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VlKSk7CiAgICAgICAgICAgICAgICAgaGFzSW50ZW50SW5mbyA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5lcXVhbHMoIi0tZWlhIikpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcga2V5ID0gbmV4dEFyZ1JlcXVpcmVkKCk7CisgICAgICAgICAgICAgICAgU3RyaW5nIHZhbHVlID0gbmV4dEFyZ1JlcXVpcmVkKCk7CisgICAgICAgICAgICAgICAgU3RyaW5nW10gc3RyaW5ncyA9IHZhbHVlLnNwbGl0KCIsIik7CisgICAgICAgICAgICAgICAgaW50W10gbGlzdCA9IG5ldyBpbnRbc3RyaW5ncy5sZW5ndGhdOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3RyaW5ncy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBsaXN0W2ldID0gSW50ZWdlci52YWx1ZU9mKHN0cmluZ3NbaV0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoa2V5LCBsaXN0KTsKKyAgICAgICAgICAgICAgICBoYXNJbnRlbnRJbmZvID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLS1lbCIpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShrZXksIExvbmcudmFsdWVPZih2YWx1ZSkpOworICAgICAgICAgICAgICAgIGhhc0ludGVudEluZm8gPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmIChvcHQuZXF1YWxzKCItLWVsYSIpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICAgICAgICAgIFN0cmluZ1tdIHN0cmluZ3MgPSB2YWx1ZS5zcGxpdCgiLCIpOworICAgICAgICAgICAgICAgIGxvbmdbXSBsaXN0ID0gbmV3IGxvbmdbc3RyaW5ncy5sZW5ndGhdOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3RyaW5ncy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBsaXN0W2ldID0gTG9uZy52YWx1ZU9mKHN0cmluZ3NbaV0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoa2V5LCBsaXN0KTsKKyAgICAgICAgICAgICAgICBoYXNJbnRlbnRJbmZvID0gdHJ1ZTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLS1leiIpKSB7CiAgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IG5leHRBcmdSZXF1aXJlZCgpOwogICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IG5leHRBcmdSZXF1aXJlZCgpOwpAQCAtNDMwLDYgKzQ1NywyOCBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIHJ1bkR1bXBIZWFwKCkgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgICAgIGJvb2xlYW4gbWFuYWdlZCA9ICEiLW4iLmVxdWFscyhuZXh0T3B0aW9uKCkpOworICAgICAgICBTdHJpbmcgcHJvY2VzcyA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICBTdHJpbmcgaGVhcEZpbGUgPSBuZXh0QXJnUmVxdWlyZWQoKTsKKyAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IgZmQgPSBudWxsOworCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBmZCA9IFBhcmNlbEZpbGVEZXNjcmlwdG9yLm9wZW4oCisgICAgICAgICAgICAgICAgICAgIG5ldyBGaWxlKGhlYXBGaWxlKSwKKyAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9DUkVBVEUgfAorICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX1RSVU5DQVRFIHwKKyAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9SRUFEX1dSSVRFKTsKKyAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiRXJyb3I6IFVuYWJsZSB0byBvcGVuIGZpbGU6ICIgKyBoZWFwRmlsZSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1BbS5kdW1wSGVhcChwcm9jZXNzLCBtYW5hZ2VkLCBoZWFwRmlsZSwgZmQpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgQW5kcm9pZEV4Y2VwdGlvbigiSEVBUCBEVU1QIEZBSUxFRCBvbiBwcm9jZXNzICIgKyBwcm9jZXNzKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIGNsYXNzIE15QWN0aXZpdHlDb250cm9sbGVyIGV4dGVuZHMgSUFjdGl2aXR5Q29udHJvbGxlci5TdHViIHsKICAgICAgICAgZmluYWwgU3RyaW5nIG1HZGJQb3J0OwogCkBAIC04OTQsOCArOTQzLDE1IEBACiAgICAgICAgICAgICAgICAgIiAgICAgICAgLXAgPEZJTEU+OiB3cml0ZSBwcm9maWxpbmcgZGF0YSB0byA8RklMRT5cbiIgKwogICAgICAgICAgICAgICAgICIgICAgICAgIC13OiB3YWl0IGZvciBpbnN0cnVtZW50YXRpb24gdG8gZmluaXNoIGJlZm9yZSByZXR1cm5pbmdcbiIgKwogICAgICAgICAgICAgICAgICJcbiIgKworICAgICAgICAgICAgICAgICIgICAgcnVuIGEgdGVzdCBwYWNrYWdlIGFnYWluc3QgYW4gYXBwbGljYXRpb246IGFtIGluc3RydW1lbnQgW2ZsYWdzXSA8VEVTVF9QQUNLQUdFPi88UlVOTkVSX0NMQVNTPlxuIiArCisgICAgICAgICAgICAgICAgIiAgICAgICAgLWUgPHRlc3RydW5uZXJfZmxhZz4gPHRlc3RydW5uZXJfdmFsdWU+IFssPHRlc3RydW5uZXJfdmFsdWU+XVxuIiArCisgICAgICAgICAgICAgICAgIiAgICAgICAgLXcgd2FpdCBmb3IgdGhlIHRlc3QgdG8gZmluaXNoIChyZXF1aXJlZClcbiIgKworICAgICAgICAgICAgICAgICIgICAgICAgIC1yIHVzZSB3aXRoIC1lIHBlcmYgdHJ1ZSB0byBnZW5lcmF0ZSByYXcgb3V0cHV0IGZvciBwZXJmb3JtYW5jZSBtZWFzdXJlbWVudHNcbiIgKworICAgICAgICAgICAgICAgICJcbiIgKwogICAgICAgICAgICAgICAgICIgICAgc3RhcnQgcHJvZmlsaW5nOiBhbSBwcm9maWxlIDxQUk9DRVNTPiBzdGFydCA8RklMRT5cbiIgKwogICAgICAgICAgICAgICAgICIgICAgc3RvcCBwcm9maWxpbmc6IGFtIHByb2ZpbGUgPFBST0NFU1M+IHN0b3BcbiIgKworICAgICAgICAgICAgICAgICIgICAgZHVtcCBoZWFwOiBhbSBkdW1waGVhcCBbZmxhZ3NdIDxQUk9DRVNTPiA8RklMRT5cbiIgKworICAgICAgICAgICAgICAgICIgICAgICAgIC1uOiBkdW1wIG5hdGl2ZSBoZWFwIGluc3RlYWQgb2YgbWFuYWdlZCBoZWFwXG4iICsKICAgICAgICAgICAgICAgICAiXG4iICsKICAgICAgICAgICAgICAgICAiICAgIHN0YXJ0IG1vbml0b3Jpbmc6IGFtIG1vbml0b3IgWy0tZ2RiIDxwb3J0Pl1cbiIgKwogICAgICAgICAgICAgICAgICIgICAgICAgIC0tZ2RiOiBzdGFydCBnZGJzZXJ2IG9uIHRoZSBnaXZlbiBwb3J0IGF0IGNyYXNoL0FOUlxuIiArCkBAIC05MDYsNyArOTYyLDEwIEBACiAgICAgICAgICAgICAgICAgIiAgICAgICAgWy1lfC0tZXMgPEVYVFJBX0tFWT4gPEVYVFJBX1NUUklOR19WQUxVRT4gLi4uXVxuIiArCiAgICAgICAgICAgICAgICAgIiAgICAgICAgWy0tZXNuIDxFWFRSQV9LRVk+IC4uLl1cbiIgKwogICAgICAgICAgICAgICAgICIgICAgICAgIFstLWV6IDxFWFRSQV9LRVk+IDxFWFRSQV9CT09MRUFOX1ZBTFVFPiAuLi5dXG4iICsKLSAgICAgICAgICAgICAgICAiICAgICAgICBbLWV8LS1laSA8RVhUUkFfS0VZPiA8RVhUUkFfSU5UX1ZBTFVFPiAuLi5dXG4iICsKKyAgICAgICAgICAgICAgICAiICAgICAgICBbLS1laSA8RVhUUkFfS0VZPiA8RVhUUkFfSU5UX1ZBTFVFPiAuLi5dXG4iICsKKyAgICAgICAgICAgICAgICAiICAgICAgICBbLS1lbCA8RVhUUkFfS0VZPiA8RVhUUkFfTE9OR19WQUxVRT4gLi4uXVxuIiArCisgICAgICAgICAgICAgICAgIiAgICAgICAgWy0tZWlhIDxFWFRSQV9LRVk+IDxFWFRSQV9JTlRfVkFMVUU+Wyw8RVhUUkFfSU5UX1ZBTFVFLi4uXV1cbiIgKworICAgICAgICAgICAgICAgICIgICAgICAgIFstLWVsYSA8RVhUUkFfS0VZPiA8RVhUUkFfTE9OR19WQUxVRT5bLDxFWFRSQV9MT05HX1ZBTFVFLi4uXV1cbiIgKwogICAgICAgICAgICAgICAgICIgICAgICAgIFstbiA8Q09NUE9ORU5UPl0gWy1mIDxGTEFHUz5dXG4iICsKICAgICAgICAgICAgICAgICAiICAgICAgICBbLS1ncmFudC1yZWFkLXVyaS1wZXJtaXNzaW9uXSBbLS1ncmFudC13cml0ZS11cmktcGVybWlzc2lvbl1cbiIgKwogICAgICAgICAgICAgICAgICIgICAgICAgIFstLWRlYn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qYXZhCkBAIC0zODksMTEgKzM4OSwxMyBAQAogICAgICAgICAgICAgaWYgKGVyciA9PSAwKSB7CiAgICAgICAgICAgICAgICAgb2JzZXJ2ZXIud2FpdEZvckNvbXBsZXRpb24oKTsKICAgICAgICAgICAgICAgICBzZXRzID0gb2JzZXJ2ZXIuc2V0czsKLSAgICAgICAgICAgICAgICBmb3IgKFJlc3RvcmVTZXQgcyA6IHNldHMpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHMudG9rZW4gPT0gdG9rZW4pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiU2NoZWR1bGluZyByZXN0b3JlOiAiICsgcy5uYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRpZFJlc3RvcmUgPSAobVJlc3RvcmUucmVzdG9yZUFsbCh0b2tlbiwgb2JzZXJ2ZXIpID09IDApOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYgKHNldHMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKFJlc3RvcmVTZXQgcyA6IHNldHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzLnRva2VuID09IHRva2VuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJTY2hlZHVsaW5nIHJlc3RvcmU6ICIgKyBzLm5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpZFJlc3RvcmUgPSAobVJlc3RvcmUucmVzdG9yZUFsbCh0b2tlbiwgb2JzZXJ2ZXIpID09IDApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQpkaWZmIC0tZ2l0IGEvY21kcy9kdW1wc3RhdGUvZHVtcHN0YXRlLm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xuIgorCQkpOwogfQogCiBpbnQgbWFpbihpbnQgYXJnYywgY2hhciAqYXJndltdKSB7CiAgICAgaW50IGRvX2FkZF9kYXRlID0gMDsKICAgICBpbnQgZG9fY29tcHJlc3MgPSAwOwogICAgIGNoYXIqIHVzZV9vdXRmaWxlID0gMDsKKyAgICBjaGFyKiBiZWdpbl9zb3VuZCA9IDA7CisgICAgY2hhciogZW5kX3NvdW5kID0gMDsKICAgICBpbnQgdXNlX3NvY2tldCA9IDA7CisgICAgaW50IGRvX2ZiID0gMDsKIAogICAgIExPR0koImJlZ2luXG4iKTsKIApAQCAtMTkxLDEzICsyMTksMTYgQEAKICAgICBkdW1wX3RyYWNlc19wYXRoID0gZHVtcF92bV90cmFjZXMoKTsKIAogICAgIGludCBjOwotICAgIHdoaWxlICgoYyA9IGdldG9wdChhcmdjLCBhcmd2LCAiZGhvOnN2eiIpKSAhPSAtMSkgeworICAgIHdoaWxlICgoYyA9IGdldG9wdChhcmdjLCBhcmd2LCAiYjpkZTpobzpzdnpwIikpICE9IC0xKSB7CiAgICAgICAgIHN3aXRjaCAoYykgeworICAgICAgICAgICAgY2FzZSAnYic6IGJlZ2luX3NvdW5kID0gb3B0YXJnOyAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlICdkJzogZG9fYWRkX2RhdGUgPSAxOyAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgJ2UnOiBlbmRfc291bmQgPSBvcHRhcmc7ICAgIGJyZWFrOwogICAgICAgICAgICAgY2FzZSAnbyc6IHVzZV9vdXRmaWxlID0gb3B0YXJnOyAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlICdzJzogdXNlX3NvY2tldCA9IDE7ICAgICAgICBicmVhazsKICAgICAgICAgICAgIGNhc2UgJ3YnOiBicmVhazsgIC8vIGNvbXBhdGliaWxpdHkgbm8tb3AKICAgICAgICAgICAgIGNhc2UgJ3onOiBkb19jb21wcmVzcyA9IDY7ICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAncCc6IGRvX2ZiID0gMTsgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlICc/JzogcHJpbnRmKCJcbiIpOwogICAgICAgICAgICAgY2FzZSAnaCc6CiAgICAgICAgICAgICAgICAgdXNhZ2UoKTsKQEAgLTI0Niw2ICsyNzcsMTAgQEAKICAgICAgICAgICAgIHN0cmZ0aW1lKGRhdGUsIHNpemVvZihkYXRlKSwgIi0lWS0lbS0lZC0lSC0lTS0lUyIsIGxvY2FsdGltZSgmbm93KSk7CiAgICAgICAgICAgICBzdHJsY2F0KHBhdGgsIGRhdGUsIHNpemVvZihwYXRoKSk7CiAgICAgICAgIH0KKyAgICAgICAgaWYgKGRvX2ZiKSB7CisgICAgICAgICAgICBzdHJsY3B5KHNjcmVlbnNob3RfcGF0aCwgcGF0aCwgc2l6ZW9mKHNjcmVlbnNob3RfcGF0aCkpOworICAgICAgICAgICAgc3RybGNhdChzY3JlZW5zaG90X3BhdGgsICIucG5nIiwgc2l6ZW9mKHNjcmVlbnNob3RfcGF0aCkpOworICAgICAgICB9CiAgICAgICAgIHN0cmxjYXQocGF0aCwgIi50eHQiLCBzaXplb2YocGF0aCkpOwogICAgICAgICBpZiAoZG9fY29tcHJlc3MpIHN0cmxjYXQocGF0aCwgIi5neiIsIHNpemVvZihwYXRoKSk7CiAgICAgICAgIHN0cmxjcHkodG1wX3BhdGgsIHBhdGgsIHNpemVvZih0bXBfcGF0aCkpOwpAQCAtMjUzLDE2ICsyODgsMTggQEAKICAgICAgICAgZ3ppcF9waWQgPSByZWRpcmVjdF90b19maWxlKHN0ZG91dCwgdG1wX3BhdGgsIGRvX2NvbXByZXNzKTsKICAgICB9CiAKLSAgICAvKiBienp6enp6ICovCi0gICAgaWYgKHZpYnJhdG9yKSB7CisgICAgaWYgKGJlZ2luX3NvdW5kKSB7CisgICAgICAgIHBsYXlfc291bmQoYmVnaW5fc291bmQpOworICAgIH0gZWxzZSBpZiAodmlicmF0b3IpIHsKICA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GludCBmYjsKKyAgICBjaGFyIGltZ2J1ZlsweDEwMDAwXTsKKyAgICBzdHJ1Y3QgZmJfdmFyX3NjcmVlbmluZm8gdmluZm87CisgICAgcG5nX3N0cnVjdHAgcG5nOworICAgIHBuZ19pbmZvcCBpbmZvOworICAgIHVuc2lnbmVkIGludCByLGMscm93bGVuOworICAgIHVuc2lnbmVkIGludCBieXRlc3BwLG9mZnNldDsKKworICAgIGZiID0gZmlsZW5vKGZiX2luKTsKKyAgICBpZihmYiA8IDApIHsKKyAgICAgICAgTE9HRSgiZmFpbGVkIHRvIG9wZW4gZnJhbWVidWZmZXJcbiIpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGZiX2luID0gZmRvcGVuKGZiLCAiciIpOworCisgICAgaWYoaW9jdGwoZmIsIEZCSU9HRVRfVlNDUkVFTklORk8sICZ2aW5mbykgPCAwKSB7CisgICAgICAgIExPR0UoImZhaWxlZCB0byBnZXQgZnJhbWVidWZmZXIgaW5mb1xuIik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgZmNudGwoZmIsIEZfU0VURkQsIEZEX0NMT0VYRUMpOworCisgICAgcG5nID0gcG5nX2NyZWF0ZV93cml0ZV9zdHJ1Y3QoUE5HX0xJQlBOR19WRVJfU1RSSU5HLCBOVUxMLCBOVUxMLCBOVUxMKTsKKyAgICBpZiAocG5nID09IE5VTEwpIHsKKyAgICAgICAgTE9HRSgiZmFpbGVkIHBuZ19jcmVhdGVfd3JpdGVfc3RydWN0XG4iKTsKKyAgICAgICAgZmNsb3NlKGZiX2luKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBuZ19pbml0X2lvKHBuZywgZmJfb3V0KTsKKyAgICBpbmZvID0gcG5nX2NyZWF0ZV9pbmZvX3N0cnVjdChwbmcpOworICAgIGlmIChpbmZvID09IE5VTEwpIHsKKyAgICAgICAgTE9HRSgiZmFpbGVkIHBuZ19jcmVhdGVfaW5mb19zdHJ1Y3RcbiIpOworICAgICAgICBwbmdfZGVzdHJveV93cml0ZV9zdHJ1Y3QoJnBuZywgTlVMTCk7CisgICAgICAgIGZjbG9zZShmYl9pbik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaWYgKHNldGptcChwbmdfam1wYnVmKHBuZykpKSB7CisgICAgICAgIExPR0UoImZhaWxlZCBwbmcgc2V0am1wXG4iKTsKKyAgICAgICAgcG5nX2Rlc3Ryb3lfd3JpdGVfc3RydWN0KCZwbmcsIE5VTEwpOworICAgICAgICBmY2xvc2UoZmJfaW4pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgYnl0ZXNwcCA9IHZpbmZvLmJpdHNfcGVyX3BpeGVsIC8gODsKKyAgICBwbmdfc2V0X0lIRFIocG5nLCBpbmZvLAorICAgICAgICB2aW5mby54cmVzLCB2aW5mby55cmVzLCB2aW5mby5iaXRzX3Blcl9waXhlbCAvIDQsIAorICAgICAgICBQTkdfQ09MT1JfVFlQRV9SR0JfQUxQSEEsIFBOR19JTlRFUkxBQ0VfTk9ORSwKKyAgICAgICAgUE5HX0NPTVBSRVNTSU9OX1RZUEVfQkFTRSwgUE5HX0ZJTFRFUl9UWVBFX0JBU0UpOworICAgIHBuZ193cml0ZV9pbmZvKHBuZywgaW5mbyk7CisKKyAgICByb3dsZW49dmluZm8ueHJlcyAqIGJ5dGVzcHA7CisgICAgaWYgKHJvd2xlbiA+IHNpemVvZihpbWdidWYpKSB7CisgICAgICAgIExPR0UoImNyYXp5IHJvd2xlbjogJWRcbiIsIHJvd2xlbik7CisgICAgICAgIHBuZ19kZXN0cm95X3dyaXRlX3N0cnVjdCgmcG5nLCBOVUxMKTsKKyAgICAgICAgZmNsb3NlKGZiX2luKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIG9mZnNldCA9IHZpbmZvLnhvZmZzZXQgKiBieXRlc3BwICsgdmluZm8ueHJlcyAqIHZpbmZvLnlvZmZzZXQgKiBieXRlc3BwOworICAgIGZzZWVrKGZiX2luLCBvZmZzZXQsIFNFRUtfU0VUKTsKKworICAgIGZvcihyPTA7IHI8dmluZm8ueXJlczsgcisrKSB7CisgICAgICAgIGludCBsZW4gPSBmcmVhZChpbWdidWYsIDEsIHJvd2xlbiwgZmJfaW4pOworICAgICAgICBpZiAobGVuIDw9IDApIGJyZWFrOworICAgICAgICBwbmdfd3JpdGVfcm93KHBuZywgKHBuZ19ieXRlcClpbWdidWYpOworICAgIH0KKworICAgIHBuZ193cml0ZV9lbmQocG5nLCBpbmZvKTsKKyAgICBmY2xvc2UoZmJfaW4pOworICAgIHBuZ19kZXN0cm95X3dyaXRlX3N0cnVjdCgmcG5nLCBOVUxMKTsKK30KKwordm9pZCBmb3JrX3NvdW5kKGNvbnN0IGNoYXIqIHBhdGgpIHsKKyAgICBwaWRfdCBwaWQgPSBmb3JrKCk7CisgICAgaWYgKHBpZCA9PSAwKSB7CisgICAgICAgIGV4ZWNsKCIvc3lzdGVtL2Jpbi9zdGFnZWZyaWdodCIsICJzdGFnZWZyaWdodCIsICItbyIsICItYSIsIHBhdGgsIE5VTEwpOworICAgIH0KK30KKwordm9pZCB1c2FnZSgpIHsKKyAgICBmcHJpbnRmKHN0ZGVyciwKKyAgICAgICAgICAgICJ1c2FnZTogc2NyZWVuc2hvdCBbLXMgc291bmRmaWxlXSBmaWxlbmFtZS5wbmdcbiIKKyAgICAgICAgICAgICIgICAtczogcGxheSBhIHNvdW5kIGVmZmVjdCB0byBzaWduYWwgc3VjY2Vzc1xuIgorICAgICAgICAgICAgIiAgIC1pOiBhdXRvaW5jcmVtZW50IHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZpbGVuYW1lLnBuZ1xuIgorICAgICk7Cit9CisKK2ludCBtYWluKGludCBhcmdjLCBjaGFyKiphcmd2KSB7CisgICAgRklMRSAqcG5nID0gTlVMTDsKKyAgICBGSUxFICpmYl9pbiA9IE5VTEw7CisgICAgY2hhciBvdXRmaWxlW1BBVEhfTUFYXSA9ICIiOworCisgICAgY2hhciAqIHNvdW5kZmlsZSA9IE5VTEw7CisgICAgaW50IGRvX2luY3JlbWVudCA9IDA7CisKKyAgICBpbnQgYzsKKyAgICB3aGlsZSAoKGMgPSBnZXRvcHQoYXJnYywgYXJndiwgInM6aSIpKSAhPSAtMSkgeworICAgICAgICBzd2l0Y2ggKGMpIHsKKyAgICAgICAgICAgIGNhc2UgJ3MnOiBzb3VuZGZpbGUgPSBvcHRhcmc7IGJyZWFrOworICAgICAgICAgICAgY2FzZSAnaSc6IGRvX2luY3JlbWVudCA9IDE7IGJyZWFrOworICAgICAgICAgICAgY2FzZSAnPyc6CisgICAgICAgICAgICBjYXNlICdoJzoKKyAgICAgICAgICAgICAgICB1c2FnZSgpOyBleGl0KDEpOworICAgICAgICB9CisgICAgfQorICAgIGFyZ2MgLT0gb3B0aW5kOworICAgIGFyZ3YgKz0gb3B0aW5kOworCisgICAgaWYgKGFyZ2MgPCAxKSB7CisgICAgICAgIHVzYWdlKCk7IGV4aXQoMSk7CisgICAgfQorCisgICAgc3RybGNweShvdXRmaWxlLCBhcmd2WzBdLCBQQVRIX01BWCk7CisgICAgaWYgKGRvX2luY3JlbWVudCkgeworICAgICAgICBzdHJ1Y3Qgc3RhdCBzdDsKKyAgICAgICAgY2hhciBiYXNlW1BBVEhfTUFYXSA9ICIiOworICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgIHdoaWxlIChzdGF0KG91dGZpbGUsICZzdCkgPT0gMCkgeworICAgICAgICAgICAgaWYgKCFiYXNlWzBdKSB7CisgICAgICAgICAgICAgICAgY2hhciAqcCA9IHN0cnJjaHIob3V0ZmlsZSwgJy4nKTsKKyAgICAgICAgICAgICAgICBpZiAocCkgKnAgPSAnXDAnOworICAgICAgICAgICAgICAgIHN0cmNweShiYXNlLCBvdXRmaWxlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNucHJpbnRmKG91dGZpbGUsIFBBVEhfTUFYLCAiJXMtJWQucG5nIiwgYmFzZSwgKytpKTsKKyAgICAgICAgfQ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yAgICAgICAgbU51bUZyYW1lc091dHB1dCA9IDA7CisgICAgICAgIHJldHVybiBPSzsKKyAgICB9CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IHN0b3AoKSB7CisgICAgICAgIHJldHVybiBPSzsKKyAgICB9CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IHJlYWQoCisgICAgICAgICAgICBNZWRpYUJ1ZmZlciAqKmJ1ZmZlciwgY29uc3QgTWVkaWFTb3VyY2U6OlJlYWRPcHRpb25zICpvcHRpb25zKSB7CisKKyAgICAgICAgaWYgKG1OdW1GcmFtZXNPdXRwdXQgJSAxMCA9PSAwKSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIi4iKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobU51bUZyYW1lc091dHB1dCA9PSBtTWF4TnVtRnJhbWVzKSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfRU5EX09GX1NUUkVBTTsKKyAgICAgICAgfQorCisgICAgICAgIHN0YXR1c190IGVyciA9IG1Hcm91cC5hY3F1aXJlX2J1ZmZlcihidWZmZXIpOworICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICB9CisKKyAgICAgICAgLy8gV2UgZG9uJ3QgY2FyZSBhYm91dCB0aGUgY29udGVudHMuIHdlIGp1c3QgdGVzdCB2aWRlbyBlbmNvZGVyCisgICAgICAgIC8vIEFsc28sIGJ5IHNraXBwaW5nIHRoZSBjb250ZW50IGdlbmVyYXRpb24sIHdlIGNhbiByZXR1cm4gZnJvbQorICAgICAgICAvLyByZWFkKCkgbXVjaCBmYXN0ZXIuCisgICAgICAgIC8vY2hhciB4ID0gKGNoYXIpKChkb3VibGUpcmFuZCgpIC8gUkFORF9NQVggKiAyNTUpOworICAgICAgICAvL21lbXNldCgoKmJ1ZmZlciktPmRhdGEoKSwgeCwgbVNpemUpOworICAgICAgICAoKmJ1ZmZlciktPnNldF9yYW5nZSgwLCBtU2l6ZSk7CisgICAgICAgICgqYnVmZmVyKS0+bWV0YV9kYXRhKCktPmNsZWFyKCk7CisgICAgICAgICgqYnVmZmVyKS0+bWV0YV9kYXRhKCktPnNldEludDY0KAorICAgICAgICAgICAgICAgIGtLZXlUaW1lLCAobU51bUZyYW1lc091dHB1dCAqIDEwMDAwMDApIC8gbUZyYW1lUmF0ZSk7CisgICAgICAgICsrbU51bUZyYW1lc091dHB1dDsKKworICAgICAgICByZXR1cm4gT0s7CisgICAgfQorCitwcm90ZWN0ZWQ6CisgICAgdmlydHVhbCB+RHVtbXlTb3VyY2UoKSB7fQorCitwcml2YXRlOgorICAgIE1lZGlhQnVmZmVyR3JvdXAgbUdyb3VwOworICAgIGludCBtV2lkdGgsIG1IZWlnaHQ7CisgICAgaW50IG1NYXhOdW1GcmFtZXM7CisgICAgaW50IG1GcmFtZVJhdGU7CisgICAgaW50IG1Db2xvckZvcm1hdDsKKyAgICBzaXplX3QgbVNpemU7CisgICAgaW50NjRfdCBtTnVtRnJhbWVzT3V0cHV0OzsKKworICAgIER1bW15U291cmNlKGNvbnN0IER1bW15U291cmNlICYpOworICAgIER1bW15U291cmNlICZvcGVyYXRvcj0oY29uc3QgRHVtbXlTb3VyY2UgJik7Cit9OworCitlbnVtIHsKKyAgICBrWVVWNDIwU1AgPSAwLAorICAgIGtZVVY0MjBQICA9IDEsCit9OworCisvLyByZXR1cm5zIC0xIGlmIG1hcHBpbmcgb2YgdGhlIGdpdmVuIGNvbG9yIGlzIHVuc3VjY2Vzc2Z1bAorLy8gcmV0dXJucyBhbiBvbXggY29sb3IgZW51bSB2YWx1ZSBvdGhlcndpc2UKK3N0YXRpYyBpbnQgdHJhbnNsYXRlQ29sb3JUb09teEVudW1WYWx1ZShpbnQgY29sb3IpIHsKKyAgICBzd2l0Y2ggKGNvbG9yKSB7CisgICAgICAgIGNhc2Uga1lVVjQyMFNQOgorICAgICAgICAgICAgcmV0dXJuIE9NWF9DT0xPUl9Gb3JtYXRZVVY0M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IHsKKyAgICAgICAgc3dpdGNoIChyZXMpIHsKKyAgICAgICAgICAgIGNhc2UgJ2InOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJpdFJhdGVCcHMgPSBhdG9pKG9wdGFyZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNhc2UgJ2MnOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNvbG9yRm9ybWF0ID0gdHJhbnNsYXRlQ29sb3JUb09teEVudW1WYWx1ZShhdG9pKG9wdGFyZykpOworICAgICAgICAgICAgICAgIGlmIChjb2xvckZvcm1hdCA9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICB1c2FnZShhcmd2WzBdKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNhc2UgJ2YnOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZyYW1lUmF0ZUZwcyA9IGF0b2kob3B0YXJnKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2FzZSAnaSc6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaUZyYW1lc0ludGVydmFsU2Vjb25kcyA9IGF0b2kob3B0YXJnKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2FzZSAnbic6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbkZyYW1lcyA9IGF0b2kob3B0YXJnKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2FzZSAndyc6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgd2lkdGggPSBhdG9pKG9wdGFyZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNhc2UgJ3QnOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhlaWdodCA9IGF0b2kob3B0YXJnKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2FzZSAnbCc6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGV2ZWwgPSBhdG9pKG9wdGFyZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNhc2UgJ3AnOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHByb2ZpbGUgPSBhdG9pKG9wdGFyZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNhc2UgJ3YnOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNvZGVjID0gYXRvaShvcHRhcmcpOworICAgICAgICAgICAgICAgIGlmIChjb2RlYyA8IDAgfHwgY29kZWMgPiAyKSB7CisgICAgICAgICAgICAgICAgICAgIHVzYWdlKGFyZ3ZbMF0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2FzZSAnaCc6CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHVzYWdlKGFyZ3ZbMF0pOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgT01YQ2xpZW50IGNsaWVudDsKKyAgICBDSEVDS19FUShjbGllbnQuY29ubmVjdCgpLCBPSyk7CisKKyAgICBzdGF0dXNfdCBlcnIgPSBPSzsKKyAgICBzcDxNZWRpYVNvdXJjZT4gc291cmNlID0KKyAgICAgICAgbmV3IER1bW15U291cmNlKHdpZHRoLCBoZWlnaHQsIG5GcmFtZXMsIGZyYW1lUmF0ZUZwcywgY29sb3JGb3JtYXQpOworCisgICAgc3A8TWV0YURhdGE+IGVuY19tZXRhID0gbmV3IE1ldGFEYXRhOworICAgIHN3aXRjaCAoY29kZWMpIHsKKyAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgZW5jX21ldGEtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCBNRURJQV9NSU1FVFlQRV9WSURFT19NUEVHNCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgZW5jX21ldGEtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCBNRURJQV9NSU1FVFlQRV9WSURFT19IMjYzKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgZW5jX21ldGEtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCBNRURJQV9NSU1FVFlQRV9WSURFT19BVkMpOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorICAgIGVuY19tZXRhLT5zZXRJbnQzMihrS2V5V2lkdGgsIHdpZHRoKTsKKyAgICBlbmNfbWV0YS0+c2V0SW50MzIoa0tleUhlaWdodCwgaGVpZ2h0KTsKKyAgICBlbmNfbWV0YS0+c2V0SW50MzIoa0tleVNhbXBsZVJhdGUsIGZyYW1lUmF0ZUZwcyk7CisgICAgZW5jX21ldGEtPnNldEludDMyKGtLZXlCaXRSYXRlLCBiaXRSYXRlQnBzKTsKKyAgICBlbmNfbWV0YS0+c2V0SW50MzIoa0tleVN0cmlkZSwgd2lkdGgpOworICAgIGVuY19tZXRhLT5zZXRJbnQzMihrS2V5U2xpY2VIZWlnaHQsIGhlaWdodCk7CisgICAgZW5jX21ldGEtPnNldEludDMyKGtLZXlJRnJhbWVzSW50ZXJ2YWwsIGlGcmFtZXNJbnRlcnZhbFNlY29uZHMpOworICAgIGVuY19tZXRhLT5zZXRJbnQzMihrS2V5Q29sb3JGb3JtYXQsIGNvbG9yRm9ybWF0KTsKKyAgICBpZiAobGV2ZWwgIT0gLTEpIHsKKyAgICAgICAgZW5jX21ldGEtPnNldEludDMyKGtLZXlWaWRlb0xldmVsLCBsZXZlbCk7CisgICAgfQorICAgIGlmIChwcm9maWxlICE9IC0xKSB7CisgICAgICAgIGVuY19tZXRhLT5zZXRJbnQzMihrS2V5VmlkZW9Qcm9maWxlLCBwcm9maWxlKTsKKyAgICB9CisKKyAgICBzcDxNZWRpYVNvdXJjZT4gZW5jb2RlciA9CisgICAgICAgIE9NWENvZGVjOjpDcmVhdGUoCisgICAgICAgICAgICAgICAgY2xpZW50LmludGVyZmFjZSgpLCBlbmNfbWV0YSwgdHJ1ZSAvKiBjcmVhdGVFbmNvZGVyICovLCBzb3VyY2UpOworCisgICAgc3A8TVBFRzRXcml0ZXI+IHdyaXRlciA9IG5ldyBNUEVHNFdyaXRlcihmaWxlTmFtZSk7CisgICAgd3JpdGVyLT5hZGRTb3VyY2UoZW5jb2Rlcik7CisgICAgaW50NjRfdCBzdGFydCA9IHN5c3RlbVRpbWUoKTsKKyAgICBDSEVDS19FUShPSywgd3JpdGVyLT5zdGFydCgpKTsKKyAgICB3aGlsZSAoIXdyaXRlci0+cmVhY2hlZEVPUygpKSB7CisgICAgfQorICAgIGVyciA9IHdyaXRlci0+c3RvcCgpOworICAgIGludDY0X3QgZW5kID0gc3lzdGVtVGltZSgpOworCisgICAgZnByaW50ZihzdGRlcnIsICIkXG4iKTsKKyAgICBjbGllbnQuZGlzY29ubmVjdCgpOworCisgICAgaWYgKGVyciAhPSBPSyAmJiBlcnIgIT0gRVJST1JfRU5EX09GX1NUUkVBTSkgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgInJlY29yZCBmYWlsZWQ6ICVkXG4iLCBlcnIpOworICAgICAgICByZXR1cm4gMTsKKyAgICB9CisgICAgZnByaW50ZihzdGRlcnIsICJlbmNvZGluZyAlZCBmcmFtZXMgaW4gJWxsZCB1c1xuIiwgbkZyYW1lcywgKGVuZC1zdGFydCkvMTAwMCk7CisgICAgZnByaW50ZihzdGRlcnIsICJlbmN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3Qgd2FudCBpdCB0byBwZXJzaXN0IGluIHRoZSBkYi4gSXQgaXMgaW5zdGVhZAorICAgICAgICAvLyB1c2VkIGFzIGEgY29udHJvbCBzaWduYWwgdG8gaW5kaWNhdGUgd2hldGhlciBvciBub3QgdGhpcyBpbnNlcnRpb24gc2hvdWxkIHJlc3VsdCBpbgorICAgICAgICAvLyBhbiBhY2NvdW50cyBjaGFuZ2VkIGJyb2FkY2FzdCBiZWluZyBzZW50LgorICAgICAgICBpZiAoZXh0cmFzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGV4dHJhcy5yZW1vdmUoTk9fQlJPQURDQVNUX0ZMQUcpOworICAgICAgICB9CiAgICAgICAgIGRiLmJlZ2luVHJhbnNhY3Rpb24oKTsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGlmIChhY2NvdW50ID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBib29sZWFuIG5vQnJvYWRjYXN0ID0gZmFsc2U7Ci0gICAgICAgICAgICBpZiAoYWNjb3VudC50eXBlLmVxdWFscyhHT09HTEVfQUNDT1VOVF9UWVBFKSkgewotICAgICAgICAgICAgICAgIC8vIExvb2sgZm9yIHRoZSAnbm9icm9hZGNhc3QnIGZsYWcgYW5kIHJlbW92ZSBpdCBzaW5jZSB3ZSBkb24ndCB3YW50IGl0IHRvIHBlcnNpc3QKLSAgICAgICAgICAgICAgICAvLyBpbiB0aGUgZGIuCi0gICAgICAgICAgICAgICAgbm9Ccm9hZGNhc3QgPSBleHRyYXMuZ2V0Qm9vbGVhbihOT19CUk9BRENBU1RfRkxBRywgZmFsc2UpOwotICAgICAgICAgICAgICAgIGV4dHJhcy5yZW1vdmUoTk9fQlJPQURDQVNUX0ZMQUcpOwotICAgICAgICAgICAgfQotCiAgICAgICAgICAgICBsb25nIG51bU1hdGNoZXMgPSBEYXRhYmFzZVV0aWxzLmxvbmdGb3JRdWVyeShkYiwKICAgICAgICAgICAgICAgICAgICAgInNlbGVjdCBjb3VudCgqKSBmcm9tICIgKyBUQUJMRV9BQ0NPVU5UUwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBXSEVSRSAiICsgQUNDT1VOVFNfTkFNRSArICI9PyBBTkQgIiArIEFDQ09VTlRTX1RZUEUrICI9PyIsCkBAIC00MzYsMTMgKzQzNiwxMyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGRiLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOwotICAgICAgICAgICAgaWYgKCFub0Jyb2FkY2FzdCkgewotICAgICAgICAgICAgICAgIHNlbmRBY2NvdW50c0NoYW5nZWRCcm9hZGNhc3QoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICAgZGIuZW5kVHJhbnNhY3Rpb24oKTsKICAgICAgICAgfQorICAgICAgICBpZiAoIW5vQnJvYWRjYXN0KSB7CisgICAgICAgICAgICBzZW5kQWNjb3VudHNDaGFuZ2VkQnJvYWRjYXN0KCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCiAgICAgcHJpdmF0ZSBsb25nIGluc2VydEV4dHJhKFNRTGl0ZURhdGFiYXNlIGRiLCBsb25nIGFjY291bnRJZCwgU3RyaW5nIGtleSwgU3RyaW5nIHZhbHVlKSB7CkBAIC0xNjU3LDcgKzE2NTcsNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBib29sZWFuIG5lZWRzUHJvdmlzaW9uaW5nOwogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIG5lZWRzUHJvdmlzaW9uaW5nID0gdGVsZXBob255LmdldENkbWFOZWVkc1Byb3Zpc2lvbmluZygpOworICAgICAgICAgICAgICAgICAgICBuZWVkc1Byb3Zpc2lvbmluZyA9IHRlbGVwaG9ueS5uZWVkc090YVNlcnZpY2VQcm92aXNpb25pbmcoKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJleGNlcHRpb24gd2hpbGUgY2hlY2tpbmcgcHJvdmlzaW9uaW5nIiwgZSk7CiAgICAgICAgICAgICAgICAgICAgIC8vIGRlZmF1bHQgdG8gTk9UIHdpcGluZyBvdXQgdGhlIHBhc3N3b3JkcwpAQCAtMTY4MSwxMSArMTY4MSwxMSBAQAogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIGRiLmV4ZWNTUUwoIkRFTEVURSBmcm9tICIgKyBUQUJMRV9BVVRIVE9LRU5TKTsKICAgICAgICAgICAgICAgICAgICAgZGIuZXhlY1NRTCgiVVBEQVRFICIgKyBUQUJMRV9BQ0NPVU5UUyArICIgU0VUICIgKyBBQ0NPVU5UU19QQVNTV09SRCArICIgPSAnJyIpOwotICAgICAgICAgICAgICAgICAgICBzZW5kQWNjb3VudHNDaGFuZ2VkQnJvYWRjYXN0KCk7CiAgICAgICAgICAgICAgICAgICAgIGRiLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOwogICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICAgICAgICAgIGRiLmVuZFRyYW5zYWN0aW9uKCk7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNlbmRBY2NvdW50c0NoYW5nZWRCcm9hZGNhc3QoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHNldE1ldGFWYWx1ZSgiaW1zaSIsIGltc2kpOwogICAgICAgICB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hbmltYXRpb24vQW5pbWF0b3IuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FuaW1hdGlvbi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worICAgICAgICB0cnkgeworICAgICAgICAgICAgZmluYWwgQW5pbWF0b3IgYW5pbSA9IChBbmltYXRvcikgc3VwZXIuY2xvbmUoKTsKKyAgICAgICAgICAgIGlmIChtTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBcnJheUxpc3Q8QW5pbWF0b3JMaXN0ZW5lcj4gb2xkTGlzdGVuZXJzID0gbUxpc3RlbmVyczsKKyAgICAgICAgICAgICAgICBhbmltLm1MaXN0ZW5lcnMgPSBuZXcgQXJyYXlMaXN0PEFuaW1hdG9yTGlzdGVuZXI+KCk7CisgICAgICAgICAgICAgICAgaW50IG51bUxpc3RlbmVycyA9IG9sZExpc3RlbmVycy5zaXplKCk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1MaXN0ZW5lcnM7ICsraSkgeworICAgICAgICAgICAgICAgICAgICBhbmltLm1MaXN0ZW5lcnMuYWRkKG9sZExpc3RlbmVycy5nZXQoaSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBhbmltOworICAgICAgICB9IGNhdGNoIChDbG9uZU5vdFN1cHBvcnRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgIHRocm93IG5ldyBBc3NlcnRpb25FcnJvcigpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2QgdGVsbHMgdGhlIG9iamVjdCB0byB1c2UgYXBwcm9wcmlhdGUgaW5mb3JtYXRpb24gdG8gZXh0cmFjdAorICAgICAqIHN0YXJ0aW5nIHZhbHVlcyBmb3IgdGhlIGFuaW1hdGlvbi4gRm9yIGV4YW1wbGUsIGEgQW5pbWF0b3JTZXQgb2JqZWN0IHdpbGwgcGFzcworICAgICAqIHRoaXMgY2FsbCB0byBpdHMgY2hpbGQgb2JqZWN0cyB0byB0ZWxsIHRoZW0gdG8gc2V0IHVwIHRoZSB2YWx1ZXMuI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ZXRpdGlvbiBvZiB0aGUgYW5pbWF0aW9uLjwvcD4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGludGVyZmFjZSBBbmltYXRvckxpc3RlbmVyIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPk5vdGlmaWVzIHRoZSBzdGFydCBvZiB0aGUgYW5pbWF0aW9uLjwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGFuaW1hdGlvbiBUaGUgc3RhcnRlZCBhbmltYXRpb24uCisgICAgICAgICAqLworICAgICAgICB2b2lkIG9uQW5pbWF0aW9uU3RhcnQoQW5pbWF0b3IgYW5pbWF0aW9uKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+Tm90aWZpZXMgdGhlIGVuZCBvZiB0aGUgYW5pbWF0aW9uLiBUaGlzIGNhbGxiYWNrIGlzIG5vdCBpbnZva2VkCisgICAgICAgICAqIGZvciBhbmltYXRpb25zIHdpdGggcmVwZWF0IGNvdW50IHNldCB0byBJTkZJTklURS48L3A+CisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhbmltYXRpb24gVGhlIGFuaW1hdGlvbiB3aGljaCByZWFjaGVkIGl0cyBlbmQuCisgICAgICAgICAqLworICAgICAgICB2b2lkIG9uQW5pbWF0aW9uRW5kKEFuaW1hdG9yIGFuaW1hdGlvbik7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPk5vdGlmaWVzIHRoZSBjYW5jZWxsYXRpb24gb2YgdGhlIGFuaW1hdGlvbi4gVGhpcyBjYWxsYmFjayBpcyBub3QgaW52b2tlZAorICAgICAgICAgKiBmb3IgYW5pbWF0aW9ucyB3aXRoIHJlcGVhdCBjb3VudCBzZXQgdG8gSU5GSU5JVEUuPC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gYW5pbWF0aW9uIFRoZSBhbmltYXRpb24gd2hpY2ggd2FzIGNhbmNlbGVkLgorICAgICAgICAgKi8KKyAgICAgICA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AgICAgICAgICAgcGFyc2VyID0gY29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRBbmltYXRpb24oaWQpOworICAgICAgICAgICAgcmV0dXJuIGNyZWF0ZUFuaW1hdG9yRnJvbVhtbChjb250ZXh0LCBwYXJzZXIpOworICAgICAgICB9IGNhdGNoIChYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICBSZXNvdXJjZXMuTm90Rm91bmRFeGNlcHRpb24gcm5mID0KKyAgICAgICAgICAgICAgICAgICAgbmV3IFJlc291cmNlcy5Ob3RGb3VuZEV4Y2VwdGlvbigiQ2FuJ3QgbG9hZCBhbmltYXRpb24gcmVzb3VyY2UgSUQgIzB4IiArCisgICAgICAgICAgICAgICAgICAgIEludGVnZXIudG9IZXhTdHJpbmcoaWQpKTsKKyAgICAgICAgICAgIHJuZi5pbml0Q2F1c2UoZXgpOworICAgICAgICAgICAgdGhyb3cgcm5mOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgUmVzb3VyY2VzLk5vdEZvdW5kRXhjZXB0aW9uIHJuZiA9CisgICAgICAgICAgICAgICAgICAgIG5ldyBSZXNvdXJjZXMuTm90Rm91bmRFeGNlcHRpb24oIkNhbid0IGxvYWQgYW5pbWF0aW9uIHJlc291cmNlIElEICMweCIgKworICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyLnRvSGV4U3RyaW5nKGlkKSk7CisgICAgICAgICAgICBybmYuaW5pdENhdXNlKGV4KTsKKyAgICAgICAgICAgIHRocm93IHJuZjsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChwYXJzZXIgIT0gbnVsbCkgcGFyc2VyLmNsb3NlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBBbmltYXRvciBjcmVhdGVBbmltYXRvckZyb21YbWwoQ29udGV4dCBjLCBYbWxQdWxsUGFyc2VyIHBh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9IHBhcnNlci5nZXROYW1lKCk7CisKKyAgICAgICAgICAgIGlmIChuYW1lLmVxdWFscygib2JqZWN0QW5pbWF0b3IiKSkgeworICAgICAgICAgICAgICAgIGFuaW0gPSBsb2FkT2JqZWN0QW5pbWF0b3IoYywgYXR0cnMpOworICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygiYW5pbWF0b3IiKSkgeworICAgICAgICAgICAgICAgIGFuaW0gPSBsb2FkQW5pbWF0b3IoYywgYXR0cnMsIG51bGwpOworICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygic2V0IikpIHsKKyAgICAgICAgICAgICAgICBhbmltID0gbmV3IEFuaW1hdG9yU2V0KCk7CisgICAgICAgICAgICAgICAgVHlwZWRBcnJheSBhID0gYy5vYnRhaW5TdHlsZWRBdHRyaWJ1dGVzKGF0dHJzLAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5pbWF0b3JTZXQpOworICAgICAgICAgICAgICAgIGludCBvcmRlcmluZyA9IGEuZ2V0SW50KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuaW1hdG9yU2V0X29yZGVyaW5nLAorICAgICAgICAgICAgICAgICAgICAgICAgVE9HRVRIRVIpOworICAgICAgICAgICAgICAgIGNyZWF0ZUFuaW1hdG9yRnJvbVhtbChjLCBwYXJzZXIsIGF0dHJzLCAoQW5pbWF0b3JTZXQpIGFuaW0sICBvcmRlcmluZyk7CisgICAgICAgICAgICAgICAgYS5yZWN5Y2xlKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJVbmtub3duIGFuaW1hdG9yIG5hbWU6ICIgKyBwYXJzZXIuZ2V0TmFtZSgpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBhcmVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKGNoaWxkQW5pbXMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjaGlsZEFuaW1zID0gbmV3IEFycmF5TGlzdDxBbmltYXRvcj4oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2hpbGRBbmltcy5hZGQoYW5pbSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBhcmVudCAhPSBudWxsICYmIGNoaWxkQW5pbXMgIT0gbnVsbCkgeworICAgICAgICAgICAgQW5pbWF0b3JbXSBhbmltc0FycmF5ID0gbmV3IEFuaW1hdG9yW2NoaWxkQW5pbXMuc2l6ZSgpXTsKKyAgICAgICAgICAgIGludCBpbmRleCA9IDA7CisgICAgICAgICAgICBmb3IgKEFuaW1hdG9yIGEgOiBjaGlsZEFuaW1zKSB7CisgICAgICAgICAgICAgICAgYW5pbXNBcnJheVtpbmRleCsrXSA9IGE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoc2VxdWVuY2VPcmRlcmluZyA9PSBUT0dFVEhFUikgeworICAgICAgICAgICAgICAgIHBhcmVudC5wbGF5VG9nZXRoZXIoYW5pbXNBcnJheSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHBhcmVudC5wbGF5U2VxdWVudGlhbGx5KGFuaW1zQXJyYXkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGFuaW07CisKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBPYmplY3RBbmltYXRvciBsb2FkT2JqZWN0QW5pbWF0b3IoQ29udGV4dCBjb250ZXh0LCBBdHRyaWJ1dGVTZXQgYXR0cnMpCisgICAgICAgICAgICB0aHJvd3MgTm90Rm91bmRFeGNlcHRpb24geworCisgICAgICAgIE9iamVjdEFuaW1hdG9yIGFuaW0gPSBuZXcgT2JqZWN0QW5pbWF0b3IoKTsKKworICAgICAgICBsb2FkQW5pbWF0b3IoY29udGV4dCwgYXR0cnMsIGFuaW0pOworCisgICAgICAgIFR5cGVkQXJyYXkgYSA9CisgICAgICAgICAgICAgICAgY29udGV4dC5vYnRhaW5TdHlsZWRBdHRyaWJ1dGVzKGF0dHJzLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5Qcm9wZXJ0eUFuaW1hdG9yKTsKKworICAgICAgICBTdHJpbmcgcHJvcGVydHlOYW1lID0gYS5nZXRTdHJpbmcoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuUHJvcGVydHlBbmltYXRvcl9wcm9wZXJ0eU5hbWUpOworCisgICAgICAgIGFuaW0uc2V0UHJvcGVydHlOYW1lKHByb3BlcnR5TmFtZSk7CisKKyAgICAgICAgYS5yZWN5Y2xlKCk7CisKKyAgICAgICAgcmV0dXJuIGFuaW07CisgICAgfQorCisgICAgLyoqCisgICAgICogQ3JlYXRlcyBhIG5ldyBhbmltYXRpb24gd2hvc2UgcGFyYW1ldGVycyBjb21lIGZyb20gdGhlIHNwZWNpZmllZCBjb250ZXh0IGFuZAorICAgICAqIGF0dHJpYnV0ZXMgc2V0LgorICAgICAqCisgICAgICogQHBhcmFtIGNvbnRleHQgdGhlIGFwcGxpY2F0aW9uIGVudmlyb25tZW50CisgICAgICogQHBhcmFtIGF0dHJzIHRoZSBzZXQgb2YgYXR0cmlidXRlcyBob2xkaW5nIHRoZSBhbmltYXRpb24gcGFyYW1ldGVycworICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIFZhbHVlQW5pbWF0b3IgbG9hZEFuaW1hdG9yKENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzLCBWYWx1ZUFuaW1hdG9yIGFuaW0pCisgICAgICAgICAgICB0aHJvd3MgTm90Rm91bmRFeGNlcHRpb24geworCisgICAgICAgIFR5cGVkQXJyYXkgYSA9CisgICAgICAgICAgICAgICAgY29udGV4dC5vYnRhaW5TdHls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ICAgaWYgKGhhc0Zyb20pIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWVGcm9tID0gYS5nZXRGbG9hdChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmltYXRvcl92YWx1ZUZyb20sIDBmKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhhc1RvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVRvID0gYS5nZXRGbG9hdChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmltYXRvcl92YWx1ZVRvLCAwZik7CisgICAgICAgICAgICAgICAgICAgICAgICBhbmltLnNldEZsb2F0VmFsdWVzKHZhbHVlRnJvbSwgdmFsdWVUbyk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBhbmltLnNldEZsb2F0VmFsdWVzKHZhbHVlRnJvbSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB2YWx1ZVRvID0gYS5nZXRGbG9hdChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmltYXRvcl92YWx1ZVRvLCAwZik7CisgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0RmxvYXRWYWx1ZXModmFsdWVUbyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgVkFMVUVfVFlQRV9DT0xPUjoKKyAgICAgICAgICAgICAgICBldmFsdWF0b3IgPSBuZXcgUkdCRXZhbHVhdG9yKCk7CisgICAgICAgICAgICAgICAgYW5pbS5zZXRFdmFsdWF0b3IoZXZhbHVhdG9yKTsKKyAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2ggdG8gcGljayB1cCB2YWx1ZXMKKyAgICAgICAgICAgIGNhc2UgVkFMVUVfVFlQRV9JTlQ6IHsKKyAgICAgICAgICAgICAgICBpbnQgdmFsdWVGcm9tOworICAgICAgICAgICAgICAgIGludCB2YWx1ZVRvOworICAgICAgICAgICAgICAgIGlmIChoYXNGcm9tKSB7CisgICAgICAgICAgICAgICAgICAgIHZhbHVlRnJvbSA9IGEuZ2V0SW50ZWdlcihjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmltYXRvcl92YWx1ZUZyb20sIDApOworICAgICAgICAgICAgICAgICAgICBpZiAoaGFzVG8pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlVG8gPSBhLmdldEludGVnZXIoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5pbWF0b3JfdmFsdWVUbywgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICBhbmltLnNldEludFZhbHVlcyh2YWx1ZUZyb20sIHZhbHVlVG8pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgYW5pbS5zZXRJbnRWYWx1ZXModmFsdWVGcm9tKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHZhbHVlVG8gPSBhLmdldEludGVnZXIoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5pbWF0b3JfdmFsdWVUbywgMCk7CisgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0SW50VmFsdWVzKHZhbHVlVG8pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIFZBTFVFX1RZUEVfTE9ORzogeworICAgICAgICAgICAgICAgIGludCB2YWx1ZUZyb207CisgICAgICAgICAgICAgICAgaW50IHZhbHVlVG87CisgICAgICAgICAgICAgICAgaWYgKGhhc0Zyb20pIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWVGcm9tID0gYS5nZXRJbnRlZ2VyKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuaW1hdG9yX3ZhbHVlRnJvbSwgMCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChoYXNUbykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVUbyA9IGEuZ2V0SW50ZWdlcihjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmltYXRvcl92YWx1ZVRvLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0TG9uZ1ZhbHVlcyh2YWx1ZUZyb20sIHZhbHVlVG8pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgYW5pbS5zZXRMb25nVmFsdWVzKHZhbHVlRnJvbSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB2YWx1ZVRvID0gYS5nZXRJbnRlZ2VyKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuaW1hdG9yX3ZhbHVlVG8sIDApOworICAgICAgICAgICAgICAgICAgICBhbmltLnNldExvbmdWYWx1ZXModmFsdWVUbyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgVkFMVUVfVFlQRV9ET1VCTEU6IHsKKyAgICAgICAgICAgICAgICBkb3VibGUgdmFsdWVGcm9tOworICAgICAgICAgICAgICAgIGRvdWJsZSB2YWx1ZVRvOworICAgICAgICAgICAgICAgIGlmIChoYXNGcm9tKSB7CisgICAgICAgICAgICAgICAgICAgIHZhbHVlRnJvbSA9IGEuZ2V0RmxvYXQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5pbWF0b3JfdmFsdWVGcm9tLCAwZik7CisgICAgICAgICAgICAgICAgICAgIGlmIChoYXNUbykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVUbyA9IGEuZ2V0RmxvYXQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5pbWF0b3JfdmFsdWVUbywgMGYpOworICAgICAgICAgICAgICAgICAgICAgICAgYW5pbS5zZXREb3VibGVWYWx1ZXModmFsdWVGcm9tLCB2YWx1ZVRvKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0RG91YmxlVmFsdWVzKHZhbHVlRnJvbSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB2YWx1ZVRvID0gYS5nZXRGbG9hdChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmltYXRvcl92YWx1ZVRvLCAwZik7CisgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0RG91YmxlVmFsdWVzKHZhbHVlVG8pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIFZBTFVFX1RZUEVfQ1VTVE9NOiB7CisgICAgICAgICAgICAgICAgLy8gVE9ETzogSG93IHRvIGdldCBhbiAnT2JqZWN0JyB2YWx1ZT8KKyAgICAgICAgICAgICAgICBmbG9hdCB2YWx1ZUZyb207CisgICAgICAgICAgICAgICAgZmxvYXQgdmFsdWVUbzsKKyAgICAgICAgICAgICAgICBpZiAoaGFzRnJvbSkgeworICAgICAgICAgICAgICAgICAgICB2YWx1ZUZyb20gPSBhLmdldEZsb2F0KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuaW1hdG9yX3ZhbHVlRnJvbSwgMGYpOworICAgICAgICAgICAgICAgICAgICBpZiAoaGFzVG8pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlVG8gPSBhLmdldEZsb2F0KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuaW1hdG9yX3ZhbHVlVG8sIDBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0RmxvYXRWYWx1ZXModmFsdWVGcm9tLCB2YWx1ZVRvKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0RmxvYXRWYWx1ZXModmFsdWVGcm9tKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHZhbHVlVG8gPSBhLmdldEZsb2F0KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuaW1hdG9yX3ZhbHVlVG8sIDBmKTsKKyAgICAgICAgICAgICAgICAgICAgYW5pbS5zZXRGbG9hdFZhbHVlcyh2YWx1ZVRvKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisKKyAgICAgICAgYW5pbS5zZXREdXJhdGlvbihkdXJhdGlvbik7CisgICAgICAgIGFuaW0uc2V0U3RhcnREZWxheShzdGFydERlbGF5KTsKKworICAgICAgICBpZiAoYS5oYXNWYWx1ZShjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmltYXRvcl9yZXBlYXRDb3VudCkpIHsKKyAgICAgICAgICAgIGFuaW0uc2V0UmVwZWF0Q291bnQoCisgICAgICAgICAgICAgICAgICAgIGEuZ2V0SW50KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuaW1hdG9yX3JlcGVhdENvdW50LCAwKSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGEuaGFzVmFsdWUoY29tLmFuZHJvaWQuaW50Z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dm9pZCBwbGF5VG9nZXRoZXIoQW5pbWF0b3IuLi4gaXRlbXMpIHsKKyAgICAgICAgaWYgKGl0ZW1zICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1OZWVkc1NvcnQgPSB0cnVlOworICAgICAgICAgICAgQnVpbGRlciBidWlsZGVyID0gcGxheShpdGVtc1swXSk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8IGl0ZW1zLmxlbmd0aDsgKytpKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoKGl0ZW1zW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdXAgdGhpcyBBbmltYXRvclNldCB0byBwbGF5IGVhY2ggb2YgdGhlIHN1cHBsaWVkIGFuaW1hdGlvbnMgd2hlbiB0aGUKKyAgICAgKiBwcmV2aW91cyBhbmltYXRpb24gZW5kcy4KKyAgICAgKgorICAgICAqIEBwYXJhbSBpdGVtcyBUaGUgYW5pYW10aW9ucyB0aGF0IHdpbGwgYmUgc3RhcnRlZCBvbmUgYWZ0ZXIgYW5vdGhlci4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBwbGF5U2VxdWVudGlhbGx5KEFuaW1hdG9yLi4uIGl0ZW1zKSB7CisgICAgICAgIGlmIChpdGVtcyAhPSBudWxsKSB7CisgICAgICAgICAgICBtTmVlZHNTb3J0ID0gdHJ1ZTsKKyAgICAgICAgICAgIGlmIChpdGVtcy5sZW5ndGggPT0gMSkgeworICAgICAgICAgICAgICAgIHBsYXkoaXRlbXNbMF0pOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1zLmxlbmd0aCAtIDE7ICsraSkgeworICAgICAgICAgICAgICAgICAgICBwbGF5KGl0ZW1zW2ldKS5iZWZvcmUoaXRlbXNbaSsxXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCBsaXN0IG9mIGNoaWxkIEFuaW1hdG9yIG9iamVjdHMgY29udHJvbGxlZCBieSB0aGlzCisgICAgICogQW5pbWF0b3JTZXQuIFRoaXMgaXMgYSBjb3B5IG9mIHRoZSBpbnRlcm5hbCBsaXN0OyBtb2RpZmljYXRpb25zIHRvIHRoZSByZXR1cm5lZCBsaXN0CisgICAgICogd2lsbCBub3QgYWZmZWN0IHRoZSBBbmltYXRvclNldCwgYWx0aG91Z2ggY2hhbmdlcyB0byB0aGUgdW5kZXJseWluZyBBbmltYXRvciBvYmplY3RzCisgICAgICogd2lsbCBhZmZlY3QgdGhvc2Ugb2JqZWN0cyBiZWluZyBtYW5hZ2VkIGJ5IHRoZSBBbmltYXRvclNldC4KKyAgICAgKgorICAgICAqIEByZXR1cm4gQXJyYXlMaXN0PEFuaW1hdG9yPiBUaGUgbGlzdCBvZiBjaGlsZCBhbmltYXRpb25zIG9mIHRoaXMgQW5pbWF0b3JTZXQuCisgICAgICovCisgICAgcHVibGljIEFycmF5TGlzdDxBbmltYXRvcj4gZ2V0Q2hpbGRBbmltYXRpb25zKCkgeworICAgICAgICBBcnJheUxpc3Q8QW5pbWF0b3I+IGNoaWxkTGlzdCA9IG5ldyBBcnJheUxpc3Q8QW5pbWF0b3I+KCk7CisgICAgICAgIGZvciAoTm9kZSBub2RlIDogbU5vZGVzKSB7CisgICAgICAgICAgICBjaGlsZExpc3QuYWRkKG5vZGUuYW5pbWF0aW9uKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gY2hpbGRMaXN0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIHRhcmdldCBvYmplY3QgZm9yIGFsbCBjdXJyZW50IHtAbGluayAjZ2V0Q2hpbGRBbmltYXRpb25zKCkgY2hpbGQgYW5pbWF0aW9uc30KKyAgICAgKiBvZiB0aGlzIEFuaW1hdG9yU2V0IHRoYXQgdGFrZSB0YXJnZXRzICh7QGxpbmsgT2JqZWN0QW5pbWF0b3J9IGFuZAorICAgICAqIEFuaW1hdG9yU2V0KS4KKyAgICAgKgorICAgICAqIEBwYXJhbSB0YXJnZXQgVGhlIG9iamVjdCBiZWluZyBhbmltYXRlZAorICAgICAqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldFRhcmdldChPYmplY3QgdGFyZ2V0KSB7CisgICAgICAgIGZvciAoTm9kZSBub2RlIDogbU5vZGVzKSB7CisgICAgICAgICAgICBBbmltYXRvciBhbmltYXRpb24gPSBub2RlLmFuaW1hdGlvbjsKKyAgICAgICAgICAgIGlmIChhbmltYXRpb24gaW5zdGFuY2VvZiBBbmltYXRvclNldCkgeworICAgICAgICAgICAgICAgICgoQW5pbWF0b3JTZXQpYW5pbWF0aW9uKS5zZXRUYXJnZXQodGFyZ2V0KTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYW5pbWF0aW9uIGluc3RhbmNlb2YgT2JqZWN0QW5pbWF0b3IpIHsKKyAgICAgICAgICAgICAgICAoKE9iamVjdEFuaW1hdG9yKWFuaW1hdGlvbikuc2V0VGFyZ2V0KHRhcmdldCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXRzIHRoZSBUaW1lSW50ZXJwb2xhdG9yIGZvciBhbGwgY3VycmVudCB7QGxpbmsgI2dldENoaWxkQW5pbWF0aW9ucygpIGNoaWxkIGFuaW1hdGlvbnN9CisgICAgICogb2YgdGhpcyBBbmltYXRvclNldC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBpbnRlcnBvbGF0b3IgdGhlIGludGVycG9sYXRvciB0byBiZSB1c2VkIGJ5IGVhY2ggY2hpbGQgYW5pbWF0aW9uIG9mIHRoaXMgQW5pbWF0b3JTZXQKKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXRJb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b2RlPiBvYmplY3QuIEEgbnVsbCBwYXJhbWV0ZXIgd2lsbCByZXN1bHQKKyAgICAgKiBpbiBhIG51bGwgPGNvZGU+QnVpbGRlcjwvY29kZT4gcmV0dXJuIHZhbHVlLgorICAgICAqIEByZXR1cm4gQnVpbGRlciBUaGUgb2JqZWN0IHRoYXQgY29uc3RydWN0cyB0aGUgQW5pbWF0b3JTZXQgYmFzZWQgb24gdGhlIGRlcGVuZGVuY2llcworICAgICAqIG91dGxpbmVkIGluIHRoZSBjYWxscyB0byA8Y29kZT5wbGF5PC9jb2RlPiBhbmQgdGhlIG90aGVyIG1ldGhvZHMgaW4gdGhlCisgICAgICogPGNvZGU+QnVpbGRlcjwvY29kZSBvYmplY3QuCisgICAgICovCisgICAgcHVibGljIEJ1aWxkZXIgcGxheShBbmltYXRvciBhbmltKSB7CisgICAgICAgIGlmIChhbmltICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1OZWVkc1NvcnQgPSB0cnVlOworICAgICAgICAgICAgcmV0dXJuIG5ldyBCdWlsZGVyKGFuaW0pOworICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKgorICAgICAqIDxwPk5vdGUgdGhhdCBjYW5jZWxpbmcgYSA8Y29kZT5BbmltYXRvclNldDwvY29kZT4gYWxzbyBjYW5jZWxzIGFsbCBvZiB0aGUgYW5pbWF0aW9ucyB0aGF0IGl0IGlzCisgICAgICogcmVzcG9uc2libGUgZm9yLjwvcD4KKyAgICAgKi8KKyAgICBAU3VwcHJlc3NXYXJuaW5ncygidW5jaGVja2VkIikKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBjYW5jZWwoKSB7CisgICAgICAgIG1DYW5jZWxlZCA9IHRydWU7CisgICAgICAgIGlmIChtTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgIEFycmF5TGlzdDxBbmltYXRvckxpc3RlbmVyPiB0bXBMaXN0ZW5lcnMgPQorICAgICAgICAgICAgICAgICAgICAoQXJyYXlMaXN0PEFuaW1hdG9yTGlzdGVuZXI+KSBtTGlzdGVuZXJzLmNsb25lKCk7CisgICAgICAgICAgICBmb3IgKEFuaW1hdG9yTGlzdGVuZXIgbGlzdGVuZXIgOiB0bXBMaXN0ZW5lcnMpIHsKKyAgICAgICAgICAgICAgICBsaXN0ZW5lci5vbkFuaW1hdGlvbkNhbmNlbCh0aGlzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobVNvcnRlZE5vZGVzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIGZvciAoTm9kZSBub2RlIDogbVNvcnRlZE5vZGVzKSB7CisgICAgICAgICAgICAgICAgbm9kZS5hbmltYXRpb24uY2FuY2VsKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICoKKyAgICAgKiA8cD5Ob3RlIHRoYXQgZW5kaW5nIGEgPGNvZGU+QW5pbWF0b3JTZXQ8L2NvZGU+IGFsc28gZW5kcyBhbGwgb2YgdGhlIGFuaW1hdGlvbnMgdGhhdCBpdCBpcworICAgICAqIHJlc3BvbnNpYmxlIGZvci48L3A+CisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZW5kKCkgeworICAgICAgICBtQ2FuY2VsZWQgPSB0cnVlOworICAgICAgICBpZiAobVNvcnRlZE5vZGVzLnNpemUoKSAhPSBtTm9kZXMuc2l6ZSgpKSB7CisgICAgICAgICAgICAvLyBoYXNuJ3QgYmVlbiBzdGFydGVkIHlldCAtIHNvcnQgdGhlIG5vZGVzIG5vdywgdGhlbiBlbmQgdGhlbQorICAgICAgICAgICAgc29ydE5vZGVzKCk7CisgICAgICAgICAgICBmb3IgKE5vZGUgbm9kZSA6IG1Tb3J0ZWROb2RlcykgeworICAgICAgICAgICAgICAgIGlmIChtU2V0TGlzdGVuZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtU2V0TGlzdGVuZXIgPSBuZXcgQW5pbWF0b3JTZXRMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbm9kZS5hbmltYXRpb24uYWRkTGlzdGVuZXIobVNldExpc3RlbmVyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobVNvcnRlZE5vZGVzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIGZvciAoTm9kZSBub2RlIDogbVNvcnRlZE5vZGVzKSB7CisgICAgICAgICAgICAgICAgbm9kZS5hbmltYXRpb24uZW5kKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRydWUgaWYgYW55IG9mIHRoZSBjaGlsZCBhbmltYXRpb25zIG9mIHRoaXMgQW5pbWF0b3JTZXQgaGF2ZSBiZWVuIHN0YXJ0ZWQgYW5kIGhhdmUgbm90CisgICAgICogeWV0IGVuZGVkLgorICAgICAqIEByZXR1cm4gV2hldGhlciB0aGlzIEFuaW1hdG9yU2V0IGhhcyBiZWVuIHN0YXJ0ZWQgYW5kIGhhcyBub3QgeWV0IGVuZGVkLgorICAgICAqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIGlzUnVubmluZygpIHsKKyAgICAgICAgZm9yIChOb2RlIG5vZGUgOiBtTm9kZXMpIHsKKyAgICAgICAgICAgIGlmIChub2RlLmFuaW1hdGlvbi5pc1J1bm5pbmcoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGUgYW1vdW50IG9mIHRpbWUsIGluIG1pbGxpc2Vjb25kcywgdG8gZGVsYXkgc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RGVwZW5kZW5jeSBkZXBlbmRlbmN5IDogbm9kZS5kZXBlbmRlbmNpZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgZGVwZW5kZW5jeS5ub2RlLmFuaW1hdGlvbi5hZGRMaXN0ZW5lcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgRGVwZW5kZW5jeUxpc3RlbmVyKHRoaXMsIG5vZGUsIGRlcGVuZGVuY3kucnVsZSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBub2RlLnRtcERlcGVuZGVuY2llcyA9IChBcnJheUxpc3Q8RGVwZW5kZW5jeT4pIG5vZGUuZGVwZW5kZW5jaWVzLmNsb25lKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBub2RlLmFuaW1hdGlvbi5hZGRMaXN0ZW5lcihtU2V0TGlzdGVuZXIpOworICAgICAgICB9CisgICAgICAgIC8vIE5vdyB0aGF0IGFsbCBkZXBlbmRlbmNpZXMgYXJlIHNldCB1cCwgc3RhcnQgdGhlIGFuaW1hdGlvbnMgdGhhdCBzaG91bGQgYmUgc3RhcnRlZC4KKyAgICAgICAgaWYgKG1TdGFydERlbGF5IDw9IDApIHsKKyAgICAgICAgICAgIGZvciAoTm9kZSBub2RlIDogbm9kZXNUb1N0YXJ0KSB7CisgICAgICAgICAgICAgICAgbm9kZS5hbmltYXRpb24uc3RhcnQoKTsKKyAgICAgICAgICAgICAgICBtUGxheWluZ1NldC5hZGQobm9kZS5hbmltYXRpb24pOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVE9ETzogTmVlZCB0byBjYW5jZWwgb3V0IG9mIHRoZSBkZWxheSBhcHByb3ByaWF0ZWx5CisgICAgICAgICAgICBWYWx1ZUFuaW1hdG9yIGRlbGF5QW5pbSA9IFZhbHVlQW5pbWF0b3Iub2ZGbG9hdCgwZiwgMWYpOworICAgICAgICAgICAgZGVsYXlBbmltLnNldER1cmF0aW9uKG1TdGFydERlbGF5KTsKKyAgICAgICAgICAgIGRlbGF5QW5pbS5hZGRMaXN0ZW5lcihuZXcgQW5pbWF0b3JMaXN0ZW5lckFkYXB0ZXIoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25BbmltYXRpb25FbmQoQW5pbWF0b3IgYW5pbSkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKE5vZGUgbm9kZSA6IG5vZGVzVG9TdGFydCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5hbmltYXRpb24uc3RhcnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1QbGF5aW5nU2V0LmFkZChub2RlLmFuaW1hdGlvbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUxpc3RlbmVycyAhPSBudWxsKSB7CisgICAgICAgICAgICBBcnJheUxpc3Q8QW5pbWF0b3JMaXN0ZW5lcj4gdG1wTGlzdGVuZXJzID0KKyAgICAgICAgICAgICAgICAgICAgKEFycmF5TGlzdDxBbmltYXRvckxpc3RlbmVyPikgbUxpc3RlbmVycy5jbG9uZSgpOworICAgICAgICAgICAgZm9yIChBbmltYXRvckxpc3RlbmVyIGxpc3RlbmVyIDogdG1wTGlzdGVuZXJzKSB7CisgICAgICAgICAgICAgICAgbGlzdGVuZXIub25BbmltYXRpb25TdGFydCh0aGlzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBBbmltYXRvclNldCBjbG9uZSgpIHsKKyAgICAgICAgZmluYWwgQW5pbWF0b3JTZXQgYW5pbSA9IChBbmltYXRvclNldCkgc3VwZXIuY2xvbmUoKTsKKyAgICAgICAgLyoKKyAgICAgICAgICogVGhlIGJhc2ljIGNsb25lKCkgb3BlcmF0aW9uIGNvcGllcyBhbGwgaXRlbXMuIFRoaXMgZG9lc24ndCB3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ICAgLy8gY2xlYXIgb3V0IGFueSBsaXN0ZW5lcnMgdGhhdCB3ZXJlIHNldCB1cCBieSB0aGUgQW5pbWF0b3JTZXQ7IHRoZXNlIHdpbGwKKyAgICAgICAgICAgIC8vIGJlIHNldCB1cCB3aGVuIHRoZSBjbG9uZSdzIG5vZGVzIGFyZSBzb3J0ZWQKKyAgICAgICAgICAgIEFycmF5TGlzdDxBbmltYXRvckxpc3RlbmVyPiBjbG9uZUxpc3RlbmVycyA9IG5vZGVDbG9uZS5hbmltYXRpb24uZ2V0TGlzdGVuZXJzKCk7CisgICAgICAgICAgICBpZiAoY2xvbmVMaXN0ZW5lcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFycmF5TGlzdDxBbmltYXRvckxpc3RlbmVyPiBsaXN0ZW5lcnNUb1JlbW92ZSA9IG51bGw7CisgICAgICAgICAgICAgICAgZm9yIChBbmltYXRvckxpc3RlbmVyIGxpc3RlbmVyIDogY2xvbmVMaXN0ZW5lcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3RlbmVyIGluc3RhbmNlb2YgQW5pbWF0b3JTZXRMaXN0ZW5lcikgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3RlbmVyc1RvUmVtb3ZlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lcnNUb1JlbW92ZSA9IG5ldyBBcnJheUxpc3Q8QW5pbWF0b3JMaXN0ZW5lcj4oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RlbmVyc1RvUmVtb3ZlLmFkZChsaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGxpc3RlbmVyc1RvUmVtb3ZlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChBbmltYXRvckxpc3RlbmVyIGxpc3RlbmVyIDogbGlzdGVuZXJzVG9SZW1vdmUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNsb25lTGlzdGVuZXJzLnJlbW92ZShsaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8gTm93IHRoYXQgd2UndmUgY2xvbmVkIGFsbCBvZiB0aGUgbm9kZXMsIHdlJ3JlIHJlYWR5IHRvIHdhbGsgdGhyb3VnaCB0aGVpcgorICAgICAgICAvLyBkZXBlbmRlbmNpZXMsIG1hcHBpbmcgdGhlIG9sZCBkZXBlbmRlbmNpZXMgdG8gdGhlIG5ldyBub2RlcworICAgICAgICBmb3IgKE5vZGUgbm9kZSA6IG1Ob2RlcykgeworICAgICAgICAgICAgTm9kZSBub2RlQ2xvbmUgPSBub2RlQ2xvbmVNYXAuZ2V0KG5vZGUpOworICAgICAgICAgICAgaWYgKG5vZGUuZGVwZW5kZW5jaWVzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKERlcGVuZGVuY3kgZGVwZW5kZW5jeSA6IG5vZGUuZGVwZW5kZW5jaWVzKSB7CisgICAgICAgICAgICAgICAgICAgIE5vZGUgY2xvbmVkRGVwZW5kZW5jeU5vZGUgPSBub2RlQ2xvbmVNYXAuZ2V0KGRlcGVuZGVuY3kubm9kZSk7CisgICAgICAgICAgICAgICAgICAgIERlcGVuZGVuY3kgY2xvbmVEZXBlbmRlbmN5ID0gbmV3IERlcGVuZGVuY3koY2xvbmVkRGVwZW5kZW5jeU5vZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVwZW5kZW5jeS5ydWxlKTsKKyAgICAgICAgICAgICAgICAgICAgbm9kZUNsb25lLmFkZERlcGVuZGVuY3koY2xvbmVEZXBlbmRlbmN5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBy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ICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogSWdub3JlIGNhbmNlbCBldmVudHMgZm9yIG5vdy4gV2UgbWF5IHdhbnQgdG8gaGFuZGxlIHRoaXMgZXZlbnR1YWxseSwKKyAgICAgICAgICogdG8gcHJldmVudCBmb2xsb3ctb24gYW5pbWF0aW9ucyBmcm9tIHJ1bm5pbmcgd2hlbiBzb21lIGRlcGVuZGVuY3kKKyAgICAgICAgICogYW5pbWF0aW9uIGlzIGNhbmNlbGVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgb25BbmltYXRpb25DYW5jZWwoQW5pbWF0b3IgYW5pbWF0aW9uKSB7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQW4gZW5kIGV2ZW50IGlzIHJlY2VpdmVkIC0gc2VlIGlmIHRoaXMgaXMgYW4gZXZlbnQgd2UgYXJlIGxpc3RlbmluZyBmb3IKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uRW5kKEFuaW1hdG9yIGFuaW1hdGlvbikgeworICAgICAgICAgICAgaWYgKG1SdWxlID09IERlcGVuZGVuY3kuQUZURVIpIHsKKyAgICAgICAgICAgICAgICBzdGFydElmUmVhZHkoYW5pbWF0aW9uKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBJZ25vcmUgcmVwZWF0IGV2ZW50cyBmb3Igbm93CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBvbkFuaW1hdGlvblJlcGVhdChBbmltYXRvciBhbmltYXRpb24pIHsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIHN0YXJ0IGV2ZW50IGlzIHJlY2VpdmVkIC0gc2VlIGlmIHRoaXMgaXMgYW4gZXZlbnQgd2UgYXJlIGxpc3RlbmluZyBmb3IKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uU3RhcnQoQW5pbWF0b3IgYW5pbWF0aW9uKSB7CisgICAgICAgICAgICBpZiAobVJ1bGUgPT0gRGVwZW5kZW5jeS5XSVRIKSB7CisgICAgICAgICAgICAgICAgc3RhcnRJZlJlYWR5KGFuaW1hdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ2hlY2sgd2hldGhlciB0aGUgZXZlbnQgcmVjZWl2ZWQgaXMgb25lIHRoYXQgdGhlIG5vZGUgd2FzIHdhaXRpbmcgZm9yLgorICAgICAgICAgKiBJZiBzbywgbWFyayBpdCBhcyBjb21wbGV0ZSBhbmQgc2VlIHdoZXRoZXIgaXQncyB0aW1lIHRvIHN0YXJ0CisgICAgICAgICAqIHRoZSBhbmltYXRpb24uCisgICAgICAgICAqIEBwYXJhbSBkZXBlbmRlbmN5QW5pbWF0aW9uIHRoZSBhbmltYXRpb24gdGhhdCBzZW50IHRoZSBldmVudC4KKyAgICAgICAgICovCisgICAgICAgIHByaXZhdGUgdm9pZCBzdGFydElmUmVhZHkoQW5pbWF0b3IgZGVwZW5kZW5jeUFuaW1hdGlvbikgeworICAgICAgICAgICAgaWYgKG1BbmltYXRvclNldC5tQ2FuY2VsZWQpIHsKKyAgICAgICAgICAgICAgICAvLyBpZiB0aGUgcGFyZW50IEFuaW1hdG9yU2V0IHdhcyBjYW5jZWxlZCwgdGhlbiBkb24ndCBzdGFydCBhbnkgZGVwZW5kZW50IGFuaW1zCisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRGVwZW5kZW5jeSBkZXBlbmRlbmN5VG9SZW1vdmUgPSBudWxsOworICAgICAgICAgICAgZm9yIChEZXBlbmRlbmN5IGRlcGVuZGVuY3kgOiBtTm9kZS50bXBEZXBlbmRlbmNpZXMpIHsKKyAgICAgICAgICAgICAgICBpZiAoZGVwZW5kZW5jeS5ydWxlID09IG1SdWxlICYmCisgICAgICAgICAgICAgICAgICAgICAgICBkZXBlbmRlbmN5Lm5vZGUuYW5pbWF0aW9uID09IGRlcGVuZGVuY3lBbmltYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gcnVsZSBmaXJlZCAtIHJlbW92ZSB0aGUgZGVwZW5kZW5jeSBhbmQgbGlzdGVuZXIgYW5kIGNoZWNrIHRvCisgICAgICAgICAgICAgICAgICAgIC8vIHNlZSB3aGV0aGVyIGl0J3MgdGltZSB0byBzdGFydCB0aGUgYW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgIGRlcGVuZGVuY3lUb1JlbW92ZSA9IGRlcGVuZGVuY3k7CisgICAgICAgICAgICAgICAgICAgIGRlcGVuZGVuY3lBbmltYXRpb24ucmVtb3ZlTGlzdGVuZXIodGhpcyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Ob2RlLnRtcERlcGVuZGVuY2llcy5yZW1vdmUoZGVwZW5kZW5jeVRvUmVtb3ZlKTsKKyAgICAgICAgICAgIGlmIChtTm9kZS50bXBEZXBlbmRlbmNpZXMuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICAvLyBhbGwgZGVwZW5kZW5jaWVzIHNhdGlzZmllZDogc3RhcnQgdGhlIGFuaW1hdGlvbgorICAgICAgICAgICAgICAgIG1Ob2RlLmFuaW1hdGlvbi5zdGFydCgpOworICAgICAgICAgICAgICAgIG1BbmltYXRvclNldC5tUGxheWluZ1NldC5hZGQobU5vZGUuYW5pbWF0aW9uKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBBbmltYXRvclNldExpc3RlbmVyIGltcGxlbWVudHMgQW5pbWF0b3JMaXN0ZW5lciB7CisKKyAgICAgICAgcHJpdmF0ZSBBbmltYXRvclNldCBtQW5pbWF0b3JTZXQ7CisKKyAgICAgICAgQW5pbWF0b3JTZXRMaXN0ZW5lcihBbmltYXRvclNldCBhbmltYXRvclNldCkgeworICAgICAgICAgICAgbUFuaW1hdG9yU2V0ID0gYW5pbWF0b3JTZXQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvbkFuaW1hdGlvbkNhbmNlbChBbmltYXRvciBhbmltYXRpb24pIHsKKyAgICAgICAgICAgIGlmIChtUGxheWluZ1NldC5zaXplKCkgPT0gMCkgeworICAgICAgICAgICAgICAgIGlmIChtTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChBbmltYXRvckxpc3RlbmVyIGxpc3RlbmVyIDogbUxpc3RlbmVycykgeworICAgICAgICAgICAgICAgICAgICAgICAgbGlzdGVuZXIub25BbmltYXRpb25DYW5jZWwobUFuaW1hdG9yU2V0KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bmNoZWNrZWQiKQorICAgICAgICBwdWJsaWMgdm9pZCBvbkFuaW1hdGlvbkVuZChBbmltYXRvciBhbmltYXRpb24pIHsKKyAgICAgICAgICAgIGFuaW1hdGlvbi5yZW1vdmVMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgICAgIG1QbGF5aW5nU2V0LnJlbW92ZShhbmltYXRpb24pOworICAgICAgICAgICAgTm9kZSBhbmltTm9kZSA9IG1BbmltYXRvclNldC5tTm9kZU1hcC5nZXQoYW5pbWF0aW9uKTsKKyAgICAgICAgICAgIGFuaW1Ob2RlLmRvbmUgPSB0cnVlOworICAgICAgICAgICAgQXJyYXlMaXN0PE5vZGU+IHNvcnRlZE5vZGVzID0gbUFuaW1hdG9yU2V0Lm1Tb3J0ZWROb2RlczsKKyAgICAgICAgICAgIGJvb2xlYW4gYWxsRG9uZSA9IHRydWU7CisgICAgICAgICAgICBmb3IgKE5vZGUgbm9kZSA6IHNvcnRlZE5vZGVzKSB7CisgICAgICAgICAgICAgICAgaWYgKCFub2RlLmRvbmUpIHsKKyAgICAgICAgICAgICAgICAgICAgYWxsRG9uZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYWxsRG9uZSkgeworICAgICAgICAgICAgICAgIC8vIElmIHRoaXMgd2FzIHRoZSBsYXN0IGNoaWxkIGFuaW1hdGlvbiB0byBlbmQsIHRoZW4gbm90aWZ5IGxpc3RlbmVycyB0aGF0IHRoaXMKKyAgICAgICAgICAgICAgICAvLyBBbmltYXRvclNldCBoYXMgZW5kZWQKKyAgICAgICAgICAgICAgICBpZiAobUxpc3RlbmVycyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxBbmltYXRvckxpc3RlbmVyPiB0bXBMaXN0ZW5lcnMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChBcnJheUxpc3Q8QW5pbWF0b3JMaXN0ZW5lcj4pIG1MaXN0ZW5lcnMuY2xvbmUoKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChBbmltYXRvckxpc3RlbmVyIGxpc3RlbmVyIDogdG1wTGlzdGVuZXJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lci5vbkFuaW1hdGlvbkVuZChtQW5pbWF0b3JTZXQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gTm90aGluZyB0byBkbworICAgICAgICBwdWJsaWMgdm9pZCBvbkFuaW1hdGlvblJlcGVhdChBbmltYXRvciBhbmltYXRpb24pIHsKKyAgICAgICAgfQorCisgICAgICAgIC8vIE5vdGhpbmcgdG8gZG8KKyAgICAgICAgcHVibGljIHZvaWQgb25BbmltYXRpb25TdGFydChBbmltYXRvciBhbmltYXRpb24pIHsKKyAgICAgICAgfQorCisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2Qgc29ydHMgdGhlIGN1cnJlbnQgc2V0IG9mIG5vZGVzLCBpZiBuZWVkZWQuIFRoZSBzb3J0IGlzIGEgc2ltcGxlCisgICAgICogRGVwZW5kZW5jeUdyYXBoIHNvcnQsIHdoaWNoIGdvZXMgbGlrZSB0aGlzOgorICAgICAqIC0gQWxsIG5vZGVzIHdpdGhvdXQgZGVwZW5kZW5jaWVzIGJlY29tZSAncm9vdHMnCisgICAgICogLSB3aGlsZSByb290cyBsaXN0IGlzIG5vdCBudWxsCisgICAgICogLSAgIGZvciBlYWNoIHJvb3QgcgorICAgICAqIC0gICAgIGFkZCByIHRvIHNvcnRlZCBsaXN0CisgICAgICogLSAgICAgcmVtb3ZlIHIgYXMgYSBkZXBlbmRlbmN5IGZyb20gYW55IG90aGVyIG5vZGUKKyAgICAgKiAtICAgYW55IG5vZGVzIHdpdGggbm8gZGVwZW5kZW5jaWVzIGFyZSBhZGRlZCB0byB0aGUgcm9vdHMgbGlzdAorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzb3J0Tm9kZXMoKSB7CisgICAgICAgIGlmIChtTmVlZHNTb3J0KSB7CisgICAgICAgICAgICBtU29ydGVkTm9kZXMuY2xlYXIoKTsKKyAgICAgICAgICAgIEFycmF5TGlzdDxOb2RlPiByb290cyA9IG5ldyBBcnJheUxpc3Q8Tm9kZT4oKTsKKyAgICAgICAgICAgIGZvciAoTm9kZSBub2RlIDogbU5vZGVzKSB7CisgICAgICAgICAgICAgICAgaWYgKG5vZGUuZGVwZW5kZW5jaWVzID09IG51bGwgfHwgbm9kZS5kZXBlbmRlbmNpZXMuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcm9vdHMuYWRkKG5vZGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFycmF5TGlzdDxOb2RlPiB0bXBSb290cyA9IG5ldyBBcnJheUxpc3Q8Tm9kZT4oKTsKKyAgICAgICAgICAgIHdoaWxlIChyb290cy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgZm9yIChOb2RlIHJvb3QgOiByb290cykgeworICAgICAgICAgICAgICAgICAgICBtU29ydGVkTm9kZXMuYWRkKHJvb3QpOworICAgICAgICAgICAgICAgICAgICBpZiAocm9vdC5ub2RlRGVwZW5kZW50cyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKE5vZGUgbm9kZSA6IHJvb3Qubm9kZURlcGVuZGVudHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLm5vZGVEZXBlbmRlbmNpZXMucmVtb3ZlKHJvb3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChub2RlLm5vZGVEZXBlbmRlbmNpZXMuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wUm9vdHMuYWRkKG5vZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByb290cy5jbGVhcigpOworICAgICAgICAgICAgICAgIHJvb3RzLmFkZEFsbCh0bXBSb290cyk7CisgICAgICAgICAgICAgICAgdG1wUm9vdHMuY2xlYXIoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1OZWVkc1NvcnQgPSBmYWxzZTsKKyAgICAgICAgICAgIGlmIChtU29ydGVkTm9kZXMuc2l6ZSgpICE9IG1Ob2Rlcy5zaXplKCkpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJDaXJjdWxhciBkZXBlbmRlbmNpZXMgY2Fubm90IGV4aXN0IgorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGluIEFuaW1hdG9yU2V0Iik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBEb2Vzbid0IG5lZWQgc29ydGluZywgYnV0IHN0aWxsIG5lZWQgdG8gYWRkIGluIHRoZSBub2RlRGVwZW5kZW5jaWVzIGxpc3QKKyAgICAgICAgICAgIC8vIGJlY2F1c2UgdGhlc2UgZ2V0IHJlbW92ZWQgYXMgdGhlIGV2ZW50IGxpc3RlbmVycyBmaXJlIGFuZCB0aGUgZGVwZW5kZW5jaWVzCisgICAgICAgICAgICAvLyBhcmUgc2F0aXNmaWVkCisgICAgICAgICAgICBmb3IgKE5vZGUgbm9kZSA6IG1Ob2RlcykgeworICAgICAgICAgICAgICAgIGlmIChub2RlLmRlcGVuZGVuY2llcyAhPSBudWxsICYmIG5vZGUuZGVwZW5kZW5jaWVzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChEZXBlbmRlbmN5IGRlcGVuZGVuY3kgOiBub2RlLmRlcGVuZGVuY2llcykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5vZGUubm9kZURlcGVuZGVuY2llcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5ub2RlRGVwZW5kZW5jaWVzID0gbmV3IEFycmF5TGlzdDxOb2RlPigpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFub2RlLm5vZGVEZXBlbmRlbmNpZXMuY29udGFpbnMoZGVwZW5kZW5jeS5ub2RlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUubm9kZURlcGVuZGVuY2llcy5hZGQoZGVwZW5kZW5jeS5ub2RlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBub2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ZXMgYnkgZGVmYXVsdDsgZGVwZW5kZW5jaWVzIGFyZSBhZGRlZCB2aWEgdGhlIGFkZERlcGVuZGVuY3koKQorICAgICAgICAgKiBtZXRob2QuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhbmltYXRpb24gVGhlIGFuaW1hdGlvbiB0aGF0IHRoZSBOb2RlIGVuY2Fwc3VsYXRlcy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBOb2RlKEFuaW1hdG9yIGFuaW1hdGlvbikgeworICAgICAgICAgICAgdGhpcy5hbmltYXRpb24gPSBhbmltYXRpb247CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQWRkIGEgZGVwZW5kZW5jeSB0byB0aGlzIE5vZGUuIFRoZSBkZXBlbmRlbmN5IGluY2x1ZGVzIGluZm9ybWF0aW9uIGFib3V0IHRoZQorICAgICAgICAgKiBub2RlIHRoYXQgdGhpcyBub2RlIGlzIGRlcGVuZGVuY3kgdXBvbiBhbmQgdGhlIG5hdHVyZSBvZiB0aGUgZGVwZW5kZW5jeS4KKyAgICAgICAgICogQHBhcmFtIGRlcGVuZGVuY3kKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZERlcGVuZGVuY3koRGVwZW5kZW5jeSBkZXBlbmRlbmN5KSB7CisgICAgICAgICAgICBpZiAoZGVwZW5kZW5jaWVzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBkZXBlbmRlbmNpZXMgPSBuZXcgQXJyYXlMaXN0PERlcGVuZGVuY3k+KCk7CisgICAgICAgICAgICAgICAgbm9kZURlcGVuZGVuY2llcyA9IG5ldyBBcnJheUxpc3Q8Tm9kZT4oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGRlcGVuZGVuY2llcy5hZGQoZGVwZW5kZW5jeSk7CisgICAgICAgICAgICBpZiAoIW5vZGVEZXBlbmRlbmNpZXMuY29udGFpbnMoZGVwZW5kZW5jeS5ub2RlKSkgeworICAgICAgICAgICAgICAgIG5vZGVEZXBlbmRlbmNpZXMuYWRkKGRlcGVuZGVuY3kubm9kZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBOb2RlIGRlcGVuZGVuY3lOb2RlID0gZGVwZW5kZW5jeS5ub2RlOworICAgICAgICAgICAgaWYgKGRlcGVuZGVuY3lOb2RlLm5vZGVEZXBlbmRlbnRzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBkZXBlbmRlbmN5Tm9kZS5ub2RlRGVwZW5kZW50cyA9IG5ldyBBcnJheUxpc3Q8Tm9kZT4oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGRlcGVuZGVuY3lOb2RlLm5vZGVEZXBlbmRlbnRzLmFkZCh0aGlzKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgTm9kZSBjbG9uZSgpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgTm9kZSBub2RlID0gKE5vZGUpIHN1cGVyLmNsb25lKCk7CisgICAgICAgICAgICAgICAgbm9kZS5hbmltYXRpb24gPSAoQW5pbWF0b3IpIGFuaW1hdGlvbi5jbG9uZSgpOworICAgICAgICAgICAgICAgIHJldHVybiBub2RlOworICAgICAgICAgICAgfSBjYXRjaCAoQ2xvbmVOb3RTdXBwb3J0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFzc2VydGlvbkVycm9yKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGUgPGNvZGU+QnVpbGRlcjwvY29kZT4gb2JqZWN0IGlzIGEgdXRpbGl0eSBjbGFzcyB0byBmYWNpbGl0YXRlIGFkZGluZyBhbmltYXRpb25zIHRvIGEKKyAgICAgKiA8Y29kZT5BbmltYXRvclNldDwvY29kZT4gYWxvbmcgd2l0aCB0aGUgcmVsYXRpb25zaGlwcyBiZXR3Z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XRlIGNvbnN0cnVjdG9yLiBCdWlsZGVycyBhcmUgb25seSBjb25zdHJ1Y3RlZCBieSBBbmltYXRvclNldCwgd2hlbiB0aGUKKyAgICAgICAgICogcGxheSgpIG1ldGhvZCBpcyBjYWxsZWQuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhbmltIFRoZSBhbmltYXRpb24gdGhhdCBpcyB0aGUgZGVwZW5kZW5jeSBmb3IgdGhlIG90aGVyIGFuaW1hdGlvbnMgcGFzc2VkIGludG8KKyAgICAgICAgICogdGhlIG90aGVyIG1ldGhvZHMgb2YgdGhpcyBCdWlsZGVyIG9iamVjdC4KKyAgICAgICAgICovCisgICAgICAgIEJ1aWxkZXIoQW5pbWF0b3IgYW5pbSkgeworICAgICAgICAgICAgbUN1cnJlbnROb2RlID0gbU5vZGVNYXAuZ2V0KGFuaW0pOworICAgICAgICAgICAgaWYgKG1DdXJyZW50Tm9kZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUN1cnJlbnROb2RlID0gbmV3IE5vZGUoYW5pbSk7CisgICAgICAgICAgICAgICAgbU5vZGVNYXAucHV0KGFuaW0sIG1DdXJyZW50Tm9kZSk7CisgICAgICAgICAgICAgICAgbU5vZGVzLmFkZChtQ3VycmVudE5vZGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNldHMgdXAgdGhlIGdpdmVuIGFuaW1hdGlvbiB0byBwbGF5IGF0IHRoZSBzYW1lIHRpbWUgYXMgdGhlIGFuaW1hdGlvbiBzdXBwbGllZCBpbiB0aGUKKyAgICAgICAgICoge0BsaW5rIEFuaW1hdG9yU2V0I3BsYXkoQW5pbWF0b3IpfSBjYWxsIHRoYXQgY3JlYXRlZCB0aGlzIDxjb2RlPkJ1aWxkZXI8L2NvZGU+IG9iamVjdC4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGFuaW0gVGhlIGFuaW1hdGlvbiB0aGF0IHdpbGwgcGxheSB3aGVuIHRoZSBhbmltYXRpb24gc3VwcGxpZWQgdG8gdGhlCisgICAgICAgICAqIHtAbGluayBBbmltYXRvclNldCNwbGF5KEFuaW1hdG9yKX0gbWV0aG9kIHN0YXJ0cy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIHdpdGgoQW5pbWF0b3IgYW5pbSkgeworICAgICAgICAgICAgTm9kZSBub2RlID0gbU5vZGVNYXAuZ2V0KGFuaW0pOworICAgICAgICAgICAgaWYgKG5vZGUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG5vZGUgPSBuZXcgTm9kZShhbmltKTsKKyAgICAgICAgICAgICAgICBtTm9kZU1hcC5wdXQoYW5pbSwgbm9kZSk7CisgICAgICAgICAgICAgICAgbU5vZGVzLmFkZChub2RlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIERlcGVuZGVuY3kgZGVwZW5kZW5jeSA9IG5ldyBEZXBlbmRlbmN5KG1DdXJyZW50Tm9kZSwgRGVwZW5kZW5jeS5XSVRIKTsKKyAgICAgICAgICAgIG5vZGUuYWRkRGVwZW5kZW5jeShkZXBlbmRlbmN5KTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZXRzIHVwIHRoZSBnaXZlbiBhbmltYXRpb24gdG8gcGxheSB3aGVuIHRoZSBhbmltYXRpb24gc3VwcGxpZWQgaW4gdGhlCisgICAgICAgICAqIHtAbGluayBBbmltYXRvclNldCNwbGF5KEFuaW1hdG9yKX0gY2FsbCB0aGF0IGNyZWF0ZWQgdGhpcyA8Y29kZT5CdWlsZGVyPC9jb2RlPiBvYmplY3QKKyAgICAgICAgICogZW5kcy4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGFuaW0gVGhlIGFuaW1hdGlvbiB0aGF0IHdpbGwgcGxheSB3aGVuIHRoZSBhbmltYXRpb24gc3VwcGxpZWQgdG8gdGhlCisgICAgICAgICAqIHtAbGluayBBbmltYXRvclNldCNwbGF5KEFuaW1hdG9yKX0gbWV0aG9kIGVuZHMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBiZWZvcmUoQW5pbWF0b3IgYW5pbSkgeworICAgICAgICAgICAgTm9kZSBub2RlID0gbU5vZGVNYXAuZ2V0KGFuaW0pOworICAgICAgICAgICAgaWYgKG5vZGUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG5vZGUgPSBuZXcgTm9kZShhbmltKTsKKyAgICAgICAgICAgICAgICBtTm9kZU1hcC5wdXQoYW5pbSwgbm9kZSk7CisgICAgICAgICAgICAgICAgbU5vZGVzLmFkZChub2RlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIERlcGVuZGVuY3kgZGVwZW5kZW5jeSA9IG5ldyBEZXBlbmRlbmN5KG1DdXJyZW50Tm9kZSwgRGVwZW5kZW5jeS5BRlRFUik7CisgICAgICAgICAgICBub2RlLmFkZERlcGVuZGVuY3koZGVwZW5kZW5jeSk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogU2V0cyB1cCB0aGUgZ2l2ZW4gYW5pbWF0aW9uIHRvIHBsYXkgd2hlbiB0aGUgYW5pbWF0aW9uIHN1cHBsaWVkIGluIHRoZQorICAgICAgICAgKiB7QGxpbmsgQW5pbWF0b3JTZXQjcGxheShBbmltYXRvcil9IGNhbGwgdGhhdCBjcmVhdGVkIHRoaXMgPGNvZGU+QnVpbGRlcjwvY29kZT4gb2JqZWN0CisgICAgICAgICAqIHRvIHN0YXJ0IHdoZW4gdGhlIGFuaW1hdGlvbiBzdXBwbGllZCBpbiB0aGlzIG1ldGhvZCBjYWxsIGVuZHMuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhbmltIFRoZSBhbmltYXRpb24gd2hvc2UgZW5kIHdpbGwgY2F1c2UgdGhlIGFuaW1hdGlvbiBzdXBwbGllZCB0byB0aGUKKyAgICAgICAgICoge0BsaW5rIEFuaW1hdG9yU2V0I3BsYXkoQW5pbWF0b3IpfSBtZXRob2QgdG8gcGxheS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIGFmdGVyKEFuaW1hdG9yIGFuaW0pIHsKKyAgICAgICAgICAgIE5vZGUgbm9kZSA9IG1Ob2RlTWFwLmdldChhbmltKTsKKyAgICAgICAgICAgIGlmIChub2RlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBub2RlID0gbmV3IE5vZGUoYW5pbSk7CisgICAgICAgICAgICAgICAgbU5vZGVNYXAucHV0KGFuaW0sIG5vZGUpOworICAgICAgICAgICAgICAgIG1Ob2Rlcy5hZGQobm9kZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBEZXBlbmRlbmN5IGRlcGVuZGVuY3kgPSBuZXcgRGVwZW5kZW5jeShub2RlLCBEZXBlbmRlbmN5LkFGVEVSKTsKKyAgICAgICAgICAgIG1DdXJyZW50Tm9kZS5hZGREZXBlbmRlbmN5KGRlcGVuZGVuY3kpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNldHMgdXAgdGhlIGFuaW1hdGlvbiBzdXBwbGllZCBpbiB0aGUKKyAgICAgICAgICoge0BsaW5rIEFuaW1hdG9yU2V0I3BsYXkoQW5pbWF0b3IpfSBjYWxsIHRoYXQgY3JlYXRlZCB0aGlzIDxjb2RlPkJ1aWxkZXI8L2NvZGU+IG9iamVjdAorICAgICAgICAgKiB0byBwbGF5IHdoZW4gdGhlIGdpdmVuIGFtb3VudCBvZiB0aW1lIGVsYXBzZXMuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBkZWxheSBUaGUgbnVtYmVyIG9mIG1pbGxpc2Vjb25kcyB0aGF0IHNob3VsZCBlbGFwc2UgYmVmb3JlIHRoZQorICAgICAgICAgKiBhbmltYXRpb24gc3RhcnRzLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgYWZ0ZXIobG9uZyBkZWxheSkgeworICAgICAgIC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bGwpOworICAgICAgICAgICAga2V5ZnJhbWVzWzFdID0gbmV3IEtleWZyYW1lKDFmLCB2YWx1ZXNbMF0pOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAga2V5ZnJhbWVzWzBdID0gbmV3IEtleWZyYW1lKDBmLCB2YWx1ZXNbMF0pOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPCBudW1LZXlmcmFtZXM7ICsraSkgeworICAgICAgICAgICAgICAgIGtleWZyYW1lc1tpXSA9IG5ldyBLZXlmcmFtZSgoZmxvYXQpIGkgLyAobnVtS2V5ZnJhbWVzIC0gMSksIHZhbHVlc1tpXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG5ldyBLZXlmcmFtZVNldChrZXlmcmFtZXMpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgS2V5ZnJhbWVTZXQgb2ZMb25nKGxvbmcuLi4gdmFsdWVzKSB7CisgICAgICAgIGludCBudW1LZXlmcmFtZXMgPSB2YWx1ZXMubGVuZ3RoOworICAgICAgICBLZXlmcmFtZSBrZXlmcmFtZXNbXSA9IG5ldyBLZXlmcmFtZVtNYXRoLm1heChudW1LZXlmcmFtZXMsMildOworICAgICAgICBpZiAobnVtS2V5ZnJhbWVzID09IDEpIHsKKyAgICAgICAgICAgIGtleWZyYW1lc1swXSA9IG5ldyBLZXlmcmFtZSgwZiwgKE9iamVjdCkgbnVsbCk7CisgICAgICAgICAgICBrZXlmcmFtZXNbMV0gPSBuZXcgS2V5ZnJhbWUoMWYsIHZhbHVlc1swXSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBrZXlmcmFtZXNbMF0gPSBuZXcgS2V5ZnJhbWUoMGYsIHZhbHVlc1swXSk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8IG51bUtleWZyYW1lczsgKytpKSB7CisgICAgICAgICAgICAgICAga2V5ZnJhbWVzW2ldID0gbmV3IEtleWZyYW1lKChmbG9hdCkgaSAvIChudW1LZXlmcmFtZXMgLSAxKSwgdmFsdWVzW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbmV3IEtleWZyYW1lU2V0KGtleWZyYW1lcyk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBLZXlmcmFtZVNldCBvZk9iamVjdChPYmplY3QuLi4gdmFsdWVzKSB7CisgICAgICAgIGludCBudW1LZXlmcmFtZXMgPSB2YWx1ZXMubGVuZ3RoOworICAgICAgICBLZXlmcmFtZSBrZXlmcmFtZXNbXSA9IG5ldyBLZXlmcmFtZVtNYXRoLm1heChudW1LZXlmcmFtZXMsMildOworICAgICAgICBpZiAobnVtS2V5ZnJhbWVzID09IDEpIHsKKyAgICAgICAgICAgIGtleWZyYW1lc1swXSA9IG5ldyBLZXlmcmFtZSgwZiwgKE9iamVjdCkgbnVsbCk7CisgICAgICAgICAgICBrZXlmcmFtZXNbMV0gPSBuZXcgS2V5ZnJhbWUoMWYsIHZhbHVlc1swXSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBrZXlmcmFtZXNbMF0gPSBuZXcgS2V5ZnJhbWUoMGYsIHZhbHVlc1swXSk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8IG51bUtleWZyYW1lczsgKytpKSB7CisgICAgICAgICAgICAgICAga2V5ZnJhbWVzW2ldID0gbmV3IEtleWZyYW1lKChmbG9hdCkgaSAvIChudW1LZXlmcmFtZXMgLSAxKSwgdmFsdWVzW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbmV3IEtleWZyYW1lU2V0KGtleWZyYW1lcyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0cyB0aGUgYW5pbWF0ZWQgdmFsdWUsIGdpdmVuIHRoZSBlbGFwc2VkIGZyYWN0aW9uIG9mIHRoZSBhbmltYXRpb24gKGludGVycG9sYXRlZCBieSB0aGU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mFsdWUoZmxvYXQgZnJhY3Rpb24sIFR5cGVFdmFsdWF0b3IgZXZhbHVhdG9yKSB7CisKKyAgICAgICAgLy8gU3BlY2lhbC1jYXNlIG9wdGltaXphdGlvbiBmb3IgdGhlIGNvbW1vbiBjYXNlIG9mIG9ubHkgdHdvIGtleWZyYW1lcworICAgICAgICBpZiAobU51bUtleWZyYW1lcyA9PSAyKSB7CisgICAgICAgICAgICBpZiAobUludGVycG9sYXRvciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZnJhY3Rpb24gPSBtSW50ZXJwb2xhdG9yLmdldEludGVycG9sYXRpb24oZnJhY3Rpb24pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGV2YWx1YXRvci5ldmFsdWF0ZShmcmFjdGlvbiwgbUZpcnN0S2V5ZnJhbWUuZ2V0VmFsdWUoKSwKKyAgICAgICAgICAgICAgICAgICAgbUxhc3RLZXlmcmFtZS5nZXRWYWx1ZSgpKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChmcmFjdGlvbiA8PSAwZikgeworICAgICAgICAgICAgZmluYWwgS2V5ZnJhbWUgbmV4dEtleWZyYW1lID0gbUtleWZyYW1lcy5nZXQoMSk7CisgICAgICAgICAgICBmaW5hbCBUaW1lSW50ZXJwb2xhdG9yIGludGVycG9sYXRvciA9IG5leHRLZXlmcmFtZS5nZXRJbnRlcnBvbGF0b3IoKTsKKyAgICAgICAgICAgIGlmIChpbnRlcnBvbGF0b3IgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZyYWN0aW9uID0gaW50ZXJwb2xhdG9yLmdldEludGVycG9sYXRpb24oZnJhY3Rpb24pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmluYWwgZmxvYXQgcHJldkZyYWN0aW9uID0gbUZpcnN0S2V5ZnJhbWUuZ2V0RnJhY3Rpb24oKTsKKyAgICAgICAgICAgIGZsb2F0IGludGVydmFsRnJhY3Rpb24gPSAoZnJhY3Rpb24gLSBwcm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yYW1lLmdldFZhbHVlKCkpOworICAgICAgICB9CisgICAgICAgIEtleWZyYW1lIHByZXZLZXlmcmFtZSA9IG1GaXJzdEtleWZyYW1lOworICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8IG1OdW1LZXlmcmFtZXM7ICsraSkgeworICAgICAgICAgICAgS2V5ZnJhbWUgbmV4dEtleWZyYW1lID0gbUtleWZyYW1lcy5nZXQoaSk7CisgICAgICAgICAgICBpZiAoZnJhY3Rpb24gPCBuZXh0S2V5ZnJhbWUuZ2V0RnJhY3Rpb24oKSkgeworICAgICAgICAgICAgICAgIGZpbmFsIFRpbWVJbnRlcnBvbGF0b3IgaW50ZXJwb2xhdG9yID0gbmV4dEtleWZyYW1lLmdldEludGVycG9sYXRvcigpOworICAgICAgICAgICAgICAgIGlmIChpbnRlcnBvbGF0b3IgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmcmFjdGlvbiA9IGludGVycG9sYXRvci5nZXRJbnRlcnBvbGF0aW9uKGZyYWN0aW9uKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgcHJldkZyYWN0aW9uID0gcHJldktleWZyYW1lLmdldEZyYWN0aW9uKCk7CisgICAgICAgICAgICAgICAgZmxvYXQgaW50ZXJ2YWxGcmFjdGlvbiA9IChmcmFjdGlvbiAtIHByZXZGcmFjdGlvbikgLworICAgICAgICAgICAgICAgICAgICAobmV4dEtleWZyYW1lLmdldEZyYWN0aW9uKCkgLSBwcmV2RnJhY3Rpb24pOworICAgICAgICAgICAgICAgIHJldHVybiBldmFsdWF0b3IuZXZhbHVhdGUoaW50ZXJ2YWxGcmFjdGlvbiwgcHJldktleWZyYW1lLmdldFZhbHVlKCksCisgICAgICAgICAgICAgICAgICAgICAgICBuZXh0S2V5ZnJhbWUuZ2V0VmFsdWUoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwcmV2S2V5ZnJhbWUgPSBuZXh0S2V5ZnJhbWU7C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QHBhcmFtIHRyYW5zaXRpb25UeXBlIG9uZSBvZiB7QGxpbmsgI0NIQU5HRV9BUFBFQVJJTkd9LCB7QGxpbmsgI0NIQU5HRV9ESVNBUFBFQVJJTkd9LAorICAgICAqIHtAbGluayAjQVBQRUFSSU5HfSwgb3Ige0BsaW5rICNESVNBUFBFQVJJTkd9LCB3aGljaCBkZXRlcm1pbmVzIHRoZSBhbmltYXRpb24gd2hvc2Ugc3RhcnQKKyAgICAgKiBkZWxheSBpcyBiZWluZyBzZXQuCisgICAgICogQHBhcmFtIGRlbGF5IFRoZSBsZW5ndGggb2YgdGltZSwgaW4gbWlsbGlzZWNvbmRzLCB0byBkZWxheSBiZWZvcmUgc3RhcnRpbmcgdGhlIGFuaW1hdGlvbi4KKyAgICAgKiBAc2VlIEFuaW1hdG9yI3NldFN0YXJ0RGVsYXkobG9uZykKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRTdGFydERlbGF5KGludCB0cmFuc2l0aW9uVHlwZSwgbG9uZyBkZWxheSkgeworICAgICAgICBzd2l0Y2ggKHRyYW5zaXRpb25UeXBlKSB7CisgICAgICAgICAgICBjYXNlIENIQU5HRV9BUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgbUNoYW5naW5nQXBwZWFyaW5nRGVsYXkgPSBkZWxheTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQ0hBTkdFX0RJU0FQUEVBUklORzoKKyAgICAgICAgICAgICAgICBtQ2hhbmdpbmdEaXNhcHBlYXJpbmdEZWxheSA9IGRlbGF5OworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgbUFwcGVhcmluZ0RlbGF5ID0gZGVsYXk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIERJU0FQUEVBUklORzoKKyAgICAgICAgICAgICAgICBtRGlzYXBwZWFyaW5nRGVsYXkgPSBkZWxheTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEdldHMgdGhlIHN0YXJ0IGRlbGF5IG9uIG9uZSBvZiB0aGUgYW5pbWF0aW9uIG9iamVjdHMgdXNlZCBieSB0aGlzIHRyYW5zaXRpb24uIFRoZQorICAgICAqIDxjb2RlPnRyYW5zaXRpb25UeXBlPC9jb2RlPiBwYXJhbWV0ZXIgZGV0ZXJtaW5lcyB0aGUgYW5pbWF0aW9uIHdob3NlIHN0YXJ0IGRlbGF5CisgICAgICogaXMgcmV0dXJuZWQuCisgICAgICoKKyAgICAgKiBAcGFyYW0gdHJhbnNpdGlvblR5cGUgb25lIG9mIHtAbGluayAjQ0hBTkdFX0FQUEVBUklOR30sIHtAbGluayAjQ0hBTkdFX0RJU0FQUEVBUklOR30sCisgICAgICoge0BsaW5rICNBUFBFQVJJTkd9LCBvciB7QGxpbmsgI0RJU0FQUEVBUklOR30sIHdoaWNoIGRldGVybWluZXMgdGhlIGFuaW1hdGlvbiB3aG9zZSBzdGFydAorICAgICAqIGRlbGF5IGlzIHJldHVybmVkLgorICAgICAqIEByZXR1cm4gbG9uZyBUaGUgc3RhcnQgZGVsYXkgb2YgdGhlIHNwZWNpZmllZCBhbmltYXRpb24uCisgICAgICogQHNlZSBBbmltYXRvciNnZXRTdGFydERlbGF5KCkKKyAgICAgKi8KKyAgICBwdWJsaWMgbG9uZyBnZXRTdGFydERlbGF5KGludCB0cmFuc2l0aW9uVHlwZSkgeworICAgICAgICBzd2l0Y2ggKHRyYW5zaXRpb25UeXBlKSB7CisgICAgICAgICAgICBjYXNlIENIQU5HRV9BUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1DaGFuZ2luZ0FwcGVhcmluZ0R1cmF0aW9uOworICAgICAgICAgICAgY2FzZSBDSEFOR0VfRElTQVBQRUFSSU5HOgorICAgICAgICAgICAgICAgIHJldHVybiBtQ2hhbmdpbmdEaXNhcHBlYXJpbmdEdXJhdGlvbjsKKyAgICAgICAgICAgIGNhc2UgQVBQRUFSSU5HOgorICAgICAgICAgICAgICAgIHJldHVybiBtQXBwZWFyaW5nRHVyYXRpb247CisgICAgICAgICAgICBjYXNlIERJU0FQUEVBUklORzoKKyAgICAgICAgICAgICAgICByZXR1cm4gbURpc2FwcGVhcmluZ0R1cmF0aW9uOworICAgICAgICB9CisgICAgICAgIC8vIHNob3VsZG4ndCByZWFjaCBoZXJlCisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIGR1cmF0aW9uIG9uIG9uZSBvZiB0aGUgYW5pbWF0aW9uIG9iamVjdHMgdXNlZCBieSB0aGlzIHRyYW5zaXRpb24uIFRoZQorICAgICAqIDxjb2RlPnRyYW5zaXRpb25UeXBlPC9jb2RlPiBwYXJhbWV0ZXIgZGV0ZXJtaW5lcyB0aGUgYW5pbWF0aW9uIHdob3NlIGR1cmF0aW9uCisgICAgICogaXMgYmVpbmcgc2V0LgorICAgICAqCisgICAgICogQHBhcmFtIHRyYW5zaXRpb25UeXBlIG9uZSBvZiB7QGxpbmsgI0NIQU5HRV9BUFBFQVJJTkd9LCB7QGxpbmsgI0NIQU5HRV9ESVNBUFBFQVJJTkd9LAorICAgICAqIHtAbGluayAjQVBQRUFSSU5HfSwgb3Ige0BsaW5rICNESVNBUFBFQVJJTkd9LCB3aGljaCBkZXRlcm1pbmVzIHRoZSBhbmltYXRpb24gd2hvc2UKKyAgICAgKiBkdXJhdGlvbiBpcyBiZWluZyBzZXQuCisgICAgICogQHBhcmFtIGR1cmF0aW9uIFRoZSBsZW5ndGggb2YgdGltZSwgaW4gbWlsbGlzZWNvbmRzLCB0aGF0IHRoZSBzcGVjaWZpZWQgYW5pbWF0aW9uIHNob3VsZCBydW4uCisgICAgICogQHNlZSBBbmltYXRvciNzZXREdXJhdGlvbihsb25nKQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldER1cmF0aW9uKGludCB0cmFuc2l0aW9uVHlwZSwgbG9uZyBkdXJhdGlvbikgeworICAgICAgICBzd2l0Y2ggKHRyYW5zaXRpb25UeXBlKSB7CisgICAgICAgICAgICBjYXNlIENIQU5HRV9BUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgbUNoYW5naW5nQXBwZWFyaW5nRHVyYXRpb24gPSBkdXJhdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQ0hBTkdFX0RJU0FQUEVBUklORzoKKyAgICAgICAgICAgICAgICBtQ2hhbmdpbmdEaXNhcHBlYXJpbmdEdXJhdGlvbiA9IGR1cmF0aW9uOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgbUFwcGVhcmluZ0R1cmF0aW9uID0gZHVyYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIERJU0FQUEVBUklORzoKKyAgICAgICAgICAgICAgICBtRGlzYXBwZWFyaW5nRHVyYXRpb24gPSBkdXJhdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEdldHMgdGhlIGR1cmF0aW9uIG9uIG9uZSBvZiB0aGUgYW5pbWF0aW9uIG9iamVjdHMgdXNlZCBieSB0aGlzIHRyYW5zaXRpb24uIFRoZQorICAgICAqIDxjb2RlPnRyYW5zaXRpb25UeXBlPC9jb2RlPiBwYXJhbWV0ZXIgZGV0ZXJtaW5lcyB0aGUgYW5pbWF0aW9uIHdob3NlIGR1cmF0aW9uCisgICAgICogaXMgcmV0dXJuZWQuCisgICAgICoKKyAgICAgKiBAcGFyYW0gdHJhbnNpdGlvblR5cGUgb25lIG9mIHtAbGluayAjQ0hBTkdFX0FQUEVBUklOR30sIHtAbGluayAjQ0hBTkdFX0RJU0FQUEVBUklOR30sCisgICAgICoge0BsaW5rICNBUFBFQVJJTkd9LCBvciB7QGxpbmsgI0RJU0FQUEVBUklOR30sIHdoaWNoIGRldGVybWluZXMgdGhlIGFuaW1hdGlvbiB3aG9zZQorICAgICAqIGR1cmF0aW9uIGlzIHJldHVybmVkLgorICAgICAqIEByZXR1cm4gbG9uZyBUaGUgZHVyYXRpb24gb2YgdGhlIHNwZWNpZmllZCBhbmltYXRpb24uCisgICAgICogQHNlZSBBbmltYXRvciNnZXREdXJhdGlvbigpCisgICAgICovCisgICAgcHVibGljIGxvbmcgZ2V0RHVyYXRpb24oaW50IHRyYW5zaXRpb25UeXBlKSB7CisgICAgICAgIHN3aXRjaCAodHJhbnNpdGlvblR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgQ0hBTkdFX0FQUEVBUklORzoKKyAgICAgICAgICAgICAgICByZXR1cm4gbUNoYW5naW5nQXBwZWFyaW5nRHVyYXRpb247CisgICAgICAgICAgICBjYXNlIENIQU5HRV9ESVNBUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1DaGFuZ2luZ0Rpc2FwcGVhcmluZ0R1cmF0aW9uOworICAgICAgICAgICAgY2FzZSBBUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1BcHBlYXJpbmdEdXJhdGlvbjsKKyAgICAgICAgICAgIGNhc2UgRElTQVBQRUFSSU5HOgorICAgICAgICAgICAgICAgIHJldHVybiBtRGlzYXBwZWFyaW5nRHVyYXRpb247CisgICAgICAgIH0KKyAgICAgICAgLy8gc2hvdWxkbid0IHJlYWNoIGhlcmUKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgbGVuZ3RoIG9mIHRpbWUgdG8gZGVsYXkgYmV0d2VlbiBzdGFydGluZyBlYWNoIGFuaW1hdGlvbiBkdXJpbmcgb25lIG9mIHRoZQorICAgICAqIENIQU5HRSBhbmltYXRpb25zLgorICAgICAqCisgICAgICogQHBhcmFtIH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EVBUklOR30sIHdoaWNoIGRldGVybWluZXMgdGhlIGFuaW1hdGlvbiB3aG9zZQorICAgICAqIGR1cmF0aW9uIGlzIGJlaW5nIHNldC4KKyAgICAgKiBAcGFyYW0gaW50ZXJwb2xhdG9yIFRoZSBpbnRlcnBvbGF0b3IgdGhhdCB0aGUgc3BlY2lmaWVkIGFuaW1hdGlvbiBzaG91bGQgdXNlLgorICAgICAqIEBzZWUgQW5pbWF0b3Ijc2V0SW50ZXJwb2xhdG9yKFRpbWVJbnRlcnBvbGF0b3IpCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0SW50ZXJwb2xhdG9yKGludCB0cmFuc2l0aW9uVHlwZSwgVGltZUludGVycG9sYXRvciBpbnRlcnBvbGF0b3IpIHsKKyAgICAgICAgc3dpdGNoICh0cmFuc2l0aW9uVHlwZSkgeworICAgICAgICAgICAgY2FzZSBDSEFOR0VfQVBQRUFSSU5HOgorICAgICAgICAgICAgICAgIG1DaGFuZ2luZ0FwcGVhcmluZ0ludGVycG9sYXRvciA9IGludGVycG9sYXRvcjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQ0hBTkdFX0RJU0FQUEVBUklORzoKKyAgICAgICAgICAgICAgICBtQ2hhbmdpbmdEaXNhcHBlYXJpbmdJbnRlcnBvbGF0b3IgPSBpbnRlcnBvbGF0b3I7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEFQUEVBUklORzoKKyAgICAgICAgICAgICAgICBtQXBwZWFyaW5nSW50ZXJwb2xhdG9yID0gaW50ZXJwb2xhdG9yOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBESVNBUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgbURpc2FwcGVhcmluZ0ludGVycG9sYXRvciA9IGludGVycG9sYXRvcjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICA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uaW1hdG9yIGFuaW1hdG9yKSB7CisgICAgICAgIHN3aXRjaCAodHJhbnNpdGlvblR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgQ0hBTkdFX0FQUEVBUklORzoKKyAgICAgICAgICAgICAgICBtQ2hhbmdpbmdBcHBlYXJpbmdBbmltID0gYW5pbWF0b3I7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIENIQU5HRV9ESVNBUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgbUNoYW5naW5nRGlzYXBwZWFyaW5nQW5pbSA9IGFuaW1hdG9yOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgbUFwcGVhcmluZ0FuaW0gPSBhbmltYXRvcjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRElTQVBQRUFSSU5HOgorICAgICAgICAgICAgICAgIG1EaXNhcHBlYXJpbmdBbmltID0gYW5pbWF0b3I7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZXRzIHRoZSBhbmltYXRpb24gdXNlZCBkdXJpbmcgb25lIG9mIHRoZSB0cmFuc2l0aW9uIHR5cGVzIHRoYXQgbWF5IHJ1bi4KKyAgICAgKgorICAgICAqIEBwYXJhbSB0cmFuc2l0aW9uVHlwZSBvbmUgb2Yge0BsaW5rICNDSEFOR0VfQVBQRUFSSU5HfSwge0BsaW5rICNDSEFOR0VfRElTQVBQRUFSSU5HfSwKKyAgICAgKiB7QGxpbmsgI0FQUEVBUklOR30sIG9yIHtAbGluayAjRElTQVBQRUFSSU5HfSwgd2hpY2ggZGV0ZXJtaW5lcyB0aGUgYW5pbWF0aW9uIHdob3NlCisgICAgICogZHVyYXRpb24gaXMgYmVpbmcgc2V0LgorICAgICAqIEByZXR1cm4gQW5pbWF0b3IgVGhlIGFuaW1hdGlvbiBiZWluZyB1c2VkIGZvciB0aGUgZ2l2ZW4gdHJhbnNpdGlvbiB0eXBlLgorICAgICAqIEBzZWUgI3NldEFuaW1hdG9yKGludCwgQW5pbWF0b3IpCisgICAgICovCisgICAgcHVibGljIEFuaW1hdG9yIGdldEFuaW1hdG9yKGludCB0cmFuc2l0aW9uVHlwZSkgeworICAgICAgICBzd2l0Y2ggKHRyYW5zaXRpb25UeXBlKSB7CisgICAgICAgICAgICBjYXNlIENIQU5HRV9BUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1DaGFuZ2luZ0FwcGVhcmluZ0FuaW07CisgICAgICAgICAgICBjYXNlIENIQU5HRV9ESVNBUFBFQVJJTkc6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1DaGFuZ2luZ0Rpc2FwcGVhcmluZ0FuaW07CisgICAgICAgICAgICBjYXNlIEFQUEVBUklORzoKKyAgICAgICAgICAgICAgICByZXR1cm4gbUFwcGVhcmluZ0FuaW07CisgICAgICAgICAgICBjYXNlIERJU0FQUEVBUklORzoKKyAgICAgICAgICAgICAgICByZXR1cm4gbURpc2FwcGVhcmluZ0FuaW07CisgICAgICAgIH0KKyAgICAgICAgLy8gc2hvdWxkbid0IHJlYWNoIGhlcmUKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBmdW5jdGlvbiBzZXRzIHVwIHJ1bnMgYW5pbWF0aW9ucyBvbiBhbGwgb2YgdGhlIHZpZXdzIHRoYXQgY2hhbmdlIGR1cmluZyBsYXlvdXQuCisgICAgICogRm9yIGV2ZXJ5IGNoaWxkIGluIHRoZSBwYXJlbnQsIHdlIGNyZWF0ZSBhIGNoYW5nZSBhbmltYXRpb24gb2YgdGhlIGFwcHJvcHJpYXRlCisgICAgICogdHlwZSAoYXBwZWFyaW5nIG9yIGRpc2FwcGVhcmluZykgYW5kIGFzayBpdCB0byBwb3B1bGF0ZSBpdHMgc3RhcnQgdmF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cGVhcmluZ0FuaW0gOiBtQ2hhbmdpbmdEaXNhcHBlYXJpbmdBbmltOworICAgICAgICAvLyBJZiB0aGUgYW5pbWF0aW9uIGlzIG51bGwsIHRoZXJlJ3Mgbm90aGluZyB0byBkbworICAgICAgICBpZiAoYmFzZUFuaW1hdG9yID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIC8vIHJlc2V0IHRoZSBpbnRlci1hbmltYXRpb24gZGVsYXksIGluIGNhc2Ugd2UgdXNlIGl0IGxhdGVyCisgICAgICAgIHN0YWdnZXJEZWxheSA9IDA7CisKKyAgICAgICAgZmluYWwgVmlld1RyZWVPYnNlcnZlciBvYnNlcnZlciA9IHBhcmVudC5nZXRWaWV3VHJlZU9ic2VydmVyKCk7IC8vIHVzZWQgZm9yIGxhdGVyIGNsZWFudXAKKyAgICAgICAgaWYgKCFvYnNlcnZlci5pc0FsaXZlKCkpIHsKKyAgICAgICAgICAgIC8vIElmIHRoZSBvYnNlcnZlcidzIG5vdCBpbiBhIGdvb2Qgc3RhdGUsIHNraXAgdGhlIHRyYW5zaXRpb24KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBpbnQgbnVtQ2hpbGRyZW4gPSBwYXJlbnQuZ2V0Q2hpbGRDb3VudCgpOworCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtQ2hpbGRyZW47ICsraSkgeworICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IHBhcmVudC5nZXRDaGlsZEF0KGkpOworCisgICAgICAgICAgICAvLyBvbmx5IGFuaW1hdGUgdGhlIHZpZXdzIG5vdCBiZWluZyBhZGRlZCBvciByZW1vdmVkCisgICAgICAgICAgICBpZiAoY2hpbGQgIT0gbmV3VmlldykgeworCisgICAgICAgICAgICAgICAgLy8gSWYgdGhlcmUncyBhbiBhbmltYXRpb24gcnVubmluZyBvbiB0aGlzIHZpZXcgYWxyZWFkeSwgY2FuY2VsIGl0CisgICAgICAgICAgICAgICAgQW5pbWF0b3IgY3VycmVudEFuaW1hdGlvbiA9IGN1cnJlbnRBbmltYXRpb25zLmdldChjaGlsZCk7CisgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRBbmltYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uLmNhbmNlbCgpOworICAgICAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9ucy5yZW1vdmUoY2hpbGQpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIE1ha2UgYSBjb3B5IG9mIHRoZSBhcHByb3ByaWF0ZSBhbmltYXRpb24KKyAgICAgICAgICAgICAgICBmaW5hbCBBbmltYXRvciBhbmltID0gYmFzZUFuaW1hdG9yLmNsb25lKCk7CisKKyAgICAgICAgICAgICAgICAvLyBDYWNoZSB0aGUgYW5pbWF0aW9uIGluIGNhc2Ugd2UgbmVlZCB0byBjYW5jZWwgaXQgbGF0ZXIKKyAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9ucy5wdXQoY2hpbGQsIGFuaW0pOworCisgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSB0YXJnZXQgb2JqZWN0IGZvciB0aGUgYW5pbWF0aW9uCisgICAgICAgICAgICAgICAgYW5pbS5zZXRUYXJnZXQoY2hpbGQpOworCisgICAgICAgICAgICAgICAgLy8gQSBPYmplY3RBbmltYXRvciAob3IgQW5pbWF0b3JTZXQgb2YgdGhlbSkgY2FuIGV4dHJhY3Qgc3RhcnQgdmFsdWVzIGZyb20KKyAgICAgICAgICAgICAgICAvLyBpdHMgdGFyZ2V0IG9iamVjdAorICAgICAgICAgICAgICAgIGFuaW0uc2V0dXBTdGFydFZhbHVlcygpOworCisgICAgICAgICAgICAgICAgLy8gQWRkIGEgbGlzdGVuZXIgdG8gdHJhY2sgbGF5b3V0IGNoYW5nZXMgb24gdGhpcyB2aWV3LiBJZiB3ZSBkb24ndCBnZXQgYSBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAvLyB0aGVuIHRoZXJlJ3Mgbm90aGluZyB0byBhbmltYXRlLgorICAgICAgICAgICAgICAgIGZpbmFsIFZpZXcuT25MYXlvdXRDaGFuZ2VMaXN0ZW5lciBsaXN0ZW5lciA9IG5ldyBWaWV3Lk9uTGF5b3V0Q2hhbmdlTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uTGF5b3V0Q2hhbmdlKFZpZXcgdiwgaW50IGxlZnQsIGludCB0b3AsIGludCByaWdodCwgaW50IGJvdHRvbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgb2xkTGVmdCwgaW50IG9sZFRvcCwgaW50IG9sZFJpZ2h0LCBpbnQgb2xkQm90dG9tKSB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRlbGwgdGhlIGFuaW1hdGlvbiB0byBleHRyYWN0IGVuZCB2YWx1ZXMgZnJvbSB0aGUgY2hhbmdlZCBvYmplY3QKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0dXBFbmRWYWx1ZXMoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyBzdGFydERlbGF5OworICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyBkdXJhdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGFuZ2VSZWFzb24gPT0gQVBQRUFSSU5HKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnREZWxheSA9IG1DaGFuZ2luZ0FwcGVhcmluZ0RlbGF5ICsgc3RhZ2dlckRlbGF5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YWdnZXJEZWxheSArPSBtQ2hhbmdpbmdBcHBlYXJpbmdTdGFnZ2VyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR1cmF0aW9uID0gbUNoYW5naW5nQXBwZWFyaW5nRHVyYXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0RGVsYXkgPSBtQ2hhbmdpbmdEaXNhcHBlYXJpbmdEZWxheSArIHN0YWdnZXJEZWxheTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFnZ2VyRGVsYXkgKz0gbUNoYW5naW5nRGlzYXBwZWFyaW5nU3RhZ2dlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdXJhdGlvbiA9IG1DaGFuZ2luZ0Rpc2FwcGVhcmluZ0R1cmF0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYW5pbS5zZXRTdGFydERlbGF5KHN0YXJ0RGVsYXkpOworICAgICAgICAgICAgICAgICAgICAgICAgYW5pbS5zZXREdXJhdGlvbihkdXJhdGlvbik7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmltIGluc3RhbmNlb2YgT2JqZWN0QW5pbWF0b3IpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKE9iamVjdEFuaW1hdG9yKSBhbmltKS5zZXRDdXJyZW50UGxheVRpbWUoMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBhbmltLnN0YXJ0KCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgb25seSByZW1vdmVzIGxpc3RlbmVycyB3aG9zZSB2aWV3cyBjaGFuZ2VkIC0gbXVzdCBjbGVhciB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG90aGVyIGxpc3RlbmVycyBsYXRlcgorICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQucmVtb3ZlT25MYXlvdXRDaGFuZ2VMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxheW91dENoYW5nZUxpc3RlbmVyTWFwLnJlbW92ZShjaGlsZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIC8vIFJlbW92ZSB0aGUgYW5pbWF0aW9uIGZyb20gdGhlIGNhY2hlIHdoZW4gaXQgZW5kcworICAgICAgICAgICAgICAgIGFuaW0uYWRkTGlzdGVuZXIobmV3IEFuaW1hdG9yTGlzdGVuZXJBZGFwdGVyKCkgeworICAgICAgICAgICAgICAgICAgICBwcml2YXRlIGJvb2xlYW4gY2FuY2VsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25BbmltYXRpb25DYW5jZWwoQW5pbWF0b3IgYW5pbWF0b3IpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIHJlbW92ZSBjYW5jZWxlZCBhbmltYXRpb25zIGltbWVkaWF0ZWx5LCBub3QgaGVyZQorICAgICAgICAgICAgICAgICAgICAgICAgY2FuY2VsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQucmVtb3ZlT25MYXlvdXRDaGFuZ2VMaXN0ZW5lcihsaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgICAgICAgICBsYXlvdXRDaGFuZ2VMaXN0ZW5lck1hcC5yZW1vdmUoY2hpbGQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uRW5kKEFuaW1hdG9yIGFuaW1hdG9yKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNhbmNlbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudEFuaW1hdGlvbnMucmVtb3ZlKGNoaWxkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgY2hpbGQuYWRkT25MYXlvdXRDaGFuZ2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QoY2hpbGQpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGF5b3V0Q2hhbmdlTGlzdGVuZXJNYXAuY2xlYXIoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2QgcnVucyB0aGUgYW5pbWF0aW9uIHRoYXQgbWFrZXMgYW4gYWRkZWQgaXRlbSBhcHBlYXIuCisgICAgICoKKyAgICAgKiBAcGFyYW0gcGFyZW50IFRoZSBWaWV3R3JvdXAgdG8gd2hpY2ggdGhlIFZpZXcgaXMgYmVpbmcgYWRkZWQuCisgICAgICogQHBhcmFtIGNoaWxkIFRoZSBWaWV3IGJlaW5nIGFkZGVkIHRvIHRoZSBWaWV3R3JvdXAuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHJ1bkFwcGVhcmluZ1RyYW5zaXRpb24oZmluYWwgVmlld0dyb3VwIHBhcmVudCwgZmluYWwgVmlldyBjaGlsZCkgeworICAgICAgICBpZiAobUFwcGVhcmluZ0FuaW0gPT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKG1MaXN0ZW5lcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoVHJhbnNpdGlvbkxpc3RlbmVyIGxpc3RlbmVyIDogbUxpc3RlbmVycykgeworICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lci5lbmRUcmFuc2l0aW9uKExheW91dFRyYW5zaXRpb24udGhpcywgcGFyZW50LCBjaGlsZCwgQVBQRUFSSU5HKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgQW5pbWF0b3IgYW5pbSA9IG1BcHBlYXJpbmdBbmltLmNsb25lKCk7CisgICAgICAgIGFuaW0uc2V0VGFyZ2V0KGNoaWxkKTsKKyAgICAgICAgYW5pbS5zZXRTdGFydERlbGF5KG1BcHBlYXJpbmdEZWxheSk7CisgICAgICAgIGFuaW0uc2V0RHVyYXRpb24obUFwcGVhcmluZ0R1cmF0aW9uKTsKKyAgICAgICAgaWYgKGFuaW0gaW5zdGFuY2VvZiBPYmplY3RBbmltYXRvcikgeworICAgICAgICAgICAgKChPYmplY3RBbmltYXRvcikgYW5pbSkuc2V0Q3VycmVudFBsYXlUaW1lKDApOworICAgICAgICB9CisgICAgICAgIGlmIChtTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGFuaW0uYWRkTGlzdGVuZXIobmV3IEFuaW1hdG9yTGlzdGVuZXJBZGFwdGVyKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uRW5kKCkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKFRyYW5zaXRpb25MaXN0ZW5lciBsaXN0ZW5lciA6IG1MaXN0ZW5lcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RlbmVyLmVuZFRyYW5zaXRpb24oTGF5b3V0VHJhbnNpdGlvbi50aGlzLCBwYXJlbnQsIGNoaWxkLCBBUFBFQVJJTkcpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICAgICAgYW5pbS5zdGFydCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRoaXMgbWV0aG9kIHJ1bnMgdGhlIGFuaW1hdGlvbiB0aGF0IG1ha2VzIGEgcmVtb3ZlZCBpdGVtIGRpc2FwcGVhci4KKyAgICAgKgorICAgICAqIEBwYXJhbSBwYXJlbnQgVGhlIFZpZXdHcm91cCBmcm9tIHdoaWNoIHRoZSBWaWV3IGlzIGJlaW5nIHJlbW92ZWQuCisgICAgICogQHBhcmFtIGNoaWxkIFRoZSBWaWV3IGJlaW5nIHJlbW92ZWQgZnJvbSB0aGUgVmlld0dyb3VwLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBydW5EaXNhcHBlYXJpbmdUcmFuc2l0aW9uKGZpbmFsIFZpZXdHcm91cCBwYXJlbnQsIGZpbmFsIFZpZXcgY2hpbGQpIHsKKyAgICAgICAgaWYgKG1EaXNhcHBlYXJpbmdBbmltID09IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKFRyYW5zaXRpb25MaXN0ZW5lciBsaXN0ZW5lciA6IG1MaXN0ZW5lcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgbGlzdGVuZXIuZW5kVHJhbnNpdGlvbihMYXlvdXRUcmFuc2l0aW9uLnRoaXMsIHBhcmVudCwgY2hpbGQsIERJU0FQUEVBUklORyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIEFuaW1hdG9yIGFuaW0gPSBtRGlzYXBwZWFyaW5nQW5pbS5jbG9uZSgpOworICAgICAgICBhbmltLnNldFN0YXJ0RGVsYXkobURpc2FwcGVhcmluZ0RlbGF5KTsKKyAgICAgICAgYW5pbS5zZXREdXJhdGlvbihtRGlzYXBwZWFyaW5nRHVyYXRpb24pOworICAgICAgICBhbmltLnNldFRhcmdldChjaGlsZCk7CisgICAgICAgIGlmIChtTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGFuaW0uYWRkTGlzdGVuZXIobmV3IEFuaW1hdG9yTGlzdGVuZXJBZGFwdGVyKCkgeworICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uRW5kKEFuaW1hdG9yIGFuaW0pIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChUcmFuc2l0aW9uTGlzdGVuZXIgbGlzdGVuZXIgOiBtTGlzdGVuZXJzKSB7CisgICAgICAgICAgICAgIC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qLworICAgIHB1YmxpYyBpbnRlcmZhY2UgVHJhbnNpdGlvbkxpc3RlbmVyIHsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyBldmVudCBpcyBzZW50IHRvIGxpc3RlbmVycyB3aGVuIGFuIEFQUEVBUklORyBvciBESVNBUFBFQVJJTkcgdHJhbnNpdGlvbgorICAgICAgICAgKiBiZWdpbnMuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSB0cmFuc2l0aW9uIFRoZSBMYXlvdXRUcmFuc2l0aW9uIHNlbmRpbmcgb3V0IHRoZSBldmVudC4KKyAgICAgICAgICogQHBhcmFtIGNvbnRhaW5lciBUaGUgVmlld0dyb3VwIG9uIHdoaWNoIHRoZSB0cmFuc2l0aW9uIGlzIHBsYXlpbmcuCisgICAgICAgICAqIEBwYXJhbSB2aWV3IFRoZSBWaWV3IG9iamVjdCBiZWluZyBhZGRlZCBvciByZW1vdmVkIGZyb20gaXRzIHBhcmVudC4KKyAgICAgICAgICogQHBhcmFtIHRyYW5zaXRpb25UeXBlIFRoZSB0eXBlIG9mIHRyYW5zaXRpb24gdGhhdCBpcyBiZWdpbm5pbmcsIGVpdGhlcgorICAgICAgICAgKiB7QGxpbmsgYW5kcm9pZC5hbmltYXRpb24uTGF5b3V0VHJhbnNpdGlvbiNBUFBFQVJJTkd9IG9yCisgICAgICAgICAqIHtAbGluayBhbmRyb2lkLmFuaW1hdGlvbi5MYXlvdXRUcmFuc2l0aW9uI0RJU0FQUEVBUklOR30uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBzdGFydFRyYW5zaXRpb24oTGF5b3V0VHJhbnNpdGlvbiB0cmFuc2l0aW9uLCBWaWV3R3JvdXAgY29udGFpbmVyLAorICAgICAgICAgICAgICAgIFZpZXcgdmlldywgaW50IHRyYW5zaXRpb25UeXBlKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyBldmVudCBpcyBzZW50IHRvIGxpc3RlbmVycyB3aGVuIGF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F0aW9uLCBhcyBpbgorICAgICAqIDxjb2RlPk9iamVjdEFuaW1hdG9yLm9mSW50KHRhcmdldCwgcHJvcGVydHlOYW1lLCAwLCAxMCkuc2V0RHVyYXRpb24oNTAwKS5zdGFydCgpPC9jb2RlPi4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgT2JqZWN0QW5pbWF0b3Igc2V0RHVyYXRpb24obG9uZyBkdXJhdGlvbikgeworICAgICAgICBzdXBlci5zZXREdXJhdGlvbihkdXJhdGlvbik7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworCisgICAgLyoqCisgICAgICogVGhlIHRhcmdldCBvYmplY3Qgd2hvc2UgcHJvcGVydHkgd2lsbCBiZSBhbmltYXRlZCBieSB0aGlzIGFuaW1hdGlvbgorICAgICAqCisgICAgICogQHJldHVybiBUaGUgb2JqZWN0IGJlaW5nIGFuaW1hdGVkCisgICAgICovCisgICAgcHVibGljIE9iamVjdCBnZXRUYXJnZXQoKSB7CisgICAgICAgIHJldHVybiBtVGFyZ2V0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIHRhcmdldCBvYmplY3Qgd2hvc2UgcHJvcGVydHkgd2lsbCBiZSBhbmltYXRlZCBieSB0aGlzIGFuaW1hdGlvbgorICAgICAqCisgICAgICogQHBhcmFtIHRhcmdldCBUaGUgb2JqZWN0IGJlaW5nIGFuaW1hdGVkCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0VGFyZ2V0KE9iamVjdCB0YXJnZXQpIHsKKyAgICAgICAgaWYgKG1UYXJnZXQgIT0gdGFyZ2V0KSB7CisgICAgICAgICAgICBtVGFyZ2V0ID0gdGFyZ2V0OworICAgICAgICAgICAgaWYgKG1UYXJnZXQgICE9IG51bGwgJiYgdGFyZ2V0ICE9IG51bGwgJiYgbVRhcmdldC5nZXRDbGFzcygpID09IHRhcmdldC5nZXRDbGFzcygpKSB7CisgICAgICAg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aCAoTm9TdWNoTWV0aG9kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZSgiUHJvcGVydHlWYWx1ZXNIb2xkZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgIkNvdWxkbid0IGZpbmQgbm8tYXJnIG1ldGhvZCBmb3IgcHJvcGVydHkgIiArIG1Qcm9wZXJ0eU5hbWUgKyAiOiAiICsgZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBhcmdzID0gbmV3IENsYXNzWzFdOworICAgICAgICAgICAgQ2xhc3MgdHlwZVZhcmlhbnRzW107CisgICAgICAgICAgICBpZiAobVZhbHVlVHlwZS5lcXVhbHMoRmxvYXQuY2xhc3MpKSB7CisgICAgICAgICAgICAgICAgdHlwZVZhcmlhbnRzID0gRkxPQVRfVkFSSUFOVFM7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1WYWx1ZVR5cGUuZXF1YWxzKEludGVnZXIuY2xhc3MpKSB7CisgICAgICAgICAgICAgICAgdHlwZVZhcmlhbnRzID0gSU5URUdFUl9WQVJJQU5UUzsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobVZhbHVlVHlwZS5lcXVhbHMoRG91YmxlLmNsYXNzKSkgeworICAgICAgICAgICAgICAgIHR5cGVWYXJpYW50cyA9IERPVUJMRV9WQVJJQU5UUzsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgdHlwZVZhcmlhbnRzID0gbmV3IENsYXNzWzFdOworICAgICAgICAgICAgICAgIHR5cGVWYXJpYW50c1swXSA9IG1WYWx1ZVR5cGU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmb3IgKENsYXNzIHR5cGVWYXJpYW50IDogdHlwZVZhcmlhbnRzKSB7CisgICAgICAgICAgICAgICAgYXJnc1swXSA9IHR5cGVWYXJpYW50OworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVyblZhbCA9IHRhcmdldENsYXNzLmdldE1ldGhvZChtZXRob2ROYW1lLCBhcmdzKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gY2hhbmdlIHRoZSB2YWx1ZSB0eXBlIHRvIHN1aXQKKyAgICAgICAgICAgICAgICAgICAgbVZhbHVlVHlwZSA9IHR5cGVWYXJpYW50OworICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0dXJuVmFsOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE5vU3VjaE1ldGhvZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFN3YWxsb3cgdGhlIGVycm9yIGFuZCBrZWVwIHRyeWluZyBvdGhlciB2YXJpYW50cworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIElmIHdlIGdvdCBoZXJlLCB0aGVuIG5vIGFwcHJvcHJpYXRlIGZ1bmN0aW9uIHdhcyBmb3VuZAorICAgICAgICAgICAgTG9nLmUoIlByb3BlcnR5VmFsdWVzSG9sZGVyIiwKKyAgICAgICAgICAgICAgICAgICAgIkNvdWxkbid0IGZpbmQgc2V0dGVyL2dldHRlciBmb3IgcHJvcGVydHkgIiArIG1Qcm9wZXJ0eU5hbWUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ3aXRoIHZhbHVlIHR5cGUgIisgbVZhbHVlVHlwZSk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gcmV0dXJuVmFsOworICAgIH0KKworCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgc2V0dGVyIG9yIGdldHRlciByZXF1ZXN0ZWQuIFRoaXMgdXRpbGl0eSBmdW5jdGlvbiBjaGVja3Mgd2hldGhlciB0aGUKKyAgICAgKiByZXF1ZXN0ZWQgbWV0aG9kIGV4aXN0cyBpbiB0aGUgcHJvcGVydHlNYXBNYXAgY2FjaGUuIElmIG5vdCwgaXQgY2FsbHMgYW5vdGhlcgorICAgICAqIHV0aWx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B3ZSd2ZSBjaGVja2VkIGl0CisgICAgICAgICAgICAvLyBidXQgYmVmb3JlIHdlJ3ZlIGFkZGVkIGFuIGVudHJ5IHRvIGl0CisgICAgICAgICAgICAvLyBUT0RPOiBjYW4gd2Ugc3RvcmUgdGhlIHNldHRlci9nZXR0ZXIgcGVyIENsYXNzIGluc3RlYWQgb2YgcGVyIE9iamVjdD8KKyAgICAgICAgICAgIHByb3BlcnR5TWFwTG9jay53cml0ZUxvY2soKS5sb2NrKCk7CisgICAgICAgICAgICBIYXNoTWFwPFN0cmluZywgTWV0aG9kPiBwcm9wZXJ0eU1hcCA9IHByb3BlcnR5TWFwTWFwLmdldCh0YXJnZXRDbGFzcyk7CisgICAgICAgICAgICBpZiAocHJvcGVydHlNYXAgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHNldHRlck9yR2V0dGVyID0gcHJvcGVydHlNYXAuZ2V0KG1Qcm9wZXJ0eU5hbWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHNldHRlck9yR2V0dGVyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBzZXR0ZXJPckdldHRlciA9IGdldFByb3BlcnR5RnVuY3Rpb24odGFyZ2V0Q2xhc3MsIHByZWZpeCwgdmFsdWVUeXBlKTsKKyAgICAgICAgICAgICAgICBpZiAocHJvcGVydHlNYXAgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU1hcCA9IG5ldyBIYXNoTWFwPFN0cmluZywgTWV0aG9kPigpOworICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU1hcE1hcC5wdXQodGFyZ2V0Q2xhc3MsIHByb3BlcnR5TWFwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcHJvcGVydHlNYXAucHV0KG1Qcm9wZXJ0eU5hbWUsIHNldHRlck9yR2V0dGVyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHBy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7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGtmLnNldFZhbHVlKG1HZXR0ZXIuaW52b2tlKHRhcmdldCkpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludm9jYXRpb25UYXJnZXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZSgiUHJvcGVydHlWYWx1ZXNIb2xkZXIiLCBlLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZSgiUHJvcGVydHlWYWx1ZXNIb2xkZXIiLCBlLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFV0aWxpdHkgZnVuY3Rpb24gdG8gc2V0IHRoZSB2YWx1ZSBzdG9yZWQgaW4gYSBwYXJ0aWN1bGFyIEtleWZyYW1lLiBUaGUgdmFsdWUgdXNlZCBpcworICAgICAqIHdoYXRldmVyIHRoZSB2YWx1ZSBpcyBmb3IgdGhlIHByb3BlcnR5IG5hbWUgc3BlY2lmaWVkIGluIHRoZSBrZXlmcmFtZSBvbiB0aGUgdGFyZ2V0IG9iamVjdC4KKyAgICAgKgorICAgICAqIEBwYXJhbSB0YXJnZXQgVGhlIHRhcmdldCBvYmplY3QgZnJvbSB3aGljaCB0aGUgY3VycmVudCB2YWx1ZSBzaG91bGQgYmUgZXh0cmFjdGVkLgorICAgICAqIEBwYXJhbSBrZiBUaGUga2V5ZnJhbWUgd2hpY2ggaG9sZHMgdGhlIHByb3BlcnR5IG5hbWUgYW5kIHZhbHVlLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzZXR1cFZhbHVlKE9iamVjdCB0YXJnZXQsIEtleWZyYW1lIGtmKSB7CisgICAgICAgI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kgeworICAgICAgICBpZiAobVNldHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1UbXBWYWx1ZUFycmF5WzBdID0gbUFuaW1hdGVkVmFsdWU7CisgICAgICAgICAgICAgICAgbVNldHRlci5pbnZva2UodGFyZ2V0LCBtVG1wVmFsdWVBcnJheSk7CisgICAgICAgICAgICB9IGNhdGNoIChJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZSgiUHJvcGVydHlWYWx1ZXNIb2xkZXIiLCBlLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgfSBjYXRjaCAoSWxsZWdhbEFjY2Vzc0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoIlByb3BlcnR5VmFsdWVzSG9sZGVyIiwgZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEludGVybmFsIGZ1bmN0aW9uLCBjYWxsZWQgYnkgVmFsdWVBbmltYXRvciwgdG8gc2V0IHVwIHRoZSBUeXBlRXZhbHVhdG9yIHRoYXQgd2lsbCBiZSB1c2VkCisgICAgICogdG8gY2FsY3VsYXRlIGFuaW1hdGVkIHZhbHVlcy4KKyAgICAgKi8KKyAgICB2b2lkIGluaXQoKSB7CisgICAgICAgIGlmIChtRXZhbHVhdG9yID09IG51bGwpIHsKKyAgICAgICAgICAgIG1FdmFsdWF0b3IgPSAobVZhbHVlVHlwZSA9PSBpbnQuY2xhc3MgfHwgbVZhbHVlVHlwZSA9PSBJbnRlZ2VyLmNsYXNzKSA/IHNJbnRFdmFsdWF0b3IgOgorICAgICAgICAgICAgICAgIChtVmFsdWVUeXBlID09IGRvdWJsZS5jbGFzcyB8fCBtVmFsdWVUeXBlID09IERvdWJsZS5jbGFzcykgPyBzRG91YmxlRXZhbHVhdG9yIDoKKyAgICAgICAgICAgICAgICA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kuCisgICAgICovCisgICAgcHVibGljIE9iamVjdCBldmFsdWF0ZShmbG9hdCBmcmFjdGlvbiwgT2JqZWN0IHN0YXJ0VmFsdWUsIE9iamVjdCBlbmRWYWx1ZSkgeworICAgICAgICBpbnQgc3RhcnRJbnQgPSAoSW50ZWdlcikgc3RhcnRWYWx1ZTsKKyAgICAgICAgaW50IHN0YXJ0QSA9IChzdGFydEludCA+PiAyNCk7CisgICAgICAgIGludCBzdGFydFIgPSAoc3RhcnRJbnQgPj4gMTYpICYgMHhmZjsKKyAgICAgICAgaW50IHN0YXJ0RyA9IChzdGFydEludCA+PiA4KSAmIDB4ZmY7CisgICAgICAgIGludCBzdGFydEIgPSBzdGFydEludCAmIDB4ZmY7CisKKyAgICAgICAgaW50IGVuZEludCA9IChJbnRlZ2VyKSBlbmRWYWx1ZTsKKyAgICAgICAgaW50IGVuZEEgPSAoZW5kSW50ID4+IDI0KTsKKyAgICAgICAgaW50IGVuZFIgPSAoZW5kSW50ID4+IDE2KSAmIDB4ZmY7CisgICAgICAgIGludCBlbmRHID0gKGVuZEludCA+PiA4KSAmIDB4ZmY7CisgICAgICAgIGludCBlbmRCID0gZW5kSW50ICYgMHhmZjsKKworICAgICAgICByZXR1cm4gKGludCkoKHN0YXJ0QSArIChpbnQpKGZyYWN0aW9uICogKGVuZEEgLSBzdGFydEEpKSkgPDwgMjQpIHwKKyAgICAgICAgICAgICAgICAoaW50KSgoc3RhcnRSICsgKGludCkoZnJhY3Rpb24gKiAoZW5kUiAtIHN0YXJ0UikpKSA8PCAxNikgfAorICAgICAgICAgICAgICAgIChpbnQpKChzdGFydEcgKyAoaW50KShmcmFjdGlvbiAqIChlbmRHIC0gc3RhcnRHKSkpIDw8IDgpIHwKKyAgICAgICAgICAgICAgICAoaW50KSgoc3RhcnRCICsgKGludCkoZnJhY3Rpb24gKiAoZW5kQiAtIHN0YXJ0QikpKSk7CisgICAgfQorfQpcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZG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sPEFuaW1hdGlvbkhhbmRsZXI+KCk7CisKKyAgICAvLyBUaGUgcGVyLXRocmVhZCBsaXN0IG9mIGFsbCBhY3RpdmUgYW5pbWF0aW9ucworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFRocmVhZExvY2FsPEFycmF5TGlzdDxWYWx1ZUFuaW1hdG9yPj4gc0FuaW1hdGlvbnMgPQorICAgICAgICAgICAgbmV3IFRocmVhZExvY2FsPEFycmF5TGlzdDxWYWx1ZUFuaW1hdG9yPj4oKSB7CisgICAgICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgICAgcHJvdGVjdGVkIEFycmF5TGlzdDxWYWx1ZUFuaW1hdG9yPiBpbml0aWFsVmFsdWUoKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQXJyYXlMaXN0PFZhbHVlQW5pbWF0b3I+KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgIC8vIFRoZSBwZXItdGhyZWFkIHNldCBvZiBhbmltYXRpb25zIHRvIGJlIHN0YXJ0ZWQgb24gdGhlIG5leHQgYW5pbWF0aW9uIGZyYW1lCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgVGhyZWFkTG9jYWw8QXJyYXlMaXN0PFZhbHVlQW5pbWF0b3I+PiBzUGVuZGluZ0FuaW1hdGlvbnMgPQorICAgICAgICAgICAgbmV3IFRocmVhZExvY2FsPEFycmF5TGlzdDxWYWx1ZUFuaW1hdG9yPj4oKSB7CisgICAgICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgICAgcHJvdGVjdGVkIEFycmF5TGlzdDxWYWx1ZUFuaW1hdG9yPiBpbml0aWFsVmFsdWUoKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQXJyYXlMaXN0PFZhbHVlQW5pbWF0b3I+KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgIC8qKgorICAgICAqIEludG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aW1lID0gQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoKTsKKyAgICAgICAgaWYgKG1QbGF5aW5nU3RhdGUgIT0gUlVOTklORykgeworICAgICAgICAgICAgbVNlZWtUaW1lID0gcGxheVRpbWU7CisgICAgICAgICAgICBtUGxheWluZ1N0YXRlID0gU0VFS0VEOworICAgICAgICB9CisgICAgICAgIG1TdGFydFRpbWUgPSBjdXJyZW50VGltZSAtIHBsYXlUaW1lOworICAgICAgICBhbmltYXRpb25GcmFtZShjdXJyZW50VGltZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0cyB0aGUgY3VycmVudCBwb3NpdGlvbiBvZiB0aGUgYW5pbWF0aW9uIGluIHRpbWUsIHdoaWNoIGlzIGVxdWFsIHRvIHRoZSBjdXJyZW50CisgICAgICogdGltZSBtaW51cyB0aGUgdGltZSB0aGF0IHRoZSBhbmltYXRpb24gc3RhcnRlZC4gQW4gYW5pbWF0aW9uIHRoYXQgaXMgbm90IHlldCBzdGFydGVkIHdpbGwKKyAgICAgKiByZXR1cm4gYSB2YWx1ZSBvZiB6ZXJvLgorICAgICAqCisgICAgICogQHJldHVybiBUaGUgY3VycmVudCBwb3NpdGlvbiBpbiB0aW1lIG9mIHRoZSBhbmltYXRpb24uCisgICAgICovCisgICAgcHVibGljIGxvbmcgZ2V0Q3VycmVudFBsYXlUaW1lKCkgeworICAgICAgICBpZiAoIW1Jbml0aWFsaXplZCB8fCBtUGxheWluZ1N0YXRlID09IFNUT1BQRUQpIHsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgICAgIHJldHVybiBBbmltYXRpb25VdGlscy5jdXJyZW50QW5pbWF0aW9uVGltZU1pbGxpcygpIC0gbVN0YXJ0VGltZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIGN1c3RvbSwgc3RhdGljIGhhbmRsZXIgaGFuZGxlcyB0aGUgdGltaW5nIHB1bHNlIHRo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bWF0b3I+IHBlbmRpbmdBbmltYXRpb25zID0gc1BlbmRpbmdBbmltYXRpb25zLmdldCgpOworICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9ucy5zaXplKCkgPiAwIHx8IGRlbGF5ZWRBbmltcy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYWxsQWdhaW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBwZW5kaW5nQW5pbXMgaG9sZHMgYW55IGFuaW1hdGlvbnMgdGhhdCBoYXZlIHJlcXVlc3RlZCB0byBiZSBzdGFydGVkCisgICAgICAgICAgICAgICAgICAgIC8vIFdlJ3JlIGdvaW5nIHRvIGNsZWFyIHNQZW5kaW5nQW5pbWF0aW9ucywgYnV0IHN0YXJ0aW5nIGFuaW1hdGlvbiBtYXkKKyAgICAgICAgICAgICAgICAgICAgLy8gY2F1c2UgbW9yZSB0byBiZSBhZGRlZCB0byB0aGUgcGVuZGluZyBsaXN0IChmb3IgZXhhbXBsZSwgaWYgb25lIGFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICAvLyBzdGFydGluZyB0cmlnZ2VycyBhbm90aGVyIHN0YXJ0aW5nKS4gU28gd2UgbG9vcCB1bnRpbCBzUGVuZGluZ0FuaW1hdGlvbnMKKyAgICAgICAgICAgICAgICAgICAgLy8gaXMgZW1wdHkuCisgICAgICAgICAgICAgICAgICAgIHdoaWxlIChwZW5kaW5nQW5pbWF0aW9ucy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8VmFsdWVBbmltYXRvcj4gcGVuZGluZ0NvcHkgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQXJyYXlMaXN0PFZhbHVlQW5pbWF0b3I+KSBwZW5kaW5nQW5pbWF0aW9ucy5jbG9uZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgcGVuZGluZ0FuaW1hdGlvbnMuY2xlYXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCA9IHBlbmRpbmdDb3B5LnNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7ICsraSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZhbHVlQW5pbWF0b3IgYW5pbSA9IHBlbmRpbmdDb3B5LmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgYW5pbWF0aW9uIGhhcyBhIHN0YXJ0RGVsYXksIHBsYWNlIGl0IG9uIHRoZSBkZWxheWVkIGxpc3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbS5tU3RhcnREZWxheSA9PSAwIHx8IGFuaW0ubVBsYXlpbmdTdGF0ZSA9PSBFTkRFRCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbS5tUGxheWluZ1N0YXRlID09IENBTkNFTEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW0uc3RhcnRBbmltYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxheWVkQW5pbXMuYWRkKGFuaW0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2ggdG8gcHJvY2VzcyBmaXJzdCBmcmFtZSBvZiBuZXcgYW5pbWF0aW9ucworICAgICAgICAgICAgICAgIGNhc2UgQU5JTUFUSU9OX0ZSQU1FOgorICAgICAgICAgICAgICAgICAgICAvLyBjdXJyZW50VGltZSBob2xkcyB0aGUgY29tbW9uIHRpbWUgZm9yIGFsbCBhbmltYXRpb25zIHByb2Nlc3NlZAorICAgICAgICAgICAgICAgICAgICAvLyBkdXJpbmcgdGhpcyBmcmFtZQorICAgICAgICAgICAgICAgICAgICBsb25nIGN1cnJlbnRUaW1lID0gQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICAgICAgQXJyYXlMaXN0PFZhbHVlQW5pbWF0b3I+IHJlYWR5QW5pbXMgPSBzUmVhZHlBbmltcy5nZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgQXJyYXlMaXN0PFZhbHVlQW5pbWF0b3I+IGVuZGluZ0FuaW1zID0gc0VuZGluZ0FuaW1zLmdldCgpOworCisgICAgICAgICAgICAgICAgICAgIC8vIEZpcnN0LCBwcm9jZXNzIGFuaW1hdGlvbnMgY3VycmVudGx5IHNpdHRpbmcgb24gdGhlIGRlbGF5ZWQgcXVldWUsIGFkZGluZworICAgICAgICAgICAgICAgICAgICAvLyB0aGVtIHRvIHRoZSBhY3RpdmUgYW5pbWF0aW9ucyBpZiB0aGV5IGFyZSByZWFkeQorICAgICAgICAgICAgICAgICAgICBpbnQgbnVtRGVsYXllZEFuaW1zID0gZGVsYXllZEFuaW1zLnNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1EZWxheWVkQW5pbXM7ICsraSkgeworICAgICAgICAgICAgICAgICAgICAgICAgVmFsdWVBbmltYXRvciBhbmltID0gZGVsYXllZEFuaW1zLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmltLmRlbGF5ZWRBbmltYXRpb25GcmFtZShjdXJyZW50VGltZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFkeUFuaW1zLmFkZChhbmltKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpbnQgbnVtUmVhZHlBbmltcyA9IHJlYWR5QW5pbXMuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICBpZiAobnVtUmVhZHlBbmltcyA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtUmVhZHlBbmltczsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmFsdWVBbmltYXRvciBhbmltID0gcmVhZHlBbmltcy5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbS5zdGFydEFuaW1hdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGF5ZWRBbmltcy5yZW1vdmUoYW5pbSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICByZWFkeUFuaW1zLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBOb3cgcHJvY2VzcyBhbGwgYWN0aXZlIGFuaW1hdGlvbnMuIFRoZSByZXR1cm4gdmFsdWUgZnJvbSBhbmltYXRpb25GcmFtZSgpCisgICAgICAgICAgICAgICAgICAgIC8vIHRlbGxzIHRoZSBoYW5kbGVyIHdoZXRoZXIgaXQgc2hvdWxkIG5vdyBiZSBlbmRlZAorICAgICAgICAgICAgICAgICAgICBpbnQgbnVtQW5pbXMgPSBhbmltYXRpb25zLnNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1BbmltczsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBWYWx1ZUFuaW1hdG9yIGFuaW0gPSBhbmltYXRpb25zLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmltLmFuaW1hdGlvbkZyYW1lKGN1cnJlbnRUaW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZGluZ0FuaW1zLmFkZChhbmltKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoZW5kaW5nQW5pbXMuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBlbmRpbmdBbmltcy5zaXplKCk7ICsraSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZGluZ0FuaW1zLmdldChpKS5lbmRBbmltYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVuZGluZ0FuaW1zLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGVyZSBhcmUgc3RpbGwgYWN0aXZlIG9yIGRlbGF5ZWQgYW5pbWF0aW9ucywgY2FsbCB0aGUgaGFuZGxlciBhZ2FpbgorICAgICAgICAgICAgICAgICAgICAvLyBhZnRlciB0aGUgZnJhbWVEZWxheQorICAgICAgICAgICAgICAgICAgICBpZiAoY2FsbEFnYWluICYmICghYW5pbWF0aW9ucy5pc0VtcHR5KCkgfHwgIWRlbGF5ZWRBbmltcy5pc0VtcHR5KCkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZW5kRW1wdHlNZXNzYWdlRGVsYXllZChBTklNQVRJT05fRlJBTUUsIE1hdGgubWF4KDAsIHNGcmFtZURlbGF5IC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoKSAtIGN1cnJlbnRUaW1lKSkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhlIGFtb3VudCBvZiB0aW1lLCBpbiBtaWxsaXNlY29uZHMsIHRvIGRlbGF5IHN0YXJ0aW5nIHRoZSB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IHN0YXJ0IHBsYXlpbmcgaW4gcmV2ZXJzZS4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgc3RhcnQoYm9vbGVhbiBwbGF5QmFja3dhcmRzKSB7CisgICAgICAgIG1QbGF5aW5nQmFja3dhcmRzID0gcGxheUJhY2t3YXJkczsKKyAgICAgICAgTG9vcGVyIGxvb3BlciA9IExvb3Blci5nZXRNYWluTG9vcGVyKCk7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNVaVRocmVhZDsKKyAgICAgICAgaWYgKGxvb3BlciAhPSBudWxsKSB7CisgICAgICAgICAgICBpc1VpVGhyZWFkID0gVGhyZWFkLmN1cnJlbnRUaHJlYWQoKSA9PSBsb29wZXIuZ2V0VGhyZWFkKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBpZ25vcmUgY2hlY2sgaWYgd2UgZG9uJ3QgaGF2ZSBhIExvb3BlciAodGhpcyBpc24ndCBhbiBBY3Rpdml0eSkKKyAgICAgICAgICAgIGlzVWlUaHJlYWQgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmICgobVN0YXJ0RGVsYXkgPT0gMCkgJiYgaXNVaVRocmVhZCkgeworICAgICAgICAgICAgaWYgKG1MaXN0ZW5lcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFycmF5TGlzdDxBbmltYXRvckxpc3RlbmVyPiB0bXBMaXN0ZW5lcnMgPQorICAgICAgICAgICAgICAgICAgICAgICAgKEFycmF5TGlzdDxBbmltYXRvckxpc3RlbmVyPikgbUxpc3RlbmVycy5jbG9uZSgpOworICAgICAgICAgICAgICAgIGZvciAoQW5pbWF0b3JMaXN0ZW5lciBsaXN0ZW5lciA6IHRtcExpc3RlbmVycykgeworICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lci5vbkFuaW1hdGlvblN0YXJ0KHRoaXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIFRoaXMgc2V0cyB0aGUgaW5pdGlhbCB2YWx1ZSBvZiB0aGUgYW5pbWF0aW9uLCBwcmlvciB0byBhY3R1YWxseSBzdGFydGluZyBpdCBydW5uaW5nCisgICAgICAgICAgICBzZXRDdXJyZW50UGxheVRpbWUoZ2V0Q3VycmVudFBsYXlUaW1lKCkpOworICAgICAgICB9CisgICAgICAgIG1DdXJyZW50SXRlcmF0aW9uID0gMDsKKyAgICAgICAgbVBsYXlpbmdTdGF0ZSA9IFNUT1BQRUQ7CisgICAgICAgIG1TdGFydGVkRGVsYXkgPSBmYWxzZTsKKyAgICAgICAgc1BlbmRpbmdBbmltYXRpb25zLmdldCgpLmFkZCh0aGlzKTsKKyAgICAgICAgQW5pbWF0aW9uSGFuZGxlciBhbmltYXRpb25IYW5kbGVyID0gc0FuaW1hdGlvbkhhbmRsZXIuZ2V0KCk7CisgICAgICAgIGlmIChhbmltYXRpb25IYW5kbGVyID09IG51bGwpIHsKKyAgICAgICAgICAgIGFuaW1hdGlvbkhhbmRsZXIgPSBuZXcgQW5pbWF0aW9uSGFuZGxlcigpOworICAgICAgICAgICAgc0FuaW1hdGlvbkhhbmRsZXIuc2V0KGFuaW1hdGlvbkhhbmRsZXIpOworICAgICAgICB9CisgICAgICAgIGFuaW1hdGlvbkhhbmRsZXIuc2VuZEVtcHR5TWVzc2FnZShBTklNQVRJT05fU1RBUlQpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHN0YXJ0KCkgeworICAgICAgICBzdGFydChmYWxzZSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgY2FuY2VsKCkgeworICAgICAgICBpZiAobUxpc3RlbmVycyAhPSBudWxsKSB7CisgICAgICAgICAgICBBcnJheUxpc3Q8QW5pbWF0b3JMaXN0ZW5lcj4gdG1wTGlzdGVuZXJzID0KKyAgICAgICAgICAgICAgICAgICAgKEFycmF5TGlzdDxBbmltYXRvckxpc3RlbmVyPikgbUxpc3RlbmVycy5jbG9uZSgpOworICAgICAgICAgICAgZm9yIChBbmltYXRvckxpc3RlbmVyIGxpc3RlbmVyIDogdG1wTGlzdGVuZXJzKSB7CisgICAgICAgICAgICAgICAgbGlzdGVuZXIub25BbmltYXRpb25DYW5jZWwodGhpcyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8gSnVzdCBzZXQgdGhlIENBTkNFTEVEIGZsYWcgLSB0aGlzIGNhdXNlcyB0aGUgYW5pbWF0aW9uIHRvIGVuZCB0aGUgbmV4dCB0aW1lIGEgZnJhbWUKKyAgICAgICAgLy8gaXMgcHJvY2Vzc2VkLgorICAgICAgICBtUGxheWluZ1N0YXRlID0gQ0FOQ0VMRUQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZW5kKCkgeworICAgICAgICBpZiAoIXNBbmltYXRpb25zLmdldCgpLmNvbnRhaW5zKHRoaXMpICYmICFzUGVuZGluZ0FuaW1hdGlvbnMuZ2V0KCkuY29udGFpbnModGhpcykpIHsKKyAgICAgICAgICAgIC8vIFNwZWNpYWwgY2FzZSBpZiB0aGUgYW5pbWF0aW9uIGhhcyBub3QgeWV0IHN0YXJ0ZWQ7IGdldCBpdCByZWFkeSBmb3IgZW5kaW5nCisgICAgICAgICAgICBtU3RhcnRlZERlbGF5ID0gZmFsc2U7CisgICAgICAgICAgICBzUGVuZGluZ0FuaW1hdGlvbnMuZ2V0KCkuYWRkKHRoaXMpOworICAgICAgICAgICAgQW5pbWF0aW9uSGFuZGxlciBhbmltYXRpb25IYW5kbGVyID0gc0FuaW1hdGlvbkhhbmRsZXIuZ2V0KCk7CisgICAgICAgICAgICBpZiAoYW5pbWF0aW9uSGFuZGxlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgYW5pbWF0aW9uSGFuZGxlciA9IG5ldyBBbmltYXRpb25IYW5kbGVyKCk7CisgICAgICAgICAgICAgICAgc0FuaW1hdGlvbkhhbmRsZX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ICAgaWYgKG1MaXN0ZW5lcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgQXJyYXlMaXN0PEFuaW1hdG9yTGlzdGVuZXI+IHRtcExpc3RlbmVycyA9CisgICAgICAgICAgICAgICAgICAgIChBcnJheUxpc3Q8QW5pbWF0b3JMaXN0ZW5lcj4pIG1MaXN0ZW5lcnMuY2xvbmUoKTsKKyAgICAgICAgICAgIGZvciAoQW5pbWF0b3JMaXN0ZW5lciBsaXN0ZW5lciA6IHRtcExpc3RlbmVycykgeworICAgICAgICAgICAgICAgIGxpc3RlbmVyLm9uQW5pbWF0aW9uRW5kKHRoaXMpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2FsbGVkIGludGVybmFsbHkgdG8gc3RhcnQgYW4gYW5pbWF0aW9uIGJ5IGFkZGluZyBpdCB0byB0aGUgYWN0aXZlIGFuaW1hdGlvbnMgbGlzdC4gTXVzdCBiZQorICAgICAqIGNhbGxlZCBvbiB0aGUgVUkgdGhyZWFkLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzdGFydEFuaW1hdGlvbigpIHsKKyAgICAgICAgaW5pdEFuaW1hdGlvbigpOworICAgICAgICBzQW5pbWF0aW9ucy5nZXQoKS5hZGQodGhpcyk7CisgICAgICAgIGlmIChtU3RhcnREZWxheSA+IDAgJiYgbUxpc3RlbmVycyAhPSBudWxsKSB7CisgICAgICAgICAgICAvLyBMaXN0ZW5lcnMgd2VyZSBhbHJlYWR5IG5vdGlmaWVkIGluIHN0YXJ0KCkgaWYgc3RhcnREZWxheSBpcyAwOyB0aGlzIGlzCisgICAgICAgICAgICAvLyBqdXN0IGZvciBkZWxheWVkIGFuaW1hdGlvbnMKKyAgICAgICAgICAgIEFycmF5TGlzdDxBbmltYXRvckxpc3RlbmVyPiB0bXBMaXN0ZW5lcnMgPQorICAgICAgICAgICAgICAgICAgICAoQXJyYXlMaXN0PEFuaW1hdG9yTGlzdGVuZXI+KSBtT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mFtZShsb25nIGN1cnJlbnRUaW1lKSB7CisgICAgICAgIGlmIChtUGxheWluZ1N0YXRlID09IENBTkNFTEVEIHx8IG1QbGF5aW5nU3RhdGUgPT0gRU5ERUQpIHsKKyAgICAgICAgICAgIC8vIGVuZCB0aGUgZGVsYXksIHByb2Nlc3MgYW4gYW5pbWF0aW9uIGZyYW1lIHRvIGFjdHVhbGx5IGNhbmNlbCBpdAorICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFtU3RhcnRlZERlbGF5KSB7CisgICAgICAgICAgICBtU3RhcnRlZERlbGF5ID0gdHJ1ZTsKKyAgICAgICAgICAgIG1EZWxheVN0YXJ0VGltZSA9IGN1cnJlbnRUaW1lOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbG9uZyBkZWx0YVRpbWUgPSBjdXJyZW50VGltZSAtIG1EZWxheVN0YXJ0VGltZTsKKyAgICAgICAgICAgIGlmIChkZWx0YVRpbWUgPiBtU3RhcnREZWxheSkgeworICAgICAgICAgICAgICAgIC8vIHN0YXJ0RGVsYXkgZW5kZWQgLSBzdGFydCB0aGUgYW5pbSBhbmQgcmVjb3JkIHRoZQorICAgICAgICAgICAgICAgIC8vIG1TdGFydFRpbWUgYXBwcm9wcmlhdGVseQorICAgICAgICAgICAgICAgIG1TdGFydFRpbWUgPSBjdXJyZW50VGltZSAtIChkZWx0YVRpbWUgLSBtU3RhcnREZWxheSk7CisgICAgICAgICAgICAgICAgbVBsYXlpbmdTdGF0ZSA9IFJVTk5JTkc7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRoaXMgaW50ZXJuYWwgZnVuY3Rpb24gcHJvY2Vzc2VzIGEgc2luZ2xlIGFuaW1hdGlvbiBmcmFtZSBmb3IgYSBnaXZlbiBhbmltYXRpb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VOTklORzsKKyAgICAgICAgICAgIGlmIChtU2Vla1RpbWUgPCAwKSB7CisgICAgICAgICAgICAgICAgbVN0YXJ0VGltZSA9IGN1cnJlbnRUaW1lOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtU3RhcnRUaW1lID0gY3VycmVudFRpbWUgLSBtU2Vla1RpbWU7CisgICAgICAgICAgICAgICAgLy8gTm93IHRoYXQgd2UncmUgcGxheWluZywgcmVzZXQgdGhlIHNlZWsgdGltZQorICAgICAgICAgICAgICAgIG1TZWVrVGltZSA9IC0xOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHN3aXRjaCAobVBsYXlpbmdTdGF0ZSkgeworICAgICAgICBjYXNlIFJVTk5JTkc6CisgICAgICAgIGNhc2UgU0VFS0VEOgorICAgICAgICAgICAgZmxvYXQgZnJhY3Rpb24gPSBtRHVyYXRpb24gPiAwID8gKGZsb2F0KShjdXJyZW50VGltZSAtIG1TdGFydFRpbWUpIC8gbUR1cmF0aW9uIDogMWY7CisgICAgICAgICAgICBpZiAoZnJhY3Rpb24gPj0gMWYpIHsKKyAgICAgICAgICAgICAgICBpZiAobUN1cnJlbnRJdGVyYXRpb24gPCBtUmVwZWF0Q291bnQgfHwgbVJlcGVhdENvdW50ID09IElORklOSVRFKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRpbWUgdG8gcmVwZWF0CisgICAgICAgICAgICAgICAgICAgIGlmIChtTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoQW5pbWF0b3JMaXN0ZW5lciBsaXN0ZW5lciA6IG1MaXN0ZW5lcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lci5vbkFuaW1hdGlvblJlcGVhdCh0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICArK21DdXJyZW50SXRlcmF0aW9uOworICAgICAgICAgICAgICAgICAgICBpZiAobVJlcGVhdE1vZGUgPT0gUkVWRVJTRSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVBsYXlpbmdCYWNrd2FyZHMgPSBtUGxheWluZ0JhY2t3YXJkcyA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBkb2Vzbid0IGFjY291bnQgZm9yIGZyYWN0aW9uIGdvaW5nIFdheXl5eXkgb3ZlciAxLCBsaWtlIDIrCisgICAgICAgICAgICAgICAgICAgIGZyYWN0aW9uID0gZnJhY3Rpb24gLSAxZjsKKyAgICAgICAgICAgICAgICAgICAgbVN0YXJ0VGltZSArPSBtRHVyYXRpb247CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZG9uZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGZyYWN0aW9uID0gTWF0aC5taW4oZnJhY3Rpb24sIDEuMGYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtUGxheWluZ0JhY2t3YXJkcykgeworICAgICAgICAgICAgICAgIGZyYWN0aW9uID0gMWYgLSBmcmFjdGlvbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGFuaW1hdGVWYWx1ZShmcmFjdGlvbik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBFTkRFRDoKKyAgICAgICAgICAgIC8vIFRoZSBmaW5hbCB2YWx1ZSBzZXQgb24gdGhlIHRhcmdldCB2YXJpZXMsIGRlcGVuZGluZyBvbiB3aGV0aGVyIHRoZSBhbmltYXRpb24KKyAgICAgICAgICAgIC8vIHdhcyBzdXBwb3NlZCB0byByZXBlYXQgYW4gb2RkIG51bWJlciBvZiB0aW1lcworICAgICAgICAgICAgaWYgKG1SZXBlYXRDb3VudCA+IDAgJiYgKG1SZXBlYX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vcm0gdGhlIGNhbGN1bGF0aW9uCisgICAgICogb2YgdGhlIGFuaW1hdGVkIHZhbHVlLjwvcD4KKyAgICAgKgorICAgICAqIEBwYXJhbSBmcmFjdGlvbiBUaGUgZWxhcHNlZCBmcmFjdGlvbiBvZiB0aGUgYW5pbWF0aW9uLgorICAgICAqLworICAgIHZvaWQgYW5pbWF0ZVZhbHVlKGZsb2F0IGZyYWN0aW9uKSB7CisgICAgICAgIGZyYWN0aW9uID0gbUludGVycG9sYXRvci5nZXRJbnRlcnBvbGF0aW9uKGZyYWN0aW9uKTsKKyAgICAgICAgaW50IG51bVZhbHVlcyA9IG1WYWx1ZXMubGVuZ3RoOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bVZhbHVlczsgKytpKSB7CisgICAgICAgICAgICBtVmFsdWVzW2ldLmNhbGN1bGF0ZVZhbHVlKGZyYWN0aW9uKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobVVwZGF0ZUxpc3RlbmVycyAhPSBudWxsKSB7CisgICAgICAgICAgICBpbnQgbnVtTGlzdGVuZXJzID0gbVVwZGF0ZUxpc3RlbmVycy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bUxpc3RlbmVyczsgKytpKSB7CisgICAgICAgICAgICAgICAgbVVwZGF0ZUxpc3RlbmVycy5nZXQoaSkub25BbmltYXRpb25VcGRhdGUodGhpcyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgVmFsdWVBbmltYXRvciBjbG9uZSgpIHsKKyAgICAgICAgZmluYWwgVmFsdWVBbmltYXRvciBhbmltID0gKFZhbHVlQW5pbWF0b3IpIHN1cGVyLmNsb25lKCk7CisgICAgICAgIGlmIChtVXBkYXRlTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgIEFycmF5TGlzdDxBbmltYXRvclVwZGF0ZUxpc3RlbmVyPiBvbGRMaXN0ZW5lcnMgPSBtVXBkYXRlTGlzdGVuZXJzOworICAgICAgICAgICAgYW5pbS5tVXBkYXRlTGlzdGVuZXJzID0gbmV3IEFycmF5TGlzdDxBbmltYXRvclVwZGF0ZUxpc3RlbmVyPigpOworICAgICAgICAgICAgaW50IG51bUxpc3RlbmVycyA9IG9sZExpc3RlbmVycy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bUxpc3RlbmVyczsgKytpKSB7CisgICAgICAgICAgICAgICAgYW5pbS5tVXBkYXRlTGlzdGVuZXJzLmFkZChvbGRMaXN0ZW5lcnMuZ2V0KGkpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBhbmltLm1TZWVrVGltZSA9IC0xOworICAgICAgICBhbmltLm1QbGF5aW5nQmFja3dhcmRzID0gZmFsc2U7CisgICAgICAgIGFuaW0ubUN1cnJlbnRJdGVyYXRpb24gPSAwOworICAgICAgICBhbmltLm1Jbml0aWFsaXplZCA9IGZhbHNlOworICAgICAgICBhbmltLm1QbGF5aW5nU3RhdGUgPSBTVE9QUEVEOworICAgICAgICBhbmltLm1TdGFydGVkRGVsYXkgPSBmYWxzZTsKKyAgICAgICAgUHJvcGVydHlWYWx1ZXNIb2xkZXJbXSBvbGRWYWx1ZXMgPSBtVmFsdWVzOworICAgICAgICBpZiAob2xkVmFsdWVzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGludCBudW1WYWx1ZXMgPSBvbGRWYWx1ZXMubGVuZ3RoOworICAgICAgICAgICAgYW5pbS5tVmFsdWVzID0gbmV3IFByb3BlcnR5VmFsdWVzSG9sZGVyW251bVZhbHVlc107CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bVZhbHVlczsgKytpKSB7CisgICAgICAgICAgICAgICAgYW5pbS5tVmFsdWVzW2ldID0gb2xkVmFsdWVzW2ldLmNsb25lKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBhbmltLm1WYW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gYWJzdHJhY3QgVmlldyBnZXRDdXN0b21OYXZpZ2F0aW9uVmlldygpOworICAgIAorICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGN1cnJlbnQgQWN0aW9uQmFyIHRpdGxlIGluIHN0YW5kYXJkIG1vZGUuCisgICAgICogUmV0dXJucyBudWxsIGlmIHtAbGluayAjZ2V0TmF2aWdhdGlvbk1vZGUoKX0gd291bGQgbm90IHJldHVybgorICAgICAqIHtAbGluayAjTkFWSUdBVElPTl9NT0RFX1NUQU5EQVJEfS4gCisgICAgICoKKyAgICAgKiBAcmV0dXJuIFRoZSBjdXJyZW50IEFjdGlvbkJhciB0aXRsZSBvciBudWxsLgorICAgICAqLworICAgIHB1YmxpYyBhYnN0cmFjdCBDaGFyU2VxdWVuY2UgZ2V0VGl0bGUoKTsKKyAgICAKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBjdXJyZW50IEFjdGlvbkJhciBzdWJ0aXRsZSBpbiBzdGFuZGFyZCBtb2RlLgorICAgICAqIFJldHVybnMgbnVsbCBpZiB7QGxpbmsgI2dldE5hdmlnYXRpb25Nb2RlKCl9IHdvdWxkIG5vdCByZXR1cm4KKyAgICAgKiB7QGxpbmsgI05BVklHQVRJT05fTU9ERV9TVEFOREFSRH0uIAorICAgICAqCisgICAgICogQHJldHVybiBUaGUgY3VycmVudCBBY3Rpb25CYXIgc3VidGl0bGUgb3IgbnVsbC4KKyAgICAgKi8KKyAgICBwdWJsaWMgYWJzdHJhY3QgQ2hhclNlcXVlbmNlIGdldFN1YnRpdGxlKCk7CisgICAgCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCBuYXZpZ2F0aW9uIG1vZGUuIFRoZSByZXN1bHQgd2lsbCBiZSBvbmUgb2Y6CisgICAgICogPHVsPgorICAgICAqIDxsaT57QGxpbmsgI05BVklHQVRJT05fTU9ERV9TVEFOREFSRH08L2xpPgorICAgICAqIDxsaT57QGxpbmsgI05BVklHQVRJT05fTU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0CisgICAgICogQHJldHVybgorICAgICAqLworICAgIHB1YmxpYyBhYnN0cmFjdCBUYWIgZ2V0VGFiQXQoaW50IGluZGV4KTsKKworICAgIC8qKgorICAgICAqIFJldHJpZXZlIHRoZSBjdXJyZW50IGhlaWdodCBvZiB0aGUgQWN0aW9uQmFyLgorICAgICAqCisgICAgICogQHJldHVybiBUaGUgQWN0aW9uQmFyJ3MgaGVpZ2h0CisgICAgICovCisgICAgcHVibGljIGFic3RyYWN0IGludCBnZXRIZWlnaHQoKTsKKworICAgIC8qKgorICAgICAqIFNob3cgdGhlIEFjdGlvbkJhciBpZiBpdCBpcyBub3QgY3VycmVudGx5IHNob3dpbmcuCisgICAgICogSWYgdGhlIHdpbmRvdyBob3N0aW5nIHRoZSBBY3Rpb25CYXIgZG9lcyBub3QgaGF2ZSB0aGUgZmVhdHVyZQorICAgICAqIHtAbGluayBXaW5kb3cjRkVBVFVSRV9BQ1RJT05fQkFSX09WRVJMQVl9IGl0IHdpbGwgcmVzaXplIGFwcGxpY2F0aW9uCisgICAgICogY29udGVudCB0byBmaXQgdGhlIG5ldyBzcGFjZSBhdmFpbGFibGUuCisgICAgICovCisgICAgcHVibGljIGFic3RyYWN0IHZvaWQgc2hvdygpOworCisgICAgLyoqCisgICAgICogSGlkZSB0aGUgQWN0aW9uQmFyIGlmIGl0IGlzIG5vdCBjdXJyZW50bHkgc2hvd2luZy4KKyAgICAgKiBJZiB0aGUgd2luZG93IGhvc3RpbmcgdGhlIEFjdGlvbkJhciBkb2VzIG5vdCBoYXZlIHRoZSBmZWF0dXJlCisgICAgICoge0BsaW5rIFdpbmRvdyNGRUFUVVJFX0FDVElPTl9CQVJfT1ZFUkxBWX0gaXQgd2lsbCByZXNpemUgYXBwbGljYXRpb24KKyAgICAgKiBjb250ZW50IHRvIGZpdCB0aGUgbmV3IHNwYWNlIGF2YWlsYWJsZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgYWJzdHJhY3Qgdm9pZCBoaWRlKCk7CisKK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xpYyBzdGF0aWMgYWJzdHJhY3QgY2xhc3MgVGFiIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEFuIGludmFsaWQgcG9zaXRpb24gZm9yIGEgdGFiLgorICAgICAgICAgKgorICAgICAgICAgKiBAc2VlICNnZXRQb3NpdGlvbigpCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBJTlZBTElEX1BPU0lUSU9OID0gLTE7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJldHVybiB0aGUgY3VycmVudCBwb3NpdGlvbiBvZiB0aGlzIHRhYiBpbiB0aGUgYWN0aW9uIGJhci4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBDdXJyZW50IHBvc2l0aW9uLCBvciB7QGxpbmsgI0lOVkFMSURfUE9TSVRJT059IGlmIHRoaXMgdGFiIGlzIG5vdCBjdXJyZW50bHkgaW4KKyAgICAgICAgICogICAgICAgICB0aGUgYWN0aW9uIGJhci4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBhYnN0cmFjdCBpbnQgZ2V0UG9zaXRpb24oKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJuIHRoZSBpY29uIGFzc29jaWF0ZWQgd2l0aCB0aGlzIHRhYi4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBUaGUgdGFiJ3MgaWNvbgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGFic3RyYWN0IERyYXdhYmxlIGdldEljb24oKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJuIHRoZSB0ZXh0IG9mIHRoaXMgdGFiLgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIFRoZSB0YWIncyB0ZXh0CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgYWJzdHJhY3QgQ2hhclNlcXVlbmNlIGdldFRleHQoKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogU2V0IHRoZSBpY29uIGRpc3BsYXllZ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ICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGFic3RyYWN0IFRhYiBzZXRDdXN0b21WaWV3KFZpZXcgdmlldyk7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJldHJpZXZlIGEgcHJldmlvdXNseSBzZXQgY3VzdG9tIHZpZXcgZm9yIHRoaXMgdGFiLgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIFRoZSBjdXN0b20gdmlldyBzZXQgYnkge0BsaW5rICNzZXRDdXN0b21WaWV3KFZpZXcpfS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBhYnN0cmFjdCBWaWV3IGdldEN1c3RvbVZpZXcoKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogR2l2ZSB0aGlzIFRhYiBhbiBhcmJpdHJhcnkgb2JqZWN0IHRvIGhvbGQgZm9yIGxhdGVyIHVzZS4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIG9iaiBPYmplY3QgdG8gc3RvcmUKKyAgICAgICAgICogQHJldHVybiBUaGUgY3VycmVudCBpbnN0YW5jZSBmb3IgY2FsbCBjaGFpbmluZworICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGFic3RyYWN0IFRhYiBzZXRUYWcoT2JqZWN0IG9iaik7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEByZXR1cm4gVGhpcyBUYWIncyB0YWcgb2JqZWN0LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGFic3RyYWN0IE9iamVjdCBnZXRUYWcoKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogU2V0IHRoZSB7QGxpbmsgVGFiTGlzdGVuZXJ9IHRoYXQgd2lsbCBoYW5kbGUgc3dpdGNoaW5nIHRvIGFuZCBmcm9tIHRoaXMgdGFiLgorICAgICAgICAgKiBBbGwgdGFicyBtdXN0IGhhdmUgYSBUYWJMaXN0ZW5lciBzZXQgYmVmb3JlIGJlaW5nIGFkZGVkIHRvIHRoZSBBY3Rpb25CYXIuCisg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dHJpbmcoZnJvbSA9IEdyYXZpdHkuTk9fR1JBVklUWSwgICAgICAgIHRvID0gIk5PTkUiKSwKKyAgICAgICAgICAgIEBWaWV3RGVidWcuSW50VG9TdHJpbmcoZnJvbSA9IEdyYXZpdHkuVE9QLCAgICAgICAgICAgICAgIHRvID0gIlRPUCIpLAorICAgICAgICAgICAgQFZpZXdEZWJ1Zy5JbnRUb1N0cmluZyhmcm9tID0gR3Jhdml0eS5CT1RUT00sICAgICAgICAgICAgdG8gPSAiQk9UVE9NIiksCisgICAgICAgICAgICBAVmlld0RlYnVnLkludFRvU3RyaW5nKGZyb20gPSBHcmF2aXR5LkxFRlQsICAgICAgICAgICAgICB0byA9ICJMRUZUIiksCisgICAgICAgICAgICBAVmlld0RlYnVnLkludFRvU3RyaW5nKGZyb20gPSBHcmF2aXR5LlJJR0hULCAgICAgICAgICAgICB0byA9ICJSSUdIVCIpLAorICAgICAgICAgICAgQFZpZXdEZWJ1Zy5JbnRUb1N0cmluZyhmcm9tID0gR3Jhdml0eS5DRU5URVJfVkVSVElDQUwsICAgdG8gPSAiQ0VOVEVSX1ZFUlRJQ0FMIiksCisgICAgICAgICAgICBAVmlld0RlYnVnLkludFRvU3RyaW5nKGZyb20gPSBHcmF2aXR5LkZJTExfVkVSVElDQUwsICAgICB0byA9ICJGSUxMX1ZFUlRJQ0FMIiksCisgICAgICAgICAgICBAVmlld0RlYnVnLkludFRvU3RyaW5nKGZyb20gPSBHcmF2aXR5LkNFTlRFUl9IT1JJWk9OVEFMLCB0byA9ICJDRU5URVJfSE9SSVpPTlRBTCIpLAorICAgICAgICAgICAgQFZpZXdEZWJ1Zy5JbnRUb1N0cmluZyhmcm9tID0gR3Jhdml0eS5GSUxMX0hPUklaT05UQUwsICAgdG8gPSAiRklMTF9IT1JJWk9OVEFMIiksCisgICAgICAgICAgICBAVmlld0RlYnVnLkludFRvU3RyaW5nKGZyb20gPSBHcmF2aXR5LkNFTlRFUiwgICAgICAgICAgICB0byA9ICJDRU5URVIiKSwKKyAgICAgICAgICAgIEBWaWV3RGVidWcuSW50VG9TdHJpbmcoZnJvbSA9IEdyYXZpdHkuRklMTCwgICAgICAgICAgICAgIHRvID0gIkZJTEwiKQorICAgICAgICB9KQorICAgICAgICBwdWJsaWMgaW50IGdyYXZpdHkgPSAtMTsKKworICAgICAgICBwdWJsaWMgTGF5b3V0UGFyYW1zKENvbnRleHQgYywgQXR0cmlidXRlU2V0IGF0dHJzKSB7CisgICAgICAgICAgICBzdXBlcihjLCBhdHRycyk7CisKKyAgICAgICAgICAgIFR5cGVkQXJyYXkgYSA9IGMub2J0YWluU3R5bGVkQXR0cmlidXRlcyhhdHRycywKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQWN0aW9uQmFyX0xheW91dFBhcmFtcyk7CisgICAgICAgICAgICBncmF2aXR5ID0gYS5nZXRJbnQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFjdGlvbkJhcl9MYXlvdXRQYXJhbXNfbGF5b3V0X2dyYXZpdHksIC0xKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBMYXlvdXRQYXJhbXMoaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7CisgICAgICAgICAgICBzdXBlcih3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgIHRoaXMuZ3Jhdml0eSA9IEdyYXZpdHkuQ0VOVEVSX1ZFUlRJQ0FMIHwgR3Jhdml0eS5MRUZUOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIExheW91dFBhcmFtcyhpbnQgd2lkdGgsIGludCBoZWlnaHQsIGludCBncmF2aXR5KSB7CisgICAgICAgICAgICBzdXBlcih3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgIHRoaXMuZ3Jhdml0eSA9IGdyYXZpdHk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgTG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WxyZWFkeSBzdG9wcGVkIGFuZCBzbworICAgICAgICAgICAgLy8gaGF2ZSBub3RoaW5nIHVzZWZ1bCB0byByZXRhaW4uCisgICAgICAgICAgICBmb3IgKGludCBpPW1BbGxMb2FkZXJNYW5hZ2Vycy5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgTG9hZGVyTWFuYWdlckltcGwgbG0gPSBtQWxsTG9hZGVyTWFuYWdlcnMudmFsdWVBdChpKTsKKyAgICAgICAgICAgICAgICBpZiAobG0ubVJldGFpbmluZykgeworICAgICAgICAgICAgICAgICAgICByZXRhaW5Mb2FkZXJzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBsbS5kb0Rlc3Ryb3koKTsKKyAgICAgICAgICAgICAgICAgICAgbUFsbExvYWRlck1hbmFnZXJzLnJlbW92ZUF0KGkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoYWN0aXZpdHkgPT0gbnVsbCAmJiBjaGlsZHJlbiA9PSBudWxsICYmIGZyYWdtZW50cyA9PSBudWxsICYmICFyZXRhaW5Mb2FkZXJzKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgTm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcyBuY2kgPSBuZXcgTm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcygpOworICAgICAgICBuY2kuYWN0aXZpdHkgPSBhY3Rpdml0eTsKKyAgICAgICAgbmNpLmNoaWxkcmVuID0gY2hpbGRyZW47CisgICAgICAgIG5jaS5mcmFnbWVudHMgPSBmcmFnbWVudHM7CisgICAgICAgIG5jaS5sb2FkZXJzID0gbUFsbExvYWRlck1hbmFnZXJzOworICAgICAgICByZXR1cm4gbmNpOworICAgIH0KKyAgICAKICAgICBwdWJsaWMgdm9pZCBvbkxvd01lbW9yeS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KiBAZGVwcmVjYXRlZCBVc2Uge0BsaW5rIEN1cnNvckxvYWRlcn0gaW5zdGVhZC4KICAgICAgKi8KLSAgICBwdWJsaWMgZmluYWwgQ3Vyc29yIG1hbmFnZWRRdWVyeShVcmkgdXJpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZ1tdIHByb2plY3Rpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHNlbGVjdGlvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSBzZWxlY3Rpb25BcmdzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBzb3J0T3JkZXIpCi0gICAgeworICAgIEBEZXByZWNhdGVkCisgICAgcHVibGljIGZpbmFsIEN1cnNvciBtYW5hZ2VkUXVlcnkoVXJpIHVyaSwgU3RyaW5nW10gcHJvamVjdGlvbiwgU3RyaW5nIHNlbGVjdGlvbiwKKyAgICAgICAgICAgIFN0cmluZ1tdIHNlbGVjdGlvbkFyZ3MsIFN0cmluZyBzb3J0T3JkZXIpIHsKICAgICAgICAgQ3Vyc29yIGMgPSBnZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeSh1cmksIHByb2plY3Rpb24sIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncywgc29ydE9yZGVyKTsKICAgICAgICAgaWYgKGMgIT0gbnVsbCkgewogICAgICAgICAgICAgc3RhcnRNYW5hZ2luZ0N1cnNvcihjKTsKQEAgLTE1NTUsNDAgKzE3MDIsNiBAQAogICAgIH0KIAogICAgIC8qKgotICAgICAqIFdyYXBwZXIgYXJvdW5kIHtAbGluayBDdXJzb3IjY29tbWl0VXBkYXRlcygpfSB0aGF0IHRha2VzIGNhcmUgb2Ygbm90aW5nCi0gICAgICogdGhhdCB0aGUgQ3Vyc29yIG5lZWRzIHRvIGJlIHJlcXVlcmllZC4gIFlvdSBjYW4gY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dtZW50cy5wb3BCYWNrU3RhY2soaWQsIGZsYWdzKTsKKyAgICB9CisgICAgCisgICAgLyoqCiAgICAgICogQ2FsbGVkIHdoZW4gdGhlIGFjdGl2aXR5IGhhcyBkZXRlY3RlZCB0aGUgdXNlcidzIHByZXNzIG9mIHRoZSBiYWNrCiAgICAgICoga2V5LiAgVGhlIGRlZmF1bHQgaW1wbGVtZW50YXRpb24gc2ltcGx5IGZpbmlzaGVzIHRoZSBjdXJyZW50IGFjdGl2aXR5LAogICAgICAqIGJ1dCB5b3UgY2FuIG92ZXJyaWRlIHRoaXMgdG8gZG8gd2hhdGV2ZXIgeW91IHdhbnQuCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgb25CYWNrUHJlc3NlZCgpIHsKLSAgICAgICAgZmluaXNoKCk7CisgICAgICAgIGlmICghbUZyYWdtZW50cy5wb3BCYWNrU3RhY2soKSkgeworICAgICAgICAgICAgZmluaXNoKCk7CisgICAgICAgIH0KICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0yMTU1LDcgKzIzODIsOSBAQAogICAgICAqLwogICAgIHB1YmxpYyBib29sZWFuIG9uQ3JlYXRlUGFuZWxNZW51KGludCBmZWF0dXJlSWQsIE1lbnUgbWVudSkgewogICAgICAgICBpZiAoZmVhdHVyZUlkID09IFdpbmRvdy5GRUFUVVJFX09QVElPTlNfUEFORUwpIHsKLSAgICAgICAgICAgIHJldHVybiBvbkNyZWF0ZU9wdGlvbnNNZW51KG1lbnUpOworICAgICAgICAgICAgYm9vbGVhbiBzaG93ID0gb25DcmVhdGVPcHRpb25zTWVudShtZW51KTsKKyAgICAgICAgICAgIHNob3cgfD0gbUZyYWdtZW50cy5kaXNwYXRjaENyZWF0ZU9wdGlvbnNNZW51KG1lbnUsIGdldE1lbnVJbmZsYXRlcigpKTsKKyAgICAgICAgICAgIHJldHVybiBzaG93OwogICAgICAgICB9CiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CkBAIC0yMTcyLDYgKzI0MDEsNyBAQAogICAgIHB1YmxpYyBib29sZWFuIG9uUHJlcGFyZVBhbmVsKGludCBmZWF0dXJlSWQsIFZpZXcgdmlldywgTWVudSBtZW51KSB7CiAgICAgICAgIGlmIChmZWF0dXJlSWQgPT0gV2luZG93LkZFQVRVUkVfT1BUSU9OU19QQU5FTCAmJiBtZW51ICE9IG51bGwpIHsKICAgICAgICAgICAgIGJvb2xlYW4gZ29mb3JpdCA9IG9uUHJlcGFyZU9wdGlvbnNNZW51KG1lbnUpOworICAgICAgICAgICAgZ29mb3JpdCB8PSBtRnJhZ21lbnRzLmRpc3BhdGNoUHJlcGFyZU9wdGlvbnNNZW51KG1lbnUpOwogICAgICAgICAgICAgcmV0dXJuIGdvZm9yaXQgJiYgbWVudS5oYXNWaXNpYmxlSXRlbXMoKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gdHJ1ZTsKQEAgLTIyMDIsMTEgKzI0MzIsMTcgQEAKICAgICAgICAgICAgICAgICAvLyBkb2Vzbid0IGNhbGwgdGhyb3VnaCB0byBzdXBlcmNsYXNzJ3MgaW1wbG1lZW50YXRpb24gb2YgZWFjaAogICAgICAgICAgICAgICAgIC8vIG9mIHRoZXNlIG1ldGhvZHMgYmVsb3cKICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KDUwMDAwLCAwLCBpdGVtLmdldFRpdGxlQ29uZGVuc2VkKCkpOwotICAgICAgICAgICAgICAgIHJldHVybiBvbk9wdGlvbnNJdGVtU2VsZWN0ZWQoaXRlbSk7CisgICAgICAgICAgICAgICAgaWYgKG9uT3B0aW9uc0l0ZW1TZWxlY3RlZChpdGVtKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIG1GcmFnbWVudHMuZGlzcGF0Y2hPcHRpb25zSXRlbVNlbGVjdGVkKGl0ZW0pOwogICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgY2FzZSBXaW5kb3cuRkVBVFVSRV9DT05URVhUX01FTlU6CiAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudCg1MDAwMCwgMSwgaXRlbS5nZXRUaXRsZUNvbmRlbnNlZCgpKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gb25Db250ZXh0SXRlbVNlbGVjdGVkKGl0ZW0pOworICAgICAgICAgICAgICAgIGlmIChvbkNvbnRleHRJdGVtU2VsZWN0ZWQoaXRlbSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBtRnJhZ21lbnRzLmRpc3BhdGNoQ29udGV4dEl0ZW1TZWxlY3RlZChpdGVtKTsKICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwpAQCAtMjIyNSw2ICsyNDYxLDcgQEAKICAgICBwdWJsaWMgdm9pZCBvblBhbmVsQ2xvc2VkKGludCBmZWF0dXJlSWQsIE1lbnUgbWVudSkgewogICAgICAgICBzd2l0Y2ggKGZlYXR1cmVJZCkgewogICAgICAgICAgICAgY2FzZSBXaW5kb3cuRkVBVFVSRV9PUFRJT05TX1BBTkVMOgorICAgICAgICAgICAgICAgIG1GcmFnbWVudHMuZGlzcGF0Y2hPcHRpb25zTWVudUNsb3NlZChtZW51KTsKICAgICAgICAgICAgICAgICBvbk9wdGlvbnNNZW51Q2xvc2VkKG1lbnUpOwogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIApAQCAtMjIzNSw2ICsyNDcyLDE1IEBACiAgICAgfQogCiAgICAgLyoqCisgICAgICogRGVjbGFyZSB0aGF0IHRoZSBvcHRpb25zIG1lbnUgaGFzIGNoYW5nZWQsIHNvIHNob3VsZCBiZSByZWNyZWF0ZWQuCisgICAgICogVGhlIHtAbGluayAjb25DcmVhdGVPcH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ID0gaWQgIT0gVmlldy5OT19JRCA/IG1GcmFnbWVudHMuZmluZEZyYWdtZW50QnlJZChpZCkgOiBudWxsOworICAgICAgICBpZiAoZnJhZ21lbnQgPT0gbnVsbCAmJiB0YWcgIT0gbnVsbCkgeworICAgICAgICAgICAgZnJhZ21lbnQgPSBtRnJhZ21lbnRzLmZpbmRGcmFnbWVudEJ5VGFnKHRhZyk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZyYWdtZW50ID09IG51bGwgJiYgY29udGFpbmVySWQgIT0gVmlldy5OT19JRCkgeworICAgICAgICAgICAgZnJhZ21lbnQgPSBtRnJhZ21lbnRzLmZpbmRGcmFnbWVudEJ5SWQoY29udGFpbmVySWQpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKEZyYWdtZW50TWFuYWdlckltcGwuREVCVUcpIExvZy52KFRBRywgIm9uQ3JlYXRlVmlldzogaWQ9MHgiCisgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGlkKSArICIgZm5hbWU9IiArIGZuYW1lCisgICAgICAgICAgICAgICAgKyAiIGV4aXN0aW5nPSIgKyBmcmFnbWVudCk7CisgICAgICAgIGlmIChmcmFnbWVudCA9PSBudWxsKSB7CisgICAgICAgICAgICBmcmFnbWVudCA9IEZyYWdtZW50Lmluc3RhbnRpYXRlKHRoaXMsIGZuYW1lKTsKKyAgICAgICAgICAgIGZyYWdtZW50Lm1Gcm9tTGF5b3V0ID0gdHJ1ZTsKKyAgICAgICAgICAgIGZyYWdtZW50Lm1GcmFnbWVudElkID0gaWQgIT0gMCA/IGlkIDogY29udGFpbmVySWQ7CisgICAgICAgICAgICBmcmFnbWVudC5tQ29udGFpbmVySWQgPSBjb250YWluZXJJZDsKKyAgICAgICAgICAgIGZyYWdtZW50Lm1UYWcgPSB0YWc7CisgICAgICAgICAgICBmcmFnbWVudC5tSW5MYXlvdXQgPSB0cnVlOworICAgICAgICAgICAgZnJhZ21lbnQubUltbWVkaWF0ZUFjdGl2aXR5ID0gdGhpczsKKyAgICAgICAgICAgIGZyYWdtZW50Lm1GcmFnbWVudE1hbmFnZXIgPSBtRnJhZ21lbnRzOworICAgICAgICAgICAgZnJhZ21lbnQub25JbmZsYXRlKGF0dHJzLCBmcmFnbWVudC5tU2F2ZWRGcmFnbWVudFN0YXRlKTsKKyAgICAgICAgICAgIG1GcmFnbWVudHMuYWRkRnJhZ21lbnQoZnJhZ21lbnQsIHRydWUpOworCisgICAgICAgIH0gZWxzZSBpZiAoZnJhZ21lbnQubUluTGF5b3V0KSB7CisgICAgICAgICAgICAvLyBBIGZyYWdtZW50IGFscmVhZHkgZXhpc3RzIGFuZCBpdCBpcyBub3Qgb25lIHdlIHJlc3RvcmVkIGZyb20KKyAgICAgICAgICAgIC8vIHByZXZpb3VzIHN0YXRlLgorICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbihhdHRycy5nZXRQb3NpdGlvbkRlc2NyaXB0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgKyAiOiBEdXBsaWNhdGUgaWQgMHgiICsgSW50ZWdlci50b0hleFN0cmluZyhpZCkKKyAgICAgICAgICAgICAgICAgICAgKyAiLCB0YWcgIiArIHRhZyArICIsIG9yIHBhcmVudCBpZCAweCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGNvbnRhaW5lcklkKQorICAgICAgICAgICAgICAgICAgICArICIgd2l0aCBhbm90aGVyIGZyYWdtZW50IGZvciAiICsgZm5hbWUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVGhpcyBmcmFnbWVudCB3YXMgcmV0YWluZWQgZnJvbSBhIHByZXZpb3VzIGluc3RhbmNlOyBnZXQgaXQKKyAgICAgICAgICAgIC8vIGdvaW5nIG5vdy4KKyAgICAgICAgICAgIGZyYWdtZW50Lm1JbkxheW91dCA9IHRydWU7CisgICAgICAgICAgICBmcmFnbWVudC5tSW1tZWRpYXRlQWN0aXZpdHkgPSB0aGlzOworICAgICAgICAgICAgLy8gSWYgdGhpcyBmcmFnbWVudCBpcyBuZXdseSBpbnN0YW50aWF0ZWQgKGVpdGhlciByaWdodCBub3csIG9yCisgICAgICAgICAgICAvLyBmcm9tIGxhc3Qgc2F2ZWQgc3RhdGUpLCB0aGVuIGdpdmUgaXQgdGhlIGF0dHJpYnV0ZXMgdG8KKyAgICAgICAgICAgIC8vIGluaXRpYWxpemUgaXRzZWxmLgorICAgICAgICAgICAgaWYgKCFmcmFnbWVudC5tUmV0YWluaW5nKSB7CisgICAgICAgICAgICAgICAgZnJhZ21lbnQub25JbmZsYXRlKGF0dHJzLCBmcmFnbWVudC5tU2F2ZWRGcmFnbWVudFN0YXRlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1GcmFnbWVudHMubW92ZVRvU3RhdGUoZnJhZ21lbnQpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGZyYWdtZW50Lm1WaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkZyYWdtZW50ICIgKyBmbmFtZQorICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjcmVhdGUgYSB2aWV3LiIpOworICAgICAgICB9CisgICAgICAgIGlmIChpZCAhPSAwKSB7CisgICAgICAgICAgICBmcmFnbWVudC5tVmlldy5zZXRJZChpZCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZyYWdtZW50Lm1WaWV3LmdldFRhZygpID09IG51bGwpIHsKKyAgICAgICAgICAgIGZyYWdtZW50Lm1WaWV3LnNldFRhZyh0YWcpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmcmFnbWVudC5tVmlldzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBQcmludCB0aGUgQWN0aXZpdHkncyBzdGF0ZSBpbnRvIHRoZSBnaXZlbiBzdHJlYW0uICBUaGlzIGdldHMgaW52b2tlZCBpZgorICAgICAqIHlvdSB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Rpb25JbnN0YW5jZXMsIGNvbmZpZyk7CiAgICAgfQogICAgIAogICAgIGZpbmFsIHZvaWQgYXR0YWNoKENvbnRleHQgY29udGV4dCwgQWN0aXZpdHlUaHJlYWQgYVRocmVhZCwKICAgICAgICAgICAgIEluc3RydW1lbnRhdGlvbiBpbnN0ciwgSUJpbmRlciB0b2tlbiwgaW50IGlkZW50LAogICAgICAgICAgICAgQXBwbGljYXRpb24gYXBwbGljYXRpb24sIEludGVudCBpbnRlbnQsIEFjdGl2aXR5SW5mbyBpbmZvLAogICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRpdGxlLCBBY3Rpdml0eSBwYXJlbnQsIFN0cmluZyBpZCwKLSAgICAgICAgICAgIE9iamVjdCBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlLAotICAgICAgICAgICAgSGFzaE1hcDxTdHJpbmcsT2JqZWN0PiBsYXN0Tm9uQ29uZmlndXJhdGlvbkNoaWxkSW5zdGFuY2VzLAorICAgICAgICAgICAgTm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcyBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcywKICAgICAgICAgICAgIENvbmZpZ3VyYXRpb24gY29uZmlnKSB7CiAgICAgICAgIGF0dGFjaEJhc2VDb250ZXh0KGNvbnRleHQpOwogCisgICAgICAgIG1GcmFnbWVudHMuYXR0YWNoQWN0aXZpdHkodGhpcyk7CisgICAgICAgIAogICAgICAgICBtV2luZG93ID0gUG9saWN5TWFuYWdlci5tYWtlTmV3V2luZG93KHRoaXMpOwogICAgICAgICBtV2luZG93LnNldENhbGxiYWNrKHRoaXMpOworICAgICAgICBtV2luZG93LmdldExheW91dEluZmxhdGVyKCkuc2V0RmFjdG9yeTIodGhpcyk7CiAgICAgICAgIGlmIChpbmZvLnNvZnRJbnB1dE1vZGUgIT0gV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuU09GVF9JTlBVVF9TVEFURV9VTlNQRUNJRklFRCkgewogICAgICAgICAgICAgbVdpbmRvdy5zZXRTb2Z0SW5wdXRNb2RlKGluZm8uc29mdElucHV0TW9kZSk7CiAgICAgICAgIH0KICAgICAgICAgbVVpVGhyZWFkID0gVGhyZWFkLmN1cnJlbnRUaHJlYWQoKTsKLQorICAgICAgICAKICAgICAgICAgbU1haW5UaHJlYWQgPSBhVGhyZWFkOwogICAgICAgICBtSW5zdHJ1bWVudGF0aW9uID0gaW5zdHI7CiAgICAgICAgIG1Ub2tlbiA9IHRva2VuOwpAQCAtMzc3MSwxMCArNDIzNiwxMCBAQAogICAgICAgICBtVGl0bGUgPSB0aXRsZTsKICAgICAgICAgbVBhcmVudCA9IHBhcmVudDsKICAgICAgICAgbUVtYmVkZGVkSUQgPSBpZDsKLSAgICAgICAgbUxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2UgPSBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlOwotICAgICAgICBtTGFzdE5vbkNvbmZpZ3VyYXRpb25DaGlsZEluc3RhbmNlcyA9IGxhc3ROb25Db25maWd1cmF0aW9uQ2hpbGRJbnN0YW5jZXM7CisgICAgICAgIG1MYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcyA9IGxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzOwogCi0gICAgICAgIG1XaW5kb3cuc2V0V2luZG93TWFuYWdlcihudWxsLCBtVG9rZW4sIG1Db21wb25lbnQuZmxhdHRlblRvU3RyaW5nKCkpOworICAgICAgICBtV2luZG93LnNldFdpbmRvd01hbmFnZXIobnVsbCwgbVRva2VuLCBtQ29tcG9uZW50LmZsYXR0ZW5Ub1N0cmluZygpLAorICAgICAgICAgICAgICAgIChpbmZvLmZsYWdzICYgQWN0aXZpdHlJbmZvLkZMQUdfSEFSRFdBUkVfQUNDRUxFUkFURUQpICE9IDApOwogICAgICAgICBpZiAobVBhcmVudCAhPSBudWxsKSB7CiAgICAgICAgICAgICBtV2luZG93LnNldENvbnRhaW5lc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YWRlck1hbmFnZXJzLnZhbHVlQXQoaSkuZmluaXNoUmV0YWluKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KICAgICB9CiAgICAgCiAgICAgZmluYWwgdm9pZCBwZXJmb3JtUmVzdGFydCgpIHsKKyAgICAgICAgbUZyYWdtZW50cy5ub3RlU3RhdGVOb3RTYXZlZCgpOworCiAgICAgICAgIHN5bmNocm9uaXplZCAobU1hbmFnZWRDdXJzb3JzKSB7CiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1NYW5hZ2VkQ3Vyc29ycy5zaXplKCk7CiAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgTWFuYWdlZEN1cnNvciBtYyA9IG1NYW5hZ2VkQ3Vyc29ycy5nZXQoaSk7CiAgICAgICAgICAgICAgICAgaWYgKG1jLm1SZWxlYXNlZCB8fCBtYy5tVXBkYXRlZCkgewotICAgICAgICAgICAgICAgICAgICBtYy5tQ3Vyc29yLnJlcXVlcnkoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFtYy5tQ3Vyc29yLnJlcXVlcnkoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRyeWluZyB0byByZXF1ZXJ5IGFuIGFscmVhZHkgY2xvc2VkIGN1cnNvciIpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIG1jLm1SZWxlYXNlZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICBtYy5tVXBkYXRlZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgIH0KQEAgLTM4MjUsNyArNDMwOCw5IEBACiAgICAgZmluYWwgdm9pZCBwZXJmb3JtUmVzdW1lKCkgewogICAgICAgICBwZXJmb3JtUmVzdGFydCgpOwogICAgICAgICAKLSAgICAgICAgbUx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mdldFNka1ZlcnNpb24KQEAgLTM4NjUsMTEgKzQzNTUsMjQgQEAKICAgICB9CiAgICAgCiAgICAgZmluYWwgdm9pZCBwZXJmb3JtU3RvcCgpIHsKKyAgICAgICAgaWYgKG1Mb2FkZXJzU3RhcnRlZCkgeworICAgICAgICAgICAgbUxvYWRlcnNTdGFydGVkID0gZmFsc2U7CisgICAgICAgICAgICBpZiAobUxvYWRlck1hbmFnZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmICghbUNoYW5naW5nQ29uZmlndXJhdGlvbnMpIHsKKyAgICAgICAgICAgICAgICAgICAgbUxvYWRlck1hbmFnZXIuZG9TdG9wKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbUxvYWRlck1hbmFnZXIuZG9SZXRhaW4oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCiAgICAgICAgIGlmICghbVN0b3BwZWQpIHsKICAgICAgICAgICAgIGlmIChtV2luZG93ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBtV2luZG93LmNsb3NlQWxsUGFuZWxzKCk7CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIG1GcmFnbWVudHMuZGlzcGF0Y2hTdG9wKCk7CisgICAgICAgICAgICAKICAgICAgICAgICAgIG1DYWxsZWQgPSBmYWxzZTsKICAgICAgICAgICAgIG1JbnN0cnVtZW50YXRpb24uY2FsbEFjdGl2aXR5T25TdG9wKHRoaXMpOwogICAgICAgICAgICAgaWYgKCFtQ2FsbGVkKSB7CkBAIC0zODk0LDYgKzQzOTcsMTUgQEAKICAgICAgICAgbVJlc3VtZWQgPSBmYWxzZTsKICAgICB9CiAKKyAgICBmaW5hbCB2b2lkIHBlcmZvcm1EZXN0cm95KCkgeworICAgICAgICBtV2luZG93LmRlc3Ryb3koKTsKKyAgICAgICAgbUZyYWdtZW50cy5kaXNwYXRjaERlc3Ryb3koKTsKKyAgICAgICAgb25EZXN0cm95KCk7CisgICAgICAgIGlmIChtTG9hZGVyTWFuYWdlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtTG9hZGVyTWFuYWdlci5kb0Rlc3Ryb3koKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKICAgICBmaW5hbCBib29sZWFuIGlzUmVzdW1lZCgpIHsKICAgICAgICAgcmV0dXJuIG1SZXN1bWVkOwogICAgIH0KQEAgLTM5MDMsOCArNDQxNSwxNCBAQAogICAgICAgICBpZiAoQ29uZmlnLkxPR1YpIExvZy52KAogICAgICAgICAgICAgVEFHLCAiRGlzcGF0Y2hpbmcgcmVzdWx0OiB3aG89IiArIHdobyArICIsIHJlcUNvZGU9IiArIHJlcXVlc3RDb2RlCiAgICAgICAgICAgICArICIsIHJlc0NvZGU9IiArIHJlc3VsdENvZGUgKyAiLCBkYXRhPSIgKyBkYXRhKTsKKyAgICAgICAgbUZyYWdtZW50cy5ub3RlU3RhdGVOb3RTYXZlZCgpOwogICAgICAgICBpZiAod2hvID09IG51bGwpIHsKICAgICAgICAgICAgIG9uQWN0aXZpdHlSZXN1bHQocmVxdWVzdENvZGUsIHJlc3VsdENvZGUsIGRhdGEpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgRnJhZ21lbnQgZnJhZyA9IG1GcmFnbWVudHMuZmluZEZyYWdtZW50QnlXaG8od2hvKTsKKyAgICAgICAgICAgIGlmIChmcmFnICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmcmFnLm9uQWN0aXZpdHlSZXN1bHQocmVxdWVzdENvZGUsIHJlc3VsdENvZGUsIGRhdGEpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvYXBwL0FjdGl2aXR5TWFuYWdlck5hdGl2ZS5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvYXBwL0FjdGl2aXR5TWFuYWdlck5hdGl2ZS5qYXZhCmluZGV4IGQ2MjMxZWEuLjhjYzY0MjggMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9BY3Rpdml0eU1hbmFnZXJOYXRpdmUuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQWN0aXZpdHlNYW5hZ2VyTmF0aXZlLmphdmEKQEAgLTEyNTAsNiArMTI1MCwzMiBAQAogICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KIAorICAgICAgICBjYXNlIElTX0lNTUVSU0lWRV9UUkFOU0FDVElPTjogeworICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElBY3Rpdml0eU1hbmFnZXIuZGVzY3JpcHRvcik7CisgICAgICAgICAgICBJQmluZGVyIHRva2VuID0gZGF0YS5yZWFkU3Ryb25nQmluZGVyKCk7CisgICAgICAgICAgICBib29sZWFuIGlzaXQgPSBpc0ltbWVyc2l2ZSh0b2tlbik7CisgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7CisgICAgICAgICAgICByZXBseS53cml0ZUludChpc2l0ID8gMSA6IDApOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFNFVF9JTU1FUlNJVkVfVFJBTlNBQ1RJT046IHsKKyAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQWN0aXZpdHlNYW5hZ2VyLmRlc2NyaXB0b3IpOworICAgICAgICAgICAgSUJpbmRlciB0b2tlbiA9IGRhdGEucmVhZFN0cm9uZ0JpbmRlcigpOworICAgICAgICAgICAgYm9vbGVhbiBpbW0gPSBkYXRhLnJlYWRJbnQoKSA9PSAxOworICAgICAgICAgICAgc2V0SW1tZXJzaXZlKHRva2VuLCBpbW0pOworICAgICAgICAgICAgcmVwbHkud3JpdGVOb0V4Y2VwdGlvbigpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGNhc2UgSVNfVE9QX0FDVElWSVRZX0lNTUVSU0lWRV9UUkFOU0FDVElPTjogeworICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElBY3Rpdml0eU1hbmFnZXIuZGVzY3JpcHRvcik7CisgICAgICAgICAgICBib29sZWFuIGlzaXQgPSBpc1RvcEFjdGl2aXR5SW1tZXJzaXZlKCk7CisgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7CisgICAgICAgICAgICByZXBseS53cml0ZUludChpc2l0ID8gMSA6IDApOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKwogICAgICAgICBjYXNlIENSQVNIX0FQUExJQ0FUSU9OX1RSQU5TQUNUSU9OOiB7CiAgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUFjdGl2aXR5TWFuYWdlci5kZXNjcmlwdG9yKTsKICAgICAgICAgICAgIGludCB1aWQgPSBkYXRhLnJlYWRJbnQoKTsKQEAgLTEzMDQsNiArMTMzMCwzMSBAQAogICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KIAorICAgICAgICBjYXNlIENIRUNLX0dSQU5UX1VSSV9QRVJNSVNTSU9OX1RSQU5TQUNUSU9OOiB7CisgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUFjdGl2aXR5TWFuYWdlci5kZXNjcmlwdG9yKTsKKyAgICAgICAgICAgIGludCBjYWxsaW5nVWlkID0gZGF0YS5yZWFkSW50KCk7CisgICAgICAgICAgICBTdHJpbmcgdGFyZ2V0UGtnID0gZGF0YS5yZWFkU3RyaW5nKCk7CisgICAgICAgICAgICBVcmkgdXJpID0gVXJpLkNSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChkYXRhKTsKKyAgICAgICAgICAgIGludCBtb2RlRmxhZ3MgPSBkYXRhLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIGludCByZXMgPSBjaGVja0dyYW50VXJpUGVybWlzc2lvbihjYWxsaW5nVWlkLCB0YXJnZXRQa2csIHVyaSwgbW9kZUZsYWdzKTsKKyAgICAgICAgICAgIHJlcGx5LndyaXRlTm9FeGNlcHRpb24oKTsKKyAgICAgICAgICAgIHJlcGx5LndyaXRlSW50KHJlcyk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgRFVNUF9IRUFQX1RSQU5TQUNUSU9OOiB7CisgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUFjdGl2aXR5TWFuYWdlci5kZXNjcmlwdG9yKTsKKyAgICAgICAgICAgIFN0cmluZyBwcm9jZXNzID0gZGF0YS5yZWFkU3RyaW5nKCk7CisgICAgICAgICAgICBib29sZWFuIG1hbmFnZWQgPSBkYXRhLnJlYWRJbnQoKSAhPSAwOworICAgICAgICAgICAgU3RyaW5nIHBhdGggPSBkYXRhLnJlYWRTdHJpbmcoKTsKKyAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkID0gZGF0YS5yZWFkSW50KCkgIT0gMAorICAgICAgICAgICAgICAgICAgICA/IGRhdGEucmVhZEZpbGVEZXNjcmlwdG9yKCkgOiBudWxsOworICAgICAgICAgICAgYm9vbGVhbiByZXMgPSBkdW1wSGVhcChwcm9jZXNzLCBtYW5hZ2VkLCBwYXRoLCBmZCk7CisgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7CisgICAgICAgICAgICByZXBseS53cml0ZUludChyZXMgPyAxIDogMCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorCiAgICAgICAgIH0KICAgICAgICAgCiAgICAgICAgIHJldHVybiBzdXBlci5vblRyYW5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7CkBAIC0yODE4LDYgKzI4NjksNDYgQEAKICAgICAgICAgcmVwbHk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GRhdGEsIHJlcGx5LCAwKTsKKyAgICAgICAgcmVwbHkucmVhZEV4Y2VwdGlvbigpOworICAgICAgICBib29sZWFuIHJlcyA9IHJlcGx5LnJlYWRJbnQoKSA9PSAxOworICAgICAgICBkYXRhLnJlY3ljbGUoKTsKKyAgICAgICAgcmVwbHkucmVjeWNsZSgpOworICAgICAgICByZXR1cm4gcmVzOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzVG9wQWN0aXZpdHlJbW1lcnNpdmUoKQorICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgIFBhcmNlbCBkYXRhID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBQYXJjZWwgcmVwbHkgPSBQYXJjZWwub2J0YWluKCk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQWN0aXZpdHlNYW5hZ2VyLmRlc2NyaXB0b3IpOworICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KElTX1RPUF9BQ1RJVklUWV9JTU1FUlNJVkVfVFJBTlNBQ1RJT04sIGRhdGEsIHJlcGx5LCAwKTsKKyAgICAgICAgcmVwbHkucmVhZEV4Y2VwdGlvbigpOworICAgICAgICBib29sZWFuIHJlcyA9IHJlcGx5LnJlYWRJbnQoKSA9PSAxOworICAgICAgICBkYXRhLnJlY3ljbGUoKTsKKyAgICAgICAgcmVwbHkucmVjeWNsZSgpOworICAgICAgICByZXR1cm4gcmVzOworICAgIH0KKwogICAgIHB1YmxpYyB2b2lkIGNyYXNoQXBwbGljYXRpb24oaW50IHVpZCwgaW50IGluaXRpYWxQaWQsIFN0cmluZyBwYWNrYWdlTmFtZSwKICAgICAgICAgICAgIFN0cmluZyBtZXNzYWdlKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKICAgICAgICAgUGFyY2VsIGRhdGEgPSBQYXJjZWwub2J0YWluKCk7CkBAIC0yODk1LDYgKzI5ODYsNDUgQEAKICAgICAgICAgZGF0YS5yZWN5Y2xlKCk7CiAgICAgICAgIHJlcGx5LnJlY3ljbGUoKTsKICAgICB9CisKKyAgICBwdWJsaWMgaW50IGNoZWNrR3JhbnRVcmlQZXJtaXNzaW9uKGludCBjYWxsaW5nVWlkLCBTdHJpbmcgdGFyZ2V0UGtnLAorICAgICAgICAgICAgVXJpIHVyaSwgaW50IG1vZGVGbGFncykgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgIFBhcmNlbCBkYXRhID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBQYXJjZWwgcmVwbHkgPSBQYXJjZWwub2J0YWluKCk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQWN0aXZpdHlNYW5hZ2VyLmRlc2NyaXB0b3IpOworICAgICAgICBkYXRhLndyaXRlSW50KGNhbGxpbmdVaWQpOworICAgICAgICBkYXRhLndyaXRlU3RyaW5nKHRhcmdldFBrZyk7CisgICAgICAgIHVyaS53cml0ZVRvUGFyY2VsKGRhdGEsIDApOworICAgICAgICBkYXRhLndyaXRlSW50KG1vZGVGbGFncyk7CisgICAgICAgIG1SZW1vdGUudHJhbnNhY3QoQ0hFQ0tfR1JBTlRfVVJJX1BFUk1JU1NJT05fVFJBTlNBQ1RJT04sIGRhdGEsIHJlcGx5LCAwKTsKKyAgICAgICAgcmVwbHkucmVhZEV4Y2VwdGlvbigpOworICAgICAgICBpbnQgcmVzID0gcmVwbHkucmVhZEludCgpOworICAgICAgICBkYXRhLnJlY3ljbGUoKTsKKyAgICAgICAgcmVwbHkucmVjeWNsZSgpOworICAgICAgICByZXR1cm4gcmVzOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGR1bXBIZWFwKFN0cmluZyBwcm9jZXNzLCBib29sZWFuIG1hbmFnZWQsCisgICAgICAgICAgICBTdHJpbmcgcGF0aCwgUGFyY2VsRmlsZURlc2NyaXB0b3IgZmQpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAg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mM7Ci0gICAgICAgIGJvb2xlYW4gcmVzdWx0QWJvcnQ7CiAgICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CiAgICAgICAgICAgICByZXR1cm4gIlJlY2VpdmVyRGF0YXtpbnRlbnQ9IiArIGludGVudCArICIgcGFja2FnZU5hbWU9IiArCi0gICAgICAgICAgICBpbmZvLnBhY2thZ2VOYW1lICsgIiByZXN1bHRDb2RlPSIgKyByZXN1bHRDb2RlCi0gICAgICAgICAgICArICIgcmVzdWx0RGF0YT0iICsgcmVzdWx0RGF0YSArICIgcmVzdWx0RXh0cmFzPSIgKyByZXN1bHRFeHRyYXMgKyAifSI7CisgICAgICAgICAgICAgICAgICAgIGluZm8ucGFja2FnZU5hbWUgKyAiIHJlc3VsdENvZGU9IiArIGdldFJlc3VsdENvZGUoKQorICAgICAgICAgICAgICAgICAgICArICIgcmVzdWx0RGF0YT0iICsgZ2V0UmVzdWx0RGF0YSgpICsgIiByZXN1bHRFeHRyYXM9IgorICAgICAgICAgICAgICAgICAgICArIGdldFJlc3VsdEV4dHJhcyhmYWxzZSkgKyAifSI7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTMzNSw5ICszNDAsOSBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgY2xhc3MgRHVtcFNlcnZpY2VJbmZvIHsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBjbGFzcyBEdW1wQ29tcG9uZW50SW5mbyB7CiAgICAgICAgIEZpbGVEZXNjcmlwdG9yIGZkOwotICAgICAgICBJQmluZGVyIHNlcnZpY2U7CisgICAgICAgIElCaW5kZXIgdG9rZW47CiAgICAgICAgIFN0cmluZ1tdIGFyZ3M7CiAgICAgICAgIGJvb2xlYW4gZHVtcGVkOwogICAgIH0KQEAgLTM2MSwxMiArMzY2LDE3IEBACiAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkOwogICAgIH0KIAor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ACiAKICAgICAgICAgcHVibGljIGZpbmFsIHZvaWQgc2NoZWR1bGVSZWNlaXZlcihJbnRlbnQgaW50ZW50LCBBY3Rpdml0eUluZm8gaW5mbywKICAgICAgICAgICAgICAgICBpbnQgcmVzdWx0Q29kZSwgU3RyaW5nIGRhdGEsIEJ1bmRsZSBleHRyYXMsIGJvb2xlYW4gc3luYykgewotICAgICAgICAgICAgUmVjZWl2ZXJEYXRhIHIgPSBuZXcgUmVjZWl2ZXJEYXRhKCk7Ci0KLSAgICAgICAgICAgIHIuaW50ZW50ID0gaW50ZW50OworICAgICAgICAgICAgUmVjZWl2ZXJEYXRhIHIgPSBuZXcgUmVjZWl2ZXJEYXRhKGludGVudCwgcmVzdWx0Q29kZSwgZGF0YSwgZXh0cmFzLAorICAgICAgICAgICAgICAgICAgICBzeW5jLCBmYWxzZSwgbUFwcFRocmVhZC5hc0JpbmRlcigpKTsKICAgICAgICAgICAgIHIuaW5mbyA9IGluZm87Ci0gICAgICAgICAgICByLnJlc3VsdENvZGUgPSByZXN1bHRDb2RlOwotICAgICAgICAgICAgci5yZXN1bHREYXRhID0gZGF0YTsKLSAgICAgICAgICAgIHIucmVzdWx0RXh0cmFzID0gZXh0cmFzOwotICAgICAgICAgICAgci5zeW5jID0gc3luYzsKLQogICAgICAgICAgICAgcXVldWVPclNlbmRNZXNzYWdlKEguUkVDRUlWRVIsIHIpOwogICAgICAgICB9CiAKQEAgLTU4Nyw5ICs1OTEsOSBAQAogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIHZvaWQgZHVtcFNlcnZpY2UoRmlsZURlc2NyaXB0b3IgZmQsIElCaW5kZXIgc2VydmljZXRva2VuLCBTdHJpbmdbXSBhcmdzKSB7Ci0gICAgICAgICAgICBEdW1wU2VydmljZUluZm8gZGF0YSA9IG5ldyBEdW1wU2VydmljZUluZm8oKTsKKyAgICAgICAgICAgIER1bXBDb21wb25lbnRJbmZvIGRhdGEgPSBuZXcgRHVtcENvbXBvbmVudEluZm8oKT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gICAgICAgcHVibGljIHZvaWQgc2NoZWR1bGVDcmFzaChTdHJpbmcgbXNnKSB7CiAgICAgICAgICAgICBxdWV1ZU9yU2VuZE1lc3NhZ2UoSC5TQ0hFRFVMRV9DUkFTSCwgbXNnKTsKICAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGR1bXBBY3Rpdml0eShGaWxlRGVzY3JpcHRvciBmZCwgSUJpbmRlciBhY3Rpdml0eXRva2VuLCBTdHJpbmdbXSBhcmdzKSB7CisgICAgICAgICAgICBEdW1wQ29tcG9uZW50SW5mbyBkYXRhID0gbmV3IER1bXBDb21wb25lbnRJbmZvKCk7CisgICAgICAgICAgICBkYXRhLmZkID0gZmQ7CisgICAgICAgICAgICBkYXRhLnRva2VuID0gYWN0aXZpdHl0b2tlbjsKKyAgICAgICAgICAgIGRhdGEuYXJncyA9IGFyZ3M7CisgICAgICAgICAgICBkYXRhLmR1bXBlZCA9IGZhbHNlOworICAgICAgICAgICAgcXVldWVPclNlbmRNZXNzYWdlKEguRFVNUF9BQ1RJVklUWSwgZGF0YSk7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKGRhdGEpIHsKKyAgICAgICAgICAgICAgICB3aGlsZSAoIWRhdGEuZHVtcGVkKSB7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLndhaXQoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm8gbmVlZCB0byBkbyBhbnl0aGluZyBoZXJlLCB3ZSB3aWxsIGtlZXAgd2FpdGluZyB1bnRpbAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gZHVtcGVkIGlzIHNldAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CiAgICAgICAgIAogICAgICAgICBAT3Z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YWxPYmplY3RDb3VudCA9IERlYnVnLmdldEJpbmRlckxvY2FsT2JqZWN0Q291bnQoKTsKICAgICAgICAgICAgIGludCBiaW5kZXJQcm94eU9iamVjdENvdW50ID0gRGVidWcuZ2V0QmluZGVyUHJveHlPYmplY3RDb3VudCgpOwogICAgICAgICAgICAgaW50IGJpbmRlckRlYXRoT2JqZWN0Q291bnQgPSBEZWJ1Zy5nZXRCaW5kZXJEZWF0aE9iamVjdENvdW50KCk7Ci0gICAgICAgICAgICBpbnQgb3BlblNzbFNvY2tldENvdW50ID0gT3BlblNTTFNvY2tldEltcGwuZ2V0SW5zdGFuY2VDb3VudCgpOworICAgICAgICAgICAgbG9uZyBvcGVuU3NsU29ja2V0Q291bnQgPSBEZWJ1Zy5jb3VudEluc3RhbmNlc09mQ2xhc3MoT3BlblNTTFNvY2tldEltcGwuY2xhc3MpOwogICAgICAgICAgICAgbG9uZyBzcWxpdGVBbGxvY2F0ZWQgPSBTUUxpdGVEZWJ1Zy5nZXRIZWFwQWxsb2NhdGVkU2l6ZSgpIC8gMTAyNDsKICAgICAgICAgICAgIFNRTGl0ZURlYnVnLlBhZ2VyU3RhdHMgc3RhdHMgPSBTUUxpdGVEZWJ1Zy5nZXREYXRhYmFzZUluZm8oKTsKIApAQCAtNzY2LDcgKzc5Niw3IEBACiAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzdGF0cy5kYlN0YXRzLnNpemUoKTsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgIERiU3RhdHMgZGJTdGF0cyA9IHN0YXRzLmRiU3RhdHMuZ2V0KGkpOwogICAgICAgICAgICAgICAgICAgICBwcmludFJvdyhwdywgREJfSU5GT19GT1JNQVQsIGRiU3RhdHMucGFnZVNpemUsIGRiU3RhdHMuZGJTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRiU3RhdHMubG9va2FzaWRlLCBkYlN0YXRzLmRiTmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGJTdGF0cy5sb29rYXNpZGUsIGRiU3RhdHMuY2FjaGUsIGRiU3RhdHMuZGJOYW1lKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICB9CiAKQEAgLTgxNywxMSArODQ3LDE1IEBACiAgICAgICAgICAgICBpbnQgTiA9IHN0YXRzLmRiU3RhdHMuc2l6ZSgpOwogICAgICAgICAgICAgaWYgKE4gPiAwKSB7CiAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiIERBVEFCQVNFUyIpOwotICAgICAgICAgICAgICAgIHByaW50Um93KHB3LCAiICAlOHMgJThzICUxNHMgICVzIiwgInBnc3oiLCAiZGJzeiIsICJMb29rYXNpZGUoYikiLCAiRGJuYW1lIik7CisgICAgICAgICAgICAgICAgcHJpbnRSb3cocHcsICIgICU4cyAlOHMgJTE0cyAlMTRzICAlcyIsICJwZ3N6IiwgImRic3oiLCAiTG9va2FzaWRlKGIpIiwgImNhY2hlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJEYm5hbWUiKTsKICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgICAgICAgICAgICAgICBEYlN0YXRzIGRiU3RhdHMgPSBzdGF0cy5kYlN0YXRzLmdldChpKTsKLSAgICAgICAgICAgICAgICAgICAgcHJpbnRSb3cocHcsIERCX0lORk9fRk9STUFULCBkYlN0YXRzLnBhZ2VTaXplLCBkYlN0YXRzLmRiU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYlN0YXRzLmxvb2thc2lkZSwgZGJTdGF0cy5kYk5hbWUpOworICAgICAgICAgICAgICAgICAgICBwcmludFJvdyhwdywgREJfSU5GT19GT1JNQVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRiU3RhdHMucGFnZVNpemUgPiAwKSA/IFN0cmluZy52YWx1ZU9mKGRiU3RhdHMucGFnZVNpemUpIDogIiAiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkYlN0YXRzLmRiU2l6ZSA+IDApID8gU3RyaW5nLnZhbHVlT2YoZGJTdGF0cy5kYlNpemUpIDogIiAiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkYlN0YXRzLmxvb2thc2lkZSA+IDApID8gU3RyaW5nLnZhbHVlT2YoZGJTdGF0cy5sb29rYXNpZGUpIDogIiAiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRiU3RhdHMuY2FjaGUsIGRiU3RhdHMuZGJOYW1lKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKQEAgLTg3NSw2ICs5MDksOCBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBFTkFCTEVfSklUICAgICAgICAgICAgICA9IDEzMjsKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRElTUEFUQ0hfUEFDS0FHRV9CUk9BRENBU1QgPSAxMzM7CiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFNDSEVEVUxFX0NSQVNIICAgICAgICAgID0gMTM0OworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBEVU1QX0hFQVAgICAgICAgICAgICAgICA9IDEzNTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRFVNUF9BQ1RJVklUWSAgICAgICAgICAgPSAxMzY7CiAgICAgICAgIFN0cmluZyBjb2RlVG9TdHJpbmcoaW50IGNvZGUpIHsKICAgICAgICAgICAgIGlmIChERUJVR19NRVNTQUdFUykgewogICAgICAgICAgICAgICAgIHN3aXRjaCAoY29kZSkgewpAQCAtOTEzLDYgKzk0OSw4IEBACiAgICAgICAgICAgICAgICAgICAgIGNhc2UgRU5BQkxFX0pJVDogcmV0dXJuICJFTkFCTEVfSklUIjsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBESVNQQVRDSF9QQUNLQUdFX0JST0FEQ0FTVDogcmV0dXJuICJESVNQQVRDSF9QQUNLQUdFX0JST0FEQ0FTVCI7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgU0NIRURVTEVfQ1JBU0g6IHJldHVybiAiU0NIRURVTEVfQ1JBU0giOworICAgICAgICAgICAgICAgICAgICBjYXNlIERVTVBfSEVBUDogcmV0dXJuICJEVU1QX0hFQVAiOworICAgICAgICAgICAgICAgICAgICBjYXNlIERVTVBfQUNUSVZJVFk6IHJldHVybiAiRFVNUF9BQ1RJVklUWSI7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuICIodW5rbm93bikiOwpAQCAtMTAwOCw3ICsxMDQ2LDcgQEAKICAgICAgICAgICAgICAgICAgICAgc2NoZWR1bGVHY0lkbGVyKCk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgRFVNUF9TRVJWSUNFOgotICAgICAgICAgICAgICAgICAgICBoYW5kbGVEdW1wU2VydmljZSgoRHVtcFNlcnZpY2VJbmZvKW1zZy5vYmopOworICAgICAgICAgICAgICAgICAgICBoYW5kbGVEdW1wU2VydmljZSgoRHVtcENvbXBvbmVudEluZm8pbXNnLm9iaik7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgTE9XX01FTU9SWToKICAgICAgICAgICAgICAgICAgICAgaGFuZGxlTG93TWVtb3J5KCk7CkBAIC0xMDM5LDE0ICsxMDc3LDM5IEBACiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgU0NIRURVTEVfQ1JBU0g6CiAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSZW1vdGVTZXJ2aWNlRXhjZXB0aW9uKChTdHJpbmcpbXNnLm9iaik7CisgICAgICAgICAgICAgICAgY2FzZSBEVU1QX0hFQVA6CisgICAgICAgICAgICAgICAgICAgIGhhbmRsZUR1bXBIZWFwKG1zZy5hcmcxICE9IDAsIChEdW1wSGVhcERhdGEpbXNnLm9iaik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgRFVNUF9BQ1RJVklUWToKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlRHVtcEFjdGl2aXR5KChEdW1wQ29tcG9uZW50SW5mbyltc2cub2JqKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoREVCVUdfTUVTU0FHRVMpIFNsb2cudihUQUcsICI8PDwgZG9uZTogIiArIG1zZy53aGF0KTsKICAgICAgICAgfQogCiAgICAgICAgIHZvaWQgbWF5YmVTbmFwc2hvdCgpIHsKICAgICAgICAgICAgIGlmIChtQm91bmRBcHBsaWNhdGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgU2FtcGxpbmdQcm9maWxlckludGVncmF0aW9uLndyaXRlU25hcHNob3QoCi0gICAgICAgICAgICAgICAgICAgICAgICBtQm91bmRBcHBsaWNhdGlvbi5wcm9jZXNzTmFtZSk7CisgICAgICAgICAgICAgICAgLy8gY29udmVydCB0aGUgKnByaXZhdGUqIEFjdGl2aXR5VGhyZWFkLlBhY2thZ2VJbmZvIHRvICpwdWJsaWMqIGtub3duCisgICAgICAgICAgICAgICAgLy8gYW5kcm9pZC5jb250ZW50LnBtLlBhY2thZ2VJbmZvCisgICAgICAgICAgICAgICAgU3RyaW5nIHBhY2thZ2VOYW1lID0gbUJvdW5kQXBwbGljYXRpb24uaW5mby5tUGFja2FnZU5hbWU7CisgICAgICAgICAgICAgICAgYW5kcm9pZC5jb250ZW50LnBtLlBhY2thZ2VJbmZvIHBhY2thZ2VJbmZvID0gbnVsbDsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBnZXRTeXN0ZW1Db250ZXh0KCk7CisgICAgICAgICAgICAgICAgICAgIGlmKGNvbnRleHQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiY2Fubm90IGdldCBhIHZhbGlkIGNvbnRleHQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBQYWNrYWdlTWFuYWdlciBwbSA9IGNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYocG0gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiY2Fubm90IGdldCBhIHZhbGlkIFBhY2thZ2VNYW5hZ2VyIik7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcGFja2FnZUluZm8gPSBwbS5nZXRQYWNrYWdlSW5mbygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWNrYWdlTmFtZSwgUGFja2FnZU1hbmFnZXIuR0VUX0FDVElWSVRJRVMpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE5hbWVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImNhbm5vdCBnZXQgcGFja2FnZSBpbmZvIGZvciAiICsgcGFja2FnZU5hbWUsIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBTYW1wbGluZ1Byb2ZpbGVySW50ZWdyYXRpb24ud3JpdGVTbmFwc2hvdChtQm91bmRBcHBsaWNhdGlvbi5wcm9jZXNzTmFtZSwgcGFja2FnZUluZm8pOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQpAQCAtMTQzNyw3ICsxNTAwLDcgQEAKIAogICAgIHB1YmxpYyBmaW5hbCBBY3Rpdml0eSBzdGFydEFjdGl2aXR5Tm93KEFjdGl2aXR5IHBhcmVudCwgU3RyaW5nIGlkLAogICAgICAgICBJbnRlbnQgaW50ZW50LCBBY3Rpdml0eUluZm8gYWN0aXZpdHlJbmZvLCBJQmluZGVyIHRva2VuLCBCdW5kbGUgc3RhdGUsCi0gICAgICAgIE9iamVjdCBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlKSB7CisgICAgICAgIEFjdGl2aXR5Lk5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMgbGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMpIHsKICAgICAgICAgQWN0aXZpdHlDbGllbnRSZWNvcmQgciA9IG5ldyBBY3Rpdml0eUNsaWVudFJlY29yZCgpOwogICAgICAgICAgICAgci50b2tlbiA9IHRva2VuOwogICAgICAgICAgICAgci5pZGVudCA9IDA7CkBAIC0xNDQ2LDcgKzE1MDksNyBAQAogICAgICAgICAgICAgci5wYXJlbnQgPSBwYXJlbnQ7CiAgICAgICAgICAgICByLmVtYmVkZGVkSUQgPSBpZDsKICAgICAgICAgICAgIHIuYWN0aXZpdHlJbmZvID0gYWN0aXZpdHlJbmZvOwotICAgICAgICAgICAgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlID0gbGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZTsKKyAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMgPSBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlczsKICAgICAgICAgaWYgKGxvY2FsTE9HVikgewogICAgICAgICAgICAgQ29tcG9uZW50TmFtZSBjb21wbmFtZSA9IGludGVudC5nZXRDb21wb25lbnQoKTsKICAgICAgICAgICAgIFN0cmluZyBuYW1lOwpAQCAtMTU2OCwxNCArMTYzMSwxMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgKyByLmFjdGl2aXR5SW5mby5uYW1lICsgIiB3aXRoIGNvbmZpZyAiICsgY29uZmlnKTsKICAgICAgICAgICAgICAgICBhY3Rpdml0eS5hdHRhY2goYXBwQ29udGV4dCwgdGhpcywgZ2V0SW5zdHJ1bWVudGF0aW9uKCksIHIudG9rZW4sCiAgICAgICAgICAgICAgICAgICAgICAgICByLmlkZW50LCBhcHAsIHIuaW50ZW50LCByLmFjdGl2aXR5SW5mbywgdGl0bGUsIHIucGFyZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgci5lbWJlZGRlZElELCByLmxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICByLmxhc3ROb25Db25maWd1cmF0aW9uQ2hpbGRJbnN0YW5jZXMsIGNvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgICAgICByLmVtYmVkZGVkSUQsIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMsIGNvbmZpZyk7CiAKICAgICAgICAgICAgICAgICBpZiAoY3VzdG9tSW50ZW50ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgYWN0aXZpdHkubUludGVudCA9IGN1c3RvbUludGVudDsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlID0gbnVsbDsKLSAgICAgICAgICAgICAgICByLmxhc3ROb25Db25maWd1cmF0aW9uQ2hpbGRJbnN0YW5jZXMgPSBudWxsOworICAgICAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMgPSBudWxsOwogICAgICAgICAgICAgICAgIGFjdGl2aXR5Lm1TdGFydGVkQWN0aXZpdHkgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBpbnQgdGhlbWUgPSByLmFjdGl2aXR5SW5mby5nZXRUaGVtZVJlc291cmNlKCk7CiAgICAgICAgICAgICAgICAgaWYgKHRoZW1lICE9IDApIHsKQEAgLTE2OTQsNiArMTc1NSw3IEBACiAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKICAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBpbnRlbnRzLmdldChpKTsKICAgICAgICAgICAgIGludGVudC5zZXRFeHRyYXNDbGFzc0xvYWRlcihyLmFjdGl2aXR5LmdldENsYXNzTG9hZGVyKCkpOworICAgICAgICAgICAgci5hY3Rpdml0eS5tRnJhZ21lbnRzLm5vdGVTdGF0ZU5vdFNhdmVkKCk7CiAgICAgICAgICAgICBtSW5zdHJ1bWVudGF0aW9uLmNhbGxBY3Rpdml0eU9uTmV3SW50ZW50KHIuYWN0aXZpdHksIGludGVudCk7CiAgICAgICAgIH0KICAgICB9CkBAIC0xNzA0LDExICsxNzY2LDEzIEBACiAgICAgICAgIGlmIChyICE9IG51bGwpIHsKICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVzdW1lZCA9ICFyLnBhdXNlZDsKICAgICAgICAgICAgIGlmIChyZXN1bWVkKSB7CisgICAgICAgICAgICAgICAgci5hY3Rpdml0eS5tVGVtcG9yYXJ5UGF1c2UgPSB0cnVlOwogICAgICAgICAgICAgICAgIG1JbnN0cnVtZW50YXRpb24uY2FsbEFjdGl2aXR5T25QYXVzZShyLmFjdGl2aXR5KTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGRlbGl2ZXJOZXdJbnRlbnRzKHIsIGludGVudHMpOwogICAgICAgICAgICAgaWYgKHJlc3VtZWQpIHsKICAgICAgICAgICAgICAgICBtSW5zdHJ1bWVudGF0aW9uLmNhbGxBY3Rpdml0eU9uUmVzdW1lKHIuYWN0aXZpdHkpOworICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubVRlbXBvcmFyeVBhdXNlID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0xNzE3LDYgKzE3ODEsMTcgQEAKICAgICAgICAgcGVyZm9ybU5ld0ludGVudHMoZGF0YS50b2tlbiwgZGF0YS5pbnRlbnRzKTsKICAgICB9CiAKKyAgICBwcml2YXRl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HRyYXNDbGFzc0xvYWRlcihjbCk7CiAgICAgICAgICAgICByZWNlaXZlciA9IChCcm9hZGNhc3RSZWNlaXZlciljbC5sb2FkQ2xhc3MoY29tcG9uZW50KS5uZXdJbnN0YW5jZSgpOwogICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBpZiAoREVCVUdfQlJPQURDQVNUKSBTbG9nLmkoVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgIkZpbmlzaGluZyBmYWlsZWQgYnJvYWRjYXN0IHRvICIgKyBkYXRhLmludGVudC5nZXRDb21wb25lbnQoKSk7Ci0gICAgICAgICAgICAgICAgbWdyLmZpbmlzaFJlY2VpdmVyKG1BcHBUaHJlYWQuYXNCaW5kZXIoKSwgZGF0YS5yZXN1bHRDb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnJlc3VsdERhdGEsIGRhdGEucmVzdWx0RXh0cmFzLCBkYXRhLnJlc3VsdEFib3J0KTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKERFQlVHX0JST0FEQ0FTVCkgU2xvZy5pKFRBRywKKyAgICAgICAgICAgICAgICAgICAgIkZpbmlzaGluZyBmYWlsZWQgYnJvYWRjYXN0IHRvICIgKyBkYXRhLmludGVudC5nZXRDb21wb25lbnQoKSk7CisgICAgICAgICAgICBkYXRhLnNlbmRGaW5pc2hlZChtZ3IpOwogICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byBpbnN0YW50aWF0ZSByZWNlaXZlciAiICsgY29tcG9uZW50CiAgICAgICAgICAgICAgICAgKyAiOiAiICsgZS50b1N0cmluZygpLCBlKTsKQEAgLTE3NjIsNDMgKzE4MzEsMjUgQEAKICAgICAgICAgICAgICAgICArICIsIGRpcj0iICsgcGFja2FnZUluZm8uZ2V0QXBwRGlyKCkpOwogCiAgICAgICAgICAgICBDb250ZXh0SW1wbCBjb250ZXh0ID0gKENvbnRleHRJbXBsKWFwcC5nZXRCYXNlQ29udGV4dCgpOwotICAgICAgICAgICAgcmVjZWl2ZXIuc2V0T3JkZXJlZEhpbnQodHJ1ZSk7Ci0gICAgICAgICAgICByZWNlaXZlci5zZXRSZXN1bHQoZGF0YS5yZXN1bHRDb2RlLCBkYXRhLnJlc3VsdERhdGEsCi0gICAgICAgICAgICAgICAgZGF0YS5yZXN1bHRFeHRyYXMpOwotICAgICAgICAgICAgcmVjZWl2ZXIuc2V0T3JkZXJlZEhpbnQoZGF0YS5zeW5jKTsKKyAgICAgICAgICAgIHNDdXJyZW50QnJvYWRjYXN0SW50ZW50LnNldChkYXRhLmludGVudCk7CisgICAgICAgICAgICByZWNlaXZlci5zZXRQZW5kaW5nUmVzdWx0KGRhdGEpOwogICAgICAgICAgICAgcmVjZWl2ZXIub25SZWNlaXZlKGNvbnRleHQuZ2V0UmVjZWl2ZXJSZXN0cmljdGVkQ29udGV4dCgpLAogICAgICAgICAgICAgICAgICAgICBkYXRhLmludGVudCk7CiAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGlmIChERUJVR19CUk9BRENBU1QpIFNsb2cuaShUQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAiRmluaXNoaW5nIGZhaWxlZCBicm9hZGNhc3QgdG8gIiArIGRhdGEuaW50ZW50LmdldENvbXBvbmVudCgpKTsKLSAgICAgICAgICAgICAgICBtZ3IuZmluaXNoUmVjZWl2ZXIobUFwcFRocmVhZC5hc0JpbmRlcigpLCBkYXRhLnJlc3VsdENvZGUsCi0gICAgICAgICAgICAgICAgICAgIGRhdGEucmVzdWx0RGF0YSwgZGF0YS5yZXN1bHRFeHRyYXMsIGRhdGEucmVzdWx0QWJvcnQpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoREVCVUdfQlJPQURDQVNUKSBTbG9nLmkoVEFHLAorICAgICAgICAgICAgICAgICAgICAiRmluaXNoaW5nIGZhaWxlZCBicm9hZGNhc3QgdG8gIiArIGRhdGEuaW50ZW50LmdldENvbXBvbmVudCgpKTsKKyAgICAgICAgICAgIGRhdGEuc2VuZEZpbmlzaGVkKG1ncik7CiAgICAgICAgICAgICBpZiAoIW1JbnN0cnVtZW50YXRpb24ub25FeGNlcHRpb24ocmVjZWl2ZXIsIGUpKSB7CiAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgICJVbmFibGUgdG8gc3RhcnQgcmVjZWl2ZXIgIiArIGNvbXBvbmVudAogICAgICAgICAgICAgICAgICAgICArICI6ICIgKyBlLnRvU3RyaW5nKCksIGUpOwogICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgc0N1cnJlbnRCcm9hZGNhc3RJbnRlbnQuc2V0KG51bGwpOwogICAgICAgICB9CiAKLSAgICAgICAgUXVldWVkV29yay53YWl0VG9GaW5pc2goKTsKLQotICAgICAgICB0cnkgewotICAgICAgICAgICAgaWYgKGRhdGEuc3luYykgewotICAgICAgICAgICAgICAgIGlmIChERUJVR19CUk9BRENBU1QpIFNsb2cuaShUQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAiRmluaXNoaW5nIG9yZGVyZWQgYnJvYWRjYXN0IHRvICIgKyBkYXRhLmludGVudC5nZXRDb21wb25lbnQoKSk7Ci0gICAgICAgICAgICAgICAgbWdyLmZpbmlzaFJlY2VpdmVyKAotICAgICAgICAgICAgICAgICAgICBtQXBwVGhyZWFkLmFzQmluZGVyKCksIHJlY2VpdmVyLmdldFJlc3VsdENvZGUoKSwKLSAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZXIuZ2V0UmVzdWx0RGF0YSgpLCByZWNlaXZlci5nZXRSZXN1bHRFeHRyYXMoZmFsc2UpLAotICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZXIuZ2V0QWJvcnRCcm9hZGNhc3QoKSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChERUJVR19CUk9BRENBU1QpIFNsb2cuaShUQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAiRmluaXNoaW5nIGJyb2FkY2FzdCB0byAiICsgZGF0YS5pbnRlbnQuZ2V0Q29tcG9uZW50KCkpOwotICAgICAgICAgICAgICAgIG1nci5maW5pc2hSZWNlaXZlcihtQXBwVGhyZWFkLmFzQmluZGVyKCksIDAsIG51bGwsIG51bGwsIGZhbHNlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CisgICAgICAgIGlmIChyZWNlaXZlci5nZXRQZW5kaW5nUmVzdWx0KCkgIT0gbnVsbCkgeworICAgICAgICAgICAgZGF0YS5maW5pc2goKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTk4OCw5ICsyMDM5LDkgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBoYW5kbGVEdW1wU2VydmljZShEdW1wU2VydmljZUluZm8gaW5mbykgeworICAgIHByaXZhdGUgdm9pZCBoYW5kbGVEdW1wU2VydmljZShEdW1wQ29tcG9uZW50SW5mbyBpbmZvKSB7CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBTZXJ2aWNlIHMgPSBtU2VydmljZXMuZ2V0KGluZm8uc2VydmljZSk7CisgICAgICAgICAgICBTZXJ2aWNlIHMgPSBtU2VydmljZXMuZ2V0KGluZm8udG9rZW4pOwogICAgICAgICAgICAgaWYgKHMgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIFByaW50V3JpdGVyIHB3ID0gbmV3IFByaW50V3JpdGVyKG5ldyBGaWxlT3V0cHV0U3RyZWFtKGluZm8uZmQpKTsKICAgICAgICAgICAgICAgICBzLmR1bXAoaW5mby5mZCwgcHcsIGluZm8uYXJncyk7CkBAIC0yMDA0LDYgKzIwNTUsMjIgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHByaXZhdGUgdm9pZCBoYW5kbGVEdW1wQWN0aXZpdHkoRHVtcENvbXBvbmVudEluZm8gaW5mbykgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgQWN0aXZpdHlDbGllbnRSZWNvcmQgciA9IG1BY3Rpdml0aWVzLmdldChpbmZvLnRva2VuKTsKKyAgICAgICAgICAgIGlmIChyICE9IG51bGwgJiYgci5hY3Rpdml0eSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgUHJpbnRXcml0ZXIgcHcgPSBuZXcgUHJpbnRXcml0ZXIobmV3IEZpbGVPdXRwdXRTdHJlYW0oaW5mby5mZCkpOworICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkuZHVtcChpbmZvLmZkLCBwdywgaW5mby5hcmdzKTsKKyAgICAgICAgICAgICAgICBwdy5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChpbmZvKSB7CisgICAgICAgICAgICAgICAgaW5mby5kdW1wZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIGluZm8ubm90aWZ5QWxsKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKICAgICBwcml2YXRlIGZpbmFsIHZvaWQgaGFuZGxlU2VydmljZUFyZ3MoU2VydmljZUFyZ3NEYXRhIGRhdGEpIHsKICAgICAgICAgU2VydmljZSBzID0gbVNlcnZpY2VzLmdldChkYXRhLnRva2VuKTsKICAgICAgICAgaWYgKHMgIT0gbnVsbCkgewpAQCAtMjUxOCw2ICsyNTg1LDcgQEAKICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAvLyBOb3cgd2UgYXJlIGlkbGUuCiAgICAgICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICByLmFjdGl2aXR5Lm1UZW1wb3JhcnlQYXVzZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgIG1JbnN0cnVtZW50YXRpb24uY2FsbEFjdGl2aXR5T25QYXVzZShyLmFjdGl2aXR5KTsKICAgICAgICAgICAgICAgICAgICAgaWYgKCFyLmFjdGl2aXR5Lm1DYWxsZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigKQEAgLTI1MzgsNiArMjYwNiw3IEBACiAgICAgICAgICAgICBkZWxpdmVyUmVzdWx0cyhyLCByZXMucmVzdWx0cyk7CiAgICAgICAgICAgICBpZiAocmVzdW1lZCkgewogICAgICAgICAgICAgICAgIG1JbnN0cnVtZW50YXRpb24uY2FsbEFjdGl2aXR5T25SZXN1bWUoci5hY3Rpdml0eSk7CisgICAgICAgICAgICAgICAgci5hY3Rpdml0eS5tVGVtcG9yYXJ5UGF1c2UgPSBmYWxzZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTI1NTUsNiArMjYyNCw5IEBACiAgICAgICAgICAgICBpZiAoZmluaXNoaW5nKSB7CiAgICAgICAgICAgICAgICAgci5hY3Rpdml0eS5tRmluaXNoZWQgPSB0cnVlOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGdldE5vbkNvbmZpZ0luc3RhbmNlKSB7CisgICAgICAgICAgICAgICAgci5hY3Rpdml0eS5tQ2hhbmdpbmdDb25maWd1cmF0aW9ucyA9IHRydWU7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoIXIucGF1c2VkKSB7CiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgci5hY3Rpdml0eS5tQ2FsbGVkID0gZmFsc2U7CkBAIC0yNTk1LDggKzI2NjcsOCBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKGdldE5vbkNvbmZpZ0luc3RhbmNlKSB7CiAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgPSByLmFjdGl2aXR5Lm9uUmV0YWluTm9uQ29uZmlndXJhdGlvbkluc3RhbmNlKCk7CisgICAgICAgICAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IHIuYWN0aXZpdHkucmV0YWluTm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcygpOwogICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmICghbUluc3RydW1lbnRhdGlvbi5vbkV4Y2VwdGlvbihyLmFjdGl2aXR5LCBlKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oCkBAIC0yNjA1LDIyICsyNjc3LDEwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIjogIiArIGUudG9TdHJpbmcoKSwgZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkNoaWxkSW5zdGFuY2VzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgPSByLmFjdGl2aXR5Lm9uUmV0YWluTm9uQ29uZmlndXJhdGlvbkNoaWxkSW5zdGFuY2VzKCk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtSW5zdHJ1bWVudGF0aW9uLm9uRXhjZXB0aW9uKHIuYWN0aXZpdHksIGUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byByZXRhaW4gY2hpbGQgYWN0aXZpdGllcyAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2FmZVRvQ29tcG9uZW50U2hvcnRTdHJpbmcoci5pbnRlbnQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIjogIiArIGUudG9TdHJpbmcoKSwgZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgci5hY3Rpdml0eS5tQ2FsbGVkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgci5hY3Rpdml0eS5vbkRlc3Ryb3koKTsKKyAgICAgICAgICAgICAgICBtSW5zdHJ1bWVudGF0aW9uLmNhbGxBY3Rpdml0eU9uRGVzdHJveShyLmFjdGl2aXR5KTsKICAgICAgICAgICAgICAgICBpZiAoIXIuYWN0aXZpdHkubUNhbGxlZCkgewogICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU3VwZXJOb3RDYWxsZWRFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgICAgICAiQWN0aXZpdHkgIiArIHNhZmVUb0NvbXBvbmVudFNob3J0U3RyaW5nKHIuaW50ZW50KSArCkBAIC0zMDMyLDYgKzMwOTIsMjUgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIGZpbmFsIHZvaWQgaGFuZGxlRHVtcEhlYXAoYm9vbGVhbiBtYW5hZ2VkLCBEdW1wSGVhcERhdGEgZGhkKSB7CisgICAgICAgIGlmIChtYW5hZ2VkKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIERlYnVnLmR1bXBIcHJvZkRhdGEoZGhkLnBhdGgsIGRoZC5mZC5nZXRGaWxlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAiTWFuYWdlZCBoZWFwIGR1bXAgZmFpbGVkIG9uIHBhdGggIiArIGRoZC5wYXRoCisgICAgICAgICAgICAgICAgICAgICAgICArICIgLS0gY2FuIHRoZSBwcm9jZXNzIGFjY2VzcyB0aGlzIHBhdGg/Iik7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGRoZC5mZC5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIkZhaWx1cmUgY2xvc2luZyBwcm9maWxlIGZkIiwgZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgRGVidWcuZHVtcE5hdGl2ZUhlYXAoZGhkLmZkLmdldEZpbGVEZXNjcmlwdG9yKCkpOworICAgICAgICB9CisgICAgfQorCiAgICAgZmluYWwgdm9pZCBoYW5kbGVEaXNwYXRjaFBhY2thZ2VCcm9hZGNhc3QoaW50IGNtZCwgU3RyaW5nW10gcGFja2FnZXMpIHsKICAgICAgICAgYm9vbGVhbiBoYXNQa2dJbmZvID0gZmFsc2U7CiAgICAgICAgIGlmIChwYWNrYWdlcyAhPSBudWxsKSB7CkBAIC0zMTIzLDYgKzMyMDIsMTcgQEAKICAgICAgICAgfQogCiAgICAgICAgIC8qKgorICAgICAgICAgKiBGb3I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bnRleHQsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGUuVGhlbWVfRGlhbG9nX0FsZXJ0KTsKKyAgICAgICAgc3VwZXIoY29udGV4dCwgZ2V0RGVmYXVsdERpYWxvZ1RoZW1lKGNvbnRleHQpKTsKICAgICAgICAgc2V0Q2FuY2VsYWJsZShjYW5jZWxhYmxlKTsKICAgICAgICAgc2V0T25DYW5jZWxMaXN0ZW5lcihjYW5jZWxMaXN0ZW5lcik7CiAgICAgICAgIG1BbGVydCA9IG5ldyBBbGVydENvbnRyb2xsZXIoY29udGV4dCwgdGhpcywgZ2V0V2luZG93KCkpOwogICAgIH0KIAorICAgIHByaXZhdGUgc3RhdGljIGludCBnZXREZWZhdWx0RGlhbG9nVGhlbWUoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIFR5cGVkVmFsdWUgb3V0VmFsdWUgPSBuZXcgVHlwZWRWYWx1ZSgpOworICAgICAgICBjb250ZXh0LmdldFRoZW1lKCkucmVzb2x2ZUF0dHJpYnV0ZShjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmF0dHIuYWxlcnREaWFsb2dUaGVtZSwKKyAgICAgICAgICAgICAgICBvdXRWYWx1ZSwgdHJ1ZSk7CisgICAgICAgIHJldHVybiBvdXRWYWx1ZS5yZXNvdXJjZUlkOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikgeworICAgICAgICBpZiAobUNhbmNlbGFibGUpIHsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcgZGVjb3IgPSBtV2luZG93LmdldERlY29yVmlldygpOworICAgICAgICAgICAgZmluYWwgaW50IHdpZHRoID0gZGVjb3IuZ2V0V2lkdGgoKTsKKyAgICAgICAgICAgIGZpbmFsIGludCBoZWlnaHQgPSBkZWNvci5nZXRIZWlnaHQoKTsKKyAgICAgICAgICAgIGZpbmFsIGZsb2F0IHggPSBldi5nZXRYKCk7CisgICAgICAgICAgICBmaW5hbCBmbG9hdCB5ID0gZXYuZ2V0WSgpOworCisgICAgICAgICAgICBpZiAobUNhbmNlbGFibGUgJiYgKHggPCAwIHx8IHggPiB3aWR0aCB8fCB5IDwgMCB8fCB5ID4gaGVpZ2h0KSkgeworICAgICAgICAgICAgICAgIGNhbmNlbCgpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHN1cGVyLm9uVG91Y2hFdmVudChldik7CisgICAgfQorCiAgICAgLyoqCiAgICAgICogR2V0cyBvbmUgb2YgdGhlIGJ1dHRvbnMgdXNlZCBpbiB0aGUgZGlhbG9nLgogICAgICAqIDxwPgpAQCAtMjcxLDcgKzMwMCw3IEBACiAgICAgICAgICAqIENvbnN0cnVjdG9yIHVzaW5nIGEgY29udGV4dCBmb3IgdGhpcyBidWlsZGVyIGFuZCB0aGUge0BsaW5rIEFsZXJ0RGlhbG9nfSBpdCBjcmVhdGVzLgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIEJ1aWxkZXIoQ29udGV4dCBjb250ZXh0KSB7Ci0gICAgICAgICAgICB0aGlzKGNvbnRleHQsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGUuVGhlbWVfRGlhbG9nX0FsZXJ0KTsKKyAgICAgICAgICAgIHRoaXMoY29udGV4dCwgZ2V0RGVmYXVsdERpYWxvZ1RoZW1lKGNvbnRleHQpKTsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgpAQCAtMjc5LDExICszMDgsMjMgQEAKICAgICAgICAgICogdGhlIHtAbGluayBBbGVydERpYWxvZ30gaXQgY3JlYXRlcy4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBCdWlsZGVyKENvbnRleHQgY29udGV4dCwgaW50IHRoZW1lKSB7Ci0gICAgICAgICAgICBQID0gbmV3IEFsZXJ0Q29udHJvbGxlci5BbGVydFBhcmFtcyhjb250ZXh0KTsKKyAgICAgICAgICAgIFAgPSBuZXcgQWxlcnRDb250cm9sbGVyLkFsZXJ0UGFyYW1zKG5ldyBDb250ZXh0VGhlbWVXcmFwcGVyKGNvbnRleHQsIHRoZW1lKSk7CiAgICAgICAgICAgICBtVGhlbWUgPSB0aGVtZTsKICAgICAgICAgfQogICAgICAgICAKICAgICAgICAgLyoqCisgICAgICAgICAqIFJldHVybnMgYSB7QGxpbmsgQ29udGV4dH0gd2l0aCB0aGUgYXBwcm9wcmlhdGUgdGhlbWUgZm9yIGRpYWxvZ3MgY3JlYXRlZCBieSB0aGlzIEJ1aWxkZXIuCisgICAgICAgICAqIEFwcGxpY2F0aW9ucyBzaG91bGQgdXNlIHRoaXMgQ29udGV4dCBmb3Igb2J0YWluaW5nIExheW91dEluZmxhdGVycyBmb3IgaW5mbGF0aW5nIHZpZXdzCisgICAgICAgICAqIHRoYXQgd2lsbCBiZSB1c2VkIGluIHRoZSByZXN1bHRpbmcgZGlhbG9ncywgYXMgaXQgd2lsbCBjYXVzZSB2aWV3cyB0byBiZSBpbmZsYXRlZCB3aXRoCisgICAgICAgICAqIHRoZSBjb3JyZWN0IHRoZW1lLgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIEEgQ29udGV4dCBmb3IgYnVpbHQgRGlhbG9ncy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBDb250ZXh0IGdldENvbnRleHQoKSB7CisgICAgICAgICAgICByZXR1cm4gUC5tQ29udGV4dDsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgogICAgICAgICAgKiBTZXQgdGhlIHRpdGxlIHVzaW5nIHRoZSBnaXZlbiByZXNvdXJjZSBpZC4KICAgICAgICAgICoKICAgICAgICAgICogQHJldHVybiBUaGlzIEJ1aWxkZXIgb2JqZWN0IHRvIGFsbG93IGZvciBjaGFpbmluZyBvZiBjYWxscyB0byBzZXQgbWV0aG9kcwpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvYXBw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vYW5kcm9pZC9hcHAvQXBwbGljYXRpb25UaHJlYWROYXRpdmUuamF2YQppbmRleCAxYzIwMDYyLi45NTY4OWZjIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQXBwbGljYXRpb25UaHJlYWROYXRpdmUuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQXBwbGljYXRpb25UaHJlYWROYXRpdmUuamF2YQpAQCAtNDAzLDYgKzQwMywzMiBAQAogICAgICAgICAgICAgc2NoZWR1bGVDcmFzaChtc2cpOwogICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KKworICAgICAgICBjYXNlIERVTVBfSEVBUF9UUkFOU0FDVElPTjoKKyAgICAgICAgeworICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElBcHBsaWNhdGlvblRocmVhZC5kZXNjcmlwdG9yKTsKKyAgICAgICAgICAgIGJvb2xlYW4gbWFuYWdlZCA9IGRhdGEucmVhZEludCgpICE9IDA7CisgICAgICAgICAgICBTdHJpbmcgcGF0aCA9IGRhdGEucmVhZFN0cmluZygpOworICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IgZmQgPSBkYXRhLnJlYWRJbnQoKSAhPSAwCisgICAgICAgICAgICAgICAgICAgID8gZGF0YS5yZWFkRmlsZURlc2NyaXB0b3IoKSA6IG51bGw7CisgICAgICAgICAgICBkdW1wSGVhcChtYW5hZ2VkLCBwYXRoLCBmZCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgRFVNUF9BQ1RJVklUWV9UUkFOU0FDVElPTjogeworICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElBcHBsaWNhdGlvblRocmVhZC5kZXNjcmlwdG9yKTsKKyAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkID0gZGF0YS5yZWFkRmlsZURlc2NyaXB0b3IoKTsKKyAgICAgICAgICAgIGZpbmFsIElCaW5kZXIgYWN0aXZpdHkgPSBkYXRhLnJlYWRTdHJvbmdCaW5kZXIoKTsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZ1tdIGFyZ3MgPSBkYXRhLnJlYWRTdHJpbmdBcnJheSgpOworICAgICAgICAgICAgaWYgKGZkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBkdW1wQWN0aXZpdHkoZmQuZ2V0RmlsZURlc2NyaXB0b3IoKSwgYWN0aXZpdHksIGFyZ3MpOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGZkLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICByZXR1cm4gc3VwZXIub25UcmFuc2FjdChjb2RlLCBkYXRhLCByZXBseSwgZmxhZ3MpOwpAQCAtODI5LDUgKzg1NSwzMyBAQAogICAgICAgICBkYXRhLnJlY3ljbGUoKTsKICAgICAgICAgCiAgICAgfQorCisgICAgcHVibGljIHZvaWQgZHVtcEhlYXAoYm9vbGVhbiBtYW5hZ2VkLCBTdHJpbmcgcGF0aCwKKyAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgUGFyY2VsIGRhdGEgPSBQYXJjZWwub2J0YWluKCk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXBwbGljYXRpb25UaHJlYWQuZGVzY3JpcHRvcik7CisgICAgICAgIGRhdGEud3JpdGVJbnQobWFuYWdlZCA/IDEgOiAwKTsKKyAgICAgICAgZGF0YS53cml0ZVN0cmluZyhwYXRoKTsKKyAgICAgICAgaWYgKGZkICE9IG51bGwpIHsKKyAgICAgICAgICAgIGRhdGEud3JpdGVJbnQoMSk7CisgICAgICAgICAgICBmZC53cml0ZVRvUGFyY2VsKGRhdGEsIFBhcmNlbGFibGUuUEFSQ0VMQUJMRV9XUklURV9SRVRVUk5fVkFMVUUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGF0YS53cml0ZUludCgwKTsKKyAgICAgICAgfQorICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KERVTVBfSEVBUF9UUkFOU0FDVElPTiwgZGF0YSwgbnVsbCwKKyAgICAgICAgICAgICAgICBJQmluZGVyLkZMQUdfT05FV0FZKTsKKyAgICAgICAgZGF0YS5yZWN5Y2xlKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgZHVtcEFjdGl2aXR5KEZpbGVEZXNjcmlwdG9yIGZkLCBJQmluZGVyIHRva2VuLCBTdHJpbmdbXSBhcmdzKQorICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgIFBhcmNlbCBkYXRhID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUFwcGxpY2F0aW9uVGhyZWFkLmRlc2NyaXB0b3IpOworICAgICAgICBkYXRhLndyaXRlRmlsZURlc2NyaXB0b3IoZmQpOworICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKHRva2VuKTsKKyAgICAgICAgZGF0YS53cml0ZVN0cmluZ0FycmF5KGFyZ3MpOworICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KERVTVBfQUNUSVZJVFlfVFJBTlNBQ1RJT04sIGRhdGEsIG51bGwsIDApOworICAgICAgICBkYXRhLnJlY3ljbGUoKTsKKyAgICB9CiB9CiAKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9CYWNrU3RhY2tSZWNvcmQuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC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worCisgICAgICAgIGlmICghYnNlLm1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiTm90IG9uIGJhY2sgc3RhY2siKTsKKyAgICAgICAgfQorCisgICAgICAgIG9wID0gYnNlLm1IZWFkOworICAgICAgICBpbnQgcG9zID0gMDsKKyAgICAgICAgd2hpbGUgKG9wICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1PcHNbcG9zKytdID0gb3AuY21kOworICAgICAgICAgICAgbU9wc1twb3MrK10gPSBvcC5mcmFnbWVudC5tSW5kZXg7CisgICAgICAgICAgICBtT3BzW3BvcysrXSA9IG9wLmVudGVyQW5pbTsKKyAgICAgICAgICAgIG1PcHNbcG9zKytdID0gb3AuZXhpdEFuaW07CisgICAgICAgICAgICBpZiAob3AucmVtb3ZlZCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IE4gPSBvcC5yZW1vdmVkLnNpemUoKTsKKyAgICAgICAgICAgICAgICBtT3BzW3BvcysrXSA9IE47CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICBtT3BzW3BvcysrXSA9IG9wLnJlbW92ZWQuZ2V0KGkpLm1JbmRleDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1PcHNbcG9zKytdID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG9wID0gb3AubmV4dDsKKyAgICAgICAgfQorICAgICAgICBtVHJhbnNpdGlvbiA9IGJzZS5tVHJhbnNpdGlvbjsKKyAgICAgICAgbVRyYW5zaXRpb25TdHlsZSA9IGJzZS5tVHJhbnNpdGlvblN0eWxlOworICAgICAgICBtTmFtZSA9IGJzZS5tTmFtZTsKKyAgICAgICAgbUluZGV4ID0gYnNlLm1JbmRleDsKKyAgICAgICAgbUJyZWFkQ3J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SBuZXcgQmFja1N0YWNrUmVjb3JkKGZtKTsKKyAgICAgICAgaW50IHBvcyA9IDA7CisgICAgICAgIHdoaWxlIChwb3MgPCBtT3BzLmxlbmd0aCkgeworICAgICAgICAgICAgQmFja1N0YWNrUmVjb3JkLk9wIG9wID0gbmV3IEJhY2tTdGFja1JlY29yZC5PcCgpOworICAgICAgICAgICAgb3AuY21kID0gbU9wc1twb3MrK107CisgICAgICAgICAgICBpZiAoRnJhZ21lbnRNYW5hZ2VySW1wbC5ERUJVRykgTG9nLnYoRnJhZ21lbnRNYW5hZ2VySW1wbC5UQUcsCisgICAgICAgICAgICAgICAgICAgICJCU0UgIiArIGJzZSArICIgc2V0IGJhc2UgZnJhZ21lbnQgIyIgKyBtT3BzW3Bvc10pOworICAgICAgICAgICAgRnJhZ21lbnQgZiA9IGZtLm1BY3RpdmUuZ2V0KG1PcHNbcG9zKytdKTsKKyAgICAgICAgICAgIG9wLmZyYWdtZW50ID0gZjsKKyAgICAgICAgICAgIG9wLmVudGVyQW5pbSA9IG1PcHNbcG9zKytdOworICAgICAgICAgICAgb3AuZXhpdEFuaW0gPSBtT3BzW3BvcysrXTsKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbU9wc1twb3MrK107CisgICAgICAgICAgICBpZiAoTiA+IDApIHsKKyAgICAgICAgICAgICAgICBvcC5yZW1vdmVkID0gbmV3IEFycmF5TGlzdDxGcmFnbWVudD4oTik7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICBpZiAoRnJhZ21lbnRNYW5hZ2VySW1wbC5ERUJVRykgTG9nLnYoRnJhZ21lbnRNYW5hZ2VySW1wbC5UQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkJTRSAiICsgYnNlICsgIiBzZXQgcmVtb3ZlIGZyYWdtZW50ICMiICsgbU9wc1twb3NdKTsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgciA9IGZtLm1BY3RpdmUuZ2V0KG1PcHNbcG9zKytdKTsKKyAgICAgICAgICAgICAgICAgICAgb3AucmVtb3ZlZC5hZGQocik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnNlLmFkZE9wKG9wKTsKKyAgICAgICAgfQorICAgICAgICBic2UubVRyYW5zaXRpb24gPSBtVHJhbnNpdGlvbjsKKyAgICAgICAgYnNlLm1UcmFuc2l0aW9uU3R5bGUgPSBtVHJhbnNpdGlvblN0eWxlOworICAgICAgICBic2UubU5hbWUgPSBtTmFtZTsKKyAgICAgICAgYnNlLm1JbmRleCA9IG1JbmRleDsKKyAgICAgICAgYnNlLm1BZGRUb0JhY2tTdGFjayA9IHRydWU7CisgICAgICAgIGJzZS5tQnJlYWRDcnVtYlRpdGxlUmVzID0gbUJyZWFkQ3J1bWJUaXRsZVJlczsKKyAgICAgICAgYnNlLm1CcmVhZENydW1iVGl0bGVUZXh0ID0gbUJyZWFkQ3J1bWJUaXRsZVRleHQ7CisgICAgICAgIGJzZS5tQnJlYWRDcnVtYlNob3J0VGl0bGVSZXMgPSBtQnJlYWRDcnVtYlNob3J0VGl0bGVSZXM7CisgICAgICAgIGJzZS5tQnJlYWRDcnVtYlNob3J0VGl0bGVUZXh0ID0gbUJyZWFkQ3J1bWJTaG9ydFRpdGxlVGV4dDsKKyAgICAgICAgYnNlLmJ1bXBCYWNrU3RhY2tOZXN0aW5nKDEpOworICAgICAgICByZXR1cm4gYnNlOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgIGRlc3Qud3JpdGVJbnRBcnJheShtT3BzKTsKKyAgICAgICAgZGVzdC53cml0ZUludChtVHJhbnNpdGlvbik7CisgICAgICAgIGRlc3Qud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dtZW50TWFuYWdlci5CYWNrU3RhY2tFbnRyeSwgUnVubmFibGUgeworICAgIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEFHID0gIkJhY2tTdGFja0VudHJ5IjsKKworICAgIGZpbmFsIEZyYWdtZW50TWFuYWdlckltcGwgbU1hbmFnZXI7CisKKyAgICBzdGF0aWMgZmluYWwgaW50IE9QX05VTEwgPSAwOworICAgIHN0YXRpYyBmaW5hbCBpbnQgT1BfQUREID0gMTsKKyAgICBzdGF0aWMgZmluYWwgaW50IE9QX1JFUExBQ0UgPSAyOworICAgIHN0YXRpYyBmaW5hbCBpbnQgT1BfUkVNT1ZFID0gMzsKKyAgICBzdGF0aWMgZmluYWwgaW50IE9QX0hJREUgPSA0OworICAgIHN0YXRpYyBmaW5hbCBpbnQgT1BfU0hPVyA9IDU7CisKKyAgICBzdGF0aWMgZmluYWwgY2xhc3MgT3AgeworICAgICAgICBPcCBuZXh0OworICAgICAgICBPcCBwcmV2OworICAgICAgICBpbnQgY21kOworICAgICAgICBGcmFnbWVudCBmcmFnbWVudDsKKyAgICAgICAgaW50IGVudGVyQW5pbTsKKyAgICAgICAgaW50IGV4aXRBbmltOworICAgICAgICBBcnJheUxpc3Q8RnJhZ21lbnQ+IHJlbW92ZWQ7CisgICAgfQorCisgICAgT3AgbUhlYWQ7CisgICAgT3AgbVRhaWw7CisgICAgaW50IG1OdW1PcDsKKyAgICBpbnQgbUVudGVyQW5pbTsKKyAgICBpbnQgbUV4aXRBbmltOworICAgIGludCBtVHJhbnNpdGlvbjsKKyAgICBpbnQgbVRyYW5zaXRpb25TdHlsZTsKKyAgICBib29sZWFuIG1BZGRUb0JhY2tTdGFjazsKKyAgICBTdHJpbmcgbU5hbWU7CisgICAgYm9vbGVhbiBtQ29tbWl0dGVkOworICAgIGludCBtSW5kZXg7CisKKyAgICBpbnQgbUJyZWFkQ3J1bWJUaXRsZVJlczsKKyAgICBDaGFyU2VxdWVuY2UgbUJyZWFkQ3J1bWJUaXRsZVRleHQ7CisgICAgaW50IG1CcmVhZENydW1iU2hvcnRUaXRsZVJlczsKKyAgICBDaGFyU2VxdWVuY2UgbUJyZWFkQ3J1bWJTaG9ydFRpdGxlVGV4dDsKKworICAgIHB1YmxpYyBCYWNrU3RhY2tSZWNvcmQoRnJhZ21lbnRNYW5hZ2VySW1wbCBtYW5hZ2VyKSB7CisgICAgICAgIG1NYW5hZ2VyID0gbWFuYWdlcjsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldElkKCkgeworICAgICAgICByZXR1cm4gbUluZGV4OworICAgIH0KKworICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0QnJlYWRDcnVtYlRpdGxlKCkgeworICAgICAgICBpZiAobUJyZWFkQ3J1bWJUaXRsZVJlcyAhPSAwKSB7CisgICAgICAgICAgICByZXR1cm4gbU1hbmFnZXIubUFjdGl2aXR5LmdldFRleHQobUJyZWFkQ3J1bWJUaXRsZVJlcyk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1CcmVhZENydW1iVGl0bGVUZXh0OworICAgIH0KKworICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0QnJlYWRDcnVtYlNob3J0VGl0bGUoKSB7CisgICAgICAgIGlmIChtQnJlYWRDcnVtYlNob3J0VGl0bGVSZXMgIT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIG1NYW5hZ2VyLm1BY3Rpdml0eS5nZXRUZXh0KG1CcmVhZENydW1iU2hvcnRUaXRsZVJlcyk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1CcmVhZENydW1iU2hvcnRUaXRsZVRleHQ7CisgICAgfQorCisgICAgdm9pZCBhZGRPcChPcCBvcCkgeworICAgICAgICBpZiAobUhlYWQgPT0gbnVsbCkgeworICAgICAgICAgICAgbUhlYWQgPSBtVGFpbCA9IG9wOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgb3AucHJldiA9IG1UYWlsOworICAgICAgICAgICAgbVRhaWwubmV4dCA9IG9wOworICAgICAgICAgICAgbVRhaWwgPSBvcDsKKyAgICAgICAgfQorICAgICAgICBvcC5lbnRlckFuaW0gPSBtRW50ZXJBbmltOworICAgICAgICBvcC5leGl0QW5pbSA9IG1FeGl0QW5pbTsKKyAgICAgICAgbU51bU9wKys7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gYWRkKEZyYWdtZW50IGZyYWdtZW50LCBTdHJpbmcgdGFnKSB7CisgICAgICAgIGRvQWRkT3AoMCwgZnJhZ21lbnQsIHRhZywgT1BfQUREKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gYWRkKGludCBjb250YWluZXJWaWV3SWQsIEZyYWdtZW50IGZyYWdtZW50KSB7CisgICAgICAgIGRvQWRkT3AoY29udGFpbmVyVmlld0lkLCBmcmFnbWVudCwgbnVsbCwgT1BfQUREKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gYWRkKGludCBjb250YWluZXJWaWV3SWQsIEZyYWdtZW50IGZyYWdtZW50LCBTdHJpbmcgdGFnKSB7CisgICAgICAgIGRvQWRkT3AoY29udGFpbmVyVmlld0lkLCBmcmFnbWVudCwgdGFnLCBPUF9BREQpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZG9BZGRPcChpbnQgY29udGFpbmVyVmlld0lkLCBGcmFnbWVudCBmcmFnbWVudCwgU3RyaW5nIHRhZywgaW50IG9wY21kKSB7CisgICAgICAgIGlmIChmcmFnbWVudC5tSW1tZWRpYXRlQWN0aXZpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiRnJhZ21lbnQgYWxyZWFkeSBhZGRlZDogIiArIGZyYWdtZW50KTsKKyAgICAgICAgfQorICAgICAgICBmcmFnbWVudC5tSW1tZWRpYXRlQWN0aXZpdHkgPSBtTWFuYWdlci5tQWN0aXZpdHk7CisgICAgICAgIGZyYWdtZW50Lm1GcmFnbWVudE1hbmFnZXIgPSBtTWFuYWdlcjsKKworICAgICAgICBpZiAodGFnICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChmcmFnbWVudC5tVGFnICE9IG51bGwgJiYgIXRhZy5lcXVhbHMoZnJhZ21lbnQubVRhZykpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJDYW4ndCBjaGFuZ2UgdGFnIG9mIGZyYWdtZW50ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgZnJhZ21lbnQgKyAiOiB3YXMgIiArIGZyYWdtZW50Lm1UYWcKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBub3cgIiArIHRhZyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcmFnbWVudC5tVGFnID0gdGFnOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGNvbnRhaW5lclZpZXdJZCAhPSAwKSB7CisgICAgICAgICAgICBpZiAoZnJhZ21lbnQubUZyYWdtZW50SWQgIT0gMCAmJiBmcmFnbWVudC5tRnJhZ21lbnRJZCAhPSBjb250YWluZXJWaWV3SWQpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJDYW4ndCBjaGFuZ2UgY29udGFpbmVyIElEIG9mIGZyYWdtZW50ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgZnJhZ21lbnQgKyAiOiB3YXMgIiArIGZyYWdtZW50Lm1GcmFnbWVudElkCisgICAgICAgICAgICAgICAgICAgICAgICArICIgbm93ICIgKyBjb250YWluZXJWaWV3SWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZnJhZ21lbnQubUNvbnRhaW5lcklkID0gZnJhZ21lbnQubUZyYWdtZW50SWQgPSBjb250YWluZXJWaWV3SWQ7CisgICAgICAgIH0KKworICAgICAgICBPcCBvcCA9IG5ldyBPcCgpOworICAgICAgICBvcC5jbWQgPSBvcGNtZDsKKyAgICAgICAgb3AuZnJhZ21lbnQgPSBmcmFnbWVudDsKKyAgICAgICAgYWRkT3Aob3ApOworICAgIH0KKworICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHJlcGxhY2UoaW50IGNvbnRhaW5lclZpZXdJZCwgRnJhZ21lbnQgZnJhZ21lbnQpIHsKKyAgICAgICAgcmV0dXJuIHJlcGxhY2UoY29udGFpbmVyVmlld0lkLCBmcmFnbWVudCwgbnVsbCk7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gcmVwbGFjZShpbnQgY29udGFpbmVyVmlld0lkLCBGcmFnbWVudCBmcmFnbWVudCwgU3RyaW5nIHRhZykgeworICAgICAgICBpZiAoY29udGFpbmVyVmlld0lkID09IDApIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk11c3QgdXNlIG5vbi16ZXJvIGNvbnRhaW5lclZpZXdJZCIpOworICAgICAgICB9CisKKyAgICAgICAgZG9BZGRPcChjb250YWluZXJWaWV3SWQsIGZyYWdtZW50LCB0YWcsIE9QX1JFUExBQ0UpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiByZW1vdmUoRnJhZ21lbnQgZnJhZ21lbnQpIHsKKyAgICAgICAgaWYgKGZyYWdtZW50Lm1JbW1lZGlhdGVBY3Rpdml0eSA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJGcmFnbWVudCBub3QgYWRkZWQ6ICIgKyBmcmFnbWVudCk7CisgICAgICAgIH0KKyAgICAgICAgZnJhZ21lbnQubUltbWVkaWF0ZUFjdGl2aXR5ID0gbnVsbDsKKworICAgICAgICBPcCBvcCA9IG5ldyBPcCgpOworICAgICAgICBvcC5jbWQgPSBPUF9SRU1PVkU7CisgICAgICAgIG9wLmZyYWdtZW50ID0gZnJhZ21lbnQ7CisgICAgICAgIGFkZE9wKG9wKTsKKworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiBoaWRlKEZyYWdtZW50IGZyYWdtZW50KSB7CisgICAgICAgIGlmIChmcmFnbWVudC5tSW1tZWRpYXRlQWN0aXZpdHkgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiRnJhZ21lbnQgbm90IGFkZGVkOiAiICsgZnJhZ21lbnQpOworICAgICAgICB9CisKKyAgICAgICAgT3Agb3AgPSBuZXcgT3AoKTsKKyAgICAgICAgb3AuY21kID0gT1BfSElERTsKKyAgICAgICAgb3AuZnJhZ21lbnQgPSBmcmFnbWVudDsKKyAgICAgICAgYWRkT3Aob3ApOworCisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHNob3coRnJhZ21lbnQgZnJhZ21lbnQpIHsKKyAgICAgICAgaWYgKGZyYWdtZW50Lm1JbW1lZGlhdGVBY3Rpdml0eSA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJGcmFnbWVudCBub3QgYWRkZWQ6ICIgKyBmcmFnbWVudCk7CisgICAgICAgIH0KKworICAgICAgICBPcCBvcCA9IG5ldyBPcCgpOworICAgICAgICBvcC5jbWQgPSBPUF9TSE9XOworICAgICAgICBvcC5mcmFnbWVudCA9IGZyYWdtZW50OworICAgICAgICBhZGRPcChvcCk7CisKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gc2V0Q3VzdG9tQW5pbWF0aW9ucyhpbnQgZW50ZXIsIGludCBleGl0KSB7CisgICAgICAgIG1FbnRlckFuaW0gPSBlbnRlcjsKKyAgICAgICAgbUV4aXRBbmltID0gZXhpdDsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gc2V0VHJhbnNpdGlvbihpbnQgdHJhbnNpdGlvbikgeworICAgICAgICBtVHJhbnNpdGlvbiA9IHRyYW5zaXRpb247CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHNldFRyYW5zaXRpb25TdHlsZShpbnQgc3R5bGVSZXMpIHsKKyAgICAgICAgbVRyYW5zaXRpb25TdHlsZSA9IHN0eWxlUmVzOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiBhZGRUb0JhY2tTdGFjayhTdHJpbmcgbmFtZSkgeworICAgICAgICBtQWRkVG9CYWNrU3RhY2sgPSB0cnVlOworICAgICAgICBtTmFtZSA9IG5hbWU7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHNldEJyZWFkQ3J1bWJUaXRsZShpbnQgcmVzKSB7CisgICAgICAgIG1CcmVhZENydW1iVGl0bGVSZXMgPSByZXM7CisgICAgICAgIG1CcmVhZENydW1iVGl0bGVUZXh0ID0gbnVsbDsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gc2V0QnJlYWRDcnVtYlRpdGxlKENoYXJTZXF1ZW5jZSB0ZXh0KSB7CisgICAgICAgIG1CcmVhZENydW1iVGl0bGVSZXMgPSAwOworICAgICAgICBtQnJlYWRDcnVtYlRpdGxlVGV4dCA9IHRleHQ7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHNldEJyZWFkQ3J1bWJTaG9ydFRpdGxlKGludCByZXMpIHsKKyAgICAgICAgbUJyZWFkQ3J1bWJTaG9ydFRpdGxlUmVzID0gcmVzOworICAgICAgICBtQnJlYWRDcnVtYlNob3J0VGl0bGVUZXh0ID0gbnVsbDsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gc2V0QnJlYWRDcnVtYlNob3J0VGl0bGUoQ2hhclNlcXVlbmNlIHRleHQpIHsKKyAgICAgICAgbUJyZWFkQ3J1bWJTaG9ydFRpdGxlUmVzID0gMDsKKyAgICAgICAgbUJyZWFkQ3J1bWJTaG9ydFRpdGxlVGV4dCA9IHRleHQ7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHZvaWQgYnVtcEJhY2tTdGFja05lc3RpbmcoaW50IGFtdCkgeworICAgICAgICBpZiAoIW1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChGcmFnbWVudE1hbmFnZXJJbXBsLkRFQlVHKSBMb2cudihUQUcsICJCdW1wIG5lc3RpbmcgaW4gIiArIHRoaXMKKyAgICAgICAgICAgICAgICArICIgYnkgIiArIGFtdCk7CisgICAgICAgIE9wIG9wID0gbUhlYWQ7CisgICAgICAgIHdoaWxlIChvcCAhPSBudWxsKSB7CisgICAgICAgICAgICBvcC5mcmFnbWVudC5tQmFja1N0YWNrTmVzdGluZyArPSBhbXQ7CisgICAgICAgICAgICBpZiAoRnJhZ21lbnRNYW5hZ2VySW1wbC5ERUJVRykgTG9nLnYoVEFHLCAiQnVtcCBuZXN0aW5nIG9mICIKKyAgICAgICAgICAgICAgICAgICAgKyBvcC5mcmFnbWVudCArICIgdG8gIiArIG9wLmZyYWdtZW50Lm1CYWNrU3RhY2tOZXN0aW5nKTsKKyAgICAgICAgICAgIGlmIChvcC5yZW1vdmVkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpPW9wLnJlbW92ZWQuc2l6ZSgpLTE7IGk+PTA7IGktLSkgeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCByID0gb3AucmVtb3ZlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgIHIubUJhY2tTdGFja05lc3RpbmcgKz0gYW10OworICAgICAgICAgICAgICAgICAgICBpZiAoRnJhZ21lbnRNYW5hZ2VySW1wbC5ERUJVRykgTG9nLnYoVEFHLCAiQnVtcCBuZXN0aW5nIG9mICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHIgKyAiIHRvICIgKyByLm1CYWNrU3RhY2tOZXN0aW5nKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBvcCA9IG9wLm5leHQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGNvbW1pdCgpIHsKKyAgICAgICAgaWYgKG1Db21taXR0ZWQpIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImNvbW1pdCBhbHJlYWR5IGNhbGxlZCIpOworICAgICAgICBpZiAoRnJhZ21lbnRNYW5hZ2VySW1wbC5ERUJVRykgTG9nLnYoVEFHLCAiQ29tbWl0OiAiICsgdGhpcyk7CisgICAgICAgIG1Db21taXR0ZWQgPSB0cnVlOworICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICBtSW5kZXggPSBtTWFuYWdlci5hbGxvY0JhY2tTdGFja0luZGV4KHRoaXMpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUluZGV4ID0gLTE7CisgICAgICAgIH0KKyAgICAgICAgbU1hbmFnZXIuZW5xdWV1ZUFjdGlvbih0aGlzKTsKKyAgICAgICAgcmV0dXJuIG1JbmRleDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgIGlmIChGcmFnbWVudE1hbmFnZXJJbXBsLkRFQlVHKSBMb2cudihUQUcsICJSdW46ICIgKyB0aGlzKTsKKworICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICBpZiAobUluZGV4IDwgMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImFkZFRvQmFja1N0YWNrKCkgY2FsbGVkIGFmdGVyIGNvbW1pdCgpIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBidW1wQmFja1N0YWNrTmVzdGluZygxKTsKKworICAgICAgICBPcCBvcCA9IG1IZWFkOworICAgICAgICB3aGlsZSAob3AgIT0gbnVsbCkgeworICAgICAgICAgICAgc3dpdGNoIChvcC5jbWQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIE9QX0FERDogeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gb3AuZnJhZ21lbnQ7CisgICAgICAgICAgICAgICAgICAgIGYubU5leHRBbmltID0gb3AuZW50ZXJBbmltOworICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5hZGRGcmFnbWVudChmLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE9QX1JFUExBQ0U6IHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG9wLmZyYWdtZW50OworICAgICAgICAgICAgICAgICAgICBpZiAobU1hbmFnZXIubUFkZGVkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtTWFuYWdlci5tQWRkZWQuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBvbGQgPSBtTWFuYWdlci5tQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGcmFnbWVudE1hbmFnZXJJbXBsLkRFQlVHKSBMb2cudihUQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiT1BfUkVQTEFDRTogYWRkaW5nPSIgKyBmICsgIiBvbGQ9IiArIG9sZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9sZC5tQ29udGFpbmVySWQgPT0gZi5tQ29udGFpbmVySWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wLnJlbW92ZWQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3AucmVtb3ZlZCA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3AucmVtb3ZlZC5hZGQob2xkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkLm1OZXh0QW5pbSA9IG9wLmV4aXRBbmltOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGQubUJhY2tTdGFja05lc3RpbmcgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGcmFnbWVudE1hbmFnZXJJbXBsLkRFQlVHKSBMb2cudihUQUcsICJCdW1wIG5lc3Rpbmcgb2YgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG9sZCArICIgdG8gIiArIG9sZC5tQmFja1N0YWNrTmVzdGluZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIucmVtb3ZlRnJhZ21lbnQob2xkLCBtVHJhbnNpdGlvbiwgbVRyYW5zaXRpb25TdHlsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubU5leHRBbmltID0gb3AuZW50ZXJBbmltOworICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5hZGRGcmFnbWVudChmLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE9QX1JFTU9WRTogeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gb3AuZnJhZ21lbnQ7CisgICAgICAgICAgICAgICAgICAgIGYubU5leHRBbmltID0gb3AuZXhpdEFuaW07CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLnJlbW92ZUZyYWdtZW50KGYsIG1UcmFuc2l0aW9uLCBtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgT1BfSElERTogeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gb3AuZnJhZ21lbnQ7CisgICAgICAgICAgICAgICAgICAgIGYubU5leHRBbmltID0gb3AuZXhpdEFuaW07CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLmhpZGVGcmFnbWVudChmLCBtVHJhbnNpdGlvbiwgbVRyYW5zaXRpb25TdHlsZSk7CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE9QX1NIT1c6IHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG9wLmZyYWdtZW50OworICAgICAgICAgICAgICAgICAgICBmLm1OZXh0QW5pbSA9IG9wLmVudGVyQW5pbTsKKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIuc2hvd0ZyYWdtZW50KGYsIG1UcmFuc2l0aW9uLCBtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rbm93biBjbWQ6ICIgKyBvcC5jbWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgb3AgPSBvcC5uZXh0OworICAgICAgICB9CisKKyAgICAgICAgbU1hbmFnZXIubW92ZVRvU3RhdGUobU1hbmFnZXIubUN1clN0YXRlLCBtVHJhbnNpdGlvbiwKKyAgICAgICAgICAgICAgICBtVHJhbnNpdGlvblN0eWxlLCB0cnVlKTsKKworICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICBtTWFuYWdlci5hZGRCYWNrU3RhY2tTdGF0ZSh0aGlzKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHBvcEZyb21CYWNrU3RhY2soYm9vbGVhbiBkb1N0YXRlTW92ZSkgeworICAgICAgICBpZiAoRnJhZ21lbnRNYW5hZ2VySW1wbC5ERUJVRykgTG9nLnYoVEFHLCAicG9wRnJvbUJhY2tTdGFjazogIiArIHRoaXMpOworCisgICAgICAgIGJ1bXBCYWNrU3RhY2tOZXN0aW5nKC0xKTsKKworICAgICAgICBPcCBvcCA9IG1UYWlsOworICAgICAgICB3aGlsZSAob3AgIT0gbnVsbCkgeworICAgICAgICAgICAgc3dpdGNoIChvcC5jbWQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIE9QX0FERDogeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gb3AuZnJhZ21lbnQ7CisgICAgICAgICAgICAgICAgICAgIGYubUltbWVkaWF0ZUFjdGl2aXR5ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIucmVtb3ZlRnJhZ21lbnQoZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXJJbXBsLnJldmVyc2VUcmFuc2l0KG1UcmFuc2l0aW9uKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgT1BfUkVQTEFDRTogeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gb3AuZnJhZ21lbnQ7CisgICAgICAgICAgICAgICAgICAgIGYubUltbWVkaWF0ZUFjdGl2aXR5ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIucmVtb3ZlRnJhZ21lbnQoZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXJJbXBsLnJldmVyc2VUcmFuc2l0KG1UcmFuc2l0aW9uKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG9wLnJlbW92ZWQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG9wLnJlbW92ZWQuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBvbGQgPSBvcC5yZW1vdmVkLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmLm1JbW1lZGlhdGVBY3Rpdml0eSA9IG1NYW5hZ2VyLm1BY3Rpdml0eTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5hZGRGcmFnbWVudChvbGQsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9SRU1PVkU6IHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG9wLmZyYWdtZW50OworICAgICAgICAgICAgICAgICAgICBmLm1JbW1lZGlhdGVBY3Rpdml0eSA9IG1NYW5hZ2VyLm1BY3Rpdml0eTsKKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIuYWRkRnJhZ21lbnQoZiwgZmFsc2UpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9ISURFOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIuc2hvd0ZyYWdtZW50KGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnRNYW5hZ2VySW1wbC5yZXZlcnNlVHJhbnNpdChtVHJhbnNpdGlvbiksIG1UcmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9TSE9XOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIuaGlkZUZyYWdtZW50KGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnRNYW5hZ2VySW1wbC5yZXZlcnNlVHJhbnNpdChtVHJhbnNpdGlvbiksIG1UcmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDogeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGNtZDogIiArIG9wLmNtZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBvcCA9IG9wLnByZXY7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZG9TdGF0ZU1vdmUpIHsKKyAgICAgICAgICAgIG1NYW5hZ2VyLm1vdmVUb1N0YXRlKG1NYW5hZ2VyLm1DdXJTdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnRNYW5hZ2VySW1wbC5yZXZlcnNlVHJhbnNpdChtVHJhbnNpdGlvbiksIG1UcmFuc2l0aW9uU3R5bGUsIHRydWUpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1JbmRleCA+PSAwKSB7CisgICAgICAgICAgICBtTWFuYWdlci5mcmVlQmFja1N0YWNrSW5kZXgobUluZGV4KTsKKyAgICAgICAgICAgIG1JbmRleCA9IC0xOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBnZXROYW1lKCkgeworICAgICAgICByZXR1cm4gbU5hbWU7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRUcmFuc2l0aW9uKCkgeworICAgICAgICByZXR1cm4gbVRyYW5zaXRpb247CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRUcmFuc2l0aW9uU3R5bGUoKSB7CisgICAgICAgIHJldHVybiBtVHJhbnNpdGlvblN0eWxlOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzRW1wdHkoKSB7CisgICAgICAgIHJldHVybiBtTnVtT3AgPT0gMDsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQ29udGV4dEltcGwuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9Db250ZXh0SW1wbC5qYXZhCmluZGV4IDY5ODMzMDMyLi41Y2U0Y2Q2IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQ29udGV4dEltcGwuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQ29udGV4dEltcGwuamF2YQpAQCAtNTYsMTE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3RyaW5nIG5hbWUpIHsKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIEZpbGUgZiA9IHZhbGlkYXRlRmlsZVBhdGgobmFtZSwgZmFsc2UpOwpAQCAtNjE4LDcgKzYyMSw4IEBACiAgICAgICAgICAgICAgICAgICAgICsgIiBJcyB0aGlzIHJlYWxseSB3aGF0IHlvdSB3YW50PyIpOwogICAgICAgICB9CiAgICAgICAgIG1NYWluVGhyZWFkLmdldEluc3RydW1lbnRhdGlvbigpLmV4ZWNTdGFydEFjdGl2aXR5KAotICAgICAgICAgICAgZ2V0T3V0ZXJDb250ZXh0KCksIG1NYWluVGhyZWFkLmdldEFwcGxpY2F0aW9uVGhyZWFkKCksIG51bGwsIG51bGwsIGludGVudCwgLTEpOworICAgICAgICAgICAgZ2V0T3V0ZXJDb250ZXh0KCksIG1NYWluVGhyZWFkLmdldEFwcGxpY2F0aW9uVGhyZWFkKCksIG51bGwsCisgICAgICAgICAgICAoQWN0aXZpdHkpbnVsbCwgaW50ZW50LCAtMSk7CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCkBAIC05NDIsNiArOTQ2LDggQEAKICAgICAgICAgICAgIHJldHVybiBBY2Nlc3NpYmlsaXR5TWFuYWdlci5nZXRJbnN0YW5jZSh0aGlzKTsKICAgICAgICAgfSBlbHNlIGlmIChMT0NBVElPTl9TRVJWSUNFLmVxdWFscyhuYW1lKSkgewogICAgICAgICAgICAgcmV0dXJuIGdldExvY2F0aW9uTWFuYWdlcigpOworICAgICAgICB9IGVsc2UgaWYgKENPVU5UUllfREVURUNUT1IuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0Q291bnRyeURldGVjdG9yKCk7CiAgICAgICAgIH0gZWxzZSBpZiAoU0VBUkNIX1NFUlZJQ0UuZXF1YWxzKG5hbWUpKSB7CiAgICAgICAgICAgICByZXR1cm4gZ2V0U2VhcmNoTWFuYWdlcigpOwogICAgICAgICB9IGVsc2UgaWYgKFNFTlNPUl9TRVJWSUNFLmVxdWFscyhuYW1lKSkgewpAQCAtMTA2MCw4ICsxMDY2LDEzIEBACiAgICAgcHJpdmF0ZSBOb3RpZmljYXRpb25NYW5hZ2VyIGdldE5vdGlmaWNhdGlvbk1hbmFnZXIoKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVN5bmMpIHsKICAgICAgICAgICAgIGlmIChtTm90aWZpY2F0aW9uTWFuYWdlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgZmluYWwgQ29udGV4dCBvdXRlckNvbnRleHQgPSBnZXRPdXRlckNvbnRleHQoKTsKICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uTWFuYWdlciA9IG5ldyBOb3RpZmljYXRpb25NYW5hZ2VyKAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IENvbnRleHRUaGVtZVdyYXBwZXIoZ2V0T3V0ZXJDb250ZXh0KCksIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGUuVGhlbWVfRGlhbG9nKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBDb250ZXh0VGhlbWVXcmFwcGVyKG91dGVyQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0ZXJDb250ZXh0LmdldEFwcGxpY2F0aW9uSW5mbygpLnRhcmdldFNka1ZlcnNpb24gPj0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJ1aWxkLlZFUlNJT05fQ09ERVMuSE9ORVlDT01CCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZS5UaGVtZV9Ib2xvX0RpYWxvZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGUuVGhlbWVfRGlhbG9nKSwKICAgICAgICAgICAgICAgICAgICAgICAgIG1NYWluVGhyZWFkLmdldEhhbmRsZXIoKSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTExMDgsNiArMTExOSwxNyBAQAogICAgICAgICByZXR1cm4gc0xvY2F0aW9uTWFuYWdlcjsKICAgICB9CiAKKyAgICBwcml2YXRlIENvdW50cnlEZXRlY3RvciBnZXRDb3VudHJ5RGV0ZWN0b3IoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAoc1N5bmMpIHsKKyAgICAgICAgICAgIGlmIChzQ291bnRyeURldGVjdG9yID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBJQmluZGVyIGIgPSBTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKENPVU5UUllfREVURUNUT1IpOworICAgICAgICAgICAgICAgIElDb3VudHJ5RGV0ZWN0b3Igc2VydmljZSA9IElDb3VudHJ5RGV0ZWN0b3IuU3R1Yi5hc0ludGVyZmFjZShiKTsKKyAgICAgICAgICAgICAgICBzQ291bnRyeURldGVjdG9yID0gbmV3IENvdW50cnlEZXRlY3RvcihzZXJ2aWNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gc0NvdW50cnlEZXRlY3RvcjsKKyAgICB9CisKICAgICBwcml2YXRlIFNlYXJjaE1hbmFnZXIgZ2V0U2VhcmNoTWFuYWdlcigpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtU3luYykgewogICAgICAgICAgICAgaWYgKG1TZWFyY2hNYW5hZ2VyID09IG51bGwpIHsKQEAgLTE0ODEsOCArMTUwMyw2IEBACiAgICAgfQogCiAgICAgQ29udGV4dEltcGwoKSB7Ci0gICAgICAgIC8vIEZvciBkZWJ1ZyBvbmx5Ci0gICAgICAgIC8vKytzSW5zdGFuY2VDb3VudDsKICAgICAgICAgbU91dGVyQ29udGV4dCA9IHRoaXM7CiAgICAgfQogCkBAIC0xNDkzLDcgKzE1MTMsNiBAQAogICAgICAqIEBwYXJhbSBjb250ZXh0IEV4aXN0aW5nIGFwcGxpY2F0aW9uIGNvbnRleHQuCiAgICAgICovCiAgICAgcHVibGljIENvbnRleHRJbXBsKENvbnRleHRJbXBsIGNvbnRleHQpIHsKLSAgICAgICAgKytzSW5zdGFuY2VDb3VudDsKICAgICAgICAgbVBhY2thZ2VJbmZvID0gY29udGV4dC5tUGFja2FnZUluZm87CiAgICAgICAgIG1SZXNvdXJjZXMgPSBjb250ZXh0Lm1SZXNvdXJjZXM7CiAgICAgICAgIG1NYWluVGhyZWFkID0gY29udGV4dC5tTWFpblRocmVhZDsKQEAgLTI4MDAsNiArMjgxOSwxMyBAQAogICAgICAgICAgICAgICAgIHJldHVybiB2ICE9IG51bGwgPyB2IDogZGVmVmFsdWU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBTZXQ8U3RyaW5nPiBnZXRTdHJpbmdTZXQoU3RyaW5nIGtleSwgU2V0PFN0cmluZz4gZGVmVmFsdWVzKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgICAgICBTZXQ8U3RyaW5nPiB2ID0gKFNldDxTdHJpbmc+KSBtTWFwLmdldChrZXkpOworICAgICAgICAgICAgICAgIHJldHVybiB2ICE9IG51bGwgPyB2IDogZGVmVmFsdWVzOworICAgICAgICAgICAgfQorICAgICAgICB9CiAKICAgICAgICAgcHVibGljIGludCBnZXRJbnQoU3RyaW5nIGtleSwgaW50IGRlZlZhbHVlKSB7CiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKQEAgLTI4NjEsNiArMjg4NywxMiBAQAogICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpczsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBwdWJsaWMgRWRpdG9yIHB1dFN0cmluZ1NldChTdHJpbmcga2V5LCBTZXQ8U3RyaW5nPiB2YWx1ZXMpIHsKKyAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIH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GhlbWVXcmFwcGVyKAotICAgICAgICAgICAgY29udGV4dCwgdGhlbWUgPT0gMCA/IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGUuVGhlbWVfRGlhbG9nIDogdGhlbWUpOworICAgICAgICBpZiAodGhlbWUgPT0gMCkgeworICAgICAgICAgICAgVHlwZWRWYWx1ZSBvdXRWYWx1ZSA9IG5ldyBUeXBlZFZhbHVlKCk7CisgICAgICAgICAgICBjb250ZXh0LmdldFRoZW1lKCkucmVzb2x2ZUF0dHJpYnV0ZShjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmF0dHIuZGlhbG9nVGhlbWUsCisgICAgICAgICAgICAgICAgICAgIG91dFZhbHVlLCB0cnVlKTsKKyAgICAgICAgICAgIHRoZW1lID0gb3V0VmFsdWUucmVzb3VyY2VJZDsKKyAgICAgICAgfQorCisgICAgICAgIG1Db250ZXh0ID0gbmV3IENvbnRleHRUaGVtZVdyYXBwZXIoY29udGV4dCwgdGhlbWUpOwogICAgICAgICBtV2luZG93TWFuYWdlciA9IChXaW5kb3dNYW5hZ2VyKWNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LldJTkRPV19TRVJWSUNFKTsKICAgICAgICAgV2luZG93IHcgPSBQb2xpY3lNYW5hZ2VyLm1ha2VOZXdXaW5kb3cobUNvbnRleHQpOwogICAgICAgICBtV2luZG93ID0gdzsKQEAgLTE3MCwxMyArMTgxLDIyIEBACiAgICAgLyoqCiAgICAgICogUmV0cmlldmUgdGhlIENvbnRleHQgdGhpcyBEaWFsb2cgaXMgcnVubmluZyBpbi4KICAgICAgKiAKLSAgICAgKiBAcmV0dXJuIENvbnRleHQgVGhlIENvbnRleHQgdGhhdCB3YXMgc3VwcGxpZWQgdG8gdGhlIGNvbnN0cnVjdG9yLgorICAgICAqIEByZXR1cm4gQ29udGV4dCBUaGUgQ29udGV4dCB1c2VkIGJ5IHRoZSBEaWFsb2cuCiAgICAgICovCiAgICAgcHVibGljIGZpbmFsIENvbnRleHQgZ2V0Q29udGV4dCgpIHsKICAgICAgICAgcmV0dXJuIG1Db250ZXh0OwogICAgIH0KIAogICAgIC8qKgorICAgICAqIFJldHJpZXZlIHRoZSB7QGxpbmsgQWN0aW9uQmFyfSBhdHRhY2hlZCB0byB0aGlzIGRpYWxvZywgaWYgcHJlc2VudC4KKyAgICAgKgorICAgICAqIEByZXR1cm4gVGhlIEFjdGlvbkJhciBhdHRhY2hlZCB0byB0aGUgZGlhbG9nIG9yIG51bGwgaWYgbm8gQWN0aW9uQmFyIGlzIHByZXNlbnQuCisgICAgICovCisgICAgcHVibGljIEFjdGlvbkJhciBnZXRBY3Rpb25CYXIoKSB7CisgICAgICAgIHJldHVybiBtQWN0aW9uQmFyOworICAgIH0KKworICAgIC8qKgogICAgICAqIFNldHMgdGhlIEFjdGl2aXR5IHRoYXQgb3ducyB0aGlzIGRpYWxvZy4gQW4gZXhhbXBsZSB1c2U6IFRoaXMgRGlhbG9nIHdpbGwKICAgICAgKiB1c2UgdGhlIHN1Z2dlc3RlZCB2b2x1bWUgY29udHJvbCBzdHJlYW0gb2YgdGhlIEFjdGl2aXR5LgogICAgICAqIApAQCAtMjE2LDYgKzIzNiw5IEBACiAgICAgcHVibGljIHZvaWQgc2hvdygpIHsKICAgICAgICAgaWYgKG1TaG93aW5nKSB7CiAgICAgICAgICAgICBpZiAobURlY29yICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAobVdpbmRvdy5oYXNGZWF0dXJlKFdpbmRvdy5GRUFUVVJFX0FDVElPTl9CQVIpKSB7CisgICAgICAgICAgICAgICAgICAgIG1XaW5kb3cuaW52YWxpZGF0ZVBhbmVsTWVudShXaW5kb3cuRkVBVFVSRV9BQ1RJT05fQkFSKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgbURlY29yLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybjsKQEAgL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dGcmFnbWVudCBleHRlbmRzIEZyYWdtZW50CisgICAgICAgIGltcGxlbWVudHMgRGlhbG9nSW50ZXJmYWNlLk9uQ2FuY2VsTGlzdGVuZXIsIERpYWxvZ0ludGVyZmFjZS5PbkRpc21pc3NMaXN0ZW5lciB7CisKKyAgICAvKioKKyAgICAgKiBTdHlsZSBmb3Ige0BsaW5rICNzZXRTdHlsZShpbnQsIGludCl9OiBhIGJhc2ljLAorICAgICAqIG5vcm1hbCBkaWFsb2cuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgU1RZTEVfTk9STUFMID0gMDsKKworICAgIC8qKgorICAgICAqIFN0eWxlIGZvciB7QGxpbmsgI3NldFN0eWxlKGludCwgaW50KX06IGRvbid0IGluY2x1ZGUKKyAgICAgKiBhIHRpdGxlIGFyZWEuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgU1RZTEVfTk9fVElUTEUgPSAxOworCisgICAgLyoqCisgICAgICogU3R5bGUgZm9yIHtAbGluayAjc2V0U3R5bGUoaW50LCBpbnQpfTogZG9uJ3QgZHJhdworICAgICAqIGFueSBmcmFtZSBhdCBhbGw7IHRoZSB2aWV3IGhpZXJhcmNoeSByZXR1cm5lZCBieSB7QGxpbmsgI29uQ3JlYXRlVmlld30KKyAgICAgKiBpcyBlbnRpcmVseSByZXNwb25zaWJsZSBmb3IgZHJhd2luZyB0aGUgZGlhbG9nLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFNUWUxFX05PX0ZSQU1FID0gMjsKKworICAgIC8qKgorICAgICAqIFN0eWxlIGZvciB7QGxpbmsgI3NldFN0eWxlKGludCwgaW50KX06IGxpa2UKKyAgICAgKiB7QGxpbmsgI1NUWUxFX05PX0ZSQU1FfSwgYnV0IGFsc28gZGlzYWJsZXMgYWxsIGlucHV0IHRvIHRoZSBkaWFsb2cuCisgICAgICogVGhlIHVzZXIgY2FuIG5vdCB0b3VjaCBp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gKG1CYWNrU3RhY2tJZCA+PSAwKSB7CisgICAgICAgICAgICBnZXRGcmFnbWVudE1hbmFnZXIoKS5wb3BCYWNrU3RhY2sobUJhY2tTdGFja0lkLAorICAgICAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXIuUE9QX0JBQ0tfU1RBQ0tfSU5DTFVTSVZFKTsKKyAgICAgICAgICAgIG1CYWNrU3RhY2tJZCA9IC0xOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgRnJhZ21lbnRUcmFuc2FjdGlvbiBmdCA9IGdldEZyYWdtZW50TWFuYWdlcigpLm9wZW5UcmFuc2FjdGlvbigpOworICAgICAgICAgICAgZnQucmVtb3ZlKHRoaXMpOworICAgICAgICAgICAgZnQuY29tbWl0KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgRGlhbG9nIGdldERpYWxvZygpIHsKKyAgICAgICAgcmV0dXJuIG1EaWFsb2c7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRUaGVtZSgpIHsKKyAgICAgICAgcmV0dXJuIG1UaGVtZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb250cm9sIHdoZXRoZXIgdGhlIHNob3duIERpYWxvZyBpcyBjYW5jZWxhYmxlLiAgVXNlIHRoaXMgaW5zdGVhZCBvZgorICAgICAqIGRpcmVjdGx5IGNhbGxpbmcge0BsaW5rIERpYWxvZyNzZXRDYW5jZWxhYmxlKGJvb2xlYW4pCisgICAgICogRGlhbG9nLnNldENhbmNlbGFibGUoYm9vbGVhbil9LCBiZWNhdXNlIERpYWxvZ0ZyYWdtZW50IG5lZWRzIHRvIGNoYW5nZQorICAgICAqIGl0cyBiZWhhdmlvciBiYXNlZCBvbiB0aGlzLgorICAgICAqCisgICAgICogQHBhcmFtIGNhbmNlbGFibGUgSWYgdHJ1ZSwgdGhlIGRpYWxvZyBpcyBjYW5jZWxhYmxlLiAgVGhlIGRlZmF1bHQKKyAgICAgKiBpcyB0cnVlLgorICA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lKSB7CisgICAgICAgIHN1cGVyLm9uQWN0aXZpdHlDcmVhdGVkKHNhdmVkSW5zdGFuY2VTdGF0ZSk7CisKKyAgICAgICAgaWYgKCFtU2hvd3NEaWFsb2cpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIG1EaWFsb2cgPSBvbkNyZWF0ZURpYWxvZyhzYXZlZEluc3RhbmNlU3RhdGUpOworICAgICAgICBtRGVzdHJveWVkID0gZmFsc2U7CisgICAgICAgIHN3aXRjaCAobVN0eWxlKSB7CisgICAgICAgICAgICBjYXNlIFNUWUxFX05PX0lOUFVUOgorICAgICAgICAgICAgICAgIG1EaWFsb2cuZ2V0V2luZG93KCkuYWRkRmxhZ3MoCisgICAgICAgICAgICAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5GTEFHX05PVF9GT0NVU0FCTEUgfAorICAgICAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19OT1RfVE9VQ0hBQkxFKTsKKyAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2guLi4KKyAgICAgICAgICAgIGNhc2UgU1RZTEVfTk9fRlJBTUU6CisgICAgICAgICAgICBjYXNlIFNUWUxFX05PX1RJVExFOgorICAgICAgICAgICAgICAgIG1EaWFsb2cucmVxdWVzdFdpbmRvd0ZlYXR1cmUoV2luZG93LkZFQVRVUkVfTk9fVElUTEUpOworICAgICAgICB9CisgICAgICAgIFZpZXcgdmlldyA9IGdldFZpZXcoKTsKKyAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKHZpZXcuZ2V0UGFyZW50KCkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkRpYWxvZ0ZyYWdtZW50IGNhbiBub3QgYmUgYXR0YWNoZWQgdG8gYSBjb250YWluZXIgdmlldyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbURpYWxvZy5zZXRDb250ZW50Vmlldyh2aWV3KTsKKyAgICAgICAgfQorICAgICAgICBtRGlhbG9nLnNldE93bmVyQWN0aXZpdHkoZ2V0QWN0aXZpdHkoKSk7CisgICAgICAgIG1EaWFsb2cuc2V0Q2FuY2VsYWJsZShtQ2FuY2VsYWJsZSk7CisgICAgICAgIG1EaWFsb2cuc2V0T25DYW5jZWxMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgbURpYWxvZy5zZXRPbkRpc21pc3NMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgaWYgKHNhdmVkSW5zdGFuY2VTdGF0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBCdW5kbGUgZGlhbG9nU3RhdGUgPSBzYXZlZEluc3RhbmNlU3RhdGUuZ2V0QnVuZGxlKFNBVkVEX0RJQUxPR19TVEFURV9UQUcpOworICAgICAgICAgICAgaWYgKGRpYWxvZ1N0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtRGlhbG9nLm9uUmVzdG9yZUluc3RhbmNlU3RhdGUoZGlhbG9nU3RhdGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25TdGFydCgpIHsKKyAgICAgICAgc3VwZXIub25TdGFydCgpOworICAgICAgICBpZiAobURpYWxvZyAhPSBudWxsKSB7CisgICAgICAgICAgICBtUmVtb3ZlZCA9IGZhbHNlOworICAgICAgICAgICAgbURpYWxvZy5zaG93KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvblNhdmVJbnN0YW5jZVN0YXRlKEJ1bmRsZSBvdXRTdGF0ZSkgeworICAgICAgICBzdXBlci5vblNhdmVJbnN0YW5jZVN0YXRlKG91dFN0YXRlKTsKKyAgICAgICAgaWYgKG1EaWFsb2cgIT0gbnVsbCkgeworICAgICAgICAgICAgQnVuZGxlIGRpYWxvZ1N0YXRlID0gbURpYWxvZy5vblNhdmVJbnN0YW5jZVN0YXRlKCk7CisgICAgICAgICAgICBpZiAoZGlhbG9nU3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG91dFN0YXRlLnB1dEJ1bmRsZShTQVZFRF9ESUFMT0dfU1RBVEVfVEFHLCBkaWFsb2dTdGF0ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1TdHlsZSAhPSBTVFlMRV9OT1JNQUwpIHsKKyAgICAgICAgICAgIG91dFN0YXRlLnB1dEludChTQVZFRF9TVFlMRSwgbVN0eWxlKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobVRoZW1lICE9IDApIHsKKyAgICAgICAgICAgIG91dFN0YXRlLnB1dEludChTQVZFRF9USEVNRSwgbVRoZW1lKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoIW1DYW5jZWxhYmxlKSB7CisgICAgICAgICAgICBvdXRTdGF0ZS5wdXRCb29sZWFuKFNBVkVEX0NBTkNFTEFCTEUsIG1DYW5jZWxhYmxlKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoIW1TaG93c0RpYWxvZykgeworICAgICAgICAgICAgb3V0U3RhdGUucHV0Qm9vbGVhbihTQVZFRF9TSE9XU19ESUFMT0csIG1TaG93c0RpYWxvZyk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1CYWNrU3RhY2tJZCAhPSAtMSkgeworICAgICAgICAgICAgb3V0U3RhdGUucHV0SW50KFNBVkVEX0JBQ0tfU1RBQ0tfSUQsIG1CYWNrU3RhY2tJZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvblN0b3AoKSB7CisgICAgICAgIHN1cGVyLm9uU3RvcCgpOworICAgICAgICBpZiAobURpYWxvZyAhPSBudWxsKSB7CisgICAgICAgICAgICBtRGlhbG9nLm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mljYXRpb25zIGFyZSByZWNlaXZlZCwgdGhlIGZvbGxvd2luZworICAgICAqIHByb3ZpZGVzIGFuIGFycmF5IG9mIGRvd25sb2FkIGlkcyBjb3JyZXNwb25kaW5nIHRvIHRoZSBkb3dubG9hZCBub3RpZmljYXRpb24gdGhhdCB3YXMKKyAgICAgKiBjbGlja2VkLiBJdCBjYW4gYmUgcmV0cmlldmVkIGJ5IHRoZSByZWNlaXZlciBvZiB0aGlzCisgICAgICogSW50ZW50IHVzaW5nIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuSW50ZW50I2dldExvbmdBcnJheUV4dHJhKFN0cmluZyl9LgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVYVFJBX05PVElGSUNBVElPTl9DTElDS19ET1dOTE9BRF9JRFMgPSAiZXh0cmFfY2xpY2tfZG93bmxvYWRfaWRzIjsKKwogICAgIC8vIHRoaXMgYXJyYXkgbXVzdCBjb250YWluIGFsbCBwdWJsaWMgY29sdW1ucwogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZ1tdIENPTFVNTlMgPSBuZXcgU3RyaW5nW10gewogICAgICAgICBDT0xVTU5fSUQsCkBAIC0yODEsMjIgKzI5MywyMyBAQAogICAgICAgICBDT0xVTU5fU1RBVFVTLAogICAgICAgICBDT0xVTU5fUkVBU09OLAogICAgICAgICBDT0xVTU5fQllURVNfRE9XTkxPQURFRF9TT19GQVIsCi0gICAgICAgIENPTFVNTl9MQVNUX01PRElGSUVEX1RJTUVTVEFNUAorICAgICAgICBDT0xVTU5fTEFTVF9NT0RJRklFRF9USU1FU1RBTVAsCisgICAgICAgIENPTFVNTl9MT0NBTF9GSUxFTkFNRQogICAgIH07CiAKICAgICAvLyBjb2x1bW5zIHRvIHJlcXVlc3QgZnJvbSBEb3dubG9hZFByb3ZpZGVyCiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nW10gVU5ERVJMWUlOR19DT0xVTU5TID0gbmV3IFN0cmluZ1tdIHsKICAgICAgICAgRG93bmxvYWRzLkltcGwuX0lELAogICAgICAgICBEb3dubG9hZHMuSW1wbC5DT0xVTU5fTUVESUFQUk9WSURFUl9VUkksCi0gICAgICAgIERvd25sb2Fkcy5DT0xVTU5fVElUTEUsCi0gICAgICAgIERvd25sb2Fkcy5DT0xVTU5fREVTQ1JJUFRJT04sCi0gICAgICAgIERvd25sb2Fkcy5DT0xVTU5fVVJJLAotICAgICAgICBEb3dubG9hZHMuQ09MVU1OX01JTUVfVFlQRSwKLSAgICAgICAgRG93bmxvYWRzLkNPTFVNTl9UT1RBTF9CWVRFUywKLSAgICAgICAgRG93bmxvYWRzLkNPTFVNTl9TVEFUVVMsCi0gICAgICAgIERvd25sb2Fkcy5DT0xVTU5fQ1VSUkVOVF9CWVRFUywKLSAgICAgICAgRG93bmxvYWRzLkNPTFVNTl9MQVNUX01PRElGSUNBVElPTiwKLSAgICAgICAgRG93bmxvYWRzLkNPTFVNTl9ERVNUSU5BVElPTiwKKyAgICAgICAgRG93bmxvYWRzLkltcGwuQ09MVU1OX1RJVExFLAorICAgICAgICBEb3dubG9hZHMuSW1wbC5DT0xVTU5fREVTQ1JJUFRJT04sCisgICAgICAgIERvd25sb2Fkcy5JbXBsLkNPTFVNTl9VUkksCisgICAgICAgIERvd25sb2Fkcy5JbXBsLkNPTFVNTl9NSU1FX1RZUEUsCisgICAgICAgIERvd25sb2Fkcy5JbXBsLkNPTFVNTl9UT1RBTF9CWVRFUywKKyAgICAgICAgRG93bmxvYWRzLkltcGwuQ09MVU1OX1NUQVRVUywKKyAgICAgICAgRG93bmxvYWRzLkltcGwuQ09MVU1OX0NVUlJFTlRfQllURVMsCisgICAgICAgIERvd25sb2Fkcy5JbXBsLkNPTFVNTl9MQVNUX01PRElGSUNBVElPTiwKKyAgICAgICAgRG93bmxvYWRzLkltcGwuQ09MVU1OX0RFU1RJTkFUSU9OLAogICAgICAgICBEb3dubG9hZHMuSW1wbC5DT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luIHByb2dyZXNzIGFuZCBhZnRlciBjb21wbGV0aW9uLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVklTSUJJTElUWV9WSVNJQkxFX05PVElGWV9DT01QTEVURUQgPSAxOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGlzIGRvd25sb2FkIGRvZXNuJ3Qgc2hvdyBpbiB0aGUgVUkgb3IgaW4gdGhlIG5vdGlmaWNhdGlvbnMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBWSVNJQklMSVRZX0hJRERFTiA9IDI7CisKKyAgICAgICAgLyoqIGNhbiB0YWtlIGFueSBvZiB0aGUgZm9sbG93aW5nIHZhbHVlczoge0BsaW5rICNWSVNJQklMSVRZX0hJRERFTn0KKyAgICAgICAgICoge0BsaW5rICNWSVNJQklMSVRZX1ZJU0lCTEVfTk9USUZZX0NPTVBMRVRFRH0sIHtAbGluayAjVklTSUJJTElUWV9WSVNJQkxFfQorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSBpbnQgbU5vdGlmaWNhdGlvblZpc2liaWxpdHkgPSBWSVNJQklMSVRZX1ZJU0lCTEU7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIEBwYXJhbSB1cmkgdGhlIEhUVFAgVVJJIHRvIGRvd25sb2FkLgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIFJlcXVlc3QoVXJpIHVyaSkgewpAQCAtMzQ1LDggKzM3OSw4IEBACiAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBTdHJpbmcgc2NoZW1lID0gdXJpLmdldFNjaGVtZSgpOwotICAgICAgICAgICAgaWYgKHNjaGVtZSA9PSBudWxsIHx8ICFzY2hlbWUuZXF1YWxzKCJodHRwIikpIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW4gb25seSBkb3dubG9hZCBIVFRQIFVSSXM6ICIgKyB1cmkpOworICAgICAgICAgICAgaWYgKHNjaGVtZSA9PSBudWxsIHx8ICghc2NoZW1lLmVxdWFscygiaHR0cCIpICYmICFzY2hlbWUuZXF1YWxzKCJodHRwcyIpKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbiBvbmx5IGRvd25sb2FkIEhUVFAvSFRUUFMgVVJJczogIiArIHVyaSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtVXJpID0gdXJpOwogICAgICAgICB9CkBAIC00NjksOSArNTAzLDMzIEBACiAgICAgICAgICAqCiAgICAgICAgICAqIEBwYXJhbSBzaG93IHdoZXRoZXIgdGhlIGRvd25sb2FkIG1hbmFnZXIgc2hvdWxkIHNob3cgYSBub3RpZmljYXRpb24gZm9yIHRoaXMgZG93bmxvYWQuCiAgICAgICAgICAqIEByZXR1cm4gdGhpcyBvYmplY3QKKyAgICAgICAgICogQGRlcHJlY2F0ZWQgdXNlIHtAbGluayAjc2V0Tm90aWZpY2F0aW9uVmlzaWJpbGl0eShpbnQpfQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIFJlcXVlc3Qgc2V0U2hvd1J1bm5pbmdOb3RpZmljYXRpb24oYm9vbGVhbiBzaG93KSB7Ci0gICAgICAgICAgICBtU2hvd05vdGlmaWNhdGlvbiA9IHNob3c7CisgICAgICAgICAgICByZXR1cm4gKHNob3cpID8gc2V0Tm90aWZpY2F0aW9uVmlzaWJpbGl0eShWSVNJQklMSVRZX1ZJU0lCTEUpIDoKKyAgICAgICAgICAgICAgICAgICAgc2V0Tm90aWZpY2F0aW9uVmlzaWJpbGl0eShWSVNJQklMSVRZX0hJRERFTik7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ29udHJvbCB3aGV0aGVyIGEgc3lzdGVtIG5vdGlmaWNhdGlvbiBpcyBwb3N0ZWQgYnkgdGhlIGRvd25sb2FkIG1hbmFnZXIgd2hpbGUgdGhpcworICAgICAgICAgKiBkb3dubG9hZCBpcyBydW5uaW5nIG9yIHdoZW4gaXQgaXMgY29tcGxldGVkLgorICAgICAgICAgKiBJZiBlbmFibGVkLCB0aGUgZG93bmxvYWQgbWFuYWdlciBwb3N0cyBub3RpZmljYXRpb25zIGFib3V0IGRvd25sb2FkcworICAgICAgICAgKiB0aHJvdWdoIHRoZSBzeXN0ZW0ge0BsaW5rIGFuZHJvaWQuYXBwLk5vdGlmaWNhdGlvbk1hbmFnZXJ9LgorICAgICAgICAgKiBCeSBkZWZhdWx0LCBhIG5vdGlmaWNhdGlvbiBpcyBzaG93biBvbmx5IHdoZW4gdGhlIGRvd25sb2FkIGlzIGluIHByb2dyZXNzLgorICAgICAgICAgKjxwPgorICAgICAgICAgKiBJdCBjYW4gdGFrZSB0aGUgZm9sbG93aW5nIHZhbHVlczoge0BsaW5rICNWSVNJQklMSVRZX0hJRERFTn0sCisgICAgICAgICAqIHtAbGluayAjVklTSUJJTElUWV9WSVNJQkxFfSwKKyAgICAgICAgICoge0BsaW5rICNWSVNJQklMSVRZX1ZJU0lCTEVfTk9USUZZX0NPTVBMRVRFRH0uCisgICAgICAgICAqPHA+CisgICAgICAgICAqIElmIHNldCB0byB7QGxpbmsgI1ZJU0lCSUxJVFlfSElEREVOfSwgdGhpcyByZXF1aXJlcyB0aGUgcGVybWlzc2lvbgorICAgICAgICAgKiBhbmRyb2lkLnBlcm1pc3Npb24uRE9XTkxPQURfV0lUSE9VVF9OT1RJRklDQVRJT04uCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSB2aXNpYmlsaXR5IHRoZSB2aXNpYmlsaXR5IHNldHRpbmcgdmFsdWUKKyAgICAgICAgICogQHJldHVybiB0aGlzIG9iamVjdAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIFJlcXVlc3Qgc2V0Tm90aWZpY2F0aW9uVmlzaWJpbGl0eShpbnQgdmlzaWJpbGl0eSkgeworICAgICAgICAgICAgbU5vdGlmaWNhdGlvblZpc2liaWxpdHkgPSB2aXNpYmlsaXR5OwogICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgIH0KIApAQCAtNTE0LDMwICs1NzIsMjcgQEAKICAgICAgICAgQ29udGVudFZhbHVlcyB0b0NvbnRlbnRWYWx1ZXMoU3RyaW5nIHBhY2thZ2VOYW1lKSB7CiAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CiAgICAgICAgICAgICBhc3NlcnQgbVVyaSAhPSBudWxsOwotICAgICAgICAgICAgdmFsdWVzLnB1dChEb3dubG9hZHMuQ09MVU1OX1VSSSwgbVVyaS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoRG93bmxvYWRzLkltcGwuQ09MVU1OX1VSSSwgbVVyaS50b1N0cmluZygpKTsKICAgICAgICAgICAgIHZhbHVlcy5wdXQoRG93bmxvYWRzLkltcGwuQ09MVU1OX0lTX1BVQkxJQ19BUEksIHRydWUpOwotICAgICAgICAgICAgdmFsdWVzLnB1dChEb3dubG9hZHMuQ09MVU1OX05PVElGSUNBVElPTl9QQUNLQUdFLCBwYWNrYWdlTmFtZSk7CisgICAgICAgICAgICB2YWx1ZXMucHV0KERvd25sb2Fkcy5JbXBsLkNPTFVNTl9OT1RJRklDQVRJT05fUEFDS0FHRSwgcGFja2FnZU5hbWUpOwogCiAgICAgICAgICAgICBpZiAobURlc3RpbmF0aW9uVXJpICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KERvd25sb2Fkcy5DT0xVTU5fREVTVElOQVRJT04sIERvd25sb2Fkcy5JbXBsLkRFU1RJTkFUSU9OX0ZJTEVfVVJJKTsKLSAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KERvd25sb2Fkcy5DT0xVTU5fRklMRV9OQU1FX0hJTlQsIG1EZXN0aW5hdGlvblVyaS50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KERvd25sb2Fkcy5JbXBsLkNPTFVNTl9ERVNUSU5BVElPTiwgRG93bmxvYWRzLkltcGwuREVTVElOQVRJT05fRklMRV9VUkkpOworICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoRG93bmxvYWRzLkltcGwuQ09MVU1OX0ZJTEVfTkFNRV9ISU5ULCBtRGVzdGluYXRpb25VcmkudG9TdHJpbmcoKSk7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoRG93bmxvYWRzLkNPTFVNTl9ERVNUSU5BVElPTiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIERvd25sb2Fkcy5ERVNUSU5BVElPTl9DQUNIRV9QQVJUSVRJT05fUFVSR0VBQkxFKTsKKyAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KERvd25sb2Fkcy5JbXBsLkNPTFVNTl9ERVNUSU5BVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIERvd25sb2Fkcy5JbXBsLkRFU1RJTkFUSU9OX0NBQ0hFX1BBUlRJVElPTl9QVVJHRUFCTEUpOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAoIW1SZXF1ZXN0SGVhZGVycy5pc0VtcHR5KCkpIHsKICAgICAgICAgICAgICAgICBlbmNvZGVIdHRwSGVhZGVycyh2YWx1ZXMpOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBwdXRJZk5vbk51bGwodmFsdWVzLCBEb3dubG9hZHMuQ09MVU1OX1RJVExFLCBtVGl0bGUpOwotICAgICAgICAgICAgcHV0SWZOb25OdWxsKHZhbHVlcywgRG93bmxvYWRzLkNPTFVNTl9ERVNDUklQVElPTiwgbURlc2NyaXB0aW9uKTsKLSAgICAgICAgIC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UzsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ2Fubm90IG9yZGVyIGJ5ICIgKyBjb2x1bW4pOwogICAgICAgICAgICAgfQpAQCAtNjU5LDEwICs3MTQsMTAgQEAKICAgICAgICAgICAgIGlmIChtU3RhdHVzRmxhZ3MgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIExpc3Q8U3RyaW5nPiBwYXJ0cyA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwogICAgICAgICAgICAgICAgIGlmICgobVN0YXR1c0ZsYWdzICYgU1RBVFVTX1BFTkRJTkcpICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgcGFydHMuYWRkKHN0YXR1c0NsYXVzZSgiPSIsIERvd25sb2Fkcy5TVEFUVVNfUEVORElORykpOworICAgICAgICAgICAgICAgICAgICBwYXJ0cy5hZGQoc3RhdHVzQ2xhdXNlKCI9IiwgRG93bmxvYWRzLkltcGwuU1RBVFVTX1BFTkRJTkcpKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKChtU3RhdHVzRmxhZ3MgJiBTVEFUVVNfUlVOTklORykgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBwYXJ0cy5hZGQoc3RhdHVzQ2xhdXNlKCI9IiwgRG93bmxvYWRzLlNUQVRVU19SVU5OSU5HKSk7CisgICAgICAgICAgICAgICAgICAgIHBhcnRzLmFkZChzdGF0dXNDbGF1c2UoIj0iLCBEb3dubG9hZHMuSW1wbC5TVEFUVVNfUlVOTklORykpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAoKG1TdGF0dXNGbGFncyAmIFNUQVRVU19QQVVTRUQpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgcGFydHMuYWRkKHN0YXR1c0NsYXVzZSgiPSIsIERvd25sb2Fkcy5JbXBsLlNUQVRVU19QQVVTRURfQllfQVBQKSk7CkBAIC02NzEsNyArNzI2LDcgQEAKICAgICAgICAgICAgICAgICAgICAgcGFydHMuYWRkKHN0YXR1c0NsYXVzZSgiPSIsIERvd25sb2Fkcy5JbXBsLlNUQVRVU19RVUVVRURfRk9SX1dJRkkpKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKChtU3RhdHVzRmxhZ3MgJiBTVEFUVVNfU1VDQ0VTU0ZVTCkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBwYXJ0cy5hZGQoc3RhdHVzQ2xhdXNlKCI9IiwgRG93bmxvYWRzLlNUQVRVU19TVUNDRVNTKSk7CisgICAgICAgICAgICAgICAgICAgIHBhcnRzLmFkZChzdGF0dXNDbGF1c2UoIj0iLCBEb3dubG9hZHMuSW1wbC5TVEFUVVNfU1VDQ0VTUykpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAoKG1TdGF0dXNGbGFncyAmIFNUQVRVU19GQUlMRUQpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgcGFydHMuYWRkKCIoIiArIHN0YXR1c0NsYXVzZSgiPj0iLCA0MDApCkBAIC03MDgsNyArNzYzLDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIHByaXZhdGUgU3RyaW5nIHN0YXR1c0NsYXVzZShTdHJpbmcgb3BlcmF0b3IsIGludCB2YWx1ZSkgewotICAgICAgICAgICAgcmV0dXJuIERvd25sb2Fkcy5DT0xVTU5fU1RBVFVTICsgb3BlcmF0b3IgKyAiJyIgKyB2YWx1ZSArICInIjsKKyAgICAgICAgICAgIHJldHVybiBEb3dubG9hZHMuSW1wbC5DT0xVTU5fU1RBVFVTICsgb3BlcmF0b3IgKyAiJyIgKyB2YWx1ZSArICInIjsKICAgICAgICAgfQogICAgIH0KIApAQCAtNzQ3LDcgKzgwMiw3IEBACiAgICAgICovCiAgICAgcHVibGljIGxvbmcgZW5xdWV1ZShSZXF1ZXN0IHJlcXVlc3QpIHsKICAgICAgICAgQ29udGVudFZhbHVlcyB2YWx1ZXMgPSByZXF1ZXN0LnRvQ29udGVudFZhbHVlcyhtUGFja2FnZU5hbWUpOwotICAgICAgICBVcmkgZG93bmxvYWRVcmkgPSBtUmVzb2x2ZXIuaW5zZXJ0KERvd25sb2Fkcy5DT05URU5UX1VSSSwgdmFsdWVzKTsKKyAgICAgICAgVXJpIGRvd25sb2FkVXJpID0gbVJlc29sdmVyLmluc2VydChEb3dubG9hZHMuSW1wbC5DT05URU5UX1VSSSwgdmFsdWVzKTsKICAgICAgICAgbG9uZyBpZCA9IExvbmcucGFyc2VMb25nKGRvd25sb2FkVXJpLmdldExhc3RQYXRoU2VnbWVudCgpKTsKICAgICAgICAgcmV0dXJuIGlkOwogICAgIH0KQEAgLTk2OSwxNiArMTAyNCwxOSBAQAogICAgICAgICAgICAgICAgIHJldHVybiBMb25nLnRvU3RyaW5nKHRyYW5zbGF0ZUxvbmcoY29sdW1uKSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoY29sdW1uLmVxdWFscyhDT0xVTU5fVElUTEUpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGdldFVuZGVybHlpbmdTdHJpbmcoRG93bmxvYWRzLkNPTFVNTl9USVRMRSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGdldFVuZGVybHlpbmdTdHJpbmcoRG93bmxvYWRzLkltcGwuQ09MVU1OX1RJVExFKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChjb2x1bW4uZXF1YWxzKENPTFVNTl9ERVNDUklQVElPTikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VW5kZXJseWluZ1N0cmluZyhEb3dubG9hZHMuQ09MVU1OX0RFU0NSSVBUSU9OKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VW5kZXJseWluZ1N0cmluZyhEb3dubG9hZHMuSW1wbC5DT0xVTU5fREVTQ1JJUFRJT04pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKGNvbHVtbi5lcXVhbHMoQ09MVU1OX1VSSSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VW5kZXJseWluZ1N0cmluZyhEb3dubG9hZHMuQ09MVU1OX1VSSSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGdldFVuZGVybHlpbmdTdHJpbmcoRG93bmxvYWRzLkltcGwuQ09MVU1OX1VSSSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoY29sdW1uLmVxdWFscyhDT0xVTU5fTUVESUFfVFlQRSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VW5kZXJseWluZ1N0cmluZyhEb3dubG9hZHMuQ09MVU1OX01JTUVfVFlQRSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGdldFVuZGVybHlpbmdTdHJpbmcoRG93bmxvYWRzLkltcGwuQ09MVU1OX01JTUVfVFlQRSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY29sdW1uLmVxdWFscyhDT0xVTU5fTE9DQUxfRklMRU5BTUUpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGdldFVuZGVybHlpbmdTdHJpbmcoRG93bmxvYWRzLkltcGwuX0RBVEEpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKGNvbHVtbi5lcXVhbHMoQ09MVU1OX01FRElBUFJPVklERVJfVVJJKSkgewogICAgICAgICAgICAgICAgIHJldHVybiBnZXRVbmRlcmx5aW5nU3RyaW5nKERvd25sb2Fkcy5JbXBsLkNPTFVNTl9NRURJQVBST1ZJREVSX1VSSSk7CkBAIC0xMDE5LDE5ICsxMDc3LDE5IEBACiAgICAgICAgICAgICAgICAgcmV0dXJuIGdldFVuZGVybHlpbmdMb25nKERvd25sb2Fkcy5JbXBsLl9JRCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoY29sdW1uLmVxdWFscyhDT0xVTU5fVE9UQUxfU0laRV9CWVRFUykpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VW5kZXJseWluZ0xvbmcoRG93bmxvYWRzLkNPTFVNTl9UT1RBTF9CWVRFUyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGdldFVuZGVybHlpbmdMb25nKERvd25sb2Fkcy5JbXBsLkNPTFVNTl9UT1RBTF9CWVRFUyk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoY29sdW1uLmVxdWFscyhDT0xVTU5fU1RBVFVTKSkgewotICAgICAgICAgICAgICAgIHJldHVybiB0cmFuc2xhdGVTdGF0dXMoKGludCkgZ2V0VW5kZXJseWluZ0xvbmcoRG93bmxvYWRzLkNPTFVNTl9TVEFUVVMpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNsYXRlU3RhdHVzKChpbnQpIGdldFVuZGVybHlpbmdMb25nKERvd25sb2Fkcy5JbXBsLkNPTFVNTl9TVEFUVVMpKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChjb2x1bW4uZXF1YWxzKENPTFVNTl9SRUFTT04pKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGdldFJlYXNvbigoaW50KSBnZXRVbmRlcmx5aW5nTG9uZyhEb3dubG9hZHMuQ09MVU1OX1NUQVRVUykpOworICAgICAgICAgICAgICAgIHJldHVybiBnZXRSZWFzb24oKGludCkgZ2V0VW5kZXJseWluZ0xvbmcoRG93bmxvYWRzLkltcGwuQ09MVU1OX1NUQVRVUykpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKGNvbHVtbi5lcXVhbHMoQ09MVU1OX0JZVEVTX0RPV05MT0FERURfU09fRkFSKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBnZXRVbmRlcmx5aW5nTG9uZyhEb3dubG9hZHMuQ09MVU1OX0NVUlJFTlRfQllURVMpOworICAgICAgICAgICAgICAgIHJldHVybiBnZXRVbmRlcmx5aW5nTG9uZyhEb3dubG9hZHMuSW1wbC5DT0xVTU5fQ1VSUkVOVF9CWVRFUyk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBhc3NlcnQgY29sdW1uLmVxdWFscyhDT0xVTU5fTEFTVF9NT0RJRklFRF9USU1FU1RBTVApOwotICAgICAgICAgICAgcmV0dXJuIGdldFVuZGVybHlpbmdMb25nKERvd25sb2Fkcy5DT0xVTU5fTEFTVF9NT0RJRklDQVRJT04pOworICAgICAgICAgICAgcmV0dXJuIGdldFVuZGVybHlpbmdMb25nKERvd25sb2Fkcy5JbXBsLkNPTFVNTl9MQVNUX01PRElGSUNBVElPTik7CiAgICAgICAgIH0KIAogICAgICAgICBwcml2YXRlIGxvbmcgZ2V0UmVhc29uKGludCBzdGF0dXMpIHsKQEAgLTEwNzEsMjMgKzExMjksMjMgQEAKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgc3dpdGNoIChzdGF0dXMpIHsKLSAgICAgICAgICAgICAgICBjYXNlIERvd25sb2Fkcy5TVEFUVVNfRklMRV9FUlJPUjoKKyAgICAgICAgICAgICAgICBjYXNlIERvd25sb2Fkcy5JbXBsLlNUQVRVU19GSUxFX0VSUk9SOgogICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfRklMRV9FUlJPUjsKIAotICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLlNUQVRVU19VTkhBTkRMRURfSFRUUF9DT0RFOgotICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLlNUQVRVU19VTkhBTkRMRURfUkVESVJFQ1Q6CisgICAgICAgICAgICAgICAgY2FzZSBEb3dubG9hZHMuSW1wbC5TVEFUVVNfVU5IQU5ETEVEX0hUVFBfQ09ERToKKyAgICAgICAgICAgICAgICBjYXNlIERvd25sb2Fkcy5JbXBsLlNUQVRVU19VTkhBTkRMRURfUkVESVJFQ1Q6CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9VTkhBTkRMRURfSFRUUF9DT0RFOwogCi0gICAgICAgICAgICAgICAgY2FzZSBEb3dubG9hZHMuU1RBVFVTX0hUVFBfREFUQV9FUlJPUjoKKyAgICAgICAgICAgICAgICBjYXNlIERvd25sb2Fkcy5JbXBsLlNUQVRVU19IVFRQX0RBVEFfRVJST1I6CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9IVFRQX0RBVEFfRVJST1I7CiAKLSAgICAgICAgICAgICAgICBjYXNlIERvd25sb2Fkcy5TVEFUVVNfVE9PX01BTllfUkVESVJFQ1RTOgorICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLkltcGwuU1RBVFVTX1RPT19NQU5ZX1JFRElSRUNUUzoKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX1RPT19NQU5ZX1JFRElSRUNUUzsKIAotICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLlNUQVRVU19JTlNVRkZJQ0lFTlRfU1BBQ0VfRVJST1I6CisgICAgICAgICAgICAgICAgY2FzZSBEb3dubG9hZHMuSW1wbC5TVEFUVVNfSU5TVUZGSUNJRU5UX1NQQUNFX0VSUk9SOgogICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU5TVUZGSUNJRU5UX1NQQUNFOwogCi0gICAgICAgICAgICAgICAgY2FzZSBEb3dubG9hZHMuU1RBVFVTX0RFVklDRV9OT1RfRk9VTkRfRVJST1I6CisgICAgICAgICAgICAgICAgY2FzZSBEb3dubG9hZHMuSW1wbC5TVEFUVVNfREVWSUNFX05PVF9GT1VORF9FUlJPUjoKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0RFVklDRV9OT1RfRk9VTkQ7CiAKICAgICAgICAgICAgICAgICBjYXNlIERvd25sb2Fkcy5JbXBsLlNUQVRVU19DQU5OT1RfUkVTVU1FOgpAQCAtMTExMSwxMCArMTE2OSwxMCBAQAogCiAgICAgICAgIHByaXZhdGUgaW50IHRyYW5zbGF0ZVN0YXR1cyhpbnQgc3RhdHVzKSB7CiAgICAgICAgICAgICBzd2l0Y2ggKHN0YXR1cykgewotICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLlNUQVRVU19QRU5ESU5HOgorICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLkltcGwuU1RBVFVTX1BFTkRJTkc6CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVEFUVVNfUEVORElORzsKIAotICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLlNUQVRVU19SVU5OSU5HOgorICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLkltcGwuU1RBVFVTX1JVTk5JTkc6CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVEFUVVNfUlVOTklORzsKIAogICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLkltcGwuU1RBVFVTX1BBVVNFRF9CWV9BUFA6CkBAIC0xMTIzLDExICsxMTgxLDExIEBACiAgICAgICAgICAgICAgICAgY2FzZSBEb3dubG9hZHMuSW1wbC5TVEFUVVNfUVVFVUVEX0ZPUl9XSUZJOgogICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1RBVFVTX1BBVVNFRDsKIAotICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLlNUQVRVU19TVUNDRVNTOgorICAgICAgICAgICAgICAgIGNhc2UgRG93bmxvYWRzLkltcGwuU1RBVFVTX1NVQ0NFU1M6CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVEFUVVNfU1VDQ0VTU0ZVTDsKIAogICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgIGFzc2VydCBEb3dubG9hZHMuaXNTdGF0dXNFcnJvcihzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICBhc3NlcnQgRG93bmxvYWRzLkltcGwuaXNTdGF0dXNFcnJvcihzdGF0dXMpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1RBVFVTX0ZBSUxFRDsKICAgICAgICA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Z21lbnRTdGF0ZShQYXJjZWwgaW4pIHsKKyAgICAgICAgbUNsYXNzTmFtZSA9IGluLnJlYWRTdHJpbmcoKTsKKyAgICAgICAgbUluZGV4ID0gaW4ucmVhZEludCgpOworICAgICAgICBtRnJvbUxheW91dCA9IGluLnJlYWRJbnQoKSAhPSAwOworICAgICAgICBtRnJhZ21lbnRJZCA9IGluLnJlYWRJbnQoKTsKKyAgICAgICAgbUNvbnRhaW5lcklkID0gaW4ucmVhZEludCgpOworICAgICAgICBtVGFnID0gaW4ucmVhZFN0cmluZygpOworICAgICAgICBtUmV0YWluSW5zdGFuY2UgPSBpbi5yZWFkSW50KCkgIT0gMDsKKyAgICAgICAgbUFyZ3VtZW50cyA9IGluLnJlYWRCdW5kbGUoKTsKKyAgICAgICAgbVNhdmVkRnJhZ21lbnRTdGF0ZSA9IGluLnJlYWRCdW5kbGUoKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIEZyYWdtZW50IGluc3RhbnRpYXRlKEFjdGl2aXR5IGFjdGl2aXR5KSB7CisgICAgICAgIGlmIChtSW5zdGFuY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG1JbnN0YW5jZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKG1Bcmd1bWVudHMgIT0gbnVsbCkgeworICAgICAgICAgICAgbUFyZ3VtZW50cy5zZXRDbGFzc0xvYWRlcihhY3Rpdml0eS5nZXRDbGFzc0xvYWRlcigpKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgbUluc3RhbmNlID0gRnJhZ21lbnQuaW5zdGFudGlhdGUoYWN0aXZpdHksIG1DbGFzc05hbWUsIG1Bcmd1bWVudHMpOworICAgICAgICAKKyAgICAgICAgaWYgKG1TYXZlZEZyYWdtZW50U3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgbVNhdmVkRnJhZ21lbnRTdGF0ZS5zZXRDbGFzc0xvYWRlcihhY3Rpdml0eS5nZXRDbGFzc0xvYWRlcigpKTsKKyAgICAgICAgICAgIG1JbnN0YW5jZS5tU2F2ZWRGcmFnbWVudFN0YXRlID0gbVNhdmVkRnJhZ21lbnRTdGF0ZTsKKyAgICAgICAgfQorICAgICAgICBtSW5zdGFuY2Uuc2V0SW5kZXgobUluZGV4KTsKKyAgICAgICAgbUluc3RhbmNlLm1Gcm9tTGF5b3V0ID0gbUZyb21MYXlvdXQ7CisgICAgICAgIG1JbnN0YW5jZS5tRnJhZ21lbnRJZCA9IG1GcmFnbWVudElkOworICAgICAgICBtSW5zdGFuY2UubUNvbnRhaW5lcklkID0gbUNvbnRhaW5lcklkOworICAgICAgICBtSW5zdGFuY2UubVRhZyA9IG1UYWc7CisgICAgICAgIG1JbnN0YW5jZS5tUmV0YWluSW5zdGFuY2UgPSBtUmV0YWluSW5zdGFuY2U7CisgICAgICAgIG1JbnN0YW5jZS5tRnJhZ21lbnRNYW5hZ2VyID0gYWN0aXZpdHkubUZyYWdtZW50czsKKyAgICAgICAgCisgICAgICAgIHJldHVybiBtSW5zdGFuY2U7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcobUNsYXNzTmFtZSk7CisgICAgICAgIGRlc3Qud3JpdGVJbnQobUluZGV4KTsKKyAgICAgICAgZGVzdC53cml0ZUludChtRnJvbUxheW91dCA/IDEgOiAwKTsKKyAgICAgICAgZGVzdC53cml0ZUludChtRnJhZ21lbnRJZCk7CisgICAgICAgIGRlc3Qud3JpdGVJbnQobUNvbnRhaW5lcklkKTsKKyAgICAgICAgZGVzdC53cml0ZVN0cmluZyhtVGFnKTsKKyAgICAgICAgZGVzdC53cml0ZUludChtUmV0YWluSW5zdGFuY2UgPyAxIDogM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QHJldHVybiBSZXR1cm5zIGEgbmV3IGZyYWdtZW50IGluc3RhbmNlLgorICAgICAqIEB0aHJvd3MgSW5zdGFudGlhdGlvbkV4Y2VwdGlvbiBJZiB0aGVyZSBpcyBhIGZhaWx1cmUgaW4gaW5zdGFudGlhdGluZworICAgICAqIHRoZSBnaXZlbiBmcmFnbWVudCBjbGFzcy4gIFRoaXMgaXMgYSBydW50aW1lIGV4Y2VwdGlvbjsgaXQgaXMgbm90CisgICAgICogbm9ybWFsbHkgZXhwZWN0ZWQgdG8gaGFwcGVuLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgRnJhZ21lbnQgaW5zdGFudGlhdGUoQ29udGV4dCBjb250ZXh0LCBTdHJpbmcgZm5hbWUsIEJ1bmRsZSBhcmdzKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBDbGFzczw/PiBjbGF6eiA9IHNDbGFzc01hcC5nZXQoZm5hbWUpOworICAgICAgICAgICAgaWYgKGNsYXp6ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvLyBDbGFzcyBub3QgZm91bmQgaW4gdGhlIGNhY2hlLCBzZWUgaWYgaXQncyByZWFsLCBhbmQgdHJ5IHRvIGFkZCBpdAorICAgICAgICAgICAgICAgIGNsYXp6ID0gY29udGV4dC5nZXRDbGFzc0xvYWRlcigpLmxvYWRDbGFzcyhmbmFtZSk7CisgICAgICAgICAgICAgICAgc0NsYXNzTWFwLnB1dChmbmFtZSwgY2xhenopOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRnJhZ21lbnQgZiA9IChGcmFnbWVudCljbGF6ei5uZXdJbnN0YW5jZSgpOworICAgICAgICAgICAgaWYgKGFyZ3MgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGFyZ3Muc2V0Q2xhc3NMb2FkZXIoZi5nZXRDbGFzcygpLmdldENsYXNzTG9hZGVyKCkpOworICAgICAgICAgICAgICAgIGYubUFyZ3VtZW50cyA9IGFyZ3M7CisgICAgICAgICAgIC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oYXQgaXMgcHVibGljIiwgZSk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgdm9pZCByZXN0b3JlVmlld1N0YXRlKCkgeworICAgICAgICBpZiAobVNhdmVkVmlld1N0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1WaWV3LnJlc3RvcmVIaWVyYXJjaHlTdGF0ZShtU2F2ZWRWaWV3U3RhdGUpOworICAgICAgICAgICAgbVNhdmVkVmlld1N0YXRlID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIHNldEluZGV4KGludCBpbmRleCkgeworICAgICAgICBtSW5kZXggPSBpbmRleDsKKyAgICAgICAgbVdobyA9ICJhbmRyb2lkOmZyYWdtZW50OiIgKyBtSW5kZXg7CisgICB9CisgICAgCisgICAgdm9pZCBjbGVhckluZGV4KCkgeworICAgICAgICBtSW5kZXggPSAtMTsKKyAgICAgICAgbVdobyA9IG51bGw7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFN1YmNsYXNzZXMgY2FuIG5vdCBvdmVycmlkZSBlcXVhbHMoKS4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUgZmluYWwgcHVibGljIGJvb2xlYW4gZXF1YWxzKE9iamVjdCBvKSB7CisgICAgICAgIHJldHVybiBzdXBlci5lcXVhbHMobyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU3ViY2xhc3NlcyBjYW4gbm90IG92ZXJyaWRlIGhhc2hDb2RlKCkuCisgICAgICovCisgICAgQE92ZXJyaWRlIGZpbmFsIHB1YmxpYyBpbnQgaGFzaENvZGUoKSB7CisgICAgICAgIHJldHVybiBzdXBlci5oYXNoQ29kZSgpOworICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIoMTI4KTsKKyAgICAgICAgc2IuYXBwZW5kKCJGcmFnbWVudHsiKTsKKyAgICAgICAgc2IuYXBwZW5kKEludGVnZXIudG9IZXhTdHJpbmcoU3lzdGVtLmlkZW50aXR5SGFzaENvZGUodGhpcykpKTsKKyAgICAgICAgaWYgKG1JbmRleCA+PSAwKSB7CisgICAgICAgICAgICBzYi5hcHBlbmQoIiAjIik7CisgICAgICAgICAgICBzYi5hcHBlbmQobUluZGV4KTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUZyYWdtZW50SWQgIT0gMCkgeworICAgICAgICAgICAgc2IuYXBwZW5kKCIgaWQ9MHgiKTsKKyAgICAgICAgICAgIHNiLmFwcGVuZChJbnRlZ2VyLnRvSGV4U3RyaW5nKG1GcmFnbWVudElkKSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1UYWcgIT0gbnVsbCkgeworICAgICAgICAgICAgc2IuYXBwZW5kKCIgIik7CisgICAgICAgICAgICBzYi5hcHBlbmQobVRhZyk7CisgICAgICAgIH0KKyAgICAgICAgc2IuYXBwZW5kKCd9Jyk7CisgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIGlkZW50aWZpZXIgdGhpcyBmcmFnbWVudCBpcyBrbm93biBieS4gIFRoaXMgaXMgZWl0aGVyCisgICAgICogdGhlIGFuZHJvaWQ6aWQgdmFsdWUgc3VwcGxpZWQgaW4gYSBsYXlvdXQgb3IgdGhlIGNvbnRhaW5lciB2aWV3IElECisgICAgICogc3VwcGxpZWQgd2hlbiBhZGRpbmcgdGhlIGZyYWdtZW50LgorICAgICAqLworICAgIGZpbmFsIHB1YmxpYyBpbnQgZ2V0SWQoKSB7CisgICAgICAgIHJldHVybiBtRnJhZ21lbnRJZDsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogR2V0IHRoZSB0YWcgbmFtZSBvZiB0aGUgZnJhZ21lbnQsIGlmIHNwZWNpZmllZC4KKyAgICAgKi8KKyAgICB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YXJhbSBoYXNNZW51IElmIHRydWUsIHRoZSBmcmFnbWVudCBoYXMgbWVudSBpdGVtcyB0byBjb250cmlidXRlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEhhc09wdGlvbnNNZW51KGJvb2xlYW4gaGFzTWVudSkgeworICAgICAgICBpZiAobUhhc01lbnUgIT0gaGFzTWVudSkgeworICAgICAgICAgICAgbUhhc01lbnUgPSBoYXNNZW51OworICAgICAgICAgICAgaWYgKGlzQWRkZWQoKSAmJiAhaXNIaWRkZW4oKSkgeworICAgICAgICAgICAgICAgIG1BY3Rpdml0eS5pbnZhbGlkYXRlT3B0aW9uc01lbnUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIExvYWRlck1hbmFnZXIgZm9yIHRoaXMgZnJhZ21lbnQsIGNyZWF0aW5nIGl0IGlmIG5lZWRlZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgTG9hZGVyTWFuYWdlciBnZXRMb2FkZXJNYW5hZ2VyKCkgeworICAgICAgICBpZiAobUxvYWRlck1hbmFnZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG1Mb2FkZXJNYW5hZ2VyOworICAgICAgICB9CisgICAgICAgIG1DaGVja2VkRm9yTG9hZGVyTWFuYWdlciA9IHRydWU7CisgICAgICAgIG1Mb2FkZXJNYW5hZ2VyID0gbUFjdGl2aXR5LmdldExvYWRlck1hbmFnZXIobUluZGV4LCBtTG9hZGVyc1N0YXJ0ZWQsIHRydWUpOworICAgICAgICByZXR1cm4gbUxvYWRlck1hbmFnZXI7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIENhbGwge0BsaW5rIEFjdGl2aXR5I3N0YXJ0QWN0aXZpdHkoSW50ZW50KX0gb24gdGhlIGZyYWdtZW50J3MKKyAgICAgKiBjb250YWluaW5nIEFjdGl2aXR5LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHN0YXJ0QWN0aXZpdHkoSW50ZW50IGludGVudCkgeworICAgICAgICBtQWN0aXZpdHkuc3RhcnRBY3Rpdml0eUZyb21GcmFnbWVudCh0aGlzLCBpbnRlbnQsIC0xKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQ2FsbCB7QGxpbmsgQWN0aXZpdHkjc3RhcnRBY3Rpdml0eUZvclJlc3VsdChJbnRlbnQsIGludCl9IG9uIHRoZSBmcmFnbWVudCdzCisgICAgICogY29udGFpbmluZyBBY3Rpdml0eS4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzdGFydEFjdGl2aXR5Rm9yUmVzdWx0KEludGVudCBpbnRlbnQsIGludCByZXF1ZXN0Q29kZSkgeworICAgICAgICBtQWN0aXZpdHkuc3RhcnRBY3Rpdml0eUZyb21GcmFnbWVudCh0aGlzLCBpbnRlbnQsIHJlcXVlc3RDb2RlKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogUmVjZWl2ZSB0aGUgcmVzdWx0IGZyb20gYSBwcmV2aW91cyBjYWxsIHRvCisgICAgICoge0BsaW5rICNzdGFydEFjdGl2aXR5Rm9yUmVzdWx0KEludGVudCwgaW50KX0uICBUaGlzIGZvbGxvd3MgdGhlCisgICAgICogcmVsYXRlZCBBY3Rpdml0eSBBUEkgYXMgZGVzY3JpYmVkIHRoZXJlIGluCisgICAgICoge0BsaW5rIEFjdGl2aXR5I29uQWN0aXZpdHlSZXN1bHQoaW50LCBpbnQsIEludGVudCl9LgorICAgICAqIAorICAgICAqIEBwYXJhbSByZXF1ZXN0Q29kZSBUaGUgaW50ZWdlciByZXF1ZXN0IGNvZGUgb3JpZ2luYWxseSBzdXBwbGllZCB0bworICAgICAqICAgICAgICAgICAgICAgICAgICBzdGFydEFjdGl2aXR5Rm9yUmVzdWx0KCksIGFsbG93aW5nIHlvdSB0byBpZGVudGlmeSB3aG8gdGhpcworICAgICAqICAgICAgICAgICAgICAgICAgICByZXN1bHQg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pbiB3aGljaCB0byBwbGFjZSB5b3VyIHNhdmVkIHN0YXRlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIG9uU2F2ZUluc3RhbmNlU3RhdGUoQnVuZGxlIG91dFN0YXRlKSB7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIG9uQ29uZmlndXJhdGlvbkNoYW5nZWQoQ29uZmlndXJhdGlvbiBuZXdDb25maWcpIHsKKyAgICAgICAgbUNhbGxlZCA9IHRydWU7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIENhbGxlZCB3aGVuIHRoZSBGcmFnbWVudCBpcyBubyBsb25nZXIgcmVzdW1lZC4gIFRoaXMgaXMgZ2VuZXJhbGx5CisgICAgICogdGllZCB0byB7QGxpbmsgQWN0aXZpdHkjb25QYXVzZSgpIEFjdGl2aXR5Lm9uUGF1c2V9IG9mIHRoZSBjb250YWluaW5nCisgICAgICogQWN0aXZpdHkncyBsaWZlY3ljbGUuCisgICAgICovCisgICAgcHVibGljIHZvaWQgb25QYXVzZSgpIHsKKyAgICAgICAgbUNhbGxlZCA9IHRydWU7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIENhbGxlZCB3aGVuIHRoZSBGcmFnbWVudCBpcyBubyBsb25nZXIgc3RhcnRlZC4gIFRoaXMgaXMgZ2VuZXJhbGx5CisgICAgICogdGllZCB0byB7QGxpbmsgQWN0aXZpdHkjb25TdG9wKCkgQWN0aXZpdHkub25TdG9wfSBvZiB0aGUgY29udGFpbmluZworICAgICAqIEFjdGl2aXR5J3MgbGlmZWN5Y2xlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIG9uU3RvcCgpIHsKKyAgICAgICAgbUNhbGxlZCA9IHRydWU7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIG9uTG93TWVtb3J5KCkgeworICAgICAgICBtQ2FsbGVkID0gdHJ1ZTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQ2FsbGVkIHdoZW4gdGhlI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aGUgYmFjay9tZW51IGJ1dHRvbiwgb3Igd2hlbiBhbiBpdGVtIGlzIHNlbGVjdGVkKS4KKyAgICAgKiAgCisgICAgICogQHBhcmFtIG1lbnUgVGhlIG9wdGlvbnMgbWVudSBhcyBsYXN0IHNob3duIG9yIGZpcnN0IGluaXRpYWxpemVkIGJ5CisgICAgICogICAgICAgICAgICAgb25DcmVhdGVPcHRpb25zTWVudSgpLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIG9uT3B0aW9uc01lbnVDbG9zZWQoTWVudSBtZW51KSB7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIENhbGxlZCB3aGVuIGEgY29udGV4dCBtZW51IGZvciB0aGUge0Bjb2RlIHZpZXd9IGlzIGFib3V0IHRvIGJlIHNob3duLgorICAgICAqIFVubGlrZSB7QGxpbmsgI29uQ3JlYXRlT3B0aW9uc01lbnV9LCB0aGlzIHdpbGwgYmUgY2FsbGVkIGV2ZXJ5CisgICAgICogdGltZSB0aGUgY29udGV4dCBtZW51IGlzIGFib3V0IHRvIGJlIHNob3duIGFuZCBzaG91bGQgYmUgcG9wdWxhdGVkIGZvcgorICAgICAqIHRoZSB2aWV3IChvciBpdGVtIGluc2lkZSB0aGUgdmlldyBmb3Ige0BsaW5rIEFkYXB0ZXJWaWV3fSBzdWJjbGFzc2VzLAorICAgICAqIHRoaXMgY2FuIGJlIGZvdW5kIGluIHRoZSB7QGNvZGUgbWVudUluZm99KSkuCisgICAgICogPHA+CisgICAgICogVXNlIHtAbGluayAjb25Db250ZXh0SXRlbVNlbGVjdGVkKGFuZHJvaWQudmlldy5NZW51SXRlbSl9IHRvIGtub3cgd2hlbiBhbgorICAgICAqIGl0ZW0gaGFzIGJlZW4gc2VsZWN0ZWQuCisgICAgICogPHA+CisgICAgICogVGhlIGRlZmF1bHQgaW1wbGVtZW50YXRpb24gY2FsbHMgdXAgdG8KKyAgICAgKiB7QGxpbmsgQWN0aXZpdHkjb25DcmVhdGVDb250ZXh0TWVudSBBY3Rpdml0eS5vbkNyZWF0ZUNvbnRleHRNZW51fSwgdGhvdWdoCisgICAgICogeW91IGNhbiBub3QgY2FsbCB0aGlzIGltcGxlbWVudGF0aW9uIGlmIHlvdSBkb24ndCB3YW50IHRoYXQgYmVoYXZpb3IuCisgICAgICogPHA+CisgICAgICogSXQgaXMgbm90IHNhZmUgdG8gaG9sZCBvbnRvIHRoZSBjb250ZXh0IG1lbnUgYWZ0ZXIgdGhpcyBtZXRob2QgcmV0dXJucy4KKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCisgICAgcHVibGljIHZvaWQgb25DcmVhdGVDb250ZXh0TWVudShDb250ZXh0TWVudSBtZW51LCBWaWV3IHYsIENvbnRleHRNZW51SW5mbyBtZW51SW5mbykgeworICAgICAgICBnZXRBY3Rpdml0eSgpLm9uQ3JlYXRlQ29udGV4dE1lbnUobWVudSwgdiwgbWVudUluZm8pOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJlZ2lzdGVycyBhIGNvbnRleHQgbWVudSB0byBiZSBzaG93biBmb3IgdGhlIGdpdmVuIHZpZXcgKG11bHRpcGxlIHZpZXdzCisgICAgICogY2FuIHNob3cgdGhlIGNvbnRleHQgbWVudSkuIFRoaXMgbWV0aG9kIHdpbGwgc2V0IHRoZQorICAgICAqIHtAbGluayBPbkNyZWF0ZUNvbnRleHRNZW51TGlzdGVuZXJ9IG9uIHRoZSB2aWV3IHRvIHRoaXMgZnJhZ21lbnQsIHNvCisgICAgICoge0BsaW5rICNvbkNyZWF0ZUNvbnRleHRNZW51KENvbnRleHRNZW51LCBWaWV3LCBDb250ZXh0TWVudUluZm8pfSB3aWxsIGJlCisgICAgICogY2FsbGVkIHdoZW4gaXQgaXMgdGltZSB0byBzaG93IHRoZSBjb250ZXh0IG1lbnUuCisgICAgICogCisgICAgICogQHNlZSAjdW5yZWdpc3RlckZvckNvbnRleHRNZW51KFZpZXcpCisgICAgICogQHBhcmFtIHZpZXcgVGhlIHZpZXcgdGhhdC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isgICAgICogQHBhcmFtIGZkIFRoZSByYXcgZmlsZSBkZXNjcmlwdG9yIHRoYXQgdGhlIGR1bXAgaXMgYmVpbmcgc2VudCB0by4KKyAgICAgKiBAcGFyYW0gd3JpdGVyIFRoZSBQcmludFdyaXRlciB0byB3aGljaCB5b3Ugc2hvdWxkIGR1bXAgeW91ciBzdGF0ZS4gIFRoaXMgd2lsbCBiZQorICAgICAqIGNsb3NlZCBmb3IgeW91IGFmdGVyIHlvdSByZXR1cm4uCisgICAgICogQHBhcmFtIGFyZ3MgYWRkaXRpb25hbCBhcmd1bWVudHMgdG8gdGhlIGR1bXAgcmVxdWVzdC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBkdW1wKFN0cmluZyBwcmVmaXgsIEZpbGVEZXNjcmlwdG9yIGZkLCBQcmludFdyaXRlciB3cml0ZXIsIFN0cmluZ1tdIGFyZ3MpIHsKKyAgICAgICAgd3JpdGVyLnByaW50KHByZWZpeCk7IHdyaXRlci5wcmludCgibUZyYWdtZW50SWQ9Iik7IHdyaXRlci5wcmludChtRnJhZ21lbnRJZCk7CisgICAgICAgICAgICAgICAgd3JpdGVyLnByaW50KCIgbUNvbnRhaW5lcklkPSIpOyB3cml0ZXIucHJpbnQobUNvbnRhaW5lcklkKTsKKyAgICAgICAgICAgICAgICB3cml0ZXIucHJpbnQoIiBtVGFnPSIpOyB3cml0ZXIucHJpbnRsbihtVGFnKTsKKyAgICAgICAgd3JpdGVyLnByaW50KHByZWZpeCk7IHdyaXRlci5wcmludCgibVN0YXRlPSIpOyB3cml0ZXIucHJpbnQobVN0YXRlKTsKKyAgICAgICAgICAgICAgICB3cml0ZXIucHJpbnQoIiBtSW5kZXg9Iik7IHdyaXRlci5wcmludChtSW5kZXgpOworICAgICAgICAgICAgICAgIHdyaXRlci5wcmludCgiIG1XaG89Iik7IHdyaXRlci5wcmludChtV2hvKTsKKyAgICAgICAgICAgICAgICB3cml0ZXIucHJpbnQoIiBtQmFja1N0YWNrTmVzdGluZz0iKTsgd3JpdGVyLnByaW50bG4obUJhY2tTdGFja05lc3RpbmcpOworICAgICAgICB3cml0ZXIucHJpbnQocHJlZml4KTsgd3JpdGVyLnByaW50KCJtQWRkZWQ9Iik7IHdyaXRlci5wcmludChtQWRkZWQpOworICAgICAgICAgICAgICAgIHdyaXRlci5wcmludCgiIG1SZXN1bWVkPSIpOyB3cml0ZXIucHJpbnQobVJlc3VtZWQpOworICAgICAgICAgICAgICAgIHdyaXRlci5wcmludCgiIG1Gcm9tTGF5b3V0PSIpOyB3cml0ZXIucHJpbnQobUZyb21MYXlvdXQpOworICAgICAgICAgICAgICAgIHdyaXRlci5wcmludCgiIG1JbkxheW91dD0iKTsgd3JpdGVyLnByaW50bG4obUluTGF5b3V0KTsKKyAgICAgICAgd3JpdGVyLnByaW50KHByZWZpeCk7IHdyaXRlci5wcmludCgibUhpZGRlbj0iKTsgd3JpdGVyLnByaW50KG1IaWRkZW4pOworICAgICAgICAgICAgICAgIHdyaXRlci5wcmludCgiIG1SZXRhaW5JbnN0YW5jZT0iKTsgd3JpdGVyLnByaW50KG1SZXRhaW5JbnN0YW5jZSk7CisgICAgICAgICAgICAgICAgd3JpdGVyLnByaW50KCIgbVJldGFpbmluZz0iKTsgd3JpdGVyLnByaW50KG1SZXRhaW5pbmcpOworICAgICAgICAgICAgICAgIHdyaXRlci5wcmludCgiIG1IYXNNZW51PSIpOyB3cml0ZXIucHJpbnRsbihtSGFzTWVudSk7CisgICAgICAgIGlmIChtRnJhZ21lbnRNYW5hZ2VyICE9IG51bGwpIHsKKyAgICAgICAgICAgIHdyaXRlci5wcmludChwcmVmaXgpOyB3cml0ZXIucHJpbnQoIm1GcmFnbWVudE1hbmFnZXI9Iik7CisgICAgICAgICAgICAgICAgICAgIHdyaXRlci5wcmludGxuKG1GcmFnbWVudE1hbmFnZXIpOworICAgICAgICB9CisgICAgICAgIGlmIChtSW1tZWRpYXRlQWN0aXZpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgd3JpdGVyLnByaW50KHByZWZpeCk7IHdyaXRlci5wcmludCgibUltbWVkaWF0ZUFjdGl2aXR5PSIpOworICAgICAgICAgICAgICAgICAgICB3cml0ZXIucHJpbnRsbihtSW1tZWRpYXRlQWN0aXZpdHkpOworICAgICAgICB9CisgICAgICAgIGlmIChtQWN0aXZpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgd3JpdGVyLnByaW50KHByZWZpeCk7IHdyaXRlci5wcmludCgibUFjdGl2aXR5PSIpOworICAgICAgICAgICAgICAgICAgICB3cml0ZXIucHJpbnRsbihtQWN0aXZpdHkpOworICAgICAgICB9CisgICAgICAgIGlmIChtQXJndW1lbnRzICE9IG51bGwpIHsKKyAgICAgICAgICAgIHdyaXRlci5wcmludChwcmVmaXgpOyB3cml0ZXIucHJpbnQoIm1Bcmd1bWVudHM9Iik7IHdyaXRlci5wcmludGxuKG1Bcmd1bWVudHMpOworICAgICAgICB9CisgICAgICAgIGlmIChtU2F2ZWRGcmFnbWVudFN0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHdyaXRlci5wcmludChwcmVmaXgpOyB3cml0ZXIucHJpbnQoIm1TYXZlZEZyYWdtZW50U3RhdGU9Iik7CisgICAgICAgICAgICAgICAgICAgIHdyaXRlci5wcmludGxuKG1TYXZlZEZyYWdtZW50U3RhdGUpOworICAgICAgICB9CisgICAgICAgIGlmIChtU2F2ZWRWaWV3U3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgd3JpdGVyLnByaW50KHByZWZpeCk7IHdyaXRlci5wcmludCgibVNhdmVkVmlld1N0YXRlPSIpOworICAgICAgICAgICAgICAgICAgICB3cml0ZXIucHJpbnRsbihtU2F2ZWRWaWV3U3RhdGUpOworICAgICAgICB9CisgICAgICAgIGlmIChtVGFyZ2V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHdyaXRlci5wcmludChwcmVmaXgpOyB3cml0ZXIucHJpbnQoIm1UYXJnZXQ9Iik7IHdyaXRlci5wcmludChtVGFyZ2V0KTsKKyAgICAgICAgICAgICAgICAgICAgd3JpdGVyLnByaW50KCIgbVRhcmdldFJlcXVlc3RDb2RlPSIpOworICAgICAgICAgICAgICAgICAgICB3cml0ZXIucHJpbnRsbihtVGFyZ2V0UmVxdWVzdENvZGUpOworICAgICAgICB9CisgICAgICAgIGlmIChtTmV4dEFuaW0gIT0gMCkgeworICAgICAgICAgICAgd3JpdGVyLnByaW50KHByZWZpeCk7IHdyaXRlci5wcmludCgibU5leHRBbmltPSIpOyB3cml0ZXIucHJpbnRsbihtTmV4dEFuaW0pOworICAgICAgICB9CisgICAgICAgIGlmIChtQ29udGFpbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIHdyaXRlci5wcmludChwcmVmaXgpOyB3cml0ZXIucHJpbnQoIm1Db250YWluZXI9Iik7IHdyaXRlci5wcmludGxuKG1Db250YWluZXIpOworICAgICAgICB9CisgICAgICAgIGlmIChtVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICB3cml0ZXIucHJpbnQocHJlZml4KTsgd3JpdGVyLnByaW50KCJtVmlldz0iKTsgd3JpdGVyLnByaW50bG4obVZpZXcpOworICAgICAgICB9CisgICAgICAgIGlmIChtTG9hZGVyTWFuYWdlciAhPSBudWxsKSB7CisgICAgICAgICAgICB3cml0ZXIucHJpbnQocHJlZml4KTsgd3JpdGVyLnByaW50KCJtTG9hZGVyTWFuYWdlcj0iKTsgd3JpdGVyLnByaW50KG1Mb2FkZXJNYW5hZ2VyKTsKKyAgICAgICAgICAgICAgICAgICAgd3JpdGVyLnByaW50KCIgbUxvYWRlcnNTdGFydGVkPSIpOyB3cml0ZXIucHJpbnQobUxvYWRlcnNTdGFydGVkKTsKKyAgICAgICAgICAgICAgICAgICAgd3JpdGVyLnByaW50KCIgbUNoZWNrZWRGb3JMb2FkZXJNYW5hZ2VyPSIpOworICAgICAgICAgICAgICAgICAgICB3cml0ZXIucHJpbnRsbihtQ2hlY2tlZEZvckxvYWRlck1hbmFnZXIp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Gl0bGUpOworICAgICAgICB9CisgICAgICAgIHVwZGF0ZUNydW1icygpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uTGF5b3V0KGJvb2xlYW4gY2hhbmdlZCwgaW50IGwsIGludCB0LCBpbnQgciwgaW50IGIpIHsKKyAgICAgICAgLy8gRXZlbnR1YWxseSB3ZSBzaG91bGQgaW1wbGVtZW50IG91ciBvd24gbGF5b3V0IG9mIHRoZSB2aWV3cywKKyAgICAgICAgLy8gcmF0aGVyIHRoYW4gcmVseWluZyBvbiBhIGxpbmVhciBsYXlvdXQuCisgICAgICAgIGZpbmFsIGludCBjaGlsZENvdW50ID0gZ2V0Q2hpbGRDb3VudCgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNoaWxkQ291bnQ7IGkrKykgeworICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IGdldENoaWxkQXQoaSk7CisKKyAgICAgICAgICAgIGludCBjaGlsZFJpZ2h0ID0gbVBhZGRpbmdMZWZ0ICsgY2hpbGQuZ2V0TWVhc3VyZWRXaWR0aCgpIC0gbVBhZGRpbmdSaWdodDsKKyAgICAgICAgICAgIGludCBjaGlsZEJvdHRvbSA9IG1QYWRkaW5nVG9wICsgY2hpbGQuZ2V0TWVhc3VyZWRIZWlnaHQoKSAtIG1QYWRkaW5nQm90dG9tOworICAgICAgICAgICAgY2hpbGQubGF5b3V0KG1QYWRkaW5nTGVmdCwgbVBhZGRpbmdUb3AsIGNoaWxkUmlnaHQsIGNoaWxkQm90dG9tKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uTWVhc3VyZShpbnQgd2lkdGhNZWFzdXJlU3BlYywgaW50IGhlaWdodE1lYXN1cmVTcGVjKSB7CisgICAgICAgIGZpbmFsIGludCBjb3VudCA9IGdldENoaWxkQ291bnQoKTsKKworICAgICAgICBpbnQgbWF4SGVpZ2h0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bihyZXNvbHZlU2l6ZShtYXhXaWR0aCwgd2lkdGhNZWFzdXJlU3BlYyksCisgICAgICAgICAgICAgICAgcmVzb2x2ZVNpemUobWF4SGVpZ2h0LCBoZWlnaHRNZWFzdXJlU3BlYykpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uQmFja1N0YWNrQ2hhbmdlZCgpIHsKKyAgICAgICAgdXBkYXRlQ3J1bWJzKCk7CisgICAgfQorCisgICAgdm9pZCB1cGRhdGVDcnVtYnMoKSB7CisgICAgICAgIEZyYWdtZW50TWFuYWdlciBmbSA9IG1BY3Rpdml0eS5nZXRGcmFnbWVudE1hbmFnZXIoKTsKKyAgICAgICAgaW50IG51bUVudHJpZXMgPSBmbS5jb3VudEJhY2tTdGFja0VudHJpZXMoKTsKKyAgICAgICAgaW50IG51bVZpZXdzID0gbUNvbnRhaW5lci5nZXRDaGlsZENvdW50KCk7CisgICAgICAgIGZvciAoaW50IGkgPSBtVG9wRW50cnkgIT0gbnVsbCA/IC0xIDogMDsgaSA8IG51bUVudHJpZXM7IGkrKykgeworICAgICAgICAgICAgQmFja1N0YWNrRW50cnkgYnNlID0gaSA9PSAtMSA/IG1Ub3BFbnRyeSA6IGZtLmdldEJhY2tTdGFja0VudHJ5KGkpOworICAgICAgICAgICAgaW50IHZpZXdJID0gbVRvcEVudHJ5ICE9IG51bGwgPyBpICsgMSA6IGk7CisgICAgICAgICAgICBpZiAodmlld0kgPCBudW1WaWV3cykgeworICAgICAgICAgICAgICAgIFZpZXcgdiA9IG1Db250YWluZXIuZ2V0Q2hpbGRBdCh2aWV3SSk7CisgICAgICAgICAgICAgICAgT2JqZWN0IHRhZyA9IHYuZ2V0VGFnKCk7CisgICAgICAgICAgICAgICAgaWYgKHRhZyAhPSBic2UpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IHZpZXdJOyBqIDwgbnVtVmlld3M7IGorKykgeworICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRhaW5lci5yZW1vdmVWaWV3QXQodmlld0kpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG51bVZpZXdzID0gdmlld0k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHZpZXdJID49IG51bVZpZXdzKSB7CisgICAgICAgICAgICAgICAgVmlldyBpdGVtID0gbUluZmxhdGVyLmluZmxhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmxheW91dC5mcmFnbWVudF9icmVhZF9jcnVtYl9pdGVtLAorICAgICAgICAgICAgICAgICAgICAgICAgdGhpcywgZmFsc2UpOworICAgICAgICAgICAgICAgIFRleHRWaWV3IHRleHQgPSAoVGV4dFZpZXcpaXRlbS5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC50aXRsZSk7CisgICAgICAgICAgICAgICAgdGV4dC5zZXRUZXh0KGJzZS5nZXRCcmVhZENydW1iVGl0bGUoKSk7CisgICAgICAgICAgICAgICAgaXRlbS5zZXRUYWcoYnNlKTsKKyAgICAgICAgICAgICAgICBpZiAodmlld0kgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICB0ZXh0LnNldENvbXBvdW5kRHJhd2FibGVzKG51bGwsIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtQ29udGFpbmVyLmFkZFZpZXcoaXRlbSk7CisgICAgICAgICAgICAgICAgaXRlbS5zZXRPbkNsaWNrTGlzdGVuZXIobU9uQ2xpY2tMaXN0ZW5lcik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaW50IHZpZXdJID0gbVRvcEVudHJ5ICE9IG51bGwgPyBudW1FbnRyaWVzICsgMSA6IG51bUVudHJpZXM7CisgICAgICAgIG51bVZpZXdzID0gbUNvbnRhaW5lci5nZXRDaGlsZENvdW50K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JhZ21lbnRNYW5hZ2VyLmdldEJhY2tTdGFja0VudHJ5KCl9LgorICAgICAqCisgICAgICogPHA+Tm90ZSB0aGF0IHlvdSBzaG91bGQgbmV2ZXIgaG9sZCBvbiB0byBhIEJhY2tTdGFja0VudHJ5IG9iamVjdDsKKyAgICAgKiB0aGUgaWRlbnRpZmllciBhcyByZXR1cm5lZCBieSB7QGxpbmsgI2dldElkfSBpcyB0aGUgb25seSB0aGluZyB0aGF0CisgICAgICogd2lsbCBiZSBwZXJzaXN0ZWQgYWNyb3NzIGFjdGl2aXR5IGluc3RhbmNlcy4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50ZXJmYWNlIEJhY2tTdGFja0VudHJ5IHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJldHVybiB0aGUgdW5pcXVlIGlkZW50aWZpZXIgZm9yIHRoZSBlbnRyeS4gIFRoaXMgaXMgdGhlIG9ubHkKKyAgICAgICAgICogcmVwcmVzZW50YXRpb24gb2YgdGhlIGVudHJ5IHRoYXQgd2lsbCBwZXJzaXN0IGFjcm9zcyBhY3Rpdml0eQorICAgICAgICAgKiBpbnN0YW5jZXMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGdldElkKCk7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJldHVybiB0aGUgZnVsbCBicmVhZCBjcnVtYiB0aXRsZSBmb3IgdGhlIGVudHJ5LCBvciBudWxsIGlmIGl0CisgICAgICAgICAqIGRvZXMgbm90IGhhdmUgb25lLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIENoYXJTZXF1ZW5jZSBnZXRCcmVhZENydW1iVGl0bGUoKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJuIHRoZSBzaG9ydCBicmVhZCBjcnVtYiB0aXRsZSBmb3IgdGhlIGVudHJ5LCBvciBudWxsIGlmIGl0CisgICAgICAgICAqIGRvZXMgbm90IGhhdmUgb25lLgorICAgICAgICAgKi8KKyAgICAgICAgc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gpOworICAgICAgICB9CisgICAgICAgIEZyYWdtZW50IGYgPSBtQWN0aXZlLmdldChpbmRleCk7CisgICAgICAgIGlmIChmID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkZyYWdlbWVudCBubyBsb25nZXIgZXhpc3RzIGZvciBrZXkgIgorICAgICAgICAgICAgICAgICAgICArIGtleSArICI6IGluZGV4ICIgKyBpbmRleCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGY7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHVtcChTdHJpbmcgcHJlZml4LCBGaWxlRGVzY3JpcHRvciBmZCwgUHJpbnRXcml0ZXIgd3JpdGVyLCBTdHJpbmdbXSBhcmdzKSB7CisgICAgICAgIGlmIChtQWN0aXZlID09IG51bGwgfHwgbUFjdGl2ZS5zaXplKCkgPD0gMCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgd3JpdGVyLnByaW50KHByZWZpeCk7IHdyaXRlci5wcmludGxuKCJBY3RpdmUgRnJhZ21lbnRzOiIpOworCisgICAgICAgIFN0cmluZyBpbm5lclByZWZpeCA9IHByZWZpeCArICIgICAgIjsKKworICAgICAgICBpbnQgTiA9IG1BY3RpdmUuc2l6ZSgpOworICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFjdGl2ZS5nZXQoaSk7CisgICAgICAgICAgICBpZiAoZiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgd3JpdGVyLnByaW50KHByZWZpeCk7IHdyaXRlci5wcmludCgiICAjIik7IHdyaXRlci5wcmludChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlci5wcmludCgiOiAiKTsgd3JpdGVyLnByaW50bG4oZi50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICBmLmR1bXAoaW5uZXJQcmVmaXgsIGZkLCB3cml0ZXIsIGFyZ3MpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKG1BZGRlZCAhPSBudWxsKSB7CisgICAgICAgICAgICBOID0gbUFkZGVkLnNpemUoKTsKKyAgICAgICAgICAgIGlmIChOID4gMCkgeworICAgICAgICAgICAgICAgIHdyaXRlci5wcmludChwcmVmaXgpOyB3cml0ZXIucHJpbnRsbigiQWRkZWQgRnJhZ21lbnRzOiIpOworICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BZGRlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgIHdyaXRlci5wcmludChwcmVmaXgpOyB3cml0ZXIucHJpbnQoIiAgIyIpOyB3cml0ZXIucHJpbnQoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVyLnByaW50KCI6ICIpOyB3cml0ZXIucHJpbnRsbihmLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQmFja1N0YWNrICE9IG51bGwpIHsKKyAgICAgICAgICAgIE4gPSBtQmFja1N0YWNrLnNpemUoKTsKKyAgICAgICAgICAgIGlmIChOID4gMCkgeworICAgICAgICAgICAgICAgIHdyaXRlci5wcmludChwcmVmaXgpOyB3cml0ZXIucHJpbnRsbigiQmFjayBTdGFjazoiKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIEJhY2tTdGFja1JlY29yZCBicyA9IG1CYWNrU3RhY2suZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICB3cml0ZXIucHJpbnQocHJlZml4KTsgd3JpdGVyLnByaW50KCIgICMiKTsgd3JpdGVyLnByaW50KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlci5wcmludCgiOiAiKTsgd3JpdGVyLnByaW50bG4oYnMudG9TdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgQW5pbWF0b3IgbG9hZEFuaW1hdG9yKEZyYWdtZW50IGZyYWdtZW50LCBpbnQgdHJhbnNpdCwgYm9vbGVhbiBlbnRlciwKKyAgICAgICAgICAgIGludCB0cmFuc2l0aW9uU3R5bGUpIHsKKyAgICAgICAgQW5pbWF0b3IgYW5pbU9iaiA9IGZyYWdtZW50Lm9uQ3JlYXRlQW5pbWF0b3IodHJhbnNpdCwgZW50ZXIsCisgICAgICAgICAgICAgICAgZnJhZ21lbnQubU5leHRBbmltKTsKKyAgICAgICAgaWYgKGFuaW1PYmogIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIGFuaW1PYmo7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChmcmFnbWVudC5tTmV4dEFuaW0gIT0gMCkgeworICAgICAgICAgICAgQW5pbWF0b3IgYW5pbSA9IEFuaW1hdG9ySW5mbGF0ZXIubG9hZEFuaW1hdG9yKG1BY3Rpdml0eSwgZnJhZ21lbnQubU5leHRBbmltKTsKKyAgICAgICAgICAgIGlmIChhbmltICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gYW5pbTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKHRyYW5zaXQgPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGludCBzdHlsZUluZGV4ID0gdHJhbnNpdFRvU3R5bGVJbmRleCh0cmFuc2l0LCBlbnRlcik7CisgICAgICAgIGlmIChzdHlsZUluZGV4IDwgMCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmICh0cmFuc2l0aW9uU3R5bGUgPT0gMCAmJiBtQWN0aXZpdHkuZ2V0V2luZG93KCkgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJhbnNpdGlvblN0eWxlID0gbUFjdGl2aXR5LmdldFdpbmRvdygpLmdldEF0dHJpYnV0ZXMoKS53aW5kb3dBbmltYXRpb25zOworICAgICAgICB9CisgICAgICAgIGlmICh0cmFuc2l0aW9uU3R5bGUgPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIFR5cGVkQXJyYXkgYXR0cnMgPSBtQWN0aXZpdHkub2J0YWluU3R5bGVkQXR0cmlidXRlcyh0cmFuc2l0aW9uU3R5bGUsCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuRnJhZ21lbnRBbmltYXRpb24pOworICAgICAgICBpbnQgYW5pbSA9IGF0dHJzLmdldFJlc291cmNlSWQoc3R5bGVJbmRleCwgMCk7CisgICAgICAgIGF0dHJzLnJlY3ljbGUoKTsKKyAgICAgICAgCisgICAgICAgIGlmIChhbmltID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICByZXR1cm4gQW5pbWF0b3JJbmZsYXRlci5sb2FkQW5pbWF0b3IobUFjdGl2aXR5LCBhbmltKTsKKyAgICB9CisgICAgCisgICAgdm9pZCBtb3ZlVG9TdGF0ZShGcmFnbWVudCBmLCBpbnQgbmV3U3RhdGUsIGludCB0cmFuc2l0LCBpbnQgdHJhbnNpdGlvblN0eWxlKSB7CisgICAgICAgIC8vIEZyYWdtZW50cyB0aGF0IGFyZSBub3QgY3VycmVudGx5IGFkZGVkIHdpbGwgc2l0IGluIHRoZSBvbkNyZWF0ZSgpIHN0YXRlLgorICAgICAgICBpZiAoIWYubUFkZGVkICYmIG5ld1N0YXRlID4gRnJhZ21lbnQuQ1JFQVRFRCkgeworICAgICAgICAgICAgbmV3U3RhdGUgPSBGcmFnbWVudC5DUkVBVEVEOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoZi5tU3RhdGUgPCBuZXdTdGF0ZSkgeworICAgICAgICAgICAgc3dpdGNoIChmLm1TdGF0ZSkgeworICAgICAgICAgICAgICAgIGNhc2UgRnJhZ21lbnQuSU5JVElBTElaSU5HOgorICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm1vdmV0byBDUkVBVEVEOiAiICsgZik7CisgICAgICAgICAgICAgICAgICAgIGlmIChmLm1TYXZlZEZyYWdtZW50U3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tU2F2ZWRWaWV3U3RhdGUgPSBmLm1TYXZlZEZyYWdtZW50U3RhdGUuZ2V0U3BhcnNlUGFyY2VsYWJsZUFycmF5KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXJJbXBsLlZJRVdfU1RBVEVfVEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubVRhcmdldCA9IGdldEZyYWdtZW50KGYubVNhdmVkRnJhZ21lbnRTdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnRNYW5hZ2VySW1wbC5UQVJHRVRfU1RBVEVfVEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLm1UYXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubVRhcmdldFJlcXVlc3RDb2RlID0gZi5tU2F2ZWRGcmFnbWVudFN0YXRlLmdldEludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50TWFuYWdlckltcGwuVEFSR0VUX1JFUVVFU1RfQ09ERV9TVEFURV9UQUcsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubUFjdGl2aXR5ID0gbUFjdGl2aXR5OworICAgICAgICAgICAgICAgICAgICBmLm1DYWxsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZi5vbkF0dGFjaChtQWN0aXZpdHkpOworICAgICAgICAgICAgICAgICAgICBpZiAoIWYubUNhbGxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25BdHRhY2goKSIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1BY3Rpdml0eS5vbkF0dGFjaEZyYWdtZW50KGYpOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1SZXRhaW5pbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5vbkNyZWF0ZShmLm1TYXZlZEZyYWdtZW50U3RhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU3VwZXJOb3RDYWxsZWRFeGNlcHRpb24oIkZyYWdtZW50ICIgKyBmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25DcmVhdGUoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubVJldGFpbmluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBpZiAoZi5tRnJvbUxheW91dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gRm9yIGZyYWdtZW50cyB0aGF0IGFyZSBwYXJ0IG9mIHRoZSBjb250ZW50IHZpZXcKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxheW91dCwgd2UgbmVlZCB0byBpbnN0YW50aWF0ZSB0aGUgdmlldyBpbW1lZGlhdGVseQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIHRoZSBpbmZsYXRlciB3aWxsIHRha2UgY2FyZSBvZiBhZGRpbmcgaXQuCisgICAgICAgICAgICAgICAgICAgICAgICBmLm1WaWV3ID0gZi5vbkNyZWF0ZVZpZXcobUFjdGl2aXR5LmdldExheW91dEluZmxhdGVyKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIGYubVNhdmVkRnJhZ21lbnRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5tVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5tVmlldy5zZXRTYXZlRnJvbVBhcmVudEVuYWJsZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYucmVzdG9yZVZpZXdTdGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLm1IaWRkZW4pIGYubVZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOyAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgRnJhZ21lbnQuQ1JFQVRFRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlID4gRnJhZ21lbnQuQ1JFQVRFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZldG8gQ09OVEVOVDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1Gcm9tTGF5b3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwIGNvbnRhaW5lciA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubUNvbnRhaW5lcklkICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyID0gKFZpZXdHcm91cCltQWN0aXZpdHkuZmluZFZpZXdCeUlkKGYubUNvbnRhaW5lcklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5lciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJObyB2aWV3IGZvdW5kIGZvciBpZCAweCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGYubUNvbnRhaW5lcklkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZm9yIGZyYWdtZW50ICIgKyBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmLm1Db250YWluZXIgPSBjb250YWluZXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5tVmlldyA9IGYub25DcmVhdGVWaWV3KG1BY3Rpdml0eS5nZXRMYXlvdXRJbmZsYXRlcigpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyLCBmLm1TYXZlZEZyYWdtZW50U3RhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLm1WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5tVmlldy5zZXRTYXZlRnJvbVBhcmVudEVuYWJsZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29udGFpbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFuaW1hdG9yIGFuaW0gPSBsb2FkQW5pbWF0b3IoZiwgdHJhbnNpdCwgdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmltICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltLnNldFRhcmdldChmLm1WaWV3KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltLnN0YXJ0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250YWluZXIuYWRkVmlldyhmLm1WaWV3KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYucmVzdG9yZVZpZXdTdGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLm1IaWRkZW4pIGYubVZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5vbkFjdGl2aXR5Q3JlYXRlZChmLm1TYXZlZEZyYWdtZW50U3RhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU3VwZXJOb3RDYWxsZWRFeGNlcHRpb24oIkZyYWdtZW50ICIgKyBmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25SZWFkeSgpIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1TYXZlZEZyYWdtZW50U3RhdGUgPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSBGcmFnbWVudC5BQ1RJVklUWV9DUkVBVEVEOgorICAgICAgICAgICAgICAgICAgICBpZiAobmV3U3RhdGUgPiBGcmFnbWVudC5BQ1RJVklUWV9DUkVBVEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm1vdmV0byBTVEFSVEVEOiAiICsgZik7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1DYWxsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYub25TdGFydCgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU3VwZXJOb3RDYWxsZWRFeGNlcHRpb24oIkZyYWdtZW50ICIgKyBmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25TdGFydCgpIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIEZyYWdtZW50LlNUQVJURUQ6CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA+IEZyYWdtZW50LlNUQVJURUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAibW92ZXRvIFJFU1VNRUQ6ICIgKyBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5tUmVzdW1lZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm9uUmVzdW1lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWYubUNhbGxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkaWQgbm90IGNhbGwgdGhyb3VnaCB0byBzdXBlci5vblJlc3VtZSgpIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChmLm1TdGF0ZSA+IG5ld1N0YXRlKSB7CisgICAgICAgICAgICBzd2l0Y2ggKGYubVN0YXRlKSB7CisgICAgICAgICAgICAgICAgY2FzZSBGcmFnbWVudC5SRVNVTUVEOgorICAgICAgICAgICAgICAgICAgICBpZiAobmV3U3RhdGUgPCBGcmFnbWVudC5SRVNVTUVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm1vdmVmcm9tIFJFU1VNRUQ6ICIgKyBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5vblBhdXNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWYubUNhbGxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkaWQgbm90IGNhbGwgdGhyb3VnaCB0byBzdXBlci5vblBhdXNlKCkiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGYubVJlc3VtZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgRnJhZ21lbnQuU1RBUlRFRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlIDwgRnJhZ21lbnQuU1RBUlRFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZlZnJvbSBTVEFSVEVEOiAiICsgZik7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1DYWxsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYucGVyZm9ybVN0b3AoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uU3RvcCgpIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIEZyYWdtZW50LkFDVElWSVRZX0NSRUFURUQ6CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA8IEZyYWdtZW50LkFDVElWSVRZX0NSRUFURUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAibW92ZWZyb20gQ09OVEVOVDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5lZWQgdG8gc2F2ZSB0aGUgY3VycmVudCB2aWV3IHN0YXRlIGlmIG5vdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvbmUgYWxyZWFkeS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1BY3Rpdml0eS5pc0ZpbmlzaGluZygpICYmIGYubVNhdmVkVmlld1N0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZyYWdtZW50Vmlld1N0YXRlKGYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5vbkRlc3Ryb3lWaWV3KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWYubUNhbGxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkaWQgbm90IGNhbGwgdGhyb3VnaCB0byBzdXBlci5vbkRlc3Ryb3llZFZpZXcoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubVZpZXcgIT0gbnVsbCAmJiBmLm1Db250YWluZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFuaW1hdG9yIGFuaW0gPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQ3VyU3RhdGUgPiBGcmFnbWVudC5JTklUSUFMSVpJTkcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbSA9IGxvYWRBbmltYXRvcihmLCB0cmFuc2l0LCBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFZpZXdHcm91cCBjb250YWluZXIgPSBmLm1Db250YWluZXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFZpZXcgdmlldyA9IGYubVZpZXc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5zdGFydFZpZXdUcmFuc2l0aW9uKHZpZXcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltLmFkZExpc3RlbmVyKG5ldyBBbmltYXRvckxpc3RlbmVyQWRhcHRlcigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25BbmltYXRpb25FbmQoQW5pbWF0b3IgYW5pbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5lbmRWaWV3VHJhbnNpdGlvbih2aWV3KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0VGFyZ2V0KGYubVZpZXcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltLnN0YXJ0KCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ29udGFpbmVyLnJlbW92ZVZpZXcoZi5tVmlldyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1Db250YWluZXIgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgZi5tVmlldyA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIEZyYWdtZW50LkNSRUFURUQ6CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA8IEZyYWdtZW50LkNSRUFURUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAibW92ZWZyb20gQ1JFQVRFRDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1SZXRhaW5pbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmLm1DYWxsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmLm9uRGVzdHJveSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25EZXN0cm95KCkiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5vbkRldGFjaCgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU3VwZXJOb3RDYWxsZWRFeGNlcHRpb24oIkZyYWdtZW50ICIgKyBmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25EZXRhY2goKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZi5tSW1tZWRpYXRlQWN0aXZpdHkgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQWN0aXZpdHkgPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGYubVN0YXRlID0gbmV3U3RhdGU7CisgICAgfQorICAgIAorICAgIHZvaWQgbW92ZVRvU3RhdGUoRnJhZ21lbnQgZikgeworICAgICAgICBtb3ZlVG9TdGF0ZShmLCBtQ3VyU3RhdGUsIDAsIDApOworICAgIH0KKworICAgIHZvaWQgbW92ZVRvU3RhdGUoaW50IG5ld1N0YXRlLCBib29sZWFuIGFsd2F5cykgeworICAgICAgICBtb3ZlVG9TdGF0ZShuZXdTdGF0ZSwgMCwgMCwgYWx3YXlzKTsKKyAgICB9CisgICAgCisgICAgdm9pZCBtb3ZlVG9TdGF0ZShpbnQgbmV3U3RhdGUsIGludCB0cmFuc2l0LCBpbnQgdHJhbnNpdFN0eWxlLCBib29sZWFuIGFsd2F5cykgeworICAgICAgICBpZiAobUFjdGl2aXR5ID09IG51bGwgJiYgbmV3U3RhdGUgIT0gRnJhZ21lbnQuSU5JVElBTElaSU5HKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJObyBhY3Rpdml0eSIpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoIWFsd2F5cyAmJiBtQ3VyU3RhdGUgPT0gbmV3U3RhdGUpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgbUN1clN0YXRlID0gbmV3U3RhdGU7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtQWN0aXZlLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BY3RpdmUuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbW92ZVRvU3RhdGUoZiwgbmV3U3RhdGUsIHRyYW5zaXQsIHRyYW5zaXRTdHlsZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobU5lZWRNZW51SW52YWxpZGF0ZSAmJiBtQWN0aXZpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1BY3Rpdml0eS5pbnZhbGlkYXRlT3B0aW9uc01lbnUoKTsKKyAgICAgICAgICAgICAgICBtTmVlZE1lbnVJbnZhbGlkYXRlID0gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgdm9pZCBtYWtlQWN0aXZlKEZyYWdtZW50IGYpIHsKKyAgICAgICAgaWYgKGYubUluZGV4ID49IDApIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKG1BdmFpbEluZGljZXMgPT0gbnVsbCB8fCBtQXZhaWxJbmRpY2VzLnNpemUoKSA8PSAwKSB7CisgICAgICAgICAgICBpZiAobUFjdGl2ZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUFjdGl2ZSA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmLnNldEluZGV4KG1BY3RpdmUuc2l6ZSgpKTsKKyAgICAgICAgICAgIG1BY3RpdmUuYWRkKGYpOworICAgICAgICAgICAgCisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmLnNldEluZGV4KG1BdmFpbEluZGljZXMucmVtb3ZlKG1BdmFpbEluZGljZXMuc2l6ZSgpLTEpKTsKKyAgICAgICAgICAgIG1BY3RpdmUuc2V0KGYubUluZGV4LCBmKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIG1ha2VJbmFjdGl2ZShGcmFnbWVudCBmKSB7CisgICAgICAgIGlmIChmLm1JbmRleCA8IDApIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJGcmVlaW5nIGZyYWdtZW50IGluZGV4ICIgKyBmLm1JbmRleCk7CisgICAgICAgIG1BY3RpdmUuc2V0KGYubUluZGV4LCBudWxsKTsKKyAgICAgICAgaWYgKG1BdmFpbEluZGljZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgbUF2YWlsSW5kaWNlcyA9IG5ldyBBcnJheUxpc3Q8SW50ZWdlcj4oKTsKKyAgICAgICAgfQorICAgICAgICBtQXZhaWxJbmRpY2VzLmFkZChmLm1JbmRleCk7CisgICAgICAgIG1BY3Rpdml0eS5pbnZhbGlkYXRlRnJhZ21lbnRJbmRleChmLm1JbmRleCk7CisgICAgICAgIGYuY2xlYXJJbmRleCgpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBhZGRGcmFnbWVudChGcmFnbWVudCBmcmFnbWVudCwgYm9vbGVhbiBtb3ZlVG9TdGF0ZU5vdykgeworICAgICAgICBpZiAobUFkZGVkID09IG51bGwpIHsKKyAgICAgICAgICAgIG1BZGRlZCA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KCk7CisgICAgICAgIH0KKyAgICAgICAgbUFkZGVkLmFkZChmcmFnbWVudCk7CisgICAgICAgIG1ha2VBY3RpdmUoZnJhZ21lbnQpOworICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgImFkZDogIiArIGZyYWdtZW50KTsKKyAgICAgICAgZnJhZ21lbnQubUFkZGVkID0gdHJ1ZTsKKyAgICAgICAgaWYgKGZyYWdtZW50Lm1IYXNNZW51KSB7CisgICAgICAgICAgICBtTmVlZE1lbnVJbnZhbGlkYXRlID0gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBpZiAobW92ZVRvU3RhdGVOb3cpIHsKKyAgICAgICAgICAgIG1vdmVUb1N0YXRlKGZyYWdtZW50KTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCByZW1vdmVGcmFnbWVudChGcmFnbWVudCBmcmFnbWVudCwgaW50IHRyYW5zaXRpb24sIGludCB0cmFuc2l0aW9uU3R5bGUpIHsKKyAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJyZW1vdmU6ICIgKyBmcmFnbWVudCArICIgbmVzdGluZz0iICsgZnJhZ21lbnQubUJhY2tTdGFja05lc3RpbmcpOworICAgICAgICBtQWRkZWQucmVtb3ZlKGZyYWdtZW50KTsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBpbmFjdGl2ZSA9IGZyYWdtZW50Lm1CYWNrU3RhY2tOZXN0aW5nIDw9IDA7CisgICAgICAgIGlmIChmcmFnbWVudC5tSGFzTWVudSkgeworICAgICAgICAgICAgbU5lZWRNZW51SW52YWxpZGF0ZSA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgZnJhZ21lbnQubUFkZGVkID0gZmFsc2U7CisgICAgICAgIG1vdmVUb1N0YXRlKGZyYWdtZW50LCBpbmFjdGl2ZSA/IEZyYWdtZW50LklOSVRJQUxJWklORyA6IEZyYWdtZW50LkNSRUFURUQsCisgICAgICAgICAgICAgICAgdHJhbnNpdGlvbiwgdHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgaWYgKGluYWN0aXZlKSB7CisgICAgICAgICAgICBtYWtlSW5hY3RpdmUoZnJhZ21lbnQpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGhpZGVGcmFnbWVudChGcmFnbWVudCBmcmFnbWVudCwgaW50IHRyYW5zaXRpb24sIGludCB0cmFuc2l0aW9uU3R5bGUpIHsKKyAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJoaWRlOiAiICsgZnJhZ21lbnQpOworICAgICAgICBpZiAoIWZyYWdtZW50Lm1IaWRkZW4pIHsKKyAgICAgICAgICAgIGZyYWdtZW50Lm1IaWRkZW4gPSB0cnVlOworICAgICAgICAgICAgaWYgKGZyYWdtZW50Lm1WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBbmltYXRvciBhbmltID0gbG9hZEFuaW1hdG9yKGZyYWdtZW50LCB0cmFuc2l0aW9uLCB0cnVlLAorICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICBpZiAoYW5pbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGFuaW0uc2V0VGFyZ2V0KGZyYWdtZW50Lm1WaWV3KTsKKyAgICAgICAgICAgICAgICAgICAgYW5pbS5zdGFydCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmcmFnbWVudC5tVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZnJhZ21lbnQubUFkZGVkICYmIGZyYWdtZW50Lm1IYXNNZW51KSB7CisgICAgICAgICAgICAgICAgbU5lZWRNZW51SW52YWxpZGF0ZSA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcmFnbWVudC5vbkhpZGRlbkNoYW5nZWQodHJ1ZSk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgc2hvd0ZyYWdtZW50KEZyYWdtZW50IGZyYWdtZW50LCBpbnQgdHJhbnNpdGlvbiwgaW50IHRyYW5zaXRpb25TdHlsZSkgeworICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgInNob3c6ICIgKyBmcmFnbWVudCk7CisgICAgICAgIGlmIChmcmFnbWVudC5tSGlkZGVuKSB7CisgICAgICAgICAgICBmcmFnbWVudC5tSGlkZGVuID0gZmFsc2U7CisgICAgICAgICAgICBpZiAoZnJhZ21lbnQubVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFuaW1hdG9yIGFuaW0gPSBsb2FkQW5pbWF0b3IoZnJhZ21lbnQsIHRyYW5zaXRpb24sIHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIGlmIChhbmltICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYW5pbS5zZXRUYXJnZXQoZnJhZ21lbnQubVZpZXcpOworICAgICAgICAgICAgICAgICAgICBhbmltLnN0YXJ0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZyYWdtZW50Lm1WaWV3LnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChmcmFnbWVudC5tQWRkZWQgJiYgZnJhZ21lbnQubUhhc01lbnUpIHsKKyAgICAgICAgICAgICAgICBtTmVlZE1lbnVJbnZhbGlkYXRlID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZyYWdtZW50Lm9uSGlkZGVuQ2hhbmdlZChmYWxzZSk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIEZyYWdtZW50IGZpbmRGcmFnbWVudEJ5SWQoaW50IGlkKSB7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwpIHsKKyAgICAgICAgICAgIC8vIEZpcnN0IGxvb2sgdGhyb3VnaCBhZGRlZCBmcmFnbWVudHMuCisgICAgICAgICAgICBmb3IgKGludCBpPW1BZGRlZC5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BZGRlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiBmLm1GcmFnbWVudElkID09IGlkKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIE5vdyBmb3IgYW55IGtub3duIGZyYWdtZW50LgorICAgICAgICAgICAgZm9yIChpbnQgaT1tQWN0aXZlLnNpemUoKS0xOyBpPj0wOyBpLS0pIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFjdGl2ZS5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiBmLm1GcmFnbWVudElkID09IGlkKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisgICAgCisgICAgcHVibGljIEZyYWdtZW50IGZpbmRGcmFnbWVudEJ5VGFnKFN0cmluZyB0YWcpIHsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCAmJiB0YWcgIT0gbnVsbCkgeworICAgICAgICAgICAgLy8gRmlyc3QgbG9vayB0aHJvdWdoIGFkZGVkIGZyYWdtZW50cy4KKyAgICAgICAgICAgIGZvciAoaW50IGk9bUFkZGVkLnNpemUoKS0xOyBpPj0wOyBpLS0pIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFkZGVkLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoZiAhPSBudWxsICYmIHRhZy5lcXVhbHMoZi5tVGFnKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBOb3cgZm9yIGFueSBrbm93biBmcmFnbWVudC4KKyAgICAgICAgICAgIGZvciAoaW50IGk9bUFjdGl2ZS5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BY3RpdmUuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgdGFnLmVxdWFscyhmLm1UYWcpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisgICAgCisgICAgcHVibGljIEZyYWdtZW50IGZpbmRGcmFnbWVudEJ5V2hvKFN0cmluZyB3aG8pIHsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCAmJiB3aG8gIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT1tQWN0aXZlLnNpemUoKS0xOyBpPj0wOyBpLS0pIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFjdGl2ZS5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiB3aG8uZXF1YWxzKGYubVdobykpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGY7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBlbnF1ZXVlQWN0aW9uKFJ1bm5hYmxlIGFjdGlvbikgeworICAgICAgICBpZiAobVN0YXRlU2F2ZWQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJDYW4gbm90IHBlcmZvcm0gdGhpcyBhY3Rpb24gYWZ0ZXIgb25TYXZlSW5zdGFuY2VTdGF0ZSIpOworICAgICAgICB9CisgICAgICAgIGlmIChtTm9UcmFuc2FjdGlvbnNCZWNhdXNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJDYW4gbm90IHBlcmZvcm0gdGhpcyBhY3Rpb24gaW5zaWRlIG9mICIgKyBtTm9UcmFuc2FjdGlvbnNCZWNhdXNlKTsKKyAgICAgICAgfQorICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmIChtUGVuZGluZ0FjdGlvbnMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1QZW5kaW5nQWN0aW9ucyA9IG5ldyBBcnJheUxpc3Q8UnVubmFibGU+KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtUGVuZGluZ0FjdGlvbnMuYWRkKGFjdGlvbik7CisgICAgICAgICAgICBpZiAobVBlbmRpbmdBY3Rpb25zLnNpemUoKSA9PSAxKSB7CisgICAgICAgICAgICAgICAgbUFjdGl2aXR5Lm1IYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtRXhlY0NvbW1pdCk7CisgICAgICAgICAgICAgICAgbUFjdGl2aXR5Lm1IYW5kbGVyLnBvc3QobUV4ZWNDb21taXQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyBpbnQgYWxsb2NCYWNrU3RhY2tJbmRleChCYWNrU3RhY2tSZWNvcmQgYnNlKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaWYgKG1BdmFpbEJhY2tTdGFja0luZGljZXMgPT0gbnVsbCB8fCBtQXZhaWxCYWNrU3RhY2tJbmRpY2VzLnNpemUoKSA8PSAwKSB7CisgICAgICAgICAgICAgICAgaWYgKG1CYWNrU3RhY2tJbmRpY2VzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUJhY2tTdGFja0luZGljZXMgPSBuZXcgQXJyYXlMaXN0PEJhY2tTdGFja1JlY29yZD4oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW50IGluZGV4ID0gbUJhY2tTdGFja0luZGljZXMuc2l6ZSgpOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiU2V0dGluZyBiYWNrIHN0YWNrIGluZGV4ICIgKyBpbmRleCArICIgdG8gIiArIGJzZSk7CisgICAgICAgICAgICAgICAgbUJhY2tTdGFja0luZGljZXMuYWRkKGJzZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGluZGV4OworCisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludCBpbmRleCA9IG1BdmFpbEJhY2tTdGFja0luZGljZXMucmVtb3ZlKG1BdmFpbEJhY2tTdGFja0luZGljZXMuc2l6ZSgpLTEpOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiQWRkaW5nIGJhY2sgc3RhY2sgaW5kZXggIiArIGluZGV4ICsgIiB3aXRoICIgKyBic2UpOworICAgICAgICAgICAgICAgIG1CYWNrU3RhY2tJbmRpY2VzLnNldChpbmRleCwgYnNlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gaW5kZXg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRCYWNrU3RhY2tJbmRleChpbnQgaW5kZXgsIEJhY2tTdGFja1JlY29yZCBic2UpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAobUJhY2tTdGFja0luZGljZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1CYWNrU3RhY2tJbmRpY2VzID0gbmV3IEFycmF5TGlzdDxCYWNrU3RhY2tSZWNvcmQ+KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQgTiA9IG1CYWNrU3RhY2tJbmRpY2VzLnNpemUoKTsKKyAgICAgICAgICAgIGlmIChpbmRleCA8IE4pIHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIlNldHRpbmcgYmFjayBzdGFjayBpbmRleCAiICsgaW5kZXggKyAiIHRvICIgKyBic2UpOworICAgICAgICAgICAgICAgIG1CYWNrU3RhY2tJbmRpY2VzLnNldChpbmRleCwgYnNlKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgd2hpbGUgKE4gPCBpbmRleCkgeworICAgICAgICAgICAgICAgICAgICBtQmFja1N0YWNrSW5kaWNlcy5hZGQobnVsbCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQXZhaWxCYWNrU3RhY2tJbmRpY2VzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BdmFpbEJhY2tTdGFja0luZGljZXMgPSBuZXcgQXJyYXlMaXN0PEludGVnZXI+KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJBZGRpbmcgYXZhaWxhYmxlIGJhY2sgc3RhY2sgaW5kZXggIiArIE4pOworICAgICAgICAgICAgICAgICAgICBtQXZhaWxCYWNrU3RhY2tJbmRpY2VzLmFkZChOKTsKKyAgICAgICAgICAgICAgICAgICAgTisrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIkFkZGluZyBiYWNrIHN0YWNrIGluZGV4ICIgKyBpbmRleCArICIgd2l0aCAiICsgYnNlKTsKKyAgICAgICAgICAgICAgICBtQmFja1N0YWNrSW5kaWNlcy5hZGQoYnNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGZyZWVCYWNrU3RhY2tJbmRleChpbnQgaW5kZXgpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBtQmFja1N0YWNrSW5kaWNlcy5zZXQoaW5kZXgsIG51bGwpOworICAgICAgICAgICAgaWYgKG1BdmFpbEJhY2tTdGFja0luZGljZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1BdmFpbEJhY2tTdGFja0luZGljZXMgPSBuZXcgQXJyYXlMaXN0PEludGVnZXI+KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIkZyZWVpbmcgYmFjayBzdGFjayBpbmRleCAiICsgaW5kZXgpOworICAgICAgICAgICAgbUF2YWlsQmFja1N0YWNrSW5kaWNlcy5hZGQoaW5kZXgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogT25seSBjYWxsIGZyb20gbWFpbiB0aHJlYWQhCisgICAgICovCisgICAgcHVibGljIHZvaWQgZXhlY1BlbmRpbmdBY3Rpb25zKCkgeworICAgICAgICBpZiAobUV4ZWN1dGluZ0FjdGlvbnMpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIlJlY3Vyc2l2ZSBlbnRyeSB0byBleGVjUGVuZGluZ0FjdGlvbnMiKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgIGludCBudW1BY3Rpb25zOworICAgICAgICAgICAgCisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgICAgICBpZiAobVBlbmRpbmdBY3Rpb25zID09IG51bGwgfHwgbVBlbmRpbmdBY3Rpb25zLnNpemUoKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgbnVtQWN0aW9ucyA9IG1QZW5kaW5nQWN0aW9ucy5zaXplKCk7CisgICAgICAgICAgICAgICAgaWYgKG1UbXBBY3Rpb25zID09IG51bGwgfHwgbVRtcEFjdGlvbnMubGVuZ3RoIDwgbnVtQWN0aW9ucykgeworICAgICAgICAgICAgICAgICAgICBtVG1wQWN0aW9ucyA9IG5ldyBSdW5uYWJsZVtudW1BY3Rpb25zXTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVBlbmRpbmdBY3Rpb25zLnRvQXJyYXkobVRtcEFjdGlvbnMpOworICAgICAgICAgICAgICAgIG1QZW5kaW5nQWN0aW9ucy5jbGVhcigpOworICAgICAgICAgICAgICAgIG1BY3Rpdml0eS5tSGFuZGxlci5yZW1vdmVDYWxsYmFja3MobUV4ZWNDb21taXQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBtRXhlY3V0aW5nQWN0aW9ucyA9IHRydWU7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bnVtQWN0aW9uczsgaSsrKSB7CisgICAgICAgICAgICAgICAgbVRtcEFjdGlvbnNbaV0ucnVuKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRXhlY3V0aW5nQWN0aW9ucyA9IGZhbHNlOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHZvaWQgcmVwb3J0QmFja1N0YWNrQ2hhbmdlZCgpIHsKKyAgICAgICAgaWYgKG1CYWNrU3RhY2tDaGFuZ2VMaXN0ZW5lcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1CYWNrU3RhY2tDaGFuZ2VMaXN0ZW5lcnMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBtQmFja1N0YWNrQ2hhbmdlTGlzdGVuZXJzLmdldChpKS5vbkJhY2tTdGFja0NoYW5nZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHZvaWQgYWRkQmFja1N0YWNrU3RhdGUoQmFja1N0YWNrUmVjb3JkIHN0YXRlKSB7CisgICAgICAgIGlmIChtQmFja1N0YWNrID09IG51bGwpIHsKKyAgICAgICAgICAgIG1CYWNrU3RhY2sgPSBuZXcgQXJyYXlMaXN0PEJhY2tTdGFja1JlY29yZD4oKTsKKyAgICAgICAgfQorICAgICAgICBtQmFja1N0YWNrLmFkZChzdGF0ZSk7CisgICAgICAgIHJlcG9ydEJhY2tTdGFja0NoYW5nZWQoKTsKKyAgICB9CisgICAgCisgICAgYm9vbGVhbiBwb3BCYWNrU3RhY2tTdGF0ZShIYW5kbGVyIGhhbmRsZXIsIFN0cmluZyBuYW1lLCBpbnQgaWQsIGludCBmbGFncykgeworICAgICAgICBpZiAobUJhY2tTdGFjayA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG5hbWUgPT0gbnVsbCAmJiBpZCA8IDAgJiYgKGZsYWdzJkFjdGl2aXR5LlBPUF9CQUNLX1NUQUNLX0lOQ0xVU0lWRSkgPT0gMCkgeworICAgICAgICAgICAgaW50IGxhc3QgPSBtQmFja1N0YWNrLnNpemUoKS0xOworICAgICAgICAgICAgaWYgKGxhc3QgPCAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmluYWwgQmFja1N0YWNrUmVjb3JkIGJzcyA9IG1CYWNrU3RhY2sucmVtb3ZlKGxhc3QpOworICAgICAgICAgICAgZW5xdWV1ZUFjdGlvbihuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIlBvcHBpbmcgYmFjayBzdGFjayBzdGF0ZTogIiArIGJzcyk7CisgICAgICAgICAgICAgICAgICAgIGJzcy5wb3BGcm9tQmFja1N0YWNrKHRydWUpOworICAgICAgICAgICAgICAgICAgICByZXBvcnRCYWNrU3RhY2tDaGFuZ2VkKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQgaW5kZXggPSAtMTsKKyAgICAgICAgICAgIGlmIChuYW1lICE9IG51bGwgfHwgaWQgPj0gMCkgeworICAgICAgICAgICAgICAgIC8vIElmIGEgbmFtZSBvciBJRCBpcyBzcGVjaWZpZWQsIGxvb2sgZm9yIHRoYXQgcGxhY2UgaW4KKyAgICAgICAgICAgICAgICAvLyB0aGUgc3RhY2suCisgICAgICAgICAgICAgICAgaW5kZXggPSBtQmFja1N0YWNrLnNpemUoKS0xOworICAgICAgICAgICAgICAgIHdoaWxlIChpbmRleCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIEJhY2tTdGFja1JlY29yZCBic3MgPSBtQmFja1N0YWNrLmdldChpbmRleCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChuYW1lICE9IG51bGwgJiYgbmFtZS5lcXVhbHMoYnNzLmdldE5hbWUoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChpZCA+PSAwICYmIGlkID09IGJzcy5tSW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGluZGV4LS07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChpbmRleCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoKGZsYWdzJkFjdGl2aXR5LlBPUF9CQUNLX1NUQUNLX0lOQ0xVU0lWRSkgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBpbmRleC0tOworICAgICAgICAgICAgICAgICAgICAvLyBDb25zdW1lIGFsbCBmb2xsb3dpbmcgZW50cmllcyB0aGF0IG1hdGNoLgorICAgICAgICAgICAgICAgICAgICB3aGlsZSAoaW5kZXggPj0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgQmFja1N0YWNrUmVjb3JkIGJzcyA9IG1CYWNrU3RhY2suZ2V0KGluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobmFtZSAhPSBudWxsICYmIG5hbWUuZXF1YWxzKGJzcy5nZXROYW1lKCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoaWQgPj0gMCAmJiBpZCA9PSBic3MubUluZGV4KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4LS07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChpbmRleCA9PSBtQmFja1N0YWNrLnNpemUoKS0xKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmluYWwgQXJyYXlMaXN0PEJhY2tTdGFja1JlY29yZD4gc3RhdGVzCisgICAgICAgICAgICAgICAgICAgID0gbmV3IEFycmF5TGlzdDxCYWNrU3RhY2tSZWNvcmQ+KCk7CisgICAgICAgICAgICBmb3IgKGludCBpPW1CYWNrU3RhY2suc2l6ZSgpLTE7IGk+aW5kZXg7IGktLSkgeworICAgICAgICAgICAgICAgIHN0YXRlcy5hZGQobUJhY2tTdGFjay5yZW1vdmUoaSkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZW5xdWV1ZUFjdGlvbihuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgTEFTVCA9IHN0YXRlcy5zaXplKCktMTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPD1MQVNUOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiUG9wcGluZyBiYWNrIHN0YWNrIHN0YXRlOiAiICsgc3RhdGVzLmdldChpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZXMuZ2V0KGkpLnBvcEZyb21CYWNrU3RhY2soaSA9PSBMQVNUKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXBvcnRCYWNrU3RhY2tDaGFuZ2VkKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICAgIAorICAgIEFycmF5TGlzdDxGcmFnbWVudD4gcmV0YWluTm9uQ29uZmlnKCkgeworICAgICAgICBBcnJheUxpc3Q8RnJhZ21lbnQ+IGZyYWdtZW50cyA9IG51bGw7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtQWN0aXZlLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BY3RpdmUuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgZi5tUmV0YWluSW5zdGFuY2UpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGZyYWdtZW50cyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmcmFnbWVudHMgPSBuZXcgQXJyYXlMaXN0PEZyYWdtZW50PigpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGZyYWdtZW50cy5hZGQoZik7CisgICAgICAgICAgICAgICAgICAgIGYubVJldGFpbmluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmcmFnbWVudHM7CisgICAgfQorICAgIAorICAgIHZvaWQgc2F2ZUZyYWdtZW50Vmlld1N0YXRlKEZyYWdtZW50IGYpIHsKKyAgICAgICAgaWYgKGYubVZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChtU3RhdGVBcnJheSA9PSBudWxsKSB7CisgICAgICAgICAgICBtU3RhdGVBcnJheSA9IG5ldyBTcGFyc2VBcnJheTxQYXJjZWxhYmxlPigpOworICAgICAgICB9CisgICAgICAgIGYubVZpZXcuc2F2ZUhpZXJhcmNoeVN0YXRlKG1TdGF0ZUFycmF5KTsKKyAgICAgICAgaWYgKG1TdGF0ZUFycmF5LnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIGYubVNhdmVkVmlld1N0YXRlID0gbVN0YXRlQXJyYXk7CisgICAgICAgICAgICBtU3RhdGVBcnJheSA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgUGFyY2VsYWJsZSBzYXZlQWxsU3RhdGUoKSB7CisgICAgICAgIG1TdGF0ZVNhdmVkID0gdHJ1ZTsKKworICAgICAgICBpZiAobUFjdGl2ZSA9PSBudWxsIHx8IG1BY3RpdmUuc2l6ZSgpIDw9IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBGaXJzdCBjb2xsZWN0IGFsbCBhY3RpdmUgZnJhZ21lbnRzLgorICAgICAgICBpbnQgTiA9IG1BY3RpdmUuc2l6ZSgpOworICAgICAgICBGcmFnbWVudFN0YXRlW10gYWN0aXZlID0gbmV3IEZyYWdtZW50U3RhdGVbTl07CisgICAgICAgIGJvb2xlYW4gaGF2ZUZyYWdtZW50cyA9IGZhbHNlOworICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFjdGl2ZS5nZXQoaSk7CisgICAgICAgICAgICBpZiAoZiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaGF2ZUZyYWdtZW50cyA9IHRydWU7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgRnJhZ21lbnRTdGF0ZSBmcyA9IG5ldyBGcmFnbWVudFN0YXRlKGYpOworICAgICAgICAgICAgICAgIGFjdGl2ZVtpXSA9IGZzOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmIChmLm1TdGF0ZSA+IEZyYWdtZW50LklOSVRJQUxJWklORyAmJiBmcy5tU2F2ZWRGcmFnbWVudFN0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1TdGF0ZUJ1bmRsZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtU3RhdGVCdW5kbGUgPSBuZXcgQnVuZGxlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZi5vblNhdmVJbnN0YW5jZVN0YXRlKG1TdGF0ZUJ1bmRsZSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghbVN0YXRlQnVuZGxlLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZnMubVNhdmVkRnJhZ21lbnRTdGF0ZSA9IG1TdGF0ZUJ1bmRsZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TdGF0ZUJ1bmRsZSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoZi5tVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzYXZlRnJhZ21lbnRWaWV3U3RhdGUoZik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5tU2F2ZWRWaWV3U3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmcy5tU2F2ZWRGcmFnbWVudFN0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnMubVNhdmVkRnJhZ21lbnRTdGF0ZSA9IG5ldyBCdW5kbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnMubVNhdmVkRnJhZ21lbnRTdGF0ZS5wdXRTcGFyc2VQYXJjZWxhYmxlQXJyYXkoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXJJbXBsLlZJRVdfU1RBVEVfVEFHLCBmLm1TYXZlZFZpZXdTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoZi5tVGFyZ2V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmcy5tU2F2ZWRGcmFnbWVudFN0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcy5tU2F2ZWRGcmFnbWVudFN0YXRlID0gbmV3IEJ1bmRsZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcHV0RnJhZ21lbnQoZnMubVNhdmVkRnJhZ21lbnRTdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnRNYW5hZ2VySW1wbC5UQVJHRVRfU1RBVEVfVEFHLCBmLm1UYXJnZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubVRhcmdldFJlcXVlc3RDb2RlICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcy5tU2F2ZWRGcmFnbWVudFN0YXRlLnB1dEludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50TWFuYWdlckltcGwuVEFSR0VUX1JFUVVFU1RfQ09ERV9TVEFURV9UQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmLm1UYXJnZXRSZXF1ZXN0Q29kZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGZzLm1TYXZlZEZyYWdtZW50U3RhdGUgPSBmLm1TYXZlZEZyYWdtZW50U3RhdGU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiU2F2ZWQgc3RhdGUgb2YgIiArIGYgKyAiOiAiCisgICAgICAgICAgICAgICAgICAgICAgICArIGZzLm1TYXZlZEZyYWdtZW50U3RhdGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoIWhhdmVGcmFnbWVudHMpIHsKKyAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAic2F2ZUFsbFN0YXRlOiBubyBmcmFnbWVudHMhIik7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaW50W10gYWRkZWQgPSBudWxsOworICAgICAgICBCYWNrU3RhY2tTdGF0ZVtdIGJhY2tTdGFjayA9IG51bGw7CisgICAgICAgIAorICAgICAgICAvLyBCdWlsZCBsaXN0IG9mIGN1cnJlbnRseSBhZGRlZCBmcmFnbWVudHMuCisgICAgICAgIGlmIChtQWRkZWQgIT0gbnVsbCkgeworICAgICAgICAgICAgTiA9IG1BZGRlZC5zaXplKCk7CisgICAgICAgICAgICBpZiAoTiA+IDApIHsKKyAgICAgICAgICAgICAgICBhZGRlZCA9IG5ldyBpbnRbTl07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICBhZGRlZFtpXSA9IG1BZGRlZC5nZXQoaSkubUluZGV4OworICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgInNhdmVBbGxTdGF0ZTogYWRkaW5nIGZyYWdtZW50ICMiICsgaQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIjogIiArIG1BZGRlZC5nZXQoaSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLy8gTm93IHNhdmUgYmFjayBzdGFjay4KKyAgICAgICAgaWYgKG1CYWNrU3RhY2sgIT0gbnVsbCkgeworICAgICAgICAgICAgTiA9IG1CYWNrU3RhY2suc2l6ZSgpOworICAgICAgICAgICAgaWYgKE4gPiAwKSB7CisgICAgICAgICAgICAgICAgYmFja1N0YWNrID0gbmV3IEJhY2tTdGFja1N0YXRlW05dOworICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgYmFja1N0YWNrW2ldID0gbmV3IEJhY2tTdGFja1N0YXRlKHRoaXMsIG1CYWNrU3RhY2suZ2V0KGkpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJzYXZlQWxsU3RhdGU6IGFkZGluZyBiYWNrIHN0YWNrICMiICsgaQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIjogIiArIG1CYWNrU3RhY2suZ2V0KGkpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEZyYWdtZW50TWFuYWdlclN0YXRlIGZtcyA9IG5ldyBGcmFnbWVudE1hbmFnZXJTdGF0ZSgpOworICAgICAgICBmbXMubUFjdGl2ZSA9IGFjdGl2ZTsKKyAgICAgICAgZm1zLm1BZGRlZCA9IGFkZGVkOworICAgICAgICBmbXMubUJhY2tTdGFjayA9IGJhY2tTdGFjazsKKyAgICAgICAgcmV0dXJuIGZtczsKKyAgICB9CisgICAgCisgICAgdm9pZCByZXN0b3JlQW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VkVmlld1N0YXRlID0gbnVsbDsKKyAgICAgICAgICAgICAgICBmLm1CYWNrU3RhY2tOZXN0aW5nID0gMDsKKyAgICAgICAgICAgICAgICBmLm1JbkxheW91dCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGYubUFkZGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgaWYgKGZzLm1TYXZlZEZyYWdtZW50U3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmcy5tU2F2ZWRGcmFnbWVudFN0YXRlLnNldENsYXNzTG9hZGVyKG1BY3Rpdml0eS5nZXRDbGFzc0xvYWRlcigpKTsKKyAgICAgICAgICAgICAgICAgICAgZi5tU2F2ZWRWaWV3U3RhdGUgPSBmcy5tU2F2ZWRGcmFnbWVudFN0YXRlLmdldFNwYXJzZVBhcmNlbGFibGVBcnJheSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXJJbXBsLlZJRVdfU1RBVEVfVEFHKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIEJ1aWxkIHRoZSBmdWxsIGxpc3Qgb2YgYWN0aXZlIGZyYWdtZW50cywgaW5zdGFudGlhdGluZyB0aGVtIGZyb20KKyAgICAgICAgLy8gdGhlaXIgc2F2ZWQgc3RhdGUuCisgICAgICAgIG1BY3RpdmUgPSBuZXcgQXJyYXlMaXN0PEZyYWdtZW50PihmbXMubUFjdGl2ZS5sZW5ndGgpOworICAgICAgICBpZiAobUF2YWlsSW5kaWNlcyAhPSBudWxsKSB7CisgICAgICAgICAgICBtQXZhaWxJbmRpY2VzLmNsZWFyKCk7CisgICAgICAgIH0KKyAgICAgICAgZm9yIChpbnQgaT0wOyBpPGZtcy5tQWN0aXZlLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBGcmFnbWVudFN0YXRlIGZzID0gZm1zLm1BY3RpdmVbaV07CisgICAgICAgICAgICBpZiAoZnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBmcy5pbnN0YW50aWF0ZShtQWN0aXZpdHkpOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAicmVzdG9yZUFsbFN0YXRlOiBhZGRpbmcgIyIgKyBpICsgIjogIiArIGYpOworICAgICAgICAgICAgICAgIG1BY3RpdmUuYWRkKGYpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgInJlc3RvcmVBbGxTdGF0ZTogYWRkaW5nICMiICsgaSArICI6IChudWxsKSIpOworICAgICAgICAgICAgICAgIG1BY3RpdmUuYWRkKG51bGwpOworICAgICAgICAgICAgICAgIGlmIChtQXZhaWxJbmRpY2VzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUF2YWlsSW5kaWNlcyA9IG5ldyBBcnJheUxpc3Q8SW50ZWdlcj4oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJyZXN0b3JlQWxsU3RhdGU6IGFkZGluZyBhdmFpbCAjIiArIGkpOworICAgICAgICAgICAgICAgIG1BdmFpbEluZGljZXMuYWRkKGkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBVcGRhdGUgdGhlIHRhcmdldCBvZiBhbGwgcmV0YWluZWQgZnJhZ21lbnRzLgorICAgICAgICBpZiAobm9uQ29uZmlnICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxub25Db25maWcuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbm9uQ29uZmlnLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoZi5tVGFyZ2V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGYubVRhcmdldC5tSW5kZXggPCBtQWN0aXZlLnNpemUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tVGFyZ2V0ID0gbUFjdGl2ZS5nZXQoZi5tVGFyZ2V0Lm1JbmRleCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJSZS1hdHRhY2hpbmcgcmV0YWluZWQgZnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHRhcmdldCBubyBsb25nZXIgZXhpc3RzOiAiICsgZi5tVGFyZ2V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubVRhcmdldCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBCdWlsZCB0aGUgbGlzdCBvZiBjdXJyZW50bHkgYWRkZWQgZnJhZ21lbnRzLgorICAgICAgICBpZiAoZm1zLm1BZGRlZCAhPSBudWxsKSB7CisgICAgICAgICAgICBtQWRkZWQgPSBuZXcgQXJyYXlMaXN0PEZyYWdtZW50PihmbXMubUFkZGVkLmxlbmd0aCk7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8Zm1zLm1BZGRlZC5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWN0aXZlLmdldChmbXMubUFkZGVkW2ldKTsKKyAgICAgICAgICAgICAgICBpZiAoZiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5vIGluc3RhbnRpYXRlZCBmcmFnbWVudCBmb3IgaW5kZXggIyIgKyBmbXMubUFkZGVkW2ldKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZi5tQWRkZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIGYubUltbWVkaWF0ZUFjdGl2aXR5ID0gbUFjdGl2aXR5OworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAicmVzdG9yZUFsbFN0YXRlOiBtYWtpbmcgYWRkZWQgIyIgKyBpICsgIjogIiArIGYpOworICAgICAgICAgICAgICAgIG1BZGRlZC5hZGQoZik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtQWRkZWQgPSBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBCdWlsZCB0aGUgYmFjayBzdGFjay4KKyAgICAgICAgaWYgKGZtcy5tQmFja1N0YWNrICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1CYWNrU3RhY2sgPSBuZXcgQXJyYXlMaXN0PEJhY2tTdGFja1JlY29yZD4oZm1zLm1CYWNrU3RhY2subGVuZ3RoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxmbXMubUJhY2tTdGFjay5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIEJhY2tTdGFja1JlY29yZCBic2UgPSBmbXMubUJhY2tTdGFja1tpXS5pbnN0YW50aWF0ZSh0aGlzKTsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgInJlc3RvcmVBbGxTdGF0ZTogYWRkaW5nIGJzZSAjIiArIGkKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiAoaW5kZXggIiArIGJzZS5tSW5kZXggKyAiKTogIiArIGJzZSk7CisgICAgICAgICAgICAgICAgbUJhY2tTdGFjay5hZGQoYnNlKTsKKyAgICAgICAgICAgICAgICBpZiAoYnNlLm1JbmRleCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIHNldEJhY2tTdGFja0luZGV4KGJzZS5tSW5kZXgsIGJzZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2Uge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wdWJsaWMgdm9pZCBkaXNwYXRjaFBhdXNlKCkgeworICAgICAgICBtb3ZlVG9TdGF0ZShGcmFnbWVudC5TVEFSVEVELCBmYWxzZSk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoU3RvcCgpIHsKKyAgICAgICAgbW92ZVRvU3RhdGUoRnJhZ21lbnQuQUNUSVZJVFlfQ1JFQVRFRCwgZmFsc2UpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaERlc3Ryb3koKSB7CisgICAgICAgIG1vdmVUb1N0YXRlKEZyYWdtZW50LklOSVRJQUxJWklORywgZmFsc2UpOworICAgICAgICBtQWN0aXZpdHkgPSBudWxsOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgYm9vbGVhbiBkaXNwYXRjaENyZWF0ZU9wdGlvbnNNZW51KE1lbnUgbWVudSwgTWVudUluZmxhdGVyIGluZmxhdGVyKSB7CisgICAgICAgIGJvb2xlYW4gc2hvdyA9IGZhbHNlOworICAgICAgICBBcnJheUxpc3Q8RnJhZ21lbnQ+IG5ld01lbnVzID0gbnVsbDsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1BZGRlZC5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgIWYubUhpZGRlbiAmJiBmLm1IYXNNZW51KSB7CisgICAgICAgICAgICAgICAgICAgIHNob3cgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBmLm9uQ3JlYXRlT3B0aW9uc01lbnUobWVudSwgaW5mbGF0ZXIpOworICAgICAgICAgICAgICAgICAgICBpZiAobmV3TWVudXMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV3TWVudXMgPSBuZXcgQXJyYXlMaXN0PEZyYWdtZW50PigpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG5ld01lbnVzLmFkZChmKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtQ3JlYXRlZE1lbnVzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtQ3JlYXRlZE1lbnVzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1DcmVhdGVkTWVudXMuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChuZXdNZW51cyA9PSBudWxsIHx8ICFuZXdNZW51cy5jb250YWlucyhmKSkgeworICAgICAgICAgICAgICAgICAgICBmLm9uRGVzdHJveU9wdGlvbnNNZW51KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBtQ3JlYXRlZE1lbnVzID0gbmV3TWVudXM7CisgICAgICAgIAorICAgICAgICByZXR1cm4gc2hvdzsKKyAgICB9CisgICAgCisgICAgcHVibGljIGJvb2xlYW4gZGlzcGF0Y2hQcmVwYXJlT3B0aW9uc01lbnUoTWVudSBtZW51KSB7CisgICAgICAgIGJvb2xlYW4gc2hvdyA9IGZhbHNlOworICAgICAgICBpZiAobUFjdGl2ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bUFkZGVkLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BZGRlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiAhZi5tSGlkZGVuICYmIGYubUhhc01lbnUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2hvdyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGYub25QcmVwYXJlT3B0aW9uc01lbnUobWVudSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBzaG93OworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgYm9vbGVhbiBkaXNwYXRjaE9wdGlvbnNJdGVtU2VsZWN0ZWQoTWVudUl0ZW0gaXRlbSkgeworICAgICAgICBpZiAobUFjdGl2ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bUFkZGVkLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BZGRlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiAhZi5tSGlkZGVuICYmIGYubUhhc01lbnUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGYub25PcHRpb25zSXRlbVNlbGVjdGVkKGl0ZW0pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBib29sZWFuIGRpc3BhdGNoQ29udGV4dEl0ZW1TZWxlY3RlZChNZW51SXRlbSBpdGVtKSB7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtQWRkZWQuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFkZGVkLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoZiAhPSBudWxsICYmICFmLm1IaWRkZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGYub25Db250ZXh0SXRlbVNlbGVjdGVkKGl0ZW0pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoT3B0aW9uc01lbnVDbG9zZWQoTWVudSBtZW51KSB7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtQWRkZWQuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFkZGVkLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoZiAhPSBudWxsICYmICFmLm1IaWRkZW4gJiYgZi5tSGFzTWVudSkgeworICAgICAgICAgICAgICAgICAgICBmLm9uT3B0aW9uc01lbnVDbG9zZWQobWVudSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyBzdGF0aWMgaW50IHJldmVyc2VUcmFuc2l0KGludCB0cmFuc2l0KSB7CisgICAgICAgIGludCByZXYgPSAwOworICAgICAgICBzd2l0Y2ggKHRyYW5zaXQpIHsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0ZSQUdNRU5UX09QRU46CisgICAgICAgICAgICAgICAgcmV2ID0gRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0ZSQUdNRU5UX0NMT1NFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfRlJBR01FTlRfQ0xPU0U6CisgICAgICAgICAgICAgICAgcmV2ID0gRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0ZSQUdNRU5UX09QRU47CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9GUkFHTUVOVF9ORVhUOgorICAgICAgICAgICAgICAgIHJldiA9IEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9GUkFHTUVOVF9QUkVWOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfRlJBR01FTlRfUFJFVjoKKyAgICAgICAgICAgICAgICByZXYgPSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfRlJBR01FTlRfTkVYVDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmV2OworICAgICAgICAKKyAgICB9CisgICAgCisgICAgcHVibGljIHN0YXRpYyBpbnQgdHJhbnNpdFRvU3R5bGVJbmRleChpbnQgdHJhbnNpdCwgYm9vbGVhbiBlbnRlcikgeworICAgICAgICBpbnQgYW5pbUF0dHIgPSAtMTsKKyAgICAgICAgc3dpdGNoICh0cmFuc2l0KSB7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9GUkFHTUVOVF9PUEVOOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5GcmFnbWVudEFuaW1hdGlvbl9mcmFnbWVudE9wZW5FbnRlckFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkZyYWdtZW50QW5pbWF0aW9uX2ZyYWdtZW50T3BlbkV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9GUkFHTUVOVF9DTE9TRToKKyAgICAgICAgICAgICAgICBhbmltQXR0ciA9IGVudGVyCisgICAgICAgICAgICAgICAgICAgID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuRnJhZ21lbnRBbmltYXRpb25fZnJhZ21lbnRDbG9zZUVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuRnJhZ21lbnRBbmltYXRpb25fZnJhZ21lbnRDbG9zZUV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9GUkFHTUVOVF9ORVhUOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5GcmFnbWVudEFuaW1hdGlvbl9mcmFnbWVudE5leHRFbnRlckFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkZyYWdtZW50QW5pbWF0aW9uX2ZyYWdtZW50TmV4dEV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9GUkFHTUVOVF9QUkVWOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5GcmFnbWVudEFuaW1hdGlvbl9mcmFnbWVudFByZXZFbnRlckFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkZyYWdtZW50QW5pbWF0aW9uX2ZyYWdtZW50UHJldkV4aXRBb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dHkuTm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcylsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlLAorICAgICAgICAgICAgICAgIG5ldyBDb25maWd1cmF0aW9uKCkpOwogICAgICAgICByZXR1cm4gYWN0aXZpdHk7CiAgICAgfQogCkBAIC0xMDU4LDIxICsxMDYwLDIzIEBACiAgICAgfQogICAgIAogICAgIHB1YmxpYyB2b2lkIGNhbGxBY3Rpdml0eU9uRGVzdHJveShBY3Rpdml0eSBhY3Rpdml0eSkgewotICAgICAgaWYgKG1XYWl0aW5nQWN0aXZpdGllcyAhPSBudWxsKSB7Ci0gICAgICAgICAgc3luY2hyb25pemVkIChtU3luYykgewotICAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1XYWl0aW5nQWN0aXZpdGllcy5zaXplKCk7Ci0gICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgIGZpbmFsIEFjdGl2aXR5V2FpdGVyIGF3ID0gbVdhaXRpbmdBY3Rpdml0aWVzLmdldChpKTsKLSAgICAgICAgICAgICAgICAgIGZpbmFsIEludGVudCBpbnRlbnQgPSBhdy5pbnRlbnQ7Ci0gICAgICAgICAgICAgICAgICBpZiAoaW50ZW50LmZpbHRlckVxdWFscyhhY3Rpdml0eS5nZXRJbnRlbnQoKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICBhdy5hY3Rpdml0eSA9IGFjdGl2aXR5OwotICAgICAgICAgICAgICAgICAgICAgIG1NZXNzYWdlUXVldWUuYWRkSWRsZUhhbmRsZXIobmV3IEFjdGl2aXR5R29pbmcoYXcpKTsKLSAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgfQotICAgICAgICAgIH0KLSAgICAgIH0KKyAgICAgIC8vIFRPRE86IHRoZSBmb2xsb3dpbmcgYmxvY2sgY2F1c2VzIGludGVybWl0dGVudCBoYW5ncyB3aGVuIHVzaW5nIHN0YXJ0QWN0aXZpdHkKKyAgICAgIC8vIHRlbXBvcmFyaWx5IGNvbW1lbnQgb3V0IHVudGlsIHJvb3QgY2F1c2UgaXMgZml4ZWQgKGJ1ZyAyNjMwNjgzKQorLy8gICAgICBpZiAobVdhaXRpbmdBY3Rpdml0aWVzICE9IG51bGwpIHsKKy8vICAgICAgICAgIHN5bmNocm9uaXplZCAobVN5bmMpIHsKKy8vICAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1XYWl0aW5nQWN0aXZpdGllcy5zaXplKCk7CisvLyAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworLy8gICAgICAgICAgICAgICAgICBmaW5hbCBBY3Rpdml0eVdhaXRlciBhdyA9IG1XYWl0aW5nQWN0aXZpdGllcy5nZXQoaSk7CisvLyAgICAgICAgICAgICAgICAgIGZpbmFsIEludGVudCBpbnRlbnQgPSBhdy5pbnRlbnQ7CisvLyAgICAgICAgICAgICAgICAgIGlmIChpbnRlbnQuZmlsdGVyRXF1YWxzKGFjdGl2aXR5LmdldEludGVudCgpKSkgeworLy8gICAgICAgICAgICAgICAgICAgICAgYXcuYWN0aXZpdHkgPSBhY3Rpdml0eTsKKy8vICAgICAgICAgICAgICAgICAgICAgIG1NZXNzYWdlUXVldWUuYWRkSWRsZUhhbmRsZXIobmV3IEFjdGl2aXR5R29pbmcoYXcpKTsKKy8vICAgICAgICAgICAgICAgICAgfQorLy8gICAgICAgICAgICAgIH0KKy8vICAgICAgICAgIH0KKy8vICAgICAgfQogICAgICAgCi0gICAgICBhY3Rpdml0eS5vbkRlc3Ryb3koKTsKKyAgICAgIGFjdGl2aXR5LnBlcmZvcm1EZXN0cm95KCk7CiAgICAgICAKICAgICAgIGlmIChtQWN0aXZpdHlNb25pdG9ycyAhPSBudWxsKSB7CiAgICAgICAgICAgc3luY2hyb25pemVkIChtU3luYykgewpAQCAtMTMzMSw3ICsxMzM1LDcgQEAKICAgICAgKiAgICAgICAgICAgICAgICAgICAgICBp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XZpdHkKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgICBpcyBiZWluZyBzdGFydGVkLgorICAgICAqIEBwYXJhbSB0b2tlbiBJbnRlcm5hbCB0b2tlbiBpZGVudGlmeWluZyB0byB0aGUgc3lzdGVtIHdobyBpcyBzdGFydGluZyAKKyAgICAgKiAgICAgICAgICAgICAgdGhlIGFjdGl2aXR5OyBtYXkgYmUgbnVsbC4KKyAgICAgKiBAcGFyYW0gdGFyZ2V0IFdoaWNoIGZyYWdtZW50IGlzIHBlcmZvcm1pbmcgdGhlIHN0YXJ0IChhbmQgdGh1cyByZWNlaXZpbmcgCisgICAgICogICAgICAgICAgICAgICBhbnkgcmVzdWx0KS4KKyAgICAgKiBAcGFyYW0gaW50ZW50IFRoZSBhY3R1YWwgSW50ZW50IHRvIHN0YXJ0LgorICAgICAqIEBwYXJhbSByZXF1ZXN0Q29kZSBJZGVudGlmaWVyIGZvciB0aGlzIHJlcXVlc3QncyByZXN1bHQ7IGxlc3MgdGhhbiB6ZXJvIAorICAgICAqICAgICAgICAgICAgICAgICAgICBpZiB0aGUgY2FsbGVyIGlzIG5vdCBleHBlY3RpbmcgYSByZXN1bHQuCisgICAgICogCisgICAgICogQHJldHVybiBUbyBmb3JjZSB0aGUgcmV0dXJuIG9mIGEgcGFydGljdWxhciByZXN1bHQsIHJldHVybiBhbiAKKyAgICAgKiAgICAgICAgIEFjdGl2aXR5UmVzdWx0IG9iamVjdCBjb250YWluaW5nIHRoZSBkZXNpcmVkIGRhdGE7IG90aGVyd2lzZQorICAgICAqICAgICAgICAgcmV0dXJuIG51bGwuICBUaGUgZGVmYXVsdCBpbXBsZW1lbnRhdGlvbiBhbHdheXMgcmV0dXJucyBudWxsLgorICAgICAqICAKKyAgICAgKiBAdGhyb3dzIGFuZHJvaWQuY29udGVudC5BY3Rpdml0eU5vdEZvdW5kRXhjZXB0aW9uCisgICAgICogCisgICAgICogQHNlZSBBY3Rpdml0eSNzdGFydEFjdGl2aXR5KEludGVudCkKKyAgICAgKiBAc2VlIEFjdGl2aXR5I3N0YXJ0QWN0aXZpdHlGb3JSZXN1bHQoSW50ZW50LCBpbnQpCisgICAgICogQHNlZSBBY3Rpdml0eSNzdGFydEFjdGl2aXR5RnJvbUNoaWxkCisgICAgICogCisgICAgICoge0BoaWRlfQorICAgICAqLworICAgIHB1YmxpYyBBY3Rpdml0eVJlc3VsdCBleGVjU3RhcnRBY3Rpdml0eSgKKyAgICAgICAgQ29udGV4dCB3aG8sIElCaW5kZXIgY29udGV4dFRocmVhZCwgSUJpbmRlciB0b2tlbiwgRnJhZ21lbnQgdGFyZ2V0LAorICAgICAgICBJbnRlbnQgaW50ZW50LCBpbnQgcmVxdWVzdENvZGUpIHsKKyAgICAgICAgSUFwcGxpY2F0aW9uVGhyZWFkIHdob1RocmVhZCA9IChJQXBwbGljYXRpb25UaHJlYWQpIGNvbnRleHRUaHJlYWQ7CisgICAgICAgIGlmIChtQWN0aXZpdHlNb25pdG9ycyAhPSBudWxsKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jKSB7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWN0aXZpdHlNb25pdG9ycy5zaXplKCk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBBY3Rpdml0eU1vbml0b3IgYW0gPSBtQWN0aXZpdHlNb25pdG9ycy5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChhbS5tYXRjaCh3aG8sIG51bGwsIGludGVudCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFtLm1IaXRzKys7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW0uaXNCbG9ja2luZygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcXVlc3RDb2RlID49IDAgPyBhbS5nZXRSZXN1bHQoKSA6IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgaW50IHJlc3VsdCA9IEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCkKKyAgICAgICAgICAgICAgICAuc3RhcnRBY3Rpdml0eSh3aG9UaHJlYWQsIGludGVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5yZXNvbHZlVHlwZUlmTmVlZGVkKHdoby5nZXRDb250ZW50UmVzb2x2ZXIoKSksCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCAwLCB0b2tlbiwgdGFyZ2V0ICE9IG51bGwgPyB0YXJnZXQubVdobyA6IG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0Q29kZSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgIGNoZWNrU3RhcnRBY3Rpdml0eVJlc3VsdChyZXN1bHQsIGludGVudCk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCiAgICAgLypwYWNrYWdlKi8gZmluYWwgdm9pZCBpbml0KEFjdGl2aXR5VGhyZWFkIHRocmVhZCwKICAgICAgICAgICAgIENvbnRleHQgaW5zdHJDb250ZXh0LCBDb250ZXh0IGFwcENvbnRleHQsIENvbXBvbmVudE5hbWUgY29tcG9uZW50LCAKICAgICAgICAgICAgIElJbnN0cnVtZW50YXRpb25XYXRjaGVyIHdhdGNoZXIpIHsKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9MaXN0QWN0aXZpdHkuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9MaXN0QWN0aXZpdHkuamF2YQppbmRle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S5mYWRlX291dCkpOworICAgICAgICAgICAgICAgIG1MaXN0Q29udGFpbmVyLnN0YXJ0QW5pbWF0aW9uKEFuaW1hdGlvblV0aWxzLmxvYWRBbmltYXRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICBnZXRBY3Rpdml0eSgpLCBhbmRyb2lkLlIuYW5pbS5mYWRlX2luKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtUHJvZ3Jlc3NDb250YWluZXIuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICAgICAgbUxpc3RDb250YWluZXIuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKGFuaW1hdGUpIHsKKyAgICAgICAgICAgICAgICBtUHJvZ3Jlc3NDb250YWluZXIuc3RhcnRBbmltYXRpb24oQW5pbWF0aW9uVXRpbHMubG9hZEFuaW1hdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgIGdldEFjdGl2aXR5KCksIGFuZHJvaWQuUi5hbmltLmZhZGVfaW4pKTsKKyAgICAgICAgICAgICAgICBtTGlzdENvbnRhaW5lci5zdGFydEFuaW1hdGlvbihBbmltYXRpb25VdGlscy5sb2FkQW5pbWF0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgZ2V0QWN0aXZpdHkoKSwgYW5kcm9pZC5SLmFuaW0uZmFkZV9vdXQpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Qcm9ncmVzc0NvbnRhaW5lci5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICBtTGlzdENvbnRhaW5lci5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogR2V0IHRoZSBMaXN0QWRhcHRlciBhc3NvY2lhdGVkIHdpdGggdGhpcyBhY3Rpdml0eSdzIExpc3RWaWV3LgorICAgICAqLworICAgIHB1YmxpYyBMaXN0QWRhcHRlciBnZXRMaXN0QWRhcHRlcigpIHsKKyAgICAgICAgcmV0dXJuIG1BZGFwdGVyOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBlbnN1cmVMaXN0KCkgeworICAgICAgICBpZiAobUxpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIFZpZXcgcm9vdCA9IGdldFZpZXcoKTsKKyAgICAgICAgaWYgKHJvb3QgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiQ29udGVudCB2aWV3IG5vdCB5ZXQgY3JlYXRlZCIpOworICAgICAgICB9CisgICAgICAgIGlmIChyb290IGluc3RhbmNlb2YgTGlzdFZpZXcpIHsKKyAgICAgICAgICAgIG1MaXN0ID0gKExpc3RWaWV3KXJvb3Q7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtU3RhbmRhcmRFbXB0eVZpZXcgPSAoVGV4dFZpZXcpcm9vdC5maW5kVmlld0J5SWQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuaW50ZXJuYWxFbXB0eSk7CisgICAgICAgICAgICBpZiAobVN0YW5kYXJkRW1wdHlWaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtRW1wdHlWaWV3ID0gcm9vdC5maW5kVmlld0J5SWQoYW5kcm9pZC5SLmlkLmVtcHR5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Qcm9ncmVzc0NvbnRhaW5lciA9IHJvb3QuZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQucHJvZ3Jlc3NDb250YWluZXIpOworICAgICAgICAgICAgbUxpc3RDb250YWluZXIgPSByb290LmZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLmxpc3RDb250YWluZXIpOworICAgICAgICAgICAgVmlldyByYXdMaXN0VmlldyA9IHJvb3QuZmluZFZpZXdCeUlkKGFuZHJvaWQuUi5pZC5saXN0KTsKKyAgICAgICAgICAgIGlmICghKHJhd0xpc3RWaWV3IGluc3RhbmNlb2YgTGlzdFZpZXcpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiQ29udGVudCBoYXMgdmlldyB3aXRoIGlkIGF0dHJpYnV0ZSAnYW5kcm9pZC5SLmlkLmxpc3QnICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgInRoYXQgaXMgbm90IGEgTGlzdFZpZXcgY2xhc3MiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1MaXN0ID0gKExpc3RWaWV3KXJhd0xpc3RWaWV3OworICAgICAgICAgICAgaWYgKG1MaXN0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJZb3VyIGNvbnRlbnQgbXVzdCBoYXZlIGEgTGlzdFZpZXcgd2hvc2UgaWQgYXR0cmlidXRlIGlzICIgKworICAgICAgICAgICAgICAgICAgICAgICAgIidhbmRyb2lkLlIuaWQubGlzdCciKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtRW1wdHlWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtTGlzdC5zZXRFbXB0eVZpZXcobUVtcHR5Vmlldyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbUxpc3RTaG93biA9IHRydWU7CisgICAgICAgIG1MaXN0LnNldE9uSXRlbUNsaWNrTGlzdGVuZXIobU9uQ2xpY2tMaXN0ZW5lcik7CisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBzZXRMaXN0QWRhcHRlcihtQ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XRlIEludGVudCBtQ3VySW50ZW50OwotICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbUN1ckNvZGU7Ci0gICAgICAgICAgICBwcml2YXRlIFN0cmluZyBtQ3VyRGF0YTsKLSAgICAgICAgICAgIHByaXZhdGUgQnVuZGxlIG1DdXJNYXA7Ci0gICAgICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUN1ck9yZGVyZWQ7Ci0gICAgICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUN1clN0aWNreTsKKyAgICAgICAgICAgIHByaXZhdGUgZmluYWwgYm9vbGVhbiBtT3JkZXJlZDsKIAorICAgICAgICAgICAgcHVibGljIEFyZ3MoSW50ZW50IGludGVudCwgaW50IHJlc3VsdENvZGUsIFN0cmluZyByZXN1bHREYXRhLCBCdW5kbGUgcmVzdWx0RXh0cmFzLAorICAgICAgICAgICAgICAgICAgICBib29sZWFuIG9yZGVyZWQsIGJvb2xlYW4gc3RpY2t5KSB7CisgICAgICAgICAgICAgICAgc3VwZXIocmVzdWx0Q29kZSwgcmVzdWx0RGF0YSwgcmVzdWx0RXh0cmFzLAorICAgICAgICAgICAgICAgICAgICAgICAgbVJlZ2lzdGVyZWQgPyBUWVBFX1JFR0lTVEVSRUQgOiBUWVBFX1VOUkVHSVNURVJFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG9yZGVyZWQsIHN0aWNreSwgbUlJbnRlbnRSZWNlaXZlci5hc0JpbmRlcigpKTsKKyAgICAgICAgICAgICAgICBtQ3VySW50ZW50ID0gaW50ZW50OworICAgICAgICAgICAgICAgIG1PcmRlcmVkID0gb3JkZXJlZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAogICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewotICAgICAgICAgICAgICAgIEJyb2FkY2FzdFJlY2VpdmVyIHJlY2VpdmVyID0gbVJlY2VpdmVyOworICAgICAgICAgICAgICAgIGZpbmFsIEJyb2FkY2FzdFJlY2VpdmVyIHJlY2VpdmVyID0gbVJlY2VpdmVyOworICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gb3JkZXJlZCA9IG1PcmRlcmVkOworICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgIGlmIChBY3Rpdml0eVRocmVhZC5ERUJVR19CUk9BRENBU1QpIHsKICAgICAgICAgICAgICAgICAgICAgaW50IHNlcSA9IG1DdXJJbnRlbnQuZ2V0SW50RXh0cmEoInNlcSIsIC0xKTsKICAgICAgICAgICAgICAgICAgICAgU2xvZy5pKEFjdGl2aXR5VGhyZWFkLlRBRywgIkRpc3BhdGNoaW5nIGJyb2FkY2FzdCAiICsgbUN1ckludGVudC5nZXRBY3Rpb24oKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBzZXE9IiArIHNlcSArICIgdG8gIiArIG1SZWNlaXZlcik7CiAgICAgICAgICAgICAgICAgICAgIFNsb2cuaShBY3Rpdml0eVRocmVhZC5UQUcsICIgIG1SZWdpc3RlcmVkPSIgKyBtUmVnaXN0ZXJlZAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtQ3VyT3JkZXJlZD0iICsgbUN1ck9yZGVyZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtT3JkZXJlZEhpbnQ9IiArIG9yZGVyZWQpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBJQWN0aXZpdHlNYW5hZ2VyIG1nciA9IEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCk7Ci0gICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG1DdXJJbnRlbnQ7CisgICAgICAgICAgICAgICAgZmluYWwgSUFjdGl2aXR5TWFuYWdlciBtZ3IgPSBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuZ2V0RGVmYXVsdCgpOworICAgICAgICAgICAgICAgIGZpbmFsIEludGVudCBpbnRlbnQgPSBtQ3VySW50ZW50OwogICAgICAgICAgICAgICAgIG1DdXJJbnRlbnQgPSBudWxsOwogICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgIGlmIChyZWNlaXZlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtUmVnaXN0ZXJlZCAmJiBtQ3VyT3JkZXJlZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQWN0aXZpdHlUaHJlYWQuREVCVUdfQlJPQURDQVNUKSBTbG9nLmkoQWN0aXZpdHlUaHJlYWQuVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZpbmlzaGluZyBudWxsIGJyb2FkY2FzdCB0byAiICsgbVJlY2VpdmVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZ3IuZmluaXNoUmVjZWl2ZXIobUlJbnRlbnRSZWNlaXZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJDb2RlLCBtQ3VyRGF0YSwgbUN1ck1hcCwgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChtUmVnaXN0ZXJlZCAmJiBvcmRlcmVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQWN0aXZpdHlUaHJlYWQuREVCVUdfQlJPQURDQVNUKSBTbG9nLmkoQWN0aXZpdHlUaHJlYWQuVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRmluaXNoaW5nIG51bGwgYnJvYWRjYXN0IHRvICIgKyBtUmVjZWl2ZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZEZpbmlzaGVkKG1ncik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KQEAgLTY5OCwyNCArNzAxLDE0IEBACiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgQ2xhc3NMb2FkZXIgY2wgPSAgbVJlY2VpdmVyLmdldENsYXNzKCkuZ2V0Q2xhc3NMb2FkZXIoKTsKICAgICAgICAgICAgICAgICAgICAgaW50ZW50LnNldEV4dHJhc0NsYXNzTG9hZGVyKGNsKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1DdXJNYXAgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUN1ck1hcC5zZXRDbGFzc0xvYWRlcihjbCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZXIuc2V0T3JkZXJlZEhpbnQodHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgIHJlY2VpdmVyLnNldFJlc3VsdChtQ3VyQ29kZSwgbUN1ckRhdGEsIG1DdXJNYXApOwotICAgICAgICAgICAgICAgICAgICByZWNlaXZlci5jbGVhckFib3J0QnJvYWRjYXN0KCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlY2VpdmVyLnNldE9yZGVyZWRIaW50KG1DdXJPcmRlcmVkKTsKLSAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZXIuc2V0SW5pdGlhbFN0aWNreUhpbnQobUN1clN0aWNreSk7CisgICAgICAgICAgICAgICAgICAgIHNldEV4dHJhc0NsYXNzTG9hZGVyKGNsKTsKKyAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZXIuc2V0UGVuZGluZ1Jlc3VsdCh0aGlzKTsKICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZXIub25SZWNlaXZlKG1Db250ZXh0LCBpbnRlbnQpOwogICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtUmVnaXN0ZXJlZCAmJiBtQ3VyT3JkZXJlZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQWN0aXZpdHlUaHJlYWQuREVCVUdfQlJPQURDQVNUKSBTbG9nLmkoQWN0aXZpdHlUaHJlYWQuVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZpbmlzaGluZyBmYWlsZWQgYnJvYWRjYXN0IHRvICIgKyBtUmVjZWl2ZXIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1nci5maW5pc2hSZWNlaXZlcihtSUludGVudFJlY2VpdmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUN1ckNvZGUsIG1DdXJEYXRhLCBtQ3VyTWFwLCBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1SZWdpc3RlcmVkICYmIG9yZGVyZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBY3Rpdml0eVRocmVhZC5ERUJVR19CUk9BRENBU1QpIFNsb2cuaShBY3Rpdml0eVRocmVhZC5UQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJGaW5pc2hpbmcgZmFpbGVkIGJyb2FkY2FzdCB0byAiICsgbVJlY2VpdmVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRGaW5pc2hlZChtZ3IpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmIChtSW5zdHJ1bWVudGF0aW9uID09IG51bGwgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhbUluc3RydW1lbnRhdGlvbi5vbkV4Y2VwdGlvbihtUmVjZWl2ZXIsIGUpKSB7CkBAIC03MjQsMTcgKzcxNyw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGluICIgKyBtUmVjZWl2ZXIsIGUpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChtUmVnaXN0ZXJlZCAmJiBtQ3VyT3JkZXJlZCkgewotICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFjdGl2aXR5VGhyZWFkLkRFQlVHX0JST0FEQ0FTVCkgU2xvZy5pKEFjdGl2aXR5VGhyZWFkLlRBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZpbmlzaGluZyBicm9hZGNhc3QgdG8gIiArIG1SZWNlaXZlcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtZ3IuZmluaXNoUmVjZWl2ZXIobUlJbnRlbnRSZWNlaXZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZXIuZ2V0UmVzdWx0Q29kZSgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlci5nZXRSZXN1bHREYXRhKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY2VpdmVyLmdldFJlc3VsdEV4dHJhcyhmYWxzZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY2VpdmVyLmdldEFib3J0QnJvYWRjYXN0KCkpOwotICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmIChyZWNlaXZlci5nZXRQZW5kaW5nUmVzdWx0KCkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmaW5pc2goKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTc5OCwyMyArNzgzLDEzIEBACiAgICAgICAgICAgICAgICAgU2xvZy5pKEFjdGl2aXR5VGhyZWFkLlRBRywgIkVucXVldWVpbmcgYnJvYWRjYXN0ICIgKyBpbnRlbnQuZ2V0QWN0aW9uKCkgKyAiIHNlcT0iICsgc2VxCiAgICAgICAgICAgICAgICAgICAgICAgICArICIgdG8gIiArIG1SZWNlaXZlcik7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBBcmdzIGFyZ3MgPSBuZXcgQXJncygpOwotICAgICAgICAgICAgYXJncy5tQ3VySW50ZW50ID0gaW50ZW50OwotICAgICAgICAgICAgYXJncy5tQ3VyQ29kZSA9IHJlc3VsdENvZGU7Ci0gICAgICAgICAgICBhcmdzLm1DdXJEYXRhID0gZGF0YTsKLSAgICAgICAgICAgIGFyZ3MubUN1ck1hcCA9IGV4dHJhczsKLSAgICAgICAgICAgIGFyZ3MubUN1ck9yZGVyZWQgPSBvcmRlcmVkOwotICAgICAgICAgICAgYXJncy5tQ3VyU3RpY2t5ID0gc3RpY2t5OworICAgICAgICAgICAgQXJncyBhcmdzID0gbmV3IEFyZ3MoaW50ZW50LCByZXN1bHRDb2RlLCBkYXRhLCBleHRyYXMsIG9yZGVyZWQsIHN0aWNreSk7CiAgICAgICAgICAgICBpZiAoIW1BY3Rpdml0eVRocmVhZC5wb3N0KGFyZ3MpKSB7CiAgICAgICAgICAgICAgICAgaWYgKG1SZWdpc3RlcmVkICYmIG9yZGVyZWQpIHsKICAgICAgICAgICAgICAgICAgICAgSUFjdGl2aXR5TWFuYWdlciBtZ3IgPSBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuZ2V0RGVmYXVsdCgpOwotICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFjdGl2aXR5VGhyZWFkLkRFQlVHX0JST0FEQ0FTVCkgU2xvZy5pKEFjdGl2aXR5VGhyZWFkLlRBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZp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ICAgYm9vbGVhbiBtTGlzdGVuZXJSZWdpc3RlcmVkOworICAgICAgICAKKyAgICAgICAgcHVibGljIExvYWRlckluZm8oaW50IGlkLCBCdW5kbGUgYXJncywgTG9hZGVyTWFuYWdlci5Mb2FkZXJDYWxsYmFja3M8T2JqZWN0PiBjYWxsYmFja3MpIHsKKyAgICAgICAgICAgIG1JZCA9IGlkOworICAgICAgICAgICAgbUFyZ3MgPSBhcmdzOworICAgICAgICAgICAgbUNhbGxiYWNrcyA9IGNhbGxiYWNrczsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdm9pZCBzdGFydCgpIHsKKyAgICAgICAgICAgIGlmIChtUmV0YWluaW5nICYmIG1SZXRhaW5pbmdTdGFydGVkKSB7CisgICAgICAgICAgICAgICAgLy8gT3VyIG93bmVyIGlzIHN0YXJ0ZWQsIGJ1dCB3ZSB3ZXJlIGJlaW5nIHJldGFpbmVkIGZyb20gYQorICAgICAgICAgICAgICAgIC8vIHByZXZpb3VzIGluc3RhbmNlIGluIHRoZSBzdGFydGVkIHN0YXRlLi4uICBzbyB0aGVyZSBpcyByZWFsbHkKKyAgICAgICAgICAgICAgICAvLyBub3RoaW5nIHRvIGRvIGhlcmUsIHNpbmNlIHRoZSBsb2FkZXJzIGFyZSBzdGlsbCBzdGFydGVkLgorICAgICAgICAgICAgICAgIG1TdGFydGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtU3RhcnRlZCkgeworICAgICAgICAgICAgICAgIC8vIElmIGxvYWRlciBhbHJlYWR5IHN0YXJ0ZWQsIGRvbid0IHJlc3RhcnQuCisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIiAgU3RhcnRpbmc6ICIgKyB0aGlzKTsKKyAgICAgICAgICAgIGlmIChtTG9hZGVyID09IG51bGwgJiYgbUNhbGxiYWNrcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICBtTG9hZGVyID0gbUNhbGxiYWNrcy5vbkNyZWF0ZUxvYWRlcihtSWQsIG1BcmdzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtTG9hZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW1MaXN0ZW5lclJlZ2lzdGVyZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgbUxvYWRlci5yZWdpc3Rlckxpc3RlbmVyKG1JZCwgdGhpcyk7CisgICAgICAgICAgICAgICAgICAgIG1MaXN0ZW5lclJlZ2lzdGVyZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtTG9hZGVyLnN0YXJ0TG9hZGluZygpOworICAgICAgICAgICAgICAgIG1TdGFydGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdm9pZCByZXRhaW4oKSB7CisgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIiAgUmV0YWluaW5nOiAiICsgdGhpcyk7CisgICAgICAgICAgICBtUmV0YWluaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIG1SZXRhaW5pbmdTdGFydGVkID0gbVN0YXJ0ZWQ7CisgICAgICAgICAgICBtU3RhcnRlZCA9IGZhbHNlOworICAgICAgICAgICAgbUNhbGxiYWNrcyA9IG51bGw7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHZvaWQgZmluaXNoUmV0YWluKCkgeworICAgICAgICAgICAgaWYgKG1SZXRhaW5pbmcpIHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIiAgRmluaXNoZWQgUmV0YWluaW5nOiAiICsgdGhpcyk7CisgICAgICAgICAgICAgICAgbVJldGFpbmluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgIGlmIChtU3RhcnRlZCAhPSBtUmV0YWluaW5nU3RhcnRlZCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIW1TdGFydGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGxvYWRlciB3YXMgcmV0YWluZWQgaW4gYSBzdGFydGVkIHN0YXRlLCBidXQKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGF0IHRoZSBlbmQgb2YgcmV0YWluaW5nIGV2ZXJ5dGhpbmcgb3VyIG93bmVyIGlzCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBsb25nZXIgc3RhcnRlZC4uLiAgc28gbWFrZSBpdCBzdG9wLgorICAgICAgICAgICAgICAgICAgICAgICAgc3RvcCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtU3RhcnRlZCAmJiBtRGF0YSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgbG9hZGVyIHdhcyByZXRhaW5lZCwgYW5kIG5vdyBhdCB0aGUgcG9pbnQgb2YKKyAgICAgICAgICAgICAgICAgICAgLy8gZmluaXNoaW5nIHRoZSByZXRhaW4gd2UgZmluZCB3ZSByZW1haW4gc3RhcnRlZCwgaGF2ZQorICAgICAgICAgICAgICAgICAgICAvLyBvdXIgZGF0YSwgYW5kIHRoZSBvd25lciBoYXMgYSBuZXcgY2FsbGJhY2suLi4gIHNvCisgICAgICAgICAgICAgICAgICAgIC8vIGxldCdzIGRlbGl2ZXIgdGhlIGRhdGEgbm93LgorICAgICAgICAgICAgICAgICAgICBjYWxsT25Mb2FkRmluaXNoZWQobUxvYWRlciwgbURhdGEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdm9pZCBzdG9wKCkgeworICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICIgIFN0b3BwaW5nOiAiICsgdGhpcyk7CisgICAgICAgICAgICBtU3RhcnRlZCA9IGZhbHNlOworICAgICAgICAgICAgaWYgKCFtUmV0YWluaW5nKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Mb2FkZXIgIT0gbnVsbCAmJiBtTGlzdGVuZXJSZWdpc3RlcmVkKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIExldCB0aGUgbG9hZGVyIGtub3cgd2UncmUgZG9uZSB3aXRoIGl0CisgICAgICAgICAgICAgICAgICAgIG1MaXN0ZW5lclJlZ2lzdGVyZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgbUxvYWRlci51bnJlZ2lzdGVyTGlzdGVuZXIodGhpcyk7CisgICAgICAgICAgICAgICAgICAgIG1Mb2FkZXIuc3RvcExvYWRpbmcoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbURhdGEgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICB2b2lkIGRlc3Ryb3koKSB7CisgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIiAgRGVzdHJveWluZzogIiArIHRoaXMpOworICAgICAgICAgICAgbURlc3Ryb3llZCA9IHRydWU7CisgICAgICAgICAgICBtQ2FsbGJhY2tzID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChtTG9hZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAobUxpc3RlbmVyUmVnaXN0ZXJlZCkgeworICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXJSZWdpc3RlcmVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIG1Mb2FkZXIudW5yZWdpc3Rlckxpc3RlbmVyKHRoaXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtTG9hZGVyLmRlc3Ryb3koKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgQE92ZXJyaWRlIHB1YmxpYyB2b2lkIG9uTG9hZENvbXBsZXRlKExvYWRlcjxPYmplY3Q+IGxvYWRlciwgT2JqZWN0IGRhdGEpIHsKKyAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAib25Mb2FkQ29tcGxldGU6ICIgKyB0aGlzICsgIiBtRGVzdHJveWVkPSIgKyBtRGVzdHJveWVkKTsKKworICAgICAgICAgICAgaWYgKG1EZXN0cm95ZWQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIE5vdGlmeSBvZiB0aGUgbmV3IGRhdGEgc28gdGhlIGFwcCBjYW4gc3dpdGNoIG91dCB0aGUgb2xkIGRhdGEgYmVmb3JlCisgICAgICAgICAgICAvLyB3ZSB0cnkgdG8gZGVzdHJveSBpdC4KKyAgICAgICAgICAgIG1EYXRhID0gZGF0YTsKKyAgICAgICAgICAgIGNhbGxPbkxvYWRGaW5pc2hlZChsb2FkZXIsIGRhdGEpOworCisgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm9uTG9hZEZpbmlzaGVkIHJldHVybmVkOiAiICsgdGhpcyk7CisKKyAgICAgICAgICAgIC8vIFdlIGhhdmUgbm93IGdpdmVuIHRoZSBhcHBsaWNhdGlvbiB0aGUgbmV3IGxvYWRlciB3aXRoIGl0cworICAgICAgICAgICAgLy8gbG9hZGVkIGRhdGEsIHNvIGl0IHNob3VsZCBoYXZlIHN0b3BwZWQgdXNpbmcgdGhlIHByZXZpb3VzCisgICAgICAgICAgICAvLyBsb2FkZXIuICBJZiB0aGVyZSBpcyBhIHByZXZpb3VzIGxvYWRlciBvbiB0aGUgaW5hY3RpdmUgbGlzdCwKKyAgICAgICAgICAgIC8vIGNsZWFuIGl0IHVwLgorICAgICAgICAgICAgTG9hZGVySW5mbyBpbmZvID0gbUluYWN0aXZlTG9hZGVycy5nZXQobUlkKTsKKyAgICAgICAgICAgIGlmIChpbmZvICE9IG51bGwgJiYgaW5mbyAhPSB0aGlzKSB7CisgICAgICAgICAgICAgICAgaW5mby5kZXN0cm95KCk7CisgICAgICAgICAgICAgICAgbUluYWN0aXZlTG9hZGVycy5yZW1vdmUobUlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgY2FsbE9uTG9hZEZpbmlzaGVkKExvYWRlcjxPYmplY3Q+IGxvYWRlciwgT2JqZWN0IGRhdGEpIHsKKyAgICAgICAgICAgIGlmIChtQ2FsbGJhY2tzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgbGFzdEJlY2F1c2UgPSBudWxsOworICAgICAgICAgICAgICAgIGlmIChtQWN0aXZpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBsYXN0QmVjYXVzZSA9IG1BY3Rpdml0eS5tRnJhZ21lbnRzLm1Ob1RyYW5zYWN0aW9uc0JlY2F1c2U7CisgICAgICAgICAgICAgICAgICAgIG1BY3Rpdml0eS5tRnJhZ21lbnRzLm1Ob1RyYW5zYWN0aW9uc0JlY2F1c2UgPSAib25Mb2FkRmluaXNoZWQiOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBtQ2FsbGJhY2tzLm9uTG9hZEZpbmlzaGVkKGxvYWRlciwgZGF0YSk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BY3Rpdml0eSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aXZpdHkubUZyYWdtZW50cy5tTm9UcmFuc2FjdGlvbnNCZWNhdXNlID0gbGFzdEJlY2F1c2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBzYiA9IG5ldyBTdHJpbmdCdWlsZGVyKDY0KTsKKyAgICAgICAgICAgIHNiLmFwcGVuZCgiTG9hZGVySW5mb3siKTsKKyAgICAgICAgICAgIHNiLmFwcGVuZChJbnRlZ2VyLnRvSGV4U3RyaW5nKFN5c3RlbS5pZGVudGl0eUhhc2hDb2RlKHRoaXMpKSk7CisgICAgICAgICAgICBzYi5hcHBlbmQoIiAjIik7CisgICAgICAgICAgICBzYi5hcHBlbmQobUlkKTsKKyAgICAgICAgICAgIGlmIChtQXJncyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCIgIik7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKG1BcmdzLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2IuYXBwZW5kKCJ9Iik7CisgICAgICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBMb2FkZXJNYW5hZ2VySW1wbChBY3Rpdml0eSBhY3Rpdml0eSwgYm9vbGVhbiBzdGFydGVkKSB7CisgICAgICAgIG1BY3Rpdml0eSA9IGFjdGl2aXR5OworICAgICAgICBtU3RhcnRlZCA9IHN0YXJ0ZWQ7CisgICAgfQorICAgIAorICAgIHZvaWQgdXBkYXRlQWN0aXZpdHkoQWN0aXZpdHkgYWN0aXZpdHkpIHsKKyAgICAgICAgbUFjdGl2aXR5ID0gYWN0aXZpdHk7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgTG9hZGVySW5mbyBjcmVhdGVMb2FkZXIoaW50IGlkLCBCdW5kbGUgYXJncywKKyAgICAgICAgICAgIExvYWRlck1hbmFnZXIuTG9hZGVyQ2FsbGJhY2tzPE9iamVjdD4gY2FsbGJhY2spIHsKKyAgICAgICAgTG9hZGVySW5mbyBpbmZvID0gbmV3IExvYWRlckluZm8oaWQsIGFyZ3MsICAoTG9hZGVyTWFuYWdlci5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pbmZvID0gY3JlYXRlTG9hZGVyKGlkLCBhcmdzLCAgKExvYWRlck1hbmFnZXIuTG9hZGVyQ2FsbGJhY2tzPE9iamVjdD4pY2FsbGJhY2spOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaW5mby5tQ2FsbGJhY2tzID0gKExvYWRlck1hbmFnZXIuTG9hZGVyQ2FsbGJhY2tzPE9iamVjdD4pY2FsbGJhY2s7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChpbmZvLm1EYXRhICE9IG51bGwgJiYgbVN0YXJ0ZWQpIHsKKyAgICAgICAgICAgIC8vIElmIHRoZSBsb2FkZXIgaGFzIGFscmVhZHkgZ2VuZXJhdGVkIGl0cyBkYXRhLCByZXBvcnQgaXQgbm93LgorICAgICAgICAgICAgaW5mby5jYWxsT25Mb2FkRmluaXNoZWQoaW5mby5tTG9hZGVyLCBpbmZvLm1EYXRhKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcmV0dXJuIChMb2FkZXI8RD4paW5mby5tTG9hZGVyOworICAgIH0KKyAgICAKKyAgICBAU3VwcHJlc3NXYXJuaW5ncygidW5jaGVja2VkIikKKyAgICBwdWJsaWMgPEQ+IExvYWRlcjxEPiByZXN0YXJ0TG9hZGVyKGludCBpZCwgQnVuZGxlIGFyZ3MsIExvYWRlck1hbmFnZXIuTG9hZGVyQ2FsbGJhY2tzPEQ+IGNhbGxiYWNrKSB7CisgICAgICAgIExvYWRlckluZm8gaW5mbyA9IG1Mb2FkZXJzLmdldChpZCk7CisgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAicmVzdGFydExvYWRlciBpbiAiICsgdGhpcyArICI6IGN1cj0iICsgaW5mbyk7CisgICAgICAgIGlmIChpbmZvICE9IG51bGwpIHsKKyAgICAgICAgICAgIExvYWRlckluZm8gaW5hY3RpdmUgPSBtSW5hY3RpdmVMb2FkZXJzLmdldChpZCk7CisgICAgICAgICAgICBpZiAoaW5hY3RpdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChpbmZvLm1EYXRhICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBsb2FkZXIgbm93IGhhcyBkYXRhLi4uICB3ZSBhcmUgcHJvYmFibHkgYmVpbmcKKyAgICAgICAgICAgICAgICAgICAgLy8gY2FsbGVkIGZyb20gd2l0aGluIG9uTG9hZENvbXBsZXRlLCB3aGVyZSB3ZSBoYXZlbid0CisgICAgICAgICAgICAgICAgICAgIC8vIHlldCBkZXN0cm95ZWQgdGhlIGxhc3QgaW5hY3RpdmUgbG9hZGVyLiAgU28ganVzdCBkbworICAgICAgICAgICAgICAgICAgICAvLyB0aGF0IG5vdy4KKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICIgIFJlbW92aW5nIGxhc3QgaW5hY3RpdmUgbG9hZGVyIGluICIgKyB0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgaW5hY3RpdmUuZGVzdHJveSgpOworICAgICAgICAgICAgICAgICAgICBtSW5hY3RpdmVMb2FkZXJzLnB1dChpZCwgaW5mbyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gV2UgYWxyZWFkeSBoYXZlIGFuIGluYWN0aXZlIGxvYWRlciBmb3IgdGhpcyBJRCB0aGF0IHdlIGFyZQorICAgICAgICAgICAgICAgICAgICAvLyB3YWl0aW5nIGZvciEgIE5vdyB3ZSBoYXZlIHRocmVlIGFjdGl2ZSBsb2FkZXJzLi4uIGxldCdzIGp1c3QKKyAgICAgICAgICAgICAgICAgICAgLy8gZHJvcCB0aGUgb25lIGluIHRoZSBtaWRkbGUsIHNpbmNlIHdlIGFyZSBzdGlsbCB3YWl0aW5nIGZvcgorICAgICAgICAgICAgICAgICAgICAvLyBpdHMgcmVzdWx0IGJ1dCB0aGF0IHJlc3VsdCBpcyBhbHJlYWR5IG91dCBvZiBkYXRlLgorICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIiAgUmVtb3ZpbmcgaW50ZXJtZWRpYXRlIGxvYWRlciBpbiAiICsgdGhpcyk7CisgICAgICAgICAgICAgICAgICAgIGluZm8uZGVzdHJveSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gS2VlcCB0cmFjayBvZiB0aGUgcHJldmlvdXMgaW5zdGFuY2Ugb2YgdGhpcyBsb2FkZXIgc28gd2UgY2FuIGRlc3Ryb3kKKyAgICAgICAgICAgICAgICAvLyBpdCB3aGVuIHRoZSBuZXcgb25lIGNvbXBsZXRlcy4KKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIiAgTWFraW5nIGluYWN0aXZlOiAiICsgaW5mbyk7CisgICAgICAgICAgICAgICAgbUluYWN0aXZlTG9hZGVycy5wdXQoaWQsIGluZm8pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpbmZvID0gY3JlYXRlTG9hZGVyKGlkLCBhcmdzLCAgKExvYWRlck1hbmFnZXIuTG9hZGVyQ2FsbGJhY2tzPE9iamVjdD4pY2FsbGJhY2spOworICAgICAgICByZXR1cm4gKExvYWRlcjxEPilpbmZvLm1Mb2FkZXI7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHN0b3BMb2FkZXIoaW50IGlkKSB7CisgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAic3RvcExvYWRlciBpbiAiICsgdGhpcyArICIgb2YgIiArIGlkKTsKKyAgICAgICAgaW50IGlkeCA9IG1Mb2FkZXJzLmluZGV4T2ZLZXkoaWQpOworICAgICAgICBpZiAoaWR4ID49IDApIHsKKyAgICAgICAgICAgIExvYWRlckluZm8gaW5mbyA9IG1Mb2FkZXJzLnZhbHVlQXQoaWR4KTsKKyAgICAgICAgICAgIG1Mb2FkZXJzLnJlbW92ZUF0KGlkeCk7CisgICAgICAgICAgICBpbmZvLmRlc3Ryb3koKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bmNoZWNrZWQiKQorICAgIHB1YmxpYyA8RD4gTG9hZGVyPEQ+IGdldExvYWRlcihpbnQgaWQpIHsKKyAgICAgICAgTG9hZGVySW5mbyBsb2FkZXJJbmZvID0gbUxvYWRlcnMuZ2V0KGlkKTsKKyAgICAgICAgaWYgKGxvYWRlckluZm8gIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIChMb2FkZXI8RD4pbUxvYWRlcnMuZ2V0KGlkKS5tTG9hZGVyOworICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKyAKKyAgICB2b2lkIGRvU3RhcnQoKSB7CisgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiU3RhcnRpbmc6ICIgKyB0aGlzKTsKKyAgICAgICAgaWYgKG1TdGFydGVkKSB7CisgICAgICAgICAgICBSdW50aW1lRXhjZXB0aW9uIGUgPSBuZXcgUnVudGltZUV4Y2VwdGlvbigiaGVyZSIpOworICAgICAgICAgICAgZS5maWxsSW5TdGFja1RyYWNlKCk7CisgICAgICAgICAgICBMb2cudyhUQUcsICJDYWxsZWQgZG9TdGFydCB3aGVuIGFscmVhZHkgc3RhcnRlZDogIiArIHRoaXMsIGUpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBDYWxsIG91dCB0byBzdWIgY2xhc3NlcyBzbyB0aGV5IGNhbiBzdGFydCB0aGVpciBsb2FkZXJzCisgICAgICAgIC8vIExldCB0aGUgZXhpc3RpbmcgbG9hZGVycyBrbm93IHRoYXQgd2Ugd2FudCB0byBiZSBub3RpZmllZCB3aGVuIGEgbG9hZCBpcyBjb21wbGV0ZQorICAgICAgICBmb3IgKGludCBpID0gbUxvYWRlcnMuc2l6ZSgpLTE7IGkgPj0gMDsgaS0tKSB7CisgICAgICAgICAgICBtTG9hZGVycy52YWx1ZUF0KGkpLnN0YXJ0KCk7CisgICAgICAgIH0KKyAgICAgICAgbVN0YXJ0ZWQgPSB0cnVlOworICAgIH0KKyAgICAKKyAgICB2b2lkIGRvU3RvcCgpIHsKKyAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJTdG9wcGluZzogIiArIHRoaXMpOworICAgICAgICBpZiAoIW1TdGFydGVkKSB7CisgICAgICAgICAgICBSdW50aW1lRXhjZXB0aW9uIGUgPSBuZXcgUnVudGltZUV4Y2VwdGlvbigiaGVyZSIpOworICAgICAgICAgICAgZS5maWxsSW5TdGFja1RyYWNlKCk7CisgICAgICAgICAgICBMb2cudyhUQUcsICJDYWxsZWQgZG9TdG9wIHdoZW4gbm90IHN0YXJ0ZWQ6ICIgKyB0aGlzLCBlKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGZvciAoaW50IGkgPSBtTG9hZGVycy5zaXplKCktMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgIG1Mb2FkZXJzLnZhbHVlQXQoaSkuc3RvcCgpOworICAgICAgICB9CisgICAgICAgIG1TdGFydGVkID0gZmFsc2U7CisgICAgfQorICAgIAorICAgIHZvaWQgZG9SZXRhaW4oKSB7CisgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiUmV0YWluaW5nOiAiICsgdGhpcyk7CisgICAgICAgIGlmICghbVN0YXJ0ZWQpIHsKKyAgICAgICAgICAgIFJ1bnRpbWVFeGNlcHRpb24gZSA9IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJoZXJlIik7CisgICAgICAgICAgICBlLmZpbGxJblN0YWNrVHJhY2UoKTsKKyAgICAgICAgICAgIExvZy53KFRBRywgIkNhbGxlZCBkb1JldGFpbiB3aGVuIG5vdCBzdGFydGVkOiAiICsgdGhpcywgZSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBtUmV0YWluaW5nID0gdHJ1ZTsKKyAgICAgICAgbVN0YXJ0ZWQgPSBmYWxzZTsKKyAgICAgICAgZm9yIChpbnQgaSA9IG1Mb2FkZXJzLnNpemUoKS0xOyBpID49IDA7IGktLSkgeworICAgICAgICAgICAgbUxvYWRlcnMudmFsdWVBdChpKS5yZXRhaW4oKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIGZpbmlzaFJldGFpbigpIHsKKyAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJGaW5pc2hlZCBSZXRhaW5pbmc6ICIgKyB0aGlzKTsKKworICAgICAgICBtUmV0YWluaW5nID0gZmFsc2U7CisgICAgICAgIGZvciAoaW50IGkgPSBtTG9hZGVycy5zaXplKCktMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgIG1Mb2FkZXJzLnZhbHVlQXQoaSkuZmluaXNoUmV0YWluKCk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgdm9pZCBkb0Rlc3Ryb3koKSB7CisgICAgICAgIGlmICghbVJldGFpbmluZykgeworICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJEZXN0cm95aW5nIEFjdGl2ZTogIiArIHRoaXMpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1Mb2FkZXJzLnNpemUoKS0xOyBpID49IDA7IGktLSkgeworICAgICAgICAgICAgICAgIG1Mb2FkZXJzLnZhbHVlQXQoaSkuZGVzdHJveSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIkRlc3Ryb3lpbmcgSW5hY3RpdmU6ICIgKyB0aGlzKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IG1JbmFjdGl2ZUxvYWRlcnMuc2l6ZSgpLTE7IGkgPj0gMDsgaS0tKSB7CisgICAgICAgICAgICBtSW5hY3RpdmVMb2FkZXJzLnZhbHVlQXQoaSkuZGVzdHJveSgp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OworCisgICAgICAgIC8vIExvb2sgZm9yIGFuIGluYWN0aXZlIGxvYWRlciBhbmQgZGVzdHJveSBpdCBpZiBmb3VuZAorICAgICAgICBpbnQgaWQgPSBsb2FkZXIuZ2V0SWQoKTsKKyAgICAgICAgTG9hZGVySW5mbzxEPiBpbmZvID0gbUluYWN0aXZlTG9hZGVycy5nZXQoaWQpOworICAgICAgICBpZiAoaW5mbyAhPSBudWxsKSB7CisgICAgICAgICAgICBMb2FkZXI8RD4gb2xkTG9hZGVyID0gaW5mby5sb2FkZXI7CisgICAgICAgICAgICBpZiAob2xkTG9hZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvbGRMb2FkZXIuZGVzdHJveSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUluYWN0aXZlTG9hZGVycy5yZW1vdmUoaWQpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25DcmVhdGUoQnVuZGxlIHNhdmVkU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRTdGF0ZSk7CisKKyAgICAgICAgaWYgKG1Mb2FkZXJzID09IG51bGwpIHsKKyAgICAgICAgICAgIC8vIExvb2sgZm9yIGEgcGFzc2VkIGFsb25nIGxvYWRlciBhbmQgY3JlYXRlIGEgbmV3IG9uZSBpZiBpdCdzIG5vdCB0aGVyZQorLy8gVE9ETzogdW5jb21tZW50IG9uY2UgZ2V0TGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSBtZXRob2QgaXMgYXZhaWxhYmxlCisvLyAgICAgICAgICAgIG1Mb2FkZXJzID0gKEhhc2hNYXA8SW50ZWdlciwgTG9hZGVySW5mbz4pIGdldExhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2UoKTsKKyAgICAgICAgICAgIGlmIChtTG9hZGVycyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUxvYWRlcnMgPSBuZXcgSGFzaE1hcDxJbnRlZ2VyLCBMb2FkZXJJbmZvPEQ+PigpOworICAgICAgICAgICAgICAgIG9uSW5pdGlhbGl6ZUxvYWRlcnMoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobUluYWN0aXZlTG9hZGVycyA9PSBudWxsKSB7CisgICAgICAgICAgICBtSW5hY3RpdmVMb2FkZXJzID0gbmV3IEhhc2hNYXA8SW50ZWdlciwgTG9hZGVySW5mbzxEPj4oKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uU3RhcnQoKSB7CisgICAgICAgIHN1cGVyLm9uU3RhcnQoKTsKKworICAgICAgICAvLyBDYWxsIG91dCB0byBzdWIgY2xhc3NlcyBzbyB0aGV5IGNhbiBzdGFydCB0aGVpciBsb2FkZXJzCisgICAgICAgIC8vIExldCB0aGUgZXhpc3RpbmcgbG9hZGVycyBrbm93IHRoYXQgd2Ugd2FudCB0byBiZSBub3RpZmllZCB3aGVuIGEgbG9hZCBpcyBjb21wbGV0ZQorICAgICAgICBmb3IgKEhhc2hNYXAuRW50cnk8SW50ZWdlciwgTG9hZGVySW5mbzxEPj4gZW50cnkgOiBtTG9hZGVycy5lbnRyeVNldCgpKSB7CisgICAgICAgICAgICBMb2FkZXJJbmZvPEQ+IGluZm8gPSBlbnRyeS5nZXRWYWx1ZSgpOworICAgICAgICAgICAgTG9hZGVyPEQ+IGxvYWRlciA9IGluZm8ubG9hZGVyOworICAgICAgICAgICAgaW50IGlkID0gZW50cnkuZ2V0S2V5KCk7CisgICAgICAgICAgICBpZiAobG9hZGVyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgIGxvYWRlciA9IG9uQ3JlYXRlTG9hZGVyKGlkLCBpbmZvLmFyZ3MpOworICAgICAgICAgICAgICAgaW5mby5sb2FkZXIgPSBsb2FkZXI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBsb2FkZXIucmVnaXN0ZXJMaXN0ZW5lcihpZCwgdGhpcyk7CisgICAgICAgICAgICBsb2FkZXIuc3RhcnRMb2FkaW5nKCk7CisgICAgICAgIH0KKworICAgICAgICBtU3RhcnRlZCA9IHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25TdG9wKCkgeworICAgICAgICBzdXBlci5vblN0b3AoKTsKKworICAgICAgICBmb3IgKEhhc2hNYXAuRW50cnk8SW50ZWdlciwgTG9hZGVySW5mbzxEPj4gZW50cnkgOiBtTG9hZGVycy5lbnRyeVNldCgpKSB7CisgICAgICAgICAgICBMb2FkZXJJbmZvPEQ+IGluZm8gPSBlbnRyeS5nZXRWYWx1ZSgpOworICAgICAgICAgICAgTG9hZGVyPEQ+IGxvYWRlciA9IGluZm8ubG9hZGVyOworICAgICAgICAgICAgaWYgKGxvYWRlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIExldCB0aGUgbG9hZGVyIGtub3cgd2UncmUgZG9uZSB3aXRoIGl0CisgICAgICAgICAgICBsb2FkZXIudW5yZWdpc3Rlckxpc3RlbmVyKHRoaXMpOworCisgICAgICAgICAgICAvLyBUaGUgbG9hZGVyIGlzbid0IGdldHRpbmcgcGFzc2VkIGFsb25nIHRvIHRoZSBuZXh0IGluc3RhbmNlIHNvIGFzayBpdCB0byBzdG9wIGxvYWRpbmcKKyAgICAgICAgICAgIGlmICghZ2V0QWN0aXZpdHkoKS5pc0NoYW5naW5nQ29uZmlndXJhdGlvbnMoKSkgeworICAgICAgICAgICAgICAgIGxvYWRlci5zdG9wTG9hZGluZygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgbVN0YXJ0ZWQgPSBmYWxzZTsKKyAgICB9CisKKyAgICAvKiBUTyBETzogVGhpcyBuZWVkcyB0byBiZSB0dXJuZWQgaW50byBhIHJldGFpbmVkIGZyYWdtZW50LgorICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBPYmplY3Qgb25SZXRhaW5Ob25Db25maWd1cmF0aW9uSW5zdGFuY2UoKSB7CisgICAgICAgIC8vIFBhc3MgdGhlIGxvYWRlciBhbG9uZyB0byB0aGUgbmV4dCBndXkKKyAgICAgICAgT2JqZWN0IHJlc3VsdCA9IG1Mb2FkZXJzOworICAgICAgICBtTG9hZGVycyA9IG51bGw7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorICAgICoqLworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25EZXN0cm95KCkgeworICAgICAgICBzdXBlci5vbkRlc3Ryb3koKTsKKworICAgICAgICBpZiAobUxvYWRlcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChIYXNoTWFwLkVudHJ5PEludGVnZXIsIExvYWRlckluZm88RD4+IGVudHJ5IDogbUxvYWRlcnMuZW50cnlTZXQoKSkgeworICAgICAgICAgICAgICAgIExvYWRlckluZm88RD4gaW5mbyA9IGVudHJ5LmdldFZhbHVlKCk7CisgICAgICAgICAgICAgICAgTG9hZGVyPEQ+IGxvYWRlciA9IGluZm8ubG9hZGVyOworICAgICAgICAgICAgICAgIGlmIChsb2FkZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbG9hZGVyLmRlc3Ryb3koKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFN0b3BzIGFuZCByZW1vdmVzIHRoZSBsb2FkZXIgd2l0aCB0aGUgZ2l2ZW4gSUQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc3RvcExvYWRpbmcoaW50IGlkKSB7CisgICAgICAgIGlmIChtTG9hZGVycyAhPSBudWxsKSB7CisgICAgICAgICAgICBMb2FkZXJJbmZvPEQ+IGluZm8gPSBtTG9hZGVycy5yZW1vdmUoaWQpOworICAgICAgICAgICAg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Z3VyYXRpb25JbnN0YW5jZSBmb3IgdGhlIGFjdGl2aXR5Ci0gICAgICAgICAgICBIYXNoTWFwPFN0cmluZyxPYmplY3Q+IGxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzID0KLSAgICAgICAgICAgICAgICBtUGFyZW50LmdldExhc3ROb25Db25maWd1cmF0aW9uQ2hpbGRJbnN0YW5jZXMoKTsKLSAgICAgICAgICAgIE9iamVjdCBpbnN0YW5jZSA9IG51bGw7CisgICAgICAgICAgICBIYXNoTWFwPFN0cmluZywgT2JqZWN0PiBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcyA9CisgICAgICAgICAgICAgICAgICAgIG1QYXJlbnQuZ2V0TGFzdE5vbkNvbmZpZ3VyYXRpb25DaGlsZEluc3RhbmNlcygpOworICAgICAgICAgICAgT2JqZWN0IGluc3RhbmNlT2JqID0gbnVsbDsKICAgICAgICAgICAgIGlmIChsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcy5nZXQoci5pZCk7CisgICAgICAgICAgICAgICAgaW5zdGFuY2VPYmogPSBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcy5nZXQoci5pZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3Rpdml0eS5Ob25Db25maWd1cmF0aW9uSW5zdGFuY2VzIGluc3RhbmNlID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChpbnN0YW5jZU9iaiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBuZXcgQWN0aXZpdHkuTm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcygpOworICAgICAgICAgICAgICAgIGluc3RhbmNlLmFjdGl2aXR5ID0gaW5zdGFuY2VPYmo7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAKICAgICAgICAgICAgIC8vIFdlIG5lZWQgdG8gaGF2ZSBhbHdheXMgY3JlYXRlZCB0aGUgYWN0aXZpdHkuCkBAIC0zNDYsNyArMzQ5LDcgQEAKICAgICB9CiAKICAgICBwcml2YXRlIFdpbmRvdyBwZXJmb3JtRGVzdHJveShMb2NhbEFjdGl2aXR5UmVjb3JkIHIsIGJvb2xlYW4gZmluaXNoKSB7Ci0gICAgICAgIFdpbmRvdyB3aW4gPSBudWxsOworICAgICAgICBXaW5kb3cgd2luOwogICAgICAgICB3aW4gPSByLndpbmRvdzsKICAgICAgICAgaWYgKHIuY3VyU3RhdGUgPT0gUkVTVU1FRCAmJiAhZmluaXNoKSB7CiAgICAgICAgICAgICBwZXJmb3JtUGF1c2UociwgZmluaXNoKTsKQEAgLTM4MCw3ICszODMsOCBAQAogICAgICAgICBpZiAociAhPSBudWxsKSB7CiAgICAgICAgICAgICB3aW4gPSBwZXJmb3JtRGVzdHJveShyLCBmaW5pc2gpOwogICAgICAgICAgICAgaWYgKGZpbmlzaCkgewotICAgICAgICAgICAgICAgIG1BY3Rpdml0aWVzLnJlbW92ZShyKTsKKyAgICAgICAgICAgICAgICBtQWN0aXZpdGllcy5yZW1vdmUoaWQpOworICAgICAgICAgICAgICAgIG1BY3Rpdml0eUFycmF5LnJlbW92ZShyKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gd2luOwpAQCAtNDQxLDEwICs0NDUsOCBAQAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoQ3JlYXRlKEJ1bmRsZSBzdGF0ZSkgewogICAgICAgICBpZiAoc3RhdGUgIT0gbnVsbCkgewotICAgICAgICAgICAgZmluYWwgSXRlcmF0b3I8U3RyaW5nPiBpID0gc3RhdGUua2V5U2V0KCkuaXRlcmF0b3IoKTsKLSAgICAgICAgICAgIHdoaWxlIChpLmhhc05leHQoKSkgeworICAgICAgICAgICAgZm9yIChTdHJpbmcgaWQgOiBzdGF0ZS5rZXlTZXQoKSkgewogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBpZCA9IGkubmV4dCgpOwogICAgICAgICAgICAgICAgICAgICBmaW5hbCBCdW5kbGUgYXN0YXRlID0gc3RhdGUuZ2V0QnVuZGxlKGlkKTsKICAgICAgICAgICAgICAgICAgICAgTG9jYWxBY3Rpdml0eVJlY29yZCByID0gbUFjdGl2aXRpZXMuZ2V0KGlkKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKHIgIT0gbnVsbCkgewpAQCAtNDU3LDkgKzQ1OSw3IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICAvLyBSZWNvdmVyIGZyb20gLWFsbC0gYXBwIGVycm9ycy4KLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAiRXhjZXB0aW9uIHRocm93biB3aGVuIHJlc3RvcmluZyBMb2NhbEFjdGl2aXR5TWFuYWdlciBzdGF0ZSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGUpOworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFeGNlcHRpb24gdGhyb3duIHdoZW4gcmVzdG9yaW5nIExvY2FsQWN0aXZpdHlNYW5hZ2VyIHN0YXRlIiwgZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvTm90aWZpY2F0aW9uLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9hcHAvTm90aWZpY2F0aW9uLmphdmEKaW5kZXggODU2OTQzZC4uZTYwMjUxOCAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvYXBwL05vdGlmaWNhdGlvbi5qYXZhCisrKyBiL2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yAgICAgKiBpbiBjb25qdW5jdGlvbiB3aXRoIHtAbGluayAjZnVsbFNjcmVlbkludGVudH0uCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRkxBR19ISUdIX1BSSU9SSVRZID0gMHgwMDAwMDA4MDsKKwogICAgIHB1YmxpYyBpbnQgZmxhZ3M7CiAKICAgICAvKioKQEAgLTMzNiw2ICszODQsMjEgQEAKICAgICAgICAgICAgIHRpY2tlclRleHQgPSBUZXh0VXRpbHMuQ0hBUl9TRVFVRU5DRV9DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwocGFyY2VsKTsKICAgICAgICAgfQogICAgICAgICBpZiAocGFyY2VsLnJlYWRJbnQoKSAhPSAwKSB7CisgICAgICAgICAgICB0aWNrZXJUaXRsZSA9IFRleHRVdGlscy5DSEFSX1NFUVVFTkNFX0NSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChwYXJjZWwpOworICAgICAgICB9CisgICAgICAgIGlmIChwYXJjZWwucmVhZEludCgpICE9IDApIHsKKyAgICAgICAgICAgIHRpY2tlclN1YnRpdGxlID0gVGV4dFV0aWxzLkNIQVJfU0VRVUVOQ0VfQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKHBhcmNlbCk7CisgICAgICAgIH0KKyAgICAgICAgZmluYWwgaW50IHRpY2tlckljb25Db3VudCA9IHBhcmNlbC5yZWFkSW50KCk7CisgICAgICAgIGlmICh0aWNrZXJJY29uQ291bnQgPj0gMCkgeworICAgICAgICAgICAgdGlja2VySWNvbnMgPSBuZXcgQml0bWFwW3RpY2tlckljb25Db3VudF07CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8dGlja2VySWNvbkNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBpZiAocGFyY2VsLnJlYWRJbnQoKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIHRpY2tlckljb25zW2ldID0gQml0bWFwLkNSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChwYXJjZWwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAocGFyY2VsLnJlYWRJbnQoKSAhPSAwKSB7CiAgICAgICAgICAgICBjb250ZW50VmlldyA9IFJlbW90ZVZpZXdzLkNSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChwYXJjZWwpOwogICAgICAgICB9CiAgICAgICAgIGRlZmF1bHRzID0gcGFyY2VsLnJlYWRJbnQoKTsKQEAgLTM3MSw2ICs0MzQsMTkgQEAKICAgICAgICAgaWYgKHRoaXMudGlja2VyVGV4dCAhPSBudWxsKSB7CiAgICAgICAgICAgICB0aGF0LnRpY2tlclRleHQgPSB0aGlzLnRpY2tlclRleHQudG9TdHJpbmcoKTsKICAgICAgICAgfQorICAgICAgICBpZiAodGhpcy50aWNrZXJUaXRsZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0aGF0LnRpY2tlclRpdGxlID0gdGhpcy50aWNrZXJUaXRsZS50b1N0cmluZygpOworICAgICAgICB9CisgICAgICAgIGlmICh0aGlzLnRpY2tlclN1YnRpdGxlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRoYXQudGlja2VyU3VidGl0bGUgPSB0aGlzLnRpY2tlclN1YnRpdGxlLnRvU3RyaW5nKCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHRoaXMudGlja2VySWNvbnMgIT0gbnVsbCkgeworICAgICAgICAgICAgZmluYWwgaW50IE4gPSB0aGlzLnRpY2tlckljb25zLmxlbmd0aDsKKyAgICAgICAgICAgIHRoYXQudGlja2VySWNvbnMgPSBuZXcgQml0bWFwW05dOworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgIHRoYXQudGlja2VySWNvbnNbaV0gPSBCaXRtYXAuY3JlYXRlQml0bWFwKHRoaXMudGlja2VySWNvbnNbaV0pOworICAgICAgICAgICAgfQorICAgICAgICB9CiAgICAgICAgIGlmICh0aGlzLmNvbnRlbnRWaWV3ICE9IG51bGwpIHsKICAgICAgICAgICAgIHRoYXQuY29udGVudFZpZXcgPSB0aGlzLmNvbnRlbnRWaWV3LmNsb25lKCk7CiAgICAgICAgIH0KQEAgLTQyNyw2ICs1MDMsMzIgQEAKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIHBhcmNlbC53cml0ZUludCgwKTsKICAgICAgICAgfQorICAgICAgICBpZiAodGlja2VyVGl0bGUgIT0gbnVsbCkgeworICAgICAgICAgICAgcGFyY2VsLndyaXRlSW50KDEpOworICAgICAgICAgICAgVGV4dFV0aWxzLndyaXRlVG9QYXJjZWwodGlja2VyVGl0bGUsIHBhcmNlbCwgZmxhZ3MpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcGFyY2VsLndyaXRlSW50KDApOworICAgICAgICB9CisgICAgICAgIGlmICh0aWNrZXJTdWJ0aXRsZSAhPSBudWxsKSB7CisgICAgICAgICAgICBwYXJjZWwud3JpdGVJbnQoMSk7CisgICAgICAgICAgICBUZXh0VXRpbHMud3JpdGVUb1BhcmNlbCh0aWNrZXJTdWJ0aXRsZSwgcGFyY2VsLCBmbGFncyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBwYXJjZWwud3JpdGVJbnQoMCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHRpY2tlckljb25zICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gdGlja2VySWNvbnMubGVuZ3RoOworICAgICAgICAgICAgcGFyY2VsLndyaXRlSW50KE4pOworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgIGlmICh0aWNrZXJJY29uc1tpXSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHBhcmNlbC53cml0ZUludCgxKTsKKyAgICAgICAgICAgICAgICAgICAgdGlja2VySWNvbnNbaV0ud3JpdGVUb1BhcmNlbChwYXJjZWwsIGZsYWdzKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBwYXJjZWwud3JpdGVJbnQoMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcGFyY2VsLndyaXRlSW50KC0xKTsKKyAgICAgICAgfQogICAgICAgICBpZiAoY29udGVudFZpZXcgIT0gbnVsbCkgewogICAgICAgICAgICAgcGFyY2VsLndyaXRlSW50KDEpOwogICAgICAgICAgICAgY29udGVudFZpZXcud3JpdGVUb1BhcmNlbChwYXJjZWwsIDApOwpAQCAtNTQzLDYgKzY0NSw5IEBACiAgICAgICAgIHNiLmFwcGVuZChJbnRlZ2VyLnRvSGV4U3RyaW5nKHRoaXMuZGVmYXVsdHMpKTsKICAgICAgICAgc2IuYXBwZW5kKCIsZmxhZ3M9MHgiKTsKICAgICAgICAgc2IuYXBwZW5kKEludGVnZXIudG9IZXhTdHJpbmcodGhpcy5mbGFncykpOworICAgICAgICBpZiAoKHRoaXMuZmxhZ3MgJiBGTEFHX0hJR0hfUFJJT1JJVFkpICE9IDApIHsKKyAgICAgICAgICAgIHNiLmFwcGVuZCgiISEhMSFvbmUhIik7CisgICAgICAgIH0KICAgICAgICAgc2IuYXBwZW5kKCIpIik7CiAgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOwogICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9Qcm9ncmVzc0RpYWxvZy5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvYXBwL1Byb2dyZXNzRGlhbG9nLmphdmEKaW5kZXggYmRlYTA2OS4uNGM1ZDI4ZSAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvYXBwL1Byb2dyZXNzRGlhbG9nLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvYXBwL1Byb2dyZXNzRGlhbG9nLmphdmEKQEAgLTE4LD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GluayAjc2V0UGFzc3dvcmRRdWFsaXR5fS4gVGhlCisgICAgICogZGVmYXVsdCB2YWx1ZSBpcyAwLgorICAgICAqIDxwPgorICAgICAqIFRoZSBjYWxsaW5nIGRldmljZSBhZG1pbiBtdXN0IGhhdmUgcmVxdWVzdGVkCisgICAgICoge0BsaW5rIERldmljZUFkbWluSW5mbyNVU0VTX1BPTElDWV9MSU1JVF9QQVNTV09SRH0gdG8gYmUgYWJsZSB0byBjYWxsCisgICAgICogdGhpcyBtZXRob2Q7IGlmIGl0IGhhcyBub3QsIGEgc2VjdXJpdHkgZXhjZXB0aW9uIHdpbGwgYmUgdGhyb3duLgorICAgICAqCisgICAgICogQHBhcmFtIGFkbWluIFdoaWNoIHtAbGluayBEZXZpY2VBZG1pblJlY2VpdmVyfSB0aGlzIHJlcXVlc3QgaXMgYXNzb2NpYXRlZAorICAgICAqICAgICAgICAgICAgd2l0aC4KKyAgICAgKiBAcGFyYW0gbGVuZ3RoIFRoZSBuZXcgZGVzaXJlZCBtaW5pbXVtIG51bWJlciBvZiB1cHBlciBjYXNlIGxldHRlcnMKKyAgICAgKiAgICAgICAgICAgIHJlcXVpcmVkIGluIHRoZSBwYXNzd29yZC4gQSB2YWx1ZSBvZiAwIG1lYW5zIHRoZXJlIGlzIG5vCisgICAgICogICAgICAgICAgICByZXN0cmljdGlvbi4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1VcHBlckNhc2UoQ29tcG9uZW50TmFtZSBhZG1pbiwgaW50IGxlbmd0aCkgeworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtU2VydmljZS5zZXRQYXNzd29yZE1pbmltdW1VcHBlckNhc2UoYWRtaW4sIGxlbmd0aCk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRB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B9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkZhaWxlZCB0YWxraW5nIHdpdGggZGV2aWNlIHBvbGljeSBzZXJ2aWNlIiwgZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXRyaWV2ZSB0aGUgY3VycmVudCBudW1iZXIgb2YgbGV0dGVycyByZXF1aXJlZCBpbiB0aGUgcGFzc3dvcmQgZm9yIGFsbAorICAgICAqIGFkbWlucyBvciBhIHBhcnRpY3VsYXIgb25lLiBUaGlzIGlzIHRoZSBzYW1lIHZhbHVlIGFzCisgICAgICogc2V0IGJ5IHsjbGluayB7QGxpbmsgI3NldFBhc3N3b3JkTWluaW11bUxldHRlcnMoQ29tcG9uZW50TmFtZSwgaW50KX0KKyAgICAgKiBhbmQgb25seSBhcHBsaWVzIHdoZW4gdGhlIHBhc3N3b3JkIHF1YWxpdHkgaXMKKyAgICAgKiB7QGxpbmsgI1BBU1NXT1JEX1FVQUxJVFlfQ09NUExFWH0uCisgICAgICoKKyAgICAgKiBAcGFyYW0gYWRtaW4gVGhlIG5hbWUgb2YgdGhlIGFkbWluIGNvbXBvbmVudCB0byBjaGVjaywgb3IgbnVsbCB0bworICAgICAqICAgICAgICAgICAgYWdncmVnYXRlIGFsbCBhZG1pbnMuCisgICAgICogQHJldHVybiBUaGUgbWluaW11bSBudW1iZXIgb2YgbGV0dGVycyByZXF1aXJlZCBpbiB0aGUgcGFzc3dvcmQuCisgICAgICovCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1MZXR0ZXJzKENvbXBvbmVudE5hbWUgYWRtaW4pIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldFBhc3N3b3JkTWluaW11bUxldHRlcnMoYWR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b2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0cmlldmUgdGhlIGN1cnJlbnQgbnVtYmVyIG9mIG51bWVyaWNhbCBkaWdpdHMgcmVxdWlyZWQgaW4gdGhlIHBhc3N3b3JkCisgICAgICogZm9yIGFsbCBhZG1pbnMgb3IgYSBwYXJ0aWN1bGFyIG9uZS4gVGhpcyBpcyB0aGUgc2FtZSB2YWx1ZSBhcworICAgICAqIHNldCBieSB7I2xpbmsge0BsaW5rICNzZXRQYXNzd29yZE1pbmltdW1OdW1lcmljKENvbXBvbmVudE5hbWUsIGludCl9CisgICAgICogYW5kIG9ubHkgYXBwbGllcyB3aGVuIHRoZSBwYXNzd29yZCBxdWFsaXR5IGlzCisgICAgICoge0BsaW5rICNQQVNTV09SRF9RVUFMSVRZX0NPTVBMRVh9LgorICAgICAqCisgICAgICogQHBhcmFtIGFkbWluIFRoZSBuYW1lIG9mIHRoZSBhZG1pbiBjb21wb25lbnQgdG8gY2hlY2ssIG9yIG51bGwgdG8KKyAgICAgKiAgICAgICAgICAgIGFnZ3JlZ2F0ZSBhbGwgYWRtaW5zLgorICAgICAqIEByZXR1cm4gVGhlIG1pbmltdW0gbnVtYmVyIG9mIG51bWVyaWNhbCBkaWdpdHMgcmVxdWlyZWQgaW4gdGhlIHBhc3N3b3JkLgorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRNaW5pbXVtTnVtZXJpYyhDb21wb25lbnROYW1lIGFkbWluKSB7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRQYXNzd29yZE1pbmltdW1OdW1lcmljKGFkbWluKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90Z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CBkZXZpY2UgcG9saWN5IHNlcnZpY2UiLCBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHJpZXZlIHRoZSBjdXJyZW50IG51bWJlciBvZiBzeW1ib2xzIHJlcXVpcmVkIGluIHRoZSBwYXNzd29yZCBmb3IgYWxsCisgICAgICogYWRtaW5zIG9yIGEgcGFydGljdWxhciBvbmUuIFRoaXMgaXMgdGhlIHNhbWUgdmFsdWUgYXMKKyAgICAgKiBzZXQgYnkgeyNsaW5rIHtAbGluayAjc2V0UGFzc3dvcmRNaW5pbXVtU3ltYm9scyhDb21wb25lbnROYW1lLCBpbnQpfQorICAgICAqIGFuZCBvbmx5IGFwcGxpZXMgd2hlbiB0aGUgcGFzc3dvcmQgcXVhbGl0eSBpcworICAgICAqIHtAbGluayAjUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYfS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhZG1pbiBUaGUgbmFtZSBvZiB0aGUgYWRtaW4gY29tcG9uZW50IHRvIGNoZWNrLCBvciBudWxsIHRvCisgICAgICogICAgICAgICAgICBhZ2dyZWdhdGUgYWxsIGFkbWlucy4KKyAgICAgKiBAcmV0dXJuIFRoZSBtaW5pbXVtIG51bWJlciBvZiBzeW1ib2xzIHJlcXVpcmVkIGluIHRoZSBwYXNzd29yZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bVN5bWJvbHMoQ29tcG9uZW50TmFtZSBhZG1pbikgeworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0UGFzc3dvcmRNaW5pbXVtU3ltYm9scyhhZG1pbik7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIk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AgICogdG8gc2V0IHRoZSBwcm94eSwgdGhlIHtAbGluayBDb21wb25lbnROYW1lfSBvZiB0aGUgYWRtaW4gb3JpZ2luYWxseSBzZXR0aW5nIHRoZQorICAgICAqIHByb3h5IHdpbGwgYmUgcmV0dXJuZWQuIElmIHN1Y2Nlc3NmdWwgaW4gc2V0dGluZyB0aGUgcHJveHksIG51bGwgd2lsbAorICAgICAqIGJlIHJldHVybmVkLgorICAgICAqIFRoZSBtZXRob2QgY2FuIGJlIGNhbGxlZCByZXBlYXRlZGx5IGJ5IHRoZSBkZXZpY2UgYWRtaW4gYWxyYWR5IHNldHRpbmcgdGhlCisgICAgICogcHJveHkgdG8gdXBkYXRlIHRoZSBwcm94eSBhbmQgZXhjbHVzaW9uIGxpc3QuCisgICAgICoKKyAgICAgKiBAcGFyYW0gYWRtaW4gV2hpY2gge0BsaW5rIERldmljZUFkbWluUmVjZWl2ZXJ9IHRoaXMgcmVxdWVzdCBpcyBhc3NvY2lhdGVkCisgICAgICogICAgICAgICAgICB3aXRoLgorICAgICAqIEBwYXJhbSBwcm94eVNwZWMgdGhlIGdsb2JhbCBwcm94eSBkZXNpcmVkLiBNdXN0IGJlIGFuIEhUVFAgUHJveHkuCisgICAgICogICAgICAgICAgICBQYXNzIFByb3h5Lk5PX1BST1hZIHRvIHJlc2V0IHRoZSBwcm94eS4KKyAgICAgKiBAcGFyYW0gZXhjbHVzaW9uTGlzdCBhIGxpc3Qgb2YgZG9tYWlucyB0byBiZSBleGNsdWRlZCBmcm9tIHRoZSBnbG9iYWwgcHJveHkuCisgICAgICogQHJldHVybiByZXR1cm5zIG51bGwgaWYgdGhlIHByb3h5IHdhcyBzdWNjZXNzZnVsbHkgc2V0LCBvciBhIHtAbGluayBDb21wb25lbnROYW1lfQorICAgICAqICAgICAgICAgICAgb2YgdGhlIGRldmljZSBhZG1pbiB0aGF0IHNldHMgdGhldyBwcm94eSBvdGhlcndpc2UuCisgICAgICovCisgICAgcHVibGljIENvbXBvbmVudE5hbWUgc2V0R2xvYmFsUHJveHkoQ29tcG9uZW50TmFtZSBhZG1pbiwgUHJveHkgcHJveHlTcGVjLAorICAgICAgICAgICAgTGlzdDxTdHJpbmc+IGV4Y2x1c2lvbkxpc3QgKSB7CisgICAgICAgIGlmIChwcm94eVNwZWMgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGhvc3RTcGVjOworICAgICAgICAgICAgICAgIFN0cmluZyBleGNsU3BlYzsKKyAgICAgICAgICAgICAgICBpZiAocHJveHlTcGVjLmVxdWFscyhQcm94eS5OT19QUk9YWSkpIHsKKyAgICAgICAgICAgICAgICAgICAgaG9zdFNwZWMgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBleGNsU3BlYyA9IG51bGw7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFwcm94eVNwZWMudHlwZSgpLmVxdWFscyhQcm94eS5UeXBlLkhUVFApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgSW5ldFNvY2tldEFkZHJlc3Mgc2EgPSAoSW5ldFNvY2tldEFkZHJlc3MpcHJveHlTcGVjLmFkZHJlc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGhvc3ROYW1lID0gc2EuZ2V0SG9zdE5hbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHBvcnQgPSBzYS5nZXRQb3J0KCk7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgaG9zdEJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgICAgICAgICBob3N0U3BlYyA9IGhvc3RCdWlsZGVyLmFwcGVuZChob3N0TmFtZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoIjoiKS5hcHBlbmQoSW50ZWdlci50b1N0cmluZyhwb3J0KSkudG9TdHJpbmcoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGV4Y2x1c2lvbkxpc3QgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZXhjbFNwZWMgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgbGlzdEJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBmaXJzdERvbWFpbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBleGNsRG9tYWluIDogZXhjbHVzaW9uTGlzdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZmlyc3REb21haW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdEJ1aWxkZXIgPSBsaXN0QnVpbGRlci5hcHBlbmQoIiwiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdERvbWFpbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0QnVpbGRlciA9IGxpc3RCdWlsZGVyLmFwcGVuZChleGNsRG9tYWluLnRyaW0oKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBleGNsU3BlYyA9IGxpc3RCdWlsZGVyLnRvU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC5uZXQuUHJveHkudmFsaWRhdGUoaG9zdE5hbWUsIEludGVnZXIudG9TdHJpbmcocG9ydCksIGV4Y2xTcGVjKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLnNldEdsb2JhbFByb3h5KGFkbWluLCBob3N0U3BlYywgZXhjbFNwZWMpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGNvbXBvbmVudCBuYW1lIHNldHRpbmcgdGhlIGdsb2JhbCBwcm94eS4KKyAgICAgKiBAcmV0dXJuIENvbXBvbmVudE5hbWUgb2JqZWN0IG9mIHRoZSBkZXZpY2UgYWRtaW4gdGhhdCBzZXQgdGhlIGdsb2JhbCBwcm94eSwgb3IKKyAgICAgKiAgICAgICAgICAgIG51bGwgaWYgbm8gYWRtaW4gaGFzIHNldCB0aGUgcHJveHkuCisgICAgICovCisgICAgcHVibGljIENvbXBvbmVudE5hbWUgZ2V0R2xvYmFsUHJveHlBZG1pbigpIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldEdsb2JhbFByb3h5QWRtaW4oKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRmFpbGVkIHRhbGtpbmcgd2l0aCBkZXZpY2UgcG9saWN5IHNlcnZpY2UiLCBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBAaGlkZQogICAgICAqLwpAQCAtNTQ5LDcgKzEwMTksNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogQGhpZGUKICAgICAgKi8KQEAgLTU2MiwxMCArMTAzMiwxMCBAQAogICAgICAgICAgICAgTG9nLncoVEFHLCAiVW5hYmxlIHRvIHJldHJpZXZlIGRldmljZSBwb2xpY3kgIiArIGNuLCBlKTsKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIFJlc29sdmVJbmZvIHJpID0gbmV3IFJlc29sdmVJbmZvKCk7CiAgICAgICAgIHJpLmFjdGl2aXR5SW5mbyA9IGFpOwotICAgICAgICAKKwogICAgICAgICB0cnkgewogICAgICAgICAgICAgcmV0dXJuIG5ldyBEZXZpY2VBZG1pbkluZm8obUNvbnRleHQsIHJpKTsKICAgICAgICAgfSBjYXRjaCAoWG1sUHVsbFBhcnNlckV4Y2VwdGlvbiBlKSB7CkBAIC01NzYsNyArMTA0Niw3IEBACiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIEBoaWRlCiAgICAgICovCkBAIC01OTMsMTYgKzEwNjMsMTggQEAKICAgICAvKioKICAgICAgKiBAaGlkZQogICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldEFjdGl2ZVBhc3N3b3JkU3RhdGUoaW50IHF1YWxpdHksIGludCBsZW5ndGgpIHsKKyAgICBwdWJsaWMgdm9pZCBzZXRBY3RpdmVQYXNzd29yZFN0YXRlKGludCBxdWFsaXR5LCBpbnQgbGVuZ3RoLCBpbnQgbGV0dGVycywgaW50IHVwcGVyY2FzZSwKKyAgICAgICAgICAgIGludCBsb3dlcmNhc2UsIGludCBudW1iZXJzLCBpbnQgc3ltYm9scywgaW50IG5vbmxldHRlcikgewogICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgewogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBtU2VydmljZS5zZXRBY3RpdmVQYXNzd29yZFN0YXRlKHF1YWxpdHksIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgbVNlcnZpY2Uuc2V0QWN0aXZlUGFzc3dvcmRTdGF0ZShxdWFsaXR5LCBsZW5ndGgsIGxldHRlcnMsIHVwcGVyY2FzZSwgbG93ZXJjYXNlLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVycywgc3ltYm9scywgbm9ubGV0dGVyKTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRmFpbGVkIHRhbGtpbmcgd2l0aCBkZXZpY2UgcG9saWN5IHNlcnZpY2UiLCBlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIEBoaWRlCiAgICAgICovCkBAIC02MTUsNyArMTA4Nyw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBAaGlkZQogICAgICAqLwpAQCAtNjI4LDQgKzExMDAsNSBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQorCiB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvYWRtaW4vSURldmljZVBvbGljeU1hbmFnZXIuYWlkbCBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9hZG1pbi9JRGV2aWNlUG9saWN5TWFuYWdlci5haWRsCmluZGV4IDZmYzRkYzUuLjNmY2Q2ZmMgMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmR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AgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigic3lzdGVtIHNlcnZlciBkZWFkPyIsIGUpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogTm90aWZpZXMgdGhlIHNwZWNpZmllZCBjb2xsZWN0aW9uIHZpZXcgaW4gYWxsIHRoZSBzcGVjaWZpZWQgQXBwV2lkZ2V0IGluc3RhbmNlCisgICAgICogdG8gaW52YWxpZGF0ZSBpdCdzIGN1cnJlbnRseSBkYXRhLgorICAgICAqCisgICAgICogQHBhcmFtIGFwcFdpZGdldElkICBUaGUgQXBwV2lkZ2V0IGluc3RhbmNlIGZvciB3aGljaCB0byBub3RpZnkgb2YgdmlldyBkYXRhIGNoYW5nZXMuCisgICAgICogQHBhcmFtIHZpZXdJZCAgICAgICAgVGhlIGNvbGxlY3Rpb24gdmlldyBpZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBub3RpZnlBcHBXaWRnZXRWaWV3RGF0YUNoYW5nZWQoaW50IGFwcFdpZGdldElkLCBpbnQgdmlld0lkKSB7CisgICAgICAgIG5vdGlmeUFwcFdpZGdldFZpZXdEYXRhQ2hhbmdlZChuZXcgaW50W10geyBhcHBXaWRnZXRJZCB9LCB2aWV3SWQpOworICAgIH0KKworICAgIC8qKgogICAgICAqIFJldHVybiBhIGxpc3Qgb2YgdGhlIEFwcFdpZGdldCBwcm92aWRlcnMgdGhhdCBhcmUgY3VycmVudGx5IGluc3RhbGxlZC4KICAgICAgKi8KICAgICBwdWJsaWMgTGlzdDxBcHBXaWRnZXRQcm92aWRlckluZm8+IGdldEluc3RhbGxlZFByb3ZpZGVycygpIHsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBzU2VydmljZS5nZXRJbnN0YWxsZWRQcm92aWRlcnMoKTsKKyAgICAgICAgICAgIExpc3Q8QXBwV2lkZ2V0UHJvdmlkZXJJbmZvPiBwcm92aWRlcnMgPSBzU2VydmljZS5nZXRJbn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KzExMCwxNyBAQAogICAgICAqIEBoaWRlIFBlbmRpbmcgQVBJIGFwcHJvdmFsCiAgICAgICovCiAgICAgcHVibGljIFN0cmluZyBvbGROYW1lOworICAgIAorICAgIC8qKgorICAgICAqIEEgcHJldmlldyBvZiB3aGF0IHRoZSBBcHBXaWRnZXQgd2lsbCBsb29rIGxpa2UgYWZ0ZXIgaXQncyBjb25maWd1cmVkLgorICAgICAqIElmIG5vdCBzdXBwbGllZCwgdGhlIEFwcFdpZGdldCdzIGljb24gd2lsbCBiZSB1c2VkLgorICAgICAqCisgICAgICogPHA+VGhpcyBmaWVsZCBjb3JyZXNwb25kcyB0byB0aGUgPGNvZGU+YW5kcm9pZDpwcmV2aWV3SW1hZ2U8L2NvZGU+IGF0dHJpYnV0ZSBpbgorICAgICAqIHRoZSA8Y29kZT4mbHQ7cmVjZWl2ZXImZ3Q7PC9jb2RlPiBlbGVtZW50IGluIHRoZSBBbmRyb2lkTWFuaWZlc3QueG1sIGZpbGUuCisgICAgICogCisgICAgICogQGhpZGUgUGVuZGluZyBBUEkgYXBwcm92YWwKKyAgICAgKi8KKwlwdWJsaWMgaW50IHByZXZpZXdJbWFnZTsKIAogICAgIHB1YmxpYyBBcHBXaWRnZXRQcm92aWRlckluZm8oKSB7CiAgICAgfQpAQCAtMTMwLDYgKzE0MSw3IEBACiAgICAgICAgIH0KICAgICAgICAgdGhpcy5sYWJlbCA9IGluLnJlYWRTdHJpbmcoKTsKICAgICAgICAgdGhpcy5pY29uID0gaW4ucmVhZEludCgpOworICAgICAgICB0aGlzLnByZXZpZXdJbWFnZSA9IGluLnJlYWRJbnQoKTsKICAgICB9CiAKIApAQCAtMTUyLDYgKzE2NCw3IEBACiAgICAgICAgIH0KICAgICAgICAgb3V0LndyaXRlU3RyaW5nKHRoaXMubGFiZWwpOwogICAgICAgICBvdXQud3JpdGVJbnQodGhpcy5pY29uKTsKKyAgICAgICAgb3V0LndyaXRlSW50KHRoaXMucHJldmlld0ltYWdlKTsKICAg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TZXJ2aWNlLmNvbm5lY3RTaW5rKGRldmljZSk7Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICBwdWJsaWMgYm9vbGVhbiBjb25uZWN0KEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJjb25uZWN0KCIgKyBkZXZpY2UgKyAiKSIpOworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCAmJiBpc0VuYWJsZWQoKSAmJgorICAgICAgICAgICAgaXNWYWxpZERldmljZShkZXZpY2UpKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5jb25uZWN0KGRldmljZSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlN0YWNrOiIgKyBMb2cuZ2V0U3RhY2tUcmFjZVN0cmluZyhuZXcgVGhyb3dhYmxlKCkpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgaWYgKG1TZXJ2aWNlID09IG51bGwpIExvZy53KFRBRywgIlByb3h5IG5vdCBhdHRhY2hlZCB0byBzZXJ2aWNlIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKLSAgICAvKiogSW5pdGlhdGUgZGlzY29ubmVjdCBmcm9tIGFuIEEyRFAgc2luay4KLSAgICAgKiAgTGlzdGVuIGZvciBTSU5LX1NUQVRFX0NIQU5HRURfQUNUSU9OIHRvIGZpbmQgb3V0IHdoZW4KLSAgICAgKiAgZGlzY29ubmVjdCBpcyBjb21wbGV0ZWQuCi0gICAgICogIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KLSAgICAgKiAgQHJldHVybiBmYWxzZSBvbiBpbW1lZGlhdGUgZXJyb3IsIHRydWUgb3RoZXJ3aXNlCi0gICAgICogIEBoaWRlCisgICAgLyoqCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqIEBoaWRlCiAgICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gZGlzY29ubmVjdFNpbmsoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgewotICAgICAgICBpZiAoREJHKSBsb2coImRpc2Nvbm5lY3RTaW5rKCIgKyBkZXZpY2UgKyAiKSIpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmRpc2Nvbm5lY3RTaW5rKGRldmljZSk7Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICBwdWJsaWMgYm9vbGVhbiBkaXNjb25uZWN0KEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJkaXNjb25uZWN0KCIgKyBkZXZpY2UgKyAiKSIpOworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCAmJiBpc0VuYWJsZWQoKSAmJgorICAgICAgICAgICAgaXNWYWxpZERldmljZShkZXZpY2UpKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5kaXNjb25uZWN0KGRldmljZSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlN0YWNrOiIgKyBMb2cuZ2V0U3RhY2tUcmFjZVN0cmluZyhuZXcgVGhyb3dhYmxlKCkpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgaWYgKG1TZXJ2aWNlID09IG51bGwpIExvZy53KFRBRywgIlByb3h5IG5vdCBhdHRhY2hlZCB0byBzZXJ2aWNlIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKLSAgICAvKiogSW5pdGlhdGUgc3VzcGVuZCBmcm9tIGFuIEEyRFAgc2luay4KLSAgICAgKiAgTGlzdGVuIGZvciBTSU5LX1NUQVRFX0NIQU5HRURfQUNUSU9OIHRvIGZpbmQgb3V0IHdoZW4KLSAgICAgKiAgc3VzcGVuZCBpcyBjb21wbGV0ZWQuCi0gICAgICogIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KLSAgICAgKiAgQHJldHVybiBmYWxzZSBvbiBpbW1lZGlhdGUgZXJyb3IsIHRydWUgb3RoZXJ3aXNlCi0gICAgICogIEBoaWRlCisgICAgLyoqCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqLworICAgIHB1YmxpYyBMaXN0PEJsdWV0b290aERldmljZT4gZ2V0Q29ubmVjdGVkRGV2aWNlcygpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJnZXRDb25uZWN0ZWREZXZpY2VzKCkiKTsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwgJiYgaXNFbmFibGVkKCkpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldENvbm5lY3RlZERldmljZXMoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiU3RhY2s6IiArIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQXJyYXlMaXN0PEJsdWV0b290aERldmljZT4oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor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KyAgICBwdWJsaWMgaW50IGdldENvbm5lY3Rpb25TdGF0ZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiZ2V0U3RhdGUoIiArIGRldmljZSArICIpIik7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsICYmIGlzRW5hYmxlZCgpCisgICAgICAgICAgICAmJiBpc1ZhbGlkRGV2aWNlKGRldmljZSkpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldENvbm5lY3Rpb25TdGF0ZShkZXZpY2UpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJTdGFjazoiICsgTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcobmV3IFRocm93YWJsZSgpKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aFByb2ZpbGUuU1RBVEVfRElTQ09OTkVDVEVEOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChtU2VydmljZSA9PSBudWxsKSBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc2VydmljZSIpOworICAgICAgICByZXR1cm4gQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9ESVNDT05ORUNURUQ7CisgICAgfQorCisgICAgLyoqCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gc2V0UHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwgaW50IHByaW9yaXR5KSB7CisgICAgICAgIGlmIChEQkcpIGxvZygic2V0UHJpb3JpdHkoIiArIGRldmljZSArICIsICIgKyBwcmlvcml0eSArICIpIik7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsICYmIGlzRW5hYmxlZCgpCisgICAgICAgICAgICAmJiBpc1ZhbGlkRGV2aWNlKGRldmljZSkpIHsKKyAgICAgICAgICAgIGlmIChwcmlvcml0eSAhPSBCbHVldG9vdGhQcm9maWxlLlBSSU9SSVRZX09GRiAmJgorICAgICAgICAgICAgICAgIHByaW9yaXR5ICE9IEJsdWV0b290aFByb2ZpbGUuUFJJT1JJVFlfT04pIHsKKyAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2Uuc2V0UHJpb3JpdHkoZGV2aWNlLCBwcmlvcml0eSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlN0YWNrOiIgKyBMb2cuZ2V0U3RhY2tUcmFjZVN0cmluZyhuZXcgVGhyb3dhYmxlKCkpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1TZXJ2aWNlID09IG51bGwpIExvZy53KFRBRywgIlByb3h5IG5vdCBhdHRhY2hlZCB0byBzZXJ2aWNlIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJnZXRQcmlvcml0eSgiICsgZGV2aWNlICsgIikiKTsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwgJiYgaXNFbmFibGVkKCkKKyAgICAgICAgICAgICYmIGlzVmFsaWREZXZpY2UoZGV2aWNlKSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0UHJpb3JpdHkoZGV2aWNlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiU3RhY2s6IiArIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhQcm9maWxlLlBSSU9SSVRZX09GRjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobVNlcnZpY2UgPT0gbnVsbCkgTG9nLncoVEFHLCAiUHJveHkgbm90IGF0dGFjaGVkIHRvIHNlcnZpY2UiKTsKKyAgICAgICAgcmV0dXJuIEJsdWV0b290aFByb2ZpbGUuUFJJT1JJVFlfT0ZGOworICAgIH0KKworICAgIC8qKgorICAgICAqIENoZWNrIGlmIEEyRFAgcHJvZmlsZSBpcyBzdHJlYW1pbmcgbXVzaWMuCisgICAgICoKKyAgICAgKiA8cD5SZXF1aXJlcyB7QGxpbmsgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uI0JMVUVUT09USH0KKyAgICAgKgorICAgICAqIEBwYXJhbSBkZXZpY2UgQmx1ZXRvb3RoRGV2aWNlIGRldmljZQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGlzQTJkcFBsYXlpbmcoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCAmJiBpc0VuYWJsZWQoKQorICAgICAgICAgICAgJiYgaXNWYWxpZERldmljZShkZXZpY2UpKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5pc0EyZHBQbGF5aW5nKGRldmljZSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlN0YW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jYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCAmJiBpc0VuYWJsZWQoKQorICAgICAgICAgICAgJiYgaXNWYWxpZERldmljZShkZXZpY2UpKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5yZXN1bWVTaW5rKGRldmljZSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlN0YWNrOiIgKyBMb2cuZ2V0U3RhY2tUcmFjZVN0cmluZyhuZXcgVGhyb3dhYmxlKCkpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiogQ2hlY2sgaWYgYSBzcGVjaWZpZWQgQTJEUCBzaW5rIGlzIGNvbm5lY3RlZC4KLSAgICAgKiAgQHBhcmFtIGRldmljZSBSZW1vdGUgQlQgZGV2aWNlLgotICAgICAqICBAcmV0dXJuIFRydWUgaWYgY29ubmVjdGVkIChvciBwbGF5aW5nKSwgZmFsc2Ugb3RoZXJ3aXNlIGFuZCBvbiBlcnJvci4KLSAgICAgKiAgQGhpZGUKLSAgICAgKi8KLSAgICBwdWJsaWMgYm9vbGVhbiBpc1NpbmtDb25uZWN0ZWQoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgewotICAgICAgICBpZiAoREJHKSBsb2coImlzU2lua0Nvbm5lY3RlZCgiICsgZGV2aWNlICsgIikiKTsKLSAgICAgICAgaW50IHN0YXRlID0gZ2V0U2lua1N0YXRlKGRldmljZSk7Ci0gICAgICAgIHJldHVybiBzdGF0ZSA9PSBTVEFURV9DT05ORUNURUQgfHwgc3RhdGUgPT0g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0gICAgICAgIGlmIChEQkcpIGxvZygiZ2V0Tm9uRGlzY29ubmVjdGVkU2lua3MoKSIpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIENvbGxlY3Rpb25zLnVubW9kaWZpYWJsZVNldCgKLSAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8Qmx1ZXRvb3RoRGV2aWNlPihBcnJheXMuYXNMaXN0KG1TZXJ2aWNlLmdldE5vbkRpc2Nvbm5lY3RlZFNpbmtzKCkpKSk7Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqIEdldCB0aGUgc3RhdGUgb2YgYW4gQTJEUCBzaW5rCi0gICAgICogIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KLSAgICAgKiAgQHJldHVybiBTdGF0ZSBjb2RlLCBvbmUgb2YgU1RBVEVfCi0gICAgICogIEBoaWRlCi0gICAgICovCi0gICAgcHVibGljIGludCBnZXRTaW5rU3RhdGUoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgewotICAgICAgICBpZiAoREJHKSBsb2coImdldFNpbmtTdGF0ZSgiICsgZGV2aWNlICsgIikiKTsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRTaW5rU3RhdGUoZGV2aWNlKTsKLSAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOwotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEOwotICAgICAgICB9CisgICAgICAgIGlmIChtU2VydmljZSA9PSBudWxsKSBMb2cudyhUQUcsICJQcm94eSBub3Qg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FNpbmtQcmlvcml0eShCbHVldG9vdGhEZXZpY2UgZGV2aWNlLCBpbnQgcHJpb3JpdHkpIHsKLSAgICAgICAgaWYgKERCRykgbG9nKCJzZXRTaW5rUHJpb3JpdHkoIiArIGRldmljZSArICIsICIgKyBwcmlvcml0eSArICIpIik7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICByZXR1cm4gbVNlcnZpY2Uuc2V0U2lua1ByaW9yaXR5KGRldmljZSwgcHJpb3JpdHkpOwotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgcHVibGljIGJvb2xlYW4gc2hvdWxkU2VuZFZvbHVtZUtleXMoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBpZiAoaXNFbmFibGVkKCkgJiYgaXNWYWxpZERldmljZShkZXZpY2UpKSB7CisgICAgICAgICAgICBQYXJjZWxVdWlkW10gdXVpZHMgPSBkZXZpY2UuZ2V0VXVpZHMoKTsKKyAgICAgICAgICAgIGlmICh1dWlkcyA9PSBudWxsKSByZXR1cm4gZmFsc2U7CisKKyAgICAgICAgICAgIGZvciAoUGFyY2VsVXVpZCB1dWlkOiB1dWlkcykgeworICAgICAgICAgICAgICAgIGlmIChCbHVldG9vdGhVdWlkLmlzQXZyY3BUYXJnZXQodXVpZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBHZXQgcHJpb3JpdHkgb2YgYTJkcCBzaW5rLgotICAgICAqIEBwYXJhbSBkZXZpY2UgU2luawotICAgICAqIEByZXR1cm4gbm9uLW5lZ2F0aXZlIHByaW9yaXR5LCBvciBuZWdhdGl2ZSBlcnJvciBjb2RlIG9uIGVycm9yLgotICAgICAqLwotICAgIHB1YmxpYyBpbnQgZ2V0U2lua1ByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKLSAgICAgICAgaWYgKERCRykgbG9nKCJnZXRTaW5rUHJpb3JpdHkoIiArIGRldmljZSArICIpIik7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0U2lua1ByaW9yaXR5KGRldmljZSk7Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKLSAgICAgICAgICAgIHJldHVybiBQUklPUklUWV9PRkY7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiogSGVscGVyIGZvciBjb252ZXJ0aW5nIGEgc3RhdGUgdG8gYSBzdHJpbmcuCisgICAgIC8qKgorICAgICAqIEhlbHBlciBmb3IgY29udmVydGluZyBhIHN0YXRlIHRvIGEgc3RyaW5nLgorICAgICAqCiAgICAgICogRm9yIGRlYnVnIHVzZSBvbmx5IC0gc3RyaW5ncyBhcmUgbm90IGludGVybmF0aW9uYWxpemVkLgogICAgICAqIEBoaWRlCiAgICAgICovCkBAIC0yODUsMTIgKzM3NCwyNiBAQAogICAgICAgICAgICAgcmV0dXJuICJkaXNjb25uZWN0aW5nIjsKICAgICAgICAgY2FzZSBTVEFURV9QTEFZSU5HOgogICAgICAgICAgICAgcmV0dXJuICJwbGF5aW5nIjsKKyAgICAgICAgY2FzZSBTVEFURV9OT1RfUExBWUlORzoKKyAgICAgICAgICByZXR1cm4gIm5vdCBwbGF5aW5nIjsKICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgIHJldHVybiAiPHVua25vd24gc3RhdGUgIiArIHN0YXRlICsgIj4iOwogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSBib29sZWFuIGlzRW5hYmxlZCgpIHs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AgaWYgKHByb2ZpbGUgPT0gQmx1ZXRvb3RoUHJvZmlsZS5IRUFEU0VUKSB7CisgICAgICAgICAgICBCbHVldG9vdGhIZWFkc2V0IGhlYWRzZXQgPSBuZXcgQmx1ZXRvb3RoSGVhZHNldChjb250ZXh0LCBsaXN0ZW5lcik7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIGlmIChwcm9maWxlID09IEJsdWV0b290aFByb2ZpbGUuQTJEUCkgeworICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcCBhMmRwID0gbmV3IEJsdWV0b290aEEyZHAoY29udGV4dCwgbGlzdGVuZXIpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDbG9zZSB0aGUgY29ubmVjdGlvbiBvZiB0aGUgcHJvZmlsZSBwcm94eSB0byB0aGUgU2VydmljZS4KKyAgICAgKgorICAgICAqIDxwPiBDbGllbnRzIHNob3VsZCBjYWxsIHRoaXMgd2hlbiB0aGV5IGFyZSBubyBsb25nZXIgdXNpbmcKKyAgICAgKiB0aGUgcHJveHkgb2J0YWluZWQgZnJvbSB7QGxpbmsgI2dldFByb2ZpbGVQcm94eX0uCisgICAgICogUHJvZmlsZSBjYW4gYmUgb25lIG9mIHtAbGluayBCbHVldG9vdGhQcm9maWxlI0hFQURTRVR9IG9yCisgICAgICoge0BsaW5rIEJsdWV0b290aFByb2ZpbGUjQTJEUH0KKyAgICAgKgorICAgICAqIEBwYXJhbSBwcm9maWxlCisgICAgICogQHBhcmFtIHByb3h5IFByb2ZpbGUgcHJveHkgb2JqZWN0CisgICAgICovCisgICAgcHVibGljIHZvaWQgY2xvc2VQcm9maWxlUHJveHkoaW50IHByb2ZpbGUsIEJsdWV0b290aFByb2ZpbGUgcHJveHkpIHsKKyAgICAgICAgaWYgKHByb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bHVldG9vdGhEZXZpY2UuRVhUUkFfREVWSUNFKTsKICAgICAgICAgICAgIGlmICghZGV2aWNlLmVxdWFscyhtRGV2aWNlKSkgcmV0dXJuOwogCi0gICAgICAgICAgICBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhIZWFkc2V0LkFDVElPTl9TVEFURV9DSEFOR0VEKSkgewotICAgICAgICAgICAgICAgIGludCBuZXdTdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhIZWFkc2V0LkVYVFJBX1NUQVRFLCAwKTsKLSAgICAgICAgICAgICAgICBpbnQgb2xkU3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoSGVhZHNldC5FWFRSQV9QUkVWSU9VU19TVEFURSwgMCk7Ci0gICAgICAgICAgICAgICAgaW50IGluaXRpYXRvciA9IGludGVudC5nZXRJbnRFeHRyYSgKLSAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoSGVhZHNldC5FWFRSQV9ESVNDT05ORUNUX0lOSVRJQVRPUiwKLSAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoSGVhZHNldC5MT0NBTF9ESVNDT05ORUNUKTsKLSAgICAgICAgICAgICAgICBtSGVhZHNldFN0YXRlID0gbmV3U3RhdGU7Ci0gICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlID09IEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRElTQ09OTkVDVEVEICYmCi0gICAgICAgICAgICAgICAgICAgIGluaXRpYXRvciA9PSBCbHVldG9vdGhIZWFkc2V0LlJFTU9URV9ESVNDT05ORUNUKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKERJU0NPTk5FQ1RfSEZQX0lOQ09NSU5HKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlID09IEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQ09OTkVDVEVEIHx8Ci0gICAgICAgICAgICAgICAgICAgIG5ld1N0YXRlID09IEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRElTQ09OTkVDVEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKFRSQU5TSVRJT05fVE9fU1RBQkxFKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoQTJkcC5BQ1RJT05fU0lOS19TVEFURV9DSEFOR0VEKSkgewotICAgICAgICAgICAgICAgIGludCBuZXdTdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhBMmRwLkVYVFJBX1NJTktfU1RBVEUsIDApOwotICAgICAgICAgICAgICAgIGludCBvbGRTdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhBMmRwLkVYVFJBX1BSRVZJT1VTX1NJTktfU1RBVEUsIDApOworICAgICAgICAgICAgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoQTJkcC5BQ1RJT05fQ09OTkVDVElPTl9TVEFURV9DSEFOR0VEKSkgeworICAgICAgICAgICAgICAgIGludCBuZXdTdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhQcm9maWxlLkVYVFJBX1NUQVRFLCAwKTsKKyAgICAgICAgICAgICAgICBpbnQgb2xkU3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoUHJvZmlsZS5FWFRSQV9QUkVWSU9VU19TVEFURSwgMCk7CiAgICAgICAgICAgICAgICAgbUEyZHBTdGF0ZSA9IG5ld1N0YXRlOwotICAgICAgICAgICAgICAgIGlmICgob2xkU3RhdGUgPT0gQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUQgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sZFN0YXRlID09IEJsdWV0b290aEEyZHAuU1RBVEVfUExBWUlORykgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1N0YXRlID09IEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEKSB7CisgICAgICAgICAgICAgICAgaWYgKG9sZFN0YXRlID09IEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVEICYmCisgICAgICAgICAgICAgICAgICAgIG5ld1N0YXRlID09IEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEKSB7CiAgICAgICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKERJU0NPTk5FQ1RfQTJEUF9JTkNPTUlORyk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRCB8fAotICAgICAgICAgICAgICAgICAgICBuZXdTdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX0RJU0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA9PSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RFRCB8fAorICAgICAgICAgICAgICAgICAgICBuZXdTdGF0ZSA9PSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0RJU0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShUUkFOU0lUSU9OX1RPX1NUQUJMRSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEJsdWV0b290aEhlYWRzZXQuQUNUSU9OX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRCkpIHsKKyAgICAgICAgICAgICAgICBpbnQgbmV3U3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoUHJvZmlsZS5FWFRSQV9TVEFURSwgMCk7CisgICAgICAgICAgICAgICAgaW50IG9sZFN0YXRlID0gaW50ZW50LmdldEludEV4dHJhKEJsdWV0b290aFByb2ZpbGUuRVhUUkFfUFJFVklPVVNfU1RBVEUsIDApOworCisgICAgICAgICAgICAgICAgbUhlYWRzZXRTdGF0ZSA9IG5ld1N0YXRlOworICAgICAgICAgICAgICAgIGlmIChvbGRTdGF0ZSA9PSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RFRCAmJgorICAgICAgICAgICAgICAgICAgICBuZXdTdGF0ZSA9PSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0RJU0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShESVNDT05ORUNUX0hGUF9JTkNPTUlORyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA9PSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RFRCB8fAorICAgICAgICAgICAgICAgICAgICBuZXdTdGF0ZSA9PSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0RJU0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShUUkFOU0lUSU9OX1RPX1NUQUJMRSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEJsdWV0b290aElucHV0RGV2aWNlLkFDVElPTl9JTlBVVF9ERVZJQ0VfU1RBVEVfQ0hBTkdFRCkpIHsKKyAgICAgICAgICAgICAgICBpbnQgbmV3U3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoSW5wdXREZXZpY2UuRVhUUkFfSU5QVVRfREVWSUNFX1NUQVRFLCAwKTsKKyAgICAgICAgICAgICAgICBpbnQgb2xkU3RhdGUgPQorICAgICAgICAgICAgICAgICAgICBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoSW5wdXREZXZpY2UuRVhUUkFfUFJFVklPVVNfSU5QVVRfREVWSUNFX1NUQVRFLCAwKTsKKyAgICAgICAgICAgICAgICBtSGlkU3RhdGUgPSBuZXdTdGF0ZTsKKyAgICAgICAgICAgICAgICBpZiAob2xkU3RhdGUgPT0gQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfQ09OTkVDVEVEICYmCisgICAgICAgICAgICAgICAgICAgIG5ld1N0YXRlID09IEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0RJU0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShESVNDT05ORUNUX0hJRF9JTkNPTUlORyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA9PSBCbHVldG9vdGhJbnB1dERldmljZS5TVEFURV9DT05ORUNURUQgfHwKKyAgICAgICAgICAgICAgICAgICAgbmV3U3RhdGUgPT0gQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfRElTQ09OTkVDVEVEKSB7CiAgICAgICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKFRSQU5TSVRJT05fVE9fU1RBQkxFKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoRGV2aWNlLkFDVElPTl9BQ0xfQ09OTkVDVEVEKSkgewpAQCAtMTY5LDM2ICsxODksNDAgQEAKICAgICAgICAgYWRkU3RhdGUobUluY29taW5nSGFuZHNmcmVlKTsKICAgICAgICAgYWRkU3RhdGUobUluY29taW5nQTJkcCk7CiAgICAgICAgIGFkZFN0YXRlKG1PdXRnb2luZ0EyZHApOworICAgICAgICBhZGRTdGF0ZShtT3V0Z29pbmdIaWQpOworICAgICAgICBhZGRTdGF0ZShtSW5jb21pbmdIaWQpOwogICAgICAgICBzZXRJbml0aWFsU3RhdGUobUJvbmRlZERldmljZSk7CiAKICAgICAgICAgSW50ZW50RmlsdGVyIGZpbHRlciA9IG5ldyBJbnR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HVldG9vdGhIZWFkc2V0KSBwcm94eTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VEaXNjb25uZWN0ZWQoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIG9uU2VydmljZURpc2Nvbm5lY3RlZChpbnQgcHJvZmlsZSkgewogICAgICAgICAgICAgc3luY2hyb25pemVkKEJsdWV0b290aERldmljZVByb2ZpbGVTdGF0ZS50aGlzKSB7Ci0gICAgICAgICAgICAgICAgbUhlYWRzZXRTZXJ2aWNlQ29ubmVjdGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgbUhlYWRzZXRTZXJ2aWNlID0gbnVsbDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgIH0KKyAgICB9OwogCiAgICAgcHJpdmF0ZSBjbGFzcyBQYmFwU2VydmljZUxpc3RlbmVyIGltcGxlbWVudHMgQmx1ZXRvb3RoUGJhcC5TZXJ2aWNlTGlzdGVuZXIgewogICAgICAgICBwdWJsaWMgUGJhcFNlcnZpY2VMaXN0ZW5lcigpIHsKQEAgLTI0Niw2ICsyNzAsMTQgQEAKICAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfQTJEUF9JTkNPTUlORzoKICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1JbmNvbWluZ0EyZHApOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfSElEX09VVEdPSU5HOgorICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9ISURfT1VUR09JTkc6CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtT3V0Z29pbmdIaWQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfSElEX0lOQ09NSU5HOgorICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9ISURfSU5DT01JTkc6CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtSW5jb21pbmdIaWQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfUEJBUF9PVVRHT0lORzoKICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc0NvbW1hbmQoRElTQ09OTkVDVF9QQkFQX09VVEdPSU5HKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC0yNTgsNiArMjkwLDEwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShESVNDT05ORUNUX0EyRFBfT1VUR09JTkcpOwogICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobUhpZFN0YXRlICE9IEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0RJU0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2UoRElTQ09OTkVDVF9ISURfT1VUR09JTkcpOworICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc0NvbW1hbmQoVU5QQUlSKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC0yNjUsMjEgKzMwMSwyOSBAQAogICAgICAgICAgICAgICAgICAgICBpZiAoaXNQaG9uZURvY2tlZChtRGV2aWNlKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG9uJ3QgYXV0byBjb25uZWN0IHRvIGRvY2tzLgogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIW1IZWFkc2V0U2VydmljZUNvbm5lY3RlZCkgeworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1IZWFkc2V0U2VydmljZSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UobWVzc2FnZSk7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUhlYWRzZXRTZXJ2aWNlLmdldFByaW9yaXR5KG1EZXZpY2UpID09CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhIZWFkc2V0LlBSSU9SSVRZX0FVVE9fQ09OTkVDVCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIW1IZWFkc2V0U2VydmljZS5pc0Nvbm5lY3RlZChtRGV2aWNlKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkhlYWRzZXQ6QXV0byBDb25uZWN0IFByb2ZpbGVzIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhlYWRzZXRTZXJ2aWNlLmNvbm5lY3RIZWFkc2V0KG1EZXZpY2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhlYWRzZXRTZXJ2aWNlLmdldERldmljZXNNYXRjaGluZ0Nvbm5lY3Rpb25TdGF0ZXMoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IGludFtdIHtCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aFByb2ZpbGUuU1RBVEVfQ09OTkVDVElORywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aFByb2ZpbGUuU1RBVEVfRElTQ09OTkVDVElOR30pLnNpemUoKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhlYWRzZXRTZXJ2aWNlLmNvbm5lY3QobURldmljZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUEyZHBTZXJ2aWNlICE9IG51bGwgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BMmRwU2VydmljZS5nZXRTaW5rUHJpb3JpdHkobURldmljZSkgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BMmRwU2VydmljZS5nZXRQcmlvcml0eShtRGV2aWNlKSA9PQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcC5QUklPUklUWV9BVVRPX0NPTk5FQ1QgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BMmRwU2VydmljZS5nZXRDb25uZWN0ZWRTaW5rcygpLmxlbmd0aCA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiQTJkcDpBdXRvIENvbm5lY3QgUHJvZmlsZXMiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQTJkcFNlcnZpY2UuY29ubmVjdFNpbmsobURldmljZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQTJkcFNlcnZpY2UuZ2V0RGV2aWNlc01hdGNoaW5nQ29ubmVjdGlvblN0YXRlcygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgaW50W10ge0JsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9DT05ORUNUSU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9ESVNDT05ORUNUSU5HfSkuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQTJkcFNlcnZpY2UuY29ubmVjdChtRGV2aWNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU2VydmljZS5nZXRJbnB1dERldmljZVByaW9yaXR5KG1EZXZpY2UpID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9BVVRPX0NPTk5FQ1QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2VydmljZS5jb25uZWN0SW5wdXREZXZpY2UobURldmljZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC0yODksMTcgKzMzMywxNyBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmFyZzEgPT0gQ09OTkVDVF9BMkRQX09VVEdPSU5HKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUEyZHBTZXJ2aWNlICE9IG51bGwgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQTJkcFNlcnZpY2UuZ2V0Q29ubmVjdGVkU2lua3MoKS5sZW5ndGggPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BMmRwU2VydmljZS5nZXRDb25uZWN0ZWREZXZpY2VzKCkuc2l6ZSgpID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJBMmRwOkNvbm5lY3QgT3RoZXIgUHJvZmlsZXMiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQTJkcFNlcnZpY2UuY29ubmVjdFNpbmsobURldmljZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUEyZHBTZXJ2aWNlLmNvbm5lY3QobURldmljZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5hcmcxID09IENPTk5FQ1RfSEZQX09VVEdPSU5HKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1IZWFkc2V0U2VydmljZUNvbm5lY3RlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1IZWFkc2V0U2VydmljZSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1IZWFkc2V0U2VydmljZS5pc0Nvbm5lY3RlZChtRGV2aWNlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtSGVhZHNldFNlcnZpY2UuZ2V0Q29ubmVjdGVkRGV2aWNlcygpLnNpemUoKSA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkhlYWRzZXQ6Q29ubmVjdCBPdGhlciBQcm9maWxlcyIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZHNldFNlcnZpY2UuY29ubmVjdEhlYWRzZXQobURldmljZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkc2V0U2VydmljZS5jb25uZWN0KG1EZXZpY2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMzk0LDYgKzQzOCwyMyBAQAogICAgICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UoZGVmZXJNc2cpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVF9ISURfT1VUR09JTkc6CisgICAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0hJRF9PVVRHT0lORzoKKyAgICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfSElEX0lOQ09NSU5HOgorICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obUluY29taW5nSGlkKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1TdGF0dXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVyTXNnLndoYXQgPSBtQ29tbWFuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVyTWVzc2FnZShkZWZlck1zZyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0hJRF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1TdGF0dXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVyTXNnLndoYXQgPSBtQ29tbWFuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVyTWVzc2FnZShkZWZlck1zZyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7IC8vIGlnbm9yZQogICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9QQkFQX09VVEdPSU5HOgogICAgICAgICAgICAgICAgIGNhc2UgVU5QQUlSOgogICAgICAgICAgICAgICAgIGNhc2UgQVVUT19DT05ORUNUX1BST0ZJTEVTOgpAQCAtNDY3LDYgKzUyOCwxMyBAQAogICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGlzIGNhdXNlcyBpbmNvbWluZyBIRlAgdG8gZmFpbCwgaXQgaXMgbW9yZSBvZiBhIGhlYWRzZXQgcHJvYmxlbQogICAgICAgICAgICAgICAgICAgICAvLyBzaW5jZSBib3RoIGNvbm5lY3Rpb25zIGFyZSBpbmNvbWluZyBvbmVzLgogICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfSElEX09VVEdPSU5HOgorICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9ISURfT1VUR09JTkc6CisgICAgICAgICAgICAgICAgICAgIGRlZmVyTWVzc2FnZShtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDT05ORUNUX0hJRF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfSElEX0lOQ09NSU5HOgorICAgICAgICAgICAgICAgICAgICAgYnJlYWs7IC8vIGlnbm9yZQogICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9QQkFQX09VVEdPSU5HOgogICAgICAgICAgICAgICAgIGNhc2UgVU5QQUlSOgogICAgICAgICAgICAgICAgIGNhc2UgQVVUT19DT05ORUNUX1BST0ZJTEVTOgpAQCAtNTYwLDYgKzYyOCwyMyBAQAogICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9BMkRQX0lOQ09NSU5HOgogICAgICAgICAgICAgICAgICAgICAvLyBJZ25vcmUsIHdpbGwgYmUgaGFuZGxlZCBieSBCbHVlegogICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfSElEX09VVEdPSU5HOgorICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9ISURfT1VUR09JTkc6CisgICAgICAgICAgICAgICAgICAgIGRlZmVyTWVzc2FnZShtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDT05ORUNUX0hJRF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1JbmNvbWluZ0hpZCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtU3RhdHVzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZlck1zZy53aGF0ID0gbUNvbW1hbmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UoZGVmZXJNc2cpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9ISURfSU5DT01JTkc6CisgICAgICAgICAgICAgICAgICAgIGlmIChtU3RhdHVzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZlck1zZy53aGF0ID0gbUNvbW1hbmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UoZGVmZXJNc2cpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOyAvLyBpZ25vcmUKICAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfUEJBUF9PVVRHT0lORzoKICAgICAgICAgICAgICAgICBjYXNlIFVOUEFJUjoKICAgICAgICAgICAgICAgICBjYXNlIEFVVE9fQ09OTkVDVF9QUk9GSUxFUzoKQEAgLTYzMSw2ICs3MTYsMTMgQEAKICAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfQTJEUF9JTkNPTUlORzoKICAgICAgICAgICAgICAgICAgICAgLy8gSWdub3JlLCB3aWxsIGJlIGhhbmRsZWQgYnkgQmx1ZXoKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDT05ORUNUX0hJRF9PVVRHT0lORzoKKyAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfSElEX09VVEdPSU5HOgorICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UobWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVF9ISURfSU5DT01JTkc6CisgICAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0hJRF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICAgICAgIGJyZWFrOyAvLyBpZ25vcmUKICAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfUEJBUF9PVVRHT0lORzoKICAgICAgICAgICAgICAgICBjYXNlIFVOUEFJUjoKICAgICAgICAgICAgICAgICBjYXNlIEFVVE9fQ09OTkVDVF9QUk9GSUxFUzoKQEAgLTY0OCwxMSArNzQwLDE1MCBAQAogICAgIH0KIAogCisgICAgcHJpdmF0ZSBjbGFzcyBPdXRnb2luZ0hpZCBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1TdGF0dXMgPSBmYWxzZTsKKyAgICAgICAgcHJpdmF0ZSBpbnQgbUNvbW1hbmQ7CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgbG9nKCJFbnRlcmluZyBPdXRnb2luZ0hpZCBzdGF0ZSB3aXRoOiAiICsgZ2V0Q3VycmVudE1lc3NhZ2UoKS53aGF0KTsKKyAgICAgICAgICAgIG1Db21tYW5kID0gZ2V0Q3VycmVudE1lc3NhZ2UoKS53aGF0OworICAgICAgICAgICAgaWYgKG1Db21tYW5kICE9IENPTk5FQ1RfSElEX09VVEdPSU5HICYmCisgICAgICAgICAgICAgICAgbUNvbW1hbmQgIT0gRElTQ09OTkVDVF9ISURfT1VUR09JTkcpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvcjogT3V0Z29pbmdIaWQgc3RhdGUgd2l0aCBjb21tYW5kOiIgKyBtQ29tbWFuZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtU3RhdHVzID0gcHJvY2Vzc0NvbW1hbmQobUNvbW1hbmQpOworICAgICAgICAgICAgaWYgKCFtU3RhdHVzKSBzZW5kTWVzc2FnZShUUkFOU0lUSU9OX1RPX1NUQUJMRSk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgICBsb2coIk91dGdvaW5nSGlkIFN0YXRlLT5Qcm9jZXNzaW5nIE1lc3NhZ2U6ICIgKyBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgTWVzc2FnZSBkZWZlck1zZyA9IG5ldyBNZXNzYWdlKCk7CisgICAgICAgICAgICBzd2l0Y2gobWVzc2FnZS53aGF0KSB7CisgICAgICAgICAgICAgICAgLy8gZGVmZXIgYWxsIG91dGdvaW5nIG1lc3NhZ2VzCisgICAgICAgICAgICAgICAgY2FzZSBDT05ORUNUX0hGUF9PVVRHT0lORzoKKyAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfQTJEUF9PVVRHT0lORzoKKyAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfSElEX09VVEdPSU5HOgorICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9IRlBfT1VUR09JTkc6CisgICAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0EyRFBfT1VUR09JTkc6CisgICAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0hJRF9PVVRHT0lORzoKKyAgICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVF9IRlBfSU5DT01JTkc6CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtSW5jb21pbmdIYW5kc2ZyZWUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfQTJEUF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1JbmNvbWluZ0EyZHApOworCisgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IGNhbmNlbCBISUQgb3V0Z29pbmcgYXMgdGhlcmUgaXMgbm8gZ3VhcmFudGVlIGl0CisgICAgICAgICAgICAgICAgICAgIC8vIHdpbGwgZ2V0IGNhbmNlbGVkLgorICAgICAgICAgICAgICAgICAgICAvLyBJdCBtaWdodCBhbHJlYWR5IGJlIGNvbm5lY3RlZCBidXQgd2UgbWlnaHQgbm90IGhhdmUgZ290IHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBJTlBVVF9ERVZJQ0VfU1RBVEVfQ0hBTkdFLiBIZW5jZSwgbm8gcG9pbnQgZGlzY29ubmVjdGluZyBoZXJlLgorICAgICAgICAgICAgICAgICAgICAvLyBUaGUgd29yc3QgY2FzZSwgdGhlIGNvbm5lY3Rpb24gd2lsbCBmYWlsLCByZXRyeS4KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1TdGF0dXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVyTXNnLndoYXQgPSBtQ29tbWFuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVyTWVzc2FnZShkZWZlck1zZyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDT05ORUNUX0hJRF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICAgIC8vIEJsdWV6IHdpbGwgdGFrZSBjYXJlIG9mIHRoZSBjb25mbGljdHMKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1JbmNvbWluZ0hpZCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0hGUF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfQTJEUF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICAgICAgLy8gQXQgdGhpcyBwb2ludCwgd2UgYXJlIGFscmVhZHkgZGlzY29ubmVjdGVkCisgICAgICAgICAgICAgICAgICAgIC8vIHdpdGggSEZQLiBTb21ldGltZXMgSElEIGNvbm5lY3Rpb24gY2FuCisgICAgICAgICAgICAgICAgICAgIC8vIGZhaWwgZHVlIHRvIHRoZSBkaXNjb25uZWN0aW9uIG9mIEhGUC4gU28gYWRkIGEgcmV0cnkKKyAgICAgICAgICAgICAgICAgICAgLy8gZm9yIHRoZSBISUQuCisgICAgICAgICAgICAgICAgICAgIGlmIChtU3RhdHVzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZlck1zZy53aGF0ID0gbUNvbW1hbmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UoZGVmZXJNc2cpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9ISURfSU5DT01JTkc6CisgICAgICAgICAgICAgICAgICAgIC8vIElnbm9yZSwgd2lsbCBiZSBoYW5kbGVkIGJ5IEJsdWV6CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9QQkFQX09VVEdPSU5HOgorICAgICAgICAgICAgICAgIGNhc2UgVU5QQUlSOgorICAgICAgICAgICAgICAgIGNhc2UgQVVUT19DT05ORUNUX1BST0ZJTEVTOgorICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UobWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgVFJBTlNJVElPTl9UT19TVEFCTEU6CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtQm9uZGVkRGV2aWNlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5PVF9IQU5ETEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIEhBTkRMRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgcHJpdmF0ZSBjbGFzcyBJbmNvbWluZ0hpZCBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgIHByaXZhdGUgYm9vbGVhbiBtU3RhdHVzID0gZmFsc2U7CisgICAgICBwcml2YXRlIGludCBtQ29tbWFuZDsKKworICAgICAgQE92ZXJyaWRlCisgICAgICBwcm90ZWN0ZWQgdm9pZCBlbnRlcigpIHsKKyAgICAgICAgICBsb2coIkVudGVyaW5nIEluY29taW5nSGlkIHN0YXRlIHdpdGg6ICIgKyBnZXRDdXJyZW50TWVzc2FnZSgpLndoYXQpOworICAgICAgICAgIG1Db21tYW5kID0gZ2V0Q3VycmVudE1lc3NhZ2UoKS53aGF0OworICAgICAgICAgIGlmIChtQ29tbWFuZCAhPSBDT05ORUNUX0hJRF9JTkNPTUlORyAmJgorICAgICAgICAgICAgICBtQ29tbWFuZCAhPSBESVNDT05ORUNUX0hJRF9JTkNPTUlORykgeworICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvcjogSW5jb21pbmdIaWQgc3RhdGUgd2l0aCBjb21tYW5kOiIgKyBtQ29tbWFuZCk7CisgICAgICAgICAgfQorICAgICAgICAgIG1TdGF0dXMgPSBwcm9jZXNzQ29tbWFuZChtQ29tbWFuZCk7CisgICAgICAgICAgaWYgKCFtU3RhdHVzKSBzZW5kTWVzc2FnZShUUkFOU0lUSU9OX1RPX1NUQUJMRSk7CisgICAgICB9CisKKyAgICAgIEBPdmVycmlkZQorICAgICAgcHJvdGVjdGVkIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgbG9nKCJJbmNvbWluZ0hpZCBTdGF0ZS0+UHJvY2Vzc2luZyBNZXNzYWdlOiAiICsgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICBNZXNzYWdlIGRlZmVyTXNnID0gbmV3IE1lc3NhZ2UoKTsKKyAgICAgICAgICBzd2l0Y2gobWVzc2FnZS53aGF0KSB7CisgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVF9IRlBfT1VUR09JTkc6CisgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVF9IRlBfSU5DT01JTkc6CisgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9IRlBfT1VUR09JTkc6CisgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVF9BMkRQX0lOQ09NSU5HOgorICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfQTJEUF9PVVRHT0lORzoKKyAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0EyRFBfT1VUR09JTkc6CisgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVF9ISURfT1VUR09JTkc6CisgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVF9ISURfSU5DT01JTkc6CisgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9ISURfT1VUR09JTkc6CisgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UobWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0hGUF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICAgIC8vIFNob3VsZG4ndCBoYXBwZW4gYnV0IGlmIGRvZXMsIHdlIGNhbiBoYW5kbGUgaXQuCisgICAgICAgICAgICAgICAgICAvLyBEZXBlbmRzIGlmIHRoZSBoZWFkc2V0IGNhbiBoYW5kbGUgaXQuCisgICAgICAgICAgICAgICAgICAvLyBJbmNvbWluZyBISUQgd2lsbCBiZSBoYW5kbGVkIGJ5IEJsdWV6LCBEaXNjb25uZWN0IEhGUAorICAgICAgICAgICAgICAgICAgLy8gdGhlIHNvY2tldCB3b3VsZCBoYXZlIGFscmVhZHkgYmVlbiBjbG9zZWQuCisgICAgICAgICAgICAgICAgICAvLyBpZ25vcmUKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfSElEX0lOQ09NSU5HOgorICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfQTJEUF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICAgIC8vIElnbm9yZSwgd2lsbCBiZSBoYW5kbGVkIGJ5IEJsdWV6CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX1BCQVBfT1VUR09JTkc6CisgICAgICAgICAgICAgIGNhc2UgVU5QQUlSOgorICAgICAgICAgICAgICBjYXNlIEFVVE9fQ09OTkVDVF9QUk9GSUxFUzoKKyAgICAgICAgICAgICAgICAgIGRlZmVyTWVzc2FnZShtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIFRSQU5TSVRJT05fVE9fU1RBQkxFOgorICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1Cb25kZWREZXZpY2UpOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiBIQU5ETEVEOworICAgICAgfQorICB9CisKIAogICAgIHN5bmNocm9uaXplZCB2b2lkIGNhbmNlbENvbW1hbmQoaW50IGNvbW1hbmQpIHsKICAgICAgICAgaWYgKGNvbW1hbmQgPT0gQ09OTkVDVF9IRlBfT1VUR09JTkcgKSB7CiAgICAgICAgICAgICAvLyBDYW5jZWwgdGhlIG91dGdvaW5nIHRocmVhZC4KLSAgICAgICAgICAgIGlmIChtSGVhZHNldFNlcnZpY2VDb25uZWN0ZWQpIHsKKyAgICAgICAgICAgIGlmIChtSGVhZHNldFNlcnZpY2UgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIG1IZWFkc2V0U2VydmljZS5jYW5jZWxDb25uZWN0VGhyZWFkKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAvLyBIZWFkc2V0U2VydmljZSBpcyBkb3duLiBQaG9uZSBwcm9jZXNzIG1vc3QgbGlrZWx5IGNyYXNoZWQuCkBAIC02NzAsMTIgKzkwMSwxNCBAQAogICAgICAgICBMb2cuaShUQUcsICJQcm9jZXNzaW5nIGNvbW1hbmQ6IiArIGNvbW1hbmQpOwogICAgICAgICBzd2l0Y2goY29tbWFuZCkgewogICAgICAgICAgICAgY2FzZSAgQ09OTkVDVF9IRlBfT1VUR09JTkc6Ci0gICAgICAgICAgICAgICAgaWYgKG1IZWFkc2V0U2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKG1IZWFkc2V0U2VydmljZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGRlZmVyUHJvZmlsZVNlcnZpY2VNZXNzYWdlKGNvbW1hbmQpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtSGVhZHNldFNlcnZpY2UuY29ubmVjdEhlYWRzZXRJbnRlcm5hbChtRGV2aWNlKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIENPTk5FQ1RfSEZQX0lOQ09NSU5HOgotICAgICAgICAgICAgICAgIGlmICghbUhlYWRzZXRTZXJ2aWNlQ29ubmVjdGVkKSB7CisgICAgICAgICAgICAgICAgaWYgKG1IZWFkc2V0U2VydmljZSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGRlZmVyUHJvZmlsZVNlcnZpY2VNZXNzYWdlKGNvbW1hbmQpOwogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobUhlYWRzZXRTdGF0ZSA9PSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RJTkcpIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1IZWFkc2V0U2VydmljZS5hY2NlcHRJbmNvbWluZ0Nvbm5lY3QobURldmljZSk7CkBAIC02OTMsOCArOTI2LDEyIEBACiAgICAgICAgICAgICAgICAgaGFuZGxlQ29ubmVjdGlvbk9mT3RoZXJQcm9maWxlcyhjb21tYW5kKTsKICAgICAgICAgICAgICAgICAvLyBpZ25vcmUsIEJsdWV6IHRha2VzIGNhcmUKICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIGNhc2UgQ09OTkVDVF9ISURfT1VUR09JTkc6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmNvbm5lY3RJbnB1dERldmljZUludGVybmFsKG1EZXZpY2UpOworICAgICAgICAgICAgY2FzZSBDT05ORUNUX0hJRF9JTkNPTUlORzoKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9IRlBfT1VUR09JTkc6Ci0gICAgICAgICAgICAgICAgaWYgKCFtSGVhZHNldFNlcnZpY2VDb25uZWN0ZWQpIHsKKyAgICAgICAgICAgICAgICBpZiAobUhlYWRzZXRTZXJ2aWNlID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgZGVmZXJQcm9maWxlU2VydmljZU1lc3NhZ2UoY29tbWFuZCk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgLy8gRGlzY29ubmVjdCBQQkFQCkBAIC03MTcsMTMgKzk1NCwyMiBAQAogICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0EyRFBfT1VUR09JTkc6CiAgICAgICAgICAgICAgICAgaWYgKG1BMmRwU2VydmljZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtQTJkcFNlcnZpY2UuZ2V0U2lua1ByaW9yaXR5KG1EZXZpY2UpID09CisgICAgICAgICAgICAgICAgICAgIGlmIChtQTJkcFNlcnZpY2UuZ2V0UHJpb3JpdHkobURldmljZSkgPT0KICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuUFJJT1JJVFlfQVVUT19DT05ORUNUKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQTJkcFNlcnZpY2Uuc2V0U2lua1ByaW9yaXR5KG1EZXZpY2UsIEJsdWV0b290aEhlYWRzZXQuUFJJT1JJVFlfT04pOworICAgICAgICAgICAgICAgICAgICAgICAgbUEyZHBTZXJ2aWNlLnNldFByaW9yaXR5KG1EZXZpY2UsIEJsdWV0b290aEhlYWRzZXQuUFJJT1JJVFlfT04pOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtQTJkcFNlcnZpY2UuZGlzY29ubmVjdFNpbmtJbnRlcm5hbChtRGV2aWNlKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RfSElEX0lOQ09NSU5HOgorICAgICAgICAgICAgICAgIC8vIGlnbm9yZQorICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUX0hJRF9PVVRHT0lORzoKKyAgICAgICAgICAgICAgICBpZiAobVNlcnZpY2UuZ2V0SW5wdXREZXZpY2VQcmlvcml0eShtRGV2aWNlKSA9PQorICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9BVVRPX0NPTk5FQ1QpIHsKKyAgICAgICAgICAgICAgICAgICAgbVNlcnZpY2Uuc2V0SW5wdXREZXZpY2VQcmlvcml0eShtRGV2aWNlLCBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9PTik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5kaXNjb25uZWN0SW5wdXREZXZpY2VJbnRlcm5hbChtRGV2aWNlKTsKICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVF9QQkFQX09VVEdPSU5HOgogICAgICAgICAgICAgICAgIGlmICghbVBiYXBTZXJ2aWNlQ29ubmVjdGVkKSB7CiAgICAgICAgICAgICAgICAgICAgIGRlZmVyUHJvZmlsZVNlcnZpY2VNZXNzYWdlKGNvbW1hbmQpOwpAQCAtNzcwLDcgKzEwMTYsNyBAQAogICAgICAgICAgICAgICAgIC8vIENvbm5lY3QgQTJEUCBpZiB0aGVyZSBpcyBubyBpbmNvbWluZyBjb25uZWN0aW9uCiAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHByaW9yaXR5IGlzIE9GRiAtIGRvbid0IGF1dG8gY29ubmVjdC4KICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgcHJpb3JpdHkgaXMgQVVUT19DT05ORUNULCBhdXRvIGNvbm5lY3QgY29kZSB0YWtlcyBjYXJlLgotICAgICAgICAgICAgICAgIGlmIChtQTJkcFNlcnZpY2UuZ2V0U2lua1ByaW9yaXR5KG1EZXZpY2UpID09IEJsdWV0b290aEEyZHAuUFJJT1JJVFlfT04pIHsKKyAgICAgICAgICAgICAgICBpZiAobUEyZHBTZXJ2aWNlLmdldFByaW9yaXR5KG1EZXZpY2UpID09IEJsdWV0b290aFByb2ZpbGUuUFJJT1JJVFlfT04pIHsKICAgICAgICAgICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBuZXcgTWVzc2FnZSgpOwogICAgICAgICAgICAgICAgICAgICBtc2cud2hhdCA9IENPTk5FQ1RfT1RIRVJfUFJPRklMRVM7CiAgICAgICAgICAgICAgICAgICAgIG1zZy5hcmcxID0gQ09OTk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50ZW50KElCbHVldG9vdGhIZWFkc2V0LmNsYXNzLmdldE5hbWUoKSksIG1Db25uZWN0aW9uLCAwKSkgewogICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ291bGQgbm90IGJpbmQgdG8gQmx1ZXRvb3RoIEhlYWRzZXQgU2VydmljZSIpOwogICAgICAgICB9CiAgICAgfQogCi0gICAgcHJvdGVjdGVkIHZvaWQgZmluYWxpemUoKSB0aHJvd3MgVGhyb3dhYmxlIHsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGNsb3NlKCk7Ci0gICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICBzdXBlci5maW5hbGl6ZSgpOwotICAgICAgICB9Ci0gICAgfQotCiAgICAgLyoqCiAgICAgICogQ2xvc2UgdGhlIGNvbm5lY3Rpb24gdG8gdGhlIGJhY2tpbmcgc2VydmljZS4KICAgICAgKiBPdGhlciBwdWJsaWMgZnVuY3Rpb25zIG9mIEJsdWV0b290aEhlYWRzZXQgd2lsbCByZXR1cm4gZGVmYXVsdCBlcnJvcgogICAgICAqIHJlc3VsdHMgb25jZSBjbG9zZSgpIGhhcyBiZWVuIGNhbGxlZC4gTXVsdGlwbGUgaW52b2NhdGlvbnMgb2YgY2xvc2UoKQogICAgICAqIGFyZSBvay4KICAgICAgKi8KLSAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgY2xvc2UoKSB7CisgICAgLypwYWNrYWdlKi8gc3luY2hyb25pemVkIHZvaWQgY2xvc2UoKSB7CiAgICAgICAgIGlmIChEQkcpIGxvZygiY2xvc2UoKSIpOwogICAgICAgICBpZiAobUNvbm5lY3Rpb24gIT0gbnVsbCkgewogICAgICAgICAgICAgbUNvbnRleHQudW5iaW5kU2VydmljZShtQ29ubmVjdGlvbik7CkBAIC0yMjIsMTkwICsyMzIsMjEyIEBACiAgICAgfQogCiAgICAgLyoqCi0gICAgICogR2V0IHRoZSBjdXJyZW50IHN0YXRlIG9mIHRoZSBCbHVldG9vdGggSGVhZHNldCBzZXJ2aWNlLgotICAgICAqIEByZXR1cm4gT25lIG9mIHRoZSBTVEFURV8gcmV0dXJuIGNvZGVzLCBvciBTVEFURV9FUlJPUiBpZiB0aGlzIHByb3h5Ci0gICAgICogICAgICAgICBvYmplY3QgaXMgY3VycmVudGx5IG5vdCBjb25uZWN0ZWQgdG8gdGhlIEhlYWRzZXQgc2VydmljZS4KKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICogQGhpZGUKICAgICAgKi8KLSAgICBwdWJsaWMgaW50IGdldFN0YXRlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKLSAgICAgICAgaWYgKERCRykgbG9nKCJnZXRTdGF0ZSgpIik7Ci0gICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CisgICAgcHVibGljIGJvb2xlYW4gY29ubmVjdChCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiY29ubmVjdCgiICsgZGV2aWNlICsgIikiKTsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwgJiYgaXNFbmFibGVkKCkgJiYKKyAgICAgICAgICAgIGlzVmFsaWREZXZpY2UoZGV2aWNlKSkgewogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0U3RhdGUoZGV2aWNlKTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7TG9nLmUoVEFHLCBlLnRvU3RyaW5nKCkpO30KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgIlByb3h5IG5vdCBhdHRhY2hlZCB0byBzZXJ2aWNlIik7Ci0gICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5jb25uZWN0KGRldmljZSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcobmV3IFRocm93YWJsZSgpKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0VSUk9SOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIEdldCB0aGUgQmx1ZXRvb3RoRGV2aWNlIGZvciB0aGUgY3VycmVudCBoZWFkc2V0LgotICAgICAqIEByZXR1cm4gY3VycmVudCBoZWFkc2V0LCBvciBudWxsIGlmIG5vdCBpbiBjb25uZWN0ZWQgb3IgY29ubmVjdGluZwotICAgICAqICAgICAgICAgc3RhdGUsIG9yIGlmIHRoaXMgcHJveHkgb2JqZWN0IGlzIG5vdCBjb25uZWN0ZWQgdG8gdGhlIEhlYWRzZXQKLSAgICAgKiAgICAgICAgIHNlcnZpY2UuCi0gICAgICovCi0gICAgcHVibGljIEJsdWV0b290aERldmljZSBnZXRDdXJyZW50SGVhZHNldCgpIHsKLSAgICAgICAgaWYgKERCRykgbG9nKCJnZXRDdXJyZW50SGVhZHNldCgpIik7Ci0gICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRDdXJyZW50SGVhZHNldCgpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHtMb2cuZShUQUcsIGUudG9TdHJpbmcoKSk7fQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgTG9nLncoVEFHLCAiUHJveHkgbm90IGF0dGFjaGVkIHRvIHNlcnZpY2UiKTsKLSAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFR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OwotICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgewotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBpZiAobVNlcnZpY2UuY29ubmVjdEhlYWRzZXQoZGV2aWNlKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgZS50b1N0cmluZygpKTt9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc2VydmljZSIpOwotICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBMb2cuZ2V0U3RhY2tUcmFjZVN0cmluZyhuZXcgVGhyb3dhYmxlKCkpKTsKLSAgICAgICAgfQorICAgICAgICBpZiAobVNlcnZpY2UgPT0gbnVsbCkgTG9nLncoVEFHLCAiUHJveHkgbm90IGF0dGFjaGVkIHRvIHNlcnZpY2UiKTsKICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KIAogICAgIC8qKgotICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGUgc3BlY2lmaWVkIGhlYWRzZXQgaXMgY29ubmVjdGVkIChkb2VzIG5vdCBpbmNsdWRlCi0gICAgICogY29ubmVjdGluZykuIFJldHVybnMgZmFsc2UgaWYgbm90IGNvbm5lY3RlZCwgb3IgaWYgdGhpcyBwcm94eSBvYmplY3QKLSAgICAgKiBpZiBub3QgY3VycmVudGx5IGNvbm5lY3RlZCB0byB0aGUgaGVhZHNldCBzZXJ2aWNlLgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKiBAaGlkZQogICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGlzQ29ubmVjdGVkKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKLSAgICAgICAgaWYgKERCRykgbG9nKCJpc0Nvbm5lY3RlZCgiICsgZGV2aWNlICsgIikiKTsKLSAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICBwdWJsaWMgYm9vbGVhbiBkaXNjb25uZWN0KEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJkaXNjb25uZWN0KCIgKyBkZXZpY2UgKyAiKSIpOworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCAmJiBpc0VuYWJsZWQoKSAmJgorICAgICAgICAgICAgaXNWYWxpZERldmljZShkZXZpY2UpKSB7CiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5pc0Nvbm5lY3RlZChkZXZpY2UpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHtMb2cuZShUQUcsIGUudG9TdHJpbmcoKSk7fQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgTG9nLncoVEFHLCAiUHJveHkgbm90IGF0dGFjaGVkIHRvIHNlcnZpY2UiKTsKLSAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcobmV3IFRocm93YWJsZSgpKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmRpc2Nvbm5lY3QoZGV2aWNlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgIExvZy5lKFRBRywgTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcobmV3IFRocm93YWJsZSgpKSk7CisgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQorICAgICAgICBpZiAobVNlcnZpY2UgPT0gbnVsbCkgTG9nLncoVEFHLCAiUHJveHkgbm90IGF0dGFjaGVkIHRvIHNlcnZpY2UiKTsKICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KIAogICAgIC8qKgotICAgICAqIERpc2Nvbm5lY3RzIHRoZSBjdXJyZW50IGhlYWRzZXQuIEN1cnJlbnRseSB0aGlzIGNhbGwgYmxvY2tzLCBpdCBtYXkgc29vbgotICAgICAqIGJlIG1hZGUgYXN5bmNocm9ub3VzLiBSZXR1cm5zIGZhbHNlIGlmIHRoaXMgcHJveHkgb2JqZWN0IGlzCi0gICAgICogbm90IGN1cnJlbnRseSBjb25uZWN0ZWQgdG8gdGhlIEhlYWRzZXQgc2VydmljZS4KKyAgICAgKiB7QGluaGVyaXREb2N9CiAgICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gZGlzY29ubmVjdEhlYWRzZXQoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgewotICAgICAgICBpZiAoREJHKSBsb2coImRpc2Nvbm5lY3RIZWFkc2V0KCkiKTsKLSAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICBwdWJsaWMgTGlzdDxCbHVldG9vdGhEZXZpY2U+IGdldENvbm5lY3RlZERldmljZXMoKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiZ2V0Q29ubmVjdGVkRGV2aWNlcygpIik7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsICYmIGlzRW5hYmxlZCgpKSB7CiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIG1TZXJ2aWNlLmRpc2Nvbm5lY3RIZWFkc2V0KGRldmljZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgZS50b1N0cmluZygpKTt9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc2VydmljZSIpOwotICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBMb2cuZ2V0U3RhY2tUcmFjZVN0cmluZyhuZXcgVGhyb3dhYmxlKCkpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0Q29ubmVjdGVkRGV2aWNlcygpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQXJyYXlMaXN0PEJsdWV0b290aERldmljZT4oKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIGlmIChtU2VydmljZSA9PSBudWxsKSBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc2VydmljZSIpOworICAgICAgICByZXR1cm4gbmV3IEFycmF5TGlzdDxCbHVldG9vdGhEZXZpY2U+KCk7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogU3RhcnQgQlQgVm9pY2UgUmVjb2duaXRpb24gbW9kZSwgYW5kIHNldCB1cCBCbHVldG9vdGggYXVkaW8gcGF0aC4KLSAgICAgKiBSZXR1cm5zIGZhbHNlIGlmIHRoZXJlIGlzIG5vIGhlYWRzZXQgY29ubmVjdGVkLCBvciBpZiB0aGUKLSAgICAgKiBjb25uZWN0ZWQgaGVhZHNldCBkb2VzIG5vdCBzdXBwb3J0IHZvaWNlIHJlY29nbml0aW9uLCBvciBvbgotICAgICAqIGVycm9yLgorICAgICAqIHtAaW5oZXJpdERvY30KICAgICAgKi8KLSAgICBwdWJsaWMgYm9vbGVhbiBzdGFydFZvaWNlUmVjb2duaXRpb24oKSB7Ci0gICAgICAgIGlmIChEQkcpIGxvZygic3RhcnRWb2ljZVJlY29nbml0aW9uKCkiKTsKLSAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICBwdWJs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RvIHNlcnZpY2UiKTsKKyAgICAgICAgcmV0dXJuIG5ldyBBcnJheUxpc3Q8Qmx1ZXRvb3RoRGV2aWNlPigpOwogICAgIH0KIAogICAgIC8qKgotICAgICAqIFN0b3AgQlQgVm9pY2UgUmVjb2duaXRpb24gbW9kZSwgYW5kIHNodXQgZG93biBCbHVldG9vdGggYXVkaW8gcGF0aC4KLSAgICAgKiBSZXR1cm5zIGZhbHNlIGlmIHRoZXJlIGlzIG5vIGhlYWRzZXQgY29ubmVjdGVkLCBvciB0aGUgY29ubmVjdGVkCi0gICAgICogaGVhZHNldCBpcyBub3QgaW4gdm9pY2UgcmVjb2duaXRpb24gbW9kZSwgb3Igb24gZXJyb3IuCisgICAgICoge0Bpbmhlcml0RG9jfQogICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIHN0b3BWb2ljZVJlY29nbml0aW9uKCkgewotICAgICAgICBpZiAoREJHKSBsb2coInN0b3BWb2ljZVJlY29nbml0aW9uKCkiKTsKLSAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICBwdWJsaWMgaW50IGdldENvbm5lY3Rpb25TdGF0ZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiZ2V0Q29ubmVjdGlvblN0YXRlKCIgKyBkZXZpY2UgKyAiKSIpOworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCAmJiBpc0VuYWJsZWQoKSAmJgorICAgICAgICAgICAgaXNWYWxpZERldmljZShkZXZpY2UpKSB7CiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5zdG9wVm9pY2VSZWNvZ25pdGlvbigpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHtMb2cuZShUQUcsIGUudG9TdHJpbmcoKSk7fQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgTG9nLncoVEFHLCAiUHJveHkgbm90IGF0dGFjaGVkIHRvIHNlcnZpY2UiKTsKLSAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcobmV3IFRocm93YWJsZSgpKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldENvbm5lY3Rpb25TdGF0ZShkZXZpY2UpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0RJU0NPTk5FQ1RFRDsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIGlmIChtU2VydmljZSA9PSBudWxsKSBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc2VydmljZSIpOworICAgICAgICByZXR1cm4gQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9ESVNDT05ORUNURUQ7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogU2V0IHByaW9yaXR5IG9mIGhlYWRzZXQuCi0gICAgICogUHJpb3JpdHkgaXMgYSBub24tbmVnYXRpdmUgaW50ZWdlci4gQnkgZGVmYXVsdCBwYWlyZWQgaGVhZHNldHMgd2lsbCBoYXZlCi0gICAgICogYSBwcmlvcml0eSBvZiBQUklPUklUWV9BVVRPLCBhbmQgdW5wYWlyZWQgaGVhZHNldCBQUklPUklUWV9OT05FICgwKS4KLSAgICAgKiBIZWFkc2V0cyB3aXRoIHByaW9yaXR5IGdyZWF0ZXIgdGhhbiB6ZXJvIHdpbGwgYmUgYXV0by1jb25uZWN0ZWQsIGFuZAotICAgICAqIGluY29taW5nIGNvbm5lY3Rpb25zIHdpbGwgYmUgYWNjZXB0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VuYWJsZWQoKSAmJgorICAgICAgICAgICAgaXNWYWxpZERldmljZShkZXZpY2UpKSB7CisgICAgICAgICAgICBpZiAocHJpb3JpdHkgIT0gQmx1ZXRvb3RoUHJvZmlsZS5QUklPUklUWV9PRkYgJiYKKyAgICAgICAgICAgICAgICBwcmlvcml0eSAhPSBCbHVldG9vdGhQcm9maWxlLlBSSU9SSVRZX09OKSB7CisgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLnNldFByaW9yaXR5KGRldmljZSwgcHJpb3JpdHkpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHtMb2cuZShUQUcsIGUudG9TdHJpbmcoKSk7fQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgTG9nLncoVEFHLCAiUHJveHkgbm90IGF0dGFjaGVkIHRvIHNlcnZpY2UiKTsKLSAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcobmV3IFRocm93YWJsZSgpKSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcobmV3IFRocm93YWJsZSgpKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQogICAgICAgICB9CisgICAgICAgIGlmIChtU2VydmljZSA9PSBudWxsKSBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc2VydmljZSIpOwogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogR2V0IHByaW9yaXR5IG9mIGhlYWRzZXQuCi0gICAgICogQHBhcmFtIGRldmljZSBoZWFkc2V0Ci0gICAgICogQHJldHVybiBub24tbmVnYXRpdmUgcHJpb3JpdHksIG9yIG5lZ2F0aXZlIGVycm9yIGNvZGUgb24gZXJyb3IKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICogQGhpZGUKICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldFByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKICAgICAgICAgaWYgKERCRykgbG9nKCJnZXRQcmlvcml0eSgiICsgZGV2aWNlICsgIikiKTsKLSAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwgJiYgaXNFbmFibGVkKCkgJiYKKyAgICAgICAgICAgIGlzVmFsaWREZXZpY2UoZGV2aWNlKSkgewogICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0UHJpb3JpdHkoZGV2aWNlKTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7TG9nLmUoVEFHLCBlLnRvU3RyaW5nKCkpO30KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgIlByb3h5IG5vdCBhdHRhY2hlZCB0byBzZXJ2aWNlIik7Ci0gICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgICAgIHJldHVybiBQUklPUklUWV9PRkY7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIC0xOworICAgICAgICBpZiAobVNlcnZpY2UgPT0g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Y2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygic3RhcnRWb2ljZVJlY29nbml0aW9uKCkiKTsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwgJiYgaXNFbmFibGVkKCkgJiYKKyAgICAgICAgICAgIGlzVmFsaWREZXZpY2UoZGV2aWNlKSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2Uuc3RhcnRWb2ljZVJlY29nbml0aW9uKGRldmljZSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChtU2VydmljZSA9PSBudWxsKSBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc2VydmljZSIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogU3RvcCBCbHVldG9vdGggVm9pY2UgUmVjb2duaXRpb24gbW9kZSwgYW5kIHNodXQgZG93biB0aGUKKyAgICAgKiBCbHVldG9vdGggYXVkaW8gcGF0aC4KKyAgICAgKgorICAgICAqIDxwPlJlcXVpcmVzIHtAbGluayBhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24jQkxVRVRPT1RIfQorICAgICAqCisgICAgICogQHBhcmFtIGRldmljZSBCbHVldG9vdGggaGVhZHNldAorICAgICAqIEByZXR1cm4gZmFsc2UgaWYgdGhlcmUgaXMgbm8gaGVhZHNldCBjb25uZWN0ZWQKKyAgICAgKiAgICAgICAgICAgICAgIG9yIG9uIGVycm9yLCB0cnVlIG90aGVyd2lzZQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIHN0b3BWb2ljZVJlY29nbml0aW9uKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJzdG9wVm9pY2VSZWNvZ25pdGlvbigpIik7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsICYmIGlzRW5hYmxlZCgpICYmCisgICAgICAgICAgICBpc1ZhbGlkRGV2aWNlKGRldmljZSkpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLnN0b3BWb2ljZVJlY29nbml0aW9uKGRldmljZSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChtU2VydmljZSA9PSBudWxsKSBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc2VydmljZSIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2hlY2sgaWYgQmx1ZXRvb3RoIFNDTyBhdWRpbyBpcyBjb25uZWN0ZWQuCisgICAgICoKKyAgICAgKiA8cD5SZXF1aXJlcyB7QGxpbmsgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uI0JMVUVUT09USH0KKyAgICAgKgorICAgICAqIEBwYXJhbSBkZXZpY2UgQmx1ZXRvb3RoIGhlYWRzZXQKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgU0NPIGlzIGNvbm5lY3RlZCwKKyAgICAgKiAgICAgICAgIGZhbHNlIG90aGVyd2lzZSBvciBvbiBlcnJvcgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGlzQXVkaW9Db25uZWN0ZWQoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBpZiAoREJHKSBsb2coImlzQXVkaW9Db25uZWN0ZWQoKSIpOworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCAmJiBpc0VuYWJsZWQoKSAmJgorICAgICAgICAgICAgaXNWYWxpZERldmljZShkZXZpY2UpKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuaXNBdWRpb0Nvbm5lY3RlZChkZXZpY2UpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgTG9nLmUoVEFHLCAgTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcobmV3IFRocm93YWJsZSgpKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1TZXJ2aWNlID09IG51bGwpIExvZy53KFRBRywgIlByb3h5IG5vdCBhdHRhY2hlZCB0byBzZXJ2aWNlIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKICAgICAvKioKQEAgLTQxNiwyNCArNDQ4LDI5IEBACiAgICAgICogYm9vdC4gVGhpcyBpcyBhIGdvb2QgaW5kaWNhdG9yIGZvciBzcGFtbXkgaGVhZHNldC9oYW5kc2ZyZWUgdW5pdHMgdGhhdAogICAgICAqIGNhbiBrZWVwIHRoZSBkZXZpY2UgYXdha2UgYnkgcG9sbGluZyBmb3IgY2VsbHVsYXIgc3RhdHVzIHVwZGF0ZXMuIEFzIGEKICAgICAgKiBydWxlIG9mIHRodW1iLCBlYWNoIEFUIGNvbW1hbmQgcHJldmVudHMgdGhlIENQVSBmcm9tIHNsZWVwaW5nIGZvciA1MDAgbXMKKyAgICAgKgorICAgICAqIEBwYXJhbSBkZXZpY2UgdGhlIGJsdWV0b290aCBoZWFkc2V0LgogICAgICAqIEByZXR1cm4gbW9ub3RvbmljYWxseSBpbmNyZWFzaW5nIGJhdHRlcnkgdXNhZ2UgaGludCwgb3IgYSBuZWdhdGl2ZSBlcnJvcgogICAgICAqICAgICAgICAgY29kZSBvbiBlcnJvcgogICAgICAqIEBoaWRlCiAgICAgICovCi0gICAgcHVibGljIGludCBnZXRCYXR0ZXJ5VXNhZ2VIaW50KCkgeworICAgIHB1YmxpYyBpbnQgZ2V0QmF0dGVyeVVzYWdlSGludChCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CiAgICAgICAgIGlmIChEQkcpIGxvZygiZ2V0QmF0dGVyeVVzYWdlSGludCgpIik7Ci0gICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsICYmIGlzRW5hYmxlZCgpICYmCisgICAgICAgICAgICBpc1ZhbGlkRGV2aWNlKGRldmljZSkpIHsKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldEJhdHRlcnlVc2FnZUhpbnQoKTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7TG9nLmUoVEFHLCBlLnRvU3RyaW5nKCkpO30KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgIlByb3h5IG5vdCBhdHRhY2hlZCB0byBzZXJ2aWNlIik7Ci0gICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRCYXR0ZXJ5VXNhZ2VIaW50KGRldmljZSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICAgICAgfQogICAgICAgICB9CisgICAgICAgIGlmIChtU2VydmljZSA9PSBudWxsKSBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc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ZSBleHBvc2VkCisgICAgICoKICAgICAgKiBAaGlkZQogICAgICAqLwogICAgIHB1YmxpYyBib29sZWFuIGRpc2Nvbm5lY3RIZWFkc2V0SW50ZXJuYWwoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgewogICAgICAgICBpZiAoREJHKSBsb2coImRpc2Nvbm5lY3RIZWFkc2V0SW50ZXJuYWwiKTsKLSAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwgJiYgaXNFbmFibGVkKCkpIHsKICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5kaXNjb25uZWN0SGVhZHNldEludGVybmFsKGRldmljZSk7CiAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgZS50b1N0cmluZygpKTt9CkBAIC01MjgsMjMgKzU3Myw1NiBAQAogICAgICAgICB9CiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXQgdGhlIGF1ZGlvIHN0YXRlIG9mIHRoZSBIZWFkc2V0LgorICAgICAqIE5vdGU6IFRoaXMgaXMgYW4gaW50ZXJuYWwgZnVuY3Rpb24gYW5kIHNob3VsZG4ndCBiZSBleHBvc2VkCisgICAgICoKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIHNldEF1ZGlvU3RhdGUoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwgaW50IHN0YXRlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygic2V0QXVkaW9TdGF0ZSIpOworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCAmJiBpc0VuYWJsZWQoKSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2Uuc2V0QXVkaW9TdGF0ZShkZXZpY2UsIHN0YXRlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7TG9nLmUoVEFHLCBlLnRvU3RyaW5nKCkpO30KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExvZy53KFRBRywgIlByb3h5IG5vdCBhdHRhY2hlZCB0byBzZXJ2aWNlIik7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKICAgICBwcml2YXRlIFNlcnZpY2VDb25uZWN0aW9uIG1Db25uZWN0aW9uID0gbmV3IFNlcnZpY2VDb25uZWN0aW9uKCkgewogICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VDb25uZWN0ZWQoQ29tcG9uZW50TmFtZSBjbGFzc05hbWUsIElCaW5kZXIgc2VydmljZSkgewogICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAiUHJveHkgb2JqZWN0IGNvbm5lY3RlZCIpOwogICAgICAgICAgICAgbVNlcnZpY2UgPSBJQmx1ZXRvb3RoSGVhZHNldC5TdHViLmFzSW50ZXJmYWNlKHNlcnZpY2UpOworCiAgICAgICAgICAgICBpZiAobVNlcnZpY2VMaXN0ZW5lciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbVNlcnZpY2VMaXN0ZW5lci5vblNlcnZpY2VDb25uZWN0ZWQoKTsKKyAgICAgICAgICAgICAgICBtU2VydmljZUxpc3RlbmVyLm9uU2VydmljZUNvbm5lY3RlZChCbHVldG9vdGhQcm9maWxlLkhFQURTRVQsIEJsdWV0b290aEhlYWRzZXQudGhpcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlRGlzY29ubmVjdGVkKENvbXBvbmVudE5hbWUgY2xhc3NOYW1lKSB7CiAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICJQcm94eSBvYmplY3QgZGlzY29ubmVjdGVkIik7CiAgICAgICAgICAgICBtU2VydmljZSA9IG51bGw7CiAgICAgICAgICAgICBpZiAobVNlcnZpY2VMaXN0ZW5lciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbVNlcnZpY2VMaXN0ZW5lci5vblNlcnZpY2VEaXNjb25uZWN0ZWQoKTsKKyAgICAgICAgICAgICAgICBtU2VydmljZUxpc3RlbmVyLm9uU2VydmljZURpc2Nvbm5lY3RlZChCbHVldG9vdGhQcm9maWxlLkhFQURTRVQpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfTsKIAorICAgIHByaXZhdGUgYm9vbGVhbiBpc0VuYWJsZWQoKSB7CisgICAgICAgaWYgKG1BZGFwdGVyLmdldFN0YXRlKCkgPT0gQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9PTikgcmV0dXJuIHRydWU7CisgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBpc1ZhbGlkRGV2aWNlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICBpZiAoZGV2aWNlID09IG51bGwpIHJldHVybiBmYWxzZTsKKworICAgICAgIGlmIChCbHVldG9vdGhBZGFwdGVyLmNoZWNrQmx1ZXRvb3RoQWRkcmVzcyhkZXZpY2UuZ2V0QWRkcmVzcygpKSkgcmV0dXJuIHRydWU7CisgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKwogICAgIHByaXZhdGUgc3RhdGljIHZvaWQgbG9nKFN0cmluZyBtc2cpIHsKICAgICAgICAgTG9nLmQoVEFHLCBtc2cpOwogICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2JsdWV0b290aC9CbHVldG9vdGhJbnB1dERldmljZS5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvYmx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uZWN0aW9ucyB0byB0aGUgZGV2aWNlIGFyZSBub3QgYWxsb3dlZCBhdCB0aGlzIHByaW9yaXR5IGxldmVsLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBSSU9SSVRZX09GRiA9IDA7CisgICAgLyoqCisgICAgICogRGVmYXVsdCBwcmlvcml0eSBsZXZlbCB3aGVuIHRoZSBkZXZpY2UgaXMgdW5wYWlyZWQuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUFJJT1JJVFlfVU5ERUZJTkVEID0gLTE7CisKKyAgICBwcml2YXRlIGZpbmFsIElCbHVldG9vdGggbVNlcnZpY2U7CisgICAgcHJpdmF0ZSBmaW5hbCBDb250ZXh0IG1Db250ZXh0OworCisgICAgLyoqCisgICAgICogQ3JlYXRlIGEgQmx1ZXRvb3RoSW5wdXREZXZpY2UgcHJveHkgb2JqZWN0IGZvciBpbnRlcmFjdGluZyB3aXRoIHRoZSBsb2NhbAorICAgICAqIEJsdWV0b290aCBTZXJ2aWNlIHdoaWNoIGhhbmRsZSB0aGUgSElEIHByb2ZpbGUuCisgICAgICogQHBhcmFtIGMgQ29udGV4dAorICAgICAqLworICAgIHB1YmxpYyBCbHVldG9vdGhJbnB1dERldmljZShDb250ZXh0IGMpIHsKKyAgICAgICAgbUNvbnRleHQgPSBjOworCisgICAgICAgIElCaW5kZXIgYiA9IFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoQmx1ZXRvb3RoQWRhcHRlci5CTFVFVE9PVEhfU0VSVklDRSk7CisgICAgICAgIGlmIChiICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1TZXJ2aWNlID0gSUJsdWV0b290aC5TdHViLmFzSW50ZXJmYWNlKGIpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgTG9nLncoVEFHLCAiQmx1ZXRvb3RoIFNlcnZpY2Ugbm90IGF2YWlsYWJsZSEiKTsKKworICAgICAgICAgICAgLy8gSW5z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3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqIEluaXRpYXRlIGRpc2Nvbm5lY3QgZnJvbSBhbiBJbnB1dCBEZXZpY2UuCisgICAgICogIFRoaXMgZnVuY3Rpb24gcmV0dXJuIGZhbHNlIG9uIGVycm9yIGFuZCB0cnVlIGlmIHRoZSBkaXNjb25uZWN0aW9uCisgICAgICogIGF0dGVtcHQgaXMgYmVpbmcgbWFkZS4KKyAgICAgKgorICAgICAqICBMaXN0ZW4gZm9yIElOUFVUX0RFVklDRV9TVEFURV9DSEFOR0VEX0FDVElPTiB0byBmaW5kIG91dCB3aGVuCisgICAgICogIGRpc2Nvbm5lY3QgaXMgY29tcGxldGVkLgorICAgICAqCisgICAgICogIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KKyAgICAgKiAgQHJldHVybiBmYWxzZSBvbiBpbW1lZGlhdGUgZXJyb3IsIHRydWUgb3RoZXJ3aXNlCisgICAgICogIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gZGlzY29ubmVjdElucHV0RGV2aWNlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJkaXNjb25uZWN0SW5wdXREZXZpY2UoIiArIGRldmljZSArICIpIik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZGlzY29ubmVjdElucHV0RGV2aWNlKGRldmljZSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKiBDaGVjayBpZiBhIHNwZWNpZmllZCBJbnB1dERldmljZSBpcyBjb25uZWN0ZWQuCisgICAgICoKKyAgICAgKiAgQHBhcmFtIGRldmljZSBSZW1vdGUgQlQgZGV2aWNlLgorICAgICAqICBAcmV0dXJuIFRydWUgaWYgY29ubmVjdGVkICwgZmFsc2Ugb3RoZXJ3aXNlIGFuZCBvbiBlcnJvci4KKyAgICAgKiAgQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBpc0lucHV0RGV2aWNlQ29ubmVjdGVkKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJpc0lucHV0RGV2aWNlQ29ubmVjdGVkKCIgKyBkZXZpY2UgKyAiKSIpOworICAgICAgICBpbnQgc3RhdGUgPSBnZXRJbnB1dERldmljZVN0YXRlKGRldmljZSk7CisgICAgICAgIGlmIChzdGF0ZSA9PSBTVEFURV9DT05ORUNURUQpIHJldHVybiB0cnVlOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqIENoZWNrIGlmIGFueSBJbnB1dCBEZXZpY2UgaXMgY29ubmVjdGVkLgorICAgICAqCisgICAgICogQHJldHVybiBMaXN0IG9mIGRldmljZXMsIGVtcHR5IExpc3Qgb24gZXJyb3IuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgTGlzdDxCbHVldG9vdGhEZXZpY2U+IGdldENvbm5lY3RlZElucHV0RGV2aWNlcygpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJnZXRDb25uZWN0ZWRJbnB1dERldmljZXMoKSIpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldENvbm5lY3RlZElucHV0RGV2aWNlcygpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gbmV3IEFycmF5TGlzdDxCbHVldG9vdGhEZXZpY2U+KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiogR2V0IHRoZSBzdGF0ZSBvZiBhbiBJbnB1dCBEZXZpY2UuCisgICAgICoKKyAgICAgKiAgQHBhcmFtIGRldmljZSBSZW1vdGUgQlQgZGV2aWNlLgorICAgICAqICBAcmV0dXJuIFRoZSBjdXJyZW50IHN0YXRlIG9mIHRoZSBJbnB1dCBEZXZpY2UKKyAgICAgKiAgQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldElucHV0RGV2aWNlU3RhdGUoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBpZiAoREJHKSBsb2coImdldElucHV0RGV2aWNlU3RhdGUoIiArIGRldmljZSArICIpIik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0SW5wdXREZXZpY2VTdGF0ZShkZXZpY2UpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gU1RBVEVfRElTQ09OTkVDVEVEOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHByaW9yaXR5IG9mIGFuIGlucHV0IGRldmljZS4KKyAgICAgKgorICAgICAqIFByaW9yaXR5IGlzIGEgbm9uLW5lZ2F0aXZlIGludGVnZXIuIFByaW9yaXR5IGNhbiB0YWtlIHRoZSBmb2xsb3dpbmcKKyAgICAgKiB2YWx1ZXM6CisgICAgICoge0BsaW5rIFBSSU9SSVRZX09OfSwge0BsaW5rIFBSSU9SSVRZX09GRn0sIHtAbGluayBQUklPUklUWV9BVVRPX0NPTk5FQ1R9CisgICAgICoKKyAgICAgKiBAcGFyYW0gZGV2aWNlIFBhaXJlZCBkZXZpY2UuCisgICAgICogQHBhcmFtIHByaW9yaXR5IEludGVnZXIgcHJpb3JpdHkKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgcHJpb3JpdHkgaXMgc2V0LCBmYWxzZSBvbiBlcnJvcgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIHNldElucHV0RGV2aWNlUHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwgaW50IHByaW9yaXR5KSB7CisgICAgICAgIGlmIChEQkcpIGxvZygic2V0SW5wdXREZXZpY2VQcmlvcml0eSgiICsgZGV2aWNlICsgIiwgIiArIHByaW9yaXR5ICsgIikiKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5zZXRJbnB1dERldmljZVByaW9yaXR5KGRldmljZSwgcHJpb3JpdHkpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZXQgdGhlIHByaW9yaXR5IGFzc29jaWF0ZWQgd2l0aCBhbiBJbnB1dCBEZXZpY2UuCisgICAgICoKKyAgICAgKiBAcGFyYW0gZGV2aWNlIElucHV0IERldmljZQorICAgICAqIEByZXR1cm4gbm9uLW5lZ2F0aXZlIHByaW9yaXR5LCBvciBuZWdhdGl2ZSBlcnJvciBjb2RlIG9uIGVycm9yLgorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0SW5wdXREZXZpY2VQcmlvcml0eShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiZ2V0SW5wdXREZXZpY2VQcmlvcml0eSgiICsgZGV2aWNlICsgIikiKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRJbnB1dERldmljZVByaW9yaXR5KGRldmljZSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB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aWMgZmluYWwgaW50IFNUQVRFX0NPTk5FQ1RJTkcgICA9IDE7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgU1RBVEVfQ09OTkVDVEVEICAgID0gMjsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBTVEFURV9ESVNDT05ORUNUSU5HID0gMzsKKworICAgIHByaXZhdGUgZmluYWwgSUJsdWV0b290aCBtU2VydmljZTsKKyAgICBwcml2YXRlIGZpbmFsIENvbnRleHQgbUNvbnRleHQ7CisKKyAgICAvKioKKyAgICAgKiBDcmVhdGUgYSBCbHVldG9vdGhQYW4gcHJveHkgb2JqZWN0IGZvciBpbnRlcmFjdGluZyB3aXRoIHRoZSBsb2NhbAorICAgICAqIEJsdWV0b290aCBQYW4gc2VydmljZS4KKyAgICAgKiBAcGFyYW0gYyBDb250ZXh0CisgICAgICovCisgICAgcHVibGljIEJsdWV0b290aFBhbihDb250ZXh0IGMpIHsKKyAgICAgICAgbUNvbnRleHQgPSBjOworCisgICAgICAgIElCaW5kZXIgYiA9IFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoQmx1ZXRvb3RoQWRhcHRlci5CTFVFVE9PVEhfU0VSVklDRSk7CisgICAgICAgIGlmIChiICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1TZXJ2aWNlID0gSUJsdWV0b290aC5TdHViLmFzSW50ZXJmYWNlKGIpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgTG9nLncoVEFHLCAiQmx1ZXRvb3RoIFNlcnZpY2Ugbm90IGF2YWlsYWJsZSEiKTsKKworICAgICAgICAgICAgLy8gSW5zdGVhZCBvZiB0aHJvd2luZyBhbiBleGNlcHRpb24gd2hpY2ggcHJldmVudHMgcGVvcGxlIGZyb20gZ29pbmcKKyAgICAgICAgICAgIC8vIGludG8gV2lyZWxlc3Mgc2V0dGluZ3MgaW4gdGhlIGVtdWxhdG9yLiBMZXQgaXQgY3Jhc2ggbGF0ZXIKKyAgICAgICAgICAgIC8vIHdoZW4gaXQgaXMgYWN0dWFsbHkgdXNlZC4KKyAgICAgICAgICAgIG1TZXJ2aWNlID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEluaXRpYXRlIGEgUEFOIGNvbm5lY3Rpb24uCisgICAgICoKKyAgICAgKiBUaGlzIGZ1bmN0aW9uIHJldHVybnMgZmFsc2Ugb24gZXJyb3IgYW5kIHRydWUgaWYgdGhlIGNvbm5lY3Rpb24KKyAgICAgKiBhdHRlbXB0IGlzIGJlaW5nIG1hZGUuCisgICAgICoKKyAgICAgKiBMaXN0ZW4gZm9yIHtAbGluayAjQUNUSU9OX1BBTl9TVEFURV9DSEFOR0VEfSB0byBmaW5kIG91dCB3aGVuIHRoZQorICAgICAqIGNvbm5lY3Rpb24gaXMgY29tcGxldGVkLgorICAgICAqCisgICAgICogQHBhcmFtIGRldmljZSBSZW1vdGUgQlQgZGV2aWNlLgorICAgICAqIEByZXR1cm4gZmFsc2Ugb24gaW1tZWRpYXRlIGVycm9yLCB0cnVlIG90aGVyd2lzZQorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gY29ubmVjdChCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiY29ubmVjdCgiICsgZGV2aWNlICsgIikiKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5jb25uZWN0UGFuRGV2aWNlKGRldmljZSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEluaXRpYXRlIGRpc2Nvbm5lY3QgZnJvbSBQQU4uCisgICAgICoKKyAgICAgKiBUaGlzIGZ1bmN0aW9uIHJldHVybiBmYWxzZSBvbiBlcnJvciBhbmQgdHJ1ZSBpZiB0aGUgZGlzY29ubmVjdGlvbgorICAgICAqIGF0dGVtcHQgaXMgYmVpbmcgbWFkZS4KKyAgICAgKgorICAgICAqIExpc3RlbiBmb3Ige0BsaW5rICNBQ1RJT05fUEFOX1NUQVRFX0NIQU5HRUR9IHRvIGZpbmQgb3V0IHdoZW4KKyAgICAgKiBkaXNjb25uZWN0IGlzIGNvbXBsZXRlZC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KKyAgICAgKiBAcmV0dXJuIGZhbHNlIG9uIGltbWVkaWF0ZSBlcnJvciwgdHJ1ZSBvdGhlcndpc2UKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGRpc2Nvbm5lY3QoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBpZiAoREJHKSBsb2coImRpc2Nvbm5lY3QoIiArIGRldmljZSArICIpIik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZGlzY29ubmVjdFBhbkRldmljZShkZXZpY2UpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiogR2V0IHRoZSBzdGF0ZSBvZiBhIFBBTiBEZXZpY2UuCisgICAgKgorICAgICogVGhpcyBmdW5jdGlvbiByZXR1cm5zIGFuIGludCByZXByZXNlbnRpbmcgdGhlIHN0YXRlIG9mIHRoZSBQQU4gY29ubmVjdGlvbgorICAgICoKKyAgICAqICBAcGFyYW0gZGV2aWNlIFJlbW90ZSBCVCBkZXZpY2UuCisgICAgKiAgQHJldHVybiBUaGUgY3VycmVudCBzdGF0ZSBvZiB0aGUgUEFOIERldmljZQorICAgICogIEBoaWRlCisgICAgKi8KKyAgIHB1YmxpYyBpbnQgZ2V0UGFuRGV2aWNlU3RhdGUoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgIGlmIChEQkcpIGxvZygiZ2V0UGFuRGV2aWNlU3RhdGUoIiArIGRldmljZSArICIpIik7CisgICAgICAgdHJ5IHsKKyAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldFBhbkRldmljZVN0YXRlKGRldmljZSk7CisgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgIHJldHVybiBTVEFURV9ESVNDT05ORUNURUQ7CisgICAgICAgfQorICAgfQorCisgICAvKiogUmV0dXJucyBhIHNldCBvZiBhbGwgdGhlIGNvbm5lY3RlZCBQQU4gRGV2aWNlcworICAgKgorICAgKiBEb2VzIG5vdCBpbmNsdWRlIGRldmljZXMgdGhhdCBhcmUgY3VycmVudGx5IGNvbm5lY3Rpbmcgb3IgZGlzY29ubmVjdGluZworICAgKgorICAgKiBAcmV0dXJuIExpc3Qgb2YgUEFOIGRldmljZXMgb3IgZW1wdHkgb24gRXJyb3IKKyAgICogQGhpZGUKKyAgICovCisgICBwdWJsaWMgTGlzdDxCbHVldG9vdGhEZXZpY2U+IGdldENvbm5lY3RlZERldmljZXMoKSB7CisgICAgICBpZiAoREJHKSBsb2coImdldENvbm5lY3RlZERldmljZXMiKTsKKyAgICAgIHRyeSB7CisgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldENvbm5lY3RlZFBhbkRldmljZXMoKTsKKyAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgcmV0dXJuIG5ldyBBcnJheUxpc3Q8Qmx1ZXRvb3RoRGV2aWNlPigpOworICAgICAgfQor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YXRlICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgU1RBVEVfQ09OTkVDVElORyAgICA9IDE7CisgICAgLyoqIFRoZSBwcm9maWxlIGlzIGluIGNvbm5lY3RlZCBzdGF0ZSAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFNUQVRFX0NPTk5FQ1RFRCAgICAgPSAyOworICAgIC8qKiBUaGUgcHJvZmlsZSBpcyBpbiBkaXNjb25uZWN0aW5nIHN0YXRlICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgU1RBVEVfRElTQ09OTkVDVElORyA9IDM7CisKKyAgICAvKioKKyAgICAgKiBIZWFkc2V0IGFuZCBIYW5kc2ZyZWUgcHJvZmlsZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEhFQURTRVQgPSAxOworICAgIC8qKgorICAgICAqIEEyRFAgcHJvZmlsZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBBMkRQID0gMjsKKworICAgIC8qKgorICAgICAqIERlZmF1bHQgcHJpb3JpdHkgZm9yIGRldmljZXMgdGhhdCB3ZSB0cnkgdG8gYXV0by1jb25uZWN0IHRvIGFuZAorICAgICAqIGFuZCBhbGxvdyBpbmNvbWluZyBjb25uZWN0aW9ucyBmb3IgdGhlIHByb2ZpbGUKKyAgICAgKiBAaGlkZQorICAgICAqKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUklPUklUWV9BVVRPX0NPTk5FQ1QgPSAxMDAwOworCisgICAgLyoqCisgICAgICogIERlZmF1bHQgcHJpb3JpdHkgZm9yIGRldmljZXMgdGhhdCBhbGxvdyBpbmNvbWluZworICAgICAqIGFuZCBvdXRnb2luZyBjb25uZWN0aW9ucyBmb3IgdGhlIHByb2ZpbGUKKyAgICAgKiBAaGlkZQorICAgICAqKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUklPUklUWV9PTi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CisgICAgICogICAgICAgICAgICAgIHtAbGluayAjU1RBVEVfRElTQ09OTkVDVEVEfSwge0BsaW5rICNTVEFURV9ESVNDT05ORUNUSU5HfSwKKyAgICAgKiBAcmV0dXJuIExpc3Qgb2YgZGV2aWNlcy4gVGhlIGxpc3Qgd2lsbCBiZSBlbXB0eSBvbiBlcnJvci4KKyAgICAgKi8KKyAgICBwdWJsaWMgTGlzdDxCbHVldG9vdGhEZXZpY2U+IGdldERldmljZXNNYXRjaGluZ0Nvbm5lY3Rpb25TdGF0ZXMoaW50W10gc3RhdGVzKTsKKworICAgIC8qKgorICAgICAqIEdldCB0aGUgY3VycmVudCBjb25uZWN0aW9uIHN0YXRlIG9mIHRoZSBwcm9maWxlCisgICAgICoKKyAgICAgKiA8cD5SZXF1aXJlcyB7QGxpbmsgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uI0JMVUVUT09USH0KKyAgICAgKgorICAgICAqIEBwYXJhbSBkZXZpY2UgUmVtb3RlIGJsdWV0b290aCBkZXZpY2UuCisgICAgICogQHJldHVybiBTdGF0ZSBvZiB0aGUgcHJvZmlsZSBjb25uZWN0aW9uLiBPbmUgb2YKKyAgICAgKiAgICAgICAgICAgICAgIHtAbGluayAjU1RBVEVfQ09OTkVDVEVEfSwge0BsaW5rICNTVEFURV9DT05ORUNUSU5HfSwKKyAgICAgKiAgICAgICAgICAgICAgIHtAbGluayAjU1RBVEVfRElTQ09OTkVDVEVEfSwge0BsaW5rICNTVEFURV9ESVNDT05ORUNUSU5HfQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0Q29ubmVjdGlvblN0YXRlKEJsdWV0b290aERldmljZSBkZXZpY2UpOworCisgICAgLyoqCisgICAgICogU2V0IHByaW9yaXR5IG9mIHRoZSBwcm9maWxlCisgICAgICoKKyAgICAgKiA8cD4gVGhlIGRldmljZSBzaG91bGQgYWxyZWFkeSBiZSBwYWlyZWQuCisgICAgICogIFByaW9yaXR5IGNhbiBiZSBvbmUg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yAgICAgKiBBbiBpbnRlcmZhY2UgZm9yIG5vdGlmeWluZyBCbHVldG9vdGhQcm9maWxlIElQQyBjbGllbnRzIHdoZW4gdGhleSBoYXZlCisgICAgICogYmVlbiBjb25uZWN0ZWQgb3IgZGlzY29ubmVjdGVkIHRvIHRoZSBzZXJ2aWNlLgorICAgICAqLworICAgIHB1YmxpYyBpbnRlcmZhY2UgU2VydmljZUxpc3RlbmVyIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIENhbGxlZCB0byBub3RpZnkgdGhlIGNsaWVudCB3aGVuIHRoZSBwcm94eSBvYmplY3QgaGFzIGJlZW4KKyAgICAgICAgICogY29ubmVjdGVkIHRvIHRoZSBzZXJ2aWNlLgorICAgICAgICAgKiBAcGFyYW0gcHJvZmlsZSAtIE9uZSBvZiB7QGxpbmsgI0hFQURTRVR9IG9yCisgICAgICAgICAqICAgICAgICAgICAgICAgICAge0BsaW5rICNBMkRQfQorICAgICAgICAgKiBAcGFyYW0gcHJveHkgLSBPbmUgb2Yge0BsaW5rIEJsdWV0b290aEhlYWRzZXR9IG9yCisgICAgICAgICAqICAgICAgICAgICAgICAgIHtAbGluayBCbHVldG9vdGhBMmRwfQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlQ29ubmVjdGVkKGludCBwcm9maWxlLCBCbHVldG9vdGhQcm9maWxlIHByb3h5KTsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ2FsbGVkIHRvIG5vdGlmeSB0aGUgY2xpZW50IHRoYXQgdGhpcyBwcm94eSBvYmplY3QgaGFzIGJlZW4KKyAgICAgICAgICogZGlzY29ubmVjdGVkIGZyb20gdGhlIHNlcnZpY2UuCisgICAgICAgICAqIEBwYXJhbSBwcm9maWxlIC0gT25lIG9mIHtAbGluayAjSEVBRFNFVH0gb3IKKyAgICAgICAgICogICAgICAgICAgICAgICAgICB7QGxpbmsgI0EyRFB9CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9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BMkRQICYmIChuZXdTdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRCB8fAotICAgICAgICAgICAgICAgICAgICBuZXdTdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX0RJU0NPTk5FQ1RFRCkpIHsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhBMmRwLkFDVElPTl9DT05ORUNUSU9OX1NUQVRFX0NIQU5HRUQpKSB7CisgICAgICAgICAgICAgICAgaW50IG5ld1N0YXRlID0gaW50ZW50LmdldEludEV4dHJhKEJsdWV0b290aFByb2ZpbGUuRVhUUkFfU1RBVEUsIDApOworICAgICAgICAgICAgICAgIGlmIChtUHJvZmlsZSA9PSBBMkRQICYmIChuZXdTdGF0ZSA9PSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RFRCB8fAorICAgICAgICAgICAgICAgICAgICBuZXdTdGF0ZSA9PSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0RJU0NPTk5FQ1RFRCkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2UoVFJBTlNJVElPTl9UT19TVEFCTEUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhJbnB1dERldmljZS5BQ1RJT05fSU5QVVRfREVWSUNFX1NUQVRFX0NIQU5HRUQpKSB7CisgICAgICAgICAgICAgICAgaW50IG5ld1N0YXRlID0gaW50ZW50LmdldEludEV4dHJhKEJsdWV0b290aElucHV0RGV2aWNlLkVYVFJBX0lOUFVUX0RFVklDRV9TVEFURSwgMCk7CisgICAgICAgICAgICAgICAgaWYgKG1Qcm9maWxlID09IEhJRCAmJiAobmV3U3RhdGUgPT0gQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfQ09OTkVDVEVEIHx8CisgICAgICAgICAgICAgICAgICAg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WN0KCk6IEJhZCBzdGF0ZSIpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgICAgIGFjcXVpcmVXYWtlTG9jaygpOwotICAgICAgICBpZiAoY29ubmVjdE5hdGl2ZShhZGRyZXNzLCBuYW1lKSkgewotICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfQ09OTkVDVElORzsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfQ0xPU0VEOwotICAgICAgICAgICAgcmVsZWFzZVdha2VMb2NrTm93KCk7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgcHJpdmF0ZSBuYXRpdmUgYm9vbGVhbiBjb25uZWN0TmF0aXZlKFN0cmluZyBhZGRyZXNzLCBTdHJpbmcgbmFtZSk7Ci0KLSAgICAvKiogQWNjZXB0IGluY29taW5nIFNDTyBjb25uZWN0aW9ucy4KLSAgICAgKiAgRG9lcyBub3QgYmxvY2suCi0gICAgICovCi0gICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGFjY2VwdCgpIHsKLSAgICAgICAgaWYgKFZEQkcpIGxvZygiYWNjZXB0KCkgIiArIHRoaXMpOwotICAgICAgICBpZiAobVN0YXRlICE9IFNUQVRFX1JFQURZKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSBsb2coIkJhZCBzdGF0ZSIpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgICAgIGlmIChhY2NlcHROYXRpdmUoKSkgewotICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfQUNDRVBUOwotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtU3RhdGUgPSBTVEFURV9DTE9TRUQ7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7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ICAvKiBSdW5zIG9uIHRoZSBVSSB0aHJlYWQgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uUG9zdEV4ZWN1dGUoRCBkYXRhKSB7CisgICAgICAgICAgICBBc3luY1Rhc2tMb2FkZXIudGhpcy5kaXNwYXRjaE9uTG9hZENvbXBsZXRlKGRhdGEpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uQ2FuY2VsbGVkKCkgeworICAgICAgICAgICAgQXN5bmNUYXNrTG9hZGVyLnRoaXMub25DYW5jZWxsZWQocmVzdWx0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIExvYWRUYXNrIG1UYXNrOworCisgICAgcHVibGljIEFzeW5jVGFza0xvYWRlcihDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogRm9yY2UgYW4gYXN5bmNocm9ub3VzIGxvYWQuIFVubGlrZSB7QGxpbmsgI3N0YXJ0TG9hZGluZygpfSB0aGlzIHdpbGwgaWdub3JlIGEgcHJldmlvdXNseQorICAgICAqIGxvYWRlZCBkYXRhIHNldCBhbmQgbG9hZCBhIG5ldyBvbmUuCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZm9yY2VMb2FkKCkgeworICAgICAgICBjYW5jZWxMb2FkKCk7CisgICAgICAgIG1UYXNrID0gbmV3IExvYWRUYXNrKCk7CisgICAgICAgIG1UYXNrLmV4ZWN1dGUoKFZvaWRbXSkgbnVsbCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQXR0ZW1wdCB0byBjYW5jZWwgdGhlIGN1cnJlbnQgbG9hZCB0YXNrLiBTZWUge0BsaW5rIEFzeW5jVGFzayNjYW5jZWwoYm9vbGVhbil9CisgICAgICogZm9yIG1vcmUgaW5mby4KKyAgICAgKgorICAgICAqI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IEBoaWRlICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfQ09NUE9ORU5UID0gMDsKKyAgICAgICAgLyoqIEBoaWRlICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfUkVHSVNURVJFRCA9IDE7CisgICAgICAgIC8qKiBAaGlkZSAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1VOUkVHSVNURVJFRCA9IDI7CisgICAgICAgIAorICAgICAgICBmaW5hbCBpbnQgbVR5cGU7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gbU9yZGVyZWRIaW50OworICAgICAgICBmaW5hbCBib29sZWFuIG1Jbml0aWFsU3RpY2t5SGludDsKKyAgICAgICAgZmluYWwgSUJpbmRlciBtVG9rZW47CisgICAgICAgIAorICAgICAgICBpbnQgbVJlc3VsdENvZGU7CisgICAgICAgIFN0cmluZyBtUmVzdWx0RGF0YTsKKyAgICAgICAgQnVuZGxlIG1SZXN1bHRFeHRyYXM7CisgICAgICAgIGJvb2xlYW4gbUFib3J0QnJvYWRjYXN0OworICAgICAgICBib29sZWFuIG1GaW5pc2hlZDsKKyAgICAgICAgCisgICAgICAgIC8qKiBAaGlkZSAqLworICAgICAgICBwdWJsaWMgUGVuZGluZ1Jlc3VsdChpbnQgcmVzdWx0Q29kZSwgU3RyaW5nIHJlc3VsdERhdGEsIEJ1bmRsZSByZXN1bHRFeHRyYXMsCisgICAgICAgICAgICAgICAgaW50IHR5cGUsIGJvb2xlYW4gb3JkZXJlZCwgYm9vbGVhbiBzdGlja3ksIElCaW5kZXIgdG9rZW4pIHsKKyAgICAgICAgICAgIG1SZXN1bHRDb2RlID0gcmVzdWx0Q29kZTsKKyAgICAgICAgICAgIG1SZXN1bHREYXRhID0gcmVzdWx0RGF0YTsKKyAgICAgICAgICAgIG1SZXN1bHRFeHRyYXMgPSByZXN1bHRFeHRyYXM7CisgICAgICAgICAgICBtVHlwZSA9IHR5cGU7CisgICAgICAgICAgICBtT3JkZXJlZEhpbnQgPSBvcmRlcmVkOworICAgICAgICAgICAgbUluaXRpYWxTdGlja3lIaW50ID0gc3RpY2t5OworICAgICAgICAgICAgbVRva2VuID0gdG9rZW47CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBWZXJzaW9uIG9mIHtAbGluayBCcm9hZGNhc3RSZWNlaXZlciNzZXRSZXN1bHRDb2RlKGludCkKKyAgICAgICAgICogQnJvYWRjYXN0UmVjZWl2ZXIuc2V0UmVzdWx0Q29kZShpbnQpfSBmb3IKKyAgICAgICAgICogYXN5bmNocm9ub3VzIGJyb2FkY2FzdCBoYW5kbGluZy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBmaW5hbCB2b2lkIHNldFJlc3VsdENvZGUoaW50IGNvZGUpIHsKKyAgICAgICAgICAgIGNoZWNrU3luY2hyb25vdXNIaW50KCk7CisgICAgICAgICAgICBtUmVzdWx0Q29kZSA9IGNvZGU7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVmVyc2lvbiBvZiB7QGxpbmsgQnJvYWRjYXN0UmVjZWl2ZXIjZ2V0UmVzdWx0Q29kZSgpCisgICAgICAgICAqIEJyb2FkY2FzdFJlY2VpdmVyLmdldFJlc3VsdENvZGUoKX0gZm9yCisgICAgICAgICAqIGFzeW5jaHJvbm91cyBicm9hZGNhc3QgaGFuZGxpbmcuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgZmluYWwgaW50IGdldFJlc3VsdENvZGUoKSB7CisgICAgICAgICAgICByZXR1cm4gbVJlc3VsdENvZGU7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVmVyc2lvbiBvZiB7QGxpbmsgQnJvYWRjYXN0UmVjZWl2ZXIjc2V0UmVzdWx0RGF0YShTdHJpbmcpCisgICAgICAgICAqIEJyb2FkY2FzdFJlY2VpdmVyLnNldFJlc3VsdERhdGEoU3RyaW5nKX0gZm9yCisgICAgICAgICAqIGFzeW5jaHJvbm91cyBicm9hZGNhc3QgaGFuZGxpbmcuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgZmluYWwgdm9pZCBzZXRSZXN1bHREYXRhKFN0cmluZyBkYXRhKSB7CisgICAgICAgICAgICBjaGVja1N5bmNocm9ub3VzSGludCgpOworICAgICAgICAgICAgbVJlc3VsdERhdGEgPSBkYXRhOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFZlcnNpb24gb2Yge0BsaW5rIEJyb2FkY2FzdFJlY2VpdmVyI2dldFJlc3VsdERhdGEoKQorICAgICAgICAgKiBCcm9hZGNhc3RSZWNlaXZlci5nZXRSZXN1bHREYXRhKCl9IGZvcgorICAgICAgICAgKiBhc3luY2hyb25vdXMgYnJvYWRjYXN0IGhhbmRsaW5nLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyBnZXRSZXN1bHREYXRhKCkgeworICAgICAgICAgICAgcmV0dXJuIG1SZXN1bHREYXRhOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFZlcnNpb24gb2Yge0BsaW5rIEJyb2FkY2FzdFJlY2VpdmVyI3NldFJlc3VsdEV4dHJhcyhCdW5kbGUpCisgICAgICAgICAqIEJyb2FkY2FzdFJlY2VpdmVyLnNldFJlc3VsdEV4dHJhcyhCdW5kbGUpfSBmb3IKKyAgICAgICAgICogYXN5bmNocm9ub3VzIGJyb2FkY2FzdCBoYW5kbGluZy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBmaW5hbCB2b2lkIHNldFJlc3VsdEV4dHJhcyhCdW5kbGUgZXh0cmFzKSB7CisgICAgICAgICAgICBjaGVja1N5bmNocm9ub3VzSGludCgpOworICAgICAgICAgICAgbVJlc3VsdEV4dHJhcyA9IGV4dHJhczsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBWZXJzaW9uIG9mIHtAbGluayBCcm9hZGNhc3RSZWNlaXZlciNnZXRSZXN1bHRFeHRyYXMoYm9vbGVhbikKKyAgICAgICAgICogQnJvYWRjYXN0UmVjZWl2ZXIuZ2V0UmVzdWx0RXh0cmFzKGJvb2xlYW4pfSBmb3IKKyAgICAgICAgICogYXN5bmNocm9ub3VzIGJyb2FkY2FzdCBoYW5kbGluZy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBmaW5hbCBCdW5kbGUgZ2V0UmVzdWx0RXh0cmFzKGJvb2xlYW4gbWFrZU1hcCkgeworICAgICAgICAgICAgQnVuZGxlIGUgPSBtUmVzdWx0RXh0cmFzOworICAgICAgICAgICAgaWYgKCFtYWtlTWFwKSByZXR1cm4gZTsKKyAgICAgICAgICAgIGlmIChlID09IG51bGwpIG1SZXN1bHRFeHRyYXMgPSBlID0gbmV3IEJ1bmRsZSgpOworICAgICAgICAgICAgcmV0dXJuIGU7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVmVyc2lvbiBvZiB7QGxpbmsgQnJvYWRjYXN0UmVjZWl2ZXIjc2V0UmVzdWx0KGludCwgU3RyaW5nLCBCdW5kbGUpCisgICAgICAgICAqIEJyb2FkY2FzdFJlY2VpdmVyLnNldFJlc3VsdChpbnQsIFN0cmluZywgQnVuZGxlKX0gZm9yCisgICAgICAgICAqIGFzeW5jaHJvbm91cyBicm9hZGNhc3QgaGFuZGxpbmcuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgZmluYWwgdm9pZCBzZXRSZXN1bHQoaW50IGNvZGUsIFN0cmluZyBkYXRhLCBCdW5kbGUgZXh0cmFzKSB7CisgICAgICAgICAgICBjaGVja1N5bmNocm9ub3VzSGludCgpOworICAgICAgICAgICAgbVJlc3VsdENvZGUgPSBjb2RlOworICAgICAgICAgICAgbVJlc3VsdERhdGEgPSBkYXRhOworICAgICAgICAgICAgbVJlc3VsdEV4dHJhcyA9IGV4dHJhczsKKyAgICAgICAgfQorICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIFZlcnNpb24gb2Yge0BsaW5rIEJyb2FkY2FzdFJlY2VpdmVyI2dldEFib3J0QnJvYWRjYXN0KCkKKyAgICAgICAgICogQnJvYWRjYXN0UmVjZWl2ZXIuZ2V0QWJvcnRCcm9hZGNhc3QoKX0gZm9yCisgICAgICAgICAqIGFzeW5jaHJvbm91cyBicm9hZGNhc3QgaGFuZGxpbmcuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgZmluYWwgYm9vbGVhbiBnZXRBYm9ydEJyb2FkY2FzdCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtQWJvcnRCcm9hZGNhc3Q7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVmVyc2lvbiBvZiB7QGxpbmsgQnJvYWRjYXN0UmVjZWl2ZXIjYWJvcnRCcm9hZGNhc3QoKQorICAgICAgICAgKiBCcm9hZGNhc3RSZWNlaXZlci5hYm9ydEJyb2FkY2FzdCgpfSBmb3IKKyAgICAgICAgICogYXN5bmNocm9ub3VzIGJyb2FkY2FzdCBoYW5kbGluZy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBmaW5hbCB2b2lkIGFib3J0QnJvYWRjYXN0KCkgeworICAgICAgICAgICAgY2hlY2tTeW5jaHJvbm91c0hpbnQoKTsKKyAgICAgICAgICAgIG1BYm9ydEJyb2FkY2FzdCA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBWZXJzaW9uIG9mIHtAbGluayBCcm9hZGNhc3RSZWNlaXZlciNjbGVhckFib3J0QnJvYWRjYXN0KCkKKyAgICAgICAgICogQnJvYWRjYXN0UmVjZWl2ZXIuY2xlYXJBYm9ydEJyb2FkY2FzdCgpfSBmb3IKKyAgICAgICAgICogYXN5bmNocm9ub3VzIGJyb2FkY2FzdCBoYW5kbGluZy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBmaW5hb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NvIHdlIGRvbid0IGJsb2NrIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhyZWFkICh3aGljaCBtYXkgYmUgdGhlIG1haW4gdGhyZWFkKSB0byBoYXZlIGl0IGZpbmlzaGVkLgorICAgICAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgICAgICAvLyBOb3RlIHRoYXQgd2UgZG9uJ3QgbmVlZCB0byB1c2UgUXVldWVkV29yay5hZGQoKSB3aXRoIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBydW5uYWJsZSwgc2luY2Ugd2Uga25vdyB0aGUgQU0gaXMgd2FpdGluZyBmb3IgdXMgdW50aWwgdGhlCisgICAgICAgICAgICAgICAgICAgIC8vIGV4ZWN1dG9yIGdldHMgdG8gaXQuCisgICAgICAgICAgICAgICAgICAgIFF1ZXVlZFdvcmsuc2luZ2xlVGhyZWFkRXhlY3V0b3IoKS5leGVjdXRlKCBuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBAT3ZlcnJpZGUgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBY3Rpdml0eVRocmVhZC5ERUJVR19CUk9BRENBU1QpIFNsb2cuaShBY3Rpdml0eVRocmVhZC5UQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRmluaXNoaW5nIGJyb2FkY2FzdCBhZnRlciB3b3JrIHRvIGNvbXBvbmVudCAiICsgbVRva2VuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kRmluaXNoZWQobWdyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKEFjdGl2aXR5VGhyZWFkLkRFQlVHX0JST0FEQ0FTVCkgU2xvZy5pKEFjdGl2aXR5VGhyZWFkLlRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRmluaXNoaW5nIGJyb2FkY2FzdCB0byBjb21wb25lbnQgIiArIG1Ub2tlbik7CisgICAgICAgICAgICAgICAgICAgIHNlbmRGaW5pc2hlZChtZ3IpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAobU9yZGVyZWRIaW50ICYmIG1UeXBlICE9IFRZUEVfVU5SRUdJU1RFUkVEKSB7CisgICAgICAgICAgICAgICAgaWYgKEFjdGl2aXR5VGhyZWFkLkRFQlVHX0JST0FEQ0FTVCkgU2xvZy5pKEFjdGl2aXR5VGhyZWFkLlRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICJGaW5pc2hpbmcgYnJvYWRjYXN0IHRvICIgKyBtVG9rZW4pOworICAgICAgICAgICAgICAgIGZpbmFsIElBY3Rpdml0eU1hbmFnZXIgbWdyID0gQWN0aXZpdHlNYW5hZ2VyTmF0aXZlLmdldERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICBzZW5kRmluaXNoZWQobWdyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLyoqIEBoaWRlICovCisgICAgICAgIHB1YmxpYyB2b2lkIHNldEV4dHJhc0NsYXNzTG9hZGVyKENsYXNzTG9hZGVyIGNsKSB7CisgICAgICAgICAgICBpZiAobVJlc3VsdEV4dHJhcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVJlc3VsdEV4dHJhcy5zZXRDbGFzc0xvYWRlcihjbCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8qKiBAaGlkZSAqLworICAgICAgICBwdWJsaWMgdm9pZCBzZW5kRmluaXNoZWQoSUFjdGl2aXR5TWFuYWdlciBhbSkgeworICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICAgICAgaWYgKG1GaW5pc2hlZCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJCcm9hZGNhc3QgYWxyZWFkeSBmaW5pc2hlZCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtRmluaXNoZWQgPSB0cnVlOworICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1PcmRlcmVkSGludCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYW0uZmluaXNoUmVjZWl2ZXIobVRva2VuLCBtUmVzdWx0Q29kZSwgbVJlc3VsdERhdGEsIG1SZXN1bHRFeHRyYXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BYm9ydEJyb2FkY2FzdCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGJyb2FkY2FzdCB3YXMgc2VudCB0byBhIGNvbXBvbmVudDsgaXQgaXMgbm90IG9yZGVyZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBidXQgd2Ugc3RpbGwgbmVlZCB0byB0ZWxsIHRoZSBhY3Rpdml0eSBtYW5hZ2VyIHdlIGFyZSBkb25lLgorICAgICAgICAgICAgICAgICAgICAgICAgYW0uZmluaXNoUmVjZWl2ZXIobVRva2VuLCAwLCBudWxsLCBudWxsLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHZvaWQgY2hlY2tTeW5jaHJvbm91c0hpbnQoKSB7CisgICAgICAgICAgICAvLyBOb3RlIHRoYXQgd2UgZG9uJ3QgYXNzZXJ0IHdoZW4gcmVjZWl2aW5nIHRoZSBpbml0aWFsIHN0aWNreSB2YWx1ZSwKKy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ZSB0ZXh0KSB7CisgICAgICAgICAgICBtVGV4dCA9IHRleHQ7CisgICAgICAgICAgICBtSW50ZW50ID0gbnVsbDsKKyAgICAgICAgICAgIG1VcmkgPSBudWxsOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENyZWF0ZSBhbiBJdGVtIGNvbnNpc3Rpbmcgb2YgYW4gYXJiaXRyYXJ5IEludGVudC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBJdGVtKEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgICAgIG1UZXh0ID0gbnVsbDsKKyAgICAgICAgICAgIG1JbnRlbnQgPSBpbnRlbnQ7CisgICAgICAgICAgICBtVXJpID0gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBDcmVhdGUgYW4gSXRlbSBjb25zaXN0aW5nIG9mIGFuIGFyYml0cmFyeSBVUkkuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgSXRlbShVcmkgdXJpKSB7CisgICAgICAgICAgICBtVGV4dCA9IG51bGw7CisgICAgICAgICAgICBtSW50ZW50ID0gbnVsbDsKKyAgICAgICAgICAgIG1VcmkgPSB1cmk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ3JlYXRlIGEgY29tcGxleCBJdGVtLCBjb250YWluaW5nIG11bHRpcGxlIHJlcHJlc2VudGF0aW9ucyBvZgorICAgICAgICAgKiB0ZXh0LCBpbnRlbnQsIGFuZC9vciBVUkkuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgSXRlbShDaGFyU2VxdWVuY2UgdGV4dCwgSW50ZW50IGludGVudCwgVXJpIHVyaSkgeworICAgICAgICAgICAgbVRleHQgPSB0ZXh0OworICAgICAgICAgICAgbUludGVudCA9IGludGVudDsKKyAgICAgICAgICAgIG1VcmkgPSB1cmk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0cmlldmUgdGhlIHJhdyB0ZXh0IGNvbnRhaW5lZCBpbiB0aGlzIEl0ZW0uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFRleHQoKSB7CisgICAgICAgICAgICByZXR1cm4gbVRleHQ7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0cmlldmUgdGhlIHJhdyBJbnRlbnQgY29udGFpbmVkIGluIHRoaXMgSXRlbS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBJbnRlbnQgZ2V0SW50ZW50KCkgeworICAgICAgICAgICAgcmV0dXJuIG1JbnRlbnQ7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0cmlldmUgdGhlIHJhdyBVUkkgY29udGFpbmVkIGluIHRoaXMgSXRlbS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBVcmkgZ2V0VXJpKCkgeworICAgICAgICAgICAgcmV0dXJuIG1Vcmk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVHVybiB0aGlzIGl0ZW0gaW50byB0ZXh0LCByZWdhcmRsZXNzIG9mIHRoZSB0eXBlIG9mIGRhdGEgaXQKKyAgICAgICAgICogYWN0dWFsbHkgY29udGFpbnMuCisgICAgICAgICAqCisgICAgICAgICAqIDxwPlRoZSBhbGdvcml0aG0gZm9yIGRlY2lkaW5nIHdoYXQgdGV4dCB0byByZXR1cm4gaXM6CisgICAgICAgICAqIDx1bD4KKyAgICAgICAgICogPGxpPiBJZiB7QGxpbmsgI2dldFRleHR9IGlzIG5vbi1udWxsLCByZXR1cm4gdGhhdC4KKyAgICAgICAgICogPGxpPiBJZiB7QGxpbmsgI2dldFVyaX0gaXMgbm9uLW51bGwsIHRyeSB0byByZXRyaWV2ZSBpdHMgZGF0YQorICAgICAgICAgKiBhcyBhIHRleHQgc3RyZWFtIGZyb20gaXRzIGNvbnRlbnQgcHJvdmlkZXIuICBJZiB0aGlzIHN1Y2NlZWRzLCBjb3B5CisgICAgICAgICAqIHRoZSB0ZXh0IGludG8gYSBTdHJpbmcgYW5kIHJldHVybiBpdC4gIElmIGl0IGlzIG5vdCBhIGNvbnRlbnQ6IFVSSSBvcgorICAgICAgICAgKiB0aGUgY29udGVudCBwcm92aWRlciBkb2VzIG5vdCBzdXBwbHkgYSB0ZXh0IHJlcHJlc2VudGF0aW9uLCByZXR1cm4KKyAgICAgICAgICogdGhlIHJhdyBVUkkgYXMgYSBzdHJpbmcuCisgICAgICAgICAqIDxsaT4gSWYge0BsaW5rICNnZXRJbnRlbnR9IGlzIG5vbi1udWxsLCBjb252ZXJ0IHRoYXQgdG8gYW4gaW50ZW50OgorICAgICAgICAgKiBVUkkgYW5kIHJldHVybml0LgorICAgICAgICAgKiA8bGk+IE90aGVyd2lzZSwgcmV0dXJuIGFuIGVtcHR5IHN0cmluZy4KKyAgICAgICAgICogPC91bD4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGNvbnRleHQgVGhlIGNhbGxlcidzIENvbnRleHQsIGZyb20gd2hpY2ggaXRzIENvbnRlbnRSZXNvbHZlcgorICAgICAgICAgKiBhbmQgb3RoZXIgdGhpbmdzIGNhbiBiZSByZXRyaWV2ZWQuCisgICAgICAgICAqIEByZXR1cm4gUmV0dXJucyB0aGUgaXRlbSdzIHRleHR1YWwgcmVwcmVzZW50YXRpb24uCisgICAgICAgICAqLworLy9CRUdJTl9JTkNMVURFKGNvZXJjZVRvVGV4dCkKKyAgICAgICAgcHVibGljIENoYXJTZXF1ZW5jZSBjb2VyY2VUb1RleHQoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICAvLyBJZiB0aGlzIEl0ZW0gaGFzIGFuIGV4cGxpY2l0IHRleHR1YWwgdmFsdWUsIHNpbXBseSByZXR1cm4gdGhhdC4KKyAgICAgICAgICAgIGlmIChtVGV4dCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1UZXh0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBJZiB0aGlzIEl0ZW0gaGFzIGEgVVJJIHZhbHVlLCB0cnkgdXNpbmcgdGhhdC4KKyAgICAgICAgICAgIGlmIChtVXJpICE9IG51bGwpIHsKKworICAgICAgICAgICAgICAgIC8vIEZpcnN0IHNlZSBpZiB0aGUgVVJJIGNhbiBiZSBvcGVuZWQgYXMgYSBwbGFpbiB0ZXh0IHN0cmVhbQorICAgICAgICAgICAgICAgIC8vIChvZiBhbnkgc3ViLXR5cGUpLiAgSWYgc28sIHRoaXMgaXMgdGhlIGJlc3QgdGV4dHVhbAorICAgICAgICAgICAgICAgIC8vIHJlcHJlc2VudGF0aW9uIGZvciBpdC4KKyAgICAgICAgICAgICAgICBGaWxlSW5wdXRTdHJlYW0gc3RyZWFtID0gbnVsbDsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAvLyBBc2sgZm9yIGEgc3RyZWFtIG9mIHRoZSBkZXNpcmVkIHR5cGUuCisgICAgICAgICAgICAgICAgICAgIEFzc2V0RmlsZURlc2NyaXB0b3IgZGVzY3IgPSBjb250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9wZW5UeXBlZEFzc2V0RmlsZURlc2NyaXB0b3IobVVyaSwgInRleHQvKiIsIG51bGwpOworICAgICAgICAgICAgICAgICAgICBzdHJlYW0gPSBkZXNjci5jcmVhdGVJbnB1dFN0cmVhbSgpOworICAgICAgICAgICAgICAgICAgICBJbnB1dFN0cmVhbVJlYWRlciByZWFkZXIgPSBuZXcgSW5wdXRTdHJlYW1SZWFkZXIoc3RyZWFtLCAiVVRGLTgiKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBHb3QgaXQuLi4gIGNvcHkgdGhlIHN0cmVhbSBpbnRvIGEgbG9jYWwgc3RyaW5nIGFuZCByZXR1cm4gaXQuCisgICAgICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKDEyOCk7CisgICAgICAgICAgICAgICAgICAgIGNoYXJbXSBidWZmZXIgPSBuZXcgY2hhcls4MTkyXTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGxlbjsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChsZW49cmVhZGVyLnJlYWQoYnVmZmVyKSkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChidWZmZXIsIDAsIGxlbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKKworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFVuYWJsZSB0byBvcGVuIGNvbnRlbnQgVVJJIGFzIHRleHQuLi4gIG5vdCByZWFsbHkgYW4KKyAgICAgICAgICAgICAgICAgICAgLy8gZXJyb3IsIGp1c3Qgc29tZXRoaW5nIHRvIGlnbm9yZS4KKworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU29tZXRoaW5nIGJhZCBoYXMgaGFwcGVuZWQuCisgICAgICAgICAgICAgICAgICAgIExvZy53KCJDbGlwcGVkRGF0YSIsICJGYWlsdXJlIGxvYWRpbmcgdGV4dCIsIGUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZS50b1N0cmluZygpOworCisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmVhbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbS5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gSWYgd2UgY291bGRuJ3Qgb3BlbiB0aGUgVVJJIGFzIGEgc3RyZWFtLCB0aGVuIHRoZSBVUkkgaXRzZWxmCisgICAgICAgICAgICAgICAgLy8gcHJvYmFibHkgc2VydmVzIGZhaXJseSB3ZWxsIGFzIGEgdGV4dHVhbCByZXByZXNlbnRhdGlvbi4KKyAgICAgICAgICAgICAgICByZXR1cm4gbVVyaS50b1N0cmluZygpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBGaW5hbGx5LCBpZiBhbGwgd2UgaGF2ZSBpcyBhbiBJbnRlbnQsIHRoZW4gd2UgY2FuIGp1c3QgdHVybiB0aGF0CisgICAgICAgICAgICAvLyBpbnRvIHRleHQuICBOb3QgdGhlIG1vc3QgdXNlci1mcmllbmRseSB0aGluZywgYnV0IGl0J3Mgc29tZXRoaW5nLgorICAgICAgICAgICAgaWYgKG1JbnRlbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBtSW50ZW50LnRvVXJpKEludGVudC5VUklfSU5URU5UX1NDSEVNRSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFNob3VsZG4ndCBnZXQgaGVyZSwgYnV0IGp1c3QgaW4gY2FzZS4uLgorICAgICAgICAgICAgcmV0dXJuICIiOworICAgICAgICB9CisvL0VORF9JTkNMVURFKGNvZXJjZVRvVGV4dCkKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDcmVhdGUgYSBuZXcgY2xpcC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBsYWJlbCBMYWJlbCB0byBzaG93IHRvIHRoZSB1c2VyIGRlc2NyaWJpbmcgdGhpcyBjbGlwLgorICAgICAqIEBwYXJhbSBtaW1lVHlwZXMgQW4gYXJyYXkgb2YgTUlNRSB0eXBlcy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N0cmluZ1tdIHsgcmVhbFR5cGUsIENsaXBEZXNjcmlwdGlvbi5NSU1FVFlQRV9URVhUX1VSSUxJU1QgfTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIFN0cmluZ1tdIHRtcCA9IG5ldyBTdHJpbmdbbWltZVR5cGVzLmxlbmd0aCArIChyZWFsVHlwZSAhPSBudWxsID8gMiA6IDEpXTsKKyAgICAgICAgICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgICAgICAgICAgaWYgKHJlYWxUeXBlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdG1wWzBdID0gcmVhbFR5cGU7CisgICAgICAgICAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtaW1lVHlwZXMsIDAsIHRtcCwgaSwgbWltZVR5cGVzLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgdG1wW2kgKyBtaW1lVHlwZXMubGVuZ3RoXSA9IENsaXBEZXNjcmlwdGlvbi5NSU1FVFlQRV9URVhUX1VSSUxJU1Q7CisgICAgICAgICAgICAgICAgbWltZVR5cGVzID0gdG1wOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChtaW1lVHlwZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgbWltZVR5cGVzID0gTUlNRVRZUEVTX1RFWFRfVVJJTElTVDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbmV3IENsaXBEYXRhKGxhYmVsLCBtaW1lVHlwZXMsIGljb24sIGl0ZW0pOworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZSBhIG5ldyBDbGlwRGF0YSBob2xkaW5nIGFuIFVSSSB3aXRoIE1JTUUgdHlwZQorICAgICAqIHtAbGluayBDbGlwRGVzY3JpcHRpb24jTUlNRVRZUEVfVEVYVF9VUklMSVNUfS4KKyAgICAgKiBVbmxpa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IHsKKyAgICAgICAgcmV0dXJuIG1DbGlwRGVzY3JpcHRpb247CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGFkZEl0ZW0oSXRlbSBpdGVtKSB7CisgICAgICAgIGlmIChpdGVtID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiaXRlbSBpcyBudWxsIik7CisgICAgICAgIH0KKyAgICAgICAgbUl0ZW1zLmFkZChpdGVtKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQml0bWFwIGdldEljb24oKSB7CisgICAgICAgIHJldHVybiBtSWNvbjsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldEl0ZW1Db3VudCgpIHsKKyAgICAgICAgcmV0dXJuIG1JdGVtcy5zaXplKCk7CisgICAgfQorCisgICAgcHVibGljIEl0ZW0gZ2V0SXRlbShpbnQgaW5kZXgpIHsKKyAgICAgICAgcmV0dXJuIG1JdGVtcy5nZXQoaW5kZXgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgIG1DbGlwRGVzY3JpcHRpb24ud3JpdGVUb1BhcmNlbChkZXN0LCBmbGFncyk7CisgICAgICAgIGlmIChtSWNvbiAhPSBudWxsKSB7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KDEpOworICAgICAgICAgICAgbUljb24ud3JpdGVUb1BhcmNlbChkZXN0LCBmbGFncyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KDApOworICAgICAgICB9CisgICAgICAgIGZpbmFsIGludCBOID0gbUl0ZW1zLnNpemUoKTsKKyAgICAgICAgZGVzdC53cml0ZUludChOKTsKKyAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgSXRlbSBpdGVtID0gbUl0ZW1zLmdldChpKTsKKyAgICAgICAgICAgIFRleHRVdGlscy53cml0ZVRvUGFyY2VsKGl0ZW0ubVRleHQsIGRlc3QsIGZsYWdzKTsKKyAgICAgICAgICAgIGlmIChpdGVtLm1JbnRlbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMSk7CisgICAgICAgICAgICAgICAgaXRlbS5tSW50ZW50LndyaXRlVG9QYXJjZWwoZGVzdCwgZmxhZ3MpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBkZXN0LndyaXRlSW50KDApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGl0ZW0ubVVyaSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZGVzdC53cml0ZUludCgxKTsKKyAgICAgICAgICAgICAgICBpdGVtLm1Vcmkud3JpdGVUb1BhcmNlbChkZXN0LCBmbGFncyk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBDbGlwRGF0YShQYXJjZWwgaW4pIHsKKyAgICAgICAgbUNsaXBEZXNjcmlwdGlvbiA9IG5ldyBDbGlwRGVzY3JpcHRpb24oaW4pOworICAgICAgICBpZiAoaW4ucmVhZEludCgpICE9IDApIHsKKyAgICAgICAgICAgIG1JY29uID0gQml0bWFwLkNSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChpbik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtSWNvbiA9IG51bGw7CisgICAgICAgIH0KKyAgICAgICAgZmluYWwgaW50IE4gPSBpbi5yZWFkSW50KCk7CisgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyA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gICAgICAgIGlmICh0eXBlTGVuZ3RoID09IHNsYXNocG9zKzIgJiYgZGVzaXJlZFR5cGUuY2hhckF0KHNsYXNocG9zKzEpID09ICcqJykgeworICAgICAgICAgICAgICAgIGlmIChkZXNpcmVkVHlwZS5yZWdpb25NYXRjaGVzKDAsIGNvbmNyZXRlVHlwZSwgMCwgc2xhc2hwb3MrMSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChkZXNpcmVkVHlwZS5lcXVhbHMoY29uY3JldGVUeXBlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgbGFiZWwgZm9yIHRoaXMgY2xpcC4KKyAgICAgKi8KKyAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldExhYmVsKCkgeworICAgICAgICByZXR1cm4gbUxhYmVsOworICAgIH0KKworICAgIC8qKgorICAgICAqIENoZWNrIHdoZXRoZXIgdGhlIGNsaXAgZGVzY3JpcHRpb24gY29udGFpbnMgdGhlIGdpdmVuIE1JTUUgdHlwZS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBtaW1lVHlwZSBUaGUgZGVzaXJlZCBNSU1FIHR5cGUuICBNYXkgYmUgYSBwYXR0ZXJuLgorICAgICAqIEByZXR1cm4gUmV0dXJucyB0cnVlIGlmIG9uZSBvZiB0aGUgTUlNRSB0eXBlcyBpbiB0aGUgY2xpcCBkZXNjcmlwdGlvbgorICAgICAqIG1hdGNoZXMgdGhlIGRlc2lyZWQgTUlNRSB0eXBlLCBlbHNlIGZhbHNlLgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGhhc01pbWVUeXBlKFN0cmluZyBtaW1lVHlwZSkgeworICAgICAgICBmb3IgKGludCBpPTA7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OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBhcnJheS5hZGQobU1pbWVUeXBlc1tpXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKGFycmF5ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIFN0cmluZ1tdIHJhd0FycmF5ID0gbmV3IFN0cmluZ1thcnJheS5zaXplKCldOworICAgICAgICBhcnJheS50b0FycmF5KHJhd0FycmF5KTsKKyAgICAgICAgcmV0dXJuIHJhd0FycmF5OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgbnVtYmVyIG9mIE1JTUUgdHlwZXMgdGhlIGNsaXAgaXMgYXZhaWxhYmxlIGluLgorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0TWltZVR5cGVDb3VudCgpIHsKKyAgICAgICAgcmV0dXJuIG1NaW1lVHlwZXMubGVuZ3RoOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiBvbmUgb2YgdGhlIHBvc3NpYmxlIGNsaXAgTUlNRSB0eXBlcy4KKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIGdldE1pbWVUeXBlKGludCBpbmRleCkgeworICAgICAgICByZXR1cm4gbU1pbWVUeXBlc1tpbmRleF07CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgcHVibGljIHZvaWQgdmFsaWRhdGUoKSB7CisgICAgICAgIGlmIChtTWltZVR5cGVzID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigibnVsbCBtaW1lIHR5cGVzIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1NaW1lVHlwZXMubGVuZ3RoIDw9IDApIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIm11c3QgaGF2ZSBhdCBsZWFzdCAxIG1pbWUgdHlwZSIpOworICAgICAgICB9CisgICAgICAgIGZvciAoaW50IGk9MDsgaTxtTWltZVR5cGVzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBpZiAobU1pbWVUeXBlc1tpXSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJtaW1lIHR5cGUgYXQgIiArIGkgKyAiIGlzIG51bGwiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgIFRleHRVdGlscy53cml0ZVRvUGFyY2VsKG1MYWJlbCwgZGVzdCwgZmxhZ3MpOworICAgICAgICBkZXN0LndyaXRlU3RyaW5nQXJyYXkobU1pbWVUeXBlcyk7CisgICAgfQorCisgICAgQ2xpcERlc2NyaXB0aW9uKFBhcmNlbCBpbikgeworICAgICAgICBtTGFiZWwgPSBUZXh0VXRpbHMuQ0hBUl9TRVFVRU5DRV9DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoaW4pOworICAgICAgICBtTWltZVR5cGVzID0gaW4uY3JlYXRlU3RyaW5nQXJyYXkoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFBhcmNlbGFibGUuQ3JlYXRvcjxDbGlwRGVzY3JpcHRpb24+IENSRUFUT1IgPQorICAgICAgICBuZXcgUGFyY2VsYWJsZS5DcmVhdG9yPENsaXBEZXNjcmlwdGlvbj4oKSB7CisKKyAgICAgICAgICAgIHB1YmxpYyBDbGlwRGVzY3JpcHRpb24gY3JlYXRlRnJvbVBhcmNlbChQYXJjZWwgc291cmNlKSB7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VuZXIuU3R1YigpIHsKKyAgICAgICAgcHVibGljIHZvaWQgZGlzcGF0Y2hQcmltYXJ5Q2xpcENoYW5nZWQoKSB7CisgICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKE1TR19SRVBPUlRfUFJJTUFSWV9DTElQX0NIQU5HRUQpOworICAgICAgICB9CisgICAgfTsKKworICAgIHN0YXRpYyBmaW5hbCBpbnQgTVNHX1JFUE9SVF9QUklNQVJZX0NMSVBfQ0hBTkdFRCA9IDE7CisKKyAgICBwcml2YXRlIGZpbmFsIEhhbmRsZXIgbUhhbmRsZXIgPSBuZXcgSGFuZGxlcigpIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19SRVBPUlRfUFJJTUFSWV9DTElQX0NIQU5HRUQ6CisgICAgICAgICAgICAgICAgICAgIHJlcG9ydFByaW1hcnlDbGlwQ2hhbmdlZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHB1YmxpYyBpbnRlcmZhY2UgT25QcmltYXJ5Q2xpcENoYW5nZWRMaXN0ZW5lciB7CisgICAgICAgIHZvaWQgb25QcmltYXJ5Q2xpcENoYW5nZWQoKTsKKyAgICB9CisKKyAgICBzdGF0aWMgcHJpdmF0ZSBJQ2xpcGJvYXJkIGdldFNlcnZpY2UoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAoc1N0YXRpY0xvY2spIHsKKyAgICAgICAgICAgIGlmIChzU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHNTZXJ2aWNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgSUJpbmRlciBiID0gU2VydmljZU1hbmFnZXIuZ2V0U2VydmljZSgiY2xpcGJvYX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KSB7CisgICAgICAgICAgICBpZiAobVByaW1hcnlDbGlwQ2hhbmdlZExpc3RlbmVycy5zaXplKCkgPT0gMCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGdldFNlcnZpY2UoKS5hZGRQcmltYXJ5Q2xpcENoYW5nZWRMaXN0ZW5lcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJpbWFyeUNsaXBDaGFuZ2VkU2VydmljZUxpc3RlbmVyKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1QcmltYXJ5Q2xpcENoYW5nZWRMaXN0ZW5lcnMuYWRkKHdoYXQpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcmVtb3ZlUHJpbWFyeUNsaXBDaGFuZ2VkTGlzdGVuZXIoT25QcmltYXJ5Q2xpcENoYW5nZWRMaXN0ZW5lciB3aGF0KSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobVByaW1hcnlDbGlwQ2hhbmdlZExpc3RlbmVycykgeworICAgICAgICAgICAgbVByaW1hcnlDbGlwQ2hhbmdlZExpc3RlbmVycy5yZW1vdmUod2hhdCk7CisgICAgICAgICAgICBpZiAobVByaW1hcnlDbGlwQ2hhbmdlZExpc3RlbmVycy5zaXplKCkgPT0gMCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGdldFNlcnZpY2UoKS5yZW1vdmVQcmltYXJ5Q2xpcENoYW5nZWRMaXN0ZW5lcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJpbWFyeUNsaXBDaGFuZ2VkU2VydmljZUxpc3RlbmVyKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgI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FuIGhhc1RleHQoKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0U2VydmljZSgpLmhhc1ByaW1hcnlDbGlwKCk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIHJlcG9ydFByaW1hcnlDbGlwQ2hhbmdlZCgpIHsKKyAgICAgICAgT2JqZWN0W10gbGlzdGVuZXJzOworCisgICAgICAgIHN5bmNocm9uaXplZCAobVByaW1hcnlDbGlwQ2hhbmdlZExpc3RlbmVycykgeworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtUHJpbWFyeUNsaXBDaGFuZ2VkTGlzdGVuZXJzLnNpemUoKTsKKyAgICAgICAgICAgIGlmIChOIDw9IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBsaXN0ZW5lcnMgPSBtUHJpbWFyeUNsaXBDaGFuZ2VkTGlzdGVuZXJzLnRvQXJyYXkoKTsKKyAgICAgICAgfQorCisgICAgICAgIGZvciAoaW50IGk9MDsgaTxsaXN0ZW5lcnMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICgoT25QcmltYXJ5Q2xpcENoYW5nZWRMaXN0ZW5lcilsaXN0ZW5lcnNbaV0pLm9uUHJpbWFyeUNsaXBDaGFuZ2VkKCk7CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L0NvbnRlbnRQcm92aWRlci5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9Db250ZW50UHJvdmlkZXIuamF2YQppbmRleCAxZDZlOGI4Li42YmIzMmMxIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L0NvbnRlbnRQcm92aWRlci5qYXZhC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BBc3luY1Rhc2s8T2JqZWN0LCBPYmplY3QsIE9iamVjdD4gdGFzayA9IG5ldyBBc3luY1Rhc2s8T2JqZWN0LCBPYmplY3QsIE9iamVjdD4oKSB7CisgICAgICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgICAgcHJvdGVjdGVkIE9iamVjdCBkb0luQmFja2dyb3VuZChPYmplY3QuLi4gcGFyYW1zKSB7CisgICAgICAgICAgICAgICAgICAgIGZ1bmMud3JpdGVEYXRhVG9QaXBlKGZkc1sxXSwgdXJpLCBtaW1lVHlwZSwgb3B0cywgYXJncyk7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmZHNbMV0uY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRmFpbHVyZSBjbG9zaW5nIHBpcGUiLCBlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdGFzay5leGVjdXRlKChPYmplY3RbXSludWxsKTsKKworICAgICAgICAgICAgcmV0dXJuIGZkc1swXTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IEZpbGVOb3RGb3VuZEV4Y2VwdGlvbigiZmFpbHVyZSBtYWtpbmcgcGlwZSIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCiAgICAgICogUmV0dXJucyB0cnVlIGlmIHRoaXMgaW5zdGFuY2UgaXMgYSB0ZW1wb3JhcnkgY29udGVudCBwcm92aWRlci4KICAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhpcyBpbnN0YW5jZSBpcyBhIHRlbXBvcmFyeSBjb250ZW50IHByb3ZpZGV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JhdGlvbnMpCiAgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uLCBPcGVyYXRpb25BcHBsaWNhdGlvbkV4Y2VwdGlvbiB7CiAgICAgICAgIHJldHVybiBtQ29udGVudFByb3ZpZGVyLmFwcGx5QmF0Y2gob3BlcmF0aW9ucyk7CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L0NvbnRlbnRQcm92aWRlck5hdGl2ZS5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9Db250ZW50UHJvdmlkZXJOYXRpdmUuamF2YQppbmRleCBmZGIzZDIwLi5kMWFiOGQ1IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L0NvbnRlbnRQcm92aWRlck5hdGl2ZS5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvQ29udGVudFByb3ZpZGVyTmF0aXZlLmphdmEKQEAgLTI1Nyw2ICsyNTcsMzggQEAKICAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVCdW5kbGUocmVzcG9uc2VCdW5kbGUpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXNlIEdFVF9TVFJFQU1fVFlQRVNfVFJBTlNBQ1RJT046CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUNvbnRlbnRQcm92aWRlci5kZXNjcmlwdG9yKTsKKyAgICAgICAgICAgICAgICAgICAgVXJpIHVybCA9IFVyaS5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoZGF0YSk7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBtaW1lVHlwZUZpbHRlciA9IGRhdGEucmVhZFN0cmluZygpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSB0eXBlcyA9IGdldFN0cmVhbVR5cGVzKHVybCwgbWltZVR5cGVGaWx0ZXIpOworICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlU3RyaW5nQXJyYXkodHlwZXMpOworCisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNhc2UgT1BFTl9UWVBFRF9BU1NFVF9GSUxFX1RSQU5TQUNUSU9OOgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElDb250ZW50UHJvdmlkZXIuZGVzY3JpcHRvcik7CisgICAgICAgICAgICAgICAgICAgIFVyaSB1cmwgPSBVcmkuQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKGRhdGEpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbWltZVR5cGUgPSBkYXRhLnJlYWRTdHJpbmcoKTsKKyAgICAgICAgICAgICAgICAgICAgQnVuZGxlIG9wdHMgPSBkYXRhLnJlYWRCdW5kbGUoKTsKKworICAgICAgICAgICAgICAgICAgICBBc3NldEZpbGVEZXNjcmlwdG9yIGZkOworICAgICAgICAgICAgICAgICAgICBmZCA9IG9wZW5UeXBlZEFzc2V0RmlsZSh1cmwsIG1pbWVUeXBlLCBvcHRzKTsKKyAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVOb0V4Y2VwdGlvbigpOworICAgICAgICAgICAgICAgICAgICBpZiAoZmQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVJbnQoMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBmZC53cml0ZVRvUGFyY2VsKHJlcGx5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxhYmxlLlBBUkNFTEFCTEVfV1JJVEVfUkVUVVJOX1ZBTFVFKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlSW50KDApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMud3JpdGVFeGNlcHRpb25Ub1BhcmNlbChyZXBseSwgZSk7CkBAIC01NjgsNSArNjAwLDUwIEBACiAgICAgICAgIHJldHVybiBidW5kbGU7CiAgICAgfQogCisgICAgcHVibGljIFN0cmluZ1tdIGdldFN0cmVhbVR5cGVzKFVyaSB1cmwsIFN0cmluZyBtaW1lVHlwZUZpbHRlcikgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbgorICAgIHsKKyAgICAgICAgUGFyY2VsIGRhdGEgPSBQYXJjZWwub2J0YWluKCk7CisgICAgICAgIFBhcmNlbCByZXBseSA9IFBhcmNlbC5vYnRhaW4oKTsKKworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbnRlbnRQcm92aWRlci5kZXNjcmlwdG9yKTsKKworICAgICAgICB1cmwud3JpdGVUb1BhcmNlbChkYXRhLCAwKTsKKyAgICAgICAgZGF0YS53cml0ZVN0cmluZyhtaW1lVHlwZUZpbHRlcik7CisKKyAgICAgICAgbVJlbW90ZS50cmFuc2FjdChJQ29udGVudFByb3ZpZGVyLkdFVF9TVFJFQU1fVFlQRVNfVFJBTlNBQ1RJT04sIGRhdGEsIHJlcGx5LCAwKTsKKworICAgICAgICBEYXRhYmFzZVV0aWxzLnJlYWRFeGNlcHRpb25Gcm9tUGFyY2VsKHJlcGx5KTsKKyAgICAgICAgU3RyaW5nW10gb3V0ID0gcmVwbHkuY3JlYXRlU3RyaW5nQXJyYXkoKTsKKworICAgICAgICBkYXRhLnJlY3ljbGUoKTsKKyAgICAgICAgcmVwbHkucmVjeWNsZSgpOworCisgICAgICAgIHJldHVybiBvdXQ7CisgICAgfQorCisgICAgcHVibGljIEFzc2V0RmlsZURlc2NyaXB0b3Igb3BlblR5cGVkQXNzZXRGaWxlKFVyaSB1cmwsIFN0cmluZyBtaW1lVHlwZSwgQnVuZGxlIG9wdHMpCisgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uLCBGaWxlTm90Rm91bmRFeGNlcHRpb24geworICAgICAgICBQYXJjZWwgZGF0YSA9IFBhcmNlbC5vYnRhaW4oKTsKKyAgICAgICAgUGFyY2VsIHJlcGx5ID0gUGFyY2VsLm9idGFpbigpOworCisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQ29udGVudFByb3ZpZGVyLmRlc2NyaXB0b3IpOworCisgICAgICAgIHVybC53cml0ZVRvUGFyY2VsKGRhdGEsIDApOworICAgICAgICBkYXRhLndyaXRlU3RyaW5nKG1pbWVUeXBlKTsKKyAgICAgICAgZGF0YS53cml0ZUJ1bmRsZShvcHRzKTsKKworICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KElDb250ZW50UHJvdmlkZXIuT1BFTl9UWVBFRF9BU1NFVF9GSUxFX1RSQU5TQUNUSU9OLCBkYXRhLCByZXBseSwgMCk7CisKKyAgICAgICAgRGF0YWJhc2VVdGlscy5yZWFkRXhjZXB0aW9uV2l0aEZpbGVOb3RGb3VuZEV4Y2VwdGlvbkZyb21QYXJjZWwocmVwbHkpOworICAgICAgICBpbnQgaGFzID0gcmVwbHkucmVhZEludCgpOworICAgICAgICBBc3NldEZpbGVEZXNjcmlwdG9yIGZkID0gaGFzICE9IDAKKyAgICAgICAgICAgICAgICA/IEFzc2V0RmlsZURlc2NyaXB0b3IuQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKHJlcGx5KSA6IG51bGw7CisKKyAgICAgICAgZGF0YS5yZWN5Y2xlKCk7Cisg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RQcm92aWRlci5vcGVuQXNzZXRGaWxlfS4KQEAgLTQ3NiwyOSArNTEyLDk3IEBACiAgICAgICAgICAgICAgICAgICAgIG5ldyBGaWxlKHVyaS5nZXRQYXRoKCkpLCBtb2RlVG9Nb2RlKHVyaSwgbW9kZSkpOwogICAgICAgICAgICAgcmV0dXJuIG5ldyBBc3NldEZpbGVEZXNjcmlwdG9yKHBmZCwgMCwgLTEpOwogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgSUNvbnRlbnRQcm92aWRlciBwcm92aWRlciA9IGFjcXVpcmVQcm92aWRlcih1cmkpOwotICAgICAgICAgICAgaWYgKHByb3ZpZGVyID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRmlsZU5vdEZvdW5kRXhjZXB0aW9uKCJObyBjb250ZW50IHByb3ZpZGVyOiAiICsgdXJpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgQXNzZXRGaWxlRGVzY3JpcHRvciBmZCA9IHByb3ZpZGVyLm9wZW5Bc3NldEZpbGUodXJpLCBtb2RlKTsKLSAgICAgICAgICAgICAgICBpZihmZCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlbGVhc2VQcm92aWRlcihwcm92aWRlcik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgaWYgKCJyIi5lcXVhbHMobW9kZSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gb3BlblR5cGVkQXNzZXRGaWxlRGVzY3JpcHRvcih1cmksICIqLyoiLCBudWxsKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgSUNvbnRlbnRQcm92aWRlciBwcm92aWRlciA9IGFjcXVpcmVQcm92aWRlcih1cmkpOworICAgICAgICAgICAgICAgIGlmIChwcm92aWRlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGaWxlTm90Rm91bmRFeGNlcHRpb24oIk5vIGNvbnRlbnQgcHJvdmlkZXI6ICIgKyB1cmkpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvciBwZmQgPSBuZXcgUGFyY2VsRmlsZURlc2NyaXB0b3JJbm5lcigKLSAgICAgICAgICAgICAgICAgICAgICAgIGZkLmdldFBhcmNlbEZpbGVEZXNjcmlwdG9yKCksIHByb3ZpZGVyKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEFzc2V0RmlsZURlc2NyaXB0b3IocGZkLCBmZC5nZXRTdGFydE9mZnNldCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgZmQuZ2V0RGVjbGFyZWRMZW5ndGgoKSk7Ci0gICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIEFzc2V0RmlsZURlc2NyaXB0b3IgZmQgPSBwcm92aWRlci5vcGVuQXNzZXRGaWxlKHVyaSwgbW9kZSk7CisgICAgICAgICAgICAgICAgICAgIGlmKGZkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbGVhc2VQcm92aWRlcihwcm92aWRlcik7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvciBwZmQgPSBuZXcgUGFyY2VsRmlsZURlc2NyaXB0b3JJbm5lcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZC5nZXRQYXJjZWxGaWxlRGVzY3JpcHRvcigpLCBwcm92aWRlcik7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gU3VjY2VzcyEgIERvbid0IHJlbGVhc2UgdGhlIHByb3ZpZGVyIHdoZW4gZXhpdGluZywgbGV0CisgICAgICAgICAgICAgICAgICAgIC8vIFBhcmNlbEZpbGVEZXNjcmlwdG9ySW5uZXIgZG8gdGhhdCB3aGVuIGl0IGlzIGNsb3NlZC4KKyAgICAgICAgICAgICAgICAgICAgcHJvdmlkZXIgPSBudWxsOworCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQXNzZXRGaWxlRGVzY3JpcHRvcihwZmQsIGZkLmdldFN0YXJ0T2Zmc2V0KCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmQuZ2V0RGVjbGFyZWRMZW5ndGgoKSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZpbGVOb3RGb3VuZEV4Y2VwdGlvbigiRGVhZCBjb250ZW50IHByb3ZpZGVyOiAiICsgdXJpKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBlOworICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwcm92aWRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZWxlYXNlUHJvdmlkZXIocHJvdmlkZXIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogT3BlbiBhIHJhdyBmaWxlIGRlc2NyaXB0b3IgdG8gYWNjZXNzIChwb3RlbnRpYWxseSB0eXBlIHRyYW5zZm9ybWVkKQorICAgICAqIGRhdGEgZnJvbSBhICJjb250ZW50OiIgVVJJLiAgVGhpcyBpbnRlcmFjdHMgd2l0aCB0aGUgdW5kZXJseWluZworICAgICAqIHtAbGluayBDb250ZW50UHJvdmlkZXIjb3BlblR5cGVkQXNzZXRGaWxlfSBtZXRob2Qg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W5kRXhjZXB0aW9uKCJObyBjb250ZW50IHByb3ZpZGVyOiAiICsgdXJpKTsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgQXNzZXRGaWxlRGVzY3JpcHRvciBmZCA9IHByb3ZpZGVyLm9wZW5UeXBlZEFzc2V0RmlsZSh1cmksIG1pbWVUeXBlLCBvcHRzKTsKKyAgICAgICAgICAgIGlmIChmZCA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgcmVsZWFzZVByb3ZpZGVyKHByb3ZpZGVyKTsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRmlsZU5vdEZvdW5kRXhjZXB0aW9uKCJEZWFkIGNvbnRlbnQgcHJvdmlkZXI6ICIgKyB1cmkpOwotICAgICAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIHBmZCA9IG5ldyBQYXJjZWxGaWxlRGVzY3JpcHRvcklubmVyKAorICAgICAgICAgICAgICAgICAgICBmZC5nZXRQYXJjZWxGaWxlRGVzY3JpcHRvcigpLCBwcm92aWRlcik7CisKKyAgICAgICAgICAgIC8vIFN1Y2Nlc3MhICBEb24ndCByZWxlYXNlIHRoZSBwcm92aWRlciB3aGVuIGV4aXRpbmcsIGxldAorICAgICAgICAgICAgLy8gUGFyY2VsRmlsZURlc2NyaXB0b3JJbm5lciBkbyB0aGF0IHdoZW4gaXQgaXMgY2xvc2VkLgorICAgICAgICAgICAgcHJvdmlkZXIgPSBudWxsOworCisgICAgICAgICAgICByZXR1cm4gbmV3IEFzc2V0RmlsZURlc2NyaXB0b3IocGZkLCBmZC5nZXRTdGFydE9mZnNldCgpLAorICAgICAgICAgICAgICAgICAgICBmZC5nZXREZWNsYXJlZExlbmd0aCgpKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBGaWxlTm90Rm91bmRFeGNlcHRpb24oIkRlYWQgY29udGVudCBwcm92aWRlcjogIiArIHVyaSk7CisgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB0aHJvdyBlOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKHByb3ZpZGVyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICByZWxlYXNlUHJvdmlkZXIocHJvdmlkZXIpOwotICAgICAgICAgICAgICAgIHRocm93IGU7Ci0gICAgICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICByZWxlYXNlUHJvdmlkZXIocHJvdmlkZXIpOwotICAgICAgICAgICAgICAgIHRocm93IGU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0xMjE1LDEyICsxMzE5LDM2IEBACiAgICAgfQogCiAgICAgLyoqCi0gICAgICogSWYgYSBzeW5jIGlzIGFjdGl2ZSByZXR1cm5zIHRoZSBpbmZvcm1hdGlvbiBhYm91dCBpdCwgb3RoZXJ3aXNlIHJldHVybnMgZmFsc2UuCisgICAgICogSWYgYSBzeW5jIGlzIGFjdGl2ZSByZXR1cm5zIHRoZSBpbmZvcm1hdGlvbiBhYm91dCBpdCwgb3RoZXJ3aXNlIHJldHVybnMgbnVsbC4KKyAgICAgKiA8cD4KICAgICAgKiBAcmV0dXJuIHRoZSBTeW5jSW5mbyBmb3IgdGhlIGN1cnJlbnRseSBhY3RpdmUgc3luYyBvciBudWxsIGlmIG9uZSBpcyBub3QgYWN0aXZlLgorICAgICAqIEBkZXByZWNhdGVkCisgICAgICogU2luY2UgbXVsdGlwbGUgY29uY3VycmVudCBzeW5jcyBhcmUgbm93IHN1cHBvcnRlZCB5b3Ugc2hvdWxkIHVzZQorICAgICAqIHtAbGluayAjZ2V0Q3VycmVudFN5bmNzKCl9IHRvIGdldCB0aGUgYWNjdXJhdGUgbGlzdCBvZiBjdXJyZW50IHN5bmNzLgorICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgdGhlIGZpcnN0IGl0ZW0gZnJvbSB0aGUgbGlzdCBvZiBjdXJyZW50IHN5bmNzCisgICAgICogb3IgbnVsbCBpZiB0aGVyZSBhcmUgbm9uZS4KICAgICAgKi8KKyAgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBzdGF0aWMgU3luY0luZm8gZ2V0Q3VycmVudFN5bmMoKSB7CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICByZXR1cm4gZ2V0Q29udGVudFNlcnZpY2UoKS5nZXRDdXJyZW50U3luYygpOworICAgICAgICAgICAgZmluYWwgTGlzdDxTeW5jSW5mbz4gc3luY3MgPSBnZXRDb250ZW50U2VydmljZSgpLmdldEN1cnJlbnRTeW5jcygpOworICAgICAgICAgICAgaWYgKHN5bmNzLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHN5bmNzLmdldCgwKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJ0aGUgQ29udGVudFNlcnZpY2Ugc2hvdWxkIGFsd2F5cyBiZSByZWFjaGFibGUiLCBlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgYSBsaXN0IHdpdGggaW5mb3JtYXRpb24gYWJvdXQgYWxsIHRoZSBhY3RpdmUgc3luY3MuIFRoaXMgbGlzdCB3aWxsIGJlIGVtcHR5CisgICAgICogaWYgdGhlcmUgYXJlIG5vIGFjdGl2ZSBzeW5jcy4KKyAgICAgKiBAcmV0dXJuIGEgTGlzdCBvZi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ikgeworICAgICAgICAgICAgICAgIHJldHVybiAoKE51bWJlcikgdmFsdWUpLmludFZhbHVlKCkgIT0gMDsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ2Fubm90IGNhc3QgdmFsdWUgZm9yICIgKyBrZXkgKyAiIHRvIGEgQm9vbGVhbjogIiArIHZhbHVlLCBlKTsKICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKQEAgLTQ0Niw2ICs0NDgsMTUgQEAKICAgICAgICAgcmV0dXJuIG1WYWx1ZXMuZW50cnlTZXQoKTsKICAgICB9CiAKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIGEgc2V0IG9mIGFsbCBvZiB0aGUga2V5cworICAgICAqCisgICAgICogQHJldHVybiBhIHNldCBvZiBhbGwgb2YgdGhlIGtleXMKKyAgICAgKi8KKyAgICBwdWJsaWMgU2V0PFN0cmluZz4ga2V5U2V0KCkgeworICAgICAgICByZXR1cm4gbVZhbHVlcy5rZXlTZXQoKTsKKyAgICB9CisKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFBhcmNlbGFibGUuQ3JlYXRvcjxDb250ZW50VmFsdWVzPiBDUkVBVE9SID0KICAgICAgICAgICAgIG5ldyBQYXJjZWxhYmxlLkNyZWF0b3I8Q29udGVudFZhbHVlcz4oKSB7CiAgICAgICAgIEBTdXBwcmVzc1dhcm5pbmdzKHsiZGVwcmVjYXRpb24iLCAidW5jaGVja2VkIn0pCkBAIC00ODgsNiArNDk5LDEwIEBACiAgICAgICAgIHJldHVybiAoQXJyYXlMaXN0PFN0cmluZz4pIG1WYWx1ZXMuZ2V0KGtleSk7CiAgICAgfQogCisgICAgLyoqCisgICAgICogUmV0dXJucyBhIHN0cmluZyBjb250YWluaW5nIGEgY29uY2lzZSwgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhpcyBvYmplY3QuCisgICAgICogQHJldHVybiBhIHByaW50YWJsZSByZXBy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GVsaXZlclJlc3VsdChtQ3Vyc29yKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGZvcmNlTG9hZCgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogTXVzdCBiZSBjYWxsZWQgZnJvbSB0aGUgVUkgdGhyZWFkCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc3RvcExvYWRpbmcoKSB7CisgICAgICAgIGlmIChtQ3Vyc29yICE9IG51bGwgJiYgIW1DdXJzb3IuaXNDbG9zZWQoKSkgeworICAgICAgICAgICAgbUN1cnNvci5jbG9zZSgpOworICAgICAgICB9CisgICAgICAgIG1DdXJzb3IgPSBudWxsOworCisgICAgICAgIC8vIEF0dGVtcHQgdG8gY2FuY2VsIHRoZSBjdXJyZW50IGxvYWQgdGFzayBpZiBwb3NzaWJsZS4KKyAgICAgICAgY2FuY2VsTG9hZCgpOworCisgICAgICAgIC8vIE1ha2Ugc3VyZSB0aGF0IGFueSBvdXRzdGFuZGluZyBsb2FkcyBjbGVhbiB0aGVtc2VsdmVzIHVwIHByb3Blcmx5CisgICAgICAgIG1TdG9wcGVkID0gdHJ1ZTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvbkNhbmNlbGxlZChDdXJzb3IgY3Vyc29yKSB7CisgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCAmJiAhY3Vyc29yLmlzQ2xvc2VkKCkpIHsKKyAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZGVzdHJveSgpIHsKKyAgICAgICAgLy8gRW5zdXJlIHRoZSBsb2FkZXIgaXMgc3RvcHBlZAorICAgICAgICBzdG9wTG9hZGluZygpOworICAgIH0KKworICAgIHB1YmxpYyBVcmkgZ2V0VXJpKCkgeworICAgICAgICByZXR1cm4gbVVyaTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRVcmkoVXJpIHVyaSkgeworICAgICAgICBtVXJpID0gdXJpOworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRQcm9qZWN0aW9uKCkgeworICAgICAgICByZXR1cm4gbVByb2plY3Rpb247CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UHJvamVjdGlvbihTdHJpbmdbXSBwcm9qZWN0aW9uKSB7CisgICAgICAgIG1Qcm9qZWN0aW9uID0gcHJvamVjdGlvbjsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nIGdldFNlbGVjdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIG1TZWxlY3Rpb247CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0U2VsZWN0aW9uKFN0cmluZyBzZWxlY3Rpb24pIHsKKyAgICAgICAgbVNlbGVjdGlvbiA9IHNlbGVjdGlvbjsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nW10gZ2V0U2VsZWN0aW9uQXJncygpIHsKKyAgICAgICAgcmV0dXJuIG1TZWxlY3Rpb25BcmdzOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFNlbGVjdGlvbkFyZ3MoU3RyaW5nW10gc2VsZWN0aW9uQXJncykgeworICAgICAgICBtU2VsZWN0aW9uQXJncyA9IHNlbGVjdGlvbkFyZ3M7CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBnZXRTb3J0T3JkZXIoKSB7CisgICAgICAgIHJldHVybiBtU29ydE9yZGVyOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFNvcnRPcmRlcihTdHJpbmcgc29ydE9yZGVyKSB7CisgICAgICAgIG1Tb3J0T3JkZXIgPSBzb3J0T3JkZXI7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9JQ2xpcGJvYXJkLmFpZGwgYi9jb3JlL2phdmEvYW5kcm9pZC9jb250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U1lOQ19PQlNFUlZFUl9UWVBFX1NFVFRJTkdTLCBuZXcgSVN5bmNTdGF0dXNPYnNlcnZlci5TdHViKCkgewogICAgICAgICAgICAgcHVibGljIHZvaWQgb25TdGF0dXNDaGFuZ2VkKGludCB3aGljaCkgewpAQCAtNDI1LDggKzQyNyw4IEBACiAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KCk7CiAgICAgICAgIGludGVudC5zZXRBY3Rpb24oImFuZHJvaWQuY29udGVudC5TeW5jQWRhcHRlciIpOwogICAgICAgICBpbnRlbnQuc2V0Q29tcG9uZW50KHN5bmNBZGFwdGVySW5mby5jb21wb25lbnROYW1lKTsKLSAgICAgICAgaWYgKCFtQ29udGV4dC5iaW5kU2VydmljZShpbnRlbnQsIG5ldyBJbml0aWFsaXplclNlcnZpY2VDb25uZWN0aW9uKGFjY291bnQsIGF1dGhvcml0eSwgbUNvbnRleHQsCi0gICAgICAgICAgICAgICAgbU1haW5IYW5kbGVyKSwKKyAgICAgICAgaWYgKCFtQ29udGV4dC5iaW5kU2VydmljZShpbnRlbnQsCisgICAgICAgICAgICAgICAgbmV3IEluaXRpYWxpemVyU2VydmljZUNvbm5lY3Rpb24oYWNjb3VudCwgYXV0aG9yaXR5LCBtQ29udGV4dCwgbU1haW5IYW5kbGVyKSwKICAgICAgICAgICAgICAgICBDb250ZXh0LkJJTkRfQVVUT19DUkVBVEUgfCBDb250ZXh0LkJJTkRfTk9UX0ZPUkVHUk9VTkQpKSB7CiAgICAgICAgICAgICBMb2cudyhUQUcsICJpbml0aWFsaXplU3luY0FkYXB0ZXI6IGZhaWxlZCB0byBiaW5kIHRvICIgKyBpbnRlbnQpOwogICAgICAgICB9CkBAIC01MDYsOCArNTA4LDggQEAKICAgICAgKiBAcGFyYW0gcmVxdWVzdGVkQWNjb3VudCB0aGUgYWNjb3VudCB0byBzeW5jLCBtYXkgYmUgbnVsbCB0byBzaWduaWZ5IGFsbCBhY2NvdW50cwogICAgICAqIEBwYXJhbSByZXF1ZXN0ZWRBdXRob3JpdHkgdGhlIGF1dGhvcml0eSB0byBzeW5jLCBtYXkgYmUgbnVsbCB0byBpbmRpY2F0ZSBhbGwgYXV0aG9yaXRpZXMKICAgICAgKiBAcGFyYW0gZXh0cmFzIGEgTWFwIG9mIFN5bmNBZGFwdGVyLXNwZWNpZmljIGluZm9ybWF0aW9uIHRvIGNvbnRyb2wKLSogICAgICAgICAgc3luY3Mgb2YgYSBzcGVjaWZpYyBwcm92aWRlci4gQ2FuIGJlIG51bGwuIElzIGlnbm9yZWQKLSogICAgICAgICAgaWYgdGhlIHVybCBpcyBudWxsLgorICAgICAqICAgICAgICAgIHN5bmNzIG9mIGEgc3BlY2lmaWMgcHJvdmlkZXIuIENhbiBiZSBudWxsLiBJcyBpZ25vcmVkCisgICAgICogICAgICAgICAgaWYgdGhlIHVybCBpcyBudWxsLgogICAgICAqIEBwYXJhbSBkZWxheSBob3cgbWFueSBtaWxsaXNlY29uZHMgaW4gdGhlIGZ1dHVyZSB0byB3YWl0IGJlZm9yZSBwZXJmb3JtaW5nIHRoaXMKICAgICAgKiBAcGFyYW0gb25seVRob3NlV2l0aFVua293blN5bmNhYmxlU3RhdGUKICAgICAgKi8KQEAgLTYxMSwxNiArNjEzLDI5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgICAgIGlmIChpc0xvZ2dhYmxlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJzY2hlZHVsZVN5bmM6IgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGVsYXkgIiArIGRlbGF5Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgc291cmNlICIgKyBzb3VyY2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCBhY2NvdW50ICIgKyBhY2NvdW50Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgYXV0aG9yaXR5ICIgKyBhdXRob3JpdHkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCBleHRyYXMgIiArIGV4dHJhcyk7CisgICAgICAgICAgICAgICAgICAgIFBhaXI8TG9uZywgTG9uZz4gYmFja29mZiA9IG1TeW5jU3RvcmFnZUVuZ2luZS5nZXRCYWNrb2ZmKGFjY291bnQsIGF1dGhvcml0eSk7CisgICAgICAgICAgICAgICAgICAgIGxvbmcgZGVsYXlVbnRpbCA9IG1TeW5jU3RvcmFnZUVuZ2luZS5nZXREZWxheVVudGlsVGltZShhY2NvdW50LCBhdXRob3JpdHkpOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGJhY2tvZmZUaW1lID0gYmFja29mZiAhPSBudWxsID8gYmFja29mZi5maXJzdCA6IDA7CisgICAgICAgICAgICAgICAgICAgIGlmIChpc1N5bmNhYmxlIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgQnVuZGxlIG5ld0V4dHJhcyA9IG5ldyBCdW5kbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ld0V4dHJhcy5wdXRCb29sZWFuKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19JTklUSUFMSVpFLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjaGVkdWxlU3luY09wZXJhdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFN5bmNPcGVyYXRpb24oYWNjb3VudCwgc291cmNlLCBhdXRob3JpdHksIG5ld0V4dHJhcywgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrb2ZmVGltZSwgZGVsYXlVbnRpbCkpOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHNjaGVkdWxlU3luY09wZXJhdGlvbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3luY09wZXJhdGlvbihhY2NvdW50LCBzb3VyY2UsIGF1dGhvcml0eSwgZXh0cmFzLCBkZWxheSkpOworICAgICAgICAgICAgICAgICAgICBpZiAoIW9ubHlUaG9zZVdpdGhVbmtvd25TeW5jYWJsZVN0YXRlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInNjaGVkdWxlU3luYzoiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGVsYXkgIiArIGRlbGF5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIHNvdXJjZSAiICsgc291cmNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIGFjY291bnQgIiArIGFjY291bnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgYXV0aG9yaXR5ICIgKyBhdXRob3JpdHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgZXh0cmFzICIgKyBleHRyYXMpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NoZWR1bGVTeW5jT3BlcmF0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3luY09wZXJhdGlvbihhY2NvdW50LCBzb3VyY2UsIGF1dGhvcml0eSwgZXh0cmFzLCBkZWxheSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrb2ZmVGltZSwgZGVsYXlVbnRpbCkpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC02MzQsNyArNjQ5LDggQEAKICAgICB9CiAKICAgICBwdWJsaWMgU3luY0FkYXB0ZXJUeXBlW10gZ2V0U3luY0FkYXB0ZXJUeXBlcygpIHsKLSAgICA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C5iYWNrb2ZmID0gYmFja29mZjsKKyAgICAgICAgb3AudXBkYXRlRWZmZWN0aXZlUnVuVGltZSgpOworCisgICAgICAgIHN5bmNocm9uaXplZCAobVN5bmNRdWV1ZSkgeworICAgICAgICAgICAgbVN5bmNRdWV1ZS5vbkJhY2tvZmZDaGFuZ2VkKG9wLmFjY291bnQsIG9wLmF1dGhvcml0eSwgYmFja29mZik7CisgICAgICAgIH0KICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgc2V0RGVsYXlVbnRpbFRpbWUoU3luY09wZXJhdGlvbiBvcCwgbG9uZyBkZWxheVVudGlsU2Vjb25kcykgewpAQCAtNzIzLDYgKzc1MSw5IEBACiAgICAgICAgICAgICBuZXdEZWxheVVudGlsVGltZSA9IDA7CiAgICAgICAgIH0KICAgICAgICAgbVN5bmNTdG9yYWdlRW5naW5lLnNldERlbGF5VW50aWxUaW1lKG9wLmFjY291bnQsIG9wLmF1dGhvcml0eSwgbmV3RGVsYXlVbnRpbFRpbWUpOworICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jUXVldWUpIHsKKyAgICAgICAgICAgIG1TeW5jUXVldWUub25EZWxheVVudGlsVGltZUNoYW5nZWQob3AuYWNjb3VudCwgb3AuYXV0aG9yaXR5LCBuZXdEZWxheVVudGlsVGltZSk7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTczMSwyMyArNzYyLDcgQEAKICAgICAgKiBAcGFyYW0gYXV0aG9yaXR5IGxpbWl0IHRoZSBjYW5jZWxhdGlvbnMgdG8gc3luY3Mgd2l0aCB0aGlzIGF1dGhvcml0eSwgaWYgbm9uLW51bGwKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBjYW5jZWxBY3RpdmVTeW5jKEFjY291bnQgYWNjb3VudCwgU3RyaW5nIGF1dGhvcml0eSkgewotICAgICAgICBBY3RpdmVTeW5jQ29udGV4dCBhY3RpdmVTeW5jQ29udGV4dCA9IG1BY3RpdmVTeW5jQ29udGV4dDsKLSAgICAgICAgaWYgKGFjdGl2ZVN5bmNDb250ZXh0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIC8vIGlmIGFuIGF1dGhvcml0eSB3YXMgc3BlY2lmaWVkIHRoZW4gb25seSBjYW5jZWwgdGhlIHN5bmMgaWYgaXQgbWF0Y2hlcwotICAgICAgICAgICAgaWYgKGFjY291bnQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmICghYWNjb3VudC5lcXVhbHMoYWN0aXZlU3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uYWNjb3VudCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIGlmIGFuIGFjY291bnQgd2FzIHNwZWNpZmllZCB0aGVuIG9ubHkgY2FuY2VsIHRoZSBzeW5jIGlmIGl0IG1hdGNoZXMKLSAgICAgICAgICAgIGlmIChhdXRob3JpdHkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmICghYXV0aG9yaXR5LmVxdWFscyhhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbi5hdXRob3JpdHkpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzZW5kU3luY0ZpbmlzaGVkT3JDYW5jZWxlZE1lc3NhZ2UoYWN0aXZlU3luY0NvbnRleHQsCi0gICAgICAgICAgICAgICAgICAgIG51bGwgLyogbm8gcmVzdWx0IHNpbmNlIHRoaXMgaXMgYSBjYW5jZWwgKi8pOwotICAgICAgICB9CisgICAgICAgIHNlbmRDYW5jZWxTeW5jc01lc3NhZ2UoYWNjb3VudCwgYXV0aG9yaXR5KTsKICAgICB9CiAKICAgICAvKioKQEAgLTc1NiwyMiArNzcxLDYgQEAKICAgICAgKiBAcGFyYW0gc3luY09wZXJhdGlvbiB0aGUgU3lu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k7CiAgICAgICAgICAgICBMb2cuZChUQUcsICJyZXRyeWluZyBzeW5jIG9wZXJhdGlvbiBhcyBhIHR3by13YXkgc3luYyBiZWNhdXNlIGFuIHVwbG9hZC1vbmx5IHN5bmMgIgogICAgICAgICAgICAgICAgICAgICArICJlbmNvdW50ZXJlZCBhbiBlcnJvcjogIiArIG9wZXJhdGlvbik7CkBAIC04NDgsNyArODQ4LDggQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHNjaGVkdWxlU3luY09wZXJhdGlvbihuZXcgU3luY09wZXJhdGlvbihvcGVyYXRpb24uYWNjb3VudCwgb3BlcmF0aW9uLnN5bmNTb3VyY2UsCiAgICAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbi5hdXRob3JpdHksIG9wZXJhdGlvbi5leHRyYXMsCi0gICAgICAgICAgICAgICAgICAgIERFTEFZX1JFVFJZX1NZTkNfSU5fUFJPR1JFU1NfSU5fU0VDT05EUyAqIDEwMDApKTsKKyAgICAgICAgICAgICAgICAgICAgREVMQVlfUkVUUllfU1lOQ19JTl9QUk9HUkVTU19JTl9TRUNPTkRTICogMTAwMCwKKyAgICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uLmJhY2tvZmYsIG9wZXJhdGlvbi5kZWxheVVudGlsKSk7CiAgICAgICAgIH0gZWxzZSBpZiAoc3luY1Jlc3VsdC5oYXNTb2Z0RXJyb3IoKSkgewogICAgICAgICAgICAgaWYgKGlzTG9nZ2FibGUpIHsKICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJyZXRyeWluZyBzeW5jIG9wZXJhdGlvbiBiZWNhdXNlIGl0IGVuY291bnRlcmVkIGEgc29mdCBlcnJvcjogIgpAQCAtODcxLDE1ICs4NzIsMzMgQEAKICAgICAgICAgZmluYWwgbG9uZyBtU3RhcnRUaW1lOwogICAgICAgICBsb25nIG1UaW1lb3V0U3RhcnRUaW1lOwogICAgICAgICBib29sZWFuIG1Cb3VuZDsKKyAgICAgICAgZmluYWwgUG93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G8gdGhhdCBhcHBsaWNhdGlvbi4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBBY3RpdmVTeW5jQ29udGV4dChTeW5jT3BlcmF0aW9uIHN5bmNPcGVyYXRpb24sIGxvbmcgaGlzdG9yeVJvd0lkLAorICAgICAgICAgICAgICAgIGludCBzeW5jQWRhcHRlclVpZCkgewogICAgICAgICAgICAgc3VwZXIoKTsKKyAgICAgICAgICAgIG1TeW5jQWRhcHRlclVpZCA9IHN5bmNBZGFwdGVyVWlkOwogICAgICAgICAgICAgbVN5bmNPcGVyYXRpb24gPSBzeW5jT3BlcmF0aW9uOwogICAgICAgICAgICAgbUhpc3RvcnlSb3dJZCA9IGhpc3RvcnlSb3dJZDsKICAgICAgICAgICAgIG1TeW5jQWRhcHRlciA9IG51bGw7CiAgICAgICAgICAgICBtU3RhcnRUaW1lID0gU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCk7CiAgICAgICAgICAgICBtVGltZW91dFN0YXJ0VGltZSA9IG1TdGFydFRpbWU7CisgICAgICAgICAgICBtU3luY1dha2VMb2NrID0gbVN5bmNIYW5kbGVyLmdldFN5bmNXYWtlTG9jaygKKyAgICAgICAgICAgICAgICAgICAgbVN5bmNPcGVyYXRpb24uYWNjb3VudC50eXBlLCBtU3luY09wZXJhdGlvbi5hdXRob3JpdHkpOworICAgICAgICAgICAgbVN5bmNXYWtlTG9jay5zZXRXb3JrU291cmNlKG5ldyBXb3JrU291cmNlKHN5bmNBZGFwdGVyVWlkKSk7CisgICAgICAgICAgICBtU3luY1dha2VMb2NrLmFjcXVpcmUoKTsKICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIHNlbmRIZWFydGJlYXQoKSB7CkBAIC04ODcsNiArOTA2LDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIG9uRmluaXNoZWQoU3luY1Jlc3VsdCByZXN1bHQpIHsKKyAgICAgICAgICAgIGlmIChMb2cuaXNM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IG1TeW5jV2FrZUxvY2sucmVsZWFzZSgpOwogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlCkBAIC0xMDAxLDYyICsxMDI3LDI4IEBACiAgICAgICAgICAgICBwdy5wcmludGxuKCJubyBhbGFybSBpcyBzY2hlZHVsZWQgKHRoZXJlIGhhZCBiZXR0ZXIgbm90IGJlIGFueSBwZW5kaW5nIHN5bmNzKSIpOwogICAgICAgICB9CiAKLSAgICAgICAgZmluYWwgU3luY01hbmFnZXIuQWN0aXZlU3luY0NvbnRleHQgYWN0aXZlU3luY0NvbnRleHQgPSBtQWN0aXZlU3luY0NvbnRleHQ7Ci0KLSAgICAgICAgcHcucHJpbnQoImFjdGl2ZSBzeW5jOiAiKTsgcHcucHJpbnRsbihhY3RpdmVTeW5jQ29udGV4dCk7Ci0KICAgICAgICAgcHcucHJpbnQoIm5vdGlmaWNhdGlvbiBpbmZvOiAiKTsKICAgICAgICAgc2Iuc2V0TGVuZ3RoKDApOwogICAgICAgICBtU3luY0hhbmRsZXIubVN5bmNOb3RpZmljYXRpb25JbmZvLnRvU3RyaW5nKHNiKTsKICAgICAgICAgcHcucHJpbnRsbihzYi50b1N0cmluZygpKTsKIAorICAgICAgICBwdy5wcmludGxuKCk7CisgICAgICAgIHB3LnByaW50bG4oIkFjdGl2ZSBTeW5jczogIiArIG1BY3RpdmVTeW5jQ29udGV4dHMuc2l6ZSgpKTsKKyAgICAgICAgZm9yIChTeW5jTWFuYWdlci5BY3RpdmVTeW5jQ29udGV4dCBhY3RpdmVTeW5jQ29udGV4dCA6IG1BY3RpdmVTeW5jQ29udGV4dHMpIHsKKyAgICAgICAgICAgIGZpbmFsIGxvbmcgZHVyYXRpb25JblNlY29uZHMgPSAobm93IC0gYWN0aXZlU3luY0NvbnRleHQubVN0YXJ0VGltZSkgLyAxMDAwOworICAgICAgICAgICAgcHcucHJpbnQoIiAgIik7CisgICAgICAgICAgICBwdy5wcmludChEYXRlVXRpbHMuZm9ybWF0RWxhcHNlZFRpbWUoZHVyYXRpb25JblNlY29uZHMpKTsKKyAgICAgICAgICAgIHB3LnByaW50KCIgLSAiKTsKKyAgICAgICAgICAgIHB3LnByaW50KGFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jT3BlcmF0aW9uLmR1bXAoZmFsc2UpKTsKKyAgICAgICAgICAgIHB3LnByaW50bG4oKTsKKyAgICAgICAgfQorCiAgICAgICAgIHN5bmNocm9uaXplZCAobVN5bmNRdWV1ZSkgewotICAgICAgICAgICAgcHcucHJpbnQoInN5bmMgcXVldWU6ICIpOwogICAgICAgICAgICAgc2Iuc2V0TGVuZ3RoKDApOwogICAgICAgICAgICAgbVN5bmNRdWV1ZS5kdW1wKHNiKTsKLSAgICAgICAgICAgIHB3LnByaW50bG4oc2IudG9TdHJpbmcoKSk7CiAgICAgICAgIH0KLQotICAgICAgICBTeW5jSW5mbyBhY3RpdmUgPSBtU3luY1N0b3JhZ2VFbmdpbmUuZ2V0Q3VycmVudFN5bmMoKTsKLSAgICAgICAgaWYgKGFjdGl2ZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBTeW5jU3RvcmFnZUVuZ2luZS5BdXRob3JpdHlJbmZvIGF1dGhvcml0eQotICAgICAgICAgICAgICAgICAgICA9IG1TeW5jU3RvcmFnZUVuZ2luZS5nZXRBdXRob3JpdHkoYWN0aXZlLmF1dGhvcml0eUlkKTsKLSAgICAgICAgICAgIGZpbmFsIGxvbmcgZHVyYXRpb25JblNlY29uZHMgPSAobm93IC0gYWN0aXZlLnN0YXJ0VGltZSkgLyAxMDAwOwotICAgICAgICAgICAgcHcucHJpbnQoIkFjdGl2ZSBzeW5jOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoYXV0aG9yaXR5ICE9IG51bGwgPyBhdXRob3JpdHkuYWNjb3VudCA6ICI8bm8gYWNjb3VudD4iKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAiKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoYXV0aG9yaXR5ICE9IG51bGwgPyBhdXRob3JpdHkuYXV0aG9yaXR5IDogIjxubyBhY2NvdW50PiIpOwotICAgICAgICAgICAgICAgICAgICBpZiAoYWN0aXZlU3luY0NvbnRleHQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KFN5bmNTdG9yYWdlRW5naW5lLlNPVVJDRVNbCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jT3BlcmF0aW9uLnN5bmNTb3VyY2VdKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiLCBkdXJhdGlvbiBpcyAiKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihEYXRlVXRpbHMuZm9ybWF0RWxhcHNlZFRpbWUoZHVyYXRpb25JblNlY29uZHMpKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHB3LnByaW50bG4oIk5vIHN5bmMgaXMgaW4gcHJvZ3Jlc3MuIik7Ci0gICAgICAgIH0KLQotICAgICAgICBBcnJheUxpc3Q8U3luY1N0b3JhZ2VFbmdpbmUuUGVuZGluZ09wZXJhdGlvbj4gb3BzCi0gICAgICAgICAgICAgICAgPSBtU3luY1N0b3JhZ2VFbmdpbmUuZ2V0UGVuZGluZ09wZXJhdGlvbnMoKTsKLSAgICAgICAgaWYgKG9wcyAhPSBudWxsICYmIG9wcy5zaXplKCkgPiAwKSB7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCk7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCJQZW5kaW5nIFN5bmNzIik7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG9wcy5zaXplKCk7Ci0gICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgU3luY1N0b3JhZ2VFbmdpbmUuUGVuZGluZ09wZXJhdGlvbiBvcCA9IG9wcy5nZXQoaSk7Ci0gICAgICAgICAgICAgICAgcHcucHJpbnQoIiAgIyIpOyBwdy5wcmludChpKTsgcHcucHJpbnQoIjogYWNjb3VudD0iKTsKLSAgICAgICAgICAgICAgICBwdy5wcmludChvcC5hY2NvdW50Lm5hbWUpOyBwdy5wcmludCgiOiIpOwotICAgICAgICAgICAgICAgIHB3LnByaW50KG9wLmFjY291bnQudHlwZSk7IHB3LnByaW50KCIgYXV0aG9yaXR5PSIpOwotICAgICAgICAgICAgICAgIHB3LnByaW50KG9wLmF1dGhvcml0eSk7IHB3LnByaW50KCIgZXhwZWRpdGVkPSIpOwotICAgICAgICAgICAgICAgIHB3LnByaW50bG4ob3AuZXhwZWRpdGVkKTsKLSAgICAgICAgICAgICAgICBpZiAob3AuZXh0cmFzICE9IG51bGwgJiYgb3AuZXh0cmFzLnNpemUoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgc2Iuc2V0TGVuZ3RoKDApOwotICAgICAgICAgICAgICAgICAgICBTeW5jT3BlcmF0aW9uLmV4dHJhc1RvU3RyaW5nQnVpbGRlcihvcC5leHRyYXMsIHNiLCBmYWxzZSAvKiBhc0tleSAqLyk7Ci0gICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgICAgZXh0cmFzOiAiKTsgcHcucHJpbnRsbihzYi50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKyAgICAgICAgcHcucHJpbnRsbigpOworICAgICAgICBwdy5wcmludChzYi50b1N0cmluZygpKTsKIAogICAgICAgICAvLyBqb2luIHRoZSBpbnN0YWxsZWQgc3luYyBhZGFwdGVyIHdpdGggdGhlIGFjY291bnRzIGxpc3QgYW5kIGVtaXQgZm9yIGV2ZXJ5dGhpbmcKICAgICAgICAgcHcucHJpbnRsbigpOwpAQCAtM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dXRob3JpdHkpOworICAgICAgICAgICAgUG93ZXJNYW5hZ2VyLldha2VMb2NrIHdha2VMb2NrID0gbVdha2VMb2Nrcy5nZXQod2FrZUxvY2tLZXkpOworICAgICAgICAgICAgaWYgKHdha2VMb2NrID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbmFtZSA9IFNZTkNfV0FLRV9MT0NLX1BSRUZJWCArICJfIiArIGF1dGhvcml0eSArICJfIiArIGFjY291bnRUeXBlOworICAgICAgICAgICAgICAgIHdha2VMb2NrID0gbVBvd2VyTWFuYWdlci5uZXdXYWtlTG9jayhQb3dlck1hbmFnZXIuUEFSVElBTF9XQUtFX0xPQ0ssIG5hbWUpOworICAgICAgICAgICAgICAgIHdha2VMb2NrLnNldFJlZmVyZW5jZUNvdW50ZWQoZmFsc2UpOworICAgICAgICAgICAgICAgIG1XYWtlTG9ja3MucHV0KHdha2VMb2NrS2V5LCB3YWtlTG9jayk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gd2FrZUxvY2s7CisgICAgICAgIH0KKwogICAgICAgICBwcml2YXRlIHZvaWQgd2FpdFVudGlsUmVhZHlUb1J1bigpIHsKICAgICAgICAgICAgIENvdW50RG93bkxhdGNoIGxhdGNoID0gbVJlYWR5VG9SdW5MYXRjaDsKICAgICAgICAgICAgIGlmIChsYXRjaCAhPSBudWxsKSB7CkBAIC0xMzM0LDEyICsxMzM4LDYgQEAKICAgICAgICAgICogVXNlZCB0byBrZWVwIHRyYWNrIG9mIHdoZXRoZXIgYSBzeW5jIG5vdGlmaWNhdGlvbiBpcyBhY3RpdmUgYW5kIHdobyBpdCBpcyBmb3IuCiAgICAgICAgICAqLwogICAgICAgICBjbGFzcyBTeW5jTm90aWZpY2F0aW9uSW5mbyB7Ci0gICAgICAgICAgICAvLyBvbmx5IHZhbGlkIGlmIGlzQWN0aXZlIGlzIHRydWUKLSAgICAgICAgICAgIHB1YmxpYyBBY2NvdW50IGFjY291bnQ7Ci0KLSAgICAgICAgICAgIC8vIG9ubHkgdmFsaWQgaWYgaXNBY3RpdmUgaXMgdHJ1ZQotICAgICAgICAgICAgcHVibGljIFN0cmluZyBhdXRob3JpdHk7Ci0KICAgICAgICAgICAgIC8vIHRydWUgaWZmIHRoZSBub3RpZmljYXRpb24gbWFuYWdlciBoYXMgYmVlbiBhc2tlZCB0byBzZW5kIHRoZSBub3RpZmljYXRpb24KICAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQWN0aXZlID0gZmFsc2U7CiAKQEAgLTEzNDgsMTAgKzEzNDYsNyBAQAogICAgICAgICAgICAgcHVibGljIExvbmcgc3RhcnRUaW1lID0gbnVsbDsKIAogICAgICAgICAgICAgcHVibGljIHZvaWQgdG9TdHJpbmcoU3RyaW5nQnVpbGRlciBzYikgewotICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiYWNjb3VudCAiKS5hcHBlbmQoYWNjb3VudCkKLSAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoIiwgYXV0aG9yaXR5ICIpLmFwcGVuZChhdXRob3JpdHkpCi0gICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCIsIGlzQWN0aXZlICIpLmFwcGVuZChpc0FjdGl2ZSkKLSAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoIiwgc3RhcnRUaW1lICIpLmFwcGVuZChzdGFydFRpbWUpOworICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiaXNBY3RpdmUgIikuYXBwZW5kKGlzQWN0aXZlKS5hcHBlbmQoIiwgc3RhcnRUaW1lICIpLmFwcGVuZChzdGFydFRpbWUpOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBAT3ZlcnJpZGUKQEAgLTEzNjcsNjAgKzEzNjIsNzIgQEAKICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKLSAgICAgICAgICAgIExvbmcgZWFybGllc3RGdXR1cmVQb2xsVGltZSA9IG51bGw7CisgICAgICAgICAgICBsb25nIGVhcmxpZXN0RnV0dXJlUG9sbFRpbWUgPSBMb25nLk1BWF9WQUxVRTsKKyAgICAgICAgICAgIGxvbmcgbmV4dFBlbmRpbmdTeW5jVGltZSA9IExvbmcuTUFYX1ZBTFVFOwogICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICB3YWl0VW50aWxSZWFkeVRvUnVuKCk7CisgICAgICAgICAgICAgICAgbVN5bmNNYW5hZ2VyV2FrZUxvY2suYWNxdWlyZSgpOwogICAgICAgICAgICAgICAgIC8vIEFsd2F5cyBkbyB0aGlzIGZpcnN0IHNvIHRoYXQgd2UgYmUgc3VyZSB0aGF0IGFueSBwZXJpb2RpYyBzeW5jcyB0aGF0CiAgICAgICAgICAgICAgICAgLy8gYXJlIHJlYWR5IHRvIHJ1biBoYXZlIGJlZW4gY29udmVydGVkIGludG8gcGVuZGluZyBzeW5jcy4gVGhpcyBhbGxvd3MgdGhlCiAgICAgICAgICAgICAgICAgLy8gbG9naWMgdGhhdCBjb25zaWRlcnMgdGhlIG5leHQgc3RlcHMgdG8gdGFrZSBiYXNlZCBvbiB0aGUgc2V0IG9mIHBlbmRpbmcgc3luY3MKICAgICAgICAgICAgICAgICAvLyB0byBhbHNvIHRha2UgaW50byBhY2NvdW50IHRoZSBwZXJpb2RpYyBzeW5jcy4KICAgICAgICAgICAgICAgICBlYXJsaWVzdEZ1dHVyZVBvbGxUaW1lID0gc2NoZWR1bGVSZWFkeVBlcmlvZGljU3luY3MoKTsKICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU3luY0hhbmRsZXIuTUVTU0FHRV9DQU5DRUw6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFBhaXI8QWNjb3VudCwgU3RyaW5nPiBwYXlsb2FkID0gKFBhaXI8QWNjb3VudCwgU3RyaW5nPiltc2cub2JqOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiaGFuZGxlU3luY0hhbmRsZXJNZXNzYWdlOiBNRVNTQUdFX1NFUlZJQ0VfQ0FOQ0VMOiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHBheWxvYWQuZmlyc3QgKyAiLCAiICsgcGF5bG9hZC5zZWNvbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgY2FuY2VsQWN0aXZlU3luY0xvY2tlZChwYXlsb2FkLmZpcnN0LCBwYXlsb2FkLnNlY29uZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXh0UGVuZGluZ1N5bmNUaW1lID0gbWF5YmVTdGFydE5leHRTeW5jTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgICAgIGNhc2UgU3luY0hhbmRsZXIuTUVTU0FHRV9TWU5DX0ZJTklTSEVEOgogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiaGFuZGxlU3luY0hhbmRsZXJNZXNzYWdlOiBNRVNTQUdFX1NZTkNfRklOSVNIRUQiKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIFN5bmNIYW5kbGVyTWVzc2FnZVBheWxvYWQgcGF5bG9hZCA9IChTeW5jSGFuZGxlck1lc3NhZ2VQYXlsb2FkKW1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVN5bmNDb250ZXh0ICE9IHBheWxvYWQuYWN0aXZlU3luY0NvbnRleHQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJoYW5kbGVTeW5jSGFuZGxlck1lc3NhZ2U6IHN5bmMgY29udGV4dCBkb2Vzbid0IG1hdGNoLCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJkcm9wcGluZzogbUFjdGl2ZVN5bmNDb250ZXh0ICIgKyBtQWN0aXZlU3luY0NvbnRleHQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiAhPSAiICsgcGF5bG9hZC5hY3RpdmVTeW5jQ29udGV4dCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc1N5bmNTdGlsbEFjdGl2ZShwYXlsb2FkLmFjdGl2ZVN5bmNDb250ZXh0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImhhbmRsZVN5bmNIYW5kbGVyTWVzc2FnZTogZHJvcHBpbmcgc2luY2UgdGhlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgInN5bmMgaXMgbm8gbG9uZ2VyIGFjdGl2ZTogIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBwYXlsb2FkLmFjdGl2ZVN5bmNDb250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHJ1blN5bmNGaW5pc2hlZE9yQ2FuY2VsZWQocGF5bG9hZC5zeW5jUmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJ1blN5bmNGaW5pc2hlZE9yQ2FuY2VsZWRMb2NrZWQocGF5bG9hZC5zeW5jUmVzdWx0LCBwYXlsb2FkLmFjdGl2ZVN5bmNDb250ZXh0KTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2luY2Ugd2UgYXJlIG5vIGxvbmdlciBzeW5jaW5nLCBjaGVjayBpZiBpdCBpcyB0aW1lIHRvIHN0YXJ0IGEgbmV3IHN5bmMKLSAgICAgICAgICAgICAgICAgICAgICAgIHJ1blN0YXRlSWRsZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2luY2UgYSBzeW5jIGp1c3QgZmluaXNoZWQgY2hlY2sgaWYgaXQgaXMgdGltZSB0byBzdGFydCBhIG5ldyBzeW5jCisgICAgICAgICAgICAgICAgICAgICAgICBuZXh0UGVuZGluZ1N5bmNUaW1lID0gbWF5YmVTdGFydE5leHRTeW5jTG9ja2VkKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgICAgICBjYXNlIFN5bmNIYW5kbGVyLk1FU1NBR0VfU0VSVklDRV9DT05ORUNURUQ6IHsKICAgICAgICAgICAgICAgICAgICAgICAgIFNlcnZpY2VDb25uZWN0aW9uRGF0YSBtc2dEYXRhID0gKFNlcnZpY2VDb25uZWN0aW9uRGF0YSltc2cub2JqOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiaGFuZGxlU3luY0hhbmRsZXJNZXNzYWdlOiBNRVNTQUdFX1NFUlZJQ0VfQ09OTkVDVEVEOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1zZ0RhdGEuYWN0aXZlU3luY0NvbnRleHQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBhY3RpdmUgaXMgIiArIG1BY3RpdmVTeW5jQ29udGV4dCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1zZ0RhdGEuYWN0aXZlU3luY0NvbnRleHQpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgdGhhdCB0aGlzIGlzbid0IGFuIG9sZCBtZXNzYWdlCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVN5bmNDb250ZXh0ID09IG1zZ0RhdGEuYWN0aXZlU3luY0NvbnRleHQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5Cb3VuZFRvU3luY0FkYXB0ZXIobXNnRGF0YS5zeW5jQWRhcHRlcik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNTeW5jU3RpbGxBY3RpdmUobXNnRGF0YS5hY3RpdmVTeW5jQ29udGV4dCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5Cb3VuZFRvU3luY0FkYXB0ZXIobXNnRGF0YS5hY3RpdmVTeW5jQ29udGV4dCwgbXNnRGF0YS5zeW5jQWRhcHRlcik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIGNhc2UgU3luY0hhbmRsZXIuTUVTU0FHRV9TRVJWSUNFX0RJU0NPTk5FQ1RFRDogewotICAgICAgICAgICAgICAgICAgICAgICAgU2VydmljZUNvbm5lY3Rpb25EYXRhIG1zZ0RhdGEgPSAoU2VydmljZUNvbm5lY3Rpb25EYXRhKW1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBBY3RpdmVTeW5jQ29udGV4dCBjdXJyZW50U3luY0NvbnRleHQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFNlcnZpY2VDb25uZWN0aW9uRGF0YSltc2cub2JqKS5hY3RpdmVTeW5jQ29udGV4dDsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImhhbmRsZVN5bmNIYW5kbGVyTWVzc2FnZTogTUVTU0FHRV9TRVJWSUNFX0RJU0NPTk5FQ1RFRDogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtc2dEYXRhLmFjdGl2ZVN5bmNDb250ZXh0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgYWN0aXZlIGlzICIgKyBtQWN0aXZlU3luY0NvbnRleHQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBjdXJyZW50U3luY0NvbnRleHQpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgdGhhdCB0aGlzIGlzbid0IGFuIG9sZCBtZXNzYWdlCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVN5bmNDb250ZXh0ID09IG1zZ0RhdGEuYWN0aXZlU3luY0NvbnRleHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1N5bmNTdGlsbEFjdGl2ZShjdXJyZW50U3luY0NvbnRleHQpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2FuY2VsIHRoZSBzeW5jIGlmIHdlIGhhdmUgYSBzeW5jYWRhcHRlciwgd2hpY2ggbWVhbnMgb25lIGlzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb3V0c3RhbmRpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRTeW5jQ29udGV4dC5tU3luY0FkYXB0ZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jQWRhcHRlci5jYW5jZWxTeW5jKG1BY3RpdmVTeW5jQ29udGV4dCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50U3luY0NvbnRleHQubVN5bmNBZGFwdGVyLmNhbmNlbFN5bmMoY3VycmVudFN5bmNDb250ZXh0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIGRvbid0IG5lZWQgdG8gcmV0cnkgdGhpcyBpbiB0aGlzIGNhc2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMTQzMCwxMSArMTQzNywxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdoaWNoIGlzIGEgc29mdCBlcnJvcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN5bmNSZXN1bHQgc3luY1Jlc3VsdCA9IG5ldyBTeW5jUmVzdWx0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3luY1Jlc3VsdC5zdGF0cy5udW1Jb0V4Y2VwdGlvbnMrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5TeW5jRmluaXNoZWRPckNhbmNlbGVkKHN5bmNSZXN1bHQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1blN5bmNGaW5pc2hlZE9yQ2FuY2VsZWRMb2NrZWQoc3luY1Jlc3VsdCwgY3VycmVudFN5bmNDb250ZXh0KTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNpbmNlIHdlIGFyZSBubyBsb25nZXIgc3luY2luZywgY2hlY2sgaWYgaXQgaXMgdGltZSB0byBzdGFydCBhIG5ldwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN5bmMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5TdGF0ZUlkbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzaW5jZSBhIHN5bmMganVzdCBmaW5pc2hlZCBjaGVjayBpZiBpdCBpcyB0aW1lIHRvIHN0YXJ0IGEgbmV3IHN5bmMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0UGVuZGluZ1N5bmNUaW1lID0gbWF5YmVTdGFydE5leHRTeW5jTG9ja2VkKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTQ0NywyMiArMTQ1Myw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBtQWxhcm1TY2hlZHVsZVRpbWUgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVN5bmNDb250ZXh0ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzTG9nZ2FibGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImhhbmRsZVN5bmNIYW5kbGVyTWVzc2FnZTogc3luYyBjb250ZXh0IGlzIGFjdGl2ZSIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1blN0YXRlU3luY2luZygpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBhYm92ZSBjYWxsIHRvIHJ1blN0YXRlU3luY2luZygpIHJlc3VsdGVkIGluIHRoZSBlbmQgb2YgYSBzeW5jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIGl0IGlzIHRpbWUgdG8gc3RhcnQgYSBuZXcgc3luYwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQWN0aXZlU3luY0NvbnRleHQgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiaGFuZGxlU3luY0hhbmRsZXJNZXNzYWdlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgInN5bmMgY29udGV4dCBpcyBub3QgYWN0aXZlIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVuU3RhdGVJZGxlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRQZW5kaW5nU3luY1RpbWUgPSBtYXliZVN0YXJ0TmV4dFN5bmNMb2NrZWQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhhbmRsZUFsYXJtV2FrZUxvY2sucmVsZWFzZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMTQ3MywxOCArMTQ2NCwxNCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiaGFuZGxlU3luY0hhbmRsZXJNZXNzYWdlOiBNRVNTQUdFX0NIRUNLX0FMQVJNUyIpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgZG8gYWxsIHRoZSB3b3JrIGZvciB0aGlzIGNhc2UgaW4gdGhlIGZpbmFsbHkgYmxvY2sKKyAgICAgICAgICAgICAgICAgICAgICAgIG5leHRQZW5kaW5nU3luY1RpbWUgPSBtYXliZVN0YXJ0TmV4dFN5bmNMb2NrZWQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc1N5bmNJblByb2dyZXNzID0gbUFjdGl2ZVN5bmNDb250ZXh0ICE9IG51bGw7Ci0gICAgICAgICAgICAgICAgaWYgKCFpc1N5bmNJblByb2dyZXNzKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1TeW5jV2FrZUxvY2sucmVsZWFzZSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtYW5hZ2VTeW5jTm90aWZpY2F0aW9uKCk7Ci0gICAgICAgICAgICAgICAgbWFuYWdlRXJyb3JOb3RpZmljYXRpb24oKTsKLSAgICAgICAgICAgICAgICBtYW5hZ2VTeW5jQWxhcm0oZWFybGllc3RGdXR1cmVQb2xsVGltZSk7CisgICAgICAgICAgICAgICAgbWFuYWdlU3luY05vdGlmaWNhdGlvbkxvY2tlZCgpOworICAgICAgICAgICAgICAgIG1hbmFnZVN5bmNBbGFybUxvY2tlZChlYXJsaWVzdEZ1dHVyZVBvbGxUaW1lLCBuZXh0UGVuZGluZ1N5bmNUaW1lKTsKICAgICAgICAgICAgICAgICBtU3luY1RpbWVUcmFja2VyLnVwZGF0ZSgpOworICAgICAgICAgICAgICAgIG1TeW5jTWFuYWdlcldha2VMb2NrLnJlbGVhc2UoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC0xNDkzLDEwICsxNDgwLDEwIEBACiAgICAgICAgICAqIEByZXR1cm4gdGhlIGRlc2lyZWQgc3RhcnQgdGltZSBvZiB0aGUgZWFybGllc3QgZnV0dXJlICBwZXJpb2RpYyBzeW5jIG9wZXJhdGl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WJzb2x1dGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFBhaXI8TG9uZywgTG9uZz4gYmFja29mZiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TeW5jU3RvcmFnZUVuZ2luZS5nZXRCYWNrb2ZmKGluZm8uYWNjb3VudCwgaW5mby5hdXRob3JpdHkpOwogICAgICAgICAgICAgICAgICAgICAgICAgc2NoZWR1bGVTeW5jT3BlcmF0aW9uKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3luY09wZXJhdGlvbihpbmZvLmFjY291bnQsIFN5bmNTdG9yYWdlRW5naW5lLlNPVVJDRV9QRVJJT0RJQywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLmF1dGhvcml0eSwgZXh0cmFzLCAwIC8qIGRlbGF5ICovKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5mby5hdXRob3JpdHksIGV4dHJhcywgMCAvKiBkZWxheSAqLywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrb2ZmICE9IG51bGwgPyBiYWNrb2ZmLmZpcnN0IDogMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3luY1N0b3JhZ2VFbmdpbmUuZ2V0RGVsYXlVbnRpbFRpbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLmFjY291bnQsIGluZm8uYXV0aG9yaXR5KSkpOwogICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLnNldFBlcmlvZGljU3luY1RpbWUoaSwgbm93QWJzb2x1dGUpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXQgaXNuJ3QgcmVhZHkgdG8gcnVuLCByZW1lbWJlciB0aGlzIHRpbWUgaWYgaXQgaXMgZWFybGllciB0aGFuCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBlYXJsaWVzdEZ1dHVyZVBvbGxUaW1lCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWFybGllc3RGdXR1cmVQb2xsVGltZSA9PSBudWxsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG5leHRQb2xsVGltZUFic29sdXRlIDwgZWFybGllc3RGdXR1cmVQb2xsVGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRQb2xsVGltZUFic29sdXRlIDwgZWFybGllc3RGdXR1cmVQb2xsVGltZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVhcmxpZXN0RnV0dXJlUG9sbFRpbWUgPSBuZXh0UG9sbFRpbWVBYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaWYgKGVhcmxpZXN0RnV0dXJlUG9sbFRpbWUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgaWYgKGVhcmxpZXN0RnV0dXJlUG9sbFRpbWUgPT0gTG9uZy5NQVhfVkFMVUUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gTG9uZy5NQVhfVkFMVUU7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIC8vIGNvbnZlcnQgYWJzb2x1dGUgdGltZSB0byBlbGFwc2VkIHRpbWUKQEAgLTE1NTIsNDcgKzE1NDMsMjMgQEAKICAgICAgICAgICAgICAgICAgICAgICA6IChlYXJsaWVzdEZ1dHVyZVBvbGxUaW1lIC0gbm93QWJzb2x1dGUpKTsKICAgICAgICAgfQogCi0gICAgICAgIHByaXZhdGUgdm9pZCBydW5TdGF0ZVN5bmNpbmcoKSB7Ci0gICAgICAgICAgICAvLyBpZiB0aGUgc3luYyB0aW1lb3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l2ZVN5bmNDb250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwgLyogbm8gcmVzdWx0IHNpbmNlIHRoaXMgaXMgYSBjYW5jZWwgKi8pOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGFjdGl2ZVN5bmNDb250ZXh0Lm1UaW1lb3V0U3RhcnRUaW1lID0gbm93ICsgTUFYX1RJTUVfUEVSX1NZTkM7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBubyBuZWVkIHRvIHNjaGVkdWxlIGFuIGFsYXJtLCBhcyB0aGF0IHdpbGwgYmUgZG9uZSBieSBvdXIgY2FsbGVyLgotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIHJ1blN0YXRlSWRsZSgpIHsKLSAgICAgICAgICAgIGJvb2xlYW4gaXNMb2dnYWJsZSA9IExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpOwotICAgICAgICAgICAgaWYgKGlzTG9nZ2FibGUpIExvZy52KFRBRywgInJ1blN0YXRlSWRsZSIpOworICAgICAgICBwcml2YXRlIGxvbmcgbWF5YmVTdGFydE5leHRTeW5jTG9ja2VkKCkgeworICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc0xvZ2dhYmxlID0gTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSk7CisgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgTG9nLnYoVEFHLCAibWF5YmVTdGFydE5leHRTeW5jIik7CiAKICAgICAgICAgICAgIC8vIElmIHdlIGFyZW4ndCByZWFkeSB0byBydW4gKGUuZy4gdGhlIGRhdGEgY29ubmVjdGlvbiBpcyBkb3duKSwgZ2V0IG91dC4KICAgICAgICAgICAgIGlmICghbURhdGFDb25uZWN0aW9uSXNDb25uZWN0ZWQpIHsKICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJydW5TdGF0ZUlkbGU6IG5vIGRhdGEgY29ubmVjdGlvbiwgc2tpcHBpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAibWF5YmVTdGFydE5leHRTeW5jOiBubyBkYXRhIGNvbm5lY3Rpb24sIHNraXBwaW5nIik7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICByZXR1cm4gTG9uZy5NQVhfVkFMVUU7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGlmIChtU3RvcmFnZUlzTG93KSB7CiAgICAgICAgICAgICAgICAgaWYgKGlzTG9nZ2FibGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAicnVuU3RhdGVJZGxlOiBtZW1vcnkgbG93LCBza2lwcGluZyIpOworICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJtYXliZVN0YXJ0TmV4dFN5bmM6IG1lbW9yeSBsb3csIHNraXBwaW5nIik7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICByZXR1cm4gTG9uZy5NQVhfVkFMVUU7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIC8vIElmIHRoZSBhY2NvdW50cyBhcmVuJ3Qga25vd24geWV0IHRoZW4gd2UgYXJlbid0IHJlYWR5IHRvIHJ1bi4gV2Ugd2lsbCBiZSBraWNrZWQKQEAgLTE2MDAsNDYgKzE1NjcsNTYgQEAKICAgICAgICAgICAgIEFjY291bnRbXSBhY2NvdW50cyA9IG1BY2NvdW50czsKICAgICAgICAgICAgIGlmIChhY2NvdW50cyA9PSBJTklUSUFMX0FDQ09VTlRTX0FSUkFZKSB7CiAgICAgICAgICAgICAgICAgaWYgKGlzTG9nZ2FibGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAicnVuU3RhdGVJZGxlOiBhY2NvdW50cyBub3Qga25vd24sIHNraXBwaW5nIik7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIm1heWJlU3RhcnROZXh0U3luYzogYWNjb3VudHMgbm90IGtub3duLCBza2lwcGluZyIpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgcmV0dXJuIExvbmcuTUFYX1ZBTFVFOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAvLyBPdGhlcndpc2UgY29uc3VtZSBTeW5jT3BlcmF0aW9ucyBmcm9tIHRoZSBoZWFkIG9mIHRoZSBTeW5jUXVldWUgdW50aWwgb25lIGlzCiAgICAgICAgICAgICAvLyBmb3VuZCB0aGF0IGlzIHJ1bm5hYmxlIChub3QgZGlzYWJsZWQsIGV0YykuIElmIHRoYXQgb25lIGlzIHJlYWR5IHRvIHJ1biB0aGVuCiAgICAgICAgICAgICAvLyBzdGFydCBpdCwgb3RoZXJ3aXNlIGp1c3QgZ2V0IG91dC4KLSAgICAgICAgICAgIFN5bmNPcGVyYXRpb24gb3A7Ci0gICAgICAgICAgICBpbnQgc3luY2FibGVTdGF0ZTsKICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gYmFja2dyb3VuZERhdGFVc2FnZUFsbG93ZWQgPQogICAgICAgICAgICAgICAgICAgICBnZXRDb25uZWN0aXZpdHlNYW5hZ2VyKCkuZ2V0QmFja2dyb3VuZERhdGFTZXR0aW5nKCk7CiAgICAgICAgICAgICBmaW5hbCBib29sZWFuIG1hc3RlclN5bmNBdXRvbWF0aWNhbGx5ID0gbVN5bmNTdG9yYWdlRW5naW5lLmdldE1hc3RlclN5bmNBdXRvbWF0aWNhbGx5KCk7CiAKLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVN5bmNRdWV1ZSkgewotICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgbm93ID0gU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCk7Ci0gICAgICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKLSAgICAgICAgICAgICAgICAgICAgUGFpcjxTeW5jT3BlcmF0aW9uLCBMb25nPiBuZXh0T3BBbmRSdW5UaW1lID0gbVN5bmNRdWV1ZS5uZXh0T3BlcmF0aW9uKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChuZXh0T3BBbmRSdW5UaW1lID09IG51bGwgfHwgbmV4dE9wQW5kUnVuVGltZS5zZWNvbmQgPiBub3cpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0xvZ2dhYmxlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAicnVuU3RhdGVJZGxlOiBubyBtb3JlIHJlYWR5IHN5bmMgb3BlcmF0aW9ucywgcmV0dXJuaW5nIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgb3AgPSBuZXh0T3BBbmRSdW5UaW1lLmZpcnN0OworICAgICAgICAgICAgZmluYWwgbG9uZyBub3cgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKIAotICAgICAgICAgICAgICAgICAgICAvLyB3ZSBhcmUgZWl0aGVyIGdvaW5nIHRvIHJ1biB0aGlzIHN5bmMgb3IgZHJvcCBpdCBzbyBnbyBhaGVhZCBhbmQKLSAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIGl0IGZyb20gdGhlIHF1ZXVlIG5vdwotICAgICAgICAgICAgICAgICAgICBtU3luY1F1ZXVlLnJlbW92ZShvcCk7CisgICAgICAgICAgICAvLyB3aWxsIGJlIHNldCB0byB0aGUgbmV4dCB0aW1lIHRoYXQgYSBzeW5jIHNob3VsZCBiZSBjb25zaWRlcmVkIGZvciBydW5uaW5nCisgICAgICAgICAgICBsb25nIG5leHRSZWFkeVRvUnVuVGltZSA9IExvbmcuTUFYX1ZBTFVFOworCisgICAgICAgICAgICAvLyBvcmRlciB0aGUgc3luYyBxdWV1ZSwgZHJvcHBpbmcgc3luY3MgdGhhdCBhcmUgbm90IGFsbG93ZWQKKyAgICAgICAgICAgIEFycmF5TGlzdDxTeW5jT3BlcmF0aW9uPiBvcGVyYXRpb25zID0gbmV3IEFycmF5TGlzdDxTeW5jT3BlcmF0aW9uPigpOworICAgICAgICAgICAgc3luY2hyb25pemVkIChtU3luY1F1ZXVlKSB7CisgICAgICAgICAgICAgICAgaWYgKGlzTG9nZ2FibGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiYnVpbGQgdGhlIG9wZXJhdGlvbiBhcnJheSwgc3luY1F1ZXVlIHNpemUgaXMgIgorICAgICAgICAgICAgICAgICAgICAgICAgKyBtU3luY1F1ZXVlLm1PcGVyYXRpb25zTWFwLnNpemUoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEl0ZXJhdG9yPFN5bmNPcGVyYXRpb24+IG9wZXJhdGlvbkl0ZXJhdG9yID0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1TeW5jUXVldWUubU9wZXJhdGlvbnNNYXAudmFsdWVzKCkuaXRlcmF0b3IoKTsKKyAgICAgICAgICAgICAgICB3aGlsZSAob3BlcmF0aW9uSXRlcmF0b3IuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN5bmNPcGVyYXRpb24gb3AgPSBvcGVyYXRpb25JdGVyYXRvci5uZXh0KCk7CiAKICAgICAgICAgICAgICAgICAgICAgLy8gZHJvcCB0aGUgc3luYyBpZiB0aGUgYWNjb3VudCBvZiB0aGlzIG9wZXJhdGlvbiBubyBsb25nZXIgZXhpc3RzCiAgICAgICAgICAgICAgICAgICAgIGlmICghQXJyYXlVdGlscy5jb250YWlucyhtQWNjb3VudHMsIG9wLmFjY291bnQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25JdGVyYXRvci5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TeW5jU3RvcmFnZUVuZ2luZS5kZWxldGVGcm9tUGVuZGluZyhvcC5wZW5kaW5nT3BlcmF0aW9uKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgICAgICB9CiAKLQotICAgICAgICAgICAgICAgICAgICAvLyBkcm9wIHRoaXMgc3luYyByZXF1ZXN0IGlmIGl0IGlzbid0IHN5bmNhYmxlLCBpbnRpYWxpemluZyB0aGUgc3luYyBhZGFwdGVyCi0gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBzeW5jYWJsZSBzdGF0ZSBpcyBzZXQgdG8gInVua25vd24iCi0gICAgICAgICAgICAgICAgICAgIHN5bmNhYmxlU3RhdGUgPSBtU3luY1N0b3JhZ2VFbmdpbmUuZ2V0SXNTeW5jYWJsZShvcC5hY2NvdW50LCBvcC5hdXRob3JpdHkpOworICAgICAgICAgICAgICAgICAgICAvLyBkcm9wIHRoaXMgc3luYyByZXF1ZXN0IGlmIGl0IGlzbid0IHN5bmNhYmxlCisgICAgICAgICAgICAgICAgICAgIGludCBzeW5jYWJsZVN0YXRlID0gbVN5bmNTdG9yYWdlRW5naW5lLmdldElzU3luY2FibGUob3AuYWNjb3VudCwgb3AuYXV0aG9yaXR5KTsKICAgICAgICAgICAgICAgICAgICAgaWYgKHN5bmNhYmxlU3RhdGUgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uSXRlcmF0b3IucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtU3luY1N0b3JhZ2VFbmdpbmUuZGVsZXRlRnJvbVBlbmRpbmcob3AucGVuZGluZ09wZXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBuZXh0IHJ1biB0aW1lIGlzIGluIHRoZSBmdXR1cmUsIG1lYW5pbmcgdGhlcmUgYXJlIG5vIHN5bmNzIHJlYWR5CisgICAgICAgICAgICAgICAgICAgIC8vIHRvIHJ1biwgcmV0dXJuIHRoZSB0aW1lCisgICAgICAgICAgICAgICAgICAgIGlmIChvcC5lZmZlY3RpdmVSdW5UaW1lID4gbm93KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dFJlYWR5VG9SdW5UaW1lID4gb3AuZWZmZWN0aXZlUnVuVGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRSZWFkeVRvUnVuVGltZSA9IG9wLmVmZmVjdGl2ZVJ1blRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgfQogCkBAIC0xNjUxLDMwICsxNjI4LDEzOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhYmFja2dyb3VuZERhdGFVc2FnZUFsbG93ZWQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIW1TeW5jU3RvcmFnZUVuZ2luZS5nZXRTeW5jQXV0b21hdGljYWxseSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wLmFjY291bnQsIG9wLmF1dGhvcml0eSkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25JdGVyYXRvci5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TeW5jU3RvcmFnZUVuZ2luZS5kZWxldGVGcm9tUGVuZGluZyhvcC5wZW5kaW5nT3BlcmF0aW9uKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICAgICAgLy8gZ28gYWhlYWQgYW5kIHRyeSB0byBzeW5jIHRoaXMgc3luY09wZXJhdGlvbgotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvLyBXZSB3aWxsIGRvIHRoaXMgc3luYy4gUnVuIGl0IG91dHNpZGUgb2YgdGhlIHN5bmNocm9uaXplZCBibG9jay4KLSAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJydW5TdGF0ZUlkbGU6IHdlIGFyZSBnb2luZyB0byBzeW5jICIgKyBvcCk7CisgICAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbnMuYWRkKG9wKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIC8vIGNvbnZlcnQgdGhlIG9wIGludG8gYW4gaW5pdGlhbGl6YXRpb24gc3luYyBpZiB0aGUgc3luY2FibGUgc3RhdGUgaXMgInVua25vd24iIGFuZAotICAgICAgICAgICAgLy8gb3AgaXNuJ3QgYWxyZWFkeSBhbiBpbml0aWFsaXphdGlvbiBzeW5jLiBJZiBpdCBpcyBtYXJrZWQgc3luY2FibGUgdGhlbiBjb252ZXJ0Ci0gICAgICAgICAgICAvLyB0aGlzIGludG8gYSByZWd1bGFyIHN5bmMKLSAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaW5pdGlhbGl6ZUlzU2V0ID0KLSAgICAgICAgICAgICAgICAgICAgb3AuZXh0cmFzLmdldEJvb2xlYW4oQ29udGVudFJlc29sdmVyLlNZTkNfRVhUUkFTX0lOSVRJQUxJWkUsIGZhbHNlKTsKLSAgICAgICAgICAgIGlmIChzeW5jYWJsZVN0YXRlIDwgMCAmJiAhaW5pdGlhbGl6ZUlzU2V0KSB7Ci0gICAgICAgICAgICAgICAgb3AuZXh0cmFzLnB1dEJvb2xlYW4oQ29udGVudFJlc29sdmVyLlNZTkNfRV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GlvbnMiKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwLCBOID0gb3BlcmF0aW9ucy5zaXplKCk7IGkgPCBOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBTeW5jT3BlcmF0aW9uIGNhbmRpZGF0ZSA9IG9wZXJhdGlvbnMuZ2V0KGkpOworICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gY2FuZGlkYXRlSXNJbml0aWFsaXphdGlvbiA9IGNhbmRpZGF0ZS5pc0luaXRpYWxpemF0aW9uKCk7CisKKyAgICAgICAgICAgICAgICBpbnQgbnVtSW5pdCA9IDA7CisgICAgICAgICAgICAgICAgaW50IG51bVJlZ3VsYXIgPSAwOworICAgICAgICAgICAgICAgIEFjdGl2ZVN5bmNDb250ZXh0IGNvbmZsaWN0ID0gbnVsbDsKKyAgICAgICAgICAgICAgICBBY3RpdmVTeW5jQ29udGV4dCBsb25nUnVubmluZyA9IG51bGw7CisgICAgICAgICAgICAgICAgQWN0aXZlU3luY0NvbnRleHQgdG9SZXNjaGVkdWxlID0gbnVsbDsKKworICAgICAgICAgICAgICAgIGZvciAoQWN0aXZlU3luY0NvbnRleHQgYWN0aXZlU3luY0NvbnRleHQgOiBtQWN0aXZlU3luY0NvbnRleHRzKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN5bmNPcGVyYXRpb24gYWN0aXZlT3AgPSBhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFjdGl2ZU9wLmlzSW5pdGlhbGl6YXRpb24oKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbnVtSW5pdCsrOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbnVtUmVndWxhcisrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChhY3RpdmVPcC5hY2NvdW50LnR5cGUuZXF1YWxzKGNhbmRpZGF0ZS5hY2NvdW50LnR5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlT3AuYXV0aG9yaXR5LmVxdWFscyhjYW5kaWRhdGUuYXV0aG9yaXR5KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29uZmxpY3QgPSBhY3RpdmVTeW5jQ29udGV4dDsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IGJyZWFrIG91dCBzaW5jZSB3ZSB3YW50IHRvIGRvIGEgZnVsbCBjb3VudCBvZiB0aGUgdmFyaWV0aWVzCisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2FuZGlkYXRlSXNJbml0aWFsaXphdGlvbiA9PSBhY3RpdmVPcC5pc0luaXRpYWxpemF0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlU3luY0NvbnRleHQubVN0YXJ0VGltZSArIE1BWF9USU1FX1BFUl9TWU5DIDwgbm93KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ1J1bm5pbmcgPSBhY3RpdmVTeW5jQ29udGV4dDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCBicmVhayBvdXQgc2luY2Ugd2Ugd2FudCB0byBkbyBhIGZ1bGwgY291bnQgb2YgdGhlIHZhcmlldGllcworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGlzTG9nZ2FibGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiY2FuZGlkYXRlICIgKyAoaSArIDEpICsgIiBvZiAiICsgTiArICI6ICIgKyBjYW5kaWRhdGUpOworICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICIgIG51bUFjdGl2ZUluaXQ9IiArIG51bUluaXQgKyAiLCBudW1BY3RpdmVSZWd1bGFyPSIgKyBudW1SZWd1bGFyKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiICBsb25nUnVubmluZzogIiArIGxvbmdSdW5uaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiICBjb25mbGljdDogIiArIGNvbmZsaWN0KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoY29uZmxpY3QgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoY2FuZGlkYXRlSXNJbml0aWFsaXphdGlvbiAmJiAhY29uZmxpY3QubVN5bmNPcGVyYXRpb24uaXNJbml0aWFsaXphdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbnVtSW5pdCA8IE1BWF9TSU1VTFRBTkVPVVNfSU5JVElBTElaQVRJT05fU1lOQ1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvUmVzY2hlZHVsZSA9IGNvbmZsaWN0OworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiY2FuY2VsaW5nIGFuZCByZXNjaGVkdWxpbmcgc3luYyBzaW5jZSBhbiBpbml0aWFsaXphdGlvbiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJ0YWtlcyBoaWdoZXIgcHJpb3JpdHksICIgKyBjb25mbGljdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2FuZGlkYXRlLmV4cGVkaXRlZCAmJiAhY29uZmxpY3QubVN5bmNPcGVyYXRpb24uZXhwZWRpdGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKGNhbmRpZGF0ZUlzSW5pdGlhbGl6YXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gY29uZmxpY3QubVN5bmNPcGVyYXRpb24uaXNJbml0aWFsaXphdGlvbigpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdG9SZXNjaGVkdWxlID0gY29uZmxpY3Q7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJjYW5jZWxpbmcgYW5kIHJlc2NoZWR1bGluZyBzeW5jIHNpbmNlIGFuIGV4cGVkaXRlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJ0YWtlcyBoaWdoZXIgcHJpb3JpdHksICIgKyBjb25mbGljdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcm9vbUF2YWlsYWJsZSA9IGNhbmRpZGF0ZUlzSW5pdGlhbGl6YXRpb24gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBudW1Jbml0IDwgTUFYX1NJTVVMVEFORU9VU19JTklUSUFMSVpBVElPTl9TWU5DUyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG51bVJlZ3VsYXIgPCBNQVhfU0lNVUxUQU5FT1VTX1JFR1VMQVJfU1lOQ1M7CisgICAgICAgICAgICAgICAgICAgIGlmIChyb29tQXZhaWxhYmxlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBkaXNwYXRjaCBjYW5kaWRhdGUKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChsb25nUnVubmluZyAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKGNhbmRpZGF0ZUlzSW5pdGlhbGl6YXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gbG9uZ1J1bm5pbmcubVN5bmNPcGVyYXRpb24uaXNJbml0aWFsaXphdGlvbigpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdG9SZXNjaGVkdWxlID0gbG9uZ1J1bm5pbmc7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJjYW5jZWxpbmcgYW5kIHJlc2NoZWR1bGluZyBzeW5jIHNpbmNlIGl0IHJhbiByb28gbG9uZywgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBsb25nUnVubmluZyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICh0b1Jlc2NoZWR1bGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBydW5TeW5jRmluaXNoZWRPckNhbmNlbGVkTG9ja2VkKG51bGwsIHRvUmVzY2hlZHVsZSk7CisgICAgICAgICAgICAgICAgICAgIHNjaGVkdWxlU3luY09wZXJhdGlvbih0b1Jlc2NoZWR1bGUubVN5bmNPcGVyYXRpb24pOworICAgICAgICAgICAgICAgIH0KKyAgICAKKyAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jUXVldWUpeworICAgICAgICAgICAgICAgICAgICBtU3luY1F1ZXVlLnJlbW92ZShjYW5kaWRhdGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkaXNwYXRjaFN5bmNPcGVyYXRpb24oY2FuZGlkYXRlKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIG5leHRSZWFkeVRvUnVuVGltZTsKKyAgICAgfQorCisgICAgICAgIHByaXZhdGUgYm9vbGVhbiBkaXNwYXRjaFN5bmNPcGVyYXRpb24oU3luY09wZXJhdGlvbiBvcCkgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAibWF5YmVTdGFydE5leHRTeW5jOiB3ZSBhcmUgZ29pbmcgdG8gc3luYyAiICsgb3ApOworICAgICAgICAgICAgICAgIExvZy52KFRBRywgIm51bSBhY3RpdmUgc3luY3M6ICIgKyBtQWN0aXZlU3luY0NvbnRleHRzLnNpemUoKSk7CisgICAgICAgICAgICAgICAgZm9yIChBY3RpdmVTeW5jQ29udGV4dCBzeW5jQ29udGV4dCA6IG1BY3RpdmVTeW5jQ29udGV4dHMpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCBzeW5jQ29udGV4dC50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGlmIHRoaXMgaXMgYW4gaW5pdGlhbGl6YXRpb24gc3luYyBhbmQgdGhlcmUgaXMgYWxyZWFkeSBhIHN5bmMgcnVubmluZyB3aXRoCisgICAgICAgICAgICAvLyB0aGUgc2FtZSBhY2NvdW50IHR5cGUgYW5kIGF1dGhvcml0eSBjYW5jZWwgdGhhdCBzeW5jIGJlZm9yZSBzdGFydGluZyB0aGlzIG9uZQorICAgICAgICAgICAgLy8gc2luY2Ugb3RoZXJ3aXNlIHRoZSBzeW5jYWRhcHRlciB3aWxsIGxpa2VseSByZWplY3QgdGhpcyByZXF1ZXN0CisgICAgICAgICAgICBpZiAob3AuaXNJbml0aWFsaXphdGlvbigpKSB7CisgICAgICAgICAgICAgICAgSXRlcmF0b3I8QWN0aXZlU3luY0NvbnRleHQ+IGl0ZXJhdG9yID0gbUFjdGl2ZVN5bmNDb250ZXh0cy5pdGVyYXRvcigpOworICAgICAgICAgICAgICAgIHdoaWxlIChpdGVyYXRvci5oYXNOZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgQWN0aXZlU3luY0NvbnRleHQgc3luY0NvbnRleHQgPSBpdGVyYXRvci5uZXh0KCk7CisgICAgICAgICAgICAgICAgICAgIGlmICghc3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uaXNJbml0aWFsaXphdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uYWNjb3VudC50eXBlLmVxdWFscyhvcC5hY2NvdW50LnR5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uYXV0aG9yaXR5LmVxdWFscyhvcC5hdXRob3JpdHkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJjYW5jZWxpbmcgYW5kIHJlc2NoZWR1bGluZyAiICsgc3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHNpbmNlIHdlIGFyZSBhYm91dCB0byBzdGFydCBhIHN5bmMgdGhhdCB1c2VkIHRoZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgInNhbWUgc3luYyBhZGFwdGVyLCAiICsgb3ApOworICAgICAgICAgICAgICAgICAgICAgICAgaXRlcmF0b3IucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBydW5TeW5jRmluaXNoZWRPckNhbmNlbGVkTG9ja2VkKG51bGwsIHN5bmNDb250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjaGVkdWxlU3luY09wZXJhdGlvbihzeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIC8vIGNvbm5lY3QgdG8gdGhlIHN5bmMgYWRhcHRlcgpAQCAtMTY4NSw2MSArMTc3MSw3MCBAQAogICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImNhbid0IGZpbmQgYSBzeW5jIGFkYXB0ZXIgZm9yICIgKyBzeW5jQWRhcHRlclR5cGUKICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgcmVtb3Zpbmcgc2V0dGluZ3MgZm9yIGl0Iik7CiAgICAgICAgICAgICAgICAgbVN5bmNTdG9yYWdlRW5naW5lLnJlbW92ZUF1dGhvcml0eShvcC5hY2NvdW50LCBvcC5hdXRob3JpdHkpOwotICAgICAgICAgICAgICAgIHJ1blN0YXRlSWRsZSgpOwotICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIEFjdGl2ZVN5bmNDb250ZXh0IGFjdGl2ZVN5bmNDb250ZXh0ID0KLSAgICAgICAgICAgICAgICAgICAgbmV3IEFjdGl2ZVN5bmNDb250ZXh0KG9wLCBpbnNlcnRTdGFydFN5bmNFdmVudChvcCkpOwotICAgICAgICAgICAgbUFjdGl2ZVN5bmNDb250ZXh0ID0gYWN0aXZlU3luY0NvbnRleHQ7CisgICAgICAgICAgICAgICAgICAgIG5ldyBBY3RpdmVTeW5jQ29udGV4dChvcCwgaW5zZXJ0U3RhcnRTeW5jRXZlbnQob3ApLCBzeW5jQWRhcHRlckluZm8udWlkKTsKKyAgICAgICAgICAgIGFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jSW5mbyA9IG1TeW5jU3RvcmFnZUVuZ2luZS5hZGRBY3RpdmVTeW5jKGFjdGl2ZVN5bmNDb250ZXh0KTsKKyAgICAgICAgICAgIG1BY3RpdmVTeW5jQ29udGV4dHMuYWRkKGFjdGl2ZVN5bmNDb250ZXh0KTsKICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgewotICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJ1blN0YXRlSWRsZTogc2V0dGluZyBtQWN0aXZlU3luY0NvbnRleHQgdG8gIiArIG1BY3RpdmVTeW5jQ29udGV4dCk7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiZGlzcGF0Y2hTeW5jT3BlcmF0aW9uOiBzdGFydGluZyAiICsgYWN0aXZlU3luY0NvbnRleHQpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgbVN5bmNTdG9yYWdlRW5naW5lLnNldEFjdGl2ZVN5bmMobUFjdGl2ZVN5bmNDb250ZXh0KTsKICAgICAgICAgICAgIGlmICghYWN0aXZlU3luY0NvbnRleHQuYmluZFRvU3luY0FkYXB0ZXIoc3luY0FkYXB0ZXJJbmZvKSkgewogICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkJpbmQgYXR0ZW1wdCBmYWlsZWQgdG8gIiArIHN5bmNBZGFwdGVySW5mbyk7Ci0gICAgICAgICAgICAgICAgbUFjdGl2ZVN5bmNDb250ZXh0LmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgbUFjdGl2ZVN5bmNDb250ZXh0ID0gbnVsbDsKLSAgICAgICAgICAgICAgICBtU3luY1N0b3JhZ2VFbmdpbmUuc2V0QWN0aXZlU3luYyhtQWN0aXZlU3luY0NvbnRleHQpOwotICAgICAgICAgICAgICAgIG1TeW5jV2FrZUxvY2suc2V0V29ya1NvdXJjZShudWxsKTsKLSAgICAgICAgICAgICAgICBydW5TdGF0ZUlkbGUoKTsKLSAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgY2xvc2VBY3RpdmVTeW5jQ29udGV4dChhY3RpdmVTeW5jQ29udGV4dCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZh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AgICAgICAgICAgICBpZiAoYWN0aXZlU3luY0NvbnRleHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAvLyBpZiBhbiBhdXRob3JpdHkgd2FzIHNwZWNpZmllZCB0aGVuIG9ubHkgY2FuY2VsIHRoZSBzeW5jIGlmIGl0IG1hdGNoZXMKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFjY291bnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFhY2NvdW50LmVxdWFscyhhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbi5hY2NvdW50KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBpZiBhbiBhY2NvdW50IHdhcyBzcGVjaWZpZWQgdGhlbiBvbmx5IGNhbmNlbCB0aGUgc3luYyBpZiBpdCBtYXRjaGVzCisgICAgICAgICAgICAgICAgICAgIGlmIChhdXRob3JpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFhdXRob3JpdHkuZXF1YWxzKGFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jT3BlcmF0aW9uLmF1dGhvcml0eSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcnVuU3luY0ZpbmlzaGVkT3JDYW5jZWxlZExvY2tlZChudWxsIC8qIG5vIHJlc3VsdCBzaW5jZSB0aGlzIGlzIGEgY2FuY2VsICovLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZVN5bmNDb250ZXh0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgcnVuU3luY0ZpbmlzaGVkT3JDYW5jZWxlZExvY2tlZChTeW5jUmVzdWx0IHN5bmNSZXN1bHQsCisgICAgICAgICAgICAgICAgQWN0aXZlU3luY0NvbnRleHQgYWN0aXZlU3luY0NvbnRleHQpIHsKICAgICAgICAgICAgIGJvb2xlYW4gaXNMb2dnYWJsZSA9IExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpOwotICAgICAgICAgICAgZmluYWwgQWN0aXZlU3luY0NvbnRleHQgYWN0aXZlU3luY0NvbnRleHQgPSBtQWN0aXZlU3luY0NvbnRleHQ7Ci0gICAgICAgICAgICBtQWN0aXZlU3luY0NvbnRleHQgPSBudWxsOwotICAgICAgICAgICAgbVN5bmNTdG9yYWdlRW5naW5lLnNldEFjdGl2ZVN5bmMobUFjdGl2ZVN5bmNDb250ZXh0KTsKKyAgICAgICAgICAgIGNsb3NlQWN0aXZlU3luY0NvbnRleHQoYWN0aXZlU3luY0NvbnRleHQpOwogCiAgICAgICAgICAgICBmaW5hbCBTeW5jT3BlcmF0aW9uIHN5bmNPcGVyYXRpb24gPSBhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbjsKIApAQCAtMTc1OSwxNiArMTg1NCw2IEBACiAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IHNldCB0aGVzZSBjb3JyZWN0bHkgd2hlbiB0aGUgU3luY1Jlc3VsdCBpcyBleHRlbmRlZCB0byBpbmNsdWRlIGl0CiAgICAgICAgICAgICAgICAgICAgIGRvd25zdHJlYW1BY3Rpdml0eSA9IDA7CiAgICAgICAgICAgICAgICAgICAgIHVwc3RyZWFtQWN0aXZpdHkgPSAwOwotICAgICAgICAgICAgICAgICAgICBjbGVhckJhY2tvZmZTZXR0aW5nKHN5bmNPcGVyYXRpb24pOwotICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGlzIHdhcyBhbiBpbml0aWFsaXphdGlvbiBzeW5jIGFuZCB0aGUgc3luYyBhZGFwdGVyIGlzIG5vdwotICAgICAgICAgICAgICAgICAgICAvLyBtYXJrZWQgc3luY2FibGUgdGhlbiByZXNjaGVkdWxlIHRoZSBzeW5jLiBUaGUgbmV4dCB0aW1lIGl0IHJ1bnMgaXQKLSAgICAgICAgICAgICAgICAgICAgLy8gd2lsbCBiZSBtYWRlIGludG8gYSByZWd1bGFyIHN5bmMuCi0gICAgICAgICAgICAgICAgICAgIGlmIChzeW5jT3BlcmF0aW9uLmV4dHJhcy5nZXRCb29sZWFuKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb250ZW50UmVzb2x2ZXIuU1lOQ19FWFRSQVNfSU5JVElBTElaRSwgZmFsc2UpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbVN5bmNTdG9yYWdlRW5naW5lLmdldElzU3luY2FibGUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNPcGVyYXRpb24uYWNjb3VudCwgc3luY09wZXJhdGlvbi5hdXRob3JpdHkpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc2NoZWR1bGVTeW5jT3BlcmF0aW9uKG5ldyBTeW5jT3BlcmF0aW9uKHN5bmNPcGVyYXRpb24pKTsKLSAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImZhaWxlZCBzeW5jIG9wZXJhdGlvbiAiICsgc3luY09wZXJhdGlvbiArICIsICIgKyBzeW5jUmVzdWx0KTsKICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIG9wZXJhdGlvbiBmYWlsZWQgc28gaW5jcmVhc2UgdGhlIGJhY2tvZmYgdGltZQpAQCAtMTgwMyw4ICsxODg4LDYgQEAKICAgICAgICAgICAgIHN0b3BTeW5jRXZlbnQoYWN0aXZlU3luY0NvbnRleHQubUhpc3RvcnlSb3dJZCwgc3luY09wZXJhdGlvbiwgaGlzdG9yeU1lc3NhZ2UsCiAgICAgICAgICAgICAgICAgICAgIHVwc3RyZWFtQWN0aXZpdHksIGRvd25zdHJlYW1BY3Rpdml0eSwgZWxhcHNlZFRpbWUpOwogCi0gICAgICAgICAgICBhY3RpdmVTeW5jQ29udGV4dC5jbG9zZSgpOwotCiAgICAgICAgICAgICBpZiAoc3luY1Jlc3VsdCAhPSBudWxsICYmIHN5bmNSZXN1bHQudG9vTWFueURlbGV0aW9ucykgewogICAgICAgICAgICAgICAgIGluc3RhbGxIYW5kbGVUb29NYW55RGVsZXRlc05vdGlmaWNhdGlvbihzeW5jT3BlcmF0aW9uLmFjY291bnQsCiAgICAgICAgICAgICAgICAgICAgICAgICBzeW5jT3BlcmF0aW9uLmF1dGhvcml0eSwgc3luY1Jlc3VsdC5zdGF0cy5udW1EZWxldGVzKTsKQEAgLTE4MTUsMTEgKzE4OTgsMTggQEAKIAogICAgICAgICAgICAgaWYgKHN5bmNSZXN1bHQgIT0gbnVsbCAmJiBzeW5jUmVzdWx0LmZ1bGxTeW5jUmVxdWVzdGVkKSB7CiAgICAgICAgICAgICAgICAgc2NoZWR1bGVTeW5jT3BlcmF0aW9uKG5ldyBTeW5jT3BlcmF0aW9uKHN5bmNPcGVyYXRpb24uYWNjb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNPcGVyYXRpb24uc3luY1NvdXJjZSwgc3luY09wZXJhdGlvbi5hdXRob3JpdHksIG5ldyBCdW5kbGUoKSwgMCkpOworICAgICAgICAgICAgICAgICAgICAgICAgc3luY09wZXJhdGlvbi5zeW5jU291cmNlLCBzeW5jT3BlcmF0aW9uLmF1dGhvcml0eSwgbmV3IEJ1bmRsZSgpLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgc3luY09wZXJhdGlvbi5iYWNrb2ZmLCBzeW5jT3BlcmF0aW9uLmRlbGF5VW50aWwpKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIC8vIG5vIG5lZWQgdG8gc2NoZWR1bGUgYW4gYW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CiAKLSAgICAgICAgICAgIGlmIChtQWN0aXZlU3luY0NvbnRleHQgPT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKG1BY3RpdmVTeW5jQ29udGV4dHMuaXNFbXB0eSgpKSB7CiAgICAgICAgICAgICAgICAgbVN5bmNOb3RpZmljYXRpb25JbmZvLnN0YXJ0VGltZSA9IG51bGw7CiAKICAgICAgICAgICAgICAgICAvLyB3ZSBhcmVuJ3Qgc3luY2luZy4gaWYgdGhlIG5vdGlmaWNhdGlvbiBpcyBhY3RpdmUgdGhlbiByZW1lbWJlciB0aGF0IHdlIG5lZWQKQEAgLTE4NjIsMzQgKzE5NTIsMzggQEAKICAgICAgICAgICAgICAgICBzaG91bGRJbnN0YWxsID0gZmFsc2U7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIC8vIHdlIGFyZSBzeW5jaW5nCi0gICAgICAgICAgICAgICAgZmluYWwgU3luY09wZXJhdGlvbiBzeW5jT3BlcmF0aW9uID0gbUFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jT3BlcmF0aW9uOwotCiAgICAgICAgICAgICAgICAgZmluYWwgbG9uZyBub3cgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKICAgICAgICAgICAgICAgICBpZiAobVN5bmNOb3RpZmljYXRpb25JbmZvLnN0YXJ0VGltZSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIG1TeW5jTm90aWZpY2F0aW9uSW5mby5zdGFydFRpbWUgPSBub3c7CiAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgLy8gY2FuY2VsIHRoZSBub3RpZmljYXRpb24gaWYgaXQgaXMgdXAgYW5kIHRoZSBhdXRob3JpdHkgb3IgYWNjb3VudCBpcyB3cm9uZwotICAgICAgICAgICAgICAgIHNob3VsZENhbmNlbCA9IG1TeW5jTm90aWZpY2F0aW9uSW5mby5pc0FjdGl2ZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgKCFzeW5jT3BlcmF0aW9uLmF1dGhvcml0eS5lcXVhbHMobVN5bmNOb3RpZmljYXRpb25JbmZvLmF1dGhvcml0eSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHx8ICFzeW5jT3BlcmF0aW9uLmFjY291bnQuZXF1YWxzKG1TeW5jTm90aWZpY2F0aW9uSW5mby5hY2NvdW50KSk7Ci0KLSAgICAgICAgICAgICAgICAvLyB0aGVyZSBhcmUgZm91ciBjYXNlczoKLSAgICAgICAgICAgICAgICAvLyAtIHRoZSBub3RpZmljYXRpb24gaXMgdXAgYW5kIHRoZXJlIGlzIG5vIGNoYW5nZTogZG8gbm90aGluZwotICAgICAgICAgICAgICAgIC8vIC0gdGhlIG5vdGlmaWNhdGlvbiBpcyB1cCBidXQgd2Ugc2hvdWxkIGNhbmNlbCBzaW5jZSBpdCBpcyBzdGFsZToKLSAgICAgICAgICAgICAgICAvLyAgIG5lZWQgdG8gaW5zdGFsbAorICAgICAgICAgICAgICAgIC8vIHRoZXJlIGFyZSB0aHJlZSBjYXNlczoKKyAgICAgICAgICAgICAgICAvLyAtIHRoZSBub3RpZmljYXRpb24gaXMgdXA6IGRvIG5vdGhpbmcKICAgICAgICAgICAgICAgICAvLyAtIHRoZSBub3RpZmljYXRpb24gaXMgbm90IHVwIGJ1dCBpdCBpc24ndCB0aW1lIHlldDogZG9uJ3QgaW5zdGFsbAogICAgICAgICAgICAgICAgIC8vIC0gdGhlIG5vdGlmaWNhdGlvbiBpcyBub3QgdXAgYW5kIGl0IGlzIHRpbWU6IG5lZWQgdG8gaW5zdGFsbAogCiAgICAgICAgICAgICAgICAgaWYgKG1TeW5jTm90aWZpY2F0aW9uSW5mby5pc0FjdGl2ZSkgewotICAgICAgICAgICAgICAgICAgICBzaG91bGRJbnN0YWxsID0gc2hvdWxkQ2FuY2VsOworICAgICAgICAgICAgICAgICAgICBzaG91bGRJbnN0YWxsID0gc2hvdWxkQ2FuY2VsID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gaXQgaXNuJ3QgY3VycmVudGx5IHVwLCBzbyB0aGVyZSBpcyBub3RoaW5nIHRvIGNhbmNlbAorICAgICAgICAgICAgICAgICAgICBzaG91bGRDYW5jZWwgPSBmYWxzZTsKKwogICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHRpbWVUb1Nob3dOb3RpZmljYXRpb24gPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdyA+IG1TeW5jTm90aWZpY2F0aW9uSW5mby5zdGFydFRpbWUgKyBTWU5DX05PVElGSUNBVElPTl9ERUxBWTsKLSAgICAgICAgICAgICAgICAgICAgLy8gc2hvdyB0aGUgbm90aWZpY2F0aW9uIGltbWVkaWF0ZWx5IGlmIHRoaXMgaXMgYSBtYW51YWwgc3luYwotICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIG1hbnVhbFN5bmMgPSBzeW5jT3BlcmF0aW9uLmV4dHJhcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRCb29sZWFuKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19NQU5VQUwsIGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgc2hvdWxkSW5zdGFsbCA9IHRpbWVUb1Nob3dOb3RpZmljYXRpb24gfHwgbWFudWFsU3luYzsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVUb1Nob3dOb3RpZmljYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNob3VsZEluc3RhbGwgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2hvdyB0aGUgbm90aWZpY2F0aW9uIGltbWVkaWF0ZWx5IGlmIHRoaXMgaXMgYSBtYW51YWwgc3luYworICAgICAgICAgICAgICAgICAgICAgICAgc2hvdWxkSW5zdGFsbCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChBY3RpdmVTeW5jQ29udGV4dCBhY3RpdmVTeW5jQ29udGV4dCA6IG1BY3RpdmVTeW5jQ29udGV4dHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIG1hbnVhbFN5bmMgPSBhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbi5leHRyYXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRCb29sZWFuKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19NQU5VQUwsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFudWFsU3luYykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG91bGRJbnN0YWxsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCkBAIC0xOTAwLDk0ICsxOTk0LDgyIEBACiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGlmIChzaG91bGRJbnN0YWxsKSB7Ci0gICAgICAgICAgICAgICAgU3luY09wZXJhdGlvbiBzeW5jT3BlcmF0aW9uID0gbUFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jT3BlcmF0aW9uOwogICAgICAgICAgICAgICAgIG1OZWVkU3luY0FjdGl2ZU5vdGlmaWNhdGlvbiA9IHRydWU7CiAgICAgICAgICAgICAgICAgc2VuZFN5bmNTdGF0ZUludGVudCgpOwogICAgICAgICAgICAgICAgIG1TeW5jTm90aWZpY2F0aW9uSW5mby5pc0FjdGl2ZSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgbVN5bmNOb3RpZmljYXRpb25JbmZvLmFjY291bnQgPSBzeW5jT3BlcmF0aW9uLmFjY291bnQ7Ci0gICAgICAgICAgICAgICAgbVN5bmNOb3RpZmljYXRpb25JbmZvLmF1dGhvcml0eSA9IHN5bmNPcGVyYXRpb24uYXV0aG9yaXR5OwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgLyoqCi0gICAgICAgICAqIENoZWNrIGlmIHRoZXJlIHdlcmUgYW55IGxvbmctbGFzdGluZyBlcnJvcnMsIGlmIHNvIGluc3RhbGwgdGhlIGVycm9yIG5vdGlmaWNhdGlvbiwKLSAgICAgICAgICogb3RoZXJ3aXNlIGNhbmNlbCB0aGUgZXJyb3Igbm90aWZpY2F0aW9uLgotICAgICAgICAgKi8KLSAgICAgICAgcHJpdmF0ZSB2b2lkIG1hbmFnZUVycm9yTm90aWZpY2F0aW9uKCkgewotICAgICAgICAgICAgLy8KLSAgICAgICAgICAgIGxvbmcgd2hlbiA9IG1TeW5jU3RvcmFnZUVuZ2luZS5nZXRJbml0aWFsU3luY0ZhaWx1cmVUaW1lKCk7Ci0gICAgICAgICAgICBpZiAoKHdoZW4gPiAwKSAmJiAod2hlbiArIEVSUk9SX05PVElGSUNBVElPTl9ERUxBWV9NUyA8IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpKSkgewotICAgICAgICAgICAgICAgIGlmICghbUVycm9yTm90aWZpY2F0aW9uSW5zdGFsbGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1OZWVkU3luY0Vycm9yTm90aWZpY2F0aW9uID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgc2VuZFN5bmNTdGF0ZUludGVudCgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtRXJyb3JOb3RpZmljYXRpb25JbnN0YWxsZWQgPSB0cnVlOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAobUVycm9yTm90aWZpY2F0aW9uSW5zdGFsbGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1OZWVkU3luY0Vycm9yTm90aWZpY2F0aW9uID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIHNlbmRTeW5jU3RhdGVJbnRlbnQoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUVycm9yTm90aWZpY2F0aW9uSW5zdGFsbGVkID0gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgbWFuYWdlU3luY0FsYXJtKExvbmcgZWFybGllc3RGdXR1cmVQb2xsRWxhcHNlZFRpbWUpIHsKKyAgICAgICAgcHJpdmF0ZSB2b2lkIG1hbmFnZVN5bmNBbGFybUxvY2tlZChsb25nIG5leHRQZXJpb2RpY0V2ZW50RWxhcHNlZFRpbWUsCisgICAgICAgICAgICAgICAgbG9uZyBuZXh0UGVuZGluZ0V2ZW50RWxhcHNlZFRpbWUpIHsKICAgICAgICAgICAgIC8vIGluIGVhY2ggb2YgdGhlc2UgY2FzZXMgdGhlIHN5bmMgbG9vcCB3aWxsIGJlIGtpY2tlZCwgd2hpY2ggd2lsbCBjYXVzZSB0aGlzCiAgICAgICAgICAgICAvLyBtZXRob2QgdG8gYmUgY2FsbGVkIGFnYWluCiAgICAgICAgICAgICBpZiAoIW1EYXRhQ29ubmVjdGlvbklzQ29ubmVjdGVkKSByZXR1cm47CiAgICAgICAgICAgICBpZiAobVN0b3JhZ2VJc0xvdykgcmV0dXJuOwogCi0gICAgICAgICAgICBmaW5hbCBsb25nIG5vdyA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpOworICAgICAgICAgICAgLy8gV2hlbiB0aGUgc3RhdHVzIGJhciBub3RpZmljYXRpb24gc2hvdWxkIGJlIHJhaXNlZAorICAgICAgICAgICAgZmluYWwgbG9uZyBub3RpZmljYXRpb25UaW1lID0KKyAgICAgICAgICAgICAgICAgICAgKCFtU3luY0hhbmRsZXIubVN5bmNOb3RpZmljYXRpb25Jb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ICAgICAgaWYgKGVhcmxpZXN0RnV0dXJlUG9sbEVsYXBzZWRUaW1lID09IG51bGwgJiYgY2FuZGlkYXRlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFsYXJtVGltZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZWFybGllc3RGdXR1cmVQb2xsRWxhcHNlZFRpbWUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYWxhcm1UaW1lID0gY2FuZGlkYXRlLnNlY29uZDsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYW5kaWRhdGUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYWxhcm1UaW1lID0gZWFybGllc3RGdXR1cmVQb2xsRWxhcHNlZFRpbWU7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhbGFybVRpbWUgPSBNYXRoLm1pbihlYXJsaWVzdEZ1dHVyZVBvbGxFbGFwc2VkVGltZSwgY2FuZGlkYXRlLnNlY29uZCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIFdoZW4gd2Ugc2hvdWxkIGNvbnNpZGVyIGNhbmNlbGluZyBhbiBhY3RpdmUgc3luYworICAgICAgICAgICAgbG9uZyBlYXJsaWVzdFRpbWVvdXRUaW1lID0gTG9uZy5NQVhfVkFMVUU7CisgICAgICAgICAgICBmb3IgKEFjdGl2ZVN5bmNDb250ZXh0IGN1cnJlbnRTeW5jQ29udGV4dCA6IG1BY3RpdmVTeW5jQ29udGV4dHMpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGN1cnJlbnRTeW5jVGltZW91dFRpbWUgPQorICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFN5bmNDb250ZXh0Lm1UaW1lb3V0U3RhcnRUaW1lICsgTUFYX1RJTUVfUEVSX1NZTkM7CisgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIm1hbmFnZVN5bmNBbGFybTogYWN0aXZlIHN5bmMsIG1UaW1lb3V0U3RhcnRUaW1lICsgTUFYIGlzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGN1cnJlbnRTeW5jVGltZW91dFRpbWUpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgbG9uZyBub3RpZmljYXRpb25UaW1lID0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1TeW5jSGFuZGxlci5tU3luY05vdGlmaWNhdGlvbkluZm8uc3RhcnRUaW1lICsgU1lOQ19OT1RJRklDQVRJT05fREVMQVk7Ci0gICAgICAgICAgICAgICAgZmluYWwgbG9uZyB0aW1lb3V0VGltZSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQWN0aXZlU3luY0NvbnRleHQubVRpbWVvdXRTdGFydFRpbWUgKyBNQVhfVElNRV9QRVJfU1lOQzsKLSAgICAgICAgICAgICAgICBpZiAobVN5bmNIYW5kbGVyLm1TeW5jTm90aWZpY2F0aW9uSW5mby5pc0FjdGl2ZSkgewotICAgICAgICAgICAgICAgICAgICBhbGFybVRpbWUgPSB0aW1lb3V0VGltZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBhbGFybVRpbWUgPSBNYXRoLm1pbihub3RpZmljYXRpb25UaW1lLCB0aW1lb3V0VGltZSk7CisgICAgICAgICAgICAgICAgaWYgKGVhcmxpZXN0VGltZW91dFRpbWUgPiBjdXJyZW50U3luY1RpbWVvdXRUaW1lKSB7CisgICAgICAgICAgICAgICAgICAgIGVhcmxpZXN0VGltZW91dFRpbWUgPSBjdXJyZW50U3luY1RpbWVvdXRUaW1lOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgLy8gYWRqdXN0IHRoZSBhbGFybVRpbWUgc28gdGhhdCB3ZSB3aWxsIHdha2UgdXAgd2hlbiBpdCBpcyB0aW1lIHRvCi0gICAgICAgICAgICAvLyBpbnN0YWxsIHRoZSBlcnJvciBub3RpZmljYXRpb24KLSAgICAgICAgICAgIGlmICghbUVycm9yTm90aWZpY2F0aW9uSW5zdGFsbGVkKSB7Ci0gICAgICAgICAgICAgICAgbG9uZyB3aGVuID0gbVN5bmNTdG9yYWdlRW5naW5lLmdldEluaXRpYWxTeW5jRmFpbHVyZVRpbWUoKTsKLSAgICAgICAgICAgICAgICBpZiAod2hlbiA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgd2hlbiArPSBFUlJPUl9OT1RJRklDQVRJT05fREVMQVlfTVM7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgd2hlbiBmcm9uIGFic29sdXRlIHRpbWUgdG8gZWxhcHNlZCBydW4gdGltZQotICAgICAgICAgICAgICAgICAgICBsb25nIGRlbGF5ID0gd2hlbiAtIFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICAgICAgICAgICAgICB3aGVuID0gbm93ICsgZGVsYXk7Ci0gICAgICAgICAgICAgICAgICAgIGFsYXJtVGltZSA9IGFsYXJtVGltZSAhPSBudWxsID8gTWF0aC5taW4oYWxhcm1UaW1lLCB3aGVuKSA6IHdoZW47CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJtYW5hZ2VTeW5jQWxhcm06IG5vdGlmaWNhdGlvblRpbWUgaXMgIiArIG5vdGlmaWNhdGlvblRpbWUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJtYW5hZ2VTeW5jQWxhcm06IGVhcmxpZXN0VGltZW91dFRpbWUgaXMgIiArIGVhcmxpZXN0VGltZW91dFRpbWUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJtYW5hZ2VTeW5jQWxhcm06IG5leHRQZXJpb2RpY0V2ZW50RWxhcHNlZFRpbWUgaXMgIgorICAgICAgICAgICAgICAgICAgICAgICAgKyBuZXh0UGVyaW9kaWNFdmVudEVsYXBzZWRUaW1lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgIExvZy52KFRBRywgIm1hbmFnZVN5bmNBbGFybTogbmV4dFBlbmRpbmdFdmVudEVsYXBzZWRUaW1lIGlzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgbmV4dFBlbmRpbmdFdmVudEVsYXBzZWRUaW1lKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbG9uZyBhbGFybVRpbWUgPSBNYXRoLm1pbihub3RpZmljYXRpb25UaW1lLCBlYXJsaWVzdFRpbWVvdXRUaW1lKTsKKyAgICAgICAgICAgIGFsYXJtVGltZSA9IE1hdGgubWluKGFsYXJtVGltZSwgbmV4dFBlcmlvZGljRXZlbnRFbGFwc2VkVGltZSk7CisgICAgICAgICAgICBhbGFybVRpbWUgPSBNYXRoLm1pbihhbGFybVRpbWUsIG5leHRQZW5kaW5nRXZlbnRFbGFwc2VkVGltZSk7CisKKyAgICAgICAgICAgIC8vIEJvdW5kIHRoZSBhbGFybSB0aW1lLgorICAgICAgICAgICAgZmluYWwgbG9uZyBub3cgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKKyAgICAgICAgICAgIGlmIChhbGFybVRpbWUgPCBub3cgKyBTWU5DX0FMQVJNX1RJTUVPVVRfTUlOKSB7CisgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIm1hbmFnZVN5bmNBbGFybTogdGhlIGFsYXJtVGltZSBpcyB0b28gc21hbGwsICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGFsYXJtVGltZSArICIsIHNldHRpbmcgdG8gIiArIChub3cgKyBTWU5DX0FMQVJNX1RJTUVPVVRfTUlOKSk7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGFsYXJtVGltZSA9IG5vdyArIFNZTkNfQUxBUk1fVElNRU9VVF9NSU47CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFsYXJtVGltZSA+IG5vdyArIFNZTkNfQUxBUk1fVElNRU9VVF9NQVgpIHsKKyAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAibWFuYWdlU3luY0FsYXJtOiB0aGUgYWxhcm1UaW1lIGlzIHRvbyBsYXJnZSwgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYWxhcm1UaW1lICsgIiwgc2V0dGluZyB0byAiICsgKG5vdyArIFNZTkNfQUxBUk1fVElNRU9VVF9NSU4pKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYWxhcm1UaW1lID0gbm93ICsgU1lOQ19BTEFSTV9USU1FT1VUX01BWDsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgLy8gZGV0ZXJtaW5lIGlmIHdlIG5lZWQgdG8gc2V0IG9yIGNhbmNlbCB0aGUgYWxhcm0KICAgICAgICAgICAgIGJvb2xlYW4gc2hvdWxkU2V0ID0gZmFsc2U7CiAgICAgICAgICAgICBib29sZWFuIHNob3VsZENhbmNlbCA9IGZhbHNlOwogICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBhbGFybUlzQWN0aXZlID0gbUFsYXJtU2NoZWR1bGVUaW1lICE9IG51bGw7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIG5lZWRBbGFybSA9IGFsYXJtVGltZSAhPSBudWxsOworICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBuZWVkQWxhcm0gPSBhbGFybVRpbWUgIT0gTG9uZy5NQVhfVkFMVUU7CiAgICAgICAgICAgICBpZiAobmVlZEFsYXJtKSB7CiAgICAgICAgICAgICAgICAgaWYgKCFhbGFybUlzQWN0aXZlIHx8IGFsYXJtVGltZSA8IG1BbGFybVNjaGVkdWxlVGltZSkgewogICAgICAgICAgICAgICAgICAgICBzaG91bGRTZXQgPSB0cnVlOwpAQCAtMTk5OSw2ICsyMDgxLDExIEBACiAgICAgICAgICAgICAvLyBzZXQgb3IgY2FuY2VsIHRoZSBhbGFybSBhcyBkaXJlY3RlZAogICAgICAgICAgICAgZW5zdXJlQWxhcm1TZXJ2aWNlKCk7CiAgICAgICAgICAgICBpZiAoc2hvdWxkU2V0KSB7CisgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJlcXVlc3RpbmcgdGhhdCB0aGUgYWxhcm0gbWFuYWdlciB3YWtlIHVzIHVwIGF0IGVsYXBzZWQgdGltZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBhbGFybVRpbWUgKyAiLCBub3cgaXMgIiArIG5vdyArICIsICIgKyAoKGFsYXJtVGltZSAtIG5vdykgLyAxMDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBzZWNzIGZyb20gbm93Iik7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1BbGFybVNjaGVkdWxlVGltZSA9IGFsYXJtVGltZTsKICAgICAgICAgICAgICAgICBtQWxhcm1TZXJ2aWNlLnNldChBbGFybU1hbmFnZXIuRUxBUFNFRF9SRUFMVElNRV9XQUtFVVAsIGFsYXJtVGltZSwKICAgICAgICAgICAgICAgICAgICAgICAgIG1TeW5jQWxhcm1JbnRlbnQpOwpAQCAtMjAxMiw3ICsyMDk5LDcgQEAKICAgICAgICAgICAgIEludGVudCBzeW5jU3RhdGVJbnRlbnQgPSBuZXcgSW50ZW50KEludGVudC5BQ1RJT05fU1lOQ19TVEFURV9DSEFOR0VEKTsKICAgICAgICAgICAgIHN5bmNTdGF0ZUludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19SRUNFSVZFUl9SRUdJU1RFUkVEX09OTFlfQkVGT1JFX0JPT1QpOwogICAgICAgICAgICAgc3luY1N0YXRlSW50ZW50LnB1dEV4dHJhKCJhY3RpdmUiLCBtTmVlZFN5bmNBY3RpdmVOb3RpZmljYXRpb24pOwotICAgICAgICAgICAgc3luY1N0YXRlSW50ZW50LnB1dEV4dHJhKCJmYWlsaW5nIiwgbU5lZWRTeW5jRXJyb3JOb3RpZmljYXRpb24pOworICAgICAgICAgICAgc3luY1N0YXRlSW50ZW50LnB1dEV4dHJhKCJmYWlsaW5nIiwgZmFsc2UpOwogICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChzeW5jU3RhdGVJbnRlbnQpOwogICAgICAgICB9CiAKQEAgLTIxMDEsNCArMjE4OCwxMyBAQAogICAgICAgICAgICAgICAgICAgICByZXN1bHRNZXNzYWdlLCBkb3duc3RyZWFtQWN0aXZpdHksIHVwc3RyZWFtQWN0aXZpdHkpOwogICAgICAgICB9CiAgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGlzU3luY1N0aWxsQWN0aXZlKEFjdGl2ZVN5bmNDb250ZXh0IGFjdGl2ZVN5bmNDb250ZXh0KSB7CisgICAgICAgIGZvciAoQWN0aXZlU3luY0NvbnRleHQgc3luYyA6IG1BY3RpdmVTeW5jQ29udGV4dHMpIHsKKyAgICAgICAgICAgIGlmIChzeW5jID09IGFjdGl2ZVN5bmNDb250ZXh0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvU3luY09wZXJhdGlvbi5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9TeW5jT3BlcmF0aW9uLmphdmEKaW5kZXggYjAxNjA4ODUuLjNkN2YzZmJmIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L1N5bmNPcGVyYXRpb24uamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L1N5bmNPcGVyYXRpb24uamF2YQpAQCAtMzMsOSArMzMsMTIgQEAKICAgICBwdWJsaWMgbG9uZyBlYXJsaWVzdFJ1blRpbWU7CiAgICAgcHVibGljIGJvb2xlYW4gZXhwZWRpdGVkOwogICAgIHB1YmxpYyBTeW5jU3RvcmFnZUVuZ2luZS5QZW5kaW5nT3BlcmF0aW9uIHBlbmRpbmdPcGVyYXRpb247CisgICAgcHVibGljIExvbmcgYmFja29mZjsKKyAgICBwdWJsaWMgbG9uZyBkZWxheVVudGlsOworICAgIHB1YmxpYyBsb25nIGVmZmVjdGl2ZVJ1blRpbWU7CiAKICAgICBwdWJsaWMgU3luY09wZXJhdGlvbihBY2NvdW50IGFjY291bnQsIGludCBzb3VyY2UsIFN0cmluZyBhdXRob3JpdHksIEJ1bmRsZSBleHRyYXMsCi0gICAgICAgICAgICBsb25nIGRlbGF5SW5NcykgeworICAgICAgICAgICAgbG9uZyBkZWxheUluTXMsIGxvbmcgYmFja29mZiwgbG9uZyBkZWxheVVudGlsKSB7CiAgICAgICAgIHRoaXMuYWNjb3VudCA9IGFjY291bnQ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CgiLCAiICsgYXV0aG9yaXR5KTsKKyAgICAgICAgc2IuYXBwZW5kKCIsICIpOworICAgICAgICBzYi5hcHBlbmQoU3luY1N0b3JhZ2VFbmdpbmUuU09VUkNFU1tzeW5jU291cmNlXSk7CisgICAgICAgIHNiLmFwcGVuZCgiLCBlYXJsaWVzdFJ1blRpbWUgIiArIGVhcmxpZXN0UnVuVGltZSk7CisgICAgICAgIGlmIChleHBlZGl0ZWQpIHsKKyAgICAgICAgICAgIHNiLmFwcGVuZCgiLCBFWFBFRElURUQiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoIXVzZU9uZUxpbmUgJiYgIWV4dHJhcy5rZXlTZXQoKS5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgIHNiLmFwcGVuZCgiXG4gICAgIik7CisgICAgICAgICAgICBleHRyYXNUb1N0cmluZ0J1aWxkZXIoZXh0cmFzLCBzYik7CisgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7CiAgICAgfQogCisgICAgcHVibGljIGJvb2xlYW4gaXNJbml0aWFsaXphdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIGV4dHJhcy5nZXRCb29sZWFuKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19JTklUSUFMSVpFLCBmYWxzZSk7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaWdub3JlQmFja29mZigpIHsKKyAgICAgICAgcmV0dXJuIGV4dHJhcy5nZXRCb29sZWFuKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19JR05PUkVfQkFDS09GRiwgZmFsc2UpOworICAgIH0KKwogICAgIHByaXZhdGUgU3RyaW5nIHRvS2V5KCkgewogICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKICAgICAgICAgc2IuYXBwZW5kKCJhdXRob3JpdHk6ICIpLmFwcGVuZChhdXRob3JpdHkpOwotCXNiLmFwcGVuZCgiIGFjY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gQ29udGVudFJlc29sdmVyLlNZTkNfRVhUUkFTX0lOSVRJQUxJWkUuZXF1YWxzKGtleSkpIHsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KICAgICAgICAgICAgIHNiLmFwcGVuZChrZXkpLmFwcGVuZCgiPSIpLmFwcGVuZChidW5kbGUuZ2V0KGtleSkpLmFwcGVuZCgiICIpOwogICAgICAgICB9CiAgICAgICAgIHNiLmFwcGVuZCgiXSIpOwogICAgIH0KIAorICAgIHB1YmxpYyB2b2lkIHVwZGF0ZUVmZmVjdGl2ZVJ1blRpbWUoKSB7CisgICAgICAgIGVmZmVjdGl2ZVJ1blRpbWUgPSBpZ25vcmVCYWNrb2ZmKCkKKyAgICAgICAgICAgICAgICA/IGVhcmxpZXN0UnVuVGltZQorICAgICAgICAgICAgICAgIDogTWF0aC5tYXgoCisgICAgICAgICAgICAgICAgICAgIE1hdGgubWF4KGVhcmxpZXN0UnVuVGltZSwgZGVsYXlVbnRpbCksCisgICAgICAgICAgICAgICAgICAgIGJhY2tvZmYpOworICAgIH0KKwogICAgIHB1YmxpYyBpbnQgY29tcGFyZVRvKE9iamVjdCBvKSB7CiAgICAgICAgIFN5bmNPcGVyYXRpb24gb3RoZXIgPSAoU3luY09wZXJhdGlvbilvOwotICAgICAgICBpZiAoZWFybGllc3RSdW5UaW1lID09IG90aGVyLmVhcmxpZXN0UnVuVGltZSkgeworCisgICAgICAgIGlmIChleHBlZGl0ZWQgIT0gb3RoZXIuZXhwZWRpdGVkKSB7CisgICAgICAgICAgICByZXR1cm4gZXhwZWRpdGVkID8gLTEgOiAxOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGVmZmVjdGl2ZVJ1blRpbWUgPT0gb3RoZXIuZWZmZWN0aXZlUnVuVGltZSkgewogICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChlYXJsaWVzdFJ1blRpbWUgPCBvdGhlci5lYXJsaWVz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IGlzIGV4cGVkaXRlZAotICAgICAgICAgICAgLy8gZWxzZSwgbWFrZSB0aGUgY3VycmVudCB0aGUgYmVzdCBpZiBpdCBpcyBlYXJsaWVyIHRoYW4gdGhlIGJlc3QKLSAgICAgICAgICAgIGlmIChiZXN0ID09IG51bGwKLSAgICAgICAgICAgICAgICAgICAgfHwgKChiZXN0U3luY2FibGVJc1Vua25vd25BbmROb3RBUmV0cnkgPT0gc3luY2FibGVJc1Vua25vd25BbmROb3RBUmV0cnkpCi0gICAgICAgICAgICAgICAgICAgICAgICA/IChiZXN0LmV4cGVkaXRlZCA9PSBvcC5leHBlZGl0ZWQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3BSdW5UaW1lIDwgYmVzdFJ1blRpbWUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIDogb3AuZXhwZWRpdGVkKQotICAgICAgICAgICAgICAgICAgICAgICAgOiBzeW5jYWJsZUlzVW5rbm93bkFuZE5vdEFSZXRyeSkpIHsKLSAgICAgICAgICAgICAgICBiZXN0ID0gb3A7Ci0gICAgICAgICAgICAgICAgYmVzdFN5bmNhYmxlSXNVbmtub3duQW5kTm90QVJldHJ5ID0gc3luY2FibGVJc1Vua25vd25BbmROb3RBUmV0cnk7Ci0gICAgICAgICAgICAgICAgYmVzdFJ1blRpbWUgPSBvcFJ1blRpbWU7CisgICAgICAgICAgICBpZiAob3AuYWNjb3VudC5lcXVhbHMoYWNjb3VudCkgJiYgb3AuYXV0aG9yaXR5LmVxdWFscyhwcm92aWRlck5hbWUpKSB7CisgICAgICAgICAgICAgICAgb3AuYmFja29mZiA9IGJhY2tvZmY7CisgICAgICAgICAgICAgICAgb3AudXBkYXRlRWZmZWN0aXZlUnVuVGltZSgpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIGlmIChiZXN0ID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBQYWlyLmNyZ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gICAgIGZvciAoU3luY09wZXJhdGlvbiBvcCA6IG1PcGVyYXRpb25zTWFwLnZhbHVlcygpKSB7CisgICAgICAgICAgICBpZiAob3AuYWNjb3VudC5lcXVhbHMoYWNjb3VudCkgJiYgb3AuYXV0aG9yaXR5LmVxdWFscyhwcm92aWRlck5hbWUpKSB7CisgICAgICAgICAgICAgICAgb3AuZGVsYXlVbnRpbCA9IGRlbGF5VW50aWw7CisgICAgICAgICAgICAgICAgb3AudXBkYXRlRWZmZWN0aXZlUnVuVGltZSgpOworICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBuZXh0T3BBbmRSdW5UaW1lOwogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIHJlbW92ZShBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRob3JpdHkpIHsKQEAgLTIwMCw5ICsxNjUsMTcgQEAKICAgICB9CiAKICAgICBwdWJsaWMgdm9pZCBkdW1wKFN0cmluZ0J1aWxkZXIgc2IpIHsKKyAgICAgICAgZmluYWwgbG9uZyBub3cgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKICAgICAgICAgc2IuYXBwZW5kKCJTeW5jUXVldWU6ICIpLmFwcGVuZChtT3BlcmF0aW9uc01hcC5zaXplKCkpLmFwcGVuZCgiIG9wZXJhdGlvbihzKVxuIik7CiAgICAgICAgIGZvciAoU3luY09wZXJhdGlvbiBvcGVyYXRpb24gOiBtT3BlcmF0aW9uc01hcC52YWx1ZXMoKSkgewotICAgICAgICAgICAgc2IuYXBwZW5kKG9wZXJhdGlvbikuYXBwZW5kKCJcbiIpOworICAgICAgICAgICAgc2IuYXBwZW5kKCIgICIpOworICAgICAgICAgICAgaWYgKG9wZXJhdGlvbi5lZmZlY3RpdmVSdW5UaW1lIDw9IG5vdykgeworICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiUkVBRFkiKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICA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h0KSB7CisgICAgcHVibGljIFN5bmNJbmZvIGFkZEFjdGl2ZVN5bmMoU3luY01hbmFnZXIuQWN0aXZlU3luY0NvbnRleHQgYWN0aXZlU3luY0NvbnRleHQpIHsKKyAgICAgICAgZmluYWwgU3luY0luZm8gc3luY0luZm87CiAgICAgICAgIHN5bmNocm9uaXplZCAobUF1dGhvcml0aWVzKSB7Ci0gICAgICAgICAgICBpZiAoYWN0aXZlU3luY0NvbnRleHQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJzZXRBY3RpdmVTeW5jOiBhY2NvdW50PSIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgYWN0aXZlU3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uYWNjb3VudAotICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGF1dGg9IiArIGFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jT3BlcmF0aW9uLmF1dGhvcml0eQotICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHNyYz0iICsgYWN0aXZlU3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uc3luY1NvdXJjZQotICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGV4dHJhcz0iICsgYWN0aXZlU3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uZXh0cmFzKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG1DdXJyZW50U3luYyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgInNldEFjdGl2ZVN5bmMgY2FsbGVkIHdpdGggZXhpc3RpbmcgYWN0aXZlIHN5bmMhIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIEF1dGhvcml0eUluZm8gYXV0aG9yaXR5ID0gZ2V0QXV0aG9yaXR5TG9ja2VkKAotICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlU3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uYWNjb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jT3BlcmF0aW9uLmF1dGhvcml0eSwKLSAgICAgICAgICAgICAgICAgICAgICAgICJzZXRBY3RpdmVTeW5jIik7Ci0gICAgICAgICAgICAgICAgaWYgKGF1dGhvcml0eSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTeW5jID0gbmV3IFN5bmNJbmZvKGF1dGhvcml0eS5pZGVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhvcml0eS5hY2NvdW50LCBhdXRob3JpdHkuYXV0aG9yaXR5LAotICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlU3luY0NvbnRleHQubVN0YXJ0VGltZSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgTG9nLnYoVEFHLCAic2V0QWN0aXZlU3luYzogbnVsbCIpOwotICAgICAgICAgICAgICAgIG1DdXJyZW50U3luYyA9IG51bGw7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJzZXRBY3RpdmVTeW5jOiBhY2NvdW50PSIKKyAgICAgICAgICAgICAgICAgICAgKyBhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbi5hY2NvdW50CisgICAgICAgICAgICAgICAgICAgICsgIiBhdXRoPSIgKyBhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbi5hdXRob3JpdHkKKyAgICAgICAgICAgICAgICAgICAgKyAiIHNyYz0iICsgYWN0aXZlU3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uc3luY1NvdXJjZQorICAgICAgICAgICAgICAgICAgICArICIgZXh0cmFzPSIgKyBhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbi5leHRyYXMpOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgQXV0aG9yaXR5SW5mbyBhdXRob3JpdHkgPSBnZXRPckNyZWF0ZUF1dGhvcml0eUxvY2tlZCgKKyAgICAgICAgICAgICAgICAgICAgYWN0aXZlU3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uYWNjb3VudCwKKyAgICAgICAgICAgICAgICAgICAgYWN0aXZlU3luY0NvbnRleHQubVN5bmNPcGVyYXRpb24uYXV0aG9yaXR5LAorICAgICAgICAgICAgICAgICAgICAtMSAvKiBhc3NpZ24gYSBuZXcgaWRlbnRpZmllciBpZiBjcmVhdGluZyBhIG5ldyBhdXRob3JpdHkgKi8sCisgICAgICAgICAgICAgICAgICAgIHRydWUgLyogd3JpdGUgdG8gc3RvcmFnZSBpZiB0aGlzIHJlc3VsdHMgaW4gYSBjaGFuZ2UgKi8pOworICAgICAgICAgICAgc3luY0luZm8gPSBuZXcgU3luY0luZm8oYXV0aG9yaXR5LmlkZW50LAorICAgICAgICAgICAgICAgICAgICBhdXRob3JpdHkuYWNjb3VudCwgYXV0aG9yaXR5LmF1dGhvcml0eSwKKyAgICAgICAgICAgICAgICAgICAgYWN0aXZlU3luY0NvbnRleHQubVN0YXJ0VGltZSk7CisgICAgICAgICAgICBtQ3VycmVudFN5bmNzLmFkZChzeW5jSW5mbyk7CiAgICAgICAgIH0KIAotICAgICAgICByZXBvcnRDaGFuZ2UoQ29udGVudFJlc29sdmVyLlNZTkNfT0JTRVJWRVJfVFlQRV9BQ1RJVkUpOworICAgICAgICByZXBvcnRBY3RpdmVDaGFuZ2UoKTsKKyAgICAgICAgcmV0dXJuIHN5bmNJbmZvOworICAgIH0KKworICAgIC8qKgorICAgICAqIEN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lcnJpZGUKKyAgICBwdWJsaWMgQ3Vyc29yIHF1ZXJ5KFVyaSB1cmksIFN0cmluZ1tdIHByb2plY3Rpb24sIFN0cmluZyBzZWxlY3Rpb24sIFN0cmluZ1tdIHNlbGVjdGlvbkFyZ3MsCisgICAgICAgICAgICBTdHJpbmcgc29ydE9yZGVyKSB7CisKKyAgICAgICAgWG1sUHVsbFBhcnNlciBwYXJzZXIgPSBudWxsOworICAgICAgICBtSHR0cENsaWVudCA9IG51bGw7CisKKyAgICAgICAgZmluYWwgU3RyaW5nIHVybCA9IHVyaS5nZXRRdWVyeVBhcmFtZXRlcigidXJsIik7CisgICAgICAgIGlmICh1cmwgIT0gbnVsbCkgeworICAgICAgICAgICAgcGFyc2VyID0gZ2V0VXJpWG1sUHVsbFBhcnNlcih1cmwpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIHJlc291cmNlID0gdXJpLmdldFF1ZXJ5UGFyYW1ldGVyKCJyZXNvdXJjZSIpOworICAgICAgICAgICAgaWYgKHJlc291cmNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBVcmkgcmVzb3VyY2VVcmkgPSBVcmkucGFyc2UoQ29udGVudFJlc29sdmVyLlNDSEVNRV9BTkRST0lEX1JFU09VUkNFICsgIjovLyIgKworICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldFBhY2thZ2VOYW1lKCkgKyAiLyIgKyByZXNvdXJjZSk7CisgICAgICAgICAgICAgICAgcGFyc2VyID0gZ2V0UmVzb3VyY2VYbWxQdWxsUGFyc2VyKHJlc291cmNlVXJpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChwYXJzZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgWE1MQ3Vyc29yIHhtbEN1cnNvciA9IG5ldyBYTUxDdXJzb3Ioc2VsZWN0aW9uLCBwcm9qZWN0aW9uKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgeG1sQ3Vyc29yLnBhcnNlV2l0aChwYXJzZXIpOworICAgICAgICAgICAgICAgIHJldHVybiB4bWxDdXJzb3I7CisgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIkkvTyBlcnJvciB3aGlsZSBwYXJzaW5nIFhNTCAiICsgdXJpLCBlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFhtbFB1bGxQYXJzZXJFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJFcnJvciB3aGlsZSBwYXJzaW5nIFhNTCAiICsgdXJpLCBlKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgaWYgKG1IdHRwQ2xpZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUh0dHBDbGllbnQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDcmVhdGVzIGFuIFhtbFB1bGxQYXJzZXIgZm9yIHRoZSBwcm92aWRlZCBVUkwuIENhbiBiZSBvdmVybG9hZGVkIHRvIHByb3ZpZGUgeW91ciBvd24gcGFyc2VyLgorICAgICAqIEBwYXJhbSB1cmwgVGhlIFVSTCBvZiB0aGUgWE1MIGRvY3VtZW50IHRoYXQgaXMgdG8gYmUgcGFyc2VkLgorICAgICAqIEByZXR1cm4gQW4gWG1sUHVsbFBhcnNlciBvbiB0aGlzIGRvY3VtZW50LgorICAgICAqLworICAgIHByb3RlY3RlZCBYbWxQdWxsUGFyc2VyIGdldFVyaVhtbFB1bGxQYXJzZXIoU3RyaW5nIHVybCkgeworICAgICAgICBYbWxQdWxsUGFyc2VyIHBhcnNlciA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICA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Z2V0Q29udGV4dCgpLmdldENvbnRlbnRSZXNvbHZlcigpLmdldFJlc291cmNlSWQocmVzb3VyY2VVcmkpOworICAgICAgICAgICAgcmV0dXJuIHJlc291cmNlSWQuci5nZXRYbWwocmVzb3VyY2VJZC5pZCk7CisgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiWE1MIHJlc291cmNlIG5vdCBmb3VuZDogIiArIHJlc291cmNlVXJpLnRvU3RyaW5nKCksIGUpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL3htbGRvYyIuCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZyBnZXRUeXBlKFVyaSB1cmkpIHsKKyAgICAgICAgcmV0dXJuICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL3htbGRvYyI7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBDb250ZW50UHJvdmlkZXIgaXMgcmVhZC1vbmx5LiBUaGlzIG1ldGhvZCB0aHJvd3MgYW4gVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24uCisgICAgICoqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBVcmkgaW5zZXJ0KFVyaSB1cmksIENvbnRlbnRWYWx1ZXMgdmFsdWVzKSB7CisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRoaXMgQ29udGVudFByb3ZpZGVyIGlzIHJlYWQtb25seS4gVGhpcyBtZXRob2QgdGhyb3dzIGFuIFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uLgorICAgICAqKi8KKyAgICBAT3ZlcnJp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KSB7CisgICAgICAgICAgICBzdXBlcihwcm9qZWN0aW9ucyk7CisgICAgICAgICAgICAvLyBUaGUgZmlyc3QgY29sdW1uIGluIHByb2plY3Rpb25zIGlzIHVzZWQgZm9yIHRoZSBfSUQKKyAgICAgICAgICAgIG1OdW1iZXJPZlByb2plY3Rpb25zID0gcHJvamVjdGlvbnMubGVuZ3RoIC0gMTsKKyAgICAgICAgICAgIG1TZWxlY3Rpb25QYXR0ZXJuID0gY3JlYXRlUGF0dGVybihzZWxlY3Rpb24pOworICAgICAgICAgICAgY3JlYXRlUHJvamVjdGlvblBhdHRlcm4ocHJvamVjdGlvbnMpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBQYXR0ZXJuIGNyZWF0ZVBhdHRlcm4oU3RyaW5nIGlucHV0KSB7CisgICAgICAgICAgICBTdHJpbmcgcGF0dGVybiA9IGlucHV0LnJlcGxhY2VBbGwoIi8vIiwgIi8oLiovfCkiKS5yZXBsYWNlQWxsKCJeLyIsICJeLyIpICsgIiQiOworICAgICAgICAgICAgcmV0dXJuIFBhdHRlcm4uY29tcGlsZShwYXR0ZXJuKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBjcmVhdGVQcm9qZWN0aW9uUGF0dGVybihTdHJpbmdbXSBwcm9qZWN0aW9ucykgeworICAgICAgICAgICAgbVByb2plY3Rpb25QYXR0ZXJucyA9IG5ldyBQYXR0ZXJuW21OdW1iZXJPZlByb2plY3Rpb25zXTsKKyAgICAgICAgICAgIG1BdHRyaWJ1dGVOYW1lcyA9IG5ldyBTdHJpbmdbbU51bWJlck9mUHJvamVjdGlvbnNdOworICAgICAgICAgICAgbUFjdGl2ZVRleHREZXB0aE1hc2sgPSBuZXcgQml0U2V0W21OdW1iZXJPZlByb2plY3Rpb25zXTsKKyAgICAgICAgICAgIC8vIEFkZCBhIGNvbHVtbiB0byBzdG9yZSBfSUQKKyAgICAgICAgICAgIG1DdXJyZW50VmFsdWVzID0gbmV3IFN0cmluZ1ttTnVtYmVyT2ZQcm9qZWN0aW9ucyArIDFdOworCisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bU51bWJlck9mUHJvamVjdGlvbnM7IGkrKykgeworICAgICAgICAgICAgICAgIG1BY3RpdmVUZXh0RGVwdGhNYXNrW2ldID0gbmV3IEJpdFNldCgpOworICAgICAgICAgICAgICAgIFN0cmluZyBwcm9qZWN0aW9uID0gcHJvamVjdGlvbnNbaSArIDFdOyAvLyArMSB0byBza2lwIHRoZSBfSUQgY29sdW1uCisgICAgICAgICAgICAgICAgaW50IGF0SW5kZXggPSBwcm9qZWN0aW9uLmxhc3RJbmRleE9mKCdAJywgcHJvamVjdGlvbi5sZW5ndGgoKSk7CisgICAgICAgICAgICAgICAgaWYgKGF0SW5kZXggPj0gMCkgeworICAgICAgICAgICAgICAgICAgICBtQXR0cmlidXRlTmFtZXNbaV0gPSBwcm9qZWN0aW9uLnN1YnN0cmluZyhhdEluZGV4KzEpOworICAgICAgICAgICAgICAgICAgICBwcm9qZWN0aW9uID0gcHJvamVjdGlvbi5zdWJzdHJpbmcoMCwgYXRJbmRleCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnV0ZU5hbWVzW2ldID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBDb25mb3JtcyB0byBYUGF0aCBzdGFuZGFyZDogcmVmZXJlbmNlIHRvIGxvY2FsIGNvbnRleHQgc3RhcnRzIHdpdGggYSAuCisgICAgICAgICAgICAgICAgaWYgKHByb2plY3Rpb24uY2hhckF0KDApID09ICcuJykgeworICAgICAgICAgICAgICAgICAgICBwcm9qZWN0aW9uID0gcHJvamVjdGlvbi5zdWJzdHJpbmcoMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1Qcm9qZWN0aW9uUGF0dGVybnNbaV0gPSBjcmVhdGVQYXR0ZXJuKHByb2pl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XZlbnRUeXBlKCk7CisgICAgICAgICAgICB3aGlsZSAoZXZlbnRUeXBlICE9IFhtbFB1bGxQYXJzZXIuRU5EX0RPQ1VNRU5UKSB7CisKKyAgICAgICAgICAgICAgICBpZiAoZXZlbnRUeXBlID09IFhtbFB1bGxQYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSBwYXRoCisgICAgICAgICAgICAgICAgICAgIHBhdGhMZW5ndGhTdGFjay5wdXNoKHBhdGgubGVuZ3RoKCkpOworICAgICAgICAgICAgICAgICAgICBwYXRoLmFwcGVuZCgnLycpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcHJlZml4ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGdldFByZWZpeCBpcyBub3Qgc3VwcG9ydGVkIGJ5IGxvY2FsIFhtbCByZXNvdXJjZSBwYXJzZXIKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCA9IHBhcnNlci5nZXRQcmVmaXgoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXggPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChwcmVmaXggIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcGF0aC5hcHBlbmQocHJlZml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhdGguYXBwZW5kKCc6Jyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcGF0aC5hcHBlbmQocGFyc2VyLmdldE5hbWUoKSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnROb2RlRGVwdGggPj0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE5vZGVEZXB0aCsrOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQSBub2RlIG1hdGNoaW5nIHNlbGVjdGlvbiBpcyBmb3VuZDogaW5pdGlhbGl6ZSBjaGlsZCBwYXJzaW5nIG1vZGUKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU2VsZWN0aW9uUGF0dGVybi5tYXRjaGVyKHBhdGgudG9TdHJpbmcoKSkubWF0Y2hlcygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE5vZGVEZXB0aCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE5vZGVQYXRoU3RhcnRJbmRleCA9IHBhdGgubGVuZ3RoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRWYWx1ZXNbMF0gPSBJbnRlZ2VyLnRvU3RyaW5nKGdldENvdW50KCkpOyAvLyBfSUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1OdW1iZXJPZlByb2plY3Rpb25zOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVzZXQgdmFsdWVzIHRvIGRlZmF1bHQgKGVtcHR5IHN0cmluZykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRWYWx1ZXNbaSArIDFdID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVUZXh0RGVwdGhNYXNrW2ldLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyB0ZXN0IGhhcyB0byBiZSBzZXBhcmF0ZWQgZnJvbSB0aGUgcHJldmlvdXMgb25lIGFzIGN1cnJlbnROb2RlRGVwdGggY2FuCisgICAgICAgICAgICAgICAgICAgIC8vIGJlIG1vZGlmaWVkIGFib3ZlICh3aGVuIGEgbm9kZSBtYXRjaGluZyBzZWxlY3Rpb24gaXMgZm91bmQpLgorICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE5vZGVEZXB0aCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbG9jYWxOb2RlUGF0aCA9IHBhdGguc3Vic3RyaW5nKGN1cnJlbnROb2RlUGF0aFN0YXJ0SW5kZXgpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtTnVtYmVyT2ZQcm9qZWN0aW9uczsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Qcm9qZWN0aW9uUGF0dGVybnNbaV0ubWF0Y2hlcihsb2NhbE5vZGVQYXRoKS5tYXRjaGVzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGF0dHJpYnV0ZSA9IG1BdHRyaWJ1dGVOYW1lc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHJpYnV0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFZhbHVlc1tpICsgMV0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCBhdHRyaWJ1dGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVRleHREZXB0aE1hc2tbaV0uc2V0KGN1cnJlbnROb2RlRGVwdGgsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50VHlwZSA9PSBYbWxQdWxsUGFyc2VyLkVORF9UQUcpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gUG9wIGxhc3Qgbm9kZSBmcm9tIHBhdGgKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGxlbmd0aCA9IHBhdGhMZW5ndGhTdGFjay5wb3AoKTsKKyAgICAgICAgICAgICAgICAgICAgcGF0aC5zZXRMZW5ndGgobGVuZ3RoKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE5vZGVEZXB0aCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE5vZGVEZXB0aCA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTGVhdmluZyBhIHNlbGVjdGlvbiBtYXRjaGluZyBub2RlOiBhZGQgYSBuZXcgcm93IHdpdGggcmVzdWx0cworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZFJvdyhtQ3VycmVudFZhbHVlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU51bWJlck9mUHJvamVjdGlvbnM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aXZlVGV4dERlcHRoTWFza1tpXS5zZXQoY3VycmVudE5vZGVEZXB0aCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnROb2RlRGVwdGgtLTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoZXZlbnRUeXBlID09IFhtbFB1bGxQYXJzZXIuVEVYVCkgJiYgKCFwYXJzZXIuaXNXaGl0ZXNwYWNlKCkpKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU51bWJlck9mUHJvamVjdGlvbnM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjdXJyZW50Tm9kZURlcHRoID49IDApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1BY3RpdmVUZXh0RGVwdGhNYXNrW2ldLmdldChjdXJyZW50Tm9kZURlcHRoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFZhbHVlc1tpICsgMV0gKz0gcGFyc2VyLmdldFRleHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGV2ZW50VHlwZSA9IHBhcnNlci5uZXh0KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L3BtL0FjdGl2aXR5SW5mby5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9wbS9BY3Rpdml0eUluZm8uamF2YQppbmRleCBlMjZmMTYwLi5lNjg4Yzg2IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L3BtL0FjdGl2aXR5SW5mby5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvcG0vQWN0aXZpdHlJbmZvLmphdmEKQEAgLTE0OSw2ICsxNDksMjcgQEAKICAgICAgKiB7QGxpbmsgYW5kcm9pZC5SLmF0dHIjZmluaXNoT25DbG9zZVN5c3RlbURpYWxvZ3N9IGF0dHJpYnV0ZS4KICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGTEFHX0ZJTklTSF9PT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yLAogICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmRyb2lkTWFuaWZlc3RJbnN0cnVtZW50YXRpb25fbmFtZSwKICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0SW5zdHJ1bWVudGF0aW9uX2xhYmVsLAotICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmRyb2lkTWFuaWZlc3RJbnN0cnVtZW50YXRpb25faWNvbiwgMCk7CisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuZHJvaWRNYW5pZmVzdEluc3RydW1lbnRhdGlvbl9pY29uLAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmRyb2lkTWFuaWZlc3RJbnN0cnVtZW50YXRpb25fbG9nbyk7CiAgICAgICAgICAgICBtUGFyc2VJbnN0cnVtZW50YXRpb25BcmdzLnRhZyA9ICI8aW5zdHJ1bWVudGF0aW9uPiI7CiAgICAgICAgIH0KICAgICAgICAgCkBAIC0xNTA4LDEwICsxNTA4LDE4IEBACiAgICAgICAgICAgICBhaS5ub25Mb2NhbGl6ZWRMYWJlbCA9IHYuY29lcmNlVG9TdHJpbmcoKTsKICAgICAgICAgfQogCisgICAgICAgIGludCBkZWZhdWx0VGhlbWUgPSAwOworICAgICAgICBpZiAob3duZXIuYXBwbGljYXRpb25JbmZvLnRhcmdldFNka1ZlcnNpb24gPj0gYW5kcm9pZC5vcy5CdWlsZC5WRVJTSU9OX0NPREVTLkhPTkVZQ09NQikgeworICAgICAgICAgICAgLy8gQXMgb2YgaG9uZXljb21iLCB0aGUgZGVmYXVsdCBhcHBsaWNhdGlvbiB0aGVtZSBpcyBob2xvZ3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oCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0QXBwbGljYXRpb25faGFyZHdhcmVBY2NlbGVyYXRlZCwKKyAgICAgICAgICAgICAgICBmYWxzZSk7CisKICAgICAgICAgaWYgKHNhLmdldEJvb2xlYW4oCiAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0QXBwbGljYXRpb25faGFzQ29kZSwKICAgICAgICAgICAgICAgICB0cnVlKSkgewpAQCAtMTY0Miw3ICsxNjU0LDggQEAKIAogICAgICAgICAgICAgU3RyaW5nIHRhZ05hbWUgPSBwYXJzZXIuZ2V0TmFtZSgpOwogICAgICAgICAgICAgaWYgKHRhZ05hbWUuZXF1YWxzKCJhY3Rpdml0eSIpKSB7Ci0gICAgICAgICAgICAgICAgQWN0aXZpdHkgYSA9IHBhcnNlQWN0aXZpdHkob3duZXIsIHJlcywgcGFyc2VyLCBhdHRycywgZmxhZ3MsIG91dEVycm9yLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgQWN0aXZpdHkgYSA9IHBhcnNlQWN0aXZpdHkob3duZXIsIHJlcywgcGFyc2VyLCBhdHRycywgZmxhZ3MsIG91dEVycm9yLCBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGhhcmR3YXJlQWNjZWxlcmF0ZWQpOwogICAgICAgICAgICAgICAgIGlmIChhID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgbVBhcnNlRXJyb3IgPSBQYWNrYWdlTWFuYWdlci5JTlNUQUxMX1BBUlNFX0ZBSUxFRF9NQU5JRkVTVF9NQUxGT1JNRUQ7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKQEAgLTE2NTEsNyArMTY2NCw3IEBACiAgICAgICAgICAgICAgICAgb3duZXIuYWN0aXZpdGllcy5hZGQoYSk7CiAKICAgICAgICAgICAgIH0gZWxzZSBpZiAodGFnTmFtZS5lcXVhbHMoInJlY2VpdmVyIikpIHsKLSAgICAgICAgICAgICAgICBBY3Rpdml0eSBhID0gcGFyc2VBY3Rpdml0eShvd25lciwgcmVzLCBwYXJzZXIsIGF0dHJzLCBmbGFncywgb3V0RXJyb3IsIHRydWUpOworICAgICAgICAgICAgICAgIEFjdGl2aXR5IGEgPSBwYXJzZUFjdGl2aXR5KG93bmVyLCByZXMsIHBhcnNlciwgYXR0cnMsIGZsYWdzLCBvdXRFcnJvciwgdHJ1ZSwgZmFsc2UpOwogICAgICAgICAgICAgICAgIGlmIChhID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgbVBhcnNlRXJyb3IgPSBQYWNrYWdlTWFuYWdlci5JTlNUQUxMX1BBUlNFX0ZBSUxFRF9NQU5JRkVTVF9NQUxGT1JNRUQ7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKQEAgLTE3NzQsNiArMTc4NywxMSBAQAogICAgICAgICAgICAgb3V0SW5mby5ub25Mb2NhbGl6ZWRMYWJlbCA9IG51bGw7CiAgICAgICAgIH0KICAgICAgICAgCisgICAgICAgIGludCBsb2dvVmFsID0gc2EuZ2V0UmVzb3VyY2VJZChsb2dvUmVzLCAwKTsKKyAgICAgICAgaWYgKGxvZ29WYWwgIT0gMCkgeworICAgICAgICAgICAgb3V0SW5mby5sb2dvID0gbG9nb1ZhbDsKKyAgICAgICAgfQorCiAgICAgICAgIFR5cGVkVmFsdWUgdiA9IHNhLnBlZWtWYWx1ZShsYWJlbFJlcyk7CiAgICAgICAgIGlmICh2ICE9IG51bGwgJiYgKG91dEluZm8ubGFiZWxSZXM9di5yZXNvdXJjZUlkKSA9PSAwKSB7CiAgICAgICAgICAgICBvdXRJbmZvLm5vbkxvY2FsaXplZExhYmVsID0gdi5jb2VyY2VUb1N0cmluZygpOwpAQCAtMTc4Niw3ICsxODA0LDggQEAKIAogICAgIHByaXZhdGUgQW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zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0QWN0aXZpdHlBbGlhc19sb2dvLAogICAgICAgICAgICAgICAgICAgICBtU2VwYXJhdGVQcm9jZXNzZXMsCiAgICAgICAgICAgICAgICAgICAgIDAsCiAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuZHJvaWRNYW5pZmVzdEFjdGl2aXR5QWxpYXNfZGVzY3JpcHRpb24sCkBAIC0yMTMyLDcgKzIxNjUsOCBAQAogICAgICAgICAgICAgbVBhcnNlUHJvdmlkZXJBcmdzID0gbmV3IFBhcnNlQ29tcG9uZW50QXJncyhvd25lciwgb3V0RXJyb3IsCiAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuZHJvaWRNYW5pZmVzdFByb3ZpZGVyX25hbWUsCiAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuZHJvaWRNYW5pZmVzdFByb3ZpZGVyX2xhYmVsLAotICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmRyb2lkTWFuaWZlc3RQcm92aWRlcl9pY29uLCAwLAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmRyb2lkTWFuaWZlc3RQcm92aWRlcl9pY29uLAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmRyb2lkTWFuaWZlc3RQcm92aWRlcl9sb2dvLAogICAgICAgICAgICAgICAgICAgICBtU2VwYXJhdGVQcm9jZXNzZXMsCiAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuZHJvaWRNYW5pZmVzdFByb3ZpZGVyX3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4LDYgKzI2NTMsOSBAQAogICAgICAgICBvdXRJbmZvLmljb24gPSBzYS5nZXRSZXNvdXJjZUlkKAogICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFuZHJvaWRNYW5pZmVzdEludGVudEZpbHRlcl9pY29uLCAwKTsKICAgICAgICAgCisgICAgICAgIG91dEluZm8ubG9nbyA9IHNhLmdldFJlc291cmNlSWQoCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0SW50ZW50RmlsdGVyX2xvZ28sIDApOworCiAgICAgICAgIHNhLnJlY3ljbGUoKTsKIAogICAgICAgICBpbnQgb3V0ZXJEZXB0aCA9IHBhcnNlci5nZXREZXB0aCgpOwpAQCAtMjg4NSw2ICsyOTIzLDExIEBACiAgICAgICAgICAgICAgICAgb3V0SW5mby5ub25Mb2NhbGl6ZWRMYWJlbCA9IG51bGw7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAKKyAgICAgICAgICAgIGludCBsb2dvVmFsID0gYXJncy5zYS5nZXRSZXNvdXJjZUlkKGFyZ3MubG9nb1JlcywgMCk7CisgICAgICAgICAgICBpZiAobG9nb1ZhbCAhPSAwKSB7CisgICAgICAgICAgICAgICAgb3V0SW5mby5sb2dvID0gbG9nb1ZhbDsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgVHlwZWRWYWx1ZSB2ID0gYXJncy5zYS5wZWVrVmFsdWUoYXJncy5sYWJlbFJlcyk7CiAgICAgICAgICAgICBpZiAodiAhPSBudWxsICYmIChvdXRJbmZvLmxhYmVsUmVzPXYucmVzb3VyY2VJZCkgPT0gMCkgewogICAgICAgICAgICAgICAgIG91dEluZm8ubm9uTG9jYWxpemVkTGFiZWwgPSB2LmNvZXJjZVRvU3RyaW5nKCk7CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L3J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VEZXNjcmlwdG9yLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBFLmcuIENvbnRlbnRSZXNvbHZlci5QYXJjZWxGaWxlRGVzY3JpcHRvcklubmVyLmNsb3NlKCkgcmVsZWFzZXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYSBjb250ZW50IHByb3ZpZGVyCi0gICAgICAgICAgICBtRmlsZS5jbG9zZSgpOyAgICAgIC8vIHRvIHVubWFwIHRoZSBtZW1vcnkgZmlsZSBmcm9tIHRoZSBhZGRyZXNzIHNwYWNlLgotICAgICAgICAgICAgbVN0cmVhbS5jbG9zZSgpOyAgICAvLyBkb2Vzbid0IGFjdHVhbGx5IGRvIGFueXRoaW5nCi0gICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIEZpbGVDaGFubmVsIGdldENoYW5uZWwoKSB7Ci0gICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgaW50IHJlYWQoKSB0aHJvd3MgSU9FeGNlcHRpb24gewotICAgICAgICAgICAgcmV0dXJuIG1TdHJlYW0ucmVhZCgpOwotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyBpbnQgcmVhZChieXRlW10gYnVmZmVyLCBpbnQgb2Zmc2V0LCBpbnQgY291bnQpIHRocm93cyBJT0V4Y2VwdGlvbiB7Ci0gICAgICAgICAgICByZXR1cm4gbVN0cmVhbS5yZWFkKGJ1ZmZlciwgb2Zmc2V0LCBjb3VudCk7Ci0gICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIGludCByZWFkKGJ5dGVbXSBidWZmZXIpIHRocm93cyBJT0V4Y2VwdGlvbiB7Ci0gICAgICAgICAgICByZXR1cm4gbVN0cmVhbS5yZWFkKGJ1ZmZlcik7Ci0gICA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Z2VyLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9yZXMvQXNzZXRNYW5hZ2VyLmphdmEKQEAgLTE0OSw3ICsxNDksNyBAQAogICAgIC8qcGFja2FnZSovIGZpbmFsIENoYXJTZXF1ZW5jZSBnZXRSZXNvdXJjZVRleHQoaW50IGlkZW50KSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgVHlwZWRWYWx1ZSB0bXBWYWx1ZSA9IG1WYWx1ZTsKLSAgICAgICAgICAgIGludCBibG9jayA9IGxvYWRSZXNvdXJjZVZhbHVlKGlkZW50LCB0bXBWYWx1ZSwgdHJ1ZSk7CisgICAgICAgICAgICBpbnQgYmxvY2sgPSBsb2FkUmVzb3VyY2VWYWx1ZShpZGVudCwgKHNob3J0KSAwLCB0bXBWYWx1ZSwgdHJ1ZSk7CiAgICAgICAgICAgICBpZiAoYmxvY2sgPj0gMCkgewogICAgICAgICAgICAgICAgIGlmICh0bXBWYWx1ZS50eXBlID09IFR5cGVkVmFsdWUuVFlQRV9TVFJJTkcpIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1TdHJpbmdCbG9ja3NbYmxvY2tdLmdldCh0bXBWYWx1ZS5kYXRhKTsKQEAgLTE5MCwxMCArMTkwLDExIEBACiAKIAogICAgIC8qcGFja2FnZSovIGZpbmFsIGJvb2xlYW4gZ2V0UmVzb3VyY2VWYWx1ZShpbnQgaWRlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkZW5zaXR5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUeXBlZFZhbHVlIG91dFZhbHVlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIHJlc29sdmVSZWZzKQogICAgIHsKLSAgICAgICAgaW50IGJsb2NrID0gbG9hZFJlc291cmNlVmFsdW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fSBkZWZpbmVzIHdoZXRoZXIgdGhlIHNjcmVlbgogICAgICAqIGlzIHdpZGVyL3RhbGxlciB0aGFuIG5vcm1hbC4gIFRoZXkgbWF5IGJlIG9uZSBvZgpAQCAtMjY2LDExICsyNjYsMTggQEAKICAgICAgICAgc2IuYXBwZW5kKCIvIik7CiAgICAgICAgIHNiLmFwcGVuZChuYXZpZ2F0aW9uSGlkZGVuKTsKICAgICAgICAgc2IuYXBwZW5kKCIgb3JpZW49Iik7Ci0gICAgICAgIHNiLmFwcGVuZChvcmllbnRhdGlvbik7Ci0gICAgICAgIHNiLmFwcGVuZCgiIGxheW91dD0iKTsKLSAgICAgICAgc2IuYXBwZW5kKHNjcmVlbkxheW91dCk7Ci0gICAgICAgIHNiLmFwcGVuZCgiIHVpTW9kZT0iKTsKLSAgICAgICAgc2IuYXBwZW5kKHVpTW9kZSk7CisgICAgICAgIHN3aXRjaChvcmllbnRhdGlvbikgeworICAgICAgICAgICAgY2FzZSBPUklFTlRBVElPTl9MQU5EU0NBUEU6CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCJMIik7IGJyZWFrOworICAgICAgICAgICAgY2FzZSBPUklFTlRBVElPTl9QT1JUUkFJVDoKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIlAiKTsgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHNiLmFwcGVuZChvcmllbnRhdGlvbik7CisgICAgICAgIH0KKyAgICAgICAgc2IuYXBwZW5kKCIgbGF5b3V0PTB4Iik7CisgICAgICAgIHNiLmFwcGVuZChqYXZhLmxhbmcuSW50ZWdlci50b0hleFN0cmluZyhzY3JlZW5MYXlvdXQpKTsKKyAgICAgICAgc2IuYXBwZW5kKCIgdWlNb2RlPTB4Iik7CisgICAgICAgIHNiLmFwcGVuZChqYXZhLmxhbmcuSW50ZWdlci50b0hleFN0cmluZyh1aU1vZGUpKTsKICAgICAgICAgaWYgKHNlcSAhPSAwKSB7CiAgIC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WJlcihpbnQgbikgewotICAgICAgICByZXR1cm4gUGx1cmFsUnVsZXMuYXR0ckZvclF1YW50aXR5KHF1YW50aXR5Rm9yTnVtYmVyKG4pKTsKLSAgICB9Ci0KLSAgICBzdGF0aWMgZmluYWwgaW50IGF0dHJGb3JRdWFudGl0eShpbnQgcXVhbnRpdHkpIHsKLSAgICAgICAgLy8gc2VlIGluY2x1ZGUvdXRpbHMvUmVzb3VyY2VUeXBlcy5oCi0gICAgICAgIHN3aXRjaCAocXVhbnRpdHkpIHsKLSAgICAgICAgICAgIGNhc2UgUVVBTlRJVFlfWkVSTzogcmV0dXJuIDB4MDEwMDAwMDU7Ci0gICAgICAgICAgICBjYXNlIFFVQU5USVRZX09ORTogIHJldHVybiAweDAxMDAwMDA2OwotICAgICAgICAgICAgY2FzZSBRVUFOVElUWV9UV086ICByZXR1cm4gMHgwMTAwMDAwNzsKLSAgICAgICAgICAgIGNhc2UgUVVBTlRJVFlfRkVXOiAgcmV0dXJuIDB4MDEwMDAwMDg7Ci0gICAgICAgICAgICBjYXNlIFFVQU5USVRZX01BTlk6IHJldHVybiAweDAxMDAwMDA5OwotICAgICAgICAgICAgZGVmYXVsdDogICAgICAgICAgICByZXR1cm4gSURfT1RIRVI7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBzdGF0aWMgZmluYWwgU3RyaW5nIHN0cmluZ0ZvclF1YW50aXR5KGludCBxdWFudGl0eSkgewotICAgICAgICBzd2l0Y2ggKHF1YW50aXR5KSB7Ci0gICAgICAgICAgICBjYXNlIFFVQU5USVRZX1pFUk86Ci0gICAgICAgICAgICAgICAgcmV0dXJuICJ6ZXJvIjsKLSAgICAgICAgICAgIGNhc2UgUVVBTlRJVFlfT05FOgotICAgICAgICAgICAgICAgIHJldHVybiAib25lIjsKLSAgICAgICAgICAgIGNhc2UgUVVBTlRJVFlfVFdPOgotICAgICAgICAgICAgICAgIHJldHVybiAidHdvIjsKLSAgICAgICAgICAgIGNhc2UgUVVBTlRJVFlfRkVXOgotICAgICAgICAgICAgICAgIHJldHVybiAiZmV3IjsKLSAgICAgICAgICAgIGNhc2UgUVVBTlRJVFlfTUFOWToKLSAgICAgICAgICAgICAgICByZXR1cm4gIm1hbnkiOwotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICByZXR1cm4gIm90aGVyIjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHN0YXRpYyBmaW5hbCBQbHVyYWxSdWxlcyBydWxlRm9yTG9jYWxlKExvY2FsZSBsb2NhbGUpIHsKLSAgICAgICAgU3RyaW5nIGxhbmcgPSBsb2NhbGUuZ2V0TGFuZ3VhZ2UoKTsKLSAgICAgICAgaWYgKCJjcyIuZXF1YWxzKGxhbmcpKSB7Ci0gICAgICAgICAgICBpZiAoY3MgPT0gbnVsbCkgY3MgPSBuZXcgY3MoKTsKLSAgICAgICAgICAgIHJldHVybiBjczsKLSAgICAgICAgfQotICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgIGlmIChlbiA9PSBudWxsKSBlbiA9IG5ldyBlbigpOwotICAgICAgICAgICAgcmV0dXJuIGVuOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBzdGF0aWMgUGx1cmFsUnVsZXMgY3M7Ci0gICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgY3MgZXh0ZW5kcyBQbHVyYWxSdWxlcyB7Ci0gICAgICAgIGludCBxdWFudGl0eUZvck51bWJlcihpbnQgbikgewotICAgICAgICAgICAgaWYgKG4gPT0gMSkgewotICAgICAgICAgICAgICAgIHJldHVybiBRVUFOVElUWV9PTkU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChuID49IDIgJiYgbiA8PSA0KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIFFVQU5USVRZX0ZFVzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiBRVUFOVElUWV9PVEhF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MDU7CisgICAgICAgICAgICBjYXNlIE5hdGl2ZVBsdXJhbFJ1bGVzLk9ORTogIHJldHVybiAweDAxMDAwMDA2OworICAgICAgICAgICAgY2FzZSBOYXRpdmVQbHVyYWxSdWxlcy5UV086ICByZXR1cm4gMHgwMTAwMDAwNzsKKyAgICAgICAgICAgIGNhc2UgTmF0aXZlUGx1cmFsUnVsZXMuRkVXOiAgcmV0dXJuIDB4MDEwMDAwMDg7CisgICAgICAgICAgICBjYXNlIE5hdGl2ZVBsdXJhbFJ1bGVzLk1BTlk6IHJldHVybiAweDAxMDAwMDA5OworICAgICAgICAgICAgZGVmYXVsdDogICAgICAgICAgICAgICAgICAgICByZXR1cm4gSURfT1RIRVI7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgc3RyaW5nRm9yUXVhbnRpdHlDb2RlKGludCBxdWFudGl0eUNvZGUpIHsKKyAgICAgICAgc3dpdGNoIChxdWFudGl0eUNvZGUpIHsKKyAgICAgICAgICAgIGNhc2UgTmF0aXZlUGx1cmFsUnVsZXMuWkVSTzogcmV0dXJuICJ6ZXJvIjsKKyAgICAgICAgICAgIGNhc2UgTmF0aXZlUGx1cmFsUnVsZXMuT05FOiAgcmV0dXJuICJvbmUiOworICAgICAgICAgICAgY2FzZSBOYXRpdmVQbHVyYWxSdWxlcy5UV086ICByZXR1cm4gInR3byI7CisgICAgICAgICAgICBjYXNlIE5hdGl2ZVBsdXJhbFJ1bGVzLkZFVzogIHJldHVybiAiZmV3IjsKKyAgICAgICAgICAgIGNhc2UgTmF0aXZlUGx1cmFsUnVsZXMuTUFOWTogcmV0dXJuICJtYW55IjsKKyAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJvdGhlciI7CisgICAgICAgIH0KKyAgICB9CisKICAgICAvKioKICAgICAgKiBSZXR1cm4gdGhlIHN0cmluZyB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggYSB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gLyoKKyAgICAgICAgICAgICAqIFByZXRlbmQgdGhlIHJlcXVlc3RlZCBkZW5zaXR5IGlzIGFjdHVhbGx5IHRoZSBkaXNwbGF5IGRlbnNpdHkuIElmCisgICAgICAgICAgICAgKiB0aGUgZHJhd2FibGUgcmV0dXJuZWQgaXMgbm90IHRoZSByZXF1ZXN0ZWQgZGVuc2l0eSwgdGhlbiBmb3JjZSBpdAorICAgICAgICAgICAgICogdG8gYmUgc2NhbGVkIGxhdGVyIGJ5IGRpdmlkaW5nIGl0cyBkZW5zaXR5IGJ5IHRoZSByYXRpbyBvZgorICAgICAgICAgICAgICogcmVxdWVzdGVkIGRlbnNpdHkgdG8gYWN0dWFsIGRldmljZSBkZW5zaXR5LiBEcmF3YWJsZXMgdGhhdCBoYXZlCisgICAgICAgICAgICAgKiB1bmRlZmluZWQgZGVuc2l0eSBvciBubyBkZW5zaXR5IGRvbid0IG5lZWQgdG8gYmUgaGFuZGxlZCBoZXJlLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAodmFsdWUuZGVuc2l0eSA+IDAgJiYgdmFsdWUuZGVuc2l0eSAhPSBUeXBlZFZhbHVlLkRFTlNJVFlfTk9ORSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZS5kZW5zaXR5ID09IGRlbnNpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWUuZGVuc2l0eSA9IERpc3BsYXlNZXRyaWNzLkRFTlNJVFlfREVWSUNFOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHZhbHVlLmRlbnNpdHkgPSAodmFsdWUuZGVuc2l0eSAqIERpc3BsYXlNZXRyaWNzLkRFTlNJVFlfREVWSUNFKSAvIGRlbnNpdHk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gbG9hZERyYXdhYmxlKHZhbHVlLCBpZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKio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QGRlcHJlY2F0ZWQKLSAgICAgKi8KLSAgICBwdWJsaWMgYm9vbGVhbiB1cGRhdGVEb3VibGUoaW50IGNvbHVtbkluZGV4LCBkb3VibGUgdmFsdWUpIHsKLSAgICAgICAgcmV0dXJuIHVwZGF0ZShjb2x1bW5JbmRleCwgRG91YmxlLnZhbHVlT2YodmFsdWUpKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gdXBkYXRlVG9OdWxsKGludCBjb2x1bW5JbmRleCkgewotICAgICAgICByZXR1cm4gdXBkYXRlKGNvbHVtbkluZGV4LCBudWxsKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gdXBkYXRlKGludCBjb2x1bW5JbmRleCwgT2JqZWN0IG9iaikgewotICAgICAgICBpZiAoIXN1cHBvcnRzVXBkYXRlcygpKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBMb25nLnZhbHVlT2YoKSByZXR1cm5zIG51bGwgc29tZXRpbWVzIQotLy8gICAgICAgIExvbmcgcm93aWQgPSBMb25nLnZhbHVlT2YoZ2V0TG9uZyhtUm93SWRDb2x1bW5JbmRleCkpOwotICAgICAgICBMb25nIHJvd2lkID0gbmV3IExvbmcoZ2V0TG9uZyhtUm93SWRDb2x1bW5JbmRleCkpOwotICAgICAgICBpZiAocm93aWQgPT0gbnVsbCkgewotICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigibnVsbCByb3dpZC4gbVJvd0lkQ29sdW1uSW5kZXggPSAiICsgbVJvd0lkQ29sdW1uSW5kZXgpOwotICAgICAgICB9Ci0KLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgTWFwPFN0cmluZywgT2JqZWN0PiByb3cgPSBtVXBkYXRlZFJvd3MuZ2V0KHJvd2lkKTsKLSAgICAgICAgICAgIGlmIChyb3cgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHJvdyA9IG5ldyBIYXNoTWFwPFN0cmluZywgT2JqZWN0PigpOwotICAgICAgICAgICAgICAgIG1VcGRhdGVkUm93cy5wdXQocm93aWQsIHJvdyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByb3cucHV0KGdldENvbHVtbk5hbWVzKClbY29sdW1uSW5kZXhdLCBvYmopOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogUmV0dXJucyA8Y29kZT50cnVlPC9jb2RlPiBpZiB0aGVyZSBhcmUgcGVuZGluZyB1cGRhdGVzIHRoYXQgaGF2ZSBub3QgeWV0IGJlZW4gY29tbWl0dGVkLgotICAgICAqIAotICAgICAqIEByZXR1cm4gPGNvZGU+dHJ1ZTwvY29kZT4gaWYgdGhlcmUgYXJlIHBlbmRpbmcgdXBkYXRlcyB0aGF0IGhhdmUgbm90IHlldCBiZWVuIGNvbW1pdHRlZC4KLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gaGFzVXBkYXRlcygpIHsKLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgcmV0dXJuIG1VcGRhdGVkUm93cy5zaXplKCkgPiAwOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogQGhpZGUKLSAgICAgKiBAZGVwcmVjYXRlZAotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIGFib3J0VXBkYXRlcygpIHsKLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgbVVwZGF0ZWRSb3dzLmNsZWFyKCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gY29tbWl0VXBkYXRlcygpIHsKLSAgICAgICAgcmV0dXJuIGNvbW1pdFVwZGF0ZXMobnVsbCk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogQGhpZGUKLSAgICAgKiBAZGVwcmVjYXRlZAotICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIHN1cHBvcnRzVXBkYXRlcygpIHsKLSAgICAgICAgcmV0dXJuIG1Sb3dJZENvbHVtbkluZGV4ICE9IC0xOwotICAgIH0KLQogICAgIHB1YmxpYyB2b2lkIHJlZ2lzdGVyQ29udGVudE9ic2VydmVyKENvbnRlbnRPYnNlcnZlciBvYnNlcnZlcikgewogICAgICAgICBtQ29udGVudE9ic2VydmFibGUucmVnaXN0ZXJPYnNlcnZlcihvYnNlcnZlcik7CiAgICAgfQpAQCAtNDc4LDkgKzMzMCw5IEBACiAgICAgICAgIHJldHVybiBtRGF0YVNldE9ic2VydmFibGU7CiAgICAgICAgIAogICAgIH0KKwogICAgIHB1YmxpYyB2b2lkIHJlZ2lzdGVyRGF0YVNldE9ic2VydmVyKERhdGFTZXRPYnNlcnZlciBvYnNlcnZlcikgewogICAgICAgICBtRGF0YVNldE9ic2VydmFibGUucmVnaXN0ZXJPYnNlcnZlcihvYnNlcnZlcik7Ci0gICAgICAgIAogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIHVucmVnaXN0ZXJEYXRhU2V0T2JzZXJ2ZXIoRGF0YVNldE9ic2VydmVyIG9ic2VydmVyKSB7CkBAIC01MjIsNiArMzc0LDEwIEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwdWJsaWMgVXJpIGdldE5vdGlmaWNhdGlvblVyaSgpIHsKKyAgICAgICAgcmV0dXJuIG1Ob3RpZnlVcmk7CisgICAgf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BDaGFyQXJyYXlCdWZmZXIgYnVmZmVyKSB7CiAgICAgICAgIGNoZWNrUG9zaXRpb24oKTsKLSAgICAgICAgCi0gICAgICAgIHN5bmNocm9uaXplZChtVXBkYXRlZFJvd3MpIHsKLSAgICAgICAgICAgIGlmIChpc0ZpZWxkVXBkYXRlZChjb2x1bW5JbmRleCkpIHsKLSAgICAgICAgICAgICAgICBzdXBlci5jb3B5U3RyaW5nVG9CdWZmZXIoY29sdW1uSW5kZXgsIGJ1ZmZlcik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgCiAgICAgICAgIG1XaW5kb3cuY29weVN0cmluZ1RvQnVmZmVyKG1Qb3MsIGNvbHVtbkluZGV4LCBidWZmZXIpOwogICAgIH0KIAogICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBzaG9ydCBnZXRTaG9ydChpbnQgY29sdW1uSW5kZXgpCi0gICAgeworICAgIHB1YmxpYyBzaG9ydCBnZXRTaG9ydChpbnQgY29sdW1uSW5kZXgpIHsKICAgICAgICAgY2hlY2tQb3NpdGlvbigpOwotCi0gICAgICAgIHN5bmNocm9uaXplZChtVXBkYXRlZFJvd3MpIHsKLSAgICAgICAgICAgIGlmIChpc0ZpZWxkVXBkYXRlZChjb2x1bW5JbmRleCkpIHsKLSAgICAgICAgICAgICAgICBOdW1iZXIgdmFsdWUgPSAoTnVtYmVyKWdldFVwZGF0ZWRGaWVsZChjb2x1bW5JbmRleCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlLnNob3J0VmFsdWUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCiAgICAgICAgIHJldHVybiBtV2luZG93LmdldFNob3J0KG1Qb3MsIGNvbHVtbkluZGV4KTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgaW50IGdldEludChpbnQgY29sdW1uSW5kZXgpCi0gICAgeworICAgIHB1YmxpYyBpbnQgZ2V0SW50KGludCBjb2x1bW5JbmRleCkgewogICAgICAgICBjaGVja1Bvc2l0aW9uKCk7Ci0KLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgaWYgKGlzRmllbGRVcGRhdGVkKGNvbHVtbkluZGV4KSkgewotICAgICAgICAgICAgICAgIE51bWJlciB2YWx1ZSA9IChOdW1iZXIpZ2V0VXBkYXRlZEZpZWxkKGNvbHVtbkluZGV4KTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUuaW50VmFsdWUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCiAgICAgICAgIHJldHVybiBtV2luZG93LmdldEludChtUG9zLCBjb2x1bW5JbmRleCk7CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGxvbmcgZ2V0TG9uZyhpbnQgY29sdW1uSW5kZXgpCi0gICAgeworICAgIHB1YmxpYyBsb25nIGdldExvbmcoaW50IGNvbHVtbkluZGV4KSB7CiAgICAgICAgIGNoZWNrUG9zaXRpb24oKTsKLQotICAgICAgICBzeW5jaHJvbml6ZWQobVVwZGF0ZWRSb3dzKSB7Ci0gICAgICAgICAgICBpZiAoaXNGaWVsZFVwZGF0ZWQoY29sdW1uSW5kZXgpKSB7Ci0gICAgICAgICAgICAgICAgTnVtYmVyIHZhbHVlID0gKE51bWJlcilnZXRVcGRhdGVkRmllbGQoY29sdW1uSW5kZXgpOwotICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZS5sb25nVmFsdWUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCiAgICAgICAgIHJldHVybiBtV2luZG93LmdldExvbmcobVBvcywgY29sdW1uSW5kZXgpOwogICAgIH0KIAogICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBmbG9hdCBnZXRGbG9hdChpbnQgY29sdW1uSW5kZXgpCi0gICAgeworICAgIHB1YmxpYyBmbG9hdCBnZXRGbG9hdChpbnQgY29sdW1uSW5kZXgpIHsKICAgICAgICAgY2hlY2tQb3NpdGlvbigpOwotCi0gICAgICAgIHN5bmNocm9uaXplZChtVXBkYXRlZFJvd3MpIHsKLSAgICAgICAgICAgIGlmIChpc0ZpZWxkVXBkYXRlZChjb2x1bW5JbmRleCkpIHsKLSAgICAgICAgICAgICAgICBOdW1iZXIgdmFsdWUgPSAoTnVtYmVyKWdldFVwZGF0ZWRGaWVsZChjb2x1bW5JbmRleCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlLmZsb2F0VmFsdWUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCiAgICAgICAgIHJldHVybiBtV2luZG93LmdldEZsb2F0KG1Qb3MsIGNvbHVtbkluZGV4KTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgZG91YmxlIGdldERvdWJsZShpbnQgY29sdW1uSW5kZXgpCi0gICAgeworICAgIHB1YmxpYyBkb3VibGUgZ2V0RG91YmxlKGludCBjb2x1bW5JbmRleCkgewogICAgICAgICBjaGVja1Bvc2l0aW9uKCk7Ci0KLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgaWYgKGlzRmllbGRVcGRhdGVkKGNvbHVtbkluZGV4KSkgewotICAgICAgICAgICAgICAgIE51bWJlciB2YWx1ZSA9IChOdW1iZXIpZ2V0VXBkYXRlZEZpZWxkKGNvbHVtbkluZGV4KTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUuZG91YmxlVmFsdWUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCiAgICAgICAgIHJldHVybiBtV2luZG93LmdldERvdWJsZShtUG9zLCBjb2x1bW5JbmRleCk7CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGJvb2xlYW4gaXNOdWxsKGludCBjb2x1bW5JbmRleCkKLSAgICB7CisgICAgcHVibGljIGJvb2xlYW4gaXNOdWxsKGludCBjb2x1bW5JbmRleCkgewogICAgICAgICBjaGVja1Bvc2l0aW9uKCk7Ci0KLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgaWYgKGlzRmllbGRVcGRhdGVkKGNvbHVtbkluZGV4KSkgewotICAgICAgICAgICAgICAgIHJldHVybiBnZXRVcGRhdGVkRmllbGQoY29sdW1uSW5kZXgpID09IG51bGw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gbVdpbmRvdy5pc051bGwobVBvcywgY29sdW1uSW5kZXgpOworICAgICAgICByZXR1cm4gbVdpbmRvdy5nZXRUeXBlKG1Qb3MsIGNvbHVtbkluZGV4KSA9PSBDdXJzb3IuRklFTERfVFlQRV9OVUxMOwogICAgIH0KIAotICAgIHB1YmxpYyBib29sZWFuIGlzQmxvYihpbnQgY29sdW1uSW5kZXgpCi0gICAgewotICAgICAgICBjaGVja1Bvc2l0aW9uKCk7Ci0KLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgaWYgKGlzRmllbGRVcGRhdGVkKGNvbHVtbkluZGV4KSkgewotICAgICAgICAgICAgICAgIE9iamVjdCBvYmplY3QgPSBnZXRVcGRhdGVkRmllbGQoY29sdW1uSW5kZXgpOwotICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3QgPT0gbnVsbCB8fCBvYmplY3QgaW5zdGFuY2VvZiBieXRlW107Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gbVdpbmRvdy5pc0Jsb2IobVBvcywgY29sdW1uSW5kZXgpOworICAgIC8qKgorICAgICAqIEBkZXByZWNhdGVkIFVzZSB7QGxpbmsgI2dldFR5cGV9CisgICAgICovCisgICAgQERlcHJlY2F0ZWQKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0Jsb2IoaW50IGNvbHVtbkluZGV4KSB7CisgICAgICAgIHJldHVybiBnZXRUeXBlKGNvbHVtbkluZ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VzID0gZGF0YS5yZWFkSGFzaE1hcChudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiByZXN1bHQgPSB1cGRhdGVSb3dzKHZhbHVlcyk7Ci0gICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlTm9FeGNlcHRpb24oKTsKLSAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVJbnQoKHJlc3VsdCA9PSB0cnVlID8gMSA6IDApKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgY2FzZSBERUxFVEVfUk9XX1RSQU5TQUNUSU9OOiB7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQnVsa0N1cnNvci5kZXNjcmlwdG9yKTsKLSAgICAgICAgICAgICAgICAgICAgaW50IHBvc2l0aW9uID0gZGF0YS5yZWFkSW50KCk7Ci0gICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gcmVzdWx0ID0gZGVsZXRlUm93KHBvc2l0aW9uKTsKLSAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVOb0V4Y2VwdGlvbigpOwotICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZUludCgocmVzdWx0ID09IHRydWUgPyAxIDogMCkpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0KICAgICAgICAgICAgICAgICBjYXNlIE9OX01PVkVfVFJBTlNBQ1RJT046IHsKICAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElCdWxrQ3Vyc29yLmRlc2NyaXB0b3IpOwogICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24gPSBkYXRhLnJlYWRJbnQoKTsKQEAgLTM0Myw0OCArMzIwLDYgQEAKICAgICAgICAgcmV0dXJuIGNvdW50OwogICAgIH0KIAotICAgIHB1Ym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cnQgYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb247CiBpbXBvcnQgYW5kcm9pZC51dGlsLkxvZzsKIAotaW1wb3J0IGphdmEudXRpbC5NYXA7Ci0KIC8qKgogICogQWRhcHRzIGFuIHtAbGluayBJQnVsa0N1cnNvcn0gdG8gYSB7QGxpbmsgQ3Vyc29yfSBmb3IgdXNlIGluIHRoZSBsb2NhbAogICogcHJvY2Vzcy4KQEAgLTE3NCwzOCArMTcyLDYgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIC8qKgotICAgICAqIEBoaWRlCi0gICAgICogQGRlcHJlY2F0ZWQKLSAgICAgKi8KLSAgICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgYm9vbGVhbiBkZWxldGVSb3coKSB7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBib29sZWFuIHJlc3VsdCA9IG1CdWxrQ3Vyc29yLmRlbGV0ZVJvdyhtUG9zKTsKLSAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gZmFsc2UpIHsKLSAgICAgICAgICAgICAgICAvLyBUaGUgd2luZG93IGNvbnRhaW5zIHRoZSBvbGQgdmFsdWUsIGRpc2NhcmQgaXQKLSAgICAgICAgICAgICAgICBtV2luZG93ID0gbnVsbDsKLSAgICAKLSAgICAgICAgICAgICAgICAvLyBGaXggdXAgdGhlIHBvc2l0aW9uCi0gICAgICAgICAgICAgICAgbUNvdW50ID0gbUJ1bGtDdXJzb3IuY291bnQoKTsKLSAgICAgICAgICAgICAgICBpZiAobVBvcyA8IG1Db3VudCkgewotICAgICAgICAgICAgICAgICAgICBpbnQgb2xkUG9zID0gbVBvczsKLSAgICAgICAgICAgICAgICAgICAgbVBvcyA9IC0xOwotICAgICAgICAgICAgICAgICAgICBtb3ZlVG9Qb3NpdGlvbihvbGRQb3MpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb3MgPSBtQ291bnQ7Ci0gICAgICAgICAg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m93cykgewotICAgICAgICAgICAgaWYgKGFkZGl0aW9uYWxWYWx1ZXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1VcGRhdGVkUm93cy5wdXRBbGwoYWRkaXRpb25hbFZhbHVlcyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtVXBkYXRlZFJvd3Muc2l6ZSgpIDw9IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiByZXN1bHQgPSBtQnVsa0N1cnNvci51cGRhdGVSb3dzKG1VcGRhdGVkUm93cyk7Ci0gICAgCi0gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PSB0cnVlKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1VcGRhdGVkUm93cy5jbGVhcigpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIFNlbmQgdGhlIGNoYW5nZSBub3RpZmljYXRpb24KLSAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2UodHJ1ZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7Ci0gICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJVbmFibGUgdG8gY29tbWl0IHVwZGF0ZXMgYmVjYXVzZSB0aGUgcmVtb3RlIHByb2Nlc3MgaXMgZGVhZCIpOwotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBCdW5kbGUgZ2V0RXh0cmFzKCkgewogICAgICAgICB0cnkgewpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvZGF0YWJhc2UvQ3Vyc29yLmphdmE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hbWUgPSBwcm92aWRlck5hbWU7Ci0gICAgICAgIG1SZWFkT25seSA9ICFhbGxvd1dyaXRlOwogCiAgICAgICAgIGNyZWF0ZUFuZFJlZ2lzdGVyT2JzZXJ2ZXJQcm94eShvYnNlcnZlcik7CiAgICAgfQpAQCAtMTk3LDMxICsxOTEsNiBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgcHVibGljIGJvb2xlYW4gdXBkYXRlUm93cyhNYXA8PyBleHRlbmRzIExvbmcsID8gZXh0ZW5kcyBNYXA8U3RyaW5nLCBPYmplY3Q+PiB2YWx1ZXMpIHsKLSAgICAgICAgaWYgKG1SZWFkT25seSkgewotICAgICAgICAgICAgTG9nLncoIkNvbnRlbnRQcm92aWRlciIsICJQZXJtaXNzaW9uIERlbmlhbDogbW9kaWZ5aW5nICIKLSAgICAgICAgICAgICAgICAgICAgKyBtUHJvdmlkZXJOYW1lCi0gICAgICAgICAgICAgICAgICAgICsgIiBmcm9tIHBpZD0iICsgQmluZGVyLmdldENhbGxpbmdQaWQoKQotICAgICAgICAgICAgICAgICAgICArICIsIHVpZD0iICsgQmluZGVyLmdldENhbGxpbmdVaWQoKSk7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIG1DdXJzb3IuY29tbWl0VXBkYXRlcyh2YWx1ZXMpOwotICAgIH0KLQotICAgIHB1YmxpYyBib29sZWFuIGRlbGV0ZVJvdyhpbnQgcG9zaXRpb24pIHsKLSAgICAgICAgaWYgKG1SZWFkT25seSkgewotICAgICAgICAgICAgTG9nLncoIkNvbnRlbnRQcm92aWRlciIsICJQZXJtaXNzaW9uIERlbmlhbDogbW9kaWZ5aW5nICIKLSAgICAgICAgICAgICAgICAgICAgKyBtUHJvdmlkZXJOYW1lCi0gICAgICAgICAgICAgICAgICAgICsgIiBmcm9tIHBpZD0iICsgQmluZGVyLmdldENhbGxpbmdQaWQoKQotICAgICAgICAgICAgICAgICAgICArICIsIH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AgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBib29sZWFuIGlzTnVsbChpbnQgcm93LCBpbnQgY29sKSB7Ci0gICAgICAgIGFjcXVpcmVSZWZlcmVuY2UoKTsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBpc051bGxfbmF0aXZlKHJvdyAtIG1TdGFydFBvcywgY29sKTsKLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIHJlbGVhc2VSZWZlcmVuY2UoKTsKLSAgICAgICAgfQorICAgICAgICByZXR1cm4gZ2V0VHlwZShyb3csIGNvbCkgPT0gQ3Vyc29yLkZJRUxEX1RZUEVfTlVMTDsKICAgICB9CiAgICAgCi0gICAgcHJpdmF0ZSBuYXRpdmUgYm9vbGVhbiBpc051bGxfbmF0aXZlKGludCByb3csIGludCBjb2wpOwotICAgIAogICAgIC8qKgogICAgICAqIFJldHVybnMgYSBieXRlIGFycmF5IGZvciB0aGUgZ2l2ZW4gZmllbGQuCiAgICAgICoKQEAgLTI1NywxOSArMjUyLDQzIEBACiAgICAgcHJpdmF0ZSBuYXRpdmUgYnl0ZVtdIGdldEJsb2JfbmF0aXZlKGludCByb3csIGludCBjb2wpOwogCiAgICAgLyoqCisgICAgICogUmV0dXJucyBkYXRhIHR5cGUgb2YgdGhlIGdpdmVuIGNvbHVtbidzIHZhbHVlLgorICAgICAqPHA+CisgICAgICogUmV0dXJuZWQgY29sdW1uIHR5cGVzIGFyZQorICAgICAqIDx1bD4KKyAgICAgKiAgIDxsaT57QGxpbmsgQ3Vyc29yI0ZJRUxEX1RZUEVfTlVMTH08L2xpPgorICAgICAqICAgPGxpPntAbGluayBDdXJzb3IjRklFTERfVFlQRV9JTlRFR0VSfTwvbGk+CisgICAgICogICA8bGk+e0BsaW5rIEN1cnNvciNGSUVMRF9UWVBFX0ZMT0FUfTwvbGk+CisgICAgICogICA8bGk+e0BsaW5rIEN1cnNvciNGSUVMRF9UWVBFX1NUUklOR308L2xpPgorICAgICAqICAgPGxpPntAbGluayBDdXJzb3IjRklFTERfVFlQRV9CTE9CfTwvbGk+CisgICAgICo8L3VsPgorICAgICAqPC9wPgorICAgICAqCisgICAgICogQHBhcmFtIHJvdyB0aGUgcm93IHRvIHJlYWQgZnJvbSwgcm93IC0gZ2V0U3RhcnRQb3NpdGlvbigpIGJlaW5nIHRoZSBhY3R1YWwgcm93IGluIHRoZSB3aW5kb3cKKyAgICAgKiBAcGFyYW0gY29sIHRoZSBjb2x1bW4gdG8gcmVhZCBmcm9tCisgICAgICogQHJldHVybiB0aGUgdmFsdWUgdHlwZQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0VHlwZShpbnQgcm93LCBpbnQgY29sKSB7CisgICAgICAgIGFjcXVpcmVSZWZlcmVuY2UoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBnZXRUeXBlX25hdGl2ZShyb3cgLSBtU3RhcnRQb3MsIGNvbCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICByZWxlYXNlUmVmZXJlbmNlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKICAgICAgKiBDaGVja3MgaWYgYSBmaWVsZCBjb250YWlucyBlaXRoZXIgYSBibG9iIG9yIGlzIG51bGwuCiAgICAgICoKICAgICAgKiBAcGFyYW0gcm93IHRoZSByb3cgdG8gcmVhZCBmcm9tLCByb3cgLSBnZXRTdGFydFBvc2l0aW9uKCkgYmVpbmcgdGhlIGFjdHVhbCByb3cgaW4gdGhlIHdpbmRvdwogICAgICAqIEBwYXJhbSBjb2wgdGhlIGNvbHVtbiB0byByZWFkIGZyb20KICAgICAgKiBAcmV0dXJuIHtAY29kZSB0cnVlfSBpZiBnaXZlbiBmaWVsZCBpcyB7QGNvZGUgTlVMTH0gb3IgYSBibG9iCisgICAgICogQGRlcHJlY2F0ZWQgdXNlIHtAbGluayAjZ2V0VHlwZShpbnQsIGludCl9IGluc3RlYWQKICAgICAgKi8KKy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YWN0dWFsIHJvdyBpbiB0aGUgd2luZG93CiAgICAgICogQHBhcmFtIGNvbCB0aGUgY29sdW1uIHRvIHJlYWQgZnJvbQogICAgICAqIEByZXR1cm4ge0Bjb2RlIHRydWV9IGlmIGdpdmVuIGZpZWxkIGlzIHtAY29kZSBOVUxMfSBvciBhIFN0cmluZworICAgICAqIEBkZXByZWNhdGVkIHVzZSB7QGxpbmsgI2dldFR5cGUoaW50LCBpbnQpfSBpbnN0ZWFkCiAgICAgICovCisgICAgQERlcHJlY2F0ZWQKICAgICBwdWJsaWMgYm9vbGVhbiBpc1N0cmluZyhpbnQgcm93LCBpbnQgY29sKSB7Ci0gICAgICAgIGFjcXVpcmVSZWZlcmVuY2UoKTsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBpc1N0cmluZ19uYXRpdmUocm93IC0gbVN0YXJ0UG9zLCBjb2wpOwotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgcmVsZWFzZVJlZmVyZW5jZSgpOwotICAgICAgICB9CisgICAgICAgIGludCB0eXBlID0gZ2V0VHlwZShyb3csIGNvbCk7CisgICAgICAgIHJldHVybiB0eXBlID09IEN1cnNvci5GSUVMRF9UWVBFX1NUUklORyB8fCB0eXBlID09IEN1cnNvci5GSUVMRF9UWVBFX05VTEw7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBuYXRpdmUgYm9vbGVhbiBpc0Jsb2JfbmF0aXZlKGludCByb3csIGludCBjb2wpOwotICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gaXNTdHJpbmdfbmF0aXZlKGludCByb3csIGludCBjb2wpOwotICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gaXNJbnRlZ2VyX25hdGl2ZShpbnQgcm93LCBpbnQgY29sKTsKLSAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIGlzRmxvYXRfbmF0aXZlKGludCByb3csIGludCBjb2wpOworICAgIHByaXZhdGUgbmF0aXZlIGludCBnZ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XRVcGRhdGVzKHZhbHVlcyk7Ci0gICAgfQotCiAgICAgcHVibGljIGludCBnZXRDb3VudCgpIHsKICAgICAgICAgcmV0dXJuIG1DdXJzb3IuZ2V0Q291bnQoKTsKICAgICB9CkBAIC03NCwxNCArNTUsNiBAQAogICAgICAgICBtQ3Vyc29yLmRlYWN0aXZhdGUoKTsKICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gZGVsZXRlUm93KCkgewotICAgICAgICByZXR1cm4gbUN1cnNvci5kZWxldGVSb3coKTsKLSAgICB9Ci0KICAgICBwdWJsaWMgYm9vbGVhbiBtb3ZlVG9GaXJzdCgpIHsKICAgICAgICAgcmV0dXJuIG1DdXJzb3IubW92ZVRvRmlyc3QoKTsKICAgICB9CkBAIC0xNDcsMTQgKzEyMCw2IEBACiAgICAgICAgIHJldHVybiBtQ3Vyc29yLmdldFdhbnRzQWxsT25Nb3ZlQ2FsbHMoKTsKICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gaGFzVXBkYXRlcygpIHsKLSAgICAgICAgcmV0dXJuIG1DdXJzb3IuaGFzVXBkYXRlcygpOwotICAgIH0KLQogICAgIHB1YmxpYyBib29sZWFuIGlzQWZ0ZXJMYXN0KCkgewogICAgICAgICByZXR1cm4gbUN1cnNvci5pc0FmdGVyTGFzdCgpOwogICAgIH0KQEAgLTE3MSw2ICsxMzYsMTAgQEAKICAgICAgICAgcmV0dXJuIG1DdXJzb3IuaXNMYXN0KCk7CiAgICAgfQogCisgICAgcHVibGljIGludCBnZXRUeXBlKGludCBjb2x1bW5JbmRleCkgeworICAgICAgICByZXR1cm4gbUN1cnNvci5nZXRUeXBlKGNvbHVtbkluZGV4KTsKKyAgICB9CisKICAgICBwdWJsaWMgYm9vbGVhbiB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ZXgoY29sdW1uKTsKKyAgICAgICAgaWYgKGluZGV4ICE9IC0xICYmICFjdXJzb3IuaXNOdWxsKGluZGV4KSkgewogICAgICAgICAgICAgdmFsdWVzLnB1dChjb2x1bW4sIGN1cnNvci5nZXRTdHJpbmcoaW5kZXgpKTsKICAgICAgICAgfQogICAgIH0KQEAgLTcyMCw4ICs3OTEsOCBAQAogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBjdXJzb3JMb25nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KEN1cnNvciBjdXJzb3IsIENvbnRlbnRWYWx1ZXMgdmFsdWVzLAogICAgICAgICAgICAgU3RyaW5nIGNvbHVtbikgewotICAgICAgICBmaW5hbCBpbnQgaW5kZXggPSBjdXJzb3IuZ2V0Q29sdW1uSW5kZXhPclRocm93KGNvbHVtbik7Ci0gICAgICAgIGlmICghY3Vyc29yLmlzTnVsbChpbmRleCkpIHsKKyAgICAgICAgZmluYWwgaW50IGluZGV4ID0gY3Vyc29yLmdldENvbHVtbkluZGV4KGNvbHVtbik7CisgICAgICAgIGlmIChpbmRleCAhPSAtMSAmJiAhY3Vyc29yLmlzTnVsbChpbmRleCkpIHsKICAgICAgICAgICAgIHZhbHVlcy5wdXQoY29sdW1uLCBjdXJzb3IuZ2V0TG9uZyhpbmRleCkpOwogICAgICAgICB9CiAgICAgfQpAQCAtNzM2LDggKzgwNyw4IEBACiAgICAgICovCiAgICAgcHVibGljIHN0YXRpYyB2b2lkIGN1cnNvclNob3J0VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KEN1cnNvciBjdXJzb3IsIENvbnRlbnRWYWx1ZXMgdmFsdWVzLAogICAgICAgICAgICAgU3RyaW5nIGNvbHVtbikgewotICAgICAgICBmaW5hbCBpbnQgaW5kZXggPSBjdXJzb3IuZ2V0Q29sdW1uSW5kZXhPclRocm93KGNvbHVtbik7Ci0gICAgICAgIGlmICghY3Vyc29yLmlzTnVsbChpbmRleCkpIHsKKyAgICAgICAg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AgICAgICBpZiAoIWN1cnNvci5pc051bGwoaW5kZXgpKSB7CisgICAgICAgIGZpbmFsIGludCBpbmRleCA9IGN1cnNvci5nZXRDb2x1bW5JbmRleChjb2x1bW4pOworICAgICAgICBpZiAoaW5kZXggIT0gLTEgJiYgIWN1cnNvci5pc051bGwoaW5kZXgpKSB7CiAgICAgICAgICAgICB2YWx1ZXMucHV0KGNvbHVtbiwgY3Vyc29yLmdldEZsb2F0KGluZGV4KSk7CiAgICAgICAgIH0KICAgICB9CkBAIC03ODQsOCArODU1LDggQEAKICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIHZvaWQgY3Vyc29yRG91YmxlVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KEN1cnNvciBjdXJzb3IsIENvbnRlbnRWYWx1ZXMgdmFsdWVzLAogICAgICAgICAgICAgU3RyaW5nIGNvbHVtbikgewotICAgICAgICBmaW5hbCBpbnQgaW5kZXggPSBjdXJzb3IuZ2V0Q29sdW1uSW5kZXhPclRocm93KGNvbHVtbik7Ci0gICAgICAgIGlmICghY3Vyc29yLmlzTnVsbChpbmRleCkpIHsKKyAgICAgICAgZmluYWwgaW50IGluZGV4ID0gY3Vyc29yLmdldENvbHVtbkluZGV4KGNvbHVtbik7CisgICAgICAgIGlmIChpbmRleCAhPSAtMSAmJiAhY3Vyc29yLmlzTnVsbChpbmRleCkpIHsKICAgICAgICAgICAgIHZhbHVlcy5wdXQoY29sdW1uLCBjdXJzb3IuZ2V0RG91YmxlKGluZGV4KSk7CiAgICAgICAgIH0KICAgICB9CkBAIC0xMTUyLDQgKzEyMjMsNjYgQEAKICAgICAgICAgZGIuc2V0VmVyc2lvbihkYlZlcnNpb24pOwogICAgICAgICBkYi5jbG9zZSgpOwogICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgb25lIG9mIHRoZSBmb2xsb3dpbmcgd2hpY2ggcmVwcmVzZW50IHRoZSB0eXBlIG9mIHRoZSBnaXZlbiBTUUwgc3RhdGVtZW50L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maXhTcWwuZXF1YWxzKCJVUEQiKSB8fAorICAgICAgICAgICAgICAgIHByZWZpeFNxbC5lcXVhbHMoIlJFUCIpIHx8CisgICAgICAgICAgICAgICAgcHJlZml4U3FsLmVxdWFscygiREVMIikpIHsKKyAgICAgICAgICAgIHJldHVybiBTVEFURU1FTlRfVVBEQVRFOworICAgICAgICB9IGVsc2UgaWYgKHByZWZpeFNxbC5lcXVhbHMoIkFUVCIpKSB7CisgICAgICAgICAgICByZXR1cm4gU1RBVEVNRU5UX0FUVEFDSDsKKyAgICAgICAgfSBlbHNlIGlmIChwcmVmaXhTcWwuZXF1YWxzKCJDT00iKSkgeworICAgICAgICAgICAgcmV0dXJuIFNUQVRFTUVOVF9DT01NSVQ7CisgICAgICAgIH0gZWxzZSBpZiAocHJlZml4U3FsLmVxdWFscygiRU5EIikpIHsKKyAgICAgICAgICAgIHJldHVybiBTVEFURU1FTlRfQ09NTUlUOworICAgICAgICB9IGVsc2UgaWYgKHByZWZpeFNxbC5lcXVhbHMoIlJPTCIpKSB7CisgICAgICAgICAgICByZXR1cm4gU1RBVEVNRU5UX0FCT1JUOworICAgICAgICB9IGVsc2UgaWYgKHByZWZpeFNxbC5lcXVhbHMoIkJFRyIpKSB7CisgICAgICAgICAgICByZXR1cm4gU1RBVEVNRU5UX0JFR0lOOworICAgICAgICB9IGVsc2UgaWYgKHByZWZpeFNxbC5lcXVhbHMoIlBSQSIpKSB7CisgICAgICAgICAgICByZXR1cm4gU1RBVEVNRU5UX1BSQUdNQTsKKyAgICAgICAgfSBlbHNlIGlmIChwcmVmaXhTcWwuZXF1YWxzKCJDUkUiKSB8fCBwcmVmaXhTcWwuZXF1YWxzKCJEUk8iKSB8fAorICAgICAgICAgICAgICAgIHByZWZpeFNxbC5lcXVhbHMoIkFMVCIpKSB7CisgICAgICAgICAgICByZXR1cm4gU1RBVEVNRU5UX0RETDsKKyAgICAgICAgfSBlbHNlIGlmIChwcmVmaXhTcWwuZXF1YWxzKCJBTkEiKSB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F0aCgpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIEFycmF5TGlzdDxQYWlyPFN0cmluZywgU3RyaW5nPj4gYXR0YWNoZWREYnMgPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgLy8gQ2xvc2UgdGhlIGRhdGFiYXNlLCB3aGljaCB3aWxsIGNhdXNlIHN1YnNlcXVlbnQgb3BlcmF0aW9ucyB0byBmYWlsLgorICAgICAgICAgICAgLy8gYmVmb3JlIHRoYXQsIGdldCB0aGUgYXR0YWNoZWQgZGF0YWJhc2UgbGlzdCBmaXJzdC4KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgYXR0YWNoZWREYnMgPSBkYk9iai5nZXRBdHRhY2hlZERicygpOworICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvKiBpZ25vcmUgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZGJPYmouY2xvc2UoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgLyogaWdub3JlICovCisgICAgICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAvLyBEZWxldGUgYWxsIGZpbGVzIG9mIHRoaXMgY29ycnVwdCBkYXRhYmFzZSBhbmQvb3IgYXR0YWNoZWQgZGF0YWJhc2VzCisgICAgICAgICAgICBpZiAoYXR0YWNoZWREYnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoUGFpcjxTdHJpbmcsIFN0cmluZz4gcCA6IGF0dGFjaGVkRGJzKSB7CisgICAgICAgICAgICAgICAgICAgIGRlbGV0ZURhdGFiYXNlRmlsZShwLnNlY29uZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsK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2RhdGFiYXNlL01lcmdlQ3Vyc29yLmphdmEKQEAgLTkyLDMyICs5Miw2IEBACiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGJvb2xlYW4gZGVsZXRlUm93KCkKLSAgICB7Ci0gICAgICAgIHJldHVybiBtQ3Vyc29yLmRlbGV0ZVJvdygpOwotICAgIH0KLSAgICAKLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGJvb2xlYW4gY29tbWl0VXBkYXRlcygpIHsKLSAgICAgICAgaW50IGxlbmd0aCA9IG1DdXJzb3JzLmxlbmd0aDsKLSAgICAgICAgZm9yIChpbnQgaSA9IDAgOyBpIDwgbGVuZ3RoIDsgaSsrKSB7Ci0gICAgICAgICAgICBpZiAobUN1cnNvcnNbaV0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1DdXJzb3JzW2ldLmNvbW1pdFVwZGF0ZXMoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBvbkNoYW5nZSh0cnVlKTsKLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIFN0cmluZyBnZXRTdHJpbmcoaW50IGNvbHVtbikKICAgICB7CkBAIC0xNTUsNiArMTI5LDExIEBACiAgICAgfQogCiAgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGludCBnZXRUeXBlKGludCBjb2x1bW4pIHsKKyAgICAgICAgcmV0dXJuIG1DdXJzb3IuZ2V0VHlwZShjb2x1bW4pOworICAgIH0KKworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIGlzTnVsbChpbnQgY29sdW1uKQogICAgIHsKICAgICAgIC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gICBhc3NlcnQgc3FsICE9IG51bGw7CisgICAgICAgICAgICBkb0Fzc2VydHMoKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZ2V0RnJlZVBvb2xTaXplKCkgPT0gMCkgeworICAgICAgICAgICAgLy8gbm8gZnJlZSAoID0gYXZhaWxhYmxlKSBjb25uZWN0aW9ucworICAgICAgICAgICAgaWYgKG1NYXhQb29sU2l6ZSA9PSBwb29sU2l6ZSkgeworICAgICAgICAgICAgICAgIC8vIG1heGVkIG91dC4gY2FuJ3Qgb3BlbiBhbnkgbW9yZSBjb25uZWN0aW9ucy4KKyAgICAgICAgICAgICAgICAvLyBsZXQgdGhlIGNhbGxlciB3YWl0IG9uIG9uZSBvZiB0aGUgcG9vbGVkIGNvbm5lY3Rpb25zCisgICAgICAgICAgICAgICAgLy8gcHJlZmVyYWJseSBhIGNvbm5lY3Rpb24gY2FjaGluZyB0aGUgcHJlLWNvbXBpbGVkIHN0YXRlbWVudCBvZiB0aGUgZ2l2ZW4gU1FMCisgICAgICAgICAgICAgICAgaWYgKG1NYXhQb29sU2l6ZSA9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHBvb2xPYmogPSBtUG9vbC5nZXQoMCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtTWF4UG9vbFNpemU7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Qb29sLmdldChpKS5tRGIuaXNJblN0YXRlbWVudENhY2hlKHNxbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb29sT2JqID0gbVBvb2wuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChwb29sT2JqID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZXJlIGFyZSBubyBkYXRhYmFzZSBjb25uZWN0aW9ucyB3aXRoIHRoZSBnaXZlbiBTUUwgcHJlLWNvbXBpbGVkLgorICAgICAgICAgICAgICAgICAgICAgICAgLy8gb2sgdG8gcmV0dXJuIGFueSBvZiB0aGUgY29ubmVjdGlvbnMuCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmFuZCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFuZCA9IG5ldyBSYW5kb20oU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcG9vbE9iaiA9IG1Qb29sLmdldChyYW5kLm5leHRJbnQobU1heFBvb2xTaXplKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZGIgPSBwb29sT2JqLm1EYjsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgbmV3IGNvbm5lY3Rpb24gYW5kIGFkZCBpdCB0byB0aGUgcG9vbCwgc2luY2Ugd2UgaGF2ZW4ndCByZWFjaGVkCisgICAgICAgICAgICAgICAgLy8gbWF4IHBvb2wgc2l6ZSBhbGxvd2VkCisgICAgICAgICAgICAgICAgZGIgPSBtUGFyZW50RGJPYmouY3JlYXRlUG9vbENvbm5lY3Rpb24oKHNob3J0KShwb29sU2l6ZSArIDEpKTsKKyAgICAgICAgICAgICAgICBwb29sT2JqID0gbmV3IFBvb2xPYmooZGIpOworICAgICAgICAgICAgICAgIG1Qb29sLmFkZChwb29sU2l6ZSwgcG9vbE9iaik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyB0aGVyZSBhcmUgZnJlZSBjb25uZWN0aW9ucyBhdmFpbGFibGUuIHBpY2sgb25lCisgICAgICAgICAgICAvLyBwcmVmZXJhYmx5IGEgY29ubmVjdGlvbiBjYWNoaW5nIHRoZSBwcmUtY29tcGlsZWQgc3RhdGVtZW50IG9mIHRoZSBnaXZlbiBTUUwKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcG9vbFNpemU7IGkrKykgeworICAgICAgICAgICAgICAgIGlmIChtUG9vbC5nZXQoaSkuaXNGcmVlKCkgJiYgbVBvb2wuZ2V0KGkpLm1EYi5pc0luU3RhdGVtZW50Q2FjaGUoc3FsKSkgeworICAgICAgICAgICAgICAgICAgICBwb29sT2JqID0gbVBvb2wuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocG9vbE9iaiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgLy8gZGlkbid0IGZpbmQgYSBmcmVlIGRhdGFiYXNlIGNvbm5lY3Rpb24gd2l0aCB0aGUgZ2l2ZW4gU1FMIGFscmVhZHkKKyAgICAgICAgICAgICAgICAvLyBwcmUtY29tcGlsZWQuIHJldHVybiBhIGZyZWUgY29ubmVjdGlvbiAodGhpcyBtZWFucywgdGhlIHNhbWUgU1FMIGNvdWxkIGJlCisgICAgICAgICAgICAgICAgLy8gcHJlLWNvbXBpbGVkIG9uIG1vcmUgdGhhbiBvbmUgZGF0YWJhc2UgY29ubmVjdGlvbi4gcG90ZW50aWFsIHdhc3RlZCBtZW1vcnkuKQorICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcG9vbFNpemU7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBpZiAobVBvb2wuZ2V0KGkpLmlzRnJlZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwb29sT2JqID0gbVBvb2wuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBkYiA9IHBvb2xPYmoubURiOworICAgICAgICB9CisKKyAgICAgICAgYXNzZXJ0IHBvb2xPYmogIT0gbnVsbDsKKyAgICAgICAgYXNzZXJ0IHBvb2xPYmoubURiID09IGRiOworCisgICAgICAgIHBvb2xPYmouYWNxdWlyZSgpOworICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJFTkQgZ2V0LWNvbm5lY3Rpb246ICIgKyB0b1N0cmluZygpICsgcG9vbE9iai50b1N0cmluZygpKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZGI7CisgICAgICAgIC8vIFRPRE8gaWYgYSB0aHJlYWQgYWNxdWlyZXMgYSBjb25uZWN0aW9uIGFuZCBkaWVzIHdpdGhvdXQgcmVsZWFzaW5nIHRoZSBjb25uZWN0aW9uLCB0aGVuCisgICAgICAgIC8vIHRoZXJlIGNvdWxkIGJlIGEgY29ubmVjdGlvbiBsZWFrLgorICAgIH0KKworICAgIC8qKgorICAgICAqIHJlbGVhc2UgdGhlIGdpdmVuIGRhdGFiYXNlIGNvbm5lY3Rpb24gYmFjayB0byB0aGUgcG9vbC4KKyAgICAgKiBAcGFyYW0gZGIgdGhlIGNvbm5lY3Rpb24gdG8gYmUgcmVsZWFzZWQKKyAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovIHN5bmNocm9uaXplZCB2b2lkIHJlbGVhc2UoU1FMaXRlRGF0YWJhc2UgZGIpIHsKKyAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgYXNzZXJ0IGRiLm1Db25uZWN0aW9uTnVtID4gMDsKKyAgICAgICAgICAgIGRvQXNzZXJ0cygpOworICAgICAgICAgICAgYXNzZXJ0IG1Qb29sLmdldChkYi5tQ29ubmVjdGlvbk51bSAtIDEpLm1EYiA9PSBkYjsKKyAgICAgICAgfQorCisgICAgICAgIFBvb2xPYmogcG9vbE9iaiA9IG1Qb29sLmdldChkYi5tQ29ubmVjdGlvbk51bSAtIDEpOworCisgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgIExvZy5kKFRBRywgIkJFR0lOIHJlbGVhc2UtY29ubjogIiArIHRvU3RyaW5nKCkgKyBwb29sT2JqLnRvU3RyaW5nKCkpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHBvb2xPYmouaXNGcmVlKCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIlJlbGVhc2luZyBvYmplY3QgYWxyZWFkeSBmcmVlZDogIiArCisgICAgICAgICAgICAgICAgICAgIGRiLm1Db25uZWN0aW9uTnVtKTsKKyAgICAgICAgfQorCisgICAgICAgIHBvb2xPYmoucmVsZWFzZSgpOworICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJFTkQgcmVsZWFzZS1jb25uOiAiICsgdG9TdHJpbmcoKSArIHBvb2xPYmoudG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIGEgbGlzdCBvZiBhbGwgZGF0YWJhc2UgY29ubmVjdGlvbnMgaW4gdGhlIHBvb2wgKGJvdGggZnJlZSBhbmQgYnVzeSBjb25uZWN0aW9ucykuCisgICAgICogVGhpcyBtZXRob2QgaXMgdXNlZCB3aGVuICJhZGIgYnVncmVwb3J0IiBpcyBkb25lLgorICAgICAqLworICAgIC8qIHBhY2thZ2UgKi8gc3luY2hyb25pemVkIEFycmF5TGlzdDxTUUxpdGVEYXRhYmFzZT4gZ2V0Q29ubmVjdGlvbkxpc3QoKSB7CisgICAgICAgIEFycmF5TGlzdDxTUUxpdGVEYXRhYmFzZT4gbGlzdCA9IG5ldyBBcnJheUxpc3Q8U1FMaXRlRGF0YWJhc2U+KCk7CisgICAgICAgIGZvciAoaW50IGkgPSBtUG9vbC5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgeworICAgICAgICAgICAgbGlzdC5hZGQobVBvb2wuZ2V0KGkpLm1EYik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGxpc3Q7CisgICAgfQorCisgICAgLyoqCisgICAgICogcGFja2FnZSBsZXZlbCBhY2Nlc3MgZm9yIHRlc3RpbmcgcHVycG9zZXMgb25seS4gb3RoZXJ3aXNlLCBwcml2YXRlIHNob3VsZCBiZSBzdWZmaWNpZW50LgorICAgICAqLworICAgIC8qIHBhY2thZ2UgKi8gaW50IGdldEZyZWVQb29sU2l6ZSgpIHsKKyAgICAgICAgaW50IGNvdW50ID0gMDsKKyAgICAgICAgZm9yIChpbnQgaSA9IG1Qb29sLnNpemUoKSAtIDE7IGkgPj0gMDsgaS0tKSB7CisgICAgICAgICAgICBpZiAobVBvb2wuZ2V0KGkpLmlzRnJlZSgpKSB7CisgICAgICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gY291bnQrKzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBvbmx5IGZvciB0ZXN0aW5nIHB1cnBvc2VzCisgICAgICovCisgICAgLyogcGFja2FnZSAqLyBBcnJheUxpc3Q8UG9vbE9iaj4gZ2V0UG9vbCgpIHsKKyAgICAgICAgcmV0dXJuIG1Qb29sOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVmZiA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIGJ1ZmYuYXBwZW5kKCJkYjogIik7CisgICAgICAgIGJ1ZmYuYXBwZW5kKG1QYXJlbnREYk9iai5nZXRQYXRoKCkpOworICAgICAgICBidWZmLmFwcGVuZCgiLCB0b3RhbHNpemUgPSAiKTsKKyAgICAgICAgYnVmZi5hcHBlbmQobVBvb2wuc2l6ZSgpKTsKKyAgICAgICAgYnVmZi5hcHBlbmQoIiwgI2ZyZWUgPSAiKTsKKyAgICAgICAgYnVmZi5hcHBlbmQoZ2V0RnJlZVBvb2xTaXplKCkpOworICAgICAgICBidWZmLmFwcGVuZCgiLCBtYXhwb29sc2l6ZSA9ICIpOworICAgICAgICBidWZmLmFwcGVuZChtTWF4UG9vbFNpemUpOworICAgICAgICBmb3IgKFBvb2xPYmogcCA6IG1Qb29sKSB7CisgICAgICAgICAgICBidWZmLmFwcGVuZCgiXG4iKTsKKyAgICAgICAgICAgIGJ1ZmYuYXBwZW5kKHAudG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGJ1ZmYudG9TdHJpbmcoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZG9Bc3NlcnRzKCkgeworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1Qb29sLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICBtUG9vbC5nZXQoaSkudmVyaWZ5KCk7CisgICAgICAgICAgICBhc3NlcnQgbVBvb2wuZ2V0KGkpLm1EYi5tQ29ubmVjdGlvbk51bSA9PSAoaSArIDEpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqIG9ubHkgdXNlZCBmb3IgdGVzdGluZyBwdXJwb3Nlcy4gKi8KKyAgICAvKiBwYWNrYWdlICovIHN5bmNocm9uaXplZCB2b2lkIHNldE1heFBvb2xTaXplKGludCBzaXplKSB7CisgICAgICAgIG1NYXhQb29sU2l6ZSA9IHNpemU7CisgICAgfQorCisgICAgLyoqIG9ubHkgdXNlZCBmb3IgdGVzdGluZyBwdXJwb3Nlcy4gKi8KKyAgICAvKiBwYWNrYWdlICovIHN5bmNocm9uaXplZCBpbnQgZ2V0TWF4UG9vbFNpemUoKSB7CisgIC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ogY29udGFpbnMgdGhlIHRocmVhZElkcyBvZiB0aGUgdGhyZWFkcyBob2xkaW5nIHRoaXMgY29ubmVjdGlvbi4KKyAgICAgICAgICogdXNlZCBmb3IgZGVidWdnaW5nIHB1cnBvc2VzIG9ubHkuCisgICAgICAgICAqLworICAgICAgICAvLyBAR3VhcmRlZEJ5KCJ0aGlzIikKKyAgICAgICAgcHJpdmF0ZSBIYXNoU2V0PExvbmc+IG1Ib2xkZXJJZHMgPSBuZXcgSGFzaFNldDxMb25nPigpOworCisgICAgICAgIHB1YmxpYyBQb29sT2JqKFNRTGl0ZURhdGFiYXNlIGRiKSB7CisgICAgICAgICAgICBtRGIgPSBkYjsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgYWNxdWlyZSgpIHsKKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICBhc3NlcnQgaXNGcmVlKCk7CisgICAgICAgICAgICAgICAgbG9uZyBpZCA9IFRocmVhZC5jdXJyZW50VGhyZWFkKCkuZ2V0SWQoKTsKKyAgICAgICAgICAgICAgICBhc3NlcnQgIW1Ib2xkZXJJZHMuY29udGFpbnMoaWQpOworICAgICAgICAgICAgICAgIG1Ib2xkZXJJZHMuYWRkKGlkKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbU51bUhvbGRlcnMrKzsKKyAgICAgICAgICAgIG1GcmVlQnVzeUZsYWcgPSBCVVNZOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCByZWxlYXNlKCkgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgICAgIGxvbmcgaWQgPSBUaHJlYWQuY3VycmVudFRocmVhZCgpLmdldElkKCk7CisgICAgICAgICAgICAgICAgYXNzZXJ0IG1Ib2xkZXJJZHMuc2l6ZSgpID09IG1OdW1Ib2xkZXJzOworICAgICAgICAgICAgICAgIGFzc2VydCBtSG9sZGVySWRzLmNvbnRhaW5zKGlkKTsKKyAgICAgICAgICAgICAgICBtSG9sZGVySWRzLnJlbW92ZShpZCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1OdW1Ib2xkZXJzLS07CisgICAgICAgICAgICBpZiAobU51bUhvbGRlcnMgPT0gMCkgeworICAgICAgICAgICAgICAgIG1GcmVlQnVzeUZsYWcgPSBGUkVFOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgYm9vbGVhbiBpc0ZyZWUoKSB7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgdmVyaWZ5KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gKG1GcmVlQnVzeUZsYWcgPT0gRlJFRSk7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIHZlcmlmeSgpIHsKKyAgICAgICAgICAgIGlmIChtRnJlZUJ1c3lGbGFnID09IEZSRUUpIHsKKyAgICAgICAgICAgICAgICBhc3NlcnQgbU51bUhvbGRlcnMgPT0gMDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgYXNzZXJ0IG1OdW1Ib2xkZXJzID4gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBvbmx5IGZvciB0ZXN0aW5nIHB1cnBvc2VzCisgICAgICAgICAqLworICAgICAgICAvKiBwYWNrYWdlICovIHN5bmNocm9uaXplZCBpbnQgZ2V0TnVtSG9sZGVycygpIHsKKyAgICAgICAgICAgIHJldHVybiBtTnVtSG9sZGVyczsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlk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lZCBhIHJlY29tcGlsZS4KLSAgICAgICAgaWYgKGZvcmNlQ29tcGlsYXRpb24pIHsKLSAgICAgICAgICAgIG1EYXRhYmFzZS5sb2NrKCk7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIC8vIE5vdGUgdGhhdCB0aGUgbmF0aXZlX2NvbXBpbGUoKSB0YWtlcyBjYXJlIG9mIGRlc3Ryb3lpbmcgYW55IHByZXZpb3VzbHkKLSAgICAgICAgICAgICAgICAvLyBleGlzdGluZyBwcm9ncmFtcyBiZWZvcmUgaXQgY29tcGlsZXMuCi0gICAgICAgICAgICAgICAgbmF0aXZlX2NvbXBpbGUoc3FsKTsKLSAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgbURhdGFiYXNlLnVubG9jaygpOwotICAgICAgICAgICAgfQotICAgICAgICB9CisgICAgICAgIG5IYW5kbGUgPSBkYi5tTmF0aXZlSGFuZGxlOworICAgICAgICBuYXRpdmVfY29tcGlsZShzcWwpOwogICAgIH0KIAogICAgIC8qIHBhY2thZ2UgKi8gdm9pZCByZWxlYXNlU3FsU3RhdGVtZW50KCkgewogICAgICAgICAvLyBOb3RlIHRoYXQgbmF0aXZlX2ZpbmFsaXplKCkgY2hlY2tzIHRvIG1ha2Ugc3VyZSB0aGF0IG5TdGF0ZW1lbnQgaXMKICAgICAgICAgLy8gbm9uLW51bGwgYmVmb3JlIGRlc3Ryb3lpbmcgaXQuCiAgICAgICAgIGlmIChuU3RhdGVtZW50ICE9IDApIHsKLSAgICAgICAgICAgIGlmIChTUUxpdGVEZWJ1Zy5ERUJVR19BQ1RJVkVfQ1VSU09SX0ZJTkFMSVpBVElPTikgewotICAgICAgICAgICAgICAgIExvZy52KFRBRywgImNsb3NlZCBhbmQgZGVhbGxvY2F0ZWQgRGJPYmogKGlkIyIgKyBuU3RhdGVtZW50ICsiKSIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2UubG9jaygpOwotICAgICAgICAgICAgICAgIG5hdGl2ZV9maW5hbGl6ZSgpOwotICAgICAgICAgICAgICAgIG5TdGF0ZW1lbnQgPSAwOwotICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2UudW5sb2NrKCk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBtRGF0YWJhc2UuZmluYWxpemVTdGF0ZW1lbnRMYXRlcihuU3RhdGVtZW50KTsKKyAgICAgICAgICAgIG5TdGF0ZW1lbnQgPSAwOwogICAgICAgICB9CiAgICAgfQogCkBAIC0xMTgsMjMgKzc4LDI0IEBACiAgICAgICovCiAgICAgLyogcGFja2FnZSAqLyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBhY3F1aXJlKCkgewogICAgICAgICBpZiAobUluVXNlKSB7Ci0gICAgICAgICAgICAvLyBzb21lb25lIGFscmVhZHkgaGFzIGFjcXVpcmVkIGl0LgorICAgICAgICAgICAgLy8gaXQgaXMgYWxyZWFkeSBpbiB1c2UuCiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KICAgICAgICAgbUluVXNlID0gdHJ1ZTsKLSAgICAgICAgaWYgKFNRTGl0ZURlYnVnLkRFQlVHX0FDVElWRV9DVVJTT1JfRklOQUxJWkFUSU9OKSB7Ci0gICAgICAgICAgICBMb2cudihUQUcsICJBY3F1aXJlZCBEYk9iaiAoaWQjIiArIG5TdGF0ZW1lbnQgKyAiKSBmcm9tIERCIGNhY2hlIik7Ci0gICAgICAgIH0KICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCiAgICAgLyogcGFja2FnZSAqLyBzeW5jaHJvbml6ZWQgdm9pZCByZWxlYXNlKCkgewotICAgICAgICBpZiAoU1FMaXRlRGVidWcuREVCVUdfQUNUSVZFX0NVUlNPUl9GSU5BTElaQVRJT04pIHsKLSAgICAgICAgICAgIExvZy52KFRBRywgIlJlbGVhc2VkIERiT2JqIChpZCMiICsgblN0YXRlbWVudCArICIpIGJhY2sgdG8gREIgY2FjaGUiKTsKLSAgICAgICAgfQogICAgICAgICBtSW5Vc2UgPSBmYWxzZTsKICAgICB9CiAKKyAgICAvKiBwYWNrYWdlICovIHN5bmNocm9uaXplZCB2b2lkIHJlbGVhc2VJZk5vdEluVXNlKCkgeworICAgICAgICAvLyBpZiBpdCBpcyBub3QgaW4gdXNlLCByZWxlYXNlIGl0cyBtZW1vcnkgZnJvbSB0aGUgZGF0YWJhc2UKKyAgICAgICAgaWYgKCFtSW5Vc2UpIHsKKyAgICAgICAgICAgIHJlbGVhc2VTcWxTdGF0ZW1lbnQoKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIC8qKgogICAgICAqIE1ha2Ugc3VyZSB0aGF0IHRoZSBuYXRpdmUgcmVzb3VyY2UgaXMgY2xlYW5lZCB1cC4KICAgICAgKi8KQEAgLTE0MywxNSArMTA0LDE1IEBACiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICBpZiAoblN0YXRlbWVudCA9PSAwKSByZXR1cm47CiAgICAgICAgICAgICAvLyBmaW5hbGl6ZXIgc2hvdWxkIE5FVkVSIGdldCBjYWxsZWQKLSAgICAgICAgICAgIGlmIChTUUxpdGVEZWJ1Zy5ERUJVR19BQ1RJVkVfQ1VSU09SX0ZJTkFMSVpBVElPTikgewotICAgICAgICAgICAgICAgIExvZy52KFRBRywgIioqIHdhcm5pbmcgKiogRmluYWxpemVkIERiT2JqIChpZCMiICsgblN0YXRlbWVudCArICIpIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoU3RyaWN0TW9kZS52bVNxbGl0ZU9iamVjdExlYWtzRW5hYmxlZCgpKSB7CisgICAgICAgICAgICAvLyBidXQgaWYgdGhlIGRhdGFiYXNlIGl0c2VsZiBpcyBub3QgY2xvc2VkIGFuZCBpcyBHQydlZCwgdGhlbgorICAgICAgICAgICAgLy8gYWxsIHN1Yi1vYmplY3RzIGF0dGFjaGVkIHRvIHRoZSBkYXRhYmFzZSBjb3VsZCBlbmQgdXAgZ2V0dGluZyBHQydlZCB0b28uCisgICAgICAgICAgICAvLyBpbiB0aGF0IGNhc2UsIGRvbid0IHByaW50IGFueSB3YXJuaW5nLgorICAgICAgICAgICAgaWYgKG1JblVzZSAmJiBTdHJpY3RNb2RlLnZtU3FsaXRlT2JqZWN0TGVha3NFbmFibGVkKCkpIHsKICAgICAgICAgICAgICAgICBpbnQgbGVuID0gbVNxbFN0bXQubGVuZ3RoKCk7CiAgICAgICAgICAgICAgICAgU3RyaWN0TW9kZS5vblNxbGl0ZU9iamVjdExlYWtlZCgKICAgICAgICAgICAgICAgICAgICAgIlJlbGVhc2luZyBzdGF0ZW1lbnQgaW4gYSBmaW5hbGl6ZXIuIFBsZWFzZSBlbnN1cmUgIiArCiAgICAgICAgICAgICAgICAgICAgICJ0aGF0IHlvdSBleHBsaWNpdGx5IGNhbGwgY2xvc2UoKSBvbiB5b3VyIGN1cnNvcjogIiArCi0gICAgICAgICAgICAgICAgICAgIG1TcWxTdG10LnN1YnN0cmluZygwLCAobGVuID4gMTAwKSA/IDEwMCA6IGxlbiksCisgICAgICAgICAgICAgICAgICAgIG1TcWxTdG10LnN1YnN0cmluZygwLCAobGVuID4gMTAwMCkgPyAxMDAwIDogbGVuKSwKICAgICAgICAgICAgICAgICAgICAgbVN0YWNrVHJhY2UpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgcmVsZWFzZVNxbFN0YXRlbWVudCgpOwpAQCAtMTYwLDYgKzEyMSwyNCBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgQE92ZXJyaWRlIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CisgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1ZmYgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgYnVmZi5hcHBlbmQoIiBuU3Rhd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YXRlIFRocm93YWJsZSBtU3RhY2tUcmFjZTsKKyAgICBwcml2YXRlIGZpbmFsIFRocm93YWJsZSBtU3RhY2tUcmFjZTsKICAgICAKICAgICAvKiogCiAgICAgICogIG1NYXhSZWFkIGlzIHRoZSBtYXggaXRlbXMgdGhhdCBlYWNoIGN1cnNvciB3aW5kb3cgcmVhZHMgCkBAIC03OCw3ICs3MSw3IEBACiAgICAgcHJpdmF0ZSBpbnQgbUN1cnNvclN0YXRlID0gMDsKICAgICBwcml2YXRlIFJlZW50cmFudExvY2sgbUxvY2sgPSBudWxsOwogICAgIHByaXZhdGUgYm9vbGVhbiBtUGVuZGluZ0RhdGEgPSBmYWxzZTsKLSAgICAKKwogICAgIC8qKgogICAgICAqICBzdXBwb3J0IGZvciBhIGN1cnNvciB2YXJpYW50IHRoYXQgZG9lc24ndCBhbHdheXMgcmVhZCBhbGwgcmVzdWx0cwogICAgICAqICBpbml0aWFsUmVhZCBpcyB0aGUgaW5pdGlhbCBudW1iZXIgb2YgaXRlbXMgdGhhdCBjdXJzb3Igd2luZG93IHJlYWRzIApAQCAtMTM3LDE0ICsxMzAsMjIgQEAKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGludCBjb3VudCA9IG1RdWVyeS5maWxsV2luZG93KGN3LCBtTWF4UmVhZCwgbUNvdW50KTsKLSAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIC0xIG1lYW5zIG5vdCBmaW5pc2hlZAorICAgICAgICAgICAgICAgICAgICBpbnQgY291bnQgPSBnZXRRdWVyeSgpLmZpbGxXaW5kb3coY3csIG1NYXhSZWFkLCBtQ291bnQpOworICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm4gLTEgbWVhbnMgdGhlcmUgaXMgc3RpbGwgbW9yZSBkYXRhIHRvIGJlIHJldHJpZXZlZCBmcm9tIHRoZSByZXN1bHRzZXQKICAgICAgICAgICAgICAgICAgICAgaWYgKGNvdW50ICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb3VudCA9PSBOT19DT1VOVCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvdW50ICs9IG1NYXhSZWFkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAicmVjZWl2ZWQgLTEgZnJvbSBuYXRpdmVfZmlsbF93aW5kb3cuIHJlYWQgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvdW50ICsgIiByb3dzIHNvIGZhciIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db3VudCA9IGNvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db3VudCArPSBjb3VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgInJlY2VpdmVkIGFsbCBkYXRhIGZyb20gbmF0aXZlX2ZpbGxfd2luZG93LiByZWFkICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db3VudCArICIgcm93cy4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmV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5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInF1ZXJ5Lm1EYXRhYmFzZSBjYW5ub3QgYmUgbnVsbCIpOworICAgICAgICB9CiAgICAgICAgIG1TdGFja1RyYWNlID0gbmV3IERhdGFiYXNlT2JqZWN0Tm90Q2xvc2VkRXhjZXB0aW9uKCkuZmlsbEluU3RhY2tUcmFjZSgpOwotICAgICAgICBtRGF0YWJhc2UgPSBkYjsKICAgICAgICAgbURyaXZlciA9IGRyaXZlcjsKICAgICAgICAgbUVkaXRUYWJsZSA9IGVkaXRUYWJsZTsKICAgICAgICAgbUNvbHVtbk5hbWVNYXAgPSBudWxsOwogICAgICAgICBtUXVlcnkgPSBxdWVyeTsKIAogICAgICAgICB0cnkgewotICAgICAgICAgICAgZGIubG9jaygpOworICAgICAgICAgICAgcXVlcnkubURhdGFiYXNlLmxvY2soKTsKIAogICAgICAgICAgICAgLy8gU2V0dXAgdGhlIGxpc3Qgb2YgY29sdW1ucwogICAgICAgICAgICAgaW50IGNvbHVtbkNvdW50ID0gbVF1ZXJ5LmNvbHVtbkNvdW50TG9ja2VkKCk7CkBAIC0yNDAsNyArMjYzLDcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICBkYi51bmxvY2soKTsKKyAgICAgICAgICAgIHF1ZXJ5Lm1EYXRhYmFzZS51bmxvY2soKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMjQ4LDcgKzI3MSw5IEBACiAgICAgICogQHJldHVybiB0aGUgU1FMaXRlRGF0YWJhc2UgdGhhdCB0aGlzIGN1cnNvciBpcyBhc3NvY2lhdGVkIHdpdGguCiAgICAgICovCiAgICAgcHVibGljIFNRTGl0ZURhdGFiYXNlIGdldERhdGFiYXNlKCkgewotICAgICAgICByZXR1cm4gbURhdGFiYXNlOworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIHJldHVybiBtUXVlcnkubURhdGFiYXNlOworICAgICAgICB9CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCkBAIC0yODQsMTMgKzMwOSwyNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBtV2luZG93LnNldFN0YXJ0UG9zaXRpb24oc3RhcnRQb3MpOwotICAgICAgICBtQ291bnQgPSBtUXVlcnkuZmlsbFdpbmRvdyhtV2luZG93LCBtSW5pdGlhbFJlYWQsIDApOwotICAgICAgICAvLyByZXR1cm4gLTEgbWVhbnMgbm90IGZpbmlzaGVkCi0gICAgICAgIGlmIChtQ291bnQgPT0gTk9fQ09VTlQpeworICAgICAgICBpbnQgY291bnQgPSBnZXRRdWVyeSgpLmZpbGxXaW5kb3cobVdpbmRvdywgbUluaXRpYWxSZWFkLCAwKTsKKyAgICAgICAgLy8gcmV0dXJuIC0xIG1lYW5zIHRoZXJlIGlzIHN0aWxsIG1vcmUgZGF0YSB0byBiZSByZXRyaWV2ZWQgZnJvbSB0aGUgcmVzdWx0c2V0CisgICAgICAgIGlmIChjb3VudCA9PSBOT19DT1VOVCl7CiAgICAgICAgICAgICBtQ291bnQgPSBzdGFydFBvcyArIG1Jbml0aWFsUmVhZDsKKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJyZWNlaXZlZCAtMSBmcm9tIG5hdGl2ZV9maWxsX3dpbmRvdy4gcmVhZCAiICsgbUNvdW50ICsgIiByb3dzIHNvIGZhciIpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgVGhyZWFkIHQgPSBuZXcgVGhyZWFkKG5ldyBRdWVyeVRocmVhZChtQ3Vyc29yU3RhdGUpLCAicXVlcnkgdGhyZWFkIik7CiAgICAgICAgICAgICB0LnN0YXJ0KCk7Ci0gICAgICAgIH0gCisgICAgICAgIH0gZWxzZSBpZiAoc3RhcnRQb3MgPT0gMCkge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LSAgICAgICAgICAgICAgICAgICAgIkNvdWxkIG5vdCBkZWxldGUgcm93IGJlY2F1c2UgZWl0aGVyIHRoZSByb3cgSUQgY29sdW1uIGlzIG5vdCBhdmFpbGFibGUgb3IgaXQiICsKLSAgICAgICAgICAgICAgICAgICAgImhhcyBub3QgYmVlbiByZWFkLiIpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgYm9vbGVhbiBzdWNjZXNzOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEVuc3VyZSB3ZSBkb24ndCBjaGFuZ2UgdGhlIHN0YXRlIG9mIHRoZSBkYXRhYmFzZSB3aGVuIGFub3RoZXIKLSAgICAgICAgICogdGhyZWFkIGlzIGhvbGRpbmcgdGhlIGRhdGFiYXNlIGxvY2suIHJlcXVlcnkoKSBhbmQgbW92ZVRvKCkgYXJlIGFsc28KLSAgICAgICAgICogc3luY2hyb25pemVkIGhlcmUgdG8gbWFrZSBzdXJlIHRoZXkgZ2V0IHRoZSBzdGF0ZSBvZiB0aGUgZGF0YWJhc2UKLSAgICAgICAgICogaW1tZWRpYXRlbHkgZm9sbG93aW5nIHRoZSBERUxFVEUuCi0gICAgICAgICAqLwotICAgICAgICBtRGF0YWJhc2UubG9jaygpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2UuZGVsZXRlKG1FZGl0VGFibGUsIG1Db2x1bW5zW21Sb3dJZENvbHVtbkluZGV4XSArICI9PyIsCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW10ge21DdXJyZW50Um93SUQudG9TdHJpbmcoKX0pOwotICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSB0cnVlOwotICAgICAgICAgICAgfSBjYXRjaCAoU1FMRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBzdWNjZXNzID0gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGludCBwb3MgPSBtUG9zOwotICAgICAgICAgICAgcmVxdWVyeSgpOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogRW5zdXJlIHByb3BlciBjdXJzb3Igc3RhdGUuIE5vdGUgdGhhdCBtQ3VycmVudFJvd0lEIGNoYW5nZXMKLSAgICAgICAgICAgICAqIGluIHRoaXMgY2FsbC4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgbW92ZVRvUG9zaXRpb24ocG9zKTsKLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIG1EYXRhYmFzZS51bmxvY2soKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChzdWNjZXNzKSB7Ci0gICAgICAgICAgICBvbkNoYW5nZSh0cnVlKTsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgfQotCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIFN0cmluZ1tdIGdldENvbHVtbk5hbWVzKCkgewogICAgICAgICByZXR1cm4gbUNvbHVtbnM7CiAgICAgfQogCi0gICAgLyoqCi0gICAgICogQGhpZGUKLSAgICAgKiBAZGVwcmVjYXRlZAotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBib29sZWFuIHN1cHBvcnRzVXBkYXRlcygpIHsKLSAgICAgICAgcmV0dXJuIHN1cGVyLnN1cHBvcnRzVXBkYXRlcygpICYmICFUZXh0VXRpbHMuaXNFbXB0eShtRWRpdFRhYmxlKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGJvb2xlYW4gY29tbWl0VXBkYXRlcyhNYXA8PyBleHRlbmRzIExvbmcsCi0gICAgICAgICAgICA/IGV4dGVuZHMgTWFwPFN0cmluZywgT2JqZWN0Pj4gYWRkaXRpb25hbFZhbHVlcykgewotICAgICAgICBpZiAoIXN1cHBvcnRzVXBkYXRlcygpKSB7Ci0gICAgICAgICAgICBMb2cuZShUQUcsICJjb21taXRVcGRhdGVzIG5vdCBzdXBwb3J0ZWQgb24gdGhpcyBjdXJzb3IsIGRpZCB5b3UgIgotICAgICAgICAgICAgICAgICAgICArICJpbmNsdWRlIHRoZSBfaWQgY29sdW1uPyIpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogUHJldmVudCBvdGhlciB0aHJlYWRzIGZyb20gY2hhbmdpbmcgdGhlIHVwZGF0ZWQgcm93cyB3aGlsZSB0aGV5J3JlCi0gICAgICAgICAqIGJlaW5nIHByb2Nlc3NlZCBoZXJlLgotICAgICAgICAgKi8KLSAgICAgICAgc3luY2hyb25pemVkIChtVXBkYXRlZFJvd3MpIHsKLSAgICAgICAgICAgIGlmIChhZGRpdGlvbmFsVmFsdWVzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtVXBkYXRlZFJvd3MucHV0QWxsKGFkZGl0aW9uYWxWYWx1ZXMpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobVVwZGF0ZWRSb3dzLnNpemUoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBQcmV2ZW50IG90aGVyIHRocmVhZHMgZnJvbSBjaGFuZ2luZyB0aGUgZGF0YWJhc2Ugc3RhdGUgd2hpbGUKLSAgICAgICAgICAgICAqIHdlIHByb2Nlc3MgdGhlIHVwZGF0ZWQgcm93cywgYW5kIHByZXZlbnRzIHVzIGZyb20gY2hhbmdpbmcgdGhlCi0gICAgICAgICAgICAgKiBkYXRhYmFzZSBiZWhpbmQgdGhlIGJhY2sgb2YgYW5vdGhlciB0aHJlYWQuCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIG1EYXRhYmFzZS5iZWdpblRyYW5zYWN0aW9uKCk7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgc3FsID0gbmV3IFN0cmluZ0J1aWxkZXIoMTI4KTsKLQotICAgICAgICAgICAgICAgIC8vIEZvciBlYWNoIHJvdyB0aGF0IGhhcyBiZWVuIHVwZGF0ZWQKLSAgICAgICAgICAgICAgICBmb3IgKE1hcC5FbnRyeTxMb25nLCBNYXA8U3RyaW5nLCBPYmplY3Q+PiByb3dFbnRyeSA6Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVXBkYXRlZFJvd3MuZW50cnlTZXQoKSkgewotICAgICAgICAgICAgICAgICAgICBNYXA8U3RyaW5nLCBPYmplY3Q+IHZhbHVlcyA9IHJvd0VudHJ5LmdldFZhbHVlKCk7Ci0gICAgICAgICAgICAgICAgICAgIExvbmcgcm93SWRPYmogPSByb3dFbnRyeS5nZXRLZXkoKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAocm93SWRPYmogPT0gbnVsbCB8fCB2YWx1ZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigibnVsbCByb3dJZCBvciB2YWx1ZXMgZm91bmQhIHJvd0lkID0gIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHJvd0lkT2JqICsgIiwgdmFsdWVzID0gIiArIHZhbHVlcyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWVzLnNpemUoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGxvbmcgcm93SWQgPSByb3dJZE9iai5sb25nVmFsdWUoKTsKLQotICAgICAgICAgICAgICAgICAgICBJdGVyYXRvcjxNYXAuRW50cnk8U3RyaW5nLCBPYmplY3Q+PiB2YWx1ZXNJdGVyID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXMuZW50cnlTZXQoKS5pdGVyYXRvcigpOwotCi0gICAgICAgICAgICAgICAgICAgIHNxbC5zZXRMZW5ndGgoMCk7Ci0gICAgICAgICAgICAgICAgICAgIHNxbC5hcHBlbmQoIlVQREFURSAiICsgbUVkaXRUYWJsZSArICIgU0VUICIpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIEZvciBlYWNoIGNvbHVtbiB2YWx1ZSB0aGF0IGhhcyBiZWVuIHVwZGF0ZWQKLSAgICAgICAgICAgICAgICAgICAgT2JqZWN0W10gYmluZGluZ3MgPSBuZXcgT2JqZWN0W3ZhbHVlcy5zaXplKCldOwotICAgICAgICAgICAgICAgICAgICBpbnQgaSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIHdoaWxlICh2YWx1ZXNJdGVyLmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgTWFwLkVudHJ5PFN0cmluZywgT2JqZWN0PiBlbnRyeSA9IHZhbHVlc0l0ZXIubmV4dCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgc3FsLmFwcGVuZChlbnRyeS5nZXRLZXkoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzcWwuYXBwZW5kKCI9PyIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYmluZGluZ3NbaV0gPSBlbnRyeS5nZXRWYWx1ZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlc0l0ZXIuaGFzTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3FsLmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHNxbC5hcHBlbmQoIiBXSEVSRSAiICsgbUNvbHVtbnNbbVJvd0lkQ29sdW1uSW5kZXhdCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAnPScgKyByb3dJZCk7Ci0gICAgICAgICAgICAgICAgICAgIHNxbC5hcHBlbmQoJzsnKTsKLSAgICAgICAgICAgICAgICAgICAgbURhdGFiYXNlLmV4ZWNTUUwoc3FsLnRvU3RyaW5nKCksIGJpbmRpbmdzKTsKLSAgICAgICAgICAgICAgICAgICAgbURhdGFiYXNlLnJvd1VwZGF0ZWQobUVkaXRUYWJsZSwgcm93SWQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtRGF0YWJhc2Uuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7Ci0gICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5lbmRUcmFuc2FjdGlvbigpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtVXBkYXRlZFJvd3MuY2xlYXIoKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8vIExldCBhbnkgY2hhbmdlIG9ic2VydmVycyBrbm93IGFib3V0IHRoZSB1cGRhdGUKLSAgICAgICAgb25DaGFuZ2UodHJ1ZSk7Ci0KLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCiAgICAgcHJpdmF0ZSB2b2lkIGRlYWN0aXZhdGVDb21tb24oKSB7CiAgICAgICAgIGlmIChDb25maWcuTE9HVikgTG9nLnYoVEFHLCAiPDw8IFJlbGVhc2luZyBjdXJzb3IgIiArIHRoaXMpOwogICAgICAgICBtQ3Vyc29yU3RhdGUgPSAwOwpAQCAtNTAyLDkgKzM4NiwxMSBAQAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgewogICAgICAgICBzdXBlci5jbG9zZSgpOwotICAgICAgICBkZWFjdGl2YXRlQ29tbW9uKCk7Ci0gICAgICAgIG1RdWVyeS5jbG9zZSgpOwotICAgICAgICBtRHJpdmVyLmN1cnNvckNsb3NlZCgpOworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGRlYWN0aXZhdGVDb21tb24oKTsKKyAgICAgICAgICAgIG1RdWVyeS5jbG9zZSgpOworICAgICAgICAgICAgbURyaXZlci5jdXJzb3JDbG9zZWQoKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIEBPdmVycmlkZQpAQCAtNTE2LDE2ICs0MDIsMjUgQEAKICAgICAgICAgaWYgKENvbmZpZy5MT0dWKSB7CiAgICAgICAgICAgICB0aW1lU3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKICAgICAgICAgfQotICAgICAgICAvKgotICAgICAgICAgKiBTeW5jaHJvbml6ZSBvbiB0aGUgZGF0YWJhc2UgbG9jayB0byBlbnN1cmUgdGhhdCBtQ291bnQgbWF0Y2hlcyB0aGUKLSAgICAgICAgICogcmVzdWx0cyBvZiBtUXVlcnkucmVxdWVyeSgpLgotICAgICAgICAgKi8KLSAgICAgICAgbURhdGFiYXNlLmxvY2soKTsKLSAgICAgICAgdHJ5IHsKKworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGlmIChtV2luZG93ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBtV2luZG93LmNsZWFyKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtUG9zID0gLTE7CisgICAgICAgICAgICBTUUxpdGVEYXRhYmFzZSBkYiA9IG1RdWVyeS5tRGF0YWJhc2UuZ2V0RGF0YWJhc2VIYW5kbGUobVF1ZXJ5Lm1TcWwpOworICAgICAgICAgICAgaWYgKCFkYi5lcXVhbHMobVF1ZXJ5Lm1EYXRhYmFzZSkpIHsKKyAgICAgICAgICAgICAgICAvLyBzaW5jZSB3ZSBuZWVkIHRvIHVzZSBhIGRpZmZlcmVudCBkYXRhYmFzZSBjb25uZWN0aW9uIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAvLyByZS1jb21waWxlIHRoZSBxdWVyeQorICAgICAgICAgICAgICAgIGRiLmxvY2soKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAvLyBjbG9zZSB0aGUgb2xkIG1RdWVyeSBvYmplY3QgYW5kIG9wZW4gYSBuZXcgb25lCisgICAgICAgICAgICAgICAgICAgIG1RdWVyeS5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICBtUXVlcnkgPSBuZXcgU1FMaXRlUXVlcnkoZGIsIG1RdWVyeSk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgZGIudW5sb2NrKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICAgICAgLy8gVGhpcyBvbmUgd2lsbCByZWNyZWF0ZSB0aGUgdGVtcCB0YWJsZSwgYW5kIGdldCBpdHMgY291bnQKICAgICAgICAgICAgIG1Ecml2ZXIuY3Vyc29yUmVxdWVyaWVkKHRoaXMpOwogICAgICAgICAgICAgbUNvdW50ID0gTk9fQ09VTlQ7CkBAIC01MzYsOCArNDMxLDYgQEAKICAgICAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICAgICAgcXVlcnlUaHJlYWRVbmxvY2soKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIG1EYXRhYmFzZS51bmxvY2soKTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChDb25maWcuTE9HVikgewpAQCAtNTg3LDE1ICs0ODAsMTUgQEAKICAgICAgICAgICAgICAgICAgICAgaW50IGxlbiA9IG1RdWVyeS5tU3FsLmxlbmd0aCgpOwogICAgICAgICAgICAgICAgICAgICBTdHJpY3RNb2RlLm9uU3FsaXRlT2JqZWN0TGVha2VkKAogICAgICAgICAgICAgICAgICAgICAgICAgIkZpbmFsaXppbmcgYSBDdXJzb3IgdGhhdCBoYXMgbm90IGJlZW4gZGVhY3RpdmF0ZWQgb3IgY2xvc2VkLiAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJkYXRhYmFzZSA9ICIgKyBtRGF0YWJhc2UuZ2V0UGF0aCgpICsgIiwgdGFibGUgPSAiICsgbUVkaXRUYWJsZSArCi0gICAgICAgICAgICAgICAgICAgICAgICAiLCBxdWVyeSA9ICIgKyBtUXVlcnkubVNxbC5zdWJzdHJpbmcoMCwgKGxlbiA+IDEwMCkgPyAxMDAgOiBsZW4pLAorICAgICAgICAgICAgICAgICAgICAgICAgImRhdGFiYXNlID0gIiArIG1RdWVyeS5tRGF0YWJhc2UuZ2V0UGF0aCgpICsgIiwgdGFibGUgPSAiICsgbUVkaXRUYWJsZSArCisgICAgICAgICAgICAgICAgICAgICAgICAiLCBxdWVyeSA9ICIgKyBtUXVlcnkubVNxbC5zdWJzdHJpbmcoMCwgKGxlbiA+IDEwMDApID8gMTAwMCA6IGxlbiksCiAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhY2tUcmFjZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGNsb3NlKCk7CiAgICAgICAgICAgICAgICAgU1FMaXRlRGVidWcubm90aWZ5QWN0aXZlQ3Vyc29yRmluYWxpemVkKCk7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HVikgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJGaW5hbGl6aW5nIGN1cnNvciBvbiBkYXRhYmFzZSA9ICIgKyBtRGF0YWJhc2UuZ2V0UGF0aCgpICsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiRmluYWxpemluZyBjdXJzb3Igb24gZGF0YWJhc2UgPSAiICsgbVF1ZXJ5Lm1EYXRhYmFzZS5nZXRQYXRoKCkgKwogICAgICAgICAgICAgIC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ICAgICAgIFN5bmNVcGRhdGVJbmZvKFN0cmluZyBtYXN0ZXJUYWJsZSwgU3RyaW5nIGRlbGV0ZWRUYWJsZSwKLSAgICAgICAgICAgICAgICBTdHJpbmcgZm9yZWlnbktleSkgewotICAgICAgICAgICAgdGhpcy5tYXN0ZXJUYWJsZSA9IG1hc3RlclRhYmxlOwotICAgICAgICAgICAgdGhpcy5kZWxldGVkVGFibGUgPSBkZWxldGVkVGFibGU7Ci0gICAgICAgICAgICB0aGlzLmZvcmVpZ25LZXkgPSBmb3JlaWduS2V5OwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqIFRoZSB0YWJsZSBjb250YWluaW5nIHRoZSBfc3luY190aW1lIGNvbHVtbiAqLwotICAgICAgICBTdHJpbmcgbWFzdGVyVGFibGU7Ci0KLSAgICAgICAgLyoqIFRoZSBkZWxldGVkIHRhYmxlIHRoYXQgY29ycmVzcG9uZHMgdG8gdGhlIG1hc3RlciB0YWJsZSAqLwotICAgICAgICBTdHJpbmcgZGVsZXRlZFRhYmxlOwotCi0gICAgICAgIC8qKiBUaGUga2V5IGluIHRoZSBsb2NhbCB0YWJsZSB0aGUgcm93IGluIHRhYmxlLiBJdCBtYXkgYmUgX2lkLCBpZiB0YWJsZQotICAgICAgICAgKiBpcyB0aGUgbG9jYWwgdGFibGUuICovCi0gICAgICAgIFN0cmluZyBmb3JlaWduS2V5OworICAgIEBEZXByZWNhdGVkCisgICAgcHVibGljIE1hcDxTdHJpbmcsIFN0cmluZz4gZ2V0U3luY2VkVGFibGVzKCkgeworICAgICAgICByZXR1cm4gbmV3IEhhc2hNYXA8U3RyaW5nLCBTdHJpbmc+KDApOwogICAgIH0KIAogICAgIC8qKgpAQCAtNzkxLDggKzkwMSw3IEBACiAgICAgcHVibGljIGludGVyZmFjZSBDdXJzb3JGYWN0b3J5IHsKICAgICAgICAgLyoqCiAgICAgICAgICAqIFNlZQotICAgICAgICAgKiB7QGxpbmsgU1FMaXRlQ3Vyc29yI1NRTGl0Z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pcyBkYXRhYmFzZSB3aGlsZSBJIHdhcyB3YWl0aW5nIGZvciBsb2NrLgorICAgICAgICAgICAgLy8gY2hlY2sgdGhlIGRhdGFiYXNlIHN0YXRlCisgICAgICAgICAgICBpZiAoIWlzT3BlbigpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQogICAgICAgICAgICAgY2xvc2VDbG9zYWJsZSgpOworICAgICAgICAgICAgLy8gZmluYWxpemUgQUxMIHN0YXRlbWVudHMgcXVldWVkIHVwIHNvIGZhcgorICAgICAgICAgICAgY2xvc2VQZW5kaW5nU3RhdGVtZW50cygpOworICAgICAgICAgICAgcmVsZWFzZUN1c3RvbUZ1bmN0aW9ucygpOwogICAgICAgICAgICAgLy8gY2xvc2UgdGhpcyBkYXRhYmFzZSBpbnN0YW5jZSAtIHJlZ2FyZGxlc3Mgb2YgaXRzIHJlZmVyZW5jZSBjb3VudCB2YWx1ZQotICAgICAgICAgICAgb25BbGxSZWZlcmVuY2VzUmVsZWFzZWQoKTsKKyAgICAgICAgICAgIGNsb3NlRGF0YWJhc2UoKTsKKyAgICAgICAgICAgIGlmIChtQ29ubmVjdGlvblBvb2wgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICAgICAgYXNzZXJ0IG1Db25uZWN0aW9uUG9vbCAhPSBudWxsOworICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsIG1Db25uZWN0aW9uUG9vbC50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUNvbm5lY3Rpb25Qb29sLmNsb3NlKCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICB1bmxvY2soKTsKKyAgICAgICAgICAgIHVubG9jaygpOyAgICAgICAgICAgIAogICAgICAgICB9CiAgICAgfQogCiAgICAgcHJpdmF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RtdElkID0gSW50ZWdlci5wYXJzZUludCh0b2tlbnNbMF0pOworICAgICAgICAgICAgLy8gZ2V0IGV4dHJhIGluZm8gYWJvdXQgdGhpcyBzdGF0ZW1lbnQsIGlmIGl0IGlzIHN0aWxsIHRvIGJlIHJlbGVhc2VkIGJ5IGNsb3NlQ2xvc2FibGUoKQorICAgICAgICAgICAgSXRlcmF0b3I8TWFwLkVudHJ5PFNRTGl0ZUNsb3NhYmxlLCBPYmplY3Q+PiBpdGVyID0gbVByb2dyYW1zLmVudHJ5U2V0KCkuaXRlcmF0b3IoKTsKKyAgICAgICAgICAgIGJvb2xlYW4gZm91bmQgPSBmYWxzZTsKKyAgICAgICAgICAgIHdoaWxlIChpdGVyLmhhc05leHQoKSkgeworICAgICAgICAgICAgICAgIE1hcC5FbnRyeTxTUUxpdGVDbG9zYWJsZSwgT2JqZWN0PiBlbnRyeSA9IGl0ZXIubmV4dCgpOworICAgICAgICAgICAgICAgIFNRTGl0ZUNsb3NhYmxlIHByb2dyYW0gPSBlbnRyeS5nZXRLZXkoKTsKKyAgICAgICAgICAgICAgICBpZiAocHJvZ3JhbSAhPSBudWxsICYmIHByb2dyYW0gaW5zdGFuY2VvZiBTUUxpdGVQcm9ncmFtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTUUxpdGVDb21waWxlZFNxbCBjb21waWxlZFNxbCA9ICgoU1FMaXRlUHJvZ3JhbSlwcm9ncmFtKS5tQ29tcGlsZWRTcWw7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29tcGlsZWRTcWwublN0YXRlbWVudCA9PSBzdG10SWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cgPSBjb21waWxlZFNxbC50b1N0cmluZygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIWZvdW5kKSB7CisgICAgICAgICAgICAgICAgLy8gdGhlIHN0YXRlbWVudCBpcyBhbHJlYWR5IHJlbGVhc2VkIGJ5IGNsb3NlQ2xvc2FibGUoKS4gaXMgaXQgd2FpdGluZyB0byBiZQorICAgICAgICAgICAgICAgIC8vIGZpbmFsaXplZD8KKyAgICAgICAgICAgICAgICBpZiAobUNsb3NlZFN0YXRlbWVudElkcy5jb250YWlucyhzdG10SWQpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgInRoaXMgc2hvdWxkbid0IGhhcHBlbi4gZmluYWxpemluZyB0aGUgc3RhdGVtZW50IG5vdzogIik7CisgICAgICAgICAgICAgICAgICAgIGNsb3NlUGVuZGluZ1N0YXRlbWVudHMoKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gdHJ5IHRvIGNsb3NlIHRoZSBkYXRhYmFzZSBhZ2FpbgorICAgICAgICAgICAgICAgICAgICBjbG9zZURhdGFiYXNlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyB0aGUgc3RhdGVtZW50IGlzIG5vdCB5ZXQgY2xvc2VkLiBtb3N0IHByb2JhYmx5IHByb2dyYW1taW5nIGVycm9yIGluIHRoZSBhcHAuCisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiZGJjbG9zZSBmYWlsZWQgZHVlIHRvIHVuLWNsb3NlKClkIFNRTCBzdGF0ZW1lbnRzOiAiICsgbXNnKTsKKyAgICAgICAgICAgICAgICB0aHJvdyBlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCiAgICAgICogTmF0aXZlIGNhbGwgdG8gY2xvc2UgdGhlIGRhdGFiYXNlLgogICAgICAqLwogICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgZGJjbG9zZSgpOwogCiAgICAgLyoqCisgICAgICogQSBjYWxsYmFjayBpbnRlcmZhY2UgZm9yIGEgY3VzdG9tIHNx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sKKyAgICAgICAgICAgIGlmIChyZWYgIT0gMCkgeworICAgICAgICAgICAgICAgIC8vIHNhdmUgYSByZWZlcmVuY2UgdG8gdGhlIGZ1bmN0aW9uIGZvciBjbGVhbnVwIGxhdGVyCisgICAgICAgICAgICAgICAgbUN1c3RvbUZ1bmN0aW9ucy5hZGQobmV3IEludGVnZXIocmVmKSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBTUUxpdGVFeGNlcHRpb24oImZhaWxlZCB0byBhZGQgY3VzdG9tIGZ1bmN0aW9uICIgKyBuYW1lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZWxlYXNlQ3VzdG9tRnVuY3Rpb25zKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1DdXN0b21GdW5jdGlvbnMpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUN1c3RvbUZ1bmN0aW9ucy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIEludGVnZXIgZnVuY3Rpb24gPSBtQ3VzdG9tRnVuY3Rpb25zLmdldChpKTsKKyAgICAgICAgICAgICAgICBuYXRpdmVfcmVsZWFzZUN1c3RvbUZ1bmN0aW9uKGZ1bmN0aW9uLmludFZhbHVlKCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUN1c3RvbUZ1bmN0aW9ucy5jbGVhcigpOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gbGlzdCBvZiBDdXN0b21GdW5jdGlvbiByZWZlcmVuY2VzIHNvIHdlIGNhbiBjbGVhbiB1cCB3aGVuIHRoZSBkYXRhYmFzZSBjbG9zZXMKKyAgICBwcml2YXRlIGZpbmFsIEFycmF5TGlzdDxJbnRlZ2VyPiBtQ3VzdG9tRnVuY3Rpb25zID0KKyAgICAgICAgICAgIG5ldyBBcnJheUxpc3Q8SW50ZWdlcj4oKTsKKworICAgIHByaX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pY3koKS5vblJlYWRGcm9tRGlzaygpOwogICAgICAgICBsb25nIHRpbWVTdGFydCA9IDA7CiAKQEAgLTEzNDksNyArMTUyOCw4IEBACiAgICAgICAgICAgICB0aW1lU3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKICAgICAgICAgfQogCi0gICAgICAgIFNRTGl0ZUN1cnNvckRyaXZlciBkcml2ZXIgPSBuZXcgU1FMaXRlRGlyZWN0Q3Vyc29yRHJpdmVyKHRoaXMsIHNxbCwgZWRpdFRhYmxlKTsKKyAgICAgICAgU1FMaXRlRGF0YWJhc2UgZGIgPSBnZXREYkNvbm5lY3Rpb24oc3FsKTsKKyAgICAgICAgU1FMaXRlQ3Vyc29yRHJpdmVyIGRyaXZlciA9IG5ldyBTUUxpdGVEaXJlY3RDdXJzb3JEcml2ZXIoZGIsIHNxbCwgZWRpdFRhYmxlKTsKIAogICAgICAgICBDdXJzb3IgY3Vyc29yID0gbnVsbDsKICAgICAgICAgdHJ5IHsKQEAgLTEzNzUsNiArMTU1NSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiPG51bGw+IikgICsgIiwgY291bnQgaXMgIiArIGNvdW50KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICByZWxlYXNlRGJDb25uZWN0aW9uKGRiKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gY3Vyc29yOwogICAgIH0KQEAgLTE1MDEsODQgKzE2ODIsNDEgQEAKICAgICAgKi8KICAgICBwdWJsaWMgbG9uZyBpbnNlcnRXaXRoT25Db25mbGljdChTdHJpbmcgdGFibGUsIFN0cmluZyBudWxsQ29sdW1uSGFjaywKICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgaW5pdGlhbFZhbHVlcywgaW50IGNvbmZsaWN0QWxnb3JpdGhtKSB7Ci0gICAgICAgIEJsb2NrR3VhcmQuZ2V0VGhyZWFkUG9saWN5KCkub25Xcml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AgICAgIHNxbC5hcHBlbmQoJygnKTsKLQotICAgICAgICAgICAgYm9vbGVhbiBuZWVkU2VwYXJhdG9yID0gZmFsc2U7Ci0gICAgICAgICAgICB3aGlsZSAoZW50cmllc0l0ZXIuaGFzTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG5lZWRTZXBhcmF0b3IpIHsKLSAgICAgICAgICAgICAgICAgICAgc3FsLmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgICAgICAgICAgdmFsdWVzLmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbmVlZFNlcGFyYXRvciA9IHRydWU7Ci0gICAgICAgICAgICAgICAgTWFwLkVudHJ5PFN0cmluZywgT2JqZWN0PiBlbnRyeSA9IGVudHJpZXNJdGVyLm5leHQoKTsKLSAgICAgICAgICAgICAgICBzcWwuYXBwZW5kKGVudHJ5LmdldEtleSgpKTsKLSAgICAgICAgICAgICAgICB2YWx1ZXMuYXBwZW5kKCc/Jyk7CisgICAgICAgIE9iamVjdFtdIGJpbmRBcmdzID0gbnVsbDsKKyAgICAgICAgaW50IHNpemUgPSAoaW5pdGlhbFZhbHVlcyAhPSBudWxsICYmIGluaXRpYWxWYWx1ZXMuc2l6ZSgpID4gMCkgPyBpbml0aWFsVmFsdWVzLnNpemUoKSA6IDA7CisgICAgICAgIGlmIChzaXplID4gMCkgeworICAgICAgICAgICAgYmluZEFyZ3MgPSBuZXcgT2JqZWN0W3NpemVdOworICAgICAgICAgICAgaW50IGkgPSAwOworICAgICAgICAgICAgZm9yIChTdHJpbmcgY29sTmFtZSA6IGluaXRpYWxWYWx1ZXMua2V5U2V0KCkpIHsKKyAgICAgICAgICAgICAgICBzcWwuYXBwZW5kKChpID4gMCkgPyAiLCIgOiAiIik7CisgICAgICAgICAgICAgICAgc3FsLmFwcGVuZChjb2xOYW1lKTsKKyAgICAgICAgICAgICAgICBiaW5kQXJnc1tpKytdID0gaW5pdGlhbFZhbHVlcy5nZXQoY29sTmFtZSk7CiAgICAgICAgICAgICB9Ci0KICAgICAgICAgICAgIHNxbC5hcHBlbmQoJyknKTsKKyAgICAgICAgICAgIHNxbC5hcHBlbmQoIiBWQUxVRVMgKCIpOworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHNpemU7IGkrKykgeworICAgICAgICAgICAgICAgIHNxbC5hcHBlbmQoKGkgPiAwKSA/ICIsPyIgOiAiPyIpOworICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgc3FsLmFwcGVuZCgiKCIgKyBudWxsQ29sdW1uSGFjayArICIpICIpOwotICAgICAgICAgICAgdmFsdWVzLmFwcGVuZCgiTlVMTCIpOworICAgICAgICAgICAgc3FsLmFwcGVuZChudWxsQ29sdW1uSGFjayArICIpIFZBTFVFUyAoTlVMTCIpOwogICAgICAgICB9CisgICAgICAgIHNxbC5hcHBlbmQoJyknKTsKIAotICAgICAgICBzcWwuYXBwZW5kKCIgVkFMVUVTKCIpOwotICAgICAgICBzcWwuYXBwZW5kKHZhbHVlcyk7Ci0gICAgICAgIHNxbC5hcHBlbmQoIik7Iik7Ci0KLSAgICAgICAgbG9jaygpOwotICAgICAgICBTUUxpdGVTdGF0ZW1lbnQgc3RhdGVtZW50ID0gbnVsbDsKKyAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0YXRlbWVudCA9IG5ldyBTUUxpdGVTdGF0ZW1lbnQodGhpcywgc3FsLnRvU3RyaW5nKCksIGJpbmRBcmdzKTsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHN0YXRlbWVudCA9IGNvbXBpbGVTdGF0ZW1lbnQoc3FsLnRvU3RyaW5nKCkpOwotCi0gICAgICAgICAgICAvLyBCaW5kIHRoZSB2YWx1ZXMKLSAgICAgICAgICAgIGlmIChlbnRyeVNldCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaW50IHNpemUgPSBlbnRyeVNldC5zaXplKCk7Ci0gICAgICAgICAgICAgICAgSXRlcmF0b3I8TWFwLkVudHJ5PFN0cmluZywgT2JqZWN0Pj4gZW50cmllc0l0ZXIgPSBlbnRyeVNldC5pdGVyYXRvcigpOwotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIE1hcC5FbnRyeTxTdHJpbmcsIE9iamVjdD4gZW50cnkgPSBlbnRyaWVzSXRlci5uZXh0KCk7Ci0gICAgICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuYmluZE9iamVjdFRvUHJvZ3JhbShzdGF0ZW1lbnQsIGkgKyAxLCBlbnRyeS5nZXRWYWx1ZSgpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIFJ1biB0aGUgcHJvZ3JhbSBhbmQgdGhlbiBjbGVhbnVwCi0gICAgICAgICAgICBzdGF0ZW1lbnQuZXhlY3V0ZSgpOwotCi0gICAgICAgICAgICBsb25nIGluc2VydGVkUm93SWQgPSBsYXN0SW5zZXJ0Um93KCk7Ci0gICAgICAgICAgICBpZiAoaW5zZXJ0ZWRSb3dJZCA9PSAtMSkgewotICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIGluc2VydGluZyAiICsgaW5pdGlhbFZhbHVlcyArICIgdXNpbmcgIiArIHNxbCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HRCAmJiBMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJJbnNlcnRpbmcgcm93ICIgKyBpbnNlcnRlZFJvd0lkICsgIiBmcm9tICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGluaXRpYWxWYWx1ZXMgKyAiIHVzaW5nICIgKyBzcWwpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgIC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ICAgICghVGV4dFV0aWxzLmlzRW1wdHkod2hlcmVDbGF1c2UpID8gIiBXSEVSRSAiICsgd2hlcmVDbGF1c2UgOiAiIiksIHdoZXJlQXJncyk7CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBzdGF0ZW1lbnQgPSBjb21waWxlU3RhdGVtZW50KCJERUxFVEUgRlJPTSAiICsgdGFibGUKLSAgICAgICAgICAgICAgICAgICAgKyAoIVRleHRVdGlscy5pc0VtcHR5KHdoZXJlQ2xhdXNlKQotICAgICAgICAgICAgICAgICAgICA/ICIgV0hFUkUgIiArIHdoZXJlQ2xhdXNlIDogIiIpKTsKLSAgICAgICAgICAgIGlmICh3aGVyZUFyZ3MgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGludCBudW1BcmdzID0gd2hlcmVBcmdzLmxlbmd0aDsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bUFyZ3M7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmJpbmRPYmplY3RUb1Byb2dyYW0oc3RhdGVtZW50LCBpICsgMSwgd2hlcmVBcmdzW2ldKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdGF0ZW1lbnQuZXhlY3V0ZSgpOwotICAgICAgICAgICAgcmV0dXJuIGxhc3RDaGFuZ2VDb3VudCgpOworICAgICAgICAgICAgcmV0dXJuIHN0YXRlbWVudC5leGVjdXRlVXBkYXRlRGVsZXRlKCk7CiAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZURhdGFiYXNlQ29ycnVwdEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICBvbkNvcnJ1cHRpb24oKTsKICAgICAgICAgICAgIHRocm93IGU7CiAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICBpZiAoc3RhdGVtZW50ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBzdGF0ZW1lbnQuY2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h3aGVyZUNsYXVzZSkpIHsKICAgICAgICAgICAgIHNxbC5hcHBlbmQoIiBXSEVSRSAiKTsKICAgICAgICAgICAgIHNxbC5hcHBlbmQod2hlcmVDbGF1c2UpOwogICAgICAgICB9CiAKLSAgICAgICAgbG9jaygpOwotICAgICAgICBpZiAoIWlzT3BlbigpKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJkYXRhYmFzZSBub3Qgb3BlbiIpOwotICAgICAgICB9Ci0gICAgICAgIFNRTGl0ZVN0YXRlbWVudCBzdGF0ZW1lbnQgPSBudWxsOworICAgICAgICBTUUxpdGVTdGF0ZW1lbnQgc3RhdGVtZW50ID0gbmV3IFNRTGl0ZVN0YXRlbWVudCh0aGlzLCBzcWwudG9TdHJpbmcoKSwgYmluZEFyZ3MpOwogICAgICAgICB0cnkgewotICAgICAgICAgICAgc3RhdGVtZW50ID0gY29tcGlsZVN0YXRlbWVudChzcWwudG9TdHJpbmcoKSk7Ci0KLSAgICAgICAgICAgIC8vIEJpbmQgdGhlIHZhbHVlcwotICAgICAgICAgICAgaW50IHNpemUgPSBlbnRyeVNldC5zaXplKCk7Ci0gICAgICAgICAgICBlbnRyaWVzSXRlciA9IGVudHJ5U2V0Lml0ZXJhdG9yKCk7Ci0gICAgICAgICAgICBpbnQgYmluZEFyZyA9IDE7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNpemU7IGkrKykgewotICAgICAgICAgICAgICAgIE1hcC5FbnRyeTxTdHJpbmcsIE9iamVjdD4gZW50cnkgPSBlbnRyaWVzSXRlci5uZXh0KCk7Ci0gICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5iaW5kT2JqZWN0VG9Qcm9ncmFtKHN0YXRlbWVudCwgYmluZEFyZywgZW50cnkuZ2V0VmFsdWUoKSk7Ci0gICAgICAgICAgICAgICAgYmluZEFyZysrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAod2hlcmVBcmdzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBzaXplID0gd2hlcmVBcmdzLmxlbmd0aDsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNpemU7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBzdGF0ZW1lbnQuYmluZFN0cmluZyhiaW5kQXJnLCB3aGVyZUFyZ3NbaV0pOwotICAgICAgICAgICAgICAgICAgICBiaW5kQXJnKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBSdW4gdGhlIHByb2dyYW0gYW5kIHRoZW4gY2xlYW51cAotICAgICAgICAgICAgc3RhdGVtZW50LmV4ZWN1dGUoKTsKLSAgICAgICAgICAgIGludCBudW1DaGFuZ2VkUm93cyA9IGxhc3RDaGFuZ2VDb3VudCgpOwotICAgICAgICAgICAgaWYgKENvbmZpZy5MT0dEICYmIExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7Ci0gICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiVXBkYXRlZCAiICsgbnVtQ2hhbmdlZFJvd3MgKyAiIHVzaW5nICIgKyB2YWx1ZXMgKyAiIGFuZCAiICsgc3FsKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBudW1DaGFuZ2VkUm93czsKKyAgICAgICAgICAgIHJldHVybiBzdGF0ZW1lbnQuZXhlY3V0ZVVwZGF0ZURlbGV0ZSgpOwogICAgICAgICB9IGNhdGNoIChTUUxpdGVEYXRhYmFzZUNvcnJ1cHRFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgb25Db3JydXB0aW9uKCk7CiAgICAgICAgICAgICB0aHJvdyBlOwotICAgICAgICB9IGNhdGNoIChTUUxFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgdXBkYXRpbmcgIiArIHZhbHVlcyArICIgdXNpbmcgIiArIH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AgKiBGb3IgVVBEQVRFIHN0YXRlbWVudHMsIHVzZSBhbnkgb2YgdGhlIGZvbGxvd2luZyBpbnN0ZWFkLgorICAgICAqIDx1bD4KKyAgICAgKiAgIDxsaT57QGxpbmsgI3VwZGF0ZShTdHJpbmcsIENvbnRlbnRWYWx1ZXMsIFN0cmluZywgU3RyaW5nW10pfTwvbGk+CisgICAgICogICA8bGk+e0BsaW5rICN1cGRhdGVXaXRoT25Db25mbGljdChTdHJpbmcsIENvbnRlbnRWYWx1ZXMsIFN0cmluZywgU3RyaW5nW10sIGludCl9PC9saT4KKyAgICAgKiA8L3VsPgorICAgICAqIDxwPgorICAgICAqIEZvciBERUxFVEUgc3RhdGVtZW50cywgdXNlIGFueSBvZiB0aGUgZm9sbG93aW5nIGluc3RlYWQuCisgICAgICogPHVsPgorICAgICAqICAgPGxpPntAbGluayAjZGVsZXRlKFN0cmluZywgU3RyaW5nLCBTdHJpbmdbXSl9PC9saT4KKyAgICAgKiA8L3VsPgorICAgICAqIDxwPgorICAgICAqIEZvciBleGFtcGxlLCB0aGUgZm9sbG93aW5nIGFyZSBnb29kIGNhbmRpZGF0ZXMgZm9yIHVzaW5nIHRoaXMgbWV0aG9kOgorICAgICAqIDx1bD4KKyAgICAgKiAgIDxsaT5BTFRFUiBUQUJMRTwvbGk+CisgICAgICogICA8bGk+Q1JFQVRFIG9yIERST1AgdGFibGUgLyB0cmlnZ2VyIC8gdmlldyAvIGluZGV4IC8gdmlydHVhbCB0YWJsZTwvbGk+CisgICAgICogICA8bGk+UkVJTkRFWDwvbGk+CisgICAgICogICA8bGk+UkVMRUFTRTwvbGk+CisgICAgICogICA8bGk+U0FWRVBPSU5UPC9saT4KKyAgICAgKiAgIDxsaT5QUkFHTUEgdGhhdCByZXR1cm5zIG5vIGRhdGE8L2xpPgorICAgICAqIDwvdWw+CisgICAgICogPC9wPgorICAgICAqIDxwPgorICAgICAqIFdoZW4gdXNpbmcge0BsaW5rICNlbmFibGVXcml0ZUFoZWFk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GVEYXRhYmFzZUNvcnJ1cHRFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgb25Db3JydXB0aW9uKCk7CiAgICAgICAgICAgICB0aHJvdyBlOwogICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgaWYgKHN0YXRlbWVudCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgc3RhdGVtZW50LmNsb3NlKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB1bmxvY2soKTsKKyAgICAgICAgICAgIHN0YXRlbWVudC5jbG9zZSgpOwogICAgICAgICB9CiAgICAgICAgIGxvZ1RpbWVTdGF0KHNxbCwgdGltZVN0YXJ0KTsKKyAgICAgICAgcmV0dXJuIG47CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCi0gICAgcHJvdGVjdGVkIHZvaWQgZmluYWxpemUoKSB7Ci0gICAgICAgIGlmIChpc09wZW4oKSkgewotICAgICAgICAgICAgTG9nLmUoVEFHLCAiY2xvc2UoKSB3YXMgbmV2ZXIgZXhwbGljaXRseSBjYWxsZWQgb24gZGF0YWJhc2UgJyIgKwotICAgICAgICAgICAgICAgICAgICBtUGF0aCArICInICIsIG1TdGFja1RyYWNlKTsKLSAgICAgICAgICAgIGNsb3NlQ2xvc2FibGUoKTsKLSAgICAgICAgICAgIG9uQWxsUmVmZXJlbmNlc1JlbGVhc2VkKCk7CisgICAgcHJvdGVjdGVkIHZvaWQgZmluYWxpemUoKSB0aHJvd3MgVGhyb3dhYmxlIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChpc09wZW4oKSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImNsb3NlKCkgd2FzIG5ldmVyIGV4cGxpY2l0bHkgY2FsbGVkIG9uIGRhdGFiYXNlICciICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1QYXRoICsgIicgIiwgbVN0YWNrVHJhY2UpOworICAgICAgICAgICAgICAgIGNsb3NlQ2xvc2FibGUoKTsKKyAg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+PSBzUXVlcnlMb2dUaW1lSW5NaWxsaXMpIHsKICAgICAgICAgICAgIHNhbXBsZVBlcmNlbnQgPSAxMDA7Ci0gICAgICAgIH0gZWxzZSB7OworICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgc2FtcGxlUGVyY2VudCA9IChpbnQpICgxMDAgKiBkdXJhdGlvbk1pbGxpcyAvIHNRdWVyeUxvZ1RpbWVJbk1pbGxpcykgKyAxOwogICAgICAgICAgICAgaWYgKG1SYW5kb20ubmV4dEludCgxMDApID49IHNhbXBsZVBlcmNlbnQpIHJldHVybjsKICAgICAgICAgfQpAQCAtMTk3MCw2NiArMjA4NSw2NyBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgLyoKLSAgICAgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgICoKLSAgICAgKiAgICAgICBUaGUgZm9sbG93aW5nIG1ldGhvZHMgZGVhbCB3aXRoIGNvbXBpbGVkLXNxbCBjYWNoZQotICAgICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovIHZvaWQgdmVyaWZ5RGJJc09wZW4oKSB7CisgICAgICAgIGlmICghaXNPcGVuKCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImRhdGFiYXNlICIgKyBnZXRQYXRoKCkgKyAiIChjb25uIyAiICsKKyAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3Rpb25OdW0gKyAiKSBhbHJlYWR5IGNsb3NlZCIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyB2b2lkIHZlcmlmeUxvY2tPd25lcigpIHsKKyAgICAgICAgdmVyaWZ5RGJJc09wZW4oKTsKKyAgICAgICAga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ZUNvbXBpbGVkU3FsIGNvbXBpbGVkU3RhdGVtZW50KSB7Ci0gICAgICAgIGlmIChtTWF4U3FsQ2FjaGVTaXplID09IDApIHsKLSAgICAgICAgICAgIC8vIGZvciB0aGlzIGRhdGFiYXNlLCB0aGVyZSBpcyBubyBjYWNoZSBvZiBjb21waWxlZCBzcWwuCi0gICAgICAgICAgICBpZiAoU1FMaXRlRGVidWcuREVCVUdfU1FMX0NBQ0hFKSB7Ci0gICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAifE5PVCBhZGRpbmdfc3FsX3RvX2NhY2hlfCIgKyBnZXRQYXRoKCkgKyAifCIgKyBzcWwpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgU1FMaXRlQ29tcGlsZWRTcWwgY29tcGlsZWRTcWwgPSBudWxsOwogICAgICAgICBzeW5jaHJvbml6ZWQobUNvbXBpbGVkUXVlcmllcykgewogICAgICAgICAgICAgLy8gZG9uJ3QgaW5zZXJ0IHRoZSBuZXcgbWFwcGluZyBpZiBhIG1hcHBpbmcgYWxyZWFkeSBleGlzdHMKLSAgICAgICAgICAgIGNvbXBpbGVkU3FsID0gbUNvbXBpbGVkUXVlcmllcy5nZXQoc3FsKTsKLSAgICAgICAgICAgIGlmIChjb21waWxlZFNxbCAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAobUNvbXBpbGVkUXVlcmllcy5jb250YWluc0tleShzcWwpKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gYWRkIHRoaXMgPHNxbCwgY29tcGlsZWRTdGF0ZW1lbnQ+IHRvIHRoZSBjYWNoZQotICAgICAgICAgICAgaWYgKG1Db21waWxlZFF1ZXJpZXMuc2l6ZSgpID09IG1NYXhTcWxDYWNoZVNpemUpIHsKKworICAgICAgICAgICAgaW50IG1heENhY2hlU3ogPSAobUNvbm5lY3Rpb25OdW0gPT0gMCkgPyBtTWF4U3FsQ2FjaGVTaXplIDoKKyAgICAgICAgICAgICAgICAgICAgbVBhcmVudENvbm5PYmoubU1heFNxbENhY2hlU2l6ZTsKKyAgICAgICAgICAgIGJvb2xlYW4gcHJpbnRXYXJuaW5nID0KKyAgICAgICAgICAgICAgICAgICAgKG1Db25uZWN0aW9uTnVtID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAoIW1DYWNoZUZ1bGxXYXJuaW5nICYmIG1Db21waWxlZFF1ZXJpZXMuc2l6ZSgpID09IG1heENhY2hlU3opCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIW1QYXJlbnRDb25uT2JqLm1DYWNoZUZ1bGxXYXJuaW5nICYmIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBhcmVudENvbm5PYmoubUNvbXBpbGVkUXVlcmllcy5zaXplKCkgPT0gbWF4Q2FjaGVTeik7CisgICAgICAgICAgIGlmIChwcmludFdhcm5pbmcpIHsKICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAqIGNhY2hlIHNpemUgb2Yge0BsaW5rICNtTWF4U3FsQ2FjaGVTaXplfSBpcyBub3QgZW5vdWdoIGZvciB0aGlzIGFwcC4KLSAgICAgICAgICAgICAgICAgKiBsb2cgYSB3YXJuaW5nIE1BWF9XQVJOSU5HU19PTl9DQUNIRVNJWkVfQ09ORElUSU9OIHRpbWVzCi0gICAgICAgICAgICAgICAgICogY2hhbmNlcyBhcmUgaXQgaXMgTk9UIHVzaW5nID8gZm9yIGJpbmRhcmdzIC0gc28gY2FjaGluZyBpcyB1c2VsZXNzLgotICAgICAgICAgICAgICAgICAqIFRPRE86IGVpdGhlciBsZXQgdGhlIGNhbGxlcnMgc2V0IG1heCBjY2hlc2l6ZSBmb3IgdGhlaXIgYXBwLCBvciBpbnRlbGxpZ2VudGx5Ci0gICAgICAgICAgICAgICAgICogZmlndXJlIG91dCB3aGF0IHNob3VsZCBiZSBjYWNoZWQgZm9yIGEgZ2l2ZW4gYXBwLgorICAgICAgICAgICAgICAgICAqIGxvZyBhIHdhcm5pbmcuCisgICAgICAgICAgICAgICAgICogY2hhbmNlcyBhcmUgaXQgaXMgTk9UIHVzaW5nID8gZm9yIGJpbmRhcmdzIC0gb3IgY2FjaGVzaXplIGlzIHRvbyBzbWFsbC4KICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBpZiAoKyttQ2FjaGVGdWxsV2FybmluZ3MgPT0gTUFYX1dBUk5JTkdTX09OX0NBQ0hFU0laRV9DT05ESVRJT04pIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiUmVhY2hlZCBNQVggc2l6ZSBmb3IgY29tcGlsZWQtc3FsIHN0YXRlbWVudCBjYWNoZSBmb3IgZGF0YWJhc2UgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0UGF0aCgpICsgIjsgaS5lLiwgTk8gc3BhY2UgZm9yIHRoaXMgc3FsIHN0YXRlbWVudCBpbiBjYWNoZTogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3FsICsgIi4gUGxlYXNlIGNoYW5nZSB5b3VyIHNxbCBzdGF0ZW1lbnRzIHRvIHVzZSAnPycgZm9yICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJiaW5kYXJncywgaW5zdGVhZCBvZiB1c2luZyBhY3R1YWwgdmFsdWVzIik7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiUmVhY2hlZCBNQVggc2l6ZSBmb3IgY29tcGlsZWQtc3FsIHN0YXRlbWVudCBjYWNoZSBmb3IgZGF0YWJhc2UgIiArCisgICAgICAgICAgICAgICAgICAgICAgICBnZXRQYXRoKCkgKyAiLiBVc2Ugc2V0TWF4U3FsQ2FjaGVTaXplKCkgdG8gaW5jcmVhc2UgY2FjaGVzaXplLiAiKTsKKyAgICAgICAgICAgICAgICBtQ2FjaGVGdWxsV2FybmluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgLy8gU1RPUFNISVAgZW5jbG9zZSB0aGUgZm9sbG93aW5nIHdhcm5pbmdzIHdpdGggImlmIChTUUxpdGVEZWJ1Zy5ERUJVR19TUUxfQ0FDSEUpIgorICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIkhlcmUgYXJlIHRoZSBTUUwgc3RhdGVtZW50cyBpbiBDYWNoZSBvZiBkYXRhYmFzZTogIiArIG1QYXRoKTsKKyAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBzIDogbUNvbXBpbGVkUXVlcmllcy5rZXlTZXQoKSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJTcWwgc3RhbWVudCBpbiBDYWNoZTogIiArIHMpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvLyBkb24ndCBhZGQgdGhpcyBlbnRyeSB0byBjYWNoZQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBjYWNoZSBpcyBOT1QgZnVsbC4gYWRkIHRoaXMgdG8gY2FjaGUuCi0gICAgICAgICAgICAgICAgbUNvbXBpbGVkUXVlcmllcy5wdXQoc3FsLCBjb21waWxlZFN0YXRlbWVudCk7Ci0gICAgICAgICAgICAgICAgaWYgKFNRTGl0ZURlYnVnLkRFQlVHX1NRTF9DQUNIRSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ8YWRkaW5nX3NxbF90b19jYWNoZXwiICsgZ2V0UGF0aCgpICsgInwiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29tcGlsZWRRdWVyaWVzLnNpemUoKSArICJ8IiArIHNxbCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQorICAgICAgICAgICAgfSAKKyAgICAgICAgICAgIC8qIGFkZCB0aGUgZ2l2ZW4gU1FMaXRlQ29tcGlsZWRTcWwgY29tcGlsZWRTdGF0ZW1lbnQgdG8gY2FjaGUuCisgICAgICAgICAgICAgKiB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3RhdGVtZW50LWlkIGZvciB0aGUgZ2l2ZW4gU1FMLgorICAgICAqIFJldHVybnMgbnVsbCwgaWYgbm90IGZvdW5kIGluIHRoZSBjYWNoZS4KICAgICAgKi8KICAgICAvKiBwYWNrYWdlICovIFNRTGl0ZUNvbXBpbGVkU3FsIGdldENvbXBpbGVkU3RhdGVtZW50Rm9yU3FsKFN0cmluZyBzcWwpIHsKLSAgICAgICAgU1FMaXRlQ29tcGlsZWRTcWwgY29tcGlsZWRTdGF0ZW1lbnQgPSBudWxsOwotICAgICAgICBib29sZWFuIGNhY2hlSGl0OwotICAgICAgICBzeW5jaHJvbml6ZWQobUNvbXBpbGVkUXVlcmllcykgewotICAgICAgICAgICAgaWYgKG1NYXhTcWxDYWNoZVNpemUgPT0gMCkgewotICAgICAgICAgICAgICAgIC8vIGZvciB0aGlzIGRhdGFiYXNlLCB0aGVyZSBpcyBubyBjYWNoZSBvZiBjb21waWxlZCBzcWwuCi0gICAgICAgICAgICAgICAgaWYgKFNRTGl0ZURlYnVnLkRFQlVHX1NRTF9DQUNIRSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ8Y2FjaGUgTk9UIGZvdW5kfCIgKyBnZXRQYXRoKCkpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgc3luY2hyb25pemVkIChtQ29tcGlsZWRRdWVyaWVzKSB7CisgICAgICAgICAgICBTUUxpdGVDb21waWxlZFNxbCBjb21waWxlZFN0YXRlbWVudCA9IG1Db21waWxlZFF1ZXJpZXMuZ2V0KHNxbCk7CisgICAgICAgICAgICBpZiAoY29tcGlsZWRTdGF0ZW1lbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1OdW1DYWNoZU1pc3NlcysrOwogICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FjaGVIaXQgPSAoY29tcGlsZWRTdGF0ZW1lbnQgPSBtQ29tcGlsZWRRdWVyaWVzLmdldChzcWwpKSAhPSBudWxsOwotICAgICAgICB9Ci0gICAgICAgIGlmIChjYWNoZUhpdCkgewogICAgICAgICAgICAgbU51bUNhY2hlSGl0cysrOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbU51bUNhY2hlTWlzc2VzKys7CisgICAgICAgICAgICByZXR1cm4gY29tcGlsZWRTdGF0ZW1lbnQ7CiAgICAgICAgIH0KLQotICAgICAgICBpZiAoU1FMaXRlRGVidWcuREVCVUdfU1FMX0NBQ0hFKSB7Ci0gICAgICAgICAgICBMb2cudihUQUcsICJ8Y2FjaGVfc3RhdHN8IiArCi0gICAgICAgICAgICAgICAgICAgIGdldFBhdGgoKSArICJ8IiArIG1Db21waWxlZFF1ZXJpZXMuc2l6ZSgpICsKLSAgICAgICAgICAgICAgICAgICAgInwiICsgbU51bUNhY2hlSGl0cyArICJ8IiArIG1OdW1DYWNoZU1pc3NlcyArCi0gICAgICAgICAgICAgICAgICAgICJ8IiArIGNhY2hlSGl0ICsgInwiICsgbVRpbWVPcGVuZWQgKyAifCIgKyBtVGltZUNsb3NlZCArICJ8IiArIHNxbCk7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGNvbXBpbGVkU3RhdGVtZW50OwogICAgIH0KIAogICAgIC8qKgotICAgICAqIHJldHVybnMgdHJ1ZSBpZiB0aGUgZ2l2ZW4gc3FsIGlzIGNhY2hlZCBpbiBjb21waWxlZC1zcWwgY2FjaGUuCi0gICAgICogQGhpZGUKKyAgICAgKiBTZXRzIHRoZSBtYXhpbXVtIHNpemUgb2YgdGhlIHByZXBhcmVkLXN0YXRlbWVudCBjYWNoZSBmb3IgdGhpcyBkYXRhYmFzZS4KKyAgICAgKiAoc2l6ZSBvZiB0aGUgY2FjaGUgPSBudW1iZXIgb2YgY29tcGlsZWQtc3FsLXN0YXRlbWVudHMgc3RvcmVkIGluIHRoZSBjYWNoZSkuCisgICAgICo8cD4KKyAgICAgKiBNYXhpbXVtIGNhY2hlIHNpemUgY2FuIE9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ICAgICAgfSBlbHNlIGlmIChjYWNoZVNpemUgPCBtTWF4U3FsQ2FjaGVTaXplKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiY2Fubm90IHNldCBjYWNoZVNpemUgdG8gYSB2YWx1ZSBsZXNzIHRoYW4gdGhlIHZhbHVlICIgKworICAgICAgICAgICAgICAgICAgICAgICAgInNldCB3aXRoIHByZXZpb3VzIHNldE1heFNxbENhY2hlU2l6ZSgpIGNhbGwuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTWF4U3FsQ2FjaGVTaXplID0gY2FjaGVTaXplOworICAgICAgICB9CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyBib29sZWFuIGlzSW5TdGF0ZW1lbnRDYWNoZShTdHJpbmcgc3FsKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobUNvbXBpbGVkUXVlcmllcykgewogICAgICAgICAgICAgcmV0dXJuIG1Db21waWxlZFF1ZXJpZXMuY29udGFpbnNLZXkoc3FsKTsKICAgICAgICAgfQogICAgIH0KIAotICAgIC8qKgotICAgICAqIHB1cmdlcyB0aGUgZ2l2ZW4gc3FsIGZyb20gdGhlIGNvbXBpbGVkLXNxbCBjYWNoZS4KLSAgICAgKiBAaGlkZQotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHB1cmdlRnJvbUNvbXBpbGVkU3FsQ2FjaGUoU3RyaW5nIHNxbCkgeworICAgIC8qIHBhY2thZ2UgKi8gdm9pZCByZWxlYXNlQ29tcGlsZWRTcWxPYmooU1FMaXRlQ29tcGlsZWRTcWwgY29tcGlsZWRTcWwpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtQ29tcGlsZWRRdWVyaWVzKSB7CisgICAgICAgICAgICBpZiAobUNvbXBpbGVkUXVlcmllcy5jb250YWluc1ZhbHVlKGNvbXBpbGVkU3FsKSkgeworICAgICAgICAgICAgICAgIC8vIGl0IGlzIGluIGNhY2hlIC0gcmVzZXQgaXRzIGluVXNlIGZsYWcKKyAgICAgICAgICAgICAgICBjb21waWxlZFNxbC5yZWxlYXNlKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIGl0IGlzIE5PVCBpbiBjYWNoZS4gZmluYWxpemUgaXQuCisgICAgICAgICAgICAgICAgY29tcGlsZWRTcWwucmVsZWFzZVNxbFN0YXRlbWVudCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgZ2V0Q2FjaGVIaXROdW0oKSB7CiAgICAgICAgIHN5bmNocm9uaXplZChtQ29tcGlsZWRRdWVyaWVzKSB7Ci0gICAgICAgICAgICBtQ29tcGlsZWRRdWVyaWVzLnJlbW92ZShzcWwpOworICAgICAgICAgICAgcmV0dXJuIG1OdW1DYWNoZUhpdHM7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICAvKioKLSAgICAgKiByZW1vdmUgZXZlcnl0aGluZyBmcm9tIHRoZSBjb21waWxlZCBzcWwgY2FjaGUKLSAgICAgKiBAaGlkZQotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHJlc2V0Q29tcGlsZWRTcWxDYWNoZSgpIHsKKyAgICBwcml2YXRlIGludCBnZXRDYWNoZU1pc3NOdW0oKSB7CiAgICAgICAgIHN5bmNocm9uaXplZChtQ29tcGlsZWRRdWVyaWVzKSB7Ci0gICAgICAgICAgICBtQ29tcGlsZWRRdWVyaWVzLmNsZWFyKCk7CisgICAgICAgICAgICByZXR1cm4gbU51bUNhY2hlTWlzc2VzOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgZ2V0Q2FjaGVzaXplKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQobUNvbXBpbGVkUXVlcmllcykgeworICAgICAgICAgICAgcmV0dXJuIG1Db21waWxlZFF1ZXJpZXMuc2l6ZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyB2b2lkIGZpbmFsaXplU3RhdGVtZW50TGF0ZXIoaW50IGlkKSB7CisgICAgICAgIGlmICghaXNPcGVuKCkpIHsKKyAgICAgICAgICAgIC8vIGRhdGFiYXNlIGFscmVhZHkgY2xvc2VkLiB0aGlzIHN0YXRlbWVudCB3aWxsIGFscmVhZHkgaGF2ZSBiZWVuIGZpbmFsaXplZC4KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBzeW5jaHJvbml6ZWQobUNsb3NlZFN0YXRlbWVudElkcykgeworICAgICAgICAgICAgaWYgKG1DbG9zZWRTdGF0ZW1lbnRJZHMuY29udGFpbnMoaWQpKSB7CisgICAgICAgICAgICAgICAgLy8gdGhpcyBzdGF0ZW1lbnQgaWQgaXMgYWxyZWFkeSBxdWV1ZWQgdXAgZm9yIGZpbmFsaXphdGlvbi4KKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtQ2xvc2VkU3RhdGVtZW50SWRzLmFkZChpZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBwYWNrYWdlICovIHZvaWQgY2xvc2VQZW5kaW5nU3RhdGVtZW50cygpIHsKKyAgICAgICAgaWYgKCFpc09wZW4oKSkgeworICAgICAgICAgICAgLy8gc2luY2UgdGhpcyBkYXRhYmFzZSBpcyBhbHJlYWR5IGNsb3NlZCwgbm8gbmVlZCB0byBmaW5hbGl6ZSBhbnl0aGluZy4KKyAgICAgICAgICAgIG1DbG9zZWRTdGF0ZW1lbnRJZHMuY2xlYXIoKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICB2ZXJpZnlMb2NrT3duZXIoKTsKKyAgICAgICAgLyogdG8gbWluaW1pemUgc3luY2hyb25pemF0aW9uIG9uIG1DbG9zZWRTdGF0ZW1lbnRJZHMsIG1ha2UgYSBjb3B5IG9mIHRoZSBsaXN0ICovCisgICAgICAgIEFycmF5TGlzdDxJbnRlZ2VyPiB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BMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAidGhpcyBkYXRhYmFzZTogIiArIG1QYXRoICsgIiBoYXMgYXR0YWNoZWQgZGF0YWJhc2VzLiBjYW4ndCAgZW5hYmxlIFdBTC4iKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUNvbm5lY3Rpb25Qb29sID0gbmV3IERhdGFiYXNlQ29ubmVjdGlvblBvb2wodGhpcyk7CisgICAgICAgICAgICBzZXRKb3VybmFsTW9kZShtUGF0aCwgIldBTCIpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICB1bmxvY2soKTsKICAgICAgICAgfQotICAgICAgICBtTWF4U3FsQ2FjaGVTaXplID0gY2FjaGVTaXplOwogICAgIH0KIAotICAgIHN0YXRpYyBjbGFzcyBBY3RpdmVEYXRhYmFzZXMgewotICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBBY3RpdmVEYXRhYmFzZXMgYWN0aXZlRGF0YWJhc2VzID0gbmV3IEFjdGl2ZURhdGFiYXNlcygpOwotICAgICAgICBwcml2YXRlIEhhc2hTZXQ8V2Vha1JlZmVyZW5jZTxTUUxpdGVEYXRhYmFzZT4+IG1BY3RpdmVEYXRhYmFzZXMgPQotICAgICAgICAgICAgbmV3IEhhc2hTZXQ8V2Vha1JlZmVyZW5jZTxTUUxpdGVEYXRhYmFzZT4+KCk7Ci0gICAgICAgIHByaXZhdGUgQWN0aXZlRGF0YWJhc2VzKCkge30gLy8gZGlzYWJsZSBpbnN0YW50aWF0aW9uIG9mIHRoaXMgY2xhc3MKLSAgICAgICAgc3RhdGljIEFjdGl2ZURhdGFiYXNlcyBnZXRJbnN0YW5jZSgpIHtyZXR1cm4gYWN0aXZlRGF0YWJhc2VzO30KKyAgICAvKioKKyAgICAgKiBUaGlzIG1ldGhvZCBkaXNhYmxlcyB0aGUgZmVhdHVyZXMgZW5hYmxlZCBieSB7QGxpbmsgI2VuYWJsZVdyaXRlQWhlYWRMb2dnaW5nKCl9LgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgZGlzYWJsZVdyaXRlQWhlYWRMb2dnaW5nKCkgeworICAgICAgICAvLyBncmFiIGRhdGFiYXNlIGxvY2sgc28gdGhhdCB3cml0ZUFoZWFkTG9nZ2luZyBpcyBub3QgZGlzYWJsZWQgZnJvbSAyIGRpZmZlcmVudCB0aHJlYWRzCisgICAgICAgIC8vIGF0IHRoZSBzYW1lIHRpbWUKKyAgICAgICAgbG9jaygpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKG1Db25uZWN0aW9uUG9vbCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOyAvLyBhbHJlYWR5IGRpc2FibGVkCisgICAgICAgICAgICB9CisgICAgICAgICAgICBtQ29ubmVjdGlvblBvb2wuY2xvc2UoKTsKKyAgICAgICAgICAgIHNldEpvdXJuYWxNb2RlKG1QYXRoLCAiVFJVTkNBVEUiKTsKKyAgICAgICAgICAgIG1Db25uZWN0aW9uUG9vbCA9IG51bGw7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICB1bmxvY2soKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8gU1FMaXRlRGF0YWJhc2UgZ2V0RGF0YWJhc2VIYW5kbGUoU3RyaW5nIHNxbCkgeworICAgICAgICBpZiAoaXNQb29sZWRDb25uZWN0aW9uKCkpIHsKKyAgICAgICAgICAgIC8vIHRoaXMgaXMgYSBwb29sZWQgZGF0YWJhc2UgY29ubmVjdGlvbgorICAgICAgICAgICAgLy8gdXNlIGl0IGlmIGl0IGlzIG9wZW4gQU5EIGlmIEkgYW0gbm90IGN1cnJlbnRseSBwYXJ0IG9mIGEgdHJhbnNhY3Rpb24KKyAgICAgICAgICAgIGlmIChpc09wZW4oKSAmJiAhYW1JSW5UcmFuc2FjdGlvbigpKSB7CisgICAgICAgICAgICAgICAgLy8gVE9ETzogdXNlIGFub3RoZXIgY29ubmVjdGlvbiBmcm9tIHRoZSBwb29sCisgICAgICAgICAgICAgICAgLy8gaWYgdGhpcyBjb25uZWN0aW9uIGlzIGN1cnJlbnRseSBpbiB1c2UgYnkgc29tZSBvdGhlciB0aHJlYWQKKyAgICAgICAgICAgICAgICAvLyBBTkQgaWYgdGhlcmUgYXJlIGZyZWUgY29ubmVjdGlvbnMgaW4gdGhlIHBvb2wKKyAgICAgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gdGhlIHBvb2xlZCBjb25uZWN0aW9uIGlzIG5vdCBvcGVuISBjb3VsZCBoYXZlIGJlZW4gY2xvc2VkIGVpdGhlciBkdWUKKyAgICAgICAgICAgICAgICAvLyB0byBjb3JydXB0aW9uIG9uIHRoaXMgb3Igc29tZSBvdGhlciBjb25uZWN0aW9uIHRvIHRoZSBkYXRhYmFzZQorICAgICAgICAgICAgICAgIC8vIE9SLCBtYXliZSB0aGUgY29ubmVjdGlvbiBwb29sIGlzIGRpc2FibGVkIGFmdGVyIHRoaXMgY29ubmVjdGlvbiBoYXMgYmVlbgorICAgICAgICAgICAgICAgIC8vIGFsbG9jYXRlZCB0byBtZS4gdHJ5IHRvIGdldCBzb21lIG90aGVyIHBvb2xlZCBvciBtYWluIGRhdGFiYXNlIGNvbm5lY3Rpb24KKyAgICAgICAgICAgICAgICByZXR1cm4gZ2V0UGFyZW50RGJDb25uT2JqKCkuZ2V0RGJDb25uZWN0aW9uKHNxbCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyB0aGlzIGlzIE5PVCBhIHBvb2xlZCBjb25uZWN0aW9uLiBjYW4gd2Ug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SBjb25uZWN0aW9uIGhhbmRsZS4KKyAgICAgICAgLy8gaW4gdGhhdCBjYXNlLCBzaW1wbHkgcmV0dXJuICd0aGlzJyBoYW5kbGUKKyAgICAgICAgaWYgKGlzUG9vbGVkQ29ubmVjdGlvbigpKSB7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIC8vIHVzZSB0aGUgY3VycmVudCBjb25uZWN0aW9uIGhhbmRsZSBpZgorICAgICAgICAvLyAxLiBpZiB0aGUgY2FsbGVyIGlzIHBhcnQgb2YgdGhlIG9uZ29pbmcgdHJhbnNhY3Rpb24sIGlmIGFueQorICAgICAgICAvLyAyLiBPUiwgaWYgdGhlcmUgaXMgTk8gY29ubmVjdGlvbiBoYW5kbGUgcG9vbCBzZXR1cAorICAgICAgICBpZiAoYW1JSW5UcmFuc2FjdGlvbigpIHx8IG1Db25uZWN0aW9uUG9vbCA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIGdldCBhIGNvbm5lY3Rpb24gaGFuZGxlIGZyb20gdGhlIHBvb2wKKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICBhc3NlcnQgbUNvbm5lY3Rpb25Qb29sICE9IG51bGw7CisgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCBtQ29ubmVjdGlvblBvb2wudG9TdHJpbmcoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbUNvbm5lY3Rpb25Qb29sLmdldChzcWwpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlbGVhc2VEYkNvbm5lY3Rpb24oU1FMaXRlRGF0YWJhc2UgZGIpIHsKKyAgICAgICAgLy8gaWdub3JlIHRoaXMgcmVsZWFzZSBjYWxsIGlmCisgICAgICAgIC8vIDEuI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gICAgICAgICAgIGlmIChkYiA9PSBudWxsIHx8ICFkYi5pc09wZW4oKSkgewogICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gZ2V0IFNRTElURV9EQlNUQVRVU19MT09LQVNJREVfVVNFRCBmb3IgdGhlIGRiCi0gICAgICAgICAgICBpbnQgbG9va2FzaWRlVXNlZCA9IGRiLm5hdGl2ZV9nZXREYkxvb2thc2lkZSgpOwogCi0gICAgICAgICAgICAvLyBnZXQgdGhlIGxhc3Rub2RlIG9mIHRoZSBkYm5hbWUKLSAgICAgICAgICAgIFN0cmluZyBwYXRoID0gZGIuZ2V0UGF0aCgpOwotICAgICAgICAgICAgaW50IGluZHggPSBwYXRoLmxhc3RJbmRleE9mKCIvIik7Ci0gICAgICAgICAgICBTdHJpbmcgbGFzdG5vZGUgPSBwYXRoLnN1YnN0cmluZygoaW5keCAhPSAtMSkgPyArK2luZHggOiAwKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgLy8gZ2V0IFNRTElURV9EQlNUQVRVU19MT09LQVNJREVfVVNFRCBmb3IgdGhlIGRiCisgICAgICAgICAgICAgICAgaW50IGxvb2thc2lkZVVzZWQgPSBkYi5uYXRpdmVfZ2V0RGJMb29rYXNpZGUoKTsKIAotICAgICAgICAgICAgLy8gZ2V0IGxpc3Qgb2YgYXR0YWNoZWQgZGJzIGFuZCBmb3IgZWFjaCBkYiwgZ2V0IGl0cyBzaXplIGFuZCBwYWdlc2l6ZQotICAgICAgICAgICAgQXJyYXlMaXN0PFBhaXI8U3RyaW5nLCBTdHJpbmc+PiBhdHRhY2hlZERicyA9IGdldEF0dGFjaGVkRGJzKGRiKTsKLSAgICAgICAgICAgIGlmIChhdHRhY2hlZERicyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGF0dGFjaGVkRGJzLnNpemUoKTsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgUGFpcjxTdHJpbmcsIFN0cmluZz4gcCA9IGF0dGFjaGVkRGJzLmdldChpKTsKLSAgICAgICAgICAgICAgICBsb25nIHBhZ2VDb3VudCA9IGdldFByYWdtYVZhbChkYiwgcC5maXJzdCArICIucGFnZV9jb3VudDsiKTsKKyAgICAgICAgICAgICAgICAvLyBnZXQgdGhlIGxhc3Rub2RlIG9mIHRoZSBkYm5hbWUKKyAgICAgICAgICAgICAgICBTdHJpbmcgcGF0aCA9IGRiLmdldFBhdGgoKTsKKyAgICAgICAgICAgICAgICBpbnQgaW5keCA9IHBhdGgubGFzdEluZGV4T2YoIi8iKTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgbGFzdG5vZGUgPSBwYXRoLnN1YnN0cmluZygoaW5keCAhPSAtMSkgPyArK2luZHggOiAwKTsKIAotICAgICAgICAgICAgICAgIC8vIGZpcnN0IGVudHJ5IGluIHRoZSBhdHRhY2hlZCBkYiBsaXN0IGlzIGFsd2F5cyB0aGUgbWFpbiBkYXRhYmFzZQotICAgICAgICAgICAgICAgIC8vIGRvbid0IHdvcnJ5IGFib3V0IHByZWZpeGluZyB0aGUgZGJuYW1lIHdpdGggIm1haW4iCi0gICAgICAgICAgICAgICAgU3RyaW5nIGRiTmFtZTsKLSAgICAgICAgICAgICAgICBpZiAoaSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRiTmFtZSA9IGxhc3Rub2RlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGxvb2thc2lkZSBpcyBvbmx5IHJlbGV2YW50IGZvciB0aGUgbWFpbiBkYgotICAgICAgICAgICAgICAgICAgICBsb29rYXNpZGVVc2VkID0gMDsKLSAgICAgICAgICAgICAgICAgICAgZGJOYW1lID0gIiAgKGF0dGFjaGVkKSAiICsgcC5maXJzdDsKLSAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIGF0dGFjaGVkIGRiIGhhcyBhIHBhdGgsIGF0dGFjaCB0aGUgbGFzdG5vZGUgZnJvbSB0aGUgcGF0aCB0byBhYm92ZQotICAgICAgICAgICAgICAgICAgICBpZiAocC5zZWNvbmQudHJpbSgpLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlkeCA9IHAuc2Vjb25kLmxhc3RJbmRleE9mKCIvIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkYk5hbWUgKz0gIiA6ICIgKyBwLnNlY29uZC5zdWJzdHJpbmcoKGlkeCAhPSAtMSkgPyArK2lkeCA6IDApOworICAgICAgICAgICAgICAgIC8vIGdldCBsaXN0IG9mIGF0dGFjaGVkIGRicyBhbmQgZm9yIGVhY2ggZGIsIGdldCBpdHMgc2l6ZSBhbmQgcGFnZXNpemUKKyAgICAgICAgICAgICAgICBBcnJheUxpc3Q8UGFpcjxTdHJpbmcsIFN0cmluZz4+IGF0dGFjaGVkRGJzID0gZGIuZ2V0QXR0YWNoZWREYnMoKTsKKyAgICAgICAgICAgICAgICBpZiAoYXR0YWNoZWREYnMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhdHRhY2hlZERicy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBQYWlyPFN0cmluZywgU3RyaW5nPiBwID0gYXR0YWNoZWREYnMuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICBsb25nIHBhZ2VDb3VudCA9IERhdGFiYXNlVXRpbHMubG9uZ0ZvclF1ZXJ5KGRiLCAiUFJBR01BICIgKyBwLmZpcnN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLnBhZ2VfY291bnQ7IiwgbnVsbCk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gZmlyc3QgZW50cnkgaW4gdGhlIGF0dGFjaGVkIGRiIGxpc3QgaXMgYWx3YXlzIHRoZSBtYWluIGRhdGFiYXNlCisgICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IHdvcnJ5IGFib3V0IHByZWZpeGluZyB0aGUgZGJuYW1lIHdpdGggIm1haW4iCisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBkYk5hbWU7CisgICAgICAgICAgICAgICAgICAgIGlmIChpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRiTmFtZSA9IGxhc3Rub2RlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gbG9va2FzaWRlIGlzIG9ubHkgcmVsZXZhbnQgZm9yIHRoZSBtYWluIGRiCisgICAgICAgICAgICAgICAgICAgICAgICBsb29rYXNpZGVVc2VkID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRiTmFtZSA9ICIgIChhdHRhY2hlZCkgIiArIHAuZmlyc3Q7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGUgYXR0YWNoZWQgZGIgaGFzIGEgcGF0aCwgYXR0YWNoIHRoZSBsYXN0bm9kZSBmcm9tIHRoZSBwYXRoIHRvIGFib3ZlCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocC5zZWNvbmQudHJpbSgpLmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpZHggPSBwLnNlY29uZC5sYXN0SW5kZXhPZigiLyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRiTmFtZSArPSAiIDogIiArIHAuc2Vjb25kLnN1YnN0cmluZygoaWR4ICE9IC0xKSA/ICsraWR4IDogMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHBhZ2VDb3VudCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRiU3RhdHNMaXN0LmFkZChuZXcgRGJTdGF0cyhkYk5hbWUsIHBhZ2VDb3VudCwgZGIuZ2V0UGFnZVNpemUoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9va2FzaWRlVXNlZCwgZGIuZ2V0Q2FjaGVIaXROdW0oKSwgZGIuZ2V0Q2FjaGVNaXNzTnVtKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRiLmdldENhY2hlc2l6ZSgpKSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHBhZ2VDb3VudCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgZGJTdGF0c0xpc3QuYWRkKG5ldyBEYlN0YXRzKGRiTmFtZSwgcGFnZUNvdW50LCBkYi5nZXRQYWdlU2l6ZSgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvb2thc2lkZVVzZWQpKTsKKyAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSBhcmUgcG9vbGVkIGNvbm5lY3Rpb25zLCByZXR1cm4gdGhlIGNhY2hlIHN0YXRzIGZvciB0aGVtIGFsc28uCisgICAgICAgICAgICAgICAgLy8gd2hpbGUgd2UgYXJlIHRyeWluZyB0byBxdWVyeSB0aGUgcG9vbGVkIGNvbm5lY3Rpb25zIGZvciBzdGF0cywgc29tZSBvdGhlciB0aHJlYWQKKyAgICAgICAgICAgICAgICAvLyBjb3VsZCBiZSBkaXNhYmxpbmcgY29ubmVjaXRvbiBwb29sLiBzbywgZ3JhYiBhIHJlZmVyZW5jZSB0byB0aGUgY29ubmVjdGlvbiBwb29sLgorICAgICAgICAgICAgICAgIERhdGFiYXNlQ29ubmVjdGlvblBvb2wgY29ublBvb2wgPSBkYi5tQ29ubmVjdGlvblBvb2w7CisgICAgICAgICAgICAgICAgaWYgKGNvbm5Qb29sICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChTUUxpdGVEYXRhYmFzZSBwRGIgOiBjb25uUG9vbC5nZXRDb25uZWN0aW9uTGlzdCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkYlN0YXRzTGlzdC5hZGQobmV3IERiU3RhdHMoIihwb29sZWQgIyAiICsgcERiLm1Db25uZWN0aW9uTnVtICsgIikgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGxhc3Rub2RlLCAwLCAwLCAwLCBwRGIuZ2V0Q2FjaGVIaXROdW0oKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERiLmdldENhY2hlTWlzc051bSgpLCBwRGIuZ2V0Q2FjaGVzaXplKCkpKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgLy8gaWdub3JlLiB3ZSBkb24ndCBjYXJlIGFib3V0IGV4Y2VwdGlvbnMgd2hlbiB3ZSBhcmUgdGFraW5nIGFkYgorICAgICAgICAgICAgICAgIC8vIGJ1Z3JlcG9ydCEKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gZGJTdGF0c0xpc3Q7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogZ2V0IHRoZSBzcGVjaWZpZWQgcHJhZ21hIHZhbHVlIGZyb20gc3FsaXRlIGZvciB0aGUgc3BlY2lmaWVkIGRhdGFiYXNlLgotICAgICAqIG9ubHkgaGFuZGxlcyBwcmFnbWEncyB0aGF0IHJldHVybiBpbnQvbG9uZy4KLSAgICAgKiBOTyBKQVZBIGxvY2tzIGFyZSBoZWxkIGluIHRoaXMgbWV0aG9kLgotICAgICAqIFRPRE86IHVzZSB0aGlzIHRvIGRvIGFsbCBwcmFnbWEncyBpbiB0aGlzIGNsYXNzCisgICAgICogUmV0dXJucyBsaXN0IG9mIGZ1bGwgcGF0aG5hbWVzIG9mIGFsbCBhd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XNlX2xpc3Q7IiwgbnVsbCk7CisgICAgICAgICAgICB3aGlsZSAoYy5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAvLyBzcWxpdGUgcmV0dXJucyBhIHJvdyBmb3IgZWFjaCBkYXRhYmFzZSBpbiB0aGUgcmV0dXJuZWQgbGlzdCBvZiBkYXRhYmFzZXMuCisgICAgICAgICAgICAgICAgLy8gICBpbiBlYWNoIHJvdywKKyAgICAgICAgICAgICAgICAvLyAgICAgICAxc3QgY29sdW1uIGlzIHRoZSBkYXRhYmFzZSBuYW1lIHN1Y2ggYXMgbWFpbiwgb3IgdGhlIGRhdGFiYXNlCisgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lIHNwZWNpZmllZCBvbiB0aGUgIkFUVEFDSCIgY29tbWFuZAorICAgICAgICAgICAgICAgIC8vICAgICAgIDJuZCBjb2x1bW4gaXMgdGhlIGRhdGFiYXNlIGZpbGUgcGF0aC4KKyAgICAgICAgICAgICAgICBhdHRhY2hlZERicy5hZGQobmV3IFBhaXI8U3RyaW5nLCBTdHJpbmc+KGMuZ2V0U3RyaW5nKDEpLCBjLmdldFN0cmluZygyKSkpOworICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGMuY2xvc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQogICAgICAgICByZXR1cm4gYXR0YWNoZWREYnM7CiAgICAgfQogCiAgICAgLyoqCisgICAgICogUnVucyAncHJhZ21hIGludGVncml0eV9jaGVjaycgb24gdGhlIGdpdmVuIGRhdGFiYXNlIChhbmQgYWxsIHRoZSBhdHRhY2hlZCBkYXRhYmFzZXMpCisgICAgICogYW5kIHJldHVybnMgdHJ1ZSBpZiB0aGUgZ2l2ZW4gZGF0YWJhc2UgKGFuZCBhbGwgaXRzIGF0dGFjaGVkIGRhdGFiYXNlcykgcGFzcyBpbnRlZ3JpdHlfY2hlY2ssCisgICAgICogZmFsc2Ugb3RoZXJ3aXNlLgorICAgICAqPHA+CisgICAgICogSWYgdGhlIHJlc3VsdCBpcyBmYWxzZSwgdGhlbiB0aGlzIG1ldGhvZCBsb2dzIHRoZSBlcnJvcnMgcmVwb3J0ZWQgYnkgdGhlIGludGVncml0eV9jaGVjaworICAgICAqIGNvbW1hbmQgZXhlY3V0aW9uLgorICAgICAqPHA+CisgICAgICogTm90ZSB0aGF0ICdwcmFnbWEgaW50ZWdyaXR5X2NoZWNrJyBvbiBhIGRhdGFiYXNlIGNhbiB0YWtlIGEgbG9uZyB0aW1lLgorICAgICAqCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSBnaXZlbiBkYXRhYmFzZSAoYW5kIGFsbCBpdHMgYXR0YWNoZWQgZGF0YWJhc2VzKSBwYXNzIGludGVncml0eV9jaGVjaywKKyAgICAgKiBmYWxzZSBvdGhlcndpc2UuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaXNEYXRhYmFzZUludGVncml0eU9rKCkgeworICAgICAgICB2ZXJpZnlEYklzT3BlbigpOworICAgICAgICBBcnJheUxpc3Q8UGFpcjxTdHJpbmcsIFN0cmluZz4+IGF0dGFjaGVkRGJzID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGF0dGFjaGVkRGJzID0gZ2V0QXR0YWNoZWREYnMoKTsKKyAgICAgICAgICAgIGlmIChhdHRhY2hlZERicyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiZGF0YWJhc2VsaXN0IGZvcjogIiArIGdldFBhdGgoKSArICIgY291bGRuJ3QgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAiYmUgcmV0cmlldmVkLiBwcm9iYWJseSBiZWNhdXNlIHRoZSBkYXRhYmFzZSBpcyBjbG9zZWQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIC8vIGNhbid0IGdldCBhdHRhY2hlZERiIGxpc3QuIGRvIGludGVncml0eSBjaGVjayBvbiB0aGUgbWFpbiBkYXRhYmFzZQorICAgICAgICAgICAgYXR0YWNoZWREYnMgPSBuZXcgQXJyYXlMaXN0PFBhaXI8U3RyaW5nLCBTdHJpbmc+PigpOworICAgICAgICAgICAgYXR0YWNoZWREYnMuYWRkKG5ldyBQYWlyPFN0cmluZywgU3RyaW5nPigibWFpbiIsIHRoaXMubVBhdGgpKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGF0dGFjaGVkRGJzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICBQYWlyPFN0cmluZywgU3RyaW5nPiBwID0gYXR0YWNoZWREYnMuZ2V0KGkpOworICAgICAgICAgICAgU1FMaXRlU3RhdGVtZW50IHByb2cgPSBudWxsOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBwcm9nID0gY29tcGlsZVN0YXRlbWVudCgiUFJBR01BICIgKyBwLmZpcnN0ICsgIi5pbnRlZ3JpdHlfY2hlY2soMSk7Iik7CisgICAgICAgICAgICAgICAgU3RyaW5nIHJzbHQgPSBwcm9nLnNpbXBsZVF1ZXJ5Rm9yU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgaWYgKCFyc2x0LmVxdWFsc0lnbm9yZUNhc2UoIm9rIikpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gaW50ZWdyaXR5X2NoZWNrZXIgZmFpbGVkIG9uIG1haW4gb3IgYXR0YWNoZWQgZGF0YWJhc2VzCisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlBSQUdNQSBpbnRlZ3JpdHlfY2hlY2sgb24gIiArIHAuc2Vjb25kICsgIiByZXR1cm5lZDogIiArIHJzbHQpOworICAgICAgICAgICAgICAgICAgICByZXR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W5lc3MKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogCiAgICAgICAgIGlmIChtSXNJbml0aWFsaXppbmcpIHsKQEAgLTExNSwxMCArMTQ4LDE0IEBACiAgICAgICAgICAgICBpZiAobU5hbWUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGRiID0gU1FMaXRlRGF0YWJhc2UuY3JlYXRlKG51bGwpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBkYiA9IG1Db250ZXh0Lm9wZW5PckNyZWF0ZURhdGFiYXNlKG1OYW1lLCAwLCBtRmFjdG9yeSk7CisgICAgICAgICAgICAgICAgZGIgPSBtQ29udGV4dC5vcGVuT3JDcmVhdGVEYXRhYmFzZShtTmFtZSwgMCwgbUZhY3RvcnksIG1FcnJvckhhbmRsZXIpOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpbnQgdmVyc2lvbiA9IGRiLmdldFZlcnNpb24oKTsKKyAgICAgICAgICAgIGlmICh2ZXJzaW9uID4gbU5ld1ZlcnNpb24pIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJEYXRhYmFzZSAiICsgbU5hbWUgKworICAgICAgICAgICAgICAgICAgICAgICAgIiBjYW5ub3QgYmUgZG93bmdyYWRlZC4gaW5zdGVhZCwgcGxlYXNlIHVuaW5zdGFsbCBuZXcgdmVyc2lvbiBmaXJzdC4iKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmICh2ZXJzaW9uICE9IG1OZXdWZXJzaW9uKSB7CiAgICAgICAgICAgICAgICAgZGIuYmVnaW5UcmFuc2FjdGlvbigpOwogICAgICAgICAgICAgICAgIHRyeSB7CkBAIC0xNzUsOCArMjEyLDEzIEBACiAgICAgICogICAgIG9yIHtAbGluayAjY2xvc2V9IGlzIGNhbGxlZC4KICAgICAgKi8KICAgICBwdWJsaWMgc3luY2hyb25pemVkIFNRTGl0ZURhdGFiYX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lscy5TVEFURU1FTlRfQUJPUlQ6CisgICAgICAgICAgICBjYXNlIERhdGFiYXNlVXRpbHMuU1RBVEVNRU5UX0RETDoKKyAgICAgICAgICAgIGNhc2UgRGF0YWJhc2VVdGlscy5TVEFURU1FTlRfVU5QUkVQQVJFRDoKKyAgICAgICAgICAgICAgICBtU3RhdGVtZW50VHlwZSA9IG4gfCBTVEFURU1FTlRfRE9OVF9QUkVQQVJFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBtU3RhdGVtZW50VHlwZSA9IG47CisgICAgICAgIH0KICAgICAgICAgZGIuYWNxdWlyZVJlZmVyZW5jZSgpOwogICAgICAgICBkYi5hZGRTUUxpdGVDbG9zYWJsZSh0aGlzKTsKLSAgICAgICAgdGhpcy5uSGFuZGxlID0gZGIubU5hdGl2ZUhhbmRsZTsKKyAgICAgICAgbURhdGFiYXNlID0gZGI7CisgICAgICAgIG5IYW5kbGUgPSBkYi5tTmF0aXZlSGFuZGxlOworICAgICAgICBpZiAoYmluZEFyZ3MgIT0gbnVsbCkgeworICAgICAgICAgICAgaW50IHNpemUgPSBiaW5kQXJncy5sZW5ndGg7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNpemU7IGkrKykgeworICAgICAgICAgICAgICAgIHRoaXMuYWRkVG9CaW5kQXJncyhpICsgMSwgYmluZEFyZ3NbaV0pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChjb21waWxlRmxhZykgeworICAgICAgICAgICAgY29tcGlsZUFuZGJpbmRBbGxBcmdzKCk7CisgICAgICAgIH0KKyAgICB9CiAKKyAgICBwcml2YXRlIHZvaWQgY29tcGlsZVNxbCgpIHsKICAgICAgICAgLy8gb25seSBjYWNoZSBDUlVEIHN0YXRlbWVudHMKLSAgICAgICAgU3RyaW5nIHByZWZpeFNxbCA9IG1TcWwuc3Vic3RyaW5nKDAsIDYpOwotICAgICAgICB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gLyoqCisgICAgICogdXNlZCBvbmx5IGZvciB0ZXN0aW5nIHB1cnBvc2VzCisgICAgICovCisgICAgLyogcGFja2FnZSAqLyBpbnQgZ2V0U3FsU3RhdGVtZW50SWQoKSB7CisgICAgICBzeW5jaHJvbml6ZWQodGhpcykgeworICAgICAgICByZXR1cm4gKG1Db21waWxlZFNxbCA9PSBudWxsKSA/IDAgOiBuU3RhdGVtZW50OworICAgICAgfQogICAgIH0KIAogICAgIC8qIHBhY2thZ2UgKi8gU3RyaW5nIGdldFNxbFN0cmluZygpIHsKQEAgLTE2OSw2ICsyMjYsMzcgQEAKICAgICAgICAgLy8gVE9ETyBpcyB0aGVyZSBhIG5lZWQgZm9yIHRoaXM/CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIGJpbmQoaW50IHR5cGUsIGludCBpbmRleCwgT2JqZWN0IHZhbHVlKSB7CisgICAgICAgIG1EYXRhYmFzZS52ZXJpZnlEYklzT3BlbigpOworICAgICAgICBhZGRUb0JpbmRBcmdzKGluZGV4LCAodHlwZSA9PSBDdXJzb3IuRklFTERfVFlQRV9OVUxMKSA/IG51bGwgOiB2YWx1ZSk7CisgICAgICAgIGlmIChuU3RhdGVtZW50ID4gMCkgeworICAgICAgICAgICAgLy8gYmluZCBvbmx5IGlmIHRoZSBTUUwgc3RhdGVtZW50IGlzIGNvbXBpbGVkCisgICAgICAgICAgICBhY3F1aXJlUmVmZXJlbmNlKCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHN3aXRjaCAodHlwZSkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIEN1cnNvci5GSUVMRF9UWVBFX05VTEw6CisgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVfYmluZF9udWxsKGluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIEN1cnNvci5GSUVMRF9UWVBFX0JMT0I6CisgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVfYmluZF9ibG9iKGluZGV4LCAoYnl0ZVtdKSB2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBDdXJzb3IuRklFTERfVFlQRV9GTE9BVDoKKyAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZV9iaW5kX2RvdWJsZShpbmRleCwgKERvdWJsZSkgdmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgQ3Vyc29yLkZJRUxEX1RZUEVfSU5URUdFUjoKKyAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZV9iaW5kX2xvbmcoaW5kZXgsIChMb25nKSB2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBDdXJzb3IuRklFTERfVFlQRV9TVFJJTkc6CisgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVfYmluZF9zdHJpbmcoaW5kZXgsIChTdHJpbmcpIHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgcmVsZWFzZVJlZmVyZW5jZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCiAgICAgLyoqCiAgICAgICogQmluZCBhIE5VTEwgdmFsdWUgdG8gdGhpcyBzdGF0ZW1lbnQuIFRoZSB2YWx1ZSByZW1haW5zIGJvdW5kIHVudGlsCiAgICAgICoge0BsaW5rICNjbGVhckJpbmRpbmdzfSBpcyBjYWxsZWQuCkBAIC0xNzYsMzQgKzI2NCwxOCBAQAogICAgICAqIEBwYXJhbSBpbmRleCBUaGUgMS1iYXNlZCBpbmRleCB0byB0aGUgcGFyYW1ldGVy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SAwIHx8ICFtRGF0YWJhc2UuaXNPcGVuKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQotICAgICAgICBtRGF0YWJhc2UubG9jaygpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmVsZWFzZVJlZmVyZW5jZSgpOwotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgbURhdGFiYXNlLnVubG9jaygpOworICAgICAgICByZWxlYXNlUmVmZXJlbmNlKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGFkZFRvQmluZEFyZ3MoaW50IGluZGV4LCBPYmplY3QgdmFsdWUpIHsKKyAgICAgICAgaWYgKG1CaW5kQXJncyA9PSBudWxsKSB7CisgICAgICAgICAgICBtQmluZEFyZ3MgPSBuZXcgSGFzaE1hcDxJbnRlZ2VyLCBPYmplY3Q+KCk7CiAgICAgICAgIH0KKyAgICAgICAgbUJpbmRBcmdzLnB1dChpbmRleCwgdmFsdWUpOworICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8gdm9pZCBjb21waWxlQW5kYmluZEFsbEFyZ3MoKSB7CisgICAgICAgIGlmICgobVN0YXRlbWVudFR5cGUgJiBTVEFURU1FTlRfRE9OVF9QUkVQQVJFKSA+IDApIHsKKyAgICAgICAgICAgIC8vIG5vIG5lZWQgdG8gcHJlcGFyZSB0aGlzIFNRTCBzdGF0ZW1lbnQKKyAgICAgICAgICAgIGlmIChTUUxpdGVEZWJ1Zy5ERUJVR19TUUxfU1RBVEVNRU5UUykgeworICAgICAgICAgICAgICAgIGlmIChtQmluZEFyZ3MgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJubyBuZWVkIHRvIHBhc3MgYmluZGFyZ3MgZm9yIHRoaXMgc3FsIDoiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3FsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKG5TdGF0ZW1lbnQgPT0gMCkgeworICAgICAgICAgICAgLy8gU1FMIHN0YXRlbWVudCBpcyBub3QgY29tcGlsZWQgeWV0LiBjb21waWxlIGl0IG5vdy4KKyAgICAgICAgICAgIGNvbXBpbGVTcWwoKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUJpbmRBcmdzID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGludCBpbmRleCA6IG1CaW5kQXJncy5rZXlTZXQoKSkgeworICAgICAgICAgICAgT2JqZWN0IHZhbHVlID0gbUJpbmRBcmdzLmdldChpbmRleCk7CisgICAgICAgICAgICBpZiAodmFsdWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG5hdGl2ZV9iaW5kX251bGwoaW5kZXgpOworICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIERvdWJsZSB8fCB2YWx1ZSBpbnN0YW5jZW9mIEZsb2F0KSB7CisgICAgICAgICAgICAgICAgbmF0aXZlX2JpbmRfZG91YmxlKGluZGV4LCAoKE51bWJlcikgdmFsdWUpLmRvdWJsZVZhbHVlKCkpOworICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIE51bWJlcikgeworICAgICAgICAgICAgICAgIG5hdGl2ZV9iaW5kX2xvbmcoaW5kZXgsICgoTnVtYmVyKSB2YWx1ZSkubG9uZ1ZhbHVlKCkpOworICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIEJvb2xlYW4pIHsKKyAgICAgICAgICAgICAgICBCb29sZWFuIGJvb2wgPSAoQm9vbGVhbil2YWx1ZTsKKyAgICAgICAgICAgICAgICBuYXRpdmVfYmluZF9sb25nKGluZGV4LCAoYm9vbCkgPyAxIDogMCk7CisgICAgICAgICAgICAgICAgaWYgKGJvb2wpIHsKKyAgICAgICAgICAgICAgICAgICAgbmF0aXZlX2JpbmRfbG9uZyhpbmRleCwgMSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbmF0aXZlX2JpbmRfbG9uZyhpbmRleCwgMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIGJ5dGVbXSl7CisgICAgICAgICAgICAgICAgbmF0aXZlX2JpbmRfYmxvYihpbmRleCwgKGJ5dGVbXSkgdmFsdWUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBuYXRpdmVfYmluZF9zdHJpbmcoaW5kZXgsIHZhbHVlLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogR2l2ZW4gYW4gYXJyYXkgb2YgU3RyaW5nIGJpbmRBcmdzLCB0aGlzIG1ldGhvZCBiaW5kcyBhbGwgb2YgdGhlbSBpbiBvbmUgc2luZ2xlIGNhbGwuCisgICAgICoKKyAgICAgKiBAcGFyYW0gYmluZEFyZ3MgdGhlIFN0cmluZyBhcnJheSBvZiBiaW5kIGFyZ3MuCisgICAgICovCisgICAgcHVibGljIHZvaWQgYmluZEFsbEFyZ3NBc1N0cmluZ3MoU3RyaW5nW10gYmluZEFyZ3MpIHsKKyAgICAgICAgaWYgKGJpbmRBcmdzID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBpbnQgc2l6ZSA9IGJpbmRBcmdzLmxlbmd0aDsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKKyAgICAgICAgICAgIGJpbmRTdHJpbmcoaSArIDEsIGJpbmRBcmdzW2ldKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8gc3luY2hyb25pemV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nVnLkRFQlVHX1NRTF9TVEFURU1FTlRTKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImZpbGxXaW5kb3coKTogIiArIG1TcWwpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnQgbnVtUm93cyA9IG5hdGl2ZV9maWxsX3dpbmRvdyh3aW5kb3csIHdpbmRvdy5nZXRTdGFydFBvc2l0aW9uKCksCisgICAgICAgICAgICAgICAgICAgICAgICBtT2Zmc2V0SW5kZXgsIG1heFJlYWQsIGxhc3RQb3MpOwogICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5sb2dUaW1lU3RhdChtU3FsLCB0aW1lU3RhcnQpOwogICAgICAgICAgICAgICAgIHJldHVybiBudW1Sb3dzOwogICAgICAgICAgICAgfSBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGUpewpAQCAtODUsNiArOTAsOSBAQAogICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRGF0YWJhc2VDb3JydXB0RXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICBtRGF0YWJhc2Uub25Db3JydXB0aW9uKCk7CiAgICAgICAgICAgICAgICAgdGhyb3cgZTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiZXhjZXB0aW9uOiAiICsgZS5nZXRNZXNzYWdlKCkgKyAiOyBxdWVyeTogIiArIG1TcWwpOworICAgICAgICAgICAgICAgIHRocm93IGU7CiAgICAgICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICAgICAgIHdpbmRvdy5yZWxlYXNlUmVmZXJlbmNlKCk7CiAgICAgICAgICAgICB9CkBAIC0xNDEsNTEgKzE0OSwxMyBAQAogICAgICAqIENhbGxlZCBieSBTUUxpdGVDdXJzb3Igd2hlbiBpdCBpcyByZXF1ZXJpZWQuCiAgICAgICovCiAgICAgLyogcGFja2FnZSAqLyB2b2lkIHJlcXVlcnkoKSB7Ci0gICAgICAgIGlmIChtQmluZEFyZ3MgIT0gbnVsbCkgewotICAgICAgICAgICAgaW50IGxlbiA9IG1CaW5kQXJncy5sZW5ndGg7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgc3VwZXIuYmluZFN0cmluZyhpICsgMSwgbUJpbmRBcmdzW2ldKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGNhdGNoIChTUUxpdGVNaXN1c2VFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgZXJyTXNnID0gbmV3IFN0cmluZ0J1aWxkZXIoIm1TcWwgIiArIG1TcWwpOwotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgZXJyTXNnLmFwcGVuZCgiICIpOwotICAgICAgICAgICAgICAgICAgICBlcnJNc2cuYXBwZW5kKG1CaW5kQXJnc1tpXSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVyck1zZy5hcHBlbmQoIiAiKTsKLSAgICAgICAgICAgICAgICBJbGxlZ2FsU3RhdGVFeGNlcHRpb24gbGVha1Byb2dyYW0gPSBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKAotICAgICAgICAgICAgICAgICAgICAgICAgZXJyTXNnLnRvU3RyaW5nKCksIGUpOwotICAgICAgICAgICAgICAgIHRocm93IGxlYWtQcm9ncmFtOyAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgIH0KKyAgICAgICAgaWYgKG1DbG9zZWQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oInJlcXVlcnlpbmcgYSBjbG9zZWQgY3Vyc29yIik7Ci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DApIHsKKyAgICAgICAgICAgICAgICAvLyBzaW5jZSB0aGUgc3RhdGVtZW50IGRvZXNuJ3QgaGF2ZSB0byBiZSBwcmVwYXJlZCwKKyAgICAgICAgICAgICAgICAvLyBjYWxsIHRoZSBmb2xsb3dpbmcgbmF0aXZlIG1ldGhvZCB3aGljaCB3aWxsIG5vdCBwcmVwYXJlCisgICAgICAgICAgICAgICAgLy8gdGhlIHF1ZXJ5IHBsYW4KKyAgICAgICAgICAgICAgICBuYXRpdmVfZXhlY3V0ZVNxbChtU3FsKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbnVtQ2hhbmdlcyA9IG5hdGl2ZV9leGVjdXRlKCk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBtRGF0YWJhc2UubG9nVGltZVN0YXQobVNxbCwgdGltZVN0YXJ0KTsKKyAgICAgICAgICAgIHJldHVybiBudW1DaGFuZ2VzOwogICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgcmVsZWFzZVJlZmVyZW5jZSgpOwotICAgICAgICAgICAgbURhdGFiYXNlLnVubG9jaygpOworICAgICAgICAgICAgcmVsZWFzZUFuZFVubG9jaygpOwogICAgICAgICB9CiAgICAgfQogCkBAIC03NiwyMSArMTA3LDEzIEBACiAgICAgICogICAgICAgICBzb21lIHJlYXNvbgogICAgICAqLwogICAgIHB1YmxpYyBsb25nIGV4ZWN1dGVJbnNlcnQoKSB7Ci0gICAgICAgIEJsb2NrR3VhcmQuZ2V0VGhyZWFkUG9saWN5KCkub25Xcml0ZVRvRGlzaygpOwotICAgICAgICBpZiAoIW1EYXRhYmFzZS5pc09wZW4oKSkgewotICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiZGF0YWJhc2UgIiArIG1EYXRhYmFzZS5nZXRQYXRoKCkgKyAiIGFscmVhZHkgY2xvc2VkIik7Ci0gICAgICAgIH0KLSAgICAgICAgbG9uZyB0aW1lU3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isgICAgICAgIH0KKworICAgICAgICBhY3F1aXJlUmVmZXJlbmNlKCk7CisgICAgICAgIGxvbmcgc3RhcnRUaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgIG1EYXRhYmFzZS5jbG9zZVBlbmRpbmdTdGF0ZW1lbnRzKCk7CisgICAgICAgIGNvbXBpbGVBbmRiaW5kQWxsQXJncygpOworICAgICAgICByZXR1cm4gc3RhcnRUaW1lOworICAgIH0KKworICAgIC8qKgorICAgICAqIHRoaXMgbWV0aG9kIHJlbGVhc2VzIGxvY2tzIGFuZCByZWZlcmVuY2VzIGFjcXVpcmVkIGluIHtAbGluayAjYWNxdWlyZUFuZExvY2soYm9vbGVhbil9CisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHJlbGVhc2VBbmRVbmxvY2soKSB7CisgICAgICAgIHJlbGVhc2VSZWZlcmVuY2UoKTsKKyAgICAgICAgaWYgKG1TdGF0ZSA9PSBUUkFOU19TVEFSVEVEKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAobVN0YXRlID09IExPQ0tfQUNRVUlSRUQpIHsKKyAgICAgICAgICAgIG1EYXRhYmFzZS51bmxvY2soKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoKG1TdGF0ZW1lbnRUeXBlICYgU1FMaXRlUHJvZ3JhbS5TVEFURU1FTlRfVFlQRV9NQVNLKSA9PQorICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuU1RBVEVNRU5UX0NPTU1JVCB8fAorICAgICAgICAgICAgICAgIChtU3RhdGVtZW50VHlwZSAmIFNRTGl0ZVByb2dyYW0uU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bmV3IElucHV0Q29ubmVjdGlvbldyYXBwZXIoaW5wdXRDb250ZXh0KSA6IG51bGw7Ci0gICAgICAgICAgICAgICAgaW5wdXRNZXRob2Quc3RhcnRJbnB1dChpYywgKEVkaXRvckluZm8pYXJncy5hcmcyKTsKKyAgICAgICAgICAgICAgICBFZGl0b3JJbmZvIGluZm8gPSAoRWRpdG9ySW5mbylhcmdzLmFyZzI7CisgICAgICAgICAgICAgICAgaW5mby5tYWtlQ29tcGF0aWJsZShtVGFyZ2V0U2RrVmVyc2lvbik7CisgICAgICAgICAgICAgICAgaW5wdXRNZXRob2Quc3RhcnRJbnB1dChpYywgaW5mbyk7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgY2FzZSBET19SRVNUQVJUX0lOUFVUOiB7CkBAIC0xNTcsNyArMTYzLDkgQEAKICAgICAgICAgICAgICAgICBJSW5wdXRDb250ZXh0IGlucHV0Q29udGV4dCA9IChJSW5wdXRDb250ZXh0KWFyZ3MuYXJnMTsKICAgICAgICAgICAgICAgICBJbnB1dENvbm5lY3Rpb24gaWMgPSBpbnB1dENvbnRleHQgIT0gbnVsbAogICAgICAgICAgICAgICAgICAgICAgICAgPyBuZXcgSW5wdXRDb25uZWN0aW9uV3JhcHBlcihpbnB1dENvbnRleHQpIDogbnVsbDsKLSAgICAgICAgICAgICAgICBpbnB1dE1ldGhvZC5yZXN0YXJ0SW5wdXQoaWMsIChFZGl0b3JJbmZvKWFyZ3MuYXJnMik7CisgICAgICAgICAgICAgICAgRWRpdG9ySW5mbyBpbmZvID0gKEVkaXRvckluZm8pYXJncy5hcmcyOworICAgICAgICAgICAgICAgIGluZm8ubWFrZUNvbXBhdGlibGUobVRhcmdldFNka1ZlcnNpb24pOworICAgICAgICAgICAgICAgIGlucHV0TWV0aG9kLnJlc3RhcnRJbnB1dChpYywgaW5mbyk7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogICAgICAg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pOwpAQCAtNTU4LDcgKzU2NCw3IEBACiAgICAgICAgIGluaXRWaWV3cygpOwogICAgICAgICBtV2luZG93LmdldFdpbmRvdygpLnNldExheW91dChNQVRDSF9QQVJFTlQsIFdSQVBfQ09OVEVOVCk7CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogVGhpcyBpcyBhIGhvb2sgdGhhdCBzdWJjbGFzc2VzIGNhbiB1c2UgdG8gcGVyZm9ybSBpbml0aWFsaXphdGlvbiBvZgogICAgICAqIHRoZWlyIGludGVyZmFjZS4gIEl0IGlzIGNhbGxlZCBmb3IgeW91IHByaW9yIHRvIGFueSBvZiB5b3VyIFVJIG9iamVjdHMKQEAgLTU2NywxNCArNTczLDE0IEBACiAgICAgICovCiAgICAgcHVibGljIHZvaWQgb25Jbml0aWFsaXplSW50ZXJmYWNlKCkgewogICAgIH0KLSAgICAKKwogICAgIHZvaWQgaW5pdGlhbGl6ZSgpIHsKICAgICAgICAgaWYgKCFtSW5pdGlhbGl6ZWQpIHsKICAgICAgICAgICAgIG1Jbml0aWFsaXplZCA9IHRydWU7CiAgICAgICAgICAgICBvbkluaXRpYWxpemVJbnRlcmZhY2UoKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHZvaWQgaW5pdFZpZXdzKCkgewogICAgICAgICBtSW5pdGlhbGl6ZWQgPSBmYWxzZTsKICAgICAgICAgbVdpbmRvd0NyZWF0ZWQgPSBmYWxzZTsKQEAgLTYxMCw3ICs2MTYsNyBAQAogICAgICAgICBtQ2FuZGlkYXRlc0ZyYW1lLnNldFZpc2liaWxpdHkobUNhbmRpZGF0ZXNWaXNpYmlsaXR5KTsKICAgICAgICAgbUlucHV0RnJhbWUuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOwogICAgIH0KLSAgICAKKwogICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBvbkRlc3Ryb3koKSB7CiAgICAgICAgIHN1cGVyLm9uRGVzdHJveSgpOwogICAgICAgICB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sZWFuIGRvU2hvd0lucHV0ID0gZmFsc2U7CiAgICAgICAgIGJvb2xlYW4gd2FzVmlzaWJsZSA9IG1XaW5kb3dWaXNpYmxlOwpAQCAtMTMwMyw3ICsxMzExLDcgQEAKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIHNob3dJbnB1dCA9IHRydWU7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJzaG93V2luZG93OiB1cGRhdGluZyBVSSIpOwogICAgICAgICBpbml0aWFsaXplKCk7CiAgICAgICAgIHVwZGF0ZUZ1bGxzY3JlZW5Nb2RlKCk7CkBAIC0xMzM1LDE0ICsxMzQzLDE1IEBACiAgICAgICAgIGlmIChkb1Nob3dJbnB1dCkgewogICAgICAgICAgICAgc3RhcnRFeHRyYWN0aW5nVGV4dChmYWxzZSk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgaWYgKCF3YXNWaXNpYmxlKSB7CiAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgInNob3dXaW5kb3c6IHNob3dpbmchIik7CisgICAgICAgICAgICBtSW1tLnNldElNRUJ1dHRvblZpc2libGUobVRva2VuLCB0cnVlKTsKICAgICAgICAgICAgIG9uV2luZG93U2hvd24oKTsKICAgICAgICAgICAgIG1XaW5kb3cuc2hvdygpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgaGlkZVdpbmRvdygpIHsKICAgICAgICAgaWYgKG1JbnB1dFZpZXdTdGFydGVkKSB7CiAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIkNBTEw6IG9uRmluaXNoSW5wdXRWaWV3Iik7CkBAIC0xMzU2LDExICsxMzY1LDEyIEBACiAgICAgICAgIGlmIChtV2luZG93VmlzaWJsZSkgewogICAgICAgICAgICAgbVdpbmRvdy5oaWRlKCk7CiAgICAgICAgICAgICBtV2luZG93VmlzaWJsZSA9IGZhbHNlOworICAgICAgICAgICAgbUltbS5zZXRJTUVCdXR0b25WaXNpYmxlKG1Ub2tlbiwgZmFsc2UpOwogICAgICAgICAgICAgb25XaW5kb3dIaWRkZW4oKTsKICAgICAgICAgICAgIG1XaW5kb3dXYXNWaXNpYmxlID0gZmFsc2U7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBDYWxsZWQgd2hlbiB0aGUgaW5wdXQgbWV0aG9kIHdpbmRvdyBoYXMgYmVlbiBzaG93biB0byB0aGUgdXNlciwgYWZ0ZXIKICAgICAgKiBwcmV2aW91c2x5IG5vdCBiZWluZyB2aXNpYmxlLiAgVGhpcyBpcyBkb25lIGFmdGVyIGFsbCBvZiB0aGUgVUkgc2V0dXAKQEAgLTE2NTYsNiArMTY2Niw3IEBACiAgICAgICAgIHJldHVybiBkb01vdmVtZW50S2V5KGtleUNvZGUsIGV2ZW50LCBNT1ZFTUVOVF9VUCk7CiAgICAgfQogCisgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gb25UcmFja2JhbGxFdmVudChNb3Rpb25FdmVudCBldmVudCkgewogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQpAQCAtMTY5NCw3ICsxNzA1LDcgQEAKICAgICAgICAgICAgICAgICBkeSA9IGNvdW50OwogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9Ci0gICAgICAgIG9uRXh0cmFjdGVkQ3Vyc29yTW92ZW1lbnQoZHgsIGR5KTsgICAgICAgCisgICAgICAgIG9uRXh0cmFjdGVkQ3Vyc29yTW92ZW1lbnQoZHgsIGR5KTsKICAgICB9CiAgICAgCiAgICAgYm9vbGVhbiBkb01vdmVtZW50S2V5KGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCwgaW50IGNvdW50KSB7CkBAIC0xOTM0LDYgKzE5NDUsOCBAQAogICAgICAgICAgICAgICAgIHJldHVybiBnZXRUZXh0KGNvbS5hbmRyb2lkLmludGVybm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aCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgcHVibGljIExpbmtQcm9wZXJ0aWVzIGdldExpbmtQcm9wZXJ0aWVzKGludCBuZXR3b3JrVHlwZSkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldExpbmtQcm9wZXJ0aWVzKG5ldHdvcmtUeXBlKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgfQorCiAgICAgLyoqIHtAaGlkZX0gKi8KICAgICBwdWJsaWMgYm9vbGVhbiBzZXRSYWRpb3MoYm9vbGVhbiB0dXJuT24pIHsKICAgICAgICAgdHJ5IHsKQEAgLTM2NywxNCArMzg1LDE0IEBACiAgICAgICogPHA+CiAgICAgICogQWxsIGFwcGxpY2F0aW9ucyB0aGF0IGhhdmUgYmFja2dyb3VuZCBzZXJ2aWNlcyB0aGF0IHVzZSB0aGUgbmV0d29yawogICAgICAqIHNob3VsZCBsaXN0ZW4gdG8ge0BsaW5rICNBQ1RJT05fQkFDS0dST1VORF9EQVRBX1NFVFRJTkdfQ0hBTkdFRH0uCi0gICAgICogCisgICAgICoKICAgICAgKiBAcmV0dXJuIFdoZXRoZXIgYmFja2dyb3VuZCBkYXRhIHVzYWdlIGlzIGFsbG93ZWQuCiAgICAgICovCiAgICAgcHVibGljIGJvb2xlYW4gZ2V0QmFja2dyb3VuZERhdGFTZXR0aW5nKCkgewogICAgICAgICB0cnkgewogICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldEJhY2tncm91bmREYXRhU2V0dGluZygpOwogICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgLy8gRXJyIG9uIHRoZSBzaWRlIG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N0cmluZyBmb3JXaG9tKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtU2VydmljZS5yZXF1ZXN0TmV0d29ya1RyYW5zaXRpb25XYWtlbG9jayhmb3JXaG9tKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCiAgICAgICogQHBhcmFtIG5ldHdvcmtUeXBlIFRoZSB0eXBlIG9mIG5ldHdvcmsgeW91IHdhbnQgdG8gcmVwb3J0IG9uCiAgICAgICogQHBhcmFtIHBlcmNlbnRhZ2UgVGhlIHF1YWxpdHkgb2YgdGhlIGNvbm5lY3Rpb24gMCBpcyBiYWQsIDEwMCBpcyBnb29kCiAgICAgICoge0BoaWRlfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvbmV0L0RoY3BJbmZvLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9uZXQvRGhjcEluZm8uamF2YQppbmRleCAxMTc4YmVjLi45YzgxYzE5IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9uZXQvRGhjcEluZm8uamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9uZXQvRGhjcEluZm8uamF2YQpAQCAtMzcsNiArMzcsMTkgQEAKICAgICAgICAgc3VwZXIoKTsKICAgICB9CiAKKyAgICAvKiogY29weSBjb25zdHJ1Y3RvciB7QGhpZGV9ICovCisgICAgcHVibGljIERoY3BJbmZvKERoY3BJbmZvIHNvdXJjZSkgeworICAgICAgICBpZiAoc291cmNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlwQWRkcmVzcyA9IHNvdXJjZS5pcEFkZHJlc3M7CisgICAgICAgICAgICBnYXRld2F5ID0gc291cmNlLmdhdGV3YXk7CisgICAgICAgICAgICBuZXRtYXNrID0gc291cmNlLm5ldG1hc2s7CisgICAgICAgICAgICBkbnMxID0gc291cmNlLmRuczE7CisgICAgICAgICAgICBkbnMyID0gc291cmNlLmRuczI7CisgICAgICAgICAgICBzZXJ2ZXJBZGRyZXNzID0gc291cmNlLnNlcnZlckFkZHJlc3M7CisgICAgICAgICAgICBsZWFzZUR1cmF0aW9uID0gc291cmNlLmxlYXNlRHVyYXRpb247CisgICAgICAgIH0KKyAgICB9CisKICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewogICAgICAgICBTdHJpbmdCdWZmZXIgc3RyID0gbmV3IFN0cmluZ0J1ZmZlcigpOwogCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9uZXQvRG93bmxvYWRzLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9uZXQvRG93bmxvYWRzLmphdmEKaW5kZXggZmQzMzc4MS4uZGRkZTVjMSAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvbmV0L0Rvd25sb2Fkcy5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL25ldC9Eb3dubG9hZHMuamF2YQpAQCAtNDMwLDExICs0MzAsMTAgQEAKIAogICAgICAgICAgICAgQ29udGVudFJlc29sdmVyIGNyID0gY29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKTsKIAotICAgICAgICAgICAgQ3Vyc29yIGMgPSBjci5xdWVyeSgKLSAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRVcmksIERPV05MT0FEU19QUk9KRUNUSU9OLCBudWxsIC8qIHNlbGVjdGlvbiAqLywgbnVsbCAvKiBzZWxlY3Rpb24gYXJncyAqLywKLSAgICAgICAgICAgICAgICAgICAgbnVsbCAvKiBzb3J0IG9yZGVyICovKTsKKyAgICAgICAgICAgIEN1cnNvciBjID0gY3IucXVlcnkoZG93bmxvYWRVcmksIERPV05MT0FEU19QUk9KRUNUSU9OLCBudWxsIC8qIHNlbGVjdGlvbiAqLywKKyAgICAgICAgICAgIC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Y2VBZGRyZXNzKSB7CisgICAgICAgIHRoaXMuYWRkcmVzcyA9IGludGVyZmFjZUFkZHJlc3MuZ2V0QWRkcmVzcygpOworICAgICAgICB0aGlzLnByZWZpeExlbmd0aCA9IGludGVyZmFjZUFkZHJlc3MuZ2V0TmV0d29ya1ByZWZpeExlbmd0aCgpOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGludCBjb21wdXRlcHJlZml4TGVuZ3RoKEluZXRBZGRyZXNzIG1hc2spIHsKKyAgICAgICAgaW50IGNvdW50ID0gMDsKKyAgICAgICAgZm9yIChieXRlIGIgOiBtYXNrLmdldEFkZHJlc3MoKSkgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCA4OyArK2kpIHsKKyAgICAgICAgICAgICAgICBpZiAoKGIgJiAoMSA8PCBpKSkgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICArK2NvdW50OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gY291bnQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgcmV0dXJuIChhZGRyZXNzID09IG51bGwgPyAiIiA6IChhZGRyZXNzLmdldEhvc3RBZGRyZXNzKCkgKyAiLyIgKyBwcmVmaXhMZW5ndGgpKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb21wYXJlcyB0aGlzIHtAY29kZSBMaW5rQWRkcmVzc30gaW5zdGFuY2UgYWdhaW5zdCB0aGUgc3BlY2lmaWVkIGFkZHJlc3MKKyAgICAgKiBpbiB7QGNvZGUgb2JqfS4gVHdvIGFkZHJlc3NlcyBhcmUgZXF1YWwgaWYgdGhlaXIgSW5ldEFkZHJlc3MgYW5kIHByZWZpeExlbmd0aAorICAgICAqIGFyZSBlcXVhbAorICAgICAqCisgICAgICogQHBhcmFtIG9iaiB0aGUgb2JqZWN0IHRvIGJlIHRlc3RlZCBmb3IgZXF1YWxpdHkuCisgICAgICogQHJldHVybiB7QGNvZGUgdHJ1ZX0gaWYgYm90aCBvYmplY3RzIGFyZSBlcXVhbCwge0Bjb2RlIGZhbHNlfSBvdGhlcndpc2UuCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gZXF1YWxzKE9iamVjdCBvYmopIHsKKyAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgTGlua0FkZHJlc3MpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgTGlua0FkZHJlc3MgbGlua0FkZHJlc3MgPSAoTGlua0FkZHJlc3MpIG9iajsKKyAgICAgICAgcmV0dXJuIHRoaXMuYWRkcmVzcy5lcXVhbHMobGlua0FkZHJlc3MuYWRkcmVzcykgJiYKKyAgICAgICAgICAgIHRoaXMucHJlZml4TGVuZ3RoID09IGxpbmtBZGRyZXNzLnByZWZpeExlbmd0aDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBJbmV0QWRkcmVzcyBmb3IgdGhpcyBhZGRyZXNzLgorICAgICAqLworICAgIHB1YmxpYyBJbmV0QWRkcmVzcyBnZXRBZGRyZXNzKCkgeworICAgICAgICByZXR1cm4gYWRkcmVzczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZXQgbmV0d29yayBwcmVmaXggbGVuZ3RoCisgICAgICovCisgICAgcHVibGljIGludCBnZXROZXR3b3JrUHJlZml4TGVuZ3RoKCkgeworICAgICAgICByZXR1cm4gcHJlZml4TGVuZ3RoOworICAgIH0KKworICAgIC8qKgorICAgICAqIEltcGxlbWVudCB0aGUgUGFyY2VsYWJsZSBpbnRlcmZhY2UKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW1wbGVtZW50IHRoZSBQYXJjZWxhYmxlIGludGVyZmFjZS4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgeworICAgICAgICBpZiAoYWRkcmVzcyAhPSBudWxsKSB7CisgICAgICAgICAgICBkZXN0LndyaXRlQnl0ZSgoYnl0ZSkxKTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVCeXRlQXJyYXkoYWRkcmVzcy5nZXRBZGRyZXNzKCkpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChwcmVmaXhMZW5ndGgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVzdC53cml0ZUJ5dGUoKGJ5dGUpMCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBJbXBsZW1lbnQgdGhlIFBhcmNlbGFibGUgaW50ZXJmYWNlLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBDcmVhdG9yPExpbmtBZGRyZXNzPiBDUkVBVE9SID0KKyAgICAgICAgbmV3IENyZWF0b3I8TGlua0FkZHJlc3M+KCkgeworICAgICAgICAgICAgcHVibGljIExpbmtBZGRyZXNzIGNyZWF0ZUZyb21QYXJjZWwoUGFyY2VsIGluKSB7CisgICAgICAgICAgICAgICAgSW5ldEFkZHJlc3MgYWRkcmVzcyA9IG51bGw7CisgICAgICAgICAgICAgICAgaW50IHByZWZpeExlbmd0aCA9IDA7CisgICAgICAgICAgICAgICAgaWYgKGluLnJlYWRCeXRlKCkgPT0gMSkgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgYWRkcmVzcyA9IEluZXRBZGRyZXNzLmdldEJ5QWRkcmVzcyhpbi5jcmVhdGVCeXRlQXJyYXkoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXhMZW5nd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iogTm8gY29uc3RydWN0b3IgKi8KKyAgICAgICAgcHJpdmF0ZSBLZXkoKSB7fQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBBbiBpbnRlZ2VyIHJlcHJlc2VudGluZyB0aGUgbmV0d29yayB0eXBlLgorICAgICAgICAgKiBAc2VlIENvbm5lY3Rpdml0eU1hbmFnZXIKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBmaW5hbCBzdGF0aWMgaW50IFJPX05FVFdPUktfVFlQRSA9IDE7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIERlc2lyZWQgbWluaW11bSBmb3J3YXJkIGxpbmsgKGRvd25sb2FkKSBiYW5kd2lkdGggZm9yIHRoZQorICAgICAgICAgKiBpbiBraWxvYml0cyBwZXIgc2Vjb25kIChrYnBzKS4gVmFsdWVzIHNob3VsZCBiZSBzdHJpbmdzIHN1Y2gKKyAgICAgICAgICogIjUwIiwgIjEwMCIsICIxNTAwIiwgZXRjLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGZpbmFsIHN0YXRpYyBpbnQgUldfREVTSVJFRF9GV0RfQlcgPSAyOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBSZXF1aXJlZCBtaW5pbXVtIGZvcndhcmQgbGluayAoZG93bmxvYWQpIGJhbmR3aWR0aCwgaW4KKyAgICAgICAgICogcGVyIHNlY29uZCAoa2JwcyksIGJlbG93IHdoaWNoIHRoZSBzb2NrZXQgY2Fubm90IGZ1bmN0aW9uLgorICAgICAgICAgKiBWYWx1ZXMgc2hvdWxkIGJlIHN0cmluZ3Mgc3VjaCBhcyAiNTAiLCAiMTAwIiwgIjE1MDAiLCBldGMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgZmluYWwgc3RhdGljIGludCBSV19SRVFVSVJFRF9GV0RfQlcgPSAzOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBdmFpbGFibGUgZm9yd2FyZCBsaW5rIChkb3dubG9hZCkgYmFuZHdpZHRoIGZvciB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ICIxNTAwIiwgZXRjLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGZpbmFsIHN0YXRpYyBpbnQgUldfUkVRVUlSRURfUkVWX0JXID0gNjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQXZhaWxhYmxlIHJldmVyc2UgbGluayAodXBsb2FkKSBiYW5kd2lkdGggZm9yIHRoZSBzb2NrZXQuCisgICAgICAgICAqIFRoaXMgdmFsdWUgaXMgaW4ga2lsb2JpdHMgcGVyIHNlY29uZCAoa2JwcykuCisgICAgICAgICAqIFZhbHVlcyB3aWxsIGJlIHN0cmluZ3Mgc3VjaCBhcyAiNTAiLCAiMTAwIiwgIjE1MDAiLCBldGMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgZmluYWwgc3RhdGljIGludCBST19BVkFJTEFCTEVfUkVWX0JXID0gNzsKKworICAgICAgICAvKioKKyAgICAgICAgICogTWF4aW11bSBsYXRlbmN5IGZvciB0aGUgc29ja2V0LCBpbiBtaWxsaXNlY29uZHMsIGFib3ZlIHdoaWNoCisgICAgICAgICAqIHNvY2tldCBjYW5ub3QgZnVuY3Rpb24uCisgICAgICAgICAqIFZhbHVlcyBzaG91bGQgYmUgc3RyaW5ncyBzdWNoIGFzICI1MCIsICIzMDAiLCAiNTAwIiwgZXRjLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGZpbmFsIHN0YXRpYyBpbnQgUldfTUFYX0FMTE9XRURfTEFURU5DWSA9IDg7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEludGVyZmFjZSB0aGF0IHRoZSBzb2NrZXQgaXMgYm91bmQgdG8uIFRoaXMgY2FuIGJlIGEgdmlydHVhbAorICAgICAgICAgKiBpbnRlcmZhY2UgKGUuZy4gVlBOIG9yIE1vYmlsZSBJUCkgb3IgYSBwaHlzaWNhbCBpbnRlcmZhY2UKKyAgICAgICAgICogKGUuZy4gd2xhbjAgb3Igcm1uZXQwKS4KKyAgICAgICAgICogVmFsdWVzIHdpbGwgY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FtaW5nLjcyMGkiOworCisgICAgICAgIC8qKiBWaWRlbyBDaGF0IEFwcGxpY2F0aW9uIGF0IDM2MHAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVklERU9fQ0hBVF8zNjBQID0gInZpZGVvLmNoYXQuMzYwcCI7CisgICAgICAgIC8qKiBWaWRlbyBDaGF0IEFwcGxpY2F0aW9uIGF0IDQ4MHAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVklERU9fQ0hBVF80ODBQID0gInZpZGVvLmNoYXQuNDgwaSI7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29uc3RydWN0b3IKKyAgICAgKi8KKyAgICBwdWJsaWMgTGlua0NhcGFiaWxpdGllcygpIHsKKyAgICAgICAgbUNhcGFiaWxpdGllcyA9IG5ldyBIYXNoTWFwPEludGVnZXIsIFN0cmluZz4oKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb3B5IGNvbnN0cnVjdG9yLgorICAgICAqCisgICAgICogQHBhcmFtIHNvdXJjZQorICAgICAqLworICAgIHB1YmxpYyBMaW5rQ2FwYWJpbGl0aWVzKExpbmtDYXBhYmlsaXRpZXMgc291cmNlKSB7CisgICAgICAgIGlmIChzb3VyY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgbUNhcGFiaWxpdGllcyA9IG5ldyBIYXNoTWFwPEludGVnZXIsIFN0cmluZz4oc291cmNlLm1DYXBhYmlsaXRpZXMpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUNhcGFiaWxpdGllcyA9IG5ldyBIYXNoTWFwPEludGVnZXIsIFN0cmluZz4oKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZSB0aGUge0Bjb2RlIExpbmtDYXBhYmlsaXRpZXN9IHdpdGggdmFsdWVzIGRlcGVuZGluZyBvbiByb2xlIHR5cGUuCisgICAgICogQHBhcmFtIGFwcGxpY2F0aW9uUm9sZSBhIHtAY29kZSBMaW5rU29ja2V0LlJvbGV9CisgICAgICogQHJldHVybiB0aGUge0Bjb2RlIExpbmtDYXBhYmlsaXRpZXN9IGFzc29jaWF0ZWQgd2l0aCB0aGUgYXBwbGljYXRpb25Sb2xlLCBlbXB0eSBpZiBub25lCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBMaW5rQ2FwYWJpbGl0aWVzIGNyZWF0ZU5lZWRzTWFwKFN0cmluZyBhcHBsaWNhdGlvblJvbGUpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJjcmVhdGVOZWVkZWRDYXBhYmlsaXRpZXMoYXBwbGljYXRpb25Sb2xlKSBFWCIpOworICAgICAgICByZXR1cm4gbmV3IExpbmtDYXBhYmlsaXRpZXMoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZW1vdmUgYWxsIGNhcGFiaWxpdGllcworICAgICAqLworICAgIHB1YmxpYyB2b2lkIGNsZWFyKCkgeworICAgICAgICBtQ2FwYWJpbGl0aWVzLmNsZWFyKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB3aGV0aGVyIHRoaXMgbWFwIGlzIGVtcHR5LgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGlzRW1wdHkoKSB7CisgICAgICAgIHJldHVybiBtQ2FwYWJpbGl0aWVzLmlzRW1wdHkoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBudW1iZXIgb2YgZWxlbWVudHMgaW4gdGhpcyBtYXAuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIHRoZSBudW1iZXIgb2YgZWxlbWVudHMgaW4gdGhpcyBtYXAuCisgICAgICovCisgICAgcHVibGljIGludCBzaXplKCkgeworICAgICAgICByZXR1cm4gbUNhcGFiaWxpdGllcy5zaXplKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2l2ZW4gdGhlIGtleSByZXR1cm4gdGhlIGNhcGFiaWxpdHkgc3RyaW5nCisgICAgICoKKyAgICAgKiBAcGFyYW0ga2V5CisgICAgICogQHJldHVybiB0aGUgY2FwYWJpbGl0eSBzdHJpbmcKKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIGdldChpbnQga2V5KSB7CisgICAgICAgIHJldHVybiBtQ2FwYWJpbGl0aWVzLmdldChrZXkpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFN0b3JlIHRoZSBrZXkvdmFsdWUgY2FwYWJpbGl0eSBwYWlyCisgICAgICoKKyAgICAgKiBAcGFyYW0ga2V5CisgICAgICogQHBhcmFtIHZhbHVlCisgICAgICovCisgICAgcHVibGljIHZvaWQgcHV0KGludCBrZXksIFN0cmluZyB2YWx1ZSkgeworICAgICAgICBtQ2FwYWJpbGl0aWVzLnB1dChrZXksIHZhbHVlKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHdoZXRoZXIgdGhpcyBtYXAgY29udGFpbnMgdGhlIHNwZWNpZmllZCBrZXkuCisgICAgICoKKyAgICAgKiBAcGFyYW0ga2V5IHRvIHNlYXJjaCBmb3IuCisgICAgICogQHJldHVybiB7QGNvZGUgdHJ1ZX0gaWYgdGhpcyBtYXAgY29udGFpbnMgdGhlIHNwZWNpZmllZCBrZXksCisgICAgICogICAgICAgICB7QGNvZGUgZmFsc2V9IG90aGVyd2lzZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBjb250YWluc0tleShpbnQga2V5KSB7CisgICAgICAgIHJldHVybiBtQ2FwYWJpbGl0aWVzLmNvbnRhaW5zS2V5KGtleSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB3aGV0aGVyIHRoaXMgbWFwIGNvbnRhaW5zIHRoZSBzcGVjaWZpZWQgdmFsdWUuCisgICAgICoKKyAgICAgKiBAcGFyYW0gdmFsdWUgdG8gc2VhcmNoIGZvci4KKyAgICAgKiBAcmV0dXJuIHtAY29kZSB0cnVlfSBpZiB0aGlzIG1hcCBjb250YWlucyB0aGUgc3BlY2lmaWVkIHZhbHVlLAorICAgICAqICAgICAgICAge0Bjb2RlIGZhbHNlfSBvdGhlcndpc2UuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gY29udGFpbnNWYWx1ZShTdHJpbmcgdmFsdWUpIHsKKyAgICAgICAgcmV0dXJuIG1DYXBhYmlsaXRpZXMuY29udGFpbnNWYWx1ZSh2YWx1ZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyBhIHNldCBjb250YWluaW5nIGFsbCBvZiB0aGUgbWFwcGluZ3MgaW4gdGhpcyBtYXAuIEVhY2ggbWFwcGluZyBpcworICAgICAqIGFuIGluc3RhbmNlIG9mIHtAbGluayBNYXAuRW50cnl9LiBBcyB0aGUgc2V0IGlzIGJhY2tlZCBieSB0aGlzIG1hcCwKKyAgICAgKiBjaGFuZ2VzIGluIG9uZSB3aWxsIGJlIHJlZmxlY3RlZCBpbiB0aGUgb3RoZXIuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIGEgc2V0IG9mIHRoZSBtYXBwaW5ncy4KKyAgICAgKi8KKyAgICBwdWJsaWMgU2V0PEVudHJ5PEludGVnZXIsIFN0cmluZz4+IGVudHJ5U2V0KCkgeworICAgICAgICByZXR1cm4gbUNhcGFiaWxpdGllcy5lbnRyeVNldCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdGhlIHNldCBvZiB0aGUga2V5cy4KKyAgICAgKi8KKyAgICBwdWJsaWMgU2V0PEludGVnZXI+IGtleVNldCgpIHsKKyAgICAgICAgcmV0dXJuIG1DYXBhYmlsaXRpZXMua2V5U2V0KCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiB0aGUgc2V0IG9mIHZhbHVlcworICAgICAqLworICAgIHB1YmxpYyBDb2xsZWN0aW9uPFN0cmluZz4gdmFsdWVzKCkgeworICAgICAgICByZXR1cm4gbUNhcGFiaWxpdGllcy52YWx1ZXMoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBJbXBsZW1lbnQgdGhlIFBhcmNlbGFibGUgaW50ZXJmYWNlCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGRlc2NyaWJlQ29udGVudHMoKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnZlcnQgdG8gc3RyaW5nIGZvciBkZWJ1Z2dpbmcKKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgc2IuYXBwZW5kKCJ7Iik7CisgICAgICAgIGJvb2xlYW4gZmlyc3RUaW1lID0gdHJ1ZTsKKyAgICAgICAgZm9yIChFbnRyeTxJbnRlZ2VyLCBTdHJpbmc+IGVudHJ5IDogbUNhcGFiaWxpdGllcy5lbnRyeVNldCgpKSB7CisgICAgICAgICAgICBpZiAoZmlyc3RUaW1lKSB7CisgICAgICAgICAgICAgICAgZmlyc3RUaW1lID0gZmFsc2U7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiLCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2IuYXBwZW5kKGVudHJ5LmdldEtleSgpKTsKKyAgICAgICAgICAgIHNiLmFwcGVuZCgiOlwiIik7CisgICAgICAgICAgICBzYi5hcHBlbmQoZW50cnkuZ2V0VmFsdWUoKSk7CisgICAgICAgICAgICBzYi5hcHBlbmQoIlwiIik7CisgICAgICAgICAgICByZXR1cm4gbUNhcGFiaWxpdGllcy50b1N0cmluZygpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEltcGxlbWVudCB0aGUgUGFyY2VsYWJsZSBpbnRlcmZhY2UuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhcmNlbCBkZXN0LCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgZGVzdC53cml0ZUludChtQ2FwYWJpbGl0aWVzLnNpemUoKSk7CisgICAgICAgIGZvciAoRW50cnk8SW50ZWdlciwgU3RyaW5nPiBlbnRyeSA6IG1DYXBhYmlsaXRpZXMuZW50cnlTZXQoKSkgeworICAgICAgICAgICAgZGVzdC53cml0ZUludChlbnRyeS5nZXRLZXkoKS5pbnRWYWx1ZSgpKTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcoZW50cnkuZ2V0VmFsdWUoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBJbXBsZW1lbnQgdGhlIFBhcmNlbGFibGUgaW50ZXJmYWNlLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBDcmVhdG9yPExpbmtDYXBhYmlsaXRpZXM+IENSRUFUT1IgPQorICAgICAgICBuZXcgQ3JlYXRvcjxMaW5rQ2FwYWJpbGl0aWVzPigpIHsKKyAgICAgICAgICAgIHB1YmxpYyBMaW5rQ2FwYWJpbGl0aWVzIGNyZWF0ZUZyb21QYXJjZWwoUGFyY2VsIGluKSB7CisgICAgICAgICAgICAgICAgTGlua0NhcGFiaWxpdGllcyBjYXBhYmlsaXRpZXMgPSBuZXcgTGlua0NhcGFiaWxpdGllcygpOworICAgICAgICAgICAgICAgIGludCBzaXplID0gaW4ucmVhZEludCgpOworICAgICAgICAgICAgICAgIHdoaWxlIChzaXplLS0gIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBpbnQga2V5ID0gaW4ucmVhZEludCgpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdmFsdWUgPSBpbi5yZWFkU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgICAgIGNhcGFiaWxpdGllcy5tQ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mVzcyBkbnMpIHsKKyAgICAgICAgbURuc2VzLmFkZChkbnMpOworICAgIH0KKworICAgIHB1YmxpYyBDb2xsZWN0aW9uPEluZXRBZGRyZXNzPiBnZXREbnNlcygpIHsKKyAgICAgICAgcmV0dXJuIENvbGxlY3Rpb25zLnVubW9kaWZpYWJsZUNvbGxlY3Rpb24obURuc2VzKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRHYXRld2F5KEluZXRBZGRyZXNzIGdhdGV3YXkpIHsKKyAgICAgICAgbUdhdGV3YXkgPSBnYXRld2F5OworICAgIH0KKyAgICBwdWJsaWMgSW5ldEFkZHJlc3MgZ2V0R2F0ZXdheSgpIHsKKyAgICAgICAgcmV0dXJuIG1HYXRld2F5OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEh0dHBQcm94eShQcm94eVByb3BlcnRpZXMgcHJveHkpIHsKKyAgICAgICAgbUh0dHBQcm94eSA9IHByb3h5OworICAgIH0KKyAgICBwdWJsaWMgUHJveHlQcm9wZXJ0aWVzIGdldEh0dHBQcm94eSgpIHsKKyAgICAgICAgcmV0dXJuIG1IdHRwUHJveHk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY2xlYXIoKSB7CisgICAgICAgIG1JZmFjZU5hbWUgPSBudWxsOworICAgICAgICBtTGlua0FkZHJlc3NlcyA9IG5ldyBBcnJheUxpc3Q8TGlua0FkZHJlc3M+KCk7CisgICAgICAgIG1EbnNlcyA9IG5ldyBBcnJheUxpc3Q8SW5ldEFkZHJlc3M+KCk7CisgICAgICAgIG1HYXRld2F5ID0gbnVsbDsKKyAgICAgICAgbUh0dHBQcm94eSA9IG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW1wbGVtZW50IHRoZSBQYXJjZWxhYmxlIGludGVyZmFjZQorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGludCBkZXNjcmliZUNvbnRlbnRzKCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICBTdHJpbmcgaWZhY2VOYW1lID0gKG1JZmFjZU5hbWUgPT0gbnVsbCA/ICIiIDogIkludGVyZmFjZU5hbWU6ICIgKyBtSWZhY2VOYW1lICsgIiAiKTsKKworICAgICAgICBTdHJpbmcgbGlua0FkZHJlc3NlcyA9ICJMaW5rQWRkcmVzc2VzOiBbIjsKKyAgICAgICAgZm9yIChMaW5rQWRkcmVzcyBhZGRyIDogbUxpbmtBZGRyZXNzZXMpIGxpbmtBZGRyZXNzZXMgKz0gYWRkci50b1N0cmluZygpOworICAgICAgICBsaW5rQWRkcmVzc2VzICs9ICJdICI7CisKKyAgICAgICAgU3RyaW5nIGRucyA9ICJEbnNBZGRyZXNzZXM6IFsiOworICAgICAgICBmb3IgKEluZXRBZGRyZXNzIGFkZHIgOiBtRG5zZXMpIGRucyArPSBhZGRyLmdldEhvc3RBZGRyZXNzKCkgKyAiLCI7CisgICAgICAgIGRucyArPSAiXSAiOworCisgICAgICAgIFN0cmluZyBwcm94eSA9IChtSHR0cFByb3h5ID09IG51bGwgPyAiIiA6ICJIdHRwUHJveHk6ICIgKyBtSHR0cFByb3h5LnRvU3RyaW5nKCkgKyAiICIpOworICAgICAgICBTdHJpbmcgZ2F0ZXdheSA9IChtR2F0ZXdheSA9PSBudWxsID8gIiIgOiAiR2F0ZXdheTogIiArIG1HYXRld2F5LmdldEhvc3RBZGRyZXNzKCkgKyAiICIpOworCisgICAgICAgIHJldHVybiBpZmFjZU5hbWUgKyBsaW5rQWRkcmVzc2VzICsgZ2F0ZXdheSArIGRucyArIHByb3h5OworICAgIH0KKworICAgIC8qKgorICAgICAqIEltcGxlbWVudCB0aGUgUGFyY2VsYWJsZSBpbnRlcmZhY2UuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhcmNlbCBkZXN0LCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgZGVzdC53cml0ZVN0cmluZyhnZXRJbnRlcmZhY2VOYW1lKCkpOworICAgICAgICBkZXN0LndyaXRlSW50KG1MaW5rQWRkcmVzc2VzLnNpemUoKSk7CisgICAgICAgIGZvcihMaW5rQWRkcmVzcyBsaW5rQWRkcmVzcyA6IG1MaW5rQWRkcmVzc2VzKSB7CisgICAgICAgICAgICBkZXN0LndyaXRlUGFyY2VsYWJsZShsaW5rQWRkcmVzcywgZmxhZ3MpOworICAgICAgICB9CisKKyAgICAgICAgZGVzdC53cml0ZUludChtRG5zZXMuc2l6ZSgpKTsKKyAgICAgICAgZm9yKEluZXRBZGRyZXNzIGQgOiBtRG5zZXMpIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVCeXRlQXJyYXkoZC5nZXRBZGRyZXNzKCkpOworICAgICAgICB9CisgICAgICAgIGlmIChtR2F0ZXdheSAhPSBudWxsKSB7CisgICAgICAgICAgICBkZXN0LndyaXRlQnl0ZSgoYnl0ZSkxKTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVCeXRlQXJyYXkobUdhdGV3YXkuZ2V0QWRkcmVzcygpKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVCeXRlKChieXRlKTApOworICAgICAgICB9CisgICAgICAgIGlmIChtSHR0cFByb3h5ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVCeXRlKChieXRlKTEpOworICAgICAgICAgICAgZGVzdC53cml0ZVBhcmNlbGFibGUobUh0dHBQcm94eSwgZmxhZ3MpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVzdC53cml0ZUJ5dGUoKGJ5dGUpMCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBJbXBsZW1lbnQgdGhlIFBhcmNlbGFibGUgaW50ZXJmYWNlLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBDcmVhdG9yPExpbmtQcm9wZXJ0aWVzPiBDUkVBVE9SID0KKyAgICAgICAgbmV3IENyZWF0b3I8TGlua1Byb3BlcnRpZXM+KCkgeworICAgICAgICAgICAgcHVibGljIExpbmtQcm9wZXJ0aWVzIGNyZWF0ZUZyb21QYXJjZWwoUGFyY2VsIGluKSB7CisgICAgICAgICAgICAgICAgTGlua1Byb3BlcnRpZXMgbmV0UHJvcCA9IG5ldyBMaW5rUHJvcGVydGllcygpOworICAgICAgICAgICAgICAgIFN0cmluZyBpZmFjZSA9IGluLnJlYWRTdHJpbmcoKTsKKyAgICAgICAgICAgICAgICBpZiAoaWZhY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV0UHJvcC5zZXRJbnRlcmZhY2VOYW1lKGlmYWNlKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBhZGRyZXNzQ291bnQgPSBpbi5yZWFkSW50KCk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPGFkZHJlc3NDb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIG5ldFByb3AuYWRkTGlua0FkZHJlc3MoKExpbmtBZGRyZXNzKWluLnJlYWRQYXJjZWxhYmxlKG51bGwpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYWRkcmVzc0NvdW50ID0gaW4ucmVhZEludCgpOworICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxhZGRyZXNzQ291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV0UHJvcC5hZGREbnMoSW5ldEFkZHJlc3MuZ2V0QnlBZGRyZXNzKGluLmNyZWF0ZUJ5dGVBcnJheSgpKSk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVua25vd25Ib3N0RXhjZXB0aW9uIGUpIHsgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoaW4ucmVhZEJ5dGUoKSA9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXRQcm9wLnNldEdhdGV3YXkoSW5ldEFkZHJlc3MuZ2V0QnlBZGRyZXNzKGluLmNyZWF0ZUJ5dGVBcnJheSgpKSk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVua25vd25Ib3N0RXhjZXB0aW9uIGUpIHt9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChpbi5yZWFkQnl0ZSgpID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgbmV0UHJvcC5zZXRIdHRwUHJveHkoKFByb3h5UHJvcGVydGllcylpbi5yZWFkUGFyY2VsYWJsZShudWxsKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBuZXRQcm9wOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgTGlua1Byb3BlcnRpZXNbXSBuZXdBcnJheShpbnQgc2l6ZSkgeworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgTGlua1Byb3BlcnRpZXNbc2l6ZV07CisgICAgICAgICAgICB9CisgICAgICAgIH07Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9uZXQvTGlua1NvY2tldC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvbmV0L0xpbmtTb2NrZXQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41YWE2NDUxCi0tLSAvZGV2L251bGwKKysrIGIvY29yZS9qYXZh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LkxpbmtTb2NrZXROb3RpZmllcjsKKworaW1wb3J0IGFuZHJvaWQudXRpbC5Mb2c7CisKK2ltcG9ydCBqYXZhLmlvLklPRXhjZXB0aW9uOworaW1wb3J0IGphdmEubmV0LlNvY2tldDsKK2ltcG9ydCBqYXZhLm5ldC5Tb2NrZXRBZGRyZXNzOworaW1wb3J0IGphdmEubmV0LlNvY2tldFRpbWVvdXRFeGNlcHRpb247CitpbXBvcnQgamF2YS5uZXQuVW5rbm93bkhvc3RFeGNlcHRpb247CitpbXBvcnQgamF2YS51dGlsLkhhc2hTZXQ7CitpbXBvcnQgamF2YS51dGlsLlNldDsKKworLyoqIEBoaWRlICovCitwdWJsaWMgY2xhc3MgTGlua1NvY2tldCBleHRlbmRzIFNvY2tldCB7CisgICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgU3RyaW5nIFRBRyA9ICJMaW5rU29ja2V0IjsKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBib29sZWFuIERCRyA9IHRydWU7CisKKyAgICAvKioKKyAgICAgKiBEZWZhdWx0IGNvbnN0cnVjdG9yCisgICAgICovCisgICAgcHVibGljIExpbmtTb2NrZXQoKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiTGlua1NvY2tldCgpIEVYIik7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ3JlYXRlcyBhIG5ldyB1bmNvbm5lY3RlZCBzb2NrZXQuCisgICAgICogQHBhcmFtIG5vdGlmaWVyIGEgcmVmZXJlbmNlIHRvIGEgY2xhc3MgdGhhdCBpbXBsZW1lbnRzIHtAY29kZSBMaW5rU29ja2V0Tm90aWZpZXJ9CisgICAgICovCisgICAgcHVibGljIExpbmtTb2NrZXQoTGlua1NvY2tldE5vdGlmaWVyIG5vdGlmaWVyKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiTGlua1NvY2tldChub3RpZmllcikgRVgiKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDcmVhdGVzIGEgbmV3IHVuY29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gICAgICAgICAgIHdoaWxlIGNvbm5lY3RpbmcKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBjb25uZWN0KGludCB0aW1lb3V0KSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBpZiAoREJHKSBsb2coImNvbm5lY3QodGltZW91dCkgRVgiKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb25uZWN0IGEgZHVwbGljYXRlIHNvY2tldCBzb2NrZXQgdG8gdGhlIHNhbWUgcmVtb3RlIGhvc3QgYWRkcmVzcyBhbmQgcG9ydAorICAgICAqIGFzIHRoZSBvcmlnaW5hbC4KKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uIGlmIHRoZSBzb2NrZXQgaXMgYWxyZWFkeSBjb25uZWN0ZWQgb3IgYW4gZXJyb3Igb2NjdXJzCisgICAgICogICAgICAgICAgICAgICAgICAgICB3aGlsZSBjb25uZWN0aW5nCisgICAgICovCisgICAgcHVibGljIHZvaWQgY29ubmVjdCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGlmIChEQkcpIGxvZygiY29ubmVjdCgpIEVYIik7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2xvc2VzIHRoZSBzb2NrZXQuICBJdCBpcyBub3QgcG9zc2libGUgdG8gcmVjb25uZWN0IG9yIHJlYmluZCB0byB0aGlzCisgICAgICogc29ja2V0IHRoZXJlYWZ0ZXIgd2hpY2ggbWVhbnMgYSBuZXcgc29ja2V0IGluc3RhbmNlIGhhcyB0byBiZSBjcmVhdGVkLgorICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24gaWYgYW4gZXJyb3Igb2NjdXJzIHdoaWxlIGNsb3NpbmcgdGhlIHNvY2tldAorICAgICAqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBjbG9zZSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGlmIChEQkcpIGxvZygiY2x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b3IgPSBQaG9uZS5BUE5fVFlQRV9ERUZBVUxUOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbUFwblR5cGVUb1dhdGNoRm9yID0gbUFwblR5cGU7Ci0gICAgICAgIH0KICAgICAgICAgaWYgKG5ldFR5cGUgPT0gQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRSB8fAogICAgICAgICAgICAgICAgIG5ldFR5cGUgPT0gQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRV9ISVBSSSkgewogICAgICAgICAgICAgbUlzRGVmYXVsdE9ySGlwcmkgPSB0cnVlOwogICAgICAgICB9CiAKICAgICAgICAgbVBob25lU2VydmljZSA9IG51bGw7Ci0gICAgICAgIGlmKG5ldFR5cGUgPT0gQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRSkgewotICAgICAgICAgICAgbUVuYWJsZWQgPSB0cnVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbUVuYWJsZWQgPSBmYWxzZTsKLSAgICAgICAgfQogCi0gICAgICAgIG1EbnNQcm9wTmFtZXMgPSBuZXcgU3RyaW5nW10geworICAgICAgICBzRG5zUHJvcE5hbWVzID0gbmV3IFN0cmluZ1tdIHsKICAgICAgICAgICAgICAgICAibmV0LnJtbmV0MC5kbnMxIiwKICAgICAgICAgICAgICAgICAibmV0LnJtbmV0MC5kbnMyIiwKICAgICAgICAgICAgICAgICAibmV0LmV0aDAuZG5zMSIsCkBAIC05OSwxNjUgKzk0LDE2OCBAQAogICAgICAgICAgICAgICAgICJuZXQuZ3Bycy5kbnMyIiwKICAgICAgICAgICAgICAgICAibmV0LnBwcDAuZG5zMSIsCiAgICAgICAgICAgICAgICAgIm5ldC5wcHAwLmRuczIifTsKLQogICAgIH0KIAogICAgIC8qKgotICAgICAqIEJlZ2luIG1vbml0b3JpbmcgbW9iaWxlIGRhdGEgY29ubmVjdGl2aXR5LgorICAgICAqIEJlZ2luIG1vbml0b3Jpbmc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bnRzLgotICAgICAgICAgICAgICAgICAgICAgICAgQUNUSU9OX0FOWV9EQVRBX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRCkpIHsKLSAgICAgICAgICAgICAgICAgICAgUGhvbmUuRGF0YVN0YXRlIHN0YXRlID0gZ2V0TW9iaWxlRGF0YVN0YXRlKGludGVudCk7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyByZWFzb24gPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuU1RBVEVfQ0hBTkdFX1JFQVNPTl9LRVkpOwotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXBuTmFtZSA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0FQTl9LRVkpOwotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXBuVHlwZUxpc3QgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9BUE5fVFlQRVNfS0VZKTsKLSAgICAgICAgICAgICAgICAgICAgbUFwbk5hbWUgPSBhcG5OYW1lOworICAgICAgICAgICAgaWYgKGludGVudC5nZXRBY3Rpb24oKS5lcXVhbHMoVGVsZXBob255SW50ZW50cy4KKyAgICAgICAgICAgICAgICAgICAgQUNUSU9OX0FOWV9EQVRBX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRCkpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgYXBuVHlwZSA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0FQTl9UWVBFX0tFWSk7CisgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuZXF1YWxzKGFwblR5cGUsIG1BcG5UeXBlKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIFBob25lLkRhdGFTdGF0ZSBzdGF0ZSA9IEVudW0udmFsdWVPZihQaG9uZS5EYXRhU3RhdGUuY2xhc3MsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuU1RBVEVfS0VZKSk7CisgICAgICAgICAgICAgICAgU3RyaW5nIHJlYXNvbiA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5TVEFURV9DSEFOR0VfUkVBU09OX0tFWSk7CisgICAgICAgICAgICAgICAgU3RyaW5nIGFwbk5hbWUgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9BUE5fS0VZKTsKIAotICAgICAgICAgICAgICAgICAgICBib29sZWFuIHVuYXZhaWxhYmxlID0gaW50ZW50LmdldEJvb2xlYW5FeHRyYShQaG9uZS5ORVRXT1JLX1VOQVZBSUxBQkxFX0tFWSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSk7CisgICAgICAgICAgICAgICAgbU5ldHdvcmtJbmZvLnNldElzQXZhaWxhYmxlKCFpbnRlbnQuZ2V0Qm9vbGVhbkV4dHJhKFBob25lLk5FVFdPUktfVU5BVkFJTEFCTEVfS0VZLAorICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpKTsKIAotICAgICAgICAgICAgICAgICAgICAvLyBzZXQgdGhpcyByZWdhcmRsZXNzIG9mIHRoZSBhcG5UeXBlTGlzdC4gIEl0J3MgYWxsIHRoZSBzYW1lIHJhZGlvL25ldHdvcmsKLSAgICAgICAgICAgICAgICAgICAgLy8gdW5kZXJuZWF0aAotICAgICAgICAgICAgICAgICAgICBtTmV0d29ya0luZm8uc2V0SXNBdmFpbGFibGUoIXVuYXZhaWxhYmxlKTsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIG1BcG5UeXBlICsgIiBSZWNlaXZlZCBzdGF0ZT0gIiArIHN0YXRlICsgIiwgb2xkPSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Nb2JpbGVEYXRhU3RhdGUgKyAiLCByZWFzb249ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgKHJlYXNvbiA9PSBudWxsID8gIih1bnNwZWNpZmllZCkiIDogcmVhc29uKSk7CiAKLSAgICAgICAgICAgICAgICAgICAgaWYgKGlzQXBuVHlwZUluY2x1ZGVkKGFwblR5cGVMaXN0KSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1FbmFibGVkID09IGZhbHNlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgd2UncmUgbm90IGVuYWJsZWQgYnV0IHRoZSBBUE4gVHlwZSBpcyBzdXBwb3J0ZWQgYnkgdGhpcyBjb25uZWN0aW9uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2Ugc2hvdWxkIHJlY29yZCB0aGUgaW50ZXJmYWNlIG5hbWUgaWYgb25lJ3MgcHJvdmlkZWQuICBJZiB0aGUgdXNlcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHR1cm5zIG9uIHRoaXMgbmV0d29yayB3ZSB3aWxsIG5lZWQgdGhlIGludGVyZmFjZW5hbWUgYnV0IHdvbid0IGdldAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGEgZnJlc2ggY29ubmVjdGVkIG1lc3NhZ2UgLSBUT0RPIGZpeCB0aGlzIHdoZW4gd2UgZ2V0IHBlci1BUE4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBub3RpZmljYXRpb25zCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRlID09IFBob25lLkRhdGFTdGF0ZS5DT05ORUNURUQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAicmVwbGFjaW5nIG9sZCBtSW50ZXJmYWNlTmFtZSAoIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUludGVyZmFjZU5hbWUgKyAiKSB3aXRoICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0lGQUNFX05BTUVfS0VZKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBmb3IgIiArIG1BcG5UeXBlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUludGVyZmFjZU5hbWUgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9JRkFDRV9OQU1FX0tFWSk7CisgICAgICAgICAgICAgICAgaWYgKG1Nb2JpbGVEYXRhU3RhdGUgIT0gc3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgbU1vYmlsZURhdGFTdGF0ZSA9IHN0YXRlOworICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpc1RlYXJkb3duUmVxdWVzdGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGVhcmRvd25SZXF1ZXN0ZWQoZmFsc2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIG1BcG5UeXBlICsgIiBSZWNlaXZlZCBzdGF0ZT0gIiArIHN0YXRlICsgIiwgb2xkPSAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTW9iaWxlRGF0YVN0YXRlICsgIiwgcmVhc29uPSAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVhc29uID09IG51bGwgPyAiKHVuc3BlY2lmaWVkKSIgOiByZWFzb24pICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCBhcG5UeXBlTGlzdD0gIiArIGFwblR5cGVMaXN0KTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobU1vYmlsZURhdGFTdGF0ZSAhPSBzdGF0ZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbU1vYmlsZURhdGFTdGF0ZSA9IHN0YXRlOwotICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChzdGF0ZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVEVEOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpc1RlYXJkb3duUmVxdWVzdGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1FbmFibGVkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUZWFyZG93blJlcXVlc3RlZChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLkRJU0NPTk5FQ1RFRCwgcmVhc29uLCBhcG5OYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGRvUmVzZXQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtSXNEZWZhdWx0T3JIaXByaSA9PSB0cnVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJvdGggZGVmYXVsdCBhbmQgaGlwcmkgbXVzdCBnbyBkb3duIGJlZm9yZSB3ZSByZXNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdHlwZVRvQ2hlY2sgPSAoUGhvbmUuQVBOX1RZUEVfREVGQVVMVC5lcXVhbHMobUFwblR5cGUpID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9NT0JJTEVfSElQUkkgOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQ29ubmVjdGl2aXR5TWFuYWdlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJQmluZGVyIGIgPSBTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb250ZXh0LkNPTk5FQ1RJVklUWV9TRVJWSUNFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0aXZpdHlNYW5hZ2VyID0gSUNvbm5lY3Rpdml0eU1hbmFnZXIuU3R1Yi5hc0ludGVyZmFjZShiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5ESVNDT05ORUNURUQsIHJlYXNvbiwgYXBuTmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gZG9SZXNldCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtSXNEZWZhdWx0T3JIaXByaSA9PSB0cnVlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBib3RoIGRlZmF1bHQgYW5kIGhpcHJpIG11c3QgZ28gZG93biBiZWZvcmUgd2UgcmVzZXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB0eXBlVG9DaGVjayA9IChQaG9uZS5BUE5fVFlQRV9ERUZBVUxULmVxdWFscyhtQXBuVHlwZSkgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb25uZWN0aXZpdHlNYW5hZ2VyLlRZUEVfTU9CSUxFX0hJUFJJIDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUNvbm5lY3Rpdml0eU1hbmFnZXIgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0aXZpdHlNYW5hZ2VyID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChDb25uZWN0aXZpdHlNYW5hZ2VyKWNvbnRleHQuZ2V0U3lzdGVtU2VydmljZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbnRleHQuQ09OTkVDVElWSVRZX1NFUlZJQ0UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Db25uZWN0aXZpdHlNYW5hZ2VyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrSW5mbyBpbmZvID0gbUNvbm5lY3Rpdml0eU1hbmFnZXIuZ2V0TmV0d29ya0luZm8oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZVRvQ2hlY2spOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmZvICE9IG51bGwgJiYgaW5mby5pc0Nvbm5lY3RlZCgpID09IHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVUb0NoZWNrKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5mby5pc0Nvbm5lY3RlZCgpID09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9SZXNldCA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGp1c3QgZ28gYWhlYWQgd2l0aCB0aGUgcmVzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkV4Y2VwdGlvbiB0cnlpbmcgdG8gY29udGFjdCBDb25uU2VydmljZTogIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb1Jlc2V0ICYmIG1JbnRlcmZhY2VOYW1lICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5ldHdvcmtVdGlscy5yZXNldENvbm5lY3Rpb25zKG1JbnRlcmZhY2VOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjYW4ndCBkbyB0aGlzIGhlcmUgLSBDb25uZWN0aXZpdHlTZXJ2aWNlIG5lZWRzIGl0IHRvIGNsZWFyIHN0dWZmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGl0J3Mgb2sgdGhvdWdoIC0ganVzdCBsZWF2ZSBpdCB0byBiZSByZWZyZXNoZWQgbmV4dCB0aW1lCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIGNvbm5lY3QuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaWYgKERCRykgTG9nLmQoVEFHLCAiY2xlYXJpbmcgbUludGVyZmFjZU5hbWUgZm9yICIrIG1BcG5UeXBlICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICIgYXMgaXQgRElTQ09OTkVDVEVEIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbUludGVyZmFjZU5hbWUgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL21EZWZhdWx0R2F0ZXdheUFkZHIgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RJTkc6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5DT05ORUNUSU5HLCByZWFzb24sIGFwbk5hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNVU1BFTkRFRDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLlNVU1BFTkRFRCwgcmVhc29uLCBhcG5OYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBDT05ORUNURUQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbnRlcmZhY2VOYW1lID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfSUZBQ0VfTkFNRV9LRVkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUludGVyZmFjZU5hbWUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiQ09OTkVDVEVEIGV2ZW50IGRpZCBub3Qgc3VwcGx5IGludGVyZmFjZSBuYW1lLiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1EZWZhdWx0R2F0ZXdheUFkZHIgPSBpbnRlbnQuZ2V0SW50RXh0cmEoUGhvbmUuREFUQV9HQVRFV0FZX0tFWSwgMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5DT05ORUNURUQsIHJlYXNvbiwgYXBuTmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG9SZXNldCAmJiBtTGlua1Byb3BlcnRpZXMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgaWZhY2UgPSBtTGlua1Byb3BlcnRpZXMuZ2V0SW50ZXJmYWNlTmFtZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWZhY2UgIT0gbnVsbCkgTmV0d29ya1V0aWxzLnJlc2V0Q29ubmVjdGlvbnMoaWZhY2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIC0gY2hlY2sgdGhpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbid0IGRvIHRoaXMgaGVyZSAtIENvbm5lY3Rpdml0eVNlcnZpY2UgbmVlZHMgaXQgdG8gY2xlYXIgc3R1ZmYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpdCdzIG9rIHRob3VnaCAtIGp1c3QgbGVhdmUgaXQgdG8gYmUgcmVmcmVzaGVkIG5leHQgdGltZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIGNvbm5lY3QuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9pZiAoREJHKSBMb2cuZChUQUcsICJjbGVhcmluZyBtSW50ZXJmYWNlTmFtZSBmb3IgIisgbUFwblR5cGUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAiIGFzIGl0IERJU0NPTk5FQ1RFRCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbUludGVyZmFjZU5hbWUgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbURlZmF1bHRHYXRld2F5QWRkciA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RJTkc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLkNPTk5FQ1RJTkcsIHJlYXNvbiwgYXBuTmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNVU1BFTkRFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuU1VTUEVOREVELCByZWFzb24sIGFwbk5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBDT05ORUNURUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxpbmtQcm9wZXJ0aWVzID0gaW50ZW50LmdldFBhcmNlbGFibGVFeHRyYSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBob25lLkRBVEFfTElOS19QUk9QRVJUSUVTX0tFWSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1MaW5rUHJvcGVydGllcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIkNPTk5FQ1RFRCBldmVudCBkaWQgbm90IHN1cHBseSBsaW5rIHByb3BlcnRpZXMuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MaW5rUHJvcGVydGllcyA9IG5ldyBMaW5rUHJvcGVydGllcygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGlua0NhcGFiaWxpdGllcyA9IGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQaG9uZS5EQVRBX0xJTktfQ0FQQUJJTElUSUVTX0tFWSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1MaW5rQ2FwYWJpbGl0aWVzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiQ09OTkVDVEVEIGV2ZW50IGRpZCBub3Qgc3VwcGx5IGxpbmsgY2FwYWJpbGl0aWVzLiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGlua0NhcGFiaWxpdGllcyA9IG5ldyBMaW5rQ2FwYWJpbGl0aWVzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5DT05ORUNURUQsIHJlYXNvbiwgYXBuTmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGludGVudC5nZXRBY3Rpb24oKS4KLSAgICAgICAgICAgICAgICAgICAgICAgIGVxdWFscyhUZWxlcGhvbnlJbnRlbnRzLkFDVElPTl9EQVRBX0NPTk5FQ1RJT05fRkFJTEVEKSkgewotICAgICAgICAgICAgICAgICAgICBtRW5hYmxlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcmVhc29uID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkZBSUxVUkVfUkVBU09OX0tFWSk7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBhcG5OYW1lID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfQVBOX0tFWSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIlJlY2VpdmVkICIgKyBpbnRlbnQuZ2V0QWN0aW9uKCkgKyAiIGJyb2FkY2FzdCIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYXNvbiA9PSBudWxsID8gIiIgOiAiKCIgKyByZWFzb24gKyAiKSIpOwotICAgICAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuRkFJTEVELCByZWFzb24sIGFwbk5hbWUpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBUZWxlcGhvbnlNYW5hZ2VyIHRtID0gVGVsZXBob255TWFuYWdlci5nZXREZWZhdWx0KCk7Ci0gICAgICAgICAgICAgICAgc2V0Um9hbWluZ1N0YXR1cyh0bS5pc05ldHdvcmtSb2FtaW5nKCkpOwotICAgICAgICAgICAgICAgIHNldFN1YnR5cGUodG0uZ2V0TmV0d29ya1R5cGUoKSwgdG0uZ2V0TmV0d29ya1R5cGVOYW1lKCkpOworICAgICAgICAgICAgfSBlbHNlIGlmIChpbnRlbnQuZ2V0QWN0aW9uKCkuCisgICAgICAgICAgICAgICAgICAgIGVxdWFscyhUZWxlcGhvbnlJbnRlbnRzLkFDVElPTl9EQVRBX0NPTk5FQ1RJT05fRkFJTEVEKSkgeworICAgICAgICAgICAgICAgIFN0cmluZyBhcG5UeXBlID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfQVBOX1RZUEVfS0VZKTsKKyAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5lcXVhbHMoYXBuVHlwZSwgbUFwblR5cGUpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgU3RyaW5nIHJlYXNvbiA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5GQUlMVVJFX1JFQVNPTl9LRVkpOworICAgICAgICAgICAgICAgIFN0cmluZyBhcG5OYW1lID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfQVBOX0tFWSk7CisgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBtQXBuVHlwZSArICJSZWNlaXZlZCAiICsgaW50ZW50LmdldEFjdGlvbigpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICIgYnJvYWRjYXN0IiArIHJlYXNvbiA9PSBudWxsID8gIiIgOiAiKCIgKyByZWFzb24gKyAiKSIpOworICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5GQUlMRUQsIHJlYXNvbiwgYXBuTmFtZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0yNzIsMzMgKzI3MCw3IEBACiAgICAgICogUmVwb3J0IHdoZXRoZXIgZGF0YSBjb25uZWN0aXZpdHkgaXMgcG9zc2libGUuCiAgICAgICovCiAgICAgcHVibGljIGJvb2xlYW4gaXNBdmFpbGFibGUoKSB7Ci0gICAgICAgIGdldFBob25lU2VydmljZShmYWxzZSk7Ci0KLSAgICAgICAg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mZvLlN0YXRlLkNPTk5FQ1RJTkcpOworICAgICAgICAgICAgU3RyaW5nIGxhc3RSZWFzb24gPSBtTmV0d29ya0luZm8uZ2V0UmVhc29uKCk7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogSWYgYSByZWFzb24gd2FzIHN1cHBsaWVkIHdoZW4gdGhlIENPTk5FQ1RJTkcgc3RhdGUgd2FzIGVudGVyZWQsIGFuZCBubworICAgICAgICAgICAgICogcmVhc29uIHdhcyBzdXBwbGllZCBmb3IgZW50ZXJpbmcgdGhlIENPTk5FQ1RFRCBzdGF0ZSwgdGhlbiByZXRhaW4gdGhlCisgICAgICAgICAgICAgKiByZWFzb24gdGhhdCB3YXMgc3VwcGxpZWQgd2hlbiBnb2luZyB0byBDT05ORUNUSU5HLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAod2FzQ29ubmVjdGluZyAmJiBzdGF0ZSA9PSBOZXR3b3JrSW5mby5EZXRhaWxlZFN0YXRlLkNPTk5FQ1RFRCAmJiByZWFzb24gPT0gbnVsbAorICAgICAgICAgICAgICAgICAgICAmJiBsYXN0UmVhc29uICE9IG51bGwpCisgICAgICAgICAgICAgICAgcmVhc29uID0gbGFzdFJlYXNvbjsKKyAgICAgICAgICAgIG1OZXR3b3JrSW5mby5zZXREZXRhaWxlZFN0YXRlKHN0YXRlLCByZWFzb24sIGV4dHJhSW5mbyk7CisgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1UYXJnZXQub2J0YWluTWVzc2FnZShFVkVOVF9TVEFURV9DSEFOR0VELCBtTmV0d29ya0luZm8pOworICAgICAgICAgICAgbXNnLnNlbmRUb1RhcmdldCgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0VGVhcmRvd25SZXF1ZXN0ZWQoYm9vbGVhbiBpc1JlcXVlc3RlZCkgeworICAgICAgICBtVGVhcmRvd25SZXF1ZXN0ZWQgPSBpc1JlcXVlc3RlZDsKKyAgICB9CisKKyAgICB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AgbUVuYWJsZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIGVsc2UgZmFsbCB0aHJvdWdoCiAgICAgICAgICAgICBjYXNlIFBob25lLkFQTl9UWVBFX05PVF9BVkFJTEFCTEU6Ci0gICAgICAgICAgICAgICAgLy8gRGVmYXVsdCBpcyBhbHdheXMgYXZhaWxhYmxlLCBidXQgbWF5IGJlIG9mZiBkdWUgdG8KLSAgICAgICAgICAgICAgICAvLyBBaXJwbGFuZU1vZGUgb3IgRS1DYWxsIG9yIHdoYXRldmVyLi4KLSAgICAgICAgICAgICAgICBpZiAobUFwblR5cGUgIT0gUGhvbmUuQVBOX1RZUEVfREVGQVVMVCkgewotICAgICAgICAgICAgICAgICAgICBtRW5hYmxlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgaW4gcmVjb25uZWN0IC0gdW5leHBlY3RlZCByZXNwb25zZS4iKTsKLSAgICAgICAgICAgICAgICBtRW5hYmxlZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBtRW5hYmxlZDsKKyAgICAgICAgcmV0dXJuIHJldFZhbHVlOwogICAgIH0KIAogICAgIC8qKgpAQCAtNDg2LDI1ICs0NjIsNiBAQAogICAgICAgICByZXR1cm4gLTE7CiAgICAgfQogCi0gICAgLyoqCi0gICAgICogRW5zdXJlIHRoYXQgYSBuZXR3b3JrIHJvdXRlIGV4aXN0cyB0byBkZWxpdmVyIHRyYWZmaWMgdG8gdGhlIHNwZWNpZmllZAotICAgICAqIGhvc3QgdmlhIHRoZSBtb2JpbGUgZGF0YSBuZXR3b3JrLgotICAgICAqIEBwYXJhbSBob3N0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AKICAgICB2b2lkIHNldFN1YnR5cGUoaW50IHN1YnR5cGUsIFN0cmluZyBzdWJ0eXBlTmFtZSkgewotICAgICAgICBtU3VidHlwZSA9IHN1YnR5cGU7Ci0gICAgICAgIG1TdWJ0eXBlTmFtZSA9IHN1YnR5cGVOYW1lOworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIG1TdWJ0eXBlID0gc3VidHlwZTsKKyAgICAgICAgICAgIG1TdWJ0eXBlTmFtZSA9IHN1YnR5cGVOYW1lOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC0xNjQsNyArMTczLDkgQEAKICAgICAgKiBAcmV0dXJuIHRoZSBuYW1lIG9mIHRoZSBuZXR3b3JrIHR5cGUKICAgICAgKi8KICAgICBwdWJsaWMgU3RyaW5nIGdldFR5cGVOYW1lKCkgewotICAgICAgICByZXR1cm4gbVR5cGVOYW1lOworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIHJldHVybiBtVHlwZU5hbWU7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTE3Miw3ICsxODMsOSBAQAogICAgICAqIEByZXR1cm4gdGhlIG5hbWUgb2YgdGhlIG5ldHdvcmsgc3VidHlwZQogICAgICAqLwogICAgIHB1YmxpYyBTdHJpbmcgZ2V0U3VidHlwZU5hbWUoKSB7Ci0gICAgICAgIHJldHVybiBtU3VidHlwZU5hbWU7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgcmV0dXJuIG1TdWJ0eXBlTmFtZTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIC8qKgpAQCAtMTg1LDcgKzE5OCw5IEBACiAgICAgICogb2YgYmVpbmcgZXN0YWJsaXNoZWQsIHtAY29kZSBmYWxzZX0gb3RoZXJ3aXNlLgogICAgICAqLwogICAgIHB1YmxpYyBib29sZWFuIGlzQ29ubmVjdGVkT3JDb25uZWN0a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yB2b2lkIHNldElzQXZhaWxhYmxlKGJvb2xlYW4gaXNBdmFpbGFibGUpIHsKLSAgICAgICAgbUlzQXZhaWxhYmxlID0gaXNBdmFpbGFibGU7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgbUlzQXZhaWxhYmxlID0gaXNBdmFpbGFibGU7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTIzMSw3ICsyNTIsOSBAQAogICAgICAqIG90aGVyd2lzZS4KICAgICAgKi8KICAgICBwdWJsaWMgYm9vbGVhbiBpc0ZhaWxvdmVyKCkgewotICAgICAgICByZXR1cm4gbUlzRmFpbG92ZXI7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgcmV0dXJuIG1Jc0ZhaWxvdmVyOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC0yNDEsNyArMjY0LDkgQEAKICAgICAgKiBAaGlkZQogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldEZhaWxvdmVyKGJvb2xlYW4gaXNGYWlsb3ZlcikgewotICAgICAgICBtSXNGYWlsb3ZlciA9IGlzRmFpbG92ZXI7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgbUlzRmFpbG92ZXIgPSBpc0ZhaWxvdmVyOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC0yNTEsMTEgKzI3NiwxNSBAQAogICAgICAqIEByZXR1cm4ge0Bjb2RlIHRydWV9IGlmIHJvYW1pbmcgaXMgaW4gZWZmZWN0LCB7QGNvZGUgZmFsc2V9IG90aGVyd2lzZS4KICAgICAgKi8KICAgICBwdWJsaWMgYm9vbGVhbiBpc1JvYW1pbmcoKSB7Ci0gICAgICAgIHJldHVybiBtSXNSb2FtaW5nOworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIHJldHVybiBtSXNSb2FtaW5nOworICAgICAgICB9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gbmV0d29ya2luZyBsYXllcnMuCisgICAgICogQGhpZGUKICAgICAgKi8KLSAgICB2b2lkIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZSBkZXRhaWxlZFN0YXRlLCBTdHJpbmcgcmVhc29uLCBTdHJpbmcgZXh0cmFJbmZvKSB7Ci0gICAgICAgIHRoaXMubURldGFpbGVkU3RhdGUgPSBkZXRhaWxlZFN0YXRlOwotICAgICAgICB0aGlzLm1TdGF0ZSA9IHN0YXRlTWFwLmdldChkZXRhaWxlZFN0YXRlKTsKLSAgICAgICAgdGhpcy5tUmVhc29uID0gcmVhc29uOwotICAgICAgICB0aGlzLm1FeHRyYUluZm8gPSBleHRyYUluZm87CisgICAgcHVibGljIHZvaWQgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlIGRldGFpbGVkU3RhdGUsIFN0cmluZyByZWFzb24sIFN0cmluZyBleHRyYUluZm8pIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICB0aGlzLm1EZXRhaWxlZFN0YXRlID0gZGV0YWlsZWRTdGF0ZTsKKyAgICAgICAgICAgIHRoaXMubVN0YXRlID0gc3RhdGVNYXAuZ2V0KGRldGFpbGVkU3RhdGUpOworICAgICAgICAgICAgdGhpcy5tUmVhc29uID0gcmVhc29uOworICAgICAgICAgICAgdGhpcy5tRXh0cmFJbmZvID0gZXh0cmFJbmZvOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC0yOTUsNyArMzMxLDkgQEAKICAgICAgKiBAcmV0dXJuIHRoZSByZWFzb24gZm9yIGZhaWx1cmUsIG9yIG51bGwgaWYgbm90IGF2YWlsYWJsZQogICAgICAqLwogICAgIHB1YmxpYyBTdHJpbmcgZ2V0UmVhc29uKCkgewotICAgICAgICByZXR1cm4gbVJlYXNvbjsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICByZXR1cm4gbVJlYXNvbjs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TcgKzM3NiwxOSBAQAogICAgICAqIEBoaWRlCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7Ci0gICAgICAgIGRlc3Qud3JpdGVJbnQobU5ldHdvcmtUeXBlKTsKLSAgICAgICAgZGVzdC53cml0ZUludChtU3VidHlwZSk7Ci0gICAgICAgIGRlc3Qud3JpdGVTdHJpbmcobVR5cGVOYW1lKTsKLSAgICAgICAgZGVzdC53cml0ZVN0cmluZyhtU3VidHlwZU5hbWUpOwotICAgICAgICBkZXN0LndyaXRlU3RyaW5nKG1TdGF0ZS5uYW1lKCkpOwotICAgICAgICBkZXN0LndyaXRlU3RyaW5nKG1EZXRhaWxlZFN0YXRlLm5hbWUoKSk7Ci0gICAgICAgIGRlc3Qud3JpdGVJbnQobUlzRmFpbG92ZXIgPyAxIDogMCk7Ci0gICAgICAgIGRlc3Qud3JpdGVJbnQobUlzQXZhaWxhYmxlID8gMSA6IDApOwotICAgICAgICBkZXN0LndyaXRlSW50KG1Jc1JvYW1pbmcgPyAxIDogMCk7Ci0gICAgICAgIGRlc3Qud3JpdGVTdHJpbmcobVJlYXNvbik7Ci0gICAgICAgIGRlc3Qud3JpdGVTdHJpbmcobUV4dHJhSW5mbyk7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgZGVzdC53cml0ZUludChtTmV0d29ya1R5cGUpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChtU3VidHlwZSk7CisgICAgICAgICAgICBkZXN0LndyaXRlU3RyaW5nKG1UeXBlTmFtZSk7CisgICAgICAgICAgICBkZXN0LndyaXRlU3RyaW5nKG1TdWJ0eXBlTmFtZSk7CisgICAgICAgICAgICBkZXN0LndyaXRlU3RyaW5nKG1TdGF0ZS5uYW1lKCkpOworICAgICAgICAgICAgZGVzdC53cml0ZVN0cmluZyhtRGV0YWlsZWRTdGF0ZS5uYW1lKCkpOworICAgICA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otICAgICAgICBpbnQgaSwgajsKLQotICAgICAgICBmb3IgKGkgPSAwLCBqID0gMDsgaSA8IHByb3BlcnR5TmFtZXMubGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KHByb3BlcnR5TmFtZXNbaV0pOwotICAgICAgICAgICAgLy8gVGhlIEdTTSBsYXllciBzb21ldGltZXMgc2V0cyBhIGJvZ3VzIEROUyBzZXJ2ZXIgYWRkcmVzcyBvZgotICAgICAgICAgICAgLy8gMC4wLjAuMAotICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZSkgJiYgIVRleHRVdGlscy5lcXVhbHModmFsdWUsICIwLjAuMC4wIikpIHsKLSAgICAgICAgICAgICAgICBkbnNBZGRyZXNzZXNbaisrXSA9IHZhbHVlOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBkbnNBZGRyZXNzZXM7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgYWRkUHJpdmF0ZURuc1JvdXRlcygpIHsKLSAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgTG9nLmQoVEFHLCAiYWRkUHJpdmF0ZURuc1JvdXRlcyBmb3IgIiArIHRoaXMgKwotICAgICAgICAgICAgICAgICAgICAiKCIgKyBtSW50ZXJmYWNlTmFtZSArICIpIC0gbVByaXZhdGVEbnNSb3V0ZVNldCA9ICIrbVByaXZhdGVEbnNSb3V0ZVNldCk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKG1JbnRlcmZhY2VOYW1lICE9IG51bGwgJiYgIW1Qcml2YXRlRG5zUm91dGVTZXQpIHsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIGFkZHJTdHJpbmcgOiBnZXROYW1lU2VydmVycygpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGFkZHJTdHJpbmcgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgSW5ldEFkZHJlc3MgaW5ldEFkZHJlc3MgPSBJbmV0QWRkcmVzcy5nZXRCeU5hbWUoYWRkclN0cmluZyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICIgIGFkZGluZyAiICsgYWRkclN0cmluZyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoTmV0d29ya1V0aWxzLmFkZEhvc3RSb3V0ZShtSW50ZXJmYWNlTmFtZSwgaW5ldEFkZHJlc3MsIG51bGwpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVEbnNSb3V0ZVNldCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVua25vd25Ib3N0RXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIiBETlMgYWRkcmVzcyAiICsgYWRkclN0cmluZyArICIgOiBFeGNlcHRpb24gIiArIGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgcmVtb3ZlUHJpdmF0ZURuc1JvdXRlcygpIHsKLSAgICAgICAgLy8gVE9ETyAtIHdlIHNob3VsZCBkbyB0aGlzIGV4cGxpY2l0bHkgYnV0IHRoZSBOZXRVdGlscyBhcGkgZG9lc250Ci0gICAgICAgIC8vIHN1cHBvcnQgdGhpcyB5ZXQgLSBtdXN0IHJlbW92ZSBhbGwuICBObyB3b3JzZSB0aGFuIGJlZm9yZQotICAgICAgICBpZiAobUludGVyZmFjZU5hbWUgIT0gbnVsbCAmJiBtUHJpdmF0ZURuc1JvdXRlU2V0KSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgIC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NlIHsKLSAgICAgICAgICAgICAgICBpZiAoIU5ldHdvcmtVdGlscy5hZGREZWZhdWx0Um91dGUobUludGVyZmFjZU5hbWUsIGluZXRBZGRyZXNzKSAmJiBEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiICBVbmFibGUgdG8gYWRkIGRlZmF1bHQgcm91dGUuIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgcmVtb3ZlRGVmYXVsdFJvdXRlKCkgewotICAgICAgICBpZiAobUludGVyZmFjZU5hbWUgIT0gbnVsbCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKFRBRywgInJlbW92ZURlZmF1bHRSb3V0ZSBmb3IgIiArIG1OZXR3b3JrSW5mby5nZXRUeXBlTmFtZSgpICsgIiAoIiArCi0gICAgICAgICAgICAgICAgICAgICAgICBtSW50ZXJmYWNlTmFtZSArICIpIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBOZXR3b3JrVXRpbHMucmVtb3ZlRGVmYXVsdFJvdXRlKG1JbnRlcmZhY2VOYW1lKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJlYWRzIHRoZSBuZXR3b3JrIHNwZWNpZmljIFRDUCBidWZmZXIgc2l6ZXMgZnJvbSBTeXN0ZW1Qcm9wZXJ0aWVzCi0gICAgICogbmV0LnRjcC5idWZmZXJzaXplLltkZWZhdWx0fHdpZml8dW10c3xlZGdlfGdwcnNdIGFuZCBzZXQgdGhlbSBmb3Igc3lzdGVtCi0gICAgICogd2lkZSB1c2UKLSAgICAgKi8KLSAgIHB1YmxpYyB2b2lkIHVwZGF0ZU5ldHdvcmtTZXR0aW5ncygpIHsKLSAgICAgICAgU3RyaW5nIGtleSA9IGdldFRjcEJ1ZmZlclNpemVzUHJvcE5hbWUoKTsKLSAgICAgICAgU3RyaW5nIGJ1ZmZlclNpemVzID0gU3lzdGVtUHJvcGVydGllcy5nZXQoa2V5KTsKLQotICAgICAgICBpZiAoYnVmZmVyU2l6ZXMubGVuZ3RoKCkgPT0gMCkgewotICAgICAgICAgICAgTG9nLncoVEFHLCBrZXkgKyAiIG5vdCBmb3VuZCBpbiBzeXN0ZW0gcHJvcGVydGllcy4gVXNpbmcgZGVmYXVsdHMiKTsKLQotICAgICAgICAgICAgLy8gU2V0dGluZyB0byBkZWZhdWx0IHZhbHVlcyBzbyB3ZSB3b24ndCBiZSBzdHVjayB0byBwcmV2aW91cyB2YWx1ZXMKLSAgICAgICAgICAgIGtleSA9ICJuZXQudGNwLmJ1ZmZlcnNpemUuZGVmYXVsdCI7Ci0gICAgICAgICAgICBidWZmZXJTaXplcyA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KGtleSk7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBTZXQgdmFsdWVzIGluIGtlcm5lbAotICAgICAgICBpZiAoYnVmZmVyU2l6ZXMubGVuZ3RoKCkgIT0gMCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy52KFRBRywgIlNldHRpbmcgVENQIHZhbHVlczogWyIgKyBidWZmZXJTaXplcwotICAgICAgICAgICAgICAgICAgICAgICAgKyAiXSB3aGljaCBjb21lcyBmcm9tIFsiICsga2V5ICsgIl0iKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHNldEJ1ZmZlclNpemUoYnVmZmVyU2l6ZXMpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogUmVsZWFzZSB0aGUgd2FrZWxvY2ssIGlmIGFueSwgdGhhdCBtYXkgYmUgaGVsZCB3aGlsZSBoYW5kbGluZyBhCi0gICAgICogZGlzY29ubmVjdCBvcGVyYXRpb24uCi0gICAgICovCi0gICAgcHVibGljIHZvaWQgcmVsZWFzZVdha2VMb2NrKCkgewotICAgIH0KLQotICAgIC8qKgotICA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IHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24geworICAgICAgICBieXRlIFtdIGFkZHIgPSBpbmV0QWRkci5nZXRBZGRyZXNzKCk7CisgICAgICAgIGlmIChhZGRyLmxlbmd0aCAhPSA0KSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJOb3QgYW4gSVB2NCBhZGRyZXNzIik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuICgoYWRkclszXSAmIDB4ZmYpIDw8IDI0KSB8ICgoYWRkclsyXSAmIDB4ZmYpIDw8IDE2KSB8CisgICAgICAgICAgICAgICAgKChhZGRyWzFdICYgMHhmZikgPDwgOCkgfCAoYWRkclswXSAmIDB4ZmYpOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnZlcnQgYSBuZXR3b3JrIHByZWZpeCBsZW5ndGggdG8gYW4gSVB2NCBuZXRtYXNrIGludGVnZXIKKyAgICAgKiBAcGFyYW0gcHJlZml4TGVuZ3RoCisgICAgICogQHJldHVybiB0aGUgSVB2NCBuZXRtYXNrIGFzIGFuIGludGVnZXIgaW4gbmV0d29yayBieXRlIG9yZGVyCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBpbnQgcHJlZml4TGVuZ3RoVG9OZXRtYXNrSW50KGludCBwcmVmaXhMZW5ndGgpCisgICAgICAgICAgICB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKHByZWZpeExlbmd0aCA8IDAgfHwgcHJlZml4TGVuZ3RoID4gMzIpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkludmFsaWQgcHJlZml4IGxlbmd0aCAoMCA8PSBwcmVmaXggPD0gMzIpIik7CisgICAgICAgIH0KKyAgICAgICAgaW50IHZhbHVlID0gMHhmZmZmZmZmZiA8PCAoMzIgLSBwcmVmaXhMZW5ndGgpOworICAgICAgICByZXR1cm4gSW50ZWdlci5yZXZlcnNlQnl0ZXModmFsdWUpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBpc0lwQWRkcmVzcyhTdHJpbmcgYWRkcmVzcykgeworICAgICAgICAvL1RPRE86IEFkZCBOZXR3b3JrVXRpbHMgc3VwcG9ydCBmb3IgSVB2NiBjb25maWd1cmF0aW9uIGFuZAorICAgICAgICAvL3JlbW92ZSBJUHY0IHZhbGlkYXRpb24gYW5kIHVzZSBhIGdlbmVyaWMgSW5ldEFkZHJlc3MgdmFsaWRhdGlvbgorICAgICAgICB0cnkgeworICAgICAgICAgICAgU3RyaW5nW10gcGFydHMgPSBhZGRyZXNzLnNwbGl0KCJcXC4iKTsKKyAgICAgICAgICAgIGlmIChwYXJ0cy5sZW5ndGggIT0gNCkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBhID0gSW50ZWdlci5wYXJzZUludChwYXJ0c1swXSk7CisgICAgICAgICAgICBpZiAoYSA8IDAgfHwgYSA+IDI1NSkgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgYSA9IEludGVnZXIucGFyc2VJbnQocGFydHNbMV0pOworICAgICAgICAgICAgaWYgKGEgPCAwIHx8IGEgPiAyNTUpIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIGEgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnRzWzJdKTsKKyAgICAgICAgICAgIGlmIChhIDwgMCB8fCBhID4gMjU1KSByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICBhID0gSW50ZWdlci5wYXJzZUludChwYXJ0c1szXSk7CisgICAgICAgICAgICBpZiAoYSA8IDAgfHwgYSA+IDI1NSkgcmV0dXJuIGZhbHNlOworICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKK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CisKKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzVVJMSW5FeGNsdXNpb25MaXN0KFN0cmluZyB1cmwsIFN0cmluZ1tdIGV4Y2x1c2lvbkxpc3QpIHsKKyAgICAgICAgaWYgKHVybCA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgVXJpIHUgPSBVcmkucGFyc2UodXJsKTsKKyAgICAgICAgU3RyaW5nIHVybERvbWFpbiA9IHUuZ2V0SG9zdCgpOworICAgICAgICAvLyBJZiB0aGUgZG9tYWluIGlzIGRlZmluZWQgYXMgIi5hbmRyb2lkLmNvbSIgb3IgImFuZHJvaWQuY29tIiwgd2Ugd2lzaCB0byBtYXRjaAorICAgICAgICAvLyBodHRwOi8vYW5kcm9pZC5jb20gYXMgd2VsbCBhcyBodHRwOi8veHh4LmFuZHJvaWQuY29tICwgYnV0IG5vdAorICAgICAgICAvLyBodHRwOi8vbXlhbmRyb2lkLmNvbSAuIFRoaXMgY29kZSB3b3JrcyBvdXQgdGhlIGxvZ2ljLgorICAgICAgICBmb3IgKFN0cmluZyBleGNsdWRlZERvbWFpbiA6IGV4Y2x1c2lvbkxpc3QpIHsKKyAgICAgICAgICAgIFN0cmluZyBkb3REb21haW4gPSAiLiIgKyBleGNsdWRlZERvbWFpbjsKKyAgICAgICAgICAgIGlmICh1cmxEb21haW4uZXF1YWxzKGV4Y2x1ZGVkRG9tYWluKSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHVybERvbWFpbi5lbmRzV2l0aChkb3REb21haW4pKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8gTm8gbWF0Y2gKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIFN0cmluZyBwYXJzZUhvc3QoU3RyaW5nIHByb3h5U3BlYykgeworICAgICAgICBpbnQgaSA9IHByb3h5U3BlYy5pbmRleE9mKCc6Jyk7CisgICAgICAgIGlmIChpID09IC0xKSB7CisgICAgICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgICAgICBBc3NlcnQuYXNzZXJ0VHJ1ZShwcm94eVNwZWMubGVuZ3RoKCkgPT0gMCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcHJveHlTcGVjLnN1YnN0cmluZygwLCBpKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgcGFyc2VQb3J0KFN0cmluZyBwcm94eVNwZWMpIHsKKyAgICAgICAgaW50IGkgPSBwcm94eVNwZWMuaW5kZXhPZignOicpOworICAgICAgICBpZiAoaSA9PSAtMSkgeworICAgICAgICAgICAgaWYgKERFQlVHKSB7CisgICAgICAgICAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUocHJveHlTcGVjLmxlbmd0aCgpID09IDApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9CisgICAgICAgIGlmIChERUJVRykgeworICAgICAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUoaSA8IHByb3h5U3BlYy5sZW5ndGgoKSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIEludGVnZXIucGFyc2VJbnQocHJveHlTcGVjLnN1YnN0cmluZyhpKzEpKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIHByb3h5IG9iamVjdCB0byBiZSB1c2VkIGZvciB0aGUgVVJMIGdpdmVuIGFzIHBhcmFtZXRlci4KKyAgICAgKiBAcGFyYW0gY3R4IEEgQ29udGV4dCB1c2VkIHRvIGdldCB0aGUgc2V0dGluZ3MgZm9yIHRoZSBwcm94eSBob3N0LgorICAgICAqIEBwYXJhbSB1cmwgQSBVUkwgdG8gYmUgYWNjZXNzZWQuIFVzZWQgdG8gZXZhbHVhdGUgZXhjbHVzaW9uIGxpc3QuCisgICAgICogQHJldHVybiBQcm94eSAoamF2YS5uZXQpIG9iamVjdCBjb250YWluaW5nIHRoZSBob3N0IG5hbWUuIElmIHRoZQorICAgICAqICAgICAgICAgdXNlciBkaWQgbm90IHNldCBhIGhvc3RuYW1lIGl0IHJldHVybnMgdGhlIGRlZmF1bHQgaG9zdC4KKyAgICAgKiAgICAgICAgIEEgbnVsbCB2YWx1ZSBtZWFucyB0aGF0IG5vIGhvc3QgaXMgdG8gYmUgdXNlZC4KKyAgICAgKiB7QGhpZGV9CisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBqYXZhLm5ldC5Qcm94eSBnZXRQcm94eShDb250ZXh0IGN0eCwgU3RyaW5nIHVybCkgeworICAgICAgICBzUHJveHlJbmZvTG9jay5yZWFkTG9jaygpLmxvY2soKTsKKyAgICAgICAgamF2YS5uZXQuUHJveHkgcmV0dmFsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKHNHbG9iYWxQcm94eUNoYW5nZWRPYnNlcnZlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmVnaXN0ZXJDb250ZW50T2JzZXJ2ZXJzUmVhZExvY2tlZChjdHgpOworICAgICAgICAgICAgICAgIHBhcnNlR2xvYmFsUHJveHlJbmZvUmVhZExvY2tlZChjdHgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHNHbG9iYWxQcm94eVNwZWMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIC8vIFByb3h5IGRlZmluZWQgLSBBcHBseSBleGNsdXNpb24gcnVsZXMKKyAgICAgICAgICAgICAgICBpZiAoaXNVUkxJbkV4Y2x1c2lvbkxpc3QodXJsLCBzR2xvYmFsUHJveHlTcGVjLmV4Y2x1c2lvbkxpc3QpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFJldHVybiBubyBwcm94eQorICAgICAgICAgICAgICAgICAgICByZXR2YWwgPSBqYXZhLm5ldC5Qcm94eS5OT19QUk9YWTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXR2YWwgPQorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IGphdmEubmV0LlByb3h5KGphdmEubmV0LlByb3h5LlR5cGUuSFRUUCwgc0dsb2JhbFByb3h5U3BlYy5hZGRyZXNzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHZhbCA9IGdldERlZmF1bHRQcm94eShjdHgsIHVybCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBzUHJveHlJbmZvTG9jay5yZWFkTG9jaygpLnVubG9jaygpOworICAgICAgICB9CisgICAgICAgIGlmICgocmV0dmFsICE9IGphdmEubmV0LlByb3h5Lk5PX1BST1hZKSAmJiAoaXNMb2NhbEhvc3QodXJsKSkpIHsKKyAgICAgICAgICAgIHJldHZhbCA9IGphdmEubmV0LlByb3h5Lk5PX1BST1hZOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXR2YWw7CisgICAgfQorCisgICAgLy8gVE9ETzogZGVwcmVjYXRlIHRoaXMgZnVuY3Rpb24KICAgICAvKioKICAgICAgKiBSZXR1cm4gdGhlIHByb3h5IGhvc3Qgc2V0IGJ5IHRoZSB1c2VyLgogICAgICAqIEBwYXJhbSBjdHggQSBDb250ZXh0IHVzZWQgdG8gZ2V0IHRoZSBzZXR0aW5ncyBmb3IgdGhlIHByb3h5IGhvc3QuCkBAIC00Nyw4MyArMTkwLDgyIEBACiAgICAgICogICAgICAgICBuYW1lIGl0IHJldHVybnMgdGhlIGRlZmF1bHQgaG9zdC4gQSBudWxsIHZhbHVlIG1lYW5zIHRoYXQgbm8KICAgICAgKiAgICAgICAgIGhvc3QgaXMgdG8gYmUgdXNlZC4KICAgICAgKi8KLSAgICBzdGF0aWMgZmluYWwgcHVibGljIFN0cmluZyBnZXRIb3N0KENvbnRleHQgY3R4KSB7Ci0gICAgICAgIENvbnRlbnRSZXNvbHZlciBjb250ZW50UmVzb2x2ZXIgPSBjdHguZ2V0Q29udGVudFJlc29sdmVyKCk7Ci0gICAgICAgIEFzc2VydC5hc3NlcnROb3ROdWxsKGNvbnRlbnRSZXNvbHZlcik7Ci0gICAgICAgIFN0cmluZyBob3N0ID0gU2V0dGluZ3MuU2VjdXJlLmdldFN0cmluZygKLSAgICAgICAgICAgICAgICBjb250ZW50UmVzb2x2ZXIsCi0gICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkhUVFBfUFJPWFkpOwotICAgICAgICBpZiAoaG9zdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBpbnQgaSA9IGhvc3QuaW5kZXhPZignOicpOwotICAgICAgICAgICAgaWYgKGkgPT0gLTEpIHsKLSAgICAgICAgICAgICAgICBpZiAoREVCVUcpIHsKLSAgICAgICAgICAgICAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUoaG9zdC5sZW5ndGgoKSA9PSAwKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gaG9zdC5zdWJzdHJpbmcoMCwgaSk7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgZ2V0SG9zdChDb250ZXh0IGN0eCkgeworICAgICAgICBqYXZhLm5ldC5Qcm94eSBwcm94eSA9IGdldFByb3h5KGN0eCwgbnVsbCk7CisgICAgICAgIGlmIChwcm94eSA9PSBqYXZhLm5ldC5Qcm94eS5OT19QUk9YWSkgcmV0dXJuIG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gKChJbmV0U29ja2V0QWRkcmVzcykocHJveHkuYWRkcmVzcygpKSkuZ2V0SG9zdE5hbWUoKTsKKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBnZXREZWZhdWx0SG9zdCgpOwogICAgIH0KIAorICAgIC8vIFRPRE86IGRlcHJlY2F0ZSB0aGlzIGZ1bmN0aW9uCiAgICAgLyoqCiAgICAgICogUmV0dXJuIHRoZSBwcm94eSBwb3J0IHNldCBieSB0aGUgdXNlci4KICAgICAgKiBAcGFyYW0gY3R4IEEgQ29udGV4dCB1c2VkIHRvIGdldCB0aGUgc2V0dGluZ3MgZm9yIHRoZSBwcm94eSBwb3J0LgogICAgICAqIEByZXR1cm4gVGhlIHBvcnQgbnVtYmVyIHRvIHVzZSBvciAtMSBpZiBubyBwcm94eSBpcyB0byBiZSB1c2VkLgogICAgICAqLwotICAgIHN0YXRpYyBmaW5hbCBwdWJsaWMgaW50IGdldFBvcnQoQ29udGV4dCBjdHgpIHsKLSAgICAgICAgQ29udGVudFJlc29sdmVyIGNvbnRlbnRSZXNvbHZlciA9IGN0eC5nZXRDb250ZW50UmVzb2x2ZXIoKTsKLSAgICAgICAgQXNzZXJ0LmFzc2VydE5vdE51bGwoY29udGVudFJlc29sdmVyKTsKLSAgICAgICAgU3RyaW5nIGhvc3QgPSBTZXR0aW5ncy5TZWN1cmUuZ2V0U3RyaW5nKAotICAgICAgICAgICAgICAgIGNvbnRlbnRSZXNvbHZlciwKLSAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuSFRUUF9QUk9YWSk7Ci0gICAgICAgIGlmIChob3N0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGludCBpID0gaG9zdC5pbmRleE9mKCc6Jyk7Ci0gICAgICAgICAgICBpZiAoaSA9PSAtMSkgewotICAgICAgICAgICAgICAgIGlmIChERUJVRykgewotICAgICAgICAgICAgICAgICAgICBBc3NlcnQuYXNzZXJ0VHJ1ZShob3N0Lmxlbmd0aCgpID09IDApOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICByZXR1cm4gLTE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoREVCVUcpIHsKLSAgICAgICAgICAgICAgICBBc3NlcnQuYXNzZXJ0VHJ1ZShpIDwgaG9zdC5sZW5ndGgoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gSW50ZWdlci5wYXJzZUludChob3N0LnN1YnN0cmluZyhpKzEpKTsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBnZXRQb3J0KENvbnRleHQgY3R4KSB7CisgICAgICAgIGphdmEubmV0LlByb3h5IHByb3h5ID0gZ2V0UHJveHkoY3R4LCBudWxsKTsKKyAgICAgICAgaWYgKHByb3h5ID09IGphdmEubmV0LlByb3h5Lk5PX1BST1hZKSByZXR1cm4gLTE7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gKChJbmV0U29ja2V0QWRkcmVzcykocHJveHkuYWRkcmVzcygpKSkuZ2V0UG9ydCgpOworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBnZXREZWZhdWx0UG9ydCgpOwogICAgIH0KIAorICAgIC8vIFRPRE86IGRlcHJlY2F0ZSB0aGlzIGZ1bmN0aW9uCiAgICAgLyoqCiAgICAgICogUmV0dXJuIHRoZSBkZWZhdWx0IHByb3h5IGhvc3Qgc3BlY2lmaWVkIGJ5IHRoZSBjYXJyaWVyLgogICAgICAqIEByZXR1cm4gU3RyaW5nIGNvbnRhaW5pbmcgdGhlIGhvc3QgbmFtZSBvciBudWxsIGlmIHRoZXJlIGlzIG5vIHByb3h5IGZvcgogICAgICAqIHRoaXMgY2Fycmllci4KICAgICAgKi8KLSAgICBzdGF0aWMgZmluYWwgcHVibGljIFN0cmluZyBnZXREZWZhdWx0SG9zdCgpIHsKLSAgICAgICAgU3RyaW5nIGhvc3QgPSBTeXN0ZW1Qcm9wZXJ0aWVzLmdldCgibmV0LmdwcnMuaHR0cC1wcm94eSIpOwotICAgICAgICBpZiAoaG9zdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBVcmkgdSA9IFVyaS5wYXJzZShob3N0KTsKLSAgICAgICAgICAgIGhvc3QgPSB1LmdldEhvc3QoKTsKLSAgICAgICAgICAgIHJldHVybiBob3N0OwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgIH0KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBnZXREZWZhdWx0SG9zdCgpIHsKKyAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgfQogCisgICAgLy8gVE9ETzogZGVwcmVjYXRlIHRoaXMgZnVuY3Rpb24KICAgICAvKioKICAgICAgKiBSZXR1cm4gdGhlIGRlZmF1bHQgcHJveHkgcG9ydCBzcGVjaWZpZWQgYnkgdGhlIGNhcnJpZXIuCiAgICAgICogQHJldHVybiBUaGUgcG9ydCBudW1iZXIgdG8gYmUgdXNlZCB3aXRoIHRoZSBwcm94eSBob3N0IG9yIC0xIGlmIHRoZXJlIGlzCiAgICAgICogbm8gcHJveHkgZm9yIHRoaXMgY2Fycmllci4KICAgICAgKi8KLSAgICBzdGF0aWMgZmluYWwgcHVibGljIGludCBnZXREZWZhdWx0UG9ydCgpIHsKLSAgICAgICAgU3RyaW5nIGhvc3QgPSBTeXN0ZW1Qcm9wZXJ0aWVzLmdldCgibmV0LmdwcnMuaHR0cC1wcm94eSIpOwotICAgICAgICBpZiAoaG9zdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBVcmkgdSA9IFVyaS5wYXJzZShob3N0KTsKLSAgICAgICAgICAgIHJldHVybiB1LmdldFBvcnQoKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiAtMTsKLSAgICAgICAgfQorICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50I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zdCgpOworICAgICAgICAgICAgICAgIFNvY2tldEFkZHJlc3Mgc29ja2V0QWRkciA9IHByb3h5UHJvcGVydGllcy5nZXRTb2NrZXRBZGRyZXNzKCk7CisgICAgICAgICAgICAgICAgaWYgKHNvY2tldEFkZHIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSBwYXJzZWRFeGNsdXNpb25BcnJheSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VkRXhjbHVzaW9uQXJyYXkgPSBwYXJzZUV4Y2x1c2lvbkxpc3QoZXhjbHVzaW9uTGlzdCk7CisgICAgICAgICAgICAgICAgICAgIGlmICghaXNVUkxJbkV4Y2x1c2lvbkxpc3QodXJsLCBwYXJzZWRFeGNsdXNpb25BcnJheSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgamF2YS5uZXQuUHJveHkoamF2YS5uZXQuUHJveHkuVHlwZS5IVFRQLCBzb2NrZXRBZGRyKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gamF2YS5uZXQuUHJveHkuTk9fUFJPWFk7CisgICAgfQorCisgICAgLy8gVE9ETzogcmVtb3ZlIHRoaXMgZnVuY3Rpb24gLyBkZXByZWNhdGUKICAgICAvKioKICAgICAgKiBSZXR1cm5zIHRoZSBwcmVmZXJyZWQgcHJveHkgdG8gYmUgdXNlZCBieSBjbGllbnRzLiBUaGlzIGlzIGEgd3JhcHBlcgogICAgICAqIGFyb3VuZCB7QGxpbmsgYW5kcm9pZC5uZXQuUHJveHkjZ2V0SG9zdCgpfS4gQ3VycmVudGx5IG5vIHByb3h5IHdpbGwKQEAgLTEzNiwyNiArMjc4LDIzIEBACiAgICAgICogYW5kcm9pZC5wZXJtaXNzaW9uLkFDQ0VTU19ORVRXT1JLX1NUQVRFCiAgICAgICogQHJldHVybiBUaGUgcHJlZmVycmVkIHByb3h5IHRvIGJlIHVzZWQgYnkgY2xpZW50cywgb3IgbnVsbCBpZiB0aGVyZQogICAgICAqIGlzIG5vIHByb3h5LgotICAgICAqCiAgICAgICoge0BoaWRlfQogICAgICAqLwotICAgIHN0YXRpYyBmaW5hbCBwdWJsaWMgSHR0cEhvc3QgZ2V0UHJlZmVycmVkSHR0cEhvc3QoQ29udGV4dCBjb250ZXh0LAorICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgSHR0cEhvc3QgZ2V0UHJlZmVycmVkSHR0cEhvc3QoQ29udGV4dCBjb250ZXh0LAogICAgICAgICAgICAgU3RyaW5nIHVybCkgewotICAgICAgICBpZiAoIWlzTG9jYWxIb3N0KHVybCkgJiYgIWlzTmV0d29ya1dpZmkoY29udGV4dCkpIHsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBwcm94eUhvc3QgPSBQcm94eS5nZXRIb3N0KGNvbnRleHQpOwotICAgICAgICAgICAgaWYgKHByb3h5SG9zdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBIdHRwSG9zdChwcm94eUhvc3QsIFByb3h5LmdldFBvcnQoY29udGV4dCksICJodHRwIik7Ci0gICAgICAgICAgICB9CisgICAgICAgIGphdmEubmV0LlByb3h5IHByZWZQcm94eSA9IGdldFByb3h5KGNvbnRleHQsIHVybCk7CisgICAgICAgIGlmIChwcmVmUHJveHkuZXF1YWxzKGphdmEubmV0LlByb3h5Lk5PX1BST1hZKSkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBJbmV0U29ja2V0QWRkcmVzcyBzYSA9IChJbmV0U29ja2V0QWRkcmVzcylwcmVmUHJveHkuYWRkcmVzcygpOworICAgICAgICAgICAgcmV0dXJuIG5ldyBIdHRwSG9zdChzYS5nZXRIb3N0TmFtZSgpLCBzYS5nZXRQb3J0KCksICJodHRwIik7CiAgICAgICAgIH0KLQotICAgICAgICByZXR1cm4gbnVsbDsKICAgICB9CiAKLSAgICBzdGF0aWMgZmluYWwgcHJpdmF0ZSBib29sZWFuIGlzTG9jYWxIb3N0KFN0cmluZyB1cmwpIHsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBib29sZWFuIGlzTG9jYWxIb3N0KFN0cmluZyB1cmwpIHsKICAgICAgICAgaWYgKHVybCA9PSBudWxsKSB7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KLQogICAgICAgICB0cnkgewogICAgICAgICAgICAgZmluYWwgVVJJIHVyaSA9IFVSSS5jcmVhdGUodXJsKTsKICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBob3N0ID0gdXJpLmdldEhvc3QoKTsKQEAgLTE3MiwyNSArMzExLDE3MCBAQAogICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gaWV4KSB7CiAgICAgICAgICAgICAvLyBJZ25vcmUgKFVSSS5jcmVhdGUpCiAgICAgICAgIH0KLQogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogCi0gICAgc3RhdGljIGZpbmFsIHByaXZhdGUgYm9vbGVhbiBpc05ldHdvcmtXaWZpKENvbnRleHQgY29udGV4dCkgewotICAgICAgICBpZiAoY29udGV4dCA9PSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgU2V0dGluZ3NPYnNlcnZlciBleHRlbmRzIENvbnRlbnRPYnNlcnZlciB7CisKKyAgICAgICAgcHJpdmF0ZSBDb250ZXh0IG1Db250ZXh0OworCisgICAgICAgIFNldHRpbmdzT2JzZXJ2ZXIoQ29udGV4dCBjdHgpIHsKKyAgICAgICAgICAgIHN1cGVyKG5ldyBIYW5kbGVyKGN0eC5nZXRNYWluTG9vcGVyKCkpKTsKKyAgICAgICAgICAgIG1Db250ZXh0ID0gY3R4OwogICAgICAgICB9CiAKLSA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3R4KSB7CisgICAgICAgIENvbnRlbnRSZXNvbHZlciBjb250ZW50UmVzb2x2ZXIgPSBjdHguZ2V0Q29udGVudFJlc29sdmVyKCk7CisgICAgICAgIFN0cmluZyBwcm94eUhvc3QgPSAgU2V0dGluZ3MuU2VjdXJlLmdldFN0cmluZygKKyAgICAgICAgICAgICAgICBjb250ZW50UmVzb2x2ZXIsCisgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkhUVFBfUFJPWFkpOworICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkocHJveHlIb3N0KSkgeworICAgICAgICAgICAgLy8gQ2xlYXIgc2lnbmFsCisgICAgICAgICAgICBzUHJveHlJbmZvTG9jay5yZWFkTG9jaygpLnVubG9jaygpOworICAgICAgICAgICAgc1Byb3h5SW5mb0xvY2sud3JpdGVMb2NrKCkubG9jaygpOworICAgICAgICAgICAgc0dsb2JhbFByb3h5U3BlYyA9IG51bGw7CisgICAgICAgICAgICBzUHJveHlJbmZvTG9jay5yZWFkTG9jaygpLmxvY2soKTsKKyAgICAgICAgICAgIHNQcm94eUluZm9Mb2NrLndyaXRlTG9jaygpLnVubG9jaygpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIFN0cmluZyBleGNsdXNpb25MaXN0U3BlYyA9IFNldHRpbmdzLlNlY3VyZS5nZXRTdHJpbmcoCisgICAgICAgICAgICAgICAgY29udGVudFJlc29sdmVyLAorICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5IVFRQX1BST1hZX0VYQ0xVU0lPTl9MSVNUKTsKKyAgICAgICAgU3RyaW5nIGhvc3QgPSBwYXJzZUhvc3QocHJveHlIb3N0KTsKKyAgICAgICAgaW50IHBvcnQgPSBwYXJzZVBvcnQocHJveHlIb3N0KTsKKyAgICAgICAgUHJveHlTcGVjIHRtcFByb3h5U3BlYyA9IG51bGw7CisgICAgICAgIGlmIChwcm94eUhvc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgdG1wUHJveHlTcGVjID0gbmV3IFByb3h5U3BlYygpOworICAgICAgICAgICAgdG1wUHJveHlTcGVjLmFkZHJlc3MgPSBuZXcgSW5ldFNvY2tldEFkZHJlc3MoaG9zdCwgcG9ydCk7CisgICAgICAgICAgICB0bXBQcm94eVNwZWMuZXhjbHVzaW9uTGlzdCA9IHBhcnNlRXhjbHVzaW9uTGlzdChleGNsdXNpb25MaXN0U3BlYyk7CisgICAgICAgIH0KKyAgICAgICAgc1Byb3h5SW5mb0xvY2sucmVhZExvY2soKS51bmxvY2soKTsKKyAgICAgICAgc1Byb3h5SW5mb0xvY2sud3JpdGVMb2NrKCkubG9jaygpOworICAgICAgICBzR2xvYmFsUHJveHlTcGVjID0gdG1wUHJveHlTcGVjOworICAgICAgICBzUHJveHlJbmZvTG9jay5yZWFkTG9jaygpLmxvY2soKTsKKyAgICAgICAgc1Byb3h5SW5mb0xvY2sud3JpdGVMb2NrKCkudW5sb2NrKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nW10gcGFyc2VFeGNsdXNpb25MaXN0KFN0cmluZyBleGNsdXNpb25MaXN0KSB7CisgICAgICAgIFN0cmluZ1tdIHByb2Nlc3NlZEFycmF5ID0gbmV3IFN0cmluZ1swXTsKKyAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShleGNsdXNpb25MaXN0KSkgeworICAgICAgICAgICAgU3RyaW5nW10gZXhjbHVzaW9uTGlzdEFycmF5ID0gZXhjbHVzaW9uTGlzdC50b0xvd2VyQ2FzZSgpLnNwbGl0KCIsIik7CisgICAgICAgICAgICBwcm9jZXNzZWRBcnJheSA9IG5ldyBTdHJpbmdbZXhjbHVzaW9uTGlzdEFycmF5Lmxlbmd0aF07CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGV4Y2x1c2lvbkxpc3RBcnJheS5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIFN0cmluZyBlbnRyeSA9IGV4Y2x1c2lvbkxpc3RBcnJheVtpXS50cmltKCk7CisgICAgICAgICAgICAgICAgaWYgKGVudHJ5LnN0YXJ0c1dpdGgoIi4iKSkgeworICAgICAgICAgICAgICAgICAgICBlbnRyeSA9IGVudHJ5LnN1YnN0cmluZygxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcHJvY2Vzc2VkQXJyYXlbaV0gPSBlbnRyeTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgcmV0dXJuIHByb2Nlc3NlZEFycmF5OwogICAgIH0KLX07CisKKyAgICAvKioKKyAgICAgKiBWYWxpZGF0ZSBzeW50YXggb2YgaG9zdG5hbWUsIHBvcnQgYW5kIGV4Y2x1c2lvbiBsaXN0IGVudHJpZXMKKyAgICAgKiB7QGhpZGV9CisgICAgICovCisgICAgcHVibGljIHN0YXRpYyB2b2lkIHZhbGlkYXRlKFN0cmluZyBob3N0bmFtZSwgU3RyaW5nIHBvcnQsIFN0cmluZyBleGNsTGlzdCkgeworICAgICAgICBNYXRjaGVyIG1hdGNoID0gSE9TVE5BTUVfUEFUVEVSTi5tYXRjaGVyKGhvc3RuYW1lKTsKKyAgICAgICAgTWF0Y2hlciBsaXN0TWF0Y2ggPSBFWENMTElTVF9QQVRURVJOLm1hdGNoZXIoZXhjbExpc3QpOworCisgICAgICAgIGlmICghbWF0Y2gubWF0Y2hlcygpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIWxpc3RNYXRjaC5tYXRjaGVzKCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChob3N0bmFtZS5sZW5ndGgoKSA+IDAgJiYgcG9ydC5sZW5ndGgoKSA9PSAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAocG9ydC5sZW5ndGgoKSA+IDApIHsKKyAgICAgICAgICAgIGlmIChob3N0bmFtZS5sZW5ndGgoKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaW50IHBvcnRWYWwgPSAtMTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcG9ydFZhbCA9IEludGVnZXIucGFyc2VJbnQocG9ydCk7CisgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocG9ydFZhbCA8PSAwIHx8IHBvcnRWYWwgPiAweEZGRkYpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgQW5kcm9pZFByb3h5U2VsZWN0b3JSb3V0ZVBsYW5uZXIKKyAgICAgICAgICAgIGV4dGVuZHMgb3JnLmFwYWNoZS5odHRwLmltcGwuY29ubi5Qcm94eVNlbGVjdG9yUm91dGVQbGFubmVyIHsKKworICAgICAgICBwcml2YXRlIENvbnRleHQgbUNvbnRleHQ7CisKKyAgICAgICAgcHVibGljIEFuZHJvaWRQcm94eVNlbGVjdG9yUm91dGVQbGFubmVyKFNjaGVtZVJlZ2lzdHJ5IHNjaHJlZywgUHJveHlTZWxlY3RvciBwcm9zZWwsCisgICAgICAgICAgICAgICAgQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICBzdXBlcihzY2hyZWcsIHByb3NlbCk7CisgICAgICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIGphdmEubmV0LlByb3h5IGNob29zZVByb3h5KExpc3Q8amF2YS5uZXQuUHJveHk+IHByb3hpZXMsIEh0dHBIb3N0IHRhcmdldCwKKyAgICAgICAgICAgICAgICBIdHRwUmVxdWVzdCByZXF1ZXN0LCBIdHRwQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0UHJveHkobUNvbnRleHQsIHRhcmdldC5nZXRIb3N0TmFtZSgpKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgSHR0cEhvc3QgZGV0ZXJtaW5lUHJveHkoSHR0cEhvc3QgdGFyZ2V0LCBIdHRwUmVxdWVzdCByZXF1ZXN0LAorICAgICAgICAgICAgICAgIEh0dHBDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgICAgIHJldHVybiBnZXRQcmVmZXJyZWRIdHRwSG9zdChtQ29udGV4dCwgdGFyZ2V0LmdldEhvc3ROYW1lKCkpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBIdHRwUm91dGUgZGV0ZXJtaW5lUm91dGUoSHR0cEhvc3QgdGFyZ2V0LCBIdHRwUmVxdWVzdCByZXF1ZXN0LAorICAgICAgICAgICAgICAgIEh0dHBDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgICAgIEh0dHBIb3N0IHByb3h5ID0gZ2V0UHJlZmVycmVkSHR0cEhvc3QobUNvbnRleHQsIHRhcmdldC5nZXRIb3N0TmFtZSgpKTsKKyAgICAgICAgICAgIGlmIChwcm94eSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJu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Tb2NrZXRBZGRyZXNzIG1Qcm94eTsKKyAgICBwcml2YXRlIFN0cmluZyBtRXhjbHVzaW9uTGlzdDsKKworICAgIHB1YmxpYyBQcm94eVByb3BlcnRpZXMoKSB7CisgICAgfQorCisgICAgLy8gY29weSBjb25zdHJ1Y3RvciBpbnN0ZWFkIG9mIGNsb25lCisgICAgcHVibGljIFByb3h5UHJvcGVydGllcyhQcm94eVByb3BlcnRpZXMgc291cmNlKSB7CisgICAgICAgIGlmIChzb3VyY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgbVByb3h5ID0gc291cmNlLmdldFNvY2tldEFkZHJlc3MoKTsKKyAgICAgICAgICAgIFN0cmluZyBleGNsdXNpb25MaXN0ID0gc291cmNlLmdldEV4Y2x1c2lvbkxpc3QoKTsKKyAgICAgICAgICAgIGlmIChleGNsdXNpb25MaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtRXhjbHVzaW9uTGlzdCA9IG5ldyBTdHJpbmcoZXhjbHVzaW9uTGlzdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgSW5ldFNvY2tldEFkZHJlc3MgZ2V0U29ja2V0QWRkcmVzcygpIHsKKyAgICAgICAgcmV0dXJuIG1Qcm94eTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRTb2NrZXRBZGRyZXNzKEluZXRTb2NrZXRBZGRyZXNzIHByb3h5KSB7CisgICAgICAgIG1Qcm94eSA9IHByb3h5OworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmcgZ2V0RXhjbHVzaW9uTGlzdCgpIHsKKyAgICAgICAgcmV0dXJuIG1FeGNsdXNpb25MaXN0OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEV4Y2x1c2lvbkxpc3QoU3RyaW5nIGV4Y2x1c2lvbkxpc3QpIHsKKyAgICAgICAgbUV4Y2x1c2lvbkxpc3QgPSBleGNsdXNpb25MaXN0OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICBpZiAobVByb3h5ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHNiLmFwcGVuZChtUHJveHkudG9TdHJpbmcoKSk7CisgICAgICAgICAgICBpZiAobUV4Y2x1c2lvbkxpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiB4bD0iKS5hcHBlbmQobUV4Y2x1c2lvbkxpc3QpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEltcGxlbWVudCB0aGUgUGFyY2VsYWJsZSBpbnRlcmZhY2UKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW1wbGVtZW50IHRoZSBQYXJjZWxhYmxlIGludGVyZmFjZS4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgeworICAgICAgICBTdHJpbmcgaG9zdCA9IG51bGw7CisgICAgICAgIGlmIChtUHJveHkgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBJbmV0QWRkcmVzcyBhZGRyID0gbVByb3h5LmdldEFkZHJlc3MoKTsKKyAgICAgICAgICAgICAgICBpZiAoYWRkciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGhvc3QgPSBhZGRyLmdldEhvc3RBZGRyZXNzKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLyogRG9lcyBub3QgcmVzb2x2ZSB3aGVuIGFkZHIgaXMgbnVsbCAqLworICAgICAgICAgICAgICAgICAgICBob3N0ID0gbVByb3h5LmdldEhvc3ROYW1lKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKGhvc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgZGVzdC53cml0ZUJ5dGUoKGJ5dGUpMSk7CisgICAgICAgICAgICBkZXN0LndyaXRlU3RyaW5nKGhvc3QpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChtUHJveHkuZ2V0UG9ydCgpKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVCeXRlKChieXRlKTApOworICAgICAgICB9CisgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcobUV4Y2x1c2lvbkxpc3QpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEltcGxlbWVudCB0aGUgUGFyY2VsYWJsZSBpbnRlcmZhY2UuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIENyZWF0b3I8UHJveHlQcm9wZXJ0aWVzPiBDUkVBVE9SID0KKyAgICAgICAgbmV3IENyZWF0b3I8UHJveHlQcm9wZXJ0aWVzPigpIHsKKyAgICAgICAgICAgIHB1YmxpYyBQcm94eVByb3BlcnRpZXMgY3JlYXRlRnJvbVBhcmNlbChQYXJjZWwgaW4pIHsKKyAgICAgICAgICAgICAgICBQcm94eVByb3BlcnRpZXMgcHJveHlQcm9wZXJ0aWVzID0gbmV3IFByb3h5UHJvcGVydGllcygpOworICAgICAgICAgICAgICAgIGlmIChpbi5yZWFkQnl0ZSgpID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBob3N0ID0gaW4ucmVhZFN0cmluZygpOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBvcnQgPSBpbi5yZWFkSW50KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBwcm94eVByb3BlcnRpZXMuc2V0U29ja2V0QWRkcmVzcyhJbmV0U29ja2V0QWRkcmVzcy5jcmVhdGVVbnJlc29sdmVkKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBob3N0LCBwb3J0KSk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiBlKSB7IH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcHJveHlQcm9wZXJ0aWVzLnNldEV4Y2x1c2lvbkxpc3QoaW4ucmVhZFN0cmluZygpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcHJveHlQcm9wZXJ0aWVzOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgUHJveHlQcm9wZXJ0aWVzW10gbmV3QXJyYXkoaW50IHNpemUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb3h5UHJvcGVydGllc1tzaXplXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL25ldC9VcmkuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL25ldC9VcmkuamF2YQppbmRleCA0N2ZhYWJhLi4zYjIxNTkwIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9uZXQvVXJpLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvbmV0L1VyaS5qYXZhCkBAIC0yOCw4ICsyOCwxMCBAQAogaW1wb3J0IGphdmEudXRpbC5BYnN0cmFjdExpc3Q7CiBpbXBvcnQgamF2YS51dGlsLkFycmF5TGlzdDsKIGltcG9ydCBqYXZhLnV0aWwuQ29sbGVjdGlvbnM7CitpbXBvcnQgamF2YS51dGlsL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sKKyAgICAgICAgaWYgKGlzT3BhcXVlKCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbihOT1RfSElFUkFSQ0hJQ0FMKTsKKyAgICAgICAgfQorCisgICAgICAgIFN0cmluZyBxdWVyeSA9IGdldEVuY29kZWRRdWVyeSgpOworICAgICAgICBpZiAocXVlcnkgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIENvbGxlY3Rpb25zLmVtcHR5U2V0KCk7CisgICAgICAgIH0KKworICAgICAgICBTZXQ8U3RyaW5nPiBuYW1lcyA9IG5ldyBMaW5rZWRIYXNoU2V0PFN0cmluZz4oKTsKKyAgICAgICAgaW50IHN0YXJ0ID0gMDsKKyAgICAgICAgZG8geworICAgICAgICAgICAgaW50IG5leHQgPSBxdWVyeS5pbmRleE9mKCcmJywgc3RhcnQpOworICAgICAgICAgICAgaW50IGVuZCA9IChuZXh0ID09IC0xKSA/IHF1ZXJ5Lmxlbmd0aCgpIDogbmV4dDsKKworICAgICAgICAgICAgaW50IHNlcGFyYXRvciA9IHF1ZXJ5LmluZGV4T2YoJz0nLCBzdGFydCk7CisgICAgICAgICAgICBpZiAoc2VwYXJhdG9yID4gZW5kIHx8IHNlcGFyYXRvciA9PSAtMSkgeworICAgICAgICAgICAgICAgIHNlcGFyYXRvciA9IGVuZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBxdWVyeS5zdWJzdHJpbmcoc3RhcnQsIHNlcGFyYXRvcik7CisgICAgICAgICAgICBuYW1lcy5hZGQoZGVjb2RlKG5hbWUpKTsKKworICAgICAgICAgICAgLy8gTW92ZSBzdGFydCB0byBlbmQgb2YgbmFtZS4KKyAgICAgICAgICAgIHN0YXJ0ID0gZW5kICsgMTsKKyAgICAgICAgfSB3aGlsZSAoc3RhcnQgPCBxdWVyeS5sZW5ndGgoKSk7CisKKyAgICAgICAgcmV0dXJuIEN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0Y2hlcyhzdGFydCwgZW5jb2RlZEtleSwgMCwgZW5jb2RlZEtleS5sZW5ndGgoKSkpIHsKKyAgICAgICAgICAgICAgICBpZiAoc2VwYXJhdG9yID09IGVuZCkgeworICAgICAgICAgICAgICAgICAgdmFsdWVzLmFkZCgiIik7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgIHZhbHVlcy5hZGQoZGVjb2RlKHF1ZXJ5LnN1YnN0cmluZyhzZXBhcmF0b3IgKyAxLCBlbmQpKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBNb3ZlIHN0YXJ0IHRvIGVuZCBvZiBuYW1lLgorICAgICAgICAgICAgaWYgKG5leHRBbXBlcnNhbmQgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICBzdGFydCA9IG5leHRBbXBlcnNhbmQgKyAxOworICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gTW92ZSBzdGFydCB0byBzdGFydCBvZiB2YWx1ZS4KLSAgICAgICAgICAgIHN0YXJ0ICs9IHByZWZpeC5sZW5ndGgoKTsKLQotICAgICAgICAgICAgLy8gRmluZCBlbmQgb2YgdmFsdWUuCi0gICAgICAgICAgICBpbnQgZW5kID0gcXVlcnkuaW5kZXhPZignJicsIHN0YXJ0KTsKLSAgICAgICAgICAgIGlmIChlbmQgPT0gLTEpIHsKLSAgICAgICAgICAgICAgICBlbmQgPSBxdWVyeS5sZW5ndGgoKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgU3RyaW5nIHZhbHVlID0gcXVlcnkuc3Vic3RyaW5nKHN0YXJ0LCBlbmQpOwotICAgICAgICAgICAgdmFsdWVzLmFkZChkZWNvZGUodmFsdWUpKTsKLQotICAgICAgICAgICAgc3RhcnQgPSBlbmQ7Ci0gICAgICAgIH0KKyAgICAgICAgfSB3aGl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RoID0gZW5jb2RlZEtleS5sZW5ndGgoKTsKKyAgICAgICAgZmluYWwgaW50IGxlbmd0aCA9IHF1ZXJ5Lmxlbmd0aCgpOworICAgICAgICBpbnQgc3RhcnQgPSAwOworICAgICAgICBkbyB7CisgICAgICAgICAgICBpbnQgbmV4dEFtcGVyc2FuZCA9IHF1ZXJ5LmluZGV4T2YoJyYnLCBzdGFydCk7CisgICAgICAgICAgICBpbnQgZW5kID0gbmV4dEFtcGVyc2FuZCAhPSAtMSA/IG5leHRBbXBlcnNhbmQgOiBsZW5ndGg7CiAKLSAgICAgICAgaW50IGVuY29kZWRLZXlTZWFyY2hJbmRleCA9IDA7Ci0gICAgICAgIGZpbmFsIGludCBlbmNvZGVkS2V5U2VhcmNoRW5kID0gcXVlcnkubGVuZ3RoKCkgLSAoZW5jb2RlZEtleUxlbmd0aCArIDEpOworICAgICAgICAgICAgaW50IHNlcGFyYXRvciA9IHF1ZXJ5LmluZGV4T2YoJz0nLCBzdGFydCk7CisgICAgICAgICAgICBpZiAoc2VwYXJhdG9yID4gZW5kIHx8IHNlcGFyYXRvciA9PSAtMSkgeworICAgICAgICAgICAgICAgIHNlcGFyYXRvciA9IGVuZDsKKyAgICAgICAgICAgIH0KIAotICAgICAgICB3aGlsZSAoZW5jb2RlZEtleVNlYXJjaEluZGV4IDw9IGVuY29kZWRLZXlTZWFyY2hFbmQpIHsKLSAgICAgICAgICAgIGludCBrZXlJbmRleCA9IHF1ZXJ5LmluZGV4T2YoZW5jb2RlZEtleSwgZW5jb2RlZEtleVNlYXJjaEluZGV4KTsKLSAgICAgICAgICAgIGlmIChrZXlJbmRleCA9PSAtMSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZmluYWwgaW50IGVxdWFsc0luZGV4ID0ga2V5SW5kZXggKyBlbmNvZGVkS2V5TGVuZ3RoOwotICAgICAgICAgICAgaWYgKGVxdWFsc0luZGV4ID49IHF1ZXJ5Lmxlbmd0aCgpKSB7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAocXVlcnkuY2hhckF0KGVxdWFsc0luZGV4KSAhPSAnPScpIHsKLSAgICAgICAgICAgICAgICBlbmNvZGVkS2V5U2VhcmNoSW5kZXggPSBlcXVhbHNJbmRleCArIDE7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoa2V5SW5kZXggPT0gMCB8fCBxdWVyeS5jaGFyQXQoa2V5SW5kZXggLSAxKSA9PSAnJicpIHsKLSAgICAgICAgICAgICAgICBpbnQgZW5kID0gcXVlcnkuaW5kZXhPZignJicsIGVxdWFsc0luZGV4KTsKLSAgICAgICAgICAgICAgICBpZiAoZW5kID09IC0xKSB7Ci0gICAgICAgICAgICAgICAgICAgIGVuZCA9IHF1ZXJ5Lmxlbmd0aCgpOworICAgICAgICAgICAgaWYgKHNlcGFyYXRvciAtIHN0YXJ0ID09IGVuY29kZWRLZXkubGVuZ3RoKCkKKyAgICAgICAgICAgICAgICAgICAgJiYgcXVlcnkucmVnaW9uTWF0Y2hlcyhzdGFydCwgZW5jb2RlZEtleSwgMCwgZW5jb2RlZEtleS5sZW5ndGgoKSkpIHsKKyAgICAgICAgICAgICAgICBpZiAoc2VwYXJhdG9yID09IGVuZCkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuICIiOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gZGVjb2RlKHF1ZXJ5LnN1YnN0cmluZyhzZXBhcmF0b3IgKyAxLCBlbmQpKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGRlY29kZShxdWVyeS5zdWJzdHJpbmcoZXF1YWxzSW5kZXggKyAxLCBlbmQpKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZEtleV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3RyaW5nIG1Ib3N0OworICAgIHByaXZhdGUgaW50IG1Qb3J0OworICAgIHByaXZhdGUgU3RyaW5nIG1QYXRoOworICAgIHByaXZhdGUgU3RyaW5nIG1BdXRoSW5mbzsKIAogICAgIHN0YXRpYyBmaW5hbCBpbnQgTUFUQ0hfR1JPVVBfU0NIRU1FID0gMTsKICAgICBzdGF0aWMgZmluYWwgaW50IE1BVENIX0dST1VQX0FVVEhPUklUWSA9IDI7CkBAIC01Niw3ICs1NCw3IEBACiAgICAgc3RhdGljIFBhdHRlcm4gc0FkZHJlc3NQYXR0ZXJuID0gUGF0dGVybi5jb21waWxlKAogICAgICAgICAgICAgLyogc2NoZW1lICAgICovICIoPzooaHR0cHxodHRwc3xmaWxlKVxcOlxcL1xcLyk/IiArCiAgICAgICAgICAgICAvKiBhdXRob3JpdHkgKi8gIig/OihbLUEtWmEtejAtOSRfLishKicoKSw7PyY9XSsoPzpcXDpbLUEtWmEtejAtOSRfLishKicoKSw7PyY9XSspPylAKT8iICsKLSAgICAgICAgICAgIC8qIGhvc3QgICAgICAqLyAiKFstIiArIEdPT0RfSVJJX0NIQVIgKyAiJV9dKyg/OlxcLlstIiArIEdPT0RfSVJJX0NIQVIgKyAiJV9dKykqfFxcW1swLTlhLWZBLUY6XFwuXStcXF0pPyIgKworICAgICAgICAgICAgLyogaG9zdCAgICAgICovICIoWyIgKyBHT09EX0lSSV9DSEFSICsgIiVfLV1bIiArIEdPT0RfSVJJX0NIQVIgKyAiJV9cXC4tXSp8XFxbWzAtOWEtZkEtRjpcXC5dK1xcXSk/IiArCiAgICAgICAgICAgICAvKiBwb3J0ICAgICAgKi8gIig/OlxcOihbMC05XSopKT8iICsKICAgICAgICAgICAgIC8qIHBhdGggICAgICAqLyAiKFxcLz9bXiNdKik/IiArCiAgICAgICAgICAgICAvKiBhbmNob3IgICAgKi8gIi4qIiwgUGF0dGVybi5DQVNFX0lOU0VOU0lUSVZFKTsKQEAgLTEyMiw2ICsxMjAsNyBAQAogICAgICAgICBpZiAobVNjaGVtZS5lcXVhbHMoIiIpKSBtU2NoZW1lID0gImh0dHAiOwogICAgIH0KIAorICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CiAgICAgICAgIFN0cmluZyBwb3J0ID0gIiI7CiAgICAgICAgIGlmICgobVBvcnQgIT0gNDQzICYmIG1TY2hlbWUuZXF1YWxzKCJodHRwcyIpKSB8fApAQCAtMTM1LDQgKzEzNCw0NCBAQAogCiAgICAgICAgIHJldHVybiBtU2NoZW1lICsgIjovLyIgKyBhdXRoSW5mbyArIG1Ib3N0ICsgcG9ydCArIG1QYXRoOwogICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFNjaGVtZShTdHJpbmcgc2NoZW1lKSB7CisgICAgICBtU2NoZW1lID0gc2NoZW1lOworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmcgZ2V0U2NoZW1lKCkgeworICAgICAgcmV0dXJuIG1TY2hlbWU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0SG9zdChTdHJpbmcgaG9zdCkgeworICAgICAgbUhvc3QgPSBob3N0OworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmcgZ2V0SG9zdCgpIHsKKyAgICAgIHJldHVybiBtSG9zdDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQb3J0KGludCBwb3J0KSB7CisgICAgICBtUG9ydCA9IHBvcnQ7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRQb3J0KCkgeworICAgICAgcmV0dXJuIG1Qb3J0OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFBhdGgoU3RyaW5nIHBhdGgpIHsKKyAgICAgIG1QYXRoID0gcGF0aDsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nIGdldFBhdGgoKSB7CisgICAgICByZXR1cm4gbVBhdGg7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0QXV0aEluZm8oU3RyaW5nI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AvKiogSW50ZXJjZXB0b3IgdGhyb3dzIGFuIGV4Y2VwdGlvbiBpZiB0aGUgZXhlY3V0aW5nIHRocmVhZCBpcyBibG9ja2VkICovCiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgSHR0cFJlcXVlc3RJbnRlcmNlcHRvciBzVGhyZWFkQ2hlY2tJbnRlcmNlcHRvciA9CkBAIC0zNTgsNyArMzY0LDcgQEAKICAgICAgICAgfQogICAgICAgICBpZiAobGV2ZWwgPCBMb2cuVkVSQk9TRSB8fCBsZXZlbCA+IExvZy5BU1NFUlQpIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkxldmVsIGlzIG91dCBvZiByYW5nZSBbIgotICAgICAgICAgICAgICAgICsgTG9nLlZFUkJPU0UgKyAiLi4iICsgTG9nLkFTU0VSVCArICJdIik7ICAgIAorICAgICAgICAgICAgICAgICsgTG9nLlZFUkJPU0UgKyAiLi4iICsgTG9nLkFTU0VSVCArICJdIik7CiAgICAgICAgIH0KIAogICAgICAgICBjdXJsQ29uZmlndXJhdGlvbiA9IG5ldyBMb2dnaW5nQ29uZmlndXJhdGlvbihuYW1lLCBsZXZlbCk7CkBAIC00MzEsMTIgKzQzNywxNyBAQAogICAgICAgICAgICAgICAgIGlmIChlbnRpdHkuZ2V0Q29udGVudExlbmd0aCgpIDwgMTAyNCkgewogICAgICAgICAgICAgICAgICAgICBCeXRlQXJyYXlPdXRwdXRTdHJlYW0gc3RyZWFtID0gbmV3IEJ5dGVBcnJheU91dHB1dFN0cmVhbSgpOwogICAgICAgICAgICAgICAgICAgICBlbnRpdHkud3JpdGVUbyhzdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZW50aXR5U3RyaW5nID0gc3RyZWFtLnRvU3RyaW5nKCk7CiAKLSAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogQ2hlY2sgdGhlIGNvbnRlbnQgdHlwZSwgdG9vLgotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiIC0tZGF0YS1hc2NpaSBcIiIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZChlbnRpdHlTdHJpbmcpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiXCIiKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzQmluYXJ5Q29udGVudChyZXF1ZXN0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGJhc2U2NCA9IEJhc2U2NC5lbmNvZGVUb1N0cmluZyhzdHJlYW0udG9CeXRlQXJyYXkoKSwgQmFzZTY0Lk5PX1dSQVApOworICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5pbnNlcnQoMCwgImVjaG8gJyIgKyBiYXNlNjQgKyAiJyB8IGJhc2U2NCAtZCA+IC90bXAvJCQuYmluOyAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIgLS1kYXRhLWJpbmFyeSBAL3RtcC8kJC5iaW4iKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBlbnRpdHlTdHJpbmcgPSBzdHJlYW0udG9TdHJpbmcoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIgLS1kYXRhLWFzY2lpIFwiIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZChlbnRpdHlTdHJpbmcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoIlwiIik7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiIFtUT08gTVVDSCBEQVRBIFRPIElOQ0xVREVdIik7CiAgICAgICAgICAgICAgICAgfQpAQCAtNDQ2LDYgKzQ1NywzMCBAQAogICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwogICAgIH0KIAorICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNCaW5hcnlDb250ZW50KEh0dHBVcmlSZXF1ZXN0IHJlcXVlc3QpIHsKKyAgICAgICAgSGVhZGVyW10gaGVhZGVyczsKKyAgICAgICAgaGVhZGVycyA9IHJlcXVlc3QuZ2V0SGVhZGVycyhIZWFkZXJzLkNPTlRFTlRfRU5DT0RJTkcpOworICAgICAgICBpZiAoaGVhZGVycyAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKEhlYWRlciBoZWFkZXIgOiBoZWFkZXJzKSB7CisgICAgICAgICAgICAgICAgaWYgKCJnemlwIi5lcXVhbHNJZ25vcmVDYXNlKGhlYWRlci5nZXRWYWx1ZSgpKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBoZWFkZXJzID0gcmVxdWVzdC5nZXRIZWFkZXJzKEhlYWRlcnMuQ09OVEVOVF9UWVBFKTsKKyAgICAgICAgaWYgKGhlYWRlcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChIZWFkZXIgaGVhZGVyIDogaGVhZGVycykgeworICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIGNvbnRlbnRUeXBlIDogdGV4dENvbnRlbnRUeXBlcykgeworICAgICAgICAgICAgICAgICAgICBpZiAoaGVhZGVyLmdldFZhbHVlKCkuc3RhcnRzV2l0aChjb250ZW50VHlwZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBSZX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BRyA9ICJBc3luY1Rhc2siOwpAQCAtMTc1LDYgKzE4NSwxMSBAQAogICAgICAgICBGSU5JU0hFRCwKICAgICB9CiAKKyAgICAvKiogQGhpZGUgVXNlZCB0byBmb3JjZSBzdGF0aWMgaGFuZGxlciB0byBiZSBjcmVhdGVkLiAqLworICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBpbml0KCkgeworICAgICAgICBzSGFuZGxlci5nZXRMb29wZXIoKTsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBDcmVhdGVzIGEgbmV3IGFzeW5jaHJvbm91cyB0YXNrLiBUaGlzIGNvbnN0cnVjdG9yIG11c3QgYmUgaW52b2tlZCBvbiB0aGUgVUkgdGhyZWFkLgogICAgICAqLwpAQCAtMTg3LDYgKzIwMiwxNyBAQAogICAgICAgICB9OwogCiAgICAgICAgIG1GdXR1cmUgPSBuZXcgRnV0dXJlVGFzazxSZXN1bHQ+KG1Xb3JrZXIpIHsKKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwcm90ZWN0ZWQgdm9pZCBzZXQoUmVzdWx0IHYpIHsKKyAgICAgICAgICAgICAgICBzdXBlci5zZXQodik7CisgICAgICAgICAgICAgICAgaWYgKGlzQ2FuY2VsbGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgTWVzc2FnZSBtZXNzYWdlID0gc0hhbmRsZXIub2J0YWluTWVzc2FnZShNRVNTQUdFX1BPU1RfQ0FOQ0VMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBBc3luY1Rhc2tSZXN1bHQ8UmVzdWx0PihBc3luY1Rhc2sudGhpcywgKFJlc3VsdFtdKSBudWxsKSk7CisgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2Uuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgIHByb3RlY3RlZCB2b2lkIGRvbmUoK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19JTl9VU0UpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHZvaWQgbWFya0luVXNlKCkgeworICAgICAgICBmbGFncyB8PSBGTEFHX0lOX1VTRTsKKyAgICB9CisKICAgICAvKiogQ29uc3RydWN0b3IgKGJ1dCB0aGUgcHJlZmVycmVkIHdheSB0byBnZXQgYSBNZXNzYWdlIGlzIHRvIGNhbGwge0BsaW5rICNvYnRhaW4oKSBNZXNzYWdlLm9idGFpbigpfSkuCiAgICAgKi8KICAgICBwdWJsaWMgTWVzc2FnZSgpIHsKQEAgLTQ1Myw0ICs0NzQsMyBAQAogICAgICAgICByZXBseVRvID0gTWVzc2VuZ2VyLnJlYWRNZXNzZW5nZXJPck51bGxGcm9tUGFyY2VsKHNvdXJjZSk7CiAgICAgfQogfQotCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9vcy9NZXNzYWdlUXVldWUuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL29zL01lc3NhZ2VRdWV1ZS5qYXZhCmluZGV4IDAwOTAxNzcuLmJiMDc4MjUgMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2lkL29zL01lc3NhZ2VRdWV1ZS5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL29zL01lc3NhZ2VRdWV1ZS5qYXZhCkBAIC0xMjksNiArMTI5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIG1NZXNzYWdlcyA9IG1zZy5uZXh0OwogICAgICAgICAgICAgICAgICAgICAgICAgbXNnLm5leHQgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKENvbmZpZy5MT0dWKSBMb2cudigiTWVzc2FnZVF1ZXVlIiwgIlJldHVybmluZyBtZXNzYWdlOiAiICsgbXNnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5tYXJrSW5Vc2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtc2c7CiAgICAgICAgICAgICAgICA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KKyAgICAgICAgICAgIFBFTkFMVFlfTE9HIHwgUEVOQUxUWV9ESUFMT0cgfCBQRU5BTFRZX0RFQVRIIHwgUEVOQUxUWV9EUk9QQk9YIHwgUEVOQUxUWV9HQVRIRVIgfAorICAgICAgICAgICAgUEVOQUxUWV9ERUFUSF9PTl9ORVRXT1JLOworCisgICAgLyoqCiAgICAgICogVGhlIGN1cnJlbnQgVm1Qb2xpY3kgaW4gZWZmZWN0LgogICAgICAqLwogICAgIHByaXZhdGUgc3RhdGljIHZvbGF0aWxlIGludCBzVm1Qb2xpY3lNYXNrID0gMDsKQEAgLTMxNiwxMiArMzM1LDI4IEBACiAgICAgICAgICAgICAgKiBDcmFzaCB0aGUgd2hvbGUgcHJvY2VzcyBvbiB2aW9sYXRpb24uICBUaGlzIHBlbmFsdHkgcnVucyBhdAogICAgICAgICAgICAgICogdGhlIGVuZCBvZiBhbGwgZW5hYmxlZCBwZW5hbHRpZXMgc28geW91J2xsIHN0aWxsIGdldAogICAgICAgICAgICAgICogc2VlIGxvZ2dpbmcgb3Igb3RoZXIgdmlvbGF0aW9ucyBiZWZvcmUgdGhlIHByb2Nlc3MgZGllcy4KKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiA8cD5Vbmxpa2Uge0BsaW5rICNwZW5hbHR5RGVhdGhPbk5ldHdvcmt9LCB0aGlzIGFwcGxpZXMKKyAgICAgICAgICAgICAqIHRvIGRpc2sgcmVhZHMsIGRpc2sgd3JpdGVzLCBhbmQgbmV0d29yayB1c2FnZSBpZiB0aGVpcgorICAgICAgICAgICAgICogY29ycmVzcG9uZGluZyBkZXRlY3QgZmxhZ3MgYXJlIHNldC4KICAgICAgICAgICAgICAqLwogICAgICAgICAgICAgcHVibGljIEJ1aWxkZXIgcGVuYWx0eURlYXRoKCkgewogICAgICAgICAgICAgICAgIHJldHVybiBlbmFibGUoUEVOQUxUWV9ERUFUSCk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQ3Jhc2ggdGhlIHdob2xlIHByb2Nlc3Mgb24gYW55IG5ldHdvcmsgdXNhZ2UuICBVbmxpa2UKKyAgICAgICAgICAgICAqIHtAbGluayAjcGVuYWx0eURlYXRofSwgdGhpcyBwZW5hbHR5IHJ1bnMKKyAgICAgICAgICAgICAqIDxlbT5iZWZvcmU8L2VtPiBhbnl0aGluZyBlbHNlLiAgWW91IG11c3Qgc3RpbGwgaGF2ZQorICAgICAgICAgICAgICogY2FsbGVkIHtAbGluayAjZGV0ZWN0TmV0d29ya30gdG8gZW5hYmxlIHRoaXMuCisgICAgICAgICAgICAgKgorICAgICAgICAgICAgICogPHA+SW4gdGhlIEhvbmV5Y29tYiBvciBsYXRlciBTREtzLCB0aGlzIGlzIG9uIGJ5IGRlZmF1bHQuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBCdWlsZGVyIHBlbmFsdHlEZWF0aE9uTmV0d29yaygpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZW5hYmxlKFBFTkFMVFlfREVBVEhfT05fTkVUV09SSyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogTG9nIGRldGVjdGVkIHZpb2xhdGlvbnMgdG8gdGhlIHN5c3RlbSBsb2cuCiAgICAgICAgICAgICAgKi8KICAgICAgICAgICAgIHB1YmxpYyBCdWlsZGVyIHBlbmFsdHlMb2coKSB7CkBAIC02NDIsNiArNjc3LDE4IEBACiAgICAgfQogCiAgICAgLyoqCisgICAgICogVXNlZCBieSB0aGUgZnJhbWV3b3JrIHRvIG1ha2UgbmV0d29yayB1c2FnZSBvbiB0aGUgbWFpbgorICAgICAqIHRocmVhZCBhIGZhdGFsIGVycm9yLgorICAgICAqCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIHZvaWQgZW5hYmxlRGVhdGhPbk5ldHdvcmsoKSB7CisgICAgICAgIGludCBvbGRQb2xpY3kgPSBnZXRUaHJlYWRQb2xpY3lNYXNrKCk7CisgICAgICAgIGludCBuZXdQb2xpY3kgPSBvbGRQb2xpY3kgfCBERVRFQ1RfTkVUV09SSyB8IFBFTkFMVFlfREVBVEhfT05fTkVUV09SSzsKKyAgICAgICAgc2V0VGhyZWFkUG9saWN5TWFzayhuZXdQb2xpY3kpOworICAgIH0KKworICAgIC8qKgogICAgICAqIFBhcnNlcyB0aGUgQmxvY2tHdWFyZCBwb2xpY3kgbWFzayBvdXQgZnJvbSB0aGUgRXhjZXB0aW9uJ3MKICAgICAgKiBnZXRNZXNzYWdlKCkgU3RyaW5nIHZhbHVlLiAgS2luZGEgZ3Jvc3MsIGJ1dCBsZWFzdAogICAgICAqIGludmFzaXZlLiAgOi8KQEAgLTc1MSw2ICs3OTgsOSBAQAogICAgICAgICAgICAgaWYgKChtUG9saWN5TWFzayAmIERFVEVDVF9ORVRXT1JLKSA9PSAwKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKChtUG9saWN5TWFzayAmIFBFTkFMVFlfREVBVEhfT05fTkVUV09SSykgIT0gMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBOZXR3b3JrT25NYWluVGhyZWFkRXhjZXB0aW9uKCk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAodG9vTWFueVZpb2xhdGlvbnNUaGlzTG9vcCgpKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQpAQCAtODgxLDcgKzkzMSw3IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAvLyBUaGUgdmlvbGF0aW9uTWFzaywgcGFzc2VkIHRvIEFjdGl2aXR5TWFuYWdlciwgaXMgYQorICAgICAgICAgICAgLy8gVGhlIHZpb2xhdGlvbk1hc2tTdWJzZXQsIHBhc3NlZCB0byBBY3Rpdml0eU1hbmFnZXIsIGlzIGEKICAgICAgICAgICAgIC8vIHN1YnNldCBvZiB0aGUgb3JpZ2luYWwgU3RyaWN0TW9kZSBwb2xpY3kgYml0bWFzaywgd2l0aAogICAgICAgICAgICAgLy8gb25seSB0aGUgYml0IHZpb2xhdGVkIGFuZCBwZW5hbHR5IGJpdHMgdG8gYmUgZXhlY3V0ZWQKICAgICAgICAgICAgIC8vIGJ5IHRoZSBBY3Rpdml0eU1hbmFnZXJTZXJ2aWNlIHJlbWFpbmluZyBzZXQuCkBAIC04OTksNyArOTQ5LDM1IEBACiAgICAgICAgICAgICBpZiAodmlvbGF0aW9uTWFza1N1YnNldCAhPSAwKSB7CiAgICAgICAgICAgICAgICAgaW50IHZpb2xhdGlvbkJpdCA9IHBhcnNlVmlvbGF0aW9uRnJvbU1lc3NhZ2UoaW5mby5jcmFzaEluZm8uZXhjZXB0aW9uTWVzc2FnZSk7CiAgICAgICAgICAgICAgICAgdmlvbGF0aW9uTWFza1N1YnNldCB8PSB2aW9sYXRpb25CaXQ7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IHZpb2xhdGlvbk1hc2tTdWJzZXRGaW5hbCA9IHZpb2xhdGlvbk1hc2tTdWJzZXQ7CiAgICAgICAgICAgICAgICAgZmluYWwgaW50IHNhdmVkUG9saWN5TWFzayA9IGdldFRocmVhZFBvbGljeU1hc2soKTsKKworICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4ganVzdERyb3BCb3ggPSAoaW5mby5wb2xpY3kgJiBQRU5BTFRZX01BU0spID09IFBFTkFMVFlfRFJPUEJPWDsKKyAgICAgICAgICAgICAgICBpZiAoanVzdERyb3BCb3gpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgYWxsIHdlJ3JlIGdvaW5nIHRvIGFzayB0aGUgYWN0aXZpdHkgbWFuYWdlcgorICAgICAgICAgICAgICAgICAgICAvLyB0byBkbyBpcyBkcm9wYm94IGl0ICh0aGUgY29tbW9uIGNhc2UgZHVyaW5nCisgICAgICAgICAgICAgICAgICAgIC8vIHBsYXRmb3JtIGRldmVsb3BtZW50KSwgd2UgY2FuIGF2b2lkIGRvaW5nIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgLy8gY2FsbCBzeW5jaHJvbm91c2x5IHdoaWNoIEJpbmRlciBkYXRhIHN1Z2dlc3RzCisgICAgICAgICAgICAgICAgICAgIC8vIGlzbid0IGFsd2F5cyBzdXBlciBmYXN0LCBkZXNwaXRlIHRoZSBpbXBsZW1lbnRhdGlvbgorICAgICAgICAgICAgICAgICAgICAvLyBpbiB0aGUgQWN0aXZpdHlNYW5hZ2VyIHRyeWluZyB0byBiZSBtb3N0bHkgYXN5bmMuCisgICAgICAgICAgICAgICAgICAgIG5ldyBUaHJlYWQoImNhbGxBY3Rpdml0eU1hbmFnZXJGb3JTdHJpY3RNb2RlRHJvcGJveCIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm9jZXNzLnNldFRocmVhZFByaW9yaXR5KFByb2Nlc3MuVEhSRUFEX1BSSU9SSVRZX0JBQ0tHUk9VTkQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCkuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlQXBwbGljYXRpb25TdHJpY3RNb2RlVmlvbGF0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW50aW1lSW5pdC5nZXRBcHBsaWNhdGlvbk9iamVjdCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aW9sYXRpb25NYXNrU3Vic2V0RmluYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlJlbW90ZUV4Y2VwdGlvbiBoYW5kbGluZyBTdHJpY3RNb2RlIHZpb2xhdGlvbiIsIGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfS5zdGFydCgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gTm9ybWFsIHN5bmNocm9ub3VzIGNhbGwgdG8gdGhlIEFjdGl2aXR5TWFuYWdlci4KICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAvLyBGaXJzdCwgcmVtb3ZlIGFueSBwb2xpY3kgYmVmb3JlIHdlIGNhbGwgaW50byB0aGUgQWN0aXZpdHkgTWFuYWdlciwKICAgICAgICAgICAgICAgICAgICAgLy8gb3RoZXJ3aXNlIHdlJ2xsIGluZmluaXRlIHJlY3Vyc2UgYXMgd2UgdHJ5IHRvIGxvZyBwb2xpY3kgdmlvbGF0aW9ucwpAQCAtMTExMCw2ICsxMTg4LDExIEBACiAgICAgICAgIHB1YmxpYyBpbnQgZHVyYXRpb25NaWxsaXMgPSAtMTsKIAogICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG51bWJlciBvZiBhbmltYXRpb25zIGN1cnJlbnRseSBydW5uaW5nLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCBudW1BbmltYXRpb25zUnVubmluZyA9IDA7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFdoaWNoIHZpb2xhdGlvbiBudW1iZXIgdGhpcyB3YXMgKDEtYmFzZWQpIHNpbmNlIHRoZSBsYXN0IExvb3BlciBsb29wLAogICAgICAgICAgKiBmcm9tIHRoZSBwZXJzcGVjdGl2ZSBvZiB0aGUgcm9vdCBjYWxsZXIgKGlmIGl0IGNyb3NzZWQgYW55IHByb2Nlc3NlcwogICAgICAgICAgKiB2aWEgQmluZGVyIGNhbGxzKS4gIFRoZSB2YWx1ZSBpcyAwIGlmIHRoZSByb290IGNhbGxlciB3YXNuJ3Qgb24gYSBMb29wZXIKQEAgLTExMjQsNiArMTIwNywxMiBAQAogICAgICAgICBwdWJsaWMgbG9uZyB2aW9sYXRpb25VcHRpbWVNaWxsaXM7CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBhY3Rpb24gb2YgdGhlIEludGVudCBiZWluZyBicm9hZGNhc3QgdG8gc29tZWJvZHkncyBvblJlY2VpdmUKKyAgICAgICAgICogb24gdGhpcyB0aHJlYWQgcmlnaHQgbm93LCBvciBudWxsLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIFN0cmluZyBicm9hZGNhc3RJbnRlbnRBY3Rpb247CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIENyZWF0ZSBhbiB1bmluaXRpYWxpemVkIGluc3RhbmNlIG9mIFZpb2xhdGlvbkluZm8KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBWaW9sYXRpb25JbmZvKCkgewpAQCAtMTEzOCw2ICsxMjI3LDExIEBACiAgICAgICAgICAgICBjcmFzaEluZm8gPSBuZXcgQXBwbGljYXRpb25FcnJvclJlcG9ydC5DcmFzaEluZm8odHIpOwogICAgICAgICAgICAgdmlvbGF0aW9uVXB0aW1lTWlsbGlzID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CiAgICAgICAgICAgICB0aGlzLnBvbGljeSA9IHBvbGljeTsKKyAgICAgICAgICAgIHRoaXMubnVtQW5pbWF0aW9uc1J1bm5pbmcgPSBWYWx1ZUFuaW1hdG9yLmdldEN1cnJlbnRBbmltYXRpb25zQ291bnQoKTsKKyAgICAgICAgICAgIEludGVudCBicm9hZGNhc3RJbnRlbnQgPSBBY3Rpdml0eVRocmVhZC5nZXRJbnRlbnRCZWluZ0Jyb2FkY2FzdCgpOworICAgICAgICAgICAgaWYgKGJyb2FkY2FzdEludGVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYnJvYWRjYXN0SW50ZW50QWN0aW9uID0gYnJvYWRjYXN0SW50ZW50LmdldEFjdGlvbigpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgLyoqCkBAIC0xMTYzLDcgKzEyNTcsOSBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgZHVyYXRpb25NaWxsaXMgPSBpbi5yZWFkSW50KCk7CiAgICAgICAgICAgICB2aW9sYXRpb25OdW1UaGlzTG9vcCA9IGluLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIG51bUFuaW1hdGlvbnNSdW5uaW5nID0gaW4ucmVhZEludCgpOwogICAgICAgICAgICAgdmlvbGF0aW9uVXB0aW1lTWlsbGlzID0gaW4ucmVhZExvbmcoKTsKKyAgICAgICAgICAgIGJyb2FkY2FzdEludGVudEFjdGlvbiA9IGluLnJlYWRTdHJpbmcoKTsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgpAQCAtMTE3NCw3ICsxMjcwLDkgQEAKICAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQocG9saWN5KTsKICAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoZHVyYXRpb25NaWxsaXMpOwogICAgICAgICAgICAgZGVzdC53cml0ZUludCh2aW9sYXRpb25OdW1UaGlzTG9vcCk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KG51bUFuaW1hdGlvbnNSdW5uaW5nKTsKICAgICAgICAgICAgIGRlc3Qud3JpdGVMb25nKHZpb2xhdGlvblVwdGltZU1pbGxpcyk7CisgICAgICAgICAgICBkZXN0LndyaXRlU3RyaW5nKGJyb2FkY2FzdEludGVudEFjdGlvbik7CiAgICAgICAgIH0KIAogCkBAIC0xMTkwLDcgKzEyODgsMTMgQEAKICAgICAgICAgICAgIGlmICh2aW9sYXRpb25OdW1UaGlzTG9vcCAhPSAwKSB7CiAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihwcmVmaXggKyAidmlvbGF0aW9uTnVtVGhpc0xvb3A6ICIgKyB2aW9sYXRpb25OdW1UaGlzTG9vcCk7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobnVtQW5pbWF0aW9uc1J1bm5pbmcgIT0gMCkgeworICAgICAgICAgICAgICAgIHB3LnByaW50bG4ocHJlZml4ICsgIm51bUFuaW1hdGlvbnNSdW5uaW5nOiAiICsgbnVtQW5pbWF0aW9uc1J1bm5pbmcpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgcHcucHJpbnRsbihwcmVmaXggKyAidmlvbGF0aW9uVXB0aW1lTWlsbGlzOiAiICsgdmlvbGF0aW9uVXB0aW1lTWlsbGlzKTsKKyAgICAgICAgICAgIGlmIChicm9hZGNhc3RJbnRlbnRBY3Rpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHB3LnByaW50bG4ocHJlZml4ICsgImJyb2FkY2FzdEludGVudEFjdGlvbjogIiArIGJyb2FkY2FzdEludGVudEFjdGlvbik7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL29zL1N5c3RlbVNlcnZpY2UuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL29zL1N5c3RlbVNlcnZpY2UuamF2YQppbmRleCA0NDdjZDFmLi5kYTI3ZGI1IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9vcy9TeXN0ZW1TZXJ2aWNlLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvb3MvU3lzdGVtU2VydmljZS5qYXZhCkBAIC0yOCw0ICsyOCw5IEBACiAgICAgcHVibGljIHN0YXRpYyB2b2lkIHN0b3AoU3RyaW5nIG5hbWUpIHsKICAgICAgICAgU3lzdGVtUHJvcGVydGll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ICAgICAgICAgICAgICBib29sZWFuIF9yZXN1bHQ7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgX2RhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihERVNDUklQVE9SKTsKKyAgICAgICAgICAgICAgICAgICAgbVJlbW90ZS50cmFuc2FjdChTdHViLlRSQU5TQUNUSU9OX2lzRXh0ZXJuYWxTdG9yYWdlRW11bGF0ZWQsIF9kYXRhLCBfcmVwbHksIDApOworICAgICAgICAgICAgICAgICAgICBfcmVwbHkucmVhZEV4Y2VwdGlvbigpOworICAgICAgICAgICAgICAgICAgICBfcmVzdWx0ID0gMCAhPSBfcmVwbHkucmVhZEludCgpOworICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgIF9yZXBseS5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgICAgIF9kYXRhLnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIF9yZXN1bHQ7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgREVTQ1JJUFRPUiA9ICJJTW91bnRTZXJ2aWNlIjsKQEAgLTYyMSw2ICs2NDAsOCBAQAogCiAgICAgICAgIHN0YXRpYyBmaW5hbCBpbnQgVFJBTlNBQ1RJT05fZ2V0TW91bnRlZE9iYlBhdGggPSBJQmluZGVyLkZJUlNUX0NBTExfVFJBTlNBQ1RJT04gKyAyNDsKIAorICAgICAgICBzdGF0aWMgZmluYWwgaW50IFRSQU5TQUNUSU9OX2lzRXh0ZXJuYWxTdG9yYWdlRW11bGF0ZWQgPSBJQmluZGVyLkZJUlNUX0NBTExfVFJBTlNBQ1RJT04gKyAyNTsKKwogICAgICAgICAvKioKICAgICAgICAgICogQ2FzdCBhbiBJQmluZGVyIG9iamVjdCBpbnRvIGFuIElNb3VudFNlcnZpY2UgaW50ZXJmYWNlLCBnZW5lcmF0aW5nIGEKICAgICAgICAgICogcHJveHkgaWYgbmVlZGVkLgpAQCAtODk1LDYgKzkxNiwxMyBAQAogICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZVN0cmluZyhtb3VudGVkUGF0aCk7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIFRSQU5TQUNUSU9OX2lzRXh0ZXJuYWxTdG9yYWdlRW11bGF0ZWQ6IHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKERFU0NSSVBUT1IpOworICAgICAgICAgICAgICAgICAgICBib29sZWFuIGVtdWxhdGVkID0gaXNFeHRlcm5hbFN0b3JhZ2VFbXVsYXRlZCgpOworICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlSW50KGVtdWxhdGVkID8gMSA6IDApOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gc3VwZXIub25UcmFuc2FjdChjb2RlLCBkYXRhLCByZXBseSwgZmxhZ3MpOwogICAgICAgICB9CkBAIC0xMDQ5LDQgKzEwNzcsOSBAQAogICAgICAqIFVucmVnaXN0ZXJzIGFuIElNb3VudFNlcnZpY2VMaXN0ZW5lcgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHVucmVnaXN0ZXJMaXN0ZW5lcihJTW91bnRTZXJ2aWNlTGlzdGVuZXIgbGlzdGVuZXIpIHRocm93cyBSZW1vdGVFeGNlcHRpb247CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHdoZXRoZXIgb3Igbm90IHRoZSBleHRlcm5hbCBzdG9yYWdlIGlzIGVtdWxhdGVkLgorICAgICAqL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5NiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDg5JywgIlx1RkY5NyIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDhBJywgIlx1RkY5OCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDhCJywgIlx1RkY5OSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDhDJywgIlx1RkY5QSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDhEJywgIlx1RkY5QiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDhFJywgIlx1RkY5QyIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDhGJywgIlx1RkY5QyIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDkwJywgIlx1RkY3MiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDkxJywgIlx1RkY3NCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDkyJywgIlx1RkY2NiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDkzJywgIlx1RkY5RCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDlCJywgIlx1RkY5RSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMDlDJywgIlx1RkY5RiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEExJywgIlx1RkY2NyIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEEyJywgIlx1RkY3MSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEEzJywgIlx1RkY2OCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEE0JywgIlx1RkY3MiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCg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Q3JywgIlx1RkY4Q1x1RkY5RiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEQ4JywgIlx1RkY4RCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEQ5JywgIlx1RkY4RFx1RkY5RSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMERBJywgIlx1RkY4RFx1RkY5RiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMERCJywgIlx1RkY4RSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMERDJywgIlx1RkY4RVx1RkY5RSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEREJywgIlx1RkY4RVx1RkY5RiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMERFJywgIlx1RkY4RiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMERGJywgIlx1RkY5MCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEUwJywgIlx1RkY5MSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEUxJywgIlx1RkY5MiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEUyJywgIlx1RkY5MyIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEUzJywgIlx1RkY2QyIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEU0JywgIlx1RkY5NCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEU1JywgIlx1RkY2RCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEU2JywgIlx1RkY5NSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEU3JywgIlx1RkY2RSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEU4JywgIlx1RkY5NiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEU5JywgIlx1RkY5NyIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEVBJywgIlx1RkY5OCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEVCJywgIlx1RkY5OSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEVDJywgIlx1RkY5QSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEVEJywgIlx1RkY5QiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEVFJywgIlx1RkY5QyIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEVGJywgIlx1RkY5QyIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEYwJywgIlx1RkY3MiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEYxJywgIlx1RkY3NCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEYyJywgIlx1RkY2NiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEYzJywgIlx1RkY5RCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEY0JywgIlx1RkY3M1x1RkY5RSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEY1JywgIlx1RkY3NiIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEY2JywgIlx1RkY3OSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEZCJywgIlx1RkY2NSIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHUzMEZDJywgIlx1RkY3MCIpOwotICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHVGRjAxJywgIiEiKTsKLSAgICAgICAgc0hhbGZ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LSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnNldCA9IENoYXJzZXRVdGlscy5jaGFyc2V0Rm9yVmVuZG9yKGNoYXJzZXQpLm5hbWUoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRDaGFyc2V0RXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDYXJlZXItc3BlY2lmaWMgXCIiICsgY2hhcnNldCArICJcIiB3YXMgbm90IGZvdW5kIChhcyB1c3VhbCkuICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiVXNlIGl0IGFzIGlzLiIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1DaGFyc2V0ID0gY2hhcnNldDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChtSXNEb0NvTW8pIHsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJzZXQgPSBDaGFyc2V0VXRpbHMuY2hhcnNldEZvclZlbmRvcihTSElGVF9KSVMsICJkb2NvbW8iKS5uYW1lKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkQ2hhcnNldEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRG9Db01vLXNwZWNpZmljIFNISUZUX0pJUyB3YXMgbm90IGZvdW5kLiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIlVzZSBTSElGVF9KSVMgYXMgaXMuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaGFyc2V0ID0gU0hJRlRfSklTOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJzZXQgPSBDaGFyc2V0VXRpbHMuY2hhcnNldEZvclZlbmRvcihTSElGVF9KSVMpLm5hbWUoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRDaGFyc2V0RXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDYXJlZXItc3BlY2lmaWMgU0hJRlRfSklTIHdhcyBub3QgZm91bmQuICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiVXNlIFNISUZUX0pJUyBhcyBpcy4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJzZXQgPSBTSElGVF9KSVM7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUNoYXJzZXQgPSBjaGFyc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVZDYXJkQ2hhcnNldFBhcmFtZXRlciA9ICJDSEFSU0VUPSIgKyBTSElGVF9KSVM7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoY2hhcnNldCkpIHsKLSAgICAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgIlVzZSB0aGUgY2hhcnNldCBcIiIgKyBWQ2FyZENvbmZpZy5ERUZBVUxUX0VYUE9SVF9DSEFSU0VUCi0gICAgICAgICAgICAgICAgICAgICAgICArICJcIiBmb3IgZXhwb3J0LiIp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G9vc2UgInN1cGVyIHByaW1hcnkiIENvbnRlbnRWYWx1ZXMuCi0gICAgICAgICAgICAgICAgcHJpbWFyeUNvbnRlbnRWYWx1ZXMgPSBjb250ZW50VmFsdWVzOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfSBlbHNlIGlmIChwcmltYXJ5Q29udGVudFZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgLy8gV2UgY2hvb3NlIHRoZSBmaXJzdCAicHJpbWFyeSIgQ29udGVudFZhbHVlcwotICAgICAgICAgICAgICAgIC8vIGlmICJzdXBlciBwcmltYXJ5IiBDb250ZW50VmFsdWVzIGRvZXMgbm90IGV4aXN0LgotICAgICAgICAgICAgICAgIGZpbmFsIEludGVnZXIgaXNQcmltYXJ5ID0gY29udGVudFZhbHVlcy5nZXRBc0ludGVnZXIoU3RydWN0dXJlZE5hbWUuSVNfUFJJTUFSWSk7Ci0gICAgICAgICAgICAgICAgaWYgKGlzUHJpbWFyeSAhPSBudWxsICYmIGlzUHJpbWFyeSA+IDAgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5zTm9uRW1wdHlOYW1lKGNvbnRlbnRWYWx1ZXMpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHByaW1hcnlDb250ZW50VmFsdWVzID0gY29udGVudFZhbHVlczsKLSAgICAgICAgICAgICAgICAgICAgLy8gRG8gbm90IGJyZWFrLCBzaW5jZSB0aGVyZSBtYXkgYmUgQ29udGVudFZhbHVlcyB3aXRoICJzdXBlciBwcmltYXJ5IgotICAgICAgICAgICAgICAgICAgICAvLyBhZnRlcndvcmQuCi0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzdWJwcmltYXJ5Q29udGVudFZhbHVlcyA9PSBudWxsICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250YWluc05vbkVtcHR5TmFtZShjb250ZW50VmFsdWVzKSkgewotICAgICAgICAgICAgICAgICAgICBzdWJwcmltYXJ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sKLSAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5QXBwZW5kQ2hhcnNldFBhcmFtZXRlclRvTmFtZSA9Ci0gICAgICAgICAgICAgICAgICAgIHNob3VsZEFwcGVuZENoYXJzZXRQYXJhbShmYW1pbHlOYW1lLCBnaXZlbk5hbWUsIG1pZGRsZU5hbWUsIHByZWZpeCwgc3VmZml4KTsKLSAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlVG9OYW1lID0KLSAgICAgICAgICAgICAgICAgICAgKCFtUmVmcmFpbnNRUFRvTmFtZVByb3BlcnRpZXMgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAhKFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKGZhbWlseU5hbWUpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShnaXZlbk5hbWUpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShtaWRkbGVOYW1lKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkocHJlZml4KSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoc3VmZml4KSkpOwotCi0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZm9ybWF0dGVkTmFtZTsKLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZGlzcGxheU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgZm9ybWF0d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AgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfRU5EX09GX0xJTkUpOwotICAgICAgICB9IGVsc2UgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShkaXNwbGF5TmFtZSkpIHsKLSAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlVG9EaXNwbGF5TmFtZSA9Ci0gICAgICAgICAgICAgICAgKCFtUmVmcmFpbnNRUFRvTmFtZVByb3BlcnRpZXMgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShkaXNwbGF5TmFtZSkpOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWREaXNwbGF5TmFtZSA9Ci0gICAgICAgICAgICAgICAgICAgIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZVRvRGlzcGxheU5hbWUgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuY29kZVF1b3RlZFByaW50YWJsZShkaXNwbGF5TmFtZSkgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc2NhcGVDaGFyYWN0ZXJzKGRpc3BsYXlOYW1lKTsKLQotICAgICAgICAgICAgLy8gTgotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX04pOwotICAgICAgICAgICAgaWYgKHNob3VsZEFwcGVuZENoYXJzZXRQYXJhbShkaXNwbGF5TmFtZSkpIHsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQobVZDYXJkQ2hhcnNldFBhcmFtZXRlcik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAocmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlVG9EaXNwbG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2b2lkIGFwcGVuZFBob25ldGljTmFtZUZpZWxkcyhmaW5hbCBDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMpIHsKLSAgICAgICAgZmluYWwgU3RyaW5nIHBob25ldGljRmFtaWx5TmFtZTsKLSAgICAgICAgZmluYWwgU3RyaW5nIHBob25ldGljTWlkZGxlTmFtZTsKLSAgICAgICAgZmluYWwgU3RyaW5nIHBob25ldGljR2l2ZW5OYW1lOwotICAgICAgICB7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgdG1wUGhvbmV0aWNGYW1pbHlOYW1lID0KLSAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFN0cnVjdHVyZWROYW1lLlBIT05FVElDX0ZBTUlMWV9OQU1FKTsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyB0bXBQaG9uZXRpY01pZGRsZU5hbWUgPQotICAgICAgICAgICAgICAgIGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfTUlERExFX05BTUUpOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIHRtcFBob25ldGljR2l2ZW5OYW1lID0KLSAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFN0cnVjdHVyZWROYW1lLlBIT05FVElDX0dJVkVOX05BTUUpOwotICAgICAgICAgICAgaWYgKG1OZWVkc1RvQ29udmVydFBob25ldGljU3RyaW5nKSB7Ci0gICAgICAgICAgICAgICAgcGhvbmV0aWNGYW1pbHlOYW1lID0gVkNhcmRVdGlscy50b0hhbGZXaWR0aFN0cmluZyh0bXBQaG9uZXRpY0ZhbWlseU5hbWUpOwotICAgICAgICAgICAgICAgIHBob25ldGljTWlkZGxlTmFtZSA9IFZDYXJkVXRpbHMudG9IYWxmV2lkdGhTdHJpbmcodG1wUGhvbmV0aWNNaWRkbGVOYW1lKTsKLSAgICAgICAgICAgICAgICBwaG9uZX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0aWVzCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiAhKFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG9uZXRpY0ZhbWlseU5hbWUpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob25ldGljTWlkZGxlTmFtZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmV0aWNHaXZlbk5hbWUpKSk7Ci0KLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkUGhvbmV0aWNGYW1pbHlOYW1lOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWU7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFBob25ldGljR2l2ZW5OYW1lOwotICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgIGVuY29kZWRQaG9uZXRpY0ZhbWlseU5hbWUgPSBlbmNvZGVRdW90ZWRQcmludGFibGUocGhvbmV0aWNGYW1pbHlOYW1lKTsKLSAgICAgICAgICAgICAgICBlbmNvZGVkUGhvbmV0aWNNaWRkbGVOYW1lID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHBob25ldGljTWlkZGxlTmFtZSk7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZFBob25ldGljR2l2ZW5OYW1lID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHBob25ldGljR2l2ZW5OYW1lKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZFBob25ldGljRmFtaWx5TmFtZSA9IGVzY2FwZUNoYXJhY3RlcnMocGhvbmV0aWNGYW1pbHlOYW1lKTsKLSAgICAgICAgICAgICAgICBlbmNvZGVkUGhvbmV0aWNNaWRkbGVOYW1lID0gZXNjYXBlQ2hhcmFjdGVycyhwaG9uZXRpY01pZGRsZU5hbWUpOwotICAgICAgICAgICAgICAgIGVuY29kZWRQaG9uZXRpY0dpdmVuTmFtZSA9IGVzY2FwZUNoYXJhY3RlcnMocGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoc2hvdWxkQXBwZW5kQ2hhcnNldFBhcmFtKGVuY29kZWRQaG9uZXRpY0ZhbWlseU5hbWUsCi0gICAgICAgICAgICAgICAgICAgIGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWUsIGVuY29kZWRQaG9uZXRpY0dpdmVuTmFtZSkpIHsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQobVZDYXJkQ2hhcnNldFBhcmFtZXRlcik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJvb2xlYW4gZmlyc3QgPSB0cnVlOwotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZW5jb2RlZFBob25ldGljRmFtaWx5TmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVuY29kZWRQaG9uZXRpY0ZhbWlseU5hbWUpOwotICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3QgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChlbmNvZGVkUGhvbmV0aWNNaWRkbGVOYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghZmlyc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7ICAvLyBmYW1pbHk7Z2l2ZW4KLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7ICAvLyBnaXZlbjttaWRkbGUKLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7ICAvLyBtaWRkbGU7cHJlZml4Ci0gICAgICAgICAgICBtQnVpbGRlci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pOwotICAgICAgICAgICAgICAgIGlmIChzaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0ocGhvbmV0aWNHaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9QQVJBTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQobVZDYXJkQ2hhcnNldFBhcmFtZXRlcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChyZWFsbHlVc2VRdW90ZWRQcmludGFibGUpIHsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9QQVJBTV9FTkNPRElOR19RUCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVuY29kZWRQaG9uZXRpY0dpdmVuTmFtZSk7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0VORF9PRl9MSU5FKTsKLSAgICAgICAgICAgIH0gIC8vIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocGhvbmV0aWNHaXZlbk5hbWUpKQotICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShwaG9uZXRpY01pZGRsZU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiByZWFsbHlVc2VRdW90ZWRQcmludGFibGUgPQotICAgICAgICAgICAgICAgICAgICAobVNob3VsZFVzZVF1b3RlZFByaW50YWJsZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShwaG9uZXRpY01pZGRsZU5hbWUpKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFBob25ldGljTWlkZGxlTmFtZTsKLSAgICAgICAgICAgICAgICBpZiAocmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWUgPSBlbmNvZGVRdW90ZWRQcmludGFibGUocGhvbmV0aWNNaWRkbGVOYW1lKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBlbmNvZGVkUGhvbmV0aWNNaWRkbGVOYW1lID0gZXNjYXBlQ2hhcmFjdGVycyhwaG9uZXRpY01pZGRsZU5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfWF9QSE9ORVRJQ19NSURETEVfTkFNRSk7Ci0gICAgICAgICAgICAgICAgaWYgKHNob3VsZEFwcGVuZENoYXJzZXRQYXJhbShwaG9uZXRpY01pZGRsZU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9QQVJBTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQobVZDYXJkQ2hhcnNldFBhcmFtZXRlcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChyZWFsbHlVc2VRdW90ZWRQcmludGFibGUpIHsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9QQVJBTV9FTkNPRElOR19RUCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWUpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9FTkRfT0ZfTElORSk7Ci0gICAgICAgICAgICB9ICAvLyBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHBob25ldGljR2l2ZW5OYW1lKSkKLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocGhvbmV0aWNGYW1pbHlOYW1lKSkgewotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlID0KLSAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkocGhvbmV0aWNGYW1pbHlOYW1lKSk7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRQaG9uZXRpY0ZhbWlseU5hbWU7Ci0gICAgICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgICAgICBlbmNvZGVkUGhvbmV0aWNGYW1pbHlOYW1lID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHBob25ldGljRmFtaWx5TmFtZSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZW5jb2RlZFBob25ldGljRmFtaWx5TmFtZSA9IGVzY2FwZUNoYXJhY3RlcnMocGhvbmV0aWNGYW1pbHlOYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUJ1aWx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UHJvcGVydHk7Ci0gICAgICAgIGlmIChtSXNWMzBPclY0MCkgeyAgIC8vIFRoZXNlIHNwZWNpZmljYXRpb25zIGhhdmUgTklDS05BTUUgcHJvcGVydHkuCi0gICAgICAgICAgICB1c2VBbmRyb2lkUHJvcGVydHkgPSBmYWxzZTsKLSAgICAgICAgfSBlbHNlIGlmIChtVXNlc0FuZHJvaWRQcm9wZXJ0eSkgewotICAgICAgICAgICAgdXNlQW5kcm9pZFByb3BlcnR5ID0gdHJ1ZTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIFRoZXJlJ3Mgbm8gd2F5IHRvIGFkZCB0aGlzIGZpZWxkLgotICAgICAgICAgICAgcmV0dXJuIHRoaXM7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXNMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbmlja25hbWUgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKE5pY2tuYW1lLk5BTUUpOwotICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShuaWNrbmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICh1c2VBbmRyb2lkUHJvcGVydHkpIHsKLSAgICAgICAgICAgICAgICAgICAgYXBwZW5kQW5kcm9pZFNwZWNpZmljUHJvcGVydHkoTmlja25hbWUuQ09OVEVOVF9JVEVNX1RZUEUsIGNvbnRlbnRWYWx1ZXMpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGFwcGVuZExpbmVXaXRoQ2hhcnNldEFuZFFQRGV0ZWN0aW9uKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX05JQ0tOQU1FLCBuaWNrbmFtZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0aGlzOwotICAgIH0KLQotICAgIHB1YmxpYyBWQ2FyZEJ1aWxkZXIgYXBwZW5kUGhvbmVzKGZpbmFsIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgYm9vbGVhbiBwaG9uZUxpbmVFeGlzdHMgPSBmYWxzZTsKLSAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXNMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIFNldDxTdHJpbmc+IHBob25lU2V0ID0gbmV3IEhhc2hTZXQ8U3RyaW5nPigpOwotICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIGZpbmFsIEludGVnZXIgdHlwZUFzT2JqZWN0ID0gY29udGVudFZhbHVlcy5nZXRBc0ludGVnZXIoUGhvbmUuVFlQRSk7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxhYmVsID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhQaG9uZS5MQUJFTCk7Ci0gICAgICAgICAgICAgICAgZmluYWwgSW50ZWdlciBpc1ByaW1hcnlBc0ludGVnZXIgPSBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihQaG9uZS5JU19QUklNQVJZKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGlzUHJpbWFyeSA9IChpc1ByaW1hcnlBc0ludGVnZXIgIT0gbnVsbCA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAoaXNQcmltYXJ5QXNJbnRlZ2VyID4gMCkgOiBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHBob25lTnVtYmVyID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhQaG9uZS5OVU1CRVIpOwotICAgICAgICAgICAgICAgIGlmIChwaG9uZU51bWJlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBob25lTnVtYmVyID0gcGhvbmVOdW1iZXIudHJpbSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkocGhvbmVOdW1iZXIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8vIFBBR0VSIG51bWJlciBuZWVkcyB1bmZvcm1hdHRlZCAicGhvbmUgbnVtYmVyIi4KLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdHlwZSA9ICh0eXBlQXNPYmplY3QgIT0gbnVsbCA/IHR5cGVBc09iamVjdCA6IERFRkFVTFRfUEhPTkVfVFlQRSk7Ci0gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gUGhvbmUuVFlQRV9QQUdFUiB8fAotICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRDb25maWcucmVmcmFpblBob25lTnVtYmVyRm9ybWF0dGluZyhtVkNhcmRUeXBlKSkgewotICAgICAgICAgICAgICAgICAgICBwaG9uZUxpbmVFeGlzdHMgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBpZiAoIXBob25lU2V0LmNvbnRhaW5zKHBob25lTnVtYmVyKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmVTZXQuYWRkKHBob25lTnVtYmVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZFRlbExpbmUodHlwZSwgbGFiZWwsIHBob25lTnVtYmVyLCBpc1ByaW1hcnkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgTGlzdDxTdHJpbmc+IHBob25lTnVtYmVyTGlzdCA9IHNwbGl0QW5kVHJpbVBob25lTnVtYmVycyhwaG9uZU51bWJlcik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwaG9uZU51bWJlckxpc3QuaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBwaG9uZUxpbmVFeGlzdHMgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBhY3R1YWxQaG9uZU51bWJlciA6IHBob25lTnVtYmVyTGlzdCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFwaG9uZVNldC5jb250YWlucyhhY3R1YWxQaG9uZU51bWJlcikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZm9ybWF0ID0gVkNhcmRVdGlscy5nZXRQaG9uZU51bWJlckZvcm1hdChtVkNhcmRUeXBlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgZm9ybWF0dGVkUGhvbmVOdW1iZXIgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5mb3JtYXROdW1iZXIoYWN0dWFsUGhvbmVOdW1iZXIsIGZvcm1hdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmVTZXQuYWRkKGFjdHVhbFBob25lTnVtYmVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRUZWxMaW5lKHR5cGUsIGxhYmVsLCBmb3JtYXR0ZWRQaG9uZU51bWJlciwgaXNQcmltYXJ5KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSAgLy8gZm9yIChTdHJpbmcgYWN0dWFsUGhvbmVOdW1iZXIgOiBwaG9uZU51bWJlckxpc3QpIHsKLSAgICAgICAgICAg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gIGVtYWlsQWRkcmVzcyA9IGVtYWlsQWRkcmVzcy50cmltKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShlbWFpbEFkZHJlc3MpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBJbnRlZ2VyIHR5cGVBc09iamVjdCA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEVtYWlsLlRZUEUpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCB0eXBlID0gKHR5cGVBc09iamVjdCAhPSBudWxsID8KLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVBc09iamVjdCA6IERFRkFVTFRfRU1BSUxfVFlQRSk7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxhYmVsID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhFbWFpbC5MQUJFTCk7Ci0gICAgICAgICAgICAgICAgSW50ZWdlciBpc1ByaW1hcnlBc0ludGVnZXIgPSBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihFbWFpbC5JU19QUklNQVJZKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGlzUHJpbWFyeSA9IChpc1ByaW1hcnlBc0ludGVnZXIgIT0gbnVsbCA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAoaXNQcmltYXJ5QXNJbnRlZ2VyID4gMCkgOiBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgZW1haWxBZGRyZXNzRXhpc3RzID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBpZiAoIWFkZHJlc3NTZXQuY29udGFpbnMoZW1haWxBZGRyZXNzKSkgewotICAgICAgICAgICAgICAgICAgICBhZGRyZXNzU2V0LmFkZChlbWFpbEFkZHJlc3MpOwotICAgICAgICAgICAgICAgICAgICBhcHBlbmRFbWFpbExpbmUodHlw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SB7Ci0gICAgICAgIGludCBjdXJyZW50UHJpb3JpdHkgPSBJbnRlZ2VyLk1BWF9WQUxVRTsKLSAgICAgICAgaW50IGN1cnJlbnRUeXBlID0gSW50ZWdlci5NQVhfVkFMVUU7Ci0gICAgICAgIENvbnRlbnRWYWx1ZXMgY3VycmVudENvbnRlbnRWYWx1ZXMgPSBudWxsOwotICAgICAgICBmb3IgKGZpbmFsIENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgICAgICBpZiAoY29udGVudFZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIHR5cGVBc0ludGVnZXIgPSBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihTdHJ1Y3R1cmVkUG9zdGFsLlRZUEUpOwotICAgICAgICAgICAgZmluYWwgSW50ZWdlciBwcmlvcml0eUFzSW50ZWdlciA9IHNQb3N0YWxUeXBlUHJpb3JpdHlNYXAuZ2V0KHR5cGVBc0ludGVnZXIpOwotICAgICAgICAgICAgZmluYWwgaW50IHByaW9yaXR5ID0KLSAgICAgICAgICAgICAgICAgICAgKHByaW9yaXR5QXNJbnRlZ2VyICE9IG51bGwgPyBwcmlvcml0eUFzSW50ZWdlciA6IEludGVnZXIuTUFYX1ZBTFVFKTsKLSAgICAgICAgICAgIGlmIChwcmlvcml0eSA8IGN1cnJlbnRQcmlvcml0eSkgewotICAgICAgICAgICAgICAgIGN1cnJlbnRQcmlvcml0eSA9IHByaW9yaXR5OwotICAgICAgICAgICAgICAgIGN1cnJlbnRUeXBlID0gdHlwZUFzSW50ZWdlcjsKLSAgICAgICAgICAgICAgICBjdXJyZW50Q29udGVudFZhbHVlcyA9IGNvbnRlbnRWYWx1ZXM7Ci0gICAgICAgICAgICAgICAgaWYgKHByaW9yaXR5ID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGN1cnJlbnRDb250ZW50VmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgIExvZy53KExPR19UQUcsICJTaG91bGQgbm90IGNvbWUgaGVyZS4gTXVzdCBoYXZlIGF0IGxlYXN0IG9uZSBwb3N0YWwgZGF0YS4iKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotCi0gICAgICAgIGZpbmFsIFN0cmluZyBsYWJlbCA9IGN1cnJlbnRDb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFN0cnVjdHVyZWRQb3N0YWwuTEFCRUwpOwotICAgICAgICBhcHBlbmRQb3N0YWxMaW5lKGN1cnJlbnRUeXBlLCBsYWJlbCwgY3VycmVudENvbnRlbnRWYWx1ZXMsIGZhbHNlLCB0cnVlKTsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQgYXBwZW5kUG9zdGFsc0ZvckdlbmVyaWMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBmb3IgKGZpbmFsIENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgICAgICBpZiAoY29udGVudFZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIHR5cGVBc0ludGVnZXIgPSBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihTdHJ1Y3R1cmVkUG9zdGFsLlRZUEUpOwotICAgICAgICAgICAgZmluYWwgaW50IHR5cGUgPSAodHlwZUFzSW50ZWdlciAhPSBudWxsID8KLSAgICAgICAgICAgICAgICAgICAgdHlwZUFzSW50ZWdlciA6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RyaW5nIGVuY29kZWRQb0JveDsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkU3RyZWV0OwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRMb2NhbGl0eTsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkUmVnaW9uOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRQb3N0YWxDb2RlOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRDb3VudHJ5OwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWROZWlnaGJvcmhvb2Q7Ci0KLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyByYXdMb2NhbGl0eTI7Ci0gICAgICAgICAgICAvLyBUaGlzIGxvb2tzIGluZWZmaWNpZW50IHNpbmNlIHdlIGVuY29kZSByYXdMb2NhbGl0eSBhbmQgcmF3TmVpZ2hib3Job29kIHR3aWNlLAotICAgICAgICAgICAgLy8gYnV0IHRoaXMgaXMgaW50ZW50aW9uYWwuCi0gICAgICAgICAgICAvLwotICAgICAgICAgICAgLy8gUVAgZW5jb2RpbmcgbWF5IGFkZCBsaW5lIGZlZWRzIHdoZW4gbmVlZGVkIGFuZCB0aGUgcmVzdWx0IG9mCi0gICAgICAgICAgICAvLyAtIGVuY29kZVF1b3RlZFByaW50YWJsZShyYXdMb2NhbGl0eSArICIgIiArIHJhd05laWdoYm9yaG9vZCkKLSAgICAgICAgICAgIC8vIG1heSBiZSBkaWZmZXJlbnQgZnJvbQotICAgICAgICAgICAgLy8gLSBlbmNvZGVkTG9jYWxpdHkgKyAiICIgKyBlbmNvZGVkTmVpZ2hib3Job29kLgotICAgICAgICAgICAgLy8KLSAgICAgICAgICAgIC8vIFdlIHVzZSBzYWZlciB3YXkuCi0gICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkocmF3TG9jYWxpdHkpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHJhd05laWdoYm9yaG9vZCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmF3TG9jYWxpdHkyID0gIiI7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcmF3TG9jYWxpdHkyID0gcmF3TmVpZ2hib3Job29kOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHJhd05laWdoYm9yaG9vZCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmF3TG9jYWxpdHkyID0gcmF3TG9jYWxpdHk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcmF3TG9jYWxpdHkyID0gcmF3TG9jYWxpdHkgKyAiICIgKyByYXdOZWlnaGJvcmhvb2Q7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgIGVuY29kZWRQb0JveCA9IGVuY29kZVF1b3RlZFByaW50YWJsZShyYXdQb0JveCk7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZFN0cmVldCA9IGVuY29kZVF1b3RlZFByaW50YWJsZShyYXdTdHJlZXQpOwotICAgICAgICAgICAgICAgIGVuY29kZWRMb2NhbGl0eSA9IGVuY29kZVF1b3RlZFByaW50YWJsZShyYXdMb2NhbGl0eTIpOwotICAgICAgICAgICAgICAgIGVuY29kZWRSZWdpb24gPSBlbmNvZGVRdW90ZWRQcmludGFibGUocmF3UmVnaW9uKTsKLSAgICAgICAgICAgICAgICBlbmNvZGVkUG9zdGFsQ29kZSA9IGVuY29kZVF1b3RlZFByaW50YWJsZShyYXdQb3N0YWxDb2RlKTsKLSAgICAgICAgICAgICAgICBlbmNvZGVkQ291bnRyeSA9IGVuY29kZVF1b3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zdGFsIENvZGUKLSAgICAgICAgICAgIGFkZHJlc3NCdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7ICAvLyBQb3N0YWwgQ29kZSA6IENvdW50cnkKLSAgICAgICAgICAgIHJldHVybiBuZXcgUG9zdGFsU3RydWN0KAotICAgICAgICAgICAgICAgICAgICByZWFsbHlVc2VRdW90ZWRQcmludGFibGUsIGFwcGVuZENoYXJzZXQsIGFkZHJlc3NCdWlsZGVyLnRvU3RyaW5nKCkpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHVibGljIFZDYXJkQnVpbGRlciBhcHBlbmRJbXMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIGZpbmFsIEludGVnZXIgcHJvdG9jb2xBc09iamVjdCA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEltLlBST1RPQ09MKTsKLSAgICAgICAgICAgICAgICBpZiAocHJvdG9jb2xBc09iamVjdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcHJvcGVydHlOYW1lID0gVkNhcmRVdGlscy5nZXRQcm9wZXJ0eU5hbWVGb3JJbShwcm90b2NvbEFzT2JqZWN0KTsKLSAgICAgICAgICAgICAgICBpZiAocHJvcGVydHlOYW1lID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0cmluZyBkYXRhID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhJbS5EQVRBKTsKLSAgICAgICAgICAgICAgICBpZiAoZGF0YSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGEgPSBkYXRhLnRyaW0oKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGRhdGEpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgdHlwZUFzU3RyaW5nOwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgSW50ZWdlciB0eXBlQXNJbnRlZ2VyID0gY29udGVudFZhbHVlcy5nZXRBc0ludGVnZXIoSW0uVFlQRSk7Ci0gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodHlwZUFzSW50ZWdlciAhPSBudWxsID8gdHlwZUFzSW50ZWdlciA6IEltLlRZUEVfT1RIRVIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgSW0uVFlQRV9IT01FOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBJbS5UWVBFX1dPUks6IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSBWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUks7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEltLlRZUEVfQ1VTVE9NOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxhYmVsID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhJbS5MQUJFTCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gKGxhYmVsICE9IG51bGwgPyAiWC0iICsgbGFiZWwgOiBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgSW0uVFlQRV9PVEhFUjogIC8vIElnbm9yZQotICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVBc1N0cmluZyA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBmaW5hbCBMaXN0PFN0cmluZz4gcGFyYW1ldGVyTGlzdCA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodHlwZUFzU3RyaW5nKSkgewotICAgICAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZCh0eXBlQXNTdHJpbmcpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGlzUHJpbWFyeUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEltLklTX1BSSU1BUlkpOwotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5ID0gKGlzUHJpbWFyeUFzSW50ZWdlciAhPSBudWxsID8KLSAgICAgICAgICAgICAgICAgICAgICAgIChpc1ByaW1hcnlBc0ludG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nIHRpdGxlID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhPcmdhbml6YXRpb24uVElUTEUpOwotICAgICAgICAgICAgICAgIGlmICh0aXRsZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUudHJpbSgpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgb3JnQnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShjb21wYW55KSkgewotICAgICAgICAgICAgICAgICAgICBvcmdCdWlsZGVyLmFwcGVuZChjb21wYW55KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShkZXBhcnRtZW50KSkgewotICAgICAgICAgICAgICAgICAgICBpZiAob3JnQnVpbGRlci5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG9yZ0J1aWxkZXIuYXBwZW5kKCc7Jyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgb3JnQnVpbGRlci5hcHBlbmQoZGVwYXJ0bWVudCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBvcmdsaW5lID0gb3JnQnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgICAgIGFwcGVuZExpbmUoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfT1JHLCBvcmdsaW5lLAotICAgICAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5UHJpbnRhYmxlQXNjaWkob3JnbGluZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAobVNob3VsZFVzZVF1b3RlZFByaW50YWJsZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkob3JnbGluZSkpKTsKLQotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodGl0bGUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFwcGVuZExpbmUoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfVElUTEUsIHRpdGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seVByaW50YWJsZUFzY2lpKHRpdGxlKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAobVNob3VsZFVzZVF1b3RlZFByaW50YWJsZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKHRpdGxlKSkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gdGhpczsKLSAgICB9Ci0KLSAgICBwdWJsaWMgVkNhcmRCdWlsZGVyIGFwcGVuZFBob3RvcyhmaW5hbCBMaXN0PENvbnRlbnRWYWx1ZXM+IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnl0ZVtdIGRhdGEgPSBjb250ZW50VmFsdWVzLmdldEFzQnl0ZUFycmF5KFBob3RvLlBIT1RPKTsKLSAgICAgICAgICAgICAgICBpZiAoZGF0YSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcGhvdG9UeXBlID0gVkNhcmRVdGlscy5ndWVzc0ltYWdlVHlwZShkYXRhKTsKLSAgICAgICAgICAgICAgICBpZiAocGhvdG9UeXBlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIlVua25vd24gcGhvdG8gdHlwZS4gSWdub3JlZC4iKTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIFRPRE86IGNoZWNrIHRoaXMgd29ya3MgZmluZS4KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcGhvdG9TdHJpbmcgPSBuZXcgU3RyaW5nKEJhc2U2NC5lbmNvZGUoZGF0YSwgQmFzZTY0Lk5PX1dSQVApKTsKLSAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHBob3RvU3RyaW5nKSkgewotICAgICAgICAgICAgICAgICAgICBhcHBlbmRQaG90b0xpbmUocGhvdG9TdHJpbmcsIHBob3RvVHlwZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0aGlzOwotICAgIH0KLQotICAgIHB1YmxpYyBWQ2FyZEJ1aWxkZXIgYXBwZW5kTm90ZXMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgaWYgKG1Pbmx5T25lTm90ZUZpZWxkSXNBdmFpbGFibGUpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmdCdWlsZGVyIG5vdGVCdWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICBib29sZWFuIGZpcnN0ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBmb3IgKGZpbmFsIENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBub3RlID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhOb3RlLk5PVEUpOwotICAgICAgICAgICAgICAgICAgICBpZiAobm90ZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBub3RlID0gIiI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG5vdGUubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlyc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBub3RlQnVpbGRlci5hcHBlbmQoJ1xuJyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBub3RlQnVpbGRlci5hcHBlbmQobm90ZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIG5vdGVTdHIgPSBub3RlQnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgICAgIC8vIFRoaXMgbWVhbnMgd2Ugc2NhbiBub3RlU3RyIGNvbXBsZXRlbHkgdHdpY2UsIHdoaWNoIGlzIHJlZHVuZGFudC4KLSAgICAgICAgICAgICAgICAvLyBCdXQgZm9yIG5vdywgd2UgYXNzdW1lIHRoaXMgaXMgbm90IHNvIHRpbWUtY29uc3VtaW5nLi4KLSAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHNob3VsZEFwcGVuZENoYXJzZXRJbmZvID0KLSAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5UHJpbnRhYmxlQXNjaWkobm90ZVN0cik7Ci0gICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiByZWFsbHlVc2VRdW90ZWRQcmludGFibGUgPQotICAgICAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkobm90ZVN0cikpOwotICAgICAgICAgICAgICAgIGFwcGVuZExpbmUoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfTk9URSwgbm90ZVN0ciwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNob3VsZEFwcGVuZENoYXJzZXRJbmZvLCByZWFsbHlVc2VRdW90ZWRQcmludGFibGUpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBub3RlU3RyID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhOb3RlLk5PVEUpOwotICAgICAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KG5vdGVTdHIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHNob3VsZEFwcGVuZENoYXJzZXRJbmZvID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5UHJpbnRhYmxlQXNjaWkobm90ZVN0cik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtU2hvdWxkVXNlUXVvdGVkUHJpbnRhYmxlICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkobm90ZVN0cikpOwotICAgICAgICAgICAgICAgICAgICAgICAgYXBwZW5kTGluZShWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9OT1RFLCBub3RlU3RyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG91bGRBcHBlbmRDaGFyc2V0SW5mbywgcmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gdGhpczsKLSAgICB9Ci0KLSAgICBwdWJsaWMgVkNhcmRCdWlsZGVyIGFwcGVuZEV2ZW50cyhmaW5hbCBMaXN0PENvbnRlbnRWYWx1ZXM+IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgIC8vIFRoZXJlJ3MgcG9zc2liaWxpdHkgd2hlcmUgYSBnaXZlbiBvYmplY3QgbWF5IGhhdmUgbW9yZSB0aGFuIG9uZSBiaXJ0aGRheSwgd2hpY2gKLSAgICAgICAgLy8gaXMgaW5hcHByb3ByaWF0ZS4gV2UganVzdCBidWlsZCBvbmUgYmlydGhkYXkuCi0gICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBTdHJpbmcgcHJpbWFyeUJpcnRoZGF5ID0gbnVsbDsKLSAgICAgICAgICAgIFN0cmluZyBzZWNvbmRhcnlCaXJ0aGRheSA9IG51bGw7Ci0gICAgICAgICAgICBmb3IgKGZpbmFsIENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgSW50ZWdlciBldmVudFR5cGVBc0ludGVnZXIgPSBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihFdmVudC5UWVBFKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZXZlbnRUeXBlOwotICAgICAgICAgICAgICAgIGlmIChldmVudFR5cGVBc0ludGVnZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBldmVudFR5cGUgPSBldmVudFR5cGVBc0ludGVnZXI7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZXZlbnRUeXBlID0gRXZlbnQuVFlQRV9PVEhFUjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGV2ZW50VHlwZSA9PSBFdmVudC5UWVBFX0JJUlRIREFZKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBiaXJ0aGRheUNhbmRpZGF0ZSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoRXZlbnQuU1RBUlRfREFURSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChiaXJ0aGRheUNhbmRpZGF0ZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGlzU3VwZXJQcmltYXJ5QXNJbnRlZ2VyID0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEV2ZW50LklTX1NVUEVSX1BSSU1BUlkpOwotICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGlzU3VwZXJQcmltYXJ5ID0gKGlzU3VwZXJQcmltYXJ5QXNJbnRlZ2VyICE9IG51bGwgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpc1N1cGVyUHJpbWFyeUFzSW50ZWdlciA+IDApIDogZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICBpZiAoaXNTdXBlclByaW1hcnkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vICJzdXBlciBwcmltYXJ5IiBiaXJ0aGRheSBzaG91bGQgdGhlIHByZWZlcmVkIG9uZS4KLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW1hcnlCaXJ0aGRheSA9IGJpcnRoZGF5Q2FuZGlkYXRlOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZmluYWwgSW50ZWdlciBpc1ByaW1hcnlBc0ludGVnZXIgPQotICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlcy5nZXRBc0ludGVnZXIoRXZlbnQuSVNfUFJJTUFSWSk7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5ID0gKGlzUHJpbWFyeUFzSW50ZWdlciAhPSBudWxsID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaXNQcmltYXJ5QXNJbnRlZ2VyID4gMCkgOiBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpc1ByaW1hcnkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGRvbid0IGJyZWFrIGhlcmUgc2luY2UgInN1cGVyIHByaW1hcnkiIGJpcnRoZGF5IG1heSBleGlzdCBsYXRlci4KLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW1hcnlCaXJ0aGRheSA9IGJpcnRoZGF5Q2FuZGlkYXRlOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNlY29uZGFyeUJpcnRoZGF5ID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZpcnN0IGVudHJ5IGlzIHNldCB0byB0aGUgInNlY29uZGFyeSIgY2FuZGlkYXRlLgotICAgICAgICAgICAgICAgICAgICAgICAgc2Vjb25kYXJ5QmlydGhkYXkgPSBiaXJ0aGRheUNhbmRpZGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVVzZXNBbmRyb2lkUHJvcGVydHkpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gRXZlbnQgdHlwZXMgb3RoZXIgdGhhbiBCaXJ0aGRheSBpcyBub3Qgc3VwcG9ydGVkIGJ5IHZDYXJkLgotICAgICAgICAgICAgICAgICAgICBhcHBlbmRBbmRyb2lkU3BlY2lmaWNQcm9wZXJ0eShFdmVudC5DT05URU5UX0lURU1fVFlQRSwgY29udGVudFZhbHVlcyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHByaW1hcnlCaXJ0aGRheSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgYXBwZW5kTGluZVdpdGhDaGFyc2V0QW5kUVBEZXRlY3Rpb24oVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfQkRBWSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW1hcnlCaXJ0aGRheS50cmltKCkpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChzZWNvbmRhcnlCaXJ0aGRheSAhPSBudWxsKXsKLSAgICAgICAgICAgICAgICBhcHBlbmRMaW5lV2l0aENoYXJzZXRBbmRRUERldGVjdGlvbihWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9CREFZLAotICAgICAgICAgICAgICAgICAgICAgICAgc2Vjb25kYXJ5QmlydGhkYXkudHJpbSgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gdGhpczsKLSAgICB9Ci0KLSAgICBwdWJsaWMgVkNhcmRCdWlsZGVyIGFwcGVuZFJlbGF0aW9uKGZpbmFsIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgaWYgKG1Vc2VzQW5kcm9pZFByb3BlcnR5ICYmIGNvbnRlbnRWYWx1ZXNMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoZmluYWwgQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICBpZiAoY29udGVudFZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBhcHBlbmRBbmRyb2lkU3BlY2lmaWNQcm9wZXJ0eShSZWxhdGlvbi5DT05URU5UX0lURU1fVFlQRSwgY29udGVudFZhbHVlcyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHRoaXM7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogQHBhcmFtIGVtaXRFdmVyeVRpbWUgSWYgdHJ1ZSwgYnVpbGRlciBidWlsZHMgdGhlIGxpbmUgZXZlbiB3aGVuIHRoZXJlJ3Mgbm8gZW50cnkuCi0gICAgICovCi0gICAgcHVibGljIHZvaWQgYXBwZW5kUG9zdGFsTGluZShmaW5hbCBpbnQgdHlwZSwgZmluYWwgU3RyaW5nIGxhYmVsLAotICAgICAgICAgICAgZmluYWwgQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzLAotICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc1ByaW1hcnksIGZpbmFsIGJvb2xlYW4gZW1pdEV2ZXJ5VGltZSkgewotICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVz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5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QUkVGKTsKLSAgICAgICAgfQotICAgICAgICBzd2l0Y2ggKHR5cGUpIHsKLSAgICAgICAgICAgIGNhc2UgU3RydWN0dXJlZFBvc3RhbC5UWVBFX0hPTUU6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0hPTUUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfV09SSzogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfV09SSyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9DVVNUT006IHsKLSAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGxhYmVsKQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgVkNhcmRVdGlscy5jb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKGxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICAvLyBXZSdyZSBub3Qgc3VyZSB3aGV0aGVyIHRoZSBsYWJlbCBpcyB2YWxpZCBpbiB0aGUgc3BlYwotICAgICAgICAgICAgICAgICAgICAvLyAoIklBTkEtdG9rZW4iIGluIHRoZSB2Q2FyZCAzLjAgaXMgdW5jbGVhci4uLikKLSAgICAgICAgICAgICAgICAgICAgLy8gSnVzdCAgZm9yIHNhZmV0eSwgd2UgYWRkICJYLSIgYXQgdGhlIGJlZ2dpbmluZyBvZiBlYWNoIGxhYmVsLgotICAgICAgICAgICAgICAgICAgICAvLyBBbHNvIGNoZWNrcyB0aGUgbGFiZWwgb2JleXMgd2l0aCB2Q2FyZCAzLjAgc3BlYy4KLSAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoIlgtIiArIGxhYmVsKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9PVEhFUjogewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZGVmYXVsdDogewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJVbmtub3duIFN0cnVjdHVyZWRQb3N0YWwgdHlwZTogIiArIHR5cGUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX0FEUik7Ci0gICAgICAgIGlmICghcGFyYW1ldGVyTGlzdC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9QQVJBTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgYXBwZW5kVHlwZVBhcmFtZXRlcnMocGFyYW1ldGVyTGlzdCk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGFwcGVuZENoYXJzZXQpIHsKLSAgICAgICAgICAgIC8vIFN0cmljdGx5LCB2Q2FyZCAzLjAgZG9lcyBub3QgYWxsb3cgZXhwb3J0ZXJzIHRvIGVtaXQgY2hhcnNldCBpbmZvcm1hdGlvbiwKLSAgICAgICAgICAgIC8vIGJ1dCB3ZSB3aWxsIGFkZCBpdCBzaW5jZSB0aGUgaW5mb3JtYXRpb24gc2hvdWxkIGJlIHVzZWZ1bCBmb3IgaW1wb3J0ZXJzLAotICAgICAgICAgICAgLy8KLSAgICAgICAgICAgIC8vIEFzc3VtZSBubyBwYXJzZXIgZG9lcyBub3QgZW1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w7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmICghVGV4dFV0aWxzLmlzRW1wdHkobGFiZWwpCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiBWQ2FyZFV0aWxzLmNvbnRhaW5zT25seUFscGhhRGlnaXRIeXBoZW4obGFiZWwpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHR5cGVBc1N0cmluZyA9ICJYLSIgKyBsYWJlbDsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSBudWxsOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgRW1haWwuVFlQRV9IT01FOiB7Ci0gICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBFbWFpbC5UWVBFX1dPUks6IHsKLSAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSBWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUks7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIEVtYWlsLlRZUEVfT1RIRVI6IHsKLSAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSBudWxsOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBFbWFpbC5UWVBFX01PQklMRTogewotICAgICAgICAgICAgICAgIHR5cGVBc1N0cmluZyA9IFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfQ0VMTDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGRlZmF1bHQ6IHsKLSAgICAgIC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gICAgICAgIGlmICh0eXBlQXNJbnRlZ2VyID09IG51bGwpIHsKLSAgICAgICAgICAgIHR5cGUgPSBQaG9uZS5UWVBFX09USEVSOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgdHlwZSA9IHR5cGVBc0ludGVnZXI7Ci0gICAgICAgIH0KLQotICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBwYXJhbWV0ZXJMaXN0ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7Ci0gICAgICAgIHN3aXRjaCAodHlwZSkgewotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX0hPTUU6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZEFsbCgKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfV09SSzogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkQWxsKAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUkspKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9GQVhfSE9NRTogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkQWxsKAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0hPTUUsIFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfRkFYKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfRkFYX1dPUks6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZEFsbCgKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLLCBWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0ZBWCkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX01PQklMRTogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfQ0VMTCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfUEFHRVI6IHsKLSAgICAgICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIE5vdCBzdXJlIGFib3V0IHRoZSByZWFzb24sIGJ1dCBwcmV2aW91cyBpbXBsZW1lbnRhdGlvbiBoYWQKLSAgICAgICAgICAgICAgICAgICAgLy8gdXNlZCAiVk9JQ0UiIGluc3RlYWQgb2YgIlBBR0VSIgotICAgICAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1ZPSUNFKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1BBR0VSKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfT1RIRVI6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1ZPSUNFKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9DQVI6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0NBUik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfQ09NUEFOWV9NQUlOOiB7Ci0gICAgICAgICAgICAgICAgLy8gVGhlcmUncyBubyByZWxldmFudCBmaWVsZCBpbiB2Q2FyZCAoYXQgbGVhc3QgMi4xKS4KLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUkspOwotICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfSVNETjogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfSVNETik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfTUFJTjogewotICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfT1RIRVJfRkFYOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9GQVgpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX1RFTEVYOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9UTFgpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX1dPUktfTU9CSUxFOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGRBbGwoCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfV09SSywgVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9DRUxMKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfV09SS19QQUdFUjogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfV09SSyk7Ci0gICAgICAgICAgICAgICAgLy8gU2VlIGFib3ZlLgotICAgICAgICAgICAgICAgIGlmIChtSXNEb0NvTW8pIHsKLSAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9WT0lDRSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QQUdFUik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX01NUzogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfTVNHKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9DVVNUT006IHsKLSAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkobGFiZWwpKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIEp1c3QgaWdub3JlIHRoZSBjdXN0b20gdHlwZS4KLSAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9WT0lDRSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChWQ2FyZFV0aWxzLmlzTW9iaWxlUGhvbmVMYWJlbChsYWJlbCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9DRUxMKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1Jc1YzME9yVjQwKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgbGFiZWwgaXMgYXBwcm9wcmlhdGVseSBlbmNvZGVkIGluIGFwcGVuZFR5cGVQYXJhbWV0ZXJzLgotICAgICAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChsYWJlbCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHVwcGVyTGFiZWwgPSBsYWJlbC50b1VwcGVyQ2FzZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAoVkNhcmRVdGlscy5pc1ZhbGlkSW5WMjFCdXRVbmtub3duVG9Db250YWN0c1Bob3RlVHlwZSh1cHBlckxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQodXBwZXJMYWJlbCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVkNhcmRVdGlscy5jb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKGxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm90ZTogU3RyaWN0bHksIHZDYXJkIDIuMSBkb2VzIG5vdCBhbGxvdyAiWC0iIHBhcmFtZXRlciB3aXRob3V0Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAiVFlQRT0iIHN0cmluZy4KLSAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKCJYLSIgKyBsYWJlbCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfUkFESU86Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfVFRZX1RERDoKLSAgICAgICAgICAgIGRlZmF1bHQ6IHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChpc1ByaW1hcnkpIHsKLSAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfUFJFRik7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocGFyYW1ldGVyTGlzdC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgIGFwcGVuZFVuY29tbW9uUGhvbmVUeXBlKG1CdWlsZGVyLCB0eXBlKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGFwcGVuZFR5cGVQYXJhbWV0ZXJzKHBhcmFtZXRlckxpc3QpOwotICAgICAgICB9Ci0KLSAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0RBVEFfU0VQQVJBVE9SKTsKLSAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVuY29k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mljUHJvcGVydHkoCi0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgbWltZVR5cGUsIENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcykgewotICAgICAgICBpZiAoIXNBbGxvd2VkQW5kcm9pZFByb3BlcnR5U2V0LmNvbnRhaW5zKG1pbWVUeXBlKSkgewotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIGZpbmFsIExpc3Q8U3RyaW5nPiByYXdWYWx1ZUxpc3QgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKLSAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gVkNhcmRDb25zdGFudHMuTUFYX0RBVEFfQ09MVU1OOyBpKyspIHsKLSAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoImRhdGEiICsgaSk7Ci0gICAgICAgICAgICBpZiAodmFsdWUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHZhbHVlID0gIiI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByYXdWYWx1ZUxpc3QuYWRkKHZhbHVlKTsKLSAgICAgICAgfQotCi0gICAgICAgIGJvb2xlYW4gbmVlZENoYXJzZXQgPQotICAgICAgICAgICAgKG1TaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0gJiYKLSAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKHJhd1ZhbHVlTGlzdCkpOwotICAgICAgICBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSA9Ci0gICAgICAgICAgICAobVNob3VsZFVzZVF1b3RlZFByaW50YWJsZSAmJgotICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkocmF3VmFsdWVMaXN0KSk7Ci0gICAgICAgIG1CdWlsZ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IHsKLSAgICAgICAgICAgICAgICBjYXNlICc7JzogewotICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZCgnXFwnKTsKLSAgICAgICAgICAgICAgICAgICAgdG1wQnVpbGRlci5hcHBlbmQoJzsnKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgJ1xyJzogewotICAgICAgICAgICAgICAgICAgICBpZiAoaSArIDEgPCBsZW5ndGgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgbmV4dENoYXIgPSB1bmVzY2FwZWQuY2hhckF0KGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRDaGFyID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYXNlICdcbic6IHsKLSAgICAgICAgICAgICAgICAgICAgLy8gSW4gdkNhcmQgMi4xLCB0aGVyZSdzIG5vIHNwZWNpZmljYXRpb24gYWJvdXQgdGhpcywgd2hpbGUKLSAgICAgICAgICAgICAgICAgICAgLy8gdkNhcmQgMy4wIGV4cGxpY2l0bHkgcmVxdWlyZXMgdGhpcyBzaG91bGQgYmUgZW5jb2RlZCB0byAiXG4iLgotICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZCgiXFxuIik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYXNlICdcXCc6IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1Jc1YzME9yVjQwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZCgiXFxcXCIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYXNlICc8JzoKLSAgICAgICAgICAgICAgICBjYXNlICc+JzogewotICAgICAgICAgICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZCgnXFwnKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcEJ1aWxkZXIuYXBwZW5kKGNoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcEJ1aWxkZXIuYXBwZW5kKGNoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY2FzZSAnLCc6IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1Jc1YzME9yVjQwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZCgiXFwsIik7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHsKLSAgICAgICAgICAgICAgICAgICAgdG1wQnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHRtcEJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICB9Ci0KLSAgICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewotICAgICAgICBpZiAoIW1FbmRBcHBlbmRlZCkgewotICAgICAgICAgICAgaWYgKG1Jc0RvQ29NbykgewotICAgICAgICAgICAgICAgIGFwcGVuZExpbmUoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfWF9DTEFTUywgVkNBUkRfREFUQV9QVUJMSUMpOwotICAgICAgICAgICAgICAgIGFwcGVuZExpbmUoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfWF9SRURVQ1RJT04sICIiKTsKLSAgICAgICAgICAgICAgICBhcHBlbmRMaW5lKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX1hfTk8sICIiKTsKLSAgICAgICAgICAgICAgICBhcHBlbmRMaW5lKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX1hfRENNX0hNTl9NT0RFLCAiIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBhcHBlbmRMaW5lKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX0VORCwgVkNBUkRfREFUQV9WQ0FSRCk7Ci0gICAgICAgICAgICBtRW5kQXBwZW5kZWQgPSB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBtQnVpbGRlci50b1N0cmluZygpOwotICAgIH0KLX0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3BpbS92Y2FyZC9WQ2FyZENvbXBvc2VyLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9waW0vdmNhcmQvVkNhcmRDb21wb3Nlci5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AgICAgICBtT3V0cHV0U3RyZWFtLCBtQ2hhcnNldCkpOwotICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlMSkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJVbnN1cHBvcnRlZCBjaGFyc2V0OiAiICsgbUNoYXJzZXQpOwotICAgICAgICAgICAgICAgIG1FcnJvclJlYXNvbiA9ICJFbmNvZGluZyBpcyBub3Qgc3VwcG9ydGVkICh1c3VhbGx5IHRoaXMgZG9lcyBub3QgaGFwcGVuISk6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgbUNoYXJzZXQ7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIG9uZSBlbXB0eSBlbnRyeS4KLSAgICAgICAgICAgICAgICAgICAgbVdyaXRlci53cml0ZShjcmVhdGVPbmVFbnRyeUludGVybmFsKCItMSIsIG51bGwpKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChWQ2FyZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJWQ2FyZEV4Y2VwdGlvbiBoYXMgYmVlbiB0aHJvd24gZHVyaW5nIG9uIEluaXQoKTogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJJT0V4Y2VwdGlvbiBvY2N1cnJlZCBkdXJpbmcgZXhwb3J0T25lQ29udGFjdERhdGE6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgICAgICAgICBtRXJyb3JSZWFzb24gPSAiSU9FeGNlcHRpb24gb2NjdXJyZWQ6ICIgKyBlLmdldE1lc3NhZ2UoKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGJvb2xlYW4gb25FbnRyeUNyZWF0ZWQoU3RyaW5nIHZjYXJkKSB7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIG1Xcml0ZXIud3JpdGUodmNhcmQpOwotICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAiSU9FeGNlcHRpb24gb2NjdXJyZWQgZHVyaW5nIGV4cG9ydE9uZUNvbnRhY3REYXRhOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgICAgIG1FcnJvclJlYXNvbiA9ICJJT0V4Y2VwdGlvbiBvY2N1cnJlZDogIiArIGUuZ2V0TWVzc2FnZSgpOwotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgb25UZXJtaW5hdGUoKSB7Ci0gICAgICAgICAgICBtT25UZXJtaW5hdGVJc0NhbGxlZCA9IHRydWU7Ci0gICAgICAgICAgICBpZiAobVdyaXRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgLy8gRmx1c2ggYW5kIHN5bmMgdGhlIGRhdGEgc28gdGhhdCBhIHVzZXIgaXMgYWJsZSB0byBwdWxsCi0gICAgICAgICAgICAgICAgICAgIC8vIHRoZSBTRENhcmQganVzdCBhZnRlcgotICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZXhwb3J0LgotICAgICAgICAgICAgICAgICAgICBtV3JpdGVyLmZsdXNoKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtT3V0cHV0U3RyZWFtICE9IG51bGwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBtT3V0cHV0U3RyZWFtIGluc3RhbmNlb2YgRmlsZU91dHB1dFN0cmVhbSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoRmlsZU91dHB1dFN0cmVhbSkgbU91dHB1dFN0cmVhbSkuZ2V0RkQoKS5zeW5jKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIklPRXhjZXB0aW9uIGR1cmluZyBjbG9zaW5nIHRoZSBvdXRwdXQgc3RyZWFtOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgICAgICBjbG9zZU91dHB1dFN0cmVhbSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIGNsb3NlT3V0cHV0U3RyZWFtKCkgewotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBtV3JpdGVyLmNsb3NlKCk7Ci0gICAgICAgICAgICB9IGNhdGNoIChJT0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ICAgICAgIG1IYW5kbGVyTGlzdCA9IG5ldyBBcnJheUxpc3Q8T25lRW50cnlIYW5kbGVyPigpOwotCi0gICAgICAgIGNoYXJzZXQgPSAoVGV4dFV0aWxzLmlzRW1wdHkoY2hhcnNldCkgPyBWQ2FyZENvbmZpZy5ERUZBVUxUX0VYUE9SVF9DSEFSU0VUIDogY2hhcnNldCk7Ci0gICAgICAgIGZpbmFsIGJvb2xlYW4gc2hvdWxkQXBwZW5kQ2hhcnNldFBhcmFtID0gISgKLSAgICAgICAgICAgICAgICBWQ2FyZENvbmZpZy5pc1ZlcnNpb24zMCh2Y2FyZFR5cGUpICYmIFVURl84LmVxdWFsc0lnbm9yZUNhc2UoY2hhcnNldCkpOwotCi0gICAgICAgIGlmIChtSXNEb0NvTW8gfHwgc2hvdWxkQXBwZW5kQ2hhcnNldFBhcmFtKSB7Ci0gICAgICAgICAgICBpZiAoU0hJRlRfSklTLmVxdWFsc0lnbm9yZUNhc2UoY2hhcnNldCkpIHsKLSAgICAgICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaGFyc2V0ID0gQ2hhcnNldFV0aWxzLmNoYXJzZXRGb3JWZW5kb3IoU0hJRlRfSklTLCAiZG9jb21vIikubmFtZSgpOwotICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChVbnN1cHBvcnRlZENoYXJzZXRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkRvQ29Nby1zcGVjaWZpYyBTSElGVF9KSVMgd2FzIG5vdCBmb3VuZC4gIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJVc2UgU0hJRlRfSklTIGFzIGlzLiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnNldCA9IFNISUZUX0pJUzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaGFyc2V0ID0gQ2hhcnNldFV0aWxzLmNoYXJzZXRGb3JWZW5kb3IoU0hJRlRfSklTKS5uYW1lKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkQ2hhcnNldEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ2FyZWVyLXNwZWNpZmljIFNISUZUX0pJUyB3YXMgbm90IGZvdW5kLiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIlVzZSBTSElGVF9KSVMgYXMgaXMuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaGFyc2V0ID0gU0hJRlRfSklTOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1DaGFyc2V0ID0gY2hhcnNldDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICJUaGUgY2hhcnNldCBcIiIgKyBjaGFyc2V0ICsgIlwiIGlzIHVzZWQgd2hpbGUgIgotICAgICAgICAgICAgICAgICAgICAgICAgKyBTSElGVF9KSVMgKyAiIGlzIG5lZWRlZCB0byBiZSB1c2VkLiIpOwotICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShjaGFyc2V0KSkgewotICAgICAgICAgICAgICAgICAgICBtQ2hhcnNldCA9IFNISUZUX0pJUzsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnNldCA9IENoYXJzZXRVdGlscy5jaGFyc2V0Rm9yVmVuZG9yKGNoYXJzZXQpLm5hbWUoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRDaGFyc2V0RXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDYXJlZXItc3BlY2lmaWMgXCIiICsgY2hhcnNldCArICJcIiB3YXMgbm90IGZvdW5kIChhcyB1c3VhbCkuICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiVXNlIGl0IGFzIGlzLiIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1DaGFyc2V0ID0gY2hhcnNldDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoY2hhcnNldCkpIHsKLSAgICAgICAgICAgICAgICBtQ2hhcnNldCA9IFVURl84OwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBjaGFyc2V0ID0gQ2hhcnNldFV0aWxzLmNoYXJzZXRGb3JWZW5kb3IoY2hhcnNldCkubmFtZSgpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkQ2hhcnNldEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNhcmVlci1zcGVjaWZpYyBcIiIgKyBjaGFyc2V0ICsgIlwiIHdhcyBub3QgZm91bmQgKGFzIHVzdWFsKS4gIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIlVzZSBpdCBhcyBpcy4iKTsKLS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B0aGUgZnV0dXJlLgotICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGluaXQoZmluYWwgVXJpIGNvbnRlbnRVcmksIGZpbmFsIFN0cmluZyBzZWxlY3Rpb24sCi0gICAgICAgICAgICBmaW5hbCBTdHJpbmdbXSBzZWxlY3Rpb25BcmdzLCBmaW5hbCBTdHJpbmcgc29ydE9yZGVyKSB7Ci0gICAgICAgIGlmIChjb250ZW50VXJpID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtQ2FyZUhhbmRsZXJFcnJvcnMpIHsKLSAgICAgICAgICAgIGZpbmFsIExpc3Q8T25lRW50cnlIYW5kbGVyPiBmaW5pc2hlZExpc3QgPSBuZXcgQXJyYXlMaXN0PE9uZUVudHJ5SGFuZGxlcj4oCi0gICAgICAgICAgICAgICAgICAgIG1IYW5kbGVyTGlzdC5zaXplKCkpOwotICAgICAgICAgICAgZm9yIChPbmVFbnRyeUhhbmRsZXIgaGFuZGxlciA6IG1IYW5kbGVyTGlzdCkgewotICAgICAgICAgICAgICAgIGlmICghaGFuZGxlci5vbkluaXQobUNvbnRleHQpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoT25lRW50cnlIYW5kbGVyIGZpbmlzaGVkIDogZmluaXNoZWRMaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5pc2hlZC5vblRlcm1pbmF0ZSgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAvLyBKdXN0IGlnbm9yZSB0aGUgZmFsc2UgcmV0dXJuZWQgZnJvbSBvbkluaXQoKS4KLSAgICAgICAgICAgIGZvciAoT25lRW50cnlIYW5kbGVyIGhhbmRsZXIgOiBtSGFuZGxlckxpc3QpIHsKLSAgICAgICAgICAgICAgICBoYW5kbGVyLm9uSW5pdChtQ29udGV4dCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBmaW5hbCBTdHJpbmdbXSBwcm9qZWN0aW9uOwotICAgICAgICBpZiAoQ29udGFjdHMuQ09OVEVOVF9VUkkuZXF1YWxzKGNvbnRlbnRVcmkpIHx8Ci0gICAgICAgICAgICAgICAgQ09OVEFDVFNfVEVTVF9DT05URU5UX1VSSS5lcXVhbHMoY29udGVudFVyaSkpIHsKLSAgICAgICAgICAgIHByb2plY3Rpb24gPSBzQ29udGFjdHNQcm9qZWN0aW9uOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbUVycm9yUmVhc29uID0gRkFJTFVSRV9SRUFTT05fVU5TVVBQT1JURURfVVJJOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgICAgIG1DdXJzb3IgPSBtQ29udGVudFJlc29sdmVyLnF1ZXJ5KAotICAgICAgICAgICAgICAgIGNvbnRlbnRVcmksIHByb2plY3Rpb24sIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncywgc29ydE9yZGVyKTsKLQotICAgICAgICBpZiAobUN1cnNvciA9PSBudWxsKSB7Ci0gICAgICAgICAgICBtRXJyb3JSZWFzb24gPSBGQUlMVVJFX1JFQVNPTl9GQUlMRURfVE9fR0VUX0RBVEFCQVNFX0lORk87Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoZ2V0Q291bnQoKSA9PSAwIHx8ICFtQ3Vyc29yLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgbUN1cnNvci5jbG9zZSgpOwotICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiU1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YnJhbmNoIGlzIGV4ZWN1dGVkIGJ5IHVuaXQgdGVzdHMgb25seQotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGVudGl0eUl0ZXJhdG9yID0gKEVudGl0eUl0ZXJhdG9yKWdldEVudGl0eUl0ZXJhdG9yTWV0aG9kLmludm9rZShudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZW50UmVzb2x2ZXIsIHVyaSwgc2VsZWN0aW9uLCBzZWxlY3Rpb25BcmdzLCBudWxsKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIGhhcyBiZWVuIHRocm93bjogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiSWxsZWdhbEFjY2Vzc0V4Y2VwdGlvbiBoYXMgYmVlbiB0aHJvd246ICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkludm9jYXRpb25UYXJnZXRFeGNlcHRpb24gaGFzIGJlZW4gdGhyb3duOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgU3RhY2tUcmFjZUVsZW1lbnRbXSBzdGFja1RyYWNlRWxlbWVudHMgPSBlLmdldENhdXNlKCkuZ2V0U3RhY2tUcmFjZSgpOwotICAgICAgICAgICAgICAgICAgICBmb3IgKFN0YWNrVHJhY2VFbGVtZW50IGVsZW1lbnQgOiBzdGFja1RyYWNlRWxlbWVudHMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICIgICAgYXQgIiArIGVsZW1lbnQudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKCJJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGhhcyBiZWVuIHRocm93bjogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5nZXRDYXVzZSgpLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBlbnRpdHlJdGVyYXRvciA9IFJhd0NvbnRhY3RzLm5ld0VudGl0eUl0ZXJhdG9yKG1Db250ZW50UmVzb2x2ZXIucXVlcnkoCi0gICAgICAgICAgICAgICAgICAgICAgICB1cmksIG51bGwsIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncywgbnVsbCkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZW50aXR5SXRlcmF0b3IgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJFbnRpdHlJdGVyYXRvciBpcyBudWxsIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuICIiOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIWVudGl0eUl0ZXJhdG9yLmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJEYXRhIGRvZXMgbm90IGV4aXN0LiBjb250YWN0SWQ6ICIgKyBjb250YWN0SWQpOwotICAgICAgICAgICAgICAgIHJldHVybiAiIjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgd2hpbGUgKGVudGl0eUl0ZXJhdG9yLmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgIEVudGl0eSBlbnRpdHkgPSBlbnRpdHlJdGVyYXRvci5uZXh0KCk7Ci0gICAgICAgICAgICAgICAgZm9yIChOYW1lZENvbnRlbnRWYWx1ZXMgbmFtZWRDb250ZW50VmFsdWVzIDogZW50aXR5LmdldFN1YlZhbHVlcygpKSB7Ci0gICAgICAgICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA9IG5hbWVkQ29udGVudFZhbHVlcy52YWx1ZXM7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBrZXkgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKERhdGEuTUlNRVRZUEUpOwotICAgICAgICAgICAgICAgICAgICBpZiAoa2V5ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzTGlzdE1hcC5nZXQoa2V5KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0xpc3QgPSBuZXcgQXJyYXlMaXN0PENvbnRlbnRWYWx1ZXM+KCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0xpc3RNYXAucHV0KGtleSwgY29udGVudFZhbHVlc0xpc3QpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0xpc3QuYWRkKGNvbnRlbnRWYWx1ZXMpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgaWYgKGVudGl0eUl0ZXJ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mFsdWVzTGlzdE1hcC5nZXQoRXZlbnQuQ09OVEVOVF9JVEVNX1RZUEUpKQotICAgICAgICAgICAgICAgICAgICAuYXBwZW5kSW1zKGNvbnRlbnRWYWx1ZXNMaXN0TWFwLmdldChJbS5DT05URU5UX0lURU1fVFlQRSkpCi0gICAgICAgICAgICAgICAgICAgIC5hcHBlbmRSZWxhdGlvbihjb250ZW50VmFsdWVzTGlzdE1hcC5nZXQoUmVsYXRpb24uQ09OVEVOVF9JVEVNX1RZUEUpKTsKLSAgICAgICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCB0ZXJtaW5hdGUoKSB7Ci0gICAgICAgIGZvciAoT25lRW50cnlIYW5kbGVyIGhhbmRsZXIgOiBtSGFuZGxlckxpc3QpIHsKLSAgICAgICAgICAgIGhhbmRsZXIub25UZXJtaW5hdGUoKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtQ3Vyc29yICE9IG51bGwpIHsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgbUN1cnNvci5jbG9zZSgpOwotICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiU1FMaXRlRXhjZXB0aW9uIG9uIEN1cnNvciNjbG9zZSgpOiAiICsgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUN1cnNvciA9IG51bGw7Ci0gICAgICAgIH0KLQotICAgICAgICBtVGVybWluYXRlSXNDYWxsZWQgPSB0cnVlOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIGZpbmFsaXplKCkgewotICAgICAgICBpZiAoIW1UZXJtaW5hdGVJc0NhbGxlZCkgewotICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgInRlcm1pbmF0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JsaWMgUGhvbmVEYXRhKGludCB0eXBlLCBTdHJpbmcgZGF0YSwgU3RyaW5nIGxhYmVsLCBib29sZWFuIGlzUHJpbWFyeSkgewotICAgICAgICAgICAgdGhpcy50eXBlID0gdHlwZTsKLSAgICAgICAgICAgIHRoaXMuZGF0YSA9IGRhdGE7Ci0gICAgICAgICAgICB0aGlzLmxhYmVsID0gbGFiZWw7Ci0gICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgewotICAgICAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgUGhvbmVEYXRhKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFBob25lRGF0YSBwaG9uZURhdGEgPSAoUGhvbmVEYXRhKW9iajsKLSAgICAgICAgICAgIHJldHVybiAodHlwZSA9PSBwaG9uZURhdGEudHlwZSAmJiBkYXRhLmVxdWFscyhwaG9uZURhdGEuZGF0YSkgJiYKLSAgICAgICAgICAgICAgICAgICAgbGFiZWwuZXF1YWxzKHBob25lRGF0YS5sYWJlbCkgJiYgaXNQcmltYXJ5ID09IHBob25lRGF0YS5pc1ByaW1hcnkpOwotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7Ci0gICAgICAgICAgICByZXR1cm4gU3RyaW5nLmZvcm1hdCgidHlwZTogJWQsIGRhdGE6ICVzLCBsYWJlbDogJXMsIGlzUHJpbWFyeTogJXMiLAotICAgICAgICAgICAgICAgICAgICB0eXBlLCBkYXRhLCBsYWJlbCwgaXNQcmltYXJ5KTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgRW1haWxEY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J5OwotCi0gICAgICAgIHB1YmxpYyBQb3N0YWxEYXRhKGZpbmFsIGludCB0eXBlLCBmaW5hbCBMaXN0PFN0cmluZz4gcHJvcFZhbHVlTGlzdCwKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGFiZWwsIGJvb2xlYW4gaXNQcmltYXJ5KSB7Ci0gICAgICAgICAgICB0aGlzLnR5cGUgPSB0eXBlOwotICAgICAgICAgICAgZGF0YUFycmF5ID0gbmV3IFN0cmluZ1tBRERSX01BWF9EQVRBX1NJWkVdOwotCi0gICAgICAgICAgICBpbnQgc2l6ZSA9IHByb3BWYWx1ZUxpc3Quc2l6ZSgpOwotICAgICAgICAgICAgaWYgKHNpemUgPiBBRERSX01BWF9EQVRBX1NJWkUpIHsKLSAgICAgICAgICAgICAgICBzaXplID0gQUREUl9NQVhfREFUQV9TSVpFOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBhZHItdmFsdWUgPSAwKjYodGV4dC12YWx1ZSAiOyIpIHRleHQtdmFsdWUKLSAgICAgICAgICAgIC8vICAgICAgICAgICA7IFBPIEJveCwgRXh0ZW5kZWQgQWRkcmVzcywgU3RyZWV0LCBMb2NhbGl0eSwgUmVnaW9uLCBQb3N0YWwKLSAgICAgICAgICAgIC8vICAgICAgICAgICA7IENvZGUsIENvdW50cnkgTmFtZQotICAgICAgICAgICAgLy8KLSAgICAgICAgICAgIC8vIFVzZSBJdGVyYXRvciBhc3N1bWluZyBMaXN0IG1heSBiZSBMaW5rZWRMaXN0LCB0aG91Z2ggYWN0dWFsbHkgaXQgaXMKLSAgICAgICAgICAgIC8vIGFsd2F5cyBBcnJheUxpc3QgaW4gdGhlIGN1cnJlbnQgaW1wbGVtZW50YXRpb24uCi0gICAgICAgICAgICBpbnQgaSA9IDA7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyBhZGRyZXNzRWxlbWVudCA6IHByb3BWYWx1ZUxpc3QpIHsKLSAgICAgICAgICAgICAgICBkYXRhQXJyYXlbaV0gPSBhZGRyZXNzRWxlbWVudDsKLSAgICAgICAgICAgICAgICBpZiAoKytpID49IHNpemUpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgd2hpbGUgKGkgPCBBRERSX01BWF9EQVRBX1NJWkUpIHsKLSAgICAgICAgICAgICAgICBkYXRhQXJyYXlbaSsrXSA9IG51bGw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHRoaXMucG9ib3ggPSBkYXRhQXJyYXlbMF07Ci0gICAgICAgICAgICB0aGlzLmV4dGVuZGVkQWRkcmVzcyA9IGRhdGFBcnJheVsxXTsKLSAgICAgICAgICAgIHRoaXMuc3RyZWV0ID0gZGF0YUFycmF5WzJdOwotICAgICAgICAgICAgdGhpcy5sb2NhbHR5ID0gZGF0YUFycmF5WzNdOwotICAgICAgICAgICAgdGhpcy5yZWdpb24gPSBkYXRhQXJyYXlbNF07Ci0gICAgICAgICAgICB0aGlzLnBvc3RhbENvZGUgPSBkYXRhQXJyYXlbNV07Ci0gICAgICAgICAgICB0aGlzLmNvdW50cnkgPSBkYXRhQXJyYXlbNl07Ci0gICAgICAgICAgICB0aGlzLmxhYmVsID0gbGFiZWw7Ci0gICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgewotICAgICAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgUG9zdGFsRGF0YSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmaW5hbCBQb3N0YWxEYXRhIHBvc3RhbERhdGEgPSAoUG9zdGFsRGF0YSlvYmo7Ci0gICAgICAgICAgICByZXR1cm4gKEFycmF5cy5lcXVhbHMoZGF0YUFycmF5LCBwb3N0YWxEYXRhLmRhdGFBcnJheSkgJiYKLSAgICAgICAgICAgICAgICAgICAgKHR5cGUgPT0gcG9zdGFsRGF0YS50eXBlICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHR5cGUgPT0gU3RydWN0dXJlZFBvc3RhbC5UWVBFX0NVU1RPTSA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGFiZWwgPT0gcG9zdGFsRGF0YS5sYWJlbCkgOiB0cnVlKSkgJiYKLSAgICAgICAgICAgICAgICAgICAgKGlzUHJpbWFyeSA9PSBwb3N0YWxEYXRhLmlzUHJpbWFyeSkpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIFN0cmluZyBnZXRGb3JtYXR0ZWRBZGRyZXNzKGZpbmFsIGludCB2Y2FyZFR5cGUpIHsKLSAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICBib29sZWFuIGVtcHR5ID0gdHJ1ZTsKLSAgICAgICAgICAgIGlmIChWQ2FyZENvbmZpZy5pc0phcGFuZXNlRGV2aWNlKHZjYXJkVHlwZSkpIHsKLSAgICAgICAgICAgICAgICAvLyBJbiBKYXBhbiwgdGhlIG9yZGVyIGlzIHJldmVyc2VkLgotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSBBRERSX01BWF9EQVRBX1NJWkUgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYWRkcmVzc1BhcnQgPSBkYXRhQXJyYXlbaV07Ci0gICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoYWRkcmVzc1BhcnQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyAnKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW1wdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGFkZHJlc3NQYXJ0KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBBRERSX01BWF9EQVRBX1NJWkU7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYWRkcmVzc1BhcnQgPSBkYXRhQXJyYXlbaV07Ci0gICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoYWRkcmVzc1BhcnQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyAnKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW1wdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGFkZHJlc3NQYXJ0KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKS50cmltKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKLSAgICAgICAgICAgIHJldHVybiBTdHJpbmcuZm9ybWF0KCJ0eXBlOiAlZC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AgICAgICAgICAgICBmaW5hbCBib29sZWFuIGlzUHJpbWFyeSkgewotICAgICAgICAgICAgdGhpcy50eXBlID0gdHlwZTsKLSAgICAgICAgICAgIHRoaXMuY29tcGFueU5hbWUgPSBjb21wYW55TmFtZTsKLSAgICAgICAgICAgIHRoaXMuZGVwYXJ0bWVudE5hbWUgPSBkZXBhcnRtZW50TmFtZTsKLSAgICAgICAgICAgIHRoaXMudGl0bGVOYW1lID0gdGl0bGVOYW1lOwotICAgICAgICAgICAgdGhpcy5waG9uZXRpY05hbWUgPSBwaG9uZXRpY05hbWU7Ci0gICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgewotICAgICAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgT3JnYW5pemF0aW9uRGF0YSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBPcmdhbml6YXRpb25EYXRhIG9yZ2FuaXphdGlvbiA9IChPcmdhbml6YXRpb25EYXRhKW9iajsKLSAgICAgICAgICAgIHJldHVybiAodHlwZSA9PSBvcmdhbml6YXRpb24udHlwZSAmJgotICAgICAgICAgICAgICAgICAgICBUZXh0VXRpbHMuZXF1YWxzKGNvbXBhbnlOYW1lLCBvcmdhbml6YXRpb24uY29tcGFueU5hbWUpICYmCi0gICAgICAgICAgICAgICAgICAgIFRleHRVdGlscy5lcXVhbHMoZGVwYXJ0bWVudE5hbWUsIG9yZ2FuaXphdGlvbi5kZXBhcnRtZW50TmFtZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgVGV4dFV0aWxzLmVxdWFscyh0aXRsZU5hbWUsIG9yZ2FuaXphdGlvbi50aXRsZU5hbWUpICYmCi0gICAgICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9PSBvcmdhbml6YXRpb24uaXNQcmltYXJ5KTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0Rm9ybWF0dGVkU3RyaW5nKCkgewotICAgICAgICAgICAgZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoY29tcGFueU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY29tcGFueU5hbWUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGRlcGFydG1lbnROYW1lKSkgewotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZGVwYXJ0bWVudE5hbWUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHRpdGxlTmFtZSkpIHsKLSAgICAgICAgICAgICAgICBpZiAoYnVpbGRlci5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiwgIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKHRpdGxlTmFtZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKLSAgICAgICAgICAgIHJldHVybiBTdHJpbmcuZm9ybWF0KAotICAgICAgICAgICAgIC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pZiAoIShvYmogaW5zdGFuY2VvZiBJbURhdGEpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgSW1EYXRhIGltRGF0YSA9IChJbURhdGEpb2JqOwotICAgICAgICAgICAgcmV0dXJuICh0eXBlID09IGltRGF0YS50eXBlICYmIHByb3RvY29sID09IGltRGF0YS5wcm90b2NvbAotICAgICAgICAgICAgICAgICAgICAmJiAoY3VzdG9tUHJvdG9jb2wgIT0gbnVsbCA/IGN1c3RvbVByb3RvY29sLmVxdWFscyhpbURhdGEuY3VzdG9tUHJvdG9jb2wpIDoKLSAgICAgICAgICAgICAgICAgICAgICAgIChpbURhdGEuY3VzdG9tUHJvdG9jb2wgPT0gbnVsbCkpCi0gICAgICAgICAgICAgICAgICAgICYmIChkYXRhICE9IG51bGwgPyBkYXRhLmVxdWFscyhpbURhdGEuZGF0YSkgOiAoaW1EYXRhLmRhdGEgPT0gbnVsbCkpCi0gICAgICAgICAgICAgICAgICAgICYmIGlzUHJpbWFyeSA9PSBpbURhdGEuaXNQcmltYXJ5KTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewotICAgICAgICAgICAgcmV0dXJuIFN0cmluZy5mb3JtYXQoCi0gICAgICAgICAgICAgICAgICAgICJ0eXBlOiAlZCwgcHJvdG9jb2w6ICVkLCBjdXN0b21fcHJvdGNvbDogJXMsIGRhdGE6ICVzLCBpc1ByaW1hcnk6ICVzIiwKLSAgICAgICAgICAgICAgICAgICAgdHlwZSwgcHJvdG9jb2wsIGN1c3RvbVByb3RvY29sLCBkYXRhLCBpc1ByaW1hcnkpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBjbGFzcyBQaG90b0RhdGEgewotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGT1JNQVRfRkxBU0ggPSAiU1dGIjsKLSAgICAgICAgcHVibGljIGZpbmFsIGludCB0eXBlOwotICAgICAgICBwdWJsaWMgZmluYWwgU3RyaW5nIGZvcm1hdE5hbWU7ICAvLyB1c2VkIHdoZW4gdHlwZSBpcyBub3QgZGVmaW5lZCBpbiBDb250YWN0c0NvbnRyYWN0LgotICAgICAgICBwdWJsaWMgZmluYWwgYnl0ZVtdIHBob3RvQnl0ZXM7Ci0gICAgICAgIHB1YmxpYyBmaW5hbCBib29sZWFuIGlzUHJpbWFyeTsKLQotICAgICAgICBwdWJsaWMgUGhvdG9EYXRhKGludCB0eXBlLCBTdHJpbmcgZm9ybWF0TmFtZSwgYnl0ZVtdIHBob3RvQnl0ZXMsIGJvb2xlYW4gaXNQcmltYXJ5KSB7Ci0gICAgICAgICAgICB0aGlzLnR5cGUgPSB0eXBlOwotICAgICAgICAgICAgdGhpcy5mb3JtYXROYW1lID0gZm9ybWF0TmFtZTsKLSAgICAgICAgICAgIHRoaXMucGhvdG9CeXRlcyA9IHBob3RvQnl0ZXM7Ci0gICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgewotICAgICAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgUGhvdG9EYXRhKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFBob3RvRGF0YSBwaG90b0RhdGEgPSAoUGhvdG9EYXRhKW9iajsKLSAgICAgICAgICAgIHJldHVybiAodHlwZSA9PSBwaG90b0RhdGEudHlwZSAmJgotICAgICAgICAgICAgICAgICAgICAoZm9ybWF0TmFtZSA9PSBudWxsID8gKHBob3RvRGF0YS5mb3JtYXROYW1lID09IG51bGwpIDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3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hpcyBpbnB1dCBkYXRhIGFyZSBhdHRhY2hlZCB0byB0aGUgbGFzdCBvbmUgd2hpY2gKLSAgICAgKiBkb2VzIG5vdCBoYXZlIHZhbGlkIHZhbHVlcyAobm90IGluY2x1ZGluZyBlbXB0eSBidXQgb25seSBudWxsKS4gSWYgdGhlcmUncyBubwotICAgICAqIHtAbGluayBPcmdhbml6YXRpb25EYXRhfSBvYmplY3QsIGEgbmV3IHtAbGluayBPcmdhbml6YXRpb25EYXRhfSBpcyBjcmVhdGVkLAotICAgICAqIHdob3NlIHRpdGxlIGlzIHNldCB0byBudWxsLgotICAgICAqLwotICAgIHByaXZhdGUgdm9pZCBoYW5kbGVPcmdWYWx1ZShmaW5hbCBpbnQgdHlwZSwgTGlzdDxTdHJpbmc+IG9yZ0xpc3QsCi0gICAgICAgICAgICBNYXA8U3RyaW5nLCBDb2xsZWN0aW9uPFN0cmluZz4+IHBhcmFtTWFwLCBib29sZWFuIGlzUHJpbWFyeSkgewotICAgICAgICBmaW5hbCBTdHJpbmcgcGhvbmV0aWNOYW1lID0gYnVpbGRTaW5nbGVQaG9uZXRpY05hbWVGcm9tU29ydEFzUGFyYW0ocGFyYW1NYXApOwotICAgICAgICBpZiAob3JnTGlzdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICBvcmdMaXN0ID0gc0VtcHR5TGlzdDsKLSAgICAgICAgfQotICAgICAgICBmaW5hbCBTdHJpbmcgY29tcGFueU5hbWU7Ci0gICAgICAgIGZpbmFsIFN0cmluZyBkZXBhcnRtZW50TmFtZTsKLSAgICAgICAgZmluYWwgaW50IHNpemUgPSBvcmdMaXN0LnNpemUoKTsKLSAgICAgICAgc3dpdGNoIChzaXplKSB7Ci0gICAgICAgICAgICBjYXNlIDA6IHsKLSAgICAgICAgICAgICAgICBjb21wYW55TmFtZSA9ICIiOwotICAgICAgICAgICAgICAgIGRlcGFydG1lbnROYW1lID0gbnVsbDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgMTogewotICAgICAgICAgICAgICAgIGNvbXBhbnlOYW1lID0gb3JnTGlzdC5nZXQoMCk7Ci0gICAgICAgICAgICAgICAgZGVwYXJ0bWVudE5hbWUgPSBudWxsOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZGVmYXVsdDogeyAgLy8gTW9yZSB0aGFuIDEuCi0gICAgICAgICAgICAgICAgY29tcGFueU5hbWUgPSBvcmdMaXN0LmdldCgwKTsKLSAgICAgICAgICAgICAgICAvLyBXZSdyZSBub3Qgc3VyZSB3aGljaCBpcyB0aGUgY29ycmVjdCBzdHJpbmcgZm9yIGRlcGFydG1lbnQuCi0gICAgICAgICAgICAgICAgLy8gSW4gb3JkZXIgdG8ga2VlcCBhbGwgdGhlIGRhdGEsIGNvbmNhdGluYXRlIHRoZSByZXN0IG9mIGVsZW1lbnRzLgotICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPCBzaXplOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGkgPiAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG9yZ0xpc3QuZ2V0KGkpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZGVwYXJ0bWVudE5hbWUgPSBidWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKG1Pcmdhbml6YXRpb25MaXN0ID09IG51bGwpIHsKLSAgICAgICAgICAgIC8vIENyZWF0ZSBuZXcgZmlyc3Qgb3JnYW5pemF0aW9uIGVudHJ5LCB3aXRoICJudWxsIiB0aXRsZSB3aGljaCBtYXkgYmUKLSAgICAgICAgICAgIC8vIGFkZGVkIHZpYSBoYW5kbGVUaXRsZVZhbHVlKCkuCi0gICAgICAgICAgICBhZGROZXdPcmdhbml6YXRpb24odHlwZSwgY29tcGFueU5hbWUsIGRlcGFydG1lbnROYW1lLCBudWxsLCBwaG9uZXRpY05hbWUsIGlzUHJpbWFyeSk7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChPcmdhbml6YXRpb25EYXRhIG9yZ2FuaXphdGlvbkRhdGEgOiBtT3JnYW5pemF0aW9uTGlzdCkgewotICAgICAgICAgICAgLy8gTm90IHVzZSBUZXh0VXRpbHMuaXNFbXB0eSgpIHNpbmNlIE9SRyB3YXMgc2V0IGJ1dCB0aGUgZWxlbWVudHMgbWlnaHQgYmUgZW1wdHkuCi0gICAgICAgICAgICAvLyBlLmcuICJPUkc7UFJFRjo7IiAtPiBCb3RoIGNvbXBhbnlOYW1lIGFuZCBkZXBhcnRtZW50TmFtZSBiZWNvbWUgZW1wdHkgYnV0IG5vdCBudWxsLgotICAgICAgICAgICAgaWYgKG9yZ2FuaXphdGlvbkRhdGEuY29tcGFueU5hbWUgPT0gbnVsbCAmJgotICAgICAgICAgICAgICAgICAgICBvcmdhbml6YXRpb25EYXRhLmRlcGFydG1lbnROYW1lID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAvLyBQcm9iYWJseSB0aGUgIlRJVExFIiBwcm9wZXJ0eSBjb21lcyBiZWZvcmUgdGhlICJPUkciIHByb3BlcnR5IHZpYQotICAgICAgICAgICAgICAgIC8vIGhhbmRsZVRpdGxlTGluZSgpLgotICAgICAgICAgICAgICAgIG9yZ2FuaXphdGlvbkRhdGEuY29tcGFueU5hbWUgPSBjb21wYW55TmFtZTsKLSAgICAgICAgICAgICAgICBvcmdhbml6YXRpb25EYXRhLmRlcGFydG1lbnROYW1lID0gZGVwYXJ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AgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgZmluYWwgQ29sbGVjdGlvbjxTdHJpbmc+IHNvcnRBc0NvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoVkNhcmRDb25zdGFudHMuUEFSQU1fU09SVF9BUyk7Ci0gICAgICAgIGlmIChzb3J0QXNDb2xsZWN0aW9uICE9IG51bGwgJiYgc29ydEFzQ29sbGVjdGlvbi5zaXplKCkgIT0gMCkgewotICAgICAgICAgICAgaWYgKHNvcnRBc0NvbGxlY3Rpb24uc2l6ZSgpID4gMSkgewotICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJJbmNvcnJlY3QgbXVsdGlwbGUgU09SVF9BUyBwYXJhbWV0ZXJzIGRldGVjdGVkOiAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy50b1N0cmluZyhzb3J0QXNDb2xsZWN0aW9uLnRvQXJyYXkoKSkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZmluYWwgTGlzdDxTdHJpbmc+IHNvcnROYW1lcyA9Ci0gICAgICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuY29uc3RydWN0TGlzdEZyb21WYWx1ZShzb3J0QXNDb2xsZWN0aW9uLml0ZXJhdG9yKCkubmV4dCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1WQ2FyZFR5cGUpOwotICAgICAgICAgICAgaW50IHNpemUgPSBzb3J0TmFtZXMuc2l6ZSgpOwotICAgICAgICAgICAgaWYgKHNpemUgPiAzKSB7Ci0gICAgICAgICAgICAgICAgc2l6ZSA9IDM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzd2l0Y2ggKHNpemUpIHsKLSAgICAgICAgICAgIGNhc2UgMzogbVBob25ldGljTWlkZGxlTmFtZSA9IHNvcnROYW1lcy5nZXQoMik7IC8vJEZBTEwtVEhST1VHSCQKLSAgICAgICAgICAgIGNhc2UgMjogbVBob25ldGljR2l2ZW5OYW1lID0gc29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i4KLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotCi0gICAgICAgIGludCBzaXplOwotICAgICAgICBpZiAoZWxlbXMgPT0gbnVsbCB8fCAoc2l6ZSA9IGVsZW1zLnNpemUoKSkgPCAxKSB7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBBc3N1bWUgdGhhdCB0aGUgb3JkZXIgaXMgIkZhbWlseSwgR2l2ZW4sIE1pZGRsZSIuCi0gICAgICAgIC8vIFRoaXMgaXMgbm90IGZyb20gc3BlY2lmaWNhdGlvbiBidXQgbWVyZSBhc3N1bXB0aW9uLiBTb21lIEphcGFuZXNlIHBob25lcyB1c2UgdGhpcyBvcmRlci4KLSAgICAgICAgaWYgKHNpemUgPiAzKSB7Ci0gICAgICAgICAgICBzaXplID0gMzsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChlbGVtcy5nZXQoMCkubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICBib29sZWFuIG9ubHlGaXJzdEVsZW1Jc05vbkVtcHR5ID0gdHJ1ZTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDwgc2l6ZTsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGVsZW1zLmdldChpKS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgb25seUZpcnN0RWxlbUlzTm9uRW1wdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG9ubHlGaXJzdEVsZW1Jc05vbkVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nW10gbmFtZXNBcnJheSA9IGVsZW1zLmdldCgwKS5zcGxpdCgiICIpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCBuYW1lQXJyYXlMZW5ndGggPSBuYW1lc0FycmF5Lmxlbmd0aDsKLSAgICAgICAgICAgICAgICBpZiAobmFtZUFycmF5TGVuZ3RoID09IDMpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gQXNzdW1lIHRoZSBzdHJpbmcgaXMgIkZhbWlseSBNaWRkbGUgR2l2ZW4iLgotICAgICAgICAgICAgICAgICAgICBtUGhvbmV0aWNGYW1pbHlOYW1lID0gbmFtZXNBcnJheVswXTsKLSAgICAgICAgICAgICAgICAgICAgbVBob25ldGljTWlkZGxlTmFtZSA9IG5hbWVzQXJyYXlbMV07Ci0gICAgICAgICAgICAgICAgICAgIG1QaG9uZXRpY0dpdmVuTmFtZSA9IG5hbWVzQXJyYXlbMl07Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lQXJyYXlMZW5ndGggPT0gMikgewotICAgICAgICAgICAgICAgICAgICAvLyBBc3N1bWUgdGhlIHN0cmluZyBpcyAiRmFtaWx5IEdpdmVuIiBiYXNlZCBvbiB0aGUgSmFwYW5lc2UgbW9iaWxlCi0gICAgICAgICAgICAgICAgICAgIC8vIHBob25lcycgcHJlZmVyZW5jZS4KLSAgICAgICAgICAgICAgICAgICAgbVBob25ldGljRmFtaWx5TmFtZSA9IG5hbWVzQXJyYXlbMF07Ci0gICAgICAgICAgICAgICAgICAgIG1QaG9uZXRpY0dpdmVuTmFtZSA9IG5hbWVzQXJyYXlbMV07Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVBob25ldGljRnVsbE5hbWUgPSBlbGVtcy5nZXQoMCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHN3aXRjaCAoc2l6ZSkgewotICAgICAgICAgICAgLy8gZmFsbHRocm91Z2gKLSAgICAgICAgICAgIGNhc2UgMzogbVBob25ldGljTWlkZGxlTmFtZSA9IGVsZW1zLmdldCgyKTsKLSAgICAgICAgICAgI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9Ci0gICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX0FEUikpIHsKLSAgICAgICAgICAgIGJvb2xlYW4gdmFsdWVzQXJlQWxsRW1wdHkgPSB0cnVlOwotICAgICAgICAgICAgZm9yIChTdHJpbmcgdmFsdWUgOiBwcm9wVmFsdWVMaXN0KSB7Ci0gICAgICAgICAgICAgICAgaWYgKHZhbHVlLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICB2YWx1ZXNBcmVBbGxFbXB0eSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodmFsdWVzQXJlQWxsRW1wdHkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGludCB0eXBlID0gLTE7Ci0gICAgICAgICAgICBTdHJpbmcgbGFiZWwgPSAiIjsKLSAgICAgICAgICAgIGJvb2xlYW4gaXNQcmltYXJ5ID0gZmFsc2U7Ci0gICAgICAgICAgICBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRSk7Ci0gICAgICAgICAgICBpZiAodHlwZUNvbGxlY3Rpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlQ29sbGVjdGlvbikgewotICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nID0gdHlwZVN0cmluZy50b1VwcGVyQ2FzZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5lcXVhbHMoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QUkVGKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaXNQcmltYXJ5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0hPTUUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gU3RydWN0dXJlZFBvc3RhbC5UWVBFX0hPTUU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbCA9ICIiOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfV09SSykgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nLmVxdWFsc0lnbm9yZUNhc2UoVkNhcmRDb25zdGFudHMuUEFSQU1fRVhUUkFfVFlQRV9DT01QQU5ZKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gIkNPTVBBTlkiIHNlZW1zIGVtaXR0ZWQgYnkgV2luZG93cyBNb2JpbGUsIHdoaWNoIGlzIG5vdAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3BlY2lmaWNhbGx5IHN1cHBvcnRlZCBieSB2Q2FyZCAyLjEuIFdlIGFzc3VtZSB0aGlzIGlzIHNhbWUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFzICJXT1JLIi4KLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfV09SSzsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gIiI7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHMoVkNhcmRDb25zdGFudHMuUEFSQU1fQURSX1RZUEVfUEFSQ0VMKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX0FEUl9UWVBFX0RPTSkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9BRFJfVFlQRV9JTlRMKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgZG8gbm90IGhhdmUgYW55IGFwcHJvcHJpYXRlIHdheSB0byBzdG9yZSB0aGlzIGluZm9ybWF0aW9uLgotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuc3RhcnRzV2l0aCgiWC0iKSAmJiB0eXBlIDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnN1YnN0cmluZygyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHZDYXJkIDMuMCBhbGxvd3MgaWFuYS10b2tlbi4gQWxzbyBzb21lIHZDYXJkIDIuMSBleHBvcnRlcnMKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVtaXQgbm9uLXN0YW5kYXJkIHR5cGVzLiBXZSBkbyBub3QgaGFuZGxlIHRoZWlyIHZhbHVlcyBub3cuCi0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gU3RydWN0dXJlZFBvc3RhbC5UWVBFX0NVU1RPTTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdHlwZVN0cmluZzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIFdlIHVzZSAiSE9NRSIgYXMgZGVmYXVsdAotICAgICAgICAgICAgaWYgKHR5cGUgPCAwKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9IT01FOwotICAgICAgICAgICAgfQotC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gICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9XT1JLOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfQ0VMTCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBFbWFpbC5UWVBFX01PQklMRTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nLnN0YXJ0c1dpdGgoIlgtIikgJiYgdHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nID0gdHlwZVN0cmluZy5zdWJzdHJpbmcoMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyB2Q2FyZCAzLjAgYWxsb3dzIGlhbmEtdG9rZW4uCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBtYXkgaGF2ZSBJTlRFUk5FVCAoc3BlY2lmaWVkIGluIHZDYXJkIHNwZWMpLAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gU0NIT09MLCBldGMuCi0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9DVVNUT007Ci0gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbCA9IHR5cGVTdHJpbmc7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9PVEhFUjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGFkZEVtYWlsKHR5cGUsIHByb3BWYWx1ZSwgbGFiZWwsIGlzUHJpbWFyeSk7Ci0gICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF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otICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZvcm1hdE5hbWUgPT0gbnVsbCl7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0TmFtZSA9IHR5cGVWYWx1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBhZGRQaG90b0J5dGVzKGZvcm1hdE5hbWUsIHByb3BCeXRlcywgaXNQcmltYXJ5KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmIChwcm9wTmFtZS5lcXVhbHMoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfVEVMKSkgewotICAgICAgICAgICAgZmluYWwgQ29sbGVjdGlvbjxTdHJpbmc+IHR5cGVDb2xsZWN0aW9uID0gcGFyYW1NYXAuZ2V0KFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEUpOwotICAgICAgICAgICAgZmluYWwgT2JqZWN0IHR5cGVPYmplY3QgPQotICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuZ2V0UGhvbmVUeXBlRnJvbVN0cmluZ3ModHlwZUNvbGxlY3Rpb24sIHByb3BWYWx1ZSk7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgdHlwZTsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBsYWJlbDsKLSAgICAgICAgICAgIGlmICh0eXBlT2JqZWN0IGluc3RhbmNlb2YgSW50ZWdlcikgewotICAgICAgICAgICAgICAgIHR5cGUgPSAoSW50ZWdlcil0eXBlT2JqZWN0OwotICAgICAgICAgICAgICAgIGxhYmVsID0gbnVsbDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IFBob25lLlRZUEVfQ1VTVE9NOwotICAgICAgICAgICAgICAg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GlzUHJpbWFyeSA9IGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYWRkUGhvbmUodHlwZSwgcHJvcFZhbHVlLCBudWxsLCBpc1ByaW1hcnkpOwotICAgICAgICB9IGVsc2UgaWYgKHNJbU1hcC5jb250YWluc0tleShwcm9wTmFtZSkpIHsKLSAgICAgICAgICAgIGZpbmFsIGludCBwcm90b2NvbCA9IHNJbU1hcC5nZXQocHJvcE5hbWUpOwotICAgICAgICAgICAgYm9vbGVhbiBpc1ByaW1hcnkgPSBmYWxzZTsKLSAgICAgICAgICAgIGludCB0eXBlID0gLTE7Ci0gICAgICAgICAgICBmaW5hbCBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRSk7Ci0gICAgICAgICAgICBpZiAodHlwZUNvbGxlY3Rpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlQ29sbGVjdGlvbikgewotICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5lcXVhbHMoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QUkVGKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaXNQcmltYXJ5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlIDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuZXF1YWxzSWdub3JlQ2FzZShWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0hPTUUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IEltLlRZUEVfSE9NRTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHNJZ25vcmVDYXNlKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfV09SSykpIHsKLSAgICAgICAgICAgICAgICAgICAgICAg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FsdWUoUmF3Q29udGFjdHMuQUNDT1VOVF9OQU1FLCBtQWNjb3VudC5uYW1lKTsKLSAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKFJhd0NvbnRhY3RzLkFDQ09VTlRfVFlQRSwgbUFjY291bnQudHlwZSk7Ci0KLSAgICAgICAgICAgIC8vIEFzc3VtZSB0aGF0IGNhbGxlciBzaWRlIGNyZWF0ZXMgdGhpcyBncm91cCBpZiBpdCBkb2VzIG5vdCBleGlzdC4KLSAgICAgICAgICAgIGlmIChBQ0NPVU5UX1RZUEVfR09PR0xFLmVxdWFscyhtQWNjb3VudC50eXBlKSkgewotICAgICAgICAgICAgICAgIGZpbmFsIEN1cnNvciBjdXJzb3IgPSByZXNvbHZlci5xdWVyeShHcm91cHMuQ09OVEVOVF9VUkksIG5ldyBTdHJpbmdbXSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBHcm91cHMuU09VUkNFX0lEIH0sCi0gICAgICAgICAgICAgICAgICAgICAgICBHcm91cHMuVElUTEUgKyAiPT8iLCBuZXcgU3RyaW5nW10gewotICAgICAgICAgICAgICAgICAgICAgICAgR09PR0xFX01ZX0NPTlRBQ1RTX0dST1VQIH0sIG51bGwpOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCAmJiBjdXJzb3IubW92ZVRvRmlyc3QoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbXlHcm91cHNJZCA9IGN1cnNvci5nZXRTdHJpbmcoMCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IG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LSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShQaG9uZS5UWVBFLCBwaG9uZURhdGEudHlwZSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBob25lRGF0YS50eXBlID09IFBob25lLlRZUEVfQ1VTVE9NKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKFBob25lLkxBQkVMLCBwaG9uZURhdGEubGFiZWwpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShQaG9uZS5OVU1CRVIsIHBob25lRGF0YS5kYXRhKTsKLSAgICAgICAgICAgICAgICBpZiAocGhvbmVEYXRhLmlzUHJpbWFyeSkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShQaG9uZS5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtT3JnYW5pemF0aW9uTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmb3IgKE9yZ2FuaXphdGlvbkRhdGEgb3JnYW5pemF0aW9uRGF0YSA6IG1Pcmdhbml6YXRpb25MaXN0KSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlciA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKE9yZ2FuaXphdGlvbi5SQVdfQ09OVEFDVF9JRCwgMCk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgT3JnYW5pemF0aW9uLkNPTlRFTlRfSVRFTV9UWVBFKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShPcmdhbml6YXRpb24uVFlQRSwgb3JnYW5pemF0aW9uRGF0YS50eXBlKTsKLSAgICAgICAgICAgICAgICBpZiAob3JnYW5pemF0aW9uRGF0YS5jb21wYW55TmFtZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKE9yZ2FuaXphdGlvbi5DT01QQU5ZLCBvcmdhbml6YXRpb25EYXRhLmNvbXBhbnlOYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG9yZ2FuaXphdGlvbkRhdGEuZGVwYXJ0bWVudE5hbWUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShPcmdhbml6YXRpb24uREVQQVJUTUVOVCwgb3JnYW5pemF0aW9uRGF0YS5kZXBhcnRtZW50TmFtZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChvcmdhbml6YXRpb25EYXRhLnRpdGxlTmFtZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKE9yZ2FuaXphdGlvbi5USVRMRSwgb3JnYW5pemF0aW9uRGF0YS50aXRsZU5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAob3JnYW5pemF0aW9uRGF0YS5waG9uZXRpY05hbWUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShPcmdhbml6YXRpb24uUEhPTkVUSUNfTkFNRSwgb3JnYW5pemF0aW9uRGF0YS5waG9uZXRpY05hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAob3JnYW5pemF0aW9uRGF0YS5pc1ByaW1hcnkpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoT3JnYW5pemF0aW9uLklTX1BSSU1BUlksIDEpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1FbWFpbExpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChFbWFpbERhdGEgZW1haWxEYXRhIDogbUVtYWlsTGlzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5jZShFbWFpbC5SQVdfQ09OVEFDVF9JRCwgMCk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgRW1haWwuQ09OVEVOVF9JVEVNX1RZUEUpOwotCi0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRW1haWwuVFlQRSwgZW1haWxEYXRhLnR5cGUpOwotICAgICAgICAgICAgICAgIGlmIChlbWFpbERhdGEudHlwZSA9PSBFbWFpbC5UWVBFX0NVU1RPTSkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShFbWFpbC5MQUJFTCwgZW1haWxEYXRhLmxhYmVsKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRW1haWwuREFUQSwgZW1haWxEYXRhLmRhdGEpOwotICAgICAgICAgICAgICAgIGlmIChlbWFpbERhdGEuaXNQcmltYXJ5KSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuSVNfUFJJTUFSWSwgMSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobVBvc3RhbExpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChQb3N0YWxEYXRhIHBvc3RhbERhdGEgOiBtUG9zdGFsTGlzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuaW5zZXJ0U3RydWN0dXJlZFBvc3RhbERhdGFVc2luZ0NvbnRhY3RzU3RydWN0KAotICAgICAgICAgICAgICAgICAgICAgICAgbVZDYXJkVHlwZSwgYnVpbGRlciwgcG9zdGFsRGF0YSk7Ci0gICAgICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtSW1MaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoSW1EYXRhIGltRGF0YSA6IG1JbUxpc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoSW0uUkFXX0NPTlRBQ1RfSUQsIDApOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIEltLkNPTlRFTlRfSVRFTV9UWVBFKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShJbS5UWVBFLCBpbURhdGEudHlwZSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoSW0uUFJPVE9DT0wsIGltRGF0YS5wcm90b2NvbCk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoSW0uREFUQSwgaW1EYXRhLmRhdGEpOwotICAgICAgICAgICAgICAgIGlmIChpbURhdGEucHJvdG9jb2wgPT0gSW0uUFJPVE9DT0xfQ1VTVE9NKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEltLkNVU1RPTV9QUk9UT0NPTCwgaW1EYXRhLmN1c3RvbVByb3RvY29sKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGltRGF0YS5pc1ByaW1hcnkpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtTm90ZUxpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChTdHJpbmcgbm90ZSA6IG1Ob3RlTGlzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5jZShOb3RlLlJBV19DT05UQUNUX0lELCAwKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLk1JTUVUWVBFLCBOb3RlLkNPTlRFTlRfSVRFTV9UWVBFKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShOb3RlLk5PVEUsIG5vdGUpOwotICAgICAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobVBob3RvTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmb3IgKFBob3RvRGF0YSBwaG90b0RhdGEgOiBtUGhvdG9MaXN0KSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlciA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKFBob3RvLlJBV19DT05UQUNUX0lELCAwKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLk1JTUVUWVBFLCBQaG90by5DT05URU5UX0lURU1fVFlQRSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoUGhvdG8uUEhPVE8sIHBob3RvRGF0YS5waG90b0J5dGVzKTsKLSAgICAgICAgICAgICAgICBpZiAocGhvdG9EYXRhLmlzUHJpbWFyeSkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShQaG90by5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtV2Vic2l0ZUxpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChTdHJpbmcgd2Vic2l0ZSA6IG1XZWJzaXRlTGlzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5j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gfSBlbHNlIGlmIChzaXplID4gVkNhcmRDb25zdGFudHMuTUFYX0RBVEFfQ09MVU1OICsgMSkgewotICAgICAgICAgICAgICAgICAgICBzaXplID0gVkNhcmRDb25zdGFudHMuTUFYX0RBVEFfQ09MVU1OICsgMTsKLSAgICAgICAgICAgICAgICAgICAgY3VzdG9tUHJvcGVydHlMaXN0ID0KLSAgICAgICAgICAgICAgICAgICAgICAgIGN1c3RvbVByb3BlcnR5TGlzdC5zdWJMaXN0KDAsIFZDYXJkQ29uc3RhbnRzLk1BWF9EQVRBX0NPTFVNTiArIDIpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGludCBpID0gMDsKLSAgICAgICAgICAgICAgICBmb3IgKGZpbmFsIFN0cmluZyBjdXN0b21Qcm9wZXJ0eVZhbHVlIDogY3VzdG9tUHJvcGVydHlMaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBtaW1lVHlwZSA9IGN1c3RvbVByb3BlcnR5VmFsdWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5jZShHcm91cE1lbWJlcnNoaXAuUkFXX0NPTlRBQ1RfSUQsIDApOwotICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgbWltZVR5cGUpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyAgLy8gMSA8PSBpICYmIGkgPD0gTUFYX0RBVEFfQ09MVU1OUwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShjdXN0b21Qcm9wZXJ0eVZhbHVlKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKCJkYXRhIiArIGksIGN1c3RvbVByb3BlcnR5VmFsdWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaSsrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG15R3JvdXBzSWQgIT0gbnVsbCkgewotICAgICAgICAgICAgYnVpbGRlciA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSk7Ci0gICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoR3JvdXBNZW1iZXJzaGlwLlJBV19DT05UQUNUX0lELCAwKTsKLSAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIEdyb3VwTWVtYmVyc2hpcC5DT05URU5UX0lURU1fVFlQRSk7Ci0gICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShHcm91cE1lbWJlcnNoaXAuR1JPVVBfU09VUkNFX0lELCBteUdyb3Vwc0lkKTsKLSAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7Ci0gICAgICAgIH0KLQotICAgICAgICB0cnkgewotICAgICAgICAgICAgQ29udGVudFByb3ZpZGVyUmVzdWx0W10gcmVzdWx0cyA9IHJlc29sdmVyLmFwcGx5QmF0Y2goCi0gICAgICAgICAgICAgICAgICAgICAgICBDb250YWN0c0NvbnRyYWN0LkFVVEhPUklUWSwgb3BlcmF0aW9uTGlzdCk7Ci0gICAgICAgICAgICAvLyB0aGUgZmlyc3Qgcm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AgICAgICAgICAgIHN1cGVyKGluKTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgU3RyaW5nIHJlYWRMaW5lKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKLSAgICAgICAgICAgIGlmIChtTmV4dExpbmVJc1ZhbGlkKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHJldCA9IG1OZXh0TGluZTsKLSAgICAgICAgICAgICAgICBtTmV4dExpbmUgPSBudWxsOwotICAgICAgICAgICAgICAgIG1OZXh0TGluZUlzVmFsaWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICByZXR1cm4gcmV0OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBsb25nIHN0YXJ0ID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGluZSA9IHN1cGVyLnJlYWRMaW5lKCk7Ci0gICAgICAgICAgICBsb25nIGVuZCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICAgICAgbVRpbWUgKz0gZW5kIC0gc3RhcnQ7Ci0gICAgICAgICAgICByZXR1cm4gbGluZTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qKgotICAgICAgICAgKiBSZWFkIG9uZSBsaW5lLCBidXQgbWFrZSB0aGlzIG9iamVjdCBzdG9yZSBpdCBpbiBpdHMgcXVldWUuCi0gICAgICAgICAqLwotICAgICAgICBwdWJsaWMgU3RyaW5nIHBlZWtMaW5lKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKLSAgICAgICAgICAgIGlmICghbU5leHRMaW5lSXNWYWxpZCkgewotICAgICAgICAgICAgICAgIGxvbmcgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGluZSA9IHN1cGVyLnJlYWRMaW5lKCk7Ci0gIC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RydWU7Ci0gICAgICAgIHdoaWxlICh0cnVlKSB7Ci0gICAgICAgICAgICBpZiAobUNhbmNlbGVkKSB7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIXBhcnNlT25lVkNhcmQocmVhZGluZ0ZpcnN0RmlsZSkpIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJlYWRpbmdGaXJzdEZpbGUgPSBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtTmVzdENvdW50ID4gMCkgewotICAgICAgICAgICAgYm9vbGVhbiB1c2VDYWNoZSA9IHRydWU7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1OZXN0Q291bnQ7IGkrKykgewotICAgICAgICAgICAgICAgIHJlYWRFbmRWQ2FyZCh1c2VDYWNoZSwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgdXNlQ2FjaGUgPSBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIEByZXR1cm4gdHJ1ZSB3aGVuIGEgZ2l2ZW4gcHJvcGVydHkgbmFtZSBpcyBhIHZhbGlkIHByb3BlcnR5IG5hbWUuCi0gICAgICovCi0gICAgcHJvdGVjdGVkIGJvb2xlYW4gaXNWYWxpZFByb3BlcnR5TmFtZShmaW5hbCBTdHJpbmcgcHJvcGVydHlOYW1lKSB7Ci0gICAgICAgIGlmICghKGdldEtub3duUHJvcGVydHlOYW1lU2V0KCkuY29udGFpbnMocHJvcGVydHlOYW1lLnRvVXBwZXJDYXNlKCkpIHx8Ci0gICAgICAgICAgICAgICAgcHJvcGVydHlOYW1lLnN0YXJ0c1dpdGgoIlgtIikpCi0gICAgICAgICAgICAgICAgJiYgIW1Vbmtub3duVHlwZVNldC5jb250YWlucyhwcm9wZXJ0eU5hbWUpKSB7Ci0gICAgICAgICA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3IFZDYXJkRXhjZXB0aW9uKCJSZWFjaGVkIGVuZCBvZiBidWZmZXIuIik7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUudHJpbSgpLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgIHJldHVybiBsaW5lOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoKLSAgICAgKiB2Y2FyZCA9ICJCRUdJTiIgW3dzXSAiOiIgW3dzXSAiVkNBUkQiIFt3c10gMSpDUkxGCi0gICAgICogICAgICAgICBpdGVtcyAqQ1JMRgotICAgICAqICAgICAgICAgIkVORCIgW3dzXSAiOiIgW3dzXSAiVkNBUkQiCi0gICAgICovCi0gICAgcHJpdmF0ZSBib29sZWFuIHBhcnNlT25lVkNhcmQoYm9vbGVhbiBmaXJzdFJlYWQpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBib29sZWFuIGFsbG93R2FyYmFnZSA9IGZhbHNlOwotICAgICAgICBpZiAoZmlyc3RSZWFkKSB7Ci0gICAgICAgICAgICBpZiAobU5lc3RDb3VudCA+IDApIHsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1OZXN0Q291bnQ7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBpZiAoIXJlYWRCZWdpblZDYXJkKGFsbG93R2FyYmFnZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBhbGxvd0dhcmJhZ2UgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmICghcmVhZEJlZ2luVkNhcmQoYWxsb3dHYXJiYWdlKSkgewotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgICAgIGZpbmFsIGxvbmcgYm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NlcHRpb24gewotICAgICAgICBTdHJpbmcgbGluZTsKLSAgICAgICAgZG8gewotICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKLSAgICAgICAgICAgICAgICBsaW5lID0gZ2V0TGluZSgpOwotICAgICAgICAgICAgICAgIGlmIChsaW5lID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGluZS50cmltKCkubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZpbmFsIFN0cmluZ1tdIHN0ckFycmF5ID0gbGluZS5zcGxpdCgiOiIsIDIpOwotICAgICAgICAgICAgZmluYWwgaW50IGxlbmd0aCA9IHN0ckFycmF5Lmxlbmd0aDsKLQotICAgICAgICAgICAgLy8gQWx0aG91Z2ggdkNhcmQgMi4xLzMuMCBzcGVjaWZpY2F0aW9uIGRvZXMgbm90IGFsbG93IGxvd2VyIGNhc2VzLAotICAgICAgICAgICAgLy8gd2UgZm91bmQgdkNhcmQgZmlsZSBlbWl0dGVkIGJ5IHNvbWUgZXh0ZXJuYWwgdkNhcmQgZXhwb3RlciBoYXZlIHN1Y2gKLSAgICAgICAgICAgIC8vIGludmFsaWQgU3RyaW5ncy4KLSAgICAgICAgICAgIC8vIFNvIHdlIGFsbG93IGl0LgotICAgICAgICAgICAgLy8gZS5nLgotICAgICAgICAgICAgLy8gQkVHSU46dkNhcmQKLSAgICAgICAgICAgIGlmIChsZW5ndGggPT0gMiAmJiBzdHJBcnJheVswXS50cmltKCkuZXF1YWxzSWdub3JlQ2FzZSgiQkVHSU4iKQotICAgICAgICAgICAgICAgICAgICAmJiBzdHJBcnJheVsxXS50cmltKCkuZXF1YWxzSWdub3JlQ2FzZSgiVkNBUkQiKSkgewotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotIC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2FyYmFnZSBXaGVuIHRydWUsIGlnbm9yZSBub24gIkVORDpWQ0FSRCIgbGluZS4KLSAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uCi0gICAgICogQHRocm93cyBWQ2FyZEV4Y2VwdGlvbgotICAgICAqLwotICAgIHByb3RlY3RlZCB2b2lkIHJlYWRFbmRWQ2FyZChib29sZWFuIHVzZUNhY2hlLCBib29sZWFuIGFsbG93R2FyYmFnZSkgdGhyb3dzIElPRXhjZXB0aW9uLAotICAgICAgICAgICAgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBTdHJpbmcgbGluZTsKLSAgICAgICAgZG8gewotICAgICAgICAgICAgaWYgKHVzZUNhY2hlKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhvdWdoIHZDYXJkIHNwZWNpZmljYXRpb24gZG9lcyBub3QgYWxsb3cgbG93ZXIgY2FzZXMsCi0gICAgICAgICAgICAgICAgLy8gc29tZSBkYXRhIG1heSBoYXZlIHRoZW0sIHNvIHdlIGFsbG93IGl0LgotICAgICAgICAgICAgICAgIGxpbmUgPSBtUHJldmlvdXNMaW5lOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgICAgICAgICBsaW5lID0gZ2V0TGluZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIkV4cGVjdGVkIEVORDpWQ0FSRCB3YXMgbm90IGZvdW5kLiIpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUudHJpbSgpLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIFN0cmluZ1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KHByb3BlcnR5TmFtZS5lcXVhbHMoIkJFR0lOIikpIHsKLSAgICAgICAgICAgICAgICBpZiAocHJvcGVydHlWYWx1ZS5lcXVhbHMoIlZDQVJEIikpIHsKLSAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkTmVzdGVkRXhjZXB0aW9uKCJUaGlzIHZDYXJkIGhhcyBuZXN0ZWQgdkNhcmQgZGF0YSBpbiBpdC4iKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIlVua25vd24gQkVHSU4gdHlwZTogIiArIHByb3BlcnR5VmFsdWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAocHJvcGVydHlOYW1lLmVxdWFscygiVkVSU0lPTiIpICYmICFwcm9wZXJ0eVZhbHVlLmVxdWFscyhnZXRWZXJzaW9uU3RyaW5nKCkpKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkVmVyc2lvbkV4Y2VwdGlvbigiSW5jb21wYXRpYmxlIHZlcnNpb246ICIgKyBwcm9wZXJ0eVZhbHVlICsgIiAhPSAiCi0gICAgICAgICAgICAgICAgICAgICAgICArIGdldFZlcnNpb25TdHJpbmcoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdGFydCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICAgICAgaGFuZGxlUHJvcGVydHlWYWx1ZShwcm9wZXJ0eU5hbWUsIHByb3BlcnR5VmFsdWUpOwotICAgICAgICAgICAgbVRpbWVQYXJzZVByb3BlcnR5VmFsdWVzICs9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gc3RhcnQ7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIlV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gIC8vIFRoaXMgbG9vcCBpcyBkZXZlbG9wZWQgc28gdGhhdCB3ZSBkb24ndCBoYXZlIHRvIHRha2UgY2FyZSBvZiBib3R0bGUgbmVjayBoZXJlLgotICAgICAgICAvLyBSZWZhY3RvciBjYXJlZnVsbHkgd2hlbiB5b3UgbmVlZCB0byBkbyBzby4KLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgZmluYWwgY2hhciBjaCA9IGxpbmUuY2hhckF0KGkpOwotICAgICAgICAgICAgc3dpdGNoIChzdGF0ZSkgewotICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfR1JPVVBfT1JfUFJPUEVSVFlfTkFNRTogewotICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJzonKSB7ICAvLyBFbmQgb2YgYSBwcm9wZXJ0eSBuYW1lLgotICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHByb3BlcnR5TmFtZSA9IGxpbmUuc3Vic3RyaW5nKG5hbWVJbmRleCwgaSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydHlOYW1lLmVxdWFsc0lnbm9yZUNhc2UoIkVORCIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByZXZpb3VzTGluZSA9IGxpbmU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtSW50ZXJwcmV0ZXIucHJvcGVydHlOYW1lKHByb3BlcnR5TmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU5hbWVBbmRWYWx1ZVswXSA9IHByb3BlcnR5TmFtZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpIDwgbGVuZ3RoIC0gMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzFdID0gbGluZS5zdWJzdHJpbmcoaSArIDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU5hbWVBbmRWYWx1ZVsxXSA9ICIiOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByb3BlcnR5TmFtZUFuZFZhbHVlOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICcuJykgeyAgLy8gRWFjaCBncm91cCBpcyBmb2xsb3dlZCBieSB0aGUgZG90LgotICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGdyb3VwTmFtZSA9IGxpbmUuc3Vic3RyaW5nKG5hbWVJbmRleCwgaSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXBOYW1lLmxlbmd0aCgpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiRW1wdHkgZ3JvdXAgZm91bmQuIElnbm9yaW5nLiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW50ZXJwcmV0ZXIucHJvcGVydHlHcm91cChncm91cE5hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgbmFtZUluZGV4ID0gaSArIDE7ICAvLyBOZXh0IHNob3VsZCBiZSBhbm90aGVyIGdyb3VwIG9yIGEgcHJvcGVydHkgbmFtZS4KLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnOycpIHsgIC8vIEVuZCBvZiBwcm9wZXJ0eSBuYW1lIGFuZCBiZWdpbm5lbmcgb2YgcGFyYW1ldGVycy4gIAotICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHByb3BlcnR5TmFtZSA9IGxpbmUuc3Vic3RyaW5nKG5hbWVJbmRleCwgaSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydHlOYW1lLmVxdWFsc0lnbm9yZUNhc2UoIkVORCIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByZXZpb3VzTGluZSA9IGxpbmU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtSW50ZXJwcmV0ZXIucHJvcGVydHlOYW1lKHByb3BlcnR5TmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU5hbWVBbmRWYWx1ZVswXSA9IHByb3BlcnR5TmFtZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVJbmRleCA9IGkgKyAxOwotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9QQVJBTVM7ICAvLyBTdGFydCBwYXJhbWV0ZXIgcGFyc2luZy4KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBjb21tYSBzdXBwb3J0IChpbiB2Q2FyZCAzLjAgYW5kIDQuMCkuCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYXNlIFNUQVRFX1BBUkFNUzogewotICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJyInKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoVkNhcmRDb25zdGFudHMuVkVSU0lPTl9WMjEuZXF1YWxzSWdub3JlQ2FzZShnZXRWZXJzaW9uU3RyaW5nKCkpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIkRvdWJsZS1xdW90ZWQgcGFyYW1zIGZvdW5kIGluIHZDYXJkIDIuMS4gIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU2lsZW50bHkgYWxsb3cgaXQiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfUEFSQU1TX0lOX0RRVU9URTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnOycpIHsgIC8vIFN0YXJ0cyBhbm90aGVyIHBhcmFtLgotICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlUGFyYW1zKGxpbmUuc3Vic3RyaW5nKG5hbWVJbmRleCwgaSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgbmFtZUluZGV4ID0gaSArIDE7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gJzonKSB7ICAvLyBFbmQgb2YgcGFyYW0gYW5kIGJlZ2luZW5uaW5nIG9mIHZhbHVlcy4KLSAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZVBhcmFtcyhsaW5lLnN1YnN0cmluZyhuYW1lSW5kZXgsIGkpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpIDwgbGVuZ3RoIC0gMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzFdID0gbGluZS5zdWJzdHJpbmcoaSArIDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU5hbWVBbmRWYWx1ZVsxXSA9ICIiOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByb3BlcnR5TmFtZUFuZFZhbHVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYXNlIFNUQVRFX1BBUkFNU19JTl9EUVVPVEU6IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09ICciJykgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFZDYXJkQ29uc3RhbnRzLlZFUlNJT05fVjIxLmVxdWFsc0lnbm9yZUNhc2UoZ2V0VmVyc2lvblN0cmluZygpKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJEb3VibGUtcXVvdGVkIHBhcmFtcyBmb3VuZCBpbiB2Q2FyZCAyLjEuICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNpbGVudGx5IGFsbG93IGl0Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1BBUkFNUzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICB0aHJvdyBuZXcgVkNhcmRJbnZhbGlkTGluZUV4Y2VwdGlvbigiSW52YWxpZCBsaW5lOiBcIiIgKyBsaW5lICsgIlwiIik7Ci0gICAgfQotCi0gICAgLyoKLSAgICAgKiBwYXJhbXMgPSAiOyIgW3dzXSBwYXJhbWxpc3QgcGFyYW1saXN0ID0gcGFyYW1saXN0IFt3c10gIjsiIFt3c10gcGFyYW0gLwotICAgICAqIHBhcmFtIHBhcmFtID0gIlRZUEUiIFt3c10gIj0iIFt3c10gcHR5cGV2YWwgLyAiVkFMVUUiIFt3c10gIj0iIFt3c10KLSAgICAgKiBwdmFsdWV2YWwgLyAiRU5DT0RJTkciIFt3c10gIj0iIFt3c10gcGVuY29kaW5ndmFsIC8gIkNIQVJTRVQiIFt3c10gIj0iCi0gICAgICogW3dzXSBjaGFyc2V0dmFsIC8gIkxBTkdVQUdFIiBbd3NdICI9Ii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ICAgICAgICBMb2cudyhMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nLmZvcm1hdCgiVGhlIGVuY29kaW5nIFwiJXNcIiBpcyB1bnN1cHBvcnRlZCBieSB2Q2FyZCAlcyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50RW5jb2RpbmcsIGdldFZlcnNpb25TdHJpbmcoKSkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBTb21lIGRldmljZSB1c2VzIGxpbmUgZm9sZGluZyBkZWZpbmVkIGluIFJGQyAyNDI1LCB3aGljaCBpcyBub3QgYWxsb3dlZAotICAgICAgICAgICAgLy8gaW4gdkNhcmQgMi4xICh3aGlsZSBuZWVkZWQgaW4gdkNhcmQgMy4wKS4KLSAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAvLyBlLmcuCi0gICAgICAgICAgICAvLyBCRUdJTjpWQ0FSRAotICAgICAgICAgICAgLy8gVkVSU0lPTjoyLjEKLSAgICAgICAgICAgIC8vIE46O09tZWdhOzs7Ci0gICAgICAgICAgICAvLyBFTUFJTDtJTlRFUk5FVDoiT21lZ2EiCi0gICAgICAgICAgICAvLyAgIDxvbWVnYUBleGFtcGxlLmNvbT4KLSAgICAgICAgICAgIC8vIEZOOk9tZWdhCi0gICAgICAgICAgICAvLyBFTkQ6VkNBUkQKLSAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAvLyBUaGUgdkNhcmQgYWJvdmUgYXNzdW1lcyB0aGF0IGVtYWlsIGFkZHJlc3Mgc2hvdWxkIGJlY29tZToKLSAgICAgICAgICAgIC8vICJPbWVnYSIgPG9tZWdhQGV4YW1wbGUuY29tPgotICAgICAgICAgICAgLy8KLSAgICAgICAgICAgIC8vIEJ1dCB2Q2FyZCAyLjEgcmVxdWlyZXMgUXVvdGUtUHJpbnRhYmxlIHdoZW4gYSBsaW5lIGNvbnRhaW5zIGxpbmUgYnJlYWsocykuCi0gICAgICAgICAg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dHJhIGZlZSBpcyB3b3J0aCBwYXlpbmcuIFRoaXMgaXMgZXhjZXB0aW9uYWwKLSAgICAgICAgICAgICAgICAgICAgLy8gYW55d2F5LgotICAgICAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KG5leHRMaW5lKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRMaW5lLmNoYXJBdCgwKSA9PSAnICcgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAhIkVORDpWQ0FSRCIuY29udGFpbnMobmV4dExpbmUudG9VcHBlckNhc2UoKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGdldExpbmUoKTsgIC8vIERyb3AgdGhlIG5leHQgbGluZS4KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJ1aWxkZXIgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKHByb3BlcnR5VmFsdWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobmV4dExpbmUuc3Vic3RyaW5nKDEpKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlWYWx1ZSA9IGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGZpbmFsIGxvbmcgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTs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0cmluZygwLCBwb3MgKyAxKSk7Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXHJcbiIpOwotICAgICAgICAgICAgU3RyaW5nIGxpbmU7Ci0gICAgICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgICAgIGxpbmUgPSBnZXRMaW5lKCk7Ci0gICAgICAgICAgICAgICAgaWYgKGxpbmUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIkZpbGUgZW5kZWQgZHVyaW5nIHBhcnNpbmcgYSBRdW90ZWQtUHJpbnRhYmxlIFN0cmluZyIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAobGluZS50cmltKCkuZW5kc1dpdGgoIj0iKSkgewotICAgICAgICAgICAgICAgICAgICAvLyByZW1vdmUgInRyYW5zcG9ydC1wYWRkaW5nIgotICAgICAgICAgICAgICAgICAgICBwb3MgPSBsaW5lLmxlbmd0aCgpIC0gMTsKLSAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGxpbmUuY2hhckF0KHBvcykgIT0gJz0nKSB7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZS5zdWJzdHJpbmcoMCwgcG9zICsgMSkpOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXHJcbiIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIGZpcnN0U3RyaW5nOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJvdGVjdGVkIFN0cmluZyBnZXRCYXNlNjQoU3RyaW5nIGZpcnN0U3RyaW5nKSB0aHJvd3MgSU9FeGNlcHRpb24sIFZDYXJkRXhjZXB0aW9uIHsKLSAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgYnVpbGRlci5hcHBlbmQoZmlyc3RTdHJpbmcpOwotCi0gICAgICAgIHdoaWxlICh0cnVlKSB7Ci0gICAgICAgICAgICBTdHJpbmcgbGluZSA9IGdldExpbmUoKTsKLSAgICAgICAgICAgIGlmIChsaW5lID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIkZpbGUgZW5kZWQgZHVyaW5nIHBhcnNpbmcgQkFTRTY0IGJpbmFyeSIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGxpbmUubGVuZ3RoKCkgPT0gMCkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZSk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIDxwPgotICAgICAqIE1haW5seSBmb3IgIkFEUiIsICJPUkciLCBhbmQgIk4iCi0gICAgICogPC9wPgotICAgICAqLwotICAgIC8qCi0gICAgICogYWRkcmVzc3BhcnRzID0gMCo2KHN0cm5vc2VtaSAiOyIpIHN0cm5vc2VtaSA7IFBPIEJveCwgRXh0ZW5kZWQgQWRkciwKLSAgICAgKiBTdHJlZXQsIExvY2FsaXR5LCBSZWdpb24sIFBvc3RhbCBDb2RlLCBDb3VudHJ5IE5hbWUgb3JncGFydHMgPQotICAgICAqICooc3Rybm9zZW1pICI7Iikgc3Rybm9zZW1pIDsgRmlyc3QgaXMgT3JnYW5pemF0aW9uIE5hbWUs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W9uIHsKLSAgICAgICAgU3RyaW5nIGxpbmU7Ci0gICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG51bGw7Ci0gICAgICAgIHdoaWxlICh0cnVlKSB7Ci0gICAgICAgICAgICBsaW5lID0gbVJlYWRlci5yZWFkTGluZSgpOwotICAgICAgICAgICAgaWYgKGxpbmUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1QcmV2aW91c0xpbmUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcmV0ID0gbVByZXZpb3VzTGluZTsKLSAgICAgICAgICAgICAgICAgICAgbVByZXZpb3VzTGluZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigiUmVhY2hlZCBlbmQgb2YgYnVmZmVyLiIpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChsaW5lLmxlbmd0aCgpID09IDApIHsKLSAgICAgICAgICAgICAgICBpZiAoYnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtUHJldmlvdXNMaW5lICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJldCA9IG1QcmV2aW91c0xpbmU7Ci0gICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAobGluZS5jaGFyQXQoMCkgPT0gJyAnIHx8IGxpbmUuY2hhckF0KDApID09ICdcdCcpIHsKLSAgICAgICAgICAgICAgICBpZiAoYnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFNlZSBTZWN0aW9uIDUuOC4xIG9mIFJGQyAyNDI1IChNSU1FLURJUiBkb2N1bWVudCkuCi0gICAgICAgICAgICAgICAgICAgIC8vIEZvbGxvd2luZyBpcyB0aGUgZXhjZXJwdHMgZnJvbSBpdC4KLSAgICAgICAgICAgICAgICAgICAgLy8KLSAgICAgICAgICAgICAgICAgICAgLy8gREVTQ1JJUFRJT046VGhpcyBpcyBhIGxvbmcgZGVzY3JpcHRpb24gdGhhdCBleGlzdHMgb24gYSBsb25nIGxpbmUuCi0gICAgICAgICAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAgICAgICAgIC8vIENhbiBiZSByZXByZXNlbnRlZCBhczoKLSAgICAgICAgICAgICAgICAgICAgLy8KLSAgICAgICAgICAgICAgICAgICAgLy8gREVTQ1JJUFRJT046VGhpcyBpcyBhIGxvbmcgZGVzY3JpcHRpb24KLSAgICAgICAgICAgICAgICAgICAgLy8gIHRoYXQgZXhpc3RzIG9uIGEgbG9uZyBsaW5lLgotICAgICAgICAgICAgICAgICAgICAvLwotICAgICAgICAgICAgICAgICAgICAvLyBJdCBjb3VsZCBhbHNvIGJlIHJlcHJlc2VudGVkIGFzOgotICAgICAgICAgICAgICAgICAgICAvLwotICAgICAgICAgICAgICAgICAgICAvLyBERVNDUklQVElPTjpUaGlzIGlzIGEgbG9uZyBkZXNjcmlwCi0gICAgICAgICAgICAgICAgICAgIC8vICB0aW9uIHRoYXQgZXhpc3RzIG8KLSAgICAgICAgICAgICAgICAgICAgLy8gIG4gYSBsb25nIGxpbmUuCi0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUuc3Vic3RyaW5nKDEpKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1QcmV2aW91c0xpbmUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobVByZXZpb3VzTGluZSk7Ci0gICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChsaW5lLnN1YnN0cmluZygxKSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKCJTcGFjZSBleGlzdHMgYXQgdGhlIGJlZ2lubmluZyBvZiB0aGUgbGluZSIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1QcmV2aW91c0xpbmUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGJ1aWxkZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyByZXQgPSBtUHJldmlvdXNMaW5lOwotICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKgotICAgICAqIHZjYXJkID0gW2dyb3VwICIuIl0gIkJFR0lOIiAiOiIgIlZDQVJEIiAxICogQ1JMRgotICAgICAqICAgICAgICA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d0aCA9IHBhcmFtVmFsdWUubGVuZ3RoKCk7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgIGZpbmFsIGNoYXIgY2ggPSBwYXJhbVZhbHVlLmNoYXJBdChpKTsKLSAgICAgICAgICAgIGlmIChjaCA9PSAnIicpIHsKLSAgICAgICAgICAgICAgICBpZiAoaW5zaWRlRHF1b3RlKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIEVuZCBvZiBEcXVvdGUuCi0gICAgICAgICAgICAgICAgICAgIG1JbnRlcnByZXRlci5wcm9wZXJ0eVBhcmFtVmFsdWUoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIGluc2lkZURxdW90ZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChidWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChidWlsZGVyLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGUuZy4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwcmVmInF1b3RlZCIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiVW5leHBlY3RlZCBEcXVvdGUgaW5zaWRlIHByb3BlcnR5LiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBlLmcuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcHJlZiwicXVvdGVkIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICJxdW90ZWQiLHByZWYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW50ZXJwcmV0ZXIucHJvcGVydHlQYXJhbVZhbHVlKGJ1aWxkZXIudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaW5zaWRlRHF1b3RlID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICcsJyAmJiAhaW5zaWRlRHF1b3RlKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGJ1aWxkZXIgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiQ29tbWEgaXMgdXNlZCBiZWZvcmUgYWN0dWFsIHN0cmluZyBjb21lcy4gKCIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtVmFsdWUgKyAiKSIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1JbnRlcnByZXRlci5wcm9wZXJ0eVBhcmFtVmFsdWUoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IG51bGw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBUbyBzdG9wIGNyZWF0aW5nIGVtcHR5IFN0cmluZ0J1ZmZlciBhdCB0aGUgZW5kIG9mIHBhcmFtZXRlciwKLSAgICAgICAgICAgICAgICAvLyB3ZSBkZWxheSBjcmVhdGluZyB0aGlzIG9iamVjdCB1bnRpbCB0aGlzIHBvaW50LgotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgf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ZXMgOywgXCwgZW5jb2RlcyAsCi0gICAgICoKLSAgICAgKiBOb3RlOiBBcHBsZSBlc2NhcGVzICc6JyBpbnRvICdcOicgd2hpbGUgZG9lcyBub3QgZXNjYXBlICdcJwotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHByb3RlY3RlZCBTdHJpbmcgbWF5YmVVbmVzY2FwZVRleHQoZmluYWwgU3RyaW5nIHRleHQpIHsKLSAgICAgICAgcmV0dXJuIHVuZXNjYXBlVGV4dCh0ZXh0KTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIFN0cmluZyB1bmVzY2FwZVRleHQoZmluYWwgU3RyaW5nIHRleHQpIHsKLSAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgZmluYWwgaW50IGxlbmd0aCA9IHRleHQubGVuZ3RoKCk7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgIGNoYXIgY2ggPSB0ZXh0LmNoYXJBdChpKTsKLSAgICAgICAgICAgIGlmIChjaCA9PSAnXFwnICYmIGkgPCBsZW5ndGggLSAxKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgY2hhciBuZXh0X2NoID0gdGV4dC5jaGFyQXQoKytpKTsKLSAgICAgICAgICAgICAgICBpZiAobmV4dF9jaCA9PSAnbicgfHwgbmV4dF9jaCA9PSAnTicpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIlxuIik7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobmV4dF9jaCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLS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XMgZGlmZmVyZW50IHR5cGUgb2YgdW5lc2NhcGluZyBydWxlCi0gICAgICAgIC8vICAgICAgIHRvd2FyZCBlYWNoIHByb3BlcnR5LgotICAgICAgICBmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBmaW5hbCBpbnQgbGVuZ3RoID0gdGV4dC5sZW5ndGgoKTsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgY2hhciBjaCA9IHRleHQuY2hhckF0KGkpOwotICAgICAgICAgICAgaWYgKGNoID09ICdcXCcgJiYgaSA8IGxlbmd0aCAtIDEpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBjaGFyIG5leHRfY2ggPSB0ZXh0LmNoYXJBdCgrK2kpOwotICAgICAgICAgICAgICAgIGlmIChuZXh0X2NoID09ICduJyB8fCBuZXh0X2NoID09ICdOJykgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXG4iKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChuZXh0X2NoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHVuZXNjYXBlQ2hhcmFjdGVyKGZpbmFsIGNoYXIgY2gpIHsKLSAgICAgICAgaWYgKGNoID09ICduJyB8fCBjaCA9PSAnTicpIHsKLSAgICAgICAgICAgIHJldHVybiAiXG4iOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIFN0cmluZy52YWx1ZU9mKG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Rk4iLCAiVElUTEUiLCAiU09VTkQiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJWRVJTSU9OIiwgIlRFTCIsICJFTUFJTCIsICJUWiIsICJHRU8iLCAiTk9URSIsICJVUkwiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJCREFZIiwgIlJPTEUiLCAiUkVWIiwgIlVJRCIsICJLRVkiLCAiTUFJTEVSIikpKTsKLQotICAgIC8qKgotICAgICAqIEEgdW5tb2RpZmlhYmxlIFNldCBzdG9yaW5nIHRoZSB0eXBlcyBrbm93biBpbiB2Q2FyZCAyLjEuCi0gICAgICovCi0gICAgLyogcGFja2FnZSAqLyBzdGF0aWMgZmluYWwgU2V0PFN0cmluZz4gc0tub3duVHlwZVNldCA9Ci0gICAgICAgICAgICBDb2xsZWN0aW9ucy51bm1vZGlmaWFibGVTZXQobmV3IEhhc2hTZXQ8U3RyaW5nPigKLSAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiRE9NIiwgIklOVEwiLCAiUE9TVEFMIiwgIlBBUkNFTCIsICJIT01FIiwgIldPUksiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQUkVGIiwgIlZPSUNFIiwgIkZBWCIsICJNU0ciLCAiQ0VMTCIsICJQQUdFUiIsICJCQlMiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJNT0RFTSIsICJDQVIiLCAiSVNETiIsICJWSURFTyIsICJBT0wiLCAiQVBQTEVMSU5LIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQVRUTUFJTCIsICJDSVMiLCAiRVdPUkxEIiwgIklOVEVSTkVUIiwgIklCTU1BSUwiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJNQ0lNQUlMIiwgIlBPV0VSU0hBUkUiLCAiUFJPRElHWSIsICJUTFgiLCAiWDQwMCIsICJHSUYiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDR00iLCAiV01GIiwgIkJNUCIsICJNRVQiLCA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24gdHlwZS4gUmV0dXJucyBTdHJpbmcgb2JqZWN0Ci0gICAgICogd2hlbiBub3QsIHdoaWNoIHNob3VsZCBiZSBzZXQgdG8gbGFiZWwuIAotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgT2JqZWN0IGdldFBob25lVHlwZUZyb21TdHJpbmdzKENvbGxlY3Rpb248U3RyaW5nPiB0eXBlcywKLSAgICAgICAgICAgIFN0cmluZyBudW1iZXIpIHsKLSAgICAgICAgaWYgKG51bWJlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICBudW1iZXIgPSAiIjsKLSAgICAgICAgfQotICAgICAgICBpbnQgdHlwZSA9IC0xOwotICAgICAgICBTdHJpbmcgbGFiZWwgPSBudWxsOwotICAgICAgICBib29sZWFuIGlzRmF4ID0gZmFsc2U7Ci0gICAgICAgIGJvb2xlYW4gaGFzUHJlZiA9IGZhbHNlOwotICAgICAgICAKLSAgICAgICAgaWYgKHR5cGVzICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlcykgewotICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnRvVXBwZXJDYXNlKCk7Ci0gICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfUFJFRikpIHsKLSAgICAgICAgICAgICAgICAgICAgaGFzUHJlZiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0ZBWCkpIHsKLSAgICAgICAgICAgICAgICAgICAgaXNGYXggPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nLnN0YXJ0c1dpdGgoIlgtIikgJiYgdHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnN1YnN0cmluZygyKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5sZW5ndGgoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIHRtcCA9IHNLbm93blBob25lVHlwZU1hcF9TdG9JLmdldCh0eXBlU3RyaW5nKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdHlwZUNhbmRpZGF0ZSA9IHRtcDsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRZUEVfUEFHRVIgaXMgcHJlZmVyZWQgd2hlbiB0aGUgbnVtYmVyIGNvbnRhaW5zIEAgc3Vycm9uZGVkIGJ5Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBhIHBhZ2VyIG51bWJlciBhbmQgYSBkb21haW4gbmFtZS4KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGUuZy4KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG8gMTExMUBkb21haW4uY29tCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB4IEBkb21haW4uY29tCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB4IDExMTFACi0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaW5kZXhPZkF0ID0gbnVtYmVyLmluZGV4T2YoIkAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodHlwZUNhbmRpZGF0ZSA9PSBQaG9uZS5UWVBFX1BBR0VSCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIDAgPCBpbmRleE9mQXQgJiYgaW5kZXhPZkF0IDwgbnVtYmVyLmxlbmd0aCgpIC0gMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdHlwZSA8IDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdHlwZSA9PSBQaG9uZS5UWVBFX0NVU1RPTSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSB0bXA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBQaG9uZS5UWVBFX0NVU1RPTTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdHlwZVN0cmluZzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgIGlmIChoYXNQcmVmKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IFBob25lLlRZUEVfTUFJTjsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gZGVmYXVsdCB0byBUWVBFX0hPTUUKLSAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9IT01FOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmIChpc0ZheCkgewotICAgICAgICAgICAgaWYgKHR5cGUgPT0gUGhvbmUuVFlQRV9IT01FKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IFBob25lLlRZUEVfRkFYX0hPTUU7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gUGhvbmUuVFlQRV9XT1JLKSB7Ci0gIC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9Db250YWN0c1NldC5jb250YWlucyhsYWJlbCk7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZ2V0UHJvcGVydHlOYW1lRm9ySW0oZmluYWwgaW50IHByb3RvY29sKSB7Ci0gICAgICAgIHJldHVybiBzS25vd25JbVByb3BOYW1lTWFwX0l0b1MuZ2V0KHByb3RvY29sKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIFN0cmluZ1tdIHNvcnROYW1lRWxlbWVudHMoZmluYWwgaW50IHZjYXJkVHlwZSwKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBmYW1pbHlOYW1lLCBmaW5hbCBTdHJpbmcgbWlkZGxlTmFtZSwgZmluYWwgU3RyaW5nIGdpdmVuTmFtZSkgewotICAgICAgICBmaW5hbCBTdHJpbmdbXSBsaXN0ID0gbmV3IFN0cmluZ1szXTsKLSAgICAgICAgZmluYWwgaW50IG5hbWVPcmRlclR5cGUgPSBWQ2FyZENvbmZpZy5nZXROYW1lT3JkZXJUeXBlKHZjYXJkVHlwZSk7Ci0gICAgICAgIHN3aXRjaCAobmFtZU9yZGVyVHlwZSkgewotICAgICAgICAgICAgY2FzZSBWQ2FyZENvbmZpZy5OQU1FX09SREVSX0pBUEFORVNFOiB7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5zT25seVByaW50YWJsZUFzY2lpKGZhbWlseU5hbWUpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250YWluc09ubHlQcmludGFibGVBc2NpaShnaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3RbMF0gPSBnaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3RbMV0gPSBtaWRkbGVOYW1lOwotICAgICAgICAgICAgICAgICAgICBsaXN0WzJdID0gZmFtaWx5TmFtZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBsaXN0WzBdID0gZmFtaWx5TmFtZTsKLSAgICAgICAgICAgICAgICAgICAgbGlzdFsxXSA9IG1pZGRsZU5hbWU7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3RbMl0gPSBnaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBWQ2FyZENvbmZpZy5OQU1FX09SREVSX0VVUk9QRTogewotICAgICAgICAgICAgICAgIGxpc3RbMF0gPSBtaWRkbGVOYW1lOwotICAgICAgICAgICAgICAgIGxpc3RbMV0gPSBnaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgbGlzdFsyXSA9IGZhbWlseU5hbWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkZWZhdWx0OiB7Ci0gICAgICAgICAgICAgICAgbGlzdFswXSA9IGdpdmVuTmFtZTsKLSAgICAgICAgICAgICAgICBsaXN0WzFdID0gbWlkZGxlTmFtZTsKLSAgICAgICAgICAgICAgICBsaXN0WzJdID0gZmFtaWx5TmFtZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gbGlzdDsKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIGludCBnZXRQaG9uZU51bWJlckZvcm1hdChmaW5hbCBpbnQgdmNhcmRUeXBlKSB7Ci0gICAgICAgIGlmIChWQ2FyZENvbmZpZy5pc0phcGFuZXNlRGV2aWNlKHZjYXJkVHlwZSkpIHsKLSAgICAgICAgICAgIHJldHVybiBQaG9uZU51bWJlclV0aWxzLkZPUk1BVF9KQVBBTjsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiBQaG9uZU51bWJlclV0aWxzLkZPUk1BVF9OQU5QOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogPHA+Ci0gICAg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otICAgICAgICB9Ci0KLSAgICAgICAgZmluYWwgU3RyaW5nIHN0cmVldFN0cmluZzsKLSAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHBvc3RhbERhdGEuc3RyZWV0KSkgewotICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHBvc3RhbERhdGEuZXh0ZW5kZWRBZGRyZXNzKSkgewotICAgICAgICAgICAgICAgIHN0cmVldFN0cmluZyA9IG51bGw7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHN0cmVldFN0cmluZyA9IHBvc3RhbERhdGEuZXh0ZW5kZWRBZGRyZXNzOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHBvc3RhbERhdGEuZXh0ZW5kZWRBZGRyZXNzKSkgewotICAgICAgICAgICAgICAgIHN0cmVldFN0cmluZyA9IHBvc3RhbERhdGEuc3RyZWV0OwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzdHJlZXRTdHJpbmcgPSBwb3N0YWxEYXRhLnN0cmVldCArICIgIiArIHBvc3RhbERhdGEuZXh0ZW5kZWRBZGRyZXNzOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKFN0cnVjdHVyZWRQb3N0YWwuUE9CT1gsIHBvc3RhbERhdGEucG9ib3gpOwotICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShTdHJ1Y3R1cmVkUG9zdGFsLlNUUkVFVCwgc3RyZWV0U3RyaW5nKTsKLSAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoU3RydWN0dXJlZFBvc3RhbC5DSVRZLCBwb3N0YWxEYXRhLmxvY2FsdHkpOwotICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShTdHJ1Y3R1cmVkUG9zdGFsLlJFR0lPTiwgcG9zdGFsRGF0YS5yZWdpb24p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aXZlbk5hbWUsCi0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgcHJlZml4LCBmaW5hbCBTdHJpbmcgc3VmZml4KSB7Ci0gICAgICAgIGZpbmFsIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgIGZpbmFsIFN0cmluZ1tdIG5hbWVMaXN0ID0gc29ydE5hbWVFbGVtZW50cyh2Y2FyZFR5cGUsIGZhbWlseU5hbWUsIG1pZGRsZU5hbWUsIGdpdmVuTmFtZSk7Ci0gICAgICAgIGJvb2xlYW4gZmlyc3QgPSB0cnVlOwotICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHByZWZpeCkpIHsKLSAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZChwcmVmaXgpOwotICAgICAgICB9Ci0gICAgICAgIGZvciAoZmluYWwgU3RyaW5nIG5hbWVQYXJ0IDogbmFtZUxpc3QpIHsKLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkobmFtZVBhcnQpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGZpcnN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyAnKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobmFtZVBhcnQpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoc3VmZml4KSkgewotICAgICAgICAgICAgaWYgKCFmaXJzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCcgJyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGV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KLSAgICAgICAgICAgICAgICAgICAgdW5lc2NhcGVkU3RyaW5nID0gVkNhcmRQYXJzZXJJbXBsX1Y0MC51bmVzY2FwZUNoYXJhY3RlcihuZXh0Q2gpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVkNhcmRDb25maWcuaXNWZXJzaW9uMzAodmNhcmRUeXBlKSkgewotICAgICAgICAgICAgICAgICAgICB1bmVzY2FwZWRTdHJpbmcgPSBWQ2FyZFBhcnNlckltcGxfVjMwLnVuZXNjYXBlQ2hhcmFjdGVyKG5leHRDaCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCFWQ2FyZENvbmZpZy5pc1ZlcnNpb24yMSh2Y2FyZFR5cGUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBVbmtub3duIHZDYXJkIHR5cGUKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJVbmtub3duIHZDYXJkIHR5cGUiKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB1bmVzY2FwZWRTdHJpbmcgPSBWQ2FyZFBhcnNlckltcGxfVjIxLnVuZXNjYXBlQ2hhcmFjdGVyKG5leHRDaCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHVuZXNjYXBlZFN0cmluZyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKHVuZXNjYXBlZFN0cmluZyk7Ci0gICAgICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnOycpIHsKLSAgICAgICAgICAgICAgICBsaXN0LmFkZChidWlsZGVyLnRvU3RyaW5nKCkpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgbGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgcmV0dXJuIGxpc3Q7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBib29sZWFuIGNvbnRhaW5zT25seVByaW50YWJsZUFzY2lpKGZpbmFsIFN0cmluZy4uLnZhbHVlcykgewotICAgICAgICBpZiAodmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBjb250YWluc09ubHlQcmludGFibGVBc2NpaShBcnJheXMuYXNMaXN0KHZhbHVlcykpOwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBjb250YWluc09ubHlQcmludGFibGVBc2NpaShmaW5hbCBDb2xsZWN0aW9uPFN0cmluZz4gdmFsdWVzKSB7Ci0gICAgICAgIGlmICh2YWx1ZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChmaW5hbCBTdHJpbmcgdmFsdWUgOiB2YWx1ZXMpIHsKLSAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZSkpIHsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzUHJpbnRhYmxlQXNjaWlPbmx5KHZhbHVlKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiA8cD4KLSAgICAgKiBUaGlzIGlzIHVzZWZ1bCB3aGVuIGNoZWNraW5nIHRoZSBzdHJpbmcgc2hvdWxkIGJlIGVuY29kZWQgaW50byBxdW90ZWQtcHJpbnRhYmxlCi0gICAgICogb3Igbm90LCB3aGljaCBpcyByZXF1aXJlZCBieSB2Q2FyZCAyLjEuCi0gICAgICogPC9wPgotICAgICAqIDxwPgotICAgICAqIFNlZSB0aGUgZGVmaW5pdGlvbiBvZiAiN2JpdCIgaW4gdkNhcmQgMi4xIHNwZWMgZm9yIG1vcmUgaW5mb3JtYXRpb24uCi0gICAgICogPC9wPgotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBjb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoZmluYWwgU3RyaW5nLi4udmFsdWVzKSB7Ci0gICAgICAgIGlmICh2YWx1ZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShBcnJheXMuYXNMaXN0KHZhbHVlcykpOwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBjb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoZmluYWwgQ29sbGVjdGlvbjxTdHJpbmc+IHZhbHVlcykgewotICAgICAgICBpZiAodmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIGZpbmFsIGludCBhc2NpaUZpcnN0ID0gMHgyMDsKLSAgICAgICAgZmluYWwgaW50IGFzY2lpTGFzdCA9IDB4N0U7ICAvLyBpbmNsdWRlZAotICAgICAgICBmb3IgKGZpbmFsIFN0cmluZyB2YWx1ZSA6IHZhbHVlcykgewotICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHZ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ICAgKiBAcmV0dXJuIFRoZSBpbWFnZSB0eXBlIG9yIG51bGwgd2hlbiB0aGUgdHlwZSBjYW5ub3QgYmUgZGV0ZXJtaW5lZC4KLSAgICAgKi8KLSAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBndWVzc0ltYWdlVHlwZShmaW5hbCBieXRlW10gaW5wdXQpIHsKLSAgICAgICAgaWYgKGlucHV0ID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9Ci0gICAgICAgIGlmIChpbnB1dC5sZW5ndGggPj0gMyAmJiBpbnB1dFswXSA9PSAnRycgJiYgaW5wdXRbMV0gPT0gJ0knICYmIGlucHV0WzJdID09ICdGJykgewotICAgICAgICAgICAgcmV0dXJuICJHSUYiOwotICAgICAgICB9IGVsc2UgaWYgKGlucHV0Lmxlbmd0aCA+PSA0ICYmIGlucHV0WzBdID09IChieXRlKSAweDg5Ci0gICAgICAgICAgICAgICAgJiYgaW5wdXRbMV0gPT0gJ1AnICYmIGlucHV0WzJdID09ICdOJyAmJiBpbnB1dFszXSA9PSAnRycpIHsKLSAgICAgICAgICAgIC8vIE5vdGU6IHZDYXJkIDIuMSBvZmZpY2lhbGx5IGRvZXMgbm90IHN1cHBvcnQgUE5HLCBidXQgd2UgbWF5IGhhdmUgaXQgYW5kCi0gICAgICAgICAgICAvLyAgICAgICB1c2luZyBYLSB3b3JkIGxpa2UgIlgtUE5HIiBtYXkgbm90IGxldCBpbXBvcnRlcnMga25vdyBpdCBpcyBQTkcuCi0gICAgICAgICAgICAvLyAgICAgICBTbyB3ZSB1c2UgdGhlIFN0cmluZyAiUE5HIiBhcyBpcy4uLgotICAgICAgICAgICAgcmV0dXJuICJQTkciOwotICAgICAgICB9IGVsc2UgaWYgKGlucHV0Lmxlbmd0aCA+PSAyICYmIGlucHV0WzBdID09IChieXRlKSAweGZmCi0gICAgICAgICAgICAgICAgJiYgaW5wdXRbMV0gPT0gKGJ5dGUpIDB4ZDgpIHsKLSAgICAgICAgICAgIHJldHVybiAiSlBFRyI7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIEByZXR1cm4gVHJ1ZSB3aGVuIGFsbCB0aGUgZ2l2ZW4gdmFsdWVzIGFyZSBudWxsIG9yIGVtcHR5IFN0cmluZ3MuCi0gICAgICovCi0gICAgcHVibGljIHN0YXRpYyBib29sZWFuIGFyZUFsbEVtcHR5KGZpbmFsIFN0cmluZy4uLnZhbHVlcykgewotICAgICAgICBpZiAodmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChmaW5hbCBTdHJpbmcgdmFsdWUgOiB2YWx1ZXMpIHsKLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0cnVlOwotICAgIH0KLQotICAgIC8vLy8gVGhlIG1ldGhvZHMgYmVsbG93IG1heSBiZSB1c2VkIGJ5IHVuaXQgdGVzdC4KLQotICAgIC8qKgotICAgICAqIFVucXVvdGVzIGdpdmVuIFF1b3RlZC1QcmludGFibGUgdmFsdWUuIHZhbHVlIG11c3Qgbm90IGJlIG51bGwuCi0gICAgICovCi0gICAgcHVibGljIHN0YXRpYyBTdHJpbmcgcGFyc2VRdW90ZWRQcmludGFibGUoCi0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgdmFsdWUsIGJvb2xlYW4gc3RyaWN0TGluZUJyZWFraW5nLAotICAgICAgICAgICAgU3RyaW5nIHNvdXJjZUNoYXJzZXQsIFN0cmluZyB0YXJnZXRDaGFyc2V0KSB7Ci0gICAgICAgIC8vICI9ICIgLT4gIiAiLCAiPVx0IiAtPiAiXHQiLgotICAgICAgICAvLyBQcmV2aW91cyBjb2RlIGhhZCBkb25lIHRoaXMgcmVwbGFjZW1lbnQuIEtlZXAgb24gdGhlIHNhZmUgc2lkZS4KLSAgICAgICAgZmluYWwgU3RyaW5nIHF1b3RlZFByaW50YWJsZTsKLSAgICAgICAgewotICAgICAgICAgICAgZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgIGZpbmFsIGludCBsZW5ndGggPSB2YWx1ZS5sZW5ndGgoKTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgICAgICBjaGFyIGNoID0gdmFsdWUuY2hhckF0KGkpOwotICAgICAgICAgICAgICAgIGlmIChjaCA9PSAnPScgJiYgaSA8IGxlbmd0aCAtIDEpIHsKLSAgICAgICAgICAgICAgICAgICAgY2hhciBuZXh0Q2ggPSB2YWx1ZS5jaGFyQXQoaSArIDEpOwotICAgICAgICAgICAgICAgICAgICBpZiAobmV4dENoID09ICcgJyB8fCBuZXh0Q2ggPT0gJ1x0JykgewotICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobmV4dENoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHF1b3RlZFByaW50YWJsZSA9IGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgfQotCi0gICAgICAgIFN0cmluZ1tdIGxpbmVzOwotICAgICAgICBpZiAoc3RyaWN0TGluZUJyZWFraW5nKSB7Ci0gICAgICAgICAgICBsaW5lcyA9IHF1b3RlZFByaW50YWJsZS5zcGxpdCgiXHJcbiIpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgIGZpbmFsIGludCBsZW5ndGggPSBxdW90ZWRQcmludGFibGUubGVuZ3RoKCk7Ci0gICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBsaXN0ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgY2hhciBjaCA9IHF1b3RlZFByaW50YWJsZS5jaGFyQXQoaSk7Ci0gICAgICAgICAgICAgICAgaWYgKGNoID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgbGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnXHInKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3QuYWRkKGJ1aWxkZXIudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICBpZiAoaSA8IGxlbmd0aCAtIDEpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgbmV4dENoID0gcXVvdGVkUHJpbnRhYmxlLmNoYXJBdChpICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dENoID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxhc3RMaW5lID0gYnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgaWYgKGxhc3RMaW5lLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgIGxpc3QuYWRkKGxhc3RMaW5lKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGxpbmVzID0gbGlzdC50b0FycmF5KG5ldyBTdHJpbmdbMF0pOwotICAgICAgICB9Ci0KLSAgICAgICAgZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgZm9yIChTdHJpbmcgbGluZSA6IGxpbmVzKSB7Ci0gICAgICAgICAgICBpZiAobGluZS5lbmRzV2l0aCgiPSIpKSB7Ci0gICAgICAgICAgICAgICAgbGluZSA9IGxpbmUuc3Vic3RyaW5nKDAsIGxpbmUubGVuZ3RoKCkgLSAxKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUpOwotICAgICAgICB9Ci0KLSAgICAgICAgZmluYWwgU3RyaW5nIHJhd1N0cmluZyA9IGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHJhd1N0cmluZykpIHsKLSAgICAgICAgICAgIExvZy53KExPR19UQUcsICJHaXZlbiByYXcgc3RyaW5nIGlzIGVtcHR5LiIpOwotICAgICAgICB9Ci0KLSAgICAgICAgYnl0ZVtdIHJhd0J5dGVzID0gbnVsbDsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJhd0J5dGVzID0gcmF3U3RyaW5nLmdldEJ5dGVzKHNvdXJjZUNoYXJzZXQpOyAKLSAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWR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VlbmNlW10gZW50cmllcykgeworICAgICAgICBtRW50cmllcyA9IGVudHJpZXM7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIEBzZWUgI3NldEVudHJpZXMoQ2hhclNlcXVlbmNlW10pCisgICAgICogQHBhcmFtIGVudHJpZXNSZXNJZCBUaGUgZW50cmllcyBhcnJheSBhcyBhIHJlc291cmNlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEVudHJpZXMoaW50IGVudHJpZXNSZXNJZCkgeworICAgICAgICBzZXRFbnRyaWVzKGdldENvbnRleHQoKS5nZXRSZXNvdXJjZXMoKS5nZXRUZXh0QXJyYXkoZW50cmllc1Jlc0lkKSk7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFRoZSBsaXN0IG9mIGVudHJpZXMgdG8gYmUgc2hvd24gaW4gdGhlIGxpc3QgaW4gc3Vic2VxdWVudCBkaWFsb2dzLgorICAgICAqIAorICAgICAqIEByZXR1cm4gVGhlIGxpc3QgYXMgYW4gYXJyYXkuCisgICAgICovCisgICAgcHVibGljIENoYXJTZXF1ZW5jZVtdIGdldEVudHJpZXMoKSB7CisgICAgICAgIHJldHVybiBtRW50cmllczsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogVGhlIGFycmF5IHRvIGZpbmQgdGhlIHZhbHVlIHRvIHNhdmUgZm9yIGEgcHJlZmVyZW5jZSB3aGVuIGFuIGVudHJ5IGZyb20KKyAgICAgKiBlbnRyaWVzIGlzIHNlbGVjdGVkLiBJZiBhIHVzZXIgY2xpY2tzIG9uIHRoZSBzZWNvbmQgaXRlbSBpbiBlbnRyaWVzLCB0aGUKKyAgICAgKiBzZWNvbmQgaXRlbSBpbiB0aGlzIGFycmF5IHdpbGwgYmUgc2F2ZWQgdG8gdGhlIHByZWZlcmVuY2UuCisgICAgICogCisgICAgICogQHBhcmFtIGVudHJ5VmFsdWVzIFRoZSBhcnJheSB0byBiZSB1c2VkIGFzIHZhbHVlcyB0byBzYXZlIGZvci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ZhbHVlcyhTZXQ8U3RyaW5nPiB2YWx1ZXMpIHsKKyAgICAgICAgbVZhbHVlcyA9IHZhbHVlczsKKyAgICAgICAgCisgICAgICAgIHBlcnNpc3RTdHJpbmdTZXQodmFsdWVzKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogUmV0cmlldmVzIHRoZSBjdXJyZW50IHZhbHVlIG9mIHRoZSBrZXkuCisgICAgICovCisgICAgcHVibGljIFNldDxTdHJpbmc+IGdldFZhbHVlcygpIHsKKyAgICAgICAgcmV0dXJuIG1WYWx1ZXM7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGluZGV4IG9mIHRoZSBnaXZlbiB2YWx1ZSAoaW4gdGhlIGVudHJ5IHZhbHVlcyBhcnJheSkuCisgICAgICogCisgICAgICogQHBhcmFtIHZhbHVlIFRoZSB2YWx1ZSB3aG9zZSBpbmRleCBzaG91bGQgYmUgcmV0dXJuZWQuCisgICAgICogQHJldHVybiBUaGUgaW5kZXggb2YgdGhlIHZhbHVlLCBvciAtMSBpZiBub3QgZm91bmQuCisgICAgICovCisgICAgcHVibGljIGludCBmaW5kSW5kZXhPZlZhbHVlKFN0cmluZyB2YWx1ZSkgeworICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCAmJiBtRW50cnlWYWx1ZXMgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1FbnRyeVZhbHVlcy5sZW5ndGggLSAxOyBpID49IDA7IGktLSkgeworICAgICAgICAgICAgICAgIGlmIChtRW50cnlWYWx1ZXNbaV0uZXF1YWxzKHZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvblByZXBhcmVEaWFsb2dCdWlsZGVyKEJ1aWxkZXIgYnVpbGRlcikgeworICAgICAgICBzdXBlci5vblByZXBhcmVEaWFsb2dCdWlsZGVyKGJ1aWxkZXIpOworICAgICAgICAKKyAgICAgICAgaWYgKG1FbnRyaWVzID09IG51bGwgfHwgbUVudHJ5VmFsdWVzID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJNdWx0aVNlbGVjdExpc3RQcmVmZXJlbmNlIHJlcXVpcmVzIGFuIGVudHJpZXMgYXJyYXkgYW5kICIgKworICAgICAgICAgICAgICAgICAgICAiYW4gZW50cnlWYWx1ZXMgYXJyYXkuIik7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGJvb2xlYW5bXSBjaGVja2VkSXRlbXMgPSBnZXRTZWxlY3RlZEl0ZW1zKCk7CisgICAgICAgIGJ1aWxkZXIuc2V0TXVsdGlDaG9pY2VJdGVtcyhtRW50cmllcywgY2hlY2tlZEl0ZW1zLAorICAgICAgICAgICAgICAgIG5ldyBEaWFsb2dJbnRlcmZhY2UuT25NdWx0aUNob2ljZUNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soRGlhbG9nSW50ZXJmYWNlIGRpYWxvZywgaW50IHdoaWNoLCBib29sZWFuIGlzQ2hlY2tlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzQ2hlY2tlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmVmZXJlbmNlQ2hhbmdlZCB8PSBtTmV3VmFsdWVzLmFkZChtRW50cmllc1t3aGljaF0udG9TdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmVmZXJlbmNlQ2hhbmdlZCB8PSBtTmV3VmFsdWVzLnJlbW92ZShtRW50cmllc1t3aGljaF0udG9TdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgbU5ld1ZhbHVlcy5jbGVhcigpOworICAgICAgICBtTmV3VmFsdWVzLmFkZEFsbChtVmFsdWVzKTsKKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBib29sZWFuW10gZ2V0U2VsZWN0ZWRJdGVtcygpIHsKKyAgICAgICAgZmluYWwgQ2hhclNlcXVlbmNlW10gZW50cmllcyA9IG1FbnRyaWVzOworICAgICAgICBmaW5hbCBpbnQgZW50cnlDb3VudCA9IGVudHJpZXMubGVuZ3RoOworICAgICAgICBmaW5hbCBTZXQ8U3RyaW5nPiB2YWx1ZXMgPSBtVmFsdWVzOworICAgICAgICBib29sZWFuW10gcmVzdWx0ID0gbmV3IGJvb2xlYW5bZW50cnlDb3VudF07CisgICAgICAgIAorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGVudHJ5Q291bnQ7IGkrKykgeworICAgICAgICAgICAgcmVzdWx0W2ldID0gdmFsdWVzLmNvbnRhaW5zKGVudHJpZXNbaV0udG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorICAgIAorICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uRGlhbG9nQ2xvc2VkKGJvb2xlYW4gcG9zaXRpdmVSZXN1bHQpIHsKKyAgICAgICAgc3VwZXIub25EaWFsb2dDbG9zZWQocG9zaXRpdmVSZXN1bHQpOworICAgICAgICAKKyAgICAgICAgaWYgKHBvc2l0aXZlUmVzdWx0ICYmIG1QcmVmZXJlbmNlQ2hhbmdlZCkgeworICAgICAgICAgICAgZmluYWwgU2V0PFN0cmluZz4gdmFsdWVzID0gbU5ld1ZhbHVlczsKKyAgICAgICAgICAgIGlmIChjYWxsQ2hhbmdlTG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vciBYTUwuCisgICAgICovCisgICAgcHVibGljIFN0cmluZyBnZXRGcmFnbWVudCgpIHsKKyAgICAgICAgcmV0dXJuIG1GcmFnbWVudDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIGV4dHJhcyBCdW5kbGUgb2JqZWN0IGFzc29jaWF0ZWQgd2l0aCB0aGlzIHByZWZlcmVuY2UsIGNyZWF0aW5nCisgICAgICogYSBuZXcgQnVuZGxlIGlmIHRoZXJlIGN1cnJlbnRseSBpc24ndCBvbmUuICBZb3UgY2FuIHVzZSB0aGlzIHRvIGdldCBhbmQKKyAgICAgKiBzZXQgaW5kaXZpZHVhbCBleHRyYSBrZXkvdmFsdWUgcGFpcnMuCisgICAgICovCisgICAgcHVibGljIEJ1bmRsZSBnZXRFeHRyYXMoKSB7CisgICAgICAgIGlmIChtRXh0cmFzID09IG51bGwpIHsKKyAgICAgICAgICAgIG1FeHRyYXMgPSBuZXcgQnVuZGxlKCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1FeHRyYXM7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJuIHRoZSBleHRyYXMgQnVuZGxlIG9iamVjdCBhc3NvY2lhdGVkIHdpdGggdGhpcyBwcmVmZXJlbmNlLAorICAgICAqIHJldHVybmluZyBudWxsIGlmIHRoZXJlIGlzIG5vdCBjdXJyZW50bHkgb25lLgorICAgICAqLworICAgIHB1YmxpYyBCdW5kbGUgcGVla0V4dHJhcygpIHsKKyAgICAgICAgcmV0dXJuIG1FeHRyYXM7CisgICAgfQorCisgICAgLyoqCiAgICAgICogU2V0cyB0aGUgbGF5b3V0IHJlc291cmNlIHRoYXQgaXMgaW5mbGF0ZWQgYXMgdGhlIHtAbGluayBWaWV3fSB0byBiZSBzaG93bgogICAgICAqIGZvciB0aGlzIFByZWZlcmVuY2UuIEluIG1vc3QgY2FzZXMsIHRoZSBkZWZhdWx0IGxheW91dCBpcyBzdWZmaWNpZW50IGZvcgogIC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HZhbHVlcykgeworICAgICAgICBpZiAoc2hvdWxkUGVyc2lzdCgpKSB7CisgICAgICAgICAgICAvLyBTaG91bGRuJ3Qgc3RvcmUgbnVsbAorICAgICAgICAgICAgaWYgKHZhbHVlcy5lcXVhbHMoZ2V0UGVyc2lzdGVkU3RyaW5nU2V0KG51bGwpKSkgeworICAgICAgICAgICAgICAgIC8vIEl0J3MgYWxyZWFkeSB0aGVyZSwgc28gdGhlIHNhbWUgYXMgcGVyc2lzdGluZworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBTaGFyZWRQcmVmZXJlbmNlcy5FZGl0b3IgZWRpdG9yID0gbVByZWZlcmVuY2VNYW5hZ2VyLmdldEVkaXRvcigpOworICAgICAgICAgICAgZWRpdG9yLnB1dFN0cmluZ1NldChtS2V5LCB2YWx1ZXMpOworICAgICAgICAgICAgdHJ5Q29tbWl0KGVkaXRvcik7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogQXR0ZW1wdHMgdG8gZ2V0IGEgcGVyc2lzdGVkIHNldCBvZiBTdHJpbmdzIGZyb20gdGhlCisgICAgICoge0BsaW5rIGFuZHJvaWQuY29udGVudC5TaGFyZWRQcmVmZXJlbmNlc30uCisgICAgICogPHA+CisgICAgICogVGhpcyB3aWxsIGNoZWNrIGlmIHRoaXMgUHJlZmVyZW5jZSBpcyBwZXJzaXN0ZW50LCBnZXQgdGhlIFNoYXJlZFByZWZlcmVuY2VzCisgICAgICogZnJvbSB0aGUge0BsaW5rIFByZWZlcmVuY2VNYW5hZ2VyfSwgYW5kIGdldCB0aGUgdmFsdWUuCisgICAgICogCisgICAgICogQHBhcmFtIGRlZmF1bHRSZXR1cm5WYWx1ZSBUaGUgZGVmYXVsdCB2YWx1ZSB0byByZXR1cm4gaWYgZWl0aGVyI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ICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgY2FzZSBNU0dfQklORF9QUkVGRVJFTkNFUzoKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19CSU5EX1BSRUZFUkVOQ0VTOiB7CiAgICAgICAgICAgICAgICAgICAgIGJpbmRQcmVmZXJlbmNlcygpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0JVSUxEX0hFQURFUlM6IHsKKyAgICAgICAgICAgICAgICAgICAgQXJyYXlMaXN0PEhlYWRlcj4gb2xkSGVhZGVycyA9IG5ldyBBcnJheUxpc3Q8SGVhZGVyPihtSGVhZGVycyk7CisgICAgICAgICAgICAgICAgICAgIG1IZWFkZXJzLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgIG9uQnVpbGRIZWFkZXJzKG1IZWFkZXJzKTsKKyAgICAgICAgICAgICAgICAgICAgbUFkYXB0ZXIubm90aWZ5RGF0YVNldENoYW5nZWQoKTsKKyAgICAgICAgICAgICAgICAgICAgSGVhZGVyIGhlYWRlciA9IG9uR2V0TmV3SGVhZGVyKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChoZWFkZXIgIT0gbnVsbCAmJiBoZWFkZXIuZnJhZ21lbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgSGVhZGVyIG1hcHBlZEhlYWRlciA9IGZpbmRCZXN0TWF0Y2hpbmdIZWFkZXIoaGVhZGVyLCBvbGRIZWFkZXJzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXBwZWRIZWFkZXIgPT0gbnVsbCB8fCBtQ3VySGVhZGVyICE9IG1hcHBlZEhlYWRlcikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaFRvSGVhZGVyKGhlYWRlcik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobUN1ckhlYWRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBIZWFkZXIgbWFwcGVkSGVhZGVyID0gZmluZEJlc3RNYXRjaGluZ0hlYWRlcihtQ3VySGVhZGVyLCBtSGVhZGVycyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFwcGVkSGVhZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTZWxlY3RlZEhlYWRlcihtYXBwZWRIZWFkZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hUb0hlYWRlcihudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gYnJlYWs7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9OwogCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgSGVhZGVyQWRhcHRlciBleHRlbmRzIEFycmF5QWRhcHRlcjxIZWFkZXI+IHsKKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgSGVhZGVyVmlld0hvbGRlciB7CisgICAgICAgICAgICBJbWFnZVZpZXcgaWNvbjsKKyAgICAgICAgICAgIFRleHRWaWV3IHRpdGxlOworICAgICAgICAgICAgVGV4dFZpZXcgc3VtbWFyeTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgTGF5b3V0SW5mbGF0ZXIgbUluZmxhdGVyOworCisgICAgICAgIHB1YmxpYyBIZWFkZXJBZGFwdGVyKENvbnRleHQgY29udGV4dCwgTGlzdDxIZWFkZXI+IG9iamVjdHMpIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIDAsIG9iamVjdHMpOworICAgICAgICAgICAgbUluZmxhdGVyID0gKExheW91dEluZmxhdGVyKWNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LkxBWU9VVF9JTkZMQVRFUl9TRVJWSUNFKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgVmlldyBnZXRWaWV3KGludCBwb3NpdGlvbiwgVmlldyBjb252ZXJ0VmlldywgVmlld0dyb3VwIHBhcmVudCkgeworICAgICAgICAgICAgSGVhZGVyVmlld0hvbGRlciBob2xkZXI7CisgICAgICAgICAgICBWaWV3IHZpZXc7CisKKyAgICAgICAgICAgIGlmIChjb252ZXJ0VmlldyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdmlldyA9IG1JbmZsYXRlci5pbmZsYXRlKGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0LnByZWZlcmVuY2VfaGVhZGVyX2l0ZW0sCisgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBob2xkZXIgPSBuZXcgSGVhZGVyVmlld0hvbGRlcigpOworICAgICAgICAgICAgICAgIGhvbGRlci5pY29uID0gKEltYWdlVmlldykgdmlldy5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5pY29uKTsKKyAgICAgICAgICAgICAgICBob2xkZXIudGl0bGUgPSAoVGV4dFZpZXcpIHZpZXcuZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQudGl0bGUpOworICAgICAgICAgICAgICAgIGhvbGRlci5zdW1tYXJ5ID0gKFRleHRWaWV3KSB2aWV3LmZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnN1bW1hcnkpOworICAgICAgICAgICAgICAgIHZpZXcuc2V0VGFnKGhvbGRlcik7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHZpZXcgPSBjb252ZXJ0VmlldzsKKyAgICAgICAgICAgICAgICBob2xkZXIgPSAoSGVhZGVyVmlld0hvbGRlcikgdmlldy5nZXRUYWcoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gQWxsIHZpZXcgZmllbGRzIG11c3QgYmUgdXBkYXRlZCBldmVyeSB0aW1lLCBiZWNhdXNlIHRoZSB2aWV3IG1heSBiZSByZWN5Y2xlZCAKKyAgICAgICAgICAgIEhlYWRlciBoZWFkZXIgPSBnZXRJdGVtKHBvc2l0aW9uKTsKKyAgICAgICAgICAgIGhvbGRlci5pY29uLnNldEltYWdlUmVzb3VyY2UoaGVhZGVyLmljb25SZXMpOworICAgICAgICAgICAgaG9sZGVyLnRpdGxlLnNldFRleHQoaGVhZGVyLnRpdGxlKTsKKyAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShoZWFkZXIuc3VtbWFyeSkpIHsKKyAgICAgICAgICAgICAgICBob2xkZXIuc3VtbWFyeS5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGhvbGRlci5zdW1tYXJ5LnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgICAgICBob2xkZXIuc3VtbWFyeS5zZXRUZXh0KGhlYWRlci5zdW1tYXJ5KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHZpZXc7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBEZWZhdWx0IHZhbHVlIGZvciB7QGxpbmsgSGVhZGVyI2lkIEhlYWRlci5pZH0gaW5kaWNhdGluZyB0aGF0IG5vCisgICAgICogaWRlbnRpZmllciB2YWx1ZSBpcyBzZXQuICBBbGwgb3RoZXIgdmFsdWVzIChpbmNsdWRpbmcgdGhvc2UgYmVsb3cgLTEpCisgICAgICogYXJlIHZhbGlkLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgbG9uZyBIRUFERVJfSURfVU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ICAgICAgKi8KKyAgICAgICAgcHVibGljIENoYXJTZXF1ZW5jZSBzdW1tYXJ5OworCisgICAgICAgIC8qKgorICAgICAgICAgKiBPcHRpb25hbCB0ZXh0IHRvIHNob3cgYXMgdGhlIHRpdGxlIGluIHRoZSBicmVhZCBjcnVtYi4KKyAgICAgICAgICogQGF0dHIgcmVmIGFuZHJvaWQuUi5zdHlsZWFibGUjUHJlZmVyZW5jZUhlYWRlcl9icmVhZENydW1iVGl0bGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgYnJlYWRDcnVtYlRpdGxlOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBPcHRpb25hbCB0ZXh0IHRvIHNob3cgYXMgdGhlIHNob3J0IHRpdGxlIGluIHRoZSBicmVhZCBjcnVtYi4KKyAgICAgICAgICogQGF0dHIgcmVmIGFuZHJvaWQuUi5zdHlsZWFibGUjUHJlZmVyZW5jZUhlYWRlcl9icmVhZENydW1iU2hvcnRUaXRsZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIENoYXJTZXF1ZW5jZSBicmVhZENydW1iU2hvcnRUaXRsZTsKKworICAgICAgICAvKioKKyAgICAgICAgICogT3B0aW9uYWwgaWNvbiByZXNvdXJjZSB0byBzaG93IGZvciB0aGlzIGhlYWRlci4KKyAgICAgICAgICogQGF0dHIgcmVmIGFuZHJvaWQuUi5zdHlsZWFibGUjUHJlZmVyZW5jZUhlYWRlcl9pY29uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGljb25SZXM7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEZ1bGwgY2xhc3MgbmFtZSBvZiB0aGUgZnJhZ21lbnQgdG8gZGlzcGxheSB3aGVuIHRoaXMgaGVhZGVyIGlzCisgICAgICAgICAqIHNlbGVjdGVkLgorICAgICAgICAgKiBAYXR0ciByZWYgYW5kcm9pZC5SLnN0eWxlYWJsZSNQcmVmZXJlbmNlSGVhZGVyX2ZyYWdtZW50CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgU3RyaW5nIGZyYWdtZW50OworCisgICAgICAgIC8qKgorICAgICAgICAgKiBPcHRpb25hbCBhcmd1bWVudHMgdG8gc3VwcGx5IHRvIHRoZSBmcmFnbWVudCB3aGVuIGl0IGlzCisgICAgICAgICAqIGluc3RhbnRpYXRlZC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBCdW5kbGUgZnJhZ21lbnRBcmd1bWVudHM7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEludGVudCB0byBsYXVuY2ggd2hlbiB0aGUgcHJlZmVyZW5jZSBpcyBzZWxlY3RlZC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBJbnRlbnQgaW50ZW50OworCisgICAgICAgIC8qKgorICAgICAgICAgKiBPcHRpb25hbCBhZGRpdGlvbmFsIGRhdGEgZm9yIHVzZSBieSBzdWJjbGFzc2VzIG9mIFByZWZlcmVuY2VBY3Rpdml0eS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBCdW5kbGUgZXh0cmFzOworCisgICAgICAgIHB1YmxpYyBIZWFkZXIoKSB7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGludCBkZXNjcmliZUNvbnRlbnRzKCkgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgICAgICBkZXN0LndyaXRlTG9uZyhpZCk7CisgICAgICAgICAgICBUZXh0VXRpbHMud3JpdGVUb1BhcmNlbCh0aXRsZSwgZGVzdCwgZmxhZ3MpOworICAgICAgICAgICAgVGV4dFV0aWxzLndyaXRlVG9QYXJjZWwoc3VtbWFyeSwgZGVzdCwgZmxhZ3MpOworICAgICAgICAgICAgVGV4dFV0aWxzLndyaXRlVG9QYXJjZWwoYnJlYWRDcnVtYlRpdGxlLCBkZXN0LCBmbGFncyk7CisgICAgICAgICAgICBUZXh0VXRpbHMud3JpdGVUb1BhcmNlbChicmVhZENydW1iU2hvcnRUaXRsZSwgZGVzdCwgZmxhZ3MpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChpY29uUmVzKTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcoZnJhZ21lbnQpOworICAgICAgICAgICAgZGVzdC53cml0ZUJ1bmRsZShmcmFnbWVudEFyZ3VtZW50cyk7CisgICAgICAgICAgICBpZiAoaW50ZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBkZXN0LndyaXRlSW50KDEpOworICAgICAgICAgICAgICAgIGludGVudC53cml0ZVRvUGFyY2VsKGRlc3QsIGZsYWdzKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZGVzdC53cml0ZUludCgwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGRlc3Qud3JpdGVCdW5kbGUoZXh0cmFzKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHJlYWRGcm9tUGFyY2VsKFBhcmNlbCBpbikgeworICAgICAgICAgICAgaWQgPSBpbi5yZWFkTG9uZygpOworICAgICAgICAgICAgdGl0bGUgPSBUZXh0VXRpbHMuQ0hBUl9TRVFVRU5DRV9DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoaW4pOworICAgICAgICAgICAgc3VtbWFyeSA9IFRleHRVdGlscy5DSEFSX1NFUVVFTkNFX0NSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChpbik7CisgICAgICAgICAgICBicmVhZENydW1iVGl0bGUgPSBUZXh0VXRpbHMuQ0hBUl9TRVFVRU5DRV9DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoaW4pOworICAgICAgICAgICAgYnJlYWRDcnVtYlNob3J0VGl0bGUgPSBUZXh0VXRpbHMuQ0hBUl9TRVFVRU5DRV9DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoaW4pOworICAgICAgICAgICAgaWNvblJlcyA9IGluLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIGZyYWdtZW50ID0gaW4ucmVhZFN0cmluZygpOworICAgICAgICAgICAgZnJhZ21lbnRBcmd1bWVudHMgPSBpbi5yZWFkQnVuZGxlKCk7CisgICAgICAgICAgICBpZiAoaW4ucmVhZEludCgpICE9IDApIHsKKyAgICAgICAgICAgICAgICBpbnRlbnQgPSBJbnRlbnQuQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKGluKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGV4dHJhcyA9IGluLnJlYWRCdW5kbGUoKTsKKyAgICAgICAgfQorCisgICAgICAgIEhlYWRlcihQYXJjZWwgaW4pIHsKKyAgICAgICAgICAgIHJlYWRGcm9tUGFyY2VsKGluKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgQ3JlYXRvcjxIZWFkZXI+IENSRUFUT1IgPSBuZXcgQ3JlYXRvcjxIZWFkZXI+KCkgeworICAgICAgICAgICAgcHVibGljIEhlYWRlciBjcmVhdGVGcm9tUGFyY2VsKFBhcmNlbCBzb3VyY2UpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEhlYWRlcihzb3VyY2UpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcHVibGljIEhlYWRlcltdIG5ld0FycmF5KGludCBzaXplKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBIZWFkZXJbc2l6ZV07CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfQorCiAgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIHZvaWQgb25DcmVhdGUoQnVuZGxlIHNhdmVkSW5zdGFuY2VTdGF0ZSkgewogICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUpO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PSBzYXZlZEluc3RhbmNlU3RhdGUuZ2V0UGFyY2VsYWJsZUFycmF5TGlzdChIRUFERVJTX1RBRyk7CisgICAgICAgICAgICBpZiAoaGVhZGVycyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUhlYWRlcnMuYWRkQWxsKGhlYWRlcnMpOworICAgICAgICAgICAgICAgIGludCBjdXJIZWFkZXIgPSBzYXZlZEluc3RhbmNlU3RhdGUuZ2V0SW50KENVUl9IRUFERVJfVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgKGludClIRUFERVJfSURfVU5ERUZJTkVEKTsKKyAgICAgICAgICAgICAgICBpZiAoY3VySGVhZGVyID49IDAgJiYgY3VySGVhZGVyIDwgbUhlYWRlcnMuc2l6ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIHNldFNlbGVjdGVkSGVhZGVyKG1IZWFkZXJzLmdldChjdXJIZWFkZXIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGlmIChpbml0aWFsRnJhZ21lbnQgIT0gbnVsbCAmJiBtU2luZ2xlUGFuZSkgeworICAgICAgICAgICAgICAgIC8vIElmIHdlIGFyZSBqdXN0IHNob3dpbmcgYSBmcmFnbWVudCwgd2Ugd2FudCB0byBydW4gaW4KKyAgICAgICAgICAgICAgICAvLyBuZXcgZnJhZ21lbnQgbW9kZSwgYnV0IGRvbid0IG5lZWQgdG8gY29tcHV0ZSBhbmQgc2hvdworICAgICAgICAgICAgICAgIC8vIHRoZSBoZWFkZXJzLgorICAgICAgICAgICAgICAgIHN3aXRjaFRvSGVhZGVyKGluaXRpYWxGcmFnbWVudCwgaW5pdGlhbEFyZ3VtZW50cyk7CisKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gV2UgbmVlZCB0byB0cnkgdG8gYnVpbGQgdGhlIGhlYWRlcnMuCisgICAgICAgICAgICAgICAgb25CdWlsZEhlYWRlcnMobUhlYWRlcnMpOworCisgICAgICAgICAgICAgICAgLy8gSWYgdGhlcmUgYXJlIGhlYWRlcnMsIHRoZW4gYXQgdGhpcyBwb2ludCB3ZSBuZWVkIHRvIHNob3cKKyAgICAgICAgICAgICAgICAvLyB0aGVtIGFuZCwgZGVwZW5kaW5nIG9uIHRoZSBzY3JlZW4sIHdlIG1heSBhbHNvIHNob3cgaW4tbGluZQorICAgICAgICAgICAgICAgIC8vIHRoZSBjdXJyZW50bHkgc2VsZWN0ZWQgcHJlZmVyZW5jZSBmcmFnbWVudC4KKyAgICAgICAgICAgICAgICBpZiAobUhlYWRlcnMuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIW1TaW5nbGVQYW5lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5pdGlhbEZyYWdtZW50ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBIZWFkZXIgaCA9IG9uR2V0SW5pdGlhbEhlYWRlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaFRvSGVhZGVyKGgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hUb0hlYWRlcihpbml0aWFsRnJhZ21lbnQsIGluaXRpYWxBcmd1bWVudHMpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gVGhlIGRlZmF1bHQgY29uZmlndXJhdGlvbiBpcyB0byBvbmx5IHNob3cgdGhlIGxpc3Qgdmlldy4gIEFkanVzdAorICAgICAgICAvLyB2aXNpYmlsaXR5IGZvciBvdGhlciBjb25maWd1cmF0aW9ucy4KKyAgICAgICAgaWYgKGluaXRpYWxGcmFnbWVudCAhPSBudWxsICYmIG1TaW5nbGVQYW5lKSB7CisgICAgICAgICAgICAvLyBTaW5nbGUgcGFuZSwgc2hvd2luZyBqdXN0IGEgcHJlZnMgZnJhZ21lbnQuCisgICAgICAgICAgICBmaW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5oZWFkZXJzKS5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICBtUHJlZnNDb250YWluZXIuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICB9IGVsc2UgaWYgKG1IZWFkZXJzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIG1BZGFwdGVyID0gbmV3IEhlYWRlckFkYXB0ZXIodGhpcywgbUhlYWRlcnMpOworICAgICAgICAgICAgc2V0TGlzdEFkYXB0ZXIobUFkYXB0ZXIpOworICAgICAgICAgICAgaWYgKCFtU2luZ2xlUGFuZSkgeworICAgICAgICAgICAgICAgIC8vIE11bHRpLXBhbmUuCisgICAgICAgICAgICAgICAgZ2V0TGlzdFZpZXcoKS5zZXRDaG9pY2VNb2RlKEFic0xpc3RWaWV3LkNIT0lDRV9NT0RFX1NJTkdMRSk7CisgICAgICAgICAgICAgICAgaWYgKG1DdXJIZWFkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBzZXRTZWxlY3RlZEhlYWRlcihtQ3VySGVhZGVyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVByZWZzQ29udGFpbmVyLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIElmIHRoZXJlIGFyZSBubyBoZWFkZXJzLCB3ZSBhcmUgaW4gdGhlIG9sZCAianVzdCBzaG93IGEgc2NyZWVuCisgICAgICAgICAgICAvLyBvZiBwcmVmZXJlbmNlcyIgbW9kZS4KKyAgICAgICAgICAgIG1QcmVmZXJlbmNlTWFuYWdlciA9I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V3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnNraXBfYnV0dG9uKTsKKyAgICAgICAgICAgIHNraXBCdXR0b24uc2V0T25DbGlja0xpc3RlbmVyKG5ldyBPbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKKyAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KFJFU1VMVF9PSyk7CisgICAgICAgICAgICAgICAgICAgIGZpbmlzaCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgbU5leHRCdXR0b24gPSAoQnV0dG9uKWZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLm5leHRfYnV0dG9uKTsKKyAgICAgICAgICAgIG1OZXh0QnV0dG9uLnNldE9uQ2xpY2tMaXN0ZW5lcihuZXcgT25DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChSRVNVTFRfT0spOworICAgICAgICAgICAgICAgICAgICBmaW5pc2goKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgLy8gc2V0IG91ciB2YXJpb3VzIGJ1dHRvbiBwYXJhbWV0ZXJzCisgICAgICAgICAgICBpZiAoaW50ZW50Lmhhc0V4dHJhKEVYVFJBX1BSRUZTX1NFVF9ORVhUX1RFWFQpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGJ1dHRvblRleHQgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoRVhUUkFfUFJFRlNfU0VUX05FWFRfVEVYVCk7CisgICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGJ1dHRvblRleHQpKSB7CisgICAgICAgICAgICAgICAgICAgIG1OZXh0QnV0dG9uLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1OZXh0QnV0dG9uLnNldFRleHQoYnV0dG9uVGV4dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGludGVudC5oYXNFeHRyYShFWFRSQV9QUkVGU19TRVRfQkFDS19URVhUKSkgeworICAgICAgICAgICAgICAgIFN0cmluZyBidXR0b25UZXh0ID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKEVYVFJBX1BSRUZTX1NFVF9CQUNLX1RFWFQpOworICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShidXR0b25UZXh0KSkgeworICAgICAgICAgICAgICAgICAgICBiYWNrQnV0dG9uLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGJhY2tCdXR0b24uc2V0VGV4dChidXR0b25UZXh0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoaW50ZW50LmdldEJvb2xlYW5FeHRyYShFWFRSQV9QUkVGU19TSE9XX1NLSVAsIGZhbHNlKSkgeworICAgICAgICAgICAgICAgIHNraXBCdXR0b24uc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0cnVlIGlmIHRoaXMgYWN0aXZpdHkgaXMgY3VycmVudGx5IHNob3dpbmcgdGhlIGhlYWRlciBsaXN0LgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGhhc0hlYWRlcnMoKSB7CisgICAgICAgIHJldHVybiBnZXRMaXN0VmlldygpLmdldFZpc2liaWxpdHkoKSA9PSBW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9IRUFERVJTKSkgeworICAgICAgICAgICAgbUhhbmRsZXIuc2VuZEVtcHR5TWVzc2FnZShNU0dfQlVJTERfSEVBREVSUyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBQYXJzZSB0aGUgZ2l2ZW4gWE1MIGZpbGUgYXMgYSBoZWFkZXIgZGVzY3JpcHRpb24sIGFkZGluZyBlYWNoCisgICAgICogcGFyc2VkIEhlYWRlciBpbnRvIHRoZSB0YXJnZXQgbGlzdC4KKyAgICAgKgorICAgICAqIEBwYXJhbSByZXNpZCBUaGUgWE1MIHJlc291cmNlIHRvIGxvYWQgYW5kIHBhcnNlLgorICAgICAqIEBwYXJhbSB0YXJnZXQgVGhlIGxpc3QgaW4gd2hpY2ggdGhlIHBhcnNlZCBoZWFkZXJzIHNob3VsZCBiZSBwbGFjZWQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgbG9hZEhlYWRlcnNGcm9tUmVzb3VyY2UoaW50IHJlc2lkLCBMaXN0PEhlYWRlcj4gdGFyZ2V0KSB7CisgICAgICAgIFhtbFJlc291cmNlUGFyc2VyIHBhcnNlciA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBwYXJzZXIgPSBnZXRSZXNvdXJjZXMoKS5nZXRYbWwocmVzaWQpOworICAgICAgICAgICAgQXR0cmlidXRlU2V0IGF0dHJzID0gWG1sLmFzQXR0cmlidXRlU2V0KHBhcnNlcik7CisKKyAgICAgICAgICAgIGludCB0eXBlOworICAgICAgICAgICAgd2hpbGUgKCh0eXBlPXBhcnNlci5uZXh0KCkpICE9IFhtbFB1bGxQYXJzZXIuRU5EX0RPQ1VNRU5UCisgICAgICAgICAgICAgICAgICAgICYmIHR5cGUgIT0gWG1sUHVsbFBhcnNlci5TVEFSVF9UQUcpIHsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3RyaW5nIG5vZGVOYW1lID0gcGFyc2VyLmdldE5hbWUoKTsKKyAgICAgICAgICAgIGlmICghInByZWZlcmVuY2UtaGVhZGVycyIuZXF1YWxzKG5vZGVOYW1lKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIlhNTCBkb2N1bWVudCBtdXN0IHN0YXJ0IHdpdGggPHByZWZlcmVuY2UtaGVhZGVycz4gdGFnOyBmb3VuZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgbm9kZU5hbWUgKyAiIGF0ICIgKyBwYXJzZXIuZ2V0UG9zaXRpb25EZXNjcmlwdGlvbigpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQnVuZGxlIGN1ckJ1bmRsZSA9IG51bGw7CisKKyAgICAgICAgICAgIGZpbmFsIGludCBvdXRlckRlcHRoID0gcGFyc2VyLmdldERlcHRoKCk7CisgICAgICAgICAgICB3aGlsZSAoKHR5cGU9cGFyc2VyLm5leHQoKSkgIT0gWG1sUHVsbFBhcnNlci5FTkRfRE9DVU1FTlQKKyAgICAgICAgICAgICAgICAgICAmJiAodHlwZSAhPSBYbWxQdWxsUGFyc2VyLkVORF9UQUcgfHwgcGFyc2VyLmdldERlcHRoKCkgPiBvdXRlckRlcHRoKSkgeworICAgICAgICAgICAgICAgIGlmICh0eXBlID09IFhtbFB1bGxQYXJzZXIuRU5EX1RBRyB8fCB0eXBlID09IFhtbFB1bGxQYXJzZXIuVEVYVCkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBub2RlTmFtZSA9IHBhcnNlci5nZXROYW1lKCk7CisgICAgICAgICAgICAgICAgaWYgKCJoZWFkZXIiLmVxdWFscyhub2RlTmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgSGVhZGVyIGhlYWRlciA9IG5ldyBIZWFkZXIoKTsKKworICAgICAgICAgICAgICAgICAgICBUeXBlZEFycmF5IHNhID0gZ2V0UmVzb3VyY2VzKCkub2J0YWluQXR0cmlidXRlcyhhdHRycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5QcmVmZXJlbmNlSGVhZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgaGVhZGVyLmlkID0gc2EuZ2V0UmVzb3VyY2VJZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5QcmVmZXJlbmNlSGVhZGVyX2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpSEVBREVSX0lEX1VOREVGSU5FRCk7CisgICAgICAgICAgICAgICAgICAgIGhlYWRlci50aXRsZSA9IHNhLmdldFRleHQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuUHJlZmVyZW5jZUhlYWRlcl90aXRsZSk7CisgICAgICAgICAgICAgICAgICAgIGhlYWRlci5zdW1tYXJ5ID0gc2EuZ2V0VGV4dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5QcmVmZXJlbmNlSGVhZGVyX3N1bW1hcnkpOworICAgICAgICAgICAgICAgICAgICBoZWFkZXIuYnJlYWRDcnVtYlRpdGxlID0gc2EuZ2V0VGV4dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5QcmVmZXJlbmNlSGVhZGVyX2JyZWFkQ3J1bWJUaXRsZSk7CisgICAgICAgICAgICAgICAgICAgIGhlYWRlci5icmVhZENydW1iU2hvcnRUaXRsZSA9IHNhLmdldFRleHQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuUHJlZmVyZW5jZUhlYWRlcl9icmVhZENydW1iU2hvcnRUaXRsZSk7CisgICAgICAgICAgICAgICAgICAgIGhlYWRlci5pY29uUmVzID0gc2EuZ2V0UmVzb3VyY2VJZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5QcmVmZXJlbmNlSGVhZGVyX2ljb24sIDApOworICAgICAgICAgICAgICAgICAgICBoZWFkZXIuZnJhZ21lbnQgPSBzYS5nZXRTdHJpbmcoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuUHJlZmVyZW5jZUhlYWRlcl9mcmFnbWVudCk7CisgICAgICAgICAgICAgICAgICAgIHNhLnJlY3ljbGUoKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoY3VyQnVuZGxlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1ckJ1bmRsZSA9IG5ldyBCdW5kbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBpbm5lckRlcHRoID0gcGFyc2VyLmdldERlcHRoKCk7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlICgodHlwZT1wYXJzZXIubmV4dCgpKSAhPSBYbWxQdWxsUGFyc2VyLkVORF9ET0NVTUVOVAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKHR5cGUgIT0gWG1sUHVsbFBhcnNlci5FTkRfVEFHIHx8IHBhcnNlci5nZXREZXB0aCgpID4gaW5uZXJEZXB0aCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09IFhtbFB1bGxQYXJzZXIuRU5EX1RBRyB8fCB0eXBlID09IFhtbFB1bGxQYXJzZXIuVEVYVCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgaW5uZXJOb2RlTmFtZSA9IHBhcnNlci5nZXROYW1lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5uZXJOb2RlTmFtZS5lcXVhbHMoImV4dHJhIikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRSZXNvdXJjZXMoKS5wYXJzZUJ1bmRsZUV4dHJhKCJleHRyYSIsIGF0dHJzLCBjdXJCdW5kbGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFhtbFV0aWxzLnNraXBDdXJyZW50VGFnKHBhcnNlcik7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5uZXJOb2RlTmFtZS5lcXVhbHMoImludGVudCIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyLmludGVudCA9IEludGVudC5wYXJzZUludGVudChnZXRSZXNvdXJjZXMoKSwgcGFyc2VyLCBhdHRycyk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgWG1sVXRpbHMuc2tpcEN1cnJlbnRUYWcocGFyc2VyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChjdXJCdW5kbGUuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyLmZyYWdtZW50QXJndW1lbnRzID0gY3VyQnVuZGxlOworICAgICAgICAgICAgICAgICAgICAgICAgY3VyQnVuZGxlID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHRhcmdldC5hZGQoaGVhZGVyKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBYbWxVdGlscy5za2lwQ3VycmVudFRhZyhwYXJzZXIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICB9IGNhdGNoIChYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJFcnJvciBwYXJzaW5nIGhlYWRlcnMiLCBlKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkVycm9yIHBhcnNpbmcgaGVhZGVycyIsIGUpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKHBhcnNlciAhPSBudWxsKSBwYXJzZXIuY2xvc2UoKTsKKyAgICAgICAgfQorCisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IGEgZm9vdGVyIHRoYXQgc2hvdWxkIGJlIHNob3duIGF0IHRoZSBib3R0b20gb2YgdGhlIGhlYWRlciBsaXN0LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldExpc3RGb290ZXIoVmlldyB2aWV3KSB7CisgICAgICAgIG1MaXN0Rm9vdGVyLnJlbW92ZUFsbFZpZXdzKCk7CisgICAgICAgIG1MaXN0Rm9vdGVyLmFkZFZpZXcodmlldywgbmV3IEZyYW1lTGF5b3V0LkxheW91dFBhcmFtcygKKyAgICAgICAgICAgICAgICBGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5ULAorICAgICAgICAgICAgICAgIEZyYW1lTGF5b3V0LkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKICAgICBwcm90ZWN0ZWQgdm9pZCBvblN0b3AoKSB7CiAgICAgICAgIHN1cGVyLm9uU3RvcCgpOwotICAgICAgICAKLSAgICAgICAgbVByZWZlcmVuY2VNYW5hZ2VyLmRpc3BhdGNoQWN0aXZpdHlTdG9wKCk7CisKKyAgICAgICAgaWY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XRQYXJjZWxhYmxlQXJyYXlMaXN0KEhFQURFUlNfVEFHLCBtSGVhZGVycyk7CisgICAgICAgICAgICBpZiAobUN1ckhlYWRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW50IGluZGV4ID0gbUhlYWRlcnMuaW5kZXhPZihtQ3VySGVhZGVyKTsKKyAgICAgICAgICAgICAgICBpZiAoaW5kZXggPj0gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXRTdGF0ZS5wdXRJbnQoQ1VSX0hFQURFUl9UQUcsIGluZGV4KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAobVByZWZlcmVuY2VNYW5hZ2VyICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZpbmFsIFByZWZlcmVuY2VTY3JlZW4gcHJlZmVyZW5jZVNjcmVlbiA9IGdldFByZWZlcmVuY2VTY3JlZW4oKTsKKyAgICAgICAgICAgIGlmIChwcmVmZXJlbmNlU2NyZWVuICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBCdW5kbGUgY29udGFpbmVyID0gbmV3IEJ1bmRsZSgpOworICAgICAgICAgICAgICAgIHByZWZlcmVuY2VTY3JlZW4uc2F2ZUhpZXJhcmNoeVN0YXRlKGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgb3V0U3RhdGUucHV0QnVuZGxlKFBSRUZFUkVOQ0VTX1RBRywgY29udGFpbmVyKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIAogICAgIEBPdmVycmlkZQogICAgIHByb3RlY3RlZCB2b2lkIG9uUmVzdG9yZUluc3RhbmNlU3RhdGUoQnVuZGxlIHN0YXRlKSB7Ci0gICAgICAgIEJ1bmRsZSBjb250YWluZXIgPSBzdGF0ZS5nZXRCdW5kbGUoUFJFRkVSRU5DRVNfVEFHKTsKLSAgICAgICAgaWYgKGNvbnRhaW5lciAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmaW5hbCBQcmVmZXJlbmNlU2NyZWVuIHByZWZlcmVuY2VTY3JlZW4gPSBnZXRQcmVmZXJlbmNlU2NyZWVuKCk7Ci0gICAgICAgICAgICBpZiAocHJlZmVyZW5jZVNjcmVlbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcHJlZmVyZW5jZVNjcmVlbi5yZXN0b3JlSGllcmFyY2h5U3RhdGUoY29udGFpbmVyKTsKLSAgICAgICAgICAgICAgICBtU2F2ZWRJbnN0YW5jZVN0YXRlID0gc3RhdGU7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICBpZiAobVByZWZlcmVuY2VNYW5hZ2VyICE9IG51bGwpIHsKKyAgICAgICAgICAgIEJ1bmRsZSBjb250YWluZXIgPSBzdGF0ZS5nZXRCdW5kbGUoUFJFRkVSRU5DRVNfVEFHKTsKKyAgICAgICAgICAgIGlmIChjb250YWluZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZpbmFsIFByZWZlcmVuY2VTY3JlZW4gcHJlZmVyZW5jZVNjcmVlbiA9IGdldFByZWZlcmVuY2VTY3JlZW4oKTsKKyAgICAgICAgICAgICAgICBpZiAocHJlZmVyZW5jZVNjcmVlbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHByZWZlcmVuY2VTY3JlZW4ucmVzdG9yZUhpZXJhcmNoeVN0YXRlKGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgICAgIG1TYXZlZEluc3RhbmNlU3RhdGUgPSBzdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC0xNTYsMTQgKzc5OSwyODAgQEAKICAgICBAT3ZlcnJpZGUKICAgICBwcm90ZWN0ZWQgdm9pZCBvbkFjdGl2aXR5UmVzdWx0KGludCByZXF1ZXN0Q29kZSwgaW50IHJlc3VsdENvZGUsIEludGVudCBkYXRhKSB7CiAgIC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pdGVtIGluIHRoZSBoZWFkZXIgbGlzdC4gIFRoZSBkZWZhdWx0CisgICAgICogaW1wbGVtZW50YXRpb24gd2lsbCBjYWxsIGVpdGhlciB7QGxpbmsgI3N0YXJ0V2l0aEZyYWdtZW50KFN0cmluZywgQnVuZGxlLCBGcmFnbWVudCwgaW50KX0KKyAgICAgKiBvciB7QGxpbmsgI3N3aXRjaFRvSGVhZGVyKEhlYWRlcil9IGFzIGFwcHJvcHJpYXRlLgorICAgICAqCisgICAgICogQHBhcmFtIGhlYWRlciBUaGUgaGVhZGVyIHRoYXQgd2FzIHNlbGVjdGVkLgorICAgICAqIEBwYXJhbSBwb3NpdGlvbiBUaGUgaGVhZGVyJ3MgcG9zaXRpb24gaW4gdGhlIGxpc3QuCisgICAgICovCisgICAgcHVibGljIHZvaWQgb25IZWFkZXJDbGljayhIZWFkZXIgaGVhZGVyLCBpbnQgcG9zaXRpb24pIHsKKyAgICAgICAgaWYgKGhlYWRlci5mcmFnbWVudCAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAobVNpbmdsZVBhbmUpIHsKKyAgICAgICAgICAgICAgICBzdGFydFdpdGhGcmFnbWVudChoZWFkZXIuZnJhZ21lbnQsIGhlYWRlci5mcmFnbWVudEFyZ3VtZW50cywgbnVsbCwgMCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHN3aXRjaFRvSGVhZGVyKGhlYWRlcik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoaGVhZGVyLmludGVudCAhPSBudWxsKSB7CisgICAgICAgICAgICBzdGFydEFjdGl2aXR5KGhlYWRlci5pbnRlbnQpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU3RhcnQgYSBuZXcgaW5zdGFuY2Ugb2YgdGhpcyBhY3Rpdml0eSwgc2hvd2luZyBvbmx5IHRoZSBnaXZlbgorICAgICAqIHByZWZlcmVuY2UgZnJhZ21lbnQuICBXaGVuIGxhdW5jaG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N1bHRSZXF1ZXN0Q29kZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDaGFuZ2UgdGhlIGJhc2UgdGl0bGUgb2YgdGhlIGJyZWFkIGNydW1icyBmb3IgdGhlIGN1cnJlbnQgcHJlZmVyZW5jZXMuCisgICAgICogVGhpcyB3aWxsIG5vcm1hbGx5IGJlIGNhbGxlZCBmb3IgeW91LiAgU2VlCisgICAgICoge0BsaW5rIGFuZHJvaWQuYXBwLkZyYWdtZW50QnJlYWRDcnVtYnN9IGZvciBtb3JlIGluZm9ybWF0aW9uLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNob3dCcmVhZENydW1icyhDaGFyU2VxdWVuY2UgdGl0bGUsIENoYXJTZXF1ZW5jZSBzaG9ydFRpdGxlKSB7CisgICAgICAgIGlmIChtRnJhZ21lbnRCcmVhZENydW1icyA9PSBudWxsKSB7CisgICAgICAgICAgICBtRnJhZ21lbnRCcmVhZENydW1icyA9IG5ldyBGcmFnbWVudEJyZWFkQ3J1bWJzKHRoaXMpOworICAgICAgICAgICAgbUZyYWdtZW50QnJlYWRDcnVtYnMuc2V0QWN0aXZpdHkodGhpcyk7CisgICAgICAgICAgICBnZXRBY3Rpb25CYXIoKS5zZXRDdXN0b21OYXZpZ2F0aW9uTW9kZShtRnJhZ21lbnRCcmVhZENydW1icyk7CisgICAgICAgIH0KKyAgICAgICAgbUZyYWdtZW50QnJlYWRDcnVtYnMuc2V0VGl0bGUodGl0bGUsIHNob3J0VGl0bGUpOworICAgIH0KKworICAgIHZvaWQgc2V0U2VsZWN0ZWRIZWFkZXIoSGVhZGVyIGhlYWRlcikgeworICAgICAgICBtQ3VySGVhZGVyID0gaGVhZGVyOworICAgICAgICBpbnQgaW5kZXggPSBtSGVhZGVycy5pbmRleE9mKGhlYWRlcik7CisgICAgICAgIGlmIChpbmRleCA+PSAwKSB7CisgICAgICAgICAgICBnZXRMaXN0VmlldygpLnNldEl0ZW1DaGVja2VkKGlu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cgaGVhZGVyIHRvIGRpc3BsYXkuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc3dpdGNoVG9IZWFkZXIoSGVhZGVyIGhlYWRlcikgeworICAgICAgICBpZiAobUN1ckhlYWRlciA9PSBoZWFkZXIpIHsKKyAgICAgICAgICAgIC8vIFRoaXMgaXMgdGhlIGhlYWRlciB3ZSBhcmUgY3VycmVudGx5IGRpc3BsYXlpbmcuICBKdXN0IG1ha2Ugc3VyZQorICAgICAgICAgICAgLy8gdG8gcG9wIHRoZSBzdGFjayB1cCB0byBpdHMgcm9vdCBzdGF0ZS4KKyAgICAgICAgICAgIGdldEZyYWdtZW50TWFuYWdlcigpLnBvcEJhY2tTdGFjayhCQUNLX1NUQUNLX1BSRUZTLCBQT1BfQkFDS19TVEFDS19JTkNMVVNJVkUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaW50IGRpcmVjdGlvbiA9IG1IZWFkZXJzLmluZGV4T2YoaGVhZGVyKSAtIG1IZWFkZXJzLmluZGV4T2YobUN1ckhlYWRlcik7CisgICAgICAgICAgICBzd2l0Y2hUb0hlYWRlcklubmVyKGhlYWRlci5mcmFnbWVudCwgaGVhZGVyLmZyYWdtZW50QXJndW1lbnRzLCBkaXJlY3Rpb24pOworICAgICAgICAgICAgc2V0U2VsZWN0ZWRIZWFkZXIoaGVhZGVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEhlYWRlciBmaW5kQmVzdE1hdGNoaW5nSGVhZGVyKEhlYWRlciBjdXIsIEFycmF5TGlzdDxIZWFkZXI+IGZyb20pIHsKKyAgICAgICAgQXJyYXlMaXN0PEhlYWRlcj4gbWF0Y2hlcyA9IG5ldyBBcnJheUxpc3Q8SGVhZGVyPigpOworICAgICAgICBmb3IgKGludCBqPTA7IGo8ZnJvbS5zaXplKCk7IGorKykgeworICAgICAgICAgICAgSGVhZGVyIG9oID0gZnJvbS5nZXQoaik7CisgICAgICAgICAgICBpZiAoY3VyID09IG9oIHx8IChjdXIuaWQgIT0gSEVBREVSX0lEX1VOREVGSU5FRCAmJiBjdXIuaWQgPT0gb2guaWQpKSB7CisgICAgICAgICAgICAgICAgLy8gTXVzdCBiZSB0aGlzIG9uZS4KKyAgICAgICAgICAgICAgICBtYXRjaGVzLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgbWF0Y2hlcy5hZGQob2gpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGN1ci5mcmFnbWVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKGN1ci5mcmFnbWVudC5lcXVhbHMob2guZnJhZ21lbnQpKSB7CisgICAgICAgICAgICAgICAgICAgIG1hdGNoZXMuYWRkKG9oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKGN1ci5pbnRlbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChjdXIuaW50ZW50LmVxdWFscyhvaC5pbnRlbnQpKSB7CisgICAgICAgICAgICAgICAgICAgIG1hdGNoZXMuYWRkKG9oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKGN1ci50aXRsZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKGN1ci50aXRsZS5lcXVhbHMob2gudGl0bGUpKSB7CisgICAgICAgICAgICAgICAgICAgIG1hdGNoZXMuYWRkKG9oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZmluYWwgaW50IE5NID0gbWF0Y2hlcy5zaXplKCk7CisgICAgICAgIGlmIChOTSA9PSAxKSB7CisgICAgICAgICAgICByZXR1cm4gbWF0Y2hlcy5nZXQoMCk7CisgICAgICAgIH0gZWxzZSBpZiAoTk0gPiAxKSB7CisgICAgICAgICAgICBmb3IgKGludCBqPTA7IGo8Tk07IGorKykgeworICAgICAgICAgICAgICAgIEhlYWRlciBvaCA9IG1hdGNoZXMuZ2V0KGopOworICAgICAgICAgICAgICAgIGlmIChjdXIuZnJhZ21lbnRBcmd1bWVudHMgIT0gbnVsbCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgY3VyLmZyYWdtZW50QXJndW1lbnRzLmVxdWFscyhvaC5mcmFnbWVudEFyZ3VtZW50cykpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9oOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoY3VyLmV4dHJhcyAhPSBudWxsICYmIGN1ci5leHRyYXMuZXF1YWxzKG9oLmV4dHJhcykpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9oOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoY3VyLnRpdGxlICE9IG51bGwgJiYgY3VyLnRpdGxlLmVxdWFscyhvaC50aXRsZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9oOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdGFydCBhIG5ldyBmcmFnbWVudC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBmcmFnbWVudCBUaGUgZnJhZ21lbnQgdG8gc3RhcnQKKyAgICAgKiBAcGFyYW0gcHVzaCBJZiB0cnVlLCB0aGUgY3VycmVudCBmcmFnbWVudCB3aWxsIGJlIHB1c2hlZCBvbnRvIHRoZSBiYWNrIHN0YWNrLiAgSWYgZmFsc2UsCisgICAgICogdGhlIGN1cnJlbnQgZnJhZ21lbnQgd2lsbCBiZSByZXBsYWNlZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzdGFydFByZWZlcmVuY2VGcmFnbWVudChGcmFnbWVudCBmcmFnbWVudCwgYm9vbGVhbiBwdXNoKSB7CisgICAgICAgIEZyYWdtZW50VHJhbnNhY3Rpb24gdHJhbnNh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sbGVyLmdldFRhcmdldFJlcXVlc3RDb2RlKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0Q29kZSwgcmVzdWx0RGF0YSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gWFhYIGJlIHNtYXJ0ZXIgYWJvdXQgcG9wcGluZyB0aGUgc3RhY2suCisgICAgICAgICAgICBvbkJhY2tQcmVzc2VkKCk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25QcmVmZXJlbmNlU3RhcnRGcmFnbWVudChQcmVmZXJlbmNlRnJhZ21lbnQgY2FsbGVyLCBQcmVmZXJlbmNlIHByZWYpIHsKKyAgICAgICAgc3RhcnRQcmVmZXJlbmNlUGFuZWwocHJlZi5nZXRGcmFnbWVudCgpLCBwcmVmLmdldEV4dHJhcygpLCAwLCBwcmVmLmdldFRpdGxlKCksIG51bGwsIDApOworICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICB9CiAKICAgICAvKioKQEAgLTE3Niw3ICsxMDg1LDcgQEAKICAgICAgICAgaWYgKG1IYW5kbGVyLmhhc01lc3NhZ2VzKE1TR19CSU5EX1BSRUZFUkVOQ0VTKSkgcmV0dXJuOwogICAgICAgICBtSGFuZGxlci5vYnRhaW5NZXNzYWdlKE1TR19CSU5EX1BSRUZFUkVOQ0VTKS5zZW5kVG9UYXJnZXQoKTsKICAgICB9Ci0gICAgCisKICAgICBwcml2YXRlIHZvaWQgYmluZFByZWZlcmVuY2VzKCkgewogICAgICAgICBmaW5hbCBQcmVmZXJlbmNlU2NyZWVuIHByZWZlcmVuY2VTY3JlZW4gPSBnZXRQcmVmZXJlbmNlU2NyZWVuKCk7CiAgICAgICAgIGlmIChwcmVmZXJlbmNlU2NyZWVuICE9IG51bGwpIHsKQEAgLTE4NywzOCArMTA5Niw0MSBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICA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uYWdlcjsKKyAgICBwcml2YXRlIExpc3RWaWV3IG1MaXN0OworICAgIHByaXZhdGUgYm9vbGVhbiBtSGF2ZVByZWZzOworICAgIHByaXZhdGUgYm9vbGVhbiBtSW5pdERvbmU7CisKKyAgICAvKioKKyAgICAgKiBUaGUgc3RhcnRpbmcgcmVxdWVzdCBjb2RlIGdpdmVuIG91dCB0byBwcmVmZXJlbmNlIGZyYW1ld29yay4KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgRklSU1RfUkVRVUVTVF9DT0RFID0gMTAwOworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE1TR19CSU5EX1BSRUZFUkVOQ0VTID0gMTsKKyAgICBwcml2YXRlIEhhbmRsZXIgbUhhbmRsZXIgPSBuZXcgSGFuZGxlcigpIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0JJTkRfUFJFRkVSRU5DRVM6CisgICAgICAgICAgICAgICAgICAgIGJpbmRQcmVmZXJlbmNlcygpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisKKyAgICBmaW5hbCBwcml2YXRlIFJ1bm5hYmxlIG1SZXF1ZXN0Rm9jdXMgPSBuZXcgUnVubmFibGUoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIG1MaXN0LmZvY3VzYWJsZVZpZXdBdmFpbGFibGUobUxpc3QpOworICAgICAgICB9CisgICAgfTsKKworICAgIC8qKgorICAgICAqIEludGVyZmFjZSB0aGF0IFByZWZlcmVuY2VGcmFnbWVudCdzIGNvbnRhaW5pbmcgYWN0aXZpdHkgc2hvdWxkCisg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ldFByZWZlcmVuY2VTY3JlZW4oKTsKKyAgICAgICAgICAgICAgICBpZiAocHJlZmVyZW5jZVNjcmVlbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHByZWZlcmVuY2VTY3JlZW4ucmVzdG9yZUhpZXJhcmNoeVN0YXRlKGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25TdG9wKCkgeworICAgICAgICBzdXBlci5vblN0b3AoKTsKKyAgICAgICAgbVByZWZlcmVuY2VNYW5hZ2VyLmRpc3BhdGNoQWN0aXZpdHlTdG9wKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25EZXN0cm95VmlldygpIHsKKyAgICAgICAgbUxpc3QgPSBudWxsOworICAgICAgICBtSGFuZGxlci5yZW1vdmVDYWxsYmFja3MobVJlcXVlc3RGb2N1cyk7CisgICAgICAgIHN1cGVyLm9uRGVzdHJveVZpZXcoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvbkRlc3Ryb3koKSB7CisgICAgICAgIHN1cGVyLm9uRGVzdHJveSgpOworICAgICAgICBtUHJlZmVyZW5jZU1hbmFnZXIuZGlzcGF0Y2hBY3Rpdml0eURlc3Ryb3koKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvblNhdmVJbnN0YW5jZVN0YXRlKEJ1bmRsZSBvdXRTdGF0ZSkgeworICAgICAgICBzdXBlci5vblNhdmVJbnN0YW5jZVN0YXRlKG91dFN0YXRlKTsKKworICAgICAgICBmaW5hbCBQcmVmZXJlbmNlU2NyZWVuIHByZWZlcmVuY2VTY3JlZW4gPSBnZXRQcmVmZXJlbmNlU2NyZWVuKCk7CisgICAgICAgIGlmIChwcmVmZXJlbmNlU2NyZWVuICE9IG51bGwpIHsKKyAgICAgICAgICAgIEJ1bmRsZSBjb250YWluZXIgPSBuZXcgQnVuZGxlKCk7CisgICAgICAgICAgICBwcmVmZXJlbmNlU2NyZWVuLnNhdmVIaWVyYXJjaHlTdGF0ZShjb250YWluZXIpOworICAgICAgICAgICAgb3V0U3RhdGUucHV0QnVuZGxlKFBSRUZFUkVOQ0VTX1RBRywgY29udGFpbmVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uQWN0aXZpdHlSZXN1bHQoaW50IHJlcXVlc3RDb2RlLCBpbnQgcmVzdWx0Q29kZSwgSW50ZW50IGRhdGEpIHsKKyAgICAgICAgc3VwZXIub25BY3Rpdml0eVJlc3VsdChyZXF1ZXN0Q29kZSwgcmVzdWx0Q29kZSwgZGF0YSk7CisKKyAgICAgICAgbVByZWZlcmVuY2VNYW5hZ2VyLmRpc3BhdGNoQWN0aXZpdHlSZXN1bHQocmVxdWVzdENvZGUsIHJlc3VsdENvZGUsIGRhdGEpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIHtAbGluayBQcmVmZXJlbmNlTWFuYWdlcn0gdXNlZCBieSB0aGlzIGZyYWdtZW50LgorICAgICAqIEByZXR1cm4gVGhlIHtAbGluayBQcmVmZXJlbmNlTWFuYWdlcn0uCisgICAgICovCisgICAgcHVibGljIFByZWZlcmVuY2VNYW5hZ2VyIGdldFByZWZlcmVuY2VNYW5hZ2VyKCkgeworICAgICAgICByZXR1cm4gbVByZWZlcmVuY2VNYW5hZ2VyOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIHJvb3Qgb2YgdGhlIHByZWZlcmVuY2UgaGllcmFyY2h5IHRoYXQgdGhpcyBmcmFnbWVudCBpcyBzaG93aW5nLgorICAgICAqCisgICAgICogQHBhcmFtIHByZWZlcmVuY2VTY3JlZW4gVGhlIHJvb3Qge0BsaW5rIFByZWZlcmVuY2VTY3JlZW59IG9mIHRoZSBwcmVmZXJlbmNlIGhpZXJhcmNoeS4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRQcmVmZXJlbmNlU2NyZWVuKFByZWZlcmVuY2VTY3JlZW4gcHJlZmVyZW5jZVNjcmVlbikgeworICAgICAgICBpZiAobVByZWZlcmVuY2VNYW5hZ2VyLnNldFByZWZlcmVuY2VzKHByZWZlcmVuY2VTY3JlZW4pICYmIHByZWZlcmVuY2VTY3JlZW4gIT0gbnVsbCkgeworICAgICAgICAgICAgbUhhdmVQcmVmcyA9IHRydWU7CisgICAgICAgICAgICBpZiAobUluaXREb25lKSB7CisgICAgICAgICAgICAgICAgcG9zdEJpbmRQcmVmZXJlbmNlcygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0cyB0aGUgcm9vdCBvZiB0aGUgcHJlZmVyZW5jZSBoaWVyYXJjaHkgdGhhdCB0aGlzIGZyYWdtZW50IGlzIHNob3dpbmcuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIFRoZSB7QGxpbmsgUHJlZmVyZW5jZVNjcmVlbn0gdGhhdCBpcyB0aGUgcm9vdCBvZiB0aGUgcHJlZmVyZW5jZQorICAgICAqICAgICAgICAgaGllcmFyY2h5LgorICAgICAqLworICAgIHB1YmxpYyBQcmVmZXJlbmNlU2NyZWVuIGdldFByZWZlcmVuY2VTY3JlZW4oKSB7CisgICAgICAgIHJldHVybiBtUHJlZmVyZW5jZU1hbmFnZXIuZ2V0UHJlZmVyZW5jZVNjcmVlbigpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEFkZHMgcHJlZmVyZW5jZXMgZnJvbSBhY3Rpdml0aWVzIHRoYXQgbWF0Y2ggdGhlIGdpdmVuIHtAbGluayBJbnRlbnR9LgorICAgICAqCisgICAgICogQHBhcmFtIGludGVudCBUaGUge0BsaW5rIEludGVudH0gdG8gcXVlcnkgYWN0aXZpdGllcy4KKyAgICAgKi8KK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VsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlRoaXMgc2hvdWxkIGJlIGNhbGxlZCBhZnRlciBzdXBlci5vbkNyZWF0ZS4iKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBwb3N0QmluZFByZWZlcmVuY2VzKCkgeworICAgICAgICBpZiAobUhhbmRsZXIuaGFzTWVzc2FnZXMoTVNHX0JJTkRfUFJFRkVSRU5DRVMpKSByZXR1cm47CisgICAgICAgIG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoTVNHX0JJTkRfUFJFRkVSRU5DRVMpLnNlbmRUb1RhcmdldCgpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBiaW5kUHJlZmVyZW5jZXMoKSB7CisgICAgICAgIGZpbmFsIFByZWZlcmVuY2VTY3JlZW4gcHJlZmVyZW5jZVNjcmVlbiA9IGdldFByZWZlcmVuY2VTY3JlZW4oKTsKKyAgICAgICAgaWYgKHByZWZlcmVuY2VTY3JlZW4gIT0gbnVsbCkgeworICAgICAgICAgICAgcHJlZmVyZW5jZVNjcmVlbi5iaW5kKGdldExpc3RWaWV3KCkpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgcHVibGljIExpc3RWaWV3IGdldExpc3RWaWV3KCkgeworICAgICAgICBlbnN1cmVMaXN0KCk7CisgICAgICAgIHJldHVybiBtTGlzdDsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZW5zdXJlTGlzdCgpIHsKKyAgICAgICAgaWYgKG1MaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBWaWV3IHJvb3QgPSBnZXRWaWV3KCk7CisgICAgICAgIGlmIChyb290ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkNvbnRlbnQgdmlldyBub3Qge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FBhcnNlckV4Y2VwdGlvbiBleCA9IG5ldyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIkVycm9yIHBhcnNpbmcgcHJlZmVyZW5jZSIpOworICAgICAgICAgICAgICAgIGV4LmluaXRDYXVzZShlKTsKKyAgICAgICAgICAgICAgICB0aHJvdyBleDsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIAogICAgICAgICAgICAgaWYgKGludGVudCAhPSBudWxsKSB7CkBAIC04Miw2ICs4NywxOCBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgCiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIGlmICh0YWcuZXF1YWxzKEVYVFJBX1RBR19OQU1FKSkgeworICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldFJlc291cmNlcygpLnBhcnNlQnVuZGxlRXh0cmEoRVhUUkFfVEFHX05BTUUsIGF0dHJzLAorICAgICAgICAgICAgICAgICAgICBwYXJlbnRQcmVmZXJlbmNlLmdldEV4dHJhcygpKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgWG1sVXRpbHMuc2tpcEN1cnJlbnRUYWcocGFyc2VyKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIGV4ID0gbmV3IFhtbFB1bGxQYXJzZXJFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiRXJyb3IgcGFyc2luZyBwcmVmZXJlbmNlIik7CisgICAgICAgICAgICAgICAgZXguaW5pdENhdXNlKGUpOworICAgICAgICAgICAgICAgIHRocm93IGV4OworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KICAgICAgICAgCiAgICAgICAgIHJldHVybiBmYWxzZTsKZGlmZiAtLWdpdCBhL2Nv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AgIH0KICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfTVVURToKKyAgICAgICAgICAgICAgICBpZiAoaXNkb3duKSB7CisgICAgICAgICAgICAgICAgICAgIG1TZWVrQmFyVm9sdW1pemVyLm11dGVWb2x1bWUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQpAQCAtMjI1LDYgKzIzMCw3IEBACiAgICAgCiAgICAgICAgIHByaXZhdGUgaW50IG1MYXN0UHJvZ3Jlc3MgPSAtMTsKICAgICAgICAgcHJpdmF0ZSBTZWVrQmFyIG1TZWVrQmFyOworICAgICAgICBwcml2YXRlIGludCBtVm9sdW1lQmVmb3JlTXV0ZSA9IC0xOwogICAgICAgICAKICAgICAgICAgcHJpdmF0ZSBDb250ZW50T2JzZXJ2ZXIgbVZvbHVtZU9ic2VydmVyID0gbmV3IENvbnRlbnRPYnNlcnZlcihtSGFuZGxlcikgewogICAgICAgICAgICAgQE92ZXJyaWRlCkBAIC0zMzYsNiArMzQyLDIxIEBACiAgICAgICAgICAgICAgICAgc2FtcGxlKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBwb3N0U2V0Vm9sdW1lKG1TZWVrQmFyLmdldFByb2dyZXNzKCkpOworICAgICAgICAgICAgbVZvbHVtZUJlZm9yZU11dGUgPSAtMTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG11dGVWb2x1bWUoKSB7CisgICAgICAgICAgICBpZiAobVZvbHVtZUJlZm9yZU11dGUgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICBtU2Vla0Jhci5zZXRQcm9ncmVzcyhtVm9sdW1lQmVmb3JlTXV0ZSk7CisgICAgICAgICAgICAgICAgc2F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IHN0cmluZyB0byBzZW5kCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCB2b2lkIHNlbmRTdHJpbmcoQ29udGV4dCBjb250ZXh0LCBTdHJpbmcgc3RyaW5nKSB7CisgICAgICAgIHNlbmRTdHJpbmcoY29udGV4dCwgc3RyaW5nLCBjb250ZXh0LmdldFN0cmluZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5zZW5kVGV4dCkpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMTc0LDQ4ICsyMTAsNDkgQEAKICAgICAgICAgc2VuZC5wdXRFeHRyYShJbnRlbnQuRVhUUkFfVEVYVCwgc3RyaW5nVG9TZW5kKTsKIAogICAgICAgICB0cnkgewotICAgICAgICAgICAgYy5zdGFydEFjdGl2aXR5KEludGVudC5jcmVhdGVDaG9vc2VyKHNlbmQsIGNob29zZXJEaWFsb2dUaXRsZSkpOworICAgICAgICAgICAgSW50ZW50IGkgPSBJbnRlbnQuY3JlYXRlQ2hvb3NlcihzZW5kLCBjaG9vc2VyRGlhbG9nVGl0bGUpOworICAgICAgICAgICAgLy8gSW4gY2FzZSB0aGlzIGlzIGNhbGxlZCBmcm9tIG91dHNpZGUgYW4gQWN0aXZpdHkKKyAgICAgICAgICAgIGkuc2V0RmxhZ3MoSW50ZW50LkZMQUdfQUNUSVZJVFlfTkVXX1RBU0spOworICAgICAgICAgICAgYy5zdGFydEFjdGl2aXR5KGkpOwogICAgICAgICB9IGNhdGNoKGFuZHJvaWQuY29udGVudC5BY3Rpdml0eU5vdEZvdW5kRXhjZXB0aW9uIGV4KSB7CiAgICAgICAgICAgICAvLyBpZiBubyBhcHAgaGFuZGxlcyBpdCwgZG8gbm90aGluZwogICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogIFJldHVybiBhIGN1cnNvciBwb2ludGluZyB0byBhIGxpc3Qgb2YgYWxsIHRoZSBib29rbWFya3MuCisgICAgICogIFJldHVybiBhIGN1cnNvciBwb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cod2hlcmVDbGF1c2UsCiAgICAgICAgICAgICAgICAgICAgICJodHRwczovLyIgKyBjb21wYXJlU3RyaW5nKTsKICAgICAgICAgICAgIGFkZE9yVXJsRXF1YWxzKHdoZXJlQ2xhdXNlKTsKICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuYXBwZW5kRXNjYXBlZFNRTFN0cmluZyh3aGVyZUNsYXVzZSwKICAgICAgICAgICAgICAgICAgICAgImh0dHBzOi8vd3d3LiIgKyBjb21wYXJlU3RyaW5nKTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHdoZXJlQ2xhdXNlID0gbmV3IFN0cmluZ0J1aWxkZXIoQm9va21hcmtDb2x1bW5zLlVSTCArICIgPSAiKTsKKyAgICAgICAgICAgIHdoZXJlQ2xhdXNlID0gbmV3IFN0cmluZ0J1aWxkZXIoQm9va21hcmtzLlVSTCArICIgPSAiKTsKICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuYXBwZW5kRXNjYXBlZFNRTFN0cmluZyh3aGVyZUNsYXVzZSwKICAgICAgICAgICAgICAgICAgICAgY29tcGFyZVN0cmluZyk7CiAgICAgICAgICAgICBhZGRPclVybEVxdWFscyh3aGVyZUNsYXVzZSk7CkBAIC0yNTAsNyArMjg3LDcgQEAKICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuYXBwZW5kRXNjYXBlZFNRTFN0cmluZyh3aGVyZUNsYXVzZSwKICAgICAgICAgICAgICAgICAgICAgImh0dHA6Ly8iICsgd3d3U3RyaW5nKTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gY3IucXVlcnkoQk9PS01BUktTX1VSSSwgSElTVE9SWV9QUk9KRUNUSU9OLAorICAgICAgICByZXR1cm4gY3IucXVlcnkoSGlzdG9yeS5DT05URU5UX1VSSSwgbmV3IFN0cmluZ1tdIHsgSGlzdG9yeS5fSUQsIEhpc3RvcnkuVklTSVRTIH0sCiAgICAgICAgICAgICAgICAgd2hlcmVDbGF1c2UudG9TdHJpbmcoKSwgbnVsbCwgbnVsbCk7CiAgICAgfQogCkBAIC0yNjYsMjYgKzMwMywyNCBAQAogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgdm9pZCB1cGRhdGVWaXNpdGVkSGlzdG9yeShDb250ZW50UmVzb2x2ZXIgY3IsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyB1cmwsIGJvb2xlYW4gcmVhbCkgewotICAgICAgICBsb25nIG5vdyA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpOworICAgICAgICBsb25nIG5vdyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwogICAgICAgICBDdXJzb3IgYyA9IG51bGw7CiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICBjID0gZ2V0VmlzaXRlZExpa2UoY3IsIHVybCk7CiAgICAgICAgICAgICAvKiBXZSBzaG91bGQgb25seSBnZXQgb25lIGFuc3dlciB0aGF0IGlzIGV4YWN0bHkgdGhlIHNhbWUuICovCiAgICAgICAgICAgICBpZiAoYy5tb3ZlVG9GaXJzdCgpKSB7Ci0gICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyBtYXAgPSBuZXcgQ29udGVudFZhbHVlcygpOworICAgICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgdmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKICAgICAgICAgICAgICAgICBpZiAocmVhbCkgewotICAgICAgICAgICAgICAgICAgICBtYXAucHV0KEJvb2ttYXJrQ29sdW1ucy5WSVNJVFMsIGMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0SW50KEhJU1RPUllfUFJPSkVDVElPTl9WSVNJVFNfSU5ERVgpICsgMSk7CisgICAgICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoSGlzdG9yeS5WSVNJVFMsIGMuZ2V0SW50KDEpICsgMSk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbWFwLnB1dChCb29rbWFya0NvbHVtbnMuVVNFUl9FTlRFUkVELCAxKTsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChIaXN0b3J5LlVTRVJfRU5URVJFRCwgMSk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1hcC5wdXQoQm9va21hcmtDb2x1bW5zLkRBVEUsIG5vdyk7Ci0gICAgICAgICAgICAgICAgU3RyaW5nW10gcHJvamVjdGlvbiA9IG5ldyBTdHJpbmdbXQotICAgICAgICAgICAgICAgICAgICAgICAgeyBJbnRlZ2VyLnZhbHVlT2YoYy5nZXRJbnQoMCkpLnRvU3RyaW5nKCkgfTsKLSAgICAgICAgICAgICAgICBjci51cGRhdGUoQk9PS01BUktTX1VSSSwgbWFwLCAiX2lkID0gPyIsIHByb2plY3Rpb24pOworICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoSGlzdG9yeS5EQVRFX0xBU1RfVklTSVRFRCwgbm93KTsKKyAgICAgICAgICAgICAgICBjci51cGRhdGUoQ29udGVudFVyaXMud2l0aEFwcGVuZGVkSWQoSGlzdG9yeS5DT05URU5UX1VSSSwgYy5nZXRMb25nKDApKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcywgbnVsbCwgbnVsbCk7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIHRydW5jYXRlSGlzdG9yeShjcik7Ci0gICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyBtYXAgPSBuZXcgQ29udGVudFZhbHVlcygpOworICAgICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgdmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKICAgICAgICAgICAgICAgICBpbnQgdmlzaXRzOwogICAgICAgICAgICAgICAgIGludCB1c2VyX2VudGVyZWQ7CiAgICAgICAgICAgICAgICAgaWYgKHJlYWwpIHsKQEAgLTI5NSwxNCArMzMwLDEzIEBACiAgICAgICAgICAgICAgICAgICAgIHZpc2l0cyA9IDA7CiAgICAgICAgICAgICAgICAgICAgIHVzZXJfZW50ZXJlZCA9IDE7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1hcC5wdXQoQm9va21hcmtDb2x1bW5zLlVSTCwgdXJsKTsKLSAgICAgICAgICAgICAgICBtYXAucHV0KEJvb2ttYXJrQ29sdW1ucy5WSVNJVFMsIHZpc2l0cyk7Ci0gICAgICAgICAgICAgICAgbWFwLnB1dChCb29rbWFya0NvbHVtbnMuREFURSwgbm93KTsKLSAgICAgICAgICAgICAgICBtYXAucHV0KEJvb2ttYXJrQ29sdW1ucy5CT09LTUFSSywgMCk7Ci0gICAgICAgICAgICAgICAgbWFwLnB1dChCb29rbWFya0NvbHVtbnMuVElUTEUsIHVybCk7Ci0gICAgICAgICAgICAgICAgbWFwLnB1dChCb29rbWFya0NvbHVtbnMuQ1JFQVRFRCwgMCk7Ci0gICAgICAgICAgICAgICAgbWFwLnB1dChCb29rbWFya0NvbHVtbnMuVVNFUl9FTlRFUkVELCB1c2VyX2VudGVyZWQpOwotICAgICAgICAgICAgICAgIGNyLmluc2VydChCT09LTUFSS1NfVVJJLCBtYXApOworICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoSGlzdG9yeS5VUkwsIHVybCk7CisgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChIaXN0b3J5LlZJU0lUUywgdmlzaXRzKTsKKyAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KEhpc3RvcnkuREFURV9MQVNUX1ZJU0lURUQsIG5vdyk7CisgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChIaXN0b3J5LlRJVExFLCB1cmwpOworICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoSGlzdG9yeS5EQVRFX0NSRUFURUQsIDApOworICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoSGlzdG9yeS5VU0VSX0VOVEVSRUQsIHVzZXJfZW50ZXJlZCk7CisgICAgICAgICAgICAgICAgY3IuaW5zZXJ0KEhpc3RvcnkuQ09OVEVOVF9VUkksIHZhbHVlcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJ1cGRhdGVWaXNpdGVkSGlzdG9yeSIsIGUpOwpAQCAtMzIyLDEwICszNTYsMTAgQEAKICAgICAgICAgU3RyaW5nW10gc3RyID0gbnVsbDsKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIFN0cmluZ1tdIHByb2plY3Rpb24gPSBuZXcgU3RyaW5nW10gewotICAgICAgICAgICAgICAgICJ1cmwiCisgICAgICAgICAgICAgICAgICAgIEhpc3RvcnkuVVJMLAogICAgICAgICAgICAgfTsKLSAgICAgICAgICAgIGMgPSBjci5xdWVyeShCT09LTUFSS1NfVVJJLCBwcm9qZWN0aW9uLCAidmlzaXRzID4gMCIsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgIG51bGwpOworICAgICAgICAgICAgYyA9IGNyLnF1ZXJ5KEhpc3RvcnkuQ09OVEVOVF9VUkksIHByb2plY3Rpb24sIEhpc3RvcnkuVklTSVRTICsgIiA+IDAiLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgIGlmIChjID09IG51bGwpIHJldHVybiBuZXcgU3RyaW5nWzBdOwogICAgICAgICAgICAgc3RyID0gbmV3IFN0cmluZ1tjLmdldENvdW50KCldOwogICAgICAgICAgICAgaW50IGkgPSAwOwogICAgICAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7CkBAIC0zNTMsMzEgKzM4NywyOSBAQAogICAgICAqIEBwYXJhbSBjciBUaGUgQ29udGVudFJlc29sdmVyIHVzZWQgdG8gYWNjZXNzIHRoZSBkYXRhYmFzZS4KICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIHZvaWQgdHJ1bmNhdGVIaXN0b3J5KENvbnRlbnRSZXNvbHZlciBjcikgewotICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisgICAgICAgIC8vIFRPRE8gbWFrZSBhIHNpbmdsZSByZXF1ZXN0IHRvIHRoZSBwcm92aWRlciB0byBkbyB0aGlzIGluIGEgc2luZ2xlIHRyYW5zYWN0aW9uCisgICAgICAgIEN1cnNvciBjdXJzb3IgPSBudWxsOwogICAgICAgICB0cnkgeworICAgICAgICAgICAgCiAgICAgICAgICAgICAvLyBTZWxlY3Qgbm9uLWJvb2ttYXJrIGhpc3RvcnksIG9yZGVyZWQgYnkgZGF0ZQotICAgICAgICAgICAgYyA9IGNyLnF1ZXJ5KAotICAgICAgICAgICAgICAgICAgICBCT09LTUFSS1NfVVJJLAotICAgICAgICAgICAgICAgICAgICBUUlVOQ0FURV9ISVNUT1JZX1BST0pFQ1RJT04sCi0gICAgICAgICAgICAgICAgICAgICJib29rbWFyayA9IDAiLAotICAgICAgICAgICAgICAgICAgICBudWxsLAotICAgICAgICAgICAgICAgICAgICBCb29rbWFya0NvbHVtbnMuREFURSk7Ci0gICAgICAgICAgICAvLyBMb2cudihMT0dUQUcsICJoaXN0b3J5IGNvdW50ICIgKyBjLmNvdW50KCkpOwotICAgICAgICAgICAgaWYgKGMubW92ZVRvRmlyc3QoKSAmJiBjLmdldENvdW50KCkgPj0gTUFYX0hJU1RPUllfQ09VTlQpIHsKKyAgICAgICAgICAgIGN1cnNvciA9IGNyLnF1ZXJ5KEhpc3RvcnkuQ09OVEVOVF9VUkksCisgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXSB7IEhpc3RvcnkuX0lELCBIaXN0b3J5LlVSTCwgSGlzdG9yeS5EQVRFX0xBU1RfVklTSVRFRCB9LAorICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBIaXN0b3J5LkRBVEVfTEFTVF9WSVNJVEVEICsgIiBBU0MiKTsKKworICAgICAgICAgICAgaWYgKGN1cnNvci5tb3ZlVG9GaXJzdCgpICYmIGN1cnNvci5nZXRDb3VudCgpID49IE1BWF9ISVNUT1JZX0NPVU5UKSB7CisgICAgICAgICAgICAgICAgZmluYWwgV2ViSWNvbkRhdGFiYXNlIGljb25EYiA9IFdlYkljb25EYXRhYmFzZS5nZXRJbnN0YW5jZSgpOwogICAgICAgICAgICAgICAgIC8qIGVsaW1pbmF0ZSBvbGRlc3QgaGlzdG9yeSBpdGVtcyAqLwogICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgVFJVTkNBVEVfTl9PTERFU1Q7IGkrKykgewotICAgICAgICAgICAgICAgICAgICAvLyBMb2cudihMT0dUQUcsICJ0cnVuY2F0ZSBoaXN0b3J5ICIgKwotICAgICAgICAgICAgICAgICAgICAvLyBjLmdldEludChUUlVOQ0FURV9ISVNUT1JZX1BST0pFQ1RJT05fSURfSU5ERVgpKTsKLSAgICAgICAgICAgICAgICAgICAgY3IuZGVsZXRlKEJPT0tNQVJLU19VUkksICJfaWQgPSAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjLmdldEludChUUlVOQ0FURV9ISVNUT1JZX1BST0pFQ1RJT05fSURfSU5ERVgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOwotICAgICAgICAgICAgICAgICAgICBpZiAoIWMubW92ZVRvTmV4dCgpKSBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY3IuZGVsZXRlKENvbnRlbnRVcmlzLndpdGhBcHBlbmRlZElkKEhpc3RvcnkuQ09OVEVOVF9VUkksIGN1cnNvci5nZXRMb25nKDApKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgaWNvbkRiLnJlbGVhc2VJY29uRm9yUGFnZVVybChjdXJzb3IuZ2V0U3RyaW5nKDEpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFjdXJzb3IubW92ZVRvTmV4dCgpKSBicmVhazsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJ0cnVuY2F0ZUhpc3RvcnkiLCBlKTsKICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIGlmIChjICE9IG51bGwpIGMuY2xvc2UoKTsKKyAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCkgY3Vyc29yLmNsb3NlKCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTM4OCwyMyArNDIwLDE3IEBACiAgICAgICogQHJldHVybiBib29sZWFuICBUcnVlIGlmIHRoZSBoaXN0b3J5IGNhbiBiZSBjbGVhcmVkLgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgYm9vbGVhbiBjYW5DbGVhckhpc3RvcnkoQ29udGVudFJlc29sdmVyIGNyKSB7Ci0gICAgICAgIEN1cnNvciBjID0gbnVsbDsKKyAgICAgICAgQ3Vyc29yIGN1cnNvciA9IG51bGw7CiAgICAgICAgIGJvb2xlYW4gcmV0ID0gZmFsc2U7CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBjID0gY3IucXVlcnkoCi0gICAgICAgICAgICAgICAgQk9PS01BUktTX1VSSSwKLSAgICAgICAgICAgICAgICBuZXcgU3RyaW5nIFtdIHsgQm9va21hcmtDb2x1bW5zLl9JRCwgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJvb2ttYXJrQ29sdW1ucy5CT09LTUFSSywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQm9va21hcmtDb2x1bW5zLlZJU0lUUyB9LAotICAgICAgICAgICAgICAgICJib29rbWFyayA9IDAgT1IgdmlzaXRzID4gMCIsIAotICAgICAgICAgICAgICAgIG51bGwsCi0gICAgICAgICAgICAgICAgbnVsbAotICAgICAgICAgICAgICAgICk7Ci0gICAgICAgICAg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gYW5kIHJlbGVhc2UgdGhlIGljb25zIGZvciB0aGVtIGluIHRoZQorICAgICAqIHtAbGluayBXZWJJY29uRGF0YWJhc2V9LgorICAgICAqCisgICAgICogUmVxdWlyZXMge0BsaW5rIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbiNSRUFEX0hJU1RPUllfQk9PS01BUktTfQorICAgICAqIFJlcXVpcmVzIHtAbGluayBhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24jV1JJVEVfSElTVE9SWV9CT09LTUFSS1N9CisgICAgICoKICAgICAgKiBAcGFyYW0gY3IgICBUaGUgQ29udGVudFJlc29sdmVyIHVzZWQgdG8gYWNjZXNzIHRoZSBkYXRhYmFzZS4KICAgICAgKiBAcGFyYW0gd2hlcmVDbGF1c2UgICBTdHJpbmcgdG8gbGltaXQgdGhlIGl0ZW1zIGFmZmVjdGVkLgogICAgICAqICAgICAgICAgICAgICAgICAgICAgIG51bGwgbWVhbnMgYWxsIGl0ZW1zLgogICAgICAqLwotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIHZvaWQgZGVsZXRlSGlzdG9yeVdoZXJlKENvbnRlbnRSZXNvbHZlciBjciwKLSAgICAgICAgICAgIFN0cmluZyB3aGVyZUNsYXVzZSkgewotICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgdm9pZCBkZWxldGVIaXN0b3J5V2hlcmUoQ29udGVudFJlc29sdmVyIGNyLCBTdHJpbmcgd2hlcmVDbGF1c2UpIHsKKyAgICAgICAgQ3Vyc29yIGN1cnNvciA9IG51bGw7CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBjID0gY3IucXVlcnkoQk9PS01BUktTX1VSSSwKLSAgICAgICAgICAgICAgICBISVNUT1JZX1BST0pFQ1RJT04sCi0gICAgICAgICAgICAgICAgd2hlcmVDbGF1c2UsCi0gICAgICAgICAgICAgICAgbnVsbCwKLSAgICAgICAgICAgICAgICBudWxsKTsKLSAgICAgICAgICAgIGlmIChjLm1vdmVUb0ZpcnN0KCkpIHsKKyAgICAgICAgICAgIGN1cnNvciA9IGNyLnF1ZXJ5KEhpc3RvcnkuQ09OVEVOVF9VUkksIG5ldyBTdHJpbmdbXSB7IEhpc3RvcnkuVVJMIH0sIHdoZXJlQ2xhdXNlLAorICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsKTsKKyAgICAgICAgICAgIGlmIChjdXJzb3IubW92ZVRvRmlyc3QoKSkgewogICAgICAgICAgICAgICAgIGZpbmFsIFdlYkljb25EYXRhYmFzZSBpY29uRGIgPSBXZWJJY29uRGF0YWJhc2UuZ2V0SW5zdGFuY2UoKTsKLSAgICAgICAgICAgICAgICAvKiBEZWxldGUgZmF2aWNvbnMsIGFuZCByZXZlcnQgYm9va21hcmtzIHdoaWNoIGhhdmUgYmVlbiB2aXNpdGVkCi0gICAgICAgICAgICAgICAgICogdG8gc2ltcGx5IGJvb2ttYXJrcy4KLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBTdHJpbmdCdWZmZXIgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBmaXJzdFRpbWUgPSB0cnVlOwogICAgICAgICAgICAgICAgIGRvIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHVybCA9IGMuZ2V0U3RyaW5nKEhJU1RPUllfUFJPSkVDVElPTl9VUkxfSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICBib29sZWFuIGlzQm9va21hcmsgPQotICAgICAgICAgICAgICAgICAgICAgICAgYy5nZXRJbnQoSElTVE9SWV9QUk9KRUNUSU9OX0JPT0tNQVJLX0lOREVYKSA9PSAxOwotICAgICAgICAgICAgICAgICAgICBpZiAoaXNCb29rbWFyaykgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpcnN0VGltZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0VGltZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiBPUiAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiKCBfaWQgPSAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChjLmdldEludCgwKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiApIik7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpY29uRGIucmVsZWFzZUljb25Gb3JQYWdlVXJsKHVybCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IHdoaWxlIChjLm1vdmVUb05leHQoKSk7CisgICAgICAgICAgICAgICAgICAgIC8vIERlbGV0ZSBmYXZpY29ucworICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIGRvbid0IHJlbGVhc2UgaWYgdGhlIFVSTCBpcyBib29rbWFya2VkCisgICAgICAgICAgICAgICAgICAgIGljb25EYi5yZWxlYXNlSWNvbkZvclBhZ2VVcmwoY3Vyc29yLmdldFN0cmluZygwKSk7CisgICAgICAgICAgICAgICAgfSB3aGlsZSAoY3Vyc29yLm1vdmVUb05leHQoKSk7CiAKLSAgICAgICAgICAgICAgICBpZiAoIWZpcnN0VGltZSkgewotICAgICAgICAgICAgICAgICAgICBDb250ZW50VmFsdWVzIG1hcCA9IG5ldyBDb250ZW50VmFsdWVzKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1hcC5wdXQoQm9va21hcmtDb2x1bW5zLlZJU0lUUywgMCk7Ci0gICAgICAgICAgICAgICAgICAgIG1hcC5wdXQoQm9va21hcmtDb2x1bW5zLkRBVEUsIDApOwotICAgICAgICAgICAgICAgICAgICAvKiBGSVhNRTogU2hvdWxkIEkgYWxzbyByZW1vdmUgdGhlIHRpdGxlPyAqLwotICAgICAgICAgICAgICAgICAgICBjci51cGRhdGUoQk9PS01BUktTX1VSSSwgbWFwLCBzYi50b1N0cmluZygpLCBudWxsKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBTdHJpbmcgZGVsZXRlV2hlcmVDbGF1c2UgPSBCb29rbWFya0NvbHVtbnMuQk9PS01BUksgKyAiID0gMCI7Ci0gICAgICAgICAgICAgICAgaWYgKHdoZXJlQ2xhdXNlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgZGVsZXRlV2hlcmVDbGF1c2UgKz0gIiBBTkQgIiArIHdoZXJlQ2xhdXNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjci5kZWxldGUoQk9PS01BUktTX1VSSSwgZGVsZXRlV2hlcmVDbGF1c2UsIG51bGwpOworICAgICAgICAgICAgICAgIGNyLmRlbGV0ZShIaXN0b3J5LkNPTlRFTlRfVVJJLCB3aGVyZUNsYXVzZSwgbnVsbCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJkZWxldGVIaXN0b3J5V2hlcmUiLCBlKTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIGlmIChjICE9IG51bGwpIGMuY2xvc2UoKTsKKyAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCkgY3Vyc29yLmNsb3NlKCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTUyMCwxMCArNTE1LDcgQEAKICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIHZvaWQgZGVsZXRlRnJvbUhpc3RvcnkoQ29udGVudFJlc29sdmVyIGNyLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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ICAgICAgKiA8cD5UeXBlOiBCTE9CIChpbWFnZSk8L3A+CisgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGQVZJQ09OID0gImZhdmljb24iOworCiAgICAgICAgIC8qKgogICAgICAgICAgKiBAaGlkZQogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJOQUlMID0gInRodW1ibmFpbCI7CisKICAgICAgICAgLyoqCiAgICAgICAgICAqIEBoaWRlCiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBUT1VDSF9JQ09OID0gInRvdWNoX2ljb24iOworCiAgICAgICAgIC8qKgogICAgICAgICAgKiBAaGlkZQogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVVNFUl9FTlRFUkVEID0gInVzZXJfZW50ZXJlZCI7CiAgICAgfQogCisgICAgLyoqCisgICAgICogQ29sdW1uIGRlZmluaXRpb25zIGZvciB0aGUgc2VhcmNoIGhpc3RvcnkgdGFibGUsIGF2YWlsYWJsZSBhdCB7QGxpbmsgI1NFQVJDSEVTX1VSSX0uCisgICAgICovCiAgICAgcHVibGljIHN0YXRpYyBjbGFzcyBTZWFyY2hDb2x1bW5zIGltcGxlbWVudHMgQmFzZUNvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogQGRlcHJlY2F0ZWQgTm90IHVzZWQuCisgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBVUkwgPSAidXJsIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHVzZXIgZW50ZXJlZCBzZWFyY2ggdGVybS4KKyAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQVJDSCA9ICJzZWFyY2giOworCisgIC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gICAgICAgLyoqIFRoZSBjbGllbnQgdW5pcXVlIElEIGZvciBhbiBpdGVtICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENMSUVOVF9VTklRVUUgPSBCYXNlU3luY0NvbHVtbnMuU1lOQzQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29sdW1ucyB0aGF0IGFwcGVhciB3aGVuIGVhY2ggcm93IG9mIGEgdGFibGUgYmVsb25ncyB0byBhIHNwZWNpZmljCisgICAgICogYWNjb3VudCwgaW5jbHVkaW5nIHN5bmMgaW5mb3JtYXRpb24gdGhhdCBhbiBhY2NvdW50IG1heSBuZWVkLgorICAgICAqLworICAgIGludGVyZmFjZSBTeW5jQ29sdW1ucyBleHRlbmRzIEJhc2VTeW5jQ29sdW1ucyB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbmFtZSBvZiB0aGUgYWNjb3VudCBpbnN0YW5jZSB0byB3aGljaCB0aGlzIHJvdyBiZWxvbmdzLCB3aGljaCB3aGVuIHBhaXJlZCB3aXRoCisgICAgICAgICAqIHtAbGluayAjQUNDT1VOVF9UWVBFfSBpZGVudGlmaWVzIGEgc3BlY2lmaWMgYWNjb3VudC4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDQ09VTlRfTkFNRSA9ICJhY2NvdW50X25hbWUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdHlwZSBvZiBhY2NvdW50IHRvIHdoaWNoIHRoaXMgcm93IGJlbG9uZ3MsIHdoaWNoIHdoZW4gcGFpcmVkIHdpdGgKKyAgICAgICAgICoge0BsaW5rICNBQ0NPVU5UX05BTUV9IGlkZW50aWZpZXMgYSBzcGVjaWZpYyBhY2NvdW50LgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQUNDT1VOVF9UWVBFID0gImFjY291bnRfdHlwZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFN0cmluZyB0aGF0IHVuaXF1ZWx5IGlkZW50aWZpZXMgdGhpcyByb3cgdG8gaXRzIHNvdXJjZSBhY2NvdW50LgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU09VUkNFX0lEID0gInNvdXJjZWlkIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVmVyc2lvbiBudW1iZXIgdGhhdCBpcyB1cGRhdGVkIHdoZW5ldmVyIHRoaXMgcm93IG9yIGl0cyByZWxhdGVkIGRhdGEKKyAgICAgICAgICogY2hhbmdlcy4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFZFUlNJT04gPSAidmVyc2lvbiI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEZsYWcgaW5kaWNhdGluZyB0aGF0IHtAbGluayAjVkVSU0lPTn0gaGFzIGNoYW5nZWQsIGFuZCB0aGlzIHJvdyBuZWVkcworICAgICAgICAgKiB0byBiZSBzeW5jaHJvbml6ZWQgYnkgaXRzIG93bmluZyBhY2NvdW50LgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChib29sZWFuKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERJUlRZID0gImRpcnR5IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHRpbWUgdGhhdCB0aGlzIHJvdyB3YXMgbGFzdCBtb2RpZmllZCBieSBhIGNsaWVudCAobXNlY3Mgc2luY2UgdGhlIGVwb2NoKS4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERBVEVfTU9ESUZJRUQgPSAibW9kaWZpZWQiOworICAgIH0KKworICAgIGludGVyZmFjZSBDb21tb25Db2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB1bmlxdWUgSUQgZm9yIGEgcm93LgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIF9JRCA9ICJfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgVVJMIG9mIHRoZSBib29rbWFyay4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVCAoVVJMKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFVSTCA9ICJ1cmwiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdXNlciB2aXNpYmxlIHRpdGxlIG9mIHRoZSBib29rbWFyay4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRJVExFID0gInRpdGxlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHRpbWUgdGhhdCB0aGlzIHJvdyB3YXMgY3JlYXRlZCBvbiBpdHMgb3JpZ2luYXRpbmcgY2xpZW50IChtc2VjcworICAgICAgICAgKiBzaW5jZSB0aGUgZXBvY2gpLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgREFURV9DUkVBVEVEID0gImNyZWF0ZWQiOworICAgIH0KKworICAgIGludGVyZmFjZSBJbWFnZUNvbHVtbnMgeworICAgICAgICAvKioK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lZCwgaW4gbWlsbGlzZWNvbmRzIHNpbmNlIHRoZSBlcG9jaC4KKyAgICAgICAgICogPHA+VHlwZTogSU5URUdFUiAoZGF0ZSBpbiBtaWxsaXNlY29uZHMgc2luY2UgSmFudWFyeSAxLCAxOTcwKTwvcD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERBVEVfTEFTVF9WSVNJVEVEID0gImRhdGUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbnVtYmVyIG9mIHRpbWVzIHRoZSBpdGVtIGhhcyBiZWVuIHZpc2l0ZWQuCisgICAgICAgICAqIDxwPlR5cGU6IElOVEVHRVI8L3A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBWSVNJVFMgPSAidmlzaXRzIjsKKworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBVU0VSX0VOVEVSRUQgPSAidXNlcl9lbnRlcmVkIjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGUgYm9va21hcmtzIHRhYmxlLCB3aGljaCBob2xkcyB0aGUgdXNlcidzIGJyb3dzZXIgYm9va21hcmtzLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgQm9va21hcmtzIGltcGxlbWVudHMgQ29tbW9uQ29sdW1ucywgSW1hZ2VDb2x1bW5zLCBTeW5jQ29sdW1ucyB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGlzIHV0aWxpdHkgY2xhc3MgY2Fubm90IGJlIGluc3RhbnRpYXRlZC4KKyAgICAgICAgICovCisgICAgICAgIHByaXZhdGUgQm9va21hcmtzKCkge30KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKEFVVEhPUklUWV9VUkksICJib29rbWFya3MiKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGUgZGVmYXVsdCBmb2xkZXIKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJX0RFRkFVTFRfRk9MREVSID0KKyAgICAgICAgICAgICAgICBVcmkud2l0aEFwcGVuZGVkUGF0aChDT05URU5UX1VSSSwgImZvbGRlciIpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBRdWVyeSBwYXJhbWV0ZXIgdXNlZCB0byBzcGVjaWZ5IGFuIGFjY291bnQgbmFtZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEFSQU1fQUNDT1VOVF9OQU1FID0gImFjY3RfbmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFF1ZXJ5IHBhcmFtZXRlciB1c2VkIHRvIHNwZWNpZnkgYW4gYWNjb3VudCB0eXBlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQQVJBTV9BQ0NPVU5UX1RZUEUgPSAiYWNjdF90eXBlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQnVpbGRzIGEgVVJJIHRoYXQgcG9pbnRzIHRvIGEgc3BlY2lmaWMgZm9sZGVyLgorICAgICAgICAgKiBAcGFyYW0gZm9sZGVySWQgdGhlIElEIG9mIHRoZSBmb2xkZXIgdG8gcG9pbnQgdG8KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIGJ1aWxkRm9sZGVyVXJpKGxvbmcgZm9sZGVySWQpIHsKKyAgICAgICAgICAgIHJldHVybiBDb250ZW50VXJpcy53aXRoQXBwZW5kZWRJ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ZQorICAgICAgICAgKiBhIGZvbGRlciBhbmQgemVybyBpbmRpY2F0ZXMgYSBib29rbWFyay4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAoYm9vbGVhbik8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBJU19GT0xERVIgPSAiZm9sZGVyIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIElEIG9mIHRoZSBwYXJlbnQgZm9sZGVyLiBJRCAwIGlzIHRoZSByb290IGZvbGRlci4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAocmVmZXJlbmNlIHRvIGl0ZW0gaW4gdGhlIHNhbWUgdGFibGUpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEFSRU5UID0gInBhcmVudCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBzb3VyY2UgSUQgZm9yIGFuIGl0ZW0ncyBwYXJlbnQuIFJlYWQtb25seS4KKyAgICAgICAgICogQHNlZSAjUEFSRU5UCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQQVJFTlRfU09VUkNFX0lEID0gInBhcmVudF9zb3VyY2UiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgcG9zaXRpb24gb2YgdGhlIGJvb2ttYXJrIGluIHJlbGF0aW9uIHRvIGl0J3Mgc2libGluZ3MgdGhhdCBzaGFyZSB0aGUgc2FtZQorICAgICAgICAgKiB7QGxpbmsgI1BBUkVOVH0uIE1heSBiZSBuZWdhdGl2ZS4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBPU0lUSU9OID0gInBvc2l0aW9uIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGl0ZW0gdGhhdCB0aGUgYm9va21hcmsgc2hvdWxkIGJlIGluc2VydGVkIGFmdGVyLgorICAgICAgICAgKiBNYXkgYmUgbmVnYXRpdmUuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBJTlNFUlRfQUZURVIgPSAiaW5zZXJ0X2FmdGVyIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHNvdXJjZSBJRCBmb3IgdGhlIGl0ZW0gdGhhdCB0aGUgYm9va21hcmsgc2hvdWxkIGJlIGluc2VydGVkIGFmdGVyLiBSZWFkLW9ubHkuCisgICAgICAgICAqIE1heSBiZSBuZWdhdGl2ZS4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICogQHNlZSAjSU5TRVJUX0FGVEVSCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBJTlNFUlRfQUZURVJfU09VUkNFX0lEID0gImluc2VydF9hZnRlcl9zb3VyY2UiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIGZsYWcgdG8gaW5kaWNhdGUgaWYgYW4gaXRlbSBoYXMgYmVlbiBkZWxldGVkLiBRdWVyaWVzIHdpbGwgbm90IHJldHVybiBkZWxldGVkCisgICAgICAgICAqIGVudHJpZXMgdW5sZXNzIHlvdSBhZGQgdGhlIHtAbGluayAjUVVFUllfUEFSQU1FVEVSX1NIT1dfREVMRVRFRH0gcXVlcnkgcGFyYW10ZXIKKyAgICAgICAgICogdG8gdGhlIFVSSSB3aGVuIHBlcmZvcm1pbmcgeW91ciBxdWVyeS4KKyAgICAgICAgICogPHA+VHlwZTogSU5URUdFUiAobm9uLXplcm8gaWYgdGhlIGl0ZW0gaGFzIGJlZW4gZGVsZXRlZCwgemVybyBpZiBpdCBoYXNuJ3QpCisgICAgICAgICAqIEBzZWUgI1FVRVJZX1BBUkFNRVRFUl9TSE9XX0RFTEVURUQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElTX0RFTEVURUQgPSAiZGVsZXRlZCI7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVhZC1vbmx5IHRhYmxlIHRoYXQgbGlzdHMgYWxsIHRoZSBhY2NvdW50cyB0aGF0IGFyZSB1c2VkIHRvIHByb3ZpZGUgYm9va21hcmtzLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgQWNjb3VudHMgeworICAgICAgICAvKioKKyAgICAgICAgICogRGlyZWN0b3J5IHVuZGVyIHtAbGluayBCb29rbWFya3MjQ09OVEVOVF9VUkl9CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9CisgICAgICAgICAgICAgICAgQVVUSE9SSVRZX1VSSS5idWlsZFVwb24oKS5hcHBlbmRQYXRoKCJhY2NvdW50cyIpLmJ1aWxkKCk7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBuYW1lIG9mIHRoZSBhY2NvdW50IGluc3RhbmNlIHRvIHdoaWNoIHRoaXMgcm93IGJlbG9uZ3MsIHdoaWNoIHdoZW4gcGFpcmVkIHdpdGgKKyAgICAgICAgICoge0BsaW5rICNBQ0NPVU5UX1RZUEV9IGlkZW50aWZpZXMgYSBzcGVjaWZpYyBhY2NvdW50LgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQUNDT1VOVF9OQU1FID0gImFjY291bnRfbmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0eXBlIG9mIGFjY291bnQgdG8gd2hpY2ggdGhpcyByb3cgYmVsb25ncywgd2hpY2ggd2hlbiBwYWlyZWQgd2l0aAorICAgICAgICAgKiB7QGx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nkiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIGEge0BsaW5rICNDT05URU5UX1VSSX0gb2YgYSBzaW5nbGUgYnJvd3NlciBoaXN0b3J5IGl0ZW0uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0lURU1fVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS9icm93c2VyLWhpc3RvcnkiOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRoZSBzZWFyY2ggaGlzdG9yeSB0YWJsZS4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgU2VhcmNoZXMgeworICAgICAgICBwcml2YXRlIFNlYXJjaGVzKCkge30KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKEFVVEhPUklUWV9VUkksICJzZWFyY2hlcyIpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIHtAbGluayAjQ09OVEVOVF9VUkl9IHByb3ZpZGluZyBhIGRpcmVjdG9yeSBvZiBicm93c2VyIHNlYXJjaCBpdGVtcy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL3NlYXJjaGVzIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIE1JTUUgdHlwZSBvZiBhIHtAbGluayAjQ09OVEVOVF9VUkl9IG9mIGEgc2luZ2xlIGJyb3dzZXIgc2VhcmNoIGl0ZW0u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nRyYWN0LkNvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyB1dGlsaXR5IGNsYXNzIGNhbm5vdCBiZSBpbnN0YW50aWF0ZWQKKyAgICAgICAgICovCisgICAgICAgIHByaXZhdGUgU3luY1N0YXRlKCkge30KKworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0RJUkVDVE9SWSA9CisgICAgICAgICAgICAgICAgU3luY1N0YXRlQ29udHJhY3QuQ29uc3RhbnRzLkNPTlRFTlRfRElSRUNUT1JZOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkkgZm9yIHRoaXMgdGFibGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJID0KKyAgICAgICAgICAgICAgICBVcmkud2l0aEFwcGVuZGVkUGF0aChBVVRIT1JJVFlfVVJJLCBDT05URU5UX0RJUkVDVE9SWSk7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEBzZWUgYW5kcm9pZC5wcm92aWRlci5TeW5jU3RhdGVDb250cmFjdC5IZWxwZXJzI2dldAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBieXRlW10gZ2V0KENvbnRlbnRQcm92aWRlckNsaWVudCBwcm92aWRlciwgQWNjb3VudCBhY2NvdW50KQorICAgICAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgcmV0dXJuIFN5bmNTdGF0ZUNvbnRyYWN0LkhlbHBlcnMuZ2V0KHByb3ZpZGVyLCBDT05URU5UX1VSSSwgYWNjb3VudCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQHNlZSBhbmRyb2lkLnByb3ZpZGVyLlN5bmNTdGF0ZUNvbnRyYWN0LkhlbHBlcnMjZ2V0CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIFBhaXI8VXJpLCBieXRlW10+IGdldFdpdGhVcmkoQ29udGVudFByb3ZpZGVyQ2xpZW50IHByb3ZpZGVyLCBBY2NvdW50IGFjY291bnQpCisgICAgICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICByZXR1cm4gU3luY1N0YXRlQ29udHJhY3QuSGVscGVycy5nZXRXaXRoVXJpKHByb3ZpZGVyLCBDT05URU5UX1VSSSwgYWNjb3VudCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQHNlZSBhbmRyb2lkLnByb3ZpZGVyLlN5bmNTdGF0ZUNvbnRyYWN0LkhlbHBlcnMjc2V0CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIHZvaWQgc2V0KENvbnRlbnRQcm92aWRlckNsaWVudCBwcm92aWRlciwgQWNjb3VudCBhY2NvdW50LCBieXRlW10gZGF0YSkKKyAgICAgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIFN5bmNTdGF0ZUNvbnRyYWN0LkhlbHBlcnMuc2V0KHByb3ZpZGVyLCBDT05URU5UX1VSSSwgYWNjb3VudCwgZGF0YSk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQHNlZSBhbmRyb2lkLnByb3ZpZGVyLlN5bmNTdGF0ZUNvbnRyYWN0LkhlbHBlcnMjbmV3U2V0T3BlcmF0aW9uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbiBuZXdTZXRPcGVyYXRpb24oQWNjb3VudCBhY2NvdW50LCBieXRlW10gZGF0YSkgeworICAgICAgICAgICAgcmV0dXJuIFN5bmNTdGF0ZUNvbnRyYWN0LkhlbHBlcnMubmV3U2V0T3BlcmF0aW9uKENPTlRFTlRfVVJJLCBhY2NvdW50LCBkYXRhKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFN0b3JlcyBpbWFnZXMgZm9yIFVSTHMuIE9ubHkgc3VwcG9ydCBxdWVyeSgpIGFuZCB1cGRhdGUoKS4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgSW1hZ2VzIGltcGxlbWVudHMgSW1hZ2VDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoaXMgdXRpbGl0eSBjbGFzcyBjYW5ub3QgYmUgaW5zdGFudGlhdGVkCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIEltYWdlcygpIHt9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSSSBmb3IgdGhpcyB0YWJsZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9VUkkgPSBVcmkud2l0aEFwcGVuZGVkUGF0aChBVVRIT1JJVFlfVVJJLCAiaW1hZ2VzIik7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBVUkwgdGhlIGltYWdlcyBjYW1lIGZyb20uCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQgKFVSTCk8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBVUkwgPSAidXJsX2tleSI7CisgICAgfQorCisgICAgLyoqCisgICAgICogQSBjb21iaW5lZCB2aWV3IG9mIGJvb2ttYXJrcyBhbmQgaGlzdG9yeS4gQWxsIGJvb2ttYXJrcyBpbiBhbGwgZm9sZGVycyBhcmUgaW5jbHVkZWQgYW5kCisgICAgICogbm8gZm9sZGVycyBhcmUgaW5jbHVkZWQuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBDb21iaW5lZCBpbXBsZW1lbnRzIENvbW1vbkNvbHVtbnMsIEhpc3RvcnlDb2x1bW5zLCBJbWFnZUNvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyB1dGlsaXR5IGNsYXNzIGNhbm5vdCBiZSBpbnN0YW50aWF0ZWQKKyAgICAgICAgICovCisgICAgICAgIHByaXZhdGUgQ29tYmluZWQoKSB7fQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkkgZm9yIHRoaXMgdGFibGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJID0gVXJpLndpdGhBcHBlbmRlZFBhdGgoQVVUSE9SSVRZX1VSSSwgImNvbWJpbmVkIik7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEZsYWcgaW5kaWNhdGluZyB0aGF0IGFuIGl0ZW0gaXMgYSBib29rbWFyay4gQSB2YWx1ZSBvZiAxIGluZGljYXRlcyBhIGJvb2ttYXJrLCBhIHZhbHVlCisgICAgICAgICAqIG9mIDAgaW5kaWNhdGVzIGEgaGlzdG9yeSBpdGVtLgorICAgICAgICAgKiA8cD5UeXBlOiBJTlRFR0VSIChib29sZWFuKTwvcD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElTX0JPT0tNQVJLID0gImJvb2ttYXJrIjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBIHRhYmxlIHRoYXQgc3RvcmVzIHNldHRpbmdzIHNwZWNpZmljIHRvIHRoZSBicm93c2VyLiBPbmx5IHN1cHBvcnQgcXVlcnkgYW5kIGluc2VydC4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFNldHRpbmdzIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoaXMgdXRpbGl0eSBjbGFzcyBjYW5ub3QgYmUgaW5zdGFudGlhdGVkCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIFNldHRpbmdzKCkge30KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKEFVVEhPUklUWV9VUkksICJzZXR0aW5ncyIpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBLZXkgZm9yIGEgc2V0dGluZyB2YWx1ZS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEtFWSA9ICJrZXkiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBWYWx1ZSBmb3IgYSBzZXR0aW5nLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVkFMVUUgPSAidmFsdWUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBJZiBzZXQgdG8gbm9uLTAgdGhlIHVzZXIgaGFzIG9wdGVkIGludG8gYm9va21hcmsgc3luYy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEtFWV9TWU5DX0VOQUJMRUQgPSAic3luY19lbmFibGVkIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJucyB0cnVlIGlmIGJvb2ttYXJrIHN5bmMgaXMgZW5hYmxlZAorICAgICAgICAgKi8KKyAgICAgICAgc3RhdGljIHB1YmxpYyBib29sZWFuIGlzU3luY0VuYWJsZWQoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICBDdXJzb3IgY3Vyc29yID0gbnVsbDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgY3Vyc29yID0gY29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeShDT05URU5UX1VSSSwgbmV3IFN0cmluZ1tdIHsgVkFMVUUgfSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEtFWSArICI9PyIsIG5ldyBTdHJpbmdbXSB7IEtFWV9TWU5DX0VOQUJMRUQgfSwgbnVsbCk7CisgICAgICAgICAgICAgICAgaWYgKGN1cnNvciA9PSBudWxsIHx8ICFjdXJzb3IubW92ZVRvRmlyc3QoKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBjdXJzb3IuZ2V0SW50KDApICE9IDA7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCkgY3Vyc29yLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogU2V0cyB0aGUgYm9va21hcmsgc3luYyBlbmFibGVkIHNldHRpbmcuCisgICAgICAgICAqLworICAgICAgICBzdGF0aWMgcHVibGljIHZvaWQgc2V0U3luY0VuYWJsZWQoQ29udGV4dCBjb250ZXh0LCBib29sZWFuIGVuYWJsZWQpIHsKKyAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgdmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoS0VZLCBLRVlfU1lOQ19FTkFCTEVEKTsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoVkFMVUUsIGVuYWJsZWQgPyAxIDogMCk7CisgICAgICAgICAgICBjb250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLmluc2VydChDT05URU5UX1VSSSwgdmFsdWVzKTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3Byb3ZpZGVyL0NhbGVuZGFyLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9wcm92aWRlci9DYWxlbmRhci5qYXZhCmluZGV4IDYzNTVhOWMu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5DMyA9ICJzeW5jMyI7CisgICAgICAgIC8qKiBHZW5lcmljIGNvbHVtbiBmb3IgdXNlIGJ5IHN5bmMgYWRhcHRlcnMuICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNZTkM0ID0gInN5bmM0IjsKKyAgICAgICAgLyoqIEdlbmVyaWMgY29sdW1uIGZvciB1c2UgYnkgc3luYyBhZGFwdGVycy4gKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU1lOQzUgPSAic3luYzUiOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbHVtbnMgZm9yIFN5bmMgaW5mb3JtYXRpb24gdXNlZCBieSBDYWxlbmRhcnMgYW5kIEV2ZW50cyB0YWJsZXMuCisgICAgICovCisgICAgcHVibGljIGludGVyZmFjZSBTeW5jQ29sdW1ucyBleHRlbmRzIEJhc2VTeW5jQ29sdW1ucyB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgYWNjb3VudCB0aGF0IHdhcyB1c2VkIHRvIHN5bmMgdGhlIGVudHJ5IHRvIHRoZSBkZXZpY2UuCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBfU1lOQ19BQ0NPVU5UID0gIl9zeW5jX2FjY291bnQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdHlwZSBvZiB0aGUgYWNjb3VudCB0aGF0IHdhcyB1c2VkIHRvIHN5bmMgdGhlIGVudHJ5IHRvIHRoZSBkZXZpY2UuCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBfU1lOQ19BQ0NPVU5UX1RZUEUgPSAiX3N5bmNfYWNjb3VudF90eXBlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHVuaX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uCisgICAgICAgICAqIFRPRE8gUmVwbGFjZSB0aGlzIHdpdGggc29tZXRoaW5nIG1vcmUgZ2VuZXJhbCBpbiB0aGUgZnV0dXJlLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIF9TWU5DX0RBVEEgPSAiX3N5bmNfbG9jYWxfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBVc2VkIG9ubHkgaW4gcGVyc2lzdGVudCBwcm92aWRlcnMsIGFuZCBvbmx5IGR1cmluZyBtZXJnaW5nLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIF9TWU5DX01BUksgPSAiX3N5bmNfbWFyayI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFVzZWQgdG8gaW5kaWNhdGUgdGhhdCBsb2NhbCwgdW5zeW5jZWQsIGNoYW5nZXMgYXJlIHByZXNlbnQuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGxvbmcpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgX1NZTkNfRElSVFkgPSAiX3N5bmNfZGlydHkiOworCisgICAgfQorCisgICAgLyoqCisgICAgICogQ29sdW1ucyBmcm9tIHRoZSBBY2NvdW50IGluZm9ybWF0aW9uIHVzZWQgYnkgQ2FsZW5kYXJzIGFuZCBFdmVudHMgdGFibGVzLgorICAgICAqLworICAgIHB1YmxpYyBpbnRlcmZhY2UgQWNjb3VudENvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG5hbWUgb2YgdGhlIGFjY291bnQgaW5zdGFuY2UgdG8gd2hpY2ggdGhpcyByb3cgYmVsb25ncywgd2hpY2ggd2hlbiBwYWlyZWQgd2l0aAorICAgICAgICAgKiB7QGxpbmsgI0FDQ09VTlRfVFlQRX0gaWRlbnRpZmllcyBhIHNwZWNpZmljIGFjY291bnQuCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBQ0NPVU5UX05BTUUgPSAiYWNjb3VudF9uYW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHR5cGUgb2YgYWNjb3VudCB0byB3aGljaCB0aGlzIHJvdyBiZWxvbmdzLCB3aGljaCB3aGVuIHBhaXJlZCB3aXRoCisgICAgICAgICAqIHtAbGluayAjQUNDT1VOVF9OQU1FfSBpZGVudGlmaWVzIGEgc3BlY2lmaWMgYWNjb3VudC4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDQ09VTlRfVFlQRSA9ICJhY2NvdW50X3R5cGUiOworICAgIH0KKwogICAgIC8qKgogICAgICAqIENvbHVtbnMgZnJvbSB0aGUgQ2FsZW5kYXJzIHRhYmxlIHRoYXQgb3RoZXIgdGFibGVzIGpvaW4gaW50byB0aGVtc2VsdmVzLgogICAgICAqLwotICAgIHB1YmxpYyBpbnRlcmZhY2UgQ2FsZW5kYXJzQ29sdW1ucwotICAgIHsKKyAgICBwdWJsaWMgaW50ZXJmYWNlIENhbGVuZGFyc0NvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGNvbG9yIG9mIHRoZSBjYWxlbmRhcgogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChjb2xvciB2YWx1ZSk8L1A+CkBAIC0xMzUsNzUgKzIzMCwxMDMgQEAKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU1lOQ19TVEFURSA9ICJzeW5jX3N0YXRlIjsKIAogICAgIC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LSAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAobG9uZyk8L1A+Ci0gICAgICAgICAqLwotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBfU1lOQ19NQVJLID0gIl9zeW5jX21hcmsiOwotCi0gICAgICAgIC8qKgotICAgICAgICAgKiBVc2VkIHRvIGluZGljYXRlIHRoYXQgbG9jYWwsIHVuc3luY2VkLCBjaGFuZ2VzIGFyZSBwcmVzZW50LgotICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KLSAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIF9TWU5DX0RJUlRZID0gIl9zeW5jX2RpcnR5IjsKLQotICAgICAgICAvKioKLSAgICAgICAgICogVGhlIG5hbWUgb2YgdGhlIGFjY291bnQgaW5zdGFuY2UgdG8gd2hpY2ggdGhpcyByb3cgYmVsb25ncywgd2hpY2ggd2hlbiBwYWlyZWQgd2l0aAotICAgICAgICAgKiB7QGxpbmsgI0FDQ09VTlRfVFlQRX0gaWRlbnRpZmllcyBhIHNwZWNpZmljIGFjY291bnQuCi0gICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+Ci0gICAgICAgICAqLwotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBQ0NPVU5UX05BTUUgPSAiYWNjb3VudF9uYW1lIjsKLQotICAgICAgICAvKioKLSAgICAgICAgICogVGhlIHR5cGUgb2YgYWNjb3VudCB0byB3aGljaCB0aGlzIHJvdyBiZWxvbmdzLCB3aGljaCB3aGVuIHBhaXJlZCB3aXRoCi0gICAgICAgICAqIHtAbGluayAjQUNDT1VOVF9OQU1FfSBpZGVudGlmaWVzIGEgc3BlY2lmaWMgYWNjb3VudC4KLSAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KLSAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE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0ZW5kcyBDdXJzb3JFbnRpdHlJdGVyYXRvciB7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIENvbnRlbnRSZXNvbHZlciBtUmVzb2x2ZXI7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIENvbnRlbnRQcm92aWRlckNsaWVudCBtUHJvdmlkZXI7CisKKyAgICAgICAgICAgIHB1YmxpYyBFbnRpdHlJdGVyYXRvckltcGwoQ3Vyc29yIGN1cnNvciwgQ29udGVudFJlc29sdmVyIHJlc29sdmVyKSB7CisgICAgICAgICAgICAgICAgc3VwZXIoY3Vyc29yKTsKKyAgICAgICAgICAgICAgICBtUmVzb2x2ZXIgPSByZXNvbHZlcjsKKyAgICAgICAgICAgICAgICBtUHJvdmlkZXIgPSBudWxsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgRW50aXR5SXRlcmF0b3JJbXBsKEN1cnNvciBjdXJzb3IsIENvbnRlbnRQcm92aWRlckNsaWVudCBwcm92aWRlcikgeworICAgICAgICAgICAgICAgIHN1cGVyKGN1cnNvcik7CisgICAgICAgICAgICAgICAgbVJlc29sdmVyID0gbnVsbDsKKyAgICAgICAgICAgICAgICBtUHJvdmlkZXIgPSBwcm92aWRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgRW50aXR5IGdldEVudGl0eUFuZEluY3JlbWVudEN1cnNvcihDdXJzb3IgY3Vyc29yKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICAvLyB3ZSBleHBlY3QgdGhlIGN1cnNvciBpcyBhbHJlYWR5IGF0IHRoZSByb3cgd2UgbmVlZCB0byByZWFkIGZyb20KKyAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGNhbGVuZGFySWQgPSBjdXJzb3IuZ2V0TG9uZyhjdXJzb3IuZ2V0Q29sdW1uSW5kZXhPclRocm93KF9JRCkpOworCisgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIHRoZSBjb250ZW50IHZhbHVlCisgICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyBjdiA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgICAgICAgICAgY3YucHV0KF9JRCwgY2FsZW5kYXJJZCk7CisKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBfU1lOQ19BQ0NPVU5UKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBfU1lOQ19BQ0NPVU5UX1RZUEUpOworCisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgX1NZTkNfSUQpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX1ZFUlNJT04pOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX1RJTUUpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX0RBVEEpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yTG9uZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBfU1lOQ19ESVJUWSk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JMb25nVG9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GN2LCBDYWxlbmRhcnMuQ09MT1IpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIEFDQ0VTU19MRVZFTCk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JJbnRUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgU0VMRUNURUQpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIFNZTkNfRVZFTlRTKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBDYWxlbmRhcnMuTE9DQVRJT04pOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIFRJTUVaT05FKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LAorICAgICAgICAgICAgICAgICAgICAgICAgQ2FsZW5kYXJzLk9XTkVSX0FDQ09VTlQpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsCisgICAgICAgICAgICAgICAgICAgICAgICBDYWxlbmRhcnMuT1JHQU5JWkVSX0NBTl9SRVNQT05EKTsKKworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIERFTEVURUQpOworCisgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIHRoZSBFbnRpdHkgZnJvbSB0aGUgQ29udGVudFZhbHVlCisgICAgICAgICAgICAgICAgRW50aXR5IGVudGl0eSA9IG5ldyBFbnRpdHkoY3YpOworCisgICAgICAgICAgICAgICAgLy8gU2V0IGN1cnNvciB0byBuZXh0IHJvdworICAgICAgICAgICAgICAgIGN1cnNvci5tb3ZlVG9OZXh0KCk7CisKKyAgICAgICAgICAgICAgICAvLyBSZXR1cm4gdGhlIGNyZWF0ZWQgRW50aXR5CisgICAgICAgICAgICAgICAgcmV0dXJuIGVudGl0eTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICB9CisKKyAgICAvKioKICAgICAgKiBDb250YWlucyBhIGxpc3Qgb2YgYXZhaWxhYmxlIGNhbGVuZGFycy4KICAgICAgKi8KLSAgICBwdWJsaWMgc3RhdGljIGNsYXNzIENhbGVuZGFycyBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBDYWxlbmRhcnNDb2x1bW5zCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBDYWxlbmRhcnMgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgU3luY0NvbHVtbnMsIEFjY291bnRDb2x1bW5zLAorICAgICAgICAgICAgQ2FsZW5kYXJzQ29sdW1ucwogICAgIHsKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIFdIRVJFX0RFTEVURV9GT1JfQUNDT1VOVCA9IENhbGVuZGFycy5fU1lOQ19BQ0NPVU5UICsgIj0/IgogICAgICAgICAgICAgICAgICsgIiBBTkQgIiArIENhbGVuZGFycy5fU1lOQ19BQ0NPVU5UX1RZUEUgKyAiPT8iOwpAQCAtMjU4LDYgKzM4MSwyNCBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBVUkwgPSAidXJsIjsKIAogICAgICAgICAvKioKKyAgICAgICAgICogVGhlIFVSTCBmb3IgdGhlIGNhbGVuZGFyIGl0c2VsZgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUIChVUkwpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0VMRl9VUkwgPSAic2VsZlVybCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBVUkwgZm9yIHRoZSBjYWxlbmRhciB0byBiZSBlZGl0ZWQKKyAgICAgICAgICogPFA+VHlwZTogVEVYVCAoVVJMKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVESVRfVVJMID0gImVkaXRVcmwiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgVVJMIGZvciB0aGUgY2FsZW5kYXIgZXZlbnRzCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQgKFVSTCk8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFVkVOVFNfVVJMID0gImV2ZW50c1VybCI7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBuYW1lIG9mIHRoZSBjYWxlbmRhcgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KQEAgLTI3NiwxMiArNDE3LDYgQEAKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTE9DQVRJT04gPSAibG9jYXRpb24iOwogCiAgICAgICAgIC8qKgotICAgICAgICAgKiBTaG91bGQgdGhlIGNhbGVuZGFyIGJlIGhpZGRlbiBpbiB0aGUgY2FsZW5kYXIgc2VsZWN0aW9uIHBhbmVsPwotICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChib29sZWFuKTwvUD4KLSAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEhJRERFTiA9ICJoaWRkZW4iOwotCi0gICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgb3duZ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EID0gImR0ZW5kIjsKIAogICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHRpbWUgdGhlIGV2ZW50IHN0YXJ0cyB3aXRoIGFsbERheSBldmVudHMgaW4gYSBsb2NhbCB0egorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nOyBtaWxsaXMgc2luY2UgZXBvY2gpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRFRTVEFSVDIgPSAiZHRzdGFydDIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdGltZSB0aGUgZXZlbnQgZW5kcyB3aXRoIGFsbERheSBldmVudHMgaW4gYSBsb2NhbCB0egorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nOyBtaWxsaXMgc2luY2UgZXBvY2gpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRFRFTkQyID0gImR0ZW5kMiI7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBkdXJhdGlvbiBvZiB0aGUgZXZlbnQKICAgICAgICAgICogPFA+VHlwZTogVEVYVCAoZHVyYXRpb24gaW4gUkZDMjQ0NSBmb3JtYXQpPC9QPgogICAgICAgICAgKi8KQEAgLTQ1MCw2ICs1OTksMTIgQEAKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRVZFTlRfVElNRVpPTkUgPSAiZXZlbnRUaW1lem9uZSI7CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0aW1lem9uZSBmb3IgdGhlIGV2ZW50LCBhbGxEYXkgZXZlbnRzIHdpbGwgaGF2ZSBhIGxvY2FsIHR6IGluc3RlYWQgb2YgVVRDCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVWRU5UX1R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VyZSArICIpIEFORCAiICsgV0hFUkVfQ0FMRU5EQVJTX1NFTEVDVEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGNyLnF1ZXJ5KGJ1aWxkZXIuYnVpbGQoKSwgcHJvamVjdGlvbiwgd2hlcmUsIG51bGwsCisgICAgICAgICAgICAgICAgICAgIG9yZGVyQnkgPT0gbnVsbCA/IERFRkFVTFRfU09SVF9PUkRFUiA6IG9yZGVyQnkpOworICAgICAgICB9CisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3IgdGhpcyB0YWJsZQogICAgICAgICAgKi8KQEAgLTg4MCw2ICsxMDYxLDEwIEBACiAgICAgICAgICAgICAgICAgIi9pbnN0YW5jZXMvd2hlbiIpOwogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX0JZX0RBWV9VUkkgPQogICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vIiArIEFVVEhPUklUWSArICIvaW5zdGFuY2VzL3doZW5ieWRheSIpOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1NFQVJDSF9VUkkgPSBVcmkucGFyc2UoImNvbnRlbnQ6Ly8iICsgQVVUSE9SSVRZICsKKyAgICAgICAgICAgICAgICAiL2luc3RhbmNlcy9zZWFyY2giKTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9TRUFSQ0hfQllfREFZX1VSSSA9CisgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly8iICsgQVVUSE9SSVRZICsgIi9pbnN0YW5jZXMvc2VhcmNoYnlkYXkiKTsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGRlZmF1bHQgc29ydCBvcmRlciBmb3IgdGhpcyB0YWJsZS4KQEAgLTg5Niw3ICsxMDgxLDYgQEAKICAgICAgICAgICogcmVxdWly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GltZXMgdGFibGUKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50ZXJmYWNlIEV2ZW50c1Jhd1RpbWVzQ29sdW1ucyB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgY29ycmVzcG9uZGluZyBldmVudCBpZAorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVWRU5UX0lEID0gImV2ZW50X2lkIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIFJGQzI0NDUgY29tcGxpYW50IHRpbWUgdGhlIGV2ZW50IHN0YXJ0cworICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRFRTVEFSVF8yNDQ1ID0gImR0c3RhcnQyNDQ1IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIFJGQzI0NDUgY29tcGxpYW50IHRpbWUgdGhlIGV2ZW50IGVuZHMKKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERURU5EXzI0NDUgPSAiZHRlbmQyNDQ1IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIFJGQzI0NDUgY29tcGxpYW50IG9yaWdpbmFsIGluc3RhbmNlIHRpbWUgb2YgdGhlIHJlY3VycmluZyBldmVudCBmb3Igd2hpY2ggdGhpcworICAgICAgICAgKiBldmVudCBpcyBhbiBleGNlcHRpb24uCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBPUklHSU5BTF9JTlNUQU5DRV9USU1FXzI0NDUgPSAib3JpZ2luYWxJbnN0YW5jZVRpbWUy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XJ9KS4gSWYgdGhlIGFjY291bnQgaXMgbGF0ZXIgcmVtb3ZlZCwKKyAgICAgKiB0aGUgY29ycmVzcG9uZGluZyBkaXJlY3Rvcnkgcm93cyBhcmUgYXV0b21hdGljYWxseSByZW1vdmVkIGZyb20gdGhlIENvbnRhY3RzIFByb3ZpZGVyLgorICAgICAqIDwvcD4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIERpcmVjdG9yeSBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zIHsKKworICAgICAgICAvKioKKyAgICAgICAgICogTm90IGluc3RhbnRpYWJsZS4KKyAgICAgICAgICovCisgICAgICAgIHByaXZhdGUgRGlyZWN0b3J5KCkgeworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSSSBmb3IgdGhpcyB0YWJsZS4gIFJlcXVlc3RzIHRvIHRoaXMgVVJJIGNhbiBiZQorICAgICAgICAgKiBwZXJmb3JtZWQgb24gdGhlIFVJIHRocmVhZCBiZWNhdXNlIHRoZXkgYXJlIGFsd2F5cyB1bmJsb2NraW5nLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9VUkkgPQorICAgICAgICAgICAgICAgIFVyaS53aXRoQXBwZW5kZWRQYXRoKEFVVEhPUklUWV9VUkksICJkaXJlY3RvcmllcyIpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgTUlNRS10eXBlIG9mIHtAbGluayAjQ09OVEVOVF9VUkl9IHByb3ZpZGluZyBhIGRpcmVjdG9yeSBvZgorICAgICAgICAgKiBjb250YWN0IGRpcmVjdG9yaWVzLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9UWVBFID0KKyAgICAgICAgICAgICAgICAidm5kLmFuZHJvaWQuY3Vyc29yLmRpci9jb250YWN0X2RpcmVjdG9yaWVzIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIE1JTUUgdHlwZSBvZiBhIHtAbGluayAjQ09OVEVOVF9VUkl9IGl0ZW0uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0lURU1fVFlQRSA9CisgICAgICAgICAgICAgICAgInZuZC5hbmRyb2lkLmN1cnNvci5pdGVtL2NvbnRhY3RfZGlyZWN0b3J5IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogX0lEIG9mIHRoZSBkZWZhdWx0IGRpcmVjdG9yeSwgd2hpY2ggcmVwcmVzZW50cyBsb2NhbGx5IHN0b3JlZCBjb250YWN0cy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgbG9uZyBERUZBVUxUID0gMDsKKworICAgICAgICAvKioKKyAgICAgICAgICogX0lEIG9mIHRoZSBkaXJlY3RvcnkgdGhhdCByZXByZXNlbnRzIGxvY2FsbHkgc3RvcmVkIGludmlzaWJsZSBjb250YWN0cy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgbG9uZyBMT0NBTF9JTlZJU0lCTEUgPSAxOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbmFtZSBvZiB0aGUgcGFja2FnZSB0aGF0IG93bnMgdGhpcyBkaXJlY3RvcnkuIENvbnRhY3RzIFByb3ZpZGVyCisgICAgICAgICAqIGZpbGwgaXQgaW4gd2l0aCB0aGUgbmFtZSBvZiB0aGUgcGFja2FnZSBjb250YWluaW5nIHRoZSBkaXJlY3RvcnkgcHJvdmlkZXIuCisgICAgICAgICAqIElmIHRoZSBwYWNrYWdlIGlzIGxhdGVyIHVuaW5zdGFsbGVkLCB0aGUgZGlyZWN0b3JpZXMgaXQgb3ducyBhcmUKKyAgICAgICAgICogYXV0b21hdGljYWxseSByZW1vdmVkIGZyb20gdGhpcyB0YWJsZS4KKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogVEVYVDwvcD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBBQ0tBR0VfTkFNRSA9ICJwYWNrYWdlTmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0eXBlIG9mIGRpcmVjdG9yeSBjYXB0dXJlZCBhcyBhIHJlc291cmNlIElEIGluIHRoZSBjb250ZXh0IG9mIHRoZQorICAgICAgICAgKiBwYWNrYWdlIHtAbGluayAjUEFDS0FHRV9OQU1FfSwgZS5nLiAiQ29ycG9yYXRlIERpcmVjdG9yeSIKKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogSU5URUdFUjwvcD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRZUEVfUkVTT1VSQ0VfSUQgPSAidHlwZVJlc291cmNlSWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBbiBvcHRpb25hbCBuYW1lIHRoYXQgY2FuIGJlIHVzZWQgaW4gdGhlIFVJIHRvIHJlcHJlc2VudCB0aGlzIGRpcmVjdG9yeSwKKyAgICAgICAgICogZS5nLiAiQWNtZSBDb3JwIgorICAgICAgICAgKiA8cD5UWVBFOiB0ZXh0PC9wPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRElTUExBWV9OQU1FID0gImRpc3BsYXlOYW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFRoZSBhdXRob3JpdHkgb2YgdGhlIERpcmVjdG9yeSBQcm92aWRlci4gQ29udGFjdHMgUHJvdmlkZXIgd2lsbAorICAgICAgICAgKiB1c2UgdGhpcyBhdXRob3JpdHkgdG8gZm9yd2FyZCByZXF1ZXN0cyB0byB0aGUgZGlyZWN0b3J5IHByb3ZpZGVyLgorICAgICAgICAgKiBBIGRpcmVjdG9yeSBwcm92aWRlciBjYW4gbGVhdmUgdGhpcyBjb2x1bW4gZW1wdHkgLSBDb250YWN0cyBQcm92aWRlciB3aWxsIGZpbGwgaXQgaW4uCisgICAgICAgICAqIDwvcD4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIENsaWVudHMgb2YgdGhpcyBBUEkgc2hvdWxkIG5vdCBzZW5kIHJlcXVlc3RzIGRpcmVjdGx5IHRvIHRoaXMgYXV0aG9yaXR5LgorICAgICAgICAgKiBBbGwgZGlyZWN0b3J5IHJlcXVlc3RzIG11c3QgYmUgcm91dGVkIHRocm91Z2ggQ29udGFjdHMgUHJvdmlkZXIuCisgICAgICAgICAqIDwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogdGV4dDwvcD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERJUkVDVE9SWV9BVVRIT1JJVFkgPSAiYXV0aG9yaXR5IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGFjY291bnQgdHlwZSB3aGljaCB0aGlzIGRpcmVjdG9yeSBpcyBhc3NvY2lhdGVkLgorICAgICAgICAgKgorICAgICAgICAgKiA8cD5UWVBFOiB0ZXh0PC9wPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQUNDT1VOVF9UWVBFID0gImFjY291bnRUeXBlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGFjY291bnQgd2l0aCB3aGljaCB0aGlzIGRpcmVjdG9yeSBpcyBhc3NvY2lhdGVkLiBJZiB0aGUgYWNjb3VudCBpcyBsYXRlcgorICAgICAgICAgKiByZW1vdmVkLCB0aGUgZGlyZWN0b3JpZXMgaXQgb3ducyBhcmUgYXV0b21hdGljYWxseSByZW1vdmVkIGZyb20gdGhpcyB0YWJsZS4KKyAgICAgICAgICoKKyAgICAgICAgICogPHA+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YVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBIT1RPX1VSSSA9ICJwaG90b191cmkiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIFVSSSB0aGF0IGNhbiBiZSB1c2VkIHRvIHJldHJpZXZlIGEgdGh1bWJuYWlsIG9mIHRoZSBjb250YWN0J3MgcGhvdG8uCisgICAgICAgICAqIEEgcGhvdG8gY2FuIGJlIHJlZmVycmVkIHRvIGVpdGhlciBieSBhIFVSSSAodGhpcyBmaWVsZCBvciB7QGxpbmsgI1BIT1RPX1VSSX0pCisgICAgICAgICAqIG9yIGJ5IElEIChzZWUge0BsaW5rICNQSE9UT19JRH0pLiBJZiBQSE9UT19JRCBpcyBub3QgbnVsbCwgUEhPVE9fVVJJIGFuZAorICAgICAgICAgKiBQSE9UT19USFVNQk5BSUxfVVJJIHNoYWxsIG5vdCBiZSBudWxsIChidXQgbm90IG5lY2Vzc2FyaWx5IHZpY2UgdmVyc2EpLgorICAgICAgICAgKiBJZiB0aGUgY29udGVudCBwcm92aWRlciBkb2VzIG5vdCBkaWZmZXJlbnRpYXRlIGJldHdlZW4gZnVsbC1zaXplIHBob3RvcworICAgICAgICAgKiBhbmQgdGh1bWJuYWlsIHBob3RvcywgUEhPVE9fVEhVTUJOQUlMX1VSSSBhbmQge0BsaW5rICNQSE9UT19VUkl9IGNhbiBjb250YWluCisgICAgICAgICAqIHRoZSBzYW1lIHZhbHVlLCBidXQgZWl0aGVyIGJvdGggc2hlbGwgYmUgbnVsbCBvciBib3RoIG5vdCBudWxsLgorICAgICAgICAgKgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPVE9fVEhVTUJOQUlMX1VSSSA9ICJwaG90b190aHVtYl91cmkiOworCisgICAgICAgIC8qKgogICAgICAgICAgKiBMb29rdXAgdmF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VtZW50ZWQgYnkgMSBhbmQgdGhlIExBU1RfVElNRV9DT05UQUNURUQKKyAgICAgICAgICogZmllbGQgaXMgcG9wdWxhdGVkIHdpdGggdGhlIGN1cnJlbnQgc3lzdGVtIHRpbWUuCiAgICAgICAgICAqCiAgICAgICAgICAqIEBwYXJhbSByZXNvbHZlciB0aGUgQ29udGVudFJlc29sdmVyIHRvIHVzZQogICAgICAgICAgKiBAcGFyYW0gY29udGFjdElkIHRoZSBwZXJzb24gd2hvIHdhcyBjb250YWN0ZWQKQEAgLTEwNDEsNyArMTQwNiw4IEBACiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIEEgc3ViLWRpcmVjdG9yeSBvZiBhIHNpbmdsZSBjb250YWN0IHRoYXQgY29udGFpbnMgYWxsIG9mIHRoZSBjb25zdGl0dWVudCByYXcgY29udGFjdAotICAgICAgICAgKiB7QGxpbmsgQ29udGFjdHNDb250cmFjdC5EYXRhfSByb3dzLgorICAgICAgICAgKiB7QGxpbmsgQ29udGFjdHNDb250cmFjdC5EYXRhfSByb3dzLiAgVGhpcyBkaXJlY3RvcnkgY2FuIGJlIHVzZWQgZWl0aGVyCisgICAgICAgICAqIHdpdGggYSB7QGxpbmsgI0NPTlRFTlRfVVJJfSBvciB7QGxpbmsgI0NPTlRFTlRfTE9PS1VQX1VSSX0uCiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIERhdGEgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgRGF0YUNvbHVtbnMgewogICAgICAgICAgICAgLyoqCkBAIC0xMDU3LDYgKzE0MjMsNjMgQEAKIAogICAgICAgICAvKioKICAgICAgICAgICogPHA+CisgICAgICAgICAqIEEgc3ViLWRpcmVjdG9yeSBvZiBhIGNvbnRhY3QgdGhhdCBjb250YWlucyBhbGwgb2YgaXRzCisgICAgICAgICAqIHtAbGluayBDb250YWN0c0NvbnRyYWN0LlJhd0NvbnRhY3RzfSBhcyB3ZWxsIGFz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ogbm8gcHVibGljIGNvbnN0cnVjdG9yIHNpbmNlIHRoaXMgaXMgYSB1dGlsaXR5IGNsYXNzCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHByaXZhdGUgRW50aXR5KCkgeworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBkaXJlY3RvcnkgdHdpZyBmb3IgdGhpcyBzdWItdGFibGUKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9ESVJFQ1RPUlkgPSAiZW50aXRpZXMiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBJRCBvZiB0aGUgcmF3IGNvbnRhY3Qgcm93LgorICAgICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUkFXX0NPTlRBQ1RfSUQgPSAicmF3X2NvbnRhY3RfaWQiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBJRCBvZiB0aGUgZGF0YSByb3cuIFRoZSB2YWx1ZSB3aWxsIGJlIG51bGwgaWYgdGhpcyByYXcgY29udGFjdCBoYXMgbm8KKyAgICAgICAgICAgICAqIGRhdGEgcm93cy4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERBVEFfSUQgPSAiZGF0YV9pZCI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+CiAgICAgICAgICAqIEEgPGk+cmVhZC1vbmx5PC9pPiBzdWItZGlyZWN0b3J5IG9mIGEgc2luZ2xlIGNvbnRhY3QgYWdncmVnYXRlIHRoYXQKICAgICAgICAgICogY29udGFpbnMgYWxs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ZC5wcm92aWRlci5Db250YWN0c0NvbnRyYWN0LkNvbnRhY3RzI0NPTlRFTlRfRklMVEVSX1VSSX0uCiAgICAgICAgICAgICAgKi8KICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfRElSRUNUT1JZID0gInN1Z2dlc3Rpb25zIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBVc2VkIHdpdGgge0BsaW5rIEJ1aWxkZXIjYWRkUGFyYW1ldGVyfSB0byBzcGVjaWZ5IHdoYXQga2luZCBvZiBkYXRhIGlzCisgICAgICAgICAgICAgKiBzdXBwbGllZCBmb3IgdGhlIHN1Z2dlc3Rpb24gcXVlcnkuCisgICAgICAgICAgICAgKgorICAgICAgICAgICAgICogQGhpZGUKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEFSQU1FVEVSX01BVENIX05BTUUgPSAibmFtZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVXNlZCB3aXRoIHtAbGluayBCdWlsZGVyI2FkZFBhcmFtZXRlcn0gdG8gc3BlY2lmeSB3aGF0IGtpbmQgb2YgZGF0YSBpcworICAgICAgICAgICAgICogc3VwcGxpZWQgZm9yIHRoZSBzdWdnZXN0aW9uIHF1ZXJ5LgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqIEBoaWRlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBBUkFNRVRFUl9NQVRDSF9FTUFJTCA9ICJlbWFpbCI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVXNlZCB3aXRoIHtAbGluayBCdWlsZGVyI2FkZFBhcmFtZXRlcn0gdG8gc3BlY2lmeSB3aGF0IGtpbmQgb2YgZGF0YSBpcworICAgICAgICAgICAgICogc3VwcGxpZWQgZm9yIHRoZSBzdWdnZXN0aW9uIHF1ZXJ5LgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqIEBoaWRlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBBUkFNRVRFUl9NQVRDSF9QSE9ORSA9ICJwaG9uZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVXNlZCB3aXRoIHtAbGluayBCdWlsZGVyI2FkZFBhcmFtZXRlcn0gdG8gc3BlY2lmeSB3aGF0IGtpbmQgb2YgZGF0YSBpcworICAgICAgICAgICAgICogc3VwcGxpZWQgZm9yIHRoZSBzdWdnZXN0aW9uIHF1ZXJ5LgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqIEBoaWRlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBBUkFNRVRFUl9NQVRDSF9OSUNLTkFNRSA9ICJuaWNrbmFtZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQSBjb252ZW5pZW5jZSBidWlsZGVyIGZvciBhZ2dyZWdhdGlvbiBzdWdnZXN0aW9uIGNvbnRlbnQgVVJJcy4KKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiBUT0RPOiBjaGFuZ2UgZG9jdW1lbnRhdGlvbiBmb3IgdGhpcyBjbGFzcyB0byB1c2UgdGhlIGJ1aWxkZXIuCisgICAgICAgICAgICAgKiBAaGlkZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIEJ1aWxkZXIgeworICAgICAgICAgICAgICAgIHByaXZhdGUgbG9uZyBtQ29udGFjdElkOworICAgICAgICAgICAgICAgIHByaXZhdGUgQXJyYXlMaXN0PFN0cmluZz4gbUtpbmRzID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7CisgICAgICAgICAgICAgICAgcHJpdmF0ZSBBcnJheUxpc3Q8U3RyaW5nPiBtVmFsdWVzID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7CisgICAgICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbUxpbWl0OworCisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogT3B0aW9uYWwgZXhpc3RpbmcgY29udGFjdCBJRC4gIElmIGl0IGlzIG5vdCBwcm92aWRlZCwgdGhlIHNlYXJjaAorICAgICAgICAgICAgICAgICAqIHdpbGwgYmUgYmFzZWQgZXhjbHVzaXZlbHkgb24gdGhlIHZhbHVlcyBzdXBwbGllZCB3aXRoIHtAbGluayAjYWRkUGFyYW1ldGVyfS4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBwdWJsaWMgQnVpbGRlciBzZXRDb250YWN0SWQobG9uZyBjb250YWN0SWQpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5tQ29udGFjdElkID0gY29udGFjdElkOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBBIHZhbHVlIHRoYXQgY2FuIGJlIHVzZWQgd2hlbiBzZWFyY2hpbmcgZm9yIGFuIGFnZ3JlZ2F0aW9uCisgICAgICAgICAgICAgICAgICogc3VnZ2VzdGlvbi4KKyAgICAgICAgICAgICAgICAgKgorICAgICAgICAgICAgICAgICAqIEBwYXJhbSBraW5kIGNhbiBiZSBvbmUgb2YKKyAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgIHtAbGluayBBZ2dyZWdhdGlvblN1Z2dlc3Rpb25zI1BBUkFNRVRFUl9NQVRDSF9OQU1FfSwKKyAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgIHtAbGluayBBZ2dyZWdhdGlvblN1Z2dlc3Rpb25zI1BBUkFNRVRFUl9NQVRDSF9FTUFJTH0sCisgICAgICAgICAgICAgICAgICogICAgICAgICAgICB7QGxpbmsgQWdncmVnYXRpb25TdWdnZXN0aW9ucyNQQVJBTUVURVJfTUFUQ0hfTklDS05BTUV9LAorICAgICAgICAgICAgICAgICAqICAgICAgICAgICAge0BsaW5rIEFnZ3JlZ2F0aW9uU3VnZ2VzdGlvbnMjUEFSQU1FVEVSX01BVENIX1BIT05FfQorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIHB1YmxpYyBCdWlsZGVyIGFkZFBhcmFtZXRlcihTdHJpbmcga2luZCwgU3RyaW5nIHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtS2luZHMuYWRkKGtpbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgbVZhbHVlcy5hZGQodmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHB1YmxpYyBCdWlsZGVyIHNldExpbWl0KGludCBsaW1pdCkgeworICAgICAgICAgICAgICAgICAgICBtTGltaXQgPSBsaW1pdDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcHVibGljIFVyaSBidWlsZCgpIHsKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC5uZXQuVXJpLkJ1aWxkZXIgYnVpbGRlciA9IENvbnRhY3RzLkNPTlRFTlRfVVJJLmJ1aWxkVXBvbigpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZEVuY29kZWRQYXRoKFN0cmluZy52YWx1ZU9mKG1Db250YWN0SWQpKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmRQYXRoKENvbnRhY3RzLkFnZ3JlZ2F0aW9uU3VnZ2VzdGlvbnMuQ09OVEVOVF9ESVJFQ1RPUlkpOworICAgICAgICAgICAgICAgICAgICBpZiAobUxpbWl0ICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kUXVlcnlQYXJhbWV0ZXIoImxpbWl0IiwgU3RyaW5nLnZhbHVlT2YobUxpbWl0KSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpbnQgY291bnQgPSBtS2luZHMuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kUXVlcnlQYXJhbWV0ZXIoInF1ZXJ5IiwgbUtpbmRzLmdldChpKSArICI6IiArIG1WYWx1ZXMuZ2V0KGkpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBidWlsZGVyLmJ1aWxkKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIEBoaWRlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgQnVpbGRlciBidWlsZGVyKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQnVpbGRlcigpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgLyoqCkBAIC0xMTMwLDkgKzE2NTcsMTIgQEAKICAgICAgICAgICogPHA+WW91IHNob3VsZCBhbHNvIGNvbnNpZGVyIHVzaW5nIHRoZSBjb252ZW5pZW5jZSBtZXRob2QKICAgICAgICAgICoge0BsaW5rIENvbnRhY3RzQ29udHJhY3QuQ29udGFjdHMjb3BlbkNvbnRhY3RQaG90b0lucHV0U3RyZWFtKENvbnRlbnRSZXNvbHZlciwgVXJpKX0KICAgICAgICAgICogPC9wPgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVGhpcyBkaXJlY3RvcnkgY2FuIGJlIHVzZWQgZWl0aGVyIHdpdGggYSB7QGxpbmsgI0NPTlRFTlRfVVJJfSBvcgorICAgICAgICAgKiB7QGxpbmsgI0NPTlRFTlRfTE9PS1VQX1VSSX0uCisgICAgICAgICAqIDwvcD4KICAgICAgICAgICovCi0gICAgICAgIC8vIFRPRE86IGNoYW5nZSBEYXRhQ29sdW1ucyB0byBEYXRhQ29sdW1uc1dpdGhKb2lucwotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFBob3RvIGltcGxlbWVudHMgQmFzZUNvbHVtbnMsIERhdGFDb2x1bW5zIHsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBQaG90byBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBEYXRhQ29sdW1uc1dpdGhKb2lucyB7CiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIG5vIHB1YmxpYyBjb25zdHJ1Y3RvciBzaW5jZSB0aGlzIGlzIGEgdXRpbGl0eSBjbGFzcwogICAgICAgICAgICAgICovCkBAIC0xMTQ4LDcgKzE2NzgsNiBAQAogICAgICAgICAgICAgICogdGhhdCBjb3VsZCBiZSBpbmZsYXRlZCB1c2luZyB7QGxpbmsgYW5kcm9pZC5ncmFwaGljcy5CaXRtYXBGYWN0b3J5fS4KICAgICAgICAgICAgICAqIDxwPgogICAgICAgICAgICAgICogVHlwZTogQkxPQgotICAgICAgICAgICAgICogQGhpZGUgVE9ETzogVW5oaWRlIGluIGEgc2VwYXJhdGUgQ0wKICAgICAgICAgICAgICAqLwogICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPVE8gPSBEQVRBMTU7CiAgICAgICAgIH0KQEAgLTExNTcsNyArMTY4NiwxMCBAQAogICAgICAgICAgKiBPcGVucyBhbiBJbnB1dFN0cmVhbSBmb3IgdGhlIGNvbnRhY3RzJ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AgICAqCi0gICAgICAgICAqIFRPRE86IGRlcHJlY2F0ZSBpbiBmYXZvciBvZiB7QGxpbmsgI0FHR1JFR0FUSU9OX01PREVfREVGQVVMVH0KKyAgICAgICAgICogQWdncmVnYXRpb24gbW9kZTogYWdncmVnYXRlIGF0IHRoZSB0aW1lIHRoZSByYXcgY29udGFjdCBpcyBpbnNlcnRlZC91cGRhdGVkLgorICAgICAgICAgKiBAZGVwcmVjYXRlZCBBZ2dyZWdhdGlvbiBpcyBzeW5jaHJvbm91cywgdGhpcyBoaXN0b3JpYyB2YWx1ZSBpcyBhIG5vLW9wCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBBR0dSRUdBVElPTl9NT0RFX0lNTUVESUFURSA9IDE7CiAKICAgICAgICAgLyoqCkBAIC0xNzAxLDkgKzIyNDEsNyBAQAogICAgICAgICAvKioKICAgICAgICAgICogQSBzdWItZGlyZWN0b3J5IG9mIGEgc2luZ2xlIHJhdyBjb250YWN0IHRoYXQgY29udGFpbnMgYWxsIG9mIGl0cwogICAgICAgICAgKiB7QGxpbmsgQ29udGFjdHNDb250cmFjdC5EYXRhfSByb3dzLiBUbyBhY2Nlc3MgdGhpcyBkaXJlY3RvcnkKLSAgICAgICAgICogYXBwZW5kIHtAbGluayBEYXRhI0NPTlRFTlRfRElSRUNUT1JZfSB0byB0aGUgY29udGFjdCBVUkkuCi0gICAgICAgICAqCi0gICAgICAgICAqIFRPRE86IGRlcHJlY2F0ZSBpbiBmYXZvciBvZiB7QGxpbmsgUmF3Q29udGFjdHMuRW50aXR5fS4KKyAgICAgICAgICogYXBwZW5kIHtAbGluayBEYXRhI0NPTlRFTlRfRElSRUNUT1JZfSB0byB0aGUgcmF3IGNvbnRhY3QgVVJJLgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBEYXRhIGltcGxlbWVudHMgQmFzZUNvbHVtbnMsIERhdGFDb2x1bW5zIHsKICAgICAgICAgICAgIC8qKgpAQCAtMTcyMiw3ICsyMjYwLDcgQEAKICAgICAgICAgICogPHA+CiAgICAgICAgICAqIEEgc3ViLWRpcmVjdG9yeSBvZiBhIHNpbmdsZSByYXcgY29udGFjdCB0aGF0IGNvbnRhaW5zIGFsbCBvZiBpdHMKICAgICAgICAgICoge0BsaW5rIENvbnRhY3RzQ29udHJhY3QuRGF0YX0gcm93cy4gVG8gYWNjZXNzIHRoaXMgZGlyZWN0b3J5IGFwcGVuZAotICAgICAgICAgKiB7QGxpbmsgI0NPTlRFTlRfRElSRUNUT1JZfSB0byB0aGUgY29udGFjdCBVUkkuIFNlZQorICAgICAgICAgKiB7QGxpbmsgUmF3Q29udGFjdHMuRW50aXR5I0NPTlRFTlRfRElSRUNUT1JZfSB0byB0aGUgcmF3IGNvbnRhY3QgVVJJLiBTZWUKICAgICAgICAgICoge0BsaW5rIFJhd0NvbnRhY3RzRW50aXR5fSBmb3IgYSBzdGFuZC1hbG9uZSB0YWJsZSBjb250YWluaW5nIHRoZSBzYW1lCiAgICAgICAgICAqIGRhdGEuCiAgICAgICAgICAqIDwvcD4KQEAgLTE3MzQsMTAgKzIyNzIsMTAgQEAKICAgICAgICAgICogbnVsbC4KICAgICAgICAgICogPC9wPgogICAgICAgICAgKiA8cD4KLSAgICAgICAgICogRW50aXR5IHJlYWRzIGFsbAotICAgICAgICAgKiBkYXRhIGZvciBhIHJhdyBjb250YWN0IGluIG9uZSB0cmFuc2FjdGlvbiwgdG8gZ3VhcmFudGVlCi0gICAgICAgICAqIGNvbnNpc3RlbmN5LgotICAgICAgICAgKiA8L3A+CisgICAgICAgICAqIFVzaW5nIEVudGl0eSBzaG91bGQgYmUgcHJlZmVycmVkIHRvIHVzaW5nIHR3byBzZXBhcmF0ZSBxdWVyaWVzOgorICAgICAgICAgKiBSYXdDb250YWN0cyBmb2xsb3dlZCBieSBEYXRhLiBUaGUgcmVhc29uIGlzIHRoYXQgRW50aXR5IHJlYWRzIGFsbAorICAgICAgICAgKiBkYXRhIGZvciBhIHJhdyBjb250YWN0IGluIG9uZSB0cmFuc2FjdGlvbiwgc28gdGhlcmUgaXMgbm8gcG9zc2liaWxpdHkKKyAgICAgICAgICogb2YgdGhlIGRhdGEgY2hhbmdpbmcgYmV0d2VlbiB0aGUgdHdvIHF1ZXJpZXMuCiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIEVudGl0eSBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBEYXRhQ29sdW1ucyB7CiAgICAgICAgICAgICAvKioKQEAgLTE3NTIsNyArMjI5MCw3IEBACiAgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0RJUkVDVE9SWSA9ICJlbnRpdHkiOwogCiAgICAgICAgICAgICAvKioKLSAgICAgICAgICAgICAqIFRoZSBJRCBvZiB0aGUgZGF0YSBjb2x1bW4uIFRoZSB2YWx1ZSB3aWxsIGJlIG51bGwgaWYgdGhpcyByYXcgY29udGFjdCBoYXMgbm8KKyAgICAgICAgICAgICAqIFRoZSBJRCBvZiB0aGUgZGF0YSByb3cuIFRoZSB2YWx1ZSB3aWxsIGJlIG51bGwgaWYgdGhpcyByYXcgY29udGFjdCBoYXMgbm8KICAgICAgICAgICAgICAqIGRhdGEgcm93cy4KICAgICAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CiAgICAgICAgICAgICAgKi8KQEAgLTE4NDAsMjggKzIzNzgsMjEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEYXRhLkRBVEFfVkVSU0lPTik7CiAgICAgICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIGtleSA6IERBVEFfS0VZUykgewogICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGNvbHVtbkluZGV4ID0gY3Vyc29yLmdldENvbHVtbkluZGV4T3JUaHJvdyhrZXkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvci5pc051bGwoY29sdW1uSW5kZXgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgcHV0IGFueXRoaW5nCi0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGN1cnNvci5nZXRUeXBlKGNvbHVtbkluZGV4KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ3Vyc29yLkZJRUxEX1RZUEVfTlVMTDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgcHV0IGFueXRoaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ3Vyc29yLkZJRUxEX1RZUEVfSU5URUdFUjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEN1cnNvci5GSUVMRF9UWVBFX0ZMT0FUOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ3Vyc29yLkZJRUxEX1RZUEVfU1RSSU5HOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdi5wdXQoa2V5LCBjdXJzb3IuZ2V0U3RyaW5nKGNvbHVtbkluZGV4KSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBDdXJzb3IuRklFTERfVFlQRV9CTE9COgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdi5wdXQoa2V5LCBjdXJzb3IuZ2V0QmxvYihjb2x1bW5JbmRleCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiSW52YWxpZCBvciB1bmhhbmRsZWQgZGF0YSB0eXBlIik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBnbyBiYWNrIHRvIHRoaXMgdmVyc2lvbiBvZiB0aGUgY29kZSB3aGVuIGJ1ZwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gaHR0cDovL2IvaXNzdWU/aWQ9MjMwNjM3MCBpcyBmaXhlZC4KLS8vICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvci5pc051bGwoY29sdW1uSW5kZXgpKSB7Ci0vLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCBwdXQgYW55dGhpbmcKLS8vICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJzb3IuaXNMb25nKGNvbHVtbkluZGV4KSkgewotLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChrZXksIGN1cnNvci5nZXRMb25nKGNvbHVtbkluZGV4KSk7Ci0vLyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY3Vyc29yLmlzRmxvYXQoY29sdW1uSW5kZXgpKSB7Ci0vLyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KGtleSwgY3Vyc29yLmdldEZsb2F0KGNvbHVtbkluZGV4KSk7Ci0vLyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY3Vyc29yLmlzU3RyaW5nKGNvbHVtbkluZGV4KSkgewotLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChrZXksIGN1cnNvci5nZXRTdHJpbmcoY29sdW1uSW5kZXgpKTsKLS8vICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJzb3IuaXNCbG9iKGNvbHVtbkluZGV4KSkgewotLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChrZXksIGN1cnNvci5nZXRCbG9iKGNvbHVtbkluZGV4KSk7Ci0vLyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBjb250YWN0LmFkZFN1YlZhbHVlKENvbnRhY3RzQ29udHJhY3QuRGF0YS5DT05URU5UX1VSSSwgY3YpOwogICAgICAgICAgICAgICAgIH0gd2hpbGUgKGN1cnNvci5tb3ZlVG9OZXh0KCkpOwpAQCAtMTk2MiwyNyArMjQ5MywyNCBAQAogICAgICAgICAvKioKICAgICAgICAgICogQ29udGFjdCdzIGF1ZGlvL3ZpZGVvIGNoYXQgY2FwYWJpbGl0eSBsZXZlbC4KICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAob25lIG9mIHRoZSB2YWx1ZXMgYmVsb3cpPC9QPgotICAgICAgICAgKiBAaGlkZQogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ0hBVF9DQVBBQklMSVRZID0gImNoYXRfY2FwYWJpbGl0eSI7CiAKICAgICAgICAgLyoqCi0gICAgICAgICAqIEFuIGFsbG93ZWQgdmFsdWUgb2Yge0BsaW5rICNDSEFUX0NBUEFCSUxJVFl9LiBJbmRpY2F0ZXMgdGhhdCB0aGUgY29udGFjdCdzIGRldmljZSBjYW4KKyAgICAgICAgICogQW4gYWxsb3dlZCBmbGFnIG9mIHtAbGluayAjQ0hBVF9DQVBBQklMSVRZfS4gSW5kaWNhdGVzIGF1ZGlvLWNoYXQgY2FwYWJpbGl0eSAobWljcm9waG9uZQorICAgICAgICAgKiBhbmQ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gICAgKgogICAgICAqIG9wcy5hZGQoQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld1VwZGF0ZShEYXRhLkNPTlRFTlRfVVJJKQogICAgICAqICAgICAgICAgIC53aXRoU2VsZWN0aW9uKERhdGEuX0lEICsgIj0/IiwgbmV3IFN0cmluZ1tde1N0cmluZy52YWx1ZU9mKGRhdGFJZCl9KQogICAgICAqICAgICAgICAgIC53aXRoVmFsdWUoRW1haWwuREFUQSwgInNvbWVib2R5QGFuZHJvaWQuY29tIikKQEAgLTIyMjgsNyArMjc2Nyw5IEBACiAgICAgICogSnVzdCBhcyB3aXRoIGluc2VydCBhbmQgdXBkYXRlLCBkZWxldGlvbiBjYW4gYmUgZG9uZSBlaXRoZXIgdXNpbmcgdGhlCiAgICAgICoge0BsaW5rIENvbnRlbnRSZXNvbHZlciNkZWxldGV9IG1ldGhvZCBvciB1c2luZyBhIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbjoKICAgICAgKiA8cHJlPgotICAgICAqIEFycmF5TGlzdCZsdDtDb250ZW50UHJvdmlkZXJPcGVyYXRpb24mZ3Q7IG9wcyA9IExpc3RzLm5ld0FycmF5TGlzdCgpOworICAgICAqIEFycmF5TGlzdCZsdDtDb250ZW50UHJvdmlkZXJPcGVyYXRpb24mZ3Q7IG9wcyA9CisgICAgICogICAgICAgICAgbmV3IEFycmF5TGlzdCZsdDtDb250ZW50UHJvdmlkZXJPcGVyYXRpb24mZ3Q7KCk7CisgICAgICoKICAgICAgKiBvcHMuYWRkKENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdEZWxldGUoRGF0YS5DT05URU5UX1VSSSkKICAgICAgKiAgICAgICAgICAud2l0aFNlbGVjdGlvbihEYXRhLl9JRCArICI9PyIsIG5ldyBTdHJpbmdbXXtTdHJpbmcudmFsdWVPZihkYXRhSWQpfSkKICAgICAgKiAgICAgICAgICAuYnVpbGQoKSk7CkBAIC0yODYyLDYgKzM0MDMsMTQgQEAKICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExBQkVMID0gImxhYmVsIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHBob25lIG51bWJlcidzIEUxNjQgcmVwcmVzZW50YXRpb24uCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBOT1JNQUxJWkVEX05VTUJFUiA9ICJub3JtYWxpemVkX251bWJlciI7CiAgICAgfQogCiAgICAgLyoqCkBAIC0zMTI0LDYgKzM2NzMsMzIgQEAKICAgICAgKiA8bGk+e0BsaW5rICNBVkFJTEFCTEV9PC9saT4KICAgICAgKiA8L3VsPgogICAgICAqIDwvcD4KKyAgICAgKiA8cD4KKyAgICAgKiBTaW5jZSBwcmVzZW5jZSBzdGF0dXMgaXMgaW5oZXJlbnRseSB2b2xhdGlsZSwgdGhlIGNvbnRlbnQgcHJvdmlkZXIKKyAgICAgKiBtYXkgY2hvb3NlIG5vdCB0byBzdG9yZSB0aGlzIGZpZWxkIGluIGxvbmctdGVybSBzdG9yYWdlLgorICAgICAqIDwvcD4KKyAgICAgKiA8L3RkPgorICAgICAqIDwvdHI+CisgICAgICogPHRyPgorICAgICAqIDx0ZD5pbnQ8L3RkPgorICAgICAqIDx0ZD57QGxpbmsgI0NIQVRfQ0FQQUJJTElUWX08L3RkPgorICAgICAqIDx0ZD5yZWFkL3dyaXRlPC90ZD4KKyAgICAgKiA8dGQ+Q29udGFjdCBJTSBjaGF0IGNvbXBhdGliaWxpdHkgdmFsdWUuIFRoZSBhbGxvd2VkIHZhbHVlcyBjb21iaW5hdGlvbnMgb2YgdGhlIGZvbGxvd2luZworICAgICAqIGZsYWdzLiBJZiBOb25lIG9mIHRoZXNlIGZsYWdzIGlzIHNldCwgdGhlIGRldmljZSBjYW4gb25seSBkbyB0ZXh0IG1lc3NhZ2luZy4KKyAgICAgKiA8cD4KKyAgICAgKiA8dWw+CisgICAgICogPGxpPntAbGluayAjQ0FQQUJJTElUWV9IQVNfVklERU99PC9saT4KKyAgICAgKiA8bGk+e0BsaW5rICNDQVBBQklMSVRZX0hBU19WT0lDRX08L2xpPgorICAgICAqIDxsaT57QGxpbmsgI0NBUEFCSUxJVFlfSEFTX0NBTUVSQX08L2xpPgorICAgICAqIDwvdWw+CisgICAgICogPC9wPgorICAgICAqIDxwPgorICAgICAqIFNpbmNlIGNoYXQgY29tcGF0aWJpbGl0eSBpcyBpbmhlcmVudGx5IHZvbGF0aWxlIGFzIHRoZSBjb250YWN0J3MgYXZhaWxhYmlsaXR5IG1vdmVzIGZyb20KKyAgICAgKiBvbmUgZGV2aWNlIHRvIGFub3RoZXIsIHRoZSBjb250ZW50IHByb3ZpZGVyIG1heSBjaG9vc2Ugbm90IHRvIHN0b3JlIHRoaXMgZmllbGQgaW4gbG9uZy10ZXJtCisgICAgICogc3RvcmFnZS4KKyAgICAgKiA8L3A+CisgICAgICogPC90ZD4KKyAgICAgKiA8L3RyPgogICAgICAqIDx0cj4KICAgICAgKiA8dGQ+U3RyaW5nPC90ZD4KICAgICAgKiA8dGQ+e0BsaW5rICNTVEFUVVN9PC90ZD4KQEAgLTM0ODcsNyArNDA2Miw5IEBACiAgICAgICAgICAqIDxwPkEgZGF0YSBraW5kIHJlcHJlc2VudGluZyB0aGUgY29udGFjdCdzIG5pY2tuYW1lLiBGb3IgZXhhbXBsZSwgZm9yCiAgICAgICAgICAqIEJvYiBQYXJyICgiTXIuIEluY3JlZGlibGUiKToKICAgICAgICAgICogPHByZT4KLSAgICAgICAgICogQXJyYXlMaXN0Jmx0O0NvbnRlbnRQcm92aWRlck9wZXJhdGlvbiZndDsgb3BzID0gTGlzdHMubmV3QXJyYXlMaXN0KCk7CisgICAgICAgICAqIEFycmF5TGlzdCZsdDtDb250ZW50UHJvdmlkZXJPcGVyYXRpb24mZ3Q7IG9wcyA9CisgICAgICAgICAqICAgICAgICAgIG5ldyBBcnJheUxpc3QmbHQ7Q29udGVudFByb3ZpZGVyT3BlcmF0aW9uJmd0OygpOworICAgICAgICAgKgogICAgICAgICAgKiBvcHMuYWRkKENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSkKICAgICAgICAgICogICAgICAgICAgLndpdGhWYWx1ZShEYXRhLlJBV19DT05UQUNUX0lELCByYXdDb250YWN0SWQpCiAgICAgICAgICAqICAgICAgICAgIC53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgU3RydWN0dXJlZE5hbWUuQ09OVEVOVF9JVEVNX1RZUEUpCkBAIC0zNjkxLDYgKzQyNjgsMTQgQEAKICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5VTUJFUiA9IERBVEE7CiAKICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIHBob25lIG51bWJlcidzIEUxNjQgcmVwcmVzZW50YXRpb24uCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqIEBoaWRlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5PUk1BTElaRURfTlVNQkVSID0gREFUQTQ7CisKKyAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogQGRlcHJlY2F0ZWQgdXNlIHtAbGluayAjZ2V0VHlwZUxhYmVsKFJlc291cmNlcywgaW50LCBDaGFyU2VxdWVuY2UpfSBpbnN0ZWFkLgogICAgICAgICAgICAgICogQGhpZGUKICAgICAgICAgICAgICAqLwpAQCAtMzc3Miw3ICs0MzU3LDcgQEAKICAgICAgICAgICogPC90cj4KICAgICAgICAgICogPHRyPgogICAgICAgICAgKiA8dGQ+U3RyaW5nPC90ZD4KLSAgICAgICAgICogPHRkPntAbGluayAjREFUQX08L3RkPgorICAgICAgICAgKiA8dGQ+e0BsaW5rICNBRERSRVNTfTwvdGQ+CiAgICAgICAgICAqIDx0ZD57QGxpbmsgI0RBVEExfTwvdGQ+CiAgICAgICAgICAqIDx0ZD5FbWFpbCBhZGRyZXNzIGl0c2VsZi48L3RkPgogICAgICAgICAgKiA8L3RyPgpAQCAtMzg2Myw3ICs0NDQ4LDYgQEAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGVtYWlsIGFkZHJlc3MuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgotICAgICAgICAgICAgICogQGhpZGUgVE9ETzogVW5oaWRlIGluIGEgc2VwYXJhdGUgQ0wKICAgICAgICAgICAgICAqLwogICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQUREUkVTUyA9IERBVEExOwogCkBAIC00NTQzLDYgKzUxMjcsNDcgQEAKICAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CiAgICAgICAgICAgICAgKi8KICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5BTUUgPSBEQVRBOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFJldHVybiB0aGUgc3RyaW5nIHJlc291cmNlIHRoYXQgYmVzdCBkZXNjcmliZXMgdGhlIGdpdmVuCisgICAgICAgICAgICAgKiB7QGxpbmsgI1RZUEV9LiBXaWxsIGFsd2F5cyByZXR1cm4gYSB2YWxpZCByZXNvdXJjZS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgZ2V0VHlwZUxhYmVsUmVzb3VyY2UoaW50IHR5cGUpIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHR5cGUpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFX0FTU0lTVEFOVDogcmV0dXJuIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnJlbGF0aW9uVHlwZUFzc2lzdGFudDsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFX0JST1RIRVI6IHJldHVybiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5yZWxhdGlvblR5cGVCcm90aGVyOworICAgICAgICAgICAgICAgICAgICBjYXNlIFRZUEVfQ0hJTEQ6IHJldHVybiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5yZWxhdGlvblR5cGVDaGlsZDsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFX0RPTUVTVElDX1BBUlRORVI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnJlbGF0aW9uVHlwZURvbWVzdGljUGFydG5lcjsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFX0ZBVEhFUjogcmV0dXJuIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnJlbGF0aW9uVHlwZUZhdGhlcjsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFX0ZSSUVORDogcmV0dXJuIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnJlbGF0aW9uVHlwZUZyaWVuZDsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFX01BTkFHRVI6IHJldHVybiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5yZWxhdGlvblR5cGVNYW5hZ2VyOworICAgICAgICAgICAgICAgICAgICBjYXNlIFRZUEVfTU9USEVSOiByZXR1cm4gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcucmVsYXRpb25UeXBlTW90aGVyOworICAgICAgICAgICAgICAgICAgICBjYXNlIFRZUEVfUEFSRU5UOiByZXR1cm4gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcucmVsYXRpb25UeXBlUGFyZW50OworICAgICAgICAgICAgICAgICAgICBjYXNlIFRZUEVfUEFSVE5FUjogcmV0dXJuIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnJlbGF0aW9uVHlwZVBhcnRuZXI7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgVFlQRV9SRUZFUlJFRF9CWToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcucmVsYXRpb25UeXBlUmVmZXJyZWRCeTsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFX1JFTEFUSVZFOiByZXR1cm4gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcucmVsYXRpb25UeXBlUmVsYXRpdmU7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgVFlQRV9TSVNURVI6IHJldHVybiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5yZWxhdGlvblR5cGVTaXN0ZXI7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgVFlQRV9TUE9VU0U6IHJldHVybiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5yZWxhdGlvblR5cGVTcG91c2U7CisgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJldHVybiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5vcmdUeXBlQ3VzdG9tOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBSZXR1cm4gYSB7QGxpbmsgQ2hhclNlcXVlbmNlfSB0aGF0IGJlc3QgZGVzY3JpYmVzIHRoZSBnaXZlbiB0eXBlLAorICAgICAgICAgICAgICogcG9zc2libHkgc3Vic3RpdHV0aW5nIHRoZSBnaXZlbiB7QGxpbmsgI0xBQkVMfSB2YWx1ZQorICAgICAgICAgICAgICogZm9yIHtAbGluayAjVFlQRV9DVVNUT019LgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIENoYXJTZXF1ZW5jZSBnZXRUeXBlTGFiZWwoUmVzb3VyY2VzIHJlcywgaW50IHR5cGUsCisgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBsYWJlbCkgeworICAgICAgICAgICAgICAgIGlmICh0eXBlID09IFRZUEVfQ1VTVE9NICYmICFUZXh0VXRpbHMuaXNFbXB0eShsYWJlbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxhYmVsOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBsYWJlbFJlcyA9IGdldFR5cGVMYWJlbFJlc291cmNlKHR5cGUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzLmdldFRleHQobGFiZWxSZXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQogCiAgICAgICAgIC8qKgpAQCAtNDYyMCw3ICs1MjQ1LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5ldmVudFR5cGVBbm5pdmVyc2FyeTsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFX0JJUlRIREFZOiByZXR1cm4gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuZXZlbnRUeXBlQmlydGhkYXk7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgVFlQRV9PVEhFUjogcmV0dXJuIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmV2ZW50VHlwZU90aGVyOwotICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiByZXR1cm4gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuZXZlbnRUeXBlT3RoZXI7CisgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHJldHVybiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5ldmVudFR5cGVDdXN0b207CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC01MDI3LDYgKzU2NTIsMjMgQEAKICAgICAgICAgICogVHlwZTogSU5URUdFUiAoYm9vbGVhbikKICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNIT1VMRF9TWU5DID0gInNob3VsZF9zeW5jIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQW55IG5ld2x5IGNyZWF0ZWQgY29udGFjdHMgd2lsbCBhdXRvbWF0aWNhbGx5IGJlIGFkZGVkIHRvIGdyb3VwcyB0aGF0IGhhdmUgdGhpcworICAgICAgICAgKiBmbGFnIHNldCB0byB0cnVlLgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVHlwZTogSU5URUdFUiAoYm9vbGVhbikKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFVVE9fQUREID0gImF1dG9fYWRkIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogV2hlbiBhIGNvbnRhY3RzIGlzIG1hcmtlZCBhcyBhIGZhdm9yaXRlcyBpdCB3aWxsIGJlIGF1dG9tYXRpY2FsbHkgYWRkZWQKKyAgICAgICAgICogdG8gdGhlIGdyb3VwcyB0aGF0IGhhdmUgdGhpcyBmbGFnIHNldCwgYW5kIHdoZW4gaXQgaXMgcmVtb3ZlZCBmcm9tIGZhdm9yaXRlcworICAgICAgICAgKiBpdCB3aWxsIGJlIHJlbW92ZWQgZnJvbSB0aGVzZSBncm91cHMuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUeXBlOiBJTlRFR0VSIChib29sZWFuKQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRkFWT1JJVEVTID0gImZhdm9yaXRlcyI7CiAgICAgfQogCiAgICAgLyoqCkBAIC01MTY3LDYgKzU4MDksOCBAQAogICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yTG9uZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIHZhbHVlcywgREVMRVRFRCk7CiAgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCB2YWx1ZXMsIE5PVEVTKTsKICAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIHZhbHVlcywgU0hPVUxEX1NZTkMpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgdmFsdWVzLCBGQVZPUklURVMpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgdmFsdWVzLCBBVVRPX0FERCk7CiAgICAgICAgICAgICAgICAgY3Vyc29yLm1vdmVUb05leHQoKTsKICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEVudGl0eSh2YWx1ZXMpOwogICAgICAgICAgICAgfQpAQCAtNTU0MywxNCArNjE4Nyw2IEBACiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IE1PREVfTEFSR0UgPSAzOwogCiAgICAgICAgIC8qKgotICAgICAgICAgKiBFeHRyYSB1c2VkIHRvIHNwZWNpZnkgdGhlIGxhc3Qgc2VsZWN0ZWQgdGFiIGluZGV4IG9mIHRoZSBDb250YWN0cyBhcHAuCi0gICAgICAgICAqIElmIHRoaXMgaXMgbm90IGdpdmVuIG9yIC0xCi0gICAgICAgICAqIEBoaWRlCi0gICAgICAgICAqLwotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFWFRSQV9TRUxFQ1RFRF9DT05UQUNUU19BUFBfVEFCX0lOREVYID0KLSAgICAgICAgICAgICAgICAiU0VMRUNURURfVEFCX0lOREVYIjsKLQotICAgICAgICAvKioKICAgICAgICAgICogVHJpZ2dlciBhIGRpYWxvZyB0aGF0IGxpc3RzIHRoZSB2YXJpb3VzIG1ldGhvZHMgb2YgaW50ZXJhY3Rpbmcgd2l0aAogICAgICAgICAgKiB0aGUgcmVxdWVzdGVkIHtAbGluayBDb250YWN0c30gZW50cnkuIFRoaXMgbWF5IGJlIGJhc2VkIG9uIGF2YWlsYWJsZQogICAgICAgICAgKiB7QGxpbmsgQ29udGFjdHNDb250cmFjdC5EYXRhfSByb3dzIHVuZGVyIHRoYXQgY29udGFjdCwgYW5kIG1heSBhbHNvCkBAIC01NTc1LDE2ICs2MjExLDYgQEAKICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBzaG93UXVpY2tDb250YWN0KENvbnRleHQgY29udGV4dCwgVmlldyB0YXJnZXQsIFVyaSBsb29rdXBVcmksIGludCBtb2RlLAogICAgICAgICAgICAgICAgIFN0cmluZ1tdIGV4Y2x1ZGVNaW1lcykgewotICAgICAgICAgICAgY29udGV4dC5zdGFydEFjdGl2aXR5KGdldFF1aWNrQ29udGFjdEludGVudChjb250ZXh0LCB0YXJnZXQsIGxvb2t1cFVyaSwgbW9kZSwKLSAgICAgICAgICAgICAgICAgICAgZXhjbHVkZU1pbWVzKSk7Ci0gICAgICAgIH0KLQotICAgICAgICAvKioKLSAgICAgICAgICogQ3JlYXRlcyB0aGUgSW50ZW50IHRvIGxhdW5jaCBRdWljayBDb250YWN0cwotICAgICAgICAgKiBAaGlkZQotICAgICAgICAgKi8KLSAgICAgICAgcHVibGljIHN0YXRpYyBJbnRlbnQgZ2V0UXVpY2tDb250YWN0SW50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XMpIHsKLSAgICAgICAgICAgIGNvbnRleHQuc3RhcnRBY3Rpdml0eShnZXRRdWlja0NvbnRhY3RJbnRlbnQoY29udGV4dCwgdGFyZ2V0LCBsb29rdXBVcmksIG1vZGUsCi0gICAgICAgICAgICAgICAgICAgIGV4Y2x1ZGVNaW1lcykpOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqCi0gICAgICAgICAqIENyZWF0ZXMgdGhlIEludGVudCB0byBsYXVuY2ggUXVpY2sgQ29udGFjdHMKLSAgICAgICAgICogQGhpZGUKLSAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyBzdGF0aWMgSW50ZW50IGdldFF1aWNrQ29udGFjdEludGVudChDb250ZXh0IGNvbnRleHQsIFJlY3QgdGFyZ2V0LCBVcmkgbG9va3VwVXJpLAotICAgICAgICAgICAgICAgIGludCBtb2RlLCBTdHJpbmdbXSBleGNsdWRlTWltZXMpIHsKICAgICAgICAgICAgIC8vIExhdW5jaCBwaXZvdCBkaWFsb2cgdGhyb3VnaCBpbnRlbnQgZm9yIG5vdwogICAgICAgICAgICAgZmluYWwgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoQUNUSU9OX1FVSUNLX0NPTlRBQ1QpOwogICAgICAgICAgICAgaW50ZW50LnNldEZsYWdzKEludGVudC5GTEFHX0FDVElWSVRZX05FV19UQVNLIHwgSW50ZW50LkZMQUdfQUNUSVZJVFlfQ0xFQVJfVE9QCkBAIC01NjQ4LDcgKzYyNjQsNyBAQAogICAgICAgICAgICAgaW50ZW50LnNldFNvdXJjZUJvdW5kcyh0YXJnZXQpOwogICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEVYVFJBX01PREUsIG1vZGUpOwogICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEVYVFJBX0VYQ0xVREVfTUlNRVMsIGV4Y2x1ZGVNaW1lcyk7Ci0gICAgICAgICAgICByZXR1cm4gaW50ZW50OworICAgICAgICAgICAgY29udGV4dC5zdGFydEFjdGl2aXR5KGludGVudCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTU3MTEsNiArNjMyNywyOCBAQAogICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uU0hPV19PUl9DUkVBVEVfQ09OVEFDVCI7CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIFN0YXJ0cyBhbiBBY3Rpdml0eSB0aGF0IGxldHMgdGhlIHVzZXIgc2VsZWN0IHRoZSBtdWx0aXBsZSBwaG9uZXMgZnJvbSBhCisgICAgICAgICAqIGxpc3Qgb2YgcGhvbmUgbnVtYmVycyB3aGljaCBjb21lIGZyb20gdGhlIGNvbnRhY3RzIG9yCisgICAgICAgICAqIHtAbGluayAjRVhUUkFfUEhPTkVfVVJJU30uCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUaGUgcGhvbmUgbnVtYmVycyBiZWluZyBwYXNzZWQgaW4gdGhyb3VnaCB7QGxpbmsgI0VYVFJBX1BIT05FX1VSSVN9CisgICAgICAgICAqIGNvdWxkIGJlbG9uZyB0byB0aGUgY29udGFjdHMgb3Igbm90LCBhbmQgd2lsbCBiZSBzZWxlY3RlZCBieSBkZWZhdWx0LgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVGhlIHVzZXIncyBzZWxlY3Rpb24gd2lsbCBiZSByZXR1cm5lZCBmcm9tCisgICAgICAgICAqIHtAbGluayBhbmRyb2lkLmFwcC5BY3Rpdml0eSNvbkFjdGl2aXR5UmVzdWx0KGludCwgaW50LCBhbmRyb2lkLmNvbnRlbnQuSW50ZW50KX0KKyAgICAgICAgICogaWYgdGhlIHJlc3VsdENvZGUgaXMKKyAgICAgICAgICoge0BsaW5rIGFuZHJvaWQuYXBwLkFjdGl2aXR5I1JFU1VMVF9PS30sIHRoZSBhcnJheSBvZiBwaWNrZWQgcGhvbmUKKyAgICAgICAgICogbnVtYmVycyBhcmUgaW4gdGhlIEludGVudCdzCisgICAgICAgICAqIHtAbGluayAjRVhUUkFfUEhPTkVfVVJJU307IG90aGVyd2lzZSwgdGhlCisgICAgICAgICAqIHtAbGluayBhbmRyb2lkLmFwcC5BY3Rpdml0eSNSRVNVTFRfQ0FOQ0VMRUR9IGlzIHJldHVybmVkIGlmIHRoZSB1c2VyCisgICAgICAgICAqIGxlZnQgdGhlIEFjdGl2aXR5IHdpdGhvdXQgY2hhbmdpbmcgdGhlIHNlbGVjdGlvbi4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDVElPTl9HRVRfTVVMVElQTEVfUEhPTkVTID0KKyAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLkdFVF9NVUxUSVBMRV9QSE9ORVMiOworCisgICAgICAgIC8qKgogICAgICAgICAgKiBVc2VkIHdpdGgge0BsaW5rICNTSE9XX09SX0NSRUFURV9DT05UQUNUfSB0byBmb3JjZSBjcmVhdGluZyBhIG5ldwogICAgICAgICAgKiBjb250YWN0IGlmIG5vIG1hdGNoaW5nIGNvbnRhY3QgZm91bmQuIE90aGVyd2lzZSwgZGVmYXVsdCBiZWhhdmlvciBpcwogICAgICAgICAgKiB0byBwcm9tcHQgdXNlciB3aXRoIGRpYWxvZyBiZWZvcmUgY3JlYXRpbmcuCkBAIC01NzMxLDYgKzYzNjksMjMgQEAKICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uQ1JFQVRFX0RFU0NSSVBUSU9OIjsKIAogICAgICAgICAvKioKKyAgICAgICAgICogVXNlZCB3aXRoIHtAbGluayAjQUNUSU9OX0dFVF9NVUxUSVBMRV9QSE9ORVN9IGFzIHRoZSBpbnB1dCBvciBvdXRwdXQgdmFsdWUuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUaGUgcGhvbmUgbnVtYmVycyB3YW50IHRvIGJlIHBpY2tlZCBieSBkZWZhdWx0IHNob3VsZCBiZSBwYXNzZWQgaW4gYXMKKyAgICAgICAgICogaW5wdXQgdmFsdWUuIFRoZXNlIHBob25lIG51bWJlcnMgY291bGQgYmVsb25nIHRvIHRoZSBjb250YWN0cyBvciBub3QuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUaGUgcGhvbmUgbnVtYmVycyB3aGljaCB3ZXJlIHBpY2tlZCBieSB0aGUgdXNlciBhcmUgcmV0dXJuZWQgYXMgb3V0cHV0CisgICAgICAgICAqIHZhbHVlLgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVHlwZTogYXJyYXkgb2YgVVJJcywgdGhlIHRlbCBVUkkgaXMgdXNlZCBmb3IgdGhlIHBob25lIG51bWJlcnMgd2hpY2ggZG9uJ3QKKyAgICAgICAgICogYmVsb25nIHRvIGFueSBjb250YWN0LCB0aGUgY29udGVudCBVUkkgaXMgdXNlZCBmb3IgcGhvbmUgaWQgaW4gY29udGFjdHMuCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFWFRSQV9QSE9ORV9VUklTID0KKyAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5leHRyYS5QSE9ORV9VUklTIjsKKworICAgICAgICAvKioKICAgICAgICAgICogT3B0aW9uYWwgZXh0cmEgdXNlZCB3aXRoIHtAbGluayAjU0hPV19PUl9DUkVBVEVfQ09OVEFDVH0gdG8gc3BlY2lmeSBhCiAgICAgICAgICAqIGRpYWxvZyBsb2NhdGlvbiB1c2luZyBzY3JlZW4gY29vcmRpbmF0ZXMuIFdoZW4gbm90IHNwZWNpZmllZCwgdGhlCiAgICAgICAgICAqIGRpYWxvZyB3aWxsIGJlIGNlbnRlcmVkLgpAQCAtNjA0Miw2ICs2Njk3LDU4IEBACiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBib29sZWFuPC9QPgogICAgICAgICAgICAgICovCiAgICAgICAgICAgICB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ge0BsaW5rIENvbW1vbkRhdGFLaW5kcy5FbWFpbCNUWVBFIEVtYWlsLlRZUEV9IG1heSBiZSBhdXRvbWF0aWNhbGx5CisgICAgICAgICAgICAgKiBhZGp1c3RlZCB0byBjb21wbHkgd2l0aCB0aGUgY29uc3RyYWludHMgb2YgdGhlIHNwZWNpZmljIGFjY291bnQgdHlwZS4KKyAgICAgICAgICAgICAqIEZvciBleGFtcGxlLCBhbiBFeGNoYW5nZSBjb250YWN0IGNhbiBvbmx5IGhhdmUgb25lIHBob25lIG51bWJlcnMgb2YgdHlwZSBIb21lLAorICAgICAgICAgICAgICogc28gdGhlIGNvbnRhY3QgZWRpdG9yIG1heSBjaG9vc2UgYSBkaWZmZXJlbnQgdHlwZSBmb3IgdGhpcyBwaG9uZSBudW1iZXIgdG8KKyAgICAgICAgICAgICAqIGF2b2lkIGRyb3BwaW5nIHRoZSB2YWx1ZWFibGUgcGFydCBvZiB0aGUgcm93LCB3aGljaCBpcyB0aGUgcGhvbmUgbnVtYmVyLgorICAgICAgICAgICAgICogPHA+CisgICAgICAgICAgICAgKiBFeGFtcGxlOgorICAgICAgICAgICAgICogPHByZT4KKyAgICAgICAgICAgICAqICBBcnJheUxpc3QmbHQ7Q29udGVudFZhbHVlcyZndDsgZGF0YSA9IG5ldyBBcnJheUxpc3QmbHQ7Q29udGVudFZhbHVlcyZndDsoKTsKKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiAgQ29udGVudFZhbHVlcyByb3cxID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKKyAgICAgICAgICAgICAqICByb3cxLnB1dChEYXRhLk1JTUVUWVBFLCBPcmdhbml6YXRpb24uQ09OVEVOVF9JVEVNX1RZUEUpOworICAgICAgICAgICAgICogIHJvdzEucHV0KE9yZ2FuaXphdGlvbi5DT01QQU5ZLCAiQW5kcm9pZCIpOworICAgICAgICAgICAgICogIGRhdGEuYWRkKHJvdzEpOworICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqICBDb250ZW50VmFsdWVzIHJvdzIgPSBuZXcgQ29udGVudFZhbHVlcygpOworICAgICAgICAgICAgICogIHJvdzIucHV0KERhdGEuTUlNRVRZUEUsIEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKTsKKyAgICAgICAgICAgICAqICByb3cyLnB1dChFbWFpbC5UWVBFLCBFbWFpbC5UWVBFX0NVU1RPTSk7CisgICAgICAgICAgICAgKiAgcm93Mi5wdXQoRW1haWwuTEFCRUwsICJHcmVlbiBCb3QiKTsKKyAgICAgICAgICAgICAqICByb3cyLnB1dChFbWFpbC5BRERSRVNTLCAiYW5kcm9pZEBhbmRyb2lkLmNvbSIpOworICAgICAgICAgICAgICogIGRhdGEuYWRkKHJvdzIpOworICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX0lOU0VSVCwgQ29udGFjdHMuQ09OVEVOVF9VUkkpOworICAgICAgICAgICAgICogIGludGVudC5wdXRQYXJjZWxhYmxlQXJyYXlMaXN0RXh0cmEoSW5zZXJ0LkRBVEEsIGRhdGEpOworICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqICBzdGFydEFjdGl2aXR5KGludGVudCk7CisgICAgICAgICAgICAgKiA8L3ByZT4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgREFUQSA9ICJkYXRhIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBVc2VkIHRvIHNwZWNpZnkgdGhlIGFjY291bnQgaW4gd2hpY2ggdG8gY3JlYXRlIHRoZSBuZXcgY29udGFjdC4KKyAgICAgICAgICAgICAqIDxwPgorICAgICAgICAgICAgICogSWYgdGhpcyB2YWx1ZSBpcyBub3QgcHJvdmlkZWQsIHRoZSB1c2VyIGlzIHByZXNlbnRlZCB3aXRoIGEgZGlzYW1iaWd1YXRpb24KKyAgICAgICAgICAgICAqIG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AqIG1vdW50ZWQuCi0gICAgICogQGhpZGUKLSAgICAgKi8KLSAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBTVEFUVVNfREVWSUNFX05PVF9GT1VORF9FUlJPUiA9IDQ5OTsKLQotICAgIC8qKgotICAgICAqIFRoaXMgZG93bmxvYWQgaXMgdmlzaWJsZSBidXQgb25seSBzaG93cyBpbiB0aGUgbm90aWZpY2F0aW9ucwotICAgICAqIHdoaWxlIGl0J3MgaW4gcHJvZ3Jlc3MuCi0gICAgICogQGhpZGUKLSAgICAgKi8KLSAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBWSVNJQklMSVRZX1ZJU0lCTEUgPSAwOwotCi0gICAgLyoqCi0gICAgICogVGhpcyBkb3dubG9hZCBpcyB2aXNpYmxlIGFuZCBzaG93cyBpbiB0aGUgbm90aWZpY2F0aW9ucyB3aGlsZQotICAgICAqIGluIHByb2dyZXNzIGFuZCBhZnRlciBjb21wbGV0aW9uLgotICAgICAqIEBoaWRlCi0gICAgICovCi0gICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVklTSUJJTElUWV9WSVNJQkxFX05PVElGWV9DT01QTEVURUQgPSAxOwotCi0gICAgLyoqCi0gICAgICogVGhpcyBkb3dubG9hZCBkb2Vzbid0IHNob3cgaW4gdGhlIFVJIG9yIGluIHRoZSBub3RpZmljYXRpb25zLgotICAgICAqIEBoaWRlCi0gICAgICovCi0gICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVklTSUJJTElUWV9ISURERU4gPSAyOwotCi0gICAgLyoqCiAgICAgICogSW1wbGVtZW50YXRpb24gZGV0YWlscwogICAgICAqCiAgICAgICogRXhwb3NlcyBjb25zdGFudHMgdXNlZCB0byBpbnRlcmFjdCB3aXRoIHRoZSBkb3dubG9hZCBtYW5hZ2VyJ3MKQEAgLTExNzEsMTggKzYyMiwxOSBAQAogICAgICAgICAgKiBUaGlzIGRvd25sb2FkIGlzIHZpc2libGUgYnV0IG9ubHkgc2hvd3MgaW4gdGhlIG5vdGlmaWNhdGlvbnMKICAgICAgICAgICogd2hpbGUgaXQncyBpbiBwcm9ncmVzcy4KICAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFZJU0lCSUxJVFlfVklTSUJMRSA9IDA7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFZJU0lCSUxJVFlfVklTSUJMRSA9IERvd25sb2FkTWFuYWdlci5SZXF1ZXN0LlZJU0lCSUxJVFlfVklTSUJMRTsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhpcyBkb3dubG9hZCBpcyB2aXNpYmxlIGFuZCBzaG93cyBpbiB0aGUgbm90aWZpY2F0aW9ucyB3aGlsZQogICAgICAgICAgKiBpbiBwcm9ncmVzcyBhbmQgYWZ0ZXIgY29tcGxldGlvbi4KICAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFZJU0lCSUxJVFlfVklTSUJMRV9OT1RJRllfQ09NUExFVEVEID0gMTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVklTSUJJTElUWV9WSVNJQkxFX05PVElGWV9DT01QTEVURUQgPQorICAgICAgICAgICAgICAgIERvd25sb2FkTWFuYWdlci5SZXF1ZXN0LlZJU0lCSUxJVFlfVklTSUJMRV9OT1RJRllfQ09NUExFVEVEOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGlzIGRvd25sb2FkIGRvZXNuJ3Qgc2hvdyBpbiB0aGUgVUkgb3IgaW4gdGhlIG5vdGlmaWNhdGlvbnMuCiAgICAgICAgICAqLwotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBWSVNJQklMSVRZX0hJRERFTiA9IDI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFZJU0lCSUxJVFlfSElEREVOID0gRG93bmxvYWRNYW5hZ2VyLlJlcXVlc3QuVklTSUJJTEl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WVOYW1lKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX1NMQVNIICsgdm9sdW1lTmFtZSArCisgICAgICAgICAgICAgICAgICAgICIvZmlsZSIpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgZ2V0Q29udGVudFVyaShTdHJpbmcgdm9sdW1lTmFtZSwKKyAgICAgICAgICAgICAgICBsb25nIGZpbGVJZCkgeworICAgICAgICAgICAgcmV0dXJuIFVyaS5wYXJzZShDT05URU5UX0FVVEhPUklUWV9TTEFTSCArIHZvbHVtZU5hbWUKKyAgICAgICAgICAgICAgICAgICAgKyAiL2ZpbGUvIiArIGZpbGVJZCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBnZXRNdHBPYmplY3RzVXJpKFN0cmluZyB2b2x1bWVOYW1lKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX1NMQVNIICsgdm9sdW1lTmFtZSArCisgICAgICAgICAgICAgICAgICAgICIvb2JqZWN0Iik7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBnZXRNdHBPYmplY3RzVXJpKFN0cmluZyB2b2x1bWVOYW1lLAorICAgICAgICAgICAgICAgIGxvbmcgZmlsZUlkKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX1NMQVNIICsgdm9sdW1lTmFtZQorICAgICAgICAgICAgICAgICAgICArICIvb2JqZWN0LyIgKyBmaWxlSWQpOworICAgICAgICB9CisKKyAgICAgICAgLy8gVXNlZCB0byBpbXBsZW1lbnQgdGhlIE1UUCBHZXRPYmplY3RSZWZlcmVuY2VzIGFuZCBTZXRPYmplY3RSZWZlcmVuY2VzIGNvbW1hbmRzLgorICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBnZXRNdHBSZWZlcmVuY2VzVXJpKFN0cmluZyB2b2x1bWVOYW1lLAorICAgICAgICAgICAgICAgIGxvbmcgZmlsZUlkKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX1NMQVNIICsgdm9sdW1lTmFtZQorICAgICAgICAgICAgICAgICAgICArICIvb2JqZWN0LyIgKyBmaWxlSWQgKyAiL3JlZmVyZW5jZXMiKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBGaWVsZHMgZm9yIG1hc3RlciB0YWJsZSBmb3IgYWxsIG1lZGlhIGZpbGVzLgorICAgICAgICAgKiBUYWJsZSBhbHNvIGNvbnRhaW5zIE1lZGlhQ29sdW1ucy5fSUQsIERBVEEsIFNJWkUgYW5kIERBVEVfTU9ESUZJRUQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50ZXJmYWNlIEZpbGVDb2x1bW5zIGV4dGVuZHMgTWVkaWFDb2x1bW5zIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIE1UUCBmb3JtYXQgY29kZSBvZiB0aGUgZmlsZQorICAgICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRk9STUFUID0gImZvcm1hdCI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGluZGV4IG9mIHRoZSBwYXJlbnQgZGlyZWN0b3J5IG9mIHRoZSBmaWxlCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQQVJFTlQgPSAicGFyZW50IjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIHRoZSBmaWxlCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBNSU1FX1RZUEUgPSAibWltZV90eXBlIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgdGl0bGUgb2YgdGhlIGNvbnRlbnQKKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRJVExFID0gInRpdGxlIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgbWVkaWEgdHlwZSAoYXVkaW8sIHZpZGVvLCBpbWFnZSBvciBwbGF5bGlzdCkKKyAgICAgICAgICAgICAqIG9mIHRoZSBmaWxlLCBvciAwIGZvciBub3QgYSBtZWRpYSBmaWxlCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBNRURJQV9UWVBFID0gIm1lZGlhX3R5cGUiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIENvbnN0YW50cyBmb3IgTUVESUFfVFlQRQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBNRURJQV9UWVBFX05PTkUgPSAwOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgTUVESUFfVFlQRV9JTUFHRSA9IDE7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBNRURJQV9UWVBFX0FVRElPID0gMjsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IE1FRElBX1RZUEVfVklERU8gPSAzOworICAgICAgICAgICAgcHVibGljIHN0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pVGh1bWJGaWxlLkJZVEVTX1BFUl9NSU5USFVNQl07Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGh1bWJGaWxlLmdldE1pbmlUaHVtYkZyb21GaWxlKG9yaWdJZCwgc1RodW1iQnVmKSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0bWFwID0gQml0bWFwRmFjdG9yeS5kZWNvZGVCeXRlQXJyYXkoc1RodW1iQnVmLCAwLCBzVGh1bWJCdWYubGVuZ3RoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYml0bWFwID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiY291bGRuJ3QgZGVjb2RlIGJ5dGUgYXJyYXkuIik7CisgICAgICAgICAgICBNaW5pVGh1bWJGaWxlIHRodW1iRmlsZSA9IG5ldyBNaW5pVGh1bWJGaWxlKGlzVmlkZW8gPyBWaWRlby5NZWRpYS5FWFRFUk5BTF9DT05URU5UX1VSSQorICAgICAgICAgICAgICAgICAgICA6IEltYWdlcy5NZWRpYS5FWFRFUk5BTF9DT05URU5UX1VSSSk7CisgICAgICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGxvbmcgbWFnaWMgPSB0aHVtYkZpbGUuZ2V0TWFnaWMob3JpZ0lkKTsKKyAgICAgICAgICAgICAgICBpZiAobWFnaWMgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoa2luZCA9PSBNSUNST19LSU5EKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNUaHVtYkJ1ZkxvY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc1RodW1iQnVmID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc1RodW1iQnVmID0gbmV3IGJ5dGVbTWluaVRodW1iRmlsZS5CWVRFU19QRVJfTUlOVEhVTUJdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGh1bWJGaWxlLmdldE1pbmlUaHVtYkZyb21GaWxlKG9yaWdJZCwgc1RodW1iQnVmKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdG1hcCA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlQnl0ZUFycmF5KHNUaHVtYkJ1ZiwgMCwgc1RodW1iQnVmLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiaXRtYXAgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiY291bGRuJ3QgZGVjb2RlIGJ5dGUgYXJyYXkuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJpdG1hcDsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtpbmQgPT0gTUlOSV9LSU5EKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBjb2x1bW4gPSBpc1ZpZGVvID8gInZpZGVvX2lkPSIgOiAiaW1hZ2VfaWQ9IjsKLSAgICAgICAgICAgICAgICAgICAgQ3Vyc29yIGMgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJpdG1hcDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChraW5kID09IE1JTklfS0lORCkgeworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGNvbHVtbiA9IGlzVmlkZW8gPyAidmlkZW9faWQ9IiA6ICJpbWFnZV9pZD0iOwogICAgICAgICAgICAgICAgICAgICAgICAgYyA9IGNyLnF1ZXJ5KGJhc2VVcmksIFBST0pFQ1RJT04sIGNvbHVtbiArIG9yaWdJZCwgbnVsbCwgbnVsbCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYyAhPSBudWxsICYmIGMubW92ZVRvRmlyc3QoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdG1hcCA9IGdldE1pbmlUaHVtYkZyb21GaWxlKGMsIGJhc2VVcmksIGNyLCBvcHRpb25zKTsKQEAgLTM2MiwxNyArNDU3LDEzIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiaXRtYXA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgYy5jbG9zZSgpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBDdXJzb3IgYyA9IG51bGw7Ci0gICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIFVyaSBibG9ja2luZ1VyaSA9IGJhc2VVcmkuYnVpbGRVcG9uKCkuYXBwZW5kUXVlcnlQYXJhbWV0ZXIoImJsb2NraW5nIiwgIjEiKQogICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZFF1ZXJ5UGFyYW1ldGVyKCJvcmlnX2lkIiwgU3RyaW5nLnZhbHVlT2Yob3JpZ0lkKSkKICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmRRdWVyeVBhcmFtZXRlcigiZ3JvdXBfaWQiLCBTdHJpbmcudmFsdWVPZihncm91cElkKSkuYnVpbGQoKTsKKyAgICAgICAgICAgICAgICBpZiAoYyAhPSBudWxsKSBjLmNsb3NlKCk7CiAgICAgICAgICAgICAgICAgYyA9IGNyLnF1ZXJ5KGJsb2NraW5nVXJpLCBQUk9KRUNUSU9OLCBudWxsLCBudWxsLCBudWxsKTsKICAgICAgICAgICAgICAgICAvLyBUaGlzIGhhcHBlbnMgd2hlbiBvcmlnaW5hbCBpbWFnZS92aWRlbyBkb2Vzbid0IGV4aXN0LgogICAgICAgICAgICAgICAgIGlmIChjID09IG51bGwpIHJldHVybiBudWxsOwpAQCAtNDIzLDYgKzUxNCw5IEBACiAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCBleCk7CiAgICAgICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICAgICAgIGlmIChjICE9IG51bGwpIGMuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAvLyBUbyBhdm9pZCBmaWxlIGRlc2NyaXB0b3IgbGVhayBpbiBhcHBsaWNhdGlvbiBwcm9jZXNzLgorICAgICAgICAgICAgICAgIHRodW1iRmlsZS5kZWFjdGl2YXRlKCk7CisgICAgICAgICAgICAgICAgdGh1bWJGaWxlID0gbnVsbDsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiBiaXRtYXA7CiAgICAgICAgIH0KQEAgLTExNDAsNiArMTIzNCwxOSBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIEdldCB0aGUgY29udGVudDovLyBzdHlsZSBVUkkgZm9yIHF1ZXJ5aW5nIHRoZSBnZW5yZXMgb2YgYW4gYXVkaW8gZmlsZS4KKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiBAcGFyYW0gdm9sdW1lTmFtZSB0aGUgbmFtZSBvZiB0aGUgdm9sdW1lIHRvIGdldCB0aGUgVVJJIGZvcgorICAgICAgICAgICAgICogQHBhcmFtIGF1ZGlvSWQgdGhlIElEIG9mIHRoZSBhdWRpbyBmaWxlIGZvciB3aGljaCB0byByZXRyaWV2ZSB0aGUgZ2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VNIICsgImRldmljZSIpOworCisgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGdldENvbnRlbnRVcmkoaW50IGRldmljZUlEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlEKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbWFudWZhY3R1cmVyIG9mIHRoZSBkZXZpY2UKKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE1BTlVGQUNUVVJFUiA9ICJtYW51ZmFjdHVyZXIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbW9kZWwgbmFtZSBvZiB0aGUgZGV2aWNlCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBNT0RFTCA9ICJtb2RlbCI7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29udGFpbnMgbGlzdCBvZiBzdG9yYWdlIHVuaXRzIGZvciBhbiBNVFAvUFRQIGRldmljZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgU3RvcmFnZSBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zIHsKKworICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBnZXRDb250ZW50VXJpKGludCBkZXZpY2VJRCkgeworICAgICAgICAgICAgcmV0dXJuIFVyaS5wYXJzZShDT05URU5UX0FVVEhPUklUWV9ERVZJQ0VfU0xBU0ggKyBkZXZpY2VJRCArICIvc3RvcmFnZSIpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBVcmkgZ2V0Q29udGVudFVyaShpbnQgZGV2aWNlSUQsIGxvbmcgc3RvcmFnZUlEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlEICsgIi9zdG9yYWdlLyIgKyBzdG9yYWdlSUQpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFN0b3JhZ2UgdW5pdCBpZGVudGlmaWVyCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBJREVOVElGSUVSID0gImlkZW50aWZpZXIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBTdG9yYWdlIHVuaXQgZGVzY3JpcHRpb24KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFU0NSSVBUSU9OID0gImRlc2NyaXB0aW9uIjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb250YWlucyBsaXN0IG9mIG9iamVjdHMgb24gYW4gTVRQL1BUUCBkZXZpY2UKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIE9iamVjdCBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zIHsKKworICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBnZXRDb250ZW50VXJpKGludCBkZXZpY2VJRCwgbG9uZyBvYmplY3RJRCkgeworICAgICAgICAgICAgcmV0dXJuIFVyaS5wYXJzZShDT05URU5UX0FVVEhPUklUWV9ERVZJQ0VfU0xBU0ggKyBkZXZpY2VJRAorICAgICAgICAgICAgICAgICAgICArICIvb2JqZWN0LyIgKyBvYmplY3RJRCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBnZXRDb250ZW50VXJpRm9yT2JqZWN0Q2hpbGRyZW4oaW50IGRldmljZUlELCBsb25nIG9iamVjdElEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlECisgICAgICAgICAgICAgICAgICAgICsgIi9vYmplY3QvIiArIG9iamVjdElEICsgIi9jaGlsZCIpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBVcmkgZ2V0Q29udGVudFVyaUZvclN0b3JhZ2VDaGlsZHJlbihpbnQgZGV2aWNlSUQsIGxvbmcgc3RvcmFnZUlEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlECisgICAgICAgICAgICAgICAgICAgICsgIi9zdG9yYWdlLyIgKyBzdG9yYWdlSUQgKyAiL2NoaWxkIik7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGZvbGxvd2luZyBjb2x1bW5zIGNvcnJlc3BvbmQgdG8gdGhlIGZpZWxkcyBpbiB0aGUgT2JqZWN0SW5mbyBkYXRhc2V0CisgICAgICAgICAqIGFzIGRlc2NyaWJlZCBpbiB0aGUgTVRQIHNwZWNpZmljYXRpb24uCisgICAgICAgICAqLworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgSUQgb2YgdGhlIHN0b3JhZ2UgdW5pdCBjb250YWluaW5nIHRoZSBvYmplY3QuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTVE9SQUdFX0lEID0gInN0b3JhZ2VfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgb2JqZWN0J3MgZm9ybWF0LiAgQ2FuIGJlIG9uZSBvZiB0aGUgRk9STUFUXyogc3ltYm9scyBiZWxvdywKKyAgICAgICAgICogb3IgYW55IG9mIHRoZSB2YWxpZCBNVFAgb2JqZWN0IGZvcm1hdHMgYXMgZGVmaW5lZCBpbiB0aGUgTVRQIHNwZWNpZmljYXRpb24uCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGT1JNQVQgPSAiZm9ybWF0IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHByb3RlY3Rpb24gc3RhdHVzIG9mIHRoZSBvYmplY3QuICBTZWUgdGhlIFBST1RFQ1RJT05fU1RBVFVTXypzeW1ib2xzIGJlbG93LgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUFJPVEVDVElPTl9TVEFUVVMgPSAicHJvdGVjdGlvbl9zdGF0dXMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc2l6ZSBvZiB0aGUgb2JqZWN0IGluIGJ5dGVzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0laRSA9ICJzaXplIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG9iamVjdCdzIHRodW1ibmFpbCBmb3JtYXQuICBDYW4gYmUgb25lIG9mIHRoZSBGT1JNQVRfKiBzeW1ib2xzIGJlbG93LAorICAgICAgICAgKiBvciBhbnkgb2YgdGhlIHZhbGlkIE1UUCBvYmplY3QgZm9ybWF0cyBhcyBkZWZpbmVkIGluIHRoZSBNVFAgc3BlY2lmaWNhdGlvbi4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRIVU1CX0ZPUk1BVCA9ICJ0aHVtYl9mb3JtYXQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc2l6ZSBvZiB0aGUgb2JqZWN0J3MgdGh1bWJuYWlsIGluIGJ5dGVzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJfU0laRSA9ICJ0aHVtYl9zaXplIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHdpZHRoIG9mIHRoZSBvYmplY3QncyB0aHVtYm5haWwgaW4gcGl4ZWxzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJfV0lEVEggPSAidGh1bWJfd2lkdGgiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgaGVpZ2h0IG9mIHRoZSBvYmplY3QncyB0aHVtYm5haWwgaW4gcGl4ZWxzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJfSEVJR0hUID0gInRodW1iX2hlaWdodCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBvYmplY3QncyB0aHVtYm5haWwuCisgICAgICAgICAqIDxQPlR5cGU6IEJMT0I8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBUSFVNQiA9ICJ0aHVtYiI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB3aWR0aCBvZiB0aGUgb2JqZWN0IGluIHBpeGVscy4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNQUdFX1dJRFRIID0gImltYWdlX3dpZHRoIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGhlaWdodCBvZiB0aGUgb2JqZWN0IGluIHBpeGVscy4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNQUdFX0hFSUdIVCA9ICJpbWFnZV9oZWlnaHQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgZGVwdGggb2YgdGhlIG9iamVjdCBpbiBiaXRzIHBlciBwaXhlbC4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNQUdFX0RFUFRIID0gImltYWdlX2RlcHRoIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIElEIG9mIHRoZSBvYmplY3QncyBwYXJlbnQsIG9yIHplcm8gaWYgdGhlIG9iamVjdAorICAgICAgICAgKiBpcyBpbiB0aGUgcm9vdCBvZiBpdHMgc3RvcmFnZSB1bml0LgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEFSRU5UID0gInBhcmVudCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBhc3NvY2lhdGlvbiB0eXBlIGZvciBhIGNvbnRhaW5lciBvYmplY3QuCisgICAgICAgICAqIEZvciBmb2xkZXJzIHRoaXMgaXMgdHlwaWNhbGx5IHtAbGluayAjQVNTT0NJQVRJT05fVFlQRV9HRU5FUklDX0ZPTERFUn0KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFTU09DSUFUSU9OX1RZUEUgPSAiYXNzb2NpYXRpb25fdHlwZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENvbnRhaW5zIGFkZGl0aW9uYWwgaW5mb3JtYXRpb24gYWJvdXQgY29udGFpbmVyIG9iamVjdHMuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBU1NPQ0lBVElPTl9ERVNDID0gImFzc29jaWF0aW9uX2Rlc2MiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc2VxdWVuY2UgbnVtYmVyIG9mIHRoZSBvYmplY3QsIHR5cGljYWxseSB1c2VkIGZvciBhbiBhc3NvY2lhdGlvbgorICAgICAgICAgKiBjb250YWluaW5nIGltYWdlcyB0YWtlbiBpbiBzZXF1ZW5jZS4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFUVVFTkNFX05VTUJFUiA9ICJzZXF1ZW5jZV9udW1iZXIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbmFtZSBvZiB0aGUgb2JqZWN0LgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTkFNRSA9ICJuYW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGRhdGUgdGhlIG9iamVjdCB3YXMgY3JlYXRlZCwgaW4gc2Vjb25kcyBzaW5jZSBKYW51YXJ5IDEsIDE5NzAuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEQVRFX0NSRUFURUQgPSAiZGF0ZV9jcmVhdGVkIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGRhdGUgdGhlI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GlhbCBxdWVyaWVzIHRvIGEgc2VhcmNoIGVuZ2luZSwgaWYgaXQgcG9zZXMKLSAgICAgICAgICogYW55IHByaXZhY3kgY29uY2Vybi4gVGhlIHZhbHVlIGlzIGJvb2xlYW4gKDEgb3IgMCkuCisgICAgICAgICAqIEBkZXByZWNhdGVkIEVhY2ggYXBwbGljYXRpb24gdGhhdCBzaG93cyB3ZWIgc3VnZ2VzdGlvbnMgc2hvdWxkIGhhdmUgaXRzIG93bgorICAgICAgICAgKiBzZXR0aW5nIGZvciB0aGlzLgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0hPV19XRUJfU1VHR0VTVElPTlMgPSAic2hvd193ZWJfc3VnZ2VzdGlvbnMiOwogCiAgICAgICAgIC8qKgpAQCAtMTcwOCw2ICsxNzIzLDEyIEBACiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFVOTE9DS19TT1VORCA9ICJ1bmxvY2tfc291bmQiOwogCiAgICAgICAgIC8qKgorICAgICAgICAgKiBUcnVlIGlmIHdlIHNob3VsZCBhcHBlYXIgYXMgYSBQVFAgZGV2aWNlIGluc3RlYWQgb2YgTVRQLgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVVNFX1BUUF9JTlRFUkZBQ0UgPSAidXNlX3B0cF9pbnRlcmZhY2UiOworCisgICAgICAgIC8qKgogICAgICAgICAgKiBSZWNlaXZlIGluY29taW5nIFNJUCBjYWxscz8KICAgICAgICAgICogMCA9IG5vCiAgICAgICAgICAqIDEgPSB5ZXMKQEAgLTE3ODcsNiArMTgwOCw3IEBACiAgICAgICAgICAgICBURVhUX0FVVE9fUFVOQ1RVQVRFLAogICAgICAgICAgICAgVEVYVF9TSE9XX1BBU1NXT1JELAogICAgICAgICAgICAgQVVUT19USU1FLAorICAgICAgICAgICAgQVVUT19USU1FX1pPTkUsCiAgICAgICAgICAgICBUSU1FXzEyXzI0LAogICAgICAgICAgICAgREFURV9GT1JNQVQsCiAgICAgICAgICAgICBBQ0NFTEVST01FVEVSX1JPVEFUSU9OLApAQCAtMTgwMyw2ICsxODI1LDcgQEAKICAgICAgICAgICAgIExPQ0tTQ1JFRU5fU09VTkRTX0VOQUJMRUQsCiAgICAgICAgICAgICBTSE9XX1dFQl9TVUdHRVNUSU9OUywKICAgICAgICAgICAgIE5PVElGSUNBVElPTl9MSUdIVF9QVUxTRSwKKyAgICAgICAgICAgIFVTRV9QVFBfSU5URVJGQUNFLAogICAgICAgICAgICAgU0lQX0NBTExfT1BUSU9OUywKICAgICAgICAgICAgIFNJUF9SRUNFSVZFX0NBTExTLAogICAgICAgICB9OwpAQCAtMjM0MSw2ICsyMzY0LDE0IEBACiAgICAgICAgIH0KIAogICAgICAgICAvKioKKyAgICAgICAgICogR2V0IHRoZSBrZXkgdGhhdCByZXRyaWV2ZXMgYSBibHVldG9vdGggSW5wdXQgRGV2aWNlJ3MgcHJpb3JpdHkuCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBnZXRCbHVldG9vdGhJbnB1dERldmljZVByaW9yaXR5S2V5KFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgICAgICByZXR1cm4gKCJibHVldG9vdGhfaW5wdXRfZGV2aWNlX3ByaW9yaXR5XyIgKyBhZGRyZXNzLnRvVXBwZXJDYXNlKCkpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFdoZXRoZXIgb3Igbm90IGRhdGEgcm9hbWluZyBpcyBlbmFibGVkLiAoMCA9IGZhbHNlLCAxID0gdHJ1ZSkKICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERBVEFfUk9BTUlORyA9ICJkYXRhX3JvYW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ldHRpbmdzIGlzIGNsaWNrZWQgZnJvbSBBbGwKICAgICAgICAgICogQXBwbGljYXRpb25zLiAgTmVlZGVkIGJlY2F1c2Ugb2YgdXNlciB0ZXN0aW5nIGJldHdlZW4gdGhlIG9sZAogICAgICAgICAgKiBhbmQgbmV3IFNldHRpbmdzIGFwcHMuCkBAIC0yNDk3LDYgKzI1ODUsNjAgQEAKICAgICAgICAgICAgICJlbmFibGVkX2FjY2Vzc2liaWxpdHlfc2VydmljZXMiOwogCiAgICAgICAgIC8qKgorICAgICAgICAgKiBJZiBpbmplY3Rpb24gb2YgYWNjZXNzaWJpbGl0eSBlbmhhbmNpbmcgSmF2YVNjcmlwdCBzY3JpcHRzCisgICAgICAgICAqIGlzIGVuYWJsZWQuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiAgIE5vdGU6IEFjY2Vzc2liaWxpdHkgaW5qZWN0aW5nIHNjcmlwdHMgYXJlIHNlcnZlZCBieSB0aGUKKyAgICAgICAgICogICBHb29nbGUgaW5mcmFzdHJ1Y3R1cmUgYW5kIGVuYWJsZSB1c2VycyB3aXRoIGRpc2FiaWxpdGllcyB0bworICAgICAgICAgKiAgIGVmZmljaWFudGx5IG5hdmlnYXRlIGluIGFuZCBleHBsb3JlIHdlYiBjb250ZW50LgorICAgICAgICAgKiA8L3A+CisgICAgICAgICAqIDxwPgorICAgICAgICAgKiAgIFRoaXMgcHJvcGVydHkgcmVwcmVzZW50cyBhIGJvb2xlYW4gdmFsdWUuCisgICAgICAgICAqIDwvcD4KKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDQ0VTU0lCSUxJVFlfU0NSSVBUX0lOSkVDVElPTiA9CisgICAgICAgICAgICAiYWNjZXNzaWJpbGl0eV9zY3JpcHRfaW5qZWN0aW9uIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogS2V5IGJpbmRpbmdzIGZvciBuYXZpZ2F0aW9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ICAgICAgICAqICAgbmF2aWdhdGlvbiBhY3Rpb25zIGZvciB3ZWIgY29udGVudCB3aXRob3V0IHJlcXVpcmluZyBhIGZyYW1ld29yayBjaGFuZ2UuCisgICAgICAgICAqIDwvcD4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqICAgVGhpcyBwcm9wZXJ0eSByZXByZXNlbnRzIGEgc3RyaW5nIHZhbHVlLgorICAgICAgICAgKiA8L3A+CisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBQ0NFU1NJQklMSVRZX1dFQl9DT05URU5UX0tFWV9CSU5ESU5HUyA9CisgICAgICAgICAgICAiYWNjZXNzaWJpbGl0eV93ZWJfY29udGVudF9rZXlfYmluZGluZ3MiOworCisgICAgICAgIC8qKgogICAgICAgICAgKiBTZXR0aW5nIHRvIGFsd2F5cyB1c2UgdGhlIGRlZmF1bHQgdGV4dC10by1zcGVlY2ggc2V0dGluZ3MgcmVnYXJkbGVzcwogICAgICAgICAgKiBvZiB0aGUgYXBwbGljYXRpb24gc2V0dGluZ3MuCiAgICAgICAgICAqIDEgPSBvdmVycmlkZSBhcHBsaWNhdGlvbiBzZXR0aW5ncywKQEAgLTMwNzYsNiArMzIxOCwxNCBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBXSUZJX0lETEVfTVMgPSAid2lmaV9pZGxlX21zIjsKIAogICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGludGVydmFsIGluIG1pbGxpc2Vjb25kcyB0byBpc3N1ZSBzY2FucyB3aGVuIHRoZSBkcml2ZXIgaXMKKyAgICAgICAgICogc3RhcnRlZC4gVGhpcyBpcyBuZWNlc3NhcnkgdG8gYWxsb3cgd2lmaSB0byBjb25uZWN0IHRvIGFuCisgICAgICAgICAqIGFjY2VzcyBwb2ludCB3aGVuIHRoZSBkcml2ZXIgaXMgc3VzcGVuZGVkLgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgV0lGSV9TQ0FOX0lOVEVSVkFMX01TID0gIndpZmlfc2Nhbl9pbnRlcnZhbF9tcyI7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBpbnRlcnZhbCBpbiBtaWxsaXNlY29uZHMgYXQgd2hpY2ggdG8gY2hlY2sgcGFja2V0IGNvdW50cyBvbiB0aGUKICAgICAgICAgICogbW9iaWxlIGRhdGEgaW50ZXJmYWNlIHdoZW4gc2NyZWVuIGlzIG9uLCB0byBkZXRlY3QgcG9zc2libGUgZGF0YQogICAgICAgICAgKiBjb25uZWN0aW9uIHByb2JsZW1zLgpAQCAtMzQ3Niw2ICszNjI2LDcgQEAKICAgICAgICAgICAgIFBBUkVOVEFMX0NPTlRST0xfUkVESVJFQ1RfVVJMLAogICAgICAgICAgICAgVVNCX01BU1NfU1RPUkFHRV9FTkFCTEVELAogICAgICAgICAgICAgQUNDRVNTSUJJTElUWV9FTkFCTEVELAorICAgICAgICAgICAgQUNDRVNTSUJJTElUWV9TQ1JJUFRfSU5KRUNUSU9OLAogICAgICAgICAgICAgQkFDS1VQX0FVVE9fUkVTVE9SRSwKICAgICAgICAgICAgIEVOQUJMRURfQUNDRVNTSUJJTElUWV9TRVJWSUNFUywKICAgICAgICAgICAgIFRUU19VU0VfREVGQVVMVFMsCkBAIC0zNjU5LDIwICszODEwLDggQEAKICAgICAgICAgICAgIC8vIElmIGEgc2hvcnRjdXQgaXMgc3VwcGxpZWQsIGFuZCBpdCBpcyBhbHJlYWR5IGRlZmluZWQgZm9yCiAgICAgICAgICAgICAvLyBhbm90aGVyIGJvb2ttYXJrLCB0aGVuIHJlbW92ZSB0aGUgb2xkIGRlZmluaXRpb24uCiAgICAgICAgICAgICBpZiAoc2hvcnRjdXQgIT0gMCkgewotICAgICAgICAgICAgICAgIEN1cnNvciBjID0gY3IucXVlcnkoQ09OVEVOVF9VUkksCi0gICAgICAgICAgICAgICAgICAgICAgICBzU2hvcnRjdXRQcm9qZWN0aW9uLCBzU2hvcnRjdXRTZWxlY3Rpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW10geyBTdHJpbmcudmFsdWVPZigoaW50KSBzaG9ydGN1dCkgfSwgbnVsbCk7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGMubW92ZVRvRmlyc3QoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGMuZ2V0Q291bnQoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWMuZGVsZXRlUm93KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ291bGQgbm90IGRlbGV0ZSBleGlzdGluZyBzaG9ydGN1dCByb3ciKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgICAgICBpZiAoYyAhPSBudWxsKSBjLmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNyLmRlbGV0ZShDT05URU5UX1VSSSwgc1Nob3J0Y3V0U2VsZWN0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tdIHsgU3RyaW5nLnZhbHVlT2YoKGludCkgc2hvcnRjdXQpIH0pOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9zZXJ2ZXIvQmx1ZXRvb3RoQTJkcFNlcnZpY2UuamF2YSBiL2NvcmUvamF2YS9hbmRyb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sdWV0b290aEFkYXB0ZXIgbUFkYXB0ZXI7CiAgICAgcHJpdmF0ZSBpbnQgICBtVGFyZ2V0QTJkcFN0YXRlOworICAgIHByaXZhdGUgQmx1ZXRvb3RoRGV2aWNlIG1QbGF5aW5nQTJkcERldmljZTsKIAogICAgIHByaXZhdGUgZmluYWwgQnJvYWRjYXN0UmVjZWl2ZXIgbVJlY2VpdmVyID0gbmV3IEJyb2FkY2FzdFJlY2VpdmVyKCkgewogICAgICAgICBAT3ZlcnJpZGUKQEAgLTk0LDEyICs5MCwxMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlLkVSUk9SKTsKICAgICAgICAgICAgICAgICBzd2l0Y2goYm9uZFN0YXRlKSB7CiAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ERUQ6Ci0gICAgICAgICAgICAgICAgICAgIGlmIChnZXRTaW5rUHJpb3JpdHkoZGV2aWNlKSA9PSBCbHVldG9vdGhBMmRwLlBSSU9SSVRZX1VOREVGSU5FRCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc2V0U2lua1ByaW9yaXR5KGRldmljZSwgQmx1ZXRvb3RoQTJkcC5QUklPUklUWV9PTik7CisgICAgICAgICAgICAgICAgICAgIGlmIChnZXRQcmlvcml0eShkZXZpY2UpID09IEJsdWV0b290aEEyZHAuUFJJT1JJVFlfVU5ERUZJTkVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRQcmlvcml0eShkZXZpY2UsIEJsdWV0b290aEEyZHAuUFJJT1JJVFlfT04pOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLkJPTkRfTk9ORToKLSAgICAgICAgICAgICAgICAgICAgc2V0U2lua1ByaW9yaXR5KGRldmljZSwgQmx1ZXRvb3RoQTJkcC5QUklPUklUWV9VTkRFRklORUQpOworICAgICAgICAgICAgICAgICAgICBzZXRQcmlvcml0eShkZXZpY2UsIEJsdWV0b290aEEyZHAuUFJJT1JJVFlfVU5ERUZJTkVEKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEJsdWV0b290aERldmljZS5BQ1RJT05fQUNMX0RJU0NPTk5FQ1RFRCkpIHsKQEAgLTExMiw5ICsxMDgsMTAgQEAKICAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhBdWRpb01hbmFnZXIuVk9MVU1FX0NIQU5HRURfQUNUSU9OKSkgewogICAgICAgICAgICAgICAgIGludCBzdHJlYW1UeXBlID0gaW50ZW50LmdldEludEV4dHJhKEF1ZGlvTWFuYWdlci5FWFRSQV9WT0xVTUVfU1RSRUFNX1RZUEUsIC0xKTsKICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtVHlwZSA9PSBBdWRpb01hbmFnZXIuU1RSRUFNX01VU0lDKSB7Ci0gICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZSBzaW5rc1tdID0gZ2V0Q29ubmVjdGVkU2lua3MoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHNpbmtzLmxlbmd0aCAhPSAwICYmIGlzUGhvbmVEb2NrZWQoc2lua3NbMF0pKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYWRkcmVzcyA9IHNpbmtzWzBdLmdldEFkZHJlc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgTGlzdDxCbHVldG9vdGhEZXZpY2U+IHNpbmtzID0gZ2V0Q29ubmVjdGVkRGV2aWNlcygpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChzaW5rcy5zaXplKCkgIT0gMCAmJiBpc1Bob25lRG9ja2VkKHNpbmtzLmdldCgwKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBhZGRyZXNzID0gc2lua3MuZ2V0KDApLmdldEFkZHJlc3MoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdWb2xMZXZlbCA9CiAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5nZXRJbnRFeHRyYShBdWRpb01hbmFnZXIuRVhUUkFfVk9MVU1FX1NUUkVBTV9WQUxVRSwgMCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgb2xkVm9sTGV2ZWwgPQpAQCAtMjUzLDcgKzI1MCw3IEBACiAgICAgICAgICAgICBCbHVldG9vdGhEZXZpY2VbXSBkZXZpY2VzID0gbmV3IEJsdWV0b290aERldmljZVttQXVkaW9EZXZpY2VzLnNpemUoKV07CiAgICAgICAgICAgICBkZXZpY2VzID0gbUF1ZGlvRGV2aWNlcy5rZXlTZXQoKS50b0FycmF5KGRldmljZXMpOwogICAgICAgICAgICAgZm9yIChCbHVldG9vdGhEZXZpY2UgZGV2aWNlIDogZGV2aWNlcykgewotICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGdldFNpbmtTdGF0ZShkZXZpY2UpOworICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGdldENvbm5lY3Rpb25TdGF0ZShkZXZpY2UpOwogICAgICAgICAgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RJTkc6CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUQ6CkBAIC0yNzYsNyArMjczLDcgQEAKIAogICAgIHByaXZhdGUgc3luY2hyb25pemVkIGJvb2xlYW4gaXNDb25uZWN0U2lua0ZlYXNpYmxlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKICAgICAgICAgaWYgKCFtQmx1ZXRvb3RoU2VydmljZS5pc0VuY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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgQkxVRVRPT1RIX0FETUlOIHBlcm1pc3Npb24iKTsKICAgICAgICAgaWYgKERCRykgbG9nKCJjb25uZWN0U2luaygiICsgZGV2aWNlICsgIikiKTsKICAgICAgICAgaWYgKCFpc0Nvbm5lY3RTaW5rRmVhc2libGUoZGV2aWNlKSkgcmV0dXJuIGZhbHNlOwogCisgICAgICAgIGZvciAoQmx1ZXRvb3RoRGV2aWNlIHNpbmtEZXZpY2UgOiBtQXVkaW9EZXZpY2VzLmtleVNldCgpKSB7CisgICAgICAgICAgICBpZiAoZ2V0Q29ubmVjdGlvblN0YXRlKHNpbmtEZXZpY2UpICE9IEJsdWV0b290aFByb2ZpbGUuU1RBVEVfRElTQ09OTkVDVEVEKSB7CisgICAgICAgICAgICAgICAgZGlzY29ubmVjdChzaW5rRGV2aWNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCiAgICAgICAgIHJldHVybiBtQmx1ZXRvb3RoU2VydmljZS5jb25uZWN0U2luayhkZXZpY2UuZ2V0QWRkcmVzcygpKTsKICAgICB9CiAKQEAgLTMwNiwxNyArMzE3LDE1IEBACiAgICAgICAgIGludCBzdGF0ZSA9IG1BdWRpb0RldmljZXMuZ2V0KGRldmljZSk7CiAKICAgICAgICAgLy8gaWdub3JlIGlmIHRoZXJlIGFyZSBhbnkgYWN0aXZlIHNpbmtzCi0gICAgICAgIGlmIChsb29rdXBTaW5rc01hdGNoaW5nU3RhdGVzKG5ldyBpbnRbXSB7CisgICAgICAgIGlmIChnZXREZXZpY2VzTWF0Y2hpbmdDb25uZWN0aW9uU3RhdGVzKG5ldyBpbnRbXSB7CiAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNUSU5HLAogICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVELAotICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZ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9CiAgICAgICAgIGhhbmRsZVNpbmtTdGF0ZUNoYW5nZShkZXZpY2UsIHN0YXRlLCBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RJTkcpOwogCkBAIC0zNDUsMTcgKzM1NCwxNiBAQAogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAKLSAgICAgICAgaW50IHN0YXRlID0gZ2V0U2lua1N0YXRlKGRldmljZSk7CisgICAgICAgIGludCBzdGF0ZSA9IGdldENvbm5lY3Rpb25TdGF0ZShkZXZpY2UpOwogICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7CiAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQ6Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNUSU5HOgotICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCi0gICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGRpc2Nvbm5lY3RTaW5rKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gZGlzY29ubmVjdChCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CiAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7CiAgICAgICAgIGlmIChEQkcpIGxvZygiZGlzY29ubmVjdFNpbmsoIiArIGRldmljZSArICIpIik7CkBAIC0zNjQsNyArMzcy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zggQEAKICAgICAgICAgcmV0dXJuIHN0YXRlOwogICAgIH0KIAotICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldFNpbmtQcmlvcml0eShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgcHVibGljIHN5bmNocm9uaXplZCBMaXN0PEJsdWV0b290aERldmljZT4gZ2V0Q29ubmVjdGVkRGV2aWNlcygpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICBMaXN0PEJsdWV0b290aERldmljZT4gc2lua3MgPSBnZXREZXZpY2VzTWF0Y2hpbmdDb25uZWN0aW9uU3RhdGVzKAorICAgICAgICAgICAgICAgIG5ldyBpbnRbXSB7Qmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUR9KTsKKyAgICAgICAgcmV0dXJuIHNpbmtzOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgTGlzdDxCbHVldG9vdGhEZXZpY2U+IGdldERldmljZXNNYXRjaGluZ0Nvbm5lY3Rpb25TdGF0ZXMoaW50W10gc3RhdGVzKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfUEVSTSwgIk5lZWQgQkxVRVRPT1RIIHBlcm1pc3Npb24iKTsKKyAgICAgICAgQXJyYXlMaXN0PEJsdWV0b290aERldmljZT4gc2lua3MgPSBuZXcgQXJyYXlMaXN0PEJsdWV0b290aERldmljZT4oKTsKKyAgICAgICAgZm9yIChCbHVldG9vdGhEZXZpY2UgZGV2aWNlOiBtQXVkaW9EZXZpY2VzLmtleVNldCgpKSB7CisgICAgICAgICAgICBpbnQgc2lua1N0YXRlID0gZ2V0Q29ubmVjdGlvblN0YXRlKGRldmljZSk7CisgICAgICAgICAgICBmb3IgKGludCBzdGF0ZSA6IHN0YXRlcykgeworICAgICAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBzaW5rU3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2lua3MuYWRkKGRldmljZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gc2lua3M7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBpbnQgZ2V0UHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CiAgICAgICAgIHJldHVybiBTZXR0aW5ncy5TZWN1cmUuZ2V0SW50KG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAogICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5nZXRCbHVldG9vdGhBMmRwU2lua1ByaW9yaXR5S2V5KGRldmljZS5nZXRBZGRyZXNzKCkpLAogICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuUFJJT1JJVFlfVU5ERUZJTkVEKTsKICAgICB9CiAKLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gc2V0U2lua1ByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UsIGludCBwcmlvcml0eSkgeworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBzZXRQcmlvcml0eShCbHVldG9vdGhEZXZpY2UgZGV2aWNlLCBpbnQgcHJpb3JpdHkpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAogICAgICAgICAgICAgICAgICAgICA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kZEF1ZGlvU2luayhkZXZpY2UpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpbnQgcHJldlN0YXRlID0gbUF1ZGlvRGV2aWNlcy5nZXQoZGV2aWNlKTsKLSAgICAgICAgICAgICAgICBoYW5kbGVTaW5rU3RhdGVDaGFuZ2UoZGV2aWNlLCBwcmV2U3RhdGUsIHN0YXRlKTsKKyAgICAgICAgICAgICAgICBpZiAoc3RhdGUgPT0gQmx1ZXRvb3RoQTJkcC5TVEFURV9QTEFZSU5HICYmIG1QbGF5aW5nQTJkcERldmljZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgbVBsYXlpbmdBMmRwRGV2aWNlID0gZGV2aWNlOworICAgICAgICAgICAgICAgICAgIGhhbmRsZVNpbmtQbGF5aW5nU3RhdGVDaGFuZ2UoZGV2aWNlLCBzdGF0ZSwgQmx1ZXRvb3RoQTJkcC5TVEFURV9OT1RfUExBWUlORyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRCAmJiBtUGxheWluZ0EyZHBEZXZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtUGxheWluZ0EyZHBEZXZpY2UgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBoYW5kbGVTaW5rUGxheWluZ1N0YXRlQ2hhbmdlKGRldmljZSwgQmx1ZXRvb3RoQTJkcC5TVEFURV9OT1RfUExBWUlORywKKyAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuU1RBVEVfUExBWUlORyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICBtUGxheWluZ0EyZHBEZXZpY2UgPSBudWxsOworICAgICAgICAgICAgICAgICAgIGludCBwcmV2U3RhdGUgPSBtQXVkaW9EZXZpY2VzLmdldChkZXZpY2UpOworICAgICAgICAgICAgICAgICAgIGhhbmRsZVNpbmtTdGF0ZUNoYW5nZShkZXZpY2UsIHByZXZTdGF0ZSwgc3RhdGUpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTQ5Nyw1MiArNTE5LDQ3IEBACiAgICAgICAgICAgICBjaGVja1NpbmtTdXNwZW5kU3RhdGUoc3RhdGUpOwogICAgICAgICAgICAgbVRhcmdldEEyZHBTdGF0ZSA9IC0xOwogCi0gICAgICAgICAgICBpZiAoZ2V0U2lua1ByaW9yaXR5KGRldmljZSkgPiBCbHVldG9vdGhBMmRwLlBSSU9SSVRZX09GRiAmJgorICAgICAgICAgICAgaWYgKGdldFByaW9yaXR5KGRldmljZSkgPiBCbHVldG9vdGhBMmRwLlBSSU9SSVRZX09GRiAmJgogICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRCkgewogICAgICAgICAgICAgICAgIC8vIFdlIGhhdmUgY29ubmVjdGVkIG9yIGF0dGVtcHRpbmcgdG8gY29ubmVjdC4KICAgICAgICAgICAgICAgICAvLyBCdW1wIHByaW9yaXR5Ci0gICAgICAgICAgICAgICAgc2V0U2lua1ByaW9yaXR5KGRldmljZSwgQmx1ZXRvb3RoQTJkcC5QUklPUklUWV9BVVRPX0NPTk5FQ1QpOworICAgICAgICAgICAgICAgIHNldFByaW9yaXR5KGRldmljZSwgQmx1ZXRvb3RoQTJkcC5QUklPUklUWV9BVVRPX0NPTk5FQ1QpOwogICAgICAgICAgICAgICAgIC8vIFdlIHdpbGwgb25seSBoYXZlIDEgZGV2aWNlIHdpdGggQVVUT19DT05ORUNUIHByaW9yaXR5CiAgICAgICAgICAgICAgICAgLy8gVG8gYmUgYmFja3dhcmQgY29tcGF0aWJsZSBzZXQgZXZlcnlvbmUgZWxzZSB0byBoYXZlIFBSSU9SSVRZX09OCiAgICAgICAgICAgICAgICAgYWRqdXN0T3RoZXJTaW5rUHJpb3JpdGllcyhkZXZpY2UpOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhBMmRwLkFDVElPTl9TSU5LX1NUQVRFX0NIQU5HRUQpOworICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoQmx1ZXRvb3RoQTJkcC5BQ1RJT05fQ09OTkVDVElPTl9TVEFURV9DSEFOR0VEKTsKICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhEZXZpY2UuRVhUUkFfREVWSUNFLCBkZXZpY2UpOwotICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEEyZHAuRVhUUkFfUFJFVklPVVNfU0lOS19TVEFURSwgcHJldlN0YXRlKTsKLSAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhBMmRwLkVYVFJBX1NJTktfU1RBVEUsIHN0YXRlKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhQcm9maWxlLkVYVFJBX1BSRVZJT1VTX1NUQVRFLCBwcmV2U3RhdGUpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aFByb2ZpbGUuRVhUUkFfU1RBVEUsIHN0YXRlKTsKICAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50LCBCTFVFVE9PVEhfUEVSTSk7CiAKICAgICAgICAgICAgIGlmIChEQkcpIGxvZygiQTJEUCBzdGF0ZSA6IGRldmljZTogIiArIGRldmljZSArICIgU3RhdGU6IiArIHByZXZTdGF0ZSArICItPiIgKyBzdGF0ZSk7CisKKyAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLnNlbmRDb25uZWN0aW9uU3RhdGVDaGFuZ2UoZGV2aWNlLCBzdGF0ZSwgcHJldlN0YXRlKTsKICAgICAgICAgfQogICAgIH0KIAorICAgIHByaXZhdG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FJJT1JJVFlfQVVUT19DT05ORUNUICYmCiAgICAgICAgICAgICAgICAgIWRldmljZS5lcXVhbHMoY29ubmVjdGVkRGV2aWNlKSkgewotICAgICAgICAgICAgICAgIHNldFNpbmtQcmlvcml0eShkZXZpY2UsIEJsdWV0b290aEEyZHAuUFJJT1JJVFlfT04pOworICAgICAgICAgICAgICAgIHNldFByaW9yaXR5KGRldmljZSwgQmx1ZXRvb3RoQTJkcC5QUklPUklUWV9PTik7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHN5bmNocm9uaXplZCBTZXQ8Qmx1ZXRvb3RoRGV2aWNlPiBsb29rdXBTaW5rc01hdGNoaW5nU3RhdGVzKGludFtdIHN0YXRlcykgewotICAgICAgICBTZXQ8Qmx1ZXRvb3RoRGV2aWNlPiBzaW5rcyA9IG5ldyBIYXNoU2V0PEJsdWV0b290aERldmljZT4oKTsKLSAgICAgICAgaWYgKG1BdWRpb0RldmljZXMuaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICByZXR1cm4gc2lua3M7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChCbHVldG9vdGhEZXZpY2UgZGV2aWNlOiBtQXVkaW9EZXZpY2VzLmtleVNldCgpKSB7Ci0gICAgICAgICAgICBpbnQgc2lua1N0YXRlID0gZ2V0U2lua1N0YXRlKGRldmljZSk7Ci0gICAgICAgICAgICBmb3IgKGludCBzdGF0ZSA6IHN0YXRlcykgewotICAgICAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBzaW5rU3RhdGUpIHsKLSAgICAgICAgICAgICAgICAgICAgc2lua3MuYWRkKGRldmljZSk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gc2lua3M7Ci0gICAgfQotCiAgICAgcHJpdmF0ZSBib29sZWFuIGNoZWNrU2lua1N1c3BlbmRTd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WVzWzBdKTsKKyAgICAgICAgYm9vbGVhbiBzdGF0ZSA9IGZhbHNlOworICAgICAgICBpZiAocHJvcFZhbHVlc1sxXS5lcXVhbHMoInRydWUiKSkgeworICAgICAgICAgICAgc3RhdGUgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLmhhbmRsZUlucHV0RGV2aWNlUHJvcGVydHlDaGFuZ2UoYWRkcmVzcywgc3RhdGUpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBvblBhbkRldmljZVByb3BlcnR5Q2hhbmdlZChTdHJpbmcgZGV2aWNlT2JqZWN0UGF0aCwgU3RyaW5nW10gcHJvcFZhbHVlcykgeworICAgICAgICBTdHJpbmcgbmFtZSA9IHByb3BWYWx1ZXNbMF07CisgICAgICAgIFN0cmluZyBhZGRyZXNzID0gbUJsdWV0b290aFNlcnZpY2UuZ2V0QWRkcmVzc0Zyb21PYmplY3RQYXRoKGRldmljZU9iamVjdFBhdGgpOworICAgICAgICBpZiAoYWRkcmVzcyA9PSBudWxsKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJvblBhbkRldmljZVByb3BlcnR5Q2hhbmdlZDogQWRkcmVzcyBvZiB0aGUgcmVtb3RlIGRldmljZSBpbiBudWxsIik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKERCRykgeworICAgICAgICAgICAgbG9nKCJQYW4gRGV2aWNlIHByb3BlcnR5IGNoYW5nZWQ6ICIgKyBhZGRyZXNzICsgIiAgcHJvcGVydHk6ICIKKyAgICAgICAgICAgICAgICAgICAgKyBuYW1lICsgIiB2YWx1ZTogIisgcHJvcFZhbHVlc1sxXSk7CisgICAgICAgIH0KKyAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA9IG1BZGFwdGVyLmdldFJlbW90ZURldmljZShhZGRyZXNzKTsKKyAgICAgICAgaWYgKG5hbWUuZXF1YWxzKCJDb25uZWN0ZWQiKSkgeworICAgICAgICAgICAgaWYgKHByb3BWYWx1ZXNbMV0uZXF1YWxzKCJmYWxzZSIpKSB7CisgICAgICAgICAgICAgICAgbUJsdWV0b290aFNlcnZpY2UuaGFuZGxlUGFuRGV2aWNlU3RhdGVDaGFuZ2UoZGV2aWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfRElTQ09OTkVDVEVEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygiSW50ZXJmYWNlIikpIHsKKyAgICAgICAgICAgIFN0cmluZyBpZmFjZSA9IHByb3BWYWx1ZXNbMV07CisgICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5oYW5kbGVQYW5EZXZpY2VTdGF0ZUNoYW5nZShkZXZpY2UsIGlmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhJbnB1dERldmljZS5TVEFURV9DT05ORUNURUQpOworICAgICAgICB9CisgICAgfQorCiAgICAgcHJpdmF0ZSBTdHJpbmcgY2hlY2tQYWlyaW5nUmVxdWVzdEFuZEdldEFkZHJlc3MoU3RyaW5nIG9iamVjdFBhdGgsIGludCBuYXRpdmVEYXRhKSB7CiAgICAgICAgIFN0cmluZyBhZGRyZXNzID0gbUJsdWV0b290aFNlcnZpY2UuZ2V0QWRkcmVzc0Zyb21PYmplY3RQYXRoKG9iamVjdFBhdGgpOwogICAgICAgICBpZiAoYWRkcmVzcyA9PSBudWxsKSB7CkBAIC01MTksNiArNTgwLDggQEAKICAgICB9CiAKICAgICBwcml2YXRlIGJvb2xlYW4gb25BZ2VudEF1dGhvcml6ZShTdHJpbmcgb2JqZWN0UGF0aCwgU3RyaW5nIGRldmljZVV1aWQpIHsKKyAgICAgICAgaWYgKCFtQmx1ZXRvb3RoU2VydmljZS5pc0VuYWJsZWQoKSkgcmV0dXJ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7CiAgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoQmx1ZXRvb3RoVXVpZC5pc0lucHV0RGV2aWNlKHV1aWQpICYmICFpc090aGVySW5wdXREZXZpY2VDb25uZWN0ZWQoYWRkcmVzcykpIHsKKyAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlIGlucHV0RGV2aWNlID0gbmV3IEJsdWV0b290aElucHV0RGV2aWNlKG1Db250ZXh0KTsKKyAgICAgICAgICAgIGF1dGhvcml6ZWQgPSBpbnB1dERldmljZS5nZXRJbnB1dERldmljZVByaW9yaXR5KGRldmljZSkgPgorICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlLlBSSU9SSVRZX09GRjsKKyAgICAgICAgICAgICBpZiAoYXV0aG9yaXplZCkgeworICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJBbGxvd2luZyBpbmNvbWluZyBISUQgY29ubmVjdGlvbiBmcm9tICIgKyBhZGRyZXNzKTsKKyAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJSZWplY3RpbmcgaW5jb21pbmcgSElEIGNvbm5lY3Rpb24gZnJvbSAiICsgYWRkcmVzcyk7CisgICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKEJsdWV0b290aFV1aWQuaXNCbmVwKHV1aWQpIHx8IEJsdWV0b290aFV1aWQuaXNOYXAodXVpZCkgJiYKKyAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5hbGxvd0luY29taW5nVGV0aGVyaW5nKCkpeworICAgICAgICAgICAgYXV0aG9yaXplZCA9IHRydWU7CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICBMb2cuaShUQUcsICJSZWplY3RpbmcgaW5jb21pbmcgIiArIGRldmljZVV1aWQgKyAiIGNvbm5lY3Rpb24gZnJvbSAiICsgYWRkcmVzcyk7CiAgICAgICAgIH0KQEAgLTU1Nyw2ICs2MzEsMTggQEAKICAgICAgICAgcmV0dXJuIGF1dGhvcml6ZWQ7CiAgICAgfQogCisgICAgcHJpdmF0ZSBib29sZWFuIGlzT3RoZXJJbnB1dERldmljZUNvbm5lY3RlZChTdHJpbmcgYWRkcmVzcykgeworICAgICAgICBMaXN0PEJsdWV0b290aERldmljZT4gZGV2aWNlcyA9CisgICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5sb29rdXBJbnB1dERldmljZXNNYXRjaGluZ1N0YXRlcyhuZXcgaW50W10geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfQ09OTkVDVElORywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0NPTk5FQ1RFRH0pOworCisgICAgICAgIGZvciAoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA6IGRldmljZXMpIHsKKyAgICAgICAgICAgIGlmICghZGV2aWNlLmdldEFkZHJlc3MoKS5lcXVhbHMoYWRkcmVzcykpIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKICAgICBwcml2YXRlIGJvb2xlYW4gb25BZ2VudE91dE9mQmFuZERhdGFBdmFpbGFibGUoU3RyaW5nIG9iamVjdFBhdGgpIHsKICAgICAgICAgaWYgKCFtQmx1ZXRvb3RoU2VydmljZS5pc0VuYWJsZWQoKSkgcmV0dXJuIGZhbHNlOwogCkBAIC01NjgsMTQgKzY1NCwxNiBAQAogICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIGZhbHNlOwotCiAgICAgfQogCi0gICAgcHJpdmF0ZSBib29sZWFuIGlzT3RoZXJTaW5rSW5Ob25EaXNjb25uZWN0aW5nU3RhdGUoU3RyaW5nIGFkZHJlc3MpIHsKLSAgICAgICAgQmx1ZXRvb3RoQTJkcCBhMmRwID0gbmV3IEJsdWV0b290aEEyZHAobUNvbnRleHQpOwotICAgICAgICBTZXQ8Qmx1ZXRvb3RoRGV2aWNlPiBkZXZpY2VzID0gYTJkcC5nZXROb25EaXNjb25uZWN0ZWRTaW5rcygpOworICAgIHByaXZhdGUgYm9vbGVhbiBpc090aGVyU2lua0luTm9uRGlzY29ubmVjdGVkU3RhdGUoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgTGlzdDxCbHVldG9vdGhEZXZpY2U+IGRldmljZXMgPQorICAgICAgICAgICAgbUEyZHAuZ2V0RGV2aWNlc01hdGNoaW5nQ29ubmVjdGlvblN0YXRlcyhuZXcgaW50W10ge0JsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RJTkcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVElOR30pOworCiAgICAgICAgIGlmIChkZXZpY2VzLnNpemUoKSA9PSAwKSByZXR1cm4gZmFsc2U7Ci0gICAgICAgIGZvcihCbHVldG9vdGhEZXZpY2UgZGV2OiBkZXZpY2VzKSB7CisgICAgICAgIGZvciAoQmx1ZXRvb3RoRGV2aWNlIGRldjogZGV2aWNlcykgewogICAgICAgICAgICAgaWYgKCFkZXYuZ2V0QWRkcmVzcygpLmVxdWFscyhhZGRyZXNzKSkgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIGZhbHNlOwpAQCAtNjIyLDYgKzcxMCw2MCBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIG9uSW5wdXREZXZpY2VDb25uZWN0aW9uUmVzdWx0KFN0cmluZyBwYXRoLCBib29sZWFuIHJlc3VsdCkgeworICAgICAgICAvLyBTdWNjZXNzIGNhc2UgZ2V0cyBoYW5kbGVkIGJ5IFByb3BlcnR5IENoYW5nZSBzaWduYWwKKyAgICAgICAgaWYgKCFyZXN1bHQpIHsKKyAgICAgICAgICAgIFN0cmluZyBhZGRyZXNzID0gbUJsdWV0b290aFNlcnZpY2UuZ2V0QWRkcmVzc0Zyb21PYmplY3RQYXRoKHBhdGgpOworICAgICAgICAgICAgaWYgKGFkZHJlc3MgPT0gbnVsbCkgcmV0dXJuOworCisgICAgICAgICAgICBib29sZWFuIGNvbm5lY3RlZCA9IGZhbHNlOworICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA9IG1BZGFwdGVyLmdldFJlbW90ZURldmljZShhZGRyZXNzKTsKKyAgICAgICAgICAgIGludCBzdGF0ZSA9IG1CbHVldG9vdGhTZXJ2aWNlLmdldElucHV0RGV2aWNlU3RhdGUoZGV2aWNlKTsKKyAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhJbnB1dERldmljZS5TVEFURV9DT05ORUNUSU5HKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGVkID0gZmFsc2U7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHN0YXRlID09IEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0RJU0NPTk5FQ1RJTkcpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0ZWQgPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBvbklucHV0RGV2aWNlQ29ubmVjdGlvblJlc3VsdC4gU3RhdGUgaXM6IiArIHN0YXRlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLmhhbmRsZUlucHV0RGV2aWNlUHJvcGVydHlDaGFuZ2UoYWRkcmVzcywgY29ubmVjdGVkKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBvblBhbkRldmljZUNvbm5lY3Rpb25SZXN1bHQoU3RyaW5nIHBhdGgsIGJvb2xlYW4gcmVzdWx0KSB7CisgICAgICAgIGxvZyAoIm9uUGFuRGV2aWNlQ29ubmVjdGlvblJlc3VsdCAiICsgcGF0aCArICIgIiArIHJlc3VsdCk7CisgICAgICAgIC8vIFN1Y2Nlc3MgY2FzZSBnZXRzIGhhbmRsZWQgYnkgUHJvcGVydHkgQ2hhbmdlIHNpZ25hbAorICAgICAgICBpZiAoIXJlc3VsdCkgeworICAgICAgICAgICAgU3RyaW5nIGFkZHJlc3MgPSBtQmx1ZXRvb3RoU2VydmljZS5nZXRBZGRyZXNzRnJvbU9iamVjdFBhdGgocGF0aCk7CisgICAgICAgICAgICBpZiAoYWRkcmVzcyA9PSBudWxsKSByZXR1cm47CisKKyAgICAgICAgICAgIGJvb2xlYW4gY29ubmVjdGVkID0gZmFsc2U7CisgICAgICAgICAgICBCbHVldG9vdGhEZXZpY2UgZGV2aWNlID0gbUFkYXB0ZXIuZ2V0UmVtb3RlRGV2aWNlKGFkZHJlc3MpOworICAgICAgICAgICAgaW50IHN0YXRlID0gbUJsdWV0b290aFNlcnZpY2UuZ2V0UGFuRGV2aWNlU3RhdGUoZGV2aWNlKTsKKyAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhQYW4uU1RBVEVfQ09OTkVDVElORykgeworICAgICAgICAgICAgICAgIGNvbm5lY3RlZCA9IGZhbHNlOworICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhQYW4uU1RBVEVfRElTQ09OTkVDVElORykgeworICAgICAgICAgICAgICAgIGNvbm5lY3RlZCA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIG9uUGFuRGV2aWNlQ29ubmVjdGlvblJlc3VsdC4gU3RhdGUgaXM6IC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ICAgICAgICBmb3IgKEJsdWV0b290aERldmljZSBkZXZpY2U6IGdldENvbm5lY3RlZElucHV0RGV2aWNlcygpKSB7CisgICAgICAgICAgICBkaXNjb25uZWN0SW5wdXREZXZpY2UoZGV2aWNlKTsKKyAgICAgICAgfQorCisgICAgICAgIGZvciAoQmx1ZXRvb3RoRGV2aWNlIGRldmljZTogZ2V0Q29ubmVjdGVkUGFuRGV2aWNlcygpKSB7CisgICAgICAgICAgICBkaXNjb25uZWN0UGFuRGV2aWNlKGRldmljZSk7CisgICAgICAgIH0KKyAgICB9CiAKICAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIGZpbmlzaERpc2FibGUoYm9vbGVhbiBzYXZlU2V0dGluZykgewogICAgICAgICBpZiAobUJsdWV0b290aFN0YXRlICE9IEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfVFVSTklOR19PRkYpIHsKQEAgLTM3MCw2ICs0MjYsMTEgQEAKICAgICAgICAgbUFkYXB0ZXJQcm9wZXJ0aWVzLmNsZWFyKCk7CiAgICAgICAgIG1TZXJ2aWNlUmVjb3JkVG9QaWQuY2xlYXIoKTsKIAorICAgICAgICBtUHJvZmlsZXNDb25uZWN0ZWQgPSAwOworICAgICAgICBtUHJvZmlsZXNDb25uZWN0aW5nID0gMDsKKyAgICAgICAgbVByb2ZpbGVzRGlzY29ubmVjdGluZyA9IDA7CisgICAgICAgIG1BZGFwdGVyQ29ubmVjdGlvblN0YXRlID0gQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9ESVNDT05ORUNURUQ7CisKICAgICAgICAgaWYgKHNhdmVTZXR0aW5nKSB7CiAgICAgICAgICAgICBwZXJzaXN0Qmx1ZXRvb3RoT25TZXR0aW5nKGZhbHNlKTsKICAgICAgICAgfQpAQCAtNTY3LDggKzYyOCwxMiBAQAogICAgICAgICAgICAgICAgIG1Cb25kU3RhdGUucmVhZEF1dG9QYWlyaW5nRGF0YSgpOwogICAgICAgICAgICAgICAgIG1Cb25kU3RhdGUubG9hZEJvbmRTdGF0ZSgpOwogICAgICAgICAgICAgICAgIGluaXRQcm9maWxlU3RhdGUoKTsKKworICAgICAgICAgICAgICAgIC8vUmVnaXN0ZXIgU0RQIHJlY29yZHMuCiAgICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2VEZWxheWVkKAogICAgICAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXIub2J0YWluTWVzc2FnZShNRVNTQUdFX1JFR0lTVEVSX1NEUF9SRUNPUkRTLCAxLCAtMSksIDMwMDApOworICAgICAgICAgICAgICAgIHNldEJsdWV0b290aFRldGhlcmluZ05hdGl2ZSh0cnVlLCBCbHVldG9vdGhQYW4uTkFQX1JPTEUsIEJsdWV0b290aFBhbi5OQVBfQlJJREdFKTsKKwogCiAgICAgICAgICAgICAgICAgLy8gTG9nIGJsdWV0b290aCBvbiB0byBiYXR0ZXJ5IHN0YXRzLgogICAgICAgICAgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKQEAgLTc0Nyw2ICs4MTIsMTAgQEAKICAgICAgICAgICAgICAgICByZW1vdmVQcm9maWxlU3RhdGUoYWRkcmVzcyk7CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIC8vIEhJRCBpcyBoYW5kbGVkIGJ5IEJsdWV0b290aFNlcnZpY2UsIG90aGVyIHByb2ZpbGVzCisgICAgICAgICAgICAvLyB3aWxsIGJlIGhhbmRsZWQgYnkgdGhlaXIgcmVzcGVjdGl2ZSBzZXJ2aWNlcy4KKyAgICAgICAgICAgIHNldEluaXRpYWxJbnB1dERldmljZVByaW9yaXR5KG1BZGFwdGVyLmdldFJlbW90ZURldmljZShhZGRyZXNzKSwgc3RhdGUpOworCiAgICAgICAgICAgICBpZiAoREJHKSBsb2coYWRkcmVzcyArICIgYm9uZCBzdGF0ZSAiICsgb2xkU3RhdGUgKyAiIC0+ICIgKyBzdGF0ZSArICIgKCIgKwogICAgICAgICAgICAgICAgICAgICAgICAgIHJlYXNvbiArICIpIik7CiAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhEZXZpY2UuQUNUSU9OX0JPTkRfU1RBVEVfQ0hBTkdFRCk7CkBAIC0xMzYyLDYgKzE0MzEsNDA5IEBACiAgICAgICAgIHJldHVybiBzcC5jb250YWlucyhTSEFSRURfUFJFRkVSRU5DRV9ET0NLX0FERFJFU1MgKyBhZGRyZXNzKTsKICAgICB9CiAKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gaXNUZXRoZXJpbmdPbigpIHsKKyAgICAgICAgcmV0dXJuIG1UZXRoZXJpbmdPbjsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBhbGxvd0luY29taW5nVGV0aGVyaW5nKCkgeworICAgICAgICBpZiAoaXNUZXRoZXJpbmdPbigpICYmIGdldENvbm5lY3RlZFBhbkRldmljZXMoKS5zaXplKCkgPCBtTWF4UGFuRGV2aWNlcykKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHJpdmF0ZSBCcm9hZGNhc3RSZWNlaXZlciBtVGV0aGVyaW5nUmVjZWl2ZXIgPSBudWxsOworCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHNldEJsdWV0b290aFRldGhlcmluZyhib29sZWFuIHZhbHVlKSB7CisgICAgICAgIGlmICghdmFsdWUpIHsKKyAgICAgICAgICAgIGRpc2Nvbm5lY3RQYW4oKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChnZXRCbHVldG9vdGhTdGF0ZSgpICE9IEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfT04gJiYgdmFsdWUpIHsKKyAgICAgICAgICAgIEludGVudEZpbHRlciBmaWx0ZXIgPSBuZXcgSW50ZW50RmlsdGVyKCk7CisgICAgICAgICAgICBmaWx0ZXIuYWRkQWN0aW9uKEJsdWV0b290aEFkYXB0ZXIuQUNUSU9OX1NUQVRFX0NIQU5HRUQpOworICAgICAgICAgICAgbVRldGhlcmluZ1JlY2VpdmVyID0gbmV3IEJyb2FkY2FzdFJlY2VpdmVyKCkgeworICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBvblJlY2VpdmUoQ29udGV4dCBjb250ZXh0LCBJbnRlbnQgaW50ZW50KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoQWRhcHRlci5FWFRSQV9TVEFURSwgQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9PRkYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9PTikgeworICAgICAgICAgICAgICAgICAgICAgICAgbVRldGhlcmluZ09uID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LnVucmVnaXN0ZXJSZWNlaXZlcihtVGV0aGVyaW5nUmVjZWl2ZXIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIobVRldGhlcmluZ1JlY2VpdmVyLCBmaWx0ZXIpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbVRldGhlcmluZ09uID0gdmFsdWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRQYW5EZXZpY2VTdGF0ZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfUEVSTSwgIk5lZWQgQkxVRVRPT1RIIHBlcm1pc3Npb24iKTsKKworICAgICAgICBQYWlyPEludGVnZXIsIFN0cmluZz4gcGFuRGV2aWNlID0gbVBhbkRldmljZXMuZ2V0KGRldmljZSk7CisgICAgICAgIGlmIChwYW5EZXZpY2UgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aFBhbi5TVEFURV9ESVNDT05ORUNURUQ7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHBhbkRldmljZS5maXJzdDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gY29ubmVjdFBhbkRldmljZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7CisKKyAgICAgICAgU3RyaW5nIG9iamVjdFBhdGggPSBnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSk7CisgICAgICAgIGlmIChEQkcpIGxvZygiY29ubmVjdCBQQU4oIiArIG9iamVjdFBhdGggKyAiKSIpOworICAgICAgICBpZiAoZ2V0UGFuRGV2aWNlU3RhdGUoZGV2aWNlKSAhPSBCbHVldG9vdGhQYW4uU1RBVEVfRElTQ09OTkVDVEVEKSB7CisgICAgICAgICAgICBsb2cgKGRldmljZSArICIgYWxyZWFkeSBjb25uZWN0ZWQgdG8gUEFOIik7CisgICAgICAgIH0KKworICAgICAgICBpbnQgY29ubmVjdGVkQ291bnQgPSAwOworICAgICAgICBmb3IgKEJsdWV0b290aERldmljZSBwYW5EZXZpY2U6IG1QYW5EZXZpY2VzLmtleVNldCgpKSB7CisgICAgICAgICAgICBpZiAoZ2V0UGFuRGV2aWNlU3RhdGUocGFuRGV2aWNlKSA9PSBCbHVldG9vdGhQYW4uU1RBVEVfQ09OTkVDVEVEKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGVkQ291bnQgKys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKGNvbm5lY3RlZENvdW50ID4gOCkgeworICAgICAgICAgICAgbG9nIChkZXZpY2UgKyAiIGNvdWxkIG5vdCBjb25uZWN0IHRvIFBBTiBiZWNhdXNlIDggb3RoZXIgZGV2aWNlcyBhcmUgYWxyZWFkeSBjb25uZWN0ZWQiKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGhhbmRsZVBhbkRldmljZVN0YXRlQ2hhbmdlKGRldmljZSwgQmx1ZXRvb3RoUGFuLlNUQVRFX0NPTk5FQ1RJTkcpOworICAgICAgICBpZiAoY29ubmVjdFBhbkRldmljZU5hdGl2ZShvYmplY3RQYXRoLCAibmFwIiwgInBhbnUiKSkgeworICAgICAgICAgICAgbG9nICgiY29ubmVjdGluZyB0byBQQU4iKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaGFuZGxlUGFuRGV2aWNlU3RhdGVDaGFuZ2UoZGV2aWNlLCBCbHVldG9vdGhQYW4uU1RBVEVfRElTQ09OTkVDVEVEKTsKKyAgICAgICAgICAgIGxvZyAoImNvdWxkIG5vdCBjb25uZWN0IHRvIFBBTiIpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgYm9vbGVhbiBkaXNjb25uZWN0UGFuKCkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CisgICAgICAgIGlmIChEQkcpIGxvZygiZGlzY29ubmVjdCBhbGwgUEFOIGRldmljZXMiKTsKKworICAgICAgICBmb3IgKEJsdWV0b290aERldmljZSBkZXZpY2U6IG1QYW5EZXZpY2VzLmtleVNldCgpKSB7CisgICAgICAgICAgICBpZiAoZ2V0UGFuRGV2aWNlU3RhdGUoZGV2aWNlKSA9PSBCbHVldG9vdGhQYW4uU1RBVEVfQ09OTkVDVEVEKSB7CisgICAgICAgICAgICAgICAgaWYgKCFkaXNjb25uZWN0UGFuRGV2aWNlKGRldmljZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nICgiY291bGQgbm90IGRpc2Nvbm5lY3QgUGFuIERldmljZSAiK2RldmljZS5nZXRBZGRyZXNzKCkpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgTGlzdDxCbHVldG9vdGhEZXZpY2U+IGdldENvbm5lY3RlZFBhbkRldmljZXMoKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfUEVSTSwgIk5lZWQgQkxVRVRPT1RIIHBlcm1pc3Npb24iKTsKKworICAgICAgICBMaXN0PEJsdWV0b290aERldmljZT4gZGV2aWNlcyA9IG5ldyBBcnJheUxpc3Q8Qmx1ZXRvb3RoRGV2aWNlPigpOworCisgICAgICAgIGZvciAoQmx1ZXRvb3RoRGV2aWNlIGRldmljZTogbVBhbkRldmljZXMua2V5U2V0KCkpIHsKKyAgICAgICAgICAgIGlmIChnZXRQYW5EZXZpY2VTdGF0ZShkZXZpY2UpID09IEJsdWV0b290aFBhbi5TVEFURV9DT05ORUNURUQpIHsKKyAgICAgICAgICAgICAgICBkZXZpY2VzLmFkZChkZXZpY2UpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBkZXZpY2VzOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBkaXNjb25uZWN0UGFuRGV2aWNlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgQkxVRVRPT1RIX0FETUlOIHBlcm1pc3Npb24iKTsKKyAgICAgICAgU3RyaW5nIG9iamVjdFBhdGggPSBnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSk7CisgICAgICAgIGlmIChEQkcpIGxvZygiZGlzY29ubmVjdCBQQU4oIiArIG9iamVjdFBhdGggKyAiKSIpOworICAgICAgICBpZiAoZ2V0UGFuRGV2aWNlU3RhdGUoZGV2aWNlKSAhPSBCbHVldG9vdGhQYW4uU1RBVEVfQ09OTkVDVEVEKSB7CisgICAgICAgICAgICBsb2cgKGRldmljZSArICIgYWxyZWFkeSBkaXNjb25uZWN0ZWQgZnJvbSBQQU4iKTsKKyAgICAgICAgfQorICAgICAgICBoYW5kbGVQYW5EZXZpY2VTdGF0ZUNoYW5nZShkZXZpY2UsIEJsdWV0b290aFBhbi5TVEFURV9ESVNDT05ORUNUSU5HKTsKKyAgICAgICAgcmV0dXJuIGRpc2Nvbm5lY3RQYW5EZXZpY2VOYXRpdmUob2JqZWN0UGF0aCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3luY2hyb25pemVkIHZvaWQgaGFuZGxlUGFuRGV2aWNlU3RhdGVDaGFuZ2UoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgaWZhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXRlKSB7CisgICAgICAgIGludCBwcmV2U3RhdGU7CisgICAgICAgIFN0cmluZyBpZmFjZUFkZHIgPSBudWxsOworCisgICAgICAgIGlmIChtUGFuRGV2aWNlcy5nZXQoZGV2aWNlKSA9PSBudWxsKSB7CisgICAgICAgICAgICBwcmV2U3RhdGUgPSBCbHVldG9vdGhQYW4uU1RBVEVfRElTQ09OTkVDVEVEOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcHJldlN0YXRlID0gbVBhbkRldmljZXMuZ2V0KGRldmljZSkuZmlyc3Q7CisgICAgICAgICAgICBpZmFjZUFkZHIgPSBtUGFuRGV2aWNlcy5nZXQoZGV2aWNlKS5zZWNvbmQ7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHByZXZTdGF0ZSA9PSBzdGF0ZSkgcmV0dXJuOworCisgICAgICAgIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhQYW4uU1RBVEVfQ09OTkVDVEVEKSB7CisgICAgICAgICAgICBpZmFjZUFkZHIgPSBlbmFibGVUZXRoZXJpbmcoaWZhY2UpOworICAgICAgICAgICAgaWYgKGlmYWNlQWRkciA9PSBudWxsKSBMb2cuZShUQUcsICJFcnJvciBzZXRpbmcgdXAgdGV0aGVyIGludGVyZmFjZSIpOworICAgICAgICB9IGVsc2UgaWYgKHN0YXRlID09IEJsdWV0b290aFBhbi5TVEFURV9ESVNDT05ORUNURUQpIHsKKyAgICAgICAgICAgIGlmIChpZmFjZUFkZHIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1CbHVldG9vdGhJZmFjZUFkZHJlc3Nlcy5yZW1vdmUoaWZhY2VBZGRyKTsKKyAgICAgICAgICAgICAgICBpZmFjZUFkZHIgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAg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UpOworICAgIH0KKworICAgIHByaXZhdGUgU3RyaW5nIGNyZWF0ZU5ld1RldGhlcmluZ0FkZHJlc3NMb2NrZWQoKSB7CisgICAgICAgIGlmIChnZXRDb25uZWN0ZWRQYW5EZXZpY2VzKCkuc2l6ZSgpID09IG1NYXhQYW5EZXZpY2VzKSB7CisgICAgICAgICAgICBsb2coIk1heCBQQU4gZGV2aWNlIGNvbm5lY3Rpb25zIHJlYWNoZWQiKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIFN0cmluZyBhZGRyZXNzID0gQkxVRVRPT1RIX0lGQUNFX0FERFJfU1RBUlQ7CisgICAgICAgIHdoaWxlICh0cnVlKSB7CisgICAgICAgICAgICBpZiAobUJsdWV0b290aElmYWNlQWRkcmVzc2VzLmNvbnRhaW5zKGFkZHJlc3MpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nW10gYWRkciA9IGFkZHJlc3Muc3BsaXQoIlxcLiIpOworICAgICAgICAgICAgICAgIEludGVnZXIgbmV3SXAgPSBJbnRlZ2VyLnBhcnNlSW50KGFkZHJbMl0pICsgMTsKKyAgICAgICAgICAgICAgICBhZGRyZXNzID0gYWRkcmVzcy5yZXBsYWNlKGFkZHJbMl0sIG5ld0lwLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBtQmx1ZXRvb3RoSWZhY2VBZGRyZXNzZXMuYWRkKGFkZHJlc3MpOworICAgICAgICByZXR1cm4gYWRkcmVzczsKKyAgICB9CisKKyAgICAvLyBjb25maWd1cmVkIHdoZW4gd2Ugc3RhcnQgdGV0aGVyaW5nCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgU3RyaW5nIGVuYWJsZVRldGhlcmluZyhTdHJpbmcgaWZhY2UpIHsKKyAgICAgICAgbG9nKCJ1cGRhdGVUZXRoZXJTdGF0ZToiICsgaWZhY2UpOworCisgICAgICAgIElCaW5kZXIgYiA9IFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoQ29udGV4dC5ORVRXT1JLTUFOQUdFTUVOVF9TRVJWSUNFKTsKKyAgICAgICAgSU5ldHdvcmtNYW5hZ2VtZW50U2VydmljZSBzZXJ2aWNlID0gSU5ldHdvcmtNYW5hZ2VtZW50U2VydmljZS5TdHViLmFzSW50ZXJmYWNlKGIpOworICAgICAgICBDb25uZWN0aXZpdHlNYW5hZ2VyIGNtID0KKyAgICAgICAgICAgIChDb25uZWN0aXZpdHlNYW5hZ2VyKW1Db250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5DT05ORUNUSVZJVFlfU0VSVklDRSk7CisgICAgICAgIFN0cmluZ1tdIGJsdWV0b290aFJlZ2V4cyA9IGNtLmdldFRldGhlcmFibGVCbHVldG9vdGhSZWdleHMoKTsKKworICAgICAgICAvLyBicmluZyB0b2dnbGUgdGhlIGludGVyZmFjZXMKKyAgICAgICAgU3RyaW5nW10gY3VycmVudElmYWNlcyA9IG5ldyBTdHJpbmdbMF07CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBjdXJyZW50SWZhY2VzID0gc2VydmljZS5saXN0SW50ZXJmYWNlcygpOworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgbGlzdGluZyBJbnRlcmZhY2VzIDoiICsgZSk7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIGJvb2xlYW4gZm91bmQgPSBmYWxzZTsKKyAgICAgICAgZm9yIChTdHJpbmcgY3VycklmYWNlOiBjdXJyZW50SWZhY2VzKSB7CisgICAgICAgICAgICBpZiAoY3VycklmYWNlLmVxdWFscyhpZmFjZSkpIHsKKyAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoIWZvdW5kKSByZXR1cm4gbnVsbDsKKworICAgICAgICBTdHJpbmcgYWRkcmVzcyA9IGNyZWF0ZU5ld1RldGhlcmluZ0FkZHJlc3NMb2NrZWQoKTsKKyAgICAgICAgaWYgKGFkZHJlc3MgPT0gbnVsbCkgcmV0dXJuIG51bGw7CisKKyAgICAgICAgSW50ZXJmYWNlQ29uZmlndXJhdGlvbiBpZmNnID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmY2cgPSBzZXJ2aWNlLmdldEludGVyZmFjZUNvbmZpZyhpZmFjZSk7CisgICAgICAgICAgICBpZiAoaWZjZyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nW10gYWRkciA9IEJMVUVUT09USF9ORVRNQVNLLnNwbGl0KCJcXC4iKTsKKyAgICAgICAgICAgICAgICBpZmNnLm5ldG1hc2sgPSAoSW50ZWdlci5wYXJzZUludChhZGRyWzBdKSA8PCAyNCkgKworICAgICAgICAgICAgICAgICAgICAgICAgKEludGVnZXIucGFyc2VJbnQoYWRkclsxXSkgPDwgMTYpICsKKyAgICAgICAgICAgICAgICAgICAgICAgIChJbnRlZ2VyLnBhcnNlSW50KGFkZHJbMl0pIDw8IDgpICsKKyAgICAgICAgICAgICAgICAgICAgICAgIChJbnRlZ2VyLnBhcnNlSW50KGFkZHJbM10pKTsKKyAgICAgICAgICAgICAgICBpZiAoaWZjZy5pcEFkZHIgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICBhZGRyID0gYWRkcmVzcy5zcGxpdCgiXFwuIik7CisKKyAgICAgICAgICAgICAgICAgICAgaWZjZy5pcEFkZHIgPSAoSW50ZWdlci5wYXJzZUludChhZGRyWzBdKSA8PCAyNCkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIChJbnRlZ2VyLnBhcnNlSW50KGFkZHJbMV0pIDw8IDE2KSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEludGVnZXIucGFyc2VJbnQoYWRkclsyXSkgPDwgOCkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIChJbnRlZ2VyLnBhcnNlSW50KGFkZHJbM10pKTsKKyAgICAgICAgICAgICAgICAgICAgaWZjZy5pbnRlcmZhY2VGbGFncyA9CisgICAgICAgICAgICAgICAgICAgICAgICBpZmNnLmludGVyZmFjZUZsYWdzLnJlcGxhY2UoImRvd24iLCAidXAiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWZjZy5pbnRlcmZhY2VGbGFncyA9IGlmY2cuaW50ZXJmYWNlRmxhZ3MucmVwbGFjZSgicnVubmluZyIsICIiKTsKKyAgICAgICAgICAgICAgICBpZmNnLmludGVyZmFjZUZsYWdzID0gaWZjZy5pbnRlcmZhY2VGbGFncy5yZXBsYWNlKCIgICIsIiAiKTsKKyAgICAgICAgICAgICAgICBzZXJ2aWNlLnNldEludGVyZmFjZUNvbmZpZyhpZmFjZSwgaWZjZyk7CisgICAgICAgICAgICAgICAgaWYgKGNtLnRldGhlcihpZmFjZSkgIT0gQ29ubmVjdGl2aXR5TWFuYWdlci5URVRIRVJfRVJST1JfTk9fRVJST1IpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgdGV0aGVyaW5nICIraWZhY2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIGNvbmZpZ3VyaW5nIGludGVyZmFjZSAiICsgaWZhY2UgKyAiLCA6IiArIGUpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGFkZHJlc3M7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGNvbm5lY3RJbnB1dERldmljZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7CisKKyAgICAgICAgU3RyaW5nIG9iamVjdFBhdGggPSBnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSk7CisgICAgICAgIGlmIChvYmplY3RQYXRoID09IG51bGwgfHwKKyAgICAgICAgICAgIGdldElucHV0RGV2aWNlU3RhdGUoZGV2aWNlKSAhPSBCbHVldG9vdGhJbnB1dERldmljZS5TVEFURV9ESVNDT05ORUNURUQgfHwKKyAgICAgICAgICAgIGdldElucHV0RGV2aWNlUHJpb3JpdHkoZGV2aWNlKSA9PSBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9PRkYpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBCbHVldG9vdGhEZXZpY2VQcm9maWxlU3RhdGUgc3RhdGUgPSBtRGV2aWNlUHJvZmlsZVN0YXRlLmdldChkZXZpY2UuZ2V0QWRkcmVzcygpKTsKKyAgICAgICAgaWYgKHN0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gbmV3IE1lc3NhZ2UoKTsKKyAgICAgICAgICAgIG1zZy5hcmcxID0gQmx1ZXRvb3RoRGV2aWNlUHJvZmlsZVN0YXRlLkNPTk5FQ1RfSElEX09VVEdPSU5HOworICAgICAgICAgICAgbXNnLm9iaiA9IHN0YXRlOworICAgICAgICAgICAgbUhpZFByb2ZpbGVTdGF0ZS5zZW5kTWVzc2FnZShtc2cpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBjb25uZWN0SW5wdXREZXZpY2VJbnRlcm5hbChCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIFN0cmluZyBvYmplY3RQYXRoID0gZ2V0T2JqZWN0UGF0aEZyb21BZGRyZXNzKGRldmljZS5nZXRBZGRyZXNzKCkpOworICAgICAgICBoYW5kbGVJbnB1dERldmljZVN0YXRlQ2hhbmdlKGRldmljZSwgQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfQ09OTkVDVElORyk7CisgICAgICAgIGlmICghY29ubmVjdElucHV0RGV2aWNlTmF0aXZlKG9iamVjdFBhdGgpKSB7CisgICAgICAgICAgICBoYW5kbGVJbnB1dERldmljZVN0YXRlQ2hhbmdlKGRldmljZSwgQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfRElTQ09OTkVDVEVEKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gZGlzY29ubmVjdElucHV0RGV2aWNlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgQkxVRVRPT1RIX0FETUlOIHBlcm1pc3Npb24iKTsKKworICAgICAgICBTdHJpbmcgb2JqZWN0UGF0aCA9IGdldE9iamVjdFBhdGhGcm9tQWRkcmVzcyhkZXZpY2UuZ2V0QWRkcmVzcygpKTsKKyAgICAgICAgaWYgKG9iamVjdFBhdGggPT0gbnVsbCB8fCBnZXRDb25uZWN0ZWRJbnB1dERldmljZXMoKS5zaXplKCkgPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIEJsdWV0b290aERldmljZVByb2ZpbGVTdGF0ZSBzdGF0ZSA9IG1EZXZpY2VQcm9maWxlU3RhdGUuZ2V0KGRldmljZS5nZXRBZGRyZXNzKCkpOworICAgICAgICBpZiAoc3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBuZXcgTWVzc2FnZSgpOworICAgICAgICAgICAgbXNnLmFyZzEgPSBCbHVldG9vdGhEZXZpY2VQcm9maWxlU3RhdGUuRElTQ09OTkVDVF9ISURfT1VUR09JTkc7CisgICAgICAgICAgICBtc2cub2JqID0gc3RhdGU7CisgICAgICAgICAgICBtSGlkUHJvZmlsZVN0YXRlLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGRpc2Nvbm5lY3RJbnB1dERldmljZUludGVybmFsKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgU3RyaW5nIG9iamVjdFBhdGggPSBnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSk7CisgICAgICAgIGhhbmRsZUlucHV0RGV2aWNlU3RhdGVDaGFuZ2UoZGV2aWNlLCBCbHVldG9vdGhJbnB1dERldmljZS5TVEFURV9ESVNDT05ORUNUSU5HKTsKKyAgICAgICAgaWYgKCFkaXNjb25uZWN0SW5wdXREZXZpY2VOYXRpdmUob2JqZWN0UGF0aCkpIHsKKyAgICAgICAgICAgIGhhbmRsZUlucHV0RGV2aWNlU3RhdGVDaGFuZ2UoZGV2aWNlLCBCbHVldG9vdGhJbnB1dERldmljZS5TVEFURV9DT05ORUNURUQpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldElucHV0RGV2aWNlU3RhdGUoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CisKKyAgICAgICAgaWYgKG1JbnB1dERldmljZXMuZ2V0KGRldmljZSkgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0RJU0NPTk5FQ1RFRDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUlucHV0RGV2aWNlcy5nZXQoZGV2aWNlKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIExpc3Q8Qmx1ZXRvb3RoRGV2aWNlPiBnZXRDb25uZWN0ZWRJbnB1dERldmljZXMoKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfUEVSTSwgIk5lZWQgQkxVRVRPT1RIIHBlcm1pc3Npb24iKTsKKyAgICAgICAgTGlzdDxCbHVldG9vdGhEZXZpY2U+IGRldmljZXMgPSBsb29rdXBJbnB1dERldmljZXNNYXRjaGluZ1N0YXRlcygKKyAgICAgICAgICAgIG5ldyBpbnRbXSB7Qmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfQ09OTkVDVEVEfSk7CisgICAgICAgIHJldHVybiBkZXZpY2VzOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldElucHV0RGV2aWNlUHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CisgICAgICAgIHJldHVybiBTZXR0aW5ncy5TZWN1cmUuZ2V0SW50KG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAorICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5nZXRCbHVldG9vdGhJbnB1dERldmljZVByaW9yaXR5S2V5KGRldmljZS5nZXRBZGRyZXNzKCkpLAorICAgICAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlLlBSSU9SSVRZX1VOREVGSU5FRCk7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIHNldElucHV0RGV2aWNlUHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwgaW50IHByaW9yaXR5KSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7CisgICAgICAgIGlmICghQmx1ZXRvb3RoQWRhcHRlci5jaGVja0JsdWV0b290aEFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSkpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gU2V0dGluZ3MuU2VjdXJlLnB1dEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKKyAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuZ2V0Qmx1ZXRvb3RoSW5wdXREZXZpY2VQcmlvcml0eUtleShkZXZpY2UuZ2V0QWRkcmVzcygpKSwKKyAgICAgICAgICAgICAgICBwcmlvcml0eSk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi9zeW5jaHJvbml6ZWQgTGlzdDxCbHVldG9vdGhEZXZpY2U+IGxvb2t1cElucHV0RGV2aWNlc01hdGNoaW5nU3RhdGVzKGludFtdIHN0YXRlcykgeworICAgICAgICBMaXN0PEJsdWV0b290aERldmljZT4gaW5wdXREZXZpY2VzID0gbmV3IEFycmF5TGlzdDxCbHVldG9vdGhEZXZpY2U+KCk7CisKKyAgICAgICAgZm9yIChCbHVldG9vdGhEZXZpY2UgZGV2aWNlOiBtSW5wdXREZXZpY2VzLmtleVNldCgpKSB7CisgICAgICAgICAgICBpbnQgaW5wdXREZXZpY2VTdGF0ZSA9IGdldElucHV0RGV2aWNlU3RhdGUoZGV2aWNlKTsKKyAgICAgICAgICAgIGZvciAoaW50IHN0YXRlIDogc3RhdGVzKSB7CisgICAgICAgICAgICAgICAgaWYgKHN0YXRlID09IGlucHV0RGV2aWNlU3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgaW5wdXREZXZpY2VzLmFkZChkZXZpY2UpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGlucHV0RGV2aWNlczsKKyAgICB9CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIGhhbmRsZUlucHV0RGV2aWNlU3RhdGVDaGFuZ2UoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwgaW50IHN0YXRlKSB7CisgICAgICAgIGludCBwcmV2U3RhdGU7CisgICAgICAgIGlmIChtSW5wdXREZXZpY2VzLmdldChkZXZpY2UpID09IG51bGwpIHsKKyAgICAgICAgICAgIHByZXZTdGF0ZSA9IEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0RJU0NPTk5FQ1RFRDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHByZXZTdGF0ZSA9IG1JbnB1dERldmljZXMuZ2V0KGRldmljZSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHByZXZTdGF0ZSA9PSBzdGF0ZSkgcmV0dXJuOworCisgICAgICAgIG1JbnB1dERldmljZXMucHV0KGRldmljZSwgc3RhdGUpOworCisgICAgICAgIGlmIChnZXRJbnB1dERldmljZVByaW9yaXR5KGRldmljZSkgPgorICAgICAgICAgICAgICBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9PRkYgJiYKKyAgICAgICAgICAgIHN0YXRlID09IEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0NPTk5FQ1RJTkcgfHwKKyAgICAgICAgICAgIHN0YXRlID09IEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgLy8gV2UgaGF2ZSBjb25uZWN0ZWQgb3IgYXR0ZW1wdGluZyB0byBjb25uZWN0LgorICAgICAgICAgICAgLy8gQnVtcCBwcmlvcml0eQorICAgICAgICAgICAgc2V0SW5wdXREZXZpY2VQcmlvcml0eShkZXZpY2UsIEJsdWV0b290aElucHV0RGV2aWNlLlBSSU9SSVRZX0FVVE9fQ09OTkVDVCk7CisgICAgICAgIH0KKworICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhJbnB1dERldmljZS5BQ1RJT05fSU5QVVRfREVWSUNFX1NUQVRFX0NIQU5HRUQpOworICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoRGV2aWNlLkVYVFJBX0RFVklDRSwgZGV2aWNlKTsKKyAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aElucHV0RGV2aWNlLkVYVFJBX1BSRVZJT1VTX0lOUFVUX0RFVklDRV9TVEFURSwgcHJldlN0YXRlKTsKKyAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aElucHV0RGV2aWNlLkVYVFJBX0lOUFVUX0RFVklDRV9TVEFURSwgc3RhdGUpOworICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCwgQkxVRVRPT1RIX1BFUk0pOworCisgICAgICAgIGlmIChEQkcpIGxvZygiSW5wdXREZXZpY2Ugc3RhdGUgOiBkZXZpY2U6ICIgKyBkZXZpY2UgKyAiIFN0YXRlOiIgKyBwcmV2U3RhdGUgKyAiLT4iICsgc3RhdGUpOworICAgICAgICBzZW5kQ29ubmVjdGlvblN0YXRlQ2hhbmdlKGRldmljZSwgc3RhdGUsIHByZXZTdGF0ZSk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gdm9pZCBoYW5kbGVJbnB1dERldmljZVByb3BlcnR5Q2hhbmdlKFN0cmluZyBhZGRyZXNzLCBib29sZWFuIGNvbm5lY3RlZCkgeworICAgICAgICBpbnQgc3RhdGUgPSBjb25uZWN0ZWQgPyBCbHVldG9vdGhJbnB1dERldmljZS5TVEFURV9DT05ORUNURUQgOgorICAgICAgICAgICAgQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfRElTQ09OTkVDVEVEOworICAgICAgICBCbHVldG9vdGhEZXZpY2UgZGV2aWNlID0gbUFkYXB0ZXIuZ2V0UmVtb3RlRGV2aWNlKGFkZHJlc3MpOworICAgICAgICBoYW5kbGVJbnB1dERldmljZVN0YXRlQ2hhbmdlKGRldmljZSwgc3RhdGUpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzZXRJbml0aWFsSW5wdXREZXZpY2VQcmlvcml0eShCbHVldG9vdGhEZXZpY2UgZGV2aWNlLCBpbnQgc3RhdGUpIHsKKyAgICAgICAgc3dpdGNoIChzdGF0ZSkgeworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ERUQ6CisgICAgICAgICAgICAgICAgaWYgKGdldElucHV0RGV2aWNlUHJpb3JpdHkoZGV2aWNlKSA9PSBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9VTkRFRklORUQpIHsKKyAgICAgICAgICAgICAgICAgICAgc2V0SW5wdXREZXZpY2VQcmlvcml0eShkZXZpY2UsIEJsdWV0b290aElucHV0RGV2aWNlLlBSSU9SSVRZX09OKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX05PTkU6CisgICAgICAgICAgICAgICAgc2V0SW5wdXREZXZpY2VQcmlvcml0eShkZXZpY2UsIEJsdWV0b290aElucHV0RGV2aWNlLlBSSU9SSVRZX1VOREVGSU5FRCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKICAgICAvKnBhY2thZ2UqLyBib29sZWFuIGlzUmVtb3RlRGV2aWNlSW5DYWNoZShTdHJpbmcgYWRkcmVzcykgewogICAgICAgICByZXR1cm4gKG1EZXZpY2VQcm9wZXJ0aWVzLmdldChhZGRyZXNzKSAhPSBudWxsKTsKICAgICB9CkBAIC0xMzg0LDcgKzE4NTYsNyBAQAogICAgICAgICAgICAgaWYgKHVwZGF0ZVJlbW90ZURldmljZVByb3BlcnRpZXNDYWNoZShhZGRyZXNzKSkKICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0UmVtb3RlRGV2aWNlUHJvcGVydHkoYWRkcmVzcywgcHJvcGVydHkpOwogICAgICAgICB9Ci0gICAgICAgIExvZy5lKFRBRywgImdldFJlbW90ZURldmljZVByb3BlcnR5OiAiICsgcHJvcGVydHkgKyAibm90IHByZXNlbnQ6IiArIGFkZHJlc3MpOworICAgICAgICBMb2cuZShUQUcsICJnZXRSZW1vdGVEZXZpY2VQcm9wZXJ0eTogIiArIHByb3BlcnR5ICsgIiBub3QgcHJlc2VudDogIiArIGFkZHJlc3MpOwogICAgICAgICByZXR1cm4gbnVsbDsKICAgICB9CiAKQEAgLTE5ODksNyArMjQ2MSw4IEBACiAgICAgICAgIHB3LnByaW50bG4oIkxvY2FsIG5hbWUgPSAiICsgZ2V0TmFtZSgpKTsKICAgICAgICAgcHcucHJpbnRsbigiaXNEaXNjb3ZlcmluZygpID0gIiArIGlzRGlzY292ZXJpbmcoKSk7CiAKLSAgICAgICAgQmx1ZXRvb3RoSGVhZHNldCBoZWFkc2V0ID0gbmV3IEJsdWV0b290aEhlYWRzZXQobUNvbnRleHQsIG51bGwpOworICAgICAgICBtQWRhcHRlci5nZXRQcm9maWxlUHJveHkobUNvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoUHJvZmlsZVNlcnZpY2VMaXN0ZW5lciwgQmx1ZXRvb3RoUHJvZmlsZS5IRUFEU0VUKTsKIAogICAgICAgICBwdy5wcmludGxuKCJcbi0tS25vd24gZGV2aWNlcy0tIik7CiAgICAgICAgIGZvciAoU3RyaW5nIGFkZHJlc3MgOiBtRGV2aWNlUHJvcGVydGllcy5rZXlTZXQoKSkgewpAQCAtMjAzNCwyNCArMjUwNyw0OCBAQAogICAgICAgICAvLyBSYXRoZXIgbm90IGRvIHRoaXMgZnJvbSBoZXJlLCBidXQgbm8td2hlcmUgZWxzZSBhbmQgSSBuZWVkIHRoaXMKICAgICAgICAgLy8gZHVtcAogICAgICAgICBwdy5wcmludGxuKCJcbi0tSGVhZHNldCBTZXJ2aWNlLS0iKTsKLSAgICAgICAgc3dpdGNoIChoZWFkc2V0LmdldFN0YXRlKGhlYWRzZXQuZ2V0Q3VycmVudEhlYWRzZXQoKSkpIHsKLSAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0RJU0NPTk5FQ1RFRDoKLSAgICAgICAgICAgIHB3LnByaW50bG4oImdldFN0YXRlKCkgPSBTVEFURV9ESVNDT05ORUNURUQiKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQ09OTkVDVElORzoKLSAgICAgICAgICAgIHB3LnByaW50bG4oImdldFN0YXRlKCkgPSBTVEFURV9DT05ORUNUSU5HIik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RFRDoKLSAgICAgICAgICAgIHB3LnByaW50bG4oImdldFN0YXRlKCkgPSBTVEFURV9DT05ORUNURUQiKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRVJST1I6Ci0gICAgICAgICAgICBwdy5wcmludGxuKCJnZXRTdGF0ZSgpID0gU1RBVEVfRVJST1IiKTsKLSAgICAgICAgICAgIGJyZWFrOworICAgICAgICBpZiAobUJsdWV0b290aEhlYWRzZXQgIT0gbnVsbCkgeworICAgICAgICAgICBMaXN0PEJsdWV0b290aERldmljZT4gZGV2aWNlTGlzdCA9IG1CbHVldG9vdGhIZWFkc2V0LmdldENvbm5lY3RlZERldmljZXMoKTsKKyAgICAgICAgICAgaWYgKGRldmljZUxpc3Quc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgcHcucHJpbnRsbigiXG4tLU5vIGhlYWRzZXRzIGNvbm5lY3RlZC0tIik7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA9IGRldmljZUxpc3QuZ2V0KDApOworCisgICAgICAgICAgICBzd2l0Y2ggKG1CbHVldG9vdGhIZWFkc2V0LmdldENvbm5lY3Rpb25TdGF0ZShkZXZpY2UpKSB7CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0RJU0NPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiZ2V0Q29ubmVjdGlvblN0YXRlKCkgPSBTVEFURV9ESVNDT05ORUNURUQiKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RJTkc6CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4oImdldENvbm5lY3Rpb25TdGF0ZSgpID0gU1RBVEVfQ09OTkVDVElORyIpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQ09OTkVDVEVEOgorICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKCJnZXRDb25uZWN0aW9uU3RhdGUoKSA9IFNUQVRFX0NPTk5FQ1RFRCIpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRElTQ09OTkVDVElORzoKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiZ2V0Q29ubmVjdGlvblN0YXRlKCkgPSBTVEFURV9ESVNDT05ORUNUSU5HIik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9BVURJT19DT05ORUNURUQ6CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4oImdldENvbm5lY3Rpb25TdGF0ZSgpID0gU1RBVEVfQVVESU9fQ09OTkVDVEVEIik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBkZXZpY2VMaXN0LmNsZWFyKCk7CisgICAgICAgICAgICBkZXZpY2VMaXN0ID0gbUJsdWV0b290aEhlYWRzZXQuZ2V0RGV2aWNlc01hdGNoaW5nQ29ubmVjdGlvblN0YXRlcyhuZXcgaW50W10geworICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9DT05ORUNURUQsIEJsdWV0b290aFByb2ZpbGUuU1RBVEVfRElTQ09OTkVDVEVEfSk7CisgICAgICAgICAgICBwdy5wcmludGxuKCJcbi0tQ29ubmVjdGVkIGFuZCBEaXNjb25uZWN0ZWQgSGVhZHNldHMiKTsKKyAgICAgICAgICAgIGZvciAoQmx1ZXRvb3RoRGV2aWNlIGRldjogZGV2aWNlTGlzdCkgeworICAgICAgICAgICAgICAgIHB3LnByaW50bG4oZGV2aWNlKTsKKyAgICAgICAgICAgICAgICBpZiAobUJsdWV0b290aEhlYWRzZXQuaXNBdWRpb0Nvbm5lY3RlZChkZXZpY2UpKSB7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIlNDTyBhdWRpbyBjb25uZWN0ZWQgdG8gZGV2aWNlOiIgKyBkZXZpY2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcHcucHJpbnRsbigiXG5nZXRDdXJyZW50SGVhZHNldCgpID0gIiArIGRldmljZSk7CisgICAgICAgICAgICBwdy5wcmludGxuKCJnZXRCYXR0ZXJ5VXNhZ2VIaW50KCkgPSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgbUJsdWV0b290aEhlYWRzZXQuZ2V0QmF0dGVyeVVzYWdlSGludChkZXZpY2UpKTsKKyAgICAgICAgICAgIG1BZGFwdGVyLmNsb3NlUHJvZmlsZVByb3h5KEJsdWV0b290aFByb2ZpbGUuSEVBRFNFVCwgbUJsdWV0b290aEhlYWRzZXQpOwogICAgICAgICB9CiAKLSAgICAgICAgcHcucHJpbnRsbigiXG5nZXRDdXJyZW50SGVhZHNldCgpID0gIiArIGhlYWRzZXQuZ2V0Q3VycmVudEhlYWRzZXQoKSk7Ci0gICAgICAgIHB3LnByaW50bG4oImdldEJhdHRlcnlVc2FnZUhpbnQoKSA9ICIgKyBoZWFkc2V0LmdldEJhdHRlcnlVc2FnZUhpbnQoKSk7Ci0gICAgICAgIGhlYWRzZXQuY2xvc2UoKTsKICAgICAgICAgcHcucHJpbnRsbigiXG4tLUFwcGxpY2F0aW9uIFNlcnZpY2UgUmVjb3Jkcy0tIik7CiAgICAgICAgIGZvciAoSW50ZWdlciBoYW5kbGUgOiBtU2Vydm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AgICAgICAgIHJldHVybiBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX0NPTk5FQ1RFRDsKKyAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9ESVNDT05ORUNUSU5HOgorICAgICAgICAgICAgICByZXR1cm4gQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9ESVNDT05ORUNUSU5HOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0RJU0NPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfRElTQ09OTkVDVEVEOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgaW4gZ2V0QWRhcHRlckNvbm5lY3Rpb25TdGF0ZSIpOworICAgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gdXBkYXRlQ291bnRlcnNBbmRDaGVja0ZvckNvbm5lY3Rpb25TdGF0ZUNoYW5nZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcHJldlN0YXRlKSB7CisgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKKyAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9DT05ORUNUSU5HOgorICAgICAgICAgICAgICAgIG1Qcm9maWxlc0Nvbm5lY3RpbmcrKzsKKyAgICAgICAgICAgICAgICBpZiAocHJldlN0YXRlID09IEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfRElTQ09OTkVDVElORykgbVByb2ZpbGVzRGlzY29ubmVjdGluZy0tOworICAgICAgICAgICAgICAgIGlmIChtUHJvZmlsZXNDb25uZWN0ZWQgPiAwIHx8IG1Qcm9maWxlc0Nvbm5lY3RpbmcgPiAxKSByZXR1cm4gZmFsc2U7CisKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9DT05ORUNURUQ6CisgICAgICAgICAgICAgICAgaWYgKHByZXZTdGF0ZSA9PSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX0NPTk5FQ1RJTkcpIG1Qcm9maWxlc0Nvbm5lY3RpbmctLTsKKyAgICAgICAgICAgICAgICBpZiAocHJldlN0YXRlID09IEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfRElTQ09OTkVDVElORykgbVByb2ZpbGVzRGlzY29ubmVjdGluZy0tOworCisgICAgICAgICAgICAgICAgbVByb2ZpbGVzQ29ubmVjdGVkKys7CisKKyAgICAgICAgICAgICAgICBpZiAobVByb2ZpbGVzQ29ubmVjdGVkID4gMSkgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0RJU0NPTk5FQ1RJTkc6CisgICAgICAgICAgICAgICAgbVByb2ZpbGVzRGlzY29ubmVjdGluZysrOworICAgICAgICAgICAgICAgIG1Qcm9maWxlc0Nvbm5lY3RlZC0tOworCisgICAgICAgICAgICAgICAgaWYgKG1Qcm9maWxlc0Nvbm5lY3RlZCA+IDAgfHwgbVByb2ZpbGVzRGlzY29ubmVjdGluZyA+IDEpIHJldHVybiBmYWxzZTsKKworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0RJU0NPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgICBpZiAocHJldlN0YXRlID09IEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfQ09OTkVDVElORykgbVByb2ZpbGVzQ29ubmVjdGluZy0tOworICAgICAgICAgICAgICAgIGlmIChwcmV2U3RhdGUgPT0gQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9ESVNDT05ORUNUSU5HKSBtUHJvZmlsZXNEaXNjb25uZWN0aW5nLS07CisKKyAgICAgICAgICAgICAgICBpZiAocHJldlN0YXRlID09IEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfQ09OTkVDVEVEKSB7CisgICAgICAgICAgICAgICAgICAgIG1Qcm9maWxlc0Nvbm5lY3RlZC0tOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChtUHJvZmlsZXNDb25uZWN0ZWQgID4gMCB8fCBtUHJvZmlsZXNDb25uZWN0aW5nID4gMCkgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKwogICAgIHByaXZhdGUgc3RhdGljIHZvaWQgbG9nKFN0cmluZyBtc2cpIHsKICAgICAgICAgTG9nLmQoVEFHLCBtc2cpOwogICAgIH0KQEAgLTIyODcsNCArMjg3OCwxMCBAQAogICAgICAgICAgICAgc2hvcnQgY2hhbm5lbCk7CiAgICAgcHJpdmF0ZSBuYXRpdmUgYm9vbGVhbiByZW1vdmVTZXJ2aWNlUmVjb3JkTmF0aXZlKGludCBoYW5kbGUpOwogICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gc2V0TGlua1RpbWVvdXROYXRpdmUoU3RyaW5nIHBhdGgsIGludCBudW1fc2xvdHMpOworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gY29ubmVjdElucHV0RGV2aWNlTmF0aXZlKFN0cmluZyBwYXRoKTsKKyAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIGRpc2Nvbm5lY3RJbnB1dERldmljZU5hdGl2ZShTdHJpbmcgcGF0aCk7CisKKyAgICBwcml2YXRlIG5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ICAgICAgKiBtZXRob2QgZm9yIGVhY2ggdXJsLiAgQSBudWxsIHJlc3VsdCBtZWFucyB0aGF0IHRoZXJlIHdhcyBhIHNlcnZlcgotICAgICAgICAgKiBlcnJvciBvciBhIHByb2JsZW0gcmVuZGVyaW5nIHRoZSB1cmwuCi0gICAgICAgICAqIEBwYXJhbSB1cmwgIFRoZSB1cmwgdGhhdCBoYXMgYmVlbiByZW5kZXJlZC4KLSAgICAgICAgICogQHBhcmFtIHJlc3VsdCAgQSBQYXJjZWxGaWxlRGVzY3JpcHRvciBjb250YWluaW5nIHRoZSBlbmNvZGVkIGltYWdlCi0gICAgICAgICAqICAgICAgICAgICAgICAgIGRhdGEuIFRoZSBjbGllbnQgaXMgcmVzcG9uc2libGUgZm9yIGNsb3NpbmcgdGhlIHN0cmVhbQotICAgICAgICAgKiAgICAgICAgICAgICAgICB0byBmcmVlIHJlc291cmNlcy4gIEEgbnVsbCByZXN1bHQgaW5kaWNhdGVzIGEgZmFpbHVyZQotICAgICAgICAgKiAgICAgICAgICAgICAgICB0byByZW5kZXIuCi0gICAgICAgICAqLwotICAgICAgICBwdWJsaWMgdm9pZCBjb21wbGV0ZShTdHJpbmcgdXJsLCBQYXJjZWxGaWxlRGVzY3JpcHRvciByZXN1bHQpOwotICAgIH0KLQotICAgIHByaXZhdGUgSVVybFJlbmRlcmVyU2VydmljZSBtU2VydmljZTsKLQotICAgIC8qKgotICAgICAqIENyZWF0ZSBhIG5ldyBVcmxSZW5kZXJlciB0byByZW1vdGVseSByZW5kZXIgdXJscy4KLSAgICAgKiBAcGFyYW0gc2VydmljZSAgQW4gSUJpbmRlciBzZXJ2aWNlIHVzdWFsbHkgb2J0YWluZWQgdGhyb3VnaAotICAgICAqICAgICAgICAgICAgICAgICB7QGxpbmsgU2VydmljZUNvbm5lY3Rpb24jb25TZXJ2aWNlQ29ubmVjdGVkfQotICAgICAqLwotICAgIHB1YmxpYyBVcmxSZW5kZXJlcihJQmluZGVyIHNlcnZpY2UpI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aW5kZXJJbnRlcmZhY2UgPQotICAgICAgICAgICAgbmV3IElVcmxSZW5kZXJlclNlcnZpY2UuU3R1YigpIHsKLSAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCByZW5kZXIoTGlzdDxTdHJpbmc+IHVybHMsIGludCB3aWR0aCwgaW50IGhlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIElVcmxSZW5kZXJlckNhbGxiYWNrIGNiKSB7Ci0gICAgICAgICAgICAgICAgICAgIHByb2Nlc3NSZXF1ZXN0KHVybHMsIHdpZHRoLCBoZWlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEludGVybmFsQ2FsbGJhY2soY2IpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9OwotCi0gICAgLyoqCi0gICAgICogSW1wbGVtZW50IHRvIHJldHVybiB0aGUgaW1wbGVtZW50YXRpb24gb2YgdGhlIGludGVybmFsIGFjY2Vzc2liaWxpdHkKLSAgICAgKiBzZXJ2aWNlIGludGVyZmFjZS4gIFN1YmNsYXNzZXMgc2hvdWxkIG5vdCBvdmVycmlkZS4KLSAgICAgKi8KLSAgICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgZmluYWwgYW5kcm9pZC5vcy5JQmluZGVyIG9uQmluZChhbmRyb2lkLmNvbnRlbnQuSW50ZW50IGludGVudCkgewotICAgICAgICByZXR1cm4gbUJpbmRlckludGVyZmFjZTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBXaGVuIGFsbCBjbGllbnRzIHVuYmluZCBmcm9tIHRoZSBzZXJ2aWNlLCBzdG9wIHRoZSBzZXJ2aWNlLiAgU3ViY2xhc3NlcwotICAgICAqIHNob3VsZCBub3Qgb3ZlcnJpZGUuCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGZpbmFsIGJvb2xlYW4gb25VbmJpbmQoYW5kcm9pZC5jb250ZW50LkludGVudCBpbnRlbnQpIHsKLSAgICAg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ogICAgICAgICB9CiAKICAgICAgICAgaWYgKG1ldGhvZC5pc0Fubm90YXRpb25QcmVzZW50KFVpVGhyZWFkVGVzdC5jbGFzcykpIHsKICAgICAgICAgICAgIGZpbmFsIGludCB0b2xlcmFuY2UgPSBydW5Db3VudDsKKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVwZXRpdGl2ZSA9IGlzUmVwZXRpdGl2ZTsKICAgICAgICAgICAgIGZpbmFsIE1ldGhvZCB0ZXN0TWV0aG9kID0gbWV0aG9kOwogICAgICAgICAgICAgZmluYWwgVGhyb3dhYmxlW10gZXhjZXB0aW9ucyA9IG5ldyBUaHJvd2FibGVbMV07CiAgICAgICAgICAgICBnZXRJbnN0cnVtZW50YXRpb24oKS5ydW5Pbk1haW5TeW5jKG5ldyBSdW5uYWJsZSgpIHsKICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBydW5NZXRob2QodGVzdE1ldGhvZCwgdG9sZXJhbmNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJ1bk1ldGhvZCh0ZXN0TWV0aG9kLCB0b2xlcmFuY2UsIHJlcGV0aXRpdmUpOwogICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgdGhyb3dhYmxlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBleGNlcHRpb25zWzBdID0gdGhyb3dhYmxlOwogICAgICAgICAgICAgICAgICAgICB9CkBAIC0xOTEsMTEgKzE5NiwxNiBAQAogICAgICAgICAgICAgICAgIHRocm93IGV4Y2VwdGlvbnNbMF07CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBydW5NZXRob2QobWV0aG9kLCBydW5Db3VudCk7CisgICAgICAgICAgICBydW5NZXRob2QobWV0aG9kLCBydW5Db3VudCwgaXNSZXBldGl0aXZlKTsKICAgICAgICAgfQogICAgIH0KIAorICAgIC8vIEZvciBiYWNrd2FyZHMtY29tcGF0aWJpbGl0eSBhZnRlciBhZGRpbmcgaXNSZXBldGl0aXZlCiAgICAgcHJpdmF0ZSB2b2lkIHJ1bk1ldGhvZChNZXRob2QgcnVuTWV0aG9kLCBpbnQgdG9sZXJhbmNlKSB0aHJvd3MgVGhyb3dhYmxlIHsKKyAgICAgICAgcnVuTWV0aG9kKHJ1bk1ldGhvZCwgdG9sZXJhbmNlLCBmYWxzZSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJ1bk1ldGhvZChNZXRob2QgcnVuTWV0aG9kLCBpbnQgdG9sZXJhbmNlLCBib29sZWFuIGlzUmVwZXRpdGl2ZSkgdGhyb3dzIFRocm93YWJsZSB7CiAgICAgICAgIFRocm93YWJsZSBleGNlcHRpb24gPSBudWxsOwogCiAgICAgICAgIGludCBydW5Db3VudCA9IDA7CkBAIC0yMTEsOCArMjIxLDE0IEBACiAgICAgICAgICAgICAgICAgZXhjZXB0aW9uID0gZTsKICAgICAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICAgICAgcnVuQ291bnQrKzsKKyAgICAgICAgICAgICAgICAvLyBSZXBvcnQgY3VycmVudCBpdGVyYXRpb24gbnVtYmVyLCBpZiB0ZXN0IGlzIHJlcGV0aXRpdmUKKyAgICAgICAgICAgICAgICBpZiAoaXNSZXBldGl0aXZlKSB7CisgICAgICAgICAgICAgICAgICAgIEJ1bmRsZSBpdGVyYXRpb25zID0gbmV3IEJ1bmRsZSgpOworICAgICAgICAgICAgICAgICAgICBpdGVyYXRpb25zLnB1dEludCgiY3VycmVudGl0ZXJhdGlvbnMiLCBydW5Db3VudCk7CisgICAgICAgICAgICAgICAgICAgIGdldEluc3RydW1lbnRhdGlvbigpLnNlbmRTdGF0dXMoMiwgaXRlcmF0aW9ucyk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICB9IHdoaWxlICgocnVuQ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DwgZTsgKytpKSB7CisgICAgICAgICAgICBpbnQgbGV2ZWwgPSBsZXZlbHNbaV07CisgICAgICAgICAgICBpZiAobGV2ZWwgIT0gY3VyTGV2ZWwpIHsKKyAgICAgICAgICAgICAgICBjdXJMZXZlbCA9IGxldmVsOworICAgICAgICAgICAgICAgICsrcnVuQ291bnQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBhZGQgZmluYWwgcnVuIGZvciB0cmFpbGluZyBjb3VudGVyLWRpcmVjdGlvbmFsIHdoaXRlc3BhY2UKKyAgICAgICAgaW50IHZpc0xlbiA9IGxlbjsKKyAgICAgICAgaWYgKChjdXJMZXZlbCAmIDEpICE9IChiYXNlTGV2ZWwgJiAxKSkgeworICAgICAgICAgICAgLy8gbG9vayBmb3IgdmlzaWJsZSBlbmQKKyAgICAgICAgICAgIHdoaWxlICgtLXZpc0xlbiA+PSAwKSB7CisgICAgICAgICAgICAgICAgY2hhciBjaCA9IGNoYXJzW2NzdGFydCArIHZpc0xlbl07CisKKyAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJ1xuJykgeworICAgICAgICAgICAgICAgICAgICAtLXZpc0xlbjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGNoICE9ICcgJyAmJiBjaCAhPSAnXHQnKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICsrdmlzTGVuOworICAgICAgICAgICAgaWYgKHZpc0xlbiAhPSBsZW4pIHsKKyAgICAgICAgICAgICAgICArK3J1bkNvdW50OworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHJ1bkNvdW50ID09IDEgJiYgbWluTGV2ZWwgPT0gYmFzZUxldmVsKSB7CisgICAgICAgICAgICAvLyB3ZSdyZSBkb25lLCBvbmx5IG9uZSBydW4gb24gdGhpcyBsaW5lCisgICAgICAgICAgICBpZiAoKG1pbkxldmVsICYgMSkgIT0gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBMYXlvdXQuRElSU19BTExfUklHSFRfVE9fTEVGVDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBMYXlvdXQuRElSU19BTExfTEVGVF9UT19SSUdIVDsKKyAgICAgICAgfQorCisgICAgICAgIGludFtdIGxkID0gbmV3IGludFtydW5Db3VudCAqIDJdOworICAgICAgICBpbnQgbWF4TGV2ZWwgPSBtaW5MZXZlbDsKKyAgICAgICAgaW50IGxldmVsQml0cyA9IG1pbkxldmVsIDw8IExheW91dC5SVU5fTEVWRUxfU0hJRlQ7CisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIFN0YXJ0IG9mIGZpcnN0IHBhaXIgaXMgYWx3YXlzIDAsIHdlIHdyaXRlCisgICAgICAgICAgICAvLyBsZW5ndGggdGhlbiBzdGFydCBhdCBlYWNoIG5ldyBydW4sIGFuZCB0aGUKKyAgICAgICAgICAgIC8vIGxhc3QgcnVuIGxlbmd0aCBhZnRlciB3ZSdyZSBkb25lLgorICAgICAgICAgICAgaW50IG4gPSAxOworICAgICAgICAgICAgaW50IHByZXYgPSBsc3RhcnQ7CisgICAgICAgICAgICBjdXJMZXZlbCA9IG1pbkxldmVsOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGxzdGFydCwgZSA9IGxzdGFydCArIHZpc0xlbjsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgICAgIGludCBsZXZlbCA9IGxldmVsc1tpXTsKKyAgICAgICAgICAgICAgICBpZiAobGV2ZWwgIT0gY3VyTGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgY3VyTGV2ZWwgPSBsZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxldmVsID4gbWF4TGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1heExldmVsID0gbGV2ZWw7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGV2ZWwgPCBtaW5MZXZlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbWluTGV2ZWwgPSBsZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBYWFggaWdub3JlIHJ1biBsZW5ndGggbGltaXQgb2YgMl5SVU5fTEVWRUxfU0hJRlQKKyAgICAgICAgICAgICAgICAgICAgbGRbbisrXSA9IChpIC0gcHJldikgfCBsZXZlbEJpdHM7CisgICAgICAgICAgICAgICAgICAgIGxkW24rK10gPSBpIC0gbHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBsZXZlbEJpdHMgPSBjdXJMZXZlbCA8PCBMYXlvdXQuUlVOX0xFVkVMX1NISUZUOworICAgICAgICAgICAgICAgICAgICBwcmV2ID0gaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBsZFtuXSA9IChsc3RhcnQgKyB2aXNMZW4gLSBwcmV2KSB8IGxldmVsQml0czsKKyAgICAgICAgICAgIGlmICh2aXNMZW4gPCBsZW4pIHsKKyAgICAgICAgICAgICAgICBsZFsrK25dID0gdmlzTGVuOworICAgICAgICAgICAgICAgIGxkWysrbl0gPSAobGVuIC0gdmlzTGVuKSB8IChiYXNlTGV2ZWwgPDwgTGF5b3V0LlJVTl9MRVZFTF9TSElGVCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBTZWUgaWYgd2UgbmVlZCB0byBzd2FwIGFueSBydW5zLgorICAgICAgICAvLyBJZiB0aGUgbWluIGxldmVsIHJ1biBkaXJlY3Rpb24gZG9lc24ndCBtYXRjaCB0aGUgYmFzZQorICAgICAgICAvLyBkaXJlY3Rpb24sIHdlIGFsd2F5cyBuZWVkIHRvIHN3YXAgKGF0IHRoaXMgcG9pbnQKKyAgICAgICAgLy8gd2UgaGF2ZSBtb3JlIHRoYW4gb25lIHJ1bikuCisgICAgICAgIC8vIE90aGVyd2lzZSwgd2UgZG9uJ3QgbmVlZCB0byBzd2FwIHRoZSBsb3dlc3QgbGV2ZWwuCisgICAgICAgIC8vIFNpbmNlIHRoZXJlIGFyZSBubyBsb2dpY2FsbHkgYWRqYWNlbnQgcnVucyBhdCB0aGUgc2FtZQorICAgICAgICAvLyBsZXZlbCwgaWYgdGhlIG1heCBsZXZlbCBpcyB0aGUgc2FtZSBhcyB0aGUgKG5ldykgbWluCisgICAgICAgIC8vIGxldmVsLCB3ZSBoYXZlIGEgc2VyaWVzIG9mIGFsdGVybmF0aW5nIGxldmVscyB0aGF0CisgICAgICAgIC8vIGlzIGFscmVhZHkgaW4gb3JkZXIsIHNvIHRoZXJlJ3Mgbm8gbW9yZSB0byBkby4KKyAgICAgICAgLy8KKyAgICAgICAgYm9vbGVhbiBzd2FwOworICAgICAgICBpZiAoKG1pbkxldmVsICYgMSkgPT0gYmFzZUxldmVsKSB7CisgICAgICAgICAgICBtaW5MZXZlbCArPSAxOworICAgICAgICAgICAgc3dhcCA9IG1heExldmVsID4gbWluTGV2ZWw7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzd2FwID0gcnVuQ291bnQgPiAxOworICAgICAgICB9CisgICAgICAgIGlmIChzd2FwKSB7CisgICAgICAgICAgICBmb3IgKGludCBsZXZlbCA9IG1heExldmVsIC0gMTsgbGV2ZWwgPj0gbWluTGV2ZWw7IC0tbGV2ZWwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxkLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsZXZlbHNbbGRbaV1dID49IGxldmVsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZSA9IGkgKyAyOworICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGUgPCBsZC5sZW5ndGggJiYgbGV2ZWxzW2xkW2VdXSA+PSBsZXZlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGxvdyA9IGksIGhpID0gZSAtIDI7IGxvdyA8IGhpOyBsb3cgKz0gMiwgaGkgLT0gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4ID0gbGRbbG93XTsgbGRbbG93XSA9IGxkW2hpXTsgbGRbaGldID0geDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gbGRbbG93KzFdOyBsZFtsb3crMV0gPSBsZFtoaSsxXTsgbGRbaGkrMV0gPSB4OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGUgKyAyOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBuZXcgRGlyZWN0aW9ucyhsZCk7CisgICAgfQorCiAgICAgcHJpdmF0ZSBuYXRpdmUgc3RhdGljIGludCBydW5CaWRpKGludCBkaXIsIGNoYXJbXSBjaHMsIGJ5dGVbXSBjaEluZm8sIGludCBuLCBib29sZWFuIGhhdmVJbmZvKTsKIH0KXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC90ZXh0L0JvcmluZ0xheW91dC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9Cb3JpbmdMYXlvdXQuamF2YQppbmRleCA5NDRmNzM1Li45MzA5YjA1IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC90ZXh0L0JvcmluZ0xheW91dC5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvQm9yaW5nTGF5b3V0LmphdmEKQEAgLTIwOCwxMSArMjA4LDExIEBACiAgICAgICAgICAgICAgKiB3aWR0aCBiZWNhdXNlIHRoZSB3aWR0aCB0aGF0IHdhcyBwYXNzZWQgaW4gd2FzIGZvciB0aGUKICAgICAgICAgICAgICAqIGZ1bGwgdGV4dCwgbm90IHRoZSBlbGxpcHNpemVkIGZvcm0uCiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc1RlbXApIHsKLSAgICAgICAgICAgICAgICBtTWF4ID0gKGludCkgKEZsb2F0TWF0aC5jZWlsKFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgc1RlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2UsIDAsIHNvdXJjZS5sZW5ndGgoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpKSk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBUZXh0TGluZSBsaW5lID0gVGV4dExpbmUub2J0YWluKCk7CisgICAgICAgICAgICBsaW5lLnNldChwYWludCwgc291cmNlLCAwLCBzb3VyY2UubGVuZ3RoKCksIExheW91dC5ESVJfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUlNfQUxMX0xFRlRfVE9fUklHSFQsIGZhbHNlLCBudWxsKTsKKyAgICAgICAgICAgIG1NYXggPSAoaW50KSBGbG9hdE1hdGguY2VpbChsaW5lLm1ldHJpY3MobnVsbCkpOworICAgICAgICAgICAgVGV4dExpbmUucmVjeWNsZShsaW5lKTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChpbmNsdWRlcGFkKSB7CkBAIC0yNzYsMTQgKzI3NiwxMyBAQAogICAgICAgICAgICAgaWYgKGZtID09IG51bGwpIHsKICAgICAgICAgICAgICAgICBmbSA9IG5ldyBNZXRyaWNzKCk7CiAgICAgICAgICAgICB9Ci0gICAgCi0gICAgICAgICAgICBpbnQgd2lkOwogCi0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNUZW1wKSB7Ci0gICAgICAgICAgICAgICAgd2lkID0gKGludCkgKEZsb2F0TWF0aC5jZWlsKFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgc1RlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LCAwLCB0ZXh0Lmxlbmd0aCgpLCBmbSkpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZtLndpZHRoID0gd2lkOworICAgICAgICAgICAgVGV4dExpbmUgbGluZSA9IFRleHRMaW5lLm9idGFpbigpOworICAgICAgICAgICAgbGluZS5zZXQocGFpbnQsIHRleHQsIDAsIHRleHQubGVuZ3RoKCksIExheW91dC5ESVJfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUlNfQUxMX0xFRlRfVE9fUklHSFQsIGZhbHNlLCBudWxsKTsKKyAgICAgICAgICAgIGZtLndpZHRoID0gKGludCkgRmxvYXRNYXRoLmNlaWwobGluZS5tZXRyaWNzKGZtKSk7CisgICAgICAgICAgICBUZXh0TGluZS5yZWN5Y2xlKGxpbmUpOworCiAgICAgICAgICAgICByZXR1cm4gZm07CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKQEAgLTM4OSw3ICszODgsNyBAQAogCiAgICAgcHVibGljIHN0YXRpYyBjbGFzcyBNZXRyaWNzIGV4dGVuZHMgUGFpbnQuRm9udE1ldHJpY3NJbnQgewogICAgICAgICBwdWJsaWMgaW50IHdpZHRoOwotICAgICAgICAKKwogICAgICAgICBAT3ZlcnJpZGUgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKICAgICAgICAgICAgIHJldHVybiBzdXBlci50b1N0cmluZygpICsgIiB3aWR0aD0iICsgd2lkdGg7CiAgICAgICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvQ2xpcGJvYXJkTWFuYWdlci5qYXZhIGIvY29y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LCBQYWludCBwKTsKIAogICAgIC8qKgorICAgICAqIEp1c3QgbGlrZSB7QGxpbmsgQ2FudmFzI2RyYXdUZXh0UnVufS4KKyAgICAgKiB7QGhpZGV9CisgICAgICovCisgICAgdm9pZCBkcmF3VGV4dFJ1bihDYW52YXMgYywgaW50IHN0YXJ0LCBpbnQgZW5kLCBpbnQgY29udGV4dFN0YXJ0LCBpbnQgY29udGV4dEVuZCwKKyAgICAgICAgICAgIGZsb2F0IHgsIGZsb2F0IHksIGludCBmbGFncywgUGFpbnQgcCk7CisKKyAgIC8qKgogICAgICAqIEp1c3QgbGlrZSB7QGxpbmsgUGFpbnQjbWVhc3VyZVRleHR9LgogICAgICAqLwogICAgIGZsb2F0IG1lYXN1cmVUZXh0KGludCBzdGFydCwgaW50IGVuZCwgUGFpbnQgcCk7CiAKLQogICAgIC8qKgogICAgICAqIEp1c3QgbGlrZSB7QGxpbmsgUGFpbnQjZ2V0VGV4dFdpZHRoc30uCiAgICAgICovCiAgICAgcHVibGljIGludCBnZXRUZXh0V2lkdGhzKGludCBzdGFydCwgaW50IGVuZCwgZmxvYXRbXSB3aWR0aHMsIFBhaW50IHApOworCisgICAgLyoqCisgICAgICogSnVzdCBsaWtlIHtAbGluayBQYWludCNnZXRUZXh0UnVuQWR2YW5jZXN9LgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgZmxvYXQgZ2V0VGV4dFJ1bkFkdmFuY2VzKGludCBzdGFydCwgaW50IGVuZCwgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsCisgICAgICAgICAgICBpbnQgZmxhZ3MsIGZsb2F0W10gYWR2YW5jZXMsIGludCBhZHZhbmNlc0luZGV4LCBQYWludCBwYWludCk7CisKKyAgICAvKioKKyAgICAgKiBKdXN0IGxpa2Uge0BsaW5rIFBhaW50I2dldFRleHRSdW5DdXJzb3J9LgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgaW50IGdldFRleHRSdW5DdXJzb3IoaW50IGNvbnRleH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sKKyAgICAgICAgICAgIHBhaW50LmJnQ29sb3IgPSAwOworICAgICAgICAgICAgcGFpbnQuYmFzZWxpbmVTaGlmdCA9IDA7CisgICAgICAgIH0KKwogICAgICAgICBtVGV4dCA9IHRleHQ7CiAgICAgICAgIG1QYWludCA9IHBhaW50OwogICAgICAgICBtV29ya1BhaW50ID0gbmV3IFRleHRQYWludCgpOwpAQCAtMTc1LDcgKzE4NSw2IEBACiAgICAgICAgICAgICBkYm90dG9tID0gc1RlbXBSZWN0LmJvdHRvbTsKICAgICAgICAgfQogCi0KICAgICAgICAgaW50IHRvcCA9IDA7CiAgICAgICAgIGludCBib3R0b20gPSBnZXRMaW5lVG9wKGdldExpbmVDb3VudCgpKTsKIApAQCAtMTg1LDI2ICsxOTQsMjggQEAKICAgICAgICAgaWYgKGRib3R0b20gPCBib3R0b20pIHsKICAgICAgICAgICAgIGJvdHRvbSA9IGRib3R0b207CiAgICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIGludCBmaXJzdCA9IGdldExpbmVGb3JWZXJ0aWNhbCh0b3ApOyAKKworICAgICAgICBpbnQgZmlyc3QgPSBnZXRMaW5lRm9yVmVydGljYWwodG9wKTsKICAgICAgICAgaW50IGxhc3QgPSBnZXRMaW5lRm9yVmVydGljYWwoYm90dG9tKTsKLSAgICAgICAgCisKICAgICAgICAgaW50IHByZXZpb3VzTGluZUJvdHRvbSA9IGdldExpbmVUb3AoZmlyc3QpOwogICAgICAgICBpbnQgcHJldmlvdXNMaW5lRW5kID0gZ2V0TGluZVN0YXJ0KGZpcnN0KTsKLSAgICAgICAgCisKICAgICAgICAgVGV4dFBhaW50IHBhaW50ID0gbVBhaW50OwogICAgICAgICBDaGFyU2VxdWVuY2UgYnVmID0gbVRleHQ7CiAgICAgICAgIGludCB3aWR0aCA9IG1XaWR0aDsKICAgICAgICAgYm9vbGVhbiBzcGFubmVkVGV4dCA9IG1TcGFubmVkVGV4dDsKIAogICAgICAgICBQYXJhZ3JhcGhTdHlsZVtdIHNwYW5zID0gTk9fUEFSQV9TUEFOUzsKLSAgICAgICAgaW50IHNwYW5lbmQgPSAwOworICAgICAgICBpbnQgc3BhbkVuZCA9IDA7CiAgICAgICAgIGludCB0ZXh0TGVuZ3RoID0gMDsKIAogICAgICAgICAvLyBGaXJzdCwgZHJhdyBMaW5lQmFja2dyb3VuZFNwYW5zLgotICAgICAgICAvLyBMaW5lQmFja2dyb3VuZFNwYW5zIGtub3cgbm90aGluZyBhYm91dCB0aGUgYWxpZ25tZW50IG9yIGRpcmVjdGlvbiBvZgotICAgICAgICAvLyB0aGUgbGF5b3V0IG9yIGxpbmUuICBYWFg6IFNob3VsZCB0aGV5PworICAgICAgICAvLyBMaW5lQmFja2dyb3VuZFNwYW5zIGtub3cgbm90aGluZyBhYm91dCB0aGUgYWxpZ25tZW50LCBtYXJnaW5zLCBvcgorICAgICAgICAvLyBkaXJlY3Rpb24gb2YgdGhlIGxheW91dCBvciBsaW5lLiAgWFhYOiBTaG91bGQgdGhleT8KKyAgICAgICAgLy8gVGhleSBhcmUgZXZhbHVhdGVkIGF0IGVhY2ggbGluZS4KICAgICAgICAgaWYgKHNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICBTcGFubmVkIHNwID0gKFNwYW5uZWQpIGJ1ZjsKICAgICAgICAgICAgIHRleHRMZW5ndGggPSBidWYubGVuZ3RoKCk7CiAgICAgICAgICAgICBmb3IgKGludCBpID0gZmlyc3Q7IGkgPD0gbGFzdDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgaW50IHN0YXJ0ID0gcHJldmlvdXNMaW5lRW5kOwpAQCAtMjE2LDEyICsyMjcsMTQgQEAKICAgICAgICAgICAgICAgICBwcmV2aW91c0xpbmVCb3R0b20gPSBsYm90dG9tOwogICAgICAgICAgICAgICAgIGludCBsYmFzZWxpbmUgPSBsYm90dG9tIC0gZ2V0TGluZURlc2NlbnQoaSk7CiAKLSAgICAgICAgICAgICAgICBpZiAoc3RhcnQgPj0gc3BhbmVuZCkgewotICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgYnVmOwotICAgICAgICAgICAgICAgICAgIHNwYW5lbmQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oc3RhcnQsIHRleHRMZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaW5lQmFja2dyb3VuZFNwYW4uY2xhc3MpOwotICAgICAgICAgICAgICAgICAgIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIHNwYW5lbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaW5lQmFja2dyb3VuZFNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgIGlmIChzdGFydCA+PSBzcGFuRW5kKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoZXNlIHNob3VsZCBiZSBpbmZyZXF1ZW50LCBzbyB3ZSdsbCB1c2UgdGhpcyBzbyB0aGF0CisgICAgICAgICAgICAgICAgICAgIC8vIHdlIGRvbid0IGhhdmUgdG8gY2hlY2sgYXMgb2Z0ZW4uCisgICAgICAgICAgICAgICAgICAgIHNwYW5FbmQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oc3RhcnQsIHRleHRMZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGluZUJhY2tncm91bmRTcGFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gQWxsIExpbmVCYWNrZ3JvdW5kU3BhbnMgb24gYSBsaW5lIGNvbnRyaWJ1dGUgdG8gaXRzCisgICAgICAgICAgICAgICAgICAgIC8vIGJhY2tncm91bmQuCisgICAgICAgICAgICAgICAgICAgc3BhbnMgPSBnZXRQYXJhZ3JhcGhTcGFucyhzcCwgc3RhcnQsIGVuZCwgTGluZUJhY2tncm91bmRTcGFuLmNsYXNzKTsKICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICBmb3IgKGludCBuID0gMDsgbiA8IHNwYW5zLmxlbmd0aDsgbisrKSB7CkBAIC0yMzQsMTEgKzI0NywxMSBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIC8vIHJlc2V0IHRvIHRoZWlyIG9yaWdpbmFsIHZhbHVlcwotICAgICAgICAgICAgc3BhbmVuZCA9IDA7CisgICAgICAgICAgICBzcGFuRW5kID0gMDsKICAgICAgICAgICAgIHByZXZpb3VzTGluZUJvdHRvbSA9IGdldExpbmVUb3AoZmlyc3QpOwogICAgICAgICAgICAgcHJldmlvdXNMaW5lRW5kID0gZ2V0TGluZVN0YXJ0KGZpcnN0KTsKICAgICAgICAgICAgIHNwYW5zID0gTk9fUEFSQV9TUEFOUzsKLSAgICAgICAgfSAKKyAgICAgICAgfQogCiAgICAgICAgIC8vIFRoZXJlIGNhbiBiZSBhIGhpZ2hsaWdodCBldmVuIHdpdGhvdXQgc3BhbnMgaWYgd2UgYXJlIGRyYXdpbmcKICAgICAgICAgLy8gYSBub24tc3Bhbm5lZCB0cmFuc2Zvcm1hdGlvbiBvZiBhIHNwYW5uZWQgZWRpdGluZyBidWZmZXIuCkBAIC0yNTUsNyArMjY4LDExIEBACiAgICAgICAgIH0KIAogICAgICAgICBBbGlnbm1lbnQgYWxpZ24gPSBtQWxpZ25tZW50OwotICAgICAgICAKKyAgICAgICAgVGFiU3RvcHMgdGFiU3RvcHMgPSBudWxsOworICAgICAgICBib29sZWFuIHRhYlN0b3BzSXNJbml0aWFsaXplZCA9IGZhbHNlOworCisgICAgICAgIFRleHRMaW5lIHRsID0gVGV4dExpbmUub2J0YWluKCk7CisKICAgICAgICAgLy8gTmV4dCBkcmF3IHRoZSBsaW5lcywgb25lIGF0IGEgdGltZS4KICAgICAgICAgLy8gdGhlIGJhc2VsaW5lIGlzIHRoZSB0b3Agb2YgdGhlIGZvbGxvd2luZyBsaW5lIG1pbnVzIHRoZSBjdXJyZW50CiAgICAgICAgIC8vIGxpbmUncyBkZXNjZW50LgpAQCAtMjcwLDE5ICsyODcsMzAgQEAKICAgICAgICAgICAgIHByZXZpb3VzTGluZUJvdHRvbSA9IGxib3R0b207CiAgICAgICAgICAgICBpbnQgbGJhc2VsaW5lID0gbGJvdHRvbSAtIGdldExpbmVEZXNjZW50KGkpOwogCi0gICAgICAgICAgICBib29sZWFuIGlzRmlyc3RQYXJhTGluZSA9IGZhbHNlOwotICAgICAgICAgICAgaWYgKHNwYW5uZWRUZXh0KSB7IAotICAgICAgICAgICAgICAgIGlmIChzdGFydCA9PSAwIHx8IGJ1Zi5jaGFyQXQoc3RhcnQgLSAxKSA9PSAnXG4nKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlzRmlyc3RQYXJhTGluZSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIE5ldyBiYXRjaCBvZiBwYXJhZ3JhcGggc3R5bGVzLCBjb21wdXRlIHRoZSBhbGlnbm1lbnQuCi0gICAgICAgICAgICAgICAgLy8gTGFzdCBhbGlnbm1lbnQgc3R5bGUgd2lucy4KLSAgICAgICAgICAgICAgICBpZiAoc3RhcnQgPj0gc3BhbmVuZCkgewotICAgICAgICAgICAgICAgICAgICBTcGFubmVkIHNwID0gKFNwYW5uZWQpIGJ1ZjsKLSAgICAgICAgICAgICAgICAgICAgc3BhbmVuZCA9IHNwLm5leHRTcGFuVHJhbnNpdGlvbihzdGFydCwgdGV4dExlbmd0aCwKKyAgICAgICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24oaSk7CisgICAgICAgICAgICBpbnQgbGVmdCA9IDA7CisgICAgICAgICAgICBpbnQgcmlnaHQgPSBtV2lkdGg7CisKKyAgICAgICAgICAgIGlmIChzcGFubmVkVGV4dCkgeworICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgYnVmOworICAgICAgICAgICAgICAgIGJvb2xlYW4gaXNGaXJzdFBhcmFMaW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7CisgICAgICAgICAgICAgICAgICAgIHNwYW5FbmQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oc3RhcnQsIHRleHRMZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyYWdyYXBoU3R5bGUuY2xhc3MpOwotICAgICAgICAgICAgICAgICAgICBzcGFucyA9IHNwLmdldFNwYW5zKHN0YXJ0LCBzcGFuZW5kLCBQYXJhZ3JhcGhTdHlsZS5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBzcGFucyA9IGdldFBhcmFncmFwaFNwYW5zKHNwLCBzdGFydCwgc3BhbkVuZCwgUGFyYWdyYXBoU3R5bGUuY2xhc3MpOworCiAgICAgICAgICAgICAgICAgICAgIGFsaWduID0gbUFsaWdubWVudDsKICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgbiA9IHNwYW5zLmxlbmd0aC0xOyBuID49IDA7IG4tLSkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW5zW25dIGluc3RhbmNlb2YgQWxpZ25tZW50U3BhbikgewpAQCAtMjkwLDQ1ICszMTgsNDkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAotICAgICAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihpKTsKLSAgICAgICAgICAgIGludCBsZWZ0ID0gMDsKLSAgICAgICAgICAgIGludCByaWdodCA9IG1XaWR0aDsKIAotICAgICAgICAgICAgLy8gRHJhdyBhbGwgbGVhZGluZyBtYXJnaW4gc3BhbnMuICBBZGp1c3QgbGVmdCBvciByaWdodCBhY2NvcmRpbmcKLSAgICAgICAgICAgIC8vIHRvIHRoZSBwYXJhZ3JhcGggZGlyZWN0aW9uIG9mIHRoZSBsaW5lLgotICAgICAgICAgICAgaWYgKHNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICAgICAgICAgIHRhYlN0b3BzSXNJbml0aWFsaXplZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIERyYXcgYWxsIGxlYWRpbmcgbWFyZ2luIHNwYW5zLiAgQWRqdXN0IGxlZnQgb3IgcmlnaHQgYWNjb3JkaW5nCisgICAgICAgICAgICAgICAgLy8gdG8gdGhlIHBhcmFncmFwaCBkaXJlY3Rpb24gb2YgdGhlIGxpbmUuCiAgICAgICAgICAgICAgICAgZmluYWwgaW50IGxlbmd0aCA9IHNwYW5zLmxlbmd0aDsKICAgICAgICAgICAgICAgICBmb3IgKGludCBuID0gMDsgbiA8IGxlbmd0aDsgbisrKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChzcGFuc1tuXSBpbnN0YW5jZW9mIExlYWRpbmdNYXJnaW5TcGFuKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3BhbiBtYXJnaW4gPSAoTGVhZGluZ01hcmdpblNwYW4pIHNwYW5zW25dOworICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiB1c2VGaXJzdExpbmVNYXJnaW4gPSBpc0ZpcnN0UGFyYUxpbmU7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFyZ2luIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4yKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gKChMZWFkaW5nTWFyZ2luU3BhbjIpIG1hcmdpbikuZ2V0TGVhZGluZ01hcmdpbkxpbmVDb3VudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydExpbmUgPSBnZXRMaW5lRm9yT2Zmc2V0KHNwLmdldFNwYW5TdGFydChtYXJnaW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VGaXJzdExpbmVNYXJnaW4gPSBpIDwgc3RhcnRMaW5lICsgY291bnQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX1JJR0hUX1RPX0xFRlQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4uZHJhd0xlYWRpbmdNYXJnaW4oYywgcGFpbnQsIHJpZ2h0LCBkaXIsIGx0b3AsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxiYXNlbGluZSwgbGJvdHRvbSwgYnVmLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCwgZW5kLCBpc0ZpcnN0UGFyYUxpbmUsIHRoaXMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWdodCAtPSBtYXJnaW4uZ2V0TGVhZGluZ01hcmdpbihpc0ZpcnN0UGFyYUxpbmUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJpZ2h0IC09IG1hcmdpbi5nZXRMZWFkaW5nTWFyZ2luKHVzZUZpcnN0TGluZU1hcmdpbik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbi5kcmF3TGVhZGluZ01hcmdpbihjLCBwYWludCwgbGVmdCwgZGlyLCBsdG9wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYmFzZWxpbmUsIGxib3R0b20sIGJ1ZiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQsIGVuZCwgaXNGaXJzdFBhcmFMaW5lLCB0aGlzKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gdXNlTWFyZ2luID0gaXNGaXJzdFBhcmFMaW5lOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXJnaW4gaW5zdGFuY2VvZiBMZWFkaW5nTWFyZ2luU3Bhbi5MZWFkaW5nTWFyZ2luU3BhbjIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gKChMZWFkaW5nTWFyZ2luU3Bhbi5MZWFkaW5nTWFyZ2luU3BhbjIpbWFyZ2luKS5nZXRMZWFkaW5nTWFyZ2luTGluZUNvdW50KCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZU1hcmdpbiA9IGNvdW50ID4gaTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCArPSBtYXJnaW4uZ2V0TGVhZGluZ01hcmdpbih1c2VNYXJnaW4pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgKz0gbWFyZ2luLmdldExlYWRpbmdNYXJnaW4odXNlRmlyc3RMaW5lTWFyZ2luKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgLy8gQWRqdXN0IHRoZSBwb2ludCBhdCB3aGljaCB0byBzdGFydCByZW5kZXJpbmcgZGVwZW5kaW5nIG9uIHRoZQotICAgICAgICAgICAgLy8gYWxpZ25tZW50IG9mIHRoZSBwYXJhZ3JhcGguCisgICAgICAgICAgICBib29sZWFuIGhhc1RhYk9yRW1vamkgPSBnZXRMaW5lQ29udGFpbnNUYWIoaSk7CisgICAgICAgICAgICAvLyBDYW4ndCB0ZWxsIGlmIHdlIGhhdmUgdGFicyBmb3Igc3VyZSwgY3VycmVudGx5CisgICAgICAgICAgICBpZiAoaGFzVGFiT3JFbW9qaSAmJiAhdGFiU3RvcHNJc0luaXRpYWxpemVkKSB7CisgICAgICAgICAgICAgICAgaWYgKHRhYlN0b3BzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGFiU3RvcHMgPSBuZXcgVGFiU3RvcHMoVEFCX0lOQ1JFTUVOVCwgc3BhbnMpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHRhYlN0b3BzLnJlc2V0KFRBQl9JTkNSRU1FTlQsIHNwYW5zKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdGFiU3RvcHNJc0luaXRpYWxpemVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgaW50IHg7CiAgICAgICAgICAgICBpZiAoYWxpZ24gPT0gQWxpZ25tZW50LkFMSUdOX05PUk1BTCkgewogICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpIHsKQEAgLTMzNyw0MSArMzY5LDgwIEBACiAgICAgICAgICAgICAgICAgICAgIHggPSByaWdodDsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGludCBtYXggPSAoaW50KWdldExpbmVNYXgoaSwgc3BhbnMsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBpbnQgbWF4ID0gKGludClnZXRMaW5lRXh0ZW50KGksIHRhYlN0b3BzLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgaWYgKGFsaWduID09IEFsaWdubWVudC5BTElHTl9PUFBPU0lURSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB4ID0gbGVmdCArIG1heDsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfTEVGVF9UT19SSUdIVCkgewogICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHJpZ2h0IC0gbWF4OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gQWxpZ25tZW50LkFMSUdOX0NFTlRFUgotICAgICAgICAgICAgICAgICAgICBtYXggPSBtYXggJiB+MTsKLSAgICAgICAgICAgICAgICAgICAgaW50IGhhbGYgPSAocmlnaHQgLSBsZWZ0IC0gbWF4KSA+PiAxOwotICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB4ID0gcmlnaHQgLSBoYWxmOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGxlZnQgKyBoYWxmOworICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGxlZnQgLSBtYXg7CiAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyBBbGlnbm1lbnQuQUxJR05fQ0VOVEVSCisgICAgICAgICAgICAgICAgICAgIG1heCA9IG1heCAmIH4xOworICAgICAgICAgICAgICAgICAgICB4ID0gKHJpZ2h0ICsgbGVmdCAtIG1heCkgPj4gMTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIERpcmVjdGlvbnMgZGlyZWN0aW9ucyA9IGdldExpbmVEaXJlY3Rpb25zKGkpOwotICAgICAgICAgICAgYm9vbGVhbiBoYXNUYWIgPSBnZXRMaW5lQ29udGFpbnNUYWIoaSk7CiAgICAgICAgICAgICBpZiAoZGlyZWN0aW9ucyA9PSBESVJTX0FMTF9MRUZUX1RPX1JJR0hUICYmCi0gICAgICAgICAgICAgICAgICAgICFzcGFubmVkVGV4dCAmJiAhaGFzVGFiKSB7Ci0gICAgICAgICAgICAgICAgaWYgKERFQlVHKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnRUcnVlKGRpciA9PSBESVJfTEVGVF9UT19SSUdIVCk7Ci0gICAgICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnROb3ROdWxsKGMpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIXNwYW5uZWRUZXh0ICYmICFoYXNUYWJPckVtb2ppKSB7CiAgICAgICAgICAgICAgICAgLy8gWFhYOiBhc3N1bWVzIHRoZXJlJ3Mgbm90aGluZyBhZGRpdGlvbmFsIHRvIGJlIGRvbmUKICAgICAgICAgICAgICAgICBjLmRyYXdUZXh0KGJ1Ziwgc3RhcnQsIGVuZCwgeCwgbGJhc2VsaW5lLCBwYWludCk7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGRyYXdUZXh0KGMsIGJ1Ziwgc3RhcnQsIGVuZCwgZGlyLCBkaXJlY3Rpb25zLAotICAgICAgICAgICAgICAgICAgICB4LCBsdG9wLCBsYmFzZWxpbmUsIGxib3R0b20sIHBhaW50LCBtV29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICBoYXNUYWIsIHNwYW5zKTsKKyAgICAgICAgICAgICAgICB0bC5zZXQocGFpbnQsIGJ1Ziwgc3RhcnQsIGVuZCwgZGlyLCBkaXJlY3Rpb25zLCBoYXNUYWJPckVtb2ppLCB0YWJTdG9wcyk7CisgICAgICAgICAgICAgICAgdGwuZHJhdyhjLCB4LCBsdG9wLCBsYmFzZWxpbmUsIGxib3R0b20pOwogICAgICAgICAgICAgfQogICAgICAgICB9CisKKyAgICAgICAgVGV4dExpbmUucmVjeWNsZSh0bCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJuIHRoZSBzdGFydCBwb3NpdGlvbiBvZiB0aGUgbGluZSwgZ2l2ZW4gdGhlIGxlZnQgYW5kIHJpZ2h0IGJvdW5kcworICAgICAqIG9mIHRoZSBtYXJnaW5zLgorICAgICAqCisgICAgICogQHBhcmFtIGxpbmUgdGhlIGxpbmUgaW5kZXgKKyAgICAgKiBAcGFyYW0gbGVmdCB0aGUgbGVmdCBib3VuZHMgKDAsIG9yIGxlYWRpbmcgbWFyZ2luIGlmIGx0ciBwYXJhKQorICAgICAqIEBwYXJhbSByaWdodCB0aGUgcmlnaHQgYm91bmRzICh3aWR0aCwgbWludXMgbGVhZGluZyBtYXJnaW4gaWYgcnRsIHBhcmEpCisgICAgICogQHJldHVybiB0aGUgc3RhcnQgcG9zaXRpb24gb2YgdGhlIGxpbmUgKHRvIHJpZ2h0IG9mIGxpbmUgaWYgcnRsIHBhcmEpCisgICAgICovCisgICAgcHJpdmF0ZSBpbnQgZ2V0TGluZVN0YXJ0UG9zKGludCBsaW5lLCBpbnQgbGVmdCwgaW50IHJpZ2h0KSB7CisgICAgICAgIC8vIEFkanVzdCB0aGUgcG9pbnQgYXQgd2hpY2ggdG8gc3RhcnQgcmVuZGVyaW5nIGRlcGVuZGluZyBvbiB0aGUKKyAgICAgICAgLy8gYWxpZ25tZW50IG9mIHRoZSBwYXJhZ3JhcGguCisgICAgICAgIEFsaWdubWVudCBhbGlnbiA9IGdldFBhcmFncmFwaEFsaWdubWVudChsaW5lKTsKKyAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKworICAgICAgICBpbnQgeDsKKyAgICAgICAgaWYgKGFsaWduID09IEFsaWdubWVudC5BTElHTl9OT1JNQUwpIHsKKyAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpIHsKKyAgICAgICAgICAgICAgICB4ID0gbGVmdDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgeCA9IHJpZ2h0OworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgVGFiU3RvcHMgdGFiU3RvcHMgPSBudWxsOworICAgICAgICAgICAgaWYgKG1TcGFubmVkVGV4dCAmJiBnZXRMaW5lQ29udGFpbnNUYWIobGluZSkpIHsKKyAgICAgICAgICAgICAgICBTcGFubmVkIHNwYW5uZWQgPSAoU3Bhbm5lZCkgbVRleHQ7CisgICAgICAgICAgICAgICAgaW50IHN0YXJ0ID0gZ2V0TGluZVN0YXJ0KGxpbmUpOworICAgICAgICAgICAgICAgIGludCBzcGFuRW5kID0gc3Bhbm5lZC5uZXh0U3BhblRyYW5zaXRpb24oc3RhcnQsIHNwYW5uZWQubGVuZ3RoKCksCisgICAgICAgICAgICAgICAgICAgICAgICBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgVGFiU3RvcFNwYW5bXSB0YWJTcGFucyA9IGdldFBhcmFncmFwaFNwYW5zKHNwYW5uZWQsIHN0YXJ0LCBzcGFuRW5kLCBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgaWYgKHRhYlNwYW5zLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgdGFiU3RvcHMgPSBuZXcgVGFiU3RvcHMoVEFCX0lOQ1JFTUVOVCwgdGFiU3BhbnMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBtYXggPSAoaW50KWdldExpbmVFeHRlbnQobGluZSwgdGFiU3RvcHMsIGZhbHNlKTsKKyAgICAgICAgICAgIGlmIChhbGlnbiA9PSBBbGlnbm1lbnQuQUxJR05fT1BQT1NJVEUpIHsKKyAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUKSB7CisgICAgICAgICAgICAgICAgICAgIHggPSByaWdodCAtIG1heDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB4ID0gbGVmdCAtIG1heDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeyAvLyBBbGlnbm1lbnQuQUxJR05fQ0VOVEVSCisgICAgICAgICAgICAgICAgbWF4ID0gbWF4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GV2ZWwgYm91bmRhcnkKKyAgICAgKi8KKyAgICBwcml2YXRlIGJvb2xlYW4gaXNMZXZlbEJvdW5kYXJ5KGludCBvZmZzZXQpIHsKKyAgICAgICAgaW50IGxpbmUgPSBnZXRMaW5lRm9yT2Zmc2V0KG9mZnNldCk7CisgICAgICAgIERpcmVjdGlvbnMgZGlycyA9IGdldExpbmVEaXJlY3Rpb25zKGxpbmUpOworICAgICAgICBpZiAoZGlycyA9PSBESVJTX0FMTF9MRUZUX1RPX1JJR0hUIHx8IGRpcnMgPT0gRElSU19BTExfUklHSFRfVE9fTEVGVCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgaW50W10gcnVucyA9IGRpcnMubURpcmVjdGlvbnM7CisgICAgICAgIGludCBsaW5lU3RhcnQgPSBnZXRMaW5lU3RhcnQobGluZSk7CisgICAgICAgIGludCBsaW5lRW5kID0gZ2V0TGluZUVuZChsaW5lKTsKKyAgICAgICAgaWYgKG9mZnNldCA9PSBsaW5lU3RhcnQgfHwgb2Zmc2V0ID09IGxpbmVFbmQpIHsKKyAgICAgICAgICAgIGludCBwYXJhTGV2ZWwgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSkgPT0gMSA/IDAgOiAxOworICAgICAgICAgICAgaW50IHJ1bkluZGV4ID0gb2Zmc2V0ID09IGxpbmVTdGFydCA/IDAgOiBydW5zLmxlbmd0aCAtIDI7CisgICAgICAgICAgICByZXR1cm4gKChydW5zW3J1bkluZGV4ICsgMV0gPj4+IFJVTl9MRVZFTF9TSElGVCkgJiBSVU5fTEVWRUxfTUFTSykgIT0gcGFyYUxldmVsOworICAgICAgICB9CisKKyAgICAgICAgb2Zmc2V0IC09IGxpbmVTdGFydDsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBydW5zLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICBpZiAob2Zmc2V0ID09IHJ1bnNbaV0pIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIHByaW1hcnlJc1RyYWlsaW5nUHJldmlvdXMoaW50IG9mZnNldCkgeworICAgICAgICBpbnQgbGluZSA9IGdldExpbmVGb3JPZmZzZXQob2Zmc2V0KTsKKyAgICAgICAgaW50IGxpbmVTdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgaW50IGxpbmVFbmQgPSBnZXRMaW5lRW5kKGxpbmUpOworICAgICAgICBpbnRbXSBydW5zID0gZ2V0TGluZURpcmVjdGlvbnMobGluZSkubURpcmVjdGlvbnM7CisKKyAgICAgICAgaW50IGxldmVsQXQgPSAtMTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBydW5zLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICBpbnQgc3RhcnQgPSBsaW5lU3RhcnQgKyBydW5zW2ldOworICAgICAgICAgICAgaW50IGxpbWl0ID0gc3RhcnQgKyAocnVuc1tpKzFdICYgUlVOX0xFTkdUSF9NQVNLKTsKKyAgICAgICAgICAgIGlmIChsaW1pdCA+IGxpbmVFbmQpIHsKKyAgICAgICAgICAgICAgICBsaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAob2Zmc2V0ID49IHN0YXJ0ICYmIG9mZnNldCA8IGxpbWl0KSB7CisgICAgICAgICAgICAgICAgaWYgKG9mZnNldCA+IHN0YXJ0KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFByZXZpb3VzIGNoYXJhY3RlciBpcyBhdCBzYW1lIGxldmVsLCBzbyBkb24ndCB1c2UgdHJhaWxpbmcuCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGV2ZWxBdCA9IChydW5zW2krMV0gPj4+IFJVTl9MRVZFTF9TSElGVCkgJiBSVU5fTEVWRUxfTUFTSzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobGV2ZWxBdCA9PSAtMSkgeworICAgICAgICAgICAgLy8gT2Zmc2V0IHdhcyBsaW1pdCBvZiBsaW5lLgorICAgICAgICAgICAgbGV2ZWxBdCA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKSA9PSAxID8gMCA6IDE7CisgICAgICAgIH0KKworICAgICAgICAvLyBBdCBsZXZlbCBib3VuZGFyeSwgY2hlY2sgcHJldmlvdXMgbGV2ZWwuCisgICAgICAgIGludCBsZXZlbEJlZm9yZSA9IC0xOworICAgICAgICBpZiAob2Zmc2V0ID09IGxpbmVTdGFydCkgeworICAgICAgICAgICAgbGV2ZWxCZWZvcmUgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSkgPT0gMSA/IDAgOiAxOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgb2Zmc2V0IC09IDE7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHJ1bnMubGVuZ3RoOyBpICs9IDIpIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnQgPSBsaW5lU3RhcnQgKyBydW5zW2ldOworICAgICAgICAgICAgICAgIGludCBsaW1pdCA9IHN0YXJ0ICsgKHJ1bnNbaSsxXSAmIFJVTl9MRU5HVEhfTUFTSyk7CisgICAgICAgICAgICAgICAgaWYgKGxpbWl0ID4gbGluZUVuZCkgeworICAgICAgICAgICAgICAgICAgICBsaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPj0gc3RhcnQgJiYgb2Zmc2V0IDwgbGltaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgbGV2ZWxCZWZvcmUgPSAocnVuc1tpKzFdID4+Pi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YXJ5SXNUcmFpbGluZ1ByZXZpb3VzKG9mZnNldCk7CisgICAgICAgIHJldHVybiBnZXRIb3Jpem9udGFsKG9mZnNldCwgIXRyYWlsaW5nKTsKICAgICB9CiAKLSAgICBwcml2YXRlIGZsb2F0IGdldEhvcml6b250YWwoaW50IG9mZnNldCwgYm9vbGVhbiB0cmFpbGluZywgYm9vbGVhbiBhbHQpIHsKKyAgICBwcml2YXRlIGZsb2F0IGdldEhvcml6b250YWwoaW50IG9mZnNldCwgYm9vbGVhbiB0cmFpbGluZykgewogICAgICAgICBpbnQgbGluZSA9IGdldExpbmVGb3JPZmZzZXQob2Zmc2V0KTsKIAotICAgICAgICByZXR1cm4gZ2V0SG9yaXpvbnRhbChvZmZzZXQsIHRyYWlsaW5nLCBhbHQsIGxpbmUpOworICAgICAgICByZXR1cm4gZ2V0SG9yaXpvbnRhbChvZmZzZXQsIHRyYWlsaW5nLCBsaW5lKTsKICAgICB9CiAKLSAgICBwcml2YXRlIGZsb2F0IGdldEhvcml6b250YWwoaW50IG9mZnNldCwgYm9vbGVhbiB0cmFpbGluZywgYm9vbGVhbiBhbHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsaW5lKSB7CisgICAgcHJpdmF0ZSBmbG9hdCBnZXRIb3Jpem9udGFsKGludCBvZmZzZXQsIGJvb2xlYW4gdHJhaWxpbmcsIGludCBsaW5lKSB7CiAgICAgICAgIGludCBzdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKLSAgICAgICAgaW50IGVuZCA9IGdldExpbmVWaXNpYmxlRW5kKGxpbmUpOworICAgICAgICBpbnQgZW5kID0gZ2V0TGluZUVuZChsaW5lKTsKICAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKLSAgICAgICAgYm9vbGVhbiB0YWIgPSBnZXRMaW5lQ29udGFpbnNUYWIobGluZSk7CisgICAgICAgIGJvb2xlYW4gaGFzVGFiT3JFbW9qaSA9IGdld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BkaXIsIGRpcmVjdGlvbnMsIHRyYWlsaW5nLCBhbHQsIHRhYiwgdGFicyk7CisgICAgICAgIFRleHRMaW5lIHRsID0gVGV4dExpbmUub2J0YWluKCk7CisgICAgICAgIHRsLnNldChtUGFpbnQsIG1UZXh0LCBzdGFydCwgZW5kLCBkaXIsIGRpcmVjdGlvbnMsIGhhc1RhYk9yRW1vamksIHRhYlN0b3BzKTsKKyAgICAgICAgZmxvYXQgd2lkID0gdGwubWVhc3VyZShvZmZzZXQgLSBzdGFydCwgdHJhaWxpbmcsIG51bGwpOworICAgICAgICBUZXh0TGluZS5yZWN5Y2xlKHRsKTsKIAotICAgICAgICBpZiAob2Zmc2V0ID4gZW5kKSB7Ci0gICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUKQotICAgICAgICAgICAgICAgIHdpZCAtPSBtZWFzdXJlVGV4dChtUGFpbnQsIG1Xb3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXh0LCBlbmQsIG9mZnNldCwgbnVsbCwgdGFiLCB0YWJzKTsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB3aWQgKz0gbWVhc3VyZVRleHQobVBhaW50LCBtV29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGV4dCwgZW5kLCBvZmZzZXQsIG51bGwsIHRhYiwgdGFicyk7Ci0gICAgICAgIH0KLQotICAgICAgICBBbGlnbm1lbnQgYWxpZ24gPSBnZXRQYXJhZ3JhcGhBbGlnbm1lbnQobGluZSk7CiAgICAgICAgIGludCBsZWZ0ID0gZ2V0UGFyYWdyYXBoTGVmdChsaW5lKTsKICAgICAgICAgaW50IHJpZ2h0ID0gZ2V0UGFyYWdyYXBoUmlnaHQobGluZSk7CiAKLSAgICAgICAgaWYgKGFsaWduID09IEFsaWdubWVudC5BTElHTl9OT1JNQUwpIHsKLSAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX1JJR0hUX1RPX0xFRlQpCi0gICAgICAgICAgICAgICAgcmV0dXJuIHJpZ2h0ICsgd2lkOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ICsgd2lkOwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgbWF4ID0gZ2V0TGluZU1heChsaW5lKTsKLQotICAgICAgICBpZiAoYWxpZ24gPT0gQWxpZ25tZW50LkFMSUdOX09QUE9TSVRFKSB7Ci0gICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUKQotICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ICsgbWF4ICsgd2lkOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHJldHVybiByaWdodCAtIG1heCArIHdpZDsKLSAgICAgICAgfSBlbHNlIHsgLyogYWxpZ24gPT0gQWxpZ25tZW50LkFMSUdOX0NFTlRFUiAqLwotICAgICAgICAgICAgaW50IGltYXggPSAoKGludCkgbWF4KSAmIH4xOwotCi0gICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUKQotICAgICAgICAgICAgICAgIHJldHVybiByaWdodCAtICgoKHJpZ2h0IC0gbGVmdCkgLSBpbWF4KSAvIDIpICsgd2lkOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ICsgKChyaWdodCAtIGxlZnQpIC0gaW1heCkgLyAyICsgd2lkOwotICAgICAgICB9CisgICAgICAgIHJldHVybiBnZXRMaW5lU3RhcnRQb3MobGluZSwgbGVmdCwgcmlnaHQpICsgd2lkOwogICAgIH0KIAogICAgIC8qKgpAQCAtNjU2LDM4ICs3ODUsNzYgQEAKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBHZXRzIHRoZSBob3Jpem9udGFsIGV4dGVudCBvZiB0aGUgc3BlY2lmaWVkIGxpbmUsIGV4Y2x1ZGluZwotICAgICAqIHRyYWlsaW5nIHd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hcnQgPSBnZXRMaW5lU3RhcnQobGluZSk7CisgICAgICAgIGludCBlbmQgPSBmdWxsID8gZ2V0TGluZUVuZChsaW5lKSA6IGdldExpbmVWaXNpYmxlRW5kKGxpbmUpOworICAgICAgICBib29sZWFuIGhhc1RhYnNPckVtb2ppID0gZ2V0TGluZUNvbnRhaW5zVGFiKGxpbmUpOworICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnMgPSBnZXRMaW5lRGlyZWN0aW9ucyhsaW5lKTsKKyAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKworICAgICAgICBUZXh0TGluZSB0bCA9IFRleHRMaW5lLm9idGFpbigpOworICAgICAgICB0bC5zZXQobVBhaW50LCBtVGV4dCwgc3RhcnQsIGVuZCwgZGlyLCBkaXJlY3Rpb25zLCBoYXNUYWJzT3JFbW9qaSwgdGFiU3RvcHMpOworICAgICAgICBmbG9hdCB3aWR0aCA9IHRsLm1ldHJpY3MobnVsbCk7CisgICAgICAgIFRleHRMaW5lLnJlY3ljbGUodGwpOworICAgICAgICByZXR1cm4gd2lkdGg7CiAgICAgfQogCiAgICAgLyoqCkBAIC03MzgsNyArOTA1LDcgQEAKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBHZXQgdGhlIGNoYXJhY3RlciBvZmZzZXQgb24gdGhlIHNwZWNmaWVkIGxpbmUgd2hvc2UgcG9zaXRpb24gaXMKKyAgICAgKiBHZXQgdGhlIGNoYXJhY3RlciBvZmZzZXQgb24gdGhlIHNwZWNpZmllZCBsaW5lIHdob3NlIHBvc2l0aW9uIGlzCiAgICAgICogY2xvc2VzdCB0byB0aGUgc3BlY2lmaWVkIGhvcml6b250YWwgcG9zaXRpb24uCiAgICAgICovCiAgICAgcHVibGljIGludCBnZXRPZmZzZXRGb3JIb3Jpem9udGFsKGludCBsaW5lLCBmbG9hdCBob3JpeikgewpAQCAtNzQ5LDIwICs5MTYsMTYgQEAKICAgICAgICAgaWYgKGxpbmUgPT0gZ2V0TGluZUNvdW50KCkgLSAxKQogICAgICAgICAgICAgbWF4Kys7CiAKLSAgICAgICAgaWYgKGxpbmUgIT0gZ2V0TGluZUNvdW50KCkgLSAxKQotICAgICAgICAgICAgbWF4ID0gVGV4dFV0aWxzLmdldE9mZnNldEJlZm9yZShtVGV4dCwgZ2V0TGluZUVuZChsaW5lKSk7Ci0KICAgICAgICAgaW50IGJlc3QgPSBtaW47CiAgICAgICAgIGZsb2F0IGJlc3RkaXN0ID0gTWF0aC5hYnMoZ2V0UHJpbWFyeUhvcml6b250YWwoYmVzdCkgLSBob3Jpeik7CiAKLSAgICAgICAgaW50IGhlcmUgPSBtaW47Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGlycy5tRGlyZWN0aW9ucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgaW50IHRoZXJlID0gaGVyZSArIGRpcnMubURpcmVjdGlvbnNbaV07Ci0gICAgICAgICAgICBpbnQgc3dhcCA9ICgoaSAmIDEpID09IDApID8gMSA6IC0xOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGRpcnMubURpcmVjdGlvbnMubGVuZ3RoOyBpICs9IDIpIHsKKyAgICAgICAgICAgIGludCBoZXJlID0gbWluICsgZGlycy5tRGlyZWN0aW9uc1tpXTsKKyAgICAgICAgICAgIGludCB0aGVyZSA9IGhlcmUgKyAoZGlycy5tRGlyZWN0aW9uc1tpKzFdICYgUlVOX0xFTkdUSF9NQVNLKTsKKyAgICAgICAgICAgIGludCBzd2FwID0gKGRpcnMubURpcmVjdGlvbnNbaSsxXSAmIFJVTl9SVExfRkxBRykgIT0gMCA/IC0xIDogMTsKIAogICAgICAgICAgICAgaWYgKHRoZXJlID4gbWF4KQogICAgICAgICAgICAgICAgIHRoZXJlID0gbWF4OwotCiAgICAgICAgICAgICBpbnQgaGlnaCA9IHRoZXJlIC0gMSArIDEsIGxvdyA9IGhlcmUgKyAxIC0gMSwgZ3Vlc3M7CiAKICAgICAgICAgICAgIHdoaWxlIChoaWdoIC0gbG93ID4gMSkgewpAQCAtNzk1LDcgKzk1OCw3IEBACiAKICAgICAgICAgICAgICAgICBpZiAoZGlzdCA8IGJlc3RkaXN0KSB7CiAgICAgICAgICAgICAgICAgICAgIGJlc3RkaXN0ID0gZGlzdDsKLSAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGxvdzsgICAKKyAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGxvdzsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKQEAgLTgwNSw4ICs5NjgsNiBAQAogICAgICAgICAgICAgICAgIGJlc3RkaXN0ID0gZGlzdDsKICAgICAgICAgICAgICAgICBiZXN0ID0gaGVyZTsKICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaGVyZSA9IHRoZXJlOwogICAgICAgICB9CiAKICAgICAgICAgZmxvYXQgZGlzdCA9IE1hdGguYWJzKGdldFByaW1hcnlIb3Jpem9udGFsKG1heCkgLSBob3Jpeik7CkBAIC04MjYsMTkgKzk4NywxNSBAQAogICAgICAgICByZXR1cm4gZ2V0TGluZVN0YXJ0KGxpbmUgKyAxKTsKICAgICB9CiAKLSAgICAvKiogCisgICAgLyoqCiAgICAgICogUmV0dXJuIHRoZSB0ZXh0IG9mZnNldCBhZnRlciB0aGUgbGFzdCB2aXNpYmxlIGNoYXJhY3RlciAoc28gd2hpdGVzcGFjZQogICAgICAqIGlzIG5vdCBjb3VudGVkKSBvbiB0aGUgc3BlY2lmaWVkIGxpbmUuCiAgICAgICovCiAgICAgcHVibGljIGludCBnZXRMaW5lVmlzaWJsZUVuZChpbnQgbGluZSkgewogICAgICAgICByZXR1cm4gZ2V0TGluZVZpc2libGVFbmQobGluZSwgZ2V0TGluZVN0YXJ0KGxpbmUpLCBnZXRMaW5lU3RhcnQobGluZSsxKSk7CiAgICAgfQotICAgIAotICAgIHByaXZhdGUgaW50IGdldExpbmVWaXNpYmxlRW5kKGludCBsaW5lLCBpbn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gICAgIGludCBoZXJlID0gc3RhcnQ7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGlycy5tRGlyZWN0aW9ucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgaW50IHRoZXJlID0gaGVyZSArIGRpcnMubURpcmVjdGlvbnNbaV07Ci0gICAgICAgICAgICBpZiAodGhlcmUgPiBlbmQpCi0gICAgICAgICAgICAgICAgdGhlcmUgPSBlbmQ7Ci0KLSAgICAgICAgICAgIGZsb2F0IGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChoZXJlKTsKLQotICAgICAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgICAgICBiZXN0ID0gaGVyZTsKLSAgICAgICAgICAgICAgICBiZXN0aCA9IGg7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhbmRpZGF0ZSA9IFRleHRVdGlscy5nZXRPZmZzZXRBZnRlcihtVGV4dCwgaGVyZSk7Ci0gICAgICAgICAgICBpZiAoY2FuZGlkYXRlID49IHN0YXJ0ICYmIGNhbmRpZGF0ZSA8PSBlbmQpIHsKLSAgICAgICAgICAgICAgICBoID0gZ2V0UHJpbWFyeUhvcml6b250YWwoY2FuZGlkYXRlKTsKLQotICAgICAgICAgICAgICAgIGlmIChoIDwgaG9yaXogJiYgaCA+IGJlc3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJlc3QgPSBjYW5kaWRhdGU7Ci0gICAgICAgICAgICAgICAgICAgIGJlc3RoID0gaDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhbmRpZGF0ZSA9IFRleHRVdGlscy5nZXRPZmZzZXRCZWZvcmUobVRleHQsIHRoZXJlKTsKLSAgICAgICAgICAgIGlmIChjYW5kaWRhdGUgPj0gc3RhcnQgJiYgY2FuZGlkYXRlIDw9IGVuZCkgewotICAgICAgICAgICAgICAgIGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChjYW5kaWRhdGUpOwotCi0gICAgICAgICAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGNhbmRpZGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgYmVzdGggPSBoOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaGVyZSA9IHRoZXJlOwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgaCA9IGdldFByaW1hcnlIb3Jpem9udGFsKGVuZCk7Ci0KLSAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgIGJlc3QgPSBlbmQ7Ci0gICAgICAgICAgICBiZXN0aCA9IGg7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoYmVzdCAhPSBvZmZzZXQpCi0gICAgICAgICAgICByZXR1cm4gYmVzdDsKLQotICAgICAgICBpbnQgZGlyID0gZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGxpbmUpOwotCi0gICAgICAgIGlmIChkaXIgPiAwKSB7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSAwKQotICAgICAgICAgICAgICAgIHJldHVybiBiZXN0OwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHJldHVybiBnZXRPZmZzZXRGb3JIb3Jpem9udGFsKGxpbmUgLSAxLCAxMDAwMCk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSBnZXRMaW5lQ291bnQoKSAtIDEpCi0gICAgICAgICAgICAgICAgcmV0dXJuIGJlc3Q7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgcmV0dXJuIGdldE9mZnNldEZvckhvcml6b250YWwobGluZSArIDEsIDEwMDAwKTsKLSAgICAgICAgfQorICAgICAgICByZXR1cm4gZ2V0T2Zmc2V0VG9MZWZ0U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pKyspIHsKLSAgICAgICAgICAgIGludCB0aGVyZSA9IGhlcmUgKyBkaXJzLm1EaXJlY3Rpb25zW2ldOwotICAgICAgICAgICAgaWYgKHRoZXJlID4gZW5kKQotICAgICAgICAgICAgICAgIHRoZXJlID0gZW5kOwotCi0gICAgICAgICAgICBmbG9hdCBoID0gZ2V0UHJpbWFyeUhvcml6b250YWwoaGVyZSk7Ci0KLSAgICAgICAgICAgIGlmIChoID4gaG9yaXogJiYgaCA8IGJlc3RoKSB7Ci0gICAgICAgICAgICAgICAgYmVzdCA9IGhlcmU7Ci0gICAgICAgICAgICAgICAgYmVzdGggPSBoOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYW5kaWRhdGUgPSBUZXh0VXRpbHMuZ2V0T2Zmc2V0QWZ0ZXIobVRleHQsIGhlcmUpOwotICAgICAgICAgICAgaWYgKGNhbmRpZGF0ZSA+PSBzdGFydCAmJiBjYW5kaWRhdGUgPD0gZW5kKSB7Ci0gICAgICAgICAgICAgICAgaCA9IGdldFByaW1hcnlIb3Jpem9udGFsKGNhbmRpZGF0ZSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoaCA+IGhvcml6ICYmIGggPCBiZXN0aCkgewotICAgICAgICAgICAgICAgICAgICBiZXN0ID0gY2FuZGlkYXRlOwotICAgICAgICAgICAgICAgICAgICBiZXN0aCA9IGg7CisgICAgICAgIGJvb2xlYW4gYWR2YW5jZSA9IHRvTGVmdCA9PSAobGluZURpciA9PSBESVJfUklHSFRfVE9fTEVGVCk7CisgICAgICAgIGlmIChjYXJldCA9PSAoYWR2YW5jZSA/IGxpbmVFbmQgOiBsaW5lU3RhcnQpKSB7CisgICAgICAgICAgICAvLyB3YWxraW5nIG9mZiBsaW5lLCBzbyBsb29rIGF0IHRoZSBsaW5lIHdlJ3JlIGhlYWRlZCB0bworICAgICAgICAgICAgaWYgKGNhcmV0ID09IGxpbmVTdGFydCkgeworICAgICAgICAgICAgICAgIGlmIChsaW5lID4gMCkgeworICAgICAgICAgICAgICAgICAgICAtLWxpbmU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhcmV0OyAvLyBhdCB2ZXJ5IHN0YXJ0LCBkb24ndCBtb3ZlCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAobGluZSA8IGdldExpbmVDb3VudCgpIC0gMSkgeworICAgICAgICAgICAgICAgICAgICArK2xpbmU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhcmV0OyAvLyBhdCB2ZXJ5IGVuZCwgZG9uJ3QgbW92ZQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgY2FuZGlkYXRlID0gVGV4dFV0aWxzLmdldE9mZnNldEJlZm9yZShtVGV4dCwgdGhlcmUpOwotICAgICAgICAgICAgaWYgKGNhbmRpZGF0ZSA+PSBzdGFydCAmJiBjYW5kaWRhdGUgPD0gZW5kKSB7Ci0gICAgICAgICAgICAgICAgaCA9IGdldFByaW1hcnlIb3Jpem9udGFsKGNhbmRpZGF0ZSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoaCA+IGhvcml6ICYmIGggPCBiZXN0aCkgewotICAgICAgICAgICAgICAgICAgICBiZXN0ID0gY2FuZGlkYXRlOwotICAgICAgICAgICAgICAgICAgICBiZXN0aCA9IGg7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgbGluZVN0YXJ0ID0gZ2V0TGluZVN0YXJ0KGxpbmUpOworICAgICAgICAgICAgbGluZUVuZCA9IGdldExpbmVFbmQobGluZSk7CisgICAgICAgICAgICBpbnQgbmV3RGlyID0gZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGxpbmUpOworICAgICAgICAgICAgaWYgKG5ld0RpciAhPSBsaW5lRGlyKSB7CisgICAgICAgICAgICAgICAgLy8gdW51c3VhbCBjYXNlLiAgd2Ugd2FudCB0byB3YWxrIG9udG8gdGhlIGxpbmUsIGJ1dCBpdCBydW5zCisgICAgICAgICAgICAgICAgLy8gaW4gYSBkaWZmZXJlbnQgZGlyZWN0aW9uIHRoYW4gdGhpcyBvbmUsIHNvIHdlIGZha2UgbW92ZW1lbnQKKyAgICAgICAgICAgICAgICAvLyBpbiB0aGUgb3Bwb3NpdGUgZGlyZWN0aW9uLgorICAgICAgICAgICAgICAgIHRvTGVmdCA9ICF0b0xlZnQ7CisgICAgICAgICAgICAgICAgbGluZURpciA9IG5ld0RpcjsKICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaGVyZSA9IHRoZXJlOwogICAgICAgICB9CiAKLSAgICAgICAgZmxvYXQgaCA9IGdldFByaW1hcnlIb3Jpem9udGFsKGVuZCk7CisgICAgICAgIERpcmVjdGlvbnMgZGlyZWN0aW9ucyA9IGdldExpbmVEaXJlY3Rpb25zKGxpbmUpOwogCi0gICAgICAgIGlmIChoID4gaG9yaXogJiYgaCA8IGJlc3RoKSB7Ci0gICAgICAgICAgICBiZXN0ID0gZW5kOwotICAgICAgICAgICAgYmVzdGggPSBoOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGJlc3QgIT0gb2Zmc2V0KQotICAgICAgICAgICAgcmV0dXJuIGJlc3Q7Ci0KLSAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKLQotICAgICAgICBpZiAoZGlyID4gMCkgewotICAgICAgICAgICAgaWYgKGxpbmUgPT0gZ2V0TGluZUNvdW50KCkgLSAxKQotICAgICAgICAgICAgICAgIHJldHVybiBiZXN0OwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHJldHVybiBnZXRPZmZzZXRGb3JIb3Jpem9udGFsKGxpbmUgKyAxLCAtMTAwMDApOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKGxpbmUgPT0gMCkKLSAgICAgICAg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YnV0IGNhbiBiZSBtdWx0aXBsZSBkaXNjb250aW5vdXMgbGluZXMgaW4gdGV4dCB3aXRoIG11bHRpcGxlCisgICAgICogYnV0IGNhbiBiZSBtdWx0aXBsZSBkaXNjb250aW51b3VzIGxpbmVzIGluIHRleHQgd2l0aCBtdWx0aXBsZQogICAgICAqIGRpcmVjdGlvbmFsaXRpZXMuCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgZ2V0Q3Vyc29yUGF0aChpbnQgcG9pbnQsIFBhdGggZGVzdCwKQEAgLTExMzAsMTQgKzExNDIsMTIgQEAKICAgICAgICAgaW50IGJvdHRvbSA9IGdldExpbmVUb3AobGluZSsxKTsKIAogICAgICAgICBmbG9hdCBoMSA9IGdldFByaW1hcnlIb3Jpem9udGFsKHBvaW50KSAtIDAuNWY7Ci0gICAgICAgIGZsb2F0IGgyID0gZ2V0U2Vjb25kYXJ5SG9yaXpvbnRhbChwb2ludCkgLSAwLjVmOworICAgICAgICBmbG9hdCBoMiA9IGlzTGV2ZWxCb3VuZGFyeShwb2ludCkgPworICAgICAgICAgICAgICAgICAgICBnZXRTZWNvbmRhcnlIb3Jpem9udGFsKHBvaW50KSAtIDAuNWYgOiBoMTsKIAotICAgICAgICBpbnQgY2FwcyA9IFRleHRLZXlMaXN0ZW5lci5nZXRNZXRhU3RhdGUoZWRpdGluZ0J1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEtleUV2ZW50Lk1FVEFfU0hJRlRfT04pIHwKLSAgICAgICAgICAgICAgICAgICBUZXh0S2V5TGlzdGVuZXIuZ2V0TWV0YVN0YXRlKGVkaXRpbmdCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0S2V5TGlzdGVuZXIuTUVUQV9TRUxFQ1RJTkcpOwotICAgICAgICBpbnQgZm4gPSBUZXh0S2V5TGlzdGVuZXIuZ2V0TWV0YVN0YXRlKGV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lcmUgPSBoZXJlICsgKGRpcnMubURpcmVjdGlvbnNbaSsxXSAmIFJVTl9MRU5HVEhfTUFTSyk7CisKICAgICAgICAgICAgIGlmICh0aGVyZSA+IGxpbmVlbmQpCiAgICAgICAgICAgICAgICAgdGhlcmUgPSBsaW5lZW5kOwogCkBAIC0xMjE4LDE0ICsxMjI5LDEyIEBACiAgICAgICAgICAgICAgICAgaW50IGVuID0gTWF0aC5taW4oZW5kLCB0aGVyZSk7CiAKICAgICAgICAgICAgICAgICBpZiAoc3QgIT0gZW4pIHsKLSAgICAgICAgICAgICAgICAgICAgZmxvYXQgaDEgPSBnZXRIb3Jpem9udGFsKHN0LCBmYWxzZSwgZmFsc2UsIGxpbmUpOwotICAgICAgICAgICAgICAgICAgICBmbG9hdCBoMiA9IGdldEhvcml6b250YWwoZW4sIHRydWUsIGZhbHNlLCBsaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgaDEgPSBnZXRIb3Jpem9udGFsKHN0LCBmYWxzZSwgbGluZSk7CisgICAgICAgICAgICAgICAgICAgIGZsb2F0IGgyID0gZ2V0SG9yaXpvbnRhbChlbiwgdHJ1ZSwgbGluZSk7CiAKICAgICAgICAgICAgICAgICAgICAgZGVzdC5hZGRSZWN0KGgxLCB0b3AsIGgyLCBib3R0b20sIFBhdGguRGlyZWN0aW9uLkNXKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGhlcmUgPSB0aGVyZTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTI2MCw3ICsxMjY5LDcgQEAKIAogICAgICAgICAgICAgYWRkU2VsZWN0aW9uKHN0YXJ0bGluZSwgc3RhcnQsIGdldExpbmVFbmQoc3RhcnRsaW5lKSwKICAgICAgICAgICAgICAgICAgICAgICAgICB0b3AsIGdldExpbmVCb3R0b20oc3RhcnRsaW5lKSwgZGVzdCk7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKGdldFBhcmFncmFwaERpcmVjdGlvbihzdGFydGxpbmUpID09IERJUl9SSUdIVF9UT19MRUZUKQogICAgICAgICAgICAgICAgIGRlc3QuYWRkUmVjdChnZXRMaW5lTGVmdChzdGFydGxpbmUpLCB0b3AsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCBnZXRMaW5lQm90dG9tKHN0YXJ0bGluZSksIFBhdGguRGlyZWN0aW9uLkNXKTsKQEAgLTEyOTYsNyArMTMwNSw3IEBACiAKICAgICAgICAgaWYgKG1TcGFubmVkVGV4dCkgewogICAgICAgICAgICAgU3Bhbm5lZCBzcCA9IChTcGFubmVkKSBtVGV4dDsKLSAgICAgICAgICAgIEFsaWdubWVudFNwYW5bXSBzcGFucyA9IHNwLmdldFNwYW5zKGdldExpbmVTdGFydChsaW5lKSwKKyAgICAgICAgICAgIEFsaWdubWVudFNwYW5bXSBzcGFucyA9IGdldFBhcmFncmFwaFNwYW5zKHNwLCBnZXRMaW5lU3RhcnQobGluZSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRMaW5lRW5kKGxpbmUpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWxpZ25tZW50U3Bhbi5jbGFzcyk7CiAKQEAgLTEzMTMsNDIzICsxMzIyLDE3MyBAQAogICAgICAqIEdldCB0aGUgbGVmdCBlZGdlIG9mIHRoZSBzcGVjaWZpZWQgcGFyYWdyYXBoLCBpbnNldCBieSBsZWZ0IG1hcmdpbnMuCiAgICAgICovCiAgICAgcHVibGljIGZpbmFsIGludCBnZXRQYXJhZ3JhcGhMZWZ0KGludCBsaW5lKSB7Ci0gICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSk7Ci0KICAgICAgICAgaW50IGxlZnQgPSAwOwotCi0gICAgICAgIGJvb2xlYW4gcGFyID0gZmFsc2U7Ci0gICAgICAgIGludCBvZmYgPSBnZXRMaW5lU3RhcnQobGluZSk7Ci0gICAgICAgIGlmIChvZmYgPT0gMCB8fCBtVGV4dC5jaGFyQXQob2ZmIC0gMSkgPT0gJ1xuJykKLSAgICAgICAgICAgIHBhciA9IHRydWU7Ci0KLSAgICAgICAgaWYgKGRpciA9PSBESVJfTEVGVF9UT19SSUdIVCkgewotICAgICAgICAgICAgaWYgKG1TcGFubmVkVGV4dCkgewotICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgbVRleHQ7Ci0gICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW5bXSBzcGFucyA9IHNwLmdldFNwYW5zKGdldExpbmVTdGFydChsaW5lKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0TGluZUVuZChsaW5lKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4uY2xhc3MpOwotCi0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzcGFucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBib29sZWFuIG1hcmdpbiA9IHBhcjsKLSAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4gc3BhbiA9IHNwYW5zW2ldOwotICAgICAgICAgICAgICAgICAgICBpZiAoc3BhbiBpbnN0YW5jZW9mIExlYWRpbmdNYXJnaW5TcGFuLkxlYWRpbmdNYXJnaW5TcGFuMikgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gKChMZWFkaW5nTWFyZ2luU3Bhbi5MZWFkaW5nTWFyZ2luU3BhbjIpc3BhbikuZ2V0TGVhZGluZ01hcmdpbkxpbmVDb3VudCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luID0gY291bnQgPj0gbGluZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBsZWZ0ICs9IHNwYW4uZ2V0TGVhZGluZ01hcmdpbihtYXJnaW4pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKyAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCB8fCAhbVNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICByZXR1cm4gbGVmdDsgLy8gbGVhZGluZyBtYXJnaW4gaGFzIG5vIGltcGFjdCwgb3Igbm8gc3R5bGVzCiAgICAgICAgIH0KLQotICAgICAgICByZXR1cm4gbGVmdDsKKyAgICAgICAgcmV0dXJuIGdldFBhcmFncmFwaExlYWRpbmdNYXJnaW4obGluZSk7CiAgICAgfQogCiAgICAgLyoqCiAgICAgICogR2V0IHRoZSByaWdodCBlZGdlIG9mIHRoZSBzcGVjaWZpZWQgcGFyYWdyYXBoLCBpbnNldCBieSByaWdodCBtYXJnaW5zLgogICAgICAqLwogICAgIHB1YmxpYyBmaW5hbCBpbnQgZ2V0UGFyYWdyYXBoUmlnaHQoaW50IGxpbmUpIHsKLSAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKLQogICAgICAgICBpbnQgcmlnaHQgPSBtV2lkdGg7Ci0KLSAgICAgICAgYm9vbGVhbiBwYXIgPSBmYWxzZTsKLSAgICAgICAgaW50IG9mZiA9IGdldExpbmVTdGFydChsaW5lKTsKLSAgICAgICAgaWYgKG9mZiA9PSAwIHx8IG1UZXh0LmNoYXJBdChvZmYgLSAxKSA9PSAnXG4nKQotICAgICAgICAgICAgcGFyID0gdHJ1ZTsKLQotCi0gICAgICAgIGlmIChkaXIgPT0gRElSX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgIGlmIChtU3Bhbm5lZFRleHQpIHsKLSAgICAgICAgICAgICAgICBTcGFubmVkIHNwID0gKFNwYW5uZWQpIG1UZXh0OwotICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuW10gc3BhbnMgPSBzcC5nZXRTcGFucyhnZXRMaW5lU3RhcnQobGluZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldExpbmVFbmQobGluZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuLmNsYXNzKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3BhbnMubGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgcmlnaHQgLT0gc3BhbnNbaV0uZ2V0TGVhZGluZ01hcmdpbihwYXIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKyAgICAgICAgaWYgKGRpciA9PSBESVJfTEVGVF9UT19SSUdIVCB8fCAhbVNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICByZXR1cm4gcmlnaHQ7IC8vIGxlYWRpbmcgbWFyZ2luIGhhcyBubyBpbXBhY3QsIG9yIG5vIHN0eWxlcwogICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHJpZ2h0OwotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZCBkcmF3VGV4dChDYW52YXMgY2FudmFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkaXIsIERpcmVjdGlvbnMgZGlyZWN0aW9ucywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgsIGludCB0b3AsIGludCB5LCBpbnQgYm90dG9tLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHBhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaGFzVGFicywgT2JqZWN0W10gcGFyc3BhbnMpIHsKLSAgICAgICAgY2hhcltdIGJ1ZjsKLSAgICAgICAgaWYgKCFoYXNUYWJzKSB7Ci0gICAgICAgICAgICBpZiAoZGlyZWN0aW9ucyA9PSBESVJTX0FMTF9MRUZUX1RPX1JJR0hUKSB7Ci0gICAgICAgICAgICAgICAgaWYgKERFQlVHKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnRUcnVlKERJUl9MRUZUX1RPX1JJR0hUID09IGRpcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0eWxlZC5kcmF3VGV4dChjYW52YXMsIHRleHQsIHN0YXJ0LCBlbmQsIGRpciwgZmFsc2UsIHgsIHRvcCwgeSwgYm90dG9tLCBwYWludCwgd29ya1BhaW50LCBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVmID0gbnVsbDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGJ1ZiA9IFRleHRVdGlscy5vYnRhaW4oZW5kIC0gc3RhcnQpOwotICAgICAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIHN0YXJ0LCBlbmQsIGJ1ZiwgMCk7Ci0gICAgICAgIH0KLQotICAgICAgICBmbG9hdCBoID0gMDsKLQotICAgICAgICBpbnQgaGVyZSA9IDA7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGlyZWN0aW9ucy5tRGlyZWN0aW9ucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgaW50IHRoZXJlID0gaGVyZSArIGRpcmVjdGlvbnMubURpcmVjdGlvbnNbaV07Ci0gICAgICAgICAgICBpZiAodGhlcmUgPiBlbmQgLSBzdGFydCkKLSAgICAgICAgICAgICAgICB0aGVyZSA9IGVuZCAtIHN0YXJ0OwotCi0gICAgICAgICAgICBpbnQgc2Vnc3RhcnQgPSBoZXJlOwotICAgICAgICAgICAgZm9yIChpbnQgaiA9IGhhc1RhYnMgPyBoZXJlIDogdGhlcmU7IGogPD0gdGhlcmU7IGorKykgewotICAgICAgICAgICAgICAgIGlmIChqID09IHRoZXJlIHx8IGJ1ZltqXSA9PSAnXHQnKSB7Ci0gICAgICAgICAgICAgICAgICAgIGggKz0gU3R5bGVkLmRyYXdUZXh0KGNhbnZhcywgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwgc3RhcnQgKyBqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXIsIChpICYgMSkgIT0gMCwgeCArIGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcCwgeSwgYm90dG9tLCBwYWludCwgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCArIGogIT0gZW5kKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoaiAhPSB0aGVyZSAmJiBidWZbal0gPT0gJ1x0JykKLSAgICAgICAgICAgICAgICAgICAgICAgIGggPSBkaXIgKiBuZXh0VGFiKHRleHQsIHN0YXJ0LCBlbmQsIGggKiBkaXIsIHBhcnNwYW5zKTsKLQotICAgICAgICAgICAgICAgICAgICBzZWdzdGFydCA9IGogKyAxOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaGFzVGFicyAmJiBidWZbal0gPj0gMHhEODAwICYmIGJ1ZltqXSA8PSAweERGRkYgJiYgaiArIDEgPCB0aGVyZSkgewotICAgICAgICAgICAgICAgICAgICBpbnQgZW1vamkgPSBDaGFyYWN0ZXIuY29kZVBvaW50QXQoYnVmLCBqKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZW1vamkgPj0gTUlOX0VNT0pJICYmIGVtb2ppIDw9IE1BWF9FTU9KSSkgewotICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwIGJtID0gRU1PSklfRkFDVE9SWS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRCaXRtYXBGcm9tQW5kcm9pZFB1YShlbW9qaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChibSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCArPSBTdHlsZWQuZHJhd1RleHQoY2FudmFzLCB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0ICsgc2Vnc3RhcnQsIHN0YXJ0ICsgaiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXIsIChpICYgMSkgIT0gMCwgeCArIGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wLCB5LCBib3R0b20sIHBhaW50LCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBqICE9IGVuZCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUVtb2ppUmVjdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1FbW9qaVJlY3QgPSBuZXcgUmVjdEYoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b3JrUGFpbnQuc2V0KHBhaW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBqLCBzdGFydCArIGogKyAxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBiaXRtYXBIZWlnaHQgPSBibS5nZXRIZWlnaHQoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB0ZXh0SGVpZ2h0ID0gLXdvcmtQYWludC5hc2NlbnQoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBzY2FsZSA9IHRleHRIZWlnaHQgLyBiaXRtYXBIZWlnaHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgd2lkdGggPSBibS5nZXRXaWR0aCgpICogc2NhbGU7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRW1vamlSZWN0LnNldCh4ICsgaCwgeSAtIHRleHRIZWlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCArIGggKyB3aWR0aCwgeSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChibSwgbnVsbCwgbUVtb2ppUmVjdCwgcGFpbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggKz0gd2lkdGg7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vnc3RhcnQgPSBqICsgMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaGVyZSA9IHRoZXJlOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGhhc1RhYnMpCi0gICAgICAgICAgICBUZXh0VXRpbHMucmVjeWNsZShidWYpOwotICAgIH0KLQotICAgIHByaXZhdGUgc3RhdGljIGZsb2F0IG1lYXN1cmVUZXh0KFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwgaW50IG9mZnNldCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGlyLCBEaXJlY3Rpb25zIGRpcmVjdGlvbnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiB0cmFpbGluZywgYm9vbGVhbiBhbHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBoYXNUYWJzLCBPYmplY3RbXSB0YWJzKSB7Ci0gICAgICAgIGNoYXJbXSBidWYgPSBudWxsOwotCi0gICAgICAgIGlmIChoYXNUYWJzKSB7Ci0gICAgICAgICAgICBidWYgPSBUZXh0VXRpbHMub2J0YWluKGVuZCAtIHN0YXJ0KTsKLSAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBzdGFydCwgZW5kLCBidWYsIDApOwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgaCA9IDA7Ci0KLSAgICAgICAgaWYgKGFsdCkgewotICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICB0cmFpbGluZyA9ICF0cmFpbGluZzsKLSAgICAgICAgfQotCi0gICAgICAgIGludCBoZXJlID0gMDsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaXJlY3Rpb25zLm1EaXJlY3Rpb25zLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBpZiAoYWx0KQotICAgICAgICAgICAgICAgIHRyYWlsaW5nID0gIXRyYWlsaW5nOwotCi0gICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgZGlyZWN0aW9ucy5tRGlyZWN0aW9uc1tpXTsKLSAgICAgICAgICAgIGlmICh0aGVyZSA+IGVuZCAtIHN0YXJ0KQotICAgICAgICAgICAgICAgIHRoZXJlID0gZW5kIC0gc3RhcnQ7Ci0KLSAgICAgICAgICAgIGludCBzZWdzdGFydCA9IGhlcmU7Ci0gICAgICAgICAgICBmb3IgKGludCBqID0gaGFzVGFicyA/IGhlcmUgOiB0aGVyZTsgaiA8PSB0aGVyZTsgaisrKSB7Ci0gICAgICAgICAgICAgICAgaW50IGNvZGVwdCA9IDA7Ci0gICAgICAgICAgICAgICAgQml0bWFwIGJtID0gbnVsbDsKLQotICAgICAgICAgICAgICAgIGlmIChoYXNUYWJzICYmIGogPCB0aGVyZSkgewotICAgICAgICAgICAgICAgICAgICBjb2RlcHQgPSBidWZbal07Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA+PSAweEQ4MDAgJiYgY29kZXB0IDw9IDB4REZGRiAmJiBqICsgMSA8IHRoZXJlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvZGVwdCA9IENoYXJhY3Rlci5jb2RlUG9pbnRBdChidWYsIGopOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPj0gTUlOX0VNT0pJICYmIGNvZGVwdCA8PSBNQVhfRU1PSkkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gRU1PSklfRkFDVE9SWS5nZXRCaXRtYXBGcm9tQW5kcm9pZFB1YShjb2RlcHQpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGogPT0gdGhlcmUgfHwgY29kZXB0ID09ICdcdCcgfHwgYm0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBmbG9hdCBzZWd3OwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPCBzdGFydCArIGogfHwKLSAgICAgICAgICAgICAgICAgICAgICAgKHRyYWlsaW5nICYmIG9mZnNldCA8PSBzdGFydCArIGopKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUICYmIChpICYgMSkgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggKz0gU3R5bGVkLm1lYXN1cmVUZXh0KHBhaW50LCB3b3JrUGFpbnQsIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwgb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUICYmIChpICYgMSkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gU3R5bGVkLm1lYXN1cmVUZXh0KHBhaW50LCB3b3JrUGFpbnQsIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwgb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgc2VndyA9IFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgd29ya1BhaW50LCB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0ICsgc2Vnc3RhcnQsIHN0YXJ0ICsgaiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAob2Zmc2V0IDwgc3RhcnQgKyBqIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAodHJhaWxpbmcgJiYgb2Zmc2V0IDw9IHN0YXJ0ICsgaikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBoICs9IHNlZ3cgLSBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LCBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gc2VndyAtIFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCArIHNlZ3N0YXJ0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gc2VndzsKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgaCArPSBzZWd3OwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChqICE9IHRoZXJlICYmIGJ1ZltqXSA9PSAnXHQnKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAob2Zmc2V0ID09IHN0YXJ0ICsgaikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGRpciAqIG5leHRUYWIodGV4dCwgc3RhcnQsIGVuZCwgaCAqIGRpciwgdGFicyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoaiAhPSB0aGVyZSAmJiBibSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAob2Zmc2V0ID09IHN0YXJ0ICsgaikgcmV0dXJuIGg7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3b3JrUGFpbnQuc2V0KHBhaW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgd29ya1BhaW50LCB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGosIGogKyAyLCBudWxsKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgd2lkID0gKGZsb2F0KSBibS5nZXRXaWR0aCgpICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC13b3JrUGFpbnQuYXNjZW50KCkgLyBibS5nZXRIZWlnaHQoKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gd2lkOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBoICs9IHdpZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaisrOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgc2Vnc3RhcnQgPSBqICsgMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGhlcmUgPSB0aGVyZTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChoYXNUYWJzKQotICAgICAgICAgICAgVGV4dFV0aWxzLnJlY3ljbGUoYnVmKTsKLQotICAgICAgICByZXR1cm4gaDsKKyAgICAgICAgcmV0dXJuIHJpZ2h0IC0gZ2V0UGFyYWdyYXBoTGVhZGluZ01hcmdpbihsaW5lKTsKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBNZWFzdXJlIHdpZHRoIG9mIGEgcnVuIG9mIHRleHQgb24gYSBzaW5nbGUgbGluZSB0aGF0IGlzIGtub3duIHRvIGFsbCBiZQotICAgICAqIGluIHRoZSBzYW1lIGRpcmVjdGlvbiBhcyB0aGUgcGFyYWdyYXBoIGJhc2UgZGlyZWN0aW9uLiBSZXR1cm5zIHRoZSB3aWR0aCwKLSAgICAgKiBhbmQg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ICAgICAgICAgICAgICAgICAgIFRleHRQYWludCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LCBpbnQgZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhaW50LkZvbnRNZXRyaWNzSW50IGZtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaGFzVGFicywgT2JqZWN0W10gdGFicykgewotICAgICAgICBjaGFyW10gYnVmID0gbnVsbDsKLSAgCi0gICAgICAgIGlmIChoYXNUYWJzKSB7Ci0gICAgICAgICAgICBidWYgPSBUZXh0VXRpbHMub2J0YWluKGVuZCAtIHN0YXJ0KTsKLSAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBzdGFydCwgZW5kLCBidWYsIDApOworICAgIHByaXZhdGUgaW50IGdldFBhcmFncmFwaExlYWRpbmdNYXJnaW4oaW50IGxpbmUpIHsKKyAgICAgICAgaWYgKCFtU3Bhbm5lZFRleHQpIHsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgICAgIFNwYW5uZWQgc3Bhbm5lZCA9IChTcGFubmVkKSBtVGV4dDsKKworICAgICAgICBpbnQgbGluZVN0YXJ0ID0gZ2V0TGluZVN0YXJ0KGxpbmUpOworICAgICAgICBpbnQgbGluZUVuZCA9IGdldExpbmVFbmQobGluZSk7CisgICAgICAgIGludCBzcGFuRW5kID0gc3Bhbm5lZC5uZXh0U3BhblRyYW5zaXRpb24obGluZVN0YXJ0LCBsaW5lRW5kLAorICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuLmNsYXNzKTsKKyAgICAgICAgTGVhZGluZ01hcmdpblNwYW5bXSBzcGFucyA9IGdldFBhcmFncmFwaFNwYW5zKHNwYW5uZWQsIGxpbmVTdGFydCwgc3BhbkVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuLmNsYXNzKTsKKyAgICAgICAgaWYgKHNwYW5zLmxlbmd0aCA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gMDsgLy8gbm8gbGVhZGluZyBtYXJnaW4gc3BhbjsKICAgICAgICAgfQogCi0gICAgICAgIGludCBsZW4gPSBlbmQgLSBzdGFydDsKKyAgICAgICAgaW50IG1hcmdpbiA9IDA7CiAKLSAgICAgICAgaW50IGxhc3RQb3MgPSAwOwotICAgICAgICBmbG9hdCB3aWR0aCA9IDA7Ci0gICAgICAgIGludCBhc2NlbnQgPSAwLCBkZXNjZW50ID0gMCwgdG9wID0gMCwgYm90dG9tID0gMDsKKyAgICAgICAgYm9vbGVhbiBpc0ZpcnN0UGFyYUxpbmUgPSBsaW5lU3RhcnQgPT0gMCB8fAorICAgICAgICAgICAgc3Bhbm5lZC5jaGFyQXQobGluZVN0YXJ0IC0gMSkgPT0gJ1xuJzsKIAotICAgICAgICBpZiAoZm0gIT0gbnVsbCkgewotICAgICAgICAgICAgZm0uYXNjZW50ID0gMDsKLSAgICAgICAgICAgIGZtLmRlc2NlbnQgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpbnQgcG9zID0gaGFzVGFicyA/IDAgOiBsZW47IHBvcyA8PSBsZW47IHBvcysrKSB7Ci0gICAgICAgICAgICBpbnQgY29kZXB0ID0gMDsKLSAgICAgICAgICAgIEJpdG1hcCBibSA9IG51bGw7Ci0KLSAgICAgICAgICAgIGlmIChoYXNUYWJzICYmIHBvcyA8IGxlbikgewotICAgICAgICAgICAgICAgIGNvZGVwdCA9IGJ1Zltwb3NdOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNwYW5zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3BhbiBzcGFuID0gc3BhbnNbaV07CisgICAgICAgICAgICBib29sZWFuIHVzZUZpcnN0TGluZU1hcmdpbiA9IGlzRmlyc3RQYXJhTGluZTsKKyAgICAgICAgICAgIGlmIChzcGFuIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4yKSB7CisgICAgICAgICAgICAgICAgaW50IHNwU3RhcnQgPSBzcGFubmVkLmdldFNwYW5TdGFydChzcGFuKTsKKyAgICAgICAgICAgICAgICBpbnQgc3BhbkxpbmUgPSBnZXRMaW5lRm9yT2Zmc2V0KHNwU3RhcnQpOworICAgICAgICAgICAgICAgIGludCBjb3VudCA9ICgoTGVhZGluZ01hcmdpblNwYW4yKXNwYW4pLmdldExlYWRpbmdNYXJnaW5MaW5lQ291bnQoKTsKKyAgICAgICAgICAgICAgICB1c2VGaXJzdExpbmVNYXJnaW4gPSBsaW5lIDwgc3BhbkxpbmUgKyBjb3VudDsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1hcmdpbiArPSBzcGFuLmdldExlYWRpbmdNYXJnaW4odXNlRmlyc3RMaW5lTWFyZ2luKTsKKyAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAoY29kZXB0ID49IDB4RDgwMCAmJiBjb2RlcHQgPD0gMHhERkZGICYmIHBvcyA8IGxlbikgewotICAgICAgICAgICAgICAgIGNvZGVwdCA9IENoYXJhY3Rlci5jb2RlUG9pbnRBdChidWYsIHBvcyk7CisgICAgICAgIHJldHVybiBtYXJnaW47CisgICAgfQogCi0gICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA+PSBNSU5fRU1PSkkgJiYgY29kZXB0IDw9IE1BWF9FTU9KSSkgewotICAgICAgICAgICAgICAgICAgICBibSA9IEVNT0pJX0ZBQ1RPUlkuZ2V0Qml0bWFwRnJvbUFuZHJvaWRQdWEoY29kZXB0KTsKKyAgICAvKiBwYWNrYWdlICovCisgICAgc3RhdGljIGZsb2F0IG1lYXN1cmVQYXJhKFRleHRQYWludCBwYWludCwgVGV4dFBhaW50IHdvcmtQYWludCwKKyAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQpIHsKKworICAgICAgICBNZWFzdXJlZFRleHQgbXQgPSBNZWFzdXJlZFRleHQub2J0YWluKCk7CisgICAgICAgIFRleHRMaW5lIHRsID0gVGV4dExpbmUub2J0YWluKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtdC5zZXRQYXJhKHRleHQsIHN0YXJ0LCBlbmQsIERJUl9SRVFVRVNUX0xUUik7CisgICAgICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnM7CisgICAgICAgICAgICBpbnQgZGlyOworICAgICAgICAgICAgaWYgKG10Lm1FYXN5KSB7CisgICAgICAgICAgICAgICAgZGlyZWN0aW9ucyA9IERJUlNfQUxMX0xFRlRfVE9fUklHSFQ7CisgICAgICAgICAgICAgICAgZGlyID0gTGF5b3V0LkRJUl9MRUZUX1RPX1JJR0hUOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBkaXJlY3Rpb25zID0gQW5kcm9pZEJpZGkuZGlyZWN0aW9ucyhtdC5tRGlyLCBtdC5tTGV2ZWxzLAorICAgICAgICAgICAgICAgICAgICAwLCBtdC5tQ2hhcnMsIDAsIG10Lm1MZW4pOworICAgICAgICAgICAgICAgIGRpciA9IG10Lm1EaXI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjaGFyW10gY2hhcnMgPSBtdC5tQ2hhcnM7CisgICAgICAgICAgICBpbnQgbGVuID0gbXQubUxlbjsKKyAgICAgICAgICAgIGJvb2xlYW4gaGFzVGFicyA9IGZhbHNlOworICAgICAgICAgICAgVGFiU3RvcHMgdGFiU3RvcHMgPSBudWxsOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47ICsraSkgeworICAgICAgICAgICAgICAgIGlmIChjaGFyc1tpXSA9PSAnXHQnKSB7CisgICAgICAgICAgICAgICAgICAgIGhhc1RhYnMgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBpZiAodGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgc3Bhbm5lZCA9IChTcGFubmVkKSB0ZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNwYW5FbmQgPSBzcGFubmVkLm5leHRTcGFuVHJhbnNpdGlvbihzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBUYWJTdG9wU3BhbltdIHNwYW5zID0gZ2V0UGFyYWdyYXBoU3BhbnMoc3Bhbm5lZCwgc3RhcnQsIHNwYW5FbmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRhYlN0b3BTcGFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcGFucy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFiU3RvcHMgPSBuZXcgVGFiU3RvcHMoVEFCX0lOQ1JFTUVOVCwgc3BhbnMpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHRsLnNldChwYWludCwgdGV4dCwgc3RhcnQsIGVuZCwgZGlyLCBkaXJlY3Rpb25zLCBoYXNUYWJzLCB0YWJTdG9wcyk7CisgICAgICAgICAgICByZXR1cm4gdGwubWV0cmljcyhudWxsKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIFRleHRMaW5lLnJlY3ljbGUodGwpOworICAgICAgICAgICAgTWVhc3VyZWRUZXh0LnJlY3ljbGUobXQpOworICAgICAgICB9CisgICAgfQogCi0gICAgICAgICAgICBpZiAocG9zID09IGxlbiB8fCBjb2RlcHQgPT0gJ1x0JyB8fCBibSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgd29ya1BhaW50LmJhc2VsaW5lU2hpZnQgPSAwOworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgLyogcGFja2FnZSAqLyBzdGF0aWMgY2xhc3MgVGFiU3RvcHMgeworICAgICAgICBwcml2YXRlIGludFtdIG1TdG9wczsKKyAgICAgICAgcHJpdmF0ZSBpbnQgbU51bVN0b3BzOworICAgICAgICBwcml2YXRlIGludCBtSW5jcmVtZW50OwogCi0gICAgICAgICAgICAgICAgd2lkdGggKz0gU3R5bGVkLm1lYXN1cmVUZXh0KHBhaW50LCB3b3JrUGFpbnQsIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBsYXN0UG9zLCBzdGFydCArIHBvcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbSk7CisgICAgICAgIFRhYlN0b3BzKGludCBpbmNyZW1lbnQsIE9iamVjdFtdIHNwYW5zKSB7CisgICAgICAgICAgICByZXNldChpbmNyZW1lbnQsIHNwYW5zKTsKKyAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgaWYgKGZtICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHdvcmtQYWludC5iYXNlbGluZVNoaWZ0IDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZm0uYXNjZW50ICs9IHdvcmtQYWludC5iYXNlbGluZVNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgZm0udG9wICs9IHdvcmtQYWludC5iYXNlbGluZVNoaWZ0OwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgZm0uZGVzY2VudCArPSB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZtLmJvdHRvbSArPSB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgdm9pZCByZXNldChpbnQgaW5jcmVtZW50LCBPYmplY3RbXSBzcGFucykgeworICAgICAgICAgICAgdGhpcy5tSW5jcmVtZW50ID0gaW5jcmVtZW50OworCisgICAgICAgICAgICBpbnQgbnMgPSAwOworICAgICAgICAgICAgaWYgKHNwYW5zICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpbnRbXSBzdG9wcyA9IHRoaXMubVN0b3BzOworICAgICAgICAgICAgICAgIGZvciAoT2JqZWN0IG8gOiBzcGFucykgeworICAgICAgICAgICAgICAgICAgICBpZiAobyBpbnN0YW5jZW9mIFRhYlN0b3BTcGFuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RvcHMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3BzID0gbmV3IGludFsxMF07CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG5zID09IHN0b3BzLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludFtdIG5zdG9wcyA9IG5ldyBpbnRbbnMgKiAyXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG5zOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnN0b3BzW2ldID0gc3RvcHNbaV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3BzID0gbnN0b3BzOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc3RvcHNbbnMrK10gPSAoKFRhYlN0b3BTcGFuKSBvKS5nZXRUYWJTdG9wKCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAocG9zICE9IGxlbikgewotICAgICAgICAgICAgICAgICAgICBpZiAoYm0gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm8gZW1vamksIG11c3QgaGF2ZSBoaXQgYSB0YWIKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoID0gbmV4dFRhYih0ZXh0LCBzdGFydCwgZW5kLCB3aWR0aCwgdGFicyk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIHNldHMgdXAgd29ya1BhaW50IHdpdGggdGhlIGZvbnQgb24gdGhlIGVtb2ppCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB0ZXh0LCBzbyB0aGF0IHdlIGNhbiBleHRyYWN0IHRoZSBhc2NlbnQgYW5kIHNjYWxlLgotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBjYW4ndCB1c2UgdGhlIHJlc3VsdCBvZiB0aGUgcHJldmlvdXMgY2FsbCB0bwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWVhc3VyZVRleHQgYmVjYXVzZSB0aGUgZW1vamkgbWlnaHQgaGF2ZSBpdHMgb3duIHN0eWxlLgotICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgaGF2ZSB0byBpbml0aWFsaXplIHdvcmtQYWludCBoZXJlIGJlY2F1c2UgaWYgdGhlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB0ZXh0IGlzIHVuc3R5bGVkIG1lYXN1cmVUZXh0IG1pZ2h0IG5vdCB1c2Ugd29ya1BhaW50Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBhdCBhbGwuCi0gICAgICAgICAgICAgICAgICAgICAgICB3b3JrUGFpbnQuc2V0KHBhaW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgd29ya1BhaW50LCB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0ICsgcG9zLCBzdGFydCArIHBvcyArIDEsIG51bGwpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCArPSAoZmxvYXQpIGJtLmdldFdpZHRoKCkgKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLXdvcmtQYWludC5hc2NlbnQoKSAvIGJtLmdldEhlaWdodCgpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBTaW5jZSB3ZSBoYWQgYW4gZW1vamksIHdlIGJ1bXAgcGFzdCB0aGUgc2Vjb25kIGhhbGYKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9mIHRoZSBzdXJyb2dhdGUgcGFpci4KLSAgICAgICAgICAgICAgICAgICAgICAgIHBvcysrOwotICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG5zID4gMSkgeworICAgICAgICAgICAgICAgICAgICBBcnJheXMuc29ydChzdG9wcywgMCwgbnMpOwogICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChmbSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmbS5hc2NlbnQgPCBhc2NlbnQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFzY2VudCA9IGZtLmFzY2VudDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoZm0uZGVzY2VudCA+IGRlc2NlbnQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NlbnQgPSBmbS5kZXNjZW50OwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGZtLnRvcCA8IHRvcCkgewotICAgICAgICAgICAgICAgICAgICAgICAgdG9wID0gZm0udG9wOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmbS5ib3R0b20gPiBib3R0b20pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJvdHRvbSA9IGZtLmJvdHRvbTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIC8vIE5vIG5lZWQgdG8gdGFrZSBiaXRtYXAgaGVpZ2h0IGludG8gYWNjb3VudCBoZXJlLAotICAgICAgICAgICAgICAgICAgICAvLyBzaW5jZSBpdCBpcyBzY2FsZWQgdG8gbWF0Y2ggdGhlIHRleHQgaGVpZ2h0LgorICAgICAgICAgICAgICAgIGlmIChzdG9wcyAhPSB0aGlzLm1TdG9wcykgeworICAgICAgICAgICAgICAgICAgICB0aGlzLm1TdG9wcyA9IHN0b3BzOwogICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGxhc3RQb3MgPSBwb3MgKyAxOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgdGhpcy5tTnVtU3RvcHMgPSBuczsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChmbSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmbS5hc2NlbnQgPSBhc2NlbnQ7Ci0gICAgICAgICAgICBmbS5kZXNjZW50ID0gZGVzY2VudDsKLSAgICAgICAgICAgIGZtLnRvcCA9IHRvcDsKLSAgICAgICAgICAgIGZtLmJvdHRvbSA9IGJvdHRvbTsKKyAgICAgICAgZmxvYXQgbmV4dFRhYihmbG9hdCBoKSB7CisgICAgICAgICAgICBpbnQgbnMgPSB0aGlzLm1OdW1TdG9wczsKKyAgICAgICAgICAgIGlmIChucyA+IDApIHsKKyAgICAgICAgICAgICAgICBpbnRbXSBzdG9wcyA9IHRoaXMubVN0b3BzOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnM7ICsraSkgeworICAgICAgICAgICAgICAgICAgICBpbnQgc3RvcCA9IHN0b3BzW2ldOworICAgICAgICAgICAgICAgICAgICBpZiAoc3RvcCA+IGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdG9wOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG5leHREZWZhdWx0U3RvcChoLCBtSW5jcmVtZW50KTsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChoYXNUYWJzKQotICAgICAgICAgICAgVGV4dFV0aWxzLnJlY3ljbGUoYnVmKTsKLQotICAgICAgICByZXR1cm4gd2lkdGg7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmxvYXQgbmV4dERlZmF1bHRTdG9wKGZsb2F0IGgsIGludCBpbmMpIHsKKyAgICAgICAgICAgIHJldHVybiAoKGludCkgKChoICsgaW5jKSAvIGluYykpICogaW5jOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC0xNzUxLDcgKzE1MTAsNyBAQAogCiAgICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgU3Bhbm5lZCkgewogICAgICAgICAgICAgaWYgKHRhYnMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRhYnMgPSAoKFNwYW5uZWQpIHRleHQpLmdldFNwYW5zKHN0YXJ0LCBlbmQsIFRhYlN0b3BTcGFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICB0YWJzID0gZ2V0UGFyYWdyYXBoU3BhbnMoKFNwYW5uZWQpIHRleHQsIHN0YXJ0LCBlbmQsIFRhYlN0b3BTcGFuLmNsYXNzKTsKICAgICAgICAgICAgICAgICBhbGx0YWJzID0gdHJ1ZTsKICAgICAgICAgICAgIH0KIApAQCAtMTc3OCw2ICsxNTM3LDM4IEBACiAgICAgICAgIHJldHVybiBtU3Bhbm5lZFRleHQ7CiAgICAgfQogCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgc2FtZSBhcyA8Y29kZT50ZXh0LmdldFNwYW5zKCk8L2NvZGU+LCBleGNlcHQgd2hlcmUKKyAgICAgKiA8Y29kZT5zdGFydDwvY29kZT4gYW5kIDxjb2RlPmVuZDwv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lYXN1cmVkVGV4dCBtdDsKKyAgICAgICAgc3luY2hyb25pemVkIChjYWNoZWQpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBjYWNoZWQubGVuZ3RoOyAtLWkgPj0gMDspIHsKKyAgICAgICAgICAgICAgICBpZiAoY2FjaGVkW2ldICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbXQgPSBjYWNoZWRbaV07CisgICAgICAgICAgICAgICAgICAgIGNhY2hlZFtpXSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBtdDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbXQgPSBuZXcgTWVhc3VyZWRUZXh0KCk7CisgICAgICAgIExvZy5lKCJNRUFTIiwgIm5ldzogIiArIG10KTsKKyAgICAgICAgcmV0dXJuIG10OworICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8KKyAgICBzdGF0aWMgTWVhc3VyZWRUZXh0IHJlY3ljbGUoTWVhc3VyZWRUZXh0IG10KSB7CisgICAgICAgIG10Lm1UZXh0ID0gbnVsbDsKKyAgICAgICAgaWYgKG10Lm1MZW4gPCAxMDAwKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQoY2FjaGVkKSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjYWNoZWQubGVuZ3RoOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNhY2hlZFtpXSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZWRbaV0gPSBtdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIEFuYWx5emVzIHRleHQgZm9yIGJpZGlyZWN0aW9uYWwgcnVucy4gIEFsbG9jYXRlcyB3b3JraW5nIGJ1ZmZlcnMuCisgICAgICovCisgICAgLyogcGFja2FnZSAqLworICAgIHZvaWQgc2V0UGFyYShDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLCBpbnQgYmlkaVJlcXVlc3QpIHsKKyAgICAgICAgbVRleHQgPSB0ZXh0OworICAgICAgICBtVGV4dFN0YXJ0ID0gc3RhcnQ7CisKKyAgICAgICAgaW50IGxlbiA9IGVuZCAtIHN0YXJ0OworICAgICAgICBtTGVuID0gbGVuOworICAgICAgICBtUG9zID0gMDsKKworICAgICAgICBpZiAobVdpZHRocyA9PSBudWxsIHx8IG1XaWR0aHMubGVuZ3RoIDwgbGVuKSB7CisgICAgICAgICAgICBtV2lkdGhzID0gbmV3IGZsb2F0W0FycmF5VXRpbHMuaWRlYWxGbG9hdEFycmF5U2l6ZShsZW4pXTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUNoYXJzID09IG51bGwgfHwgbUNoYXJzLmxlbmd0aCA8IGxlbikgeworICAgICAgICAgICAgbUNoYXJzID0gbmV3IGNoYXJbQXJyYXlVdGlscy5pZGVhbENoYXJBcnJheVNpemUobGVuKV07CisgICAgICAgIH0KKyAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIHN0YXJ0LCBlbmQsIG1DaGFycywgMCk7CisKKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBTcGFubmVkKSB7CisgICAgICAgICAgICBTcGFubmVkIHNwYW5uZWQgPSAoU3Bhbm5lZCkgdGV4dDsKKyAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbltdIHNwYW5zID0gc3Bhbm5lZC5nZXRTcGFucyhzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBSZXBsYWNlbWVudFNwYW4uY2xhc3MpOworCisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNwYW5zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgaW50IHN0YXJ0SW5QYXJhID0gc3Bhbm5lZC5nZXRTcGFuU3RhcnQoc3BhbnNbaV0pIC0gc3RhcnQ7CisgICAgICAgICAgICAgICAgaW50IGVuZEluUGFyYSA9IHNwYW5uZWQuZ2V0U3BhbkVuZChzcGFuc1tpXSkgLSBzdGFydDsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gc3RhcnRJblBhcmE7IGogPCBlbmRJblBhcmE7IGorKykgeworICAgICAgICAgICAgICAgICAgICBtQ2hhcnNbal0gPSAnXHVGRkZDJzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoVGV4dFV0aWxzLmRvZXNOb3ROZWVkQmlkaShtQ2hhcnMsIDAsIGxlbikpIHsKKyAgICAgICAgICAgIG1EaXIgPSBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQ7CisgICAgICAgICAgICBtRWFzeSA9IHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAobUxldmVscyA9PSBudWxsIHx8IG1MZXZlbHMubGVuZ3RoIDwgbGVuKSB7CisgICAgICAgICAgICAgICAgbUxldmVscyA9IG5ldyBieXRlW0FycmF5VXRpbHMuaWRlYWxCeXRlQXJyYXlTaXplKGxlbildOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbURpciA9IEFuZHJvaWRCaWRpLmJpZGkoYmlkaVJlcXVlc3QsIG1DaGFycywgbUxldmVscywgbGVuLCBmYWxzZSk7CisgICAgICAgICAgICBtRWFzeSA9IGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgZmxvYXQgYWRkU3R5bGVSdW4oVGV4dFBhaW50IHBhaW50LCBpbnQgbGVuLCBQYWludC5Gb250TWV0cmljc0ludCBmbSkgeworICAgICAgICBpZiAoZm0gIT0gbnVsbCkgeworICAgICAgICAgICAgcGFpbnQuZ2V0Rm9udE1ldHJpY3NJbnQoZm0pOworICAgICAgICB9CisKKyAgICAgICAgaW50IHAgPSBtUG9zOworICAgICAgICBtUG9zID0gcCArIGxlbjsKKworICAgICAgICBpZiAobUVhc3kpIHsKKyAgICAgICAgICAgIGludCBmbGFncyA9IG1EaXIgPT0gTGF5b3V0LkRJUl9MRUZUX1RPX1JJR0hUCisgICAgICAgICAgICAgICAgPyBDYW52YXMuRElSRUNUSU9OX0xUUiA6IENhbnZhcy5ESVJFQ1RJT05fUlRMOworICAgICAgICAgICAgcmV0dXJuIHBhaW50LmdldFRleHRSdW5BZHZhbmNlcyhtQ2hhcnMsIHAsIGxlbiwgcCwgbGVuLCBmbGFncywgbVdpZHRocywgcCk7CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCB0b3RhbEFkdmFuY2UgPSAwOworICAgICAgICBpbnQgbGV2ZWwgPSBtTGV2ZWxzW3BdOworICAgICAgICBmb3IgKGludCBxID0gcCwgaSA9IHAgKyAxLCBlID0gcCArIGxlbjs7ICsraSkgeworICAgICAgICAgICAgaWYgKGkgPT0gZSB8fCBtTGV2ZWxzW2ldICE9IGxldmVsKSB7CisgICAgICAgICAgICAgICAgaW50IGZsYWdzID0gKGxldmVsICYgMHgxKSA9PSAwID8gQ2FudmFzLkRJUkVDVElPTl9MVFIgOiBDYW52YXMuRElSRUNUSU9OX1JUTDsKKyAgICAgICAgICAgICAgICB0b3RhbEFkdmFuY2UgKz0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldFRleHRSdW5BZHZhbmNlcyhtQ2hhcnMsIHEsIGkgLSBxLCBxLCBpIC0gcSwgZmxhZ3MsIG1XaWR0aHMsIHEpOworICAgICAgICAgICAgICAgIGlmIChpID09IGUpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHEgPSBpOworICAgICAgICAgICAgICAgIGxldmVsID0gbUxldmVsc1tpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdG90YWxBZHZhbmNlOworICAgIH0KKworICAgIGZsb2F0IGFkZFN0eWxlUnVuKFRleHRQYWludCBwYWludCwgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zLCBpbnQgbGVuLAorICAgICAgICAgICAgUGFpbnQuRm9udE1ldHJpY3NJbnQgZm0pIHsKKworICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50ID0gbVdvcmtQYWludDsKKyAgICAgICAgd29ya1BhaW50LnNldChwYWludCk7CisgICAgICAgIC8vIFhYWCBwYWludCBzaG91bGQgbm90IGhhdmUgYSBiYXNlbGluZSBzaGlmdCwgYnV0Li4uCisgICAgICAgIHdvcmtQYWludC5iYXNlbGluZVNoaWZ0ID0gMDsKKworICAgICAgICBSZXBsYWNlbWVudFNwYW4gcmVwbGFjZW1lbnQgPSBudWxsOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNwYW5zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuIHNwYW4gPSBzcGFuc1tpXTsKKyAgICAgICAgICAgIGlmIChzcGFuIGluc3RhbmNlb2YgUmVwbGFjZW1lbnRTcGFuKSB7CisgICAgICAgICAgICAgICAgcmVwbGFjZW1lbnQgPSAoUmVwbGFjZW1lbnRTcGFuKXNwYW47CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNwYW4udXBkYXRlTWVhc3VyZVN0YXRlKHdvcmtQYWludCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCB3aWQ7CisgICAgICAgIGlmIChyZXBsYWNlbWVudCA9PSBudWxsKSB7CisgICAgICAgICAgICB3aWQgPSBhZGRTdHlsZVJ1bih3b3JrUGFpbnQsIGxlbiwgZm0pOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVXNlIG9yaWdpbmFsIHRleHQuICBTaG91bGRuJ3QgbWF0dGVyLgorICAgICAgICAgICAgd2lkID0gcmVwbGFjZW1lbnQuZ2V0U2l6ZSh3b3JrUGFpbnQsIG1UZXh0LCBtVGV4dFN0YXJ0ICsgbVBvcywKKyAgICAgICAgICAgICAgICAgICAgbVRleHRTdGFydCArIG1Qb3MgKyBsZW4sIGZtKTsKKyAgICAgICAgICAgIGZsb2F0W10gdyA9IG1XaWR0aHM7CisgICAgICAgICAgICB3W21Qb3NdID0gd2lkOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1Qb3MgKyAxLCBlID0gbVBvcyArIGxlbjsgaSA8IGU7IGkrKykKKyAgICAgICAgICAgICAgICB3W2ldID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChmbSAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAod29ya1BhaW50LmJhc2VsaW5lU2hpZnQgPCAwKSB7CisgICAgICAgICAgICAgICAgZm0uYXNjZW50ICs9IHdvcmtQYWludC5iYXNlbGluZVNoaWZ0OworICAgICAgICAgICAgICAgIGZtLnRvcCArPSB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZm0uZGVzY2VudCArPSB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgICAgICAgICBmbS5ib3R0b20gKz0gd29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gd2lkOworICAgIH0KKworICAgIGludCBicmVha1RleHQoaW50IHN0YXJ0LCBpbnQgbGltaXQsIGJvb2xlYW4gZm9yd2FyZHMsIGZsb2F0IHdpZHRoKSB7CisgICAgICAgIGZsb2F0W10gdyA9IG1XaWR0aHM7CisgICAgICAgIGlmIChmb3J3YXJkcykgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0OyBpIDwgbGltaXQ7ICsraSkgeworICAgICAgICAgICAgICAgIGlmICgod2lkdGggLT0gd1tpXSkgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBpIC0gc3RhcnQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGxpbWl0OyAtLWkgPj0gc3RhcnQ7KSB7CisgICAgICAgICAgICAgICAgaWYgKCh3aWR0aCAtPSB3W2ldKSA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpbWl0IC0gaSAtMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbGltaXQgLSBzdGFydDsKKyAgICB9CisKKyAgICBmbG9hdCBtZWFzdXJlKGludCBzdGFydCwgaW50IGxpbWl0KSB7CisgICAgICAgIGZsb2F0IHdpZHRoID0gMDsKKyAgICAgICAgZmxvYXRbXSB3ID0gbVdpZHRoczsKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0OyBpIDwgbGltaXQ7ICsraSkgeworICAgICAgICAgICAgd2lkdGggKz0gd1tpXTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gd2lkdGg7CisgICAgfQorfQpcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvU3Bhbm5hYmxlU3RyaW5nQnVpbGRlci5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9TcGFubmFibGVTdHJpbmdCdWlsZGVyLmphdmEKaW5kZXggY2FhYWZhMS4uZmMwMWVmMiAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9TcGFubmFibGVTdHJpbmdCdWlsZGVyLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9TcGFubmFibGVTdHJpbmdCdWlsZGVyLmphdmEKQEAgLTE3LDggKzE3LDkgQEAKIHBhY2thZ2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IGlmIChtR2FwTGVuZ3RoIDwgMSkKICAgICAgICAgICAgIG5ldyBFeGNlcHRpb24oIm1HYXBMZW5ndGggPCAxIikucHJpbnRTdGFja1RyYWNlKCk7CkBAIC03MDcsNiArNzExLDcgQEAKICAgICAgKiB0aGUgc3BlY2lmaWVkIHJhbmdlIG9mIHRoZSBidWZmZXIuICBUaGUga2luZCBtYXkgYmUgT2JqZWN0LmNsYXNzIHRvIGdldAogICAgICAqIGEgbGlzdCBvZiBhbGwgdGhlIHNwYW5zIHJlZ2FyZGxlc3Mgb2YgdHlwZS4KICAgICAgKi8KKyAgICBAU3VwcHJlc3NXYXJuaW5ncygidW5jaGVja2VkIikKICAgICBwdWJsaWMgPFQ+IFRbXSBnZXRTcGFucyhpbnQgcXVlcnlTdGFydCwgaW50IHF1ZXJ5RW5kLCBDbGFzczxUPiBraW5kKSB7CiAgICAgICAgIGludCBzcGFuQ291bnQgPSBtU3BhbkNvdW50OwogICAgICAgICBPYmplY3RbXSBzcGFucyA9IG1TcGFuczsKQEAgLTcxNyw4ICs3MjIsOCBAQAogICAgICAgICBpbnQgZ2FwbGVuID0gbUdhcExlbmd0aDsKIAogICAgICAgICBpbnQgY291bnQgPSAwOwotICAgICAgICBPYmplY3RbXSByZXQgPSBudWxsOwotICAgICAgICBPYmplY3QgcmV0MSA9IG51bGw7CisgICAgICAgIFRbXSByZXQgPSBudWxsOworICAgICAgICBUIHJldDEgPSBudWxsOwogCiAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3BhbkNvdW50OyBpKyspIHsKICAgICAgICAgICAgIGludCBzcGFuU3RhcnQgPSBzdGFydHNbaV07CkBAIC03NTAsMTEgKzc1NSwxMyBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAoY291bnQgPT0gMCkgewotICAgICAgICAgICAgICAgIHJldDEgPSBzcGFuc1tpXTsKKyAgICAgICAgICAgICAgICAvLyBTYWZlIGNvbnZlcnNpb24gdGhhbmtzIHRvIHRoZSBpc0luc3RhbmNlIHRlc3QgYWJvdmUKKyAgICAgICAgICAgICAgICByZXQxID0gKFQpIHNwYW5zW2ldOwogICAgICAgICAgICAgICAgIGNvdW50Kys7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIGlmIChjb3VudCA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldCA9IChPYmplY3RbXSkgQXJyYXkubmV3SW5zdGFuY2Uoa2luZCwgc3BhbkNvdW50IC0gaSArIDEpOworICAgICAgICAgICAgICAgICAgICAvLyBTYWZlIGNvbnZlcnNpb24sIGJ1dCByZXF1aXJlcyBhIHN1cHByZXNzV2FybmluZworICAgICAgICAgICAgICAgICAgICByZXQgPSAoVFtdKSBBcnJheS5uZXdJbnN0YW5jZShraW5kLCBzcGFuQ291bnQgLSBpICsgMSk7CiAgICAgICAgICAgICAgICAgICAgIHJldFswXSA9IHJldDE7CiAgICAgICAgICAgICAgICAgfQogCkBAIC03NzEsMjkgKzc3OCwzMyBAQAogICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShyZXQsIGosIHJldCwgaiArIDEsIGNvdW50IC0gaik7Ci0gICAgICAgICAgICAgICAgICAgIHJldFtqXSA9IHNwYW5zW2ldOworICAgICAgICAgICAgICAgICAgICAvLyBTYWZlIGNvbnZlcnNpb24gdGhhbmtzIHRvIHRoZSBpc0luc3RhbmNlIHRlc3QgYWJvdmUKKyAgICAgICAgICAgICAgICAgICAgcmV0W2pdID0gKFQpIHNwYW5zW2ldOwogICAgICAgICAgICAgICAgICAgICBjb3VudCsrOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldFtjb3VudCsrXSA9IHNwYW5zW2ldOworICAgICAgICAgICAgICAgICAgICAvLyBTYWZlIGNvbnZlcnNpb24gdGhhbmtzIHRvIHRoZSBpc0luc3RhbmNlIHRlc3QgYWJvdmUKKyAgICAgICAgICAgICAgICAgICAgcmV0W2NvdW50KytdID0gKFQpIHNwYW5zW2ldOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQogCiAgICAgICAgIGlmIChjb3VudCA9PSAwKSB7Ci0gICAgICAgICAgICByZXR1cm4gKFRbXSkgQXJyYXlVdGlscy5lbXB0eUFycmF5KGtpbmQpOworICAgICAgICAgICAgcmV0dXJuIEFycmF5VXRpbHMuZW1wdHlBcnJheShraW5kKTsKICAgICAgICAgfQogICAgICAgICBpZiAoY291bnQgPT0gMSkgewotICAgICAgICAgICAgcmV0ID0gKE9iamVjdFtdKSBBcnJheS5uZXdJbnN0YW5jZShraW5kLCAxKTsKKyAgICAgICAgICAgIC8vIFNhZmUgY29udmVyc2lvbiwgYnV0IHJlcXVpcmVzIGEgc3VwcHJlc3NXYXJuaW5nCisgICAgICAgICAgICByZXQgPSAoVFtdKSBBcnJheS5uZXdJbnN0YW5jZShraW5kLCAxKTsKICAgICAgICAgICAgIHJldFswXSA9IHJldDE7Ci0gICAgICAgICAgICByZXR1cm4gKFRbXSkgcmV0OworICAgICAgICAgICAgcmV0dXJuIHJldDsKICAgICAgICAgfQogICAgICAgICBpZiAoY291bnQgPT0gcmV0Lmxlbmd0aCkgewotICAgICAgICAgICAgcmV0dXJuIChUW10pIHJldDsKKyAgICAgICAgICAgIHJldHVybiByZXQ7CiAgICAgICAgIH0KIAotICAgICAgICBPYmplY3RbXSBucmV0ID0gKE9iamVjdFtdKSBBcnJheS5uZXdJbnN0YW5jZShraW5kLCBjb3VudCk7CisgICAgICAgIC8vIFNhZmUgY29udmVyc2lvbiwgYnV0IHJlcXVpcmVzIGEgc3VwcHJlc3NXYXJuaW5nCisgICAgICAgIFRbXSBucmV0ID0gKFRbXSkgQXJyYXkubmV3SW5zdGFuY2Uoa2luZCwgY291bnQpOwogICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHJldCwgMCwgbnJldCwgMCwgY291bnQpOwotICAgICAgICByZXR1cm4gKFRbXSkgbnJldDsKKyAgICAgICAgcmV0dXJuIG5yZXQ7CiAgICAgfQogCiAgICAgLyoqCkBAIC04NjIsNiArODczLDcgQEAKICAgICAvKioKICAgICAgKiBSZXR1cm4gYSBTdHJpbmcgY29udGFpbmluZyBhIGNvcHkgb2YgdGhlIGNoYXJzIGluIHRoaXMgYnVmZmVyLgogICAgICAqLworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CiAgICAgICAgIGludCBsZW4gPSBsZW5ndGgoKTsKICAgICAgICAgY2hhcltdIGJ1ZiA9IG5ldyBjaGFyW2xlbl07CkBAIC05NTIsNiArOTY0LDcgQEAKICAgICAgICAgfQogICAgIH0KIAorLyoKICAgICBwcml2YXRlIGJvb2xlYW4gaXNwcmludChjaGFyIGMpIHsgLy8gWFhYCiAgICAgICAgIGlmIChjID49ICcgJyAmJiBjIDw9ICd+JykKICAgICAgICAgICAgIHJldHVybiB0cnVlOwpAQCAtOTU5LDcgKzk3Miw2IEBACiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogCi0vKgogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBzdGFydEZsYWcoaW50IGZsYWcpIHsKICAgICAgICAgcmV0dXJuIChmbGFnID4+IDQpICYgMHgwRjsKICAgICB9CkBAIC0xMDU0LDcgKzEwNjYsMzIgQEAKICAgICAgICAgfQogICAgIH0KIAorCiAgICAgLyoqCisgICAgICogRG9uJ3QgY2FsbCB0aGlzIHlvdXJzZWxmIC0tIGV4aXN0cyBmb3IgQ2FudmFzIHRvIHVzZSBpbnRlcm5hbGx5LgorICAgICAqIHtAaGlkZX0KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBkcmF3VGV4dFJ1bihDYW52YXMgYywgaW50IHN0YXJ0LCBpbnQgZW5kLAorICAgICAgICAgICAgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsCisgICAgICAgIC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GVybmFsbHkuCiAgICAgICoge0BoaWRlfQogICAgICAqLwpAQCAtMTEwMyw2ICsxMTQwLDU4IEBACiAgICAgICAgIHJldHVybiByZXQ7CiAgICAgfQogCisgICAgLyoqCisgICAgICogRG9uJ3QgY2FsbCB0aGlzIHlvdXJzZWxmIC0tIGV4aXN0cyBmb3IgUGFpbnQgdG8gdXNlIGludGVybmFsbHkuCisgICAgICoge0BoaWRlfQorICAgICAqLworICAgIHB1YmxpYyBmbG9hdCBnZXRUZXh0UnVuQWR2YW5jZXMoaW50IHN0YXJ0LCBpbnQgZW5kLCBpbnQgY29udGV4dFN0YXJ0LCBpbnQgY29udGV4dEVuZCwgaW50IGZsYWdzLAorICAgICAgICAgICAgZmxvYXRbXSBhZHZhbmNlcywgaW50IGFkdmFuY2VzUG9zLCBQYWludCBwKSB7CisKKyAgICAgICAgZmxvYXQgcmV0OworCisgICAgICAgIGludCBjb250ZXh0TGVuID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgaW50IGxlbiA9IGVuZCAtIHN0YXJ0OworCisgICAgICAgIGlmIChlbmQgPD0gbUdhcFN0YXJ0KSB7CisgICAgICAgICAgICByZXQgPSBwLmdldFRleHRSdW5BZHZhbmNlcyhtVGV4dCwgc3RhcnQsIGxlbiwgY29udGV4dFN0YXJ0LCBjb250ZXh0TGVuLAorICAgICAgICAgICAgICAgICAgICBmbGFncywgYWR2YW5jZXMsIGFkdmFuY2VzUG9zKTsKKyAgICAgICAgfSBlbHNlIGlmIChzdGFydCA+PSBtR2FwU3RhcnQpIHsKKyAgICAgICAgICAgIHJldCA9IHAuZ2V0VGV4dFJ1bkFkdmFuY2VzKG1UZXh0LCBzdGFydCArIG1HYXBMZW5ndGgsIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0ICsgbUdhcExlbmd0aCwgY29udGV4dExlbiwgZmxhZ3MsIGFkdmFuY2VzLCBhZHZhbmNlc1Bvcyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBjaGFyW10gYnVmID0gVGV4dFV0aWxzLm9idGFpbihjb250ZXh0TGVuKTsKKyAgICAgICAgICAgIGdldENoYXJzKGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgYnVmLCAwKTsKKyAgICAgICAgICAgIHJldCA9IHAuZ2V0VGV4dFJ1bkFkdmFuY2VzKGJ1Ziwgc3RhcnQgLSBjb250ZXh0U3RhcnQsIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgMCwgY29udGV4dExlbiwgZmxhZ3MsIGFkdmFuY2VzLCBhZHZhbmNlc1Bvcyk7CisgICAgICAgICAgICBUZXh0VXRpbHMucmVjeWNsZShidWYpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFRleHRSdW5DdXJzb3IoaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsIGludCBmbGFncywgaW50IG9mZnNldCwKKyAgICAgICAgICAgIGludCBjdXJzb3JPcHQsIFBhaW50IHApIHsKKworICAgICAgICBpbnQgcmV0OworCisgICAgICAgIGludCBjb250ZXh0TGVuID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgaWYgKGNvbnRleHRFbmQgPD0gbUdhcFN0YXJ0KSB7CisgICAgICAgICAgICByZXQgPSBwLmdldFRleHRSdW5DdXJzb3IobVRleHQsIGNvbnRleHRTdGFydCwgY29udGV4dExlbiwKKyAgICAgICAgICAgICAgICAgICAgZmxhZ3MsIG9mZnNldCwgY3Vyc29yT3B0KTsKKyAgICAgICAgfSBlbHNlIGlmIChjb250ZXh0U3RhcnQgPj0gbUdhcFN0YXJ0KSB7CisgICAgICAgICAgICByZXQgPSBwLmdldFRleHRSdW5DdXJzb3IobVRleHQsIGNvbnRleHRTdGFydCArIG1HYXBMZW5ndGgsIGNvbnRleHRMZW4sCisgICAgICAgICAgICAgICAgICAgIGZsYWdzLCBvZm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QYWludCkKKyAqIENhbnZhcy5kcmF3VGV4dCgpfSBkaXJlY3RseS48L3A+CiAgKi8KIHB1YmxpYyBjbGFzcwogU3RhdGljTGF5b3V0CkBAIC02Miw3ICs2NCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGluY2x1ZGVwYWQsCiAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0VXRpbHMuVHJ1bmNhdGVBdCBlbGxpcHNpemUsIGludCBlbGxpcHNpemVkV2lkdGgpIHsKICAgICAgICAgc3VwZXIoKGVsbGlwc2l6ZSA9PSBudWxsKQotICAgICAgICAgICAgICAgID8gc291cmNlIAorICAgICAgICAgICAgICAgID8gc291cmNlCiAgICAgICAgICAgICAgICAgOiAoc291cmNlIGluc3RhbmNlb2YgU3Bhbm5lZCkKICAgICAgICAgICAgICAgICAgICAgPyBuZXcgU3Bhbm5lZEVsbGlwc2l6ZXIoc291cmNlKQogICAgICAgICAgICAgICAgICAgICA6IG5ldyBFbGxpcHNpemVyKHNvdXJjZSksCkBAIC03Miw3ICs3NCw3IEBACiAgICAgICAgICAqIFRoaXMgaXMgYW5ub3lpbmcsIGJ1dCB3ZSBjYW4ndCByZWZlciB0byB0aGUgbGF5b3V0IHVudGlsCiAgICAgICAgICAqIHN1cGVyY2xhc3MgY29uc3RydWN0aW9uIGlzIGZpbmlzaGVkLCBhbmQgdGhlIHN1cGVyY2xhc3MKICAgICAgICAgICogY29uc3RydWN0b3Igd2FudHMgdGhlIHJlZmVyZW5jZSB0byB0aGUgZGlzcGxheSB0ZXh0LgotICAgICAgICAgKiAKKyAgICAgICAgICoKICAgICAgICAgICogVGhpcyB3aWxsIGJyZWFrIGlmIHRoZSBzdXBlcmNsYXNzIGNvbnN0cnVjdG9yIGV2ZXIgYWN0dWFsbHkKICAgICAgICAgICogY2FyZXMgYWJvdXQgdGhlIGNvbnRlbnQgaW5zdGVhZCBvZiBqdXN0IGhvbGRpbmcgdGhlIHJlZmVyZW5jZS4KICAgICAgICAgICovCkBAIC05NCwxMyArOTYsMTMgQEAKICAgICAgICAgbUxpbmVEaXJlY3Rpb25zID0gbmV3IERpcmVjdGlvbnNbCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5VXRpbHMuaWRlYWxJbnRBcnJheVNpemUoMiAqIG1Db2x1bW5zKV07CiAKKyAgICAgICAgbU1lYXN1cmVkID0gTWVhc3VyZWRUZXh0Lm9idGFpbigpOworCiAgICAgICAgIGdlbmVyYXRlKHNvdXJjZSwgYnVmc3RhcnQsIGJ1ZmVuZCwgcGFpbnQsIG91dGVyd2lkdGgsIGFsaWduLAogICAgICAgICAgICAgICAgICBzcGFjaW5nbXVsdCwgc3BhY2luZ2FkZCwgaW5jbHVkZXBhZCwgaW5jbHVkZXBhZCwKICAgICAgICAgICAgICAgICAgZWxsaXBzaXplICE9IG51bGwsIGVsbGlwc2l6ZWRXaWR0aCwgZWxsaXBzaXplKTsKIAotICAgICAgICBtQ2hkaXJzID0gbnVsbDsKLSAgICAgICAgbUNocyA9IG51bGw7Ci0gICAgICAgIG1XaWR0aHMgPSBudWxsOworICAgICAgICBtTWVhc3VyZWQgPSBNZWFzdXJlZFRleHQucmVjeWNsZShtTWVhc3VyZWQpOwogICAgICAgICBtRm9udE1ldHJpY3NJbnQgPSBudWxsOwogICAgIH0KIApAQCAtMTExLDYgKzExMyw3IEBACiAgICAgICAgIG1MaW5lcyA9IG5ldyBpbnRbQXJyYXlVdGlscy5pZGVhbEludEFycmF5U2l6ZSgyICogbUNvbHVtbnMpXTsKICAgICAgICAgbUxpbmVEaXJlY3Rpb25zID0gbmV3IERpcmVjdGlvbnNbCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5VXRpbHMuaWRlYWxJbnRBcnJheVNpemUoMiAqIG1Db2x1bW5zKV07CisgICAgICAgIG1NZWFzdXJlZCA9IE1lYXN1cmVkVGV4dC5vYnRhaW4oKTsKICAgICB9CiAKICAgICAvKiBwYWNrYWdlICovIHZvaWQg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Bhbm5lZCA9IG51bGw7Ci0KICAgICAgICAgaWYgKHNvdXJjZSBpbnN0YW5jZW9mIFNwYW5uZWQpCiAgICAgICAgICAgICBzcGFubmVkID0gKFNwYW5uZWQpIHNvdXJjZTsKIAogICAgICAgICBpbnQgREVGQVVMVF9ESVIgPSBESVJfTEVGVF9UT19SSUdIVDsgLy8gWFhYCiAKLSAgICAgICAgZm9yIChpbnQgc3RhcnQgPSBidWZzdGFydDsgc3RhcnQgPD0gYnVmZW5kOyBzdGFydCA9IGVuZCkgewotICAgICAgICAgICAgaWYgKGZpcnN0KQotICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7CisgICAgICAgIGludCBwYXJhRW5kOworICAgICAgICBmb3IgKGludCBwYXJhU3RhcnQgPSBidWZzdGFydDsgcGFyYVN0YXJ0IDw9IGJ1ZmVuZDsgcGFyYVN0YXJ0ID0gcGFyYUVuZCkgeworICAgICAgICAgICAgcGFyYUVuZCA9IFRleHRVdGlscy5pbmRleE9mKHNvdXJjZSwgJ1xuJywgcGFyYVN0YXJ0LCBidWZlbmQpOworICAgICAgICAgICAgaWYgKHBhcmFFbmQgPCAwKQorICAgICAgICAgICAgICAgIHBhcmFFbmQgPSBidWZlbmQ7CiAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgZW5kID0gVGV4dFV0aWxzLmluZGV4T2Yoc291cmNlLCAnXG4nLCBzdGFydCwgYnVmZW5kKTsKKyAgICAgICAgICAgICAgICBwYXJhRW5kKys7CisgICAgICAgICAgICBpbnQgcGFyYUxlbiA9IHBhcmFFbmQgLSBwYXJhU3RhcnQ7CiAKLSAgICAgICAgICAgIGlmIChlbmQgPCAwKQotICAgICAgICAgICAgICAgIGVuZCA9IGJ1ZmVuZDsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBlbmQrKzsKLQotICAgICAgICAgICAgaW50IGZpcnN0V2lkdGhMaW5lQ291bnQgPSAxOworICAgICAgICAgICAgaW50IGZpcnN0V2lkdGhMaW5lTGltaXQgPSBtTGluZUNvdW50ICsgMTsKICAgICAgICAgICAgIGludCBmaXJzdHdpZHRoID0gb3V0ZXJ3aWR0aDsKICAgICAgICAgICAgIGludCByZXN0d2lkdGggPSBvdXRlcndpZHRoOwogCiAgICAgICAgICAgICBMaW5lSGVpZ2h0U3BhbltdIGNob29zZWh0ID0gbnVsbDsKIAogICAgICAgICAgICAgaWYgKHNwYW5uZWQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuW10gc3A7Ci0KLSAgICAgICAgICAgICAgICBzcCA9IHNwYW5uZWQuZ2V0U3BhbnMoc3RhcnQsIGVuZCwgTGVhZGluZ01hcmdpblNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuW10gc3AgPSBnZXRQYXJhZ3JhcGhTcGFucyhzcGFubmVkLCBwYXJhU3RhcnQsIHBhcmFFbmQsCisgICAgICAgICAgICAgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3Bhbi5jbGFzcyk7CiAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzcC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3BhbiBsbXMgPSBzcFtpXTsKICAgICAgICAgICAgICAgICAgICAgZmlyc3R3aWR0aCAtPSBzcFtpXS5nZXRMZWFkaW5nTWFyZ2luKHRydWUpOwogICAgICAgICAgICAgICAgICAgICByZXN0d2lkdGggLT0gc3BbaV0uZ2V0TGVhZGluZ01hcmdpbihmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChsbXMgaW5zdGFuY2VvZiBMZWFkaW5nTWFyZ2luU3Bhbi5MZWFkaW5nTWFyZ2luU3BhbjIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0V2lkdGhMaW5lQ291bnQgPSAoKExlYWRpbmdNYXJnaW5TcGFuLkxlYWRpbmdNYXJnaW5TcGFuMilsbXMpLmdldExlYWRpbmdNYXJnaW5MaW5lQ291bnQoKTsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIC8vIExlYWRpbmdNYXJnaW5TcGFuMiBpcyBvZGQuICBUaGUgY291bnQgYWZmZWN0cyBhbGwKKyAgICAgICAgICAgICAgICAgICAgLy8gbGVhZGluZyBtYXJnaW4gc3BhbnMsIG5vdCBqdXN0IHRoaXMgcGFydGljdWxhciBvbmUsCisgICAgICAgICAgICAgICAgICAgIC8vIGFuZCBzdGFydCBmcm9tIHRoZSB0b3Agb2YgdGhlIHNwYW4sIG5vdCB0aGUgdG9wIG9mIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBwYXJhZ3JhcGguCisgICAgICAgICAgICAgICAgICAgIGlmIChsbXMgaW5zdGFuY2VvZiBMZWFkaW5nTWFyZ2luU3BhbjIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuMiBsbXMyID0gKExlYWRpbmdNYXJnaW5TcGFuMikgbG1zOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxtc0ZpcnN0TGluZSA9IGdldExpbmVGb3JPZmZzZXQoc3Bhbm5lZC5nZXRTcGFuU3RhcnQobG1zMikpOworICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3RXaWR0aExpbmVMaW1pdCA9IGxtc0ZpcnN0TGluZSArIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxtczIuZ2V0TGVhZGluZ01hcmdpbkxpbmVDb3VudCgpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgY2hvb3NlaHQgPSBzcGFubmVkLmdldFNwYW5zKHN0YXJ0LCBlbmQsIExpbmVIZWlnaHRTcGFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICBjaG9vc2VodCA9IGdldFBhcmFncmFwaFNwYW5zKHNwYW5uZWQsIHBhcmFTdGFydCwgcGFyYUVuZCwgTGluZUhlaWdodFNwYW4uY2xhc3MpOwogCiAgICAgICAgICAgICAgICAgaWYgKGNob29zZWh0Lmxlbmd0aCAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChjaG9vc2VodHYgPT0gbnVsbCB8fApAQCAtMTkyLDExICsxODYsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjaG9vc2VodC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgaW50IG8gPSBzcGFubmVkLmdldFNwYW5TdGFydChjaG9vc2VodFtpXSk7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvIDwgc3RhcnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvIDwgcGFyYVN0YXJ0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3RhcnRzIGluIHRoaXMgbGF5b3V0LCBiZWZvcmUgdGhlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3VycmVudCBwYXJhZ3JhcGgKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0dltpXSA9IGdldExpbmVUb3AoZ2V0TGluZUZvck9mZnNldChvKSk7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0dltpXSA9IGdldExpbmVUb3AoZ2V0TGluZUZvck9mZnNldChvKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0YXJ0cyBpbiB0aGlzIHBhcmFncmFwaAogCkBAIC0yMDYsMTY2ICsyMDAsODcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmIChlbmQgLSBzdGFydCA+IGNoZGlycy5sZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBjaGRpcnMgPSBuZXcgYnl0ZVtBcnJheVV0aWxzLmlkZWFsQnl0ZUFycmF5U2l6ZShlbmQgLSBzdGFydCldOwotICAgICAgICAgICAgICAgIG1DaGRpcnMgPSBjaGRpcnM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoZW5kIC0gc3RhcnQgPiBjaHMubGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgY2hzID0gbmV3IGNoYXJbQXJyYXlVdGlscy5pZGVhbENoYXJBcnJheVNpemUoZW5kIC0gc3RhcnQpXTsKLSAgICAgICAgICAgICAgICBtQ2hzID0gY2hzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKChlbmQgLSBzdGFydCkgKiAyID4gd2lkdGhzLmxlbmd0aCkgewotICAgICAgICAgICAgICAgIHdpZHRocyA9IG5ldyBmbG9hdFtBcnJheVV0aWxzLmlkZWFsSW50QXJyYXlTaXplKChlbmQgLSBzdGFydCkgKiAyKV07Ci0gICAgICAgICAgICAgICAgbVdpZHRocyA9IHdpZHRoczsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1lYXN1cmVkLnNldFBhcmEoc291cmNlLCBwYXJhU3RhcnQsIHBhcmFFbmQsIERJUl9SRVFVRVNUX0RFRkFVTFRfTFRSKTsKKyAgICAgICAgICAgIGNoYXJbXSBjaHMgPSBtZWFzdXJlZC5tQ2hhcnM7CisgICAgICAgICAgICBmbG9hdFtdIHdpZHRocyA9IG1lYXN1cmVkLm1XaWR0aHM7CisgICAgICAgICAgICBieXRlW10gY2hkaXJzID0gbWVhc3VyZWQubUxldmVsczsKKyAgICAgICAgICAgIGludCBkaXIgPSBtZWFzdXJlZC5tRGlyOworICAgICAgICAgICAgYm9vbGVhbiBlYXN5ID0gbWVhc3VyZWQubUVhc3k7CiAKLSAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyhzb3VyY2UsIHN0YXJ0LCBlbmQsIGNocywgMCk7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgbiA9IGVuZCAtIHN0YXJ0OwotCi0gICAgICAgICAgICBib29sZWFuIGVhc3kgPSB0cnVlOwotICAgICAgICAgICAgYm9vbGVhbiBhbHRlcmVkID0gZmFsc2U7Ci0gICAgICAgICAgICBpbnQgZGlyID0gREVGQVVMVF9ESVI7IC8vIFhYWAotCi0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewotICAgICAgICAgICAgICAgIGlmIChjaHNbaV0gPj0gRklSU1RfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICBlYXN5ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gRW5zdXJlIHRoYXQgbm9uZSBvZiB0aGUgdW5kZXJseWluZyBjaGFyYWN0ZXJzIGFyZSB0cmVhdGVkCi0gICAgICAgICAgICAvLyBhcyB2aWFibGUgYnJlYWtwb2ludHMsIGFuZCB0aGF0IHRoZSBlbnRpcmUgcnVuIGdldHMgdGhlCi0gICAgICAgICAgICAvLyBzYW1lIGJpZGkgZGlyZWN0aW9uLgotCi0gICAgICAgICAgICBpZiAoc291cmNlIGluc3RhbmNlb2YgU3Bhbm5lZCkgewotICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgc291cmNlOwotICAgICAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbltdIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIGVuZCwgUmVwbGFjZW1lbnRTcGFuLmNsYXNzKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IHkgPSAwOyB5IDwgc3BhbnMubGVuZ3RoOyB5KyspIHsKLSAgICAgICAgICAgICAgICAgICAgaW50IGEgPSBzcC5nZXRTcGFuU3RhcnQoc3BhbnNbeV0pOwotICAgICAgICAgICAgICAgICAgICBpbnQgYiA9IHNwLmdldFNwYW5FbmQoc3BhbnNbeV0pOwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAoaW50IHggPSBhOyB4IDwgYjsgeCsrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaHNbeCAtIHN0YXJ0XSA9ICdcdUZGRkMnOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIWVhc3kpIHsKLSAgICAgICAgICAgICAgICAvLyBYWFggcHV0IG92ZXJyaWRlIGZsYWdzLCBldGMuIGludG8gY2hkaXJzCi0gICAgICAgICAgICAgICAgZGlyID0gYmlkaShkaXIsIGNocywgY2hkaXJzLCBuLCBmYWxzZSk7Ci0KLSAgICAgICAgICAgICAgICAvLyBEbyBtaXJyb3JpbmcgZm9yIHJpZ2h0LXRvLWxlZnQgc2VnbWVudHMKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaGRpcnNbaV0gPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBqOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSBpOyBqIDwgbjsgaisrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoZGlyc1tqXSAhPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBbmRyb2lkQ2hhcmFjdGVyLm1pcnJvcihjaHMsIGksIGogLSBpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHRlcmVkID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGogLSAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBDaGFyU2VxdWVuY2Ugc3ViOwotCi0gICAgICAgICAgICBpZiAoYWx0ZXJlZCkgewotICAgICAgICAgICAgICAgIGlmIChhbHRlciA9PSBudWxsKQotICAgICAgICAgICAgICAgICAgICBhbHRlciA9IEFsdGVyZWRDaGFyU2VxdWVuY2UubWFrZShzb3VyY2UsIGNocywgc3RhcnQsIGVuZCk7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBhbHRlci51cGRhdGUoY2hzLCBzdGFydCwgZW5kKTsKLQotICAgICAgICAgICAgICAgIHN1YiA9IGFsdGVyOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzdWIgPSBzb3VyY2U7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBDaGFyU2VxdWVuY2Ugc3ViID0gc291cmNlOwogCiAgICAgICAgICAgICBpbnQgd2lkdGggPSBmaXJzdHdpZHRoOwogCiAgICAgICAgICAgICBmbG9hdCB3ID0gMDsKLSAgICAgICAgICAgIGludCBoZXJlID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgaGVyZSA9IHBhcmFTdGFydDsKIAotICAgICAgICAgICAgaW50IG9rID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgb2sgPSBwYXJhU3RhcnQ7CiAgICAgICAgICAgICBmbG9hdCBva3dpZHRoID0gdzsKICAgICAgICAgICAgIGludCBva2FzY2VudCA9IDAsIG9rZGVzY2VudCA9IDAsIG9rdG9wID0gMCwgb2tib3R0b20gPSAwOwogCi0gICAgICAgICAgICBpbnQgZml0ID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgZml0ID0gcGFyYVN0YXJ0OwogICAgICAgICAgICAgZmxvYXQgZml0d2lkdGggPSB3OwogICAgICAgICAgICAgaW50IGZpdGFzY2VudCA9IDAsIGZpdGRlc2NlbnQgPSAwLCBmaXR0b3AgPSAwLCBmaXRib3R0b20gPSAwOwogCi0gICAgICAgICAgICBib29sZWFuIHRhYiA9IGZhbHNlOworICAgICAgICAgICAgYm9vbGVhbiBoYXNUYWJPckVtb2ppID0gZmFsc2U7CisgICAgICAgICAgICBib29sZWFuIGhhc1RhYiA9IGZhbHNlOworICAgICAgICAgICAgVGFiU3RvcHMgdGFiU3RvcHMgPSBudWxsOwogCi0gICAgICAgICAgICBpbnQgbmV4dDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBzdGFydDsgaSA8IGVuZDsgaSA9IG5leHQpIHsKLSAgICAgICAgICAgICAgICBpZiAoc3Bhbm5lZCA9PSBudWxsKQotICAgICAgICAgICAgICAgICAgICBuZXh0ID0gZW5kOwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgbmV4dCA9IHNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKGksIGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW4uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzcyk7CisgICAgICAgICAgICBmb3IgKGludCBzcGFuU3RhcnQgPSBwYXJhU3RhcnQsIHNwYW5FbmQgPSBzcGFuU3RhcnQsIG5leHRTcGFuU3RhcnQ7CisgICAgICAgICAgICAgICAgICAgIHNwYW5TdGFydCA8IHBhcmFFbmQ7IHNwYW5TdGFydCA9IG5leHRTcGFuU3RhcnQpIHsKIAotICAgICAgICAgICAgICAgIGlmIChzcGFubmVkID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGFjdHVhbE51bSA9IHBhaW50LmdldFRleHRXaWR0aHMoc3ViLCBpLCBuZXh0LCB3aWR0aHMpOwotICAgICAgICAgICAgICAgICAgICBpZiAobmV4dCAtIGkgPiBhY3R1YWxOdW0pCi0gICAgICAgICAgICAgICAgICAgICAgICBhZGp1c3RUZXh0V2lkdGhzKHdpZHRocywgc3ViLCBpLCBuZXh0LCBhY3R1YWxOdW0pOwotICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHdpZHRocywgMCwgd2lkdGhzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZCAtIHN0YXJ0ICsgKGkgLSBzdGFydCksIG5leHQgLSBpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgcGFpbnQuZ2V0Rm9udE1ldHJpY3NJbnQoZm0pOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Xb3JrUGFpbnQuYmFzZWxpbmVTaGlmdCA9IDA7CisgICAgICAgICAgICAgICAgaWYgKHNwYW5TdGFydCA9PSBzcGFuRW5kKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzcGFubmVkID09IG51bGwpCisgICAgICAgICAgICAgICAgICAgICAgICBzcGFuRW5kID0gcGFyYUVuZDsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgc3BhbkVuZCA9IHNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKHNwYW5TdGFydCwgcGFyYUVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWV0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcyk7CiAKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGFjdHVhbE51bSA9IFN0eWxlZC5nZXRUZXh0V2lkdGhzKHBhaW50LCBtV29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYW5uZWQsIGksIG5leHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzLCBmbSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChuZXh0IC0gaSA+IGFjdHVhbE51bSkKLSAgICAgICAgICAgICAgICAgICAgICAgIGFkanVzdFRleHRXaWR0aHMod2lkdGhzLCBzcGFubmVkLCBpLCBuZXh0LCBhY3R1YWxOdW0pOwotICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHdpZHRocywgMCwgd2lkdGhzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZCAtIHN0YXJ0ICsgKGkgLSBzdGFydCksIG5leHQgLSBpKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobVdvcmtQYWludC5iYXNlbGluZVNoaWZ0IDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZm0uYXNjZW50ICs9IG1Xb3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZtLnRvcCArPSBtV29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7CisgICAgICAgICAgICAgICAgICAgIGludCBzcGFuTGVuID0gc3BhbkVuZCAtIHNwYW5TdGFydDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW5uZWQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbWVhc3VyZWQuYWRkU3R5bGVSdW4ocGFpbnQsIHNwYW5MZW4sIGZtKTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZtLmRlc2NlbnQgKz0gbVdvcmtQYWludC5iYXNlbGluZVNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgZm0uYm90dG9tICs9IG1Xb3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW5bXSBzcGFucyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Bhbm5lZC5nZXRTcGFucyhzcGFuU3RhcnQsIHNwYW5FbmQsIE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgbWVhc3VyZWQuYWRkU3R5bGVSdW4ocGFpbnQsIHNwYW5zLCBzcGFuTGVuLCBmbSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgICAgICBuZXh0U3BhblN0YXJ0ID0gc3BhbkVuZDsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRJblBhcmEgPSBzcGFuU3RhcnQgLSBwYXJhU3RhcnQ7CisgICAgICAgICAgICAgICAgaW50IGVuZEluUGFyYSA9IHNwYW5FbmQgLSBwYXJhU3RhcnQ7CisKICAgICAgICAgICAgICAgICBpbnQgZm10b3AgPSBmbS50b3A7CiAgICAgICAgICAgICAgICAgaW50IGZtYm90dG9tID0gZm0uYm90dG9tOwogICAgICAgICAgICAgICAgIGludCBmbWFzY2VudCA9IGZtLmFzY2VudDsKICAgICAgICAgICAgICAgICBpbnQgZm1kZXNjZW50ID0gZm0uZGVzY2VudDsKIAotICAgICAgICAgICAgICAgIGlmIChmYWxzZSkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IGk7IGogPCBuZXh0OyBqKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCh3aWR0aHNbaiAtIHN0YXJ0ICsgKGVuZCAtIHN0YXJ0KV0pOwotICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCcgJyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBMb2cuZSgidGV4dCIsIHNiLnRvU3RyaW5nKCkpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSBpOyBqIDwgbmV4dDsgaisrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNoYXIgYyA9IGNoc1tqIC0gc3RhcnRdOworICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSBzcGFuU3RhcnQ7IGogPCBzcGFuRW5kOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgY2hhciBjID0gY2hzW2ogLSBwYXJhU3RhcnRdOwogICAgICAgICAgICAgICAgICAgICBmbG9hdCBiZWZvcmUgPSB3OwogCiAgICAgICAgICAgICAgICAgICAgIGlmIChjID09ICdcbicpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIDsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjID09ICdcdCcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHcgPSBMYXlvdXQubmV4dFRhYihzdWIsIHN0YXJ0LCBlbmQsIHcsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgdGFiID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjID49IDB4RDgwMCAmJiBjIDw9IDB4REZGRiAmJiBqICsgMSA8IG5leHQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBlbW9qaSA9IENoYXJhY3Rlci5jb2RlUG9pbnRBdChjaHMsIGogLSBzdGFydCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzVGFiID09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzVGFiID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNUYWJPckVtb2ppID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3Bhbm5lZCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZpcnN0IHRhYiB0aGlzIHBhcmEsIGNoZWNrIGZvciB0YWJzdG9wcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUYWJTdG9wU3BhbltdIHNwYW5zID0gZ2V0UGFyYWdyYXBoU3BhbnMoc3Bhbm5lZCwgcGFyYVN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFFbmQsIFRhYlN0b3BTcGFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW5zLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhYlN0b3BzID0gbmV3IFRhYlN0b3BzKFRBQl9JTkNSRU1FTlQsIHNwYW5zKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0YWJTdG9wcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyA9IHRhYlN0b3BzLm5leHRUYWIodyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSBUYWJTdG9wcy5uZXh0RGVmYXVsdFN0b3AodywgVEFCX0lOQ1JFTUVOVCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYyA+PSAweEQ4MDAgJiYgYyA8PSAweERGRkYgJiYgaiArIDEgPCBzcGFuRW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZW1vamkgPSBDaGFyYWN0ZXIuY29kZVBvaW50QXQoY2hzLCBqIC0gcGFyYVN0YXJ0KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVtb2ppID49IE1JTl9FTU9KSSAmJiBlbW9qaSA8PSBNQVhfRU1PSkkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXRtYXAgYm0gPSBFTU9KSV9GQUNUT1JZLgpAQCAtMzgwLDIxICsyOTUsMjEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWNoUGFpbnQgPSBtV29ya1BhaW50OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgd2lkID0gKGZsb2F0KSBibS5nZXRXaWR0aCgpICoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgd2lkID0gYm0uZ2V0V2lkdGgoKSAqCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC13aGljaFBhaW50LmFzY2VudCgpIC8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm0uZ2V0SGVpZ2h0KCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyArPSB3aWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhYiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc1RhYk9yRW1vamkgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqKys7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyArPSB3aWR0aHNbaiAtIHN0YXJ0ICsgKGVuZCAtIHN0YXJ0KV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ogLSBwYXJhU3RhcnRdOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdyArPSB3aWR0aHNbaiAtIHN0YXJ0ICsgKGVuZCAtIHN0YXJ0KV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyArPSB3aWR0aHNbaiAtIHBhcmFTdGFydF07CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3ICs9IHdpZHRoc1tqIC0gc3RhcnQgKyAoZW5kIC0gc3RhcnQpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ogLSBwYXJhU3RhcnRdOwogICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgLy8gTG9nLmUoInRleHQiLCAid2FzICIgKyBiZWZvcmUgKyAiIG5vdyAiICsgdyArICIgYWZ0ZXIgIiArIGMgKyAiIHdpdGhpbiAiICsgd2lkdGgpOwpAQCAtNDE1LDcgKzMzMCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAgICAgICAgICogRnJvbSB0aGUgVW5pY29kZSBMaW5lIEJyZWFraW5nIEFsZ29yaXRobToKICAgICAgICAgICAgICAgICAgICAgICAgICAqIChhdCBsZWFzdCBhcHByb3hpbWF0ZWx5KQotICAgICAgICAgICAgICAgICAgICAgICAgICogIAorICAgICAgICAgICAgICAgICAgICAgICAgICoKICAgICAgICAgICAgICAgICAgICAgICAgICAqIC4sOjsgYXJlIGNsYXNzIElTOiBicmVha3BvaW50cwogICAgICAgICAgICAgICAgICAgICAgICAgICogICAgICBleGNlcHQgd2hlbiBhZGphY2VudCB0byBkaWdpdHMKICAgICAgICAgICAgICAgICAgICAgICAgICAqIC8gICAgaXMgY2xhc3MgU1k6IGEgYnJlYWtwb2ludApAQCAtNDMwLDEyICszNDUsMTIgQEAKIAogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGMgPT0gJyAnIHx8IGMgPT0gJ1x0JyB8fAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYyA9PSAnLicgIHx8IGMgPT0gJywnIHx8IGMgPT0gJzonIHx8IGMgPT0gJzsnKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaiAtIDEgPCBoZXJlIHx8ICFDaGFyYWN0ZXIuaXNEaWdpdChjaHNbaiAtIDEgLSBzdGFydF0pKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaiArIDEgPj0gbmV4dCB8fCAhQ2hhcmFjdGVyLmlzRGlnaXQoY2hzW2ogKyAxIC0gc3RhcnRdKSkpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChqIC0gMSA8IGhlcmUgfHwgIUNoYXJhY3Rlci5pc0RpZ2l0KGNoc1tqIC0gMSAtIHBhcmFTdGFydF0pKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaiArIDEgPj0gc3BhbkVuZCB8fCAhQ2hhcmFjdGVyLmlzRGlnaXQoY2hzW2ogKyAxIC0gcGFyYVN0YXJ0XSkpKSB8fAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYyA9PSAnLycgfHwgYyA9PSAnLScpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIChqICsgMSA+PSBuZXh0IHx8ICFDaGFyYWN0ZXIuaXNEaWdpdChjaHNbaiArIDEgLSBzdGFydF0pKSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGogKyAxID49IHNwYW5FbmQgfHwgIUNoYXJhY3Rlci5pc0RpZ2l0KGNoc1tqICsgMSAtIHBhcmFTdGFydF0pKSkgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYyA+PSBGSVJTVF9DSksgJiYgaXNJZGVvZ3JhcGhpYyhjLCB0cnVlKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqICsgMSA8IG5leHQgJiYgaXNJZGVvZ3JhcGhpYyhjaHNbaiArIDEgLSBzdGFydF0sIGZhbHNlKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiArIDEgPCBzcGFuRW5kICYmIGlzSWRlb2dyYXBoaWMoY2hzW2ogKyAxIC0gcGFyYVN0YXJ0XSwgZmFsc2UpKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rd2lkdGggPSB3OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rID0gaiArIDE7CiAKQEAgLTQ1Miw3ICszNjcsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9rICE9IGhlcmUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMb2cuZSgidGV4dCIsICJvdXRwdXQgb2sgIiArIGhlcmUgKyAiIHRvICIgK29rKTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChvayA8IG5leHQgJiYgY2hzW29rIC0gc3RhcnRdID09ICcgJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChvayA8IHNwYW5FbmQgJiYgY2hzW29rIC0gcGFyYVN0YXJ0XSA9PSAnICcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2srKzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKQEAgLTQ2MSwxMCArMzc2LDEwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBva2FzY2VudCwgb2tkZXNjZW50LCBva3RvcCwgb2tib3R0b20sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2luZ211bHQsIHNwYWNpbmdhZGQsIGNob29zZWh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hvb3NlaHR2LCBmbSwgdGFiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZE11bHRpcGx5LCBzdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VodHYsIGZtLCBoYXNUYWJPckVtb2ppLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZE11bHRpcGx5LCBwYXJhU3RhcnQsIGNoZGlycywgZGlyLCBlYXN5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2sgPT0gYnVmZW5kLCBpbmNsdWRlcGFkLCB0cmFja3BhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRocywgc3RhcnQsIGVuZCAtIHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hzLCB3aWR0aHMsIGhlcmUgLSBwYXJhU3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGVyZSwgZWxsaXBzaXplZFdpZHRoLCBva3dpZHRoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQpOwogCkBAIC00ODgsNyArNDAzLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvayAhPSBoZXJlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTG9nLmUoInRleHQiLCAib3V0cHV0IG9rICIgKyBoZXJlICsgIiB0byAiICtvayk7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAob2sgPCBuZXh0ICYmIGNoc1tvayAtIHN0YXJ0XSA9PSAnICcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAob2sgPCBzcGFuRW5kICYmIGNoc1tvayAtIHBhcmFTdGFydF0gPT0gJyAnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rKys7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCkBAIC00OTcsMTAgKzQxMiwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2thc2NlbnQsIG9rZGVzY2VudCwgb2t0b3AsIG9rYm90dG9tLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNpbmdtdWx0LCBzcGFjaW5nYWRkLCBjaG9vc2VodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIHRhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgc3RhcnQsIGNoZGlycywgZGlyLCBlYXN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hvb3NlaHR2LCBmbSwgaGFzVGFiT3JFbW9qaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgcGFyYVN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rID09IGJ1ZmVuZCwgaW5jbHVkZXBhZCwgdHJhY2twYWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aHMsIHN0YXJ0LCBlbmQgLSBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNocywgd2lkdGhzLCBoZXJlIC0gcGFyYVN0YXJ0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hlcmUsIGVsbGlwc2l6ZWRXaWR0aCwgb2t3aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50KTsKIApAQCAtNTEzLDE5ICs0MjgsMjAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpdHRvcCwgZml0Ym90dG9tLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNpbmdtdWx0LCBzcGFjaW5nYWRkLCBjaG9vc2VodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIHRhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgc3RhcnQsIGNoZGlycywgZGlyLCBlYXN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hvb3NlaHR2LCBmbSwgaGFzVGFiT3JFbW9qaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgcGFyYVN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpdCA9PSBidWZlbmQsIGluY2x1ZGVwYWQsIHRyYWNrcGFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzLCBzdGFydCwgZW5kIC0gc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaHMsIHdpZHRocywgaGVyZSAtIHBhcmFTdGFydCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZXJlLCBlbGxpcHNpemVkV2lkdGgsIGZpdHdpZHRoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVyZSA9IGZpdDsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTG9nLmUoInRleHQiLCAib3V0cHV0IG9uZSAiICsgaGVyZSArICIgdG8gIiArKGhlcmUgKyAxKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVhc3VyZVRleHQocGFpbnQsIG1Xb3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlLCBoZXJlLCBoZXJlICsgMSwgZm0sIHRhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBYWFggbm90IHN1cmUgd2h5IHRoZSBleGlzdGluZyBmbSB3YXNuJ3Qgb2suCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWVhc3VyZVRleHQocGFpbnQsIG1Xb3JrUGFpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgc291cmNlLCBoZXJlLCBoZXJlICsgMSwgZm0sIHRhYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICBudWxsKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSBvdXQoc291cmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVyZSwgaGVyZSsxLApAQCAtNTMzLDE5ICs0NDksMjIgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZtLnRvcCwgZm0uYm90dG9tLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNpbmdtdWx0LCBzcGFjaW5nYWRkLCBjaG9vc2VodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIHRhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgc3RhcnQsIGNoZGlycywgZGlyLCBlYXN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hvb3NlaHR2LCBmbSwgaGFzVGFiT3JFbW9qaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgcGFyYVN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUgKyAxID09IGJ1ZmVuZCwgaW5jbHVkZXBhZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWNrcGFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzLCBzdGFydCwgZW5kIC0gc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaHMsIHdpZHRocywgaGVyZSAtIHBhcmFTdGFydCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZXJlLCBlbGxpcHNpemVkV2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aHNbaGVyZSAtIHN0YXJ0XSwgcGFpbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzW2hlcmUgLSBwYXJhU3RhcnRdLCBwYWludCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXJlID0gaGVyZSArIDE7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoZXJlIDwgaSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBuZXh0ID0gaGVyZTsgLy8gbXVzdCByZW1lYXN1cmUKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoZXJlIDwgc3BhblN0YXJ0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGlkbid0IG91dHB1dCBhbGwgdGhlIHRleHQgZm9yIHRoaXMgc3BhbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3ZlIG1lYXN1cmVkIHRoZSByYXcgd2lkdGhzLCB0aG91Z2gsIHNvCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8ganVzdCByZXNldCB0aGUgc3RhcnQgcG9pbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gbmV4dFNwYW5TdGFydCA9IGhlcmU7CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBoZXJlIC0gMTsgICAgLy8gY29udGludWUgbG9vcGluZwogICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtNTU1LDE0ICs0NzQsMTQgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGZpdGFzY2VudCA9IGZpdGRlc2NlbnQgPSBmaXR0b3AgPSBmaXRib3R0b20gPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAgb2thc2NlbnQgPSBva2Rlc2NlbnQgPSBva3RvcCA9IG9rYm90dG9tID0gMDsKIAotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC0tZmlyc3RXaWR0aExpbmVDb3VudCA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoLS1maXJzdFdpZHRoTGluZUxpbWl0IDw9IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA9IHJlc3R3aWR0aDsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaWYgKGVuZCAhPSBoZXJlKSB7CisgICAgICAgICAgICBpZiAocGFyYUVuZCAhPSBoZXJlKSB7CiAgICAgICAgICAgICAgICAgaWYgKChmaXR0b3AgfCBmaXRib3R0b20gfCBmaXRkZXNjZW50IHwgZml0YXNjZW50KSA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldEZvbnRNZXRyaWNzSW50KGZtKTsKIApAQCAtNTc1LDIwICs0OTQsMjAgQEAKICAgICAgICAgICAgICAgICAvLyBMb2cuZSgidGV4dCIsICJvdXRwdXQgcmVzdCAiICsgaGVyZSArICIgdG8gIiArIGVuZCk7CiAKICAgICAgICAgICAgICAgICB2ID0gb3V0KHNvdXJjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUsIGVuZCwgZml0YXNjZW50LCBmaXRkZXNjZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgaGVyZSwgcGFyYUVuZCwgZml0YXNjZW50LCBmaXRkZXNjZW50LAogICAgICAgICAgICAgICAgICAgICAgICAgZml0dG9wLCBmaXRib3R0b20sCiAgICAgICAgICAgICAgICAgICAgICAgICB2LAogICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2luZ211bHQsIHNwYWNpbmdhZGQsIGNob29zZWh0LAotICAgICAgICAgICAgICAgICAgICAgICAgY2hvb3NlaHR2LCBmbSwgdGFiLAotICAgICAgICAgICAgICAgICAgICAgICAgbmVlZE11bHRpcGx5LCBzdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCi0gICAgICAgICAgICAgICAgICAgICAgICBlbmQgPT0gYnVmZW5kLCBpbmNsdWRlcGFkLCB0cmFja3BhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRocywgc3RhcnQsIGVuZCAtIHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgY2hvb3NlaHR2LCBmbSwgaGFzVGFiT3JFbW9qaSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgcGFyYVN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFFbmQgPT0gYnVmZW5kLCBpbmNsdWRlcGFkLCB0cmFja3BhZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNocywgd2lkdGhzLCBoZXJlIC0gcGFyYVN0YXJ0LAogICAgICAgICAgICAgICAgICAgICAgICAgd2hlcmUsIGVsbGlwc2l6ZWRXaWR0aCwgdywgcGFpbnQpOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBzdGFydCA9IGVuZDsKKyAgICAgICAgICAgIHBhcmFTdGFydCA9IHBhcmFFbmQ7CiAKLSAgICAgICAgICAgIGlmIChlbmQgPT0gYnVmZW5kKQorICAgICAgICAgICAgaWYgKHBhcmFFbmQgPT0gYnVmZW5kKQogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAKQEAgLTYwMywyNDYgKzUyMiwxMyBAQAogICAgICAgICAgICAgICAgICAgICB2LAogICAgICAgICAgICAgICAgICAgICBzcGFjaW5nbXVsdCwgc3BhY2luZ2FkZCwgbnVsbCwKICAgICAgICAgICAgICAgICAgICAgbnVsbCwgZm0sIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIGJ1ZmVuZCwgY2hkaXJzLCBERUZBVUxUX0RJUiwgdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgbmVlZE11bHRpcGx5LCBidWZlbmQsIG51bGwsIERFRkFVTFRfRElSLCB0cnVlLAogICAgICAgICAgICAgICAgICAgICB0cnVlLCBpbmNsdWRlcGFkLCB0cmFja3BhZCwKLSAgICAgICAgICAgICAgICAgICAgd2lkdGhzLCBidWZzdGFydCwgMCwKKyAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgYnVmc3RhcnQsCiAgICAgICAgICAgICAgICAgICAgIHdoZXJlLCBlbGxpcHNpemVkV2lkdGgsIDAsIHBhaW50KTsKICAgICAgICAgfQogICAgIH0KIAotICAgIC8qKgotICAgICAqIFJ1bnMgdGhlIHVuaWNvZGUgYmlkaSBhbGdvcml0aG0gb24gdGhlIGZpcnN0IG4gY2hhcnMgaW4gY2hzLCByZXR1cm5pbmcKLSAgICAgKiB0aGUgY2hhciBkaXJzIGluIGNoSW5mbyBhbmQgdGhlIGJhc2UgbGluZSBkaXJlY3Rpb24gb2YgdGhlIGZpcnN0Ci0gICAgICogcGFyYWdyYXBoLgotICAgICAqIAotICAgICAqIFhYWCBjaGFuZ2UgcmVzdWx0IGZyb20gZGlycyB0byBsZXZlbHMKLSAgICAgKiAgCi0gICAgICogQHBhcmFtIGRpciB0aGUgZGlyZWN0aW9uIGZsYWcsIGVpdGhlciBESVJfUkVRVUVTVF9MVFIsCi0gICAgICogRElSX1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bmUgcHJpbWFyeSBwYXJhZ3JhcGggZGlyZWN0aW9uIGlmIG5vdCBzcGVjaWZpZWQKLSAgICAgICAgICovCi0gICAgICAgIGlmIChkaXIgIT0gRElSX1JFUVVFU1RfTFRSICYmIGRpciAhPSBESVJfUkVRVUVTVF9SVEwpIHsKLSAgICAgICAgICAgIC8vIHNldCB1cCBkZWZhdWx0Ci0gICAgICAgICAgICBkaXIgPSBkaXIgPj0gMCA/IERJUl9MRUZUX1RPX1JJR0hUIDogRElSX1JJR0hUX1RPX0xFRlQ7Ci0gICAgICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IG47IGorKykgewotICAgICAgICAgICAgICAgIGludCBkID0gY2hJbmZvW2pdOwotCi0gICAgICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQpIHsKLSAgICAgICAgICAgICAgICAgICAgZGlyID0gRElSX0xFRlRfVE9fUklHSFQ7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICBkaXIgPSBESVJfUklHSFRfVE9fTEVGVDsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZmluYWwgYnl0ZSBTT1IgPSBkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQgPwotICAgICAgICAgICAgICAgIENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9MRUZUX1RPX1JJR0hUIDoKLSAgICAgICAgICAgICAgICBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVDsKLQotICAgICAgICAvKgotICAgICAgICAgKiBYWFggRXhwbGljaXQgb3ZlcnJpZGVzIHNob3VsZCBnbyBoZXJlCi0gICAgICAgICAqLwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFdlYWsgdHlwZSByZXNvbHV0aW9uCi0gICAgICAgICAqLwotCi0gICAgICAgIC8vIGR1bXAoY2hkaXJzLCBuLCAiaW5pdGlhbCIpOwotCi0gICAgICAgIC8vIFcxIG5vbiBzcGFjaW5nIG1hcmtzCi0gICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKSB7Ci0gICAgICAgICAgICBpZiAoY2hJbmZvW2pdID09IENoYXJhY3Rlci5OT05fU1BBQ0lOR19NQVJLKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGogPT0gMCkKLSAgICAgICAgICAgICAgICAgICAgY2hJbmZvW2pdID0gU09SOwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgY2hJbmZvW2pdID0gY2hJbmZvW2ogLSAxXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8vIGR1bXAoY2hkaXJzLCBuLCAiVzEiKTsKLQotICAgICAgICAvLyBXMiBldXJvcGVhbiBudW1iZXJzCi0gICAgICAgIGJ5dGUgY3VyID0gU09SOwotICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IG47IGorKykgewotICAgICAgICAgICAgYnl0ZSBkID0gY2hJbmZvW2pdOwotCi0gICAgICAgICAgICBpZiAoZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfTEVGVF9UT19SSUdIVCB8fAotICAgICAgICAgICAgICAgIGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQgfHwKLSAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUX0FSQUJJQykKLSAgICAgICAgICAgICAgICBjdXIgPSBkOwotICAgICAgICAgICAgZWxzZSBpZiAoZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSKSB7Ci0gICAgICAgICAgICAgICAgIGlmIChjdXIgPT0KLSAgICAgICAgICAgICAgICAgICAgQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlRfQVJBQklDKQotICAgICAgICAgICAgICAgICAgICBjaEluZm9bal0gPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfQVJBQklDX05VTUJFUjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8vIGR1bXAoY2hkaXJzLCBuLCAiVzIiKTsKLQotICAgICAgICAvLyBXMyBhcmFiaWMgbGV0dGVycwotICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IG47IGorKykgewotICAgICAgICAgICAgaWYgKGNoSW5mb1tqXSA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVF9BUkFCSUMpCi0gICAgICAgICAgICAgICAgY2hJbmZvW2pdID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQ7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBkdW1wKGNoZGlycywgbiwgIlczIik7Ci0KLSAgICAgICAgLy8gVzQgc2luZ2xlIHNlcGFyYXRvciBiZXR3ZWVuIG51bWJlcnMKLSAgICAgICAgZm9yIChpbnQgaiA9IDE7IGogPCBuIC0gMTsgaisrKSB7Ci0gICAgICAgICAgICBieXRlIGQgPSBjaEluZm9bal07Ci0gICAgICAgICAgICBieXRlIHByZXYgPSBjaEluZm9baiAtIDFdOwotICAgICAgICAgICAgYnl0ZSBuZXh0ID0gY2hJbmZvW2ogKyAxXTsKLQotICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUl9TRVBBUkFUT1IpIHsKLSAgICAgICAgICAgICAgICBpZiAocHJldiA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bHNlOwotICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IG47IGorKykgewotICAgICAgICAgICAgYnl0ZSBkID0gY2hJbmZvW2pdOwotCi0gICAgICAgICAgICBpZiAoZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSKQotICAgICAgICAgICAgICAgIGFkamFjZW50ID0gdHJ1ZTsKLSAgICAgICAgICAgIGVsc2UgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUl9URVJNSU5BVE9SICYmIGFkamFjZW50KQotICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVI7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgYWRqYWNlbnQgPSBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIC8vZHVtcChjaGRpcnMsIG4sICJXNSIpOwotCi0gICAgICAgIC8vIFc1IGV1cm9wZWFuIG51bWJlciB0ZXJtaW5hdG9ycyBwYXJ0IDIsCi0gICAgICAgIC8vIFc2IHNlcGFyYXRvcnMgYW5kIHRlcm1pbmF0b3JzCi0gICAgICAgIGFkamFjZW50ID0gZmFsc2U7Ci0gICAgICAgIGZvciAoaW50IGogPSBuIC0gMTsgaiA+PSAwOyBqLS0pIHsKLSAgICAgICAgICAgIGJ5dGUgZCA9IGNoSW5mb1tqXTsKLQotICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUikKLSAgICAgICAgICAgICAgICBhZGphY2VudCA9IHRydWU7Ci0gICAgICAgICAgICBlbHNlIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVJfVEVSTUlOQVRPUikgewotICAgICAgICAgICAgICAgIGlmIChhZGphY2VudCkKLSAgICAgICAgICAgICAgICAgICAgY2hJbmZvW2pdID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUjsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9PVEhFUl9ORVVUUkFMUzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIGFkamFjZW50ID0gZmFsc2U7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSX1NFUEFSQVRPUiB8fAotICAgICAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9DT01NT05fTlVNQkVSX1NFUEFSQVRPUiB8fAotICAgICAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9QQVJBR1JBUEhfU0VQQVJBVE9SIHx8Ci0gICAgICAgICAgICAgICAgICAgIGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1NFR01FTlRfU0VQQVJBVE9SKQotICAgICAgICAgICAgICAgICAgICBjaEluZm9bal0gPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfT1RIRVJfTkVVVFJBTFM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBkdW1wKGNoZGlycywgbiwgIlc2Iik7Ci0KLSAgICAgICAgLy8gVzcgc3Ryb25nIGRpcmVjdGlvbiBvZiBldXJvcGVhbiBudW1iZXJzCi0gICAgICAgIGN1ciA9IFNPUjsKLSAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKLSAgICAgICAgICAgIGJ5dGUgZCA9IGNoSW5mb1tqXTsKLQotICAgICAgICAgICAgaWYgKG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0ZSBkZCA9IFNPUjsKLSAgICAgICAgICAgICAgICBpbnQgazsKLQotICAgICAgICAgICAgICAgIGZvciAoayA9IGogKyAxOyBrIDwgbjsgaysrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRkID0gY2hJbmZvW2tdOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChkZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfTEVGVF9UT19SSUdIVCB8fAotICAgICAgICAgICAgICAgICAgICAgICAgZGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChkZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBkZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfQVJBQklDX05VTUJFUikgewotICAgICAgICAgICAgICAgICAgICAgICAgZGQgPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZm9yIChpbnQgeSA9IGo7IHkgPCBrOyB5KyspIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRkID09IGN1cikKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoSW5mb1t5XSA9IGN1cjsKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgY2hJbmZvW3ldID0gU09SOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGogPSBrIC0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8vIGR1bXAoY2hkaXJzLCBuLCAiZmluYWwiKTsKLQotICAgICAgICAvLyBleHRyYTogZW5mb3JjZSB0aGF0IGFsbCB0YWJzIGFuZCBzdXJyb2dhdGUgY2hhcmFjdGVycyBnbyB0aGUKLSAgICAgICAgLy8gcHJpbWFyeSBkaXJlY3Rpb24KLSAgICAgICAgLy8gVE9ETzogYWN0dWFsbHkgZG8gZGlyZWN0aW9ucyByaWdodCBmb3Igc3Vycm9nYXRlcwotCi0gICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKSB7Ci0gICAgICAgICAgICBjaGFyIGMgPSBjaHNbal07Ci0KLSAgICAgICAgICAgIGlmIChjID09ICdcdCcgfHwgKGMgPj0gMHhEODAwICYmIGMgPD0gMHhERkZGKSkgewotICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IFNPUjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgcmV0dXJuIGRpcjsKLSAgICB9Ci0KICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBjaGFyIEZJUlNUX0NKSyA9ICdcdTJFODAnOwogICAgIC8qKgogICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGUgc3BlY2lmaWVkIGNoYXJhY3RlciBpcyBvbmUgb2YgdGhvc2Ugc3BlY2lmaWVkCkBAIC05NDgsNTMgKzYzNCwxNSBAQAogICAgIH0KICovCiAKLSAgICBwcml2YXRlIHN0YXRpYyBpbnQgZ2V0Rml0KFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZCkgewotICAgICAgICBpbnQgaGlnaCA9IGVuZCArIDEsIGxvdyA9IHN0YXJ0IC0gMSwgZ3Vlc3M7Ci0KLSAgICAgICAgd2hpbGUgKGhpZ2ggLSBsb3cgPiAxKSB7Ci0gICAgICAgICAgICBndWVzcyA9IChoaWdoICsgbG93KSAvIDI7Ci0KLSAgICAgICAgICAgIGlmIChtZWFzdXJlVGV4dChwYWludCwgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQsIHN0YXJ0LCBndWVzcywgbnVsbCwgdHJ1ZSwgbnVsbCkgPiB3aWQpCi0gICAgICAgICAgICAgICAgaGlnaCA9IGd1ZXNzOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIGxvdyA9IGd1ZXNzOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGxvdyA8IHN0YXJ0KQotICAgICAgICAgICAgcmV0dXJuIHN0YXJ0OwotICAgICAgICBlbHNlCi0gICAgICAgICAgICByZXR1cm4gbG93OwotICAgIH0KLQotICAgIHByaXZhdGUgc3RhdGljIHZvaWQgYWRqdXN0VGV4dFdpZHRocyhmbG9hdFtdIHdpZHRocywgQ2hhclNlcXVlbmNlIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3VyUG9zLCBpbnQgbmV4dFBvcywgaW50IGFjdHVhbE51bSkgewotICAgICAgICB0cnkgewotICAgICAgICAgICAgaW50IGRzdEluZGV4ID0gbmV4dFBvcyAtIGN1clBvcyAtIDE7Ci0gICAgICAgICAgICBmb3IgKGludCBzcmNJbmRleCA9IGFjdHVhbE51bSAtIDE7IHNyY0luZGV4ID49IDA7IHNyY0luZGV4LS0pIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBjaGFyIGMgPSB0ZXh0LmNoYXJBdChkc3RJbmRleCArIGN1clBvcyk7Ci0gICAgICAgICAgICAgICAgaWYgKGMgPj0gMHhEODAwICYmIGMgPD0gMHhERkZGKSB7Ci0gICAgICAgICAgICAgICAgICAgIHdpZHRoc1tkc3RJbmRleC0tXSA9IDAuMGY7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHdpZHRoc1tkc3RJbmRleC0tXSA9IHdpZHRoc1tzcmNJbmRleF07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gY2F0Y2ggKEluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgTG9nLmUoInRleHQiLCAiYWRqdXN0IHRleHQgd2lkdGhzIGZhaWxlZCIpOwotICAgICAgICB9Ci0gICAgfQotCiAgICAgcHJpdmF0ZSBpbnQgb3V0KENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCiAgICAgICAgICAgICAgICAgICAgICAgaW50IGFib3ZlLCBpbnQgYmVsb3csIGludCB0b3AsIGludCBib3R0b20sIGludCB2LAogICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHNwYWNpbmdtdWx0LCBmbG9hdCBzcGFjaW5nYWRkLAogICAgICAgICAgICAgICAgICAgICAgIExpbmVIZWlnaHRTcGFuW10gY2hvb3NlaHQsIGludFtdIGNob29zZWh0diwKLSAgICAgICAgICAgICAgICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbSwgYm9vbGVhbiB0YWIsCisgICAgICAgICAgICAgICAgICAgICAgUGFpbnQuRm9udE1ldHJpY3NJbnQgZm0sIGJvb2xlYW4gaGFzVGFiT3JFbW9qaSwKICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIG5lZWRNdWx0aXBseSwgaW50IHBzdGFydCwgYnl0ZVtdIGNoZGlycywKICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGlyLCBib29sZWFuIGVhc3ksIGJvb2xlYW4gbGFzdCwKICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGluY2x1ZGVwYWQsIGJvb2xlYW4gdHJhY2twYWQsCi0gICAgICAgICAgICAgICAgICAgICAgZmxvYXRbXSB3aWR0aHMsIGludCB3aWRzdGFydCwgaW50IHdpZG9mZiwKKyAgICAgICAgICAgICAgICAgICAgICBjaGFyW10gY2hzLCBmbG9hdFtdIHdpZHRocywgaW50IHdpZHN0YXJ0LAogICAgICAgICAgICAgICAgICAgICAgIFRleHRVdGlscy5UcnVuY2F0ZUF0IGVsbGlwc2l6ZSwgZmxvYXQgZWxsaXBzaXN3aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB0ZXh0d2lkdGgsIFRleHRQYWludCBwYWludCkgewogICAgICAgICBpbnQgaiA9IG1MaW5lQ291bnQ7CkBAIC0xMDAyLDggKzY1MCw2IEBACiAgICAgICAgIGludCB3YW50ID0gb2ZmICsgbUNvbHVtbnMgKyBUT1A7CiAgICAgICAgIGludFtdIGxpbmVzID0gbUxpbmVzOwogCi0gICAgICAgIC8vIExvZy5lKCJ0ZXh0IiwgImxpbmUgIiArIHN0YXJ0ICsgIiB0byAiICsgZW5kICsgKGxhc3QgPyAiPT09IiA6ICIiKSk7Ci0KICAgICAgICAgaWYgKHdhbnQgPj0gbGluZXMubGVuZ3RoKSB7CiAgICAgICAgICAgICBpbnQgbmxlbiA9IEFycmF5VXRpbHMuaWRlYWxJbnRBcnJheVNpemUod2FudCArIDEpOwogICAgICAgICAgICAgaW50W10gZ3JvdyA9IG5ldyBpbnRbbmxlbl07CkBAIC0xMDc5LDU5ICs3MjUsMjMgQEAKICAgICAgICAgbGluZXNbb2ZmICsgbUNvbHVtbnMgKyBTVEFSVF0gPSBlbmQ7CiAgICAgICAgIGxpbmVzW29mZiArIG1Db2x1bW5zICsgVE9QXSA9IHY7CiAKLSAgICAgICAgaWYgKHRhYikKKyAgICAgICAgaWYgKGhhc1RhYk9yRW1vamkpCiAgICAgICAgICAgICBsaW5lc1tvZmYgKyBUQUJdIHw9IFRBQl9NQVNLOwogCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxpbmVzW29mZiArIERJUl0gfD0gZGlyIDw8IERJUl9TSElGVDsKLQotICAgICAgICAgICAgaW50IGN1ciA9IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9MRUZUX1RPX1JJR0hUOwotICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKLQotICAgICAgICAgICAgaWYgKCFlYXN5KSB7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgayA9IHN0YXJ0OyBrIDwgZW5kOyBrKyspIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGNoZGlyc1trIC0gcHN0YXJ0XSAhPSBjdXIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50Kys7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjdXIgPSBjaGRpcnNbayAtIHBzdGFydF07Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIERpcmVjdGlvbnMgbGluZWRpcnM7Ci0KLSAgICAgICAgICAgIGlmIChjb3VudCA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgbGluZWRpcnMgPSBESVJTX0FMTF9MRUZUX1RPX1JJR0hUOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzaG9ydFtdIGxkID0gbmV3IHNob3J0W2NvdW50ICsgMV07Ci0KLSAgICAgICAgICAgICAgICBjdXIgPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfTEVGVF9UT19SSUdIVDsKLSAgICAgICAgICAgICAgICBjb3VudCA9IDA7Ci0gICAgICAgICAgICAgICAgaW50IGhlcmUgPSBzdGFydDsKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IGsgPSBzdGFydDsgayA8IGVuZDsgaysrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaGRpcnNbayAtIHBzdGFydF0gIT0gY3VyKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBYWFggY2hlY2sgdG8gbWFrZSBzdXJlIHdlIGRvbid0Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgb3ZlcmZsb3cgc2hvcnQKLSAgICAgICAgICAgICAgICAgICAgICAgIGxkW2NvdW50KytdID0gKHNob3J0KSAoayAtIGhlcmUpOwotICAgICAgICAgICAgICAgICAgICAgICAgY3VyID0gY2hkaXJzW2sgLSBwc3RhcnRdOwotICAgICAgICAgICAgICAgICAgICAgICAgaGVyZSA9IGs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBsZFtjb3VudF0gPSAoc2hvcnQpIChlbmQgLSBoZXJlKTsKLQotICAgICAgICAgICAgICAgIGlmIChjb3VudCA9PSAxICYmIGxkWzBdID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbGluZWRpcnMgPSBESVJTX0FMTF9SSUdIVF9UT19MRUZUOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGxpbmVkaXJzID0gbmV3IERpcmVjdGlvbnMobGQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQorICAgICAgICBsaW5lc1tvZmYgKyBESVJdIHw9IGRpciA8PCBESVJfU0hJRlQ7CisgICAgICAgIERpcmVjdGlvbnMgbGluZWRpcnMgPSBESVJTX0FMTF9MRUZUX1RPX1JJR0hUOworICAgICAgICAvLyBlYXN5IG1lYW5zIGFsbCBjaGFycyA8IHRoZSBmaXJzdCBSVEwsIHNvIG5vIGVtb2ppLCBubyBub3RoaW5nCisgICAgICAgIC8vIFhYWCBhIHJ1biB3aXRoIG5vIHRleHQgb3IgYWxsIHNwYWNlcyBpcyBlYXN5IGJ1dCBtaWdodCBiZSBhbiBlbXB0eQorICAgICAgICAvLyBSVEwgcGFyYWdyYXBoLiAgTWFrZSBzdXJlIGVhc3kgaXMgZmFsc2UgaWYgdGhpcyBpcyB0aGUgY2FzZS4KKyAgICAgICAgaWYgKGVhc3kpIHsKICAgICAgICAgICAgIG1MaW5lRGlyZWN0aW9uc1tqXSA9IGxpbmVkaXJzOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUxpbmVEaXJlY3Rpb25zW2pdID0gQW5kcm9pZEJpZGkuZGlyZWN0aW9ucyhkaXIsIGNoZGlycywgd2lkc3RhcnQsIGNocywKKyAgICAgICAgICAgICAgICAgICAgd2lkc3RhcnQsIGVuZCAtIHN0YXJ0KTsKIAogICAgICAgICAgICAgLy8gSWYgZWxsaXBzaXplIGlzIGluIG1hcnF1ZWUgbW9kZSwgZG8gbm90IGFwcGx5IGVsbGlwc2lzIG9uIHRoZSBmaXJzdCBsaW5lCiAgICAgICAgICAgICBpZiAoZWxsaXBzaXplICE9IG51bGwgJiYgKGVsbGlwc2l6ZSAhPSBUZXh0VXRpbHMuVHJ1bmNhdGVBdC5NQVJRVUVFIHx8IGogIT0gMCkpIHsKLSAgICAgICAgICAgICAgICBjYWxjdWxhdGVFbGxpcHNpcyhzdGFydCwgZW5kLCB3aWR0aHMsIHdpZHN0YXJ0LCB3aWRvZmYsCisgICAgICAgICAgICAgICAgY2FsY3VsYXRlRWxsaXBzaXMoc3RhcnQsIGVuZCwgd2lkdGhzLCB3aWRzdGFydCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGxpcHNpc3dpZHRoLCBlbGxpcHNpemUsIGosCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHdpZHRoLCBwYWludCk7CiAgICAgICAgICAgICB9CkBAIC0xMTQyLDcgKzc1Miw3IEBACiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIGNhbGN1bGF0ZUVsbGlwc2lzKGludCBsaW5lc3RhcnQsIGludCBsaW5lZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdFtdIHdpZHRocywgaW50IHdpZHN0YXJ0LCBpbnQgd2lkb2ZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdFtdIHdpZHRocywgaW50IHdpZHN0YXJ0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBhdmFpbCwgVGV4dFV0aWxzLlRydW5jYXRlQXQgd2hlcmUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsaW5lLCBmbG9hdCB0ZXh0d2lkdGgsIFRleHRQYWludCBwYWludCkgewogICAgICAgICBpbnQgbGVuID0gbGluZWVuZCAtIGxpbmVzdGFydDsKQEAgLTExNjIsNyArNzcyLDcgQEAKICAgICAgICAgICAgIGludCBpOwogCiAgICAgICAgICAgICBmb3IgKGkgPSBsZW47IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZHRoc1tpIC0gMSArIGxpbmVzdGFydCAtIHdpZHN0YXJ0ICsgd2lkb2ZmXTsKKyAgICAgICAgICAgICAgICBmbG9hdCB3ID0gd2lkdGhzW2kgLSAxICsgbGluZXN0YXJ0IC0gd2lkc3RhcnRdOwogCiAgICAgICAgICAgICAgICAgaWYgKHcgKyBzdW0gKyBlbGxpcHNpc3dpZCA+IGF2YWlsKSB7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTE3OCw3ICs3ODgsNyBAQAogICAgICAgICAgICAgaW50IGk7CiAKICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkrKykgewotICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWR0aHNbaSArIGxpbmVzdGFydCAtIHdpZHN0YXJ0ICsgd2lkb2ZmXTsKKyAgICAgICAgICAgICAgICBmbG9hdCB3ID0gd2lkdGhzW2kgKyBsaW5lc3RhcnQgLSB3aWRzdGFydF07CiAKICAgICAgICAgICAgICAgICBpZiAodyArIHN1bSArIGVsbGlwc2lzd2lkID4gYXZhaWwpIHsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC0xMTk1LDcgKzgwNSw3IEBACiAKICAgICAgICAgICAgIGZsb2F0IHJhdmFpbCA9IChhdmFpbCAtIGVsbGlwc2lzd2lkK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Gx5IGFjY2VzcyBvdXIgbWVtYmVycywKICAgICAvLyByYXRoZXIgdGhhbiByZWx5aW5nIG9uIG1lbWJlciBmdW5jdGlvbnMuCiAgICAgLy8gVGhlIGxvZ2ljIG1pcnJvcnMgdGhhdCBvZiBMYXlvdXQuZ2V0TGluZUZvclZlcnRpY2FsCiAgICAgLy8gRklYTUU6IEl0IG1heSBiZSBmYXN0ZXIgdG8gZG8gYSBsaW5lYXIgc2VhcmNoIGZvciBsYXlvdXRzIHdpdGhvdXQgbWFueSBsaW5lcy4KQEAgLTEyNTIsMTEgKzg2MiwxMSBAQAogICAgIH0KIAogICAgIHB1YmxpYyBpbnQgZ2V0TGluZVRvcChpbnQgbGluZSkgewotICAgICAgICByZXR1cm4gbUxpbmVzW21Db2x1bW5zICogbGluZSArIFRPUF07ICAgIAorICAgICAgICByZXR1cm4gbUxpbmVzW21Db2x1bW5zICogbGluZSArIFRPUF07CiAgICAgfQogCiAgICAgcHVibGljIGludCBnZXRMaW5lRGVzY2VudChpbnQgbGluZSkgewotICAgICAgICByZXR1cm4gbUxpbmVzW21Db2x1bW5zICogbGluZSArIERFU0NFTlRdOyAgIAorICAgICAgICByZXR1cm4gbUxpbmVzW21Db2x1bW5zICogbGluZSArIERFU0NFTlRdOwogICAgIH0KIAogICAgIHB1YmxpYyBpbnQgZ2V0TGluZVN0YXJ0KGludCBsaW5lKSB7CkBAIC0xMzI5LDEzICs5MzksMTEgQEAKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgRElSX1NISUZUICA9IDMwOwogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBUQUJfTUFTSyAgID0gMHgyMDAwMDAwMDsKIAotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGNoYXIgRklSU1RfUklHSFRfVE9fTEVGVCA9ICdcdTA1OTAnOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBUQUJfSU5DUkVNRU5UID0gMjA7IC8vIHNhbWUgYXMgTGF5b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YXJhZ3JhcGgKLSAgICAgKiBkaXJlY3Rpb24gaXMgcmlnaHQtdG8tbGVmdC4KLSAgICAgKi8KLSAgICBwcml2YXRlIHN0YXRpYyBmbG9hdCBkcmF3VW5pZm9ybVJ1bihDYW52YXMgY2FudmFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3Bhbm5lZCB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGlyLCBib29sZWFuIHJ1bklzUnRsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeCwgaW50IHRvcCwgaW50IHksIGludCBib3R0b20sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbWksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBuZWVkV2lkdGgpIHsKLQotICAgICAgICBib29sZWFuIGhhdmVXaWR0aCA9IGZhbHNlOwotICAgICAgICBmbG9hdCByZXQgPSAwOwotICAgICAgICBDaGFyYWN0ZXJTdHlsZVtdIHNwYW5zID0gdGV4dC5nZXRTcGFucyhzdGFydCwgZW5kLCBDaGFyYWN0ZXJTdHlsZS5jbGFzcyk7Ci0KLSAgICAgICAgUmVwbGFjZW1lbnRTcGFuIHJlcGxhY2VtZW50ID0gbnVsbDsKLQotICAgICAgICAvLyBYWFg6IFRoaXMgc2hvdWxkbid0IGJlIG1vZGlmeWluZyBwYWludCwgb25seSB3b3JrUGFpbnQuCi0gICAgICAgIC8vIEhvd2V2ZXIsIHRoZSBtZW1iZXJzIGJlbG9uZ2luZyB0byBUZXh0UGFpbnQgc2hvdWxkIGhhdmUgZGVmYXVsdAotICAgICAgICAvLyB2YWx1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sKLSAgICAgICAgICAgICAgICB0bXBzdGFydCA9IHN0YXJ0OwotICAgICAgICAgICAgICAgIHRtcGVuZCA9IGVuZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGZtaSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgd29ya1BhaW50LmdldEZvbnRNZXRyaWNzSW50KGZtaSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChjYW52YXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmICh3b3JrUGFpbnQuYmdDb2xvciAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludCBjID0gd29ya1BhaW50LmdldENvbG9yKCk7Ci0gICAgICAgICAgICAgICAgICAgIFBhaW50LlN0eWxlIHMgPSB3b3JrUGFpbnQuZ2V0U3R5bGUoKTsKLSAgICAgICAgICAgICAgICAgICAgd29ya1BhaW50LnNldENvbG9yKHdvcmtQYWludC5iZ0NvbG9yKTsKLSAgICAgICAgICAgICAgICAgICAgd29ya1BhaW50LnNldFN0eWxlKFBhaW50LlN0eWxlLkZJTEwpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmICghaGF2ZVdpZHRoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXQgPSB3b3JrUGFpbnQubWVhc3VyZVRleHQodG1wLCB0bXBzdGFydCwgdG1wZW5kKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhhdmVXaWR0aCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IExheW91dC5ESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCh4IC0gcmV0LCB0b3AsIHgsIGJvdHRvbSwgd29ya1BhaW50KTsKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KHgsIHRvcCwgeCArIHJldCwgYm90dG9tLCB3b3JrUGFpbnQpOwotCi0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludC5zZXRTdHlsZShzKTsKLSAgICAgICAgICAgICAgICAgICAgd29ya1BhaW50LnNldENvbG9yKGMpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gTGF5b3V0LkRJUl9SSUdIVF9UT19MRUZUKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghaGF2ZVdpZHRoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXQgPSB3b3JrUGFpbnQubWVhc3VyZVRleHQodG1wLCB0bXBzdGFydCwgdG1wZW5kKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhhdmVXaWR0aCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd1RleHQodG1wLCB0bXBzdGFydCwgdG1wZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCAtIHJldCwgeSArIHdvcmtQYWludC5iYXNlbGluZVNoaWZ0LCB3b3JrUGFpbnQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChuZWVkV2lkdGgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaGF2ZVdpZHRoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gd29ya1BhaW50Lm1lYXN1cmVUZXh0KHRtcCwgdG1wc3RhcnQsIHRtcGVuZCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGF2ZVdpZHRoID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3VGV4dCh0bXAsIHRtcHN0YXJ0LCB0bXBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4LCB5ICsgd29ya1BhaW50LmJhc2VsaW5lU2hpZnQsIHdvcmtQYWludCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAobmVlZFdpZHRoICYmICFoYXZlV2lkdGgpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0ID0gd29ya1BhaW50Lm1lYXN1cmVUZXh0KHRtcCwgdG1wc3RhcnQsIHRtcGVuZCk7Ci0gICAgICAgICAgICAgICAgICAgIGhhdmVXaWR0aCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0ID0gcmVwbGFjZW1lbnQuZ2V0U2l6ZSh3b3JrUGFpbnQsIHRleHQsIHN0YXJ0LCBlbmQsIGZtaSk7Ci0KLSAgICAgICAgICAgIGlmIChjYW52YXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gTGF5b3V0LkRJUl9SSUdIVF9UT19MRUZUKQotICAgICAgICAgICAgICAgICAgICByZXBsYWNlbWVudC5kcmF3KGNhbnZhcywgdGV4dCwgc3RhcnQsIGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4IC0gcmV0LCB0b3AsIHksIGJvdHRvbSwgd29ya1BhaW50KTsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHJlcGxhY2VtZW50LmRyYXcoY2FudmFzLCB0ZXh0LCBzdGFydCwgZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIHRvcCwgeSwgYm90dG9tLCB3b3JrUGFpbnQpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGRpciA9PSBMYXlvdXQuRElSX1JJR0hUX1RPX0xFRlQpCi0gICAgIC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0gICAgICogcGFyYWdyYXBoLCB0aGlzIHdpbGwgYmUgdG8gdGhlIHJpZ2h0IG9mIHRoZSB0ZXh0IHRvIGJlIGRyYXduLiBQYWludAotICAgICAqIHNob3VsZCBub3QgaGF2ZSBhbiBBbGlnbiB2YWx1ZSBvdGhlciB0aGFuIExFRlQgb3IgcG9zaXRpb25pbmcgd2lsbCBnZXQKLSAgICAgKiBjb25mdXNlZC4KLSAgICAgKgotICAgICAqIDxwPlRoaXMgb3B0aW1pemVzIGZvciB1bnN0eWxlZCB0ZXh0IGFuZCBzbyB3b3JrUGFpbnQgbWlnaHQgbm90IGJlCi0gICAgICogbW9kaWZpZWQgYnkgdGhpcyBjYWxsLgotICAgICAqCi0gICAgICogPHA+VGhlIHJldHVybmVkIGFkdmFuY2Ugd2lkdGggd2lsbCBiZSA8IDAgaWYgdGhlIHBhcmFncmFwaAotICAgICAqIGRpcmVjdGlvbiBpcyByaWdodC10by1sZWZ0LgotICAgICAqLwotICAgIHByaXZhdGUgc3RhdGljIGZsb2F0IGRyYXdEaXJlY3Rpb25hbFJ1bihDYW52YXMgY2FudmFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkaXIsIGJvb2xlYW4gcnVuSXNSdGwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4LCBpbnQgdG9wLCBpbnQgeSwgaW50IGJvdHRvbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhaW50LkZvbnRNZXRyaWNzSW50IGZtaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIG5lZWRXaWR0aCkgewotCi0gICAgICAgIC8vIFhYWDogSXQgbG9va3MgbGlrZSBhbGwgY2FsbHMgdG8gdGhpcyBBUEkgbWF0Y2ggZGlyIGFuZCBydW5Jc1J0bCwgc28KLSAgICAgICAgLy8gaGF2aW5nIGJvdGggcGFyYW1ldGVycyBpcyByZWR1bmRhbnQgYW5kIGNvbmZ1c2luZy4KLQotICAgICAgICAvLyBmYXN0IHBhdGggZm9yIHVuc3R5bGVkIHRleHQKLSAgICAgICAgaWYgKCEodGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpKSB7Ci0gICAgICAgICAgICBmbG9hdCByZXQgPSAwOwotCi0gICAgICAgICAgICBpZiAocnVuSXNSdGwpIHsKLSAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdG1wID0gVGV4dFV0aWxzLmdldFJldmVyc2UodGV4dCwgc3RhcnQsIGVuZCk7Ci0gICAgICAgICAgICAgICAgLy8gWFhYOiB0aGlzIGFzc3VtZXMgZ2V0UmV2ZXJzZSBkb2Vzbid0IHR3ZWFrIHRoZSBsZW5ndGggb2YKLSAgICAgICAgICAgICAgICAvLyB0aGUgdGV4dAotICAgICAgICAgICAgICAgIGludCB0bXBlbmQgPSBlbmQgLSBzdGFydDsKLQotICAgICAgICAgICAgICAgIGlmIChjYW52YXMgIT0gbnVsbCB8fCBuZWVkV2lkdGgpCi0gICAgICAgICAgICAgICAgICAgIHJldCA9IHBhaW50Lm1lYXN1cmVUZXh0KHRtcCwgMCwgdG1wZW5kKTsKLQotICAgICAgICAgICAgICAgIGlmIChjYW52YXMgIT0gbnVsbCkKLSAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdUZXh0KHRtcCwgMCwgdG1wZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCAtIHJldCwgeSwgcGFpbnQpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAobmVlZFdpZHRoKQotICAgICAgICAgICAgICAgICAgICByZXQgPSBwYWludC5tZWFzdXJlVGV4dCh0ZXh0LCBzdGFydCwgZW5kKTsKLQotICAgICAgICAgICAgICAgIGlmIChjYW52YXMgIT0gbnVsbCkKLSAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdUZXh0KHRleHQsIHN0YXJ0LCBlbmQsIHgsIHksIHBhaW50KTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGZtaSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcGFpbnQuZ2V0Rm9udE1ldHJpY3NJbnQoZm1pKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIHJldCAqIGRpcjsgICAvLyBMYXlvdXQuRElSX1JJR0hUX1RPX0xFRlQgPT0gLTEKLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgZmxvYXQgb3ggPSB4OwotICAgICAgICBpbnQgbWluQXNjZW50ID0gMCwgbWF4RGVzY2VudCA9IDAsIG1pblRvcCA9IDAsIG1heEJvdHRvbSA9IDA7Ci0KLSAgICAgICAgU3Bhbm5lZCBzcCA9IChTcGFubmVkKSB0ZXh0OwotICAgICAgICBDbGFzczw/PiBkaXZpc2lvbjsKLQotICAgICAgICBpZiAoY2FudmFzID09IG51bGwpCi0gICAgICAgICAgICBkaXZpc2lvbiA9IE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3M7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIGRpdmlzaW9uID0gQ2hhcmFjdGVyU3R5bGUuY2xhc3M7Ci0KLSAgICAgICAgaW50IG5leHQ7Ci0gICAgICAgIGZvciAoaW50IGkgPSBzdGFydDsgaSA8IGVuZDsgaSA9IG5leHQpIHsKLSAgICAgICAgICAgIG5leHQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oaSwgZW5kLCBkaXZpc2lvbik7Ci0KLSAgICAgICAgICAgIC8vIFhYWDogaWYgZGlyIGFuZCBydW5Jc1J0bCB3ZXJlIG5vdCB0aGUgc2FtZSwgdGhpcyB3b3VsZCBkcmF3Ci0gICAgICAgICAgICAvLyBzcGFucyBpbiB0aGUgd3Jvbmcgb3JkZXIsIGJ1dCBubyBvbmUgYXBwZWFycyB0byBjYWxsIGl0IHRoaXMKLSAgICAgICAgICAgIC8vIHdheS4KLSAgICAgICAgICAgIHggKz0gZHJhd1VuaWZvcm1SdW4oY2FudmFzLCBzcCwgaSwgbmV4dCwgZGlyLCBydW5Jc1J0bCwKLSAgICAgICAgICAgICAgICAgIHgsIHRvcCwgeSwgYm90dG9tLCBmbWksIHBhaW50LCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICBuZWVkV2lkdGggfHwgbmV4dCAhPSBlbmQpOwotCi0gICAgICAgICAgICBpZiAoZm1pICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBpZiAoZm1pLmFzY2VudCA8IG1pbkFzY2VudCkKLSAgICAgICAgICAgICAgICAgICAgbWluQXNjZW50ID0gZm1pLmFzY2VudDsKLSAgICAgICAgICAgICAgICBpZiAoZm1pLmRlc2NlbnQgPiBtYXhEZXNjZW50KQotICAgICAgICAgICAgICAgICAgICBtYXhEZXNjZW50ID0gZm1pLmRlc2NlbnQ7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZm1pLnRvcCA8IG1pblRvcCkKLSAgICAgICAgICAgICAgICAgICAgbWluVG9wID0gZm1pLnRvcDsKLSAgICAgICAgICAgICAgICBpZiAoZm1pLmJvdHRvbSA+IG1heEJvdHRvbSkKLSAgICAgICAgICAgICAgICAgICAgbWF4Qm90dG9tID0gZm1pLmJvdHRvbTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChmbWkgIT0gbnVsbCkgewotICAgICAgICAgICAgaWYgKHN0YXJ0ID09IGVuZCkgewotICAgICAgICAgICAgICAgIHBhaW50LmdldEZvbnRNZXRyaWNzSW50KGZtaSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGZtaS5hc2NlbnQgPSBtaW5Bc2NlbnQ7Ci0gICAgICAgICAgICAgICAgZm1pLmRlc2NlbnQgPSBtYXhEZXNjZW50OwotICAgICAgICAgICAgICAgIGZtaS50b3AgPSBtaW5Ub3A7Ci0gICAgICAgICAgICAgICAgZm1pLmJvdHRvbSA9IG1heEJvdHRvbTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiB4IC0gb3g7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogRHJhd3MgYSB1bmlkaXJlY3Rpb25hbCBydW4gb2YgdGV4dCBvbiBhIHNpbmdsZSBsaW5lLCBhbmQgb3B0aW9uYWxseQotICAgICAqIHJldHVybnMgdGhlIHNpZ25lZCBhZHZhbmNlLiAgVW5saWtlIGRyYXdEaXJlY3Rpb25hbFJ1biwgdGhlIHBhcmFncmFwaAotICAgICAqIGRpcmVjdGlvbiBhbmQgcnVuIGRpcmVjdGlvbiBjYW4gYmUgZGlmZmVyZW50LgotICAgICAqLwotICAgIC8qIHBhY2thZ2UgKi8gc3RhdGljIGZsb2F0IGRyYXdUZXh0KENhbnZhcyBjYW52YXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRpciwgYm9vbGVhbiBydW5Jc1J0bCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgsIGludCB0b3AsIGludCB5LCBpbnQgYm90dG9tLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHBhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gbmVlZFdpZHRoKSB7Ci0gICAgICAgIC8vIFhYWCB0aGlzIGxvZ2ljIGlzIChkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpID09IHJ1bklzUnRsCi0gICAgICAgIGlmICgoZGlyID09IExheW91dC5ESVJfUklHSFRfVE9fTEVGVCAmJiAhcnVuSXNSdGwpIHx8Ci0gICAgICAgICAgICAocnVuSXNSdGwgJiYgZGlyID09IExheW91dC5ESVJfTEVGVF9UT19SSUdIVCkpIHsKLSAgICAgICAgICAgIC8vIFRPRE86IHRoaXMgbmVlZHMgdGhlIHJlYWwgZGlyZWN0aW9uCi0gICAgICAgICAgICBmbG9hdCBjaCA9IGRyYXdEaXJlY3Rpb25hbFJ1bihudWxsLCB0ZXh0LCBzdGFydCwgZW5kLAotICAgICAgICAgICAgICAgICAgICBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQsIGZhbHNlLCAwLCAwLCAwLCAwLCBudWxsLCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgd29ya1BhaW50LCB0cnVlKTsKLQotICAgICAgICAgICAgY2ggKj0gZGlyOyAgLy8gRElSX1JJR0hUX1RPX0xFRlQgPT0gLTEKLSAgICAgICAgICAgIGRyYXdEaXJlY3Rpb25hbFJ1bihjYW52YXMsIHRleHQsIHN0YXJ0LCBlbmQsIC1kaXIsCi0gICAgICAgICAgICAgICAgICAgIHJ1bklzUnRsLCB4ICsgY2gsIHRvcCwgeSwgYm90dG9tLCBudWxsLCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgd29ya1BhaW50LCB0cnVlKTsKLQotICAgICAgICAgICAgcmV0dXJuIGNoOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIGRyYXdEaXJlY3Rpb25hbFJ1bihjYW52YXMsIHRleHQsIHN0YXJ0LCBlbmQsIGRpciwgcnVuSXNSdGwsCi0gICAgICAgICAgICAgICAgICAgICAgIHgsIHRvcCwgeSwgYm90dG9tLCBudWxs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CBpcyB0cnVlCi0gICAgICovCi0gICAgcHVibGljIHN0YXRpYyBmbG9hdCBkcmF3VGV4dChDYW52YXMgY2FudmFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkaXJlY3Rpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4LCBpbnQgdG9wLCBpbnQgeSwgaW50IGJvdHRvbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIG5lZWRXaWR0aCkgewotICAgICAgICAvLyBGb3Igc2FmZXR5LgotICAgICAgICBkaXJlY3Rpb24gPSBkaXJlY3Rpb24gPj0gMCA/IExheW91dC5ESVJfTEVGVF9UT19SSUdIVAotICAgICAgICAgICAgICAgIDogTGF5b3V0LkRJUl9SSUdIVF9UT19MRUZUOwotCi0gICAgICAgIC8vIEhpZGUgcnVuSXNSdGwgcGFyYW1ldGVyIHNpbmNlIGl0IGlzIG1lYW5pbmdsZXNzIGZvciBleHRlcm5hbAotICAgICAgICAvLyBkZXZlbG9wZXJzLgotICAgICAgICAvLyBYWFg6IHRoZSBydW5Jc1J0bCBwcm9iYWJseSBvdWdodCB0byBiZSB0aGUgc2FtZSBhcyBkaXJlY3Rpb24sIHRoZW4KLSAgICAgICAgLy8gdGhpcyBjb3VsZCBkcmF3IHJ0bCB0ZXh0LgotICAgICAgICByZXR1cm4gZHJhd1RleHQoY2FudmFzLCB0ZXh0LCBzdGFydCwgZW5kLCBkaXJlY3Rpb24sIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgICAgeCwgdG9wLCB5LCBib3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Bhbm5lZDsKKyAgICBwcml2YXRlIGZpbmFsIFRleHRQYWludCBtV29ya1BhaW50ID0gbmV3IFRleHRQYWludCgpOworCisgICAgcHJpdmF0ZSBzdGF0aWMgVGV4dExpbmVbXSBjYWNoZWQgPSBuZXcgVGV4dExpbmVbM107CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIGEgbmV3IFRleHRMaW5lIGZyb20gdGhlIHNoYXJlZCBwb29sLgorICAgICAqCisgICAgICogQHJldHVybiBhbiB1bmluaXRpYWxpemVkIFRleHRMaW5lCisgICAgICovCisgICAgc3RhdGljIFRleHRMaW5lIG9idGFpbigpIHsKKyAgICAgICAgVGV4dExpbmUgdGw7CisgICAgICAgIHN5bmNocm9uaXplZCAoY2FjaGVkKSB7CisgICAgICAgICAgICBmb3IgKGludCBpID0gY2FjaGVkLmxlbmd0aDsgLS1pID49IDA7KSB7CisgICAgICAgICAgICAgICAgaWYgKGNhY2hlZFtpXSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRsID0gY2FjaGVkW2ldOworICAgICAgICAgICAgICAgICAgICBjYWNoZWRbaV0gPSBudWxsOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHRsID0gbmV3IFRleHRMaW5lKCk7CisgICAgICAgIExvZy52KCJUTElORSIsICJuZXc6ICIgKyB0bCk7CisgICAgICAgIHJldHVybiB0bDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBQdXRzIGEgVGV4dExpbmUgYmFjayBpbnRvIHRoZSBzaGFyZWQgcG9vbC4gRG8gbm90IHVzZSB0aGlzIFRleHRMaW5lIG9uY2UKKyAgICAgKiBpdCBoYXMgYmVlbiByZXR1cm5lZC4KKyAgICAgKiBAcGFyYW0gdGwgdGhlIHRleHRMaW5lCisgICAgICogQHJldHVybiBudWxsLCBhcyBhIGNvbnZlbmllbmNlIGZyb20gY2xlYXJpbmcgcmVmZXJlbmNlcyB0byB0aGUgcHJvdmlkZWQKKyAgICAgKiBUZXh0TGluZQorICAgICAqLworICAgIHN0YXRpYyBUZXh0TGluZSByZWN5Y2xlKFRleHRMaW5lIHRsKSB7CisgICAgICAgIHRsLm1UZXh0ID0gbnVsbDsKKyAgICAgICAgdGwubVBhaW50ID0gbnVsbDsKKyAgICAgICAgdGwubURpcmVjdGlvbnMgPSBudWxsOworICAgICAgICBpZiAodGwubUxlbiA8IDI1MCkgeworICAgICAgICAgICAgc3luY2hyb25pemVkKGNhY2hlZCkgeworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY2FjaGVkLmxlbmd0aDsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChjYWNoZWRbaV0gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVkW2ldID0gdGw7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBJbml0aWFsaXplcyBhIFRleHRMaW5lIGFuZCBwcmVwYXJlcyBpdCBmb3IgdXNlLgorICAgICAqCisgICAgICogQHBhcmFtIHBhaW50IHRoZSBiYXNlIHBhaW50IGZvciB0aGUgbGluZQorICAgICAqIEBwYXJhbSB0ZXh0IHRoZSB0ZXh0LCBjYW4gYmUgU3R5bGVkCisgICAgICogQHBhcmFtIHN0YXJ0IHRoZSBzdGFydCBvZiB0aGUgbGluZSByZWxhdGl2ZSB0byB0aGUgdGV4dAorICAgICAqIEBwYXJhbSBsaW1pdCB0aGUgbGltaXQgb2YgdGhlIGxpbmUgcmVsYXRpdmUgdG8gdGhlIHRleHQKKyAgICAgKiBAcGFyYW0gZGlyIHRoZSBwYXJhZ3JhcGggZGlyZWN0aW9uIG9m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ZXh0KSB7CisgICAgICAgICAgICAgICAgICAgIGluZXh0ID0gbVNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKGksIGxpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlcGxhY2VtZW50U3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtU3Bhbm5lZC5nZXRTcGFucyhpLCBpbmV4dCwgUmVwbGFjZW1lbnRTcGFuLmNsYXNzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5sZW5ndGggPiAwKSB7IC8vIHRyYW5zaXRpb24gaW50byBhIHNwYW4KKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJzW2kgLSBzdGFydF0gPSAnXHVmZmZjJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSBpIC0gc3RhcnQgKyAxLCBlID0gaW5leHQgLSBzdGFydDsgaiA8IGU7ICsraikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJzW2pdID0gJ1x1ZmVmZic7IC8vIHVzZWQgYXMgWldOQlMsIG1hcmtzIHBvc2l0aW9ucyB0byBza2lwCisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbVRhYnMgPSB0YWJTdG9wczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZW5kZXJzIHRoZSBUZXh0TGluZS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjIHRoZSBjYW52YXMgdG8gcmVuZGVyIG9uCisgICAgICogQHBhcmFtIHggdGhlIGxlYWRpbmcgbWFyZ2luIHBvc2l0aW9uCisgICAgICogQHBhcmFtIHRvcCB0aGUgdG9wIG9mIHRoZSBsaW5lCisgICAgICogQHBhcmFtIHkgdGhlIGJhc2VsaW5lCisgICAgICogQHBhcmFtIGJvdHRvbSB0aGUgYm90dG9tIG9mIHRoZSBsaW5lCisgICAgICovCisgICAgdm9pZCBkcmF3KENhbnZhcyBjLCBmbG9hdCB4LCBpbnQgdG9wLCBpbnQgeSwgaW50IGJvdHRvbSkgeworICAgICAgICBpZiAoIW1IYXNUYWJzKSB7CisgICAgICAgICAgICBpZiAobURpcmVjdGlvbnMgPT0gTGF5b3V0LkRJUlNfQUxMX0xFRlRfVE9fUklHSFQpIHsKKyAgICAgICAgICAgICAgICBkcmF3UnVuKGMsIDAsIDAsIG1MZW4sIGZhbHNlLCB4LCB0b3AsIHksIGJvdHRvbSwgZmFsc2UpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtRGlyZWN0aW9ucyA9PSBMYXlvdXQuRElSU19BTExfUklHSFRfVE9fTEVGVCkgeworICAgICAgICAgICAgICAgIGRyYXdSdW4oYywgMCwgMCwgbUxlbiwgdHJ1ZSwgeCwgdG9wLCB5LCBib3R0b20sIGZhbHNlKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCBoID0gMDsKKyAgICAgICAgaW50W10gcnVucyA9IG1EaXJlY3Rpb25zLm1EaXJlY3Rpb25zOworICAgICAgICBSZWN0RiBlbW9qaVJlY3QgPSBudWxsOworCisgICAgICAgIGludCBsYXN0UnVuSW5kZXggPSBydW5zLmxlbmd0aCAtIDI7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcnVucy5sZW5ndGg7IGkgKz0gMikgeworICAgICAgICAgICAgaW50IHJ1blN0YXJ0ID0gcnVuc1tpXTsKKyAgICAgICAgICAgIGludCBydW5MaW1pdCA9IHJ1blN0YXJ0ICsgKHJ1bnNbaSsxXSAmIExheW91dC5SVU5fTEVOR1RIX01BU0spOworICAgICAgICAgICAgaWYgKHJ1bkxpbWl0ID4gbUxlbikgeworICAgICAgICAgICAgICAgIHJ1bkxpbWl0ID0gbUxlbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJvb2xlYW4gcnVuSXNSdGwgPSAocnVuc1tpKzFdICYgTGF5b3V0LlJVTl9SVExfRkxBRykgIT0gMDsKKworICAgICAgICAgICAgaW50IHNlZ3N0YXJ0ID0gcnVuU3RhcnQ7CisgICAgICAgICAgICBjaGFyW10gY2hhcnMgPSBtQ2hhcnM7CisgICAgICAgICAgICBmb3IgKGludCBqID0gbUhhc1RhYnMgPyBydW5TdGFydCA6IHJ1bkxpbWl0OyBqIDw9IHJ1bkxpbWl0OyBqKyspIHsKKyAgICAgICAgICAgICAgICBpbnQgY29kZXB0ID0gMDsKKyAgICAgICAgICAgICAgICBCaXRtYXAgYm0gPSBudWxsOworCisgICAgICAgICAgICAgICAgaWYgKG1IYXNUYWJzICYmIGogPCBydW5MaW1pdCkgeworICAgICAgICAgICAgICAgICAgICBjb2RlcHQgPSBtQ2hhcnNbal07CisgICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPj0gMHhkODAwICYmIGNvZGVwdCA8IDB4ZGMwMCAmJiBqICsgMSA8IHJ1bkxpbWl0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb2RlcHQgPSBDaGFyYWN0ZXIuY29kZVBvaW50QXQobUNoYXJzLCBqKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPj0gTGF5b3V0Lk1JTl9FTU9KSSAmJiBjb2RlcHQgPD0gTGF5b3V0Lk1BWF9FTU9KSSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gTGF5b3V0LkVNT0pJX0ZBQ1RPUlkuZ2V0Qml0bWFwRnJvbUFuZHJvaWRQdWEoY29kZXB0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY29kZXB0ID4gMHhmZmZmKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytqOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGogPT0gcnVuTGltaXQgfHwgY29kZXB0ID09ICdcdCcgfHwgYm0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBoICs9IGRyYXdSdW4oYywgaSwgc2Vnc3RhcnQsIGosIHJ1bklzUnRsLCB4K2gsIHRvcCwgeSwgYm90dG9tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgIT0gbGFzdFJ1bkluZGV4IHx8IGogIT0gbUxlbik7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA9PSAnXHQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBoID0gbURpciAqIG5leHRUYWIoaCAqIG1EaXIpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJtICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGJtQXNjZW50ID0gYXNjZW50KGopOworICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgYml0bWFwSGVpZ2h0ID0gYm0uZ2V0SGVpZ2h0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBzY2FsZSA9IC1ibUFzY2VudCAvIGJpdG1hcEhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZHRoID0gYm0uZ2V0V2lkdGgoKSAqIHNjYWxlOworCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW1vamlSZWN0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbW9qaVJlY3QgPSBuZXcgUmVjdEYoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVtb2ppUmVjdC5zZXQoeCArIGgsIHkgKyBibUFzY2VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCArIGggKyB3aWR0aCwgeSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjLmRyYXdCaXRtYXAoYm0sIG51bGwsIGVtb2ppUmVjdCwgbVBhaW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGggKz0gd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICBqKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2Vnc3RhcnQgPSBqICsgMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIG1ldHJpY3MgaW5mb3JtYXRpb24gZm9yIHRoZSBlbnRpcmUgbGluZS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBmbWkgcmVjZWl2ZXMgZm9udCBtZXRyaWNzIGluZm9ybWF0aW9uLCBjYW4gYmUgbnVsbAorICAgICAqIEByZXR1cm4gdGhlIHNpZ25lZCB3aWR0aCBvZiB0aGUgbGluZQorICAgICAqLworICAgIGZsb2F0IG1ldHJpY3MoRm9udE1ldHJpY3NJbnQgZm1pKSB7CisgICAgICAgIHJldHVybiBtZWFzdXJlKG1MZW4sIGZhbHNlLCBmbWkpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgaW5mb3JtYXRpb24gYWJvdXQgYSBwb3NpdGlvbiBvbiB0aGUgbGluZS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBvZmZzZXQgdGhlIGxpbmUtcmVsYXRpdmUgY2hhcmFjdGVyIG9mZnNldCwgYmV0d2VlbiAwIGFuZCB0aGUKKyAgICAgKiBsaW5lIGxlbmd0aCwgaW5jbHVzaXZlCisgICAgICogQHBhcmFtIHRyYWlsaW5nIHRydWUgdG8gbWVhc3VyZSB0aGUgdHJhaWxpbmcgZWRnZSBvZiB0aGUgY2hhcmFjdGVyCisgICAgICogYmVmb3JlIG9mZnNldCwgZmFsc2UgdG8gbWVhc3VyZSB0aGUgbGVhZGluZyBlZGdlIG9mIHRoZSBjaGFyYWN0ZXIKKyAgICAgKiBhdCBvZmZzZXQuCisgICAgICogQHBhcmFtIGZtaSByZWNlaXZlcyBtZXRyaWNzIGluZm9ybWF0aW9uIGFib3V0IHRoZSByZXF1ZXN0ZWQKKyAgICAgKiBjaGFyYWN0ZXIsIGNhbiBiZSBudWxsLgorICAgICAqIEByZXR1cm4gdGhlIHNpZ25lZCBvZmZzZXQgZnJvbSB0aGUgbGVhZGluZyBtYXJnaW4gdG8gdGhlIHJlcXVlc3RlZAorICAgICAqIGNoYXJhY3RlciBlZGdlLgorICAgICAqLworICAgIGZsb2F0IG1lYXN1cmUoaW50IG9mZnNldCwgYm9vbGVhbiB0cmFpbGluZywgRm9udE1ldHJpY3NJbnQgZm1pKSB7CisgICAgICAgIGludCB0YXJnZXQgPSB0cmFpbGluZyA/IG9mZnNldCAtIDEgOiBvZmZzZXQ7CisgICAgICAgIGlmICh0YXJnZXQgPCAwKSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorCisgICAgICAgIGZsb2F0IGggPSAwOworCisgICAgICAgIGlmICghbUhhc1RhYnMpIHsKKyAgICAgICAgICAgIGlmIChtRGlyZWN0aW9ucyA9PSBMYXlvdXQuRElSU19BTExfTEVGVF9UT19SSUdIVCkgeworICAgICAgICAgICAgICAgIHJldHVybiBtZWFzdXJlUnVuKDAsIDAsIG9mZnNldCwgbUxlbiwgZmFsc2UsIGZtaSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobURpcmVjdGlvbnMgPT0gTGF5b3V0LkRJUlNfQUxMX1JJR0hUX1RPX0xFRlQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbWVhc3VyZVJ1bigwLCAwLCBvZmZzZXQsIG1MZW4sIHRydWUsIGZtaSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBjaGFyW10gY2hhcnMgPSBtQ2hhcnM7CisgICAgICAgIGludFtdIHJ1bnMgPSBtRGlyZWN0aW9ucy5tRGlyZWN0aW9uczsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBydW5zLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICBpbnQgcnVuU3RhcnQgPSBydW5zW2ldOworICAgICAgICAgICAgaW50IHJ1bkxpbWl0ID0gcnVuU3RhcnQgKyAocnVuc1tpKzFdICYgTGF5b3V0LlJVTl9MRU5HVEhfTUFTSyk7CisgICAgICAgICAgICBpZiAocnVuTGltaXQgPiBtTGVuKSB7CisgICAgICAgICAgICAgICAgcnVuTGltaXQgPSBtTGVuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYm9vbGVhbiBydW5Jc1J0bCA9IChydW5zW2krMV0gJiBMYXlvdXQuUlVOX1JUTF9GTEFHKSAhPSAwOworCisgICAgICAgICAgICBpbnQgc2Vnc3RhcnQgPSBydW5TdGFydDsKKyAgICAgICAgICAgIGZvciAoaW50IGogPSBtSGFzVGFicyA/IHJ1blN0YXJ0IDogcnVuTGltaXQ7IGogPD0gcnVuTGltaXQ7IGorKykgeworICAgICAgICAgICAgICAgIGludCBjb2RlcHQgPSAwOworICAgICAgICAgICAgICAgIEJpdG1hcCBibSA9IG51bGw7CisKKyAgICAgICAgICAgICAgICBpZiAobUhhc1RhYnMgJiYgaiA8IHJ1bkxpbWl0KSB7CisgICAgICAgICAgICAgICAgICAgIGNvZGVwdCA9IGNoYXJzW2pdOworICAgICAgICAgICAgICAgICAgICBpZiAoY29kZXB0ID49IDB4ZDgwMCAmJiBjb2RlcHQgPCAweGRjMDAgJiYgaiArIDEgPCBydW5MaW1pdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29kZXB0ID0gQ2hhcmFjdGVyLmNvZGVQb2ludEF0KGNoYXJzLCBqKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPj0gTGF5b3V0Lk1JTl9FTU9KSSAmJiBjb2RlcHQgPD0gTGF5b3V0Lk1BWF9FTU9KSSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gTGF5b3V0LkVNT0pJX0ZBQ1RPUlkuZ2V0Qml0bWFwRnJvbUFuZHJvaWRQdWEoY29kZXB0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY29kZXB0ID4gMHhmZmZmKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytqOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGogPT0gcnVuTGltaXQgfHwgY29kZXB0ID09ICdcdCcgfHwgYm0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBib29sZWFuIGluU2VnbWVudCA9IHRhcmdldCA+PSBzZWdzdGFydCAmJiB0YXJnZXQgPCBqOworCisgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gYWR2YW5jZSA9IChtRGlyID09IExheW91dC5ESVJfUklHSFRfVE9fTEVGVCkgPT0gcnVuSXNSdGw7CisgICAgICAgICAgICAgICAgICAgIGlmIChpblNlZ21lbnQgJiYgYWR2YW5jZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGggKz0gbWVhc3VyZVJ1bihpLCBzZWdzdGFydCwgb2Zmc2V0LCBqLCBydW5Jc1J0bCwgZm1pKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGZsb2F0IHcgPSBtZWFzdXJlUnVuKGksIHNlZ3N0YXJ0LCBqLCBqLCBydW5Jc1J0bCwgZm1pKTsKKyAgICAgICAgICAgICAgICAgICAgaCArPSBhZHZhbmNlID8gdyA6IC13OworCisgICAgICAgICAgICAgICAgICAgIGlmIChpblNlZ21lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoICs9IG1lYXN1cmVSdW4oaSwgc2Vnc3RhcnQsIG9mZnNldCwgaiwgcnVuSXNSdGwsIG51bGwpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA9PSAnXHQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2Zmc2V0ID09IGopIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGggPSBtRGlyICogbmV4dFRhYihoICogbURpcik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGFyZ2V0ID09IGopIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChibSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBibUFzY2VudCA9IGFzY2VudChqKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZCA9IGJtLmdldFdpZHRoKCkgKiAtYm1Bc2NlbnQgLyBibS5nZXRIZWlnaHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGggKz0gbURpciAqIHdpZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGorKzsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHNlZ3N0YXJ0ID0gaiArIDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGg7CisgICAgfQorCisgICAgLyoqCisgICAgICogRHJhd3MgYSB1bmlkaXJlY3Rpb25hbCAoYnV0IHBvc3NpYmx5IG11bHRpLXN0eWxlZCkgcnVuIG9mIHRleHQuCisgICAgICoKKyAgICAgKiBAcGFyYW0gYyB0aGUgY2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3Vyc29yID09IGxpbmVTdGFydCkgeworICAgICAgICAgICAgcnVuSW5kZXggPSAtMjsKKyAgICAgICAgfSBlbHNlIGlmIChjdXJzb3IgPT0gbGluZUVuZCkgeworICAgICAgICAgICAgcnVuSW5kZXggPSBydW5zLmxlbmd0aDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAvLyBGaXJzdCwgZ2V0IGluZm9ybWF0aW9uIGFib3V0IHRoZSBydW4gY29udGFpbmluZyB0aGUgY2hhcmFjdGVyIHdpdGgKKyAgICAgICAgICAvLyB0aGUgYWN0aXZlIGNhcmV0LgorICAgICAgICAgIGZvciAocnVuSW5kZXggPSAwOyBydW5JbmRleCA8IHJ1bnMubGVuZ3RoOyBydW5JbmRleCArPSAyKSB7CisgICAgICAgICAgICBydW5TdGFydCA9IGxpbmVTdGFydCArIHJ1bnNbcnVuSW5kZXhdOworICAgICAgICAgICAgaWYgKGN1cnNvciA+PSBydW5TdGFydCkgeworICAgICAgICAgICAgICBydW5MaW1pdCA9IHJ1blN0YXJ0ICsgKHJ1bnNbcnVuSW5kZXgrMV0gJiBMYXlvdXQuUlVOX0xFTkdUSF9NQVNLKTsKKyAgICAgICAgICAgICAgaWYgKHJ1bkxpbWl0ID4gbGluZUVuZCkgeworICAgICAgICAgICAgICAgICAgcnVuTGltaXQgPSBsaW5lRW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGlmIChjdXJzb3IgPCBydW5MaW1pdCkgeworICAgICAgICAgICAgICAgIHJ1bkxldmVsID0gKHJ1bnNbcnVuSW5kZXgrMV0gPj4+IExheW91dC5SVU5fTEVWRUxfU0hJRlQpICYKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0LlJVTl9MRVZFTF9NQVNLOworICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgPT0gcnVuU3RhcnQpIHsKKyAgICAgICAgICAgICAgICAgIC8vIFRoZSBjYXJldCBpcyBvbiBhIHJ1biBib3VuZGFyeSwgc2VlIGlmIHdlIHNob3VsZAorICAgICAgICAgICAgICAgICAgLy8gdXNlIHRoZSBwb3NpdGlvbiBvbiB0aGUgdHJhaWxpbmcgZWRnZSBvZiB0aGUgcHJldmlvdXMKKyAgICAgICAgICAgICAgICAgIC8vIGxvZ2ljYWwgY2hhcmFjdGVyIGluc3RlYWQuCisgICAgICAgICAgICAgICAgICBpbnQgcHJldlJ1bkluZGV4LCBwcmV2UnVuTGV2ZWwsIHByZXZSdW5TdGFydCwgcHJldlJ1bkxpbWl0OworICAgICAgICAgICAgICAgICAgaW50IHBvcyA9IGN1cnNvciAtIDE7CisgICAgICAgICAgICAgICAgICBmb3IgKHByZXZSdW5JbmRleCA9IDA7IHByZXZSdW5JbmRleCA8IHJ1bnMubGVuZ3RoOyBwcmV2UnVuSW5kZXggKz0gMikgeworICAgICAgICAgICAgICAgICAgICBwcmV2UnVuU3RhcnQgPSBsaW5lU3RhcnQgKyBydW5zW3ByZXZSdW5JbmRleF07CisgICAgICAgICAgICAgICAgICAgIGlmIChwb3MgPj0gcHJldlJ1blN0YXJ0KSB7CisgICAgICAgICAgICAgICAgICAgICAgcHJldlJ1bkxpbWl0ID0gcHJldlJ1blN0YXJ0ICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHJ1bnNbcHJldlJ1bkluZGV4KzFdICYgTGF5b3V0LlJVTl9MRU5HVEhfTUFTSyk7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZSdW5MaW1pdCA+IGxpbmVFbmQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldlJ1bkxpbWl0ID0gbGluZUVuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgaWYgKHBvcyA8IHByZXZSdW5MaW1pdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcHJldlJ1bkxldmVsID0gKHJ1bnNbcHJldlJ1bkluZGV4KzFdID4+PiBMYXlvdXQuUlVOX0xFVkVMX1NISUZUKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYgTGF5b3V0LlJVTl9MRVZFTF9NQVNLOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZSdW5MZXZlbCA8IHJ1bkxldmVsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0YXJ0IGZyb20gbG9naWNhbGx5IHByZXZpb3VzIGNoYXJhY3Rlci4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgcnVuSW5kZXggPSBwcmV2UnVuSW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bkxldmVsID0gcHJldlJ1bkxldmVsOworICAgICAgICAgICAgICAgICAgICAgICAgICBydW5TdGFydCA9IHByZXZSdW5TdGFydDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcnVuTGltaXQgPSBwcmV2UnVuTGltaXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWlsaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgICAgLy8gY2FyZXQgbWlnaHQgYmUgPT0gbGluZUVuZC4gIFRoaXMgaXMgZ2VuZXJhbGx5IGEgc3BhY2Ugb3IgcGFyYWdyYXBoCisgICAgICAgICAgLy8gc2VwYXJhdG9yIGFuZCBoYXMgYW4gYXNzb2NpYXRlZCBydW4sIGJ1dCBtaWdodCBiZSB0aGUgZW5kIG9mCisgICAgICAgICAgLy8gdGV4dCwgaW4gd2hpY2ggY2FzZSBpdCBkb2Vzbid0LiAgSWYgdGhhdCBoYXBwZW5zLCB3ZSByYW4gb2ZmIHRoZQorICAgICAgICAgIC8v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ICAgICBvdGhlclJ1bkxpbWl0ID0gbGluZUVuZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBvdGhlclJ1bkxldmVsID0gKHJ1bnNbb3RoZXJSdW5JbmRleCsxXSA+Pj4gTGF5b3V0LlJVTl9MRVZFTF9TSElGVCkgJgorICAgICAgICAgICAgICAgIExheW91dC5SVU5fTEVWRUxfTUFTSzsKKyAgICAgICAgICAgIGJvb2xlYW4gb3RoZXJSdW5Jc1J0bCA9IChvdGhlclJ1bkxldmVsICYgMSkgIT0gMDsKKworICAgICAgICAgICAgYWR2YW5jZSA9IHRvTGVmdCA9PSBvdGhlclJ1bklzUnRsOworICAgICAgICAgICAgaWYgKG5ld0NhcmV0ID09IC0xKSB7CisgICAgICAgICAgICAgICAgbmV3Q2FyZXQgPSBnZXRPZmZzZXRCZWZvcmVBZnRlcihvdGhlclJ1bkluZGV4LCBvdGhlclJ1blN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgb3RoZXJSdW5MaW1pdCwgb3RoZXJSdW5Jc1J0bCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGFkdmFuY2UgPyBvdGhlclJ1blN0YXJ0IDogb3RoZXJSdW5MaW1pdCwgYWR2YW5jZSk7CisgICAgICAgICAgICAgICAgaWYgKG5ld0NhcmV0ID09IChhZHZhbmNlID8gb3RoZXJSdW5MaW1pdCA6IG90aGVyUnVuU3RhcnQpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIENyb3NzZWQgYW5kIGVuZGVkIHVwIGF0IGEgbmV3IGJvdW5kYXJ5LAorICAgICAgICAgICAgICAgICAgICAvLyByZXBlYXQgYSBzZWNvbmQgYW5kIGZpbmFsIHRpbWUuCisgICAgICAgICAgICAgICAgICAgIHJ1bkluZGV4ID0gb3RoZXJSdW5JbmRleDsKKyAgICAgICAgICAgICAgICAgICAgcnVuTGV2ZWwgPSBvdGhlclJ1bkxldmVsOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFRoZSBuZXcgY2FyZXQgaXMgYXQgYSBib3VuZGFyeS4KKyAgICAgICAgICAgIGlmIChvdGhlclJ1bkxldmVsIDwgcnVuTGV2ZWwpIHsKKyAgICAgICAgICAgICAgLy8gVGhlIHN0cm9uZyBjaGFyYWN0ZXIgaXMgaW4gdGhlIG90aGVyIHJ1bi4KKyAgICAgICAgICAgICAgbmV3Q2FyZXQgPSBhZHZhbmNlID8gb3RoZXJSdW5TdGFydCA6IG90aGVyUnVuTGltaXQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBpZiAobmV3Q2FyZXQgPT0gLTEpIHsKKyAgICAgICAgICAgICAgLy8gV2UncmUgd2Fsa2luZyBvZmYgdGhlIGVuZCBvZiB0aGUgbGluZS4gIFRoZSBwYXJhZ3JhcGgKKyAgICAgICAgICAgICAgLy8gbGV2ZWwgaXMgYWx3YXlzIGVxdWFsIHRvIG9yIGxvd2VyIHRoYW4gYW55IGludGVybmFsIGxldmVsLCBzbworICAgICAgICAgICAgICAvLyB0aGUgYm91bmRhcmllcyBnZXQgdGhlIHN0cm9uZyBjYXJldC4KKyAgICAgICAgICAgICAgbmV3Q2FyZXQgPSBhZHZhbmNlID8gbUxlbiArIDEgOiAtMTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgfQorCisgICAgICAgICAgLy8gRWxzZSB3ZSd2ZSBhcnJpdmVkIGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUuICBUaGF0J3MgYSBzdHJvbmcgcG9zaXRpb24uCisgICAgICAgICAgLy8gV2UgbWlnaHQgaGF2ZSBhcnJpdmVkIGhlcmUgYnkgY3Jvc3Npbmcgb3ZlciBhIHJ1biB3aXRoIG5vIGludGVybmFsCisgICAgICAgICAgLy8gYnJlYWtzIGFuZC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ZSBvbiBvdGhlciBsaW5lcywgd2UgY2FuJ3QKKyAgICAgICAgICAgIC8vIHJldHVybiBhY2N1cmF0ZSB2YWx1ZXMuICBUaGVzZSBhcmUgYSBndWVzcy4KKyAgICAgICAgICAgIGlmIChhZnRlcikgeworICAgICAgICAgICAgICAgIHJldHVybiBUZXh0VXRpbHMuZ2V0T2Zmc2V0QWZ0ZXIobVRleHQsIG9mZnNldCArIG1TdGFydCkgLSBtU3RhcnQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gVGV4dFV0aWxzLmdldE9mZnNldEJlZm9yZShtVGV4dCwgb2Zmc2V0ICsgbVN0YXJ0KSAtIG1TdGFydDsKKyAgICAgICAgfQorCisgICAgICAgIFRleHRQYWludCB3cCA9IG1Xb3JrUGFpbnQ7CisgICAgICAgIHdwLnNldChtUGFpbnQpOworCisgICAgICAgIGludCBzcGFuU3RhcnQgPSBydW5TdGFydDsKKyAgICAgICAgaW50IHNwYW5MaW1pdDsKKyAgICAgICAgaWYgKG1TcGFubmVkID09IG51bGwpIHsKKyAgICAgICAgICAgIHNwYW5MaW1pdCA9IHJ1bkxpbWl0OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaW50IHRhcmdldCA9IGFmdGVyID8gb2Zmc2V0ICsgMSA6IG9mZnNldDsKKyAgICAgICAgICAgIGludCBsaW1pdCA9IG1TdGFydCArIHJ1bkxpbWl0OworICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgICAgICBzcGFuTGltaXQgPSBtU3Bhbm5lZC5uZXh0U3BhblRyYW5zaXRpb24obVN0YXJ0ICsgc3BhblN0YXJ0LCBsaW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3MpIC0gbVN0YXJ0OworICAgICAgICAgICAgICAgIGlmIChzcGFuTGltaXQgPj0gdGFyZ2V0KSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzcGFuU3RhcnQgPSBzcGFuTGltaXQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW5bXSBzcGFucyA9IG1TcGFubmVkLmdldFNwYW5zKG1TdGFydCArIHNwYW5TdGFydCwKKyAgICAgICAgICAgICAgICAgICAgbVN0YXJ0ICsgc3BhbkxpbWl0LCBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzKTsKKworICAgICAgICAgICAgaWYgKHNwYW5zLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICBSZXBsYWNlbWVudFNwYW4gcmVwbGFjZW1lbnQgPSBudWxsOworICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgc3BhbnMubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgTWV0cmljQWZmZWN0aW5nU3BhbiBzcGFuID0gc3BhbnNbal07CisgICAgICAgICAgICAgICAgICAgIGlmIChzcGFuIGluc3RhbmNlb2YgUmVwbGFjZW1lbnRTcGFuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXBsYWNlbWVudCA9IChSZXBsYWNlbWVudFNwYW4pc3BhbjsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYW4udXBkYXRlTWVhc3VyZVN0YXRlKHdwKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChyZXBsYWNlbWVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIElmIHdlIGhhdmUgYSByZXBsYWNlbWVudCBzcGFuLCB3ZSdyZSBtb3ZpbmcgZWl0aGVyIHRvCisgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBzdGFydCBvciBlbmQgb2YgdGhpcyBzcGFuLgorICAgICAgICAgICAgICAgICAgIC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IGludCBydW5MZW4gPSBlbmQgLSBzdGFydDsKKyAgICAgICAgaW50IGNvbnRleHRMZW4gPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICBpZiAobmVlZFdpZHRoIHx8IChjICE9IG51bGwgJiYgKHdwLmJnQ29sb3IgIT0gMCB8fCBydW5Jc1J0bCkpKSB7CisgICAgICAgICAgICBpbnQgZmxhZ3MgPSBydW5Jc1J0bCA/IFBhaW50LkRJUkVDVElPTl9SVEwgOiBQYWludC5ESVJFQ1RJT05fTFRSOworICAgICAgICAgICAgaWYgKG1DaGFyc1ZhbGlkKSB7CisgICAgICAgICAgICAgICAgcmV0ID0gd3AuZ2V0VGV4dFJ1bkFkdmFuY2VzKG1DaGFycywgc3RhcnQsIHJ1bkxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHRTdGFydCwgY29udGV4dExlbiwgZmxhZ3MsIG51bGwsIDApOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpbnQgZGVsdGEgPSBtU3RhcnQ7CisgICAgICAgICAgICAgICAgcmV0ID0gd3AuZ2V0VGV4dFJ1bkFkdmFuY2VzKG1UZXh0LCBkZWx0YSArIHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGEgKyBlbmQsIGRlbHRhICsgY29udGV4dFN0YXJ0LCBkZWx0YSArIGNvbnRleHRFbmQsCisgICAgICAgICAgICAgICAgICAgICAgICBmbGFncywgbnVsbCwgMCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoZm1pICE9IG51bGwpIHsKKyAgICAgICAgICAgIHdwLmdldEZvbnRNZXRyaWNzSW50KGZtaSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoYyAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAocnVuSXNSdGwpIHsKKyAgICAgICAgICAgICAgICB4IC09IHJldDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHdwLmJnQ29sb3IgIT0gMCkgeworICAgICAgICAgICAgICAgIGludCBjb2xvciA9IHdwLmdldENvbG9yKCk7CisgICAgICAgICAgICAgICAgUGFpbnQuU3R5bGUgcyA9IHdwLmdldFN0eWxlKCk7CisgICAgICAgICAgICAgICAgd3Auc2V0Q29sb3Iod3AuYmdDb2xvcik7CisgICAgICAgICAgICAgICAgd3Auc2V0U3R5bGUoUGFpbnQuU3R5bGUuRklMTCk7CisKKyAgICAgICAgICAgICAgICBjLmRyYXdSZWN0KHgsIHRvcCwgeCArIHJldCwgYm90dG9tLCB3cCk7CisKKyAgICAgICAgICAgICAgICB3cC5zZXRTdHlsZShzKTsKKyAgICAgICAgICAgICAgICB3cC5zZXRDb2xvcihjb2xvcik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGRyYXdUZXh0UnVuKGMsIHdwLCBzdGFydCwgZW5kLCBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIHJ1bklzUnRsLAorICAgICAgICAgICAgICAgICAgICB4LCB5ICsgd3AuYmFzZWxpbmVTaGlmdCk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gcnVuSXNSdGwgPyAtcmV0IDogcmV0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFV0aWxpdHkgZnVuY3Rpb24gZm9yIG1lYXN1cmluZyBhbmQgcmVuZGVyaW5nIGEgcmVwbGFjZW1lbnQuCisgICAgICoKKyAgICAgKiBAcGFyYW0gcmVwbGFjZW1lbnQgdGhlIHJlcGxhY2VtZW50CisgICAgICogQHBhcmFtIHdwIHRoZSB3b3JrIHBhaW50CisgICAgICogQHBhcmFtIHJ1bkluZGV4IHRoZSBydW4gaW5kZXgKKyAgICAgKiBAcGFyYW0gc3RhcnQgdGhlIHN0YXJ0IG9mIHRoZSBydW4KKyAgICAgKiBAcGFyYW0gbGltaXQgdGhlIGxpbWl0IG9mIHRoZSBydW4KKyAgICAgKiBAcGFyYW0gcnVuSXNSdGwgdHJ1ZSBpZ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gICAgICAvLyBidXQgcmVuZGVyaW5nIG5lZWRzIHRvIHRha2UgaW50byBhY2NvdW50IGNoYXJhY3RlciBzdHlsZSBib3VuZGFyaWVzLgorICAgICAgICAvLyBTbyB3ZSBpdGVyYXRlIHRocm91Z2ggbWV0cmljIHJ1bnMgdG8gZ2V0IG1ldHJpYyBib3VuZHMsCisgICAgICAgIC8vIHRoZW4gd2l0aGluIGVhY2ggbWV0cmljIHJ1biBpdGVyYXRlIHRocm91Z2ggY2hhcmFjdGVyIHN0eWxlIHJ1bnMKKyAgICAgICAgLy8gZm9yIHRoZSBydW4gYm91bmRzLgorICAgICAgICBmbG9hdCBveCA9IHg7CisgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCwgaW5leHQ7IGkgPCBtZWFzdXJlTGltaXQ7IGkgPSBpbmV4dCkgeworICAgICAgICAgICAgVGV4dFBhaW50IHdwID0gbVdvcmtQYWludDsKKyAgICAgICAgICAgIHdwLnNldChtUGFpbnQpOworCisgICAgICAgICAgICBpbnQgbWxpbWl0OworICAgICAgICAgICAgaWYgKG1TcGFubmVkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpbmV4dCA9IGxpbWl0OworICAgICAgICAgICAgICAgIG1saW1pdCA9IG1lYXN1cmVMaW1pdDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaW5leHQgPSBtU3Bhbm5lZC5uZXh0U3BhblRyYW5zaXRpb24obVN0YXJ0ICsgaSwgbVN0YXJ0ICsgbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzKSAtIG1TdGFydDsKKworICAgICAgICAgICAgICAgIG1saW1pdCA9IGluZXh0IDwgbWVhc3VyZUxpbWl0ID8gaW5leHQgOiBtZWFzdXJlTGltaXQ7CisgICAgICAgICAgICAgICAgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zID0gbVNwYW5uZWQuZ2V0U3BhbnMobVN0YXJ0ICsgaSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TdGFydCArIG1saW1pdCwgTWV0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcyk7CisKKyAgICAgICAgICAgICAgICBpZiAoc3BhbnMubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgICAgICBSZXBsYWNlbWVudFNwYW4gcmVwbGFjZW1lbnQgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IHNwYW5zLmxlbmd0aDsgaisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuIHNwYW4gPSBzcGFuc1tqXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcGFuIGluc3RhbmNlb2YgUmVwbGFjZW1lbnRTcGFuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGFjZW1lbnQgPSAoUmVwbGFjZW1lbnRTcGFuKXNwYW47CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIG1pZ2h0IGhhdmUgYSByZXBsYWNlbWVudCB0aGF0IHVzZXMgdGhlIGRyYXcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzdGF0ZSwgb3RoZXJ3aXNlIG1lYXN1cmUgc3RhdGUgd291bGQgc3VmZmljZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFuLnVwZGF0ZURyYXdTdGF0ZSh3cCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAocmVwbGFjZW1lbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgeCArPSBoYW5kbGVSZXBsYWNlbWVudChyZXBsYWNlbWVudCwgd3AsIHJ1bkluZGV4LCBpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtbGltaXQsIHJ1bklzUnRsLCBjLCB4LCB0b3AsIHksIGJvdHRvbSwgZm1pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkV2lkdGggfHwgbWxpbWl0IDwgbWVhc3VyZUxpbWl0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobVNwYW5uZWQgPT0gbnVsbCB8fCBjID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB4ICs9IGhhbmRsZVRleHQod3AsIGksIG1saW1pdCwgaSwgaW5leHQsIHJ1bklzUnRsLCBjLCB4LCB0b3AsCisgICAgICAgICAgICAgICAgICAgICAgICB5LCBib3R0b20sIGZtaSwgbmVlZFdpZHRoIHx8IG1saW1pdCA8IG1lYXN1cmVMaW1pdCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSBpLCBqbmV4dDsgaiA8IG1saW1pdDsgaiA9IGpuZXh0KSB7CisgICAgICAgICAgICAgICAgICAgIGpuZXh0ID0gbVNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKG1TdGFydCArIGosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0ICsgbWxpbWl0LCBDaGFyYWN0ZXJTdHlsZS5jbGFzcykgLSBtU3RhcnQ7CisKKyAgICAgICAgICAgICAgICAgICAgQ2hhcmFjdGVyU3R5bGVbXSBzcGFucyA9IG1TcGFubmVkLmdldFNwYW5zKG1TdGFydCArIGosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0ICsgam5leHQsIENoYXJhY3RlclN0eWxlLmNsYXNzKTsKKworICAgICAgICAgICAgICAgICAgICB3cC5zZXQobVBhaW50KTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgayA9IDA7IGsgPCBzcGFucy5sZW5ndGg7IGsrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgQ2hhcmFjdGVyU3R5bGUgc3BhbiA9IHNwYW5zW2tdOworICAgICAgICAgICAgICAgICAgICAgICAgc3Bhbi51cGRhdGVEcmF3U3RhdGUod3ApOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgeCArPSBoYW5kbGVUZXh0KHdwLCBqLCBqbmV4dCwgaSwgaW5leHQsIHJ1bklzUnRsLCBjLCB4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcCwgeSwgYm90dG9tLCBmbWksIG5lZWRXaWR0aCB8fCBqbmV4dCA8IG1lYXN1cmVMaW1pdCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHggLSBveDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZW5kZXIgYSB0ZXh0IHJ1biB3aXRoIHRoZSBzZXQtdXAgcGFpbnQuCisgICAgICoKKyAgICAgKiBAcGFyYW0gYyB0aGUgY2FudmFzCisgICAgICogQHBhcmFtIHdwIHRoZSBwYWludCB1c2VkIHRvIHJlbmRlciB0aGUgdGV4dAorICAgICAqIEBwYXJhbSBzdGFydCB0aGUgc3RhcnQgb2YgdGhlIHJ1bgorICAgICAqIEBwYXJhbSBlbmQgdGhlIGVuZCBvZiB0aGUgcnVuCisgICAgICogQHBhcmFtIGNvbnRleHRTdGFydCB0aGUgc3RhcnQgb2YgY29udGV4dCBmb3IgdGhlIHJ1bgorICAgICAqIEBwYXJhbSBjb250ZXh0RW5kIHRoZSBlbmQgb2YgdGhlIGNvbnRleHQgZm9yIHRoZSBydW4KKyAgICAgKiBAcGFyYW0gcnVuSXNSdGwgdHJ1ZSBpZiB0aGUgcnVuIGlzIHJpZ2h0LXRvLWxlZnQKKyAgICAgKiBAcGFyYW0geCB0aGUgeCBwb3NpdGlvbiBvZiB0aGUgbGVmdCBlZGdlIG9mIHRoZSBydW4KKyAgICAgKiBAcGFyYW0geSB0aGUgYmFzZWxpbmUgb2YgdGhlIHJ1bgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBkcmF3VGV4dFJ1bihDYW52YXMgYywgVGV4dFBhaW50IHdwLCBpbnQgc3RhcnQsIGludCBlbmQsCisgICAgICAgICAgICBpbnQgY29udGV4dFN0YXJ0LCBpbnQgY29udGV4dEVuZCwgYm9vbGVhbiBydW5Jc1J0bCwgZmxvYXQgeCwgaW50IHkpIHsKKworICAgICAgICBpbnQgZmxhZ3MgPSBydW5Jc1J0bCA/IENhbnZhcy5ESVJFQ1RJT05fUlRMIDogQ2FudmFzLkRJUkVDVElPTl9MVFI7CisgICAgICAgIGlmIChtQ2hhcnNWYWxpZCkgeworICAgICAgICAgICAgaW50IGNvdW50ID0gZW5kIC0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgY29udGV4dENvdW50ID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgIGMuZHJhd1RleHRSdW4obUNoYXJzLCBzdGFydCwgY291bnQsIGNvbnRleHRTdGFydCwgY29udGV4dENvdW50LAorICAgICAgICAgICAgICAgICAgICB4LCB5LCBmbGFncywgd3ApOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaW50IGRlbHRhID0gbVN0YXJ0OworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihtVGV4dCwgZGVsdGEgKyBzdGFydCwgZGVsdGEgKyBlbmQsCisgICAgICAgICAgICAgICAgICAgIGRlbHRhICsgY29udGV4dFN0YXJ0LCBkZWx0YSArIGNvbnRleHRFbmQsIHgsIHksIGZsYWdzLCB3cCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBhc2NlbnQgb2YgdGhlIHRleHQgYXQgc3RhcnQuICBUaGlzIGlzIHVzZWQgZm9yIHNjYWxpbmcKKyAgICAgKiBlbW9qaS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBwb3MgdGhlIGxpbmUtcmVsYXRpdmUgcG9zaXRpb24KKyAgICAgKiBAcmV0dXJuIHRoZSBhc2NlbnQgb2YgdGhlIHRleHQgYXQgc3RhcnQKKyAgICAgKi8KKyAgICBmbG9hdCBhc2NlbnQoaW50IHBvcykgeworICAgICAgICBpZiAobVNwYW5uZWQgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG1QYWludC5hc2NlbnQoKTsKKyAgICAgICAgfQorCisgICAgICAgIHBvcyArPSBtU3RhcnQ7CisgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW5bXSBzcGFucyA9IG1TcGFubmVkLmdldFNwYW5zKHBvcywgcG9zICsgMSwKKyAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzKTsKKyAgICAgICAgaWYgKHNwYW5zLmxlbmd0aCA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gbVBhaW50LmFzY2VudCgpOworICAgICAgICB9CisKKyAgICAgICAgVGV4dFBhaW50IHdwID0gbVdvcmtQYWludDsKKyAgICAgICAgd3Auc2V0KG1QYWludCk7CisgICAgICAgIGZvciAoTWV0cmljQWZmZWN0aW5nU3BhbiBzcGFuIDogc3BhbnMpIHsKKyAgICAgICAgICAgIHNwYW4udXBkYXRlTWVhc3VyZVN0YXRlKHdwKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gd3AuYXNjZW50KCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgbmV4dCB0YWIgcG9zaXRpb24uCisgICAgICoKKyAgICAgKiBAcGFyYW0gaCB0aGUgKHVuc2lnbmVkKSBvZmZzZXQgZnJvbSB0aGUgbGVhZGluZyBtYXJnaW4KKyAgICAgKiBAcmV0dXJuIHRoZSAodW5zaWduZWQpIHRhYiBwb3NpdGlvbiBhZnRlciB0aGlzIG9mZnNldAorICAgICAqLworICAgIGZsb2F0IG5leHRUYWIoZmxvYXQg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XJvLXdpZHRoIHNwYWNlcyB0byBwcmVzZXJ2ZSB0aGUgb3JpZ2luYWwKQEAgLTk5Miw3ICs5ODksNyBAQAogICAgICAqIHJlcG9ydCB0aGUgc3RhcnQgYW5kIGVuZCBvZiB0aGUgZWxsaXBzaXplZCByYW5nZS4KICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIENoYXJTZXF1ZW5jZSBlbGxpcHNpemUoQ2hhclNlcXVlbmNlIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCBwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgcGFpbnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGF2YWlsLCBUcnVuY2F0ZUF0IHdoZXJlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIHByZXNlcnZlTGVuZ3RoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGxpcHNpemVDYWxsYmFjayBjYWxsYmFjaykgewpAQCAtMTAwMywxMyArMTAwMCwxMiBAQAogCiAgICAgICAgIGludCBsZW4gPSB0ZXh0Lmxlbmd0aCgpOwogCi0gICAgICAgIC8vIFVzZSBQYWludC5icmVha1RleHQoKSBmb3IgdGhlIG5vbi1TcGFubmVkIGNhc2UgdG8gYXZvaWQgaGF2aW5nCi0gICAgICAgIC8vIHRvIGFsbG9jYXRlIG1lbW9yeSBhbmQgYWNjdW11bGF0ZSB0aGUgY2hhcmFjdGVyIHdpZHRocyBvdXJzZWx2ZXMuCisgICAgICAgIE1lYXN1cmVkVGV4dCBtdCA9IE1lYXN1cmVkVGV4dC5vYnRhaW4oKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGZsb2F0IHdpZHRoID0gc2V0UGFyYShtdCwgcGFpbnQsIHRleHQsIDAsIHRleHQubGVuZ3RoKCksCisgICAgICAgICAgICAgICAgICAgIExheW91dC5ESVJfUkVRVUVTVF9ERUZBVUxUX0xUUik7CiAKLSAgICAgICAgaWYgKCEodGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpKSB7Ci0gICAgICAgICAgICBmbG9hdCB3aWQgPSBwLm1lYXN1cmVUZXh0KHRleHQsIDAsIGxlbik7Ci0KLSAgICAgICAgICAgIGlmICh3aWQgPD0gYXZhaWwpIHsKKyAgICAgICAgICAgIGlmICh3aWR0aCA8PSBhdmFpbCkgewogICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLmVsbGlwc2l6ZWQoMCwgMCk7CiAgICAgICAgICAgICAgICAgfQpAQCAtMTAxNywyNTAgKzEwMTMsNjkgQEAKICAgICAgICAgICAgICAgICByZXR1cm4gdGV4dDsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgZmxvYXQgZWxsaXBzaXN3aWQgPSBwLm1lYXN1cmVUZXh0KHNFbGxpcHNpcyk7CisgICAgICAgICAgICAvLyBYWFggYXNzdW1lcyBlbGxpcHNpcyBzdHJpbmcgZG9lcyBub3QgcmVxdWlyZSBzaGFwaW5nIGFuZAorICAgICAgICAgICAgLy8gaXMgdW5hZmZlY3RlZCBieSBzdHlsZQorICAgICAgICAgICAgZmxvYXQgZWxsaXBzaXN3aWQgPSBwYWludC5tZWFzdXJlVGV4dChzRWxsaXBzaXMpOworICAgICAgICAgICAgYXZhaWwgLT0gZWxsaXBzaXN3aWQ7CiAKLSAgICAgICAgICAgIGlmIChlbGxpcHNpc3dpZCA+IGF2YWlsKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZCgwLCBsZW4pOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChwcmVzZXJ2ZUxlbmd0aCkgewotICAgICAgICAgICAgICAgICAgICBjaGFyW10gYnVmID0gb2J0YWluKGxlbik7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZltpXSA9ICdcdUZFRkYnOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyByZXQgPSBuZXcgU3RyaW5nKGJ1ZiwgMCwgbGVuKTsKLSAgICAgICAgICAgICAgICAgICAgcmVjeWNsZShidWYpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0OwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiAiIjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICh3aGVyZSA9PSBUcnVuY2F0ZUF0LlNUQVJUKSB7Ci0gICAgICAgICAgICAgICAgaW50IGZpdCA9IHAuYnJlYWtUZXh0KHRleHQsIDAsIGxlbiwgZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsIC0gZWxsaXBzaXN3aWQsIG51bGwpOwotCi0gICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZCgwLCBsZW4gLSBmaXQpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChwcmVzZXJ2ZUxlbmd0aCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmxhbmsodGV4dCwgMCwgbGVuIC0gZml0KTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gc0VsbGlwc2lzICsgdGV4dC50b1N0cmluZygpLnN1YnN0cmluZyhsZW4gLSBmaXQsIGxlbik7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaW50IGxlZnQgPSAwOworICAgICAgICAgICAgaW50IHJpZ2h0ID0gbGVuOworICAgICAgICAgICAgaWYgKGF2YWlsIDwgMCkgeworICAgICAgICAgICAgICAgIC8vIGl0IGFsbCBnb2VzCisgICAgICAgICAgICB9IGVsc2UgaWYgKHdoZXJlID09IFRydW5jYXRlQXQuU1RBUlQpIHsKKyAgICAgICAgICAgICAgICByaWdodCA9IGxlbiAtIG10LmJyZWFrVGV4dCgwLCBsZW4sIGZhbHNlLCBhdmFpbCk7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKHdoZXJlID09IFRydW5jYXRlQXQuRU5EKSB7Ci0gICAgICAgICAgICAgICAgaW50IGZpdCA9IHAuYnJlYWtUZXh0KHRleHQsIDAsIGxlbiwgdHJ1ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWwgLSBlbGxpcHNpc3dpZCwgbnVsbCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKGZpdCwgbGVuKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAocHJlc2VydmVMZW5ndGgpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJsYW5rKHRleHQsIGZpdCwgbGVuKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGV4dC50b1N0cmluZygpLnN1YnN0cmluZygwLCBmaXQpICsgc0VsbGlwc2lzOwotICAgICAgICAgICAgICAgIH0gCi0gICAgICAgICAgICB9IGVsc2UgLyogd2hlcmUgPT0gVHJ1bmNhdGVBdC5NSURETEUgKi8gewotICAgICAgICAgICAgICAgIGludCByaWdodCA9IHAuYnJlYWtUZXh0KHRleHQsIDAsIGxlbiwgZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGF2YWlsIC0gZWxsaXBzaXN3aWQpIC8gMiwgbnVsbCk7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdXNlZCA9IHAubWVhc3VyZVRleHQodGV4dCwgbGVuIC0gcmlnaHQsIGxlbik7Ci0gICAgICAgICAgICAgICAgaW50IGxlZnQgPSBwLmJyZWFrVGV4dCh0ZXh0LCAwLCBsZW4gLSByaWdodCwgdHJ1ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsIC0gZWxsaXBzaXN3aWQgLSB1c2VkLCBudWxsKTsKLQotICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLmVsbGlwc2l6ZWQobGVmdCwgbGVuIC0gcmlnaHQpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChwcmVzZXJ2ZUxlbmd0aCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmxhbmsodGV4dCwgbGVmdCwgbGVuIC0gcmlnaHQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBzID0gdGV4dC50b1N0cmluZygpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gcy5zdWJzdHJpbmcoMCwgbGVmdCkgKyBzRWxsaXBzaXMgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgcy5zdWJzdHJpbmcobGVuIC0gcmlnaHQsIGxlbik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLy8gQnV0IGRvIHRoZSBTcGFubmVkIGNhc2VzIGJ5IGhhbmQsIGJlY2F1c2UgaXQncyBzdWNoIGEgcGFpbgotICAgICAgICAvLyB0byBpdGVyYXRlIHRoZS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iArIGldOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHN1bSA8PSBhdmFpbCkgewotICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKDAsIDApOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gdGV4dDsKLSAgICAgICAgfQotCi0gICAgICAgIGZsb2F0IGVsbGlwc2lzd2lkID0gcC5tZWFzdXJlVGV4dChzRWxsaXBzaXMpOwotCi0gICAgICAgIGlmIChlbGxpcHNpc3dpZCA+IGF2YWlsKSB7Ci0gICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGNhbGxiYWNrLmVsbGlwc2l6ZWQoMCwgbGVuKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgY2hhcltdIGJ1ZiA9IG9idGFpbihsZW4pOwotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgYnVmW2ldID0gJ1x1RkVGRic7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZyBzcyA9IG5ldyBTcGFubmFibGVTdHJpbmcobmV3IFN0cmluZyhidWYsIDAsIGxlbikpOwotICAgICAgICAgICAgICAgIHJlY3ljbGUoYnVmKTsKLSAgICAgICAgICAgICAgICBjb3B5U3BhbnNGcm9tKHNwLCAwLCBsZW4sIE9iamVjdC5jbGFzcywgc3MsIDApOwotICAgICAgICAgICAgICAgIHJldHVybiBzczsKKyAgICAgICAgICAgICAgICBsZWZ0ID0gbXQuYnJlYWtUZXh0KDAsIGxlbiwgdHJ1ZSwgYXZhaWwpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gIiI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAod2hlcmUgPT0gVHJ1bmNhdGVBdC5TVEFSVCkgewotICAgICAgICAgICAgc3VtID0gMDsKLSAgICAgICAgICAgIGludCBpOwotCi0gICAgICAgICAgICBmb3IgKGkgPSBsZW47IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZFtsZW4gKyBpIC0gMV07Ci0KLSAgICAgICAgICAgICAgICBpZiAodyArIHN1bSArIGVsbGlwc2lzd2lkID4gYXZhaWwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgc3VtICs9IHc7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZCgwLCBpKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nIHNzID0gbmV3IFNwYW5uYWJsZVN0cmluZyhibGFuayh0ZXh0LCAwLCBpKSk7Ci0gICAgICAgICAgICAgICAgY29weVNwYW5zRnJvbShzcCwgMCwgbGVuLCBPYmplY3QuY2xhc3MsIHNzLCAwKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gc3M7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIgb3V0ID0gbmV3IFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIoc0VsbGlwc2lzKTsKLSAgICAgICAgICAgICAgICBvdXQuaW5zZXJ0KDEsIHRleHQsIGksIGxlbik7Ci0KLSAgICAgICAgICAgICAgICByZXR1cm4gb3V0OwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKHdoZXJlID09IFRydW5jYXRlQXQuRU5EKSB7Ci0gICAgICAgICAgICBzdW0gPSAwOwotICAgICAgICAgICAgaW50IGk7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkrKykgewotICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWRbbGVuICsgaV07Ci0KLSAgICAgICAgICAgICAgICBpZiAodyArIHN1bSArIGVsbGlwc2lzd2lkID4gYXZhaWwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgc3VtICs9IHc7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZChpLCBsZW4pOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocHJlc2VydmVMZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBTcGFubmFibGVTdHJpbmcgc3MgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nKGJsYW5rKHRleHQsIGksIGxlbikpOwotICAgICAgICAgICAgICAgIGNvcHlTcGFuc0Zyb20oc3AsIDAsIGxlbiwgT2JqZWN0LmNsYXNzLCBzcywgMCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHNzOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBTcGFubmFibGVTdHJpbmdCdWlsZGVyIG91dCA9IG5ldyBTcGFubmFibGVTdHJpbmdCdWlsZGVyKHNFbGxpcHNpcyk7Ci0gICAgICAgICAgICAgICAgb3V0Lmluc2VydCgwLCB0ZXh0LCAwLCBpKTsKLQotICAgICAgICAgICAgICAgIHJldHVybiBvdXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSAvKiB3aGVyZSA9IFRydW5jYXRlQXQuTUlERExFICovIHsKLSAgICAgICAgICAgIGZsb2F0IGxzdW0gPSAwLCByc3VtID0gMDsKLSAgICAgICAgICAgIGludCBsZWZ0ID0gMCwgcmlnaHQgPSBsZW47Ci0KLSAgICAgICAgICAgIGZsb2F0IHJhdmFpbCA9IChhdmFpbCAtIGVsbGlwc2lzd2lkKSAvIDI7Ci0gICAgICAgICAgICBmb3IgKHJpZ2h0ID0gbGVuOyByaWdodCA+PSAwOyByaWdodC0tKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZFtsZW4gKyByaWdodCAtIDFdOwotCi0gICAgICAgICAgICAgICAgaWYgKHcgKyByc3VtID4gcmF2YWlsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHJzdW0gKz0gdzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZmxvYXQgbGF2YWlsID0gYXZhaWwgLSBlbGxpcHNpc3dpZCAtIHJzdW07Ci0gICAgICAgICAgICBmb3IgKGxlZnQgPSAwOyBsZWZ0IDwgcmlnaHQ7IGxlZnQrKykgewotICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWRbbGVuICsgbGVmdF07Ci0KLSAgICAgICAgICAgICAgICBpZiAodyArIGxzdW0gPiBsYXZhaWwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbHN1bSArPSB3OworICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVuIC0gbXQuYnJlYWtUZXh0KDAsIGxlbiwgZmFsc2UsIGF2YWlsIC8gMik7CisgICAgICAgICAgICAgICAgYXZhaWwgLT0gbXQubWVhc3VyZShyaWdodCwgbGVuKTsKKyAgICAgICAgICAgICAgICBsZWZ0ID0gbXQuYnJlYWtUZXh0KDAsIHJpZ2h0LCB0cnVlLCBhdmFpbCk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZChsZWZ0LCByaWdodCk7CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIGNoYXJbXSBidWYgPSBtdC5tQ2hhcnM7CisgICAgICAgICAgICBTcGFubmVkIHNwID0gdGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQgPyAoU3Bhbm5lZCkgdGV4dCA6IG51bGw7CisKKyAgICAgICAgICAgIGludCByZW1haW5pbmcgPSBsZW4gLSAocmlnaHQgLSBsZWZ0KTsKICAgICAgICAgICAgIGlmIChwcmVzZXJ2ZUxlbmd0aCkgewotICAgICAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZyBzcyA9IG5ldyBTcGFubmFibGVTdHJpbmcoYmxhbmsodGV4dCwgbGVmdCwgcmlnaHQpKTsKKyAgICAgICAgICAgICAgICBpZiAocmVtYWluaW5nID4gMCkgeyAvLyBlbHNlIGVsaW1pbmF0ZSB0aGUgZWxsaXBzaXMgdG9vCisgICAgICAgICAgICAgICAgICAgIGJ1ZltsZWZ0KytdID0gJ1x1MjAyNic7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSBsZWZ0OyBpIDwgcmlnaHQ7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBidWZbaV0gPSAnXHVGRUZGJzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgU3RyaW5nIHMgPSBuZXcgU3RyaW5nKGJ1ZiwgMCwgbGVuKTsKKyAgICAgICAgICAgICAgICBpZiAoc3AgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nIHNzID0gbmV3IFNwYW5uYWJsZVN0cmluZyhzKTsKICAgICAgICAgICAgICAgICBjb3B5U3BhbnNGcm9tKHNwLCAwLCBsZW4sIE9iamVjdC5jbGFzcywgc3MsIDApOwogICAgICAgICAgICAgICAgIHJldHVybiBzczsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlciBvdXQgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlcihzRWxsaXBzaXMpOwotICAgICAgICAgICAgICAgIG91dC5pbnNlcnQoMCwgdGV4dCwgMCwgbGVmdCk7Ci0gICAgICAgICAgICAgICAgb3V0Lmluc2VydChvdXQubGVuZ3RoKCksIHRleHQsIHJpZ2h0LCBsZW4pOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIG91dDsKICAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KIAotICAgIHByaXZhdGUgc3RhdGljIFN0cmluZyBibGFuayhDaGFyU2VxdWVuY2Ugc291cmNlLCBpbnQgc3RhcnQsIGludCBlbmQpIHsKLSAgICAgICAgaW50IGxlbiA9IHNvdXJjZS5sZW5ndGgoKTsKLSAgICAgICAgY2hhcltdIGJ1ZiA9IG9idGFpbihsZW4pOwotCi0gICAgICAgIGlmIChzdGFydCAhPSAwKSB7Ci0gICAgICAgICAgICBnZXRDaGFycyhzb3VyY2UsIDAsIHN0YXJ0LCBidWYsIDApOwotICAgICAgICB9Ci0gICAgICAgIGlmIChlbmQgIT0gbGVuKSB7Ci0gICAgICAgICAgICBnZXRDaGFycyhzb3VyY2UsIGVuZCwgbGVuLCBidWYsIGVuZCk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoc3RhcnQgIT0gZW5kKSB7Ci0gICAgICAgICAgICBidWZbc3RhcnRdID0gJ1x1MjAyNic7Ci0KLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCArIDE7IGkgPCBlbmQ7IGkrKykgewotICAgICAgICAgICAgICAgIGJ1ZltpXSA9ICdcdUZFRkYnOworICAgICAgICAgICAgaWYgKHJlbWFpbmluZyA9PSAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgCi0gICAgICAgIFN0cmluZyByZXQgPSBuZXcgU3RyaW5nKGJ1ZiwgMCwgbGVuKTsKLSAgICAgICAgcmVjeWNsZShidWYpOwogCi0gICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICBpZiAoc3AgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcihyZW1haW5pbmcgKyBzRWxsaXBzaXMubGVuZ3RoKCkpOworICAgICAgICAgICAgICAgIHNiLmFwcGVuZChidWYsIDAsIGxlZnQpOworICAgICAgICAgICAgICAgIHNiLmFwcGVuZChzRWxsaXBzaXMpOworICAgICAgICAgICAgICAgIHNiLmFwcGVuZChidWYsIHJpZ2h0LCBsZW4gLSByaWdodCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIgc3NiID0gbmV3IFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgIHNzYi5hcHBlbmQodGV4dCwgMCwgbGVmdCk7CisgICAgICAgICAgICBzc2IuYXBwZW5kKHNFbGxpcHNpcyk7CisgICAgICAgICAgICBzc2IuYXBwZW5kKHRleHQsIHJpZ2h0LCBsZW4pOworICAgICAgICAgICAgcmV0dXJuIHNzYjsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIE1lYXN1cmVkVGV4dC5yZWN5Y2xlKG10KTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIC8qKgpAQCAtMTI3OCw4MCArMTA5MywxMjEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgcCwgZmxvYXQgYXZhaWwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG9uZU1vcmUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG1vcmUpIHsKLSAgICAgICAgaW50IGxlbiA9IHRleHQubGVuZ3RoKCk7Ci0gICAgICAgIGNoYXJbXSBidWYgPSBuZXcgY2hhcltsZW5dOwotICAgICAgICBUZXh0VXRpbHMuZ2V0Q2hhcnModGV4dCwgMCwgbGVuLCBidWYsIDApOwogCi0gICAgICAgIGludCBjb21tYUNvdW50ID0gMDsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgewotICAgICAgICAgICAgaWYgKGJ1ZltpXSA9PSAnLCcpIHsKLSAgICAgICAgICAgICAgICBjb21tYUNvdW50Kys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBmbG9hdFtdIHdpZDsKLQotICAgICAgICBpZiAodGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpIHsKLSAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgdGV4dDsKLSAgICAgICAgICAgIFRleHRQYWludCB0ZW1wcGFpbnQgPSBuZXcgVGV4dFBhaW50KCk7Ci0gICAgICAgICAgICB3aWQgPSBuZXcgZmxvYXRbbGVuICogMl07Ci0KLSAgICAgICAgICAgIGludCBuZXh0OwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkgPSBuZXh0KSB7Ci0gICAgICAgICAgICAgICAgbmV4dCA9IHNwLm5leHRTcGFuVHJhbnNpdGlvbihpLCBsZW4sIE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3MpOwotCi0gICAgICAgICAgICAgICAgU3R5bGVkLmdldFRleHRXaWR0aHMocCwgdGVtcHBhaW50LCBzcCwgaSwgbmV4dCwgd2lkLCBudWxsKTsKLSAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHdpZCwgMCwgd2lkLCBsZW4gKyBpLCBuZXh0IC0gaSk7CisgICAgICAgIE1lYXN1cmVkVGV4dCBtdCA9IE1lYXN1cmVkVGV4dC5vYnRhaW4oKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGludCBsZW4gPSB0ZXh0Lmxlbmd0aCgpOworICAgICAgICAgICAgZmxvYXQgd2lkdGggPSBzZXRQYXJhKG10LCBwLCB0ZXh0LCAwLCBsZW4sIExheW91dC5ESVJfUkVRVUVTVF9ERUZBVUxUX0xUUik7CisgICAgICAgICAgICBpZiAod2lkdGggPD0gYXZhaWwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdGV4dDsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weSh3aWQsIGxlbiwgd2lkLCAwLCBsZW4pOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgd2lkID0gbmV3IGZsb2F0W2xlbl07Ci0gICAgICAgICAgICBwLmdldFRleHRXaWR0aHModGV4dCwgMCwgbGVuLCB3aWQpOwotICAgICAgICB9CisgICAgICAgICAgICBjaGFyW10gYnVmID0gbXQubUNoYXJzOwogCi0gICAgICAgIGludCBvayA9IDA7Ci0gICAgICAgIGludCBva1JlbWFpbmluZyA9IGNvbW1hQ291bnQgKyAxOwotICAgICAgICBTdHJpbmcgb2tGb3JtYXQgPSAiIjsKLQotICAgICAgICBpbnQgdyA9IDA7Ci0gICAgICAgIGludCBjb3VudCA9IDA7Ci0KLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgewotICAgICAgICAgICAgdyArPSB3aWRbaV07Ci0KLSAgICAgICAgICAgIGlmIChidWZbaV0gPT0gJywnKSB7Ci0gICAgICAgICAgICAgICAgY291bnQrKzsKLQotICAgICAgICAgICAgICAgIGludCByZW1haW5pbmcgPSBjb21tYUNvdW50IC0gY291bnQgKyAxOwotICAgICAgICAgICAgICAgIGZsb2F0IG1vcmVXaWQ7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIGZvcm1hdDsKLQotICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmcgPT0gMSkgewotICAgICAgICAgICAgICAgICAgICBmb3JtYXQgPSAiICIgKyBvbmVNb3JlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvcm1hdCA9ICIgIiArIFN0cmluZy5mb3JtYXQobW9yZSwgcmVtYWluaW5nKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtb3JlV2lkID0gcC5tZWFzdXJlVGV4dChmb3JtYXQpOwotCi0gICAgICAgICAgICAgICAgaWYgKHcgKyBtb3JlV2lkIDw9IGF2YWlsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG9rID0gaSArIDE7Ci0gICAgICAgICAgICAgICAgICAgIG9rUmVtYWluaW5nID0gcmVtYWluaW5nOwotICAgICAgICAgICAgICAgICAgICBva0Zvcm1hdCA9IGZvcm1hdDsKKyAgICAgICAgICAgIGludCBjb21tYUNvdW50ID0gMDsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKKyAgICAgICAgICAgICAgICBpZiAoYnVmW2ldID09ICcsJykgeworICAgICAgICAgICAgICAgICAgICBjb21tYUNvdW50Kys7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICB9CiAKLSAgICAgICAgaWYgKHcgPD0gYXZhaWwpIHsKLSAgICAgICAgICAgIHJldHVybiB0ZXh0OwotICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaW50IHJlbWFpbmluZyA9IGNvbW1hQ291bnQgKyAxOworCisgICAgICAgICAgICBpbnQgb2sgPSAwOworICAgICAgICAgICAgaW50IG9rUmVtYWluaW5nID0gcmVtYWluaW5nOworICAgICAgICAgICAgU3RyaW5nIG9rRm9ybWF0ID0gIiI7CisKKyAgICAgICAgICAgIGludCB3ID0gMDsKKyAgICAgICAgICAgIGludCBjb3VudCA9IDA7CisgICAgICAgICAgICBmbG9hdFtdIHdpZHRocyA9IG10Lm1XaWR0aHM7CisKKyAgICAgICAgICAgIGludCByZXF1ZXN0ID0gbXQubURpciA9PSAxID8gTGF5b3V0LkRJUl9SRVFVRVNUX0xUUiA6CisgICAgICAgICAgICAgICAgTGF5b3V0LkRJUl9SRVFVRVNUX1JUTDsKKworICAgICAgICAgICAgTWVhc3VyZWRUZXh0IHRlbXBNdCA9IE1lYXN1cmVkVGV4dC5vYnRhaW4oKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKKyAgICAgICAgICAgICAgICB3ICs9IHdpZHRoc1tpXTsKKworICAgICAgICAgICAgICAgIGlmIChidWZbaV0gPT0gJywnKSB7CisgICAgICAgICAgICAgICAgICAgIGNvdW50Kys7CisKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGZvcm1hdDsKKyAgICAgICAgICAgICAgICAgICAgLy8gWFhYIHNob3VsZCBub3QgaW5zZXJ0IHNwYWNlcywgc2hvdWxkIGJlIHBhcnQgb2Ygc3RyaW5nCisgICAgICAgICAgICAgICAgICAgIC8vIFhYWCBzaG91bGQgdXNlIHBsdXJhbCBydWxlcyBhbmQgbm90IGFzc3VtZSBFbmdsaXNoIHBsdXJhbHMKKyAgICAgICAgICAgICAgICAgICAgaWYgKC0tcmVtYWluaW5nID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdCA9ICIgIiArIG9uZU1vcmU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQgPSAiICIgKyBTdHJpbmcuZm9ybWF0KG1vcmUsIHJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBYWFggdGhpcyBpcyBwcm9iYWJseSBvaywgYnV0IG5lZWQgdG8gbG9vayBhdCBpdCBtb3JlCisgICAgICAgICAgICAgICAgICAgIHRlbXBNdC5zZXRQYXJhKGZvcm1hdCwgMCwgZm9ybWF0Lmxlbmd0aCgpLCByZXF1ZXN0KTsKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgbW9yZVdpZCA9IG10LmFkZFN0eWxlUnVuKHAsIG10Lm1MZW4sIG51bGwpOworCisgICAgICAgICAgICAgICAgICAgIGlmICh3ICsgbW9yZVdpZCA8PSBhdmFpbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgb2sgPSBpICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG9rUmVtYWluaW5nID0gcmVtYWluaW5nOworICAgICAgICAgICAgICAgICAgICAgICAgb2tGb3JtYXQgPSBmb3JtYXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBNZWFzdXJlZFRleHQucmVjeWNsZSh0ZW1wTXQpOworCiAgICAgICAgICAgICBTcGFubmFibGVTdHJpbmdCdWlsZGVyIG91dCA9IG5ldyBTcGFubmFibGVTdHJpbmdCdWlsZGVyKG9rRm9ybWF0KTsKICAgICAgICAgICAgIG91dC5pbnNlcnQoMCwgdGV4dCwgMCwgb2spOwogICAgICAgICAgICAgcmV0dXJuIG91dDsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIE1lYXN1cmVkVGV4dC5yZWN5Y2xlKG10KTsKICAgICAgICAgfQogICAgIH0KIAorICAgIHByaXZhdGUgc3RhdGljIGZsb2F0IHNldFBhcmEoTWVhc3VyZWRUZXh0IG10LCBUZXh0UGFpbnQgcGFpbnQsCisgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLCBpbnQgYmlkaVJlcXVlc3QpIHsKKworICAgICAgICBtdC5zZXRQYXJhKHRleHQsIHN0YXJ0LCBlbmQsIGJpZGlSZXF1ZXN0KTsKKworICAgICAgICBmbG9hdCB3aWR0aDsKKyAgICAgICAgU3Bhbm5lZCBzcCA9IHRleHQgaW5zdGFuY2VvZiBTcGFubmVkID8gKFNwYW5uZWQpIHRleHQgOiBudWxsOworICAgICAgICBpbnQgbGVuID0gZW5kIC0gc3RhcnQ7CisgICAgICAgIGlmIChzcCA9PSBudWxsKSB7CisgICAgICAgICAgICB3aWR0aCA9IG10LmFkZFN0eWxlUnVuKHBhaW50LCBsZW4sIG51bGwpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgd2lkdGggPSAwOworICAgICAgICAgICAgaW50IHNwYW5FbmQ7CisgICAgICAgICAgICBmb3IgKGludCBzcGFuU3RhcnQgPSAwOyBzcGFuU3RhcnQgPCBsZW47IHNwYW5TdGFydCA9IHNwYW5FbmQpIHsKKyAgICAgICAgICAgICAgICBzcGFuRW5kID0gc3AubmV4dFNwYW5UcmFuc2l0aW9uKHNwYW5TdGFydCwgbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgTWV0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zID0gc3AuZ2V0U3BhbnMoCisgICAgICAgICAgICAgICAgICAgICAgICBzcGFuU3RhcnQsIHNwYW5FbmQsIE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgIHdpZHRoICs9IG10LmFkZFN0eWxlUnVuKHBhaW50LCBzcGFucywgc3BhbkVuZCAtIHNwYW5TdGFydCwgbnVsbCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gd2lkdGg7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgY2hhciBGSVJTVF9SSUdIVF9UT19MRUZUID0gJ1x1MDU5MCc7CisKKyAgICAvKiBwYWNrYWdlICovCisgICAgc3RhdGljIGJvb2xlYW4gZG9lc05vdE5lZWRCaWRpKENoYXJTZXF1ZW5jZSBzLCBpbnQgc3RhcnQsIGludCBlbmQpIHsKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0OyBpIDwgZW5kOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChzLmNoYXJBdChpKSA+PSBGSVJTVF9SSUdIVF9UT19MRUZUKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8KKyAgICBzdGF0aWMgYm9vbGVhbiBkb2VzTm90TmVlZEJpZGkoY2hhcltdIHRleHQsIGludCBzdGFydCwgaW50IGxlbikgeworICAgICAgICBmb3IgKGludCBpID0gc3RhcnQsIGUgPSBpICsgbGVuOyBpIDwgZTsgaSsrKSB7CisgICAgICAgICAgICBpZiAodGV4dFtpXSA+PSBGSVJTVF9SSUdIVF9UT19MRUZUKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKwogICAgIC8qIHBhY2thZ2UgKi8gc3RhdGljIGNoYXJbXSBvYnRhaW4oaW50IGxlbikgewogICAgICAgICBjaGFyW10gYnVmOwogCkBAIC0xNTI5LDcgKzEzODUsNyBAQAogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IENBUF9NT0RFX0NIQVJBQ1RFUlMKICAgICAgICAgICAgID0gSW5wdXRUeXBlLlRZUEVfVEVYVF9GTEFHX0NBUF9DSEFSQUNURVJTOwotICAgIAorCiAgICAgLyoqCiAgICAgICogQ2FwaXRhbGl6YXRpb24gbW9kZSBmb3Ige0BsaW5rICNnZXRDYXBzTW9kZX06IGNhcGl0YWxpemUgdGhlIGZpcnN0CiAgICAgICogY2hhcmFjdGVyIG9mIGFsb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LCBNRVRBX0FMVF9MT0NLRUQpIHwKLSAgICAgICAgICAgICAgIGdldEFjdGl2ZShzdGF0ZSwgTUVUQV9TWU1fT04sIE1FVEFfU1lNX09OLCBNRVRBX1NZTV9MT0NLRUQpOworICAgICAgICBpbnQgcmVzdWx0ID0gMDsKKworICAgICAgICBpZiAoKHN0YXRlICYgTUVUQV9DQVBfTE9DS0VEKSAhPSAwKSB7CisgICAgICAgICAgICByZXN1bHQgfD0gTUVUQV9DQVBfTE9DS0VEOworICAgICAgICB9IGVsc2UgaWYgKChzdGF0ZSAmIE1FVEFfU0hJRlRfT04pICE9IDApIHsKKyAgICAgICAgICAgIHJlc3VsdCB8PSBNRVRBX1NISUZUX09OOworICAgICAgICB9CisKKyAgICAgICAgaWYgKChzdGF0ZSAmIE1FVEFfQUxUX0xPQ0tFRCkgIT0gMCkgeworICAgICAgICAgICAgcmVzdWx0IHw9IE1FVEFfQUxUX0xPQ0tFRDsKKyAgICAgICAgfSBlbHNlIGlmICgoc3RhdGUgJiBNRVRBX0FMVF9PTikgIT0gMCkgeworICAgICAgICAgICAgcmVzdWx0IHw9IE1FVEFfQUxUX09OOworICAgICAgICB9CisKKyAgICAgICAgaWYgKChzdGF0ZSAmIE1FVEFfU1lNX0xPQ0tFRCkgIT0gMCkgeworICAgICAgICAgICAgcmVzdWx0IHw9IE1FVEFfU1lNX0xPQ0tFRDsKKyAgICAgICAgfSBlbHNlIGlmICgoc3RhdGUgJiBNRVRBX1NZTV9PTikgIT0gMCkgeworICAgICAgICAgICAgcmVzdWx0IHw9IE1FVEFfU1lNX09OOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICB9CiAKICAgICAvKioKQEAgLTM0OCwyOSArMzg4LDI1IEBACiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgZ2V0TWV0YVN0YXRlKGxvbmcgc3RhdGUsIGludCBtZXRhKSB7CiAgICAgICAgIHN3aXRjaCAobWV0YSkgewogICAgICAgICAgICAgY2FzZSBNRVRBX1NISUZUX09OOgotICAgICAgICAgICAgICAgIHJldHVybiBnZXRBY3RpdmUoc3RhdGUsIG1ldGEsIDEsIDIpOworICAgICAgICAgICAgICAgIGlmICgoc3RhdGUgJiBNRVRBX0NBUF9MT0NLRUQpICE9IDApIHJldHVybiAyOworICAgICAgICAgICAgICAgIGlmICgoc3RhdGUgJiBNRVRBX1NISUZUX09OKSAhPSAwKSByZXR1cm4gMTsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKIAogICAgICAgICAgICAgY2FzZSBNRVRBX0FMVF9PTjoKLSAgICAgICAgICAgICAgICByZXR1cm4gZ2V0QWN0aXZlKHN0YXRlLCBtZXRhLCAxLCAyKTsKKyAgICAgICAgICAgICAgICBpZiAoKHN0YXRlICYgTUVUQV9BTFRfTE9DS0VEKSAhPSAwKSByZXR1cm4gMjsKKyAgICAgICAgICAgICAgICBpZiAoKHN0YXRlICYgTUVUQV9BTFRfT04pICE9IDApIHJldHVybiAxOworICAgICAgICAgICAgICAgIHJldHVybiAwOwogCiAgICAgICAgICAgICBjYXNlIE1FVEFfU1lNX09OOgotICAgICAgICAgICAgICAgIHJldHVybiBnZXRBY3RpdmUoc3RhdGUsIG1ldGEsIDEsIDIpOworICAgICAgICAgICAgICAgIGlmICgoc3RhdGUgJiBNRVRBX1NZTV9MT0NLRUQpICE9IDApIHJldHVybiAyOworICAgICAgICAgICAgICAgIGlmICgoc3RhdGUgJiBNRVRBX1NZTV9PTikgIT0gMCkgcmV0dXJuIDE7CisgICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAKICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHN0YXRpYyBpbnQgZ2V0QWN0aXZlKGxvbmcgc3RhdGUsIGludCBtZXRhLCBpbnQgb24sIGludCBsb2NrKSB7Ci0gICAgICAgIGlmICgoc3RhdGUmKG1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lCi0gICAgICAgICAgICBzdGF0ZSA9IHN0YXRlIHwgd2hhdCB8ICgoKGxvbmcpd2hhdCk8PFBSRVNTRURfU0hJRlQpOworICAgIHByaXZhdGUgc3RhdGljIGxvbmcgcHJlc3MobG9uZyBzdGF0ZSwgaW50IHdoYXQsIGxvbmcgbWFzaywKKyAgICAgICAgICAgIGxvbmcgbG9ja2VkLCBsb25nIHByZXNzZWQsIGxvbmcgcmVsZWFzZWQsIGxvbmcgdXNlZCkgeworICAgICAgICBpZiAoKHN0YXRlICYgcHJlc3NlZCkgIT0gMCkgeworICAgICAgICAgICAgLy8gcmVwZWF0IGJlZm9yZSB1c2UKKyAgICAgICAgfSBlbHNlIGlmICgoc3RhdGUgJiByZWxlYXNlZCkgIT0gMCkgeworICAgICAgICAgICAgc3RhdGUgPSAoc3RhdGUgJn4gbWFzaykgfCB3aGF0IHwgbG9ja2VkOworICAgICAgICB9IGVsc2UgaWYgKChzdGF0ZSAmIHVzZWQpICE9IDApIHsKKyAgICAgICAgICAgIC8vIHJlcGVhdCBhZnRlciB1c2UKKyAgICAgICAgfSBlbHNlIGlmICgoc3RhdGUgJiBsb2NrZWQpICE9IDApIHsKKyAgICAgICAgICAgIHN0YXRlICY9IH5tYXNrOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc3RhdGUgfD0gd2hhdCB8IHByZXNzZWQ7CisgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHN0YXRlOwogICAgIH0KIApAQCAtNDMxLDM5ICs0NzcsNTIgQEAKICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIGxvbmcgaGFuZGxlS2V5VXAobG9uZyBzdGF0ZSwgaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50KSB7CiAgICAgICAgIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfU0hJRlRfTEVGVCB8fCBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfU0hJRlRfUklHSFQpIHsKLSAgICAgICAgICAgIHJ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AqIHtAbGluayAjTUVUQV9BTFRfT059IG9yIHtAbGluayAjTUVUQV9TWU1fT059LgorICAgICAqLwogICAgIHB1YmxpYyBsb25nIGNsZWFyTWV0YUtleVN0YXRlKGxvbmcgc3RhdGUsIGludCB3aGljaCkgewotICAgICAgICBpZiAoKHdoaWNoJk1FVEFfU0hJRlRfT04pICE9IDApCi0gICAgICAgICAgICBzdGF0ZSA9IHJlc2V0TG9jayhzdGF0ZSwgTUVUQV9TSElGVF9PTiwgTUVUQV9TSElGVF9NQVNLKTsKLSAgICAgICAgaWYgKCh3aGljaCZNRVRBX0FMVF9PTikgIT0gMCkKLSAgICAgICAgICAgIHN0YXRlID0gcmVzZXRMb2NrKHN0YXRlLCBNRVRBX0FMVF9PTiwgTUVUQV9BTFRfTUFTSyk7Ci0gICAgICAgIGlmICgod2hpY2gmTUVUQV9TWU1fT04pICE9IDApCi0gICAgICAgICAgICBzdGF0ZSA9IHJlc2V0TG9jayhzdGF0ZSwgTUVUQV9TWU1fT04sIE1FVEFfU1lNX01BU0spOworICAgICAgICBpZiAoKHdoaWNoICYgTUVUQV9TSElGVF9PTl9BTkRfTE9DS0VEKSA9PSBNRVRBX1NISUZUX09OX0FORF9MT0NLRUQpIHsKKyAgICAgICAgICAgIHN0YXRlICY9IH5NRVRBX1NISUZUX01BU0s7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCh3aGljaCAmIE1FVEFfQUxUX09OX0FORF9MT0NLRUQpID09IE1FVEFfQUxUX09OX0FORF9MT0NLRUQpIHsKKyAgICAgICAgICAgIHN0YXRlICY9IH5NRVRBX0FMVF9NQVNLOworICAgICAgICB9CisgICAgICAgIGlmICgod2hpY2ggJiBNRVRBX1NZTV9PTl9BTkRfTE9DS0VEKSA9PSBNRVRBX1NZTV9PTl9BTkRfTE9DS0VEKSB7CisgICAgICAgICAgICBzdGF0ZSAmPSB+TUVUQV9TWU1fTUFTSzsKKyAgICAgICAgfQogICAgICAgICByZXR1cm4gc3RhdGU7CiAgICA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AwOwogCisgICAgICAgIC8vIGFsaWduX29wcG9zaXRlIGRvZXMgTk9UIG1lYW4gYWxpZ25fcmlnaHQsIHdlIG5lZWQgdGhlIHBhcmFncmFwaAorICAgICAgICAvLyBkaXJlY3Rpb24gdG8gcmVzb2x2ZSBpdCB0byBsZWZ0IG9yIHJpZ2h0CiAgICAgICAgIGlmIChyaWdodCAtIGxlZnQgPCB3aWR0aCAtIHBhZGRpbmcpIHsKICAgICAgICAgICAgIGlmIChhID09IEFsaWdubWVudC5BTElHTl9DRU5URVIpIHsKICAgICAgICAgICAgICAgICBkaWZmID0gKHdpZHRoIC0gcGFkZGluZyAtIChyaWdodCAtIGxlZnQpKSAvIDI7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGEgPT0gQWxpZ25tZW50LkFMSUdOX09QUE9TSVRFKSB7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGx0ciA9PSAoYSA9PSBBbGlnbm1lbnQuQUxJR05fT1BQT1NJVEUpKSB7CiAgICAgICAgICAgICAgICAgZGlmZiA9IHdpZHRoIC0gcGFkZGluZyAtIChyaWdodCAtIGxlZnQpOwogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0xNDAsNyArMTQ0LDcgQEAKICAgICAgICAgICAgICAgICBpZiAoZHNbMF0ubUZhckVub3VnaCkgewogICAgICAgICAgICAgICAgICAgICBkc1swXS5tVXNlZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gY2FwID0gKE1ldGFLZXlLZXlMaXN0ZW5lci5nZXRNZXRhU3RhdGUoYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBLZXlFdmVudC5NRVRBX1NISUZUX09OKSA9PSAxKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZXRhS2V5S2V5TGlzdGVuZXIuTUVUQV9TSElGVF9PTikgPT0gMSkgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKE1ld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HQVBfV0lEVEggPSAyOwogCiAgICAgcHVibGljIEJ1bGxldFNwYW4oKSB7CkBAIC01NSwxMSArNTgsMTEgQEAKICAgICAgICAgbVdhbnRDb2xvciA9IHNyYy5yZWFkSW50KCkgIT0gMDsKICAgICAgICAgbUNvbG9yID0gc3JjLnJlYWRJbnQoKTsKICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgaW50IGdldFNwYW5UeXBlSWQoKSB7CiAgICAgICAgIHJldHVybiBUZXh0VXRpbHMuQlVMTEVUX1NQQU47CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGludCBkZXNjcmliZUNvbnRlbnRzKCkgewogICAgICAgICByZXR1cm4gMDsKICAgICB9CkBAIC04OSw4ICs5MiwyMCBAQAogCiAgICAgICAgICAgICBwLnNldFN0eWxlKFBhaW50LlN0eWxlLkZJTEwpOwogCi0gICAgICAgICAgICBjLmRyYXdDaXJjbGUoeCArIGRpciAqIEJVTExFVF9SQURJVVMsICh0b3AgKyBib3R0b20pIC8gMi4wZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBCVUxMRVRfUkFESVVTLCBwKTsKKyAgICAgICAgICAgIGlmIChjLmlzSGFyZHdhcmVBY2NlbGVyYXRlZCgpKSB7CisgICAgICAgICAgICAgICAgaWYgKHNCdWxsZXRQYXRoID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgc0J1bGxldFBhdGggPSBuZXcgUGF0aCgpOworICAgICAgICAgICAgICAgICAgICAvLyBCdWxsZXQgaXMgc2xpZ2h0bHkgYmV0dGVyIHRvIGF2b2lkIGFsaWFzaW5nIGFydGlmYWN0cyBvbiBtZHBpIGRldmljZXMuCisgICAgICAgICAgICAgICAgICAgIHNCdWxsZXRQYXRoLmFkZENpcmNsZSgwLjBmLCAwLjBmLCAxLjJmICogQlVMTEVUX1JBRElVUywgRGlyZWN0aW9uLkNXKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjLnNhdmUoKTsKKyAgIC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Mgc3RhdGljIFN0cmluZyBuYW1lRm9yVmVuZG9yKFN0cmluZyBjaGFyc2V0TmFtZSwgU3RyaW5nIHZlbmRvcikgewotICAgICAgICAvLyBUT0RPOiBFdmVudHVhbGx5LCB0aGlzIG1heSB3YW50IHRvIGJlIHRhYmxlLWRyaXZlbi4KLQotICAgICAgICBpZiAodmVuZG9yLmVxdWFsc0lnbm9yZUNhc2UoVkVORE9SX0RPQ09NTykKLSAgICAgICAgICAgICAgICAmJiBpc1NoaWZ0SmlzKGNoYXJzZXROYW1lKSkgewotICAgICAgICAgICAgcmV0dXJuICJkb2NvbW8tc2hpZnRfamlzLTIwMDciOworICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGNoYXJzZXROYW1lKSAmJiAhVGV4dFV0aWxzLmlzRW1wdHkodmVuZG9yKSkgeworICAgICAgICAgICAgLy8gWW91IGNhbiBhZGQgeW91ciBvd24gbWFwcGluZyBoZXJlLgorICAgICAgICAgICAgaWYgKGlzU2hpZnRKaXMoY2hhcnNldE5hbWUpKSB7CisgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHZlbmRvclNoaWZ0SmlzID0gc1ZlbmRvclNoaWZ0SmlzTWFwLmdldCh2ZW5kb3IpOworICAgICAgICAgICAgICAgIGlmICh2ZW5kb3JTaGlmdEppcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB2ZW5kb3JTaGlmdEppczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICByZXR1cm4gY2hhcnNldE5hbWU7CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC91dGlsL0ZpbmFsaXplcnMuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3V0aWwvRmluYWxpemVycy5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjY3MWYyZDQKLS0tIC9kZXYvbnVsbAorKysgYi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5yZWYuUmVmZXJlbmNlUXVldWU7CisKKy8qKgorICogVGhpcyBjbGFzcyBjYW4gYmUgdXNlZCB0byBpbXBsZW1lbnQgcmVsaWFibGUgZmluYWxpemVycy4KKyAqIAorICogQGhpZGUKKyAqLworcHVibGljIGZpbmFsIGNsYXNzIEZpbmFsaXplcnMgeworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBMT0dfVEFHID0gIkZpbmFsaXplcnMiOworICAgIAorICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIE9iamVjdFtdIHNMb2NrID0gbmV3IE9iamVjdFswXTsKKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIHNJbml0OworICAgIHByaXZhdGUgc3RhdGljIFJlY2xhaW1lciBzUmVjbGFpbWVyOworCisgICAgLyoqCisgICAgICogU3ViY2xhc3Mgb2YgUGhhbnRvbVJlZmVyZW5jZSB1c2VkIHRvIHJlY2xhaW0gcmVzb3VyY2VzLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgYWJzdHJhY3QgY2xhc3MgUmVjbGFpbWFibGVSZWZlcmVuY2U8VD4gZXh0ZW5kcyBQaGFudG9tUmVmZXJlbmNlPFQ+IHsKKyAgICAgICAgcHVibGljIFJlY2xhaW1hYmxlUmVmZXJlbmNlKFQgciwgUmVmZXJlbmNlUXVldWU8T2JqZWN0PiBxKSB7CisgICAgICAgICAgICBzdXBlcihyLCBxKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcHVibGljIGFic3RyYWN0IHZvaWQgcmVjbGFpbSgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIHF1ZXVlIHVzZWQgdG8gcmVjbGFpbSBSZWNsYWltYWJsZVJlZmVyZW5jZXMuCisgICAgICogCisgICAgICogQHJldHVybiBBIHJlZmVyZW5jZSBxdWV1ZSBvciBudWxsIGJlZm9yZSBpbml0aWFsaXphdGlvbgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgUmVmZXJlbmNlUXVldWU8T2JqZWN0PiBnZXRRdWV1ZSgpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChzTG9jaykgeworICAgICAgICAgICAgaWYgKCFzSW5pdCkgeworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFzUmVjbGFpbWVyLmlzUnVubmluZygpKSB7CisgICAgICAgICAgICAgICAgc1JlY2xhaW1lciA9IG5ldyBSZWNsYWltZXIoc1JlY2xhaW1lci5tUXVldWUpOworICAgICAgICAgICAgICAgIHNSZWNsYWltZXIuc3RhcnQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBzUmVjbGFpbWVyLm1RdWV1ZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEludm9rZWQgYnkgWnlnb3RlLiBEb24ndCB0b3VjaCEKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIHZvaWQgaW5pdCgpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChzTG9jaykgeworICAgICAgICAgICAgaWYgKCFzSW5pdCAmJiBzUmVjbGFpbWVyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBzUmVjbGFpbWVyID0gbmV3IFJlY2xhaW1lcigpOworICAgICAgICAgICAgICAgIHNSZWNsYWltZXIuc3RhcnQoKTsKKyAgICAgICAgICAgICAgICBzSW5pdCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgUmVjbGFpbWVyIGV4dGVuZHMgVGhyZWFkIHsKKyAgICAgICAgUmVmZXJlbmNlUXVldWU8T2JqZWN0PiBtUXVldWU7CisKKyAgICAgICAgcHJpdmF0ZSB2b2xhdGlsZSBib29sZWFuIG1SdW5uaW5nID0gZmFsc2U7CisKKyAgICAgICAgUmVjbGFpbWVyKCkgeworICAgICAgICAgICAgdGhpcyhuZXcgUmVmZXJlbmNlUXVldWU8T2JqZWN0PigpKTsKKyAgICAgICAgfQorCisgICAgICAgIFJlY2xhaW1lcihSZWZlcmVuY2VRdWV1ZTxPYmplY3Q+IHF1ZXVlKSB7CisgICAgICAgICAgICBzdXBlcigiUmVjbGFpbWVyIik7CisgICAgICAgICAgICBzZXREYWVtb24odHJ1ZSk7CisgICAgICAgICAgICBtUXVldWUgPSBxdWV1ZTsgICAgICAgICAgICAKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBzdGFydCgpIHsKKyAgICAgICAgICAgIG1SdW5uaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIHN1cGVyLnN0YXJ0KCk7CisgICAgICAgIH0KKworICAgICAgICBib29sZWFuIGlzUnVubmluZygpIHsKKyAgICAgICAgICAgIHJldHVybiBtUnVubmluZzsKKyAgICAgICAgfQorCisgICAgICAgIEBTdXBwcmVzc1dhcm5pbmdzKHsiSW5maW5pdGVMb29wU3RhdGVtZW50In0pCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjbGVhblVwKG1RdWV1ZS5yZW1vdmUoKSk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIElnbm9yZQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiUmVjbGFpbWVyIHRocmVhZCBleGl0aW5nOiAiLCBlKTsKKyAgICAgICAgICAgIH0gZ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0aHJvd3MgSU9FeGNlcHRpb24geworICogICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IElucHV0U3RyZWFtUmVhZGVyKGluLCAiVVRGLTgiKSk7CisgKiAgICAgcmV0dXJuIHJlYWRNZXNzYWdlc0FycmF5KHJlYWRlcik7CisgKiAgIH0KKyAqCisgKiAgIHB1YmxpYyBMaXN0PE1lc3NhZ2U+IHJlYWRNZXNzYWdlc0FycmF5KEpzb25SZWFkZXIgcmVhZGVyKSB0aHJvd3MgSU9FeGNlcHRpb24geworICogICAgIExpc3Q8TWVzc2FnZT4gbWVzc2FnZXMgPSBuZXcgQXJyYXlMaXN0PE1lc3NhZ2U+KCk7CisgKgorICogICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgKiAgICAgd2hpbGUgKHJlYWRlci5oYXNOZXh0KCkpIHsKKyAqICAgICAgIG1lc3NhZ2VzLmFkZChyZWFkTWVzc2FnZShyZWFkZXIpKTsKKyAqICAgICB9CisgKiAgICAgcmVhZGVyLmVuZEFycmF5KCk7CisgKiAgICAgcmV0dXJuIG1lc3NhZ2VzOworICogICB9CisgKgorICogICBwdWJsaWMgTWVzc2FnZSByZWFkTWVzc2FnZShKc29uUmVhZGVyIHJlYWRlcikgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAqICAgICBsb25nIGlkID0gLTE7CisgKiAgICAgU3RyaW5nIHRleHQgPSBudWxsOworICogICAgIFVzZXIgdXNlciA9IG51bGw7CisgKiAgICAgTGlzdDxEb3VibGU+IGdlbyA9IG51bGw7CisgKgorICogICAgIHJlYWRlci5iZWdpbk9iamVjdCgpOworICogICAgIHdoaWxlIChyZWFkZXIuaGFzTmV4dCgpKSB7CisgKiAgICAgICBTdHJpbmcgbmFtZSA9IHJlYWRlci5uZXh0TmFtZSgpOworICogICAgICAgaWYgKG5hbWUuZXF1YWxzKCJpZCIpKSB7CisgKiAgICAgICAgIGlkID0gcmVhZGVyLm5leHRMb25nKCk7CisgKiAgICAgICB9IGVsc2UgaWYgKG5hbWUuZXF1YWxzKCJ0ZXh0IikpIHsKKyAqICAgICAgICAgdGV4dCA9IHJlYWRlci5uZXh0U3RyaW5nKCk7CisgKiAgICAgICB9IGVsc2UgaWYgKG5hbWUuZXF1YWxzKCJnZW8iKSAmJiByZWFkZXIucGVlaygpICE9IEpzb25Ub2tlbi5OVUxMKSB7CisgKiAgICAgICAgIGdlbyA9IHJlYWREb3VibGVzQXJyYXkocmVhZGVyKTsKKyAqICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoInVzZXIiKSkgeworICogICAgICAgICB1c2VyID0gcmVhZFVzZXIocmVhZGVyKTsKKyAqICAgICAgIH0gZWxzZSB7CisgKiAgICAgICAgIHJlYWRlci5za2lwVmFsdWUoKTsKKyAqICAgICAgIH0KKyAqICAgICB9CisgKiAgICAgcmVhZGVyLmVuZE9iamVjdCgpOworICogICAgIHJldHVybiBuZXcgTWVzc2FnZShpZCwgdGV4dCwgdXNlciwgZ2VvKTsKKyAqICAgfQorICoKKyAqICAgcHVibGljIExpc3Q8RG91YmxlPiByZWFkRG91Ymxlc0FycmF5KEpzb25SZWFkZXIgcmVhZGVyKSB0aHJvd3MgSU9FeGNlcHRpb24geworICogICAgIExpc3Q8RG91YmxlPiBkb3VibGVzID0gbmV3IEFycmF5TGlzdDxEb3VibGU+KCk7CisgKgorICogICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgKiAgICAgd2hpbGUgKHJlYWRlci5oYXNOZXh0KCkpIHsKKyAqICAgICAgIGRvdWJsZXMuYWRkKHJlYWRlci5uZXh0RG91YmxlKCkpOworICogICAgIH0KKyAqICAgICByZWFkZXIuZW5kQXJyYXkoKTsKKyAqICAgICByZXR1cm4gZG91YmxlczsKKyAqICAgfQorICoKKyAqICAgcHVibGljIFVzZXIgcmVhZFVzZXIoSnNvblJlYWRlciByZWFkZXIpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgKiAgICAgU3RyaW5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Rva2VuIGZyb20gdGhlIEpTT04gc3RyZWFtIGFuZCBhc3NlcnRzIHRoYXQgaXQgaXMgdGhlCisgICAgICogZW5kIG9mIHRoZSBjdXJyZW50IGFycmF5LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGVuZE9iamVjdCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGV4cGVjdChKc29uVG9rZW4uRU5EX09CSkVDVCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29uc3VtZXMge0Bjb2RlIGV4cGVjdGVkfS4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgZXhwZWN0KEpzb25Ub2tlbiBleHBlY3RlZCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgcXVpY2tQZWVrKCk7CisgICAgICAgIGlmICh0b2tlbiAhPSBleHBlY3RlZCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiRXhwZWN0ZWQgIiArIGV4cGVjdGVkICsgIiBidXQgd2FzICIgKyBwZWVrKCkpOworICAgICAgICB9CisgICAgICAgIGFkdmFuY2UoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRydWUgaWYgdGhlIGN1cnJlbnQgYXJyYXkgb3Igb2JqZWN0IGhhcyBhbm90aGVyIGVsZW1lbnQuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaGFzTmV4dCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIHF1aWNrUGVlaygpOworICAgICAgICByZXR1cm4gdG9rZW4gIT0gSnNvblRva2VuLkVORF9PQkpFQ1QgJiYgdG9rZW4gIT0gSnNvblRva2VuLkVORF9BUlJBWTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSB0eXBlIG9mIHRoZSBuZXh0IHRva2VuIHdpdGhvdXQgY29uc3VtaW5nIGl0LgorICAgICAqLworICAgIHB1YmxpYyBKc29uVG9rZW4gcGVlaygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIHF1aWNrUGVlaygpOworCisgICAgICAgIGlmICh0b2tlbiA9PSBudWxsKSB7CisgICAgICAgICAgICBkZWNvZGVMaXRlcmFsKCk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gdG9rZW47CisgICAgfQorCisgICAgLyoqCisgICAgICogRW5zdXJlcyB0aGF0IGEgdG9rZW4gaXMgcmVhZHkuIEFmdGVyIHRoaXMgY2FsbCBlaXRoZXIge0Bjb2RlIHRva2VufSBvcgorICAgICAqIHtAY29kZSB2YWx1ZX0gd2lsbCBiZSBub24tbnVsbC4gVG8gZW5zdXJlIHtAY29kZSB0b2tlbn0gaGFzIGEgZGVmaW5pdGl2ZQorICAgICAqIHZhbHVlLCB1c2Uge0BsaW5rICNwZWVrKCl9CisgICAgICovCisgICAgcHJpdmF0ZSBKc29uVG9rZW4gcXVpY2tQZWVrKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKGhhc1Rva2VuKSB7CisgICAgICAgICAgICByZXR1cm4gdG9rZW47CisgICAgICAgIH0KKworICAgICAgICBzd2l0Y2ggKHBlZWtTdGFjaygpKSB7CisgICAgICAgICAgICBjYXNlIEVNUFRZX0RPQ1VNRU5UOgorICAgICAgICAgICAgICAgIHJlcGxhY2VUb3AoSnNvblNjb3BlLk5PTkVNUFRZX0RPQ1VNRU5UKTsKKyAgICAgICAgICAgICAgICBKc29uVG9rZW4gZmlyc3RUb2tlbiA9IG5leHRWYWx1ZSgpOworICAgICAgICAgICAgICAgIGlmICh0b2tlbiAhPSBKc29uVG9rZW4uQkVHSU5fQVJSQVkgJiYgdG9rZW4gIT0gSnNvblRva2VuLkJFR0lOX09CSkVDVCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSU9FeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkV4cGVjdGVkIEpTT04gZG9jdW1lbnQgdG8gc3RhcnQgd2l0aCAnWycgb3IgJ3snIGJ1dCB3YXMgIiArIHRva2VuKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGZpcnN0VG9rZW47CisgICAgICAgICAgICBjYXNlIEVNUFRZX0FSUkFZOgorICAgICAgICAgICAgICAgIHJldHVybiBuZXh0SW5BcnJheSh0cnVlKTsKKyAgICAgICAgICAgIGNhc2UgTk9ORU1QVFlfQVJSQVk6CisgICAgICAgICAgICAgICAgcmV0dXJuIG5leHRJbkFycmF5KGZhbHNlKTsKKyAgICAgICAgICAgIGNhc2UgRU1QVFlfT0JKRUNUOgorICAgICAgICAgICAgICAgIHJldHVybiBuZXh0SW5PYmplY3QodHJ1ZSk7CisgICAgICAgICAgICBjYXNlIERBTkdMSU5HX05BTUU6CisgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdFZhbHVlKCk7CisgICAgICAgICAgICBjYXNlIE5PTkVNUFRZX09CSkVDVDoKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV4dEluT2JqZWN0KGZhbHNlKTsKKyAgICAgICAgICAgIGNhc2UgTk9ORU1QVFlfRE9DVU1FTlQ6CisgICAgICAgICAgICAgICAgaGFzVG9rZW4gPSB0cnVlOworICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbiA9IEpzb25Ub2tlbi5FTkRfRE9DVU1FTlQ7CisgICAgICAgICAgICBjYXNlIENMT1NFRDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJKc29uUmVhZGVyIGlzIGNsb3NlZCIpOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXNzZXJ0aW9uRXJyb3IoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEFkdmFuY2VzIHRoZSBjdXJzb3IgaW4gdGhlIEpTT04gc3RyZWFtIHRvIHRoZSBuZXh0IHRva2VuLgorICAgICAqLworICAgIHByaXZhdGUgSnNvblRva2VuIGFkdmFuY2UoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBxdWlja1BlZWsoKTsKKworICAgICAgICBKc29uVG9rZW4gcmVzdWx0ID0gdG9rZW47CisgICAgICAgIGhhc1Rva2VuID0gZmFsc2U7CisgICAgICAgIHRva2VuID0gbnVsbDsKKyAgICAgICAgdmFsdWUgPSBudWxsOworICAgICAgICBuYW1lID0gbnVsbDsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBuZXh0IHRva2VuLCBhIHtAbGluayBKc29uVG9rZW4jTkFNRSBwcm9wZXJ0eSBuYW1lfSwgYW5kCisgICAgICogY29uc3VtZXMgaXQuCisgICAgICoKKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uIGlmIHRoZSBuZXh0IHRva2VuIGluIHRoZSBzdHJlYW0gaXMgbm90IGEgcHJvcGVydHkKKyAgICAgKiAgICAgbmFtZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIG5leHROYW1lKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgcXVpY2tQZWVrKCk7CisgICAgICAgIGlmICh0b2tlbiAhPSBKc29uVG9rZW4uTkFNRSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiRXhwZWN0ZWQgYSBuYW1lIGJ1dCB3YXMgIiArIHBlZWsoKSk7CisgICAgICAgIH0KKyAgICAgICAgU3RyaW5nIHJlc3VsdCA9IG5hbWU7CisgICAgICAgIGFkdmFuY2UoKTsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSB7QGxpbmsgSnNvblRva2VuI1NUUklORyBzdHJpbmd9IHZhbHVlIG9mIHRoZSBuZXh0IHRva2VuLAorICAgICAqIGNvbnN1bWluZyBpdC4gSWYgdGhlIG5leHQgdG9rZW4gaXMgYSBudW1iZXIsIHRoaXMgbWV0aG9kIHdpbGwgcmV0dXJuIGl0cworICAgICAqIHN0cmluZyBmb3JtLgorICAgICAqCisgICAgICogQHRocm93cyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24gaWYgdGhlIG5leHQgdG9rZW4gaXMgbm90IGEgc3RyaW5nIG9yIGlmCisgICAgICogICAgIHRoaXMgcmVhZGVyIGlzIGNsb3NlZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIG5leHRTdHJpbmcoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBwZWVrKCk7CisgICAgICAgIGlmICh2YWx1ZSA9PSBudWxsIHx8ICh0b2tlbiAhPSBKc29uVG9rZW4uU1RSSU5HICYmIHRva2VuICE9IEpzb25Ub2tlbi5OVU1CRVIpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJFeHBlY3RlZCBhIHN0cmluZyBidXQgd2FzICIgKyBwZWVrKCkpOworICAgICAgICB9CisKKyAgICAgICAgU3RyaW5nIHJlc3VsdCA9IHZhbHVlOworICAgICAgICBhZHZhbmNlKCk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUge0BsaW5rIEpzb25Ub2tlbiNCT09MRUFOIGJvb2xlYW59IHZhbHVlIG9mIHRoZSBuZXh0IHRva2VuLAorICAgICAqIGNvbnN1bWluZyBpdC4KKyAgICAgKgorICAgICAqIEB0aHJvd3MgSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGlmIHRoZSBuZXh0IHRva2VuIGlzIG5vdCBhIGJvb2xlYW4gb3IgaWYKKyAgICAgKiAgICAgdGhpcyByZWFkZXIgaXMgY2xvc2VkLgorICAgICAqLworICAgIHB1YmxpYyBib29sZW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Ghyb3dzIElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBpZiB0aGUgbmV4dCB0b2tlbiBpcyBub3QgYSBsaXRlcmFsIHZhbHVlLgorICAgICAqIEB0aHJvd3MgTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGlmIHRoZSBuZXh0IGxpdGVyYWwgdmFsdWUgY2Fubm90IGJlIHBhcnNlZAorICAgICAqICAgICBhcyBhIG51bWJlciwgb3IgZXhhY3RseSByZXByZXNlbnRlZCBhcyBhIGxvbmcuCisgICAgICovCisgICAgcHVibGljIGxvbmcgbmV4dExvbmcoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBxdWlja1BlZWsoKTsKKyAgICAgICAgaWYgKHZhbHVlID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkV4cGVjdGVkIGEgbG9uZyBidXQgd2FzICIgKyBwZWVrKCkpOworICAgICAgICB9CisKKyAgICAgICAgbG9uZyByZXN1bHQ7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXN1bHQgPSBMb25nLnBhcnNlTG9uZyh2YWx1ZSk7CisgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBpZ25vcmVkKSB7CisgICAgICAgICAgICBkb3VibGUgYXNEb3VibGUgPSBEb3VibGUucGFyc2VEb3VibGUodmFsdWUpOyAvLyBkb24ndCBjYXRjaCB0aGlzIE51bWJlckZvcm1hdEV4Y2VwdGlvbgorICAgICAgICAgICAgcmVzdWx0ID0gKGxvbmcpIGFzRG91YmxlOworICAgICAgICAgICAgaWYgKChkb3VibGUpIHJlc3VsdCAhPSBhc0RvdWJsZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdW1iZXJGb3JtYXRFeGNlcHRpb24odmFsdWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHJlc3VsdCA+PSAxTCAmJiB2YWx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rZW4gPSBmYWxzZTsKKyAgICAgICAgdmFsdWUgPSBudWxsOworICAgICAgICB0b2tlbiA9IG51bGw7CisgICAgICAgIHN0YWNrLmNsZWFyKCk7CisgICAgICAgIHN0YWNrLmFkZChKc29uU2NvcGUuQ0xPU0VEKTsKKyAgICAgICAgaW4uY2xvc2UoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTa2lwcyB0aGUgbmV4dCB2YWx1ZSByZWN1cnNpdmVseS4gSWYgaXQgaXMgYW4gb2JqZWN0IG9yIGFycmF5LCBhbGwgbmVzdGVkCisgICAgICogZWxlbWVudHMgYXJlIHNraXBwZWQuIFRoaXMgbWV0aG9kIGlzIGludGVuZGVkIGZvciB1c2Ugd2hlbiB0aGUgSlNPTiB0b2tlbgorICAgICAqIHN0cmVhbSBjb250YWlucyB1bnJlY29nbml6ZWQgb3IgdW5oYW5kbGVkIHZhbHVlcy4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBza2lwVmFsdWUoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBza2lwcGluZyA9IHRydWU7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpbnQgY291bnQgPSAwOworICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgIEpzb25Ub2tlbiB0b2tlbiA9IGFkdmFuY2UoKTsKKyAgICAgICAgICAgICAgICBpZiAodG9rZW4gPT0gSnNvblRva2VuLkJFR0lOX0FSUkFZIHx8IHRva2VuID09IEpzb25Ub2tlbi5CRUdJTl9PQkpFQ1QpIHsKKyAgICAgICAgICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRva2VuID09IEpzb25Ub2tlbi5FTkRfQVJSQVkgfHwgdG9rZW4gPT0gSnNvblRva2VuLkVORF9PQkpFQ1QpIHsKKyAgICAgICAgICAgICAgICAgICAgY291bnQtLTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IHdoaWxlIChjb3VudCAhPSAwKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHNraXBwaW5nID0gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIEpzb25TY29wZSBwZWVrU3RhY2soKSB7CisgICAgICAgIHJldHVybiBzdGFjay5nZXQoc3RhY2suc2l6ZSgpIC0gMSk7CisgICAgfQorCisgICAgcHJpdmF0ZSBKc29uU2NvcGUgcG9wKCkgeworICAgICAgICByZXR1cm4gc3RhY2sucmVtb3ZlKHN0YWNrLnNpemUoKSAtIDEpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBwdXNoKEpzb25TY29wZSBuZXdUb3ApIHsKKyAgICAgICAgc3RhY2suYWRkKG5ld1RvcCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVwbGFjZSB0aGUgdmFsdWUgb24gdGhlIHRvcCBvZiB0aGUgc3RhY2sgd2l0aCB0aGUgZ2l2ZW4gdmFsdWUuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHJlcGxhY2VUb3AoSnNvblNjb3BlIG5ld1RvcCkgeworICAgICAgICBzdGFjay5zZXQoc3RhY2suc2l6ZSgpIC0gMSwgbmV3VG9wKTsKKyAgICB9CisKKyAgICBwcml2YXRlIEpzb25Ub2tlbiBuZXh0SW5BcnJheShib29sZWFuIGZpcnN0RWxlbWVudCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKGZpcnN0RWxlbWVudCkgeworICAgICAgICAgICAgcmVwbGFjZVRvcChKc29uU2NvcGUuTk9ORU1QVFlfQVJSQVkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLyogTG9vayBmb3IgYSBjb21tYSBiZWZvcmUgZWFjaCBlbGVtZW50IGFmdGVyIHRoZSBmaXJzdCBlbGVtZW50LiAqLworICAgICAgICAgICAgc3dpdGNoIChuZXh0Tm9uV2hpdGVzcGFjZSgpKSB7CisgICAgICAgICAgICAgICAgY2FzZSAnXSc6CisgICAgICAgICAgICAgICAgICAgIHBvcCgpOworICAgICAgICAgICAgICAgICAgICBoYXNUb2tlbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbiA9IEpzb25Ub2tlbi5FTkRfQVJSQVk7CisgICAgICAgICAgICAgICAgY2FzZSAnOyc6CisgICAgICAgICAgICAgICAgICAgIGNoZWNrTGVuaWVudCgpOyAvLyBmYWxsLXRocm91Z2gKKyAgICAgICAgICAgICAgICBjYXNlICcsJzoKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgc3ludGF4RXJyb3IoIlVudGVybWluYXRlZCBhcnJheSIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgc3dpdGNoIChuZXh0Tm9uV2hpdGVzcGFjZSgpKSB7CisgICAgICAgICAgICBjYXNlICddJzoKKyAgICAgICAgICAgICAgICBpZiAoZmlyc3RFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHBvcCgpOworICAgICAgICAgICAgICAgICAgICBoYXNUb2tlbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbiA9IEpzb25Ub2tlbi5FTkRfQVJSQVk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIGZhbGwtdGhyb3VnaCB0byBoYW5kbGUgIixdIgorICAgICAgICAgICAgY2FzZSAnOyc6CisgICAgICAgICAgICBjYXNlICcsJzoKKyAgICAgICAgICAgICAgICAvKiBJbiBsZW5pZW50IG1vZGUsIGEgMC1sZW5ndGggbGl0ZXJhbCBtZWFucyAnbnVsbCcgKi8KKyAgICAgICAgICAgICAgICBjaGVja0xlbmllbnQoKTsKKyAgICAgICAgICAgICAgICBwb3MtLTsKKyAgICAgICAgICAgICAgICBoYXNUb2tlbiA9IHRydWU7CisgICAgICAgICAgICAgICAgdmFsdWUgPSAibnVsbCI7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuID0gSnNvblRva2VuLk5VTEw7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHBvcy0tOworICAgICAgICAgICAgICAgIHJldHVybiBuZXh0VmFsdWUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgSnNvblRva2VuIG5leHRJbk9iamVjdChib29sZWFuIGZpcnN0RWxlbWVudCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogUmVhZCBkZWxpbWl0ZXJzLiBFaXRoZXIgYSBjb21tYS9zZW1pY29sb24gc2VwYXJhdGluZyB0aGlzIGFuZCB0aGUKKyAgICAgICAgICogcHJldmlvdXMgbmFtZS12YWx1ZSBwYWlyLCBvciBhIGNsb3NlIGJyYWNlIHRvIGRlbm90ZSB0aGUgZW5kIG9mIHRoZQorICAgICAgICAgKiBvYmplY3QuCisgICAgICAgICAqLworICAgICAgICBpZiAoZmlyc3RFbGVtZW50KSB7CisgICAgICAgICAgICAvKiBQZWVrIHRvIHNlZSBpZiB0aGlzIGlzIHRoZSBlbXB0eSBvYmplY3QuICovCisgICAgICAgICAgICBzd2l0Y2ggKG5leHROb25XaGl0ZXNwYWNlKCkpIHsKKyAgICAgICAgICAgICAgICBjYXNlICd9JzoKKyAgICAgICAgICAgICAgICAgICAgcG9wKCk7CisgICAgICAgICAgICAgICAgICAgIGhhc1Rva2VuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuID0gSnNvblRva2VuLkVORF9PQkpFQ1Q7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgcG9zLS07CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzd2l0Y2ggKG5leHROb25XaGl0ZXNwYWNlKCkpIHsKKyAgICAgICAgICAgICAgICBjYXNlICd9JzoKKyAgICAgICAgICAgICAgICAgICAgcG9wKCk7CisgICAgICAgICAgICAgICAgICAgIGhhc1Rva2VuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuID0gSnNvblRva2VuLkVORF9PQkpFQ1Q7CisgICAgICAgICAgICAgICAgY2FzZSAnOyc6CisgICAgICAgICAgICAgICAgY2FzZSAnLCc6CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHRocm93IHN5bnRheEVycm9yKCJVbnRlcm1pbmF0ZWQgb2JqZWN0Iik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiBSZWFkIHRoZSBuYW1lLiAqLworICAgICAgICBpbnQgcXVvdGUgPSBuZXh0Tm9uV2hpdGVzcGFjZSgpOworICAgICAgICBzd2l0Y2ggKHF1b3RlKSB7CisgICAgICAgICAgICBjYXNlICdcJyc6CisgICAgICAgICAgICAgICAgY2hlY2tMZW5pZW50KCk7IC8vIGZhbGwtdGhyb3VnaAorICAgICAgICAgICAgY2FzZSAnIic6CisgICAgICAgICAgICAgICAgbmFtZSA9IG5leHRTdHJpbmcoKGNoYXIpIHF1b3RlKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgY2hlY2tMZW5pZW50KCk7CisgICAgICAgICAgICAgICAgcG9zLS07CisgICAgICAgICAgICAgICAgbmFtZSA9IG5leHRMaXRlcmFsKCk7CisgICAgICAgICAgICAgICAgaWYgKG5hbWUuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IHN5bnRheEVycm9yKCJFeHBlY3RlZCBuYW1lIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmVwbGFjZVRvcChKc29uU2NvcGUuREFOR0xJTkdfTkFNRSk7CisgICAgICAgIGhhc1Rva2VuID0gdHJ1ZTsKKyAgICAgICAgcmV0dXJuIHRva2VuID0gSnNvblRva2VuLk5BTUU7CisgICAgfQorCisgICAgcHJpdmF0ZSBKc29uVG9rZW4gb2JqZWN0VmFsdWUoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICAvKgorICAgICAgICAgKiBSZWFkIHRoZSBuYW1lL3ZhbHVlIHNlcGFyYXRvci4gVXN1YWxseSBhIGNvbG9uICc6Jy4gSW4gbGVuaWVudCBtb2RlCisgICAgICAgICAqIHdlIGFsc28gYWNjZXB0IGFuIGVxdWFscyBzaWduICc9Jywgb3IgYW4gYXJyb3cgIj0+Ii4KKyAgICAgICAgICovCisgICAgICAgIHN3aXRjaCAobmV4dE5vbldoaXRlc3BhY2UoKSkgeworICAgICAgICAgICAgY2FzZSAnOic6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlICc9JzoKKyAgICAgICAgICAgICAgICBjaGVja0xlbmllbnQoKTsKKyAgICAgICAgICAgICAgICBpZiAoKHBvcyA8IGxpbWl0IHx8IGZpbGxCdWZmZXIoMSkpICYmIGJ1ZmZlcltwb3NdID09ICc+JykgeworICAgICAgICAgICAgICAgICAgICBwb3MrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHRocm93IHN5bnRheEVycm9yKCJFeHBlY3RlZCAnOiciKTsKKyAgICAgICAgfQorCisgICAgICAgIHJlcGxhY2VUb3AoSnNvblNjb3BlLk5PTkVNUFRZX09CSkVDVCk7CisgICAgICAgIHJldHVybiBuZXh0VmFsdWUoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIEpzb25Ub2tlbiBuZXh0VmFsdWUoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBpbnQgYyA9IG5leHROb25XaGl0ZXNwYWNlKCk7CisgICAgICAgIHN3aXRjaCAoYykgeworICAgICAgICAgICAgY2FzZSAneyc6CisgICAgICAgICAgICAgICAgcHVzaChKc29uU2NvcGUuRU1QVFlfT0JKRUNUKTsKKyAgICAgICAgICAgICAgICBoYXNUb2tlbiA9IHRydWU7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuID0gSnNvblRva2VuLkJFR0lOX09CSkVDVDsKKworICAgICAgICAgICAgY2FzZSAnWyc6CisgICAgICAgICAgICAgICAgcHVzaChKc29uU2NvcGUuRU1QVFlfQVJSQVkpOworICAgICAgICAgICAgICAgIGhhc1Rva2VuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4gPSBKc29uVG9rZW4uQkVHSU5fQVJSQVk7CisKKyAgICAgICAgICAgIGNhc2UgJ1wnJzoKKyAgICAgICAgICAgICAgICBjaGVja0xlbmllbnQoKTsgLy8gZmFsbC10aHJvdWdoCisgICAgICAgICAgICBjYXNlICciJzoKKyAgICAgICAgICAgICAgICB2YWx1ZSA9IG5leHRTdHJpbmcoKGNoYXIpIGMpOworICAgICAgICAgICAgICAgIGhhc1Rva2VuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4gPSBKc29uVG9rZW4uU1RSSU5HOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHBvcy0tOworICAgICAgICAgICAgICAgIHJldHVybiByZWFkTGl0ZXJhbCgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0cnVlIG9uY2Uge0Bjb2RlIGxpbWl0IC0gcG9zID49IG1pbmltdW19LiBJZiB0aGUgZGF0YSBpcworICAgICAqIGV4aGF1c3RlZCBiZWZvcmUgdGhhdCBtYW55IGNoYXJhY3RlcnMgYXJlIGF2YWlsYWJsZSwgdGhpcyByZXR1cm5zCisgICAgICogZmFsc2UuCisgICAgICovCisgICAgcHJpdmF0ZSBib29sZWFuIGZpbGxCdWZmZXIoaW50IG1pbmltdW0pIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGlmIChsaW1pdCAhPSBwb3MpIHsKKyAgICAgICAgICAgIGxpbWl0IC09IHBvczsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoYnVmZmVyLCBwb3MsIGJ1ZmZlciwgMCwgbGltaXQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbGltaXQgPSAwOworICAgICAgICB9CisKKyAgICAgICAgcG9zID0gMDsKKyAgICAgICAgaW50IHRvdGFsOworICAgICAgICB3aGlsZSAoKHRvdGFsID0gaW4ucmVhZChidWZmZXIsIGxpbWl0LCBidWZmZXIubGVuZ3RoIC0gbGltaXQpKSAhPSAtMSkgeworICAgICAgICAgICAgbGltaXQgKz0gdG90YWw7CisgICAgICAgICAgICBpZiAobGltaXQgPj0gbWluaW11bSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwcml2YXRlIGludCBuZXh0Tm9uV2hpdGVzcGFjZSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIHdoaWxlIChwb3MgPCBsaW1pdCB8fCBmaWxsQnVmZmVyKDEpKSB7CisgICAgICAgICAgICBpbnQgYyA9IGJ1ZmZlcltwb3MrK107CisgICAgICAgICAgICBzd2l0Y2ggKGMpIHsKKyAgICAgICAgICAgICAgICBjYXNlICdcdCc6CisgICAgICAgICAgICAgICAgY2FzZSAnICc6CisgICAgICAgICAgICAgICAgY2FzZSAnXG4nOgorICAgICAgICAgICAgICAgIGNhc2UgJ1xyJzoKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgICAgICAgICBjYXNlICcvJzoKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBvcyA9PSBsaW1pdCAmJiAhZmlsbEJ1ZmZlcigxKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGM7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBjaGVja0xlbmllbnQoKTsKKyAgICAgICAgICAgICAgICAgICAgY2hhciBwZWVrID0gYnVmZmVyW3Bvc107CisgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocGVlaykgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnKic6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2tpcCBhIC8qIGMtc3R5bGUgY29tbWVudCAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcysrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2tpcFRvKCIqLyIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IHN5bnRheEVycm9yKCJVbnRlcm1pbmF0ZWQgY29tbWVudCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnLyc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2tpcCBhIC8vIGVuZC1vZi1saW5lIGNvbW1lbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3MrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBza2lwVG9FbmRPZkxpbmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYzsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY2FzZSAnIyc6CisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAqIFNraXAgYSAjIGhhc2ggZW5kLW9mLWxpbmUgY29tbWVudC4gVGhlIEpTT04gUkZDIGRvZXNuJ3QKKyAgICAgICAgICAgICAgICAgICAgICogc3BlY2lmeSB0aGlzIGJlaGF2aW91ciwgYnV0IGl0J3MgcmVxdWlyZWQgdG8gcGFyc2UKKyAgICAgICAgICAgICAgICAgICAgICogZXhpc3RpbmcgZG9jdW1lbnRzLiBTZWUgaHR0cDovL2IvMjU3MTQyMy4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGNoZWNrTGVuaWVudCgpOworICAgICAgICAgICAgICAgICAgICBza2lwVG9FbmRPZkxpbmUoKTsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHRocm93IHN5bnRheEVycm9yKCJFbmQgb2YgaW5wdXQiKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgY2hlY2tMZW5pZW50KCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKCFsZW5pZW50KSB7CisgICAgICAgICAgICB0aHJvdyBzeW50YXhFcnJvcigiVXNlIEpzb25SZWFkZXIuc2V0TGVuaWVudCh0cnVlKSB0byBhY2NlcHQgbWFsZm9ybWVkIEpTT04iKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEFkdmFuY2VzIHRoZSBwb3NpdGlvbiB1bnRpbCBhZnRlciB0aGUgbmV4dCBuZXdsaW5lIGNoYXJhY3Rlci4gSWYgdGhlIGxpbmUKKyAgICAgKiBpcyB0ZXJtaW5hdGVkIGJ5ICJcclxuIiwgdGhlICdcbicgbXVzdCBiZSBjb25zdW1lZCBhcyB3aGl0ZXNwYWNlIGJ5IHRoZQorICAgICAqIGNhbGxlci4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgc2tpcFRvRW5kT2ZMaW5lKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgd2hpbGUgKHBvcyA8IGxpbWl0IHx8IGZpbGxCdWZmZXIoMSkpIHsKKyAgICAgICAgICAgIGNoYXIgYyA9IGJ1ZmZlcltwb3MrK107CisgICAgICAgICAgICBpZiAoYyA9PSAnXHInIHx8IGMgPT0gJ1xuJykgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIHNraXBUbyhTdHJpbmcgdG9GaW5kKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBvdXRlcjoKKyAgICAgICAgZm9yICg7IHBvcyArIHRvRmluZC5sZW5ndGgoKSA8IGxpbWl0IHx8IGZpbGxCdWZmZXIodG9GaW5kLmxlbmd0aCgpKTsgcG9zKyspIHsKKyAgICAgICAgICAgIGZvciAoaW50IGMgPSAwOyBjIDwgdG9GaW5kLmxlbmd0aCgpOyBjKyspIHsKKyAgICAgICAgICAgICAgICBpZiAoYnVmZmVyW3BvcyArIGNdICE9IHRvRmluZC5jaGFyQXQoYykpIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWUgb3V0ZXI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIHN0cmluZyB1cCB0byBidXQgbm90IGluY2x1ZGluZyB7QGNvZGUgcXVvdGV9LCB1bmVzY2FwaW5nIGFueQorICAgICAqIGNoYXJhY3RlciBlc2NhcGUgc2VxdWVuY2VzIGVuY291bnRlcmVkIGFsb25nIHRoZSB3YXkuIFRoZSBvcGVuaW5nIHF1b3RlCisgICAgICogc2hvdWxkIGhhdmUgYWxyZWFkeSBiZWVuIHJlYWQuIFRoaXMgY29uc3VtZXMgdGhlIGNsb3NpbmcgcXVvdGUsIGJ1dCBkb2VzCisgICAgICogbm90IGluY2x1ZGUgaXQgaW4gdGhlIHJldHVybmVkIHN0cmluZy4KKyAgICAgKgorICAgICAqIEBwYXJhbSBxdW90ZSBlaXRoZXIgJyBvciAiLgorICAgICAqIEB0aHJvd3MgTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGlmIGFueSB1bmljb2RlIGVzY2FwZSBzZXF1ZW5jZXMgYXJlCisgICAgICogICAgIG1hbGZvcm1lZC4KKyAgICAgKi8KKyAgICBwcml2YXRlIFN0cmluZyBuZXh0U3RyaW5nKGNoYXIgcXVvdGUpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG51bGw7CisgICAgICAgIGRvIHsKKyAgICAgICAgICAgIC8qIHRoZSBpbmRleCBvZiB0aGUgZmlyc3QgY2hhcmFjdGVyIG5vdCB5ZXQgYXBwZW5kZWQgdG8gdGhlIGJ1aWxkZXIuICovCisgICAgICAgICAgICBpbnQgc3RhcnQgPSBwb3M7CisgICAgICAgICAgICB3aGlsZSAocG9zIDwgbGltaXQpIHsKKyAgICAgICAgICAgICAgICBpbnQgYyA9IGJ1ZmZlcltwb3MrK107CisKKyAgICAgICAgICAgICAgICBpZiAoYyA9PSBxdW90ZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc2tpcHBpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAic2tpcHBlZCEiOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJ1aWxkZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmcoYnVmZmVyLCBzdGFydCwgcG9zIC0gc3RhcnQgLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGJ1ZmZlciwgc3RhcnQsIHBvcyAtIHN0YXJ0IC0gMSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPT0gJ1xcJykgeworICAgICAgICAgICAgICAgICAgICBpZiAoYnVpbGRlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChidWZmZXIsIHN0YXJ0LCBwb3MgLSBzdGFydCAtIDEpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChyZWFkRXNjYXBlQ2hhcmFjdGVyKCkpOworICAgICAgICAgICAgICAgICAgICBzdGFydCA9IHBvczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChidWlsZGVyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGJ1ZmZlciwgc3RhcnQsIHBvcyAtIHN0YXJ0KTsKKyAgICAgICAgfSB3aGlsZSAoZmlsbEJ1ZmZlcigxKSk7CisKKyAgICAgICAgdGhyb3cgc3ludGF4RXJyb3IoIlVudGVybWluYXRlZCBzdHJpbmciKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBzdHJpbmcgdXAgdG8gYnV0IG5vdCBpbmNsdWRpbmcgYW55IGRlbGltaXRlciBjaGFyYWN0ZXJzLiBUaGlzCisgICAgICogZG9lcyBub3QgY29uc3VtZSB0aGUgZGVsaW1pdGVyIGNoYXJhY3Rlci4KKyAgICAgKi8KKyAgICBwcml2YXRlIFN0cmluZyBuZXh0TGl0ZXJhbCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG51bGw7CisgICAgICAgIGRvIHsKKyAgICAgICAgICAgIC8qIHRoZSBpbmRleCBvZiB0aGUgZmlyc3QgY2hhcmFjdGVyIG5vdCB5ZXQgYXBwZW5kZWQgdG8gdGhlIGJ1aWxkZXIuICovCisgICAgICAgICAgICBpbnQgc3RhcnQgPSBwb3M7CisgICAgICAgICAgICB3aGlsZSAocG9zIDwgbGltaXQpIHsKKyAgICAgICAgICAgICAgICBpbnQgYyA9IGJ1ZmZlcltwb3MrK107CisgICAgICAgICAgICAgICAgc3dpdGNoIChjKSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgJy8nOgorICAgICAgICAgICAgICAgICAgICBjYXNlICdcXCc6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgJzsnOgorICAgICAgICAgICAgICAgICAgICBjYXNlICcjJzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAnPSc6CisgICAgICAgICAgICAgICAgICAgICAgICBjaGVja0xlbmllbnQoKTsgLy8gZmFsbC10aHJvdWdoCisKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAneyc6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgJ30nOgorICAgICAgICAgICAgICAgICAgICBjYXNlICdbJzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAnXSc6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgJzonOgorICAgICAgICAgICAgICAgICAgICBjYXNlICcsJzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAnICc6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgJ1x0JzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAnXGYnOgorICAgICAgICAgICAgICAgICAgICBjYXNlICdccic6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgJ1xuJzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvcy0tOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNraXBwaW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJza2lwcGVkISI7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJ1aWxkZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RyaW5nKGJ1ZmZlciwgc3RhcnQsIHBvcyAtIHN0YXJ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoYnVmZmVyLCBzdGFydCwgcG9zIC0gc3RhcnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoYnVpbGRlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChidWZmZXIsIHN0YXJ0LCBwb3MgLSBzdGFydCk7CisgICAgICAgIH0gd2hpbGUgKGZpbGxCdWZmZXIoMSkpOworCisgICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIHJldHVybiBnZXRDbGFzcygpLmdldFNpbXBsZU5hbWUoKSArICIgbmVhciAiICsgZ2V0U25pcHBldCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFVuZXNjYXBlcyB0aGUgY2hhcmFjdGVyIGlkZW50aWZpZWQgYnkgdGhlIGNoYXJhY3RlciB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ybiAoY2hhcikgSW50ZWdlci5wYXJzZUludChoZXgsIDE2KTsKKworICAgICAgICAgICAgY2FzZSAndCc6CisgICAgICAgICAgICAgICAgcmV0dXJuICdcdCc7CisKKyAgICAgICAgICAgIGNhc2UgJ2InOgorICAgICAgICAgICAgICAgIHJldHVybiAnXGInOworCisgICAgICAgICAgICBjYXNlICduJzoKKyAgICAgICAgICAgICAgICByZXR1cm4gJ1xuJzsKKworICAgICAgICAgICAgY2FzZSAncic6CisgICAgICAgICAgICAgICAgcmV0dXJuICdccic7CisKKyAgICAgICAgICAgIGNhc2UgJ2YnOgorICAgICAgICAgICAgICAgIHJldHVybiAnXGYnOworCisgICAgICAgICAgICBjYXNlICdcJyc6CisgICAgICAgICAgICBjYXNlICciJzoKKyAgICAgICAgICAgIGNhc2UgJ1xcJzoKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIGVzY2FwZWQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZWFkcyBhIG51bGwsIGJvb2xlYW4sIG51bWVyaWMgb3IgdW5xdW90ZWQgc3RyaW5nIGxpdGVyYWwgdmFsdWUuCisgICAgICovCisgICAgcHJpdmF0ZSBKc29uVG9rZW4gcmVhZExpdGVyYWwoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmcgbGl0ZXJhbCA9IG5leHRMaXRlcmFsKCk7CisgICAgICAgIGlmIChsaXRlcmFsLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgdGhyb3cgc3ludGF4RXJyb3IoIkV4cGVjdGVkIGxpdGVyYWwgdmFsdWUiKTsKKyAgICAgICAgfQorICAgICAgICB2YWx1ZSA9IGxpdGVyYWw7CisgICAgICAgIGhhc1Rva2VuID0gdHJ1ZTsKKyAgICAgICAgcmV0dXJuIHRva2VuID0gbnVsbDsgLy8gdXNlIGRlY29kZUxpdGVyYWwoKSB0byBnZXQgdGhlIHRva2VuIHR5cGU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ICAgICogd2l0aCB0aGlzIHJlYWRlcidzIGNvbnRlbnQuCisgICAgICovCisgICAgcHVibGljIElPRXhjZXB0aW9uIHN5bnRheEVycm9yKFN0cmluZyBtZXNzYWdlKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICB0aHJvdyBuZXcgSnNvblN5bnRheEV4Y2VwdGlvbihtZXNzYWdlICsgIiBuZWFyICIgKyBnZXRTbmlwcGV0KCkpOworICAgIH0KKworICAgIHByaXZhdGUgQ2hhclNlcXVlbmNlIGdldFNuaXBwZXQoKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgc25pcHBldCA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIGludCBiZWZvcmVQb3MgPSBNYXRoLm1pbihwb3MsIDIwKTsKKyAgICAgICAgc25pcHBldC5hcHBlbmQoYnVmZmVyLCBwb3MgLSBiZWZvcmVQb3MsIGJlZm9yZVBvcyk7CisgICAgICAgIGludCBhZnRlclBvcyA9IE1hdGgubWluKGxpbWl0IC0gcG9zLCAyMCk7CisgICAgICAgIHNuaXBwZXQuYXBwZW5kKGJ1ZmZlciwgcG9zLCBhZnRlclBvcyk7CisgICAgICAgIHJldHVybiBzbmlwcGV0OworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIEpzb25TeW50YXhFeGNlcHRpb24gZXh0ZW5kcyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIHByaXZhdGUgSnNvblN5bnRheEV4Y2VwdGlvbihTdHJpbmcgcykgeworICAgICAgICAgICAgc3VwZXIocyk7CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC91dGlsL0pzb25TY29wZS5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdXRpbC9Kc29uU2NvcGUuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5jYTUzNGU5Ci0tLSAvZGV2L251bGwKKysr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ID09IG51bGwiKTsKKyAgICAgICAgfQorICAgICAgICB0aGlzLm91dCA9IG91dDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXRzIHRoZSBpbmRlbnRhdGlvbiBzdHJpbmcgdG8gYmUgcmVwZWF0ZWQgZm9yIGVhY2ggbGV2ZWwgb2YgaW5kZW50YXRpb24KKyAgICAgKiBpbiB0aGUgZW5jb2RlZCBkb2N1bWVudC4gSWYge0Bjb2RlIGluZGVudC5pc0VtcHR5KCl9IHRoZSBlbmNvZGVkIGRvY3VtZW50CisgICAgICogd2lsbCBiZSBjb21wYWN0LiBPdGhlcndpc2UgdGhlIGVuY29kZWQgZG9jdW1lbnQgd2lsbCBiZSBtb3JlCisgICAgICogaHVtYW4tcmVhZGFibGUuCisgICAgICoKKyAgICAgKiBAcGFyYW0gaW5kZW50IGEgc3RyaW5nIGNvbnRhaW5pbmcgb25seSB3aGl0ZXNwYWNlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEluZGVudChTdHJpbmcgaW5kZW50KSB7CisgICAgICAgIGlmIChpbmRlbnQuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICB0aGlzLmluZGVudCA9IG51bGw7CisgICAgICAgICAgICB0aGlzLnNlcGFyYXRvciA9ICI6IjsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRoaXMuaW5kZW50ID0gaW5kZW50OworICAgICAgICAgICAgdGhpcy5zZXBhcmF0b3IgPSAiOiAiOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQmVnaW5zIGVuY29kaW5nIGEgbmV3IGFycmF5LiBFYWNoIGNhbGwgdG8gdGhpcyBtZXRob2QgbXVzdCBiZSBwYWlyZWQgd2l0aAorICAgICAqIGEgY2FsbCB0byB7QGxpbmsgI2VuZEFycmF5fS4KKyAgICAgKgorICAgICAqIEByZXR1cm4gdGhpcyB3cml0ZXIuCisgICAgICovCisgICAgcHVibGljIEpzb25Xcml0ZXIgYmVnaW5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1QsICJ9Iik7CisgICAgfQorCisgICAgLyoqCisgICAgICogRW50ZXJzIGEgbmV3IHNjb3BlIGJ5IGFwcGVuZGluZyBhbnkgbmVjZXNzYXJ5IHdoaXRlc3BhY2UgYW5kIHRoZSBnaXZlbgorICAgICAqIGJyYWNrZXQuCisgICAgICovCisgICAgcHJpdmF0ZSBKc29uV3JpdGVyIG9wZW4oSnNvblNjb3BlIGVtcHR5LCBTdHJpbmcgb3BlbkJyYWNrZXQpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGJlZm9yZVZhbHVlKHRydWUpOworICAgICAgICBzdGFjay5hZGQoZW1wdHkpOworICAgICAgICBvdXQud3JpdGUob3BlbkJyYWNrZXQpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDbG9zZXMgdGhlIGN1cnJlbnQgc2NvcGUgYnkgYXBwZW5kaW5nIGFueSBuZWNlc3Nhcnkgd2hpdGVzcGFjZSBhbmQgdGhlCisgICAgICogZ2l2ZW4gYnJhY2tldC4KKyAgICAgKi8KKyAgICBwcml2YXRlIEpzb25Xcml0ZXIgY2xvc2UoSnNvblNjb3BlIGVtcHR5LCBKc29uU2NvcGUgbm9uZW1wdHksIFN0cmluZyBjbG9zZUJyYWNrZXQpCisgICAgICAgICAgICB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBKc29uU2NvcGUgY29udGV4dCA9IHBlZWsoKTsKKyAgICAgICAgaWYgKGNvbnRleHQgIT0gbm9uZW1wdHkgJiYgY29udGV4dCAhPSBlbXB0eSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiTmVzdGluZyBwcm9ibGVtOiAiICsgc3RhY2spOworICAgICAgICB9CisKKyAgICAgICAgc3RhY2sucmVtb3ZlKHN0YWNrLnNpemUoKSAtIDEpOworICAgICAgICBpZiAoY29udGV4dCA9PSBub25lbXB0eSkgeworICAgICAgICAgICAgbmV3bGluZSgpOworICAgICAgICB9CisgICAgICAgIG91dC53cml0ZShjbG9zZUJyYWNrZXQpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSB2YWx1ZSBvbiB0aGUgdG9wIG9mIHRoZSBzdGFjay4KKyAgICAgKi8KKyAgICBwcml2YXRlIEpzb25TY29wZSBwZWVrKCkgeworICAgICAgICByZXR1cm4gc3RhY2suZ2V0KHN0YWNrLnNpemUoKSAtIDEpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJlcGxhY2UgdGhlIHZhbHVlIG9uIHRoZSB0b3Agb2YgdGhlIHN0YWNrIHdpdGggdGhlIGdpdmVuIHZhbHVlLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCByZXBsYWNlVG9wKEpzb25TY29wZSB0b3BPZlN0YWNrKSB7CisgICAgICAgIHN0YWNrLnNldChzdGFjay5zaXplKCkgLSAxLCB0b3BPZlN0YWNrKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBFbmNvZGVzIHRoZSBwcm9wZXJ0eSBuYW1lLgorICAgICAqCisgICAgICogQHBhcmFtIG5hbWUgdGhlIG5hbWUgb2YgdGhlIGZvcnRoY29taW5nIHZhbHVlLiBNYXkgbm90IGJlIG51bGwuCisgICAgICogQHJldHVybiB0aGlzIHdyaXRlci4KKyAgICAgKi8KKyAgICBwdWJsaWMgSnNvbldyaXRlciBuYW1lKFN0cmluZyBuYW1lKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBpZiAobmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIm5hbWUgPT0gbnVsbCIpOworICAgICAgICB9CisgICAgICAgIGJlZm9yZU5hbWUoKTsKKyAgICAgICAgc3RyaW5nKG5hbWUpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBFbmNvZGVzIHtAY29kZSB2YWx1ZX0uCisgICAgICoKKyAgICAgKiBAcGFyYW0gdmFsdWUgdGhlIGxpdGVyYWwgc3RyaW5nIHZhbHVlLCBvciBudWxsIHRvIGVuY29kZSBhIG51bGwgbGl0ZXJhbC4KKyAgICAgKiBAcmV0dXJuIHRoaXMgd3JpdGVyLgorICAgICAqLworICAgIHB1YmxpYyBKc29uV3JpdGVyIHZhbHVlKFN0cmluZyB2YWx1ZSkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKHZhbHVlID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsVmFsdWUoKTsKKyAgICAgICAgfQorICAgICAgICBiZWZvcmVWYWx1ZShmYWxzZSk7CisgICAgICAgIHN0cmluZyh2YWx1ZSk7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIC8qKgorICAgICAqIEVuY29kZXMge0Bjb2RlIG51bGx9LgorICAgICAqCisgICAgICogQHJldHVybiB0aGlzIHdyaXRlci4KKyAgICAgKi8KKyAgICBwdWJsaWMgSnNvbldyaXRlciBudWxsVmFsdWUoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBiZWZvcmVWYWx1ZShmYWxzZSk7CisgICAgICAgIG91dC53cml0ZSgibnVsbCIpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBFbmNvZGVzIHtAY29kZSB2YWx1ZX0uCisgICAgICoKKyAgICAgKiBAcmV0dXJuIHRoaXMgd3JpdGVyLgorICAgICAqLworICAgIHB1YmxpYyBKc29uV3JpdGVyIHZhbHVlKGJvb2xlYW4gdmFsdWUpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGJlZm9yZVZhbHVlKGZhbHNlKTsKKyAgICAgICAgb3V0LndyaXRlKHZhbHVlID8gInRydWUiIDogImZhbHNlIik7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIC8qKgorICAgICAqIEVuY29kZXMge0Bjb2RlIHZhbHVlfS4KKyAgICAgKgorICAgICAqIEBwYXJhbSB2YWx1ZSBhIGZpbml0ZSB2YWx1ZS4gTWF5IG5vdCBiZSB7QGxpbmsgRG91YmxlI2lzTmFOKCkgTmFOc30gb3IKKyAgICAgKiAgICAge0BsaW5rIERvdWJsZSNpc0luZmluaXRlKCkgaW5maW5pdGllc30uCisgICAgICogQHJldHVybiB0aGlzIHdyaXRlci4KKyAgICAgKi8KKyAgICBwdWJsaWMgSnNvbldyaXRlciB2YWx1ZShkb3VibGUgdmFsdWUpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGlmIChEb3VibGUuaXNOYU4odmFsdWUpIHx8IERvdWJsZS5pc0luZmluaXRlKHZhbHVlKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTnVtZXJpYyB2YWx1ZXMgbXVzdCBiZSBmaW5pdGUsIGJ1dCB3YXMgIiArIHZhbHVlKTsKKyAgICAgICAgfQorICAgICAgICBiZWZvcmVWYWx1ZShmYWxzZSk7CisgICAgICAgIG91dC5hcHBlbmQoRG91YmxlLnRvU3RyaW5nKHZhbHVlKSk7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIC8qKgorICAgICAqIEVuY29kZXMge0Bjb2RlIHZhbHVlfS4KKyAgICAgKgorICAgICAqIEByZXR1cm4gdGhpcyB3cml0ZXIuCisgICAgICovCisgICAgcHVibGljIEpzb25Xcml0ZXIgdmFsdWUobG9uZyB2YWx1ZSkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgYmVmb3JlVmFsdWUoZmFsc2UpOworICAgICAgICBvdXQud3JpdGUoTG9uZy50b1N0cmluZyh2YWx1ZSkpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBFbnN1cmVzIGFsbCBidWZmZXJlZCBkYXRhIGlzIHdyaXR0ZW4gdG8gdGhlIHVuZGVybHlpbmcge0BsaW5rIFdyaXRlcn0KKyAgICAgKiBhbmQgZmx1c2hlcyB0aGF0IHdyaXRlci4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBmbHVzaCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIG91dC5mbHVzaCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEZsdXNoZXMgYW5kIGNsb3NlcyB0aGlzIHdyaXRlciBhbmQgdGhlIHVuZGVybHlpbmcge0BsaW5rIFdyaXRlcn0uCisgICAgICoKKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uIGlmIHRoZSBKU09OIGRvY3VtZW50IGlzIGluY29tcGxldGUuCisgICAgICovCisgICAgcHVibGljIHZvaWQgY2xvc2UoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBvdXQuY2xvc2UoKTsKKworICAgICAgICBpZiAocGVlaygpICE9IEpzb25TY29wZS5OT05FTVBUWV9ET0NVTUVOVCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJJbmNvbXBsZXRlIGRvY3VtZW50Iik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc3RyaW5nKFN0cmluZyB2YWx1ZSkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgb3V0LndyaXRlKCJcIiIpOworICAgICAgICBmb3IgKGludCBpID0gMCwgbGVuZ3RoID0gdmFsdWUubGVuZ3RoKCk7IGkgPCBsZW5ndGg7IGkrKykgeworICAgICAgICAgICAgY2hhciBjID0gdmFsdWUuY2hhckF0KGkpOworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogRnJvbSBSRkMgNDYyNywgIkFsbCBVbmljb2RlIGNoYXJhY3RlcnMgbWF5IGJlIHBsYWNlZCB3aXRoaW4gdGhlCisgICAgICAgICAgICAgKiBxdW90YXRpb24gbWFya3MgZXhjZXB0IGZvciB0aGUgY2hhcmFjdGVycyB0aGF0IG11c3QgYmUgZXNjYXBlZDoKKyAgICAgICAgICAgICAqIHF1b3RhdGlvbiBtYXJrLCByZXZlcnNlIHNvbGlkdXMsIGFuZCB0aGUgY29udHJvbCBjaGFyYWN0ZXJzCisgICAgICAgICAgICAgKiAoVSswMDAwIHRocm91Z2ggVSswMDFGKS4iCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHN3aXRjaCAoYykgeworICAgICAgICAgICAgICAgIGNhc2UgJyInOgorICAgICAgICAgICAgICAgIGNhc2UgJ1xcJzoKKyAgICAgICAgICAgICAgICBjYXNlICcvJzoKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKCdcXCcpOworICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGUoYyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSAnXHQnOgorICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGUoIlxcdCIpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgJ1xiJzoKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKCJcXGIiKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlICdcbic6CisgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZSgiXFxuIik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSAnXHInOgorICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGUoIlxcciIpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgJ1xmJzoKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKCJcXGYiKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBpZiAoYyA8PSAweDFGKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGUoU3RyaW5nLmZvcm1hdCgiXFx1JTA0eCIsIChpbnQpIGMpKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZShjKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICB9CisgICAgICAgIG91dC53cml0ZSgiXCIiKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgbmV3bGluZSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGlmIChpbmRlbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgb3V0LndyaXRlKCJcbiIpOworICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8IHN0YWNrLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICBvdXQud3JpdGUoaW5kZW50KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEluc2VydHMgYW55IG5lY2Vzc2FyeSBzZXBhcmF0b3JzIGFuZCB3aGl0ZXNwYWNlIGJlZm9yZSBhIG5hbWUuIEFsc28KKyAgICAgKiBhZGp1c3RzIHRoZSBzdGFjayB0byBleHBlY3QgdGhlIG5hbWUncyB2YWx1ZS4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgYmVmb3JlTmFtZSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25TY29wZSBjb250ZXh0ID0gcGVlaygpOworICAgICAgICBpZiAoY29udGV4dCA9PSBKc29uU2NvcGUuTk9ORU1QVFlfT0JKRUNUKSB7IC8vIGZpcnN0IGluIG9iamVjdAorICAgICAgICAgICAgb3V0LndyaXRlKCcsJyk7CisgICAgICAgIH0gZWxzZSBpZiAoY29udGV4dCAhPSBKc29uU2NvcGUuRU1QVFlfT0JKRUNUKSB7IC8vIG5vdCBpbiBhbiBvYmplY3QhCisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJOZXN0aW5nIHByb2JsZW06ICIgKyBzdGFjayk7CisgICAgICAgIH0KKyAgICAgICAgbmV3bGluZSgpOworICAgICAgICByZXBsYWNlVG9wKEpzb25TY29wZS5EQU5HTElOR19OQU1FKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBJbnNlcnRzIGFueSBuZWNlc3Nhcnkgc2VwYXJhdG9ycyBhbmQgd2hpdGVzcGFjZSBiZWZvcmUgYSBsaXRlcmFsIHZhbHVlLAorICAgICAqIGlubGluZSBhcnJheSwgb3IgaW5saW5lIG9iamVjdC4gQWxzbyBhZGp1c3RzIHRoZSBzdGFjayB0byBleHBlY3QgZWl0aGVyIGEKKyAgICAgKiBjbG9zaW5nIGJyYWNrZXQgb3IgYW5vdGhlciBlbGVtZW50LgorICAgICAqCisgICAgICogQHBhcmFtIHJvb3QgdHJ1ZSBpZiB0aGUgdmFsdWUgaXMgYSBuZXcgYXJyYXkgb3Igb2JqZWN0LCB0aGUgdHdvIHZhbHVlcworICAgICAqICAgICBwZXJtaXR0ZWQgYXMgdG9wLWxldmVsIGVsZW1lbnRzLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBiZWZvcmVWYWx1ZShib29sZWFuIHJvb3QpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIHN3aXRjaCAocGVlaygpKSB7CisgICAgICAgICAgICBjYXNlIEVNUFRZX0RPQ1VNRU5UOiAvLyBmaXJzdCBpbiBkb2N1bWVudAorICAgICAgICAgICAgICAgIGlmICghcm9vdCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJKU09OIG11c3Qgc3RhcnQgd2l0aCBhbiBhcnJheSBvciBhbiBvYmplY3QuIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlcGxhY2VUb3AoSnNvblNjb3BlLk5PTkVNUFRZX0RPQ1VNRU5UKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBFTVBUWV9BUlJBWTogLy8gZmlyc3QgaW4gYXJyYXkKKyAgICAgICAgICAgICAgICByZXBsYWNlVG9wKEpzb25TY29wZS5OT05FTVBUWV9BUlJBWSk7CisgICAgICAgICAgICAgICAgbmV3bGluZSgpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIE5PTkVNUFRZX0FSUkFZOiAvLyBhbm90aGVyIGluIGFycmF5CisgICAgICAgICAgICAgICAgb3V0LmFwcGVuZCgnLCcpOworICAgICAgICAgICAgICAgIG5ld2xpbmUoKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBEQU5HTElOR19OQU1FOiAvLyB2YWx1ZSBmb3IgbmFtZQorICAgICAgICAgICAgICAgIG91dC5hcHBlbmQoc2VwYXJhdG9yKTsKKyAgICAgICAgICAgICAgICByZXBsYWNlVG9wKEpzb25TY29wZS5OT05FTVBUWV9PQkpFQ1QpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIE5PTkVNUFRZX0RPQ1VNRU5UOgorICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiSlNPTiBtdXN0IGhhdmUgb25seSBvbmUgdG9wLWxldmVsIHZhbHVlLiIpOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIk5lc3RpbmcgcHJvYmxlbTogIiArIHN0YWNrKTsKKyAgICAgICAgfQorICAgIH0KK30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c3VsdCA9IHJlc3VsdDsKKyAgICB9CisKKyAgICBzdGF0aWMgRHJhZ0V2ZW50IG9idGFpbigpIHsKKyAgICAgICAgcmV0dXJuIERyYWdFdmVudC5vYnRhaW4oMCwgMGYsIDBmLCBudWxsLCBudWxsLCBmYWxzZSk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBEcmFnRXZlbnQgb2J0YWluKGludCBhY3Rpb24sIGZsb2F0IHgsIGZsb2F0IHksCisgICAgICAgICAgICBDbGlwRGVzY3JpcHRpb24gZGVzY3JpcHRpb24sIENsaXBEYXRhIGRhdGEsIGJvb2xlYW4gcmVzdWx0KSB7CisgICAgICAgIGZpbmFsIERyYWdFdmVudCBldjsKKyAgICAgICAgc3luY2hyb25pemVkIChnUmVjeWNsZXJMb2NrKSB7CisgICAgICAgICAgICBpZiAoZ1JlY3ljbGVyVG9wID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBldiA9IG5ldyBEcmFnRXZlbnQoKTsKKyAgICAgICAgICAgICAgICBldi5pbml0KGFjdGlvbiwgeCwgeSwgZGVzY3JpcHRpb24sIGRhdGEsIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGV2OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZXYgPSBnUmVjeWNsZXJUb3A7CisgICAgICAgICAgICBnUmVjeWNsZXJUb3AgPSBldi5tTmV4dDsKKyAgICAgICAgICAgIGdSZWN5Y2xlclVzZWQgLT0gMTsKKyAgICAgICAgfQorICAgICAgICBldi5tUmVjeWNsZWRMb2NhdGlvbiA9IG51bGw7CisgICAgICAgIGV2Lm1SZWN5Y2xlZCA9IGZhbHNlOworICAgICAgICBldi5tTmV4dCA9IG51bGw7CisKKyAgICAgICAgZXYuaW5pdChhY3Rpb24sIHgsIHksIGRlc2NyaXB0aW9uLCBkYXRhLCByZXN1bHQpOworCisgICAgICAgIHJldHVybiBldjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIERyYWdFdmVudCBv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mIChUUkFDS19SRUNZQ0xFRF9MT0NBVElPTikgeworICAgICAgICAgICAgaWYgKG1SZWN5Y2xlZExvY2F0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbih0b1N0cmluZygpICsgIiByZWN5Y2xlZCB0d2ljZSEiLCBtUmVjeWNsZWRMb2NhdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtUmVjeWNsZWRMb2NhdGlvbiA9IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJMYXN0IHJlY3ljbGVkIGhlcmUiKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGlmIChtUmVjeWNsZWQpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbih0b1N0cmluZygpICsgIiByZWN5Y2xlZCB0d2ljZSEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1SZWN5Y2xlZCA9IHRydWU7CisgICAgICAgIH0KKworICAgICAgICBtQ2xpcERhdGEgPSBudWxsOworICAgICAgICBtQ2xpcERlc2NyaXB0aW9uID0gbnVsbDsKKworICAgICAgICBzeW5jaHJvbml6ZWQgKGdSZWN5Y2xlckxvY2spIHsKKyAgICAgICAgICAgIGlmIChnUmVjeWNsZXJVc2VkIDwgTUFYX1JFQ1lDTEVEKSB7CisgICAgICAgICAgICAgICAgZ1JlY3ljbGVyVXNlZCsrOworICAgICAgICAgICAgICAgIG1OZXh0ID0gZ1JlY3ljbGVyVG9wOworICAgICAgICAgICAgICAgIGdSZWN5Y2xlclRvcCA9IHRoaXM7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICByZXR1cm4gIkRyYWdFdmVudHsiICsgSW50ZWdlci50b0hleFN0cmluZyhTeXN0ZW0uaWRlbnRpdHlIYXNoQ29kZSh0aGlzKSkKKyAgICAgICAgKyAiIGFjdGlvbj0iICsgbUFjdGlvbiArICIgQCAoIiArIG1YICsgIiwgIiArIG1ZICsgIikgZGVzYz0iICsgbUNsaXBEZXNjcmlwdGlvbgorICAgICAgICArICIgZGF0YT0iICsgbUNsaXBEYXRhICsgIiByZXN1bHQ9IiArIG1EcmFnUmVzdWx0CisgICAgICAgICsgIn0iOworICAgIH0KKworICAgIC8qIFBhcmNlbGFibGUgaW50ZXJmYWNlICovCisKKyAgICBwdWJsaWMgaW50IGRlc2NyaWJlQ29udGVudHMoKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgeworICAgICAgICBkZXN0LndyaXRlSW50KG1BY3Rpb24pOworICAgICAgICBkZXN0LndyaXRlRmxvYXQobVgpOworICAgICAgICBkZXN0LndyaXRlRmxvYXQobVkpOworICAgICAgICBkZXN0LndyaXRlSW50KG1EcmFnUmVzdWx0ID8gMSA6IDApOworICAgICAgICBpZiAobUNsaXBEYXRhID09IG51bGwpIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KDEpOworICAgICAgICAgICAgbUNsaXBEYXRhLndyaXRlVG9QYXJjZWwoZGVzdCwgZmxhZ3MpOworICAgICAgICB9CisgICAgICAgIGlmIChtQ2xpcERlc2NyaXB0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KDEpOworICAgICAgICAgICAgbUNsaXBEZXNjcmlwdGlvbi53cml0ZVRvUGFyY2VsKGRlc3QsIGZsYWdzKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgUGFyY2VsYWJsZS5DcmVhdG9yPERyYWdFdmVudD4gQ1JFQVRPUiA9CisgICAgICAgIG5ldyBQYXJjZWxhYmxlLkNyZWF0b3I8RHJhZ0V2ZW50PigpIHsKKyAgICAgICAgcHVibGljIERyYWdFdmVudCBjcmVhdGVGcm9tUGFyY2VsKFBhcmNlbCBpbikgeworICAgICAgICAgICAgRHJhZ0V2ZW50IGV2ZW50ID0gRHJhZ0V2ZW50Lm9idGFpbigpOworICAgICAgICAgICAgZXZlbnQubUFjdGlvbiA9IGluLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIGV2ZW50Lm1YID0gaW4ucmVhZEZsb2F0KCk7CisgICAgICAgICAgICBldmVudC5tWSA9IGluLnJlYWRGbG9hdCgpOworICAgICAgICAgICAgZXZlbnQubURyYWdSZXN1bHQgPSAoaW4ucmVhZEludCgpICE9IDApOworICAgICAgICAgICAgaWYgKGluLnJlYWRJbnQoKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgZXZlbnQubUNsaXBEYXRhID0gQ2xpcERhdGEuQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKGluKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChpbi5yZWFkSW50KCkgIT0gMCkgeworICAgICAgICAgICAgICAgIGV2ZW50Lm1DbGlwRGVzY3JpcHRpb24gPSBDbGlwRGVzY3JpcHRpb24uQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKGluKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBldmVudDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBEcmFnRXZlbnRbXSBuZXdBcnJheShpbnQgc2l6ZSkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBEcmFnRXZlbnRbc2l6ZV07CisgICAgICAgIH0KKyAgICB9OworfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9HTEVTMjBDYW52YXMuamF2Y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AgQE92ZXJyaWRlCisgICAgdm9pZCBvblBvc3REcmF3KCkgeworICAgICAgICBuRmluaXNoKG1SZW5kZXJlcik7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgbkZpbmlzaChpbnQgcmVuZGVyZXIpOworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gYWNxdWlyZUNvbnRleHQoKSB7CisgICAgICAgIGlmICghbUNvbnRleHRMb2NrZWQpIHsKKyAgICAgICAgICAgIG5BY3F1aXJlQ29udGV4dChtUmVuZGVyZXIpOworICAgICAgICAgICAgbUNvbnRleHRMb2NrZWQgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtQ29udGV4dExvY2tlZDsKKyAgICB9CisKKyAgICBwcml2YXRlIG5hdGl2ZSB2b2lkIG5BY3F1aXJlQ29udGV4dChpbnQgcmVuZGVyZXIpOworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcmVsZWFzZUNvbnRleHQoKSB7CisgICAgICAgIGlmIChtQ29udGV4dExvY2tlZCkgeworICAgICAgICAgICAgblJlbGVhc2VDb250ZXh0KG1SZW5kZXJlcik7CisgICAgICAgICAgICBtQ29udGV4dExvY2tlZCA9IGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBuUmVsZWFzZUNvbnRleHQoaW50IHJlbmRlcmVyKTsKKyAgICAKKyAgICAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKyAgICAvLyBEaXNwbGF5IGxpc3QKKyAgICAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKworICAgIGludCBnZXREaXNwbGF5TGlzdCgpI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k7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGludCBzYXZlTGF5ZXJBbHBoYShmbG9hdCBsZWZ0LCBmbG9hdCB0b3AsIGZsb2F0IHJpZ2h0LCBmbG9hdCBib3R0b20sIGludCBhbHBoYSwKKyAgICAgICAgICAgIGludCBzYXZlRmxhZ3MpIHsKKyAgICAgICAgcmV0dXJuIG5TYXZlTGF5ZXJBbHBoYShtUmVuZGVyZXIsIGxlZnQsIHRvcCwgcmlnaHQsIGJvdHRvbSwgYWxwaGEsIHNhdmVGbGFncyk7CisgICAgfQorCisgICAgcHJpdmF0ZSBuYXRpdmUgaW50IG5TYXZlTGF5ZXJBbHBoYShpbnQgcmVuZGVyZXIsIGZsb2F0IGxlZnQsIGZsb2F0IHRvcCwgZmxvYXQgcmlnaHQsCisgICAgICAgICAgICBmbG9hdCBib3R0b20sIGludCBhbHBoYSwgaW50IHNhdmVGbGFncyk7CisgICAgCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcmVzdG9yZSgpIHsKKyAgICAgICAgblJlc3RvcmUobVJlbmRlcmVyKTsKKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBuUmVzdG9yZShpbnQgcmVuZGVyZXIpOworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcmVzdG9yZVRvQ291bnQoaW50IHNhdmVDb3VudCkgeworICAgICAgICBuUmVzdG9yZVRvQ291bnQobVJlbmRlcmVyLCBzYXZlQ291bnQpOworICAgIH0KKworICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgblJlc3RvcmVUb0NvdW50KGludCByZW5kZXJlciwgaW50IHNhdmVDb3VudCk7CisgICAgCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGludCBnZXRTYXZlQ291bnQoKSB7CisgICAgICAgIHJldHVybiBuR2V0U2F2ZUNvdW50KG1SZW5kZXJlcik7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgbmF0a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bmRlcmVyLCBiaXRtYXAubU5hdGl2ZUJpdG1hcCwgbWF0cml4Lm5hdGl2ZV9pbnN0YW5jZSwgbmF0aXZlUGFpbnQpOworICAgICAgICBpZiAoaGFzQ29sb3JGaWx0ZXIpIG5SZXNldE1vZGlmaWVycyhtUmVuZGVyZXIpOworICAgIH0KKworICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgbkRyYXdCaXRtYXAoaW50IHJlbmRlcmVyLCBpbnQgYml0bWFwLCBpbnQgbWF0cml4LCBpbnQgcGFpbnQpOworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd0JpdG1hcChCaXRtYXAgYml0bWFwLCBSZWN0IHNyYywgUmVjdCBkc3QsIFBhaW50IHBhaW50KSB7CisgICAgICAgIC8vIFNoYWRlcnMgYXJlIGlnbm9yZWQgd2hlbiBkcmF3aW5nIGJpdG1hcHMKKyAgICAgICAgYm9vbGVhbiBoYXNDb2xvckZpbHRlciA9IHBhaW50ICE9IG51bGwgJiYgc2V0dXBDb2xvckZpbHRlcihwYWludCk7CisgICAgICAgIGZpbmFsIGludCBuYXRpdmVQYWludCA9IHBhaW50ID09IG51bGwgPyAwIDogcGFpbnQubU5hdGl2ZVBhaW50OworCisgICAgICAgIGludCBsZWZ0LCB0b3AsIHJpZ2h0LCBib3R0b207CisgICAgICAgIGlmIChzcmMgPT0gbnVsbCkgeworICAgICAgICAgICAgbGVmdCA9IHRvcCA9IDA7CisgICAgICAgICAgICByaWdodCA9IGJpdG1hcC5nZXRXaWR0aCgpOworICAgICAgICAgICAgYm90dG9tID0gYml0bWFwLmdldEhlaWdodCgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbGVmdCA9IHNyYy5sZWZ0OworICAgICAgICAgICAgcmlnaHQgPSBzcmMucmlnaHQ7CisgICAgICAgICAgICB0b3AgPSBzcmMudG9wOworICAgICAgICAgICAgYm90dG9tID0gc3JjLmJvdHRvbTsKKyAgICAgICAgfQorCisgICAgICAgI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AgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd0NvbG9yKGludCBjb2xvciwgUG9ydGVyRHVmZi5Nb2RlIG1vZGUpIHsKKyAgICAgICAgbkRyYXdDb2xvcihtUmVuZGVyZXIsIGNvbG9yLCBtb2RlLm5hdGl2ZUludCk7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgbkRyYXdDb2xvcihpbnQgcmVuZGVyZXIsIGludCBjb2xvciwgaW50IG1vZGUpOworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd0xpbmUoZmxvYXQgc3RhcnRYLCBmbG9hdCBzdGFydFksIGZsb2F0IHN0b3BYLCBmbG9hdCBzdG9wWSwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgbUxpbmVbMF0gPSBzdGFydFg7CisgICAgICAgIG1MaW5lWzFdID0gc3RhcnRZOworICAgICAgICBtTGluZVsyXSA9IHN0b3BYOworICAgICAgICBtTGluZVszXSA9IHN0b3BZOworICAgICAgICBkcmF3TGluZXMobUxpbmUsIDAsIDQsIHBhaW50KTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBkcmF3TGluZXMoZmxvYXRbXSBwdHMsIGludCBvZmZzZXQsIGludCBjb3VudCwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgaWYgKChvZmZzZXQgfCBjb3VudCkgPCAwIHx8IG9mZnNldCArIGNvdW50ID4gcHRzLmxlbmd0aCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVGhlIGxpbmVzIGFycmF5IG11c3QgY29udGFpbiA0IGVsZW1lbnRzIHBlciBsaW5lLiIpOworICAgICAgICB9CisgICAgICAgIGJvb2xlYW4gaGFzTW9kaWZpZXIgPSBzZXR1cE1vZGlmaWVycyhwYWludCk7CisgICAgICAgIG5EcmF3TGluZXMobVJlbmRlcmVyLCBwdHMsIG9mZnNldCwgY291bnQsIHBhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIGlmIChoYXNNb2RpZmllcikgblJlc2V0TW9kaWZpZXJzKG1SZW5kZXJlcik7CisgICAgfQorCisgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBuRHJhd0xpbmVzKGludCByZW5kZXJlciwgZmxvYXRbXSBwb2ludHMsIGludCBvZmZzZXQsIGludCBjb3VudCwgaW50IHBhaW50KTsKKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdMaW5lcyhmbG9hdFtdIHB0cywgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgZHJhd0xpbmVzKHB0cywgMCwgcHRzLmxlbmd0aCwgcGFpbnQpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdPdmFsKFJlY3RGIG92YWwsIFBhaW50IHBhaW50KSB7CisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdQYWludChQYWludCBwYWludCkgeworICAgICAgICBmaW5hbCBSZWN0IHIgPSBtQ2xpcEJvdW5kczsKKyAgICAgICAgbkdldENsaXBCb3VuZHMobVJlbmRlcmVyLCByKTsKKyAgICAgICAgZHJhd1JlY3Qoci5sZWZ0LCByLnRvcCwgci5yaWdodCwgci5ib3R0b20sIHBhaW50KTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBkcmF3UGF0aChQYXRoIHBhdGgsIFBhaW50IHBhaW50KSB7CisgICAgICAgIGJvb2xlYW4gaGFzTW9kaWZpZXIgPSBzZXR1cE1vZGlmaWVycyhwYWludCk7CisgICAgICAgIGlmIChwYXRoLmlzU2ltcGxlUGF0aCkgeworICAgICAgICAgICAgaWYgKHBhdGgucmVjdHMgIT0gbnVsbCkg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isgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd1RleHQoY2hhcltdIHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LCBmbG9hdCB4LCBmbG9hdCB5LCBQYWludCBwYWludCkgeworICAgICAgICBpZiAoKGluZGV4IHwgY291bnQgfCAoaW5kZXggKyBjb3VudCkgfCAodGV4dC5sZW5ndGggLSBpbmRleCAtIGNvdW50KSkgPCAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigpOworICAgICAgICB9CisKKyAgICAgICAgYm9vbGVhbiBoYXNNb2RpZmllciA9IHNldHVwTW9kaWZpZXJzKHBhaW50KTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG5EcmF3VGV4dChtUmVuZGVyZXIsIHRleHQsIGluZGV4LCBjb3VudCwgeCwgeSwgcGFpbnQubUJpZGlGbGFncywgcGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChoYXNNb2RpZmllcikgblJlc2V0TW9kaWZpZXJzKG1SZW5kZXJlcik7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBuRHJhd1RleHQoaW50IHJlbmRlcmVyLCBjaGFyW10gdGV4dCwgaW50IGluZGV4LCBpbnQgY291bnQsIGZsb2F0IHgsIGZsb2F0IHksCisgICAgICAgICAgICBpbnQgYmlkaUZsYWdzLCBpbnQgcGFpbnQpOworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd1RleHQoQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwgZmxvYXQgeCwgZmxvYXQgeSwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgYm9vbGVhbiBoYXNNb2RpZmllciA9IHNldHVwTW9kaWZpZXJzKHBhaW50KTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgU3RyaW5nIHx8IHRleHQgaW5zdGFuY2VvZiBTcGFubmVkU3RyaW5nIHx8CisgICAgICAgICAgICAgICAgICAgIHRleHQgaW5zdGFuY2VvZiBTcGFubmFibGVTdHJpbmcpIHsKKyAgICAgICAgICAgICAgICBuRHJhd1RleHQobVJlbmRlcmVyLCB0ZXh0LnRvU3RyaW5nKCksIHN0YXJ0LCBlbmQsIHgsIHksIHBhaW50Lm1CaWRpRmxhZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICAgICAgfSBlbHNlIGlmICh0ZXh0IGluc3RhbmNlb2YgR3JhcGhpY3NPcGVyYXRpb25zKSB7CisgICAgICAgICAgICAgICAgKChHcmFwaGljc09wZXJhdGlvbnMpIHRleHQpLmRyYXdUZXh0KHRoaXMsIHN0YXJ0LCBlbmQsIHgsIHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWludCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGNoYXJbXSBidWYgPSBUZW1wb3JhcnlCdWZmZXIub2J0YWluKGVuZCAtIHN0YXJ0KTsKKyAgICAgICAgICAgICAgICBUZXh0VXRpbHMuZ2V0Q2hhcnModGV4dCwgc3RhcnQsIGVuZCwgYnVmLCAwKTsKKyAgICAgICAgICAgICAgICBuRHJhd1RleHQobVJlbmRlcmVyLCBidWYsIDAsIGVuZCAtIHN0YXJ0LCB4LCB5LCBwYWludC5tQmlkaUZsYWdzLCBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICAgICAgICAgIFRlbXBvcmFyeUJ1ZmZlci5yZWN5Y2xlKGJ1Zik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBpZiAoaGFzTW9kaWZpZXIpIG5SZXNldE1vZGlmaWVycyhtUmVuZGVyZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd1RleHQoU3RyaW5nIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwgZmxvYXQgeCwgZmxvYXQgeSwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgaWYgKChzdGFydCB8IGVuZCB8IChlbmQgLSBzdGFydCkgfCAodGV4dC5sZW5ndGgoKSAtIGVuZCkpIDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IEluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oKTsKKyAgICAgICAgfQorCisgICAgICAgIGJvb2xlYW4gaGFzTW9kaWZpZXIgPSBzZXR1cE1vZGlmaWVycyhwYWludCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBuRHJhd1RleHQobVJlbmRlcmVyLCB0ZXh0LCBzdGFydCwgZW5kLCB4LCB5LCBwYWludC5tQmlkaUZsYWdzLCBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKGhhc01vZGlmaWVyKSBuUmVzZXRNb2RpZmllcnMobVJlbmRlcmVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgbkRyYXdUZXh0KGludCByZW5kZXJlciwgU3RyaW5nIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwgZmxvYXQgeCwgZmxvYXQgeSwKKyAgICAgICAgICAgIGludCBiaWRpRmxhZ3MsIGludCBwYWludCk7CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBkcmF3VGV4dChTdHJpbmcgdGV4dCwgZmxvYXQgeCwgZmxvYXQgeSwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgYm9vbGVhbiBoYXNNb2RpZmllciA9IHNldHVwTW9kaWZpZXJzKHBhaW50KTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG5EcmF3VGV4dChtUmVuZGVyZXIsIHRleHQsIDAsIHRleHQubGVuZ3RoKCksIHgsIHksIHBhaW50Lm1CaWRpRmxhZ3MsCisgICAgICAgICAgICAgICAgICAgIHBhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBpZiAoaGFzTW9kaWZpZXIpIG5SZXNldE1vZGlmaWVycyhtUmVuZGVyZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd1RleHRPblBhdGgoY2hhcltdIHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LCBQYXRoIHBhdGgsIGZsb2F0IGhPZmZzZXQsCisgICAgICAgICAgICBmbG9hdCB2T2Zmc2V0LCBQYWludCBwYWludCkgeworICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBkcmF3VGV4dE9uUGF0aChTdHJpbmcgdGV4dCwgUGF0aCBwYXRoLCBmbG9hdCBoT2Zmc2V0LCBmbG9hdCB2T2Zmc2V0LCBQYWludCBwYWludCkgeworICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBkcmF3VGV4dFJ1bihjaGFyW10gdGV4dCwgaW50IGluZGV4LCBpbnQgY291bnQsIGludCBjb250ZXh0SW5kZXgsIGludCBjb250ZXh0Q291bnQsCisgICAgICAgICAgICBmbG9hdCB4LCBmbG9hdCB5LCBpbnQgZGlyLCBQYWludCBwYWludCkgeworICAgICAgICBpZiAoKGluZGV4IHwgY291bnQgfCB0ZXh0Lmxlbmd0aCAtIGluZGV4IC0gY291bnQpIDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IEluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZGlyICE9IERJUkVDVElPTl9MVFIgJiYgZGlyICE9IERJUkVDVElPTl9SVEwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVua25vd24gZGlyZWN0aW9uOiAiICsgZGlyKTsKKyAgICAgICAgfQorCisgICAgICAgIGJvb2xlYW4gaGFzTW9kaWZpZXIgPSBzZXR1cE1vZGlmaWVycyhwYWludCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBuRHJhd1RleHRSdW4obVJlbmRlcmVyLCB0ZXh0LCBpbmRleCwgY291bnQsIGNvbnRleHRJbmRleCwgY29udGV4dENvdW50LCB4LCB5LCBkaXIsCisgICAgICAgICAgICAgICAgICAgIHBhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBpZiAoaGFzTW9kaWZpZXIpIG5SZXNldE1vZGlmaWVycyhtUmVuZGVyZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBuRHJhd1RleHRSdW4oaW50IHJlbmRlcmVyLCBjaGFyW10gdGV4dCwgaW50IGluZGV4LCBpbnQgY291bnQsCisgICAgICAgICAgICBpbnQgY29udGV4dEluZGV4LCBpbnQgY29udGV4dENvdW50LCBmbG9hdCB4LCBmbG9hdCB5LCBpbnQgZGlyLCBpbnQgbmF0aXZlUGFpbnQpOworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd1RleHRSdW4oQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsCisgICAgICAgICAgICBmbG9hdCB4LCBmbG9hdCB5LCBpbnQgZGlyLCBQYWludCBwYWludCkgeworICAgICAgICBpZiAoKHN0YXJ0IHwgZW5kIHwgZW5kIC0gc3RhcnQgfCB0ZXh0Lmxlbmd0aCgpIC0gZW5kKSA8IDApIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uKCk7CisgICAgICAgIH0KKworICAgICAgICBib29sZWFuIGhhc01vZGlmaWVyID0gc2V0dXBNb2RpZmllcnMocGFpbnQpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaW50IGZsYWdzID0gZGlyID09IDAgPyAwIDogMTsKKyAgICAgICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgU3RyaW5nIHx8IHRleHQgaW5zdGFuY2VvZiBTcGFubmVkU3RyaW5nIHx8CisgICAgICAgICAgICAgICAgICAgIHRleHQgaW5zdGFuY2VvZiBTcGFubmFibGVTdHJpbmcpIHsKKyAgICAgICAgICAgICAgICBuRHJhd1RleHRSdW4obVJlbmRlcmVyLCB0ZXh0LnRvU3RyaW5nKCksIHN0YXJ0LCBlbmQsIGNvbnRleHRTdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHRFbmQsIHgsIHksIGZsYWdzLCBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICAgICAgfSBlbHNlIGlmICh0ZXh0IGluc3RhbmNlb2YgR3JhcGhpY3NPcGVyYXRpb25zKSB7CisgICAgICAgICAgICAgICAgKChHcmFwaGljc09wZXJhdGlvbnMpIHRleHQpLmRyYXdUZXh0UnVuKHRoaXMsIHN0YXJ0LCBlbmQsCisgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIHgsIHksIGZsYWdzLCBwYWludCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludCBjb250ZXh0TGVuID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgICAgICBpbnQgbGVuID0gZW5kIC0gc3RhcnQ7CisgICAgICAgICAgICAgICAgY2hhcltdIGJ1ZiA9IFRlbXBvcmFyeUJ1ZmZlci5vYnRhaW4oY29udGV4dExlbik7CisgICAgICAgICAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgYnVmLCAwKTsKKyAgICAgICAgICAgICAgICBuRHJhd1RleHRSdW4obVJlbmRlcmVyLCBidWYsIHN0YXJ0IC0gY29udGV4dFN0YXJ0LCBsZW4sIDAsIGNvbnRleHRMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICB4LCB5LCBmbGFncywgcGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICAgICAgICAgICAgICBUZW1wb3JhcnlCdWZmZXIucmVjeWNsZShidWYpOworICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKGhhc01vZGlmaWVyKSBuUmVzZXRNb2RpZmllcnMobVJlbmRlcmVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgbkRyYXdUZXh0UnVuKGludCByZW5kZXJlciwgU3RyaW5nIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKKyAgICAgICAgICAgIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLCBmbG9hdCB4LCBmbG9hdCB5LCBpbnQgZmxhZ3MsIGludCBuYXRpdmVQYWludCk7CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBkcmF3VmVydGljZXMoVmVydGV4TW9kZSBtb2RlLCBpbnQgdmVydGV4Q291bnQsIGZsb2F0W10gdmVydHMsIGludCB2ZXJ0T2Zmc2V0LAorICAgICAgICAgICAgZmxvYXRbXSB0ZXhzLCBpbnQgdGV4T2Zmc2V0LCBpbnRbXSBjb2xvcnMsIGludCBjb2xvck9mZnNldCwgc2hvcnRbXSBpbmRpY2VzLAorICAgICAgICAgICAgaW50IGluZGV4T2Zmc2V0LCBpbnQgaW5kZXhDb3VudCwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgLy8gVE9ETzogSW1wbGVtZW50CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIHNldHVwTW9kaWZpZXJzKFBhaW50IHBhaW50KSB7CisgICAgICAgIGJvb2xlYW4gaGFzTW9kaWZpZXIgPSBmYWxzZTsKKworICAgICAgICBpZiAocGFpbnQuaGFzU2hhZG93KSB7CisgICAgICAgICAgICBuU2V0dXBTaGFkb3cobVJlbmRlcmVyLCBwYWludC5zaGFkb3dSYWRpdXMsIHBhaW50LnNoYWRvd0R4LCBwYWludC5zaGFkb3dEeSwKKyAgICAgICAgICAgICAgICAgICAgcGFpbnQuc2hhZG93Q29sb3IpOworICAgICAgICAgICAgaGFzTW9kaWZpZXIgPSB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgU2hhZGVyIHNoYWRlciA9IHBhaW50LmdldFNoYWRlcigpOworICAgICAgICBpZiAoc2hhZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG5TZXR1cFNoYWRlcihtUmVuZGVyZXIsIHNoYWRlci5uYXRpdmVfc2hhZGVyKTsKKyAgICAgICAgICAgIGhhc01vZGlmaWVyID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIENvbG9yRmlsdGVyIGZpbHRlciA9IHBhaW50LmdldENvbG9yRmlsdGVyKCk7CisgICAgICAgIGlmIChmaWx0ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgblNldHVwQ29sb3JGaWx0ZXIobVJlbmRlcmVyLCBmaWx0ZXIubmF0aXZlQ29sb3JGaWx0ZXIpOworICAgICAgICAgICAgaGFzTW9kaWZpZXIgPSB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGhhc01vZGlmaWVyOworICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBzZXR1cENvbG9yRmlsdGVyKFBhaW50IHBha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3QgZXh0ZW5kcyBEaXNwbGF5TGlzdCB7CisgICAgcHJpdmF0ZSBHTEVTMjBDYW52YXMgbUNhbnZhczsKKworICAgIHByaXZhdGUgYm9vbGVhbiBtU3RhcnRlZCA9IGZhbHNlOworICAgIHByaXZhdGUgYm9vbGVhbiBtUmVjb3JkZWQgPSBmYWxzZTsKKworICAgIGludCBtTmF0aXZlRGlzcGxheUxpc3Q7CisKKyAgICBAT3ZlcnJpZGUKKyAgICBIYXJkd2FyZUNhbnZhcyBzdGFydCgpIHsKKyAgICAgICAgaWYgKG1TdGFydGVkKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJSZWNvcmRpbmcgaGFzIGFscmVhZHkgc3RhcnRlZCIpOworICAgICAgICB9CisKKyAgICAgICAgbUNhbnZhcyA9IG5ldyBHTEVTMjBDYW52YXModHJ1ZSwgdHJ1ZSk7CisgICAgICAgIG1TdGFydGVkID0gdHJ1ZTsKKyAgICAgICAgbVJlY29yZGVkID0gZmFsc2U7CisKKyAgICAgICAgcmV0dXJuIG1DYW52YXM7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgdm9pZCBlbmQoKSB7CisgICAgICAgIGlmIChtQ2FudmFzICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1TdGFydGVkID0gZmFsc2U7CisgICAgICAgICAgICBtUmVjb3JkZWQgPSB0cnVlOworCisgICAgICAgICAgICBtTmF0aXZlRGlzcGxheUxpc3QgPSBtQ2FudmFzLmdldERpc3BsYXlMaXN0KCk7CisgICAgICAgICAgICBuZXcgRGlzcGxheUxpc3RGaW5hbGl6ZXIodGhpcyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBib29sZWFuIGlzUmVhZHkoKSB7CisgICAgICAgIHJldHVybiAhbVN0YXJ0ZWQgJiYgbVJlY29yZGVkOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIERpc3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ICAgcHJpdmF0ZSBib29sZWFuIG1EZXN0cm95ZWQ7CisKKyAgICAgICAgR2xSZW5kZXJlcihpbnQgZ2xWZXJzaW9uLCBib29sZWFuIHRyYW5zbHVjZW50KSB7CisgICAgICAgICAgICBtR2xWZXJzaW9uID0gZ2xWZXJzaW9uOworICAgICAgICAgICAgbVRyYW5zbHVjZW50ID0gdHJhbnNsdWNlbnQ7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJuIGEgc3RyaW5nIGZvciB0aGUgRUdMIGVycm9yIGNvZGUsIG9yIHRoZSBoZXggcmVwcmVzZW50YXRpb24KKyAgICAgICAgICogaWYgdGhlIGVycm9yIGlzIHVua25vd24uCisgICAgICAgICAqIAorICAgICAgICAgKiBAcGFyYW0gZXJyb3IgVGhlIEVHTCBlcnJvciB0byBjb252ZXJ0IGludG8gYSBTdHJpbmcuCisgICAgICAgICAqIAorICAgICAgICAgKiBAcmV0dXJuIEFuIGVycm9yIHN0cmluZyBjb3JyZXBvbmRpbmcgdG8gdGhlIEVHTCBlcnJvciBjb2RlLgorICAgICAgICAgKi8KKyAgICAgICAgc3RhdGljIFN0cmluZyBnZXRFR0xFcnJvclN0cmluZyhpbnQgZXJyb3IpIHsKKyAgICAgICAgICAgIHN3aXRjaCAoZXJyb3IpIHsKKyAgICAgICAgICAgICAgICBjYXNlIEVHTDEwLkVHTF9TVUNDRVNTOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gIkVHTF9TVUNDRVNTIjsKKyAgICAgICAgICAgICAgICBjYXNlIEVHTDEwLkVHTF9OT1RfSU5JVElBTElaRUQ6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAiRUdMX05PVF9JTklUSUFMSVpFRCI7CisgICAgICAgICAgICAgICAgY2FzZSBFR0wxMC5FR0xfQkFEX0FDQ0VTUzoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJFR0xfQkFEX0FDQ0VTUyI7CisgICAgICAgICAgICAgICAgY2FzZSBFR0wxMC5FR0xfQkFEX0FMTE9DOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gIkVHTF9CQURfQUxMT0MiOworICAgICAgICAgICAgICAgIGNhc2UgRUdMMTAuRUdMX0JBRF9BVFRSSUJVVEU6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAiRUdMX0JBRF9BVFRSSUJVVEUiOworICAgICAgICAgICAgICAgIGNhc2UgRUdMMTAuRUdMX0JBRF9DT05GSUc6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAiRUdMX0JBRF9DT05GSUciOworICAgICAgICAgICAgICAgIGNhc2UgRUdMMTAuRUdMX0JBRF9DT05URVhUOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gIkVHTF9CQURfQ09OVEVYVCI7CisgICAgICAgICAgICAgICAgY2FzZSBFR0wxMC5FR0xfQkFEX0NVUlJFTlRfU1VSRkFDRToKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJFR0xfQkFEX0NVUlJFTlRfU1VSRkFDRSI7CisgICAgICAgICAgICAgICAgY2FzZSBFR0wxMC5FR0xfQkFEX0RJU1BMQVk6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAiRUdMX0JBRF9ESVNQTEFZIjsKKyAgICAgICAgICAgICAgICBjYXNlIEVHTDEwLkVHTF9CQURfTUFUQ0g6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAiRUdMX0JBRF9NQVRDSCI7CisgICAgICAgICAgICAgICAgY2FzZSBFR0wxMC5FR0xfQkFEX05BVElWRV9QSVhNQVA6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAiRUdMX0JBRF9OQVRJVkVfUElYTUFQIjsKKyAgICAgICAgICAgICAgICBjYXNlIEVHTDEwLkVHTF9CQURfTkFUSVZFX1dJTkRPVzoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJFR0xfQkFEX05BVElWRV9XSU5ET1ciOworICAgICAgICAgICAgICAgIGNhc2UgRUdMMTAuRUdMX0JBRF9QQVJBTUVURVI6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAiRUdMX0JBRF9QQVJBTUVURVIiOworICAgICAgICAgICAgICAgIGNhc2UgRUdMMTAuRUdMX0JBRF9TVVJGQUNFOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gIkVHTF9CQURfU1VSRkFDRSI7CisgICAgICAgICAgICAgICAgY2FzZSBFR0wxMS5FR0xfQ09OVEVYVF9MT1NUOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gIkVHTF9DT05URVhUX0xPU1QiOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAiMHgiICsgSW50ZWdlci50b0hleFN0cmluZyhlcnJvcik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ2hlY2tzIGZvciBPcGVuR0wgZXJyb3JzLiBJZiBhbiBlcnJvciBoYXMgb2NjdXJlZCwge0BsaW5rICNkZXN0cm95KGJvb2xlYW4pfQorICAgICAgICAgKiBpcyBpbnZva2VkIGFuZCB0aGUgcmVxdWVzdGVkIGZsYWcgaXMgdHVybmVkIG9mZi4gVGhlIGVycm9yIGNvZGUgaXMKKyAgICAgICAgICogYWxzbyBsb2dnZWQgYXMgYSB3YXJuaW5nLgorICAgICAgICAgKi8KKyAgICAgICAgdm9pZCBjaGVja0VnbEVycm9ycygpIHsKKyAgICAgICAgICAgIGlmIChpc0VuYWJsZWQoKSkgeworICAgICAgICAgICAgICAgIGludCBlcnJvciA9IHNFZ2wuZWdsR2V0RXJyb3IoKTsKKyAgICAgICAgICAgICAgICBpZiAoZXJyb3IgIT0gRUdMMTAuRUdMX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gc29tZXRoaW5nIGJhZCBoYXMgaGFwcGVuZWQgcmV2ZXJ0IHRvCisgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbCByZW5kZXJpbmcuCisgICAgICAgICAgICAgICAgICAgIGRlc3Ryb3kodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciAhPSBFR0wxMS5FR0xfQ09OVEVYVF9MT1NUKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSdsbCB0cnkgYWdhaW4gaWYgaXQgd2FzIGNvbnRleHQgbG9zdAorICAgICAgICAgICAgICAgICAgICAgICAgc2V0UmVxdWVzdGVkKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiRUdMIGVycm9yOiAiICsgZ2V0RUdMRXJyb3JTdHJpbmcoZXJyb3IpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBib29sZWFuIGluaXRpYWxpemUoU3VyZmFjZUhvbGRlciBob2xkZXIpIHsKKyAgICAgICAgICAgIGlmIChpc1JlcXVlc3RlZCgpICYmICFpc0VuYWJsZWQoKSkgeworICAgICAgICAgICAgICAgIGluaXRpYWxpemVFZ2woKTsKKyAgICAgICAgICAgICAgICBtR2wgPSBjcmVhdGVFZ2xTdXJmYWNlKGhvbGRlcik7CisgICAgICAgICAgICAgICAgbURlc3Ryb3llZCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgaWYgKG1HbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBlcnIgPSBzRWdsLmVnbEdldEVycm9yKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gRUdMMTAuRUdMX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Ryb3kodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXF1ZXN0ZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1DYW52YXMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DYW52YXMgPSBjcmVhdGVDYW52YXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQ2FudmFzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRFbmFibGVkKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiSGFyZHdhcmUgYWNjZWxlcmF0ZWQgQ2FudmFzIGNvdWxkIG5vdCBiZSBjcmVhdGVkIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbUNhbnZhcyAhPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGFic3RyYWN0IEdMRVMyMENhbnZhcyBjcmVhdGVDYW52YXMoKTsKKworICAgICAgICB2b2lkIGluaXRpYWxpemVFZ2woKSB7CisgICAgICAgICAgICBpZiAoc0VnbENvbnRleHQgIT0gbnVsbCkgcmV0dXJuOworCisgICAgICAgICAgICBzRWdsVGhyZWFkID0gVGhyZWFkLmN1cnJlbnRUaHJlYWQoKTsKKyAgICAgICAgICAgIHNFZ2wgPSAoRUdMMTApIEVHTENvbnRleHQuZ2V0RUdMKCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIEdldCB0byB0aGUgZGVmYXVsdCBkaXNwbGF5LgorICAgICAgICAgICAgc0VnbERpc3BsYXkgPSBzRWdsLmVnbEdldERpc3BsYXkoRUdMMTAuRUdMX0RFRkFVTFRfRElTUExBWSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChzRWdsRGlzcGxheSA9PSBFR0wxMC5FR0xfTk9fRElTUExBWSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJlZ2xHZXREaXNwbGF5IGZhaWxlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICArIGdldEVHTEVycm9yU3RyaW5nKHNFZ2wuZWdsR2V0RXJyb3IoKSkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBXZSBjYW4gbm93IGluaXRpYWxpemUgRUdMIGZvciB0aGF0IGRpc3BsYXkKKyAgICAgICAgICAgIGludFtdIHZlcnNpb24gPSBuZXcgaW50WzJdOworICAgICAgICAgICAgaWYgKCFzRWdsLmVnbEluaXRpYWxpemUoc0VnbERpc3BsYXksIHZlcnNpb24pKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oImVnbEluaXRpYWxpemUgZmFpbGVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgZ2V0RUdMRXJyb3JTdHJpbmcoc0VnbC5lZ2xHZXRFcnJvcigpKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzRWdsQ29uZmlnID0gZ2V0Q29uZmlnQ2hvb3NlcihtR2xWZXJzaW9uKS5jaG9vc2VDb25maWcoc0VnbCwgc0VnbERpc3BsYXkpOworICAgICAgICAgICAgCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgKiBDcmVhdGUgYW4gRUdMIGNvbnRleHQuIFdlIHdhbnQgdG8gZG8gdGhpcyBhcyByYXJlbHkgYXMgd2UgY2FuLCBiZWNhdXNlIGFuCisgICAgICAgICAgICAqIEVHTCBjb250ZXh0IGlzIGEgc29tZXdoYXQgaGVhdnkgb2JqZWN0LgorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHNFZ2xDb250ZXh0ID0gY3JlYXRlQ29udGV4dChzRWdsLCBzRWdsRGlzcGxheSwgc0VnbENvbmZpZyk7CisgICAgICAgIH0KKworICAgICAgICBHTCBjcmVhdGVFZ2xTdXJmYWNlKFN1cmZhY2VIb2xkZXIgaG9sZGVyKSB7CisgICAgICAgICAgICAvLyBDaGVjayBwcmVjb25kaXRpb25zLgorICAgICAgICAgICAgaWYgKHNFZ2wgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJlZ2wgbm90IGluaXRpYWxpemVkIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoc0VnbERpc3BsYXkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJlZ2xEaXNwbGF5IG5vdCBpbml0aWFsaXplZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHNFZ2xDb25maWcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJtRWdsQ29uZmlnIG5vdCBpbml0aWFsaXplZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKFRocmVhZC5jdXJyZW50VGhyZWFkKCkgIT0gc0VnbFRocmVhZCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkhhcmR3YXJlUmVuZGVyZXIgY2Fubm90IGJlIHVzZWQgIiAKKyAgICAgICAgICAgICAgICAgICAgICAgICsgImZyb20gbXVsdGlwbGUgdGhyZWFkcyIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogIFRoZSB3aW5kb3cgc2l6ZSBoYXMgY2hhbmdlZCwgc28gd2UgbmVlZCB0byBjcmVhdGUgYSBuZXcKKyAgICAgICAgICAgICAqICBzdXJmYWNlLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAobUVnbFN1cmZhY2UgIT0gbnVsbCAmJiBtRWdsU3VyZmFjZSAhPSBFR0wxMC5FR0xfTk9fU1VSRkFDRSkgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogVW5iaW5kIGFuZCBkZXN0cm95IHRoZSBvbGQgRUdMIHN1cmZhY2UsIGlmCisgICAgICAgICAgICAgICAgICogdGhlcmUgaXMgb25lLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIHNFZ2wuZWdsTWFrZUN1cnJlbnQoc0VnbERpc3BsYXksIEVHTDEwLkVHTF9OT19TVVJGQUNFLAorICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX05PX1NVUkZBQ0UsIEVHTDEwLkVHTF9OT19DT05URVhUKTsKKyAgICAgICAgICAgICAgICBzRWdsLmVnbERlc3Ryb3lTdXJmYWNlKHNFZ2xEaXNwbGF5LCBtRWdsU3VyZmFjZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIENyZWF0ZSBhbiBFR0wgc3VyZmFjZSB3ZSBjYW4gcmVuZGVyIGludG8uCisgICAgICAgICAgICBtRWdsU3VyZmFjZSA9IHNFZ2wuZWdsQ3JlYXRlV2luZG93U3VyZmFjZShzRWdsRGlzcGxheSwgc0VnbENvbmZpZywgaG9sZGVyLCBudWxsKTsKKworICAgICAgICAgICAgaWYgKG1FZ2xTdXJmYWNlID09IG51bGwgfHwgbUVnbFN1cmZhY2UgPT0gRUdMMTAuRUdMX05PX1NVUkZBQ0UpIHsKKyAgICAgICAgICAgICAgICBpbnQgZXJyb3IgPSBzRWdsLmVnbEdldEVycm9yKCk7CisgICAgICAgICAgICAgICAgaWYgKGVycm9yID09IEVHTDEwLkVHTF9CQURfTkFUSVZFX1dJTkRPVykgeworICAgICAgICAgICAgICAgICAgICBMb2cuZSgiRWdsSGVscGVyIiwgImNyZWF0ZVdpbmRvd1N1cmZhY2UgcmV0dXJuZWQgRUdMX0JBRF9OQVRJVkVfV0lORE9XLiIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIC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Z2xEaXNwbGF5LCBlZ2xDb25maWcsIEVHTDEwLkVHTF9OT19DT05URVhULAorICAgICAgICAgICAgICAgICAgICBtR2xWZXJzaW9uICE9IDAgPyBhdHRyaWJfbGlzdCA6IG51bGwpOyAgICAgICAgICAgIAorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHZvaWQgaW5pdGlhbGl6ZUlmTmVlZGVkKGludCB3aWR0aCwgaW50IGhlaWdodCwgVmlldy5BdHRhY2hJbmZvIGF0dGFjaEluZm8sCisgICAgICAgICAgICAgICAgU3VyZmFjZUhvbGRlciBob2xkZXIpIHsKKyAgICAgICAgICAgIGlmIChpc1JlcXVlc3RlZCgpKSB7CisgICAgICAgICAgICAgICAgY2hlY2tFZ2xFcnJvcnMoKTsKKyAgICAgICAgICAgICAgICBzdXBlci5pbml0aWFsaXplSWZOZWVkZWQod2lkdGgsIGhlaWdodCwgYXR0YWNoSW5mbywgaG9sZGVyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHZvaWQgZGVzdHJveShib29sZWFuIGZ1bGwpIHsKKyAgICAgICAgICAgIGlmIChmdWxsICYmIG1DYW52YXMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1DYW52YXMgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoIWlzRW5hYmxlZCgpIHx8IG1EZXN0cm95ZWQpIHJldHVybjsKKworICAgICAgICAgICAgbURlc3Ryb3llZCA9IHRydWU7CisKKyAgICAgICAgICAgIHNFZ2wuZWdsTWFrZUN1cnJlbnQoc0VnbERpc3BsYXksIEVHTDEwLkVHTF9OT19TVVJGQUNFLAorICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfTk9fU1VSRkFDRSwgRUdMMTAuRUdMX05PX0NPTlRFWFQpOworICAgICAgICAgICAgc0VnbC5lZ2xEZXN0cm95U3VyZmFjZShzRWdsRGlzcGxheSwgbUVnbFN1cmZhY2UpOworCisgICAgICAgICAgICBtRWdsU3VyZmFjZSA9IG51bGw7CisgICAgICAgICAgICBtR2wgPSBudWxsOworCisgICAgICAgICAgICBzZXRFbmFibGVkKGZhbHNlKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICB2b2lkIHNldHVwKGludCB3aWR0aCwgaW50IGhlaWdodCkgeworICAgICAgICAgICAgbUNhbnZhcy5zZXRWaWV3cG9ydCh3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgYm9vbGVhbiBjYW5EcmF3KCkgeworICAgICAgICAgICAgcmV0dXJuIG1HbCAhPSBudWxsICYmIG1DYW52YXMgIT0gbnVsbDsKKyAgICAgICAgfSAgICAgICAgCisgICAgICAgIAorICAgICAgICB2b2lkIG9uUHJlRHJhdygpIHsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgb25Qb3N0RHJhdygpIHsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIERlZmluZXMgdGhlIEVHTCBjb25maWd1cmF0aW9uIGZvciB0aGlzIHJlbmRlcmVyLgorICAgICAgICAgKiAKKyAgICAgICAgICogQHJldHVybiBBbiB7QGxpbmsgYW5kcm9pZC52aWV3LkhhcmR3YXJlUmVuZGVyZXIuR2xSZW5kZXJlci5FZ2xDb25maWdDaG9vc2VyfS4KKyAgICAgICAgICovCisgICAgICAgIEVnbENvbmZpZ0Nob29zZXIgZ2V0Q29uZmlnQ2hvb3NlcihpbnQgZ2xWZXJzaW9uKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IENvbXBvbmVudFNpemVDaG9vc2VyKGdsVmVyc2lvbiwgOCwgOCwgOCwgOCwgMCwgMCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgdm9pZCBkcmF3KFZpZXcgdmlldywgVmlldy5BdHRhY2hJbmZvIGF0dGFjaEluZm8sIGludCB5T2Zmc2V0KSB7CisgICAgICAgICAgICBpZiAoY2FuRHJhdygpKSB7CisgICAgICAgICAgICAgICAgYXR0YWNoSW5mby5tRHJhd2luZ1RpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICBhdHRhY2hJbmZvLm1JZ25vcmVEaXJ0eVN0YXRlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB2aWV3Lm1Qcml2YXRlRmxhZ3MgfD0gVmlldy5EUkFXTjsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBsb25nIHN0YXJ0VGltZTsKKyAgICAgICAgICAgICAgICBpZiAoVmlld0RlYnVnLkRFQlVHX1BST0ZJTEVfRFJBV0lORykgeworICAgICAgICAgICAgICAgICAgICBzdGFydFRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjaGVja0N1cnJlbnQoKTsKKworICAgICAgICAgICAgICAgIG9uUHJlRHJhdygpOworCisgICAgICAgICAgICAgICAgQ2FudmFzIGNhbnZhcyA9IG1DYW52YXM7CisgICAgICAgICAgICAgICAgaW50IHNhdmVDb3VudCA9IGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLCAteU9mZnNldCk7CisKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICB2aWV3LmRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQoc2F2ZUNvdW50KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBvblBvc3REcmF3KCk7CisKKyAgICAgICAgICAgICAgICBpZiAoVmlld0RlYnVnLkRFQlVHX1BST0ZJTEVfRFJBV0lORykgeworICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KDYwMDAwLCBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKSAtIHN0YXJ0VGltZSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgYXR0YWNoSW5mby5tSWdub3JlRGlydHlTdGF0ZSA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgc0VnbC5lZ2xTd2FwQnVmZmVycyhzRWdsRGlzcGxheSwgbUVnbFN1cmZhY2UpOworICAgICAgICAgICAgICAgIGNoZWNrRWdsRXJyb3JzKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgY2hlY2tDdXJyZW50KCkgeworICAgICAgICAgICAgLy8gVE9ETzogRG9uJ3QgY2hlY2sgdGhlIGN1cnJlbnQgY29udGV4dCB3aGVuIHdlIGhhdmUgb25lIHBlciBVSSB0aHJlYWQKKyAgICAgICAgICAgIC8vIFRPRE86IFVzZSBhIHRocmVhZGxvY2FsIGZsYWcgdG8ga25vdyB3aGV0aGVyIHRoZSBzdXJmYWNlIGhhcyBjaGFuZ2VkCisgICAgICAgICAgICBpZiAoc0VnbC5lZ2xHZXRDdXJyZW50Q29udGV4dCgpICE9IHNFZ2xDb250ZXh0IHx8CisgICAgICAgICAgICAgICAgICAgIHNFZ2wuZWdsR2V0Q3VycmVudFN1cmZhY2UoRUdMMTAuRUdMX0RSQVcpICE9IG1FZ2xTdXJmYWNlKSB7CisgICAgICAgICAgICAgICAgaWYgKCFzRWdsLmVnbE1ha2VDdXJyZW50KHNFZ2xEaXNwbGF5LCBtRWdsU3VyZmFjZSwgbUVnbFN1cmZhY2UsIHNFZ2xDb250ZXh0KSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiZWdsTWFrZUN1cnJlbnQgZmFpbGVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGdldEVHTEVycm9yU3RyaW5nKHNFZ2wuZWdsR2V0RXJyb3IoKSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHN0YXRpYyBhYnN0cmFjdCBjbGFzcyBFZ2xDb25maWdDaG9vc2VyIHsKKyAgICAgICAgICAgIGZpbmFsIGludFtdIG1Db25maWdTcGVjOworICAgICAgICAgICAgcHJpdmF0ZSBmaW5hbCBpbnQgbUdsVmVyc2lvbjsKKworICAgICAgICAgICAgRWdsQ29uZmlnQ2hvb3NlcihpbnQgZ2xWZXJzaW9uLCBpbnRbXSBjb25maWdTcGVjKSB7CisgICAgICAgICAgICAgICAgbUdsVmVyc2lvbiA9IGdsVmVyc2lvbjsKKyAgICAgICAgICAgICAgICBtQ29uZmlnU3BlYyA9IGZpbHRlckNvbmZpZ1NwZWMoY29uZmlnU3BlYyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIEVHTENvbmZpZyBjaG9vc2VDb25maWcoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGRpc3BsYXkpIHsKKyAgICAgICAgICAgICAgICBpbnRbXSBpbmRleCA9IG5ldyBpbnRbMV07CisgICAgICAgICAgICAgICAgaWYgKCFlZ2wuZWdsQ2hvb3NlQ29uZmlnKGRpc3BsYXksIG1Db25maWdTcGVjLCBudWxsLCAwLCBpbmRleCkpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiZWdsQ2hvb3NlQ29uZmlnIGZhaWxlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBnZXRFR0xFcnJvclN0cmluZyhlZ2wuZWdsR2V0RXJyb3IoKSkpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGludCBudW1Db25maWdzID0gaW5kZXhbMF07CisgICAgICAgICAgICAgICAgaWYgKG51bUNvbmZpZ3MgPD0gMCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJObyBjb25maWdzIG1hdGNoIGNvbmZpZ1NwZWMiKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBFR0xDb25maWdbXSBjb25maWdzID0gbmV3IEVHTENvbmZpZ1tudW1Db25maWdzXTsKKyAgICAgICAgICAgICAgICBpZiAoIWVnbC5lZ2xDaG9vc2VDb25maWcoZGlzcGxheSwgbUNvbmZpZ1NwZWMsIGNvbmZpZ3MsIG51bUNvbmZpZ3MsIGluZGV4KSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJlZ2xDaG9vc2VDb25maWcgZmFpbGVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGdldEVHTEVycm9yU3RyaW5nKGVnbC5lZ2xHZXRFcnJvcigpKSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgRUdMQ29uZmlnIGNvbmZpZyA9IGNob29zZUNvbmZpZyhlZ2wsIGRpc3BsYXksIGNvbmZpZ3MpOworICAgICAgICAgICAgICAgIGlmIChjb25maWcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJObyBjb25maWcgY2hvc2VuIik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYWJzdHJhY3QgRUdMQ29uZmlnIGNob29zZUNvbmZpZyhFR0wxMCBlZ2wsIEVHTERpc3BsYXkgZGlzcGxheSwgRUdMQ29uZmlnW10gY29uZmlncyk7CisKKyAgICAgICAgICAgIHByaXZhdGUgaW50W10gZmlsdGVyQ29uZmlnU3BlYyhpbnRbXSBjb25maWdTcGVjKSB7CisgICAgICAgICAgICAgICAgaWYgKG1HbFZlcnNpb24gIT0gMikgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnU3BlYzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyogV2Uga25vdyBub25lIG9mIHRoZSBzdWJjbGFzc2VzIGRlZmluZSBFR0xfUkVOREVSQUJMRV9UWVBFLgorICAgICAgICAgICAgICAgICAqIEFuZCB3ZSBrbm93IHRoZSBjb25maWdTcGVjIGlzIHdlbGwgZm9ybWVkLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGludCBsZW4gPSBjb25maWdTcGVjLmxlbmd0aDsKKyAgICAgICAgICAgICAgICBpbnRbXSBuZXdDb25maWdTcGVjID0gbmV3IGludFtsZW4gKyAyXTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGNvbmZpZ1NwZWMsIDAsIG5ld0NvbmZpZ1NwZWMsIDAsIGxlbiAtIDEpOworICAgICAgICAgICAgICAgIG5ld0NvbmZpZ1NwZWNbbGVuIC0gMV0gPSBFR0wxMC5FR0xfUkVOREVSQUJMRV9UWVBFOworICAgICAgICAgICAgICAgIG5ld0NvbmZpZ1NwZWNbbGVuXSA9IDQ7IC8qIEVHTF9PUEVOR0xfRVMyX0JJVCAqLworICAgICAgICAgICAgICAgIG5ld0NvbmZpZ1NwZWNbbGVuICsgMV0gPSBFR0wxMC5FR0xfTk9ORTsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3Q29uZmlnU3BlYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBDaG9vc2UgYSBjb25maWd1cmF0aW9uIHdpdGggZXhhY3RseSB0aGUgc3BlY2lmaWVkIHIsZyxiLGEgc2l6ZXMsCisgICAgICAgICAqIGFuZCBhdCBsZWFzdCB0aGUgc3BlY2lmaWVkIGRlcHRoIGFuZCBzdGVuY2lsIHNpemVzLgorICAgICAgICAgKi8KKyAgICAgICAgc3RhdGljIGNsYXNzIENvbXBvbmVudFNpemVDaG9vc2VyIGV4dGVuZHMgRWdsQ29uZmlnQ2hvb3NlciB7CisgICAgICAgICAgICBwcml2YXRlIGludFtdIG1WYWx1ZTsKKworICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbVJlZFNpemU7CisgICAgICAgICAgICBwcml2YXRlIGludCBtR3JlZW5TaXplOworICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbUJsdWVTaXplOworICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbUFscGhhU2l6ZTsKKyAgICAgICAgICAgIHByaXZhdGUgaW50IG1EZXB0aFNpemU7CisgICAgICAgICAgICBwcml2YXRlIGludCBtU3RlbmNpbFNpemU7CisKKyAgICAgICAgICAgIENvbXBvbmVudFNpemVDaG9vc2VyKGludCBnbFZlcnNpb24sIGludCByZWRTaXplLCBpbnQgZ3JlZW5TaXplLCBpbnQgYmx1ZVNpemUsCisgICAgICAgICAgICAgICAgICAgIGludCBhbHBoYVNpemUsIGludCBkZXB0aFNpemUsIGludCBzdGVuY2lsU2l6ZSkgeworICAgICAgICAgICAgICAgIHN1cGVyKGdsVmVyc2lvbiwgbmV3IGludFtdIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9SRURfU0laRSwgcmVkU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9HUkVFTl9TSVpFLCBncmVlblNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfQkxVRV9TSVpFLCBibHVlU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9BTFBIQV9TSVpFLCBhbHBoYVNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfREVQVEhfU0laRSwgZGVwdGhTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX1NURU5DSUxfU0laRSwgc3RlbmNpbFNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfTk9ORSB9KTsKKyAgICAgICAgICAgICAgICBtVmFsdWUgPSBuZXcgaW50WzFdOworICAgICAgICAgICAgICAgIG1SZWRTaXplID0gcmVkU2l6ZTsKKyAgICAgICAgICAgICAgICBtR3JlZW5TaXplID0gZ3JlZW5TaXplOworICAgICAgICAgICAgICAgIG1CbHVlU2l6ZSA9IGJsdWVTaXplOworICAgICAgICAgICAgICAgIG1BbHBoYVNpemUgPSBhbHBoYVNpemU7CisgICAgICAgICAgICAgICAgbURlcHRoU2l6ZSA9IGRlcHRoU2l6ZTsKKyAgICAgICAgICAgICAgICBtU3RlbmNpbFNpemUgPSBzdGVuY2lsU2l6ZTsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIEVHTENvbmZpZyBjaG9vc2VDb25maWcoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGRpc3BsYXksIEVHTENvbmZpZ1tdIGNvbmZpZ3MpIHsKKyAgICAgICAgICAgICAgICBmb3IgKEVHTENvbmZpZyBjb25maWcgOiBjb25maWdzKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBkID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywgRUdMMTAuRUdMX0RFUFRIX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICBpbnQgcyA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsIEVHTDEwLkVHTF9TVEVOQ0lMX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICBpZiAoZCA+PSBtRGVwdGhTaXplICYmIHMgPj0gbVN0ZW5jaWxTaXplKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgciA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsIEVHTDEwLkVHTF9SRURfU0laRSwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZyA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsIEVHTDEwLkVHTF9HUkVFTl9TSVpFLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBiID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywgRUdMMTAuRUdMX0JMVUVfU0laRSwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgYSA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsIEVHTDEwLkVHTF9BTFBIQV9TSVpFLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyID49IG1SZWRTaXplICYmIGcgPj0gbUdyZWVuU2l6ZSAmJiBiID49IG1CbHVlU2l6ZSAmJiBhID49IG1BbHBoYVNpemUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwcml2YXRlIGludCBmaW5kQ29uZmlnQXR0cmliKEVHTDEwIGVnbCwgRUdMRGlzcGxheSBkaXNwbGF5LCBFR0xDb25maWcgY29uZmlnLAorICAgICAgICAgICAgICAgICAgICBpbnQgYXR0cmlidXRlLCBpbnQgZGVmYXVsdFZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKGVnbC5lZ2xHZXRDb25maWdBdHRyaWIoZGlzcGxheSwgY29uZmlnLCBhdHRyaWJ1dGUsIG1WYWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1WYWx1ZVswXTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICByZXR1cm4gZGVmYXVsdFZhbHVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogSGFyZHdhcmUgcmVuZGVyZXIgdXNpbmcgT3BlbkdMIEVTIDIuMC4KKyAgICAgKi8KKyAgICBzdGF0aWMgY2xhc3MgR2wyMFJlbmRlcmVyIGV4dGVuZHMgR2xSZW5kZXJlciB7CisgICAgICAgIHByaXZhdGUgR0xFUzIwQ2FudmFzIG1HbENhbnZhczsKKworICAgICAgICBHbDIwUmVuZGVyZXIoYm9vbGVhbiB0cmFuc2x1Y2VudCkgeworICAgICAgICAgICAgc3VwZXIoMiwgdHJhbnNsdWNlbnQpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIEdMRVMyMENhbnZhcyBjcmVhdGVDYW52YXMoKSB7CisgICAgICAgICAgICByZXR1cm4gbUdsQ2FudmFzID0gbmV3IEdMRVMyMENhbnZhcyhtVHJhbnNsdWNlbnQpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHZvaWQgb25QcmVEcmF3KCkgeworICAgICAgICAgICAgbUdsQ2FudmFzLm9uUHJlRHJhdygpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHZvaWQgb25Qb3N0RHJhdygpIHsKKyAgICAgICAgICAgIG1HbENhbnZhcy5vblBvc3REcmF3KCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgRGlzcGxheUxpc3QgY3JlYXRlRGlzcGxheUxpc3QoKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IEdMRVMyMERpc3BsYXlMaXN0KCk7CisgICAgICAgIH0KKworICAgICAgICBzdGF0aWMgSGFyZHdhcmVSZW5kZXJlciBjcmVhdGUoYm9vbGVhbiB0cmFuc2x1Y2VudCkgeworICAgICAgICAgICAgaWYgKEdMRVMyMENhbnZhcy5pc0F2YWlsYWJsZSgpKSB7CisgICAgICAgICAgICAgICAgcmV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ICAgICAgID0gMjQ7Ci0gICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBWb2x1bWUgRG93biBrZXkuICovCisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBWb2x1bWUgRG93biBrZXkuCisgICAgICogQWRqdXN0cyB0aGUgc3BlYWtlciB2b2x1bWUgZG93bi4gKi8KICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX1ZPTFVNRV9ET1dOICAgICA9IDI1OwogICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogUG93ZXIga2V5LiAqLwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfUE9XRVIgICAgICAgICAgID0gMjY7CkBAIC0yMDksNyArMjE4LDcgQEAKICAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IEVudGVyIGtleS4gKi8KICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX0VOVEVSICAgICAgICAgICA9IDY2OwogICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogQmFja3NwYWNlIGtleS4KLSAgICAgKiBEZWxldGVzIGNoYXJhY3RlcnMgYmVmb3JlIHRoZSBpbnNlcnRpb24gcG9pbnQuICovCisgICAgICogRGVsZXRlcyBjaGFyYWN0ZXJzIGJlZm9yZSB0aGUgaW5zZXJ0aW9uIHBvaW50LCB1bmxpa2Uge0BsaW5rICNLRVlDT0RFX0ZPUldBUkRfREVMfS4gKi8KICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX0RFTCAgICAgICAgICAgICA9IDY3OwogICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogJ2AnIChiYWNrdGljaykga2V5LiAqLwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfR1JBVkUgICAgICAgICAgID0gNjg7CkBAIC0yNjIsNyArMjcxLDggQEAKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0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G9pbnQsIHVubGlrZSB7QGxpbmsgI0tFWUNPREVfREVMfS4gKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX0ZPUldBUkRfREVMICAgICA9IDExMjsKKyAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IExlZnQgQ29udHJvbCBtb2RpZmllciBrZXkuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9DVFJMX0xFRlQgICAgICAgPSAxMTM7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBSaWdodCBDb250cm9sIG1vZGlmaWVyIGtleS4gKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX0NUUkxfUklHSFQgICAgICA9IDExNDsKKyAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IENhcHMgTG9jayBtb2RpZmllciBrZXkuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9DQVBTX0xPQ0sgICAgICAgPSAxMTU7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBTY3JvbGwgTG9jayBrZXkuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9TQ1JPTExfTE9DSyAgICAgPSAxMTY7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBMZWZ0IE1ldGEgbW9kaWZpZXIga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfTUVUQV9MRUZUICAgICAgID0gMTE3OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogUmlnaHQgTWV0YSBtb2RpZmllciBrZXkuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9NRVRBX1JJR0hUICAgICAgPSAxMTg7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBGdW5jdGlvbiBtb2RpZmllciBrZXkuICovCisgICA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F0aWMgZmluYWwgaW50IEtFWUNPREVfTUVESUFfUkVDT1JEICAgID0gMTMwOworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjEga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjEgICAgICAgICAgICAgID0gMTMxOworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjIga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjIgICAgICAgICAgICAgID0gMTMyOworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjMga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjMgICAgICAgICAgICAgID0gMTMzOworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjQga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjQgICAgICAgICAgICAgID0gMTM0OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjUga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjUgICAgICAgICAgICAgID0gMTM1OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjYga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjYgICAgICAgICAgICAgID0gMTM2OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjcga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjcgICAgICAgICAgICAgID0gMTM3OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjgga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjggICAgICAgICAgICAgID0gMTM4OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjkga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjkgICAgICAgICAgICAgID0gMTM5OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogRjEwIGtleS4gKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX0YxMCAgICAgICAgICAgICA9IDE0MDsKKyAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IEYxMSBrZXkuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9GMTEgICAgICAgICAgICAgPSAxNDE7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBGMTIga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfRjEyICAgICAgICAgICAgID0gMTQyOworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogTnVtIExvY2sgbW9kaWZpZXIga2V5LgorICAgICAqIFRoaXMgaXMgdGhlIE51bSBMb2NrIGtleTsgaXQgaXMgZGlmZmVyZW50IGZyb20ge0BsaW5rICNLRVlDT0RFX05VTX0uCisgICAgICogVGhpcyBrZXkgZ2VuZXJhbGx5IG1vZGlmaWVzIHRoZSBiZWhhdmlvciBvZiBvdGhlciBrZXlzIG9uIHRoZSBudW1lcmljIGtleXBhZC4gKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX05VTV9MT0NLICAgICAgICA9IDE0MzsKKyAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IE51bWVyaWMga2V5cGFkICcwJyBrZXkuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9OVU1QQURfMCAgICAgICAgPSAxNDQ7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBOdW1lcmljIGtleXBhZCAnMScga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfTlVNUEFEXzEgICAgICAgID0gMTQ1OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogTnVtZXJpYyBrZXlwYWQgJzInIGtleS4gKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX05VTVBBRF8yICAgICAgICA9IDE0NjsKKyAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IE51bWVyaWMga2V5cGFkICczJyBrZXkuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9OVU1QQURfMyAgICAgICAgPSAxNDc7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBOdW1lcmljIGtleXBhZCAnNCcga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfTlVNUEFEXzQgICAgICAgID0gMTQ4OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogTnVtZXJpYyBrZXlwYWQgJzUnIGtleS4gKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX05VTVBBRF81ICAgICAgICA9IDE0OTsKKyAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IE51bWVyaWMga2V5cGFkICc2JyBrZXkuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9OVU1QQURfNiAgICAgICAgPSAxNTA7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBOdW1lcmljIGtleXBhZCAnNycga2V5LiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfTlVNUEFEXzcgICAgICAgID0gMTUxOworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogTnVtZXJpYyBrZXlwYWQgJzgnIGtleS4gKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX05VTVBBRF84ICAgICAgICA9IDE1MjsKKyAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IE51bWVyaWMga2V5cGFkICc5JyBrZXkuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9OVU1QQURfOSAgICAgICAgPSAxNTM7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBOdW1lcmljIGtleXBhZCAnLycga2V5IChmb3IgZGl2aXNpb24pLiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfTlVNUEFEX0RJVklERSAgID0gMTU0OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogTnVtZXJpYyBrZXlwYWQgJyonIGtleSAoZm9yIG11bHRpcGxpY2F0aW9uKS4gKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX05VTVBBRF9NVUxUSVBMWSA9IDE1NTsKKyAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IE51bWVyaWMga2V5cGFkICctJyBrZXkgKGZvciBzdWJ0cmFjdGlvbikuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgS0VZQ09ERV9OVU1QQURfU1VCVFJBQ1QgPSAxNTY7CisgICAgLyoqIEtleSBjb2RlIGNvbnN0YW50OiBOdW1lcmljIGtleXBhZCAnKycga2V5IChmb3IgYWRkaXRpb24pLiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEtFWUNPREVfTlVNUEFEX0FERCAgICAgID0gMTU3OworICAgIC8qKiBLZXkgY29kZSBjb25zdGFudDogTnVtZXJpYyBrZXlwYWQgJy4nIGtleSAoZm9yIGRlY2ltYWxzIG9yIGRpZ2l0IGdyb3VwaW5nKS4gKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBLRVlDT0RFX05VTVBBRF9ET1QgICAgICA9IDE1ODsKKyAgICAvKiogS2V5IGNvZGUgY29uc3RhbnQ6IE51bWVyaWMga2V5cGFkICcsJyBrZXkgKGZvciBkZWNpbWFscyBvciBkaWdpdCBncm91cGluZykuICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hb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ib2xpYyBuYW1lcyBvZiBhbGwga2V5cyBpbmRleGVkIGJ5IGtleWNvZGUuCisgICAgLy8gVGhlcmUgc2hvdWxkIGJlIGV4YWN0bHkgTEFTVF9LRVlDT0RFICsgMSBlbnRyaWVzIGluIHRoaXMgdGFibGUuCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nW10gS0VZQ09ERV9TWU1CT0xJQ19OQU1FUyA9IG5ldyBTdHJpbmdbXSB7CisgICAgICAgICJLRVlDT0RFX1VOS05PV04iLAorICAgICAgICAiS0VZQ09ERV9TT0ZUX0xFRlQiLAorICAgICAgICAiS0VZQ09ERV9TT0ZUX1JJR0hUIiwKKyAgICAgICAgIktFWUNPREVfSE9NRSIsCisgICAgICAgICJLRVlDT0RFX0JBQ0siLAorICAgICAgICAiS0VZQ09ERV9DQUxMIiwKKyAgICAgICAgIktFWUNPREVfRU5EQ0FMTCIsCisgICAgICAgICJLRVlDT0RFXzAiLAorICAgICAgICAiS0VZQ09ERV8xIiwKKyAgICAgICAgIktFWUNPREVfMiIsCisgICAgICAgICJLRVlDT0RFXzMiLAorICAgICAgICAiS0VZQ09ERV80IiwKKyAgICAgICAgIktFWUNPREVfNSIsCisgICAgICAgICJLRVlDT0RFXzYiLAorICAgICAgICAiS0VZQ09ERV83IiwKKyAgICAgICAgIktFWUNPREVfOCIsCisgICAgICAgICJLRVlDT0RFXzkiLAorICAgICAgICAiS0VZQ09ERV9TVEFSIiwKKyAgICAgICAgIktFWUNPREVfUE9VTkQiLAorICAgICAgICAiS0VZQ09ERV9EUEFEX1VQIiwKKyAgICAgICAgIktFWUNPREVfRFBBRF9ET1dOIiwKKyAgICAgICAgIktFWUNPREVfRFBBRF9MRUZUIiwKKyAgICAgICAgIktFWUNPREVfRFBBRF9SSUdIVCIsCisgICAgICAgICJLRVlDT0RFX0RQQURfQ0VOVEVSIiwKKyAgICAgICAgIktFWUNPREVfVk9MVU1FX1VQIiwKKyAgICAgICAgIktFWUNPREVfVk9MVU1FX0RPV04iLAorICAgICAgICAiS0VZQ09ERV9QT1dFUiIsCisgICAgICAgICJLRVlDT0RFX0NBTUVSQSIsCisgICAgICAgICJLRVlDT0RFX0NMRUFSIiwKKyAgICAgICAgIktFWUNPREVfQSIsCisgICAgICAgICJLRVlDT0RFX0IiLAorICAgICAgICAiS0VZQ09ERV9DIiwKKyAgICAgICAgIktFWUNPREVfRCIsCisgICAgICAgICJLRVlDT0RFX0UiLAorICAgICAgICAiS0VZQ09ERV9GIiwKKyAgICAgICAgIktFWUNPREVfRyIsCisgICAgICAgICJLRVlDT0RFX0giLAorICAgICAgICAiS0VZQ09ERV9JIiwKKyAgICAgICAgIktFWUNPREVfSiIsCisgICAgICAgICJLRVlDT0RFX0siLAorICAgICAgICAiS0VZQ09ERV9MIiwKKyAgICAgICAgIktFWUNPREVfTSIsCisgICAgICAgICJLRVlDT0RFX04iLAorICAgICAgICAiS0VZQ09ERV9PIiwKKyAgICAgICAgIktFWUNPREVfUCIsCisgICAgICAgICJLRVlDT0RFX1EiLAorICAgICAgICAiS0VZQ09ERV9SIiwKKyAgICAgICAgIktFWUNPREVfUyIsCisgICAgICAgICJLRVlDT0RFX1QiLAorICAgICAgICAiS0VZQ09ERV9VIiwKKyAgICAgICAgIktFWUNPREVfViIsCisgICAgICAgICJLRVlDT0RFX1ciLAorICAgICAgICAiS0VZQ09ERV9YIiwKKyAgICAgICAgIktFWUNPREVfWSIsCisgICAgICAgICJLRVlDT0RFX1oiLAorICAgICAgICAiS0VZQ09ERV9DT01NQSIsCisgICAgICAgICJLRVlDT0RFX1BFUklPRCIsCisgICAgICAgICJLRVlDT0RFX0FMVF9MRUZUIiwKKyAgICAgICAgIktFWUNPREVfQUxUX1JJR0hUIiwKKyAgICAgICAgIktFWUNPREVfU0hJRlRfTEVGVCIsCisgICAgICAgICJLRVlDT0RFX1NISUZUX1JJR0hUIiwKKyAgICAgICAgIktFWUNPREVfVEFCIiwKKyAgICAgICAgIktFWUNPREVfU1BBQ0UiLAorICAgICAgICAiS0VZQ09ERV9TWU0iLAorICAgICAgICAiS0VZQ09ERV9FWFBMT1JFUiIsCisgICAgICAgICJLRVlDT0RFX0VOVkVMT1BFIiwKKyAgICAgICAgIktFWUNPREVfRU5URVIiLAorICAgICAgICAiS0VZQ09ERV9ERUwiLAorICAgICAgICAiS0VZQ09ERV9HUkFWRSIsCisgICAgICAgICJLRVlDT0RFX01JTlVTIiwKKyAgICAgICAgIktFWUNPREVfRVFVQUxTIiwKKyAgICAgICAgIktFWUNPREVfTEVGVF9CUkFDS0VUIiwKKyAgICAgICAgIktFWUNPREVfUklHSFRfQlJBQ0tFVCIsCisgICAgICAgICJLRVlDT0RFX0JBQ0tTTEFTSCIsCisgICAgICAgICJLRVlDT0RFX1NFTUlDT0xPTiIsCisgICAgICAgICJLRVlDT0RFX0FQT1NUUk9QSEUiLAorICAgICAgICAiS0VZQ09ERV9TTEFTSCIsCisgICAgICAgICJLRVlDT0RFX0FUIiwKKyAgICAgICAgIktFWUNPREVfTlVNIiwKKyAgICAgICAgIktFWUNPREVfSEVBRFNFVEhPT0siLAorICAgICAgICAiS0VZQ09ERV9GT0NVUyIsCisgICAgICAgICJLRVlDT0RFX1BMVVMiLAorICAgICAgICAiS0VZQ09ERV9NRU5VIiwKKyAgICAgICAgIktFWUNPREVfTk9USUZJQ0FUSU9OIiwKKyAgICAgICAgIktFWUNPREVfU0VBUkNIIiwKKyAgICAgICAgIktFWUNPREVfTUVESUFfUExBWV9QQVVTRSIsCisgICAgICAgICJLRVlDT0RFX01FRElBX1NUT1AiLAorICAgICAgICAiS0VZQ09ERV9NRURJQV9ORVhUIiwKKyAgICAgICAgIktFWUNPREVfTUVESUFfUFJFVklPVVMiLAorICAgICAgICAiS0VZQ09ERV9NRURJQV9SRVdJTkQiLAorICAgICAgICAiS0VZQ09ERV9NRURJQV9GQVNUX0ZPUldBUkQiLAorICAgICAgICAiS0VZQ09ERV9NVVRFIiwKKyAgICAgICAgIktFWUNPREVfUEFHRV9VUCIsCisgICAgICAgICJLRVlDT0RFX1BBR0VfRE9XTiIsCisgICAgICAgICJLRVlDT0RFX1BJQ1RTWU1CT0xTIiwKKyAgICAgICAgIktFWUNPREVfU1dJVENIX0NIQVJTRVQiLAorICAgICAgICAiS0VZQ09ERV9CVVRUT05fQSIsCisgICAgICAgICJLRVlDT0RFX0JVVFRPTl9CIiwKKyAgICAgICAgIktFWUNPREVfQlVUVE9OX0MiLAorICAgICAgICAiS0VZQ09ERV9CVVRUT05fWCIsCisgICAgICAgICJLRVlDT0RFX0JVVFRPTl9ZIiwKKyAgICAgICAgIktFWUNPREVfQlVUVE9OX1oiLAorICAgICAgICAiS0VZQ09ERV9CVVRUT05fTDEiLAorICAgICAgICAiS0VZQ09ERV9CVVRUT05fUjEiLAorICAgICAgICAiS0VZQ09ERV9CVVRUT05fTDIiLAorICAgICAgICAiS0VZQ09ERV9CVVRUT05fUjIiLAorICAgICAgICAiS0VZQ09ERV9CVVRUT05fVEhVTUJMIiwKKyAgICAgICAgIktFWUNPREVfQlVUVE9OX1RIVU1CUiIsCisgICAgICAgICJLRVlDT0RFX0JVVFRPTl9TVEFSVCIsCisgICAgICAgICJLRVlDT0RFX0JVVFRPTl9TRUxFQ1QiLAorICAgICAgICAiS0VZQ09ERV9CVVRUT05fTU9ERSIsCisgICAgICAgICJLRVlDT0RFX0VTQ0FQRSIsCisgICAgICAgICJLRVlDT0RFX0ZPUldBUkRfREVMIiwKKyAgICAgICAgIktFWUNPREVfQ1RSTF9MRUZUIiwKKyAgICAgICAgIktFWUNPREVfQ1RSTF9SSUdIVCIsCisgICAgICAgICJLRVlDT0RFX0NBUFNfTE9DSyIsCisgICAgICAgICJLRVlDT0RFX1NDUk9MTF9MT0NLIiwKKyAgICAgICAgIktFWUNPREVfTUVUQV9MRUZUIiwKKyAgICAgICAgIktFWUNPREVfTUVUQV9SSUdIVCIsCisgICAgICAgICJLRVlDT0RFX0ZVTkNUSU9OIiwKKyAgICAgICAgIktFWUNPREVfU1lTUlEiLAorICAgICAgICAiS0VZQ09ERV9CUkVBSyIsCisgICAgICAgICJLRVlDT0RFX01PVkVfSE9NRSIsCisgICAgICAgICJLRVlDT0RFX01PVkVfRU5EIiwKKyAgICAgICAgIktFWUNPREVfSU5TRVJUIiwKKyAgICAgICAgIktFWUNPREVfRk9SV0FSRCIsCisgICAgICAgICJLRVlDT0RFX01FRElBX1BMQVkiLAorICAgICAgICAiS0VZQ09ERV9NRURJQV9QQVVTRSIsCisgICAgICAgICJLRVlDT0RFX01FRElBX0NMT1NFIiwKKyAgICAgICAgIktFWUNPREVfTUVESUFfRUpFQ1QiLAorICAgICAgICAiS0VZQ09ERV9NRURJQV9SRUNPUkQiLAorICAgICAgICAiS0VZQ09ERV9GMSIsCisgICAgICAgICJLRVlDT0RFX0YyIiwKKyAgICAgICAgIktFWUNPREVfRjMiLAorICAgICAgICAiS0VZQ09ERV9GNCIsCisgICAgICAgICJLRVlDT0RFX0Y1IiwKKyAgICAgICAgIktFWUNPREVfRjYiLAorICAgICAgICAiS0VZQ09ERV9GNyIsCisgICAgICAgICJLRVlDT0RFX0Y4IiwKKyAgICAgICAgIktFWUNPREVfRjkiLAorICAgICAgICAiS0VZQ09ERV9GMTAiLAorICAgICAgICAiS0VZQ09ERV9GMTEiLAorICAgICAgICAiS0VZQ09ERV9GMTIiLAorICAgICAgICAiS0VZQ09ERV9OVU1fTE9DSyIsCisgICAgICAgICJLRVlDT0RFX05VTVBBRF8wIiwKKyAgICAgICAgIktFWUNPREVfTlVNUEFEXzEiLAorICAgICAgICAiS0VZQ09ERV9OVU1QQURfMiIsCisgICAgICAgICJLRVlDT0RFX05VTVBBRF8zIiwKKyAgICAgICAgIktFWUNPREVfTlVNUEFEXzQiLAorICAgICAgICAiS0VZQ09ERV9OVU1QQURfNSIsCisgICAgICAgICJLRVlDT0RFX05VTVBBRF82IiwKKyAgICAgICAgIktFWUNPREVfTlVNUEFEXzciLAorICAgICAgICAiS0VZQ09ERV9OVU1QQURfOCIsCisgICAgICAgICJLRVlDT0RFX05VTVBBRF85IiwKKyAgICAgICAgIktFWUNPREVfTlVNUEFEX0RJVklERSIsCisgICAgICAgICJLRVlDT0RFX05VTVBBRF9NVUxUSVBMWSIsCisgICAgICAgICJLRVlDT0RFX01VTVBBRF9TVUJUUkFDVCIsCisgICAgICAgICJLRVlDT0RFX05VTVBBRF9BREQiLAorICAgICAgICAiS0VZQ09ERV9OVU1QQURfRE9UIiwKKyAgICAgICAgIktFWUNPREVfTlVNUEFEX0NPTU1BIiwKKyAgICAgICAgIktFWUNPREVfTlVNUEFEX0VOVEVSIiwKKyAgICAgICAgIktFWUNPREVfTlVNUEFEX0VRVUFMUyIsCisgICAgICAgICJLRVlDT0RFX05VTVBBRF9MRUZUX1BBUkVOIiwKKyAgICAgICAgIktFWUNPREVfTlVNUEFEX1JJR0hUX1BBUkVOIiwKKyAgICAgICAgIktFWUNPREVfVk9MVU1FX01VVEUiLAorICAgIH07CisKKyAgICAvLyBTeW1ib2xpYyBuYW1lcyBvZiBhbGwgbWV0YWtleXMgaW4gYml0IG9yZGVyIGZyb20gbGVhc3Qgc2lnbmlmaWNhbnQgdG8gbW9zdCBzaWduaWZpY2FudC4KKyAgICAvLyBBY2NvcmRpbmdseSB0aGVyZSBhcmUgZXhhY3RseSAzMiB2YWx1ZXMgaW4gdGhpcyB0YWJsZS4KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmdbXSBNRVRBX1NZTUJPTElDX05BTUVTID0gbmV3IFN0cmluZ1tdIHsKKyAgICAgICAgIk1FVEFfU0hJRlRfT04iLAorICAgICAgICAiTUVUQV9BTFRfT04iLAorICAgICAgICAiTUVUQV9TWU1fT04iLAorICAgICAgICAiTUVUQV9GVU5DVElPTl9PTiIsCisgICAgICAgICJNRVRBX0FMVF9MRUZUX09OIiwKKyAgICAgICAgIk1FVEFfQUxUX1JJR0hUX09OIiwKKyAgICAgICAgIk1FVEFfU0hJRlRfTEVGVF9PTiIsCisgICAgICAgICJNRVRBX1NISUZUX1JJR0hUX09OIiwKKyAgICAgICAgIk1FVEFfQ0FQX0xPQ0tFRCIsCisgICAgICAgICJNRVRBX0FMVF9MT0NLRUQiLAorICAgICAgICAiTUVUQV9TWU1fTE9DS0VEIiwKKyAgICAgICAgIjB4MDAwMDA4MDAiLAorICAgICAgICAiTUVUQV9DVFJMX09OIiwKKyAgICAgICAgIk1FVEFfQ1RSTF9MRUZUX09OIiwKKyAgICAgICAgIk1FVEFfQ1RSTF9SSUdIVF9PTiIsCisgICAgICAgICIweDAwMDA4MDAwIiwKKyAgICAgICAgIk1FVEFfTUVUQV9PTiIsCisgICAgICAgICJNRVRBX01FVEFfTEVGVF9PTiIsCisgICAgICAgICJNRVRBX01FVEFfUklHSFRfT04iLAorICAgICAgICAiMHgwMDA4MDAwMCIsCisgICAgICAgICJNRVRBX0NBUFNfTE9DS19MQVRDSEVEIiwKKyAgICAgICAgIk1FVEFfTlVNX0xPQ0tfTEFUQ0hFRCIsCisgICAgICAgICJNRVRBX1NDUk9MTF9MT0NLX0xBVENIRUQiLAorICAgICAgICAiMHgwMDgwMDAwMCIsCisgICAgICAgICIweDAxMDAwMDAwIiwKKyAgICAgICAgIjB4MDIwMDAwMDAiLAorICAgICAgICAiMHgwNDAwMDAwMCIsCisgICAgICAgICIweDA4MDAwMDAwIiwKKyAgICAgICAgIjB4MTAwMDAwMDAiLAorICAgICAgICAiMHgyMDAwMDAwMCIsCisgICAgICAgICIweDQwMDAwMDAwIiwKKyAgICAgICAgIjB4ODAwMDAwMDAiLAorICAgIH07CisKICAgICAvKioKICAgICAgKiBAZGVwcmVjYXRlZCBUaGVyZSBhcmUgbm93IG1vcmUgdGhhbiBNQVhfS0VZQ09ERSBrZXljb2Rlcy4KICAgICAgKiBVc2Uge0BsaW5rICNnZXRNYXhLZXlDb2RlKCl9IGluc3RlYWQuCkBAIC0zNzcsNiArNzE1LDM1IEBACiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQU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gICAgICAgICAgICAgICAgICJNRVRBX1NZTUJPTElDX05BTUVTIGFycmF5IHNob3VsZCBjb250YWluIGV4YWN0bHkgMzIgZW50cmllcy4iKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoS0VZQ09ERV9TWU1CT0xJQ19OQU1FUy5sZW5ndGggIT0gTEFTVF9LRVlDT0RFICsgMSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgIktFWUNPREVfU1lNQk9MSUNfTkFNRVMgYXJyYXkgaXMgb3V0IG9mIHN5bmMgd2l0aCB0aGUga2V5Y29kZSBjb25zdGFudHMuIik7CisgICAgICAgIH0KKyAgICB9CisKICAgICAvKioKICAgICAgKiBDcmVhdGUgYSBuZXcga2V5IGV2ZW50LgogICAgICAqIApAQCAtOTM5LDkgKzE0MDgsMjkgQEAKICAgICAgKiBAc2VlICNpc0FsdFByZXNzZWQoKQogICAgICAqIEBzZWUgI2lzU2hpZnRQcmVzc2VkKCkKICAgICAgKiBAc2VlICNpc1N5bVByZXNzZWQoKQorICAgICAqIEBzZWUgI2lzQ3RybFByZXNzZWQoKQorICAgICAqIEBzZWUgI2lzTWV0YVByZXNzZWQoKQorICAgICAqIEBzZWUgI2lzRnVuY3Rpb25QcmVzc2VkKCkKKyAgICAgKiBAc2VlICNpc0NhcHNMb2NrTGF0Y2hlZCgpCisgICAgICogQHNlZSAjaXNOdW1Mb2NrTGF0Y2hlZCgpCisgICAgICogQHNlZSAjaXNTY3JvbGxMb2NrTGF0Y2hlZCgpCiAgICAgICogQHNlZSAjTUVUQV9BTFRfT04KKyAgICAgKiBAc2VlICNNRVRBX0FMVF9MRUZUX09OCisgICAgICogQHNlZSAjTUVUQV9BTFRfUklHSFRfT04KICAgICAgKiBAc2VlICNNRVRBX1NISUZUX09OCisgICAgICogQHNlZSAjTUVUQV9TSElGVF9MRUZUX09OCisgICAgICogQHNlZSAjTUVUQV9TSElGVF9SSUdIVF9PTgogICAgICAqIEBzZWUgI01FVEFfU1lNX09OCisgICAgICogQHNlZSAjTUVUQV9GVU5DVElPTl9PTgorICAgICAqIEBzZWUgI01FVEFfQ1RSTF9PTgorICAgICAqIEBzZWUgI01FVEFfQ1RSTF9MRUZUX09OCisgICAgICogQHNlZSAjTUVUQV9DVFJMX1JJR0hUX09OCisgICAgICogQHNlZSAjTUVUQV9NRVRBX09OCisgICAgICogQHNlZSAjTUVUQV9NRVRBX0xFRlRfT04KKyAgICAgKiBAc2VlICNNRVRBX01FVEFfUklHSFRfT04KKyAgICAgKiBAc2VlICNNRVRBX0NBUFNfTE9DS19MQVRDSEVECisgICAgICogQHNlZSAjTUVUQV9OVU1fTE9DS19MQVRDSEVECisgICAgICogQHNlZSAjTUVUQV9TQ1JPTExfTE9DS19MQVRDSEVECiAgICAgICovCiAgICAgcHVibGljIGZpbmFsIGludCBnZXRNZXRhU3RhdGUoKSB7CiAgICAgICAgIHJldHVybiBtTWV0YVN0YXRlOwpAQCAtOTYxLDEzICsxNDUwLDI4IEBACiAgICAgICoKICAgICAgKiBAcmV0dXJuIHdoZXRoZXIgdGhlIHByb3ZpZGVkIGtleUNvZGUgaXMgb25lIG9mCiAgICAgICoge0BsaW5rICNLRVlDT0RFX1NISUZUX0xFRlR9IHtAbGluayAjS0VZQ09ERV9TSElGVF9SSUdIVH0sCi0gICAgICoge0BsaW5rICNLRVlDT0RFX0FMVF9MRUZUfSwge0BsaW5rICNLRVlDT0RFX0FMVF9SSUdIVH0KLSAgICAgKiBvciB7QGxpbmsgI0tFWUNPREVfU1lNfS4KKyAgICAgKiB7QGxpbmsgI0tFWUNPREVfQUxUX0xFRlR9LCB7QGxpbmsgI0tFWUNPREVfQUxUX1JJR0hUfSwKKyAgICAgKiB7QGxpbmsgI0tFWUNPREVfU1lNfSwge0BsaW5rICNLRVlDT0RFX05VTX0sIHtAbGluayAjS0VZQ09ERV9GVU5DVElPTn0sCisgICAgICoge0BsaW5rICNLRVlDT0RFX0NUUkxfTEVGVH0sIHtAbGluayAjS0VZQ09ERV9DVFJMX1JJR0hUfSwKKyAgICAgKiB7QGxpbmsgI0tFWUNPREVfTUVUQV9MRUZUfSwgb3Ige0BsaW5rICNLRVlDT0RFX01FVEFfUklHSFR9LgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBpc01vZGlmaWVyS2V5KGludCBrZXlDb2RlKSB7Ci0gICAgICAgIHJldHVybiBrZXlDb2RlID09IEtFWUNPREVfU0hJRlRfTEVGVCB8fCBrZXlDb2RlID09IEtFWUNPREVfU0hJRlRfUklHSFQKLSAgICAgICAgICAgICAgICB8fCBrZXlDb2RlID09IEtFWUNPREVfQUxUX0xFRlQgfHwga2V5Q29kZSA9PSBLRVlDT0RFX0FMVF9SSUdIVAotICAgICAgICAgICAgICAgIHx8IGtleUNvZGUgPT0gS0VZQ09ERV9TWU07CisgICAgICAgIHN3aXRjaCAoa2V5Q29kZSkgeworICAgICAgICAgICAgY2FzZSBLRVlDT0RFX1NISUZUX0xFRlQ6CisgICAgICAgICAgICBjYXNlIEtFWUNPREVfU0hJRlRfUklHSFQ6CisgICAgICAgICAgICBjYXNlIEtFWUNPREVfQUxUX0xFRlQ6CisgICAgICAgICAgICBjYXNlIEtFWUNPREVfQUxUX1JJR0hUOgorICAgICAgICAgICAgY2FzZSBLRVlDT0RFX1NZTToKKyAgICAgICAgICAgIGNhc2UgS0VZQ09ERV9OVU06CisgICAgICAgICAgICBjYXNlIEtFWUNPREVfRlVOQ1RJT046CisgICAgICAgICAgICBjYXNlIEtFWUNPREVfQ1RSTF9MRUZUOgorICAgICAgICAgICAgY2FzZSBLRVlDT0RFX0NUUkxfUklHSFQ6CisgICAgICAgICAgICBjYXNlIEtFWUNPREVfTUVUQV9MRUZUOgorICAgICAgICAgICAgY2FzZSBLRVlDT0RFX01FVEFfUklHSFQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIC8qKgpAQCAtMTAwOSw2ICsxNTEzLDgwIEBACiAgICAgfQogCiAgICAgLyoqCisgICAgICogPHA+UmV0dXJucyB0aGUgcHJlc3NlZCBzdGF0ZSBvZiB0aGUgQ1RSTCBtZXRhIGtleS48L3A+CisgICAgICoKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIENUUkwga2V5IGlzIHByZXNzZWQsIGZhbHNlIG90aGVyd2lzZQorICAgICAqCisgICAgICogQHNlZSAjS0VZQ09ERV9DVFJMX0xFRlQKKyAgICAgKiBAc2VlICNLRVlDT0RFX0NUUkxfUklHSFQKKyAgICAgKiBAc2VlICNNRVRBX0NUUkxfT04KKyAgICAgKi8KKyAgICBwdWJsaWMgZmluYWwgYm9vbGVhbiBpc0N0cmxQcmVzc2VkKCkgeworICAgICAgICByZXR1cm4gKG1NZXRhU3RhdGUgJiBNRVRBX0NUUkxfT04pICE9IDA7CisgICAgfQorCisgICAgLyoqCisgICAgICogPHA+UmV0dXJucyB0aGUgcHJlc3NlZCBzdGF0ZSBvZiB0aGUgTUVUQSBtZXRhIGtleS48L3A+CisgICAgICoKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIE1FVEEga2V5IGlzIHByZXNzZWQsIGZhbHNlIG90aGVyd2lzZQorICAgICAqCisgICAgICogQHNlZSAjS0VZQ09ERV9NRVRBX0xFRlQKKyAgICAgKiBAc2VlICNLRVlDT0RFX01FVEFfUklHSFQKKyAgICAgKiBAc2VlICNNRVRBX01FVEFfT04KKyAgICAgKi8KKyAgICBwdWJsaWMgZmluYWwgYm9vbGVhbiBpc01ldGFQcmVzc2VkKCkgeworICAgICAgICByZXR1cm4gKG1NZXRhU3RhdGUgJiBNRVRBX01FVEFfT04pICE9IDA7CisgICAgfQorCisgICAgLyoqCisgICAgICogPHA+UmV0dXJucyB0aGUgcHJlc3NlZCBzdG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2V5RXZlbnR7YWN0aW9uPSIgKyBtQWN0aW9uICsgIiBjb2RlPSIgKyBtS2V5Q29kZQotICAgICAgICAgICAgKyAiIHJlcGVhdD0iICsgbVJlcGVhdENvdW50Ci0gICAgICAgICAgICArICIgbWV0YT0iICsgbU1ldGFTdGF0ZSArICIgc2NhbmNvZGU9IiArIG1TY2FuQ29kZQotICAgICAgICAgICAgKyAiIG1GbGFncz0iICsgbUZsYWdzICsgIn0iOworICAgICAgICByZXR1cm4gIktleUV2ZW50e2FjdGlvbj0iICsgYWN0aW9uVG9TdHJpbmcobUFjdGlvbikKKyAgICAgICAgICAgICAgICArICIga2V5Y29kZT0iICsga2V5Q29kZVRvU3RyaW5nKG1LZXlDb2RlKQorICAgICAgICAgICAgICAgICsgIiBzY2FuY29kZT0iICsgbVNjYW5Db2RlCisgICAgICAgICAgICAgICAgKyAiIG1ldGE9IiArIG1ldGFTdGF0ZVRvU3RyaW5nKG1NZXRhU3RhdGUpCisgICAgICAgICAgICAgICAgKyAiIGZsYWdzPTB4IiArIEludGVnZXIudG9IZXhTdHJpbmcobUZsYWdzKQorICAgICAgICAgICAgICAgICsgIiByZXBlYXQ9IiArIG1SZXBlYXRDb3VudAorICAgICAgICAgICAgICAgICsgIiBkZXZpY2U9IiArIG1EZXZpY2VJZAorICAgICAgICAgICAgICAgICsgIiBzb3VyY2U9MHgiICsgSW50ZWdlci50b0hleFN0cmluZyhtU291cmNlKQorICAgICAgICAgICAgICAgICsgIn0iOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgYSBzdHJpbmcgdGhhdCByZXByZXNlbnRzIHRoZSBzeW1ib2xpYyBuYW1lIG9mIHRoZSBzcGVjaWZpZWQgYWN0aW9uCisgICAgICogc3VjaCBhcyAiQUNUSU9OX0RPV04iLCBvciAiMzUiIChpZiB1bmtub3duKS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhY3Rpb24gVGhlIGFjdGlvbi4KKyAgICAgKiBAcmV0dXJuIFRoZSBzeW1ib2xpYyBuYW1lIG9mIHRoZSBzcGVjaWZpZWQgYWN0aW9uLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgYWN0aW9uVG9TdHJpbmcoaW50IGFjdGlvbikgeworICAgICAgICBzd2l0Y2ggKGFjdGlvbikgeworICAgICAgICAgICAgY2FzZSBBQ1RJT05fRE9XTjoKKyAgICAgICAgICAgICAgICByZXR1cm4gIkFDVElPTl9ET1dOIjsKKyAgICAgICAgICAgIGNhc2UgQUNUSU9OX1VQOgorICAgICAgICAgICAgICAgIHJldHVybiAiQUNUSU9OX1VQIjsKKyAgICAgICAgICAgIGNhc2UgQUNUSU9OX01VTFRJUExFOgorICAgICAgICAgICAgICAgIHJldHVybiAiQUNUSU9OX01VTFRJUExFIjsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIEludGVnZXIudG9TdHJpbmcoYWN0aW9uKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgYSBzdHJpbmcgdGhhdCByZXByZXNlbnRzIHRoZSBzeW1ib2xpYyBuYW1lIG9mIHRoZSBzcGVjaWZpZWQga2V5Y29kZQorICAgICAqIHN1Y2ggYXMgIktFWUNPREVfQSIsICJLRVlDT0RFX0RQQURfVVAiLCBvciAiMTAwMSIgKGlmIHVua25vd24pLgorICAgICAqCisgICAgICogQHBhcmFtIGtleUNvZGUgVGhlIGtleSBjb2RlLgorICAgICAqIEByZXR1cm4gVGhlIHN5bWJvbGljIG5hbWUgb2YgdGhlIHNwZWNpZmllZCBrZXljb2RlLgorICAgICAqCisgICAgICogQHNlZSBLZXlDaGFyYWN0ZXJNYXAjZ2V0RGlzcGxheUxhYmVsCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBrZXlDb2RlVG9TdHJpbmcoaW50IGtleUNvZGUpIHsKKyAgICAgICAgaWYgKGtleUNvZGUgPj0gMCAmJiBrZXlDb2RlIDwgS0VZQ09ERV9TWU1CT0xJQ19OQU1FUy5sZW5ndGgpIHsKKyAgICAgICAgICAgIHJldHVybiBLRVlDT0RFX1NZTUJPTElDX05BTUVTW2tleUNvZGVdOworICAgICAgICB9CisgICAgICAgIHJldHVybiBJbnRlZ2VyLnRvU3RyaW5nKGtleUNvZGUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEdldHMgYSBrZXljb2RlIGJ5IGl0cyBzeW1ib2xpYyBuYW1lIHN1Y2ggYXMgIktFWUNPREVfQSIgb3IgIjEwMDEiIChpZiB1bmtub3duKS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBzeW1ib2xpY05hbWUgVGhlIHN5bWJvbGljIG5hbWUgb2YgdGhlIGtleWNvZGUuCisgICAgICogQHJldHVybiBUaGUga2V5Y29kZSBvciAtMSBpZiBub3QgZm91bmQuCisgICAgICogQHNlZSAja2V5Y29kZVRvU3RyaW5nCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGludCBrZXlDb2RlRnJvbVN0cmluZyhTdHJpbmcgc3ltYm9saWNOYW1lKSB7CisgICAgICAgIGlmIChzeW1ib2xpY05hbWUgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigic3ltYm9saWNOYW1lIG11c3Qgbm90IGJlIG51bGwiKTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIGludCBjb3VudCA9IEtFWUNPREVfU1lNQk9MSUNfTkFNRVMubGVuZ3RoOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGlmIChzeW1ib2xpY05hbWUuZXF1YWxzKEtFWUNPREVfU1lNQk9MSUNfTkFNRVNbaV0pKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGk7CisgICAgICAgICAgICB9CisgICAgICAg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UgPj4+PSAxOyAvLyB1bnNpZ25lZCBzaGlmdCEKKyAgICAgICAgICAgIGlmIChpc1NldCkgeworICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBuYW1lID0gTUVUQV9TWU1CT0xJQ19OQU1FU1tpXTsKKyAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1ldGFTdGF0ZSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmFtZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgU3RyaW5nQnVpbGRlcihuYW1lKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKCd8Jyk7CisgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQobmFtZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaSArPSAxOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQudG9TdHJpbmcoKTsKICAgICB9CiAKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFBhcmNlbGFibGUuQ3JlYXRvcjxLZXlFdmVudD4gQ1JFQVRPUgpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9MYXlvdXRJbmZsYXRlci5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9MYXlvdXRJbmZsYXRlci5qYXZhCmluZGV4IDE5NGMwMTMuLmQyNGFmNTIgMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2lkL3ZpZXcvTGF5b3V0SW5mbGF0ZXIuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC92aWV3L0xheW91dEluZmxhdGVyLmphdmEKQEAgLTE2LDE1ICsxNiwxNSBAQAogCiBwYWNrYWdlIGFuZHJv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eSk7CisgICAgICAgICAgICBtRmFjdG9yeSA9IG5ldyBGYWN0b3J5TWVyZ2VyKGZhY3RvcnksIG51bGwsIG1GYWN0b3J5LCBtRmFjdG9yeTIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogTGlrZSB7QGxpbmsgI3NldEZhY3Rvcnl9LCBidXQgYWxsb3dzIHlvdSB0byBzZXQgYSB7QGxpbmsgRmFjdG9yeTJ9CisgICAgICogaW50ZXJmYWNlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEZhY3RvcnkyKEZhY3RvcnkyIGZhY3RvcnkpIHsKKyAgICAgICAgaWYgKG1GYWN0b3J5U2V0KSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJBIGZhY3RvcnkgaGFzIGFscmVhZHkgYmVlbiBzZXQgb24gdGhpcyBMYXlvdXRJbmZsYXRlciIpOworICAgICAgICB9CisgICAgICAgIGlmIChmYWN0b3J5ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiR2l2ZW4gZmFjdG9yeSBjYW4gbm90IGJlIG51bGwiKTsKKyAgICAgICAgfQorICAgICAgICBtRmFjdG9yeVNldCA9IHRydWU7CisgICAgICAgIGlmIChtRmFjdG9yeSA9PSBudWxsKSB7CisgICAgICAgICAgICBtRmFjdG9yeSA9IG1GYWN0b3J5MiA9IGZhY3Rvcnk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtRmFjdG9yeSA9IG5ldyBGYWN0b3J5TWVyZ2VyKGZhY3RvcnksIGZhY3RvcnksIG1GYWN0b3J5LCBtRmFjdG9yeTIpOwogICAgICAgICB9CiAgICAgfQogCkBAIC0zODAsMTAgKzQ0MiwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJWaWV3R3JvdXAgcm9vdCBhbmQgYXR0YWNoVG9Sb290PXRydWUiKTsKICAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgICAgIHJJbmZsYXRlKHBhcnNlciwgcm9vdCwgYXR0cnMpOworICAgICAgICAgICAgICAgICAgICBySW5mbGF0ZShwYXJzZXIsIHJvb3QsIGF0dHJzLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgLy8gVGVtcCBpcyB0aGUgcm9vdCB2aWV3IHRoYXQgd2FzIGZvdW5kIGluIHRoZSB4bWwKLSAgICAgICAgICAgICAgICAgICAgVmlldyB0ZW1wID0gY3JlYXRlVmlld0Zyb21UYWcobmFtZSwgYXR0cnMpOworICAgICAgICAgICAgICAgICAgICBWaWV3IHRlbXAgPSBjcmVhdGVWaWV3RnJvbVRhZyhyb290LCBuYW1lLCBhdHRycyk7CiAKICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcyBwYXJhbXMgPSBudWxsOwogCkBAIC00MDUsNyArNDY3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiLS0tLS0+IHN0YXJ0IGluZmxhdGluZyBjaGlsZHJlbiIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIC8vIEluZmxhdGUgYWxsIGNoaWxkcmVuIHVuZGVyIHRlbXAKLSAgICAgICAgICAgICAgICAgICAgckluZmxhdGUocGFyc2VyLCB0ZW1wLCBhdHRycyk7CisgICAgICAgICAgICAgICAgICAgIHJJbmZsYXRlKHBhcnNlciwgdGVtcCwgYXR0cnMsIHRydWUpOwogICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiLS0tLS0+IGRvbmUgaW5mbGF0aW5nIGNoaWxkcmVuIik7CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTQ1OCwxOCArNTI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YWRDbGFzcygKLSAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCAhPSBudWxsID8gKHByZWZpeCArIG5hbWUpIDogbmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXggIT0gbnVsbCA/IChwcmVmaXggKyBuYW1lKSA6IG5hbWUpLmFzU3ViY2xhc3MoVmlldy5jbGFzcyk7CiAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgaWYgKG1GaWx0ZXIgIT0gbnVsbCAmJiBjbGF6eiAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gYWxsb3dlZCA9IG1GaWx0ZXIub25Mb2FkQ2xhc3MoY2xhenopOwpAQCAtNDg3LDcgKzU0OSw3IEBACiAgICAgICAgICAgICAgICAgICAgIGlmIChhbGxvd2VkU3RhdGUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gTmV3IGNsYXNzIC0tIHJlbWVtYmVyIHdoZXRoZXIgaXQgaXMgYWxsb3dlZAogICAgICAgICAgICAgICAgICAgICAgICAgY2xhenogPSBtQ29udGV4dC5nZXRDbGFzc0xvYWRlcigpLmxvYWRDbGFzcygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ICE9IG51bGwgPyAocHJlZml4ICsgbmFtZSkgOiBuYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ICE9IG51bGwgPyAocHJlZml4ICsgbmFtZSkgOiBuYW1lKS5hc1N1YmNsYXNzKFZpZXcuY2xhc3MpOwogICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGFsbG93ZWQgPSBjbGF6eiAhPSBudWxsICYmIG1GaWx0ZXIub25Mb2FkQ2xhc3MoY2xhenopOwogICAgICAgICAgICAgICAgICAgICAgICAgbUZpbHRlck1hcC5wdXQobmFtZSwgYWxsb3dlZCk7CkBAIC01MDIsNy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gU3lzdGVtLm91dC5wcmludGxuKCIqKioqKioqKiBDcmVhdGluZyB2aWV3OiAiICsgbmFtZSk7CiAKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIFZpZXcgdmlldyA9IChtRmFjdG9yeSA9PSBudWxsKSA/IG51bGwgOiBtRmFjdG9yeS5vbkNyZWF0ZVZpZXcobmFtZSwKLSAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQsIGF0dHJzKTsKKyAgICAgICAgICAgIFZpZXcgdmlldzsKKyAgICAgICAgICAgIGlmIChtRmFjdG9yeTIgIT0gbnVsbCkgdmlldyA9IG1GYWN0b3J5Mi5vbkNyZWF0ZVZpZXcocGFyZW50LCBuYW1lLCBtQ29udGV4dCwgYXR0cnMpOworICAgICAgICAgICAgZWxzZSBpZiAobUZhY3RvcnkgIT0gbnVsbCkgdmlldyA9IG1GYWN0b3J5Lm9uQ3JlYXRlVmlldyhuYW1lLCBtQ29udGV4dCwgYXR0cnMpOworICAgICAgICAgICAgZWxzZSB2aWV3ID0gbnVsbDsKIAogICAgICAgICAgICAgaWYgKHZpZXcgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGlmICgtMSA9PSBuYW1lLmluZGV4T2YoJy4nKSkgewotICAgICAgICAgICAgICAgICAgICB2aWV3ID0gb25DcmVhdGVWaWV3KG5hbWUsIGF0dHJzKTsKKyAgICAgICAgICAgICAgICAgICAgdmlldyA9IG9uQ3JlYXRlVmlldyhwYXJlbnQsIG5hbWUsIGF0dHJzKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICB2aWV3ID0gY3JlYXRlVmlldyhuYW1lLCBudWxsLCBhdHRycyk7CiAgICAgICAgICAgICAgICAgfQpAQCAtNTk1LDggKzY4Myw4IEBACiAgICAgICogUmVjdXJzaXZlIG1ldGhvZCB1c2VkIHRvIGRlc2NlbmQgZG93biB0aGUgeG1sIGhpZXJhcmNoeSBhbmQgaW5zdGFudGlhdGUKICAgICAgKi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Hcm91cCkgcGFyZW50OwogICAgICAgICAgICAgICAgIGZpbmFsIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMgcGFyYW1zID0gdmlld0dyb3VwLmdlbmVyYXRlTGF5b3V0UGFyYW1zKGF0dHJzKTsKLSAgICAgICAgICAgICAgICBySW5mbGF0ZShwYXJzZXIsIHZpZXcsIGF0dHJzKTsKKyAgICAgICAgICAgICAgICBySW5mbGF0ZShwYXJzZXIsIHZpZXcsIGF0dHJzLCB0cnVlKTsKICAgICAgICAgICAgICAgICB2aWV3R3JvdXAuYWRkVmlldyh2aWV3LCBwYXJhbXMpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgcGFyZW50Lm9uRmluaXNoSW5mbGF0ZSgpOworICAgICAgICBpZiAoZmluaXNoSW5mbGF0ZSkgcGFyZW50Lm9uRmluaXNoSW5mbGF0ZSgpOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBwYXJzZVJlcXVlc3RGb2N1cyhYbWxQdWxsUGFyc2VyIHBhcnNlciwgVmlldyBwYXJlbnQpCkBAIC02NzksOSArNzY3LDkgQEAKIAogICAgICAgICAgICAgICAgICAgICBpZiAoVEFHX01FUkdFLmVxdWFscyhjaGlsZE5hbWUpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbmZsYXRlIGFsbCBjaGlsZHJlbi4KLSAgICAgICAgICAgICAgICAgICAgICAgIHJJbmZsYXRlKGNoaWxkUGFyc2VyLCBwYXJlbnQsIGNoaWxkQXR0cnMpOworICAgICAgICAgICAgICAgICAgICAgICAgckluZmxhdGUoY2hpbGRQYXJzZXIsIHBhcmVudCwgY2hpbGRBdHRycywgZmFsc2UpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgVmlldyB2aWV3ID0gY3JlYXRlVmlld0Zyb21UYWcoY2hpbGROYW1lLCBjaGlsZEF0dHJzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFZpZXcgdmlldyA9IGNyZWF0ZVZpZXdGcm9tVGFnKHBhcmVudCwgY2hpbGROYW1lLCBjaGlsZEF0dHJzKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFZpZXdHcm91cCBncm91cCA9IChWaWV3R3JvdXApIHBhcmVudDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgdHJ5IHRvIGxvYWQgdGhlIGxheW91dCBwYXJhbXMgc2V0IGluIHRoZSA8aW5jbHVkZSAvPiB0YWcuIElmCkBAIC03MDQsNyArNzkyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW5mbGF0ZSBhbGwgY2hpbGRyZW4uCi0gICAgICAgICAgICAgICAgICAgICAgICBySW5mbGF0ZShjaGlsZFBhcnNlciwgdmlldywgY2hpbGRBdHRycyk7CisgICAgICAgICAgICAgICAgICAgICAgICBySW5mbGF0ZShjaGlsZFBhcnNlciwgdmlldywgY2hpbGRBdHRycywgdHJ1ZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEF0dGVtcHQgdG8gb3ZlcnJpZGUgdGhlIGluY2x1ZGVkIGxheW91dCdzIGFuZHJvaWQ6aWQgd2l0aCB0aGUKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9uZSBzZXQgb24gdGhlIDxpbmNsdWRlIC8+IHRhZyBpdHNlbGYuCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC92aWV3L01lbnVJbmZsYXRlci5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9NZW51SW5mbGF0ZXIuamF2YQppbmRleCA0NmM4MDVjLi43ZDVkY2Q4IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC92aWV3L01lbnVJbmZsYXRlci5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3ZpZXcvTWVudUluZmxhdG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W51SXRlbUNsaWNrTGlzdGVuZXIgeworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBDbGFzc1tdIFBBUkFNX1RZUEVTID0gbmV3IENsYXNzW10geyBNZW51SXRlbS5jbGFzcyB9OworICAgICAgICAKKyAgICAgICAgcHJpdmF0ZSBDb250ZXh0IG1Db250ZXh0OworICAgICAgICBwcml2YXRlIE1ldGhvZCBtTWV0aG9kOworICAgICAgICAKKyAgICAgICAgcHVibGljIEluZmxhdGVkT25NZW51SXRlbUNsaWNrTGlzdGVuZXIoQ29udGV4dCBjb250ZXh0LCBTdHJpbmcgbWV0aG9kTmFtZSkgeworICAgICAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OworICAgICAgICAgICAgQ2xhc3MgYyA9IGNvbnRleHQuZ2V0Q2xhc3MoKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbU1ldGhvZCA9IGMuZ2V0TWV0aG9kKG1ldGhvZE5hbWUsIFBBUkFNX1RZUEVTKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgSW5mbGF0ZUV4Y2VwdGlvbiBleCA9IG5ldyBJbmZsYXRlRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIkNvdWxkbid0IHJlc29sdmUgbWVudSBpdGVtIG9uQ2xpY2sgaGFuZGxlciAiICsgbWV0aG9kTmFtZSArCisgICAgICAgICAgICAgICAgICAgICAgICAiIGluIGNsYXNzICIgKyBjLmdldE5hbWUoKSk7CisgICAgICAgICAgICAgICAgZXguaW5pdENhdXNlKGUpOworICAgICAgICAgICAgICAgIHRocm93IGV4OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbk1lbnVJdGVtQ2xpY2soTWVudUl0ZW0gaXRlbSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAobU1ldGhvZC5nZXRSZXR1cm5UeXBlKCkgPT0gQm9vbGVhbi5UWVBFKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAoQm9vbGVhbikgbU1ldGhvZC5pbnZva2UobUNvbnRleHQsIGl0ZW0pOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1NZXRob2QuaW52b2tlKG1Db250ZXh0LCBpdGVtKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbihlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKICAgICAvKioKICAgICAgKiBTdGF0ZSBmb3IgdGhlIGN1cnJlbnQgbWVudS4KICAgICAgKiA8cD4KQEAgLTIwNSw2ICsyNDQsMjAgQEAKICAgICAgICAgcHJpdmF0ZSBib29sZWFuIGl0ZW1WaXNpYmxlOwogICAgICAgICBwcml2YXRlIGJvb2xlYW4gaXRlbUVuYWJsZWQ7CiAgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogU3luYyB0byBhdHRycy54bWwgZW51bSwgdmFsdWVzIGluIE1lbnVJdGVtOgorICAgICAgICAgKiAtIDA6IG5ldmVyCisgICAgICAgICAqIC0gMTogaWZSb29tCisgICAgICAgICAqIC0gMjogYWx3YXlzCisgICAgICAgICAqIC0gLTE6IFNhZmUgc2VudGluZWwgZm9yICJubyB2YWx1ZSIuCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIGludCBpdGVtU2hvd0FzQWN0aW9uOworCisgICAgICAgIHByaXZhdGUgaW50IGl0ZW1BY3Rpb25WaWV3TGF5b3V0OworICAgICAgICBwcml2YXRlIFN0cmluZyBpdGVtQWN0aW9uVmlld0NsYXNzTmFtZTsKKyAgICAg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hLmdldFJlc291cmNlSWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuTWVudUl0ZW1fYWN0aW9uTGF5b3V0LCAwKTsKKyAgICAgICAgICAgIGl0ZW1BY3Rpb25WaWV3Q2xhc3NOYW1lID0gYS5nZXRTdHJpbmcoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuTWVudUl0ZW1fYWN0aW9uVmlld0NsYXNzKTsKICAgICAgICAgICAgIAogICAgICAgICAgICAgYS5yZWN5Y2xlKCk7CiAgICAgICAgICAgICAKQEAgLTI5OSw5ICszNTYsMzggQEAKICAgICAgICAgICAgICAgICAuc2V0SWNvbihpdGVtSWNvblJlc0lkKQogICAgICAgICAgICAgICAgIC5zZXRBbHBoYWJldGljU2hvcnRjdXQoaXRlbUFscGhhYmV0aWNTaG9ydGN1dCkKICAgICAgICAgICAgICAgICAuc2V0TnVtZXJpY1Nob3J0Y3V0KGl0ZW1OdW1lcmljU2hvcnRjdXQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoaXRlbVNob3dBc0FjdGlvbiA+PSAwKSB7CisgICAgICAgICAgICAgICAgaXRlbS5zZXRTaG93QXNBY3Rpb24oaXRlbVNob3dBc0FjdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChpdGVtTGlzdGVuZXJNZXRob2ROYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAobUNvbnRleHQuaXNSZXN0cmljdGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiVGhlIGFuZHJvaWQ6b25DbGljayBhdHRyaWJ1dGUgY2Fubm90ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJiZSB1c2VkIHdpdGhpbiBhIHJlc3RyaWN0ZWQgY29udGV4dCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpdGVtLnNldE9uTWVudUl0ZW1DbGlja0xpc3RlbmVyKAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEluZmxhdGVkT25NZW51SXRlbUNsaWNrTGlzdGVuZXIobUNvbnRleHQsIGl0ZW1MaXN0ZW5lck1ldGhvZE5hbWUpKTsKKyAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaWYgKGl0ZW1DaGVja2FibGUgPj0gMikgewotICAgICAgICAgICAgICAgICgoTWVudUl0ZW1JbXBsKSBpdGVtKS5zZXRFeGNsdXNpdmVDaGVja2FibGUodHJ1ZSk7CisgICAgICAgICAgICBpZiAoaXRlbSBpbnN0YW5jZW9mIE1lbnVJdGVtSW1wbCkgeworICAgICAgICAgICAgICAgIE1lbnVJdGVtSW1wbCBpbXBsID0gKE1lbnVJdGVtSW1wbCkgaXRlbTsKKyAgICAgICAgICAgICAgICBpZiAoaXRlbUNoZWNrYWJsZSA+PSAyKSB7CisgICAgICAgICAgICAgICAgICAgIGltcGwuc2V0RXhjbHVzaXZlQ2hlY2thYmxlKHRydWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGl0ZW1BY3Rpb25WaWV3Q2xhc3NOYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBDbGFzczw/PiBjbGF6eiA9IENsYXNzLmZvck5hbWUoaXRlbUFjdGlvblZpZXdDbGFzc05hbWUpOworICAgICAgICAgICAgICAgICAgICBDb25zdHJ1Y3Rvcjw/PiBjID0gY2xhenouZ2V0Q29uc3RydWN0b3IoQUNUSU9OX1ZJRVdfQ09OU1RSVUNUT1JfU0lHTkFUVVJFKTsKKyAgICAgICAgICAgICAgICAgICAgaXRlbS5zZXRBY3Rpb25WaWV3KChWaWV3KSBjLm5ld0luc3RhbmNlKG1Db250ZXh0KSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXh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qb3IoKQorICAgICAgICAgICAgKyAiIHRvdWNoTWlub3I9IiArIGdldFRvdWNoTWlub3IoKQorICAgICAgICAgICAgKyAiIHRvb2xNYWpvcj0iICsgZ2V0VG9vbE1ham9yKCkKKyAgICAgICAgICAgICsgIiB0b29sTWlub3I9IiArIGdldFRvb2xNaW5vcigpCisgICAgICAgICAgICArICIgb3JpZW50YXRpb249IiArIGdldE9yaWVudGF0aW9uKCkKKyAgICAgICAgICAgICsgIiBtZXRhPSIgKyBLZXlFdmVudC5tZXRhU3RhdGVUb1N0cmluZyhtTWV0YVN0YXRlKQorICAgICAgICAgICAgKyAiIHBvaW50ZXJDb3VudD0iICsgZ2V0UG9pbnRlckNvdW50KCkKKyAgICAgICAgICAgICsgIiBoaXN0b3J5U2l6ZT0iICsgZ2V0SGlzdG9yeVNpemUoKQorICAgICAgICAgICAgKyAiIGZsYWdzPTB4IiArIEludGVnZXIudG9IZXhTdHJpbmcobUZsYWdzKQorICAgICAgICAgICAgKyAiIGVkZ2VGbGFncz0weCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKG1FZGdlRmxhZ3MpCisgICAgICAgICAgICArICIgZGV2aWNlPSIgKyBtRGV2aWNlSWQKKyAgICAgICAgICAgICsgIiBzb3VyY2U9MHgiICsgSW50ZWdlci50b0hleFN0cmluZyhtU291cmNlKQorICAgICAgICAgICAgKyAifSI7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyBhIHN0cmluZyB0aGF0IHJlcHJlc2VudHMgdGhlIHN5bWJvbGljIG5hbWUgb2YgdGhlIHNwZWNpZmllZCBhY3Rpb24KKyAgICAgKiBzdWNoIGFzICJBQ1RJT05fRE9XTiIsICJBQ1RJT05fUE9JTlRFUl9ET1dOKDMpIiBvciAiMzUiIChpZiB1bmtub3duKS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhY3Rpb24gVGhlIGFjdGlvbi4KKyAgICAgKiBAcmV0dXJuIFRoZSBzeW1ib2xpYyBuYW1lIG9mIHRoZSBzcGVjaWZpZWQgYWN0aW9uLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgYWN0aW9uVG9TdHJpbmcoaW50IGFjdGlvbikgeworICAgICAgICBzd2l0Y2ggKGFjdGlvbikgeworICAgICAgICAgICAgY2FzZSBBQ1RJT05fRE9XTjoKKyAgICAgICAgICAgICAgICByZXR1cm4gIkFDVElPTl9ET1dOIjsKKyAgICAgICAgICAgIGNhc2UgQUNUSU9OX1VQOgorICAgICAgICAgICAgICAgIHJldHVybiAiQUNUSU9OX1VQIjsKKyAgICAgICAgICAgIGNhc2UgQUNUSU9OX0NBTkNFTDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIkFDVElPTl9DQU5DRUwiOworICAgICAgICAgICAgY2FzZSBBQ1RJT05fTU9WRToKKyAgICAgICAgICAgICAgICByZXR1cm4gIkFDVElPTl9NT1ZFIjsKKyAgICAgICAgfQorICAgICAgICBpbnQgaW5kZXggPSAoYWN0aW9uICYgQUNUSU9OX1BPSU5URVJfSU5ERVhfTUFTSykgPj4gQUNUSU9OX1BPSU5URVJfSU5ERVhfU0hJRlQ7CisgICAgICAgIHN3aXRjaCAoYWN0aW9uICYgQUNUSU9OX01BU0spIHsKKyAgICAgICAgICAgIGNhc2UgQUNUSU9OX1BPSU5URVJfRE9XTjoKKyAgICAgICAgICAgICAgICByZXR1cm4gIkFDVElPTl9QT0lOVEVSX0RPV04oIiArIGluZGV4ICsgIikiOworICAgICAgICAgICAgY2FzZSBBQ1RJT05fUE9JTlRFUl9VUDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIkFDVElPTl9QT0lOVEVSX1VQKCIgKyBpbmRleCArICIpIjsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIEludGVnZXIudG9TdHJpbmcoYWN0aW9uKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwg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lzdGVuIGZvciBhIHN1YnNldCBpdCBtaWdodAogICAgICAqIGJlIGVhc2llciB0byBleHRlbmQge0BsaW5rIFNpbXBsZU9uU2NhbGVHZXN0dXJlTGlzdGVuZXJ9LgotICAgICAqIAorICAgICAqCiAgICAgICogQW4gYXBwbGljYXRpb24gd2lsbCByZWNlaXZlIGV2ZW50cyBpbiB0aGUgZm9sbG93aW5nIG9yZGVyOgogICAgICAqIDx1bD4KICAgICAgKiAgPGxpPk9uZSB7QGxpbmsgT25TY2FsZUdlc3R1cmVMaXN0ZW5lciNvblNjYWxlQmVnaW4oU2NhbGVHZXN0dXJlRGV0ZWN0b3IpfQpAQCAtNTMsNyArNTMsNyBAQAogICAgICAgICAvKioKICAgICAgICAgICogUmVzcG9uZHMgdG8gc2NhbGluZyBldmVudHMgZm9yIGEgZ2VzdHVyZSBpbiBwcm9ncmVzcy4KICAgICAgICAgICogUmVwb3J0ZWQgYnkgcG9pbnRlciBtb3Rpb24uCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gZGV0ZWN0b3IgVGhlIGRldGVjdG9yIHJlcG9ydGluZyB0aGUgZXZlbnQgLSB1c2UgdGhpcyB0bwogICAgICAgICAgKiAgICAgICAgICByZXRyaWV2ZSBleHRlbmRlZCBpbmZvIGFib3V0IGV2ZW50IHN0YXRlLgogICAgICAgICAgKiBAcmV0dXJuIFdoZXRoZXIgb3Igbm90IHRoZSBkZXRlY3RvciBzaG91bGQgY29uc2lkZXIgdGhpcyBldmVudApAQCAtNjgsNyArNjgsNyBAQAogICAgICAgICAvKioKICAgICAgICAgICogUmVzcG9uZHMgdG8gdGhlIGJlZ2lubmluZyBvZiBhIHNjYWxpbmcgZ2VzdHVyZS4gUmVwb3J0ZWQgYnkKICAgICAgICAgICogbmV3IHBvaW50ZXJzIGdvaW5nIGRvd24uCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gZGV0ZWN0b3IgVGhlIGRldGVjdG9yIHJlcG9ydGluZyB0aGUgZXZlbnQgLSB1c2UgdGhpcyB0bwogICAgICAgICAgKiAgICAgICAgICByZXRyaWV2ZSBleHRlbmRlZCBpbmZvIGFib3V0IGV2ZW50IHN0YXRlLgogICAgICAgICAgKiBAcmV0dXJuIFdoZXRoZXIgb3Igbm90IHRoZSBkZXRlY3RvciBzaG91bGQgY29udGludWUgcmVjb2duaXppbmcKQEAgLTgyLDE3ICs4MiwxNyBAQAogICAgICAgICAvKioKICAgICAgICAgICogUmVzcG9uZHMgdG8gdGhlIGVuZCBvZiBhIHNjYWxlIGdlc3R1cmUuIFJlcG9ydGVkIGJ5IGV4aXN0aW5nCiAgICAgICAgICAqIHBvaW50ZXJzIGdvaW5nIHVwLgotICAgICAgICAgKiAKKyAgICAgICAgICoKICAgICAgICAgICogT25jZSBhIHNjYWxlIGhhcyBlbmRlZCwge0BsaW5rIFNjYWxlR2VzdHVyZURldGVjdG9yI2dldEZvY3VzWCgpfQogICAgICAgICAgKiBhbmQge0BsaW5rIFNjYWxlR2VzdHVyZURldGVjdG9yI2dldEZvY3VzWSgpfSB3aWxsIHJldHVybiB0aGUgbG9jYXRpb24KICAgICAgICAgICogb2YgdGhlIHBvaW50ZXIgcmVtYWluaW5nIG9uIHRoZSBzY3JlZW4uCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gZGV0ZWN0b3IgVGhlIGRldGVjdG9yIHJlcG9ydGluZyB0aGUgZXZlbnQgLSB1c2UgdGhpcyB0bwogICAgICAgICAgKiAgICAgICAgICByZXRyaWV2ZSBleHRlbmRlZCBpbmZvIGFib3V0IGV2ZW50IHN0YXRlLgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHZvaWQgb25TY2FsZUVuZChTY2FsZUdlc3R1cmVEZXRlY3RvciBkZXRlY3Rvcik7CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogQSBjb252ZW5pZW5jZSBjbGFzcyB0byBleHRlb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uWSgpIHsKKyAgICAgICAgcmV0dXJuIG1DdXJyRmluZ2VyRGlmZlk7CisgICAgfQorCisgICAgLyoqCiAgICAgICogUmV0dXJuIHRoZSBwcmV2aW91cyBkaXN0YW5jZSBiZXR3ZWVuIHRoZSB0d28gcG9pbnRlcnMgZm9ybWluZyB0aGUKICAgICAgKiBnZXN0dXJlIGluIHByb2dyZXNzLgotICAgICAqIAorICAgICAqCiAgICAgICogQHJldHVybiBQcmV2aW91cyBkaXN0YW5jZSBiZXR3ZWVuIHBvaW50ZXJzIGluIHBpeGVscy4KICAgICAgKi8KICAgICBwdWJsaWMgZmxvYXQgZ2V0UHJldmlvdXNTcGFuKCkgewpAQCAtNDQzLDEwICs0NjMsMzAgQEAKICAgICB9CiAKICAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIHByZXZpb3VzIHggZGlzdGFuY2UgYmV0d2VlbiB0aGUgdHdvIHBvaW50ZXJzIGZvcm1pbmcgdGhlCisgICAgICogZ2VzdHVyZSBpbiBwcm9ncmVzcy4KKyAgICAgKgorICAgICAqIEByZXR1cm4gUHJldmlvdXMgZGlzdGFuY2UgYmV0d2VlbiBwb2ludGVycyBpbiBwaXhlbHMuCisgICAgICovCisgICAgcHVibGljIGZsb2F0IGdldFByZXZpb3VzU3BhblgoKSB7CisgICAgICAgIHJldHVybiBtUHJldkZpbmdlckRpZmZYOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgcHJldmlvdXMgeSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSB0d28gcG9pbnRlcnMgZm9ybWluZyB0aGUKKyAgICAgKiBnZXN0dXJlIGluIHByb2dyZXNzLgorICAgICAqCisgICAgICogQHJldHVybiBQcmV2aW91cyBkaXN0YW5jZSBiZXR3ZWVuIHBvaW50ZXJzIGluIHBpeGVscy4KKyAgICAgKi8KKyAgICBwdWJsaWMgZmxvYXQgZ2V0UHJldmlvdXNTcGFuWSgpIHsKKyAgICAgICAgcmV0dXJuIG1QcmV2RmluZ2VyRGlmZlk7CisgICAgfQorCisgICAgLyoqCiAgICAgICogUmV0dXJuIHRoZSBzY2FsaW5nIGZhY3RvciBmcm9tIHRoZSBwcmV2aW91cyBzY2FsZSBldmVudCB0byB0aGUgY3VycmVudAogICAgICAqIGV2ZW50LiBUaGlzIHZhbHVlIGlzIGRlZmluZWQgYXMKICAgICAgKiAoe0BsaW5rICNnZXRDdXJyZW50U3BhbigpfSAvIHtAbGluayAjZ2V0UHJldmlvdXNTcGFuKCl9KS4KLSAgICAgKiAKKyAgICAgKgogICAgICAqIEByZXR1cm4gVGhlIGN1cnJlbnQgc2NhbGluZyBmYWN0b3IuCiAgICAgICovCiAgICAgcHVibGljIGZsb2F0IGdldFNjYWxlRmFjdG9yKCkgewpAQCAtNDU1LDIwICs0OTUsMjAgQEAKICAgICAgICAgfQogICAgICAgICByZXR1cm4gbVNjYWxlRmFjdG9yOwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFJldHVybiB0aGUgdGltZSBkaWZmZXJlbmNlIGluIG1pbGxpc2Vjb25kcyBiZXR3ZWVuIHRoZSBwcmV2aW91cwogICAgICAqIGFjY2VwdGVkIHNjYWxpbmcgZXZlbnQgYW5kIHRoZSBjdXJyZW50IHNjYWxpbmcgZXZlbnQuCi0gICAgICogCisgICAgICoKICAgICAgKiBAcmV0dXJuIFRpbWUgZGlmZmVyZW5jZSBzaW5jZSB0aGUgbGFzdCBzY2FsaW5nIGV2ZW50IGluIG1pbGxpc2Vjb25kcy4KICAgICAgKi8KICAgICBwdWJsaWMgbG9uZyBnZXRUaW1lRGVsdGEoKSB7CiAgICAgICAgIHJldHVybiBtVGltZURlbHRhOwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFJldHVybiB0aGUgZXZlbnQgdGltZSBvZiB0aGUgY3VycmVudCBldmVudCBiZWluZyBwcm9jZXNzZWQuCi0gICAgICogCisgICAgICoKICAgICAgKiBAcmV0dXJuIEN1cnJlbnQgZXZlbnQ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sKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHN1cGVyLmZpbmFsaXplKCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBpZiAobU5hdGl2ZVN1cmZhY2UgIT0gMCB8fCBtU3VyZmFjZUNvbnRyb2wgIT0gMCkgeworICAgICAgICAgICAgICAgIGlmIChERUJVR19SRUxFQVNFKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJTdXJmYWNlLmZpbmFsaXplKCkgaGFzIHdvcmsuIFlvdSBzaG91bGQgaGF2ZSBjYWxsZWQgcmVsZWFzZSgpICgiIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbU5hdGl2ZVN1cmZhY2UgKyAiLCAiICsgbVN1cmZhY2VDb250cm9sICsgIikiLCBtQ3JlYXRpb25TdGFjayk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIlN1cmZhY2UuZmluYWxpemUoKSBoYXMgd29yay4gWW91IHNob3VsZCBoYXZlIGNhbGxlZCByZWxlYXNlKCkgKCIgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtTmF0aXZlU3VyZmFjZSArICIsICIgKyBtU3VyZmFjZUNvbnRyb2wgKyAiKSIpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJlbGVhc2UoKTsgICAgICAgICAgICAKICAgICAgICAgfQotICAgICAgICByZWxlYXNlKCk7CiAgICAgfQogICAgIAogICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgaW5pdChTdXJmYWNlU2Vzc2lvbiBzLApkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9WZWxvY2l0eVRyYWNrZXIuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3ZpZXcvVmVsb2NpdHlUcmFja2VyLmphdmEKaW5kZXggZmI4OGM3MS4uNGFiMjg4M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FUjsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0xODAsNiArMTgzLDEwIEBACiAgICAgICAgICAgICAgICAgLy8gUG9pbnRlciB3ZW50IGRvd24uICBBZGQgaXQgdG8gdGhlIGxpc3QuCiAgICAgICAgICAgICAgICAgLy8gV3JpdGUgYSBzZW50aW5lbCBhdCB0aGUgZW5kIG9mIHRoZSBwYXN0VGltZSB0cmFjZSBzbyB3ZSB3aWxsIGJlIGFibGUgdG8KICAgICAgICAgICAgICAgICAvLyB0ZWxsIHdoZW4gdGhlIHRyYWNlIHN0YXJ0ZWQuCisgICAgICAgICAgICAgICAgaWYgKG1BY3RpdmVQb2ludGVySWQgPT0gSU5WQUxJRF9QT0lOVEVSKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIENvbmdyYXR1bGF0aW9ucyEgWW91J3JlIHRoZSBuZXcgYWN0aXZlIHBvaW50ZXIhCisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQb2ludGVySWQgPSBwb2ludGVySWQ7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHBvaW50ZXIgPSBvYnRhaW5Qb2ludGVyKCk7CiAgICAgICAgICAgICAgICAgcG9pbnRlci5pZCA9IHBvaW50ZXJJZDsKICAgICAgICAgICAgICAgICBwb2ludGVyLnBhc3RUaW1lW2xhc3RUb3VjaEluZGV4XSA9IExvbmcuTUlOX1ZBTFVFOwpAQCAtMjE0LDYgKzIyMSw3IEBACiAgICAgICAgIHByZXZpb3VzUG9pbnRlciA9IG51bGw7CiAgICAgICAgIGZvciAoUG9pbnRlciBwb2ludGVyID0gbVBvaW50ZXJMaXN0SGVhZDsgcG9pbnRlciAhPSBudWxsOyApIHsKICAgICAgICAgICAgIGZpbmFsIFBvaW50ZXIgbmV4dFBvaW50ZXIgPSBwb2ludGVyLm5leHQ7CisgICAgICAgICAgICBmaW5hbCBpbnQgcG9pbnRlcklkID0gcG9pbnRlci5pZDsKICAgICAgICAgICAgIGlmIChwb2ludGVyLmdlbmVyYXRpb24gIT0gZ2VuZXJhdGlvbikgewogICAgICAgICAgICAgICAgIC8vIFBvaW50ZXIgd2VudCB1cC4gIFJlbW92ZSBpdCBmcm9tIHRoZSBsaXN0LgogICAgICAgICAgICAgICAgIGlmIChwcmV2aW91c1BvaW50ZXIgPT0gbnVsbCkgewpAQCAtMjIyLDYgKzIzMCwxMiBAQAogICAgICAgICAgICAgICAgICAgICBwcmV2aW91c1BvaW50ZXIubmV4dCA9IG5leHRQb2ludGVyOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZWxlYXNlUG9pbnRlcihwb2ludGVyKTsKKworICAgICAgICAgICAgICAgIGlmIChwb2ludGVySWQgPT0gbUFjdGl2ZVBvaW50ZXJJZCkgeworICAgICAgICAgICAgICAgICAgICAvLyBQaWNrIGEgbmV3IGFjdGl2ZSBwb2ludGVyLiBIb3cgaXMgYXJiaXRyYXJ5LgorICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUG9pbnRlcklkID0gbVBvaW50ZXJMaXN0SGVhZCAhPSBudWxsID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUG9pbnRlckxpc3RIZWFkLmlkIDogSU5WQUxJRF9QT0lOVEVSOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgcHJldmlvdXNQb2ludGVyID0gcG9pbnRlcjsKICAgICAgICAgICAgIH0KQEAgLTMzNCw3ICszNDgsNyBAQAogICAgICAqIEByZXR1cm4gVGhlIHByZXZpb3VzbHkgY29tcHV0ZWQgWCB2ZWxvY2l0eS4KICAgICAgKi8KICAgICBwdWJsaWMgZmxvYXQgZ2V0WFZlbG9jaXR5KCkgewotICAgICAgICBQb2ludGVyIHBvaW50ZXIgPSBnZXRQb2ludGVyKDApOworICAgICAgICBQb2ludGVyIHBvaW50ZXIgPSBnZXRQb2ludGVyKG1BY3RpdmVQb2ludGVySWQpOwogICAgICAgICByZXR1cm4gcG9pbnRlciAhPSBudWxsID8gcG9pbnRlci54VmVsb2NpdHkgOiAwOwogICAgIH0KICAgICAKQEAgLTM0NSw3ICszNTksNyBAQAogICAgICAqIEByZXR1cm4gVGhlIHByZXZpb3VzbHkgY29tcHV0ZWQgWSB2ZWxvY2l0eS4KICAgICAgKi8KICAgICBwdWJsaWMgZmxvYXQgZ2V0WVZlbG9jaXR5KCkgewotICAgICAgICBQb2ludGVyIHBvaW50ZXIgPSBnZXRQb2ludGVyKDApOworICAgICAgICBQb2ludGVyIHBvaW50ZXIgPSBnZXRQb2ludGVyKG1BY3RpdmVQb2ludGVySWQpOwogICAgICAgICByZXR1cm4gcG9pbnRlciAhPSBudWxsID8gcG9pbnRlci55VmVsb2NpdHkgOiAwOwogICAgIH0KICAgICAKQEAgLTM3Myw3ICszODcsNyBAQAogICAgICAgICByZXR1cm4gcG9pbnRlciAhPSBudWxsID8gcG9pbnRlci55VmVsb2NpdHkgOiAwOwogICAgIH0KICAgICAKLSAgICBwcml2YXRlIGZpbmFsIFBvaW50ZXIgZ2V0UG9pbnRlcihpbnQgaWQpIHsKKyAgICBwcml2YXRlIFBvaW50ZXIgZ2V0UG9pbnRlcihpbnQgaWQpIHsKICAgICAgICAgZm9yIChQb2ludGVyIHBvaW50ZXIgPSBtUG9pbnRlckxpc3RIZWFkOyBwb2ludGVyICE9IG51bGw7IHBvaW50ZXIgPSBwb2ludGVyLm5leHQpIHsKICAgICAgICAgICAgIGlmIChwb2ludGVyLmlkID09IGlkKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIHBvaW50ZXI7CkBAIC0zODIsNyArMzk2LDcgQEAKICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgfQogICAgIAotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFBvaW50ZXIgb2J0YWluUG9pbnRlcigpIHsKKyAgICBwcml2YXRlIHN0YXRpYyBQb2ludGVyIG9idGFpblBvaW50ZXIoKSB7CiAgICAgICAgIHN5bmNocm9uaXplZC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gogICAgICAqIFRoZSBvcmRlciBoZXJlIGlzIHZlcnkgaW1wb3J0YW50IHRvIHtAbGluayAjZ2V0RHJhd2FibGVTdGF0ZSgpfQogICAgICAqLwotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludFtdW10gVklFV19TVEFURV9TRVRTID0gewotICAgICAgICBFTVBUWV9TVEFURV9TRVQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMCAwIDAgMAotICAgICAgICBXSU5ET1dfRk9DVVNFRF9TVEFURV9TRVQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMCAwIDAgMQotICAgICAgICBTRUxFQ1RFRF9TVEFURV9TRVQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMCAwIDEgMAotICAgICAgICBTRUxFQ1RFRF9XSU5ET1dfRk9DVVNFRF9TVEFURV9TRVQsICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMCAwIDEgMQotICAgICAgICBGT0NVU0VEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMCAxIDAgMAotICAgICAgICBGT0NVU0VEX1dJTkRPV19GT0NVU0VEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMCAxIDAgMQotICAgICAgICBGT0NVU0VEX1NFTEVDVEVEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMCAxIDEgMAotICAgICAgICBGT0NVU0VEX1NFTEVDVEVEX1dJTkRPV19GT0NVU0VEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgIC8vIDAgMCAxIDEgMQotICAgICAgICBFTkFCTEVEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMSAwIDAgMAotICAgICAgICBFTkFCTEVEX1dJTkRPV19GT0NVU0VEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMSAwIDAgMQotICAgICAgICBFTkFCTEVEX1NFTEVDVEVEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMSAwIDEgMAotICAgICAgICBFTkFCTEVEX1NFTEVDVEVEX1dJTkRPV19GT0NVU0VEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgIC8vIDAgMSAwIDEgMQotICAgICAgICBFTkFCTEVEX0ZPQ1VTRURfU1RBVEVfU0VULCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMSAxIDAgMAotICAgICAgICBFTkFCTEVEX0ZPQ1VTRURfV0lORE9XX0ZPQ1VTRURfU1RBVEVfU0VULCAgICAgICAgICAgICAgICAgIC8vIDAgMSAxIDAgMQotICAgICAgICBFTkFCTEVEX0ZPQ1VTRURfU0VMRUNURURfU1RBVEVfU0VULCAgICAgICAgICAgICAgICAgICAgICAgIC8vIDAgMSAxIDEgMAotICAgICAgICBFTkFCTEVEX0ZPQ1VTRURfU0VMRUNURURfV0lORE9XX0ZPQ1VTRURfU1RBVEVfU0VULCAgICAgICAgIC8vIDAgMSAxIDEgMQotICAgICAgICBQUkVTU0VEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgMCAwIDAgMAotICAgICAgICBQUkVTU0VEX1dJTkRPV19GT0NVU0VEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgMCAwIDAgMQotICAgICAgICBQUkVTU0VEX1NFTEVDVEVEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgMCAwIDEgMAotICAgICAgICBQUkVTU0VEX1NFTEVDVEVEX1dJTkRPV19GT0NVU0VEX1NUQVRFX1NFVCwgICAgICAgICAgICAgICAgIC8vIDEgMCAwIDEgMQotICAgICAgICBQUkVTU0VEX0ZPQ1VTRURfU1RBVEVfU0VULCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgMCAxIDAgMAotICAgICAgICBQUkVTU0VEX0ZPQ1VTRURfV0lORE9XX0ZPQ1VTRURfU1RBVEVfU0VULCAgICAgICAgICAgICAgICAgIC8vIDEgMCAxIDAgMQotICAgICAgICBQUkVTU0VEX0ZPQ1VTRURfU0VMRUNURURfU1RBVEVfU0VULCAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgMCAxIDEgMAotICAgICAgICBQUkVTU0VEX0ZPQ1VTRURfU0VMRUNURURfV0lORE9XX0ZPQ1VTRURfU1RBVEVfU0VULCAgICAgICAgIC8vIDEgMCAxIDEgMQotICAgICAgICBQUkVTU0VEX0VOQUJMRURfU1RBVEVfU0VULCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgMSAwIDAgMAotICAgICAgICBQUkVTU0VEX0VOQUJMRURfV0lORE9XX0ZPQ1VTRURfU1RBVEVfU0VULCAgICAgICAgICAgICAgICAgIC8vIDEgMSAwIDAgMQotICAgICAgICBQUkVTU0VEX0VOQUJMRURfU0VMRUNURURfU1RBVEVfU0VULCAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgMSAwIDEgMAotICAgICAgICBQUkVTU0VEX0VOQUJMRURfU0VMRUNURURfV0lORE9XX0ZPQ1VTRURfU1RBVEVfU0VULCAgICAgICAgIC8vIDEgMSAwIDEgMQotICAgICAgICBQUkVTU0VEX0VOQUJMRURfRk9DVVNFRF9TVEFURV9TRVQsICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgMSAxIDAgMAotICAgICAgICBQUkVTU0VEX0VOQUJMRURfRk9DVVNFRF9XSU5ET1dfRk9DVVNFRF9TVEFURV9TRVQsICAgICAgICAgIC8vIDEgMSAxIDAgMQotICAgICAgICBQUkVTU0VEX0VOQUJMRURfRk9DVVNFRF9TRUxFQ1RFRF9TVEFURV9T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URV9QUkVTU0VELAorICAgICAgICBSLmF0dHIuc3RhdGVfYWN0aXZhdGVkLCAgICAgICAgIFZJRVdfU1RBVEVfQUNUSVZBVEVELAogICAgIH07CiAKKyAgICBzdGF0aWMgeworICAgICAgICBpbnRbXSBvcmRlcmVkSWRzID0gbmV3IGludFtWSUVXX1NUQVRFX0lEUy5sZW5ndGhdOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IFIuc3R5bGVhYmxlLlZpZXdEcmF3YWJsZVN0YXRlcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgaW50IHZpZXdTdGF0ZSA9IFIuc3R5bGVhYmxlLlZpZXdEcmF3YWJsZVN0YXRlc1tpXTsKKyAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqPFZJRVdfU1RBVEVfSURTLmxlbmd0aDsgaiArPSAyKSB7CisgICAgICAgICAgICAgICAgaWYgKFZJRVdfU1RBVEVfSURTW2pdID09IHZpZXdTdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICBvcmRlcmVkSWRzW2kgKiAyXSA9IHZpZXdTdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgb3JkZXJlZElkc1tpICogMiArIDFdID0gVklFV19TVEFURV9JRFNbaiArIDFdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBmaW5hbCBpbnQgTlVNX0JJVFMgPSBWSUVXX1NUQVRFX0lEUy5sZW5ndGggLyAyOworICAgICAgICBWSUVXX1NUQVRFX1NFVFMgPSBuZXcgaW50WzEgPDwgTlVNX0JJVFNdW107CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgVklFV19TVEFURV9TRVRTLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBpbnQgbnVtQml0cyA9IEludGVnZXIuYml0Q291bnQoaSk7CisgICAgICAgICAgICBpbnRbXSBzZXQgPSBuZXcgaW50W251bUJpdHNdOworICAgICAgICAgICAgaW50IHBvcyA9IDA7CisgICAgICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IG9yZGVyZWRJZHMubGVuZ3RoOyBqICs9IDIpIHsKKyAgICAgICAgICAgICAgICBpZiAoKGkgJiBvcmRlcmVkSWRzW2orMV0pICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgc2V0W3BvcysrXSA9IG9yZGVyZWRJZHNbal07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgVklFV19TVEFURV9TRVRTW2ldID0gc2V0OworICAgICAgICB9CisKKyAgICAgICAgRU1QVFlfU1RBVEVfU0VUID0gVklFV19TVEFURV9TRVRTWzBdOworICAgICAgICBXSU5ET1dfRk9DVVNFRF9TVEFURV9TRVQgPSBWSUVXX1NUQVRFX1NFVFNbVklFV19TVEFURV9XSU5ET1dfRk9DVVNFRF07CisgICAgICAgIFNFTEVDVEVEX1NUQVRFX1NFVCA9IFZJRVdfU1RBVEVfU0VUU1tWSUVXX1NUQVRFX1NFTEVDVEVEXTsKKyAgICAgICAgU0VMRUNURURfV0lORE9XX0ZPQ1VTRURfU1RBVEVfU0VUID0gVklFV19TVEFURV9TRVRTWworICAgICAgICAgICAgICAgIFZJRVdfU1RBVEVfV0lORE9XX0ZPQ1VTRUQgfCBWSUVXX1NUQVRFX1NFTEVDVEVEXTsKKyAgICAgICAgRk9DVVNFRF9TVEFURV9TRVQgPSBWSUVXX1NUQVRFX1NFVFNbVklFV19TVEFURV9GT0NVU0VEXTsKKyAgICAgICAgRk9DVVNFRF9XSU5ET1dfRk9DVVNFRF9TVEFURV9TRVQgPSBWSUVXX1NUQVRFX1NFVFNbCisgICAgICAgICAgICAgICAgVklFV19TVEFURV9XSU5ET1dfRk9DVVNFRCB8IFZJRVdfU1RBVEVfRk9DVVNFRF07CisgICAgICAgIEZPQ1VTRURfU0VMRUNURURfU1RBVEVfU0VUID0gVklFV19TVEFURV9TRVRTWworICAgICAgICAgICAgICAgIFZJRVdfU1RBVEVfU0VMRUNURUQgf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uIG1DYW5BY2NlcHREcm9wOwogCiAgICAgLyoqCiAgICAgICogU2ltcGxlIGNvbnN0cnVjdG9yIHRvIHVzZSB3aGVuIGNyZWF0aW5nIGEgdmlldyBmcm9tIGNvZGUuCkBAIC0xODczLDEwICsyMDUwLDcgQEAKICAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OwogICAgICAgICBtUmVzb3VyY2VzID0gY29udGV4dCAhPSBudWxsID8gY29udGV4dC5nZXRSZXNvdXJjZXMoKSA6IG51bGw7CiAgICAgICAgIG1WaWV3RmxhZ3MgPSBTT1VORF9FRkZFQ1RTX0VOQUJMRUQgfCBIQVBUSUNfRkVFREJBQ0tfRU5BQkxFRDsKLSAgICAgICAgLy8gVXNlZCBmb3IgZGVidWcgb25seQotICAgICAgICAvLysrc0luc3RhbmNlQ291bnQ7CiAgICAgICAgIG1Ub3VjaFNsb3AgPSBWaWV3Q29uZmlndXJhdGlvbi5nZXQoY29udGV4dCkuZ2V0U2NhbGVkVG91Y2hTbG9wKCk7Ci0gICAgICAgIHNldE92ZXJTY3JvbGxNb2RlKE9WRVJfU0NST0xMX0lGX0NPTlRFTlRfU0NST0xMUyk7CiAgICAgfQogCiAgICAgLyoqCkBAIC0xOTQyLDcgKzIxMTYsNiBAQAogCiAgICAgICAgIGludCBzY3JvbGxiYXJTdHlsZSA9IFNDUk9MTEJBUlNfSU5TSURFX09WRVJMQVk7CiAKLSAgICAgICAgaW50IG92ZXJTY3JvbGxNb2RlID0gbU92ZXJTY3JvbGxNb2RlOwogICAgICAgICBmaW5hbCBpbnQgTiA9IGEuZ2V0SW5kZXhDb3VudCgpOwogICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgICAgICAgaW50IGF0dHIgPSBhLmdldEluZGV4KGkpOwpAQCAtMjE0OCwxNCArMjMyMSw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC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gYSBzcGVjaWZpYyB2aWV3IG9yIHRvIG9uZSBvZiBpdHMgZGVzY2VuZGFudHMuIFRoaXMgaXMgYQogICAgICAqIHNwZWNpYWwgdmFyaWFudCBvZiB7QGxpbmsgI3JlcXVlc3RGb2N1cygpIH0gdGhhdCB3aWxsIGFsbG93IHZpZXdzIHRoYXQgYXJlIG5vdCBmb2N1YWJsZSBpbgpAQCAtMzczNCwxMiArMzk4NCw5IEBACiAgICAgcHVibGljIGZpbmFsIGJvb2xlYW4gcmVxdWVzdEZvY3VzRnJvbVRvdWNoKCkgewogICAgICAgICAvLyBMZWF2ZSB0b3VjaCBtb2RlIGlmIHdlIG5lZWQgdG8KICAgICAgICAgaWYgKGlzSW5Ub3VjaE1vZGUoKSkgewotICAgICAgICAgICAgVmlldyByb290ID0gZ2V0Um9vdFZpZXcoKTsKLSAgICAgICAgICAgIGlmIChyb290ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgIFZpZXdSb290IHZpZXdSb290ID0gKFZpZXdSb290KXJvb3QuZ2V0UGFyZW50KCk7Ci0gICAgICAgICAgICAgICBpZiAodmlld1Jvb3QgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgIHZpZXdSb290LmVuc3VyZVRvdWNoTW9kZShmYWxzZSk7Ci0gICAgICAgICAgICAgICB9CisgICAgICAgICAgICBWaWV3Um9vdCB2aWV3Um9vdCA9IGdldFZpZXdSb290KCk7CisgICAgICAgICAgICBpZiAodmlld1Jvb3QgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHZpZXdSb290LmVuc3VyZVRvdWNoTW9kZShmYWxzZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHJlcXVlc3RGb2N1cyhWaWV3LkZPQ1VTX0RPV04pOwpAQCAtMzg0MSwxMiArNDA4OCwxMyBAQAogICAgICAqLwogICAgIHB1YmxpYyBib29sZWFuIGRpc3BhdGNoS2V5RXZlbnQoS2V5RXZlbnQgZXZlbnQpI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yVG91Y2hlc1doZW5PYnNjdXJlZAogICAgICAqLwogICAgIHB1YmxpYyBib29sZWFuIG9uRmlsdGVyVG91Y2hFdmVudEZvclNlY3VyaXR5KE1vdGlvbkV2ZW50IGV2ZW50KSB7CisgICAgICAgIC8vbm9pbnNwZWN0aW9uIFJlZHVuZGFudElmU3RhdGVtZW50CiAgICAgICAgIGlmICgobVZpZXdGbGFncyAmIEZJTFRFUl9UT1VDSEVTX1dIRU5fT0JTQ1VSRUQpICE9IDAKICAgICAgICAgICAgICAgICAmJiAoZXZlbnQuZ2V0RmxhZ3MoKSAmIE1vdGlvbkV2ZW50LkZMQUdfV0lORE9XX0lTX09CU0NVUkVEKSAhPSAwKSB7CiAgICAgICAgICAgICAvLyBXaW5kb3cgaXMgb2JzY3VyZWQsIGRyb3AgdGhpcyB0b3VjaC4KQEAgLTQ1MDEsOSArNDc1MSw3IEBACiAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCB5ID0gKGludCkgZXZlbnQuZ2V0WSgpOwogCiAgICAgICAgICAgICAgICAgICAgIC8vIEJlIGxlbmllbnQgYWJvdXQgbW92aW5nIG91dHNpZGUgb2YgYnV0dG9ucwotICAgICAgICAgICAgICAgICAgICBpbnQgc2xvcCA9IG1Ub3VjaFNsb3A7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgoeCA8IDAgLSBzbG9wKSB8fCAoeCA+PSBnZXRXaWR0aCgpICsgc2xvcCkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoeSA8IDAgLSBzbG9wKSB8fCAoeSA+PSBnZXRIZWlnaHQoKSArIHNsb3ApKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghcG9pbnRJblZpZXcoeCwgeSwgbVRvdWNoU2xvcCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE91dHNpZGUgYnV0dG9uCiAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVUYXBDYWxsYmFjaygpOwogICAgICAgICAgICAgICAgICAgICA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1NFVCkgPT0gMCkgeworICAgICAgICAgICAgICAgIGlmICgobVJpZ2h0IC0gbUxlZnQpICE9IG1QcmV2V2lkdGggJiYgKG1Cb3R0b20gLSBtVG9wKSAhPSBtUHJldkhlaWdodCkgeworICAgICAgICAgICAgICAgICAgICBtUHJldldpZHRoID0gbVJpZ2h0IC0gbUxlZnQ7CisgICAgICAgICAgICAgICAgICAgIG1QcmV2SGVpZ2h0ID0gbUJvdHRvbSAtIG1Ub3A7CisgICAgICAgICAgICAgICAgICAgIG1QaXZvdFggPSAoZmxvYXQpIG1QcmV2V2lkdGggLyAyZjsKKyAgICAgICAgICAgICAgICAgICAgbVBpdm90WSA9IChmbG9hdCkgbVByZXZIZWlnaHQgLyAyZjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTWF0cml4LnJlc2V0KCk7CisgICAgICAgICAgICBpZiAoIW5vbnplcm8obVJvdGF0aW9uWCkgJiYgIW5vbnplcm8obVJvdGF0aW9uWSkpIHsKKyAgICAgICAgICAgICAgICBtTWF0cml4LnNldFRyYW5zbGF0ZShtVHJhbnNsYXRpb25YLCBtVHJhbnNsYXRpb25ZKTsKKyAgICAgICAgICAgICAgICBtTWF0cml4LnByZVJvdGF0ZShtUm90YXRpb24sIG1QaXZvdFgsIG1QaXZvdFkpOworICAgICAgICAgICAgICAgIG1NYXRyaXgucHJlU2NhbGUobVNjYWxlWCwgbVNjYWxlWSwgbVBpdm90WCwgbVBpdm90WSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChtQ2FtZXJhID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUNhbWVyYSA9IG5ldyBDYW1lcmEoKTsKKyAgICAgICAgICAgICAgICAgICAgbWF0cml4M0QgPSBuZXcgTWF0cml4KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1DYW1lcmEuc2F2ZSgpOworICAgICAgICAgICAgICAgIG1NYXRyaXgucHJlU2NhbGUobVNjYWxlWCwgbVNjYWxlWSwgbVBpdm90WCwgbVBpdm90WSk7CisgICAgICAgICAgICAgICAgbUNhbWVyYS5yb3RhdGVYKG1Sb3RhdGlvblgpOworICAgICAgICAgICAgICAgIG1DYW1lcmEucm90YXRlWShtUm90YXRpb25ZKTsKKyAgICAgICAgICAgICAgICBtQ2FtZXJhLnJvdGF0ZVooLW1Sb3RhdGlvbik7CisgICAgICAgICAgICAgICAgbUNhbWVyYS5nZXRNYXRyaXgobWF0cml4M0QpOworICAgICAgICAgICAgICAgIG1hdHJpeDNELnByZVRyYW5zbGF0ZSgtbVBpdm90WCwgLW1QaXZvdFkpOworICAgICAgICAgICAgICAgIG1hdHJpeDNELnBvc3RUcmFuc2xhdGUobVBpdm90WCArIG1UcmFuc2xhdGlvblgsIG1QaXZvdFkgKyBtVHJhbnNsYXRpb25ZKTsKKyAgICAgICAgICAgICAgICBtTWF0cml4LnBvc3RDb25jYXQobWF0cml4M0QpOworICAgICAgICAgICAgICAgIG1DYW1lcmEucmVzdG9yZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU1hdHJpeERpcnR5ID0gZmFsc2U7CisgICAgICAgICAgICBtTWF0cml4SXNJZGVudGl0eSA9IG1NYXRyaXguaXNJZGVudGl0eSgpOworICAgICAgICAgICAgbUludmVyc2VNYXRyaXhEaXJ0eSA9IHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBVdGlsaXR5IG1ldGhvZCB0byByZXRyaWV2ZSB0aGUgaW52ZXJzZSBvZiB0aGUgY3VycmVudCBtTWF0cml4IHByb3BlcnR5LgorICAgICAqIFdlIGNhY2hlIHRoZSBtYXRyaXggdG8gYXZvaWQgcmVjYWxjdWxhdGluZyBpdCB3aGVuIHRyYW5zZm9ybSBwcm9wZXJ0aWVzCisgICAgICogaGF2ZSBub3QgY2hhbmdlZC4KKyAgICAgKgorICAgICAqIEByZXR1cm4gVGhlIGludmVyc2Ugb2YgdGhlIGN1cnJlbnQgbWF0cml4IG9mIHRoaXMgdmlldy4KKyAgICAgKi8KKyAgICBmaW5hbCBNYXRyaXggZ2V0SW52ZXJzZU1hdHJpeCgpIHsKKyAgICAgICAgdXBkYXRlTWF0cml4KCk7CisgICAgICAgIGlmIChtSW52ZXJzZU1hdHJpeERpcnR5KSB7CisgICAgICAgICAgICBpZiAobUludmVyc2VNYXRyaXggPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1JbnZlcnNlTWF0cml4ID0gbmV3IE1hdHJpeCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU1hdHJpeC5pbnZlcnQobUludmVyc2VNYXRyaXgpOworICAgICAgICAgICAgbUludmVyc2VNYXRyaXhEaXJ0eSA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtSW52ZXJzZU1hdHJpeDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGUgZGVncmVlcyB0aGF0IHRoZSB2aWV3IGlzIHJvdGF0ZWQgYXJvdW5kIHRoZSBwaXZvdCBwb2ludC4KKyAgICAgKgorICAgICAqIEBzZWUgI2dldFBpdm90WCgpCisgICAgICogQHNlZSAjZ2V0UGl2b3RZKCkKKyAgICAgKiBAcmV0dXJuIFRoZSBkZWdyZWVzIG9mIHJvdGF0aW9uLgorICAgICAqLworICAgIHB1YmxpYyBmbG9hdCBnZXRSb3RhdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIG1Sb3RhdGlvbjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXRzIHRoZSBkZWdyZWVzIHRoYXQgdGhlIHZpZXcgaXMgcm90YXRlZCBhcm91bmQgdGhlIHBpdm90IHBvaW50LiBJbmNyZWFzaW5nIHZhbHVlcworICAgICAqIHJlc3VsdCBpbiBjbG9ja3dpc2Ugcm90YXRpb24uCisgICAgICoKKyAgICAgKiBAcGFyYW0gcm90YXRpb24gVGhlIGRlZ3JlZXMgb2Ygcm90YXRpb24uC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ZlcnRpY2FsIGF4aXMgdGhyb3VnaCB0aGUgcGl2b3QgcG9pbnQuCisgICAgICogSW5jcmVhc2luZyB2YWx1ZXMgcmVzdWx0IGluIGNvdW50ZXItY2xvY2t3aXNlIHJvdGF0aW9uIGZyb20gdGhlIHZpZXdwb2ludCBvZiBsb29raW5nCisgICAgICogZG93biB0aGUgeSBheGlzLgorICAgICAqCisgICAgICogQHBhcmFtIHJvdGF0aW9uWSBUaGUgZGVncmVlcyBvZiBZIHJvdGF0aW9uLgorICAgICAqIEBzZWUgI2dldFBpdm90WCgpCisgICAgICogQHNlZSAjZ2V0UGl2b3RZKCkKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRSb3RhdGlvblkoZmxvYXQgcm90YXRpb25ZKSB7CisgICAgICAgIGlmIChtUm90YXRpb25ZICE9IHJvdGF0aW9uWSkgeworICAgICAgICAgICAgLy8gRG91YmxlLWludmFsaWRhdGlvbiBpcyBuZWNlc3NhcnkgdG8gY2FwdHVyZSB2aWV3J3Mgb2xkIGFuZCBuZXcgYXJlYXMKKyAgICAgICAgICAgIGludmFsaWRhdGUoZmFsc2UpOworICAgICAgICAgICAgbVJvdGF0aW9uWSA9IHJvdGF0aW9uWTsKKyAgICAgICAgICAgIG1NYXRyaXhEaXJ0eSA9IHRydWU7CisgICAgICAgICAgICBtUHJpdmF0ZUZsYWdzIHw9IERSQVdOOyAvLyBmb3JjZSBhbm90aGVyIGludmFsaWRhdGlvbiB3aXRoIHRoZSBuZXcgb3JpZW50YXRpb24KKyAgICAgICAgICAgIGludmFsaWRhdGUoZmFsc2UpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhlIGRlZ3JlZXMgdGhhdCB0aGUgdmlldyBpcyByb3RhdGVkIGFyb3VuZCB0aGUgaG9yaXpvbnRhbCBheGlzIHRocm91Z2ggdGhlIHBpdm90IHBvaW50LgorICAgICAqCisgICAgICogQHNlZSAjZ2V0UGl2b3RYKCkKKyAgICAgKiBA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gICAgICAgICAvLyBEb3VibGUtaW52YWxpZGF0aW9uIGlzIG5lY2Vzc2FyeSB0byBjYXB0dXJlIHZpZXcncyBvbGQgYW5kIG5ldyBhcmVhcworICAgICAgICAgICAgaW52YWxpZGF0ZShmYWxzZSk7CisgICAgICAgICAgICBtUGl2b3RYID0gcGl2b3RYOworICAgICAgICAgICAgbU1hdHJpeERpcnR5ID0gdHJ1ZTsKKyAgICAgICAgICAgIG1Qcml2YXRlRmxhZ3MgfD0gRFJBV047IC8vIGZvcmNlIGFub3RoZXIgaW52YWxpZGF0aW9uIHdpdGggdGhlIG5ldyBvcmllbnRhdGlvbgorICAgICAgICAgICAgaW52YWxpZGF0ZShmYWxzZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGUgeSBsb2NhdGlvbiBvZiB0aGUgcG9pbnQgYXJvdW5kIHdoaWNoIHRoZSB2aWV3IGlzIHtAbGluayAjc2V0Um90YXRpb24oZmxvYXQpIHJvdGF0ZWR9CisgICAgICogYW5kIHtAbGluayAjc2V0U2NhbGVZKGZsb2F0KSBzY2FsZWR9LgorICAgICAqCisgICAgICogQHNlZSAjZ2V0Um90YXRpb24oKQorICAgICAqIEBzZWUgI2dldFNjYWxlWCgpCisgICAgICogQHNlZSAjZ2V0U2NhbGVZKCkKKyAgICAgKiBAc2VlICNnZXRQaXZvdFkoKQorICAgICAqIEByZXR1cm4gVGhlIHkgbG9jYXRpb24gb2YgdGhlIHBpdm90IHBvaW50LgorICAgICAqLworICAgIHB1YmxpYyBmbG9hdCBnZXRQaXZvdFkoKSB7CisgICAgICAgIHJldHVybiBtUGl2b3RZOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIHkgbG9jYXRpb24gb2YgdGhlIHBvaW50IGFyb3VuZCB3aGljaCB0aGUgdmlldyBpcyB7QGxpbmsgI3NldFJvdGF0aW9uKGZsb2F0KSByb3RhdGVkfQorICAgICAqIGFuZCB7QGxpbmsgI3NldFNjY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KyAgICAgICAgICAgICAgICAgICAgZmluYWwgUmVjdCByID0gbUF0dGFjaEluZm8ubVRtcEludmFsUmVjdDsKKyAgICAgICAgICAgICAgICAgICAgaW50IG1pblRvcDsKKyAgICAgICAgICAgICAgICAgICAgaW50IHlMb2M7CisgICAgICAgICAgICAgICAgICAgIGlmICh0b3AgPCBtVG9wKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtaW5Ub3AgPSB0b3A7CisgICAgICAgICAgICAgICAgICAgICAgICB5TG9jID0gdG9wIC0gbVRvcDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pblRvcCA9IG1Ub3A7CisgICAgICAgICAgICAgICAgICAgICAgICB5TG9jID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByLnNldCgwLCB5TG9jLCBtUmlnaHQgLSBtTGVmdCwgbUJvdHRvbSAtIG1pblRvcCk7CisgICAgICAgICAgICAgICAgICAgIHAuaW52YWxpZGF0ZUNoaWxkKHRoaXMsIHIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gRG91YmxlLWludmFsaWRhdGlvbiBpcyBuZWNlc3NhcnkgdG8gY2FwdHVyZSB2aWV3J3Mgb2xkIGFuZCBuZXcgYXJlYXMKKyAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCB3aWR0aCA9IG1SaWdodCAtIG1MZWZ0OworICAgICAgICAgICAgaW50IG9sZEhlaWdodCA9IG1Cb3R0b20gLSBtVG9wOworCisgICAgICAgICAgICBtVG9wID0gdG9wOworCisgICAgICAgICAgICBvblNpemVDaGFuZ2VkKHdpZHRoLCBtQm90dG9tIC0gbVRvcCwgd2lkdGgsIG9sZEhlaWdodCk7CisKKyAgICAgICAgICAgIGlmICghbU1hdHJpeElzSWRlbnR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XJlbnQgcCA9IG1QYXJlbnQ7CisgICAgICAgICAgICAgICAgaWYgKHAgIT0gbnVsbCAmJiBtQXR0YWNoSW5mbyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgciA9IG1BdHRhY2hJbmZvLm1UbXBJbnZhbFJlY3Q7CisgICAgICAgICAgICAgICAgICAgIGludCBtYXhCb3R0b207CisgICAgICAgICAgICAgICAgICAgIGlmIChib3R0b20gPCBtQm90dG9tKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtYXhCb3R0b20gPSBtQm90dG9tOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbWF4Qm90dG9tID0gYm90dG9tOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHIuc2V0KDAsIDAsIG1SaWdodCAtIG1MZWZ0LCBtYXhCb3R0b20gLSBtVG9wKTsKKyAgICAgICAgICAgICAgICAgICAgcC5pbnZhbGlkYXRlQ2hpbGQodGhpcywgcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBEb3VibGUtaW52YWxpZGF0aW9uIGlzIG5lY2Vzc2FyeSB0byBjYXB0dXJlIHZpZXcncyBvbGQgYW5kIG5ldyBhcmVhcworICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50IHdpZHRoID0gbVJpZ2h0IC0gbUxlZnQ7CisgICAgICAgICAgICBpbnQgb2xkSGVpZ2h0ID0gbUJvdHRvbSAtIG1Ub3A7CisKKyAgICAgICAgICAgIG1Cb3R0b20gPSBib3R0b207CisKKyAgICAgICAgICAgIG9uU2l6ZUNoYW5nZWQod2lkdGgsIG1Cb3R0b20gLSBtVG9wLCB3aWR0aCwgb2xkSGVpZ2h0KTsKKworICAgICAgICAgICAgaWYgKCFtTWF0cml4SXNJZG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XJlbnQgcCA9IG1QYXJlbnQ7CisgICAgICAgICAgICAgICAgaWYgKHAgIT0gbnVsbCAmJiBtQXR0YWNoSW5mbyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgciA9IG1BdHRhY2hJbmZvLm1UbXBJbnZhbFJlY3Q7CisgICAgICAgICAgICAgICAgICAgIGludCBtaW5MZWZ0OworICAgICAgICAgICAgICAgICAgICBpbnQgeExvYzsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxlZnQgPCBtTGVmdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbWluTGVmdCA9IGxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICB4TG9jID0gbGVmdCAtIG1MZWZ0OworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbWluTGVmdCA9IG1MZWZ0OworICAgICAgICAgICAgICAgICAgICAgICAgeExvYyA9IDA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgci5zZXQoeExvYywgMCwgbVJpZ2h0IC0gbWluTGVmdCwgbUJvdHRvbSAtIG1Ub3ApOworICAgICAgICAgICAgICAgICAgICBwLmludmFsaWRhdGVDaGlsZCh0aGlzLCByKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIERvdWJsZS1pbnZhbGlkYXRpb24gaXMgbmVjZXNzYXJ5IHRvIGNhcHR1cmUgdmlldydzIG9sZCBhbmQgbmV3IGFyZWFzCisgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQgb2xkV2lkdGggPSBtUmlnaHQgLSBtTGVmdDsKKyAgICAgICAgICAgIGludCBoZWlnaHQgPSBtQm90dG9tIC0gbVRvcDsKKworICAgICAgICAgICAgbUxlZnQgPSBsZWZ0OworCisgICAgICAgICAgICBvblNpemVDa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ICAgICAgICAgIHVwZGF0ZU1hdHJpeCgpOworICAgICAgICAgICAgaWYgKG1NYXRyaXhJc0lkZW50aXR5KSB7CisgICAgICAgICAgICAgICAgZmluYWwgVmlld1BhcmVudCBwID0gbVBhcmVudDsKKyAgICAgICAgICAgICAgICBpZiAocCAhPSBudWxsICYmIG1BdHRhY2hJbmZvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgUmVjdCByID0gbUF0dGFjaEluZm8ubVRtcEludmFsUmVjdDsKKyAgICAgICAgICAgICAgICAgICAgaW50IG1heFJpZ2h0OworICAgICAgICAgICAgICAgICAgICBpZiAocmlnaHQgPCBtUmlnaHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1heFJpZ2h0ID0gbVJpZ2h0OworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbWF4UmlnaHQgPSByaWdodDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByLnNldCgwLCAwLCBtYXhSaWdodCAtIG1MZWZ0LCBtQm90dG9tIC0gbVRvcCk7CisgICAgICAgICAgICAgICAgICAgIHAuaW52YWxpZGF0ZUNoaWxkKHRoaXMsIHIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gRG91YmxlLWludmFsaWRhdGlvbiBpcyBuZWNlc3NhcnkgdG8gY2FwdHVyZSB2aWV3J3Mgb2xkIGFuZCBuZXcgYXJlYXMKKyAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCBvbGRXaWR0aCA9IG1SaWdodCAtIG1MZWZ0OworICAgICAgICAgICAgaW50IGhlaWdodCA9IG1Cb3R0b20gLSBtVG9wOworCisgICAgICAgICAgICBtUmlnaHQgPSByaWdodDsKKworICAgICAgICAgICAgb25TaXplQ2hhbmdlZChtUmlna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b3ApOwogICAgIH0KIAogICAgIC8qKgpAQCAtNDk1Nyw4ICs1OTAzLDM5IEBACiAgICAgICogQHBhcmFtIG9mZnNldCB0aGUgbnVtYmVyIG9mIHBpeGVscyB0byBvZmZzZXQgdGhlIHZpZXcgYnkKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBvZmZzZXRUb3BBbmRCb3R0b20oaW50IG9mZnNldCkgewotICAgICAgICBtVG9wICs9IG9mZnNldDsKLSAgICAgICAgbUJvdHRvbSArPSBvZmZzZXQ7CisgICAgICAgIGlmIChvZmZzZXQgIT0gMCkgeworICAgICAgICAgICAgdXBkYXRlTWF0cml4KCk7CisgICAgICAgICAgICBpZiAobU1hdHJpeElzSWRlbnRpdHkpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBWaWV3UGFyZW50IHAgPSBtUGFyZW50OworICAgICAgICAgICAgICAgIGlmIChwICE9IG51bGwgJiYgbUF0dGFjaEluZm8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBSZWN0IHIgPSBtQXR0YWNoSW5mby5tVG1wSW52YWxSZWN0OworICAgICAgICAgICAgICAgICAgICBpbnQgbWluVG9wOworICAgICAgICAgICAgICAgICAgICBpbnQgbWF4Qm90dG9tOworICAgICAgICAgICAgICAgICAgICBpbnQgeUxvYzsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG9mZnNldCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pblRvcCA9IG1Ub3AgKyBvZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICBtYXhCb3R0b20gPSBtQm90dG9tOworICAgICAgICAgICAgICAgICAgICAgICAgeUxvYyA9IG9mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pblRvcCA9IG1Ub3A7CisgICAgICAgICAgICAgICAgICAgICAgICBtYXhCb3R0b20gPSBtQm90dG9tICsgb2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgeUxvYyA9IDA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgci5zZXQoMCwgeUxvYywgbVJpZ2h0IC0gbUxlZnQsIG1heEJvdHRvbSAtIG1pblRvcCk7CisgICAgICAgICAgICAgICAgICAgIHAuaW52YWxpZGF0ZUNoaWxkKHRoaXMsIHIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaW52YWxpZGF0ZShmYWxzZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1Ub3AgKz0gb2Zmc2V0OworICAgICAgICAgICAgbUJvdHRvbSArPSBvZmZzZXQ7CisKKyAgICAgICAgICAgIGlmICghbU1hdHJpeElzSWRlbnRpdHkpIHsKKyAgICAgICAgICAgICAgICBtUHJpdmF0ZUZsYWdzIHw9IERSQVdOOyAvLyBmb3JjZSBhbm90aGVyIGludmFsaWRhdGlvbiB3aXRoIHRoZSBuZXcgb3JpZW50YXRpb24KKyAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKGZhbHNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQogICAgIH0KIAogICAgIC8qKgpAQCAtNDk2Nyw4ICs1OTQ0LDM2IEBACiAgICAgICogQHBhcmFtIG9mZnNldCB0aGUgbnVtZXIgb2YgcGl4ZWxzIHRvIG9mZnNldCB0aGUgdmlldyBieQogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIG9mZnNldExlZnRBbmRSaWdodChpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIG1MZWZ0ICs9IG9mZnNldDsKLSAgICAgICAgbVJpZ2h0ICs9IG9mZnNldDsKKyAgICAgICAgaWYgKG9mZnNldCAhPSAwKSB7CisgICAgICAgICAgICB1cGRhdGVNYXRyaXgoKTsKKyAgICAgICAgICAgIGlmIChtTWF0cml4SXNJZGVudGl0eSkgeworICAgICAgICAgICAgICAgIGZpbmFsIFZpZXdQYXJlbnQgcCA9IG1QYXJlbnQ7CisgICAgICAgICAgICAgICAgaWYgKHAgIT0gbnVsbCAmJiBtQXR0YWNoSW5mbyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgciA9IG1BdHRhY2hJbmZvLm1UbXBJbnZhbFJlY3Q7CisgICAgICAgICAgICAgICAgICAgIGludCBtaW5MZWZ0OworICAgICAgICAgICAgICAgICAgICBpbnQgbWF4UmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtaW5MZWZ0ID0gbUxlZnQgKyBvZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICBtYXhSaWdodCA9IG1SaWdodDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pbkxlZnQgPSBtTGVmdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1heFJpZ2h0ID0gbVJpZ2h0ICsgb2Zmc2V0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHIuc2V0KDAsIDAsIG1heFJpZ2h0IC0gbWluTGVmdCwgbUJvdHRvbSAtIG1Ub3ApOworICAgICAgICAgICAgICAgICAgICBwLmludmFsaWRhdGVDaGlsZCh0aGlzLCByKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludmFsaWRhdGUoZmFsc2UpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtTGVmdCArPSBvZmZzZXQ7CisgICAgICAgICAgICBtUmlnaHQgKz0gb2Zmc2V0OworCisgICAgICAgICAgICBpZiAoIW1NYXRyaXhJc0lkZW50aXR5KSB7CisgICAgICAgICAgICAgICAgbVByaXZhdGVGbGFncyB8PSBEUkFXTjsgLy8gZm9yY2UgYW5vdGhlciBpbnZhbGlkYXRpb24gd2l0aCB0aGUgbmV3IG9yaWVudGF0aW9uCisgICAgICAgICAgICAgICAgaW52YWxpZGF0ZShmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTUyMTMsNyArNjIxOCw4IEBACiAgICAgICAgICAgICBWaWV3RGVidWcudHJhY2UodGhpcywgVmlld0RlYnVnLkhpZXJhcmNoeVRyYWNlVHlwZS5JTlZBTElEQVRFKTsKICAgICAgICAgfQogCi0gICAgICAgIGlmICgobVByaXZhdGVGbGFncyAmIChEUkFXTiB8IEhBU19CT1VORFMpKSA9PSAoRFJBV04gfCBIQVNfQk9VTkRTKSkgeworICAgICAgICBpZiAoKG1Qcml2YXRlRmxhZ3MgJiAoRFJBV04gfCBIQVNfQk9VTkRTKSkgPT0gKERSQVdOIHwgSEFTX0JPVU5EUykgfHwKKyAgICAgICAgICAgICAgICAobVByaXZhdGVGbGFncyAmIERSQVdJTkdfQ0FDSEVfVkFMSUQpID09IERSQVdJTkdfQ0FDSEVfVkFMSUQpIHsKICAgICAgICAgICAgIG1Qcml2YXRlRmxhZ3MgJj0gfkRSQVdJTkdfQ0FDSEVfVkFMSUQ7CiAgICAgICAgICAgICBmaW5hbCBWaWV3UGFyZW50IHAgPSBtUGFyZW50OwogICAgICAgICAgICAgZmluYWwgQXR0YWNoSW5mbyBhaSA9IG1BdHRhY2hJbmZvOwpAQCAtNTI0NCw3ICs2MjUwLDggQEAKICAgICAgICAgICAgIFZpZXdEZWJ1Zy50cmFjZSh0aGlzLCBWaWV3RGVidWcuSGllcmFyY2h5VHJhY2VUeXBlLklOVkFMSURBVEUpOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKChtUHJpdmF0ZUZsYWdzICYgKERSQVdOIHwgSEFTX0JPVU5EUykpID09IChEUkFXTiB8IEhBU19CT1VORFMpKSB7CisgICAgICAgIGlmICgobVByaXZhdGVGbGFncyAmIChEUkFXTiB8IEhBU19CT1VORFMpKSA9PSAoRFJBV04gfCBI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BU0spID09IE9QQVFVRV9NQVNLOworICAgICAgICByZXR1cm4gKG1Qcml2YXRlRmxhZ3MgJiBPUEFRVUVfTUFTSykgPT0gT1BBUVVFX01BU0sgJiYKKyAgICAgICAgICAgICAgICAobUFscGhhID49IDEuMGYgLSBWaWV3Q29uZmlndXJhdGlvbi5BTFBIQV9USFJFU0hPTEQpOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBjb21wdXRlT3BhcXVlRmxhZ3MoKSB7CkBAIC02MDA3LDkgKzcwNDAsOCBAQAogICAgICAqIEBzZWUgYW5kcm9pZC53aWRnZXQuU2Nyb2xsQmFyRHJhd2FibGUKICAgICAgKiBAaGlkZQogICAgICAqLwotICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhd0hvcml6b250YWxTY3JvbGxCYXIoQ2FudmFzIGNhbnZhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERyYXdhYmxlIHNjcm9sbEJhciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsLCBpbnQgdCwgaW50IHIsIGludCBiKSB7CisgICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3SG9yaXpvbnRhbFNjcm9sbEJhcihDYW52YXMgY2FudmFzLCBEcmF3YWJsZSBzY3JvbGxCYXIsCisgICAgICAgICAgICBpbnQgbCwgaW50IHQsIGludCByLCBpbnQgYikgewogICAgICAgICBzY3JvbGxCYXIuc2V0Qm91bmRzKGwsIHQsIHIsIGIpOwogICAgICAgICBzY3JvbGxCYXIuZHJhdyhjYW52YXMpOwogICAgIH0KQEAgLTYwMjgsOSArNzA2MCw4IEBACiAgICAgICogQHNlZSBhbmRyb2lkLndpZGdldC5TY3JvbGxCYXJEcmF3YWJsZQogICAgICAqIEBoaWRlCiAgICAgICovCi0gICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3VmVydGljYWxTY3JvbGxCYXIoQ2FudmFzIGNhbnZhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEcmF3YWJsZSBzY3JvbGxCYXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGwsIGludCB0LCBpbnQgciwgaW50IGIpIHsKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXdWZXJ0aWNhbFNjcm9sbEJhcihDYW52YXMgY2FudmFzLCBEcmF3YWJsZSBzY3JvbGxCYXIsCisgICAgICAgICAgICBpbnQgbCwgaW50IHQsIGludCByLCBpbnQgYikgewogICAgICAgICBzY3JvbGxCYXIuc2V0Qm91bmRzKGwsIHQsIHIsIGIpOwogICAgICAgICBzY3JvbGxCYXIuZHJhdyhjYW52YXMpOwogICAgIH0KQEAgLTYzODQsNiArNzQxNSw1NiBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIDxwPlJldHVybnMgYSBkaXNwbGF5IGxpc3QgdGhhdCBjYW4gYmUgdXNlZCB0byBkcmF3IHRoaXMgdmlldyBhZ2FpbgorICAgICAqIHdpdGhvdXQgZXhlY3V0aW5nIGl0cyBkcmF3IG1ldGhvZC48L3A+CisgICAgICogCisgICAgICogQHJldHVybiBBIERpc3BsYXlMaXN0IHJlYWR5IHRvIHJlcGxheSwgb3IgbnVsbCBpZiBjYWNoaW5nIGlzIG5vdCBlbmFibGVkLgorICAgICAqLworICAgIERpc3BsYXlMaXN0IGdldERpc3BsYXlMaXN0KCkgeworICAgICAgICBpZiAoKG1WaWV3RmxhZ3MgJiBXSUxMX05PVF9DQUNIRV9EUkFXSU5HKSA9PSBXSUxMX05PVF9DQUNIRV9EUkFXSU5HKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBpZiAobUF0dGFjaEluZm8gPT0gbnVsbCB8fCBtQXR0YWNoSW5mby5tSGFyZHdhcmVSZW5kZXJlciA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICgobVZpZXdGbGFncyAmIERSQVdJTkdfQ0FDSEVfRU5BQkxFRCkgPT0gRFJBV0lOR19DQUNIRV9FTkFCTEVEICYmCisgICAgICAgICAgICAgICAgKChtUHJpdmF0ZUZsYWdzICYgRFJBV0lOR19DQUNIRV9WQUxJRCkgPT0gMCB8fCBtRGlzcGxheUxpc3QgPT0gbnVsbCkpIHsKKworICAgICAgICAgICAgbURpc3BsYXlMaXN0ID0gbUF0dGFjaEluZm8ubUhhcmR3YXJlUmVuZGVyZXIuY3JlYXRlRGlzcGxheUxpc3QoKTsKKworICAgICAgICAgICAgZmluYWwgSGFyZHdhcmVDYW52YXMgY2FudmFzID0gbURpc3BsYXlMaXN0LnN0YXJ0KCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGludCB3aWR0aCA9IG1SaWdodCAtIG1MZWZ0OworICAgICAgICAgICAgICAgIGludCBoZWlnaHQgPSBtQm90dG9tIC0gbVRvcDsKKworICAgICAgICAgICAgICAgIGNhbnZhcy5zZXRWaWV3cG9ydCh3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAgICBjYW52YXMub25QcmVEcmF3KCk7CisKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcmVzdG9yZUNvdW50ID0gY2FudmFzLnNhdmUoKTsKKworICAgICAgICAgICAgICAgIG1Qcml2YXRlRmxhZ3MgfD0gRFJBV04gfCBEUkFXSU5HX0NBQ0hFX1ZBTElEOworICAgIAorICAgICAgICAgICAgICAgIC8vIEZhc3QgcGF0aCBmb3IgbGF5b3V0cyB3aXRoIG5vIGJhY2tncm91bmRzCisgICAgICAgICAgICAgICAgaWYgKChtUHJpdmF0ZUZsYWdzICYgU0tJUF9EUkFXKSA9PSBTS0lQX0RSQVcpIHsKKyAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVGbGFncyAmPSB+RElSVFlfTUFTSzsKKyAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2hEcmF3KGNhbnZhcyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZHJhdyhjYW52YXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAKKyAgICAgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQocmVzdG9yZUNvdW50KTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgY2FudmFzLm9uUG9zdERyYXcoKTsKKworICAgICAgICAgICAgICAgIG1EaXNwbGF5TGlzdC5lbmQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBtRGlzcGxheUxpc3Q7CisgICAgfQorCisgICAgLyoqCiAgICAgICogPHA+Q2FsbGluZyB0aGlzIG1ldGhvZCBpcyBlcXVpdmFsZW50IHRvIGNhbGxpbmcgPGNvZGU+Z2V0RHJhd2luZ0NhY2hlKGZhbHNlKTwvY29kZT4uPC9wPgogICAgICAqIAogICAgICAqIEByZXR1cm4gQSBub24tc2NhbGVkIGJpdG1hcCByZXByZXNlbnRpbmcgdGhpcyB2aWV3IG9yIG51bGwgaWYgY2FjaGUgaXMgZGlzYWJsZWQuCkBAIC02NDI4LDggKzc1MDksNyBAQAogICAgICAgICBpZiAoKG1WaWV3RmxhZ3MgJiBEUkFXSU5HX0NBQ0hFX0VOQUJMRUQpID09IERSQVdJTkdfQ0FDSEVfRU5BQkxFRCkgewogICAgICAgICAgICAgYnVpbGREcmF3aW5nQ2FjaGUoYXV0b1NjYWxlKTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gYXV0b1NjYWxlID8gKG1EcmF3aW5nQ2FjaGUgPT0gbnVsbCA/IG51bGwgOiBtRHJhd2luZ0NhY2hlLmdldCgpKSA6Ci0gICAgICAgICAgICAgICAgKG1VbnNjYWxlZERyYXdpbmdDYWNoZSA9PSBudWxsID8gbnVsbCA6IG1VbnNjYWxlZERyYXdpbmdDYWNoZS5nZXQoKSk7CisgIC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R0aCB8fCBiaXRtYXAuZ2V0SGVpZ2h0KCkgIT0gaGVpZ2h0KSB7CiAgICAgICAgICAgICAgICAgQml0bWFwLkNvbmZpZyBxdWFsaXR5OwpAQCAtNjU3OCw5ICs3NjU5LDkgQEAKICAgICAgICAgICAgICAgICAgICAgYml0bWFwID0gQml0bWFwLmNyZWF0ZUJpdG1hcCh3aWR0aCwgaGVpZ2h0LCBxdWFsaXR5KTsKICAgICAgICAgICAgICAgICAgICAgYml0bWFwLnNldERlbnNpdHkoZ2V0UmVzb3VyY2VzKCkuZ2V0RGlzcGxheU1ldHJpY3MoKS5kZW5zaXR5RHBpKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKGF1dG9TY2FsZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbURyYXdpbmdDYWNoZSA9IG5ldyBTb2Z0UmVmZXJlbmNlPEJpdG1hcD4oYml0bWFwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1EcmF3aW5nQ2FjaGUgPSBiaXRtYXA7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVW5zY2FsZWREcmF3aW5nQ2FjaGUgPSBuZXcgU29mdFJlZmVyZW5jZTxCaXRtYXA+KGJpdG1hcCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVW5zY2FsZWREcmF3aW5nQ2FjaGUgPSBiaXRtYXA7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaWYgKG9wYXF1ZSAmJiB0cmFuc2x1Y2VudFdpbmRvdykgYml0bWFwLnNldEhhc0FscGhhKGZhbHNlKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChPdXRPZk1lbW9yeUVycm9yIGUpIHsKQEAgLTY2MzAsNyArNzcxMSw5IEBACiAgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKC1tU2Nyb2xsWCwgLW1TY3JvbGxZKTsKIAogICAgICAgICAgICAgbVByaXZhdG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KChmbGFncyAmIEhhcHRpY0ZlZWRiYWNrQ29uc3RhbnRzLkZMQUdfSUdOT1JFX1ZJRVdfU0VUVElORykgPT0gMAogICAgICAgICAgICAgICAgICYmICFpc0hhcHRpY0ZlZWRiYWNrRW5hYmxlZCgpKSB7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIG1BdHRhY2hJbmZvLm1Sb290Q2FsbGJhY2tzLnBlcmZvcm1IYXB0aWNGZWVkYmFjaygKLSAgICAgICAgICAgICAgICBmZWVkYmFja0NvbnN0YW50LAotICAgICAgICAgICAgICAgIChmbGFncyZIYXB0aWNGZWVkYmFja0NvbnN0YW50cy5GTEFHX0lHTk9SRV9HTE9CQUxfU0VUVElORykgIT0gMCk7CisgICAgICAgIHJldHVybiBtQXR0YWNoSW5mby5tUm9vdENhbGxiYWNrcy5wZXJmb3JtSGFwdGljRmVlZGJhY2soZmVlZGJhY2tDb25zdGFudCwKKyAgICAgICAgICAgICAgICAoZmxhZ3MgJiBIYXB0aWNGZWVkYmFja0NvbnN0YW50cy5GTEFHX0lHTk9SRV9HTE9CQUxfU0VUVElORykgIT0gMCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogISEhIFRPRE86IHJlYWwgZG9jcworICAgICAqCisgICAgICogVGhlIGJhc2UgY2xhc3MgaW1wbGVtZW50YXRpb24gbWFrZXMgdGhlIHRodW1ibmFpbCB0aGUgc2FtZSBzaXplIGFuZCBhcHBlYXJhbmNlCisgICAgICogYXMgdGhlIHZpZXcgaXRzZWxmLCBhbmQgcG9zaXRpb25zIGl0IHdpdGggaXRzIGNlbnRlciBhdCB0aGUgdG91Y2ggcG9pbnQuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBEcmFnVGh1bWJuYWlsQnVpbGRlciB7CisgICAgICAgIHByaXZhdGUgZmluYWwgV2Vha1JlZmVyZW5jZTxWaWV3PiBtVmlldzsKKworICAgICAgICAvKioKKyA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yaWNzIGJ1dCBubyB2aWV3Iik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogRHJhdyB0aGUgdGh1bWJuYWlsIGltYWdlIGZvciB0aGUgdXBjb21pbmcgZHJhZy4gIFRoZSB0aHVtYm5haWwgY2FudmFzIHdhcworICAgICAgICAgKiBjcmVhdGVkIHdpdGggdGhlIGRpbWVuc2lvbnMgc3VwcGxpZWQgYnkgdGhlIG9uUHJvdmlkZVRodW1ibmFpbE1ldHJpY3MoKQorICAgICAgICAgKiBjYWxsYmFjay4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGNhbnZhcworICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgb25EcmF3VGh1bWJuYWlsKENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcgdmlldyA9IG1WaWV3LmdldCgpOworICAgICAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHZpZXcuZHJhdyhjYW52YXMpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBMb2cuZShWaWV3LlZJRVdfTE9HX1RBRywgIkFza2VkIHRvIGRyYXcgZHJhZyB0aHVtYiBidXQgbm8gdmlldyIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogRHJhZyBhbmQgZHJvcC4gIEFwcCBjYWxscyBzdGFydERyYWcoKSwgdGhlbiBjYWxsYmFja3MgdG8gdGhlIHRodW1ibmFpbCBidWlsZGVyJ3MKKyAgICAgKiBvblByb3ZpZGVUaHVtYm5haWxNZXRyaWNzKCkgYW5kIG9uRHJhd1RodW1ibmFpbCgpIG1ldGhvZHMgaGFwcGVuLCB0aGVuIHRoZSBkcmFnCisgICAgICogb3BlcmF0aW9uIGlzIGhhbmRlZCBvdmVyIHRvIHRoZSBPUy4KKyAgICAgKiAhISEgVE9ETzogcmVhbCBkb2NzCisgICAgICovCisgICAgcHVibGljIGZpbmFsIGJvb2xlYW4gc3RhcnREcmFnKENsaXBEYXRhIGRhdGEsIERyYWdUaHVtYm5haWxCdWlsZGVyIHRodW1iQnVpbGRlciwKKyAgICAgICAgICAgIGJvb2xlYW4gbXlXaW5kb3dPbmx5KSB7CisgICAgICAgIGlmIChWaWV3RGVidWcuREVCVUdfRFJBRykgeworICAgICAgICAgICAgTG9nLmQoVklFV19MT0dfVEFHLCAic3RhcnREcmFnOiBkYXRhPSIgKyBkYXRhICsgIiBsb2NhbD0iICsgbXlXaW5kb3dPbmx5KTsKKyAgICAgICAgfQorICAgICAgICBib29sZWFuIG9rYXkgPSBmYWxzZTsKKworICAgICAgICBQb2ludCB0aHVtYlNpemUgPSBuZXcgUG9pbnQoKTsKKyAgICAgICAgUG9pbnQgdGh1bWJUb3VjaFBvaW50ID0gbmV3IFBvaW50KCk7CisgICAgICAgIHRodW1iQnVpbGRlci5vblByb3ZpZGVUaHVtYm5haWxNZXRyaWNzKHRodW1iU2l6ZSwgdGh1bWJUb3VjaFBvaW50KTsKKworICAgICAgICBpZiAoKHRodW1iU2l6ZS54IDwgMCkgfHwgKHRodW1iU2l6ZS55IDwgMCkgfHwKKyAgICAgICAgICAgICAgICAodGh1bWJUb3VjaFBvaW50LnggPCAwKSB8fCAodGh1bWJUb3VjaFBvaW50LnkgPCAwKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiRHJhZyB0aHVtYiBkaW1lbnNpb25zIG11c3Qgbm90IGJlIG5lZ2F0aXZlIik7CisgICAgICAgIH0KKworICAgICAgICBpZiAoVmlld0RlYnVnLkRFQlVHX0RSQUcpIHsKKyAgICAgICAgICAgIExvZy5kKFZJRVdfTE9HX1RBRywgImRyYWcgdGh1bWI6IHdpZHRoPSIgKyB0aHVtYlNpemUueCArICIgaGVpZ2h0PSIgKyB0aHVtYlNpemUueQorICAgICAgICAgICAgICAgICAgICArICIgdGh1bWJYPSIgKyB0aHVtYlRvdWNoUG9pbnQueCArICIgdGh1bWJZPSIgKyB0aHVtYlRvdWNoUG9pbnQueSk7CisgICAgICAgIH0KKyAgICAgICAgU3VyZmFjZSBzdXJmYWNlID0gbmV3IFN1cmZhY2UoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIElCaW5kZXIgdG9rZW4gPSBtQXR0YWNoSW5mby5tU2Vzc2lvbi5wcmVwYXJlRHJhZyhtQXR0YWNoSW5mby5tV2luZG93LAorICAgICAgICAgICAgICAgICAgICBteVdpbmRvd09ubHksIHRodW1iU2l6ZS54LCB0aHVtYlNpemUueSwgc3VyZmFjZSk7CisgICAgICAgICAgICBpZiAoVmlld0RlYnVnLkRFQlVHX0RSQUcpIExvZy5kKFZJRVdfTE9HX1RBRywgInByZXBhcmVEcmFnIHJldHVybmVkIHRva2VuPSIgKyB0b2tlbgorICAgICAgICAgICAgICAgICAgICArICIgc3VyZmFjZT0iICsgc3VyZmFjZSk7CisgICAgICAgICAgICBpZiAodG9rZW4gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIENhbnZhcyBjYW52YXMgPSBzdXJmYWNlLmxvY2tDYW52YXMobnVsbCk7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdDb2xvcigwLCBQb3J0ZXJEdWZmLk1vZGUuQ0xFQVIpOworICAgICAgICAgICAgICAgICAgICB0aHVtYkJ1aWxkZXIub25EcmF3VGh1bWJuYWlsKGNhbnZhcyk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgc3VyZmFjZS51bmxvY2tDYW52YXNBbmRQb3N0KGNhbnZhcyk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gcmVwdXJwb3NlICd0aHVtYlNpemUnIGZvciB0aGUgbGFzdCB0b3VjaCBwb2ludAorICAgICAgICAgICAgICAgIGdldFZpZXdSb290KCkuZ2V0TGFzdFRvdWNoUG9pbnQodGh1bWJTaXplKTsKKworICAgICAgICAgICAgICAgIG9rYXkgPSBtQXR0YWNoSW5mby5tU2Vzc2lvbi5wZXJmb3JtRHJhZyhtQXR0YWNoSW5mby5tV2luZG93LCB0b2tlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIChmbG9hdCkgdGh1bWJTaXplLngsIChmbG9hdCkgdGh1bWJTaXplLnksCisgICAgICAgICAgICAgICAgICAgICAgICAoZmxvYXQpIHRodW1iVG91Y2hQb2ludC54LCAoZmxvYXQpIHRodW1iVG91Y2hQb2ludC55LCBkYXRhKTsKKyAgICAgICAgICAgICAgICBpZiAoVmlld0RlYnVnLkRFQlVHX0RSQUcpIExvZy5kKFZJRVdfTE9HX1RBRywgInBlcmZvcm1EcmFnIHJldHVybmVkICIgKyBva2F5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFZJRVdfTE9HX1RBRywgIlVuYWJsZSB0byBpbml0aWF0ZSBkcmFnIiwgZSk7CisgICAgICAgICAgICBzdXJmYWNlLmRlc3Ryb3koKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBva2F5OworICAgIH0KKworICAgIC8qKgorICAgICAqIERyYWctYW5kLWRyb3AgZXZlbnQgZGlzcGF0Y2guICBUaGUgZXZlbnQuZ2V0QWN0aW9uKCkgdmVyYiBpcyBvbmUgb2YgdGhlIERyYWdFdmVudAorICAgICAqIGNvbnN0YW50cyBEUkFHX1NUQVJURURfRVZFTlQsIERSQUdfRVZFTlQsIERST1BfRVZFTlQsIGFuZCBEUkFHX0VOREVEX0VWRU5ULgorICAgICAqCisgICAgICogRm9yIERSQUdfU1RBUlRFRF9FVkVOVCwgZXZlbnQuZ2V0Q2xpcERlc2NyaXB0aW9uKCkgZGVzY3JpYmVzIHRoZSBjb250ZW50CisgICAgICogYmVpbmcg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zZXRNb3Rpb25FdmVudFNwbGl0dGluZ0VuYWJsZWQoYS5nZXRCb29sZWFuKGF0dHIsIGZhbHNlKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgUi5zdHlsZWFibGUuVmlld0dyb3VwX2FuaW1hdGVMYXlvdXRDaGFuZ2VzOgorICAgICAgICAgICAgICAgICAgICBib29sZWFuIGFuaW1hdGVMYXlvdXRDaGFuZ2VzID0gYS5nZXRCb29sZWFuKGF0dHIsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGVMYXlvdXRDaGFuZ2VzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRMYXlvdXRUcmFuc2l0aW9uKG5ldyBMYXlvdXRUcmFuc2l0aW9uKCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTQ2MSw2ICs1MTYsMTMgQEAKICAgICB9CiAKICAgICAvKioKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCisgICAgcHVibGljIEFjdGlvbk1vZGUgc3RhcnRBY3Rpb25Nb2RlRm9yQ2hpbGQoVmlldyBvcmlnaW5hbFZpZXcsIEFjdGlvbk1vZGUuQ2FsbGJhY2sgY2FsbGJhY2spIHsKKyAgICAgICAgcmV0dXJuIG1QYXJlbnQgIT0gbnVsbCA/IG1QYXJlbnQuc3RhcnRBY3Rpb25Nb2RlRm9yQ2hpbGQob3JpZ2luYWxWaWV3LCBjYWxsYmFjaykgOiBudWxsOworICAgIH0KKworICAgIC8qKgogICAgICAqIEZpbmQgdGhlIG5lYXJlc3QgdmlldyBpbiB0aGUgc3BlY2lmaWVkIGRpcmVjdGlvbiB0aGF0IHdhbnRzIHRvIHRha2UKICAgICAgKiBmb2N1cy4KICAgICAgKgpAQCAtNjk2LDYgKzc1OCwzMiBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICogQHBhcmFtIGNoaWxkCisgICAgICogQHBhcmFtIHZpc2liaWxpdHkKKyAgICAgKi8KKyAgICB2b2lkIG9uQ2hpbGRWaXNpYmlsaXR5Q2hhbmdlZChWaWV3IGNoaWxkLCBpbnQgdmlzaWJpbGl0eSkgeworICAgICAgICBpZiAobVRyYW5zaXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKHZpc2liaWxpdHkgPT0gVklTSUJMRSkgeworICAgICAgICAgICAgICAgIG1UcmFuc2l0aW9uLnNob3dDaGlsZCh0aGlzLCBjaGlsZCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1UcmFuc2l0aW9uLmhpZGVDaGlsZCh0aGlzLCBjaGlsZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodmlzaWJpbGl0eSAhPSBWSVNJQkxFKSB7CisgICAgICAgICAgICAgICAgLy8gT25seSB0cmFjayB0aGlzIG9uIGRpc2FwcGVhcmluZyB2aWV3cyAtIGFwcGVhcmluZyB2aWV3cyBhcmUgYWxyZWFkeSB2aXNpYmxlCisgICAgICAgICAgICAgICAgLy8gYW5kIGRvbid0IG5lZWQgc3BlY2lhbCBoYW5kbGluZyBkdXJpbmcgZHJhd0NoaWxkKCkKKyAgICAgICAgICAgICAgICBpZiAobVZpc2liaWxpdHlDaGFuZ2luZ0NoaWxkcmVuID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVZpc2liaWxpdHlDaGFuZ2luZ0NoaWxkcmVuID0gbmV3IEFycmF5TGlzdDxWaWV3PigpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtVmlzaWJpbGl0eUNoYW5naW5nQ2hpbGRyZW4uYWRkKGNoaWxkKTsKKyAgICAgICAgICAgICAgICBpZiAobVRyYW5zaXRpb25pbmdWaWV3cyAhPSBudWxsICYmIG1UcmFuc2l0aW9uaW5nVmlld3MuY29udGFpbnMoY2hpbGQpKSB7CisgICAgICAgICAgICAgICAgICAgIGFkZERpc2FwcGVhcmluZ1ZpZXcoY2hpbGQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgogICAgICAqIHtAaW5oZXJpdERvY30KICAgICAgKi8KICAgICBAT3ZlcnJpZGUKQEAgLTc2Nyw2ICs4NTUsMTMxIEBACiAKICAgICAvKioKICAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICoKKyAgICAgKiAhISEgVE9ETzogd3JpdGUgcmVhbCBkb2NzCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gZGlzcGF0Y2hEcmFnRXZlbnQoRHJhZ0V2ZW50IGV2ZW50KSB7CisgICAgICAgIGJvb2xlYW4gcmV0dmFsID0gZmFsc2U7CisgICAgICAgIGZpbmFsIGZsb2F0IHR4ID0gZXZlbnQubVg7CisgICAgICAgIGZpbmFsIGZsb2F0IHR5ID0gZXZlbnQubVk7CisKKyAgICAgICAgVmlld1Jvb3Qgcm9vdCA9IGdldFZpZXdSb290KCk7CisKKyAgICAgICAgLy8gRGlzcGF0Y2ggZG93biB0aGUgdmlldyBoaWVyYXJjaHkKKyAgICAgICAgc3dpdGNoIChldmVudC5tQWN0aW9uKSB7CisgICAgICAgIGNhc2UgRHJhZ0V2ZW50LkFDVElPTl9EUkFHX1NUQVJURUQ6IHsKKyAgICAgICAgICAgIC8vIGNsZWFyIHN0YXRlIHRvIHJlY2FsY3VsYXRlIHdoaWNoIHZpZXdzIHdlIGRyYWcgb3ZlcgorICAgICAgICAgICAgcm9vdC5zZXREcmFnRm9jdXMoZXZlbnQsIG51bGwpOworCisgICAgICAgICAgICAvLyBOb3cgZGlzcGF0Y2ggZG93biB0byBvdXIgY2hpbGRyZW4sIGNhY2hpbmcgdGhlIHJlc3BvbnNlcworICAgICAgICAgICAgbUNoaWxkQWNjZXB0c0RyYWcgPSBmYWxzZTsKKyAgICAgICAgICAgIGZpbmFsIGludCBjb3VudCA9IG1DaGlsZHJlbkNvdW50OworICAgICAgICAgICAgZmluYWwgVmlld1tdIGNoaWxkcmVuID0gbUNoaWxkcmVuOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IGNoaWxkcmVuW2ldOworICAgICAgICAgICAgICAgIGlmIChjaGlsZC5nZXRWaXNpYmlsaXR5KCkgPT0gVklTSUJMRSkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGhhbmRsZWQgPSBjaGlsZHJlbltpXS5kaXNwYXRjaERyYWdFdmVudChldmVudCk7CisgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuW2ldLm1DYW5BY2NlcHREcm9wID0gaGFuZGxlZDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhhbmRsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DaGlsZEFjY2VwdHNEcmFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gUmV0dXJuIEhBTkRMRUQgaWYgb25lIG9mIG91ciBjaGlsZHJlbiBjYW4gYWNjZXB0IHRoZSBkcmFnCisgICAgICAgICAgICBpZiAobUNoaWxkQWNjZXB0c0RyYWcpIHsKKyAgICAgICAgICAgICAgICByZXR2YWwgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9IGJyZWFrOworCisgICAgICAgIGNhc2UgRHJhZ0V2ZW50LkFDVElPTl9EUkFHX0VOREVEOiB7CisgICAgICAgICAgICAvLyBOb3RpZnkgYWxsIG9mIG91ciBjaGlsZHJlbiB0aGF0IHRoZSBkcmFnIGlzIG92ZXIKKyAgICAgICAgICAgIGZpbmFsIGludCBjb3VudCA9IG1DaGlsZHJlbkNvdW50OworICAgICAgICAgICAgZmluYWwgVmlld1tdIGNoaWxkcmVuID0gbUNoaWxkcmVuOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IGNoaWxkcmVuW2ldOworICAgICAgICAgICAgICAgIGlmIChjaGlsZC5nZXRWaXNpYmlsaXR5KCkgPT0gVklTSUJMRSkgeworICAgICAgICAgICAgICAgICAgICBjaGlsZC5kaXNwYXRjaERyYWdFdmVudChldmVudCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gV2UgY29uc2lkZXIgZHJhZy1lbmRlZCB0byBoYXZlIGJlZW4gaGFuZGxlZCBpZiBvbmUgb2Ygb3VyIGNoaWxkcmVuCisgICAgICAgICAgICAvLyBoYWQgb2ZmZXJlZCB0byBoYW5kbGUgdGhlIGRyYWcuCisgICAgICAgICAgICBpZiAobUNoaWxkQWNjZXB0c0RyYWcpIHsKKyAgICAgICAgICAgICAgICByZXR2YWwgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9IGJyZWFrOworCisgICAgICAgIGNhc2UgRHJhZ0V2ZW50LkFDVElPTl9EUkFHX0xPQ0FUSU9OOiB7CisgICAgICAgICAgICAvLyBGaW5kIHRoZSBbcG9zc2libHkgbmV3XSBkcmFnIHRhcmdldAorICAgICAgICAgICAgZmluYWwgVmlldyB0YXJnZXQgPSBmaW5kRnJvbnRtb3N0RHJvcHBhYmxlQ2hpbGRBdChldmVudC5tWCwgZXZlbnQubVksIG1Mb2NhbFBvaW50KTsKKworICAgICAgICAgICAgLy8gSWYgd2UndmUgY2hhbmdlZCBhcHBhcmVudCBkcmFnIHRhcmdldCwgdGVsbCB0aGUgdmlldyByb290IHdoaWNoIHZpZXcKKyAgICAgICAgICAgIC8vIHdlJ3JlIG92ZXIgbm93LiAgVGhpcyB3aWxsIGluIHR1cm4gc2VuZCBvdXQgRFJBR19FTlRFUkVEIC8gRFJBR19FWElURUQKKyAgICAgICAgICAgIC8vIG5vdGlmaWNhdGlvbnMgYXMgYXBwcm9wcmlhdGUuCisgICAgICAgICAgICBpZiAobUN1cnJlbnREcmFnVmlldyAhPSB0YXJnZXQpIHsKKyAgICAgICAgICAgICAgICByb290LnNldERyYWdGb2N1cyhldmVudCwgdGFyZ2V0KTsKKyAgICAgICAgICAgICAgICBtQ3VycmVudERyYWdWaWV3ID0gdGFyZ2V0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBEaXNwYXRjaCB0aGUgYWN0dWFsIGRyYWcgbG9jYXRpb24gbm90aWNlLCBsb2NhbGl6ZWQgaW50byBpdHMgY29vcmRpbmF0ZXMKKyAgICAgICAgICAgIGlmICh0YXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGV2ZW50Lm1YID0gbUxvY2FsUG9pbnQueDsKKyAgICAgICAgICAgICAgICBldmVudC5tWSA9IG1Mb2NhbFBvaW50Lnk7CisKKyAgICAgICAgICAgICAgICByZXR2YWwgPSB0YXJnZXQuZGlzcGF0Y2hEcmFnRXZlbnQoZXZlbnQpOworCisgICAgICAgICAgICAgICAgZXZlbnQubVggPSB0eDsKKyAgICAgICAgICAgICAgICBldmVudC5tWSA9IHR5OworICAgICAgICAgICAgfQorICAgICAgICB9IGJyZWFrOworCisgICAgICAgIGNhc2UgRHJhZ0V2ZW50LkFDVElPTl9EUk9QOiB7CisgICAgICAgICAgICBpZiAoVmlld0RlYnVnLkRFQlVHX0RSQUcpIExvZy5kKFZpZXcuVklFV19MT0dfVEFHLCAiRHJvcCBldmVudDogIiArIGV2ZW50KTsKKyAgICAgICAgICAgIFZpZXcgdGFyZ2V0ID0gZmluZEZyb250bW9zdERyb3BwYWJsZUNoaWxkQXQoZXZlbnQubVgsIGV2ZW50Lm1ZLCBtTG9jYWxQb2ludCk7CisgICAgICAgICAgICBpZiAodGFyZ2V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoVmlld0RlYnVnLkRFQlVHX0RSQUcpIExvZy5kKFZpZXcuVklFV19MT0dfVEFHLCAiICAgZGlzcGF0Y2ggZHJvcCB0byAiICsgdGFyZ2V0KTsKKyAgICAgICAgICAgICAgICBldmVudC5tWCA9IG1Mb2NhbFBvaW50Lng7CisgICAgICAgICAgICAgICAgZXZlbnQubVkgPSBtTG9jYWxQb2ludC55OworICAgICAgICAgICAgICAgIHJldHZhbCA9IHRhcmdldC5kaXNwYXRjaERyYWdFdmVudChldmVudCk7CisgICAgICAgICAgICAgICAgZXZlbnQubVggPSB0eDsKKyAgICAgICAgICAgICAgICBldmVudC5tWSA9IHR5OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAoVmlld0RlYnVnLkRFQlVHX0RSQUcpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmQoVmlldy5WSUVXX0xPR19UQUcsICIgICBub3QgZHJvcHBlZCBvbiBhbiBhY2NlcHRpbmcgdmlldyIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIC8vIElmIG5vbmUgb2Ygb3VyIGNoaWxkcmVuIGNvdWxkIGhhbmRsZSB0aGUgZXZlbnQsIHRyeSBoZXJlCisgICAgICAgIGlmICghcmV0dmFsKSB7CisgICAgICAgICAgICAvLyBDYWxsIHVwIHRvIHRoZSBWaWV3IGltcGxlbWVudGF0aW9uIHRoYXQgZGlzcGF0Y2hlcyB0byBpbnN0YWxsZWQgbGlzdGVuZXJzCisgICAgICAgICAgICByZXR2YWwgPSBzdXBlci5kaXNwYXRjaERyYWdFdmVudChldmVudCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJldHZhbDsKKyAgICB9CisKKyAgICAvLyBGaW5kIHRoZSBmcm9udG1vc3QgY2hpbGQgdmlldyB0aGF0IGxpZXMgdW5kZXIgdGhlIGdpdmVuIHBvaW50LCBhbmQgY2FsY3VsYXRlCisgICAgLy8gdGhlIHBvc2l0aW9uIHdpdGhpbiBpdHMgb3duIGxvY2FsIGNvb3JkaW5hdGUgc3lzdGVtLgorICAgIFZpZXcgZmluZEZyb250bW9zdERyb3BwYWJsZUNoaWxkQXQoZmxvYXQgeCwgZmxvYXQgeSwgUG9pbnRGIG91dExvY2FsUG9pbnQpIHsKKyAgICAgICAgZmluYWwgaW50IGNvdW50ID0gbUNoaWxkcmVuQ291bnQ7CisgICAgICAgIGZpbmFsIFZpZXdbXSBjaGlsZHJlbiA9IG1DaGlsZHJlbjsKKyAgICAgICAgZm9yIChpbnQgaSA9IGNvdW50IC0gMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcgY2hpbGQgPSBjaGlsZHJlbltpXTsKKyAgICAgICAgICAgIGlmICghY2hpbGQubUNhbkFjY2VwdERyb3ApIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGlzVHJhbnNmb3JtZWRUb3VjaFBvaW50SW5WaWV3KHgsIHksIGNoaWxkLCBvdXRMb2NhbFBvaW50KSkgeworICAgICAgICAgICAgICAgIHJldHVybiBjaGlsZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiB7QGluaGVyaXREb2N9CiAgICAgICovCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gZGlzcGF0Y2hLZXlFdmVudFByZUltZShLZXlFdmVudCBldmVudCkgewpAQCAtODI3LDExOSArMTA0MCw1MjQgQEAKICAgICAgICAgfQogCiAgICAgICAgIGZpbmFsIGludCBhY3Rpb24gPSBldi5nZXRBY3Rpb24oKTsKLSAgICAgICAgZmluYWwgZmxvYXQgeGYgPSBldi5nZXRYKCk7Ci0gICAgICAgIGZpbmFsIGZsb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UYXJnZXQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIHRoaXMgaXMgd2VpcmQsIHdlIGdvdCBhIHBlbiBkb3duLCBidXQgd2UgdGhvdWdodCBpdCB3YXMKLSAgICAgICAgICAgICAgICAvLyBhbHJlYWR5IGRvd24hCi0gICAgICAgICAgICAgICAgLy8gWFhYOiBXZSBzaG91bGQgcHJvYmFibHkgc2VuZCBhbiBBQ1RJT05fVVAgdG8gdGhlIGN1cnJlbnQKLSAgICAgICAgICAgICAgICAvLyB0YXJnZXQuCi0gICAgICAgICAgICAgICAgbU1vdGlvblRhcmdldCA9IG51bGw7CisgICAgICAgIC8vIENoZWNrIGZvciBpbnRlcmNlcHRpb24uCisgICAgICAgIGZpbmFsIGJvb2xlYW4gaW50ZXJjZXB0ZWQ7CisgICAgICAgIGlmIChhY3Rpb25NYXNrZWQgPT0gTW90aW9uRXZlbnQuQUNUSU9OX0RPV04gfHwgbUZpcnN0VG91Y2hUYXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBkaXNhbGxvd0ludGVyY2VwdCA9IChtR3JvdXBGbGFncyAmIEZMQUdfRElTQUxMT1dfSU5URVJDRVBUKSAhPSAwOworICAgICAgICAgICAgaWYgKCFkaXNhbGxvd0ludGVyY2VwdCkgeworICAgICAgICAgICAgICAgIGludGVyY2VwdGVkID0gb25JbnRlcmNlcHRUb3VjaEV2ZW50KGV2KTsKKyAgICAgICAgICAgICAgICBldi5zZXRBY3Rpb24oYWN0aW9uKTsgLy8gcmVzdG9yZSBhY3Rpb24gaW4gY2FzZSBvbkludGVyY2VwdFRvdWNoRXZlbnQoKSBjaGFuZ2VkIGl0CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludGVyY2VwdGVkID0gZmFsc2U7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBJZiB3ZSdyZSBkaXNhbGxvd2luZyBpbnRlcmNlcHQgb3IgaWYgd2U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3MgJiBWSVNJQklMSVRZX01BU0spID09IFZJU0lCTEUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBjaGlsZC5nZXRBbmltYXRpb24oKSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaGlsZC5nZXRIaXRSZWN0KGZyYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmcmFtZS5jb250YWlucyhzY3JvbGxlZFhJbnQsIHNjcm9sbGVkWUludCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvZmZzZXQgdGhlIGV2ZW50IHRvIHRoZSB2aWV3J3MgY29vcmRpbmF0ZSBzeXN0ZW0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBmbG9hdCB4YyA9IHNjcm9sbGVkWEZsb2F0IC0gY2hpbGQubUxlZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgeWMgPSBzY3JvbGxlZFlGbG9hdCAtIGNoaWxkLm1Ub3A7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXYuc2V0TG9jYXRpb24oeGMsIHljKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZC5tUHJpdmF0ZUZsYWdzICY9IH5DQU5DRUxfTkVYVF9VUF9FVkVOVDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuZGlzcGF0Y2hUb3VjaEV2ZW50KGV2KSkgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRXZlbnQgaGFuZGxlZCwgd2UgaGF2ZSBhIHRhcmdldCBub3cuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Nb3Rpb25UYXJnZXQgPSBjaGlsZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBldmVudCBkaWRuJ3QgZ2V0IGhhbmRsZWQsIHRyeSB0aGUgbmV4dCB2aWV3LgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IHJlc2V0IHRoZSBldmVudCdzIGxvY2F0aW9uLCBpdCdzIG5vdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5lY2Vzc2FyeSBoZXJlLgorICAgICAgICAvLyBDaGVjayBmb3IgY2FuY2VsYXRpb24uCisgICAgICAgIGZpbmFsIGJvb2xlYW4gY2FuY2VsZWQgPSByZXNldENhbmNlbE5leHRVcEZsYWcodGhpcykKKyAgICAgICAgICAgICAgICB8fCBhY3Rpb25NYXNrZWQgPT0gTW90aW9uRXZlbnQuQUNUSU9OX0NBTkNFTDsKKworICAgICAgICAvLyBVcGRhdGUgbGlzdCBvZiB0b3VjaCB0YXJnZXRzIGZvciBwb2ludGVyIGRvd24sIGlmIG5lZWRlZC4KKyAgICAgICAgZmluYWwgYm9vbGVhbiBzcGxpdCA9IChtR3JvdXBGbGFncyAmIEZMQUdfU1BMSVRfTU9USU9OX0VWRU5UUykgIT0gMDsKKyAgICAgICAgVG91Y2hUYXJnZXQgbmV3VG91Y2hUYXJnZXQgPSBudWxsOworICAgICAgICBib29sZWFuIGFscmVhZHlEaXNwYXRjaGVkVG9OZXdUb3VjaFRhcmdldCA9IGZhbHNlOworICAgICAgICBpZiAoIWNhbmNlbGVkICYmICFpbnRlcmNlcHRlZCkgeworICAgICAgICAgICAgaWYgKGFjdGlvbk1hc2tlZCA9PSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTgorICAgICAgICAgICAgICAgICAgICB8fCAoc3BsaXQgJiYgYWN0aW9uTWFza2VkID09IE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX0RPV04pKSB7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IGFjdGlvbkluZGV4ID0gZXYuZ2V0QWN0aW9uSW5kZXgoKTsgLy8gYWx3YXlzIDAgZm9yIGRvd24KKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaWRCaXRzVG9Bc3NpZ24gPSBzcGxpdCA/IDEgPDwgZXYuZ2V0UG9pbnRlcklkKGFjdGlvbkluZGV4KQorICAgICAgICAgICAgICAgICAgICAgICAgOiBUb3VjaFRhcmdldC5BTExfUE9JTlRFUl9JRFM7CisKKyAgICAgICAgICAgICAgICAvLyBDbGVhbiB1cCBlYXJsaWVyIHRvdWNoIHRhcmdldHMgZm9yIHRoaXMgcG9pbnRlciBpZCBpbiBjYXNlIHRoZXkKKyAgICAgICAgICAgICAgICAvLyBoYXZlIGJlY29tZSBvdXQgb2Ygc3luYy4KKyAgICAgICAgICAgICAgICByZW1vdmVQb2ludGVyc0Zyb21Ub3VjaFRhcmdldHMoaWRCaXRzVG9Bc3NpZ24pOworCisgICAgICAgICAgICAgICAgZmluYWwgaW50IGNoaWxkcmVuQ291bnQgPSBtQ2hpbGRyZW5Db3VudDsKKyAgICAgICAgICAgICAgICBpZiAoY2hpbGRyZW5Db3VudCAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIEZpbmQgYSBjaGlsZCB0aGF0IGNhbiByZWNlaXZlIHRoZSBldmVudC4gIFNjYW4gY2hpbGRyZW4gZnJvbSBmcm9udCB0byBiYWNrLgorICAgICAgICAgICAgICAgICAgICBmaW5hbCBWaWV3W10gY2hpbGRyZW4gPSBtQ2hpbGRyZW47CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGZsb2F0IHggPSBldi5nZXRYKGFjdGlvbkluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgeSA9IGV2LmdldFkoYWN0aW9uSW5kZXgpOworCisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSBjaGlsZHJlbkNvdW50IC0gMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFZpZXcgY2hpbGQgPSBjaGlsZHJlbltpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY2hpbGQubVZpZXdGbGFncyAmIFZJU0lCSUxJVFlfTUFTSykgIT0gVklTSUJMRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjaGlsZC5nZXRBbmltYXRpb24oKSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2tpcCBpbnZpc2libGUgY2hpbGQgdW5sZXNzIGl0IGlzIGFuaW1hdGluZy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc1RyYW5zZm9ybWVkVG91Y2hQb2ludEluVmlldyh4LCB5LCBjaGlsZCwgbnVsbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOZXcgcG9pbnRlciBpcyBvdXQgb2YgY2hpbGQncyBib3VuZHMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ld1RvdWNoVGFyZ2V0ID0gZ2V0VG91Y2hUYXJnZXQoY2hpbGQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1RvdWNoVGFyZ2V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDaGlsZCBpcyBhbHJlYWR5IHJlY2VpdmluZyB0b3VjaCB3aXRoaW4gaXRzIGJvdW5kcy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBHaXZlIGl0IHRoZSBuZXcgcG9pbnRlciBpbiBhZGRpdGlvbiB0byB0aGUgb25lcyBpdCBpcyBoYW5kbGluZy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdUb3VjaFRhcmdldC5wb2ludGVySWRCaXRzIHw9IGlkQml0c1RvQXNzaWduOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICByZXNldENhbmNlbE5leHRVcEZsYWcoY2hpbGQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpc3BhdGNoVHJhbnNmb3JtZWRUb3VjaEV2ZW50KGV2LCBmYWxzZSwgY2hpbGQsIGlkQml0c1RvQXNzaWduKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIENoaWxkIHdhbnRzIHRvIHJlY2VpdmUgdG91Y2ggd2l0aGluIGl0cyBib3VuZHMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3VG91Y2hUYXJnZXQgPSBhZGRUb3VjaFRhcmdldChjaGlsZCwgaWRCaXRzVG9Bc3NpZ24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscmVhZHlEaXNwYXRjaGVkVG9OZXdUb3VjaFRhcmdldCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAobmV3VG91Y2hUYXJnZXQgPT0gbnVsbCAmJiBtRmlyc3RUb3VjaFRhcmdldCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIERpZCBub3QgZmluZCBhIGNoaWxkIHRvIHJlY2VpdmUgdGhlIGV2ZW50LgorICAgICAgICAgICAgICAgICAgICAvLyBBc3NpZ24gdGhlIHBvaW50ZXIgdG8gdGhlIGxlYXN0IHJlY2VudGx5IGFkZGVkIHRhcmdldC4KKyAgICAgICAgICAgICAgICAgICAgbmV3VG91Y2hUYXJnZXQgPSBtRmlyc3RUb3VjaFRhcmdldDsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG5ld1RvdWNoVGFyZ2V0Lm5leHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV3VG91Y2hUYXJnZXQgPSBuZXdUb3VjaFRhcmdldC5uZXh0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG5ld1RvdWNoVGFyZ2V0LnBvaW50ZXJJZEJpdHMgfD0gaWRCaXRzVG9Bc3NpZ247CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgYm9vbGVhbiBpc1VwT3JDYW5jZWwgPSAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9VUCkgfHwKLSAgICAgICAgICAgICAgICAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUwpOwotCi0gICAgICAgIGlmIChpc1VwT3JDYW5jZWwpIHsKLSAgICAgICAgICAgIC8vIE5vdGUsIHdlJ3ZlIGFscmVhZHkgY29waWVkIHRoZSBwcmV2aW91cyBzdGF0ZSB0byBvdXIgbG9jYWwKLSAgICAgICAgICAgIC8vIHZhcmlhYmxlLCBzbyB0aGlzIHRha2VzIGVmZmVjdCBvbiB0aGUgbmV4dCBldmVudAotICAgICAgICAgICAgbUdyb3VwRmxhZ3MgJj0gfkZMQUdfRElTQUxMT1dfSU5URVJDRVBUOworICAgICAgICAvLyBEaXNwYXRjaCB0byB0b3VjaCB0YXJnZXRzLgorICAgICAgICBib29sZWFuIGhhbmRsZWQgPSBmYWxzZTsKKyAgICAgICAgaWYgKG1GaXJzdFRvdWNoVGFyZ2V0ID09IG51bGwpIHsKKyAgICAgICAgICAgIC8vIE5vIHRvdWNoIHRhcmdldHMgc28gdHJlYXQgdGhpcyBhcyBhbiBvcmRpbmFyeSB2aWV3LgorICAgICAgICAgICAgaGFuZGxlZCA9IGRpc3BhdGNoVHJhbnNmb3JtZWRUb3VjaEV2ZW50KGV2LCBjYW5jZWxlZCwgbnVsbCwKKyAgICAgICAgICAgICAgIC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AgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoY2FuY2VsQ2hpbGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcmVkZWNlc3NvciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZpcnN0VG91Y2hUYXJnZXQgPSBuZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkZWNlc3Nvci5uZXh0ID0gbmV4dDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldC5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXQgPSBuZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcHJlZGVjZXNzb3IgPSB0YXJnZXQ7CisgICAgICAgICAgICAgICAgdGFyZ2V0ID0gbmV4dDsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogCi0gICAgICAgIC8vIFRoZSBldmVudCB3YXNuJ3QgYW4gQUNUSU9OX0RPV04sIGRpc3BhdGNoIGl0IHRvIG91ciB0YXJnZXQgaWYKLSAgICAgICAgLy8gd2UgaGF2ZSBvbmUuCi0gICAgICAgIGZpbmFsIFZpZXcgdGFyZ2V0ID0gbU1vdGlvblRhcmdldDsKLSAgICAgICAgaWYgKHRhcmdldCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAvLyBXZSBkb24ndCBoYXZlIGEgdGFyZ2V0LCB0aGlzIG1lYW5zIHdlJ3JlIGhhbmRsaW5nIHRoZQotICAgICAgICAgICAgLy8gZXZlbnQgYXMgYSByZWd1bGFyIHZpZXcuCi0gICAgICAgICAgICBldi5zZXRMb2NhdGlvbih4ZiwgeWYpOwotICAgICAgICAgICAgaWY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AgICBUb3VjaFRhcmdldCBuZXh0ID0gdGFyZ2V0Lm5leHQ7CisgICAgICAgICAgICAgICAgdGFyZ2V0LnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICB0YXJnZXQgPSBuZXh0OworICAgICAgICAgICAgfSB3aGlsZSAodGFyZ2V0ICE9IG51bGwpOworICAgICAgICAgICAgbUZpcnN0VG91Y2hUYXJnZXQgPSBudWxsOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2FuY2VscyBhbmQgY2xlYXJzIGFsbCB0b3VjaCB0YXJnZXRzLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBjYW5jZWxBbmRDbGVhclRvdWNoVGFyZ2V0cyhNb3Rpb25FdmVudCBldmVudCkgeworICAgICAgICBpZiAobUZpcnN0VG91Y2hUYXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgYm9vbGVhbiBzeW50aGV0aWNFdmVudCA9IGZhbHNlOworICAgICAgICAgICAgaWYgKGV2ZW50ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBsb25nIG5vdyA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOworICAgICAgICAgICAgICAgIGV2ZW50ID0gTW90aW9uRXZlbnQub2J0YWluKG5vdywgbm93LAorICAgICAgICAgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQuQUNUSU9OX0NBTkNFTCwgMC4wZiwgMC4wZiwgMCk7CisgICAgICAgICAgICAgICAgc3ludGhldGljRXZlbnQgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmb3IgKFRvdWNoVGFyZ2V0IHRhcmdldCA9IG1GaXJzdFRvdWNoVGFyZ2V0OyB0YXJnZXQgIT0gbnVsbDsgdGFyZ2V0ID0gdGFyZ2V0Lm5leHQpIHsKKyAgICAgICAgICAgICAgICByZXNldENhbmNlbE5leHRVcEZsYWcodGFyZ2V0LmNoaWxkKTsKKyAgICAgICAgICAgICAgICBkaXNwYXRjaFRyYW5zZm9ybWVkVG91Y2hFdmVudChldmVudCwgdHJ1ZSwgdGFyZ2V0LmNoaWxkLCB0YXJnZXQucG9pbnRlcklkQml0cyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjbGVhclRvdWNoVGFyZ2V0cygpOworCisgICAgICAgICAgICBpZiAoc3ludGhldGljRXZlbnQpIHsKKyAgICAgICAgICAgICAgICBldmVudC5yZWN5Y2xlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZXRzIHRoZSB0b3VjaCB0YXJnZXQgZm9yIHNwZWNpZmllZCBjaGlsZCB2aWV3LgorICAgICAqIFJldHVybnMgbnVsbCBpZiBub3QgZm91bmQuCisgICAgICovCisgICAgcHJpdmF0ZSBUb3VjaFRhcmdldCBnZXRUb3VjaFRhcmdldChWaWV3IGNoaWxkKSB7CisgICAgICAgIGZvciAoVG91Y2hUYXJnZXQgdGFyZ2V0ID0gbUZpcnN0VG91Y2hUYXJnZXQ7IHRhcmdldCAhPSBudWxsOyB0YXJnZXQgPSB0YXJnZXQubmV4dCkgeworICAgICAgICAgICAgaWYgKHRhcmdldC5jaGlsZCA9PSBjaGlsZCkgeworICAgICAgICAgICAgICAgIHJldHVybiB0YXJnZXQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogQWRkcyBhIHRvdWNoIHRhcmdldCBmb3Igc3BlY2lmaWVkIGNoaWxkIHRvIHRoZSBiZWdpbm5pbmcgb2YgdGhlIGxpc3QuCisgICAgICogQXNzdW1lcyB0aGUgdGFyZ2V0IGNoaWxkIGlzIG5vdCBhbHJlYWR5IHByZXNlbnQuCisgICAgICovCisgICAgcHJpdmF0ZSBUb3VjaFRhcmdldCBhZGRUb3VjaFRhcmdldChWaWV3IGNoaWxkLCBpbnQgcG9pbnRlcklkQml0cykgeworICAgICAgICBUb3VjaFRhcmdldCB0YXJnZXQgPSBUb3VjaFRhcmdldC5vYnRhaW4oY2hpbGQsIHBvaW50ZXJJZEJpdHMpOworICAgICAgICB0YXJnZXQubmV4dCA9IG1GaXJzdFRvdWNoVGFyZ2V0OworICAgICAgICBtRmlyc3RUb3VjaFRhcmdldCA9IHRhcmdldDsKKyAgICAgICAgcmV0dXJuIHRhcmdldDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZW1vdmVzIHRoZSBwb2ludGVyIGlkcyBmcm9tIGNvbnNpZGVyYXRpb24uCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHJlbW92ZVBvaW50ZXJzRnJvbVRvdWNoVGFyZ2V0cyhpbnQgcG9pbnRlcklkQml0cykgeworICAgICAgICBUb3VjaFRhcmdldCBwcmVkZWNlc3NvciA9IG51bGw7CisgICAgICAgIFRvdWNoVGFyZ2V0IHRhcmdldCA9IG1GaXJzdFRvdWNoVGFyZ2V0OworICAgICAgICB3aGlsZSAodGFyZ2V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZpbmFsIFRvdWNoVGFyZ2V0IG5leHQgPSB0YXJnZXQubmV4dDsKKyAgICAgICAgICAgIGlmICgodGFyZ2V0LnBvaW50ZXJJZEJpdHMgJiBwb2ludGVySWRCaXRzKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgdGFyZ2V0LnBvaW50ZXJJZEJpdHMgJj0gfnBvaW50ZXJJZEJpdHM7CisgICAgICAgICAgICAgICAgaWYgKHRhcmdldC5wb2ludGVySWRCaXRzID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHByZWRlY2Vzc29yID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1GaXJzdFRvdWNoVGFyZ2V0ID0gbmV4dDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZWRlY2Vzc29yLm5leHQgPSBuZXh0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHRhcmdldC5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgICAgIHRhcmdldCA9IG5leHQ7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHByZWRlY2Vzc29yID0gdGFyZ2V0OworICAgICAgICAgICAgdGFyZ2V0ID0gbmV4dDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdHJ1ZSBpZiBhIGNoaWxkIHZpZXcgY29udGFpbnMgdGhlIHNwZWNpZmllZCBwb2ludCB3aGVuIHRyYW5zZm9ybWVkCisgICAgICogaW50byBpdHMgY29vcmRpbmF0ZSBzcGFjZS4KKyAgICAgKiBDaGlsZCBtdXN0IG5vdCBiZSBudWxsLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHJvdGVjdGVkIGJvb2xlYW4gaXNUcmFuc2Zvcm1lZFRvdWNoUG9pbnRJblZpZXcoZmxvYXQgeCwgZmxvYXQgeSwgVmlldyBjaGlsZCwKKyAgICAgICAgICAgIFBvaW50RiBvdXRMb2NhbFBvaW50KSB7CisgICAgICAgIGZsb2F0IGxvY2FsWCA9IHggKyBtU2Nyb2xsWCAtIGNoaWxkLm1MZWZ0OworICAgICAgICBmbG9hdCBsb2NhbFkgPSB5ICsgbVNjcm9sbFkgLSBjaGlsZC5tVG9wOworICAgICAgICBpZiAoISBjaGlsZC5oYXNJZGVudGl0eU1hdHJpeCgpICYmIG1BdHRhY2hJbmZvICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZpbmFsIGZsb2F0W10gbG9jYWxYWSA9IG1BdHRhY2hJbmZvLm1UbXBUcmFuc2Zvcm1Mb2NhdGlvbjsKKyAgICAgICAgICAgIGxvY2FsWFlbMF0gPSBsb2NhbFg7CisgICAgICAgICAgICBsb2NhbFhZWzFdID0gbG9jYWxZOworICAgICAgICAgICAgY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yyk7Ci0KLSAgICAgICAgaWYgKCh0YXJnZXQubVByaXZhdGVGbGFncyAmIENBTkNFTF9ORVhUX1VQX0VWRU5UKSAhPSAwKSB7Ci0gICAgICAgICAgICBldi5zZXRBY3Rpb24oTW90aW9uRXZlbnQuQUNUSU9OX0NBTkNFTCk7Ci0gICAgICAgICAgICB0YXJnZXQubVByaXZhdGVGbGFncyAmPSB+Q0FOQ0VMX05FWFRfVVBfRVZFTlQ7Ci0gICAgICAgICAgICBtTW90aW9uVGFyZ2V0ID0gbnVsbDsKKyAgICAgICAgLy8gQ2FsY3VsYXRlIHRoZSBudW1iZXIgb2YgcG9pbnRlcnMgdG8gZGVsaXZlci4KKyAgICAgICAgZmluYWwgaW50IG9sZFBvaW50ZXJDb3VudCA9IGV2ZW50LmdldFBvaW50ZXJDb3VudCgpOworICAgICAgICBpbnQgbmV3UG9pbnRlckNvdW50ID0gMDsKKyAgICAgICAgaWYgKGRlc2lyZWRQb2ludGVySWRCaXRzID09IFRvdWNoVGFyZ2V0LkFMTF9QT0lOVEVSX0lEUykgeworICAgICAgICAgICAgbmV3UG9pbnRlckNvdW50ID0gb2xkUG9pbnRlckNvdW50OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBvbGRQb2ludGVyQ291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIGZpbmFsIGludCBwb2ludGVySWQgPSBldmVudC5nZXRQb2ludGVySWQoaSk7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IHBvaW50ZXJJZEJpdCA9IDEgPDwgcG9pbnRlcklkOworICAgICAgICAgICAgICAgIGlmICgocG9pbnRlcklkQml0ICYgZGVzaXJlZFBvaW50ZXJJZEJpdHMpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgbmV3UG9pbnRlckNvdW50ICs9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgcmV0dXJuIHRhcmdldC5kaXNwYXRjaFRvdWNoRXZlbnQoZXYpOworICAgICAgICAvLyBJZiBmb3Igc29tZSByZWFzb24gd2UgZW5kZWQgdXAgaW4gYW4gaW5jb25zaXN0ZW50IHN0YXRlIHdoZXJlIGl0IGxvb2tzIGxpa2Ugd2UKKyAgICAgICAgLy8gbWlnaHQgcHJvZHVjZSBhIG1vdGlvbiBldmVudCB3aXRoIG5vIHBvaW50ZXJzIGluIGl0LCB0aGVuIGRyb3AgdGhlIGV2ZW50LgorICAgICAgICBpZiAobmV3UG9pbnRlckNvdW50ID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIElmIHRoZSBudW1iZXIgb2YgcG9pbnRlcnMgaXMgdGhlIHNhbWUgYW5kIHdlIGRvbid0IG5lZWQgdG8gcGVyZm9ybSBhbnkgZmFuY3kKKyAgICAgICAgLy8gaXJyZXZlcnNpYmxlIHRyYW5zZm9ybWF0aW9ucywgdGhlbiB3ZSBjYW4gcmV1c2UgdGhlIG1vdGlvbiBldmVudCBmb3IgdGhpcworICAgICAgICAvLyBkaXNwYXRjaCBhcyBsb25nIGFzIHdlIGFyZSBjYXJlZnVsIHRvIHJldmVydCBhbnkgY2hhbmdlcyB3ZSBtYWtlLgorICAgICAgICBmaW5hbCBib29sZWFuIHJldXNlID0gbmV3UG9pbnRlckNvdW50ID09IG9sZFBvaW50ZXJDb3VudAorICAgICAgICAgICAgICAgICYmIChjaGlsZCA9PSBudWxsIHx8IGNoaWxkLmhhc0lkZW50aXR5TWF0cml4KCkpOworICAgICAgICBpZiAocmV1c2UpIHsKKyAgICAgICAgICAgIGlmIChjaGlsZCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHN1cGVyLmRpc3BhdGNoVG91Y2hFdmVudChldmVudCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGZpbmFsIGZsb2F0IG9mZnNldFggPSBtU2N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BvaW50ZXJJZHM7CisgICAgICAgICAgICBmaW5hbCBNb3Rpb25FdmVudC5Qb2ludGVyQ29vcmRzW10gbmV3UG9pbnRlckNvb3JkcyA9IG1UbXBQb2ludGVyQ29vcmRzOworCisgICAgICAgICAgICBpbnQgbmV3UG9pbnRlckluZGV4ID0gMDsKKyAgICAgICAgICAgIGludCBvbGRQb2ludGVySW5kZXggPSAwOworICAgICAgICAgICAgd2hpbGUgKG5ld1BvaW50ZXJJbmRleCA8IG5ld1BvaW50ZXJDb3VudCkgeworICAgICAgICAgICAgICAgIGZpbmFsIGludCBwb2ludGVySWQgPSBldmVudC5nZXRQb2ludGVySWQob2xkUG9pbnRlckluZGV4KTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcG9pbnRlcklkQml0cyA9IDEgPDwgcG9pbnRlcklkOworICAgICAgICAgICAgICAgIGlmICgocG9pbnRlcklkQml0cyAmIGRlc2lyZWRQb2ludGVySWRCaXRzKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIG5ld1BvaW50ZXJJbmRleE1hcFtuZXdQb2ludGVySW5kZXhdID0gb2xkUG9pbnRlckluZGV4OworICAgICAgICAgICAgICAgICAgICBuZXdQb2ludGVySWRzW25ld1BvaW50ZXJJbmRleF0gPSBwb2ludGVySWQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdQb2ludGVyQ29vcmRzW25ld1BvaW50ZXJJbmRleF0gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV3UG9pbnRlckNvb3Jkc1tuZXdQb2ludGVySW5kZXhdID0gbmV3IE1vdGlvbkV2ZW50LlBvaW50ZXJDb29yZHMoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIG5ld1BvaW50ZXJJbmRleCArPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvbGRQb2ludGVySW5kZXggKz0gMTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IG5ld0FjdGlvbjsKKyAgICAgICAgICAgIGlmIChjYW5jZWwpIHsKKyAgICAgICAgICAgICAgICBuZXdBY3Rpb24gPSBNb3Rpb25FdmVudC5BQ1RJT05fQ0FOQ0VMOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgb2xkTWFza2VkQWN0aW9uID0gb2xkQWN0aW9uICYgTW90aW9uRXZlbnQuQUNUSU9OX01BU0s7CisgICAgICAgICAgICAgICAgaWYgKG9sZE1hc2tlZEFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fUE9JTlRFUl9ET1dOCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBvbGRNYXNrZWRBY3Rpb24gPT0gTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfVVApIHsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGNoYW5nZWRQb2ludGVySWQgPSBldmVudC5nZXRQb2ludGVySWQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG9sZEFjdGlvbiAmIE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX0lOREVYX01BU0spCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA+PiBNb3Rpb25FdmVudC5BQ1RJT05fUE9JTlRFUl9JTkRFWF9TSElGVCk7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBjaGFuZ2VkUG9pbnRlcklkQml0cyA9IDEgPDwgY2hhbmdlZFBvaW50ZXJJZDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChjaGFuZ2VkUG9pbnRlcklkQml0cyAmIGRlc2lyZWRQb2ludGVySWRCaXRzKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3UG9pbnRlckNvdW50ID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgZmlyc3QvbGFzdCBwb2ludGVyIHdlbnQgZG93bi91cC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdBY3Rpb24gPSBvbGRNYXNrZWRBY3Rpb24gPT0gTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfRE9XTgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTiA6IE1vdGlvbkV2ZW50LkFDVElPTl9VUDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQSBzZWNvbmRhcnkgcG9pbnRlciB3ZW50IGRvd24vdXAuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG5ld0NoYW5nZWRQb2ludGVySW5kZXggPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChuZXdQb2ludGVySWRzW25ld0NoYW5nZWRQb2ludGVySW5kZXhdICE9IGNoYW5nZWRQb2ludGVySWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3Q2hhbmdlZFBvaW50ZXJJbmRleCArPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdBY3Rpb24gPSBvbGRNYXNrZWRBY3Rpb24gfCAobmV3Q2hhbmdlZFBvaW50ZXJJbmRleAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPDwgTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfSU5ERVhfU0hJRlQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQW4gdW5yZWxhdGVkIHBvaW50ZXIgY2hhbmdlZC4KKyAgICAgICAgICAgICAgICAgICAgICAgIG5ld0FjdGlvbiA9IE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU2ltcGxlIHVwL2Rvd24vY2FuY2VsL21vdmUgbW90aW9uIGFjdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgbmV3QWN0aW9uID0gb2xkTWFza2VkQWN0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdHJhbnNmb3JtZWRFdmVudCA9IG51bGw7CisgICAgICAgICAgICBmaW5hbCBpbnQgaGlzdG9yeVNpemUgPSBldmVudC5nZXRIaXN0b3J5U2l6ZSgpOworICAgICAgICAgICAgZm9yIChpbnQgaGlzdG9yeUluZGV4ID0gMDsgaGlzdG9yeUluZGV4IDw9IGhpc3RvcnlTaXplOyBoaXN0b3J5SW5kZXgrKykgeworICAgICAgICAgICAgICAgIGZvciAobmV3UG9pbnRlckluZGV4ID0gMDsgbmV3UG9pbnRlckluZGV4IDwgbmV3UG9pbnRlckNvdW50OyBuZXdQb2ludGVySW5kZXgrKykgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBNb3Rpb25FdmVudC5Qb2ludGVyQ29vcmRzIGMgPSBuZXdQb2ludGVyQ29vcmRzW25ld1BvaW50ZXJJbmRleF07CisgICAgICAgICAgICAgICAgICAgIG9sZFBvaW50ZXJJbmRleCA9IG5ld1BvaW50ZXJJbmRleE1hcFtuZXdQb2ludGVySW5kZXhdOworICAgICAgICAgICAgICAgICAgICBpZiAoaGlzdG9yeUluZGV4ICE9IGhpc3RvcnlTaXplKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5nZXRIaXN0b3JpY2FsUG9pbnRlckNvb3JkcyhvbGRQb2ludGVySW5kZXgsIGhpc3RvcnlJbmRleCwgYyk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5nZXRQb2ludGVyQ29vcmRzKG9sZFBvaW50ZXJJbmRleCwgYyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGV2ZW50VGltZTsKKyAgICAgICAgICAgICAgICBpZiAoaGlzdG9yeUluZGV4ICE9IGhpc3RvcnlTaXplKSB7CisgICAgICAgICAgICAgICAgICAgIGV2ZW50VGltZSA9IGV2ZW50LmdldEhpc3RvcmljYWxFdmVudFRpbWUoaGlzdG9yeUluZGV4KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBldmVudFRpbWUgPSBldmVudC5nZXRFdmVudFRpbWUoKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAodHJhbnNmb3JtZWRFdmVudCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybWVkRXZlbnQgPSBNb3Rpb25FdmVudC5vYnRhaW4oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuZ2V0RG93blRpbWUoKSwgZXZlbnRUaW1lLCBuZXdBY3Rpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3UG9pbnRlckNvdW50LCBuZXdQb2ludGVySWRzLCBuZXdQb2ludGVyQ29vcmRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LmdldE1ldGFTdGF0ZSgpLCBldmVudC5nZXRYUHJlY2lzaW9uKCksIGV2ZW50LmdldFlQcmVjaXNpb24oKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5nZXREZXZpY2VJZCgpLCBldmVudC5nZXRFZGdlRmxhZ3MoKSwgZXZlbnQuZ2V0U291cmNlKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuZ2V0RmxhZ3MoKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNmb3JtZWRFdmVudC5hZGRCYX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gZGlzY2FyZCBjb250ZW50cyAoYnV0IGtlZXBzIFBvaW50ZXJDb29yZHMgb2JqZWN0cyB0byBhdm9pZCByZWFsbG9jYXRpbmcgdGhlbSkuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGdyb3dUbXBQb2ludGVyQXJyYXlzKGludCBkZXNpcmVkQ2FwYWNpdHkpIHsKKyAgICAgICAgZmluYWwgTW90aW9uRXZlbnQuUG9pbnRlckNvb3Jkc1tdIG9sZFRtcFBvaW50ZXJDb29yZHMgPSBtVG1wUG9pbnRlckNvb3JkczsKKyAgICAgICAgaW50IGNhcGFjaXR5OworICAgICAgICBpZiAob2xkVG1wUG9pbnRlckNvb3JkcyAhPSBudWxsKSB7CisgICAgICAgICAgICBjYXBhY2l0eSA9IG9sZFRtcFBvaW50ZXJDb29yZHMubGVuZ3RoOworICAgICAgICAgICAgaWYgKGRlc2lyZWRDYXBhY2l0eSA8PSBjYXBhY2l0eSkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNhcGFjaXR5ID0gNDsKKyAgICAgICAgfQorCisgICAgICAgIHdoaWxlIChjYXBhY2l0eSA8IGRlc2lyZWRDYXBhY2l0eSkgeworICAgICAgICAgICAgY2FwYWNpdHkgKj0gMjsKKyAgICAgICAgfQorCisgICAgICAgIG1UbXBQb2ludGVySW5kZXhNYXAgPSBuZXcgaW50W2NhcGFjaXR5XTsKKyAgICAgICAgbVRtcFBvaW50ZXJJZHMgPSBuZXcgaW50W2NhcGFjaXR5XTsKKyAgICAgICAgbVRtcFBvaW50ZXJDb29yZHMgPSBuZXcgTW90aW9uRXZlbnQuUG9pbnRlckNvb3Jkc1tjYXBhY2l0eV07CisKKyAgICAgICAgaWYgKG9sZFRtcFBvaW50ZXJDb29yZHMgIT0gbnVsbCkgeworICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShvbGRUbXBQb2ludGVyQ29vcm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QogICAgICAgICAvLyBmaXJzdCBzZW5kIGl0IGFuIEFDVElPTl9DQU5DRUwgbW90aW9uIGV2ZW50LgotICAgICAgICBpZiAobU1vdGlvblRhcmdldCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmaW5hbCBsb25nIG5vdyA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOwotICAgICAgICAgICAgZmluYWwgTW90aW9uRXZlbnQgZXZlbnQgPSBNb3Rpb25FdmVudC5vYnRhaW4obm93LCBub3csCi0gICAgICAgICAgICAgICAgICAgIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUwsIDAuMGYsIDAuMGYsIDApOwotICAgICAgICAgICAgbU1vdGlvblRhcmdldC5kaXNwYXRjaFRvdWNoRXZlbnQoZXZlbnQpOwotICAgICAgICAgICAgZXZlbnQucmVjeWNsZSgpOwotICAgICAgICAgICAgbU1vdGlvblRhcmdldCA9IG51bGw7Ci0gICAgICAgIH0KKyAgICAgICAgY2FuY2VsQW5kQ2xlYXJUb3VjaFRhcmdldHMobnVsbCk7CiAKICAgICAgICAgZmluYWwgaW50IGNvdW50ID0gbUNoaWxkcmVuQ291bnQ7CiAgICAgICAgIGZpbmFsIFZpZXdbXSBjaGlsZHJlbiA9IG1DaGlsZHJlbjsKQEAgLTExODcsNyArMTc5OCwxMCBAQAogICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBtQ2hpbGRyZW5Db3VudDsKICAgICAgICAgZmluYWwgVmlld1tdIGNoaWxkcmVuID0gbUNoaWxkcmVuOwogICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKLSAgICAgICAgICAgIGNoaWxkcmVuW2ldLmRpc3BhdGNoU2F2ZUluc3RhbmNlU3RhdGUoY29udGFpbmVyKTsKKyAgICAgICAgICAgIFZpZXcgYyA9IGNoaWxkcmVuW2ldOworICAgICAgICAgICAgaWYgKChjLm1WaWV3RmxhZ3MgJiBQQVJFTlRfU0FWRV9ESVNBQkxF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m9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IGNoaWxkcmVuW2ldOwogICAgICAgICAgICAgICAgIGlmICgoY2hpbGQubVZpZXdGbGFncyAmIFZJU0lCSUxJVFlfTUFTSykgPT0gVklTSUJMRSkgewogICAgICAgICAgICAgICAgICAgICBjaGlsZC5zZXREcmF3aW5nQ2FjaGVFbmFibGVkKHRydWUpOwotICAgICAgICAgICAgICAgICAgICBjaGlsZC5idWlsZERyYXdpbmdDYWNoZSh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGJ1aWxkQ2FjaGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkLmJ1aWxkRHJhd2luZ0NhY2hlKHRydWUpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCkBAIC0xMjk5LDcgKzE5MTksNyBAQAogICAgICAgICBpZiAoc2tpcENoaWxkcmVuKSB7CiAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKICAgICAgICAgICAgICAgICBnZXRDaGlsZEF0KGkpLnNldFZpc2liaWxpdHkodmlzaWJpbGl0aWVzW2ldKTsKLSAgICAgICAgICAgIH0gICAgICAgIAorICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgcmV0dXJuIGI7CkBAIC0xMzE3LDYgKzE5MzcsNyBAQAogICAgICAgICBpZiAoKGZsYWdzICYgRkxBR19SVU5fQU5JTUFUSU9OKSAhPSAwICYmIGNhbkFuaW1hdGUoKSkgewogICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBjYWNoZSA9IChtR3JvdXBGbGFncyAmIEZMQUdfQU5JTUFUSU9OX0NBQ0hFKSA9PSBGTEFHX0FOSU1BVElPTl9DQUNIRTsKIAorICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBidWlsZENhY2hlID0gIWlzSGFyZHdhcmVBY2NlbGVyYXRlZCgpOwogICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IGNoaWxkcmVuW2ldOwogICAgICAgICAgICAgICAgIGlmICgoY2hpbGQubVZpZXdGbGFncyAmIFZJU0lCSUxJVFlfTUFTSykgPT0gVklTSUJMRSkgewpAQCAtMTMyNSw3ICsxOTQ2LDkgQEAKICAgICAgICAgICAgICAgICAgICAgYmluZExheW91dEFuaW1hdGlvbihjaGlsZCk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChjYWNoZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQuc2V0RHJhd2luZ0NhY2hlRW5hYmxlZCh0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkLmJ1aWxkRHJhd2luZ0NhY2hlKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJ1aWxkQ2FjaGUpIHsgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZC5idWlsZERyYXdpbmdDYWNoZSh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTE0MjksNyArMjA1Miw3IEBACiAgICAgICoKICAgICAgKiBAcGFyYW0gaSBUaGUgY3VycmVudCBpdGVyYXRpb24uCiAgICAgICogQHJldHVybiBUaGUgaW5kZXggb2YgdGhlIGNoaWxkIHRvIGRyYXcgdGhpcyBpdGVyYXRpb24uCi0gICAgICogCisgICAgICoKICAgICAgKiBAc2VlICNzZXRDaGlsZHJlbkRyYXdpbmdPcmRlckVuYWJsZWQoYm9vbGVhbikKICAgICAgKiBAc2VlICNpc0NoaWxkcmVuRHJhd2luZ09yZGVyRW5hYmx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syMTU5LDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKGNsLCBjdCwgY3IsIGNiKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGEuZ2V0SW52YWxpZGF0ZVJlZ2lvbigwLCAwLCBjciAtIGNsLCBjYiAtIGN0LCByZWdpb24sIHRyYW5zZm9ybVRvQXBwbHkpOworICAgICAgICAgICAgICAgICAgICBpZiAobUludmFsaWRhdGVSZWdpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUludmFsaWRhdGVSZWdpb24gPSBuZXcgUmVjdEYoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBmaW5hbCBSZWN0RiByZWdpb24gPSBtSW52YWxpZGF0ZVJlZ2lvbjsKKyAgICAgICAgICAgICAgICAgICAgYS5nZXRJbnZhbGlkYXRlUmVnaW9uKDAsIDAsIGNyIC0gY2wsIGNiIC0gY3QsIHJlZ2lvbiwgaW52YWxpZGF0aW9uVHJhbnNmb3JtKTsKIAogICAgICAgICAgICAgICAgICAgICAvLyBUaGUgY2hpbGQgbmVlZCB0byBkcmF3IGFuIGFuaW1hdGlvbiwgcG90ZW50aWFsbHkgb2Zmc2NyZWVuLCBzbwogICAgICAgICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgd2UgZG8gbm90IGNhbmNlbCBpbnZhbGlkYXRlIHJlcXVlc3RzCkBAIC0xNTM4LDkgKzIxNzYsNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgaWYgKChmbGFncyAmIEZMQUdfU1VQUE9SVF9TVEFUSUNfVFJBTlNGT1JNQVRJT05TKSA9PQogICAgICAgICAgICAgICAgIEZMQUdfU1VQUE9SVF9TVEFUSUNfVFJBTlNGT1JNQVRJT05TKSB7Ci0gICAgICAgICAgICBpZiAobUNoaWxkVHJhbnNmb3Jt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yAgICAgICAgICAgICAgICBkaXNwbGF5TGlzdCA9IGNoaWxkLmdldERpc3BsYXlMaXN0KCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAotICAgICAgICBmaW5hbCBib29sZWFuIGhhc05vQ2FjaGUgPSBjYWNoZSA9PSBudWxsOworICAgICAgICBmaW5hbCBib29sZWFuIGhhc0Rpc3BsYXlMaXN0ID0gZGlzcGxheUxpc3QgIT0gbnVsbCAmJiBkaXNwbGF5TGlzdC5pc1JlYWR5KCk7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gaGFzTm9DYWNoZSA9IGNhY2hlID09IG51bGwgfHwgaGFzRGlzcGxheUxpc3Q7CiAKICAgICAgICAgZmluYWwgaW50IHJlc3RvcmVUbyA9IGNhbnZhcy5zYXZlKCk7CiAgICAgICAgIGlmIChoYXNOb0NhY2hlKSB7CkBAIC0xNTg2LDQwICsyMjMzLDU5IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAotICAgICAgICBmbG9hdCBhbHBoYSA9IDEuMGY7Ci0KLSAgICAgICAgaWYgKHRyYW5zZm9ybVRvQXBwbHkgIT0gbnVsbCkgewotICAgICAgICAgICAgaWYgKGNvbmNhdE1hdHJpeCkgeworICAgICAgICBpZiAodHJhbnNmb3JtVG9BcHBseSAhPSBudWxsIHx8IGFscGhhIDwgMS4wZiB8fCAhY2hpbGQuaGFzSWRlbnRpdHlNYXRyaXgoKSkgeworICAgICAgICAgICAgaWYgKHRyYW5zZm9ybVRvQXBwbHkgIT0gbnVsbCB8fCAhY2hpbGRIYXNJZGVudGl0eU1hdHJpeCkgewogICAgICAgICAgICAgICAgIGludCB0cmFuc1ggPSAwOwogICAgICAgICAgICAgICAgIGludCB0cmFuc1kgPSAwOworCiAgICAgICAgICAgICAgICAgaWYgKGhhc05vQ2FjaGUpIHsKICAgICAgICAgICAgICAgICAgICAgdHJhbnNYID0gLXN4OwogICAgICAgICAgICAgICAgICAgICB0cmFuc1kgPSAtc3k7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIFVuZG8gdGhlIHNjcm9sbCB0cmFuc2xhdGlvbiwgYXBwbHkgdGhlIHRyYW5zZm9ybWF0aW9uIG1hdHJpeCwKLSAgICAgICAgICAgICAgICAvLyB0aGVuIHJlZG8gdGhlIHNjcm9sbCB0cmFuc2xhdGUgdG8gZ2V0IHRoZSBjb3JyZWN0IHJlc3VsdC4KLSAgICAgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKC10cmFuc1gsIC10cmFuc1kpOwotICAgICAgICAgICAgICAgIGNhbnZhcy5jb25jYXQodHJhbnNmb3JtVG9BcHBseS5nZXRNYXRyaXgoKSk7Ci0gICAgICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSh0cmFuc1gsIHRyYW5zWSk7Ci0gICAgICAgICAgICAgICAgbUdyb3VwRmxhZ3MgfD0gRkxBR19DTEVBUl9UUkFOU0ZPUk1BVElPTjsKKworICAgICAgICAgICAgICAgIGlmICh0cmFuc2Zvcm1Ub0FwcGx5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmNhdE1hdHJpeCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gVW5kbyB0aGUgc2Nyb2xsIHRyYW5zbGF0aW9uLCBhcHBseSB0aGUgdHJhbnNmb3JtYXRpb24gbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlbiByZWRvIHRoZSBzY3JvbGwgdHJhbnNsYXRlIHRvIGdldCB0aGUgY29ycmVjdCByZXN1bHQuCisgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKC10cmFuc1gsIC10cmFuc1kpOworICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLmNvbmNhdCh0cmFuc2Zvcm1Ub0FwcGx5LmdldE1hdHJpeCgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUodHJhbnNYLCB0cmFuc1kpOworICAgICAgICAgICAgICAgICAgICAgICAgbUdyb3VwRmxhZ3MgfD0gRkxBR19DTEVBUl9UUkFOU0ZPUk1BVElPTjsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGZsb2F0IHRyYW5zZm9ybUFscGhhID0gdHJhbnNmb3JtVG9BcHBseS5nZXRBbHBoYSgpOworICAgICAgICAgICAgICAgICAgICBpZiAodHJhbnNmb3JtQWxwaGEgPCAxLjBmKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYSAqPSB0cmFuc2Zvcm1Ub0FwcGx5LmdldEFscGhhKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtR3JvdXBGbGFncyB8PSBGTEFHX0NMRUFSX1RSQU5TRk9STUFUSU9OOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKCFjaGlsZEhhc0lkZW50aXR5TWF0cml4KSB7CisgICAgICAgICAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoLXRyYW5zWCwgLXRyYW5zWSk7CisgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5jb25jYXQoY2hpbGQuZ2V0TWF0cml4KCkpOworICAgICAgICAgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKHRyYW5zWCwgdHJhbnNZKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGFscGhhID0gdHJhbnNmb3JtVG9BcHBseS5nZXRBbHBoYSgpOwogICAgICAgICAgICAgaWYgKGFscGhhIDwgMS4wZikgewogICAgICAgICAgICAgICAgIG1Hcm91cEZsYWdzIHw9IEZMQUdfQ0xFQVJfVFJBTlNGT1JNQVRJT047Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChhbHBoYSA8IDEuMGYgJiYgaGFzTm9DYWNoZSkgewotICAgICAgICAgICAgICAgIGZpbmFsIGludCBtdWx0aXBsaWVkQWxwaGEgPSAoaW50KSAoMjU1ICogYWxwaGEpOwotICAgICAgICAgICAgICAgIGlmICghY2hpbGQub25TZXRBbHBoYShtdWx0aXBsaWVkQWxwaGEpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5zYXZlTGF5ZXJBbHBoYShzeCwgc3ksIHN4ICsgY3IgLSBjbCwgc3kgKyBjYiAtIGN0LCBtdWx0aXBsaWVkQWxwaGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkhBU19BTFBIQV9MQVlFUl9TQVZFX0ZMQUcgfCBDYW52YXMuQ0xJUF9UT19MQVlFUl9TQVZFX0ZMQUcpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGNoaWxkLm1Qcml2YXRlRmxhZ3MgfD0gQUxQSEFfU0VUOworICAgICAgICAgICAgICAgIGlmIChoYXNOb0NhY2hlKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBtdWx0aXBsaWVkQWxwaGEgPSAoaW50KSAoMjU1ICogYWxwaGEpOworICAgICAgICAgICAgICAgICAgICBpZiAoIWNoaWxkLm9uU2V0QWxwaGEobXVsdGlwbGllZEFscGhhKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxheWVyRmxhZ3MgPSBDYW52YXMuSEFTX0FMUEhBX0xBWUVSX1NBVkVfRkxBRzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZmxhZ3MgJiBGTEFHX0NMSVBfQ0hJTERSRU4pID09IEZMQUdfQ0xJUF9DSElMRFJFTikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxheWVyRmxhZ3MgfD0gQ2FudmFzLkNMSVBfVE9fTEFZRVJfU0FWRV9GTEFHOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLnNhdmVMYXllckFscGhhKHN4LCBzeSwgc3ggKyBjciAtIGNsLCBzeSArIGNiIC0gY3QsIG11bHRpcGxpZWRBbHBoYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGF5ZXJGbGFncyk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZC5tUHJpdmF0ZUZsYWdzIHw9IEFMUEhBX1NFVDsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIGlmICgoY2hpbGQubVByaXZhdGVGbGFncyAmIEFMUEhBX1NFVCkgPT0gQUxQSEFfU0VUKSB7CiAgICAgICAgICAgICBjaGlsZC5vblNldEFscGhhKDI1NSk7CisgICAgICAgICAgICBjaGlsZC5tUHJpdmF0ZUZsYWdzICY9IH5BTFBIQV9TRVQ7CiAgICAgICAgIH0KIAogICAgICAgICBpZiAoKGZsYWdzICYgRkxBR19DTElQX0NISUxEUkVOKSA9PSBGTEFHX0NMSVBfQ0hJTERSRU4pIHsKQEAgLTE2MzUsMTcgKzIzMDEsMjEgQEAKICAgICAgICAgfQogCiAgICAgICAgIGlmIChoYXNOb0NhY2hlKSB7Ci0gICAgICAgICAgICAvLyBGYXN0IHBhdGggZm9yIGxheW91dHMgd2l0aCBubyBiYWNrZ3JvdW5kcwotICAgICAgICAgICAgaWYgKChjaGlsZC5tUHJpdmF0ZUZsYWdzICYgU0tJUF9EUkFXKSA9PSBTS0lQX0RSQVcpIHsKLSAgICAgICAgICAgICAgICBpZiAoVmlld0RlYnVnLlRSQUNFX0hJRVJBUkNIWSkgewotICAgICAgICAgICAgICAgICAgICBWaWV3RGVidWcudHJhY2UodGhpcywgVmlld0RlYnVnLkhpZXJhcmNoeVRyYWNlVHlwZS5EUkFXKTsKKyAgICAgICAgICAgIGlmICghaGFzRGlzcGxheUxpc3QpIHsKKyAgICAgICAgICAgICAgICAvLyBGYXN0IHBhdGggZm9yIGxheW91dHMgd2l0aCBubyBiYWNrZ3JvdW5kcworICAgICAgICAgICAgICAgIGlmICgoY2hpbGQubVByaXZhdGVGbGFncyAmIFNLSVBfRFJBVykgPT0gU0tJUF9EUkFXKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChWaWV3RGVidWcuVFJBQ0VfSElFUkFSQ0hZKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBWaWV3RGVidWcudHJhY2UodGhpcywgVmlld0RlYnVnLkhpZXJhcmNoeVRyYWNlVHlwZS5EUkFXKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjaGlsZC5tUHJpdmF0ZUZsYWdzICY9IH5ESVJUWV9NQVNLOworICAgICAgICAgICAgICAgICAgICBjaGlsZC5kaXNwYXRjaERyYXcoY2FudmFzKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBjaGlsZC5kcmF3KGNhbnZhcyk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNoaWxkLm1Qcml2YXRlRmxhZ3MgJj0gfkRJUlRZX01BU0s7Ci0gICAgICAgICAgICAgICAgY2hpbGQuZGlzcGF0Y2hEcmF3KGNhbnZhcyk7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGNoaWxkLmRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgICAgICAoKEhhcmR3YXJlQ2FudmFzKSBjYW52YXMpLmRyYXdEaXNwbGF5TGlzdChkaXNwbGF5TGlzdCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7CisgICAgICAgIH0gZWxzZSBpZiAoY2FjaGUgIT0gbnVsbCkgewogICAgICAgICAgICAgZmluYWwgUGFpbnQgY2FjaGVQYWludCA9IG1DYWNoZVBhaW50OwogICAgICAgICAgICAgaWYgKGFscGhhIDwgMS4wZikgewogICAgICAgICAgICAgICAgIGNhY2hlUGFpbnQuc2V0QWxwaGEoKGludCkgKGFscGhhICogMjU1KSk7CkBAIC0xNjU0LDkgKzIzMjQsNiBAQAogICAgICAgICAgICAgICAgIGNhY2hlUGFpbnQuc2V0QWxwaGEoMjU1KTsKICAgICAgICAgICAgICAgICBtR3JvdXBGbGFncyAmPSB+RkxBR19BTFBIQV9MT1dFUl9USEFOX09ORTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChDb25maWcuREVCVUcgJiYgVmlld0RlYnVnLnByb2ZpbGVEcmF3aW5nKSB7Ci0gICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudCg2MDAwMywgaGFzaENvZGUoKSk7Ci0gICAgICAgICAgICB9CiAgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChjYWNoZSwgMC4wZiwgMC4wZiwgY2FjaGVQYWludCk7CiAgICAgICAgIH0KIApAQCAtMTcwMiwxMCArMjM2OSwyNCBAQAogICAgICAgICBmaW5hbCBWaWV3W10gY2hpbGRyZW4gPSBtQ2hpbGRyZW47CiAgICAgICAgIGZpbmFsIGludCBjb3VudCA9IG1DaGlsZHJlbkNvdW50OwogICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKwogICAgICAgICAgICAgY2hpbGRyZW5baV0uc2V0U2VsZWN0ZWQoc2VsZWN0ZWQpOwogICAgICAgICB9CiAgICAgfQogCisgICAgLyoqCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoU2V0QWN0aXZhdGVkKGJvb2xlYW4gYWN0aXZhdGVkKSB7CisgICAgICAgIGZpbmFsIFZpZXdbXSBjaGlsZHJlbiA9IG1DaGlsZHJlbjsKKyAgICAgICAgZmluYWwgaW50IGNvdW50ID0gbUNoaWxkcmVuQ291bnQ7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworCisgICAgICAgICAgICBjaGlsZHJlbltpXS5zZXRBY3RpdmF0ZWQoYWN0aXZhdGVkKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIEBPdmVycmlkZQogICAgIHByb3RlY3RlZCB2b2lkIGRpc3BhdGNoU2V0UHJlc3NlZChib29sZWFuIHByZXNzZWQpIHsKICAgICAgICAgZmluYWwgVmlld1tdIGNoaWxkcmVuID0gbUNoaWxkcmVuOwpAQCAtMTk3Nyw2ICsyNjU4LDEwIEBACiAgICAgICAgICAgICAgICAgICAgICJZb3UgbXVzdCBjYWxsIHJlbW92ZVZpZXcoKSBvbiB0aGUgY2hpbGQncyBwYXJlbnQgZmlyc3QuIik7CiAgICAgICAgIH0KIAorICAgICAgICBpZiAobVRyYW5zaXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgbVRyYW5zaXRpb24uYWRkQ2hpbGQodGhpcywgY2hpbGQpOworICAgICAgICB9CisKICAgICAgICAgaWYgKCFjaGVja0xheW91dFBhcmFtcyhwYXJhbXMpKSB7CiAgICAgICAgICAgICBwYXJhbXMgPSBnZW5lcmF0ZUxheW91dFBhcmFtcyhwYXJhbXMpOwogICAgICAgICB9CkBAIC0yMDU0LDcgKzI3MzksOSBAQAogICAgIC8vIFRoaXMgbWV0aG9kIGFsc28gc2V0cyB0aGUgY2hpbGQncyBtUGFyZW50IHRvIG51bGwKICAgICBwcml2YXRlIHZvaWQgcmVtb3ZlRnJvbUFycmF5KGludCBpbmRleCkgewogICAgICAgICBmaW5hbCBWaWV3W10gY2hpbGRyZW4gPSBtQ2hpbGRyZW47Ci0gICAgICAgIGNoaWxkcmVuW2luZGV4XS5tUGFyZW50ID0gbnVsbDsKKyAgICAgICAgaWYgKCEobVRyYW5zaXRpb25pbmdWaWV3cyAhPSBudWxsICYmIG1UcmFuc2l0aW9uaW5nVmlld3MuY29udGFpbnMoY2hpbGRyZW5baW5kZXhdKSkpIHsKKyAgICAgICAgICAgIGNoaWxkcmVuW2luZGV4XS5tUGFyZW50ID0gbnVsbDsKKyAgICAgICAgfQogICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBtQ2hpbGRyZW5Db3VudDsKICAgICAgICAgaWYgKGluZGV4ID09IGNvdW50IC0gMSkgewogICAgICAgICAgICAgY2hpbGRyZW5bLS1tQ2hpbGRyZW5Db3VudF0gPSBudWxsOwpAQCAtMjE4OSwxMyArMjg3NiwxOSBAQAogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCByZW1vdmVWaWV3SW50ZXJuYWwoaW50IGluZGV4LCBWaWV3IHZpZXcpIHsKKworICAgICAgICBpZiAobVRyYW5zaXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgbVRyYW5zaXRpb24ucmVtb3ZlQ2hpbGQodGhpcywgdmlldyk7CisgICAgICAgIH0KKwogICAgICAgICBib29sZWFuIGNsZWFyQ2hpbGRGb2N1cyA9IGZhbHNlOwogICAgICAgICBpZiAodmlldyA9PSBtRm9jdXNlZCkgewogICAgICAgICAgICAgdmlldy5jbGVhckZvY3VzRm9yUmVtb3ZhbCgpOwogICAgICAgICAgICAgY2xlYXJDaGlsZEZvY3VzID0gdHJ1ZTsKICAgICAgICAgfQogCi0gICAgICAgIGlmICh2aWV3LmdldEFuaW1hdGlvbigpICE9IG51bGwpIHsKKyAgICAgICAgaWYgKHZpZXcuZ2V0QW5pbWF0aW9uKCkgIT0gbnVsbCB8fAorICAgICAgICAgICAgICAgIChtVHJhbnNpdGlvbmluZ1ZpZXdzICE9IG51bGwgJiYgbVRyYW5zaXRpb25pbmdWaWV3cy5jb250YWlucyh2aWV3KSkpIHsKICAgICAgICAgICAgIGFkZERpc2FwcGVhcmluZ1ZpZXcodmlldyk7CiAgICAgICAgIH0gZWxzZSBpZiAodmlldy5tQXR0YWNoSW5mbyAhPSBudWxsKSB7CiAgICAgICAgICAgIHZpZXcuZGlzcGF0Y2hEZXRhY2hlZEZyb21XaW5kb3coKTsKQEAgLTIyMTQsNiArMjkwNywzOSBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgLyoqCisgICAgICogU2V0cy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vbigpIHsKKyAgICAgICAgcmV0dXJuIG1UcmFuc2l0aW9uOworICAgIH0KKwogICAgIHByaXZhdGUgdm9pZCByZW1vdmVWaWV3c0ludGVybmFsKGludCBzdGFydCwgaW50IGNvdW50KSB7CiAgICAgICAgIGZpbmFsIE9uSGllcmFyY2h5Q2hhbmdlTGlzdGVuZXIgb25IaWVyYXJjaHlDaGFuZ2VMaXN0ZW5lciA9IG1PbkhpZXJhcmNoeUNoYW5nZUxpc3RlbmVyOwogICAgICAgICBmaW5hbCBib29sZWFuIG5vdGlmeUxpc3RlbmVyID0gb25IaWVyYXJjaHlDaGFuZ2VMaXN0ZW5lciAhPSBudWxsOwpAQCAtMjIyNywxMiArMjk1MywxNyBAQAogICAgICAgICBmb3IgKGludCBpID0gc3RhcnQ7IGkgPCBlbmQ7IGkrKykgewogICAgICAgICAgICAgZmluYWwgVmlldyB2aWV3ID0gY2hpbGRyZW5baV07CiAKKyAgICAgICAgICAgIGlmIChtVHJhbnNpdGlvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVRyYW5zaXRpb24ucmVtb3ZlQ2hpbGQodGhpcywgdmlldyk7CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIGlmICh2aWV3ID09IGZvY3VzZWQpIHsKICAgICAgICAgICAgICAgICB2aWV3LmNsZWFyRm9jdXNGb3JSZW1vdmFsKCk7CiAgICAgICAgICAgICAgICAgY2xlYXJDaGlsZEZvY3VzID0gdmlldzsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaWYgKHZpZXcuZ2V0QW5pbWF0aW9uKCkgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKHZpZXcuZ2V0QW5pbWF0aW9uKCkgIT0gbnVsbCB8fAorICAgICAgICAgICAgICAgIChtVHJhbnNpdGlvbmluZ1ZpZXdzICE9IG51bGwgJiYgbVRyYW5zaXRpb25pbmdWaWV3cy5jb250YWlucyh2aWV3KSkpIHsKICAgICAgICAgICAgICAgICBhZGREaXNhcHBlYXJpbmdWaWV3KHZpZXcpOwogICAgICAgICAgICAgfSBlbHNlIGlmIChkZXRhY2gpIHsKICAgICAgICAgICAgICAgIHZpZXcuZGlzcGF0Y2hEZXRhY2hlZEZyb21XaW5kb3coKTsKQEAgLTIyOTEsMTIgKzMwMjIsMTcgQEAKICAgICAgICAgZm9yIChpbnQgaSA9IGNvdW50IC0gMTsgaSA+PSAwOyBpLS0pIHsKICAgICAgICAgICAgIGZpbmFsIFZpZXcgdmlldyA9IGNoaWxkcmVuW2ldOwogCisgICAgICAgICAgICBpZiAobVRyYW5zaXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1UcmFuc2l0aW9uLnJlbW92ZUNoaWxkKHRoaXMsIHZpZXcpOworICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBpZiAodmlldyA9PSBmb2N1c2VkKSB7CiAgICAgICAgICAgICAgICAgdmlldy5jbGVhckZvY3VzRm9yUmVtb3ZhbCgpOwogICAgICAgICAgICAgICAgIGNsZWFyQ2hpbGRGb2N1cyA9IHZpZXc7CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmICh2aWV3LmdldEFuaW1hdGlvbigpICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmICh2aWV3LmdldEFuaW1hdGlvbigpICE9IG51bGwgfHwKKyAgICAgICAgICAgICAgICAgICAgKG1UcmFuc2l0aW9uaW5nVmlld3MgIT0gbnVsbCAmJiBtVHJhbnNpdGlvbmluZ1ZpZXdzLmNvbnRhaW5zKHZpZXcpKSkgewogICAgICAgICAgICAgICAgIGFkZERpc2FwcGVhcmluZ1ZpZXcodmlldyk7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKGRldGFjaCkgewogICAgICAgICAgICAgICAgdmlldy5kaXNwYXRjaERldGFjaGVkRnJvbVdpbmRvdygpOwpAQCAtMjMyOSwxMSArMzA2NSwxNiBAQAogICAgICAqIEBzZWUgI2RldGFjaFZpZXdGcm9tUGFyZW50KGludCkKICAgICAgK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gICAgICAgICBsb2NhdGlvbltDSElMRF9UT1BfSU5ERVhdID0gY2hpbGQubVRvcDsKLQogICAgICAgICAgICAgLy8gSWYgdGhlIGNoaWxkIGlzIGRyYXdpbmcgYW4gYW5pbWF0aW9uLCB3ZSB3YW50IHRvIGNvcHkgdGhpcyBmbGFnIG9udG8KICAgICAgICAgICAgIC8vIG91cnNlbHZlcyBhbmQgdGhlIHBhcmVudCB0byBtYWtlIHN1cmUgdGhlIGludmFsaWRhdGUgcmVxdWVzdCBnb2VzCiAgICAgICAgICAgICAvLyB0aHJvdWdoCkBAIC0yNDgzLDMzICszMjIwLDk1IEBACiAKICAgICAgICAgICAgIC8vIENoZWNrIHdoZXRoZXIgdGhlIGNoaWxkIHRoYXQgcmVxdWVzdHMgdGhlIGludmFsaWRhdGUgaXMgZnVsbHkgb3BhcXVlCiAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGlzT3BhcXVlID0gY2hpbGQuaXNPcGFxdWUoKSAmJiAhZHJhd0FuaW1hdGlvbiAmJgotICAgICAgICAgICAgICAgICAgICBjaGlsZC5nZXRBbmltYXRpb24oKSAhPSBudWxsOworICAgICAgICAgICAgICAgICAgICBjaGlsZC5nZXRBbmltYXRpb24oKSA9PSBudWxsOwogICAgICAgICAgICAgLy8gTWFyayB0aGUgY2hpbGQgYXMgZGlydHksIHVzaW5nIHRoZSBhcHByb3ByaWF0ZSBmbGFnCiAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgd2UgZG8gbm90IHNldCBib3RoIGZsYWdzIGF0IHRoZSBzYW1lIHRpbWUKICAgICAgICAgICAgIGZpbmFsIGludCBvcGFxdWVGbGFnID0gaXNPcGFxdWUgPyBESVJUWV9PUEFRVUUgOiBESVJUWTsKIAotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIFZpZXcgdmlldyA9IG51bGw7Ci0gICAgICAgICAgICAgICAgaWYgKHBhcmVudCBpbnN0YW5jZW9mIFZpZXcpIHsKLSAgICAgICAgICAgICAgICAgICAgdmlldyA9IChWaWV3KSBwYXJlbnQ7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGRyYXdBbmltYXRpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgdmlldy5tUHJpdmF0ZUZsYWdzIHw9IERSQVdfQU5JTUFUSU9OOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHBhcmVudCBpbnN0YW5jZW9mIFZpZXdSb290KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAoKFZpZXdSb290KSBwYXJlbnQpLm1Jc0FuaW1hdGluZyA9IHRydWU7CisgICAgICAgICAgICBpZiAoZGlydHkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICAgICAgVmlldyB2aWV3ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmVudCBpbnN0YW5jZW9mIFZpZXcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZpZXcgPSAoVmlldykgcGFyZW50OworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2aWV3Lm1Qcml2YXRlRmxhZ3MgJiBESVJUWV9NQVNLKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWxyZWFkeSBtYXJrZWQgZGlydHkgLSB3ZSdyZSBkb25lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoZHJhd0FuaW1hdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXcubVByaXZhdGVGbGFncyB8PSBEUkFXX0FOSU1BVElPTjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyZW50IGluc3RhbmNlb2YgVmlld1Jvb3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFZpZXdSb290KSBwYXJlbnQpLm1Jc0FuaW1hdGluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAocGFyZW50IGluc3RhbmNlb2YgVmlld1Jvb3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICgoVmlld1Jvb3QpIHBhcmVudCkuaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2aWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobVByaXZhdGVGbGFncyAmIERSQVdOKSA9PSBEUkFXTikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXcubVByaXZhdGVGbGFncyAmPSB+RFJBV0lOR19DQUNIRV9WQUxJRDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmlldyAhPSBudWxsICYmICh2aWV3Lm1Qcml2YXRlRmxhZ3MgJiBESVJUWV9NQVNLKSAhPSBESVJUWSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWV3Lm1Qcml2YXRlRmxhZ3MgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2aWV3Lm1Qcml2YXRlRmxhZ3MgJiB+RElSVFlfTUFTSykgfCBvcGFxdWVGbGFnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQgPSB2aWV3Lm1QYXJlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IHdoaWxlIChwYXJlbnQgIT0gbnVsbCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGZpbmFsIGludFtdIGxvY2F0aW9uID0gYXR0YWNoSW5mby5tSW52YWxpZGF0ZUNoaWxkTG9jYXRpb247CisgICAgICAgICAgICAgICAgbG9jYXRpb25bQ0hJTERfTEVGVF9JTkRFWF0gPSBjaGlsZC5tTGVmdDsKKyAgICAgICAgICAgICAgICBsb2NhdGlvbltDSElMRF9UT1BfSU5ERVhdID0gY2hpbGQubVRvcDsKKyAgICAgICAgICAgICAgICBNYXRyaXggY2hpbGRNYXRyaXggPSBjaGlsZC5nZXRNYXRyaXgoKTsKKyAgICAgICAgICAgICAgICBpZiAoIWNoaWxkTWF0cml4LmlzSWRlbnRpdHkoKSkgeworICAgICAgICAgICAgICAgICAgICBSZWN0RiBib3VuZGluZ1JlY3QgPSBhdHRhY2hJbmZvLm1UbXBUcmFuc2Zvcm1SZWN0OworICAgICAgICAgICAgICAgICAgICBib3VuZGluZ1JlY3Quc2V0KGRpcnR5KTsKKyAgICAgICAgICAgICAgICAgICAgY2hpbGRNYXRyaXgubWFwUmVjdChib3VuZGluZ1JlY3QpOworICAgICAgICAgICAgICAgICAgICBkaXJ0eS5zZXQoKGludCkgYm91bmRpbmdSZWN0LmxlZnQsIChpbnQpIGJvdW5kaW5nUmVjdC50b3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgKGJvdW5kaW5nUmVjdC5yaWdodCArIDAuNWYpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIChib3VuZGluZ1JlY3QuYm90dG9tICsgMC41ZikpOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIC8vIElmIHRoZSBwYXJlbnQgaXMgZGlydHkgb3BhcXVlIG9yIG5vdCBkaXJ0eSwgbWFyayBpdCBkaXJ0eSB3aXRoIHRoZSBvcGFxdWUKLSAgICAgICAgICAgICAgICAvLyBmbGFnIGNvbWluZyBmcm9tIHRoZSBjaGlsZCB0aGF0IGluaXRpYXRlZCB0aGUgaW52YWxpZGF0ZQotICAgICAgICAgICAgICAgIGlmICh2aWV3ICE9IG51bGwgJiYgKHZpZXcubVByaXZhdGVGbGFncyAmIERJUlRZX01BU0spICE9IERJUlRZKSB7Ci0gICAgICAgICAgICAgICAgICAgIHZpZXcubVByaXZhdGVGbGFncyA9ICh2aWV3Lm1Qcml2YXRlRmxhZ3MgJiB+RElSVFlfTUFTSykgfCBvcGFxdWVGbGFnOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgICAgIFZpZXcgdmlldyA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnQgaW5zdGFuY2VvZiBWaWV3KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2aWV3ID0gKFZpZXcpIHBhcmVudDsKKyAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgcGFyZW50ID0gcGFyZW50LmludmFsaWRhdGVDaGlsZEluUGFyZW50KGxvY2F0aW9uLCBkaXJ0eSk7Ci0gICAgICAgICAgICB9IHdoaWxlIChwYXJlbnQgIT0gbnVsbCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChkcmF3QW5pbWF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlldy5tUHJpdmF0ZUZsYWdzIHw9IERSQVdfQU5JTUFUSU9OOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwYXJlbnQgaW5zdGFuY2VvZiBWaWV3Um9vdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoVmlld1Jvb3QpIHBhcmVudCkubUlzQW5pbWF0aW5nID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBwYXJlbnQgaXMgZGlydHkgb3BhcXVlIG9yIG5vdCBkaXJ0eSwgbWFyayBpdCBkaXJ0eSB3aXRoIHRoZSBvcGFxdWUKKyAgICAgICAgICAgICAgICAgICAgLy8gZmxhZyBjb21pbmcgZnJvbSB0aGUgY2hpbGQgdGhhdCBpbml0aWF0ZWQgdGhlIGludmFsaWRhdGUKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCAmJiAodmlldy5tUHJpdmF0ZUZsYWdzICYgRElSVFlfTUFTSykgIT0gRElSVFkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZpZXcubVByaXZhdGVGbGFncyA9ICh2aWV3Lm1Qcml2YXRlRmxhZ3MgJiB+RElSVFlfTUFTSykgfCBvcGFxdWVGbGFnOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgcGFyZW50ID0gcGFyZW50LmludmFsaWRhdGVDaGlsZEluUGFyZW50KGxvY2F0aW9uLCBkaXJ0eSk7CisgICAgICAgICAgICAgICAgICAgIGlmICh2aWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFjY291bnQgZm9yIHRyYW5zZm9ybSBvbiBjdXJyZW50IHBhcmVudAorICAgICAgICAgICAgICAgICAgICAgICAgTWF0cml4IG0gPSB2aWV3LmdldE1hdHJpeCgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtLmlzSWRlbnRpdHkoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlY3RGIGJvdW5kaW5nUmVjdCA9IGF0dGFjaEluZm8ubVRtcFRyYW5zZm9ybVJlY3Q7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRpbmdSZWN0LnNldChkaXJ0eSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbS5tYXBSZWN0KGJvdW5kaW5nUmVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlydHkuc2V0KChpbnQpIGJvdW5kaW5nUmVjdC5sZWZ0LCAoaW50KSBib3VuZGluZ1JlY3QudG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgKGJvdW5kaW5nUmVjdC5yaWdodCArIDAuNWYpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgKGJvdW5kaW5nUmVjdC5ib3R0b20gKyAwLjVmKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IHdoaWxlIChwYXJlbnQgIT0gbnVsbCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTI4NzUsNyArMzY3NCw3IEBACiAgICAgICovCiAgICAgQFZpZXdEZWJ1Zy5FeHBvcnRlZFByb3BlcnR5KGNhdGVnb3J5ID0gImRyYXdpbmciLCBtYXBwaW5nID0gewogICAgICAgICBAVmlld0RlYnVnLkludFRvU3RyaW5nKGZyb20gPSBQRVJTSVNURU5UX05PX0NBQ0hFLCAgICAgICAgdG8gPSAiTk9ORSIpLAotICAgICAgICBAVmlld0RlYnVnLkludFRvU3RyaW5nKGZyb20gPSBQRVJTSVNURU5UX0FMTF9DQUNIRVMsICAgICAgdG8gPSAiQU5JTUFUSU9OIiksCisgICAgICAgIEBWaWV3RGVidWcuSW50VG9TdHJpbmcoZnJvbSA9IFBFUlNJU1RFTlRfQU5JTUFUSU9OX0NBQ0hFLCB0byA9ICJBTklNQVRJT04iKSwKICAgICAgICAgQFZpZXdEZWJ1Zy5JbnRUb1N0cmluZyhmcm9tID0gUEVSU0lTVEVOVF9TQ1JPTExJTkdfQ0FDSEUsIHRvID0gIlNDUk9MT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iAodmlldy5tUGFyZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZpZXcubVBhcmVudCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUdyb3VwRmxhZ3MgfD0gRkxBR19JTlZBTElEQVRFX1JFUVVJUkVEOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBMYXlvdXRUcmFuc2l0aW9uLlRyYW5zaXRpb25MaXN0ZW5lciBtTGF5b3V0VHJhbnNpdGlvbkxpc3RlbmVyID0KKyAgICAgICAgICAgIG5ldyBMYXlvdXRUcmFuc2l0aW9uLlRyYW5zaXRpb25MaXN0ZW5lcigpIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHN0YXJ0VHJhbnNpdGlvbihMYXlvdXRUcmFuc2l0aW9uIHRyYW5zaXRpb24sIFZpZXdHcm91cCBjb250YWluZXIsCisgICAgICAgICAgICAgICAgVmlldyB2aWV3LCBpbnQgdHJhbnNpdGlvblR5cGUpIHsKKyAgICAgICAgICAgIC8vIFdlIG9ubHkgY2FyZSBhYm91dCBkaXNhcHBlYXJpbmcgaXRlbXMsIHNpbmNlIHdlIG5lZWQgc3BlY2lhbCBsb2dpYyB0byBrZWVwCisgICAgICAgICAgICAvLyB0aG9zZSBpdGVtcyB2aXNpYmxlIGFmdGVyIHRoZXkndmUgYmVlbiAncmVtb3ZlZCcKKyAgICAgICAgICAgIGlmICh0cmFuc2l0aW9uVHlwZSA9PSBMYXlvdXRUcmFuc2l0aW9uLkRJU0FQUEVBUklORykgeworICAgICAgICAgICAgICAgIHN0YXJ0Vmlld1RyYW5zaXRpb24odmlldyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZW5kVHJhbnNpdGlvbihMYXlvdXRU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ICAgICAgIHRhcmdldCA9IG5ldyBUb3VjaFRhcmdldCgpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHRhcmdldCA9IHNSZWN5Y2xlQmluOworICAgICAgICAgICAgICAgICAgICBzUmVjeWNsZUJpbiA9IHRhcmdldC5uZXh0OworICAgICAgICAgICAgICAgICAgICAgc1JlY3ljbGVkQ291bnQtLTsKKyAgICAgICAgICAgICAgICAgICAgdGFyZ2V0Lm5leHQgPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHRhcmdldC5jaGlsZCA9IGNoaWxkOworICAgICAgICAgICAgdGFyZ2V0LnBvaW50ZXJJZEJpdHMgPSBwb2ludGVySWRCaXRzOworICAgICAgICAgICAgcmV0dXJuIHRhcmdldDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHJlY3ljbGUoKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNSZWN5Y2xlTG9jaykgeworICAgICAgICAgICAgICAgIGlmIChzUmVjeWNsZWRDb3VudCA8IE1BWF9SRUNZQ0xFRCkgeworICAgICAgICAgICAgICAgICAgICBuZXh0ID0gc1JlY3ljbGVCaW47CisgICAgICAgICAgICAgICAgICAgIHNSZWN5Y2xlQmluID0gdGhpczsKKyAgICAgICAgICAgICAgICAgICAgc1JlY3ljbGVkQ291bnQgKz0gMTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBuZXh0ID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2hpbGQgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQogfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9WaWV3UGFyZW50LmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC92aWV3L1ZpZXdQYXJlbnQuamF2YQppbmR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V3IFBvaW50RigpOworCiAgICAgLyoqCiAgICAgICogc2VlIHtAbGluayAjcGxheVNvdW5kRWZmZWN0KGludCl9CiAgICAgICovCkBAIC0yNDEsMTMgKzI0MywxMiBAQAogICAgIHB1YmxpYyBWaWV3Um9vdChDb250ZXh0IGNvbnRleHQpIHsKICAgICAgICAgc3VwZXIoKTsKIAotICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZICYmIGx0ID09IG51bGwpIHsKLSAgICAgICAgICAgIGx0ID0gbmV3IExhdGVuY3lUaW1lcigxMDAsIDEwMDApOworICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZKSB7CisgICAgICAgICAgICBpZiAobHQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGx0ID0gbmV3IExhdGVuY3lUaW1lcigxMDAsIDEwMDApOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgLy8gRm9yIGRlYnVnIG9ubHkKLSAgICAgICAgLy8rK3NJbnN0YW5jZUNvdW50OwotCiAgICAgICAgIC8vIEluaXRpYWxpemUgdGhlIHN0YXRpY3Mgd2hlbiB0aGlzIGNsYXNzIGlzIGZpcnN0IGluc3RhbnRpYXRlZC4gVGhpcyBpcwogICAgICAgICAvLyBkb25lIGhlcmUgaW5zdGVhZCBvZiBpbiB0aGUgc3RhdGljIGJsb2NrIGJlY2F1c2UgWnlnb3RlIGRvZXMgbm90CiAgICAgICAgIC8vIGFsbG93IHRoZSBzcGF3bmluZyBvZiB0aHJlYWRzLgpAQCAtMjYyLDcgKzI2Myw3IEBACiAgICAgICAgIG1UZW1wUmVjdCA9IG5ldyBSZWN0KCk7CiAgICAgICAgIG1WaXNSZWN0ID0gbmV3IFJlY3QoKTsKICAgICAgICAgbVdpbkZyYW1lID0gbmV3IFJlY3QoKTsKLSAgICAgICAgbVdpbmRvdyA9IG5ldyBXKHRoaXMsIGNvbnRleHQpOworICAgICAgICBtV2luZG93ID0gbmV3IFcodGhpcyk7CiAgICAgICAgIG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fU1VDQ0VTUykgewotICAgICAgICAgICAgLy8gZ2l2ZS11cCBvbiB1c2luZyBHTAotICAgICAgICAgICAgZGVzdHJveUdMKCk7Ci0gICAgICAgICAgICBtR2xXYW50ZWQgPSBmYWxzZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZCBpbml0aWFsaXplR0xJbm5lcigpIHsKLSAgICAgICAgZmluYWwgRUdMMTAgZWdsID0gKEVHTDEwKSBFR0xDb250ZXh0LmdldEVHTCgpOwotICAgICAgICBtRWdsID0gZWdsOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEdldCB0byB0aGUgZGVmYXVsdCBkaXNwbGF5LgotICAgICAgICAgKi8KLSAgICAgICAgZmluYWwgRUdMRGlzcGxheSBlZ2xEaXNwbGF5ID0gZWdsLmVnbEdldERpc3BsYXkoRUdMMTAuRUdMX0RFRkFVTFRfRElTUExBWSk7Ci0gICAgICAgIG1FZ2xEaXNwbGF5ID0gZWdsRGlzcGxheTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBXZSBjYW4gbm93IGluaXRpYWxpemUgRUdMIGZvciB0aGF0IGRpc3BsYXkKLSAgICAgICAgICovCi0gICAgICAgIGludFtdIHZlcnNpb24gPSBuZXcgaW50WzJdOwotICAgICAgICBlZ2wuZWdsSW5pdGlhbGl6ZShlZ2xEaXNwbGF5LCB2ZXJzaW9uKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBTcGVjaWZ5IGEgY29uZmlndXJhdGlvbiBmb3Igb3VyIG9wZW5nbCBzZXNzaW9uCi0gICAgICAgICAqIGFuZCBncmFiIHRoZSBmaXJzdCBjb25maWd1cmF0aW9uIHRoYXQgbWF0Y2hlcyBpcwotICAgICAgICAgKi8KLSAgICAgICAgZmluYWwgaW50W10gY29uZmlnU3BlYyA9IHsKLSAgICAgICAgICAgICAgICBFR0wxMC5FR0xfUkVEX1NJWkUsICAgICAgNSwKLSAgICAgICAgICAgICAgICBFR0wxMC5FR0xfR1JFRU5fU0laRSwgICAgNiwKLSAgICAgICAgICAgICAgICBFR0wxMC5FR0xfQkxVRV9TSVpFLCAgICAgNSwKLSAgICAgICAgICAgICAgICBFR0wxMC5FR0xfREVQVEhfU0laRSwgICAgMCwKLSAgICAgICAgICAgICAgICBFR0wxMC5FR0xfTk9ORQotICAgICAgICB9OwotICAgICAgICBmaW5hbCBFR0xDb25maWdbXSBjb25maWdzID0gbmV3IEVHTENvbmZpZ1sxXTsKLSAgICAgICAgZmluYWwgaW50W10gbnVtX2NvbmZpZyA9IG5ldyBpbnRbMV07Ci0gICAgICAgIGVnbC5lZ2xDaG9vc2VDb25maWcoZWdsRGlzcGxheSwgY29uZmlnU3BlYywgY29uZmlncywgMSwgbnVtX2NvbmZpZyk7Ci0gICAgICAgIGZpbmFsIEVHTENvbmZpZyBjb25maWcgPSBjb25maWdzWzBdOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIENyZWF0ZSBhbiBPcGVuR0wgRVMgY29udGV4dC4gVGhpcyBtdXN0IGJlIGRvbmUgb25seSBvbmNlLCBhbgotICAgICAgICAgKiBPcGVuR0wgY29udGV4dCBpcyBhIHNvbWV3aGF0IGhlYXZ5IG9iamVjdC4KLSAgICAgICAgICovCi0gICAgICAgIGZpbmFsIEVHTENvbnRleHQgY29udGV4dCA9IGVnbC5lZ2xDcmVhdGVDb250ZXh0KGVnbERpc3BsYXksIGNvbmZpZywKLSAgICAgICAgICAgICAgICBFR0wxMC5FR0xfTk9fQ09OVEVYVCwgbnVsbCk7Ci0gICAgICAgIG1FZ2xDb250ZXh0ID0gY29udGV4dDsKLQotICAgICAgICAvKgotICAgICAgICAgKiBDcmVhdGUgYW4gRUdMIHN1cmZhY2Ugd2UgY2FuIHJlbmRlciBpbnRvLgotICAgICAgICAgKi8KLSAgICAgICAgZmluYWwgRUdMU3VyZmFjZSBzdXJmYWNlID0gZWdsLmVnbENyZWF0ZVdpbmRvd1N1cmZhY2UoZWdsRGlzcGxheSwgY29uZmlnLCB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VnbERlc3Ryb3lDb250ZXh0KG1FZ2xEaXNwbGF5LCBtRWdsQ29udGV4dCk7Ci0gICAgICAgIG1FZ2wuZWdsRGVzdHJveVN1cmZhY2UobUVnbERpc3BsYXksIG1FZ2xTdXJmYWNlKTsKLSAgICAgICAgbUVnbC5lZ2xUZXJtaW5hdGUobUVnbERpc3BsYXkpOwotICAgICAgICBtRWdsQ29udGV4dCA9IG51bGw7Ci0gICAgICAgIG1FZ2xTdXJmYWNlID0gbnVsbDsKLSAgICAgICAgbUVnbERpc3BsYXkgPSBudWxsOwotICAgICAgICBtRWdsID0gbnVsbDsKLSAgICAgICAgbUdsQ2FudmFzID0gbnVsbDsKLSAgICAgICAgbUdMID0gbnVsbDsKLSAgICAgICAgbVVzZUdMID0gZmFsc2U7Ci0gICAgfQotCi0gICAgcHJpdmF0ZSB2b2lkIGNoZWNrRWdsRXJyb3JzKCkgewotICAgICAgICBpZiAobVVzZUdMKSB7Ci0gICAgICAgICAgICBpbnQgZXJyID0gbUVnbC5lZ2xHZXRFcnJvcigpOwotICAgICAgICAgICAgaWYgKGVyciAhPSBFR0wxMC5FR0xfU1VDQ0VTUykgewotICAgICAgICAgICAgICAgIC8vIHNvbWV0aGluZyBiYWQgaGFzIGhhcHBlbmVkIHJldmVydCB0bwotICAgICAgICAgICAgICAgIC8vIG5vcm1hbCByZW5kZXJpbmcuCi0gICAgICAgICAgICAgICAgZGVzdHJveUdMKCk7Ci0gICAgICAgICAgICAgICAgaWYgKGVyciAhPSBFR0wxMS5FR0xfQ09OVEVYVF9MT1NUKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHdlJ2xsIHRyeSBhZ2FpbiBpZiBpdCB3YXMgY29udGV4dCBsb3N0Ci0gICAgICAgICAgICAgICAgICAgIG1HbFdhbnRlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQogICAgIC8qKgogICAgICAqIFdlIGhhdmUgb25lIGNoaWxkCiAgICAgICovCi0gICAgcHVibGljIHZvaWQgc2V0VmlldyhWaWV3IHZpZXcsIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIGF0dHJzLAotICAgICAgICAgICAgVmlldyBwYW5lbFBhcmVudFZpZXcpIHsKKyAgICBwdWJsaWMgdm9pZCBzZXRWaWV3KFZpZXcgdmlldywgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMgYXR0cnMsIFZpZXcgcGFuZWxQYXJlbnRWaWV3KSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaWYgKG1WaWV3ID09IG51bGwpIHsKICAgICAgICAgICAgICAgICBtVmlldyA9IHZpZXc7CiAgICAgICAgICAgICAgICAgbVdpbmRvd0F0dHJpYnV0ZXMuY29weUZyb20oYXR0cnMpOwogICAgICAgICAgICAgICAgIGF0dHJzID0gbVdpbmRvd0F0dHJpYnV0ZXM7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgZW5hYmxlSGFyZHdhcmVBY2NlbGVyYXRpb24oYXR0cnMpOworCiAgICAgICAgICAgICAgICAgaWYgKHZpZXcgaW5zdGFuY2VvZiBSb290Vmlld1N1cmZhY2VUYWtlcikgewogICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZUhvbGRlckNhbGxiYWNrID0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFJvb3RWaWV3U3VyZmFjZVRha2VyKXZpZXcpLndpbGxZb3VUYWtlVGhlU3VyZmFjZSgpOwpAQCAtNTc1LDYgKzQ1OSwyNCBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIGVuYWJsZUhhcmR3YXJlQWNjZWxlcmF0aW9uKFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIGF0dHJzKSB7CisgICAgICAgIC8vIE9ubHkgZW5hYmxlIGhhcmR3YXJlIGFjY2VsZXJhdGlvbiBpZiB3ZSBhcmUgbm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dGFjaEluZm8ubUhhcmR3YXJlUmVuZGVyZXIgIT0gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKwogICAgIHB1YmxpYyBWaWV3IGdldFZpZXcoKSB7CiAgICAgICAgIHJldHVybiBtVmlldzsKICAgICB9CkBAIC02NDEsNiArNTQzLDExIEBACiAgICAgcHVibGljIHZvaWQgaW52YWxpZGF0ZUNoaWxkKFZpZXcgY2hpbGQsIFJlY3QgZGlydHkpIHsKICAgICAgICAgY2hlY2tUaHJlYWQoKTsKICAgICAgICAgaWYgKERFQlVHX0RSQVcpIExvZy52KFRBRywgIkludmFsaWRhdGUgY2hpbGQ6ICIgKyBkaXJ0eSk7CisgICAgICAgIGlmIChkaXJ0eSA9PSBudWxsKSB7CisgICAgICAgICAgICAvLyBGYXN0IGludmFsaWRhdGlvbiBmb3IgR0wtZW5hYmxlZCBhcHBsaWNhdGlvbnM7IEdMIG11c3QgcmVkcmF3IGV2ZXJ5dGhpbmcKKyAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQogICAgICAgICBpZiAobUN1clNjcm9sbFkgIT0gMCB8fCBtVHJhbnNsYXRvciAhPSBudWxsKSB7CiAgICAgICAgICAgICBtVGVtcFJlY3Quc2V0KGRpcnR5KTsKICAgICAgICAgICAgIGRpcnR5ID0gbVRlbXBSZWN0OwpAQCAtNjU5LDYgKzU2NiwxMSBAQAogICAgICAgICAgICAgc2NoZWR1bGVUcmF2ZXJzYWxzKCk7CiAgICAgICAgIH0KICAgICB9CisgICAgCisgICAgdm9pZCBpbnZhbGlkYXRlKCkgeworICAgICAgICBtRGlydHkuc2V0KDAsIDAsIG1XaWR0aCwgbUhlaWdodCk7CisgICAgICAgIHNjaGVkdWxlVHJhdmVyc2FscygpOworICAgIH0KIAogICAgIHB1YmxpYyBWaWV3UGFyZW50IGdldFBhcmVudCgpIHsKICAgICAgICAgcmV0dXJuIG51bGw7CkBAIC03MzEsOCArNjQzLDYgQEAKICAgICAgICAgYm9vbGVhbiB2aWV3VmlzaWJpbGl0eUNoYW5nZWQgPSBtVmlld1Zpc2liaWxpdHkgIT0gdmlld1Zpc2liaWxpdHkKICAgICAgICAgICAgICAgICB8fCBtTmV3U3VyZmFjZU5lZWRlZDsKIAotICAgICAgICBmbG9hdCBhcHBTY2FsZSA9IG1BdHRhY2hJbmZvLm1BcHBsaWNhdGlvblNjYWxlOwotCiAgICAgICAgIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIHBhcmFtcyA9IG51bGw7CiAgICAgICAgIGlmIChtV2luZG93QXR0cmlidXRlc0NoYW5nZWQpIHsKICAgICAgICAgICAgIG1XaW5kb3dBdHRyaWJ1dGVzQ2hhbmdlZCA9IGZhbHNlOwpAQCAtNzgwLDkgKzY5MCw5IEBACiAgICAgICAgICAgICBhdHRhY2hJbmZvLm1XaW5kb3dWaXNpYmlsaXR5ID0gdmlld1Zpc2liaWxpdHk7CiAgICAgICAgICAgICBob3N0LmRpc3BhdGNoV2luZG93VmlzaWJpbGl0eUNoYW5nZWQodmlld1Zpc2liaWxpdHkpOwogICAgICAgICAgICAgaWYgKHZpZXdWaXNpYmlsaXR5ICE9IFZpZXcuVklTSUJMRSB8fCBtTmV3U3VyZmFjZU5lZWRlZCkgewotICAgICAgICAgICAgICAgIGlmIChtVXNlR0wpIHsKLSAgICAgICAgICAgICAgICAgICAgZGVzdHJveUdMKCk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtQXR0YWNoSW5mby5tSGFyZHdhcmVSZW5kZXJlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1BdHRhY2hJbmZvLm1IYXJkd2FyZVJlbmRlcmVyLmRlc3Ryb3koZmFsc2UpOworICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgCiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAodmlld1Zpc2liaWxpdHkgPT0g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gd2l0aCB0aGUgdWx0aW1hdGVseQogICAgICAgICAgICAgICAgIC8vIGNvbXB1dGVkIGluc2V0cy4KLSAgICAgICAgICAgICAgICBpbnNldHNQZW5kaW5nID0gY29tcHV0ZXNJbnRlcm5hbEluc2V0cwotICAgICAgICAgICAgICAgICAgICAgICAgJiYgKG1GaXJzdCB8fCB2aWV3VmlzaWJpbGl0eUNoYW5nZWQpOwotCi0gICAgICAgICAgICAgICAgaWYgKG1XaW5kb3dBdHRyaWJ1dGVzLm1lbW9yeVR5cGUgPT0gV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuTUVNT1JZX1RZUEVfR1BVKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwYXJhbXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zID0gbVdpbmRvd0F0dHJpYnV0ZXM7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbUdsV2FudGVkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW5zZXRzUGVuZGluZyA9IGNvbXB1dGVzSW50ZXJuYWxJbnNldHMgJiYgKG1GaXJzdCB8fCB2aWV3VmlzaWJpbGl0eUNoYW5nZWQpOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAobVN1cmZhY2VIb2xkZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIG1TdXJmYWNlSG9sZGVyLm1TdXJmYWNlTG9jay5sb2NrKCk7CiAgICAgICAgICAgICAgICAgbURyYXdpbmdBbGxvd2VkID0gdHJ1ZTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAotICAgICAgICAgICAgYm9vbGVhbiBpbml0aWFsaXplZCA9IGZhbHNlOworCisgICAgICAgICAgICBib29sZWFuIGh3SW5pdGlhbGl6ZWQgPSBmYWxzZTsKICAgICAgICAgICAgIGJvb2xlYW4gY29udGVudEluc2V0c0NoYW5nZWQgPSBmYWxzZTsKICAgICAgICAgICAgIGJvb2xlYW4gdmlzaWJsZUluc2V0c0NoYW5nZWQ7CiAgICAgICAgICAgICBib29sZWFuIGhhZFN1cmZhY2UgPSBtU3VyZmFjZS5pc1ZhbGlkKCk7CisKICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgaW50IGZsID0gMDsKICAgICAgICAgICAgICAgICBpZiAocGFyYW1zICE9IG51bGwpIHsKQEAgLTk5MSw5ICs4OTYsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgZnVsbFJlZHJhd05lZWRlZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNUcmFuc3BhcmVudFJlZ2lvbi5zZXRFbXB0eSgpOwogCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobUdsV2FudGVkICYmICFtVXNlR0wpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsaXplR0woKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsaXplZCA9IG1HbENhbnZhcyAhPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1BdHRhY2hJbmZvLm1IYXJkd2FyZVJlbmRlcmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBod0luaXRpYWxpemVkID0gbUF0dGFjaEluZm8ubUhhcmR3YXJlUmVuZGVyZXIuaW5pdGlhbGl6ZShtSG9sZGVyKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIW1TdXJmYWNlLmlzVmFsaWQoKSkgewpAQCAtMTA0MSw2ICs5NDUsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBzdXJmYWNlQ2hhbmdlZCA9IHRydWU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQXR0YWNoSW5mby5tSGFyZHdhcmVSZW5kZXJlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyB3aWxsIGJhaWwgb3V0IGVhcmx5IGlmIGFscmVhZHkgaW5pdGlhbGl6ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0YWNoSW5mby5tSGFyZHdhcmVSZW5kZXJlci5pbml0aWFsaXplKG1Ib2xkZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmIChzdXJmYWNlQ2hhbmdlZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVN1cmZhY2VIb2xkZXJDYWxsYmFjay5zdXJmYWNlQ2hhbmdlZChtU3VyZmFjZUhvbGRlciwKQEAgLTEwNzAsMTAgKzk3OSw5IEBACiAgICAgICAgICAgICAgICAgICAgIG1TdXJmYWNlSG9sZGVyLm1TdXJmYWNlTG9jay51bmxvY2soKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGlmIChpbml0aWFsaXplZCkgewotICAgICAgICAgICAgICAgIG1HbENhbnZhcy5zZXRWaWV3cG9ydCgoaW50KSAobVdpZHRoICogYXBwU2NhbGUgKyAwLjVmKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIChtSGVpZ2h0ICogYXBwU2NhbGUgKyAwLjVmKSk7CisKKyAgICAgICAgICAgIGlmIChod0luaXRpYWxpemVkIHx8ICh3aW5kb3dTaG91bGRSZXNpemUgJiYgbUF0dGFjaEluZm8ubUhhcmR3YXJlUmVuZGVyZXIgIT0gbnVsbCkpIHsKKyAgICAgICAgICAgICAgICBtQXR0YWNoSW5mby5tSGFyZHdhcmVSZW5kZXJlci5zZXR1cChtV2lkdGgsIG1IZWlnaHQpOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBib29sZWFuIGZvY3VzQ2hhbmdlZER1ZVRvVG91Y2hNb2RlID0gZW5zdXJlVG91Y2hNb2RlTG9jYWxseSgKQEAgLTExMzMsNyArMTA0MSw3IEBACiAgICAgICAgICAgICAgICAgVEFHLCAiTGF5aW5nIG91dCAiICsgaG9zdCArICIgdG8gKCIgKwogICAgICAgICAgICAgICAgIGhvc3QubU1lYXN1cmVkV2lkdGggKyAiLCAiICsgaG9zdC5tTWVhc3VyZWRIZWlnaHQgKyAiKSIpOwogICAgICAgICAgICAgbG9uZyBzdGFydFRpbWUgPSAwTDsKLSAgICAgICAgICAgIGlmIChDb25maWcuREVCVUcgJiYgVmlld0RlYnVnLnByb2ZpbGVMYXlvdXQpIHsKKyAgICAgICAgICAgIGlmIChWaWV3RGVidWcuREVCVUdfUFJPRklMRV9MQVlPVVQpIHsKICAgICAgICAgICAgICAgICBzdGFydFRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGhvc3QubGF5b3V0KDAsIDAsIGhvc3QubU1lYXN1cmVkV2lkdGgsIGhvc3QubU1lYXN1cmVkSGVpZ2h0KTsKQEAgLTExNDYsNyArMTA1NCw3IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAoQ29uZmlnLkRFQlVHICYmIFZpZXdEZWJ1Zy5wcm9maWxlTGF5b3V0KSB7CisgICAgICAgICAgICBpZiAoVmlld0RlYnVnLkRFQlVHX1BST0ZJTEVfTEFZT1VUKSB7CiAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudCg2MDAwMSwgU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCkgLSBzdGFydFRpbWUpOwogICAgICAgICAgICAgfQogCkBAIC0xMzQ2LDcgKzEyNTQsOCBAQAogICAgICAgICBpZiAoIXNGaXJzdERyYXdDb21wbGV0ZSkgewogICAgICAgICAgICAgc3luY2hyb25pemVkIChzRmlyc3REcmF3SGFuZGxlcnMpIHsKICAgICAgICAgICAgICAgICBzRmlyc3REcmF3Q29tcGxldGUgPSB0cnVlOwotICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxzRmlyc3REcmF3SGFuZGxlcnMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBzRmlyc3REcmF3SGFuZGxlcnMuc2l6ZSgpOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpPCBjb3VudDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgIHBvc3Qoc0ZpcnN0RHJhd0hhbmRsZXJzLmdldChpKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQpAQCAtMTM3OSw2MSArMTI4OCwyNiBAQAogICAgICAgICAgICAgZGlydHkuc2V0RW1wdHkoKTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgaWYgKG1Vc2VHTCkgewotICAgICAgICAgICAgaWYgKCFkaXJ0eS5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICBDYW52YXMgY2FudmFzID0gbUdsQ2FudmFzOwotICAgICAgICAgICAgICAgIGlmIChtR0wgIT0gbnVsbCAmJiBjYW52YXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtR0wuZ2xEaXNhYmxlKEdMX1NDSVNTT1JfVEVTVCk7Ci0gICAgICAgICAgICAgICAgICAgIG1HTC5nbENsZWFyQ29sb3IoMCwgMCwgMCwgMCk7Ci0gICAgICAgICAgICAgICAgICAgIG1HTC5nbENsZWFyKEdMX0NPTE9SX0JVRkZFUl9CSVQpOwotICAgICAgICAgICAgICAgICAgICBtR0wuZ2xFbmFibGUoR0xfU0NJU1NPUl9URVNUKTsKLQotICAgICAgICAgICAgICAgICAgICBtQXR0YWNoSW5mby5tRHJhd2luZ1RpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgICAgICAgICAgbUF0dGFjaEluZm8ubUlnbm9yZURpcnR5U3RhdGUgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBtVmlldy5tUHJpdmF0ZUZsYWdzIHw9IFZpZXcuRFJBV047Ci0KLSAgICAgICAgICAgICAgICAgICAgaW50IHNhdmVDb3VudCA9IGNhbnZhcy5zYXZlKENhbnZhcy5NQVRSSVhfU0FWRV9GTEFHKTsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMCwgLXlvZmYpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1UcmFuc2xhdG9yICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNsYXRvci50cmFuc2xhdGVDYW52YXMoY2FudmFzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5zZXRTY3JlZW5EZW5zaXR5KHNjYWxpbmdSZXF1aXJlZAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IERpc3BsYXlNZXRyaWNzLkRFTlNJVFlfREVWSUNFIDogMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVmlldy5kcmF3KGNhbnZhcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLkRFQlVHICYmIFZpZXdEZWJ1Zy5jb25zaXN0ZW5jeUNoZWNrRW5hYmxlZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1WaWV3LmRpc3BhdGNoQ29uc2lzdGVuY3lDaGVjayhWaWV3RGVidWcuQ09OU0lTVEVOQ1lfRFJBV0lORyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQoc2F2ZUNvdW50KTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIG1BdHRhY2hJbmZvLm1JZ25vcmVEaXJ0eVN0YXRlID0gZmFsc2U7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUVnbC5lZ2xTd2FwQnVmZmVycyhtRWdsRGlzcGxheSwgbUVnbFN1cmZhY2UpOwotICAgICAgICAgICAgICAgICAgICBjaGVja0VnbEVycm9ycygpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChTSE9XX0ZQUyB8fCBDb25maWcuREVCVUcgJiYgVmlld0RlYnVnLnNob3dGcHMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBub3cgPSAoaW50KVN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNEcmF3VGltZSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2hvd0ZQUyhjYW52YXMsIG5vdyAtIHNEcmF3VGltZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBzRHJhd1RpbWUgPSBub3c7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoc2Nyb2xsaW5nKSB7Ci0gICAgICAgICAgICAgICAgbUZ1bGxSZWRyYXdOZWVkZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgIHNjaGVkdWxlVHJhdmVyc2FscygpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9CiAKICAgICAgICAgaWYgKGZ1bGxSZWRyYXdOZWVkZWQpIHsKICAgICAgICAgICAgIG1BdHRhY2hJbmZvLm1JZ25vcmVEaXJ0eVN0YXRlID0gdHJ1ZTsKICAgICAgICAgICAgIGRpcnR5LnVuaW9uKDAsIDAsIChpbnQpIChtV2lkdGggKiBhcHBTY2FsZSArIDAuNWYpLCAoaW50KSAobUhlaWdodCAqIGFwcFNjYWxlICsgMC41ZikpOwogICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobUF0dGFjaEluZm8ubUhhcmR3YXJlUmVuZGVyZXIgIT0gbnVsbCAmJiBtQXR0YWNoSW5mby5tSGFyZHdhcmVSZW5kZXJlci5pc0VuYWJsZWQoKSkgeworICAgICAgICAgICAgaWYgKCFkaXJ0eS5pc0VtcHR5KCkgfHwgbUlzQW5pbWF0aW5nKSB7CisgICAgICAgICAgICAgICAgbUlzQW5pbWF0aW5nID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZGlydHkuc2V0RW1wdHkoKTsKKyAgICAgICAgICAgICAgICBtQXR0YWNoSW5mby5tSGFyZHdhcmVSZW5kZXJlci5kcmF3KG1WaWV3LCBtQXR0YWNoSW5mbywgeW9mZik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChzY3JvbGxpbmcpIHsKKyAgICAgICAgICAgICAgICBtRnVsbFJlZHJhd05lZWRlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgc2NoZWR1bGVUcmF2ZXJzYWxzKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQogCiAgICAgICAgIGlmIChERUJVR19PUklFTlRBVElPTiB8fCBERUJVR19EUkFXKSB7CiAgICAgICAgICAgICBMb2cudihUQUcsICJEcmF3ICIgKyBtVmlldyArICIvIgpAQCAtMTQ4Miw3ICsxMzU2LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIC8vY2FudmFzLmRyYXdBUkdCKDI1NSwgMjU1LCAwLCAwKTsKICAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgICAgIGlmIChDb25maWcuREVCVUcgJiYgVmlld0RlYnVnLnByb2ZpbGVEcmF3aW5nKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChWaWV3RGVidWcuREVCVUdfUFJPRklMRV9EUkFXSU5HKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydFRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKICAgICAgICAgICAgICAgICAgICAgfQogCkBAIC0xNTA5LDcgKzEzODMsNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCBtZXRyaWNzPSIgKyBjeHQuZ2V0UmVzb3VyY2VzKCkuZ2V0RGlzcGxheU1ldHJpY3MoKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIsIGNvbXBhdGliaWxpdHlJbmZvPSIgKyBjeHQuZ2V0UmVzb3VyY2VzKCkuZ2V0Q29tcGF0aWJpbGl0eUluZm8oKSk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaW50IHNhdmVDb3VudCA9IGNhbnZhcy5zYXZlKENhbnZhcy5NQVRSSVhfU0FWRV9GTEFHKTsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMCwgLXlvZmYpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1UcmFuc2xhdG9yICE9IG51bGwpIHsKQEAgLTE1MjAsMTQgKzEzOTMsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIG1WaWV3LmRyYXcoY2FudmFzKTsKICAgICAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRhY2hJbmZvLm1JZ25vcmVEaXJ0eVN0YXRlID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQoc2F2ZUNvdW50KTsKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIGlmIChDb25maWcuREVCVUcgJiYgVmlld0RlYnVnLmNvbnNpc3RlbmN5Q2hlY2tFbmFibGVkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtVmlldy5kaXNwYXRjaENvbnNpc3RlbmN5Q2hlY2soVmlld0RlYnVnLkNPTlNJU1RFTkNZX0RSQVdJTkcpOwogICAgICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfRlBTIHx8IENvbmZpZy5ERUJVRyAmJiBWaWV3RGVidWcuc2hvd0ZwcykgeworICAgICAgICAgICAgICAgICAgICBpZiAoU0hPV19GUFMgfHwgVmlld0RlYnVnLkRFQlVHX1NIT1dfRlBTKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbm93ID0gKGludClTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzRHJhd1RpbWUgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNob3dGUFMoY2FudmFzLCBub3cgLSBzRHJhd1RpbWUpOwpAQCAtMTUzNSw3ICsxNDA3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHNEcmF3VGltZSA9IG5vdzsKICAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgICAgIGlmIChDb25maWcuREVCVUcgJiYgVmlld0RlYnVnLnByb2ZpbGVEcmF3aW5nKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChWaWV3RGVidWcuREVCVUdfUFJPRklMRV9EUkFXSU5HKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KDYwMDAwLCBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKSAtIHN0YXJ0VGltZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CkBAIC0x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ICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKQEAgLTE5MzksMTggKzE4MTAsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBpblRvdWNoTW9kZSA9IG1zZy5hcmcyICE9IDA7CiAgICAgICAgICAgICAgICAgICAgIGVuc3VyZVRvdWNoTW9kZUxvY2FsbHkoaW5Ub3VjaE1vZGUpOwogCi0gICAgICAgICAgICAgICAgICAgIGlmIChtR2xXYW50ZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrRWdsRXJyb3JzKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBsb3N0IHRoZSBnbCBjb250ZXh0LCBzbyByZWNyZWF0ZSBpdC4KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtR2xXYW50ZWQgJiYgIW1Vc2VHTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVHTCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtR2xDYW52YXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBhcHBTY2FsZSA9IG1BdHRhY2hJbmZvLm1BcHBsaWNhdGlvblNjYWxlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtR2xDYW52YXMuc2V0Vmlld3BvcnQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgKG1XaWR0aCAqIGFwcFNjYWxlICsgMC41ZiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgKG1IZWlnaHQgKiBhcHBTY2FsZSArIDAuNWYpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChtQXR0YWNoSW5mby5tSGFyZHdhcmVSZW5kZXJlciAhPSBudWxsICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN1cmZhY2UgIT0gbnVsbCAmJiBtU3VyZmFjZS5pc1ZhbGlkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRhY2hJbmZvLm1IYXJkd2FyZVJlbmRlcmVyLmluaXRpYWxpemVJZk5lZWRlZChtV2lkdGgsIG1IZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRhY2hJbmZvLCBtSG9sZGVyKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIApAQCAtMjAwMCw4ICsxODYzLDcgQEAKICAgICAgICAgICAgIGlmICgoZXZlbnQuZ2V0RmxhZ3MoKSZLZXlFdmVudC5GTEFHX0ZST01fU1lTVEVNKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgLy8gVGhlIElNRSBpcyB0cnlpbmcgdG8gc2F5IHRoaXMgZXZlbnQgaXMgZnJvbSB0aGUKICAgICAgICAgICAgICAgICAvLyBzeXN0ZW0hICBCYWQgYmFkIGJhZCEKLSAgICAgICAgICAgICAgICBldmVudCA9IEtleUV2ZW50LmNoYW5nZUZsYWdzKGV2ZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuZ2V0RmxhZ3MoKSZ+S2V5RXZlbnQuRkxBR19GUk9NX1NZU1RFTSk7CisgICAgICAgICAgICAgICAgZXZlbnQgPSBLZXlFdmVudC5jaGFuZ2VGbGFncyhldmVudCwgZXZlbnQuZ2V0RmxhZ3MoKSAmIH5LZXlFdmVudC5GTEFHX0ZST01fU1lTVEVNKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGRlbGl2ZXJLZXlFdmVudFRvVmlld0hpZXJhcmNoeSgoS2V5RXZlbnQpbXNnLm9iaiwgZmFsc2UpOwogICAgICAgICB9IGJyZWFrOwpAQCAtMjAyMiw2ICsxODg0LDEwIEBACiAgICAgICAgICAgICAgICAgbVZpZXcub25DbG9zZVN5c3RlbURpYWxvZ3MoKFN0cmluZyltc2cub2JqKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBicmVhazsKKyAgICAgICAgY2FzZSBESVNQQVRDSF9EUkFHX0VWRU5UOgorICAgICAgICBjYXNlIERJU1BBVENIX0RSQUdfTE9DQVRJT05fRVZFTlQ6IHsKKyAgICAgICAgICAgIGhhbmRsZURyYWdFdmVudCgoRHJhZ0V2ZW50KW1zZy5vYmopOworICAgICAgICB9IGJyZWFrOwogICAgICAgICB9CiAgICAgfQogICAgIApAQCAtMjE4OSw2ICsyMDU1LDkgQEAKICAgICAgICAgICAgIGlmIChNRUFTVVJFX0xBVEVOQ1kpIHsKICAgICAgICAgICAgICAgICBsdC5zYW1wbGUoIkEgRGlzcGF0Y2hpbmcgVG91Y2hFdmVudHMiLCBTeXN0ZW0ubmFub1RpbWUoKSAtIGV2ZW50LmdldEV2ZW50VGltZU5hbm8oKSk7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBjYWNoZSBmb3IgcG9zc2libGUgZHJhZy1pbml0aWF0aW9uCisgICAgICAgICAgICBtTGFzdFRvdWNoUG9pbnQueCA9IGV2ZW50LmdldFJhd1goKTsKKyAgICAgICAgICAgIG1MYXN0VG91Y2hQb2ludC55ID0gZXZlbnQuZ2V0UmF3WSgpOwogICAgICAgICAgICAgaGFuZGxlZCA9IG1WaWV3LmRpc3BhdGNoVG91Y2hFdmVudChldmVudCk7CiAgICAgICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZKSB7CiAgICAgICAgICAgICAgICAgbHQuc2FtcGxlKCJCIERpc3BhdGNoZWQgVG91Y2hFdmVudHMgIiwgU3lzdGVtLm5hbm9UaW1lKCkgLSBldmVudC5nZXRFdmVudFRpbWVOYW5vKCkpOwpAQCAtMjQ5OCw4ICsyMzY3LDcgQEAKICAgICBwcml2YXRlIHZvaWQgZGVsaXZlcktleUV2ZW50KEtleUV2ZW50IGV2ZW50LCBib29sZWFuIHNlbmREb25lKSB7CiAgICAgICAgIC8vIElmIG1WaWV3IGlzIG51bGwsIHdlIGp1c3QgY29uc3VtZSB0aGUga2V5IGV2ZW50IGJlY2F1c2UgaXQgZG9lc24ndAogICAgICAgICAvLyBtYWtlIHNlbnNlIHRvIGRvIGFueXRoaW5nIGVsc2Ugd2l0aCBpdC4KLSAgICAgICAgYm9vbGVhbiBoYW5kbGVkID0gbVZpZXcgIT0gbnVsbAotICAgICAgICAgICAgICAgID8gbVZpZXcuZGlzcGF0Y2hLZXlFdmVudFByZUltZShldmVudCkgOiB0cnVlOworICAgICAgICBib29sZWFuIGhhbmRsZWQgPSBtVmlldyA9PSBudWxsIHx8IG1WaWV3LmRpc3BhdGNoS2V5RXZlbnRQcmVJbWUoZXZlbnQpOwogICAgICAgICBpZiAoaGFuZGxlZCkgewogICAgICAgICAgICAgaWYgKHNlbmREb25lKSB7CiAgICAgICAgICAgICAgICAgZmluaXNoSW5wdXRFdmVudCgpOwpAQCAtMjUzMSw3ICsyMzk5LDYgQEAKICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gc2VuZERvbmUgPSBzZXEgPj0gMDsKICAgICAgICAgICAgIGlmICghaGFuZGxlZCkgewogICAgICAgICAgICAgICAgIGRlbGl2ZXJLZXlFdmVudFRvVmlld0hpZXJhcmNoeShldmVudCwgc2VuZERvbmUpOwotICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2VuZERvbmUpIHsKICAgICAgICAgICAgICAgICBmaW5pc2hJbnB1dEV2ZW50KCk7CiAgICAgICAgICAgICB9IGVsc2UgewpAQCAtMjYxMyw2ICsyNDgwLDEwMSBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgLyogZHJhZy9kcm9wICovCisgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZURyYWdFdmVudChEcmFnRXZlbnQgZXZlbnQpIHsKKyAgICAgICAgLy8gRnJvbSB0aGUgcm9vdCwgb25seSBkc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AgICAgICAgICAgICAgLy8gb24gc3Vic2VxdWVudCBjYWxscyBhcyBhIGNvbnZlbmllbmNlCisgICAgICAgICAgICAgICAgaWYgKHdoYXQgPT0gRHJhZ0V2ZW50LkFDVElPTl9EUkFHX1NUQVJURUQpIHsKKyAgICAgICAgICAgICAgICAgICAgbURyYWdEZXNjcmlwdGlvbiA9IGV2ZW50Lm1DbGlwRGVzY3JpcHRpb247CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZXZlbnQubUNsaXBEZXNjcmlwdGlvbiA9IG1EcmFnRGVzY3JpcHRpb247CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gRm9yIGV2ZW50cyB3aXRoIGEgW3NjcmVlbl0gbG9jYXRpb24sIHRyYW5zbGF0ZSBpbnRvIHdpbmRvdyBjb29yZGluYXRlcworICAgICAgICAgICAgICAgIGlmICgod2hhdCA9PSBEcmFnRXZlbnQuQUNUSU9OX0RSQUdfTE9DQVRJT04pIHx8ICh3aGF0ID09IERyYWdFdmVudC5BQ1RJT05fRFJPUCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbURyYWdQb2ludC5zZXQoZXZlbnQubVgsIGV2ZW50Lm1ZKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1UcmFuc2xhdG9yICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFuc2xhdG9yLnRyYW5zbGF0ZVBvaW50SW5TY3JlZW5Ub0FwcFdpbmRvdyhtRHJhZ1BvaW50KTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChtQ3VyU2Nyb2xsWSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtRHJhZ1BvaW50Lm9mZnNldCgwLCBtQ3VyU2Nyb2xsWSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBldmVudC5tWCA9IG1EcmFnUG9pbnQueDsKKyAgICAgICAgICAgICAgICAgICAgZXZlbnQubVkgPSBtRHJhZ1BvaW50Lnk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgd2hvIHRoZSBjdXJyZW50IGRyYWcgdGFyZ2V0IGlzIHByZS1kaXNwYXRjaAorICAgICAgICAgICAgICAgIGZpbmFsIFZpZXcgcHJldkRyYWdWaWV3ID0gbUN1cnJlbnREcmFnVmlldzsKKworICAgICAgICAgICAgICAgIC8vIE5vdyBkaXNwYXRjaCB0aGUgZHJhZy9kcm9wIGV2ZW50CisgICAgICAgICAgICAgICAgYm9vbGVhbiByZXN1bHQgPSBtVmlldy5kaXNwYXRjaERyYWdFdmVudChldmVudCk7CisKKyAgICAgICAgICAgICAgICAvLyBJZiB3ZSBjaGFuZ2VkIGFwcGFyZW50IGRyYWcgdGFyZ2V0LCB0ZWxsIHRoZSBPUyBhYm91dCBpdAorICAgICAgICAgICAgICAgIGlmIChwcmV2RHJhZ1ZpZXcgIT0gbUN1cnJlbnREcmFnVmlldykgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZEcmFnVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc1dpbmRvd1Nlc3Npb24uZHJhZ1JlY2lwaWVudEV4aXRlZChtV2luZG93KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQ3VycmVudERyYWdWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzV2luZG93U2Vzc2lvbi5kcmFnUmVjaXBpZW50RW50ZXJlZChtV2luZG93KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJVbmFibGUgdG8gbm90ZSBkcmFnIHRhcmdldCBjaGFuZ2UiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIFJlcG9ydCB0aGUgZHJvcCByZXN1bHQgaWYgbmVjZXNzYXJ5CisgICAgICAgICAgICAgICAgaWYgKHdoYXQgPT0gRHJhZ0V2ZW50LkFDVElPTl9EUk9QKSB7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJSZXBvcnRpbmcgZHJvcCByZXN1bHQ6ICIgKyByZXN1bHQpOworICAgICAgICAgICAgICAgICAgICAgICAgc1dpbmRvd1Nlc3Npb24ucmVwb3J0RHJvcFJlc3VsdChtV2luZG93LCByZXN1bHQpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiVW5hYmxlIHRvIHJlcG9ydCBkcm9wIHJlc3VsdCIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGV2ZW50LnJlY3ljbGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBnZXRMYXN0VG91Y2hQb2ludChQb2ludCBvdXRMb2NhdGlvbikgeworICAgICAgICBvdXRMb2NhdGlvbi54ID0gKGludCkgbUxhc3RUb3VjaFBvaW50Lng7CisgICAgICAgIG91dExvY2F0aW9uLnkgPSAoaW50KSBtTGFzdFRvdWNoUG9pbnQueTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXREcmFnRm9jdXMoRHJhZ0V2ZW50IGV2ZW50LCBWaWV3IG5ld0RyYWdUYXJnZXQpIHsKKyAgICAgICAgZmluYWwgaW50IGFjdGlvbiA9IGV2ZW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BjYWxsZWQgd2hlbiB0aGVyZSBpcyBubyBtVmlldyIpOwpAQCAtMjczMCw5ICsyNjkyLDExIEBACiAKICAgICB2b2lkIGRvRGllKCkgewogICAgICAgICBjaGVja1RocmVhZCgpOwotICAgICAgICBpZiAoQ29uZmlnLkxPR1YpIExvZy52KFRBRywgIkRJRSBpbiAiICsgdGhpcyArICIgb2YgIiArIG1TdXJmYWNlKTsKKyAgICAgICAgaWYgKExPQ0FMX0xPR1YpIExvZy52KFRBRywgIkRJRSBpbiAiICsgdGhpcyArICIgb2YgIiArIG1TdXJmYWNlKTsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpZiAobUFkZGVkICYmICFtRmlyc3QpIHsKKyAgICAgICAgICAgICAgICBkZXN0cm95SGFyZHdhcmVSZW5kZXJlcigpOworCiAgICAgICAgICAgICAgICAgaW50IHZpZXdWaXNpYmlsaXR5ID0gbVZpZXcuZ2V0VmlzaWJpbGl0eSgpOwogICAgICAgICAgICAgICAgIGJvb2xlYW4gdmlld1Zpc2liaWxpdHlDaGFuZ2VkID0gbVZpZXdWaXNpYmlsaXR5ICE9IHZpZXdWaXNpYmlsaXR5OwogICAgICAgICAgICAgICAgIGlmIChtV2luZG93QXR0cmlidXRlc0NoYW5nZWQgfHwgdmlld1Zpc2liaWxpdHlDaGFuZ2VkKSB7CkBAIC0yNzU3LDYgKzI3MjEsMTQgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHByaXZhdGUgdm9pZCBkZXN0cm95SGFyZHdhcmVSZW5kZXJlcigpIHsKKyAgICAgICAgaWYgKG1BdHRhY2hJbmZvLm1IYXJkd2FyZVJlbmRlcmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1BdHRhY2hJbmZvLm1IYXJkd2FyZVJlbmRlcmVyLmRlc3Ryb3kodHJ1ZSk7CisgICAgICAgICAgICBtQXR0YWNoSW5mby5tSGFyZHdhcmVSZW5kZXJlciA9IG51bGw7CisgICAgICAgICAgICBtQXR0YWNoSW5mby5tSGFyZHdhcmVBY2NlbGVyYXRlZCA9IGZhbHNlOworICAgICAgICB9CisgICAgfQorCiAgICAgcHVibGljIHZvaWQgZGlzcGF0Y2hGaW5pc2hlZEV2ZW50KGludCBzZXEsIGJvb2xlYW4gaGFuZGxlZCkgewogICAgICAgICBNZXNzYWdlIG1zZyA9IG9idGFpbk1lc3NhZ2UoRklOSVNIRURfRVZFTlQpOwogICAgICAgICBtc2cuYXJnMSA9IHNlcTsKQEAgLTI4MDksMTMgKzI3ODEsMTIgQEAKICAgICAgICAgLy9ub2luc3BlY3Rpb24gQ29uc3RhbnRDb25kaXRpb25zCiAgICAgICAgIGlmIChmYWxzZSAmJiBldmVudC5nZXRBY3Rpb24oKSA9PSBLZXlFdmVudC5BQ1RJT05fRE9XTikgewogICAgICAgICAgICAgaWYgKGV2ZW50LmdldEtleUNvZGUoKSA9PSBLZXlFdmVudC5LRVlDT0RFX0NBTUVSQSkgewotICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HRCkgTG9nLmQoImtleWRpc3AiLAotICAgICAgICAgICAgICAgICAgICAgICAgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIpOwotICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HRCkgTG9nLmQoImtleWRpc3AiLCAiRm9jdXNlZCB2aWV3IEhpZXJhcmNoeSBpczoiKTsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZCgia2V5ZGlzcCIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0iKTsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZCgia2V5ZGlzcCIsICJGb2N1c2VkIHZpZXcgSGllcmFyY2h5IGlzOiIpOworCiAgICAgICAgICAgICAgICAgZGVidWcoKTsKIAotICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HRCkgTG9nLmQoImtleWRpc3AiLAotICAgICAgICAgICAgICAgICAgICAgICAgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIpOworICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKCJrZXlkaXNwIiwgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTI4OTUsNyArMjg2NiwxOSBAQAogICAgICAgICBtc2cub2JqID0gcmVhc29uOwogICAgICAgICBzZW5kTWVzc2FnZShtc2cpOwogICAgIH0KLSAgICAKKworICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoRHJhZ0V2ZW50KERyYWdFdmVudCBldmVudCkgeworICAgICAgICBmaW5hbCBpbnQgd2hhdDsKKyAgICAgICAgaWYgKGV2ZW50LmdldEFjdGlvbigpID09IERyYWdFdmVudC5BQ1RJT05fRFJBR19MT0NBVElPTikgeworICAgICAgICAgICAgd2hhdCA9IERJU1BBVENIX0RSQUdfTE9DQVRJT05fRVZFTlQ7CisgICAgICAgICAgICByZW1vdmVNZXNzYWdlcyh3aGF0KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHdoYXQgPSBESVNQQVRDSF9EUkFHX0VWRU5UOworICAgICAgICB9CisgICAgICAgIE1lc3NhZ2UgbXNnID0gb2J0YWluTWVzc2FnZSh3aGF0LCBldmVudCk7CisgICAgICAgIHNlbmRNZXNzYWdlKG1zZyk7CisgICAgfQorCiAgICAgLyoqCiAgICAgICogVGhlIHdpbmRvdyBpcyBnZXR0aW5nIGZvY3VzIHNvIGlmIHRoZXJlIGlzIGFueXRoaW5nIGZvY3VzZWQvc2VsZWN0ZWQKICAgICAgKiBzZW5kIGFuIHtAbGluayBBY2Nlc3NpYmlsaXR5RXZlbnR9IHRvIGFubm91bmNlIHRoYXQuCkBAIC0yOTE1LDE2ICsyODk4LDE2IEBACiAgICAgICAgIHJldHVybiBmYWxz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ICAgICAgICAgICAgUmVjdCB2aXNpYmxlSW5zZXRzLCBib29sZWFuIHJlcG9ydERyYXcsIENvbmZpZ3VyYXRpb24gbmV3Q29uZmlnKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIHJlc2l6ZWQoaW50IHcsIGludCBoLCBSZWN0IGNvdmVyZWRJbnNldHMsIFJlY3QgdmlzaWJsZUluc2V0cywKKyAgICAgICAgICAgICAgICBib29sZWFuIHJlcG9ydERyYXcsIENvbmZpZ3VyYXRpb24gbmV3Q29uZmlnKSB7CiAgICAgICAgICAgICBmaW5hbCBWaWV3Um9vdCB2aWV3Um9vdCA9IG1WaWV3Um9vdC5nZXQoKTsKICAgICAgICAgICAgIGlmICh2aWV3Um9vdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdmlld1Jvb3QuZGlzcGF0Y2hSZXNpemVkKHcsIGgsIGNvdmVyZWRJbnNldHMsCi0gICAgICAgICAgICAgICAgICAgICAgICB2aXNpYmxlSW5zZXRzLCByZXBvcnREcmF3LCBuZXdDb25maWcpOworICAgICAgICAgICAgICAgIHZpZXdSb290LmRpc3BhdGNoUmVzaXplZCh3LCBoLCBjb3ZlcmVkSW5zZXRzLCB2aXNpYmxlSW5zZXRzLCByZXBvcnREcmF3LCBuZXdDb25maWcpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTMxMDcsNiArMzA4OSwxNCBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQorCisgICAgICAgIC8qIERyYWcvZHJvcCAqLworICAgICAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaERyYWdFdmVudChEcmFnRXZlbnQgZXZlbnQpIHsKKyAgICAgICAgICAgIGZpbmFsIFZpZXdSb290IHZpZXdSb290ID0gbVZpZXdSb290LmdldCgpOworICAgICAgICAgICAgaWYgKHZpZXdSb290ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB2aWV3Um9vdC5kaXNwYXRjaERyYWdFdm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gbVdpbmRvd01hbmFnZXIuZ2V0RGVmYXVsdERpc3BsYXkoKSk7CisgICAgICAgICAgICBtSGFyZHdhcmVBY2NlbGVyYXRlZCA9IGhhcmR3YXJlQWNjZWxlcmF0ZWQ7CiAgICAgICAgIH0KIAogICAgICAgICBwdWJsaWMgZmluYWwgdm9pZCBhZGRWaWV3KFZpZXcgdmlldywgVmlld0dyb3VwLkxheW91dFBhcmFtcyBwYXJhbXMpIHsKQEAgLTQyMSw2ICs0NzIsOSBAQAogICAgICAgICAgICAgaWYgKHdwLnBhY2thZ2VOYW1lID09IG51bGwpIHsKICAgICAgICAgICAgICAgICB3cC5wYWNrYWdlTmFtZSA9IG1Db250ZXh0LmdldFBhY2thZ2VOYW1lKCk7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUhhcmR3YXJlQWNjZWxlcmF0ZWQpIHsKKyAgICAgICAgICAgICAgICB3cC5mbGFncyB8PSBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5GTEFHX0hBUkRXQVJFX0FDQ0VMRVJBVEVEOworICAgICAgICAgICAgfQogICAgICAgICAgICAgbVdpbmRvd01hbmFnZXIuYWRkVmlldyh2aWV3LCBwYXJhbXMpOwogICAgICAgICB9CiAKQEAgLTcxMyw2ICs3NjcsMTUgQEAKICAgICAgICAgcmV0dXJuIChtRmVhdHVyZXMmZmxhZykgIT0gMDsKICAgICB9CiAKKyAgICAvKioKKyAgICAgKiBAaGlkZSBVc2VkIGludGVybmFsbHkgdG8gaGVscCByZXNvbHZlIGNvbmZsaWN0aW5nIGZlYXR1cmVzLgorICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIHJlbW92ZUZlYXR1cmUoaW50IGZlYXR1cmVJZCkgeworICAgICAgICBmaW5hbCBpbnQgZmxhZyA9IDE8PGZlYXR1cmVJZDsKKyAgICAgICAgbUZlYXR1cmVzICY9IH5mbGFnOworICAgICAgICBtTG9jYWxGZWF0dXJlcyAmPSB+KG1Db250YWluZXIgIT0gbnVsbCA/IChmbGFnJn5tQ29udGFpbmVyLm1GZWF0dXJlcykgOiBmbGFnKTsKKyAgICB9CisKICAgICBwdWJsaWMgZmluYWwgdm9pZCBtYWtlQWN0aXZlKCkgewogICAgICAgICBpZiAobUNvbnRhaW5lciAhPSBudWxsKSB7CiAgICAgICAgICAgICBpZiAobUNvbnRhaW5lci5tQWN0aXZlQ2hpbGQgIT0gbnVsbCkgewpAQCAtODE3LDYgKzg4MCw4IEBACiAKICAgICBwdWJsaWMgYWJzdHJhY3Qgdm9pZCB0b2dnbGVQYW5lbChpbnQgZmVhdHVyZUlkLCBLZXlFdmVudCBldmVudCk7CiAKKyAgICBwdWJsaWMgYWJzdHJhY3Qgdm9pZCBpbnZhbGlkYXRlUGFuZWxNZW51KGludCBmZWF0dXJlSWQpOworICAgIAogICAgIHB1YmxpYyBhYnN0cmFjdCBib29sZWFuIHBlcmZvcm1QYW5lbFNob3J0Y3V0KGludCBmZWF0dXJlSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGtleUNvZGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgS2V5RXZlbnQgZXZlbnQsCkBAIC05OTYsNiArMTA2MSwxNiBAQAogICAgIHsKICAgICAgICAgcmV0dXJuIG1GZWF0dXJlczsKICAgICB9CisgICAgCisgICAgLyoqCisgICAgICogUXVlcnkgZm9yIHRoZSBhdmFpbGFiaWxpdHkgb2YgYSBjZXJ0YWluIGZlYXR1cmUuCisgICAgICogCisgICAgICogQHBhcmFtIGZlYXR1cmUgVGhlIGZlYXR1cmUgSUQgdG8gY2hlY2sKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIGZlYXR1cmUgaXMgZW5hYmxlZCwgZmFsc2Ugb3RoZXJ3aXNlLgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGhhc0ZlYXR1cmUoaW50IGZlYXR1cmUpIHsKKyA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AgICogaWdub3JlZCwgYnV0IG9uIGRldmljZXMgd2hlcmUgdGhlIE1lbnUga2V5IGlzIGRyYXduIGluIHNvZnR3YXJlIGl0IG1heSBiZSBoaWRkZW4gdW5sZXNzCisgICAgICAgICAqIHRoaXMgZmxhZyBpcyBzZXQuCisgICAgICAgICAqCisgICAgICAgICAqIChOb3RlIHRoYXQgQWN0aW9uIEJhcnMsIHdoZW4gYXZhaWxhYmxlLCBhcmUgdGhlIHByZWZlcnJlZCB3YXkgdG8gb2ZmZXIgYWRkaXRpb25hbAorICAgICAgICAgKiBmdW5jdGlvbnMgb3RoZXJ3aXNlIGFjY2Vzc2VkIHZpYSBhbiBvcHRpb25zIG1lbnUuKQorICAgICAgICAgKgorICAgICAgICAgKiB7QGhpZGV9CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGTEFHX05FRURTX01FTlVfS0VZID0gMHgwMTAwMDAwMDsKKwogICAgICAgICAvKiogV2luZG93IGZsYWc6ICpzaWdoKiBUaGUgbG9jayBzY3JlZW4gd2FudHMgdG8gY29udGludWUgcnVubmluZyBpdHMKICAgICAgICAgICogYW5pbWF0aW9uIHdoaWxlIGl0IGlzIGZhZGluZy4gIEEga2luZC1vZiBoYWNrIHRvIGFsbG93IHRoaXMuICBNYXliZQogICAgICAgICAgKiBpbiB0aGUgZnV0dXJlIHdlIGp1c3QgbWFrZSB0aGlzIHRoZSBkZWZhdWx0IGJlaGF2aW9yLgpAQCAtNjI5LDYgKzY1NiwxMiBAQAogICAgICAgICAgKiBpdCBpcyBjcmVhdGVkLgogICAgICAgICAgKiB7QGhpZGV9ICovCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZMQUdfU1lTVEVNX0VSUk9SID0gMHg0MDAwMDAwMDsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBJbmRpY2F0ZXMgd2hldGhlciB0aGlzIHdpbmRvdyBzaG91bGQgYmUgaGFyZHd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ludCwgaW50LAorICAgICAgICAgKiBhbmRyb2lkLmdyYXBoaWNzLlJlY3QpIEdyYXZpdHkuYXBwbHl9IGZvciBob3cgdGhpcyBpcyB1c2VkLiAgVGhpcworICAgICAgICAgKiBmaWVsZCBpcyBhZGRlZCB3aXRoIHtAbGluayAjeH0gdG8gc3VwcGx5IHRoZSA8dmFyPnhBZGo8L3Zhcj4gcGFyYW1ldGVyLgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIGZsb2F0IGhvcml6b250YWxNYXJnaW47CiAgICAgCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgdmVydGljYWwgbWFyZ2luLCBhcyBhIHBlcmNlbnRhZ2Ugb2YgdGhlIGNvbnRhaW5lcidzIGhlaWdodCwKLSAgICAgICAgICogYmV0d2VlbiB0aGUgY29udGFpbmVyIGFuZCB0aGUgd2lkZ2V0LgorICAgICAgICAgKiBiZXR3ZWVuIHRoZSBjb250YWluZXIgYW5kIHRoZSB3aWRnZXQuICBTZWUKKyAgICAgICAgICoge0BsaW5rIEdyYXZpdHkjYXBwbHkoaW50LCBpbnQsIGludCwgYW5kcm9pZC5ncmFwaGljcy5SZWN0LCBpbnQsIGludCwKKyAgICAgICAgICogYW5kcm9pZC5ncmFwaGljcy5SZWN0KSBHcmF2aXR5LmFwcGx5fSBmb3IgaG93IHRoaXMgaXMgdXNlZC4gIFRoaXMKKyAgICAgICAgICogZmllbGQgaXMgYWRkZWQgd2l0aCB7QGxpbmsgI3l9IHRvIHN1cHBseSB0aGUgPHZhcj55QWRqPC92YXI+IHBhcmFtZXRlci4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBmbG9hdCB2ZXJ0aWNhbE1hcmdpbjsKICAgICAKQEAgLTgxOSw2ICs4NTMsMjcgQEAKICAgICAgICAgICogZGltLgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIGZsb2F0IGRpbUFtb3VudCA9IDEuMGY7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIERlZmF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IGluIGZyb250LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBmbG9hdCBCUklHSFRORVNTX09WRVJSSURFX0ZVTEwgPSAxLjBmOwogICAgIAogICAgICAgICAvKioKICAgICAgICAgICogVGhpcyBjYW4gYmUgdXNlZCB0byBvdmVycmlkZSB0aGUgdXNlcidzIHByZWZlcnJlZCBicmlnaHRuZXNzIG9mCkBAIC0xMTAxLDYgKzExNTYsNyBAQAogICAgICAgICAgICAgICAgIHNjcmVlbk9yaWVudGF0aW9uID0gby5zY3JlZW5PcmllbnRhdGlvbjsKICAgICAgICAgICAgICAgICBjaGFuZ2VzIHw9IFNDUkVFTl9PUklFTlRBVElPTl9DSEFOR0VEOwogICAgICAgICAgICAgfQorCiAgICAgICAgICAgICByZXR1cm4gY2hhbmdlczsKICAgICAgICAgfQogICAgIApAQCAtMTEyOCwxNCArMTE4NCwyMiBAQAogICAgICAgICAgICAgc2IuYXBwZW5kKCd4Jyk7CiAgICAgICAgICAgICBzYi5hcHBlbmQoKGhlaWdodD09IE1BVENIX1BBUkVOVCA/ImZpbGwiOihoZWlnaHQ9PVdSQVBfQ09OVEVOVD8id3JhcCI6aGVpZ2h0KSkpOwogICAgICAgICAgICAgc2IuYXBwZW5kKCIpIik7Ci0gICAgICAgICAgICBpZiAoc29mdElucHV0TW9kZSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgc2IuYXBwZW5kKCIgc2ltPSMiKTsKLSAgICAgICAgICAgICAgICBzYi5hcHBlbmQoSW50ZWdlci50b0hleFN0cmluZyhzb2Z0SW5wdXRNb2RlKSk7CisgICAgICAgICAgICBpZiAoaG9yaXpvbnRhbE1hcmdpbiAhPSAwKSB7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCIgaG09Iik7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGhvcml6b250YWxNYXJnaW4pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHZlcnRpY2FsTWFyZ2luICE9IDApIHsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiB2bT0iKTsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQodmVydGljYWxNYXJnaW4pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKGdyYXZpdHkgIT0gMCkgewogICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiIGdyPSMiKTsKICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoSW50ZWdlci50b0hleFN0cmluZyhncmF2aXR5KSk7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoc29mdElucHV0TW9kZSAhPSAwKSB7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCIgc2ltPSMiKTsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoSW50ZWdlci50b0hleFN0cmluZyhzb2Z0SW5wdXRNb2RlKSk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBzYi5hcHBlbmQoIiB0eT0iKTsKICAgICAgICAgICAgIHNiLmFwcGVuZCh0eXBlKTsKICAgICAgICAgICAgIHNiLmFwcGVuZCgiIGZsPSMiKTsKQEAgLTExNTAsNiArMTIxNCwxOCBAQAogICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiIG9yPSIpOwogICAgICAgICAgICAgICAgIHNiLmFwcGVuZChzY3JlZW5PcmllbnRhdGlvbik7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYWxwaGEgIT0gMS4wZikgeworICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiIGFscGhhPSIpOworICAgICAgICAgICAgICAgIHNiLmFwcGVuZChhbHBoYSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoc2NyZWVuQnJpZ2h0bmVzcyAhPSBCUklHSFRORVNTX09WRVJSSURFX05PTkUpIHsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiBzYnJ0PSIpOworICAgICAgICAgICAgICAgIHNiLmFwcGVuZChzY3JlZW5Ccm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5CdWlsZC5WRVJTSU9OX0NPREVTLkhPTkVZQ09NQikgeworICAgICAgICAgICAgc3dpdGNoIChpbnB1dFR5cGUmKFRZUEVfTUFTS19DTEFTU3xUWVBFX01BU0tfVkFSSUFUSU9OKSkgeworICAgICAgICAgICAgICAgIGNhc2UgVFlQRV9DTEFTU19URVhUfFRZUEVfVEVYVF9WQVJJQVRJT05fV0VCX0VNQUlMX0FERFJFU1M6CisgICAgICAgICAgICAgICAgICAgIGlucHV0VHlwZSA9IFRZUEVfQ0xBU1NfVEVYVHxUWVBFX1RFWFRfVkFSSUFUSU9OX0VNQUlMX0FERFJFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IChpbnB1dFR5cGUmKH5UWVBFX01BU0tfRkxBR1MpKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBUWVBFX0NMQVNTX1RFWFR8VFlQRV9URVhUX1ZBUklBVElPTl9XRUJfUEFTU1dPUkQ6CisgICAgICAgICAgICAgICAgICAgIGlucHV0VHlwZSA9IFRZUEVfQ0xBU1NfVEVYVHxUWVBFX1RFWFRfVkFSSUFUSU9OX1BBU1NXT1JECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAoaW5wdXRUeXBlJih+VFlQRV9NQVNLX0ZMQUdTKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCiAgICAgICogV3JpdGUgZGVidWcgb3V0cHV0IG9mIHRoaXMgb2JqZWN0LgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGR1bXAoUHJpbnRlciBwdywgU3RyaW5nIHByZWZpeCkgewpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9pbnB1dG1ldGhvZC9JbnB1dE1ldGhvZC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9pbnB1dG1ldGhvZC9JbnB1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WNlOwogICAgICAgICBTZXJ2aWNlSW5mbyBzaSA9IHNlcnZpY2Uuc2VydmljZUluZm87CiAgICAgICAgIG1JZCA9IG5ldyBDb21wb25lbnROYW1lKHNpLnBhY2thZ2VOYW1lLCBzaS5uYW1lKS5mbGF0dGVuVG9TaG9ydFN0cmluZygpOwotICAgICAgICAKKwogICAgICAgICBQYWNrYWdlTWFuYWdlciBwbSA9IGNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKTsKICAgICAgICAgU3RyaW5nIHNldHRpbmdzQWN0aXZpdHlDb21wb25lbnQgPSBudWxsOwogICAgICAgICBpbnQgaXNEZWZhdWx0UmVzSWQgPSAwOwotICAgICAgICAKKwogICAgICAgICBYbWxSZXNvdXJjZVBhcnNlciBwYXJzZXIgPSBudWxsOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgcGFyc2VyID0gc2kubG9hZFhtbE1ldGFEYXRhKHBtLCBJbnB1dE1ldGhvZC5TRVJWSUNFX01FVEFfREFUQSk7CkBAIC0xMTYsMTMgKzEyMiwzOSBAQAogICAgICAgICAgICAgaXNEZWZhdWx0UmVzSWQgPSBzYS5nZXRSZXNvdXJjZUlkKAogICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5JbnB1dE1ldGhvZF9pc0RlZmF1bHQsIDApOwogICAgICAgICAgICAgc2EucmVjeWNsZSgpOworCisgICAgICAgICAgICBmaW5hbCBpbnQgZGVwdGggPSBwYXJzZXIuZ2V0RGVwdGgoKTsKKyAgICAgICAgICAgIC8vIFBhcnNlIGFsbCBzdWJ0eXBlcworICAgICAgICAgICAgd2hpbGUgKCgodHlwZSA9IHBhcnNlci5uZXh0KCkpICE9IFhtbFB1bGxQYXJzZXIuRU5EX1RBRyB8fCBwYXJzZXIuZ2V0RGVwdGgoKSA+IGRlcHRoKQorICAgICAgICAgICAgICAgICAgICAmJiB0eXBlICE9IFhtbFB1bGxQYXJzZXIuRU5EX0RPQ1VNRU5UKSB7CisgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gWG1sUHVsbFBhcnNlci5TVEFSVF9UQUcpIHsKKyAgICAgICAgICAgICAgICAgICAgbm9kZU5hbWUgPSBwYXJzZXIuZ2V0TmFtZSgpOworICAgICAgICAgICAgICAgICAgICBpZiAoISJzdWJ0eXBlIi5lcXVhbHMobm9kZU5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk1ldGEtZGF0YSBpbiBpbnB1dC1tZXRob2QgZG9lcyBub3Qgc3RhcnQgd2l0aCBzdWJ0eXBlIHRhZyIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFR5cGVkQXJyYXkgYSA9IHJlcy5vYnRhaW5BdHRyaWJ1dGVzKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJzLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5JbnB1dE1ldGhvZF9TdWJ0eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgSW5wdXRNZXRob2RTdWJ0eXBlIHN1YnR5cGUgPSBuZXcgSW5wdXRNZXRob2RTdWJ0eXBlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEuZ2V0UmVzb3VyY2VJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLklucHV0TWV0aG9kX1N1YnR5cGVfbGFiZWwsIDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEuZ2V0UmVzb3VyY2VJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLklucHV0TWV0aG9kX1N1YnR5cGVfaWNvbiwgMCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5nZXRTdHJpbmcoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5JbnB1dE1ldGhvZF9TdWJ0eXBlX2ltZVN1YnR5cGVMb2NhbGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEuZ2V0UmVzb3VyY2VJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLklucHV0TWV0aG9kX1N1YnR5cGVfaW1lU3VidHlwZU1vZGUsIDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEuZ2V0U3RyaW5nKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuSW5wdXRNZXRob2RfU3VidHlwZV9pbWVTdWJ0eXBlRXh0cmFWYWx1ZSkpOworICAgICAgICAgICAgICAgICAgICBtU3VidHlwZXMuYWRkKHN1YnR5cGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfSBjYXRjaCAoTmFtZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIHRocm93IG5ldyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgICAiVW5hYmxlIHRvIGNyZWF0ZSBjb250ZXh0IGZvcjogIiArIHNpLnBhY2thZ2VOYW1lKTsKICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIGlmIChwYXJzZXIgIT0gbnVsbCkgcGFyc2VyLmNsb3NlKCk7CiAgICAgICAgIH0KLSAgICAgICAgCiAgICAgICAgIG1TZXR0aW5nc0FjdGl2aXR5TmFtZSA9IHNldHRpbmdzQWN0aXZpdHlDb21wb25lbnQ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pYyB2b2lkIHNob3dJbnB1dE1ldGhvZFBpY2tlcigpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtSCkgewogICAgICAgICAgICAgdHJ5IHsKQEAgLTEzOTEsNiArMTQwMSwzNyBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgcHVibGljIHZvaWQgc2hvd0lucHV0TWV0aG9kU3VidHlwZVBpY2tlcigpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtSCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtU2VydmljZS5zaG93SW5wdXRNZXRob2RTdWJ0eXBlUGlja2VyRnJvbUNsaWVudChtQ2xpZW50KTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiSU1FIGRpZWQ6ICIgKyBtQ3VySWQsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2hvd0lucHV0TWV0aG9kQW5kU3VidHlwZUVuYWJsZXIoU3RyaW5nIHRvcElkKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobUgpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbVNlcnZpY2Uuc2hvd0lucHV0TWV0aG9kQW5kU3VidHlwZUVuYWJsZXJGcm9tQ2xpZW50KG1DbGllbnQsIHRvcElkKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiSU1FIGRpZWQ6ICIgKyBtQ3VySWQsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIElucHV0TWV0aG9kU3VidHlwZSBnZXRDdXJyZW50SW5wdXRNZXRob2RTdWJ0eXBlKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1IKSB7CisgICAgICAgICA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gICAgbVN1YnR5cGVNb2RlUmVzSWQgPSBzb3VyY2UucmVhZEludCgpOworICAgICAgICBtU3VidHlwZUV4dHJhVmFsdWUgPSBzb3VyY2UucmVhZFN0cmluZygpOworICAgICAgICBtU3VidHlwZUhhc2hDb2RlID0gaGFzaENvZGVJbnRlcm5hbChtU3VidHlwZU5hbWVSZXNJZCwgbVN1YnR5cGVJY29uUmVzSWQsIG1TdWJ0eXBlTG9jYWxlLAorICAgICAgICAgICAgICAgIG1TdWJ0eXBlTW9kZVJlc0lkLCBtU3VidHlwZUV4dHJhVmFsdWUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdGhlIG5hbWUgb2YgdGhlIHN1YnR5cGUKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldE5hbWVSZXNJZCgpIHsKKyAgICAgICAgcmV0dXJuIG1TdWJ0eXBlTmFtZVJlc0lkOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdGhlIGljb24gb2YgdGhlIHN1YnR5cGUKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldEljb25SZXNJZCgpIHsKKyAgICAgICAgcmV0dXJuIG1TdWJ0eXBlSWNvblJlc0lkOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdGhlIGxvY2FsZSBvZiB0aGUgc3VidHlwZQorICAgICAqLworICAgIHB1YmxpYyBTdHJpbmcgZ2V0TG9jYWxlKCkgeworICAgICAgICByZXR1cm4gbVN1YnR5cGVMb2NhbGU7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiB0aGUgbW9kZSBvZiB0aGUgc3VidHlwZQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0TW9kZVJlc0lkKCkgeworICAgICAgICByZXR1cm4gbVN1YnR5cGVNb2RlUmVzSWQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiB0aGUgZXh0cmEgdmFsdWUgb2YgdGhlIHN1YnR5cGUKKyAgICA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AgICAgIGNhc2UgQUNUSU9OX1NFVF9DVVJSRU5UX0FYSVM6CisgICAgICAgICAgICAgICAgICAgIGludCBheGlzID0gYmluZGluZy5nZXRGaXJzdEFyZ3VtZW50KGkpOworICAgICAgICAgICAgICAgICAgICBib29sZWFuIHNlbmRFdmVudCA9IChiaW5kaW5nLmdldFNlY29uZEFyZ3VtZW50KGkpID09IDEpOworICAgICAgICAgICAgICAgICAgICBzZXRDdXJyZW50QXhpcyhheGlzLCBzZW5kRXZlbnQsIGNvbnRlbnREZXNjcmlwdGlvbik7CisgICAgICAgICAgICAgICAgICAgIG1MYXN0RG93bkV2ZW50SGFuZGxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQUNUSU9OX1RSQVZFUlNFX0NVUlJFTlRfQVhJUzoKKyAgICAgICAgICAgICAgICAgICAgaW50IGRpcmVjdGlvbiA9IGJpbmRpbmcuZ2V0Rmlyc3RBcmd1bWVudChpKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gb24gc2Vjb25kIG51bGwgc2VsZWN0aW9uIHN0cmluZyBpbiBzYW1lIGRpcmVjdGlvbiA9PiBXZWJWaWV3IGhhbmRsZSB0aGUgZXZlbnQKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiA9PSBtTGFzdERpcmVjdGlvbiAmJiBtSXNMYXN0U2VsZWN0aW9uU3RyaW5nTnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3REaXJlY3Rpb24gPSBkaXJlY3Rpb247CisgICAgICAgICAgICAgICAgICAgICAgICBtSXNMYXN0U2VsZWN0aW9uU3RyaW5nTnVsbCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1MYXN0RGlyZWN0aW9uID0gZGlyZWN0aW9uOworICAgICAgICAgICAgICAgICAgICBzZW5kRXZlbnQgPSAoYmluZGluZy5nZXRTZWNvbmRBcmd1bWVudChpKSA9PSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbUxhc3REb3duRXZlbnRIYW5kbGVkID0gdHJhdmVyc2VDdXJyZW50QXhpcyhkaXJlY3Rpb24sIHNlbmRFdmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50RGVzY3JpcHRpb24pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEFDVElPTl9UUkFWRVJTRV9HSVZFTl9BWElTOgorICAgICAgICAgICAgICAgICAgICBkaXJlY3Rpb24gPSBiaW5kaW5nLmdldEZpcnN0QXJndW1lbnQoaSk7CisgICAgICAgICAgICAgICAgICAgIC8vIG9uIHNlY29uZCBudWxsIHNlbGVjdGlvbiBzdHJpbmcgaW4gc2FtZSBkaXJlY3Rpb24gPT4gV2ViVmlldyBoYW5kbGUgdGhlIGV2ZW50CisgICAgICAgICAgICAgICAgICAgIGlmIChkaXJlY3Rpb24gPT0gbUxhc3REaXJlY3Rpb24gJiYgbUlzTGFzdFNlbGVjdGlvblN0cmluZ051bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0RGlyZWN0aW9uID0gZGlyZWN0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgbUlzTGFzdFNlbGVjdGlvblN0cmluZ051bGwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtTGFzdERpcmVjdGlvbiA9IGRpcmVjdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgYXhpcyA9ICBiaW5kaW5nLmdldFNlY29uZEFyZ3VtZW50KGkpOworICAgICAgICAgICAgICAgICAgICBzZW5kRXZlbnQgPSAoYmluZGluZy5nZXRUaGlyZEFyZ3VtZW50KGkpID09IDEpOworICAgICAgICAgICAgICAgICAgICB0cmF2ZXJzZUdpdmVuQXhpcyhkaXJlY3Rpb24sIGF4aXMsIHNlbmRFdmVudCwgY29udGVudERlc2NyaXB0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgbUxhc3REb3duRXZlbnRIYW5kbGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBBQ1RJT05fUEVSRk9STV9BWElTX1RSQU5TSVRJT046CisgICAgICAgICAgICAgICAgICAgIGludCBmcm9tQXhpcyA9IGJpbmRpbmcuZ2V0Rmlyc3RBcmd1bWVudChpKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHRvQXhpcyA9IGJpbmRpbmcuZ2V0U2Vjb25kQXJndW1lbnQoaSk7CisgICAgICAgICAgICAgICAgICAgIHNlbmRFdmVudCA9IChiaW5kaW5nLmdldFRoaXJkQXJndW1lbnQoaSkgPT0gMSk7CisgICAgICAgICAgICAgICAgICAgIHByZWZyb21BeGlzVHJhbnNpdGlvbihmcm9tQXhpcywgdG9BeGlzLCBzZW5kRXZlbnQsIGNvbnRlbnREZXNjcmlwdGlvbik7CisgICAgICAgICAgICAgICAgICAgIG1MYXN0RG93bkV2ZW50SGFuZGxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJVbmtub3duIGFjdGlvbiBjb2RlOiAiICsgYWN0aW9uQ29kZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbUxhc3REb3duRXZlbnRIYW5kbGVkOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCB0aGUgY3VycmVudCBuYXZpZ2F0aW9uIGF4aXMgd2hpY2ggd2lsbCBiZSB1c2VkIHdoaWxlCisgICAgICogY2FsbGluZyB7QGxpbmsgI3RyYXZlcnNlQ3VycmVudEF4aXMoaW50LCBib29sZWFuLCBTdHJpbmcpfS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBheGlzIFRoZSBheGlzIHRvIHNldC4KKyAgICAgKiBAcGFyYW0gc2VuZEV2ZW50IFdoZXRoZXIgdG8gc2VuZCBhbiBhY2Nlc3NpYmlsaXR5IGV2ZW50IHRvCisgICAgICogICAgICAgIGFubm91bmNlIHRoZSBjaGFuZ2UuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHNldEN1cnJlbnRBeGlzKGludCBheGlzLCBib29sZWFuIHNlbmRFdmVudCwgU3RyaW5nIGNvbnRlbnREZXNjcmlwdGlvbikgeworICAgICAgICBtQ3VycmVudEF4aXMgPSBheGlzOworICAgICAgICBpZiAoc2VuZEV2ZW50KSB7CisgICAgICAgICAgICBBY2Nlc3NpYmlsaXR5RXZlbnQgZXZlbnQgPSBnZXRQYXJ0aWFseVBvcHVsYXRlZEFjY2Vzc2liaWxpdHlFdmVudCgpOworICAgICAgICAgICAgZXZlbnQuZ2V0VGV4dCgpLmFkZChTdHJpbmcudmFsdWVPZihheGlzKSk7CisgICAgICAgICAgICBldmVudC5zZXRDb250ZW50RGVzY3JpcHRpb24oY29udGVudERlc2NyaXB0aW9uKTsKKyAgICAgICAgICAgIHNlbmRBY2Nlc3NpYmlsaXR5RXZlbnQoZXZlbnQpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUGVyZm9ybXMgY29uZGl0aW9uYWwgdHJhbnNpdGlvbiBvbmUgYXhpcyB0byBhbm90aGVyLgorICAgICAqCisgICAgICogQHBhcmFtIGZyb21BeGlzIFRoZSBheGlzIHdoaWNoIG11c3QgYmUgdGhlIGN1cnJlbnQgZm9yIHRoZSB0cmFuc2l0aW9uIHRvIG9jY3VyLgorICAgICAqIEBwYXJhbSB0b0F4aXMgVGhlIGF4aXMgdG8gd2hpY2ggdG8gdHJhbnNpdGlvbi4KKyAgICAgKiBAcGFyYW0gc2VuZEV2ZW50IEZsYWcgaW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AgIGlmIChldmVudCAhPSBudWxsKSB7CisgICAgICAgICAgICBldmVudC5nZXRUZXh0KCkuYWRkKHNlbGVjdGlvblN0cmluZyk7CisgICAgICAgICAgICBzZW5kQWNjZXNzaWJpbGl0eUV2ZW50KGV2ZW50KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFNlbmRzIGFuIHtAbGluayBBY2Nlc3NpYmlsaXR5RXZlbnR9LgorICAgICAqCisgICAgICogQHBhcmFtIGV2ZW50IFRoZSBldmVudCB0byBzZW5kLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzZW5kQWNjZXNzaWJpbGl0eUV2ZW50KEFjY2Vzc2liaWxpdHlFdmVudCBldmVudCkgeworICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJEaXNwYXRjaGluZzogIiArIGV2ZW50KTsKKyAgICAgICAgfQorICAgICAgICBBY2Nlc3NpYmlsaXR5TWFuYWdlci5nZXRJbnN0YW5jZShtV2ViVmlldy5nZXRDb250ZXh0KCkpLnNlbmRBY2Nlc3NpYmlsaXR5RXZlbnQoZXZlbnQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gQW4gYWNjZXNzaWJpbGl0eSBldmVudCB3aG9zZSBtZW1iZXJzIGFyZSBwb3B1bGF0ZWQgZXhjZXB0IGl0cworICAgICAqICAgICAgICAgdGV4dCBhbmQgY29udGVudCBkZXNjcmlwdGlvbi4KKyAgICAgKi8KKyAgICBwcml2YXRlIEFjY2Vzc2liaWxpdHlFdmVudCBnZXRQYXJ0aWFseVBvcHVsYXRlZEFjY2Vzc2liaWxpdHlFdmVudCgpIHsKKyAgICAgICAgQWNjZXNzaWJpbGl0eUV2ZW50IGV2ZW50ID0gQWNjZXNzaWJpbGl0eUV2ZW50Lm9idGFpbihBY2Nlc3NpYmlsaXR5RXZlbnQuVFlQRV9WSUVXX1NFTEVDVEVEKTsKKyAgICAgICAgZXZlbnQuc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gICAgbmV3IEFycmF5TGlzdDxBY2Nlc3NpYmlsaXR5V2ViQ29udGVudEtleUJpbmRpbmc+KCk7CisKKyAgICAgICAgd2hpbGUgKHNlbWlDb2xvblNwbGl0dGVyLmhhc05leHQoKSkgeworICAgICAgICAgICAgU3RyaW5nIGJpbmRpbmdTdHJpbmcgPSBzZW1pQ29sb25TcGxpdHRlci5uZXh0KCk7CisgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoYmluZGluZ1N0cmluZykpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiTWFsZm9ybWVkIFdlYiBjb250ZW50IGtleSBiaW5kaW5nOiAiCisgICAgICAgICAgICAgICAgICAgICAgICArIHdlYkNvbnRlbnRLZXlCaW5kaW5nc1N0cmluZyk7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTdHJpbmdbXSBrZXlWYWx1ZUFycmF5ID0gYmluZGluZ1N0cmluZy5zcGxpdCgiPSIpOworICAgICAgICAgICAgaWYgKGtleVZhbHVlQXJyYXkubGVuZ3RoICE9IDIpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiRGlzcmVnYXJkaW5nIG1hbGZvcm1lZCBXZWIgY29udGVudCBrZXkgYmluZGluZzogIiArCisgICAgICAgICAgICAgICAgICAgICAgICBiaW5kaW5nU3RyaW5nKTsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgU2ltcGxlU3RyaW5nU3BsaXR0ZXIgY29sb25TcGxpdHRlciA9IG5ldyBTaW1wbGVTdHJpbmdTcGxpdHRlcignOicpOy8vcmVtb3ZlCisgICAgICAgICAgICAgICAgaW50IGtleSA9IEludGVnZXIuZGVjb2RlKGtleVZhbHVlQXJyYXlbMF0udHJpbSgpKTsKKyAgICAgICAgICAgICAgICBTdHJpbmdbXSBhY3Rpb25TdHJpbmdzID0ga2V5VmFsdWVBcnJheVsxXS5zcGxpdCgiOiIpOworICAgICAgICAgICAgICAgIGludFtdIGFjdGlvbnMgPSBuZXcgaW50W2FjdGlvblN0cmluZ3MubGVuZ3RoXTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMCwgY291bnQgPSBhY3Rpb25zLmxlbmd0aDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgYWN0aW9uc1tpXSA9IEludGVnZXIuZGVjb2RlKGFjdGlvblN0cmluZ3NbaV0udHJpbSgpKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBiaW5kaW5ncy5hZGQobmV3IEFjY2Vzc2liaWxpdHlXZWJDb250ZW50S2V5QmluZGluZyhrZXksIGFjdGlvbnMpKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBuZmUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiRGlzcmVnYXJkaW5nIG1hbGZvcm1lZCBrZXkgYmluZGluZzogIiArIGJpbmRpbmdTdHJpbmcpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm9yIChBY2Nlc3NpYmlsaXR5V2ViQ29udGVudEtleUJpbmRpbmcgYmluZGluZyA6IGJpbmRpbmdzKSB7CisgICAgICAgICAgICBzQmluZGluZ3MucHV0KGJpbmRpbmcuZ2V0S2V5KCksIGJpbmRpbmcpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVwcmVzZW50cyBhIHdlYiBjb250ZW50IGtleS1iaW5kaW5nLgorICAgICAqLworICAgIHByaXZhdGUgY2xhc3MgQWNjZXNzaWJpbGl0eVdlYkNvbnRlbnRLZXlCaW5kaW5nIHsKKworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgT0ZGU0VUX01FVEFfU1RBVEUgPSAweDAwMDA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qKgorICAgICAgICAgKiBAcmV0dXJuIFRoZSBiaW5kaW5nIGtleSB3aXRoIGtleSBjb2RlIGFuZCBtZXRhIHN0YXRlLgorICAgICAgICAgKgorICAgICAgICAgKiBAc2VlICNNQVNLX0tFWV9DT0RFCisgICAgICAgICAqIEBzZWUgI01BU0tfTUVUQV9TVEFURQorICAgICAgICAgKiBAc2VlICNPRkZTRVRfS0VZX0NPREUKKyAgICAgICAgICogQHNlZSAjT0ZGU0VUX01FVEFfU1RBVEUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBpbnQgZ2V0S2V5KCkgeworICAgICAgICAgICAgcmV0dXJuIG1LZXk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQHJldHVybiBUaGUga2V5IGNvZGUgb2YgdGhlIGJpbmRpbmcga2V5LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCBnZXRLZXlDb2RlKCkgeworICAgICAgICAgICAgcmV0dXJuIChtS2V5ICYgTUFTS19LRVlfQ09ERSkgPj4gT0ZGU0VUX0tFWV9DT0RFOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEByZXR1cm4gVGhlIG1ldGEgc3RhdGUgb2YgdGhlIGJpbmRpbmcga2V5LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCBnZXRNZXRhU3RhdGUoKSB7CisgICAgICAgICAgICByZXR1cm4gKG1LZXkgJiBNQVNLX01FVEFfU1RBVEUpID4+IE9GRlNFVF9NRVRBX1NUQVRFOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEByZXR1cm4gVGhlIG51bWJlciBvZiBhY3Rpb25zIGluIHRoZSBrZXkgYmluZGluZy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBpbnQgZ2V0QWN0aW9uQ291bnQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUFjdGlvblNlcXVlbmNlLmxlbmd0aDsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBAcGFyYW0gaW5kZXggVGhlIGFjdGlvbiBmb3IgYSBnaXZlbiBhY3Rpb24gPGNvZGU+aW5kZXg8L2NvZGU+LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCBnZXRBY3Rpb24oaW50IGluZGV4KSB7CisgICAgICAgICAgICByZXR1cm4gbUFjdGlvblNlcXVlbmNlW2luZGV4XTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBAcGFyYW0gaW5kZXggVGhlIGFjdGlvbiBjb2RlIGZvciBhIGdpdmVuIGFjdGlvbiA8Y29kZT5pbmRleDwvY29kZT4uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGdldEFjdGlvbkNvZGUoaW50IGluZGV4KSB7CisgICAgICAgICAgICByZXR1cm4gKG1BY3Rpb25TZXF1ZW5jZVtpbmRleF0gJiBNQVNLX0FDVElPTikgPj4gT0ZGU0VUX0FDVElPTjsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBAcGFyYW0gaW5kZXggVGhlIGZpcnN0IGFyZ3VtZW50IGZvciBhIGdpdmVuIGFjdGlvbiA8Y29kZT5pbmRleDwvY29kZT4uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGdldEZpcnN0QXJndW1lbnQoaW50IGluZGV4KSB7CisgICAgICAgICAgICByZXR1cm4gKG1BY3Rpb25TZXF1ZW5jZVtpbmRleF0gJiBNQVNLX0ZJUlNUX0FSR1VNRU5UKSA+PiBPRkZTRVRfRklSU1RfQVJHVU1FTlQ7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQHBhcmFtIGluZGV4IFRoZSBzZWNvbmQgYXJndW1lbnQgZm9yIGEgZ2l2ZW4gYWN0aW9uIDxjb2RlPmluZGV4PC9jb2RlPi4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBpbnQgZ2V0U2Vjb25kQXJndW1lbnQoaW50IGluZGV4KSB7CisgICAgICAgICAgICByZXR1cm4gKG1BY3Rpb25TZXF1ZW5jZVtpbmRleF0gJiBNQVNLX1NFQ09ORF9BUkdVTUVOVCkgPj4gT0ZGU0VUX1NFQ09ORF9BUkdVTUVOVDsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBAcGFyYW0gaW5kZXggVGhlIHRoaXJkIGFyZ3VtZW50IGZvciBhIGdpdmVuIGFjdGlvbiA8Y29kZT5pbmRleDwvY29kZT4uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGdldFRoaXJkQXJndW1lbnQoaW50IGluZGV4KSB7CisgICAgICAgICAgICByZXR1cm4gKG1BY3Rpb25TZXF1ZW5jZVtpbmRleF0gJiBNQVNLX1RISVJEX0FSR1VNRU5UKSA+PiBPRkZTRVRfVEhJUkRfQVJHVU1FTlQ7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ3JlYXRlcyBhIG5ldyBpbnN0YW5jZS4KKyAgICAgICAgICogQHBhcmFtIGtleSBUaGUga2V5IGZvciB0aGUgYmluZGluZyAoa2V5IGFuZCBtZXRhIHN0YXRlKQorICAgICAgICAgKiBAcGFyYW0gYWN0aW9uU2VxdWVuY2UgVGhlIHNlcXVlbmNlIG9mIGFjdGlvbiBmb3IgdGhlIGJpbmRpbmcuCisgICAgICAgICAqIEBzZWUgI2dldEtleSgpCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgQWNjZXNzaWJpbGl0eVdlYkNvbnRlbnRLZXlCaW5kaW5nKGludCBrZXksIGludFtdIGFjdGlvblNlcXVlbmNlKSB7CisgICAgICAgICAgICBtS2V5ID0ga2V5OworICAgICAgICAgICAgbUFjdGlvblNlcXVlbmNlID0gYWN0aW9uU2VxdWVuY2U7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgia2V5OiAiKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGdldEtleSgpKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsIG1ldGFTdGF0ZTogIik7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChnZXRNZXRhU3RhdGUoKSk7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCBrZXlDb2RlOiAiKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGdldEtleUNvZGUoKSk7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCBhY3Rpb25zWyIpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDAsIGNvdW50ID0gZ2V0QWN0aW9uQ291bnQoKTsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgie2FjdGlvbkNvZGUiKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChpKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiOiAiKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChnZXRBY3Rpb25Db2RlKGkpKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCBmaXJzdEFyZ3VtZW50OiAiKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChnZXRGaXJzdEFyZ3VtZW50KGkpKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCBzZWNvbmRBcmd1bWVudDogIik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZ2V0U2Vjb25kQXJndW1lbnQoaSkpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsIHRoaXJkQXJndW1lbnQ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W5nIHVybCwgaW50IHR5cGUpIHsKKyAgICAgICAgZmluYWwgaW50IFJFU09VUkNFID0gMTsKKyAgICAgICAgZmluYWwgaW50IEFTU0VUID0gMjsKKyAgICAgICAgZmluYWwgaW50IENPTlRFTlQgPSAzOworCisgICAgICAgIGlmICh0eXBlID09IFJFU09VUkNFKSB7CisgICAgICAgICAgICAvLyBmaWxlOi8vL2FuZHJvaWRfcmVzCisgICAgICAgICAgICBpZiAodXJsID09IG51bGwgfHwgdXJsLmxlbmd0aCgpID09IDApIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJ1cmwgaGFzIGxlbmd0aCAwICIgKyB1cmwpOworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaW50IHNsYXNoID0gdXJsLmluZGV4T2YoJy8nKTsKKyAgICAgICAgICAgIGludCBkb3QgPSB1cmwuaW5kZXhPZignLicsIHNsYXNoKTsKKyAgICAgICAgICAgIGlmIChzbGFzaCA9PSAtMSB8fCBkb3QgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJJbmNvcnJlY3QgcmVzIHBhdGg6ICIgKyB1cmwpOworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgU3RyaW5nIHN1YkNsYXNzTmFtZSA9IHVybC5zdWJzdHJpbmcoMCwgc2xhc2gpOworICAgICAgICAgICAgU3RyaW5nIGZpZWxkTmFtZSA9IHVybC5zdWJzdHJpbmcoc2xhc2ggKyAxLCBkb3QpOworICAgICAgICAgICAgU3RyaW5nIGVycm9yTXNnID0gbnVsbDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZmluYWwgQ2xhc3M8Pz4gZCA9IG1Db250ZXh0LmdldEFwcGxpY2F0aW9uQ29udGV4dCgpCisgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0Q2xhc3NMb2FkZXIoKS5sb2FkQ2xhc3MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFBhY2thZ2VOYW1lKCkgKyAiLlIkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc3ViQ2xhc3NOYW1lKTsKKyAgICAgICAgICAgICAgICBmaW5hbCBqYXZhLmxhbmcucmVmbGVjdC5GaWVsZCBmaWVsZCA9IGQuZ2V0RmllbGQoZmllbGROYW1lKTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaWQgPSBmaWVsZC5nZXRJbnQobnVsbCk7CisgICAgICAgICAgICAgICAgVHlwZWRWYWx1ZSB2YWx1ZSA9IG5ldyBUeXBlZFZhbHVlKCk7CisgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0VmFsdWUoaWQsIHZhbHVlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUudHlwZSA9PSBUeXBlZFZhbHVlLlRZUEVfU1RSSU5HKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBtQ29udGV4dC5nZXRBc3NldHMoKS5vcGVuTm9uQXNzZXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUuYXNzZXRDb29raWUsIHZhbHVlLnN0cmluZy50b1N0cmluZygpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFzc2V0TWFuYWdlci5BQ0NFU1NfU1RSRUFNSU5HKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBPbGQgc3RhY2sgb25seSBzdXBwb3J0cyBUWVBFX1NUUklORyBmb3IgcmVzIGZpbGVzCisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR1RBRywgIm5vdCBvZiB0eXBlIHN0cmluZzogIiArIHVybCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoTE9HVEFHLCAiRXhjZXB0aW9uOiAiICsgdXJsKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKworICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gQVNTRVQpIHsKKyAgICAgICAgICAgIC8vIGZpbGU6Ly8vYW5kcm9pZF9hc3NldAorICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBBc3NldE1hbmFnZXIgYXNzZXRzID0gbUNvbnRleHQuZ2V0QXNzZXRzKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFzc2V0cy5vcGVuKHVybCwgQXNzZXRNYW5hZ2VyLkFDQ0VTU19TVFJFQU1JTkcpOworICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gQ09OVEVOVCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAvLyBTdHJpcCBvZmYgbWltZXR5cGUsIGZvciBjb21wYXRpYmlsaXR5IHdpdGggQ29udGVudExvYWRlci5qYXZhCisgICAgICAgICAgICAgICAgLy8gSWYgd2UgZG9uJ3QgZG8gdGhpcywgd2UgY2FuIGZhaWwgdG8gbG9hZCBHbWFpbCBhdHRhY2htZW50cywKKyAgICAgICAgICAgICAgICAvLyBiZWNhdXNlIHRoZSBVUkwgYmVpbmcgbG9hZGVkIGRvZXNuJ3QgZXhhY3RseSBtYXRjaCB0aGUgVVJMIHdlCisgICAgICAgICAgICAgICAgLy8gaGF2ZSBwZXJtaXNzaW9uIHRvIHJlYWQuCisgICAgICAgICAgICAgICAgaW50IG1pbWVJbmRleCA9IHVybC5sYXN0SW5kZXhPZignPycpOworICAgICAgICAgICAgICAgIGlmIChtaW1lSW5kZXggIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsLnN1YnN0cmluZygwLCBtaW1lSW5kZXgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBVcmkgdXJpID0gVXJpLnBhcnNlKHVybCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLm9wZW5JbnB1dFN0cmVhbSh1cmkpOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJFeGNlcHRpb246ICIgKyB1cmwpOworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKICAgICAgKiBTdGFydCBsb2FkaW5nIGEgcmVzb3VyY2UuCiAgICAgICogQHBhcmFtIGxvYWRlckhhbmRsZSBUaGUgbmF0aXZlIFJlc291cmNlTG9hZGVyIHRoYXQgaXMgdGhlIHRhcmdldCBvZiB0aGUKICAgICAgKiAgICAgICAgICAgICAgICAgICAgIGRhdGEuCkBAIC02NjgsNyArNzk0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBXZWJBZGRyZXNzIHVyaSA9IG5ldyBXZWJBZGRyZXNzKG1DYWxsYmFja1Byb3h5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldEJhY2tGb3J3YXJkTGlzdCgpLmdldEN1cnJlbnRJdGVtKCkuZ2V0VXJsKCkpOwotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc2NoZW1lUGx1c0hvc3QgPSB1cmkubVNjaGVtZSArIHVyaS5tSG9zdDsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHNjaGVtZVBsdXNIb3N0ID0gdXJpLmd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Bob3N0LCBTdHJpbmcgcmVhbG0sIGZpbmFsIGJvb2xlYW4gdXNlQ2FjaGVkQ3JlZGVudGlhbHMpIHsKKworICAgICAgICBIdHRwQXV0aEhhbmRsZXIgaGFuZGxlciA9IG5ldyBIdHRwQXV0aEhhbmRsZXIoKSB7CisKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gdXNlSHR0cEF1dGhVc2VybmFtZVBhc3N3b3JkKCkgeworICAgICAgICAgICAgICAgIHJldHVybiB1c2VDYWNoZWRDcmVkZW50aWFsczsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBwcm9jZWVkKFN0cmluZyB1c2VybmFtZSwgU3RyaW5nIHBhc3N3b3JkKSB7CisgICAgICAgICAgICAgICAgbmF0aXZlQXV0aGVudGljYXRpb25Qcm9jZWVkKGhhbmRsZSwgdXNlcm5hbWUsIHBhc3N3b3JkKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBjYW5jZWwoKSB7CisgICAgICAgICAgICAgICAgbmF0aXZlQXV0aGVudGljYXRpb25DYW5jZWwoaGFuZGxlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgICAgbUNhbGxiYWNrUHJveHkub25SZWNlaXZlZEh0dHBBdXRoUmVxdWVzdChoYW5kbGVyLCBob3N0LCByZWFsbSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2FsbGVkIGJ5IEpOSSB3aGVuIHRoZSBuYXRpdmUgSFRUUCBzdGFjayBuZWVkcyB0byBkb3dubG9hZCBhIGZpbGUuCisgICAgICoKKyAgICAgKiBXZSBkZWxlZ2F0ZSB0aGUgcmVxdWVzdCB0byBDYWxsYmFja1Byb3h5LCB3aGljaCBvd25zIHRoZSBjdXJyZW50IGFwcCdzCisgICAgICogRG93bmxvYWRMaXN0ZW5lci4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgZG93bmxvYWRTdGFydChTdHJpbmcgdXJsLCBTdHJpbmcgdXNlckFnZW50LAorICAgICAgICAgICAgU3RyaW5nIGNvbnRlbnREaXNwb3NpdGlvbiwgU3RyaW5nIG1pbWVUeXBlLCBsb25nIGNvbnRlbnRMZW5ndGgpIHsKKyAgICAgICAgbWltZVR5cGUgPSBNaW1lVHlwZU1hcC5nZXRTaW5nbGV0b24oKS5yZW1hcEdlbmVyaWNNaW1lVHlwZSgKKyAgICAgICAgICAgICAgICBtaW1lVHlwZSwgdXJsLCBjb250ZW50RGlzcG9zaXRpb24pOworICAgICAgICBtQ2FsbGJhY2tQcm94eS5vbkRvd25sb2FkU3RhcnQodXJsLCB1c2VyQWdlbnQsCisgICAgICAgICAgICAgICAgY29udGVudERpc3Bvc2l0aW9uLCBtaW1lVHlwZSwgY29udGVudExlbmd0aCk7CisgICAgfQorCiAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgIC8vIG5hdGl2ZSBmdW5jdGlvbnMKICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CkBAIC0xMDEwLDUgKzExODksMTAgQEAKICAgICAgKi8KICAgICBwcml2YXRlIG5hdGl2ZSBIYXNoTWFwIGdldEZvcm1UZXh0RGF0YSgpOwogCisgICAgcHJpdmF0ZSBuYXRpdmUgU3RyaW5nIG5hdGl2ZVNhdmVXZWJBcmNoaXZlKFN0cmluZyBiYXNlbmFtZSwgYm9vbGVhbiBhdXRvbmFtZSk7CisKICAgICBwcml2YXRlIG5hdGl2ZSB2b2lkIG5hdGl2ZU9yaWVudGF0aW9uQ2hhbmdlZChpbnQgb3JpZW50YXRpb24pOworCisgICAgcHJpdmF0ZSBuYXRp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TE0LDcgQEAKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQUREX0hJU1RPUllfSVRFTSAgICAgICAgICAgICAgICAgICAgPSAxMzU7CiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEhJU1RPUllfSU5ERVhfQ0hBTkdFRCAgICAgICAgICAgICAgID0gMTM2OwogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBBVVRIX0NSRURFTlRJQUxTICAgICAgICAgICAgICAgICAgICA9IDEzNzsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgU0VUX0lOU1RBTExBQkxFX1dFQkFQUCAgICAgICAgICAgICAgPSAxMzg7CiAKICAgICAvLyBNZXNzYWdlIHRyaWdnZXJlZCBieSB0aGUgY2xpZW50IHRvIHJlc3VtZSBleGVjdXRpb24KICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTk9USUZZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAyMDA7CkBAIC0yNTMsMTcgKzI1NiwxMCBAQAogICAgICAgICAvLyAzMi1iaXQgcmVhZHMgYW5kIHdyaXRlcy4KICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgewogICAgICAgICAgICAgY2FzZSBQQUdFX1NUQVJURUQ6Ci0gICAgICAgICAgICAgICAgLy8gZXZlcnkgdGltZSB3ZSBzdGFydCBhIG5ldyBwYWdlLCB3ZSB3YW50IHRvIHJlc2V0IHRoZQotICAgICAgICAgICAgICAgIC8vIFdlYlZpZXcgY2VydGlmaWNhdGU6Ci0gICAgICAgICAgICAgICAgLy8gaWYgdGhlIG5ldyBzaXRlIGlzIHNlY3VyZSwgd2Ugd2lsbCByZWxvYWQgaXQgYW5kIGdldCBhCi0gICAgICAgICAgICAgICAgLy8gbmV3IGNlcnRpZmljYXRlIHNldDsKLSAgICAgICAgICAgICAgICAvLyBpZiB0aGUgbmV3IHNpdGUgaXMgbm90IHNlY3VyZSwgdGhlIGNlcnRpZmljYXRlIG11c3QgYmUKLSAgICAgICAgICAgICAgICAvLyBudWxsLCBhbmQgdGhhdCB3aWxsIGJlIHRoZSBjYXNlCi0gICAgICAgICAgICAgICAgbVdlYlZpZXcuc2V0Q2VydGlmaWNhdGUobnVsbCk7CisgICAgICAgICAgICAgICAgU3RyaW5nIHN0YXJ0ZWRVcmwgPSBtc2cuZ2V0RGF0YSgpLmdldFN0cmluZygidXJsIik7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcub25QYWdlU3RhcnRlZChzdGFydGVkVXJsKTsKICAgICAgICAgICAgICAgICBpZiAobVdlYlZpZXdDbGllbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NsaWVudC5vblBhZ2VTdGFydGVkKG1XZWJWaWV3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5nZXREYXRhKCkuZ2V0U3RyaW5nKCJ1cmwiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQml0bWFwKSBtc2cub2JqKTsKKyAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDbGllbnQub25QYWdlU3RhcnRlZChtV2ViVmlldywgc3RhcnRlZFVybCwgKEJpdG1hcCkgbXNnLm9iaik7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogCkBAIC01MDAsMTggKzQ5NiwzMiBAQAogICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdXJsID0gbXNnLmdldERhdGEoKS5nZXRTdHJpbmcoInVybCIpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIW1XZWJDaHJvbWVDbGllbnQub25Kc0FsZXJ0KG1XZWJWaWV3LCB1cmwsIG1lc3NhZ2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gb25seSBkaXNwbGF5IHRoZSBhbGVydCBkaWFsb2cgaWYgdGhlIG1Db250ZXh0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBBY3Rpdml0eSBhbmQgaXRzIHdpbmRvdyBoYXMgdGhlIGZvY3VzLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEobUNvbnRleHQgaW5zdGFuY2VvZiBBY3Rpdml0eSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISgoQWN0aXZpdHkpIG1Db250ZXh0KS5oYXNXaW5kb3dGb2N1cygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmNhbmNlbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5zZXRSZWFkeSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFsZXJ0RGlhbG9nLkJ1aWxkZXIobUNvbnRleHQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRUaXRsZShnZXRKc0RpYWxvZ1RpdGxlKHVybCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRNZXNzYWdlKG1lc3NhZ2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRQb3NpdGl2ZUJ1dHRvbihSLnN0cmluZy5vaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgQWxlcnREaWFsb2cuT25DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBEaWFsb2dJbnRlcmZhY2UuT25DbGlja0xpc3RlbmVyKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERpYWxvZ0ludGVyZmFjZSBkaWFsb2csCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdoaWNoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuY29uZmlybSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNldENhbmNlbGFibGUoZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRPbkNhbmNlbExpc3RlbmVyKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBEaWFsb2dJbnRlcmZhY2UuT25DYW5jZWxMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DYW5jZWwoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGlhbG9nSW50ZXJmYWNlIGRpYWxvZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmNhbmNlbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNob3coKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICByZXMuc2V0UmVhZHkoKTsKQEAgLTUyNSw2ICs1MzUsMTQgQEAKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHVybCA9IG1zZy5nZXREYXRhKCkuZ2V0U3RyaW5nKCJ1cmwiKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKCFtV2ViQ2hyb21lQ2xpZW50Lm9uSnNDb25maXJtKG1XZWJWaWV3LCB1cmwsIG1lc3NhZ2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gb25seSBkaXNwbGF5IHRoZSBhbGVydCBkaWFsb2cgaWYgdGhlIG1Db250ZXh0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBBY3Rpdml0eSBhbmQgaXRzIHdpbmRvdyBoYXMgdGhlIGZvY3VzLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEobUNvbnRleHQgaW5zdGFuY2VvZiBBY3Rpdml0eSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISgoQWN0aXZpdHkpIG1Db250ZXh0KS5oYXNXaW5kb3dGb2N1cygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmNhbmNlbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5zZXRSZWFkeSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFsZXJ0RGlhbG9nLkJ1aWxkZXIobUNvbnRleHQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRUaXRsZShnZXRKc0RpYWxvZ1RpdGxlKHVybCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRNZXNzYWdlKG1lc3NhZ2UpCkBAIC01NjUsNiArNTgzLDE0IEBACiAgICAgICAgICAgICAgICAgICAgIFN0cmluZyB1cmwgPSBtc2cuZ2V0RGF0YSgpLmdldFN0cmluZygidXJsIik7CiAgICAgICAgICAgICAgICAgICAgIGlmICghbVdlYkNocm9tZUNsaWVudC5vbkpzUHJvbXB0KG1XZWJWaWV3LCB1cmwsIG1lc3NhZ2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWwsIHJlcykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgZGlzcGxheSB0aGUgYWxlcnQgZGlhbG9nIGlmIHRoZSBtQ29udGV4dCBpcworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWN0aXZpdHkgYW5kIGl0cyB3aW5kb3cgaGFzIHRoZSBmb2N1cy4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKG1Db250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEoKEFjdGl2aXR5KSBtQ29udGV4dCkuaGFzV2luZG93Rm9jdXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5jYW5jZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuc2V0UmVhZHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIExheW91dEluZmxhdGVyIGZhY3RvcnkgPSBMYXlvdXRJbmZsYXRlcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZnJvbShtQ29udGV4dCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IHZpZXcgPSBmYWN0b3J5LmluZmxhdGUoUi5sYXlvdXQuanNfcHJvbXB0LApAQCAtNjE2LDYgKzY0MiwxNCBAQAogICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdXJsID0gbXNnLmdldERhdGEoKS5nZXRTdHJpbmcoInVybCIpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIW1XZWJDaHJvbWVDbGllbnQub25Kc0JlZm9yZVVubG9hZChtV2ViVmlldywgdXJsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UsIHJlcykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgZGlzcGxheSB0aGUgYWxlcnQgZGlhbG9nIGlmIHRoZSBtQ29udGV4dCBpcworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWN0aXZpdHkgYW5kIGl0cyB3aW5kb3cgaGFzIHRoZSBmb2N1cy4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKG1Db250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEoKEFjdGl2aXR5KSBtQ29udGV4dCkuaGFzV2luZG93Rm9jdXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5jYW5jZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuc2V0UmVhZHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBtID0gbUNvbnRleHQuZ2V0U3RyaW5nKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSLnN0cmluZy5qc19kaWFsb2dfYmVmb3JlX3VubG9hZCwgbWVzc2FnZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgQWxlcnREaWFsb2cuQnVpbGRlcihtQ29udGV4dCkKQEAgLTY3Niw2ICs3MTAsOSBAQAogICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICBjYXNlIEFERF9NRVNTQUdFX1RPX0NPTlNPTEU6CisgICAgICAgICAgICAgICAgaWYgKG1XZWJDaHJvbWVDbGllbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgU3RyaW5nIG1lc3NhZ2UgPSBtc2cuZ2V0RGF0YSgpLmdldFN0cmluZygibWVzc2FnZSIpOwogICAgICAgICAgICAgICAgIFN0cmluZyBzb3VyY2VJRCA9IG1zZy5nZXREYXRhKCkuZ2V0U3RyaW5nKCJzb3VyY2VJRCIpOwogICAgICAgICAgICAgICAgIGludCBsaW5lTnVtYmVyID0gbXNnLmdldERhdGEoKS5nZXRJbnQoImxpbmVOdW1iZXIiKTsKQEAgLTcyNSw3ICs3NjIsOCBAQAogCiAgICAgICAgICAgICBjYXNlIE9QRU5fRklMRV9DSE9PU0VSOgogICAgICAgICAgICAgICAgIGlmIChtV2ViQ2hyb21lQ2xpZW50ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgbVdlYkNocm9tZUNsaWVudC5vcGVuRmlsZUNob29zZXIoKFVwbG9hZEZpbGUpIG1zZy5vYmopOworICAgICAgICAgICAgICAgICAgICBVcGxvYWRGaWxlTWVzc2FnZURhdGEgZGF0YSA9IChVcGxvYWRGaWxlTWVzc2FnZURhdGEpbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgbVdlYkNocm9tZUNsaWVudC5vcGVuRmlsZUNob29zZXIoZGF0YS5nZXRVcGxvYWRGaWxlKCksIGRhdGEuZ2V0QWNjZXB0VHlwZSgpKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAKQEAgLTc1MCw2ICs3ODgsMTEgQEAKICAgICAgICAgICAgICAgICBtV2ViVmlldy5zZXRIdHRwQXV0aFVzZXJuYW1lUGFzc3dvcmQoCiAgICAgICAgICAgICAgICAgICAgICAgICBob3N0LCByZWFsbSwgdXNlcm5hbWUsIHBhc3N3b3JkKTsKICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU0VUX0lOU1RBTExBQkxFX1dFQkFQUDoKKyAgICAgICAgICAgICAgICBpZiAobVdlYkNocm9tZUNsaWVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1XZWJDaHJvbWVDbGllbnQuc2V0SW5zdGFsbGFibGVXZWJBcHAoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTEwODcsMTAgKzExMzAsMTUgQEAKICAgICBwdWJsaWMgdm9pZCBvblByb2dyZXNzQ2hhbmdlZChpbnQgbmV3UHJvZ3Jlc3MpIHsKICAgICAgICAgLy8gU3luY2hyb25pemUgc28gdGhhdCBtTGF0ZXN0UHJvZ3Jlc3MgaXMgdXAtdG8tZGF0ZS4KICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7Ci0gICAgICAgICAgICBpZiAobVdlYkNocm9tZUNsaWVudCA9PSBudWxsIHx8IG1MYXRlc3RQcm9ncmVzcyA9PSBuZXdQcm9ncmVzcykgeworICAgICAgICAgICAgLy8gdXBkYXRlIG1MYXRlc3RQcm9ncmVzcyBldmVuIG1XZWJDaHJvbWVDbGllbnQgaXMgbnVsbCBhcworICAgICAgICAgICAgLy8gV2ViVmlldy5nZXRQcm9ncmVzcygpIG5lZWRzIGl0CisgICAgICAgICAgICBpZiAobUxhdGVzdFByb2dyZXNzID09IG5ld1Byb2dyZXNzKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgbUxhdGVzdFByb2dyZXNzID0gbmV3UHJvZ3Jlc3M7CisgICAgICAgICAgICBpZiAobVdlYkNocm9tZUNsaWVudCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKCFtUHJvZ3Jlc3NVcGRhdGVQZW5kaW5nKSB7CiAgICAgICAgICAgICAgICAgc2VuZEVtcHR5TWVzc2FnZShQUk9HUkVTUyk7CiAgICAgICAgICAgICAgICAgbVByb2dyZXNzVXBkYXRlUGVuZGluZyA9IHRydWU7CkBAIC0xMTcyLDkgKzEyMjAsNyBAQAogICAgICAgICAvLyBmb3IgbnVsbC4KICAgICAgICAgV2ViSGlzdG9yeUl0ZW0gaSA9IG1CYWNrRm9yd2FyZExpc3QuZ2V0Q3VycmVudEl0ZW0oKTsKICAgICAgICAgaWYgKGkgIT0gbnVsbCkgewotICAgICAgICAgICAgaWYgKHByZWNvbXBvc2VkIHx8IGkuZ2V0VG91Y2hJY29uVXJsKCkgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGkuc2V0VG91Y2hJY29uVXJsKHVybCk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBpLnNldFRvdWNoSWNvblVybCh1cmwsIHByZWNvbXBvc2VkKTsKICAgICAgICAgfQogICAgICAgICAvLyBEbyBhbiB1bnN5bmNocm9uaXplZCBxdWljayBjaGVjayB0byBhdm9pZCBwb3N0aW5nIGlmIG5vIGNhbGxiYWNrIGhhcwogICAgICAgICAvLyBiZWVuIHNldC4KQEAgLTE0MzIsNiArMTQ3OCwyNCBAQAogICAgICAgICBzZW5kTWVzc2FnZShtc2cpOwogICAgIH0KIAorICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIFVwbG9hZEZpbGVNZXNzYWdlRGF0YSB7CisgICAgICAgIHByaXZhdGUgVXBsb2FkRmlsZSBtQ2FsbGJhY2s7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1BY2NlcHRUeXBlOworCisgICAgICAgIHB1YmxpYyBVcGxvYWRGaWxlTWVzc2FnZURhdGEoVXBsb2FkRmlsZSB1cGxvYWRGaWxlLCBTdHJpbmcgYWNjZXB0VHlwZSkgeworICAgICAgICAgICAgbUNhbGxiYWNrID0gdXBsb2FkRmlsZTsKKyAgICAgICAgICAgIG1BY2NlcHRUeXBlID0gYWNjZXB0VHlwZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBVcGxvYWRGaWxlIGdldFVwbG9hZEZpbGUoKSB7CisgICAgICAgICAgICByZXR1cm4gbUNhbGxiYWNrOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFN0cmluZyBnZXRBY2NlcHRUeXBlKCkgeworICAgICAgICAgICAgcmV0dXJuIG1BY2NlcHRUeXBlOworICAgICAgICB9CisgICAgfQorCiAgICAgc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bmVkIHdpdGggY291bnRyeS1jb2Rlcy4gRm9yIGV4YW1wbGU6IFsuY28udWtdLgpAQCAtMjU3LDExICsyNjEsMjMgQEAKICAgICAgICAgcmV0dXJuIHNSZWY7CiAgICAgfQogCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiB1c2VDaHJvbWl1bUh0dHBTdGFjaygpIHsKKyAgICAgICAgaWYgKHNVc2VDaHJvbWl1bUh0dHBTdGFjayA9PSBudWxsKSB7CisgICAgICAgICAgICBzVXNlQ2hyb21pdW1IdHRwU3RhY2sgPSBuYXRpdmVVc2VDaHJvbWl1bUh0dHBTdGFjaygpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBzVXNlQ2hyb21pdW1IdHRwU3RhY2s7CisgICAgfQorCiAgICAgLyoqCiAgICAgICogQ29udHJvbCB3aGV0aGVyIGNvb2tpZSBpcyBlbmFibGVkIG9yIGRpc2FibGVkCiAgICAgICogQHBhcmFtIGFjY2VwdCBUUlVFIGlmIGFjY2VwdCBjb29raWUKICAgICAgKi8KICAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgc2V0QWNjZXB0Q29va2llKGJvb2xlYW4gYWNjZXB0KSB7CisgICAgICAgIGlmICh1c2VDaHJvbWl1bUh0dHBTdGFjaygpKSB7CisgICAgICAgICAgICBuYXRpdmVTZXRBY2NlcHRDb29raWUoYWNjZXB0KTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCiAgICAgICAgIG1BY2NlcHRDb29raWUgPSBhY2NlcHQ7CiAgICAgfQogCkBAIC0yNzAsNiArMjg2LDEwIEBACiAgICAgICogQHJldHVybiBUUlVFIGlmIGFjY2VwdCBjb29raWUKICAgICAgKi8KICAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gYWNjZXB0Q29va2llKCkgeworICAgICAgICBpZiAodXNlQ2hyb21pdW1IdHRwU3RhY2soKSkgeworICAgICAgICAgICAgcmV0dXJuIG5hdGl2ZUFjY2VwdENvb2tpZSgpOworICAgICAgICB9CisKICAgICAgICAgcmV0dXJuIG1BY2NlcHRDb29raWU7CiAgICAgfQogCkBAIC0yODEsNiArMzAxLDExIEBACiAgICAgICogQHBhcmFtIHZhbHVlIFRoZSB2YWx1ZSBmb3Igc2V0LWNvb2tpZTogaW4gaHR0cCByZXNwb25zZSBoZWFkZXIKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXRDb29raWUoU3RyaW5nIHVybCwgU3RyaW5nIHZhbHVlKSB7CisgICAgICAgIGlmICh1c2VDaHJvbWl1bUh0dHBTdGFjaygpKSB7CisgICAgICAgICAgICBuYXRpdmVTZXRDb29raWUodXJsLCB2YWx1ZSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKwogICAgICAgICBXZWJBZGRyZXNzIHVyaTsKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIHVyaSA9IG5ldyBXZWJBZGRyZXNzKHVybCk7CkBAIC0zNTksNyArMzg0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgLy8gbmVnYXRpdmUgbWVhbnMgZmFyIGZ1dHVyZQogICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llLmV4cGlyZXMgPCAwIHx8IGNvb2tpZS5leHBpcmVzID4gbm93KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZWN1cmUgY29va2llcyBjYW4ndCBiZSBvdmVyd3JpdHRlbiBieSBub24tSFRUUFMgdXJsCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvb2tpZUVudHJ5LnNlY3VyZSB8fCBIVFRQUy5lcXVhbHModXJpLm1TY2hlbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvb2tpZUVudHJ5LnNlY3VyZSB8fCBIVFRQUy5lcXVhbHModXJpLmdldFNjaGVtZSgpKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tpZUVudHJ5LnZhbHVlID0gY29va2llLnZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tpZUVudHJ5LmV4cGlyZXMgPSBjb29raWUuZXhwaXJlczsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29raWVFbnRyeS5zZWN1cmUgPSBjb29raWUuc2VjdXJlOwpAQCAtNDA3LDYgKzQzMiwxMCBAQAogICAgICAqIEByZXR1cm4gVGhlIGNvb2tpZXMgaW4gdGhlIGZvcm1hdCBvZiBOQU1FPVZBTFVFIFs7IE5BTUU9VkFMVUVdCiAgICAgICovCiAgICAgcHVibGljIFN0cmluZyBnZXRDb29raWUoU3RyaW5nIHVybCkgeworICAgICAgICBpZiAodXNlQ2hyb21pdW1IdHRwU3RhY2soKSkgeworICAgICAgICAgICAgcmV0dXJuIG5hdGl2ZUdldENvb2tpZSh1cmwpOworICAgICAgICB9CisKICAgICAgICAgV2ViQWRkcmVzcyB1cmk7CiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICB1cmkgPSBuZXcgV2ViQWRkcmVzcyh1cmwpOwpAQCAtNDQ0LDcgKzQ3Myw3IEBACiAgICAgICAgIH0KIAogICAgICAgICBsb25nIG5vdyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICBib29sZWFuIHNlY3VyZSA9IEhUVFBTLmVxdWFscyh1cmkubVNjaGVtZSk7CisgICAgICAgIGJvb2xlYW4gc2VjdXJlID0gSFRUUFMuZXF1YWxzKHVyaS5nZXRTY2hlbWUoKSk7CiAgICAgICAgIEl0ZXJhdG9yPENvb2tpZT4gaXRlciA9IGNvb2tpZUxpc3QuaXRlcmF0b3IoKTsKIAogICAgICAgICBTb3J0ZWRTZXQ8Q29va2llPiBjb29raWVTZXQgPSBuZXcgVHJlZVNldDxDb29raWU+KENPTVBBUkFUT1IpOwpAQCAtNDk4LDYgKzUyNywxMSBAQAogICAgICAqIFJlbW92ZSBhbGwgc2Vzc2lvbiBjb29raWVzLCB3aGljaCBhcmUgY29va2llcyB3aXRob3V0IGV4cGlyYXRpb24gZGF0ZQogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHJlbW92ZVNlc3Npb25Db29raWUoKSB7CisgICAgICAgIGlmICh1c2VDaHJvbWl1bUh0dHBTdGFjaygpKSB7CisgICAgICAgICAgICBuYXRpdmVSZW1vdmVTZXNzaW9uQ29va2llKCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKwogICAgICAgICBmaW5hbCBSdW5uYWJsZSBjbGVhckNhY2hlID0gbmV3IFJ1bm5hYmxlKCkgewogICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewogICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZChDb29raWVNYW5hZ2VyLnRoaXMpIHsKQEAgLTUyNCw2ICs1NTgsMTEgQEAKICAgICAgKiBSZW1vdmUgYWxsIGNvb2tpZXMKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCByZW1vdmVBbGxDb29raWUoKSB7CisgICAgICAgIGlmICh1c2VDaHJvbWl1bUh0dHBTdGFjaygpKSB7CisgICAgICAgICAgICBuYXRpdmVSZW1vdmVBbGxDb29raWUoKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCiAgICAgICAgIGZpbmFsIFJ1bm5hYmxlIGNsZWFyQ2FjaGUgPSBuZXcgUnVubmFibGUoKSB7CiAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CiAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkKENvb2tpZU1hbmFnZXIudGhpcykgewpAQCAtNTQwLDYgKzU3OSwxMCBAQAogICAgICAqICBSZXR1cm4gdHJ1ZSBpZiB0aGVyZSBhcmUgc3RvcmVkIGNvb2tpZXMuCiAgICAgICovCiAgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGhhc0Nvb2tpZXMoKSB7CisgICAgICAgIGlmICh1c2VDaHJvbWl1bUh0dHBTdGFjaygpKSB7CisgICAgICAgICAgICByZXR1cm4gbmF0aXZlSGFzQ29va2llcygpOworICAgICAgICB9CisKICAgICAgICAgcmV0dXJuIENvb2tpZVN5bmNNYW5hZ2VyLmdldEluc3RhbmNlKCkuaGFzQ29va2llcygpOwogICAgIH0KIApAQCAtNTQ3LDYgKzU5MCwxMSBAQAogICAgICAqIFJlbW92ZSBhbGwgZXhwaXJlZCBjb29raWVzCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgcmVtb3ZlRXhwaXJlZENvb2tpZSgpIHsKKyAgICAgICAgaWYgKHVzZUNocm9taXVtSHR0cFN0YWNrKCkpIHsKKyAgICAgICAgICAgIG5hdGl2ZVJlbW92ZUV4cGlyZWRDb29raWUoKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCiAgICAgICAgIGZpbmFsIFJ1bm5hYmxlIGNsZWFyQ2FjaGUgPSBuZXcgUnVubmFibGUoKSB7CiAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CiAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkKENvb2tpZU1hbmFnZXIudGhpcykgewpAQCAtNjkyLDcgKzc0MCw3IEBACiAgICAgICogICAgICAgICAgZW5kZWQgd2l0aCAiLyIKICAgICAgKi8KICAgICBwcml2YXRlIFN0cmluZ1tdIGdldEhvc3RBbmRQYXRoKFdlYkFkZHJlc3MgdXJpKSB7Ci0gICAgICAgIGlmICh1cmkubUhvc3QgIT0gbnVsbCAmJiB1cmkubVBhdGggIT0gbnVsbCkgeworICAgICAgICBpZiAodXJpLmdldEhvc3QoKSAhPSBudWxsICYmIHVyaS5nZXRQYXRoKCkgIT0gbnVsbCkgewogCiAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICogVGhlIGRvbWFpbiAoaS5lLiBob3N0KSBwb3J0aW9uIG9mIHRoZSBjb29raWUgaXMgc3VwcG9zZWQgdG8gYmUKQEAgLTcwMywxMiArNzUxLDEyIEBACiAgICAgICAgICAgICAgKiBTZWU6IGh0dHA6Ly93d3cuaWVmdC5vcmcvcmZjL3JmYzI5NjUudHh0IChTZWN0aW9uIDMuMy4zKQogICAgICAgICAgICAgICovCiAgICAgICAgICAgICBTdHJpbmdbXSByZXQgPSBuZXcgU3RyaW5nWzJdOwotICAgICAgICAgICAgcmV0WzBdID0gdXJpLm1Ib3N0LnRvTG93ZXJDYXNlKCk7Ci0gICAgICAgICAgICByZXRbMV0gPSB1cmkubVBhdGg7CisgICAgICAgICAgICByZXRbMF0gPSB1cmkuZ2V0SG9zdCgpLnRvTG93ZXJDYXNlKCk7CisgICAgICAgICAgICByZXRbMV0gPSB1cmkuZ2V0UGF0aCgpOwogCiAgICAgICAgICAgICBpbnQgaW5kZXggPSByZXRbMF0uaW5kZXhPZihQRVJJT0QpOwogICAgICAgICAgICAgaWYgKGluZGV4ID09IC0xKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHVyaS5tU2NoZW1lLmVxdWFsc0lnbm9yZUNhc2UoImZpbGUiKSkgeworICAgICAgICAgICAgICAgIGlmICh1cmkuZ2V0U2NoZW1lKCkuZXF1YWxzSWdub3JlQ2FzZSgiZmlsZSIpKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIGlzIGEgcG90ZW50aWFsIGJ1ZyB3aGVyZSBhIGxvY2FsIGZpbGUgcGF0aCBtYXRjaGVzCiAgICAgICAgICAgICAgICAgICAgIC8vIGFub3RoZXIgZmlsZSBpbiB0aGUgbG9jYWwgd2ViIHNlcnZlciBkaXJlY3RvcnkuIFN0aWxsCiAgICAgICAgICAgICAgICAgICAgIC8vICJsb2NhbGhvc3QiIGlzIHRoZSBiZXN0IHBzZXVkbyBkb21haW4gbmFtZS4KQEAgLTEwMTYsNCArMTA2NCwxNSBAQAogICAgICAgICB9CiAgICAgICAgIHJldHVybiByZXQ7CiAgICAgfQorCisgICAgLy8gTmF0aXZlIGZ1bmN0aW9ucworICAgIHByaXZhdGUgc3RhdGljIG5hdGl2ZSBib29sZWFuIG5hdGl2ZVVzZUNocm9taXVtSHR0cFN0YWNrKCk7CisgICAgc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mVkCiAgICAgcHJpdmF0ZSBsb25nIG1MYXN0VXBkYXRlOwogCisgICAgLy8gVXNlZCBieSB0aGUgQ2hyb21pdW0gSFRUUCBzdGFjay4gRXZlcnl0aGluZyBlbHNlIGluIHRoaXMgY2xhc3MgaXMgdXNlZCBvbmx5IGJ5IHRoZSBBbmRyb2lkCisgICAgLy8gSmF2YSBIVFRQIHN0YWNrLgorICAgIHByaXZhdGUgc3RhdGljIFN0cmluZyBzRGF0YWJhc2VEaXJlY3Rvcnk7CisgICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIHNDYWNoZURpcmVjdG9yeTsKKwogICAgIHByaXZhdGUgQ29va2llU3luY01hbmFnZXIoQ29udGV4dCBjb250ZXh0KSB7CiAgICAgICAgIHN1cGVyKGNvbnRleHQsICJDb29raWVTeW5jTWFuYWdlciIpOwogICAgIH0KQEAgLTc3LDExICs4Miw3IEBACiAgICAgICogQHJldHVybiBDb29raWVTeW5jTWFuYWdlcgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgc3luY2hyb25pemVkIENvb2tpZVN5bmNNYW5hZ2VyIGdldEluc3RhbmNlKCkgewotICAgICAgICBpZiAoc1JlZiA9PSBudWxsKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKAotICAgICAgICAgICAgICAgICAgICAiQ29va2llU3luY01hbmFnZXI6OmNyZWF0ZUluc3RhbmNlKCkgbmVlZHMgdG8gYmUgY2FsbGVkICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJiZWZvcmUgQ29va2llU3luY01hbmFnZXI6OmdldEluc3RhbmNlKCkiKTsKLSAgICAgICAgfQorICAgICAgICBjaGVja0luc3RhbmNlSXNDcmVhdGVkKCk7CiAgICAgICAgIHJldHVybiBzUmVmOwogICAgIH0KIApAQCAtOTIsOCArOTMsMTEgQEAKICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIHN5bmNocm9uaXplZCBDb29raWVTeW5jTWFuYWdlciBjcmVhdGVJbnN0YW5jZSgKICAgICAgICAgICAgIENvbnRleHQgY29udGV4dCkgeworICAgICAgICBDb250ZXh0IGFwcENvbnRleHQgPSBjb250ZXh0LmdldEFwcGxpY2F0aW9uQ29udGV4dCgpOwogICAgICAgICBpZiAoc1JlZiA9PSBudWxsKSB7Ci0gICAgICAgICAgICBzUmVmID0gbmV3IENvb2tpZVN5bmNNYW5hZ2VyKGNvbnRleHQuZ2V0QXBwbGljYXRpb25Db250ZXh0KCkpOworICAgICAgICAgICAgc1JlZiA9IG5ldyBDb29raWVTeW5jTWFuYWdlcihhcHBDb250ZXh0KTsKKyAgICAgICAgICAgIHNEYXRhYmFzZURpcmVjdG9yeSA9IGFwcENvbnRleHQuZ2V0RGF0YWJhc2VQYXRoKCJkdW1teSIpLmdldFBhcmVudCgpOworICAgICAgICAgICAgc0NhY2hlRGlyZWN0b3J5ID0gYXBwQ29udGV4dC5nZXRDYWNoZURpcigpLmdldEFic29sdXRlUGF0aCgpOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiBzUmVmOwogICAgIH0KQEAgLTIxMCw0ICsyMTQsMzAgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgY2hlY2tJbnN0YW5jZUlzQ3JlYXRlZCgpIHsKKyAgICAgICAgaWYgKHNSZWYgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgIkNvb2tpZVN5bmNNYW5hZ2VyOjpjcmVhdGVJbnN0YW5jZSgpIG5lZWRzIHRvIGJlIGNhbGxlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiYmVmb3JlIENvb2tpZVN5bmNNYW5hZ2VyOjpnZXRJbnN0YW5jZSgpIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiB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ZSBIYW5kbGVyIG1IYW5kbGVyOworICAgIHByaXZhdGUgU2Vuc29yTWFuYWdlciBtU2Vuc29yTWFuYWdlcjsKKyAgICBwcml2YXRlIENvbnRleHQgbUNvbnRleHQ7CisgICAgcHJpdmF0ZSBib29sZWFuIG1IYXZlU2VudEVycm9yRXZlbnQ7CisgICAgcHJpdmF0ZSBSdW5uYWJsZSBtVXBkYXRlUnVubmFibGU7CisgICAgcHJpdmF0ZSBmbG9hdCBtTGFzdEFjY2VsZXJhdGlvbltdOworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IElOVEVSVkFMX01JTExJUyA9IDEwMDsKKworICAgIHB1YmxpYyBEZXZpY2VNb3Rpb25TZXJ2aWNlKERldmljZU1vdGlvbkFuZE9yaWVudGF0aW9uTWFuYWdlciBtYW5hZ2VyLCBDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgbU1hbmFnZXIgPSBtYW5hZ2VyOworICAgICAgICBhc3NlcnQobU1hbmFnZXIgIT0gbnVsbCk7CisgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKKyAgICAgICAgYXNzZXJ0KG1Db250ZXh0ICE9IG51bGwpOworICAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzdGFydCgpIHsKKyAgICAgICAgbUlzUnVubmluZyA9IHRydWU7CisgICAgICAgIHJlZ2lzdGVyRm9yU2Vuc29yKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc3RvcCgpIHsKKyAgICAgICAgbUlzUnVubmluZyA9IGZhbHNlOworICAgICAgICBzdG9wU2VuZGluZ1VwZGF0ZXMoKTsKKyAgICAgICAgdW5yZWdpc3RlckZyb21TZW5zb3IoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzdXNwZW5kKCkgeworICAgICAgICBpZiAobUlzUnVubmluZykgeworICAgICAgICAgICAgc3RvcFNlbmRpbmdVcGRhdGVzKCk7CisgICAgICAgICAgICB1bnJlZ2lzdGVyRnJvbVNlbnNvcigpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcmVzdW1lKCkgeworICAgICAgICBpZiAobUlzUnVubmluZykgeworICAgICAgICAgICAgcmVnaXN0ZXJGb3JTZW5zb3IoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzZW5kRXJyb3JFdmVudCgpIHsKKyAgICAgICAgYXNzZXJ0IFdlYlZpZXdDb3JlLlRIUkVBRF9OQU1FLmVxdWFscyhUaHJlYWQuY3VycmVudFRocmVhZCgpLmdldE5hbWUoKSk7CisgICAgICAgIC8vIFRoZSBzcGVjIHJlcXVpcmVzIHRoYXQgZWFjaCBsaXN0ZW5lciByZWNlaXZlcyB0aGUgZXJyb3IgZXZlbnQgb25seSBvbmNlLgorICAgICAgICBpZiAobUhhdmVTZW50RXJyb3JFdmVudCkKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgbUhhdmVTZW50RXJyb3JFdmVudCA9IHRydWU7CisgICAgICAgIGNyZWF0ZUhhbmRsZXIoKTsKKyAgICAgICAgbUhhbmRsZXIucG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBhc3NlcnQgV2ViVmlld0NvcmUuVEhSRUFEX05BTUUuZXF1YWxzKFRocmVhZC5jdXJyZW50VGhyZWFkKCkuZ2V0TmFtZSgpKTsKKyAgICAgICAgICAgICAgICBpZiAobUlzUnVubmluZykgeworICAgICAgICAgICAgICAgICAgICAvLyBUaGUgc3BlY2lhbCBjYXNlIG9mIGFsbCBudWxscyBpcyB1c2VkIHRvIHNpZ25pZnkgYSBmYWlsdXJlIHRvIGdldCBkYXRhLgorICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5vbk1vdGlvbkNoYW5nZShudWxsLCBudWxsLCBudWxsLCAwLjApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGNyZWF0ZUhhbmRsZXIoKSB7CisgICAgICAgIGlmIChtSGFuZGxlciAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCk7CisgICAgICAgIG1VcGRhdGVSdW5uYWJsZSA9IG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIG1NYW5hZ2VyLm9uTW90aW9uQ2hhbmdlKG5ldyBEb3VibGUobUxhc3RBY2NlbGVyYXRpb25bMF0pLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IERvdWJsZShtTGFzdEFjY2VsZXJhdGlvblsxXSksIG5ldyBEb3VibGUobUxhc3RBY2NlbGVyYXRpb25bMl0pLAorICAgICAgICAgICAgICAgICAgICAgICAgSU5URVJWQUxfTUlMTElTKTsKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5wb3N0RGVsYXllZChtVXBkYXRlUnVubmFibGUsIElOVEVSVkFMX01JTExJUyk7CisgICAgICAgICAgICAgICAgLy8gTm93IHRoYXQgd2UgaGF2ZSBzdWNjZXNzZnVsbHkgc2VudCBzb21lIGRhdGEsIHJlc2V0IHdoZXRoZXIgd2UndmUgc2VudCBhbiBlcnJvci4KKyAgICAgICAgICAgICAgICBtSGF2ZVNlbnRFcnJvckV2ZW50ID0gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHN0YXJ0U2VuZGluZ1VwZGF0ZXMoKSB7CisgICAgICAgIGNyZWF0ZUhhbmRsZXIoKTsKKyAgICAgICAgbVVwZGF0ZVJ1bm5hYmxlLnJ1bigpOworICAgIH0KKworICAgIHByaXZhdGUgdm9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m5pbmcgPSBmYWxzZTsKKyAgICAgICAgdW5yZWdpc3RlckZyb21TZW5zb3JzKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc3VzcGVuZCgpIHsKKyAgICAgICAgaWYgKG1Jc1J1bm5pbmcpIHsKKyAgICAgICAgICAgIHVucmVnaXN0ZXJGcm9tU2Vuc29ycygpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcmVzdW1lKCkgeworICAgICAgICBpZiAobUlzUnVubmluZykgeworICAgICAgICAgICAgcmVnaXN0ZXJGb3JTZW5zb3JzKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2VuZEVycm9yRXZlbnQoKSB7CisgICAgICAgIGFzc2VydCBXZWJWaWV3Q29yZS5USFJFQURfTkFNRS5lcXVhbHMoVGhyZWFkLmN1cnJlbnRUaHJlYWQoKS5nZXROYW1lKCkpOworICAgICAgICAvLyBUaGUgc3BlYyByZXF1aXJlcyB0aGF0IGVhY2ggbGlzdGVuZXIgcmVjZWl2ZXMgdGhlIGVycm9yIGV2ZW50IG9ubHkgb25jZS4KKyAgICAgICAgaWYgKG1IYXZlU2VudEVycm9yRXZlbnQpCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIG1IYXZlU2VudEVycm9yRXZlbnQgPSB0cnVlOworICAgICAgICBtSGFuZGxlci5wb3N0KG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIGFzc2VydCBXZWJWaWV3Q29yZS5USFJFQURfTkFNRS5lcXVhbHMoVGhyZWFkLmN1cnJlbnRUaHJlYWQoKS5nZXROYW1lKCkpOworICAgICAgICAgICAgICAgIGlmIChtSXNSdW5uaW5nKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBzcGVjaWFsIGNhc2Ugb2YgYWxsIG51bGxzIGlzIHVzZWQgdG8gc2lnbmlmeSBhIGZhaWx1cmUgdG8gZ2V0IGRhdGEuCisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLm9uT3JpZW50YXRpb25DaGFuZ2UobnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVnaXN0ZXJGb3JTZW5zb3JzKCkgeworICAgICAgICBpZiAobUhhbmRsZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgbUhhbmRsZXIgPSBuZXcgSGFuZGxlcigpOworICAgICAgICB9CisgICAgICAgIGlmICghcmVnaXN0ZXJGb3JBY2NlbGVyb21ldGVyU2Vuc29yKCkgfHwgIXJlZ2lzdGVyRm9yTWFnbmV0aWNGaWVsZFNlbnNvcigpKSB7CisgICAgICAgICAgICB1bnJlZ2lzdGVyRnJvbVNlbnNvcnMoKTsKKyAgICAgICAgICAgIHNlbmRFcnJvckV2ZW50KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZ2V0T3JpZW50YXRpb25Vc2luZ0dldFJvdGF0aW9uTWF0cml4KCkgeworICAgICAgICBpZiAobUdyYXZpdHlWZWN0b3IgPT0gbnVsbCB8fCBtTWFnbmV0aWNGaWVsZFZlY3RvciA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICAvLyBHZXQgdGhlIHJvdGF0aW9uIG1hdHJpeC4KKyAgICAgICAgLy8gVGhlIHJvdGF0aW9uIG1hdHJpeCB0aGF0IHRyYW5zZm9ybXMgZnJvbSB0aGUgYm9keSBmcmFtZSB0byB0aGUgZWFydGggZnJhbWUuCisgICAgICAgIGZsb2F0W10gZGV2aWNlUm90YXRpb25NYXRyaXggPSBuZXcgZmxvYXRbOV07CisgICAgICAgIGlmICghU2Vuc29yTWFuYWdlci5nZXRSb3RhdGlvbk1hdHJpeCgK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yZWFkLmN1cnJlbnRUaHJlYWQoKS5nZXROYW1lKCkpOworICAgICAgICBpZiAobUFscGhhID09IG51bGwgfHwgbUJldGEgPT0gbnVsbCB8fCBtR2FtbWEgPT0gbnVsbAorICAgICAgICAgICAgICAgIHx8IE1hdGguYWJzKGFscGhhIC0gbUFscGhhKSA+IERFTFRBX0RFR1JFU1MKKyAgICAgICAgICAgICAgICB8fCBNYXRoLmFicyhiZXRhIC0gbUJldGEpID4gREVMVEFfREVHUkVTUworICAgICAgICAgICAgICAgIHx8IE1hdGguYWJzKGdhbW1hIC0gbUdhbW1hKSA+IERFTFRBX0RFR1JFU1MpIHsKKyAgICAgICAgICAgIG1BbHBoYSA9IGFscGhhOworICAgICAgICAgICAgbUJldGEgPSBiZXRhOworICAgICAgICAgICAgbUdhbW1hID0gZ2FtbWE7CisgICAgICAgICAgICBtTWFuYWdlci5vbk9yaWVudGF0aW9uQ2hhbmdlKG1BbHBoYSwgbUJldGEsIG1HYW1tYSk7CisgICAgICAgICAgICAvLyBOb3cgdGhhdCB3ZSBoYXZlIHN1Y2Nlc3NmdWxseSBzZW50IHNvbWUgZGF0YSwgcmVzZXQgd2hldGhlciB3ZSd2ZSBzZW50IGFuIGVycm9yLgorICAgICAgICAgICAgbUhhdmVTZW50RXJyb3JFdmVudCA9IGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2Vuc29yRXZlbnRMaXN0ZW5lciBpbXBsZW1lbnRhdGlvbi4KKyAgICAgKiBDYWxsYmFja3MgaGFwcGVuIG9uIHRoZSB0aHJlYWQgb24gd2hpY2ggd2UgcmVnaXN0ZXJlZCAtIHRoZSBXZWJDb3JlIHRocmVhZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBvblNlbnNvckNoYW5nZWQoU2Vuc29yRXZlbnQgZXZlbnQpIHsKKyAgICAgICAgYXNzZXJ0KGV2ZW50LnZhbHVlcy5sZW5ndGggPT0gMyk7CisgICAgICAgIGFzc2VydCBXZWJWaWV3Q29yZS5USFJFQURfTkFNRS5lcXVhbHMoVGhyZWFkLmN1cnJlbnRUaHJlYWQoKS5nZXROYW1lKCkpOworCisgICAgICAgIGlmICghbUlzUnVubmluZykgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgc3dpdGNoIChldmVudC5zZW5zb3IuZ2V0VHlwZSgpKSB7CisgICAgICAgICAgY2FzZSBTZW5zb3IuVFlQRV9BQ0NFTEVST01FVEVSOgorICAgICAgICAgICAgaWYgKG1HcmF2aXR5VmVjdG9yID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtR3Jhdml0eVZlY3RvciA9IG5ldyBmbG9hdFszXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1HcmF2aXR5VmVjdG9yWzBdID0gZXZlbnQudmFsdWVzWzBdOworICAgICAgICAgICAgbUdyYXZpdHlWZWN0b3JbMV0gPSBldmVudC52YWx1ZXNbMV07CisgICAgICAgICAgICBtR3Jhdml0eVZlY3RvclsyXSA9IGV2ZW50LnZhbHVlc1syXTsKKyAgICAgICAgICAgIGdldE9yaWVudGF0aW9uVXNpbmdHZXRSb3RhdGlvbk1hdHJpeCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSBTZW5zb3IuVFlQRV9NQUdORVRJQ19GSUVMRDoKKyAgICAgICAgICAgIGlmIChtTWFnbmV0aWNGaWVsZFZlY3RvciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbU1hZ25ldGljRmllbGRWZWN0b3IgPSBuZXcgZmxvYXRbM107CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTWFnbmV0aWNGaWVsZFZlY3RvclswXSA9IGV2ZW50LnZhbHVlc1swXTsKKyAgICAgICAgICAgIG1NYWduZXRpY0ZpZWxkVmVjdG9yWzFdID0gZXZlbnQudmFsdWVzWzFdOworICAgICAgICAgICAgbU1hZ25ldGljRmllbGRWZWN0b3JbMl0gPSBldmVudC52YW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IGZpbmQgPSBtRWRpdFRleHQuZ2V0VGV4dCgpOworICAgICAgICBpZiAoMCA9PSBmaW5kLmxlbmd0aCgpKSB7CisgICAgICAgICAgICBtV2ViVmlldy5jbGVhck1hdGNoZXMoKTsKKyAgICAgICAgICAgIG1NYXRjaGVzLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgIG1NYXRjaGVzRm91bmQgPSBmYWxzZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1NYXRjaGVzRm91bmQgPSB0cnVlOworICAgICAgICAgICAgbU1hdGNoZXMuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgbU51bWJlck9mTWF0Y2hlcyA9IG1XZWJWaWV3LmZpbmRBbGwoZmluZC50b1N0cmluZygpKTsKKyAgICAgICAgICAgIGlmICgwID09IG1OdW1iZXJPZk1hdGNoZXMpIHsKKyAgICAgICAgICAgICAgICBtTWF0Y2hlcy5zZXRUZXh0KG1SZXNvdXJjZXMuZ2V0U3RyaW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcubm9fbWF0Y2hlcykpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB1cGRhdGVNYXRjaGVzU3RyaW5nKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqIFVwZGF0ZSB0aGUgc3RyaW5nIHdoaWNoIHRlbGxzIHRoZSB1c2VyIGhvdyBtYW55IG1hdGNoZXMgd2VyZSBmb3VuZCwgYW5kCisgICAgICogd2hpY2ggbWF0Y2ggaXMgY3VycmVudGx5IGhpZ2hsaWdodGVkLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCB1cGRhdGVNYXRjaGVzU3RyaW5nKCkgeworICAgICAgICBTdHJpbmcgdGVtcGxhdGUgPSBtUmVzb3VyY2VzLmdldFF1YW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Xh0KCIwIik7CisgICAgICAgIG1FZGl0VGV4dC5yZXF1ZXN0Rm9jdXMoKTsKKyAgICAgICAgbUlucHV0LnNob3dTb2Z0SW5wdXQobUVkaXRUZXh0LCAwKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25EZXN0cm95QWN0aW9uTW9kZShBY3Rpb25Nb2RlIG1vZGUpIHsKKyAgICAgICAgaWYgKG1UaXRsZUJhciAhPSBudWxsKSBtV2ViVmlldy5zZXRFbWJlZGRlZFRpdGxlQmFyKG1UaXRsZUJhcik7CisgICAgICAgIG1XZWJWaWV3Lm5vdGlmeUZpbmREaWFsb2dEaXNtaXNzZWQoKTsKKyAgICAgICAgbUlucHV0LmhpZGVTb2Z0SW5wdXRGcm9tV2luZG93KG1XZWJWaWV3LmdldFdpbmRvd1Rva2VuKCksIDApOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uUHJlcGFyZUFjdGlvbk1vZGUoQWN0aW9uTW9kZSBtb2RlLCBNZW51IG1lbnUpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uQWN0aW9uSXRlbUNsaWNrZWQoQWN0aW9uTW9kZSBtb2RlLCBNZW51SXRlbSBpdGVtKSB7CisgICAgICAgIGlmICghbU1hdGNoZXNGb3VuZCkgeworICAgICAgICAgICAgZmluZEFsbCgpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgc3dpdGNoKGl0ZW0uZ2V0SXRlbUlkKCkpIHsKKyAgICAgICAgICAgIGNhc2UgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5maW5kX3ByZXY6CisgICAgICAgICAgICAgICAgZmluZE5leHQoZmFsc2UpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLmZpbmRfbmV4dDoKKyAgICAgICAgICAgICAgICBmaW5kTmV4dCh0cnVlKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIHVwZGF0ZU1hdGNoZXNTdHJpbmcoKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLy8gVGV4dFdhdGNoZXIgaW1wbGVtZW50YXRpb24KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGJlZm9yZVRleHRDaGFuZ2VkKENoYXJTZXF1ZW5jZSBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGFmdGVyKSB7CisgICAgICAgIC8vIERvZXMgbm90aGluZy4gIE5lZWRlZCB0byBpbXBsZW1lbnQgVGV4dFdhdGNoZXIuCisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25UZXh0Q2hhbmdlZChDaGFyU2VxdWVuY2UgcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBiZWZvcmUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY291bnQpIHsKKyAgICAgICAgZmluZEFsbCgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGFmdGVyVGV4dENoYW5nZWQoRWRpdGFibGUgcykgeworICAgICAgICAvLyBEb2VzIG5vdGhpbmcuICBOZWVkZWQgdG8gaW1wbGVtZW50IFRleHRXYXRjaGVyLgorICAgIH0KKworf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ci0gICAgICAgICAgICAvLyBQb3AgdGhlIGxvYWRlciBmcm9tIHRoZSBxdWV1ZS4KLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvYWRlclF1ZXVlKSB7Ci0gICAgICAgICAgICAgICAgYXNzZXJ0KG1Mb2FkZXJRdWV1ZS5wZWVrKCkgPT0gbG9hZGVyKTsKLSAgICAgICAgICAgICAgICBtTG9hZGVyUXVldWUucG9sbCgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gQ2FsbCBiYWNrLgotICAgICAgICAgICAgbG9hZGVyLmhhbmRsZUF1dGhSZXNwb25zZShtVXNlcm5hbWUsIG1QYXNzd29yZCk7Ci0gICAgICAgICAgICAvLyBUaGUgbWVzc2FnZSBxdWV1ZWQgYnkgdGhlIHJlc3BvbnNlIGZyb20gdGhlIGxhc3QgYXN5bmNocm9ub3VzCi0gICAgICAgICAgICAvLyByZXF1ZXN0LCBpZiBwcmVzZW50LCB3aWxsIHN0YXJ0IHRoZSBuZXh0IHJlcXVlc3QuCi0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBib29sZWFuIHByb2Nlc3NOZXh0ID0gZmFsc2U7Ci0KLSAgICAgICAgc3luY2hyb25pemVkIChtTG9hZGVyUXVldWUpIHsKLSAgICAgICAgICAgIG1Mb2FkZXJRdWV1ZS5vZmZlcihsb2FkZXIpOwotICAgICAgICAgICAgcHJvY2Vzc05leHQgPQotICAgICAgICAgICAgICAgIChtTG9hZGVyUXVldWUuc2l6ZSgpID09IDEpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHByb2Nlc3NOZXh0KSB7Ci0gICAgICAgICAgICBwcm9jZXNzTmV4dExvYWRlcigpOwotICAgICAgICB9CisgICAgcHVibGljIHZvaWQgY2FuY2VsKCkgewogICAgIH0KIAogICAgIC8qKgotICAgICAqIFdhaXQgZm9yIHRoZSByZXF1ZXN0IGluIGZsaWdodCwgaWYgYW55LCB0byBjb21wbGV0ZQorICAgICAqIFByb2NlZWQgd2l0aCB0aGUgYXV0aG9yaXphdGlvbiB3aXRoIHRoZSBnaXZlbiBjcmVkZW50aWFscy4KICAgICAgKi8KLSAgICBwcml2YXRlIHZvaWQgd2FpdEZvclJlcXVlc3RUb0NvbXBsZXRlKCkgewotICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZXF1ZXN0SW5GbGlnaHRMb2NrKSB7Ci0gICAgICAgICAgICB3aGlsZSAobVJlcXVlc3RJbkZsaWdodCkgewotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIG1SZXF1ZXN0SW5GbGlnaHRMb2NrLndhaXQoKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HVEFHLCAiSW50ZXJydXB0ZWQgd2hpbGUgd2FpdGluZyBmb3IgcmVxdWVzdCB0byBjb21wbGV0ZSIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIFByb2Nlc3MgdGhlIG5leHQgbG9hZGVyIGluIHRoZSBxdWV1ZSAoaGVscGVyIG1ldGhvZCkKLSAgICAgKi8KLSAgICBwcml2YXRlIHZvaWQgcHJvY2Vzc05leHRMb2FkZXIoKSB7Ci0gICAgICAgIExvYWRMaXN0ZW5lciBsb2FkZXIgPSBudWxsOwotICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2FkZXJRdWV1ZSkgewotICAgICAgICAgICAgbG9hZGVyID0gbUxvYWRlclF1ZXVlLnBlZWsoKTsKLSAgICAgICAgfQotICAgICAgICBpZiAobG9hZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVJlcXVlc3RJbkZsaWdodExvY2spIHsKLSAgICAgICAgICAgICAgICBhc3NlcnQobVJlcXVlc3RJbkZsaWdodCA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ICAgICAgICBtTmV0d29yayA9IG5ldHdvcms7CisgICAgICAgIG1Mb2FkZXJRdWV1ZSA9IG5ldyBMaW5rZWRMaXN0PExvYWRMaXN0ZW5lcj4oKTsKKyAgICB9CisKKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgTG9hZExpc3RlbmVyIGxvYWRlciA9IG51bGw7CisgICAgICAgIHN5bmNocm9uaXplZCAobUxvYWRlclF1ZXVlKSB7CisgICAgICAgICAgICBsb2FkZXIgPSBtTG9hZGVyUXVldWUucG9sbCgpOworICAgICAgICB9CisgICAgICAgIGFzc2VydChsb2FkZXIuaXNTeW5jaHJvbm91cygpID09IGZhbHNlKTsKKworICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CisgICAgICAgICAgICBjYXNlIEFVVEhfUFJPQ0VFRDoKKyAgICAgICAgICAgICAgICBTdHJpbmcgdXNlcm5hbWUgPSBtc2cuZ2V0RGF0YSgpLmdldFN0cmluZygidXNlcm5hbWUiKTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgcGFzc3dvcmQgPSBtc2cuZ2V0RGF0YSgpLmdldFN0cmluZygicGFzc3dvcmQiKTsKKworICAgICAgICAgICAgICAgIGxvYWRlci5oYW5kbGVBdXRoUmVzcG9uc2UodXNlcm5hbWUsIHBhc3N3b3JkKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBBVVRIX0NBTkNFTDoKKyAgICAgICAgICAgICAgICBsb2FkZXIuaGFuZGxlQXV0aFJlc3BvbnNlKG51bGwsIG51bGwpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgcHJvY2Vzc05leHRMb2FkZXIoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBIZWxwZXIgbWV0aG9kIHVzZWQgdG8gdW5ibG9jayBoYW5kbGVBdXRoUmVxdWVzdCgpLCB3aGljaCBpbiB0aGUgY2FzZSBvZiBhCisgICAgICogc3luY2hyb25vdXMgcmVxdWVzdCB3aWxsIHdhaXQgZm9yIHByb3h5Lm9uUmVjZWl2ZWRIdHRwQXV0aFJlcXVlc3QoKSB0bworICAgICAqIGNhbGwgYmFjayB0byBlaXRoZXIgcHJvY2VlZCgpIG9yIGNhbmNlbCgpLgorICAgICAqCisgICAgICogQHBhcmFtIHVzZXJuYW1lIFRoZSB1c2VybmFtZSB0byB1c2UgZm9yIGF1dGhlbnRpY2F0aW9uCisgICAgICogQHBhcmFtIHBhc3N3b3JkIFRoZSBwYXNzd29yZCB0byB1c2UgZm9yIGF1dGhlbnRpY2F0aW9uCisgICAgICogQHJldHVybiBUcnVlIGlmIHRoZSByZXF1ZXN0IGlzIHN5bmNocm9ub3VzIGFuZCBoYW5kbGVBdXRoUmVxdWVzdCgpIGhhcworICAgICAqIGJlZW4gdW5ibG9ja2VkCisgICAgICovCisgICAgcHJpdmF0ZSBib29sZWFuIGhhbmRsZVJlc3BvbnNlRm9yU3luY2hyb25vdXNSZXF1ZXN0KFN0cmluZyB1c2VybmFtZSwgU3RyaW5nIHBhc3N3b3JkKSB7CisgICAgICAgIExvYWRMaXN0ZW5lciBsb2FkZXIgPSBudWxsOworICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2FkZXJRdWV1ZSkgeworICAgICAgICAgICAgbG9hZGVyID0gbUxvYWRlclF1ZXVlLnBlZWsoKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobG9hZGVyLmlzU3luY2hyb25vdXMoKSkgeworICAgICAgICAgICAgbVVzZXJuYW1lID0gdXNlcm5hbWU7CisgICAgICAgICAgICBtUGFzc3dvcmQgPSBwYXNzd29yZDsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2lnbmFsUmVxdWVzdENvbXBsZXRlKCk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VzdCB0byB0aGUgcHJveHkgZm9yIHRoaXMgcmVxdWVzdCwganVtcGluZyB0aGUgcXVldWUuCisgICAgICAgICAgICAvLyBXZSB1c2UgdGhlIHF1ZXVlIHNvIHRoYXQgdGhlIGxvYWRlciBpcyBwcmVzZW50IGluCisgICAgICAgICAgICAvLyB1c2VIdHRwQXV0aFVzZXJuYW1lUGFzc3dvcmQoKS4KKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvYWRlclF1ZXVlKSB7CisgICAgICAgICAgICAgICAgbUxvYWRlclF1ZXVlLmFkZEZpcnN0KGxvYWRlcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwcm9jZXNzTmV4dExvYWRlcigpOworICAgICAgICAgICAgLy8gV2FpdCBmb3IgdGhpcyByZXF1ZXN0IHRvIGNvbXBsZXRlLgorICAgICAgICAgICAgd2FpdEZvclJlcXVlc3RUb0NvbXBsZXRlKCk7CisgICAgICAgICAgICAvLyBQb3AgdGhlIGxvYWRlciBmcm9tIHRoZSBxdWV1ZS4KKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvYWRlclF1ZXVlKSB7CisgICAgICAgICAgICAgICAgYXNzZXJ0KG1Mb2FkZXJRdWV1ZS5wZWVrKCkgPT0gbG9hZGVyKTsKKyAgICAgICAgICAgICAgICBtTG9hZGVyUXVldWUucG9sbCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gQ2FsbCBiYWNrLgorICAgICAgICAgICAgbG9hZGVyLmhhbmRsZUF1dGhSZXNwb25zZShtVXNlcm5hbWUsIG1QYXNzd29yZCk7CisgICAgICAgICAgICAvLyBUaGUgbWVzc2FnZSBxdWV1ZWQgYnkgdGhlIHJlc3BvbnNlIGZyb20gdGhlIGxhc3QgYXN5bmNocm9ub3VzCisgICAgICAgICAgICAvLyByZXF1ZXN0LCBpZiBwcmVzZW50LCB3aWxsIHN0YXJ0IHRoZSBuZXh0IHJlcXVlc3QuCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBib29sZWFuIHByb2Nlc3NOZXh0ID0gZmFsc2U7CisKKyAgICAgICAgc3luY2hyb25pemVkIChtTG9hZGVyUXVldWUpIHsKKyAgICAgICAgICAgIG1Mb2FkZXJRdWV1ZS5vZmZlcihsb2FkZXIpOworICAgICAgICAgICAgcHJvY2Vzc05leHQgPQorICAgICAgICAgICAgICAgIChtTG9hZGVyUXVldWUuc2l6ZSgpID09IDEpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHByb2Nlc3NOZXh0KSB7CisgICAgICAgICAgICBwcm9jZXNzTmV4dExvYWRlcigpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogV2FpdCBmb3IgdGhlIHJlcXVlc3QgaW4gZmxpZ2h0LCBpZiBhbnksIHRvIGNvbXBsZXRlCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHdhaXRGb3JSZXF1ZXN0VG9Db21wbGV0ZSgpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtUmVxdWVzdEluRmxpZ2h0TG9jaykgeworICAgICAgICAgICAgd2hpbGUgKG1SZXF1ZXN0SW5GbGlnaHQpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBtUmVxdWVzdEluRmxpZ2h0TG9jay53YWl0KCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR1RBRywgIkludGVycnVwdGVkIHdoaWxlIHdhaXRpbmcgZm9yIHJlcXVlc3QgdG8gY29tcGxldGUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBQcm9jZXNzIHRoZSBuZXh0IGxvYWRlciBpbiB0aGUgcXVldWUgKGhlbHBlciBtZXRob2QpCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIH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ogICAgIC8qKgogICAgICAqIENvbnN0cnVjdCBhIG5ldyBKV2ViQ29yZUphdmFCcmlkZ2UgdG8gaW50ZXJmYWNlIHdpdGgKICAgICAgKiBXZWJDb3JlIHRpbWVycyBhbmQgY29va2llcy4KICAgICAgKi8KICAgICBwdWJsaWMgSldlYkNvcmVKYXZhQnJpZGdlKCkgewogICAgICAgICBuYXRpdmVDb25zdHJ1Y3RvcigpOworCiAgICAgfQogCiAgICAgQE92ZXJyaWRlCkBAIC0yNzEsNiArMjc1LDI4IEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICAvLyBDYWxsZWQgb24gdGhlIFdlYkNvcmUgdGhyZWFkIHRocm91Z2ggSk5JLgorICAgIHByaXZhdGUgU3RyaW5nIHJlc29sdmVGaWxlUGF0aEZvckNvbnRlbnRVcmkoU3RyaW5nIHVyaSkgeworICAgICAgICBpZiAobUNvbnRlbnRVcmlUb0ZpbGVQYXRoTWFwICE9IG51bGwpIHsKKyAgICAgICAgICAgIFN0cmluZyBmaWxlTmFtZSA9IG1Db250ZW50VXJpVG9GaWxlUGF0aE1hcC5nZXQodXJpKTsKKyAgICAgICAgICAgIGlmIChmaWxlTmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVOYW1lOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gRmFpbHNhZmUgZmFsbGJhY2sgdG8ganVzdCB1c2UgdGhlIGxhc3QgcGF0aCBzZWdtZW50LgorICAgICAgICAvLyAoU2VlIE9wZW5hYmxlQ29sdW1ucyBkb2N1bWVudGF0aW9uIGluIHRoZSBTREspCisgICAgICAgIFVyaSBqVXJpID0gVXJpLnBhcnNlKHVyaSk7CisgICAgICAgIHJldHVybiBqVXJpLmdldExhc3RQYXRoU2VnbWVudCgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN0b3JlRmlsZVBhdGhGb3JDb250ZW50VXJpKFN0cmluZyBwYXRoLCBTdHJpbmcg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29udGVudFR5cGUoKTsKICAgICAgICAgaWYgKGNvbnRlbnRUeXBlICE9IG51bGwpIHsKICAgICAgICAgICAgIHBhcnNlQ29udGVudFR5cGVIZWFkZXIoY29udGVudFR5cGUpOwotCi0gICAgICAgICAgICAvLyBJZiB3ZSBoYXZlIG9uZSBvZiAiZ2VuZXJpYyIgTUlNRSB0eXBlcywgdHJ5IHRvIGRlZHVjZQotICAgICAgICAgICAgLy8gdGhlIHJpZ2h0IE1JTUUgdHlwZSBmcm9tIHRoZSBmaWxlIGV4dGVuc2lvbiAoaWYgYW55KToKLSAgICAgICAgICAgIGlmIChtTWltZVR5cGUuZXF1YWxzKCJ0ZXh0L3BsYWluIikgfHwKLSAgICAgICAgICAgICAgICAgICAgbU1pbWVUeXBlLmVxdWFscygiYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtIikpIHsKLQotICAgICAgICAgICAgICAgIC8vIGZvciBhdHRhY2htZW50LCB1c2UgdGhlIGZpbGVuYW1lIGluIHRoZSBDb250ZW50LURpc3Bvc2l0aW9uCi0gICAgICAgICAgICAgICAgLy8gdG8gZ3Vlc3MgdGhlIG1pbWV0eXBlCi0gICAgICAgICAgICAgICAgU3RyaW5nIGNvbnRlbnREaXNwb3NpdGlvbiA9IGhlYWRlcnMuZ2V0Q29udGVudERpc3Bvc2l0aW9uKCk7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHVybCA9IG51bGw7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRlbnREaXNwb3NpdGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHVybCA9IFVSTFV0aWwucGFyc2VDb250ZW50RGlzcG9zaXRpb24oY29udGVudERpc3Bvc2l0aW9uKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHVybCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHVybCA9IG1Vcmw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0cmluZyBuZXdNaW1lVHlwZSA9IGd1ZXNzTWltZVR5cGVGcm9tRXh0ZW5zaW9uKHVybCk7Ci0gICAgICAgICAgICAgICAgaWYgKG5ld01pbWVUeXBlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgbU1pbWVUeXBlID0gbmV3TWltZVR5cGU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChtTWltZVR5cGUuZXF1YWxzKCJ0ZXh0L3ZuZC53YXAud21sIikpIHsKLSAgICAgICAgICAgICAgICAvLyBBcyB3ZSBkb24ndCBzdXBwb3J0IHdtbCwgcmVuZGVyIGl0IGFzIHBsYWluIHRleHQKLSAgICAgICAgICAgICAgICBtTWltZVR5cGUgPSAidGV4dC9wbGFpbiI7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8vIEl0IHNlZW1zIHRoYXQgeGh0bWwreG1sIGFuZCB2bmQud2FwLnhodG1sK3htbCBtaW1lCi0gICAgICAgICAgICAgICAgLy8gc3VidHlwZXMgYXJlIHVzZWQgaW50ZXJjaGFuZ2VhYmx5LiBTbyB0cmVhdCB0aGVtIHRoZSBzYW1lLgotICAgICAgICAgICAgICAgIGlmIChtTWltZVR5cGUuZXF1YWxzKCJhcHBsaWNhdGlvbi92bmQud2FwLnhodG1sK3htbCIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1NaW1lVHlwZSA9ICJhcHBsaWNhdGlvbi94aHRtbCt4bWwiOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1NaW1lVHlwZSA9IE1pbWVUeXBlTWFwLmdldFNpbmdsZXRvbigpLnJlbWFwR2VuZXJpY01pbWVUeXBlKAorICAgICAgICAgICAgICAgICAgICBtTWltZVR5cGUsIG1VcmwsIGhlYWRlcnMuZ2V0Q29udGVudERpc3Bvc2l0aW9uKCkpOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgLyogT2Z0ZW4gd2hlbiBzZXJ2ZXJzIHJlc3BvbmQgd2l0aCAzMDQgTm90IE1vZGlmaWVkIG9yIGEKICAgICAgICAgICAgICAgIFJlZGlyZWN0LCB0aGVuIHRoZXkgZG9uJ3Qgc3BlY2lmeSBhIE1JTUVUeXBlLiBXaGVuIHRoaXMKQEAgLTY4MCw4ICs2NTQsOCBAQAogICAgICAgICAgICAgICAgICAgICBpZiAoIW1BdXRoRmFpbGVkICYmIG1Vc2VybmFtZSAhPSBudWxsICYmIG1QYXNzd29yZCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgaG9zdCA9IG1BdXRoSGVhZGVyLmlzUHJveHkoKSA/CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5ldHdvcmsuZ2V0SW5zdGFuY2UobUNvbnRleHQpLmdldFByb3h5SG9zdG5hbWUoKSA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1VcmkubUhvc3Q7Ci0gICAgICAgICAgICAgICAgICAgICAgICBIdHRwQXV0aEhhbmRsZXIub25SZWNlaXZlZENyZWRlbnRpYWxzKHRoaXMsIGhvc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1VcmkuZ2V0SG9zdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgSHR0cEF1dGhIYW5kbGVySW1wbC5vblJlY2VpdmVkQ3JlZGVudGlhbHModGhpcywgaG9zdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF1dGhIZWFkZXIuZ2V0UmVhbG0oKSwgbVVzZXJuYW1lLCBtUGFzc3dvcmQpOwogICAgICAgICAgICAgICAgICAgICAgICAgbWFrZUF1dGhSZXNwb25zZShtVXNlcm5hbWUsIG1QYXNzd29yZCk7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC05NTAsNyArOTI0LDcgQEAKICAgICAgKi8KICAgICBTdHJpbmcgaG9zdCgpIHsKICAgICAgICAgaWYgKG1VcmkgIT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIG1VcmkubUhvc3Q7CisgICAgICAgICAgICByZXR1cm4gbVVyaS5nZXRIb3N0KCk7CiAgICAgICAgIH0KIAogICAgICAgICByZXR1cm4gbnVsbDsKQEAgLTEwODYsMTMgKzEwNjAsMTggQEAKICAgICAgICAgLy8gcmVxdWVzdCB3aXRoIHNvbWUgY3JlZGVudGlhbHMgdGhlbiBkb24ndCBjb21taXQgdGhlIGhlYWRlcnMKICAgICAgICAgLy8gb2YgdGhpcyByZXNwb25zZTsgd2FpdCBmb3IgdGhlIHJlc3BvbnNlIHRvIHRoZSByZXF1ZXN0IHdpdGggdGhlCiAgICAgICAgIC8vIGNyZWRlbnRpYWxzLgotICAgICAgICBpZiAobUF1dGhIZWFkZXIgIT0gbnVsbCkKKyAgICAgICAgaWYgKG1BdXRoSGVhZGVyICE9IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQogCi0gICAgICAgIC8vIENvbW1pdCB0aGUgaGVhZGVycyB0byBXZWJDb3JlCisgICAgICAgIHNldE5hdGl2ZVJlc3BvbnNlKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldE5hdGl2ZVJlc3BvbnNlKCkgewogICAgICAgICBpbnQgbmF0aXZlUmVzcG9uc2UgPSBjcmVhdGVOYXRpdmVSZXNwb25zZSgpOwogICAgICAgICAvLyBUaGUgbmF0aXZlIGNvZGUgZGVsZXRlcyB0aGUgbmF0aXZlIHJlc3BvbnNlIG9iamVjdC4KICAgICAgICAgbmF0aXZlUmVjZWl2ZWRSZXNwb25zZShuYXRpdmVSZXNwb25zZSk7CisgICAgICAgIG1TZXROYXRpdmVSZXNwb25zZSA9IHRydWU7CiAgICAgfQogCiAgICAgLyoqCkBAIC0xMTI3LDYgKzExMDYsOSBAQAogICAgICAqLwogICAgIHByaXZhdGUgdm9pZCBjb21taXRMb2FkKCkgewogICAgICAgICBpZiAobUNhbmNlbGxlZCkgcmV0dXJuOworICAgICAgICBpZiAoIW1TZXROYXRpdmVSZXNwb25zZSkgeworICAgICAgICAgICAgc2V0TmF0aXZlUmVzcG9uc2UoKTsKKyAgICAgICAgfQogCiAgICAgICAgIGlmIChtSXNNYWluUGFnZUxvYWRlcikgewogICAgICAgICAgICAgU3RyaW5nIHR5cGUgPSBzQ2VydGlmaWNhdGVUeXBlTWFwLmdldChtTWltZVR5cGUpOwpAQCAtMTE5Nyw2ICsxMTc5LDEwIEBACiAgICAgICAgIH0KICAgICAgICAgaWYgKG1OYXRpdmVMb2FkZXIgIT0gMCkgewogICAgICAgICAgICAgUGVyZkNoZWNrZXIgY2hlY2tlciA9IG5ldyBQZXJmQ2hlY2tlcigpOworICAgICAgICAgICAgaWYgKCFtU2V0TmF0aXZlUmVzcG9uc2UpIHsKKyAgICAgICAgICAgICAgICBzZXROYXRpdmVSZXNwb25zZSgpOworICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBuYXRpdmVGaW5pc2hlZCgpOwogICAgICAgICAgICAgY2hlY2tlci5yZXNwb25zZUFsZXJ0KCJyZXMgbmF0aXZlRmluaXNoZWQiKTsKICAgICAgICAgICAgIGNsZWFyTmF0aXZlTG9hZGVyKCk7CkBAIC0xMzEyLDYgKzEyOTgsOSBAQAogICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyB0ZXh0ID0gbUNvbnRleHQKICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRTdHJpbmcoUi5zdHJpbmcub3Blbl9wZXJtaXNzaW9uX2RlbnkpCiAgICAgICAgICAgICAgICAgICAgICAgICArICJcbiIgKyByZWRpcmVjdFRvOworICAgICAgICAgICAgICAgIGlmICghbVNldE5hdGl2ZVJlc3BvbnNlKSB7CisgICAgICAgICAgICAgICAgICAgIHNldE5hdGl2ZVJlc3BvbnNlKCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG5hdGl2ZUFkZERhdGEodGV4dC5nZ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aW9uIChpZiBhbnkpOgorICAgICAgICBpZiAoInRleHQvcGxhaW4iLmVxdWFscyhtaW1lVHlwZSkgfHwKKyAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtIi5lcXVhbHMobWltZVR5cGUpKSB7CisKKyAgICAgICAgICAgIC8vIGZvciBhdHRhY2htZW50LCB1c2UgdGhlIGZpbGVuYW1lIGluIHRoZSBDb250ZW50LURpc3Bvc2l0aW9uCisgICAgICAgICAgICAvLyB0byBndWVzcyB0aGUgbWltZXR5cGUKKyAgICAgICAgICAgIFN0cmluZyBmaWxlbmFtZSA9IG51bGw7CisgICAgICAgICAgICBpZiAoY29udGVudERpc3Bvc2l0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaWxlbmFtZSA9IFVSTFV0aWwucGFyc2VDb250ZW50RGlzcG9zaXRpb24oY29udGVudERpc3Bvc2l0aW9uKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChmaWxlbmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdXJsID0gZmlsZW5hbWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTdHJpbmcgZXh0ZW5zaW9uID0gZ2V0RmlsZUV4dGVuc2lvbkZyb21VcmwodXJsKTsKKyAgICAgICAgICAgIFN0cmluZyBuZXdNaW1lVHlwZSA9IGdldE1pbWVUeXBlRnJvbUV4dGVuc2lvbihleHRlbnNpb24pOworICAgICAgICAgICAgaWYgKG5ld01pbWVUeXBlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtaW1lVHlwZSA9IG5ld01pbWVUeXBlOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKCJ0ZXh0L3ZuZC53YXAud21sIi5lcXVhbHMobWltZVR5cGUpKSB7CisgICAgICAgICAgICAvLyBBcyB3ZSBkb24ndCBzdXBwb3J0IHdtbCwgcmVuZGVyIGl0IGFzIHBsYWluIHRleHQKKyAgICAgICAgICAgIG1pbWVUeXBlID0gInRleHQvcGxhaW4iOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gSXQgc2VlbXMgdGhhdCB4aHRtbCt4bWwgYW5kIHZuZC53YXAueGh0bWwreG1sIG1pbWUKKyAgICAgICAgICAgIC8vIHN1YnR5cGVzIGFyZSB1c2VkIGludGVyY2hhbmdlYWJseS4gU28gdHJlYXQgdGhlbSB0aGUgc2FtZS4KKyAgICAgICAgICAgIGlmICgiYXBwbGljYXRpb24vdm5kLndhcC54aHRtbCt4bWwiLmVxdWFscyhtaW1lVHlwZSkpIHsKKyAgICAgICAgICAgICAgICBtaW1lVHlwZSA9ICJhcHBsaWNhdGlvbi94aHRtbCt4bWwiOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBtaW1lVHlwZTsKICAgICB9CiAKICAgICAvKioKQEAgLTE2MSwzNjMgKzE1Nyw2IEBACiAgICAgICogQHJldHVybiBUaGUgc2luZ2xldG9uIGluc3RhbmNlIG9mIHRoZSBNSU1FLXR5cGUgbWFwLgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgTWltZVR5cGVNYXAgZ2V0U2luZ2xldG9uKCkgewotICAgICAgICBpZiAoc01pbWVUeXBlTWFwID09IG51bGwpIHsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcCA9IG5ldyBNaW1lVHlwZU1hcCgpOwotCi0gICAgICAgICAgICAvLyBUaGUgZm9sbG93aW5nIHRhYmxlIGlzIGJhc2VkIG9uIC9ldGMvbWltZS50eXBlcyBkYXRhIG1pbnVzCi0gICAgICAgICAgICAvLyBjaGVtaWNhbC8qIE1JTUUgdHlwZXMgYW5kIE1JTUUgdHlwZXMgdGhhdCBkb24ndCBtYXAgdG8gYW55Ci0gICAgICAgICAgICAvLyBmaWxlIGV4dGVuc2lvbnMuIFdlIGFsc28gZXhjbHVkZSB0b3AtbGV2ZWwgZG9tYWluIG5hbWVzIHRvCi0gICAgICAgICAgICAvLy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cnkoCi0gICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub2FzaXMub3BlbmRvY3VtZW50LmRhdGFiYXNlIiwgIm9kYiIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQuZm9ybXVsYSIsICJvZGYiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoCi0gICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub2FzaXMub3BlbmRvY3VtZW50LmdyYXBoaWNzIiwgIm9kZyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQuZ3JhcGhpY3MtdGVtcGxhdGUiLAotICAgICAgICAgICAgICAgICAgICAib3RnIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC5pbWFnZSIsICJvZGkiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoCi0gICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub2FzaXMub3BlbmRvY3VtZW50LnNwcmVhZHNoZWV0IiwgIm9kcyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQuc3ByZWFkc2hlZXQtdGVtcGxhdGUiLAotICAgICAgICAgICAgICAgICAgICAib3RzIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC50ZXh0IiwgIm9kdCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQudGV4dC1tYXN0ZXIiLCAib2RtIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC50ZXh0LXRlbXBsYXRlIiwgIm90dCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQudGV4dC13ZWIiLCAib3RoIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi9tc3dvcmQiLCAiZG9jIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi9tc3dvcmQiLCAiZG90Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9wZW54bWxmb3JtYXRzLW9mZmljZWRvY3VtZW50LndvcmRwcm9jZXNzaW5nbWwuZG9jdW1lbnQiLAotICAgICAgICAgICAgICAgICAgICAiZG9jeCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vcGVueG1sZm9ybWF0cy1vZmZpY2Vkb2N1bWVudC53b3JkcHJvY2Vzc2luZ21sLnRlbXBsYXRlIiwKLSAgICAgICAgICAgICAgICAgICAgImRvdHgiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5tcy1leGNlbCIsICJ4bHMiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5tcy1leGNlbCIsICJ4bHQiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoCi0gICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub3BlbnhtbGZvcm1hdHMtb2ZmaWNlZG9jdW1lbnQuc3ByZWFkc2hlZXRtbC5zaGVldCIsCi0gICAgICAgICAgICAgICAgICAgICJ4bHN4Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9wZW54bWxmb3JtYXRzLW9mZmljZWRvY3VtZW50LnNwcmVhZHNoZWV0bWwudGVtcGxhdGUiLAotICAgICAgICAgICAgICAgICAgICAieGx0eCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vdm5kLm1zLXBvd2VycG9pbnQiLCAicHB0Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQubXMtcG93ZXJwb2ludCIsICJwb3QiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5tcy1wb3dlcnBvaW50IiwgInBwcyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vcGVueG1sZm9ybWF0cy1vZmZpY2Vkb2N1bWVudC5wcmVzZW50YXRpb25tbC5wcmVzZW50YXRpb24iLAotICAgICAgICAgICAgICAgICAgICAicHB0eCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vcGVueG1sZm9ybWF0cy1vZmZpY2Vkb2N1bWVudC5wcmVzZW50YXRpb25tbC50ZW1wbGF0ZSIsCi0gICAgICAgICAgICAgICAgICAgICJwb3R4Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9wZW54bWxmb3JtYXRzLW9mZmljZWRvY3VtZW50LnByZXNlbnRhdGlvbm1sLnNsaWRlc2hvdyIsCi0gICAgICAgICAgICAgICAgICAgICJwcHN4Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQucmltLmNvZCIsICJjb2QiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zbWFmIiwgIm1tZiIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vdm5kLnN0YXJkaXZpc2lvbi5jYWxjIiwgInNkYyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vdm5kLnN0YXJkaXZpc2lvbi5kcmF3IiwgInNkYSIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5zdGFyZGl2aXNpb24uaW1wcmVzcyIsICJzZGQiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoCi0gICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQuc3RhcmRpdmlzaW9uLmltcHJlc3MiLCAic2RwIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQuc3RhcmRpdmlzaW9uLm1hdGgiLCAic21mIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQuc3RhcmRpdmlzaW9uLndyaXRlciIsCi0gICAgICAgICAgICAgICAgICAgICJzZHciKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdGFyZGl2aXNpb24ud3JpdGVyIiwKLSAgICAgICAgICAgICAgICAgICAgInZvciIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5zdGFyZGl2aXNpb24ud3JpdGVyLWdsb2JhbCIsICJzZ2wiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdW4ueG1sLmNhbGMiLCAic3hjIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLnN1bi54bWwuY2FsYy50ZW1wbGF0ZSIsICJzdGMiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdW4ueG1sLmRyYXciLCAic3hkIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLnN1bi54bWwuZHJhdy50ZW1wbGF0ZSIsICJzdGQiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdW4ueG1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ICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1ndGFyIiwgInRneiIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1ndGFyIiwgInRheiIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1oZGYiLCAiaGRmIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWljYSIsICJpY2EiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtaW50ZXJuZXQtc2lnbnVwIiwgImlucyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1pbnRlcm5ldC1zaWdudXAiLCAiaXNwIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWlwaG9uZSIsICJpaWkiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtaXNvOTY2MC1pbWFnZSIsICJpc28iKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtam1vbCIsICJqbXoiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gta2NoYXJ0IiwgImNocnQiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gta2lsbHVzdHJhdG9yIiwgImtpbCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rb2FuIiwgInNrcCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rb2FuIiwgInNrZCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rb2FuIiwgInNrdCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rb2FuIiwgInNrbSIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rcHJlc2VudGVyIiwgImtwciIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rcHJlc2VudGVyIiwgImtwdCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rc3ByZWFkIiwgImtzcCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rd29yZCIsICJrd2QiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gta3dvcmQiLCAia3d0Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWxhdGV4IiwgImxhdGV4Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWxoYSIsICJsaGEiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbHpoIiwgImx6aCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1sengiLCAibHp4Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW1ha2VyIiwgImZybSIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1tYWtlciIsICJtYWtlciIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1tYWtlciIsICJmcmFtZSIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1tYWtlciIsICJmYiIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1tYWtlciIsICJib29rIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW1ha2VyIiwgImZiZG9jIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW1pZiIsICJtaWYiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbXMtd21kIiwgIndtZCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1tcy13bXoiLCAid216Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW1zaSIsICJtc2kiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbnMtcHJveHktYXV0b2NvbmZpZyIsICJwYWMiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbndjIiwgIm53YyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1vYmplY3QiLCAibyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRye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ImhwcCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWMrK2hkciIsICJoeHgiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1jKytoZHIiLCAiaGgiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1jKytzcmMiLCAiYysrIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtYysrc3JjIiwgImNwcCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWMrK3NyYyIsICJjeHgiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1jaGRyIiwgImgiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1jb21wb25lbnQiLCAiaHRjIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtY3NoIiwgImNzaCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWNzcmMiLCAiYyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWRzcmMiLCAiZCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWhhc2tlbGwiLCAiaHMiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1qYXZhIiwgImphdmEiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1saXRlcmF0ZS1oYXNrZWxsIiwgImxocyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LW1vYyIsICJtb2MiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1wYXNjYWwiLCAicCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LXBhc2NhbCIsICJwYXMiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1wY3MtZ2NkIiwgImdjZCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LXNldGV4dCIsICJldHgiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC10Y2wiLCAidGNsIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtdGV4IiwgInRleCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LXRleCIsICJsdHgiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC10ZXgiLCAic3R5Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtdGV4IiwgImNscyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LXZjYWxlbmRhciIsICJ2Y3MiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC12Y2FyZCIsICJ2Y2YiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvLzNncHAiLCAiM2dwcCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vM2dwcCIsICIzZ3AiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvLzNncHAiLCAiM2cyIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby9kbCIsICJkbCIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vZHYiLCAiZGlmIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby9kdiIsICJkdiIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vZmxpIiwgImZsaSIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vbTR2IiwgIm00diIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vbXBlZyIsICJtcGVnIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby9tcGVnIiwgIm1wZyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vbXBlZyIsICJtcGUiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL21wNCIsICJtcDQiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL21wZWciLCAiVk9CIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby9xdWlja3RpbWUiLCAicXQiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL3F1aWNrdGltZSIsICJtb3YiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL3ZuZC5tcGVndXJsIiwgIm14dSIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8veC1sYS1hc2YiLCAibHNmIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby94LWxhLWFzZiIsICJsc3giKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL3gtbW5nIiwgIm1uZyIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8veC1tcy1hc2YiLCAiYXNmIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby94LW1zLWFzZiIsICJhc3giKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL3gtbXMtd20iLCAid20iKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL3gtbXMtd212IiwgIndtdiIpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8veC1tcy13bXgiLCAid214Iik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby94LW1zLXd2eCIsICJ3dngiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL3gtbXN2aWRlbyIsICJhdmkiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL3gtc2dpLW1vdmllIiwgIm1vdmllIik7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ4LWNvbmZlcmVuY2UveC1jb29sdGFsayIsICJpY2UiKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoIngtZXBvYy94LXNpc3gtYXBwIiwgInNpc3giKTsKLSAgICAgICAgfQotCiAgICAgICAgIHJldHVybiBzTWltZVR5cGVNYXA7CiAgICAgfQogfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvd2Via2l0L05ldHdvcmsuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9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UKKyAgICAgKiBjb25uZWN0aW9uLgorICAgICAqLworICAgIHByaXZhdGUgYm9vbGVhbiBtUm9hbWluZzsKKworICAgIC8qKgorICAgICAqIFRyYWNrcyBpZiB3ZSBhcmUgcm9hbWluZy4KKyAgICAgKi8KKyAgICBwcml2YXRlIFJvYW1pbmdNb25pdG9yIG1Sb2FtaW5nTW9uaXRvcjsKIAogICAgIC8qKgogICAgICAqIEByZXR1cm4gVGhlIHNpbmdsZXRvbiBpbnN0YW5jZSBvZiB0aGUgbmV0d29yay4KQEAgLTEwNyw2ICsxMjUsNyBAQAogICAgICAgICBpZiAoKytzUGxhdGZvcm1Ob3RpZmljYXRpb25FbmFibGVSZWZDb3VudCA9PSAxKSB7CiAgICAgICAgICAgICBpZiAoc05ldHdvcmsgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHNOZXR3b3JrLm1SZXF1ZXN0UXVldWUuZW5hYmxlUGxhdGZvcm1Ob3RpZmljYXRpb25zKCk7CisgICAgICAgICAgICAgICAgc05ldHdvcmsubW9uaXRvclJvYW1pbmcoKTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgc1BsYXRmb3JtTm90aWZpY2F0aW9ucyA9IHRydWU7CiAgICAgICAgICAgICB9CkBAIC0xMjEsNiArMTQwLDcgQEAKICAgICAgICAgaWYgKC0tc1BsYXRmb3JtTm90aWZpY2F0aW9uRW5hYmxlUmVmQ291bnQgPT0gMCkgewogICAgICAgICAgICAgaWYgKHNOZXR3b3JrICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBzTmV0d29yay5tUmVxdWVzdFF1ZXVlLmRpc2FibGVQbGF0Zm9ybU5vdGlmaWNhdGlvbnMoKTsKKyAgICAgICAgICAgICAgICBzTmV0d29yay5zdG9wTW9uaXRvcmluZ1JvYW1pbmcoKTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgc1BsYXRmb3JtTm90aWZpY2F0aW9ucyA9IGZhbHNl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gICAgbVJvYW1pbmcgPSBpbmZvLmlzUm9hbWluZygpOworICAgICAgICB9OworICAgIH07CisKKyAgICBwcml2YXRlIHZvaWQgbW9uaXRvclJvYW1pbmcoKSB7CisgICAgICAgIG1Sb2FtaW5nTW9uaXRvciA9IG5ldyBSb2FtaW5nTW9uaXRvcigpOworICAgICAgICBJbnRlbnRGaWx0ZXIgZmlsdGVyID0gbmV3IEludGVudEZpbHRlcigpOworICAgICAgICBmaWx0ZXIuYWRkQWN0aW9uKENvbm5lY3Rpdml0eU1hbmFnZXIuQ09OTkVDVElWSVRZX0FDVElPTik7CisgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIoc05ldHdvcmsubVJvYW1pbmdNb25pdG9yLCBmaWx0ZXIpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzdG9wTW9uaXRvcmluZ1JvYW1pbmcoKSB7CisgICAgICAgIGlmIChtUm9hbWluZ01vbml0b3IgIT0gbnVsbCkgeworICAgICAgICAgICAgbUNvbnRleHQudW5yZWdpc3RlclJlY2VpdmVyKG1Sb2FtaW5nTW9uaXRvcik7CisgICAgICAgICAgICBtUm9hbWluZ01vbml0b3IgPSBudWxsOworICAgICAgICB9CisgICAgfQorCiAgICAgLyoqCiAgICAgICogUmVxdWVzdCBhIHVybCBmcm9tIGVpdGhlciB0aGUgbmV0d29yayBvciB0aGUgZmlsZSBzeXN0ZW0uCiAgICAgICogQHBhcmFtIHVybCBUaGUgdXJsIHRvIGxvYWQuCkBAIC0xNzAsNiArMjE3LDExIEBACiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KIAorICAgICAgICAvLyBJZiB0aGlzIGlzIGEgcHJlZmV0Y2gsIGFib3J0IGl0IGlmIHdlJ3JlIHJvYW1pbmcuCisgICAgICAgIGlmIChtUm9hbWluZyAmJiBoZWFkZXJzLmNvbnRhaW5zS2V5KCJYLU1veiIpICYmICJwcmVmZXRjaCIuZXF1YWxzKGhlYWR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gICAgICAvLyBzaWduYXR1cmVzCisgICAgICAgICAgICAgICAgaWYgKCFjb250YWluc1BsdWdpblBlcm1pc3Npb25BbmRTaWduYXR1cmVzKHBrZ0luZm8pKSB7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBib29sZWFuIHBlcm1pc3Npb25PayA9IGZhbHNlOwotICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHBlcm1pdCA6IHBlcm1pc3Npb25zKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChQTFVHSU5fUEVSTUlTU0lPTi5lcXVhbHMocGVybWl0KSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcGVybWlzc2lvbk9rID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICghcGVybWlzc2lvbk9rKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8vIGNoZWNrIHRvIGVuc3VyZSB0aGUgcGx1Z2luIGlzIHByb3Blcmx5IHNpZ25lZAotICAgICAgICAgICAgICAgIFNpZ25hdHVyZSBzaWduYXR1cmVzW10gPSBwa2dJbmZvLnNpZ25hdHVyZXM7Ci0gICAgICAgICAgICAgICAgaWYgKHNpZ25hdHVyZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKFN5c3RlbVByb3BlcnRpZXMuZ2V0Qm9vbGVhbigicm8uc2VjdXJlIiwgZmFsc2UpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gc2lnbmF0dXJlTWF0Y2ggPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChTaWduYXR1cmUgc2lnbmF0dXJlIDogc2lnbmF0dXJlcykgewotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBTSUdOQVRVUkVTLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNJR05BVFVSRVNbaV0uZXF1YWxzKHNpZ25hdHVyZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2lnbmF0dXJlTWF0Y2ggPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKCFzaWduYXR1cmVNYXRjaCkgewotICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAvLyBkZXRlcm1pbmUgdGhlIHR5cGUgb2YgcGx1Z2luIGZyb20gdGhlIG1hbmlmZXN0CiAgICAgICAgICAgICAgICAgaWYgKHNlcnZpY2VJbmZvLm1ldGFEYXRhID09IG51bGwpIHsKQEAgLTIzNiw2ICsyMDYsNjQgQEAKICAgICB9CiAKICAgICAvKiBwYWNrYWdlICovCisgICAgYm9vbGVhbiBjb250YWluc1BsdWdpblBlcm1pc3Npb25BbmRTaWduYXR1cmVzKFN0cmluZyBwbHVnaW5BUEtOYW1lKSB7CisgICAgICAgIFBhY2thZ2VNYW5hZ2VyIHBtID0gbUNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKTsKKworICAgICAgICAvLyByZXRyaWV2ZSBpbmZvcm1hdGlvbiBmcm9tIHRoZSBwbHVnaW4ncyBtYW5pZmVzdAorICAgICAgICB0cnkgeworICAgICAgICAgICAgUGFja2FnZUlu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gICAgICAgICAgcGVybWlzc2lvbk9rID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoIXBlcm1pc3Npb25PaykgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgLy8gY2hlY2sgdG8gZW5zdXJlIHRoZSBwbHVnaW4gaXMgcHJvcGVybHkgc2lnbmVkCisgICAgICAgIFNpZ25hdHVyZSBzaWduYXR1cmVzW10gPSBwa2dJbmZvLnNpZ25hdHVyZXM7CisgICAgICAgIGlmIChzaWduYXR1cmVzID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBpZiAoU3lzdGVtUHJvcGVydGllcy5nZXRCb29sZWFuKCJyby5zZWN1cmUiLCBmYWxzZSkpIHsKKyAgICAgICAgICAgIGJvb2xlYW4gc2lnbmF0dXJlTWF0Y2ggPSBmYWxzZTsKKyAgICAgICAgICAgIGZvciAoU2lnbmF0dXJlIHNpZ25hdHVyZSA6IHNpZ25hdHVyZXMpIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IFNJR05BVFVSRVMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKFNJR05BVFVSRVNbaV0uZXF1YWxzKHNpZ25hdHVyZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpZ25hdHVyZU1hdGNoID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFzaWduYXR1cmVNYXRjaCkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiB0cnVlOworICAg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gICAgICAgIEJyb3dzZXIuc2VuZFN0cmluZyhtV2ViVmlldy5nZXRDb250ZXh0KCksIHNlbGVjdGlvbik7CisgICAgICAgICAgICAgICAgbW9kZS5maW5pc2goKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnNlbGVjdF9hbGw6CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuc2VsZWN0QWxsKCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5maW5kOgorICAgICAgICAgICAgICAgIFN0cmluZyBzZWw9IG1XZWJWaWV3LmdldFNlbGVjdGlvbigpOworICAgICAgICAgICAgICAgIG1vZGUuZmluaXNoKCk7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuc2hvd0ZpbmREaWFsb2coc2VsKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25EZXN0cm95QWN0aW9uTW9kZShBY3Rpb25Nb2RlIG1vZGUpIHsKKyAgICAgICAgaWYgKG1UaXRsZUJhciAhPSBudWxsKSBtV2ViVmlldy5zZXRFbWJlZGRlZFRpdGxlQmFyKG1UaXRsZUJhcik7CisgICAgICAgIG1XZWJWaWV3LnNlbGVjdGlvbkRvbmUoKTsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvVVJMVXRpbC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvd2Via2l0L1VSTFV0aWwuamF2YQppbmRleCA3YzVmMmIwLi41NDJkZDIxIDEwMDY0NAotLS0gYS9jb3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91Y2hJY29uVXJsKCkgewotICAgICAgICByZXR1cm4gbVRvdWNoSWNvblVybDsKKyAgICAgICAgaWYgKG1Ub3VjaEljb25VcmxGcm9tTGluayAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbVRvdWNoSWNvblVybEZyb21MaW5rOworICAgICAgICB9IGVsc2UgaWYgKG1Ub3VjaEljb25VcmxTZXJ2ZXJEZWZhdWx0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBtVG91Y2hJY29uVXJsU2VydmVyRGVmYXVsdDsKKyAgICAgICAgfQorCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBVUkwgdXJsID0gbmV3IFVSTChtT3JpZ2luYWxVcmwpOworICAgICAgICAgICAgbVRvdWNoSWNvblVybFNlcnZlckRlZmF1bHQgPSBuZXcgVVJMKHVybC5nZXRQcm90b2NvbCgpLCB1cmwuZ2V0SG9zdCgpLCB1cmwuZ2V0UG9ydCgpLAorICAgICAgICAgICAgICAgICAgICAiL2FwcGxlLXRvdWNoLWljb24ucG5nIikudG9TdHJpbmcoKTsKKyAgICAgICAgfSBjYXRjaCAoTWFsZm9ybWVkVVJMRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtVG91Y2hJY29uVXJsU2VydmVyRGVmYXVsdDsKICAgICB9CiAKICAgICAvKioKQEAgLTE3MSwxMSArMTk2LDE0IEBACiAgICAgfQogCiAgICAgLyoqCi0gICAgICogU2V0IHRoZSB0b3VjaCBpY29uIHVybC4KKyAgICAgKiBTZXQgdGhlIHRvdWNoIGljb24gdXJsLiBXaWxsIG5vdCBvdmVyd3JpdGUgYW4gaWNvbiB0aGF0IGhhcyBiZWVuCisgICAgICogc2V0IGFscmVhZHkgZnJvbSBhIDxsaW5rPiB0YWcsIHVubGVzcyB0aGUgbmV3IGljb24gaXMgcHJlY29tcG9zZWQuCiAgICAgICogQGhpZGUKICAgICAgKi8K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GUgaW50IG1VbmlxdWVJZDsKKyAgICAgICAgcHJpdmF0ZSBTdHJpbmcgbUZ1bGxOYW1lOworICAgICAgICBwcml2YXRlIFN0cmluZyBtRW1haWxBZGRyZXNzOworICAgICAgICBwcml2YXRlIFN0cmluZyBtQ29tcGFueU5hbWU7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1BZGRyZXNzTGluZTE7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1BZGRyZXNzTGluZTI7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1DaXR5OworICAgICAgICBwcml2YXRlIFN0cmluZyBtU3RhdGU7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1aaXBDb2RlOworICAgICAgICBwcml2YXRlIFN0cmluZyBtQ291bnRyeTsKKyAgICAgICAgcHJpdmF0ZSBTdHJpbmcgbVBob25lTnVtYmVyOworCisgICAgICAgIHB1YmxpYyBBdXRvRmlsbFByb2ZpbGUoaW50IHVuaXF1ZUlkLCBTdHJpbmcgZnVsbE5hbWUsIFN0cmluZyBlbWFpbCwKKyAgICAgICAgICAgICAgICBTdHJpbmcgY29tcGFueU5hbWUsIFN0cmluZyBhZGRyZXNzTGluZTEsIFN0cmluZyBhZGRyZXNzTGluZTIsCisgICAgICAgICAgICAgICAgU3RyaW5nIGNpdHksIFN0cmluZyBzdGF0ZSwgU3RyaW5nIHppcENvZGUsIFN0cmluZyBjb3VudHJ5LAorICAgICAgICAgICAgICAgIFN0cmluZyBwaG9uZU51bWJlcikgeworICAgICAgICAgICAgbVVuaXF1ZUlkID0gdW5pcXVlSWQ7CisgICAgICAgICAgICBtRnVsbE5hbWUgPSBmdWxsTmFtZTsKKyAgICAgICAgICAgIG1FbWFpbEFkZHJlc3MgPSBlbWFpbDsKKyAgICAgICAgICAgIG1Db21wYW55TmFtZSA9IGNvbXBhbnlOYW1lOworICAgICAgICAgICAgbUFkZHJlc3NMaW5lMSA9IGFkZHJlc3NMaW5lMTsKKyAgICAgICAgICAgIG1BZ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5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIGFkZExvY2FsZVRvSHR0cEFjY2VwdExhbmd1YWdlKGJ1ZmZlciwgbG9jYWxlKTsKKworICAgICAgICBpZiAoIUxvY2FsZS5VUy5lcXVhbHMobG9jYWxlKSkgeworICAgICAgICAgICAgaWYgKGJ1ZmZlci5sZW5ndGgoKSA+IDApIHsKKyAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCIsICIpOwogICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmICghbG9jYWxlLmVxdWFscyhMb2NhbGUuVVMpKSB7Ci0gICAgICAgICAgICBidWZmZXIuYXBwZW5kKCIsICIpOwotICAgICAgICAgICAgamF2YS51dGlsLkxvY2FsZSB1cyA9IExvY2FsZS5VUzsKLSAgICAgICAgICAgIGlmICh1cy5nZXRMYW5ndWFnZSgpICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKHVzLmdldExhbmd1YWdlKCkpOwotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBjb3VudHJ5ID0gdXMuZ2V0Q291bnRyeSgpOwotICAgICAgICAgICAgICAgIGlmIChjb3VudHJ5ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgiLSIpOwotICAgICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKGNvdW50cnkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoQUNDRVBUX0xBTkdfRk9SX1VTX0xPQ0FMRSk7CiAgICAgICAgIH0KIAogICAgICAgICByZXR1cm4gYnVmZmVyLnRvU3RyaW5nKCk7CiAgICAgfQotICAgIAorCisgICAgLyoqCisgICAgICogQ29udmVydCBvYnNvbGV0ZSBsYW5ndWFnZSBjb2RlcywgaW5jbHVkaW5nIEhlYnJldy9JbmRvbmVzaWFuL1lpZGRpc2gsCisgICAgICogdG8gbmV3IHN0YW5kYXJkLgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIFN0cmluZyBjb252ZXJ0T2Jzb2xldGVMYW5ndWFnZUNvZGVUb05ldyhTdHJpbmcgbGFuZ0NvZGUpIHsKKyAgICAgICAgaWYgKGxhbmdDb2RlID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIGlmICgiaXciLmVxdWFscyhsYW5nQ29kZSkpIHsKKyAgICAgICAgICAgIC8vIEhlYnJldworICAgICAgICAgICAgcmV0dXJuICJoZSI7CisgICAgICAgIH0gZWxzZSBpZiAoImluIi5lcXVhbHMobGFuZ0NvZGUpKSB7CisgICAgICAgICAgICAvLyBJbmRvbmVzaWFuCisgICAgICAgICAgICByZXR1cm4gImlkIjsKKyAgICAgICAgfSBlbHNlIGlmICgiamkiLmVxdWFscyhsYW5nQ29kZSkpIHsKKyAgICAgICAgICAgIC8vIFlpZGRpc2gKKyAgICAgICAgICAgIHJldHVybiAieWkiOworICAgICAgICB9CisgICAgICAgIHJldHVybiBsYW5nQ29kZTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGFkZExvY2FsZVRvSHR0cEFjY2VwdExhbmd1YWdlKFN0cmluZ0J1aWxkZXIgYnVpbGRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvY2FsZSBsb2NhbGUpIHsKKyAgICAgICAgU3RyaW5nIGxhbmd1YWdlID0gY29udmVydE9ic29sZXRlTGFuZ3VhZ2VDb2RlVG9OZXcobG9jYWxlLmdldExhbmd1YWdlKCkpOworICAgICAgICBpZiAobGFuZ3VhZ2UgIT0gbnVsbCkgeworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGFuZ3VhZ2UpOworICAgICAgICAgICAgU3RyaW5nIGNvdW50cnkgPSBsb2NhbGUuZ2V0Q291bnRyeSgpOworICAgICAgICAgICAgaWYgKGNvdW50cnkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCItIik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY291bnRyeSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKICAgICAvKioKICAgICAgKiBMb29rcyBhdCBzTG9jYWxlIGFuZCBtQ29udGV4dCBhbmQgcmV0dXJucyBjdXJyZW50IFVzZXJBZ2VudCBTdHJpbmcuCiAgICAgICogQHJldHVybiBDdXJyZW50IFVzZXJBZ2VudCBTdHJpbmcuCkBAIC0zODAsMTEgKzQ2OSwxMSBAQAogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgLy8gZGVmYXVsdCB0byAiMS4wIgogICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgiMS4wIik7Ci0gICAgICAgIH0gIAorICAgICAgICB9CiAgICAgICAgIGJ1ZmZlci5hcHBlbmQoIjsgIik7CiAgICAgICAgIGZpbmFsIFN0cmluZyBsYW5ndWFnZSA9IGxvY2FsZS5nZXRMYW5ndWFnZSgpOwogICAgICAgICBpZiAobGFuZ3VhZ2UgIT0gbnVsbCkgewotICAgICAgICAgICAgYnVmZmVyLmFwcGVuZChsYW5ndWFnZS50b0xvd2VyQ2FzZSgpKTsKKyAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoY29udmVydE9ic29sZXRlTGFuZ3VhZ2VDb2RlVG9OZXcobGFuZ3VhZ2UpKTsKICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBjb3VudHJ5ID0gbG9jYWxlLmdldENvdW50cnkoKTsKICAgICAgICAgICAgIGlmIChjb3VudHJ5ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCItIik7CkBAIC00MDcsMTEgKzQ5NiwxMyBAQAogICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgiIEJ1aWxkLyIpOwogICAgICAgICAgICAgYnVmZmVyLmFwcGVuZChpZCk7CiAgICAgICAgIH0KKyAgICAgICAgU3RyaW5nIG1vYmlsZSA9IG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFRleHQoCisgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy53ZWJfdXNlcl9hZ2VudF90YXJnZXRfY29udGVudCkudG9TdHJpbmcoKTsKICAgICAgICAgZmluYWwgU3RyaW5nIGJhc2UgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRUZXh0KAogICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLndlYl91c2VyX2FnZW50KS50b1N0cmluZygpOwotICAgICAgICByZXR1cm4gU3RyaW5nLmZvcm1hdChiYXNlLCBidWZmZXIpOworICAgICAgICByZXR1cm4gU3RyaW5nLmZvcm1hdChiYXNlLCBidWZmZXIsIG1vYmlsZSk7CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogRW5hYmxlcyBkdW1waW5nIHRoZSBwYWdlcyBuYXZpZ2F0aW9uIGNhY2hlIHRvIGEgdGV4dCBmaWxlLgogICAgICAqLwpAQCAtNDI3LDYgKzUxOCwyMSBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIElmIFdlYlZpZXcgb25seSBzdXBwb3J0cyB0b3VjaCwgYSBkaWZmZXJlbnQgbmF2aWdhdGlvbiBtb2RlbCB3aWxsIGJlCisgICAgICogYXBwbGllZC4gT3RoZXJ3aXNlLCB0aGUgbmF2aWdhdGlvbiB0byBzdXBwb3J0IGJvdGggdG91Y2ggYW5kIGtleWJvYXJkCisgICAgICogd2lsbCBiZSB1c2VkLgorICAgICAqIEBoaWRlCisgICAgcHVibGljIHZvaWQgc2V0U3VwcG9ydFRvdWNoT25seShib29sZWFuIHRvdWNoT25seSkgeworICAgICAgICBtU3VwcG9ydFRvdW5jaE9ubHkgPSB0b3VjaE9ubHk7CisgICAgfQorICAgICAqLworCisgICAgYm9vbGVhbiBzdXBwb3J0VG91Y2hPbmx5KCkgeworICAgICAgICAvLyBmb3IgZGVidWcgb25seSwgdXNlIG1MaWdodFRvdWNoRW5hYmxlZCBmb3IgbVN1cHBvcnRUb3VuY2hPbmx5CisgICAgICAgIHJldHVybiBtTGlnaHRUb3VjaEVuYWJsZWQ7CisgICAgfQorCisgICAgLyoqCiAgICAgICogU2V0IHdoZXRoZXIgdGhlIFdlYlZpZXcgc3VwcG9ydHMgem9vbQogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldFN1cHBvcnRab29tKGJvb2xlYW4gc3VwcG9ydCkgewpAQCAtNDQ4LDE0ICs1NTQsMzQgQEAKICAgICAgICAgbUJ1aWx0SW5ab29tQ29udHJvbHMgPSBlbmFibGVkOwogICAgICAgICBtV2ViVmlldy51cGRhdGVNdWx0aVRvdWNoU3VwcG9ydChtQ29udGV4dCk7CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogUmV0dXJucyB0cnVlIGlmIHRoZSB6b29tIG1lY2hhbmlzbSBidWlsdCBpbnRvIFdlYlZpZXcgaXMgYmVpbmcgdXNlZC4KICAgICAgKi8KICAgICBwdWJsaWMgYm9vbGVhbiBnZXRCdWlsdEluWm9vbUNvbnRyb2xzKCkgewogICAgICAgICByZXR1cm4gbUJ1aWx0SW5ab29tQ29udHJvbHM7CiAgICAgfQotICAgIAorCisgICAgLyoqCisgICAgICogU2V0cyB3aGV0aGVyIHRoZSBvbiBzY3JlZW4gem9vbSBidXR0b25zIGFyZSB1c2VkLgorICAgICAqIEEgY29tYmluYXRpb24gb2YgYnVpbHQgaW4gem9vbSBjb250cm9scyBlbmFibGVkCisgICAgICogYW5kIG9uIHNjcmVlbiB6b29tIGNvbnRyb2xzIGRpc2FibGVkIGFsbG93cyBmb3IgcGluY2ggdG8gem9vbQorICAgICAqIHRvIHdvcmsgd2l0aG91dCB0aGUgb24gc2NyZWVuIGNvbnRyb2xzCisgICAgICogQGhpZGUKKyAgICAgKi8K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92ZXJzY3JvbGxCYWNrZ3JvdW5kOworICAgIHB1YmxpYyBib29sZWFuIGVuYWJsZVNtb290aFRyYW5zaXRpb24oKSB7CisgICAgICAgIHJldHVybiBtRW5hYmxlU21vb3RoVHJhbnNpdGlvbjsKICAgICB9CiAKICAgICAvKioKQEAgLTk4Nyw2ICsxMTE1LDcgQEAKICAgICAgICAgaWYgKG1CbG9ja05ldHdvcmtMb2FkcyAhPSBmbGFnKSB7CiAgICAgICAgICAgICBtQmxvY2tOZXR3b3JrTG9hZHMgPSBmbGFnOwogICAgICAgICAgICAgdmVyaWZ5TmV0d29ya0FjY2VzcygpOworICAgICAgICAgICAgcG9zdFN5bmMoKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTAwMiw4ICsxMTMxLDggQEAKIAogICAgIHByaXZhdGUgdm9pZCB2ZXJpZnlOZXR3b3JrQWNjZXNzKCkgewogICAgICAgICBpZiAoIW1CbG9ja05ldHdvcmtMb2FkcykgewotICAgICAgICAgICAgaWYgKG1Db250ZXh0LmNoZWNrUGVybWlzc2lvbigiYW5kcm9pZC5wZXJtaXNzaW9uLklOVEVSTkVUIiwgCi0gICAgICAgICAgICAgICAgICAgIGFuZHJvaWQub3MuUHJvY2Vzcy5teVBpZCgpLCBhbmRyb2lkLm9zLlByb2Nlc3MubXlVaWQoKSkgIT0gCisgICAgICAgICAgICBpZiAobUNvbnRleHQuY2hlY2tQZXJtaXNzaW9uKCJhbmRyb2lkLnBlcm1pc3Npb24uSU5URVJORVQiLAorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkLm9zLlByb2Nlc3MubXlQaWQoKSwgYW5kcm9pZC5vcy5Qcm9jZXNzLm15VWlkKCkpICE9CiAgICAgICAgICAgICAgICAgICAgICAgICBQYWNrYWdlTWFuYWdlci5QRVJNSVNTSU9OX0dSQU5URUQpIHsKICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU2VjdXJpdHlFeGNlcHRpb24KICAgICAgICAgICAgICAgICAgICAgICAgICg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qLwpAQCAtMTIxMSw2ICsxMzUzLDcgQEAKICAgICAgKiBAcmV0dXJuIFRydWUgaWYgcGx1Z2lucyBhcmUgZW5hYmxlZC4KICAgICAgKiBAZGVwcmVjYXRlZCBUaGlzIG1ldGhvZCBoYXMgYmVlbiByZXBsYWNlZCBieSB7QGxpbmsgI2dldFBsdWdpblN0YXRlfQogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGdldFBsdWdpbnNFbmFibGVkKCkgewogICAgICAgICByZXR1cm4gbVBsdWdpblN0YXRlID09IFBsdWdpblN0YXRlLk9OOwogICAgIH0KQEAgLTEyODQsNyArMTQyNyw3IEBACiAgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHNldFVzZXJBZ2VudFN0cmluZyhTdHJpbmcgdWEpIHsKICAgICAgICAgaWYgKHVhID09IG51bGwgfHwgdWEubGVuZ3RoKCkgPT0gMCkgewogICAgICAgICAgICAgc3luY2hyb25pemVkKHNMb2NrRm9yTG9jYWxlU2V0dGluZ3MpIHsKLSAgICAgICAgICAgICAgICBMb2NhbGUgY3VycmVudExvY2FsZSA9IExvY2FsZS5nZXREZWZhdWx0KCk7IAorICAgICAgICAgICAgICAgIExvY2FsZSBjdXJyZW50TG9jYWxlID0gTG9jYWxlLmdldERlZmF1bHQoKTsKICAgICAgICAgICAgICAgICBpZiAoIXNMb2NhbGUuZXF1YWxzKGN1cnJlbnRMb2NhbGUpKSB7CiAgICAgICAgICAgICAgICAgICAgIHNMb2NhbGUgPSBjdXJyZW50TG9jYWxlOwogICAgICAgICAgICAgICAgICAgICBtQWNjZXB0TGFuZ3VhZ2UgPSBnZXRDdXJyZW50QWNjZXB0TGFuZ3VhZ2UoKTsKQEAgLTEzMzksMTEgKzE0ODIsMTUgQEAKICAgICAgICAgfQogICAgICAgICByZXR1cm4gbUFjY2VwdExhbmd1YWdlOwogICAgIH0KLSAgICAKKworICAgIC8qIHBhY2thZ2Ug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gLyoqCisgICAgICogUmV0dXJucyB3aGV0aGVyIHRvIHVzZSBmaXhlZCB2aWV3cG9ydC4KKyAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovIGJvb2xlYW4gZ2V0VXNlRml4ZWRWaWV3cG9ydCgpIHsKKyAgICAgICAgcmV0dXJuIG1Vc2VGaXhlZFZpZXdwb3J0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgd2hldGhlciBwcml2YXRlIGJyb3dzaW5nIGlzIGVuYWJsZWQuCisgICAgICovCisgICAgLyogcGFja2FnZSAqLyBib29sZWFuIGlzUHJpdmF0ZUJyb3dzaW5nRW5hYmxlZCgpIHsKKyAgICAgICAgcmV0dXJuIG1Qcml2YXRlQnJvd3NpbmdFbmFibGVkOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgd2hldGhlciBwcml2YXRlIGJyb3dzaW5nIGlzIGVuYWJsZWQuCisgICAgICogQHBhcmFtIGZsYWcgV2hldGhlciBwcml2YXRlIGJyb3dzaW5nIHNob3VsZCBiZSBlbmFibGVkLgorICAgICAqLworICAgIC8qIHBhY2thZ2UgKi8gc3luY2hyb25pemVkIHZvaWQgc2V0UHJpdmF0ZUJyb3dzaW5nRW5hYmxlZChib29sZWFuIGZsYWcpIHsKKyAgICAgICAgaWYgKG1Qcml2YXRlQnJvd3NpbmdFbmFibGVkICE9IGZsYWcpIHsKKyAgICAgICAgICAgIG1Qcml2YXRlQnJvd3NpbmdFbmFibGVkID0gZmxhZzsKKyAgICAgICAgICAgIHBvc3RTeW5jKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzeW5jaHJvbml6ZWQgdm9pZCBzZXRTeW50aGV0aWNMaW5rc0VuYWJsZWQoYm9vbGVhbiBmbGFnKSB7CisgICAgICAgIGlmIChtU3ludGhldGljTGlua3NFbmFibGVkICE9IGZsYWcpIHsKKyAgICAgICAgICAgIG1TeW50aGV0aWNMaW5rc0VuYWJsZWQgPSBmbGFnOworICAgICAgICAgICAgcG9zdFN5bmMoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHNldEF1dG9GaWxsRW5hYmxlZChib29sZWFuIGVuYWJsZWQpIHsKKyAgICAgICAgaWYgKG1BdXRvRmlsbEVuYWJsZWQgIT0gZW5hYmxlZCkgeworICAgICAgICAgICAgbUF1dG9GaWxsRW5hYmxlZCA9IGVuYWJsZWQ7CisgICAgICAgICAgICBwb3N0U3luYygpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gZ2V0QXV0b0ZpbGxFbmFibGVkKCkgeworICAgICAgICByZXR1cm4gbUF1dG9GaWxsRW5hYmxlZDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBzZXRBdXRvRmlsbFByb2ZpbGUoQXV0b0ZpbGxQcm9maWxlIHByb2ZpbGUpIHsKKyAgICAgICAgaWYgKG1BdXRvRmlsbFByb2ZpbGUgIT0gcHJvZmlsZSkgeworICAgICAgICAgICAgbUF1dG9GaWxsUHJvZmlsZSA9IHByb2ZpbGU7CisgICAgICAgICAgICBwb3N0U3luYygpOworICAgICAgICB9CisgICAgfQorCiAgICAgaW50IGdldERvdWJsZVRhcFRvYXN0Q291bnQoKSB7CiAgICAgICAgIHJldHVybiBtRG91YmxlVGFwVG9hc3RDb3VudDsKICAgICB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvV2ViVGV4dFZpZXcuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9XZWJUZXh0Vmlldy5qYXZhCmluZGV4IDFhOWNjZWEuLjE0ZGM2MWQgMTAwNjQ0Ci0tLSBhL2Nvcm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oZXZlbnQpOwotICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIC8vIEhvd2V2ZXIsIGlmIHRoZSBjdXJzb3IgaXMgYXQgdGhlIGJlZ2lubmluZyBvZiB0aGUgZmllbGQsIHdoaWNoCisgICAgICAgIC8vIGluY2x1ZGVzIHRoZSBjYXNlIHdoZXJlIGl0IGhhcyB6ZXJvIGxlbmd0aCwgdGhlbiB0aGUgdGV4dCBpcyBub3QKKyAgICAgICAgLy8gY2hhbmdlZCwgc28gc2VuZCB0aGUgZXZlbnRzIGltbWVkaWF0ZWx5LgorICAgICAgICBpZiAoS2V5RXZlbnQuS0VZQ09ERV9ERUwgPT0ga2V5Q29kZSkgeworICAgICAgICAgICAgaWYgKG9sZFN0YXJ0ID09IDAgJiYgb2xkRW5kID09IDApIHsKKyAgICAgICAgICAgICAgICBzZW5kRG9tRXZlbnQoZXZlbnQpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGRvd24pIHsKKyAgICAgICAgICAgICAgICBtR290RGVsZXRlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBtRGVsU2VsU3RhcnQgPSBvbGRTdGFydDsKKyAgICAgICAgICAgICAgICBtRGVsU2VsRW5kID0gb2xkRW5kOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgaWYgKChtU2luZ2xlICYmIEtleUV2ZW50LktFWUNPREVfRU5URVIgPT0ga2V5Q29kZSkpIHsKQEAgLTE5Nyw5ICsyMjYsOCBAQAogICAgICAgICBpZiAoZ2V0TGF5b3V0KCkgPT0gbnVsbCkgewogICAgICAgICAgICAgbWVhc3VyZShtV2lkdGhTcGVjLCBtSGVpZ2h0U3BlYyk7CiAgICAgICAgIH0KLSAgICAgICAgaW50IG9sZFN0YXJ0ID0gU2VsZWN0aW9uLmdldFNlbGVjdGlvblN0YXJ0KHRleHQpOwotICAgICAgICBpbnQgb2xkRW5kID0gU2VsZW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5kLCBjYW5kU3RhcnQsIGNhbmRFbmQpOwotICAgICAgICB9CiAgICAgICAgIGlmICghbUZyb21XZWJLaXQgJiYgIW1Gcm9tRm9jdXNDaGFuZ2UgJiYgIW1Gcm9tU2V0SW5wdXRUeXBlCi0gICAgICAgICAgICAgICAgJiYgbVdlYlZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICYmIG1XZWJWaWV3ICE9IG51bGwgJiYgIW1JblNldFRleHRBbmRLZWVwU2VsZWN0aW9uKSB7CiAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVEVYVF9WSUVXKSB7CiAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAib25TZWxlY3Rpb25DaGFuZ2VkIHNlbFN0YXJ0PSIgKyBzZWxTdGFydAogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHNlbEVuZD0iICsgc2VsRW5kKTsKQEAgLTQyNSwxNyArNDYzLDM4IEBACiAgICAgICAgIG1QcmVDaGFuZ2UgPSBwb3N0Q2hhbmdlOwogICAgICAgICBpZiAoMCA9PSBjb3VudCkgewogICAgICAgICAgICAgaWYgKGJlZm9yZSA+IDApIHsKKyAgICAgICAgICAgICAgICAvLyBGb3IgdGhpcyBhbmQgYWxsIGNoYW5nZXMgdG8gdGhlIHRleHQsIHVwZGF0ZSBvdXIgY2FjaGUKKyAgICAgICAgICAgICAgICB1cGRhdGVDYWNoZWRUZXh0ZmllbGQoKTsKKyAgICAgICAgICAgICAgICBpZiAobUdvdERlbGV0ZSkgeworICAgICAgICAgICAgICAgICAgICBtR290RGVsZXRlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGludCBvbGRFbmQgPSBzdGFydCArIGJlZm9yZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1EZWxTZWxFbmQgPT0gb2xkRW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKG1EZWxTZWxTdGFydCA9PSBzdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChtRGVsU2VsU3RhcnQgPT0gb2xkRW5kICYmIGJlZm9yZSA9PSAxKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBzZWxlY3Rpb24gaXMgc2V0IHVwIHByb3Blcmx5IGJlZm9yZSB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRlbGV0ZSwgc2VuZCB0aGUgRE9NIGV2ZW50cy4KKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbmREb21FdmVudChuZXcgS2V5RXZlbnQoS2V5RXZlbnQuQUNUSU9OX0RPV04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEtleUV2ZW50LktFWUNPREVfREVMKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZW5kRG9tRXZlbnQobmV3IEtleUV2ZW50KEtleUV2ZW50LkFDVElPTl9VUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgS2V5RXZlbnQuS0VZQ09ERV9ERUwpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBUaGlzIHdhcyBzaW1wbHkgYSBkZWxldGUgb3IgYSBjdXQsIHNvIGp1c3QgZGVsZXRlIHRoZQogICAgICAgICAgICAgICAgIC8vIHNlbGVjdGlvbi4KICAgICAgICAgICAgICAgICBtV2ViVmlldy5kZWxldGVTZWxlY3Rpb24oc3RhcnQsIHN0YXJ0ICsgYmVmb3JlKTsKLSAgICAgICAgICAgICAgICAvLyBGb3IgdGhpcyBhbmQgYWxsIGNoYW5nZXMgdG8gdGhlIHRleHQsIHVwZGF0ZSBvdXIgY2FjaGUKLSAgICAgICAgICAgICAgICB1cGRhdGVDYWNoZWRUZXh0ZmllbGQoKTsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Hb3REZWxldGUgPSBmYWxzZTsKICAgICAgICAgIC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aGVuIHRoZSBlZGl0IHRleHQgaXMgb3V0IG9mIGZvY3VzCi0gICAgICAgIElucHV0TWV0aG9kTWFuYWdlci5nZXRJbnN0YW5jZShtQ29udGV4dCkuaGlkZVNvZnRJbnB1dEZyb21XaW5kb3coCi0gICAgICAgICAgICAgICAgZ2V0V2luZG93VG9rZW4oKSwgMCk7CisgICAgICAgIElucHV0TWV0aG9kTWFuYWdlciBpbW0gPSBJbnB1dE1ldGhvZE1hbmFnZXIuZ2V0SW5zdGFuY2UobUNvbnRleHQpOworICAgICAgICBpZiAoaW1tLmlzQWN0aXZlKHRoaXMpKSB7CisgICAgICAgICAgICBpbW0uaGlkZVNvZnRJbnB1dEZyb21XaW5kb3coZ2V0V2luZG93VG9rZW4oKSwgMCk7CisgICAgICAgIH0KICAgICAgICAgbVdlYlZpZXcucmVtb3ZlVmlldyh0aGlzKTsKICAgICAgICAgbVdlYlZpZXcucmVxdWVzdEZvY3VzKCk7CiAgICAgfQogCisgICAgLyoqCisgICAgICogTW92ZSB0aGUgY2FyZXQvc2VsZWN0aW9uIGludG8gdmlldy4KKyAgICAgKi8KICAgICAvKiBwYWNrYWdlICovIHZvaWQgYnJpbmdJbnRvVmlldygpIHsKLSAgICAgICAgaWYgKGdldExheW91dCgpICE9IG51bGwpIHsKLSAgICAgICAgICAgIGJyaW5nUG9pbnRJbnRvVmlldyhTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kKGdldFRleHQoKSkpOworICAgICAgICBicmluZ1BvaW50SW50b1ZpZXcoU2VsZWN0aW9uLmdldFNlbGVjdGlvbkVuZChnZXRUZXh0KCkpKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBicmluZ1BvaW50SW50b1ZpZXcoaW50IG9mZnNldCkgeworICAgICAgICBpZiAobVdlYlZpZXcgPT0gbnVsbCkgcmV0dXJuIGZhbHNlOworICAgICAgICBpZiAobVdlYlZpZXcubmF0aXZlRm9jdXNDYW5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KCIiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIENhbGwgYSB3ZWJ2aWV3IG1ldGhvZCB0byB0ZWxsIFdlYkNvcmUgdG8gYXV0b2ZpbGwgdGhlIGZvcm0uCisgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy5hdXRvRmlsbEZvcm0obVF1ZXJ5SWQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzZXRPbkl0ZW1DbGlja0xpc3RlbmVyKG51bGwpOworICAgICAgICB9CisgICAgICAgIHNob3dEcm9wRG93bigpOwogICAgIH0KIAogICAgIC8qKgpAQCAtNjg3LDYgKzc3Nyw3IEBACiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICBTZWxlY3Rpb24uc2V0U2VsZWN0aW9uKHRleHQsIHNlbGVjdGlvbiwgc2VsZWN0aW9uKTsKICAgICAgICAgfQorICAgICAgICBpZiAobVdlYlZpZXcgIT0gbnVsbCkgbVdlYlZpZXcuaW5jcmVtZW50VGV4dEdlbmVyYXRpb24oKTsKICAgICB9CiAKICAgICAvKioKQEAgLTkxNiw3ICsxMDA3LDcgQEAKICAgICAgICAgICAgIGlmICh0eXBlICE9IDIgLyogUEFTU1dPUkQgKi8pIHsKICAgICAgICAgICAgICAgICBTdHJpbmcgbmFtZSA9IG1XZWJWaWV3Lm5hdGl2ZUZvY3VzQ2FuZGlkYXRlTmFtZSgpOwogICAgICAgICAgICAgICAgIGlmIChuYW1lICE9IG51bGwgJiYgbmFtZS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXcucmVxdWVzdEZvcm1EYXRhKG5hbWUsIG1Ob2RlUG9pbnRlcik7CisgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3LnJlcXVlc3RGb3JtRGF0YShuYW1lLCBtTm9kZVBvaW50ZXIsIG1BdXR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jb250ZXh0LCBBdHRyaWJ1dGVTZXQgYXR0cnMpIHsKLSAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIGF0dHJzKTsKLSAgICAgICAgICAgIExheW91dEluZmxhdGVyIGluZmxhdGVyID0gKExheW91dEluZmxhdGVyKQotICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5MQVlPVVRfSU5GTEFURVJfU0VSVklDRSk7Ci0gICAgICAgICAgICBpbmZsYXRlci5pbmZsYXRlKGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0Lnpvb21fbWFnbmlmeSwgdGhpcywgdHJ1ZSk7Ci0gICAgICAgICAgICBtUGx1c01pbnVzWm9vbUNvbnRyb2xzID0gKFpvb21Db250cm9scykgZmluZFZpZXdCeUlkKAotICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnpvb21Db250cm9scyk7Ci0gICAgICAgICAgICBmaW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC56b29tTWFnbmlmeSkuc2V0VmlzaWJpbGl0eSgKLSAgICAgICAgICAgICAgICAgICAgVmlldy5HT05FKTsKLSAgICAgICAgfQorICAgIHByaXZhdGUgWm9vbU1hbmFnZXIgbVpvb21NYW5hZ2VyOwogCi0gICAgICAgIHB1YmxpYyB2b2lkIHNob3coYm9vbGVhbiBzaG93Wm9vbSwgYm9vbGVhbiBjYW5ab29tT3V0KSB7Ci0gICAgICAgICAgICBtUGx1c01pbnVzWm9vbUNvbnRyb2xzLnNldFZpc2liaWxpdHkoCi0gICAgICAgICAgICAgICAgICAgIHNob3dab29tID8gVmlldy5WSVNJQkxFIDogVmlldy5HT05FKTsKLSAgICAgICAgICAgIGZhZGUoVmlldy5WSVNJQkxFLCAwLjBmLCAxLjBmKTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIGhpZGUoKSB7Ci0gICAgICAgICAgICBmYWRlKFZpZXcuR09ORSwgMS4wZiwgMC4wZik7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgZmFkZShpbnQgdmlzaWJpbGl0eSwgZmxvYXQgc3RhcnRBbHBoYSwgZmxvYXQgZW5kQWxwaGEpIHsKLSAgICAgICAgICAgIEFscGhhQW5pbWF0aW9uIGFuaW0gPSBuZXcgQWxwaGFBbmltYXRpb24oc3RhcnRBbHBoYSwgZW5kQWxwaGEpOwotICAgICAgICAgICAgYW5pbS5zZXREdXJhdGlvbig1MDApOwotICAgICAgICAgICAgc3RhcnRBbmltYXRpb24oYW5pbSk7Ci0gICAgICAgICAgICBzZXRWaXNpYmlsaXR5KHZpc2liaWxpdHkpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzRm9jdXMoKSB7Ci0gICAgICAgICAgICByZXR1cm4gbVBsdXNNaW51c1pvb21Db250cm9scy5oYXNGb2N1cygpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0T25ab29tSW5DbGlja0xpc3RlbmVyKE9uQ2xpY2tMaXN0ZW5lciBsaXN0ZW5lcikgewotICAgICAgICAgICAgbVBsdXNNaW51c1pvb21Db250cm9scy5zZXRPblpvb21JbkNsaWNrTGlzdGVuZXIobGlzdGVuZXIpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0T25ab29tT3V0Q2xpY2tMaXN0ZW5lcihPbkNsaWNrTGlzdGVuZXIgbGlzdGVuZXIpIHsKLSAgICAgICAgICAgIG1QbHVzTWludXNab29tQ29udHJvbHMuc2V0T25ab29tT3V0Q2xpY2tMaXN0ZW5lcihsaXN0ZW5lcik7Ci0gICAgICAgIH0KLQotICAgICAgICBab29tQ29udHJvbHMgICAgbVBsdXNNaW51c1pvb21Db250cm9sczsKLSAgICB9CisgICAgcHJpdmF0ZSBSZWN0IG1HTFJlY3RWaWV3cG9ydDsKIAogICAgIC8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A9IDEwNzsKICAgICBzdGF0aWMgZmluYWwgaW50IFVQREFURV9URVhURklFTERfVEVYVF9NU0dfSUQgICAgICAgPSAxMDg7CiAgICAgc3RhdGljIGZpbmFsIGludCBVUERBVEVfWk9PTV9SQU5HRSAgICAgICAgICAgICAgICAgID0gMTA5OwotICAgIHN0YXRpYyBmaW5hbCBpbnQgTU9WRV9PVVRfT0ZfUExVR0lOICAgICAgICAgICAgICAgICA9IDExMDsKKyAgICBzdGF0aWMgZmluYWwgaW50IFVOSEFORExFRF9OQVZfS0VZICAgICAgICAgICAgICAgICAgPSAxMTA7CiAgICAgc3RhdGljIGZpbmFsIGludCBDTEVBUl9URVhUX0VOVFJZICAgICAgICAgICAgICAgICAgID0gMTExOwogICAgIHN0YXRpYyBmaW5hbCBpbnQgVVBEQVRFX1RFWFRfU0VMRUNUSU9OX01TR19JRCAgICAgICA9IDExMjsKICAgICBzdGF0aWMgZmluYWwgaW50IFNIT1dfUkVDVF9NU0dfSUQgICAgICAgICAgICAgICAgICAgPSAxMTM7CkBAIC02MzYsMTYgKzYwNiwyMSBAQAogICAgIHN0YXRpYyBmaW5hbCBpbnQgU0hPV19GVUxMU0NSRUVOICAgICAgICAgICAgICAgICAgICA9IDEyMDsKICAgICBzdGF0aWMgZmluYWwgaW50IEhJREVfRlVMTFNDUkVFTiAgICAgICAgICAgICAgICAgICAgPSAxMjE7CiAgICAgc3RhdGljIGZpbmFsIGludCBET01fRk9DVVNfQ0hBTkdFRCAgICAgICAgICAgICAgICAgID0gMTIyOwotICAgIHN0YXRpYyBmaW5hbCBpbnQgSU1NRURJQVRFX1JFUEFJTlRfTVNHX0lEICAgICAgICAgICA9IDEyMzsKLSAgICBzdGF0aWMgZmluYWwgaW50IFNFVF9ST09UX0xBWUVSX01TR19JRCAgICAgICAgICAgICAgPSAxMjQ7CisgICAgc3RhdGljIGZpbmFsIGludCBSRVBMQUNFX0JBU0VfQ09OVEVOVCAgICAgICAgICAgICAgID0gMTIzOworICAgIHN0YXRpYyBmaW5hbCBpbnQgRk9STV9ESURfQkxVUiAgICAgICAgICAgICAgICAgICAgICA9IDEyNDsKICAgICBzdGF0aWMgZmluYWwgaW50IFJFVFVSTl9MQUJFTCAgICAgICAgICAgICAgICAgICAgICAgPSAxMjU7CiAgICAgc3RhdGljIGZpbmFsIGludCBGSU5EX0FHQUlOICAgICAgICAgICAgICAgICAgICAgICAgID0gMTI2OwogICAgIHN0YXRpYyBmaW5hbCBpbnQgQ0VOVEVSX0ZJVF9SRUNUICAgICAgICAgICAgICAgICAgICA9IDEyNzsKICAgICBzdGF0aWMgZmluYWwgaW50IFJFUVVFU1RfS0VZQk9BUkRfV0lUSF9TRUxFQ1RJT05fTVNHX0lEID0gMTI4OwogICAgIHN0YXRpYyBmaW5hbCBpbnQgU0VUX1NDUk9MTEJBUl9NT0RFUyAgICAgICAgICAgICAgICA9IDEyOTsKKyAgICBzdGF0aWMgZmluYWwgaW50IFNFTEVDVElPTl9TVFJJTkdfQ0hBTkdFRCAgICAgICAgICAgPSAxMzA7CisgICAgc3RhdGljIGZpbmFsIGludCBTRVRfVE9VQ0hfSElHSExJR0hUX1JFQ1RTICAgICAgICAgID0gMTMxOworICAgIHN0YXRpYyBmaW5hbCBpbnQgU0FWRV9XRUJBUkNISVZFX0ZJTklTSEVEICAgICAgICAgICA9IDEzMjsKKworICAgIHN0YXRpYyBmaW5hbCBpbnQgU0VUX0FVVE9GSUxMQUJMRSAgICAgICAgICAgICAgICAgICA9IDEzMzsKIAogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBGSVJTVF9QQUNLQUdFX01TR19JRCA9IFNDUk9MTF9UT19NU0dfSUQ7Ci0gICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IExBU1RfUEFDS0FHRV9NU0dfSUQgPSBTRVRfU0NST0xMQkFSX01PREVTOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBMQVNUX1BBQ0tBR0VfTVNHX0lEID0gU0VUX1RPVUNIX0hJR0hMSUdIVF9SRUNUUzsKIAogICAgIHN0YXRpYyBmaW5hbCBTdHJpbmdbXSBIYW5kbGVyUHJpdmF0ZURlYnVnU3RyaW5nID0gewogICAgICAgICAiUkVNRU1CRVJfUEFTU1dPUkQiLCAvLyAgICAgICAgICAgICAgPSAxOwpAQCAtNjcwLDcgKzY0NSw3IEBACiAgICAgICAgICJXRUJDT1JFX0lOSVRJQUxJWkVEX01TR19JRCIsIC8vICAgICA9IDEwNzsKICAgICAgICAgIlVQREFURV9URVhURklFTERfVEVYVF9NU0dfSUQiLCAvLyAgID0gMTA4OwogICAgICAgICAiVVBEQVRFX1pPT01fUkFOR0UiLCAvLyAgICAgICAgICAgICAgPSAxMDk7Ci0gICAgICAgICJNT1ZFX09VVF9PRl9QTFVHSU4iLCAvLyAgICAgICAgICAgICA9IDExMDsKKyAgICAgICAgIlVOSEFORExFRF9OQVZfS0VZIiwgLy8gICAgICAgICAgICAgID0gMTEwOwogICAgICAgICAiQ0xFQVJfVEVYVF9FTlRSWSIsIC8vICAgICAgICAgICAgICAgPSAxMTE7CiAgICAgICAgICJVUERBVEVfVEVYVF9TRUxFQ1RJT05fTVNHX0lEIiwgLy8gICA9IDExMjsKICAgICAgICAgIlNIT1dfUkVDVF9NU0dfSUQiLCAvLyAgICAgICAgICAgICAgID0gMTEzOwpAQCAtNjgzLDE4ICs2NTgsMjIgQEAKICAgICAgICAgIlNIT1dfRlVMTFNDUkVFTiIsIC8vICAgICAgICAgICAgICAgID0gMTIwOwogICAgICAgICAiSElERV9GVUxMU0NSRUVOIiwgLy8gICAgICAgICAgICAgICAgPSAxMjE7CiAgICAgICAgICJET01fRk9DVVNfQ0hBTkdFRCIsIC8vICAgICAgICAgICAgICA9IDEyMjsKLSAgICAgICAgIklNTUVESUFURV9SRVBBSU5UX01TR19JRCIsIC8vICAgICAgID0gMTIzOwotICAgICAgICAiU0VUX1JPT1RfTEFZRVJfTVNHX0lEIiwgLy8gICAgICAgICAgPSAxMjQ7CisgICAgICAgICJSRVBMQUNFX0JBU0VfQ09OVEVOVCIsIC8vICAgICAgICAgICA9IDEyMzsKKyAgICAgICAgIkZPUk1fRElEX0JMVVIiLCAvLyAgICAgICAgICAgICAgICAgID0gMTI0OwogICAgICAgICAiUkVUVVJOX0xBQkVMIiwgLy8gICAgICAgICAgICAgICAgICAgPSAxMjU7CiAgICAgICAgICJGSU5EX0FHQUlOIiwgLy8gICAgICAgICAgICAgICAgICAgICA9IDEyNjsKICAgICAgICAgIkNFTlRFUl9GSVRfUkVDVCIsIC8vICAgICAgICAgICAgICAgID0gMTI3OwogICAgICAgICAiUkVRVUVTVF9LRVlCT0FSRF9XSVRIX1NFTEVDVElPTl9NU0dfSUQiLCAvLyA9IDEyODsKLSAgICAgICAgIlNFVF9TQ1JPTExCQVJfTU9ERVMiIC8vICAgICAgICAgICAgID0gMTI5OworICAgICAgICAiU0VUX1NDUk9MTEJBUl9NT0RFUyIsIC8vICAgICAgICAgICAgPSAxMjk7CisgICAgICAgICJTRUxFQ1RJT05fU1RSSU5HX0NIQU5HRUQiLCAvLyAgICAgICA9IDEzMDsKKyAgICAgICAgIlNFVF9UT1VDSF9ISUdITElHSFRfUkVDVFMiLCAvLyAgICAgID0gMTMxOworICAgICAgICAiU0FWRV9XRUJBUkNISVZFX0ZJTklTSEVEIiwgLy8gICAgICAgPSAxMzI7CisgICAgICAgICJTRVRfQVVUT0ZJTExBQkxFIiAvLyAgICAgICAgICAgICAgICA9IDEzMzsKICAgICB9OwogCiAgICAgLy8gSWYgdGhlIHNpdGUgZG9lc24ndCB1c2UgdGhlIHZpZXdwb3J0IG1ldGEgdGFnIHRvIHNwZWNpZnkgdGhlIHZpZXdwb3J0LAogICAgIC8vIHVzZSBERUZBVUxUX1ZJRVdQT1JUX1dJRFRIIGFzIHRoZSBkZWZhdWx0IHZpZXdwb3J0IHdpZHRoCi0gICAgc3RhdGljIGZpbmFsIGludCBERUZBVUxUX1ZJRVdQT1JUX1dJRFRIID0gODAwOworICAg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RlbmVyKCkgewotCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uVmlzaWJpbGl0eUNoYW5nZWQoYm9vbGVhbiB2aXNpYmxlKSB7Ci0gICAgICAgICAgICBpZiAodmlzaWJsZSkgewotICAgICAgICAgICAgICAgIHN3aXRjaE91dERyYXdIaXN0b3J5KCk7Ci0gICAgICAgICAgICAgICAgLy8gQnJpbmcgYmFjayB0aGUgaGlkZGVuIHpvb20gY29udHJvbHMuCi0gICAgICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5nZXRab29tQ29udHJvbHMoKS5zZXRWaXNpYmlsaXR5KAotICAgICAgICAgICAgICAgICAgICAgICAgVmlldy5WSVNJQkxFKTsKLSAgICAgICAgICAgICAgICB1cGRhdGVab29tQnV0dG9uc0VuYWJsZWQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uWm9vbShib29sZWFuIHpvb21JbikgewotICAgICAgICAgICAgaWYgKHpvb21JbikgewotICAgICAgICAgICAgICAgIHpvb21JbigpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB6b29tT3V0KCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHVwZGF0ZVpvb21CdXR0b25zRW5hYmxlZCgpOwotICAgICAgICB9Ci0gICAgfTsKLQogICAgIC8qKgogICAgICAqIENvbnN0cnVjdCBhIG5ldyBXZWJWaWV3IHdpdGggYSBDb250ZXh0IG9iamVjdC4KICAgICAgKiBAcGFyYW0gY29udGV4dCBBIENvbnRleHQgb2JqZWN0IHVzZWQgdG8gYWNjZXNzIGFwcGxpY2F0aW9uIGFzc2V0cy4KQEAgLTk1OSw3ICs4NjMsMTggQEAKICAgICAgKiBAcGFyYW0gZGVmU3R5bGUgVGhlIGRlZmF1bHQgc3R5bGUgcmVzb3VyY2UgSUQuCiAgICAgICovCiAgICAgcHVibGljIFdlYlZpZXcoQ29udGV4dCBj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keSBleGlzdHMgdGhlbiB3ZSBkbyBub3QgbmVlZCB0byByZWdpc3RlciBpdAorICAgICAgICAgICAgLy8gYWdhaW4KKyAgICAgICAgICAgIGlmIChzUGFja2FnZUluc3RhbGxhdGlvblJlY2VpdmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIEludGVudEZpbHRlciBmaWx0ZXIgPSBuZXcgSW50ZW50RmlsdGVyKEludGVudC5BQ1RJT05fUEFDS0FHRV9BRERFRCk7CisgICAgICAgICAgICBmaWx0ZXIuYWRkQWN0aW9uKEludGVudC5BQ1RJT05fUEFDS0FHRV9SRU1PVkVEKTsKKyAgICAgICAgICAgIGZpbHRlci5hZGREYXRhU2NoZW1lKCJwYWNrYWdlIik7CisgICAgICAgICAgICBzUGFja2FnZUluc3RhbGxhdGlvblJlY2VpdmVyID0gbmV3IEJyb2FkY2FzdFJlY2VpdmVyKCkgeworCisgICAgICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgYWN0aW9uID0gaW50ZW50LmdldEFjdGlvbigpOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcGFja2FnZU5hbWUgPSBpbnRlbnQuZ2V0RGF0YSgpLmdldFNjaGVtZVNwZWNpZmljUGFydCgpOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlcGxhY2luZyA9IGludGVudC5nZXRCb29sZWFuRXh0cmEoSW50ZW50LkVYVFJBX1JFUExBQ0lORywgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBpZiAoSW50ZW50LkFDVElPTl9QQUNLQUdFX1JFTU9WRUQuZXF1YWxzKGFjdGlvbikgJiYgcmVwbGFjaW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiBpdCBpcyByZXBsYWNpbmcsIHJlZnJlc2hQbHVnaW5zKCkgd2hlbiBhZGRpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChzR29vZ2xlQXBwcy5jb250YWlucyhwYWNrYWdlTmFtZSkgJiYgbVdlYlZpZXdDb3JlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfQURERUQuZXF1YWxzKGFjdGlvbikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuQUREX1BBQ0tBR0VfTkFNRSwgcGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuUkVNT1ZFX1BBQ0tBR0VfTkFNRSwgcGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgUGx1Z2luTWFuYWdlciBwbSA9IFBsdWdpbk1hbmFnZXIuZ2V0SW5zdGFuY2UoY29udGV4dCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChwbS5jb250YWluc1BsdWdpblBlcm1pc3Npb25BbmRTaWduYXR1cmVzKHBhY2thZ2VOYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcG0ucmVmcmVzaFBsdWdpbnMoSW50ZW50LkFDVElPTl9QQUNLQUdFX0FEREVELmVxdWFscyhhY3Rpb24pKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGNvbnRleHQuZ2V0QXBwbGljYXRpb25Db250ZXh0KCkucmVnaXN0ZXJSZWNlaXZlcihzUGFja2FnZUluc3RhbGxhdGlvblJlY2VpdmVyLCBmaWx0ZXIpOworICAgICAgICB9CisKKyAgICAgICAgLy8gY2hlY2sgaWYgYW55IG9mIHRoZSBtb25pdG9yZWQgYXBwcyBhcmUgYWxyZWFkeSBpbnN0YWxsZWQKKyAgICAgICAgQXN5bmNUYXNrPFZvaWQsIFZvaWQsIFNldDxTdHJpbmc+PiB0YXNrID0gbmV3IEFzeW5jVGFzazxWb2lkLCBWb2lkLCBTZXQ8U3RyaW5nPj4oKSB7CisKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHJvdGVjdGVkIFNldDxTdHJpbmc+IGRvSW5CYWNrZ3JvdW5kKFZvaWQuLi4gdW51c2VkKSB7CisgICAgICAgICAgICAgICAgU2V0PFN0cmluZz4gaW5zdGFsbGVkUGFja2FnZXMgPSBuZXcgSGFzaFNldDxTdHJpbmc+KCk7CisgICAgICAgICAgICAgICAgUGFja2FnZU1hbmFnZXIgcG0gPSBtQ29udGV4dC5nZXRQYWNrYWdlTWFuYWdlcigpOworICAgICAgICAgICAgICAgIExpc3Q8UGFja2FnZUluZm8+IHBhY2thZ2VzID0gcG0uZ2V0SW5zdGFsbGVkUGFja2FnZXMoMCk7CisgICAgICAgICAgICAgICAgZm9yIChQYWNrYWdlSW5mbyBwIDogcGFja2FnZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNHb29nbGVBcHBzLmNvbnRhaW5zKHAucGFja2FnZU5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnN0YWxsZWRQYWNrYWdlcy5hZGQocC5wYWNrYWdlTmFtZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGluc3RhbGxlZFBhY2thZ2VzOworICAgICAgICAgICAgfQorCis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IGlmIChtU3VwcG9ydE11bHRpVG91Y2ggJiYgKG1TY2FsZURldGVjdG9yID09IG51bGwpKSB7Ci0gICAgICAgICAgICBtU2NhbGVEZXRlY3RvciA9IG5ldyBTY2FsZUdlc3R1cmVEZXRlY3Rvcihjb250ZXh0LAotICAgICAgICAgICAgICAgICAgICBuZXcgU2NhbGVEZXRlY3Rvckxpc3RlbmVyKCkpOwotICAgICAgICB9IGVsc2UgaWYgKCFtU3VwcG9ydE11bHRpVG91Y2ggJiYgKG1TY2FsZURldGVjdG9yICE9IG51bGwpKSB7Ci0gICAgICAgICAgICBtU2NhbGVEZXRlY3RvciA9IG51bGw7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQgdXBkYXRlWm9vbUJ1dHRvbnNFbmFibGVkKCkgewotICAgICAgICBpZiAobVpvb21CdXR0b25zQ29udHJvbGxlciA9PSBudWxsKSByZXR1cm47Ci0gICAgICAgIGJvb2xlYW4gY2FuWm9vbUluID0gbUFjdHVhbFNjYWxlIDwgbU1heFpvb21TY2FsZTsKLSAgICAgICAgYm9vbGVhbiBjYW5ab29tT3V0ID0gbUFjdHVhbFNjYWxlID4gbU1pblpvb21TY2FsZSAmJiAhbUluWm9vbU92ZXJ2aWV3OwotICAgICAgICBpZiAoIWNhblpvb21JbiAmJiAhY2FuWm9vbU91dCkgewotICAgICAgICAgICAgLy8gSGlkZSB0aGUgem9vbSBpbiBhbmQgb3V0IGJ1dHRvbnMsIGFzIHdlbGwgYXMgdGhlIGZpdCB0byBwYWdlCi0gICAgICAgICAgICAvLyBidXR0b24sIGlmIHRoZSBwYWdlIGNhbm5vdCB6b29tCi0gICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLmdldFpvb21Db250cm9scygpLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIFNldCBlYWNoIG9uZSBpbmRpdmlkdWFsbHksIGFz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XR1cm4gbVdlYlZpZXdDb3JlLmNvcHlDb250ZW50UGljdHVyZSgpOworICAgICAgICBpZiAobU5hdGl2ZUNsYXNzID09IDApIHJldHVybiBudWxsOworICAgICAgICBQaWN0dXJlIHJlc3VsdCA9IG5ldyBQaWN0dXJlKCk7CisgICAgICAgIG5hdGl2ZUNvcHlCYXNlQ29udGVudFRvUGljdHVyZShyZXN1bHQpOworICAgICAgICByZXR1cm4gcmVzdWx0OwogICAgIH0KIAogICAgIC8qKgpAQCAtMTkwOSwxNSArMTk5MiwxMyBAQAogCiAgICAgLyoqCiAgICAgICogUmVtb3ZlIHRoZSBXZWJUZXh0Vmlldy4KLSAgICAgKiBAcGFyYW0gZGlzYWJsZUZvY3VzQ29udHJvbGxlciBJZiB0cnVlLCBzZW5kIGEgbWVzc2FnZSB0byB3ZWJraXQKLSAgICAgKiAgICAgZGlzYWJsaW5nIHRoZSBmb2N1cyBjb250cm9sbGVyLCBzbyB0aGUgY2FyZXQgc3RvcHMgYmxpbmtpbmcuCiAgICAgICovCi0gICAgcHJpdmF0ZSB2b2lkIGNsZWFyVGV4dEVudHJ5KGJvb2xlYW4gZGlzYWJsZUZvY3VzQ29udHJvbGxlcikgeworICAgIHByaXZhdGUgdm9pZCBjbGVhclRleHRFbnRyeSgpIHsKICAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKSkgewogICAgICAgICAgICAgbVdlYlRleHRWaWV3LnJlbW92ZSgpOwotICAgICAgICAgICAgaWYgKGRpc2FibGVGb2N1c0NvbnRyb2xsZXIpIHsKLSAgICAgICAgICAgICAgICBzZXRGb2N1c0NvbnRyb2xsZXJJbmFjdGl2ZSgpOwotICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVGhlIGtleWJvYXJkIG1heSBiZSBvcGVuIHdpdGggdGhlIFdlYlZpZXcgYXMgdGhlIHNlcnZlZCB2aWV3CisgICAgICAgICAgICBoaWRlU29mdEtleWJvYXJkKCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTE5MjYsNyArMjAwNyw3IEBACiAgICAgICogQHJldHVybiBUaGUgY3VycmVudCBzY2FsZS4KICAgICAgKi8KICAgICBwdWJsaWMgZmxvYXQgZ2V0U2NhbGUoKSB7Ci0gICAgICAgIHJldHVybiBtQWN0dWFsU2NhbGU7CisgICAgICAgIHJldHVybiBtWm9vbU1hbmFnZXIuZ2V0U2NhbGUoKTsKICAgICB9CiAKICAgICAvKioKQEAgLTE5MzgsNyArMjAxOSw3IEBACiAgICAgICogQHBhcmFtIHNjYWxlSW5QZXJjZW50IFRoZSBpbml0aWFsIHNjYWxlIGluIHBlcmNlbnQuCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0SW5pdGlhbFNjYWxlKGludCBzY2FsZUluUGVyY2VudCkgewotICAgICAgICBtSW5pdGlhbFNjYWxlSW5QZXJjZW50ID0gc2NhbGVJblBlcmNlbnQ7CisgICAgICAgIG1ab29tTWFuYWdlci5zZXRJbml0aWFsU2NhbGVJblBlcmNlbnQoc2NhbGVJblBlcmNlbnQpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMTk1MSwxNCArMjAzMiw4IEBACiAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJUaGlzIFdlYlZpZXcgZG9lc24ndCBzdXBwb3J0IHpvb20uIik7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KLSAgICAgICAgY2xlYXJUZXh0RW50cnkoZmFsc2UpOwotICAgICAgICBpZiAoZ2V0U2V0dGluZ3MoKS5nZXRCdWlsdEluWm9vbUNvbnRyb2xzKCkpIHsKLSAgICAgICAgICAgIGdldFpvb21CdXR0b25zQ29udHJvbGxlcigpLnNldFZpc2libGUodHJ1ZSk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKLSAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5wb3N0RGVsYXllZChtWm9vbUNvbnRyb2xSdW5uYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgWk9PTV9DT05UUk9MU19USU1FT1VUKTsKLSAgICAgICAgfQorICAgICAgICBjbGVhckhlbHBlcnMoKTsKKyAgICAgICAgbVpvb21NYW5hZ2VyLmludm9rZVpvb21QaWNrZXIoKTsKICAgICB9CiAKICAgICAvKioKQEAgLTIwNzMsNyArMjE0OCw3IEBACiAgICAgICAgIG1zZy5zZW5kVG9UYXJnZXQoKTsKICAgICB9CiAKLSAgICBwcml2YXRlIHN0YXRpYyBpbnQgcGluTG9jKGludCB4LCBpbnQgdmlld01heCwgaW50IGRvY01heCkgeworICAgIHN0YXRpYyBpbnQgcGluTG9jKGludCB4LCBpbnQgdmlld01heCwgaW50IGRvY01heCkgewogLy8gICAgICAgIExvZy5kKExPR1RBRywgIi0tIHBpbkxvYyAiICsgeCArICIgIiArIHZpZXdNYXggKyAiICIgKyBkb2NNYXgpOwogICAgICAgICBpZiAoZG9jTWF4IDwgdmlld01heCkgeyAgIC8vIHRoZSBkb2MgaGFzIHJvb20gb24gdGhlIHNpZGVzIGZvciAiYmxhbmsiCiAgICAgICAgICAgICAvLyBwaW4gdGhlIHNob3J0IGRvY3VtZW50IHRvIHRoZSB0b3AvbGVmdCBvZiB0aGUgc2NyZWVuCkBAIC0yMDkwLDE2ICsyMTY1LDE0IEBACiAgICAgfQogCiAgICAgLy8gRXhwZWN0cyB4IGluIHZpZXcgY29vcmRpbmF0ZXMKLSAgICBwcml2YXRlIGludCBwaW5Mb2NYKGludCB4KSB7Ci0gICAgICAgIGlmIChtSW5PdmVyU2Nyb2xsTW9kZSkgcmV0dXJuIHg7Ci0gICAgICAgIHJldHVybiBwaW5Mb2MoeCwgZ2V0Vmlld1dpZHRoKCksIGNvbXB1dGVSZWFsSG9yaXpvbnRhbFNjcm9sbFJhbmdlKCkpOworICAgIGludCBwaW5Mb2NYKGludCB4KSB7Cisg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SBudWxsKSB7CisgICAgICAgICAgICAgICAgbUZpbmRDYWxsYmFjay5zZXRUaXRsZUJhcihudWxsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQogICAgICAgICBpZiAobVRpdGxlQmFyID09IHYpIHJldHVybjsKICAgICAgICAgaWYgKG1UaXRsZUJhciAhPSBudWxsKSB7CiAgICAgICAgICAgICByZW1vdmVWaWV3KG1UaXRsZUJhcik7CkBAIC0yMTQ3LDcgKzIyMzAsNyBAQAogICAgICAqIGhlaWdodC4KICAgICAgKi8KICAgICBwcml2YXRlIGludCB2aWV3VG9Db250ZW50RGltZW5zaW9uKGludCBkKSB7Ci0gICAgICAgIHJldHVybiBNYXRoLnJvdW5kKGQgKiBtSW52QWN0dWFsU2NhbGUpOworICAgICAgICByZXR1cm4gTWF0aC5yb3VuZChkICogbVpvb21NYW5hZ2VyLmdldEludlNjYWxlKCkpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMjE3Myw3ICsyMjU2LDcgQEAKICAgICAgKiBSZXR1cm5zIHRoZSByZXN1bHQgYXMgYSBmbG9hdC4KICAgICAgKi8KICAgICBwcml2YXRlIGZsb2F0IHZpZXdUb0NvbnRlbnRYZihpbnQgeCkgewotICAgICAgICByZXR1cm4geCAqIG1JbnZBY3R1YWxTY2FsZTsKKyAgICAgICAgcmV0dXJuIHggKiBtWm9vbU1hbmFnZXIuZ2V0SW52U2NhbGUoKTsKICAgICB9CiAKICAgICAvKioKQEAgLTIxODIsNyArMjI2NSw3IEBACiAgICAgICogZW1iZWRkZWQgaW50byB0aGUgV2ViVmlldy4gUmV0dXJucyB0aGUgcmVzdWx0IGFzIGEgZmxvYXQuCiAgICAgICovCiAgICAgcHJpdmF0ZSBmbG9hdCB2aWV3VG9Db250ZW50WWYoaW50IHkpIHsKLSAgICAgICAgcmV0dXJuICh5IC0gZ2V0VGl0bGVIZWlnaHQoKSkgKiBtSW52QWN0dWFsU2NhbGU7CisgICAgICAgIHJldHVybiAoeSAtIGdldFRp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AgICAgcHJpdmF0ZSB2b2lkIHZpZXdJbnZhbGlkYXRlRGVsYXllZChsb25nIGRlbGF5LCBpbnQgbCwgaW50IHQsIGludCByLCBpbnQgYikgewotICAgICAgICBmaW5hbCBmbG9hdCBzY2FsZSA9IG1BY3R1YWxTY2FsZTsKKyAgICAgICAgZmluYWwgZmxvYXQgc2NhbGUgPSBtWm9vbU1hbmFnZXIuZ2V0U2NhbGUoKTsKICAgICAgICAgZmluYWwgaW50IGR5ID0gZ2V0VGl0bGVIZWlnaHQoKTsKICAgICAgICAgcG9zdEludmFsaWRhdGVEZWxheWVkKGRlbGF5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludClNYXRoLmZsb29yKGwgKiBzY2FsZSksCkBAIC0yMjgyLDEzICsyMzY1LDcgQEAKICAgICAgICAgICAgIC8vIHVwZGF0ZWQgd2hlbiB3ZSBnZXQgb3V0IG9mIHRoYXQgbW9kZS4KICAgICAgICAgICAgIGlmICghbURyYXdIaXN0b3J5KSB7CiAgICAgICAgICAgICAgICAgLy8gcmVwaW4gb3VyIHNjcm9sbCwgdGFraW5nIGludG8gYWNjb3VudCB0aGUgbmV3IGNvbnRlbnQgc2l6ZQotICAgICAgICAgICAgICAgIGludCBvbGRYID0gbVNjcm9sbFg7Ci0gICAgICAgICAgICAgICAgaW50IG9sZFkgPSBtU2Nyb2xsWTsKLSAgICAgICAgICAgICAgICBtU2Nyb2xsWCA9IHBpbkxvY1gobVNjcm9sbFgpOwotICAgICAgICAgICAgICAgIG1TY3JvbGxZID0gcGluTG9jWShtU2Nyb2xsWSk7Ci0gICAgICAgICAgICAgICAgaWYgKG9sZFggIT0gbVNjcm9sbFggfHwgb2xkWSAhPSBtU2Nyb2xsWSkgewotICAgICAgICAgICAgICAgICAgICBvblNjcm9sbENoYW5nZWQobVNjcm9sbFgsIG1TY3JvbGxZLCBvbGRYLCBvbGRZKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdXBkYXRlU2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B0byBXZWJLaXQKLSAgICAgICAgICAgIG1MYXN0SGVpZ2h0U2VudCA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHNjYWxlICE9IG1BY3R1YWxTY2FsZSB8fCBmb3JjZSkgewotICAgICAgICAgICAgaWYgKG1EcmF3SGlzdG9yeSkgewotICAgICAgICAgICAgICAgIC8vIElmIGhpc3RvcnkgUGljdHVyZSBpcyBkcmF3biwgZG9uJ3QgdXBkYXRlIHNjcm9sbC4gVGhleSB3aWxsCi0gICAgICAgICAgICAgICAgLy8gYmUgdXBkYXRlZCB3aGVuIHdlIGdldCBvdXQgb2YgdGhhdCBtb2RlLgotICAgICAgICAgICAgICAgIGlmIChzY2FsZSAhPSBtQWN0dWFsU2NhbGUgJiYgIW1QcmV2aWV3Wm9vbU9ubHkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUNhbGxiYWNrUHJveHkub25TY2FsZUNoYW5nZWQobUFjdHVhbFNjYWxlLCBzY2FsZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1BY3R1YWxTY2FsZSA9IHNjYWxlOwotICAgICAgICAgICAgICAgIG1JbnZBY3R1YWxTY2FsZSA9IDEgLyBzY2FsZTsKLSAgICAgICAgICAgICAgICBzZW5kVmlld1NpemVab29tKCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSBvdXIgc2Nyb2xsIHNvIHdlIGRvbid0IGFwcGVhciB0byBqdW1wCi0gICAgICAgICAgICAgICAgLy8gaS5lLiBrZWVwIHRoZSBjZW50ZXIgb2YgdGhlIGRvYyBpbiB0aGUgY2VudGVyIG9mIHRoZSB2aWV3Ci0KLSAgICAgICAgICAgICAgICBpbnQgb2xkWCA9IG1TY3JvbGxYOwotICAgICAgICAgICAgICAgIGludCBvbGRZID0gbVNjcm9sbFk7Ci0gICAgICAgICAgICAgICAgZmxvYXQgcmF0aW8gPSBzY2FsZSAqIG1JbnZBY3R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HsKLSAgICAgICAgaWYgKG1QcmV2aWV3Wm9vbU9ubHkpIHJldHVybiBtTGFzdFZpc2libGVSZWN0U2VudDsKKyAgICBSZWN0IHNlbmRPdXJWaXNpYmxlUmVjdCgpIHsKKyAgICAgICAgaWYgKG1ab29tTWFuYWdlci5pc1ByZXZlbnRpbmdXZWJraXRVcGRhdGVzKCkpIHJldHVybiBtTGFzdFZpc2libGVSZWN0U2VudDsKIAogICAgICAgICBSZWN0IHJlY3QgPSBuZXcgUmVjdCgpOwogICAgICAgICBjYWxjT3VyQ29udGVudFZpc2libGVSZWN0KHJlY3QpOwpAQCAtMjM3OCw3ICsyMzkwLDcgQEAKICAgICAgICAgaWYgKCFyZWN0LmVxdWFscyhtTGFzdFZpc2libGVSZWN0U2VudCkpIHsKICAgICAgICAgICAgIFBvaW50IHBvcyA9IG5ldyBQb2ludChyZWN0LmxlZnQsIHJlY3QudG9wKTsKICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5TRVRfU0NST0xMX09GRlNFVCwKLSAgICAgICAgICAgICAgICAgICAgbmF0aXZlTW92ZUdlbmVyYXRpb24oKSwgMCwgcG9zKTsKKyAgICAgICAgICAgICAgICAgICAgbmF0aXZlTW92ZUdlbmVyYXRpb24oKSwgbVVzZXJTY3JvbGwgPyAxIDogMCwgcG9zKTsKICAgICAgICAgICAgIG1MYXN0VmlzaWJsZVJlY3RTZW50ID0gcmVjdDsKICAgICAgICAgfQogICAgICAgICBSZWN0IGdsb2JhbFJlY3QgPSBuZXcgUmVjdCgpOwpAQCAtMjQwMywxNSArMjQxNSwxMiBAQAogICAgICAgICBQb2ludCBwID0gbmV3IFBvaW50KCk7CiAgICAgICAgIGdldEdsb2JhbFZpc2libGVSZWN0KHIsIHApOwogICAgICAgICByLm9mZnNldCgtcC54LCAtcC55KTsKLSAgICAgICAgaWYgKG1GaW5kSXNVcCkgewotICAgICAgICAgICAgci5ib3R0b20gLT0gbUZpbmRI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VuIGl0IGlzIGF0IG1pbmltdW0gem9vbSBsZXZlbAorICAgICAgICAgICAgcmV0dXJuIGNvbXB1dGVWZXJ0aWNhbFNjcm9sbEV4dGVudCgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gdG8gYXZvaWQgcm91bmRpbmcgZXJyb3IgY2F1c2VkIHVubmVjZXNzYXJ5IHNjcm9sbGJhciwgdXNlIGZsb29yCisgICAgICAgICAgICByZXR1cm4gKGludCkgTWF0aC5mbG9vcihtQ29udGVudEhlaWdodCAqIG1ab29tTWFuYWdlci5nZXRTY2FsZSgpKTsKICAgICAgICAgfQotCi0gICAgICAgIHJldHVybiByYW5nZTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTI1NzAsNzMgKzI1NDgsMTAgQEAKICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXdWZXJ0aWNhbFNjcm9sbEJhcihDYW52YXMgY2FudmFzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERyYXdhYmxlIHNjcm9sbEJhciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbCwgaW50IHQsIGludCByLCBpbnQgYikgewotICAgICAgICBpZiAobVNjcm9sbFkgPCAwKSB7Ci0gICAgICAgICAgICB0IC09IG1TY3JvbGxZOwotICAgICAgICB9CiAgICAgICAgIHNjcm9sbEJhci5zZXRCb3VuZHMobCwgdCArIGdldFZpc2libGVUaXRsZUhlaWdodCgpLCByLCBiKTsKICAgICAgICAgc2Nyb2xsQmFyLmRyYXcoY2FudmFzKTsKICAgICB9CiAKLSAgICBAT3ZlcnJpZGUKLSAgICBwcm90ZWN0ZWQgdm9pZCBvbk92ZXJTY3JvbGxlZChpbnQgc2Nyb2xsWCwgaW50IHNjcm9sbFksIGJvb2xlYW4gY2xhbXBlZFgsCi0gICAgICAgICAgICBib29sZWFuIGNsYW1wZWRZKSB7Ci0gICAgICAgIG1Jbk92ZX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0gICAgICAgICAgICAvLyBBbHNvIGRvbid0IHNob3cgaWYgdGhlcmUgd2FzIHZlcnRpY2FsIG1vdmVtZW50LgotICAgICAgICAgICAgaWYgKG1heFggPiAwKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IHB1bGxlZFRvWCA9IG9sZFggKyBtT3ZlcnNjcm9sbERlbHRhWDsKLSAgICAgICAgICAgICAgICBpZiAocHVsbGVkVG9YIDwgMCkgewotICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dMZWZ0Lm9uUHVsbCgoZmxvYXQpIG1PdmVyc2Nyb2xsRGVsdGFYIC8gZ2V0V2lkdGgoKSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbUVkZ2VHbG93UmlnaHQuaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dSaWdodC5vblJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocHVsbGVkVG9YID4gbWF4WCkgewotICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dSaWdodC5vblB1bGwoKGZsb2F0KSBtT3ZlcnNjcm9sbERlbHRhWCAvIGdldFdpZHRoKCkpOwotICAgICAgICAgICAgICAgICAgICBpZiAoIW1FZGdlR2xvd0xlZnQuaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dMZWZ0Lm9uUmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1PdmVyc2Nyb2xsRGVsdGFYID0gMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1heFkgPiAwIHx8IGdldE92ZXJTY3JvbGxNb2RlKCkgPT0gT1ZFUl9TQ1JPTExfQUxXQVlTKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IHB1bGxlZFRvWSA9IG9sZFkgKyBtT3ZlcnNjcm9sbERlbHRhWTsKLSAgICAgICAgICAgICAgICBpZiAocHVsbGVkVG9ZIDwgMCkgewotICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dUb3Aub25QdWxsKChmbG9hdCkgbU92ZXJzY3JvbGxEZWx0YVkgLyBnZXRIZWlnaHQoKSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbUVkZ2VHbG93Qm90dG9tLmlzRmluaXNoZWQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93Qm90dG9tLm9uUmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdWxsZWRUb1kgPiBtYXhZKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1FZGdlR2xvd0JvdHRvbS5vblB1bGwoKGZsb2F0KSBtT3ZlcnNjcm9sbERlbHRhWSAvIGdldEhlaWdodCgpKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtRWRnZUdsb3dUb3AuaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dUb3Aub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbU92ZXJzY3JvbGxEZWx0YVkgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCiAgICAgLyoqCiAgICAgICogR2V0IHRoZSB1cmwgZm9yIHRoZSBjdXJyZW50IHBhZ2UuIFRoaXMgaXMgbm90IGFsd2F5cyB0aGUgc2FtZSBhcyB0aGUgdXJsCiAgICAgICogcGFzc2VkIHRvIFdlYlZpZXdDbGllbnQub25QYWdlU3RhcnRlZCBiZWNhdXNlIGFsdGhvdWdoIHRoZSBsb2FkIGZvcgpAQCAtMjY4Miw3ICsyNTk3LDkgQEAKICAgICB9CiAKICAgICAvKio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HRoZSBpbml0aWFsIHRleHQgdG8gc2VhcmNoIGZvci4KKyAgICAgKiAgICAgICAgICAgICBPdGhlcndpc2UsIHRoZSBsYXN0IFN0cmluZyBzZWFyY2hlZCBmb3IgaW4gdGhpcyBXZWJWaWV3IHdpbGwKKyAgICAgKiAgICAgICAgICAgICBiZSB1c2VkIHRvIHN0YXJ0LgogICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldEZpbmRJc1VwKGJvb2xlYW4gaXNVcCkgewotICAgICAgICBtRmluZElzVXAgPSBpc1VwOwotICAgICAgICBpZiAoaXNVcCkgewotICAgICAgICAgICAgcmVjb3JkTmV3Q29udGVudFNpemUobUNvbnRlbnRXaWR0aCwgbUNvbnRlbnRIZWlnaHQgKyBtRmluZEhlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgZmFsc2UpOworICAgIHB1YmxpYyB2b2lkIHNob3dGaW5kRGlhbG9nKFN0cmluZyB0ZXh0KSB7CisgICAgICAgIG1GaW5kQ2FsbGJhY2sgPSBuZXcgRmluZEFjdGlvbk1vZGVDYWxsYmFjayhtQ29udGV4dCk7CisgICAgICAgIHNldEZpbmRJc1VwKHRydWUpOworICAgICAgICBtRmluZENhbGxiYWNrLnNldFdlYlZpZXcodGhpcyk7CisgICAgICAgIFZpZXcgdGl0bGVCYXIgPSBtVGl0bGVCYXI7CisgICAgICAgIC8vIFdlIGRvIG5vdCB3YW50IHRvIHNob3cgdGhlIGVtYmVkZGVkIHRpdGxlIGJhciBkdXJpbmcgZmluZCBvcgorICAgICAgICAvLyBzZWxlY3QsIGJ1dCBrZWVwIHRyYWNrIG9mIGl0IHNvIHRoYXQgaXQgY2FuIGJlIHJlcGxhY2VkIHdoZW4gdGhlCisgICAgICAgIC8vIG1vZGUgaXMgZXhpdGVkLgorICAgICAgICBzZXRFbWJlZGRlZFRpdGxlQmFyKG51bGwpOworICAgICAgICBtRmluZENhbGxiYWNrLnNldFRpdGxlQmFyKHRpdGxlQmFyKTsKKyAgICAgICAgc3RhcnRBY3Rpb25Nb2RlKG1GaW5kQ2FsbGJhY2spOworICAgICAgICBpZiAodGV4dCA9PSBudWxsKSB7CisgICAgICAgICAgICB0ZXh0ID0gbUxhc3RGaW5kOwogICAgICAgICB9CisgICAgICAgIGlmICh0ZXh0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1GaW5kQ2FsbGJhY2suc2V0VGV4dCh0ZXh0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEtlZXAgdHJhY2sgb2YgdGhlIGZpbmQgY2FsbGJhY2sgc28gdGhhdCB3ZSBjYW4gcmVtb3ZlIGl0cyB0aXRsZWJhciBpZgorICAgICAqIG5lY2Vzc2FyeS4KKyAgICAgKi8KKyAgICBwcml2YXRlIEZpbmRBY3Rpb25Nb2RlQ2FsbGJhY2sgbUZpbmRDYWxsYmFjazsKKworICAgIC8qKgorICAgICAqIFRvZ2dsZSB3aGV0aGVyIHRoZSBmaW5kIGRpYWxvZyBpcyBzaG93aW5nLCBmb3IgYm90aCBuYXRpdmUgYW5kIEphdmEuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHNldEZpbmRJc1VwKGJvb2xlYW4gaXNVcCkgeworICAgICAgICBtRmluZElzVXAgPSBpc1VwOwogICAgICAgICBpZiAoMCA9PSBtTmF0aXZlQ2xhc3MpIHJldHVybjsgLy8gY2xpZW50IGlzbid0IGluaXRpYWxpemVkCiAgICAgICAgIG5hdGl2ZVNldEZpbmRJc1VwKGlzVXApOwogICAgIH0KIAogICAgIC8qKgotICAgICAqIEBoaWRlCisgICAgICogUmV0dXJuIHRoZSBpbmRleCBvZiB0aGUgY3VycmVudGx5IGhpZ2hsaWdodGVkIG1hdGNoLgogICAgICAqLwotICAgIHB1YmxpYyBpbnQgZmluZEluZGV4KCkgeworICAgIGludCBmaW5kSW5kZXgoKSB7CiAgICAgICAgIGlmICgwID09IG1OYXRpdmVDbGFzcykgcmV0dXJuIC0xOwogICAgICAgICByZXR1cm4g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HVibGljIHZvaWQgbm90aWZ5RmluZERpYWxvZ0Rpc21pc3NlZCgpIHsKKyAgICB2b2lkIG5vdGlmeUZpbmREaWFsb2dEaXNtaXNzZWQoKSB7CisgICAgICAgIG1GaW5kQ2FsbGJhY2sgPSBudWxsOwogICAgICAgICBpZiAobVdlYlZpZXdDb3JlID09IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogICAgICAgICBjbGVhck1hdGNoZXMoKTsKICAgICAgICAgc2V0RmluZElzVXAoZmFsc2UpOwotICAgICAgICByZWNvcmROZXdDb250ZW50U2l6ZShtQ29udGVudFdpZHRoLCBtQ29udGVudEhlaWdodCAtIG1GaW5kSGVpZ2h0LAotICAgICAgICAgICAgICAgIGZhbHNlKTsKICAgICAgICAgLy8gTm93IHRoYXQgdGhlIGRpYWxvZyBoYXMgYmVlbiByZW1vdmVkLCBlbnN1cmUgdGhhdCB3ZSBzY3JvbGwgdG8gYQogICAgICAgICAvLyBsb2NhdGlvbiB0aGF0IGlzIG5vdCBiZXlvbmQgdGhlIGVuZCBvZiB0aGUgcGFnZS4KICAgICAgICAgcGluU2Nyb2xsVG8obVNjcm9sbFgsIG1TY3JvbGxZLCBmYWxzZSwgMCk7CkBAIC0yOTYzLDE2ICsyOTA0LDYgQEAKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldEZpbmREaWFsb2dIZWlnaHQoaW50IGhlaWdodCkgewotICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewotICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAic2V0RmluZERpYWxvZ0hlaWdodCBoZWlnaHQ9IiArIGhlaWdodCk7Ci0gICAgICAgIH0KLSAgICAgICAgbUZpbmRIZWlnaHQgPSBoZWlnaHQ7Ci0gICAgfQotCi0gICAgLyoqCiAgICAgICogUXVlcnkgdGhlIGRvY3VtZW50IHRvIHNlZSBpZiBpdCBjb250YW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LSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcmFuZ2VYID0gY29tcHV0ZU1heFNjcm9sbFgoKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcmFuZ2VZID0gY29tcHV0ZU1heFNjcm9sbFkoKTsKLSAgICAgICAgICAgICAgICBvdmVyU2Nyb2xsQnkoeCAtIG9sZFgsIHkgLSBvbGRZLCBvbGRYLCBvbGRZLAotICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2VYLCByYW5nZVksCi0gICAgICAgICAgICAgICAgICAgICAgICBtT3ZlcmZsaW5nRGlzdGFuY2UsIG1PdmVyZmxpbmdEaXN0YW5jZSwgZmFsc2UpOwotCi0gICAgICAgICAgICAgICAgaWYgKG1FZGdlR2xvd1RvcCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChyYW5nZVkgPiAwIHx8IGdldE92ZXJTY3JvbGxNb2RlKCkgPT0gT1ZFUl9TQ1JPTExfQUxXQVlTKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoeSA8IDAgJiYgb2xkWSA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93VG9wLm9uQWJzb3JiKChpbnQpIG1TY3JvbGxlci5nZXRDdXJyVmVsb2NpdHkoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtRWRnZUdsb3dCb3R0b20uaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1FZGdlR2xvd0JvdHRvbS5vblJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHkgPiByYW5nZVkgJiYgb2xkWSA8PSByYW5nZVkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dCb3R0b20ub25BYnNvcmIoKGludCkgbVNjcm9sbGVyLmdldEN1cnJWZWxvY2l0eSgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1FZGdlR2xvd1RvcC5pc0ZpbmlzaGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93VG9wLm9uUmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmIChyYW5nZVggPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoeCA8IDAgJiYgb2xkWCA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93TGVmdC5vbkFic29yYigoaW50KSBtU2Nyb2xsZXIuZ2V0Q3VyclZlbG9jaXR5KCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbUVkZ2VHbG93UmlnaHQuaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1FZGdlR2xvd1JpZ2h0Lm9uUmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoeCA+IHJhbmdlWCAmJiBvbGRYIDw9IHJhbmdlWCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1FZGdlR2xvd1JpZ2h0Lm9uQWJzb3JiKChpbnQpIG1TY3JvbGxlci5nZXRDdXJyVmVsb2NpdHkoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtRWRnZUdsb3dMZWZ0LmlzRmluaXNoZWQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dMZWZ0Lm9uUmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtU2Nyb2xsZXIuaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2UoUkVTVU1FX1dFQkNPUkVfUFJJT1JJVFkpOworICAgICAgICAgICAgbVNjcm9sbFggPSBtU2Nyb2xsZXIuZ2V0Q3VyclgoKTsKKyAgICAgICAgICAgIG1TY3JvbGxZID0gbVNjcm9sbGVyLmdldEN1cnJZKCk7CisgICAgICAgICAgICBwb3N0SW52YWxpZGF0ZSgpOyAgLy8gU28gd2UgZHJhdyBhZ2FpbgorICAgICAgICAgICAgaWYgKG9sZFggIT0gbVNjcm9sbFggfHwgb2xkWSAhPSBtU2Nyb2xsWSkgeworICAgICAgICAgICAgICAgIG9uU2Nyb2xsQ2hhbmdlZChtU2Nyb2xsWCwgbVNjcm9sbFksIG9sZFgsIG9sZFkpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBhYm9ydEFuaW1hdGlvbigpOworICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhSRVNVTUVfV0VCQ09SRV9QUklPUklUWSk7CisgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUucmVzdW1lUHJpb3JpdHkoKTsKKyAgICAgICAgICAgICAgICBXZWJWaWV3Q29yZS5yZXN1bWVVcGRhdGVQaWN0dXJlKG1XZWJWaWV3Q29yZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICBzdXBlci5jb21wdXRlU2Nyb2xsKCk7CkBAIC0zMTA2LDYgKzMwMTQsMjMgQEAKICAgICB9CiAKICAgICAvKioKKyAgICAgKiBDYWxsZWQgYnkgQ2FsbGJhY2tQ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hbnNsYXRlKDAsIChpbnQpIG1UaXRsZUJhci5nZXRIZWlnaHQoKSk7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKG1EcmFnVHJhY2tlckhhbmRsZXIgPT0gbnVsbCkgewotICAgICAgICAgICAgZHJhd0NvbnRlbnQoY2FudmFzKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGlmICghbURyYWdUcmFja2VySGFuZGxlci5kcmF3KGNhbnZhcykpIHsKLSAgICAgICAgICAgICAgICAvLyBzb21ldGltZXMgdGhlIHRyYWNrZXIgZG9lc24ndCBkcmF3LCBldmVuIHRob3VnaCBpdHMgYWN0aXZlCi0gICAgICAgICAgICAgICAgZHJhd0NvbnRlbnQoY2FudmFzKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtRHJhZ1RyYWNrZXJIYW5kbGVyLmlzRmluaXNoZWQoKSkgewotICAgICAgICAgICAgICAgIG1EcmFnVHJhY2tlckhhbmRsZXIgPSBudWxsOwotICAgICAgICAgICAgfQotICAgICAgICB9CisgICAgICAgIGRyYXdDb250ZW50KGNhbnZhcyk7CiAgICAgICAgIGNhbnZhcy5yZXN0b3JlVG9Db3VudChzYXZlQ291bnQpOwogCiAgICAgICAgIC8vIE5vdyBkcmF3IHRoZSBzaGFkb3cuCkBAIC0zNTM1LDcgKzM0NzQsNiBAQAogICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsWSArIGhlaWdodCk7CiAgICAgICAgICAgICBtVGl0bGVTaGFkb3cuZHJhdyhjYW52YXMpOwogICAgICAgICB9Ci0KICAgICAgICAgaWYgKEFVVE9fUkVEUkFXX0hBQ0sgJiYgbUF1dG9SZWRyYXcpIHsKICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKICAgICAgICAgfQpAQCAtMzU0Myw2NiArMzQ4MSw0NSBAQAogICAgICAgICAgICAgbVdlYlRleHRWaWV3Lm9uRHJhd1N1YnN0aXR1dGUoKTsKICAgICAgICAgfQogICAgICAgICBtV2ViVmlld0NvcmUuc2lnbmFsUmVwYWludERvbmUoKTsKLSAgICB9CiAKLSAgICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgdm9pZCBkcmF3KENhbnZhcyBjYW52YXMpIHsKLSAgICAgICAgc3VwZXIuZHJhdyhjYW52YXMpOwotICAgICAgICBpZiAobUVkZ2VHbG93VG9wICE9IG51bGwgJiYgZHJhd0VkZ2VHbG93cyhjYW52YXMpKSB7Ci0gICAgICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgICAgIC8vIHBhaW50IHRoZSBoaWdobGlnaHQgaW4gdGhlIGVuZAorICAgICAgICBpZiAoIW1Ub3VjaEhpZ2hsaWdodFJlZ2lvbi5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgIGlmIChtVG91Y2hIaWdodGxpZ2h0UGFpbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2h0bGlnaHRQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2h0bGlnaHRQYWludC5zZXRDb2xvcihtSGlnaHRsaWdodENvbG9yKTsKKyAgICAgICAgICAgICAgICBtVG91Y2hIaWdodGxpZ2h0UGFpbnQuc2V0QW50aUFsaWFzKHRydWUpOworICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2h0bGlnaHRQYWludC5zZXRQYXRoRWZmZWN0KG5ldyBDb3JuZXJQYXRoRWZmZWN0KAorICAgICAgICAgICAgICAgICAgICAgICAgVE9VQ0hfSElHSExJR0hUX0FSQykpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FudmFzLmRyYXdQYXRoKG1Ub3VjaEhpZ2hsaWdodFJlZ2lvbi5nZXRCb3VuZGFyeVBhdGgoKSwKKyAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaHRsaWdodFBhaW50KTsKKyAgICAgICAgfQorICAgICAgICBpZiAoREVCVUdfVE9VQ0hfSElHSExJR0hUKSB7CisgICAgICAgICAgICBpZiAoZ2V0U2V0dGluZ3MoKS5nZXROYXZEdW1wKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoKG1Ub3VjaEhpZ2hsaWdodFggfCBtVG91Y2hIaWdobGlnaHRZKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtVG91Y2hDcm9zc0hhaXJDb2xvciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hDcm9zc0hhaXJDb2xvciA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoQ3Jvc3NIYWlyQ29sb3Iuc2V0Q29sb3IoQ29sb3IuUkVEKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd0xpbmUobVRvdWNoSGlnaGxpZ2h0WCAtIG1OYXZTbG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFkgLSBtTmF2U2xvcCwgbVRvdWNoSGlnaGxpZ2h0WAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtTmF2U2xvcCArIDEsIG1Ub3VjaEhpZ2hsaWdodFkgKyBtTmF2U2xvcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAxLCBtVG91Y2hDcm9zc0hhaXJDb2xvcik7CisgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3TGluZShtVG91Y2hIaWdobGlnaHRYICsgbU5hdlNsb3AgKyAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFkgLSBtTmF2U2xvcCwgbVRvdWNoSGlnaGxpZ2h0WAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtTmF2U2xvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hIaWdobGlnaHRZICsgbU5hdlNsb3AgKyAxLAorICAgICAgICAgICAg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vY3VzQ2FuZGlkYXRlSXNQYXNzd29yZCgpKSB7CisgICAgICAgICAgICAvLyBJZiBpdCBpcyBhIHBhc3N3b3JkIGZpZWxkLCBzdGFydCBkcmF3aW5nIHRoZSBXZWJUZXh0VmlldyBvbmNlCisgICAgICAgICAgICAvLyBhZ2Fpbi4KKyAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRJblBhc3N3b3JkKHRydWUpOworICAgICAgICB9CisgICAgfQorCisgICAgdm9pZCBvbkZpeGVkTGVuZ3RoWm9vbUFuaW1hdGlvblN0YXJ0KCkgeworICAgICAgICBXZWJWaWV3Q29yZS5wYXVzZVVwZGF0ZVBpY3R1cmUoZ2V0V2ViVmlld0NvcmUoKSk7CisgICAgICAgIG9uWm9vbUFuaW1hdGlvblN0YXJ0KCk7CisgICAgfQorCisgICAgdm9pZCBvbkZpeGVkTGVuZ3RoWm9vbUFuaW1hdGlvbkVuZCgpIHsKKyAgICAgICAgV2ViVmlld0NvcmUucmVzdW1lVXBkYXRlUGljdHVyZShtV2ViVmlld0NvcmUpOworICAgICAgICBvblpvb21BbmltYXRpb25FbmQoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgWk9PTV9CSVRTID0gUGFpbnQuRklMVEVSX0JJVE1BUF9GTEFHIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFpbnQuRElUSEVSX0ZMQUcgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWludC5TVUJQSVhFTF9URVhUX0ZMQUc7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFNDUk9MTF9CSVRTID0gUGFpbnQuRklMVEVSX0JJVE1BUF9GTEFHIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWludC5ESVRIRVJfRkxBRzsKKworICAgIHByaXZhdGUgZmluYWwgRHJhd0ZpbHRlciBtWm9vbUZpbHRlciA9CisgICAgICAgICAgICBuZXcgUGFpbnRGbGFnc0RyYXdGaWx0ZXIoWk9PTV9CSVRTLCBQYWludC5MSU5FQVJfVEVYVF9GTEFHKTsKKyAgICAvLyBJZiB3ZSBuZWVkIHRvIHRyYWRlIGJldHRlciBxdWFsaXR5IGZvciBzcGVlZCwgc2V0IG1TY3JvbGxGaWx0ZXIgdG8gbnVsbAorICAgIHByaXZhdGUgZmluYWwgRHJhd0ZpbHRlciBtU2Nyb2xsRmlsdGVyID0KKyAgICAgICAgICAgIG5ldyBQYWludEZsYWdzRHJhd0ZpbHRlcihTQ1JPTExfQklUUywgMCk7CisKICAgICBwcml2YXRlIHZvaWQgZHJhd0NvcmVBbmRDdXJzb3JSaW5nKENhbnZhcyBjYW52YXMsIGludCBjb2xvciwKICAgICAgICAgYm9vbGVhbiBkcmF3Q3Vyc29yUmluZykgewogICAgICAgICBpZiAobURyYXdIaXN0b3J5KSB7Ci0gICAgICAgICAgICBjYW52YXMuc2NhbGUobUFjdHVhbFNjYWxlLCBtQWN0dWFsU2NhbGUpOworICAgICAgICAgICAgY2FudmFzLnNjYWxlKG1ab29tTWFuYWdlci5nZXRTY2FsZSgpLCBtWm9vbU1hbmFnZXIuZ2V0U2NhbGUoKSk7CiAgICAgICAgICAgICBjYW52YXMuZHJhd1BpY3R1cmUobUhpc3RvcnlQaWN0dXJlKTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQorICAgICAgICBpZiAobU5hdGl2ZUNsYXNzID09IDApIHJldHVybjsKIAotICAgICAgICBib29sZWFuIGFuaW1hdGVab29tID0gbVpvb21TY2FsZSAhPSAwOworICAgICAgICBib29sZWFuIGFuaW1hdGVab29tID0gbVpvb21NYW5hZ2VyLmlzRml4ZWRMZW5ndGhBbmltYXRpb25JblByb2dyZXNzKCk7CiAgICAgICAgIGJvb2xlYW4gYW5pbWF0ZVNjcm9sbCA9ICgoIW1TY3JvbGxlci5pc0ZpbmlzaGVkKCkKICAgICAgICAgICAgICAgICB8fCBtVmVsb2NpdHlUcmFja2VyICE9IG51bGwpCiAgICAgICAgICAgICAgICAgJiYgKG1Ub3VjaE1vZGUgIT0gVE9VQ0hfRFJBR19NT0RFIHx8CkBAIC0zNzMwLDU5ICszNjg2LDkgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBpZiAoYW5pbWF0ZVpvb20pIHsKLSAgICAgICAgICAgIGZsb2F0IHpvb21TY2FsZTsKLSAgICAgICAgICAgIGludCBpbnRlcnZhbCA9IChpbnQpIChTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSAtIG1ab29tU3RhcnQpOwotICAgICAgICAgICAgaWYgKGludGVydmFsIDwgWk9PTV9BTklNQVRJT05fTEVOR1RIKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgcmF0aW8gPSAoZmxvYXQpIGludGVydmFsIC8gWk9PTV9BTklNQVRJT05fTEVOR1RIOwotICAgICAgICAgICAgICAgIHpvb21TY2FsZSA9IDEuMGYgLyAobUludkluaXRpYWxab29tU2NhbGUKLSAgICAgICAgICAgICAgICAgICAgICAgICsgKG1JbnZGaW5hbFpvb21TY2FsZSAtIG1JbnZJbml0aWFsWm9vbVNjYWxlKSAqIHJhdGlvKTsKLSAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHpvb21TY2FsZSA9IG1ab29tU2NhbGU7Ci0gICAgICAgICAgICAgICAgLy8gc2V0IG1ab29tU2NhbGUgdG8gYmUgMCBhcyB3ZSBoYXZlIGRvbmUgYW5pbWF0aW9uCi0gICAgICAgICAgICAgICAgbVpvb21TY2FsZSA9IDA7Ci0gICAgICAgICAgICAgICAgV2ViVmlld0NvcmUucmVzdW1lVXBkYXRlUGljdHVyZShtV2ViVmlld0NvcmUpOwotICAgICAgICAgICAgICAgIC8vIGNhbGwgaW52YWxpZGF0ZSgpIGFnYWluIHRvIGRyYXcgd2l0aCB0aGUgZmluYWwgZmlsdGVycwotICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICBpZiAobU5lZWRUb0FkanVzdFdlYlRleHRWaWV3KSB7Ci0gICAgICAgICAgICAgICAgICAgIG1OZWVkVG9BZGp1c3RXZWJUZXh0VmlldyA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBpZiAoZGlkVXBkYXRlVGV4dFZpZXdCb3VuZHMoZmFsc2UpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbmF0aXZlRm9jdXNDYW5kaWRhdGVJc1Bhc3N3b3JkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIGl0IGlzIGEgcGFzc3dvcmQgZmllbGQsIHN0YXJ0IGRyYXdpbmcgdGhlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZWJUZXh0VmlldyBvbmNlIGFnYWluLgotICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldEluUGFzc3dvcmQodHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBjYWxjdWxhdGUgdGhlIGludGVybWVkaWF0ZSBzY3JvbGwgcG9zaXRpb24uIEFzIHdlIG5lZWQgdG8gdXNlCi0gICAgICAgICAgICAvLyB6b29tU2NhbGUsIHdlIGNhbid0IHVzZSBwaW5Mb2NYL1kgZGlyZWN0bHkuIENvcHkgdGhlIGxvZ2ljIGhlcmUuCi0gICAgICAgICAgICBmbG9hdCBzY2FsZSA9IHpvb21TY2FsZSAqIG1JbnZJbml0aWFsWm9vbVNjYWxlOwotICAgICAgICAgICAgaW50IHR4ID0gTWF0aC5yb3VuZChzY2FsZSAqIChtSW5pdGlhbFNjcm9sbFggKyBtWm9vbUNlbnRlclgpCi0gICAgICAgICAgICAgICAgICAgIC0gbVpvb21DZW50ZXJYKTsKLSAgICAgICAgICAgIHR4ID0gLXBpbkxvYyh0eCwgZ2V0Vmlld1dpZHRoKCksIE1hdGgucm91bmQobUNvbnRlbnRXaWR0aAotICAgICAgICAgICAgICAgICAgICAqIHpvb21TY2FsZSkpICsgbVNjcm9sbFg7Ci0gICAgICAgICAgICBpbnQgdGl0bGVIZWlnaHQgPSBnZXRUaXRsZUhlaWdodCgpOwotICAgICAgICAgICAgaW50IHR5ID0gTWF0aC5yb3VuZChzY2FsZQotICAgICAgICAgICAgICAgICAgICAqIChtSW5pdGlhbFNjcm9sbFkgKyBtWm9vbUNlbnRlclkgLSB0aXRsZUhlaWdodCkKLSAgICAgICAgICAgICAgICAgICAgLSAobVpvb21DZW50ZXJZIC0gdGl0bGVIZWlnaHQpKTsKLSAgICAgICAgICAgIHR5ID0gLSh0eSA8PSB0aXRsZUhlaWdodCA/IE1hdGgubWF4KHR5LCAwKSA6IHBpbkxvYyh0eQotICAgICAgICAgICAgICAgICAgICAtIHRpdGxlSGVpZ2h0LCBnZXRWaWV3SGVpZ2h0KCksIE1hdGgucm91bmQobUNvbnRlbnRIZWlnaHQKLSAgICAgICAgICAgICAgICAgICAgKiB6b29tU2NhbGUpKSArIHRpdGxlSGVpZ2h0KSArIG1TY3JvbGxZOwotICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSh0eCwgdHkpOwotICAgICAgICAgICAgY2FudmFzLnNjYWxlKHpvb21TY2FsZSwgem9vbVNjYWxlKTsKLSAgICAgICAgICAgIGlmIChpbkVkaXRpbmdNb2RlKCkgJiYgIW1OZWVkVG9BZGp1c3RXZWJUZXh0VmlldwotICAgICAgICAgICAgICAgICAgICAmJiBtWm9vbVNjYWxlICE9IDApIHsKLSAgICAgICAgICAgICAgICAvLyBUaGUgV2ViVGV4dFZpZXcgaXMgdXAuICBLZWVwIHRyYWNrIG9mIHRoaXMgc28gd2UgY2FuIGFkanVzdAotICAgICAgICAgICAgICAgIC8vIGl0cyBzaXplIGFuZCBwbGFjZW1lbnQgd2hlbiB3ZSBmaW5pc2ggem9vbWluZwotICAgICAgICAgICAgICAgIG1OZWVkVG9BZGp1c3RXZWJUZXh0VmlldyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgLy8gSWYgaXQgaXMgaW4gcGFzc3dvcmQgbW9kZSwgdHVybiBpdCBvZmYgc28gaXQgZG9lcyBub3QgZHJhdwotICAgICAgICAgICAgICAgIC8vIG1pc3BsYWNlZC4KLSAgICAgICAgICAgICAgICBpZiAobmF0aXZlRm9jdXNDYW5kaWRhdGVJc1Bhc3N3b3JkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldEluUGFzc3dvcmQoZmFsc2UpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1ab29tTWFuYWdlci5hbmltYXRlWm9vbShjYW52YXMpOwogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgY2FudmFzLnNjYWxlKG1BY3R1YWxTY2FsZSwgbUFjdHVhbFNjYWxlKTsKKyAgICAgICAgICAgIGNhbnZhcy5zY2FsZShtWm9vbU1hbmFnZXIuZ2V0U2NhbGUoKSwgbVpvb21NYW5hZ2VyLmdldFNjYWxlKCkpOwogICAgICAgICB9CiAKICAgICAgICAgYm9vbGVhbiBVSUFuaW1hdGlvbnNSdW5uaW5nID0gZmFsc2U7CkBAIC0zNzk0LDIzICszNzAwLDU2IEBACiAgICAgICAgICAgICAvLyB3ZSBhc2sgZm9yIGEgcmVwYWludC4KICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKICAgICAgICAgfQotICAgICAgICBtV2ViVmlld0NvcmUuZHJhd0NvbnRlbnRQaWN0dXJlKGNhbnZhcywgY29sb3IsCi0gICAgICAgICAgICAgICAgKGFuaW1hdGVab29tIHx8IG1QcmV2aWV3Wm9vbU9ubHkgfHwgVUlBbmltYXRpb25zUnVubmluZyksCi0gICAgICAgICAgICAgICAgYW5pbWF0ZVNjcm9sbCk7Ci0gICAgICAgIGlmIChtTmF0aXZlQ2xhc3MgPT0gMCkgcmV0dXJuOworCiAgICAgICAgIC8vIGRlY2lkZSB3aGljaCBhZG9ybm1lbnRzIHRvIGRyYXcKICAgICAgICAgaW50IGV4dHJhcyA9IERSQVdfRVhUUkFTX05PTkU7CisgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJtRmluZElzVXA9IiArIG1GaW5kSXNVcAorICAgICAgICAgICAgICAgICAgICArICIgbVNlbGVjdGluZ1RleHQ9IiArIG1TZWxlY3RpbmdUZXh0CisgICAgICAgICAgICAgICAgICAgICsgIiBuYXRpdmVQYWdlU2hvdWxkSGFuZGxlU2hpZnRBbmRBcnJvd3MoKT0iCisgICAgICAgICAgICAgICAgICAgICsgbmF0aXZlUGFnZVNob3VsZEhhbmRsZVNoaWZ0QW5kQXJyb3dzKCkKKyAgICAgICAgICAgICAgICAgICAgKyAiIGFuaW1hdGVab29tPSIgKyBhbmltYXRlWm9vbSk7CisgICAgICAgIH0KICAgICAgICAgaWYgKG1GaW5kSXNVcCkgewotICAgICAgICAgICAgICAgIGV4dHJhcyA9IERSQVdfRVhUUkFTX0ZJTkQ7CisgICAgICAgICAgICBleHRyYXMgPSBEUkFXX0VYVFJBU19GSU5EOwogICAgICAgICB9IGVsc2UgaWYgKG1TZWxlY3RpbmdUZXh0KSB7CiAgICAgICAgICAgICBleHRyYXMgPSBEUkFXX0VYVFJBU19TRUxFQ1RJT047CiAgICAgICAgICAgICBuYXRpdmVTZXRTZWxlY3Rpb25Qb2ludGVyKG1EcmF3U2VsZWN0aW9uUG9pbnRlciwKLSAgICAgICAgICAgICAgICAgICAgbUludkFjdHVhbFNjYWxlLAorICAgICAgICAgICAgICAgICAgICBtWm9vbU1hbmFnZXIuZ2V0SW52U2NhbGUoKSwKICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdFgsIG1TZWxlY3RZIC0gZ2V0VGl0bGVIZWlnaHQoKSk7CiAgICAgICAgIH0gZWxzZSBpZiAoZHJhd0N1cnNvclJpbmcpIHsKICAgICAgICAgICAgIGV4dHJhcyA9IERSQVdfRVhUUkFTX0NVUlNPUl9SSU5HOwogICAgICAgICB9Ci0gICAgICAgIGRyYXdFeHRyYXMoY2FudmFzLCBleHRyYXMsIFVJQW5pbWF0aW9uc1J1bm5pbmcpOworCisgICAgICAgIGlmIChjYW52YXMuaXNIYXJkd2FyZUFjY2VsZXJhdGVkKCkpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgaWYgKGNhbnZhcy5hY3F1aXJlQ29udGV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgUmVjdCByZWN0ID0gbmV3IFJlY3QobUdMUmVjdFZpZXdwb3J0LmxlZnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUdMUmVjdFZpZXdwb3J0LnRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtR0xSZWN0Vmlld3BvcnQucmlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUdMUmVjdFZpZXdwb3J0LmJvdHRvbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gZ2V0VmlzaWJsZVRpdGxlSGVpZ2h0KCkpOworICAgICAgICAgICAgICAgICAgICAgIGlmIChuYXRpdmVEcmF3R0wocmVjdCwgZ2V0U2NhbGUoKSwgZXh0cmFzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgY2FudmFzLnJlbGVhc2VDb250ZXh0KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBEcmF3RmlsdGVyIGRmID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChtWm9vbU1hbmFnZXIuaXNab29tQW5pbWF0aW5nKCkgfHwgVUlBbmltYXRpb25zUnVubmluZykgeworICAgICAgICAgICAgICAgIGRmID0gbVpvb21GaWx0ZXI7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFuaW1hdGVTY3JvbGwpIHsKKyAgICAgICAgICAgICAgICBkZiA9IG1TY3JvbGxGaWx0ZXI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYW52YXMuc2V0RHJhd0ZpbHRlcihkZik7CisgICAgICAgICAgICBpbnQgY29udGVudCA9IG5hdGl2ZURyYXcoY2FudmFzLCBjb2xvciwgZXh0cmFzLCB0cnVlKTsKKyAgICAgICAgICAgIGNhbnZhcy5zZXREcmF3RmlsdGVyKG51bGwpOworICAgICAgICAgICAgaWYgKGNvbnRlbnQgIT0gMCkgeworICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5TUExJVF9QSUNUVVJFX1NFVCwgY29udGVudCwgMCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KIAogICAgICAgICBpZiAoZXh0cmFzID09IERSQVdfRVhUUkFTX0NVUlNPUl9SSU5HKSB7CiAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9TSE9SVFBSRVNTX1NUQVJUX01PREUpIHsKQEAgLTM4MzksMTAgKzM3NzgsMTQgQEAKICAgICAgICAgcmV0dXJuIG1EcmF3SGlzdG9yeTsKICAgICB9CiAKKyAgICBpbnQgZ2V0SGlzdG9yeVBpY3R1cmVXaWR0aCgpIHsKKyAgICAgICAgcmV0dXJuIChtSGlzdG9yeVBpY3R1cmUgIT0gbnVsbCkgPyBtSGlzdG9yeVBpY3R1cmUuZ2V0V2lkdGgoKSA6IDA7CisgICAgfQorCiAgICAgLy8gU2hvdWxkIG9ubHkgYmUgY2FsbGVkIGluIFVJIHRocmVhZAogICA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sOCArNDE4NSw4IEBACiAgICAgICAgIGlmIChrZXlDb2RlID49IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUAogICAgICAgICAgICAgICAgICYmIGtleUNvZGUgPD0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUKSB7CiAgICAgICAgICAgICBzd2l0Y2hPdXREcmF3SGlzdG9yeSgpOwotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgewotICAgICAgICAgICAgICAgIGxldFBsdWdpbkhhbmRsZU5hdktleShrZXlDb2RlLCBldmVudC5nZXRFdmVudFRpbWUoKSwgdHJ1ZSk7CisgICAgICAgICAgICBpZiAocGFnZVNob3VsZEhhbmRsZVNoaWZ0QW5kQXJyb3dzKCkpIHsKKyAgICAgICAgICAgICAgICBsZXRQYWdlSGFuZGxlTmF2S2V5KGtleUNvZGUsIGV2ZW50LmdldEV2ZW50VGltZSgpLCB0cnVlKTsKICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgewpAQCAtNDMxOSwxMyArNDMxMCwxNiBAQAogICAgICAgICAvLyBCdWJibGUgdXAgdGhlIGtleSBldmVudCBpZgogICAgICAgICAvLyAxLiBpdCBpcyBhIHN5c3RlbSBrZXk7IG9yCiAgICAgICAgIC8vIDIuIHRoZSBob3N0IGFwcGxpY2F0aW9uIHdhbnRzIHRvIGhhbmRsZSBpdDsKLSAgICAgICAgaWYgKGV2ZW50LmlzU3lzdGVtKCkgfHwgbUNhbGxiYWNrUHJveHkudWlPdmVycmlkZUtleUV2ZW50KGV2ZW50KSkgeworICAgICAgICAvLyAzLiB0aGUgYWNjZXNzaWJpbGl0eSBpbmplY3RvciBpcyBwcmVzZW50IGFuZCB3YW50cyB0byBoYW5kbGUgaXQ7CisgICAgICAgIGlmIChldmVudC5pc1N5c3RlbSgpCisgICAgICAgICAgICAgICAgfHwgbUNhbGxiYWNrUHJveHkudWlPdmVycmlkZUtleUV2ZW50KGV2ZW50KQorICAgICAgICAgICAgICAgIHx8IChtQWNjZXNzaWJpbGl0eUluamVjdG9yICE9IG51bGwgJiYgbUFjY2Vzc2liaWxpdHlJbmplY3Rvci5vbktleUV2ZW50KGV2ZW50KSkpIHsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfU0hJRlRfTEVGVAogICAgICAgICAgICAgICAgIHx8IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9TSElGVF9SSUdIVCkgewotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgeworICAgICAgICAgICAgaWYgKHBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpKSB7CiAgICAgICAgICAgICAgICAgbVNoaWZ0SXNQcmVzc2VkID0gZmFsc2U7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKGNvcHlTZWxlY3Rpb24oKSkgewogICAgICAgICAgICAgICAgIHNlbGVjdGlvbkRvbmUoKTsKQEAgLTQzMzUsOCArNDMyOSw4IEBACiAKICAgICAgICAgaWYgKGtleUNvZGUgPj0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQCiAgICAgICAgICAgICAgICAgJiYga2V5Q29kZSA8PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfUklHSFQpIHsKLSAgICAgICAgICAgIGlmIChuYXRpdmVGb2N1c0lzUGx1Z2luKCkpIHsKLSAgICAgICAgICAgICAgICBsZXRQbHVnaW5IYW5kbGVOYXZLZXkoa2V5Q29kZSwgZXZlbnQuZ2V0RXZlbnRUaW1lKCksIGZhbHNlKTsKKyAgICAgICAgICAgIGlmIChwYWdlU2hvdWxkSGFuZGxlU2hpZnRBbmRBcnJvd3MoKSkgeworICAgICAgICAgICAgICAgIGxldFBhZ2VIYW5kbGVOYX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saWVudCgpOwotICAgICAgICAgICAgaWYgKGNsaWVudCAhPSBudWxsKSBjbGllbnQub25TZWxlY3Rpb25Eb25lKHRoaXMpOworICAgICAgICAgICAgbVNlbGVjdGluZ1RleHQgPSBmYWxzZTsKKyAgICAgICAgICAgIC8vIGZpbmlzaCBpcyBpZGVtcG90ZW50LCBzbyB0aGlzIGlzIGZpbmUgZXZlbiBpZiBzZWxlY3Rpb25Eb25lIHdhcworICAgICAgICAgICAgLy8gY2FsbGVkIGJ5IG1TZWxlY3RDYWxsYmFjay5vbkRlc3Ryb3lBY3Rpb25Nb2RlCisgICAgICAgICAgICBtU2VsZWN0Q2FsbGJhY2suZmluaXNoKCk7CisgICAgICAgICAgICBtU2VsZWN0Q2FsbGJhY2sgPSBudWxsOworICAgICAgICAgICAgV2ViVmlld0NvcmUucmVzdW1lVXBkYXRlUGljdHVyZShtV2ViVmlld0NvcmUpOwogICAgICAgICAgICAgaW52YWxpZGF0ZSgpOyAvLyByZWRyYXcgd2l0aG91dCBzZWxlY3Rpb24KLSAgICAgICAgICAgIG5vdGlmeVNlbGVjdERpYWxvZ0Rpc21pc3NlZCgpOwogICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogQGhpZGUgcGVuZGluZyBBUEkgY291bmNpbCBhcHByb3ZhbC4KKyAgICAgKiBDb3B5IHRoZSBzZWxlY3Rpb24gdG8gdGhlIGNsaXBib2FyZAogICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGNvcHlTZWxlY3Rpb24oKSB7CisgICAgYm9vbGVhbiBjb3B5U2VsZWN0aW9uKCkgewogICAgICAgICBib29sZWFuIGNvcGllZFNvbWV0aGluZyA9IGZhbHNlOwogICAgICAgICBTdHJpbmcgc2VsZWN0aW9uID0gZ2V0U2VsZWN0aW9uKCk7CiAgICAgICAgIGlmIChzZWxlY3Rpb24gIT0gIiIpIHsKQEAgLTQ0ODgsMjIgKzQ0NzYsMTggQEAKICAgICAgICAgICAgICAgICAgICAgLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy50ZXh0X2NvcGllZAogICAgICAgICAgICAgICAgICAgICAsIFRvYXN0LkxFTkdUSF9TSE9SVCkuc2hvdygpOwogICAgICAgICAgICAgY29waWVkU29tZXRoaW5nID0gdHJ1ZTsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgSUNsaXBib2FyZCBjbGlwID0gSUNsaXBib2FyZC5TdHViLmFzSW50ZXJmYWNlKAotICAgICAgICAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuZ2V0U2VydmljZSgiY2xpcGJvYXJkIikpOwotICAgICAgICAgICAgICAgIGNsaXAuc2V0Q2xpcGJvYXJkVGV4dChzZWxlY3Rpb24pOwotICAgICAgICAgICAgfSBjYXRjaCAoYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR1RBRywgIkNsaXBib2FyZCBmYWlsZWQiLCBlKTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIENsaXBib2FyZE1hbmFnZXIgY20gPSAoQ2xpcGJvYXJkTWFuYWdlcilnZXRDb250ZXh0KCkKKyAgICAgICAgICAgICAgICAgICAgLmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5DTElQQk9BUkRfU0VSVklDRSk7CisgICAgICAgICAgICBjbS5zZXRUZXh0KHNlbGVjdGlvbik7CiAgICAgICAgIH0KICAgICAgICAgaW52YWxpZGF0ZSgpOyAvLyByZW1vdmUgc2VsZWN0aW9uIHJlZ2lvbiBhbmQgcG9pbnRlcgogICAgICAgICByZXR1cm4gY29waWVkU29tZXRoaW5nOwogICAgIH0KIAogICAgIC8qKgotICAgICAqIEBoaWRlIHBlbmRpbmcgQVBJIGNvdW5jaWwgYXBwcm92YWwuCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudGx5IGhpZ2hsaWdodGVkIHRleHQgYXMgYSBzdHJpbmcuCiAgICAgICovCi0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NYW5hZ2VyLmRpc21pc3Nab29tUGlja2VyKCk7CisgICAgICAgIH0KKyAgICB9CisKICAgICAvKioKICAgICAgKiBAZGVwcmVjYXRlZCBXZWJWaWV3IG5vIGxvbmdlciBuZWVkcyB0byBpbXBsZW1lbnQKICAgICAgKiBWaWV3R3JvdXAuT25IaWVyYXJjaHlDaGFuZ2VMaXN0ZW5lci4gIFRoaXMgbWV0aG9kIGRvZXMgbm90aGluZyBub3cuCkBAIC00NTUxLDMyICs0NTQ1LDMwIEBACiAgICAgICAgICAgICAgICAgLy8gSWYgb3VyIHdpbmRvdyByZWdhaW5lZCBmb2N1cywgYW5kIHdlIGhhdmUgZm9jdXMsIHRoZW4gYmVnaW4KICAgICAgICAgICAgICAgICAvLyBkcmF3aW5nIHRoZSBjdXJzb3IgcmluZwogICAgICAgICAgICAgICAgIG1EcmF3Q3Vyc29yUmluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgc2V0Rm9jdXNDb250cm9sbGVyQWN0aXZlKHRydWUpOwogICAgICAgICAgICAgICAgIGlmIChtTmF0aXZlQ2xhc3MgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICBuYXRpdmVSZWNvcmRCdXR0b25zKHRydWUsIGZhbHNlLCB0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlNFVF9BQ1RJVkUsIDEsIDApOwotICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBJZiBvdXIgd2luZG93IGdhaW5lZCBmb2N1cywgYnV0IHdlIGRvIG5vdCBoYXZlIGl0LCBkbyBub3QKLSAgICAgICAgICAgICAgICAvLyBkcmF3IHRoZSBjdXJzb3IgcmluZy4KLSAgICAgICAgICAgICAgICBtRHJhd0N1cnNvclJpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBpZiAoIWluRWRpdGluZ01vZGUoKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBJZiBvdXIgd2luZG93IGdhaW5lZCBmb2N1cywgYnV0IHdlIGRvIG5vdCBoYXZlIGl0LCBkbyBub3QKKyAgICAgICAgICAgICAgICAgICAgLy8gZHJhdyB0aGUgY3Vyc29yIHJpbmcuCisgICAgICAgICAgICAgICAgICAgIG1EcmF3Q3Vyc29yUmluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzZXRGb2N1c0NvbnRyb2xsZXJBY3RpdmUoZmFsc2UpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBXZSBkbyBub3QgY2FsbCBuYXRpdmVSZWNvcmRCdXR0b25zIGhlcmUgYmVjYXVzZSB3ZSBhc3N1bWUKICAgICAgICAgICAgICAgICAvLyB0aGF0IHdoZW4gd2UgbG9zdCBmb2N1cywgb3Igd2luZG93IGZvY3VzLCBpdCBnb3QgY2FsbGVkIHdpdGgKICAgICAgICAgICAgICAgICAvLyBmYWxzZSBmb3IgdGhlIGZpcnN0IHBhcmFtZXRlcgogICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKG1XZWJWaWV3Q29yZSAhPSBudWxsICYmIGdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpCi0gICAgICAgICAgICAgICAgICAgICYmIChtWm9vbUJ1dHRvbnNDb250cm9sbGVyID09IG51bGwgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAhbVpvb21CdXR0b25zQ29udHJvbGxlci5pc1Zpc2libGUoKSkpIHsKKyAgICAgICAgICAgIGlmICghbVpvb21NYW5hZ2VyLmlzWm9vbVBpY2tlclZpc2libGUoKSkgewogICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogVGhlIHpvb20gY29udHJvbHMgY29tZSBpbiB0aGVpciBvd24gd2luZG93LCBzbyBvdXIgd2luZG93Ci0gICAgICAgICAgICAgICAgICogbG9zZXMgZm9jdXMuIE91ciBwb2xpY3kgaXMgdG8gbm90IGRyYXcgdGhlIGN1cnNvciByaW5nIGlmCi0gICAgICAgICAgICAgICAgICogb3VyIHdpbmRvdyBpcyBub3QgZm9jdXNlZCwgYnV0IHRoaXMgaXMgYW4gZXhjZXB0aW9uIHNpbmNlCisgICAgICAgICAgICAgICAgICogVGhlIGV4dGVybmFsIHpvb20gY29udHJvbHMgY29tZSBpbiB0aGVpciBvd24gd2luZG93LCBzbyBvdXIKKyAgICAgICAgICAgICAgICAgKiB3aW5kb3cgbG9zZXMgZm9jdXMuIE91ciBwb2xpY3kgaXMgdG8gbm90IGRyYXcgdGhlIGN1cnNvciByaW5nCisgICAgICAgICAgICAgICAgICogaWYgb3VyIHdpbmRvdyBpcyBub3QgZm9jdXNlZCwgYnV0IHRoaXMgaXMgYW4gZXhjZXB0aW9uIHNpbmNlCiAgICAgICAgICAgICAgICAgICogdGhlIHVzZXIgY2FuIHN0aWxsIG5hdmlnYXRlIHRoZSB3ZWIgcGFnZSB3aXRoIHRoZSB6b29tCiAgICAgICAgICAgICAgICAgICogY29udHJvbHMgc2hvd2luZy4KICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAvLyBJZiBvdXIgd2luZG93IGhhcyBsb3N0IGZvY3VzLCBzdG9wIGRyYXdpbmcgdGhlIGN1cnNvciByaW5nCiAgICAgICAgICAgICAgICAgbURyYXdDdXJzb3JSaW5nID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtR290S2V5RG93biA9IGZhbHNlOwpAQCAtNDU4Niw3ICs0NTc4LDcgQEAKICAgICAgICAgICAgIGlmIChtTmF0aXZlQ2xhc3MgIT0gMCkgewogICAgICAgICAgICAgICAgIG5hdGl2ZVJlY29yZEJ1dHRvbnMoZmFsc2UsIGZhbHNlLCB0cnVlKTsKICAgICAgIC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lldygpOworICAgICAgICBpbnRbXSBsb2NhdGlvbiA9IG5ldyBpbnRbMl07CisgICAgICAgIGdldExvY2F0aW9uSW5XaW5kb3cobG9jYXRpb24pOworICAgICAgICBtR0xSZWN0Vmlld3BvcnQgPSBuZXcgUmVjdChsb2NhdGlvblswXSwgd2luZG93LmdldEhlaWdodCgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gKGxvY2F0aW9uWzFdICsgZ2V0SGVpZ2h0KCkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvblswXSArIGdldFdpZHRoKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5nZXRIZWlnaHQoKSAtIGxvY2F0aW9uWzFdKTsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBAaGlkZQogICAgICAqLwpAQCAtNDY2NSw5NCArNDY2NiwzNiBAQAogICAgICAgICAgICAgLy8gc3lzdGVtIHdvbid0IGNhbGwgb25TaXplQ2hhbmdlZCBpZiB0aGUgZGltZW5zaW9uIGlzIG5vdCBjaGFuZ2VkLgogICAgICAgICAgICAgLy8gSW4gdGhpcyBjYXNlLCB3ZSBuZWVkIHRvIGNhbGwgc2VuZFZpZXdTaXplWm9vbSgpIGV4cGxpY2l0bHkgdG8KICAgICAgICAgICAgIC8vIG5vdGlmeSB0aGUgV2ViS2l0IGFib3V0IHRoZSBuZXcgZGltZW5zaW9ucy4KLSAgICAgICAgICAgIHNlbmRWaWV3U2l6ZVpvb20oKTsKKyAgICAgICAgICAgIHNlbmRWaWV3U2l6ZVpvb20oZmFsc2UpOwogICAgICAgICB9CisgICAgICAgIHNldEdMUmVjdFZpZXdwb3J0KCk7CiAgICAgICAgIHJldHVybiBjaGFuZ2VkOwogICAgIH0KIAotICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIFBvc3RTY2FsZSBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKLSAgICAgICAgZmluYWwgV2ViVmlldyBtV2ViVmlldzsKLSAgICAgICAgZmluYWwgYm9vbGVhbiBtVXBkYXRlVGV4dFdyYXA7Ci0KLSAgICAgICAgcHVibGljIFBvc3RTY2FsZShXZWJWaWV3IHdlYlZpZXcsIGJvb2xlYW4gdXBkYXRlVGV4dFdyYXApIHsKLSAgICAgICAgICAgIG1XZWJWaWV3ID0gd2ViVmlldzsKLSAgICAgICAgICAgIG1VcGRhdGVUZXh0V3JhcCA9IHVwZGF0ZVRleHRXcmFwOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewotICAgICAgICAgICAgaWYgKG1XZWJWaWV3Lm1XZWJWaWV3Q29yZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgLy8gd2UgYWx3YXlzIGZvcmNlLCBpbiBjYXNlIG91ciBoZWlnaHQgY2hhbmdlZCwgaW4gd2hpY2ggY2FzZSB3ZQotICAgICAgICAgICAgICAgIC8vIHN0aWxsIHdhbnQgdG8gc2VuZCB0aGUgbm90aWZpY2F0aW9uIG92ZXIgdG8gd2Via2l0LgotICAgICAgICAgICAgICAgIG1XZWJWaWV3LnNldE5ld1pvb21TY2FsZShtV2ViVmlldy5tQWN0dWFsU2NhbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBtVXBkYXRlVGV4dFdyYXAsIHRydWUpOwotICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgem9vbSBidXR0b25zIGFzIHRoZSBzY2FsZSBjYW4gYmUgY2hhbmdlZAotICAgICAgICAgICAgICAgIGlmIChtV2ViVmlldy5nZXRTZXR0aW5ncygpLmdldEJ1aWx0SW5ab29tQ29udHJvbHMoKSkgewotICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy51cGRhdGVab29tQnV0dG9uc0VuYWJsZWQoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICBAT3ZlcnJpZGUKICAgICBwcm90ZWN0ZWQgdm9pZCBvblN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GUgc3RhdGljIGZpbmFsIGludCBEUkFHR0lOR19TVEFURSA9IDA7Ci0gICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBBTklNQVRJTkdfU1RBVEUgPSAxOwotICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgRklOSVNIRURfU1RBVEUgPSAyOwotICAgICAgICBwcml2YXRlIGludCBtU3RhdGU7Ci0KLSAgICAgICAgcHVibGljIERyYWdUcmFja2VySGFuZGxlcihmbG9hdCB4LCBmbG9hdCB5LCBEcmFnVHJhY2tlciBwcm94eSkgewotICAgICAgICAgICAgbVByb3h5ID0gcHJveHk7Ci0KLSAgICAgICAgICAgIGludCBkb2NCb3R0b20gPSBjb21wdXRlUmVhbFZlcnRpY2FsU2Nyb2xsUmFuZ2UoKSArIGdldFRpdGxlSGVpZ2h0KCk7Ci0gICAgICAgICAgICBpbnQgdmlld1RvcCA9IGdldFNjcm9sbFkoKTsKLSAgICAgICAgICAgIGludCB2aWV3Qm90dG9tID0gdmlld1RvcCArIGdldEhlaWdodCgpOwotCi0gICAgICAgICAgICBtU3RhcnRZID0geTsKLSAgICAgICAgICAgIG1NaW5EWSA9IC12aWV3VG9wOwotICAgICAgICAgICAgbU1heERZID0gZG9jQm90dG9tIC0gdmlld0JvdHRvbTsKLQotICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuRFJBR19UUkFDS0VSIHx8IERFQlVHX0RSQUdfVFJBQ0tFUikgewotICAgICAgICAgICAgICAgIExvZy5kKERlYnVnRmxhZ3MuRFJBR19UUkFDS0VSX0xPR1RBRywgIiBkcmFndHJhY2tlciB5PSAiICsgeSArCi0gICAgICAgICAgICAgICAgICAgICAgIiB1cC9kb3duPSAiICsgbU1pbkRZICsgIiAiICsgbU1heERZKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaW50IGRvY1JpZ2h0ID0gY29tcHV0ZVJlYWxIb3Jpem9udGFsU2Nyb2xsUmFuZ2UoKTsKLSAgICAgICAgICAgIGludCB2aWV3TGVmdCA9IGdldFNjcm9sbFgoKTsKLSAgICAgICAgICAgIGludCB2aWV3UmlnaHQgPSB2aWV3TGVmdCArIGdldFdpZHRoKCk7Ci0gICAgICAgICAgICBtU3RhcnRYID0geDsKLSAgICAgICAgICAgIG1NaW5EWCA9IC12aWV3TGVmdDsKLSAgICAgICAgICAgIG1NYXhEWCA9IGRvY1JpZ2h0IC0gdmlld1JpZ2h0OwotCi0gICAgICAgICAgICBtU3RhdGUgPSBEUkFHR0lOR19TVEFURTsKLSAgICAgICAgICAgIG1Qcm94eS5vblN0YXJ0RHJhZyh4LCB5KTsKLQotICAgICAgICAgICAgLy8gZW5zdXJlIHdlIGJ1aWxkQml0bWFwIGF0IGxlYXN0IG9uY2UKLSAgICAgICAgICAgIG1TWCA9IC05OTk5OTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgZmxvYXQgY29tcHV0ZVN0cmV0Y2goZmxvYXQgZGVsdGEsIGZsb2F0IG1pbiwgZmxvYXQgbWF4KSB7Ci0gICAgICAgICAgICBmbG9hdCBzdHJldGNoID0gMDsKLSAgICAgICAgICAgIGlmIChtYXggLSBtaW4gPiBNSU5fU0NST0xMX0FNT1VOVF9UT19ESVNBQkxFX0RSQUdfVFJBQ0tFUikgewotICAgICAgICAgICAgICAgIGlmIChkZWx0YSA8IG1pbikgewotICAgICAgICAgICAgICAgICAgICBzdHJldGNoID0gZGVsdGEgLSBtaW47Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkZWx0YSA+IG1heCkgewotICAgICAgICAgICAgICAgICAgICBzdHJldGNoID0gZGVsdGEgLSBtYXg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIHN0cmV0Y2g7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBkcmFnVG8oZmxvYXQgeCwgZmxvYXQgeSkgewotICAgICAgICAgICAgZmxvYXQgc3kgPSBjb21wdXRlU3RyZXRjaChtU3RhcnRZIC0geSwgbU1pbkRZLCBtTWF4RFkpOwotICAgICAgICAgICAgZmxvYXQgc3ggPSBjb21wdXRlU3RyZXRjaChtU3RhcnRYIC0geCwgbU1pbkRYLCBtTWF4RFgpOwotCi0gICAgICAgICAgICBpZiAoKG1TbmFwU2Nyb2xsTW9kZSAmIFNOQVBfWCkgIT0gMCkgewotICAgICAgICAgICAgICAgIHN5ID0gMDsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoKG1TbmFwU2Nyb2xsTW9kZSAmIFNOQVBfWSkgIT0gMCkgewotICAgICAgICAgICAgICAgIHN4ID0gMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1DdXJyU3RyZXRjaFggIT0gc3ggfHwgbUN1cnJTdHJldGNoWSAhPSBzeSkgewotICAgICAgICAgICAgICAgIG1DdXJyU3RyZXRjaFggPSBzeDsKLSAgICAgICAgICAgICAgICBtQ3VyclN0cmV0Y2hZID0gc3k7Ci0gICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuRFJBR19UUkFDS0VSIHx8IERFQlVHX0RSQUdfVFJBQ0tFUikgewotICAgICAgICAgICAgICAgICAgICBMb2cuZChEZWJ1Z0ZsYWdzLkRSQUdfVFJBQ0tFUl9MT0dUQUcsICItLS0tIHN0cmV0Y2ggIiArIHN4ICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIiAiICsgc3kpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAobVByb3h5Lm9uU3RyZXRjaENoYW5nZShzeCwgc3kpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzdG9wRHJhZygpIHsKLSAgICAgICAgICAgIGZpbmFsIGludCBEVVJBVElPTiA9IDIwMDsKLSAgICA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U1kgIT0gc3kpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRCaXRtYXAoc3gsIHN5KTsKLSAgICAgICAgICAgICAgICAgICAgbVNYID0gc3g7Ci0gICAgICAgICAgICAgICAgICAgIG1TWSA9IHN5OwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChtU3RhdGUgPT0gQU5JTUFUSU5HX1NUQVRFKSB7Ci0gICAgICAgICAgICAgICAgICAgIEludGVycG9sYXRvci5SZXN1bHQgcmVzdWx0ID0gbUludGVycC50aW1lVG9WYWx1ZXMobVhZKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PSBJbnRlcnBvbGF0b3IuUmVzdWx0LkZSRUVaRV9FTkQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TdGF0ZSA9IEZJTklTSEVEX1NUQVRFOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbVByb3h5Lm9uU3RyZXRjaENoYW5nZShtWFlbMF0sIG1YWVsxXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2ggdG8gdGhlIGRyYXcKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpbnQgY291bnQgPSBjYW52YXMuc2F2ZShDYW52YXMuTUFUUklYX1NBVkVfRkxBRyk7Ci0gICAgICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZShzeCwgc3kpOwotICAgICAgICAgICAgICAgIG1Qcm94eS5vbkRyYXcoY2FudmFzKTsKLSAgICAgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQoY291bnQpOwotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuRFJBR19UUkFDS0VSIHx8IERFQlVHX0RSQUdfVFJBQ0tFUikgewotICAgICAgICAgICAgICAgIExvZy5kKERlYnVnRmxhZ3MuRFJBR19UUkFDS0VSX0xPR1RBRywgIiAtLSBkcmF3IGZhbHNlICIgKwotICAgICAgICAgICAgICAgICAgICAgIG1DdXJyU3RyZXRjaFggKyAiICIgKyBtQ3VyclN0cmV0Y2hZKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBidWlsZEJpdG1hcChpbnQgc3gsIGludCBzeSkgewotICAgICAgICAgICAgaW50IHcgPSBnZXRXaWR0aCgpOwotICAgICAgICAgICAgaW50IGggPSBnZXRWaWV3SGVpZ2h0KCk7Ci0gICAgICAgICAgICBCaXRtYXAgYm0gPSBCaXRtYXAuY3JlYXRlQml0bWFwKHcsIGgsIG9mZnNjcmVlbkJpdG1hcENvbmZpZygpKTsKLSAgICAgICAgICAgIENhbnZhcyBjYW52YXMgPSBuZXcgQ2FudmFzKGJtKTsKLSAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoLXN4LCAtc3kpOwotICAgICAgICAgICAgZHJhd0NvbnRlbnQoY2FudmFzKTsKLQotICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuRFJBR19UUkFDS0VSIHx8IERFQlVHX0RSQUdfVFJBQ0tFUikgewotICAgICAgICAgICAgICAgIExvZy5kKERlYnVnRmxhZ3MuRFJBR19UUkFDS0VSX0xPR1RBRywgIi0tLSBidWlsZEJpdG1hcCAiICsgc3ggKwotICAgICAgICAgICAgICAgICAgICAgICIgIiArIHN5ICsgIiAiICsgdyArICIgIiArIGgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVByb3h5Lm9uQml0bWFwQ2hhbmdlKGJtKTsKLSAgICAgICAgfQotICAgIH0KLQotIC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HVibGljIGJvb2xlYW4gb25TY2FsZUJlZ2luKFNjYWxlR2VzdHVyZURldGVjdG9yIGRldGVjdG9yKSB7Ci0gICAgICAgICAgICAvLyBjYW5jZWwgdGhlIHNpbmdsZSB0b3VjaCBoYW5kbGluZwotICAgICAgICAgICAgY2FuY2VsVG91Y2goKTsKLSAgICAgICAgICAgIGRpc21pc3Nab29tQ29udHJvbCgpOwotICAgICAgICAgICAgLy8gcmVzZXQgdGhlIHpvb20gb3ZlcnZpZXcgbW9kZSBzbyB0aGF0IHRoZSBwYWdlIHdvbid0IGF1dG8gZ3JvdwotICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gZmFsc2U7Ci0gICAgICAgICAgICAvLyBJZiBpdCBpcyBpbiBwYXNzd29yZCBtb2RlLCB0dXJuIGl0IG9mZiBzbyBpdCBkb2VzIG5vdCBkcmF3Ci0gICAgICAgICAgICAvLyBtaXNwbGFjZWQuCi0gICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpICYmIG5hdGl2ZUZvY3VzQ2FuZGlkYXRlSXNQYXNzd29yZCgpKSB7Ci0gICAgICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldEluUGFzc3dvcmQoZmFsc2UpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtVmlld01hbmFnZXIuc3RhcnRab29tKCk7Ci0KLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgb25TY2FsZUVuZChTY2FsZUdlc3R1cmVEZXRlY3RvciBkZXRlY3RvcikgewotICAgICAgICAgICAgaWYgKG1QcmV2aWV3Wm9vbU9ubHkpIHsKLSAgICAgICAgICAgICAgICBtUHJldmlld1pvb21Pbmx5ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgbUFuY2hvclggPSB2aWV3VG9Db250ZW50WCgoaW50KSBtWm9vbUNlbnRlclggKyBtU2Nyb2xsWCk7Ci0gICAgICAgICAgICAgICAgbUFuY2hvclkgPSB2aWV3VG9Db250ZW50WSgoaW50KSBtWm9vbUNlbnRlclkgKyBtU2Nyb2xsWSk7Ci0gICAgICAgICAgICAgICAgLy8gZG9uJ3QgcmVmbG93IHdoZW4gem9vbSBpbjsgd2hlbiB6b29tIG91dCwgZG8gcmVmbG93IGlmIHRoZQotICAgICAgICAgICAgICAgIC8vIG5ldyBzY2FsZSBpcyBhbG1vc3QgbWluaW11bSBzY2FsZTsKLSAgICAgICAgICAgICAgICBib29sZWFuIHJlZmxvd05vdyA9IChtQWN0dWFsU2NhbGUgLSBtTWluWm9vbVNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICA8PSBNSU5JTVVNX1NDQUxFX0lOQ1JFTUVOVCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHx8ICgobUFjdHVhbFNjYWxlIDw9IDAuOCAqIG1UZXh0V3JhcFNjYWxlKSk7Ci0gICAgICAgICAgICAgICAgLy8gZm9yY2Ugem9vbSBhZnRlciBtUHJldmlld1pvb21Pbmx5IGlzIHNldCB0byBmYWxzZSBzbyB0aGF0IHRoZQotICAgICAgICAgICAgICAgIC8vIG5ldyB2aWV3IHNpemUgd2lsbCBiZSBwYXNzZWQgdG8gdGhlIFdlYktpdAotICAgICAgICAgICAgICAgIHNldE5ld1pvb21TY2FsZShtQWN0dWFsU2NhbGUsIHJlZmxvd05vdywgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgLy8gY2FsbCBpbnZhbGlkYXRlKCkgdG8gZHJhdyB3aXRob3V0IHpvb20gZmlsdGVyCi0gICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gYWRqdXN0IHRoZSBlZGl0IHRleHQgdmlldyBpZiBuZWVkZWQKLSAgICAgICAgICAgIGlmIChpbkVkaXRpbmdNb2RlKCkgJiYgZGlkVXBkYXRlVGV4dFZpZXdCb3VuZHMoZmFsc2UpCi0gICAgICAgICAgICAgICAgICAgICY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AqIDEwMCkgLyAxMDAuMCk7Ci0gICAgICAgICAgICBpZiAoTWF0aC5hYnMoc2NhbGUgLSBtQWN0dWFsU2NhbGUpID49IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5UKSB7Ci0gICAgICAgICAgICAgICAgbVByZXZpZXdab29tT25seSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgLy8gbGltaXQgdGhlIHNjYWxlIGNoYW5nZSBwZXIgc3RlcAotICAgICAgICAgICAgICAgIGlmIChzY2FsZSA+IG1BY3R1YWxTY2FsZSkgewotICAgICAgICAgICAgICAgICAgICBzY2FsZSA9IE1hdGgubWluKHNjYWxlLCBtQWN0dWFsU2NhbGUgKiAxLjI1Zik7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgc2NhbGUgPSBNYXRoLm1heChzY2FsZSwgbUFjdHVhbFNjYWxlICogMC44Zik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1ab29tQ2VudGVyWCA9IGRldGVjdG9yLmdldEZvY3VzWCgpOwotICAgICAgICAgICAgICAgIG1ab29tQ2VudGVyWSA9IGRldGVjdG9yLmdldEZvY3VzWSgpOwotICAgICAgICAgICAgICAgIHNldE5ld1pvb21TY2FsZShzY2FsZSwgZmFsc2UsIGZhbHNlKTsKLSAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICBwcml2YXRlIGJvb2xlYW4gaGl0Rm9jdXNlZFBsdWdpbihpbnQgY29udGVudFgsIGludCBjb250ZW50WSkgewogICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAibmF0aXZlRm9jdXNJc1BsdWdpbigpPSIgKyBuYXRpdmVG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EFOQ0UgPSAyMDAwMDsKKwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikgewogICAgICAgICBpZiAobU5hdGl2ZUNsYXNzID09IDAgfHwgKCFpc0NsaWNrYWJsZSgpICYmICFpc0xvbmdDbGlja2FibGUoKSkpIHsKQEAgLTUwOTksNjMgKzQ4MTAsMTIzIEBACiAgICAgICAgIH0KIAogICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewotICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCBldiArICIgYXQgIiArIGV2LmdldEV2ZW50VGltZSgpICsgIiBtVG91Y2hNb2RlPSIKLSAgICAgICAgICAgICAgICAgICAgKyBtVG91Y2hNb2RlKTsKKyAgICAgICAgICAgIExvZy52KExPR1RBRywgZXYgKyAiIGF0ICIgKyBldi5nZXRFdmVudFRpbWUoKQorICAgICAgICAgICAgICAgICsgIiBtVG91Y2hNb2RlPSIgKyBtVG91Y2hNb2RlCisgICAgICAgICAgICAgICAgKyAiIG51bVBvaW50ZXJzPSIgKyBldi5nZXRQb2ludGVyQ291bnQoKSk7CiAgICAgICAgIH0KIAotICAgICAgICBpbnQgYWN0aW9uOwotICAgICAgICBmbG9hdCB4LCB5OworICAgICAgICBpbnQgYWN0aW9uID0gZXYuZ2V0QWN0aW9uKCk7CisgICAgICAgIGZsb2F0IHggPSBldi5nZXRYKCk7CisgICAgICAgIGZsb2F0IHkgPSBldi5nZXRZKCk7CiAgICAgICAgIGxvbmcgZXZlbnRUaW1lID0gZXYuZ2V0RXZlbnRUaW1lKCk7CiAKLSAgICAgICAgLy8gRklYTUU6IHdlIG1heSBjb25zaWRlciB0byBnaXZlIFdlYktpdCBhbiBvcHRpb24gdG8gaGFuZGxlIG11bHRpLXRvdWNoCi0gICAgICAgIC8vIGV2ZW50cyBsYXRlci4KLSAgICAgICAgaWYgKG1TdXBwb3J0TXVsdGlUb3VjaCAmJiBldi5nZXRQb2ludGVyQ291bnQoKSA+IDEpIHsKLSAgICAgICAgICAgIGlmIChtQWxsb3dQYW5BbmRTY2FsZSB8fCBtTWluWm9vbVNjYWxlIDwgbU1heFpvb21TY2FsZSkgewotICAgICAgICAgICAgICAgIG1TY2FsZURldGVjdG9yLm9uVG91Y2hFdmVudChldik7Ci0gICAgICAgICAgICAgICAgaWYgKG1TY2FsZURldGVjdG9yLmlzSW5Qcm9ncmVzcygpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hUaW1lID0gZXZlbnRUaW1lOwotICAgICAgICAgICAgICAgICAgICBpZiAoIW1BbGxvd1BhbkFuZFNjYWxlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoU1dJVENIX1RPX1NIT1JUUFJFU1MpOwotICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoU1dJVENIX1RPX0xPTkdQUkVTUyk7CisgICAgICAgIGZpbmFsIFNjYWxlR2VzdHVyZURldGVjdG9yIGRldGVjdG9yID0KKyAgICAgICAgICAgICAgICBtWm9vbU1hbmFnZXIuZ2V0TXVsdGlUb3VjaEdlc3R1cmVEZXRlY3RvcigpOworICAgICAgICBib29sZWFuIHNraXBTY2FsZUdlc3R1cmUgPSBmYWxzZTsKKyAgICAgICAgLy8gU2V0IHRvIHRoZSBtaWQtcG9pbnQgb2YgYSB0d28tZmluZ2VyIGdlc3R1cmUgdXNlZCB0byBkZXRlY3QgaWYgdGhlCisgICAgICAgIC8vIHVzZXIgaGFzIHRvdWNoZWQgYSBsYXllci4KKyAgICAgICAgZmxvYXQgZ2VzdHVyZVggPSB4OworICAgICAgICBmbG9hdCBnZXN0dXJlWSA9IHk7CisgICAgICAgIGlmIChkZXRlY3RvciA9PSBudWxsIHx8ICFkZXRlY3Rvci5pc0luUHJvZ3Jlc3MoKSkgeworICAgICAgICAgICAgLy8gVGhlIGdlc3R1cmUgZm9yIHNjcm9sbGluZyBhIGxheWVyIGlzIHR3byBmaW5nZXJzIGNsb3NlIHRvZ2V0aGVyLgorICAgICAgICAgICAgLy8gRklYTUU6IHdlIG1heSBjb25zaWRlciBnaXZpbmcgV2ViS2l0IGFuIG9wdGlvbiB0byBoYW5kbGUKKyAgICAgICAgICAgIC8vIG11bHRpLXRvdWNoIGV2ZW50cyBsYXRlci4KKyAgICAgICAgICAgIGlmIChldi5nZXRQb2ludGVyQ291bnQoKSA+IDEpIHsKKyAgICAgICAgICAgICAgICBmbG9hdCBkeCA9IGV2LmdldFgoMSkgLSBldi5nZXRYKDApOworICAgICAgICAgICAgICAgIGZsb2F0IGR5ID0gZXYuZ2V0WSgxKSAtIGV2LmdldFkoMCk7CisgICAgICAgICAgICAgICAgZmxvYXQgZGlzdCA9IChkeCAqIGR4ICsgZHkgKiBkeSkgKgorICAgICAgICAgICAgICAgICAgICAgICAgRFJBR19MQVlFUl9JTlZFUlNFX0RFTlNJVFlfU1FVQVJFRDsKKyAgICAgICAgICAgICAgICAvLyBVc2UgdGhlIGFwcHJveGltYXRlIGNlbnRlciB0byBkZXRlcm1pbmUgaWYgdGhlIGdlc3R1cmUgaXMgaW4KKyAgICAgICAgICAgICAgICAvLyBhIGxheWVyLgorICAgICAgICAgICAgICAgIGdlc3R1cmVYID0gZXYuZ2V0WCgwKSArIChkeCAqIC41Zik7CisgICAgICAgICAgICAgICAgZ2VzdHVyZVkgPSBldi5nZXRZKDApICsgKGR5ICogLjVmKTsKKyAgICAgICAgICAgICAgICAvLyBOb3cgdXNlIGEgY29uc2lzdGVudCBwb2ludCBmb3IgdHJhY2tpbmcgbW92ZW1lbnQuCisgICAgICAgICAgICAgICAgaWYgKGV2LmdldFgoMCkgPCBldi5nZXRYKDEpKSB7CisgICAgICAgICAgICAgICAgICAgIHggPSBldi5nZXRYKDApOworICAgICAgICAgICAgICAgICAgICB5ID0gZXYuZ2V0WSgwKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB4ID0gZXYuZ2V0WCgxKTsKKyAgICAgICAgICAgICAgICAgICAgeSA9IGV2LmdldFkoMSk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHggPSBtU2NhbGVEZXRlY3Rvci5nZXRGb2N1c1goKTsKLSAgICAgICAgICAgICAgICB5ID0gbVNjYWxlRGV0ZWN0b3IuZ2V0Rm9jdXNZKCk7Ci0gICAgICAgICAgICAgICAgYWN0aW9uID0gZXYuZ2V0QWN0aW9uKCkgJiBNb3Rpb25FdmVudC5BQ1RJT05fTUFTSzsKLSAgICAgICAgICAgICAgICBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX0RPV04pIHsKLSAgICAgICAgICAgICAgICAgICAgY2FuY2VsVG91Y2goKTsKLSAgICAgICAgICAgICAgICAgICAgYWN0aW9uID0gTW90aW9uRXZlbnQuQUNUSU9OX0RPV047Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24gPT0gTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfVVApIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gc2V0IG1MYXN0VG91Y2hYL1kgdG8gdGhlIHJlbWFpbmluZyBwb2ludAotICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWCA9IHg7Ci0gICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hZID0geTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSkgewotICAgICAgICAgICAgICAgICAgICAvLyBuZWdhdGl2ZSB4IG9yIHkgaW5kaWNhdGUgaXQgaXMgb24gdGhlIGVkZ2UsIHNraXAgaXQuCi0gICAgICAgICAgICAgICAgICAgIGlmICh4IDwgMCB8fCB5IDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBhY3Rpb24gPSBldi5nZXRBY3Rpb25NYXNrZWQoKTsKKyAgICAgICAgICAgICAgICBpZiAoZGlzdCA8IERSQUdfTEFZRVJfRklOR0VSX0RJU1RBTkNFKSB7CisgICAgICAgICAgICAgICAgICAgIHNraXBTY2FsZUdlc3R1cmUgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9EUkFHX0xBWUVSX01PREUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gRmluZ2VycyBtb3ZlZCB0b28gZmFyIGFwYXJ0IHdoaWxlIGRyYWdnaW5nLCB0aGUgdXNlcgorICAgICAgICAgICAgICAgICAgICAvLyBtaWdodCBiZSB0cnlpbmcgdG8gem9vbS4KKyAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0lOSVRfTU9ERTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBwYWdlIGRpc2FsbG93IHpvb20sIHNraXAgbXVsdGktcG9pbnRlciBhY3Rpb24KLSAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGFjdGlvbiA9IGV2LmdldEFjdGlvbigpOwotICAgICAgICAgICAgeCA9IGV2LmdldFgoKTsKLSAgICAgICAgICAgIHkgPSBldi5nZXRZKCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBJZiB0aGUgcGFnZSBkaXNhbGxvd3Mgem9vbSwgcGFzcyBtdWx0aS1wb2ludGVyIGV2ZW50cyB0byB3ZWJraXQuCisgICAgICAgIGlmIChldi5nZXRQb2ludGVyQ291bnQoKSA+IDEKKyAgICAgICAgICAgICYmIChtWm9vbU1hbmFnZXIuaXNab29tU2NhbGVGaXhlZCgpIHx8IG1EZWZlck11bHRpdG91Y2gpKSB7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInBhc3NpbmcgIiArIGV2LmdldFBvaW50ZXJDb3VudCgpICsgIiBwb2ludHMgdG8gd2Via2l0Iik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwYXNzTXVsdGlUb3VjaFRvV2ViS2l0KGV2KTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1ab29tTWFuYWdlci5zdXBwb3J0c011bHRpVG91Y2hab29tKCkgJiYgZXYuZ2V0UG9pbnRlckNvdW50KCkgPiAxICYmCisgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSAhPSBUT1VDSF9EUkFHX0xBWUVSX01PREUgJiYgIXNraXBTY2FsZUdlc3R1cmUpIHsKKyAgICAgICAgICAgIGlmICghZGV0ZWN0b3IuaXNJblByb2dyZXNzKCkgJiYKKyAgICAgICAgICAgICAgICAgICAgZXYuZ2V0QWN0aW9uTWFza2VkKCkgIT0gTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfRE9XTikgeworICAgICAgICAgICAgICAgIC8vIEluc2VydCBhIGZha2UgcG9pbnRlciBkb3duIGV2ZW50IGluIG9yZGVyIHRvIHN0YXJ0CisgICAgICAgICAgICAgICAgLy8gdGhlIHpvb20gc2NhbGUgZGV0ZWN0b3IuCisgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQgdGVtcCA9IE1vdGlvbkV2ZW50Lm9idGFpbihldik7CisgICAgICAgICAgICAgICAgLy8gQ2xlYXIgdGhlIG9yaWdpbmFsIGV2ZW50IGFuZCBzZXQgaXQgdG8KKyAgICAgICAgICAgICAgICAvLyBBQ1RJT05fUE9JTlRFUl9ET1dOLgorICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHRlbXAuc2V0QWN0aW9uKHRlbXAuZ2V0QWN0aW9uKCkgJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH5Nb3Rpb25FdmVudC5BQ1RJT05fTUFTSyB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfRE9XTik7CisgICAgICAgICAgICAgICAgICAgIGRldGVjdG9yLm9uVG91Y2hFdmVudCh0ZW1wKTsKKyAgICAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICB0ZW1wLnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGRldGVjdG9yLm9uVG91Y2hFdmVudChldik7CisKKyAgICAgICAgICAgIGlmIChkZXRlY3Rvci5pc0luUHJvZ3Jlc3MoKSkgeworICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hUaW1lID0gZXZlbnRUaW1lOworICAgICAgICAgICAgICAgIGNhbmNlbExvbmdQcmVzcygpOworICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhTV0lUQ0hfVE9fTE9OR1BSRVNTKTsKKyAgICAgICAgICAgICAgICBpZiAoIW1ab29tTWFuYWdlci5zdXBwb3J0c1BhbkR1cmluZ1pvb20oKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0RSQUdfTU9ERTsKKyAgICAgICAgICAgICAgICBpZiAobVZlbG9jaXR5VHJhY2tlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIgPSBWZWxvY2l0eVRyYWNrZXIub2J0YWluKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICB4ID0gZGV0ZWN0b3IuZ2V0Rm9jdXNYKCk7CisgICAgICAgICAgICB5ID0gZGV0ZWN0b3IuZ2V0Rm9jdXNZKCk7CisgICAgICAgICAgICBhY3Rpb24gPSBldi5nZXRBY3Rpb24oKSAmIE1vdGlvbkV2ZW50LkFDVElPTl9NQVNLOworICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fUE9JTlRFUl9ET1dOKSB7CisgICAgICAgICAgICAgICAgY2FuY2VsVG91Y2goKTsKKyAgICAgICAgICAgICAgICBhY3Rpb24gPSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTjsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX1VQKSB7CisgICAgICAgICAgICAgICAgLy8gc2V0IG1MYXN0VG91Y2hYL1kgdG8gdGhlIHJlbWFpbmluZyBwb2ludAorICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hYID0geDsKKyAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWSA9IHk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSkgeworICAgICAgICAgICAgICAgIC8vIG5lZ2F0aXZlIHggb3IgeSBpbmRpY2F0ZSBpdCBpcyBvbiB0aGUgZWRnZSwgc2tpcCBpdC4KKyAgICAgICAgICAgICAgICBpZiAoeCA8IDAgfHwgeSA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgLy8gRHVlIHRvIHRoZSB0b3VjaCBzY3JlZW4gZWRnZSBlZmZlY3QsIGEgdG91Y2ggY2xvc2VyIHRvIHRoZSBlZGdlCiAgICAgICAgIC8vIGF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TkdMRV9UQVApOworICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0U2V0dGluZ3MoKS5zdXBwb3J0VG91Y2hPbmx5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZVRvdWNoSGlnaGxpZ2h0KHRydWUpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVggKiBkZWx0YVggKyBkZWx0YVkgKiBkZWx0YVkgPCBtRG91YmxlVGFwU2xvcFNxdWFyZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0RPVUJMRV9UQVBfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKQEAgLTUxODksMTMgKzQ5NjMsMzMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFgsIGNvbnRlbnRZKSA6IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gdGhlIG5vcm1hbCBjYXNlCi0gICAgICAgICAgICAgICAgICAgIG1QcmV2aWV3Wm9vbU9ubHkgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0lOSVRfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgbURlZmVyVG91Y2hQcm9jZXNzID0gKCFpbkZ1bGxTY3JlZW5Nb2RlKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBtRm9yd2FyZFRvdWNoRXZlbnRzKSA/IGhpdEZvY3VzZWRQbHVnaW4oCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFgsIGNvbnRlbnRZKSA6IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRIdWIuVVBEQVRFX0ZSQU1FX0NBQ0hFX0lGX0xPQURJTkcpOworICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0U2V0dGluZ3MoKS5zdXBwb3J0VG91Y2hPbmx5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoSGlnaGxpZ2h0RGF0YSBkYXRhID0gbmV3IFRvdWNoSGlnaGxpZ2h0RGF0YSgpOworICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5tWCA9IGNvbnRlbnRYOworICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5tWSA9IGNvbnRlbnRZOworICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5tU2xvcCA9IHZpZXdUb0NvbnRlbnREaW1lbnNpb24obU5hdlNsb3ApOworICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlRGVsYXllZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRIdWIuR0VUX1RPVUNIX0hJR0hMSUdIVF9SRUNUUywgZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0NvbmZpZ3VyYXRpb24uZ2V0VGFwVGltZW91dCgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19UT1VDSF9ISUdITElHSFQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0U2V0dGluZ3MoKS5nZXROYXZEdW1wKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaGxpZ2h0WCA9IChpbnQpIHggKyBtU2Nyb2xsWDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaGxpZ2h0WSA9IChpbnQpIHkgKyBtU2Nyb2xsWTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnBvc3REZWxheWVkKG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hIaWdobGlnaHRYID0gbVRvdWNoSGlnaGxpZ2h0WSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBUT1VDSF9ISUdITElHSFRfRUxBUFNFX1RJTUUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBpZiAobUxvZ0V2ZW50ICYmIGV2ZW50VGltZSAtIG1MYXN0VG91Y2hVcFRpbWUgPCAxMDAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEV2ZW50TG9nVGFncy5CUk9XU0VSX0RPVUJMRV9UQVBfRFVSQVRJT04sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChldmVudFRpbWUgLSBtTGFzdFRvdWNoVXBUaW1lKSwgZXZlbnRUaW1lKTsKQEAgLTUyMjcsMjEgKzUwMjEsMTkgQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKHNob3VsZEZvcndhcmRUb3VjaEV2ZW50KCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoRXZlbnREYXRhIHRlZCA9IG5ldyBUb3VjaEV2ZW50RGF0YSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1BY3Rpb24gPSBhY3Rpb247Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVggPSBjb250ZW50WDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tWSA9IGNvbnRlbnRZOworICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1Qb2ludHMgPSBuZXcgUG9pbnRbMV07CisgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVBvaW50c1swXSA9IG5ldyBQb2ludChjb250ZW50WCwgY29udGVudFkpOwogICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1NZXRhU3RhdGUgPSBldi5nZXRNZXRhU3RhdGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tUmVwcm9jZXNzID0gbURlZmVyVG91Y2hQcm9jZXNzOworICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1EZWZlclRvdWNoUHJvY2VzcykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0aWxsIG5lZWRzIHRvIHNldCB0aGVtIGZvciBjb21wdXRlIGRlbHRhWC9ZCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RUb3VjaFggPSB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hZID0geTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdYID0geDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdZID0geTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWluRnVsbFNjcmVlbk1vZGUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhQUkVWRU5UX0RFRkFVTFRfVElNRU9VVCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtUHJpdmF0ZUhhbmRsZXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vYnRhaW5NZXNzYWdlKFBSRVZFTlRfREVGQVVMVF9USU1FT1VULAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb24sIDApLCBUQVBfVElNRU9VVCk7CkBAIC01MjYyLDI0ICs1MDU0LDI0IEBACiAgICAgICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0RPVUJMRV9UQVBfTU9ERSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0lOSVRfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0U2V0dGluZ3MoKS5zdXBwb3J0VG91Y2hPbmx5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZVRvdWNoSGlnaGxpZ2h0KHRydWUpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIC8vIHBhc3MgdGhlIHRvdWNoIGV2ZW50cyBmcm9tIFVJIHRocmVhZCB0byBXZWJDb3JlIHRocmVhZAogICAgICAgICAgICAgICAgIGlmIChzaG91bGRGb3J3YXJkVG91Y2hFdmVudCgpICYmIG1Db25maXJtTW92ZSAmJiAoZmlyc3RNb3ZlCiAgICAgICAgICAgICAgICAgICAgICAgICB8fCBldmVudFRpbWUgLSBtTGFzdFNlbnRUb3VjaFRpbWUgPiBtQ3VycmVudFRvdWNoSW50ZXJ2YWwpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1MYXN0U2VudFRvdWNoVGltZSA9IGV2ZW50VGltZTsKICAgICAgICAgICAgICAgICAgICAgVG91Y2hFdmVudERhdGEgdGVkID0gbmV3IFRvdWNoRXZlbnREYXRhKCk7CiAgICAgICAgICAgICAgICAgICAgIHRlZC5tQWN0aW9uID0gYWN0aW9uOwotICAgICAgICAgICAgICAgICAgICB0ZWQubVggPSBjb250ZW50WDsKLSAgICAgICAgICAgICAgICAgICAgdGVkLm1ZID0gY29udGVudFk7CisgICAgICAgICAgICAgICAgICAgIHRlZC5tUG9pbnRzID0gbmV3IFBvaW50WzFdOworICAgICAgICAgICAgICAgICAgICB0ZWQubVBvaW50c1swXSA9IG5ldyBQb2ludChjb250ZW50WCwgY29udGVudFkpOwogICAgICAgICAgICAgICAgICAgICB0ZWQubU1ldGFTdGF0ZSA9IGV2LmdldE1ldGFTdGF0ZSgpOwogICAgICAgICAgICAgICAgICAgICB0ZWQubVJlcHJvY2VzcyA9IG1EZWZlclRvdWNoUHJvY2VzczsKKyAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOworICAgICAgICAgICAgICAgICAgICBtTGFzdFNlbnRUb3VjaFRpbWUgPSBldmVudFRpbWU7CiAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVmZXJUb3VjaFByb2Nlc3MpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tVmlld1ggPSB4OwotICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WSA9IHk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChmaXJzdE1vdmUgJiYgIWluRnVsbFNjcmVlbk1vZGUoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtUHJpdmF0ZUhhbmRsZXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9idGFpbk1lc3NhZ2UoUFJFVkVOVF9ERUZBVUxUX1RJTUVPVVQsCkBAIC01MzA4LDExICs1MTAwLDEzIEBACiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlICE9IFRPVUNIX0RSQUdfTU9ERSkgeworICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlICE9IFRPVUNIX0RSQUdfTU9ERSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSAhPSBUT1VDSF9EUkFHX0xBWUVSX01PREUpIHsKIAogICAgICAgICAgICAgICAgICAgICBpZiAoIW1Db25maXJtTW92ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgICAgICAgICBpZiAobVByZXZlbnREZWZhdWx0ID09IFBSRVZFTlRfREVGQVVMVF9NQVlCRV9ZRVMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtUHJldmVudERlZmF1bHQgPT0gUFJFVkVOVF9ERUZBVUxUX05PX0ZST01fVE9VQ0hfRE9XTikgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gdHJhY2sgbUxhc3RUb3VjaFRpbWUgYXMgd2UgbWF5IG5lZWQgdG8gZG8gZmxpbmcgYXQKQEAgLTUzMjIsOSArNTExNiw5IEBACiAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IGxvY2sgZHJhZ2dpbmcgdG8gb25lIGF4aXMgaWYgd2UgZG9uJ3QgaGF2ZSBhIHNjYWxlIGluIHByb2dyZXNzLgotICAgICAgICAgICAgICAgICAgICAvLyBTY2FsaW5nIGltcGxpZXMgZnJlZS1yb2FtaW5nIG1vdmVtZW50LiBOb3RlIHdlJ2xsIG9ubHkgZXZlciBnZXQgaGVyZQotICAgICAgICAgICAgICAgICAgICAvLyBpZiBtQWxsb3dQYW5BbmRTY2FsZSBpcyB0cnVlLgotICAgICAgICAgICAgICAgICAgICBpZiAobVNjYWxlRGV0ZWN0b3IgIT0gbnVsbCAmJiAhbVNjYWxlRGV0ZWN0b3IuaXNJblByb2dyZXNzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU2NhbGluZyBpbXBsaWVzIGZyZWUtcm9hbWluZyBtb3ZlbWVudC4gTm90ZSB0aGlzIGlzIG9ubHkgZXZlciBhIHF1ZXN0aW9uCisgICAgICAgICAgICAgICAgICAgIC8vIGlmIG1ab29tTWFuYWdlci5zdXBwb3J0c1BhbkR1cmluZ1pvb20oKSBpcyB0cnVlLgorICAgICAgICAgICAgICAgICAgICBpZiAoZGV0ZWN0b3IgIT0gbnVsbCAmJiAhZGV0ZWN0b3IuaXNJblByb2dyZXNzKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIGl0IHN0YXJ0cyBuZWFybHkgaG9yaXpvbnRhbCBvciB2ZXJ0aWNhbCwgZW5mb3JjZSBpdAogICAgICAgICAgICAgICAgICAgICAgICAgaW50IGF4ID0gTWF0aC5hYnMoZGVsdGFYKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGludCBheSA9IE1hdGguYWJzKGRlbHRhWSk7CkBAIC01MzQ1LDE0ICs1MTM5LDI3IEBACiAgICAgICAgICAgICAgICAgICAgIGRlbHRhWCA9IDA7CiAgICAgICAgICAgICAgICAgICAgIGRlbHRhWSA9IDA7CiAKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNraXBTY2FsZUdlc3R1cmUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0U2Nyb2xsaW5nTGF5ZXIoZ2VzdHVyZVgsIGdlc3R1cmVZKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBzdGFydERyYWcoKTsKICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBpZiAobURyYWdUcmFja2VySGFuZGxlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1EcmFnVHJhY2tlckhhbmRsZXIuZHJhZ1RvKHgsIHkpOwotICAgICAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgICAgIC8vIGRvIHBhbgorICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlICE9IFRPVUNIX0RSQUdfTEFZRVJfTU9ERSkgeworICAgICAgICAgICAgICAgICAgICBpbnQgbmV3U2Nyb2xsWCA9IHBpbkxvY1gobVNjcm9sbFggKyBkZWx0YVgpOworICAgICAgICAgICAgICAgICAgICBpbnQgbmV3RGVsdGFYID0gbmV3U2Nyb2xsWCAtIG1TY3JvbGxYOworICAgICAgICAgICAgICAgICAgICBpZiAoZGVsdGFYICE9IG5ld0RlbHRhWCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFYID0gbmV3RGVsdGFYOworICAgICAgICAgICAgICAgICAgICAgICAgZkRlbHRhWCA9IChmbG9hdCkgbmV3RGVsdGFYOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGludCBuZXdTY3JvbGxZID0gcGluTG9jWShtU2Nyb2xsWSArIGRlbHRhWSk7CisgICAgICAgICAgICAgICAgICAgIGludCBuZXdEZWx0YVkgPSBuZXdTY3JvbGxZIC0gbVNjcm9sbFk7CisgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVkgIT0gbmV3RGVsdGFZKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YVkgPSBuZXdEZWx0YVk7CisgICAgICAgICAgICAgICAgICAgICAgICBmRGVsdGFZID0gKGZsb2F0KSBuZXdEZWx0YVk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYm9vbGVhbiBkb25lID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgYm9vbGVhbiBrZWVwU2Nyb2xsQmFyc1Zpc2libGUgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMoZkRlbHRhWCkgPCAxLjBmICYmIE1hdGguYWJzKGZEZWx0YVkpIDwgMS4wZikgewpAQCAtNTQxOSw3ICs1MjI2LDkgQEAKIAogICAgICAgICAgICAgICAgIGRvRHJhZyhkZWx0YVgsIGRlbHRhWSk7CiAKLSAgICAgICAgICAgICAgICBpZiAoa2VlcFNjcm9sbEJhcnNWaXNpYmxlKSB7CisgICAgICAgICAgICAgICAgLy8gVHVybiBvZmYgc2Nyb2xsYmFycyB3aGVuIGRyYWdnaW5nIGEgbGF5ZXIuCisgICAgICAgICAgICAgICAgaWYgKGtlZXBTY3JvbGxCYXJzVmlzaWJsZSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSAhPSBUT1VDSF9EUkFHX0xBWUVSX01PREUpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKG1IZWxkTW90aW9ubGVzcyAhPSBNT1RJT05MRVNTX1RSVUUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWxkTW90aW9ubGVzcyA9IE1PVElPTkxFU1NfVFJVRTsKICAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKQEAgLTU0MzQsMTggKzUyNDMsMTUgQEAKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1VQOiB7CisgICAgICAgICAgICAgICAgaWYgKCFpc0ZvY3VzZWQoKSkgcmVxdWVzdEZvY3VzKCk7CiAgICAgICAgICAgICAgICAgLy8gcGFzcyB0aGUgdG91Y2ggZXZlbnRzIGZyb20gVUkgdGhyZWFkIHRvIFdlYkNvcmUgdGhyZWFkCiAgICAgICAgICAgICAgICAgaWYgKHNob3VsZEZvcndhcmRUb3VjaEV2ZW50KCkpIHsKICAgICAgICAgICAgICAgICAgICAgVG91Y2hFdmVudERhdGEgdGVkID0gbmV3IFRvdWNoRXZlbnREYXRhKCk7CiAgICAgICAgICAgICAgICAgICAgIHRlZC5tQWN0aW9uID0gYWN0aW9uOwotICAgICAgICAgICAgICAgICAgICB0ZWQubVggPSBjb250ZW50WDsKLSAgICAgICAgICAgICAgICAgICAgdGVkLm1ZID0gY29udGVudFk7CisgICAgICAgICAgICAgICAgICAgIHRlZC5tUG9pbnRzID0gbmV3IFBvaW50WzFdOworICAgICAgICAgICAgICAgICAgICB0ZWQubVBvaW50c1swXSA9IG5ldyBQb2ludChjb250ZW50WCwgY29udGVudFkpOwogICAgICAgICAgICAgICAgICAgICB0ZWQubU1ldGFTdGF0ZSA9IGV2LmdldE1ldGFTdGF0ZSgpOwogICAgICAgICAgICAgICAgICAgICB0ZWQubVJlcHJvY2VzcyA9IG1EZWZlclRvdWNoUHJvY2VzczsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1EZWZlclRvdWNoUHJvY2VzcykgewotICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WCA9IHg7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdZID0geTsKLSAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hVcFRpbWUgPSBldmVudFRpbWU7CkBAIC01NDU2LDE3ICs1MjYyLDEzIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5GdWxsU2NyZWVuTW9kZSgpIHx8IG1EZWZlclRvdWNoUHJvY2VzcykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoRXZlbnREYXRhIHRlZCA9IG5ldyBUb3VjaEV2ZW50RGF0YSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tQWN0aW9uID0gV2ViVmlld0NvcmUuQUNUSU9OX0RPVUJMRVRBUDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVggPSBjb250ZW50WDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVkgPSBjb250ZW50WTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVBvaW50cyA9IG5ldyBQb2ludFsxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVBvaW50c1swXSA9IG5ldyBQb2ludChjb250ZW50WCwgY29udGVudFkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tTWV0YVN0YXRlID0gZXYuZ2V0TWV0YVN0YXRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1SZXByb2Nlc3MgPSBtRGVmZXJUb3VjaFByb2Nlc3M7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1EZWZlclRvdWNoUHJvY2VzcykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdYID0geDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WSA9IHk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5UT1VDSF9FVkVOVCwgdGVkKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVByZXZlbnREZWZhdWx0ICE9IFBSRVZFTlRfREVGQVVMVF9ZRVMpewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvRG91YmxlVGFwKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21NYW5hZ2VyLmhhbmRsZURvdWJsZVRhcChtTGFzdFRvdWNoWCwgbUxhc3RUb3VjaFkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9ET05FX01PREU7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTU0ODEsOSArNTI4MywxNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtUHJldmVudERlZmF1bHQgIT0gUFJFVkVOVF9ERUZBVUxUX1lFUwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKGNvbXB1dGVNYXhTY3JvbGxYKCkgPiAwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGNvbXB1dGVNYXhTY3JvbGxZKCkgPiAwKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBVSSB0YWtlcyBjb250cm9sIGJhY2ssIGNhbmNlbCBXZWJDb3JlIHRvdWNoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbmNlbFdlYkNvcmVUb3VjaEV2ZW50KGNvbnRlbnRYLCBjb250ZW50WSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHVzZXIgaGFzIHBlcmZvcm1lZCBhIHZlcnkgcXVpY2sgdG91Y2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2VxdWVuY2UgaXQgaXMgcG9zc2libGUgdGhhdCB3ZSBtYXkgZ2V0IGhlcmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmVmb3JlIFdlYkNvcmUgaGFzIGhhZCBhIGNoYW5jZSB0byBwcm9jZXNzIHRoZSBldmVudHMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluIHRoaXMgY2FzZSwgYW55IGNhbGwgdG8gcHJldmVudERlZmF1bHQgaW4gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEpTIHRvdWNoIGhhbmRsZXIgd2lsbCBub3QgaGF2ZSBiZWVuIGV4ZWN1dGVkIHlldC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSGVuY2Ugd2Ugd2lsbCBzZWUgYm90aCB0aGUgVUkgKG5vdykgYW5kIFdlYkNvcmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gKHdoZW4gY29udGV4dCBzd2l0Y2hlcykgaGFuZGxpbmcgdGhlIGV2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZWdhcmRsZXNzIG9mIHdoZXRoZXIgdGhlIHdlYiBkZXZlbG9wZXIgYWN0dWFsbHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9lc2VzIHByZXZlbnREZWZhdWx0IGluIHRoZWlyIHRvdWNoIGhhbmRsZXIuIFRoaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgdGhlIG5hdHVyZSBvZiBvdXIgYXN5bmNocm9ub3VzIHRvdWNoIG1vZGVsLgorCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIHdpbGwgbm90IHJld3JpdGUgZHJhZyBjb2RlIGhlcmUsIGJ1dCB3ZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aWxsIHRyeSBmbGluZyBpZiBpdCBhcHBsaWVzLgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3Q29yZS5yZWR1Y2VQcmlvcml0eSgpOwpAQCAtNTUwMSwxMyArNTMxMSwxNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1TZWxlY3RpbmdUZXh0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuYXRpdmVIaXRTZWxlY3Rpb24oY29udGVudFgsIGNvbnRlbnRZKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29weVNlbGVjdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0YXBwaW5nIG9uIHNlbGVjdGlvbiBvciBjb250cm9scyBkb2VzIG5vdGhpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFuYXRpdmVIaXRTZWxlY3Rpb24oY29udGVudFgsIGNvbnRlbnRZKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uRG9uZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbkRvbmUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0lOSVRfTU9ERSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgdHJpZ2dlciBkb3VibGUgdGFwIGlmIHRoZSBXZWJWaWV3IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2NhbGFibGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9JTklUX01PREUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChjYW5ab29tSW4oKSB8fCBjYW5ab29tT3V0KCkpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlRGVsYXllZCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUxFQVNFX1NJTkdMRV9UQVAsIFZpZXdDb25maWd1cmF0aW9uCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0RG91YmxlVGFwVGltZW91dCgpKTsKQEAgLTU1MzYsMTggKzUzNDksMTMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVsZE1vdGlvbmxlc3MgPSBNT1RJT05MRVNTX0lHTk9SRTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb0ZsaW5nKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU2Nyb2xsZXIuc3ByaW5nQmFjayhtU2Nyb2xsWCwgbVNjcm9sbFksIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlTWF4U2Nyb2xsWCgpLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcHV0ZU1heFNjcm9sbFkoKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlZHJhdyBpbiBoaWdoLXF1YWxpdHksIGFzIHdlJ3JlIGRvbmUgZHJhZ2dpbmcKICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWxkTW90aW9ubGVzcyA9IE1PVElPTkxFU1NfVFJVRTsKICAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaAogICAgICAgICAgICAgICAgICAgICBjYXNlIFRPVUNIX0RSQUdfU1RBUlRfTU9ERToKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUT1VDSF9EUkFHX0xBWUVSX01PREU6CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT1VDSF9EUkFHX1NUQVJUX01PREUgc2hvdWxkIG5vdCBoYXBwZW4gZm9yIHRoZSByZWFsCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkZXZpY2UgYXMgd2UgYWxtb3N0IGNlcnRhaW4gd2lsbCBnZXQgYSBNT1ZFLiBCdXQgdGhpcwogICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgcG9zc2libGUgb24gZW11bGF0b3IuCkBAIC01NTYxLDggKzUzNjksNiBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fQ0FOQ0VMOiB7CiAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfRFJBR19NT0RFKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1TY3JvbGxlci5zcHJpbmdCYWNrKG1TY3JvbGxYLCBtU2Nyb2xsWSwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlTWF4U2Nyb2xsWCgpLCAwLCBjb21wdXRlTWF4U2Nyb2xsWSgpKTsKICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBjYW5jZWxXZWJDb3JlVG91Y2hFdmVudChjb250ZW50WCwgY29udGVudFksIGZhbHNlKTsKQEAg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GxlciA9IG5ldyBEcmFnVHJhY2tlckhhbmRsZXIoeCwgeSwgbURyYWdUcmFja2VyKTsKLSAgICAgICAgfQogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBzdGFydERyYWcoKSB7CkBAIC01NjA2LDY0ICs1NDI3LDI5IEBACiAgICAgICAgIGlmICghbURyYWdGcm9tVGV4dElucHV0KSB7CiAgICAgICAgICAgICBuYXRpdmVIaWRlQ3Vyc29yKCk7CiAgICAgICAgIH0KLSAgICAgICAgV2ViU2V0dGluZ3Mgc2V0dGluZ3MgPSBnZXRTZXR0aW5ncygpOwotICAgICAgICBpZiAoc2V0dGluZ3Muc3VwcG9ydFpvb20oKQotICAgICAgICAgICAgICAgICYmIHNldHRpbmdzLmdldEJ1aWx0SW5ab29tQ29udHJvbHMoKQotICAgICAgICAgICAgICAgICYmICFnZXRab29tQnV0dG9uc0NvbnRyb2xsZXIoKS5pc1Zpc2libGUoKQotICAgICAgICAgICAgICAgICYmIG1NaW5ab29tU2NhbGUgPCBtTWF4Wm9vbVNjYWxlCi0gICAgICAgICAgICAgICAgJiYgKG1Ib3Jpem9udGFsU2Nyb2xsQmFyTW9kZSAhPSBTQ1JPTExCQVJfQUxXQVlTT0ZGCi0gICAgICAgICAgICAgICAgICAgICAgICB8fCBtVmVydGljYWxTY3JvbGxCYXJNb2RlICE9IFNDUk9MTEJBUl9BTFdBWVNPRkYpKSB7Ci0gICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLnNldFZpc2libGUodHJ1ZSk7Ci0gICAgICAgICAgICBpbnQgY291bnQgPSBzZXR0aW5ncy5nZXREb3VibGVUYXBUb2FzdENvdW50KCk7Ci0gICAgICAgICAgICBpZiAobUluWm9vbU92ZXJ2aWV3ICYmIGNvdW50ID4gMCkgewotICAgICAgICAgICAgICAgIHNldHRpbmdzLnNldERvdWJsZVRhcFRvYXN0Q291bnQoLS1jb3VudCk7Ci0gICAgICAgICAgICAgICAgVG9hc3QubWFrZVRleHQobUNvbnRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5kb3VibGVfdGFwX3RvYXN0LAotICAgICAgICAgICAgICAgICAgICAgICAgVG9hc3QuTEVOR1RIX0xPTkcpLnNob3coKTsKLSAgICAgICAgICAgIH0KKworICAgICAgICBpZiAobUhvcml6b250YWxTY3JvbGxCYXJNb2RlICE9IFNDUk9MTEJBUl9BTFdBWVNPRkYKKyAgICAgICAgICAgICAgICB8fCBtVmVydGljYWxTY3JvbGxCYXJNb2RlICE9IFNDUk9MTEJBUl9BTFdBWVNPRkYpIHsKKyAgICAgICAgICAgIG1ab29tTWFuYWdlci5pbnZva2Vab29tUGlja2VyKCk7CiAgICAgICAgIH0KICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgZG9EcmFnKGludCBkZWx0YVgsIGludCBkZWx0YVkpIHsKICAgICAgICAgaWYgKChkZWx0YVggfCBkZWx0YVkpICE9IDApIHsKLSAgICAgICAgICAgIGZpbmFsIGludCBvbGRYID0gbVNjcm9sbFg7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgb2xkWSA9IG1TY3JvbGxZOwotICAgICAgICAgICAgZmluYWwgaW50IHJhbmdlWCA9IGNvbXB1dGVNYXhTY3JvbGxYKCk7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgcmFuZ2VZID0gY29tcHV0ZU1heFNjcm9sbFkoKTsKLQotICAgICAgICAgICAgaWYgKG1FZGdlR2xvd1RvcCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgLy8gU2F2ZSB0aGUgZGVsdGFzIGZvciBvdmVyc2Nyb2xsIGdsb3cuCi0gICAgICAgICAgICAgICAgbU92ZXJzY3JvbGxEZWx0YVggPSBkZWx0YVg7Ci0gICAgICAgICAgICAgICAgbU92ZXJzY3JvbGxEZWx0YVkgPSBkZWx0YVk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG92ZXJTY3JvbGxCeShkZWx0YVgsIGRlbHRhWSwgb2xkWCwgb2xkWSwKLSAgICAgICAgICAgICAgICAgICAgcmFuZ2VYLCByYW5nZVksCi0gICAgICAgICAgICAgICAgICAgIG1PdmVyc2Nyb2xsRGlzdGFuY2UsIG1PdmVyc2Nyb2xsRGlzdGFuY2UsIHRydWUpOwotICAgICAgICAgICAgaWYgKG1FZGdlR2xvd1RvcCAhPSBudWxsICYmCi0gICAgICAgICAgICAgICAgICAgICghbUVkZ2VHbG93VG9wLmlzRmluaXNoZWQoKSB8fCAhbUVkZ2VHbG93Qm90dG9tLmlzRmluaXNoZWQoKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICFtRWRnZUdsb3dMZWZ0LmlzRmluaXNoZWQoKSB8fCAhbUVkZ2VHbG93UmlnaHQuaXNGaW5pc2hlZCgpKSkgewotICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoIWdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpKSB7Ci0gICAgICAgICAgICBib29sZWFuIHNob3dQbHVzTWludXMgPSBtTWluWm9vbVNjYWxlIDwgbU1heFpvb21TY2FsZTsKLSAgICAgICAgICAgIGlmIChtWm9vbUNvbnRyb2xzICE9IG51bGwgJiYgc2hvd1BsdXNNaW51cykgewotICAgICAgICAgICAgICAgIGlmIChtWm9vbUNvbnRyb2xzLmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LlZJU0lCTEUpIHsKLSAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVpvb21Db250cm9scy5zaG93KHNob3dQbHVzTWludXMsIGZhbHNlKTsKKyAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0RSQUdfTEFZRVJfTU9ERSkgeworICAgICAgICAgICAgICAgIGRlbHRhWCA9IHZpZXdUb0NvbnRlbnREaW1lbnNpb24oZGVsdGFYKTsKKyAgICAgICAgICAgICAgICBkZWx0YVkgPSB2aWV3VG9Db250ZW50RGltZW5zaW9uKGRlbHRhWSk7CisgICAgICAgICAgICAgICAgaWYgKG5hdGl2ZVNjcm9sbExheWVyKG1TY3JvbGxpbmdMYXllciwgZGVsdGFYLCBkZWx0YVkpKSB7CisgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnBvc3REZWxheWVkKG1ab29tQ29udHJvbFJ1bm5hYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgWk9PTV9DT05UUk9MU19USU1FT1VUKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBzY3JvbGxCeShkZWx0YVgsIGRlbHRhWSk7CiAgICAgICAgIH0KKyAgICAgICAgbVpvb21NYW5hZ2VyLmtlZXBab29tUGlja2VyVmlzaWJsZSgpOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBzdG9wVG91Y2goKSB7Ci0gICAgICAgIGlmIChtRHJhZ1RyYWNrZXJIYW5kbGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgIG1EcmFnVHJhY2tlckhhbmRsZXIuc3RvcERyYWcoKTsKLSAgICAgICAgfQogICAgICAgICAvLyB3ZSBhbHNvIHVzZSBtVmVsb2NpdHlUcmFja2VyID09IG51bGwgdG8gdGVsbCB1cyB0aGF0IHdlIGFyZQogICAgICAgICAvLyBub3QgIm1vdmluZyBhcm91bmQiLCBzbyB3ZSBjYW4gdGFrZSB0aGUgc2xvd2VyL3ByZXR0aWVyCiAgICAgICAgIC8vIG1vZGUgaW4gdGhlIGRyYXdpbmcgY29kZQpAQCAtNTY3MSwyMCArNT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05FX01PREU7CiAgICAgICAgIG5hdGl2ZUhpZGVDdXJzb3IoKTsKQEAgLTU4MDYsNyArNTU3Niw4IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7IC8vIGxldCBjb21tb24gY29kZSBpbiBvbktleVVwIGF0IGl0CiAgICAgICAgIH0KLSAgICAgICAgaWYgKG1NYXBUcmFja2JhbGxUb0Fycm93S2V5cyAmJiBtU2hpZnRJc1ByZXNzZWQgPT0gZmFsc2UpIHsKKyAgICAgICAgaWYgKChtTWFwVHJhY2tiYWxsVG9BcnJvd0tleXMgJiYgbVNoaWZ0SXNQcmVzc2VkID09IGZhbHNlKSB8fAorICAgICAgICAgICAgICAgIChtQWNjZXNzaWJpbGl0eUluamVjdG9yICE9IG51bGwgfHwgbUFjY2Vzc2liaWxpdHlTY3JpcHRJbmplY3RlZCkpIHsKICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSBMb2cudihMT0dUQUcsICJvblRyYWNrYmFsbEV2ZW50IGdtYWlsIHF1aXQiKTsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQpAQCAtNTk3NCwxMSArNTc0NSwxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1UcmFja2JhbGxSZW1haW5zWD0iICsgbVRyYWNrYmFsbFJlbWFpbnNYCiAgICAgICAgICAgICAgICAgICAgICAgICArICIgbVRyYWNrYmFsbFJlbWFpbnNZPSIgKyBtVHJhY2tiYWxsUmVtYWluc1kpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1OYXRpdmVDbGFzcyAhPSAwICYmIG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgeworICAgICAgICAgICAgaWYgKG1OYXRpdmVDbGFzcyAhPSAwICYmIG5hdGl2ZVBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpKSB7CiAgICAgICAgICAgICAgICAgZm9yIChpbnQgaS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MGY7CiAgICAgICAgICAgICBpZiAoZGVsdGFSID4gY2lyY2xlICogMC45ZiB8fCBkZWx0YVIgPCBjaXJjbGUgKiAwLjFmKSB7CiAgICAgICAgICAgICAgICAgdnggKz0gY3VycmVudFZlbG9jaXR5ICogbUxhc3RWZWxYIC8gbUxhc3RWZWxvY2l0eTsKICAgICAgICAgICAgICAgICB2eSArPSBjdXJyZW50VmVsb2NpdHkgKiBtTGFzdFZlbFkgLyBtTGFzdFZlbG9jaXR5OworICAgICAgICAgICAgICAgIHZlbG9jaXR5ID0gKGZsb2F0KSBNYXRoLmh5cG90KHZ4LCB2eSk7CiAgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiZG9GbGluZyB2eD0gIiArIHZ4ICsgIiB2eT0iICsgdnkpOwogICAgICAgICAgICAgICAgIH0KQEAgLTYwNzYsNjcgKzU4NTksMTcgQEAKICAgICAgICAgICAgICAgICAgICAgKyAiIG1heFg9IiArIG1heFggKyAiIG1heFk9IiArIG1heFkKICAgICAgICAgICAgICAgICAgICAgKyAiIG1TY3JvbGxYPSIgKyBtU2Nyb2xsWCArICIgbVNjcm9sbFk9IiArIG1TY3JvbGxZKTsKICAgICAgICAgfQotCi0gICAgICAgIC8vIEFsbG93IHNsb3BweSBmbGluZ3Mgd2l0aG91dCBvdmVyc2Nyb2xsaW5nIGF0IHRoZSBlZGdlcy4KLSAgICAgICAgaWYgKChtU2Nyb2xsWCA9PSAwIHx8IG1TY3JvbGxYID09IG1heFgpICYmIE1hdGguYWJzKHZ4KSA8IE1hdGguYWJzKHZ5KSkgewotICAgICAgICAgICAgdnggPSAwOwotICAgICAgICB9Ci0gICAgICAgIGlmICgobVNjcm9sbFkgPT0gMCB8fCBtU2Nyb2xsWSA9PSBtYXhZKSAmJiBNYXRoLmFicyh2eSkgPCBNYXRoLmFicyh2eCkpIHsKLSAgICAgICAgICAgI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aHkuIFRoaXMgdmlldyB3aWxsCkBAIC02MTU2LDgxICs1ODg5LDI5IEBACiAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJUaGlzIFdlYlZpZXcgZG9lc24ndCBzdXBwb3J0IHpvb20uIik7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQotICAgICAgICBpZiAobVpvb21Db250cm9scyA9PSBudWxsKSB7Ci0gICAgICAgICAgICBtWm9vbUNvbnRyb2xzID0gY3JlYXRlWm9vbUNvbnRyb2xzKCk7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBuZWVkIHRvIGJlIHNldCB0byBWSVNJQkxFIGZpcnN0IHNvIHRoYXQgZ2V0TWVhc3VyZWRIZWlnaHQoKSBpbgotICAgICAgICAgICAgICoge0BsaW5rICNvblNpemVDaGFuZ2VkKCl9IGNhbiByZXR1cm4gdGhlIG1lYXN1cmVkIHZhbHVlIGZvciBwcm9wZXIKLSAgICAgICAgICAgICAqIGxheW91dC4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgbVpvb21Db250cm9scy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7Ci0gICAgICAgICAgICBtWm9vbUNvbnRyb2xSdW5uYWJsZSA9IG5ldyBSdW5uYWJsZSgpIHsKLSAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogRG9uJ3QgZGlzbWlzcyB0aGUgY29udHJvbHMgaWYgdGhlIHVzZXIgaGFzCi0gICAgICAgICAgICAgICAgICAgICAqIGZvY3VzIG9uIHRoZW0uIFdhaXQgYW5kIGNoZWNrIGFnYWluIGxhdGVyLgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtWm9vbUNvbnRyb2xzLmhhc0ZvY3VzKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1ab29tQ29udHJvbHMuaGlkZSgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFpPT01fQ09OVFJPTFNfVElNRU9VVCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9OwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBtWm9vbUNvbnRyb2xzOworICAgICAgICByZXR1cm4gbVpvb21NYW5hZ2VyLmdldEV4dGVybmFsWm9vbVBpY2tlcigpOwogICAgIH0KIAotICAgIHByaXZhdGUgRXh0ZW5kZWRab29tQ29udHJvbHMgY3JlYXRlWm9vbUNvbnRyb2xzKCkgewotICAgICAgICBFeHRlbmRlZFpvb21Db250cm9scyB6b29tQ29udHJvbHMgPSBuZXcgRXh0ZW5kZWRab29tQ29udHJvbHMobUNvbnRleHQKLSAgICAgICAgICAgICwgbnVsbCk7Ci0gICAgICAgIHpvb21Db250cm9scy5zZXRPblpvb21JbkNsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKLSAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7Ci0gICAgICAgICAgICAgICAgLy8gcmVzZXQgdGltZSBvdXQKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBaT09NX0NPTlRST0xTX1RJTUVPVVQpOwotICAgICAgICAgICAgICAgIHpvb21JbigpOwotICAgICAgICAgICAgfQotICAgICAgICB9KTsKLSAgICAgICAgem9vbUNvbnRyb2xzLnNldE9uWm9vbU91dENsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKLSAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7Ci0gICAgICAgICAgICAgICAgLy8gcmVzZXQgdGltZSBvdXQKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBaT09NX0NPTlRST0xTX1RJTUVPVVQpOwotICAgICAgICAgICAgICAgIHpvb21PdXQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSk7Ci0gICAgICAgIHJldHVybiB6b29tQ29udHJvbHM7CisgICAgdm9pZCBkaXNtaXNzWm9vbUNvbnRyb2woKSB7CisgICAgICAgIG1ab29tTWFuYWdlci5kaXNtaXNzWm9vbVBpY2tlcigpOworICAgIH0KKworICAgIGZsb2F0IGdldERlZmF1bHRab29tU2NhbGUoKSB7CisgICAgICAgIHJldHVybiBtWm9vbU1hbmFnZXIuZ2V0RGVmYXVsdFNjYWxlKCk7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogR2V0cyB0aGUge0BsaW5rIFpvb21CdXR0b25zQ29udHJvbGxlcn0gd2hpY2ggY2FuIGJlIHVzZWQgdG8gYWRkCi0gICAgICogYWRkaXRpb25hbCBidXR0b25zIHRvIHRoZSB6b29tIGNvbnRyb2xzIHdpbmRvdy4KLSAgICAgKgotICAgICAqIEByZXR1cm4gVGhlIGluc3R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gICAgIEZyYW1lTGF5b3V0LkxheW91dFBhcmFtcyBmcmFtZVBhcmFtcyA9IChGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMpIHBhcmFtczsKLSAgICAgICAgICAgICAgICBmcmFtZVBhcmFtcy5ncmF2aXR5ID0gR3Jhdml0eS5SSUdIVDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gbVpvb21CdXR0b25zQ29udHJvbGxlcjsKKyAgICBwdWJsaWMgYm9vbGVhbiBjYW5ab29tSW4oKSB7CisgICAgICAgIHJldHVybiBtWm9vbU1hbmFnZXIuY2FuWm9vbUluKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUUlVFIGlmIHRoZSBXZWJWaWV3IGNhbiBiZSB6b29tZWQgb3V0LgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGNhblpvb21PdXQoKSB7CisgICAgICAgIHJldHVybiBtWm9vbU1hbmFnZXIuY2FuWm9vbU91dCgpOwogICAgIH0KIAogICAgIC8qKgpAQCAtNjIzOCwxNSArNTkxOSw3IEBACiAgICAgICogQHJldHVybiBUUlVFIGlmIHpvb20gaW4gc3VjY2VlZHMuIEZBTFNFIGlmIG5vIHpvb20gY2hhbmdlcy4KICAgICAgKi8KICAgICBwdWJsaWMgYm9vbGVhbiB6b29tSW4oKSB7Ci0gICAgICAgIC8vIFRPRE86IGFsdGVybmF0aXZlbHkgd2UgY2FuIGRpc2FsbG93IHRoaXMgZHVyaW5nIGRyYXcgaGlzdG9yeSBtb2RlCi0gICAgICAgIHN3aXRjaE91dERyYXdIaXN0b3J5KCk7Ci0gICAgICAgIG1Jblpvb21PdmVydmlldyA9IGZhbHNlOwotICAgICAgICAvLyBDZW50ZXIgem9vbWluZyB0byB0aGUgY2VudGVyIG9mIHRoZSBzY3JlZW4uCi0gICAgICAgIG1ab29tQ2VudGVyWCA9IGdldFZpZXdXaWR0aCgpICogLjVmOwotICAgICAgICBtWm9vbUNlbnRl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dNYW5hZ2VyLkNoaWxkVmlldyB2aWV3KSB7Ci0gICAgICAgIGludCB2aWV3V2lkdGggPSBnZXRWaWV3V2lkdGgoKTsKLSAgICAgICAgaW50IHZpZXdIZWlnaHQgPSBnZXRWaWV3SGVpZ2h0V2l0aFRpdGxlKCk7Ci0gICAgICAgIGZsb2F0IHNjYWxlID0gTWF0aC5taW4oKGZsb2F0KSB2aWV3V2lkdGggLyB2aWV3LndpZHRoLAotICAgICAgICAgICAgICAgIChmbG9hdCkgdmlld0hlaWdodCAvIHZpZXcuaGVpZ2h0KTsKLSAgICAgICAgaWYgKHNjYWxlIDwgbU1pblpvb21TY2FsZSkgewotICAgICAgICAgICAgc2NhbGUgPSBtTWluWm9vbVNjYWxlOwotICAgICAgICB9IGVsc2UgaWYgKHNjYWxlID4gbU1heFpvb21TY2FsZSkgewotICAgICAgICAgICAgc2NhbGUgPSBtTWF4Wm9vbVNjYWxlOwotICAgICAgICB9Ci0gICAgICAgIGlmIChNYXRoLmFicyhzY2FsZSAtIG1BY3R1YWxTY2FsZSkgPCBNSU5JTVVNX1NDQUxFX0lOQ1JFTUVOVCkgewotICAgICAgICAgICAgaWYgKGNvbnRlbnRUb1ZpZXdYKHZpZXcueCkgPj0gbVNjcm9sbFgKLSAgICAgICAgICAgICAgICAgICAgJiYgY29udGVudFRvVmlld1godmlldy54ICsgdmlldy53aWR0aCkgPD0gbVNjcm9sbFgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHZpZXdXaWR0aAotICAgICAgICAgICAgICAgICAgICAmJiBjb250ZW50VG9WaWV3WSh2aWV3LnkpID49IG1TY3JvbGxZCi0gICAgICAgICAgICAgICAgICAgICYmIGNvbnRlbnRUb1ZpZXdZKHZpZXcueSArIHZpZXcuaGVpZ2h0KSA8PSBtU2Nyb2xsWQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdmlld0hlaWdodCkgewotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQot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0dWFsU2NhbGUgKyBnZXRUaXRsZUhlaWdodCgpCisgICAgICAgICAgICBmbG9hdCB6b29tQ2VudGVyWCA9IChvbGRTY3JlZW5YICogc2NhbGUgLSBuZXdTY3JlZW5YICogYWN0dWFsU2NhbGUpCisgICAgICAgICAgICAgICAgICAgIC8gKHNjYWxlIC0gYWN0dWFsU2NhbGUpOworICAgICAgICAgICAgZmxvYXQgb2xkU2NyZWVuWSA9IGRvY1kgKiBhY3R1YWxTY2FsZSArIGdldFRpdGxlSGVpZ2h0KCkKICAgICAgICAgICAgICAgICAgICAgLSBtU2Nyb2xsWTsKICAgICAgICAgICAgIGZsb2F0IHJlY3RWaWV3WSA9IGRvY1kgKiBzY2FsZSArIGdldFRpdGxlSGVpZ2h0KCk7CiAgICAgICAgICAgICBmbG9hdCByZWN0Vmlld0hlaWdodCA9IGRvY0hlaWdodCAqIHNjYWxlOwpAQCAtNjQ1OSwxMDkgKzYxMTgsMTAgQEAKICAgICAgICAgICAgIH0gZWxzZSBpZiAobmV3U2NyZWVuWSA+IChuZXdNYXhIZWlnaHQgLSByZWN0Vmlld1kgLSByZWN0Vmlld0hlaWdodCkpIHsKICAgICAgICAgICAgICAgICBuZXdTY3JlZW5ZID0gdmlld0hlaWdodCAtIChuZXdNYXhIZWlnaHQgLSByZWN0Vmlld1kpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgbVpvb21DZW50ZXJZID0gKG9sZFNjcmVlblkgKiBzY2FsZSAtIG5ld1NjcmVlblkgKiBtQWN0dWFsU2NhbGUpCi0gICAgICAgICAgICAgICAgICAgIC8gKHNjYWxlIC0gbUFjdHVhbFNjYWxlKTsKLSAgICAgICAgICAgIHpvb21XaXRoUHJldmlldyhzY2FsZSwgZmFsc2UpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgdm9pZCBkaXNtaXNzWm9vbUNvbnRyb2woKSB7Ci0gICAgICAgIGlmIChtV2ViVmlld0NvcmUgPT0gbnVsbCkgewotICAgICAgICAgICAgLy8gbWF5YmUgY2FsbGVkIGFmdGVyIFdlYlZpZXcncyBkZXN0cm95KCkuIEFzIHdlIGNhbid0IGdldCBzZXR0aW5ncywKLSAgICAgICAgICAgIC8vIGp1c3QgaGlkZSB6b29tIGNvbnRyb2wgZm9yIGJvdGggc3R5bGVzLgotICAgICAgICAgICAgaWYgKG1ab29tQnV0dG9uc0NvbnRyb2xsZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuc2V0VmlzaWJsZShmYWxzZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobVpvb21Db250cm9scyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbVpvb21Db250cm9scy5oaWRlKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICAgICAgV2ViU2V0dGluZ3Mgc2V0dGluZ3MgPSBnZXRTZXR0aW5ncygpOwotICAgICAgICBpZiAoc2V0dGluZ3MuZ2V0QnVpbHRJblpvb21Db250cm9scygpKSB7Ci0gICAgICAgICAgICBpZiAobVpvb21CdXR0b25zQ29udHJvbGxlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRWaXNpYmxlKGZhbHNlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGlmIChtWm9vbUNvbnRyb2xSdW5uYWJsZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobVpvb21Db250cm9scyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbVpvb21Db250cm9scy5oaWRlKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0K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QUxFX0lOQ1JFTUVOVCkgewotICAgICAgICAgICAgICAgIHpvb21Ub0RlZmF1bHQgPSB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgem9vbVRvRGVmYXVsdCA9IHRydWU7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHpvb21Ub0RlZmF1bHQpIHsKLSAgICAgICAgICAgIG1Jblpvb21PdmVydmlldyA9IGZhbHNlOwotICAgICAgICAgICAgaW50IGxlZnQgPSBuYXRpdmVHZXRCbG9ja0xlZnRFZGdlKG1BbmNob3JYLCBtQW5jaG9yWSwgbUFjdHVhbFNjYWxlKTsKLSAgICAgICAgICAgIGlmIChsZWZ0ICE9IE5PX0xFRlRFREdFKSB7Ci0gICAgICAgICAgICAgICAgLy8gYWRkIGEgNXB0IHBhZGRpbmcgdG8gdGhlIGxlZnQgZWRnZS4KLSAgICAgICAgICAgICAgICBpbnQgdmlld0xlZnQgPSBjb250ZW50VG9WaWV3WChsZWZ0IDwgNSA/IDAgOiAobGVmdCAtIDUpKQotICAgICAgICAgICAgICAgICAgICAgICAgLSBtU2Nyb2xsWDsKLSAgICAgICAgICAgICAgICAvLyBSZS1jYWxjdWxhdGUgdGhlIHpvb20gY2VudGVyIHNvIHRoYXQgdGhlIG5ldyBzY3JvbGwgeCB3aWxsIGJlCi0gICAgICAgICAgICAgICAgLy8gb24gdGhlIGxlZnQgZWRnZS4KLSAgICAgICAgICAgICAgICBpZiAodmlld0xlZnQgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1ab29tQ2VudGVyWCA9IHZpZXdMZWZ0ICogbURlZmF1bHRTY2FsZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8gKG1EZWZhdWx0U2NhbGUgLSBtQWN0dWFsU2NhbGUpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHNjcm9sbEJ5KHZpZXdMZWZ0LCAwKTsKLSAgICAgICAgICAgICAgICAgICAgbVpvb21DZW50ZXJYID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB6b29tV2l0aFByZXZpZXcobURlZmF1bHRTY2FsZSwgdHJ1ZSk7CisgICAgICAgICAgICBmbG9hdCB6b29tQ2VudGVyWSA9IChvbGRTY3JlZW5ZICogc2NhbGUgLSBuZXdTY3JlZW5ZICogYWN0dWFsU2NhbGUpCisgICAgICAgICAgICAgICAgICAgIC8gKHNjYWxlIC0gYWN0dWFsU2NhbGUpOworICAgICAgICAgICAgbVpvb21NYW5hZ2VyLnNldFpvb21DZW50ZXIoem9vbUNlbnRlclgsIHpvb21DZW50ZXJZKTsKKyAgICAgICAgICAgIG1ab29tTWFuYWdlci5zdGFydFpvb21BbmltYXRpb24oc2NhbGUsIGZhbHNlKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtNjU3Myw2ICs2MTMzLDkgQEAKIAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIHJlcXVlc3RGb2N1cyhpbnQgZGlyZWN0aW9uLCBSZWN0IHByZXZpb3VzbHlGb2N1c2VkUmVjdCkgeworICAgICAgICAvLyBGSVhNRTogSWYgYSBzdWJ3aW5kb3cgaXMgc2hvd2luZyBmaW5kLCBhbmQgdGhlIHVzZXIgdG91Y2hlcyB0aGUKKyAgICAgICAgLy8gYmFja2dyb3VuZCB3aW5kb3csIGl0IGNhbiBzdGVhbCBmb2N1cy4KKyAgICAgICAgaWYgKG1GaW5kSXNVcCkgcmV0dXJuIGZhbHNlOwogICAgICAgICBib29sZWFuIHJlc3VsdCA9IGZhbHNlOwogICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpKSB7CiAgICAgICAgICAgICByZXN1bHQgPSBtV2ViVGV4dFZpZXcucmVxdWVzdEZvY3VzKGRpcmVjdGlvbiwKQEAgLTY2NjAsNiArNjIyMywxMiBAQAogICAgIHB1YmxpYyBib29sZWFuIHJlcXVlc3RDaGlsZFJlY3RhbmdsZU9uU2NyZWVuKFZpZXcgY2hpbGQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVjdCByZWN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaW1tZWRpYXRlKSB7CisgICAgICAgIC8vIGRvbid0IHNjcm9sbCB3aGlsZSBpbiB6b29tIGFuaW1hdGlvbi4gV2hlbiBpdCBpcyBkb25lLCB3ZSB3aWxsIGFkanVzdAorICAgICAgICAvLyB0aGUgbmVjZXNzYXJ5IGNvbXBvbmVudHMgKGUuZy4sIFdlYlRleHRWaWV3IGlmIGl0IGlzIGluIGVkaXRpbmcgbW9kZSkKKyAgICAgICAgaWYgKG1ab29tTWFuYWdlci5pc0ZpeGVkTGVuZ3RoQW5pbWF0aW9uSW5Qcm9ncmVzcygpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKwogICAgICAgICByZWN0Lm9mZnNldChjaGlsZC5nZXRMZWZ0KCkgLSBjaGlsZC5nZXRTY3JvbGxYKCksCiAgICAgICAgICAgICAgICAgY2hpbGQuZ2V0VG9wKCkgLSBjaGlsZC5nZXRTY3JvbGxZKCkpOwogCkBAIC02ODAyLDcgKzYzNzEsOCBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBjYXNlIFNXSVRDSF9UT19TSE9SVFBSRVNTOiB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0lOSVRfTU9ERSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1QcmV2ZW50RGVmYXVsdCAhPSBQUkVWRU5UX0RFRkFVTFRfWUVTKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWdldFNldHRpbmdzKCkuc3VwcG9ydFRvdWNoT25seSgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG1QcmV2ZW50RGVmYXVsdCAhPSBQUkVWRU5UX0RFRkFVTFRfWUVTKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX1NIT1JUUFJFU1NfU1RBUlRfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVTZWxlY3Rpb24oKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC02ODE2LDI2ICs2Mzg2LDI1IEBACiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBjYXNlIFNXSVRDSF9UT19MT05HUFJFU1M6IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuc3VwcG9ydFRvdWNoT25seSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVUb3VjaEhpZ2hsaWdodChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaWYgKGluRnVsbFNjcmVlbk1vZGUoKSB8fCBtRGVmZXJUb3VjaFByb2Nlc3MpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoRXZlbnREYXRhIHRlZCA9IG5ldyBUb3VjaEV2ZW50RGF0YSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1BY3Rpb24gPSBXZWJWaWV3Q29yZS5BQ1RJT05fTE9OR1BSRVNTOwotICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1YID0gdmlld1RvQ29udGVudFgoKGludCkgbUxhc3RUb3VjaFggKyBtU2Nyb2xsWCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVkgPSB2aWV3VG9Db250ZW50WSgoaW50KSBtTGFzdFRvdWNoWSArIG1TY3JvbGxZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tUG9pbnRzID0gbmV3IFBvaW50WzFdOworICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1Qb2ludHNbMF0gPSBuZXcgUG9pbnQodmlld1RvQ29udGVudFgoKGludCkgbUxhc3RUb3VjaFggKyBtU2Nyb2xsWCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWV3VG9Db250ZW50WSgoaW50KSBtTGFzdFRvdWNoWSArIG1TY3JvbGxZKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBtZXRhU3RhdGUgZm9yIGxvbmcgcHJlc3MgaXMgdHJpY2t5LiBTaG91bGQgaXQgYmUgdGhlCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzdGF0ZSB3aGVuIHRoZSBwcmVzcyBzdGFydGVkIG9yIHdoZW4gdGhlIHByZXNzIHdhcwogICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVsZWFzZWQ/IE9yIHNvbWUgaW50ZXJtZWRpYXJ5IGtleSBzdGF0ZT8gRm9yCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzaW1wbGljaXR5IGZvciBub3csIHdlIGRvbid0IHNldCBpdC4KICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tTWV0YVN0YXRlID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tUmVwcm9jZXNzID0gbURlZmVyVG91Y2hQcm9jZXNzOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1EZWZlclRvdWNoUHJvY2VzcykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tVmlld1ggPSBtTGFzdFRvdWNoWDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdZID0gbUxhc3RUb3VjaFk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVByZXZlbnREZWZhdWx0ICE9IFBSRVZFTlRfREVGQVVMVF9ZRVMpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9ET05FX01PREU7CiAgICAgICAgICAgICAgICAgICAgICAgICBwZXJmb3JtTG9uZ0NsaWNrKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZWJ1aWxkV2ViVGV4dFZpZXcoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CkBAIC02ODY4LDExNiArNjQzNyw2MyBAQAogICAgICAgICAgICAgICAgICAgICBzcGF3bkNvbnRlbnRTY3JvbGxUbyhtc2cuYXJnMSwgbXNnLmFyZzIpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFVQREFURV9aT09NX1JBTkdFOiB7Ci0gICAgICAgICAgICAgICAgICAgIFdlYlZpZXdDb3JlLlJlc3RvcmVTdGF0ZSByZXN0b3JlU3RhdGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IChXZWJWaWV3Q29yZS5SZXN0b3JlU3RhdGUpIG1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgIFdlYlZpZXdDb3JlLlZpZXdTdGF0ZSB2aWV3U3RhdGUgPSAoV2ViVmlld0NvcmUuVmlld1N0YXRlKSBtc2cub2JqOwogICAgICAgICAgICAgICAgICAgICAvLyBtU2Nyb2xsWCBjb250YWlucyB0aGUgbmV3IG1pblByZWZXaWR0aAotICAgICAgICAgICAgICAgICAgICB1cGRhdGVab29tUmFuZ2UocmVzdG9yZVN0YXRlLCBnZXRWaWV3V2lkdGgoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN0b3JlU3RhdGUubVNjcm9sbFgsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgbVpvb21NYW5hZ2VyLnVwZGF0ZVpvb21SYW5nZSh2aWV3U3RhdGUsIGdldFZpZXdXaWR0aCgpLCB2aWV3U3RhdGUubVNjcm9sbFgpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSBSRVBMQUNFX0JBU0VfQ09OVEVOVDogeworICAgICAgICAgICAgICAgICAgICBuYXRpdmVSZXBsYWNlQmFzZUNvbnRlbnQobXNnLmFyZzEpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgY2FzZSBORVdfUElDVFVSRV9NU0dfSUQ6IHsKLSAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UndmUgcHJldmlvdXNseSBkZWxheWVkIGRlbGV0aW5nIGEgcm9vdAotICAgICAgICAgICAgICAgICAgICAvLyBsYXllciwgZG8gaXQgbm93LgotICAgICAgICAgICAgICAgICAgICBpZiAobURlbGF5ZWREZWxldGVSb290TGF5ZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1EZWxheWVkRGVsZXRlUm9vdExheWVyID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVTZXRSb290TGF5ZXIoMCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgV2ViU2V0dGluZ3Mgc2V0dGluZ3MgPSBtV2ViVmlld0NvcmUuZ2V0U2V0dGluZ3MoKTsKICAgICAgICAgICAgICAgICAgICAgLy8gY2FsbGVkIGZvciBuZXcgY29udGVudAotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdmlld1dpZHRoID0gZ2V0Vmlld1dpZHRoKCk7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIFdlYlZpZXdDb3JlLkRyYXdEYXRhIGRyYXcgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXZWJWaWV3Q29yZS5EcmF3RGF0YSkgbX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c1BpY3R1cmVBZnRlckZpcnN0TGF5b3V0ID0gdmlld1N0YXRlICE9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIGlmIChpc1BpY3R1cmVBZnRlckZpcnN0TGF5b3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBSZXNldCB0aGUgbGFzdCBzZW50IGRhdGEgaGVyZSBzaW5jZSBkZWFsaW5nIHdpdGggbmV3IHBhZ2UuCisgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFdpZHRoU2VudCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBtWm9vbU1hbmFnZXIub25GaXJzdExheW91dChkcmF3KTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbURyYXdIaXN0b3J5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gZmFsc2U7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUluaXRpYWxTY2FsZUluUGVyY2VudCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0TmV3Wm9vbVNjYWxlKG1Jbml0aWFsU2NhbGVJblBlcmNlbnQgLyAxMDAuMGYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW5pdGlhbFNjYWxlSW5QZXJjZW50ICE9IG1UZXh0V3JhcFNjYWxlICogMTAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzdG9yZVN0YXRlLm1WaWV3U2NhbGUgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXh0V3JhcFNjYWxlID0gcmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXROZXdab29tU2NhbGUocmVzdG9yZVN0YXRlLm1WaWV3U2NhbGUsIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Jblpvb21PdmVydmlldyA9IHVzZVdpZGVWaWV3cG9ydAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc2V0dGluZ3MuZ2V0TG9hZFdpdGhPdmVydmlld01vZGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgc2NhbGU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtSW5ab29tT3ZlcnZpZXcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gKGZsb2F0KSB2aWV3V2lkdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIERFRkFVTFRfVklFV1BPUlRfV0lEVEg7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZSA9IHJlc3RvcmVTdGF0ZS5tVGV4dFdyYXBTY2FsZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXROZXdab29tU2NhbGUoc2NhbGUsIE1hdGguYWJzKHNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1UZXh0V3JhcFNjYWxlKSA+PSBNSU5JTVVNX1NDQUxFX0lOQ1JFTUVOVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0Q29udGVudFNjcm9sbFRvKHJlc3RvcmVTdGF0ZS5tU2Nyb2xsWCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdG9yZVN0YXRlLm1TY3JvbGxZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRDb250ZW50U2Nyb2xsVG8odmlld1N0YXRlLm1TY3JvbGxYLCB2aWV3U3RhdGUubVNjcm9sbFkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFzIHdlIGFyZSBvbiBhIG5ldyBwYWdlLCByZW1vdmUgdGhlIFdlYlRleHRWaWV3LiBUaGlzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgbmVjZXNzYXJ5IGZvciBwYWdlIGxvYWRzIGRyaXZlbiBieSB3ZWJraXQsIGFuZCBpbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHBhcnRpY3VsYXIgd2hlbiB0aGUgdXNlciB3YXMgb24gYSBwYXNzd29yZCBmaWVsZCwgc28KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgV2ViVGV4dFZpZXcgd2FzIHZpc2libGUuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJUZXh0RW50cnkoZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgem9vbSBidXR0b25zIGFzIHRoZSBzY2FsZSBjYW4gYmUgY2hhbmdlZAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnZXRTZXR0aW5ncygpLmdldEJ1aWx0SW5ab29tQ29udHJvbHMoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVab29tQnV0dG9uc0VuYWJsZWQoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJUZXh0RW50cnkoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgICAgIC8vIFdlIHVwZGF0ZSB0aGUgbGF5b3V0IChpLmUuIHJlcXVlc3QgYSBsYXlvdXQgZnJvbSB0aGUKICAgICAgICAgICAgICAgICAgICAgLy8gdmlldyBzeXN0ZW0pIGlmIHRoZSBsYXN0IHZpZXcgc2l6ZSB0aGF0IHdlIHNlbnQgdG8KICAgICAgICAgICAgICAgICAgICAgLy8gV2ViQ29yZSBtYXRjaGVzIHRoZSB2aWV3IHNpemUgb2YgdGhlIHBpY3R1cmUgd2UganVzdAogICAgICAgICAgICAgICAgICAgICAvLyByZWNlaXZlZCBpbiB0aGUgZml4ZWQgZGltZW5zaW9uLgogICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHVwZGF0ZUxheW91dCA9IHZpZXdTaXplLnggPT0gbUxhc3RXaWR0aFNlbnQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2aWV3U2l6ZS55ID09IG1MYXN0SGVpZ2h0U2VudDsKLSAgICAgICAgICAgICAgICAgICAgcmVjb3JkTmV3Q29udGVudFNpemUoZHJhdy5tV2lkdGhIZWlnaHQueCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Lm1XaWR0aEhlaWdodC55Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAobUZpbmRJc1VwID8gbUZpbmRIZWlnaHQgOiAwKSwgdXBkYXRlTGF5b3V0KTsKKyAgICAgICAgICAgICAgICAgICAgcmVjb3JkTmV3Q29udGVudFNpemUoZHJhdy5tQ29udGVudFNpemUueCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Lm1Db250ZW50U2l6ZS55LCB1cGRhdGVMYXlvdXQpOwogICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgICAgICAgICAgICAgUmVjdCBiID0gZHJhdy5tSW52YWxSZWdpb24uZ2V0Qm91bmRzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJORVdfUElDVFVSRV9NU0dfSUQgeyIgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLmxlZnQrIiwiK2IudG9wKyIsIitiLnJpZ2h0KyIsIitiLmJvdHRvbSsifSIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGVDb250ZW50UmVjdChkcmF3Lm1JbnZhbFJlZ2lvbi5nZXRCb3VuZHMoKSk7CisKICAgICAgICAgICAgICAgICAgICAgaWYgKG1QaWN0dXJlTGlzdGVuZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVBpY3R1cmVMaXN0ZW5lci5vbk5ld1BpY3R1cmUoV2ViVmlldy50aGlzLCBjYXB0dXJlUGljdHVyZSgpKTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAodXNlV2lkZVZpZXdwb3J0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBsaW1pdCBtWm9vbU92ZXJ2aWV3V2lkdGggdXBwZXIgYm91bmQgdG8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNNYXhWaWV3cG9ydFdpZHRoIHNvIHRoYXQgaWYgdGhlIHBhZ2UgZG9lc24ndCBiZWhhdmUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlbGwsIHRoZSBXZWJWaWV3IHdvbid0IGdvIGluc2FuZS4gbGltaXQgdGhlIGxvd2VyCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBib3VuZCB0byBtYXRjaCB0aGUgZGVmYXVsdCBzY2FsZSBmb3IgbW9iaWxlIHNpdGVzLgotICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21PdmVydmlld1dpZHRoID0gTWF0aC5taW4oc01heFZpZXdwb3J0V2lkdGgsIE1hdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1heCgoaW50KSAodmlld1dpZHRoIC8gbURlZmF1bHRTY2FsZSksIE1hdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWF4KGRyYXcubU1pblByZWZXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXcubVZpZXdQb2ludC54KSkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbU1pblpvb21TY2FsZUZpeGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gKGZsb2F0KSB2aWV3V2lkdGggLyBtWm9vbU92ZXJ2aWV3V2lkdGg7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtRHJhd0hpc3RvcnkgJiYgbUluWm9vbU92ZXJ2aWV3KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmaXQgdGhlIGNvbnRlbnQgd2lkdGggdG8gdGhlIGN1cnJlbnQgdmlldy4gSWdub3JlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgcm91bmRpbmcgZXJyb3IgY2FzZS4KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicygodmlld1dpZHRoICogbUludkFjdHVhbFNjYWxlKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1ab29tT3ZlcnZpZXdXaWR0aCkgPiAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0TmV3Wm9vbVNjYWxlKChmbG9hdCkgdmlld1dpZHRoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIG1ab29tT3ZlcnZpZXdXaWR0aCwgTWF0aC5hYnMobUFjdHVhbFNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1UZXh0V3JhcFNjYWxlKSA8IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5ULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gdXBkYXRlIHRoZSB6b29tIGluZm9ybWF0aW9uIGJhc2VkIG9uIHRoZSBuZXcgcGljdHVyZQorICAgICAgICAgICAgICAgICAgICBtWm9vbU1hbmFnZXIub25OZXdQaWN0dXJlKGRyYXcpOworCiAgICAgICAgICAgICAgICAgICAgIGlmIChkcmF3Lm1Gb2N1c1NpemVDaGFuZ2VkICYmIGluRWRpdGluZ01vZGUoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbUZvY3VzU2l6ZUNoYW5nZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChoYXNSZXN0b3JlU3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzUGljdHVyZUFmdGVyRmlyc3RMYXlvdXQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1WaWV3TWFuYWdlci5wb3N0UmVhZHlUb0RyYXdBbGwoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTcwMTEsMTYgKzY1MjcsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBSRVFVRVNUX0tFWUJPQVJEX1dJVEhfU0VMRUNUSU9OX01TR19JRDoKICAgICAgICAgICAgICAgICAgICAgZGlzcGxheVNvZnRLZXlib2FyZCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoIHRvIFVQREFURV9URVhUX1NFTEVDVElPTl9NU0dfSUQKKyAgICAgICAgICAgICAgICBjYXNlIFVQREFURV9URVhUX1NFTEVDVElPTl9NU0dfSUQ6CiAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVRleHRTZWxlY3Rpb25Gcm9tTWVzc2FnZShtc2cuYXJnMSwgbXNnLmFyZzIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdlYlZpZXdDb3JlLlRleHRTZWxlY3Rpb25EYXRhKSBtc2cub2JqKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBVUERBVEVfVEVYVF9TRUxFQ1RJT05fTVNHX0lEOgotICAgICAgICAgICAgICAgICAgICAvLyBJZiBubyB0ZXh0ZmllbGQgd2FzIGluIGZvY3VzLCBhbmQgdGhlIHVzZXIgdG91Y2hlZCBvbmUsCi0gICAgICAgICAgICAgICAgICAgIC8vIGNhdXNpbmcgaXQgdG8gc2VuZCB0aGlzIG1lc3NhZ2UsIHRoZW4gV2ViVGV4dFZpZXcgaGFzIG5vdAotICAgICAgICAgICAgICAgICAgICAvLyBiZWVuIHNldCB1cCB5ZXQuICBSZWJ1aWxkIGl0IHNvIGl0IGNhbiBzZXQgaXRzIHNlbGVjdGlvbi4KLSAgICAgICAgICAgICAgICAgICAgcmVidWlsZFdlYlRleHRWaWV3KCk7Ci0gICAgICAgICAgICAgICAgICAgIHVwZGF0ZVRleHRTZWxlY3Rpb25Gcm9tTWVzc2FnZShtc2cuYXJnMSwgbXNnLmFyZzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdlYlZpZXdDb3JlLlRleHRTZWxlY3Rpb25EYXRhKSBtc2cub2JqKTsKKyAgICAgICAgICAgICAgICBjYXNlIEZPUk1fRElEX0JMVVI6CisgICAgICAgICAgICAgICAgICAgIGlmIChpbkVkaXRpbmdNb2RlKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBtV2ViVGV4dFZpZXcuaXNTYW1lVGV4dEZpZWxkKG1zZy5hcmcxKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaGlkZVNvZnRLZXlib2FyZCgpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgUkVUVVJOX0xBQkVMOgogICAgICAgICAgICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpCkBAIC03MDM2LDIwICs2NTUyLDE5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBNT1ZFX09VVF9PRl9QTFVHSU46CisgICAgICAgICAgICAgICAgY2FzZSBVTkhBTkRMRURfTkFWX0tFWToKICAgICAgICAgICAgICAgICAgICAgbmF2SGFuZGxlZEtleShtc2cuYXJnMSwgMSwgZmFsc2UsIDApOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFVQREFURV9URVhUX0VOVFJZX01TR19JRDoKICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyBpcyBzZW50IGFmdGVyIGZpbmlzaGluZyByZXNpemUgaW4gV2ViVmlld0NvcmUuIE1ha2UKICAgICAgICAgICAgICAgICAgICAgLy8gc3VyZSB0aGUgdGV4dCBlZGl0IGJveCBpcyBzdGlsbCBvbiB0aGUgIHNjcmVlbi4KLSAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uRG9uZSgpOwogICAgICAgICAgICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpICYmIG5hdGl2ZUN1cnNvcklzVGV4dElucHV0KCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5icmluZ0ludG9WaWV3KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICByZWJ1aWxkV2ViVGV4dFZpZXcoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIENMRUFSX1RFWFRfRU5UUlk6Ci0gICAgICAgICAgICAgICAgICAgIGNsZWFyVGV4dEVudHJ5KGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgY2xlYXJUZXh0RW50cnkoKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBJTlZBTF9SRUNUX01TR19JRDogewogICAgICAgICAgICAgICAgICAgICBSZWN0IHIgPSAoUmVjdCltc2cub2JqOwpAQCAtNzA2MiwyMyArNjU3Nyw2IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgSU1NRURJQVRFX1JFUEFJTlRfTVNHX0lEOiB7Ci0gICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgU0VUX1JPT1RfTEFZRVJfTVNHX0lEOiB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgwID09IG1zZy5hcmcxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBOdWxsIGluZGljYXRlcyBkZWxldGluZyB0aGUgb2xkIGxheWVyLCBidXQKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IGFjdHVhbGx5IGRvIHNvIHVudGlsIHdlJ3ZlIGdvdCB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5ldyBwYWdlIHRvIGRpc3BsYXkuCi0gICAgICAgICAgICAgICAgICAgICAgICBtRGVsYXllZERlbGV0ZVJvb3RMYXllciA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRGVsYXllZERlbGV0ZVJvb3RMYXllciA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0Um9vdExheWVyKG1zZy5hcmcxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgY2FzZSBSRVFVRVNUX0ZPUk1fREFUQToKICAgICAgICAgICAgICAgICAgICAgQXV0b0NvbXBsZXRlQWRhcHRlciBhZGFwdGVyID0gKEF1dG9Db21wbGV0ZUFkYXB0ZXIpIG1zZy5vYmo7CiAgICAgICAgICAgICAgICAgICAgIGlmIChtV2ViVGV4dFZpZXcuaXNTYW1lVGV4dEZpZWxkKG1zZy5hcmcxKSkgewpAQCAtNzEyMiw0MyArNjYyMCw0NiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2ZW50RGVmYXVsdCA9IG1zZy5hcmcyID09IDEgPyBQUkVWRU5UX0RFRkFVTFRfWUVTCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFBSRVZFTlRfREVGQVVMVF9OTzsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtUHJldmVudERlZmF1bHQgPT0gUFJFVkVOVF9ERUZBVUxUX1lFUykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFJlZ2lvbi5zZXRFbXB0eSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1zZy5hcmcyID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHByZXZlbnQgZGVmYXVsdCBpcyBub3QgY2FsbGVkIGluIFdlYkNvcmUsIHNvIHRoZQogICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWVzc2FnZSBuZWVkcyB0byBiZSByZXByb2Nlc3NlZCBpbiBVSQogICAgICAgICAgICAgICAgICAgICAgICAgVG91Y2hFdmVudERhdGEgdGVkID0gKFRvdWNoRXZlbnREYXRhKSBtc2cub2JqOwogICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0ZWQubUFjdGlvbikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX0RPV046Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0RGVmZXJUb3VjaFggPSB0ZWQubVZpZXdYOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERlZmVyVG91Y2hZID0gdGVkLm1WaWV3WTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3REZWZlclRvdWNoWCA9IGNvbnRlbnRUb1ZpZXdYKHRlZC5tUG9pbnRzWzBdLngpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtU2Nyb2xsWDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3REZWZlclRvdWNoWSA9IGNvbnRlbnRUb1ZpZXdZKHRlZC5tUG9pbnRzWzBdLnkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtU2Nyb2xsWTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURlZmVyVG91Y2hNb2RlID0gVE9VQ0hfSU5JVF9NT0RFOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vIHNuYXBwaW5nIGluIGRlZmVyIHByb2Nlc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHggPSBjb250ZW50VG9WaWV3WCh0ZWQubVBvaW50c1swXS54KSAtIG1TY3JvbGxYOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeSA9IGNvbnRlbnRUb1ZpZXdZKHRlZC5tUG9pbnRzWzBdLnkpIC0gbVNjcm9sbFk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVmZXJUb3VjaE1vZGUgIT0gVE9VQ0hfRFJBR19NT0RFKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGVmZXJUb3VjaE1vZGUgPSBUT1VDSF9EUkFHX01PREU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERlZmVyVG91Y2hYID0gdGVkLm1WaWV3WDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0RGVmZXJUb3VjaFkgPSB0ZWQubVZpZXdZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3REZWZlclRvdWNoWCA9IHg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERlZmVyVG91Y2hZID0geTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0RHJhZygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkZWx0YVggPSBwaW5Mb2NYKChpbnQpIChtU2Nyb2xsWAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUxhc3REZWZlclRvdWNoWCAtIHRlZC5tVmlld1gpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUxhc3REZWZlclRvdWNoWCAtIHgpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbVNjcm9sbFg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkZWx0YVkgPSBwaW5Mb2NZKChpbnQpIChtU2Nyb2xsWQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUxhc3REZWZlclRvdWNoWSAtIHRlZC5tVmlld1kpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUxhc3REZWZlclRvdWNoWSAtIHkpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbVNjcm9sbFk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvRHJhZyhkZWx0YVgsIGRlbHRhWSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVggIT0gMCkgbUxhc3REZWZlclRvdWNoWCA9IHRlZC5tVmlld1g7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVkgIT0gMCkgbUxhc3REZWZlclRvdWNoWSA9IHRlZC5tVmlld1k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVggIT0gMCkgbUxhc3REZWZlclRvdWNoWCA9IHg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVkgIT0gMCkgbUxhc3REZWZlclRvdWNoWSA9IHk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9VUDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVmZXJUb3VjaE1vZGUgPT0gVE9VQ0hfRFJBR19NT0RFKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBmbGluZyBpbiBkZWZlciBwcm9jZXNzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsZXIuc3ByaW5nQmFjayhtU2Nyb2xsWCwgbVNjcm9sbFksIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXB1dGVNYXhTY3JvbGxYKCksIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXB1dGVNYXhTY3JvbGxZKCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUucmVzdW1lUHJpb3JpdHkoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXdDb3JlLnJlc3VtZVVwZGF0ZVBpY3R1cmUobVdlYlZpZXdDb3JlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtNzE2Niw5ICs2NjY3LDkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXZWJWaWV3Q29yZS5BQ1RJT05fRE9VQkxFVEFQOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkb0RvdWJsZVRhcCgpIG5lZWRzIG1MYXN0VG91Y2hYL1kgYXMgYW5jaG9yCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hYID0gdGVkLm1WaWV3WDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RUb3VjaFkgPSB0ZWQubVZpZXdZOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb0RvdWJsZVRhcCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWCA9IGNvbnRlbnRUb1ZpZXdYKHRlZC5tUG9pbnRzWzBdLngpIC0gbVNjcm9sbFg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hZID0gY29udGVudFRvVmlld1kodGVkLm1Qb2ludHNbMF0ueSkgLSBtU2Nyb2xsWTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21NYW5hZ2VyLmhhbmRsZURvdWJsZVRhcChtTGFzdFRvdWNoWCwgbUxhc3RUb3VjaFkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGVmZXJUb3VjaE1vZGUgPSBUT1VDSF9ET05FX01PREU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV2ViVmlld0NvcmUuQUNUSU9OX0xPTkdQUkVTUzoKQEAgLTcxNzYsNyArNjY3Nyw2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoaXRUZXN0ICE9IG51bGwgJiYgaGl0VGVzdC5tVHlwZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IEhpdFRlc3RSZXN1bHQuVU5LTk9XTl9UWVBFKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJmb3JtTG9uZ0NsaWNrKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWJ1aWxkV2ViVGV4dFZpZXcoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGVmZXJUb3VjaE1vZGUgPSBUT1VDSF9ET05FX01PREU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtNzE5NCw4ICs2Njk0LDggQEAKIAogICAgICAgICAgICAgICAgIGNhc2UgRklORF9BR0FJTjoKICAgICAgICAgICAgICAgICAgICAgLy8gSWdub3JlIGlmIGZpbmQgaGFzIGJlZW4gZGlzbWlzc2VkLgotICAgICAgICAgICAgICAgICAgICBpZiAobUZpbmRJc1VwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5kQWxsKG1MYXN0RmluZCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtRmluZElzVXAgJiYgbUZpbmRDYWxsYmFjayAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtRmluZENhbGxiYWNrLmZpbmRBbGwoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKIApAQCAtNzIyMyw5ICs2NzIzLDkgQEAKICAgICAgICAgICAgICAgICAgICAgVmlldyB2aWV3ID0gKFZpZXcpIG1zZy5vYmo7CiAgICAgICAgICAgICAgICAgICAgIGludCBucHAgPSBtc2cuYXJnMTsKIAotICAgICAgICAgICAgICAgICAgICBpZiAobUZ1bGxTY3JlZW5Ib2xkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoaW5GdWxsU2NyZWVuTW9kZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJTaG91bGQgbm90IGhhdmUgYW5vdGhlciBmdWxsIHNjcmVlbi4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1GdWxsU2NyZWVuSG9sZGVyLmRpc21pc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpc21pc3NGdWxsU2NyZWVuTW9kZSgpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIG1GdWxsU2NyZWVuSG9sZGVyID0gbmV3IFBsdWdpbkZ1bGxTY3JlZW5Ib2xkZXIoV2ViVmlldy50aGlzLCBucHApOwogICAgICAgICAgICAgICAgICAgICBtRnVsbFNjcmVlbkhvbGRlci5zZXRDb250ZW50Vmlldyh2aWV3KTsKQEAgLTcyMzYsMTAgKzY3MzYsNyBAQAogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgY2FzZSBISURFX0ZVTExTQ1JFRU46Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpbkZ1bGxTY3JlZW5Nb2RlKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1GdWxsU2NyZWVuSG9sZGVyLmRpc21pc3MoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1GdWxsU2NyZWVuSG9sZGVyID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBkaXNtaXNzRnVsbFNjcmVlbk1vZGUoKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgICAgICAgICBjYXNlIERPTV9GT0NVU19DSEFOR0VEOgpAQCAtNzMwMCw3ICs2Nzk3LDYgQEAKIAogICAgICAgICAgICAgICAgIGNhc2UgQ0VOVEVSX0ZJVF9SRUNUOgogICAgICAgICAgICAgICAgICAgICBSZWN0IHIgPSAoUmVjdCltc2cub2JqOwotICAgICAgICAgICAgICAgICAgICBtSW5ab29tT3ZlcnZpZXcgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgY2VudGVyRml0UmVjdChyLmxlZnQsIHIudG9wLCByLndpZHRoKCksIHIuaGVpZ2h0KCkpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKIApAQCAtNzMwOSw2ICs2ODA1LDUxIEBACiAgICAgICAgICAgICAgICAgICAgIG1WZXJ0aWNhbFNjcm9sbEJhck1vZGUgPSBtc2cuYXJnMjsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgICAgICAgICBjYXNlIFNFTEVDVElPTl9TVFJJTkdfQ0hBTkdFRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BY2Nlc3NpYmlsaXR5SW5qZWN0b3IgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHNlbGVjdGlvblN0cmluZyA9IChTdHJpbmcpIG1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgICAgICBtQWNjZXNzaWJpbGl0eUluamVjdG9yLm9uU2VsZWN0aW9uU3RyaW5nQ2hhbmdlKHNlbGVjdGlvblN0cmluZyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIFNFVF9UT1VDSF9ISUdITElHSFRfUkVDVFM6CisgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUobVRvdWNoSGlnaGxpZ2h0UmVnaW9uLmdldEJvdW5kcygpKTsKKyAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaGxpZ2h0UmVnaW9uLnNldEVtcHR5KCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtc2cub2JqICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxSZWN0PiByZWN0cyA9IChBcnJheUxpc3Q8UmVjdD4pIG1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKFJlY3QgcmVjdCA6IHJlY3RzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVjdCB2aWV3UmVjdCA9IGNvbnRlbnRUb1ZpZXdSZWN0KHJlY3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNvbWUgc2l0ZXMsIGxpa2Ugc3RvcmllcyBpbiBueXRpbWVzLmNvbSwgc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbW91c2UgZXZlbnQgaGFuZGxlciBpbiB0aGUgdG9wIGRpdi4gSXQgaXMgbm90CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXNlciBmcmllbmRseSB0byBoaWdobGlnaHQgdGhlIGRpdiBpZiBpdCBjb3ZlcnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBtb3JlIHRoYW4gaGFsZiBvZiB0aGUgc2NyZWVuLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2aWV3UmVjdC53aWR0aCgpIDwgZ2V0V2lkdGgoKSA+PiAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCB2aWV3UmVjdC5oZWlnaHQoKSA8IGdldEhlaWdodCgpID4+IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaGxpZ2h0UmVnaW9uLnVuaW9uKHZpZXdSZWN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSh2aWV3UmVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HVEFHLCAiU2tpcCB0aGUgaHVnZSBzZWxlY3Rpb24gcmVjdDoiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB2aWV3UmVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTQVZFX1dFQkFSQ0hJVkVfRklOSVNIRUQ6CisgICAgICAgICAgICAgICAgICAgIFNhdmVXZWJBcmNoaXZlTWVzc2FnZSBzYXZlTWVzc2FnZSA9IChTYXZlV2ViQXJjaGl2ZU1lc3NhZ2UpbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNhdmVNZXNzYWdlLm1DYWxsYmFjayAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzYXZlTWVzc2FnZS5tQ2FsbGJhY2sub25SZWNlaXZlVmFsdWUoc2F2ZU1lc3NhZ2UubVJlc3VsdEZpbGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTRVRfQVVUT0ZJTExBQkxFOgorICAgICAgICAgICAgICAgICAgICBtQXV0b0ZpbGxRdWVyeUlkID0gbXNnLmFyZzE7CisgICAgICAgICAgICAgICAgICAgIGlmIChtV2ViVGV4dFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldEF1dG9GaWxsYWJsZShtQXV0b0ZpbGxRdWVyeUlkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlYnVpbGRXZWJUZXh0VmlldygpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgc3VwZXIuaGFuZGxlTWVzc2FnZShtc2cpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTc2MTgsMzcgKzcxNTksNiBAQAogICAgICAgICAgICAgICAgIG5ldyBJbnZva2VMaXN0Qm94KGFycmF5LCBlbmFibGVkQXJyYXksIHNlbGVjdGVkQXJyYXkpKTsKICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgdXBkYXRlWm9vbVJhbmdlKFdlYlZpZXdDb3JlLlJlc3RvcmVTdGF0ZSByZXN0b3JlU3RhdGUsCi0gICAgICAgICAgICBpbnQgdmlld1dpZHRoLCBpbnQgbWluUHJlZldpZHRoLCBib29sZWFuIHVwZGF0ZVpvb21PdmVydmlldykgewotICAgICAgICBpZiAocmVzdG9yZVN0YXRlLm1NaW5TY2FsZSA9PSAwKSB7Ci0gICAgICAgICAgICBpZiAocmVzdG9yZVN0YXRlLm1Nb2JpbGVTaXRlKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1pblByZWZXaWR0aCA+IE1hdGgubWF4KDAsIHZpZXdXaWR0aCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IChmbG9hdCkgdmlld1dpZHRoIC8gbWluUHJlZldpZHRoOwotICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlRml4ZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHVwZGF0ZVpvb21PdmVydmlldykgewotICAgICAgICAgICAgICAgICAgICAgICAgV2ViU2V0dGluZ3Mgc2V0dGluZ3MgPSBnZXRTZXR0aW5ncygpOwotICAgICAgICAgICAgICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gc2V0dGluZ3MuZ2V0VXNlV2lkZVZpZXdQb3J0KCkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3MuZ2V0TG9hZFdpdGhPdmVydmlld01vZGUoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSByZXN0b3JlU3RhdGUubURlZmF1bHRTY2FsZTsKLSAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZUZpeGVkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSBERUZBVUxUX01JTl9aT09NX1NDQUxFOwotICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGVGaXhlZCA9IGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IHJlc3RvcmVTdGF0ZS5tTWluU2NhbGU7Ci0gICAgICAgICAgICBtTWluWm9vbVNjYWxlRml4ZWQgPSB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIGlmIChyZXN0b3JlU3RhdGUubU1heFNjYWxlID09IDApIHsKLSAgICAgICAgICAgIG1NYXhab29tU2NhbGUgPSBERUZBVUxUX01BWF9aT09NX1NDQUxFOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbU1heFpvb21TY2FsZSA9IHJlc3RvcmVTdGF0ZS5tTWF4U2Nh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ICBVcmkgdXJpID0gbUNhbGxiYWNrUHJveHkub3BlbkZpbGVDaG9vc2VyKGFjY2VwdFR5cGUpOworICAgICAgICBpZiAodXJpICE9IG51bGwpIHsKKyAgICAgICAgICAgIFN0cmluZyBmaWxlUGF0aCA9ICIiOworICAgICAgICAgICAgLy8gTm90ZSAtIHF1ZXJ5aW5nIGZvciBNZWRpYVN0b3JlLkltYWdlcy5NZWRpYS5EQVRBCisgICAgICAgICAgICAvLyBzZWVtcyB0byB3b3JrIGZvciBhbGwgY29udGVudCBVUklzLCBub3QganVzdCBpbWFnZXMKKyAgICAgICAgICAgIEN1cnNvciBjdXJzb3IgPSBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeSgKKyAgICAgICAgICAgICAgICAgICAgdXJpLAorICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW10geyBNZWRpYVN0b3JlLkltYWdlcy5NZWRpYS5EQVRBIH0sCisgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvci5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVQYXRoID0gY3Vyc29yLmdldFN0cmluZygwKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgY3Vyc29yLmNsb3NlKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGZpbGVQYXRoID0gdXJpLmdldExhc3RQYXRoU2VnbWVudCgpOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgU3RyaW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IGludCBtTWV0YVN0YXRlOwogICAgICAgICBib29sZWFuIG1SZXByb2Nlc3M7Ci0gICAgICAgIGZsb2F0IG1WaWV3WDsKLSAgICAgICAgZmxvYXQgbVZpZXdZOwogICAgIH0KIAogICAgIHN0YXRpYyBjbGFzcyBHZW9sb2NhdGlvblBlcm1pc3Npb25zRGF0YSB7CkBAIC03MjYsOSArNzUwLDggQEAKICAgICAgICAgYm9vbGVhbiBtUmVtZW1iZXI7CiAgICAgfQogCi0KLQogICAgICAgICBzdGF0aWMgZmluYWwgU3RyaW5nW10gSGFuZGxlckRlYnVnU3RyaW5nID0geworICAgICAgICAgICAgIlJFVkVBTF9TRUxFQ1RJT04iLCAvLyA5NgogICAgICAgICAgICAgIlJFUVVFU1RfTEFCRUwiLCAvLyA5NwogICAgICAgICAgICAgIlVQREFURV9GUkFNRV9DQUNIRV9JRl9MT0FESU5HIiwgLy8gPSA5OAogICAgICAgICAgICAgIlNDUk9MTF9URVhUX0lOUFVUIiwgLy8gPSA5OQpAQCAtNzc5LDEwICs4MDIsMTMgQEAKICAgICAgICAgICAgICJPTl9SRVNVTUUiLCAgICAvLyA9IDE0NAogICAgICAgICAgICAgIkZSRUVfTUVNT1JZIiwgIC8vID0gMTQ1CiAgICAgICAgICAgICAiVkFMSURfTk9ERV9CT1VORFMiLCAvLyA9IDE0NgorICAgICAgICAgICAgIlNBVkVfV0VCQVJDSElWRSIsIC8vID0gMTQ3CisgICAgICAgICAgICAiV0VCS0lUX0RSQVdfTEFZRVJTIiwgLy8gPSAxNDg7CiAgICAgICAgIH07CiAKICAgICBjbGFzcyBFdmVudEh1YiB7CiAgICAgICAgIC8vIE1lc3NhZ2UgSWRzCisgICAgICAgIHN0YXRpYyBmaW5hbCBpbnQgUkVWRUFMX1NFTEVDVElPTiA9IDk2OwogICAgICAgICBzdGF0aWMgZmluYWwgaW50IFJFUVVFU1RfTEFCRUwgPSA5NzsKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBVUERBVEVfRlJB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T1JJRU5UQVRJT04gPSAxOTE7CisKKyAgICAgICAgc3RhdGljIGZpbmFsIGludCBBVVRPRklMTF9GT1JNID0gMTkyOworCiAgICAgICAgIC8vIHByaXZhdGUgbWVzc2FnZSBpZHMKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IERFU1RST1kgPSAgICAgMjAwOwogCkBAIC04OTMsNiArOTM1LDkgQEAKICAgICAgICAgICovCiAgICAgICAgIHByaXZhdGUgRXZlbnRIdWIoKSB7fQogCisgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBGSVJTVF9QQUNLQUdFX01TR19JRCA9IFJFVkVBTF9TRUxFQ1RJT047CisgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBMQVNUX1BBQ0tBR0VfTVNHX0lEID0gVkFMSURfTk9ERV9CT1VORFM7CisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRyYW5zZmVyIGFsbCBtZXNzYWdlcyB0byB0aGUgbmV3bHkgY3JlYXRlZCB3ZWJjb3JlIHRocmVhZCBoYW5kbGVyLgogICAgICAgICAgKi8KQEAgLTkwNCwxMSArOTQ5LDExIEBACiAgICAgICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgewogICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFV19DT1JFKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsIChtc2cud2hhdCA8IFJFUVVFU1RfTEFCRUwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgbXNnLndoYXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPiBWQUxJRF9OT0RFX0JPVU5EUyA/IEludGVnZXIudG9TdHJpbmcobXNnLndoYXQpCisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsIChtc2cud2hhdCA8IEZJUlNUX1BBQ0tBR0VfTVNHX0lECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1zZy53aGF0ID4gTEFTVF9QQUNLQUdFX01TR19JRAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEludGVnZXIudG9TdHJpbmcobXNnLndoYXQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogSGFuZGxlckRlYnVnU3RyaW5nW21zZy53aGF0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBSRVFVRVNUX0xBQkVMXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEZJUlNUX1BBQ0tBR0VfTVNHX0lEXSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGFyZzE9IiArIG1zZy5hcmcxICsgIiBhcmcyPSIgKyBtc2cuYXJnMgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgb2JqPSIgKyBtc2cub2JqKTsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtOTE3LDYgKzk2MiwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlYmtpdERyYXcoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXRUJLSVRfRFJBV19MQVlFUlM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2Via2l0RHJhd0xheWVycygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIERFU1RST1k6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGltZSB0byB0YWtlIGRvd24gdGhlIHdvcmxkLiBDYW5jZWwgYWxsIHBlbmRpbmcKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBsb2FkcyBhbmQgZGVzdHJveSB0aGUgbmF0aXZlIHZpZXcgYW5kIGZyYW1lLgpAQCAtOTI5LDYgKzk3OCwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBSRVZFQUxfU0VMRUNUSU9OOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVJldmVhbFNlbGVjdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFJFUVVFU1RfTEFCRUw6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1XZWJWaWV3ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG5vZGVQb2ludGVyID0gbXNnLmFyZzI7CkBAIC0xMDM2LDcgKzEwODksNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vdGU6IHRoZXNlIGFyZSBpbiBkb2N1bWVudCBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIChpbnYtem9vbSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQb2ludCBwdCA9IChQb2ludCkgbXNnLm9iajsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVTZXRTY3JvbGxPZmZzZXQobXNnLmFyZzEsIHB0LngsIHB0LnkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldFNjcm9sbE9mZnNldChtc2cuYXJnMSwgbXNnLmFyZzIsIHB0LngsIHB0LnkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNFVF9HTE9CQUxfQk9VTkRTOgpAQCAtMTE2MiwxMiArMTIxNSwxOSBAQAogCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFRPVUNIX0VWRU5UOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVG91Y2hFdmVudERhdGEgdGVkID0gKFRvdWNoRXZlbnREYXRhKSBtc2cub2JqOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBjb3VudCA9IHRlZC5tUG9pbnRzLmxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRbXSB4QXJyYXkgPSBuZXcgaW50W2NvdW50XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRbXSB5QXJyYXkgPSBuZXcgaW50W2NvdW50XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBjID0gMDsgYyA8IGNvdW50OyBjKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeEFycmF5W2NdID0gdGVkLm1Qb2ludHNbY10ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUFycmF5W2NdID0gdGVkLm1Qb2ludHNbY10ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4oCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlBSRVZFTlRfVE9VQ0hfSUQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubUFjdGlvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUhhbmRsZVRvdWNoRXZlbnQodGVkLm1BY3Rpb24sIHRlZC5tWCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1ZLCB0ZWQubU1ldGFTdGF0ZSkgPyAxIDogMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUhhbmRsZVRvdWNoRXZlbnQodGVkLm1BY3Rpb24sIHhBcnJheSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUFycmF5LCBjb3VudCwgdGVkLm1NZXRhU3RhdGUpID8gMSA6IDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVJlcHJvY2VzcyA/IHRlZCA6IG51bGwpLnNlbmRUb1RhcmdldCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMTI0Niw2ICsxMzA2LDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0U2VsZWN0aW9uKG1zZy5hcmcxLCBtc2cuYXJnMik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTU9ESUZZX1NFTEVDVElPTjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc2VsZWN0aW9uU3RyaW5nID0gbmF0aXZlTW9kaWZ5U2VsZWN0aW9uKG1zZy5hcmcxLCBtc2cuYXJnMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLm9idGFpbk1lc3NhZ2UoV2ViVmlldy5TRUxFQ1RJT05fU1RSSU5HX0NIQU5HRUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25TdHJpbmcpLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIExJU1RCT1hfQ0hPSUNFUzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTcGFyc2VCb29sZWFuQXJyYXkgY2hvaWNlcyA9IChTcGFyc2VCb29sZWFuQXJyYXkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cub2JqOwpAQCAtMTI4Niw2ICsxMzUyLDE1IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0SnNGbGFncygoU3RyaW5nKW1zZy5vYmopOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNBVkVfV0VCQVJDSElWRToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlNhdmVXZWJBcmNoaXZlTWVzc2FnZSBzYXZlTWVzc2FnZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXZWJWaWV3LlNhdmVXZWJBcmNoaXZlTWVzc2FnZSltc2cub2JqOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVNZXNzYWdlLm1SZXN1bHRGaWxlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZVdlYkFyY2hpdmUoc2F2ZU1lc3NhZ2UubUJhc2VuYW1lLCBzYXZlTWVzc2FnZS5tQXV0b25hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Lm1Qcml2YXRlSGFuZGxlci5vYnRhaW5NZXNzYWdlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlNBVkVfV0VCQVJDSElWRV9GSU5JU0hFRCwgc2F2ZU1lc3NhZ2UpLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEdFT0xPQ0FUSU9OX1BFUk1JU1NJT05TX1BST1ZJREU6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR2VvbG9jYXRpb25QZXJtaXNzaW9uc0RhdGEgZGF0YSA9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoR2VvbG9jYXRpb25QZXJtaXNzaW9uc0RhdGEpIG1zZy5vYmo7CkBAIC0xMjk5LDcgKzEzNzQsOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNQTElUX1BJQ1RVUkVfU0VUOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNwbGl0Q29udGVudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNwbGl0Q29udGVudChtc2cuYXJnMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLm9idGFpbk1lc3NhZ2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlJFUExBQ0VfQkFTRV9DT05URU5ULCBtc2cuYXJnMSwgMCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNwbGl0UGljdHVyZUlzU2NoZWR1bGVkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKQEAgLTEzNjUsNiArMTQ0MiwyOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXJGcmFtZS5zSmF2YUJyaWRnZS5yZW1vdmVQYWNrYWdlTmFtZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChTdHJpbmcpIG1zZy5vYmopOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEdFVF9UT1VDSF9ISUdITElHSFRfUkVDVFM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVG91Y2hIaWdobGlnaHREYXRhIGQgPSAoVG91Y2hIaWdobGlnaHREYXRhKSBtc2cub2JqOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxSZWN0PiByZWN0cyA9IG5hdGl2ZUdldFRvdWNoSGlnaGxpZ2h0UmVjdHMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkLm1YLCBkLm1ZLCBkLm1TbG9wKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIub2J0YWluTWVzc2FnZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuU0VUX1RPVUNIX0hJR0hMSUdIVF9SRUNUUywgcmVjdHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgUkVNT1ZFX1RPVUNIX0hJR0hMSUdIVF9SRUNUUzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIub2J0YWluTWVzc2FnZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuU0VUX1RPVUNIX0hJR0hMSUdIVF9SRUNUUywgbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBVU0VfTU9DS19ERVZJQ0VfT1JJRU5UQVRJT046CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlTW9ja0RldmljZU9yaWVudGF0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQVVUT0ZJTExfRk9STToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVBdXRvRmlsbEZvcm0obXNnLmFyZzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfTsKQEAgLTE1NzAsNiArMTY3MCwxMyBAQAogICAgICAgICBtQnJvd3NlckZyYW1lLmxvYWRVcmwodXJsLCBleHRyYUhlYWRlcnMpOwogICAgIH0KIAorICAgIHByaXZhdGUgU3RyaW5nIHNhdmVXZWJBcmNoaXZlKFN0cmluZyBmaWxlbmFtZSwgYm9vbGVhbiBhdXRvbmFtZSkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFV19DT1JFKSB7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICIgQ09SRSBzYXZlV2ViQXJjaGl2ZSAiICsgZmlsZW5hbWUgKyAiICIgKyBhdXRvbmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1Ccm93c2VyRnJhbWUuc2F2ZVdlYkFyY2hpdmUoZmlsZW5hbWUsIGF1dG9uYW1lKTsKKyAgICB9CisKICAgICBwcml2YXRlIHZvaWQga2V5KEtleUV2ZW50IGV2dCwgYm9vbGVhbiBpc0Rvd24pIHsKICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVdfQ09SRSkgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiQ09SRSBrZXkgYXQgIiArIFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpICsgIiwgIgpAQCAtMTU5MCwxMSArMTY5NywxMiBAQAogICAgICAgICAgICAgaWYgKGtleUNvZGUgPj0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQCiAgICAgICAgICAgICAgICAgICAgICYmIGtleUNvZGUgPD0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUKSB7CiAgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVdfQ09SRSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJrZXk6IGFycm93IHVudXNlZCBieSBwbHVnaW46ICIgKyBrZXlDb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAia2V5OiBhcnJvdyB1bnVzZWQgYnkgcGFnZTogIiArIGtleUNvZGUpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAobVdlYlZpZXcgIT0gbnVsbCAmJiBldnQuaXNEb3duKCkpIHsKICAgICAgICAgICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuTU9WRV9PVVRfT0ZfUExVR0lOLCBrZXlDb2RlKS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlVOSEFORExFRF9OQVZfS0VZLCBrZXlDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApLnNlbmRUb1RhcmdldCgpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CkBAIC0xNjI1LDcgKzE3MzMsNyBAQAogICAgICAgICBpZiAobVNldHRpbmdzLmdldFVzZVdpZGVWaWV3UG9ydCgpKSB7CiAgICAgICAgICAgICBpZiAobVZpZXdwb3J0V2lkdGggPT0gLTEpIHsKICAgICAgICAgICAgICAgICBpZiAobVNldHRpbmdzLmdldExheW91dEFsZ29yaXRobSgpID09Ci0gICAgICAgICAgICAgICAgICAgICAgICBXZWJTZXR0aW5ncy5MYXlvdXRBbGdvcml0aG0uTk9STUFMKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBXZWJTZXR0aW5ncy5MYXlvdXRBbGdvcml0aG0uTk9STUFMIHx8IG1TZXR0aW5ncy5nZXRVc2VGaXhlZFZpZXdwb3J0KCkpIHsKICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSBXZWJWaWV3LkRFRkFVTFRfVklFV1BPUlRfV0lEVEg7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgLyoKQEAgLTE2NDUsNyArMTc1MywxMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlR2V0Q29udGVudE1pblByZWZXaWR0aCgpKSkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSBpZiAobVZpZXdwb3J0V2lkdGggPiAwKSB7Ci0gICAgICAgICAgICAgICAgd2lkdGggPSBNYXRoLm1heCh3LCBtVmlld3BvcnRXaWR0aCk7CisgICAgICAgICAgICAgICAgaWYgKG1TZXR0aW5ncy5nZXRVc2VGaXhlZFZpZXdwb3J0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVXNlIHdlYnNpdGUgc3BlY2lmaWVkIG9yIGRlc2lyZWQgZml4ZWQgdmlld3BvcnQgd2lkdGguCisgICAgICAgICAgICAgICAgICAgIHdpZHRoID0gbVZpZXdwb3J0V2lkdGg7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgd2lkdGggPSBNYXRoLm1heCh3LCBtVmlld3BvcnRXaWR0aCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICB3aWR0aCA9IHRleHR3cmFwV2lkdGg7CiAgICAgICAgICAgICB9CkBAIC0xNjkwLDggKzE4MDMsMTcgQEAKICAgICAgICAgcmV0dXJuIHVzZWRRdW90YTsKICAgICB9CiAKKyAgICAvLyBjYWxsZWQgZnJvbSBVSSB0aHJlYWQKKyAgICB2b2lkIHNwbGl0Q29udGVudChpbnQgY29udGVudCkgeworICAgICAgICBpZiAoIW1TcGxpdFBpY3R1cmVJc1NjaGVkdWxlZCkgeworICAgICAgICAgICAgbVNwbGl0UGljdHVyZUlzU2NoZWR1bGVkID0gdHJ1ZTsKKyAgIC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X1ZJRVdQT1JUX1dJRFRICkBAIC0xNzQ5LDkgKzE4OTAsOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbVZpZXdwb3J0V2lkdGgpLAogICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlR2V0Q29udGVudE1pblByZWZXaWR0aCgpKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtUmVzdG9yZVN0YXRlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBkcmF3Lm1SZXN0b3JlU3RhdGUgPSBtUmVzdG9yZVN0YXRlOwotICAgICAgICAgICAgICAgIG1SZXN0b3JlU3RhdGUgPSBudWxsOworICAgICAgICAgICAgaWYgKG1Jbml0aWFsVmlld1N0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBkcmF3Lm1WaWV3U3RhdGUgPSBtSW5pdGlhbFZpZXdTdGF0ZTsKKyAgICAgICAgICAgICAgICBtSW5pdGlhbFZpZXdTdGF0ZSA9IG51bGw7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFV19DT1JFKSBMb2cudihMT0dUQUcsICJ3ZWJraXREcmF3IE5FV19QSUNUVVJFX01TR19JRCIpOwogICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLApAQCAtMTc2Niw1MSArMTkwNyw2IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KLSAgICAvLyBUaGVzZSBhcmUgY2FsbGVkIGZyb20gdGhlIFVJIHRocmVhZCwgbm90IG91ciB0aHJlYWQKLQotICAgIHN0YXRpYyBmaW5hbCBpbnQgWk9PTV9CSVRTID0gUGFpbnQuRklMVEVSX0JJVE1BUF9GTEFHIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFpbnQuRElUSEVSX0ZMQUcgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWludC5TVUJQSVhFTF9URVhUX0ZMQUc7Ci0gICAgc3RhdGljIGZpbmFsIGludCBTQ1JPTExfQklUUyA9IFBhaW50LkZJTFRFUl9CSVRNQVBfRkxBRyB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFpbnQuRElUSEVSX0ZMQUc7Ci0KLSAgICBmaW5hbCBEcmF3RmlsdGVyIG1ab29tRmlsdGVyID0KLSAgICAgICAgICAgICAgICAgICAgbmV3IFBhaW50RmxhZ3NEcmF3RmlsdGVyKFpPT01fQklUUywgUGFpbnQuTElORUFSX1RFWFRfRkxBRyk7Ci0gICAgLy8gSWYgd2UgbmVlZCB0byB0cmFkZSBiZXR0ZXIgcXVhbGl0eSBmb3Igc3BlZWQsIHNldCBtU2Nyb2xsRmlsdGVyIHRvIG51bGwKLSAgICBmaW5hbCBEcmF3RmlsdGVyIG1TY3JvbGxGaWx0ZXIgPQotICAgICAgICAgICAgICAgIG5ldyBQYWludEZsYWdzRHJhd0ZpbHRlcihTQ1JPTExfQklUUywgMCk7Ci0KLSAgICAvKiBwYWNrYWdlICovIHZvaWQgZHJhd0NvbnRlbnRQaWN0dXJlKENhbnZhcyBjYW52YXMsIGludCBjb2xvciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gYW5pbWF0aW5nWm9vbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gYW5pbWF0aW5nU2Nyb2xsKSB7Ci0gICAgICAgIERyYXdGaWx0ZXIgZGYgPSBudWxsOwotICAgICAgICBpZiAoYW5pbWF0aW5nWm9vbSkgewotICAgICAgICAgICAgZGYgPSBtWm9vbUZpbHRl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mV0dXJuOworCiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKGNvcmUpIHsKICAgICAgICAgICAgICAgICBjb3JlLm1EcmF3SXNQYXVzZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBpZiAoY29yZS5tRHJhd0lzU2NoZWR1bGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvcmUubURyYXdJc1NjaGVkdWxlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBjb3JlLmNvbnRlbnREcmF3KCk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIGFsd2F5cyByZWRyYXcgb24gcmVzdW1lIHRvIHJlZW5hYmxlIGdpZiBhbmltYXRpb25zCisgICAgICAgICAgICAgICAgY29yZS5tRHJhd0lzU2NoZWR1bGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgY29yZS5uYXRpdmVDb250ZW50SW52YWxpZGF0ZUFsbCgpOworICAgICAgICAgICAgICAgIGNvcmUuY29udGVudERyYXcoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTE4ODcsNiArMTk4OSwxNSBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgLy8gY2FsbGVkIGZyb20gSk5JCisgICAgdm9pZCBsYXllcnNEcmF3KCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmIChtRHJhd0xheWVyc0lzU2NoZWR1bGVkKSByZXR1cm47CisgICAgICAgICAgICBtRHJhd0xheWVyc0lzU2NoZWR1bGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIG1FdmVudEh1Yi5zZW5kTWVzc2FnZShNZXNzYWdlLm9idGFpbihudWxsLCBFdmVudEh1Yi5XRUJLSVRfRFJBV19MQVlFUlMpKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIC8vIGNhbGxlZCBieSBKTkkKICAgICBwcml2YXRlIHZvaWQgY29udGVudFNjcm9sbEJ5KGludC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ICAgICAgICAgICAgICBtUmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlID0gYWRqdXN0OworICAgICAgICAgICAgICAgIG1Jbml0aWFsVmlld1N0YXRlLm1UZXh0V3JhcFNjYWxlID0gYWRqdXN0OwogICAgICAgICAgICAgICAgIC8vIDAgd2lsbCB0cmlnZ2VyIFdlYlZpZXcgdG8gdHVybiBvbiB6b29tIG92ZXJ2aWV3IG1vZGUKLSAgICAgICAgICAgICAgICBtUmVzdG9yZVN0YXRlLm1WaWV3U2NhbGUgPSAwOworICAgICAgICAgICAgICAgIG1Jbml0aWFsVmlld1N0YXRlLm1WaWV3U2NhbGUgPSAwOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTIxOTIsMTUgKzIyOTMsMTUgQEAKICAgICAgICAgICAgICAgICAvLyBtVmlld1NjYWxlIGFzIDAgbWVhbnMgaXQgaXMgaW4gem9vbSBvdmVydmlldyBtb2RlLiBTbyB3ZSBkb24ndAogICAgICAgICAgICAgICAgIC8vIGtub3cgdGhlIGV4YWN0IHNjYWxlLiBJZiBtUmVzdG9yZWRTY2FsZSBpcyBub24temVybywgdXNlIGl0OwogICAgICAgICAgICAgICAgIC8vIG90aGVyd2lzZSBqdXN0IHVzZSBtVGV4dFdyYXBTY2FsZSBhcyB0aGUgaW5pdGlhbCBzY2FsZS4KLSAgICAgICAgICAgICAgICBkYXRhLm1TY2FsZSA9IG1SZXN0b3JlU3RhdGUubVZpZXdTY2FsZSA9PSAwCisgICAgICAgICAgICAgICAgZGF0YS5tU2NhbGUgPSBtSW5pdGlhbFZpZXdTdGF0ZS5tVmlld1NjYWxlID09IDAKICAgICAgICAgICAgICAgICAgICAgICAgID8gKG1SZXN0b3JlZFNjYWxlID4gMCA/IG1SZXN0b3JlZFNjYWxlIC8gMTAwLjBmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbVJlc3RvcmVTdGF0ZS5tVGV4dFdyYXBTY2FsZSkKLSAgICAgICAgICAgICAgICAgICAgICAgIDogbVJlc3RvcmVTdGF0ZS5tVmlld1NjYWxlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1Jbml0aWFsVmlld1N0YXRlLm1UZXh0V3JhcFNjYWxlKQorICAgICAgICAgICAgICAgICAgICAgICAgOiBtSW5pdGlhbFZpZXdTdGF0ZS5tVmlld1NjYWxlOwogICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXX0NPUkUpIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAic2V0dXBWaWV3cG9ydCIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1SZXN0b3JlZFNjYWxlPSIgKyBtUmVzdG9yZWRTY2FsZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbVZpZXdTY2FsZT0iICsgbVJlc3RvcmVTdGF0ZS5tVmlld1NjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtVGV4dFdyYXBTY2FsZT0iICsgbVJlc3RvcmVTdGF0ZS5tVGV4dFdyYXBTY2FsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbVZpZXdTY2FsZT0iICsgbUluaXRpYWxWaWV3U3RhdGUubVZpZXdTY2FsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbVRleHRXcmFwU2NhbGU9IiArIG1Jbml0aWFsVmlld1N0YXRlLm1UZXh0V3JhcFNjYWxlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGRhdGEubVdpZHRoID0gTWF0aC5yb3VuZCh3ZWJWaWV3V2lkdGggLyBkYXRhLm1TY2FsZSk7CkBAIC0yMjEzLDcgKzIzMTQsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5yb3VuZChtV2ViVmlldy5nZXRWaWV3SGVpZ2h0KCkgLyBkYXRhLm1TY2FsZSkKICAgICAgICAgICAgICAgICAgICAgICAgIDogbUN1cnJlbnRWaWV3SGVpZ2h0ICogZGF0YS5tV2lkdGggLyB2aWV3cG9ydFdpZHRoOwogICAgICAgICAgICAgICAgIGRhdGEubVRleHRXcmFwV2lkdGggPSBNYXRoLnJvdW5kKHdlYlZpZXdXaWR0aAotICAgICAgICAgICAgICAgICAgICAgICAgLyBtUmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8gbUluaXRpYWxWaWV3U3RhdGUubVRleHRXcmFwU2NhbGUpOwogICAgICAgICAgICAgICAgIGRhdGEubUlnbm9yZUhlaWdodCA9IGZhbHNlOwogICAgICAgICAgICAgICAgIGRhdGEubUFuY2hvclggPSBkYXRhLm1BbmNob3JZID0gMDsKICAgICAgICAgICAgICAgICAvLyBzZW5kIFZJRVdfU0laRV9DSEFOR0VEIHRvIHRoZSBmcm9udCBvZiB0aGUgcXVldWUgc28gdGhhdCB3ZQpAQCAtMjIyNiwyMCArMjMyNywxMiBAQAogICAgIH0KIAogICAgIC8vIGNhbGxlZCBieSBKTkkKLSAgICBwcml2YXRlIHZvaWQgcmVzdG9yZVNjYWxlKGludCBzY2FsZSkgeworICAgIHByaXZhdGUgdm9pZCByZXN0b3JlU2NhbGUoaW50IHNjYWxlLCBpbnQgdGV4dFdyYXBTY2FsZSkgewogICAgICAgICBpZiAobUJyb3dzZXJGcmFtZS5maXJzdExheW91dERvbmUoKSA9PSBmYWxzZSkgewogICAgICAgICAgICAgbVJlc3RvcmVkU2NhbGUgPSBzY2FsZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8vIGNhbGxlZCBieSBKTkkKLSAgICBwcml2YXRlIHZvaWQgcmVzdG9yZVNjcmVlbldpZHRoU2NhbGUoaW50IHNjYWxlKSB7Ci0gICAgICAgIGlmICghbVNldHRpbmdzLmdldFVzZVdpZGVWaWV3UG9ydCgpKSB7Ci0gICAgICAgICAgICByZX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uYXRpdmVTZXRTY3JvbGxPZmZzZXQoaW50IGdlbiwgaW50IHVzZXJTY3JvbGxlZCwgaW50IGR4LCBpbnQgZHkpOwogCiAgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBuYXRpdmVTZXRHbG9iYWxCb3VuZHMoaW50IHgsIGludCB5LCBpbnQgdywgaW50IGgpOwogCkBAIC0yMzM3LDYgKzI0MzEsMTMgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHByaXZhdGUgdm9pZCBzZXRXZWJUZXh0Vmlld0F1dG9GaWxsYWJsZShpbnQgcXVlcnlJZCkgeworICAgICAgICBpZiAobVdlYlZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLCBXZWJWaWV3LlNFVF9BVVRPRklMTEFCTEUsIHF1ZXJ5SWQsCisgICAgICAgICAgICAgICAgICAgIC8qIHVudXNlZCAqLzApLnNlbmRUb1RhcmdldCgpOworICAgICAgICB9CisgICAgfQorCiAgICAgLy8gY2FsbGVkIGJ5IEpOSQogICAgIHByaXZhdGUgQ29udGV4dCBnZXRDb250ZXh0KCkgewogICAgICAgICByZXR1cm4gbUNvbnRleHQ7CkBAIC0yNDc3LDYgKzI1NzgsMzIgQEAKICAgICAgICAgICAgICAgICBoTW9kZSwgdk1vZGUpLnNlbmRUb1RhcmdldCgpOwogICAgIH0KIAorICAgIHByaXZhdGUgdm9pZCB1c2VNb2NrRGV2aWNlT3JpZW50YXRpb24oKSB7CisgICAgICAgIG1EZXZpY2VNb3Rpb25BbmRPcmllbnRhdGlvbk1hbmFnZXIudXNlTW9jaygpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldE1vY2tEZXZpY2VPcmllbnRhdGlvbihib29sZWFuIGNhblByb3ZpZGVBbHBoYSwgZG91YmxlIGFscGhhLAorICAgICAgICAgICAgYm9vbGVhbiBjYW5Qcm92aWRlQmV0YSwgZG91YmxlIGJldGEsIGJvb2xlYW4gY2FuUHJvdmlkZUdhbW1hLCBkb3VibGUgZ2FtbWEpIHsKKyAgICAgICAgbURldmljZU1vdGlvbkFuZE9yaWVudGF0aW9uTWFuYWdlci5zZXRNb2NrT3JpZW50YXRpb24oY2FuUHJvdmlkZUFscGhhLCBhbHBoYSwKKyAgICAgICAgICAgICAgICBjYW5Qcm92aWRlQmV0YSwgYmV0YSwgY2FuUHJvdmlkZUdhbW1hLCBnYW1tYSk7CisgICAgfQorCisgICAgcHJvdGVjdGVkIERldmljZU1vdGlvblNlcnZpY2UgZ2V0RGV2aWNlTW90aW9uU2VydmljZSgpIHsKKyAgICAgICAgaWYgKG1EZXZpY2VNb3Rpb25TZXJ2aWNlID09IG51bGwpIHsKKyAgICAgICAgICAgIG1EZXZpY2VNb3Rpb25TZXJ2aWNlID0KKyAgICAgICAgICAgICAgICAgICAgbmV3IERldmljZU1vdGlvblNlcnZpY2UobURldmljZU1vdGlvbkFuZE9yaWVudGF0aW9uTWFuYWdlciwgbUNvbnRleHQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtRGV2aWNlTW90aW9uU2VydmljZTsKKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgRGV2aWNlT3JpZW50YXRpb25TZXJ2aWNlIGdldERldmljZU9yaWVudGF0aW9uU2VydmljZSgpIHsKKyAgICAgICAgaWYgKG1EZXZpY2VPcmllbnRhdGlvblNlcnZpY2UgPT0gbnVsbCkgeworICAgICAgICAgICAgbURldmljZU9yaWVudGF0aW9uU2VydmljZSA9CisgICAgICAgICAgICAgICAgICAgIG5ldyBEZXZpY2VPcmllbnRhdGlvblNlcnZpY2UobURldmljZU1vdGlvbkFuZE9yaWVudGF0aW9uTWFuYWdlciwgbUNvbnRleHQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtRGV2aWNlT3JpZW50YXRpb25TZXJ2aWNlOworICAgIH0KKwogICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgbmF0aXZlUGF1c2UoKTsK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gV2Ugc2hvdWxkIGNvbnNpZGVyIHJlbW92aW5nIHRoZSBjb29raWVzIHRhYmxlIGlmIGFuZCB3aGVuIHdlIHN3aXRjaCB0bworICAgIC8vIHRoZSBDaHJvbWl1bSBIVFRQIHN0YWNrIGZvciBnb29kLgogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBtVGFibGVOYW1lc1tdID0gewogICAgICAgICAiY29va2llcyIsICJwYXNzd29yZCIsICJmb3JtdXJsIiwgImZvcm1kYXRhIiwgImh0dHBhdXRoIgogICAgIH07CkBAIC0xNzMsMTEyICsxNzYsMTQwIEBACiAKICAgICBwcml2YXRlIHN0YXRpYyBpbnQgbUNhY2hlVHJhbnNhY3Rpb25SZWZjb3VudDsKIAotICAgIHByaXZhdGUgV2ViVmlld0RhdGFiYXNlKCkgeworICAgIC8vIEluaXRpYWxseSB0cnVlIHVudGlsIHRoZSBiYWNrZ3JvdW5kIHRocmVhZCBjb21wbGV0ZXMuCisgICAgcHJpdmF0ZSBib29sZWFuIG1Jbml0aWFsaXplZCA9IGZhbHNlOworCisgICAgcHJpdmF0ZSBXZWJWaWV3RGF0YWJhc2UoZmluYWwgQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIG5ldyBUaHJlYWQoKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBpbml0KGNvbnRleHQpOworICAgICAgICAgICAgfQorICAgICAgICB9LnN0YXJ0KCk7CisKICAgICAgICAgLy8gU2luZ2xldG9uIG9ubHksIHVzZSBnZXRJbnN0YW5jZSgpCiAgICAgfQogCiAgICAgcHVibGljIHN0YXRpYyBzeW5jaHJvbml6ZWQgV2ViVmlld0RhdGFiYXNlIGdldEluc3RhbmNlKENvbnRleHQgY29udGV4dCkgewogICAgICAgICBpZiAobUluc3RhbmNlID09IG51bGwpIHsKLSAgICAgICAgICAgIG1JbnN0YW5jZSA9IG5ldyBXZWJWaWV3RGF0YWJhc2UoKTsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgbURhdGFiYXNlID0gY29udGV4dAotICAgICAgICAgICAgICAgICAgICAgICAgLm9wZW5PckNyZWF0ZURhdGFiYXNlKERBVEFCQVNFX0ZJTEUsIDAsIG51bGwpOwotICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAvLyB0cnkgYWdhaW4gYnkgZGVsZXRpbmcgdGhlIG9sZCBkYiBhbmQgY3JlYXRlIGEgbmV3IG9uZQotICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmRlbGV0ZURhdGFiYXNlKERBVEFCQVNFX0ZJTEUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1EYXRhYmFzZSA9IGNvbnRleHQub3Blbk9yQ3JlYXRlRGF0YWJhc2UoREFUQUJBU0VfRklMRSwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBtSW5zdGFuY2UgPSBuZXcgV2ViVmlld0RhdGFiYXNlKGNvbnRleHQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtSW5zdGFuY2U7CisgICAgfQogCi0gICAgICAgICAgICAvLyBtRGF0YWJhc2Ugc2hvdWxkIG5vdCBiZSBudWxsLCAKLSAgICAgICAgICAgIC8vIHRoZSBvbmx5IGNhc2UgaXMgUmVxdWVzdEFQSSB0ZXN0IGhhcyBwcm9ibGVtIHRvIGNyZWF0ZSBkYiAKLSAgICAgICAgICAgIGlmIChtRGF0YWJhc2UgIT0gbnVsbCAmJiBtRGF0YWJhc2UuZ2V0VmVyc2lvbigpICE9IERBVEFCQVNFX1ZFUlNJT04pIHsKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2UuYmVnaW5UcmFuc2FjdGlvbigpOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHVwZ3JhZGVEYXRhYmFzZSgpOwotICAgICAgICAgICAgICAgICAgICBtRGF0YWJhc2Uuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgbURhdGFiYXNlLmVuZFRyYW5zYWN0aW9uKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQorICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgaW5pdChDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1Jbml0aWFsaXplZCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmIChtRGF0YWJhc2UgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIHVzZSBwZXIgdGFibGUgTXV0ZXggbG9jaywgdHVybiBvZmYgZGF0YWJhc2UgbG9jaywgdGhpcwotICAgICAgICAgICAgICAgIC8vIGltcHJvdmVzIHBlcmZvcm1hbmNlIGFzIGRhdGFiYXNlJ3MgUmVlbnRyYW50TG9jayBpcyBleHBhbnNpdmUKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2Uuc2V0TG9ja2luZ0VuYWJsZWQoZmFsc2UpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIG1DYWNoZURhdGFiYXNlID0gY29udGV4dC5vcGVuT3JDcmVhdGVEYXRhYmFzZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIENBQ0hFX0RBVEFCQVNFX0ZJTEUsIDAsIG51bGwpOwotICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAvLyB0cnkgYWdhaW4gYnkgZGVsZXRpbmcgdGhlIG9sZCBkYiBhbmQgY3JlYXRlIGEgbmV3IG9uZQotICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmRlbGV0ZURhdGFiYXNlKENBQ0hFX0RBVEFCQVNFX0ZJTEUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1DYWNoZURhdGFiYXNlID0gY29udGV4dC5vcGVuT3JDcmVhdGVEYXRhYmFzZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBDQUNIRV9EQVRBQkFTRV9GSUxFLCAwLCBudWxsKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIG1DYWNoZURhdGFiYXNlIHNob3VsZCBub3QgYmUgbnVsbCwgCi0gICAgICAgICAgICAvLyB0aGUgb25seSBjYXNlIGlzIFJlcXVlc3RBUEkgdGVzdCBoYXMgcHJvYmxlbSB0byBjcmVhdGUgZGIgCi0gICAgICAgICAgICBpZiAobUNhY2hlRGF0YWJhc2UgIT0gbnVsbAotICAgICAgICAgICAgICAgICAgICAmJiBtQ2FjaGVEYXRhYmFzZS5nZXRWZXJzaW9uKCkgIT0gQ0FDSEVfREFUQUJBU0VfVkVSU0lPTikgewotICAgICAgICAgICAgICAgIG1DYWNoZURhdGFiYXNlLmJlZ2luVHJhbnNhY3Rpb24oKTsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICB1cGdyYWRlQ2FjaGVEYXRhYmFzZSgpOwotICAgICAgICAgICAgICAgICAgICBib290c3RyYXBDYWNoZURhdGFiYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1DYWNoZURhdGFiYXNlLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOwotICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgIG1DYWNoZURhdGFiYXNlLmVuZFRyYW5zYWN0aW9uKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIEVyYXNlIHRoZSBmaWxlcyBmcm9tIHRoZS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lVXJsQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgotICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX1VSTF9DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUZpbGVQYXRoQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgotICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0ZJTEVfUEFUSF9DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUxhc3RNb2RpZnlDb2xJbmRleCA9IG1DYWNoZUluc2VydGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAuZ2V0Q29sdW1uSW5kZXgoQ0FDSEVfTEFTVF9NT0RJRllfQ09MKTsKLSAgICAgICAgICAgICAgICBtQ2FjaGVFVGFnQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgotICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0VUQUdfQ09MKTsKLSAgICAgICAgICAgICAgICBtQ2FjaGVFeHBpcmVzQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgotICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0VYUElSRVNfQ09MKTsKLSAgICAgICAgICAgICAgICBtQ2FjaGVFeHBpcmVzU3RyaW5nQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgotICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0VYUElSRVNfU1RSSU5HX0NPTCk7Ci0gICAgICAgICAgICAgICAgbUNhY2hlTWltZVR5cGVDb2xJbmRleCA9IG1DYWNoZUluc2VydGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAuZ2V0Q29sdW1uSW5kZXgoQ0FDSEVfTUlNRVRZUEVfQ09MKTsKLSAgICAgICAgICAgICAgICBtQ2FjaGVFbmNvZGluZ0NvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9FTkNPRElOR19DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUh0dHBTdGF0dXNDb2xJbmRleCA9IG1DYWNoZUluc2VydGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAuZ2V0Q29sdW1uSW5kZXgoQ0FDSEVfSFRUUF9TVEFUVVNfQ09MKTsKLSAgICAgICAgICAgICAgICBtQ2FjaGVMb2NhdGlvbkNvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9MT0NBVElPTl9DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUNvbnRlbnRMZW5ndGhDb2xJbmRleCA9IG1DYWNoZUluc2VydGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAuZ2V0Q29sdW1uSW5kZXgoQ0FDSEVfQ09OVEVOVExFTkdUSF9DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUNvbnRlbnREaXNwb3NpdGlvbkNvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9DT05URU5URElTUE9TSVRJT05fQ09MKTsKLSAgICAgICAgICAgICAgICBtQ2FjaGVDcm9zc0RvbWFpbkNvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9DUk9TU0RPTUFJTl9DT0wpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbURhdGFiYXNlID0gY29udGV4dC5vcGVuT3JDcmVhdGVEYXRhYmFzZShEQVRBQkFTRV9GSUxFLCAwLCBudWxsKTsKKyAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIC8vIHRyeSBhZ2FpbiBieSBkZWxldGluZyB0aGUgb2xkIGRiIGFuZCBjcmVhdGUgYSBuZXcgb25lCisgICAgICAgICAgICBpZiAoY29udGV4dC5kZWxldGVEYXRhYmFzZShEQVRBQkFTRV9GSUxFKSkgeworICAgICAgICAgICAgICAgIG1EYXRhYmFzZSA9IGNvbnRleHQub3Blbk9yQ3JlYXRlRGF0YWJhc2UoREFUQUJBU0VfRklMRSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgcmV0dXJuIG1JbnN0YW5jZTsKKyAgICAgICAgLy8gbURhdGFiYXNlIHNob3VsZCBub3QgYmUgbnVsbCwKKyAgICAgICAgLy8gdGhlIG9ubHkgY2FzZSBpcyBSZXF1ZXN0QVBJIHRlc3QgaGFzIHByb2JsZW0gdG8gY3JlYXRlIGRiCisgICAgICAgIGlmIChtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICAgICAgbUluaXRpYWxpemVkID0gdHJ1ZTsKKyAgICAgICAgICAgIG5vdGlmeSgpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1EYXRhYmFzZS5nZXRWZXJzaW9uKCkgIT0gREFUQUJBU0VfVkVSU0lPTikgeworICAgICAgICAgICAgbURhdGFiYXNlLmJlZ2luVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgdXBncmFkZURhdGFiYXNlKCk7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBtRGF0YWJhc2UuZW5kVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIHVzZSBwZXIgdGFibGUgTXV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QUNIRV9DUk9TU0RPTUFJTl9DT0wpOworCisgICAgICAgIC8vIFRocmVhZCBkb25lLCBub3RpZnkuCisgICAgICAgIG1Jbml0aWFsaXplZCA9IHRydWU7CisgICAgICAgIG5vdGlmeSgpOwogICAgIH0KIAogICAgIHByaXZhdGUgc3RhdGljIHZvaWQgdXBncmFkZURhdGFiYXNlKCkgewpAQCAtMzkxLDggKzQyMiwyNSBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgLy8gV2FpdCBmb3IgdGhlIGJhY2tncm91bmQgaW5pdGlhbGl6YXRpb24gdGhyZWFkIHRvIGNvbXBsZXRlIGFuZCBjaGVjayB0aGUKKyAgICAvLyBkYXRhYmFzZSBjcmVhdGlvbiBzdGF0dXMuCisgICAgcHJpdmF0ZSBib29sZWFuIGNoZWNrSW5pdGlhbGl6ZWQoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgd2hpbGUgKCFtSW5pdGlhbGl6ZWQpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICB3YWl0KCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJDYXVnaHQgZXhjZXB0aW9uIHdoaWxlIGNoZWNraW5nICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbml0aWFsaXphdGlvbiIpOworICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsIExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKGUpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1EYXRhYmFzZSAhPSBudWxsOworICAgIH0KKwogICAgIHByaXZhdGUgYm9vbGVhbiBoYXNFbnRyaWVzKGludCB0YWJsZUlkKSB7Ci0gICAgICAgIGlmIChtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAKQEAgLTQyMiw3ICs0NzAsNyBAQAogICAgICAqLwogICAgIEFycmF5TGlzdDxDb29raWU+IGdldENvb2tpZXNGb3JEb21haW4oU3RyaW5nIGRvbWFpbikgewogICAgICAgICBBcnJheUxpc3Q8Q29va2llPiBsaXN0ID0gbmV3IEFycmF5TGlzdDxDb29raWU+KCk7Ci0gICAgICAgIGlmIChkb21haW4gPT0gbnVsbCB8fCBtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoZG9tYWluID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuIGxpc3Q7CiAgICAgICAgIH0KIApAQCAtNDgxLDcgKzUyOSw3IEBACiAgICAgICogICAgICAgICAgICBkZWxldGVkLgogICAgICAqLwogICAgIHZvaWQgZGVsZXRlQ29va2llcyhTdHJpbmcgZG9tYWluLCBTdHJpbmcgcGF0aCwgU3RyaW5nIG5hbWUpIHsKLSAgICAgICAgaWYgKGRvbWFpbiA9PSBudWxsIHx8IG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmIChkb21haW4gPT0gbnVsbCB8fCAhY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIApAQCAtNTAxLDcgKzU0OSw3IEBACiAgICAgICovCiAgICAgdm9pZCBhZGRDb29raWUoQ29va2llIGNvb2tpZSkgewogICAgICAgICBpZiAoY29va2llLmRvbWFpbiA9PSBudWxsIHx8IGNvb2tpZS5wYXRoID09IG51bGwgfHwgY29va2llLm5hbWUgPT0gbnVsbAotICAgICAgICAgICAgICAgIHx8IG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTUzNCw3ICs1ODIsNyBAQAogICAgICAqIENsZWFyIGNvb2tpZSBkYXRhYmFzZQogICAgICAqLwogICAgIHZvaWQgY2xlYXJDb29raWVzKCkgewotICAgICAgICBpZiAobURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKCFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC01NDcsNyArNTk1LDcgQEAKICAgICAgKiBDbGVhciBzZXNzaW9uIGNvb2tpZXMsIHdoaWNoIG1lYW5zIGNvb2tpZSBkb2Vzbid0IGhhdmUgRVhQSVJFUy4KICAgICAgKi8KICAgICB2b2lkIGNsZWFyU2Vzc2lvbkNvb2tpZXMoKSB7Ci0gICAgICAgIGlmIChtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTU2NCw3ICs2MTIsNyBAQAogICAgICAqIEBwYXJhbSBub3cgVGltZSBmb3Igbm93CiAgICAgICovCiAgICAgdm9pZCBjbGVhckV4cGlyZWRDb29raWVzKGxvbmcgbm93KSB7Ci0gICAgICAgIGlmIChtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTYyMCw3ICs2NjgsNyBAQAogICAgICAqIEByZXR1cm4gQ2FjaGVSZXN1bHQgVGhlIENhY2hlTWFuYWdlci5DYWNoZVJlc3VsdAogICAgICAqLwogICAgIENhY2hlUmVzdWx0IGdldENhY2hlKFN0cmluZyB1cmwpIHsKLSAgICAgICAgaWYgKHVybCA9PSBudWxsIHx8IG1DYWNoZURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKHVybCA9PSBudWxsIHx8ICFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CiAKQEAgLTY2MCw3ICs3MDgsNyBAQAogICAgICAqIEBwYXJhbSB1cmwgVGhlIHVybAogICAgICAqLwogICAgIHZvaWQgcmVtb3ZlQ2FjaGUoU3RyaW5nIHVybCkgewotICAgICAgICBpZiAodXJsID09IG51bGwgfHwgbUNhY2hlRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAodXJsID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTY3NCw3ICs3MjIsNyBAQAogICAgICAqIEBwYXJhbSBjIFRoZSBDYWNoZU1hbmFnZXIuQ2FjaGVSZXN1bHQKICAgICAgKi8KICAgICB2b2lkIGFkZENhY2hlKFN0cmluZyB1cmwsIENhY2hlUmVzdWx0IGMpIHsKLSAgICAgICAgaWYgKHVybCA9PSBudWxsIHx8IG1DYWNoZURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKHVybCA9PSBudWxsIHx8ICFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC03MDAsNyArNzQ4LDcgQEAKICAgICAgKiBDbGVhciBjYWNoZSBkYXRhYmFzZQogICAgICAqLwogICAgIHZvaWQgY2xlYXJDYWNoZSgpIHsKLSAgICAgICAgaWYgKG1DYWNoZURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKCFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC03MDgsNyArNzU2LDcgQEAKICAgICB9CiAKICAgICBib29sZWFuIGhhc0NhY2hlKCkgewotICAgICAgICBpZiAobUNhY2hlRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAKQEAgLTgzNCw3ICs4ODIsNyBAQAogICAgICAqLwogICAgIHZvaWQgc2V0VXNlcm5hbWVQYXNzd29yZChTdHJpbmcgc2NoZW1lUGx1c0hvc3QsIFN0cmluZyB1c2VybmFtZSwKICAgICAgICAgICAgICAgICBTdHJpbmcgcGFzc3dvcmQpIHsKLSAgICAgICAgaWYgKHNjaGVtZVBsdXNIb3N0ID09IG51bGwgfHwgbURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKHNjaGVtZVBsdXNIb3N0ID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTg1Niw3ICs5MDQsNyBAQAogICAgICAqICAgICAgICAgU3RyaW5nWzFdIGlzIHBhc3N3b3JkLiBSZXR1cm4gbnVsbCBpZiBpdCBjYW4ndCBmaW5kIGFueXRoaW5nLgogICAgICAqLwogICAgIFN0cmluZ1tdIGdldFVzZXJuYW1lUGFzc3dvcmQoU3RyaW5nIHNjaGVtZVBsdXNIb3N0KSB7Ci0gICAgICAgIGlmIChzY2hlbWVQbHVzSG9zdCA9PSBudWxsIHx8IG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmIChzY2hlbWVQbHVzSG9zdCA9PSBudWxsIHx8ICFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CiAKQEAgLTkwMiw3ICs5NTAsNyBAQAogICAgICAqIENsZWFyIHBhc3N3b3JkIGRhdGFiYXNlCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgY2xlYXJVc2VybmFtZVBhc3N3b3JkKCkgewotICAgICAgICBpZiAobURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaW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uYW1lUGFzc3dvcmQoKSB7Ci0gICAgICAgIGlmIChtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTEwMjAsNyArMTA2OCw3IEBACiAgICAgICogQHBhcmFtIGZvcm1kYXRhIFRoZSBmb3JtIGRhdGEgaW4gSGFzaE1hcAogICAgICAqLwogICAgIHZvaWQgc2V0Rm9ybURhdGEoU3RyaW5nIHVybCwgSGFzaE1hcDxTdHJpbmcsIFN0cmluZz4gZm9ybWRhdGEpIHsKLSAgICAgICAgaWYgKHVybCA9PSBudWxsIHx8IGZvcm1kYXRhID09IG51bGwgfHwgbURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKHVybCA9PSBudWxsIHx8IGZvcm1kYXRhID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTEwNjksNyArMTExNyw3IEBACiAgICAgICovCiAgICAgQXJyYXlMaXN0PFN0cmluZz4gZ2V0Rm9ybURhdGEoU3RyaW5nIHVybCwgU3RyaW5nIG5hbWUpIHsKICAgICAgICAgQXJyYXlMaXN0PFN0cmluZz4gdmFsdWVzID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7Ci0gICAgICAgIGlmICh1cmwgPT0gbnVsbCB8fCBuYW1lID09IG51bGwgfHwgbURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKHVybCA9PSBudWxsIHx8IG5hbWUgPT0gbnVsbCB8fCAhY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm4gdmFsdWVzOwogICAgICAgICB9CiAKQEAgLTExMjksNyArMTE3Nyw3IEBACiAgICAgICogQ2xlYXIgZm9ybSBkYXRhYmFzZQogICAgICAqLwogICAgIHB1YmxpYyB2b2l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5pc1pvb21TY2FsZUZpeGVkKCkpIHsKKworICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRWaXNpYmxlKHRydWUpOworCisgICAgICAgICAgICBXZWJTZXR0aW5ncyBzZXR0aW5ncyA9IG1XZWJWaWV3LmdldFNldHRpbmdzKCk7CisgICAgICAgICAgICBpbnQgY291bnQgPSBzZXR0aW5ncy5nZXREb3VibGVUYXBUb2FzdENvdW50KCk7CisgICAgICAgICAgICBpZiAobVpvb21NYW5hZ2VyLmlzSW5ab29tT3ZlcnZpZXcoKSAmJiBjb3VudCA+IDApIHsKKyAgICAgICAgICAgICAgICBzZXR0aW5ncy5zZXREb3VibGVUYXBUb2FzdENvdW50KC0tY291bnQpOworICAgICAgICAgICAgICAgIFRvYXN0Lm1ha2VUZXh0KG1XZWJWaWV3LmdldENvbnRleHQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmRvdWJsZV90YXBfdG9hc3QsCisgICAgICAgICAgICAgICAgICAgICAgICBUb2FzdC5MRU5HVEhfTE9ORykuc2hvdygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaGlkZSgpIHsKKyAgICAgICAgaWYgKG1ab29tQnV0dG9uc0NvbnRyb2xsZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRWaXNpYmxlKGZhbHNlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzVmlzaWJsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIgIT0gbnVsbCAmJiBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLmlzVmlzaWJsZSgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHVwZGF0ZSgpIHsKKyAgICAgICAgaWYgKG1ab29tQnV0dG9uc0NvbnRyb2xsZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgYm9vbGVhbiBjYW5ab29tSW4gPSBtWm9vbU1hbmFnZXIuY2FuWm9vbUluKCk7CisgICAgICAgIGJvb2xlYW4gY2FuWm9vbU91dCA9IG1ab29tTWFuYWdlci5jYW5ab29tT3V0KCkgJiYgIW1ab29tTWFuYWdlci5pc0luWm9vbU92ZXJ2aWV3KCk7CisgICAgICAgIGlmICghY2FuWm9vbUluICYmICFjYW5ab29tT3V0KSB7CisgICAgICAgICAgICAvLyBIaWRlIHRoZSB6b29tIGluIGFuZCBvdXQgYnV0dG9ucyBpZiB0aGUgcGFnZSBjYW5ub3Qgem9vbQorICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5nZXRab29tQ29udHJvbHMoKS5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBTZXQgZWFjaCBvbmUgaW5kaXZpZHVhbGx5LCBhcyBhIHBhZ2UgbWF5IGJlIGFibGUgdG8gem9vbSBpbiBvciBvdXQKKyAgICAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuc2V0Wm9vbUluRW5hYmxlZChjYW5ab29tSW4pOworICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRab29tT3V0RW5hYmxlZChjYW5ab29tT3V0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgWm9vbUJ1dHRvbnNDb250cm9sbGVyIGdldENvbnRyb2xzKCkgeworICAgICAgICBpZiAobVpvb21CdXR0b25zQ29udHJvbGxlciA9PSBudWxsKSB7CisgICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyID0gbmV3IFpvb21CdXR0b25zQ29udHJvbGxlcihtV2ViVmlldyk7CisgICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLnNldE9uWm9vbUxpc3RlbmVyKG5ldyBab29tTGlzdGVuZXIoKSk7CisgICAgICAgICAgICAvLyBab29tQnV0dG9uc0NvbnRyb2xsZXIgcG9zaXRpb25zIHRoZSBidXR0b25zIGF0IHRoZSBib3R0b20sIGJ1dCBpbgorICAgICAgICAgICAgLy8gdGhlIG1pZGRsZS4gQ2hhbmdlIHRoZWlyIGxheW91dCBwYXJhbWV0ZXJzIHNvIHRoZXkgYXBwZWFyIG9uIHRoZQorICAgICAgICAgICAgLy8gcmlnaHQuCisgICAgICAgICAgICBWaWV3IGNvbnRyb2xzID0gbVpvb21CdXR0b25zQ29udHJvbGxlci5nZXRab29tQ29udHJvbHMoKTsKKyAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMgcGFyYW1zID0gY29udHJvbHMuZ2V0TGF5b3V0UGFyYW1zKCk7CisgICAgICAgICAgICBpZiAocGFyYW1zIGluc3RhbmNlb2YgRnJhbWVMYXlvdXQuTGF5b3V0UGFyYW1zKSB7CisgICAgICAgICAgICAgICAgKChGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMpIHBhcmFtcykuZ3Jhdml0eSA9IEdyYXZpdHkuUklHSFQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1ab29tQnV0dG9uc0NvbnRyb2xsZXI7CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBab29tTGlzdGVuZXIgaW1wbGVtZW50cyBab29tQnV0dG9uc0NvbnRyb2xsZXIuT25ab29tTGlzdGVuZXIgeworCisgICAgICAgIHB1YmxpYyB2b2lkIG9uVmlzaWJpbGl0eUNoYW5nZWQoYm9vbGVhbiB2aXNpYmxlKSB7CisgICAgICAgICAgICBpZiAodmlzaWJsZSkgeworICAgICAgICAgICAgICAgIG1XZWJWaWV3LnN3aXRjaE91dERyYXdIaXN0b3J5KCk7CisgICAgICAgICAgICAgICAgLy8gQnJpbmcgYmFjayB0aGUgaGlkZGVuIHpvb20gY29udHJvbHMuCisgICAgICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5nZXRab29tQ29udHJvbHMoKS5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICAgICAgdXBkYXRlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblpvb20oYm9vbGVhbiB6b29tSW4pIHsKKyAgICAgICAgICAgIGlmICh6b29tSW4pIHsKKyAgICAgICAgICAgICAgICBtV2ViVmlldy56b29tSW4oKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuem9vbU91dCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdXBkYXRlKCk7CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvWm9vbUNvbnRyb2xFeHRlcm5hbC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvd2Via2l0L1pvb21Db250cm9sRXh0ZXJuYWwuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kNzUzMTNlCi0tLSAvZGV2L251bGwKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvd2Via2l0L1pvb21Db250cm9sRXh0ZXJuYWwuamF2YQpAQCAtMCwwICsxLDE1OSBAQAorLyoKKyAqIENvcHlyaWdodCAoQykgMjAxMCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0CisgKgorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBh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oZSB0aW1lIHRoYXQgdGhlIGV4dGVybmFsIGNvbnRyb2xzIGFyZSB2aXNpYmxlIGJlZm9yZSBmYWRpbmcgYXdheQorICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGxvbmcgWk9PTV9DT05UUk9MU19USU1FT1VUID0KKyAgICAgICAgICAgIFZpZXdDb25maWd1cmF0aW9uLmdldFpvb21Db250cm9sc1RpbWVvdXQoKTsKKyAgICAvLyBUaGUgdmlldyBjb250YWluaW5nIHRoZSBleHRlcm5hbCB6b29tIGNvbnRyb2xzCisgICAgcHJpdmF0ZSBFeHRlbmRlZFpvb21Db250cm9scyBtWm9vbUNvbnRyb2xzOworICAgIHByaXZhdGUgUnVubmFibGUgbVpvb21Db250cm9sUnVubmFibGU7CisgICAgcHJpdmF0ZSBmaW5hbCBIYW5kbGVyIG1Qcml2YXRlSGFuZGxlciA9IG5ldyBIYW5kbGVyKCk7CisKKyAgICBwcml2YXRlIGZpbmFsIFdlYlZpZXcgbVdlYlZpZXc7CisKKyAgICBwdWJsaWMgWm9vbUNvbnRyb2xFeHRlcm5hbChXZWJWaWV3IHdlYlZpZXcpIHsKKyAgICAgICAgbVdlYlZpZXcgPSB3ZWJWaWV3OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgIGlmKG1ab29tQ29udHJvbFJ1bm5hYmxlICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVDYWxsYmFja3MobVpvb21Db250cm9sUnVubmFibGUpOworICAgICAgICB9CisgICAgICAgIGdldENvbnRyb2xzKCkuc2hvdyh0cnVlKTsKKyAgICAgICAgbVByaXZhdGVIYW5kbGVyLnBvc3REZWxheWVkKG1ab29tQ29udHJvbFJ1bm5hYmxlLCBaT09NX0NPTlRST0xTX1RJTUVPVVQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGhpZGUoKSB7CisgICAgICAgIGlmIChtWm9vbUNvbnRyb2xSdW5uYWJsZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobVpvb21Db250cm9scyAhPSBudWxsKSB7CisgICAgICAgICAgICBtWm9vbUNvbnRyb2xzLmhpZGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzVmlzaWJsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1ab29tQ29udHJvbHMgIT0gbnVsbCAmJiBtWm9vbUNvbnRyb2xzLmlzU2hvd24oKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1cGRhdGUoKSB7IH0KKworICAgIHB1YmxpYyBFeHRlbmRlZFpvb21Db250cm9scyBnZXRDb250cm9scygpIHsKKyAgICAgICAgaWYgKG1ab29tQ29udHJvbHMgPT0gbnVsbCkgeworICAgICAgICAgICAgbVpvb21Db250cm9scyA9IGNyZWF0ZVpvb21Db250cm9scygpOworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogbmVlZCB0byBiZSBzZXQgdG8gVklTSUJMRSBmaXJzdCBzbyB0aGF0IGdldE1lYXN1cmVkSGVpZ2h0KCkgaW4KKyAgICAgICAgICAgICAqIHtAbGluayAjb25TaXplQ2hhbmdlZCgpfSBjYW4gcmV0dXJuIHRoZSBtZWFzdXJlZCB2YWx1ZSBmb3IgcHJvcGVyCisgICAgICAgICAgICAgKiBsYXlvdXQuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIG1ab29tQ29udHJvbHMuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgbVpvb21Db250cm9sUnVubmFibGUgPSBuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICAvKiBEb24ndCBkaXNtaXNzIHRoZSBjb250cm9scyBpZiB0aGUgdXNlciBoYXMKKyAgICAgICAgICAgICAgICAgICAgICogZm9jdXMgb24gdGhlbS4gV2FpdCBhbmQgY2hlY2sgYWdhaW4gbGF0ZXIuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBpZiAoIW1ab29tQ29udHJvbHMuaGFzRm9jdXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21Db250cm9scy5oaWRlKCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5wb3N0RGVsYXllZChtWm9vbUNvbnRyb2xSdW5uYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWk9PTV9DT05UUk9MU19USU1FT1VUKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1ab29tQ29udHJvbHM7CisgICAgfQorCisgICAgcHJpdmF0ZSBFeHRlbmRlZFpvb21Db250cm9scyBjcmVhdGVab29tQ29udHJvbHMoKSB7CisgICAgICAgIEV4dGVuZGVkWm9vbUNvbnRyb2xzIHpvb21Db250cm9scyA9IG5ldyBFeHRlbmRlZFpvb21Db250cm9scyhtV2ViVmlldy5nZXRDb250ZXh0KCkpOworICAgICAgICB6b29tQ29udHJvbHMuc2V0T25ab29tSW5DbGlja0xpc3RlbmVyKG5ldyBPbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgIC8vIHJlc2V0IHRpbWUgb3V0CisgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7CisgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnBvc3REZWxheWVkKG1ab29tQ29udHJvbFJ1bm5hYmxlLCBaT09NX0NPTlRST0xTX1RJTUVPVVQpOworICAgICAgICAgICAgICAgIG1XZWJWaWV3Lnpvb21JbigpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICAgICAgem9vbUNvbnRyb2xzLnNldE9uWm9vbU91dENsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICAgICAgLy8gcmVzZXQgdGltZSBvdXQKKyAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKKyAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsIFpPT01fQ09OVFJPTFNfVElNRU9VVCk7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuem9vbU91dCgpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICAgICAgcmV0dXJuIHpvb21Db250cm9sczsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBFeHRlbmRlZFpvb21Db250cm9scyBleHRlbmRzIEZyYW1lTGF5b3V0IHsKKworICAgICAgICBwcml2YXRlIGFuZHJvaWQud2lkZ2V0Llpvb21Db250cm9scyBtUGx1c01pbnVzWm9vbUNvbnRyb2xzOworCisgICAgICAgIHB1YmxpYyBFeHRlbmRlZFpvb21Db250cm9scyhDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIG51bGwpOworICAgICAgICAgICAgTGF5b3V0SW5mbGF0ZXIgaW5mbGF0ZXIgPSAoTGF5b3V0SW5mbGF0ZXIpCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LkxBWU9VVF9JTkZMQVRFUl9TRVJWSUNFKTsKKyAgICAgICAgICAgIGluZmxhdGVyLmluZmxhdGUoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQuem9vbV9tYWduaWZ5LCB0aGlzLCB0cnVlKTsKKyAgICAgICAgICAgIG1QbHVzTWludXNab29tQ29udHJvbHMgPSAoYW5kcm9pZC53aWRnZXQuWm9vbUNvbnRyb2xzKSBmaW5kVmlld0J5SWQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuem9vbUNvbnRyb2xzKTsKKyAgICAgICAgICAgIGZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnpvb21NYWduaWZ5KS5zZXRWaXNpYmlsaXR5KAorICAgICAgICAgICAgICAgICAgICBWaWV3LkdPTkUpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2hvdyhib29sZWFuIHNob3dab29tKSB7CisgICAgICAgICAgICBtUGx1c01pbnVzWm9vbUNvbnRyb2xzLnNldFZpc2liaWxpdHkoc2hvd1pvb20gPyBWaWV3LlZJU0lCTEUgOiBWaWV3LkdPTkUpOworICAgICAgICAgICAgZmFkZShWaWV3LlZJU0lCTEUsIDAuMGYsIDEuMGYpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgaGlkZSgpIHsKKyAgICAgICAgICAgIGZhZGUoVmlldy5HT05FLCAxLjBmLCAwLjBmKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBmYWRlKGludCB2aXNpYmlsaXR5LCBmbG9hdCBzdGFydEFscGhhLCBmbG9hdCBlbmRBbHBoYSkgeworICAgICAgICAgICAgQWxwaGFBbmltYXRpb24gYW5pbSA9IG5ldyBBbHBoYUFuaW1hdGlvbihzdGFydEFscGhhLCBlbmRBbHBoYSk7CisgICAgICAgICAgICBhbmltLnNldER1cmF0aW9uKDUwMCk7CisgICAgICAgICAgICBzdGFydEFuaW1hdGlvbihhbmltKTsKKyAgICAgICAgICAgIHNldFZpc2liaWxpdHkodmlzaWJpbGl0eSk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNGb2N1cygpIHsKKyAgICAgICAgICAgIHJldHVybiBtUGx1c01pbnVzWm9vbUNvbnRyb2xzLmhhc0ZvY3VzKCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRPblpvb21JbkNsaWNrTGlzdGVuZXIoT25DbGlja0xpc3RlbmVyIGxpc3RlbmVyKSB7CisgICAgICAgICAgICBtUGx1c01pbnVzWm9vbUNvbnRyb2xzLnNldE9uWm9vbUluQ2xpY2tMaXN0ZW5lcihsaXN0ZW5lcik7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRPblpvb21PdXRDbGlja0xpc3RlbmVyKE9uQ2xpY2tMaXN0ZW5lciBsaXN0ZW5lcikgeworICAgICAgICAgICAgbVBsdXNNaW51c1pvb21Db250cm9scy5zZXRPblpvb21PdXRDbGlja0xpc3RlbmVyKGxpc3RlbmVyKTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9ab29tTWFuYWdlci5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvd2Via2l0L1pvb21NYW5hZ2VyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZGQ4MTJkNAotLS0gL2Rldi9udWxsCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9ab29tTWFuYWdlci5qYXZhCkBAIC0wLDAgKzEs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IGZsb2F0IGdldEludkRlZmF1bHRTY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1JbnZEZWZhdWx0U2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldERlZmF1bHRNYXhab29tU2NhbGUoKSB7CisgICAgICAgIHJldHVybiBtRGVmYXVsdE1heFpvb21TY2FsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgZmxvYXQgZ2V0RGVmYXVsdE1pblpvb21TY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1EZWZhdWx0TWluWm9vbVNjYWxlOworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBpbnQgZ2V0RG9jdW1lbnRBbmNob3JYKCkgeworICAgICAgICByZXR1cm4gbUFuY2hvclg7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGludCBnZXREb2N1bWVudEFuY2hvclkoKSB7CisgICAgICAgIHJldHVybiBtQW5jaG9yWTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgdm9pZCBjbGVhckRvY3VtZW50QW5jaG9yKCkgeworICAgICAgICBtQW5jaG9yWCA9IG1BbmNob3JZID0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgdm9pZCBzZXRab29tQ2VudGVyKGZsb2F0IHgsIGZsb2F0IHkpIHsKKyAgICAgICAgbVpvb21DZW50ZXJYID0geDsKKyAgICAgICAgbVpvb21DZW50ZXJZID0geTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgdm9pZCBzZXRJbml0aWFsU2NhbGVJblBlcmNlbnQoaW50IHNjYWxlSW5QZXJjZW50KSB7CisgICAgICAgIG1Jbml0aWFsU2NhbGUgPSBzY2FsZUluUGVyY2VudCAqIDAuMDFmOworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBmbG9hdCBjb21wdXRlU2NhbGVXaXRoTGltaXRzKGZsb2F0IHNjYWxlKSB7CisgICAgICAgIGlmIChzY2FsZSA8IG1NaW5ab29tU2NhbGUpIHsKKyAgICAgICAgICAgIHNjYWxlID0gbU1pblpvb21TY2FsZTsKKyAgICAgICAgfSBlbHNlIGlmIChzY2FsZSA+IG1NYXhab29tU2NhbGUpIHsKKyAgICAgICAgICAgIHNjYWxlID0gbU1heFpvb21TY2FsZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gc2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGJvb2xlYW4gaXNab29tU2NhbGVGaXhlZCgpIHsKKyAgICAgICAgcmV0dXJuIG1NaW5ab29tU2NhbGUgPj0gbU1heFpvb21TY2FsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGJvb2xlYW4gZXhjZWVkc01pblNjYWxlSW5jcmVtZW50KGZsb2F0IHNjYWxlQSwgZmxvYXQgc2NhbGVCKSB7CisgICAgICAgIHJldHVybiBNYXRoLmFicyhzY2FsZUEgLSBzY2FsZUIpID49IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5UOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIHdpbGxTY2FsZVRyaWdnZXJab29tKGZsb2F0IHNjYWxlKSB7CisgICAgICAgIHJldHVybiBleGNlZWRzTWluU2NhbGVJbmNyZW1lbnQoc2NhbGUsIG1BY3R1YWxTY2FsZSk7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGJvb2xlYW4gY2FuWm9vbUluKCkgeworICAgICAgICByZXR1cm4gbU1heFpvb21TY2FsZSAtIG1BY3R1YWxTY2FsZSA+IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5UOworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBib29sZWFuIGNhblpvb21PdXQoKSB7CisgICAgICAgIHJldHVybiBtQWN0dWFsU2NhbGUgLSBtTWluWm9vbVNjYWxlID4gTUlOSU1VTV9TQ0FMRV9JTkNSRU1FTlQ7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gem9vbUluKCkgeworICAgICAgICByZX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ksIHRoZSBXZWJWaWV3IGNhbiBjaGVjayB0byBzZWUgaWYgc3VjaCBhbiBhbmltYXRpb24gaXMgY3VycmVudGx5CisgICAgICogaW4gcHJvZ3Jlc3MgYnkgY2FsbGluZyBpc0ZpeGVkTGVuZ3RoQW5pbWF0aW9uSW5Qcm9ncmVzcygpLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGFuaW1hdGVab29tKENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgaWYgKG1ab29tU2NhbGUgPT0gMCkgeworICAgICAgICAgICAgTG9nLncoTE9HVEFHLCAiQSBXZWJWaWV3IGlzIGF0dGVtcHRpbmcgdG8gcGVyZm9ybSBhIGZpeGVkIGxlbmd0aCAiCisgICAgICAgICAgICAgICAgICAgICsgInpvb20gYW5pbWF0aW9uIHdoZW4gbm8gem9vbSBpcyBpbiBwcm9ncmVzcyIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZmxvYXQgem9vbVNjYWxlOworICAgICAgICBpbnQgaW50ZXJ2YWwgPSAoaW50KSAoU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkgLSBtWm9vbVN0YXJ0KTsKKyAgICAgICAgaWYgKGludGVydmFsIDwgWk9PTV9BTklNQVRJT05fTEVOR1RIKSB7CisgICAgICAgICAgICBmbG9hdCByYXRpbyA9IChmbG9hdCkgaW50ZXJ2YWwgLyBaT09NX0FOSU1BVElPTl9MRU5HVEg7CisgICAgICAgICAgICB6b29tU2NhbGUgPSAxLjBmIC8gKG1JbnZJbml0aWFsWm9vbVNjYWxlCisgICAgICAgICAgICAgICAgICAgICsgKG1JbnZGaW5hbFpvb21TY2FsZSAtIG1JbnZJbml0aWFsWm9vbVNjYWxlKSAqIHJhdGlvKTsKKyAgICAgICAgICAgIG1XZWJWaWV3LmludmFsaWRhdGUoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHpvb21TY2FsZSA9IG1ab29tU2NhbGU7CisgICAgICAgICAgICAvLyBzZXQgbVpvb21TY2FsZSB0byBiZSAwIGFzIHdlIGhhdmUgZmluaXNoZWQgYW5pbWF0aW5nCisgICAgICAgICAgICBtWm9vbVNjYWxlID0gMDsKKyAgICAgICAgICAgIG1XZWJWaWV3Lm9uRml4ZWRMZW5ndGhab29tQW5pbWF0aW9uRW5kKCk7CisgICAgICAgIH0KKyAgICAgICAgLy8gY2FsY3VsYXRlIHRoZSBpbnRlcm1lZGlhdGUgc2Nyb2xsIHBvc2l0aW9uLiBTaW5jZSB3ZSBuZWVkIHRvIHVzZQorICAgICAgICAvLyB6b29tU2NhbGUsIHdlIGNhbid0IHVzZSB0aGUgV2ViVmlldydzIHBpbkxvY1gvWSBmdW5jdGlvbnMgZGlyZWN0bHkuCisgICAgICAgIGZsb2F0IHNjYWxlID0gem9vbVNjYWxlICogbUludkluaXRpYWxab29tU2NhbGU7CisgICAgICAgIGludCB0eCA9IE1hdGgucm91bmQoc2NhbGUgKiAobUluaXRpYWxTY3JvbGxYICsgbVpvb21DZW50ZXJYKSAtIG1ab29tQ2VudGVyWCk7CisgICAgICAgIHR4ID0gLVdlYlZpZXcucGluTG9jKHR4LCBtV2ViVmlldy5nZXRWaWV3V2lkdGgoKSwgTWF0aC5yb3VuZChtV2ViVmlldy5nZXRDb250ZW50V2lkdGgoKQorICAgICAgICAgICAgICAgICogem9vbVNjYWxlKSkgKyBtV2ViVmlldy5nZXRTY3JvbGxYKCk7CisgICAgICAgIGludCB0aXRsZUhlaWdodCA9IG1XZWJWaWV3LmdldFRpdGxlSGVpZ2h0KCk7CisgICAgICAgIGludCB0eSA9IE1hdGgucm91bmQoc2NhbGUKKyAgICAgICAgICAgICAgICAqIChtSW5pdGlhbFNjcm9sbFkgKyBtWm9vbUNlbnRlclkgLSB0aXRsZUhlaWdodCkKKyAgICAgICAgICAgICAgICAtIChtWm9vbUNlbnRlclkgLSB0aXRsZUhlaWdodCkpOworICAgICAgICB0eSA9IC0odHkgPD0gdGl0bGVI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YWxlLCBzY2FsZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1BY3R1YWxTY2FsZSA9IHNjYWxlOworICAgICAgICAgICAgbUludkFjdHVhbFNjYWxlID0gMSAvIHNjYWxlOworCisgICAgICAgICAgICBpZiAoIW1XZWJWaWV3LmRyYXdIaXN0b3J5KCkpIHsKKworICAgICAgICAgICAgICAgIC8vIElmIGhpc3RvcnkgUGljdHVyZSBpcyBkcmF3biwgZG9uJ3QgdXBkYXRlIHNjcm9sbC4gVGhleSB3aWxsCisgICAgICAgICAgICAgICAgLy8gYmUgdXBkYXRlZCB3aGVuIHdlIGdldCBvdXQgb2YgdGhhdCBtb2RlLgorICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSBvdXIgc2Nyb2xsIHNvIHdlIGRvbid0IGFwcGVhciB0byBqdW1wCisgICAgICAgICAgICAgICAgLy8gaS5lLiBrZWVwIHRoZSBjZW50ZXIgb2YgdGhlIGRvYyBpbiB0aGUgY2VudGVyIG9mIHRoZSB2aWV3CisgICAgICAgICAgICAgICAgaW50IG9sZFggPSBtV2ViVmlldy5nZXRTY3JvbGxYKCk7CisgICAgICAgICAgICAgICAgaW50IG9sZFkgPSBtV2ViVmlldy5nZXRTY3JvbGxZKCk7CisgICAgICAgICAgICAgICAgZmxvYXQgcmF0aW8gPSBzY2FsZSAqIG9sZEludlNjYWxlOworICAgICAgICAgICAgICAgIGZsb2F0IHN4ID0gcmF0aW8gKiBvbGRYICsgKHJhdGlvIC0gMSkgKiBtWm9vbUNlbnRlclg7CisgICAgICAgICAgICAgICAgZmxvYXQgc3kgPSByYXRpbyAqIG9sZFkgKyAocmF0aW8gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgKiAobVpvb21DZW50ZXJZIC0gbVdlYlZpZXcuZ2V0VGl0bGVIZWlnaHQoKSk7CisKKyAgICAgICAgICAgICAgICAvLyBTY2FsZSBhbGwgdGhlIGNoaWxkIHZpZXdzCisgICAgICAgICAgICAgICAgbVdlYlZpZXcubVZpZXdNYW5hZ2VyLnNjYWxlQWxsKCk7CisKKyAgICAgICAgICAgICAgICAvLyBhcyB3ZSBkb24ndCBoYXZlIGFuaW1hdGlvbiBmb3Igc2NhbGluZywgZG9uJ3QgZG8gYW5pbWF0aW9uCisgICAgICAgICAgICAgICAgLy8gZm9yIHNjcm9sbGluZywgYXMgaXQgY2F1c2VzIHdlaXJkIGludGVybWVkaWF0ZSBzdGF0ZQorICAgICAgICAgICAgICAgIGludCBzY3JvbGxYID0gbVdlYlZpZXcucGluTG9jWChNYXRoLnJvdW5kKHN4KSk7CisgICAgICAgICAgICAgICAgaW50IHNjcm9sbFkgPSBtV2ViVmlldy5waW5Mb2NZKE1hdGgucm91bmQoc3kpKTsKKyAgICAgICAgICAgICAgICBpZighbVdlYlZpZXcudXBkYXRlU2Nyb2xsQ29vcmRpbmF0ZXMoc2Nyb2xsWCwgc2Nyb2xsWSkpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhlIHNjcm9sbCBwb3NpdGlvbiBpcyBhZGp1c3RlZCBhdCB0aGUgYmVnaW5uaW5nIG9mIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyB6b29tIGFuaW1hdGlvbi4gQnV0IHdlIHdhbnQgdG8gdXBkYXRlIHRoZSBXZWJLaXQgYXQgdGhlCisgICAgICAgICAgICAgICAgICAgIC8vIGVuZCBvZiB0aGUgem9vbSBhbmltYXRpb24uIFNlZSBjb21tZW50cyBpbiBvblNjYWxlRW5kKCkuCisgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3LnNlbmRPdXJWaXNpYmxlUmVjdCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gaWYgdGhlIHdlIG5lZWQgdG8gcmVmbG93IHRoZSB0ZXh0IHRoZW4gZm9yY2UgdGhlIFZJRVdfU0laRV9DSEFOR0VECisgICAgICAgICAgICAvLyBldmVudCB0byBiZSBzZW50IHRvIFdlYktpdAorICA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ubVZpZXdNYW5hZ2VyLmhpdFRlc3QobUFuY2hvclgsIG1BbmNob3JZKTsKKyAgICAgICAgaWYgKHBsdWdpbiAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAobVdlYlZpZXcuaXNQbHVnaW5GaXRPblNjcmVlbihwbHVnaW4pKSB7CisgICAgICAgICAgICAgICAgem9vbVRvT3ZlcnZpZXcoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuY2VudGVyRml0UmVjdChwbHVnaW4ueCwgcGx1Z2luLnksIHBsdWdpbi53aWR0aCwgcGx1Z2luLmhlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBmaW5hbCBmbG9hdCBuZXdUZXh0V3JhcFNjYWxlOworICAgICAgICBpZiAoc2V0dGluZ3MuZ2V0VXNlRml4ZWRWaWV3cG9ydCgpKSB7CisgICAgICAgICAgICBuZXdUZXh0V3JhcFNjYWxlID0gTWF0aC5tYXgobUFjdHVhbFNjYWxlLCBnZXRSZWFkaW5nTGV2ZWxTY2FsZSgpKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG5ld1RleHRXcmFwU2NhbGUgPSBtQWN0dWFsU2NhbGU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHNldHRpbmdzLmlzTmFycm93Q29sdW1uTGF5b3V0KCkKKyAgICAgICAgICAgICAgICAmJiBleGNlZWRzTWluU2NhbGVJbmNyZW1lbnQobVRleHRXcmFwU2NhbGUsIG5ld1RleHRXcmFwU2NhbGUpKSB7CisgICAgICAgICAgICBtVGV4dFdyYXBTY2FsZSA9IG5ld1RleHRXcmFwU2NhbGU7CisgICAgICAgICAgICByZWZyZXNoWm9vbVNjYWxlKHRydWUpOworICAgICAgICB9IGVsc2UgaWYgKCFtSW5ab29tT3ZlcnZpZXcpIHsKKyAgICAgICAgICAgIHpvb21Ub092ZXJ2aWV3KCk7C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b1pvb21BbmltYXRpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIC8vIGxpbWl0IHRoZSBzY2FsZSBjaGFuZ2UgcGVyIHN0ZXAKKyAgICAgICAgICAgICAgICBpZiAoc2NhbGUgPiBtQWN0dWFsU2NhbGUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NhbGUgPSBNYXRoLm1pbihzY2FsZSwgbUFjdHVhbFNjYWxlICogMS4yNWYpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gTWF0aC5tYXgoc2NhbGUsIG1BY3R1YWxTY2FsZSAqIDAuOGYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzZXRab29tQ2VudGVyKGRldGVjdG9yLmdldEZvY3VzWCgpLCBkZXRlY3Rvci5nZXRGb2N1c1koKSk7CisgICAgICAgICAgICAgICAgc2V0Wm9vbVNjYWxlKHNjYWxlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25TY2FsZUVuZChTY2FsZUdlc3R1cmVEZXRlY3RvciBkZXRlY3RvcikgeworICAgICAgICAgICAgaWYgKG1QaW5jaFRvWm9vbUFuaW1hdGluZykgeworICAgICAgICAgICAgICAgIG1QaW5jaFRvWm9vbUFuaW1hdGluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgIG1BbmNob3JYID0gbVdlYlZpZXcudmlld1RvQ29udGVudFgoKGludCkgbVpvb21DZW50ZXJYICsgbVdlYlZpZXcuZ2V0U2Nyb2xsWCgpKTsKKyAgICAgICAgICAgICAgICBtQW5jaG9yWSA9IG1XZWJWaWV3LnZpZXdUb0NvbnRlbnRZKChpbnQpIG1ab29tQ2VudGVyWSArIG1XZWJWaWV3LmdldFNjcm9sbFkoKSk7CisgICAgICAgICAgICAgICAgLy8gZG9uJ3QgcmVmbG93IHdoZW4gem9vbSBpbjsgd2hlbiB6b29tIG91dCwgZG8gcmVmbG93IGlmIHRoZQorICAgICAgICAgICAgICAgIC8vIG5ldyBzY2FsZSBpcyBhbG1vc3QgbWluaW11bSBzY2FsZS4KKyAgICAgICAgICAgICAgICBib29sZWFuIHJlZmxvd05vdyA9ICFjYW5ab29tT3V0KCkgfHwgKG1BY3R1YWxTY2FsZSA8PSAwLjggKiBtVGV4dFdyYXBTY2FsZSk7CisgICAgICAgICAgICAgICAgLy8gZm9yY2Ugem9vbSBhZnRlciBtUHJldmlld1pvb21Pbmx5IGlzIHNldCB0byBmYWxzZSBzbyB0aGF0IHRoZQorICAgICAgICAgICAgICAgIC8vIG5ldyB2aWV3IHNpemUgd2lsbCBiZSBwYXNzZWQgdG8gdGhlIFdlYktpdAorICAgICAgICAgICAgICAgIHJlZnJlc2hab29tU2NhbGUocmVmbG93Tm93ICYmCisgICAgICAgICAgICAgICAgICAgICFtV2ViVmlldy5nZXRTZXR0aW5ncygpLmdldFVzZUZpeGVkVmlld3BvcnQoKSk7CisgICAgICAgICAgICAgICAgLy8gY2FsbCBpbnZhbGlkYXRlKCkgdG8gZHJhdyB3aXRob3V0IHpvb20gZmlsdGVyCisgICAgICAgICAgICAgICAgbVdlYlZpZXcuaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtV2ViVmlldy5tVmlld01hbmFnZXIuZW5kWm9vbSgpOworICAgICAgICAgICAgbVdlYlZpZXcub25QaW5jaFRvWm9vbUFuaW1hdGlvbkVuZChkZXRlY3Rvcik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvblNpemVDaGFuZ2VkKGludCB3LCBpbnQgaCwgaW50IG93LCBpbnQgb2gpIHsKKyAgICAgICAgLy8gcmVzZXQgem9vbSBhbmQgYW5jaG9yIHR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xlIGlmIHRoZSB3aWR0aCBjaGFuZ2VkLgorICAgICAgICBtV2ViVmlldy5wb3N0KG5ldyBQb3N0U2NhbGUodyAhPSBvdyAmJgorICAgICAgICAgICAgIW1XZWJWaWV3LmdldFNldHRpbmdzKCkuZ2V0VXNlRml4ZWRWaWV3cG9ydCgpKSk7CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBQb3N0U2NhbGUgaW1wbGVtZW50cyBSdW5uYWJsZSB7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gbVVwZGF0ZVRleHRXcmFwOworCisgICAgICAgIHB1YmxpYyBQb3N0U2NhbGUoYm9vbGVhbiB1cGRhdGVUZXh0V3JhcCkgeworICAgICAgICAgICAgbVVwZGF0ZVRleHRXcmFwID0gdXBkYXRlVGV4dFdyYXA7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICBpZiAobVdlYlZpZXcuZ2V0V2ViVmlld0NvcmUoKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgLy8gd2UgYWx3YXlzIGZvcmNlLCBpbiBjYXNlIG91ciBoZWlnaHQgY2hhbmdlZCwgaW4gd2hpY2ggY2FzZSB3ZQorICAgICAgICAgICAgICAgIC8vIHN0aWxsIHdhbnQgdG8gc2VuZCB0aGUgbm90aWZpY2F0aW9uIG92ZXIgdG8gd2Via2l0LgorICAgICAgICAgICAgICAgIHNldFpvb21TY2FsZShNYXRoLm1heChtQWN0dWFsU2NhbGUsIGdldFpvb21PdmVydmlld1NjYWxlKCkpLAorICAgICAgICAgICAgICAgICAgICBtVXBkYXRlVGV4dFdyYXAsIHRydWUpOworICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgem9vbSBidXR0b25zIGFzIHRoZSBzY2FsZSBjYW4gYmUgY2hhbmdlZAorICAgICAgICAgICAgICAgIHVwZGF0ZVpvb21QaWNrZXIoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHVwZGF0ZVpvb21SYW5nZShXZWJWaWV3Q29yZS5WaWV3U3RhdGUgdmlld1N0YXRlLAorICAgICAgICAgICAgaW50IHZpZXdXaWR0aCwgaW50IG1pblByZWZXaWR0aCkgeworICAgICAgICBpZiAodmlld1N0YXRlLm1NaW5TY2FsZSA9PSAwKSB7CisgICAgICAgICAgICBpZiAodmlld1N0YXRlLm1Nb2JpbGVTaXRlKSB7CisgICAgICAgICAgICAgICAgaWYgKG1pblByZWZXaWR0aCA+IE1hdGgubWF4KDAsIHZpZXdXaWR0aCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IChmbG9hdCkgdmlld1dpZHRoIC8gbWluUHJlZldpZHRoOworICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlRml4ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gdmlld1N0YXRlLm1EZWZhdWx0U2NhbGU7CisgICAgICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGVGaXhlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gbURlZmF1bHRNaW5ab29tU2NhbGU7CisgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZUZpeGVkID0gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gdmlld1N0YXRlLm1NaW5TY2FsZTsKKyAgICAgICAgICAgIG1NaW5ab29tU2NhbGVGaXhlZCA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHZpZXdTdGF0ZS5tTWF4U2NhbGUgPT0gMCkgeworICAgICAgICAgICAgbU1heFpvb21TY2FsZSA9IG1EZWZhdWx0TWF4Wm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NYXhWaWV3cG9ydFdpZHRoLAorICAgICAgICAgICAgICAgICAgICBNYXRoLm1heCgoaW50KSAodmlld1dpZHRoICogbUludkRlZmF1bHRTY2FsZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5tYXgoZHJhd0RhdGEubU1pblByZWZXaWR0aCwgZHJhd0RhdGEubVZpZXdTaXplLngpKSkpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgY29udGVudFdpZHRoID0gZHJhd0RhdGEubUNvbnRlbnRTaXplLng7CisgICAgICAgICAgICAgICAgc2V0Wm9vbU92ZXJ2aWV3V2lkdGgoTWF0aC5taW4oV2ViVmlldy5zTWF4Vmlld3BvcnRXaWR0aCwgY29udGVudFdpZHRoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmaW5hbCBmbG9hdCB6b29tT3ZlcnZpZXdTY2FsZSA9IGdldFpvb21PdmVydmlld1NjYWxlKCk7CisgICAgICAgIGlmICghbU1pblpvb21TY2FsZUZpeGVkKSB7CisgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gem9vbU92ZXJ2aWV3U2NhbGU7CisgICAgICAgIH0KKyAgICAgICAgLy8gZml0IHRoZSBjb250ZW50IHdpZHRoIHRvIHRoZSBjdXJyZW50IHZpZXcuIElnbm9yZSB0aGUgcm91bmRpbmcgZXJyb3IgY2FzZS4KKyAgICAgICAgaWYgKCFtV2ViVmlldy5kcmF3SGlzdG9yeSgpICYmIChtSW5pdGlhbFpvb21PdmVydmlldyB8fCAobUluWm9vbU92ZXJ2aWV3CisgICAgICAgICAgICAgICAgJiYgTWF0aC5hYnMoKHZpZXdXaWR0aCAqIG1JbnZBY3R1YWxTY2FsZSkgLSBtWm9vbU92ZXJ2aWV3V2lkdGgpID4gMSkpKSB7CisgICAgICAgICAgICBtSW5pdGlhbFpvb21PdmVydmlldyA9IGZhbHNlOworICAgICAgICAgICAgc2V0Wm9vbVNjY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1N0YXRlID0gZHJhd0RhdGEubVZpZXdTdGF0ZTsKKyAgICAgICAgZmluYWwgUG9pbnQgdmlld1NpemUgPSBkcmF3RGF0YS5tVmlld1NpemU7CisgICAgICAgIHVwZGF0ZVpvb21SYW5nZSh2aWV3U3RhdGUsIHZpZXdTaXplLngsIGRyYXdEYXRhLm1NaW5QcmVmV2lkdGgpOworICAgICAgICBpZiAobVdlYlZpZXcuZ2V0U2V0dGluZ3MoKS5nZXRVc2VXaWRlVmlld1BvcnQoKSAmJgorICAgICAgICAgICAgbVdlYlZpZXcuZ2V0U2V0dGluZ3MoKS5nZXRVc2VGaXhlZFZpZXdwb3J0KCkpIHsKKyAgICAgICAgICAgIGZpbmFsIGludCBjb250ZW50V2lkdGggPSBkcmF3RGF0YS5tQ29udGVudFNpemUueDsKKyAgICAgICAgICAgIHNldFpvb21PdmVydmlld1dpZHRoKE1hdGgubWluKFdlYlZpZXcuc01heFZpZXdwb3J0V2lkdGgsIGNvbnRlbnRXaWR0aCkpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCFtV2ViVmlldy5kcmF3SGlzdG9yeSgpKSB7CisgICAgICAgICAgICBmbG9hdCBzY2FsZTsKKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVmbG93VGV4dDsKKyAgICAgICAgICAgIFdlYlNldHRpbmdzIHNldHRpbmdzID0gbVdlYlZpZXcuZ2V0U2V0dGluZ3MoKTsKKworICAgICAgICAgICAgaWYgKG1Jbml0aWFsU2NhbGUgPiAwKSB7CisgICAgICAgICAgICAgICAgc2NhbGUgPSBtSW5pdGlhbFNjYWxlOworICAgICAgICAgICAgICAgIHJlZmxvd1RleHQgPSBleGNlZWRzTWluU2NhbGVJbmNyZW1lbnQobVRleHRXcmFwU2NhbGUsIHNjYWxlKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodmlld1N0YXRlLm1WaWV3U2NhbGUgPiAwKSB7CisgICAgICAgICAgICAgICAgbVRleHRXcmFwU2NhbGUgPSB2aWV3U3RhdGUubVRleHRXcmFwU2NhbGU7CisgICAgICAgICAgICAgICAgc2NhbGUgPSB2aWV3U3RhdGUubVZpZXdTY2FsZTsKKyAgICAgICAgICAgICAgICByZWZsb3dUZXh0ID0gZmFsc2U7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNjYWxlID0gZ2V0Wm9vbU92ZXJ2aWV3U2NhbGUoKTsKKyAgICAgICAgICAgICAgICBpZiAoc2V0dGluZ3MuZ2V0VXNlV2lkZVZpZXdQb3J0KCkKKyAgICAgICAgICAgICAgICAgICAgJiYgc2V0dGluZ3MuZ2V0TG9hZFdpdGhPdmVydmlld01vZGUoKSkgeworICAgICAgICAgICAgICAgICAgICBtSW5pdGlhbFpvb21PdmVydmlldyA9IHRydWU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2NhbGUgPSBNYXRoLm1heCh2aWV3U3RhdGUubVRleHRXcmFwU2NhbGUsIHNjYWxlKTsKKyAgICAgICAgICAgICAgICAgICAgbUluaXRpYWxab29tT3ZlcnZpZXcgPSAhZXhjZWVkc01pblNjYWxlSW5jcmVtZW50KHNjYWxlLCBnZXRab29tT3ZlcnZpZXdTY2FsZSgpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHNldHRpbmdzLmlzTmFycm93Q29sdW1uTGF5b3V0KCkgJiYgc2V0dGluZ3MuZ2V0VXNlRml4ZWRWaWV3cG9ydCgpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gZmlyc3QgbGF5b3V0LCByZWZsb3cgdXNpbmcgdGhlIHJlYWRpbmcgbGV2ZWwgc2NhbGUgdG8gYXZvaWQKKyAgICAgICAgICAgICAgICAgICAgLy8gcmVmbG93IHdoZW4gZG91YmxlIHRhcHBlZC4KKyAgICAgICAgICAgICAgICAgICAgbVRleHRXcmFwU2NhbGUgPSBnZXRSZWFkaW5nTGV2ZWxTY2FsZ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XcmFwU2NhbGUgPSBiLmdldEZsb2F0KCJ0ZXh0d3JhcFNjYWxlIiwgbUFjdHVhbFNjYWxlKTsKKyAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gYi5nZXRCb29sZWFuKCJvdmVydmlldyIpOworICAgIH0KKworICAgIHByaXZhdGUgWm9vbUNvbnRyb2xCYXNlIGdldEN1cnJlbnRab29tQ29udHJvbCgpIHsKKyAgICAgICAgaWYgKG1XZWJWaWV3LmdldFNldHRpbmdzKCkgIT0gbnVsbCAmJiBtV2ViVmlldy5nZXRTZXR0aW5ncygpLnN1cHBvcnRab29tKCkpIHsKKyAgICAgICAgICAgIGlmIChtV2ViVmlldy5nZXRTZXR0aW5ncygpLmdldEJ1aWx0SW5ab29tQ29udHJvbHMoKSkgeworICAgICAgICAgICAgICAgIGlmICgobUVtYmVkZGVkWm9vbUNvbnRyb2wgPT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIG1XZWJWaWV3LmdldFNldHRpbmdzKCkuZ2V0RGlzcGxheVpvb21Db250cm9scygpKSB7CisgICAgICAgICAgICAgICAgICAgIG1FbWJlZGRlZFpvb21Db250cm9sID0gbmV3IFpvb21Db250cm9sRW1iZWRkZWQodGhpcywgbVdlYlZpZXcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbUVtYmVkZGVkWm9vbUNvbnRyb2w7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChtRXh0ZXJuYWxab29tQ29udHJvbCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1FeHRlcm5hbFpvb21Db250cm9sID0gbmV3IFpvb21Db250cm9sRXh0ZXJuYWwobVdlYlZpZXcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbUV4dGVybmFsWm9vbUNvbnRyb2w7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaW52b2tlWm9vbVBpY2tlcigpIHsKKyAgICAgICAgWm9vbUNvbnRyb2xCYXNlIGNvbnRyb2wgPSBnZXRDdXJyZW50Wm9vbUNvbnRyb2woKTsKKyAgICAgICAgaWYgKGNvbnRyb2wgIT0gbnVsbCkgeworICAgICAgICAgICAgY29udHJvbC5zaG93KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBkaXNtaXNzWm9vbVBpY2tlcigpIHsKKyAgICAgICAgWm9vbUNvbnRyb2xCYXNlIGNvbnRyb2wgPSBnZXRDdXJyZW50Wm9vbUNvbnRyb2woKTsKKyAgICAgICAgaWYgKGNvbnRyb2wgIT0gbnVsbCkgeworICAgICAgICAgICAgY29udHJvbC5oaWRlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc1pvb21QaWNrZXJWaXNpYmxlKCkgeworICAgICAgICBab29tQ29udHJvbEJhc2UgY29udHJvbCA9IGdldEN1cnJlbnRab29tQ29udHJvbCgpOworICAgICAgICByZXR1cm4gKGNvbnRyb2wgIT0gbnVsbCkgPyBjb250cm9sLmlzVmlzaWJsZSgpIDogZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdXBkYXRlWm9vbVBpY2tlcigpIHsKKyAgICAgICAgWm9vbUNvbnRyb2xCYXNlIGNvbnRyb2wgPSBnZXRDdXJyZW50Wm9vbUNvbnRyb2woKTsKKyAgICAgICAgaWYgKGNvbnRyb2wgIT0gbnVsbCkgeworICAgICAgICAgICAgY29udHJvbC51cGRhdGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFRoZSBlbWJlZGRlZCB6b29tIGNvbnRyb2wgaW50ZXJjZXB0cyB0b3VjaCBldmVudHMgYW5kIGF1dG9tYXRpY2FsbHkgc3RheXMKKyAgICAgKiB2aXNpYmxlLiBUaGUgZXh0ZXJuYWwgY29udHJvbCBuZWVkcyB0byBjb25zdGFudGx5IHJlZnJlc2ggaXRzIGludGVybmFsCisgICAgICogdGltZXIgdG8gc3RheSB2aXNpYmxlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGtlZXBab29tUGlja2VyVmlzaWJsZSgpIHsKKyAgICAgICAgWm9vbUNvbnRyb2xCYXNlIGNvbnRyb2wgPSBnZXRDdXJyZW50Wm9vbUNvbnRyb2woKTsKKyAgICAgICAgaWYgKGNvbnRyb2wgIT0gbnVsbCAmJiBjb250cm9sID09IG1FeHRlcm5hbFpvb21Db250cm9sKSB7CisgICAgICAgICAgICBjb250cm9sLnNob3coKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBWaWV3IGdldEV4dGVybmFsWm9vbVBpY2tlcigpIHsKKyAgICAgICAgWm9vbUNvbnRyb2xCYXNlIGNvbnRyb2wgPSBnZXRDdXJyZW50Wm9vbUNvbnRyb2woKTsKKyAgICAgICAgaWYgKGNvbnRyb2wgIT0gbnVsbCAmJiBjb250cm9sID09IG1FeHRlcm5hbFpvb21Db250cm9sKSB7CisgICAgICAgICAgICByZXR1cm4gbUV4dGVybmFsWm9vbUNvbnRyb2wuZ2V0Q29udHJvbHMoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvd2lkZ2V0L0Fic0xpc3RWaWV3LmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvQWJzTGlzdFZpZXcuamF2YQppbmRleCA5YTM4YWNjLi40ZTkwZWNkIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvQWJzTGlzdFZpZXcuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvQWJzTGlzdFZpZXcuamF2YQpAQCAtMTksNyArMTksNyBAQAogaW1wb3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rIExpc3RBZGFwdGVyI2hhc1N0YWJsZUlkcygpfSA9PSB7QGNvZGUgdHJ1ZX0pCisgICAgICoKKyAgICAgKiBAcmV0dXJuIEEgbmV3IGFycmF5IHdoaWNoIGNvbnRhaW5zIHRoZSBpZCBvZiBlYWNoIGNoZWNrZWQgaXRlbSBpbiB0aGUKKyAgICAgKiAgICAgICAgIGxpc3QuCisgICAgICovCisgICAgcHVibGljIGxvbmdbXSBnZXRDaGVja2VkSXRlbUlkcygpIHsKKyAgICAgICAgaWYgKG1DaG9pY2VNb2RlID09IENIT0lDRV9NT0RFX05PTkUgfHwgbUNoZWNrZWRJZFN0YXRlcyA9PSBudWxsIHx8IG1BZGFwdGVyID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgbG9uZ1swXTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIExvbmdTcGFyc2VBcnJheTxCb29sZWFuPiBpZFN0YXRlcyA9IG1DaGVja2VkSWRTdGF0ZXM7CisgICAgICAgIGZpbmFsIGludCBjb3VudCA9IGlkU3RhdGVzLnNpemUoKTsKKyAgICAgICAgZmluYWwgbG9uZ1tdIGlkcyA9IG5ldyBsb25nW2NvdW50XTsKKworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGlkc1tpXSA9IGlkU3RhdGVzLmtleUF0KGkpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGlkczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDbGVhciBhbnkgY2hvaWNlcyBwcmV2aW91c2x5IHNldAorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGNsZWFyQ2hvaWNlcygpIHsKKyAgICAgICAgaWYgKG1DaGVja1N0YXRlcyAhPSBudWxsKSB7CisgICAgICAgICAgICBtQ2hlY2tTdGF0ZXMuY2xlYXIoKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUNoZWNrZWRJZFN0YXRlcyAhPSBudWxs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Nb2RlQ2FsbGJhY2spOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1DaG9pY2VNb2RlID09IENIT0lDRV9NT0RFX01VTFRJUExFIHx8IG1DaG9pY2VNb2RlID09IENIT0lDRV9NT0RFX01VTFRJUExFX01PREFMKSB7CisgICAgICAgICAgICBib29sZWFuIG9sZFZhbHVlID0gbUNoZWNrU3RhdGVzLmdldChwb3NpdGlvbik7CisgICAgICAgICAgICBtQ2hlY2tTdGF0ZXMucHV0KHBvc2l0aW9uLCB2YWx1ZSk7CisgICAgICAgICAgICBpZiAobUNoZWNrZWRJZFN0YXRlcyAhPSBudWxsICYmIG1BZGFwdGVyLmhhc1N0YWJsZUlkcygpKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIG1DaGVja2VkSWRTdGF0ZXMucHV0KG1BZGFwdGVyLmdldEl0ZW1JZChwb3NpdGlvbiksIEJvb2xlYW4uVFJVRSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbUNoZWNrZWRJZFN0YXRlcy5kZWxldGUobUFkYXB0ZXIuZ2V0SXRlbUlkKHBvc2l0aW9uKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG9sZFZhbHVlICE9IHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIG1DaGVja2VkSXRlbUNvdW50Kys7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbUNoZWNrZWRJdGVtQ291bnQtLTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUNob2ljZUFjdGlvbk1vZGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgaWQgPSBtQWRhcHRlci5nZXRJdGVtSWQocG9zaXRpb24pOworICAgICAgICAgICAgICAgIG1NdWx0aUNob2ljZU1vZGVDYWxsYmFjay5vbkl0ZW1DaGVja2VkU3RhdGVDaGFuZ2VkKG1DaG9pY2VBY3Rpb25Nb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24sIGlkLCB2YWx1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBib29sZWFuIHVwZGF0ZUlkcyA9IG1DaGVja2VkSWRTdGF0ZXMgIT0gbnVsbCAmJiBtQWRhcHRlci5oYXNTdGFibGVJZHMoKTsKKyAgICAgICAgICAgIC8vIENsZWFyIGFsbCB2YWx1ZXMgaWYgd2UncmUgY2hlY2tpbmcgc29tZXRoaW5nLCBvciB1bmNoZWNraW5nIHRoZSBjdXJyZW50bHkKKyAgICAgICAgICAgIC8vIHNlbGVjdGVkIGl0ZW0KKyAgICAgICAgICAgIGlmICh2YWx1ZSB8fCBpc0l0ZW1DaGVja2VkKHBvc2l0aW9uKSkgeworICAgICAgICAgICAgICAgIG1DaGVja1N0YXRlcy5jbGVhcigpOworICAgICAgICAgICAgICAgIGlmICh1cGRhdGVJZHMpIHsKKyAgICAgICAgICAgICAgICAgICAgbUNoZWNrZWRJZFN0YXRlcy5jbGVhcigpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIHRoaXMgbWF5IGVuZCB1cCBzZWxlY3RpbmcgdGhlIHZhbHVlIHdlIGp1c3QgY2xlYXJlZCBidXQgdGhpcyB3YXkKKyAgICAgICAgICAgIC8vIHdlIGVuc3VyZSBsZW5ndGggb2YgbUNoZWNrU3RhdGVzIGlzIDEsIGEgZmFjdCBnZXRDaGVja2VkSXRlbVBvc2l0aW9uIHJlbGllcyBvbgorICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgbUNoZWNrU3RhdGVzLnB1dChwb3NpdGlvbiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgaWYgKHVwZGF0ZUlkcykgeworICAgICAgICAgICAgICAgICAgICBtQ2hlY2tlZElkU3RhdGVzLnB1dChtQWRhcHRlci5nZXRJdGVtSWQocG9zaXRpb24pLCBCb29sZWFuLlRSVUUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtQ2hlY2tlZEl0ZW1Db3VudCA9IDE7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1DaGVja1N0YXRlcy5zaXplKCkgPT0gMCB8fCAhbUNoZWNrU3RhdGVzLnZhbHVlQXQoMCkpIHsKKyAgICAgICAgICAgICAgICBtQ2hlY2tlZEl0ZW1Db3VudCA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBEbyBub3QgZ2VuZXJhdGUgYSBkYXRhIGNoYW5nZSB3aGlsZSB3ZSBhcmUgaW4gdGhlIGxheW91dCBwaGFzZQorICAgICAgICBpZiAoIW1JbkxheW91dCAmJiAhbUJsb2NrTGF5b3V0UmVxdWVzdHMpIHsKKyAgICAgICAgICAgIG1EYXRhQ2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICByZW1lbWJlclN5bmNTdGF0ZSgpOworICAgICAgICAgICAgcmVxdWVzdExheW91dCgpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gcGVyZm9ybUl0ZW1DbGljayhWaWV3IHZpZXcsIGludCBwb3NpdGlvbiwgbG9uZyBpZCkgeworICAgICAgICBib29sZWFuIGhhbmRsZWQgPSBmYWxzZTsKKyAgICAgICAgYm9vbGVhbiBkaXNwYXRjaEl0ZW1DbGljayA9IHRydWU7CisKKyAgICAgICAgaWYgKG1DaG9pY2VNb2RlICE9IENIT0lDRV9NT0RFX05PTkUpIHsKKyAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlOworCisgICAgICAgICAgICBpZiAobUNob2ljZU1vZGUgPT0gQ0hPSUNFX01PREVfTVVMVElQTEUgfHwKKyAgICAgICAgICAgICAgICAgICAgKG1DaG9pY2VNb2RlID09IENIT0lDRV9NT0RFX01VTFRJUExFX01PREFMICYmIG1DaG9pY2VBY3Rpb25Nb2RlICE9IG51bGwpKSB7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBuZXdWYWx1ZSA9ICFtQ2hlY2tTdGF0ZXMuZ2V0KHBvc2l0aW9uLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgbUNoZWNrU3RhdGVzLnB1dChwb3NpdGlvbiwgbmV3VmFsdWUpOworICAgICAgICAgICAgICAgIGlmIChtQ2hlY2tlZElkU3RhdGVzICE9IG51bGwgJiYgbUFkYXB0ZXIuaGFzU3RhYmxlSWRzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ2hlY2tlZElkU3RhdGVzLnB1dChtQWRhcHRlci5nZXRJdGVtSWQocG9zaXRpb24pLCBCb29sZWFuLlRSVUUpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbUNoZWNrZWRJZFN0YXRlcy5kZWxldGUobUFkYXB0ZXIuZ2V0SXRlbUlkKHBvc2l0aW9uKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIG1DaGVja2VkSXRlbUNvdW50Kys7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbUNoZWNrZWRJdGVtQ291bnQtLTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1DaG9pY2VBY3Rpb25Nb2RlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbU11bHRpQ2hvaWNlTW9kZUNhbGxiYWNrLm9uSXRlbUNoZWNrZWRTdGF0ZUNoYW5nZWQobUNob2ljZUFjdGlvbk1vZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24sIGlkLCBuZXdWYWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoSXRlbUNsaWNrID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChtQ2hvaWNlTW9kZSA9PSBDSE9JQ0VfTU9ERV9TSU5HTEUpIHsKKyAgICAgICAgICAgICAgICBib29sZWFuIG5ld1ZhbHVlID0gIW1DaGVja1N0YXRlcy5nZXQocG9zaXRpb24sIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBpZiAobmV3VmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgbUNoZWNrU3RhdGVzLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgIG1DaGVja1N0YXRlcy5wdXQocG9zaXRpb24sIHRydWUpOworICAgICAgICAgICAgICAgICAgICBpZiAobUNoZWNrZWRJZFN0YXRlcyAhPSBudWxsICYmIG1BZGFwdGVyLmhhc1N0YWJsZUlkcygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ2hlY2tlZElkU3RhdGVzLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ2hlY2tlZElkU3RhdGVzLnB1dChtQWRhcHRlci5nZXRJdGVtSWQocG9zaXRpb24pLCBCb29sZWFuLlRSVUUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1DaGVja2VkSXRlbUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1DaGVja1N0YXRlcy5zaXplKCkgPT0gMCB8fCAhbUNoZWNrU3RhdGVzLnZhbHVlQXQoMCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbUNoZWNrZWRJdGVtQ291bnQgPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbURh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ge0BsaW5rICNDSE9JQ0VfTU9ERV9OT05FfSwge0BsaW5rICNDSE9JQ0VfTU9ERV9TSU5HTEV9LCBvcgorICAgICAqIHtAbGluayAjQ0hPSUNFX01PREVfTVVMVElQTEV9CisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0Q2hvaWNlTW9kZShpbnQgY2hvaWNlTW9kZSkgeworICAgICAgICBtQ2hvaWNlTW9kZSA9IGNob2ljZU1vZGU7CisgICAgICAgIGlmIChtQ2hvaWNlQWN0aW9uTW9kZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtQ2hvaWNlQWN0aW9uTW9kZS5maW5pc2goKTsKKyAgICAgICAgICAgIG1DaG9pY2VBY3Rpb25Nb2RlID0gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBpZiAobUNob2ljZU1vZGUgIT0gQ0hPSUNFX01PREVfTk9ORSkgeworICAgICAgICAgICAgaWYgKG1DaGVja1N0YXRlcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUNoZWNrU3RhdGVzID0gbmV3IFNwYXJzZUJvb2xlYW5BcnJheSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG1DaGVja2VkSWRTdGF0ZXMgPT0gbnVsbCAmJiBtQWRhcHRlciAhPSBudWxsICYmIG1BZGFwdGVyLmhhc1N0YWJsZUlkcygpKSB7CisgICAgICAgICAgICAgICAgbUNoZWNrZWRJZFN0YXRlcyA9IG5ldyBMb25nU3BhcnNlQXJyYXk8Qm9vbGVhbj4oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIE1vZGFsIG11bHRpLWNob2ljZSBtb2RlIG9ubHkgaGFzIGNob2ljZXMgd2hlbiB0aGUgbW9kZSBpcyBhY3RpdmUuIENsZWFyIHRoZW0uCisgICAgICAgICAgICBpZiAobUNob2ljZU1vZGUgPT0gQ0hPSUNFX01PREVfTVVMVElQTEVfTU9EQUwpIHsKKyAgICAgICAgICAgICAgICBjbGVhckNob2ljZXMoKTsKKyAgICAgICAgICAgICAgICBzZXRMb25nQ2xpY2thYmxlKHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IGEge0BsaW5rIE11bHRpQ2hvaWNlTW9kZUxpc3RlbmVyfSB0aGF0IHdpbGwgbWFuYWdlIHRoZSBsaWZlY3ljbGUgb2YgdGhlCisgICAgICogc2VsZWN0aW9uIHtAbGluayBBY3Rpb25Nb2RlfS4gT25seSB1c2VkIHdoZW4gdGhlIGNob2ljZSBtb2RlIGlzIHNldCB0bworICAgICAqIHtAbGluayAjQ0hPSUNFX01PREVfTVVMVElQTEVfTU9EQUx9LgorICAgICAqCisgICAgICogQHBhcmFtIGxpc3RlbmVyIExpc3RlbmVyIHRoYXQgd2lsbCBtYW5hZ2UgdGhlIHNlbGVjdGlvbiBtb2RlCisgICAgICoKKyAgICAgKiBAc2VlICNzZXRDaG9pY2VNb2RlKGludCkKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRNdWx0aUNob2ljZU1vZGVMaXN0ZW5lcihNdWx0aUNob2ljZU1vZGVMaXN0ZW5lciBsaXN0ZW5lcikgeworICAgICAgICBpZiAobU11bHRpQ2hvaWNlTW9kZUNhbGxiYWNrID09IG51bGwpIHsKKyAgICAgICAgICAgIG1NdWx0aUNob2ljZU1vZGVDYWxsYmFjayA9IG5ldyBNdWx0aUNob2ljZU1vZGVXcmFwcGVyKCk7CisgICAgICAgIH0KKyAgICAgICAgbU11bHRpQ2hvaWNlTW9kZUNhbGxiYWNrLnNldFdyYXBwZWQobGlzdGVuZXIpOwogICAgIH0KIAogICAgIC8qKgpAQCAtODkzLDYgKzExODIsOCBAQAogICAgICAgICBpbnQgcG9zaXRpb247CiAgICAgICAgIGludCBoZWlnaHQ7CiAgICAgICAgIFN0cmluZyBmaWx0ZXI7CisgICAgICAgIFNwYXJzZUJvb2xlYW5BcnJheSBjaGVja1N0YXRlOworICAgICAgICBMb25nU3BhcnNlQXJyYXk8Qm9vbGVhbj4gY2hlY2tJZFN0YXRlOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBDb25zdHJ1Y3RvciBjYWxsZWQgZnJvbSB7QGxpbmsgQWJzTGlzdFZpZXcjb25TYXZlSW5zdGFuY2VTdGF0ZSgpfQpAQCAtOTEyLDYgKzEyMDMsMTMgQEAKICAgICAgICAgICAgIHBvc2l0aW9uID0gaW4ucmVhZEludCgpOwogICAgICAgICAgICAgaGVpZ2h0ID0gaW4ucmVhZEludCgpOwogICAgICAgICAgICAgZmlsdGVyID0gaW4ucmVhZFN0cmluZygpOworICAgICAgICAgICAgY2hlY2tTdGF0ZSA9IGluLnJlYWRTcGFyc2VCb29sZWFuQXJyYXkoKTsKKyAgICAgICAgICAgIGxvbmdbXSBpZFN0YXRlID0gaW4uY3JlYXRlTG9uZ0FycmF5KCk7CisKKyAgICAgICAgICAgIGlmIChpZFN0YXRlLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICBjaGVja0lkU3RhdGUgPSBuZXcgTG9uZ1NwYXJzZUFycmF5PEJvb2xlYW4+KCk7CisgICAgICAgICAgICAgICAgY2hlY2tJZFN0YXRlLnNldFZhbHVlcyhpZFN0YXRlLCBCb29sZWFuLlRSVUUpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlCkBAIC05MjMsNiArMTIyMSw4IEBACiAgICAgICAgICAgICBvdXQud3JpdGVJbnQocG9zaXRpb24pOwogICAgICAgICAgICAgb3V0LndyaXRlSW50KGhlaWdodCk7CiAgICAgICAgICAgICBvdXQud3JpdGVTdHJpbmcoZmlsdGVyKTsKKyAgICAgICAgICAgIG91dC53cml0ZVNwYXJzZUJvb2xlYW5BcnJheShjaGVja1N0YXRlKTsKKyAgICAgICAgICAgIG91dC53cml0ZUxvbmdBcnJheShjaGVja0lkU3RhdGUgIT0gbnVsbCA/IGNoZWNrSWRTdGF0ZS5nZXRLZXlzKCkgOiBuZXcgbG9uZ1swXSk7CiAgICAgICAgIH0KIAogICAgICAgICBAT3ZlcnJpZGUKQEAgLTkzNCw3ICsxMjM0LDggQEAKICAgICAgICAgICAgICAgICAgICAgKyAiIHZpZXdUb3A9IiArIHZpZXdUb3AKICAgICAgICAgICAgICAgICAgICAgKyAiIHBvc2l0aW9uPSIgKyBwb3NpdGlvbgogICAgICAgICAgICAgICAgICAgICArICIgaGVpZ2h0PSIgKyBoZWlnaHQKLSAgICAgICAgICAgICAgICAgICAgKyAiIGZpbHRlcj0iICsgZmlsdGVyICsgIn0iOworICAgICAgICAgICAgICAgICAgICArICIgZmlsdGVyPSIgKyBmaWx0ZXIKKyAgICAgICAgICAgICAgICAgICAgKyAiIGNoZWNrU3RhdGU9IiArIGNoZWNrU3RhdGUgKyAifSI7CiAgICAgICAgIH0KIAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFBhcmNlbGFibGUuQ3JlYXRvcjxTYXZlZFN0YXRlPiBDUkVBVE9SCkBAIC05OTgsNiArMTI5OSw5IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAorICAgICAgICBzcy5jaGVja1N0YXRlID0gbUNoZWNrU3RhdGVzOworICAgICAgICBzcy5jaGVja0lkU3RhdGUgPSBtQ2hlY2tlZElkU3RhdGVzOworCiAgICAgICAgIHJldHVybiBzczsKICAgICB9CiAKQEAgLTEwMjksNiArMTMzMywxNCBAQAogCiAgICAgICAgIHNldEZpbHRlclRleHQoc3MuZmlsdGVyKTsKIAorICAgICAgICBpZiAoc3MuY2hlY2tTdGF0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtQ2hlY2tTdGF0ZXMgPSBzcy5jaGVja1N0YXRlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHNzLmNoZWNrSWRTdGF0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtQ2hlY2tlZElkU3RhdGVzID0gc3MuY2hlY2tJZFN0YXRlOworICAgICAgICB9CisKICAgICAgICAgcmVxdWVzdExheW91dCgpOwogICAgIH0KIApAQCAtMTE3MSwxMCArMTQ4Myw2IEBACiAgICAgICAgIGludCByZXN1bHQ7CiAgICAgICAgIGlmIChtU21vb3RoU2Nyb2xsYmFyRW5hYmxlZCkgewogICAgICAgICAgICAgcmVzdWx0ID0gTWF0aC5tYXgobUl0ZW1Db3VudCAqIDEwMCwgMCk7Ci0gICAgICAgICAgICBpZiAobVNjcm9sbFkgIT0gMCkgewotICAgICAgICAgICAgICAgIC8vIENvbXBlbnNhdGUgZm9yIG92ZXJzY3JvbGwKLSAgICAgICAgICAgICAgICByZXN1bHQgKz0gTWF0aC5hYnMoKGludCkgKChmbG9hdCkgbVNjcm9sbFkgLyBnZXRIZWlnaHQoKSAqIG1JdGVtQ291bnQgKiAxMDApKTsKLSAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIHJlc3VsdCA9IG1JdGVtQ291bnQ7CiAgICAgICAgIH0KQEAgLTEyNDcsOCArMTU1NSw2IEBACiAKICAgICAgICAgbGF5b3V0Q2hpbGRyZW4oKTsKICAgICAgICAgbUluTGF5b3V0ID0gZmFsc2U7Ci0KLSAgICAgICAgbU92ZXJzY3JvbGxNYXggPSAoYiAtIHQpIC8gT1ZFUlNDUk9MTF9MSU1JVF9ESVZJU09SOwogICAgIH0KIAogICAgIC8qKgpAQCAtMTY3OCw2ICsxOTg0LDE2IEBACiAgICAgICAgICAgICAgICAgdHJlZU9ic2VydmVyLmFkZE9uR2xvYmFsTGF5b3V0TGlzdGVuZXIodGhpcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsICYmIG1EYXRhU2V0T2JzZXJ2ZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgbURhdGFTZXRPYnNlcnZlciA9IG5ldyBBZGFwdGVyRGF0YVNldE9ic2VydmVyKCk7CisgICAgICAgICAgICBtQWRhcHRlci5yZWdpc3RlckRhdGFTZXRPYnNlcnZlcihtRGF0YVNldE9ic2VydmVyKTsKKworICAgICAgICAgICAgLy8gRGF0YSBtYXkgaGF2ZSBjaGFuZ2VkIHdoaWxlIHdlIHdlcmUgZGV0YWNoZWQuIFJlZnJlc2guCisgICAgICAgICAgICBtRGF0YUNoYW5nZWQgPSB0cnVlOworICAgICAgICAgICAgbU9sZEl0ZW1Db3VudCA9IG1JdGVtQ291bnQ7CisgICAgICAgICAgICBtSXRlbUNvdW50ID0gbUFkYXB0ZXIuZ2V0Q291bnQoKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIEBPdmVycmlkZQpAQCAtMTY5OCw2ICsyMDE0LDExIEBACiAgICAgICAgICAgICAgICAgbUdsb2JhbExheW91dExpc3RlbmVyQWRkZWRGaWx0ZXIgPSBmYWxzZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQorCisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtQWRhcHRlci51bnJlZ2lzdGVyRGF0YVNldE9ic2VydmVyKG1EYXRhU2V0T2JzZXJ2ZXIpOworICAgICAgICAgICAgbURhdGFTZXRPYnNlcnZlciA9IG51bGw7CisgICAgICAgIH0KICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTE3MTUsNyArMjAzNiw2IEBACiAgICAgICAgICAgICAgICAgbUZsaW5nUnVubmFibGUuZW5kRmxpbmcoKTsKICAgICAgICAgICAgICAgICBpZiAobVNjcm9sbFkgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsWSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmlzaEdsb3dzKCk7CiAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC0xODQ5LDEwICsyMTY5LDIxIEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIGJvb2xlYW4gcGVyZm9ybUxvbmdQc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BAIC0yMDY0LDE5ICsyMzk0LDYgQEAKICAgICAgICAgICAgICAgICAvLyB0b3VjaCBtb2RlKS4gRm9yY2UgYW4gaW5pdGlhbCBsYXlvdXQgdG8gZ2V0IHJpZCBvZiB0aGUgc2VsZWN0aW9uLgogICAgICAgICAgICAgICAgIGxheW91dENoaWxkcmVuKCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpbnQgdG91Y2hNb2RlID0gbVRvdWNoTW9kZTsKLSAgICAgICAgICAgIGlmICh0b3VjaE1vZGUgPT0gVE9VQ0hfTU9ERV9PVkVSU0NST0xMIHx8IHRvdWNoTW9kZSA9PSBUT1VDSF9NT0RFX09WRVJGTElORykgewotICAgICAgICAgICAgICAgIGlmIChtRmxpbmdSdW5uYWJsZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1GbGluZ1J1bm5hYmxlLmVuZEZsaW5nKCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKG1TY3JvbGxZICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbVNjcm9sbFkgPSAwOwotICAgICAgICAgICAgICAgICAgICBmaW5pc2hHbG93cygpOwotICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogCkBAIC0yMTA3LDYzICsyNDI0LDQ5IEBACiAKICAgICAgICAgc3dpdGNoIChhY3Rpb24gJiBNb3Rpb25FdmVudC5BQ1RJT05fTUFTSykgewogICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOOiB7Ci0gICAgICAgICAgICBzd2l0Y2ggKG1Ub3VjaE1vZGUpIHsKLSAgICAgICAgICAgIGNhc2UgVE9VQ0hfTU9ERV9PVkVSRkxJTkc6IHsKLSAgICAgICAgICAgICAgICBtRmxpbmdSdW5uYWJsZS5lbmRGbGluZygpOwotICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9NT0RFX09WRVJTQ1JPTEw7Ci0gICAgICAgICAgICAgICAgbU1vdGlvblkgPSBtTGFzdFkgPSAoaW50KSBldi5nZXRZKCk7Ci0gICAgICAgICAgICAgICAgbU1vdGlvbkNvcnJlY3Rpb24gPSAwOwotICAgICAgICAgICAgICAgIG1BY3RpdmVQb2ludGVySWQgPSBldi5nZXRQb2ludGVySWQoMCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBtQWN0aXZlUG9pbnRlcklkID0gZXYuZ2V0UG9pbnRlcklkKDApOworICAgICAgICAgICAgZmluYWwgaW50IHggPSAoaW50KSBldi5nZXRYKCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgeSA9IChpbnQpIGV2LmdldFkoKTsKKyAgICAgICAgICAgIGludCBtb3Rpb25Qb3NpdGlvbiA9IHBvaW50VG9Qb3NpdGlvbih4LCB5KTsKKyAgICAgICAgICAgIGlmICghbURhdGFDaGFuZ2VkKSB7CisgICAgICAgICAgICAgICAgaWYgKChtVG91Y2hNb2RlICE9IFRPVUNIX01PREVfRkxJTkcpICYmIChtb3Rpb25Qb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKGdldEFkYXB0ZXIoKS5pc0VuYWJsZWQobW90aW9uUG9zaXRpb24pKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBVc2VyIGNsaWNrZWQgb24gYW4gYWN0dWFsIHZpZXcgKGFuZCB3YXMgbm90IHN0b3BwaW5nIGEgZmxpbmcpLiBJdCBtaWdodCBiZSBhCisgICAgICAgICAgICAgICAgICAgIC8vIGNsaWNrIG9yIGEgc2Nyb2xsLiBBc3N1bWUgaXQgaXMgYSBjbGljayB1bnRpbCBwcm92ZW4gb3RoZXJ3aXNlCisgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9NT0RFX0RPV047CisgICAgICAgICAgICAgICAgICAgIC8vIEZJWE1FIERlYm91bmNlCisgICAgICAgICAgICAgICAgICAgIGlmIChtUGVuZGluZ0NoZWNrRm9yVGFwID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1QZW5kaW5nQ2hlY2tGb3JUYXAgPSBuZXcgQ2hlY2tGb3JUYXAoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBwb3N0RGVsYXllZChtUGVuZGluZ0NoZWNrRm9yVGFwLCBWaWV3Q29uZmlndXJhdGlvbi5nZXRUYXBUaW1lb3V0KCkpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChldi5nZXRFZGdlRmxhZ3MoKSAhPSAwICYmIG1vdGlvblBvc2l0aW9uIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UgY291bGRuJ3QgZmluZCBhIHZpZXcgdG8gY2xpY2sgb24sIGJ1dCB0aGUgZG93biBldmVudCB3YXMgdG91Y2hpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBlZGdlLCB3ZSB3aWxsIGJhaWwgb3V0IGFuZCB0cnkgYWdhaW4uIFRoaXMgYWxsb3dzIHRoZSBlZGdlIGNvcnJlY3RpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvZGUgaW4gVmlld1Jvb3QgdG8gdHJ5IHRvIGZpbmQgYSBuZWFyYnkgdmlldyB0byBzZWxlY3QKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBkZWZhdWx0OiB7Ci0gICAgICAgICAgICAgICAgbUFjdGl2ZVBvaW50ZXJJZCA9IGV2LmdldFBvaW50ZXJJZCgwKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgeCA9IChpbnQpIGV2LmdldFgoKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgeSA9IChpbnQpIGV2LmdldFkoKTsKLSAgICAgICAgICAgICAgICBpbnQgbW90aW9uUG9zaXRpb24gPSBwb2ludFRvUG9zaXRpb24oeCwgeSk7Ci0gICAgICAgICAgICAgICAgaWYgKCFtRGF0YUNoYW5nZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChtVG91Y2hNb2RlICE9IFRPVUNIX01PREVfRkxJTkcpICYmIChtb3Rpb25Qb3NpdGlvbiA+PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChnZXRBZGFwdGVyKCkuaXNFbmFibGVkKG1vdGlvblBvc2l0aW9uKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFVzZXIgY2xpY2tlZCBvbiBhbiBhY3R1YWwgdmlldyAoYW5kIHdhcyBub3Qgc3RvcHBpbmcgYSBmbGluZykuIEl0IG1pZ2h0IGJlIGEKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNsaWNrIG9yIGEgc2Nyb2xsLiBBc3N1bWUgaXQgaXMgYSBjbGljayB1bnRpbCBwcm92ZW4gb3RoZXJ3aXNlCi0gICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfTU9ERV9ET1dOOwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gRklYTUUgRGVib3VuY2UKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtUGVuZGluZ0NoZWNrRm9yVGFwID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGVuZGluZ0NoZWNrRm9yVGFwID0gbmV3IENoZWNrRm9yVGFwKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBwb3N0RGVsYXllZChtUGVuZGluZ0NoZWNrRm9yVGFwLCBWaWV3Q29uZmlndXJhdGlvbi5nZXRUYXBUaW1lb3V0KCkpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2LmdldEVkZ2VGbGFncygpICE9IDAgJiYgbW90aW9uUG9zaXRpb24gPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UgY291bGRuJ3QgZmluZCBhIHZpZXcgdG8gY2xpY2sgb24sIGJ1dCB0aGUgZG93biBldmVudCB3YXMgdG91Y2hpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZWRnZSwgd2Ugd2lsbCBiYWlsIG91dCBhbmQgdHJ5IGFnYWluLiBUaGlzIGFsbG93cyB0aGUgZWRnZSBjb3JyZWN0aW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29kZSBpbiBWaWV3Um9vdCB0byB0cnkgdG8gZmluZCBhIG5lYXJieSB2aWV3IHRvIHNlbGVjdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfTU9ERV9GTElORykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0b3BwZWQgYSBmbGluZy4gSXQgaXMgYSBzY3JvbGwuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3JlYXRlU2Nyb2xsaW5nQ2FjaGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfTU9ERV9TQ1JPTEw7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1vdGlvbkNvcnJlY3Rpb24gPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vdGlvblBvc2l0aW9uID0gZmluZE1vdGlvblJvdyh5KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXBvcnRTY3JvbGxTdGF0ZUNoYW5nZShPblNjcm9sbExpc3RlbmVyLlNDUk9MTF9TVEFURV9UT1VDSF9TQ1JPTEwpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9NT0RFX0ZMSU5HKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBTdG9wcGVkIGEgZmxpbmcuIEl0IGlzIGEgc2Nyb2xsLgorICAgICAgICAgICAgICAgICAgICAgICAgY3JlYXRlU2Nyb2xsaW5nQ2FjaGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9NT0RFX1NDUk9MTDsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Nb3Rpb25Db3JyZWN0aW9uID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vdGlvblBvc2l0aW9uID0gZmluZE1vdGlvblJvdyh5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydFNjcm9sbFN0YXRlQ2hhbmdlKE9uU2Nyb2xsTGlzdGVuZXIuU0NST0xMX1NUQVRFX1RPVUNIX1NDUk9MTCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBpZiAobW90aW9uUG9zaXRpb24gPj0gMCkgewotICAgICAgICAgICAgICAgICAgICAvLyBSZW1lbWJlciB3aGVyZSB0aGUgbW90aW9uIGV2ZW50IHN0YXJ0ZWQKLSAgICAgICAgICAgICAgICAgICAgdiA9IGdldENoaWxkQXQobW90aW9uUG9zaXRpb24gLSBtRmlyc3RQb3NpdGlvbik7Ci0gICAgICAgICAgICAgICAgICAgIG1Nb3Rpb25WaWV3T3JpZ2luYWxUb3AgPSB2LmdldFRvcCgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtTW90aW9uWCA9IHg7Ci0gICAgICAgICAgICAgICAgbU1vdGlvblkgPSB5OwotICAgICAgICAgICAgICAgIG1Nb3Rpb25Qb3NpdGlvbiA9IG1vdGlvblBvc2l0aW9uOwotICAgICAgICAgICAgICAgIG1MYXN0WSA9IEludGVnZXIuTUlOX1ZBTFVFOwotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgaWYgKG1vdGlvblBvc2l0aW9uID49IDApIHsKKyAgICAgICAgICAgICAgICAvLyBSZW1lbWJlciB3aGVyZSB0aGUgbW90aW9uIGV2ZW50IHN0YXJ0ZWQKKyAgICAgICAgICAgICAgICB2ID0gZ2V0Q2hpbGRBdChtb3Rpb25Qb3NpdGlvbiAtIG1GaXJzdFBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgICBtTW90aW9uVmlld09yaWdpbmFsVG9wID0gdi5nZXRUb3AoKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Nb3Rpb25YID0geDsKKyAgICAgICAgICAgIG1Nb3Rpb25ZID0geTsKKyAgICAgICAgICAgIG1Nb3Rpb25Qb3NpdGlvbiA9IG1vdGlvblBvc2l0aW9uOworICAgICAgICAgICAgbUxhc3RZID0gSW50ZWdlci5NSU5fVkFMVUU7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQogCkBAIC0yMTk2LDI0ICsyNDk5LDggQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3REaXNhbGxvd0ludGVyY2VwdFRvdWNoRXZlbnQodHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcmF3RGVsdGFZID0gZGVsdGFZOwogICAgICAgICAgICAgICAgICAgICBkZWx0YVkgLT0gbU1vdGlvbkNvcnJlY3Rpb247CiAgICAgICAgICAgICAgICAgICAgIGludCBpbmNyZW1lbnRhbERlbHRhWSA9IG1MYXN0WSAhPSBJbnRlZ2VyLk1JTl9WQUxVRSA/IHkgLSBtTGFzdFkgOiBkZWx0YVk7Ci0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbW90aW9uSW5kZXg7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtTW90aW9uUG9zaXRpb24gPj0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbW90aW9uSW5kZXggPSBtTW90aW9uUG9zaXRpb24gLSBtRmlyc3RQb3NpdGlvbjsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHdlIGRvbid0IGhhdmUgYSBtb3Rpb24gcG9zaXRpb24gdGhhdCB3ZSBjYW4gcmVsaWFibHkgdHJhY2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBwaWNrIHNvbWV0aGluZyBpbiB0aGUgbWlkZGxlIHRvIG1ha2UgYSBiZXN0IGd1ZXNzIGF0IHRoaW5ncyBiZWxvdy4KLSAgICAgICAgICAgICAgICAgICAgICAgIG1vdGlvbkluZGV4ID0gZ2V0Q2hpbGRDb3VudCgpIC8gMjsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGludCBtb3Rpb25WaWV3UHJldlRvcCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIFZpZXcgbW90aW9uVmlldyA9IHRoaXMuZ2V0Q2hpbGRBdChtb3Rpb25JbmRleCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtb3Rpb25WaWV3ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1vdGlvblZpZXdQcmV2VG9wID0gbW90aW9uVmlldy5nZXRUb3AoKTsKLSAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIC8vIE5vIG5lZWQgdG8gZG8gYWxsIHRoaXMgd29yayBpZiB3ZSdyZSBub3QgZ29pbmcgdG8gbW92ZSBhbnl3YXkKICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBhdEVkZ2UgPSBmYWxzZTsKQEAgLTIyMjIsMTE3ICsyNTA5LDIzIEBACiAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayB0byBzZWUgaWYgd2UgaGF2ZSBidW1wZWQgaW50byB0aGUgc2Nyb2xsIGxpbWl0Ci0gICAgICAgICAgICAgICAgICAgIG1vdGlvblZpZXcgPSB0aGlzLmdldENoaWxkQXQobW90aW9uSW5kZXgpOwotICAgICAgICAgICAgICAgICAgICBpZiAobW90aW9uVmlldyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBpZiB0aGUgdG9wIG9mIHRoZSBtb3Rpb24gdmlldyBpcyB3aGVyZSBpdCBpcwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3VwcG9zZWQgdG8gYmUKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBtb3Rpb25WaWV3UmVhbFRvcCA9IG1vdGlvblZpZXcuZ2V0VG9wKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXRFZGdlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQXBwbHkgb3ZlcnNjcm9sbAotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG92ZXJzY3JvbGwgPSAtaW5jcmVtZW50YWxEZWx0YVkgLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1vdGlvblZpZXdSZWFsVG9wIC0gbW90aW9uVmlld1ByZXZUb3ApOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJTY3JvbGxCeSgwLCBvdmVyc2Nyb2xsLCAwLCBtU2Nyb2xsWSwgMCwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIG1PdmVyc2Nyb2xsRGlzdGFuY2UsIHRydWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicyhtT3ZlcnNjcm9sbERpc3RhbmNlKSA9PSBNYXRoLmFicyhtU2Nyb2xsWSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG9uJ3QgYWxsb3cgb3ZlcmZsaW5nIGlmIHdlJ3JlIGF0IHRoZSBlZGdlLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVmVsb2NpdHlUcmFja2VyLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IG92ZXJzY3JvbGxNb2RlID0gZ2V0T3ZlclNjcm9sbE1vZGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3ZlcnNjcm9sbE1vZGUgPT0gT1ZFUl9TQ1JPTExfQUxXQVlTIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3ZlcnNjcm9sbE1vZGUgPT0gT1ZFUl9TQ1JPTExfSUZfQ09OVEVOVF9TQ1JPTExTICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFjb250ZW50Rml0cygpKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGlyZWN0aW9uID0gMDsgLy8gUmVzZXQgd2hlbiBlbnRlcmluZyBvdmVyc2Nyb2xsLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfTU9ERV9PVkVSU0NST0xMOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmF3RGVsdGFZID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93VG9wLm9uUHVsbCgoZmxvYXQpIG92ZXJzY3JvbGwgLyBnZXRIZWlnaHQoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1FZGdlR2xvd0JvdHRvbS5pc0ZpbmlzaGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dCb3R0b20ub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmF3RGVsdGFZIDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93Qm90dG9tLm9uUHVsbCgoZmxvYXQpIG92ZXJzY3JvbGwgLyBnZXRIZWlnaHQoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1FZGdlR2xvd1RvcC5pc0ZpbmlzaGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dUb3Aub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChhdEVkZ2UgJiYgZ2V0Q2hpbGRDb3VudCgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gVHJlYXQgdGhpcyBsaWtlIHdlJ3JlIHN0YXJ0aW5nIGEgbmV3IHNjcm9sbCBmcm9tIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBwb3NpdGlvbi4gVGhpcyB3aWxsIGxldCB0aGUgdXNlciBzdGFydCBzY3JvbGxpbmcgYmFjayBpbnRvCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb250ZW50IGltbWVkaWF0ZWx5IHJhdGhlciB0aGFuIG5lZWRpbmcgdG8gc2Nyb2xsIGJhY2sgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBwb2ludCB3aGVyZSB0aGV5IGhpdCB0aGUgbGltaXQgZmlyc3QuCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbW90aW9uUG9zaXRpb24gPSBmaW5kTW90aW9uUm93KHkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1vdGlvblBvc2l0aW9uID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IG1vdGlvblZpZXcgPSBnZXRDaGlsZEF0KG1vdGlvblBvc2l0aW9uIC0gbUZpcnN0UG9zaXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Nb3Rpb25WaWV3T3JpZ2luYWxUb3AgPSBtb3Rpb25WaWV3LmdldFRvcCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbU1vdGlvblkgPSB5OworICAgICAgICAgICAgICAgICAgICAgICAgbU1vdGlvblBvc2l0aW9uID0gbW90aW9uUG9zaXRpb247CiAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgbUxhc3RZID0geTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgVE9VQ0hfTU9ERV9PVkVSU0NST0xMOgotICAgICAgICAgICAgICAgIGlmICh5ICE9IG1MYXN0WSkgewotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcmF3RGVsdGFZID0gZGVsdGFZOwotICAgICAgICAgICAgICAgICAgICBkZWx0YVkgLT0gbU1vdGlvbkNvcnJlY3Rpb247Ci0gICAgICAgICAgICAgICAgICAgIGludCBpbmNyZW1lbnRhbERlbHRhWSA9IG1MYXN0WSAhPSBJbnRlZ2VyLk1JTl9WQUxVRSA/IHkgLSBtTGFzdFkgOiBkZWx0YVk7Ci0KLSAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IG9sZFNjcm9sbCA9IG1TY3JvbGxZOwotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbmV3U2Nyb2xsID0gb2xkU2Nyb2xsIC0gaW5jcmVtZW50YWxEZWx0YVk7Ci0gICAgICAgICAgICAgICAgICAgIGludCBuZXdEaXJlY3Rpb24gPSB5ID4gbUxhc3RZID8gMSA6IC0xOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChtRGlyZWN0aW9uID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1EaXJlY3Rpb24gPSBuZXdEaXJlY3Rpb247Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAobURpcmVjdGlvbiAhPSBuZXdEaXJlY3Rpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIENvbWluZyBiYWNrIHRvICdyZWFsJyBsaXN0IHNjcm9sbGluZwotICAgICAgICAgICAgICAgICAgICAgICAgaW5jcmVtZW50YWxEZWx0YVkgPSAtbmV3U2Nyb2xsOwotICAgICAgICAgICAgICAgICAgICAgICAgbVNjcm9sbFkgPSAwOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBObyBuZWVkIHRvIGRvIGFsbCB0aGlzIHdvcmsgaWYgd2UncmUgbm90IGdvaW5nIHRvIG1vdmUgYW55d2F5Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5jcmVtZW50YWxEZWx0YVkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWNrTW90aW9uU2Nyb2xsKGluY3JlbWVudGFsRGVsdGFZLCBpbmNyZW1lbnRhbERlbHRhWSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIENoZWNrIHRvIHNlZSBpZiB3ZSBhcmUgYmFjayBpbgotICAgICAgICAgICAgICAgICAgICAgICAgVmlldyBtb3Rpb25WaWV3ID0gdGhpcy5nZXRDaGlsZEF0KG1Nb3Rpb25Qb3NpdGlvbiAtIG1GaXJzdFBvc2l0aW9uKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtb3Rpb25WaWV3ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfTU9ERV9TQ1JPTEw7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBkaWQgbm90IHNjcm9sbCB0aGUgZnVsbCBhbW91bnQuIFRyZWF0IHRoaXMgZXNzZW50aWFsbHkgbGlrZSB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzdGFydCBvZiBhIG5ldyB0b3VjaCBzY3JvbGwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbW90aW9uUG9zaXRpb24gPSBmaW5kQ2xvc2VzdE1vdGlvblJvdyh5KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Nb3Rpb25Db3JyZWN0aW9uID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3Rpb25WaWV3ID0gZ2V0Q2hpbGRBdChtb3Rpb25Qb3NpdGlvbiAtIG1GaXJzdFBvc2l0aW9uKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTW90aW9uVmlld09yaWdpbmFsVG9wID0gbW90aW9uVmlldy5nZXRUb3AoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTW90aW9uWSA9IHk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1vdGlvblBvc2l0aW9uID0gbW90aW9uUG9zaXRpb247Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvdmVyU2Nyb2xsQnkoMCwgLWluY3JlbWVudGFsRGVsdGFZLCAwLCBtU2Nyb2xsWSwgMCwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgbU92ZXJzY3JvbGxEaXN0YW5jZSwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgb3ZlcnNjcm9sbE1vZGUgPSBnZXRPdmVyU2Nyb2xsTW9kZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG92ZXJzY3JvbGxNb2RlID09IE9WRVJfU0NST0xMX0FMV0FZUyB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3ZlcnNjcm9sbE1vZGUgPT0gT1ZFUl9TQ1JPTExfSUZfQ09OVEVOVF9TQ1JPTExTICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIWNvbnRlbnRGaXRzKCkpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJhd0RlbHRhWSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93VG9wLm9uUHVsbCgoZmxvYXQpIC1pbmNyZW1lbnRhbERlbHRhWSAvIGdldEhlaWdodCgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtRWRnZUdsb3dCb3R0b20uaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dCb3R0b20ub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJhd0RlbHRhWSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93Qm90dG9tLm9uUHVsbCgoZmxvYXQpIC1pbmNyZW1lbnRhbERlbHRhWSAvIGdldEhlaWdodCgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtRWRnZUdsb3dUb3AuaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dUb3Aub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE1hdGguYWJzKG1PdmVyc2Nyb2xsRGlzdGFuY2UpID09IE1hdGguYWJzKG1TY3JvbGxZKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IGFsbG93IG92ZXJmbGluZyBpZiB3ZSdyZSBhdCB0aGUgZWRnZS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVmVsb2NpdHlUcmFja2VyLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbUxhc3RZID0geTsKLSAgICAgICAgICAgICAgICAgICAgbURpcmVjdGlvbiA9IG5ld0RpcmVjdGlvbjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGJyZWFrOwpAQCAtMjQwNCwyOSArMjU5NywxOSBAQAogICAgICAgICAgICAgY2FzZSBUT1VDSF9NT0RFX1NDUk9MTDoKICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgY2hpbGRDb3VudCA9IGdldENoaWxkQ291bnQoKTsKICAgICAgICAgICAgICAgICBpZiAoY2hpbGRDb3VudCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGZpcnN0Q2hpbGRUb3AgPSBnZXRDaGlsZEF0KDApLmdldFRvcCgpOwotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbGFzdENoaWxkQm90dG9tID0gZ2V0Q2hpbGRBdChjaGlsZENvdW50IC0gMSkuZ2V0Qm90dG9tKCk7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBjb250ZW50VG9wID0gbUxpc3RQYWRkaW5nLnRvcDsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGNvbnRlbnRCb3R0b20gPSBnZXRIZWlnaHQoKSAtIG1MaXN0UGFkZGluZy5ib3R0b207Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtRmlyc3RQb3NpdGlvbiA9PSAwICYmIGZpcnN0Q2hpbGRUb3AgPj0gY29udGVudFRvcCAmJgorICAgICAgICAgICAgICAgICAgICBpZiAobUZpcnN0UG9zaXRpb24gPT0gMCAmJiBnZXRDaGlsZEF0KDApLmdldFRvcCgpID49IG1MaXN0UGFkZGluZy50b3AgJiYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmlyc3RQb3NpdGlvbiArIGNoaWxkQ291bnQgPCBtSXRlbUNvdW50ICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdENoaWxkQm90dG9tIDw9IGdldEhlaWdodCgpIC0gY29udGVudEJvdHRvbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldENoaWxkQXQoY2hpbGRDb3VudCAtIDEpLmdldEJvdHRvbSgpIDw9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRIZWlnaHQoKSAtIG1MaXN0UGFkZGluZy5ib3R0b20pIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9NT0RFX1JFU1Q7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXBvcnRTY3JvbGxTdGF0ZUNoYW5nZShPblNjcm9sbExpc3RlbmVyLlNDUk9MTF9TVEFURV9JRExFKTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFZlbG9jaXR5VHJhY2tlciB2ZWxvY2l0eVRyYWNrZXIgPSBtVmVsb2NpdHlUcmFja2VyOwogICAgICAgICAgICAgICAgICAgICAgICAgdmVsb2NpdHlUcmFja2VyLmNvbXB1dGVDdXJyZW50VmVsb2NpdHkoMTAwMCwgbU1heGltdW1WZWxvY2l0eSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaW5pdGlhbFZlbG9jaXR5ID0gKGludCkgdmVsb2NpdHlUcmFja2VyLmdldFlWZWxvY2l0eShtQWN0aXZlUG9pbnRlcklkKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gRmxpbmcgaWYgd2UgaGF2ZSBlbm91Z2ggdmVsb2NpdHkgYW5kIHdlIGFyZW4ndCBhdCBhIGJvdW5kYXJ5LgotICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2luY2Ugd2UgY2FuIHBvdGVudGlhbGx5IG92ZXJmbGluZyBtb3JlIHRoYW4gd2UgY2FuIG92ZXJzY3JvbGwsIGRvbid0Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBhbGxvdyB0aGUgd2VpcmQgYmVoYXZpb3Igd2hlcmUgeW91IGNhbiBzY3JvbGwgdG8gYSBib3VuZGFyeSB0aGVuCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmbGluZyBmdXJ0aGVyLgotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE1hdGguYWJzKGluaXRpYWxWZWxvY2l0eSkgPiBtTWluaW11bVZlbG9jaXR5ICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICEoKG1GaXJzdFBvc2l0aW9uID09IDAgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdENoaWxkVG9wID09IGNvbnRlbnRUb3AgLSBtT3ZlcnNjcm9sbERpc3RhbmNlKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtRmlyc3RQb3NpdGlvbiArIGNoaWxkQ291bnQgPT0gbUl0ZW1Db3VudCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RDaGlsZEJvdHRvbSA9PSBjb250ZW50Qm90dG9tICsgbU92ZXJzY3JvbGxEaXN0YW5jZSkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaW5pdGlhbFZlbG9jaXR5ID0gKGludCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZlbG9jaXR5VHJhY2tlci5nZXRZVmVsb2NpdHkobUFjdGl2ZVBvaW50ZXJJZCkgKiBtVmVsb2NpdHlTY2FsZSk7CisgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMoaW5pdGlhbFZlbG9jaXR5KSA+IG1NaW5pbXVtVmVsb2NpdHkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUZsaW5nUnVubmFibGUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmxpbmdSdW5uYWJsZSA9IG5ldyBGbGluZ1J1bm5hYmxlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMjQ0MywzMiArMjYyNiwxMCBAQAogICAgICAgICAgICAgICAgICAgICByZXBvcnRTY3JvbGxTdGF0ZUNoYW5nZShPblNjcm9sbExpc3RlbmVyLlNDUk9MTF9TVEFURV9JRExFKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgVE9VQ0hfTU9ERV9PVkVSU0NST0xMOgotICAgICAgICAgICAgICAgIGlmIChtRmxpbmdSdW5uYWJsZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1GbGluZ1J1bm5hYmxlID0gbmV3IEZsaW5nUnVubmFibGUoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgVmVsb2NpdHlUcmFja2VyIHZlbG9jaXR5VHJhY2tlciA9IG1WZWxvY2l0eVRyYWNrZXI7Ci0gICAgICAgICAgICAgICAgdmVsb2NpdHlUcmFja2VyLmNvbXB1dGVDdXJyZW50VmVsb2NpdHkoMTAwMCwgbU1heGltdW1WZWxvY2l0eSk7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IGluaXRpYWxWZWxvY2l0eSA9IChpbnQpIHZlbG9jaXR5VHJhY2tlci5nZXRZVmVsb2NpdHkobUFjdGl2ZVBvaW50ZXJJZCk7Ci0KLSAgICAgICAgICAgICAgICByZXBvcnRTY3JvbGxTdGF0ZUNoYW5nZShPblNjcm9sbExpc3RlbmVyLlNDUk9MTF9TVEFURV9GTElORyk7Ci0gICAgICAgICAgICAgICAgaWYgKE1hdGguYWJzKGluaXRpYWxWZWxvY2l0eSkgPiBtTWluaW11bVZlbG9jaXR5KSB7Ci0gICAgICAgICAgICAgICAgICAgIG1GbGluZ1J1bm5hYmxlLnN0YXJ0T3ZlcmZsaW5nKC1pbml0aWFsVmVsb2NpdHkpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1GbGluZ1J1bm5hYmxlLnN0YXJ0U3ByaW5nYmFjaygpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBzZXRQcmVzc2VkKGZhbHNlKTsKIAotICAgICAgICAgICAgaWYgKG1FZGdlR2xvd1RvcCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbUVkZ2VHbG93VG9wLm9uUmVsZWFzZSgpOwotICAgICAgICAgICAgICAgIG1FZGdlR2xvd0JvdHRvbS5vblJlbGVhc2UoKTsKLSAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgLy8gTmVlZCB0byByZWRyYXcgc2luY2Ugd2UgcHJvYmFibHkgYXJlbid0IGRyYXdpbmcgdGhlIHNlbGVjdG9yIGFueW1vcmUKICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKIApAQCAtMjQ5NCw0MiArMjY1NSwyNCBAQAogICAgICAgICB9CiAKICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fQ0FOQ0VMOiB7Ci0gICAgICAgICAgICBzd2l0Y2ggKG1Ub3VjaE1vZGUpIHsKLSAgICAgICAgICAgIGNhc2UgVE9VQ0hfTU9ERV9PVkVSU0NST0xMOgotICAgICAgICAgICAgICAgIGlmIChtRmxpbmdSdW5uYWJsZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1GbGluZ1J1bm5hYmxlID0gbmV3IEZsaW5nUnVubmFibGUoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUZsaW5nUnVubmFibGUuc3RhcnRTcHJpbmdiYWNrKCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfTU9ERV9SRVNUOworICAgICAgICAgICAgc2V0UHJlc3NlZChmYWxzZSk7CisgICAgICAgICAgICBWaWV3IG1vdGlvblZpZXcgPSB0aGlzLmdldENoaWxkQXQobU1vdGlvblBvc2l0aW9uIC0gbUZpcnN0UG9zaXRpb24pOworICAgICAgICAgICAgaWYgKG1vdGlvblZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1vdGlvblZpZXcuc2V0UHJlc3NlZChmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjbGVhclNjcm9sbGluZ0NhY2hlKCk7CiAKLSAgICAgICAgICAgIGNhc2UgVE9VQ0hfTU9ERV9PVkVSRkxJTkc6Ci0gICAgICAgICAgICAgICAgLy8gRG8gbm90aGluZyAtIGxldCBpdCBwbGF5IG91dC4KLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGZpbmFsIEhhbmRsZXIgaGFuZGxlciA9IGdldEhhbmRsZXIoKTsKKyAgICAgICAgICAgIGlmIChoYW5kbGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBoYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtUGVuZGluZ0NoZWNrRm9yTG9uZ1ByZXNzKTsKKyAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfTU9ERV9SRVNUOwotICAgICAgICAgICAgICAgIHNldFByZXNzZWQoZmFsc2UpOwotICAgICAgICAgICAgICAgIFZpZXcgbW90aW9uVmlldyA9IHRoaXMuZ2V0Q2hpbGRBdChtTW90aW9uUG9zaXRpb24gLSBtRmlyc3RQb3NpdGlvbik7Ci0gICAgICAgICAgICAgICAgaWYgKG1vdGlvblZpZXcgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtb3Rpb25WaWV3LnNldFByZXNzZWQoZmFsc2UpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjbGVhclNjcm9sbGluZ0NhY2hlKCk7Ci0KLSAgICAgICAgICAgICAgICBmaW5hbCBIYW5kbGVyIGhhbmRsZXIgPSBnZXRIYW5kbGVyKCk7Ci0gICAgICAgICAgICAgICAgaWYgKGhhbmRsZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBoYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtUGVuZGluZ0NoZWNrRm9yTG9uZ1ByZXNzKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAobVZlbG9jaXR5VHJhY2tlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIucmVjeWNsZSgpOwotICAgICAgICAgICAgICAgICAgICBtVmVsb2NpdHlUcmFja2VyID0gbnVsbDsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVZlbG9jaXR5VHJhY2tlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVZlbG9jaXR5VHJhY2tlci5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgbVZlbG9jaXR5VHJhY2tlciA9IG51bGw7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAKLSAgICAgICAgICAgIGlmIChtRWRnZUdsb3dUb3AgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1FZGdlR2xvd1RvcC5vblJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICBtRWRnZUdsb3dCb3R0b20ub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICB9CiAgICAgICAgICAgICBtQWN0aXZlUG9pbnRlcklkID0gSU5WQUxJRF9QT0lOVEVSOwogICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KQEAgLTI1NTQsNjEgKzI2OTcsMTAgQEAKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKLSAgICBwcm90ZWN0ZWQgdm9pZCBvbk92ZXJTY3JvbGxlZChpbnQgc2Nyb2xsWCwgaW50IHNjcm9sbFksCi0gICAgICAgICAgICBib29sZWFuIGNsYW1wZWRYLCBib29sZWFuIGNsYW1wZWRZKSB7Ci0gICAgICAgIG1TY3JvbGxZID0gc2Nyb2xsWTsKLQotICAgICAgICBpZiAoY2xhbXBlZFkpIHsKLSAgICAgICAgICAgIC8vIFZlbG9jaXR5IGlzIGJyb2tlbiBieSBoaXR0aW5nIHRoZSBsaW1pdDsgZG9uJ3Qgc3RhcnQgYSBmbGluZyBvZmYgb2YgdGhpcy4KLSAgICAgICAgICAgIGlmIChtVmVsb2NpdHlUcmFja2VyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtVmVsb2NpdHlUcmFja2VyLmNsZWFyKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgYXdha2VuU2Nyb2xsQmFycygpOwotICAgIH0KLQotICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyB2b2lkIGRyYXcoQ2FudmFzIGNhbnZhcykgewogICAgICAgICBzdXBlci5kcmF3KGNhbnZhcyk7Ci0gICAgICAgIGlmIChtRWRnZUdsb3dUb3AgIT0gbnVsbCkgewotICAgICAgICAgICAgZmluYWwgaW50IHNjcm9sbFkgPSBtU2Nyb2xsWTsKLSAgICAgICAgICAgIGlmICghbUVkZ2VHbG93VG9wLmlzRmluaXNoZWQoKSkgewotICAgICAgICAgICAgICAgIGZpbmFsIGludCByZXN0b3JlQ291bnQgPSBjYW52YXMuc2F2ZSgpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCB3aWR0aCA9IGdldFdpZHRoKCk7Ci0KLSAgICAgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKC13aWR0aCAvIDIsIE1hdGgubWluKDAsIHNjcm9sbFkgKyBtRmlyc3RQb3NpdGlvbkRpc3RhbmNlR3Vlc3MpKTsKLSAgICAgICAgICAgICAgICBtRWRnZUdsb3dUb3Auc2V0U2l6ZSh3aWR0aCAqIDIsIGdldEhlaWdodCgpKTsKLSAgICAgICAgICAgICAgICBpZiAobUVkZ2VHbG93VG9wLmRyYXcoY2FudmFzKSkgewotICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlVG9Db3VudChyZXN0b3JlQ291bnQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFtRWRnZUdsb3dCb3R0b20uaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IHJlc3RvcmVDb3VudCA9IGNhbnZhcy5zYXZlKCk7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IHdpZHRoID0gZ2V0V2lkdGgoKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaGVpZ2h0ID0gZ2V0SGVpZ2h0KCk7Ci0KLSAgICAgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKC13aWR0aCAvIDIsCi0gICAgICAgICAgICAgICAgICAgICAgICBNYXRoLm1heChoZWlnaHQsIHNjcm9sbFkgKyBtTGFzdFBvc2l0aW9uRGlzdGFuY2VHdWVzcykpOwotICAgICAgICAgICAgICAgIGNhbnZhcy5yb3RhdGUoMTgwLCB3aWR0aCwgMCk7Ci0gICAgICAgICAgICAgICAgbUVkZ2VHbG93Qm90dG9tLnNldFNpemUod2lkdGggKiAyLCBoZWlnaHQpOwotICAgICAgICAgICAgICAgIGlmIChtRWRnZUdsb3dCb3R0b20uZHJhdyhjYW52YXMpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY2FudmFzLnJlc3RvcmVUb0NvdW50KHJlc3RvcmVDb3VudCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KICAgICAgICAgaWYgKG1GYXN0U2Nyb2xsZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgZmluYWwgaW50IHNjcm9sbFkgPSBtU2Nyb2xsWTsKLSAgICAgICAgICAgIGlmIChzY3JvbGxZICE9IDApIHsKLSAgICAgICAgICAgICAgICAvLyBQaW4gdG8gdGhlIHRvcC9ib3R0b20gZHVyaW5nIG92ZXJzY3JvbGwKLSAgICAgICAgICAgICAgICBpbnQgcmVzdG9yZUNvdW50ID0gY2FudmFzLnNhdmUoKTsKLSAgICAgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAsIChmbG9hdCkgc2Nyb2xsWSk7Ci0gICAgICAgICAgICAgICAgbUZhc3RTY3JvbGxlci5kcmF3KGNhbnZhcyk7Ci0gICAgICAgICAgICAgICAgY2FudmFzLnJlc3RvcmVUb0NvdW50KHJlc3RvcmVDb3VudCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1GYXN0U2Nyb2xsZXIuZHJhdyhjYW52YXMpOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgbUZhc3RTY3JvbGxlci5kcmF3KGNhbnZhcyk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTI2MjcsMTAgKzI3MTksNiBAQAogICAgICAgICBzd2l0Y2ggKGFjdGlvbiAmIE1vdGlvbkV2ZW50LkFDVElPTl9NQVNLKSB7CiAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX0RPV046IHsKICAgICAgICAgICAgIGludCB0b3VjaE1vZGUgPSBtVG91Y2hNb2RlOwotICAgICAgICAgICAgaWYgKHRvdWNoTW9kZSA9PSBUT1VDSF9NT0RFX09WRVJGTElORyB8fCB0b3VjaE1vZGUgPT0gVE9VQ0hfTU9ERV9PVkVSU0NST0xMKSB7Ci0gICAgICAgICAgICAgICAgbU1vdGlvbkNvcnJlY3Rpb24gPSAwOwotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQogICAgICAgICAgICAgCiAgICAgICAgICAgICBmaW5hbCBpbnQgeCA9IChpbnQpIGV2LmdldFgoKTsKICAgICAgICAgICAgIGZpbmFsIGludCB5ID0gKGludCkgZXYuZ2V0WSgpOwpAQCAtMjY5NSw3ICsyNzgzLDYgQEAKICAgICAgICAgICAgIGZpbmFsIGludCBuZXdQb2ludGVySW5kZXggPSBwb2ludGVySW5kZXggPT0gMCA/IDEgOiAwOwogICAgICAgICAgICAgbU1vdGlvblggPSAoaW50KSBldi5nZXRYKG5ld1BvaW50ZXJJbmRleCk7CiAgICAgICAgICAgICBtTW90aW9uWSA9IChpbnQpIGV2LmdldFkobmV3UG9pbnRlckluZGV4KTsKLSAgICAgICAgICAgIG1Nb3Rpb25Db3JyZWN0aW9uID0gMDsKICAgICAgICAgICAgIG1BY3RpdmVQb2ludGVySWQgPSBldi5nZXRQb2ludGVySWQobmV3UG9pbnRlckluZGV4KTsKICAgICAgICAgICAgIGlmIChtVmVsb2NpdHlUcmFja2VyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBtVmVsb2NpdHlUcmFja2VyLmNsZWFyKCk7CkBAIC0yNzUxLDcgKzI4MzgsNyBAQAogICAgICAgICAvKioKICAgICAgICAgICogVHJhY2tzIHRoZSBkZWNheSBvZiBhIGZsaW5nIHNjcm9sbAogICAgICAgICAgKi8KLSAgICAgICAgcHJpdmF0ZSBmaW5hbCBPdmVyU2Nyb2xsZXIgbVNjcm9sbGVyOworICAgICAgICBwcml2YXRlIGZpbmFsIFNjcm9sbGVyIG1TY3JvbGxlcjsKIAogICAgICAgICAvKioKICAgICAgICAgICogWSB2YWx1ZSByZXBvcnRlZCBieSBtU2Nyb2xsZXIgb24gdGhlIHByZXZpb3VzIGZsaW5nCkBAIC0yNzU5LDcgKzI4NDYsNyBAQAogICAgICAgICBwcml2YXRlIGludCBtTGFzdEZsaW5nWTsKIAogICAgICAgICBGbGluZ1J1bm5hYmxlKCkgewotICAgICAgICAgICAgbVNjcm9sbGVyID0gbmV3IE92ZXJTY3JvbGxlcihnZXRDb250ZXh0KCkpOworICAgICAgICAgICAgbVNjcm9sbGVyID0gbmV3IFNjcm9sbGVyKGdldENvbnRleHQoKSk7CiAgICAgICAgIH0KIAogICAgICAgICB2b2lkIHN0YXJ0KGludCBpbml0aWFsVmVsb2NpdHkpIHsKQEAgLTI3NzgsNDIgKzI4NjUsNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgdm9pZCBzdGFydFNwcmluZ2JhY2soKSB7Ci0gICAgICAgICAgICBpZiAobVNjcm9sbGVyLnNwcmluZ0JhY2soMCwgbVNjcm9sbFksIDAsIDAsIDAsIDApKSB7Ci0gICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX01PREVfT1ZFUkZMSU5HOwotICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICBwb3N0KHRoaXMpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gV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AgICAgICAgICAgICAgIGZpbmFsIGludCB2ZWwgPSAoaW50KSBtU2Nyb2xsZXIuZ2V0Q3VyclZlbG9jaXR5KCk7Ci0gICAgICAgICAgICAgICAgaWYgKGRlbHRhID4gMCkgewotICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dUb3Aub25BYnNvcmIodmVsKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dCb3R0b20ub25BYnNvcmIodmVsKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICBwb3N0KHRoaXMpOwotICAgICAgICB9Ci0KICAgICAgICAgdm9pZCBzdGFydFNjcm9sbChpbnQgZGlzdGFuY2UsIGludCBkdXJhdGlvbikgewogICAgICAgICAgICAgaW50IGluaXRpYWxZID0gZGlzdGFuY2UgPCAwID8gSW50ZWdlci5NQVhfVkFMVUUgOiAwOwogICAgICAgICAgICAgbUxhc3RGbGluZ1kgPSBpbml0aWFsWTsKQEAgLTI4MjUsMTQgKzI4NzYsMTMgQEAKICAgICAgICAgcHJpdmF0ZSB2b2lkIGVuZEZsaW5nKCkgewogICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX01PREVfUkVTVDsKIAotICAgICAgICAgICAgcmVwb3J0U2Nyb2xsU3RhdGVDaGFuZ2UoT25TY3JvbGxMaXN0ZW5lci5TQ1JPTExfU1RBVEVfSURMRSk7Ci0gICAgICAgICAgICBjbGVhclNjcm9sbGluZ0NhY2hlKCk7Ci0KICAgICAgICAgICAgIHJlbW92ZUNhbGxiYWNrcyh0aGlzKTsKLQogICAgICAgICAgICAgaWYgKG1Qb3NpdGlvblNjcm9sbGVyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICByZW1vdmVDYWxsYmFja3MobVBvc2l0aW9uU2Nyb2xsZXIpOwogICAgICAgICAgICAgfQorCisgICAgICA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sZFRvcCA9IG1vdGlvblZpZXcuZ2V0VG9wKCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBhdEVuZCA9IHRyYWNrTW90aW9uU2Nyb2xsKGRlbHRhLCBkZWx0YSk7Ci0gICAgICAgICAgICAgICAgaWYgKGF0RW5kKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtb3Rpb25WaWV3ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFR3ZWFrIHRoZSBzY3JvbGwgZm9yIGhvdyBmYXIgd2Ugb3ZlcnNob3QKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBvdmVyc2hvb3QgPSAtKGRlbHRhIC0gKG1vdGlvblZpZXcuZ2V0VG9wKCkgLSBvbGRUb3ApKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJTY3JvbGxCeSgwLCBvdmVyc2hvb3QsIDAsIG1TY3JvbGxZLCAwLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCBtT3ZlcmZsaW5nRGlzdGFuY2UsIGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAobW9yZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgZWRnZVJlYWNoZWQoZGVsdGEpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBEb24ndCBzdG9wIGp1c3QgYmVjYXVzZSBkZWx0YSBpcyB6ZXJvIChpdCBjb3VsZCBoYXZlIGJlZW4gcm91bmRlZCkKKyAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGF0RW5kID0gdHJhY2tNb3Rpb25TY3JvbGwoZGVsdGEsIGRlbHRhKSAmJiAoZGVsdGEgIT0gMCk7CiAKICAgICAgICAgICAgICAgICBpZiAobW9yZSAmJiAhYXRFbmQpIHsKICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwpAQCAtMjkxMiwyNCArMjk0NCw2IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlIFRPVUNIX01PREVfT1ZFUkZMSU5HOiB7Ci0gICAgICAgICAgICAgICAgZmluYWwgT3ZlclNjcm9sbGVyIHNjcm9sbGVyID0gbVNjcm9sbGVyOwotICAgICAgICAgICAgICAgIGlmIChzY3JvbGxlci5jb21wdXRlU2Nyb2xsT2Zmc2V0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IHNjcm9sbFkgPSBtU2Nyb2xsWTsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGRlbHRhWSA9IHNjcm9sbGVyLmdldEN1cnJZKCkgLSBzY3JvbGxZOwotICAgICAgICAgICAgICAgICAgICBpZiAob3ZlclNjcm9sbEJ5KDAsIGRlbHRhWSwgMCwgc2Nyb2xsWSwgMCwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCBtT3ZlcmZsaW5nRGlzdGFuY2UsIGZhbHNlKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRTcHJpbmdiYWNrKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwb3N0KHRoaXMpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZW5kRmxpbmcoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKICAgICAgICAgfQpAQCAtMjk0Myw2ICsyOTU3LDcgQEAKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE1PVkVfVVBfUE9TID0gMjsKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE1PVkVfRE9XTl9CT1VORCA9IDM7CiAgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBNT1ZFX1VQX0JPVU5EID0gNDsKKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE1PVkVfT0ZGU0VUID0gNTsKICAgICAgICAgCiAgICAgICAgIHByaXZhdGUgaW50IG1Nb2RlOwogICAgICAgICBwcml2YXRlIGludCBtVGFyZ2V0UG9zOwpAQCAtMjk1MCw2ICsyOTY1LDggQEAKICAgICAgICAgcHJpdmF0ZSBpbnQgbUxhc3RTZWVuUG9zOwogICAgICAgICBwcml2YXRlIGludCBtU2Nyb2xsRHVyYXRpb247CiAgICAgICAgIHByaXZhdGUgZmluYWwgaW50IG1FeHRyYVNjcm9sbDsKKworICAgICAgICBwcml2YXRlIGludCBtT2Zmc2V0RnJvbVRvcDsKICAgICAgICAgCiAgICAgICAgIFBvc2l0aW9uU2Nyb2xsZXIoKSB7CiAgICAgICAgICAgICBtRXh0cmFTY3JvbGwgPSBWaWV3Q29uZmlndXJhdGlvbi5nZXQobUNvbnRleHQpLmdldFNjYWxlZEZhZGluZ0VkZ2VMZW5ndGgoKTsKQEAgLTI5NTksNyArMjk3Niw3IEBACiAgICAgICAgICAgICBmaW5hbCBpbnQgZmlyc3RQb3MgPSBtRmlyc3RQb3NpdGlvbjsKICAgICAgICAgICAgIGZpbmFsIGludCBsYXN0UG9zID0gZmlyc3RQb3MgKyBnZXRDaGlsZENvdW50KCkgLSAxOwogICAgICAgICAgICAgCi0gICAgICAgICAgICBpbnQgdmlld1RyYXZlbENvdW50ID0gMDsKKyAgICAgICAgICAgIGludCB2aWV3VHJhdmVsQ291bnQ7CiAgICAgICAgICAgICBpZiAocG9zaXRpb24gPD0gZmlyc3RQb3MpIHsgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgdmlld1RyYXZlbENvdW50ID0gZmlyc3RQb3MgLSBwb3NpdGlvbiArIDE7CiAgICAgICAgICAgICAgICAgbU1vZGUgPSBNT1ZFX1VQX1BPUzsKQEAgLTI5OTIsNyArMzAwOSw3IEBACiAgICAgICAgICAgICBmaW5hbCBpbnQgZmlyc3RQb3MgPSBtRmlyc3RQb3NpdGlvbjsKICAgICAgICAgICAgIGZpbmFsIGludCBsYXN0UG9zID0gZmlyc3RQb3MgKyBnZXRDaGlsZENvdW50KCkgLSAxOwogICAgICAgICAgICAgCi0gICAgICAgICAgICBpbnQgdmlld1RyYXZlbENvdW50ID0gMDsKKyAgICAgICAgICAgIGludCB2aWV3VHJhdmVsQ291bnQ7CiAgICAgICAgICAgICBpZiAocG9zaXRpb24gPD0gZmlyc3RQb3MpIHsKICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgYm91bmRQb3NGcm9tTGFzdCA9IGxhc3RQb3MgLSBib3VuZFBvc2l0aW9uOwogICAgICAgICAgICAgICAgIGlmIChib3VuZFBvc0Zyb21MYXN0IDwgMSkgewpAQCAtMzA0MSwxMiArMzA1OCw1MiBAQAogICAgICAgICAgICAgCiAgICAgICAgICAgICBwb3N0KHRoaXMpOwogICAgICAgICB9Ci0gICAgICAgIAorCisgICAgICAgIHZvaWQgc3RhcnRXaXRoT2Zmc2V0KGludCBwb3NpdGlvbiwgaW50IG9mZnNldCkgeworICAgICAgICAgICAgc3RhcnRXaXRoT2Zmc2V0KHBvc2l0aW9uLCBvZmZzZXQsIFNDUk9MTF9EVVJBVElPTik7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHN0YXJ0V2l0aE9mZnNldChpbnQgcG9zaXRpb24sIGludCBvZmZzZXQsIGludCBkdXJhdGlvbikgeworICAgICAgICAgICAgbVRhcmdldFBvcyA9IHBvc2l0aW9uOworICAgICAgICAgICAgbU9mZnNldEZyb21Ub3AgPSBvZmZzZXQ7CisgICAgICAgICAgICBtQm91bmRQb3MgPSBJTlZBTElEX1BPU0lUSU9OOworICAgICAgICAgICAgbUxhc3RTZWVuUG9zID0gSU5WQUxJRF9QT1NJVElPTjsKKyAgICAgICAgICAgIG1Nb2RlID0gTU9WRV9PRkZTRVQ7CisKKyAgICAgICAgICAgIGZpbmFsIGludCBmaXJzdFBvcyA9IG1GaXJzdFBvc2l0aW9uOworICAgICAgICAgICAgZmluYWwgaW50IGNoaWxkQ291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgbGFzdFBvcyA9IGZpcnN0UG9zICsgY2hpbGRDb3VudCAtIDE7CisKKyAgICAgICAgICAgIGludCB2aWV3VHJhdmVsQ291bnQ7CisgICAgICAgICAgICBpZiAocG9zaXRpb24gPCBmaXJzdFBvcykgeworICAgICAgICAgICAgICAgIHZpZXdUcmF2ZWxDb3VudCA9IGZpcnN0UG9zIC0gcG9zaXRpb247CisgICAgICAgICAgICB9IGVsc2UgaWYgKHBvc2l0aW9uID4gbGFzdFBvcykgeworICAgICAgICAgICAgICAgIHZpZXdUcmF2ZWxDb3VudCA9IHBvc2l0aW9uIC0gbGFzdFBvczsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gT24tc2NyZWVuLCBqdXN0IHNjcm9sbC4KKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdGFyZ2V0VG9wID0gZ2V0Q2hpbGRBdChwb3NpdGlvbiAtIGZpcnN0UG9zKS5nZXRUb3AoKTsKKyAgICAgICAgICAgICAgICBzbW9vdGhTY3JvbGxCeSh0YXJnZXRUb3AgLSBvZmZzZXQsIGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIEVzdGltYXRlIGhvdyBtYW55IHNjcmVlbnMgd2Ugc2hvdWxkIHRyYXZlbAorICAgICAgICAgICAgZmluYWwgZmxvYXQgc2NyZWVuVHJhdmVsQ291bnQgPSAoZmxvYXQpIHZpZXdUcmF2ZWxDb3VudCAvIGNoaWxkQ291bnQ7CisgICAgICAgICAgICBtU2Nyb2xsRHVyYXRpb24gPSBzY3JlZW5UcmF2ZWxDb3VudCA8IDEgPyAoaW50KSAoc2NyZWVuVHJhdmVsQ291bnQgKiBkdXJhdGlvbikgOgorICAgICAgICAgICAgICAgICAgICAoaW50KSAoZHVyYXRpb24gLyBzY3JlZW5UcmF2ZWxDb3VudCk7CisgICAgICAgICAgICBtTGFzdFNlZW5Qb3MgPSBJTlZBTElEX1BPU0lUSU9OOworCisgICAgICAgICAgICBwb3N0KHRoaXMpOworICAgICAgICB9CisKICAgICAgICAgdm9pZCBzdG9wKCkgewogICAgICAgICAgICAgcmVtb3ZlQ2FsbGJhY2tzKHRoaXMpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlICE9IFRPVUNIX01PREVfRkxJTkcgJiYgbUxhc3RTZWVuUG9zICE9IElOVkFMSURfUE9TSVRJT04pIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIGZpbmFsIGludCBsaXN0SGVpZ2h0ID0gZ2V0SGVpZ2h0KCk7CiAgICAgICAgICAgICBmaW5hbCBpbnQgZmlyc3RQb3MgPSBtRmlyc3RQb3NpdGlvbjsKICAgICAgICAgICAgIApAQCAtMzE3MSw2ICszMjI4LDM1IEBACiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIGNhc2UgTU9WRV9PRkZTRVQ6IHsKKyAgICAgICAgICAgICAgICBpZiAobUxhc3RTZWVuUG9zID09IGZpcnN0UG9zKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIE5vIG5ldyB2aWV3cywgbGV0IHRoaW5ncyBrZWVwIGdvaW5nLgorICAgICAgICAgICAgICAgICAgICBwb3N0KHRoaXMpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgbUxhc3RTZWVuUG9zID0gZmlyc3RQb3M7CisKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgY2hpbGRDb3VudCA9IGdldENoaWxkQ291bnQoKTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcG9zaXRpb24gPSBtVGFyZ2V0UG9zOworICAgICAgICAgICAgICAgIGZpbmFsIGludCBsYXN0UG9zID0gZmlyc3RQb3MgKyBjaGlsZENvdW50IC0gMTsKKworICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA8IGZpcnN0UG9zKSB7CisgICAgICAgICAgICAgICAgICAgIHNtb290aFNjcm9sbEJ5KC1nZXRIZWlnaHQoKSwgbVNjcm9sbER1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgcG9zdCh0aGlzKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHBvc2l0aW9uID4gbGFzdFBvcykgeworICAgICAgICAgICAgICAgICAgICBzbW9vdGhTY3JvbGxCeShnZXRIZWlnaHQoKSwgbVNjcm9sbER1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgcG9zdCh0aGlzKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBPbi1zY3JlZW4sIGp1c3Qgc2Nyb2xsLgorICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdGFyZ2V0VG9wID0gZ2V0Q2hpbGRBdChwb3NpdGlvbiAtIGZpcnN0UG9zKS5nZXRUb3AoKTsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGRpc3RhbmNlID0gdGFyZ2V0VG9wIC0gbU9mZnNldEZyb21Ub3A7CisgICAgICAgICAgICAgICAgICAgIHNtb290aFNjcm9sbEJ5KGRpc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIChtU2Nyb2xsRHVyYXRpb24gKiAoKGZsb2F0KSBkaXN0YW5jZSAvIGdldEhlaWdodCgpKSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KQEAgLTMxNzgsNiArMzI2NCwzMCBAQAogICAgIH0KICAgICAKICAgICAvKioKKyAgICAgKiBUaGUgYW1vdW50IG9mIGZyaWN0aW9uIGFwcGxpZWQgdG8gZmxpbmdzLiBUaGUgZGVmYXVsdCB2YWx1ZQorICAgICAqIGlzIHtAbGluayBWaWV3Q29uZmlndXJhdGlvbiNnZXRTY3JvbGxGcmljdGlvbn0uCisgICAgICogCisgICAgICogQHJldHVybiBBIHNjYWxhciBkaW1lbnNpb25sZXNzIHZhbHVlIHJlcHJlc2VudGluZyB0aGUgY29lZmZpY2llbnQgb2YKKyAgICAgKiAgICAgICAgIGZyaWN0aW9uLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEZyaWN0aW9uKGZsb2F0IGZyaWN0aW9uKSB7CisgICAgICAgIGlmIChtRmxpbmdSdW5uYWJsZSA9PSBudWxsKSB7CisgICAgICAgICAgICBtRmxpbmdSdW5uYWJsZSA9IG5ldyBGbGluZ1J1bm5hYmxlKCk7CisgICAgICAgIH0KKyAgICAgICAgbUZsaW5nUnVubmFibGUubVNjcm9sbGVyLnNldEZyaWN0aW9uKGZyaWN0aW9uKTsgICAgICAgIAorICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgYSBzY2FsZSBmYWN0b3IgZm9yIHRoZSBmbGluZyB2ZWxvY2l0eS4gVGhlIGluaXRpYWwgc2NhbGUKKyAgICAgKiBmYWN0b3IgaXMgMS4wLgorICAgICAqIAorICAgICAqIEBwYXJhbSBzY2FsZSBUaGUgc2NhbGU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3ICszMzYzLDQ2IEBACiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICBtRmxpbmdSdW5uYWJsZS5lbmRGbGluZygpOwogICAgICAgICB9Ci0gICAgICAgIG1GbGluZ1J1bm5hYmxlLnN0YXJ0U2Nyb2xsKGRpc3RhbmNlLCBkdXJhdGlvbik7CisgICAgICAgIC8vIE5vIHNlbnNlIHN0YXJ0aW5nIHRvIHNjcm9sbCBpZiB3ZSdyZSBub3QgZ29pbmcgYW55d2hlcmUKKyAgICAgICAgaWYgKGRpc3RhbmNlICE9IDApIHsKKyAgICAgICAgICAgIG1GbGluZ1J1bm5hYmxlLnN0YXJ0U2Nyb2xsKGRpc3RhbmNlLCBkdXJhdGlvbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBbGxvd3MgUmVtb3RlVmlld3MgdG8gc2Nyb2xsIHJlbGF0aXZlbHkgdG8gYSBwb3NpdGlvbi4KKyAgICAgKi8KKyAgICB2b2lkIHNtb290aFNjcm9sbEJ5T2Zmc2V0KGludCBwb3NpdGlvbikgeworICAgICAgICBpbnQgaW5kZXggPSAtMTsKKyAgICAgICAgaWYgKHBvc2l0aW9uIDwgMCkgeworICAgICAgICAgICAgaW5kZXggPSBnZXRGaXJzdFZpc2libGVQb3NpdGlvbigpOworICAgICAgICB9IGVsc2UgaWYgKHBvc2l0aW9uID4gMCkgeworICAgICAgICAgICAgaW5kZXggPSBnZXRMYXN0VmlzaWJsZVBvc2l0aW9uKCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoaW5kZXggPiAtMSkgeworICAgICAgICAgICAgVmlldyBjaGlsZCA9IGdldENoaWxkQXQoaW5kZXggLSBnZXRGaXJzdFZpc2libGVQb3NpdGlvbigpKTsKKyAgICAgICAgICAgIGlmIChjaGlsZCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgUmVjdCB2aXNpYmxlUmVjdCA9IG5ldyBSZWN0KCk7CisgICAgICAgICAgICAgICAgaWYgKGNoaWxkLmdldEdsb2JhbFZpc2libGVSZWN0KHZpc2libGVSZWN0KSkgeworICAgICAgICAgICAgICAgICAgICAvLyB0aGUgY2hpbGQgaXMgcGFydGlhbGx5IHZpc2libGUKKyAgICAgICAgICAgICAgICAgICAgaW50IGNoaWxkUmVjdEFyZWEgPSBjaGlsZC5nZXRXaWR0aCgpICogY2hpbGQuZ2V0SGVpZ2h0KCk7CisgICAgICAgICAgICAgICAgICAgIGludCB2aXNpYmxlUmVjdEFyZWEgPSB2aXNpYmxlUmVjdC53aWR0aCgpICogdmlzaWJsZVJlY3QuaGVpZ2h0KCk7CisgICAgICAgICAgICAgICAgICAgIGZsb2F0IHZpc2libGVBcmVhID0gKHZpc2libGVSZWN0QXJlYSAvIChmbG9hdCkgY2hpbGRSZWN0QXJlYSk7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGZsb2F0IHZpc2libGVUaHJlc2hvbGQgPSAwLjc1ZjsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChwb3NpdGlvbiA8IDApICYmICh2aXNpYmxlQXJlYSA8IHZpc2libGVUaHJlc2hvbGQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgdG9wIGluZGV4IGlzIG5vdCBwZXJjZWl2YWJseSB2aXNpYmxlIHNvIG9mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gdG8gYWNjb3VudCBmb3Igc2hvd2luZyB0aGF0IHRvcCBpbmRleCBhcyB3ZWxsCisgICAgICAgICAgICAgICAgICAgICAgICArK2luZGV4OworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChwb3NpdGlvbiA+IDApICYmICh2aXNpYmxlQXJlYSA8IHZpc2libGVUaHJlc2hvbGQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgYm90dG9tIGluZGV4IGlzIG5vdCBwZXJjZWl2YWJseSB2aXNpYmxlIHNvIG9mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gdG8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yArPSBpbmNyZW1lbnRhbERlbHRhWTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChmaXJzdFBvc2l0aW9uID09IDAgJiYgZmlyc3RUb3AgPj0gbGlzdFBhZGRpbmcudG9wICYmIGluY3JlbWVudGFsRGVsdGFZID49IDApIHsKKyAgICAgICAgaWYgKGZpcnN0UG9zaXRpb24gPT0gMCAmJiBmaXJzdFRvcCA+PSBsaXN0UGFkZGluZy50b3AgJiYgZGVsdGFZID49IDApIHsKICAgICAgICAgICAgIC8vIERvbid0IG5lZWQgdG8gbW92ZSB2aWV3cyBkb3duIGlmIHRoZSB0b3Agb2YgdGhlIGZpcnN0IHBvc2l0aW9uCiAgICAgICAgICAgICAvLyBpcyBhbHJlYWR5IHZpc2libGUKLSAgICAgICAgICAgIHJldHVybiBpbmNyZW1lbnRhbERlbHRhWSAhPSAwOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KIAotICAgICAgICBpZiAoZmlyc3RQb3NpdGlvbiArIGNoaWxkQ291bnQgPT0gbUl0ZW1Db3VudCAmJiBsYXN0Qm90dG9tIDw9IGVuZCAmJgotICAgICAgICAgICAgICAgIGluY3JlbWVudGFsRGVsdGFZIDw9IDApIHsKKyAgICAgICAgaWYgKGZpcnN0UG9zaXRpb24gKyBjaGlsZENvdW50ID09IG1JdGVtQ291bnQgJiYgbGFzdEJvdHRvbSA8PSBlbmQgJiYgZGVsdGFZIDw9IDApIHsKICAgICAgICAgICAgIC8vIERvbid0IG5lZWQgdG8gbW92ZSB2aWV3cyB1cCBpZiB0aGUgYm90dG9tIG9mIHRoZSBsYXN0IHBvc2l0aW9uCiAgICAgICAgICAgICAvLyBpcyBhbHJlYWR5IHZpc2libGUKLSAgICAgICAgICAgIHJldHVybiBpbmNyZW1lbnRhbERlbHRhWSAhPSAwOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KIAogICAgICAgICBmaW5hbCBib29sZWFuIGRvd24gPSBpbmNy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vbXBhcmlzb24gZmNPbGQgPSBuZXcgSW50ZW50LkZpbHRlckNvbXBhcmlzb24oCisgICAgICAgICAgICAgICAgICAgIG1SZW1vdGVBZGFwdGVyLmdldFJlbW90ZVZpZXdzU2VydmljZUludGVudCgpKTsKKyAgICAgICAgICAgIGlmIChmY05ldy5lcXVhbHMoZmNPbGQpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gT3RoZXJ3aXNlLCBjcmVhdGUgYSBuZXcgUmVtb3RlVmlld3NBZGFwdGVyIGZvciBiaW5kaW5nCisgICAgICAgIG1SZW1vdGVBZGFwdGVyID0gbmV3IFJlbW90ZVZpZXdzQWRhcHRlcihnZXRDb250ZXh0KCksIGludGVudCwgdGhpcyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2FsbGVkIGJhY2sgd2hlbiB0aGUgYWRhcHRlciBjb25uZWN0cyB0byB0aGUgUmVtb3RlVmlld3NTZXJ2aWNlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIG9uUmVtb3RlQWRhcHRlckNvbm5lY3RlZCgpIHsKKyAgICAgICAgaWYgKG1SZW1vdGVBZGFwdGVyICE9IG1BZGFwdGVyKSB7CisgICAgICAgICAgICBzZXRBZGFwdGVyKG1SZW1vdGVBZGFwdGVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENhbGxlZCBiYWNrIHdoZW4gdGhlIGFkYXB0ZXIgZGlzY29ubmVjdHMgZnJvbSB0aGUgUmVtb3RlVmlld3NTZXJ2aWNlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIG9uUmVtb3RlQWRhcHRlckRpc2Nvbm5lY3RlZCgpIHsKKyAgICAgICAgaWYgKG1SZW1vdGVBZGFwdGVyID09IG1BZGFwdGVyKSB7CisgICAgICAgICAgICBtUmVtb3RlQWRhcHRlciA9IG51bGw7CisgICAgICAgICAgICBzZXRBZGFwdGVyKG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HVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uUHJlcGFyZUFjdGlvbk1vZGUoQWN0aW9uTW9kZSBtb2RlLCBNZW51IG1lbnUpIHsKKyAgICAgICAgICAgIHJldHVybiBtV3JhcHBlZC5vblByZXBhcmVBY3Rpb25Nb2RlKG1vZGUsIG1lbnUpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25BY3Rpb25JdGVtQ2xpY2tlZChBY3Rpb25Nb2RlIG1vZGUsIE1lbnVJdGVtIGl0ZW0pIHsKKyAgICAgICAgICAgIHJldHVybiBtV3JhcHBlZC5vbkFjdGlvbkl0ZW1DbGlja2VkKG1vZGUsIGl0ZW0pOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25EZXN0cm95QWN0aW9uTW9kZShBY3Rpb25Nb2RlIG1vZGUpIHsKKyAgICAgICAgICAgIG1XcmFwcGVkLm9uRGVzdHJveUFjdGlvbk1vZGUobW9kZSk7CisgICAgICAgICAgICBtQ2hvaWNlQWN0aW9uTW9kZSA9IG51bGw7CisKKyAgICAgICAgICAgIC8vIEVuZGluZyBzZWxlY3Rpb24gbW9kZSBtZWFucyBkZXNlbGVjdGluZyBldmVyeXRoaW5nLgorICAgICAgICAgICAgY2xlYXJDaG9pY2VzKCk7CisKKyAgICAgICAgICAgIG1EYXRhQ2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICByZW1lbWJlclN5bmNTdGF0ZSgpOworICAgICAgICAgICAgcmVxdWVzdExheW91dCgpOworCisgICAgICAgICAgICBzZXRMb25nQ2xpY2thYmxlKHRydWUpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25JdGVtQ2hlY2tlZFN0YXRlQ2hhbmdlZChBY3Rpb25Nb2RlIG1vZGUsCisgICAgICAgICAgICAgICAgaW50IHBvc2l0aW9uLCBsb25nIGlkLCBib29sZWFuIGNoZWNrZWQpIHsKKyAgICAgICAgICAgIG1XcmFwcGVkLm9uSXRlbUNoZWNrZWRTdGF0ZUNoYW5nZWQobW9kZSwgcG9zaXRpb24sIGlkLCBjaGVja2VkKTsKKworICAgICAgICAgICAgLy8gSWYgdGhlcmUgYXJlIG5vIGl0ZW1zIHNlbGVjdGVkIHdlIG5vIGxvbmdlciBuZWVkIHRoZSBzZWxlY3Rpb24gbW9kZS4KKyAgICAgICAgICAgIGlmIChnZXRDaGVja2VkSXRlbUNvdW50KCkgPT0gMCkgeworICAgICAgICAgICAgICAgIG1vZGUuZmluaXNoKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKICAgICAgKiBBYnNMaXN0VmlldyBleHRlbmRzIExheW91dFBhcmFtcyB0byBwcm92aWRlIGEgcGxhY2UgdG8gaG9sZCB0aGUgdmlldyB0eXBlLgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgTGF5b3V0UGFyYW1zIGV4dGVuZHMgVmlld0dyb3VwLkxheW91dFBhcmFtcyB7CkBAIC00NjMyLDcgKzQ4OTYsNyBAQAogICAgICAgICAgICAgICAgICAgICBmaW5hbCBBcnJheUxpc3Q8Vmlldz4gc2NyYXAgPSBtU2NyYXBWaWV3c1tpXTsKICAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IHNjcmFwQ291bnQgPSBzY3JhcC5zaXplKCk7CiAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgc2NyYXBDb3VudDsgaisrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzY3JhcC5nZXQoaSkuc2V0RHJhd2luZ0NhY2hlQmFja2dyb3VuZENvbG9yKGNvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjcmFwLmdldChqKS5zZXREcmF3aW5nQ2FjaGVCYWNrZ3JvdW5kQ29sb3IoY29sb3IpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICA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V2aW91c1ZpZXdzOworCisgICAgLyoqCisgICAgICogVGhlIGluZGV4LCByZWxhdGl2ZSB0byB0aGUgYWRhcHRlciwgb2YgdGhlIGJlZ2lubmluZyBvZiB0aGUgd2luZG93IG9mIHZpZXdzCisgICAgICovCisgICAgaW50IG1DdXJyZW50V2luZG93U3RhcnQgPSAwOworCisgICAgLyoqCisgICAgICogVGhlIGluZGV4LCByZWxhdGl2ZSB0byB0aGUgYWRhcHRlciwgb2YgdGhlIGVuZCBvZiB0aGUgd2luZG93IG9mIHZpZXdzCisgICAgICovCisgICAgaW50IG1DdXJyZW50V2luZG93RW5kID0gLTE7CisKKyAgICAvKioKKyAgICAgKiBUaGUgc2FtZSBhcyB7QGxpbmsgI21DdXJyZW50V2luZG93U3RhcnR9LCBleGNlcHQgd2hlbiB0aGUgd2UgaGF2ZSBib3VuZGVkCisgICAgICoge0BsaW5rICNtQ3VycmVudFdpbmRvd1N0YXJ0fSB0byBiZSBub24tbmVnYXRpdmUKKyAgICAgKi8KKyAgICBpbnQgbUN1cnJlbnRXaW5kb3dTdGFydFVuYm91bmRlZCA9IDA7CisKKyAgICAvKioKKyAgICAgKiBIYW5kbGVyIHRvIHBvc3QgZXZlbnRzIHRvIHRoZSBtYWluIHRocmVhZAorICAgICAqLworICAgIEhhbmRsZXIgbU1haW5RdWV1ZTsKKworICAgIC8qKgorICAgICAqIExpc3RlbnMgZm9yIGRhdGEgY2hhbmdlcyBmcm9tIHRoZSBhZGFwdGVyCisgICAgICovCisgICAgQWRhcHRlckRhdGFTZXRPYnNlcnZlciBtRGF0YVNldE9ic2VydmVyOworCisgICAgLyoqCisgICAgICogVGhlIHtAbGluayBBZGFwdGVyfSBmb3IgdGhpcyB7QGxpbmsgQWRhcHRlclZpZXdBbmltYXRvcn0KKyAgICAgKi8KKyAgICBBZGFwdGVyIG1BZGFwdGVyOworCisgICAgLyoqCisgICAgICogVGhlIHtAbGluayBSZW1vdGVWaWV3c0FkYXB0ZXJ9IGZvciB0aGlzIHtAbGluayBBZGFwdGVyVmlld0FuaW1hdG9yfQorICAgICAqLworICAgIFJlbW90ZVZpZXdzQWRhcHRlciBtUmVtb3RlVmlld3NBZGFwdGVyOworCisgICAgLyoqCisgICAgICogU3BlY2lmaWVzIHdoZXRoZXIgdGhpcyBpcyB0aGUgZmlyc3QgdGltZSB0aGUgYW5pbWF0b3IgaXMgc2hvd2luZyB2aWV3cworICAgICAqLworICAgIGJvb2xlYW4gbUZpcnN0VGltZSA9IHRydWU7CisKKyAgICAvKioKKyAgICAgKiBTcGVjaWZpZXMgaWYgdGhlIGFuaW1hdG9yIHNob3VsZCB3cmFwIGZyb20gMCB0byB0aGUgZW5kIGFuZCB2aWNlIHZlcnNhCisgICAgICogb3IgaGF2ZSBoYXJkIGJvdW5kYXJpZXMgYXQgdGhlIGJlZ2lubmluZyBhbmQgZW5kCisgICAgICovCisgICAgYm9vbGVhbiBtTG9vcFZpZXdzID0gdHJ1ZTsKKworICAgIC8qKgorICAgICAqIFRoZSB3aWR0aCBhbmQgaGVpZ2h0IG9mIHNvbWUgY2hpbGQsIHVzZWQgYXMgYSBzaXplIHJlZmVyZW5jZSBpbi1jYXNlIG91cgorICAgICAqIGRpbWVuc2lvbnMgYXJlIHVuc3BlY2lmaWVkIGJ5IHRoZSBwYXJlbnQuCisgICAgICovCisgICAgaW50IG1SZWZlcmVuY2VDaGlsZFdpZHRoID0gLTE7CisgICAgaW50IG1SZWZlcmVuY2VDaGlsZEhlaWdodCA9IC0xOworCisgICAgLyoqCisgICAgICogSW4gYW5kIG91dCBhbmltYXRpb25zLgorICAgICAqLworICAgIE9iamVjdEFuaW1hdG9yIG1JbkFuaW1hdGlvbjsKKyAgICBPYmplY3RBbmltYXRvciBtT3V0QW5pbWF0aW9uOworCisgICAgLyoqCisgICAgICogQ3VycmVudCB0b3VjaCBzdGF0ZS4KKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBtVG91Y2hNb2RlID0gVE9VQ0hfTU9ERV9OT05FOworCisgICAgLyoqCisgICAgICogUHJpdmF0ZSB0b3VjaCBzdGF0ZXMuCisgICAgICovCisgICAgc3RhdGljIGZpbmFsIGludCBUT1VDSF9NT0RFX05PTkUgPSAwOworICAgIHN0YXRpYyBmaW5hbCBpbnQgVE9VQ0hfTU9ERV9ET1dOX0lOX0NVUlJFTlRfVklFVyA9IDE7CisgICAgc3RhdGljIGZpbmFsIGludCBUT1VDSF9NT0RFX0hBTkRMRUQgPSAyOworCisgICAgcHJpdmF0ZSBSdW5uYWJsZSBtUGVuZGluZ0NoZWNrRm9yVGFwOworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IERFRkFVTFRfQU5JTUFUSU9OX0RVUkFUSU9OID0gMjAwOworCisgICAgcHVibGljIEFkYXB0ZXJWaWV3QW5pbWF0b3IoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIHN1cGVyKGNvbnRleHQpOworICAgICAgICBpbml0Vmlld0FuaW1hdG9yKCk7CisgICAgfQorCisgICAgcHVibGljIEFkYXB0ZXJWaWV3QW5pbWF0b3IoQ29udGV4dCBjb250ZXh0LCBBdHRyaWJ1dGVTZXQgYXR0cnMpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCwgYXR0cnMpOworCisgICAgICAgIFR5cGVkQXJyYXkgYSA9IGNvbnRleHQub2J0YWluU3R5bGVkQXR0cmlidXRlcyhhdHRycywKKyAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BZGFwdGVyVmlld0FuaW1hdG9yKTsKKyAgICAgICAgaW50IHJlc291cmNlID0gYS5nZXRSZXNvdXJjZUlkKAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFkYXB0ZXJWaWV3QW5pbWF0b3JfaW5BbmltYXRpb24sIDApOworICAgICAgICBpZiAocmVzb3VyY2UgPiAwKSB7CisgICAgICAgICAgICBzZXRJbkFuaW1hdGlvbihjb250ZXh0LCByZXNvdXJjZSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzZXRJbkFuaW1hdGlvbihnZXREZWZhdWx0SW5BbmltYXRpb24oKSk7CisgICAgICAgIH0KKworICAgICAgICByZXNvdXJjZSA9IGEuZ2V0UmVzb3VyY2VJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BZGFwdGVyVmlld0FuaW1hdG9yX291dEFuaW1hdGlvbiwgMCk7CisgICAgICAgIGlmIChyZXNvdXJjZSA+IDApIHsKKyAgICAgICAgICAgIHNldE91dEFuaW1hdGlvbihjb250ZXh0LCByZXNvdXJjZSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzZXRPdXRBbmltYXRpb24oZ2V0RGVmYXVsdE91dEFuaW1hdGlvbigpKTsKKyAgICAgICAgfQorCisgICAgICAgIGJvb2xlYW4gZmxhZyA9IGEuZ2V0Qm9vbGVhbigKKyAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BZGFwdGVyVmlld0FuaW1hdG9yX2FuaW1hdGVGaXJzdFZpZXcsIHRydWUpOworICAgICAgICBzZXRBbmltYXRlRmlyc3RWaWV3KGZsYWcpOworCisgICAgICAgIG1Mb29wVmlld3MgPSBhLmdldEJvb2xlYW4oCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQWRhcHRlclZpZXdBbmltYXRvcl9sb29wVmlld3MsIGZhbHNlKTsKKworICAgICAgICBhLnJlY3ljbGUoKTsKKworICAgICAgICBpbml0Vmlld0FuaW1hdG9yKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW5pdGlhbGl6ZSB0aGlzIHtAbGluayBBZGFwdGVyVmlld0FuaW1hdG9yfQorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBpbml0Vmlld0FuaW1hdG9yKCkgeworICAgICAgICBtTWFpblF1ZXVlID0gbmV3IEhhbmRsZXIoTG9vcGVyLm15TG9vcGVyKCkpOworICAgICAgICBtUHJldmlvdXNWaWV3cyA9IG5ldyBBcnJheUxpc3Q8SW50ZWdlcj4oKTsKKyAgICB9CisKKyAgICBjbGFzcyBWaWV3QW5kSW5kZXggeworICAgICAgICBWaWV3QW5kSW5kZXgoVmlldyB2LCBpbnQgaSkgeworICAgICAgICAgICAgdmlldyA9IHY7CisgICAgICAgICAgICBpbmRleCA9IGk7CisgICAgICAgIH0KKyAgICAgICAgVmlldyB2aWV3OworICAgICAgICBpbnQgaW5kZXg7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2QgaXMgdXNlZCBieSBzdWJjbGFzc2VzIHRvIGNvbmZpZ3VyZSB0aGUgYW5pbWF0b3IgdG8gZGlzcGxheSB0aGUKKyAgICAgKiBkZXNpcmVkIG51bWJlciBvZiB2aWV3cywgYW5kIHNwZWNpZnkgdGhlIG9mZnNldAorICAgICAqCisgICAgICogQHBhcmFtIG51bVZpc2libGVWaWV3cyBUaGUgbnVtYmVyIG9mIHZpZXdzIHRoZSBhbmltYXRvciBrZWVwcyBpbiB0aGUge0BsaW5rIFZpZXdHcm91cH0KKyAgICAgKiBAcGFyYW0gYWN0aXZlT2Zmc2V0IFRoaXMgcGFyYW1ldGVyIHNwZWNpZmllcyB3aGVyZSB0aGUgY3VycmVudCBpbmRleCAoe0BsaW5rICNtV2hpY2hDaGlsZH0pCisgICAgICogICAgICAgIHNpdHMgd2l0aGluIHRoZSB3aW5kb3cuIEZvciBleGFtcGxlIGlmIGFjdGl2ZU9mZnNldCBpcyAxLCBhbmQgbnVtVmlzaWJsZVZpZXdzIGlzIDMsCisgICAgICogICAgICAgIGFuZCB7QGxpbmsgI3NldERpc3BsYXllZENoaWxkKGludCl9IGlzIGNhbGxlZCB3aXRoIDEwLCB0aGVuIHRoZSBlZmZlY3RpdmUgd2luZG93IHdpbGwKKyAgICAgKiAgICAgICAgYmUgdGhlIGluZGV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orICAgICAqIHRoZSBzZXQgb2YgdmlzaWJsZSB2aWV3cworICAgICAqCisgICAgICogQHBhcmFtIGZyb21JbmRleCBUaGUgcmVsYXRpdmUgaW5kZXggd2l0aGluIHRoZSB3aW5kb3cgdGhhdCB0aGUgdmlldyB3YXMgaW4sIC0xIGlmIGl0IHdhc24ndAorICAgICAqICAgICAgICBpbiB0aGUgd2luZG93CisgICAgICogQHBhcmFtIHRvSW5kZXggVGhlIHJlbGF0aXZlIGluZGV4IHdpdGhpbiB0aGUgd2luZG93IHRoYXQgdGhlIHZpZXcgaXMgZ29pbmcgdG8sIC0xIGlmIGl0IGlzCisgICAgICogICAgICAgIGJlaW5nIHJlbW92ZWQKKyAgICAgKiBAcGFyYW0gdmlldyBUaGUgdmlldyB0aGF0IGlzIGJlaW5nIGFuaW1hdGVkCisgICAgICovCisgICAgdm9pZCBhbmltYXRlVmlld0ZvclRyYW5zaXRpb24oaW50IGZyb21JbmRleCwgaW50IHRvSW5kZXgsIFZpZXcgdmlldykgeworICAgICAgICBpZiAoZnJvbUluZGV4ID09IC0xKSB7CisgICAgICAgICAgICBtSW5BbmltYXRpb24uc2V0VGFyZ2V0KHZpZXcpOworICAgICAgICAgICAgbUluQW5pbWF0aW9uLnN0YXJ0KCk7CisgICAgICAgIH0gZWxzZSBpZiAodG9JbmRleCA9PSAtMSkgeworICAgICAgICAgICAgbU91dEFuaW1hdGlvbi5zZXRUYXJnZXQodmlldyk7CisgICAgICAgICAgICBtT3V0QW5pbWF0aW9uLnN0YXJ0KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBPYmplY3RBbmltYXRvciBnZXREZWZhdWx0SW5BbmltYXRpb24oKSB7CisgICAgICAgIE9iamVjdEFuaW1hdG9yIGFuaW0gPSBPYmplY3RBbmltYXRvci5vZkZsb2F0KG51bGwsICJhbHBoYSIsIDAuMGYsIDEuMGYpOworICAgICAgICBhbmltLnNldER1cmF0aW9uKERFRkFVTFRfQU5JTUFUSU9OX0RVUkFUSU9OKTsKKyAgICAgICAgcmV0dXJuIGFuaW07CisgICAgfQorCisgICAgT2JqZWN0QW5pbWF0b3IgZ2V0RGVmYXVsdE91dEFuaW1hdGlvbigpIHsKKyAgICAgICAgT2JqZWN0QW5pbWF0b3IgYW5pbSA9IE9iamVjdEFuaW1hdG9yLm9mRmxvYXQobnVsbCwgImFscGhhIiwgMS4wZiwgMC4wZik7CisgICAgICAgIGFuaW0uc2V0RHVyYXRpb24oREVGQVVMVF9BTklNQVRJT05fRFVSQVRJT04pOworICAgICAgICByZXR1cm4gYW5pbTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXRzIHdoaWNoIGNoaWxkIHZpZXcgd2lsbCBiZSBkaXNwbGF5ZWQuCisgICAgICoKKyAgICAgKiBAcGFyYW0gd2hpY2hDaGlsZCB0aGUgaW5kZXggb2YgdGhlIGNoaWxkIHZpZXcgdG8gZGlzcGxheQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldERpc3BsYXllZENoaWxkKGludCB3aGljaENoaWxkKSB7CisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtV2hpY2hDaGlsZCA9IHdoaWNoQ2hpbGQ7CisgICAgICAgICAgICBpZiAod2hpY2hDaGlsZCA+PSBnZXRXaW5kb3dTaXplKCkpIHsKKyAgICAgICAgICAgICAgICBtV2hpY2hDaGlsZCA9IG1Mb29wVmlld3MgPyAwIDogZ2V0V2luZG93U2l6ZSgpIC0gMTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAod2hpY2hDaGlsZCA8IDApIHsKKyAgICAgICAgICAgICAgICBtV2hpY2hDaGlsZCA9IG1Mb29wVmlld3MgPyBnZXRXaW5kb3dTaXplKCkgLSAxIDogMDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYm9vbGVhbiBoYXNGb2N1cyA9IGdldEZvY3VzZWRDaGlsZCgpICE9IG51bGw7CisgICAgICAgICAgICAvLyBUaGlzIHdpbGwgY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BzaG93cyB0aGUgcHJldmlvdXMgY2hpbGQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2hvd1ByZXZpb3VzKCkgeworICAgICAgICBzZXREaXNwbGF5ZWRDaGlsZChtV2hpY2hDaGlsZCAtIDEpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNob3dzIG9ubHkgdGhlIHNwZWNpZmllZCBjaGlsZC4gVGhlIG90aGVyIGRpc3BsYXlzIFZpZXdzIGV4aXQgdGhlIHNjcmVlbiwKKyAgICAgKiBvcHRpb25hbGx5IHdpdGggdGhlIHdpdGggdGhlIHtAbGluayAjZ2V0T3V0QW5pbWF0aW9uKCkgb3V0IGFuaW1hdGlvbn0gYW5kCisgICAgICogdGhlIHNwZWNpZmllZCBjaGlsZCBlbnRlcnMgdGhlIHNjcmVlbiwgb3B0aW9uYWxseSB3aXRoIHRoZQorICAgICAqIHtAbGluayAjZ2V0SW5BbmltYXRpb24oKSBpbiBhbmltYXRpb259LgorICAgICAqCisgICAgICogQHBhcmFtIGNoaWxkSW5kZXggVGhlIGluZGV4IG9mIHRoZSBjaGlsZCB0byBiZSBzaG93bi4KKyAgICAgKiBAcGFyYW0gYW5pbWF0ZSBXaGV0aGVyIG9yIG5vdCB0byB1c2UgdGhlIGluIGFuZCBvdXQgYW5pbWF0aW9ucywgZGVmYXVsdHMKKyAgICAgKiAgICAgICAgICAgIHRvIHRydWUuCisgICAgICovCisgICAgdm9pZCBzaG93T25seShpbnQgY2hpbGRJbmRleCwgYm9vbGVhbiBhbmltYXRlKSB7CisgICAgICAgIHNob3dPbmx5KGNoaWxkSW5kZXgsIGFuaW1hdGUsIGZhbHNlKTsKKyAgICB9CisKKyAgICBpbnQgbW9kdWxvKGludCBwb3MsIGludCBzaXplKSB7CisgICAgICAgIGlmIChzaXplID4gMCkgeworICAgICAgICAgICAgcmV0dXJuIChzaXplICsgKHBvcyAlIHNpemUpKSAlIHNpemU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEdldCB0aGUgdmlldyBhdCB0aGlzIGluZGV4IHJlbGF0aXZlIHRvIHRoZSBjdXJyZW50IHdpbmRvdydzIHN0YXJ0CisgICAgICoKKyAgICAgKiBAcGFyYW0gcmVsYXRpdmVJbmRleCBQb3NpdGlvbiByZWxhdGl2ZSB0byB0aGUgY3VycmVudCB3aW5kb3cncyBzdGFydAorICAgICAqIEByZXR1cm4gVmlldyBhdCB0aGlzIGluZGV4LCBudWxsIGlmIHRoZSBpbmRleCBpcyBvdXRzaWRlIHRoZSBib3VuZHMKKyAgICAgKi8KKyAgICBWaWV3IGdldFZpZXdBdFJlbGF0aXZlSW5kZXgoaW50IHJlbGF0aXZlSW5kZXgpIHsKKyAgICAgICAgaWYgKHJlbGF0aXZlSW5kZXggPj0gMCAmJiByZWxhdGl2ZUluZGV4IDw9IGdldE51bUFjdGl2ZVZpZXdzKCkgLSAxICYmIG1BZGFwdGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIGludCBpID0gbW9kdWxvKG1DdXJyZW50V2luZG93U3RhcnRVbmJvdW5kZWQgKyByZWxhdGl2ZUluZGV4LCBnZXRXaW5kb3dTaXplKCkpOworICAgICAgICAgICAgaWYgKG1WaWV3c01hcC5nZXQoaSkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBtVmlld3NNYXAuZ2V0KGkpLnZpZXc7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgaW50IGdldE51bUFjdGl2ZVZpZXdzKCkgeworICAgICAgICBpZiAobUFkYXB0ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIE1hdGgubWluKG1BZGFwdGVyLmdldENvdW50KCkgKyAxLCBtTWF4TnVtQWN0aXZlVmlld3MpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIG1NYXhOdW1BY3RpdmVWaWV3czsKKyAgICAgICAgfQorICAgIH0KKworICAgIGludCBnZXRXaW5kb3dTaXplKCkgeworICAgICAgICBpZiAobUFkYXB0ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgaW50IGFkYXB0ZXJDb3VudCA9IG1BZGFwdGVyLmdldENvdW50KCk7CisgICAgICAgICAgICBpZiAoYWRhcHRlckNvdW50IDw9IGdldE51bUFjdGl2ZVZpZXdzKCkgJiYgbUxvb3BWaWV3cykgeworICAgICAgICAgICAgICAgIHJldHVybiBhZGFwdGVyQ291bnQqbU1heE51bUFjdGl2ZVZpZXdzOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gYWRhcHRlckNvdW50OworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBMYXlvdXRQYXJhbXMgY3JlYXRlT3JSZXVzZUxheW91dFBhcmFtcyhWaWV3IHYpIHsKKyAgICAgICAgZmluYWwgVmlld0dyb3VwLkxheW91dFBhcmFtcyBjdXJyZW50THAgPSB2LmdldExheW91dFBhcmFtcygpOworICAgICAgICBpZiAoY3VycmVudExwIGluc3RhbmNlb2YgVmlld0dyb3VwLkxheW91dFBhcmFtcykgeworICAgICAgICAgICAgTGF5b3V0UGFyYW1zIGxwID0gKExheW91dFBhcmFtcykgY3VycmVudExwOworICAgICAgICAgICAgcmV0dXJuIGxwOworICAgICAgICB9CisgICAgICAgIHJldHVybiBuZXcgVmlld0dyb3VwLkxheW91dFBhcmFtcygwLCAwKTsKKyAgICB9CisKKyAgICB2b2lkIHJlZnJlc2hDaGlsZHJlbigpIHsKKyAgICAgICAgaWYgKG1BZGFwdGVyID09IG51bGwpIHJldHVybjsKKyAgICAgICAgZm9yIChpbnQgaSA9IG1DdXJyZW50V2luZG93U3RhcnQ7IGkgPD0gbUN1cnJlbnRXaW5kb3dFbmQ7IGkrKykgeworICAgICAgICAgICAgaW50IGluZGV4ID0gbW9kdWxvKGksIGdldFdpbmRvd1NpemUoKSk7CisKKyAgICAgICAgICAgIGludCBhZGFwdGVyQ291bnQgPSBtQWRhcHRlci5nZXRDb3VudCgpOworICAgICAgICAgICAgLy8gZ2V0IHRoZSBmcmVzaCBjaGlsZCBmcm9tIHRoZSBhZGFwdGVyCisgICAgICAgICAgICBWaWV3IHVwZGF0ZWRDaGlsZCA9IG1BZGFwdGVyLmdldFZpZXcobW9kdWxvKGksIGFkYXB0ZXJDb3VudCksIG51bGwsIHRoaXMpOworCisgICAgICAgICAgICBpZiAobVZpZXdzTWFwLmNvbnRhaW5zS2V5KGluZGV4KSkgeworICAgICAgICAgICAgICAgIEZyYW1lTGF5b3V0IGZsID0gKEZyYW1lTGF5b3V0KSBtVmlld3NNYXAuZ2V0KGluZGV4KS52aWV3OworICAgICAgICAgICAgICAgIC8vIGZsdXNoIG91dCB0aGUgb2xkIGNoaWxkCisgICAgICAgICAgICAgICAgZmwucmVtb3ZlQWxsVmlld3NJbkxheW91dCgpOworICAgICAgICAgICAgICAgIC8vIGFkZCB0aGUgbmV3IGNoaWxkIHRvIHRoZSBmcmFtZSwgaWYgaXQgZXhpc3RzCisgICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWRDaGlsZCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZsLmFkZFZpZXcodXBkYXRlZENoaWxkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIG1ldGhvZCBjYW4gYmUgb3ZlcnJpZGRlbiBzbyB0aGF0IHN1YmNsYXNzZXMgY2FuIHByb3ZpZGUgYSBjdXN0b20gZnJhbWUgaW4gd2hpY2ggdGhlaXIKKyAgICAgKiBjaGlsZHJlbiBjYW4gbGl2ZS4gRm9yIGV4YW1wbGUsIFN0YWNrVmlldyBhZGRzIHBhZGRpbmcgdG8gaXRzIGNoaWxkcmVucycgZnJhbWVzIHNvIGFzIHRvCisgICAgICogYWNjb21vZGF0ZSBmb3IgdGhlIGhpZ2hsaWdodCBlZmZlY3QuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIFRoZSBGcmFtZUxheW91dCBpbnRvIHdoaWNoIGNoaWxkcmVuIGNhbiBiZSBwbGFjZWQuCisgICAgICovCisgICAgRnJhbWVMYXlvdXQgZ2V0RnJhbWVGb3JDaGlsZCgpIHsKKyAgICAgICAgcmV0dXJuIG5ldyBGcmFtZUxheW91dChtQ29udGV4dCk7CisgICAgfQorCisgICAgdm9pZCBzaG93T25seShpbnQgY2hpbGRJbmRleCwgYm9vbGVhbiBhbmltYXRlLCBib29sZWFuIG9uTGF5b3V0KSB7CisgICAgICAgIGlmIChtQWRhcHRlciA9PSBudWxsKSByZXR1cm47CisgICAgICAgIGZpbmFsIGludCBhZGFwdGVyQ291bnQgPSBtQWRhcHRlci5nZXRDb3VudCgpOworICAgICAgICBpZiAoYWRhcHRlckNvdW50ID09IDApIHJldHVybjsKKworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1QcmV2aW91c1ZpZXdzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICBWaWV3IHZpZXdUb1JlbW92ZSA9IG1WaWV3c01hcC5nZXQobVByZXZpb3VzVmlld3MuZ2V0KGkpKS52aWV3OworICAgICAgICAgICAgbVZpZXdzTWFwLnJlbW92ZShtUHJldmlvdXNWaWV3cy5nZXQoaSkpOworICAgICAgICAgICAgdmlld1RvUmVtb3ZlLmNsZWFyQW5pbWF0aW9uKCk7CisgICAgICAgICAgICBpZiAodmlld1RvUmVtb3ZlIGluc3RhbmNlb2YgVmlld0dyb3VwKSB7CisgICAgICAgICAgICAgICAgVmlld0dyb3VwIHZnID0gKFZpZXdHcm91cCkgdmlld1RvUmVtb3ZlOworICAgICAgICAgICAgICAgIHZnLnJlbW92ZUFsbFZpZXdzSW5MYXlvdXQoKTsKKyAgICAgICAgIC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pbnQgcmFuZ2VFbmQgPSBtb2R1bG8obmV3V2luZG93RW5kLCBnZXRXaW5kb3dTaXplKCkpOworCisgICAgICAgIGJvb2xlYW4gd3JhcCA9IGZhbHNlOworICAgICAgICBpZiAocmFuZ2VTdGFydCA+IHJhbmdlRW5kKSB7CisgICAgICAgICAgICB3cmFwID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFRoaXMgc2VjdGlvbiBjbGVhcnMgb3V0IGFueSBpdGVtcyB0aGF0IGFyZSBpbiBvdXIgYWN0aXZlIHZpZXdzIGxpc3QKKyAgICAgICAgLy8gYnV0IGFyZSBvdXRzaWRlIHRoZSBlZmZlY3RpdmUgYm91bmRzIG9mIG91ciB3aW5kb3cgKHRoaXMgaXMgYmVjb21lcyBhbiBpc3N1ZQorICAgICAgICAvLyBhdCB0aGUgZXh0cmVtaXRpZXMgb2YgdGhlIGxpc3QsIGVnLiB3aGVyZSBuZXdXaW5kb3dTdGFydFVuYm91bmRlZCA8IDAgb3IKKyAgICAgICAgLy8gbmV3V2luZG93RW5kVW5ib3VuZGVkID4gbUFkYXB0ZXIuZ2V0Q291bnQoKSAtIDEKKyAgICAgICAgZm9yIChJbnRlZ2VyIGluZGV4IDogbVZpZXdzTWFwLmtleVNldCgpKSB7CisgICAgICAgICAgICBib29sZWFuIHJlbW92ZSA9IGZhbHNlOworICAgICAgICAgICAgaWYgKCF3cmFwICYmIChpbmRleCA8IHJhbmdlU3RhcnQgfHwgaW5kZXggPiByYW5nZUVuZCkpIHsKKyAgICAgICAgICAgICAgICByZW1vdmUgPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmICh3cmFwICYmIChpbmRleCA+IHJhbmdlRW5kICYmIGluZGV4IDwgcmFuZ2VTdGFydCkpIHsKKyAgICAgICAgICAgICAgICByZW1vdmUgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocmVtb3ZlKSB7CisgICAgICAgICAgICAgICAgVmlldyBwcmV2aW91c1ZpZXcgPSBtVmlld3NNYXAuZ2V0KGluZGV4KS52aWV3OworICAgICAgICAgICAgICAgIGludCBvbGRSZWxhdGl2ZUluZGV4ID0gbVZpZXdzTWFwLmdldChpbmRleCkuaW5kZXg7CisKKyAgICAgICAgICAgICAgICBtUHJldmlvdXNWaWV3cy5hZGQoaW5kZXgpOworICAgICAgICAgICAgICAgIGFuaW1hdGVWaWV3Rm9yVHJhbnNpdGlvbihvbGRSZWxhdGl2ZUluZGV4LCAtMSwgcHJldmlvdXNWaWV3KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIElmIHRoZSB3aW5kb3cgaGFzIGNoYW5nZWQKKyAgICAgICAgaWYgKCEobmV3V2luZG93U3RhcnQgPT0gbUN1cnJlbnRXaW5kb3dTdGFydCAmJiBuZXdXaW5kb3dFbmQgPT0gbUN1cnJlbnRXaW5kb3dFbmQgJiYKKyAgICAgICAgICAgICAgbmV3V2luZG93U3RhcnRVbmJvdW5kZWQgPT0gbUN1cnJlbnRXaW5kb3dTdGFydFVuYm91bmRlZCkpIHsKKyAgICAgICAgICAgIC8vIFJ1biB0aHJvdWdoIHRoZSBpbmRpY2VzIGluIHRoZSBuZXcgcmFuZ2UKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBuZXdXaW5kb3dTdGFydDsgaSA8PSBuZXdXaW5kb3dFbmQ7IGkrKykgeworCisgICAgICAgICAgICAgICAgaW50IGluZGV4ID0gbW9kdWxvKGksIGdldFdpbmRvd1NpemUoKSk7CisgICAgICAgICAgICAgICAgaW50IG9sZFJlbGF0aXZlSW5kZXg7CisgICAgICAgICAgICAgICAgaWYgKG1WaWV3c01hcC5jb250YWluc0tleShpbmRleCkpIHsKKyAgICAgICAgICAgICAgICAgICAgb2xkUmVsYXRpdmVJbmRleCA9IG1WaWV3c01hcC5nZXQoaW5kZXgpLmluZGV4OworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG9sZFJlbGF0aXZlSW5kZXggPSAtMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW50IG5ld1JlbGF0aXZlSW5kZXggPSBpIC0gbmV3V2luZG93U3RhcnRVbmJvdW5kZWQ7CisKKyAgICAgICAgICAgICAgICAvLyBJZiB0aGlzIGl0ZW0gaXMgaW4gdGhlIGN1cnJlbnQgd2luZG93LCBncmVhdCwgd2UganVzdCBuZWVkIHRvIGFwcGx5CisgICAgICAgICAgICAgICAgLy8gdGhlIHRyYW5zZm9ybSBmb3IgaXQncyBuZXcgcmVsYXRpdmUgcG9zaXRpb24gaW4gdGhlIHdpbmRvdywgYW5kIGFuaW1hdGUKKyAgICAgICAgICAgICAgICAvLyBiZXR3ZWVuIGl0J3MgY3VycmVudCBhbmQgbmV3IHJlbGF0aXZlIHBvc2l0aW9ucworICAgICAgICAgICAgICAgIGJvb2xlYW4gaW5PbGRSYW5nZSA9IG1WaWV3c01hcC5jb250YWluc0tleShpbmRleCkgJiYgIW1QcmV2aW91c1ZpZXdzLmNvbnRhaW5zKGluZGV4KTsKKworICAgICAgICAgICAgICAgIGlmIChpbk9sZFJhbmdlKSB7CisgICAgICAgICAgICAgICAgICAgIFZpZXcgdmlldyA9IG1WaWV3c01hcC5nZXQoaW5kZXgpLnZpZXc7CisgICAgICAgICAgICAgICAgICAgIG1WaWV3c01hcC5nZXQoaW5kZXgpLmluZGV4ID0gbmV3UmVsYXRpdmVJbmRleDsKKyAgICAgICAgICAgICAgICAgICAgYXBwbHlUcmFuc2Zvcm1Gb3JDaGlsZEF0SW5kZXgodmlldywgbmV3UmVsYXRpdmVJbmRleCk7CisgICAgICAgICAgICAgICAgICAgIGFuaW1hdGVWaWV3Rm9yVHJhbnNpdGlvbihvbGRSZWxhdGl2ZUluZGV4LCBuZXdSZWxhdGl2ZUluZGV4LCB2aWV3KTsKKworICAgICAgICAgICAgICAgIC8vIE90aGVyd2lzZSB0aGlzIHZpZXcgaXMgbmV3IHRvIHRoZSB3aW5kb3cKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBHZXQgdGhlIG5ldyB2aWV3IGZyb20gdGhlIGFkYXB0ZXIsIGFkZCBpdCBhbmQgYXBwbHkgYW55IHRyYW5zZm9ybSAvIGFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICBWaWV3IG5ld1ZpZXcgPSBtQWRhcHRlci5nZXRWaWV3KG1vZHVsbyhpLCBhZGFwdGVyQ291bnQpLCBudWxsLCB0aGlzKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBXZSB3cmFwIHRoZSBuZXcgdmlldyBpbiBhIEZyYW1lTGF5b3V0IHNvIGFzIHRvIHJlc3BlY3QgdGhlIGNvbnRyYWN0CisgICAgICAgICAgICAgICAgICAgIC8vIHdpdGggdGhlIGFkYXB0ZXIsIHRoYXQgaXMsIHRoYXQgd2UgZG9uJ3QgbW9kaWZ5IHRoaXMgdmlldyBkaXJlY3RseQorICAgICAgICAgICAgICAgICAgICBGcmFtZUxheW91dCBmbCA9IGdldEZyYW1lRm9yQ2hpbGQoKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgdmlldyBmcm9tIHRoZSBhZGFwdGVyIGlzIG51bGwsIHdlIHN0aWxsIGtlZXAgYW4gZW1wdHkgZnJhbWUgaW4gcGxhY2UKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1ZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICBmbC5hZGRWaWV3KG5ld1ZpZXcpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1WaWV3c01hcC5wdXQoaW5kZXgsIG5ldyBWaWV3QW5kSW5kZXgoZmwsIG5ld1JlbGF0aXZlSW5kZXgpKTsKKyAgICAgICAgICAgICAgICAgICAgYWRkQ2hpbGQoZmwpOworICAgICAgICAgICAgICAgICAgICBhcHBseVRyYW5zZm9ybUZvckNoaWxkQXRJbmRleChmbCwgbmV3UmVsYXRpdmVJbmRleCk7CisgICAgICAgICAgICAgICAgICAgIGFuaW1hdGVWaWV3Rm9yVHJhbnNpdGlvbigtMSwgbmV3UmVsYXRpdmVJbmRleCwgZmwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtVmlld3NNYXAuZ2V0KGluZGV4KS52aWV3LmJyaW5nVG9Gcm9udCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUN1cnJlbnRXaW5kb3dTdGFydCA9IG5ld1dpbmRvd1N0YXJ0OworICAgICAgICAgICAgbUN1cnJlbnRXaW5kb3dFbmQgPSBuZXdXaW5kb3dFbmQ7CisgICAgICAgICAgICBtQ3VycmVudFdpbmRvd1N0YXJ0VW5ib3VuZGVkID0gbmV3V2luZG93U3RhcnRVbmJvdW5kZWQ7CisgICAgICAgIH0KKworICAgICAgICBtRmlyc3RUaW1lID0gZmFsc2U7CisgICAgICAgIGlmICghb25MYXlvdXQpIHsKKyAgICAgICAgICAgIHJlcXVlc3RMYXlvdXQoKTsKKyAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIElmIHRoZSBBZGFwdGVyIHRyaWVzIHRvIGxheW91dCB0aGUgY3VycmVudCB2aWV3IHdoZW4gd2UgZ2V0IGl0IHVzaW5nIGdldFZpZXcKKyAgICAgICAgICAgIC8vIGFib3ZlIHRoZSBsYXlvdXQgd2lsbCBlbmQgdXAgYmVpbmcgaWdub3JlZCBzaW5jZSB3ZSBhcmUgY3VycmVudGx5IGxheWluZyBvdXQsIHNvCisgICAgICAgICAgICAvLyB3ZSBwb3N0IGEgZGVsYXllZCByZXF1ZXN0TGF5b3V0IGFuZCBpbnZhbGlkYXRlCisgICAgICAgICAgICBtTWFpblF1ZXVlLnBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgIC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ICAgIH0KKworICAgIHZvaWQgc2hvd1RhcEZlZWRiYWNrKFZpZXcgdikgeworICAgICAgICB2LnNldFByZXNzZWQodHJ1ZSk7CisgICAgfQorCisgICAgdm9pZCBoaWRlVGFwRmVlZGJhY2soVmlldyB2KSB7CisgICAgICAgIHYuc2V0UHJlc3NlZChmYWxzZSk7CisgICAgfQorCisgICAgdm9pZCBjYW5jZWxIYW5kbGVDbGljaygpIHsKKyAgICAgICAgVmlldyB2ID0gZ2V0Q3VycmVudFZpZXcoKTsKKyAgICAgICAgaWYgKHYgIT0gbnVsbCkgeworICAgICAgICAgICAgaGlkZVRhcEZlZWRiYWNrKHYpOworICAgICAgICB9CisgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9NT0RFX05PTkU7CisgICAgfQorCisgICAgZmluYWwgY2xhc3MgQ2hlY2tGb3JUYXAgaW1wbGVtZW50cyBSdW5uYWJsZSB7CisgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX01PREVfRE9XTl9JTl9DVVJSRU5UX1ZJRVcpIHsKKyAgICAgICAgICAgICAgICBWaWV3IHYgPSBnZXRDdXJyZW50VmlldygpOworICAgICAgICAgICAgICAgIHNob3dUYXBGZWVkYmFjayh2KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikgeworICAgICAgICBpbnQgYWN0aW9uID0gZXYuZ2V0QWN0aW9uKCk7CisgICAgICAgIGJvb2xlYW4gaGFuZGxlZCA9IGZhbHNlOworICAgICAgICBzd2l0Y2ggKGFjdGlvbikgeworICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTjogeworICAgICAgICAgICAgICAgIFZpZXcgdiA9IGdldEN1cnJlbnRWaWV3KCk7CisgICAgICAgICAgICAgICAgaWYgKHYgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoaXNUcmFuc2Zvcm1lZFRvdWNoUG9pbnRJblZpZXcoZXYuZ2V0WCgpLCBldi5nZXRZKCksIHYsIG51bGwpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVBlbmRpbmdDaGVja0ZvclRhcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBlbmRpbmdDaGVja0ZvclRhcCA9IG5ldyBDaGVja0ZvclRhcCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX01PREVfRE9XTl9JTl9DVVJSRU5UX1ZJRVc7CisgICAgICAgICAgICAgICAgICAgICAgICBwb3N0RGVsYXllZChtUGVuZGluZ0NoZWNrRm9yVGFwLCBWaWV3Q29uZmlndXJhdGlvbi5nZXRUYXBUaW1lb3V0KCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRTogYnJlYWs7CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX1VQOiBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1VQOiB7CisgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfTU9ERV9ET1dOX0lOX0NVUlJFTlRfVklFVykgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IHYgPSBnZXRDdXJyZW50VmlldygpOworICAgICAgICAgICAgICAgICAgICBpZiAodiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNUcmFuc2Zvcm1lZFRvdWNoUG9pbnRJblZpZXcoZXYuZ2V0WCgpLCBldi5nZXRZKCksIHYsIG51bGwpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgSGFuZGxlciBoYW5kbGVyID0gZ2V0SGFuZGxlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYW5kbGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlci5yZW1vdmVDYWxsYmFja3MobVBlbmRpbmdDaGVja0ZvclRhcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dUYXBGZWVkYmFjayh2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3N0RGVsYXllZChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVUYXBGZWVkYmFjayh2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVyZm9ybUl0ZW1DbGljayh2LCAwLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFZpZXdDb25maWd1cmF0aW9uLmdldFByZXNzZWRTdGF0ZUR1cmF0aW9uKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9NT0RFX05PTkU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6IHsKKyAgICAgICAgICAgICAgICBWaWV3IHYgPSBnZXRDdXJyZW50VmlldygpOworICAgICAgICAgICAgICAgIGlmICh2ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaGlkZVRhcEZlZWRiYWNrKHYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfTU9ERV9OT05FOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBoYW5kbGVkOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBtZWFzdXJlQ2hpbGRyZW4oKSB7CisgICAgICAgIGZpbmFsIGludCBjb3VudCA9IGdldENoaWxkQ291bnQoKTsKKyAgICAgICAgZmluYWwgaW50IGNoaWxkV2lkdGggPSBtTWVhc3VyZWRXaWR0aCAtIG1QYWRkaW5nTGVmdCAtIG1QYWRkaW5nUmlnaHQ7CisgICAgICAgIGZpbmFsIGludCBjaGlsZEhlaWdodCA9IG1NZWFzdXJlZEhlaWdodCAtIG1QYWRkaW5nVG9wIC0gbVBhZGRpbmdCb3R0b207CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICBmaW5hbCBWaWV3IGNoaWxkID0gZ2V0Q2hpbGRBdChpKTsKKyAgICAgICAgICAgIGNoaWxkLm1lYXN1cmUoTWVhc3VyZVNwZWMubWFrZU1lYXN1cmVTcGVjKGNoaWxkV2lkdGgsIE1lYXN1cmVTcGVjLkVYQUNUTFkpLAorICAgICAg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XplKTsKKyAgICAgICAgbWVhc3VyZUNoaWxkcmVuKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25MYXlvdXQoYm9vbGVhbiBjaGFuZ2VkLCBpbnQgbGVmdCwgaW50IHRvcCwgaW50IHJpZ2h0LCBpbnQgYm90dG9tKSB7CisgICAgICAgIGJvb2xlYW4gZGF0YUNoYW5nZWQgPSBtRGF0YUNoYW5nZWQ7CisgICAgICAgIGlmIChkYXRhQ2hhbmdlZCkgeworICAgICAgICAgICAgaGFuZGxlRGF0YUNoYW5nZWQoKTsKKworICAgICAgICAgICAgLy8gaWYgdGhlIGRhdGEgY2hhbmdlcywgbVdoaWNoQ2hpbGQgbWlnaHQgYmUgb3V0IG9mIHRoZSBib3VuZHMgb2YgdGhlIGFkYXB0ZXIKKyAgICAgICAgICAgIC8vIGluIHRoaXMgY2FzZSwgd2UgcmVzZXQgbVdoaWNoQ2hpbGQgdG8gdGhlIGJlZ2lubmluZworICAgICAgICAgICAgaWYgKG1XaGljaENoaWxkID49IG1BZGFwdGVyLmdldENvdW50KCkpIHsKKyAgICAgICAgICAgICAgICBtV2hpY2hDaGlsZCA9IDA7CisKKyAgICAgICAgICAgICAgICBzaG93T25seShtV2hpY2hDaGlsZCwgdHJ1ZSwgdHJ1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZWZyZXNoQ2hpbGRyZW4oKTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIGludCBjaGlsZENvdW50ID0gZ2V0Q2hpbGRDb3VudCgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNoaWxkQ291bnQ7IGkrKykgeworICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IGdldENoaWxkQXQoaSk7CisKKyAgICAgICAgICAgIGludCBjaGlsZFJpZ2h0ID0gbVBhZGRpbmdMZWZ0ICsgY2hpbGQuZ2V0TWVhc3VyZWRXaWR0aCgpOworICAgICAgICAgICAgaW50IGNoaWxkQm90dG9tID0gbVBhZGRpbmdUb3AgKyBjaGlsZC5nZXRNZWFzdXJlZEhlaWdodCgpOworCisgICAgICAgICAgICBjaGlsZC5sYXlvdXQobVBhZGRpbmdMZWZ0LCBtUGFkZGluZ1RvcCwgY2hpbGRSaWdodCwgY2hpbGRCb3R0b20pOworICAgICAgICB9CisgICAgICAgIG1EYXRhQ2hhbmdlZCA9IGZhbHNlOworICAgIH0KKworICAgIHN0YXRpYyBjbGFzcyBTYXZlZFN0YXRlIGV4dGVuZHMgQmFzZVNhdmVkU3RhdGUgeworICAgICAgICBpbnQgd2hpY2hDaGlsZDsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ29uc3RydWN0b3IgY2FsbGVkIGZyb20ge0BsaW5rIEFkYXB0ZXJWaWV3QW5pbWF0b3Ijb25TYXZlSW5zdGFuY2VTdGF0ZSgpfQorICAgICAgICAgKi8KKyAgICAgICAgU2F2ZWRTdGF0ZShQYXJjZWxhYmxlIHN1cGVyU3RhdGUsIGludCB3aGljaENoaWxkKSB7CisgICAgICAgICAgICBzdXBlcihzdXBlclN0YXRlKTsKKyAgICAgICAgICAgIHRoaXMud2hpY2hDaGlsZCA9IHdoaWNoQ2hpbGQ7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ29uc3RydWN0b3IgY2FsbGVkIGZyb20ge0BsaW5rICNDUkVBVE9SfQorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSBTYXZlZFN0YXRlKFBhcmNlbCBpbikgeworICAgICAgICAgICAgc3VwZXIoaW4pOworICAgICAgICAgICAgdGhpcy53aGljaENoaWxkID0gaW4ucmVhZEludCgpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIG91dCwgaW50IGZsYWdzKSB7CisgICAgICAgICAgICBzdXBlci53cml0ZVRvUGFyY2VsKG91dCwgZmxhZ3MpOworICAgICAgICAgICAgb3V0LndyaXRlSW50KHRoaXMud2hpY2hDaGlsZCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgICAgIHJldHVybiAiQWRhcHRlclZpZXdBbmltYXRvci5TYXZlZFN0YXRleyB3aGljaENoaWxkID0gIiArIHRoaXMud2hpY2hDaGlsZCArICIgfSI7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFBhcmNlbGFibGUuQ3JlYXRvcjxTYXZlZFN0YXRlPiBDUkVBVE9SCisgICAgICAgICAgICAgICAgPSBuZXcgUGFyY2VsYWJsZS5DcmVhdG9yPFNhdmVkU3RhdGU+KCkgeworICAgICAgICAgICAgcHVibGljIFNhdmVkU3RhdGUgY3JlYXRlRnJvbVBhcmNlbChQYXJjZWwgaW4pIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNhdmVkU3RhdGUoaW4pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgU2F2ZWRTdGF0ZVtdIG5ld0FycmF5KGludCBzaXplKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTYXZlZFN0YXRlW3NpemVdOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBQYXJjZWxhYmxlIG9uU2F2ZUluc3RhbmNlU3RhdGUoKSB7CisgICAgICAgIFBhcmNlbGFibGUgc3VwZXJTdGF0ZSA9IHN1cGVyLm9uU2F2ZUluc3RhbmNlU3RhdGUoKTsKKyAgICAgICAgcmV0dXJuIG5ldyBTYXZlZFN0YXRlKHN1cGVyU3RhdGUsIG1XaGljaENoaWxkKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvblJlc3RvcmVJbnN0YW5jZVN0YXRlKFBhcmNl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b24gVGhlIGFuaW1hdGlvbiBzdGFydGVkIHdoZW4gYSBWaWV3IGVudGVycyB0aGUgc2NyZWVuLgorICAgICAqCisgICAgICogQHNlZSAjZ2V0SW5BbmltYXRpb24oKQorICAgICAqIEBzZWUgI3NldEluQW5pbWF0aW9uKGFuZHJvaWQuY29udGVudC5Db250ZXh0LCBpbnQpCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0SW5BbmltYXRpb24oT2JqZWN0QW5pbWF0b3IgaW5BbmltYXRpb24pIHsKKyAgICAgICAgbUluQW5pbWF0aW9uID0gaW5BbmltYXRpb247CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCBhbmltYXRpb24gdXNlZCB0byBhbmltYXRlIGEgVmlldyB0aGF0IGV4aXRzIHRoZSBzY3JlZW4uCisgICAgICoKKyAgICAgKiBAcmV0dXJuIEFuIEFuaW1hdGlvbiBvciBudWxsIGlmIG5vbmUgaXMgc2V0LgorICAgICAqCisgICAgICogQHNlZSAjc2V0T3V0QW5pbWF0aW9uKGFuZHJvaWQuYW5pbWF0aW9uLk9iamVjdEFuaW1hdG9yKQorICAgICAqIEBzZWUgI3NldE91dEFuaW1hdGlvbihhbmRyb2lkLmNvbnRlbnQuQ29udGV4dCwgaW50KQorICAgICAqLworICAgIHB1YmxpYyBPYmplY3RBbmltYXRvciBnZXRPdXRBbmltYXRpb24oKSB7CisgICAgICAgIHJldHVybiBtT3V0QW5pbWF0aW9uOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNwZWNpZmllcyB0aGUgYW5pbWF0aW9uIHVzZWQgdG8gYW5pbWF0ZSBhIFZpZXcgdGhhdCBleGl0IHRoZSBzY3JlZW4uCisgICAgICoKKyAgICAgKiBAcGFyYW0gb3V0QW5pbWF0aW9uIFRoZSBhbmltYXRpb24gc3RhcnRlZCB3aGVuIGEgVmlldyBleGl0IHRoZSBzY3JlZW4uCisgICAgICoKKyAgICAgKiBAc2VlICNnZXRPdXRBbm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cGVyLmdldEJhc2VsaW5lKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEFkYXB0ZXIgZ2V0QWRhcHRlcigpIHsKKyAgICAgICAgcmV0dXJuIG1BZGFwdGVyOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldEFkYXB0ZXIoQWRhcHRlciBhZGFwdGVyKSB7CisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsICYmIG1EYXRhU2V0T2JzZXJ2ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbUFkYXB0ZXIudW5yZWdpc3RlckRhdGFTZXRPYnNlcnZlcihtRGF0YVNldE9ic2VydmVyKTsKKyAgICAgICAgfQorCisgICAgICAgIG1BZGFwdGVyID0gYWRhcHRlcjsKKyAgICAgICAgY2hlY2tGb2N1cygpOworCisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtRGF0YVNldE9ic2VydmVyID0gbmV3IEFkYXB0ZXJEYXRhU2V0T2JzZXJ2ZXIoKTsKKyAgICAgICAgICAgIG1BZGFwdGVyLnJlZ2lzdGVyRGF0YVNldE9ic2VydmVyKG1EYXRhU2V0T2JzZXJ2ZXIpOworICAgICAgICB9CisgICAgICAgIHNldEZvY3VzYWJsZSh0cnVlKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXRzIHVwIHRoaXMgQWRhcHRlclZpZXdBbmltYXRvciB0byB1c2UgYSByZW1vdGUgdmlld3MgYWRhcHRlciB3aGljaCBjb25uZWN0cyB0byBhCisgICAgICogUmVtb3RlVmlld3NTZXJ2aWNlIHRocm91Z2ggdGhlIHNwZWNpZmllZCBpbnRlbnQuCisgICAgICoKKyAgICAgKiBAcGFyYW0gaW50ZW50IHRoZSBpbnRlbnQgdXNlZCB0byBpZGVudGlmeSB0aGUgUmVtb3RlVmlld3NTZXJ2aWNlIGZvciB0aGUgYWRhcHRlciB0bworICAgICAqICAgICAgICBjb25uZWN0IHRvLgorICAgICAqLworICAgIEBhbmRyb2lkLnZpZXcuUmVtb3RhYmxlVmlld01ldGhvZAorICAgIHB1YmxpYyB2b2lkIHNldFJlbW90ZVZpZXdzQWRhcHRlcihJbnRlbnQgaW50ZW50KSB7CisgICAgICAgIC8vIEVuc3VyZSB0aGF0IHdlIGRvbid0IGFscmVhZHkgaGF2ZSBhIFJlbW90ZVZpZXdzQWRhcHRlciB0aGF0IGlzIGJvdW5kIHRvIGFuIGV4aXN0aW5nCisgICAgICAgIC8vIHNlcnZpY2UgaGFuZGxpbmcgdGhlIHNwZWNpZmllZCBpbnRlbnQuCisgICAgICAgIGlmIChtUmVtb3RlVmlld3NBZGFwdGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIEludGVudC5GaWx0ZXJDb21wYXJpc29uIGZjTmV3ID0gbmV3IEludGVudC5GaWx0ZXJDb21wYXJpc29uKGludGVudCk7CisgICAgICAgICAgICBJbnRlbnQuRmlsdGVyQ29tcGFyaXNvbiBmY09sZCA9IG5ldyBJbnRlbnQuRmlsdGVyQ29tcGFyaXNvbigKKyAgICAgICAgICAgICAgICAgICAgbVJlbW90ZVZpZXdzQWRhcHRlci5nZXRSZW1vdGVWaWV3c1NlcnZpY2VJbnRlbnQoKSk7CisgICAgICAgICAgICBpZiAoZmNOZXcuZXF1YWxzKGZjT2xkKSkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIE90aGVyd2lzZSwgY3JlYXRlIGEgbmV3IFJlbW90ZVZpZXdzQWRhcHRlciBmb3IgYmluZGluZworICAgICAgICBtUmVtb3RlVmlld3NBZGFwdGVyID0gbmV3IFJlbW90ZVZpZXdzQWRhcHRlcihnZXRDb250ZXh0KCksIGludGVudCwgdGhpcyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0U2VsZWN0aW9uKGludCBwb3NpdGlvbikge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G1GbGlwSW50ZXJ2YWwgPSBhLmdldEludCgKKyAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5WaWV3RmxpcHBlcl9mbGlwSW50ZXJ2YWwsIERFRkFVTFRfSU5URVJWQUwpOworICAgICAgICBtQXV0b1N0YXJ0ID0gYS5nZXRCb29sZWFuKAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlZpZXdGbGlwcGVyX2F1dG9TdGFydCwgZmFsc2UpOworCisgICAgICAgIC8vIEJ5IGRlZmF1bHQgd2Ugd2FudCB0aGUgZmxpcHBlciB0byBsb29wCisgICAgICAgIG1Mb29wVmlld3MgPSBhLmdldEJvb2xlYW4oCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQWRhcHRlclZpZXdBbmltYXRvcl9sb29wVmlld3MsIHRydWUpOworCisgICAgICAgIGEucmVjeWNsZSgpOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgQnJvYWRjYXN0UmVjZWl2ZXIgbVJlY2VpdmVyID0gbmV3IEJyb2FkY2FzdFJlY2VpdmVyKCkgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIGFjdGlvbiA9IGludGVudC5nZXRBY3Rpb24oKTsKKyAgICAgICAgICAgIGlmIChJbnRlbnQuQUNUSU9OX1NDUkVFTl9PRkYuZXF1YWxzKGFjdGlvbikpIHsKKyAgICAgICAgICAgICAgICBtVXNlclByZXNlbnQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB1cGRhdGVSdW5uaW5nKCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKEludGVudC5BQ1RJT05fVVNFUl9QUkVTRU5ULmVxdWFscyhhY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mcoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbldpbmRvd1Zpc2liaWxpdHlDaGFuZ2VkKGludCB2aXNpYmlsaXR5KSB7CisgICAgICAgIHN1cGVyLm9uV2luZG93VmlzaWJpbGl0eUNoYW5nZWQodmlzaWJpbGl0eSk7CisgICAgICAgIG1WaXNpYmxlID0gKHZpc2liaWxpdHkgPT0gVklTSUJMRSk7CisgICAgICAgIHVwZGF0ZVJ1bm5pbmcoZmFsc2UpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldEFkYXB0ZXIoQWRhcHRlciBhZGFwdGVyKSB7CisgICAgICAgIHN1cGVyLnNldEFkYXB0ZXIoYWRhcHRlcik7CisgICAgICAgIHVwZGF0ZVJ1bm5pbmcoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBIb3cgbG9uZyB0byB3YWl0IGJlZm9yZSBmbGlwcGluZyB0byB0aGUgbmV4dCB2aWV3CisgICAgICoKKyAgICAgKiBAcGFyYW0gbWlsbGlzZWNvbmRzCisgICAgICogICAgICAgICAgICB0aW1lIGluIG1pbGxpc2Vjb25kcworICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEZsaXBJbnRlcnZhbChpbnQgbWlsbGlzZWNvbmRzKSB7CisgICAgICAgIG1GbGlwSW50ZXJ2YWwgPSBtaWxsaXNlY29uZHM7CisgICAgfQorCisgICAgLyoqCisgICAgICogU3RhcnQgYSB0aW1lciB0byBjeWNsZSB0aHJvdWdoIGNoaWxkIHZpZXdzCisgICAgICovCisgICAgcHVibGljIHZvaWQgc3RhcnRGbGlwcGluZygpIHsKKyAgICAgICAgbVN0YXJ0ZWQgPSB0cnVlOworICAgICAgICB1cGRhdGVSdW5uaW5nKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogTm8gbW9yZSBmbGlwcworICAgICAqLworICAgIHB1YmxpYyB2b2lkIHN0b3BGbGlw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J1bm5pbmcpIHsKKyAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoRkxJUF9NU0cpOworICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoRkxJUF9NU0cpOworICAgICAgICAgICBtSGFuZGxlci5zZW5kTWVzc2FnZURlbGF5ZWQobXNnLCBtRmxpcEludGVydmFsKTsKKyAgICAgICB9CisgICAgICAgc3VwZXIuc2hvd1ByZXZpb3VzKCk7CisgICB9CisKKyAgICAvKioKKyAgICAgKiBJbnRlcm5hbCBtZXRob2QgdG8gc3RhcnQgb3Igc3RvcCBkaXNwYXRjaGluZyBmbGlwIHtAbGluayBNZXNzYWdlfSBiYXNlZAorICAgICAqIG9uIHtAbGluayAjbVJ1bm5pbmd9IGFuZCB7QGxpbmsgI21WaXNpYmxlfSBzdGF0ZS4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgdXBkYXRlUnVubmluZygpIHsKKyAgICAgICAgLy8gYnkgZGVmYXVsdCB3aGVuIHdlIHVwZGF0ZSBydW5uaW5nLCB3ZSB3YW50IHRoZQorICAgICAgICAvLyBjdXJyZW50IHZpZXcgdG8gYW5pbWF0ZSBpbgorICAgICAgICB1cGRhdGVSdW5uaW5nKHRydWUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEludGVybmFsIG1ldGhvZCB0byBzdGFydCBvciBzdG9wIGRpc3BhdGNoaW5nIGZsaXAge0BsaW5rIE1lc3NhZ2V9IGJhc2VkCisgICAgICogb24ge0BsaW5rICNtUnVubmluZ30gYW5kIHtAbGluayAjbVZpc2libGV9IHN0YXRlLgorICAgICAqCisgICAgICogQHBhcmFtIGZsaXBOb3cgRGV0ZXJtaW5lcyB3aGV0aGVyIG9yIG5vdCB0byBleGVjdXRlIHRoZSBhbmltYXRpb24gbm93LCBpbgorICAgICAqICAgICAgICAgICAgYWRkaXRpb24gdG8gcXVldWluZyBmdXR1cmUgZmxpcHMuIElmIG9taXR0ZWQsIGRlZmF1bHRzIHRvCisgICAgICogICAgICAgICAgICB0cnVlLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCB1cGRhdGVSdW5uaW5nKGJvb2xlYW4gZmxpcE5vdykgeworICAgICAgICBib29sZWFuIHJ1bm5pbmcgPSBtVmlzaWJsZSAmJiBtU3RhcnRlZCAmJiBtVXNlclByZXNlbnQgJiYgbUFkYXB0ZXIgIT0gbnVsbDsKKyAgICAgICAgaWYgKHJ1bm5pbmcgIT0gbVJ1bm5pbmcpIHsKKyAgICAgICAgICAgIGlmIChydW5uaW5nKSB7CisgICAgICAgICAgICAgICAgc2hvd09ubHkobVdoaWNoQ2hpbGQsIGZsaXBOb3cpOworICAgICAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gbUhhbmRsZXIub2J0YWluTWVzc2FnZShGTElQX01TRyk7CisgICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2VEZWxheWVkKG1zZywgbUZsaXBJbnRlcnZhbCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKEZMSVBfTVNHKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1SdW5uaW5nID0gcnVubmluZzsKKyAgICAgICAgfQorICAgICAgICBpZiAoTE9HRCkgeworICAgICAgICAgICAgTG9nLmQoVEFHLCAidXBkYXRlUnVubmluZygpIG1WaXNpYmxlPSIgKyBtVmlzaWJsZSArICIsIG1TdGFydGVkPSIgKyBtU3RhcnRlZAorICAgICAgICAgICAgICAgICAgICArICIsIG1Vc2VyUHJlc2VudD0iICsgbVVzZXJQcmVzZW50ICsgIiwgbVJ1bm5pbmc9IiArIG1SdW5uaW5nKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGUgY2hpbGQgdmlld3MgYXJlIGZsaXBwaW5nLgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGlzRmxpcHBpbmcoKSB7CisgICAgICAgIHJldHVybiBtU3RhcnRlZDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXQgaWYgdGhpcyB2aWV3IGF1dG9tYXRpY2FsbHkgY2FsbHMge0BsaW5rICNzdGFydEZsaXBwaW5nKCl9IHdoZW4gaXQKKyAgICAgKiBiZWNvbWVzIGF0dGFjaGVkIHRvIGEgd2luZG93LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEF1dG9TdGFydChib29sZWFuIGF1dG9TdGFydCkgeworICAgICAgICBtQXV0b1N0YXJ0ID0gYXV0b1N0YXJ0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGlzIHZpZXcgYXV0b21hdGljYWxseSBjYWxscyB7QGxpbmsgI3N0YXJ0RmxpcHBpbmcoKX0KKyAgICAgKiB3aGVuIGl0IGJlY29tZXMgYXR0YWNoZWQgdG8gYSB3aW5kb3cuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaXNBdXRvU3RhcnQoKSB7CisgICAgICAgIHJldHVybiBtQXV0b1N0YXJ0OworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgaW50IEZMSVBfTVNHID0gMTsKKworICAgIHByaXZhdGUgZmluYWwgSGFuZGxlciBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICAgICAgaWYgKG1zZy53aGF0ID09IEZMSVBfTVNHKSB7CisgICAgICAgICAgICAgICAgaWYgKG1SdW5uaW5nKSB7CisgICAgICAgICAgICAgICAgICAgIHNob3dOZXh0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmR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yYW5zZm9ybWF0aW9uLjwvcD4KKyAgICAgICAgICogCisgICAgICAgICAqIEBwYXJhbSBjb250ZXh0IFRoZSBjb250ZXh0IGFzc29jaWF0ZWQgd2l0aCB0aGlzIHRyYW5zZm9ybWF0aW9uLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIEN1cnNvclRyYW5zZm9ybWF0aW9uKENvbnRleHQgY29udGV4dCkgeworICAgICAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPlRyYW5zZm9ybXMgdGhlIHNwZWNpZmllZCBDdXJzb3IgY29sdW1uIGludG8gYSBTdHJpbmcuIFRoZSB0cmFuc2Zvcm1hdGlvbgorICAgICAgICAgKiBjYW4gc2ltcGx5IHJldHVybiB0aGUgY29udGVudCBvZiB0aGUgY29sdW1uIGFzIGEgU3RyaW5nICh0aGlzIGlzIGtub3duCisgICAgICAgICAqIGFzIHRoZSBpZGVudGl0eSB0cmFuc2Zvcm1hdGlvbikgb3IgbWFuaXB1bGF0ZSB0aGUgY29udGVudC4gRm9yIGluc3RhbmNlLAorICAgICAgICAgKiBhIHRyYW5zZm9ybWF0aW9uIGNhbiBwZXJmb3JtIHRleHQgc3Vic3RpdHV0aW9ucyBvciBjb25jYXRlbmF0ZSBvdGhlcgorICAgICAgICAgKiBjb2x1bW5zIHdpdGggdGhlIHNwZWNpZmllZCBjb2x1bW4uPC9wPgorICAgICAgICAgKiAKKyAgICAgICAgICogQHBhcmFtIGN1cnNvciBUaGUgY3Vyc29yIHRoYXQgY29udGFpbnMgdGhlIGRhdGEgdG8gdHJhbnNmb3JtLiAKKyAgICAgICAgICogQHBhcmFtIGNvbHVtbkluZGV4IFRoZSBpbmRleCBvZiB0aGUgY29sdW1uIHRvIHRyYW5zZm9ybS4KKyAgICAgICAgICogCisgICAgICAgICAqIEByZXR1cm4gQSBTdHJpbmcgY29udGFpbmluZyB0aGUgdHJhbnNmb3JtZWQgdmFsdWUgb2YgdGhlIGNvbHVtbi4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBhYnN0cmFjdCBTdHJpbmcgdHJhbnNmb3JtKEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCk7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPlRyYW5zZm9ybXMgdGhlIHNwZWNpZmllZCBDdXJzb3IgY29sdW1uIGludG8gYSByZXNvdXJjZSBpZGVudGlmaWVyLgorICAgICAgICAgKiBUaGUgZGVmYXVsdCBpbXBsZW1lbnRhdGlvbiBzaW1wbHkgaW50ZXJwcmV0cyB0aGUgY29udGVudCBvZiB0aGUgY29sdW1uCisgICAgICAgICAqIGFzIGFuIGludGVnZXIuPC9wPgorICAgICAgICAgKiAKKyAgICAgICAgICogQHBhcmFtIGN1cnNvciBUaGUgY3Vyc29yIHRoYXQgY29udGFpbnMgdGhlIGRhdGEgdG8gdHJhbnNmb3JtLiAKKyAgICAgICAgICogQHBhcmFtIGNvbHVtbkluZGV4IFRoZSBpbmRleCBvZiB0aGUgY29sdW1uIHRvIHRyYW5zZm9ybS4KKyAgICAgICAgICogCisgICAgICAgICAqIEByZXR1cm4gQSByZXNvdXJjZSBpZGVudGlmaWVyLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCB0cmFuc2Zvcm1Ub1Jlc291cmNlKEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgcmV0dXJuIGN1cnNvci5nZXRJbnQoY29sdW1uSW5kZXgpOworICAgICAgICB9ICAgICAgICAKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiA8cD5Mb2FkcyB0aGUge0BsaW5rIGFuZHJvaWQud2lkZ2V0LkN1cnNvckFkYXB0ZXJ9IGRlZmluZWQgaW4gdGhlIHNwZWNpZmllZAorICAgICAqIFhNTCByZXNvdXJjZS4gVGhlIGNvbnRlbnQgb2YgdGhlIGFkYXB0ZXIgaXMgbG9hZGVk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cyBpbiB0aGUgc2VsZWN0aW9uIGV4cHJlc3Npb24uCisgICAgICogCisgICAgICogQHJldHVybiBBIHtAbGluayBhbmRyb2lkLndpZGdldC5DdXJzb3JBZGFwdGVyfQorICAgICAqIAorICAgICAqIEB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIElmIHRoZSBYTUwgcmVzb3VyY2UgZG9lcyBub3QgY29udGFpbgorICAgICAqICAgICAgICAgYSB2YWxpZCAmbHQ7Y3Vyc29yLWFkYXB0ZXIgLyZndDsgZGVmaW5pdGlvbi4KKyAgICAgKiAKKyAgICAgKiBAc2VlIGFuZHJvaWQuY29udGVudC5Db250ZW50UHJvdmlkZXIKKyAgICAgKiBAc2VlIGFuZHJvaWQud2lkZ2V0LkN1cnNvckFkYXB0ZXIKKyAgICAgKiBAc2VlICNsb2FkQWRhcHRlcihhbmRyb2lkLmNvbnRlbnQuQ29udGV4dCwgaW50LCBPYmplY3RbXSkgCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBDdXJzb3JBZGFwdGVyIGxvYWRDdXJzb3JBZGFwdGVyKENvbnRleHQgY29udGV4dCwgaW50IGlkLCBTdHJpbmcgdXJpLAorICAgICAgICAgICAgT2JqZWN0Li4uIHBhcmFtZXRlcnMpIHsKKworICAgICAgICBYbWxDdXJzb3JBZGFwdGVyIGFkYXB0ZXIgPSAoWG1sQ3Vyc29yQWRhcHRlcikgbG9hZEFkYXB0ZXIoY29udGV4dCwgaWQsIEFEQVBURVJfQ1VSU09SLAorICAgICAgICAgICAgICAgIHBhcmFtZXRlcnMpOworCisgICAgICAgIGlmICh1cmkgIT0gbnVsbCkgeworICAgICAgICAgICAgYWRhcHRlci5zZXRVcmkodXJpKTsKKyAgICAgICAgfQorICAgICAgICBhZGFwdGVyLmxvYWQoKTsKKworICAgICAgICByZXR1cm4gYWRhcHRlcjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiA8cD5Mb2FkcyB0aGUge0BsaW5rIGFuZHJv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KyAgICAgICAgICAgIGlmIChsYXlvdXQgPT0gMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlRoZSBsYXlvdXQgc3BlY2lmaWVkIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiIGRvZXMgbm90IGV4aXN0Iik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGEucmVjeWNsZSgpOworCisgICAgICAgICAgICBYbWxQdWxsUGFyc2VyIHBhcnNlciA9IG1QYXJzZXI7CisgICAgICAgICAgICBpbnQgdHlwZTsKKyAgICAgICAgICAgIGludCBkZXB0aCA9IHBhcnNlci5nZXREZXB0aCgpOworCisgICAgICAgICAgICB3aGlsZSAoKCh0eXBlID0gcGFyc2VyLm5leHQoKSkgIT0gWG1sUHVsbFBhcnNlci5FTkRfVEFHIHx8IHBhcnNlci5nZXREZXB0aCgpID4gZGVwdGgpICYmCisgICAgICAgICAgICAgICAgICAgIHR5cGUgIT0gWG1sUHVsbFBhcnNlci5FTkRfRE9DVU1FTlQpIHsKKworICAgICAgICAgICAgICAgIGlmICh0eXBlICE9IFhtbFB1bGxQYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIFN0cmluZyBuYW1lID0gcGFyc2VyLmdldE5hbWUoKTsKKworICAgICAgICAgICAgICAgIGlmIChBREFQVEVSX0NVUlNPUl9CSU5ELmVxdWFscyhuYW1lKSkgeworICAgICAgICAgICAgICAgICAgICBwYXJzZUJpbmRUYWcoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEFEQVBURVJfQ1VSU09SX1NFTEVDVC5lcXVhbHMobmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcGFyc2VTZWxlY3RUYWcoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVW5rbm93biB0YWcgbmFtZSAiICsgcGFyc2VyLmdldE5hbWUoKSArICIgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3RyaW5nW10gZnJvbUFycmF5ID0gbUZyb20udG9BcnJheShuZXcgU3RyaW5nW21Gcm9tLnNpemUoKV0pOworICAgICAgICAgICAgaW50W10gdG9BcnJheSA9IG5ldyBpbnRbbVRvLnNpemUoKV07CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHRvQXJyYXkubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICB0b0FycmF5W2ldID0gbVRvLmdldChpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3RyaW5nW10gc2VsZWN0aW9uQXJncyA9IG51bGw7CisgICAgICAgICAgICBpZiAocGFyYW1ldGVycyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgc2VsZWN0aW9uQXJncyA9IG5ldyBTdHJpbmdbcGFyYW1ldGVycy5sZW5ndGhdOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc2VsZWN0aW9uQXJncy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25BcmdzW2ldID0gKFN0cmluZykgcGFyYW1ldGVyc1tpXTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBuZXcgWG1sQ3Vyc29yQWRhcHRlcihtQ29udGV4dCwgbGF5b3V0LCB1cmksIGZyb21BcnJheSwgdG9BcnJheSwgc2VsZWN0aW9uLAorICAgICAgICAgICAgICAgICAgICBzZ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pZiAoYXNUeXBlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBIGJpbmQgaXRlbSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlcy5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIiBkb2VzIG5vdCBoYXZlIGFuICdhcycgYXR0cmlidXRlIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1Gcm9tLmFkZChmcm9tTmFtZSk7CisgICAgICAgICAgICBtVG8uYWRkKHRvTmFtZSk7CisgICAgICAgICAgICBtQmluZGVycy5wdXQoZnJvbU5hbWUsIGZpbmRCaW5kZXIoYXNUeXBlKSk7CisKKyAgICAgICAgICAgIGEucmVjeWNsZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBDdXJzb3JCaW5kZXIgZmluZEJpbmRlcihTdHJpbmcgdHlwZSkgdGhyb3dzIElPRXhjZXB0aW9uLCBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIGZpbmFsIFhtbFB1bGxQYXJzZXIgcGFyc2VyID0gbVBhcnNlcjsKKyAgICAgICAgICAgIGZpbmFsIENvbnRleHQgY29udGV4dCA9IG1Db250ZXh0OworICAgICAgICAgICAgQ3Vyc29yVHJhbnNmb3JtYXRpb24gdHJhbnNmb3JtYXRpb24gPSBtSWRlbnRpdHk7CisKKyAgICAgICAgICAgIGludCB0YWdUeXBlOworICAgICAgICAgICAgaW50IGRlcHRoID0gcGFyc2VyLmdldERlcHRoKCk7CisKKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNEcmF3YWJsZSA9IEFEQVBURVJfQ1VSU09SX0FTX0RSQVdBQkxFLmVxdWFscyh0eXBlKTsgICAgICAgICAgICAKKworICAgICAgICAgICAgd2hpbGUgKCgodGFnVHlwZSA9IHBhcnNlci5uZXh0KCkpICE9IFhtbFB1bGxQYXJzZXIuRU5EX1RBRyB8fCBwYXJzZXIuZ2V0RGVwdGgoKSA+IGRlcHRoKQorICAgICAgICAgICAgICAgICAgICAmJiB0YWdUeXBlICE9IFhtbFB1bGxQYXJzZXIuRU5EX0RPQ1VNRU5UKSB7CisKKyAgICAgICAgICAgICAgICBpZiAodGFnVHlwZSAhPSBYbWxQdWxsUGFyc2VyLlNUQVJUX1RBRykgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBTdHJpbmcgbmFtZSA9IHBhcnNlci5nZXROYW1lKCk7CisKKyAgICAgICAgICAgICAgICBpZiAoQURBUFRFUl9DVVJTT1JfVFJBTlNGT1JNLmVxdWFscyhuYW1lKSkgeworICAgICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1hdGlvbiA9IGZpbmRUcmFuc2Zvcm1hdGlvbigpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoQURBUFRFUl9DVVJTT1JfTUFQLmVxdWFscyhuYW1lKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoISh0cmFuc2Zvcm1hdGlvbiBpbnN0YW5jZW9mIE1hcFRyYW5zZm9ybWF0aW9uKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNmb3JtYXRpb24gPSBuZXcgTWFwVHJhbnNmb3JtYXRpb24oY29udGV4dCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZmluZE1hcCgoKE1hcFRyYW5zZm9ybWF0aW9uKSB0cmFuc2Zvcm1hdGlvbiksIGlzRHJhd2FibGUpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJVbmtub3duIHRhZyBuYW1lICIgKyBwYXJzZXIuZ2V0TmFtZSgpICsgIiBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKEFEQVBURVJfQ1VSU09SX0FTX1NUUklORy5lcXVhbHModHlwZSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0cmluZ0JpbmRlcihjb250ZXh0LCB0cmFuc2Zvcm1hdGlvbik7CisgICAgICAgICAgICB9IGVsc2UgaWYgKEFEQVBURVJfQ1VSU09SX0FTX1RBRy5lcXVhbHModHlwZSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFRhZ0JpbmRlcihjb250ZXh0LCB0cmFuc2Zvcm1hdGlvbik7CisgICAgICAgICAgICB9IGVsc2UgaWYgKEFEQVBURVJfQ1VSU09SX0FTX0lNQUdFLmVxdWFscyh0eXBlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgSW1hZ2VCaW5kZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOyAgICAgICAgICAgIAorICAgICAgICAgICAgfSBlbHNlIGlmIChBREFQVEVSX0NVUlNPUl9BU19JTUFHRV9VUkkuZXF1YWxzKHR5cGUpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBJbWFnZVVyaUJpbmRlcihjb250ZXh0LCB0cmFuc2Zvcm1hdGlvbik7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGlzRHJhd2FibGUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IERyYXdhYmxlQmluZGVyKGNvbnRleHQsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGNyZWF0ZUJpbmRlcih0eXBlLCB0cmFuc2Zvcm1hdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIEN1cnNvckJpbmRlciBjcmVhdGVCaW5kZXIoU3RyaW5nIHR5cGUsIEN1cnNvclRyYW5zZm9ybWF0aW9uIHRyYW5zZm9ybWF0aW9uKSB7CisgICAgICAgICAgICBpZiAobUNvbnRleHQuaXNSZXN0cmljdGVkKCkpIHJldHVybiBudWxsOworCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGZpbmFsIENsYXNzPD8+IGtsYXNzID0gQ2xhc3MuZm9yTmFtZSh0eXBlLCB0cnVlLCBtQ29udGV4dC5nZXRDbGFzc0xvYWRlcigpKTsKKyAgICAgICAgICAgICAgICBpZiAoQ3Vyc29yQmluZGVyLmNsYXNzLmlzQXNzaWduYWJsZUZyb20oa2xhc3MpKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIENvbnN0cnVjdG9yPD8+IGMgPSBrbGFzcy5nZXREZWNsYXJlZENvbnN0cnVjdG9yKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbnRleHQuY2xhc3MsIEN1cnNvclRyYW5zZm9ybWF0aW9uLmNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChDdXJzb3JCaW5kZXIpIGMubmV3SW5zdGFuY2UobUNvbnRleHQsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChDbGFzc05vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgYmluZGVyIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIHR5cGUsIGUpOworICAgICAgICAgICAgfSBjYXRjaCAoTm9TdWNoTWV0aG9kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgYmluZGVyIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIHR5cGUsIGUpOworICAgICAgICAgICAgfSBjYXRjaCAoSW52b2NhdGlvblRhcmdldEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ2Fubm90IGluc3RhbmNpYXRlIGJpbmRlciB0eXBlIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICI6ICIgKyB0eXBlLCBlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEluc3RhbnRpYXRpb25FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSBiaW5kZXIgdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgdHlwZSwgZSk7CisgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQWNjZXNzRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgYmluZGVyIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIHR5cGUsIGUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBmaW5kTWFwKE1hcFRyYW5zZm9ybWF0aW9uIHRyYW5zZm9ybWF0aW9uLCBib29sZWFuIGRyYXdhYmxlKSB7CisgICAgICAgICAgICBSZXNvdXJjZXMgcmVzb3VyY2VzID0gbVJlc291cmNlczsKKworICAgICAgICAgICAgVHlwZWRBcnJheSBhID0gcmVzb3VyY2VzLm9idGFpbkF0dHJpYnV0ZXMobUF0dHJzLAorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfTWFwSXRlbSk7CisKKyAgICAgICAgICAgIFN0cmluZyBmcm9tID0gYS5nZXRTdHJpbmcoYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX01hcEl0ZW1fZnJvbVZhbHVlKTsKKyAgICAgICAgICAgIGlmIChmcm9tID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBIG1hcCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKworICAgICAgICAgICAgICAgICAgICAgICAgIiBkb2VzIG5vdCBoYXZlIGEgJ2Zyb21WYWx1ZScgYXR0cmlidXRlIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICghZHJhd2FibGUpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgdG8gPSBhLmdldFN0cmluZyhhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfTWFwSXRlbV90b1ZhbHVlKTsKKyAgICAgICAgICAgICAgICBpZiAodG8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBIG1hcCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlcy5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGRvZXMgbm90IGhhdmUgYSAndG9WYWx1ZScgYXR0cmlidXRlIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRyYW5zZm9ybWF0aW9uLmFkZFN0cmluZ01hcHBpbmcoZnJvbSwgdG8pOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpbnQgdG8gPSBhLmdldFJlc291cmNlSWQoYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX01hcEl0ZW1fdG9WYWx1ZSwgMCk7CisgICAgICAgICAgICAgICAgaWYgKHRvID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQSBtYXAgaXRlbSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBkb2VzIG5vdCBoYXZlIGEgJ3RvVmFsdWUnIGF0dHJpYnV0ZSIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0cmFuc2Zvcm1hdGlvbi5hZGRSZXNvdXJjZU1hcHBpbmcoZnJvbSwgdG8pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBhLnJlY3ljbGUoKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgQ3Vyc29yVHJhbnNmb3JtYXRpb24gZmluZFRyYW5zZm9ybWF0aW9uKCkgeworICAgICAgICAgICAgUmVzb3VyY2VzIHJlc291cmNlcyA9IG1SZXNvdXJjZXM7CisgICAgICAgICAgICBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbiA9IG51bGw7CisgICAgICAgICAgICBUeXBlZEFycmF5IGEgPSByZXNvdXJjZXMub2J0YWluQXR0cmlidXRlcyhtQXR0cnMsCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQuUi5zdHlsZWFibGUuQ3Vyc29yQWRhcHRlcl9UcmFuc2Zvcm1JdGVtKTsKKworICAgICAgICAgICAgU3RyaW5nIGNsYXNzTmFtZSA9IGEuZ2V0U3RyaW5nKGFuZHJvaWQuUi5zdHlsZWFibGUuQ3Vyc29yQWRhcHRlcl9UcmFuc2Zvcm1JdGVtX3dpdGhDbGFzcyk7CisgICAgICAgICAgICBpZiAoY2xhc3NOYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgZXhwcmVzc2lvbiA9IGEuZ2V0U3RyaW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX1RyYW5zZm9ybUl0ZW1fd2l0aEV4cHJlc3Npb24pOworICAgICAgICAgICAgICAgIHRyYW5zZm9ybWF0aW9uID0gY3JlYXRlRXhwcmVzc2lvblRyYW5zZm9ybWF0aW9uKGV4cHJlc3Npb24pOworICAgICAgICAgICAgfSBlbHNlIGlmICghbUNvbnRleHQuaXNSZXN0cmljdGVkKCkpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBDbGFzczw/PiBrbGFzID0gQ2xhc3MuZm9yTmFtZShjbGFzc05hbWUsIHRydWUsIG1Db250ZXh0LmdldENsYXNzTG9hZGVyKCkpOworICAgICAgICAgICAgICAgICAgICBpZiAoQ3Vyc29yVHJhbnNmb3JtYXRpb24uY2xhc3MuaXNBc3NpZ25hYmxlRnJvbShrbGFzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgQ29uc3RydWN0b3I8Pz4gYyA9IGtsYXMuZ2V0RGVjbGFyZWRDb25zdHJ1Y3RvcihDb250ZXh0LmNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybWF0aW9uID0gKEN1cnNvclRyYW5zZm9ybWF0aW9uKSBjLm5ld0luc3RhbmNlKG1Db250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gY2F0Y2ggKENsYXNzTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgdHJhbnNmb3JtIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIGNsYXNzTmFtZSwgZSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoTm9TdWNoTWV0aG9kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ2Fubm90IGluc3RhbmNpYXRlIHRyYW5zZm9ybSB0eXBlIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICI6ICIgKyBjbGFzc05hbWUsIGUpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludm9jYXRpb25UYXJnZXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgdHJhbnNmb3JtIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIGNsYXNzTmFtZSwgZSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW5zdGFudGlhdGlvbkV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSB0cmFuc2Zvcm0gdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgY2xhc3NOYW1lLCBlKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQWNjZXNzRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ2Fubm90IGluc3RhbmNpYXRlIHRyYW5zZm9ybSB0eXBlIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICI6ICIgKyBjbGFzc05hbWUsIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYS5yZWN5Y2xlKCk7CisKKyAgICAgICAgICAgIGlmICh0cmFuc2Zvcm1hdGlvbiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQSB0cmFuc2Zvcm0gaXRlbSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZ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QWRhcHRlciBleHRlbmRzIFNpbXBsZUN1cnNvckFkYXB0ZXIgaW1wbGVtZW50cyBNYW5hZ2VkQWRhcHRlciB7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1Vcmk7CisgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nIG1TZWxlY3Rpb247CisgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nW10gbVNlbGVjdGlvbkFyZ3M7CisgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nIG1Tb3J0T3JkZXI7CisgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nW10gbUNvbHVtbnM7CisgICAgICAgIHByaXZhdGUgZmluYWwgQ3Vyc29yQmluZGVyW10gbUJpbmRlcnM7CisgICAgICAgIHByaXZhdGUgQXN5bmNUYXNrPFZvaWQsVm9pZCxDdXJzb3I+IG1Mb2FkVGFzazsKKworICAgICAgICBYbWxDdXJzb3JBZGFwdGVyKENvbnRleHQgY29udGV4dCwgaW50IGxheW91dCwgU3RyaW5nIHVyaSwgU3RyaW5nW10gZnJvbSwgaW50W10gdG8sCisgICAgICAgICAgICAgICAgU3RyaW5nIHNlbGVjdGlvbiwgU3RyaW5nW10gc2VsZWN0aW9uQXJncywgU3RyaW5nIHNvcnRPcmRlciwKKyAgICAgICAgICAgICAgICBIYXNoTWFwPFN0cmluZywgQ3Vyc29yQmluZGVyPiBiaW5kZXJzKSB7CisKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIGxheW91dCwgbnVsbCwgZnJvbSwgdG8pOworICAgICAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OworICAgICAgICAgICAgbVVyaSA9IHVyaTsKKyAgICAgICAgICAgIG1TZWxlY3Rpb24gPSBzZWxlY3Rpb247CisgICAgICAgICAgICBtU2VsZWN0aW9uQXJncyA9IHNlbGVjdGlvbkFyZ3M7CisgICAgICAgICAgICBtU29ydE9yZGVyID0gc29ydE9yZGVyOworICAgICAgICAgICAgbUNvbHVtbnMgPSBuZXcgU3RyaW5nW2Zyb20ubGVuZ3RoICsgMV07CisgICAgICAgICAgICAvLyBUaGlzIGlzIG1hbmRhdG9yeSBpbiBDdXJzb3JBZGFwdGVyCisgICAgICAgICAgICBtQ29sdW1uc1swXSA9ICJfaWQiOworICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShmcm9tLCAwLCBtQ29sdW1ucywgMSwgZnJvbS5sZW5ndGgpOworCisgICAgICAgICAgICBDdXJzb3JCaW5kZXIgYmFzaWMgPSBuZXcgU3RyaW5nQmluZGVyKGNvbnRleHQsIG5ldyBJZGVudGl0eVRyYW5zZm9ybWF0aW9uKGNvbnRleHQpKTsKKyAgICAgICAgICAgIGZpbmFsIGludCBjb3VudCA9IGZyb20ubGVuZ3RoOworICAgICAgICAgICAgbUJpbmRlcnMgPSBuZXcgQ3Vyc29yQmluZGVyW2NvdW50XTsKKworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgQ3Vyc29yQmluZGVyIGJpbmRlciA9IGJpbmRlcnMuZ2V0KGZyb21baV0pOworICAgICAgICAgICAgICAgIGlmIChiaW5kZXIgPT0gbnVsbCkgYmluZGVyID0gYmFzaWM7CisgICAgICAgICAgICAgICAgbUJpbmRlcnNbaV0gPSBiaW5kZXI7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgYmluZFZpZXcoVmlldyB2aWV3LCBDb250ZXh0IGNvbnRleHQsIEN1cnNvciBjdXJzb3IpIHsKKyAgICAgICAgICAgIGZpbmFsIGludCBjb3VudCA9IG1Uby5sZW5ndGg7CisgICAgICAgICAgICBmaW5hbCBpbnRbXSBmcm9tID0gbUZyb207CisgICAgICAgICAgICBmaW5hbCBpbnRbXSB0byA9IG1UbzsKKyAgICAgICAgICAgIGZpbmFsIEN1cnNvckJpbmRlcltdIGJpbmRlcnMgPSBtQmluZGVyczsKKworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgZmluYWwgVmlldyB2ID0gdmlldy5maW5kVmlld0J5SWQodG9baV0pOworICAgICAgICAgICAgICAgIGlmICh2ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYmluZGVyc1tpXS5iaW5kKHYsIGN1cnNvciwgZnJvbVtpXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgbG9hZCgpIHsKKyAgICAgICAgICAgIGlmIChtVXJpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtTG9hZFRhc2sgPSBuZXcgUXVlcnlUYXNrKCkuZXhlY3V0ZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgdm9pZCBzZXRVcmkoU3RyaW5nIHVyaSkgeworICAgICAgICAgICAgbVVyaSA9IHVyaTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBjaGFuZ2VDdXJzb3IoQ3Vyc29yIGMpIHsKKyAgICAgICAgICAgIGlmIChtTG9hZFRhc2sgIT0gbnVsbCAmJiBtTG9hZFRhc2suZ2V0U3RhdHVzKCkgIT0gUXVlcnlUYXNrLlN0YXR1cy5GSU5JU0hFRCkgeworICAgICAgICAgICAgICAgIG1Mb2FkVGFzay5jYW5jZWwodHJ1ZSk7CisgICAgICAgICAgICAgICAgbUxvYWRUYXNrID0gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN1cGVyLmNoYW5nZUN1cnNvcihjKTsKKyAgICAgICAgfQorCisgICAgICAgIGNsYXNzIFF1ZXJ5VGFzayBleHRlbmRzIEFzeW5jVGFzazxWb2lkLCBWb2lkLCBDdXJzb3I+IHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHJvdGVjdGVkIEN1cnNvciBkb0luQmFja2dyb3VuZChWb2lkLi4uIHBhcmFtcykgeworICAgICAgICAgICAgICAgIGlmIChtQ29udGV4dCBpbnN0YW5jZW9mIEFjdGl2aXR5KSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAoKEFjdGl2aXR5KSBtQ29udGV4dCkubWFuYWdlZFF1ZXJ5KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVyaS5wYXJzZShtVXJpKSwgbUNvbHVtbnMsIG1TZWxlY3Rpb24sIG1TZWxlY3Rpb25BcmdzLCBtU29ydE9yZGVyKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCkucXVlcnkoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVXJpLnBhcnNlKG1VcmkpLCBtQ29sdW1ucywgbVNlbGVjdGlvbiwgbVNlbGVjdGlvbkFyZ3MsIG1Tb3J0T3JkZXIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvblBvc3RFeGVjdXRlKEN1cnNvciBjdXJzb3IpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWlzQ2FuY2VsbGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgWG1sQ3Vyc29yQWRhcHRlci5zdXBlci5jaGFuZ2VDdXJzb3IoY3Vyc29yKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBJZGVudGl0eSB0cmFuc2Zvcm1hdGlvbiwgcmV0dXJucyB0aGUgY29udGVudCBvZiB0aGUgc3BlY2lmaWVkIGNvbHVtbiBhcyBhIFN0cmluZywKKyAgICAgKiB3aXRob3V0IHBlcmZvcm1pbmcg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mluYWwgU3RyaW5nQnVpbGRlciBtQnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisKKyAgICAgICAgcHVibGljIEV4cHJlc3Npb25UcmFuc2Zvcm1hdGlvbihDb250ZXh0IGNvbnRleHQsIFN0cmluZyBleHByZXNzaW9uKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0KTsKKworICAgICAgICAgICAgcGFyc2UoZXhwcmVzc2lvbik7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgcGFyc2UoU3RyaW5nIGV4cHJlc3Npb24pIHsKKyAgICAgICAgICAgIEV4cHJlc3Npb25Ob2RlIG5vZGUgPSBtRmlyc3ROb2RlOworICAgICAgICAgICAgaW50IHNlZ21lbnRTdGFydDsKKyAgICAgICAgICAgIGludCBjb3VudCA9IGV4cHJlc3Npb24ubGVuZ3RoKCk7CisKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIGNoYXIgYyA9IGV4cHJlc3Npb24uY2hhckF0KGkpOworICAgICAgICAgICAgICAgIC8vIFN0YXJ0IGEgY29sdW1uIG5hbWUgc2VnbWVudAorICAgICAgICAgICAgICAgIHNlZ21lbnRTdGFydCA9IGk7CisgICAgICAgICAgICAgICAgaWYgKGMgPT0gJ3snKSB7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlIChpIDwgY291bnQgJiYgKGMgPSBleHByZXNzaW9uLmNoYXJBdChpKSkgIT0gJ30nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy8gV2UndmUgcmVhY2hlZCB0aGUgZW5kLCBidXQgdGhlIGV4cHJlc3Npb24gZGlkbid0IGNsb3NlCisgICAgICAgICAgICAgICAgICAgIGlmIChjICE9ICd9JykgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiVGhlIHRyYW5zZm9ybSBleHByZXNzaW9uIGNvbnRhaW5zIGEgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJub24tY2xvc2VkIGNvbHVtbiBuYW1lOiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5zdWJzdHJpbmcoc2VnbWVudFN0YXJ0ICsgMSwgaSkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG5vZGUubmV4dCA9IG5ldyBDb2x1bW5FeHByZXNzaW9uTm9kZShleHByZXNzaW9uLnN1YnN0cmluZyhzZWdtZW50U3RhcnQgKyAxLCBpKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGkgPCBjb3VudCAmJiAoYyA9IGV4cHJlc3Npb24uY2hhckF0KGkpKSAhPSAneycpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBub2RlLm5leHQgPSBuZXcgQ29uc3RhbnRFeHByZXNzaW9uTm9kZShleHByZXNzaW9uLnN1YnN0cmluZyhzZWdtZW50U3RhcnQsIGkpKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gUmV3aW5kIGlmIHdlJ3ZlIHJlYWNoZWQgYSBjb2x1bW4gZXhwcmVzc2lvbgorICAgICAgICAgICAgICAgICAgICBpZiAoYyA9PSAneycpIGktLTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUubmV4dDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgU3RyaW5nIHRyYW5zZm9ybShDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG1CdWlsZGVyOworICAgICAgICAgICAgYnVpbGRlci5kZWxldGUoMCwgYnVpbGRlci5sZW5ndGgoKSk7CisKKyAgICAgICAgICAgIEV4cHJlc3Npb25Ob2RlIG5vZGUgPSBtRmlyc3ROb2RlOworICAgICAgICAgICAgLy8gU2tpcCB0aGUgZmlyc3Qgbm9kZQorICAgICAgICAgICAgd2hpbGUgKChub2RlID0gbm9kZS5uZXh0KSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobm9kZS5hc1N0cmluZyhjdXJzb3IpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKKyAgICAgICAgfQorCisgICAgICAgIHN0YXRpYyBhYnN0cmFjdCBjbGFzcyBFeHByZXNzaW9uTm9kZSB7CisgICAgICAgICAgICBwdWJsaWMgRXhwcmVzc2lvbk5vZGUgbmV4dDsKKworICAgICAgICAgICAgcHVibGljIGFic3RyYWN0IFN0cmluZyBhc1N0cmluZyhDdXJzb3IgY3Vyc29yKTsKKyAgICAgICAgfQorCisgICAgICAgIHN0YXRpYyBjbGFzcyBDb25zdGFudEV4cHJlc3Npb25Ob2RlIGV4dGVuZHMgRXhwcmVzc2lvbk5vZGUgeworICAgICAgICAgICAgcHJpdmF0ZSBmaW5hbCBTdHJpbmcgbUNvbnN0YW50OworCisgICAgICAgICAgICBDb25zdGFudEV4cHJlc3Npb25Ob2RlKFN0cmluZyBjb25zdGFudCkgeworICAgICAgICAgICAgICAgIG1Db25zdGFudCA9IGNvbnN0YW50OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyBTdHJpbmcgYXNTdHJpbmcoQ3Vyc29yIGN1cnNvcikgeworICAgICAgICAgICAgICAgIHJldHVybiBtQ29uc3RhbnQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBzdGF0aWMgY2xhc3MgQ29sdW1uRXhwcmVzc2lvbk5vZGUgZXh0ZW5kcyBFeHByZXNzaW9uTm9kZSB7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIFN0cmluZyBtQ29sdW1uTmFtZTsKKyAgICAgICAgICAgIHByaXZhdGUgQ3Vyc29yIG1TaWduYXR1cmU7CisgICAgICAgICAgICBwcml2YXRlIGludCBtQ29sdW1uSW5kZXggPSAtMTsKKworICAgICAgICAgICAgQ29sdW1uRXhwcmVzc2lvbk5vZGUoU3RyaW5nIGNvbHVtbk5hbWUpIHsKKyAgICAgICAgICAgICAgICBtQ29sdW1uTmFtZSA9IGNvbHVtbk5hbWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIFN0cmluZyBhc1N0cmluZyhDdXJzb3IgY3Vyc29yKSB7CisgICAgICAgICAgICAgICAgaWYgKGN1cnNvciAhPSBtU2lnbmF0dXJlIHx8IG1Db2x1bW5JbmRleCA9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICBtQ29sdW1uSW5kZXggPSBjdXJzb3IuZ2V0Q29sdW1uSW5kZXgobUNvbHVtbk5hbWUpOworICAgICAgICAgICAgICAgICAgICBtU2lnbmF0dXJlID0gY3Vyc29yOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHJldHVybiBjdXJzb3IuZ2V0U3RyaW5nKG1Db2x1bW5JbmRleCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBIG1hcCB0cmFuc2Zvcm1hdGlvbiBvZmZlcnMgYSBzaW1wbGUgbWFwcGluZyBiZXR3ZWVuIHNwZWNpZmllZCBTdHJpbmcgdmFsdWVzCisgICAgICogdG8gU3RyaW5ncyBvciBpbnRlZ2Vycy4KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBNYXBUcmF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ncy5nZXQodmFsdWUpOworICAgICAgICAgICAgcmV0dXJuIHRyYW5zZm9ybWVkID09IG51bGwgPyB2YWx1ZSA6IHRyYW5zZm9ybWVkOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBpbnQgdHJhbnNmb3JtVG9SZXNvdXJjZShDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyB2YWx1ZSA9IGN1cnNvci5nZXRTdHJpbmcoY29sdW1uSW5kZXgpOworICAgICAgICAgICAgZmluYWwgSW50ZWdlciB0cmFuc2Zvcm1lZCA9IG1SZXNvdXJjZU1hcHBpbmdzLmdldCh2YWx1ZSk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cmFuc2Zvcm1lZCA9PSBudWxsID8gSW50ZWdlci5wYXJzZUludCh2YWx1ZSkgOiB0cmFuc2Zvcm1lZDsKKyAgICAgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBCaW5kcyBhIFN0cmluZyB0byBhIFRleHRWaWV3LgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIFN0cmluZ0JpbmRlciBleHRlbmRzIEN1cnNvckJpbmRlciB7CisgICAgICAgIHB1YmxpYyBTdHJpbmdCaW5kZXIoQ29udGV4dCBjb250ZXh0LCBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbikgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGJpbmQoVmlldyB2aWV3LCBDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGlmICh2aWV3IGluc3RhbmNlb2YgVGV4dFZpZXcpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgdGV4dCA9IG1UcmFuc2Zvcm1hdGlvbi50cmFuc2Zvcm0oY3Vyc29yLCBjb2x1bW5JbmRleCk7CisgICAgICAgICAgICAgICAgKChUZXh0Vmlldykgdmlldykuc2V0VGV4dCh0ZXh0KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEJpbmRzIGFuIGltYWdlIGJsb2IgdG8gYW4gSW1hZ2VWaWV3LgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIEltYWdlQmluZGVyIGV4dGVuZHMgQ3Vyc29yQmluZGVyIHsKKyAgICAgICAgcHVibGljIEltYWdlQmluZGVyKENvbnRleHQgY29udGV4dCwgQ3Vyc29yVHJhbnNmb3JtYXRpb24gdHJhbnNmb3JtYXRpb24pIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBiaW5kKFZpZXcgdmlldywgQ3Vyc29yIGN1cnNvciwgaW50IGNvbHVtbkluZGV4KSB7CisgICAgICAgICAgICBpZiAodmlldyBpbnN0YW5jZW9mIEltYWdlVmlldykgeworICAgICAgICAgICAgICAgIGZpbmFsIGJ5dGVbXSBkYXRhID0gY3Vyc29yLmdldEJsb2IoY29sdW1uSW5kZXgpOworICAgICAgICAgICAgICAgICgoSW1hZ2VWaWV3KSB2aWV3KS5zZXRJbWFnZUJpdG1hcChCaXRtYXBGYWN0b3J5LmRlY29kZUJ5dGVBcnJheShkYXRhLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5sZW5ndGgpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIFRhZ0JpbmRlciBleHRlbmRzIEN1cnNvckJpbmRlciB7CisgICAgICAgIHB1YmxpYyBUYWdCaW5kZXIoQ29udGV4dCBjb250ZXh0LCBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbikgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGJpbmQoVmlldyB2aWV3LCBDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyB0ZXh0ID0gbVRyYW5zZm9ybWF0aW9uLnRyYW5zZm9ybShjdXJzb3IsIGNvbHVtbkluZGV4KTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGFnKHRleHQpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBCaW5kcyBhbiBpbWFnZSBVUkkgdG8gYW4gSW1hZ2VWaWV3LgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIEltYWdlVXJpQmluZGVyIGV4dGVuZHMgQ3Vyc29yQmluZGVyIHsKKyAgICAgICAgcHVibGljIEltYWdlVXJpQmluZGVyKENvbnRleHQgY29udGV4dCwgQ3Vyc29yVHJhbnNmb3JtYXRpb24gdHJhbnNmb3JtYXRpb24pIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBiaW5kKFZpZXcgdmlldywgQ3Vyc29yIGN1cnNvciwgaW50IGNvbHVtbkluZGV4KSB7CisgICAgICAgICAgICBpZiAodmlldyBpbnN0YW5jZW9mIEltYWdlVmlldykgeworICAgICAgICAgICAgICAgICgoSW1hZ2VWaWV3KSB2aWV3KS5zZXRJbWFnZVVSSShVcmkucGFyc2UoCisgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNmb3JtYXRpb24udHJhbnNmb3JtKGN1cnNvciwgY29sdW1uSW5kZXgpKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBCaW5kcyBhIGRyYXdhYmxlIHJlc291cmNlIGlkZW50aWZpZXIgdG8gYW4gSW1hZ2VWaWV3LgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIERyYXdhYmxlQmluZGVyIGV4dGVuZHMgQ3Vyc29yQmluZGVyIHsKKyAgICAgICAgcHVibGljIERyYXdhYmxlQmluZGVyKENvbnRleHQgY29udGV4dCwgQ3Vyc29yVHJhbnNmb3JtYXRpb24gdHJhbnNmb3JtYXRpb24pIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBiaW5kKFZpZXcgdmlldywgQ3Vyc29yIGN1cnNvciwgaW50IGNvbHVtbkluZGV4KSB7CisgICAgICAgICAgICBpZiAodmlldyBpbnN0YW5jZW9mIEltYWdlVmlldykgeworICAgICAgICAgICAgICAgIGZpbmFsIGludCByZXNvdXJjZSA9IG1UcmFuc2Zvcm1hdGlvbi50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k9NUFRfQkVMT1cpOwogCiAgICAgICAgIFR5cGVkQXJyYXkgYSA9CiAgICAgICAgICAgICBjb250ZXh0Lm9idGFpblN0eWxlZEF0dHJpYnV0ZXMoCkBAIC0xNjksMTQgKzE0MSwxMSBAQAogICAgICAgICBtVGhyZXNob2xkID0gYS5nZXRJbnQoCiAgICAgICAgICAgICAgICAgUi5zdHlsZWFibGUuQXV0b0NvbXBsZXRlVGV4dFZpZXdfY29tcGxldGlvblRocmVzaG9sZCwgMik7CiAKLSAgICAgICAgbUhpbnRUZXh0ID0gYS5nZXRUZXh0KFIuc3R5bGVhYmxlLkF1dG9Db21wbGV0ZVRleHRWaWV3X2NvbXBsZXRpb25IaW50KTsKLQotICAgICAgICBtRHJvcERvd25MaXN0SGlnaGxpZ2h0ID0gYS5nZXREcmF3YWJsZSgKLSAgICAgICAgICAgICAgICBSLnN0eWxlYWJsZS5BdXRvQ29tcGxldGVUZXh0Vmlld19kcm9wRG93blNlbGVjdG9yKTsKLSAgICAgICAgbURyb3BEb3duVmVydGljYWxPZmZzZXQgPSAoaW50KQotICAgICAgICAgICAgICAgIGEuZ2V0RGltZW5zaW9uKFIuc3R5bGVhYmxlLkF1dG9Db21wbGV0ZVRleHRWaWV3X2Ryb3BEb3duVmVydGljYWxPZmZzZXQsIDAuMGYpOwotICAgICAgICBtRHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0ID0gKGludCkKLSAgICAgICAgICAgICAgICBhLmdldERpbWVuc2lvbihSLnN0eWxlYWJsZS5BdXRvQ29tcGxldGVUZXh0Vmlld19kcm9wRG93bkhvcml6b250YWxPZmZzZXQsIDAuMGYpOworICAgICAgICBtUG9wdXAuc2V0TGlzdFNlbGVjdG9yKGEuZ2V0RHJhd2FibGUoUi5zdHlsZWFibGUuQXV0b0NvbXBsZXRlVGV4dFZpZXdfZHJvcERvd25TZWxlY3RvcikpOworICAgICAgICBtUG9wdXAuc2V0VmVydGljYWxPZmZzZXQoKGludCkKKyAgICAgICAgICAgIC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vbihSLnN0eWxlYWJsZS5BdXRvQ29tcGxldGVUZXh0Vmlld19kcm9wRG93bkhlaWdodCwKLSAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCk7CisgICAgICAgIG1Qb3B1cC5zZXRXaWR0aChhLmdldExheW91dERpbWVuc2lvbigKKyAgICAgICAgICAgICAgICBSLnN0eWxlYWJsZS5BdXRvQ29tcGxldGVUZXh0Vmlld19kcm9wRG93bldpZHRoLAorICAgICAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKSk7CisgICAgICAgIG1Qb3B1cC5zZXRIZWlnaHQoYS5nZXRMYXlvdXREaW1lbnNpb24oCisgICAgICAgICAgICAgICAgUi5zdHlsZWFibGUuQXV0b0NvbXBsZXRlVGV4dFZpZXdfZHJvcERvd25IZWlnaHQsCisgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpKTsKIAogICAgICAgICBtSGludFJlc291cmNlID0gYS5nZXRSZXNvdXJjZUlkKFIuc3R5bGVhYmxlLkF1dG9Db21wbGV0ZVRleHRWaWV3X2NvbXBsZXRpb25IaW50VmlldywKICAgICAgICAgICAgICAgICBSLmxheW91dC5zaW1wbGVfZHJvcGRvd25faGludCk7CisgICAgICAgIAorICAgICAgICBtUG9wdXAuc2V0T25JdGVtQ2xpY2tMaXN0ZW5lcihuZXcgRHJvcERvd25JdGVtQ2xpY2tMaXN0ZW5lcigpKTsKKyAgICAgICAgc2V0Q29tcGxldGlvbkhpbnQoYS5nZXRUZXh0KFIuc3R5bGVhYmxlLkF1dG9Db21wbGV0ZVRleHRWaWV3X2NvbXBsZXRpb25IaW50KSk7CiAKICAgICAgICAgLy8gQWx3YXlzIHR1cm4gb24gdGhlIGF1dG8gY29tcGxldGUgaW5wdXQgdHlwZSBmbGFnLCBzaW5jZSBpdAogICAgICAgICAvLyBtYWtlcyBubyBzZW5zZSB0byB1c2UgdGhpcyB3aWRnZXQgd2l0aG91dCBpdC4KQEAgLTI0MSw2ICsyMTUsMjAgQEAKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXRDb21wbGV0aW9uSGludChDaGFyU2VxdWVuY2UgaGludCkgewogICAgICAgICBtSGludFRleHQgPSBoaW50OworICAgICAgICBpZiAoaGludCAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAobUhpbnRWaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBUZXh0VmlldyBoaW50VmlldyA9IChUZXh0VmlldykgTGF5b3V0SW5mbGF0ZXIuZnJvbShnZXRDb250ZXh0KCkpLmluZmxhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICBtSGludFJlc291cmNlLCBudWxsKS5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC50ZXh0MSk7CisgICAgICAgICAgICAgICAgaGludFZpZXcuc2V0VGV4dChtSGludFRleHQpOworICAgICAgICAgICAgICAgIG1IaW50VmlldyA9IGhpbnRWaWV3OworICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRQcm9tcHRWaWV3KGhpbnRWaWV3KTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUhpbnRWaWV3LnNldFRleHQoaGludCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtUG9wdXAuc2V0UHJvbXB0VmlldyhudWxsKTsKKyAgICAgICAgICAgIG1IaW50VmlldyA9IG51bGw7CisgICAgICAgIH0KICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0yNTMsNyArMjQxLDcgQEAKICAgICAgKiBAYXR0ciByZWYgYW5kcm9pZC5SLnN0eWxlYWJsZSNBdXRvQ29tcGxldGVUZXh0Vmlld19kcm9wRG93bldpZHRoCiAgICAgICovCiAgICAgcHVibGljIGludCBnZXREcm9wRG93bldpZHRoKCkg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ZXREcm9wRG93bkFuY2hvcihpbnQgaWQpIHsKICAgICAgICAgbURyb3BEb3duQW5jaG9ySWQgPSBpZDsKLSAgICAgICAgbURyb3BEb3duQW5jaG9yVmlldyA9IG51bGw7CisgICAgICAgIG1Qb3B1cC5zZXRBbmNob3JWaWV3KG51bGwpOwogICAgIH0KICAgICAKICAgICAvKioKQEAgLTM2MSw3ICszNDksNyBAQAogICAgICAqIEBwYXJhbSBvZmZzZXQgdGhlIHZlcnRpY2FsIG9mZnNldAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldERyb3BEb3duVmVydGljYWxPZmZzZXQoaW50IG9mZnNldCkgewotICAgICAgICBtRHJvcERvd25WZXJ0aWNhbE9mZnNldCA9IG9mZnNldDsKKyAgICAgICAgbVBvcHVwLnNldFZlcnRpY2FsT2Zmc2V0KG9mZnNldCk7CiAgICAgfQogICAgIAogICAgIC8qKgpAQCAtMzcwLDcgKzM1OCw3IEBACiAgICAgICogQHJldHVybiB0aGUgdmVydGljYWwgb2Zmc2V0CiAgICAgICovCiAgICAgcHVibGljIGludCBnZXREcm9wRG93blZlcnRpY2FsT2Zmc2V0KCkgewotICAgICAgICByZXR1cm4gbURyb3BEb3duVmVydGljYWxPZmZzZXQ7CisgICAgICAgIHJldHVybiBtUG9wdXAuZ2V0VmVydGljYWxPZmZzZXQoKTsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0zNzksNyArMzY3LDcgQEAKICAgICAgKiBAcGFyYW0gb2Zmc2V0IHRoZSBob3Jpem9udGFsIG9mZnNldAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldERyb3BEb3duSG9yaXpvbnRhbE9mZnNldChpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIG1Ecm9wRG93bkhvcml6b250YWxPZmZzZXQgPSBvZmZzZXQ7CisgICAgICAgIG1Qb3B1cC5zZXRIb3Jpem9udGFsT2Zmc2V0KG9mZnNldCk7CiAgICAgfQogICAgIAogICAgIC8qKgpAQCAtM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2V5Q29kZSwgZXZlbnQpOwotICAgICAgICAgICAgaWYgKGNvbnN1bWVkKSB7Ci0gICAgICAgICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBsaXN0IGFjY2VwdHMgdGhlIGtleSBldmVudHMgYW5kIHRoZSBrZXkgZXZlbnQKLSAgICAgICAgICAgICAgICAgICAgLy8gd2FzIGEgY2xpY2ssIHRoZSB0ZXh0IHZpZXcgZ2V0cyB0aGUgc2VsZWN0ZWQgaXRlbQotICAgICAgICAgICAgICAgICAgICAvLyBmcm9tIHRoZSBkcm9wIGRvd24gYXMgaXRzIGNvbnRlbnQKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSOgotICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBwZXJmb3JtQ29tcGxldGlvbigpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICBib29sZWFuIGNvbnN1bWVkID0gbVBvcHVwLm9uS2V5VXAoa2V5Q29kZSwgZXZlbnQpOworICAgICAgICBpZiAoY29uc3VtZWQpIHsKKyAgICAgICAgICAgIHN3aXRjaCAoa2V5Q29kZSkgeworICAgICAgICAgICAgLy8gaWYgdGhlIGxpc3QgYWNjZXB0cyB0aGUga2V5IGV2ZW50cyBhbmQgdGhlIGtleSBldmVudAorICAgICAgICAgICAgLy8gd2FzIGEgY2xpY2ssIHRoZSB0ZXh0IHZpZXcgZ2V0cyB0aGUgc2VsZWN0ZWQgaXRlbQorICAgICAgICAgICAgLy8gZnJvbSB0aGUgZHJvcCBkb3duIGFzIGl0cyBjb250ZW50CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRU5URVI6CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVI6CisgICAgICAgICAgICAgICAgcGVyZm9ybUNvbXBsZXRpb24oKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gc3VwZXIub25LZXlVcChrZXlDb2RlLCBldmVudCk7CkBAIC02NTUsODcgKzYzOSwxMSBAQAogCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gb25LZXlEb3duKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgewotICAgICAgICAvLyB3aGVuIHRoZSBkcm9wIGRvd24gaXMgc2hvd24sIHdlIGRyaXZlIGl0IGRpcmVjdGx5Ci0gICAgICAgIGlmIChpc1BvcHVwU2hvd2luZygpKSB7Ci0gICAgICAgICAgICAvLyB0aGUga2V5IGV2ZW50cyBhcmUgZm9yd2FyZGVkIHRvIHRoZSBsaXN0IGluIHRoZSBkcm9wIGRvd24gdmlldwotICAgICAgICAgICAgLy8gbm90ZSB0aGF0IExpc3RWaWV3IGhhbmRsZXMgc3BhY2UgYnV0IHdlIGRvbid0IHdhbnQgdGhhdCB0byBoYXBwZW4KLSAgICAgICAgICAgIC8vIGFsc28gaWYgc2VsZWN0aW9uIGlzIG5vdCBjdXJyZW50bHkgaW4gdGhlIGRyb3AgZG93biwgdGhlbiBkb24ndAotICAgICAgICAgICAgLy8gbGV0IGNlbnRlciBvciBlbnRlciBwcmVzc2VzIGdvIHRoZXJlIHNpbmNlIHRoYXQgd291bGQgY2F1c2UgaXQKLSAgICAgICAgICAgIC8vIHRvIHNlbGVjdCBvbmUgb2YgaXRzIGl0ZW1zCi0gICAgICAgICAgICBpZiAoa2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX1NQQUNFCi0gICAgICAgICAgICAgICAgICAgICYmIChtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCkgPj0gMAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfRU5URVIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUikpKSB7Ci0gICAgICAgICAgICAgICAgaW50IGN1ckluZGV4ID0gbURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpOwotICAgICAgICAgICAgICAgIGJvb2xlYW4gY29uc3VtZWQ7Ci0KLSAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGJlbG93ID0gIW1Qb3B1cC5pc0Fib3ZlQW5jaG9yKCk7Ci0KLSAgICAgICAgICAgICAgICBmaW5hbCBMaXN0QWRhcHRlciBhZGFwdGVyID0gbUFkYXB0ZXI7Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgYm9vbGVhbiBhbGxFbmFibGVkOwotICAgICAgICAgICAgICAgIGludCBmaXJzdEl0ZW0gPSBJbnRlZ2VyLk1BWF9WQUxVRTsKLSAgICAgICAgICAgICAgICBpbnQgbGFzdEl0ZW0gPSBJbnRlZ2VyLk1JTl9WQUxVRTsKLQotICAgICAgICAgICAgICAgIGlmIChhZGFwdGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgYWxsRW5hYmxlZCA9IGFkYXB0ZXIuYXJlQWxsSXRlbXNFbmFibGVkKCk7Ci0gICAgICAgICAgICAgICAgICAgIGZpcnN0SXRlbSA9IGFsbEVuYWJsZWQgPyAwIDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0Lmxvb2tGb3JTZWxlY3RhYmxlUG9zaXRpb24oMCwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgIGxhc3RJdGVtID0gYWxsRW5hYmxlZCA/IGFkYXB0ZXIuZ2V0Q291bnQoKSAtIDEgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3QubG9va0ZvclNlbGVjdGFibGVQb3NpdGlvbihhZGFwdGVyLmdldENvdW50KCkgLSAxLCBmYWxzZSk7ICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgaWYgKChiZWxvdyAmJiBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCAmJiBjdXJJbmRleCA8PSBmaXJzdEl0ZW0pIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAoIWJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0RPV04gJiYgY3VySW5kZXggPj0gbGFzdEl0ZW0pKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gdGhlIHNlbGVjdGlvbiBpcyBhdCB0aGUgdG9wLCB3ZSBibG9jayB0aGUga2V5Ci0gICAgICAgICAgICAgICAgICAgIC8vIGV2ZW50IHRvIHByZXZlbnQgZm9jdXMgZnJvbSBtb3ZpbmcuCi0gICAgICAgICAgICAgICAgICAgIGNsZWFyTGlzdFNlbGVjdGlvbigpOwotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9ORUVERUQpOwotICAgICAgICAgICAgICAgICAgICBzaG93RHJvcERvd24oKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gV0FSTklORzogUGxlYXNlIHJlYWQgdGhlIGNvbW1lbnQgd2hlcmUgbUxpc3RTZWxlY3Rpb25IaWRkZW4KLSAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgaXMgZGVjbGFyZWQKLSAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duTGlzdC5tTGlzdFNlbGVjdGlvbkhpZGRlbiA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGNvbnN1bWVkID0gbURyb3BEb3duTGlzdC5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpOwotICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiS2V5IGRvd246IGNvZGU9IiArIGtleUNvZGUgKyAiIGxpc3QgY29uc3VtZWQ9IiArIGNvbnN1bWVkKTsKLQotICAgICAgICAgICAgICAgIGlmIChjb25zdW1lZCkgewotICAgICAgICAgICAgICAgICAgICAvLyBJZiBpdCBoYW5kbGVkIHRoZSBrZXkgZXZlbnQsIHRoZW4gdGhlIHVzZXIgaXMKLSAgICAgICAgICAgICAgICAgICAgLy8gbmF2aWdhdGluZyBpbiB0aGUgbGlzdCwgc28gd2Ugc2hvdWxkIHB1dCBpdCBpbiBmcm9udC4KLSAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldElucHV0TWV0aG9kTW9kZShQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTk9UX05FRURFRCk7Ci0gICAgICAgICAgICAgICAgICAgIC8vIEhlcmUncyBhIGxpdHRsZSB0cmljayB3ZSBuZWVkIHRvIGRvIHRvIG1ha2Ugc3VyZSB0aGF0Ci0gICAgICAgICAgICAgICAgICAgIC8vIHRoZSBsaXN0IHZpZXcgaXMgYWN0dWFsbHkgc2hvd2luZyBpdHMgZm9jdXMgaW5kaWNhdG9yLAotICAgICAgICAgICAgICAgICAgICAvLyBieSBlbnN1cmluZyBpdCBoYXMgZm9jdXMgYW5kIGdldHRpbmcgaXRzIHdpbmRvdyBvdXQKLSAgICAgICAgICAgICAgICAgICAgLy8gb2YgdG91Y2ggbW9kZS4KLSAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duTGlzdC5yZXF1ZXN0Rm9jdXNGcm9tVG91Y2goKTsKLSAgICAgICAgICAgICAgICAgICAgc2hvd0Ryb3BEb3duKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBhdm9pZCBwYXNzaW5nIHRoZSBmb2N1cyBmcm9tIHRoZSB0ZXh0IHZpZXcgdG8gdGhlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBuZXh0IGNvbXBvbmVudAotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSOgotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfQ0VOVEVSOgotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTjoKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0RPV04pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gdGhlIHNlbGVjdGlvbiBpcyBhdCB0aGUgYm90dG9tLCB3ZSBibG9jayB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGV2ZW50IHRvIGF2b2lkIGdvaW5nIHRvIHRoZSBuZXh0IGZvY3VzYWJsZSB3aWRnZXQKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJJbmRleCA9PSBsYXN0SXRlbSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFiZWxvdyAmJiBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1ckluZGV4ID09IGZpcnN0SXRlbSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7CisgICAgICAgIGlmIChtUG9wdXAub25LZXlEb3duKGtleUNvZGUsIGV2ZW50KSkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmICghaXNQb3B1cFNob3dpbmcoKSkgewogICAgICAgICAgICAgc3dpdGNoKGtleUNvZGUpIHsKICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0RPV046CiAgICAgICAgICAgICAgICAgcGVyZm9ybVZhbGlkYXRpb24oKTsKQEAgLTc0Niw3ICs2NTQsNyBAQAogICAgICAgICBib29sZWFuIGhhbmRsZWQgPSBzdXBlci5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpOwogICAgICAgICBtTGFzdEtleUNvZGUgPSBLZXlFdmVudC5LRVlDT0RFX1VOS05PV047CiAKLSAgICAgICAgaWYgKGhhbmRsZWQgJiYgaXNQb3B1cFNob3dpbmcoKSAmJiBtRHJvcERvd25MaXN0ICE9IG51bGwpIHsKKyAgICAgICAgaWYgKGhhbmRsZWQgJiYgaXNQb3B1cFNob3dpbmcoKSkgewogICAgICAgICAgICAgY2xlYXJMaXN0U2VsZWN0aW9uKCk7CiAgICAgICAgIH0KIApAQCAtODA3LDExICs3MTUsMTIgQEAKICAgICAgICAgaWYgKGVub3VnaFRvRmlsdGVyKCkpIHsKICAgICAgICAgICAgIGlmIChtRmlsdGVyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBwZXJmb3JtRmlsdGVy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3NpdGlvbigpOwogICAgIH0KIAogICAgIC8qKgpAQCAtOTE0LDEzICs4MTAsNyBAQAogICAgICAgICAgICAgcmVwbGFjZVRleHQoY29tcGxldGlvbi5nZXRUZXh0KCkpOwogICAgICAgICAgICAgbUJsb2NrQ29tcGxldGlvbiA9IGZhbHNlOwogCi0gICAgICAgICAgICBpZiAobUl0ZW1DbGlja0xpc3RlbmVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBEcm9wRG93bkxpc3RWaWV3IGxpc3QgPSBtRHJvcERvd25MaXN0OwotICAgICAgICAgICAgICAgIC8vIE5vdGUgdGhhdCB3ZSBkb24ndCBoYXZlIGEgVmlldyBoZXJlLCBzbyB3ZSB3aWxsIG5lZWQgdG8KLSAgICAgICAgICAgICAgICAvLyBzdXBwbHkgbnVsbC4gIEhvcGVmdWxseSBubyBleGlzdGluZyBhcHBzIGNyYXNoLi4uCi0gICAgICAgICAgICAgICAgbUl0ZW1DbGlja0xpc3RlbmVyLm9uSXRlbUNsaWNrKGxpc3QsIG51bGwsIGNvbXBsZXRpb24uZ2V0UG9zaXRpb24oKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRpb24uZ2V0SWQoKSk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBtUG9wdXAucGVyZm9ybUl0ZW1DbGljayhjb21wbGV0aW9uLmdldFBvc2l0aW9uKCkpOwogICAgICAgICB9CiAgICAgfQogCkBAIC05MjgsNyArODE4LDcgQEAKICAgICAgICAgaWYgKGlzUG9wdXBTaG93aW5nKCkpIHsKICAgICAgICAgICAgIE9iamVjdCBzZWxlY3RlZEl0ZW07CiAgICAgICAgICAgICBpZiAocG9zaXRpb24gPCAwKSB7Ci0gICAgICAgICAgICAgICAgc2VsZWN0ZWRJdGVtID0gbURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW0oKTsKKyAgICAgICAgICAgICAgICBzZWxlY3RlZEl0ZW0gPSBtUG9wdXAuZ2V0U2VsZWN0ZWRJdGVtKCk7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIHNlbGVjdGVkSXRlbSA9IG1BZGFwdGVyLmdldEl0ZW0ocG9zaXRpb24pOwogICAgICAgICAgICAgfQpAQCAtOTQyLDE4ICs4MzIsMTggQEAKICAgICAgICAgICAgIG1CbG9ja0NvbXBsZXRpb24gPSBmYWxzZTsgICAgICAgICAgICAKIAogICAgICAgICAgICAgaWYgKG1JdGVtQ2xpY2tMaXN0ZW5lciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgRHJvcERvd25MaXN0VmlldyBsaXN0ID0gbURyb3BEb3duTGlzdDsKKyAgICAgICAgICAgICAgICBmaW5hbCBMaXN0UG9wdXBXaW5kb3cgbGlzdCA9IG1Qb3B1cDsKIAogICAgICAgICAgICAgICAgIGlmIChzZWxlY3RlZFZpZXcgPT0gbnVsbCB8fCBwb3NpdGlvbiA8IDApIHsKICAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRWaWV3ID0gbGlzdC5nZXRTZWxlY3RlZFZpZXcoKTsKICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBsaXN0LmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCk7CiAgICAgICAgICAgICAgICAgICAgIGlkID0gbGlzdC5nZXRTZWxlY3RlZEl0ZW1JZCgpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtSXRlbUNsaWNrTGlzdGVuZXIub25JdGVtQ2xpY2sobGlzdCwgc2VsZWN0ZWRWaWV3LCBwb3NpdGlvbiwgaWQpOworICAgICAgICAgICAgICAgIG1JdGVtQ2xpY2tMaXN0ZW5lci5vbkl0ZW1DbGljayhsaXN0LmdldExpc3RWaWV3KCksIHNlbGVjdGVkVmlldywgcG9zaXRpb24sIGlkKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCi0gICAgICAgIGlmIChtRHJvcERvd25EaXNtaXNzZWRPbkNvbXBsZXRpb24gJiYgIW1Ecm9wRG93bkFsd2F5c1Zpc2libGUpIHsKKyAgICAgICAgaWYgKG1Ecm9wRG93bkRpc21pc3NlZE9uQ29tcGxldGlvbiAmJiAhbVBvcHVwLmlzRHJvcERvd25BbHdheXNWaXNpYmxlKCkpIHsKICAgICAgICAgICAgIGRpc21pc3NEcm9wRG93bigpOwogICAgICAgICB9CiAgICAgfQpAQCAtMTAwMyw3ICs4OTMsNiBAQAogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCiAgICAgcHVibGljIHZvaWQgb25GaWx0ZXJDb21wbGV0ZShpbnQgY291bnQpIHsKICAgICAgICAgdXBkYXRlRHJvcERvd25Gb3JGaWx0ZXIoY291bnQpOwotCiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZURyb3BEb3duRm9yRmlsdGVyKGludCBjb3VudCkgewpAQCAtMTAxNywxMSArOTA2LDEyIEBACiAgICAgICAgICAqIHRvIGZpbHRlci4KICAgICAgICAgICovCiAKLSAgICAgICAgaWYgKChjb3VudCA+IDAgfHwgbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgJiYgZW5vdWdoVG9GaWx0ZXIoKSkgeworICAgICAgICBmaW5hbCBib29sZWFuIGRyb3BEb3duQWx3YXlzVmlzaWJsZSA9IG1Qb3B1cC5pc0Ryb3BEb3duQWx3YXlzVmlzaWJsZSgpOworICAgICAgICBpZiAoKGNvdW50ID4gMCB8fCBkcm9wRG93bkFsd2F5c1Zpc2libGUpICYmIGVub3VnaFRvRmlsdGVyKCkpIHsKICAgICAgICAgICAgIGlmIChoYXNGb2N1cygpICYmIGhhc1dpbmRvd0ZvY3VzKCkpIHsKICAgICAgICAgICAgICAgICBzaG93RHJvcERvd24oKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmICghbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgeworICAgICAgICB9IGVsc2UgaWYgKCFkcm9wRG93bkFsd2F5c1Zpc2libGUpIHsKICAgICAgICAgICAgIGRpc21pc3NEcm9wRG93bigpOwogICAgICAgICB9CiAgICAgfQpAQCAtMTAyOSw3ICs5MTksNyBAQAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyB2b2lkIG9uV2luZG93Rm9jdXNDaGFuZ2VkKGJvb2xlYW4gaGFzV2luZG93Rm9jdXMpIHsKICAgICAgICAgc3VwZXIub25XaW5kb3dGb2N1c0NoYW5nZWQoaGFzV2luZG93Rm9jdXMpOwotICAgICAgICBpZiAoIWhhc1dpbmRvd0ZvY3VzICYmICFtRHJvcERvd25BbHdheXNWaXNpYmxlKSB7CisgICAgICAgIGlmICghaGFzV2luZG93Rm9jdXMgJiYgIW1Qb3B1cC5pc0Ryb3BEb3duQWx3YXlzVmlzaWJsZSgpKSB7CiAgICAgICAgICAgICBkaXNtaXNzRHJvcERvd24oKTsKICAgICAgICAgfQogICAgIH0KQEAgLTEwMzksNyArOTI5LDcgQEAKICAgICAgICAgc3VwZXIub25EaXNwbGF5SGludChoaW50KTsKICAgICAgICAgc3dpdGNoIChoaW50KSB7CiAgICAgICAgICAgICBjYXNlIElOVklTSUJMRToKLSAgICAgICAgICAgICAgICBpZiAoIW1Ecm9wRG93bkFsd2F5c1Zpc2libGUpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW1Qb3B1cC5pc0Ryb3BEb3duQWx3YXlzVmlzaWJsZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgIGRpc21pc3NEcm9wRG93bigpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTEwNTMsNyArOTQzLDcgQEAKICAgICAgICAgaWYgKCFmb2N1c2VkKSB7CiAgICAgICAgICAgICBwZXJmb3JtVmFsaWRhdGlvbigpOwogICAgICAgICB9Ci0gICAgICAgIGlmICghZm9jdXNlZCAmJiAhbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgeworICAgICAgICBpZiAoIWZvY3VzZWQgJiYgIW1Qb3B1cC5p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KCkuZ2V0V2lkdGgoKTsKKyAgICAgICAgaWYgKG1Qb3B1cC5nZXRBbmNob3JWaWV3KCkgPT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKG1Ecm9wRG93bkFuY2hvcklkICE9IFZpZXcuTk9fSUQpIHsKKyAgICAgICAgICAgICAgICBtUG9wdXAuc2V0QW5jaG9yVmlldyhnZXRSb290VmlldygpLmZpbmRWaWV3QnlJZChtRHJvcERvd25BbmNob3JJZCkpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB3aWR0aFNwZWMgPSBtRHJvcERvd25XaWR0aDsKKyAgICAgICAgICAgICAgICBtUG9wdXAuc2V0QW5jaG9yVmlldyh0aGlzKTsKICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1Ecm9wRG93bkhlaWdodCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCkgewotICAgICAgICAgICAgICAgIC8vIFRoZSBjYWxsIHRvIFBvcHVwV2luZG93J3MgdXBkYXRlIG1ldGhvZCBiZWxvdyBjYW4gYWNjZXB0IC0xIGZvciBhbnkKLSAgICAgICAgICAgICAgICAvLyB2YWx1ZSB5b3UgZG8gbm90IHdhbnQgdG8gdXBkYXRlLgotICAgICAgICAgICAgICAgIGhlaWdodFNwZWMgPSBub0lucHV0TWV0aG9kID8gaGVpZ2h0IDogVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQ7Ci0gICAgICAgICAgICAgICAgaWYgKG5vSW5wdXRNZXRob2QpIHsKLSAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldFdpbmRvd0xheW91dE1vZGUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQgOiAwLCAwKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2luZG93TGF5b3V0TW9kZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25XaWR0aCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA6IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAobURyb3BEb3duSGVpZ2h0ID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKSB7Ci0gICAgICAgICAgICAgICAgaGVpZ2h0U3BlYyA9IGhlaWdodDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaGVpZ2h0U3BlYyA9IG1Ecm9wRG93bkhlaWdodDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbVBvcHVwLnNldE91dHNpZGVUb3VjaGFibGUoIW1Gb3JjZUlnbm9yZU91dHNpZGVUb3VjaCAmJiAhbURyb3BEb3duQWx3YXlzVmlzaWJsZSk7Ci0KLSAgICAgICAgICAgIG1Qb3B1cC51cGRhdGUoZ2V0RHJvcERvd25BbmNob3JWaWV3KCksIG1Ecm9wRG93bkhvcml6b250YWxPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93blZlcnRpY2FsT2Zmc2V0LCB3aWR0aFNwZWMsIGhlaWdodFNwZWMpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7Ci0gICAgICAgICAgICAgICAgd2lkdGhTcGVjID0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQ7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChtRHJvcERvd25XaWR0aCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCkgewotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2lkdGgoZ2V0RHJvcERvd25BbmNob3JWaWV3KCkuZ2V0V2lkdGgoKSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldFdpZHRoKG1Ecm9wRG93bldpZHRoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtRHJvcERvd25IZWlnaHQgPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpIHsKLSAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQ7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChtRHJvcERvd25IZWlnaHQgPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpIHsKLSAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldEhlaWdodChoZWlnaHQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRIZWlnaHQobURyb3BEb3duSGVpZ2h0KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1Qb3B1cC5zZXRXaW5kb3dMYXlvdXRNb2RlKHdpZHRoU3Bl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ICAgaWYgKHZpZXcgIT0gbnVsbCAmJiB2aWV3LmdldFdpbmRvd1Rva2VuKCkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc2hvd0Ryb3BEb3duKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9OwotCi0gICAgICAgICAgICBtRHJvcERvd25MaXN0ID0gbmV3IERyb3BEb3duTGlzdFZpZXcoY29udGV4dCk7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldFNlbGVjdG9yKG1Ecm9wRG93bkxpc3RIaWdobGlnaHQpOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRBZGFwdGVyKGFkYXB0ZXIpOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRWZXJ0aWNhbEZhZGluZ0VkZ2VFbmFibGVkKHRydWUpOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRPbkl0ZW1DbGlja0xpc3RlbmVyKG1Ecm9wRG93bkl0ZW1DbGlja0xpc3RlbmVyKTsKLSAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0Rm9jdXNhYmxlKHRydWUpOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRGb2N1c2FibGVJblRvdWNoTW9kZSh0cnVlKTsKLSAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0T25JdGVtU2VsZWN0ZWRMaXN0ZW5lcihuZXcgQWRhcHRlclZpZXcuT25JdGVtU2VsZWN0ZWRMaXN0ZW5lcigpIHsKLSAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkl0ZW1TZWxlY3RlZChBZGFwdGVyVmlldzw/PiBwYXJlbnQsIFZpZXcgdmlldywKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBwb3NpdGlvbiwgbG9uZyBpZCkgewotCi0gICAgICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiAhPSAtMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgRHJvcERvd25MaXN0VmlldyBkcm9wRG93bkxpc3QgPSBtRHJvcERvd25MaXN0OwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZHJvcERvd25MaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcm9wRG93bkxpc3QubUxpc3RTZWxlY3Rpb25IaWRkZW4gPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uTm90aGluZ1NlbGVjdGVkKEFkYXB0ZXJWaWV3PD8+IHBhcmVudCkgewotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0pOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRPblNjcm9sbExpc3RlbmVyKG5ldyBQb3B1cFNjcm9sbExpc3RlbmVyKCkpOwotCi0gICAgICAgICAgICBpZiAobUl0ZW1TZWxlY3RlZExpc3RlbmVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uSXRlbVNlbGVjdGVkTGlzdGVuZXIobUl0ZW1TZWxlY3RlZExpc3RlbmVyKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZHJvcERvd25WaWV3ID0gbURyb3BEb3duTGlzdDsKLQotICAgICAgICAgICAgVmlldyBoaW50VmlldyA9IGdldEhpbnRWaWV3KGNvbnRleHQpOwotICAgICAgICAgICAgaWYgKGhpbnRWaWV3ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAvLyBpZiBhbiBoaW50IGhhcyBiZWVuIHNwZWNpZmllZCwgd2UgYWNjb21vZGF0ZSBtb3JlIHNwYWNlIGZvciBpdCBhbmQKLSAgICAgICAgICAgICAgICAvLyBhZGQgYSB0ZXh0IHZpZXcgaW4gdGhlIGRyb3AgZG93biBtZW51LCBhdCB0aGUgYm90dG9tIG9mIHRoZSBsaXN0Ci0gICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0IGhpbnRDb250YWluZXIgPSBuZXcgTGluZWFyTGF5b3V0KGNvbnRleHQpOwotICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuc2V0T3JpZW50YXRpb24oTGluZWFyTGF5b3V0LlZFUlRJQ0FMKTsKLQotICAgICAgICAgICAgICAgIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMgaGludFBhcmFtcyA9IG5ldyBMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zKAotICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQsIDAsIDEuMGYKLSAgICAgICAgICAgICAgICApOwotICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuYWRkVmlldyhkcm9wRG93blZpZXcsIGhpbnRQYXJhbXMpOwotICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuYWRkVmlldyhoaW50Vmlldyk7Ci0KLSAgICAgICAgICAgICAgICAvLyBtZWFzdXJlIHRoZSBoaW50J3MgaGVpZ2h0IHRvIGZpbmQgaG93IG11Y2ggbW9yZSB2ZXJ0aWNhbCBzcGFjZQotICAgICAgICAgICAgICAgIC8vIHdlIG5lZWQgdG8gYWRkIHRvIHRoZSBkcm9wIGRvd24ncyBoZWlnaHQKLSAgICAgICAgICAgICAgICBpbnQgd2lkdGhTcGVjID0gTWVhc3VyZVNwZWMubWFrZU1lYXN1cmVTcGVjKGdldFdpZHRoKCksIE1lYXN1cmVTcGVjLkFUX01PU1QpOwotICAgICAgICAgICAgICAgIGludCBoZWlnaHRTcGVjID0gTWVhc3VyZVNwZWMuVU5TUEVDSUZJRUQ7Ci0gICAgICAgICAgICAgICAgaGludFZpZXcubWVhc3VyZSh3aWR0aFNwZWMsIGhlaWdodFNwZWMpOwotCi0gICAgICAgICAgICAgICAgaGludFBhcmFtcyA9IChMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zKSBoaW50Vmlldy5nZXRMYXlvdXRQYXJhbXMoKTsKLSAgICAgICAgICAgICAgICBvdGhlckhlaWdodHMgPSBoaW50Vmlldy5nZXRNZWFzdXJlZEhlaWdodCgpICsgaGludFBhcmFtcy50b3BNYXJnaW4KLSAgICAgICAgICAgICAgICAgICAgICAgICsgaGludFBhcmFtcy5ib3R0b21NYXJnaW47Ci0KLSAgICAgICAgICAgICAgICBkcm9wRG93blZpZXcgPSBoaW50Q29udGFpbmVyOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtUG9wdXAuc2V0Q29udGVudFZpZXcoZHJvcERvd25WaWV3KTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGRyb3BEb3duVmlldyA9IChWaWV3R3JvdXApIG1Qb3B1cC5nZXRDb250ZW50VmlldygpOwotICAgICAgICAgICAgZmluYWwgVmlldyB2aWV3ID0gZHJvcERvd25WaWV3LmZpbmRWaWV3QnlJZChISU5UX1ZJRVdfSUQpOwotICAgICAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMgaGludFBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAoTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcykgdmlldy5nZXRMYXlvdXRQYXJhbXMoKTsKLSAgICAgICAgICAgICAgICBvdGhlckhlaWdodHMgPSB2aWV3LmdldE1lYXN1cmVkSGVpZ2h0KCkgKyBoaW50UGFyYW1zLnRvcE1hcmdpbgotICAgICAgICAgICAgICAgICAgICAgICAgKyBoaW50UGFyYW1zLmJvdHRvbU1hcmdpbjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8vIE1heCBoZWlnaHQgYXZhaWxhYmxlIG9uIHRoZSBzY3JlZW4gZm9yIGEgcG9wdXAuCi0gICAgICAgIGJvb2xlYW4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A9IG1Ecm9wRG93bkxpc3QubWVhc3VyZUhlaWdodE9mQ2hpbGRyZW4oTWVhc3VyZVNwZWMuVU5TUEVDSUZJRUQsCi0gICAgICAgICAgICAgICAgMCwgTGlzdFZpZXcuTk9fUE9TSVRJT04sIG1heEhlaWdodCAtIG90aGVySGVpZ2h0cywgMik7Ci0gICAgICAgIC8vIGFkZCBwYWRkaW5nIG9ubHkgaWYgdGhlIGxpc3QgaGFzIGl0ZW1zIGluIGl0LCB0aGF0IHdheSB3ZSBkb24ndCBzaG93Ci0gICAgICAgIC8vIHRoZSBwb3B1cCBpZiBpdCBpcyBub3QgbmVlZGVkCi0gICAgICAgIGlmIChsaXN0Q29udGVudCA+IDApIG90aGVySGVpZ2h0cyArPSBwYWRkaW5nOwotCi0gICAgICAgIHJldHVybiBsaXN0Q29udGVudCArIG90aGVySGVpZ2h0czsKLSAgICB9Ci0KLSAgICBwcml2YXRlIFZpZXcgZ2V0SGludFZpZXcoQ29udGV4dCBjb250ZXh0KSB7Ci0gICAgICAgIGlmIChtSGludFRleHQgIT0gbnVsbCAmJiBtSGludFRleHQubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICBmaW5hbCBUZXh0VmlldyBoaW50VmlldyA9IChUZXh0VmlldykgTGF5b3V0SW5mbGF0ZXIuZnJvbShjb250ZXh0KS5pbmZsYXRlKAotICAgICAgICAgICAgICAgICAgICBtSGludFJlc291cmNlLCBudWxsKS5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC50ZXh0MSk7Ci0gICAgICAgICAgICBoaW50Vmlldy5zZXRUZXh0KG1IaW50VGV4dCk7Ci0gICAgICAgICAgICBoaW50Vmlldy5zZXRJZChISU5UX1ZJRVdfSUQpOwotICAgICAgICAgICAgcmV0dXJuIGhpbnRWaWV3OwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTE0NDMsNDcgKzExMTMsNiBAQAogICAgICAgICByZXR1cm4gbUZpbHRlcjsKICAgICB9CiAKLSAgICBwcml2YXRlIGNsYXNzIExpc3RTZWxlY3RvckhpZGVyIGltcGxlbWVudHMgUnVubmFibGUgewotICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0gICAgICAgICAgICBjbGVhckxpc3RTZWxlY3Rpb24oKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHByaXZhdGUgY2xhc3MgUmVzaXplUG9wdXBSdW5uYWJsZSBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKLSAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewotICAgICAgICAgICAgbVBvcHVwLnNldElucHV0TWV0aG9kTW9kZShQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTk9UX05FRURFRCk7Ci0gICAgICAgICAgICBzaG93RHJvcERvd24oKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHByaXZhdGUgY2xhc3MgUG9wdXBUb3VjaEludGVyY2VwdG9yIGltcGxlbWVudHMgT25Ub3VjaExpc3RlbmVyIHsKLSAgICAgICAgcHVibGljIGJvb2xlYW4gb25Ub3VjaChWaWV3IHYsIE1vdGlvbkV2ZW50IGV2ZW50KSB7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgYWN0aW9uID0gZXZlbnQuZ2V0QWN0aW9uKCk7Ci0gICAgICAgICAgICBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOICYmCi0gICAgICAgICAgICAgICAgICAgIG1Qb3B1cCAhPSBudWxsICYmIG1Qb3B1cC5pc1Nob3dpbmcoKSkgewotICAgICAgICAgICAgICAgIHBvc3REZWxheWVkKG1SZXNpemVQb3B1cFJ1bm5hYmxlLCBFWFBBTkRfTElTVF9USU1FT1VUKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9VUCkgewotICAgICAgIC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0dXJuIHRydWUgYWx3YXlzCi0gICAgICAgICAqLwotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzV2luZG93Rm9jdXMoKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qKgotICAgICAgICAgKiA8cD5SZXR1cm5zIHRoZSBmb2N1cyBzdGF0ZSBpbiB0aGUgZHJvcCBkb3duLjwvcD4KLSAgICAgICAgICoKLSAgICAgICAgICogQHJldHVybiB0cnVlIGFsd2F5cwotICAgICAgICAgKi8KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGlzRm9jdXNlZCgpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqCi0gICAgICAgICAqIDxwPlJldHVybnMgdGhlIGZvY3VzIHN0YXRlIGluIHRoZSBkcm9wIGRvd24uPC9wPgotICAgICAgICAgKgotICAgICAgICAgKiBAcmV0dXJuIHRydWUgYWx3YXlzCi0gICAgICAgICAqLwotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzRm9jdXMoKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgcHJvdGVjdGVkIGludFtdIG9uQ3JlYXRlRHJhd2FibGVTdGF0ZShpbnQgZXh0cmFTcGFjZSkgewotICAgICAgICAgICAgaW50W10gcmVzID0gc3VwZXIub25DcmVhdGVEcmF3YWJsZVN0YXRlKGV4dHJhU3BhY2UpOwotICAgICAgICAgICAgLy9ub2luc3BlY3Rpb24gQ29uc3RhbnRJZlN0YXRlbWVudAotICAgICAgICAgICAgaWYgKGZhbHNlKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBzYiA9IG5ldyBTdHJpbmdCdWlsZGVyKCJDcmVhdGVkIGRyYXdhYmxlIHN0YXRlOiBbIik7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPHJlcy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBpZiAoaSA+IDApIHNiLmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCIweCIpOwotICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoSW50ZWdlci50b0hleFN0cmluZyhyZXNbaV0pKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgc2IuYXBwZW5kKCJdIik7Ci0gICAgICAgICAgICAgICAgTG9nLmkoVEFHLCBzYi50b1N0cmluZygpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiByZXM7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKICAgICAgKiBUaGlzIGludGVyZmFjZSBpcyB1c2VkIHRvIG1ha2Ugc3VyZSB0aGF0IHRoZSB0ZXh0IGVudGVyZWQgaW4gdGhpcyBUZXh0VmlldyBjb21wbGllcyB0bwogICAgICAqIGEgY2VydGFpbiBmb3JtYXQuICBTaW5jZSB0aGVyZSBpcyBubyBmb29scHJvb2Ygd2F5IHRvIHByZXZlbnQgdGhlIHVzZXIgZnJvbSBsZWF2aW5nCiAgICAgICogdGhpcyBWaWV3IHdpdGggYW4gaW5jb3JyZWN0IHZhbHVlIGluIGl0LCBhbGwgd2UgY2FuIGRvIGlzIHRyeSB0byBmaXggaXQgb3Vyc2VsdmVzCkBAIC0xNjU1LDEwICsxMTY3LDcgQEAKICAgICBwcml2YXRlIGNsYXNzIFBvcHVwRGF0YVNldE9ic2VydmVyIGV4dGVuZHMgRGF0YVNldE9ic2VydmVyIHsKICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2hhbmdlZCgpIHsKLSAgICAgICAgICAgIGlmIChpc1BvcHVwU2hvd2luZygpKSB7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ZpbmFsIGludCBTSE9XX0RJVklERVJfQkVHSU5OSU5HID0gMTsKKyAgICAvKioKKyAgICAgKiBTaG93IGRpdmlkZXJzIGJldHdlZW4gZWFjaCBpdGVtIGluIHRoZSBncm91cC4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBTSE9XX0RJVklERVJfTUlERExFID0gMjsKKyAgICAvKioKKyAgICAgKiBTaG93IGEgZGl2aWRlciBhdCB0aGUgZW5kIG9mIHRoZSBncm91cC4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBTSE9XX0RJVklERVJfRU5EID0gNDsKKworICAgIHByaXZhdGUgZmluYWwgUmVjdCBtVGVtcFJlY3QgPSBuZXcgUmVjdCgpOworCisgICAgcHVibGljIEJ1dHRvbkdyb3VwKENvbnRleHQgY29udGV4dCkgeworICAgICAgICB0aGlzKGNvbnRleHQsIG51bGwpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgQnV0dG9uR3JvdXAoQ29udGV4dCBjb250ZXh0LCBBdHRyaWJ1dGVTZXQgYXR0cnMpIHsKKyAgICAgICAgdGhpcyhjb250ZXh0LCBhdHRycywgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hdHRyLmJ1dHRvbkdyb3VwU3R5bGUpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgQnV0dG9uR3JvdXAoQ29udGV4dCBjb250ZXh0LCBBdHRyaWJ1dGVTZXQgYXR0cnMsIGludCBkZWZTdHlsZVJlcykgeworICAgICAgICBzdXBlcihjb250ZXh0LCBhdHRycywgZGVmU3R5bGVSZXMpOworICAgICAgICAKKyAgICAgICAgVHlwZWRBcnJheSBhID0gY29udGV4dC5vYnRhaW5TdHlsZWRBdHRyaWJ1dGVzKGF0dHJzLAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkJ1dHRvbkdyb3VwLCBkZWZTdHlsZVJlcywgMCk7CisgICAgICAgIAorICAgICAgICBzZXREaXZpZGVyRHJhd2FibGUoYS5nZXREcmF3YWJsZShjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5CdXR0b25Hcm91cF9kaXZpZGVyKSk7CisgICAgICAgIG1CdXR0b25CYWNrZ3JvdW5kUmVzID0gYS5nZXRSZXNvdXJjZUlkKAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkJ1dHRvbkdyb3VwX2J1dHRvbkJhY2tncm91bmQsIDApOworICAgICAgICBzZXRTaG93RGl2aWRlcnMoYS5nZXRJbnQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQnV0dG9uR3JvdXBfc2hvd0RpdmlkZXJzLAorICAgICAgICAgICAgICAgIFNIT1dfRElWSURFUl9NSURETEUpKTsKKyAgICAgICAgYS5yZWN5Y2xlKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IGhvdyBkaXZpZGVycyBzaG91bGQgYmUgc2hvd24gYmV0d2VlbiBpdGVtcyBpbiB0aGlzIGJ1dHRvbiBncm91cC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBzaG93RGl2aWRlcnMgT25lIG9yIG1vcmUgb2Yge0BsaW5rICNTSE9XX0RJVklERVJfQkVHSU5OSU5HfSwKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgIHtAbGluayAjU0hPV19ESVZJREVSX01JRERMRX0sIG9yIHtAbGluayAjU0hPV19ESVZJREVSX0VORH0sCisgICAgICogICAgICAgICAgICAgICAgICAgICBvciB7QGxpbmsgI1NIT1dfRElWSURFUl9OT05FfSB0byBzaG93IG5vIGRpdmlkZXJzLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFNob3dEaXZpZGVycyhpbnQgc2hvd0RpdmlkZXJzKSB7CisgICAgICAgIGlmIChzaG93RGl2aWRlcnMgIT0gbVNob3dEaXZpZGVycykgeworICAgICAgICAgICAgcmVxdWVzdExheW91dCgpOworICAgICAgICB9CisgICAgICAgIG1TaG93RGl2aWRlcnMgPSBzaG93RGl2aWRlcnM7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBBIGZsYWcgc2V0IGluZGljYXRpbmcgaG93IGRpdmlkZXJzIHNob3VsZCBiZSBzaG93biBhcm91bmQgaXRlbXMuCisgICAgICogQHNlZSAjc2V0U2hvd0RpdmlkZXJzKGludCkKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFNob3dEaXZpZGVycygpIHsKKyAgICAgICAgcmV0dXJuIG1TaG93RGl2aWRlcnM7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IGEgZHJhd2FibGUgdG8gYmUgdXNlZCBhcyBhIGRpdmlkZXIgYmV0d2VlbiBpdGVtcy4KKyAgICAgKiBAcGFyYW0gZGl2aWRlciBEcmF3YWJsZSB0aGF0IHdpbGwgZGl2aWRlIGVhY2ggaXRlbS4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXREaXZpZGVyRHJhd2FibGUoRHJhd2FibGUgZGl2aWRlcikgeworICAgICAgICBpZiAoZGl2aWRlciA9PSBtRGl2aWRlcikgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIG1EaXZpZGVyID0gZGl2aWRlcjsKKyAgICAgICAgaWYgKGRpdmlkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbURpdmlkZXJXaWR0aCA9IGRpdmlkZXIuZ2V0SW50cmluc2ljV2lkdGgoKTsKKyAgICAgICAgICAgIG1EaXZpZGVySGVpZ2h0ID0gZGl2aWRlci5nZXRJbnRyaW5zaWNIZWlnaHQoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1EaXZpZGVyV2lkdGggPSAwOworICAgICAgICAgICAgbURpdmlkZXJIZWlnaHQgPSAwOworICAgICAgICB9CisgICAgICAgIHJlcXVlc3RMYXlvdXQoKTsKKyAgICB9CisKKyAg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gICB9CisKKyAgICAgICAgc3VwZXIuYWRkVmlldyhjaGlsZCwgaW5kZXgsIHBhcmFtcyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25NZWFzdXJlKGludCB3aWR0aE1lYXN1cmVTcGVjLCBpbnQgaGVpZ2h0TWVhc3VyZVNwZWMpIHsKKyAgICAgICAgc3VwZXIub25NZWFzdXJlKHdpZHRoTWVhc3VyZVNwZWMsIGhlaWdodE1lYXN1cmVTcGVjKTsKKworICAgICAgICAvLyBBZGQgdGhlIGV4dHJhIHNpemUgdGhhdCBkaXZpZGVycyBjb250cmlidXRlLgorICAgICAgICBpbnQgZGl2aWRlckNvdW50ID0gMDsKKyAgICAgICAgaWYgKChtU2hvd0RpdmlkZXJzICYgU0hPV19ESVZJREVSX01JRERMRSkgPT0gU0hPV19ESVZJREVSX01JRERMRSkgeworICAgICAgICAgICAgZmluYWwgaW50IGNoaWxkQ291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNoaWxkQ291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIGlmIChnZXRDaGlsZEF0KGkpLmdldFZpc2liaWxpdHkoKSAhPSBHT05FKSB7CisgICAgICAgICAgICAgICAgICAgIGRpdmlkZXJDb3VudCsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGRpdmlkZXJDb3VudCA9IE1hdGgubWF4KDAsIGRpdmlkZXJDb3VudCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKChtU2hvd0RpdmlkZXJzICYgU0hPV19ESVZJREVSX0JFR0lOTklORykgPT0gU0hPV19ESVZJREVSX0JFR0lOTklORykgeworICAgICAgICAgICAgZGl2aWRlckNvdW50Kys7CisgICAgICAgIH0KKyAgICAgICAgaWYgKChtU2hvd0RpdmlkZXJzICYgU0hPV19ESVZJREVSX0VORCkgPT0gU0hPV19ESVZJREVSX0VORCkgeworICAgICAgICAgICAgZGl2aWRlckNvdW50Kys7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZ2V0T3JpZW50YXRpb24oKSA9PSBWRVJUSUNBTCkgeworICAgICAgICAgICAgZmluYWwgaW50IGRpdmlkZXJTaXplID0gbURpdmlkZXJIZWlnaHQgKiBkaXZpZGVyQ291bnQ7CisgICAgICAgICAgICBzZXRNZWFzdXJlZERpbWVuc2lvbihnZXRNZWFzdXJlZFdpZHRoKCksCisgICAgICAgICAgICAgICAgICAgIHJlc29sdmVTaXplKGdldE1lYXN1cmVkSGVpZ2h0KCkgKyBkaXZpZGVyU2l6ZSwgaGVpZ2h0TWVhc3VyZVNwZWMpKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGZpbmFsIGludCBkaXZpZGVyU2l6ZSA9IG1EaXZpZGVyV2lkdGggKiBkaXZpZGVyQ291bnQ7CisgICAgICAgICAgICBzZXRNZWFzdXJlZERpbWVuc2lvbihyZXNvbHZlU2l6ZShnZXRNZWFzdXJlZFdpZHRoKCkgKyBkaXZpZGVyU2l6ZSwgd2lkdGhNZWFzdXJlU3BlYyksCisgICAgICAgICAgICAgICAgICAgIGdldE1lYXN1cmVkSGVpZ2h0KCkpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25MYXlvdXQoYm9vbGVhbiBjaGFuZ2VkLCBpbnQgbCwgaW50IHQsIGludCByLCBpbnQgYikgeworICAgICAgICBzdXBlci5vbkxheW91dChjaGFuZ2VkLCBsLCB0LCByLCBiKTsKKworICAgICAgICBmaW5hbCBib29sZWFuIGJlZ2luID0gKG1TaG93RGl2aWRlcnMgJiBTSE9XX0RJVklERVJfQkVHSU5OSU5HKSA9PSBTSE9XX0RJVklERVJfQkVHSU5OSU5HOworICAgICAgICBmaW5hbCBib29sZWFuIG1pZGRsZSA9IChtU2hvd0RpdmlkZXJzICYgU0hPV19ESVZJREVSX01JRERMRSkgPT0gU0hPV19ESVZJREVSX01JRERMRTsKKworICAgICAgICAvLyBPZmZzZXQgY2hpbGRyZW4gdG8gbGVhdmUgc3BhY2UgZm9yIGRpdmlkZXJzLgorICAgICAgICBpZiAoZ2V0T3JpZW50YXRpb24oKSA9PSBWRVJUSUNBTCkgeworICAgICAgICAgICAgaW50IG9mZnNldCA9IGJlZ2luID8gbURpdmlkZXJIZWlnaHQgOiAwOworICAgICAgICAgICAgZmluYWwgaW50IGNoaWxkQ291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNoaWxkQ291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIFZpZXcgY2hpbGQgPSBnZXRDaGlsZEF0KGkpOworICAgICAgICAgICAgICAgIGNoaWxkLm9mZnNldFRvcEFuZEJvdHRvbShvZmZzZXQpOworICAgICAgICAgICAgICAgIGlmIChtaWRkbGUgJiYgY2hpbGQuZ2V0VmlzaWJpbGl0eSgpICE9IEdPTkUpIHsKKyAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ICs9IG1EaXZpZGVySGVpZ2h0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGludCBvZmZzZXQgPSBiZWdpbiA/IG1EaXZpZGVyV2lkdGggOiAwOworICAgICAgICAgICAgZmluYWwgaW50IGNoaWxkQ291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNoaWxkQ291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIFZpZXcgY2hpbGQgPSBnZXRDaGlsZEF0KGkpOworICAgICAgICAgICAgICAgIGNoaWxkLm9mZnNldExlZnRBbmRSaWdodChvZmZzZXQpOworICAgICAgICAgICAgICAgIGlmIChtaWRkbGUgJiYgY2hpbGQuZ2V0VmlzaWJpbGl0eSgpICE9IEdPTkUpIHsKKyAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ICs9IG1EaXZpZGVyV2lkdGg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZGlzcGF0Y2hEcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgaWYgKG1EaXZpZGVyID09IG51bGwpIHsKKyAgICAgICAgICAgIHN1cGVyLmRpc3BhdGNoRHJhdyhjYW52YXMpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgYm9vbGVhbiBiZWdpbiA9IChtU2hvd0RpdmlkZXJzICYgU0hPV19ESVZJREVSX0JFR0lOTklORykgPT0gU0hPV19ESVZJREVSX0JFR0lOTklORzsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBtaWRkbGUgPSAobVNob3dEaXZpZGVycyAmIFNIT1dfRElWSURFUl9NSURETEUpID09IFNIT1dfRElWSURFUl9NSURETEU7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gZW5kID0gKG1TaG93RGl2aWRlcnMgJiBTSE9XX0RJVklERVJfRU5EKSA9PSBTSE9XX0RJVklERVJfRU5EOworICAgICAgICBmaW5hbCBib29sZWFuIHZlcnRpY2FsID0gZ2V0T3JpZW50YXRpb24oKSA9PSBWRVJUSUNBTDsKKworICAgICAgICBmaW5hbCBSZWN0IGJvdW5kcyA9IG1UZW1wUmVjdDsKKyAgICAgICAgYm91bmRzLmxlZnQgPSBtUGFkZGluZ0xlZnQ7CisgICAgICAgIGJvdW5kcy5yaWdodCA9IG1SaWdodCAtIG1MZWZ0IC0gbVBhZGRpbmdSaWdodDsKKyAgICAgICAgYm91bmRzLnRvcCA9IG1QYWRkaW5nVG9wOworICAgICAgICBib3VuZHMuYm90dG9tID0gbUJvdHRvbSAtIG1Ub3AgLSBtUGFkZGluZ0JvdHRvbTsKKworICAgICAgICBpZiAoYmVnaW4pIHsKKyAgICAgICAgICAgIGlmICh2ZXJ0aWNhbCkgeworICAgICAgICAgICAgICAgIGJvdW5kcy5ib3R0b20gPSBib3VuZHMudG9wICsgbURpdmlkZXJIZWlnaHQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGJvdW5kcy5yaWdodCA9IGJvdW5kcy5sZWZ0ICsgbURpdmlkZXJXaWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1EaXZpZGVyLnNldEJvdW5kcyhib3VuZHMpOworICAgICAgICAgICAgbURpdmlkZXIuZHJhdyhjYW52YXMpOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgaW50IGNoaWxkQ291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgIGludCBpID0gMDsKKyAgICAgICAgd2hpbGUgKGkgPCBjaGlsZENvdW50KSB7CisgICAgICAgICAgICBmaW5hbCBWaWV3IGNoaWxkID0gZ2V0Q2hpbGRBdChpKTsKKyAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgIGlmICgobWlkZGxlICYmIGkgPCBjaGlsZENvdW50ICYmIGNoaWxkLmdldFZpc2liaWxpdHkoKSAhPSBHT05FKSB8fCBlbmQpIHsKKyAgICAgICAgICAgICAgICBpZiAodmVydGljYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgYm91bmRzLnRvcCA9IGNoaWxkLmdldEJvdHRvbSgpOworICAgICAgICAgICAgICAgICAgICBib3VuZHMuYm90dG9tID0gYm91bmRzLnRvcCArIG1EaXZpZGVySGVpZ2h0OworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGJvdW5kcy5sZWZ0ID0gY2hpbGQuZ2V0UmlnaHQoKTsKKyAgICAgICAgICAgICAgICAgICAgYm91bmRzLnJpZ2h0ID0gYm91bmRzLmxlZnQgKyBtRGl2aWRlcldpZHRoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtRGl2aWRlci5zZXRCb3VuZHMoY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0gbUdsb3dBbHBoYVN0YXJ0KSAqIGludGVycDsKLSAgICAgICAgbUdsb3dTY2FsZVkgPSBtR2xvd1NjYWxlWVN0YXJ0ICsgKG1HbG93U2NhbGVZRmluaXNoIC0gbUdsb3dTY2FsZVlTdGFydCkgKiBpbnRlcnA7Ci0KLSAgICAgICAgaWYgKHQgPj0gMS5mIC0gRVBTSUxPTikgewotICAgICAgICAgICAgc3dpdGNoIChtU3RhdGUpIHsKLSAgICAgICAgICAgICAgICBjYXNlIFNUQVRFX0FCU09SQjoKLSAgICAgICAgICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfUkVDRURFOwotICAgICAgICAgICAgICAgICAgICBtU3RhcnRUaW1lID0gQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgICAgICAgICAgbUR1cmF0aW9uID0gUkVDRURFX1RJTUU7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUVkZ2VBbHBoYVN0YXJ0ID0gbUVkZ2VBbHBoYTsKLSAgICAgICAgICAgICAgICAgICAgbUVkZ2VTY2FsZVlTdGFydCA9IG1FZGdlU2NhbGVZOwotICAgICAgICAgICAgICAgICAgICBtR2xvd0FscGhhU3RhcnQgPSBtR2xvd0FscGhhOwotICAgICAgICAgICAgICAgICAgICBtR2xvd1NjYWxlWVN0YXJ0ID0gbUdsb3dTY2FsZVk7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gQWZ0ZXIgYWJzb3JiLCB0aGUgZ2xvdyBhbmQgZWRnZSBzaG91bGQgZmFkZSB0byBub3RoaW5nLgotICAgICAgICAgICAgICAgICAgICBtRWRnZUFscGhhRmluaXNoID0gMC5mOwotICAgICAgICAgICAgICAgICAgICBtRWRnZVNjYWxlWUZpbmlzaCA9IDAuZjsKLSAgICAgICAgICAgICAgICAgICAgbUdsb3dBbHBoYUZpbmlzaCA9IDAuZjsKLSAgICAgICAgICAgICAgICAgICAgbUdsb3dTY2FsZVlGaW5pc2ggPSAwLmY7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfUFVMTDoKLSAgICAgICAgICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfUFVMTF9ERUNBWTsKLSAgICAgICAgICAgICAgICAgICAgbVN0YXJ0VGltZSA9IEFuaW1hdGlvblV0aWxzLmN1cnJlbnRBbmltYXRpb25UaW1lTWlsbGlzKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1EdXJhdGlvbiA9IFBVTExfREVDQVlfVElNRTsKLQotICAgICAgICAgICAgICAgICAgICBtRWRnZUFscGhhU3RhcnQgPSBtRWRnZUFscGhhOwotICAgICAgICAgICAgICAgICAgICBtRWRnZVNjYWxlWVN0YXJ0ID0gbUVkZ2VTY2FsZVk7Ci0gICAgICAgICAgICAgICAgICAgIG1HbG93QWxwaGFTdGFydCA9IG1HbG93QWxwaGE7Ci0gICAgICAgICAgICAgICAgICAgIG1HbG93U2NhbGVZU3RhcnQgPSBtR2xvd1NjYWxlWTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBBZnRlciBwdWxsLCB0aGUgZ2xvdyBhbmQgZWRnZSBzaG91bGQgZmFkZSB0byBub3RoaW5nLgotICAgICAgICAgICAgICAgICAgICBtRWRnZUFscGhhRmluaXNoID0gMC5mOwotICAgICAgICAgICAgICAgICAgICBtRWRnZVNjYWxlWUZpbmlzaCA9IDAuZjsKLSAgICAgICAgICAgICAgICAgICAgbUdsb3dBbHBoYUZpbmlzaCA9IDAuZjsKLSAgICAgICAgICAgICAgICAgICAgbUdsb3dTY2FsZVlGaW5pc2ggPSAwLmY7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfUFVMTF9ERUNBWToKLSAgICAgICAgICAgICAgICAgICAgLy8gV2hlbiByZWNlZGluZywgd2Ugd2FudCBlZGdlIHRvIGRlY3JlYXNlIG1vcmUgc2xvd2x5Ci0gICAgICAgICAgICAgICAgICAgIC8vIHRoYW4gdGhlIGdsb3cuCi0gICAgICAgICAgICAgICAgICAgIGZsb2F0IGZhY3RvciA9IG1HbG93U2NhbGVZRmluaXNoICE9IDAgPyAxCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyAobUdsb3dTY2FsZVlGaW5pc2ggKiBtR2xvd1NjYWxlWUZpbmlzaCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IEZsb2F0Lk1BWF9WQUxVRTsKLSAgICAgICAgICAgICAgICAgICAgbUVkZ2VTY2FsZVkgPSBtRWRnZVNjYWxlWVN0YXJ0ICsKLSAgICAgICAgICAgICAgICAgICAgICAgIChtRWRnZVNjYWxlWUZpbmlzaCAtIG1FZGdlU2NhbGVZU3RhcnQpICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnAgKiBmYWN0b3I7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfUkVDRURFOgotICAgICAgICAgICAgICAgICAgICBtU3RhdGUgPSBTVEFURV9JRExFOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3dpZGdldC9FeHBhbmRhYmxlTGlzdFZpZXcuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3dpZGdldC9FeHBhbmRhYmxlTGlzdFZpZXcuamF2YQppbmRleCA4YmQ3OTdiLi4zZDIxMDQ4IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvRXhwYW5kYWJsZUxpc3RWaWV3LmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvd2lkZ2V0L0V4cGFuZGFibGVMaXN0Vmlldy5qYXZhCkBAIC0xODUsNyArMTg1LDYgQEAKICAgICAKICAgICAvKiogR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gICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX1VQOgogICAgICAgICAgICAgICAgIG9uU2Vjb25kYXJ5UG9pbnRlclVwKGV2KTsKQEAgLTUwMyw3ICs0OTUsOSBAQAogICAgICAgICBzd2l0Y2ggKGFjdGlvbiAmIE1vdGlvbkV2ZW50LkFDVElPTl9NQVNLKSB7CiAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOOiB7CiAgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgeCA9IGV2LmdldFgoKTsKLSAgICAgICAgICAgICAgICBtSXNCZWluZ0RyYWdnZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIGlmICghKG1Jc0JlaW5nRHJhZ2dlZCA9IGluQ2hpbGQoKGludCkgeCwgKGludCkgZXYuZ2V0WSgpKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIC8qCiAgICAgICAgICAgICAgICAgICogSWYgYmVpbmcgZmxpbmdlZCBhbmQgdXNlciB0b3VjaGVzLCBzdG9wIHRoZSBmbGluZy4gaXNGaW5pc2hlZApAQCAtNTI2LDM2ICs1MjAsNyBAQAogICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZGVsdGFYID0gKGludCkgKG1MYXN0TW90aW9uWCAtIHgpOwogICAgICAgICAgICAgICAgICAgICBtTGFzdE1vdGlvblggPSB4OwogCi0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBvbGRYID0gbVNjcm9sbFg7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBvbGRZID0gbVNjcm9sbFk7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCByYW5nZSA9IGdldFNjcm9sbFJhbmdlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChvdmVyU2Nyb2xsQnkoZGVsdGFYLCAwLCBtU2Nyb2xsWCwgMCwgcmFuZ2UsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbU92ZXJzY3JvbGxEaXN0YW5jZSwgMCwgdHJ1ZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJyZWFrIG91ciB2ZWxvY2l0eSBpZiB3ZSBoaXQgYSBzY3JvbGwgYmFycmllci4KLSAgICAgICAgICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIuY2xlYXIoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBvblNjcm9sbENoYW5nZWQobVNjcm9sbFgsIG1TY3JvbGxZLCBvbGRYLCBvbGRZKTsKLQotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgb3ZlcnNjcm9sbE1vZGUgPSBnZXRPdmVyU2Nyb2xsTW9kZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAob3ZlcnNjcm9sbE1vZGUgPT0gT1ZFUl9TQ1JPTExfQUxXQVlTIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKG92ZXJzY3JvbGxNb2RlID09IE9WRVJfU0NST0xMX0lGX0NPTlRFTlRfU0NST0xMUyAmJiByYW5nZSA+IDApKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcHVsbGVkVG9YID0gb2xkWCArIGRlbHRhWDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwdWxsZWRUb1ggPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93TGVmdC5vblB1bGwoKGZsb2F0KSBkZWx0YVggLyBnZXRXaWR0aCgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1FZGdlR2xvd1JpZ2h0LmlzRmluaXNoZWQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dSaWdodC5vblJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHB1bGxlZFRvWCA+IHJhbmdlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93UmlnaHQub25QdWxsKChmbG9hdCkgZGVsdGFYIC8gZ2V0V2lkdGgoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtRWRnZUdsb3dMZWZ0LmlzRmluaXNoZWQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dMZWZ0Lm9uUmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRWRnZUdsb3dMZWZ0ICE9IG51bGwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFtRWRnZUdsb3dMZWZ0LmlzRmluaXNoZWQoKSB8fCAhbUVkZ2VHbG93UmlnaHQuaXNGaW5pc2hlZCgpKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY3JvbGxCeShkZWx0YVgsIDApOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1VQOgpAQCAtNTY0LDE1ICs1MjksOCBAQAogICAgICAgICAgICAgICAgICAgICB2ZWxvY2l0eVRyYWNrZXIuY29tcHV0ZUN1cnJlbnRWZWxvY2l0eSgxMDAwLCBtTWF4aW11bVZlbG9jaXR5KTsKICAgICAgICAgICAgICAgICAgICAgaW50IGluaXRpYWxWZWxvY2l0eSA9IChpbnQpIHZlbG9jaXR5VHJhY2tlci5nZXRYVmVsb2NpdHkobUFjdGl2ZVBvaW50ZXJJZCk7CiAKLSAgICAgICAgICAgICAgICAgICAgaWYgKGdldENoaWxkQ291bnQoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoTWF0aC5hYnMoaW5pdGlhbFZlbG9jaXR5KSA+IG1NaW5pbXVtVmVsb2NpdHkpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxpbmcoLWluaXRpYWxWZWxvY2l0eSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCByaWdodCA9IGdldFNjcm9sbFJhbmdlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1TY3JvbGxlci5zcHJpbmdCYWNrKG1TY3JvbGxYLCBtU2Nyb2xsWSwgMCwgcmlnaHQsIDAsIDApKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChnZXRDaGlsZENvdW50KCkgPiAwICYmIE1hdGguYWJzKGluaXRpYWxWZWxvY2l0eSkgPiBtTWluaW11bVZlbG9jaXR5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmbGluZygtaW5pdGlhbFZlbG9jaXR5KTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBvaW50ZXJJZCA9IElOVkFMSURfUE9JTlRFUjsKQEAgLTU4MiwyNyArNTQwLDE2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBtVmVsb2NpdHlUcmFja2VyLnJlY3ljbGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtRWRnZUdsb3dMZWZ0ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1FZGdlR2xvd0xlZnQub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dSaWdodC5vblJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX0NBTkNFTDoKICAgICAgICAgICAgICAgICBpZiAobUlzQmVpbmdEcmFnZ2VkICYmIGdldENoaWxkQ291bnQoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1TY3JvbGxlci5zcHJpbmdCYWNrKG1TY3JvbGxYLCBtU2Nyb2xsWSwgMCwgZ2V0U2Nyb2xsUmFuZ2UoKSwgMCwgMCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUG9pbnRlcklkID0gSU5WQUxJRF9QT0lOVEVSOwogICAgICAgICAgICAgICAgICAgICBtSXNCZWluZ0RyYWdnZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgaWYgKG1WZWxvY2l0eVRyYWNrZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVZlbG9jaXR5VHJhY2tlci5yZWN5Y2xlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBtVmVsb2NpdHlUcmFja2VyID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiA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mIoKGludCkgbVNjcm9sbGVyLmdldEN1cnJWZWxvY2l0eSgpKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh4ID4gcmFuZ2UgJiYgb2xkWCA8PSByYW5nZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93UmlnaHQub25BYnNvcmIoKGludCkgbVNjcm9sbGVyLmdldEN1cnJWZWxvY2l0eSgpKTsKLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGdldENoaWxkQ291bnQoKSA+IDApIHsKKyAgICAgICAgICAgICAgICBWaWV3IGNoaWxkID0gZ2V0Q2hpbGRBdCgwKTsKKyAgICAgICAgICAgICAgICB4ID0gY2xhbXAoeCwgZ2V0V2lkdGgoKSAtIG1QYWRkaW5nUmlnaHQgLSBtUGFkZGluZ0xlZnQsIGNoaWxkLmdldFdpZHRoKCkpOworICAgICAgICAgICAgICAgIHkgPSBjbGFtcCh5LCBnZXRIZWlnaHQoKSAtIG1QYWRkaW5nQm90dG9tIC0gbVBhZGRpbmdUb3AsIGNoaWxkLmdldEhlaWdodCgpKTsKKyAgICAgICAgICAgICAgICBpZiAoeCAhPSBvbGRYIHx8IHkgIT0gb2xkWSkgeworICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsWCA9IHg7CisgICAgICAgICAgICAgICAgICAgIG1TY3JvbGxZID0geTsKKyAgICAgICAgICAgICAgICAgICAgb25TY3JvbGxDaGFuZ2VkKHgsIHksIG9sZFgsIG9sZFkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGF3YWtlblNjcm9sbEJhcnMoKTsKQEAgLTEzNDcsNyArMTI2Myw3IEBACiAgICAgICAgICAgICBpbnQgcmlnaHQgPSBnZXRDaGlsZEF0KDApLmdldFdpZHRoKCk7CiAgICAgCiAgICAgICAgICAgICBtU2Nyb2xsZXIuZmxpbmcobVNjcm9sbFgsIG1TY3JvbGxZLCB2ZWxvY2l0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QgPSBudWxsOwotICAgICAgICB9Ci0gICAgICAgIHN1cGVyLnNldE92ZXJTY3JvbGxNb2RlKG1vZGUpOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIGRyYXcoQ2FudmFzIGNhbnZhcykgewotICAgICAgICBzdXBlci5kcmF3KGNhbnZhcyk7Ci0gICAgICAgIGlmIChtRWRnZUdsb3dMZWZ0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZpbmFsIGludCBzY3JvbGxYID0gbVNjcm9sbFg7Ci0gICAgICAgICAgICBpZiAoIW1FZGdlR2xvd0xlZnQuaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IHJlc3RvcmVDb3VudCA9IGNhbnZhcy5zYXZlKCk7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IGhlaWdodCA9IGdldEhlaWdodCgpOwotCi0gICAgICAgICAgICAgICAgY2FudmFzLnJvdGF0ZSgyNzApOwotICAgICAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoLWhlaWdodCAqIDEuNWYsIE1hdGgubWluKDAsIHNjcm9sbFgpKTsKLSAgICAgICAgICAgICAgICBtRWRnZUdsb3dMZWZ0LnNldFNpemUoZ2V0SGVpZ2h0KCkgKiAyLCBnZXRXaWR0aCgpKTsKLSAgICAgICAgICAgICAgICBpZiAobUVkZ2VHbG93TGVmdC5kcmF3KGNhbnZhcykpIHsKLSAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQocmVzdG9yZUNvdW50KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghbUVkZ2VHbG93UmlnaHQuaXNGaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IHJlc3RvcmVDb3VudCA9IGNhbnZhcy5zYXZlKCk7Ci0gICA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qIEBoaWRlIE9ubHkgdXNlZCBieSBBdXRvQ29tcGxldGVUZXh0VmlldyB1bmRlciBzcGVjaWFsIGNvbmRpdGlvbnMuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaXNEcm9wRG93bkFsd2F5c1Zpc2libGUoKSB7CisgICAgICAgIHJldHVybiBtRHJvcERvd25BbHdheXNWaXNpYmxlOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIG9wZXJhdGluZyBtb2RlIGZvciB0aGUgc29mdCBpbnB1dCBhcmVhLgorICAgICAqCisgICAgICogQHBhcmFtIG1vZGUgVGhlIGRlc2lyZWQgbW9kZSwgc2VlCisgICAgICogICAgICAgIHtAbGluayBhbmRyb2lkLnZpZXcuV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMjc29mdElucHV0TW9kZX0KKyAgICAgKiAgICAgICAgZm9yIHRoZSBmdWxsIGxpc3QKKyAgICAgKgorICAgICAqIEBzZWUgYW5kcm9pZC52aWV3LldpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zI3NvZnRJbnB1dE1vZGUKKyAgICAgKiBAc2VlICNnZXRTb2Z0SW5wdXRNb2RlKCkKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRTb2Z0SW5wdXRNb2RlKGludCBtb2RlKSB7CisgICAgICAgIG1Qb3B1cC5zZXRTb2Z0SW5wdXRNb2RlKG1vZGUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGN1cnJlbnQgdmFsdWUgaW4ge0BsaW5rICNzZXRTb2Z0SW5wdXRNb2RlKGludCl9LgorICAgICAqCisgICAgICogQHNlZSAjc2V0U29mdElucHV0TW9kZShpbnQpCisgICAgICogQHNlZSBhbmRyb2lkLnZpZXcuV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMjc29mdElucHV0TW9kZQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0U29mdElucHV0TW9kZSgpIHsKKyAgICAgIC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hbmltYXRpb25TdHlsZSBBbmltYXRpb24gc3R5bGUgdG8gdXNlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEFuaW1hdGlvblN0eWxlKGludCBhbmltYXRpb25TdHlsZSkgeworICAgICAgICBtUG9wdXAuc2V0QW5pbWF0aW9uU3R5bGUoYW5pbWF0aW9uU3R5bGUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGFuaW1hdGlvbiBzdHlsZSB0aGF0IHdpbGwgYmUgdXNlZCB3aGVuIHRoZSBwb3B1cCB3aW5kb3cgaXMKKyAgICAgKiBzaG93biBvciBkaXNtaXNzZWQuCisgICAgICogCisgICAgICogQHJldHVybiBBbmltYXRpb24gc3R5bGUgdGhhdCB3aWxsIGJlIHVzZWQuCisgICAgICovCisgICAgcHVibGljIGludCBnZXRBbmltYXRpb25TdHlsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5nZXRBbmltYXRpb25TdHlsZSgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIHZpZXcgdGhhdCB3aWxsIGJlIHVzZWQgdG8gYW5jaG9yIHRoaXMgcG9wdXAuCisgICAgICogCisgICAgICogQHJldHVybiBUaGUgcG9wdXAncyBhbmNob3IgdmlldworICAgICAqLworICAgIHB1YmxpYyBWaWV3IGdldEFuY2hvclZpZXcoKSB7CisgICAgICAgIHJldHVybiBtRHJvcERvd25BbmNob3JWaWV3OworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIHBvcHVwJ3MgYW5jaG9yIHZpZXcuIFRoaXMgcG9wdXAgd2lsbCBhbHdheXMgYmUgcG9zaXRpb25lZCByZWxhdGl2ZSB0bworICAgICAqIHRoZSBhbmNob3IgdmlldyB3aGVuIHNob3duLgorICAgICAqIAorICAgICAqIEBwYXJhbSBhbmNob3IgVGhlIHZpZXcgdG8gdXNlIGFzIGFuIGFuY2hvci4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRBbmNob3JWaWV3KFZpZXcgYW5jaG9yKSB7CisgICAgICAgIG1Ecm9wRG93bkFuY2hvclZpZXcgPSBhbmNob3I7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgaG9yaXpvbnRhbCBvZmZzZXQgb2YgdGhlIHBvcHVwIGZyb20gaXRzIGFuY2hvciBpbiBwaXhlbHMuCisgICAgICovCisgICAgcHVibGljIGludCBnZXRIb3Jpem9udGFsT2Zmc2V0KCkgeworICAgICAgICByZXR1cm4gbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXQgdGhlIGhvcml6b250YWwgb2Zmc2V0IG9mIHRoaXMgcG9wdXAgZnJvbSBpdHMgYW5jaG9yIHZpZXcgaW4gcGl4ZWxzLgorICAgICAqIAorICAgICAqIEBwYXJhbSBvZmZzZXQgVGhlIGhvcml6b250YWwgb2Zmc2V0IG9mIHRoZSBwb3B1cCBmcm9tIGl0cyBhbmNob3IuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0SG9yaXpvbnRhbE9mZnNldChpbnQgb2Zmc2V0KSB7CisgICAgICAgIG1Ecm9wRG93bkhvcml6b250YWxPZmZzZXQgPSBvZmZzZXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgdmVydGljYWwgb2Zmc2V0IG9mIHRoZSBwb3B1cCBmcm9tIGl0cyBhbmNob3IgaW4gcGl4ZWxzLgorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0VmVydGljYWxPZmZzZXQoKSB7CisgICAgICAgIHJldHVybiBtRHJvcERvd25WZXJ0aWNhbE9mZnNldDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXQgdGhlIHZlcnRpY2FsIG9mZnNldCBvZiB0aGlzIHBvcHVwIGZyb20gaXRzIGFuY2hvciB2aWV3IGluIHBpeGVscy4KKyAgICAgKiAKKyAgICAgKiBAcGFyY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gaW5mb3JtYXRpb25hbCBwcm9tcHQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0UHJvbXB0VmlldyhWaWV3IHByb21wdCkgeworICAgICAgICBib29sZWFuIHNob3dpbmcgPSBpc1Nob3dpbmcoKTsKKyAgICAgICAgaWYgKHNob3dpbmcpIHsKKyAgICAgICAgICAgIHJlbW92ZVByb21wdFZpZXcoKTsKKyAgICAgICAgfQorICAgICAgICBtUHJvbXB0VmlldyA9IHByb21wdDsKKyAgICAgICAgaWYgKHNob3dpbmcpIHsKKyAgICAgICAgICAgIHNob3coKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFBvc3QgYSB7QGxpbmsgI3Nob3coKX0gY2FsbCB0byB0aGUgVUkgdGhyZWFkLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHBvc3RTaG93KCkgeworICAgICAgICBtSGFuZGxlci5wb3N0KG1TaG93RHJvcERvd25SdW5uYWJsZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2hvdyB0aGUgcG9wdXAgbGlzdC4gSWYgdGhlIGxpc3QgaXMgYWxyZWFkeSBzaG93aW5nLCB0aGlzIG1ldGhvZAorICAgICAqIHdpbGwgcmVjYWxjdWxhdGUgdGhlIHBvcHVwJ3Mgc2l6ZSBhbmQgcG9zaXRpb24uCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2hvdygpIHsKKyAgICAgICAgaW50IGhlaWdodCA9IGJ1aWxkRHJvcERvd24oKTsKKworICAgICAgICBpbnQgd2lkdGhTcGVjID0gMDsKKyAgICAgICAgaW50IGhlaWdodFNwZWMgPSAwOworCisgICAgICAgIGJvb2xlYW4gbm9JbnB1dE1ldGhvZCA9IGlzSW5wdXRNZXRob2ROb3ROZWVkZWQoKTsKKworICAgICAgICBpZiAobVBvcHVwLmlzU2hvd2luZygpKSB7CisgICAgICAgICAgICBpZiAobURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpIHsKKyAgICAgICAgICAgICAgICAvLyBUaGUgY2FsbCB0byBQb3B1cFdpbmRvdydzIHVwZGF0ZSBtZXRob2QgYmVsb3cgY2FuIGFjY2VwdCAtMSBmb3IgYW55CisgICAgICAgICAgICAgICAgLy8gdmFsdWUgeW91IGRvIG5vdCB3YW50IHRvIHVwZGF0ZS4KKyAgICAgICAgICAgICAgICB3aWR0aFNwZWMgPSAtMTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpIHsKKyAgICAgICAgICAgICAgICB3aWR0aFNwZWMgPSBnZXRBbmNob3JWaWV3KCkuZ2V0V2lkdGgoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgd2lkdGhTcGVjID0gbURyb3BEb3duV2lkdGg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtRHJvcERvd25IZWlnaHQgPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpIHsKKyAgICAgICAgICAgICAgICAvLyBUaGUgY2FsbCB0byBQb3B1cFdpbmRvdydzIHVwZGF0ZSBtZXRob2QgYmVsb3cgY2FuIGFjY2VwdCAtMSBmb3IgYW55CisgICAgICAgICAgICAgICAgLy8gdmFsdWUgeW91IGRvIG5vdCB3YW50IHRvIHVwZGF0ZS4KKyAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gbm9JbnB1dE1ldGhvZCA/IGhlaWdodCA6IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UOworICAgICAgICAgICAgICAgIGlmIChub0lucHV0TWV0aG9kKSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaW5kb3dMYXlvdXRNb2RlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UIDogMCwgMCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldFdpbmRvd0xheW91dE1vZGUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQgPworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQgOiAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1Ecm9wRG93bkhlaWdodCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCkgeworICAgICAgICAgICAgICAgIGhlaWdodFNwZWMgPSBoZWlnaHQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGhlaWdodFNwZWMgPSBtRHJvcERvd25IZWlnaHQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1Qb3B1cC5zZXRPdXRzaWRlVG91Y2hhYmxlKCFtRm9yY2VJZ25vcmVPdXRzaWRlVG91Y2ggJiYgIW1Ecm9wRG93bkFsd2F5c1Zpc2libGUpOworCisgICAgICAgICAgICBtUG9wdXAudXBkYXRlKGdldEFuY2hvclZpZXcoKSwgbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duVmVydGljYWxPZmZzZXQsIHdpZHRoU3BlYywgaGVpZ2h0U3BlYyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAobURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpIHsKKyAgICAgICAgICAgICAgICB3aWR0aFNwZWMgPSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaWR0aChnZXRBbmNob3JWaWV3KCkuZ2V0V2lkdGgoKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldFdpZHRoKG1Ecm9wRG93bldpZHRoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtRHJvcERvd25IZWlnaHQgPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpIHsKKyAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChtRHJvcERvd25IZWlnaHQgPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpIHsKKyAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldEhlaWdodChoZWlnaHQpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRIZWlnaHQobURyb3BEb3duSGVpZ2h0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1Qb3B1cC5zZXRXaW5kb3dMYXlvdXRNb2RlKHdpZHRoU3BlYywgaGVpZ2h0U3BlYyk7CisgICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9ORUVERUQpOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyB1c2Ugb3V0c2lkZSB0b3VjaGFibGUgdG8gZGlzbWlzcyBkcm9wIGRvd24gd2hlbiB0b3VjaGluZyBvdXRzaWRlIG9mIGl0LCBzbworICAgICAgICAgICAgLy8gb25seSBzZXQgdGhpcyBpZiB0aGUgZHJvcGRvd24gaXMgbm90IGFsd2F5cyB2aXNpYmxlCisgICAgICAgICAgICBtUG9wdXAuc2V0T3V0c2lkZVRvdWNoYWJsZSghbUZvcmNlSWdub3JlT3V0c2lkZVRvdWNoICYmICFtRHJvcERvd25BbHdheXNWaXNpYmxlKTsKKyAgICAgICAgICAgIG1Qb3B1cC5zZXRUb3VjaEludGVyY2VwdG9yKG1Ub3VjaEludGVyY2VwdG9yKTsKKyAgICAgICAgICAgIG1Qb3B1cC5zaG93QXNEcm9wRG93bihnZXRBbmNob3JWaWV3KCksCisgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bkhvcml6b250YWxPZmZzZXQsIG1Ecm9wRG93blZlcnRpY2FsT2Zmc2V0KTsKKyAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0U2VsZWN0aW9uKExpc3RWaWV3LklOVkFMSURfUE9TSVRJT04pOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoIW1Nb2RhbCB8fCBtRHJvcERvd25MaXN0LmlzSW5Ub3VjaE1vZGUoKSkgeworICAgICAgICAgICAgICAgIGNsZWFyTGlzdFNlbGVjdGlvbigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFtTW9kYWwpIHsKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5wb3N0KG1IaWRlU2VsZWN0b3IpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogRGlzbWlzcyB0aGUgcG9wdXAgd2luZG93LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGRpc21pc3MoKSB7CisgICAgICAgIG1Qb3B1cC5kaXNtaXNzKCk7CisgICAgICAgIHJlbW92ZVByb21wdFZpZXcoKTsKKyAgICAgICAgbVBvcHVwLnNldENvbnRlbnRWaWV3KG51bGwpOworICAgICAgICBtRHJvcERvd25MaXN0ID0gbnVsbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXQgYSBsaXN0ZW5lciB0byByZWNlaXZlIGEgY2FsbGJhY2sgd2hlbiB0aGUgcG9wdXAgaXMgZGlzbWlzc2VkLgorICAgICAqCisgICAgICogQHBhcmFtIGxpc3RlbmVyIExpc3RlbmVyIHRoYXQgd2lsbCBiZSBub3RpZmllZCB3aGVuIHRoZSBwb3B1cCBpcyBkaXNtaXNzZWQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0T25EaXNtaXNzTGlzdGVuZXIoUG9wdXBXaW5kb3cuT25EaXNtaXNzTGlzdGVuZXIgbGlzdGVuZXIpIHsKKyAgICAgICAgbVBvcHVwLnNldE9uRGlzbWlzc0xpc3RlbmVyKGxpc3RlbmVyKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVtb3ZlUHJvbXB0VmlldygpIHsKKyAgICAgICAgaWYgKG1Qcm9tcHRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZpbmFsIFZpZXdQYXJlbnQgcGFyZW50ID0gbVByb21wdFZpZXcuZ2V0UGFyZW50KCk7CisgICAgICAgICAgICBpZiAocGFyZW50IGluc3RhbmNlb2YgVmlld0dyb3VwKSB7CisgICAgICAgICAgICAgICAgZmluYWwgVmlld0dyb3VwIGdyb3VwID0gKFZpZXdHcm91cCkgcGFyZW50OworICAgICAgICAgICAgICAgIGdyb3VwLnJlbW92ZVZpZXcobVByb21wdFZpZXcpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29udHJvbCBob3cgdGhlIHBvcHVwIG9wZXJhdGVzIHdpdGggYW4gaW5wdXQgbWV0aG9kOiBvbmUgb2YKKyAgICAgKiB7QGxpbmsgI0lOUFVUX01FVEhPRF9GUk9NX0ZPQ1VTQUJMRX0sIHtAbGluayAjSU5QVVRfTUVUSE9EX05FRURFRH0sCisgICAgICogb3Ige0BsaW5rICNJTlBVVF9NRVRIT0RfTk9UX05FRURFRH0uCisgICAgICogCisgICAgICogPHA+SWYgdGhlIHBvcHVwIGlzIHNob3dpbmcsIGNhbGxpbmcgdGhpcyBtZXRob2Qgd2lsbCB0YWtlIGVmZmVjdCBvbmx5CisgICAgICogdGhlIG5leHQgdGltZSB0aGUgcG9wdXAgaXMgc2hvd24gb3IgdGhyb3VnaCBhIG1hbnVhbCBjYWxsIHRvIHRoZSB7QGxpbmsgI3Nob3coKX0KKyAgICAgKiBtZXRob2QuPC9wPgorICAgICAqIAorICAgICAqIEBzZWUgI2dldElucHV0TWV0aG9kTW9kZSgpCisgICAgICogQHNlZSAjc2hvdygpCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0SW5wdXRNZXRob2RNb2RlKGludCBtb2RlKSB7CisgICAgICAgIG1Qb3B1cC5zZXRJbnB1dE1ldGhvZE1vZGUobW9kZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJuIHRoZSBjdXJyZW50IHZhbHVlIGluIHtAbGluayAjc2V0SW5wdXRNZXRob2RNb2RlKGludCl9LgorICAgICAqIAorICAgICAqIEBzZWUgI3NldElucHV0TWV0aG9kTW9kZShpbnQpCisgICAgICovCisgICAgcHVibGljIGludCBnZXRJbnB1dE1ldGhvZE1vZGUoKSB7CisgICAgICAgIHJldHVybiBtUG9wdXAuZ2V0SW5wdXRNZXRob2RNb2RlKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHR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GlvbiBmb3IgcGVyZm9ybWluZyB0aGUgY2xpY2sKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIGNsaWNrIGFjdGlvbiBjb3VsZCBiZSBwZXJmb3JtZWQsIGZhbHNlIGlmIG5vdC4KKyAgICAgKiAgICAgICAgIChlLmcuIGlmIHRoZSBwb3B1cCB3YXMgbm90IHNob3dpbmcsIHRoaXMgbWV0aG9kIHdvdWxkIHJldHVybiBmYWxzZS4pCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gcGVyZm9ybUl0ZW1DbGljayhpbnQgcG9zaXRpb24pIHsKKyAgICAgICAgaWYgKGlzU2hvd2luZygpKSB7CisgICAgICAgICAgICBpZiAobUl0ZW1DbGlja0xpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBEcm9wRG93bkxpc3RWaWV3IGxpc3QgPSBtRHJvcERvd25MaXN0OworICAgICAgICAgICAgICAgIGZpbmFsIFZpZXcgY2hpbGQgPSBsaXN0LmdldENoaWxkQXQocG9zaXRpb24gLSBsaXN0LmdldEZpcnN0VmlzaWJsZVBvc2l0aW9uKCkpOworICAgICAgICAgICAgICAgIGZpbmFsIExpc3RBZGFwdGVyIGFkYXB0ZXIgPSBsaXN0LmdldEFkYXB0ZXIoKTsKKyAgICAgICAgICAgICAgICBtSXRlbUNsaWNrTGlzdGVuZXIub25JdGVtQ2xpY2sobGlzdCwgY2hpbGQsIHBvc2l0aW9uLCBhZGFwdGVyLmdldEl0ZW1JZChwb3NpdGlvbikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gVGhlIGN1cnJlbnRseSBzZWxlY3RlZCBpdGVtIG9yIG51bGwgaWYgdGhlIHBvcHVwIGlzIG5vdCBzaG93aW5nLgorICAgICAqLworICAgIHB1YmxpYyBPYm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pbmcoKSkgeworICAgICAgICAgICAgcmV0dXJuIExpc3RWaWV3LklOVkFMSURfUk9XX0lEOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkSXRlbUlkKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgVmlldyBmb3IgdGhlIGN1cnJlbnRseSBzZWxlY3RlZCBpdGVtIG9yIG51bGwgaWYKKyAgICAgKiB7QGxpbmsgI2lzU2hvd2luZygpfSA9PSB7QGNvZGUgZmFsc2V9LgorICAgICAqIAorICAgICAqIEBzZWUgTGlzdFZpZXcjZ2V0U2VsZWN0ZWRWaWV3KCkKKyAgICAgKi8KKyAgICBwdWJsaWMgVmlldyBnZXRTZWxlY3RlZFZpZXcoKSB7CisgICAgICAgIGlmICghaXNTaG93aW5nKCkpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkVmlldygpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gVGhlIHtAbGluayBMaXN0Vmlld30gZGlzcGxheWVkIHdpdGhpbiB0aGUgcG9wdXAgd2luZG93LgorICAgICAqIE9ubHkgdmFsaWQgd2hlbiB7QGxpbmsgI2lzU2hvd2luZygpfSA9PSB7QGNvZGUgdHJ1ZX0uCisgICAgICovCisgICAgcHVibGljIExpc3RWaWV3IGdldExpc3RWaWV3KCkgeworICAgICAgICByZXR1cm4gbURyb3BEb3duTGlzdDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBGaWx0ZXIga2V5IGRvd24gZXZlbnRzLiBCeSBmb3J3YXJkaW5nIGtleSB1cCBldmVudHMgdG8gdGhpcyBmdW5jdGlvbiwKKyAgICAgKiB2aWV3cyB1c2luZyBub24tbW9kYWwgTGlzdFBvcHVwV2luZG93IGNhbiBoYXZlIGl0IGhhbmRsZSBrZXkgc2VsZWN0aW9uI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lDT0RFX1NQQUNFCisgICAgICAgICAgICAgICAgICAgICYmIChtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCkgPj0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfRU5URVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUikpKSB7CisgICAgICAgICAgICAgICAgaW50IGN1ckluZGV4ID0gbURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpOworICAgICAgICAgICAgICAgIGJvb2xlYW4gY29uc3VtZWQ7CisKKyAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGJlbG93ID0gIW1Qb3B1cC5pc0Fib3ZlQW5jaG9yKCk7CisKKyAgICAgICAgICAgICAgICBmaW5hbCBMaXN0QWRhcHRlciBhZGFwdGVyID0gbUFkYXB0ZXI7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgYm9vbGVhbiBhbGxFbmFibGVkOworICAgICAgICAgICAgICAgIGludCBmaXJzdEl0ZW0gPSBJbnRlZ2VyLk1BWF9WQUxVRTsKKyAgICAgICAgICAgICAgICBpbnQgbGFzdEl0ZW0gPSBJbnRlZ2VyLk1JTl9WQUxVRTsKKworICAgICAgICAgICAgICAgIGlmIChhZGFwdGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYWxsRW5hYmxlZCA9IGFkYXB0ZXIuYXJlQWxsSXRlbXNFbmFibGVkKCk7CisgICAgICAgICAgICAgICAgICAgIGZpcnN0SXRlbSA9IGFsbEVuYWJsZWQgPyAwIDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0Lmxvb2tGb3JTZWxlY3RhYmxlUG9zaXRpb24oMCwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIGxhc3RJdGVtID0gYWxsRW5hYmxlZCA/IGFkYXB0ZXIuZ2V0Q291bnQoKSAtIDEgOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3QubG9va0ZvclNlbGVjdGFibGVQb3NpdGlvbihhZGFwdGVyLmdldENvdW50KCkgLSAxLCBmYWxzZSk7ICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYgKChiZWxvdyAmJiBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCAmJiBjdXJJbmRleCA8PSBmaXJzdEl0ZW0pIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAoIWJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0RPV04gJiYgY3VySW5kZXggPj0gbGFzdEl0ZW0pKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gdGhlIHNlbGVjdGlvbiBpcyBhdCB0aGUgdG9wLCB3ZSBibG9jayB0aGUga2V5CisgICAgICAgICAgICAgICAgICAgIC8vIGV2ZW50IHRvIHByZXZlbnQgZm9jdXMgZnJvbSBtb3ZpbmcuCisgICAgICAgICAgICAgICAgICAgIGNsZWFyTGlzdFNlbGVjdGlvbigpOworICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9ORUVERUQpOworICAgICAgICAgICAgICAgICAgICBzaG93KCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFdBUk5JTkc6IFBsZWFzZSByZWFkIHRoZSBjb21tZW50IHdoZXJlIG1MaXN0U2VsZWN0aW9uSGlkZGVuCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgIGlzIGRlY2xhcmVkCisgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3QubUxpc3RTZWxlY3Rpb25IaWRkZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjb25zdW1lZCA9IG1Ecm9wRG93bkxpc3Qub25LZXlEb3duKGtleUNvZGUsIGV2ZW50KTsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIktleSBkb3duOiBjb2RlPSIgKyBrZXlDb2RlICsgIiBsaXN0IGNvbnN1bWVkPSIgKyBjb25zdW1lZCk7CisKKyAgICAgICAgICAgICAgICBpZiAoY29uc3VtZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgaXQgaGFuZGxlZCB0aGUga2V5IGV2ZW50LCB0aGVuIHRoZSB1c2VyIGlzCisgICAgICAgICAgICAgICAgICAgIC8vIG5hdmlnYXRpbmcgaW4gdGhlIGxpc3QsIHNvIHdlIHNob3VsZCBwdXQgaXQgaW4gZnJvbnQuCisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRJbnB1dE1ldGhvZE1vZGUoUG9wdXBXaW5kb3cuSU5QVVRfTUVUSE9EX05PVF9ORUVERUQpOworICAgICAgICAgICAgICAgICAgICAvLyBIZXJlJ3MgYSBsaXR0bGUgdHJpY2sgd2UgbmVlZCB0byBkbyB0byBtYWtlIHN1cmUgdGhhdAorICAgICAgICAgICAgICAgICAgICAvLyB0aGUgbGlzdCB2aWV3IGlzIGFjdHVhbGx5IHNob3dpbmcgaXRzIGZvY3VzIGluZGljYXRvciwKKyAgICAgICAgICAgICAgICAgICAgLy8gYnkgZW5zdXJpbmcgaXQgaGFzIGZvY3VzIGFuZCBnZXR0aW5nIGl0cyB3aW5kb3cgb3V0CisgICAgICAgICAgICAgICAgICAgIC8vIG9mIHRvdWNoIG1vZGUuCisgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3QucmVxdWVzdEZvY3VzRnJvbVRvdWNoKCk7CisgICAgICAgICAgICAgICAgICAgIHNob3coKTsKKworICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGF2b2lkIHBhc3NpbmcgdGhlIGZvY3VzIGZyb20gdGhlIHRleHQgdmlldyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5leHQgY29tcG9uZW50CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRU5URVI6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVI6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9ET1dOOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoYmVsb3cgJiYga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTikgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2hlbiB0aGUgc2VsZWN0aW9uIGlzIGF0IHRoZSBib3R0b20sIHdlIGJsb2NrIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXZlbnQgdG8gYXZvaWQgZ29pbmcgdG8gdGhlIG5leHQgZm9jdXNhYmxlIHdpZGdldAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1ckluZGV4ID09IGxhc3RJdGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VySW5kZXggPT0gZmlyc3RJdGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBGaWx0ZXIga2V5IGRvd24gZXZlbnRzLiBCeSBmb3J3YXJkaW5nIGtleSB1cCBldmVudHMgdG8gdGhpcyBmdW5jdGlvbiwKKyAgICAgKiB2aWV3cyB1c2luZyBub24tbW9kYWwgTGlzdFBvcHVwV2luZG93IGNhbiBoYXZlIGl0IGhhbmRsZSBrZXkgc2VsZWN0aW9uIG9mIGl0ZW1zLgorICAgICAqICAKKyAgICAgKiBAcGFyYW0ga2V5Q29kZSBrZXlDb2RlIHBhcmFtIHBhc3NlZCB0byB0aGUgaG9zdCB2aWV3J3Mgb25LZXlVcAorICAgICAqIEBwYXJhbSBldmVudCBldmVudCBwYXJhbSBwYXNzZWQgdG8gdGhlIGhvc3QgdmlldydzIG9uS2V5VXAKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIGV2ZW50IHdhcyBoYW5kbGVkLCBmYWxzZSBpZiBpdCB3YXMgaWdub3JlZC4KKyAgICAgKiAKKyAgICAgKiBAc2VlICNzZXRNb2RhbChib29sZWFuKQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIG9uS2V5VXAoaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50KSB7CisgICAgICAgIGlmIChpc1Nob3dpbmcoKSAmJiBtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCkgPj0gMCkgeworICAgICAgICAgICAgYm9vbGVhbiBjb25zdW1lZCA9IG1Ecm9wRG93bkxpc3Qub25LZXlVcChrZXlDb2RlLCBldmVudCk7CisgICAgICAgICAgICBpZiAoY29uc3VtZWQpIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIGxpc3QgYWNjZXB0cyB0aGUga2V5IGV2ZW50cyBhbmQgdGhlIGtleSBldmVudAorICAgICAgICAgICAgICAgICAgICAvLyB3YXMgYSBjbGljaywgdGhlIHRleHQgdmlldyBnZXRzIHRoZSBzZWxlY3RlZCBpdGVtCisgICAgICAgICAgICAgICAgICAgIC8vIGZyb20gdGhlIGRyb3AgZG93biBhcyBpdHMgY29udGVudAorICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRU5URVI6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUjoKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpc21pc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBjb25zdW1lZDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogRmlsdGVyIHByZS1JTUUga2V5IGV2ZW50cy4gQnkgZm9yd2FyZGluZyB7QGxpbmsgVmlldyNvbktleVByZUltZShpbnQsIEtleUV2ZW50KX0KKyAgICAgKiBldmVudHMgdG8gdGhpcyBmdW5jdGlvbiwgdmlld3MgdXNpbmcgTGlzdFBvcHVwV2luZG93IGNhbiBoYXZlIGl0IGRpc21pc3MgdGhlIHBvcHVwCisgICAgICogd2hlbiB0aGUgYmFjayBrZXkgaXMgcHJlc3NlZC4KKyAgICAgKiAgCisgICAgICogQHBhcmFtIGtleUNvZGUga2V5Q29kZ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eworICAgICAgICAgICAgICAgIGFuY2hvclZpZXcuZ2V0S2V5RGlzcGF0Y2hlclN0YXRlKCkuaGFuZGxlVXBFdmVudChldmVudCk7CisgICAgICAgICAgICAgICAgaWYgKGV2ZW50LmlzVHJhY2tpbmcoKSAmJiAhZXZlbnQuaXNDYW5jZWxlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIGRpc21pc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiA8cD5CdWlsZHMgdGhlIHBvcHVwIHdpbmRvdydzIGNvbnRlbnQgYW5kIHJldHVybnMgdGhlIGhlaWdodCB0aGUgcG9wdXAKKyAgICAgKiBzaG91bGQgaGF2ZS4gUmV0dXJucyAtMSB3aGVuIHRoZSBjb250ZW50IGFscmVhZHkgZXhpc3RzLjwvcD4KKyAgICAgKgorICAgICAqIEByZXR1cm4gdGhlIGNvbnRlbnQncyBoZWlnaHQgb3IgLTEgaWYgY29udGVudCBhbHJlYWR5IGV4aXN0cworICAgICAqLworICAgIHByaXZhdGUgaW50IGJ1aWxkRHJvcERvd24oKSB7CisgICAgICAgIFZpZXdHcm91cCBkcm9wRG93blZpZXc7CisgICAgICAgIGludCBvdGhlckhlaWdodHMgPSAwOworCisgICAgICAgIGlmIChtRHJvcERvd25MaXN0ID09IG51bGwpIHsKKyAgICAgICAgICAgIENvbnRleHQgY29udGV4dCA9IG1Db250ZXh0OworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoaXMgUnVubmFibGUgZXhpc3RzIGZvciB0aGUgc29sZSBwdXJwb3NlIG9mIGNoZWNraW5nIGlmIHRoZSB2aWV3IGxheW91dCBoYXMgZ290CisgICAgICAgICAgICAgKiBjb21wbGV0ZWQgYW5kIGlmIHNvIGNhbGwgc2hvd0Ryb3BEb3duIHRvIGRpc3BsYXkgdGhlIGRyb3AgZG93bi4gVGhpcyBpcyB1c2VkIHRvIHNob3cKKyAgICAgICAgICAgICAqIHRoZSBkcm9wIGRvd24gYXMgc29vbiBhcyBwb3NzaWJsZSBhZnRlciB1c2VyIG9wZW5zIHVwIHRoZSBzZWFyY2ggZGlhbG9nLCB3aXRob3V0CisgICAgICAgICAgICAgKiB3YWl0aW5nIGZvciB0aGUgbm9ybWFsIFVJIHBpcGVsaW5lIHRvIGRvIGl0J3Mgam9iIHdoaWNoIGlzIHNsb3dlciB0aGFuIHRoaXMgbWV0aG9kLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBtU2hvd0Ryb3BEb3duUnVubmFibGUgPSBuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICAvLyBWaWV3IGxheW91dCBzaG91bGQgYmUgYWxsIGRvbmUgYmVmb3JlIGRpc3BsYXlpbmcgdGhlIGRyb3AgZG93bi4KKyAgICAgICAgICAgICAgICAgICAgVmlldyB2aWV3ID0gZ2V0QW5jaG9yVmlldygpOworICAgICAgICAgICAgICAgICAgICBpZiAodmlldyAhPSBudWxsICYmIHZpZXcuZ2V0V2luZG93VG9rZW4oKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzaG93KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBtRHJvcERvd25MaXN0ID0gbmV3IERyb3BEb3duTGlzdFZpZXcoY29udGV4dCwgIW1Nb2RhbCk7CisgICAgICAgICAgICBpZiAobURyb3BEb3duTGlzdEhpZ2hsaWdodCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRTZWxlY3RvcihtRHJvcERvd25MaXN0SGlnaGxpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0QWRhcHRlcihtQWRhcHRlcik7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldFZlcnRpY2FsRmFkaW5nRWRnZUVuYWJsZWQodHJ1ZSk7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uSXRlbUNsaWNrTGlzdGVuZXIobUl0ZW1DbGlja0xpc3RlbmVyKTsKKyAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0Rm9jdXNhYmxlKHRydWUpOworICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRGb2N1c2FibGVJblRvdWNoTW9kZSh0cnVlKTsKKyAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0T25JdGVtU2VsZWN0ZWRMaXN0ZW5lcihuZXcgQWRhcHRlclZpZXcuT25JdGVtU2VsZWN0ZWRMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkl0ZW1TZWxlY3RlZChBZGFwdGVyVmlldzw/PiBwYXJlbnQsIFZpZXcgdmlldywKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBwb3NpdGlvbiwgbG9uZyBpZCkgeworCisgICAgICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiAhPSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgRHJvcERvd25MaXN0VmlldyBkcm9wRG93bkxpc3QgPSBtRHJvcERvd25MaXN0OworCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZHJvcERvd25MaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcm9wRG93bkxpc3QubUxpc3RTZWxlY3Rpb25IaWRkZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uTm90aGluZ1NlbGVjdGVkKEFkYXB0ZXJWaWV3PD8+IHBhcmVudCkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRPblNjcm9sbExpc3RlbmVyKG1TY3JvbGxMaXN0ZW5lcik7CisKKyAgICAgICAgICAgIGlmIChtSXRlbVNlbGVjdGVkTGlzdGVuZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0T25JdGVtU2VsZWN0ZWRMaXN0ZW5lcihtSXRlbVNlbGVjdGVkTGlzdGVuZXIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBkcm9wRG93blZpZXcgPSBtRHJvcERvd25MaXN0OworCisgICAgICAgICAgICBWaWV3IGhpbnRWaWV3ID0gbVByb21wdFZpZXc7CisgICAgICAgICAgICBpZiAoaGludFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIC8vIGlmIGFuIGhpbnQgaGFzIGJlZW4gc3BlY2lmaWVkLCB3ZSBhY2NvbW9kYXRlIG1vcmUgc3BhY2UgZm9yIGl0IGFuZAorICAgICAgICAgICAgICAgIC8vIGFkZCBhIHRleHQgdmlldyBpbiB0aGUgZHJvcCBkb3duIG1lbnUsIGF0IHRoZSBib3R0b20gb2YgdGhlIGxpc3QKKyAgICAgICAgICAgICAgICBMaW5lYXJMYXlvdXQgaGludENvbnRhaW5lciA9IG5ldyBMaW5lYXJMYXlvdXQoY29udGV4dCk7CisgICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5zZXRPcmllbnRhdGlvbihMaW5lYXJMYXlvdXQuVkVSVElDQUwpOworCisgICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcyBoaW50UGFyYW1zID0gbmV3IExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMoCisgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCwgMCwgMS4wZgorICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgc3dpdGNoIChtUHJvbXB0UG9zaXRpb24pIHsKKyAgICAgICAgICAgICAgICBjYXNlIFBPU0lUSU9OX1BST01QVF9CRUxPVzoKKyAgICAgICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5hZGRWaWV3KGRyb3BEb3duVmlldywgaGludFBhcmFtcyk7CisgICAgICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuYWRkVmlldyhoaW50Vmlldyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBjYXNlIFBPU0lUSU9OX1BST01QVF9BQk9WRToKKyAgICAgICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5hZGRWaWV3KGhpbnRWaWV3KTsKKyAgICAgICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5hZGRWaWV3KGRyb3BEb3duVmlldywgaGludFBhcmFtcyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJJbnZhbGlkIGhpbnQgcG9zaXRpb24gIiArIG1Qcm9tcHRQb3NpdGlvbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIG1lYXN1cmUgdGhlIGhpbnQncyBoZWlnaHQgdG8gZmluZCBob3cgbXVjaCBtb3JlIHZlcnRpY2FsIHNwYWNlCisgICAgICAgICAgICAgICAgLy8gd2UgbmVlZCB0byBhZGQgdG8gdGhlIGRyb3AgZG93bidzIGhlaWdodAorICAgICAgICAgICAgICAgIGludCB3aWR0aFNwZWMgPSBNZWFzdXJlU3BlYy5tYWtlTWVhc3VyZVNwZWMobURyb3BEb3duV2lkdGgsIE1lYXN1cmVTcGVjLkFUX01PU1QpOworICAgICAgICAgICAgICAgIGludCBoZWlnaHRTcGVjID0gTWVhc3VyZVNwZWMuVU5TUEVDSUZJRUQ7CisgICAgICAgICAgICAgICAgaGludFZpZXcubWVhc3VyZSh3aWR0aFNwZWMsIGhlaWdodFNwZWMpOworCisgICAgICAgICAgICAgICAgaGludFBhcmFtcyA9IChMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zKSBoaW50Vmlldy5nZXRMYXlvdXRQYXJhbXMoKTsKKyAgICAgICAgICAgICAgICBvdGhlckhlaWdodHMgPSBoaW50Vmlldy5nZXRNZWFzdXJlZEhlaWdodCgpICsgaGludFBhcmFtcy50b3BNYXJnaW4KKyAgICAgICAgICAgICAgICAgICAgICAgICsgaGludFBhcmFtcy5ib3R0b21NYXJnaW47CisKKyAgICAgICAgICAgICAgICBkcm9wRG93blZpZXcgPSBoaW50Q29udGFpbmVyOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtUG9wdXAuc2V0Q29udGVudFZpZXcoZHJvcERvd25WaWV3KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGRyb3BEb3duVmlldyA9IChWaWV3R3JvdXApIG1Qb3B1cC5nZXRDb250ZW50VmlldygpOworICAgICAgICAgICAgZmluYWwgVmlldyB2aWV3ID0gbVByb21wdFZpZXc7CisgICAgICAgICAgICBpZiAodmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcyBoaW50UGFyYW1zID0KKyAgICAgICAgICAgICAgICAgICAgICAgIChMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zKSB2aWV3LmdldExheW91dFBhcmFtcygpOworICAgICAgICAgICAgICAgIG90aGVySGVpZ2h0cyA9IHZpZXcuZ2V0TWVhc3VyZWRIZWlnaHQoKSArIGhpbnRQYXJhbXMudG9wTWFyZ2luCisgICAgICAgICAgICAgICAgICAgICAgICArIGhpbnRQYXJhbXMuYm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AgICAgICBwcml2YXRlIGJvb2xlYW4gbUxpc3RTZWxlY3Rpb25IaWRkZW47CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogVHJ1ZSBpZiB0aGlzIHdyYXBwZXIgc2hvdWxkIGZha2UgZm9jdXMuCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUhpamFja0ZvY3VzOworCisgICAgICAgIC8qKgorICAgICAgICAgKiA8cD5DcmVhdGVzIGEgbmV3IGxpc3QgdmlldyB3cmFwcGVyLjwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGNvbnRleHQgdGhpcyB2aWV3J3MgY29udGV4dAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIERyb3BEb3duTGlzdFZpZXcoQ29udGV4dCBjb250ZXh0LCBib29sZWFuIGhpamFja0ZvY3VzKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCBudWxsLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmF0dHIuZHJvcERvd25MaXN0Vmlld1N0eWxlKTsKKyAgICAgICAgICAgIG1IaWphY2tGb2N1cyA9IGhpamFja0ZvY3VzOworICAgICAgICAgICAgLy8gVE9ETzogQWRkIGFuIEFQSSB0byBjb250cm9sIHRoaXMKKyAgICAgICAgICAgIHNldENhY2hlQ29sb3JIaW50KDApOyAvLyBUcmFuc3BhcmVudCwgc2luY2UgdGhlIGJhY2tncm91bmQgZHJhd2FibGUgY291bGQgYmUgYW55dGhpbmcuCisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+QXZvaWRzIGphcnJpbmcgc2Nyb2xsaW5nIGVmZmVjdCBieSBlbnN1cmluZyB0aGF0IGxpc3QgZWxlbWVudHMKKyAgICAgICAgICogbWFkZSBvZiBhIHRleHQgdmlldyBmaXQgb24gYSBzaW5nbGUgbGluZS48L3A+CisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBwb3NpdGlvbiB0aGUgaXRlbSBpbmRleCBpbiB0aGUgbGlzdCB0byBnZXQgYSB2aWV3IGZvcgorICAgICAgICAgKiBAcmV0dXJuIHRoZSB2aWV3IGZvciB0aGUgc3BlY2lmaWVkIGl0ZW0KKyAgICAgICAgICovCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBWaWV3IG9idGFpblZpZXcoaW50IHBvc2l0aW9uLCBib29sZWFuW10gaXNTY3JhcCkgeworICAgICAgICAgICAgVmlldyB2aWV3ID0gc3VwZXIub2J0YWluVmlldyhwb3NpdGlvbiwgaXNTY3JhcCk7CisKKyAgICAgICAgICAgIGlmICh2aWV3IGluc3RhbmNlb2YgVGV4dFZpZXcpIHsKKyAgICAgICAgICAgICAgICAoKFRleHRWaWV3KSB2aWV3KS5zZXRIb3Jpem9udGFsbHlTY3JvbGxpbmcodHJ1ZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiB2aWV3OworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzSW5Ub3VjaE1vZGUoKSB7CisgICAgICAgICAgICAvLyBXQVJOSU5HOiBQbGVhc2UgcmVhZCB0aGUgY29tbWVudCB3aGVyZSBtTGlzdFNlbGVjdGlvbkhpZGRlbiBpcyBkZWNsYXJlZAorICAgICAgICAgICAgcmV0dXJuIChtSGlqYWNrRm9jdXMgJiYgbUxpc3RTZWxlY3Rpb25IaWRkZW4pIHx8IHN1cGVyLmlzSW5Ub3VjaE1vZGUoKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiA8cD5SZXR1cm5zIHRoZSBmb2N1cyBzdGF0ZSBpbiB0aGUgZHJvcCBkb3duLjwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiB0cnVlIGFsd2F5cyBpZiBoaWphY2tpbmcgZm9jdXMKKyAgICAgICAgICovCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNXaW5kb3dGb2N1cygpIHsKKyAgICAgICAgICAgIHJldHVybiBtSGlqYWNrRm9jdXMgfHwgc3VwZXIuaGFzV2luZG93Rm9jdXMoKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiA8cD5SZXR1cm5zIHRoZSBmb2N1cyBzdGF0ZSBpbiB0aGUgZHJvcCBkb3duLjwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiB0cnVlIGFsd2F5cyBpZiBoaWphY2tpbmcgZm9jdXMKKyAgICAgICAgICovCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc0ZvY3VzZWQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUhpamFja0ZvY3VzIHx8IHN1cGVyLmlzRm9jdXNlZCgpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPlJldHVybnMgdGhlIGZvY3VzIHN0YXRlIGluIHRoZSBkcm9wIGRvd24uPC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIHRydWUgYWx3YXlzIGlmIGhpamFja2luZyBmb2N1cworICAgICAgICAgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGhhc0ZvY3VzKCkgeworICAgICAgICAgICAgcmV0dXJuIG1IaWphY2tGb2N1cyB8fCBzdXBlci5oYXNGb2N1cygpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBQb3B1cERhdGFTZXRPYnNlcnZlciBleHRlbmRzIERhdGFTZXRPYnNlcnZlciB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkNoYW5nZWQoKSB7CisgICAgICAgICAgICBpZiAoaXNTaG93aW5nKCkpIHsKKyAgICAgICAgICAgICAgICAvLyBSZXNpemUgdGhlIHBvcHVwIHRvIGZpdCBuZXcgY29udGVudAorICAgICAgICAgICAgICAgIHNob3coKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uSW52YWxpZGF0ZWQoKSB7CisgICAgICAgICAgICBkaXNtaXNzKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIExpc3RTZWxlY3RvckhpZGVyIGltcGxlbWVudHMgUnVubmFibGUgeworICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICBjbGVhckxpc3RTZWxlY3Rpb24oKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgUmVzaXplUG9wdXBSdW5uYWJsZSBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgbVBvcHVwLnNldElucHV0TWV0aG9kTW9kZShQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTk9UX05FRURFRCk7CisgICAgICAgICAgICBzaG93KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFBvcHVwVG91Y2hJbnRlcmNlcHRvciBpbXBsZW1lbnRzIE9uVG91Y2hMaXN0ZW5lciB7CisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2goVmlldyB2LCBNb3Rpb25FdmVudCBldmVudCkgeworICAgICAgICAgICAgZmluYWwgaW50IGFjdGlvbiA9IGV2ZW50LmdldEFjdGlvbigpOworICAgICAgICAgICAgZmluYWwgaW50IHggPSAoaW50KSBldmVudC5nZXRYKCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgeSA9IChpbnQpIGV2ZW50LmdldFkoKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTiAmJgorICAgICAgICAgICAgICAgICAgICBtUG9wdXAgIT0gbnVsbCAmJiBtUG9wdXAuaXNTaG93aW5nKCkgJiYKKyAgICAgICAgICAgICAgICAgICAgKHggPj0gMCAmJiB4IDwgZ2V0V2lkdGgoKSAmJiB5ID49IDAgJiYgeSA8IGdldEhlaWdodCgpKSkgeworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnBvc3REZWxheWVkKG1SZXNpemVQb3B1cFJ1bm5hYmxlLCBFWFBBTkRfTElTVF9USU1FT1VUKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9VUCkgeworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtUmVzaXplUG9wdXBSdW5uYWJsZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFBvcHVwU2Nyb2xsTGlzdGVuZXIgaW1wbGVtZW50cyBMaXN0Vmlldy5PblNjcm9sbExpc3RlbmVyIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25TY3JvbGwoQWJzTGlzdFZpZXcgdmlldywgaW50IGZpcnN0VmlzaWJsZUl0ZW0sIGludCB2aXNpYmxlSXRlbUNvdW50LAorICAgICAgICAgICAgICAgIGludCB0b3RhbEl0ZW1Db3VudCkgeworCisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblNjcm9sbFN0YXRlQ2hhbmdlZChBYnNMaXN0VmlldyB2aWV3LCBpbnQgc2Nyb2xsU3RhdGUpIHsKKyAgICAgICAgICAgIGlmIChzY3JvbGxTdGF0ZSA9PSBTQ1JPTExfU1RBVEVfVE9VQ0hfU0NST0xMICYmCisgICAgICAgICAgICAgICAgICAgICFpc0lucHV0TWV0aG9kTm90TmVlZGVkKCkgJiYgbVBvcHVwLmdldENvbnRlbnRWaWV3KCkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1IY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0lPTl9DT0RFUy5IT05FWUNPTUIpIHsKKyAgICAgICAgICAgICAgICBjaGlsZC5zZXRBY3RpdmF0ZWQobUNoZWNrU3RhdGVzLmdldChwb3NpdGlvbikpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTI5NjAsNTIgKzI5NDEsMTQgQEAKICAgICAgICAgfQogICAgICAgICBzdXBlci5zZXRDYWNoZUNvbG9ySGludChjb2xvcik7CiAgICAgfQotCi0gICAgdm9pZCBkcmF3T3ZlcnNjcm9sbEhlYWRlcihDYW52YXMgY2FudmFzLCBEcmF3YWJsZSBkcmF3YWJsZSwgUmVjdCBib3VuZHMpIHsKLSAgICAgICAgZmluYWwgaW50IGhlaWdodCA9IGRyYXdhYmxlLmdldE1pbmltdW1IZWlnaHQoKTsKLQotICAgICAgICBjYW52YXMuc2F2ZSgpOwotICAgICAgICBjYW52YXMuY2xpcFJlY3QoYm91bmRzKTsKLQotICAgICAgICBmaW5hbCBpbnQgc3BhbiA9IGJvdW5kcy5ib3R0b20gLSBib3VuZHMudG9wOwotICAgICAgICBpZiAoc3BhbiA8IGhlaWdodCkgewotICAgICAgICAgICAgYm91bmRzLnRvcCA9IGJvdW5kcy5ib3R0b20gLSBoZWlnaHQ7Ci0gICAgICAgIH0KLQotICAgICAgICBkcmF3YWJsZS5zZXRCb3VuZHMoYm91bmRzKTsKLSAgICAgICAgZHJhd2FibGUuZHJhdyhjYW52YXMpOwotCi0gICAgICAgIGNhbnZhcy5yZXN0b3JlKCk7Ci0gICAgfQotCi0gICAgdm9pZCBkcmF3T3ZlcnNjcm9sbEZvb3RlcihDYW52YXMgY2FudmFzLCBEcmF3YWJsZSBkcmF3YWJsZSwgUmVjdCBib3VuZHMpIHsKLSAgICAgICAgZmluYWwgaW50IGhlaWdodCA9IGRyYXdhYmxlLmdldE1pbmltdW1IZWlnaHQoKTsKLQotICAgICAgICBjYW52YXMuc2F2ZSgpOwotICAgICAgICBjYW52YXMuY2xpcFJlY3QoYm91bmRz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c3LDQwIEBACiAKICAgICAgICAgICAgIGZpbmFsIGludCBsaXN0Qm90dG9tID0gbUJvdHRvbSAtIG1Ub3AgLSBtTGlzdFBhZGRpbmcuYm90dG9tICsgbVNjcm9sbFk7CiAgICAgICAgICAgICBpZiAoIW1TdGFja0Zyb21Cb3R0b20pIHsKLSAgICAgICAgICAgICAgICBpbnQgYm90dG9tID0gMDsKKyAgICAgICAgICAgICAgICBpbnQgYm90dG9tOwogICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIC8vIERyYXcgdG9wIGRpdmlkZXIgb3IgaGVhZGVyIGZvciBvdmVyc2Nyb2xsCi0gICAgICAgICAgICAgICAgZmluYWwgaW50IHNjcm9sbFkgPSBtU2Nyb2xsWTsKLSAgICAgICAgICAgICAgICBpZiAoY291bnQgPiAwICYmIHNjcm9sbFkgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChkcmF3T3ZlcnNjcm9sbEhlYWRlcikgewotICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLmJvdHRvbSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBib3VuZHMudG9wID0gc2Nyb2xsWTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdPdmVyc2Nyb2xsSGVhZGVyKGNhbnZhcywgb3ZlcnNjcm9sbEhlYWRlciwgYm91bmRzKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkcmF3RGl2aWRlcnMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJvdW5kcy5ib3R0b20gPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLnRvcCA9IC1kaXZpZGVySGVpZ2h0OwotICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0RpdmlkZXIoY2FudmFzLCBib3VuZHMsIC0xKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewogICAgICAgICAgICAgICAgICAgICBpZiAoKGhlYWRlckRpdmlkZXJzIHx8IGZpcnN0ICsgaSA+PSBoZWFkZXJDb3VudCkgJiYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZm9vdGVyRGl2aWRlcnMgfHwgZmlyc3QgKyBpIDwgZm9vdGVyTGltaXQpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3IGNoaWxkID0gZ2V0Q2hpbGRBdChpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGJvdHRvbSA9IGNoaWxkLmdldEJvdHRvbSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG9uJ3QgZHJhdyBkaXZpZGVycyBuZXh0IHRvIGl0ZW1zIHRoYXQgYXJlIG5vdCBlbmFibGVkCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZHJhd0RpdmlkZXJzICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChib3R0b20gPCBsaXN0Qm90dG9tICYmICEoZHJhd092ZXJzY3JvbGxGb290ZXIgJiYgaSA9PSBjb3VudCAtIDEpKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYXJlQWxsSXRlbXNTZWxlY3RhYmxlIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWRhcHRlci5pc0VuYWJsZWQoZmlyc3QgKyBpKSAmJiAoaSA9PSBjb3VudCAtIDEgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRhcHRlci5pc0VuYWJsZWQoZmlyc3QgKyBpICsgMSkpKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLnRvcCA9IGJvdHRvbTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLmJvdHRvbSA9IGJvdHRvbSArIGRpdmlkZXJIZWlnaHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdEaXZpZGVyKGNhbnZhcywgYm91bmRzLCBpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZpbGxGb3JNaXNzaW5nRGl2aWRlcnMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLnRvcCA9IGJvdHRvbTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLmJvdHRvbSA9IGJvdHRvbSArIGRpdmlkZXJIZWlnaHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdChib3VuZHMsIHBhaW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFyZUFsbEl0ZW1zU2VsZWN0YWJsZSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWRhcHRlci5pc0VuYWJsZWQoZmlyc3QgKyBpKSAmJiAoaSA9PSBjb3VudCAtIDEgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGFwdGVyLmlzRW5hYmxlZChmaXJzdCArIGkgKyAxKSkpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvdW5kcy50b3AgPSBib3R0b207CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLmJvdHRvbSA9IGJvdHRvbSArIGRpdmlkZXJIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0RpdmlkZXIoY2FudmFzLCBib3VuZHMsIGkpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmaWxsRm9yTWlzc2luZ0RpdmlkZXJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLnRvcCA9IGJvdHRvbTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3VuZHMuYm90dG9tID0gYm90dG9tICsgZGl2aWRlckhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoYm91bmRzLCBwYWludCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgb3ZlckZvb3RlckJvdHRvbSA9IG1Cb3R0b20gKyBtU2Nyb2xsWTsKLSAgICAgICAgICAgICAgICBpZiAoZHJhd092ZXJzY3JvbGxGb290ZXIgJiYgZmlyc3QgKyBjb3VudCA9PSBpdGVtQ291bnQgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJGb290ZXJCb3R0b20gPiBib3R0b20pIHsKLSAgICAgICAgICAgICAgICAgICAgYm91bmRzLnRvcCA9IGJvdHRvbTsKLSAgICAgICAgICAgICAgICAgICAgYm91bmRzLmJvdHRvbSA9IG92ZXJGb290ZXJCb3R0b207Ci0gICAgICAgICAgICAgICAgICAgIGRyYXdPdmVyc2Nyb2xsRm9vdGVyKGNhbnZhcywgb3ZlcnNjcm9sbEZvb3RlciwgYm91bmRzKTsKLSAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIGludCB0b3A7CiAgICAgICAgICAgICAgICAgaW50IGxpc3RUb3AgPSBtTGlzdFBhZGRpbmcudG9wOwogCiAgICAgICAgICAgICAgICAgZmluYWwgaW50IHNjcm9sbFkgPSBtU2Nyb2xsWTsKIAotICAgICAgICAgICAgICAgIGlmIChjb3VudCA+IDAgJiYgZHJhd092ZXJzY3JvbGxIZWFkZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgYm91bmRzLnRvcCA9IHNjcm9sbFk7Ci0gICAgICAgICAgICAgICAgICAgIGJvdW5kcy5ib3R0b20gPSBnZXRDaGlsZEF0KDApLmdldFRvcCgpOwotICAgICAgICAgICAgICAgICAgICBkcmF3T3ZlcnNjcm9sbEhlYWRlcihjYW52YXMsIG92ZXJzY3JvbGxIZWFkZXIsIGJvdW5kcyk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZmluYWwgaW50IHN0YXJ0ID0gZHJhd092ZXJzY3JvbGxIZWFkZXIgPyAxIDogMDsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gc3RhcnQ7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmICgoaGVhZGVyRGl2aWRlcnMgfHwgZmlyc3QgKyBpID49IGhlYWRlckNvdW50KSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmb290ZXJEaXZpZGVycyB8fCBmaXJzdCArIGkgPCBmb290ZXJMaW1pdCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXcgY2hpbGQgPSBnZXRDaGlsZEF0KGkpOwogICAgICAgICAgICAgICAgICAgICAgICAgdG9wID0gY2hpbGQuZ2V0VG9wKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBEb24ndCBkcmF3IGRpdmlkZXJzIG5leHQgdG8gaXRlbXMgdGhhdCBhcmUgbm90IGVuYWJsZWQKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkcmF3RGl2aWRlcnMgJiYgdG9wID4gbGlzdFRvcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRvcCA+IGxpc3RUb3ApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFyZUFsbEl0ZW1zU2VsZWN0YWJsZSB8fAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFkYXB0ZXIuaXNFbmFibGVkKGZpcnN0ICsgaSkgJiYgKGkgPT0gY291bnQgLSAxIHx8CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkYXB0ZXIuaXNFbmFibGVkKGZpcnN0ICsgaSArIDEpKSkpKSB7CkBAIC0zMTIwLDE2ICszMDMxLDkgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgaWYgKGNvdW50ID4gMCAmJiBzY3JvbGxZID4gMCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoZHJhd092ZXJzY3JvbGxGb290ZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBhYnNMaXN0Qm90dG9tID0gbUJvdHRvbTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJvdW5kcy50b3AgPSBhYnNMaXN0Qm90dG9tOwotICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLmJvdHRvbSA9IGFic0xpc3RCb3R0b20gKyBzY3JvbGxZOwotICAgICAgICAgICAgICAgICAgICAgICAgZHJhd092ZXJzY3JvbGxGb290ZXIoY2FudmFzLCBvdmVyc2Nyb2xsRm9vdGVyLCBib3VuZHMpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGRyYXdEaXZpZGVycykgewotICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzLnRvcCA9IGxpc3RCb3R0b207Ci0gICAgICAgICAgICAgICAgICAgICAgICBib3VuZHMuYm90dG9tID0gbGlzdEJvdHRvbSArIGRpdmlkZXJIZWlnaHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkcmF3RGl2aWRlcihjYW52YXMsIGJvdW5kcywgLTEpOwotICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJvdW5kcy50b3AgPSBsaXN0Qm90dG9tOworICAgICAgICAgICAgICAgICAgICBib3VuZHMuYm90dG9tID0gbGlzdEJvdHRvbSArIGRpdmlkZXJIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgIGRyYXdEaXZpZGVyKGNhbnZhcywgYm91bmRzLCAtMSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0zMTUwLDIwICszMDU0LDkgQEAKICAgICB2b2lkIGRyYXdEaXZpZGVyKENhbnZhcyBjYW52YXMsIFJlY3QgYm91bmRzLCBpbnQgY2hpbGRJbmRleCkgewogICAgICAgICAvLyBUaGlzIHdpZGdldCBkcmF3cyB0aGUgc2FtZSBkaXZpZGVyIGZvciBhbGwgY2hpbGRyZW4KICAgICAgICAgZmluYWwgRHJhd2FibGUgZGl2aWRlciA9IG1EaXZpZGVyOwotICAgICAgICBmaW5hbCBib29sZWFuIGNsaXBEaXZpZGVyID0gbUNsaXBEaXZpZGVyOwogCi0gICAgICAgIGlmICghY2xpcERpdmlkZXIpIHsKLSAgICAgICAgICAgIGRpdmlkZXIuc2V0Qm91bmRzKGJvdW5kcyk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBjYW52YXMuc2F2ZSgpOwotICAgICAgICAgICAgY2FudmFzLmNsaXBSZWN0KGJvdW5kcyk7Ci0gICAgICAgIH0KLQorICAgICAgICBkaXZpZGVyLnNldEJvdW5kcyhib3VuZHMpOwogICAgICAgICBkaXZpZGVyLmRyYXcoY2FudmFzKTsKLQotICAgICAgICBpZiAoY2xpcERpdmlkZXIpIHsKLSAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlKCk7Ci0gICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTMxODQsMTAgKzMwNzcsOCBAQAogICAgIHB1YmxpYyB2b2lkIHNldERpdmlkZXIoRHJhd2FibGUgZGl2aWRlcikgewogICAgICAgICBpZiAoZGl2aWRlciAhPSBudWxsKSB7CiAgICAgICAgICAgICBtRGl2aWRlckhlaWdodCA9IGRpdmlkZXIuZ2V0SW50cmluc2ljSGVpZ2h0KCk7Ci0gICAgICAgICAgICBtQ2xpcERpdmlkZXIgPSBkaXZpZGVyIGluc3RhbmNlb2YgQ29sb3JEcmF3YWJsZTsKICAgICAgICAgfSBlbHNlIH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G5ld1ZhbHVlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQ2hlY2tlZElkU3RhdGVzLnB1dChtQWRhcHRlci5nZXRJdGVtSWQocG9zaXRpb24pLCBCb29sZWFuLlRSVUUpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbUNoZWNrZWRJZFN0YXRlcy5kZWxldGUobUFkYXB0ZXIuZ2V0SXRlbUlkKHBvc2l0aW9uKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGJvb2xlYW4gbmV3VmFsdWUgPSAhbUNoZWNrU3RhdGVzLmdldChwb3NpdGlvbiwgZmFsc2UpOwotICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZSkgewotICAgICAgICAgICAgICAgICAgICBtQ2hlY2tTdGF0ZXMuY2xlYXIoKTsKLSAgICAgICAgICAgICAgICAgICAgbUNoZWNrU3RhdGVzLnB1dChwb3NpdGlvbiwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtQ2hlY2tlZElkU3RhdGVzICE9IG51bGwgJiYgbUFkYXB0ZXIuaGFzU3RhYmxlSWRzKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1DaGVja2VkSWRTdGF0ZXMuY2xlYXIoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1DaGVja2VkSWRTdGF0ZXMucHV0KG1BZGFwdGVyLmdldEl0ZW1JZChwb3NpdGlvbiksIEJvb2xlYW4uVFJVRSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IAotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtRGF0YUNoYW5nZWQgPSB0cnVlOwotICAgICAgICAgICAgcmVtZW1iZXJTeW5jU3RhdGUoKTsKLSAgICAgICAgICAgIHJlcXVlc3RMYXlvdXQoKT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hbGlkCi0gICAgICoKLSAgICAgKiBAc2VlICNzZXRDaG9pY2VNb2RlKGludCkKLSAgICAgKi8KLSAgICBwdWJsaWMgYm9vbGVhbiBpc0l0ZW1DaGVja2VkKGludCBwb3NpdGlvbikgewotICAgICAgICBpZiAobUNob2ljZU1vZGUgIT0gQ0hPSUNFX01PREVfTk9ORSAmJiBtQ2hlY2tTdGF0ZXMgIT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIG1DaGVja1N0YXRlcy5nZXQocG9zaXRpb24pOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJldHVybnMgdGhlIGN1cnJlbnRseSBjaGVja2VkIGl0ZW0uIFRoZSByZXN1bHQgaXMgb25seSB2YWxpZCBpZiB0aGUgY2hvaWNlCi0gICAgICogbW9kZSBoYXMgYmVlbiBzZXQgdG8ge0BsaW5rICNDSE9JQ0VfTU9ERV9TSU5HTEV9LgotICAgICAqCi0gICAgICogQHJldHVybiBUaGUgcG9zaXRpb24gb2YgdGhlIGN1cnJlbnRseSBjaGVja2VkIGl0ZW0gb3IKLSAgICAgKiAgICAgICAgIHtAbGluayAjSU5WQUxJRF9QT1NJVElPTn0gaWYgbm90aGluZyBpcyBzZWxlY3RlZAotICAgICAqCi0gICAgICogQHNlZSAjc2V0Q2hvaWNlTW9kZShpbnQpCi0gICAgICovCi0gICAgcHVibGljIGludCBnZXRDaGVja2VkSXRlbVBvc2l0aW9uKCkgewotICAgICAgICBpZiAobUNob2ljZU1vZGUgPT0gQ0hPSUNFX01PREVfU0lOR0xFICYmIG1DaGVja1N0YXRlcyAhPSBudWxsICYmIG1DaGVja1N0YXRlcy5zaXplKCkgPT0gMSkgewotICAgICAgICAgICAgcmV0dXJuIG1DaGVja1N0YXRlcy5rZXlBdCgwKTsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBJTlZBTElEX1BPU0lUSU9OOwotICAgIH0KLQotICAg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aWFDb250cm9sbGVyLmphdmEKQEAgLTQxMywzMyArNDEzLDQ3IEBACiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gZGlzcGF0Y2hLZXlFdmVudChLZXlFdmVudCBldmVudCkgewogICAgICAgICBpbnQga2V5Q29kZSA9IGV2ZW50LmdldEtleUNvZGUoKTsKLSAgICAgICAgaWYgKGV2ZW50LmdldFJlcGVhdENvdW50KCkgPT0gMCAmJiBldmVudC5pc0Rvd24oKSAmJiAoCi0gICAgICAgICAgICAgICAga2V5Q29kZSA9PSAgS2V5RXZlbnQuS0VZQ09ERV9IRUFEU0VUSE9PSyB8fAotICAgICAgICAgICAgICAgIGtleUNvZGUgPT0gIEtleUV2ZW50LktFWUNPREVfTUVESUFfUExBWV9QQVVTRSB8fAotICAgICAgICAgICAgICAgIGtleUNvZGUgPT0gIEtleUV2ZW50LktFWUNPREVfU1BBQ0UpKSB7Ci0gICAgICAgICAgICBkb1BhdXNlUmVzdW1lKCk7Ci0gICAgICAgICAgICBzaG93KHNEZWZhdWx0VGltZW91dCk7Ci0gICAgICAgICAgICBpZiAobVBhdXNlQnV0dG9uICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtUGF1c2VCdXR0b24ucmVxdWVzdEZvY3VzKCk7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gdW5pcXVlRG93biA9IGV2ZW50LmdldFJlcGVhdENvdW50KCkgPT0gMAorICAgICAgICAgICAgICAgICYmIGV2ZW50LmdldEFjdGlvbigpID09IEtleUV2ZW50LkFDVElPTl9ET1dOOworICAgICAgICBpZiAoa2V5Q29kZSA9PSAgS2V5RXZlbnQuS0VZQ09ERV9IRUFEU0VUSE9PSworICAgICAgICAgICAgICAgIHx8IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QTEFZX1BBVVNFCisgICAgICAgICAgICAgICAgfHwga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX1NQQUNFKSB7CisgICAgICAgICAgICBpZiAodW5pcXVlRG93bikgeworICAgICAgICAgICAgICAgIGRvUGF1c2VSZXN1bWUoKTsKKyAgICAgICAgICAgICAgICBzaG93KHNEZWZhdWx0VGltZW91dCk7CisgICAgICAgICAgICAgICAgaWYgKG1QYXVzZUJ1dHRvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1QYXVzZUJ1dHRvbi5yZXF1ZXN0Rm9jdXMoKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfSBlbHNlIGlmIChrZXlDb2RlID09ICBLZXlFdmVudC5LRVlDT0RFX01FRElBX1NUT1ApIHsKLSAgICAgICAgICAgIGlmIChtUGxheWVyLmlzUGxheWluZygpKSB7CisgICAgICAgIH0gZWxzZSBpZiAoa2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BMQVkpIHsKKyAgICAgICAgICAgIGlmICh1bmlxdWVEb3duICYmICFtUGxheWVyLmlzUGxheWluZygpKSB7CisgICAgICAgICAgICAgICAgbVBsYXllci5zdGFydCgpOworICAgICAgICAgICAgICAgIHVwZGF0ZVBhdXNlUGxheSgpOworICAgICAgICAgICAgICAgIHNob3coc0RlZmF1bHRUaW1lb3V0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9IGVsc2UgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9TVE9QCisgICAgICAgICAgICAgICAgfHwga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BBVVNFKSB7CisgICAgICAgICAgICBpZiAodW5pcXVlRG93biAmJiBtUGxheWVyLmlzUGxheWluZygpKSB7CiAgICAgICAgICAgICAgICAgbVBsYXllci5wYXVzZSgpOwogICAgICAgICAgICAgICAgIHVwZGF0ZVBhdXNlUGxheSgpOworICAgICAgICAgICAgICAgIHNob3coc0RlZmF1bHRUaW1lb3V0KTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9IGVsc2UgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfRE9XTiB8fAotICAgICAgICAgICAgICAgIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfVVApIHsKKyAgICAgICAgfSBlbHNlIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfVk9MVU1FX0RPV04KKyAgICAgICAgICAgICAgICB8fCBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfVk9MVU1FX1VQCisgICAgICAgICAgICAgICAgfHwga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9NVVRFKSB7CiAgICAgICAgICAgICAvLyBkb24ndCBzaG93IHRoZSBjb250cm9scyBmb3Igdm9sdW1lIGFkanVzdG1lbnQKICAgICAgICAgICAgIHJldHVybiBzdXBlci5kaXNwYXRjaEtleUV2ZW50KGV2ZW50KTsKICAgICAgICAgfSBlbHNlIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfQkFDSyB8fCBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfTUVOVSkgewotICAgICAgICAgICAgaGlkZSgpOwotCisgICAgICAgICAgICBpZiAodW5pcXVlRG93bikgeworICAgICAgICAgICAgICAgIGhpZGUoKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgc2hvdyhzRGVmYXVsdFRpbWVvdXQpOwogICAgICAgICB9CisKKyAgICAgICAgc2hvdyhzRGVmYXVsdFRpbWVvdXQpOwogICAgICAgICByZXR1cm4gc3VwZXIuZGlzcGF0Y2hLZXlFdmVudChldmVudCk7CiAgICAgfQogCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW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S4KLSAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGVsYXBzZWRUaW1lID0gdGltZSAtIG1TY3JvbGxlclgubVN0YXJ0VGltZTsKLQotICAgICAgICAgICAgICAgIGZpbmFsIGludCBkdXJhdGlvbiA9IG1TY3JvbGxlclgubUR1cmF0aW9uOwotICAgICAgICAgICAgICAgIGlmIChlbGFwc2VkVGltZSA8IGR1cmF0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZsb2F0IHEgPSAoZmxvYXQpIChlbGFwc2VkVGltZSkgLyBkdXJhdGlvbjsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobUludGVycG9sYXRvciA9PSBudWxsKQotICAgICAgICAgICAgICAgICAgICAgICAgcSA9IFNjcm9sbGVyLnZpc2NvdXNGbHVpZChxKTsKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgcSA9IG1JbnRlcnBvbGF0b3IuZ2V0SW50ZXJwb2xhdGlvbihxKTsKLQotICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsZXJYLnVwZGF0ZVNjcm9sbChxKTsKLSAgICAgICAgICAgICAgICAgICAgbVNjcm9sbGVyWS51cGRhdGVTY3JvbGwocSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYWJvcnRBbmltYXRpb24oKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgRkxJTkdfTU9ERToKLSAgICAgICAgICAgICAgICBpZiAoIW1TY3JvbGxlclgubUZpbmlzaGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbVNjcm9sbGVyWC51cGRhdGUoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtU2Nyb2xsZXJYLmNvbnRpbnVlV2hlbkZpbmlzaGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsZXJYLmZpbmlzaCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKCFtU2Nyb2xsZXJZLm1GaW5pc2hlZCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoIW1TY3JvbGxlclkudXBkYXRlKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbVNjcm9sbGVyWS5jb250aW51ZVdoZW5GaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNjcm9sbGVyWS5maW5pc2goKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogU3RhcnQgc2Nyb2xsaW5nIGJ5IHByb3ZpZGluZyBhIHN0YXJ0aW5nIHBvaW50IGFuZCB0aGUgZGlzdGFuY2UgdG8gdHJhdmVsLgotICAgICAqIFRoZSBzY3JvbGwgd2lsbCB1c2UgdGhlIGRlZmF1bHQgdmFsdWUgb2YgMjUwIG1pbGxpc2Vjb25kcyBmb3IgdGhlCi0gICAgICogZHVyYXRpb24uCi0gICAgICoKLSAgICAgKiBAcGFyYW0gc3RhcnRYIFN0YXJ0aW5nIGhvcml6b250YWwgc2Nyb2xsIG9mZnNldCBpbiBwaXhlbHMuIFBvc2l0aXZlCi0gICAgICogICAgICAgIG51bWJlcnMgd2lsbCBzY3JvbGwgdGhlIGNvbnRlbnQgdG8gdGhlIGxlZnQuCi0gICAgICogQHBhcmFtIHN0YXJ0WSBTdGFydGluZyB2ZXJ0aWNhbCBzY3JvbGwgb2Zmc2V0IGluIHBpeGVscy4gUG9zaXRpdmUgbnVtYmVycwotICAgICAq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IC0gMi4wZiAqIGRlY2VsZXJhdGlvbgotICAgICAgICAgICAgICAgICAgICAqIGRpc3RhbmNlOwotICAgICAgICAgICAgaWYgKGRpc2NyaW1pbmFudCA+PSAwLjBmKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgZGVsdGEgPSAoZmxvYXQpIE1hdGguc3FydChkaXNjcmltaW5hbnQpOwotICAgICAgICAgICAgICAgIGlmIChkZWNlbGVyYXRpb24gPCAwLjBmKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRlbHRhID0gLWRlbHRhOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICByZXR1cm4gKGludCkgKDEwMDAuMGYgKiAoLWluaXRpYWxWZWxvY2l0eSAtIGRlbHRhKSAvIGRlY2VsZXJhdGlvbik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIEVuZCBwb3NpdGlvbiBjYW4gbm90IGJlIHJlYWNoZWQKLSAgICAgICAgICAgIHJldHVybiAwOwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCBzdGFydFNjcm9sbChpbnQgc3RhcnQsIGludCBkaXN0YW5jZSwgaW50IGR1cmF0aW9uKSB7Ci0gICAgICAgICAgICBtRmluaXNoZWQgPSBmYWxzZTsKLQotICAgICAgICAgICAgbVN0YXJ0ID0gc3RhcnQ7Ci0gICAgICAgICAgICBtRmluYWwgPSBzdGFydCArIGRpc3RhbmNlOwotCi0gICAgICAgICAgICBtU3RhcnRUaW1lID0gQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgIG1EdXJhdGlvbiA9IGR1cmF0aW9uOwotCi0gICAgICAgICAgICAvLyBVbnVzZWQKLSAgICAgICAgICAgIG1EZWNlbGVyYXRpb24gPSAwLjBmOwotICAgICAgICAgICAgbVZlbG9jaXR5ID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIHZvaWQgZmxpbmcoaW50IHN0YXJ0LCBpbnQgdmVsb2NpdHksIGludCBtaW4sIGludCBtYXgpIHsKLSAgICAgICAgICAgIG1GaW5pc2hlZCA9IGZhbHNlOwotCi0gICAgICAgICAgICBtU3RhcnQgPSBzdGFydDsKLSAgICAgICAgICAgIG1TdGFydFRpbWUgPSBBbmltYXRpb25VdGlscy5jdXJyZW50QW5pbWF0aW9uVGltZU1pbGxpcygpOwotCi0gICAgICAgICAgICBtVmVsb2NpdHkgPSB2ZWxvY2l0eTsKLQotICAgICAgICAgICAgbURlY2VsZXJhdGlvbiA9IGdldERlY2VsZXJhdGlvbih2ZWxvY2l0eSk7Ci0KLSAgICAgICAgICAgIC8vIEEgc3RhcnQgZnJvbSBhbiBpbnZhbGlkIHBvc2l0aW9uIGltbWVkaWF0ZWx5IGJyaW5ncyBiYWNrIHRvIGEgdmFsaWQgcG9zaXRpb24KLSAgICAgICAgICAgIGlmIChtU3RhcnQgPCBtaW4pIHsKLSAgICAgICAgICAgICAgICBtRHVyYXRpb24gPSAwOwotICAgICAgICAgICAgICAgIG1GaW5hbCA9IG1pbjsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtU3RhcnQgPiBtYXgpIHsKLSAgICAgICAgICAgICAgICBtRHVyYXRpb24gPSAwOwotICAgICAgICAgICAgICAgIG1GaW5hbCA9IG1heDsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIER1cmF0aW9uIGFyZSBleHByZXNzZWQgaW4gbWlsbGlzZWNvbmRzCi0gICAgICAgICAgICBtRHVyYXRpb24gPSAoaW50KSAoLTEwMDAuMGYgKiB2ZWxvY2l0eSAvIG1EZWNlbGVyYXRpb24pOwotCi0gICAgICAgICAgICBtRmluYWwgPSBzdGFydCAtIE1hdGgucm91bmQoKHZlbG9jaXR5ICogdmVsb2NpdHkpIC8gKDIuMGYgKiBtRGVjZWxlcmF0aW9uKSk7Ci0KLSAgICAgICAgICAgIC8vIENsYW1wIHRvIGEgdmFsaWQgZmluYWwgcG9zaXRpb24KLSAgICAgICAgICAgIGlmIChtRmluYWwgPCBtaW4pIHsKLSAgICAgICAgICAgICAgICBtRmluYWwgPSBtaW47Ci0gICAgICAgICAgICAgICAgbUR1cmF0aW9uID0gY29tcHV0ZUR1cmF0aW9uKG1TdGFydCwgbWluLCBtVmVsb2NpdHksIG1EZWNlbGVyYXRpb24pOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUZpbmFsID4gbWF4KSB7Ci0gICAgICAgICAgICAgICAgbUZpbmFsID0gbWF4OwotICAgICAgICAgICAgICAgIG1EdXJhdGlvbiA9IGNvbXB1dGVEdXJhdGlvbihtU3RhcnQsIG1heCwgbVZlbG9jaXR5LCBtRGVjZWxlcmF0aW9uKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHZvaWQgZmluaXNoKCkgewotICAgICAgICAgICAgbUN1cnJlbnRQb3NpdGlvbiA9IG1GaW5hbDsKLSAgICAgICAgICAgIC8vIE5vdCByZXNldCBzaW5jZSBXZWJWaWV3IHJlbGllcyBvbiB0aGlzIHZhbHVlIGZvciBmYXN0IGZsaW5nLgotICAgICAgICAgICAgLy8gbUN1cnJWZWxvY2l0eSA9IDAuMGY7Ci0gICAgICAgICAgICBtRmluaXNoZWQgPSB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCBzZXRGaW5hbFBvc2l0aW9uKGludCBwb3NpdGlvbikgewotICAgICAgICAgICAgbUZpbmFsID0gcG9zaXRpb247Ci0gICAgICAgICAgICBtRmluaXNoZWQgPSBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIHZvaWQgZXh0ZW5kRHVyYXRpb24oaW50IGV4dGVuZCkgewotICAgICAgICAgICAgZmluYWwgbG9uZyB0aW1lID0gQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoK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bCA9IHN0YXJ0IC0gTWF0aC5yb3VuZCgodmVsb2NpdHkgKiB2ZWxvY2l0eSkgLyAoMi4wZiAqIG1EZWNlbGVyYXRpb24pKTsKLQotICAgICAgICAgICAgLy8gQ2xhbXAgdG8gYSB2YWxpZCBmaW5hbCBwb3NpdGlvbgotICAgICAgICAgICAgaWYgKG1GaW5hbCA8IG1pbikgewotICAgICAgICAgICAgICAgIG1GaW5hbCA9IG1pbjsKLSAgICAgICAgICAgICAgICBtRHVyYXRpb24gPSBjb21wdXRlRHVyYXRpb24obVN0YXJ0LCBtaW4sIG1WZWxvY2l0eSwgbURlY2VsZXJhdGlvbik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtRmluYWwgPiBtYXgpIHsKLSAgICAgICAgICAgICAgICBtRmluYWwgPSBtYXg7Ci0gICAgICAgICAgICAgICAgbUR1cmF0aW9uID0gY29tcHV0ZUR1cmF0aW9uKG1TdGFydCwgbWF4LCBtVmVsb2NpdHksIG1EZWNlbGVyYXRpb24pOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoc3RhcnQgPiBtYXgpIHsKLSAgICAgICAgICAgICAgICBpZiAoc3RhcnQgPj0gbWF4ICsgb3ZlcikgewotICAgICAgICAgICAgICAgICAgICBzcHJpbmdiYWNrKG1heCArIG92ZXIsIG1pbiwgbWF4KTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBpZiAodmVsb2NpdHkgPD0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc3ByaW5nYmFjayhzdGFydCwgbWluLCBtYXgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyB0aW1lID0gQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGRvdWJsZSBkdXJhdGlvblNpbmNlRWRnZSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5hdGFuKChzdGFydC1tYXgpICogVElNRV9DT0VGIC8gdmVsb2NpdHkpIC8gVElNRV9DT0VGOwotICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0VGltZSA9IChpbnQpICh0aW1lIC0gMTAwMC4wZiAqIGR1cmF0aW9uU2luY2VFZGdlKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2ltdWxhdGUgYSBib3VuY2UgdGhhdCBzdGFydGVkIGZyb20gZWRnZQotICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0ID0gbWF4OwotCi0gICAgICAgICAgICAgICAgICAgICAgICBtVmVsb2NpdHkgPSAoaW50KSAodmVsb2NpdHkgLyBNYXRoLmNvcyhkdXJhdGlvblNpbmNlRWRnZSAqIFRJTUVfQ09FRikpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBvbkVkZ2VSZWFjaGVkKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChzdGFydCA8IG1pbikgewotICAgICAgICAgICAgICAgICAgICBpZiAoc3RhcnQgPD0gbWluIC0gb3ZlcikgewotICAgICAgICAgICAgICAgICAgICAgICAgc3ByaW5nYmFjayhtaW4gLSBvdmVyLCBtaW4sIG1heCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodmVsb2NpdHkgPj0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwcmluZ2JhY2soc3RhcnQsIG1pbiwgbWF4KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyB0aW1lID0gQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBkb3VibGUgZHVyYXRpb25TaW5jZUVkZ2UgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYXRoLmF0YW4oKHN0YXJ0LW1pbikgKiBUSU1FX0NPRUYgLyB2ZWxvY2l0eSkgLyBUSU1FX0NPRUY7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0VGltZSA9IChpbnQpICh0aW1lIC0gMTAwMC4wZiAqIGR1cmF0aW9uU2luY2VFZGdlKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNpbXVsYXRlIGEgYm91bmNlIHRoYXQgc3RhcnRlZCBmcm9tIGVkZ2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhcnQgPSBtaW47Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVmVsb2NpdHkgPSAoaW50KSAodmVsb2NpdHkgLyBNYXRoLmNvcyhkdXJhdGlvblNpbmNlRWRnZSAqIFRJTUVfQ09FRikpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25FZGdlUmVhY2hlZCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICB2b2lkIG5vdGlmeUVkZ2VSZWFjaGVkKGludCBzdGFydCwgaW50IGVuZCwgaW50IG92ZXIpIHsKLSAgICAgICAgICAgIG1EZWNlbGVyYXRpb24gPSBnZXREZWNlbGVyYXRpb24obVZlbG9jaXR5KTsKLQotICAgICAgICAgICAgLy8gTG9jYWwgdGltZSwgdXNlZCB0byBjb21wdXRlIGVkZ2UgY3Jvc3NpbmcgdGltZS4KLSAgICAgICAgICAgIGZsb2F0IHRpbWVDdXJyZW50ID0gbUN1cnJWZWxvY2l0eSAvIG1EZWNlbGVyYX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ICAgLy8gU3ByaW5nIGZvcmNlIHdpbGwgYnJpbmcgdXMgYmFjayB0byBmaW5hbCBwb3NpdGlvbgotICAgICAgICAgICAgICAgIG1TdGF0ZSA9IFRPX0JPVU5DRTsKLSAgICAgICAgICAgICAgICBtRmluYWwgPSBtU3RhcnQ7Ci0gICAgICAgICAgICAgICAgbUR1cmF0aW9uID0gT1ZFUlNDUk9MTF9TUFJJTkdCQUNLX0RVUkFUSU9OOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBWZWxvY2l0eSBpcyB0b28gaGlnaCwgd2Ugd2lsbCBoaXQgdGhlIGJvdW5kYXJ5IGxpbWl0Ci0gICAgICAgICAgICAgICAgbVN0YXRlID0gVE9fQk9VTkRBUlk7Ci0gICAgICAgICAgICAgICAgaW50IG92ZXIgPSBtVmVsb2NpdHkgPiAwID8gbU92ZXIgOiAtbU92ZXI7Ci0gICAgICAgICAgICAgICAgbUZpbmFsID0gbVN0YXJ0ICsgb3ZlcjsKLSAgICAgICAgICAgICAgICBtRHVyYXRpb24gPSAoaW50KSAoMTAwMC4wZiAqIE1hdGguYXNpbihvdmVyIC8gZGlzdGFuY2UpIC8gVElNRV9DT0VGKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGJvb2xlYW4gY29udGludWVXaGVuRmluaXNoZWQoKSB7Ci0gICAgICAgICAgICBzd2l0Y2ggKG1TdGF0ZSkgewotICAgICAgICAgICAgICAgIGNhc2UgVE9fRURHRToKLSAgICAgICAgICAgICAgICAgICAgLy8gRHVyYXRpb24gZnJvbSBzdGFydCB0byBudWxsIHZlbG9jaXR5Ci0gICAgICAgICAgICAgICAgICAgIGludCBkdXJhdGlvbiA9IChpbnQpICgtMTAwMC4wZiAqIG1WZWxvY2l0eSAvIG1EZWNlbGVyYXRpb24pOwotICAgICAgICAgICAgICAgICAgICBpZiAobUR1cmF0aW9uIDwgZHVyYXRpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBhbmltYXRpb24gd2FzIGNsYW1wZWQsIHdlIHJlYWNoZWQgdGhlIGVkZ2UKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TdGFydCA9IG1GaW5hbDsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNwZWVkIHdoZW4gZWRnZSB3YXMgcmVhY2hlZAotICAgICAgICAgICAgICAgICAgICAgICAgbVZlbG9jaXR5ID0gKGludCkgKG1WZWxvY2l0eSArIG1EZWNlbGVyYXRpb24gKiBtRHVyYXRpb24gLyAxMDAwLjBmKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TdGFydFRpbWUgKz0gbUR1cmF0aW9uOwotICAgICAgICAgICAgICAgICAgICAgICAgb25FZGdlUmVhY2hlZCgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm9ybWFsIHN0b3AsIG5vIG5lZWQgdG8gY29udGludWUKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIFRPX0JPVU5EQVJZOgotICAgICAgICAgICAgICAgICAgICBtU3RhcnRUaW1lICs9IG1EdXJhdGlvbjsKLSAgICAgICAgICAgICAgICAgICAgc3RhcnRTcHJpbmdiYWNrKG1GaW5hbCwgbUZpbmFsIC0gKG1WZWxvY2l0eSA+IDAgPyBtT3ZlcjotbU92ZXIpLCBtVmVsb2NpdHkgPiAwKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBUT19CT1VOQ0U6Ci0gICAgICAgICAgICAgICAgICAgIC8vbVZlbG9jaXR5ID0gKGludCkgKG1WZWxvY2l0eSAqIEJPVU5DRV9DT0VGRklDSUVOVCk7Ci0gICAgICAgICAgICAgICAgICAgIG1WZWxvY2l0eSA9IChpbnQpIChtVmVsb2NpdHkgKiBtQm91bmNlQ29lZmZpY2llbnQpOwotICAgICAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMobVZlbG9jaXR5KSA8IE1JTklNVU1fVkVMT0NJVFlfRk9SX0JPVU5DRSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1TdGFydFRpbWUgKz0gbUR1cmF0aW9uOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdXBkYXRlKCk7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFVwZGF0ZSB0aGUgY3VycmVudCBwb3NpdGlvbiBhbmQgdmVsb2NpdHkgZm9yIGN1cnJlbnQgdGltZS4gUmV0dXJucwotICAgICAgICAgKiB0cnVlIGlmIHVwZGF0ZSBoYXMgYmVlbiBkb25lIGFuZCBmYWxzZSBpZiBhbmltYXRpb24gZHVyYXRpb24gaGFzIGJlZW4KLSAgICAgICAgICogcmVhY2hlZC4KLSAgICAgICAgICovCi0gICAgICAgIGJvb2xlYW4gdXBkYXRlKCkgewotICAgICAgICAgICAgZmluYWwgbG9uZyB0aW1lID0gQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgIGZpbmFsIGxvbmcgZHVyYXRpb24gPSB0aW1lIC0gbVN0YXJ0VGltZTsKLQotICAgICAgICAgICAgaWYgKGR1cmF0aW9uID4gbUR1cmF0aW9uKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkb3VibGUgZGlzdGFuY2U7Ci0gICAgICAgICAgICBmaW5hbCBmbG9hdCB0ID0gZHVyYXRpb24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VhciBiZWxvdyB0aGUgYW5jaG9yIGlmIHRoZXJlCisgICAgICogICAgICAgICAgICAgICBpcyByb29tLCBvciBhYm92ZSBpdCBpZiB0aGVyZSBpcyBub3QuCisgICAgICovCisgICAgcHVibGljIFBvcHVwTWVudShDb250ZXh0IGNvbnRleHQsIFZpZXcgYW5jaG9yKSB7CisgICAgICAgIC8vIFRPRE8gVGhlbWU/CisgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKKyAgICAgICAgbU1lbnUgPSBuZXcgTWVudUJ1aWxkZXIoY29udGV4dCk7CisgICAgICAgIG1NZW51LnNldENhbGxiYWNrKHRoaXMpOworICAgICAgICBtQW5jaG9yID0gYW5jaG9yOworICAgICAgICBtUG9wdXAgPSBuZXcgTWVudVBvcHVwSGVscGVyKGNvbnRleHQsIG1NZW51LCBhbmNob3IpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdGhlIHtAbGluayBNZW51fSBhc3NvY2lhdGVkIHdpdGggdGhpcyBwb3B1cC4gUG9wdWxhdGUgdGhlIHJldHVybmVkIE1lbnUgd2l0aAorICAgICAqIGl0ZW1zIGJlZm9yZSBjYWxsaW5nIHtAbGluayAjc2hvdygpfS4KKyAgICAgKgorICAgICAqIEBzZWUgI3Nob3coKQorICAgICAqIEBzZWUgI2dldE1lbnVJbmZsYXRlcigpCisgICAgICovCisgICAgcHVibGljIE1lbnUgZ2V0TWVudSgpIHsKKyAgICAgICAgcmV0dXJuIG1NZW51OworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gYSB7QGxpbmsgTWVudUluZmxhdGVyfSB0aGF0IGNhbiBiZSB1c2VkIHRvIGluZmxhdGUgbWVudSBpdGVtcyBmcm9tIFhNTCBpbnRvIHRoZQorICAgICAqIG1lbnUgcmV0dXJuZWQgYnkge0BsaW5rICNnZXRNZW51KCl9LgorICAgICAqCisgICAgICogQHNlZSAjZ2V0TWVudSgpCisgICAgICovCisgICAgcHVibGljIE1lbnVJbmZsYXRlciBnZXRNZW51SW5mbGF0ZXIoKSB7CisgICAgICAgIHJldHVybiBuZXcgTWVudUluZmxhdGVyKG1Db250ZXh0KTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTaG93IHRoZSBtZW51IHBvcHVwIGFuY2hvcmVkIHRvIHRoZSB2aWV3IHNwZWNpZmllZCBkdXJpbmcgY29uc3RydWN0aW9uLgorICAgICAqIEBzZWUgI2Rpc21pc3MoKQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgIG1Qb3B1cC5zaG93KCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogRGlzbWlzcyB0aGUgbWVudSBwb3B1cC4KKyAgICAgKiBAc2VlICNzaG93KCkKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBkaXNtaXNzKCkgeworICAgICAgICBtUG9wdXAuZGlzbWlzcygpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldE9uTWVudUl0ZW1DbGlja0xpc3RlbmVyKE9uTWVudUl0ZW1DbGlja0xpc3RlbmVyIGxpc3RlbmVyKSB7CisgICAgICAgIG1NZW51SXRlbUNsaWNrTGlzdGVuZXIgPSBsaXN0ZW5lcjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIG9uTWVudUl0ZW1TZWxlY3RlZChNZW51QnVpbGRlciBtZW51LCBNZW51SXRlbSBpdGVtKSB7CisgICAgICAgIGlmIChtTWVudUl0ZW1DbGlja0xpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBtTWVudUl0ZW1DbGlja0xpc3RlbmVyLm9uTWVudUl0ZW1DbGljayhpdGVtKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBvbkNsb3NlTWVudShNZW51QnVpbGRlciBtZW51LCBib29sZWFuIGFsbE1lbnVzQXJlQ2xvc2luZykgeworICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gb25TdWJNZW51U2VsZWN0ZWQoU3ViTWVudUJ1aWxkZXIgc3ViTWVudSkgeworICAgICAgICBpZiAoIXN1Yk1lbnUuaGFzVmlzaWJsZUl0ZW1zKCkpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgLy8gQ3VycmVudCBtZW51IHdpbGwgYmUgZGlzbWlzc2VkIGJ5IHRoZSBub3JtYWwgaGVscGVyLCBzdWJtZW51IHdpbGwgYmUgc2hvd24gaW4gaXRzIHBsYWNlLgorICAgICAgICBuZXcgTWVudVBvcHVwSGVscGVyKG1Db250ZXh0LCBzdWJNZW51LCBtQW5jaG9yKS5zaG93KCk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgb25DbG9zZVN1Yk1lbnUoU3ViTWVudUJ1aWxkZXIgbWVudSkgeworICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgb25NZW51TW9kZUNoYW5nZShNZW51QnVpbGRlciBtZW51KSB7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW50ZXJmYWNlIHJlc3BvbnNpYmxlIGZvciByZWNlaXZpbmcgbWVudSBpdGVtIGNsaWNrIGV2ZW50cyBpZiB0aGUgaXRlbXMgdGhlbXNlbHZlcworICAgICAqIGRvIG5vdCBoYXZlIGluZGl2aWR1YWwgaXRlbSBjbGljayBsaXN0ZW5lcnMuCisgICAgICovCisgICAgcHVibGljIGludGVyZmFjZSBPbk1lbnVJdGVtQ2xpY2tMaXN0ZW5lciB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGlzIG1ldGhvZCB3aWxsIG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vbGVhbiBtSXNXaWRnZXRDb2xsZWN0aW9uQ2hpbGQgPSBmYWxzZTsKKworICAgIC8qKgogICAgICAqIFRoaXMgYW5ub3RhdGlvbiBpbmRpY2F0ZXMgdGhhdCBhIHN1YmNsYXNzIG9mIFZpZXcgaXMgYWxsbG93ZWQgdG8gYmUgdXNlZAogICAgICAqIHdpdGggdGhlIHtAbGluayBSZW1vdGVWaWV3c30gbWVjaGFuaXNtLgogICAgICAqLwpAQCAtOTUsNyArMTExLDcgQEAKICAgICAgICAgICAgIHN1cGVyKG1lc3NhZ2UpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogQmFzZSBjbGFzcyBmb3IgYWxsIGFjdGlvbnMgdGhhdCBjYW4gYmUgcGVyZm9ybWVkIG9uIGFuIAogICAgICAqIGluZmxhdGVkIHZpZXcuCkBAIC0xMDgsNiArMTI0LDIzNCBAQAogICAgICAgICBwdWJsaWMgaW50IGRlc2NyaWJlQ29udGVudHMoKSB7CiAgICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBPdmVycmlkZGVuIGJ5IGVhY2ggY2xhc3MgdG8gcmVwb3J0IG9uIGl0J3Mgb3duIG1lbW9yeSB1c2FnZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgdXBkYXRlTWVtb3J5VXNhZ2VFc3RpbWF0ZShNZW1vcnlVc2FnZUNvdW50ZXIgY291bnRlcikgeworICAgICAgICAgICAgLy8gV2UgY3VycmVudGx5IG9ubHkgY2FsY3VsYXRlIEJpdG1hcCBtZW1vcnkgdXNhZ2UsIHNvIGJ5IGRlZmF1bHQsIGRvbid0IGRvIGFueXRoaW5nCisgICAgICAgICAgICAvLyBoZXJlCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBwcm90ZWN0ZWQgYm9vbGVhbiBzdGFydEludGVudFNhZmVseShDb250ZXh0IGNvbnRleHQsIFBlbmRpbmdJbnRlbnQgcGVuZGluZ0ludGVudCwKKyAgICAgICAgICAgICAgICBJbnRlbnQgZmlsbEluSW50ZW50KSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIC8vIFRPRE86IFVucmVnaXN0ZXIgdGhpcyBoYW5kbGVyIGlmIFBlbmRpbmdJbnRlbnQuRkxBR19PTkVfU0hPVD8KKyAgICAgICAgICAgICAgICBjb250ZXh0LnN0YXJ0SW50ZW50U2VuZGVyKAorICAgICAgICAgICAgICAgICAgICAgICAgcGVuZGluZ0ludGVudC5nZXRJbnRlbnRTZW5kZXIoKSwgZmlsbEluSW50ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgSW50ZW50LkZMQUdfQUNUSVZJVFlfTkVXX1RBU0ssCisgICAgICAgICAgICAgICAgICAgICAgICBJbnRlbnQuRkxBR19BQ1RJVklUWV9ORVdfVEFTSywgMCk7CisgICAgICAgICAgICB9IGNhdGNoIChJbnRlbnRTZW5kZXIuU2VuZEludGVudEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgYW5kcm9pZC51dGlsLkxvZy5lKExPR19UQUcsICJDYW5ub3Qgc2VuZCBwZW5kaW5nIGludGVudDogIiwgZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBhbmRyb2lkLnV0aWwuTG9nLmUoTE9HX1RBRywgIkNhbm5vdCBzZW5kIHBlbmRpbmcgaW50ZW50IGR1ZSB0byAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICJ1bmtub3duIGV4Y2VwdGlvbjogIiwgZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFNldEVtcHR5VmlldyBleHRlbmRzIEFjdGlvbiB7CisgICAgICAgIGludCB2aWV3SWQ7CisgICAgICAgIGludCBlbXB0eVZpZXdJZDsKKworICAgICAgICBwdWJsaWMgZmluYWwgc3RhdGljIGludCBUQUcgPSA2OworCisgICAgICAgIFNldEVtcHR5VmlldyhpbnQgdmlld0lkLCBpbnQgZW1wdHlWaWV3SWQpIHsKKyAgICAgICAgICAgIHRoaXMudmlld0lkID0gdmlld0lkOworICAgICAgICAgICAgdGhpcy5lbXB0eVZpZXdJZCA9IGVtcHR5Vmlld0lkOworICAgICAgICB9CisKKyAgICAgICAgU2V0RW1wdHlWaWV3KFBhcmNlbCBpbikgeworICAgICAgICAgICAgdGhpcy52aWV3SWQgPSBpbi5yZWFkSW50KCk7CisgICAgICAgICAgICB0aGlzLmVtcHR5Vmlld0lkID0gaW4ucmVhZEludCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgb3V0LCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgICAgIG91dC53cml0ZUludChUQUcpOworICAgICAgICAgICAgb3V0LndyaXRlSW50KHRoaXMudmlld0lkKTsKKyAgICAgICAgICAgIG91dC53cml0ZUludCh0aGlzLmVtcHR5Vmlld0lkKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBhcHBseShWaWV3IHJvb3QpIHsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcgdmlldyA9IHJvb3QuZmluZFZpZXdCeUlkKHZpZXdJZCk7CisgICAgICAgICAgICBpZiAoISh2aWV3IGluc3RhbmNlb2YgQWRhcHRlclZpZXc8Pz4pKSByZXR1cm47CisKKyAgICAgICAgICAgIEFkYXB0ZXJWaWV3PD8+IGFkYXB0ZXJWaWV3ID0gKEFkYXB0ZXJWaWV3PD8+KSB2aWV3OworCisgICAgICAgICAgICBmaW5hbCBWaWV3IGVtcHR5VmlldyA9IHJvb3QuZmluZFZpZXdCeUlkKGVtcHR5Vmlld0lkKTsKKyAgICAgICAgICAgIGlmIChlbXB0eVZpZXcgPT0gbnVsbCkgcmV0dXJuOworCisgICAgICAgICAgICBhZGFwdGVyVmlldy5zZXRFbXB0eVZpZXcoZW1wdHlWaWV3KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgU2V0T25DbGlja0ZpbGxJbkludGVudCBleHRlbmRzIEFjdGlvbiB7CisgICAgICAgIHB1YmxpYyBTZXRPbkNsaWNrRmlsbEluSW50ZW50KGludCBpZCwgSW50ZW50IGZpbGxJbkludGVudCkgeworICAgICAgICAgICAgdGhpcy52aWV3SWQgPSBpZDsKKyAgICAgICAgICAgIHRoaXMuZmlsbEluSW50ZW50ID0gZmlsbEluSW50ZW50OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFNldE9uQ2xpY2tGaWxsSW5JbnRlbnQoUGFyY2VsIHBhcmNlbCkgeworICAgICAgICAgICAgdmlld0lkID0gcGFyY2VsLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIGZpbGxJbkludGVudCA9IEludGVudC5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwocGFyY2VsKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgeworICAgICAgICAgICAgZGVzdC53cml0ZUludChUQUcpOworICAgICAgICAgICAgZGVzdC53cml0ZUludCh2aWV3SWQpOworICAgICAgICAgICAgZmlsbEluSW50ZW50LndyaXRlVG9QYXJjZWwoZGVzdCwgMCAvKiBubyBmbGFncyAqLyk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgYXBwbHkoVmlldyByb290KSB7CisgICAgICAgICAgICBmaW5hbCBWaWV3IHRhcmdldCA9IHJvb3QuZmluZFZpZXdCeUlkKHZpZXdJZCk7CisgICAgICAgICAgICBpZiAodGFyZ2V0ID09IG51bGwpIHJldHVybjsKKworICAgICAgICAgICAgaWYgKCFtSXNXaWRnZXRDb2xsZWN0aW9uQ2hpbGQpIHsKKyAgICAgICAgICAgICAgICBMb2cuZSgiUmVtb3RlVmlld3MiLCAiVGhlIG1ldGhvZCBzZXRPbkNsaWNrRmlsbEluSW50ZW50IGlzIGF2YWlsYWJsZSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICJvbmx5IGZyb20gUmVtb3RlVmlld3NGYWN0b3J5IChpZS4gb24gY29sbGVjdGlvbiBpdGVtcykuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHRhcmdldCA9PSByb290KSB7CisgICAgICAgICAgICAgICAgdGFyZ2V0LnNldFRhZ0ludGVybmFsKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuZmlsbEluSW50ZW50LCBmaWxsSW5JbnRlbnQpOworICAgICAgICAgICAgfSBlbHNlIGlmICh0YXJnZXQgIT0gbnVsbCAmJiBmaWxsSW5JbnRlbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIE9uQ2xpY2tMaXN0ZW5lciBsaXN0ZW5lciA9IG5ldyBPbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbnN1cmUgdGhhdCB0aGlzIHZpZXcgaXMgYSBjaGlsZCBvZiBhbiBBZGFwdGVyVmlldworICAgICAgICAgICAgICAgICAgICAgICAgVmlldyBwYXJlbnQgPSAoVmlldykgdi5nZXRQYXJlbnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICghKHBhcmVudCBpbnN0YW5jZW9mIEFkYXB0ZXJWaWV3PD8+KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhKHBhcmVudCBpbnN0YW5jZW9mIEFwcFdpZGdldEhvc3RWaWV3KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudCA9IChWaWV3KSBwYXJlbnQuZ2V0UGFyZW50KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnQgaW5zdGFuY2VvZiBBcHBXaWRnZXRIb3N0VmlldykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNvbWVob3cgdGhleSd2ZSBtYW5hZ2VkIHRvIGdldCB0aGlzIGZhciB3aXRob3V0IGhhdmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFuZCBBZGFwdGVyVmlldyBhcyBhIHBhcmVudC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZSgiUmVtb3RlVmlld3MiLCAiQ29sbGVjdGlvbiBpdGVtIGRvZXNuJ3QgaGF2ZSBBZGFwdGVyVmlldyBwYXJlbnQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluc3VyZSB0aGF0IGEgdGVtcGxhdGUgcGVuZGluZyBpbnRlbnQgaGFzIGJlZW4gc2V0IG9uIGFuIGFuY2VzdG9yCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShwYXJlbnQuZ2V0VGFnKCkgaW5zdGFuY2VvZiBQZW5kaW5nSW50ZW50KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKCJSZW1vdGVWaWV3cyIsICJBdHRlbXB0aW5nIHNldE9uQ2xpY2tGaWxsSW5JbnRlbnQgd2l0aG91dCIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBjYWxsaW5nIHNldFBlbmRpbmdJbnRlbnRUZW1wbGF0ZSBvbiBwYXJlbnQuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBQZW5kaW5nSW50ZW50IHBlbmRpbmdJbnRlbnQgPSAoUGVuZGluZ0ludGVudCkgcGFyZW50LmdldFRhZygpOworCisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBmbG9hdCBhcHBTY2FsZSA9IHYuZ2V0Q29udGV4dCgpLmdldFJlc291cmNlcygpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb21wYXRpYmlsaXR5SW5mbygpLmFwcGxpY2F0aW9uU2NhbGU7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnRbXSBwb3MgPSBuZXcgaW50WzJdOworICAgICAgICAgICAgICAgICAgICAgICAgdi5nZXRMb2NhdGlvbk9uU2NyZWVuKHBvcyk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgcmVjdCA9IG5ldyBSZWN0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZWN0LmxlZnQgPSAoaW50KSAocG9zWzBdICogYXBwU2NhbGUgKyAwLjVmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QudG9wID0gKGludCkgKHBvc1sxXSAqIGFwcFNjYWxlICsgMC41Zik7CisgICAgICAgICAgICAgICAgICAgICAgICByZWN0LnJpZ2h0ID0gKGludCkgKChwb3NbMF0gKyB2LmdldFdpZHRoKCkpICogYXBwU2NhbGUgKyAwLjVmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QuYm90dG9tID0gKGludCkgKChwb3NbMV0gKyB2LmdldEhlaWdodCgpKSAqIGFwcFNjYWxlICsgMC41Zik7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbGxJbkludGVudC5zZXRTb3VyY2VCb3VuZHMocmVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGFydEludGVudFNhZmVseSh2LmdldENvbnRleHQoKSwgcGVuZGluZ0ludGVudCwgZmlsbEluSW50ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0YXJnZXQuc2V0T25DbGlja0xpc3RlbmVyKGxpc3RlbmVyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGludCB2aWV3SWQ7CisgICAgICAgIEludGVudCBmaWxsSW5JbnRlbnQ7CisKKyAgICAgICAgcHVibGljIGZpbmFsIHN0YXRpYyBpbnQgVEFHID0gOTsKKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFNldFBlbmRpbmdJbnRlbnRUZW1wbGF0ZSBleHRlbmRzIEFjdGlvbiB7CisgICAgICAgIHB1YmxpYyBTZXRQZW5kaW5nSW50ZW50VGVtcGxhdGUoaW50IGlkLCBQZW5kaW5nSW50ZW50IHBlbmRpbmdJbnRlbnRUZW1wbGF0ZSkgeworICAgICAgICAgICAgdGhpcy52aWV3SWQgPSBpZDsKKyAgICAgICAgICAgIHRoaXMucGVuZGluZ0ludGVudFRlbXBsYXRlID0gcGVuZGluZ0ludGVudFRlbXBsYXRlOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFNldFBlbmRpbmdJbnRlbnRUZW1wbGF0ZShQYXJjZWwgcGFyY2VsKSB7CisgICAgICAgICAgICB2aWV3SWQgPSBwYXJjZWwucmVhZEludCgpOworICAgICAgICAgICAgcGVuZGluZ0ludGVudFRlbXBsYXRlID0gUGVuZGluZ0ludGVudC5yZWFkUGVuZGluZ0ludGVudE9yTnVsbEZyb21QYXJjZWwocGFyY2VsKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgeworICAgICAgICAgICAgZGVzdC53cml0ZUludChUQUcpOworICAgICAgICAgICAgZGVzdC53cml0ZUludCh2aWV3SWQpOworICAgICAgICAgICAgcGVuZGluZ0ludGVudFRlbXBsYXRlLndyaXRlVG9QYXJjZWwoZGVzdCwgMCAvKiBubyBmbGFncyAqLyk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgYXBwbHkoVmlldyByb290KSB7CisgICAgICAgICAgICBmaW5hbCBWaWV3IHRhcmdldCA9IHJvb3QuZmluZFZpZXdCeUlkKHZpZXdJZCk7CisgICAgICAgICAgICBpZiAodGFyZ2V0ID09IG51bGwpIHJldHVybjsKKworICAgICAgICAgICAgLy8gSWYgdGhlIHZpZXcgaXNuJ3QgYW4gQWRhcHRlclZpZXcsIHNldHRpbmcgYSBQZW5kaW5nSW50ZW50IHRlbXBsYXRlIGRvZXNuJ3QgbWFrZSBzZW5zZQorICAgICAgICAgICAgaWYgKHRhcmdldCBpbnN0YW5jZW9mIEFkYXB0ZXJWaWV3PD8+KSB7CisgICAgICAgICAgICAgICAgQWRhcHRlclZpZXc8Pz4gYXYgPSAoQWRhcHRlclZpZXc8Pz4pIHRhcmdldDsKKyAgICAgICAgICAgICAgICAvLyBUaGUgUGVuZGluZ0ludGVudCB0ZW1wbGF0ZSBpcyBzdG9yZWQgaW4gdGhlIHZpZXcncyB0YWcuCisgICAgICAgICAgICAgICAgT25JdGVtQ2xpY2tMaXN0ZW5lciBsaXN0ZW5lciA9IG5ldyBPbkl0ZW1DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkl0ZW1DbGljayhBZGFwdGVyVmlldzw/PiBwYXJlbnQsIFZpZXcgdmlldywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24sIGxvbmcgaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSB2aWV3IHNob3VsZCBiZSBhIGZyYW1lIGxheW91dAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZpZXcgaW5zdGFuY2VvZiBWaWV3R3JvdXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAgdmcgPSAoVmlld0dyb3VwKSB2aWV3OworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWRhcHRlclZpZXdzIGNvbnRhaW4gdGhlaXIgY2hpbGRyZW4gaW4gYSBmcmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNvIHdlIG5lZWQgdG8gZ28gb25lIGxheWVyIGRlZXBlciBoZXJlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnQgaW5zdGFuY2VvZiBBZGFwdGVyVmlld0FuaW1hdG9yKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZnID0gKFZpZXdHcm91cCkgdmcuZ2V0Q2hpbGRBdCgwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZnID09IG51bGwpIHJldHVybjsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVudCBmaWxsSW5JbnRlbnQgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGlsZENvdW50ID0gdmcuZ2V0Q2hpbGRDb3VudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY2hpbGRDb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdCB0YWcgPSB2Zy5nZXRDaGlsZEF0KGkpLmdldFRhZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLmZpbGxJbkludGVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0YWcgaW5zdGFuY2VvZiBJbnRlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGxJbkludGVudCA9IChJbnRlbnQpIHRhZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxsSW5JbnRlbnQgPT0gbnVsbCkgcmV0dXJuOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgYXBwU2NhbGUgPSB2aWV3LmdldENvbnRleHQoKS5nZXRSZXNvdXJjZXMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbXBhdGliaWxpdHlJbmZvKCkuYXBwbGljYXRpb25TY2FsZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnRbXSBwb3MgPSBuZXcgaW50WzJdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXcuZ2V0TG9jYXRpb25PblNjcmVlbihwb3MpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgUmVjdCByZWN0ID0gbmV3IFJlY3QoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWN0LmxlZnQgPSAoaW50KSAocG9zWzBdICogYXBwU2NhbGUgKyAwLjVmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWN0LnRvcCA9IChpbnQpIChwb3NbMV0gKiBhcHBTY2FsZSArIDAuNWYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QucmlnaHQgPSAoaW50KSAoKHBvc1swXSArIHZpZXcuZ2V0V2lkdGgoKSkgKiBhcHBTY2FsZSArIDAuNWYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QuYm90dG9tID0gKGludCkgKChwb3NbMV0gKyB2aWV3LmdldEhlaWdodCgpKSAqIGFwcFNjYWxlICsgMC41Zik7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5zZXRTb3VyY2VCb3VuZHMocmVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRJbnRlbnRTYWZlbHkodmlldy5nZXRDb250ZXh0KCksIHBlbmRpbmdJbnRlbnRUZW1wbGF0ZSwgZmlsbEluSW50ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgYXYuc2V0T25JdGVtQ2xpY2tMaXN0ZW5lcihsaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgYXYuc2V0VGFnKHBlbmRpbmdJbnRlbnRUZW1wbGF0ZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIExvZy5lKCJSZW1vdGVWaWV3cyIsICJDYW5ub3Qgc2V0UGVuZGluZ0ludGVudFRlbXBsYXRlIG9uIGEgdmlldyB3aGljaCBpcyBub3QiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICJhbiBBZGFwdGVyVmlldyAoaWQ6ICIgKyB2aWV3SWQgKyAiKSIpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGludCB2aWV3SWQ7CisgICAgICAgIFBlbmRpbmdJbnRlbnQgcGVuZGluZ0ludGVudFRlbXBsYXRlOworCisgICAgICAgIHB1YmxpYyBmaW5hbCBzdGF0aWMgaW50IFRBRyA9IDg7CiAgICAgfQogCiAgICAgLyoqCkBAIC0xMjAsMjEgKzM2NCwzMSBAQAogICAgICAgICAgICAgdGhpcy52aWV3SWQgPSBpZDsKICAgICAgICAgICAgIHRoaXMucGVuZGluZ0ludGVudCA9IHBlbmRpbmdJbnRlbnQ7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcHVibGljIFNldE9uQ2xpY2tQZW5kaW5nSW50ZW50KFBhcmNlbCBwYXJjZWwpIHsKICAgICAgICAgICAgIHZpZXdJZCA9IHBhcmNlbC5yZWFkSW50KCk7CiAgICAgICAgICAgICBwZW5kaW5nSW50ZW50ID0gUGVuZGluZ0ludGVudC5yZWFkUGVuZGluZ0ludGVudE9yTnVsbEZyb21QYXJjZWwocGFyY2VsKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhcmNlbCBkZXN0LCBpbnQgZmxhZ3MpIHsKICAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoVEFHKTsKICAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQodmlld0lkKTsKICAgICAgICAgICAgIHBlbmRpbmdJbnRlbnQud3JpdGVUb1BhcmNlbChkZXN0LCAwIC8qIG5vIGZsYWdzICovKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIHZvaWQgYXBwbHkoVmlldyByb290KSB7CiAgICAgICAgICAgICBmaW5hbCBWaWV3IHRhcmdldCA9IHJvb3QuZmluZFZpZXdCeUlkKHZpZXdJZCk7CisgICAgICAgICAgICBpZiAodGFyZ2V0ID09IG51bGwpIHJldHVybjsKKworICAgICAgICAgICAgLy8gSWYgdGhlIHZpZXcgaXMgYW4gQWRhcHRlclZpZXcsIHNldHRpbmcgYSBQZW5kaW5nSW50ZW50IG9uIGNsaWNrIGRvZXNuJ3QgbWFrZSBtdWNoCisgICAgICAgICAgICAvLyBzZW5zZSwgZG8gdGhleSBtZWFuIHRvIHNldCBhIFBlbmRpbmdJbnRlbnQgdGVtcGxhdGUgZm9yIHRoZSBBZGFwdGVyVmlldydzIGNoaWxkcmVuPworICAgICAgICAgICAgaWYgKG1Jc1dpZGdldENvbGxlY3Rpb25DaGlsZCkgeworICAgICAgICAgICAgICAgIExvZy5lKCJSZW1vdGVWaWV3cyIsICJDYW5ub3Qgc2V0T25DbGlja1BlbmRpbmdJbnRlbnQgZm9yIGNvbGxlY3Rpb24gaXRlbSAiICsKKwkJCQkiKGlkOiAiICsgdmlld0lkICsgIikiKTsKKyAgICAgICAgICAgICAgICAvLyBUT0RPOiByZXR1cm47IFdlJ2xsIGxldCB0aGlzIHNsaWRlIHVudGlsIGFwcHMgYXJlIHVwIHRvIGRhdGUuCisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIGlmICh0YXJnZXQgIT0gbnVsbCAmJiBwZW5kaW5nSW50ZW50ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBPbkNsaWNrTGlzdGVuZXIgbGlzdGVuZXIgPSBuZXcgT25DbGlja0xpc3RlbmVyKCkgewogICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgewpAQCAtMTUzLDE1ICs0MDcsNyBAQAogCiAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LnNldFNvdXJjZUJvdW5kcyhyZWN0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogVW5yZWdpc3RlciB0aGlzIGhhbmRsZXIgaWYgUGVuZGluZ0ludGVudC5GTEFHX09ORV9TSE9UPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYuZ2V0Q29udGV4dCgpLnN0YXJ0SW50ZW50U2VuZGVyKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVuZGluZ0ludGVudC5nZXRJbnRlbnRTZW5kZXIoKSwgaW50ZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50ZW50LkZMQUdfQUNUSVZJVFlfTkVXX1RBU0ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnRlbnQuRkxBR19BQ1RJVklUWV9ORVdfVEFTSywgMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlbnRTZW5kZXIuU2VuZEludGVudEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC51dGlsLkxvZy5lKExPR19UQUcsICJDYW5ub3Qgc2VuZCBwZW5kaW5nIGludGVudDogIiwgZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzdGFydEludGVudFNhZmVseSh2LmdldENvbnRleHQoKSwgcGVuZGluZ0ludGVudCwgaW50ZW50KTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgdGFyZ2V0LnNldE9uQ2xpY2tMaXN0ZW5lcihsaXN0ZW5lcik7CkBAIC0yMjksOSArNDc1LDcgQEAKICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyB2b2lkIGFwcGx5KFZpZXcgcm9vdCkgewogICAgICAgICAgICAgZmluYWwgVmlldyB0YXJnZXQgPSByb290LmZpbmRWaWV3QnlJZCh2aWV3SWQpOwotICAgICAgICAgICAgaWYgKHRhcmdldCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHRhcmdldCA9PSBudWxsKSByZXR1cm47CiAgICAgICAgICAgICAKICAgICAgICAgICAgIC8vIFBpY2sgdGhlIGNvcnJlY3QgZHJhd2FibGUgdG8gbW9kaWZ5IGZvciB0aGlzIHZpZXcKICAgICAgICAgICAgIERyYXdhYmxlIHRhcmdldERyYXdhYmxlID0gbnVsbDsKQEAgLTI1NSw3ICs0OTksNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBpbnQgdmlld0lkOwogICAgICAgICBib29sZWFuIHRhcmdldEJhY2tncm91bmQ7CiAgICAgICAgIGludCBhbHBoYTsKQEAgLTI2Niw2ICs1MTAsNjEgQEAKICAgICAgICAgcHVibGljIGZpbmFsIHN0YXRpYyBpbnQgVEFHID0gMzsKICAgICB9CiAgICAgCisgICAgcHJpdmF0ZSBjbGFzcyBSZWZsZWN0aW9uQWN0aW9uV2l0aG91dFBhcmFtcyBleHRlbmRzIEFjdGlvbiB7CisgICAgICAgIGludCB2aWV3SWQ7CisgICAgICAgIFN0cmluZyBtZXRob2ROYW1lOworCisgICAgICAgIHB1YmxpYyBmaW5hbCBzdGF0aWMgaW50IFRBRyA9IDU7CisKKyAgICAgICAgUmVmbGVjdGlvbkFjdGlvbldpdGhvdXRQYXJhbXMoaW50IHZpZXdJZCwgU3RyaW5nIG1ldGhvZE5hbWUpIHsKKyAgICAgICAgICAgIHRoaXMudmlld0lkID0gdmlld0lkOworICAgICAgICAgICAgdGhpcy5tZXRob2ROYW1lID0gbWV0aG9kTmFtZTsKKyAgICAgICAgfQorCisgICAgICAgIFJlZmxlY3Rpb25BY3Rpb25XaXRob3V0UGFyYW1zKFBhcmNlbCBpbikgeworICAgICAgICAgICAgdGhpcy52aWV3SWQgPSBpbi5yZWFkSW50KCk7CisgICAgICAgICAgICB0aGlzLm1ldGhvZE5hbWUgPSBpbi5yZWFkU3RyaW5nKCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhcmNlbCBvdXQsIGludCBmbGFncykgeworICAgICAgICAgICAgb3V0LndyaXRlSW50KFRBRyk7CisgICAgICAgICAgICBvdXQud3JpdGVJbnQodGhpcy52aWV3SWQpOworICAgICAgICAgICAgb3V0LndyaXRlU3RyaW5nKHRoaXMubWV0aG9kTmFtZSk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgYXBwbHkoVmlldyByb290KSB7CisgICAgICAgICAgICBmaW5hbCBWaWV3IHZpZXcgPSByb290LmZpbmRWaWV3QnlJZCh2aWV3SWQpOworICAgICAgICAgICAgaWYgKHZpZXcgPT0gbnVsbCkgcmV0dXJuOworCisgICAgICAgICAgICBDbGFzcyBrbGFzcyA9IHZpZXcuZ2V0Q2xhc3MoKTsKKyAgICAgICAgICAgIE1ldGhvZCBtZXRob2Q7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1ldGhvZCA9IGtsYXNzLmdldE1ldGhvZCh0aGlzLm1ldGhvZE5hbWUpOworICAgICAgICAgICAgfSBjYXRjaCAoTm9TdWNoTWV0aG9kRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFjdGlvbkV4Y2VwdGlvbigidmlldzogIiArIGtsYXNzLmdldE5hbWUoKSArICIgZG9lc24ndCBoYXZlIG1ldGhvZDogIgorICAgICAgICAgICAgICAgICAgICAgICAgKyB0aGlzLm1ldGhvZE5hbWUgKyAiKCkiKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFtZXRob2QuaXNBbm5vdGF0aW9uUHJlc2VudChSZW1vdGFibGVWaWV3TWV0aG9kLmNsYXNzKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBBY3Rpb25FeGNlcHRpb24oInZpZXc6ICIgKyBrbGFzcy5nZXROYW1lKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBjYW4ndCB1c2UgbWV0aG9kIHdpdGggUmVtb3RlVmlld3M6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgdGhpcy5tZXRob2ROYW1lICsgIigpIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgLy9ub2luc3BlY3Rpb24gQ29uc3RhbnRJZlN0YXRlbWVudAorICAgICAgICAgICAgICAgIGlmIChmYWxzZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZCgiUmVtb3RlVmlld3MiLCAidmlldzogIiArIGtsYXNzLmdldE5hbWUoKSArICIgY2FsbGluZyBtZXRob2Q6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgdGhpcy5tZXRob2ROYW1lICsgIigpIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1ldGhvZC5pbnZva2Uodmlldyk7CisgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQWN0aW9uRXhjZXB0aW9uKGV4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKwogICAgIC8qKgogICAgICAqIEJhc2UgY2xhc3MgZm9yIHRoZSByZWZsZWN0aW9uIGFjdGlvbnMuCiAgICAgICovCkBAIC0yODUsNiArNTg0LDcgQEAKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBVUkkgPSAxMTsKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBCSVRNQVAgPSAxMjsKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBCVU5ETEUgPSAxMzsKKyAgICAgICAgc3RhdGljIGZpbmFsIGludCBJTlRFTlQgPSAxNDsKIAogICAgICAgICBpbnQgdmlld0lkOwogICAgICAgICBTdHJpbmcgbWV0aG9kTmFtZTsKQEAgLTM0Nyw2ICs2NDcsOSBAQAogICAgICAgICAgICAgICAgIGNhc2UgQlVORExFOgogICAgICAgICAgICAgICAgICAgICB0aGlzLnZhbHVlID0gaW4ucmVhZEJ1bmRsZSgpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIElOVEVOVDoKKyAgICAgICAgICAgICAgICAgICAgdGhpcy52YWx1ZSA9IEludGVudC5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoaW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KQEAgLTQwMiw2ICs3MDUsOSBAQAogICAgICAgICAgICAgICAgIGNhc2UgQlVORExFOgogICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVCdW5kbGUoKEJ1bmRsZSkgdGhpcy52YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgSU5URU5UOgorICAgICAgICAgICAgICAgICAgICAoKEludGVudCl0aGlzLnZhbHVlKS53cml0ZVRvUGFyY2VsKG91dCwgZmxhZ3MpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KQEAgLTQzNSw2ICs3NDEsOCBAQAogICAgICAgICAgICAgICAgICAgICByZXR1cm4gQml0bWFwLmNsYXNzOwogICAgICAgICAgICAgICAgIGNhc2UgQlVORExFOgogICAgICAgICAgICAgICAgICAgICByZXR1cm4gQnVuZGxlLmNsYXNzOworICAgICAgICAgICAgICAgIGNhc2UgSU5URU5UOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gSW50ZW50LmNsYXNzOwogICAgICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgfQpAQCAtNDQzLDkgKzc1MSw3IEBACiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgdm9pZCBhcHBseShWaWV3IHJvb3QpIHsKICAgICAgICAgICAgIGZpbmFsIFZpZXcgdmlldyA9IHJvb3QuZmluZFZpZXdCeUlkKHZpZXdJZCk7Ci0gICAgICAgICAgICBpZiAodmlldyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFjdGlvbkV4Y2VwdGlvbigiY2FuJ3QgZmluZCB2aWV3OiAweCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKHZpZXdJZCkpOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHZpZXcgPT0gbnVsbCkgcmV0dXJuOwogCiAgICAgICAgICAgICBDbGFzcyBwYXJhbSA9IGdldFBhcmFtZXRlclR5cGUoKTsKICAgICAgICAgICAgIGlmIChwYXJhbSA9PSBudWxsKSB7CkBAIC00ODEsNiArNzg3LDM1IEBACiAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFjdGlvbkV4Y2VwdGlvbihleCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgdXBkYXRlTWVtb3J5VXNhZ2VFc3RpbWF0ZShNZW1vcnlVc2FnZUNvdW50ZXIgY291bnRlcikgeworICAgICAgICAgICAgLy8gV2UgY3VycmVudGx5IG9ubHkgY2FsY3VsYXRlIEJpdG1hcCBtZW1vcnkgdXNhZ2UKKyAgICAgICAgICAgIHN3aXRjaCAodGhpcy50eXBlKSB7CisgICAgICAgICAgICAgICAgY2FzZSBCSVRNQVA6CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnZhbHVlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIEJpdG1hcCBiID0gKEJpdG1hcCkgdGhpcy52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIEJpdG1hcC5Db25maWcgYyA9IGIuZ2V0Q29uZmlnKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgYnBwID0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoYykgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBBTFBIQV84OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJwcCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFJHQl81NjU6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEFSR0JfNDQ0NDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicHAgPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBBUkdCXzg4ODg6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnBwID0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50ZXIuYml0bWFwSW5jcmVtZW50KGIuZ2V0V2lkdGgoKSAqIGIuZ2V0SGVpZ2h0KCkgKiBicHApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC01MDksMTUgKzg0NCwyMyBAQAogICAgICAgICBwdWJsaWMgdm9pZCBhcHBseShWaWV3IHJvb3QpIHsKICAgICAgICAgICAgIGZpbmFsIENvbnRleHQgY29udGV4dCA9IHJvb3QuZ2V0Q29udGV4dCgpOwogICAgICAgICAgICAgZmluYWwgVmlld0dyb3VwIHRhcmdldCA9IChWaWV3R3JvdXApIHJvb3QuZmluZFZpZXdCeUlkKHZpZXdJZCk7CisgICAgICAgICAgICBpZiAodGFyZ2V0ID09IG51bGwpIHJldHVybjsKICAgICAgICAgICAgIGlmIChuZXN0ZWRWaWV3cyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgLy8gSW5mbGF0ZSBuZXN0ZWQgdmlld3MgYW5kIGFkZCBhcyBjaGlsZHJlbgogICAgICAgICAgICAgICAgIHRhcmdldC5hZGRWaWV3KG5lc3RlZFZpZXdzLmFwcGx5KGNvbnRleHQsIHRhcmdldCkpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh0YXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgfSBlbHNlIHsKICAgICA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ICAgICAgICAgICAgIG1BY3Rpb25zID0gbmV3IEFycmF5TGlzdDxBY3Rpb24+KGNvdW50KTsKQEAgLTU2MiwxOCArOTMxLDM4IEBACiAgICAgICAgICAgICAgICAgY2FzZSBWaWV3R3JvdXBBY3Rpb24uVEFHOgogICAgICAgICAgICAgICAgICAgICBtQWN0aW9ucy5hZGQobmV3IFZpZXdHcm91cEFjdGlvbihwYXJjZWwpKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBSZWZsZWN0aW9uQWN0aW9uV2l0aG91dFBhcmFtcy5UQUc6CisgICAgICAgICAgICAgICAgICAgIG1BY3Rpb25zLmFkZChuZXcgUmVmbGVjdGlvbkFjdGlvbldpdGhvdXRQYXJhbXMocGFyY2VsKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2V0RW1wdHlWaWV3LlRBRzoKKyAgICAgICAgICAgICAgICAgICAgbUFjdGlvbnMuYWRkKG5ldyBTZXRFbXB0eVZpZXcocGFyY2VsKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2V0UGVuZGluZ0ludGVudFRlbXBsYXRlLlRBRzoKKyAgICAgICAgICAgICAgICAgICAgbUFjdGlvbnMuYWRkKG5ldyBTZXRQZW5kaW5nSW50ZW50VGVtcGxhdGUocGFyY2VsKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2V0T25DbGlja0ZpbGxJbkludGVudC5UQUc6CisgICAgICAgICAgICAgICAgICAgIG1BY3Rpb25zLmFkZChuZXcgU2V0T25DbGlja0ZpbGxJbkludGVudChwYXJjZWwpKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFjdGlvbkV4Y2VwdG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3Rpb25BY3Rpb25XaXRob3V0UGFyYW1zKHZpZXdJZCwgInNob3dOZXh0IikpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEVxdWl2YWxlbnQgdG8gY2FsbGluZyB7QGxpbmsgQWRhcHRlclZpZXdGbGlwcGVyI3Nob3dQcmV2aW91cygpfQorICAgICAqCisgICAgICogQHBhcmFtIHZpZXdJZCBUaGUgaWQgb2YgdGhlIHZpZXcgb24gd2hpY2ggdG8gY2FsbCB7QGxpbmsgQWRhcHRlclZpZXdGbGlwcGVyI3Nob3dQcmV2aW91cygpfQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNob3dQcmV2aW91cyhpbnQgdmlld0lkKSB7CisgICAgICAgIGFkZEFjdGlvbihuZXcgUmVmbGVjdGlvbkFjdGlvbldpdGhvdXRQYXJhbXModmlld0lkLCAic2hvd1ByZXZpb3VzIikpOworICAgIH0KKworICAgIC8qKgogICAgICAqIEVxdWl2YWxlbnQgdG8gY2FsbGluZyBWaWV3LnNldFZpc2liaWxpdHkKICAgICAgKiAKICAgICAgKiBAcGFyYW0gdmlld0lkIFRoZSBpZCBvZiB0aGUgdmlldyB3aG9zZSB2aXNpYmlsaXR5IHNob3VsZCBjaGFuZ2UKQEAgLTYzMCw3ICsxMDczLDcgQEAKICAgICBwdWJsaWMgdm9pZCBzZXRWaWV3VmlzaWJpbGl0eShpbnQgdmlld0lkLCBpbnQgdmlzaWJpbGl0eSkgewogICAgICAgICBzZXRJbnQodmlld0lkLCAic2V0VmlzaWJpbGl0eSIsIHZpc2liaWxpdHkpOwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIEVxdWl2YWxlbnQgdG8gY2FsbGluZyBUZXh0Vmlldy5zZXRUZXh0CiAgICAgICogCkBAIC02NzIsNiArMTExNSwxNiBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIEVxdWl2YWxlbnQgdG8gY2FsbGluZyBBZGFwdGVyVmlldy5zZXRFbXB0eVZpZXcKKyAgICAgK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xJbkludGVudAorICAgICAqIEBwYXJhbSBmaWxsSW5JbnRlbnQgVGhlIGludGVudCB3aGljaCB3aWxsIGJlIGNvbWJpbmVkIHdpdGggdGhlIHBhcmVudCdzIFBlbmRpbmdJbnRlbnQKKyAgICAgKiAgICAgICAgaW4gb3JkZXIgdG8gZGV0ZXJtaW5lIHRoZSBvbi1jbGljayBiZWhhdmlvciBvZiB0aGUgdmlldyBzcGVjaWZpZWQgYnkgdmlld0lkCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0T25DbGlja0ZpbGxJbkludGVudChpbnQgdmlld0lkLCBJbnRlbnQgZmlsbEluSW50ZW50KSB7CisgICAgICAgIGFkZEFjdGlvbihuZXcgU2V0T25DbGlja0ZpbGxJbkludGVudCh2aWV3SWQsIGZpbGxJbkludGVudCkpOworICAgIH0KKworICAgIC8qKgogICAgICAqIEBoaWRlCiAgICAgICogRXF1aXZhbGVudCB0byBjYWxsaW5nIGEgY29tYmluYXRpb24gb2Yge0BsaW5rIERyYXdhYmxlI3NldEFscGhhKGludCl9LAogICAgICAqIHtAbGluayBEcmF3YWJsZSNzZXRDb2xvckZpbHRlcihpbnQsIGFuZHJvaWQuZ3JhcGhpY3MuUG9ydGVyRHVmZi5Nb2RlKX0sCkBAIC03NjksNiArMTI2NiwzNyBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIEVxdWl2YWxlbnQgdG8gY2FsbGluZyB7QGxpbmsgYW5kcm9pZC53aWRnZXQuQWJzTGlzdFZpZXcjc2V0UmVtb3RlVmlld3NBZGFwdGVyKEludGVudCl9LgorICAgICAqCisgICAgICogQHBhcmFtIHZpZXdJZCBUaGUgaWQgb2YgdGhlIHZpZXcgd2hvc2UgdGV4dCBzaG91bGQgY2hhbmdlCisgICAgICogQHBhcmFtIGludGVudCBUaGUgaW50ZW50IG9mIHRoZSBzZXJ2aWNlIHdoaWNoIHdpbGwgYmUKKyAgICAgKiAgICAgICAgICAgIHByb3ZpZGluZyBkYXRhIHRvIHR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ICAgICAgICBmaW5hbCBSZW1vdGVWaWV3c0FkYXB0ZXIgYWRhcHRlciA9IG1BZGFwdGVyLmdldCgpOworICAgICAgICAgICAgaWYgKGFkYXB0ZXIgPT0gbnVsbCkgcmV0dXJuOworICAgICAgICAgICAgYWRhcHRlci5tV29ya2VyUXVldWUucG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICAvLyBDYWxsIGJhY2sgdG8gdGhlIHNlcnZpY2UgdG8gbm90aWZ5IHRoYXQgdGhlIGRhdGEgc2V0IGNoYW5nZWQKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFkYXB0ZXIubVNlcnZpY2VDb25uZWN0aW9uLmlzQ29ubmVjdGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIElSZW1vdGVWaWV3c0ZhY3RvcnkgZmFjdG9yeSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRhcHRlci5tU2VydmljZUNvbm5lY3Rpb24uZ2V0UmVtb3RlVmlld3NGYWN0b3J5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbGwgYmFjayB0byB0aGUgZmFjdG9yeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhY3Rvcnkub25EYXRhU2V0Q2hhbmdlZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBub3RpZnlpbmcgZmFjdG9yeSBvZiBkYXRhIHNldCBjaGFuZ2VkIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvblNlcnZpY2VDb25uZWN0ZWQoKTogIiArIGUuZ2V0TWVzc2FnZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmV0dXJuIGVhcmx5IHRvIHByZXZlbnQgYW55dGhpbmcgZnVydGhlciBmcm9tIGJlaW5nIG5vdGlmaWVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gKGVmZmVjdGl2ZWx5IG5vdGhpbmcgaGFzIGNoYW5nZWQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBSZXF1ZXN0IG1ldGEgZGF0YSBzbyB0aGF0IHdlIGhhdmUgdXAgdG8gZGF0ZSBkYXRhIHdoZW4gY2FsbGluZyBiYWNrIHRvCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgcmVtb3RlIGFkYXB0ZXIgY2FsbGJhY2sKKyAgICAgICAgICAgICAgICAgICAgICAgIGFkYXB0ZXIudXBkYXRlTWV0YURhdGEoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gUG9zdCBhIHJ1bm5hYmxlIHRvIGNhbGwgYmFjayB0byB0aGUgdmlldyB0byBub3RpZnkgaXQgdGhhdCB3ZSBoYXZlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb25uZWN0ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgIGFkYXB0ZXIubU1haW5RdWV1ZS5wb3N0KG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlbW90ZUFkYXB0ZXJDb25uZWN0aW9uQ2FsbGJhY2sgY2FsbGJhY2sgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRhcHRlci5tQ2FsbGJhY2suZ2V0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjay5vblJlbW90ZUFkYXB0ZXJDb25uZWN0ZWQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VEaXNjb25uZWN0ZWQoQ29tcG9uZW50TmFtZSBuYW1lKSB7CisgICAgICAgICAgICBtQ29ubmVjdGVkID0gZmFsc2U7CisgICAgICAgICAgICBtUmVtb3RlVmlld3NGYWN0b3J5ID0gbnVsbDsKKworICAgICAgICAgICAgZmluYWwgUmVtb3RlVmlld3NBZGFwdGVyIGFkYXB0ZXIgPSBtQWRhcHRlci5nZXQoKTsKKyAgICAgICAgICAgIGlmIChhZGFwdGVyID09IG51bGwpIHJldHVybjsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gQ2xlYXIgdGhlIG1haW4vd29ya2VyIHF1ZXVlcworICAgICAgICAgICAgYWRhcHRlci5tTWFpblF1ZXVlLnJlbW92ZU1lc3NhZ2VzKDApOworICAgICAgICAgICAgYWRhcHRlci5tV29ya2VyUXVldWUucmVtb3ZlTWVzc2FnZXMoMCk7CisKKyAgICAgICAgICAgIC8vIENsZWFyIHRoZSBjYWNoZSAodGhlIG1ldGEgZGF0YSB3aWxsIGJlIHJlLXJlcXVlc3RlZCBvbiBzZXJ2aWNlIHJlLWNvbm5lY3Rpb24pCisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKGFkYXB0ZXIubUNhY2hlKSB7CisgICAgICAgICAgICAgICAgYWRhcHRlci5tQ2FjaGUucmVzZXQoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgUmVtb3RlQWRhcHRlckNvbm5lY3Rpb25DYWxsYmFjayBjYWxsYmFjayA9IGFkYXB0ZXIubUNhbGxiYWNrLmdldCgpOworICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBjYWxsYmFjay5vblJlbW90ZUFkYXB0ZXJEaXNjb25uZWN0ZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBJUmVtb3RlVmlld3NGYWN0b3J5IGdldFJlbW90ZVZpZXdzRmFjdG9yeSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtUmVtb3RlVmlld3NGYWN0b3J5OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNDb25uZWN0ZWQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUNvbm5lY3RlZDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEEgRnJhbWVMYXlvdXQgd2hpY2ggY29udGFpbnMgYSBsb2FkaW5nIHZpZXcsIGFuZCBtYW5hZ2VzIHRoZSByZS9hcHBseWluZyBvZiBSZW1vdGVWaWV3cyB3aGVuCisgICAgICogdGhleSBhcmUgbG9hZGVkLgorICAgICAqLworICAgIHByaXZhdGUgY2xhc3MgUmVtb3RlVmlld3NGcmFtZUxheW91dCBleHRlbmRzIEZyYW1lTGF5b3V0IHsKKyAgICAgICAgcHVibGljIFJlbW90ZVZpZXdzRnJhbWVMYXlvdXQoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0KTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBVcGRhdGVzIHRoaXMgUmVtb3RlVmlld3NGcmFtZUxheW91dCBkZXBlbmRpbm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yYW1lTGF5b3V0Pj4gbVJlZmVyZW5jZXM7CisKKyAgICAgICAgcHVibGljIFJlbW90ZVZpZXdzRnJhbWVMYXlvdXRSZWZTZXQoKSB7CisgICAgICAgICAgICBtUmVmZXJlbmNlcyA9IG5ldyBIYXNoTWFwPEludGVnZXIsIExpbmtlZExpc3Q8UmVtb3RlVmlld3NGcmFtZUxheW91dD4+KCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQWRkcyBhIG5ldyByZWZlcmVuY2UgdG8gYSBSZW1vdGVWaWV3c0ZyYW1lTGF5b3V0IHJldHVybmVkIGJ5IHRoZSBhZGFwdGVyLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgYWRkKGludCBwb3NpdGlvbiwgUmVtb3RlVmlld3NGcmFtZUxheW91dCBsYXlvdXQpIHsKKyAgICAgICAgICAgIGZpbmFsIEludGVnZXIgcG9zID0gcG9zaXRpb247CisgICAgICAgICAgICBMaW5rZWRMaXN0PFJlbW90ZVZpZXdzRnJhbWVMYXlvdXQ+IHJlZnM7CisKKyAgICAgICAgICAgIC8vIENyZWF0ZSB0aGUgbGlzdCBpZiBuZWNlc3NhcnkKKyAgICAgICAgICAgIGlmIChtUmVmZXJlbmNlcy5jb250YWluc0tleShwb3MpKSB7CisgICAgICAgICAgICAgICAgcmVmcyA9IG1SZWZlcmVuY2VzLmdldChwb3MpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZWZzID0gbmV3IExpbmtlZExpc3Q8UmVtb3RlVmlld3NGcmFtZUxheW91dD4oKTsKKyAgICAgICAgICAgICAgICBtUmVmZXJlbmNlcy5wdXQocG9zLCByZWZzKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gQWRkIHRoZSByZWZlcmVuY2VzIHRvIHRoZSBsaXN0CisgICAgICAgICAgICByZWZzLmFkZChsYXlvdXQpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICA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ICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUmVtb3ZlcyBhbGwgcmVmZXJlbmNlcyB0byBhbGwgUmVtb3RlVmlld3NGcmFtZUxheW91dHMgcmV0dXJuZWQgYnkgdGhlIGFkYXB0ZXIuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBjbGVhcigpIHsKKyAgICAgICAgICAgIC8vIFdlIGN1cnJlbnRseSBqdXN0IGNsZWFyIHRoZSByZWZlcmVuY2VzLCBhbmQgbGVhdmUgYWxsIHRoZSBwcmV2aW91cyBsYXlvdXRzIHJldHVybmVkCisgICAgICAgICAgICAvLyBpbiB0aGVpciBkZWZhdWx0IHN0YXRlIG9mIHRoZSBsb2FkaW5nIHZpZXcuCisgICAgICAgICAgICBtUmVmZXJlbmNlcy5jbGVhcigpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhlIG1ldGEtZGF0YSBhc3NvY2lhdGVkIHdpdGggdGhlIGNhY2hlIGluIGl0J3MgY3VycmVudCBzdGF0ZS4KKyAgICAgKi8KKyAgICBwcml2YXRlIGNsYXNzIFJlbW90ZVZpZXdzTWV0YURhdGEgeworICAgICAgICBpbnQgY291bnQ7CisgICAgICAgIGludCB2aWV3VHlwZUNvdW50OworICAgICAgICBib29sZWFuIGhhc1N0YWJsZUlkczsKKyAgICAgICAgYm9vbGVhbiBpc0RhdGFEaXJ0eTsKKworICAgICAgICAvLyBVc2VkIHRvIGRldGVybWluZSBob3cgdG8gY29uc3RydWN0IGxvYWRpbmcgdmlld3MuICBJZiBhIGxvYWRpbmcgdmlldyBpcyBub3Qgc3BlY2lmaWVkCisgICAgICAgIC8vIGJ5IHRoZSB1c2VyLCB0aGVuIHdlIHRyeSBhbmQgbG9hZCB0aGUgZmlyc3QgdmlldywgYW5kIHVzZSBpdHMgaGVpZ2h0IGFzIHRoZSBoZWlnaHQgZm9yCisgICAgICAgIC8vIHRoZSBkZWZhdWx0IGxvYWRpb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5nVmlldzsKKyAgICAgICAgICAgIGlmIChmaXJzdFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1GaXJzdFZpZXcgPSBmaXJzdFZpZXc7CisgICAgICAgICAgICAgICAgbUZpcnN0Vmlld0hlaWdodCA9IC0xOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGludCBnZXRNYXBwZWRWaWV3VHlwZShpbnQgdHlwZUlkKSB7CisgICAgICAgICAgICBpZiAobVR5cGVJZEluZGV4TWFwLmNvbnRhaW5zS2V5KHR5cGVJZCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVR5cGVJZEluZGV4TWFwLmdldCh0eXBlSWQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBXZSArMSBiZWNhdXNlIHRoZSBsb2FkaW5nIHZpZXcgYWx3YXlzIGhhcyB2aWV3IHR5cGUgaWQgb2YgMAorICAgICAgICAgICAgICAgIGludCBpbmNyZW1lbnRhbFR5cGVJZCA9IG1UeXBlSWRJbmRleE1hcC5zaXplKCkgKyAxOworICAgICAgICAgICAgICAgIG1UeXBlSWRJbmRleE1hcC5wdXQodHlwZUlkLCBpbmNyZW1lbnRhbFR5cGVJZCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGluY3JlbWVudGFsVHlwZUlkOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBSZW1vdGVWaWV3c0ZyYW1lTGF5b3V0IGNyZWF0ZUxvYWRpbmdWaWV3KGludCBwb3NpdGlvbiwgVmlldyBjb252ZXJ0VmlldywKKyAgICAgICAgICAgICAgICBWaWV3R3JvdXAgcGFyZW50KSB7CisgICAgICAgICAgICAvLyBDcmVhdGUgYW5kIHJldHVybiBhIG5ldyBGcmFtZUxheW91dCwgYW5kIHNldHVwIHRoZSByZWZlcmVuY2VzIGZvciB0aGlzIHBvc2l0aW9uCisgICAgICAgICAgICBmaW5hbCBDb250ZXh0IGNvbnRleHQgPSBwYXJlbnQuZ2V0Q29udGV4dCgpOworICAgICAgICAgICAgUmVtb3RlVmlld3NGcmFtZUxheW91dCBsYXlvdXQgPSBuZXcgUmVtb3RlVmlld3NGcmFtZUxheW91dChjb250ZXh0KTsKKworICAgICAgICAgICAgLy8gQ3JlYXRlIGEgbmV3IGxvYWRpbmcgdmlldworICAgICAgICAgICAgc3luY2hyb25pemVkIChtQ2FjaGUpIHsKKyAgICAgICAgICAgICAgICBpZiAobVVzZXJMb2FkaW5nVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIEEgdXNlci1zcGVjaWZpZWQgbG9hZGluZyB2aWV3CisgICAgICAgICAgICAgICAgICAgIFZpZXcgbG9hZGluZ1ZpZXcgPSBtVXNlckxvYWRpbmdWaWV3LmFwcGx5KHBhcmVudC5nZXRDb250ZXh0KCksIHBhcmVudCk7CisgICAgICAgICAgICAgICAgICAgIGxvYWRpbmdWaWV3LnNldFRhZ0ludGVybmFsKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQucm93VHlwZUlkLCBuZXcgSW50ZWdlcigwKSk7CisgICAgICAgICAgICAgICAgICAgIGxheW91dC5hZGRWaWV3KGxvYWRpbmdWaWV3KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBBIGRlZmF1bHQgbG9hZGluZyB2aWV3CisgICAgICAgICAgICAgICAgICAgIC8vIFVzZSB0aGUgc2l6ZSBvZiB0aGUgZmlyc3Qgcm93IGFzIGEgZ3VpZGUgZm9yIHRoZSBzaXplIG9mIHRoZSBsb2FkaW5nIHZpZXcKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1GaXJzdFZpZXdIZWlnaHQgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBWaWV3IGZpcnN0VmlldyA9IG1GaXJzdFZpZXcuYXBwbHkocGFyZW50LmdldENvbnRleHQoKSwgcGFyZW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0Vmlldy5tZWFzdXJlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZWFzdXJlU3BlYy5tYWtlTWVhc3VyZVNwZWMoMCwgTWVhc3VyZVNwZWMuVU5TUEVDSUZJRUQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZWFzdXJlU3BlYy5tYWtlTWVhc3VyZVNwZWMoMCwgTWVhc3VyZVNwZWMuVU5TUEVDSUZJRUQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1GaXJzdFZpZXdIZWlnaHQgPSBmaXJzdFZpZXcuZ2V0TWVhc3VyZWRIZWlnaHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1GaXJzdFZpZXcgPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gQ29tcG9zZSB0aGUgbG9hZGluZyB2aWV3IHRleHQKKyAgICAgICAgICAgICAgICAgICAgVGV4dFZpZXcgbG9hZGluZ1RleHRWaWV3ID0gKFRleHRWaWV3KSBtTGF5b3V0SW5mbGF0ZXIuaW5mbGF0ZSgKKwkJCQljb20uYW5kcm9pZC5pbnRlcm5hbC5SLmxheW91dC5yZW1vdGVfdmlld3NfYWRhcHRlcl9kZWZhdWx0X2xvYWRpbmdfdmlldywKKwkJCQlsYXlvdXQsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgbG9hZGluZ1RleHRWaWV3LnNldEhlaWdodChtRmlyc3RWaWV3SGVpZ2h0KTsKKyAgICAgICAgICAgICAgICAgICAgbG9hZGluZ1RleHRWaWV3LnNldFRhZyhuZXcgSW50ZWdlcigwKSk7CisKKyAgICAgICAgICAgICAgICAgICAgbGF5b3V0LmFkZFZpZXcobG9hZGluZ1RleHRWaWV3KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBsYXlvdXQ7CisgICAgICAgIH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vcnkgdXNhZ2UsIGFzIHdlbGwKKyAgICAgICAgICAgICAgICAvLyBhcyB3aGV0aGVyIGl0IHdhcyBkaXJlY3RseSByZXF1ZXN0ZWQgdnMuIHdoZXRoZXIgaXQgd2FzIHByZWxvYWRlZCBieSBvdXIgY2FjaGluZworICAgICAgICAgICAgICAgIC8vIG1lY2hhbmlzbS4KKyAgICAgICAgICAgICAgICBtSW5kZXhSZW1vdGVWaWV3cy5yZW1vdmUoZ2V0RmFydGhlc3RQb3NpdGlvbkZyb20ocG9zaXRpb24pKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gVXBkYXRlIHRoZSBtZXRhZGF0YSBjYWNoZQorICAgICAgICAgICAgaWYgKG1JbmRleE1ldGFEYXRhLmNvbnRhaW5zS2V5KHBvc2l0aW9uKSkgeworICAgICAgICAgICAgICAgIGZpbmFsIFJlbW90ZVZpZXdzSW5kZXhNZXRhRGF0YSBtZXRhRGF0YSA9IG1JbmRleE1ldGFEYXRhLmdldChwb3NpdGlvbik7CisgICAgICAgICAgICAgICAgbWV0YURhdGEuc2V0KHYsIGl0ZW1JZCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1JbmRleE1ldGFEYXRhLnB1dChwb3NpdGlvbiwgbmV3IFJlbW90ZVZpZXdzSW5kZXhNZXRhRGF0YSh2LCBpdGVtSWQpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1JbmRleFJlbW90ZVZpZXdzLnB1dChwb3NpdGlvbiwgdik7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgUmVtb3RlVmlld3NNZXRhRGF0YSBnZXRNZXRhRGF0YSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtTWV0YURhdGE7CisgICAgICAgIH0KKyAgICAgICAgcHVibGljIFJlbW90ZVZpZXdzIGdldFJlbW90ZVZpZXdzQXQoaW50IHBvc2l0aW9uKSB7CisgICAgICAgICAgICBpZiAobUluZGV4UmVtb3RlVmlld3MuY29udGFpbnNLZXkocG9zaXRpb24pKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1JbmRleFJlbW90ZVZpZXdzLmdldChwb3NpdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgUmVtb3RlVmlld3NJbmRleE1ldGFEYXRhIGdldE1ldGFEYXRhQXQoaW50IHBvc2l0aW9uKSB7CisgICAgICAgICAgICBpZiAobUluZGV4TWV0YURhdGEuY29udGFpbnNLZXkocG9zaXRpb24pKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1JbmRleE1ldGFEYXRhLmdldChwb3NpdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgaW50IGdldFJlbW90ZVZpZXdzQml0bWFwTWVtb3J5VXNhZ2UoKSB7CisgICAgICAgICAgICAvLyBDYWxjdWxhdGUgdGhlIG1lbW9yeSB1c2FnZSBvZiBhbGwgdGhlIFJlbW90ZVZpZXdzIGJpdG1hcHMgYmVpbmcgY2FjaGVkCisgICAgICAgICAgICBpbnQgbWVtID0gMDsKKyAgICAgICAgICAgIGZvciAoSW50ZWdlciBpIDogbUluZGV4UmVtb3RlVmlld3Mua2V5U2V0KCkpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBSZW1vdGVWaWV3cyB2ID0gbUluZGV4UmVtb3RlVmlld3MuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmICh2ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbWVtICs9IHYuZXN0aW1hdGVCaXRtYXBNZW1vcnlVc2FnZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBtZW07CisgICAgICAgIH0KKyAgICAgICAgcHJpdmF0ZSBpbnQgZ2V0RmFydGhlc3RQb3NpdGlvbkZyb20oaW50IHBvcykgeworICAgICAgICAgICAgLy8gRmluZCB0aGUgaW5kZXggZmFydGhlc3QgYXdheSBhbmQgcmVtb3ZlIHRoYXQKKyAgICAgICAgICAgIGludCBtYXhEaXN0ID0gMDsKKyAgICAgICAgICAgIGludCBtYXhEaXN0SW5kZXggPSAtMTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgOiBtSW5kZXhSZW1vdGVWaWV3cy5rZXlTZXQoKSkgeworICAgICAgICAgICAgICAgIGludCBkaXN0ID0gTWF0aC5hYnMoaS1wb3MpOworICAgICAgICAgICAgICAgIGlmIChkaXN0ID4gbWF4RGlzdCkgeworICAgICAgICAgICAgICAgICAgICBtYXhEaXN0SW5kZXggPSBpOworICAgICAgICAgICAgICAgICAgICBtYXhEaXN0ID0gZGlzdDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbWF4RGlzdEluZGV4OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcXVldWVSZXF1ZXN0ZWRQb3NpdGlvblRvTG9hZChpbnQgcG9zaXRpb24pIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvYWRJbmRpY2VzKSB7CisgICAgICAgICAgICAgICAgbVJlcXVlc3RlZEluZGljZXMuYWRkKHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgICBtTG9hZEluZGljZXMuYWRkKHBvc2l0aW9uKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgdm9pZCBxdWV1ZVBvc2l0aW9uc1RvQmVQcmVsb2FkZWRGcm9tUmVxdWVzdGVkUG9zaXRpb24oaW50IHBvc2l0aW9uKSB7CisgICAgICAgICAgICAvLyBDaGVjayBpZiB3ZSBuZWVkIHRvIHByZWxvYWQgYW55IGl0ZW1zCisgICAgICAgICAgICBpZiAobVByZWxvYWRMb3dlckJvdW5kIDw9IHBvc2l0aW9uICYmIHBvc2l0aW9uIDw9IG1QcmVsb2FkVXBwZXJCb3VuZCkgeworICAgICAgICAgICAgICAgIGludCBjZW50ZXIgPSAobVByZWxvYWRVcHBlckJvdW5kICsgbVByZWxvYWRMb3dlckJvdW5kKSAvIDI7CisgICAgICAgICAgICAgICAgaWYgKE1hdGguYWJzKHBvc2l0aW9uIC0gY2VudGVyKSA8IG1NYXhDb3VudFNsYWNrKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCBjb3VudCA9IDA7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1NZXRhRGF0YSkgeworICAgICAgICAgICAgICAgIGNvdW50ID0gbU1ldGFEYXRhLmNvdW50OworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3luY2hyb25pemVkIChtTG9hZEluZGljZXMpIHsKKyAgICAgICAgICAgICAgICBtTG9hZEluZGljZXMuY2xlYXIoKTsKKworICAgICAgICAgICAgICAgIC8vIEFkZCBhbGwgdGhlIHJlcXVlc3RlZCBpbmRpY2VzCisgICAgICAgICAgICAgICAgbUxvYWRJbmRpY2VzLmFkZEFsbChtUmVxdWVzdGVkSW5kaWNlcyk7CisKKyAgICAgICAgICAgICAgICAvLyBBZGQgYWxsIHRoZSBwcmVsb2FkIGluZGljZXMKKyAgICAgICAgICAgICAgICBpbnQgaGFsZk1heENvdW50ID0gbU1heENvdW50IC8gMjsKKyAgICAgICAgICAgICAgICBtUHJlbG9hZExvd2VyQm91bmQgPSBwb3NpdGlvbiAtIGhhbGZNYXhDb3VudDsKKyAgICAgICAgICAgICAgICBtUHJlbG9hZFVwcGVyQm91bmQgPSBwb3NpdGlvbiArIGhhbGZNYXhDb3VudDsKKyAgICAgICAgICAgICAgICBpbnQgZWZmZWN0aXZlTG93ZXJCb3VuZCA9IE1hdGgubWF4KDAsIG1QcmVsb2FkTG93ZXJCb3VuZCk7CisgICAgICAgICAgICAgICAgaW50IGVmZmVjdG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KyAgICAgICAgICAgICAgICAgICAgbVJlcXVlc3RlZEluZGljZXMucmVtb3ZlKGkpOworICAgICAgICAgICAgICAgICAgICBtTG9hZEluZGljZXMucmVtb3ZlKGkpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gaS5pbnRWYWx1ZSgpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIE90aGVyd2lzZSwgcHJlbG9hZCBvdGhlciBpbmRpY2VzIGFzIG5lY2Vzc2FyeQorICAgICAgICAgICAgICAgIGlmICghbUxvYWRJbmRpY2VzLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyIGkgPSBtTG9hZEluZGljZXMuaXRlcmF0b3IoKS5uZXh0KCk7CisgICAgICAgICAgICAgICAgICAgIG1Mb2FkSW5kaWNlcy5yZW1vdmUoaSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBpLmludFZhbHVlKCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gY29udGFpbnNSZW1vdGVWaWV3QXQoaW50IHBvc2l0aW9uKSB7CisgICAgICAgICAgICByZXR1cm4gbUluZGV4UmVtb3RlVmlld3MuY29udGFpbnNLZXkocG9zaXRpb24pOworICAgICAgICB9CisgICAgICAgIHB1YmxpYyBib29sZWFuIGNvbnRhaW5zTWV0YURhdGFBdChpbnQgcG9zaXRpb24pIHsKKyAgICAgICAgICAgIHJldHVybiBtSW5kZXhNZXRhRGF0YS5jb250YWluc0tleShwb3NpdGlvbik7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCByZXNldCgpIHsKKyAgICAgICAgICAgIC8vIE5vdGU6IFdlIGRvIG5vdCB0cnkgYW5kIHJlc2V0IHRoZSBtZXRhIGRhdGEsIHNpbmNlIHRoYXQgaW5mb3JtYXRpb24gaXMgc3RpbGwgdXNlZCBieQorICAgICAgICAgICAgLy8gY29sbGVjdGlvbiB2aWV3cyB0byB2YWxpZGF0ZSBpdCdzIG93biBjb250ZW50cyAoYW5kIHdpbGwgYmUgcmUtcmVxdWVzdGVkIGlmIHRoZSBkYXRhCisgICAgICAgICAgICAvLyBpcyBpbnZhbGlkYXRlZCB0aHJvdWdoIHRoZSBub3RpZnlEYXRhU2V0Q2hhbmdlZCgpIGZsb3cpLgorCisgICAgICAgICAgICBtUHJlbG9hZExvd2VyQm91bmQgPSAwOworICAgICAgICAgICAgbVByZWxvYWRVcHBlckJvdW5kID0gLTE7CisgICAgICAgICAgICBtSW5kZXhSZW1vdGVWaWV3cy5jbGVhcigpOworICAgICAgICAgICAgbUluZGV4TWV0YURhdGEuY2xlYXIoKTsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvYWRJbmRpY2VzKSB7CisgICAgICAgICAgICAgICAgbVJlcXVlc3RlZEluZGljZXMuY2xlYXIoKTsKKyAgICAgICAgICAgICAgICBtTG9hZEluZGljZXMuY2xlYXIoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBSZW1vdGVWaWV3c0FkYXB0ZXIoQ29udGV4dCBjb250ZXh0LCBJbnRlbnQgaW50ZW50LCBSZW1vdGVBZGFwdGVyQ29ubmVjdGlvbkNhbGxiYWNrIGNhbGxiYWNrKSB7CisgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKKyAgICAgICAgbUludGVudCA9IGludGVudDsKKyAgICAgICAgbUxheW91dEluZmxhdGVyID0gTGF5b3V0SW5mbGF0ZXIuZnJvbShjb250ZXh0KTsKKyAgICAgICAgaWYgKG1JbnRlbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTm9uLW51bGwgSW50ZW50IG11c3QgYmUgc3BlY2lmaWVkLiIpOworICAgICAgICB9CisgICAgICAgIG1SZ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GV4IHRvIGxvYWQKKyAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24gPSAtMTsKKyAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1DYWNoZSkgeworICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1DYWNoZS5nZXROZXh0SW5kZXhUb0xvYWQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBvc2l0aW9uID4gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gTG9hZCB0aGUgaXRlbSwgYW5kIG5vdGlmeSBhbnkgZXhpc3RpbmcgUmVtb3RlVmlld3NGcmFtZUxheW91dHMKKyAgICAgICAgICAgICAgICAgICAgdXBkYXRlUmVtb3RlVmlld3MocG9zaXRpb24pOworCisgICAgICAgICAgICAgICAgICAgIC8vIFF1ZXVlIHVwIGZvciB0aGUgbmV4dCBvbmUgdG8gbG9hZAorICAgICAgICAgICAgICAgICAgICBsb2FkTmV4dEluZGV4SW5CYWNrZ3JvdW5kKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgdXBkYXRlTWV0YURhdGEoKSB7CisgICAgICAgIGlmIChtU2VydmljZUNvbm5lY3Rpb24uaXNDb25uZWN0ZWQoKSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBJUmVtb3RlVmlld3NGYWN0b3J5IGZhY3RvcnkgPSBtU2VydmljZUNvbm5lY3Rpb24uZ2V0UmVtb3RlVmlld3NGYWN0b3J5KCk7CisKKyAgICAgICAgICAgICAgICAvLyBnZXQgdGhlIHByb3BlcnRpZXMvZmlyc3QgdmlldyAoc28gdGhhdCB3ZSBjYW4gdXNlIGl0IHRvCisgICAgICAgICAgICAgICAgLy8gbWVhc3VyZSBvdXIgZHVtbXkgdmlld3MpCisgICAgICAgICAgICAgICAgYm9vbGVhbiBoYXNTdGFibGVJZHMgPSBmYWN0b3J5Lmhhc1N0YWJsZUlkcygpOworICAgICAgICAgICAgICAgIGludCB2aWV3VHlwZUNvdW50ID0gZmFjdG9yeS5nZXRWaWV3VHlwZUNvdW50KCk7CisgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gZmFjdG9yeS5nZXRDb3VudCgpOworICAgICAgICAgICAgICAgIFJlbW90ZVZpZXdzIGxvYWRpbmdWaWV3ID0gZmFjdG9yeS5nZXRMb2FkaW5nVmlldygpOworICAgICAgICAgICAgICAgIFJlbW90ZVZpZXdzIGZpcnN0VmlldyA9IG51bGw7CisgICAgICAgICAgICAgICAgaWYgKChjb3VudCA+IDApICYmIChsb2FkaW5nVmlldyA9PSBudWxsKSkgeworICAgICAgICAgICAgICAgICAgICBmaXJzdFZpZXcgPSBmYWN0b3J5LmdldFZpZXdBdCgwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZmluYWwgUmVtb3RlVmlld3NNZXRhRGF0YSBtZXRhRGF0YSA9IG1DYWNoZS5nZXRNZXRhRGF0YSgpOworICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobWV0YURhdGEpIHsKKyAgICAgICAgICAgICAgICAgICAgbWV0YURhdGEuaGFzU3RhYmxlSWRzID0gaGFzU3RhYmxlSWRzOworICAgICAgICAgICAgICAgICAgICBtZXRhRGF0YS52aWV3VHlwZUNvdW50ID0gdmlld1R5cGVDb3VudCArIDE7CisgICAgICAgICAgICAgICAgICAgIG1ldGFEYXRhLmNvdW50ID0gY291bnQ7CisgICAgICAgICAgICAgICAgICAgIG1ldGFEYXRhLnNldExvYWRpbmdWaWV3VGVtcGxhdGVzKGxvYWRpbmdWaWV3LCBmaXJzdFZpZXcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgLy8gcHJpbnQgdGhlIGVycm9yCisgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgaW4gcmVxdWVzdE1ldGFEYXRhKCk6ICIgKyBlLmdldE1lc3NhZ2UoKSk7CisKKyAgICAgICAgICAgICAgICAvLyByZXNldCBhbnkgbWVtYmVycyBhZnRlciB0aGUgZmFpbGVkIGNhbGwKKyAgICAgICAgICAgICAgICBmaW5hbCBSZW1vdGVWaWV3c01ldGFEYXRhIG1ldGFEYXRhID0gbUNhY2hlLmdldE1ldGFEYXRhKCk7CisgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtZXRhRGF0YSkgeworICAgICAgICAgICAgICAgICAgICBtZXRhRGF0YS5yZXNldCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB1cGRhdGVSZW1vdGVWaWV3cyhmaW5hbCBpbnQgcG9zaXRpb24pIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlQ29ubmVjdGlvbi5pc0Nvbm5lY3RlZCgpKSB7CisgICAgICAgICAgICBJUmVtb3RlVmlld3NGYWN0b3J5IGZhY3RvcnkgPSBtU2VydmljZUNvbm5lY3Rpb24uZ2V0UmVtb3RlVmlld3NGYWN0b3J5KCk7CisKKyAgICAgICAgICAgIC8vIExvYWQgdGhlIGl0ZW0gaW5mb3JtYXRpb24gZnJvbSB0aGUgcmVtb3RlIHNlcnZpY2UKKyAgICAgICAgICAgIFJlbW90ZVZpZXdzIHJlbW90ZVZpZXdzID0gbnVsbDsKKyAgICAgICAgICAgIGxvbmcgaXRlbUlkID0gMDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmVtb3RlVmlld3MgPSBmYWN0b3J5LmdldFZpZXdBdChwb3NpdGlvbik7CisgICAgICAgICAgICAgICAgaXRlbUlkID0gZmFjdG9yeS5nZXRJdGVtSWQocG9zaXRpb24pOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvLyBQcmludCB0aGUgZXJyb3IKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBpbiB1cGRhdGVSZW1vdGVWaWV3c0luZm8oIiArIHBvc2l0aW9uICsgIik6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgZS5nZXRNZXNzYWdlKCkpOworICAgICAgICAgICAgICAgIGUucHJpbnRTdGFja1RyYWNlKCk7CisKKyAgICAgICAgICAgICAgICAvLyBSZXR1cm4gZWFybHkgdG8gcHJldmVudCBhZGRpdGlvbmFsIHdvcmsgaW4gcmUtY2VudGVyaW5nIHRoZSB2aWV3IGNhY2hlLCBhbmQKKyAgICAgICAgICAgICAgICAvLyBzd2FwcGluZyBmcm9tIHRoZSBsb2FkaW5nIHZpZXcKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUNhY2hlKSB7CisgICAgICAgICAgICAgICAgLy8gQ2FjaGUgdGhlIFJlbW90ZVZpZXdzIHdlIGxvYWRlZAorICAgICAgICAgICAgICAgIG1DYWNoZS5pbnNlcnQocG9zaXRpb24sIHJlbW90ZVZpZXdzLCBpdGVtSWQpOworCisgICAgICAgICAgICAgICAgLy8gTm90aWZ5IGFsbCB0aGUgdmlld3MgdGhhdCB3ZSBoYXZlIHByZXZpb3VzbHkgcmV0dXJuZWQgZm9yIHRoaXMgaW5kZXggdGhhdAorICAgICAgICAgICAgICAgIC8vIHRoZXJlIGlzIG5ldyBkYXRhIGZvciBpdC4KKyAgICAgICAgICAgICAgICBmaW5hbCBSZW1vdGVWaWV3cyBydiA9IHJlbW90ZVZpZXdzOworICAgICAgICAgICAgICAgIGZpbmFsIGludCB0eXBlSWQgPSBtQ2FjaGUuZ2V0TWV0YURhdGFBdChwb3NpdGlvbikudHlwZUlkOworICAgICAgICAgICAgICAgIG1NYWluUXVldWUucG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtUmVxdWVzdGVkVmlld3Mubm90aWZ5T25SZW1vdGVWaWV3c0xvYWRlZChwb3NpdGlvbiwgcnYsIHR5cGVJZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBJbnRlbnQgZ2V0UmVtb3RlVmlld3NTZXJ2aWNlSW50ZW50KCkgeworICAgICAgICByZXR1cm4gbUludGVudDsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldENvdW50KCkgeworICAgICAgICByZXF1ZXN0QmluZFNlcnZpY2UoKTsKKyAgICAgICAgZmluYWwgUmVtb3RlVmlld3NNZXRhRGF0YSBtZXRhRGF0YSA9IG1DYWNoZS5nZXRNZXRhRGF0YSgpOworICAgICAgICBzeW5jaHJvbml6ZWQgKG1ldGFEYXRhKSB7CisgICAgICAgICAgICByZXR1cm4gbWV0YURhdGEuY291bnQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgT2JqZWN0IGdldEl0ZW0oaW50IHBvc2l0aW9uKSB7CisgICAgICAgIC8vIERpc2FsbG93IGFyYml0cmFyeSBvYmplY3QgdG8gYmUgYXNzb2NpYXRlZCB3aXRoIGFuIGl0ZW0gZm9yIHRoZSB0aW1lIGJlaW5nCisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyBsb25nIGdldEl0ZW1JZChpbnQgcG9zaXRpb24pIHsKKyAgICAgICAgcmVxdWVzdEJpbmRTZXJ2aWNlKCk7CisgICAgICAgIHN5bmNocm9uaXplZCAobUNhY2hlKSB7CisgICAgICAgICAgICBpZiAobUNhY2hlLmNvbnRhaW5zTWV0YURhdGFBdChwb3NpdGlvbikpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbUNhY2hlLmdldE1ldGFEYXRhQXQocG9zaXRpb24pLml0ZW1JZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRJdGVtVmlld1R5cGUoaW50IHBvc2l0aW9uKSB7CisgICAgICAgIHJlcXVlc3RCaW5kU2VydmljZSgpOworICAgICAgICBpbnQgdHlwZUlkID0gMDsKKyAgICAgICAgc3luY2hyb25pemVkIChtQ2FjaGUpIHsKKyAgICAgICAgICAgIGlmIChtQ2FjaGUuY29udGFpbnNNZXRhRGF0YUF0KHBvc2l0aW9uKSkgeworICAgICAgICAgICAgICAgIHR5cGVJZCA9IG1DYWNoZS5nZXRNZXRhRGF0YUF0KHBvc2l0aW9uKS50eXBlSWQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZmluYWwgUmVtb3RlVmlld3NNZXRhRGF0YSBtZXRhRGF0YSA9IG1DYWNoZS5nZXRNZXRhRGF0YSgpOworICAgICAgICBzeW5jaHJvbml6ZWQgKG1ldGFEYXRhKSB7CisgICAgICAgICAgICByZXR1cm4gbWV0YURhdGEuZ2V0TWFwcGVkVmlld1R5cGUodHlwZUlkKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGl0ZW0gdHlwZSBpZCBmb3IgdGhlIHNwZWNpZmllZCBjb252ZXJ0IHZpZXcuICBSZXR1cm5zIC0xIGlmIHRoZSBjb252ZXJ0IHZpZXcKKyAgICAgKiBpcyBpbnZhbGlkLgorICAgICAqLworICAgIHByaXZhdGUgaW50IGdldENvbnZlcnRWaWV3VHlwZUlkKFZpZXcgY29udmVydFZpZXcpIHsKKyAgICAgICAgaW50IHR5cGVJZCA9IC0xOworICAgICAgICBpZiAoY29udmVydFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgT2JqZWN0IHRhZyA9IGNvbnZlcnRWaWV3LmdldFRhZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnJvd1R5cGVJZCk7CisgICAgICAgICAgICBpZiAodGFnICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0eXBlSWQgPSAoSW50ZWdlcikgdGFnOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0eXBlSWQ7CisgICAgfQorCisgICAgcHVibGljIFZpZXcgZ2V0VmlldyhpbnQgcG9zaXRpb24sIFZpZXcgY29udmVydFZpZXcsIFZpZXdHcm91cCBwYXJlbnQpIHsKKyAgICAgICAgcmVxdWVzdEJpbmRTZXJ2aWNlKCk7CisgICAgICAgIGlmIChtU2VydmljZUNvbm5lY3Rpb24uaXNDb25uZWN0ZWQoKSkgeworICAgICAgICAgICAgLy8gIlJlcXVlc3QiIGFuIGluZGV4IHNvIHRoYXQgd2UgY2FuIHF1ZXVlIGl0IGZvciBsb2FkaW5nLCBpbml0aWF0ZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAvLyBwcmVsb2FkaW5nLCBldGMuCisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1DYWNoZSkgeworICAgICAgICAgICAgICAgIC8vIFF1ZXVlIHVwIG90aGVyIGluZGljZXMgdG8gYmUgcHJlbG9hZGVkIGJhc2VkIG9uIHRoaXMgcG9zaXRpb24KKyAgICAgICAgICAgICAgICBtQ2FjaGUucXVldWVQb3NpdGlvbnNUb0JlUHJlbG9hZGVkRnJvbVJlcXVlc3RlZFBvc2l0aW9uKHBvc2l0aW9uKTsKKworICAgICAgICAgICAgICAgIFJlbW90ZVZpZXdzRnJhbWVMYXlvdXQgbGF5b3V0ID0gKFJlbW90ZVZpZXdzRnJhbWVMYXlvdXQpIGNvbnZlcnRWaWV3OworICAgICAgICAgICAgICAgIFZpZXcgY29udmVydFZpZXdDaGlsZCA9IG51bGw7CisgICAgICAgICAgICAgICAgaW50IGNvbnZlcnRWaWV3VHlwZUlkID0gMDsKKyAgICAgICAgICAgICAgICBpZiAoY29udmVydFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjb252ZXJ0Vmlld0NoaWxkID0gbGF5b3V0LmdldENoaWxkQXQoMCk7CisgICAgICAgICAgICAgICAgICAgIGNvbnZlcnRWaWV3VHlwZUlkID0gZ2V0Q29udmVydFZpZXdUeXBlSWQoY29udmVydFZpZXdDaGlsZCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gU2Vjb25kLCB3ZSB0cnkgYW5kIHJldHJpZXZlIHRoZSBSZW1vdGVWaWV3cyBmcm9tIHRoZSBjYWNoZSwgcmV0dXJuaW5nIGEgbG9hZGluZworICAgICAgICAgICAgICAgIC8vIHZpZXcgYW5kIHF1ZXVlaW5nIGl0IHRvIGJlIGxvYWRlZCBpZiBpdCBoYXMgbm90IGFscmVhZHkgYmVlbiBsb2FkZWQuCisgICAgICAgICAgICAgICAgaWYgKG1DYWNoZS5jb250YWluc1JlbW90ZVZpZXdBdChwb3NpdGlvbikpIHsKKyAgICAgICAgICAgICAgICAgICAgQ29udGV4dCBjb250ZXh0ID0gcGFyZW50LmdldENvbnRleHQoKTsKKyAgICAgICAgICAgICAgICAgICAgUmVtb3RlVmlld3MgcnYgPSBtQ2FjaGUuZ2V0UmVtb3RlVmlld3NBdChwb3NpdGlvbik7CisgICAgICAgICAgICAgICAgICAgIGludCB0eXBlSWQgPSBtQ2FjaGUuZ2V0TWV0YURhdGFBdChwb3NpdGlvbikudHlwZUlkOworCisgICAgICAgICAgICAgICAgICAgIC8vIFJldXNlIHRoZSBjb252ZXJ0IHZpZXcgd2hlcmUgcG9zc2libGUKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnZlcnRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb252ZXJ0Vmlld1R5cGVJZCA9PSB0eXBlSWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBydi5yZWFwcGx5KGNvbnRleHQsIGNvbnZlcnRWaWV3Q2hpbGQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb252ZXJ0VmlldzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIE90aGVyd2lzZSwgY3JlYXRlIGEgbmV3IHZpZXcgdG8gYmUgcmV0dXJuZWQKKyAgICAgICAgICAgICAgICAgICAgVmlldyBuZXdWaWV3ID0gcnYuYXBwbHkoY29udGV4dCwgcGFyZW50KTsKKyAgICAgICAgICAgICAgICAgICAgbmV3Vmlldy5zZXRUYWdJbnRlcm5hbChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnJvd1R5cGVJZCwgbmV3IEludGVnZXIodHlwZUlkKSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChjb252ZXJ0VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsYXlvdXQucmVtb3ZlQWxsVmlld3MoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxheW91dCA9IG5ldyBSZW1vdGVWaWV3c0ZyYW1lTGF5b3V0KGNvbnRleHQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGxheW91dC5hZGRWaWV3KG5ld1ZpZXcpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGF5b3V0OworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBjYWNoZSBkb2VzIG5vdCBoYXZlIHRoZSBSZW1vdGVWaWV3cyBhdCB0aGlzIHBvc2l0aW9uLCB0aGVuIGNyZWF0ZSBhCisgICAgICAgICAgICAgICAgICAgIC8vIGxvYWRpbmcgdmlldyBhbmQgcXVldWUgdGhlIGFjdHVhbCBwb3NpdGlvbiB0byBiZSBsb2FkZWQgaW4gdGhlIGJhY2tncm91bmQKKyAgICAgICAgICAgICAgICAgICAgUmVtb3RlVmlld3NGcmFtZUxheW91dCBsb2FkaW5nVmlldyA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlbW90ZVZpZXdzTWV0YURhdGEgbWV0YURhdGEgPSBtQ2FjaGUuZ2V0TWV0YURhdGEoKTsKKyAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtZXRhRGF0YSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbG9hZGluZ1ZpZXcgPSBtZXRhRGF0YS5jcmVhdGVMb2FkaW5nVmlldyhwb3NpdGlvbiwgY29udmVydFZpZXcsIHBhcmVudCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBtUmVxdWVzdGVkVmlld3MuYWRkKHBvc2l0aW9uLCBsb2FkaW5nVmlldyk7CisgICAgICAgICAgICAgICAgICAgIG1DYWNoZS5xdWV1ZVJlcXVlc3RlZFBvc2l0aW9uVG9Mb2FkKHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgbG9hZE5leHRJbmRleEluQmFja2dyb3VuZCgpOworCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBsb2FkaW5nVmlldzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG5ldyBWaWV3KHBhcmVudC5nZXRDb250ZXh0KCkpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0Vmlld1R5cGVDb3VudCgpIHsKKyAgICAgICAgcmVxdWVzdEJpbmRTZXJ2aWNlKCk7CisgICAgICAgIGZpbmFsIFJlbW90ZVZpZXdzTWV0YURhdGEgbWV0YURhdGEgPSBtQ2FjaGUuZ2V0TWV0YURhdGEoKTsKKyAgICAgICAgc3luY2hyb25pemVkIChtZXRhRGF0YSkgeworICAgICAgICAgICAgcmV0dXJuIG1ldGFEYXRhLnZpZXdUeXBlQ291bnQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBoYXNTdGFibGVJZHMoKSB7CisgICAgICAgIHJlcXVlc3RCaW5kU2VydmljZSgpOworICAgICAgICBmaW5hbCBSZW1vdGVWaWV3c01ldGFEYXRhIG1ldGFEYXRhID0gbUNhY2hlLmdldE1ldGFEYXRhKCk7CisgICAgICAgIHN5bmNocm9uaXplZCAobWV0YURhdGEpIHsKKyAgICAgICAgICAgIHJldHVybiBtZXRhRGF0YS5oYXNTdGFibGVJZHM7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0VtcHR5KCkgeworICAgICAgICByZXR1cm4gZ2V0Q291bnQoKSA8PSAwOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG5vdGlmeURhdGFTZXRDaGFuZ2VkKCkgeworICAgICAgICBtV29ya2VyUXVldWUucG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAvLyBDb21wbGV0ZSB0aGUgYWN0dWFsIG5vdGlmeURhdGFTZXRDaGFuZ2VkKCkgY2FsbCBpbml0aWF0ZWQgZWFybGllcgorICAgICAgICAgICAgICAgIGlmIChtU2VydmljZUNvbm5lY3Rpb24uaXNDb25uZWN0ZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBJUmVtb3RlVmlld3NGYWN0b3J5IGZhY3RvcnkgPSBtU2VydmljZUNvbm5lY3Rpb24uZ2V0UmVtb3RlVmlld3NGYWN0b3J5KCk7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmYWN0b3J5Lm9uRGF0YVNldENoYW5nZWQoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIGluIHVwZGF0ZU5vdGlmeURhdGFTZXRDaGFuZ2VkKCk6ICIgKyBlLmdldE1lc3NhZ2UoKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJldHVybiBlYXJseSB0byBwcmV2ZW50IGZyb20gZnVydGhlciBiZWluZyBub3RpZmllZCAoc2luY2Ugbm90aGluZyBoYXMKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNoYW5nZWQpCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBGbHVzaCB0aGUgY2FjaGUgc28gdGhhdCB3ZSBjYW4gcmVsb2FkIG5ldyBpdGVtcyBmcm9tIHRoZSBzZXJ2aWNlCisgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtQ2FjaGUpIHsKKyAgICAgICAgICAgICAgICAgICAgbUNhY2hlLnJlc2V0KCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gUmUtcmVxdWVzdCB0aGUgbmV3IG1ldGFkYXRhIChvbmx5IGFmdGVyIHRoZSBub3RpZmljYXRpb24gdG8gdGhlIGZhY3RvcnkpCisgICAgICAgICAgICAgICAgdXBkYXRlTWV0YURhdGEoKTsKKworICAgICAgICAgICAgICAgIC8vIFByb3BhZ2F0ZSB0aGUgbm90aWZpY2F0aW9uIGJhY2sgdG8gdGhlIGJhc2UgYWRhcHRlcgorICAgICAgICAgICAgICAgIG1NYWluUXVldWUucG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdXBlck5vdGlmeURhdGFTZXRDaGFuZ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HViIHsKKyAgICAgICAgcHVibGljIFJlbW90ZVZpZXdzRmFjdG9yeUFkYXB0ZXIoUmVtb3RlVmlld3NGYWN0b3J5IGZhY3RvcnkpIHsKKyAgICAgICAgICAgIG1GYWN0b3J5ID0gZmFjdG9yeTsKKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgb25EYXRhU2V0Q2hhbmdlZCgpIHsKKyAgICAgICAgICAgIG1GYWN0b3J5Lm9uRGF0YVNldENoYW5nZWQoKTsKKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRDb3VudCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtRmFjdG9yeS5nZXRDb3VudCgpOworICAgICAgICB9CisgICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgUmVtb3RlVmlld3MgZ2V0Vmlld0F0KGludCBwb3NpdGlvbikgeworICAgICAgICAgICAgUmVtb3RlVmlld3MgcnYgPSBtRmFjdG9yeS5nZXRWaWV3QXQocG9zaXRpb24pOworICAgICAgICAgICAgcnYuc2V0SXNXaWRnZXRDb2xsZWN0aW9uQ2hpbGQodHJ1ZSk7CisgICAgICAgICAgICByZXR1cm4gcnY7CisgICAgICAgIH0KKyAgICAgICAgcHVibGljIHN5bmNocm9uaXplZCBSZW1vdGVWaWV3cyBnZXRMb2FkaW5nVmlldygpIHsKKyAgICAgICAgICAgIHJldHVybiBtRmFjdG9yeS5nZXRMb2FkaW5nVmlldygpOworICAgICAgICB9CisgICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldFZpZXdUeXBlQ291bnQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUZhY3RvcnkuZ2V0Vmlld1R5cGVDb3VudCgpOworICAgICAgICB9CisgICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgbG9uZyBnZXRJdGVtSWQoaW50IHBvc2l0aW9uKSB7CisgICAgICAgICAgICByZXR1cm4gbUZhY3RvcnkuZ2V0SXRlbUlkKHBvc2l0aW9uKTsKKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gaGFzU3RhYmxlSWRzKCkgeworICAgICAgICAgICAgcmV0dXJuIG1GYWN0b3J5Lmhhc1N0YWJsZUlkcygpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBSZW1vdGVWaWV3c0ZhY3RvcnkgbUZhY3Rvcnk7CisgICAgfQorCisgICAgcHVibGljIFJlbW90ZVZpZXdzU2VydmljZSgpIHsKKyAgICAgICAgbVJlbW90ZVZpZXdGYWN0b3JpZXMgPQorICAgICAgICAgICAgICAgIG5ldyBIYXNoTWFwPEludGVudC5GaWx0ZXJDb21wYXJpc29uLCBQYWlyPFJlbW90ZVZpZXdzRmFjdG9yeSwgSW50ZWdlcj4+KCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIElCaW5kZXIgb25CaW5kKEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgeworICAgICAgICAgICAgLy8gaW5jcmVtZW50IHRoZSByZWZlcmVuY2UgY291bnQgdG8gdGhlIHBhcnRpY3VsYXIgZmFjdG9yeSBhc3NvY2lhdGVkIHdpdGggdGhpcyBpbnRlbnQKKyAgICAgICAgICAgIEludGVudC5GaWx0ZXJDb21wYXJpc29uIGZjID0gbmV3IEludGVudC5GaWx0ZXJDb21wYXJpc29uKGludGVudCk7CisgICAgICAgICAgICBQYWlyPFJlbW90ZVZpZXdzRmFjdG9yeSwgSW50ZWdlcj4gZmFjdG9yeVJlZiA9IG51bGw7CisgICAgICAgICAgICBSZW1vdGVWaWV3c0ZhY3RvcnkgZmFjdG9yeSA9IG51bGw7CisgICAgICAgICAgICBpZiAoIW1SZW1vdGVWaWV3RmFjdG9yaWVzLmNvbnRhaW5zS2V5KGZjKSkgeworICAgICAgICAgICAgICAgIGZhY3RvcnkgPSBvbkdldFZpZXdGYWN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mlzb24oaW50ZW50KTsKKyAgICAgICAgICAgIGlmIChtUmVtb3RlVmlld0ZhY3Rvcmllcy5jb250YWluc0tleShmYykpIHsKKyAgICAgICAgICAgICAgICAvLyB0aGlzIGFsbGV2aWF0ZXMgdGhlIHVzZXIncyByZXNwb25zaWJpbGl0eSBvZiBoYXZpbmcgdG8gY2xlYXIgYWxsIGZhY3RvcmllcworICAgICAgICAgICAgICAgIFBhaXI8UmVtb3RlVmlld3NGYWN0b3J5LCBJbnRlZ2VyPiBvbGRGYWN0b3J5UmVmID0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1SZW1vdGVWaWV3RmFjdG9yaWVzLmdldChmYyk7CisgICAgICAgICAgICAgICAgaW50IG5ld1JlZkNvdW50ID0gb2xkRmFjdG9yeVJlZi5zZWNvbmQuaW50VmFsdWUoKSAtIDE7CisgICAgICAgICAgICAgICAgaWYgKG5ld1JlZkNvdW50IDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgb2xkRmFjdG9yeVJlZi5maXJzdC5vbkRlc3Ryb3koKTsKKyAgICAgICAgICAgICAgICAgICAgbVJlbW90ZVZpZXdGYWN0b3JpZXMucmVtb3ZlKGZjKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBQYWlyPFJlbW90ZVZpZXdzRmFjdG9yeSwgSW50ZWdlcj4gZmFjdG9yeVJlZiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFBhaXI8UmVtb3RlVmlld3NGYWN0b3J5LCBJbnRlZ2VyPihvbGRGYWN0b3J5UmVmLmZpcnN0LCBuZXdSZWZDb3VudCk7CisgICAgICAgICAgICAgICAgICAgIG1SZW1vdGVWaWV3RmFjdG9yaWVzLnB1dChmYywgZmFjdG9yeVJlZik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBzdXBlci5vblVuYmluZChpbnRlbnQpOworICAgIH0KKworICAgIC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QpIHkpKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgIC8qCiAgICAgICAgICAgICAgICAgICogSWYgYmVpbmcgZmxpbmdlZCBhbmQgdXNlciB0b3VjaGVzLCBzdG9wIHRoZSBmbGluZy4gaXNGaW5pc2hlZApAQCAtNTIxLDM2ICs1MTYsNyBAQAogICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZGVsdGFZID0gKGludCkgKG1MYXN0TW90aW9uWSAtIHkpOwogICAgICAgICAgICAgICAgICAgICBtTGFzdE1vdGlvblkgPSB5OwogCi0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBvbGRYID0gbVNjcm9sbFg7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBvbGRZID0gbVNjcm9sbFk7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCByYW5nZSA9IGdldFNjcm9sbFJhbmdlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChvdmVyU2Nyb2xsQnkoMCwgZGVsdGFZLCAwLCBtU2Nyb2xsWSwgMCwgcmFuZ2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgbU92ZXJzY3JvbGxEaXN0YW5jZSwgdHJ1ZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJyZWFrIG91ciB2ZWxvY2l0eSBpZiB3ZSBoaXQgYSBzY3JvbGwgYmFycmllci4KLSAgICAgICAgICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIuY2xlYXIoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBvblNjcm9sbENoYW5nZWQobVNjcm9sbFgsIG1TY3JvbGxZLCBvbGRYLCBvbGRZKTsKLQotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgb3ZlcnNjcm9sbE1vZGUgPSBnZXRPdmVyU2Nyb2xsTW9kZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAob3ZlcnNjcm9sbE1vZGUgPT0gT1ZFUl9TQ1JPTExfQUxXQVlTIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKG92ZXJzY3JvbGxNb2RlID09IE9WRVJfU0NST0xMX0lGX0NPTlRFTlRfU0NST0xMUyAmJiByYW5nZSA+IDApKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcHVsbGVkVG9ZID0gb2xkWSArIGRlbHRhWTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwdWxsZWRUb1kgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93VG9wLm9uUHVsbCgoZmxvYXQpIGRlbHRhWSAvIGdldEhlaWdodCgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1FZGdlR2xvd0JvdHRvbS5pc0ZpbmlzaGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVkZ2VHbG93Qm90dG9tLm9uUmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocHVsbGVkVG9ZID4gcmFuZ2UpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dCb3R0b20ub25QdWxsKChmbG9hdCkgZGVsdGFZIC8gZ2V0SGVpZ2h0KCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbUVkZ2VHbG93VG9wLmlzRmluaXNoZWQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dUb3Aub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1FZGdlR2xvd1RvcCAhPSBudWxsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICghbUVkZ2VHbG93VG9wLmlzRmluaXNoZWQoKSB8fCAhbUVkZ2VHbG93Qm90dG9tLmlzRmluaXNoZWQoKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2Nyb2xsQnkoMCwgZGVsdGFZKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9VUDogCkBAIC01NTksMTUgKzUyNSw4IEBACiAgICAgICAgICAgICAgICAgICAgIHZlbG9jaXR5VHJhY2tlci5jb21wdXRlQ3VycmVudFZlbG9jaXR5KDEwMDAsIG1NYXhpbXVtVmVsb2NpdHkpOwogICAgICAgICAgICAgICAgICAgICBpbnQgaW5pdGlhbFZlbG9jaXR5ID0gKGludCkgdmVsb2NpdHlUcmFja2VyLmdldFlWZWxvY2l0eShtQWN0aXZlUG9pbnRlcklkKTsKIAotICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0Q2hpbGRDb3VudCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChNYXRoLmFicyhpbml0aWFsVmVsb2NpdHkpID4gbU1pbmltdW1WZWxvY2l0eSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGluZygtaW5pdGlhbFZlbG9jaXR5KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGJvdHRvbSA9IGdldFNjcm9sbFJhbmdlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1TY3JvbGxlci5zcHJpbmdCYWNrKG1TY3JvbGxYLCBtU2Nyb2xsWSwgMCwgMCwgMCwgYm90dG9tKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0Q2hpbGRDb3VudCgpID4gMCAmJiBNYXRoLmFicyhpbml0aWFsVmVsb2NpdHkpID4gbU1pbmltdW1WZWxvY2l0eSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmxpbmcoLWluaXRpYWxWZWxvY2l0eSk7CiAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUG9pbnRlcklkID0gSU5WQUxJRF9QT0lOVEVSOwpAQCAtNTc3LDI3ICs1MzYsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIucmVjeWNsZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgbVZlbG9jaXR5VHJhY2tlciA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1FZGdlR2xvd1RvcCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dUb3Aub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dCb3R0b20ub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6CiAgICAgICAgICAgICAgICAgaWYgKG1Jc0JlaW5nRHJhZ2dlZCAmJiBnZXRDaGlsZENvdW50KCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtU2Nyb2xsZXIuc3ByaW5nQmFjayhtU2Nyb2xsWCwgbVNjcm9sbFksIDAsIDAsIDAsIGdldFNjcm9sbFJhbmdlKCkpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBvaW50ZXJJZCA9IElOVkFMSURfUE9JTlRFUjsKICAgICAgICAgICAgICAgICAgICAgbUlzQmVpbmdEcmFnZ2VkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIGlmIChtVmVsb2NpdHlUcmFja2VyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIucmVjeWNsZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgbVZlbG9jaXR5VHJhY2tlciA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1FZGdlR2xvd1RvcCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dUb3Aub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dCb3R0b20ub25SZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX1VQOgpAQCAtNjI0LDMyICs1NzIsNiBAQAogICAgICAgICB9CiAgICAgfQogICAgIAotICAgIEBPdmVycmlkZQotICAgIHByb3RlY3RlZCB2b2lkIG9uT3ZlclNjcm9sbGVkKGludCBzY3JvbGxYLCBpbnQgc2Nyb2xsWSwKLSAgICAgICAgICAgIGJvb2xlYW4gY2xhbXBlZFgsIGJvb2xlYW4gY2xhbXBlZFkpIHsKLSAgICAgICAgLy8g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AgICAgICAgICAgb25TY3JvbGxDaGFuZ2VkKG1TY3JvbGxYLCBtU2Nyb2xsWSwgb2xkWCwgb2xkWSk7Ci0KLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcmFuZ2UgPSBnZXRTY3JvbGxSYW5nZSgpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCBvdmVyc2Nyb2xsTW9kZSA9IGdldE92ZXJTY3JvbGxNb2RlKCk7Ci0gICAgICAgICAgICAgICAgaWYgKG92ZXJzY3JvbGxNb2RlID09IE9WRVJfU0NST0xMX0FMV0FZUyB8fAotICAgICAgICAgICAgICAgICAgICAgICAgKG92ZXJzY3JvbGxNb2RlID09IE9WRVJfU0NST0xMX0lGX0NPTlRFTlRfU0NST0xMUyAmJiByYW5nZSA+IDApKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh5IDwgMCAmJiBvbGRZID49IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1FZGdlR2xvd1RvcC5vbkFic29yYigoaW50KSBtU2Nyb2xsZXIuZ2V0Q3VyclZlbG9jaXR5KCkpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHkgPiByYW5nZSAmJiBvbGRZIDw9IHJhbmdlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRWRnZUdsb3dCb3R0b20ub25BYnNvcmIoKGludCkgbVNjcm9sbGVyLmdldEN1cnJWZWxvY2l0eSgpKTsKLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGdldENoaWxkQ291bnQoKSA+IDApIHsKKyAgICAgICAgICAgICAgICBWaWV3IGNoaWxkID0gZ2V0Q2hpbGRBdCgwKTsKKyAgICAgICAgICAgICAgICB4ID0gY2xhbXAoeCwgZ2V0V2lkdGgoKSAtIG1QYWRkaW5nUmlnaHQgLSBtUGFkZGluZ0xlZnQsIGNoaWxkLmdldFdpZHRoKCkpOworICAgICAgICAgICAgICAgIHkgPSBjbGFtcCh5LCBnZXRIZWlnaHQoKSAtIG1QYWRkaW5nQm90dG9tIC0gbVBhZGRpbmdUb3AsIGNoaWxkLmdldEhlaWdodCgpKTsKKyAgICAgICAgICAgICAgICBpZiAoeCAhPSBvbGRYIHx8IHkgIT0gb2xkWSkgeworICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsWCA9IHg7CisgICAgICAgICAgICAgICAgICAgIG1TY3JvbGxZID0geTsKKyAgICAgICAgICAgICAgICAgICAgb25TY3JvbGxDaGFuZ2VkKHgsIHksIG9sZFgsIG9sZFkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGF3YWtlblNjcm9sbEJhcnMoKTsKQEAgLTEzNDcsNyArMTI1NCw3IEBACiAgICAgICAgICAgICBpbnQgYm90dG9tID0gZ2V0Q2hpbGRBdCgwKS5nZXRIZWlnaHQoKTsKICAgICAKICAgICAgICAgICAgIG1TY3JvbGxlci5mbGluZyhtU2Nyb2xsWCwgbVNjcm9sbFksIDAsIHZlbG9jaXR5WSwgMCwgMCwgMCwgCi0gICAgICAgICAgICAgICAgICAgIE1hdGgubWF4KDAsIGJvdHRvbSAtIGhlaWdodCksIDAsIGhlaWdodC8yKTsKKyAgICAgICAgICAgICAgICAgICAgTWF0aC5tYXgoMCwgYm90dG9tIC0gaGVpZ2h0KSk7CiAgICAgCiAgICAgICAgICAgICBmaW5hbCBib29sZWFuIG1vdmluZ0Rvd24gPSB2ZWxvY2l0eVkgPiAwOwogICAgIApAQCAtMTM4NSw1NSArMTI5Miw2IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgdm9pZCBzZXRPdmVyU2Nyb2xsTW9kZShpbnQgbW9kZSkgewotICAgICAgICBpZiAobW9kZSAhPSBPVkVSX1NDUk9MTF9ORVZFUikgewotICAgICAgICAgICAgaWYgKG1FZGdlR2xvd1RvcCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgUmVzb3V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GUoLXdpZHRoIC8gMiwgTWF0aC5taW4oMCwgc2Nyb2xsWSkpOwotICAgICAgICAgICAgICAgIG1FZGdlR2xvd1RvcC5zZXRTaXplKHdpZHRoICogMiwgZ2V0SGVpZ2h0KCkpOwotICAgICAgICAgICAgICAgIGlmIChtRWRnZUdsb3dUb3AuZHJhdyhjYW52YXMpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY2FudmFzLnJlc3RvcmVUb0NvdW50KHJlc3RvcmVDb3VudCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIW1FZGdlR2xvd0JvdHRvbS5pc0ZpbmlzaGVkKCkpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcmVzdG9yZUNvdW50ID0gY2FudmFzLnNhdmUoKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgd2lkdGggPSBnZXRXaWR0aCgpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCBoZWlnaHQgPSBnZXRIZWlnaHQoKTsKLQotICAgICAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoLXdpZHRoIC8gMiwgTWF0aC5tYXgoZ2V0U2Nyb2xsUmFuZ2UoKSwgc2Nyb2xsWSkgKyBoZWlnaHQpOwotICAgICAgICAgICAgICAgIGNhbnZhcy5yb3RhdGUoMTgwLCB3aWR0aCwgMCk7Ci0gICAgICAgICAgICAgICAgbUVkZ2VHbG93Qm90dG9tLnNldFNpemUod2lkdGggKiAyLCBoZWlnaHQpOwotICAgICAgICAgICAgICAgIGlmIChtRWRnZUdsb3dCb3R0b20uZHJhdyhjYW52YXMpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY2FudmFzLnJlc3RvcmVUb0NvdW50KHJlc3RvcmVDb3VudCk7Ci0gICAgICA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AgICAgICAgIC8vIGluY2gvbWV0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAqIHBwaSAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHBpeGVscyBwZXIgaW5jaAotICAgICAgICAgICAgICAgICAgICAgICogVmlld0NvbmZpZ3VyYXRpb24uZ2V0U2Nyb2xsRnJpY3Rpb24oKTsKKyAgICAgICAgbVBwaSA9IGNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0RGlzcGxheU1ldHJpY3MoKS5kZW5zaXR5ICogMTYwLjBmOworICAgICAgICBtRGVjZWxlcmF0aW9uID0gY29tcHV0ZURlY2VsZXJhdGlvbihWaWV3Q29uZmlndXJhdGlvbi5nZXRTY3JvbGxGcmljdGlvbigpKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGUgYW1vdW50IG9mIGZyaWN0aW9uIGFwcGxpZWQgdG8gZmxpbmdzLiBUaGUgZGVmYXVsdCB2YWx1ZQorICAgICAqIGlzIHtAbGluayBWaWV3Q29uZmlndXJhdGlvbiNnZXRTY3JvbGxGcmljdGlvbn0uCisgICAgICogCisgICAgICogQHJldHVybiBBIHNjYWxhciBkaW1lbnNpb25sZXNzIHZhbHVlIHJlcHJlc2VudGluZyB0aGUgY29lZmZpY2llbnQgb2YKKyAgICAgKiAgICAgICAgIGZyaWN0aW9uLgorICAgICAqLworICAgIHB1YmxpYyBmaW5hbCB2b2lkIHNldEZyaWN0aW9uKGZsb2F0IGZyaWN0aW9uKSB7CisgICAgICAgIG1EZWNlbGVyYXRpb24gPSBjb21wdXRlRGVjZWxlcmF0aW9uKGZyaWN0aW9uKTsKICAgICB9CiAgICAgCisgICAgcHJpdmF0ZSBmbG9hdCBjb21wdXRlRGVjZWxlcmF0aW9uKGZsb2F0IGZyaWN0aW9uKSB7CisgICAgICAgIHJldHVybiBTZW5zb3JNYW5hZ2VyLkdSQVZJVFlfRUFSVEggICAvLyBnIChtL3NeMikKKyAgICAgICAgICAgICAgICAgICAgICAqIDM5LjM3ZiAgICAgICAgICAgICAgIC8vIGluY2gvbWV0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAqIG1QcGkgICAgICAgICAgICAgICAgIC8vIHBpeGVscyBwZXIgaW5jaAorICAgICAgICAgICAgICAgICAgICAgICogZnJpY3Rpb247CisgICAgfQorCiAgICAgLyoqCiAgICAgICogCiAgICAgICogUmV0dXJucyB3aGV0aGVyIHRoZSBzY3JvbGxlciBoYXMgZmluaXNoZWQgc2Nyb2xsaW5nLgpAQCAtMjg2LDYgKzI5MywxMSBAQAogICAgICAgICBtRGVsdGFYID0gZHg7CiAgICAgICAgIG1EZWx0YVkgPSBkeTsKICAgICAgICAgbUR1cmF0aW9uUmVjaXByb2NhbCA9IDEuMGYgLyAoZmxvYXQpIG1EdXJhdGlvbjsKKyAgICAgICAgLy8gVGhpcyBjb250cm9scyB0aGUgdmlzY291cyBmbHVpZCBlZmZlY3QgKGhvdyBtdWNoIG9mIGl0KQorICAgICAgICBtVmlzY291c0ZsdWlkU2NhbGUgPSA4LjBmOworICAgICAgICAvLyBtdXN0IGJlIHNldCB0byAxLjAgKHVzZWQgaW4gdmlzY291c0ZsdWlkKCkpCisgICAgICAgIG1WaXNjb3VzRmx1aWROb3JtYWxpemUgPSAxLjBmOworICAgICAgICBtVmlzY291c0ZsdWlkTm9ybWFsaXplID0gMS4wZiAvIHZpc2NvdXNGbHVpZCgxLjBmKTsKICAgICB9CiAKICAgICAvKioKQEAgLTM0Myw5ICszNTUsMTEgQEAKICAgICAgICAgbUZpbmFsWSA9IE1hdGgubWF4KG1GaW5hbFksIG1NaW5ZKTsKICAgICB9CiAgICAgCi0gICAgc3RhdGljIGZsb2F0IHZpc2NvdXNGbHVpZChmbG9hdCB4KQorICAgIAorICAgIAorICAgIHByaXZhdGUgZmxvYXQgdmlzY291c0ZsdWlkKGZsb2F0IHgpCiAgICAgewotICAgICAgICB4ICo9IHNWaXNjb3VzRmx1aWRTY2FsZTsKKyAgICAgICAgeCAqPS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BpbnQgbWF4V2lkdGggPSBhLmdldERpbWVuc2lvblBpeGVsU2l6ZShSLnN0eWxlYWJsZS5TZWFyY2hWaWV3X21heFdpZHRoLCAtMSk7CisgICAgICAgIGlmIChtYXhXaWR0aCAhPSAtMSkgeworICAgICAgICAgICAgc2V0TWF4V2lkdGgobWF4V2lkdGgpOworICAgICAgICB9CisgICAgICAgIGEucmVjeWNsZSgpOworCisgICAgICAgIC8vIFNhdmUgdm9pY2UgaW50ZW50IGZvciBsYXRlciBxdWVyaWVzL2xhdW5jaGluZworICAgICAgICBtVm9pY2VXZWJTZWFyY2hJbnRlbnQgPSBuZXcgSW50ZW50KFJlY29nbml6ZXJJbnRlbnQuQUNUSU9OX1dFQl9TRUFSQ0gpOworICAgICAgICBtVm9pY2VXZWJTZWFyY2hJbnRlbnQuYWRkRmxhZ3MoSW50ZW50LkZMQUdfQUNUSVZJVFlfTkVXX1RBU0spOworICAgICAgICBtVm9pY2VXZWJTZWFyY2hJbnRlbnQucHV0RXh0cmEoUmVjb2duaXplckludGVudC5FWFRSQV9MQU5HVUFHRV9NT0RFTCwKKyAgICAgICAgICAgICAgICBSZWNvZ25pemVySW50ZW50LkxBTkdVQUdFX01PREVMX1dFQl9TRUFSQ0gpOworCisgICAgICAgIG1Wb2ljZUFwcFNlYXJjaEludGVudCA9IG5ldyBJbnRlbnQoUmVjb2duaXplckludGVudC5BQ1RJT05fUkVDT0dOSVpFX1NQRUVDSCk7CisgICAgICAgIG1Wb2ljZUFwcFNlYXJjaEludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19BQ1RJVklUWV9ORVdfVEFTSyk7CisKKyAgICAgICAgdXBkYXRlVmlld3NWaXNpYmlsaXR5KG1JY29uaWZpZWRCeURlZmF1bHQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIFNlYXJjaGFibGVJbmZvIGZvciB0aGlzIFNlYXJjaFZpZXcuIFByb3BlcnRpZXMgaW4gdGhlIFNlYXJjaGFibGVJbm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hbHNlIHdpbGwKKyAgICAgKiBleHBhbmQgaXQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0SWNvbmlmaWVkKGJvb2xlYW4gaWNvbmlmeSkgeworICAgICAgICBpZiAoaWNvbmlmeSkgeworICAgICAgICAgICAgb25DbG9zZUNsaWNrZWQoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG9uU2VhcmNoQ2xpY2tlZCgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCBpY29uaWZpZWQgc3RhdGUgb2YgdGhlIFNlYXJjaFZpZXcuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIFNlYXJjaFZpZXcgaXMgY3VycmVudGx5IGljb25pZmllZCwgZmFsc2UgaWYgdGhlIHNlYXJjaCBmaWVsZCBpcworICAgICAqIGZ1bGx5IHZpc2libGUuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaXNJY29uaWZpZWQoKSB7CisgICAgICAgIHJldHVybiBtSWNvbmlmaWVkOworICAgIH0KKworICAgIC8qKgorICAgICAqIEVuYWJsZXMgc2hvd2luZyBhIHN1Ym1pdCBidXR0b24gd2hlbiB0aGUgcXVlcnkgaXMgbm9uLWVtcHR5LiBJbiBjYXNlcyB3aGVyZSB0aGUgU2VhcmNoVmlldworICAgICAqIGlzIGJlaW5nIHVzZWQgdG8gZmlsdGVyIHRoZSBjb250ZW50cyBvZiB0aGUgY3VycmVudCBhY3Rpdml0eSBhbmQgZG9lc24ndCBsYXVuY2ggYSBzZXBhcmF0ZQorICAgICAqIHJlc3VsdHMgYWN0aXZpdHksIHRoZW4gdGhlIHN1Ym1pdCBidXR0b24gc2hvdWxkIGJlIGRpc2FibGVkLgorICAgICAqCisgICAgICogQHBhcmFtIGVuYWJsZWQgdHJ1ZSB0byBzaG93IGEgc3VibWl0IGJ1dHRvbiBmb3Igc3VibWl0dGluZyBxdWVyaWVzLCB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dG9uKCFoYXNUZXh0KTsKKyAgICAgICAgcmVxdWVzdExheW91dCgpOworICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldEltZVZpc2liaWxpdHkoYm9vbGVhbiB2aXNpYmxlKSB7CisgICAgICAgIElucHV0TWV0aG9kTWFuYWdlciBpbW0gPSAoSW5wdXRNZXRob2RNYW5hZ2VyKQorICAgICAgICBnZXRDb250ZXh0KCkuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LklOUFVUX01FVEhPRF9TRVJWSUNFKTsKKworICAgICAgICAvLyBXZSBtYWRlIHN1cmUgdGhlIElNRSB3YXMgZGlzcGxheWVkLCBzbyBhbHNvIG1ha2Ugc3VyZSBpdCBpcyBjbG9zZWQKKyAgICAgICAgLy8gd2hlbiB3ZSBnbyBhd2F5LgorICAgICAgICBpZiAoaW1tICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmICh2aXNpYmxlKSB7CisgICAgICAgICAgICAgICAgaW1tLnNob3dTb2Z0SW5wdXRVbmNoZWNrZWQoMCwgbnVsbCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGltbS5oaWRlU29mdElucHV0RnJvbVdpbmRvdyhnZXRXaW5kb3dUb2tlbigpLCAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENhbGxlZCBieSB0aGUgU3VnZ2VzdGlvbnNBZGFwdGVyCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovdm9pZCBvblF1ZXJ5UmVmaW5lKENoYXJTZXF1ZW5jZSBxdWVyeVRleHQpIHsKKyAgICAgICAgc2V0UXVlcnkocXVlcnlUZXh0KTsKKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIE9uQ2xpY2tMaXN0ZW5lciBtT25DbGlja0xpc3RlbmVyID0gbmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKKworICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgaWYgKHYgPT0gbVNlYXJjaEJ1dHRvbikgeworICAgICAgICAgICAgICAgIG9uU2VhcmNoQ2xpY2tlZCgpOworICAgICAgICAgICAgfSBlbHNlIGlmICh2ID09IG1DbG9zZUJ1dHRvbikgeworICAgICAgICAgICAgICAgIG9uQ2xvc2VDbGlja2VkKCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHYgPT0gbVN1Ym1pdEJ1dHRvbikgeworICAgICAgICAgICAgICAgIG9uU3VibWl0UXVlcnkoKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodiA9PSBtVm9pY2VCdXR0b24pIHsKKyAgICAgICAgICAgICAgICBvblZvaWNlQ2xpY2tlZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIC8qKgorICAgICAqIEhhbmRsZXMgdGhlIGtleSBkb3duIGV2ZW50IGZvciBkZWFsaW5nIHdpdGggYWN0aW9uIGtleXMuCisgICAgICoKKyAgICAgKiBAcGFyYW0ga2V5Q29kZSBUaGlzIGlzIHRoZSBrZXljb2RlIG9mIHRoZSB0eXBlZCBrZXksIGFuZCBpcyB0aGUgc2FtZSB2YWx1ZSBhcworICAgICAqICAgICAgICBmb3VuZCBpbiB0aGUgS2V5RXZlbnQgcGFyYW1ldGVyLgorICAgICAqIEBwYXJhbSBldmVudCBUaGUgY29tcGxldGUgZXZlbnQgcmVjb3JkIGZvciB0aGUgdHlwZWQga2V5CisgICAgICoKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIGV2ZW50IHdhcyBoYW5kbGVkIGhlcmUsIG9yIGZhbHNlIGlmIG5vdC4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvbktleURvd24oaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50KSB7CisgICAgICAgIGlmIChtU2VhcmNoYWJsZSA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICAvLyBpZiBpdCdzIGFuIGFjdGlvbiBzcGVjaWZpZWQgYnkgdGhlIHNlYXJjaGFibGUgYWN0aXZpdHksIGxhdW5jaCB0aGUKKyAgICAgICAgLy8gZW50ZXJlZCBxdWVyeSB3aXRoIHRoZSBhY3Rpb24ga2V5CisgICAgICAgIFNlYXJjaGFibGVJbmZvLkFjdGlvbktleUluZm8gYWN0aW9uS2V5ID0gbVNlYXJjaGFibGUuZmluZEFjdGlvbktleShrZXlDb2RlKTsKKyAgICAgICAgaWYgKChhY3Rpb25LZXkgIT0gbnVsbCkgJiYgKGFjdGlvbktleS5nZXRRdWVyeUFjdGlvbk1zZygpICE9IG51bGwpKSB7CisgICAgICAgICAgICBsYXVuY2hRdWVyeVNlYXJjaChrZXlDb2RlLCBhY3Rpb25LZXkuZ2V0UXVlcnlBY3Rpb25Nc2coKSwgbVF1ZXJ5VGV4dFZpZXcuZ2V0VGV4dCgpCisgICAgICAgICAgICAgICAgICAgIC50b1N0cmluZygpKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHN1cGVyLm9uS2V5RG93bihrZXlDb2RlLCBldmVudCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZVF1ZXJ5SGludCgpIHsKKyAgICAgICAgaWYgKG1RdWVyeUhpbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgbVF1ZXJ5VGV4dFZpZXcuc2V0SGludChtUXVlcnlIaW50KTsKKyAgICAgICAgfSBlbHNlIGlmIChtU2VhcmNoYWJsZSAhPSBudWxsKSB7CisgICAgICAgICAgICBDaGFyU2VxdWVuY2UgaGludCA9IG51bGw7CisgICAgICAgICAgICBpbnQgaGludElkID0gbVNlYXJjaGFibGUuZ2V0SGludElkKCk7CisgICAgICAgICAgICBpZiAoaG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RlVm9pY2VCdXR0b24oYm9vbGVhbiBlbXB0eSkgeworICAgICAgICBpbnQgdmlzaWJpbGl0eSA9IFZpZXcuR09ORTsKKyAgICAgICAgaWYgKG1TZWFyY2hhYmxlICE9IG51bGwgJiYgbVNlYXJjaGFibGUuZ2V0Vm9pY2VTZWFyY2hFbmFibGVkKCkgJiYgZW1wdHkKKyAgICAgICAgICAgICAgICAmJiAhaXNJY29uaWZpZWQoKSkgeworICAgICAgICAgICAgSW50ZW50IHRlc3RJbnRlbnQgPSBudWxsOworICAgICAgICAgICAgaWYgKG1TZWFyY2hhYmxlLmdldFZvaWNlU2VhcmNoTGF1bmNoV2ViU2VhcmNoKCkpIHsKKyAgICAgICAgICAgICAgICB0ZXN0SW50ZW50ID0gbVZvaWNlV2ViU2VhcmNoSW50ZW50OworICAgICAgICAgICAgfSBlbHNlIGlmIChtU2VhcmNoYWJsZS5nZXRWb2ljZVNlYXJjaExhdW5jaFJlY29nbml6ZXIoKSkgeworICAgICAgICAgICAgICAgIHRlc3RJbnRlbnQgPSBtVm9pY2VBcHBTZWFyY2hJbnRlbnQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodGVzdEludGVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgUmVzb2x2ZUluZm8gcmkgPSBnZXRDb250ZXh0KCkuZ2V0UGFja2FnZU1hbmFnZXIoKS5yZXNvbHZlQWN0aXZpdHkodGVzdEludGVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFBhY2thZ2VNYW5hZ2VyLk1BVENIX0RFRkFVTFRfT05MWSk7CisgICAgICAgICAgICAgICAgaWYgKHJpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdmlzaWJpbGl0eSA9IFZpZXcuVklTSUJMRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbVZvaWNlQnV0dG9uLnNldFZpc2liaWxpdHkodmlzaWJpbGl0eSk7CisgICAg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WQobmV3VGV4dC50b1N0cmluZygpKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBvblN1Ym1pdFF1ZXJ5KCkgeworICAgICAgICBDaGFyU2VxdWVuY2UgcXVlcnkgPSBtUXVlcnlUZXh0Vmlldy5nZXRUZXh0KCk7CisgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocXVlcnkpKSB7CisgICAgICAgICAgICBpZiAobU9uUXVlcnlDaGFuZ2VMaXN0ZW5lciA9PSBudWxsCisgICAgICAgICAgICAgICAgICAgIHx8ICFtT25RdWVyeUNoYW5nZUxpc3RlbmVyLm9uU3VibWl0UXVlcnkocXVlcnkudG9TdHJpbmcoKSkpIHsKKyAgICAgICAgICAgICAgICBpZiAobVNlYXJjaGFibGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBsYXVuY2hRdWVyeVNlYXJjaChLZXlFdmVudC5LRVlDT0RFX1VOS05PV04sIG51bGwsIHF1ZXJ5LnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICBzZXRJbWVWaXNpYmlsaXR5KGZhbHNlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZGlzbWlzc1N1Z2dlc3Rpb25zKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZGlzbWlzc1N1Z2dlc3Rpb25zKCkgeworICAgICAgICBtUXVlcnlUZXh0Vmlldy5kaXNtaXNzRHJvcERvd24oKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgb25DbG9zZUNsaWNrZWQoKSB7CisgICAgICAgIGlmIChtT25DbG9zZUxpc3RlbmVyID09IG51bGwgfHwgIW1PbkNsb3NlTGlzdGVuZXIub25DbG9zZSgpKSB7CisgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGV4dCA9IG1RdWVyeVRleHRWaWV3LmdldFRleHQoKTsKKyAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eSh0ZXh0KSkgeworICAgICAgICAgICAgICAgIC8vIHF1ZXJ5IGZpZWxkIGFscmVhZHkgZW1wdHksIGhpZGUgdGhlIGtleWJvYXJkIGFuZCByZW1vdmUgZm9jdXMKKyAgICAgICAgICAgICAgICBjbGVhckZvY3VzKCk7CisgICAgICAgICAgICAgICAgc2V0SW1lVmlzaWJpbGl0eShmYWxzZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1RdWVyeVRleHRWaWV3LnNldFRleHQoIiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdXBkYXRlVmlld3NWaXNpYmlsaXR5KG1JY29uaWZpZWRCeURlZmF1bHQpOworICAgICAgICAgICAgaWYgKG1JY29uaWZpZWRCeURlZmF1bHQpIHNldEltZVZpc2liaWxpdHkoZmFsc2UpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIG9uU2VhcmNoQ2xpY2tlZCgpIHsKKyAgICAgICAgbVF1ZXJ5VGV4dFZpZXcucmVxdWVzdEZvY3VzKCk7CisgICAgICAgIHVwZGF0ZVZpZXdzVmlzaWJpbGl0eShmYWxzZSk7CisgICAgICAgIHNldEltZVZpc2liaWxpdHkodHJ1ZSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIG9uVm9pY2VDbGlja2VkKCkgeworICAgICAgICAvLyBndWFyZCBhZ2FpbnN0IHBvc3NpYmxlIHJhY2UgY29uZGl0aW9ucworICAgICAgICBpZiAobVNlYXJjaGFibGUgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIFNlYXJjaGFibGVJbmZvIHNlYXJjaGFibGUgPSBtU2VhcmNoYWJsZTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChzZWFyY2hhYmxlLmdldFZvaWNlU2VhcmNoTGF1bmNoV2ViU2VhcmNoKCkpIHsKKyAgICAgICAgICA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AgICAgLyoqCisgICAgICAgICAqIEltcGxlbWVudHMgT25JdGVtQ2xpY2tMaXN0ZW5lcgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgb25JdGVtQ2xpY2soQWRhcHRlclZpZXc8Pz4gcGFyZW50LCBWaWV3IHZpZXcsIGludCBwb3NpdGlvbiwgbG9uZyBpZCkgeworICAgICAgICAgICAgaWYgKERCRykKKyAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAib25JdGVtQ2xpY2soKSBwb3NpdGlvbiAiICsgcG9zaXRpb24pOworICAgICAgICAgICAgaWYgKG1PblN1Z2dlc3Rpb25MaXN0ZW5lciA9PSBudWxsCisgICAgICAgICAgICAgICAgICAgIHx8ICFtT25TdWdnZXN0aW9uTGlzdGVuZXIub25TdWdnZXN0aW9uQ2xpY2tlZChwb3NpdGlvbikpIHsKKyAgICAgICAgICAgICAgICBsYXVuY2hTdWdnZXN0aW9uKHBvc2l0aW9uLCBLZXlFdmVudC5LRVlDT0RFX1VOS05PV04sIG51bGwpOworICAgICAgICAgICAgICAgIHNldEltZVZpc2liaWxpdHkoZmFsc2UpOworICAgICAgICAgICAgICAgIGRpc21pc3NTdWdnZXN0aW9ucygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHByaXZhdGUgZmluYWwgT25JdGVtU2VsZWN0ZWRMaXN0ZW5lciBtT25JdGVtU2VsZWN0ZWRMaXN0ZW5lciA9IG5ldyBPbkl0ZW1TZWxlY3RlZExpc3RlbmVyKCkgeworCisgICAgICAgIC8qKgorICAgICAgICAgKiBJbXBsZW1lbnRzIE9uSXRlbVNlbGVjdGVkTGlzdGVuZXIKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIG9uSXRlbVNlbGVjdGVkKEFkYXB0ZXJWaWV3PD8+IHBhcmVudCwgVmlldyB2aWV3LCBpbnQgcG9zaXRpb24sIGxvbmcgaWQpIHsKKyAgICAgICAgICAgIGlmIChEQkcpCisgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIm9uSXRlbVNlbGVjdGVkKCkgcG9zaXRpb24gIiArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgIC8vIEEgc3VnZ2VzdGlvbiBoYXMgYmVlbiBzZWxlY3RlZCwgcmV3cml0ZSB0aGUgcXVlcnkgaWYgcG9zc2libGUsCisgICAgICAgICAgICAvLyBvdGhlcndpc2UgdGhlIHJlc3RvcmUgdGhlIG9yaWdpbmFsIHF1ZXJ5LgorICAgICAgICAgICAgaWYgKG1PblN1Z2dlc3Rpb25MaXN0ZW5lciA9PSBudWxsCisgICAgICAgICAgICAgICAgICAgIHx8ICFtT25TdWdnZXN0aW9uTGlzdGVuZXIub25TdWdnZXN0aW9uU2VsZWN0ZWQocG9zaXRpb24pKSB7CisgICAgICAgICAgICAgICAgcmV3cml0ZVF1ZXJ5RnJvbVN1Z2dlc3Rpb24ocG9zaXRpb24pOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEltcGxlbWVudHMgT25JdGVtU2VsZWN0ZWRMaXN0ZW5lcgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgb25Ob3RoaW5nU2VsZWN0ZWQoQWRhcHRlclZpZXc8Pz4gcGFyZW50KSB7CisgICAgICAgICAgICBpZiAoREJHKQorICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJvbk5vdGhpbmdTZWxlY3RlZCgpIik7CisgICAgICAgIH0KKyAgICB9OworCisgICAgLyoqCisgICAgICogUXVlcnkgcmV3cml0aW5nLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCByZXdyaXRlUXVlcnlGcm9tU3VnZ2VzdGlvbihpbnQgcG9zaXRpb24pIHsKKyAgICAgICAgQ2hhclNlcXVlbmNlIG9sZFF1ZXJ5ID0gbVF1ZXJ5VGV4dFZpZXcuZ2V0VGV4dCgpOworICAgICAgICBDdXJzb3IgYyA9IG1TdWdn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IG51bGwpIHsKKyAgICAgICAgICAgICAgICBkYXRhID0gbVNlYXJjaGFibGUuZ2V0U3VnZ2VzdEludGVudERhdGEoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIHRoZW4sIGlmIGFuIElEIHdhcyBwcm92aWRlZCwgYXBwZW5kIGl0LgorICAgICAgICAgICAgaWYgKGRhdGEgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIFN0cmluZyBpZCA9IGdldENvbHVtblN0cmluZyhjLCBTZWFyY2hNYW5hZ2VyLlNVR0dFU1RfQ09MVU1OX0lOVEVOVF9EQVRBX0lEKTsKKyAgICAgICAgICAgICAgICBpZiAoaWQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBkYXRhID0gZGF0YSArICIvIiArIFVyaS5lbmNvZGUoaWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFVyaSBkYXRhVXJpID0gKGRhdGEgPT0gbnVsbCkgPyBudWxsIDogVXJpLnBhcnNlKGRhdGEpOworCisgICAgICAgICAgICBTdHJpbmcgcXVlcnkgPSBnZXRDb2x1bW5TdHJpbmcoYywgU2VhcmNoTWFuYWdlci5TVUdHRVNUX0NPTFVNTl9RVUVSWSk7CisgICAgICAgICAgICBTdHJpbmcgZXh0cmFEYXRhID0gZ2V0Q29sdW1uU3RyaW5nKGMsIFNlYXJjaE1hbmFnZXIuU1VHR0VTVF9DT0xVTU5fSU5URU5UX0VYVFJBX0RBVEEpOworCisgICAgICAgICAgICByZXR1cm4gY3JlYXRlSW50ZW50KGFjdGlvbiwgZGF0YVVyaSwgZXh0cmFEYXRhLCBxdWVyeSwgYWN0aW9uS2V5LCBhY3Rpb25Nc2cpOworICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUgKSB7CisgICAgICAgICAgICBpbnQgcm93TnVtOworICAgICAgICAgICAgdHJ5IHsgICAgICAgICAgICAgICAgICAgICAgIC8vIGJlIHJlYWxseSBwYXJhbm9pZCBub3cKKyAgICAgICAgICAgICAgICByb3dOdW0gPSBjLmdldFBvc2l0aW9uKCk7CisgICAgICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUyICkgeworICAgICAgICAgICAgICAgIHJvd051bSA9IC0xOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIlNlYXJjaCBTdWdnZXN0aW9ucyBjdXJzb3IgYXQgcm93ICIgKyByb3dOdW0gKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgcmV0dXJuZWQgZXhjZXB0aW9uIiArIGUudG9TdHJpbmcoKSk7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENhbGxiYWNrIHRvIHdhdGNoIHRoZSB0ZXh0IGZpZWxkIGZvciBlbXB0eS9ub24tZW1wdHkKKyAgICAgKi8KKyAgICBwcml2YXRlIFRleHRXYXRjaGVyIG1UZXh0V2F0Y2hlciA9IG5ldyBUZXh0V2F0Y2hlcigpIHsKKworICAgICAgICBwdWJsaWMgdm9pZCBiZWZvcmVUZXh0Q2hhbmdlZChDaGFyU2VxdWVuY2UgcywgaW50IHN0YXJ0LCBpbnQgYmVmb3JlLCBpbnQgYWZ0ZXIpIHsgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG9uVGV4dENoYW5nZWQoQ2hhclNlcXVlbmNlIHMsIGludCBzdGFydCwKKyAgICAgICAgICAgICAgICBpbnQgYmVmb3JlLCBpbnQgYWZ0ZXIpIHsKKyAgICAgICAgICAgIFNlYXJjaFZpZXcudGhpcy5vblRleHRDaGFuZ2VkKHMpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgYWZ0ZXJUZXh0Q2hhbmdlZChFZGl0YWJsZSBzKSB7CisgICAgICAgIH0KKyAgICB9OworfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvd2lkZ2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SkgeworICAgICAgICAgICAgbW9kZSA9IGEuZ2V0SW50KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlNwaW5uZXJfc3Bpbm5lck1vZGUsIE1PREVfRElBTE9HKTsKKyAgICAgICAgfQogICAgICAgICAKLSAgICAgICAgbVByb21wdCA9IGEuZ2V0U3RyaW5nKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlNwaW5uZXJfcHJvbXB0KTsKKyAgICAgICAgc3dpdGNoIChtb2RlKSB7CisgICAgICAgIGNhc2UgTU9ERV9ESUFMT0c6IHsKKyAgICAgICAgICAgIG1Qb3B1cCA9IG5ldyBEaWFsb2dQb3B1cCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIE1PREVfRFJPUERPV046IHsKKyAgICAgICAgICAgIGZpbmFsIGludCBoaW50UmVzb3VyY2UgPSBhLmdldFJlc291cmNlSWQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlNwaW5uZXJfcG9wdXBQcm9tcHRWaWV3LCAwKTsKKworICAgICAgICAgICAgRHJvcGRvd25Qb3B1cCBwb3B1cCA9IG5ldyBEcm9wZG93blBvcHVwKGNvbnRleHQsIGF0dHJzLCBkZWZTdHlsZSwgaGludFJlc291cmNlKTsKKworICAgICAgICAgICAgcG9wdXAuc2V0V2lkdGgoYS5nZXRMYXlvdXREaW1lbnNpb24oCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlNwaW5uZXJfZHJvcERvd25XaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpKTsKKyAgICAgICAgICAgIHBvcHVwLnNldEJhY2tncm91bmREcmF3YWJsZShhLmdldERyYXdhYmxlKAorICAgICAgICAgICAgICAgICAgICBjb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KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXRBZGFwdGVyKFNwaW5uZXJBZGFwdGVyIGFkYXB0ZXIpIHsKKyAgICAgICAgc3VwZXIuc2V0QWRhcHRlcihhZGFwdGVyKTsKKworICAgICAgICBpZiAobVBvcHVwICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1Qb3B1cC5zZXRBZGFwdGVyKG5ldyBEcm9wRG93bkFkYXB0ZXIoYWRhcHRlcikpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbVRlbXBBZGFwdGVyID0gbmV3IERyb3BEb3duQWRhcHRlcihhZGFwdGVyKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIEBPdmVycmlkZQpAQCAtODcsNyArMjE1LDYgQEAKICAgICAgICAgCiAgICAgICAgIGlmIChtUG9wdXAgIT0gbnVsbCAmJiBtUG9wdXAuaXNTaG93aW5nKCkpIHsKICAgICAgICAgICAgIG1Qb3B1cC5kaXNtaXNzKCk7Ci0gICAgICAgICAgICBtUG9wdXAgPSBudWxsOwogICAgICAgICB9CiAgICAgfQogCkBAIC0xOTcsOCArMzI0LDYgQEAKICAgICAgICAgcmV0dXJuIGNoaWxkOwogICAgIH0KIAotCi0KICAgICAvKioKICAgICAgKiBIZWxwZXIgZm9yIG1ha2VBbmRBZGRWaWV3IHRvIHNldCB0aGUgcG9zaXRpb24gb2YgYSB2aWV3CiAgICAgICogYW5kIGZpbGwgb3V0IGl0cyBsYXlvdXQgcGFyYW10ZXJzLgpAQCAtMjQ5LDE1ICszNzQsMTAgQEAKICAgICAgICAgCiAgICAgICAgIGlmICghaGFuZGxlZCkgewogICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7Ci0gICAgICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBnZXRDb250ZXh0KCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGZpbmFsIERyb3BEb3duQWRhcHRlciBhZGFwdGVyID0gbmV3IERyb3BEb3duQWRhcHRlcihnZXRBZGFwdGVyKCkpOwogCi0gICAgICAgICAgICBBbGVydERpYWxvZy5CdWlsZGVyIGJ1aWxkZXIgPSBuZXcgQWxlcnREaWFsb2cuQnVpbGRlcihjb250ZXh0KTsKLSAgICAgICAgICAgIGlmIChtUHJvbXB0ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyLnNldFRpdGxlKG1Qcm9tcHQpOworICAgICAgICAgICAgaWYgKCFtUG9wdXAuaXNTaG93aW5nKCkpIHsKKyAgICAgICAgICAgICAgICBtUG9wdXAuc2hvdygpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgbVBvcHVwID0gYnVpbGRlci5zZXRTaW5nbGVDaG9pY2VJdGVtcyhhZGFwdGVyLCBnZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpLCB0aGlzKS5zaG93KCk7CiAgICAgICAgIH0KIAogICAgICAgICByZXR1cm4gaGFuZGxlZDsKQEAgLTI2Niw3ICszODYsNiBAQAogICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soRGlhbG9nSW50ZXJmYWNlIGRpYWxvZywgaW50IHdoaWNoKSB7CiAgICAgICAgIHNldFNlbGVjdGlvbih3aGljaCk7CiAgICAgICAgIGRpYWxvZy5kaXNtaXNzKCk7Ci0gICAgICAgIG1Qb3B1cCA9IG51bGw7CiAgICAgfQogCiAgICAgLyoqCkBAIC0yNzQsNyArMzkzLDcgQEAKICAgICAgKiBAcGFyYW0gcHJvbXB0IHRoZSBwcm9tcHQgdG8gc2V0CiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0UHJvbXB0KENoYXJTZXF1ZW5jZSBwcm9tcHQpIHsKLSAgICAgICAgbVByb21wdCA9IHByb21wdDsKKyAgICAgICAgbVBvcHVwLnNldFByb21wdFRleHQocHJvbXB0KTsKICAgICB9CiAKICAgICAvKioKQEAgLTI4MiwxNCArNDAxLDE0IEBACiAgICAgICogQHBhcmFtIHByb21wdElkIHRoZSByZXNvdXJjZSBJRCBvZiB0aGUgcHJvbXB0IHRvIGRpc3BsYXkgd2hlbiB0aGUgZGlhbG9nIGlzIHNob3duCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0UHJvbXB0SWQoaW50IHByb21wdElkKSB7Ci0gICAgICAgIG1Qcm9tcHQgPSBnZXRDb250ZXh0KCkuZ2V0VGV4dChwcm9tcHRJZCk7CisgICAgICAgIHNldFByb21wdChnZXRDb250ZXh0KCkuZ2V0VGV4dChwcm9tcHRJZCkpOwogICAgIH0KIAogICAgIC8qKgogICAgICAqIEByZXR1cm4gVGhlIHByb21wdCB0byBkaXNwbGF5IHdoZW4gdGhlIGRpYWxvZyBpcyBzaG93bgogICAgICAqLwogICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0UHJvbXB0KCkgewotICAgICAgICByZXR1cm4gbVByb21wdDsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5nZXRIaW50VGV4dCgpOwogICAgIH0KICAgICAKICAgICAvKioKQEAgLTM4Nyw0ICs1MDYsMTI0IEBACiAgICAgICAgICAgICByZXR1cm4gZ2V0Q291bnQoKSA9PSAwOwogICAgICAgICB9CiAgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIEltcGxlbWVudHMgc29tZSBzb3J0IG9mIHBvcHVwIHNlbGVjdGlvbiBpbnRlcmZhY2UgZm9yIHNlbGVjdGluZyBhIHNwaW5uZXIgb3B0aW9uLgorICAgICAqIEFsbG93cyBmb3IgZGlmZmVyZW50IHNwaW5uZXIgbW9kZXMuCisgICAgICovCisgICAgcHJpdmF0ZSBpbnRlcmZhY2UgU3Bpbm5lclBvcHVwIHsKKyAgICAgICAgcHVibGljIHZvaWQgc2V0QWRhcHRlcihMaXN0QWRhcHRlciBhZGFwdGVyKTsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBTaG93IHRoZSBwb3B1cAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgc2hvdygpOworICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIERpc21pc3MgdGhlIHBvcHVwCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBkaXNtaXNzKCk7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSBwb3B1cCBpcyBzaG93aW5nLCBmYWxzZSBvdGhlcndpc2UuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc1Nob3dpbmcoKTsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZXQgaGludCB0ZXh0IHRvIGJlIGRpc3BsYXllZCB0byB0aGUgdXNlci4gVGhpcyBzaG91bGQgcHJvdmlkZQorICAgICAgICAgKiBhIGRlc2NyaXB0aW9uIG9mIHRoZSBjaG9pY2UgYmVpbmcgbWFkZS4KKyAgICAgICAgICogQHBhcmFtIGhpbnRUZXh0IEhpbnQgdGV4dCB0byBzZXQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBzZXRQcm9tcHRUZXh0KENoYXJTZXF1ZW5jZSBoaW50VGV4dCk7CisgICAgICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0SGludFRleHQoKTsKKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBjbGFzcyBEaWFsb2dQb3B1cCBpbXBsZW1lbnRzIFNwaW5uZXJQb3B1cCwgRGlhbG9nSW50ZXJmYWNlLk9uQ2xpY2tMaXN0ZW5lciB7CisgICAgICAgIHByaXZhdGUgQWxlcnREaWFsb2cgbVBvcHVwOworICAgICAgICBwcml2YXRlIExpc3RBZGFwdGVyIG1MaXN0QWRhcHRlcjsKKyAgICAgICAgcHJpdmF0ZSBDaGFyU2VxdWVuY2UgbVByb21wdDsKKworICAgICAgICBwdWJsaWMgdm9pZCBkaXNtaXNzKCkgeworICAgICAgICAgICAgbVBvcHVwLmRpc21pc3MoKTsKKyAgICAgICAgICAgIG1Qb3B1cCA9IG51bGw7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc1Nob3dpbmcoKSB7CisgICAgICAgICAgICByZXR1cm4gbVBvcHVwICE9IG51bGwgPyBtUG9wdXAuaXNTaG93aW5nKCkgOiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldEFkYXB0ZXIoTGlzdEFkYXB0ZXIgYWRhcHRlcikgeworICAgICAgICAgICAgbUxpc3RBZGFwdGVyID0gYWRhcHRlcjsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFByb21wdFRleHQoQ2hhclNlcXVlbmNlIGhpbnRUZXh0KSB7CisgICAgICAgICAgICBtUHJvbXB0ID0gaGludFRleHQ7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0SGludFRleHQoKSB7CisgICAgICAgICAgICByZXR1cm4gbVByb21wdDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgICAgICBBbGVydERpYWxvZy5CdWlsZGVyIGJ1aWxkZXIgPSBuZXcgQWxlcnREaWFsb2cuQnVpbGRlcihnZXRDb250ZXh0KCkpOworICAgICAgICAgICAgaWYgKG1Qcm9tcHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIuc2V0VGl0bGUobVByb21wdCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtUG9wdXAgPSBidWlsZGVyLnNldFNpbmdsZUNob2ljZUl0ZW1zKG1MaXN0QWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKSwgdGhpcykuc2hvdygpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKERpYWxvZ0ludGVyZmFjZSBkaWFsb2csIGludCB3aGljaCkgeworICAgICAgICAgICAgc2V0U2VsZWN0aW9uKHdoaWNoKTsKKyAgICAgICAgICAgIGRpc21pc3MoKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwcml2YXRlIGNsYXNzIERyb3Bkb3duUG9wdXAgZXh0ZW5kcyBMaXN0UG9wdXBXaW5kb3cgaW1wbGVtZW50cyBTcGlubmVyUG9wdXAgeworICAgICAgICBwcml2YXRlIENoYXJTZXF1ZW5jZSBtSGludFRleHQ7CisgICAgICAgIHByaXZhdGUgVGV4dFZpZXcgbUhpbnRWaWV3OworICAgICAgICBwcml2YXRlIGludCBtSGludFJlc291cmNlOworICAgICAgICAKKyAgICAgICAgcHVibGljIERyb3Bkb3duUG9wdXAoQ29udGV4dCBjb250ZXh0LCBBdHRyaWJ1dGVTZXQgYXR0cnMsCisgICAgICAgICAgICAgICAgaW50IGRlZlN0eWxlUmVzLCBpbnQgaGludFJlc291cmNlKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCBhdHRycywgMCwgZGVmU3R5bGVSZXMpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtSGludFJlc291cmNlID0gaGludFJlc291cmNlOworICAgICAgICAgICAgCisgICAgICAgICAgICBzZXRBbmNob3JWaWV3KFNwaW5uZXIudGhpcyk7CisgICAgICAgICAgICBzZXRNb2RhbCh0cnVlKTsKKyAgICAgICAgICAgIHNldFByb21wdFBvc2l0aW9uKFBPU0lUSU9OX1BST01QVF9BQk9WRSk7CisgICAgICAgICAgICBzZXRPbkl0ZW1DbGlja0xpc3RlbmVyKG5ldyBPbkl0ZW1DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uSXRlbUNsaWNrKEFkYXB0ZXJWaWV3IHBhcmVudCwgVmlldyB2LCBpbnQgcG9zaXRpb24sIGxvbmcgaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgU3Bpbm5lci50aGlzLnNldFNlbGVjdGlvbihwb3NpdGlvbik7CisgICAgICAgICAgICAgICAgICAgIGRpc21pc3MoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcHVibGljIENoYXJTZXF1ZW5jZSBnZXRIaW50VGV4dCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtSGludFRleHQ7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFByb21wdFRleHQoQ2hhclNlcXVlbmNlIGhpbnRUZXh0KSB7CisgICAgICAgICAgICBtSGludFRleHQgPSBoaW50VGV4dDsKKyAgICAgICAgICAgIGlmIChtSGludFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1IaW50Vmlldy5zZXRUZXh0KGhpbnRUZXh0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBzaG93KCkgeworICAgICAgICAgICAgaWYgKG1IaW50VmlldyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgZmluYWwgVGV4dFZpZXcgdGV4dFZpZXcgPSAoVGV4dFZpZXcpIExheW91dEluZmxhdGVyLmZyb20oZ2V0Q29udGV4dCgpKS5pbmZsYXRlKAorICAgICAgICAgICAgICAgICAgICAgICAgbUhpbnRSZXNvdXJjZSwgbnVsbCkuZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQudGV4dDEpOworICAgICAgICAgICAgICAgIHRleHRWaWV3LnNldFRleHQobUhpbnRUZXh0KTsKKyAgICAgICAgICAgICAgICBzZXRQcm9tcHRWaWV3KHRleHRWaWV3KTsKKyAgICAgICAgICAgICAgICBtSGludFZpZXcgPSB0ZXh0VmlldzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN1cGVyLnNob3coKTsKKyAgICAgICAgICAgIGdldExpc3RWaWV3KCkuc2V0Q2hvaWNlTW9kZShMaXN0Vmlldy5D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vSW5kZXgsIFZpZXcgdmlldykgeworICAgICAgICBpZiAoZnJvbUluZGV4ID09IC0xICYmIHRvSW5kZXggIT0gMCkgeworICAgICAgICAgICAgLy8gRmFkZSBpdGVtIGluCisgICAgICAgICAgICBpZiAodmlldy5nZXRBbHBoYSgpID09IDEpIHsKKyAgICAgICAgICAgICAgICB2aWV3LnNldEFscGhhKDApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdmlldy5zZXRWaXNpYmlsaXR5KFZJU0lCTEUpOworCisgICAgICAgICAgICBPYmplY3RBbmltYXRvciBmYWRlSW4gPSBPYmplY3RBbmltYXRvci5vZkZsb2F0KHZpZXcsICJhbHBoYSIsIHZpZXcuZ2V0QWxwaGEoKSwgMS4wZik7CisgICAgICAgICAgICBmYWRlSW4uc2V0RHVyYXRpb24oREVGQVVMVF9BTklNQVRJT05fRFVSQVRJT04pOworICAgICAgICAgICAgZmFkZUluLnN0YXJ0KCk7CisgICAgICAgIH0gZWxzZSBpZiAoZnJvbUluZGV4ID09IDAgJiYgdG9JbmRleCA9PSAxKSB7CisgICAgICAgICAgICAvLyBTbGlkZSBpdGVtIGluCisgICAgICAgICAgICB2aWV3LnNldFZpc2liaWxpdHkoVklTSUJMRSk7CisKKyAgICAgICAgICAgIGludCBkdXJhdGlvbiA9IE1hdGgucm91bmQobVN0YWNrU2xpZGVyLmdldER1cmF0aW9uRm9yTmV1dHJhbFBvc2l0aW9uKG1ZVmVsb2NpdHkpKTsKKworICAgICAgICAgICAgU3RhY2tTbGlkZXIgYW5pbWF0aW9uU2xpZGVyID0gbmV3IFN0YWNrU2xpZGVyKG1TdGFja1NsaWRlcik7CisgICAgICAgICAgICBQcm9wZXJ0eVZhbHVlc0hvbGRlciBzbGlkZUluWSA9IFByb3BlcnR5VmFsdWVzSG9sZGVyLm9mRmxvYXQoIllQcm9ncmVzcyIsIDAuMGYpOworICAgICAgICAgICAgUHJvcGVydHlWYWx1ZXNIb2xkZXIgc2xpZGVJblggPSBQcm9wZXJ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ZXIsCisgICAgICAgICAgICAgICAgICAgIHNsaWRlT3V0WCwgc2xpZGVPdXRZKTsKKyAgICAgICAgICAgIHBhLnNldER1cmF0aW9uKGR1cmF0aW9uKTsKKyAgICAgICAgICAgIHBhLnNldEludGVycG9sYXRvcihuZXcgTGluZWFySW50ZXJwb2xhdG9yKCkpOworICAgICAgICAgICAgcGEuc3RhcnQoKTsKKyAgICAgICAgfSBlbHNlIGlmIChmcm9tSW5kZXggPT0gLTEgJiYgdG9JbmRleCA9PSAwKSB7CisgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdGhpcyB2aWV3IHRoYXQgaXMgIndhaXRpbmcgaW4gdGhlIHdpbmdzIiBpcyBpbnZpc2libGUKKyAgICAgICAgICAgIHZpZXcuc2V0QWxwaGEoMC4wZik7CisgICAgICAgICAgICB2aWV3LnNldFZpc2liaWxpdHkoSU5WSVNJQkxFKTsKKyAgICAgICAgICAgIExheW91dFBhcmFtcyBscCA9IChMYXlvdXRQYXJhbXMpIHZpZXcuZ2V0TGF5b3V0UGFyYW1zKCk7CisgICAgICAgICAgICBscC5zZXRWZXJ0aWNhbE9mZnNldCgtbVNsaWRlQW1vdW50KTsKKyAgICAgICAgfSBlbHNlIGlmICh0b0luZGV4ID09IC0xKSB7CisgICAgICAgICAgICAvLyBGYWRlIGl0ZW0gb3V0CisgICAgICAgICAgICBPYmplY3RBbmltYXRvciBmYWRlT3V0ID0gT2JqZWN0QW5pbWF0b3Iub2ZGbG9hdCh2aWV3LCAiYWxwaGEiLCB2aWV3LmdldEFscGhhKCksIDAuMGYpOworICAgICAgICAgICAgZmFkZU91dC5zZXREdXJhdGlvbihERUZBVUxUX0FOSU1BVElPTl9EVVJBVElPTik7CisgICAgICAgICAgICBmYWRlT3V0LnN0YXJ0KCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBJbXBsZW1lbnQgdGhlIGZha2VkIHBlcnNwZWN0aXZlCisgICAgICAgIGlmICh0b0luZGV4ICE9IC0xKSB7CisgICAgICAgICAgICB0cmFuc2Zvcm1WaWV3QXRJbmRleCh0b0luZGV4LCB2aWV3KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzZXR1cFN0YWNrU2xpZGVyKFZpZXcgdiwgaW50IG1vZGUpIHsKKyAgICAgICAgbVN0YWNrU2xpZGVyLnNldE1vZGUobW9kZSk7CisgICAgICAgIGlmICh2ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1IaWdobGlnaHQuc2V0SW1hZ2VCaXRtYXAoc0hvbG9ncmFwaGljSGVscGVyLmNyZWF0ZU91dGxpbmUodikpOworICAgICAgICAgICAgbUhpZ2hsaWdodC5zZXRSb3RhdGlvbih2LmdldFJvdGF0aW9uKCkpOworICAgICAgICAgICAgbUhpZ2hsaWdodC5zZXRUcmFuc2xhdGlvblkodi5nZXRUcmFuc2xhdGlvblkoKSk7CisgICAgICAgICAgICBtSGlnaGxpZ2h0LmJyaW5nVG9Gcm9udCgpOworICAgICAgICAgICAgdi5icmluZ1RvRnJvbnQoKTsKKyAgICAgICAgICAgIG1TdGFja1NsaWRlci5zZXRWaWV3KHYpOworCisgICAgICAgICAgICB2LnNldFZpc2liaWxpdHkoVklTSUJMRSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBAYW5kcm9pZC52aWV3LlJlbW90YWJsZVZpZXdNZXRob2QKKyAgICBwdWJsaWMgdm9pZCBzaG93TmV4dCgpIHsKKyAgICAgICAgaWYgKCFtVHJhbnNpdGlvbklzU2V0dXApIHsKKyAgICAgICAgICAgIFZpZXcgdiA9IGdldFZpZXdBdFJlbGF0aXZlSW5kZXgoMSk7CisgICAgICAgICAgICBpZiAodiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgc2V0dXBTdGFja1NsaWRlcih2LCBTdGFja1NsaWRlci5OT1JNQUxfTU9ERSk7CisgICAgICAgICAgICAgICAgbVN0YWNrU2xpZGVyLnNldFlQcm9ncmVzcygwKTsKKyAgICAgICAgICAgICAgICBtU3RhY2tTbGlkZXIuc2V0WFByb2dyZXNzKDApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHN1cGVyLnNob3dOZXh0KCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgQGFuZHJvaWQudmlldy5SZW1vdGFibGVWaWV3TWV0aG9kCisgICAgcHVibGljIHZvaWQgc2hvd1ByZXZpb3VzKCkgeworICAgICAgICBpZiAoIW1UcmFuc2l0aW9uSXNTZXR1cCkgeworICAgICAgICAgICAgVmlldyB2ID0gZ2V0Vmlld0F0UmVsYXRpdmVJbmRleCgwKTsKKyAgICAgICAgICAgIGlmICh2ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBzZXR1cFN0YWNrU2xpZGVyKHYsIFN0YWNrU2xpZGVyLk5PUk1BTF9NT0RFKTsKKyAgICAgICAgICAgICAgICBtU3RhY2tTbGlkZXIuc2V0WVByb2dyZXNzKDEpOworICAgICAgICAgICAgICAgIG1TdGFja1NsaWRlci5zZXRYUHJvZ3Jlc3MoMCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgc3VwZXIuc2hvd1ByZXZpb3VzKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHRyYW5zZm9ybVZpZXdBdEluZGV4KGludCBpbmRleCwgVmlldyB2aWV3KSB7CisgICAgICAgIGZsb2F0IG1heFBlcnBlY3RpdmVTaGlmdCA9IG1NZWFzdXJlZEhlaWdodCAqIFBFUlNQRUNUSVZFX1NISUZUX0ZBQ1RPUjsKKworICAgICAgICBpbmRleCA9IG1NYXhOdW1BY3RpdmVWaWV3cyAtIGluZGV4IC0gMTsKKyAgICAgICAgaWYgKGluZGV4ID09IG1NYXhOdW1BY3RpdmVWaWV3cyAtIDEpIGluZGV4LS07CisKKyAgICAgICAgZmxvYXQgciA9IChpbmRleCAqIDEuMGYpIC8gKG1NYXhOdW1BY3RpdmVWaWV3cyAtIDIpOworCisgICAgICA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xlWCwgc2NhbGVZLCB0cmFuc2xhdGlvblkpOworICAgICAgICBwYS5zZXREdXJhdGlvbigxMDApOworICAgICAgICBwYS5zdGFydCgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHZvaWQgc2hvd09ubHkoaW50IGNoaWxkSW5kZXgsIGJvb2xlYW4gYW5pbWF0ZSwgYm9vbGVhbiBvbkxheW91dCkgeworICAgICAgICBzdXBlci5zaG93T25seShjaGlsZEluZGV4LCBhbmltYXRlLCBvbkxheW91dCk7CisKKyAgICAgICAgLy8gSGVyZSB3ZSBuZWVkIHRvIG1ha2Ugc3VyZSB0aGF0IHRoZSB6LW9yZGVyIG9mIHRoZSBjaGlsZHJlbiBpcyBjb3JyZWN0CisgICAgICAgIGZvciAoaW50IGkgPSBtQ3VycmVudFdpbmRvd0VuZDsgaSA+PSBtQ3VycmVudFdpbmRvd1N0YXJ0OyBpLS0pIHsKKyAgICAgICAgICAgIGludCBpbmRleCA9IG1vZHVsbyhpLCBnZXRXaW5kb3dTaXplKCkpOworICAgICAgICAgICAgVmlldyB2ID0gbVZpZXdzTWFwLmdldChpbmRleCkudmlldzsKKyAgICAgICAgICAgIGlmICh2ICE9IG51bGwpIHYuYnJpbmdUb0Zyb250KCk7CisgICAgICAgIH0KKyAgICAgICAgbVRyYW5zaXRpb25Jc1NldHVwID0gZmFsc2U7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZUNoaWxkVHJhbnNmb3JtcygpIHsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBnZXROdW1BY3RpdmVWaWV3cygpOyBpKyspIHsKKyAgICAgICAgICAgIFZpZXcgdiA9IGdldFZpZXdBdFJlbGF0aXZlSW5kZXgoaSk7CisgICAgICAgICAgICBpZiAodiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdHJhbnNmb3JtVmlld0F0SW5kZXgoaSwgdik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBGcmFtZUxheW91dCBnZXRGcmFtZUZvckNoaWxkKCkgeworICAgICAgICBGcmFtZUxheW91dCBmbCA9IG5ldyBGcmFtZUxheW91dChtQ29udGV4dCk7CisgICAgICAgIGZsLnNldFBhZGRpbmcobUZyYW1lUGFkZGluZywgbUZyYW1lUGFkZGluZywgbUZyYW1lUGFkZGluZywgbUZyYW1lUGFkZGluZyk7CisgICAgICAgIHJldHVybiBmbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBcHBseSBhbnkgbmVjZXNzYXJ5IHRyYW5mb3JtcyBmb3IgdGhlIGNoaWxkIHRoYXQgaXMgYmVpbmcgYWRkZWQuCisgICAgICovCisgICAgdm9pZCBhcHBseVRyYW5zZm9ybUZvckNoaWxkQXRJbmRleChWaWV3IGNoaWxkLCBpbnQgcmVsYXRpdmVJbmRleCkgeworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIGRpc3BhdGNoRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgIGNhbnZhcy5nZXRDbGlwQm91bmRzKGludmFsaWRhdGVSZWN0KTsKKyAgICAgICAgZmluYWwgaW50IGNoaWxkQ291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY2hpbGRDb3VudDsgaSsrKSB7CisgICAgICAgICAgICBMYXlvdXRQYXJhbXMgbHAgPSAoTGF5b3V0UGFyYW1zKSBnZXRDaGlsZEF0KGkpLmdldExheW91dFBhcmFtcygpOworICAgICAgICAgICAgaW52YWxpZGF0ZVJlY3QudW5pb24obHAuZ2V0SW52YWxpZGF0ZVJlY3QoKSk7CisgICAgICAgICAgICBscC5yZXNldEludmFsaWRhdGVSZWN0KCk7CisgICAgICAgIH0KKworICAgICAgICBjYW52YXMuc2F2ZShDYW52YXMuQ0xJUF9TQVZFX0ZMQUcpOworICAgICAgICBjYW52YXMuY2xpcFJlY3QoaW52YWxpZGF0ZVJlY3QsIFJlZ2lvbi5PcC5VTklPTik7CisgICAgICAgIHN1cGVyLmRpc3BhdGNoRHJhdyhjYW52YXMpOworICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBvbkxheW91dCgpIHsKKyAgICAgICAgaWYgKCFtRmlyc3RMYXlvdXRIYXBwZW5lZCkgeworICAgICAgICAgICAgbVNsaWRlQW1vdW50ID0gTWF0aC5yb3VuZChTTElERV9VUF9SQVRJTyAqIGdldE1lYXN1cmVkSGVpZ2h0KCkpOworICAgICAgICAgICAgdXBkYXRlQ2hpbGRUcmFuc2Zvcm1zKCk7CisgICAgICAgICAgICBtU3dpcGVUaHJlc2hvbGQgPSBNYXRoLnJvdW5kKFNXSVBFX1RIUkVTSE9MRF9SQVRJTyAqIG1TbGlkZUFtb3VudCk7CisgICAgICAgICAgICBtRmlyc3RMYXlvdXRIYXBwZW5lZCA9IHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvbkludGVyY2VwdFRvdWNoRXZlbnQoTW90aW9uRXZlbnQgZXYpIHsKKyAgICAgICAgaW50IGFjdGlvbiA9IGV2LmdldEFjdGlvbigpOworICAgICAgICBzd2l0Y2goYWN0aW9uICYgTW90aW9uRXZlbnQuQUNUSU9OX01BU0spIHsKKyAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX0RPV046IHsKKyAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVBvaW50ZXJJZCA9PSBJTlZBTElEX1BPSU5URVIpIHsKKyAgICAgICAgICAgICAgICAgICAgbUluaXRpYWxYID0gZXYuZ2V0WCgpOworICAgICAgICAgICAgICAgICAgICBtSW5pdGlhbFkgPSBldi5nZXRZKCk7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQb2ludGVySWQgPSBldi5nZXRQb2ludGVySWQoMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRTogeworICAgICAgICAgICAgICAgIGludCBwb2ludGVySW5kZXggPSBldi5maW5kUG9pbnRlckluZGV4KG1BY3RpdmVQb2ludGVySWQpOworICAgICAgICAgICAgICAgIGlmIChwb2ludGVySW5kZXggPT0gSU5WQUxJRF9QT0lOVEVSKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIG5vIGRhdGEgZm9yIG91ciBwcmltYXJ5IHBvaW50ZXIsIHRoaXMgc2hvdWxkbid0IGhhcHBlbiwgbG9nIGl0CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIkVycm9yOiBObyBkYXRhIGZvciBvdXIgcHJpbWFyeSBwb2ludGVyLiIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZsb2F0IG5ld1kgPSBldi5nZXRZKHBvaW50ZXJJbmRleCk7CisgICAgICAgICAgICAgICAgZmxvYXQgZGVsdGFZID0gbmV3WSAtIG1Jbml0aWFsWTsKKworICAgICAgICAgICAgICAgIGJlZ2luR2VzdHVyZUlmTmVlZGVkKGRlbHRhWSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX1VQOiB7CisgICAgICAgICAgICAgICAgb25TZWNvbmRhcnlQb2ludGVyVXAoZXYpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fVVA6CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6IHsKKyAgICAgICAgICAgICAgICBtQWN0aXZlUG9pbnRlcklkID0gSU5WQUxJRF9QT0lOVEVSOworICAgICAgICAgICAgICAgIG1Td2lwZUdlc3R1cmVUeXBlID0gR0VTVFVSRV9OT05FOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG1Td2lwZUdlc3R1cmVUeXBlICE9IEdFU1RVUkVfTk9ORTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgYmVnaW5HZXN0dXJlSWZOZWVkZWQoZmxvYXQgZGVsdGFZKSB7CisgICAgICAgIGlmICgoaW50KSBNYXRoLmFicyhkZWx0YVkpID4gbVRvdWNoU2xvcCAmJiBtU3dpcGVHZXN0dXJlVHlwZSA9PSBHRVNUVVJFX05PTkUpIHsKKyAgICAgICAgICAgIGludCBzd2lwZUdlc3R1cmVUeXBlID0gZGVsdGFZIDwgMCA/IEdFU1RVUkVfU0xJREVfVVAgOiBHRVNUVVJFX1NMSURFX0RPV047CisgICAgICAgICAgICBjYW5jZWxMb25nUHJlc3MoKTsKKyAgICAgICAgICAgIHJlcXVlc3REaXNhbGxvd0ludGVyY2VwdFRvdWNoRXZlbnQodHJ1ZSk7CisKKyAgICAgICAgICAgIGlmIChtQWRhcHRlciA9PSBudWxsKSByZXR1cm47CisKKyAgICAgICAgICAgIGludCBhY3RpdmVJbmRleDsKKyAgICAgICAgICAgIGlmIChtU3RhY2tNb2RlID09IElURU1TX1NMSURFX1VQKSB7CisgICAgICAgICAgICAgICAgYWN0aXZlSW5kZXggPSAoc3dpcGVHZXN0dXJlVHlwZSA9PSBHRVNUVVJFX1NMSURFX0RPV04pID8gMCA6IDE7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGFjdGl2ZUluZGV4ID0gKHN3aXBlR2VzdHVyZVR5cGUgPT0gR0VTVFVSRV9TTElERV9ET1dOKSA/IDEgOiAwOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQgc3RhY2tNb2RlOworICAgICAgICAgICAgaWYgKG1Mb29wVmlld3MpIHsKKyAgICAgICAgICAgICAgICBzdGFja01vZGUgPSBTdGFja1NsaWRlci5OT1JNQUxfTU9ERTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobUN1cnJlbnRXaW5kb3dTdGFydFVuYm91bmRlZCArIGFjdGl2ZUluZGV4ID09IC0xKSB7CisgICAgICAgICAgICAgICAgYWN0aXZlSW5kZXgrKzsKKyAgICAgICAgICAgICAgICBzdGFja01vZGUgPSBTdGFja1NsaWRlci5CRUdJTk5JTkdfT0ZfU1RBQ0tfTU9ERTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobUN1cnJlbnRXaW5kb3dTdGFydFVuYm91bmRlZCArIGFjdGl2ZUluZGV4ID09IG1BZGFwdGVyLmdldENvdW50KCkgLSAxKSB7CisgICAgICAgICAgICAgICAgc3RhY2tNb2RlID0gU3RhY2tTbGlkZXIuRU5EX09GX1NUQUNLX01PREU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHN0YWNrTW9kZSA9IFN0YWNrU2xpZGVyLk5PUk1BTF9NT0RFOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtVHJhbnNpdGlvbklzU2V0dXAgPSBzdGFja01vZGUgPT0gU3RhY2tTbGlkZXIuTk9STUFMX01PREU7CisKKyAgICAgICAgICAgIFZpZXcgdiA9IGdldFZpZXdBdFJlbGF0aXZlSW5kZXgoYWN0aXZlSW5kZXgpOworICAgICAgICAgICAgaWYgKHYgPT0gbnVsbCkgcmV0dXJuOworCisgICAgICAgICAgICBzZXR1cFN0YWNrU2xpZGVyKHYsIHN0YWNrTW9kZSk7CisKKyAgICAgICAgICAgIC8vIFdlIG9ubHkgcmVnaXN0ZXIgdGhpcyBnZXN0dXJlIGlmIHdlJ3ZlIG1hZGUgaXQgdGhpcyBmYXIgd2l0aG91dCBhIHByb2JsZW0KKyAgICAgICAgICAgIG1Td2lwZUdlc3R1cmVUeXBlID0gc3dpcGVHZXN0dXJlVHlwZTsKKyAgICAgICAgICAgIGNhbmNlbEhhbmRsZUNsaWNrKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvblRvdWNoRXZlbnQoTW90aW9uRXZlbnQgZXYpIHsKKyAgICAgICAgc3VwZXIub25Ub3VjaEV2ZW50KGV2KTsKKworICAgICAgICBpbnQgYWN0aW9uID0gZXYuZ2V0QWN0aW9uKCk7CisgICAgICAgIGludCBwb2ludGVySW5kZXggPSBldi5maW5kUG9pbnRlckluZGV4KG1BY3RpdmVQb2ludGVySWQpOworICAgICAgICBpZiAocG9pbnRlckluZGV4ID09IElOVkFMSURfUE9JTlRFUikgeworICAgICAgICAgICAgLy8gbm8gZGF0YSBmb3Igb3VyIHByaW1hcnkgcG9pbnRlciwgdGhpcyBzaG91bGRuJ3QgaGFwcGVuLCBsb2cgaXQKKyAgICAgICAgICAgIExvZy5kKFRBRywgIkVycm9yOiBObyBkYXRhIGZvciBvdXIgcHJpbWFyeSBwb2ludGVyLiIpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZmxvYXQgbmV3WSA9IGV2LmdldFkocG9pbnRlckluZGV4KTsKKyAgICAgICAgZmxvYXQgbmV3WCA9IGV2LmdldFgocG9pbnRlckluZGV4KTsKKyAgICAgICAgZmxvYXQgZGVsdGFZID0gbmV3WSAtIG1Jbml0aWFsWTsKKyAgICAgICAgZmxvYXQgZGVsdGFYID0gbmV3WCAtIG1Jbml0aWFsWDsKKyAgICAgICAgaWYgKG1WZWxvY2l0eVRyYWNrZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgbVZlbG9jaXR5VHJhY2tlciA9IFZlbG9jaXR5VHJhY2tlci5vYnRhaW4oKTsKKyAgICAgICAgfQorICAgICAgICBtVmVsb2NpdHlUcmFja2VyLmFkZE1vdmVtZW50KGV2KTsKKworICAgICAgICBzd2l0Y2ggKGFjdGlvbiAmIE1vdGlvbkV2ZW50LkFDVElPTl9NQVNLKSB7CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFOiB7CisgICAgICAgICAgICAgICAgYmVnaW5HZXN0dXJlSWZOZWVkZWQoZGVsdGFZKTsKKworICAgICAgICAgICAgICAgIGZsb2F0IHJ4ID0gZGVsdGFYIC8gKG1TbGlkZUFtb3VudCAqIDEuMGYpOworICAgICAgICAgICAgICAgIGlmIChtU3dpcGVHZXN0dXJlVHlwZSA9PSBHRVNUVVJFX1NMSURFX0RPV04pIHsKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgciA9IChkZWx0YVkgLSBtVG91Y2hTbG9wICogMS4wZikgLyBtU2xpZGVBbW91bnQgKiAxLjBmOworICAgICAgICAgICAgICAgICAgICBpZiAobVN0YWNrTW9kZSA9PSBJVEVNU19TTElERV9ET1dOKSByID0gMSAtIHI7CisgICAgICAgICAgICAgICAgICAgIG1TdGFja1NsaWRlci5zZXRZUHJvZ3Jlc3MoMSAtIHIpOworICAgICAgICAgICAgICAgICAgICBtU3RhY2tTbGlkZXIuc2V0WFByb2dyZXNzKHJ4KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtU3dpcGVHZXN0dXJlVHlwZSA9PSBHRVNUVVJFX1NMSURFX1VQKSB7CisgICAgICAgICAgICAgICAgICAgIGZsb2F0IHIgPSAtKGRlbHRhWSArIG1Ub3VjaFNsb3AgKiAxLjBmKSAvIG1TbGlkZUFtb3VudCAqIDEuMGY7CisgICAgICAgICAgICAgICAgICAgIGlmIChtU3RhY2tNb2RlID09IElURU1TX1NMSURFX0RPV04pIHIgPSAxIC0gcjsKKyAgICAgICAgICAgICAgICAgICAgbVN0YWNrU2xpZGVyLnNldFlQcm9ncmVzcyhyKTsKKyAgICAgICAgICAgICAgICAgICAgbVN0YWNrU2xpZGVyLnNldFhQcm9ncmVzcyhyeCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1VQOiB7CisgICAgICAgICAgICAgICAgaGFuZGxlUG9pbnRlclVwKGV2KTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfVVA6IHsKKyAgICAgICAgICAgICAgICBvblNlY29uZGFyeVBvaW50ZXJVcChldik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6IHsKKyAgICAgICAgICAgICAgICBtQWN0aXZlUG9pbnRlcklkID0gSU5WQUxJRF9QT0lOVEVSOworICAgICAgICAgICAgICAgIG1Td2lwZUdlc3R1cmVUeXBlID0gR0VTVFVSRV9OT05FOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgUmVjdCB0b3VjaFJlY3QgPSBuZXcgUmVjdCgpOworICAgIHByaXZhdGUgdm9pZCBvblNlY29uZGFyeVBvaW50ZXJVcChNb3Rpb25FdmVudCBldikgeworICAgICAgICBmaW5hbCBpbnQgYWN0aXZlUG9pbnRlckluZGV4ID0gZXYuZ2V0QWN0aW9uSW5kZXgoKTsKKyAgICAgICAgZmluYWwgaW50IHBvaW50ZXJJZCA9IGV2LmdldFBvaW50ZXJJZChhY3RpdmVQb2ludGVySW5kZXgpOworICAgICAgICBpZiAocG9pbnRlcklkID09IG1BY3RpdmVQb2ludGVySWQpIHsKKworICAgICAgICAgICAgaW50IGFjdGl2ZVZpZXdJbmRleCA9IChtU3dpcGVHZXN0dXJlVHlwZSA9PSBHRVNUVVJFX1NMSURFX0RPV04pID8gMCA6IDE7CisKKyAgICAgICAgICAgIFZpZXcgdiA9IGdldFZpZXdBdFJlbGF0aXZlSW5kZXgoYWN0aXZlVmlld0luZGV4KTsKKyAgICAgICAgICAgIGlmICh2ID09IG51bGwpIHJldHVybjsKKworICAgICAgICAgICAgLy8gT3VyIHByaW1hcnkgcG9pbnRlciBoYXMgZ29uZSB1cCAtLSBsZXQncyBzZWUgaWYgd2UgY2FuIGZpbmQKKyAgICAgICAgICAgIC8vIGFub3RoZXIgcG9pbnRlciBvbiB0aGUgdmlldy4gSWYgc28sIHRoZW4gd2Ugc2hvdWxkIHJlcGxhY2UKKyAgICAgICAgICAgIC8vIG91ciBwcmltYXJ5IHBvaW50ZXIgd2l0aCB0aGlzIG5ldyBwb2ludGVyIGFuZCBhZGp1c3QgdGhpbmdzCisgICAgICAgICAgICAvLyBzbyB0aGF0IHRoZSB2aWV3IGRvZXNuJ3QganVtcAorICAgICAgICAgICAgZm9yIChpbnQgaW5kZXggPSAwOyBpbmRleCA8IGV2LmdldFBvaW50ZXJDb3VudCgpOyBpbmRleCsrKSB7CisgICAgICAgICAgICAgICAgaWYgKGluZGV4ICE9IGFjdGl2ZVBvaW50ZXJJbmRleCkgeworCisgICAgICAgICAgICAgICAgICAgIGZsb2F0IHggPSBldi5nZXRYKGluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgeSA9IGV2LmdldFkoaW5kZXgpOworCisgICAgICAgICAgICAgICAgICAgIHRvdWNoUmVjdC5zZXQodi5nZXRMZWZ0KCksIHYuZ2V0VG9wKCksIHYuZ2V0UmlnaHQoKSwgdi5nZXRCb3R0b20oKSk7CisgICAgICAgICAgICAgICAgICAgIGlmICh0b3VjaFJlY3QuY29udGFpbnMoTWF0aC5yb3VuZCh4KSwgTWF0aC5yb3VuZCh5KSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IG9sZFggPSBldi5nZXRYKGFjdGl2ZVBvaW50ZXJJbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBvbGRZID0gZXYuZ2V0WShhY3RpdmVQb2ludGVySW5kZXgpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBhZGp1c3Qgb3VyIGZyYW1lIG9mIHJlZmVyZW5jZSB0byBhdm9pZCBhIGp1bXAKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Jbml0aWFsWSArPSAoeSAtIG9sZFkpOworICAgICAgICAgICAgICAgICAgICAgICAgbUluaXRpYWxYICs9ICh4IC0gb2xkWCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQb2ludGVySWQgPSBldi5nZXRQb2ludGVySWQoaW5kZXgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1WZWxvY2l0eVRyYWNrZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIuY2xlYXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9rLCB3ZSdyZSBnb29kLCB3ZSBmb3VuZCBhIG5ldyBwb2ludGVyIHdoaWNoIGlzIHRvdWNoaW5nIHRoZSBhY3RpdmUgdmlldworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gaWYgd2UgbWFkZSBpdCB0aGlzIGZhciwgaXQgbWVhbnMgd2UgZGlkbid0IGZpbmQgYSBzYXRpc2ZhY3RvcnkgbmV3IHBvaW50ZXIgOigsCisgICAgICAgICAgICAvLyBzbyBlbmQgdGhlIGdlc3R1cmUKKyAgICAgICAgICAgIGhhbmRsZVBvaW50ZXJVcChldik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgaGFuZGxlUG9pbnRlclVwKE1vdGlvbkV2ZW50IGV2KSB7CisgICAgICAgIGludCBwb2ludGVySW5kZXggPSBldi5maW5kUG9pbnRlckluZGV4KG1BY3RpdmVQb2ludGVySWQpOworICAgICAgICBmbG9hdCBuZXdZID0gZXYuZ2V0WShwb2ludGVySW5kZXgpOworICAgICAgICBpbnQgZGVsdGFZID0gKGludCkgKG5ld1kgLSBtSW5pdGlhbFkpOworCisgICAgICAgIGlmIChtVmVsb2NpdHlUcmFja2VyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIuY29tcHV0ZUN1cnJlbnRWZWxvY2l0eSgxMDAwLCBtTWF4aW11bVZlbG9jaXR5KTsKKyAgICAgICAgICAgIG1ZVmVsb2NpdHkgPSAoaW50KSBtVmVsb2NpdHlUcmFja2VyLmdldFlWZWxvY2l0eShtQWN0aXZlUG9pbnRlcklkKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtVmVsb2NpdHlUcmFja2VyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIucmVjeWNsZSgpOworICAgICAgICAgICAgbVZlbG9jaXR5VHJhY2tlciA9IG51bGw7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZGVsdGFZID4gbVN3aXBlVGhyZXNob2xkICYmIG1Td2lwZUdlc3R1cmVUeXBlID09IEdFU1RVUkVfU0xJREVfRE9XTgorICAgICAgICAgICAgICAgICYmIG1TdGFja1NsaWRlci5tTW9kZSA9PSBTdGFja1NsaWRlci5OT1JNQUxfTU9ERSkgeworICAgICAgICAgICAgLy8gU3dpcGUgdGhyZXNob2xkIGV4Y2VlZGVkLCBzd2lwZSBkb3duCisgICAgICAgICAgICBpZiAobVN0YWNrTW9kZSA9PSBJVEVNU19TTElERV9VUCkgeworICAgICAgICAgICAgICAgIHNob3dQcmV2aW91cygpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzaG93TmV4dCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUhpZ2hsaWdodC5icmluZ1RvRnJvbnQoKTsKKyAgICAgICAgfSBlbHNlIGlmIChkZWx0YVkgPCAtbVN3aXBlVGhyZXNob2xkICYmIG1Td2lwZUdlc3R1cmVUeXBlID09IEdFU1RVUkVfU0xJREVfVVAKKyAgICAgICAgICAgICAgICAmJiBtU3RhY2tTbGlkZXIubU1vZGUgPT0gU3RhY2tTbGlkZXIuTk9STUFMX01PREUpIHsKKyAgICAgICAgICAgIC8vIFN3aXBlIHRocmVzaG9sZCBleGNlZWRlZCwgc3dpcGUgdXAKKyAgICAgICAgICAgIGlmIChtU3RhY2tNb2RlID09IElURU1TX1NMSURFX1VQKSB7CisgICAgICAgICAgICAgICAgc2hvd05leHQoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2hvd1ByZXZpb3VzKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1IaWdobGlnaHQuYnJpbmdUb0Zyb250KCk7CisgICAgICAgIH0gZWxzZSBpZiAobVN3aXBlR2VzdHVyZVR5cGUgPT0gR0VTVFVSRV9TTElERV9VUCApIHsKKyAgICAgICAgICAgIC8vIERpZG4ndCBzd2lwZSB1cCBmYXIgZW5vdWdoLCBzbmFwIGJhY2sgZG93bgorICAgICAgICAgICAgaW50IGR1cmF0aW9uOworICAgICAgICAgICAgZmxvYXQgZmluYWxZUHJvZ3Jlc3MgPSAobVN0YWNrTW9kZSA9PSBJVEVNU19TTElERV9ET1dOKSA/IDEgOiAwOworICAgICAgICAgICAgaWYgKG1TdGFja01vZGUgPT0gSVRFTVNfU0xJREVfVVAgfHwgbVN0YWNrU2xpZGVyLm1Nb2RlICE9IFN0YWNrU2xpZGVyLk5PUk1BTF9NT0RFKSB7CisgICAgICAgICAgICAgICAgZHVyYXRpb24gPSBNYXRoLnJvdW5kKG1TdGFja1NsaWRlci5nZXREdXJhdGlvbkZvck5ldXRyYWxQb3NpdGlvbigpKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZHVyYXRpb24gPSBNYXRoLnJvdW5kKG1TdGFja1NsaWRlci5nZXREdXJhdGlvbkZvck9mZnNjcmVlblBvc2l0aW9uKCkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdGFja1NsaWRlciBhbmltYXRpb25TbGlkZXIgPSBuZXcgU3RhY2tTbGlkZXIobVN0YWNrU2xpZGVyKTsKKyAgICAgICAgICAgIFByb3BlcnR5VmFsdWVzSG9sZGVyIHNuYXBCYWNrWSA9IFByb3BlcnR5VmFsdWVzSG9sZGVyLm9mRmxvYXQoIllQcm9ncmVzcyIsIGZpbmFsWVByb2dyZXNzKTsKKyAgICAgICAgICAgIFByb3BlcnR5VmFsdWVzSG9sZGVyIHNuYXBCYWNrWCA9IFByb3BlcnR5VmFsdWVzSG9sZGVyLm9mRmxvYXQoIlhQcm9ncmVzcyIsIDAuMGYpOworICAgICAgICAgICAgT2JqZWN0QW5pbWF0b3IgcGEgPSBPYmplY3RBbmltYXRvci5vZlByb3BlcnR5VmFsdWVzSG9sZGVyKGFuaW1hdGlvblNsaWRlciwKKyAgICAgICAgICAgICAgICAgICAgc25hcEJhY2tYLCBzbmFwQmFja1kpOworICAgICAgICAgICAgcGEuc2V0RHVyYXRpb24oZHVyYXRpb24pOworICAgICAgICAgICAgcGEuc2V0SW50ZXJwb2xhdG9yKG5ldyBMaW5lYXJJbnRlcnBvbGF0b3IoKSk7CisgICAgICAgICAgICBwYS5zdGFydCgpOworICAgICAgICB9IGVsc2UgaWYgKG1Td2lwZUdlc3R1cmVUeXBlID09IEdFU1RVUkVfU0xJREVfRE9XTikgeworICAgICAgICAgICAgLy8gRGlkbid0IHN3aXBlIGRvd24gZmFyIGVub3VnaCwgc25hcCBiYWNrIHVwCisgICAgICAgICAgICBmbG9hdCBmaW5hbFlQcm9ncmVzcyA9IChtU3RhY2tNb2RlID09IElURU1TX1NMSURFX0RPV04pID8gMCA6IDE7CisgICAgICAgICAgICBpbnQgZHVyYXRpb247CisgICAgICAgICAgICBpZiAobVN0YWNrTW9kZSA9PSBJVEVNU19TTElERV9ET1dOIHx8IG1TdGFja1NsaWRlci5tTW9kZSAhPSBTdGFja1NsaWRlci5OT1JNQUxfTU9ERSkgeworICAgICAgICAgICAgICAgIGR1cmF0aW9uID0gTWF0aC5yb3VuZChtU3RhY2tTbGlkZXIuZ2V0RHVyYXRpb25Gb3JOZXV0cmFsUG9zaXRpb24oKSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGR1cmF0aW9uID0gTWF0aC5yb3VuZChtU3RhY2tTbGlkZXIuZ2V0RHVyYXRpb25Gb3JPZmZzY3JlZW5Qb3NpdGlvbigpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3RhY2tTbGlkZXIgYW5pbWF0aW9uU2xpZGVyID0gbmV3IFN0YWNrU2xpZGVyKG1TdGFja1NsaWRlcik7CisgICAgICAgICAgICBQcm9wZXJ0eVZhbHVlc0hvbGRlciBzbmFwQmFja1kgPQorICAgICAgICAgICAgICAgICAgICBQcm9wZXJ0eVZhbHVlc0hvbGRlci5vZkZsb2F0KCJZUHJvZ3Jlc3MiLGZpbmFsWVByb2dyZXNzKTsKKyAgICAgICAgICAgIFByb3BlcnR5VmFsdWVzSG9sZGVyIHNuYXBCYWNrWCA9IFByb3BlcnR5VmFsdWVzSG9sZGVyLm9mRmxvYXQoIlhQcm9ncmVzcyIsIDAuMGYpOworICAgICAgICAgICAgT2JqZWN0QW5pbWF0b3IgcGEgPSBPYmplY3RBbmltYXRvci5vZlByb3BlcnR5VmFsdWVzSG9sZGVyKGFuaW1hdGlvblNsaWRlciwKKyAgICAgICAgICAgICAgICAgICAgc25hcEJhY2tYLCBzbmFwQmFja1kpOworICAgICAgICAgICAgcGEuc2V0RHVyYXRpb24oZHVyYXRpb24pOworICAgICAgICAgICAgcGEuc3RhcnQoKTsKKyAgICAgICAgfQorCisgICAgICAgIG1BY3RpdmVQb2ludGVySWQgPSBJTlZBTElEX1BPSU5URVI7CisgICAgICAgIG1Td2lwZUdlc3R1cmVUeXBlID0gR0VTVFVSRV9OT05FOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgU3RhY2tTbGlkZXIgeworICAgICAgICBWaWV3IG1WaWV3OworICAgICAgICBmbG9hdCBtWVByb2dyZXNzOworICAgICAgICBmbG9hdCBtWFByb2dyZXNzOworCisgICAgICAgIHN0YXRpYyBmaW5hbCBpbnQgTk9STUFMX01PREUgPSAwOworICAgICAgICBzdGF0aWMgZmluYWwgaW50IEJFR0lOTklOR19PRl9TVEFDS19NT0RFID0gMTsKKyAgICAgICAgc3RhdGljIGZpbmFsIGludCBFTkRfT0ZfU1RBQ0tfTU9ERSA9IDI7CisKKyAgICAgICAgaW50IG1Nb2RlID0gTk9STUFMX01PREU7CisKKyAgICAgICAgcHVibGljIFN0YWNrU2xpZGVyKCkgeworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFN0YWNrU2xpZGVyKFN0YWNrU2xpZGVyIGNvcHkpIHsKKyAgICAgICAgICAgIG1WaWV3ID0gY29weS5tVmlldzsKKyAgICAgICAgICAgIG1ZUHJvZ3Jlc3MgPSBjb3B5Lm1ZUHJvZ3Jlc3M7CisgICAgICAgICAgICBtWFByb2dyZXNzID0gY29weS5tWFByb2dyZXNzOworICAgICAgICAgICAgbU1vZGUgPSBjb3B5Lm1Nb2RlOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBmbG9hdCBjdWJpYyhmbG9hdCByKSB7CisgICAgICAgICAgICByZXR1cm4gKGZsb2F0KSAoTWF0aC5wb3coMiAqIHIgLSAxLCAzKSArIDEpIC8gMi4wZjsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgZmxvYXQgaGlnaGxpZ2h0QWxwaGFJbnRlcnBvbGF0b3IoZmxvYXQgcikgeworICAgICAgICAgICAgZmxvYXQgcGl2b3QgPSAwLjRmOworICAgICAgICAgICAgaWYgKHIgPCBwaXZvdCkgeworICAgICAgICAgICAgICAgIHJldHVybiAwLjg1ZiAqIGN1YmljKHIgLyBwaXZvdCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiAwLjg1ZiAqIGN1YmljKDEgLSAociAtIHBpdm90KSAvICgxIC0gcGl2b3QpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgZmxvYXQgdmlld0FscGhhSW50ZXJwb2xhdG9yKGZsb2F0IHIpIHsKKyAgICAgICAgICAgIGZsb2F0IHBpdm90ID0gMC4zZjsKKyAgICAgICAgICAgIGlmIChyID4gcGl2b3QpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gKHIgLSBwaXZvdCkgLyAoMSAtIHBpdm90KTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIGZsb2F0IHJvdGF0aW9uSW50ZXJwb2xhdG9yKGZsb2F0IHIpIHsKKyAgICAgICAgICAgIGZsb2F0IHBpdm90ID0gMC4yZjsKKyAgICAgICAgICAgIGlmIChyIDwgcGl2b3QpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIChyIC0gcGl2b3QpIC8gKDEgLSBwaXZvdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHNldFZpZXcoVmlldyB2KSB7CisgICAgICAgICAgICBtVmlldyA9IHY7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRZUHJvZ3Jlc3MoZmxvYXQgcikgeworICAgICAgICAgICAgLy8gZW5mb3JjZSByIGJldHdlZW4gMCBhbmQgMQorICAgICAgICAgICAgciA9IE1hdGgubWluKDEuMGYsIHIpOworICAgICAgICAgICAgciA9IE1hdGgubWF4KDAsIHIpOworCisgICAgICAgICAgICBtWVByb2dyZXNzID0gcjsKKyAgICAgICAgICAgIGZpbmFsIExheW91dFBhcmFtcyB2aWV3THAgPSAoTGF5b3V0UGFyYW1zKSBtVmlldy5nZXRMYXlvdXRQYXJhbXMoKTsKKyAgICAgICAgICAgIGZpbmFsIExheW91dFBhcmFtcyBoaWdobGlnaHRMcCA9IChMYXlvdXRQYXJhbXMpIG1IaWdobGlnaHQuZ2V0TGF5b3V0UGFyYW1zKCk7CisKKyAgICAgICAgICAgIGludCBzdGFja0RpcmVjdGlvbiA9IChtU3RhY2tNb2RlID09IElURU1TX1NMSURFX1VQKSA/IDEgOiAtMTsKKworICAgICAgICAgICAgc3dpdGNoIChtTW9kZSkgeworICAgICAgICAgICAgICAgIGNhc2UgTk9STUFMX01PREU6CisgICAgICAgICAgICAgICAgICAgIHZpZXdMcC5zZXRWZXJ0aWNhbE9mZnNldChNYXRoLnJvdW5kKC1yICogc3RhY2tEaXJlY3Rpb24gKiBtU2xpZGVBbW91bnQpKTsKKyAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0THAuc2V0VmVydGljYWxPZmZzZXQoTWF0aC5yb3VuZCgtciAqIHN0YWNrRGlyZWN0aW9uICogbVNsaWRlQW1vdW50KSk7CisgICAgICAgICAgICAgICAgICAgIG1IaWdobGlnaHQuc2V0QWxwaGEoaGlnaGxpZ2h0QWxwaGFJbnRlcnBvbGF0b3IocikpOworCisgICAgICAgICAgICAgICAgICAgIGZsb2F0IGFscGhhID0gdmlld0FscGhhSW50ZXJwb2xhdG9yKDEgLSByKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBXZSBtYWtlIHN1cmUgdGhhdCB2aWV3cyB3aGljaCBjYW4ndCBiZSBzZWVuIChoYXZlIDAgYWxwaGEpIGFyZSBhbHNvIGludmlzaWJsZQorICAgICAgICAgICAgICAgICAgICAvLyBzbyB0aGF0IHRoZXkgZG9uJ3QgaW50ZXJmZXJlIHdpdGggY2xpY2sgZXZlbnRzLgorICAgICAgICAgICAgICAgICAgICBpZiAobVZpZXcuZ2V0QWxwaGEoKSA9PSAwICYmIGFscGhhICE9IDAgJiYgbVZpZXcuZ2V0VmlzaWJpbGl0eSgpICE9IFZJU0lCTEUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1WaWV3LnNldFZpc2liaWxpdHkoVklTSUJMRSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYWxwaGEgPT0gMCAmJiBtVmlldy5nZXRBbHBoYSgpICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBtVmlldy5nZXRWaXNpYmlsaXR5KCkgPT0gVklTSUJMRSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVZpZXcuc2V0VmlzaWJpbGl0eShJTlZJU0lCTEUpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgbVZpZXcuc2V0QWxwaGEoYWxwaGEpOworICAgICAgICAgICAgICAgICAgICBtVmlldy5zZXRSb3RhdGlvblgoc3RhY2tEaXJlY3Rpb24gKiA5MC4wZiAqIHJvdGF0aW9uSW50ZXJwb2xhdG9yKHIpKTsKKyAgICAgICAgICAgICAgICAgICAgbUhpZ2hsaWdodC5zZXRSb3RhdGlvblgoc3RhY2tEaXJlY3Rpb24gKiA5MC4wZiAqIHJvdGF0aW9uSW50ZXJwb2xhdG9yKHIpKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBFTkRfT0ZfU1RBQ0tfTU9ERToKKyAgICAgICAgICAgICAgICAgICAgciA9IHIgKiAwLjJmOworICAgICAgICAgICAgICAgICAgICB2aWV3THAuc2V0VmVydGljYWxPZmZzZXQoTWF0aC5yb3VuZCgtc3RhY2tEaXJlY3Rpb24gKiByICogbVNsaWRlQW1vdW50KSk7CisgICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodExwLnNldFZlcnRpY2FsT2Zmc2V0KE1hdGgucm91bmQoLXN0YWNrRGlyZWN0aW9uICogciAqIG1TbGlkZUFtb3VudCkpOworICAgICAgICAgICAgICAgICAgICBtSGlnaGxpZ2h0LnNldEFscGhhKGhpZ2hsaWdodEFscGhhSW50ZXJwb2xhdG9yKHIpKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBCRUdJTk5JTkdfT0ZfU1RBQ0tfTU9ERToKKyAgICAgICAgICAgICAgICAgICAgciA9ICgxLXIpICogMC4yZjsKKyAgICAgICAgICAgICAgICAgICAgdmlld0xwLnNldFZlcnRpY2FsT2Zmc2V0KE1hdGgucm91bmQoc3RhY2tEaXJlY3Rpb24gKiByICogbVNsaWRlQW1vdW50KSk7CisgICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodExwLnNldFZlcnRpY2FsT2Zmc2V0KE1hdGgucm91bmQoc3RhY2tEaXJlY3Rpb24gKiByICogbVNsaWRlQW1vdW50KSk7CisgICAgICAgICAgICAgICAgICAgIG1IaWdobGlnaHQuc2V0QWxwaGEoaGlnaGxpZ2h0QWxwaGFJbnRlcnBvbGF0b3IocikpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFhQcm9ncmVzcyhmbG9hdCByKSB7CisgICAgICAgICAgICAvLyBlbmZvcmNlIHIgYmV0d2VlbiAwIGFuZCAxCisgICAgICAgICAgICByID0gTWF0aC5taW4oMi4wZiwgcik7CisgICAgICAgICAgICByID0gTWF0aC5tYXgoLTIuMGYsIHIpOworCisgICAgICAgICAgICBtWFByb2dyZXNzID0gcjsKKworICAgICAgICAgICAgZmluYWwgTGF5b3V0UGFyYW1zIHZpZXdMcCA9IChMYXlvdXRQYXJhbXMpIG1WaWV3LmdldExheW91dFBhcmFtcygpOworICAgICAgICAgICAgZmluYWwgTGF5b3V0UGFyYW1zIGhpZ2hsaWdodExwID0gKExheW91dFBhcmFtcykgbUhpZ2hsaWdodC5nZXRMYXlvdXRQYXJhbXMoKTsKKworICAgICAgICAgICAgciAqPSAwLjJmOworICAgICAgICAgICAgdmlld0xwLnNldEhvcml6b250YWxPZmZzZXQoTWF0aC5yb3VuZChyICogbVNsaWRlQW1vdW50KSk7CisgICAgICAgICAgICBoaWdobGlnaHRMcC5zZXRIb3Jpem9udGFsT2Zmc2V0KE1hdGgucm91bmQociAqIG1TbGlkZUFtb3VudCkpOworICAgICAgICB9CisKKyAgICAgICAgdm9pZCBzZXRNb2RlKGludCBtb2RlKSB7CisgICAgICAgICAgICBtTW9kZSA9IG1vZGU7CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCBnZXREdXJhdGlvbkZvck5ldXRyYWxQb3NpdGlvbigpIHsKKyAgICAgICAgICAgIHJldHVybiBnZXREdXJhdGlvbihmYWxzZSwgMCk7CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCBnZXREdXJhdGlvbkZvck9mZnNjcmVlblBvc2l0aW9uKCkgeworICAgICAgICAgICAgcmV0dXJuIGdldER1cmF0aW9uKHRydWUsIDApOworICAgICAgICB9CisKKyAgICAgICAgZmxvYXQgZ2V0RHVyYXRpb25Gb3JOZXV0cmFsUG9zaXRpb24oZmxvYXQgdmVsb2NpdHkpIHsKKyAgICAgICAgICAgIHJldHVybiBnZXREdXJhdGlvbihmYWxzZSwgdmVsb2NpdHkpOworICAgICAgICB9CisKKyAgICAgICAgZmxvYXQgZ2V0RHVyYXRpb25Gb3JPZmZzY3JlZW5Qb3NpdGlvbihmbG9hdCB2ZWxvY2l0eSkgeworICAgICAgICAgICAgcmV0dXJuIGdldER1cmF0aW9uKHRydWUsIHZlbG9jaXR5KTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgZmxvYXQgZ2V0RHVyYXRpb24oYm9vbGVhbiBpbnZlcnQsIGZsb2F0IHZlbG9jaXR5KSB7CisgICAgICAgICAgICBpZiAobVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZpbmFsIExheW91dFBhcmFtcyB2aWV3THAgPSAoTGF5b3V0UGFyYW1zKSBtVmlldy5nZXRMYXlvdXRQYXJhbXMoKTsKKworICAgICAgICAgICAgICAgIGZsb2F0IGQgPSAoZmxvYXQpIE1hdGguc3FydChNYXRoLnBvdyh2aWV3THAuaG9yaXpvbnRhbE9mZnNldCwgMikgKworICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5wb3codmlld0xwLnZlcnRpY2FsT2Zmc2V0LCAyKSk7CisgICAgICAgICAgICAgICAgZmxvYXQgbWF4ZCA9IChmbG9hdCkgTWF0aC5zcXJ0KE1hdGgucG93KG1TbGlkZUFtb3VudCwgMikgKworICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5wb3coMC40ZiAqIG1TbGlkZUFtb3VudCwgMikpOworCisgICAgICAgICAgICAgICAgaWYgKHZlbG9jaXR5ID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChpbnZlcnQgPyAoMSAtIGQgLyBtYXhkKSA6IGQgLyBtYXhkKSAqIERFRkFVTFRfQU5JTUFUSU9OX0RVUkFUSU9OOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGZsb2F0IGR1cmF0aW9uID0gaW52ZXJ0ID8gZCAvIE1hdGguYWJzKHZlbG9jaXR5KSA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1heGQgLSBkKSAvIE1hdGguYWJzKHZlbG9jaXR5KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGR1cmF0aW9uIDwgTUlOSU1VTV9BTklNQVRJT05fRFVSQVRJT04gfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdXJhdGlvbiA+IERFRkFVTFRfQU5JTUFUSU9OX0RVUkFUSU9OKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0RHVyYXRpb24oaW52ZXJ0LCAwKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkdXJhdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisKKyAgICAgICAgLy8gVXNlZCBmb3IgYW5pbWF0aW9ucworICAgICAgICBAU3VwcHJlc3NXYXJuaW5ncyh7IlVudXNlZERlY2xhcmF0aW9uIn0pCisgICAgICAgIHB1YmxpYyBmbG9hdCBnZXRZUHJvZ3Jlc3MoKSB7CisgICAgICAgICAgICByZXR1cm4gbVlQcm9ncmVzczsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFVzZWQgZm9yIGFuaW1hdGlvbnMKKyAgICAgICAgQFN1cHByZXNzV2FybmluZ3MoeyJVbnVzZWREZWNsYXJhdGlvbiJ9KQorICAgICAgICBwdWJsaWMgZmxvYXQgZ2V0WFByb2dyZXNzKCkgeworICAgICAgICAgICAgcmV0dXJuIG1YUHJvZ3Jlc3M7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvblJlbW90ZUFkYXB0ZXJDb25uZWN0ZWQoKSB7CisgICAgICAgIHN1cGVyLm9uUmVtb3RlQWRhcHRlckNvbm5lY3RlZCgpOworICAgICAgICAvLyBPbiBmaXJzdCBydW4sIHdlIHdhbnQgdG8gc2V0IHRoZSBzdGFjayB0byB0aGUgZW5kLgorICAgICAgICBpZiAobVdoaWNoQ2hpbGQgPT0gLTEpIHsKKyAgICAgICAgICAgIG1XaGljaENoaWxkID0gMDsKKyAgICAgICAgfQorICAgICAgICBzZXREaXNwbGF5ZWRDaGlsZChtV2hpY2hDaGlsZCk7CisgICAgfQorCisgICAgTGF5b3V0UGFyYW1zIGNyZWF0ZU9yUmV1c2VMYXlvdXRQYXJhbXMoVmlldyB2KSB7CisgICAgICAgIGZpbmFsIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMgY3VycmVudExwID0gdi5nZXRMYXlvdXRQYXJhbXMoKTsKKyAgICAgICAgaWYgKGN1cnJlbnRMcCBpbnN0YW5jZW9mIExheW91dFBhcmFtcykgeworICAgICAgICAgICAgTGF5b3V0UGFyYW1zIGxwID0gKExheW91dFBhcmFtcykgY3VycmVudExwOworICAgICAgICAgICAgbHAuc2V0SG9yaXpvbnRhbE9mZnNldCgwKTsKKyAgICAgICAgICAgIGxwLnNldFZlcnRpY2FsT2Zmc2V0KDApOworICAgICAgICAgICAgbHAud2lkdGggPSAwOworICAgICAgICAgICAgbHAud2lkdGggPSAwOworICAgICAgICAgICAgcmV0dXJuIGxwOworICAgICAgICB9CisgICAgICAgIHJldHVybiBuZXcgTGF5b3V0UGFyYW1zKHYpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uTGF5b3V0KGJvb2xlYW4gY2hhbmdlZCwgaW50IGxlZnQsIGludCB0b3AsIGludCByaWdodCwgaW50IGJvdHRvbSkgeworICAgICAgICBib29sZWFuIGRhdGFDaGFuZ2VkID0gbURhdGFDaGFuZ2VkOworICAgICAgICBpZiAoZGF0YUNoYW5nZWQpIHsKKyAgICAgICAgICAgIGhhbmRsZURhdGFDaGFuZ2VkKCk7CisKKyAgICAgICAgICAgIC8vIGlmIHRoZSBkYXRhIGNoYW5nZXMsIG1XaGljaENoaWxkIG1pZ2h0IGJlIG91dCBvZiB0aGUgYm91bmRzIG9mIHRoZSBhZGFwdGVyCisgICAgICAgICAgICAvLyBpbiB0aGlzIGNhc2UsIHdlIHJlc2V0IG1XaGljaENoaWxkIHRvIHRoZSBiZWdpbm5pbmcKKyAgICAgICAgICAgIGlmIChtV2hpY2hDaGlsZCA+PSBtQWRhcHRlci5nZXRDb3VudCgpKQorICAgICAgICAgICAgICAgIG1XaGljaENoaWxkID0gMDsKKworICAgICAgICAgICAgc2hvd09ubHkobVdoaWNoQ2hpbGQsIHRydWUsIHRydWUpOworICAgICAgICAgICAgcmVmcmVzaENoaWxkcmVuKCk7CisgICAgICAgIH0KKworICAgICAgICBmaW5hbCBpbnQgY2hpbGRDb3VudCA9IGdldENoaWxkQ291bnQoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjaGlsZENvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcgY2hpbGQgPSBnZXRDaGlsZEF0KGkpOworCisgICAgICAgICAgICBpbnQgY2hpbGRSaWdodCA9IG1QYWRkaW5nTGVmdCArIGNoaWxkLmdldE1lYXN1cmVkV2lkdGgoKTsKKyAgICAgICAgICAgIGludCBjaGlsZEJvdHRvbSA9IG1QYWRkaW5nVG9wICsgY2hpbGQuZ2V0TWVhc3VyZWRIZWlnaHQoKTsKKyAgICAgICAgICAgIExheW91dFBhcmFtcyBscCA9IChMYXlvdXRQYXJhbXMpIGNoaWxkLmdldExheW91dFBhcmFtcygpOworCisgICAgICAgICAgICBjaGlsZC5sYXlvdXQobVBhZGRpbmdMZWZ0ICsgbHAuaG9yaXpvbnRhbE9mZnNldCwgbVBhZGRpbmdUb3AgKyBscC52ZXJ0aWNhbE9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgY2hpbGRSaWdodCArIGxwLmhvcml6b250YWxPZmZzZXQsIGNoaWxkQm90dG9tICsgbHAudmVydGljYWxPZmZzZXQpOworCisgICAgICAgIH0KKworICAgICAgICBtRGF0YUNoYW5nZWQgPSBmYWxzZTsKKyAgICAgICAgb25MYXlvdXQoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgbWVhc3VyZUNoaWxkcmVuKCkgeworICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgIGZpbmFsIGludCBjaGlsZFdpZHRoID0gbU1lYXN1cmVkV2lkdGggLSBtUGFkZGluZ0xlZnQgLSBtUGFkZGluZ1JpZ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SW52YWxpZGF0ZVJlY3QgPSBuZXcgUmVjdCgpOworCisgICAgICAgIExheW91dFBhcmFtcyhWaWV3IHZpZXcpIHsKKyAgICAgICAgICAgIHN1cGVyKDAsIDApOworICAgICAgICAgICAgd2lkdGggPSAwOworICAgICAgICAgICAgaGVpZ2h0ID0gMDsKKyAgICAgICAgICAgIGhvcml6b250YWxPZmZzZXQgPSAwOworICAgICAgICAgICAgdmVydGljYWxPZmZzZXQgPSAwOworICAgICAgICAgICAgbVZpZXcgPSB2aWV3OworICAgICAgICB9CisKKyAgICAgICAgTGF5b3V0UGFyYW1zKENvbnRleHQgYywgQXR0cmlidXRlU2V0IGF0dHJzKSB7CisgICAgICAgICAgICBzdXBlcihjLCBhdHRycyk7CisgICAgICAgICAgICBob3Jpem9udGFsT2Zmc2V0ID0gMDsKKyAgICAgICAgICAgIHZlcnRpY2FsT2Zmc2V0ID0gMDsKKyAgICAgICAgICAgIHdpZHRoID0gMDsKKyAgICAgICAgICAgIGhlaWdodCA9IDA7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIGludmFsaWRhdGVHbG9iYWxSZWdpb24oVmlldyB2LCBSZWN0IHIpIHsKKyAgICAgICAgICAgIC8vIFdlIG5lZWQgdG8gbWFrZSBhIG5ldyByZWN0IGhlcmUsIHNvIGFzIG5vdCB0byBtb2RpZnkgdGhlIG9uZSBwYXNzZWQKKyAgICAgICAgICAgIGdsb2JhbEludmFsaWRhdGVSZWN0LnNldChyKTsKKyAgICAgICAgICAgIFZpZXcgcCA9IHY7CisgICAgICAgICAgICBpZiAoISh2LmdldFBhcmVudCgpICE9IG51bGwgJiYgdi5nZXRQYXJlbnQoKSBpbnN0YW5jZW9mIFZpZXcpKSByZXR1cm47CisKKyAgICAgICAgICAgIGJvb2xlYW4gZmlyc3RQYXNzID0gdHJ1ZTsKKyAgICAgICAgICAgIHBhcmVudFJlY3Quc2V0KDAsIDAsIDAsIDApOworICAgICAgICAgICAgaW50IGRlcHRoID0gMDsKKyAgICAgICAgICAgIHdoaWxlIChwLmdldFBhcmVudCgpICE9IG51bGwgJiYgcC5nZXRQYXJlbnQoKSBpbnN0YW5jZW9mIFZpZXcKKyAgICAgICAgICAgICAgICAgICAgJiYgIXBhcmVudFJlY3QuY29udGFpbnMoZ2xvYmFsSW52YWxpZGF0ZVJlY3QpKSB7CisgICAgICAgICAgICAgICAgaWYgKCFmaXJzdFBhc3MpIHsKKyAgICAgICAgICAgICAgICAgICAgZ2xvYmFsSW52YWxpZGF0ZVJlY3Qub2Zmc2V0KHAuZ2V0TGVmdCgpIC0gcC5nZXRTY3JvbGxYKCksIHAuZ2V0VG9wKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAuZ2V0U2Nyb2xsWSgpKTsKKyAgICAgICAgICAgICAgICAgICAgZGVwdGgrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZmlyc3RQYXNzID0gZmFsc2U7CisgICAgICAgICAgICAgICAgcCA9IChWaWV3KSBwLmdldFBhcmVudCgpOworICAgICAgICAgICAgICAgIHBhcmVudFJlY3Quc2V0KHAuZ2V0U2Nyb2xsWCgpLCBwLmdldFNjcm9sbFkoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwLmdldFdpZHRoKCkgKyBwLmdldFNjcm9sbFgoKSwgcC5nZXRIZWlnaHQoKSArIHAuZ2V0U2Nyb2xsWSgpKTsKKworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwLmludmFsaWRhdGUoZ2xvYmFsSW52YWxpZGF0ZVJlY3QubGVmdCwgZ2xvYmFsSW52YWxpZGF0ZVJlY3QudG9wLAorICAgICAgICAgICAgICAgICAgICBnbG9iYWxJbnZhbGlkYXRlUmVjdC5yaWdodCwgZ2xvYmFsSW52YWxpZGF0ZVJlY3QuYm90dG9tKTsKKyAgICAgICAgfQorCisgICAgICAgIFJlY3QgZ2V0SW52YWxpZGF0ZVJlY3QoKSB7CisgICAgICAgICAgICByZXR1cm4gaW52YWxpZGF0ZVJlY3Q7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHJlc2V0SW52YWxpZGF0ZVJlY3QoKSB7CisgICAgICAgICAgIGludmFsaWRhdGVSZWN0LnNldCgwLCAwLCAwLCAwKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFRoaXMgaXMgcHVibGljIHNvIHRoYXQgT2JqZWN0QW5pbWF0b3IgY2FuIGFjY2VzcyBpdAorICAgICAgICBwdWJsaWMgdm9pZCBzZXRWZXJ0aWNhbE9mZnNldChpbnQgbmV3VmVydGljYWxPZmZzZXQpIHsKKyAgICAgICAgICAgIGludCBvZmZzZXREZWx0YSA9IG5ld1ZlcnRpY2FsT2Zmc2V0IC0gdmVydGljYWxPZmZzZXQ7CisgICAgICAgICAgICB2ZXJ0aWNhbE9mZnNldCA9IG5ld1ZlcnRpY2FsT2Zmc2V0OworCisgICAgICAgICAgICBpZiAobVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1WaWV3LnJlcXVlc3RMYXlvdXQoKTsKKyAgICAgICAgICAgICAgICBpbnQgdG9wID0gTWF0aC5taW4obVZpZXcuZ2V0VG9wKCkgKyBvZmZzZXREZWx0YSwgbVZpZXcuZ2V0VG9wKCkpOworICAgICAgICAgICAgICAgIGludCBib3R0b20gPSBNYXRoLm1heChtVmlldy5nZXRCb3R0b20oKSArIG9mZnNldERlbHRhLCBtVmlldy5nZXRCb3R0b20oKSk7CisKKyAgICAgICAgICAgICAgICBpbnZhbGlkYXRlUmVjdGYuc2V0KG1WaWV3LmdldExlZnQoKSwgdG9wLCBtVmlldy5nZXRSaWdodCgpLCBib3R0b20pOworCisgICAgICAgICAgICAgICAgZmxvYXQgeG9mZnNldCA9IC1pbnZhbGlkYXRlUmVjdGYubGVmdDsKKyAgICAgICAgICAgICAgICBmbG9hdCB5b2Zmc2V0ID0gLWludmFsaWRhdGVSZWN0Zi50b3A7CisgICAgICAgICAgICAgICAgaW52YWxpZGF0ZVJlY3RmLm9mZnNldCh4b2Zmc2V0LCB5b2Zmc2V0KTsKKyAgICAgICAgICAgICAgICBtVmlldy5nZXRNYXRyaXgoKS5tYXBSZWN0KGludmFsaWRhdGVSZWN0Zik7CisgICAgICAgICAgICAgICAgaW52YWxpZGF0ZVJlY3RmLm9mZnNldCgteG9mZnNldCwgLXlvZmZzZXQpOworICAgICAgICAgICAgICAgIGludmFsaWRhdGVSZWN0LnVuaW9uKChpbnQpIE1hdGguZmxvb3IoaW52YWxpZGF0ZVJlY3RmLmxlZnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgTWF0aC5mbG9vcihpbnZhbGlkYXRlUmVjdGYudG9wKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIE1hdGguY2VpbChpbnZhbGlkYXRlUmVjdGYucmlnaHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgTWF0aC5jZWlsKGludmFsaWRhdGVSZWN0Zi5ib3R0b20pKTsKKworICAgICAgICAgICAgICAgIGludmFsaWRhdGVHbG9iYWxSZWdpb24obVZpZXcsIGludmFsaWRhdGVSZWN0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldEhvcml6b250YWxPZmZzZXQoaW50IG5ld0hvcml6b250YWxPZmZzZXQpIHsKKyAgICAgICAgICAgIGludCBvZmZzZXREZWx0YSA9IG5ld0hvcml6b250YWxPZmZzZXQgLSBob3Jpem9udGFsT2Zmc2V0OworICAgICAgICAgICAgaG9yaXpvbnRhbE9mZnNldCA9IG5ld0hvcml6b250YWxPZmZzZXQ7CisKKyAgICAgICAgICAgIGlmIChtVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVZpZXcucmVxdWVzdExheW91dCgpOworICAgICAgICAgICAgICAgIGludCBsZWZ0ID0gTWF0aC5taW4obVZpZXcuZ2V0TGVmdCgpICsgb2Zmc2V0RGVsdGEsIG1WaWV3LmdldExlZnQoKSk7CisgICAgICAgICAgICAgICAgaW50IHJpZ2h0ID0gTWF0aC5tYXgobVZpZXcuZ2V0UmlnaHQoKSArIG9mZnNldERlbHRhLCBtVmlldy5nZXRSaWdodCgpKTsKKyAgICAgICAgICAgICAgICBpbnZhbGlkYXRlUmVjdGYuc2V0KGxlZnQsICBtVmlldy5nZXRUb3AoKSwgcmlnaHQsIG1WaWV3LmdldEJvdHRvbSgpKTsKKworICAgICAgICAgICAgICAgIGZsb2F0IHhvZmZzZXQgPSAtaW52YWxpZGF0ZVJlY3RmLmxlZnQ7CisgICAgICAgICAgICAgICAgZmxvYXQgeW9mZnNldCA9IC1pbnZhbGlkYXRlUmVjdGYudG9wOworICAgICAgICAgICAgICAgIGludmFsaWRhdGVSZWN0Zi5vZmZzZXQoeG9mZnNldCwgeW9mZnNldCk7CisgICAgICAgICAgICAgICAgbVZpZXcuZ2V0TWF0cml4KCkubWFwUmVjdChpbnZhbGlkYXRlUmVjdGYpOworICAgICAgICAgICAgICAgIGludmFsaWRhdGVSZWN0Zi5vZmZzZXQoLXhvZmZzZXQsIC15b2Zmc2V0KTsKKworICAgICAgICAgICAgICAgIGludmFsaWRhdGVSZWN0LnVuaW9uKChpbnQpIE1hdGguZmxvb3IoaW52YWxpZGF0ZVJlY3RmLmxlZnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgTWF0aC5mbG9vcihpbnZhbGlkYXRlUmVjdGYudG9wKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIE1hdGguY2VpbChpbnZhbGlkYXRlUmVjdGYucmlnaHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgTWF0aC5jZWlsKGludmFsaWRhdGVSZWN0Zi5ib3R0b20pKTsKKworICAgICAgICAgICAgICAgIGludmFsaWRhdGVHbG9iYWxSZWdpb24obVZpZXcsIGludmFsaWRhdGVSZWN0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIE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5CbHVyLk5PUk1BTCkpOworICAgICAgICB9CisKKyAgICAgICAgQml0bWFwIGNyZWF0ZU91dGxpbmUoVmlldyB2KSB7CisgICAgICAgICAgICBpZiAodi5nZXRNZWFzdXJlZFdpZHRoKCkgPT0gMCB8fCB2LmdldE1lYXN1cmVkSGVpZ2h0KCkgPT0gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBCaXRtYXAgYml0bWFwID0gQml0bWFwLmNyZWF0ZUJpdG1hcCh2LmdldE1lYXN1cmVkV2lkdGgoKSwgdi5nZXRNZWFzdXJlZEhlaWdodCgpLAorICAgICAgICAgICAgICAgICAgICBCaXRtYXAuQ29uZmlnLkFSR0JfODg4OCk7CisgICAgICAgICAgICBDYW52YXMgY2FudmFzID0gbmV3IENhbnZhcyhiaXRtYXApOworCisgICAgICAgICAgICBmbG9hdCByb3RhdGlvblggPSB2LmdldFJvdGF0aW9uWCgpOworICAgICAgICAgICAgZmxvYXQgcm90YXRpb24gPSB2LmdldFJvdGF0aW9uKCk7CisgICAgICAgICAgICBmbG9hdCB0cmFuc2xhdGlvblkgPSB2LmdldFRyYW5zbGF0aW9uWSgpOworICAgICAgICAgICAgdi5zZXRSb3RhdGlvblgoMCk7CisgICAgICAgICAgICB2LnNldFJvdGF0aW9uKDApOworICAgICAgICAgICAgdi5zZXRUcmFuc2xhdGlvblkoMCk7CisgICAgICAgICAgICB2LmRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIHYuc2V0Um90YXRpb25YKHJvdGF0aW9uWCk7CisgICAgICAgICAgICB2LnNldFJvdGF0aW9uKHJvdGF0aW9uKTsKKyAgICAgICAgICAgIHYuc2V0VHJhbnNsYXRpb25ZKHRyYW5zbGF0aW9uWSk7CisKKyAgICAgICAgICAgIGRyYXdPdXRsaW5lKGNhbnZhcywgYml0bWFwKTsKKyAgICAgICAgICAgIHJldHVybiBiaXRtYXA7CisgICAgICAgIH0KKworICAgICAgIC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db250ZXh0LCBhY3Rpdml0eUNvbnRleHQpOworCisgICAgICAgIG1PdXRzaWRlRHJhd2FibGVzQ2FjaGUgPSBvdXRzaWRlRHJhd2FibGVzQ2FjaGU7CisgICAgICAgIAorICAgICAgICBtU3RhcnRTcGlubmVyUnVubmFibGUgPSBuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIC8vIG1TZWFyY2hWaWV3LnNldFdvcmtpbmcodHJ1ZSk7IC8vIFRPRE86CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICBtU3RvcFNwaW5uZXJSdW5uYWJsZSA9IG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAvLyBtU2VhcmNoVmlldy5zZXRXb3JraW5nKGZhbHNlKTsgLy8gVE9ETzoKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICAvLyBkZWxheSA1MDBtcyB3aGVuIGRlbGV0aW5nCisgICAgICAgIGdldEZpbHRlcigpLnNldERlbGF5ZXIobmV3IEZpbHRlci5EZWxheWVyKCkgeworCisgICAgICAgICAgICBwcml2YXRlIGludCBtUHJldmlvdXNMZW5ndGggPSAwOworCisgICAgICAgICAgICBwdWJsaWMgbG9uZyBnZXRQb3N0aW5nRGVsYXkoQ2hhclNlcXVlbmNlIGNvbnN0cmFpbnQpIHsKKyAgICAgICAgICAgICAgICBpZiAoY29uc3RyYWludCA9PSBudWxsKSByZXR1cm4gMDsKKworICAgICAgICAgICAgICAgIGxvbmcgZGVsYXkgPSBjb25zdHJhaW50Lmxlbmd0aCgpIDwgbVByZXZpb3VzTGVuZ3RoID8gREVMRVRFX0tFWV9QT1NUX0RFTEFZIDogMDsKKyAgICAgICAgICAgICAgICBtUHJldmlvdXNMZW5ndGggPSBjb25zdHJhaW50Lmxlbmd0aCgpO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93KCkuZ2V0RGVjb3JWaWV3KCkucG9zdChtU3RvcFNwaW5uZXJSdW5uYWJsZSk7IC8vIFRPRE86CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgeworICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAiY2xvc2UoKSIpOworICAgICAgICBjaGFuZ2VDdXJzb3IobnVsbCk7CisgICAgICAgIG1DbG9zZWQgPSB0cnVlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG5vdGlmeURhdGFTZXRDaGFuZ2VkKCkgeworICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAibm90aWZ5RGF0YVNldENoYW5nZWQiKTsKKyAgICAgICAgc3VwZXIubm90aWZ5RGF0YVNldENoYW5nZWQoKTsKKworICAgICAgICAvLyBtU2VhcmNoVmlldy5vbkRhdGFTZXRDaGFuZ2VkKCk7IC8vIFRPRE86CisKKyAgICAgICAgdXBkYXRlU3Bpbm5lclN0YXRlKGdldEN1cnNvcigpKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBub3RpZnlEYXRhU2V0SW52YWxpZGF0ZWQoKSB7CisgICAgICAgIGlmIChEQkcpIExvZy5kKExPR19UQUcsICJub3RpZnlEYXRhU2V0SW52YWxpZGF0ZWQiKTsKKyAgICAgICAgc3VwZXIubm90aWZ5RGF0YVNldEludmFsaWRhdGVkKCk7CisKKyAgICAgICAgdXBkYXRlU3Bpbm5lclN0YXRlKGdldEN1cnNvcigpKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgdXBkYXRlU3Bpbm5lclN0YXRlKEN1cnNvciBjdXJzb3IpIHsKKyAgICAgICAgQnVuZGxlIGV4dHJhcyA9IGN1cnNvciAhPSBudWxsID8gY3Vyc29yLmdldEV4dHJhcygpIDogbnVsbDsKKyAgICAgICAgaWYgKERCRykgeworICA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B1YmxpYyBDaGlsZFZpZXdDYWNoZShWaWV3IHYpIHsKKyAgICAgICAgICAgIG1UZXh0MSA9IChUZXh0Vmlldykgdi5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC50ZXh0MSk7CisgICAgICAgICAgICBtVGV4dDIgPSAoVGV4dFZpZXcpIHYuZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQudGV4dDIpOworICAgICAgICAgICAgbUljb24xID0gKEltYWdlVmlldykgdi5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5pY29uMSk7CisgICAgICAgICAgICBtSWNvbjIgPSAoSW1hZ2VWaWV3KSB2LmZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLmljb24yKTsKKyAgICAgICAgICAgIG1JY29uUmVmaW5lID0gKEltYWdlVmlldykgdi5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5lZGl0X3F1ZXJ5KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGJpbmRWaWV3KFZpZXcgdmlldywgQ29udGV4dCBjb250ZXh0LCBDdXJzb3IgY3Vyc29yKSB7CisgICAgICAgIENoaWxkVmlld0NhY2hlIHZpZXdzID0gKENoaWxkVmlld0NhY2hlKSB2aWV3LmdldFRhZygpOworCisgICAgICAgIGludCBmbGFncyA9IDA7CisgICAgICAgIGlmIChtRmxhZ3NDb2wgIT0gLTEpIHsKKyAgICAgICAgICAgIGZsYWdzID0gY3Vyc29yLmdldEludChtRmxhZ3NDb2wpOworICAgICAgICB9CisgICAgICAgIGlmICh2aWV3cy5tVGV4dDEgIT0gbnVsbCkgeworICAgICAgICAgICAgU3RyaW5nIHRleHQxID0gZ2V0U3RyaW5nT3JOdWxsKGN1cnNvciwgbVRleHQxQ29sKTsKKyAgICAgICAgICAgIHNldFZpZXdUZXh0KHZpZXdzLm1UZXh0MSwgdGV4dDEpOworICAgICAgICB9CisgICAgICAgIGlmICh2aWV3cy5tVGV4dDIgIT0gbnVsbCkgeworICAgICAgICAgICAgLy8gRmlyc3QgY2hlY2sgVEVYVF8yX1VSTAorICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRleHQyID0gZ2V0U3RyaW5nT3JOdWxsKGN1cnNvciwgbVRleHQyVXJsQ29sKTsKKyAgICAgICAgICAgIGlmICh0ZXh0MiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGV4dDIgPSBmb3JtYXRVcmwodGV4dDIpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB0ZXh0MiA9IGdldFN0cmluZ09yTnVsbChjdXJzb3IsIG1UZXh0MkNvbCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIElmIG5vIHNlY29uZCBsaW5lIG9mIHRleHQgaXMgaW5kaWNhdGVkLCBhbGxvdyB0aGUgZmlyc3QgbGluZSBvZiB0ZXh0CisgICAgICAgICAgICAvLyB0byBiZSB1cCB0byB0d28gbGluZXMgaWYgaXQgd2FudHMgdG8gYmUuCisgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkodGV4dDIpKSB7CisgICAgICAgICAgICAgICAgaWYgKHZpZXdzLm1UZXh0MSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHZpZXdzLm1UZXh0MS5zZXRTaW5nbGVMaW5lKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgdmlld3MubVRleHQxLnNldE1heExpbmVzKDIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKHZpZXdzLm1UZXh0MSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHZpZXdzLm1UZXh0MS5zZXRTaW5nbGVMaW5lKHRydWUpOworICAgICAgICAgICAgICAgICAgICB2aWV3cy5tVGV4dDEuc2V0TWF4TGluZXMoMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgc2V0Vmlld1RleHQodmlld3MubVRleHQyLCB0ZXh0Mik7CisgICAgICAgIH0KKworICAgICAgICBpZiAodmlld3MubUljb24xICE9IG51bGwpIHsKKyAgICAgICAgICAgIHNldFZpZXdEcmF3YWJsZSh2aWV3cy5tSWNvbjEsIGdldEljb24xKGN1cnNvcikpOworICAgICAgICB9CisgICAgICAgIGlmICh2aWV3cy5tSWNvbjIgIT0gbnVsbCkgeworICAgICAgICAgICAgc2V0Vmlld0RyYXdhYmxlKHZpZXdzLm1JY29uMiwgZ2V0SWNvbjIoY3Vyc29yKSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1RdWVyeVJlZmluZW1lbnQgPT0gUkVGSU5FX0FMTAorICAgICAgICAgICAgICAgIHx8IChtUXVlcnlSZWZpbmVtZW50ID09IFJFRklORV9CWV9FTlRSWQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKGZsYWdzICYgU2VhcmNoTWFuYWdlci5GTEFHX1FVRVJZX1JFRklORU1FTlQpICE9IDApKSB7CisgICAgICAgICAgICB2aWV3cy5tSWNvblJlZmluZS5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICB2aWV3cy5tSWNvblJlZmluZS5zZXRUYWcodmlld3MubVRleHQxLmdldFRleHQoKSk7CisgICAgICAgICAgICB2aWV3cy5tSWNvblJlZmluZS5zZXRPbkNsaWNrTGlzdGVuZXIodGhpcyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB2aWV3cy5tSWNvblJlZmluZS5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICBPYmplY3QgdGFnID0gdi5nZXRUYWcoKTsKKyAgICA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RleHQpIHsKKyAgICAgICAgLy8gU2V0IHRoZSB0ZXh0IGV2ZW4gaWYgaXQncyBudWxsLCBzaW5jZSB3ZSBuZWVkIHRvIGNsZWFyIGFueSBwcmV2aW91cyB0ZXh0LgorICAgICAgICB2LnNldFRleHQodGV4dCk7CisKKyAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHRleHQpKSB7CisgICAgICAgICAgICB2LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHYuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBEcmF3YWJsZSBnZXRJY29uMShDdXJzb3IgY3Vyc29yKSB7CisgICAgICAgIGlmIChtSWNvbk5hbWUxQ29sIDwgMCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgU3RyaW5nIHZhbHVlID0gY3Vyc29yLmdldFN0cmluZyhtSWNvbk5hbWUxQ29sKTsKKyAgICAgICAgRHJhd2FibGUgZHJhd2FibGUgPSBnZXREcmF3YWJsZUZyb21SZXNvdXJjZVZhbHVlKHZhbHVlKTsKKyAgICAgICAgaWYgKGRyYXdhYmxlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBkcmF3YWJsZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZ2V0RGVmYXVsdEljb24xKGN1cnNvcik7CisgICAgfQorCisgICAgcHJpdmF0ZSBEcmF3YWJsZSBnZXRJY29uMihDdXJzb3IgY3Vyc29yKSB7CisgICAgICAgIGlmIChtSWNvbk5hbWUyQ29sIDwgMCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgU3RyaW5nIHZhbHVlID0gY3Vyc29yLmdldFN0cmluZyhtSWNvbk5hbWUyQ29sKTsKKyAgICAgICAgcmV0dXJuIGdldERyYXdhYmxl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2VyLlNVR0dFU1RfQ09MVU1OX1FVRVJZKTsKKyAgICAgICAgaWYgKHF1ZXJ5ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBxdWVyeTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtU2VhcmNoYWJsZS5zaG91bGRSZXdyaXRlUXVlcnlGcm9tRGF0YSgpKSB7CisgICAgICAgICAgICBTdHJpbmcgZGF0YSA9IGdldENvbHVtblN0cmluZyhjdXJzb3IsIFNlYXJjaE1hbmFnZXIuU1VHR0VTVF9DT0xVTU5fSU5URU5UX0RBVEEpOworICAgICAgICAgICAgaWYgKGRhdGEgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBkYXRhOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKG1TZWFyY2hhYmxlLnNob3VsZFJld3JpdGVRdWVyeUZyb21UZXh0KCkpIHsKKyAgICAgICAgICAgIFN0cmluZyB0ZXh0MSA9IGdldENvbHVtblN0cmluZyhjdXJzb3IsIFNlYXJjaE1hbmFnZXIuU1VHR0VTVF9DT0xVTU5fVEVYVF8xKTsKKyAgICAgICAgICAgIGlmICh0ZXh0MSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRleHQxOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2QgaXMgb3ZlcnJpZGRlbiBwdXJlbHkgdG8gcHJvdmlkZSBhIGJpdCBvZiBwcm90ZWN0aW9uIGFnYWluc3QKKyAgICAgKiBmbGFreSBjb250ZW50IHByb3ZpZGVycy4KKyAgICAgKgorICAgICAqIEBzZWUgYW5kcm9pZC53aWRnZXQuTGlzdEFkYXB0ZXIjZ2V0VmlldyhpbnQsIFZpZXcsIFZpZXdHcm91cCkKKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgVmlldyB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VJZCkpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICAvLyBGaXJzdCwgc2VlIGlmIGl0J3MganVzdCBhbiBpbnRlZ2VyCisgICAgICAgICAgICBpbnQgcmVzb3VyY2VJZCA9IEludGVnZXIucGFyc2VJbnQoZHJhd2FibGVJZCk7CisgICAgICAgICAgICAvLyBJdCdzIGFuIGludCwgbG9vayBmb3IgaXQgaW4gdGhlIGNhY2hlCisgICAgICAgICAgICBTdHJpbmcgZHJhd2FibGVVcmkgPSBDb250ZW50UmVzb2x2ZXIuU0NIRU1FX0FORFJPSURfUkVTT1VSQ0UKKyAgICAgICAgICAgICAgICAgICAgKyAiOi8vIiArIG1Qcm92aWRlckNvbnRleHQuZ2V0UGFja2FnZU5hbWUoKSArICIvIiArIHJlc291cmNlSWQ7CisgICAgICAgICAgICAvLyBNdXN0IHVzZSBVUkkgYXMgY2FjaGUga2V5LCBzaW5jZSBpbnRzIGFyZSBhcHAtc3BlY2lmaWMKKyAgICAgICAgICAgIERyYXdhYmxlIGRyYXdhYmxlID0gY2hlY2tJY29uQ2FjaGUoZHJhd2FibGVVcmkpOworICAgICAgICAgICAgaWYgKGRyYXdhYmxlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZHJhd2FibGU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBOb3QgY2FjaGVkLCBmaW5kIGl0IGJ5IHJlc291cmNlIElECisgICAgICAgICAgICBkcmF3YWJsZSA9IG1Qcm92aWRlckNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0RHJhd2FibGUocmVzb3VyY2VJZCk7CisgICAgICAgICAgICAvLyBTdGljayBpdCBpbiB0aGUgY2FjaGUsIHVzaW5nIHRoZSBVUkkgYXMga2V5CisgICAgICAgICAgICBzdG9yZUluSWNvbkNhY2hlKGRyYXdhYmxlVXJpLCBkcmF3YWJsZSk7CisgICAgICAgICAgICByZXR1cm4gZHJhd2FibGU7CisgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBuZmUpIHsKKyAgICAgICAgICAgIC8vIEl0J3Mgbm90IGFuIGludGVnZXIsIHVzZSBpdCBhcyBhIFVSSQorICAgICAgICAgICAgRHJhd2FibGUgZHJhd2FibGUgPSBjaGVja0ljb25DYWNoZShkcmF3YWJsZUlkKTsKKyAgICAgICAgICAgIGlmIChkcmF3YWJsZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGRyYXdhYmxlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgVXJpIHVyaSA9IFVyaS5wYXJzZShkcmF3YWJsZUlkKTsKKyAgICAgICAgICAgIGRyYXdhYmxlID0gZ2V0RHJhd2FibGUodXJpKTsKKyAgICAgICAgICAgIHN0b3JlSW5JY29uQ2FjaGUoZHJhd2FibGVJZCwgZHJhd2FibGUpOworICAgICAgICAgICAgcmV0dXJuIGRyYXdhYmxlOworICAgICAgICB9IGNhdGNoIChSZXNvdXJjZXMuTm90Rm91bmRFeGNlcHRpb24gbmZlKSB7CisgICAgICAgICAgICAvLyBJdCB3YXMgYW4gaW50ZWdlciwgYnV0IGl0IGNvdWxkbid0IGJlIGZvdW5kLCBiYWlsIG91dAorICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIkljb24gcmVzb3VyY2Ugbm90IGZvdW5kOiAiICsgZHJhd2FibGVJZCk7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEdldHMgYSBkcmF3YWJsZSBieSBVUkksIHdpdGhvdXQgdXNpbmcgdGhlIGNhY2hlLgorICAgICAqCisgICAgICogQHJldHVybiBBIGRyYXdhYmxlLCBvciB7QGNvZGUgbnVsbH0gaWYgdGhlIGRyYXdhYmxlIGNvdWxkIG5vdCBiZSBsb2FkZWQuCisgICAgICovCisgICAgcHJpdmF0ZSBEcmF3YWJsZSBnZXREcmF3YWJsZShVcmkgdXJpKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBTdHJpbmcgc2NoZW1lID0gdXJpLmdldFNjaGVtZSgpOworICAgICAgICAgICAgaWYgKENvbnRlbnRSZXNvbHZlci5TQ0hFTUVfQU5EUk9JRF9SRVNPVVJDRS5lcXVhbHMoc2NoZW1lKSkgeworICAgICAgICAgICAgICAgIC8vIExvYWQgZHJhd2FibGVzIHRocm91Z2ggUmVzb3VyY2VzLCB0byBnZXQgdGhlIHNvdXJjZSBkZW5zaXR5IGluZm9ybWF0aW9uCisgICAgICAgICAgICAgICAgT3BlblJlc291cmNlSWRSZXN1bHQgciA9CisgICAgICAgICAgICAgICAgICAgIG1Qcm92aWRlckNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCkuZ2V0UmVzb3VyY2VJZCh1cmkpOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiByLnIuZ2V0RHJhd2FibGUoci5pZCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVzb3VyY2VzLk5vdEZvdW5kRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGaWxlTm90Rm91bmRFeGNlcHRpb24oIlJlc291cmNlIGRvZXMgbm90IGV4aXN0OiAiICsgdXJpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIExldCB0aGUgQ29udGVudFJlc29sdmVyIGhhbmRsZSBjb250ZW50IGFuZCBmaWxlIFVSSXMuCisgICAgICAgICAgICAgICAgSW5wdXRTdHJlYW0gc3RyZWFtID0gbVByb3ZpZGVyQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5vcGVuSW5wdXRTdHJlYW0odXJpKTsKKyAgICAgICAgICAgICAgICBpZiAoc3RyZWFtID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZpbGVOb3RGb3VuZEV4Y2VwdGlvbigiRmFpbGVkIHRvIG9wZW4gIiArIHVyaSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBEcmF3YWJsZS5jcmVhdGVGcm9tU3RyZWFtKHN0cmVhbSwgbnVsbCk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbS5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkVycm9yIGNsb3NpbmcgaWNvbiBzdHJlYW0gZm9yICIgKyB1cmksIGV4KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGZuZmUpIHsKKyAgICAgICAgICAgIExvZy53KExPR19UQUcsICJJY29uIG5vdCBmb3VuZDogIiArIHVyaSArICIsICIgKyBmbmZlLmdldE1lc3NhZ2UoKSk7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgRHJhd2FibGUgY2hlY2tJY29uQ2FjaGUoU3RyaW5nIHJlc291cmNlVXJpKSB7CisgICAgICAgIERyYXdhYmxlLkNvbnN0YW50U3RhdGUgY2FjaGVkID0gbU91dHNpZGVEcmF3YWJsZXNDYWNoZS5nZXQocmVzb3VyY2VVcmkpOworICAgICAgICBpZiAoY2FjaGVkID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIGlmIChEQkcpIExvZy5kKExPR19UQUcsICJGb3V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AgUGFja2FnZU1hbmFnZXIgcG0gPSBtQ29udGV4dC5nZXRQYWNrYWdlTWFuYWdlcigpOworICAgICAgICBmaW5hbCBBY3Rpdml0eUluZm8gYWN0aXZpdHlJbmZvOworICAgICAgICB0cnkgeworICAgICAgICAgICAgYWN0aXZpdHlJbmZvID0gcG0uZ2V0QWN0aXZpdHlJbmZvKGNvbXBvbmVudCwgUGFja2FnZU1hbmFnZXIuR0VUX01FVEFfREFUQSk7CisgICAgICAgIH0gY2F0Y2ggKE5hbWVOb3RGb3VuZEV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgZXgudG9TdHJpbmcoKSk7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBpbnQgaWNvbklkID0gYWN0aXZpdHlJbmZvLmdldEljb25SZXNvdXJjZSgpOworICAgICAgICBpZiAoaWNvbklkID09IDApIHJldHVybiBudWxsOworICAgICAgICBTdHJpbmcgcGtnID0gY29tcG9uZW50LmdldFBhY2thZ2VOYW1lKCk7CisgICAgICAgIERyYXdhYmxlIGRyYXdhYmxlID0gcG0uZ2V0RHJhd2FibGUocGtnLCBpY29uSWQsIGFjdGl2aXR5SW5mby5hcHBsaWNhdGlvbkluZm8pOworICAgICAgICBpZiAoZHJhd2FibGUgPT0gbnVsbCkgeworICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIkludmFsaWQgaWNvbiByZXNvdXJjZSAiICsgaWNvbklkICsgIiBmb3IgIgorICAgICAgICAgICAgICAgICAgICArIGNvbXBvbmVudC5mbGF0dGVuVG9TaG9ydFN0cmluZygpKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIHJldHVybiBkcmF3YWJsZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZXRzIHRoZSB2YWx1ZSBvZiBhIHN0cmluZyBjb2x1bW4gYnkgbmFtZS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjdXJzb3IgQ3Vyc29yIHRvIHJlYWQgdGhlIHZhbHVlIGZyb20uCisgICAgICogQHBhcmFtIGNvbHVtbk5hbWUgVGhlIG5hbWUgb2YgdGhlIGNvbHVtbiB0byByZWFkLgorICAgICAqIEByZXR1cm4gVGhlIHZhbHVlIG9mIHRoZSBnaXZlbiBjb2x1bW4sIG9yIDxjb2RlPm51bGw8L251bGw+CisgICAgICogICAgICAgICBpZiB0aGUgY3Vyc29yIGRvZXMgbm90IGNvbnRhaW4gdGhlIGdpdmVuIGNvbHVtbi4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBnZXRDb2x1bW5TdHJpbmcoQ3Vyc29yIGN1cnNvciwgU3RyaW5nIGNvbHVtbk5hbWUpIHsKKyAgICAgICAgaW50IGNvbCA9IGN1cnNvci5nZXRDb2x1bW5JbmRleChjb2x1bW5OYW1lKTsKKyAgICAgICAgcmV0dXJuIGdldFN0cmluZ09yTnVsbChjdXJzb3IsIGNvbCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIGdldFN0cmluZ09yTnVsbChDdXJzb3IgY3Vyc29yLCBpbnQgY29sKSB7CisgICAgICAgIGlmIChjb2wgPT0gTk9ORSkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBjdXJzb3IuZ2V0U3RyaW5nKGNvbCk7CisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLAorICAgICAgICAgICAgICAgICAgICAidW5leHBlY3RlZCBlcnJvciByZXRyaWV2aW5nIHZhbGlkIGNvbHVtbiBmcm9tIGN1cnNvciwgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgImRpZCB0aGUgcmVtb3RlIHByb2Nlc3MgZGllPyIsIGUpOworICAgICAgICAgICAgcmV0dXJuIG51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cyBuZWVkZWQgdG8gbGF1bmNoIHRoZSBsb2NhbCBhY3Rpdml0eS4KQEAgLTIwOSw2ICsyMjksNyBAQAogICAgICAgICBpZiAodGFiU3BlYy5tSW5kaWNhdG9yU3RyYXRlZ3kgaW5zdGFuY2VvZiBWaWV3SW5kaWNhdG9yU3RyYXRlZ3kpIHsKICAgICAgICAgICAgIG1UYWJXaWRnZXQuc2V0U3RyaXBFbmFibGVkKGZhbHNlKTsKICAgICAgICAgfQorCiAgICAgICAgIG1UYWJXaWRnZXQuYWRkVmlldyh0YWJJbmRpY2F0b3IpOwogICAgICAgICBtVGFiU3BlY3MuYWRkKHRhYlNwZWMpOwogCkBAIC01MDgsNyArNTI5LDcgQEAKICAgICAgICAgICAgIGZpbmFsIENvbnRleHQgY29udGV4dCA9IGdldENvbnRleHQoKTsKICAgICAgICAgICAgIExheW91dEluZmxhdGVyIGluZmxhdGVyID0KICAgICAgICAgICAgICAgICAgICAgKExheW91dEluZmxhdGVyKSBjb250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5MQVlPVVRfSU5GTEFURVJfU0VSVklDRSk7Ci0gICAgICAgICAgICBWaWV3IHRhYkluZGljYXRvciA9IGluZmxhdGVyLmluZmxhdGUoUi5sYXlvdXQudGFiX2luZGljYXRvciwKKyAgICAgICAgICAgIFZpZXcgdGFiSW5kaWNhdG9yID0gaW5mbGF0ZXIuaW5mbGF0ZShtVGFiTGF5b3V0SWQsCiAgICAgICAgICAgICAgICAgICAgIG1UYWJXaWRnZXQsIC8vIHRhYiB3aWRnZXQgaXMgdGhlIHBhcmVudAogICAgICAgICAgICAgICAgICAgICBmYWxzZSk7IC8vIG5vIGluZmxhdGUgcGFyYW1zCiAKQEAgLTUyMCw3ICs1NDEsNyBAQAogICAgICAgICAgICAgICAgIHRhYkluZGljYXRvci5zZXRCYWNrZ3JvdW5kUmVzb3VyY2UoUi5kcmF3YWJsZS50YWJfaW5kaWNhdG9yX3Y0KTsKICAgICAgICAgICAgICAgICB0di5zZXRUZXh0Q29sb3IoY29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRDb2xvclN0YXRlTGlzdChSLmNvbG9yLnRhYl9pbmRpY2F0b3JfdGV4dF92NCkpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHJldHVybiB0YWJJbmRpY2F0b3I7CiAgICAgICAgIH0KICAgICB9CkBAIC01NDIsNyArNTYzLDcgQEAKICAgICAgICAgICAgIGZpbmFsIENvbnRleHQgY29udGV4dCA9IGdldENvbnRleHQoKTsKICAgICAgICAgICAgIExheW91dEluZmxhdGVyIGluZmxhdGVyID0KICAgICAgICAgICAgICAgICAgICAgKExheW91dEluZmxhdGVyKSBjb250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5MQVlPVVRfSU5GTEFURVJfU0VSVklDRSk7Ci0gICAgICAgICAgICBWaWV3IHRhYkluZGljYXRvciA9IGluZmxhdGVyLmluZmxhdGUoUi5sYXlvdXQudGFiX2luZGljYXRvciwKKyAgICAgICAgICAgIFZpZXcgdGFiSW5kaWNhdG9yID0gaW5mbGF0ZXIuaW5mbGF0ZShtVGFiTGF5b3V0SWQsCiAgICAgICAgICAgICAgICAgICAgIG1UYWJXaWRnZXQsIC8vIHRhYiB3aWRnZXQgaXMgdGhlIHBhcmVudAogICAgICAgICAgICAgICAgICAgICBmYWxzZSk7IC8vIG5vIGluZmxhdGUgcGFyYW1zCiAKQEAgLTU1MCwxNCArNTcxLDE3IEBACiAgICAgICAgICAgICB0di5zZXRUZXh0KG1MYWJlbCk7CiAKICAgICAgICAgICAgIGZpbmFsIEltYWdlVmlldyBpY29uVmlldyA9IChJbWFnZVZpZXcpIHRhYkluZGljYXRvci5maW5kVmlld0J5SWQoUi5pZC5pY29uKTsKLSAgICAgICAgICAgIGljb25WaWV3LnNldEltYWdlRHJhd2FibGUobUljb24pOworICAgICAgICAgICAgaWYgKG1JY29uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpY29uVmlldy5zZXRJbWFnZURyYXdhYmxlKG1JY29uKTsKKyAgICAgICAgICAgICAgICBpY29uVmlldy5zZXRWaXNpYmlsaXR5KFZJU0lCTEUpOworICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAoY29udGV4dC5nZXRBcHBsaWNhdGlvbkluZm8oKS50YXJnZXRTZGtWZXJzaW9uIDw9IEJ1aWxkLlZFUlNJT05fQ09ERVMuRE9OVVQpIHsKICAgICAgICAgICAgICAgICAvLyBEb251dCBhcHBzIGdldCBvbGQgY29sb3Igc2NoZW1lCiAgICAgICAgICAgICAgICAgdGFiSW5kaWNhdG9yLnNldEJhY2tncm91bmRSZXNvdXJjZShSLmRyYXdhYmxlLnRhYl9pbmRpY2F0b3JfdjQpOwogICAgICAgICAgICAgICAgIHR2LnNldFRleHRDb2xvcihjb250ZXh0LmdldFJlc291cmNlcygpLmdldENvbG9yU3RhdGVMaXN0KFIuY29sb3IudGFiX2luZGljYXRvcl90ZXh0X3Y0KSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgcmV0dXJuIHRhYkluZGljYXRvcjsKICAgICAgICAgfQogICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3dpZGdldC9UYWJXaWRnZXQuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3dpZGdldC9UYWJXaWRnZXQuamF2YQppbmRleCBiNGIzNTVhLi5jZTRlOGU1IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvVGFiV2lkZ2V0LmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvd2lkZ2V0L1RhYldpZGdldC5qYXZhCkBAIC0yNiw4ICsyNiw5IEBACiBpbXBvcnQgYW5kcm9pZC5vcy5CdWlsZDsKIGltcG9ydCBhbmRyb2lkLnV0aWwuQXR0cmlidXRlU2V0OwogaW1wb3J0IGFuZHJvaWQudmlldy5WaWV3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hpbGRDb3VudCAtIDEpIHsKLSAgICAgICAgICAgIHJldHVybiBtU2VsZWN0ZWRUYWI7Ci0gICAgICAgIH0gZWxzZSBpZiAoaSA+PSBtU2VsZWN0ZWRUYWIpIHsKLSAgICAgICAgICAgIHJldHVybiBpICsgMTsKLSAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgaWYgKG1TZWxlY3RlZFRhYiA9PSAtMSkgewogICAgICAgICAgICAgcmV0dXJuIGk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBBbHdheXMgZHJhdyB0aGUgc2VsZWN0ZWQgdGFiIGxhc3QsIHNvIHRoYXQgZHJvcCBzaGFkb3dzIGFyZSBkcmF3bgorICAgICAgICAgICAgLy8gaW4gdGhlIGNvcnJlY3Qgei1vcmRlci4KKyAgICAgICAgICAgIGlmIChpID09IGNoaWxkQ291bnQgLSAxKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZWxlY3RlZFRhYjsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA+PSBtU2VsZWN0ZWRUYWIpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gaSArIDE7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiBpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogCkBAIC0xMTMsNyArMTE5LDkgQEAKIAogICAgICAgICBmaW5hbCBDb250ZXh0IGNvbnRleHQgPSBtQ29udGV4dDsKICAgICAgICAgZmluYWwgUmVzb3VyY2VzIHJlc291cmNlcyA9IGNvbnRleHQuZ2V0UmVzb3VyY2VzKCk7Ci0gICAgICAgIAorCisgICAgICAgIC8vIFRlc3RzIHRoZSB0YXJnZXQgU2RrIHZlcnNpb24sIGFzIHNldCBpbiB0aGUgTWFuaWZlc3QuIENvdWxkIG5vdCBiZSBzZXQgdXNpbmcgc3R5bGVzLnhtbAorICAgICAgICAvLyBpbiBhIHZhbHVlcy12PyBkaXJlY3Rvcnkgd2hpY2ggdGFyZ2V0cyB0aGUgY3VycmVudCBwbGF0Zm9ybSBTZGsgdmVyc2lvbiBpbnN0ZWFkLgogICAgICAgICBpZiAoY29udGV4dC5nZXRBcHBsaWNhdGlvbkluZm8oKS50YXJnZXRTZGtWZXJzaW9uIDw9IEJ1aWxkLlZFUlNJT05fQ09ERVMuRE9OVVQpIHsKICAgICAgICAgICAgIC8vIERvbnV0IGFwcHMgZ2V0IG9sZCBjb2xvciBzY2hlbWUKICAgICAgICAgICAgIGlmIChtTGVmdFN0cmlwID09IG51bGwpIHsKQEAgLTEyNCwxNiArMTMyLDYgQEAKICAgICAgICAgICAgICAgICBtUmlnaHRTdHJpcCA9IHJlc291cmNlcy5nZXREcmF3YWJsZSgKICAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUudGFiX2JvdHRvbV9yaWdodF92NCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAvLyBVc2UgbW9kZXJuIGNvbG9yIHNjaGVtZSBmb3IgRWNsYWlyIGFuZCBiZXlvbmQKLSAgICAgICAgICAgIGlmIChtTGVmdFN0cmlwID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtTGVmdFN0cmlwID0gcmVzb3VyY2VzLmdldERyYXdhYmxlKAotICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5kcmF3YWJsZS50YWJfYm90dG9tX2xlZnQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1SaWdodFN0cmlwID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtUmlnaHRTdHJpcCA9IHJlc291cmNlcy5nZXREcmF3YWJsZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUudGFiX2JvdHRvbV9yaWdodCk7Ci0gICAgICAgICAgICB9CiAgICAgICAgIH0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ldFJlc291cmNlSWQoYXR0ciwgMCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuVGV4dFZpZXdfdGV4dExpbmVIZWlnaHQ6CisgICAgICAgICAgICAgICAgaW50IGxpbmVIZWlnaHQgPSBhLmdldERpbWVuc2lvblBpeGVsU2l6ZShhdHRyLCAwKTsKKyAgICAgICAgICAgICAgICBpZiAobGluZUhlaWdodCAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIHNldExpbmVIZWlnaHQobGluZUhlaWdodCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGEucmVjeWNsZSgpOwpAQCAtMTA3NCw2ICsxMDk4LDkgQEAKICAgICAgKiBvciBsYXN0LWxpbmUgcGFkZGluZy4KICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldExpbmVIZWlnaHQoKSB7CisgICAgICAgIGlmIChtTGluZUhlaWdodCAhPSAwKSB7CisgICAgICAgICAgICByZXR1cm4gbUxpbmVIZWlnaHQ7CisgICAgICAgIH0KICAgICAgICAgcmV0dXJuIEZhc3RNYXRoLnJvdW5kKG1UZXh0UGFpbnQuZ2V0Rm9udE1ldHJpY3NJbnQobnVsbCkgKiBtU3BhY2luZ011bHQKICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtU3BhY2luZ0FkZCk7CiAgICAgfQpAQCAtMTY2NiwxMCArMTY5MywyNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dEFwcGVhcmFuY2VfdGV4dFN0eWxlLCAtMSk7CiAKICAgICAgICAgc2V0VHlwZWZhY2VCeUluZGV4KHR5cGVmYWNlSW5kZXgsIHN0eWxlSW5kZXgpOworICAgICAgICAKKyAgICAgICAgaW50IGxpbmVIZWlnaHQgPSBhcHBlYXJhbmNlLmdldERpbWVuc2lvblBpeGVsU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yB2b2lkIGRyYXdUZXh0UnVuKENhbnZhcyBjLCBpbnQgc3RhcnQsIGludCBlbmQsCisgICAgICAgICAgICAgICAgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsIGZsb2F0IHgsIGZsb2F0IHksIGludCBmbGFncywgUGFpbnQgcCkgeworICAgICAgICAgICAgaW50IGNvdW50ID0gZW5kIC0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgY29udGV4dENvdW50ID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgIGMuZHJhd1RleHRSdW4obUNoYXJzLCBzdGFydCArIG1TdGFydCwgY291bnQsIGNvbnRleHRTdGFydCArIG1TdGFydCwKKyAgICAgICAgICAgICAgICAgICAgY29udGV4dENvdW50LCB4LCB5LCBmbGFncywgcCk7CisgICAgICAgIH0KKwogICAgICAgICBwdWJsaWMgZmxvYXQgbWVhc3VyZVRleHQoaW50IHN0YXJ0LCBpbnQgZW5kLCBQYWludCBwKSB7CiAgICAgICAgICAgICByZXR1cm4gcC5tZWFzdXJlVGV4dChtQ2hhcnMsIHN0YXJ0ICsgbVN0YXJ0LCBlbmQgLSBzdGFydCk7CiAgICAgICAgIH0KQEAgLTI4NDQsNiArMjg5NiwyMyBAQAogICAgICAgICBwdWJsaWMgaW50IGdldFRleHRXaWR0aHMoaW50IHN0YXJ0LCBpbnQgZW5kLCBmbG9hdFtdIHdpZHRocywgUGFpbnQgcCkgewogICAgICAgICAgICAgcmV0dXJuIHAuZ2V0VGV4dFdpZHRocyhtQ2hhcnMsIHN0YXJ0ICsgbVN0YXJ0LCBlbmQgLSBzdGFydCwgd2lkdGhzKTsKICAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBmbG9hdCBnZXRUZXh0UnVuQWR2YW5jZXMoaW50IHN0YXJ0LCBpbnQgZW5kLCBpbnQgY29udGV4dFN0YXJ0LAorICAgICAgICAgICAgICAgIGludCBjb250ZXh0RW5kLCBpbnQgZmxhZ3MsIGZsb2F0W10gYWR2YW5jZXMsIGludCBhZHZhbmNlc0luZGV4LAorICAgICAgICAgICAgICAgIFBhaW50IHApIHsKKyAgICAgICAgICAgIGludCBjb3VudCA9IGVuZCAtIHN0YXJ0OworICAgICAgICAgICAgaW50IGNvbnRleHRDb3VudCA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgICAgICByZXR1cm4gcC5nZXRUZXh0UnVuQWR2YW5jZXMobUNoYXJzLCBzdGFydCArIG1TdGFydCwgY291bnQsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRTdGFydCArIG1TdGFydCwgY29udGV4dENvdW50LCBmbGFncywgYWR2YW5jZXMsCisgICAgICAgICAgICAgICAgICAgIGFkdmFuY2VzSW5kZXgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGludCBnZXRUZXh0UnVuQ3Vyc29yKGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLCBpbnQgZmxhZ3MsCisgICAgICAgICAgICAgICAgaW50IG9mZnNldCwgaW50IGN1cnNvck9wdCwgUGFpbnQgcCkgeworICAgICAgICAgICAgaW50IGNvbnRleHRDb3VudCA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgICAgICByZXR1cm4gcC5nZXRUZXh0UnVuQ3Vyc29yKG1DaGFycywgY29udGV4dFN0YXJ0ICsgbVN0YXJ0LAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0Q291bnQsIGZsYWdzLCBvZmZzZXQgKyBtU3RhcnQsIGN1cnNvck9wdCk7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTMxNjAsNyArMzIyOSw4IEBACiAgICAgICogZm9yIHRoaXMgdGV4dCB2aWV3LiAgVGhlIGRlZmF1bHQgaW1wbGVtZW50YXRpb24gd2lsbCBjYWxsIHlvdXIgYWN0aW9uCiAgICAgICogbGlzdGVuZXIgc3VwcGxpZWQgdG8ge0BsaW5rICNzZXRPbkVkaXRvckFjdGlvbkxpc3RlbmVyfSwgb3IgcGVyZm9ybQogICAgICAqIGEgc3RhbmRhcmQgb3BlcmF0aW9uIGZvciB7QGxpbmsgRWRpdG9ySW5mbyNJTUVfQUNUSU9OX05FWFQKLSAgICAgKiBFZGl0b3JJbmZvLklNRV9BQ1RJT05fTkVYVH0gb3Ige0BsaW5rIEVkaXRvckluZm8jSU1FX0FDVElPTl9ET05FCisgICAgICogRWRpdG9ySW5mby5JTUVfQUNUSU9OX05FWFR9LCB7QGxpbmsgRWRpdG9ySW5mbyNJTUVfQUNUSU9OX1BSRVZJT1VTCisgICAgICogRWRpdG9ySW5mby5JTUVfQUNUSU9OX1BSRVZJT1VTfSwgb3Ige0BsaW5rIEVkaXRvckluZm8jSU1FX0FDVElPTl9ET05FCiAgICAgICogRWRpdG9ySW5mby5JTUVfQUNUSU9OX0RPTkV9LgogICAgICAqIAogICAgICAqIDxwPkZvciBiYWNrd2FyZHMgY29tcGF0aWJpbGl0eSwgaWYgbm8gSU1FIG9wdGlvbnMgaGF2ZSBiZWVuIHNldCBhbmQgdGhlCkBAIC0zMTk3LDYgKzMyNjcsMTYgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb25Db2RlID09IEVkaXRvckluZm8uSU1FX0FDVElPTl9QUkVWSU9VUykgeworICAgICAgICAgICAgICAgIFZpZXcgdiA9IGZvY3VzU2VhcmNoKEZPQ1VTX1VQKTsKKyAgICAgICAgICAgICAgICBpZiAodiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghdi5yZXF1ZXN0Rm9jdXMoRk9DVVNfVVApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJmb2N1cyBzZWFyY2ggcmV0dXJuZWQgYSB2aWV3ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidGhhdCB3YXNuJ3QgYWJsZSB0byB0YWtlIGZvY3VzISIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybjsKKwogICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb25Db2RlID09IEVkaXRvckluZm8uSU1FX0FDVElPTl9ET05FKSB7CiAgICAgICAgICAgICAgICAgSW5wdXRNZXRob2RNYW5hZ2VyIGltbSA9IElucHV0TWV0aG9kTWFuYWdlci5wZWVrSW5zdGFuY2UoKTsKICAgICAgICAgICAgICAgICBpZiAoaW1tICE9IG51bGwpIHsKQEAgLTM3NzUsNyArMzg1NSw3IEBACiAgICAgICAgIC8vICAgYWxsb3cgdG8gdGVzdCBmb3IgaGFzU2VsZWN0aW9uIGluIG9uRm9jdXNDaGFuZ2VkLCB3aGljaCB3b3VsZCB0cmlnZ2VyIGEKICAgICAgICAgLy8gICBzdGFydFRleHRTZWxlY3Rpb25Nb2RlIGhlcmUuIFRPRE8KICAgICAgICAgaWYgKHNlbGVjdGlvbkNvbnRyb2xsZXIgIT0gbnVsbCAmJiBoYXNTZWxlY3Rpb24oKSkgewotICAgICAgICAgICAgc3RhcnRUZXh0U2VsZWN0aW9uTW9kZSgpOworICAgICAgICAgICAgc3RhcnRTZWxlY3Rpb25BY3Rpb25Nb2RlKCk7CiAgICAgICAgIH0KIAogICAgICAgICBtUHJlRHJhd1N0YXRlID0gUFJFRFJBV19ET05FOwpAQCAtMzkxNSw3ICszOTk1LDI1IEBACiAgICAgfQogCiAgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIGJvb2xlYW4gb25TZXRBbHBoYShpbnQgYWxwaGEpIHsKKyAgICAgICAgaWYgKG1Nb3ZlbWVudCA9PSBudWxsICYmIGdldEJhY2tncm91bmQoKSA9PSBudWxsKSB7CisgICAgICAgICAgICBtQ3VycmVudEFscGhhID0gYWxwaGE7CisgICAgICAgICAgICBmaW5hbCBEcmF3YWJsZXMgZHIgPSBtRHJhd2FibGVzOworICAgICAgICAgICAgaWYgKGRyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoZHIubURyYXdhYmxlTGVmdCAhPSBudWxsKSBkci5tRHJhd2FibGVMZWZ0Lm11dGF0ZSgpLnNldEFscGhhKGFscGhhKTsKKyAgICAgICAgICAgICAgICBpZiAoZHIubURyYXdhYmxlVG9wICE9IG51bGwpIGRyLm1EcmF3YWJsZVRvcC5tdXRhdGUoKS5zZXRBbHBoYShhbHBoYSk7CisgICAgICAgICAgICAgICAgaWYgKGRyLm1EcmF3YWJsZVJpZ2h0ICE9IG51bGwpIGRyLm1EcmF3YWJsZVJpZ2h0Lm11dGF0ZSgpLnNldEFscGhhKGFscGhhKTsKKyAgICAgICAgICAgICAgICBpZiAoZHIubURyYXdhYmxlQm90dG9tICE9IG51bGwpIGRyLm1EcmF3YWJsZUJvdHRvbS5tdXRhdGUoKS5zZXRBbHBoYShhbHBoYSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgaWYgKG1DdXJyZW50QWxwaGEgPD0gVmlld0NvbmZpZ3VyYXRpb24uQUxQSEFfVEhSRVNIT0xEX0lOVCkgcmV0dXJuOworCiAgICAgICAgIHJlc3RhcnRNYXJxdWVlSWZOZWVkZWQoKTsKIAogICAgICAgICAvLyBEcmF3IHRoZSBiYWNrZ3JvdW5kIGZvciB0aGlzIHZpZXcKQEAgLTQwMTEsNiArNDEwOSw3IEBACiAgICAgICAgIH0KIAogICAgICAgICBtVGV4dFBhaW50LnNldENvbG9yKGNvbG9yKTsKKyAgICAgICAgbVRleHRQYWludC5zZXRBbHBoYShtQ3VycmVudEFscGhhKTsKICAgICAgICAgbVRleHRQYWludC5kcmF3YWJsZVN0YXRlID0gZ2V0RHJhd2FibGVTdGF0ZSgpOwogCiAgICAgICAgIGNhbnZhcy5zYXZlKCk7CkBAIC00NDA3LDggKzQ1MDYsOCBAQAogCiAgICAgICAgICAgICAgICAgLy8gSGFzIHRvIGJlIGRvbmUgb24ga2V5IGRvd24gKGFuZCBub3Qgb24ga2V5IHVwKSB0byBjb3JyZWN0bHkgYmUgaW50ZXJjZXB0ZWQuCiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfQkFDSzoKLSAgICAgICAgICAgICAgICBpZiAobUlzSW5UZXh0U2VsZWN0aW9uTW9kZSkgewotICAgICAgICAgICAgICAgICAgICBzdG9wVGV4dFNlbGVjdGlvbk1vZGUoKTsKKyAgICAgICAgICAgICAgICBpZiAobVNlbGVjdGlvbkFjdGlvbk1vZGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBzdG9wU2VsZWN0aW9uQWN0aW9uTW9kZSgpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtNDQ5MSw3ICs0NTkwLDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIGhpZGVDb250cm9sbGVycygpOwotICAgICAgICBzdG9wVGV4dFNlbGVjdGlvbk1vZGUoKTsKKyAgICAgICAgc3RvcFNlbGVjdGlvbkFjdGlvbk1vZGUoKTsKIAogICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUjoKQEAgLTQ2MDEsOSArNDcwMCwxNSBAQAogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBvdXRBdHRycy5pbWVPcHRpb25zID0gRWRpdG9ySW5mby5JTUVfTlVMTDsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChmb2N1c1NlYXJjaChGT0NVU19ET1dOKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb3V0QXR0cnMuaW1lT3B0aW9ucyB8PSBFZGl0b3JJbmZvLklNRV9GTEFHX05BVklHQVRFX05FWFQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZm9jdXNTZWFyY2goRk9DVVNfVVApICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvdXRBdHRycy5pbWVPcHRpb25zIHw9IEVkaXRvckluZm8uSU1FX0ZMQUdfTkFWSUdBVEVfUFJFVklPVVM7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoKG91dEF0dHJzLmltZU9wdGlvbnMmRWRpdG9ySW5mby5JTUVfTUFTS19BQ1RJT04pCiAgICAgICAgICAgICAgICAgICAgID09IEVkaXRvckluZm8uSU1FX0FDVElPTl9VTlNQRUNJRklFRCkgewotICAgICAgICAgICAgICAgIGlmIChmb2N1c1NlYXJjaChGT0NVU19ET1dOKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKChvdXRBdHRycy5pbWVPcHRpb25zJkVkaXRvckluZm8uSU1FX0ZMQUdfTkFWSUdBVEVfTkVYVCkgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICAvLyBBbiBhY3Rpb24gaGFzIG5vdCBiZWVuIHNldCwgYnV0IHRoZSBlbnRlciBrZXkgd2lsbCBtb3ZlIHRvCiAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBuZXh0IGZvY3VzLCBzbyBzZXQgdGhlIGFjdGlvbiB0byB0aGF0LgogICAgICAgICAgICAgICAgICAgICBvdXRBdHRycy5pbWVPcHRpb25zIHw9IEVkaXRvckluZm8uSU1FX0FDVElPTl9ORVhUOwpAQCAtNDkwOCw3ICs1MDEzLDcgQEAKICAgICAgICAgICAgICAgICBtYWtlQmxpbmsoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBja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sNyArNjg5OSw3IEBACiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAvLyBUYXBwaW5nIG91dHNpZGUgc3RvcHMgc2VsZWN0aW9uIG1vZGUsIGlmIGFueQotICAgICAgICAgICAgICAgIHN0b3BUZXh0U2VsZWN0aW9uTW9kZSgpOworICAgICAgICAgICAgICAgIHN0b3BTZWxlY3Rpb25BY3Rpb25Nb2RlKCk7CiAKICAgICAgICAgICAgICAgICBpZiAobUluc2VydGlvblBvaW50Q3Vyc29yQ29udHJvbGxlciAhPSBudWxsICYmIG1UZXh0Lmxlbmd0aCgpID4gMCkgewogICAgICAgICAgICAgICAgICAgICBtSW5zZXJ0aW9uUG9pbnRDdXJzb3JDb250cm9sbGVyLnNob3coKTsKQEAgLTY3OTMsMTMgKzY5MTIsMTMgQEAKIAogICAgIGNsYXNzIENvbW1pdFNlbGVjdGlvblJlY2VpdmVyIGV4dGVuZHMgUmVzdWx0UmVjZWl2ZXIgewogICAgICAgICBwcml2YXRlIGZpbmFsIGludCBtUHJldlN0YXJ0LCBtUHJldkVuZDsKLSAgICAgICAgCisKICAgICAgICAgcHVibGljIENvbW1pdFNlbGVjdGlvblJlY2VpdmVyKGludCBwcmV2U3RhcnQsIGludCBwcmV2RW5kKSB7CiAgICAgICAgICAgICBzdXBlcihnZXRIYW5kbGVyKCkpOwogICAgICAgICAgICAgbVByZXZTdGFydCA9IHByZXZTdGFydDsKICAgICAgICAgICAgIG1QcmV2RW5kID0gcHJldkVuZDsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25SZWNlaXZlUmVzdWx0KGludCByZXN1bHRDb2RlLCBCdW5kbGUgcmVzdWx0RGF0YSkgewogICAgICAgICAgICAgLy8gSWYgdGhpcyB0YXAgd2FzIGFjdHVhbGx5IHVzZWQgdG8gc2hvdyB0aGUgSU1NLCBsZWF2ZSBjdXJzb3Igb3Igc2VsZWN0aW9uIHVuY2hhbmdlZApAQCAtNjgxMSwyMyArNjkzMCwyMyBAQAogICAgICAgICAgICAgICAgIFNlbGVjdGlvbi5zZXRTZWxlY3Rpb24oKFNwYW5uYWJsZSltVGV4dCwgc3RhcnQsIGVuZCk7CiAKICAgICAgICAgICAgICAgICBpZiAoaGFzU2VsZWN0aW9uKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhcnRUZXh0U2VsZWN0aW9uTW9kZSgpOworICAgICAgICAgICAgICAgICAgICBzdGFydFNlbGVjdGlvbkFjdGlvbk1vZGUoKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgYm9vbGVhbiBvblRvdWNoRXZlbnQoTW90aW9uRXZlbnQgZXZlbnQpIHsKICAgICAgICAgZmluYWwgaW50IGFjdGlvbiA9IGV2ZW50LmdldEFjdGlvbk1hc2tlZCgpOwotICAgICAgICBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOKSB7Ci0gICAgICAgICAgICBpZiAobUluc2VydGlvblBvaW50Q3Vyc29yQ29udHJvbGxlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbUluc2VydGlvblBvaW50Q3Vyc29yQ29udHJvbGxlci5vblRvdWNoRXZlbnQoZXZlbnQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1TZWxlY3Rpb25Nb2RpZmllckN1cnNvckNvbnRyb2xsZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1TZWxlY3Rpb25Nb2RpZmllckN1cnNvckNvbnRyb2xsZXIub25Ub3VjaEV2ZW50KGV2ZW50KTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgaWYgKG1JbnNlcnRpb25Qb2ludEN1cnNvckNvbnRyb2xsZXIgIT0gbnVsbCkgewor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RBbHBoYSA8PSBWaWV3Q29uZmlndXJhdGlvbi5BTFBIQV9USFJFU0hPTERfSU5UKSByZXR1cm4gMC4wZjsKICAgICAgICAgaWYgKG1FbGxpcHNpemUgPT0gVGV4dFV0aWxzLlRydW5jYXRlQXQuTUFSUVVFRSkgewogICAgICAgICAgICAgaWYgKG1NYXJxdWVlICE9IG51bGwgJiYgIW1NYXJxdWVlLmlzU3RvcHBlZCgpKSB7CiAgICAgICAgICAgICAgICAgZmluYWwgTWFycXVlZSBtYXJxdWVlID0gbU1hcnF1ZWU7CkBAIC03MDQzLDYgKzcxNTYsNyBAQAogCiAgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIGZsb2F0IGdldFJpZ2h0RmFkaW5nRWRnZVN0cmVuZ3RoKCkgeworICAgICAgICBpZiAobUN1cnJlbnRBbHBoYSA8PSBWaWV3Q29uZmlndXJhdGlvbi5BTFBIQV9USFJFU0hPTERfSU5UKSByZXR1cm4gMC4wZjsKICAgICAgICAgaWYgKG1FbGxpcHNpemUgPT0gVGV4dFV0aWxzLlRydW5jYXRlQXQuTUFSUVVFRSkgewogICAgICAgICAgICAgaWYgKG1NYXJxdWVlICE9IG51bGwgJiYgIW1NYXJxdWVlLmlzU3RvcHBlZCgpKSB7CiAgICAgICAgICAgICAgICAgZmluYWwgTWFycXVlZSBtYXJxdWVlID0gbU1hcnF1ZWU7CkBAIC03MDU3LDYgKzcxNzEsNyBAQAogICAgICAgICAgICAgICAgICAgICBjYXNlIEdyYXZpdHkuUklHSFQ6CiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMC4wZjsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBHcmF2aXR5LkNFTlRFUl9IT1JJWk9OVEFMOgorICAgICAgICAgICAgICAgICAgICBjYXNlIEdyYXZpdHkuRklMTF9IT1JJWk9OVEFMOgogICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChtTGF5b3V0LmdldExpbmVXaWR0aCgwKSAtICgobVJpZ2h0IC0gbUxlZnQpIC0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29tcG91bmRQYWRkaW5nTGVmdCgpIC0gZ2V0Q29tcG91bmRQYWRkaW5nUmlnaHQoKSkpIC8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0SG9yaXpvbnRhbEZhZGluZ0VkZ2VMZW5ndGgoKTsKQEAgLTcwNjgsOCArNzE4MywxMCBAQAogCiAgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIGludCBjb21wdXRlSG9yaXpvbnRhbFNjcm9sbFJhbmdlKCkgewotICAgICAgICBpZiAobUxheW91dCAhPSBudWxsKQotICAgICAgICAgICAgcmV0dXJuIG1MYXlvdXQuZ2V0V2lkdGgoKTsKKyAgICAgICAgaWYgKG1MYXlvdXQgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG1TaW5nbGVMaW5lICYmIChtR3Jhdml0eSAmIEdyYXZpdHkuSE9SSVpPTlRBTF9HUkFWSVRZX01BU0spID09IEdyYXZpdHkuTEVGVCA/CisgICAgICAgICAgICAgICAgICAgIChpbnQpIG1MYXlvdXQuZ2V0TGluZVdpZHRoKDApIDogbUxheW91dC5nZXRXaWR0aCgpOworICAgICAgICB9CiAKICAgICAgICAgcmV0dXJuIHN1cGVyLmNvbXB1dGVIb3Jpem9udGFsU2Nyb2xsUmFuZ2UoKTsKICAgICB9CkBAIC03MjE2LDcgKzczMzMsNyBAQAogICAgICAgICAgICAgICAgIGdldFNlbGVjdGlvblN0YXJ0KCkgPj0gMCAmJgogICAgICAgICAgICAgICAgIGdldFNlbGVjdGlvbkVuZCgpID49IDAgJiYKICAgICAgICAgICAgICAgICAoKENsaXBib2FyZE1hbmFnZXIpZ2V0Q29udGV4dCgpLmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5DTElQQk9BUkRfU0VSVklDRSkpLgotICAgICAgICAgICAgICAgIGhhc1RleHQoKSk7CisgICAgICAgICA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KLSAgICAKKwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIGRpc3BhdGNoUG9wdWxhdGVBY2Nlc3NpYmlsaXR5RXZlbnQoQWNjZXNzaWJpbGl0eUV2ZW50IGV2ZW50KSB7CiAgICAgICAgIGlmICghaXNTaG93bigpKSB7CkBAIC03NDIxLDgzICs3NTMwLDM0IEBACiAgICAgICAgIC8vIGl0IG1heSBub3QgYmUgY2FsbGVkIChpZiB0aGUgdXNlci8gZGlzY2FyZHMgdGhlIGNvbnRleHQgbWVudSB3aXRoIHRoZSBiYWNrIGtleSkuCiAgICAgICAgIG1EUGFkQ2VudGVySXNEb3duID0gbUVudGVyS2V5SXNEb3duID0gZmFsc2U7CiAKLSAgICAgICAgaWYgKG1Jc0luVGV4dFNlbGVjdGlvbk1vZGUpIHsKLSAgICAgICAgICAgIE1lbnVIYW5kbGVyIGhhbmRsZXIgPSBuZXcgTWVudUhhbmRsZXIoKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgaWYgKGNhbkN1dCgpKSB7Ci0gICAgICAgICAgICAgICAgbWVudS5hZGQoMCwgSURfQ1VULCAwLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5jdXQpLgotICAgICAgICAgICAgICAgICAgICAgc2V0T25NZW51SXRlbUNsaWNrTGlzdGVuZXIoaGFuZGxlcikuCi0gICAgICAgICAgICAgICAgICAgICBzZXRBbHBoYWJldGljU2hvcnRjdXQoJ3gnKTsKKyAgICAgICAgTWVudUhhbmRsZXIgaGFuZGxlciA9IG5ldyBNZW51SGFuZGxlcigpOworCisgICAgICAgIGlmIChtVGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpIHsKKyAgICAgICAgICAgIGludCBzZWxTdGFydCA9IGdldFNlbGVjdGlvblN0YXJ0KCk7CisgICAgICAgICAgICBpbnQgc2VsRW5kID0gZ2V0U2VsZWN0aW9uRW5kKCk7CisKKyAgICAgICAgICAgIGludCBtaW4gPSBNYXRoLm1pbihzZWxTdGFydCwgc2VsRW5kKTsKKyAgICAgICAgICAgIGludCBtYXggPSBNYXRoLm1heChzZWxTdGFydCwgc2VsRW5kKTsKKworICAgICAgICAgICAgVVJMU3BhbltdIHVybHMgPSAoKFNwYW5uZWQpIG1UZXh0KS5nZXRTcGFucyhtaW4sIG1heCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVJMU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICBpZiAodXJscy5sZW5ndGggPT0gMSkgeworICAgICAgICAgICAgICAgIG1lbnUuYWRkKDAsIElEX0NPUFlfVVJMLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmNvcHlVcmwpLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldE9uTWVudUl0ZW1DbGlja0xpc3RlbmVyKGhhbmRsZXIpOworCiAgICAgICAgICAgICAgICAgYWRkZWQgPSB0cnVlOwogICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoY2FuQ29weSgpKSB7Ci0gICAgICAgICAgICAgICAgbWVudS5hZGQoMCwgSURfQ09QWSwgMCwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuY29weSkuCi0gICAgICAgICAgICAgICAgICAgICBzZXRPbk1lbnVJdGVtQ2xpY2tMaXN0ZW5lcihoYW5kbGVyKS4KLSAgICAgICAgICAgICAgICAgICAgIHNldEFscGhhYmV0aWNTaG9ydGN1dCgnYycpOwotICAgICAgICAgICAgICAgIGFkZGVkID0gdHJ1ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGNhblBhc3RlKCkpIHsKLSAgICAgICAgICAgICAgICBtZW51LmFkZCgwLCBJRF9QQVNURSwgMCwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcucGFzdGUpLgotICAgICAgICAgICAgICAgICAgICAgc2V0T25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LnN0cmluZy5zZWxlY3RBbGwpLgotICAgICAgICAgICAgICAgICAgICAgc2V0T25NZW51SXRlbUNsaWNrTGlzdGVuZXIoaGFuZGxlcikuCi0gICAgICAgICAgICAgICAgICAgICBzZXRBbHBoYWJldGljU2hvcnRjdXQoJ2EnKTsKLSAgICAgICAgICAgICAgICBhZGRlZCA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtVGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpIHsKLSAgICAgICAgICAgICAgICBpbnQgc2VsU3RhcnQgPSBnZXRTZWxlY3Rpb25TdGFydCgpOwotICAgICAgICAgICAgICAgIGludCBzZWxFbmQgPSBnZXRTZWxlY3Rpb25FbmQoKTsKLQotICAgICAgICAgICAgICAgIGludCBtaW4gPSBNYXRoLm1pbihzZWxTdGFydCwgc2VsRW5kKTsKLSAgICAgICAgICAgICAgICBpbnQgbWF4ID0gTWF0aC5tYXgoc2VsU3RhcnQsIHNlbEVuZCk7Ci0KLSAgICAgICAgICAgICAgICBVUkxTcGFuW10gdXJscyA9ICgoU3Bhbm5lZCkgbVRleHQpLmdldFNwYW5zKG1pbiwgbWF4LAotICAgICAgICAgICAgICAgICAgICAgICAgVVJMU3Bhbi5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgaWYgKHVybHMubGVuZ3RoID09IDEpIHsKLSAgICAgICAgICAgICAgICAgICAgbWVudS5hZGQoMCwgSURfQ09QWV9VUkwsIDAsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmNvcHlVcmwpLgotICAgICAgICAgICAgICAgICAgICAgICAgIHNldE9uTWVudUl0ZW1DbGlja0xpc3RlbmVyKGhhbmRsZXIpOwotICAgICAgICAgICAgICAgICAgICBhZGRlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgCi0gICAgICAgICAgICBpZiAoY2FuUGFzdGUoKSkgewotICAgICAgICAgICAgICAgIG1lbnUuYWRkKDAsIElEX1BBU1RFLCAwLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5wYXN0ZSkuCi0gICAgICAgICAgICAgICAgICAgICBzZXRPbk1lbnVJdGVtQ2xpY2tMaXN0ZW5lcihoYW5kbGVyKS4KLSAgICAgICAgICAgICAgICAgICAgIHNldEFscGhhYmV0aWNTaG9ydGN1dCgndicpOwotICAgICAgICAgICAgICAgIGFkZGVkID0gdHJ1ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGlzSW5wdXRNZXRob2RUYXJnZXQoKSkgewotICAgICAgICAgICAgICAgIG1lbnUuYWRkKDEsIElEX1NXSVRDSF9JTlBVVF9NRVRIT0QsIDAsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmlucHV0TWV0aG9kKS4KLSAgICAgICAgICAgICAgICAgICAgIHNldE9uTWVudUl0ZW1DbGlja0xpc3RlbmVyKGhhbmRsZXIpOwotICAgICAgICAgICAgICAgIGFkZGVkID0gdHJ1ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgU3RyaW5nIHdvcmQgPSBnZXRXb3JkRm9yRGljdGlvbmFyeSgpOwotICAgICAgICAgICAgaWYgKHdvcmQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1lbnUuYWRkKDEsIElEX0FERF9UT19ESUNUSU9OQVJZLCAwLAotICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldFN0cmluZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5hZGRUb0RpY3Rpb25hcnksIHdvcmQpKS4KLSAgICAgICAgICAgICAgICAgICAgIHNldE9uTWVudUl0ZW1DbGlja0xpc3RlbmVyKGhhbmRsZXIpOwotICAgICAgICAgICAgICAgIGFkZGVkID0gdHJ1ZTsKLQotICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBUaGUgY29udGV4dCBt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3RoKCkpOwotICAgICAgICAgICAgICAgIHN0YXJ0VGV4dFNlbGVjdGlvbk1vZGUoKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLQotICAgICAgICAgICAgY2FzZSBJRF9TVEFSVF9TRUxFQ1RJTkdfVEVYVDoKLSAgICAgICAgICAgICAgICBzdGFydFRleHRTZWxlY3Rpb25Nb2RlKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0KLSAgICAgICAgICAgIGNhc2UgSURfQ1VUOiAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBjbGlwLnNldFRleHQobVRyYW5zZm9ybWVkLnN1YlNlcXVlbmNlKG1pbiwgbWF4KSk7Ci0gICAgICAgICAgICAgICAgKChFZGl0YWJsZSkgbVRleHQpLmRlbGV0ZShtaW4sIG1heCk7Ci0gICAgICAgICAgICAgICAgc3RvcFRleHRTZWxlY3Rpb25Nb2RlKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0KLSAgICAgICAgICAgIGNhc2UgSURfQ09QWToKLSAgICAgICAgICAgICAgICBjbGlwLnNldFRleHQobVRyYW5zZm9ybWVkLnN1YlNlcXVlbmNlKG1pbiwgbWF4KSk7Ci0gICAgICAgICAgICAgICAgc3RvcFRleHRTZWxlY3Rpb25Nb2RlKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0KLSAgICAgICAgICAgIGNhc2UgSURfUEFTVEU6Ci0gICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHBhc3RlID0gY2xpcC5nZXRUZXh0KCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAocGFzdGUgIT0gbnVsbCAmJiBwYXN0ZS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbG9uZyBtaW5NYXggPSBwcmVwYXJlU3BhY2VzQXJvdW5kUGFzdGUobWluLCBtYXgsIHBhc3RlKTsKLSAgICAgICAgICAgICAgICAgICAgbWluID0gZXh0cmFjdFJhbmdlU3RhcnRGcm9tTG9uZyhtaW5NYXgpOwotICAgICAgICAgICAgICAgICAgICBtYXggPSBleHRyYWN0UmFuZ2VFbmRGcm9tTG9uZyhtaW5NYXgpOwotICAgICAgICAgICAgICAgICAgICBTZWxlY3Rpb24uc2V0U2VsZWN0aW9uKChTcGFubmFibGUpIG1UZXh0LCBtYXgpOwotICAgICAgICAgICAgICAgICAgICAoKEVkaXRhYmxlKSBtVGV4dCkucmVwbGFjZShtaW4sIG1heCwgcGFzdGUpOwotICAgICAgICAgICAgICAgICAgICBzdG9wVGV4dFNlbGVjdGlvbk1vZGUoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0KICAgICAgICAgICAgIGNhc2UgSURfQ09QWV9VUkw6CiAgICAgICAgICAgICAgICAgVVJMU3BhbltdIHVybHMgPSAoKFNwYW5uZWQpIG1UZXh0KS5nZXRTcGFucyhtaW4sIG1heCwgVVJMU3Bhbi5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgaWYgKHVybHMubGVuZ3RoID09IDEpIHsKLSAgICAgICAgICAgICAgICAgICAgY2xpcC5zZXRUZXh0KHVybHNbMF0uZ2V0VVJMKCkpOworICAgICAgICAgICAgICAgIGlmICh1cmxzLmxlbmd0aCA+PSAxKSB7CisgICAgICAgICAgICAgICAgICAgIENsaXBEYXRhIGNsaXAgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8dXJscy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgVXJpIHVyaSA9IFVyaS5wYXJzZSh1cmxzWzBdLmdldFVSTCgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjbGlwID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGlwID0gQ2xpcERhdGEubmV3UmF3VXJpKG51bGwsIG51bGwsIHVyaSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaXAuYWRkSXRlbShuZXcgQ2xpcERhdGEuSXRlbSh1cmkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoY2xpcCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjbGlwYm9hcmQuc2V0UHJpbWFyeUNsaXAoY2xpcCk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAKLSAgICAgICAgICAgIGNhc2UgSURfU1dJVENIX0lOUFVUX01FVEhPRDoKLSAgICAgICAgICAgICAgICBJbnB1dE1ldGhvZE1hbmFnZXIgaW1tID0gSW5wdXRNZXRob2RNYW5hZ2VyLnBlZWtJbnN0YW5jZSgpOwotICAgICAgICAgICAgICAgIGlmIChpbW0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpbW0uc2hvd0lucHV0TWV0aG9kUGlja2VyKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotCi0gICAgICAgICAgICBjYXNlIElEX0FERF9UT19ESUNUSU9OQVJZOgotICAgICAgICAgICAgICAgIFN0cmluZyB3b3JkID0gZ2V0V29yZEZvckRpY3Rpb25hcnkoKTsKLSAgICAgICAgICAgICAgICBpZiAod29yZCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIEludGVudCBpID0gbmV3IEludGVudCgiY29tLmFuZHJvaWQuc2V0dGluZ3MuVVNFUl9ESUNUSU9OQVJZX0lOU0VSVCIpOwotICAgICAgICAgICAgICAgICAgICBpLnB1dEV4dHJhKCJ3b3JkIiwgd29yZCk7Ci0gICAgICAgICAgICAgICAgICAgIGkuc2V0RmxhZ3MoaS5nZXRGbGFncygpIHwgSW50ZW50LkZMQUdfQUNUSVZJVFlfTkVXX1RBU0spOwotICAgICAgICAgICAgICAgICAgICBnZXRDb250ZXh0KCkuc3RhcnRBY3Rpdml0eShpKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXNlIElEX1NFTEVDVElPTl9NT0RFOgorICAgICAgICAgICAgICAgIHN0YXJ0U2VsZWN0aW9uQWN0aW9uTW9kZSgpOwogICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgfQogCkBAIC03NjY0LDM1ICs3Njg0LDgxIEBACiAgICAgICAgICAgICBtRWF0VG91Y2hSZWxlYXNlID0gdHJ1ZTsKICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoc3RhcnRTZWxlY3Rpb25BY3Rpb25Nb2RlKCkpIHsKKyAgICAgICAgICAgIHBlcmZvcm1IYXB0aWNGZWVkYmFjayhIYXB0aWNGZWVkYmFja0NvbnN0YW50cy5MT05HX1BSRVNTKTsKKyAgICAgICAgICAgIG1FYXRUb3VjaFJlbGVhc2UgPSB0cnVlOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KIAogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogCi0gICAgcHJpdmF0ZSB2b2lkIHN0YXJ0VGV4dFNlbGVjdGlvbk1vZGUoKSB7Ci0gICAgICAgIGlmICghbUlzSW5UZXh0U2VsZWN0aW9uTW9kZSkgewotICAgICAgICAgICAgaWYgKG1TZWxlY3Rpb25Nb2RpZmllckN1cnNvckNvbnRyb2xsZXIgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJUZXh0VmlldyBoYXMgbm8gc2VsZWN0aW9uIGNvbnRyb2xsZXIuIEFjdGlvbiBtb2RlIGNhbmNlbGxlZC4iKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9CisgICAgcHJpdmF0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AgICAgICAgICAgIGhpZGVTZWxlY3Rpb25Nb2RpZmllckN1cnNvckNvbnRyb2xsZXIoKTsKLSAgICAgICAgICAgIG1Jc0luVGV4dFNlbGVjdGlvbk1vZGUgPSBmYWxzZTsKKyAgICBwcml2YXRlIHZvaWQgc3RvcFNlbGVjdGlvbkFjdGlvbk1vZGUoKSB7CisgICAgICAgIGlmIChtU2VsZWN0aW9uQWN0aW9uTW9kZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtU2VsZWN0aW9uQWN0aW9uTW9kZS5maW5pc2goKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFBhc3RlIGNsaXBib2FyZCBjb250ZW50IGJldHdlZW4gbWluIGFuZCBtYXggcG9zaXRpb25zLgorICAgICAqCisgICAgICogQHBhcmFtIGNsaXBib2FyZCBnZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuQ0xJUEJPQVJEX1NFUlZJQ0UpCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHBhc3RlKENsaXBib2FyZE1hbmFnZXIgY2xpcGJvYXJkLCBpbnQgbWluLCBpbnQgbWF4KSB7CisgICAgICAgIENsaXBEYXRhIGNsaXAgPSBjbGlwYm9hcmQuZ2V0UHJpbWFyeUNsaXAoKTsKKyAgICAgICAgaWYgKGNsaXAgIT0gbnVsbCkgeworICAgICAgICAgICAgYm9vbGVhbiBkaWRmaXJzdCA9IGZhbHNlOworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPGNsaXAuZ2V0SXRlbUNvdW50KCk7IGkrKykgeworICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBwYXN0ZSA9IGNsaXAuZ2V0SXRlbShpKS5jb2VyY2VUb1RleHQoZ2V0Q29udGV4dCgpKTsKKyAgICAgICAgICAgICAgICBpZiAocGFzdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIWRpZGZpcnN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsb25nIG1pbk1heCA9IHByZXBhcmVTcGFjZXNBcm91bmRQYXN0ZShtaW4sIG1heCwgcGFzdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgbWluID0gZXh0cmFjdFJhbmdlU3RhcnRGcm9tTG9uZyhtaW5NYXgpOworICAgICAgICAgICAgICAgICAgICAgICAgbWF4ID0gZXh0cmFjdFJhbmdlRW5kRnJvbUxvbmcobWluTWF4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNlbGVjdGlvbi5zZXRTZWxlY3Rpb24oKFNwYW5uYWJsZSkgbVRleHQsIG1heCk7CisgICAgICAgICAgICAgICAgICAgICAgICAoKEVkaXRhYmxlKSBtVGV4dCkucmVwbGFjZShtaW4sIG1heCwgcGFzdGUpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgKChFZGl0YWJsZSkgbVRleHQpLmluc2VydChnZXRTZWxlY3Rpb25FbmQoKSwgIlxuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAoKEVkaXRhYmxlKSBtVGV4dCkuaW5zZXJ0KGdldFNlbGVjdGlvbkVuZCgpLCBwYXN0ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzdG9wU2VsZWN0aW9uQWN0aW9uTW9kZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBTZWxlY3Rpb25BY3Rpb25Nb2RlQ2FsbGJhY2sgaW1wbGVtZW50cyBBY3Rpb25Nb2RlLkNhbGxiYWNrIHsKKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25DcmVhdGVBY3Rpb25Nb2RlKEFjdGlvbk1vZGUgbW9kZSwgTWVudSBtZW51KSB7CisgICAgICAgICAgICBpZiAobVNlbGVjdGlvbk1vZGlmaWVyQ3Vyc29yQ29udHJvbGxlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIlRleHRWaWV3IGhhcyBubyBzZWxlY3Rpb24gY29udHJvbGxlci4gQWN0aW9uIG1vZGUgY2FuY2VsbGVkLiIpOworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFyZXF1ZXN0Rm9jdXMoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgVHlwZWRBcnJheSBzdHlsZWRBdHRyaWJ1dGVzID0gbUNvbnRleHQub2J0YWluU3R5bGVkQXR0cmlidXRlcyhSLnN0eWxlYWJsZS5UaGVtZSk7CisKKyAgICAgICAgICAgIG1vZGUuc2V0VGl0bGUobUNvbnRleHQuZ2V0U3RyaW5nKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnRleHRTZWxlY3Rpb25DQUJUaXRsZSkpOworICAgICAgICAgICAgbW9kZS5zZXRTdWJ0aXRsZShudWxsKTsKKworICAgICAgICAgICAgYm9vbGVhbiBhdExlYXN0T25lID0gZmFsc2U7CisKKyAgICAgICAgICAgIGlmIChjYW5TZWxlY3RUZXh0KCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoaGFzUGFzc3dvcmRUcmFuc2Zvcm1hdGlvbk1ldGhvZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHNlbGVjdEN1cnJlbnRXb3JkIGlzIG5vdCBhdmFpbGFibGUgb24gYSBwYXNzd29yZCBmaWVsZCBhbmQgd291bGQgcmV0dXJuIGFuCisgICAgICAgICAgICAgICAgICAgIC8vIGFyYml0cmFyeSAxMC1jaGFyYXRlciBzZWxlY3Rpb24gYXJvdW5kIHByZXNzZWQgcG9zaXRpb24uIFNlbGVjdCBhbGwgaW5zdGVhZC4KKyAgICAgICAgICAgICAgICAgICAgU2VsZWN0aW9uLnNldFNlbGVjdGlvbigoU3Bhbm5hYmxlKSBtVGV4dCwgMCwgbVRleHQubGVuZ3RoKCkpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGVjdEN1cnJlbnRXb3JkKCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgbWVudS5hZGQoMCwgSURfU0VMRUNUX0FMTCwgMCwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuc2VsZWN0QWxsKS4KKyAgICAgICAgICAgICAgICAgICAgc2V0QWxwaGFiZXRpY1Nob3J0Y3V0KCdhJykuCisgICAgICAgICAgICAgICAgICAgIHNldFNob3dBc0FjdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZW51SXRlbS5TSE9XX0FTX0FDVElPTl9BTFdBWVMgfCBNZW51SXRlbS5TSE9XX0FTX0FDVElPTl9XSVRIX1RFWFQpOworICAgICAgICAgICAgICAgIGF0TGVhc3RPbmUgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoY2FuQ3V0KCkpIHsKKyAgICAgICAgICAgICAgICBtZW51LmFkZCgwLCBJRF9DVVQsIDAsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmN1dCkuCisgICAgICAgICAgICAgICAgICAgIHNldEljb24oc3R5bGVkQXR0cmlidXRlcy5nZXRSZXNvdXJjZUlkKFIuc3R5bGVhYmxlLlRoZW1lX2FjdGlvbk1vZGVDdXREcmF3YWJsZSwgMCkpLgorICAgICAgICAgICAgICAgICAgICBzZXRBbHBoYWJldGljU2hvcnRjdXQoJ3gnKS4KKyAgICAgICAgICAgICAgICAgICAgc2V0U2hvd0FzQWN0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1lbnVJdGVtLlNIT1dfQVNfQUNUSU9OX0FMV0FZUyB8IE1lbnVJdGVtLlNIT1dfQVNfQUNUSU9OX1dJVEhfVEVYVCk7CisgICAgICAgICAgICAgICAgYXRMZWFzdE9uZSA9IHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChjYW5Db3B5KCkpIHsKKyAgICAgICAgICAgICAgICBtZW51LmFkZCgwLCBJRF9DT1BZLCAwLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5jb3B5KS4KKyAgICAgICAgICAgICAgICAgICAgc2V0SWNvbihzdHlsZWRBdHRyaWJ1dGVzLmdldFJlc291cmNlSWQoUi5zdHlsZWFibGUuVGhlbWVfYWN0aW9uTW9kZUNvcHlEcmF3YWJsZSwgMCkpLgorICAgICAgICAgICAgICAgICAgICBzZXRBbHBoYWJldGljU2hvcnRjdXQoJ2MnKS4KKyAgICAgICAgICAgICAgICAgICAgc2V0U2hvd0FzQWN0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1lbnVJdGVtLlNIT1dfQVNfQUNUSU9OX0FMV0FZUyB8IE1lbnVJdGVtLlNIT1dfQVNfQUNUSU9OX1dJVEhfVEVYVCk7CisgICAgICAgICAgICAgICAgYXRMZWFzdE9uZSA9IHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChjYW5QYXN0ZSgpKSB7CisgICAgICAgICAgICAgICAgbWVudS5hZGQoMCwgSURfUEFTVEUsIDAsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnBhc3RlKS4KKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEljb24oc3R5bGVkQXR0cmlidXRlcy5nZXRSZXNvdXJjZUlkKFIuc3R5bGVhYmxlLlRoZW1lX2FjdGlvbk1vZGVQYXN0ZURyYXdhYmxlLCAwKSkuCisgICAgICAgICAgICAgICAgICAgICAgICBzZXRBbHBoYWJldGljU2hvcnRjdXQoJ3YnKS4KKyAgICAgICAgICAgICAgICAgICAgICAgIHNldFNob3dBc0FjdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWVudUl0ZW0uU0hPV19BU19BQ1RJT05fQUxXQVlTIHwgTWVudUl0ZW0uU0hPV19BU19BQ1RJT05fV0lUSF9URVhUKTsKKyAgICAgICAgICAgICAgICBhdExlYXN0T25lID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3R5bGVkQXR0cmlidXRlcy5yZWN5Y2xlKCk7CisKKyAgICAgICAgICAgIGlmIChhdExlYXN0T25lKSB7CisgICAgICAgICAgICAgICAgbVNlbGVjdGlvbk1vZGlmaWVyQ3Vyc29yQ29udHJvbGxlci5zaG93KCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBvblByZXBhcmVBY3Rpb25Nb2RlKEFjdGlvbk1vZGUgbW9kZSwgTWVudSBtZW51KSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbkFjdGlvbkl0ZW1DbGlja2VkKEFjdGlvbk1vZGUgbW9kZSwgTWVudUl0ZW0gaXRlbSkgeworICAgICAgICAgICAgZmluYWwgaW50IGl0ZW1JZCA9IGl0ZW0uZ2V0SXRlbUlkKCk7CisKKyAgICAgICAgICAgIGlmIChpdGVtSWQgPT0gSURfU0VMRUNUX0FMTCkgeworICAgICAgICAgICAgICAgIFNlbGVjdGlvbi5zZXRTZWxlY3Rpb24oKFNwYW5uYWJsZSkgbVRleHQsIDAsIG1UZXh0Lmxlbmd0aCgpKTsKKyAgICAgICAgICAgICAgICAvLyBVcGRhdGUgY29udHJvbGxlciBwb3NpdGlvbnMgYWZ0ZXIgc2VsZWN0aW9uIGNoYW5nZS4KKyAgICAgICAgICAgICAgICBpZiAobVNlbGVjdGlvbk1vZGlmaWVyQ3Vyc29yQ29udHJvbGxlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1TZWxlY3Rpb25Nb2RpZmllckN1cnNvckNvbnRyb2xsZXIuc2hvdygpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQ2xpcGJvYXJkTWFuYWdlciBjbGlwYm9hcmQgPSAoQ2xpcGJvYXJkTWFuYWdlcikgZ2V0Q29udGV4dCgpLgorICAgICAgICAgICAgICAgICAgICBnZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuQ0xJUEJPQVJEX1NFUlZJQ0UpOworCisgICAgICAgICAgICBpbnQgbWluID0gMDsKKyAgICAgICAgICAgIGludCBtYXggPSBtVGV4dC5sZW5ndGgoKTsKKworICAgICAgICAgICAgaWYgKGlzRm9jdXNlZCgpKSB7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IHNlbFN0YXJ0ID0gZ2V0U2VsZWN0aW9uU3RhcnQoKTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgc2VsRW5kID0gZ2V0U2VsZWN0aW9uRW5kKCk7CisKKyAgICAgICAgICAgICAgICBtaW4gPSBNYXRoLm1heCgwLCBNYXRoLm1pbihzZWxTdGFydCwgc2VsRW5kKSk7CisgICAgICAgICAgICAgICAgbWF4ID0gTWF0aC5tYXgoMCwgTWF0aC5tYXgoc2VsU3RhcnQsIHNlbEVuZCkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzd2l0Y2ggKGl0ZW0uZ2V0SXRlbUlkKCkpIHsKKyAgICAgICAgICAgICAgICBjYXNlIElEX1BBU1RFOgorICAgICAgICAgICAgICAgICAgICBwYXN0ZShjbGlwYm9hcmQsIG1pbiwgbWF4KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisKKyAgICAgICAgICAgICAgICBjYXNlIElEX0NVVDoKKyAgICAgICAgICAgICAgICAgICAgY2xpcGJvYXJkLnNldFByaW1hcnlDbGlwKENsaXBEYXRhLm5ld1BsYWluVGV4dChudWxsLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFuc2Zvcm1lZC5zdWJTZXF1ZW5jZShtaW4sIG1heCkpKTsKKyAgICAgICAgICAgICAgICAgICAgKChFZGl0YWJsZSkgbVRleHQpLmRlbGV0ZShtaW4sIG1heCk7CisgICAgICAgICAgICAgICAgICAgIHN0b3BTZWxlY3Rpb25BY3Rpb25Nb2RlKCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworCisgICAgICAgICAgICAgICAgY2FzZSBJRF9DT1BZOgorICAgICAgICAgICAgICAgICAgICBjbGlwYm9hcmQuc2V0UHJpbWFyeUNsaXAoQ2xpcERhdGEubmV3UGxhaW5UZXh0KG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRyYW5zZm9ybWVkLnN1YlNlcXVlbmNlKG1pbiwgbWF4KSkpOworICAgICAgICAgICAgICAgICAgICBzdG9wU2VsZWN0aW9uQWN0aW9uTW9kZSgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uRGVzdHJveUFjdGlvbk1vZGUoQWN0aW9uTW9kZSBtb2RlKSB7CisgICAgICAgICAgICBTZWxlY3Rpb24uc2V0U2VsZWN0aW9uKChTcGFubmFibGUpIG1UZXh0LCBnZXRTZWxlY3Rpb25TdGFydCgpKTsKKyAgICAgICAgICAgIGlmIChtU2VsZWN0aW9uTW9kaWZpZXJDdXJzb3JDb250cm9sbGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtU2VsZWN0aW9uTW9kaWZpZXJDdXJzb3JDb250cm9sbGVyLmhpZGUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1TZWxlY3Rpb25BY3Rpb25Nb2RlID0gbnVsbDsKICAgICAgICAgfQogICAgIH0KIApAQCAtNzc0Niw2ICs3OTc1LDEwMCBAQAogICAgICAgICBwdWJsaWMgYm9vbGVhbiBvblRvdWNoRXZlbnQoTW90aW9uRXZlbnQgZXZlbnQpOwogICAgIH0KIAorICAgIHByaXZhdGUgY2xhc3MgUGFzdGVQb3B1cE1lbnUgaW1wbGVtZW50cyBPbkNsaWNrTGlzdGVuZXIgeworICAgICAgICBwcml2YXRlIFBvcHVwV2luZG93IG1Db250YWluZXI7CisgICAgICAgIHByaXZhdGUgaW50IG1Qb3NpdGlvblg7CisgICAgICAgIHByaXZhdGUgaW50IG1Qb3NpdGlvblk7CisgICAgICAgIHByaXZhdGUgVmlldyBtUGFzdGVWaWV3LCBtTm9QYXN0ZVZpZXc7CisKKyAgICAgICAgcHVibGljIFBhc3RlUG9wdXBNZW51KCkgeworICAgICAgICAgICAgbUNvbnRhaW5lciA9IG5ldyBQb3B1cFdpbmRvdyhUZXh0Vmlldy50aGlzLm1Db250ZXh0LCBudWxsLAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmF0dHIudGV4dFNlbGVjdEhhbmRsZVdpbmRvd1N0eWxlKTsKKyAgICAgICAgICAgIG1Db250YWluZXIuc2V0U3BsaXRUb3VjaEVuYWJsZWQodHJ1ZSk7CisgICAgICAgICAgICBtQ29udGFpbmVyLnNldENsaXBwaW5nRW5hYmxlZChmYWxzZSk7CisgICAgICAgICAgICBtQ29udGFpbmVyLnNldFdpbmRvd0xheW91dFR5cGUoV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuVFlQRV9BUFBMSUNBVElPTl9TVUJfUEFORUwpOworCisgICAgICAgICAgICBtQ29udGFpbmVyLnNldFdpZHRoKFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKTsKKyAgICAgICAgICAgIG1Db250YWluZXIuc2V0SGVpZ2h0KFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCB1cGRhdGVDb250ZW50KCkgeworICAgICAgICAgICAgVmlldyB2aWV3ID0gY2FuUGFzdGUoKSA/IG1QYXN0ZVZpZXcgOiBtTm9QYXN0ZVZpZXc7CisKKyAgICAgICAgICAgIGlmICh2aWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbGF5b3V0ID0gY2FuUGFzdGUoKSA/IG1UZXh0RWRpdFBhc3RlV2luZG93TGF5b3V0IDoKKyAgICAgICAgICAgICAgICAgICAgbVRleHRFZGl0Tm9QYXN0ZVdpbmRvd0xheW91dDsKKyAgICAgICAgICAgICAgICBMYXlvdXRJbmZsYXRlciBpbmZsYXRlciA9IChMYXlvdXRJbmZsYXRlcilUZXh0Vmlldy50aGlzLm1Db250ZXh0LgorICAgICAgICAgICAgICAgICAgICBnZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuTEFZT1VUX0lORkxBVEVSX1NFUlZJQ0UpOworICAgICAgICAgICAgICAgIGlmIChpbmZsYXRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHZpZXcgPSBpbmZsYXRlci5pbmZsYXRlKGxheW91dCwgbnVsbCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmFibGUgdG8gaW5mbGF0ZSBUZXh0RWRpdCBwYXN0ZSB3aW5kb3ciKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgc2l6ZSA9IFZpZXcuTWVhc3VyZVNwZWMubWFrZU1lYXN1cmVTcGVjKDAsIFZpZXcuTWVhc3VyZVNwZWMuVU5TUEVDSUZJRUQpOworICAgICAgICAgICAgICAgIHZpZXcuc2V0TGF5b3V0UGFyYW1zKG5ldyBMYXlvdXRQYXJhbXMoVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsCisgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCkpOworICAgICAgICAgICAgICAgIHZpZXcubWVhc3VyZShzaXplLCBzaXplKTsKKworICAgICAgICAgICAgICAgIHZpZXcuc2V0T25DbGlja0xpc3RlbmVyKHRoaXMpOworCisgICAgICAgICAgICAgICAgaWYgKGNhblBhc3RlKCkpIG1QYXN0ZVZpZXcgPSB2aWV3OworICAgICAgICAgICAgICAgIGVsc2UgbU5vUGFzdGVWaWV3ID0gdmlldzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbUNvbnRhaW5lci5zZXRDb250ZW50Vmlldyh2aWV3KTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgICAgICB1cGRhdGVDb250ZW50KCk7CisgICAgICAgICAgICBmaW5hbCBpbnRbXSBjb29yZHMgPSBtVGVtcENvb3JkczsKKyAgICAgICAgICAgIFRleHRWaWV3LnRoaXMuZ2V0TG9jYXRpb25JbldpbmRvdyhjb29yZHMpOworICAgICAgICAgICAgcG9zaXRpb25BdEN1cnNvcigpOworICAgICAgICAgICAgY29vcmRzWzBdICs9IG1Qb3NpdGlvblg7CisgICAgICAgICAgICBjb29yZHNbMV0gKz0gbVBvc2l0aW9uWTsKKyAgICAgICAgICAgIG1Db250YWluZXIuc2hvd0F0TG9jYXRpb24oVGV4dFZpZXcudGhpcywgR3Jhdml0eS5OT19HUkFWSVRZLCBjb29yZHNbMF0sIGNvb3Jkc1sxXSk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBoaWRlKCkgeworICAgICAgICAgICAgbUNvbnRhaW5lci5kaXNtaXNzKCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc1Nob3dpbmcoKSB7CisgICAgICAgICAgICByZXR1cm4gbUNvbnRhaW5lci5pc1Nob3dpbmcoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgQ2xpcGJvYXJkTWFuYWdlciBjbGlwYm9hcmQgPSAKKyAgICAgICAgICAgICAgICAoQ2xpcGJvYXJkTWFuYWdlcikgZ2V0Q29udGV4dCgpLmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5DTElQQk9BUkRfU0VSVklDRSk7CisgICAgICAgICAgICBwYXN0ZShjbGlwYm9hcmQsIGdldFNlbGVjdGlvblN0YXJ0KCksIGdldFNlbGVjdGlvbkVuZCgpKTsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgcG9zaXRpb25BdEN1cnNvcigpIHsKKyAgICAgICAgICAgIGZpbmFsIGludCBvZmZzZXQgPSBUZXh0Vmlldy50aGlzLmdldFNlbGVjdGlvblN0YXJ0KCk7CisgICAgICAgICAgICBWaWV3IGNvbnRlbnRWaWV3ID0gbUNvbnRhaW5lci5nZXRDb250ZW50VmlldygpOworICAgICAgICAgICAgZmluYWwgaW50IHdpZHRoID0gY29udGVudFZpZXcuZ2V0TWVhc3VyZWRXaWR0aCgpOworICAgICAgICAgICAgZmluYWwgaW50IGhlaWdodCA9IGNvbnRlbnRWaWV3LmdldE1lYXN1cmVkSGVpZ2h0KCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgbGluZSA9IG1MYXlvdXQuZ2V0TGluZUZvck9mZnNldChvZmZzZXQpOworICAgICAgICAgICAgZmluYWwgaW50IGxpbmVUb3AgPSBtTGF5b3V0LmdldExpbmVUb3AobGluZSk7CisKKyAgICAgICAgICAgIGZpbmFsIFJlY3QgYm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CiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IExFRlQgPSAwOwogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBDRU5URVIgPSAxOwpAQCAtNzc4OSw3ICs4MTE1LDcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgbURyYXdhYmxlID0gbVNlbGVjdEhhbmRsZUxlZnQ7CiAgICAgICAgICAgICAgICAgaGFuZGxlV2lkdGggPSBtRHJhd2FibGUuZ2V0SW50cmluc2ljV2lkdGgoKTsKLSAgICAgICAgICAgICAgICBtSG90c3BvdFggPSBoYW5kbGVXaWR0aCAvIDQgKiAzOworICAgICAgICAgICAgICAgIG1Ib3RzcG90WCA9IChoYW5kbGVXaWR0aCAqIDMpIC8gNDsKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KIApAQCAtNzgxMyw2ICs4MTM5LDcgQEAKICAgICAgICAgICAgICAgICBtRHJhd2FibGUgPSBtU2VsZWN0SGFuZGxlQ2VudGVyOwogICAgICAgICAgICAgICAgIGhhbmRsZVdpZHRoID0gbURyYXdhYmxlLmdldEludHJpbnNpY1dpZHRoKCk7CiAgICAgICAgICAgICAgICAgbUhvdHNwb3RYID0gaGFuZGxlV2lkdGggLyAyOworICAgICAgICAgICAgICAgIG1QYXN0ZVBvcHVwV2luZG93ID0gbmV3IFBhc3RlUG9wdXBNZW51KCk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC03ODI2LDcgKzgxNTMsNyBAQAogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uTWVhc3VyZShpbnQgd2lkdGhNZWFzdXJlU3BlYywgaW50IGhlaWdodE1lYXN1cmVTcGVjKSB7CisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uTWVhc3VyZShpbnQgd2lkdGhNZWFzdXJlU3BlYywgaW50IGhlaWdodE1lYXN1cmVTcGVjKSB7CiAgICAgICAgICAgICBzZXRNZWFzdXJlZERpbWVuc2lvbihtRHJhd2FibGUuZ2V0SW50cmluc2ljV2lkdGgoKSwKICAgICAgICAgICAgICAgICAgICAgbURyYXdhYmxlLmdldEludHJpbnNpY0hlaWdodCgpKTsKICAgICAgICAgfQpAQCAtNzgzOSwxNCArODE2NiwyMiBAQAogICAgICAgICAgICAgbUNvbnRhaW5lci5zZXRDb250ZW50Vmlldyh0aGlzKTsKICAgICAgICAgICAgIGZpbmFsIGludFtdIGNvb3JkcyA9IG1UZW1wQ29vcmRzOwogICAgICAgICAgICAgVGV4dFZpZXcudGhpcy5nZXRMb2NhdGlvbkluV2luZG93KGNvb3Jkcyk7Ci0gICAgICAgICAgICBjb29yZHNbMF0gKz0gbVBvc2l0aW9uWDsKLSAgICAgICAgICAgIGNvb3Jkc1sxXSArPSBtUG9zaXRpb25ZOwotICAgICAgICAgICAgbUNvbnRhaW5lci5zaG93QXRMb2NhdGlvbihUZXh0Vmlldy50aGlzLCAwLCBjb29yZHNbMF0sIGNvb3Jkc1sxXSk7CisgICAgICAgICAgICBtQ29udGFpbmVyUG9zaXRpb25YID0gY29vcmRzWzBdICsgbVBvc2l0aW9uWDsKKyAgICAgICAgICAgIG1Db250YWluZXJQb3NpdGlvblkgPSBjb29yZHNbMV0gKyBtUG9zaXRpb25ZOworICAgICAgICAgICAgbUNvbnRhaW5lci5zaG93QXRMb2NhdGlvbihUZXh0Vmlldy50aGlzLCAwLCBtQ29udGFpbmVyUG9zaXRpb25YLCBtQ29udGFpbmVyUG9zaXRpb25ZKTsKKworICAgICAgICAgICAgLy8gSGlkZSBwYXN0ZSB2aWV3IHdoZW4gaGFuZGxlIGlzIG1vdmVkLgorICAgICAgICAgICAgaWYgKG1QYXN0ZVBvcHVwV2luZG93ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtUGFzdGVQb3B1cFdpbmRvdy5oaWRlKCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBwdWJsaWMgdm9pZCBoaWRlKCkgewogICAgICAgICAgICAgbUlzRHJhZ2dpbmcgPSBmYWxzZTsKICAgICAgICAgICAgIG1Db250YWluZXIuZGlzbWlzcygpOworICAgICAgICAgICAgaWYgKG1QYXN0ZVBvcHVwV2luZG93ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtUGFzdGVQb3B1cFdpbmRvdy5oaWRlKCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc1Nob3dpbmcoKSB7CkBAIC03OTAxLDggKzgyMzYsMjIgQEAKICAgICAgICAgICAgICAgICBpZiAobUNvbnRhaW5lci5pc1Nob3dpbmcoKSl7CiAgICAgICAgICAgICAgICAgICAgIGNvb3JkcyA9IG1UZW1wQ29vcmRzOwogICAgICAgICAgICAgICAgICAgICBUZXh0Vmlldy50aGlzLmdldExvY2F0aW9uSW5XaW5kb3coY29vcmRzKTsKLSAgICAgICAgICAgICAgICAgICAgbUNvbnRhaW5lci51cGRhdGUoY29vcmRzWzBdICsgbVBvc2l0aW9uWCwgY29vcmRzWzFdICsgbVBvc2l0aW9uWSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmlnaHQgLSBtTGVmdCwgbUJvdHRvbSAtIG1Ub3ApOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgY29udGFpbmVyUG9zaXRpb25YID0gY29vcmRzWzBdICsgbVBvc2l0aW9uWDsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGNvbnRhaW5lclBvc2l0aW9uWSA9IGNvb3Jkc1sxXSArIG1Qb3NpdGlvblk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5lclBvc2l0aW9uWCAhPSBtQ29udGFpbmVyUG9zaXRpb25YIHx8IAorICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyUG9zaXRpb25ZICE9IG1Db250YWluZXJQb3NpdGlvblkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250YWluZXJQb3NpdGlvblggPSBjb250YWluZXJQb3NpdGlvblg7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGFpbmVyUG9zaXRpb25ZID0gY29udGFpbmVyUG9zaXRpb25ZOworCisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGFpbmVyLnVwZGF0ZShtQ29udGFpbmVyUG9zaXRpb25YLCBtQ29udGFpbmVyUG9zaXRpb25ZLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmlnaHQgLSBtTGVmdCwgbUJvdHRvbSAtIG1Ub3ApOworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBIaWRlIHBhc3RlIHBvcHVwIHdpbmRvdyBhcyBzb29uIGFzIGEgc2Nyb2xsIG9jY3Vycy4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtUGFzdGVQb3B1cFdpbmRvdyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBhc3RlUG9wdXBXaW5kb3cuaGlkZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgc2hvdygpOwogICAgICAgICAgICAgICAgIH0KQEAgLTc5MTgsNiArODI2NywxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RQYXJlbnRYID0gY29vcmRzWzBdOwogICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RQYXJlbnRZID0gY29vcmRzWzFdOwogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIEhpZGUgcGFzdGUgcG9wdXAgd2luZG93IGFzIHNvb24gYXMgdGhlIGhhbmRsZSBpcyBkcmFnZ2VkLgorICAgICAgICAgICAgICAgICAgICBpZiAobVBhc3RlUG9wdXBXaW5kb3cgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVBhc3RlUG9wdXBXaW5kb3cuaGlkZSgpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBoaWRlKCk7CkBAIC03OTI1LDcgKzgyNzgsNyBAQAogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uRHJhdyhDYW52YXMgYykgeworICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXcoQ2FudmFzIGMpIHsKICAgICAgICAgICAgIG1EcmF3YWJsZS5zZXRCb3VuZHMoMCwgMCwgbVJpZ2h0IC0gbUxlZnQsIG1Cb3R0b20gLSBtVG9wKTsKICAgICAgICAgICAgIGlmIChtUG9zaXRpb25PblRvcCkgewogICAgICAgICAgICAgICAgIGMuc2F2ZSgpOwpAQCAtNzk1MCw2ICs4MzAzLDE1IEBACiAgICAgICAgICAgICAgICAgbUxhc3RQYXJlbnRYID0gY29vcmRzWzBdOwogICAgICAgICAgICAgICAgIG1MYXN0UGFyZW50WSA9IGNvb3Jkc1sxXTsKICAgICAgICAgICAgICAgICBtSXNEcmFnZ2luZyA9IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKG1QYXN0ZVBvcHVwV2luZG93ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVRvdWNoVGltZXIgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1QYXN0ZVBvcHVwV2luZG93LmlzU2hvd2luZygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBUYXBwaW5nIG9uIHRoZSBoYW5kbGUgYWdhaW4gZGlzbWlzc2VzIHRoZSBkaXNwbGF5ZWQgcGFzdGUgdmlldywKKyAgICAgICAgICAgICAgICAgICAgICAgIG1QYXN0ZVBvcHVwV2luZG93LmhpZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFuZCBtYWtlcyBzdXJlIHRoZSBhY3Rpb24gdXAgZG9lcyBub3QgZGlzcGxheSB0aGUgcGFzdGUgdmlldy4KKyAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaFRpbWVyID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX01PVkU6IHsKQEAgLTc5NjMsNiArODMyNSwyNCBAQAogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fVVA6CisgICAgICAgICAgICAgICAgaWYgKG1QYXN0ZVBvcHVwV2luZG93ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyBkZWxheSA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpIC0gbVRvdWNoVGltZXI7CisgICAgICAgICAgICAgICAgICAgIGlmIChkZWxheSA8IFZpZXdDb25maWd1cmF0aW9uLmdldFRhcFRpbWVvdXQoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgdG91Y2hPZmZzZXRYID0gZXYuZ2V0UmF3WCgpIC0gbVBvc2l0aW9uWDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGZsb2F0IHRvdWNoT2Zmc2V0WSA9IGV2LmdldFJhd1koKSAtIG1Qb3NpdGlvblk7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBmbG9hdCBkeCA9IHRvdWNoT2Zmc2V0WCAtIG1Ub3VjaFRvV2luZG93T2Zmc2V0WDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGZsb2F0IGR5ID0gdG91Y2hPZmZzZXRZIC0gbVRvdWNoVG9XaW5kb3dPZmZzZXRZOworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgZGlzdGFuY2VTcXVhcmVkID0gZHggKiBkeCArIGR5ICogZHk7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBWaWV3Q29uZmlndXJhdGlvbiB2aWV3Q29uZmlndXJhdGlvbiA9IFZpZXdDb25maWd1cmF0aW9uLmdldChnZXRDb250ZXh0KCkpOworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGRvdWJsZVRhcFNsb3AgPSB2aWV3Q29uZmlndXJhdGlvbi5nZXRTY2FsZWREb3VibGVUYXBTbG9wKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgc2xvcFNxdWFyZWQgPSBkb3VibGVUYXBTbG9wICogZG91YmxlVGFwU2xvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXN0YW5jZVNxdWFyZWQgPCBzbG9wU3F1YXJlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QYXN0ZVBvcHVwV2luZG93LnNob3coKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtSXNEcmFnZ2luZyA9IGZhbHNlOworICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fQ0FOQ0VMOgogICAgICAgICAgICAgICAgIG1Jc0RyYWdnaW5nID0gZmFsc2U7CiAgICAgICAgICAgICB9CkBAIC04MDcyLDYgKzg0NTIsMTEgQEAKICAgICAgICAgLy8gV2hldGhlciBzZWxlY3Rpb24gYW5jaG9ycyBhcmUgYWN0aXZlCiAgICAgICAgIHByaXZhdGUgYm9vbGVhbiBtSXNTaG93aW5nOwogCisgICAgICAgIC8vIERvdWJsZSB0YXAgZGV0ZWN0aW9uCisgICAgICAgIHByaXZhdGUgbG9uZyBtUHJldmlvdXNUYXBVcFRpbWUgPSAwOworICAgICAgICBwcml2YXRlIGludCBtUHJldmlvdXNUYXBQb3NpdGlvblg7CisgICAgICAgIHByaXZhdGUgaW50IG1QcmV2aW91c1RhcFBvc2l0aW9uWTsKKwogICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgREVMQVlfQkVGT1JFX0ZBREVfT1VUID0gNDEwMDsKIAogICAgICAgICBwcml2YXRlIGZpbmFsIFJ1bm5hYmxlIG1IaWRlciA9IG5ldyBSdW5uYWJsZSgpIHsKQEAgLTgxNzcsNiArODU2MiwyNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgZmluZ2VyIGRvd24gcG9zaXRpb24sIHRvIGJlIGFibGUgdG8gc3RhcnQgc2VsZWN0aW9uIGZyb20gdGhlcmUKICAgICAgICAgICAgICAgICAgICAgICAgIG1NaW5Ub3VjaE9mZnNldCA9IG1NYXhUb3VjaE9mZnNldCA9IGdldE9mZnNldCh4LCB5KTsKIAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG91YmxlIHRhcCBkZXRlY3Rpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgZHVyYXRpb24gPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSAtIG1QcmV2aW91c1RhcFVwVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkdXJhdGlvbiA8PSBWaWV3Q29uZmlndXJhdGlvbi5nZXREb3VibGVUYXBUaW1lb3V0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZGVsdGFYID0geCAtIG1QcmV2aW91c1RhcFBvc2l0aW9uWDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZGVsdGFZID0geSAtIG1QcmV2aW91c1RhcFBvc2l0aW9uWTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZGlzdGFuY2VTcXVhcmVkID0gZGVsdGFYICogZGVsdGFYICsgZGVsdGFZICogZGVsdGFZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBkb3VibGVUYXBTbG9wID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0NvbmZpZ3VyYXRpb24uZ2V0KGdldENvbnRleHQoKSkuZ2V0U2NhbGVkRG91YmxlVGFwU2xvcCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBzbG9wU3F1YXJlZCA9IGRvdWJsZVRhcFNsb3AgKiBkb3VibGVUYXBTbG9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXN0YW5jZVNxdWFyZWQgPCBzbG9wU3F1YXJlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydFNlbGVjdGlvbkFjdGlvbk1vZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSGFja3k6IG9uVGFwVXBFdmVudCB3aWxsIG9wZW4gYSBjb250ZXh0IG1lbnUgd2l0aCBjdXQvY29weQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBQcmV2ZW50IHRoaXMgYnkgaGlkaW5nIGhhbmRsZXMgd2hpY2ggd2lsbCBiZSByZXZpdmVkIGluc3RlYWQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c1RhcFBvc2l0aW9uWCA9IHg7CisgICAgICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNUYXBQb3NpdGlvblkgPSB5OworCiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX0RPV046CkBAIC04MTg4LDYgKzg1OTMsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVNaW5BbmRNYXhPZmZzZXRzKGV2ZW50KTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1VQOgorICAgICAgICAgICAgICAgICAgICAgICAgbVByZXZpb3VzVGFwVXBUaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CkBAIC04MzEwLDcgKzg3MTksOCBAQAogICAgICAgICByZXR1cm4gZ2V0T2Zmc2V0Rm9ySG9yaXpvbnRhbChsaW5lLCB4KTsKICAgICB9CiAKLSAgICBAVmlld0RlYnVnLkV4cG9ydGVkUHJvcGVydHkKKworICAgIEBWaWV3RGVidWcuRXhwb3J0ZWRQcm9wZXJ0eShjYXRlZ29yeSA9ICJ0ZXh0IikKICAgICBwcml2YXRlIENoYXJTZXF1ZW5jZSAgICAgICAgICAgIG1UZXh0OwogICAgIHByaXZhdGUgQ2hhclNlcXVlbmNlICAgICAgICAgICAgbVRyYW5zZm9ybWVkOwogICAgIHByaXZhdGUgQnVmZmVyVHlwZSAgICAgICAgICAgICAgbUJ1ZmZlclR5cGUgPSBCdWZmZXJUeXBlLk5PUk1BTDsKQEAgLTgzNDEsNyArODc1MSw3IEBACiAgICAgLy8gQ3Vyc29yIENvbnRyb2xsZXJzLiBOdWxsIHdoZW4gZGlzYWJsZWQuCiAgICAgcHJpdmF0ZSBDdXJzb3JDb250cm9sbGVyICAgICAgICBtSW5zZXJ0aW9uUG9pbnRDdXJzb3JDb250cm9sbGVyOwogICAgIH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zaWVudCBwaWVjZSBvZiBpbmZvcm1hdGlvbiB0byB0aGUgdXNlcgorICAgICAgICBBY2Nlc3NpYmlsaXR5RXZlbnQgZXZlbnQgPSBBY2Nlc3NpYmlsaXR5RXZlbnQub2J0YWluKAorICAgICAgICAgICAgICAgIEFjY2Vzc2liaWxpdHlFdmVudC5UWVBFX05PVElGSUNBVElPTl9TVEFURV9DSEFOR0VEKTsKKyAgICAgICAgZXZlbnQuc2V0Q2xhc3NOYW1lKGdldENsYXNzKCkuZ2V0TmFtZSgpKTsKKyAgICAgICAgZXZlbnQuc2V0UGFja2FnZU5hbWUobUNvbnRleHQuZ2V0UGFja2FnZU5hbWUoKSk7CisgICAgICAgIG1WaWV3LmRpc3BhdGNoUG9wdWxhdGVBY2Nlc3NpYmlsaXR5RXZlbnQoZXZlbnQpOworICAgICAgICBhY2Nlc3NpYmlsaXR5TWFuYWdlci5zZW5kQWNjZXNzaWJpbGl0eUV2ZW50KGV2ZW50KTsKKyAgICB9CisKICAgICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgICAvLyBBbGwgdGhlIGd1bmsgYmVsb3cgaXMgdGhlIGludGVyYWN0aW9uIHdpdGggdGhlIE5vdGlmaWNhdGlvbiBTZXJ2aWNlLCB3aGljaCBoYW5kbGVzCiAgICAgLy8gdGhlIHByb3BlciBvcmRlcmluZyBvZiB0aGVzZSBzeXN0ZW0td2lkZS4KQEAgLTM3MSw2ICszODgsNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAobG9jYWxMT0dWKSBMb2cudihUQUcsICJBREQhICIgKyBtVmlldyArICIgaW4gIiArIHRoaXMpOwogICAgICAgICAgICAgICAgIG1XTS5hZGRWaWV3KG1WaWV3LCBtUGFyYW1zKTsKKyAgICAgICAgICAgICAgICB0cnlTZW5kQWNjZXNzaWJpbGl0eUV2Z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dXNlOwogICAgIHByaXZhdGUgYm9vbGVhbiAgICAgbUNhblNlZWtCYWNrOwogICAgIHByaXZhdGUgYm9vbGVhbiAgICAgbUNhblNlZWtGb3J3YXJkOwotICAgIHByaXZhdGUgaW50ICAgICAgICAgbVN0YXRlV2hlblN1c3BlbmRlZDsgIC8vc3RhdGUgYmVmb3JlIGNhbGxpbmcgc3VzcGVuZCgpCiAKICAgICBwdWJsaWMgVmlkZW9WaWV3KENvbnRleHQgY29udGV4dCkgewogICAgICAgICBzdXBlcihjb250ZXh0KTsKQEAgLTQ3MCwxNCArNDY2LDcgQEAKICAgICAgICAgcHVibGljIHZvaWQgc3VyZmFjZUNyZWF0ZWQoU3VyZmFjZUhvbGRlciBob2xkZXIpCiAgICAgICAgIHsKICAgICAgICAgICAgIG1TdXJmYWNlSG9sZGVyID0gaG9sZGVyOwotICAgICAgICAgICAgLy9yZXN1bWUoKSB3YXMgY2FsbGVkIGJlZm9yZSBzdXJmYWNlQ3JlYXRlZCgpCi0gICAgICAgICAgICBpZiAobU1lZGlhUGxheWVyICE9IG51bGwgJiYgbUN1cnJlbnRTdGF0ZSA9PSBTVEFURV9TVVNQRU5ECi0gICAgICAgICAgICAgICAgICAgJiYgbVRhcmdldFN0YXRlID09IFNUQVRFX1JFU1VNRSkgewotICAgICAgICAgICAgICAgIG1NZWRpYVBsYXllci5zZXREaXNwbGF5KG1TdXJmYWNlSG9sZGVyKTsKLSAgICAgICAgICAgICAgICByZXN1bWUoKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgb3BlblZpZGVvKCk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBvcGVuVmlkZW8oKTsKICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIHN1cmZhY2VEZXN0cm95ZWQoU3VyZmFjZUhvbGRlciBob2xkZXIpCkBAIC00ODUsOSArNDc0LDcgQEAKICAgICAgICAgICAgIC8vIGFmdGVyIHdlIHJldHVybiBmcm9tIHRoaXMgd2UgY2FuJ3QgdXNlIHRoZSBzdXJmYWNlIGFueSBtb3JlCiAgICAgICAgICAgICBtU3VyZmFjZUhvbGRlciA9IG51bGw7CiAgICAgICAgICAgICBpZiAobU1lZGlhQ29udHJvbGxlciAhPSBudWxsKSBtTWVkaWFDb250cm9sbGVyLmhpZGUoKTsKLSAgICAgICAgICAgIGlmIChtQ3VycmVudFN0YXRlICE9IFNUQVRFX1NVU1BFTkQpIHsKLSAgICAgICAgICAgICAgICByZWxlYXNlKHRydWUpOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgcmVsZWFzZSh0cnVlKTsKICAgICAgICAgfQogICAgIH07CiAKQEAgLTUyOCw2ICs1MTUsNyBAQAogICAgICAgICBib29sZWFuIGlzS2V5Q29kZVN1cHBvcnRlZCA9IGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9CQUNLICYmCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9VUCAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfRE9XTiAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfTVVURSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9NRU5VICYmCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX0NBTEwgJiYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfRU5EQ0FMTDsKQEAgLTU0MiwxMCArNTMwLDE5IEBACiAgICAgICAgICAgICAgICAgICAgIG1NZWRpYUNvbnRyb2xsZXIuaGlkZSgpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BMQVkpIHsKKyAgICAgICAgICAgICAgICBpZiAobU1lZGlhUGxheWVyLmlzUGxheWluZygpKSB7CisgICAgICAgICAgICAgICAgICAgIHN0YXJ0KCk7CisgICAgICAgICAgICAgICAgICAgIG1NZWRpYUNvbnRyb2xsZXIuaGlkZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1NUT1AKLSAgICAgICAgICAgICAgICAgICAgJiYgbU1lZGlhUGxheWVyLmlzUGxheWluZygpKSB7Ci0gICAgICAgICAgICAgICAgcGF1c2UoKTsKLSAgICAgICAgICAgICAgICBtTWVkaWFDb250cm9sbGVyLnNob3coKTsKKyAgICAgICAgICAgICAgICAgICAgfHwga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BBVVNFKSB7CisgICAgICAgICAgICAgICAgaWYgKCFtTWVkaWFQbGF5ZXIuaXNQbGF5aW5nKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcGF1c2UoKTsKKyAgICAgICAgICAgICAgICAgICAgbU1lZGlhQ29udHJvbGxlci5zaG93KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICB0b2dnbGVNZWRpYUNvbnRyb2xzVmlzaWJsaXR5KCk7CiAgICAgICAgICAgICB9CkBAIC01ODEsMzkgKzU3OCwxNCBAQAogICAgIH0KIAogICAgI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dG8gdXNlIHRoZSBpbiBhbmQgb3V0IGFuaW1hdGlvbnMsIGRlZmF1bHRzCisgICAgICogICAgICAgICAgICB0byB0cnVlLgorICAgICAqLworICAgIHZvaWQgc2hvd09ubHkoaW50IGNoaWxkSW5kZXgsIGJvb2xlYW4gYW5pbWF0ZSkgeworICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IGdldENoaWxkQXQoaSk7CisgICAgICAgICAgICBpZiAoaSA9PSBjaGlsZEluZGV4KSB7CisgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGUgJiYgbUluQW5pbWF0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgY2hpbGQuc3RhcnRBbmltYXRpb24obUluQW5pbWF0aW9uKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2hpbGQuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgICAgIG1GaXJzdFRpbWUgPSBmYWxzZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGUgJiYgbU91dEFuaW1hdGlvbiAhPSBudWxsICYmIGNoaWxkLmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LlZJU0lCTEUpIHsKKyAgICAgICAgICAgICAgICAgICAgY2hpbGQuc3RhcnRBbmltYXRpb24obU91dEFuaW1hdGlvbik7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGlsZC5nZXRBbmltYXRpb24oKSA9PSBtSW5BbmltYXRpb24pCisgICAgICAgICAgICAgICAgICAgIGNoaWxkLmNsZWFyQW5pbWF0aW9uKCk7CisgICAgICAgICAgICAgICAgY2hpbGQuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICAgIC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TEFZX1NQTElUID0gMTsKKyAgICAKKyAgICBwcml2YXRlIGludCBtQ29udGV4dERpc3BsYXlNb2RlOworCisgICAgcHJpdmF0ZSBib29sZWFuIG1DbG9zaW5nQ29udGV4dDsKKworICAgIGZpbmFsIEhhbmRsZXIgbUhhbmRsZXIgPSBuZXcgSGFuZGxlcigpOworICAgIGZpbmFsIFJ1bm5hYmxlIG1DbG9zZUNvbnRleHQgPSBuZXcgUnVubmFibGUoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIG1VcHBlckNvbnRleHRWaWV3LmNsb3NlTW9kZSgpOworICAgICAgICAgICAgaWYgKG1Mb3dlckNvbnRleHRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtTG93ZXJDb250ZXh0Vmlldy5yZW1vdmVBbGxWaWV3cygpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUNsb3NpbmdDb250ZXh0ID0gZmFsc2U7CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHVibGljIEFjdGlvbkJhckltcGwoQWN0aXZpdHkgYWN0aXZpdHkpIHsKKyAgICAgICAgbUFjdGl2aXR5ID0gYWN0aXZpdHk7CisgICAgICAgIGluaXQoYWN0aXZpdHkuZ2V0V2luZG93KCkuZ2V0RGVjb3JWaWV3KCkpOworICAgIH0KKworICAgIHB1YmxpYyBBY3Rpb25CYXJJbXBsKERpYWxvZyBkaWFsb2cpIHsKKyAgICAgICAgbURpYWxvZyA9IGRpYWxvZzsKKyAgICAgICAgaW5pdChkaWFsb2cuZ2V0V2luZG93KCkuZ2V0RGVjb3JWaWV3KCkpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0KFZpZXcgZGVjb3IpIHsKKyAgICAgICAgbUNvbnRleHQgPSBkZWNvci5nZXRDb250ZXh0KCk7CisgICAgICAgIG1BY3Rpb25WaWV3ID0gKEFjdGlvbkJhclZpZXcpIGRlY29yLmZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLmFjdGlvbl9iYXIpOworICAgICAgICBtVXBwZXJDb250ZXh0VmlldyA9IChBY3Rpb25CYXJDb250ZXh0VmlldykgZGVjb3IuZmluZFZpZXdCeUlkKAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuYWN0aW9uX2NvbnRleHRfYmFyKTsKKyAgICAgICAgbUxvd2VyQ29udGV4dFZpZXcgPSAoTGluZWFyTGF5b3V0KSBkZWNvci5maW5kVmlld0J5SWQoCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5sb3dlcl9hY3Rpb25fY29udGV4dF9iYXIpOworICAgICAgICBtQW5pbWF0b3JWaWV3ID0gKFZpZXdBbmltYXRvcikgZGVjb3IuZmluZFZpZXdCeUlkKAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuYWN0aW9uX2Jhcl9hbmltYXRvcik7CisKKyAgICAgICAgaWYgKG1BY3Rpb25WaWV3ID09IG51bGwgfHwgbVVwcGVyQ29udGV4dFZpZXcgPT0gbnVsbCB8fCBtQW5pbWF0b3JWaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oZ2V0Q2xhc3MoKS5nZXRTaW1wbGVOYW1lKCkgKyAiIGNhbiBvbmx5IGJlIHVzZWQgIiArCisgICAgICAgICAgICAgICAgICAgICJ3aXRoIGEgY29tcGF0aWJsZSB3aW5kb3cgZGVjb3IgbGF5b3V0Iik7CisgICAgICAgIH0KKworICAgICAgICBtQWN0aW9uVmlldy5zZXRDb250ZXh0VmlldyhtVXBwZXJDb250ZXh0Vmlldyk7CisgICAgICAgIG1Db250ZXh0RGlzcGxheU1vZGUgPSBtTG93ZXJDb250ZXh0VmlldyA9PSBudWxsID8KKyAgICAgICAgICAgICAgICBDT05URVhUX0RJU1BMQVlfTk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ICAgICAgICBpbnQgZGVmYXVsdFNlbGVjdGVkUG9zaXRpb24pIHsKKyAgICAgICAgY2xlYW51cFRhYnMoKTsKKyAgICAgICAgc2V0RGlzcGxheU9wdGlvbnMoMCwgRElTUExBWV9TSE9XX0NVU1RPTSB8IERJU1BMQVlfU0hPV19USVRMRSk7CisgICAgICAgIG1BY3Rpb25WaWV3LnNldE5hdmlnYXRpb25Nb2RlKE5BVklHQVRJT05fTU9ERV9MSVNUKTsKKyAgICAgICAgc2V0TGlzdE5hdmlnYXRpb25DYWxsYmFja3MoYWRhcHRlciwgY2FsbGJhY2spOworICAgICAgICBpZiAoZGVmYXVsdFNlbGVjdGVkUG9zaXRpb24gPj0gMCkgeworICAgICAgICAgICAgbUFjdGlvblZpZXcuc2V0RHJvcGRvd25TZWxlY3RlZFBvc2l0aW9uKGRlZmF1bHRTZWxlY3RlZFBvc2l0aW9uKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFN0YW5kYXJkTmF2aWdhdGlvbk1vZGUoKSB7CisgICAgICAgIGNsZWFudXBUYWJzKCk7CisgICAgICAgIHNldERpc3BsYXlPcHRpb25zKERJU1BMQVlfU0hPV19USVRMRSwgRElTUExBWV9TSE9XX1RJVExFIHwgRElTUExBWV9TSE9XX0NVU1RPTSk7CisgICAgICAgIG1BY3Rpb25WaWV3LnNldE5hdmlnYXRpb25Nb2RlKE5BVklHQVRJT05fTU9ERV9TVEFOREFSRCk7CisgICAgICAgIG1BY3Rpb25WaWV3LnNldENhbGxiYWNrKG51bGwpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFNlbGVjdGVkTmF2aWdhdGlvbkl0ZW0oaW50IHBvc2l0aW9uKSB7CisgICAgICAgIHN3aXRjaCAobUFjdGlvblZpZXcuZ2V0TmF2aWdhdGlvbk1vZGUoKSkgeworICAgICAgICBjYXNlIE5BVklHQVRJT05fTU9ERV9UQUJTOgorICAgICAgICAgICAgc2VsZWN0VGFiKG1UYWJzLmdldChwb3NpdGlvbikpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTkFWSUdBVElPTl9NT0RFX0xJU1Q6CisgICAgICAgICAgICBtQWN0aW9uVmlldy5zZXREcm9wZG93blNlbGVjdGVkUG9zaXRpb24ocG9zaXRpb24pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAic2V0U2VsZWN0ZWROYXZpZ2F0aW9uSW5kZXggbm90IHZhbGlkIGZvciBjdXJyZW50IG5hdmlnYXRpb24gbW9kZSIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRTZWxlY3RlZE5hdmlnYXRpb25JdGVtKCkgeworICAgICAgICByZXR1cm4gZ2V0U2VsZWN0ZWROYXZpZ2F0aW9uSW5kZXgoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZW1vdmVBbGxUYWJzKCkgeworICAgICAgICBjbGVhbnVwVGFicygpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBjbGVhbnVwVGFicygpIHsKKyAgICAgICAgaWYgKG1TZWxlY3RlZFRhYiAhPSBudWxsKSB7CisgICAgICAgICAgICBzZWxlY3RUYWIobnVsbCk7CisgICAgICAgIH0KKyAgICAgICAgbVRhYnMuY2xlYXIoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRUaXRsZShDaGFyU2VxdWVuY2UgdGl0bGUpIHsKKyAgICAgICAgbUFjdGlvblZpZXcuc2V0VGl0bGUodGl0bGUpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFN1YnRpdGxlKENoYXJTZXF1ZW5jZSBzdWJ0aXRsZSkgeworICAgICAgICBtQWN0aW9uVmlldy5zZXRTdWJ0aXRsZShzdWJ0aXRsZSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0RGlzcGxheU9wdGlvbnMoaW50IG9wdGlvbnMpIHsKKyAgICAgICAgbUFjdGlvblZpZXcuc2V0RGlzcGxheU9wdGlvbnMob3B0aW9ucyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0RGlzcGxheU9wdGlvbnMoaW50IG9wdGlvbnMsIGludCBtYXNrKSB7CisgICAgICAgIGZpbmFsIGludCBjdXJyZW50ID0gbUFjdGlvblZpZXcuZ2V0RGlzcGxheU9wdGlvbnMoKTsgCisgICAgICAgIG1BY3Rpb25WaWV3LnNldERpc3BsYXlPcHRpb25zKChvcHRpb25zICYgbWFzaykgfCAoY3VycmVudCAmIH5tYXNrKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0QmFja2dyb3VuZERyYXdhYmxlKERyYXdhYmxlIGQpIHsKKyAgICAgICAgbUFjdGlvblZpZXcuc2V0QmFja2dyb3VuZERyYXdhYmxlKGQpOworICAgIH0KKworICAgIHB1YmxpYyBWaWV3IGdldEN1c3RvbU5hdmlnYXRpb25WaWV3KCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0Q3VzdG9tTmF2aWdhdGlvblZpZXcoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFRpdGxlKCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0VGl0bGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFN1YnRpdGxlKCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0U3VidGl0bGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldE5hdmlnYXRpb25Nb2RlKCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0TmF2aWdhdGlvbk1vZGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldERpc3BsYXlPcHRpb25zKCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0RGlzcGxheU9wdGlvbnMoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQWN0aW9uTW9kZSBzdGFydEFjdGlvbk1vZGUoQWN0aW9uTW9kZS5DYWxsYmFjayBjYWxsYmFjaykgeworICAgICAgICBpZiAobUFjdGlvbk1vZGUgIT0gbnVsbCkgeworICAgICAgICAgICAgbUFjdGlvbk1vZGUuZmluaXNoKCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBEb24ndCB3YWl0IGZvciB0aGUgY2xvc2UgY29udGV4dCBtb2RlIGFuaW1hdGlvbiB0byBmaW5pc2guCisgICAgICAgIGlmIChtQ2xvc2luZ0NvbnRleHQpIHsKKyAgICAgICAgICAgIG1BbmltYXRvclZpZXcuY2xlYXJBbmltYXRpb24oKTsKKyAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtQ2xvc2VDb250ZXh0KTsKKyAgICAgICAgICAgIG1DbG9zZUNvbnRleHQucnVuKCk7CisgICAgICAgIH0KKworICAgICAgICBBY3Rpb25Nb2RlIG1vZGUgPSBuZXcgQWN0aW9uTW9kZUltcGwoY2FsbGJhY2spOworICAgICAgICBpZiAoY2FsbGJhY2sub25DcmVhdGVBY3Rpb25Nb2RlKG1vZGUsIG1vZGUuZ2V0TWVudSgpKSkgeworICAgICAgICAgICAgbW9kZS5pbnZhbGlkYXRlKCk7CisgICAgICAgICAgICBtVXBwZXJDb250ZXh0Vmlldy5pbml0Rm9yTW9kZShtb2RlKTsKKyAgICAgICAgICAgIG1BbmltYXRvclZpZXcuc2V0RGlzcGxheWVkQ2hpbGQoQ09OVEVYVF9WSUVXKTsKKyAgICAgICAgICAgIGlmIChtTG93ZXJDb250ZXh0VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgLy8gVE9ETyBhbmltYXRlIHRoaXMKKyAgICAgICAgICAgICAgICBtTG93ZXJDb250ZXh0Vmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtQWN0aW9uTW9kZSA9IG1vZGU7CisgICAgICAgICAgICByZXR1cm4gbW9kZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgY29uZmlndXJlVGFiKFRhYiB0YWIsIGludCBwb3NpdGlvbikgeworICAgICAgICBmaW5hbCBUYWJJbXBsIHRhYmkgPSAoVGFiSW1wbCkgdGFiOworICAgICAgICBmaW5hbCBBY3Rpb25CYXIuVGFiTGlzdGVuZXIgY2FsbGJhY2sgPSB0YWJpLmdldENhbGxiYWNrKCk7CisKKyAgICAgICAgaWYgKGNhbGxiYWNrID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkFjdGlvbiBCYXIgVGFiIG11c3QgaGF2ZSBhIENhbGxiYWNrIik7CisgICAgICAgIH0KKworICAgICAgICB0YWJpLnNldFBvc2l0aW9uKHBvc2l0aW9uKTsKKyAgICAgICAgbVRhYnMuYWRkKHBvc2l0aW9uLCB0YWJpKTsKKworICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBtVGFicy5zaXplKCk7CisgICAgICAgIGZvciAoaW50IGkgPSBwb3NpdGlvbiArIDE7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICBtVGFicy5nZXQoaSkuc2V0UG9zaXRpb24oaSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBhZGRUYWIoVGFiIHRhYikgeworICAgICAgICBhZGRUYWIodGFiLCBtVGFicy5pc0VtcHR5KCkpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGFkZFRhYihUYWIgdGFiLCBpbnQgcG9zaXRpb24pIHsKKyAgICAgICAgYWRkVGFiKHRhYiwgcG9zaXRpb24sIG1UYWJzLmlzRW1wdHkoKSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgYWRkVGFiKFRhYiB0YWIsIGJvb2xlYW4gc2V0U2VsZWN0ZWQpIHsKKyAgICAgICAgbUFjdGlvblZpZXcuYWRkVGFiKHRhYiwgc2V0U2VsZWN0ZWQpOworICAgICAgICBjb25maWd1cmVUYWIodGFiLCBtVGFicy5zaXplKCkpOworICAgICAgICBpZiAoc2V0U2VsZWN0ZWQpIHsKKyAgICAgICAgICAgIHNlbGVjdFRhYih0YWIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgYWRkVGFiKFRhYiB0YWIsIGludCBwb3NpdGlvbiwgYm9vbGVhbiBzZXRTZWxlY3RlZCkgeworICAgICAgICBtQWN0aW9uVmlldy5hZGRUYWIodGFiLCBwb3NpdGlvbiwgc2V0U2VsZWN0ZWQpOworICAgICAgICBjb25maWd1cmVUYWIodGFiLCBwb3NpdGlvbik7CisgICAgICAgIGlmIChzZXRTZWxlY3RlZCkgeworICAgICAgICAgICAgc2VsZWN0VGFiKHRhYik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgVGFiIG5ld1RhYigpIHsKKyAgICAgICAgcmV0dXJuIG5ldyBUYWJJbXBsKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcmVtb3ZlVGFiKFRhYiB0YWIpIHsKKyAgICAgICAgcmVtb3ZlVGFiQXQodGFiLmdldFBvc2l0aW9uKCkpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHJlbW92ZVRhYkF0KGludCBwb3NpdGlvbikgeworICAgICAgICBtQWN0aW9uVmlldy5yZW1vdmVUYWJBdChwb3NpdGlvbik7CisgICAgICAgIG1UYWJzLnJlbW92ZShwb3NpdGlvbik7CisKKyAgICAgICAgZmluYWwgaW50IG5ld1RhYkNvdW50ID0gbVRhYnMuc2l6ZSgpOworICAgICAgICBmb3IgKGludCBpID0gcG9zaXRpb247IGkgPCBuZXdUYWJDb3VudDsgaSsrKSB7CisgICAgICAgICAgICBtVGFicy5nZXQoaSkuc2V0UG9zaXRpb24oaSk7CisgICAgICAgIH0KKworICAgICAgICBzZWxlY3RUYWIobVRhYnMuaXNFbXB0eSgpID8gbnVsbCA6IG1UYWJzLmdldChNYXRoLm1heCgwLCBwb3NpdGlvbiAtIDEpKSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0VGFiTmF2aWdhdGlvbk1vZGUoKSB7CisgICAgICAgIGlmIChtQWN0aXZpdHkgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgIlRhYiBuYXZpZ2F0aW9uIG1vZGUgY2Fubm90IGJlIHVzZWQgb3V0c2lkZSBvZiBhbiBBY3Rpdml0eSIpOworICAgICAgICB9CisgICAgICAgIHNldERpc3BsYXlPcHRpb25zKDAsIERJU1BMQVlfU0hPV19USVRMRSB8IERJU1BMQVlfU0hPV19DVVNUT00pOworICAgICAgICBtQWN0aW9uVmlldy5zZXROYXZpZ2F0aW9uTW9kZShOQVZJR0FUSU9OX01PREVfVEFCUyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2VsZWN0VGFiKFRhYiB0YWIpIHsKKyAgICAgICAgZmluYWwgRnJhZ21lbnRUcmFuc2FjdGlvbiB0cmFucyA9IG1BY3Rpdml0eS5nZXRGcmFnbWVudE1hbmFnZXIoKS5vcGVuVHJhbnNhY3Rpb24oKTsKKworICAgICAgICBpZiAobVNlbGVjdGVkVGFiID09IHRhYikgeworICAgICAgICAgICAgaWYgKG1TZWxlY3RlZFRhYiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVNlbGVjdGVkVGFiLmdldENhbGxiYWNrKCkub25UYWJSZXNlbGVjdGVkKG1TZWxlY3RlZFRhYiwgdHJhbnMpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUFjdGlvblZpZXcuc2V0VGFiU2VsZWN0ZWQodGFiICE9IG51bGwgPyB0YWIuZ2V0UG9zaXRpb24oKSA6IFRhYi5JTlZBTElEX1BPU0lUSU9OKTsKKyAgICAgICAgICAgIGlmIChtU2VsZWN0ZWRUYWIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1TZWxlY3RlZFRhYi5nZXRDYWxsYmFjaygpLm9uVGFiVW5zZWxlY3RlZChtU2VsZWN0ZWRUYWIsIHRyYW5zKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1TZWxlY3RlZFRhYiA9IChUYWJJbXBsKSB0YWI7CisgICAgICAgICAgICBpZiAobVNlbGVjdGVkVGFiICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtU2VsZWN0ZWRUYWIuZ2V0Q2FsbGJhY2soKS5vblRhYlNlbGVjdGVkKG1TZWxlY3RlZFRhYiwgdHJhbnMpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKCF0cmFucy5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgIHRyYW5zLmNvbW1pdCgpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFRhYiBnZXRTZWxlY3RlZFRhYigpIHsKKyAgICAgICAgcmV0dXJuIG1TZWxlY3RlZFRhYjsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgaW50IGdldEhlaWdodCgpIHsKKyAgICAgICAgcmV0dXJuIG1BY3Rpb25WaWV3LmdldEhlaWdodCgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgIC8vIFRPRE8gYW5pbWF0ZSEKKyAgICAgICAgbUFuaW1hdG9yVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgaGlkZSgpIHsKKyAgICAgICAgLy8gVE9ETyBhbmltYXRlIQorICAgICAgICBtQW5pbWF0b3JWaWV3LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc1Nob3dpbmcoKSB7CisgICAgICAgIHJldHVybiBtQW5pbWF0b3JWaWV3LmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LlZJU0lCTEU7CisgICAgfQorCisgICAgLyoqCisgICAgICogQGhpZGUgCisgICAgICovCisgICAgcHVibGljIGNsYXNzIEFjdGlvbk1vZGVJbXBsIGV4dGVuZHMgQWN0aW9uTW9kZSBpbXBsZW1lbnRzIE1lbnVCdWlsZGVyLkNhbGxiYWNrIHsKKyAgICAgICAgcHJpdmF0ZSBBY3Rpb25Nb2RlLkNhbGxiYWNrIG1DYWxsYmFjazsKKyAgICAgICAgcHJpdmF0ZSBNZW51QnVpbGRlciBtTWVudTsKKyAgICAgICAgcHJpdmF0ZSBXZWFrUmVmZXJlbmNlPFZpZXc+IG1DdXN0b21WaWV3OworICAgICAgICAKKyAgICAgICAgcHVibGljIEFjdGlvbk1vZGVJbXBsKEFjdGlvbk1vZGUuQ2FsbGJhY2sgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIG1DYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgICAgICAgbU1lbnUgPSBuZXcgTWVudUJ1aWxkZXIobUFjdGlvblZpZXcuZ2V0Q29udGV4dCgpKQorICAgICAgICAgICAgICAgICAgICAuc2V0RGVmYXVsdFNob3dBc0FjdGlvbihNZW51SXRlbS5TSE9XX0FTX0FDVElPTl9JRl9ST09NKTsKKyAgICAgICAgICAgIG1NZW51LnNldENhbGxiYWNrKHRoaXMpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBNZW51SW5mbGF0ZXIgZ2V0TWVudUluZmxhdGVyKCkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBNZW51SW5mbGF0ZXIobUNvbnRleHQpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBNZW51IGdldE1lbnUoKSB7CisgICAgICAgICAgICByZXR1cm4gbU1lbnU7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZmluaXNoKCkgeworICAgICAgICAgICAgaWYgKG1BY3Rpb25Nb2RlICE9IHRoaXMpIHsKKyAgICAgICAgICAgICAgICAvLyBOb3QgdGhlIGFjdGl2ZSBhY3Rpb24gbW9kZSAtIG5vLW9wCisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtQ2FsbGJhY2sub25EZXN0cm95QWN0aW9uTW9kZSh0aGlzKTsKKyAgICAgICAgICAgIG1BbmltYXRvclZpZXcuc2V0RGlzcGxheWVkQ2hpbGQoTk9STUFMX1ZJRVcpOworCisgICAgICAgICAgICAvLyBDbGVhciBvdXQgdGhlIGNvbnRleHQgbW9kZSB2aWV3cyBhZnRlciB0aGUgYW5pbWF0aW9uIGZpbmlzaGVzCisgICAgICAgICAgICBtQ2xvc2luZ0NvbnRleHQgPSB0cnVlOworICAgICAgICAgICAgbUhhbmRsZXIucG9zdERlbGF5ZWQobUNsb3NlQ29udGV4dCwgbUFuaW1hdG9yVmlldy5nZXRPdXRBbmltYXRpb24oKS5nZXREdXJhdGlvbigpKTsKKworICAgICAgICAgICAgaWYgKG1Mb3dlckNvbnRleHRWaWV3ICE9IG51bGwgJiYgbUxvd2VyQ29udGV4dFZpZXcuZ2V0VmlzaWJpbGl0eSgpICE9IFZpZXcuR09ORSkgeworICAgICAgICAgICAgICAgIC8vIFRPRE8gQW5pbWF0ZSB0aGlzCisgICAgICAgICAgICAgICAgbUxvd2VyQ29udGV4dFZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUFjdGlvbk1vZGUgPSBudWxsOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGludmFsaWRhdGUoKSB7CisgICAgICAgICAgICBpZiAobUNhbGxiYWNrLm9uUHJlcGFyZUFjdGlvbk1vZGUodGhpcywgbU1lbnUpKSB7CisgICAgICAgICAgICAgICAgLy8gUmVmcmVzaCBjb250ZW50IGluIGJvdGggY29udGV4dCB2aWV3cworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHNldEN1c3RvbVZpZXcoVmlldyB2aWV3KSB7CisgICAgICAgICAgICBtVXBwZXJDb250ZXh0Vmlldy5zZXRDdXN0b21WaWV3KHZpZXcpOworICAgICAgICAgICAgbUN1c3RvbVZpZXcgPSBuZXcgV2Vha1JlZmVyZW5jZTxWaWV3Pih2aWV3KTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBzZXRTdWJ0aXRsZShDaGFyU2VxdWVuY2Ugc3VidGl0bGUpIHsKKyAgICAgICAgICAgIG1VcHBlckNvbnRleHRWaWV3LnNldFN1YnRpdGxlKHN1YnRpdGxlKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBzZXRUaXRsZShDaGFyU2VxdWVuY2UgdGl0bGUpIHsKKyAgICAgICAgICAgIG1VcHBlckNvbnRleHRWaWV3LnNldFRpdGxlKHRpdGxlKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBzZXRUaXRsZShpbnQgcmVzSWQpIHsKKyAgICAgICAgICAgIHNldFRpdGxlKG1BY3Rpdml0eS5nZXRTdHJpbmcocmVzSWQpKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBzZXRTdWJ0aXRsZShpbnQgcmVzSWQpIHsKKyAgICAgICAgICAgIHNldFN1YnRpdGxlKG1BY3Rpdml0eS5nZXRTdHJpbmcocmVzSWQpKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFRpdGxlKCkgeworICAgICAgICAgICAgcmV0dXJuIG1VcHBlckNvbnRleHRWaWV3LmdldFRpdGxlKCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIENoYXJTZXF1ZW5jZSBnZXRTdWJ0aXRsZSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtVXBwZXJDb250ZXh0Vmlldy5nZXRTdWJ0aXRsZSgpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFZpZXcgZ2V0Q3VzdG9tVmlldygpIHsKKyAgICAgICAgICAgIHJldHVybiBtQ3VzdG9tVmlldyAhPSBudWxsID8gbUN1c3RvbVZpZXcuZ2V0KCkgOiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25NZW51SXRlbVNlbGVjdGVkKE1lbnVCdWlsZGVyIG1lbnUsIE1lbnVJdGVtIGl0ZW0pIHsKKyAgICAgICAgICAgIHJldHVybiBtQ2FsbGJhY2sub25BY3Rpb25JdGVtQ2xpY2tlZCh0aGlzLCBpdGVtKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xvc2VNZW51KE1lbnVCdWlsZGVyIG1lbnUsIGJvb2xlYW4gYWxsTWVudXNBcmVDbG9zaW5nKSB7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBvblN1Yk1lbnVTZWxlY3RlZChTdWJNZW51QnVpbGRlciBzdWJNZW51KSB7CisgICAgICAgICAgICBpZiAoIXN1Yk1lbnUuaGFzVmlzaWJsZUl0ZW1zKCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbmV3IE1lbnVQb3B1cEhlbHBlcihtQ29udGV4dCwgc3ViTWVudSkuc2hvdygpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvbkNsb3NlU3ViTWVudShTdWJNZW51QnVpbGRlciBtZW51KSB7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvbk1lbnVNb2RlQ2hhbmdlKE1lbnVCdWlsZGVyIG1lbnUpIHsKKyAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgICAgIG1VcHBlckNvbnRleHRWaWV3LnNob3dPdmVyZmxvd01lbnUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGNsYXNzIFRhYkltcGwgZXh0ZW5kcyBBY3Rpb25CYXIuVGFiIHsKKyAgICAgICAgcHJpdmF0ZSBBY3Rpb25CYXIuVGFiTGlzdGVuZXIgbUNhbGxiYWNrOworICAgICAgICBwcml2YXRlIE9iamVjdCBtVGFnOworICAgICAgICBwcml2YXRlIERyYXdhYmxlIG1JY29uOworICAgICAgICBwcml2YXRlIENoYXJTZXF1ZW5jZSBtVGV4dDsKKyAgICAgICAgcHJpdmF0ZSBpbnQgbVBvc2l0aW9uOworICAgICAgICBwcml2YXRlIFZpZXcgbUN1c3RvbVZpZXc7CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBPYmplY3QgZ2V0VGFnKCkgeworICAgICAgICAgICAgcmV0dXJuIG1UYWc7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFRhYiBzZXRUYWcoT2JqZWN0IHRhZykgeworICAgICAgICAgICAgbVRhZyA9IHRhZzsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEFjdGlvbkJhci5UYWJMaXN0ZW5lciBnZXRDYWxsYmFjaygpIHsKKyAgICAgICAgICAgIHJldHVybiBtQ2FsbGJhY2s7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFRhYiBzZXRUYWJMaXN0ZW5lcihBY3Rpb25CYXIuVGFiTGlzdGVuZXIgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIG1DYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFZpZXcgZ2V0Q3VzdG9tVmlldygpIHsKKyAgICAgICAgICAgIHJldHVybiBtQ3VzdG9tVmlldzsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgVGFiIHNldEN1c3RvbVZpZXcoVmlldyB2aWV3KSB7CisgICAgICAgICAgICBtQ3VzdG9tVmlldyA9IHZpZXc7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgRHJhd2FibGUgZ2V0SWNvbigpIHsKKyAgICAgICAgICAgIHJldHVybiBtSWNvbjsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgaW50IGdldFBvc2l0aW9uKCkgeworICAgICAgICAgICAgcmV0dXJuIG1Qb3NpdGlvbjsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFBvc2l0aW9uKGludCBwb3NpdGlvbikgeworICAgICAgICAgICAgbVBvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIENoYXJTZXF1ZW5jZSBnZXRUZXh0KCkgeworICAgICAgICAgICAgcmV0dXJuIG1UZXh0OworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBUYWIgc2V0SWNvbihEcmF3YWJsZSBpY29uKSB7CisgICAgICAgICAgICBtSWNvbiA9IGljb247CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgVGFiIHNldFRleHQoQ2hhclNlcXVlbmNlIHRleHQpIHsKKyAgICAgICAgICAgIG1UZXh0ID0gdGV4dDsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHNlbGVjdCgpIHsKKyAgICAgICAgICAgIHNlbGVjdFRhYih0aGlzKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldEN1c3RvbVZpZXcoVmlldyB2aWV3KSB7CisgICAgICAgIG1BY3Rpb25WaWV3LnNldEN1c3RvbU5hdmlnYXRpb25WaWV3KHZpZXcpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldEN1c3RvbVZpZXcoVmlldyB2aWV3LCBMYXlvdXRQYXJhbXMgbGF5b3V0UGFyYW1zKSB7CisgICAgICAgIHZpZXcuc2V0TGF5b3V0UGFyYW1zKGxheW91dFBhcmFtcyk7CisgICAgICAgIG1BY3Rpb25WaWV3LnNldEN1c3RvbU5hdmlnYXRpb25WaWV3KHZpZXcpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldExpc3ROYXZpZ2F0aW9uQ2FsbGJhY2tzKFNwaW5uZXJBZGFwdGVyIGFkYXB0ZXIsIE5hdmlnYXRpb25DYWxsYmFjayBjYWxsYmFjaykgeworICAgICAgICBtQWN0aW9uVmlldy5zZXREcm9wZG93bkFkYXB0ZXIoYWRhcHRlcik7CisgICAgICAgIG1BY3Rpb25WaWV3LnNldENhbGxiYWNrKGNhbGxiYWNrKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgaW50IGdldFNlbGVjdGVkTmF2aWdhdGlvbkluZGV4KCkgeworICAgICAgICBzd2l0Y2ggKG1BY3Rpb25WaWV3LmdldE5hdmlnYXRpb25Nb2RlKCkpIHsKKyAgICAgICAgICAgIGNhc2UgTkFWSUdBVElPTl9NT0RFX1RBQlM6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZWxlY3RlZFRhYi5nZXRQb3NpdGlvbigpOworICAgICAgICAgICAgY2FzZSBOQVZJR0FUSU9OX01PREVfTElTVDoKKyAgICAgICAgICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0RHJvcGRvd25TZWxlY3RlZFBvc2l0aW9uKCk7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBpbnQgZ2V0TmF2aWdhdGlvbkl0ZW1Db3VudCgpIHsKKyAgICAgICAgc3dpdGNoIChtQWN0aW9uVmlldy5nZXROYXZpZ2F0aW9uTW9kZSgpKSB7CisgICAgICAgICAgICBjYXNlIE5BVklHQVRJT05fTU9ERV9UQUJTOgorICAgICAgICAgICAgICAgIHJldHVybiBtVGFicy5zaXplKCk7CisgICAgICAgICAgICBjYXNlIE5BVklHQVRJT05fTU9ERV9MSVNUOgorICAgICAgICAgICAgICAgIFNwaW5uZXJBZGFwdGVyIGFkYXB0ZXIgPSBtQWN0aW9uVmlldy5nZXREcm9wZG93b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OworCisgICAgICAgIHB1YmxpYyBMb2NhbGVJbmZvKFN0cmluZyBsYWJlbCwgTG9jYWxlIGxvY2FsZSkgeworICAgICAgICAgICAgdGhpcy5sYWJlbCA9IGxhYmVsOworICAgICAgICAgICAgdGhpcy5sb2NhbGUgPSBsb2NhbGU7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgU3RyaW5nIGdldExhYmVsKCkgeworICAgICAgICAgICAgcmV0dXJuIGxhYmVsOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIExvY2FsZSBnZXRMb2NhbGUoKSB7CisgICAgICAgICAgICByZXR1cm4gbG9jYWxlOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgICAgICByZXR1cm4gdGhpcy5sYWJlbDsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgaW50IGNvbXBhcmVUbyhMb2NhbGVJbmZvIGFub3RoZXIpIHsKKyAgICAgICAgICAgIHJldHVybiBzQ29sbGF0b3IuY29tcGFyZSh0aGlzLmxhYmVsLCBhbm90aGVyLmxhYmVsKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnN0cnVjdHMgYW4gQWRhcHRlciBvYmplY3QgY29udGFpbmluZyBMb2NhbGUgaW5mb3JtYXRpb24uIENvbnRlbnQgaXMgc29ydGVkIGJ5CisgICAgICoge0BsaW5rIExvY2FsZUluZm8jbGFiZWx9LgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgQXJyYXlBZGFwdGVyPExvY2FsZUluZm8+IGNvbnN0cnVjdEFkYXB0ZXIoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGZpbmFsIFJlc291cmNlcyByZXNvdXJjZXMgPSBjb250ZXh0LmdldFJlc291cmNlcygpOworICAgICAgICBmaW5hbCBTdHJpbmdbXSBsb2NhbGVzID0gY29udGV4dC5nZXRBc3NldHMoKS5nZXRMb2NhbGVzKCk7CisgICAgICAgIGZpbmFsIFN0cmluZ1tdIHNwZWNpYWxMb2NhbGVDb2RlcyA9IHJlc291cmNlcy5nZXRTdHJpbmdBcnJheShSLmFycmF5LnNwZWNpYWxfbG9jYWxlX2NvZGVzKTsKKyAgICAgICAgZmluYWwgU3RyaW5nW10gc3BlY2lhbExvY2FsZU5hbWVzID0gcmVzb3VyY2VzLmdldFN0cmluZ0FycmF5KFIuYXJyYXkuc3BlY2lhbF9sb2NhbGVfbmFtZXMpOworICAgICAgICBBcnJheXMuc29ydChsb2NhbGVzKTsKKyAgICAgICAgZmluYWwgaW50IG9yaWdTaXplID0gbG9jYWxlcy5sZW5ndGg7CisgICAgICAgIGZpbmFsIExvY2FsZUluZm9bXSBwcmVwcm9jZXNzID0gbmV3IExvY2FsZUluZm9bb3JpZ1NpemVdOworICAgICAgICBpbnQgZmluYWxTaXplID0gMDsKKyAgICAgICAgZm9yIChpbnQgaSA9IDAgOyBpIDwgb3JpZ1NpemU7IGkrKyApIHsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyBzID0gbG9jYWxlc1tpXTsKKyAgICAgICAgICAgIGZpbmFsIGludCBsZW4gPSBzLmxlbmd0aCgpOworICAgICAgICAgICAgaWYgKGxlbiA9PSA1KSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGxhbmd1YWdlID0gcy5zdWJzdHJpbmcoMCwgMik7CisgICAgICAgICAgICAgICAgU3RyaW5nIGNvdW50cnkgPSBzLnN1YnN0cmluZygzLCA1KTsKKyAgICAgICAgICAgICAgICBmaW5hbCBMb2NhbGUgbCA9IG5ldyBMb2NhbGUobGFuZ3VhZ2UsIGNvdW50cnkpOworCisgICAgICAgICAgICAgICAgaWYgKGZpbmFsU2l6ZSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiYWRkaW5nIGluaXRpYWwgIisgdG9UaXRsZUNhc2UobC5nZXREaXNwbGF5TGFuZ3VhZ2UobCkpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBwcmVwcm9jZXNzW2ZpbmFsU2l6ZSsrXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IExvY2FsZUluZm8odG9UaXRsZUNhc2UobC5nZXREaXNwbGF5TGFuZ3VhZ2UobCkpLCBsKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBjaGVjayBwcmV2aW91cyBlbnRyeToKKyAgICAgICAgICAgICAgICAgICAgLy8gIHNhbWUgbGFuZyBhbmQgYSBjb3VudHJ5IC0+IHVwZ3JhZGUgdG8gZnVsbCBuYW1lIGFuZAorICAgICAgICAgICAgICAgICAgICAvLyAgICBpbnNlcnQgb3VycyB3aXRoIGZ1bGwgbmFtZQorICAgICAgICAgICAgICAgICAgICAvLyAgZGlmZiBsYW5nIC0+IGluc2VydCBvdXJzIHdpdGggbGFuZy1vbmx5IG5hbWUKKyAgICAgICAgICAgICAgICAgICAgaWYgKHByZXByb2Nlc3NbZmluYWxTaXplLTFdLmxvY2FsZS5nZXRMYW5ndWFnZSgpLmVxdWFscygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYW5ndWFnZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImJhY2tpbmcgdXAgYW5kIGZpeGluZyAiKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlcHJvY2Vzc1tmaW5hbFNpemUtMV0ubGFiZWwrIiB0byAiKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0RGlzcGxheU5hbWUocHJlcHJvY2Vzc1tmaW5hbFNpemUtMV0ubG9jYWxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGVjaWFsTG9jYWxlQ29kZXMsIHNwZWNpYWxMb2NhbGVOYW1lcykpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcHJlcHJvY2Vzc1tmaW5hbFNpemUtMV0ubGFiZWwgPSB0b1RpdGxlQ2FzZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0RGlzcGxheU5hbWUocHJlcHJvY2Vzc1tmaW5hbFNpemUtMV0ubG9jYWxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNpYWxMb2NhbGVDb2Rlcywgc3BlY2lhbExvY2FsZU5hbWVzKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICIgIGFuZCBhZGRpbmcgIisgdG9UaXRsZUNhc2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXREaXNwbGF5TmFtZShsLCBzcGVjaWFsTG9jYWxlQ29kZXMsIHNwZWNpYWxMb2NhbGVOYW1lcykpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHByZXByb2Nlc3NbZmluYWxTaXplKytdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IExvY2FsZUluZm8odG9UaXRsZUNhc2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0RGlzcGxheU5hbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsLCBzcGVjaWFsTG9jYWxlQ29kZXMsIHNwZWNpYWxMb2NhbGVOYW1lcykpLCBsKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBkaXNwbGF5TmFtZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzLmVxdWFscygienpfWloiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXlOYW1lID0gIlBzZXVkby4uLiI7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXlOYW1lID0gdG9UaXRsZUNhc2UobC5nZXREaXNwbGF5TGFuZ3VhZ2UobCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiYWRkaW5nICIrZGlzcGxheU5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcHJlcHJvY2Vzc1tmaW5hbFNpemUrK10gPSBuZXcgTG9jYWxlSW5mbyhkaXNwbGF5TmFtZSwgbCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmaW5hbCBMb2NhbGVJbmZvW10gbG9jYWxlSW5mb3MgPSBuZXcgTG9jYWxlSW5mb1tmaW5hbFNpemVdOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGZpbmFsU2l6ZTsgaSsrKSB7CisgICAgICAgICAgICBsb2NhbGVJbmZvc1tpXSA9IHByZXByb2Nlc3NbaV07CisgICAgICAgIH0KKyAgICAgICAgQXJyYXlzLnNvcnQobG9jYWxlSW5mb3MpOworICAgICAgICBmaW5hbCBpbnQgbGF5b3V0SWQgPSBSLmxheW91dC5sb2NhbGVfcGlja2VyX2l0ZW07CisgICAgICAgIGZpbmFsIGludCBmaWVsZElkID0gUi5pZC5sb2NhbGU7CisgICAgICAgIHJldHVybiBuZXcgQXJyYXlBZGFwdGVyPExvY2FsZUluZm8+KGNvbnRleHQ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3NlciA9IG5ldyBDbG9zZURpYWxvZ1JlY2VpdmVyKGNvbnRleHQpOwogICAgICAgICAgICAgZmluYWwgQWxlcnREaWFsb2cgZGlhbG9nID0gbmV3IEFsZXJ0RGlhbG9nLkJ1aWxkZXIoY29udGV4dCkKICAgICAgICAgICAgICAgICAgICAgLnNldEljb24oYW5kcm9pZC5SLmRyYXdhYmxlLmljX2RpYWxvZ19hbGVydCkKICAgICAgICAgICAgICAgICAgICAgLnNldFRpdGxlKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnBvd2VyX29mZikKLSAgICAgICAgICAgICAgICAgICAgLnNldE1lc3NhZ2UoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuc2h1dGRvd25fY29uZmlybSkKKyAgICAgICAgICAgICAgICAgICAgLnNldE1lc3NhZ2UocmVzb3VyY2VJZCkKICAgICAgICAgICAgICAgICAgICAgLnNldFBvc2l0aXZlQnV0dG9uKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnllcywgbmV3IERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKERpYWxvZ0ludGVyZmFjZSBkaWFsb2csIGludCB3aGljaCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlZ2luU2h1dGRvd25TZXF1ZW5jZShjb250ZXh0KTsKQEAgLTExMCw2ICsxMTksOCBAQAogICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAuc2V0TmVnYXRpdmVCdXR0b24oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcubm8sIG51bGwpCiAgICAgICAgICAgICAgICAgICAgIC5jcmVhdGUoKTsKKyAgICAgICAgICAgIGNsb3Nlci5kaWFsb2cgPSBkaWFsb2c7CisgICAgICAgICAgICBkaWFsb2cuc2V0T25EaXNtaXNzTGlzdGVuZXIoY2xvc2VyKTsKICAgICAgICAgICAgIGRpYWxvZy5nZXRXaW5kb3coKS5zZXRUeXBlKFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLlRZUEVfS0VZR1VBUkRfRElBTE9HKTsKICAgICAgICAgICAgIGlmICghY29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRCb29sZWFuKAogICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmJvb2wuY29uZmlnX3NmX3Nsb3dCbHVyKSkgewpAQCAtMTIxLDYgKzEzMiwyNyBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgQ2xvc2VEaWFsb2dSZWNlaXZlciBleHRlbmRzIEJyb2FkY2FzdFJlY2VpdmVyCisgICAgICAgICAgICBpbXBsZW1lbnRzIERpYWxvZ0ludGVyZmFjZS5PbkRpc21pc3NMaXN0ZW5lciB7CisgICAgICAgIHByaXZhdGUgQ29udGV4dCBtQ29udGV4dDsKKyAgICAgICAgcHVibGljIERpYWxvZyBkaWFsb2c7CisKKyAgICAgICAgQ2xvc2VEaWFsb2dSZWNlaXZlcihDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKKyAgICAgICAgICAgIEludGVudEZpbHRlciBmaWx0ZXIgPSBuZXcgSW50ZW50RmlsdGVyKEludGVudC5BQ1RJT05fQ0xPU0VfU1lTVEVNX0RJQUxPR1MpOworICAgICAgICAgICAgY29udGV4dC5yZWdpc3RlclJlY2VpdmVyKHRoaXMsIGZpbHRlcik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICAgZGlhbG9nLmNhbmNlbCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25Ea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TVEFURV9ST1dTLAotICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXXtMb25nLnRvU3RyaW5nKHJvd0lkKX0pIDwgMSkgewotICAgICAgICAgICAgcmV0dXJuIDA7Ci0gICAgICAgIH0KLSAgICAgICAgZGIuZXhlY1NRTCgiVVBEQVRFICIgKyBTWU5DX1NUQVRFX1RBQkxFCi0gICAgICAgICAgICAgICAgKyAiIFNFVCAiICsgU3luY1N0YXRlQ29udHJhY3QuQ29sdW1ucy5EQVRBICsgIj0/IgotICAgICAgICAgICAgICAgICsgIiBXSEVSRSAiICsgU3luY1N0YXRlQ29udHJhY3QuQ29sdW1ucy5fSUQgKyAiPSIgKyByb3dJZCwKLSAgICAgICAgICAgICAgICBuZXcgT2JqZWN0W117ZGF0YX0pOwotICAgICAgICAvLyBhc3N1bWUgYSByb3cgd2FzIG1vZGlmaWVkIHNpbmNlIHdlIGtub3cgaXQgZXhpc3RzCi0gICAgICAgIHJldHVybiAxOwotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIG9uQWNjb3VudHNDaGFuZ2VkKFNRTGl0ZURhdGFiYXNlIGRiLCBBY2NvdW50W10gYWNjb3VudHMpIHsKLSAgICAgICAgQ3Vyc29yIGMgPSBkYi5xdWVyeShTWU5DX1NUQVRFX1RBQkxFLCBBQ0NPVU5UX1BST0pFQ1RJT04sIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGFjY291bnROYW1lID0gYy5nZXRTdHJpbmcoMCk7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGFjY291bnRUeXBlID0gYy5nZXRTdHJpbmcoMSk7Ci0gICAgICAgICAgICAgICAgQWNjb3VudCBhY2NvdW50ID0gbmV3IEFjY291bnQoYWNjb3VudE5hbWUsIGFjY291bnRUeXBlKTsKLS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Db3VudCk7CkBAIC0zMzUsNyArMzM3LDcgQEAKICAgICAgICAgcHVibGljIHZvaWQgcGx1Zyhsb25nIGJhdHRlcnlVcHRpbWUsIGxvbmcgYmF0dGVyeVJlYWx0aW1lKSB7CiAgICAgICAgICAgICBtUGx1Z2dlZENvdW50ID0gbUNvdW50LmdldCgpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIC8qKgogICAgICAgICAgKiBXcml0ZXMgYSBwb3NzaWJseSBudWxsIENvdW50ZXIgdG8gYSBQYXJjZWwuCiAgICAgICAgICAqCkBAIC0zNzUsNyArMzc3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgKyAiIG1VbnBsdWdnZWRDb3VudD0iICsgbVVucGx1Z2dlZENvdW50CiAgICAgICAgICAgICAgICAgICAgICsgIiBtUGx1Z2dlZENvdW50PSIgKyBtUGx1Z2dlZENvdW50KTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICB2b2lkIHN0ZXBBdG9taWMoKSB7CiAgICAgICAgICAgICBtQ291bnQuaW5jcmVtZW50QW5kR2V0KCk7CiAgICAgICAgIH0KQEAgLTM5MCwxMSArMzkyLDExIEBACiAgICAgICAgICAgICAgICAgZGV0YWNoKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgdm9pZCBkZXRhY2goKSB7CiAgICAgICAgICAgICBtVW5wbHVnZ2FibGVzLnJlbW92ZSh0aGlzKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICB2b2lkIHdyaXRlU3VtbWFyeUZyb21QYXJjZWxMb2NrZWQoUGFyY2VsIG91dCkgewogICAgICAgICAgICAgaW50IGNvdW50ID0gbUNvdW50LmdldCgpOwogICAgICAgICAgICAgb3V0LndyaXRlSW50KGNvdW50KTsKQEAgLTQyOSw0MSArNDMxLDQxIEBACiAgICAgcHVibGljIHN0YXRpYyBhYnN0cmFjdCBjbGFzcyBUaW1lciBleHRlbmRzIEJhdHRlcnlTdGF0cy5UaW1lciBpbXBsZW1lbnRzIFVucGx1Z2dhYmxlIHsKICAgICAgICAgZmluYWwgaW50IG1UeXBlOwogICAgICAgICBmaW5hbCBBcnJheUxpc3Q8VW5wbHVnZ2FibGU+IG1VbnBsdWdnYWJsZXM7Ci0gICAgICAgIAorCiAgICAgICAgIGludCBtQ291bnQ7CiAgICAgICAgIGludCBtTG9hZGVkQ291bnQ7CiAgICAgICAgIGludCBtTGFzdENvdW50OwogICAgICAgICBpbnQgbVVucGx1Z2dlZENvdW50OwotICAgICAgICAKKwogICAgICAgICAvLyBUaW1lcyBhcmUgaW4gbWljcm9zZWNvbmRzIGZvciBiZXR0ZXIgYWNjdXJhY3kgd2hlbiBkaXZpZGluZyBieSB0aGUKICAgICAgICAgLy8gbG9jayBjb3VudCwgYW5kIGFyZSBpbiAiYmF0dGVyeSByZWFsdGltZSIgdW5pdHMuCi0gICAgICAgIAorCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgdG90YWwgdGltZSB3ZSBoYXZlIGFjY3VtdWxhdGVkIHNpbmNlIHRoZSBzdGFydCBvZiB0aGUgb3JpZ2luYWwKICAgICAgICAgICogYm9vdCwgdG8gdGhlIGxhc3QgdGltZSBzb21ldGhpbmcgaW50ZXJlc3RpbmcgaGFwcGVuZWQgaW4gdGhlCiAgICAgICAgICAqIGN1cnJlbnQgcnVuLgogICAgICAgICAgKi8KICAgICAgICAgbG9uZyBtVG90YWxUaW1lOwotICAgICAgICAKKwogICAgICAgICAvKioKICAgICAgICAgICogVGhlIHRvdGFsIHRpbWUgd2UgbG9hZGVkIGZvciB0aGUgcHJldmlvdXMgcnVucy4gIFN1YnRyYWN0IHRoaXMgZnJvbQogICAgICAgICAgKiBtVG90YWxUaW1lIHRvIGZpbmQgdGhlIHRpbWUgZm9yIHRoZSBjdXJyZW50IHJ1biBvZiB0aGUgc3lzdGVtLgogICAgICAgICAgKi8KICAgICAgICAgbG9uZyBtTG9hZGVkVGltZTsKLSAgICAgICAgCisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBydW4gdGltZSBvZiB0aGUgbGFzdCBydW4gb2YgdGhlIHN5c3RlbSwgYXMgbG9hZGVkIGZyb20gdGhlCiAgICAgICAgICAqIHNhdmVkIGRhdGEuCiAgICAgICAgICAqLwogICAgICAgICBsb25nIG1MYXN0VGltZTsKLSAgICAgICAgCisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSB2YWx1ZSBvZiBtVG90YWxUaW1lIHdoZW4gdW5wbHVnKCkgd2FzIGxhc3QgY2FsbGVkLiAgU3VidHJhY3QKICAgICAgICAgICogdGhpcyBmcm9tIG1Ub3RhbFRpbWUgdG8gZmluZCB0aGUgdGltZSBzaW5jZSB0aGUgbGFzdCB1bnBsdWcgZnJvbQogICAgICAgICAgKiBwb3dlci4KICAgICAgICAgICovCiAgICAgICAgIGxvbmcgbVVucGx1Z2dlZFRpbWU7Ci0gICAgICAgIAorCiAgICAgICAgIC8qKgogICAgICAgICAgKiBDb25zdHJ1Y3RzIGZyb20gYSBwYXJjZWwuCiAgICAgICAgICAqIEBwYXJhbSB0eXBlCkBAIC00NzQsNyArNDc2LDcgQEAKICAgICAgICAgVGltZXIoaW50IHR5cGUsIEFycmF5TGlzdDxVbnBsdWdnYWJsZT4gdW5wbHVnZ2FibGVzLCBQYXJjZWwgaW4pIHsKICAgICAgICAgICAgIG1UeXBlID0gdHlwZTsKICAgICAgICAgICAgIG1VbnBsdWdnYWJsZXMgPSB1bnBsdWdnYWJsZXM7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgbUNvdW50ID0gaW4ucmVhZEludCgpOwogICAgICAgICAgICAgbUxvYWRlZENvdW50ID0gaW4ucmVhZEludCgpOwogICAgICAgICAgICAgbUxhc3RDb3VudCA9IDA7CkBAIC00OTMsOSArNDk1LDkgQEAKICAgICAgICAgfQogCiAgICAgICAgIHByb3RlY3RlZCBhYnN0cmFjdCBsb25nIGNvbXB1dGVSdW5UaW1lTG9ja2VkKGxvbmcgY3VyQmF0dGVyeVJlYWx0aW1lKTsKLSAgICAgICAgCisKICAgICAgICAgcHJvdGVjdGVkIGFic3RyYWN0IGludCBjb21wdXRlQ3VycmVudENvdW50TG9ja2VkKCk7Ci0gICAgICAgIAorCiAgICAgICAgIC8qKgogICAgICAgICAgKiBDbGVhciBzdGF0ZSBvZiB0aGlzIHRpbWVyLiAgUmV0dXJucyB0cnVlIGlmIHRoZSB0aW1lciBpcyBpbmFjdGl2ZQogICAgICAgICAgKiBzbyBjYW4gYmUgY29tcGxldGVseSBkcm9wcGVkLgpAQCAtNTA4LDExICs1MTAsMTEgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHZvaWQgZGV0YWNoKCkgewogICAgICAgICAgICAgbVVucGx1Z2dhYmxlcy5yZW1vdmUodGhpcyk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgb3V0LCBsb25nIGJhdHRlcnlSZWFsdGltZSkgewogICAgICAgICAgICAgb3V0LndyaXRlSW50KG1Db3VudCk7CiAgICAgICAgICAgICBvdXQud3JpdGVJbnQobUxvYWRlZENvdW50KTsKQEAgLTU0OSw3ICs1NTEsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgKyAiOiBuZXcgbVRvdGFsVGltZT0iICsgbVRvdGFsVGltZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFdyaXRlcyBhIHBvc3NpYmx5IG51bGwgVGltZXIgdG8gYSBQYXJjZWwuCiAgICAgICAgICAqCkBAIC02MTAsOCArNjEyLDggQEAKICAgICAgICAgICAgIHB3LnByaW50bG4ocHJlZml4ICsgIm1MYXN0VGltZT0iICsgbUxhc3RUaW1lCiAgICAgICAgICAgICAgICAgICAgICsgIiBtVW5wbHVnZ2VkVGltZT0iICsgbVVucGx1Z2dlZFRpbWUpOwogICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICAKKworCiAgICAgICAgIHZvaWQgd3JpdGVTdW1tYXJ5RnJvbVBhcmNlbExvY2tlZChQYXJjZWwgb3V0LCBsb25nIGJhdHRlcnlSZWFsdGltZSkgewogICAgICAgICAgICAgbG9uZyBydW5UaW1lID0gY29tcHV0ZVJ1blRpbWVMb2NrZWQoYmF0dGVyeVJlYWx0aW1lKTsKICAgICAgICAgICAgIC8vIERpdmlkZSBieSAxMDAwIGZvciBiYWNrd2FyZHMgY29tcGF0aWJpbGl0eQpAQCAtNjI5LDkgKzYzMSw5IEBACiAgICAgICAgICAgICBtVW5wbHVnZ2VkQ291bnQgPSBtQ291bnQ7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFNhbXBsaW5nVGltZXIgZXh0ZW5kcyBUaW1lciB7Ci0gICAgICAgIAorCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgbW9zdCByZWNlbnQgcmVwb3J0ZWQgY291bnQgZnJvbSAvcHJvYy93YWtlbG9ja3MuCiAgICAgICAgICAqLwpAQCAtNjQ1LDcgKzY0Nyw3IEBACiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBtb3N0IHJlY2VudCByZXBvcnRlZCB0b3RhbF90aW1lIGZyb20gL3Byb2Mvd2FrZWxvY2tzLgotICAgICAgICAgKi8gCisgICAgICAgICAqLwogICAgICAgICBsb25nIG1DdXJyZW50UmVwb3J0ZWRUb3RhbFRpbWU7CiAKIApAQCAtNjY0LDEyICs2NjYsMTIgQEAKICAgICAgICAgICogV2hldGhlciB3ZSBhcmUgY3VycmVudGx5IHJlY29yZGluZyByZXBvcnRlZCB2YWx1ZXMuCiAgICAgICAgICAqLwogICAgICAgICBib29sZWFuIG1UcmFja2luZ1JlcG9ydGVkVmFsdWVzOwotICAg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fQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgdm9pZCBzZXRTdGFsZSgpIHsKICAgICAgICAgICAgIG1UcmFja2luZ1JlcG9ydGVkVmFsdWVzID0gZmFsc2U7CiAgICAgICAgICAgICBtVW5wbHVnZ2VkUmVwb3J0ZWRUb3RhbFRpbWUgPSAwOwogICAgICAgICAgICAgbVVucGx1Z2dlZFJlcG9ydGVkQ291bnQgPSAwOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyB2b2lkIHNldFVwZGF0ZVZlcnNpb24oaW50IHZlcnNpb24pIHsKICAgICAgICAgICAgIG1VcGRhdGVWZXJzaW9uID0gdmVyc2lvbjsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgaW50IGdldFVwZGF0ZVZlcnNpb24oKSB7CiAgICAgICAgICAgICByZXR1cm4gbVVwZGF0ZVZlcnNpb247CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcHVibGljIHZvaWQgdXBkYXRlQ3VycmVudFJlcG9ydGVkQ291bnQoaW50IGNvdW50KSB7CiAgICAgICAgICAgICBpZiAobUluRGlzY2hhcmdlICYmIG1VbnBsdWdnZWRSZXBvcnRlZENvdW50ID09IDApIHsKICAgICAgICAgICAgICAgICAvLyBVcGRhdGluZyB0aGUgcmVwb3J0ZWQgdmFsdWUgZm9yIHRoZSBmaXJzdCB0aW1lLgpAQCAtNzEwLDcgKzcxMiw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtQ3VycmVudFJlcG9ydGVkQ291bnQgPSBjb3VudDsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgdm9pZCB1cGRhdGVDdXJyZW50UmVwb3J0ZWRUb3RhbFRpbWUobG9uZyB0b3RhbFRpbWUpIHsKICAgICAgICAgICAgIGlmIChtSW5EaXNjaGFyZ2UgJiYgbVVucGx1Z2dlZFJlcG9ydGVkVG90YWxUaW1lID09IDApIHsKICAgICAgICAgICAgICAgICAvLyBVcGRhdGluZyB0aGUgcmVwb3J0ZWQgdmFsdWUgZm9yIHRoZSBmaXJzdCB0aW1lLgpAQCAtNzIwLDcgKzcyMiw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtQ3VycmVudFJlcG9ydGVkVG90YWxUaW1lID0gdG90YWxUaW1lOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyB2b2lkIHVucGx1Zyhsb25nIGJhdHRlcnlVcHRpbWUsIGxvbmcgYmF0dGVyeVJlYWx0aW1lKSB7CiAgICAgICAgICAgICBzdXBlci51bnBsdWcoYmF0dGVyeVVwdGltZSwgYmF0dGVyeVJlYWx0aW1lKTsKICAgICAgICAgICAgIGlmIChtVHJhY2tpbmdSZXBvcnRlZFZhbHVlcykgewpAQCAtNzM0LDI1ICs3MzYsMjUgQEAKICAgICAgICAgICAgIHN1cGVyLnBsdWcoYmF0dGVyeVVwdGltZSwgYmF0dGVyeVJlYWx0aW1lKTsKICAgICAgICAgICAgIG1JbkRpc2NoYXJnZSA9IGZhbHNlOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyB2b2lkIGxvZ1N0YXRlKFByaW50ZXIgcHcsIFN0cmluZyBwcmVmaXgpIHsKICAgICAgICAgICAgIHN1cGVyLmxvZ1N0YXRlKHB3LCBwcmVmaXgpOwotICAgICAgICAgICAgcHcucHJpbnRsbihwcmVmaXggKyAibUN1cnJlbnRSZXBvcnRlZENvdW50PSIgKyBtQ3VycmVudFJlcG9ydGVkQ291bnQgCisgICAgICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJtQ3VycmVudFJlcG9ydGVkQ291bnQ9IiArIG1DdXJyZW50UmVwb3J0ZWRDb3VudAogICAgICAgICAgICAgICAgICAgICArICIgbVVucGx1Z2dlZFJlcG9ydGVkQ291bnQ9IiArIG1VbnBsdWdnZWRSZXBvcnRlZENvdW50CiAgICAgICAgICAgICAgICAgICAg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IGhhdmUgYmVlbiBydW5uaW5nIHNpbmNlIHdlIGxhc3QgY29tcHV0ZWQgYW4gdXBkYXRlLgogICAgICAgICAgKi8KICAgICAgICAgbG9uZyBtVXBkYXRlVGltZTsKLSAgICAgICAgCisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSB0b3RhbCB0aW1lIGF0IHdoaWNoIHRoZSB0aW1lciB3YXMgYWNxdWlyZWQsIHRvIGRldGVybWluZSBpZiBpdAogICAgICAgICAgKiB3YXMgYWN0dWFsbHkgaGVsZCBmb3IgYW4gaW50ZXJlc3RpbmcgZHVyYXRpb24uCkBAIC04MjcsNyArODI5LDcgQEAKICAgICAgICAgICAgIG1VaWQgPSB1aWQ7CiAgICAgICAgICAgICBtVGltZXJQb29sID0gdGltZXJQb29sOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHZvaWQgc2V0VGltZW91dChsb25nIHRpbWVvdXQpIHsKICAgICAgICAgICAgIG1UaW1lb3V0ID0gdGltZW91dDsKICAgICAgICAgfQpAQCAtODU1LDcgKzg1Nyw3IEBACiAgICAgICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJtTmVzdGluZz0iICsgbU5lc3RpbmcgKyAibVVwZGF0ZVRpbWU9IiArIG1VcGRhdGVUaW1lCiAgICAgICAgICAgICAgICAgICAgICsgIiBtQWNxdWlyZVRpbWU9IiArIG1BY3F1aXJlVGltZSk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgdm9pZCBzdGFydFJ1bm5pbmdMb2NrZWQoQmF0dGVyeVN0YXRzSW1wbCBzdGF0cykgewogICAgICAgICAgICAgaWYgKG1OZXN0aW5nKysgPT0gMCkgewogICAgICAgICAgICAgICAgIG1VcGRhdGVUaW1lID0gc3RhdHMuZ2V0QmF0dGVyeVJlYWx0aW1lTG9ja2VkKApAQCAtODk1LDE5ICs4OTcsMTkgQEAKICAgICAgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIHRoaXMgdGltZXIgZnJvbSB0aGUgYWN0aXZlIHBvb2wKICAgICAgICAgICAgICAgICAgICAgbVRpbWVyUG9vbC5yZW1vdmUodGhpcyk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgbG9uZyByZWFsdGltZSA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpICogMTAwMDsgCisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgcmVhbHRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKSAqIDEwMDA7CiAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgYmF0dGVyeVJlYWx0aW1lID0gc3RhdHMuZ2V0QmF0dGVyeVJlYWx0aW1lTG9ja2VkKHJlYWx0aW1lKTsKICAgICAgICAgICAgICAgICAgICAgbU5lc3RpbmcgPSAxOwogICAgICAgICAgICAgICAgICAgICBtVG90YWxUaW1lID0gY29tcHV0ZVJ1blRpbWVMb2NrZWQoYmF0dGVyeVJlYWx0aW1lKTsKICAgICAgICAgICAgICAgICAgICAgbU5lc3RpbmcgPSAwOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIGlmIChERUJVRyAmJiBtVHlwZSA8IDApIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAic3RvcCAjIiArIG1UeXBlICsgIjogbVVwZGF0ZVRpbWU9IiArIG1VcGRhdGVUaW1lCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1Ub3RhbFRpbWU9IiArIG1Ub3RhbFRpbWUgKyAiIG1Db3VudD0iICsgbUNvdW50CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1BY3F1aXJlVGltZT0iICsgbUFjcXVpcmVUaW1lKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBpZiAobVRvdGFsVG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cGVyLmRldGFjaCgpOwogICAgICAgICAgICAgaWYgKG1UaW1lclBvb2wgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIG1UaW1lclBvb2wucmVtb3ZlKHRoaXMpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHZvaWQgcmVhZFN1bW1hcnlGcm9tUGFyY2VsTG9ja2VkKFBhcmNlbCBpbikgewogICAgICAgICAgICAgc3VwZXIucmVhZFN1bW1hcnlGcm9tUGFyY2VsTG9ja2VkKGluKTsKICAgICAgICAgICAgIG1OZXN0aW5nID0gMDsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHByaXZhdGUgZmluYWwgTWFwPFN0cmluZywgS2VybmVsV2FrZWxvY2tTdGF0cz4gcmVhZEtlcm5lbFdha2Vsb2NrU3RhdHMoKSB7Ci0gICAgICAgIAorCiAgICAgICAgIGJ5dGVbXSBidWZmZXIgPSBuZXcgYnl0ZVs4MTkyXTsKICAgICAgICAgaW50IGxlbjsKLSAgICAgICAgCisKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIEZpbGVJbnB1dFN0cmVhbSBpcyA9IG5ldyBGaWxlSW5wdXRTdHJlYW0oIi9wcm9jL3dha2Vsb2NrcyIpOwogICAgICAgICAgICAgbGVuID0gaXMucmVhZChidWZmZXIpOwpAQCAtOTk3LDEwICs5OTksMTAgQEAKICAgICAgICAgfSBjYXRjaCAoamF2YS5pby5JT0V4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICByZXR1cm4gcGFyc2VQcm9jV2FrZWxvY2tzKGJ1ZmZlciwgbGVuKTsKICAgICB9Ci0gICAgCisKICAgICBwcml2YXRlIGZpbmFsIE1hcDxTdHJpbmcsIEtlcm5lbFdha2Vsb2NrU3RhdHM+IHBhcnNlUHJvY1dha2Vsb2NrcygKICAgICAgICAgICAgIGJ5dGVbXSB3bEJ1ZmZlciwgaW50IGxlbikgewogICAgICAgICBTdHJpbmcgbmFtZTsKQEAgLTEwMTYsMTEgKzEwMTgsMTEgQEAKIAogICAgICAgICBzeW5jaHJvbml6ZWQodGhpcykgewogICAgICAgICAgICAgTWFwPFN0cmluZywgS2VybmVsV2FrZWxvY2tTdGF0cz4gbSA9IG1Qcm9jV2FrZWxvY2tGaWxlU3RhdHM7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgc0tlcm5lbFdha2Vsb2NrVXBkYXRlVmVyc2lvbisrOwogICAgICAgICAgICAgd2hpbGUgKGVuZEluZGV4IDwgbGVuKSB7Ci0gICAgICAgICAgICAgICAgZm9yIChlbmRJbmRleD1zdGFydEluZGV4OyAKLSAgICAgICAgICAgICAgICAgICAgICAgIGVuZEluZGV4IDwgbGVuICYmIHdsQnVmZmVyW2VuZEluZGV4XSAhPSAnXG4nICYmIHdsQnVmZmVyW2VuZEluZGV4XSAhPSAnXDAnOyAKKyAgICAgICAgICAgICAgICBmb3IgKGVuZEluZGV4PXN0YXJ0SW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICBlbmRJbmRleCA8IGxlbiAmJiB3bEJ1ZmZlcltlbmRJbmRleF0gIT0gJ1xuJyAmJiB3bEJ1ZmZlcltlbmRJbmRleF0gIT0gJ1wwJzsKICAgICAgICAgICAgICAgICAgICAgICAgIGVuZEluZGV4KyspOwogICAgICAgICAgICAgICAgIGVuZEluZGV4Kys7IC8vIGVuZEluZGV4IGlzIGFuIGV4Y2x1c2l2ZSB1cHBlciBib3VuZC4KICAgICAgICAgICAgICAgICAvLyBEb24ndCBnbyBvdmVyIHRoZSBlbmQgb2YgdGhlIGJ1ZmZlciwgUHJvY2Vzcy5wYXJzZVByb2NMaW5lIG1pZ2h0CkBAIC0xMDQ3LDcgKzEwNDksNyBAQAogCiAgICAgICAgICAgICAgICAgaWYgKHBhcnNlZCAmJiBuYW1lLmxlbmd0aCgpID4gMCkgewogICAgICAgICAgICAgICAgICAgICBpZiAoIW0uY29udGFpbnNLZXkobmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG0ucHV0KG5hbWUsIG5ldyBLZXJuZWxXYWtlbG9ja1N0YXRzKGNvdW50LCB0b3RhbFRpbWUsIAorICAgICAgICAgICAgICAgICAgICAgICAgbS5wdXQobmFtZSwgbmV3IEtlcm5lbFdha2Vsb2NrU3RhdHMoY291bnQsIHRvdGFsVGltZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0tlcm5lbFdha2Vsb2NrVXBkYXRlVmVyc2lvbikpOwogICAgICAgICAgICAgICAgICAgICAgICAgbnVtVXBkYXRlZFdsTmFtZXMrKzsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKQEAgLTEwNzgsMjcgKzEwODAsMjcgQEAKICAgICAgICAgICAgIHJldHVybiBtOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHJpdmF0ZSBjbGFzcyBLZXJuZWxXYWtlbG9ja1N0YXRzIHsKICAgICAgICAgcHVibGljIGludCBtQ291bnQ7CiAgICAgICAgIHB1YmxpYyBsb25nIG1Ub3RhbFRpbWU7CiAgICAgICAgIHB1YmxpYyBpbnQgbVZlcnNpb247Ci0gICAgICAgIAorCiAgICAgICAgIEtlcm5lbFdha2Vsb2NrU3RhdHMoaW50IGNvdW50LCBsb25nIHRvdGFsVGltZSwgaW50IHZlcnNpb24pIHsKICAgICAgICAgICAgIG1Db3VudCA9IGNvdW50OwogICAgICAgICAgICAgbVRvdGFsVGltZSA9IHRvdGFsVGltZTsKICAgICAgICAgICAgIG1WZXJzaW9uID0gdmVyc2lvbjsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qCi0gICAgICogR2V0IHRoZSBLZXJuZWxXYWtlbG9ja1RpbWVyIGFzc29jaWF0ZWQgd2l0aCBuYW1lLCBhbmQgY3JlYXRlIGEgbmV3IG9uZSBpZiBvbmUgCisgICAgICogR2V0IHRoZSBLZXJuZW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wIEBACiAKICAgICBwcml2YXRlIGludCBnZXRDdXJyZW50Qmx1ZXRvb3RoUGluZ0NvdW50KCkgewogICAgICAgICBpZiAobUJ0SGVhZHNldCAhPSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gbUJ0SGVhZHNldC5nZXRCYXR0ZXJ5VXNhZ2VIaW50KCk7CisgICAgICAgICAgICBMaXN0PEJsdWV0b290aERldmljZT4gZGV2aWNlTGlzdCA9IG1CdEhlYWRzZXQuZ2V0Q29ubmVjdGVkRGV2aWNlcygpOworICAgICAgICAgICAgaWYgKGRldmljZUxpc3Quc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBtQnRIZWFkc2V0LmdldEJhdHRlcnlVc2FnZUhpbnQoZGV2aWNlTGlzdC5nZXQoMCkpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIHJldHVybiAtMTsKICAgICB9CkBAIC0xMjI4LDcgKzEyMzMsNyBAQAogCiAgICAgICAgIGFkZEhpc3RvcnlSZWNvcmRMb2NrZWQoY3VyVGltZSwgSGlzdG9yeUl0ZW0uQ01EX1VQREFURSk7CiAgICAgfQotICAgIAorCiAgICAgdm9pZCBhZGRIaXN0b3J5UmVjb3JkTG9ja2VkKGxvbmcgY3VyVGltZSwgYnl0ZSBjbWQpIHsKICAgICAgICAgSGlzdG9yeUl0ZW0gcmVjID0gbUhpc3RvcnlDYWNoZTsKICAgICAgICAgaWYgKHJlYyAhPSBudWxsKSB7CkBAIC0xMjM3LDEwICsxMjQyLDEwIEBACiAgICAgICAgICAgICByZWMgPSBuZXcgSGlzdG9yeUl0ZW0oKTsKICAgICAgICAgfQogICAgICAgICByZWMuc2V0VG8obUhpc3RvcnlCYXNlVGltZSArIGN1clRpbWUsIGNtZCwgbUhpc3RvcnlDdXIpOwotICAgICAgICAKKwogICAgICAgICBhZGRIaXN0b3J5UmVjb3JkTG9ja2VkKHJlYyk7CiAgICAgfQotICAgIAorCiAgICAgdm9pZCBhZG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RoaXMpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgdm9pZCBub3RlV2lmaVN0b3BwZWRMb2NrZWQoKSB7CiAgICAgICAgICAgICBpZiAobVdpZmlSdW5uaW5nKSB7CkBAIC0yMjgyLDcgKzIyODcsNyBAQAogICAgICAgICAgICAgICAgIG1XaWZpUnVubmluZ1RpbWVyLnN0b3BSdW5uaW5nTG9ja2VkKEJhdHRlcnlTdGF0c0ltcGwudGhpcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyB2b2lkIG5vdGVGdWxsV2lmaUxvY2tBY3F1aXJlZExvY2tlZCgpIHsKICAgICAgICAgICAgIGlmICghbUZ1bGxXaWZpTG9ja091dCkgewpAQCAtMjI5NCw3ICsyMjk5LDcgQEAKICAgICAgICAgICAgICAgICBtRnVsbFdpZmlMb2NrVGltZXIuc3RhcnRSdW5uaW5nTG9ja2VkKEJhdHRlcnlTdGF0c0ltcGwudGhpcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyB2b2lkIG5vdGVGdWxsV2lmaUxvY2tSZWxlYXNlZExvY2tlZCgpIHsKICAgICAgICAgICAgIGlmIChtRnVsbFdpZmlMb2NrT3V0KSB7CkBAIC0yMzAyLDcgKzIzMDcsNyBAQAogICAgICAgICAgICAgICAgIG1GdWxsV2lmaUxvY2tUaW1lci5zdG9wUnVubmluZ0xvY2tlZChCYXR0ZXJ5U3RhdHNJbXBsLnRoaXMpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgdm9pZCBub3RlU2NhbldpZmlMb2NrQWNxdWlyZWRMb2NrZWQoKSB7CiAgICAgICAgICAgICBpZiAoIW1TY2FuV2lmaUxvY2tPdXQpIHsKQEAgLTIzMTQsNyArMjMxOSw3IEBACiAgICAgICAgICAgICAgICAgbVNjYW5XaWZpTG9ja1RpbWVyLnN0YXJ0UnVubmluZ0xvY2tlZChCYXR0ZXJ5U3RhdHNJbXBsLnRoaXMpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgdm9pZCBub3RlU2NhbldpZmlMb2NrUmVsZWFzZWRMb2NrZWQoKSB7CiAgICAgICAgICAgICBpZiAobVNjYW5XaWZpTG9ja091dCkgewpAQCAtMjM4Myw3ICsyMzg4LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCi0gICAgICAgIEBPdmVycmlkZSAKKyAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyBsb25nIGdldFdpZmlSdW5uaW5nVGltZShsb25nIGJhdHRlcnlSZWFsdGltZSwgaW50IHdoaWNoKSB7CiAgICAgICAgICAgICBpZiAobVdpZmlSdW5uaW5nVGltZXIgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHJldHVybiAwOwpAQCAtMjM5MSwxNSArMjM5NiwxNSBAQAogICAgICAgICAgICAgcmV0dXJuIG1XaWZpUnVubmluZ1RpbWVyLmdldFRvdGFsVGltZUxvY2tlZChiYXR0ZXJ5UmVhbHRpbWUsIHdoaWNoKTsKICAgICAgICAgfQogCi0gICAgICAgIEBPdmVycmlkZSAKKyAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyBsb25nIGdldEZ1bGxXaWZpTG9ja1RpbWUobG9uZyBiYXR0ZXJ5UmVhbHRpbWUsIGludCB3aGljaCkgewogICAgICAgICAgICAgaWYgKG1GdWxsV2lmaUxvY2tUaW1lciA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gbUZ1bGxXaWZpTG9ja1RpbWVyLmdldFRvdGFsVGltZUxvY2tlZChiYXR0ZXJ5UmVhbHRpbWUsIHdoaWNoKTsKICAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgQE92ZXJyaWRlIAorCisgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgbG9uZyBnZXRTY2FuV2lmaUxvY2tUaW1lKGxvbmcgYmF0dGVyeVJlYWx0aW1lLCBpbnQgd2hpY2gpIHsKICAgICAgICAgICAgIGlmIChtU2NhbldpZmlMb2NrVGltZXIgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHJldHVybiAwOwpAQCAtMjQxNiw3ICsyNDIxLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGljaCk7CiAgICAgICAgIH0KIAotICAgICAgICBAT3ZlcnJpZGUgCisgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgbG9uZyBnZXRBdWRpb1R1cm5lZE9uVGltZShsb25nIGJhdHRlcnlSZWFsdGltZSwgaW50IHdoaWNoKSB7CiAgICAgICAgICAgICBpZiAobUF1ZGlvVHVybmVkT25UaW1lciA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CkBAIC0yNDI0LDcgKzI0MjksNyBAQAogICAgICAgICAgICAgcmV0dXJuIG1BdWRpb1R1cm5lZE9uVGltZXIuZ2V0VG90YWxUaW1lTG9ja2VkKGJhdHRlcnlSZWFsdGltZSwgd2hpY2gpOwogICAgICAgICB9CiAKLSAgICAgICAgQE92ZXJyaWRlIAorICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIGxvbmcgZ2V0VmlkZW9UdXJuZWRPblRpbWUobG9uZyBiYXR0ZXJ5UmVhbHRpbWUsIGludCB3aGljaCkgewogICAgICAgICAgICAgaWYgKG1WaWRlb1R1cm5lZE9uVGltZXIgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHJldHVybiAwOwpAQCAtMjQ0MSwxMiArMjQ0NiwxMiBAQAogICAgICAgICAgICAgZWxzZSBpZiAodHlwZSA+PSBOVU1fVVNFUl9BQ1RJVklUWV9UWVBFUykgdHlwZSA9IE5VTV9VU0VSX0FDVElWSVRZX1RZUEVTLTE7CiAgICAgICAgICAgICBtVXNlckFjdGl2aXR5Q291bnRlcnNbdHlwZV0uc3RlcEF0b21pYygpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNVc2VyQWN0aXZpdHkoKSB7CiAgICAgICAgICAgICByZXR1cm4gbVVzZXJBY3Rpdml0eUNvdW50ZXJzICE9IG51bGw7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyBpbnQgZ2V0VXNlckFjdGl2aXR5Q291bnQoaW50IHR5cGUsIGludCB3aGljaCkgewogICAgICAgICAgICAgaWYgKG1Vc2VyQWN0aXZpdHlDb3VudGVycyA9PSBudWxsKSB7CkBAIC0yNDU0LDE0ICsyNDU5LDE0IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gbVVzZXJBY3Rpdml0eUNvdW50ZXJzW3R5cGVdLmdldENvdW50TG9ja2VkKHdoaWNoKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICB2b2lkIGluaXRVc2VyQWN0aXZpdHlMb2NrZWQoKSB7CiAgICAgICAgICAgICBtVXNlckFjdGl2aXR5Q291bnRlcnMgPSBuZXcgQ291bnRlcltOVU1fVVNFUl9BQ1RJVklUWV9UWVBFU107CiAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TlVNX1VTRVJfQUNUSVZJVFlfVFlQRVM7IGkrKykgewogICAgICAgICAgICAgICAgIG1Vc2VyQWN0aXZpdHlDb3VudGVyc1tpXSA9IG5ldyBDb3VudGVyKG1VbnBsdWdnYWJsZXMpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyBsb25nIGNvbXB1dGVDdXJyZW50VGNwQnl0ZXNTZW50KCkgewogICAgICAgICAgICAgcmV0dXJuIG1DdXJyZW50VGNwQnl0ZXNTZW50ICsgKG1TdGFydGVkVGNwQnl0ZXNTZW50ID49IDAKICAgICAgICAgICAgICAgICAgICAgPyAoVHJhZmZpY1N0YXRzLmdldFVpZFR4Qnl0ZXMobVVpZCkgLSBtU3RhcnRlZFRjcEJ5dGVzU2VudCkgOiAwKTsKQEAgLTI0NzMsNyArMjQ3OCw3IEBACiAgICAgICAgICAqLwogICAgICAgICBib29sZWFuIHJlc2V0KCkgewogICAgICAgICAgICAgYm9vbGVhbiBhY3RpdmUgPSBmYWxzZTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAobVdpZmlSdW5uaW5nVGltZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGFjdGl2ZSB8PSAhbVdpZmlSdW5uaW5nVGltZXIucmVzZXQoQmF0dGVyeVN0YXRzSW1wbC50aGlzLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgYWN0aXZlIHw9IG1XaWZpUnVubmluZzsKQEAgLTI0OTgsMTAgKzI1MDMsMTAgQEAKICAgICAgICAgICAgICAgICBhY3RpdmUgfD0gIW1WaWRlb1R1cm5lZE9uVGltZXIucmVzZXQoQmF0dGVyeVN0YXRzSW1wbC50aGlzLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgYWN0aXZlIHw9IG1WaWRlb1R1cm5lZE9uOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIG1Mb2FkZWRUY3BCeXRlc1JlY2VpdmVkID0gbUxvYWRlZFRjcEJ5dGVzU2VudCA9IDA7CiAgICAgICAgICAgICBtQ3VycmVudFRjcEJ5dGVzUmVjZWl2ZWQgPSBtQ3VycmVudFRjcEJ5dGVzU2VudCA9IDA7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKG1Vc2VyQWN0aXZpdHlDb3VudGVycyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE5VTV9VU0VSX0FDVElWSVRZX1RZUEVTOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgbVVzZXJBY3Rpdml0eUNvdW50ZXJzW2ldLnJlc2V0KGZhbHNlKTsKQEAgLTI1NjUsNyArMjU3MCw3IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1QYWNrYWdlU3RhdHMuY2xlYXIoKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBtUGlkcy5jbGVhcigpOwogCiAgICAgICAgICAgICBpZiAoIWFjdGl2ZSkgewpAQCAtMjU5MywxMCArMjU5OCwxMCBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHJldHVybiAhYWN0aXZlOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHZvaWQgd3JpdGVUb1BhcmNlbExvY2tlZChQYXJjZWwgb3V0LCBsb25nIGJhdHRlcnlSZWFsdGltZSkgewogICAgICAgICAgICAgb3V0LndyaXRlSW50KG1XYWtlbG9ja1N0YXRzLnNpemUoKSk7CiAgICAgICAgICAgICBmb3IgKE1hcC5FbnRyeTxTdHJpbmcsIFVpZC5XYWtlbG9jaz4gd2FrZWxvY2tFbnRyeSA6IG1XYWtlbG9ja1N0YXRzLmVudHJ5U2V0KCkpIHsKQEAgLTI2MjUsNyArMjYzMCw3IEBACiAgICAgICAgICAgICAgICAgVWlkLlBrZyBwa2cgPSBwa2dFbnRyeS5nZXRWYWx1ZSgpOwogICAgICAgICAgICAgICAgIHBrZy53cml0ZVRvUGFyY2VsTG9ja2VkKG91dCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgb3V0LndyaXRlTG9uZyhtTG9hZGVkVGNwQnl0ZXNSZWNlaXZlZCk7CiAgICAgICAgICAgICBvdXQud3JpdGVMb25nKG1Mb2FkZWRUY3BCeXRlc1NlbnQpOwogICAgICAgICAgICAgb3V0LndyaXRlTG9uZyhjb21wdXRlQ3VycmVudFRjcEJ5dGVzUmVjZWl2ZWQoKSk7CkBAIC0yNzE5LDcgKzI3MjQsNyBAQAogICAgICAgICAgICAgICAgIHBrZy5yZWFkRnJvbVBhcmNlbExvY2tlZChpbik7CiAgICAgICAgICAgICAgICAgbVBhY2thZ2VTdGF0cy5wdXQocGFja2FnZU5hbWUsIHBrZyk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgbUxvYWRlZFRjcEJ5dGVzUmVjZWl2ZWQgPSBpbi5yZWFkTG9uZygpOwogICAgICAgICAgICAgbUxvYWRlZFRjcEJ5dGVzU2VudCA9IGluLnJlYWRMb25nKCk7CiAgICAgICAgICAgICBtQ3VycmVudFRjcEJ5dGVzUmVjZWl2ZWQgPSBpbi5yZWFkTG9uZygpOwpAQCAtMjg0MCw3ICsyODQ1LDcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgcmV0dXJuICF3bGFjdGl2ZTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICB2b2lkIHJlYWRGcm9tUGFyY2VsTG9ja2VkKEFycmF5TGlzdDxVbnBsdWdnYWJsZT4gdW5wbHVnZ2FibGVzLCBQYXJjZWwgaW4pIHsKICAgICAgICAgICAgICAgICBtVGltZXJQYXJ0aWFsID0gcmVhZFRpbWVyRnJvbVBhcmNlbChXQUtFX1RZUEVfUEFSVElBTCwKICAgICAgICAgICAgICAgICAgICAgICAgIG1QYXJ0aWFsVGltZXJzLCB1bnBsdWdnYWJsZXMsIGluKTsKQEAgLTI4NzAsNyArMjg3NSw3IEBACiAgICAgICAgIHB1YmxpYyBmaW5hbCBjbGFzcyBTZW5zb3IgZXh0ZW5kcyBCYXR0ZXJ5U3RhdHMuVWlkLlNlbnNvciB7CiAgICAgICAgICAgICBmaW5hbCBpbnQgbUhhbmRsZTsKICAgICAgICAgICAgIFN0b3B3YXRjaFRpbWVyIG1UaW1lcjsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBwdWJsaWMgU2Vuc29yKGludCBoYW5kbGUpIHsKICAgICAgICAgICAgICAgICBtSGFuZGxlID0gaGFuZGxlOwogICAgICAgICAgICAgfQpAQCAtMjg5Niw3ICsyOTAxLDcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHZvaWQgcmVhZEZyb21QYXJjZWxMb2NrZWQoQXJyYXlMaXN0PFVucGx1Z2dhYmxlPiB1bnBsdWdnYWJsZXMsIFBhcmNlbCBpbikgewogICAgICAgICAgICAgICAgIG1UaW1lciA9IHJlYWRUaW1lckZyb21QYXJjZWwodW5wbHVnZ2FibGVzLCBpbik7CiAgICAgICAgICAgICB9CkBAIC0zMDE4LDcgKzMwMjMsNyBAQAogCiAgICAgICAgICAgICBwdWJsaWMgdm9pZCBwbHVnKGxvbmcgYmF0dGVyeVVwdGltZSwgbG9uZyBiYXR0ZXJ5UmVhbHRpbWUpIHsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICB2b2lkIGRldGFjaCgpIHsKICAgICAgICAgICAgICAgICBtVW5wbHVnZ2FibGVzLnJlbW92ZSh0aGlzKTsKICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1TcGVlZEJpbnMubGVuZ3RoOyBpKyspIHsKQEAgLTMwMjksNyArMzAzNCw3IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgcHVibGljIGludCBjb3VudEV4Y2Vzc2l2ZVBvd2VycygpIHsKICAgICAgICAgICAgICAgICByZXR1cm4gbUV4Y2Vzc2l2ZVBvd2VyICE9IG51bGwgPyBtRXhjZXNzaXZlUG93ZXIuc2l6ZSgpIDogMDsKICAgICAgICAgICAgIH0KQEAgLTMyOTYsMTggKzMzMDEsMTggQEAKICAgICAgICAgICAgIFBrZygpIHsKICAgICAgICAgICAgICAgICBtVW5wbHVnZ2FibGVzLmFkZCh0aGlzKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBwdWJsaWMgdm9pZCB1bnBsdWcobG9uZyBiYXR0ZXJ5VXB0aW1lLCBsb25nIGJhdHRlcnlSZWFsdGltZSkgewogICAgICAgICAgICAgICAgIG1VbnBsdWdnZWRXYWtldXBzID0gbVdha2V1cHM7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHBsdWcobG9uZyBiYXR0ZXJ5VXB0aW1lLCBsb25nIGJhdHRlcnlSZWFsdGltZSkgewogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHZvaWQgZGV0YWNoKCkgewogICAgICAgICAgICAgICAgIG1VbnBsdWdnYWJsZXMucmVtb3ZlKHRoaXMpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHZvaWQgcmVhZEZyb21QYXJjZWxMb2NrZWQoUGFyY2VsIGluKSB7CiAgICAgICAgICAgICAgICAgbVdha2V1cHMgPSBpbi5yZWFkSW50KCk7CiAgICAgICAgICAgICAgICAgbUxvYWRlZFdha2V1cHMgPSBpbi5yZWFkSW50KCk7CkBAIC0zNDU4LDcgKzM0NjMsNyBAQAogICAgICAgICAgICAgICAgIFNlcnYoKSB7CiAgICAgICAgICAgICAgICAgICAgIG1VbnBsdWdnYWJsZXMuYWRkKHRoaXMpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHVucGx1Zyhsb25nIGJhdHRlcnlVcHRpbWUsIGxvbmcgYmF0dGVyeVJlYWx0aW1lKSB7CiAgICAgICAgICAgICAgICAgICAgIG1VbnBsdWdnZWRTdGFydFRpbWUgPSBnZXRTdGFydFRpbWVUb05vd0xvY2tlZChiYXR0ZXJ5VXB0aW1lKTsKICAgICAgICAgICAgICAgICAgICAgbVVucGx1Z2dlZFN0YXJ0cyA9IG1TdGFydHM7CkBAIC0zNDY3LDExICszNDcyLDExIEBACiAKICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBwbHVnKGxvbmcgYmF0dGVyeVVwdGltZSwgbG9uZyBiYXR0ZXJ5UmVhbHRpbWUpIHsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICB2b2lkIGRldGFjaCgpIHsKICAgICAgICAgICAgICAgICAgICAgbVVucGx1Z2dhYmxlcy5yZW1vdmUodGhpcyk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgdm9pZCByZWFkRnJvbVBhcmNlbExvY2tlZChQYXJjZWwgaW4pIHsKICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0VGltZSA9IGluLnJlYWRMb25nKCk7CiAgICAgICAgICAgICAgICAgICAgIG1SdW5uaW5nU2luY2UgPSBpbi5yZWFkTG9uZygpOwpAQCAtMzY0Niw3ICszNjUxLDcgQEAKICAgICAgICAgcHVibGljIFNwYXJzZUFycmF5PD8gZXh0ZW5kcyBQaWQ+IGdldFBpZFN0YXRzKCkgewogICAgICAgICAgICAgcmV0dXJuIG1QaWRzOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyBQaWQgZ2V0UGlkU3RhdHNMb2NrZWQoaW50IHBpZCkgewogICAgICAgICAgICAgUGlkIHAgPSBtUGlkcy5nZXQocGlkKTsKICAgICAgICAgICAgIGlmIChwID09IG51bGwpIHsKQEAgLTM3ODQsNyArMzc4OSw3IEBACiAgICAgICAgICAgICAgICAgcC5hZGRFeGNlc3NpdmVXYWtlKG92ZXJUaW1lLCB1c2VkVGltZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcHVibGljIHZvaWQgcmVwb3J0RXhjZXNzaXZlQ3B1TG9ja2VkKFN0cmluZyBwcm9jLCBsb25nIG92ZXJUaW1lLCBsb25nIHVzZWRUaW1lKSB7CiAgICAgICAgICAgICBQcm9jIHAgPSBnZXRQcm9jZXNzU3RhdHNMb2NrZWQocHJvYyk7CiAgICAgICAgICAgICBpZiAocCAhPSBudWxsKSB7CkBAIC0zNzk2LDcgKzM4MDEsNyBAQAogICAgICAgICAgICAgU3RvcHdhdGNoVGltZXIgdCA9IGdldFNlbnNvclRpbWVyTG9ja2VkKHNlbnNvciwgdHJ1ZSk7CiAgICAgICAgICAgICBpZiAodCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgdC5zdGFydFJ1bm5pbmdMb2NrZWQoQmF0dGVyeVN0YXRzSW1wbC50aGlzKTsKLSAgICAgICAgICAgIH0gICAgICAgICAgICAKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIG5vdGVTdG9wU2Vuc29yKGludCBzZW5zb3IpIHsKQEAgLTM4MDQsMTYgKzM4MDksMTYgQEAKICAgICAgICAgICAgIFN0b3B3YXRjaFRpbWVyIHQgPSBnZXRTZW5zb3JUaW1lckxvY2tlZChzZW5zb3IsIGZhbHNlKTsKICAgICAgICAgICAgIGlmICh0ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICB0LnN0b3BSdW5uaW5nTG9ja2VkKEJhdHRlcnlTdGF0c0ltcGwudGhpcyk7Ci0gICAgICAgICAgICB9ICAgICAgICAgICAgCisgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcHVibGljIHZvaWQgbm90ZVN0YXJ0R3BzKCkgewogICAgICAgICAgICAgU3RvcHdhdGNoVGltZXIgdCA9IGdldFNlbnNvclRpbWVyTG9ja2VkKFNlbnNvci5HUFMsIHRydWUpOwogICAgICAgICAgICAgaWYgKHQgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHQuc3RhcnRSdW5uaW5nTG9ja2VkKEJhdHRlcnlTdGF0c0ltcGwudGhpcyk7Ci0gICAgICAgICAgICB9ICAKKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgdm9pZCBub3RlU3RvcEdwcygpIHsKICAgICAgICAgICAgIFN0b3B3YXRjaFRpbWVyIHQgPSBnZXRTZW5zb3JUaW1lckxvY2tlZChTZW5zb3IuR1BTLCBmYWxzZSk7CiAgICAgICAgICAgICBpZiAodCAhPSBudWxsKSB7CkBAIC0zOTAzLDEyICszOTA4LDEyIEBACiAgICAgcHVibGljIEhpc3RvcnlJdGVtIGdldEhpc3RvcnkoKSB7CiAgICAgICAgIHJldHVybiBtSGlzdG9yeTsKICAgICB9Ci0gICAgCisKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgbG9uZyBnZXRIaXN0b3J5QmFzZVRpbWUoKSB7CiAgICAgICAgIHJldHVybiBtSGlzdG9yeUJhc2VUaW1lOwogICAgIH0KLSAgICAKKwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBpbnQgZ2V0U3RhcnRDb3VudCgpIHsKICAgICAgICAgcmV0dXJuIG1TdGFydENvdW50OwpAQCAtMzkzMCw3ICszOTM1LDcgQEAKICAgICAgICAgbVVucGx1Z2dlZEJhdHRlcnlVcHRpbWUgPSBnZXRCYXR0ZXJ5VXB0aW1lTG9ja2VkKG1VcHRpbWVTdGFydCk7CiAgICAgICAgIG1VbnBsdWdnZWRCYXR0ZXJ5UmVhbHRpbWUgPSBnZXRCYXR0ZXJ5UmVhbHRpbWVMb2NrZWQobVJlYWx0aW1lU3RhcnQpOwogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHJlc2V0QWxsU3RhdHNMb2NrZWQoKSB7CiAgICAgICAgIG1TdGFydENvdW50ID0gMDsKICAgICAgICAgaW5pdFRpbWVzKCk7CkBAIC0zOTUyLDI0ICszOTU3LDI0IEBACiAgICAgICAgIG1XaWZpT25UaW1lci5yZXNldCh0aGlzLCBmYWxzZSk7CiAgICAgICAgIG1HbG9iYWxXaWZpUnVubmluZ1RpbWVyLnJlc2V0KHRoaXMsIGZhbHNlKTsKICAgICAgICAgbUJsdWV0b290aE9uVGltZXIucmVzZXQodGhpcywgZmFsc2UpOwotICAgICAgICAKKwogICAgICAgICBmb3IgKGludCBpPTA7IGk8bVVpZFN0YXRzLnNpemUoKTsgaSsrKSB7CiAgICAgICAgICAgICBpZiAobVVpZFN0YXRzLnZhbHVlQXQoaSkucmVzZXQoKSkgewogICAgICAgICAgICAgICAgIG1VaWRTdGF0cy5yZW1vdmUobVVpZFN0YXRzLmtleUF0KGkpKTsKICAgICAgICAgICAgICAgICBpLS07CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgaWYgKG1LZXJuZWxXYWtlbG9ja1N0YXRzLnNpemUoKSA+IDApIHsKICAgICAgICAgICAgIGZvciAoU2FtcGxpbmdUaW1lciB0aW1lciA6IG1LZXJuZWxXYWtlbG9ja1N0YXRzLnZhbHVlcygpKSB7CiAgICAgICAgICAgICAgICAgbVVucGx1Z2dhYmxlcy5yZW1vdmUodGltZXIpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgbUtlcm5lbFdha2Vsb2NrU3RhdHMuY2xlYXIoKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBjbGVhckhpc3RvcnlMb2NrZWQoKTsKICAgICB9Ci0gICAgCisKICAgICB2b2lkIHNldE9uQmF0dG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QodGhpcykgewogICAgICAgICAgICAgcmV0dXJuIGdldERpc2NoYXJnZUN1cnJlbnRMZXZlbExvY2tlZCgpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGludCBnZXREaXNjaGFyZ2VDdXJyZW50TGV2ZWxMb2NrZWQoKSB7CiAgICAgICAgICAgICByZXR1cm4gbURpc2NoYXJnZUN1cnJlbnRMZXZlbDsKICAgICB9CkBAIC00NDI0LDcgKzQ0MjksNyBAQAogICAgICAgICB3cml0ZVN5bmNMb2NrZWQoKTsKICAgICAgICAgbVNodXR0aW5nRG93biA9IHRydWU7CiAgICAgfQotICAgIAorCiAgICAgUGFyY2VsIG1QZW5kaW5nV3JpdGUgPSBudWxsOwogICAgIGZpbmFsIFJlZW50cmFudExvY2sgbVdyaXRlTG9jayA9IG5ldyBSZWVudHJhbnRMb2NrKCk7CiAKQEAgLTQ0NDUsNyArNDQ1MCw3IEBACiAgICAgICAgIGlmIChtU2h1dHRpbmdEb3duKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgUGFyY2VsIG91dCA9IFBhcmNlbC5vYnRhaW4oKTsKICAgICAgICAgd3JpdGVTdW1tYXJ5VG9QYXJjZWwob3V0KTsKICAgICAgICAgbUxhc3RXcml0ZVRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKQEAgLTQ1NDUsNyArNDU1MCw3IEBACiAgICAgICAgIH0gY2F0Y2goamF2YS5pby5JT0V4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICBTbG9nLmUoIkJhdHRlcnlTdGF0cyIsICJFcnJvciByZWFkaW5nIGJhdHRlcnkgc3RhdGlzdGljcyIsIGUpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIGFkZEhpc3RvcnlSZWNvcmRMb2NrZWQoU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCksIEhpc3RvcnlJdGVtLkNNRF9TVEFSVCk7CiAgICAgfQogCkBAIC00NTY0LDcgKzQ1NjksNyBAQAogICAgICAgICAgICAgICAgIG1IaXN0b3J5QmFzZVRpbWUgPSByZWMudGltZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBsb25nIG9sZG5vdyA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpIC0gKDUqNjAqMTAwKTsKICAgICAgICAgaWYgKG9sZG5vdyA+IDApIHsKICAgICAgICAgICAgIC8vIElmIHRoZSBzeXN0ZW0gcHJvY2VzcyBoYXMgcmVzdGFydGVkLCBidXQgbm90IHRoZSBlbnRpcmUKQEAgLTQ1NzYsNyArNDU4MSw3IEBACiAgICAgICAgICAgICBtSGlzdG9yeUJhc2VUaW1lIC09IG9sZG5vdzsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHZvaWQgd3JpdGVIaXN0b3J5KFBhcmNlbCBvdXQpIHsKICAgICAgICAgSGlzdG9yeUl0ZW0gcmVjID0gbUhpc3Rvcnk7CiAgICAgICAgIHdoaWxlIChyZWMgIT0gbnVsbCkgewpAQCAtNDU4NSw3ICs0NTkwLDcgQEAKICAgICAgICAgfQogICAgICAgICBvdXQud3JpdGVMb25nKC0xKTsKICAgICB9Ci0gICAgCisKICAgICBwcml2YXRlIHZvaWQgcmVhZFN1bW1hcnlGcm9tUGFyY2VsKFBhcmNlbCBpbikgewogICAgICAgICBmaW5hbCBpbnQgdmVyc2lvbiA9IGluLnJlYWRJbnQoKTsKICAgICAgICAgaWYgKHZlcnNpb24gIT0gVkVSU0lPTikgewpAQCAtNDU5NSw3ICs0NjAwLDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIHJlYWRIaXN0b3J5KGluKTsKLSAgICAgICAgCisKICAgICAgICAgbVN0YXJ0Q291bnQgPSBpbi5yZWFkSW50KCk7CiAgICAgICAgIG1CYXR0ZXJ5VXB0aW1lID0gaW4ucmVhZExvbmcoKTsKICAgICAgICAgbUJhdHRlcnlSZWFsdGltZSA9IGluLnJlYWRMb25nKCk7CkBAIC00NjA1LDkgKzQ2MTAsOSBAQAogICAgICAgICBtRGlzY2hhcmdlQ3VycmVudExldmVsID0gaW4ucmVhZEludCgpOwogICAgICAgICBtTG93RGlzY2hhcmdlQW1vdW50U2luY2VDaGFyZ2UgPSBpbi5yZWFkSW50KCk7CiAgICAgICAgIG1IaWdoRGlzY2hhcmdlQW1vdW50U2luY2VDaGFyZ2UgPSBpbi5yZWFkSW50KCk7Ci0gICAgICAgIAorCiAgICAgICAgIG1TdGFydENvdW50Kys7Ci0gICAgICAgIAorCiAgICAgICAgIG1TY3JlZW5PbiA9IGZhbHNlOwogICAgICAgICBtU2NyZWVuT25UaW1lci5yZWFkU3VtbWFyeUZyb21QYXJjZWxMb2NrZWQoaW4pOwogICAgICAgICBmb3IgKGludCBpPTA7IGk8TlVNX1NDUkVFTl9CUklHSFRORVNTX0JJTlM7IGkrKykgewpAQCAtNDY4Nyw3ICs0NjkyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgdS5tVXNlckFjdGl2aXR5Q291bnRlcnNbaV0ucmVhZFN1bW1hcnlGcm9tUGFyY2VsTG9ja2VkKGluKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaW50IE5XID0gaW4ucmVhZEludCgpOwogICAgICAgICAgICAgaWYgKE5XID4gMTAwMDApIHsKICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAiRmlsZSBjb3JydXB0OiB0b28gbWFueSB3YWtlIGxvY2tzICIgKyBOVyk7CkBAIC00NzgwLDcgKzQ3ODUsNyBAQAogICAgICAgICBvdXQud3JpdGVJbnQoVkVSU0lPTik7CiAKICAgICAgICAgd3JpdGVIaXN0b3J5KG91dCk7Ci0gICAgICAgIAorCiAgICAgICAgIG91dC53cml0ZUludChtU3RhcnRDb3VudCk7CiAgICAgICAgIG91dC53cml0ZUxvbmcoY29tcHV0ZUJhdHRlcnlVcHRpbWUoTk9XX1NZUywgU1RBVFNfU0lOQ0VfQ0hBUkdFRCkpOwogICAgICAgICBvdXQud3JpdGVMb25nKGNvbXB1dGVCYXR0ZXJ5UmVhbHRpbWUoTk9XUkVBTF9TWVMsIFNUQVRTX1NJTkNFX0NIQVJHRUQpKTsKQEAgLTQ3OTAsNyArNDc5NSw3IEBACiAgICAgICAgIG91dC53cml0ZUludChtRGlzY2hhcmdlQ3VycmVudExldmVsKTsKICAgICAgICAgb3V0LndyaXRlSW50KG1Mb3dEaXNjaGFyZ2VBbW91bnRTaW5jZUNoYXJnZSk7CiAgICAgICAgIG91dC53cml0ZUludChtSGlnaERpc2NoYXJnZUFtb3VudFNpbmNlQ2hhcmdlKTsKLSAgICAgICAgCisKICAgICAgICAgbVNjcmVlbk9uVGltZXIud3JpdGVTdW1tYXJ5RnJvbVBhcmNlbExvY2tlZChvdXQsIE5PV1JFQUwpOwogICAgICAgICBmb3IgKGludCBpPTA7IGk8TlVNX1NDUkVFTl9CUklHSFRORVNTX0JJTlM7IGkrKykgewogICAgICAgICAgICAgbVNjcmVlbkJyaWdodG5lc3NUaW1lcltpXS53cml0ZVN1bW1hcnlGcm9tUGFyY2VsTG9ja2VkKG91dCwgTk9XUkVBTCk7CkBAIC00ODE5LDE0ICs0ODI0LDE0IEBACiAgICAgICAgICAgICAgICAgb3V0LndyaXRlSW50KDApOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIG91dC53cml0ZUludChzTnVtU3BlZWRTdGVwcyk7CiAgICAgICAgIGZpbmFsIGludCBOVSA9IG1VaWRTdGF0cy5zaXplKCk7CiAgICAgICAgIG91dC53cml0ZUludChOVSk7CiAgICAgICAgIGZvciAoaW50IGl1ID0gMDsgaXUgPCBOVTsgaXUrKykgewogICAgICAgICAgICAgb3V0LndyaXRlSW50KG1VaWRTdGF0cy5rZXlBdChpdSkpOwogICAgICAgICAgICAgVWlkIHUgPSBtVWlkU3RhdHMudmFsdWVBdChpdSk7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKHUubVdpZmlSdW5uaW5nVGltZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIG91dC53cml0ZUludCgxKTsKICAgICAgICAgICAgICAgICB1Lm1XaWZpUnVubmluZ1RpbWVyLndyaXRlU3VtbWFyeUZyb21QYXJjZWxMb2NrZWQob3V0LCBOT1dSRUFMKTsKQEAgLTQ4NzIsNyArNDg3Nyw3IEBACiAgICAgICAgICAgICAgICAgICAgIHUubVVzZXJBY3Rpdml0eUNvdW50ZXJzW2ldLndyaXRlU3VtbWFyeUZyb21QYXJjZWxMb2NrZWQob3V0KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaW50IE5XID0gdS5tV2FrZWxvY2tTdGF0cy5zaXplKCk7CiAgICAgICAgICAgICBvdXQud3JpdGVJbnQoTlcpOwogICAgICAgICAgICAgaWYgKE5XID4gMCkgewpAQCAtNDk2NCw3ICs0OTY5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBvdXQud3JpdGVMb25nKHUuZ2V0VGNwQnl0ZXNSZWNlaXZlZChTVEFUU19TSU5DRV9DSEFSR0VEKSk7CiAgICAgICAgICAgICBvdXQud3JpdGVMb25nKHUuZ2V0VGNwQnl0ZXNTZW50KFNUQVRTX1NJTkNFX0NIQVJHRUQpKTsKICAgICAgICAgfQpAQCAtNDk3Myw3ICs0OTc4LDcgQEAKICAgICBwdWJsaWMgdm9pZCByZWFkRnJvbVBhcmNlbChQYXJjZWwgaW4pIHsKICAgICAgICAgcmVhZEZyb21QYXJjZWxMb2NrZWQoaW4pOwogICAgIH0KLSAgICAKKwogICAgIHZvaWQgcmVhZEZyb21QYXJjZWxMb2NrZWQoUGFyY2VsIGluKSB7CiAgICAgICAgIGludCBtYWdpYyA9IGluLnJlYWRJbnQoKTsKICAgICAgICAgaWYgKG1hZ2ljICE9IE1BR0lDKSB7CkBAIC00OTgxLDcgKzQ5ODYsNyBAQAogICAgICAgICB9CiAKICAgICAgICAgcmVhZEhpc3RvcnkoaW4pOwotICAgICAgICAKKwogICAgICAgICBtU3RhcnRDb3VudCA9IGluLnJlYWRJbnQoKTsKICAgICAgICAgbUJhdHRlcnlVcHRpbWUgPSBpbi5yZWFkTG9uZygpOwogICAgICAgICBtQmF0dGVyeUxhc3RVcHRpbWUgPSAwOwpAQCAtNTA1Niw3ICs1MDYxLDcgQEAKICAgICAgICAgICAgICAgICBtS2VybmVsV2FrZWxvY2tTdGF0cy5wdXQod2FrZWxvY2tOYW1lLCBrd2x0KTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBtUGFydGlhbFRpbWVycy5jbGVhcigpOwogICAgICAgICBtRnVsbFRpbWVycy5jbGVhcigpOwogICAgICAgICBtV2luZG93VGltZXJzLmNsZWFyKCk7CkBAIC01MDg0LDE4ICs1MDg5LDE4IEBACiAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbFdpdGhvdXRVaWRzKFBhcmNlbCBvdXQsIGludCBmbGFncykgewogICAgICAgICB3cml0ZVRvUGFyY2VsTG9ja2VkKG91dCwgZmFsc2UsIGZsYWdzKTsKICAgICB9Ci0gICAgCi0gICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpIAorCisgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCiAgICAgdm9pZCB3cml0ZVRvUGFyY2VsTG9ja2VkKFBhcmNlbCBvdXQsIGJvb2xlYW4gaW5jbFVpZHMsIGludCBmbGFncykgewogICAgICAgICBmaW5hbCBsb25nIHVTZWNVcHRpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSAqIDEwMDA7CiAgICAgICAgIG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KKyAgICAgICAgICogSWYgd2UncmUgYWxyZWFkeSB3cml0aW5nIGEgc25hcHNob3QsIGRvbid0IGJvdGhlciBlbnF1ZXVlaW5nIGFub3RoZXIKICAgICAgICAgICogcmVxdWVzdCByaWdodCBub3cuIFRoaXMgd2lsbCByZWR1Y2UgdGhlIG51bWJlciBvZiBpbmRpdmlkdWFsCiAgICAgICAgICAqIHNuYXBzaG90cyBhbmQgaW4gdHVybiB0aGUgdG90YWwgYW1vdW50IG9mIG1lbW9yeSBjb25zdW1lZCAob25lIGJpZwogICAgICAgICAgKiBzbmFwc2hvdCBpcyBzbWFsbGVyIHRoYW4gTiBzdWJzZXQgc25hcHNob3RzKS4KICAgICAgICAgICovCi0gICAgICAgIGlmICghcGVuZGluZykgewotICAgICAgICAgICAgcGVuZGluZyA9IHRydWU7CisgICAgICAgIGlmIChwZW5kaW5nLmNvbXBhcmVBbmRTZXQoZmFsc2UsIHRydWUpKSB7CiAgICAgICAgICAgICBzbmFwc2hvdFdyaXRlci5leGVjdXRlKG5ldyBSdW5uYWJsZSgpIHsKICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBkaXIgPQotICAgICAgICAgICAgICAgICAgICAgICAgRW52aXJvbm1lbnQuZ2V0RXh0ZXJuYWxTdG9yYWdlRGlyZWN0b3J5KCkuZ2V0UGF0aCgpICsgIi9zbmFwc2hvdHMiOwogICAgICAgICAgICAgICAgICAgICBpZiAoIWRpck1hZGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBGaWxlKGRpcikubWtkaXJzKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3IEZpbGUoZGlyKS5pc0RpcmVjdG9yeSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBGaWxlIGRpciA9IG5ldyBGaWxlKFNOQVBTSE9UX0RJUik7CisgICAgICAgICAgICAgICAgICAgICAgICBkaXIubWtkaXJzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZGlyZWN0b3J5IG5lZWRzIHRvIGJlIHdyaXRhYmxlIHRvIGFueWJvZHkKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpci5zZXRXcml0YWJsZSh0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZGlyZWN0b3J5IG5lZWRzIHRvIGJlIGV4ZWN1dGFibGUgdG8gYW55Ym9keQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3Qga25vdyB3aHkgeWV0LCBidXQgbW9kZSA3MjMgd291bGQgd29yaywgd2hpbGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1vZGUgNzIyIHRocm93cyBGaWxlTm90Rm91bmRFeGVjcHRpb24gYXQgbGluZSAxNTEKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpci5zZXRFeGVjdXRhYmxlKHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXcgRmlsZShTTkFQU0hPVF9ESVIpLmlzRGlyZWN0b3J5KCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXJNYWRlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ3JlYXRpb24gb2YgIiArIGRpciArICIgZmFpbGVkLiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNyZWF0aW9uIG9mICIgKyBTTkFQU0hPVF9ESVIgKyAiIGZhaWxlZC4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZW5kaW5nLnNldChmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZVNuYXBzaG90KGRpciwgbmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZVNuYXBzaG90KFNOQVBTSE9UX0RJUiwgcHJvY2Vzc05hbWUsIHBhY2thZ2VJbmZvKTsKICAgICAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBlbmRpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBlbmRpbmcuc2V0KGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0pOwpAQCAtMTI0LDE1ICsxMzcsMTUgQEAKICAgICAgICAgaWYgKCFlbmFibGVkKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KLQotICAgICAgICBTdHJpbmcgZGlyID0gIi9kYXRhL3p5Z290ZS9zbmFwc2hvdHMiOwotICAgICAgICBuZXcgRmlsZShkaXIpLm1rZGlycygpOwotICAgICAgICB3cml0ZVNuYXBzaG90KGRpciwgInp5Z290ZSIpOworICAgICAgICB3cml0ZVNuYXBzaG90KCJ6eWdvdGUiLCBudWxsKTsKICAgICAgICAgSU5TVEFOQ0Uuc2h1dGRvd24oKTsKICAgICAgICAgSU5TVEFOQ0UgPSBudWxsOwogICAgIH0KIAotICAgIHByaXZhdGUgc3RhdGljIHZvaWQgd3JpdGVTbmFwc2hvdChTdHJpbmcgZGlyLCBTdHJpbmcgbmFtZSkgeworICAgIC8qKgorICAgICAqIHBhc3MgaW4gUGFja2FnZUluZm8gdG8gcmV0cmlldmUgdmFyaW91cyB2YWx1ZXMgZm9yIHNuYXBzaG90IGhlYWRlcgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgd3JpdGVTbmFwc2hvdChTdHJpbmcgZGlyLCBTdHJpbmcgcHJvY2Vzc05hbWUsIFBhY2thZ2VJbmZvIHBhY2thZ2VJbmZvKSB7CiAgICAgICAgIGlmICghZW5hYmxlZCkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CkBAIC0xNDQsNDAgKzE1Nyw1NSBAQAogICAgICAgICAgKiB3ZSBjYXB0dXJlIHR3byBzbmFwc2hvdHMgaW4gcmFwaWQgc3VjY2Vzc2lvbi4KICAgICAgICAgICovCiAgICAgICAgIGxvbmcgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKLSAgICAgICAgU3RyaW5nIHBhdGggPSBkaXIgKyAiLyIgKyBuYW1lLnJlcGxhY2UoJzonLCAnLicpICsgIi0iCi0gICAgICAgICAgICAgICAgKyBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSArICIuc25hcHNob3QiOwotCi0gICAgICAgIC8vIFRyeSB0byBvcGVuIHRoZSBmaWxlIGEgZmV3IHRpbWVzLiBUaGUgU0QgY2FyZCBtYXkgbm90IGJlIG1vdW50ZWQuCi0gICAgICAgIFByaW50U3RyZWFtIG91dDsKLSAgICAgICAgaW50IGNvdW50ID0gMDsKLSAgICAgICAgd2hpbGUgKHRydWUpIHsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgb3V0ID0gbmV3IFByaW50U3RyZWFtKG5ldyBCdWZmZXJlZE91dHB1dFN0cmVhbShuZXcgRmlsZU91dHB1dFN0cmVhbShwYXRoKSkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBpZiAoKytjb3VudCA+IDMpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ291bGQgbm90IG9wZW4gIiArIHBhdGggKyAiLiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gU2xlZXAgZm9yIGEgYml0IGFuZCB0aGVuIHRyeSBhZ2Fpbi4KLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBUaHJlYWQuc2xlZXAoMjUwMCk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZTEpIHsgLyogaWdub3JlICovIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCisgICAgICAgIFN0cmluZyBuYW1lID0gcHJvY2Vzc05hbWUucmVwbGFjZUFsbCgiOiIsICIuIik7CisgICAgICAgIFN0cmluZyBwYXRoID0gZGlyICsgIi8iICsgbmFtZSArICItIiArU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgKyAiLnNuYXBzaG90IjsKKyAgICAgICAgUHJpbnRTdHJlYW0gb3V0ID0gbnVsbDsKICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG91dCA9IG5ldyBQcmludFN0cmVhbShuZXcgQnVmZmVyZWRPdXRwdXRTdHJlYW0obmV3IEZpbGVPdXRwdXRTdHJlYW0ocGF0aCkpKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ291bGQgbm90IG9wZW4gIiArIHBhdGggKyAiOiIgKyBlKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgZ2VuZXJhdGVTbmFwc2hvdEhlYWRlcihuYW1lLCBwYWNrYWdlSW5mbywgb3V0KTsKICAgICAgICAgICAgIElOU1RBTkNFLndyaXRlSHByb2ZEYXRhKG91dCk7CiAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICBvdXQuY2xvc2UoKTsKICAgICAgICAgfQogICAgICAgICBpZiAob3V0LmNoZWNrRXJyb3IoKSkgewogICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3Igd3JpdGluZyBzbmFwc2hvdC4iKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGxvbmcgZWxhcHNlZCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gc3RhcnQ7Ci0gICAgICAgICAgICBMb2cuaShUQUcsICJXcm90ZSBzbmFwc2hvdCBmb3IgIiArIG5hbWUKLSAgICAgICAgICAgICAgICAgICsgIiBpbiAiICsgZWxhcHNlZCArICJtcy4iKTsKKyAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQorICAgICAgICAvLyBzZXQgZmlsZSByZWFkYWJsZSB0byB0aGUgd29ybGQgc28gdGhhdCBTYW1wbGluZ1Byb2ZpbGVyU2VydmljZQorICAgICAgICAvLyBjYW4gcHV0IGl0IHRvIGRyb3Bib3gKKyAgICAgICAgbmV3IEZpbGUocGF0aCkuc2V0UmVhZGFibGUodHJ1ZSwgZmFsc2UpOworCisgICAgICAgIGxvbmcgZWxhcHNlZCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gc3RhcnQ7CisgICAgICAgIExvZy5pKFRBRywgIldyb3RlIHNuYXBzaG90IGZvciAiICsgbmFtZSArICIgaW4gIiArIGVsYXBzZWQgKyAibXMuIik7CisgICAgfQorCisgICAgLyoqCisgICAgICogZ2VuZXJhdGUgaGVhZGVyIGZvciBzbmFwc2hvdHMsIHdpdGggdGhlIGZvbGxvd2luZyBmb3JtYXQgKGxpa2UgaHR0cCBoZWFkZXIpOgorICAgICAqCisgICAgICogVmVyc2lvbjogPHZlcnNpb24gbnVtYmVyIG9mIHByb2ZpbGVyPlxuCisgICAgICogUHJvY2VzczogPHByb2Nlc3MgbmFtZT5cbgorICAgICAqIFBhY2thZ2U6IDxwYWNrYWdlIG5hbWUsIGlmIGV4aXN0cz5cbgorICAgICAqIFBhY2thZ2UtVmVyc2lvbjogPHZlcnNpb24gbnVtYmVyIG9mIHRoZSBwYWNrYWdlLCBpZiBleGlzdHM+XG4KKyAgICAgKiBCdWlsZDogPG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sZXIsIFN0cmluZyBkc3RQYWNrYWdlTmFtZSwgU3RyaW5nIGRzdENsYXNzTmFtZSwKKyAgICAgICAgICAgIGludCB0b2tlbikgeworICAgICAgICBpZiAoREJHKSBsb2coImNvbm5lY3Qgc3JjSGFuZGxlciB0byBkc3QgUGFja2FnZSAmIGNsYXNzIEUiKTsKKworICAgICAgICBtQ29ubmVjdGlvbiA9IG5ldyBBc3luY0NoYW5uZWxDb25uZWN0aW9uKHRva2VuKTsKKworICAgICAgICAvKiBJbml0aWFsaXplIHRoZSBzb3VyY2UgaW5mb3JtYXRpb24gKi8KKyAgICAgICAgbVNyY0NvbnRleHQgPSBzcmNDb250ZXh0OworICAgICAgICBtU3JjSGFuZGxlciA9IHNyY0hhbmRsZXI7CisgICAgICAgIG1TcmNNZXNzZW5nZXIgPSBuZXcgTWVzc2VuZ2VyKHNyY0hhbmRsZXIpOworCisgICAgICAgIC8qCisgICAgICAgICAqIEluaXRpYWxpemUgZGVzdGluYXRpb24gaW5mb3JtYXRpb24gdG8gbnVsbCB0aGV5IHdpbGwKKyAgICAgICAgICogYmUgaW5pdGlhbGl6ZWQgd2hlbiB0aGUgQXN5bmNDaGFubmVsQ29ubmVjdGlvbiNvblNlcnZpY2VDb25uZWN0ZWQKKyAgICAgICAgICogaXMgY2FsbGVkCisgICAgICAgICAqLworICAgICAgICBtRHN0TWVzc2VuZ2VyID0gbnVsbDsKKworICAgICAgICAvKiBTZW5kIGludGVudCB0byBjcmVhdGUgdGhlIGNvbm5lY3Rpb24gKi8KKyAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9NQUlOKTsKKyAgICAgICAgaW50ZW50LnNldENsYXNzTmFtZShkc3RQYWNrYWdlTmFtZSwgZHN0Q2xhc3NOYW1lKTsKKyAgICAgICAgYm9vbGVhbiByZXN1bHQgPSBzcmNDb250ZXh0LmJpbmRTZXJ2aWNlKGludGVudCwgbUNvbm5lY3Rpb24sIENvbnRleHQuQklORF9BVVRPX0NSRUFURSk7CisgICAgICAgIGlmICghcmVzdWx0KSB7CisgICAgICAgICAgICByZXBseUhhbGZDb25uZWN0ZWQoU1RBVFVTX0JJTkRJTkdfVU5TVUNDRVNTRlVMLCB0b2tlbik7CisgICAgICAgIH0KKworICAgICAgICBpZiAoREJHKSBsb2coImNvbm5lY3Qgc3JjSGFuZGxlciB0byBkc3QgUGFja2FnZSAmIGNsYXNzIFggcmVzdWx0PSIgKyByZXN1bHQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbm5lY3QgaGFuZGxlciB0byBuYW1lZCBwYWNrYWdlL2NsYXNzLgorICAgICAqCisgICAgICogU2VuZHMgYSBDTURfQ0hBTk5FTF9IQUxGX0NPTk5FQ1RFRCBtZXNzYWdlIHRvIHNyY0hhbmRsZXIgd2hlbiBjb21wbGV0ZS4KKyAgICAgKiAgICAgIG1zZy5hcmcxID0gc3RhdHVzCisgICAgICogICAgICBtc2cuYXJnMiA9IHRva2VuCisgICAgICoKKyAgICAgKiBAcGFyYW0gc3JjQ29udGV4dCBpcyB0aGUgY29udGV4dCBvZiB0aGUgc291cmNlCisgICAgICogQHBhcmFtIHNyY0hhbmRsZXIgaXMgdGhlIGhhbmRlciB0byByZWNlaXZlIENPTk5FQ1RFRCAmIERJU0NPTk5FQ1RFRAorICAgICAqICAgICAgICAgICAgbWVzc2FnZXMKKyAgICAgKiBAcGFyYW0gZHN0UGFja2FnZU5hbWUgaXMgdGhlIGRlc3RpbmF0aW9uIHBhY2thZ2UgbmFtZQorICAgICAqIEBwYXJhbSBkc3RDbGFzc05hbWUgaXMgdGhlIGZ1bGx5IHF1YWxpZmllZCBjbGFzcyBuYW1lIChpLmUuIGNvbnRhaW5zCisgICAgICogICAgICAgICAgICBwYWNrYWdlIG5hbWUpCisgICAgICogQHBhcmFtIHRva2VuIHJldHVybmVkIGluIG1zZy5hcmcyCisgICAgICovCisgICAgcHVibGljIHZvaWQgY29ubmVjdChDb250ZXh0IHNyY0NvbnRleHQsIEhhbmRsZXIgc3JjSGFuZGxlciwgU3RyaW5nIGRzdFBhY2thZ2VOYW1lLAorICAgICAgICAgICAgU3RyaW5nIGRzdENsYXNzTmFtZSwgaW50IHRva2VuKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiY29ubmVjdCBzcmNIYW5kbGVyIHRvIGRzdCBQYWNrYWdlICYgY2xhc3MgRSIpOworCisgICAgICAgIGZpbmFsIGNsYXNzIENvbm5lY3RBc3luYyBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKKyAgICAgICAgICAgIENvbnRleHQgbVNyY0N0eDsKKyAgICAgICAgICAgIEhhbmRsZXIgbVNyY0hkbHI7CisgICAgICAgICAgICBTdHJpbmcgbURzdFBhY2thZ2VOYW1lOworICAgICAgICAgICAgU3RyaW5nIG1Ec3RDbGFzc05hbWU7CisgICAgICAgICAgICBpbnQgbVRva2VuOworCisgICAgICAgICAgICBDb25uZWN0QXN5bmMoQ29udGV4dCBzcmNDb250ZXh0LCBIYW5kbGVyIHNyY0hhbmRsZXIsIFN0cmluZyBkc3RQYWNrYWdlTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGRzdENsYXNzTmFtZSwgaW50IHRva2VuKSB7CisgICAgICAgICAgICAgICAgbVNyY0N0eCA9IHNyY0NvbnRleHQ7CisgICAgICAgICAgICAgICAgbVNyY0hkbHIgPSBzcmNIYW5kbGVyOworICAgICAgICAgICAgICAgIG1Ec3RQYWNrYWdlTmFtZSA9IGRzdFBhY2thZ2VOYW1lOworICAgICAgICAgICAgICAgIG1Ec3RDbGFzc05hbWUgPSBkc3RDbGFzc05hbWU7CisgICAgICAgICAgICAgICAgbVRva2VuID0gdG9rZW47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0U3JjSGFuZGxlclRvUGFja2FnZShtU3JjQ3R4LCBtU3JjSGRsciwgbURzdFBhY2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gICAgfQorCisgICAgLyoqCisgICAgICogQ29ubmVjdCBzZXJ2aWNlIGFuZCBtZXNzZW5nZXIuCisgICAgICoKKyAgICAgKiBTZW5kcyBhIENNRF9DSEFOTkVMX0hBTEZfQ09OTkVDVEVEIG1lc3NhZ2UgdG8gc3JjQXN5bmNTZXJ2aWNlIHdoZW4gY29tcGxldGUuCisgICAgICogICAgICBtc2cuYXJnMSA9IHN0YXR1cworICAgICAqICAgICAgbXNnLmFyZzIgPSB0b2tlbgorICAgICAqCisgICAgICogQHBhcmFtIHNyY0FzeW5jU2VydmljZQorICAgICAqIEBwYXJhbSBkc3RNZXNzZW5nZXIKKyAgICAgKiBAcGFyYW0gdG9rZW4gcmV0dXJuZWQgaW4gbXNnLmFyZzIKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBjb25uZWN0KEFzeW5jU2VydmljZSBzcmNBc3luY1NlcnZpY2UsIE1lc3NlbmdlciBkc3RNZXNzZW5nZXIsIGludCB0b2tlbikgeworICAgICAgICBjb25uZWN0KHNyY0FzeW5jU2VydmljZSwgc3JjQXN5bmNTZXJ2aWNlLmdldEhhbmRsZXIoKSwgZHN0TWVzc2VuZ2VyLCB0b2tlbik7CisgICAgfQorCisgICAgLyoqCisgICAgICogVG8gY2xvc2UgdGhlIGNvbm5lY3Rpb24gY2FsbCB3aGVuIGhhbmRsZXIgcmVjZWl2ZXMgQ01EX0NIQU5ORUxfRElTQ09OTkVDVEVECisgICAgICovCisgICAgcHVibGljIHZvaWQgZGlzY29ubmVjdGVkKCkgeworICAgICAgICBtU3JjSGFuZGxlciA9IG51bGw7CisgICAgICAgIG1TcmNNZXNzZW5nZXIgPSBudWxsOworICAgICAgICBtRHN0TWVzc2VuZ2VyID0gbnVsbDsKKyAgICAgICAgbUNvbm5lY3Rpb24gPSBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIERpc2Nvbm5lY3QKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBkaXNjb25uZWN0KGludCB0b2tlbikgeworICAgICAgICBpZiAobUNvbm5lY3Rpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgbUNvbm5lY3Rpb24uc2V0VG9rZW4odG9rZW4pOworICAgICAgICAgICAgbVNyY0NvbnRleHQudW5iaW5kU2VydmljZShtQ29ubmVjdGlvbik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1TcmNIYW5kbGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gbVNyY0hhbmRsZXIub2J0YWluTWVzc2FnZShDTURfQ0hBTk5FTF9ESVNDT05ORUNURUQpOworICAgICAgICAgICAgbXNnLmFyZzEgPSBTVEFUVVNfU1VDQ0VTU0ZVTDsKKyAgICAgICAgICAgIG1zZy5hcmcyID0gdG9rZW47CisgICAgICAgICAgICBtc2cucmVwbHlUbyA9IG1Ec3RNZXNzZW5nZXI7CisgICAgICAgICAgICBtU3JjSGFuZGxlci5zZW5kTWVzc2FnZShtc2cpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2VuZCBhIG1lc3NhZ2UgdG8gdGhlIGRlc3RpbmF0aW9uIGhhbmRsZXIuCisgICAgICoKKyAgICAgKiBAcGFyYW0gbXNnCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2VuZE1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgbXNnLnJlcGx5VG8gPSBtU3JjTWVzc2VuZ2VyOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbURzdE1lc3Nlbmdlci5zZW5kKG1zZyk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBsb2coIlRPRE86IGhhbmRsZSBzZW5kTWVzc2FnZSBSZW1vdGVFeGNlcHRpb24iICsgZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZW5kIGEgbWVzc2FnZSB0byB0aGUgZGVzdGluYXRpb24gaGFuZGxlcgorICAgICAqCisgICAgICogQHBhcmFtIHdoYXQKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZW5kTWVzc2FnZShpbnQgd2hhdCkgeworICAgICAgICBNZXNzYWdlIG1zZyA9IE1lc3NhZ2Uub2J0YWluKCk7CisgICAgICAgIG1zZy53aGF0ID0gd2hhdDsKKyAgICAgICAgc2VuZE1lc3NhZ2UobXNnKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZW5kIGEgbWVzc2FnZSB0byB0aGUgZGVzdGluYXRpb24gaGFuZGxlcgorICAgICAqCisgICAgICogQHBhcmFtIHdoYXQKKyAgICAgKiBAcGFyYW0gYXJnMQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNlbmRNZXNzYWdlKGludCB3aGF0LCBpbnQgYXJnMSkgeworICAgICAgICBNZXNzYWdlIG1zZyA9IE1lc3NhZ2Uub2J0YWluKCk7CisgICAgICAgIG1zZy53aGF0ID0gd2hhdDsKKyAgICAgICAgbXNnLmFyZzEgPSBhcmcxOworICAgICAgICBzZW5kTWVzc2FnZShtc2cpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNlbmQgYSBtZXNzYWdlIHRvIHRoZSBkZXN0aW5hdGlvbiBoYW5kbGVyCisgICAgICoKKyAgICAgKiBAcGFyYW0gd2hhdAorICAgICAqIEBwYXJhbSBhcmcxCisgICAgICogQHBhcmFtIGFyZzIKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZW5kTWVzc2FnZShpbnQgd2hhdCwgaW50IGFyZzEsIGludCBhcmcyKSB7CisgICAgICAgIE1lc3NhZ2UgbXNnID0gTWVzc2FnZS5vYnRhaW4oKTsKKyAgICAgICAgbXNnLndoYXQgPSB3aGF0OworICAgICAgICBtc2cuYXJnMSA9IGFyZzE7CisgICAgICAgIG1zZy5hcmcyID0gYXJnMjsKKyAgICAgICAgc2VuZE1lc3NhZ2UobXNnKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZW5kIGEgbWVzc2FnZSB0byB0aGUgZGVzdGluYXRpb24gaGFuZGxlcgorICAgICAqCisgICAgICogQHBhcmFtIHdoYXQKKyAgICAgKiBAcGFyYW0gYXJnMQorICAgICAqIEBwYXJhbSBhcmcyCisgICAgICogQHBhcmFtIG9iagorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNlbmRNZXNzYWdlKGludCB3aGF0LCBpbnQgYXJnMSwgaW50IGFyZzIsIE9iamVjdCBvYmopIHsKKyAgICAgICAgTWVzc2FnZSBtc2cgPSBNZXNzYWdlLm9idGFpbigpOworICAgICAgICBtc2cud2hhdCA9IHdoYXQ7CisgICAgICAgIG1zZy5hcmcxID0gYXJnMTsKKyAgICAgICAgbXNnLmFyZzIgPSBhcmcyOworICAgICAgICBtc2cub2JqID0gb2JqOworICAgICAgICBzZW5kTWVzc2FnZShtc2cpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNlbmQgYSBtZXNzYWdlIHRvIHRoZSBkZXN0aW5hdGlvbiBoYW5kbGVyCisgICAgICoKKyAgICAgKiBAcGFyYW0gd2hhdAorICAgICAqIEBwYXJhbSBvYmoKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZW5kTWVzc2FnZShpbnQgd2hhdCwgT2JqZWN0IG9iaikgeworICAgICAgICBNZXNzYWdlIG1zZyA9IE1lc3NhZ2Uub2J0YWluKCk7CisgICAgICAgIG1zZy53aGF0ID0gd2hhdDsKKyAgICAgICAgbXNnLm9iaiA9IG9iajsKKyAgICAgICAgc2VuZE1lc3NhZ2UobXNnKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXBseSB0byBzcmNNc2cgc2VuZGluZyBkc3RNc2cKKyAgICAgKgorICAgICAqIEBwYXJhbSBzcmNNc2cKKyAgICAgKiBAcGFyYW0gZHN0TXNnCisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVwbHlUb01lc3NhZ2UoTWVzc2FnZSBzcmNNc2csIE1lc3NhZ2UgZHN0TXNnKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBzcmNNc2cucmVwbHlUby5zZW5kKGRzdE1zZyk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBsb2coIlRPRE86IGhhbmRsZSByZXBseVRvTWVzc2FnZSBSZW1vdGVFeGNlcHRpb24iICsgZSk7CisgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVwbHkgdG8gc3JjTXNnCisgICAgICoKKyAgICAgKiBAcGFyYW0gc3JjTXNnCisgICAgICogQHBhcmFtIHdoYXQKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCByZXBseVRvTWVzc2FnZShNZXNzYWdlIHNyY01zZywgaW50IHdoYXQpIHsKKyAgICAgICAgTWVzc2FnZSBtc2cgPSBNZXNzYWdlLm9idGFpbigpOworICAgICAgICBtc2cud2hhdCA9IHdoYXQ7CisgICAgICAgIHJlcGx5VG9NZXNzYWdlKHNyY01zZywgbXNnKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXBseSB0byBzcmNNc2cKKyAgICAgKgorICAgICAqIEBwYXJhbSBzcmNNc2cKKyAgICAgKiBAcGFyYW0gd2hhdAorICAgICAqIEBwYXJhbSBhcmcxCisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVwbHlUb01lc3NhZ2UoTWVzc2FnZSBzcmNNc2csIGludCB3aGF0LCBpbnQgYXJnMSkgeworICAgICAgICBNZXNzYWdlIG1zZyA9IE1lc3NhZ2Uub2J0YWluKCk7CisgICAgICAgIG1zZy53aGF0ID0gd2hhdDsKKyAgICAgICAgbXNnLmFyZzEgPSBhcmcxOworICAgICAgICByZXBseVRvTWVzc2FnZShzcmNNc2csIG1zZyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVwbHkgdG8gc3JjTXNnCisgICAgICoKKyAgICAgKiBAcGFyYW0gc3JjTXNnCisgICAgICogQHBhcmFtIHdoYXQKKyAgICAgKiBAcGFyYW0gYXJnMQorICAgICAqIEBwYXJhbSBhcmcyCisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVwbHlUb01lc3NhZ2UoTWVzc2FnZSBzcmNNc2csIGludCB3aGF0LCBpbnQgYXJnMSwgaW50IGFyZzIpIHsKKyAgICAgICAgTWVzc2FnZSBtc2cgPSBNZXNzYWdlLm9idGFpbigpOworICAgICAgICBtc2cud2hhdCA9IHdoYXQ7CisgICAgICAgIG1zZy5hcmcxID0gYXJnMTsKKyAgICAgICAgbXNnLmFyZzIgPSBhcmcyOworICAgICAgICByZXBseVRvTWVzc2FnZShzcmNNc2csIG1zZyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVwbHkgdG8gc3JjTXNnCisgICAgICoKKyAgICAgKiBAcGFyYW0gc3JjTXNnCisgICAgICogQHBhcmFtIHdoYXQKKyAgICAgKiBAcGFyYW0gYXJnMQorICAgICAqIEBwYXJhbSBhcmcyCisgICAgICogQHBhcmFtIG9iagorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHJlcGx5VG9NZXNzYWdlKE1lc3NhZ2Ugc3JjTXNnLCBpbnQgd2hhdCwgaW50IGFyZzEsIGludCBhcmcyLCBPYmplY3Qgb2JqKSB7CisgICAgICAgIE1lc3NhZ2UgbXNnID0gTWVzc2FnZS5vYnRhaW4oKTsKKyAgICAgICAgbXNnLndoYXQgPSB3aGF0OworICAgICAgICBtc2cuYXJnMSA9IGFyZzE7CisgICAgICAgIG1zZy5hcmcyID0gYXJnMjsKKyAgICAgICAgbXNnLm9iaiA9IG9iajsKKyAgICAgICAgcmVwbHlUb01lc3NhZ2Uoc3JjTXNnLCBtc2cpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJlcGx5IHRvIHNyY01zZworICAgICAqCisgICAgICogQHBhcmFtIHNyY01zZworICAgICAqIEBwYXJhbSB3aGF0CisgICAgICogQHBhcmFtIG9iagorICA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ICAgICBwcml2YXRlIFN5bmNNZXNzZW5nZXIoKSB7CisgICAgICAgIH0KKworICAgICAgICAvKiogU3luY2hyb25vdXMgSGFuZGxlciBjbGFzcyAqLworICAgICAgICBwcml2YXRlIGNsYXNzIFN5bmNIYW5kbGVyIGV4dGVuZHMgSGFuZGxlciB7CisgICAgICAgICAgICAvKiogVGhlIG9iamVjdCB1c2VkIHRvIHdhaXQvbm90aWZ5ICovCisgICAgICAgICAgICBwcml2YXRlIE9iamVjdCBtTG9ja09iamVjdCA9IG5ldyBPYmplY3QoKTsKKyAgICAgICAgICAgIC8qKiBUaGUgcmVzdWx0aW5nIG1lc3NhZ2UgKi8KKyAgICAgICAgICAgIHByaXZhdGUgTWVzc2FnZSBtUmVzdWx0TXNnOworCisgICAgICAgICAgICAvKiogQ29uc3RydWN0b3IgKi8KKyAgICAgICAgICAgIHByaXZhdGUgU3luY0hhbmRsZXIoTG9vcGVyIGxvb3BlcikgeworICAgICAgICAgICAgICAgIHN1cGVyKGxvb3Blcik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qKiBIYW5kbGUgb2YgdGhlIHJlcGx5IG1lc3NhZ2UgKi8KKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICAgICAgICAgIG1SZXN1bHRNc2cgPSBNZXNzYWdlLm9idGFpbigpOworICAgICAgICAgICAgICAgIG1SZXN1bHRNc2cuY29weUZyb20obXNnKTsKKyAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQobUxvY2tPYmplY3QpIHsKKyAgICAgICAgICAgICAgICAgICAgbUxvY2tPYmplY3Qubm90aWZ5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEByZXR1cm4gdGhlIFN5bmNNZXNzZW5nZXIKKyAgICAgICAgICovCisgICAgICAgIHByaXZhdGUgc3RhdGljIFN5bmNNZXNzZW5nZXIgb2J0YWluKCkgeworICAgICAgICAgICAgU3luY01lc3NlbmdlciBzbTsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc1N0YWNrKSB7CisgICAgICAgICAgICAgICAgaWYgKHNTdGFjay5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgc20gPSBuZXcgU3luY01lc3NlbmdlcigpOworICAgICAgICAgICAgICAgICAgICBzbS5tSGFuZGxlclRocmVhZCA9IG5ldyBIYW5kbGVyVGhyZWFkKCJTeW5jSGFuZGxlci0iICsgc0NvdW50KyspOworICAgICAgICAgICAgICAgICAgICBzbS5tSGFuZGxlclRocmVhZC5zdGFydCgpOworICAgICAgICAgICAgICAgICAgICBzbS5tSGFuZGxlciA9IHNtLm5ldyBTeW5jSGFuZGxlcihzbS5tSGFuZGxlclRocmVhZC5nZXRMb29wZXIoKSk7CisgICAgICAgICAgICAgICAgICAgIHNtLm1NZXNzZW5nZXIgPSBuZXcgTWVzc2VuZ2VyKHNtLm1IYW5kbGVyKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzbSA9IHNTdGFjay5wb3AoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gc207CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUmVjeWNsZSB0aGlzIG9iamVjdAorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSB2b2lkIHJlY3ljbGUoKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNTdGFjaykgeworICAgICAgICAgICAgICAgIHNTdGFjay5wdXNoKHRoaXMpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNlbmQgYSBtZXNzYWdlIHN5bmNocm9ub3VzbHkuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBtc2cgdG8gc2VuZAorICAgICAgICAgKiBAcmV0dXJuIHJlc3VsdCBtZXNzYWdlIG9yIG51bGwgaWYgYW4gZXJyb3Igb2NjdXJzCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIHN0YXRpYyBNZXNzYWdlIHNlbmRNZXNzYWdlU3luY2hyb25vdXNseShNZXNzZW5nZXIgZHN0TWVzc2VuZ2VyLCBNZXNzYWdlIG1zZykgeworICAgICAgICAgICAgU3luY01lc3NlbmdlciBzbSA9IFN5bmNNZXNzZW5nZXIub2J0YWluKCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1zZy5yZXBseVRvID0gc20ubU1lc3NlbmdlcjsKKyAgICAgICAgICAgICAgICBkc3RNZXNzZW5nZXIuc2VuZChtc2cpOworICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc20ubUhhbmRsZXIubUxvY2tPYmplY3QpIHsKKyAgICAgICAgICAgICAgICAgICAgc20ubUhhbmRsZXIubUxvY2tPYmplY3Qud2FpdCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBzbS5tSGFuZGxlci5tUmVzdWx0TXNnID0gbnVsbDsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgc20ubUhhbmRsZXIubVJlc3VsdE1zZyA9IG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBNZXNzYWdlIHJlc3VsdE1zZyA9IHNtLm1IYW5kbGVyLm1SZXN1bHRNc2c7CisgICAgICAgICAgICBzbS5yZWN5Y2xlKCk7CisgICAgICAgICAgICByZXR1cm4gcmVzdWx0TXNnOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVwbHkgdG8gdGhlIHNyYyBoYW5kbGVyIHRoYXQgd2UncmUgaGFsZiBjb25uZWN0ZWQuCisgICAgICoKKyAgICAgKiBAcGFyYW0gc3RhdHVzIHRvIGJlIHN0b3JlZCBpbiBtc2cuYXJnMQorICAgICAqLworICAgIHByaXZhdGUgdm9pZCByZXBseUhhbGZDb25uZWN0ZWQoaW50IHN0YXR1cywgaW50IHRva2VuKSB7CisgICAgICAgIE1lc3NhZ2UgbXNnID0gbVNyY0hhbmRsZXIub2J0YWluTWVzc2FnZShDTURfQ0hBTk5FTF9IQUxGX0NPTk5FQ1RFRCk7CisgICAgICAgIG1zZy5hcmcxID0gc3RhdHVzOworICAgICAgICBtc2cuYXJnMiA9IHRva2VuOworICAgICAgICBtc2cucmVwbHlUbyA9IG1Ec3RNZXNzZW5nZXI7CisgICAgICAgIG1TcmNIYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2VydmljZUNvbm5lY3Rpb24gdG8gcmVjZWl2ZSBjYWxsIGJhY2tzLgorICAgICAqLworICAgIGNsYXNzIEFzeW5jQ2hhbm5lbENvbm5lY3Rpb24gaW1wbGVtZW50cyBTZXJ2aWNlQ29ubmVjdGlvbiB7CisgICAgICAgIHByaXZhdGUgaW50IG1Ub2tlbjsKKworICAgICAgICBBc3luY0NoYW5uZWxDb25uZWN0aW9uKGludCB0b2tlbikgeworICAgICAgICAgICAgbVRva2VuID0gdG9rZW47CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQHBhcmFtIHRva2VuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBzZXRUb2tlbihpbnQgdG9rZW4pIHsKKyAgICAgICAgICAgIG1Ub2tlbiA9IHRva2VuOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlQ29ubmVjdGVkKENvbXBvbmVudE5hbWUgY2xhc3NOYW1lLCBJQmluZGVyIHNlcnZpY2UpIHsKKyAgICAgICAgICAgIG1Ec3RNZXNzZW5nZXIgPSBu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qLworICAgIHByb3RlY3RlZCBNZXNzZW5nZXIgbU1lc3NlbmdlcjsKKworICAgIC8qKiBNZXNzYWdlIEhhbmRsZXIgdGhhdCB3aWxsIHJlY2VpdmUgbWVzc2FnZXMgKi8KKyAgICBIYW5kbGVyIG1IYW5kbGVyOworCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBBc3luY1NlcnZpY2VJbmZvIHsKKyAgICAgICAgLyoqIE1lc3NhZ2UgSGFuZGxlciB0aGF0IHdpbGwgcmVjZWl2ZSBtZXNzYWdlcyAqLworICAgICAgICBwdWJsaWMgSGFuZGxlciBtSGFuZGxlcjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGZsYWdzIHJldHVybmVkIGJ5IG9uU3RhcnRDb21tYW5kIG9uIGhvdyB0byByZXN0YXJ0LgorICAgICAgICAgKiBGb3IgaW5zdGFuY2UgQHNlZSBhbmRyb2lkLmFwcC5TZXJ2aWNlI1NUQVJUX1NUSUNLWQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCBtUmVzdGFydEZsYWdzOworICAgIH0KKworICAgIEFzeW5jU2VydmljZUluZm8gbUFzeW5jU2VydmljZUluZm87CisKKyAgICAvKioKKyAgICAgKiBDcmVhdGUgdGhlIHNlcnZpY2UncyBoYW5kbGVyIHJldHVybmluZyBBc3luY1NlcnZpY2VJbmZvLgorICAgICAqCisgICAgICogQHJldHVybiBBc3luY1NlcnZpY2VJbmZvCisgICAgICovCisgICAgYWJzdHJhY3QgcHVibGljIEFzeW5jU2VydmljZUluZm8gY3JlYXRlSGFuZGxlcigpOworCisgICAgLyoqCisgICAgICogR2V0IHRoZSBoYW5kbGVyCisgICAgICovCisgICAgcHVibGljIEhhbmRsZXIgZ2V0SGFuZGxlcigpIHsKKyAgICAgICAgcmV0dXJuIG1IYW5kbGVyOworICAgIH0KKworICAgIC8qKgorICAgICAqIG9uQ3JlYXRlCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGlj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51dGlsLkhhc2hNYXA7CitpbXBvcnQgamF2YS51dGlsLkhhc2hTZXQ7CiBpbXBvcnQgamF2YS51dGlsLkl0ZXJhdG9yOwogaW1wb3J0IGphdmEudXRpbC5MaXN0OwogaW1wb3J0IGphdmEudXRpbC5NYXA7CkBAIC0yODQsNiArMjg1LDI2IEBACiAKICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibGlzdCIpOwogICAgIH0KKyAgICAKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIHZvaWQgd3JpdGVTZXRYbWwoU2V0IHZhbCwgU3RyaW5nIG5hbWUsIFhtbFNlcmlhbGl6ZXIgb3V0KQorICAgICAgICAgICAgdGhyb3dzIFhtbFB1bGxQYXJzZXJFeGNlcHRpb24sIGphdmEuaW8uSU9FeGNlcHRpb24geworICAgICAgICBpZiAodmFsID09IG51bGwpIHsKKyAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAibnVsbCIpOworICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibnVsbCIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgInNldCIpOworICAgICAgICBpZiAobmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJuYW1lIiwgbmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGZvciAoT2JqZWN0IHYgOiB2YWwpIHsKKyAgICAgICAgICAgIHdyaXRlVmFsdWVYbWwodiwgbnVsbCwgb3V0KTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAic2V0Iik7CisgICAgfQogCiAgICAgLyoqCiAgICAgICogRmxhdHRlbiBhIGJ5dGVbXSBpbnRvIGFuIFhtbFNlcmlhbGl6ZXIuICBUaGUgbGlzdCBjYW4gbGF0ZXIgYmUgcmVhZCBiYWNrCkBAIC00MjYsNiArNDQ3LDkgQEAKICAgICAgICAgfSBlbHNlIGlmICh2IGluc3RhbmNlb2YgTGlzdCkgewogICAgICAgICAgICAgd3JpdGVMaXN0WG1sKChMaXN0KXYsIG5hbWUsIG91dCk7CiAgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0gZWxzZSBpZiAodiBpbnN0YW5jZW9mIFNldCkgeworICAgICAgICAgICAgd3JpdGVTZXRYbWwoKFNldCl2LCBuYW1lLCBvdXQpOworICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9IGVsc2UgaWYgKHYgaW5zdGFuY2VvZiBDaGFyU2VxdWVuY2UpIHsKICAgICAgICAgICAgIC8vIFhYWCBUaGlzIGlzIHRvIGFsbG93IHVzIHRvIGF0IGxlYXN0IHdyaXRlIHNvbWV0aGluZyBpZgogICAgICAgICAgICAgLy8gd2UgZW5jb3VudGVyIHN0eWxlZCB0ZXh0Li4uICBidXQgaXQgbWVhbnMgd2Ugd2lsbCBkcm9wIGFsbApAQCAtNDc2LDcgKzUwMCw3IEBACiAgICAgICoKICAgICAgKiBAcGFyYW0gaW4gVGhlIElucHV0U3RyZWFtIGZyb20gd2hpY2ggdG8gcmVhZC4KICAgICAgKgotICAgICAqIEByZXR1cm4gSGFzaE1hcCBUaGUgcmVzdWx0aW5nIGxpc3QuCisgICAgICogQHJldHVybiBBcnJheUxpc3QgVGhlIHJlc3VsdGluZyBsaXN0LgogICAgICAqCiAgICAgICogQHNlZSAjcmVhZE1hcFhtbAogICAgICAqIEBzZWUgI3JlYWRWYWx1ZVhtbApAQCAtNDkwLDYgKzUxNCwyOSBAQAogICAgICAgICBwYXJzZXIuc2V0SW5wdXQoaW4sIG51bGwpOwogICAgICAgICByZXR1cm4gKEFycmF5TGlzdClyZWFkVmFsdWVYbWwocGFyc2VyLCBuZXcgU3RyaW5nWzFdKTsKICAgICB9CisgICAgCisgICAgCisgICAgLyoqCisgICAgICogUmVhZCBhIEhhc2hTZXQgZnJvbSBhbiBJbnB1dFN0cmVh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W5nW10gbmFtZSkKKyAgICAgICAgICAgIHRocm93cyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uLCBqYXZhLmlvLklPRXhjZXB0aW9uIHsKKyAgICAgICAgSGFzaFNldCBzZXQgPSBuZXcgSGFzaFNldCgpOworICAgICAgICAKKyAgICAgICAgaW50IGV2ZW50VHlwZSA9IHBhcnNlci5nZXRFdmVudFR5cGUoKTsKKyAgICAgICAgZG8geworICAgICAgICAgICAgaWYgKGV2ZW50VHlwZSA9PSBwYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgT2JqZWN0IHZhbCA9IHJlYWRUaGlzVmFsdWVYbWwocGFyc2VyLCBuYW1lKTsKKyAgICAgICAgICAgICAgICBzZXQuYWRkKHZhbCk7CisgICAgICAgICAgICAgICAgLy9TeXN0ZW0ub3V0LnByaW50bG4oIkFkZGluZyB0byBzZXQ6ICIgKyB2YWwpOworICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudFR5cGUgPT0gcGFyc2VyLkVORF9UQUcpIHsKKyAgICAgICAgICAgICAgICBpZiAocGFyc2VyLmdldE5hbWUoKS5lcXVhbHMoZW5kVGFnKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2V0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJFeHBlY3RlZCAiICsgZW5kVGFnICsgIiBlbmQgdGFnIGF0OiAiICsgcGFyc2VyLmdldE5hbWUoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBldmVudFR5cGUgPSBwYXJzZXIubmV4dCgpOworICAgICAgICB9IHdoaWxlIChldmVudFR5cGUgIT0gcGFyc2VyLkVORF9ET0NVTUVOVCk7CisgICAgICAgIAorICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgIC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V3KHZpZXcpOworICAgICAgICBtQ3VzdG9tVmlldyA9IHZpZXcgIT0gbnVsbCA/IG5ldyBXZWFrUmVmZXJlbmNlPFZpZXc+KHZpZXcpIDogbnVsbDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBpbnZhbGlkYXRlKCkgeworICAgICAgICBtQ2FsbGJhY2sub25QcmVwYXJlQWN0aW9uTW9kZSh0aGlzLCBtTWVudSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZmluaXNoKCkgeworICAgICAgICBpZiAobUZpbmlzaGVkKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgbUZpbmlzaGVkID0gdHJ1ZTsKKworICAgICAgICBtQ2FsbGJhY2sub25EZXN0cm95QWN0aW9uTW9kZSh0aGlzKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgTWVudSBnZXRNZW51KCkgeworICAgICAgICByZXR1cm4gbU1lbnU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIENoYXJTZXF1ZW5jZSBnZXRUaXRsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1Db250ZXh0Vmlldy5nZXRUaXRsZSgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0U3VidGl0bGUoKSB7CisgICAgICAgIHJldHVybiBtQ29udGV4dFZpZXcuZ2V0U3VidGl0bGUoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgVmlldyBnZXRDdXN0b21WaWV3KCkgeworICAgICAgICByZXR1cm4gbUN1c3RvbVZpZXcgIT0gbnVsbCA/IG1DdXN0b21WaWV3LmdldCgpIDogbnVsbDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgTWVudUluZmxhdGVyIGdldE1lbnVJbm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JpID0KKyAgICAgICAgICAgICAgICBwbS5xdWVyeUludGVudEFjdGl2aXR5T3B0aW9ucyhjYWxsZXIsIHNwZWNpZmljcywgaW50ZW50LCAwKTsKKyAgICAgICAgZmluYWwgaW50IE4gPSBscmkgIT0gbnVsbCA/IGxyaS5zaXplKCkgOiAwOworCisgICAgICAgIGlmICgoZmxhZ3MgJiBGTEFHX0FQUEVORF9UT19HUk9VUCkgPT0gMCkgeworICAgICAgICAgICAgcmVtb3ZlR3JvdXAoZ3JvdXBJZCk7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICBmaW5hbCBSZXNvbHZlSW5mbyByaSA9IGxyaS5nZXQoaSk7CisgICAgICAgICAgICBJbnRlbnQgcmludGVudCA9IG5ldyBJbnRlbnQoCisgICAgICAgICAgICAgICAgcmkuc3BlY2lmaWNJbmRleCA8IDAgPyBpbnRlbnQgOiBzcGVjaWZpY3Nbcmkuc3BlY2lmaWNJbmRleF0pOworICAgICAgICAgICAgcmludGVudC5zZXRDb21wb25lbnQobmV3IENvbXBvbmVudE5hbWUoCisgICAgICAgICAgICAgICAgICAgIHJpLmFjdGl2aXR5SW5mby5hcHBsaWNhdGlvbkluZm8ucGFja2FnZU5hbWUsCisgICAgICAgICAgICAgICAgICAgIHJpLmFjdGl2aXR5SW5mby5uYW1lKSk7CisgICAgICAgICAgICBmaW5hbCBNZW51SXRlbSBpdGVtID0gYWRkKGdyb3VwSWQsIGl0ZW1JZCwgb3JkZXIsIHJpLmxvYWRMYWJlbChwbSkpCisgICAgICAgICAgICAgICAgICAgIC5zZXRJY29uKHJpLmxvYWRJY29uKHBtKSkKKyAgICAgICAgICAgICAgICAgICAgLnNldEludGVudChyaW50ZW50KTsKKyAgICAgICAgICAgIGlmIChvdXRTcGVjaWZpY0l0ZW1zICE9IG51bGwgJiYgcmkuc3BlY2lmaWNJbmRleCA+PSAwKSB7CisgICAgICAgICAgICAgICAgb3V0U3BlY2lmaWNJdGVtc1tyaS5zcGVjaWZpY0luZGV4XSA9IGl0ZW07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gTjsKKyAgICB9CisKKyAgICBwdWJsaWMgU3ViTWVudSBhZGRTdWJNZW51KENoYXJTZXF1ZW5jZSB0aXRsZSkgeworICAgICAgICAvLyBUT0RPIEltcGxlbWVudCBzdWJtZW51cworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgU3ViTWVudSBhZGRTdWJNZW51KGludCB0aXRsZVJlcykgeworICAgICAgICAvLyBUT0RPIEltcGxlbWVudCBzdWJtZW51cworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgU3ViTWVudSBhZGRTdWJNZW51KGludCBncm91cElkLCBpbnQgaXRlbUlkLCBpbnQgb3JkZXIsCisgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGl0bGUpIHsKKyAgICAgICAgLy8gVE9ETyBJbXBsZW1lbnQgc3VibWVudXMKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIFN1Yk1lbnUgYWRkU3ViTWVudShpbnQgZ3JvdXBJZCwgaW50IGl0ZW1JZCwgaW50IG9yZGVyLCBpbnQgdGl0bGVSZXMpIHsKKyAgICAgICAgLy8gVE9ETyBJbXBsZW1lbnQgc3VibWVudXMKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY2xlYXIoKSB7CisgICAgICAgIG1JdGVtcy5jbGVhcigpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgeworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIGludCBmaW5kSXRlbUluZGV4KGludCBpZCkgeworICAgICAgICBmaW5hbCBBcnJheUxpc3Q8QWN0aW9uTWVudUl0ZW0+IGl0ZW1zID0gbUl0ZW1zOworICAgICAgICBmaW5hbCBpbnQgaXRlbUNvdW50ID0gaXRlbXMuc2l6ZSgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1Db3VudDsgaSsrKSB7CisgICAgICAgICAgICBpZiAoaXRlbXMuZ2V0KGkpLmdldEl0ZW1JZCgpID09IGlkKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gZmluZEl0ZW0oaW50IGlkKSB7CisgICAgICAgIHJldHVybiBtSXRlbXMuZ2V0KGZpbmRJdGVtSW5kZXgoaWQpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gZ2V0SXRlbShpbnQgaW5kZXgpIHsKKyAgICAgICAgcmV0dXJuIG1JdGVtcy5nZXQoaW5kZXgpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGhhc1Zpc2libGVJdGVtcygpIHsKKyAgICAgICAgZmluYWwgQXJyYXlMaXN0PEFjdGlvbk1lbnVJdGVtPiBpdGVtcyA9IG1JdGVtczsKKyAgICAgICAgZmluYWwgaW50IGl0ZW1Db3VudCA9IGl0ZW1zLnNpemUoKTsKKyAgICAgICAgCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaXRlbUNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGlmIChpdGVtcy5nZXQoaSkuaXNWaXNpYmxlKCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIEFjdGlvbk1lbnVJdGVtIGZpbmRJdGVtV2l0aFNob3J0Y3V0KGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgeworICAgICAgICAvLyBUT0RPIE1ha2UgdGhpcyBzbWFydGVyLgorICAgICAgICBmaW5hbCBib29sZWFuIHF3ZXJ0eSA9IG1Jc1F3ZXJ0eTsKKyAgICAgICAgZmluYWwgQXJyYXlMaXN0PEFjdGlvbk1lbnVJdGVtPiBpdGVtcyA9IG1JdGVtczsKKyAgICAgICAgZmluYWwgaW50IGl0ZW1Db3VudCA9IGl0ZW1zLnNpemUoKTsKKyAgICAgICAgCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaXRlbUNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIEFjdGlvbk1lbnVJdGVtIGl0ZW0gPSBpdGVtcy5nZXQoaSk7CisgICAgICAgICAgICBmaW5hbCBjaGFyIHNob3J0Y3V0ID0gcXdlcnR5ID8gaXRlbS5nZXRBbHBoYWJldGljU2hvcnRjdXQoKSA6CisgICAgICAgICAgICAgICAgICAgIGl0ZW0uZ2V0TnVtZXJpY1Nob3J0Y3V0KCk7CisgICAgICAgICAgICBpZiAoa2V5Q29kZSA9PSBzaG9ydGN1dCkgeworICAgICAgICAgICAgICAgIHJldHVybiBpdGVtOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzU2hvcnRjdXRLZXkoaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50KSB7CisgICAgICAgIHJldHVybiBmaW5kSXRlbVdpdGhTaG9ydGN1dChrZXlDb2RlLCBldmVudCkgIT0gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBwZXJmb3JtSWRlbnRpZmllckFjdGlvbihpbnQgaWQsIGludCBmbGFncykgeworICAgICAgICBmaW5hbCBpbnQgaW5kZXggPSBmaW5kSXRlbUluZGV4KGlkKTsKKyAgICAgICAgaWYgKGluZGV4IDwgMCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG1JdGVtcy5nZXQoaW5kZXgpLmludm9rZSgpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIHBlcmZvcm1TaG9ydGN1dChpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQsIGludCBmbGFncykgeworICAgICAgICBBY3Rpb25NZW51SXRlbSBpdGVtID0gZmluZEl0ZW1XaXRoU2hvcnRjdXQoa2V5Q29kZSwgZXZlbnQpOworICAgICAgICBpZiAoaXRlbSA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBpdGVtLmludm9rZSgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHJlbW92ZUdyb3VwKGludCBncm91cElkKSB7CisgICAgICAgIGZpbmFsIEFycmF5TGlzdDxBY3Rpb25NZW51SXRlbT4gaXRlbXMgPSBtSXRlbXM7CisgICAgICAgIGludCBpdGVtQ291bnQgPSBpdGVtcy5zaXplKCk7CisgICAgICAgIGludCBpID0gMDsKKyAgICAgICAgd2hpbGUgKGkgPCBpdGVtQ291bnQpIHsKKyAgICAgICAgICAgIGlmIChpdGVtcy5nZXQoaSkuZ2V0R3JvdXBJZCgpID09IGdyb3VwSWQpIHsKKyAgICAgICAgICAgICAgICBpdGVtcy5yZW1vdmUoaSk7CisgICAgICAgICAgICAgICAgaXRlbUNvdW50LS07CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHJlbW92ZUl0ZW0oaW50IGlkKSB7CisgICAgICAgIG1JdGVtcy5yZW1vdmUoZmluZEl0ZW1JbmRleChpZCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEdyb3VwQ2hlY2thYmxlKGludCBncm91cCwgYm9vbGVhbiBjaGVja2FibGUsCisgICAgICAgICAgICBib29sZWFuIGV4Y2x1c2l2ZSkgeworICAgICAgICBmaW5hbCBBcnJheUxpc3Q8QWN0aW9uTWVudUl0ZW0+IGl0ZW1zID0gbUl0ZW1zOworICAgICAgICBmaW5hbCBpbnQgaXRlbUNvdW50ID0gaXRlbXMuc2l6ZSgpOworICAgICAgICAKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpdGVtQ291bnQ7IGkrKykgeworICAgICAgICAgICAgQWN0aW9uTWVudUl0ZW0gaXRlbSA9IGl0ZW1zLmdldChpKTsKKyAgICAgICAgICAgIGlmIChpdGVtLmdldEdyb3VwSWQoKSA9PSBncm91cCkgeworICAgICAgICAgICAgICAgIGl0ZW0uc2V0Q2hlY2thYmxlKGNoZWNrYWJsZSk7CisgICAgICAgICAgICAgICAgaXRlbS5zZXRFeGNsdXNpdmVDaGVja2FibGUoZXhjbHVzaXZlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEdyb3VwRW5hYmxlZChpbnQgZ3JvdXAsIGJvb2xlYW4gZW5hYmxlZCkgeworICAgICAgICBmaW5hbCBBcnJheUxpc3Q8QWN0aW9uTWVudUl0ZW0+IGl0ZW1zID0gbUl0ZW1zOworICAgICAgICBmaW5hbCBpbnQgaXRlbUNvdW50ID0gaXRlbXMuc2l6ZSgpOworICAgICAgICAKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpdGVtQ291bnQ7IGkrKykgeworICAgICAgICAgICAgQWN0aW9uTWVudUl0ZW0gaXRlbSA9IGl0ZW1zLmdldChpKTsKKyAgICAgICAgICAgIGlmIChpdGVtLmdldEdyb3VwSWQoKSA9PSBncm91cCkgeworICAgICAgICAgICAgICAgIGl0ZW0uc2V0RW5hYmxlZChlbmFibGVkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEdyb3VwVmlzaWJsZShpbnQgZ3JvdXAsIGJvb2xlYW4gdmlzaWJsZSkgeworICAgICA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AgICA9IDB4MDAwMDAwMDI7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEVYQ0xVU0lWRSAgICAgID0gMHgwMDAwMDAwNDsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgSElEREVOICAgICAgICAgPSAweDAwMDAwMDA4OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBFTkFCTEVEICAgICAgICA9IDB4MDAwMDAwMTA7CisgICAgCisgICAgcHVibGljIEFjdGlvbk1lbnVJdGVtKENvbnRleHQgY29udGV4dCwgaW50IGdyb3VwLCBpbnQgaWQsIGludCBjYXRlZ29yeU9yZGVyLCBpbnQgb3JkZXJpbmcsCisgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGl0bGUpIHsKKyAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OworICAgICAgICBtSWQgPSBpZDsKKyAgICAgICAgbUdyb3VwID0gZ3JvdXA7CisgICAgICAgIG1DYXRlZ29yeU9yZGVyID0gY2F0ZWdvcnlPcmRlcjsKKyAgICAgICAgbU9yZGVyaW5nID0gb3JkZXJpbmc7CisgICAgICAgIG1UaXRsZSA9IHRpdGxlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgY2hhciBnZXRBbHBoYWJldGljU2hvcnRjdXQoKSB7CisgICAgICAgIHJldHVybiBtU2hvcnRjdXRBbHBoYWJldGljQ2hhcjsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldEdyb3VwSWQoKSB7CisgICAgICAgIHJldHVybiBtR3JvdXA7CisgICAgfQorCisgICAgcHVibGljIERyYXdhYmxlIGdldEljb24oKSB7CisgICAgICAgIHJldHVybiBtSWNvbkRyYXdhYmxlOworICAgIH0KKworICAgIHB1YmxpYyBJbnRlbnQgZ2V0SW50ZW50KCkgeworICAgICAgICByZXR1cm4gbUludGVudDsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldEl0ZW1JZCgpIHsKKyAgICAgICAgcmV0dXJuIG1JZDsKKyAgICB9CisKKyAgICBwdWJsaWMgQ29udGV4dE1lbnVJbmZvIGdldE1lbnVJbmZvKCkgeworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgY2hhciBnZXROdW1lcmljU2hvcnRjdXQoKSB7CisgICAgICAgIHJldHVybiBtU2hvcnRjdXROdW1lcmljQ2hhcjsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldE9yZGVyKCkgeworICAgICAgICByZXR1cm4gbU9yZGVyaW5nOworICAgIH0KKworICAgIHB1YmxpYyBTdWJNZW51IGdldFN1Yk1lbnUoKSB7CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0VGl0bGUoKSB7CisgICAgICAgIHJldHVybiBtVGl0bGU7CisgICAgfQorCisgICAgcHVibGljIENoYXJTZXF1ZW5jZSBnZXRUaXRsZUNvbmRlbnNlZCgpIHsKKyAgICAgICAgcmV0dXJuIG1UaXRsZUNvbmRlbnNlZDsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBoYXNTdWJNZW51KCkgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNDaGVja2FibGUoKSB7CisgICAgICAgIHJldHVybiAobUZsYWdzICYgQ0hFQ0tBQkxFKSAhPSAwOyAKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0NoZWNrZWQoKSB7CisgICAgICAgIHJldHVybiAobUZsYWdzICYgQ0hFQ0tFRCkgIT0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0VuYWJsZWQoKSB7CisgICAgICAgIHJldHVybiAobUZsYWdzICYgRU5BQkxFRCkgIT0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc1Zpc2libGUoKSB7CisgICAgICAgIHJldHVybiAobUZsYWdzICYgSElEREVOKSA9PSAwOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRBbHBoYWJldGljU2hvcnRjdXQoY2hhciBhbHBoYUNoYXIpIHsKKyAgICAgICAgbVNob3J0Y3V0QWxwaGFiZXRpY0NoYXIgPSBhbHBoYUNoYXI7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRDaGVja2FibGUoYm9vbGVhbiBjaGVja2FibGUpIHsKKyAgICAgICAgbUZsYWdzID0gKG1GbGFncyAmIH5DSEVDS0FCTEUpIHwgKGNoZWNrYWJsZSA/IENIRUNLQUJMRSA6IDApOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisgICAgCisgICAgcHVibGljIEFjdGlvbk1lbnVJdGVtIHNldEV4Y2x1c2l2ZUNoZWNrYWJsZShib29sZWFuIGV4Y2x1c2l2ZSkgeworICAgICAgICBtRmxhZ3MgPSAobUZsYWdzICYgfkVYQ0xVU0lWRSkgfCAoZXhjbHVzaXZlID8gRVhDTFVTSVZFIDogMCk7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRDaGVja2VkKGJvb2xlYW4gY2hlY2tlZCkgeworICAgICAgICBtRmxhZ3MgPSAobUZsYWdzICYgfkNIRUNLRUQpIHwgKGNoZWNrZWQgPyBDSEVDS0VEIDogMCk7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRFbmFibGVkKGJvb2xlYW4gZW5hYmxlZCkgeworICAgICAgICBtRmxhZ3MgPSAobUZsYWdzICYgfkVOQUJMRUQpIHwgKGVuYWJsZWQgPyBFTkFCTEVEIDogMCk7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRJY29uKERyYXdhYmxlIGljb24pIHsKKyAgICAgICAgbUljb25EcmF3YWJsZSA9IGljb247CisgICAgICAgIG1JY29uUmVzSWQgPSBOT19JQ09OOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0SWNvbihpbnQgaWNvblJlcykgeworICAgICAgICBtSWNvblJlc0lkID0gaWNvblJlczsKKyAgICAgICAgbUljb25EcmF3YWJsZSA9IG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldERyYXdhYmxlKGljb25SZXMpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0SW50ZW50KEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgbUludGVudCA9IGludGVudDsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldE51bWVyaWNTaG9ydGN1dChjaGFyIG51bWVyaWNDaGFyKSB7CisgICAgICAgIG1TaG9ydGN1dE51bWVyaWNDaGFyID0gbnVtZXJpY0NoYXI7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRPbk1lbnVJdGVtQ2xpY2tMaXN0ZW5lcihPbk1lbnVJdGVtQ2xpY2tMaXN0ZW5lciBtZW51SXRlbUNsaWNrTGlzdGVuZXIpIHsKKyAgICAgICAgbUNsaWNrTGlzdGVuZXIgPSBtZW51SXRlbUNsaWNrTGlzdGVuZXI7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRTaG9ydGN1dChjaGFyIG51bWVyaWNDaGFyLCBjaGFyIGFscGhhQ2hhcikgeworICAgICAgICBtU2hvcnRjdXROdW1lcmljQ2hhciA9IG51bWVyaWNDaGFyOworICAgICAgICBtU2hvcnRjdXRBbHBoYWJldGljQ2hhciA9IGFscGhhQ2hhcjsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldFRpdGxlKENoYXJTZXF1ZW5jZSB0aXRsZSkgeworICAgICAgICBtVGl0bGUgPSB0aXRsZTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldFRpdGxlKGludCB0aXRsZSkgeworICAgICAgICBtVGl0bGUgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRTdHJpbmcodGl0bGUpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0VGl0bGVDb25kZW5zZWQoQ2hhclNlcXVlbmNlIHRpdGxlKSB7CisgICAgICAgIG1UaXRsZUNvbmRlbnNlZCA9IHRpdGxlOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0VmlzaWJsZShib29sZWFuIHZpc2libGUpIHsKKyAgICAgICAgbUZsYWdzID0gKG1GbGFncyAmIEhJRERFTikgfCAodmlzaWJsZSA/IDAgOiBISURERU4pOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpbnZva2UoKSB7CisgICAgICAgIGlmIChtQ2xpY2tMaXN0ZW5lciAhPSBudWxsICYmIG1DbGlja0xpc3RlbmVyLm9uTWVudUl0ZW1DbGljayh0aGlzKSkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtSW50ZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1Db250ZXh0LnN0YXJ0QWN0aXZpdHkobUludGVudCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBzZXRTaG93QXNBY3Rpb24oaW50IHNob3cpIHsKKyAgICAgICAgLy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1JdGVtRGF0YSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRJdGVtSW52b2tlcihNZW51QnVpbGRlci5JdGVtSW52b2tlciBpbnZva2VyKSB7CisgICAgICAgIG1JdGVtSW52b2tlciA9IGludm9rZXI7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gcHJlZmVyc0NvbmRlbnNlZFRpdGxlKCkgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0Q2hlY2thYmxlKGJvb2xlYW4gY2hlY2thYmxlKSB7CisgICAgICAgIC8vIFRPRE8gU3VwcG9ydCBjaGVja2FibGUgYWN0aW9uIGl0ZW1zCisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0Q2hlY2tlZChib29sZWFuIGNoZWNrZWQpIHsKKyAgICAgICAgLy8gVE9ETyBTdXBwb3J0IGNoZWNrYWJsZSBhY3Rpb24gaXRlbXMKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRJY29uKERyYXdhYmxlIGljb24pIHsKKyAgICAgICAgbUltYWdlQnV0dG9uLnNldEltYWdlRHJhd2FibGUoaWNvbik7CisgICAgICAgIGlmIChpY29uICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1JbWFnZUJ1dHRvbi5zZXRWaXNpYmlsaXR5KFZJU0lCTEUpOworICAgICAgICAgICAgbVRleHRCdXR0b24uc2V0VmlzaWJpbGl0eShHT05FKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1JbWFnZUJ1dHRvbi5zZXRWaXNpYmlsaXR5KEdPTkUpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyBib29sZWFuIGhhc1RleHQoKSB7CisgICAgICAgIHJldHVybiBtVGV4dEJ1dHRvbi5nZXRWaXNpYmlsaXR5KCkgIT0gR09ORTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRTaG9ydGN1d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AKKyAgICBwcml2YXRlIGZsb2F0IG1CdXR0b25QYWRkaW5nTGVmdDsKKyAgICBwcml2YXRlIGZsb2F0IG1CdXR0b25QYWRkaW5nUmlnaHQ7CisgICAgcHJpdmF0ZSBmbG9hdCBtRGl2aWRlclBhZGRpbmc7CisgICAgCisgICAgcHJpdmF0ZSBEcmF3YWJsZSBtRGl2aWRlcjsKKworICAgIHByaXZhdGUgUnVubmFibGUgbVNob3dPdmVyZmxvdyA9IG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgc2hvd092ZXJmbG93TWVudSgpOworICAgICAgICB9CisgICAgfTsKKyAgICAKKyAgICBwdWJsaWMgQWN0aW9uTWVudVZpZXcoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIHRoaXMoY29udGV4dCwgbnVsbCk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBBY3Rpb25NZW51VmlldyhDb250ZXh0IGNvbnRleHQsIEF0dHJpYnV0ZVNldCBhdHRycykgeworICAgICAgICBzdXBlcihjb250ZXh0LCBhdHRycyk7CisgICAgICAgIAorICAgICAgICBmaW5hbCBSZXNvdXJjZXMgcmVzID0gZ2V0UmVzb3VyY2VzKCk7CisKKyAgICAgICAgLy8gTWVhc3VyZSBmb3IgaW5pdGlhbCBjb25maWd1cmF0aW9uCisgICAgICAgIG1NYXhJdGVtcyA9IGdldE1heEFjdGlvbkJ1dHRvbnMoKTsKKworICAgICAgICAvLyBUT0RPIFRoZXJlIGhhcyB0byBiZSBhIGJldHRlciB3YXkgdG8gaW5kaWNhdGUgdGhhdCB3ZSBkb24ndCBoYXZlIGEgaGFyZCBtZW51IGtleS4KKyAgICAgICAgZmluYWwgaW50IHNjcmVlbiA9IHJlcy5nZXRDb25maWd1cmF0aW9uKCkuc2NyZWVuTGF5b3V0OworICAgICAgICBtUmVzZXJ2ZU92ZXJmbG93ID0gKHNjcmVlbiAmIENvbmZpZ3VyYXRpb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nRhaW5TdHlsZWRBdHRyaWJ1dGVzKGdyb3VwU3R5bGUsCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQnV0dG9uR3JvdXApOworICAgICAgICBtRGl2aWRlciA9IGEuZ2V0RHJhd2FibGUoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQnV0dG9uR3JvdXBfZGl2aWRlcik7CisgICAgICAgIGEucmVjeWNsZSgpOworICAgICAgICAKKyAgICAgICAgbURpdmlkZXJQYWRkaW5nID0gRElWSURFUl9QQURESU5HICogcmVzLmdldERpc3BsYXlNZXRyaWNzKCkuZGVuc2l0eTsKKworICAgICAgICBzZXRCYXNlbGluZUFsaWduZWQoZmFsc2UpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uQ29uZmlndXJhdGlvbkNoYW5nZWQoQ29uZmlndXJhdGlvbiBuZXdDb25maWcpIHsKKyAgICAgICAgZmluYWwgaW50IHNjcmVlbiA9IG5ld0NvbmZpZy5zY3JlZW5MYXlvdXQ7CisgICAgICAgIG1SZXNlcnZlT3ZlcmZsb3cgPSAoc2NyZWVuICYgQ29uZmlndXJhdGlvbi5TQ1JFRU5MQVlPVVRfU0laRV9NQVNLKSA9PQorICAgICAgICAgICAgICAgIENvbmZpZ3VyYXRpb24uU0NSRUVOTEFZT1VUX1NJWkVfWExBUkdFOworICAgICAgICBtTWF4SXRlbXMgPSBnZXRNYXhBY3Rpb25CdXR0b25zKCk7CisgICAgICAgIGlmIChtTWVudSAhPSBudWxsKSB7CisgICAgICAgICAgICBtTWVudS5zZXRNYXhBY3Rpb25JdGVtcyhtTWF4SXRlbXMpOworICAgICAgICAgICAgdXBkYXRlQ2hpbGRyZW4oZmFsc2UpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1PdmVyZmxvd1BvcHVwICE9IG51bGwgJiYgbU92ZXJmbG93UG9wdXAuaXNTaG93aW5nK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G1ha2VEaXZpZGVyVmlldygpLCBtYWtlRGl2aWRlckxheW91dFBhcmFtcygpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZpbmFsIE1lbnVJdGVtSW1wbCBpdGVtRGF0YSA9IGl0ZW1zVG9TaG93LmdldChpKTsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcgYWN0aW9uVmlldyA9IGl0ZW1EYXRhLmdldEFjdGlvblZpZXcoKTsKKyAgICAgICAgICAgIGlmIChhY3Rpb25WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBWaWV3UGFyZW50IHBhcmVudCA9IGFjdGlvblZpZXcuZ2V0UGFyZW50KCk7CisgICAgICAgICAgICAgICAgaWYgKHBhcmVudCBpbnN0YW5jZW9mIFZpZXdHcm91cCkgeworICAgICAgICAgICAgICAgICAgICAoKFZpZXdHcm91cCkgcGFyZW50KS5yZW1vdmVWaWV3KGFjdGlvblZpZXcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBhZGRWaWV3KGFjdGlvblZpZXcsIG1ha2VBY3Rpb25WaWV3TGF5b3V0UGFyYW1zKCkpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBuZWVkc0RpdmlkZXIgPSBhZGRJdGVtVmlldyhpID09IDAgfHwgIW5lZWRzRGl2aWRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgIChBY3Rpb25NZW51SXRlbVZpZXcpIGl0ZW1EYXRhLmdldEl0ZW1WaWV3KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZW51QnVpbGRlci5UWVBFX0FDVElPTl9CVVRUT04sIHRoaXMpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChyZXNlcnZlT3ZlcmZsb3cpIHsKKyAgICAgICAgICAgIGlmIChtTWVudS5nZXROb25BY3Rpb25JdGVtcyh0cnVlKS5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgT3ZlcmZsb3dNZW51QnV0dG9uIGJ1dHRvbiA9IG5ldyBPdmVyZmxvd01lbnVCdXR0b24obUNvbnRleHQpOworICAgICAgICAgICAgICAgIGFkZFZpZXcoYnV0dG9uKTsKKyAgICAgICAgICAgICAgICBtT3ZlcmZsb3dCdXR0b24gPSBidXR0b247CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1PdmVyZmxvd0J1dHRvbiA9IG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBzaG93T3ZlcmZsb3dNZW51KCkgeworICAgICAgICBpZiAobU92ZXJmbG93QnV0dG9uICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZpbmFsIE1lbnVQb3B1cEhlbHBlciBwb3B1cCA9CisgICAgICAgICAgICAgICAgICAgIG5ldyBNZW51UG9wdXBIZWxwZXIoZ2V0Q29udGV4dCgpLCBtTWVudSwgbU92ZXJmbG93QnV0dG9uLCB0cnVlKTsKKyAgICAgICAgICAgIC8vIFBvc3QgdGhpcyBmb3IgbGF0ZXI7IHdlIG1pZ2h0IHN0aWxsIG5lZWQgYSBsYXlvdXQgZm9yIHRoZSBhbmNob3IgdG8gYmUgcmlnaHQuCisgICAgICAgICAgICBwb3N0KG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgIHBvcHVwLnNob3coKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIG1PdmVyZmxvd1BvcHVwID0gcG9wdXA7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNPdmVyZmxvd01lbnVTaG93aW5nKCkgeworICAgICAgICBNZW51UG9wdXBIZWxwZXIgcG9wdXAgPSBtT3ZlcmZsb3dQb3B1cDsKKyAgICAgICAgaWYgKHBvcHVwICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBwb3B1cC5pc1Nob3dpbmcoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaGlkZU92ZXJmbG93TWVudSgpIHsKKyAgICAgICAgTWVudVBvcHVwSGVscGVyIHBvcHVwID0gbU92ZXJmbG93UG9wdXA7CisgICAgICAgIGlmIChwb3B1cCAhPSBudWxsKSB7CisgICAgICAgICAgICBwb3B1cC5kaXNtaXNzKCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGFkZEl0ZW1WaWV3KGJvb2xlYW4gbmVlZHNEaXZpZGVyLCBBY3Rpb25NZW51SXRlbVZpZXcgdmlldykgeworICAgICAgICB2aWV3LnNldEl0ZW1JbnZva2VyKHRoaXMpOworICAgICAgICBib29sZWFuIGhhc1RleHQgPSB2aWV3Lmhhc1RleHQoKTsKKyAgICAgICAgCisgICAgICAgIGlmIChoYXNUZXh0ICYmIG5lZWRzRGl2aWRlcikgeworICAgICAgICAgICAgYWRkVmlldyhtYWtlRGl2aWRlclZpZXcoKSwgbWFrZURpdmlkZXJMYXlvdXRQYXJhbXMoKSk7CisgICAgICAgIH0KKyAgICAgICAgYWRkVmlldyh2aWV3KTsKKyAgICAgICAgcmV0dXJuIGhhc1RleHQ7CisgICAgfQorCisgICAgcHJpdmF0ZSBJbWFnZVZpZXcgbWFrZURpdmlkZXJWaWV3KCkgeworICAgICAgICBJbWFnZVZpZXcgcmVzdWx0ID0gbmV3IEltYWdlVmlldyhtQ29udGV4dCk7CisgICAgICAgIHJlc3VsdC5zZXRJbWFnZURyYXdhYmxlKG1EaXZpZGVyKTsKKyAgICAgICAg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YWN0aW9uT3ZlcmZsb3dCdXR0b25TdHlsZSk7CisKKyAgICAgICAgICAgIHNldENsaWNrYWJsZSh0cnVlKTsKKyAgICAgICAgICAgIHNldEZvY3VzYWJsZSh0cnVlKTsKKyAgICAgICAgICAgIHNldFZpc2liaWxpdHkoVklTSUJMRSk7CisgICAgICAgICAgICBzZXRFbmFibGVkKHRydWUpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIHBlcmZvcm1DbGljaygpIHsKKyAgICAgICAgICAgIGlmIChzdXBlci5wZXJmb3JtQ2xpY2soKSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBDaGFuZ2UgdG8gb3ZlcmZsb3cgbW9kZQorICAgICAgICAgICAgbU1lbnUuZ2V0Q2FsbGJhY2soKS5vbk1lbnVNb2RlQ2hhbmdlKG1NZW51KTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3ZpZXcvbWVudS9JY29uTWVudVZpZXcuamF2YSBiL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC92aWV3L21lbnUvSWNvbk1lbnVWaWV3LmphdmEKaW5kZXggYmViNTdiYS4uMTc4ZGNkZSAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3ZpZXcvbWVudS9JY29uTWVudVZpZXcuamF2YQorKysgYi9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdmlldy9tZW51L0ljb25NZW51Vmlldy5qYXZhCkBAIC0zMzcsNyArMzM3LDkgQEAKICAgICAgICAgLy8gVGhpcyBtZXRob2QgZG9lcyBhIGNsZWFyIHJlZnJlc2ggb2YgY2hpbGRyZW4KICAgICAgICAgcmVt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YWx1ZSBvdXRWYWx1ZSA9IG5ldyBUeXBlZFZhbHVlKCk7CisgICAgICAgIGNvbnRleHQuZ2V0VGhlbWUoKS5yZXNvbHZlQXR0cmlidXRlKGNvbS5hbmRyb2lkLmludGVybmFsLlIuYXR0ci5hbGVydERpYWxvZ1RoZW1lLAorICAgICAgICAgICAgICAgIG91dFZhbHVlLCB0cnVlKTsKKyAgICAgICAgcmV0dXJuIG91dFZhbHVlLnJlc291cmNlSWQ7CisgICAgfQorCiAgICAgcHJpdmF0ZSBNZW51VHlwZVtdIG1NZW51VHlwZXM7CiAgICAgY2xhc3MgTWVudVR5cGUgewogICAgICAgICBwcml2YXRlIGludCBtTWVudVR5cGU7CkBAIC0xNzYsOCArMjMyLDIwIEBACiAgICAgICAgIExheW91dEluZmxhdGVyIGdldEluZmxhdGVyKCkgewogICAgICAgICAgICAgLy8gQ3JlYXRlIGFuIGluZmxhdGVyIHRoYXQgdXNlcyB0aGUgZ2l2ZW4gdGhlbWUgZm9yIHRoZSBWaWV3cyBpdCBpbmZsYXRlcwogICAgICAgICAgICAgaWYgKG1JbmZsYXRlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgQ29udGV4dCB3cmFwcGVkQ29udGV4dCA9IG5ldyBDb250ZXh0VGhlbWVXcmFwcGVyKG1Db250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgVEhFTUVfUkVTX0ZPUl9UWVBFW21NZW51VHlwZV0pOyAKKyAgICAgICAgICAgICAgICBDb250ZXh0IHdyYXBwZWRDb250ZXh0OworICAgICAgICAgICAgICAgIGludCB0aGVtZVJlc0ZvclR5cGUgPSBUSEVNRV9SRVNfRk9SX1RZUEVbbU1lbnVUeXBlXTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoZW1lUmVzRm9yVHlwZSkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIFRIRU1FX0FQUExJQ0FUSU9OOgorICAgICAgICAgICAgICAgICAgICAgICAgd3JhcHBlZENvbnRleHQgPSBtQ29udGV4dDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFRIRU1FX0FMRVJUX0RJQUxPRzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHdyYXBwZWRDb250ZXh0ID0gbmV3IENvbnRleHRUaGVtZVdyYXBwZXIobUNvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldEFsZXJ0RGlhbG9nVGhlbWUobUNvbnRleHQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgd3JhcHBlZENvbnRleHQgPSBuZXcgQ29udGV4dFRoZW1lV3JhcHBlcihtQ29udGV4dCwgdGhlbWVSZXNGb3JUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtSW5mbGF0ZXIgPSAoTGF5b3V0SW5mbGF0ZXIpIHdyYXBwZWRDb250ZXh0CiAgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LkxBWU9VVF9JTkZMQVRFUl9TRVJWSUNFKTsKICAgICAgICAgICAgIH0KQEAgLTI4MSwxMCArMzQ5LDE5IEBACiAgICAgICAgIG1WaXNpYmxlSXRlbXMgPSBuZXcgQXJyYXlMaXN0PE1lbnVJdGVtSW1wbD4oKTsKICAgICAgICAgbUlzVmlzaWJsZUl0ZW1zU3RhbGUgPSB0cnVlOwogICAgICAgICAKKyAgICAgICAgbUFjdGlvbkl0ZW1zID0gbmV3IEFycmF5TGlzdDxNZW51SXRlbUltcGw+KCk7CisgICAgICAgIG1Ob25BY3Rpb25JdGVtcyA9IG5ldyBBcnJheUxpc3Q8TWVudUl0ZW1JbXBsPigpOworICAgICAgICBtSXNBY3Rpb25JdGVtc1N0YWxlID0gdH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mVyZmxvdyA9IHJlc2VydmVBY3Rpb25PdmVyZmxvdzsKKyAgICAgICAgICAgIG1Jc0FjdGlvbkl0ZW1zU3RhbGUgPSB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCFtSXNBY3Rpb25JdGVtc1N0YWxlKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBmaW5hbCBBcnJheUxpc3Q8TWVudUl0ZW1JbXBsPiB2aXNpYmxlSXRlbXMgPSBnZXRWaXNpYmxlSXRlbXMoKTsKKyAgICAgICAgZmluYWwgaW50IGl0ZW1zU2l6ZSA9IHZpc2libGVJdGVtcy5zaXplKCk7CisgICAgICAgIGludCBtYXhBY3Rpb25zID0gbU1heEFjdGlvbkl0ZW1zOworCisgICAgICAgIGludCByZXF1aXJlZEl0ZW1zID0gMDsKKyAgICAgICAgaW50IHJlcXVlc3RlZEl0ZW1zID0gMDsKKyAgICAgICAgYm9vbGVhbiBoYXNPdmVyZmxvdyA9IGZhbHNlOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1zU2l6ZTsgaSsrKSB7CisgICAgICAgICAgICBNZW51SXRlbUltcGwgaXRlbSA9IHZpc2libGVJdGVtcy5nZXQoaSk7CisgICAgICAgICAgICBpZiAoaXRlbS5yZXF1aXJlc0FjdGlvbkJ1dHRvbigpKSB7CisgICAgICAgICAgICAgICAgcmVxdWlyZWRJdGVtcysrOworICAgICAgICAgICAgfSBlbHNlIGlmIChpdGVtLnJlcXVlc3RzQWN0aW9uQnV0dG9uKCkpIHsKKyAgICAgICAgICAgICAgICByZXF1ZXN0ZWRJdGVtcysrOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBoYXNPdmVyZmxvdyA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBSZXNlcnZlIGEgc3BvdCBmb3IgdGhlIG92ZXJmbG93IGl0ZW0gaWYgbmVlZGVkLgorICAgICAgICBpZiAocmVzZXJ2ZUFjdGlvbk92ZXJmbG93ICYmCisgICAgICAgICAgICAgICAgKGhhc092ZXJmbG93IHx8IHJlcXVpcmVkSXRlbXMgKyByZXF1ZXN0ZWRJdGVtcyA+IG1heEFjdGlvbnMpKSB7CisgICAgICAgICAgICBtYXhBY3Rpb25zLS07CisgICAgICAgIH0KKyAgICAgICAgbWF4QWN0aW9ucyAtPSByZXF1aXJlZEl0ZW1zOworCisgICAgICAgIC8vIEZsYWcgYXMgbWFueSBtb3JlIHJlcXVlc3RlZCBpdGVtcyBhcyB3aWxsIGZpdC4KKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpdGVtc1NpemU7IGkrKykgeworICAgICAgICAgICAgTWVudUl0ZW1JbXBsIGl0ZW0gPSB2aXNpYmxlSXRlbXMuZ2V0KGkpOworICAgICAgICAgICAgaWYgKGl0ZW0ucmVxdWVzdHNBY3Rpb25CdXR0b24oKSkgeworICAgICAgICAgICAgICAgIGl0ZW0uc2V0SXNBY3Rpb25CdXR0b24obWF4QWN0aW9ucyA+IDApOworICAgICAgICAgICAgICAgIG1heEFjdGlvbnMtLTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIG1BY3Rpb25JdGVtcy5jbGVhcigpOworICAgICAgICBtTm9uQWN0aW9uSXRlbXMuY2xlYXIoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpdGVtc1NpemU7IGkrKykgeworICAgICAgICAgICAgTWVudUl0ZW1JbXBsIGl0ZW0gPSB2aXNpYmxlSXRlbXMuZ2V0KGkpOworICAgICAgICAgICAgaWYgKGl0ZW0uaXNBY3Rpb25CdXR0b24oKSkgeworICAgICAgICAgICAgICAgIG1BY3Rpb25JdGVtcy5hZGQoaXRlbSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1Ob25BY3Rpb25JdGVtcy5hZGQoaXRlbSk7CisgICAgICAgICAgICB9CisgICAgICAg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VudVR5cGUpOworICAgICAgICAgICAgICAgIGl0ZW0uc2V0SXRlbVZpZXcobU1lbnVUeXBlLCBpdGVtVmlldyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGNvbnZlcnRWaWV3OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBNZW51SXRlbUltcGwgaXRlbSA9IChNZW51SXRlbUltcGwpIGdldEl0ZW0ocG9zaXRpb24pOworICAgICAgICAgICAgICAgIGl0ZW0uc2V0SXRlbVZpZXcobU1lbnVUeXBlLCBudWxsKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gaXRlbS5nZXRJdGVtVmlldyhtTWVudVR5cGUsIHBhcmVudCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBbiBhZGFwdGVyIHRoYXQgYWxsb3dzIGFuIHtAbGluayBBZGFwdGVyVmlld30gdG8gdXNlIHRoaXMge0BsaW5rIE1lbnVCdWlsZGVyfSBhcyBhIGRhdGEKKyAgICAgKiBzb3VyY2UgZm9yIG92ZXJmbG93IG1lbnUgaXRlbXMgdGhhdCBkbyBub3QgZml0IGluIHRoZSBsaXN0IG9mIGFjdGlvbiBpdGVtcy4KKyAgICAgKi8KKyAgICBwcml2YXRlIGNsYXNzIE92ZXJmbG93TWVudUFkYXB0ZXIgZXh0ZW5kcyBNZW51QWRhcHRlciB7CisgICAgICAgIHByaXZhdGUgQXJyYXlMaXN0PE1lbnVJdGVtSW1wbD4gbU92ZXJmbG93SXRlbXM7CisKKyAgICAgICAgcHVibGljIE92ZXJmbG93TWVudUFkYXB0ZXIoaW50IG1lbnVUeXBlKSB7CisgICAgICAgICAgICBzdXBlcihtZW51VHlwZSk7CisgICAgICAgICAgICBtT3ZlcmZsb3dJdGVtcyA9IGdldE5vbkFjdGlvbkl0ZW1zKHRydWUpOwogICAgICAgICB9CiAKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBNZW51S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YWdzICY9IH5JU19BQ1RJT047CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBzaG93c1RleHRBc0FjdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIChtU2hvd0FzQWN0aW9uICYgU0hPV19BU19BQ1RJT05fV0lUSF9URVhUKSA9PSBTSE9XX0FTX0FDVElPTl9XSVRIX1RFWFQ7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0U2hvd0FzQWN0aW9uKGludCBhY3Rpb25FbnVtKSB7CisgICAgICAgIHN3aXRjaCAoYWN0aW9uRW51bSAmIFNIT1dfQVNfQUNUSU9OX01BU0spIHsKKyAgICAgICAgICAgIGNhc2UgU0hPV19BU19BQ1RJT05fQUxXQVlTOgorICAgICAgICAgICAgY2FzZSBTSE9XX0FTX0FDVElPTl9JRl9ST09NOgorICAgICAgICAgICAgY2FzZSBTSE9XX0FTX0FDVElPTl9ORVZFUjoKKyAgICAgICAgICAgICAgICAvLyBMb29rcyBnb29kIQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIC8vIE11dHVhbGx5IGV4Y2x1c2l2ZSBvcHRpb25zIHNlbGVjdGVkIQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlNIT1dfQVNfQUNUSU9OX0FMV0FZUywgU0hPV19BU19BQ1RJT05fSUZfUk9PTSwiCisgICAgICAgICAgICAgICAgICAgICAgICArICIgYW5kIFNIT1dfQVNfQUNUSU9OX05FVkVSIGFyZSBtdXR1YWxseSBleGNsdXNpdmUuIik7CisgICAgICAgIH0KKyAgICAgICAgbVNob3dBc0FjdGlvbiA9IGFjdGlvbkVudW07CisgICAgICAgIG1NZW51Lm9uSXRlbUFjdGlvblJlcXVlc3RDaGFuZ2VkKHRoaXMpOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRBY3Rpb25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AgICAgIHJldHVybiBtUG9wdXAgIT0gbnVsbCAmJiBtUG9wdXAuaXNTaG93aW5nKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb25JdGVtQ2xpY2soQWRhcHRlclZpZXc8Pz4gcGFyZW50LCBWaWV3IHZpZXcsIGludCBwb3NpdGlvbiwgbG9uZyBpZCkgeworICAgICAgICBNZW51SXRlbSBpdGVtID0gbnVsbDsKKyAgICAgICAgaWYgKG1PdmVyZmxvd09ubHkpIHsKKyAgICAgICAgICAgIGl0ZW0gPSBtTWVudS5nZXRPdmVyZmxvd0l0ZW0ocG9zaXRpb24pOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaXRlbSA9IG1NZW51LmdldEl0ZW0ocG9zaXRpb24pOworICAgICAgICB9CisgICAgICAgIG1NZW51LnBlcmZvcm1JdGVtQWN0aW9uKGl0ZW0sIDApOworICAgICAgICBtUG9wdXAuZGlzbWlzcygpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIG9uS2V5KFZpZXcgdiwgaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50KSB7CisgICAgICAgIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBLZXlFdmVudC5BQ1RJT05fVVAgJiYga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX01FTlUpIHsKKyAgICAgICAgICAgIGRpc21pc3MoKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwcml2YXRlIGludCBtZWFzdXJlQ29udGVudFdpZHRoKE1lbnVBZGFwdGVyIGFkYXB0ZXIpIHsKKyAgICAgICAgLy8gTWVudXMgZG9uJ3QgdGVuZCB0byBiZSBsb25nLCBzbyB0aGlzIGlzIG1vcmUgc2FuZSB0aGFuIGl0IGxvb2tzLgorICAgICAgICBpbnQgd2lkdGggPSAwOworICAgICAgICBWaWV3IGl0ZW1WaWV3ID0gbnVsbD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gbUNvbnRlbnRIZWlnaHQgPSBhLmdldExheW91dERpbWVuc2lvbigKKyAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BY3Rpb25Nb2RlX2hlaWdodCwgMCk7CisgICAgICAgIGEucmVjeWNsZSgpOworICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgQWN0aW9uTW9kZSBzdGFydEFjdGlvbk1vZGVGb3JDaGlsZChWaWV3IGNoaWxkLCBBY3Rpb25Nb2RlLkNhbGxiYWNrIGNhbGxiYWNrKSB7CisgICAgICAgIC8vIE5vIHN0YXJ0aW5nIGFuIGFjdGlvbiBtb2RlIGZvciBhbiBleGlzdGluZyBhY3Rpb24gbW9kZSBVSSBjaGlsZCEgKFdoZXJlIHdvdWxkIGl0IGdvPykKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0SGVpZ2h0KGludCBoZWlnaHQpIHsKKyAgICAgICAgbUNvbnRlbnRIZWlnaHQgPSBoZWlnaHQ7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0Q3VzdG9tVmlldyhWaWV3IHZpZXcpIHsKKyAgICAgICAgaWYgKG1DdXN0b21WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJlbW92ZVZpZXcobUN1c3RvbVZpZXcpOworICAgICAgICB9CisgICAgICAgIG1DdXN0b21WaWV3ID0gdmlldzsKKyAgICAgICAgaWYgKG1UaXRsZUxheW91dCAhPSBudWxsKSB7CisgICAgICAgICAgICByZW1vdmVWaWV3KG1UaXRsZUxheW91dCk7CisgICAgICAgICAgICBtVGl0bGVMYXlvdXQgPSBudWxsOworICAgICAgICB9CisgICAgICAgIGlmICh2aWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGFkZFZpZXcodmlldyk7CisgICAgICAgIH0KKyAgICAgICAgcmVxdWVzdExheW91dCgpOworICAgIH0KKworICAg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ICAgICBpZiAobVRpdGxlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtVGl0bGVWaWV3LnNldFRleHQobVRpdGxlKTsKKyAgICAgICAgICAgICAgICBpZiAobVRpdGxlU3R5bGVSZXMgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBtVGl0bGVWaWV3LnNldFRleHRBcHBlYXJhbmNlKG1Db250ZXh0LCBtVGl0bGVTdHlsZVJlcyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG1TdWJ0aXRsZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVN1YnRpdGxlVmlldy5zZXRUZXh0KG1TdWJ0aXRsZSk7CisgICAgICAgICAgICAgICAgaWYgKG1TdWJ0aXRsZVN0eWxlUmVzICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgbVN1YnRpdGxlVmlldy5zZXRUZXh0QXBwZWFyYW5jZShtQ29udGV4dCwgbVN1YnRpdGxlU3R5bGVSZXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtU3VidGl0bGVWaWV3LnNldFZpc2liaWxpdHkoVklTSUJMRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtVGl0bGVWaWV3LnNldFRleHQobVRpdGxlKTsKKyAgICAgICAgICAgIG1TdWJ0aXRsZVZpZXcuc2V0VGV4dChtU3VidGl0bGUpOworICAgICAgICAgICAgbVN1YnRpdGxlVmlldy5zZXRWaXNpYmlsaXR5KG1TdWJ0aXRsZSAhPSBudWxsID8gVklTSUJMRSA6IEdPTkUpOworICAgICAgICAgICAgaWYgKG1UaXRsZUxheW91dC5nZXRQYXJlbnQoKSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgYWRkVmlldyhtVGl0bGVMYXlvdXQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaW5pdEZvck1vZGUoZmluYWwgQWN0aW9uTW9kZSBtb2RlKSB7CisgICAgICAgIGlmIChtQ2xvc2UgPT0gbnVsbCkgeworICAgICAgICAgICAgTGF5b3V0SW5mbGF0ZXIgaW5mbGF0ZXIgPSBMYXlvdXRJbmZsYXRlci5mcm9tKG1Db250ZXh0KTsKKyAgICAgICAgICAgIGluZmxhdGVyLmluZmxhdGUoUi5sYXlvdXQuYWN0aW9uX21vZGVfY2xvc2VfaXRlbSwgdGhpcyk7CisgICAgICAgICAgICBtQ2xvc2UgPSBnZXRDaGlsZEF0KGdldENoaWxkQ291bnQoKSAtIDEpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYWRkVmlldyhtQ2xvc2UpOworICAgICAgICB9CisKKyAgICAgICAgVmlldyBjbG9zZUJ1dHRvbiA9IG1DbG9zZS5maW5kVmlld0J5SWQoUi5pZC5hY3Rpb25fbW9kZV9jbG9zZV9idXR0b24pOworICAgICAgICBjbG9zZUJ1dHRvbi5zZXRPbkNsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICAgICAgbW9kZS5maW5pc2goKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisKKyAgICAgICAgZmluYWwgTWVudUJ1aWxkZXIgbWVudSA9IChNZW51QnVpbGRlcikgbW9kZS5nZXRNZW51KCk7CisgICAgICAgIG1NZW51VmlldyA9IChBY3Rpb25NZW51VmlldykgbWVudS5nZXRNZW51VmlldyhNZW51QnVpbGRlci5UWVBFX0FDVElPTl9CVVRUT04sIHRoaXMpOworICAgICAgICBtTWVudVZpZXcuc2V0T3ZlcmZsb3dSZXNlcnZlZCh0cnVlKTsKKyAgICAgICAgbU1lbnVWaWV3LnVwZGF0ZUNoaWxkcmVuKGZhbHNlKTsKKyAgICAgICAgYWRkVmlldyhtTWVudVZpZXcpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsb3NlTW9kZSgpIHsKKyAgICAgICAgcmVtb3ZlQWxsVmlld3MoKTsKKyAgICAgICAgbUN1c3RvbVZpZXcgPSBudWxsOworICAgICAgICBtTWVudVZpZXcgPSBudWxsOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIHNob3dPdmVyZmxvd01lbnUoKSB7CisgICAgICAgIGlmIChtTWVudVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG1NZW51Vmlldy5zaG93T3ZlcmZsb3dNZW51KCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGhpZGVPdmVyZmxvd01lbnUoKSB7CisgICAgICAgIGlmIChtTWVudVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG1NZW51Vmlldy5oaWRlT3ZlcmZsb3dNZW51KCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzT3ZlcmZsb3dNZW51U2hvd2luZygpIHsKKyAgICAgICAgaWYgKG1NZW51VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbU1lbnVWaWV3LmlzT3ZlcmZsb3dNZW51U2hvd2luZygpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgTGF5b3V0UGFyYW1zIGdlbmVyYXRlRGVmYXVsdExheW91dFBhcmFtcygpIHsKKyAgICAgICAgLy8gVXNlZCBieSBjdXN0b20gdmlld3MgaWYgdGhleSBkb24ndCBzdXBwbHkgbGF5b3V0IHBhcmFtcy4gRXZlcnl0aGluZyBlbHNlCisgICAgICAgIC8vIGFkZGVkIHRvIGFuIEFjdGlvbkJhckNvbnRleHRWaWV3IHNob3VsZCBoYXZlIHRoZW0gYWxyZWF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pbnQgY2hpbGRDb3VudCA9IGdldENoaWxkQ291bnQoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjaGlsZENvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcgY2hpbGQgPSBnZXRDaGlsZEF0KGkpOworICAgICAgICAgICAgaWYgKGNoaWxkID09IG1DbG9zZSB8fCBjaGlsZCA9PSBtVGl0bGVMYXlvdXQgfHwgY2hpbGQgPT0gbUN1c3RvbVZpZXcpIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgYXZhaWxhYmxlV2lkdGggPSBtZWFzdXJlQ2hpbGRWaWV3KGNoaWxkLCBhdmFpbGFibGVXaWR0aCwgY2hpbGRTcGVjSGVpZ2h0LCAwKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQ3VzdG9tVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICBMYXlvdXRQYXJhbXMgbHAgPSBtQ3VzdG9tVmlldy5nZXRMYXlvdXRQYXJhbXMoKTsKKyAgICAgICAgICAgIGZpbmFsIGludCBjdXN0b21XaWR0aE1vZGUgPSBscC53aWR0aCAhPSBMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UID8KKyAgICAgICAgICAgICAgICAgICAgTWVhc3VyZVNwZWMuRVhBQ1RMWSA6IE1lYXN1cmVTcGVjLkFUX01PU1Q7CisgICAgICAgICAgICBmaW5hbCBpbnQgY3VzdG9tV2lkdGggPSBscC53aWR0aCA+PSAwID8KKyAgICAgICAgICAgICAgICAgICAgTWF0aC5taW4obHAud2lkdGgsIGF2YWlsYWJsZVdpZHRoKSA6IGF2YWlsYWJsZVdpZHRoOworICAgICAgICAgICAgZmluYWwgaW50IGN1c3RvbUhlaWdodE1vZGUgPSBscC5oZWlnaHQgIT0gTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCA/CisgICAgICAgICAgICAgICAgICAgIE1lYXN1cmVTcGVjLkVYQUNUTFkgOiBNZWFzdXJlU3BlYy5BVF9NT1NUOworICAgICAgICAgICAgZmluYWwgaW50IGN1c3RvbUhlaWdodCA9IGxwLmhlaWdodCA+PSAwID8KKyAgICAgICAgICAgICAgICAgICAgTWF0aC5taW4obHAuaGVpZ2h0LCBoZWlnaHQpIDogaGVpZ2h0OworICAgICAgICAgICAgbUN1c3RvbVZpZXcubWVhc3VyZShNZWFzdXJlU3BlYy5tYWtlTWVhc3VyZVNwZWMoY3VzdG9tV2lkdGgsIGN1c3RvbVdpZHRoTW9kZSksCisgICAgICAgICAgICAgICAgICAgIE1lYXN1cmVTcGVjLm1ha2VNZWFzdXJlU3BlYyhjdXN0b21IZWlnaHQsIGN1c3RvbUhlaWdodE1vZGUpKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQ29udGVudEhlaWdodCA8PSAwKSB7CisgICAgICAgICAgICBpbnQgbWVhc3VyZWRIZWlnaHQgPSAwOworICAgICAgICAgICAgZmluYWwgaW50IGNvdW50ID0gZ2V0Q2hpbGRDb3VudCgpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgVmlldyB2ID0gZ2V0Q2hpbGRBdChpKTsKKyAgICAgICAgICAgICAgICBpbnQgcGFkZGVkVmlld0hlaWdodCA9IHYuZ2V0TWVhc3VyZWRIZWlnaHQoKSArIHZlcnRpY2FsUGFkZGluZzsKKyAgICAgICAgICAgICAgICBpZiAocGFkZGVkVmlld0hlaWdodCA+IG1lYXN1cmVkSGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgICAgIG1lYXN1cmVkSGVpZ2h0ID0gcGFkZGVkVmlld0hlaWdodDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzZXRNZWFzdXJlZERpbWVuc2lvbihjb250ZW50V2lkdGgsIG1lYXN1cmVkSGVpZ2h0KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHNldE1lYXN1cmVkRGltZW5zaW9uKGNvbnRlbnRXaWR0aCwgbWF4SGVpZ2h0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uTGF5b3V0KGJvb2xlYW4gY2hhbmdlZCwgaW50IGwsIGludCB0LCBpbnQgciwgaW50IGIpIHsKKyAgICAgICAgaW50IHggPSBnZXRQYWRkaW5nTGVmdCgpOworICAgICAgICBmaW5hbCBpbnQgeSA9IGdldFBhZGRpbmdUb3AoKTsKKyAgICAgICAgZmluYWwgaW50IGNvbnRlbnRIZWlnaHQgPSBiIC0gdCAtIGdldFBhZGRpbmdUb3AoKSAtIGdldFBhZGRpbmdCb3R0b20oKTsKKyAgICAgICAgCisgICAgICAgIGlmIChtQ2xvc2UgIT0gbnVsbCAmJiBtQ2xvc2UuZ2V0VmlzaWJpbGl0eSgpICE9IEdPTkUpIHsKKyAgICAgICAgICAgIHggKz0gcG9zaXRpb25DaGlsZChtQ2xvc2UsIHgsIHksIGNvbnRlbnRIZWlnaHQpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobVRpdGxlTGF5b3V0ICE9IG51bGwgJiYgbUN1c3RvbVZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgeCArPSBwb3NpdGlvbkNoaWxkKG1UaXRsZUxheW91dCwgeCwgeSwgY29udGVudEhlaWdodCk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtQ3VzdG9tVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICB4ICs9IHBvc2l0aW9uQ2hpbGQobUN1c3RvbVZpZXcsIHgsIHksIGNvbnRlbnRIZWlnaHQpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICB4ID0gciAtIGwgLSBnZXRQYWRkaW5nUmlnaHQoKTsKKworICAgICAgICBpZiAobU1lbnVWaWV3ICE9IG51bGwpIHsKKyAgIC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0KS5nZXRDb21wb25lbnROYW1lKCkpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE5hbWVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkFjdGl2aXR5IGNvbXBvbmVudCBuYW1lIG5vdCBmb3VuZCEiLCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUxvZ28gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Mb2dvID0gYXBwSW5mby5sb2FkTG9nbyhwbSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBtSWNvbiA9IGEuZ2V0RHJhd2FibGUoUi5zdHlsZWFibGUuQWN0aW9uQmFyX2ljb24pOworICAgICAgICBpZiAobUljb24gPT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKGNvbnRleHQgaW5zdGFuY2VvZiBBY3Rpdml0eSkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIG1JY29uID0gcG0uZ2V0QWN0aXZpdHlJY29uKCgoQWN0aXZpdHkpIGNvbnRleHQpLmdldENvbXBvbmVudE5hbWUoKSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoTmFtZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiQWN0aXZpdHkgY29tcG9uZW50IG5hbWUgbm90IGZvdW5kISIsIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtSWNvbiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUljb24gPSBhcHBJbmZvLmxvYWRJY29uKHBtKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIG1Ib21lTGF5b3V0ID0gbmV3IExpbmVhckxheW91dChjb250ZXh0LCBudWxsLAorICAgICAgICAgICAg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odCwgMCk7CisgICAgICAgIAorICAgICAgICBtRGl2aWRlciA9IGEuZ2V0RHJhd2FibGUoUi5zdHlsZWFibGUuQWN0aW9uQmFyX2RpdmlkZXIpOworCisgICAgICAgIGEucmVjeWNsZSgpOworICAgICAgICAKKyAgICAgICAgaWYgKG1Mb2dvICE9IG51bGwgfHwgbUljb24gIT0gbnVsbCB8fCBtVGl0bGUgIT0gbnVsbCkgeworICAgICAgICAgICAgbUxvZ29OYXZJdGVtID0gbmV3IEFjdGlvbk1lbnVJdGVtKGNvbnRleHQsIDAsIGFuZHJvaWQuUi5pZC5ob21lLCAwLCAwLCBtVGl0bGUpOworICAgICAgICAgICAgbUhvbWVDbGlja0xpc3RlbmVyID0gbmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBnZXRDb250ZXh0KCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChjb250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEFjdGl2aXR5IGFjdGl2aXR5ID0gKEFjdGl2aXR5KSBjb250ZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZpdHkub25PcHRpb25zSXRlbVNlbGVjdGVkKG1Mb2dvTmF2SXRlbSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEFjdGlvbk1vZGUgc3RhcnRBY3Rpb25Nb2RlRm9yQ2hpbGQoVmlldyBjaGlsZCwgQWN0aW9uTW9kZS5DYWxsYmFjayBjYWxsYmFjaykgeworICAgICAgICAvLyBObyBzdGFydGluZyBhbiBhY3Rpb24gbW9kZSBmb3IgYW4gYWN0aW9uIGJhciBjaGlsZCEgKFdoZXJlIHdvdWxkIGl0IGdvPykKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0Q2FsbGJhY2soTmF2aWdhdGlvbkNhbGxiYWNrIGNhbGxiYWNrKSB7CisgICAgICAgIG1DYWxsYmFjayA9IGNhbGxiYWNrOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldE1lbnUoTWVudSBtZW51KSB7CisgICAgICAgIE1lbnVCdWlsZGVyIGJ1aWxkZXIgPSAoTWVudUJ1aWxkZXIpIG1lbnU7CisgICAgICAgIG1PcHRpb25zTWVudSA9IGJ1aWxkZXI7CisgICAgICAgIGlmIChtTWVudVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgcmVtb3ZlVmlldyhtTWVudVZpZXcpOworICAgICAgICB9CisgICAgICAgIGZpbmFsIEFjdGlvbk1lbnVWaWV3IG1lbnVWaWV3ID0gKEFjdGlvbk1lbnVWaWV3KSBidWlsZGVyLmdldE1lbnVWaWV3KAorICAgICAgICAgICAgICAgIE1lbnVCdWlsZGVyLlRZUEVfQUNUSU9OX0JVVFRPTiwgbnVsbCk7CisgICAgICAgIGZpbmFsIExheW91dFBhcmFtcyBsYXlvdXRQYXJhbXMgPSBuZXcgTGF5b3V0UGFyYW1zKExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsCisgICAgICAgICAgICAgICAgTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCk7CisgICAgICAgIG1lbnVWaWV3LnNldExheW91dFBhcmFtcyhsYXlvdXRQYXJhbXMpOworICAgICAgICBhZGRWaWV3KG1lbnVWaWV3KTsKKyAgICAgICAgbU1lbnVWaWV3ID0gbWVudVZpZXc7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gc2hvd092ZXJmbG93TWVudSgpIHsKKyAgICAgICAgaWYgKG1NZW51VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbU1lbnVWaWV3LnNob3dPdmVyZmxvd01lbnUoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcG9zdFNob3dPdmVyZmxvd01lbnUoKSB7CisgICAgICAgIHBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIHNob3dPdmVyZmxvd01lbnUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaGlkZU92ZXJmbG93TWVudSgpIHsKKyAgICAgICAgaWYgKG1NZW51VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbU1lbnVWaWV3LmhpZGVPdmVyZmxvd01lbnUoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNPdmVyZmxvd01lbnVTaG93aW5nKCkgeworICAgICAgICBpZiAobU1lbnVWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBtTWVudVZpZXcuaXNPdmVyZmxvd01lbnVTaG93aW5nKCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzT3ZlcmZsb3dSZXNlcnZlZCgpIHsKKyAgICAgICAgcmV0dXJuIG1NZW51VmlldyAhPSBudWxsICYmIG1NZW51Vmlldy5pc092ZXJmbG93UmVzZXJ2ZWQoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRDdXN0b21OYXZpZ2F0aW9uVmlldyhWaWV3IHZpZXcpIHsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBzaG93Q3VzdG9tID0gKG1EaXNwbGF5T3B0aW9ucyAmIEFjdGlvbkJhci5ESVNQTEFZX1NIT1dfQ1VTVE9NKSAhPSAwOworICAgIC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0gfihBY3Rpb25CYXIuRElTUExBWV9ISURFX0hPTUUgfCBBY3Rpb25CYXIuRElTUExBWV9TSE9XX0hPTUUpOworICAgICAgICB9CisgICAgICAgIC8vIEVuZCBUT0RPCisKKyAgICAgICAgZmluYWwgaW50IGZsYWdzQ2hhbmdlZCA9IG9wdGlvbnMgXiBtRGlzcGxheU9wdGlvbnM7CisgICAgICAgIG1EaXNwbGF5T3B0aW9ucyA9IG9wdGlvbnM7CisgICAgICAgIGlmICgoZmxhZ3NDaGFuZ2VkICYgRElTUExBWV9SRUxBWU9VVF9NQVNLKSAhPSAwKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgdmlzID0gKG9wdGlvbnMgJiBBY3Rpb25CYXIuRElTUExBWV9TSE9XX0hPTUUpICE9IDAgPyBWSVNJQkxFIDogR09ORTsKKyAgICAgICAgICAgIG1Ib21lTGF5b3V0LnNldFZpc2liaWxpdHkodmlzKTsKKworICAgICAgICAgICAgaWYgKChmbGFnc0NoYW5nZWQgJiBBY3Rpb25CYXIuRElTUExBWV9IT01FX0FTX1VQKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgbUhvbWVBc1VwVmlldy5zZXRWaXNpYmlsaXR5KChvcHRpb25zICYgQWN0aW9uQmFyLkRJU1BMQVlfSE9NRV9BU19VUCkgIT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgPyBWSVNJQkxFIDogR09ORSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtTG9nb1ZpZXcgIT0gbnVsbCAmJiAoZmxhZ3NDaGFuZ2VkICYgQWN0aW9uQmFyLkRJU1BMQVlfVVNFX0xPR08pICE9IDApIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGxvZ29WaXMgPSAob3B0aW9ucyAmIEFjdGlvbkJhci5ESVNQTEFZX1VTRV9MT0dPKSAhPSAwOworICAgICAgICAgICAgICAgIG1Mb2dvVmlldy5zZXRWaXNpYmlsaXR5KGxvZ29WaXMgPyBWSVNJQkxFIDogR09ORSk7CisgICAgICAgICAgICAgICAgbUljb25WaWV3LnNldFZpc2liaWxpdHkobG9nb1ZpcyA/IEdPTkUgOiBWSVNJQkxFKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKChmbGFnc0NoYW5nZWQgJiBBY3Rpb25CYXIuRElTUExBWV9TSE9XX1RJVExFKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgaWYgKChvcHRpb25zICYgQWN0aW9uQmFyLkRJU1BMQVlfU0hPV19USVRMRSkgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBpbml0VGl0bGUoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZW1vdmVWaWV3KG1UaXRsZUxheW91dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKGZsYWdzQ2hhbmdlZCAmIEFjdGlvbkJhci5ESVNQTEFZX1NIT1dfQ1VTVE9NKSAhPSAwICYmIG1DdXN0b21OYXZWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoKG9wdGlvbnMgJiBBY3Rpb25CYXIuRElTUExBWV9TSE9XX0NVU1RPTSkgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBhZGRWaWV3KG1DdXN0b21OYXZWaWV3KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZW1vdmVWaWV3KG1DdXN0b21OYXZWaWV3KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHJlcXVlc3RMYXlvdXQoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldE5hdmlnYXRpb25Nb2RlKGludCBtb2RlKSB7CisgICAgICAgIGZpbmFsIGludCBvbGRNb2RlID0gbU5hdmlnYXRpb25Nb2RlOworICAgICAgICBpZiAobW9kZSAhPSBvbGRNb2RlKSB7CisgICAgICAgICAgICBzd2l0Y2ggKG9sZE1vZGUpIHsKKyAgICAgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9MSVNUOgorICAgICAgICAgICAgICAgIGlmIChtU3Bpbm5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlbW92ZVZpZXcobVNwaW5uZXIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9UQUJTOgorICAgICAgICAgICAgICAgIGlmIChtVGFiTGF5b3V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVtb3ZlVmlldyhtVGFiU2Nyb2xsVmlldyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBzd2l0Y2ggKG1vZGUpIHsKKyAgICAgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9MSVNUOgorICAgICAgICAgICAgICAgIG1TcGlubmVyID0gbmV3IFNwaW5uZXIobUNvbnRleHQsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmF0dHIuYWN0aW9uRHJvcERvd25TdHlsZSk7CisgICAgICAgICAgICAgICAgbVNwaW5uZXIuc2V0QWRhcHRlcihtU3Bpbm5lckFkYXB0ZXIpOworICAgICAgICAgICAgICAgIG1TcGlubmVyLnNldE9uSXRlbVNlbGVjdGVkTGlzdGVuZXIobU5hdkl0ZW1TZWxlY3RlZExpc3RlbmVyKTsKKyAgICAgICAgICAgICAgICBhZGRWaWV3KG1TcGlubmVyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9UQUJTOgorICAgICAgICAgICAgICAgIGVuc3VyZVRhYnNFeGlzdCgpOworICAgICAgICAgICAgICAgIGFkZFZpZXcobVRhYlNjcm9sbFZpZXcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU5hdmlnYXRpb25Nb2RlID0gbW9kZTsKKyAgICAgICAgICAgIHJlcXVlc3RMYXlvdXQoKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwcml2YXRlIHZvaWQgZW5zdXJlVGFic0V4aXN0KCkgeworICAgICAgICBpZiAobVRhYlNjcm9sbFZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgbVRhYlNjcm9sbFZpZXcgPSBuZXcgSG9yaXpvbnRhbFNjcm9sbFZpZXcoZ2V0Q29udGV4dCgpKTsKKyAgICAgICAgICAgIG1UYWJMYXlvdXQgPSBuZXcgTGluZWFyTGF5b3V0KGdldENvbnRleHQoKSwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hdHRyLmFjdGlvbkJhclRhYkJhclN0eWxlKTsKKyAgICAgICAgICAgIG1UYWJTY3JvbGxWaWV3LmFkZFZpZXcobVRhYkxheW91dCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXREcm9wZG93bkFkYXB0ZXIoU3Bpbm5lckFkYXB0ZXIgYWRhcHRlcikgeworICAgICAgICBtU3Bpbm5lckFkYXB0ZXIgPSBhZGFwdGVyOworICAgICAgICBpZiAobVNwaW5uZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbVNwaW5uZXIuc2V0QWRhcHRlcihhZGFwdGVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBTcGlubmVyQWRhcHRlciBnZXREcm9wZG93bkFkYXB0ZXIoKSB7CisgICAgICAgIHJldHVybiBtU3Bpbm5lckFkYXB0ZXI7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0RHJvcGRvd25TZWxlY3RlZFBvc2l0aW9uKGludCBwb3NpdGlvbikgeworICAgICAgICBtU3Bpbm5lci5zZXRTZWxlY3Rpb24ocG9zaXRpb24pOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0RHJvcGRvd25TZWxlY3RlZFBvc2l0aW9uKCkgeworICAgICAgICByZXR1cm4gbVNwaW5uZXIuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKTsKKyAgICB9CisKKyAgICBwdWJsaWMgVmlldyBnZXRDdXN0b21OYXZpZ2F0aW9uVmlldygpIHsKKyAgICAgICAgcmV0dXJuIG1DdXN0b21OYXZWaWV3OworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgaW50IGdldE5hdmlnYXRpb25Nb2RlKCkgeworICAgICAgICByZXR1cm4gbU5hdmlnYXRpb25Nb2RlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgaW50IGdldERpc3BsYXlPcHRpb25zKCkgeworICAgICAgICByZXR1cm4gbURpc3BsYXlPcHRpb25zOworICAgIH0KKworICAgIHByaXZhdGUgVGFiVmlldyBjcmVhdGVUYWJWaWV3KEFjdGlvbkJhci5UYWIgdGFiKSB7CisgICAgICAgIGZpbmFsIFRhYlZpZXcgdGFiVmlldyA9IG5ldyBUYWJWaWV3KGdldENvbnRleHQoKSwgdGFiKTsKKyAgICAgICAgdGFiVmlldy5zZXRGb2N1c2FibGUodHJ1ZSk7CisKKyAgICAgICAgaWYgKG1UYWJDbGlja0xpc3RlbmVyID09IG51bGwpIHsKKyAgICAgICAgICAgIG1UYWJDbGlja0xpc3RlbmVyID0gbmV3IFRhYkNsaWNrTGlzdGVuZXIoKTsKKyAgICAgICAgfQorICAgICAgICB0YWJWaWV3LnNldE9uQ2xpY2tMaXN0ZW5lcihtVGFiQ2xpY2tMaXN0ZW5lcik7CisgICAgICAgIHJldHVybiB0YWJWaWV3OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZFRhYihBY3Rpb25CYXIuVGFiIHRhYiwgYm9vbGVhbiBzZXRTZWxlY3RlZCkgeworICAgICAgICBlbnN1cmVUYWJzRXhpc3QoKTsKKyAgICAgICAgVmlldyB0YWJWaWV3ID0gY3JlYXRlVGFiVmlldyh0YWIpOworICAgICAgICBtVGFiTGF5b3V0LmFkZFZpZXcodGFiVmlldyk7CisgICAgICAgIGlmIChzZXRTZWxlY3RlZCkgeworICAgICAgICAgICAgdGFiVmlldy5zZXRTZWxlY3RlZCh0cnVlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZFRhYihBY3Rpb25CYXIuVGFiIHRhYiwgaW50IHBvc2l0aW9uLCBib29sZWFuIHNldFNlbGVjdGVkKSB7CisgICAgICAgIGVuc3VyZVRhYnNFeGlzdCgpOworICAgICAgICBmaW5hbCBUYWJWaWV3IHRhYlZpZXcgPSBjcmVhdGVUYWJWaWV3KHRhYik7CisgICAgICAgIG1UYWJMYXlvdXQuYWRkVmlldyh0YWJWaWV3LCBwb3NpdGlvbik7CisgICAgICAgIGlmIChzZXRTZWxlY3RlZCkgeworICAgICAgICAgICAgdGFiVmlldy5zZXRTZWxlY3RlZCh0cnVlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHJlbW92ZVRhYkF0KGludCBwb3NpdGlvbikgeworICAgICAgICBpZiAobVRhYkxheW91dCAhPSBudWxsKSB7CisgICAgICAgICAgICBtVGFiTGF5b3V0LnJlbW92ZVZpZXdBdChwb3NpdGlvbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgTGF5b3V0UGFyYW1zIGdlbmVyYXRlRGVmYXVsdExheW91dFBhcmFtcygpIHsKKyAgICAgICAgLy8gVXNlZCBieSBjdXN0b20gbmF2IHZpZXdzIGlmIHRoZXkgZG9uJ3Qgc3VwcGx5IGxheW91dCBwYXJhbXMuIEV2ZXJ5dGhpbmcgZWxzZQorICAgICAgICAvLyBhZGRlZCB0byBhbiBBY3Rpb25CYXJWaWV3IHNob3VsZCBoYXZlIHRoZW0gYWxyZWFkeS4KKyAgICAgICAgcmV0dXJuIG5ldyBBY3Rpb25CYXIuTGF5b3V0UGFyYW1zKERFRkFVTFRfQ1VTVE9NX0dSQVZJVFkpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uRmluaXNoSW5mbGF0ZSgpIHsKKyAgICAgICAgc3VwZXIub25GaW5pc2hJbmZsYXRlKCk7CisKKyAgICAgICAgZmluYWwgQ29udGV4dCBjb250ZXh0ID0gZ2V0Q29udGV4dCgpOworCisgICAgICAgIGlmIChtTG9nbyAhPSBudWxsKSB7CisgICAgICAgICAgICBtTG9nb1ZpZXcgPSBuZXcgSW1hZ2VWaWV3KGNvbnRleHQpOworICAgICAgICAgICAgbUxvZ29WaWV3LnNldFNjYWxlVHlwZShJbWFnZVZpZXcuU2NhbGVUeXBlLkNFTlRFUik7CisgICAgICAgICAgICBtTG9nb1ZpZXcuc2V0TGF5b3V0UGFyYW1zKG5ldyBMYXlvdXRQYXJhbXMoTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCwKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCkpOworICAgICAgICAgICAgbUxvZ29WaWV3LnNldEltYWdlRHJhd2FibGUobUxvZ28pOworICAgICAgICAgICAgbUxvZ29WaWV3LnNldFZpc2liaWxpdHkoKG1EaXNwbGF5T3B0aW9ucyAmIEFjdGlvbkJhci5ESVNQTEFZX1VTRV9MT0dPKSAhPSAwCisgICAgICAgICAgICAgICAgICAgID8gVklTSUJMRSA6IEdPTkUpOworICAgICAgICAgICAgbUhvbWVMYXlvdXQuYWRkVmlldyhtTG9nb1ZpZXcpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1JY29uICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1JY29uVmlldyA9IG5ldyBJbWFnZVZpZXcoY29udGV4dCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hdHRyLmFjdGlvbkJ1dHRvblN0eWxlKTsKKyAgICAgICAgICAgIG1JY29uVmlldy5zZXRTY2FsZVR5cGUoSW1hZ2VWaWV3LlNjYWxlVHlwZS5DRU5URVIpOworICAgICAgICAgICAgbUljb25WaWV3LnNldExheW91dFBhcmFtcyhuZXcgTGF5b3V0UGFyYW1zKExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsCisgICAgICAgICAgICAgICAgICAgIExheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpKTsKKyAgICAgICAgICAgIG1JY29uVmlldy5zZXRJbWFnZURyYXdhYmxlKG1JY29uKTsKKyAgICAgICAgICAgIG1JY29uVmlldy5zZXRWaXNpYmlsaXR5KAorICAgICAgICAgICAgICAgICAgICAobURpc3BsYXlPcHRpb25zICYgQWN0aW9uQmFyLkRJU1BMQVlfVVNFX0xPR08pID09IDAgfHwgbUxvZ28gPT0gbnVsbAorICAgICAgICAgICAgICAgICAgICA/IFZJU0lCTEUgOiBHT05FKTsKKyAgICAgICAgICAgIG1Ib21lTGF5b3V0LmFkZFZpZXcobUljb25WaWV3KTsKKyAgICAgICAgfQorCisgICAgICAgIGFkZFZpZXcobUhvbWVMYXlvdXQpOworCisgICAgICAgIHN3aXRjaCAobU5hdmlnYXRpb25Nb2RlKSB7CisgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9TVEFOREFSRDoKKyAgICAgICAgICAgIGlmIChtTG9nb1ZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGluaXRUaXRsZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0xJU1Q6CisgICAgICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJJbmZsYXRpbmcgbGlzdCBuYXZpZ2F0aW9uIGlzbid0IHN1cHBvcnRlZCB5ZXQhIik7CisgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX1RBQlM6CisgICAgICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJJbmZsYXRpbmcgdGFiIG5hdmlnYXRpb24gaXNuJ3Qgc3VwcG9ydGVkIHlldCEiKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQ3VzdG9tTmF2VmlldyAhPSBudWxsICYmIChtRGlzcGxheU9wdGlvbnMgJiBBY3Rpb25CYXIuRElTUExBWV9TSE9XX0NVU1RPTSkgIT0gMCkgeworICAgICAgICAgICAgZmluYWwgVmlld1BhcmVudCBwYXJlbnQgPSBtQ3VzdG9tTmF2Vmlldy5nZXRQYXJlbnQoKTsKKyAgICAgICAgICAgIGlmIChwYXJlbnQgIT0gdGhpcykgeworICAgICAgICAgICAgICAgIGlmIChwYXJlbnQgaW5zdGFuY2VvZiBWaWV3R3JvdXApIHsKKyAgICAgICAgICAgICAgICAgICAgKChWaWV3R3JvdXApIHBhcmVudCkucmVtb3ZlVmlldyhtQ3VzdG9tTmF2Vmlldyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGFkZFZpZXcobUN1c3RvbU5hdlZpZXcpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAorICAgIHByaXZhdGUgdm9pZCBpbml0VGl0bGUoKSB7CisgICAgICAgIExheW91dEluZmxhdGVyIGluZmxhdGVyID0gTGF5b3V0SW5mbGF0ZXIuZnJvbShnZXRDb250ZXh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2Nyb2xsVmlldy5nZXRNZWFzdXJlZFdpZHRoKCk7CisgICAgICAgICAgICAgICAgYXZhaWxhYmxlV2lkdGggLT0gdGFiV2lkdGg7CisgICAgICAgICAgICAgICAgbGVmdE9mQ2VudGVyIC09IHRhYldpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAoKG1EaXNwbGF5T3B0aW9ucyAmIEFjdGlvbkJhci5ESVNQTEFZX1NIT1dfQ1VTVE9NKSAhPSAwICYmIG1DdXN0b21OYXZWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZpbmFsIExheW91dFBhcmFtcyBscCA9IGdlbmVyYXRlTGF5b3V0UGFyYW1zKG1DdXN0b21OYXZWaWV3LmdldExheW91dFBhcmFtcygpKTsKKyAgICAgICAgICAgIGZpbmFsIEFjdGlvbkJhci5MYXlvdXRQYXJhbXMgYWJscCA9IGxwIGluc3RhbmNlb2YgQWN0aW9uQmFyLkxheW91dFBhcmFtcyA/CisgICAgICAgICAgICAgICAgICAgIChBY3Rpb25CYXIuTGF5b3V0UGFyYW1zKSBscCA6IG51bGw7CisKKyAgICAgICAgICAgIGludCBob3Jpem9udGFsTWFyZ2luID0gMDsKKyAgICAgICAgICAgIGludCB2ZXJ0aWNhbE1hcmdpbiA9IDA7CisgICAgICAgICAgICBpZiAoYWJscCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaG9yaXpvbnRhbE1hcmdpbiA9IGFibHAubGVmdE1hcmdpbiArIGFibHAucmlnaHRNYXJnaW47CisgICAgICAgICAgICAgICAgdmVydGljYWxNYXJnaW4gPSBhYmxwLnRvcE1hcmdpbiArIGFibHAuYm90dG9tTWFyZ2luOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBJZiB0aGUgYWN0aW9uIGJhciBpcyB3cmFwcGluZyB0byBpdHMgY29udGVudCBoZWlnaHQsIGRvbid0IGFsbG93IGEgY3VzdG9tCisgICAgICAgICAgICAvLyB2aWV3IHRvIE1BVENIX1BBUkVOVC4KKyAgICAgICAgICAgIGludCBjdXN0b21OYXZIZWlnaHRNb2RlOworICAgICAgICAgICAgaWYgKG1Db250ZW50SGVpZ2h0IDw9IDApIHsKKyAgICAgICAgICAgICAgICBjdXN0b21OYXZIZWlnaHRNb2RlID0gTWVhc3VyZVNwZWMuQVRfTU9TVDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgY3VzdG9tTmF2SGVpZ2h0TW9kZSA9IGxwLmhlaWdodCAhPSBMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UID8KKyAgICAgICAgICAgICAgICAgICAgICAgIE1lYXN1cmVTcGVjLkVYQUNUTFkgOiBNZWFzdXJlU3BlYy5BVF9NT1NUOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmluYWwgaW50IGN1c3RvbU5hdkhlaWdodCA9IE1hdGgubWF4KDAsCisgICAgICAgICAgICAgICAgICAgIChscC5oZWlnaHQgPj0gMCA/IE1hdGgubWluKGxwLmhlaWdodCwgaGVpZ2h0KSA6IGhlaWdodCkgLSB2ZXJ0aWNhbE1hcmdpbik7CisKKyAgICAgICAgICAgIGZpbmFsIGludCBjdXN0b21OYXZXaWR0aE1vZGUgPSBscC53aWR0aCAhPSBMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UID8KKyAgICAgICAgICAgICAgICAgICAgTWVhc3VyZVNwZWMuRVhBQ1RMWSA6IE1lYXN1cmVTcGVjLkFUX01PU1Q7CisgICAgICAgICAgICBpbnQgY3VzdG9tTmF2V2lkdGggPSBNYXRoLm1heCgwLAorICAgICAgICAgICAgICAgICAgICAobHAud2lkdGggPj0gMCA/IE1hdGgubWluKGxwLndpZHRoLCBhdmFpbGFibGVXaWR0aCkgOiBhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgICAgICAgICAgICAgLSBob3Jpem9udGFsTWFyZ2luKTsKKyAgICAgICAgICAgIGZpbmFsIGludCBoZ3J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gPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgVmlldyB2ID0gZ2V0Q2hpbGRBdChpKTsKKyAgICAgICAgICAgICAgICBpbnQgcGFkZGVkVmlld0hlaWdodCA9IHYuZ2V0TWVhc3VyZWRIZWlnaHQoKSArIHZlcnRpY2FsUGFkZGluZzsKKyAgICAgICAgICAgICAgICBpZiAocGFkZGVkVmlld0hlaWdodCA+IG1lYXN1cmVkSGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgICAgIG1lYXN1cmVkSGVpZ2h0ID0gcGFkZGVkVmlld0hlaWdodDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzZXRNZWFzdXJlZERpbWVuc2lvbihjb250ZW50V2lkdGgsIG1lYXN1cmVkSGVpZ2h0KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHNldE1lYXN1cmVkRGltZW5zaW9uKGNvbnRlbnRXaWR0aCwgbWF4SGVpZ2h0KTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQ29udGV4dFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgbUNvbnRleHRWaWV3LnNldEhlaWdodChnZXRNZWFzdXJlZEhlaWdodCgpKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgaW50IG1lYXN1cmVDaGlsZFZpZXcoVmlldyBjaGlsZCwgaW50IGF2YWlsYWJsZVdpZHRoLCBpbnQgY2hpbGRTcGVjSGVpZ2h0LCBpbnQgc3BhY2luZykgeworICAgICAgICBjaGlsZC5tZWFzdXJlKE1lYXN1cmVTcGVjLm1ha2VNZWFzdXJlU3BlYyhhdmFpbGFibGVXaWR0aCwgTWVhc3VyZVNwZWMuQVRfTU9TVCksCisgICAgICAgICAgICAgICAgY2hpbGRTcGVjSGVpZ2h0KTsKKworICAgICAgICBhdmFpbGFibGVXaWR0aCAtPSBjaGlsZC5nZXRNZWFzdXJlZFdpZHRoKCk7CisgICAgICAgIGF2YWlsYWJsZVdpZHRoIC09IHNwYWNpbmc7CisKKyAgICAgICAgcmV0dXJuIGF2YWlsYWJsZVdpZHRoOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uTGF5b3V0KGJvb2xlYW4gY2hhbmdlZCwgaW50IGwsIGludCB0LCBpbnQgciwgaW50IGIpIHsKKyAgICAgICAgaW50IHggPSBnZXRQYWRkaW5nTGVmdCgpOworICAgICAgICBmaW5hbCBpbnQgeSA9IGdldFBhZGRpbmdUb3AoKTsKKyAgICAgICAgZmluYWwgaW50IGNvbnRlbnRIZWlnaHQgPSBiIC0gdCAtIGdldFBhZGRpbmdUb3AoKSAtIGdldFBhZGRpbmdCb3R0b20oKTsKKworICAgICAgICBpZiAobUhvbWVMYXlvdXQuZ2V0VmlzaWJpbGl0eSgpICE9IEdPTkUpIHsKKyAgICAgICAgICAgIHggKz0gcG9zaXRpb25DaGlsZChtSG9tZUxheW91dCwgeCwgeSwgY29udGVudEhlaWdodCk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtVGl0bGVMYXlvdXQgIT0gbnVsbCAmJiAobURpc3BsYXlPcHRpb25zICYgQWN0aW9uQmFyLkRJU1BMQVlfU0hPV19USVRMRSkgIT0gMCkgeworICAgICAgICAgICAgeCArPSBwb3NpdGlvbkNoaWxkKG1UaXRsZUxheW91dCwgeCwgeSwgY29udGVudEhlaWdodCk7CisgICAgICAgIH0KKworICAgICAgICBzd2l0Y2ggKG1OYXZpZ2F0aW9uTW9kZSkgeworICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfU1RBTkRBUkQ6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0xJU1Q6CisgICAgICAgICAgICBpZiAobVNwaW5uZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHggKz0gcG9zaXRpb25DaGlsZChtU3Bpbm5lciwgeCwgeSwgY29udGVudEhlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX1RBQlM6CisgICAgICAgICAgICBpZiAobVRhYlNjcm9sbFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHggKz0gcG9zaXRpb25DaGlsZChtVGFiU2Nyb2xsVmlldywgeCwgeSwgY29udGVudEhlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpbnQgbWVudUxlZnQgPSByIC0gbCAtIGdldFBhZGRpbmdSaWdodCgpOworICAgICAgICBpZiAobU1lbnVWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHBvc2l0aW9uQ2hpbGRJbnZlcnNlKG1NZW51VmlldywgbWVudUxlZnQsIHksIGNvbnRlbnRIZWlnaHQpOworICAgICAgICAgICAgbWVudUxlZnQgLT0gbU1lbnVWaWV3LmdldE1lYXN1cmVkV2lkdGgoKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQ3VzdG9tTmF2VmlldyAhPSBudWxsICYmIChtRGlzcGxheU9wdGlvbnMgJiBBY3Rpb25CYXIuRElTUExBWV9TSE9XX0NVU1RPTSkgIT0gMCkgeworICAgICAgICAgICAgTGF5b3V0UGFyYW1zIGxwID0gbUN1c3RvbU5hdlZpZXcuZ2V0TGF5b3V0UGFyYW1zKCk7CisgICAgICAgICAgICBmaW5hbCBBY3Rpb25CYXIuTGF5b3V0UGFyYW1zIGFibHAgPSBscCBpbnN0YW5jZW9mIEFjdGlvbkJhci5MYXlvdXRQYXJhbXMgPworICAgICAgICAgICAgICAgICAgICAoQWN0aW9uQmFyLkxheW91dFBhcmFtcykgbHAgOiBudWxsOworCisgICAgICAgICAgICBmaW5hbCBpbnQgZ3Jhdml0eSA9IGFibHAgIT0gbnVsbCA/IGFibHAuZ3Jhdml0eSA6IERFRkFVTFRfQ1VTVE9NX0dSQVZJVFk7CisgICAgICAgICAgICBmaW5hbCBpbnQgbmF2V2lkdGggPSBtQ3VzdG9tTmF2Vmlldy5nZXRNZWFzdXJlZFdpZHRoKCk7CisKKyAgICAgICAgICAgIGludCB0b3BNYXJnaW4gPSAwOworICAgICAgICAgICAgaW50IGJvdHRvbU1hcmdpbiA9IDA7CisgICAgICAgICAgICBpZiAoYWJscCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgeCArPSBhYmxwLmxlZnRNYXJnaW47CisgICAgICAgICAgICAgICAgbWVudUxlZnQgLT0gYWJscC5yaWdodE1hcmdpbjsKKyAgICAgICAgICAgICAgICB0b3BNYXJnaW4gPSBhYmxwLnRvcE1hcmdpbjsKKyAgICAgICAgICAgICAgICBib3R0b21NYXJnaW4gPSBhYmxwLmJvdHRvbU1hcmdpbjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50IGhncmF2aXR5ID0gZ3Jhdml0eSAmIEdyYXZpdHkuSE9SSVpPTlRBTF9HUkFWSVRZX01BU0s7CisgICAgICAgICAgICAvLyBTZWUgaWYgd2UgYWN0dWFsbHkgaGF2ZSByb29tIHRvIHRydWx5IGNlbnRlcjsgaWYgbm90IHB1c2ggYWdhaW5zdCBsZWZ0IG9yIHJpZ2h0LgorICAgICAgICAgICAgaWYgKGhncmF2aXR5ID09IEdyYXZpdHkuQ0VOVEVSX0hPUklaT05UQUwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgY2VudGVyZWRMZWZ0ID0gKChtUmlnaHQgLSBtTGVmdCkgLSBuYXZXaWR0aCkgLyAyOworICAgICAgICAgICAgICAgIGlmIChjZW50ZXJlZExlZnQgPCB4KSB7CisgICAgICAgICAgICAgICAgICAgIGhncmF2aXR5ID0gR3Jhdml0eS5MRUZUOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2VudGVyZWRMZWZ0ICsgbmF2V2lkdGggPiBtZW51TGVmdCkgeworICAgICAgICAgICAgICAgICAgICBoZ3Jhdml0eSA9IEdyYXZpdHkuUklHSFQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQgeHBvcyA9IDA7CisgICAgICAgICAgICBzd2l0Y2ggKGhncmF2aXR5KSB7CisgICAgICAgICAgICAgICAgY2FzZSBHcmF2aXR5LkNFTlRFUl9IT1JJWk9OVEFMOgorICAgICAgICAgICAgICAgICAgICB4cG9zID0gKChtUmlnaHQgLSBtTGVmdCkgLSBuYXZXaWR0aCkgLyAyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEdyYXZpdHkuTEVGVDoKKyAgICAgICAgICAgICAgICAgICAgeHBvcyA9IHg7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgR3Jhdml0eS5SSUdIVDoKKyAgICAgICAgICAgICAgICAgICAgeHBvcyA9IG1lbnVMZWZ0IC0gbmF2V2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQgeXBvcyA9IDA7CisgICAgICAgICAgICBzd2l0Y2ggKGdyYXZpdHkgJiBHcmF2aXR5LlZFUlRJQ0FMX0dSQVZJVFlfTUFTSykgeworICAgICAgICAgICAgICAgIGNhc2UgR3Jhdml0eS5DRU5URVJfVkVSVElDQUw6CisgICAgICAgICAgICAgICAgICAgIHlwb3MgPSAoKG1Cb3R0b20gLSBtVG9wKSAtIG1DdXN0b21OYXZWaWV3LmdldE1lYXN1cmVkSGVpZ2h0KCkpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBHcmF2aXR5LlRPUDoKKyAgICAgICAgICAgICAgICAgICAgeXBvcyA9IGdldFBhZGRpbmdUb3AoKSArIHRvcE1hcmdpbjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBHcmF2aXR5LkJPVFRPTToKKyAgICAgICAgICAgICAgICAgICAgeXBvcyA9IGdldEhlaWdodCgpIC0gZ2V0UGFkZGluZ0JvdHRvbSgpIC0gbUN1c3RvbU5hdlZpZXcuZ2V0TWVhc3VyZWRIZWlnaHQoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gYm90dG9tTWFyZ2luOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHggKz0gcG9zaXRpb25DaGlsZChtQ3VzdG9tTmF2VmlldywgeHBvcywgeXBvcywgY29udGVudEhlaWdodCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGludCBwb3NpdGlvbkNoaWxkKFZpZXcgY2hpbGQsIGludCB4LCBpbnQgeSwgaW50IGNvbnRlbnRIZWlnaHQpIHsKKyAgICAgICAgaW50IGNoaWxkV2lkdGggPSBjaGlsZC5nZXRNZWFzdXJlZFdpZHRoKCk7CisgICAgICAgIGludCBjaGlsZEhlaWdodCA9IGNoaWxkLmdldE1lYXN1cmVkSGVpZ2h0KCk7CisgICAgICAgIGludCBjaGlsZFRvcCA9IHkgKyAoY29udGVudEhlaWdodCAtIGNoaWxkSGVpZ2h0KSAvIDI7CisKKyAgICAgICAgY2hpbGQubGF5b3V0KHgsIGNoaWxkVG9wLCB4ICsgY2hpbGRXaWR0aCwgY2hpbGRUb3AgKyBjaGlsZEhlaWdodCk7CisKKyAgICAgICAgcmV0dXJuIGNoaWxkV2lkdGg7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgaW50IHBvc2l0aW9uQ2hpbGRJbnZlcnNlKFZpZXcgY2hpbGQsIGludCB4LCBpbnQgeSwgaW50IGNvbnRlbnRIZWlnaHQpIHsKKyAgICAgICAgaW50IGNoaWxkV2lkdGggPSBjaGlsZC5nZXRNZWFzdXJlZFdpZHRoKCk7CisgICAgICAgIGludCBjaGlsZEhlaWdodCA9IGNoaWxkLmdldE1lYXN1cmVkSGVpZ2h0KCk7CisgICAgICAgIGludCBjaGlsZFRvcCA9IHkgKyAoY29udGVudEhlaWdodCAtIGNoaWxkSGVpZ2h0KSAvIDI7CisKKyAgICAgICAgY2hpbGQubGF5b3V0KHggLSBjaGlsZFdpZHRoLCBjaGlsZFRvcCwgeCwgY2hpbGRUb3AgKyBjaGlsZEhlaWdodCk7CisKKyAgICAgICAgcmV0dXJuIGNoaWxkV2lkdGg7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgVGFiVmlldyBleHRlbmRzIExpbmVhckxheW91dCB7CisgICAgICAgIHByaXZhdGUgQWN0aW9uQmFyLlRhYiBtVGFiOworCisgICAgICAgIHB1YmxpYyBUYWJWaWV3KENvbnRleHQgY29udGV4dCwgQWN0aW9uQmFyLlRhYiB0YWIpIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIG51bGwsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYXR0ci5hY3Rpb25CYXJUYWJTdHlsZSk7CisgICAgICAgICAgICBtVGFiID0gdGFiOworCisgICAgICAgICAgICBmaW5hbCBWaWV3IGN1c3RvbSA9IHRhYi5nZXRDdXN0b21WaWV3KCk7CisgICAgICAgICAgICBpZiAoY3VzdG9tICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBhZGRWaWV3KGN1c3RvbSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIFRPRE8gU3R5bGUgdGFicyBiYXNlZCBvbiB0aGUgdGhlbWUKKworICAgICAgICAgICAgICAgIGZpbmFsIERyYXdhYmxlIGljb24gPSB0YWIuZ2V0SWNvbigpOworICAgICAgICAgICAgICAgIGZpbmFsIENoYXJTZXF1ZW5jZSB0ZXh0ID0gdGFiLmdldFRleHQoKTsKKworICAgICAgICAgICAgICAgIGlmIChpY29uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgSW1hZ2VWaWV3IGljb25WaWV3ID0gbmV3IEltYWdlVmlldyhjb250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgaWNvblZpZXcuc2V0SW1hZ2VEcmF3YWJsZShpY29uKTsKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0UGFyYW1zIGxwID0gbmV3IExheW91dFBhcmFtcyhMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpOworICAgICAgICAgICAgICAgICAgICBscC5ncmF2aXR5ID0gR3Jhdml0eS5DRU5URVJfVkVSVElDQUw7CisgICAgICAgICAgICAgICAgICAgIGljb25WaWV3LnNldExheW91dFBhcmFtcyhscCk7CisgICAgICAgICAgICAgICAgICAgIGFkZFZpZXcoaWNvblZpZXcpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICh0ZXh0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgVGV4dFZpZXcgdGV4dFZpZXcgPSBuZXcgVGV4dFZpZXcoY29udGV4dCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmF0dHIuYWN0aW9uQmFyVGFiVGV4dFN0eWxlKTsKKyAgICAgICAgICAgICAgICAgICAgdGV4dFZpZXcuc2V0VGV4dCh0ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgdGV4dFZpZXcuc2V0U2luZ2xlTGluZSgpOworICAgICAgICAgICAgICAgICAgICB0ZXh0Vmlldy5zZXRFbGxpcHNpemUoVHJ1bmNhdGVBdC5FTkQpOworICAgICAgICAgICAgICAgICAgICBMYXlvdXRQYXJhbXMgbHAgPSBuZXcgTGF5b3V0UGFyYW1zKExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCk7CisgICAgICAgICAgICAgICAgICAgIGxwLmdyYXZpdHkgPSBHcmF2aXR5LkNFTlRFUl9WRVJUSUNBTDsKKyAgICAgICAgICAgICAgICAgICAgdGV4dFZpZXcuc2V0TGF5b3V0UGFyYW1zKGxwKTsKKyAgICAgICAgICAgICAgICAgICAgYWRkVmlldyh0ZXh0Vmlldyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzZXRMYXlvdXRQYXJhbXMobmV3IExheW91dFBhcmFtcyhMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5ULAorICAgICAgICAgICAgICAgICAgICBMYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5ULCAxKSk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQWN0aW9uQmFyLlRhYiBnZXRUYWIoKSB7CisgICAgICAgICAgICByZXR1cm4gbVRhYjsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgVGFiQ2xpY2tMaXN0ZW5lciBpbXBsZW1lbnRzIE9uQ2xpY2tMaXN0ZW5lciB7CisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2aWV3KSB7CisgICAgICAgICAgICBUYWJWaWV3IHRhYlZpZXcgPSAoVGFiVmlldykgdmlldzsKKyAgICAgICAgICAgIHRhYlZpZXcuZ2V0VGFiKCkuc2VsZWN0KCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgdGFiQ291bnQgPSBtVGFiTGF5b3V0LmdldENoaWxkQ291bnQoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgdGFiQ291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIGZpbmFsIFZpZXcgY2hpbGQgPSBtVGFiTGF5b3V0LmdldENoaWxkQXQoaSk7CisgICAgICAgICAgICAgICAgY2hpbGQuc2V0U2VsZWN0ZWQoY2hpbGQgPT0gdmlldyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB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UVVFUlk6IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vU2V0IHRoZSBwaG90bwotICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwIHBob3RvQml0bWFwID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCAmJiBjdXJzb3IubW92ZVRvRmlyc3QoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yLmlzTnVsbChQaG90b1F1ZXJ5LlBIT1RPKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVbXSBwaG90b0RhdGEgPSBjdXJzb3IuZ2V0QmxvYihQaG90b1F1ZXJ5LlBIT1RPKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG90b0JpdG1hcCA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlQnl0ZUFycmF5KHBob3RvRGF0YSwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob3RvRGF0YS5sZW5ndGgsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocGhvdG9CaXRtYXAgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob3RvQml0bWFwID0gbG9hZFBsYWNlaG9sZGVyUGhvdG8obnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUGhvdG9WaWV3LnNldEltYWdlQml0bWFwKHBob3RvQml0bWFwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb29raWUgIT0gbnVsbCAmJiBjb29raWUgaW5zdGFuY2VvZiBVcmkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGhvdG9WaWV3LmFzc2lnbkNvbnRhY3RVcmkoKFVyaSkgY29va2llKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgVE9LRU5fQ09OVEFDVF9JTkZPOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwgJiYgY3Vyc29yLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaW5kQ29udGFjdEluZm8oY3Vyc29yKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBVcmkgbG9va3VwVXJpID0gQ29udGFjdHMuZ2V0TG9va3VwVXJpKGN1cnNvci5nZXRMb25nKENvbnRhY3RRdWVyeS5fSUQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yLmdldFN0cmluZyhDb250YWN0UXVlcnkuTE9PS1VQX0tFWSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgbG9uZyBwaG90b0lkID0gY3Vyc29yLmdldExvbmcoQ29udGFjdFF1ZXJ5LlBIT1RPX0lEKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwaG90b0lkID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBob3RvVmlldy5zZXRJbWFnZUJpdG1hcChsb2FkUGxhY2Vob2xkZXJQaG90byhudWxsKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb29raWUgIT0gbnVsbCAmJiBjb29raWUgaW5zdGFuY2VvZiBVcmkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QaG90b1ZpZXcuYXNzaWduQ29udGFjdFVyaSgoVXJpKSBjb29raWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydFBob3RvUXVlcnkocGhvdG9JZCwgbG9va3VwVXJpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlIC8qIGRvbid0IHJlc2V0IHF1ZXJ5IGhhbmRsZXIgKi8pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2hvdWxkbid0IHJlYWxseSBoYXBwZW4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXREaXNwbGF5TmFtZShudWxsLCBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTb2NpYWxTbmlwcGV0KG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBob3RvKGxvYWRQbGFjZWhvbGRlclBob3RvKG51bGwpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgVE9LRU5fUEhPTkVfTE9PS1VQOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwgJiYgY3Vyc29yLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nIGNvbnRhY3RJZCA9IGN1cnNvci5nZXRMb25nKFBIT05FX0xPT0tVUF9DT05UQUNUX0lEX0NPTFVNTl9JTkRFWCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGxvb2t1cEtleSA9IGN1cnNvci5nZXRTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQSE9ORV9MT09LVVBfQ09OVEFDVF9MT09LVVBfS0VZX0NPTFVNTl9JTkRFWCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmluZEZyb21Db250YWN0VXJpSW50ZXJuYWwoQ29udGFjdHMuZ2V0TG9va3VwVXJpKGNvbnRhY3RJZCwgbG9va3VwS2V5KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlIC8qIGRvbid0IHJlc2V0IHF1ZXJ5IGhhbmRsZXIgKi8pOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcGhvbmVOdW1iZXIgPSAoU3RyaW5nKSBjb29raWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGlzcGxheU5hbWUocGhvbmVOdW1iZXIsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFNvY2lhbFNuaXBwZXQobnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGhvdG8obG9hZFBsYWNlaG9sZGVyUGhvdG8obnVsbCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QaG90b1ZpZXcuYXNzaWduQ29udGFjdEZyb21QaG9uZShwaG9uZU51bWJlciwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBjYXNlIFRPS0VOX0VNQUlMX0xPT0tVUDogewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsICYmIGN1cnNvci5tb3ZlVG9GaXJzdCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyBjb250YWN0SWQgPSBjdXJzb3IuZ2V0TG9uZyhFTUFJTF9MT09LVVBfQ09OVEFDVF9JRF9DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBsb29rdXBLZXkgPSBjdXJzb3IuZ2V0U3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU1BSUxfTE9PS1VQX0NPTlRBQ1RfTE9PS1VQX0tFWV9DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpbmRGcm9tQ29udGFjdFVyaUludGVybmFsKENvbnRhY3RzLmdldExvb2t1cFVyaShjb250YWN0SWQsIGxvb2t1cEtleSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSAvKiBkb24ndCByZXNldCBxdWVyeSBoYW5kbGVyICovKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGVtYWlsQWRkcmVzcyA9IChTdHJpbmcpIGNvb2tpZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXREaXNwbGF5TmFtZShlbWFpbEFkZHJlc3MsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFNvY2lhbFNuaXBwZXQobnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGhvdG8obG9hZFBsYWNlaG9sZGVyUGhvdG8obnVsbCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QaG90b1ZpZXcuYXNzaWduQ29udGFjdEZyb21FbWFpbChlbWFpbEFkZHJlc3MsIHRydWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCkgewotICAg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cHVibGljIHZvaWQgc2V0U3RhcmVkKGJvb2xlYW4gc3RhcnJlZCkgewotICAgICAgICBtU3RhcnJlZFZpZXcuc2V0Q2hlY2tlZChzdGFycmVkKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBNYW51YWxseSBzZXQgdGhlIHByZXNlbmNlLgotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldFByZXNlbmNlKGludCBwcmVzZW5jZSkgewotICAgICAgICBtUHJlc2VuY2VWaWV3LnNldEltYWdlUmVzb3VyY2UoU3RhdHVzVXBkYXRlcy5nZXRQcmVzZW5jZUljb25SZXNvdXJjZUlkKHByZXNlbmNlKSk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogTWFudWFsbHkgc2V0IHRoZSBjb250YWN0IHVyaQotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldENvbnRhY3RVcmkoVXJpIHVyaSkgewotICAgICAgICBzZXRDb250YWN0VXJpKHVyaSwgdHJ1ZSk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogTWFudWFsbHkgc2V0IHRoZSBjb250YWN0IHVyaQotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldENvbnRhY3RVcmkoVXJpIHVyaSwgYm9vbGVhbiBzZW5kVG9GYXN0cmFjaykgewotICAgICAgICBtQ29udGFjdFVyaSA9IHVyaTsKLSAgICAgICAgaWYgKHNlbmRUb0Zhc3RyYWNrKSB7Ci0gICAgICAgICAgICBtUGhvdG9WaWV3LmFzc2lnbkNvbnRhY3RVcmkodXJpKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIE1hbnVhbGx5IHNldCB0aGUgcGhvdG8gdG8gZGlzcGxheSBpbiB0aGUgaGVhZGVyLiBUaGlzIGRvZXNuJ3QgY2hhbmdlIHRoZQotICAgICAqIHVuZGVybHlpbmcge0BsaW5rIENvbnRhY3RzfSwgb25seSB0aGUgVUkgc3RhdGUuCi0gICAgICovCi0gICAgcHVibGlj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HMuaXNFbXB0eShyZXNQYWNrYWdlKSkgewotICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMgPSBnZXRSZXNvdXJjZXMoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBQYWNrYWdlTWFuYWdlciBwbSA9IGdldENvbnRleHQoKS5nZXRQYWNrYWdlTWFuYWdlcigpOwotICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzID0gcG0uZ2V0UmVzb3VyY2VzRm9yQXBwbGljYXRpb24ocmVzUGFja2FnZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE5hbWVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJDb250YWN0IHN0YXR1cyB1cGRhdGUgcmVzb3VyY2UgcGFja2FnZSBub3QgZm91bmQ6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyByZXNQYWNrYWdlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlcyA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzb3VyY2VzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gcmVzb3VyY2VzLmdldFN0cmluZyhsYWJlbFJlc291cmNlKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTm90Rm91bmRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ29udGFjdCBzdGF0dXMgdXBkYXRlIHJlc291cmNlIG5vdCBmb3VuZDogIiArIHJlc1BhY2thZ2UgKyAiQCIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBsYWJlbFJlc291cmNlKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQ2hhclNlcXVlbmNlIGF0dHJpYnV0aW9uOwotICAgICAgICAgICAgaWYgKHRpbWVzdGFtcCAhPSBudWxsICYmIGxhYmVsICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBhdHRyaWJ1dGlvbiA9IGdldENvbnRleHQoKS5nZXRTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICBSLnN0cmluZy5jb250YWN0X3N0YXR1c191cGRhdGVfYXR0cmlidXRpb25fd2l0aF9kYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wLCBsYWJlbCk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHRpbWVzdGFtcCA9PSBudWxsICYmIGxhYmVsICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBhdHRyaWJ1dGlvbiA9IGdldENvbnRleHQoKS5nZXRTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICBSLnN0cmluZy5jb250YWN0X3N0YXR1c191cGRhdGVfYXR0cmlidXRpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbCk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHRpbWVzdGFtcCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgYXR0cmlidXRpb24gPSB0aW1lc3RhbXA7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGF0dHJpYnV0aW9uID0gbnVsbDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChhdHRyaWJ1dGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbVN0YXR1c0F0dHJpYnV0aW9uVmlldy5zZXRUZXh0KGF0dHJpYnV0aW9uKTsKLSAgICAgICAgICAgICAgICBtU3RhdHVzQXR0cmlidXRpb25WaWV3LnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbVN0YXR1c0F0dHJpYnV0aW9uVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtU3RhdHVzVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7Ci0gICAgICAgICAgICBtU3RhdHVzQXR0cmlidXRpb25WaWV3LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2aWV3KSB7Ci0gICAgICAgIHN3aXRjaCAodmlldy5nZXRJZCgpKSB7Ci0gICAgICAgICAgICBjYXNlIFIuaWQuc3RhcjogewotICAgICAgICAgICAgICAgIC8vIFRvZ2dsZSAic3RhcnJlZCIgc3RhdGUKLSAgICAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdGhlcmUgaXMgYSBjb250YWN0Ci0gICAgICAgICAgICAgICAgaWYgKG1Db250YWN0VXJpICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgQ29udGVudFZhbHVlcyB2YWx1ZXMgPSBuZXcgQ29udGVudFZhbHVlcygxKTsKLSAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChDb250YWN0cy5TVEFSUkVELCBtU3RhcnJlZFZpZXcuaXNDaGVja2VkKCkpOwotICAgICAgICAgICAgICAgICAgICBtQ29udGVudFJlc29sdmVyLnVwZGF0ZShtQ29udGFjdFVyaSwgdmFsdWVzLCBudWxsLCBudWxsKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFIuaWQucGhvdG86IHsKLSAgICAgICAgICAgICAgICBwZXJmb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oKTsKKyAgICAgICAgZm9yIChPYmplY3RBbmltYXRvciBjdXJyZW50QW5pbSA6IG1BbmltYXRvcnMpIHsKKyAgICAgICAgICAgIGlmIChwcm9wZXJ0eS5lcXVhbHMoY3VycmVudEFuaW0uZ2V0UHJvcGVydHlOYW1lKCkpKSB7CisgICAgICAgICAgICAgICAgY3VycmVudEFuaW0uY2FuY2VsKCk7CisgICAgICAgICAgICAgICAgcmVtb3ZhbExpc3QuYWRkKGN1cnJlbnRBbmltKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoREJHKSBMb2cudihUQUcsICJSZW1vdmUgbGlzdCBzaXplOiAiICsgcmVtb3ZhbExpc3Quc2l6ZSgpKTsKKyAgICAgICAgbUFuaW1hdG9ycy5yZW1vdmVBbGwocmVtb3ZhbExpc3QpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFN0b3BzIGFsbCBhbmltYXRpb25zIGFuZCByZW1vdmVzIHRoZW0gZnJvbSB0aGUgbGlzdC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBjbGVhckFuaW1hdGlvbnMoKSB7CisgICAgICAgIGZvciAoT2JqZWN0QW5pbWF0b3IgY3VycmVudEFuaW0gOiBtQW5pbWF0b3JzKSB7CisgICAgICAgICAgICBjdXJyZW50QW5pbS5jYW5jZWwoKTsKKyAgICAgICAgfQorICAgICAgICBtQW5pbWF0b3JzLmNsZWFyKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQWRkcyB0aGUgZ2l2ZW4gYW5pbWF0aW9uIHRvIHRoZSBsaXN0IG9mIGFuaW1hdGlvbnMgZm9yIHRoaXMgb2JqZWN0LgorICAgICAqCisgICAgICogQHBhcmFtIGFuaW0KKyAgICAgKiBAcGFyYW0gb3ZlcndyaXRlCisgICAgICogQHJldHVybgorICAgICAqLworICAgIHByaXZhdGUgRHJhd2FibGVIb2xkZXIgYWRkQW5pbWF0aW9uKE9iamVjdEFuaW1hdG9yIGFuaW0sIGJvb2xlYW4gb3ZlcndyaXRlKSB7CisgICAgICAgIGlmIChhbmltICE9IG51bGwpCisgICAgICAgICAgICBtQW5pbWF0b3JzLmFkZChhbmltKTsKKyAgICAgICAgbU5lZWRUb1N0YXJ0LmFkZChhbmltKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgLyoqCisgICAgICogRHJhdyB0aGlzIG9iamVjdCB0byB0aGUgY2FudmFzIHVzaW5nIHRoZSBwcm9wZXJ0aWVzIGRlZmluZWQgaW4gdGhpcyBjbGFzcy4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjYW52YXMgY2FudmFzIHRvIGRyYXcgaW50bworICAgICAqLworICAgIHB1YmxpYyB2b2lkIGRyYXcoQ2FudmFzIGNhbnZhcykgeworICAgICAgICBmaW5hbCBmbG9hdCB0aHJlc2hvbGQgPSAxLjBmIC8gMjU2LjBmOyAvLyBjb250cmlidXRpb24gbGVzcyB0aGFuIDEgTFNCIG9mIFJHQiBieXRlCisgICAgICAgIGlmIChtQWxwaGEgPD0gdGhyZXNob2xkKSAvLyBkb24ndCBib3RoZXIgaWYgaXQgd29uJ3Qgc2hvdyB1cAorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICBjYW52YXMuc2F2ZShDYW52YXMuTUFUUklYX1NBVkVfRkxBRyk7CisgICAgICAgIGNhbnZhcy50cmFuc2xhdGUobVgsIG1ZKTsKKyAgICAgICAgY2FudmFzLnNjYWxlKG1TY2FsZVgsIG1TY2FsZVkpOworICAgICAgICBjYW52YXMudHJhbnNsYXRlKC0wLjVmKmdldFdpZHRoKCksIC0wLjVmKmdldEhlaWdodCgpKTsKKyAgICAgICAgbURyYXdhYmxlLnNldEFscGhhKChpbnQpIE1hdGgucm91bmQobUFscGhhICogMjU1ZikpOworICAgICAgICBtRHJhd2FibGUuZHJhdyhjYW52YXMpOworICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFN0YXJ0cyBhbG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GljIERyYXdhYmxlSG9sZGVyIHNldFNjYWxlWChmbG9hdCB2YWx1ZSkgeworICAgICAgICBtU2NhbGVYID0gdmFsdWU7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBEcmF3YWJsZUhvbGRlciBzZXRTY2FsZVkoZmxvYXQgdmFsdWUpIHsKKyAgICAgICAgbVNjYWxlWSA9IHZhbHVlOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgRHJhd2FibGVIb2xkZXIgc2V0QWxwaGEoZmxvYXQgYWxwaGEpIHsKKyAgICAgICAgbUFscGhhID0gYWxwaGE7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBmbG9hdCBnZXRYKCkgeworICAgICAgICByZXR1cm4gbVg7CisgICAgfQorCisgICAgcHVibGljIGZsb2F0IGdldFkoKSB7CisgICAgICAgIHJldHVybiBtWTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmxvYXQgZ2V0U2NhbGVYKCkgeworICAgICAgICByZXR1cm4gbVNjYWxlWDsKKyAgICB9CisKKyAgICBwdWJsaWMgZmxvYXQgZ2V0U2NhbGVZKCkgeworICAgICAgICByZXR1cm4gbVNjYWxlWTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmxvYXQgZ2V0QWxwaGEoKSB7CisgICAgICAgIHJldHVybiBtQWxwaGE7CisgICAgfQorCisgICAgcHVibGljIEJpdG1hcERyYXdhYmxlIGdldERyYXdhYmxlKCkgeworICAgICAgICByZXR1cm4gbURyYXdhYmxlOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0V2lkdGgoKSB7CisgICAgICAgIHJldHVybiBtRHJhd2FibGUuZ2V0SW50cmluc2ljV2lkdGgoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldEhlaWdodCgpIHsKKyAgICAgICAgcmV0dXJuIG1EcmF3YWJsZS5nZXRJbnRyaW5zaWNIZWlnaHQoK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zKSB7Ci0gICAgICAgIG1EaWFsb2cuc2V0Q29sb3JBbGVydFBhcmFtcyhjb2xvcnRpdGxlLCBjb2xvcm5hbWVzLCBjb2xvcmludHMpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFNldCBQYXJhbWV0ZXJzIGZvciBTaXplQWxlcnREaWFsb2cuCi0gICAgICogCi0gICAgICogQHBhcmFtIHNpemV0aXRsZQotICAgICAqICAgICAgICAgICAgVGl0bGUgZm9yIEFsZXJ0IERpYWxvZy4KLSAgICAgKiBAcGFyYW0gc2l6ZW5hbWVzCi0gICAgICogICAgICAgICAgICBMaXN0IG9mIG5hbWUgb2Ygc2VsZWN0aW5nIHNpemUuCi0gICAgICogQHBhcmFtIHNpemVkaXNwbGF5aW50cwotICAgICAqICAgICAgICAgICAgTGlzdCBvZiBpbnQgb2Ygc2l6ZSBkaXNwbGF5ZWQgaW4gVGV4dFZpZXcuCi0gICAgICogQHBhcmFtIHNpemVzZW5kaW50cwotICAgICAqICAgICAgICAgICAgTGlzdCBvZiBpbnQgb2Ygc2l6ZSBleHBvcnRlZCB0byBIVE1MLgotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldFNpemVBbGVydFBhcmFtcyhDaGFyU2VxdWVuY2Ugc2l6ZXRpdGxlLAotICAgICAgICAgICAgQ2hhclNlcXVlbmNlW10gc2l6ZW5hbWVzLCBDaGFyU2VxdWVuY2VbXSBzaXplZGlzcGxheWludHMsCi0gICAgICAgICAgICBDaGFyU2VxdWVuY2VbXSBzaXplc2VuZGludHMpIHsKLSAgICAgICAgbURpYWxvZy5zZXRTaXplQWxlcnRQYXJhbXMoc2l6ZXRpdGxlLCBzaXplbmFtZXMsIHNpemVkaXNwbGF5aW50cywKLSAgICAgICAgICAgICAgICBzaXplc2VuZGludHMpOwotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIHNldEFsaWduQWxlcnRQYXJhbXMoQ2hhclNlcXVlbmNlIGFsaWdudGl0bGUsCi0gICAgICAgICAgICB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gICogSW5zZXJ0SW1hZ2UgdG8gVGV4dFZpZXcgYnkgdXNpbmcgcmVzb3VyY2UgSUQKLSAgICAgKiAKLSAgICAgKiBAcGFyYW0gcmVzSWQKLSAgICAgKiAgICAgICAgICAgIFJlc291cmNlIElEIG9mIHRoZSBpYW1nZSBpbnNlcnRlZCB0byBUZXh0Vmlldy4KLSAgICAgKi8KLSAgICBwdWJsaWMgdm9pZCBvbkluc2VydEltYWdlKGludCByZXNJZCkgewotICAgICAgICBtTWFuYWdlci5vbkluc2VydEltYWdlKHJlc0lkKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCBvbkluc2VydEhvcml6b250YWxMaW5lKCkgewotICAgICAgICBtTWFuYWdlci5vbkluc2VydEhvcml6b250YWxMaW5lKCk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgb25DbGVhclN0eWxlcygpIHsKLSAgICAgICAgbU1hbmFnZXIub25DbGVhclN0eWxlcygpOwotICAgIH0KLSAgICAvKioKLSAgICAgKiBTZXQgU2l6ZSBvZiB0aGUgSXRlbS4KLSAgICAgKiAKLSAgICAgKiBAcGFyYW0gc2l6ZQotICAgICAqICAgICAgICAgICAgVGhlIHNpemUgb2YgdGhlIEl0ZW0uCi0gICAgICovCi0gICAgcHVibGljIHZvaWQgc2V0SXRlbVNpemUoaW50IHNpemUpIHsKLSAgICAgICAgbU1hbmFnZXIuc2V0SXRlbVNpemUoc2l6ZSk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogU2V0IENvbG9yIG9mIHRoZSBJdGVtLgotICAgICAqIAotICAgICAqIEBwYXJhbSBjb2xvcgotICAgICAqICAgICAgICAgICAgVGhlIGNvbG9yIG9mIHRoZSBJdGVtLgotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldEl0ZW1Db2xvcihpbnQgY29sb3IpIHsKLSAgICAgICAgbU1hbmFnZXIuc2V0SXRlbUNvbG9yKGNvbG9yKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBTZXQgQWxpZ25tZW50IG9mIHRoZSBJdGVtLgotICAgICAqIAotICAgICAqIEBwYXJhbSBjb2xvcgotICAgICAqICAgICAgICAgICAgVGhlIGNvbG9yIG9mIHRoZSBJdGVtLgotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldEFsaWdubWVudChMYXlvdXQuQWxpZ25tZW50IGFsaWduKSB7Ci0gICAgICAgIG1NYW5hZ2VyLnNldEFsaWdubWVudChhbGlnbik7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogU2V0IEJhY2tncm91bmQgY29sb3Igb2YgVmlldy4KLSAgICAgKiAKLSAgICAgKiBAcGFyYW0gY29sb3IKLSAgICAgKiAgICAgICAgICAgIFRoZSBiYWNrZ3JvdW5kIGNvbG9yIG9mIHZpZXcuCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIHZvaWQgc2V0QmFja2dyb3VuZENvbG9yKGludCBjb2xvcikgewotICAgICAgICBzdXBlci5zZXRCYWNrZ3JvdW5kQ29sb3IoY29sb3IpOwotICAgICAgICBtQmFja2dyb3VuZENvbG9yID0gY29sb3I7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogU2V0IGh0bWwgdG8gRWRpdFN0eWxlZFRleHQuCi0gICAgICogCi0gICAgICogQHBhcmFtIGh0bWwKLSAgICAgKiAgICAgICAgICAgIFRoZSBodG1sIHRvIGJlIHNldC4KLSAgICAgKi8KLSAgICBwdWJsaWMgdm9pZCBzZXRIdG1sKFN0cmluZyBodG1sKSB7Ci0gICAgICAgIG1Db252ZXJ0ZXIuU2V0SHRtbChodG1sKTsKLSAgICB9Ci0gICAgLyoqCi0gICAgICogQ2hlY2sgd2hldGhlciBlZGl0aW5nIGlzIHN0YXJ0ZWQgb3Igbm90LgotICAgICAqIAotICAgICAqIEByZXR1cm4gV2hldGhlciBlZGl0aW5nIGlzIHN0YXJ0ZWQgb3Igbm90LgotICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGlz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7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHNwYW5zWzBdLmdldEZvcmVncm91bmRDb2xvcigpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gREVGQVVMVF9CQUNLR1JPVU5EX0NPTE9SOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogSW5pdGlhbGl6ZSBtZW1iZXJzLgotICAgICAqLwotICAgIHByaXZhdGUgdm9pZCBpbml0KCkgewotICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGluaXQiKTsKLSAgICAgICAgfQotICAgICAgICByZXF1ZXN0Rm9jdXMoKTsKLSAgICAgICAgbURlZmF1bHRCYWNrZ3JvdW5kID0gZ2V0QmFja2dyb3VuZCgpOwotICAgICAgICBtQmFja2dyb3VuZENvbG9yID0gREVGQVVMVF9CQUNLR1JPVU5EX0NPTE9SOwotICAgICAgICBtTWFuYWdlciA9IG5ldyBFZGl0b3JNYW5hZ2VyKHRoaXMpOwotICAgICAgICBtQ29udmVydGVyID0gbmV3IFN0eWxlZFRleHRDb252ZXJ0ZXIodGhpcyk7Ci0gICAgICAgIG1EaWFsb2cgPSBuZXcgU3R5bGVkVGV4dERpYWxvZyh0aGlzKTsKLSAgICAgICAgc2V0TW92ZW1lbnRNZXRob2QobmV3IFN0eWxlZFRleHRBcnJvd0tleU1ldGhvZChtTWFuYWdlcikpOwotICAgICAgICBtTWFuYWdlci5ibG9ja1NvZnRLZXkoKTsKLSAgICAgICAgbU1hbmFnZXIudW5ibG9ja1NvZnRLZXkoKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBTaG93IEZvcmVncm91bmQgQ29sb3IgU2VsZWN0aW5nIERpYWxvZy4KLSAgICAgKi8KLSAgICBwcml2YXRlIHZvaWQgb25TaG93Rm9yZWdyb3VuZENvbG9yQWxlcnQoKSB7Ci0gICAgICAgIG1EaWFsb2cub25TaG93Rm9yZWdyb3VuZENvbG9yQWxlcnREaWFsb2coKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBTaG93IEJhY2tncm91bmQgQ29sb3IgU2VsZWN0aW5nIERpYWxvZy4KLSAgICAgKi8KLSAgICBwcml2YXRlIHZvaWQgb25TaG93QmFja2dyb3VuZENvbG9yQWxlcnQoKSB7Ci0gICAgICAgIG1EaWFsb2cub25TaG93QmFja2dyb3VuZENvbG9yQWxlcnREaWFsb2coKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBTaG93IFNpemUgU2VsZWN0aW5nIERpYWxvZy4KLSAgICAgKi8KLSAgICBwcml2YXRlIHZvaWQgb25TaG93U2l6ZUFsZXJ0KCkgewotICAgICAgICBtRGlhbG9nLm9uU2hvd1NpemVBbGVydERpYWxvZygpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFNob3cgQWxpZ25tZW50IFNlbGVjdGluZyBEaWFsb2cuCi0gICAgICovCi0gICAgcHJpdmF0ZSB2b2lkIG9uU2hvd0FsaWduQWxlcnQoKSB7Ci0gICAgICAgIG1EaWFsb2cub25TaG93QWxpZ25BbGVydERpYWxvZygpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIE5vdGlmeSBoaW50IG1lc3NhZ2VzIHdoYXQgYWN0aW9uIGlzIGV4cGVjdGVkIHRvIGNhbGxpbmcgY2xhc3MuCi0gICAgICogCi0gICAgICogQHBhcmFtIG1zZ0lkCi0gICAgICogICAgICAgICAgICBJZCBvZiB0aGUgaGludCBtZXNzYWdlLgotICAgICAqLwotICAgIHByaXZhdGUgdm9pZCBzZXRIaW50TWVzc2FnZShpbnQgbXNnSWQpIHsKLSAgICAgICAgaWYgKG1FU1RJbnRlcmZhY2UgIT0gbnVsbCkgewotICAgICAgICAgICAgbUVTVEludGVyZmFjZS5ub3RpZnlIaW50TXNnKG1zZ0lkKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICA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ywgIi0tLSBvblN0YXJ0Q3V0Iik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBoYW5kbGVDdXQoKTsKLSAgICAgICAgICAgIG1FU1Qubm90aWZ5U3RhdGVDaGFuZ2VkKG1Nb2RlLCBtU3RhdGUpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgb25TdGFydFBhc3RlKCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gb25TdGFydFBhc3RlIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBoYW5kbGVQYXN0ZSgpOwotICAgICAgICAgICAgbUVTVC5ub3RpZnlTdGF0ZUNoYW5nZWQobU1vZGUsIG1TdGF0ZSk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBvblN0YXJ0U2l6ZSgpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIG9uU3RhcnRTaXplIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBoYW5kbGVTaXplKCk7Ci0gICAgICAgICAgICBtRVNULm5vdGlmeVN0YXRlQ2hhbmdlZChtTW9kZSwgbVN0YXRlKTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uU3RhcnRBbGlnbigpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIG9uU3RhcnRBbGlnblJpZ2h0Iik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBoYW5kbGVBbGlnbigpOwotICAgICAgICAgICAgbUVTVC5ub3RpZnlTdGF0ZUNoYW5nZWQobU1vZGUsIG1TdGF0ZSk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBvblN0YXJ0Q29sb3IoKSB7Ci0gICAgICAgIC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VXJpIHVyaSkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gb25JbnNlcnRJbWFnZSBieSBVUkk6ICIgKyB1cmkuZ2V0UGF0aCgpCi0gICAgICAgICAgICAgICAgICAgICAgICArICIsIiArIHVyaS50b1N0cmluZygpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGluc2VydEltYWdlU3BhbihuZXcgSW1hZ2VTcGFuKG1FU1QuZ2V0Q29udGV4dCgpLCB1cmkpKTsKLSAgICAgICAgICAgIG1FU1Qubm90aWZ5U3RhdGVDaGFuZ2VkKG1Nb2RlLCBtU3RhdGUpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgb25JbnNlcnRJbWFnZShpbnQgcmVzSUQpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIG9uSW5zZXJ0SW1hZ2UgYnkgcmVzSUQiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGluc2VydEltYWdlU3BhbihuZXcgSW1hZ2VTcGFuKG1FU1QuZ2V0Q29udGV4dCgpLCByZXNJRCkpOwotICAgICAgICAgICAgbUVTVC5ub3RpZnlTdGF0ZUNoYW5nZWQobU1vZGUsIG1TdGF0ZSk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBvbkluc2VydEhvcml6b250YWxMaW5lKCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gb25JbnNlcnRIb3Jpem9udGFsTGluZToiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGluc2VydEltYWdlU3BhbihuZXcgSG9yaXpvbnRhbExpbmVTcGFuKDB4RkYwMDAwMDAsIG1FU1QpKTsKLSAgICAgICAgICAgIG1FU1Qubm90aWZ5U3RhdGVDaGFuZ2VkKG1Nb2RlLCBtU3RhdGUpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgb25DbGVhclN0eWxlcygpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIG9uQ2xlYXJTdHlsZXMiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIEVkaXRhYmxlIHR4dCA9IG1FU1QuZ2V0VGV4dCgpOwotICAgICAgICAgICAgaW50IGxlbiA9IHR4dC5sZW5ndGgoKTsKLSAgICAgICAgICAgIE9iamVjdFtdIHN0eWxlcyA9IHR4dC5nZXRTcGFucygwLCBsZW4sIE9iamVjdC5jbGFzcyk7Ci0gICAgICAgICAgICBmb3IgKE9iamVjdCBzdHlsZSA6IHN0eWxlcykgewotICAgICAgICAgICAgICAgIGlmIChzdHlsZSBpbnN0YW5jZW9mIFBhcmFncmFwaFN0eWxlIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZSBpbnN0YW5jZW9mIFF1b3RlU3BhbiB8fAotICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUgaW5zdGFuY2VvZiBDaGFyYWN0ZXJTdHlsZSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGUgaW5zdGFuY2VvZiBJbWFnZVNwYW4pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCA9IHR4dC5nZXRTcGFuU3RhcnQoc3R5bGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGVuZCA9IHR4dC5nZXRTcGFuRW5kKHN0eWxlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR4dC5yZXBsYWNlKHN0YXJ0LCBlbmQsICIiKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB0eHQucmVtb3ZlU3BhbihzdHlsZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUVTVC5zZXRCYWNrZ3JvdW5kRHJhd2FibGUobUVTVC5tRGVmYXVsdEJhY2tncm91bmQpOwotICAgICAgICAgICAgbUVTVC5tQmFja2dyb3VuZENvbG9yID0gREVGQVVMVF9CQUNLR1JPVU5EX0NPTE9SOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0SXRlbVNpemUoaW50IHNpemUpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIG9uQ2xpY2tTaXplSXRlbSIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBTVEFURV9TRUxFQ1RFRCB8fCBtU3RhdGUgPT0gU1RBVEVfU0VMRUNUX0ZJWCkgewotICAgICAgICAgICAgICAgIGNoYW5nZVNpemVTZWxlY3RlZFRleHQoc2l6ZSk7Ci0gICAgICAgICAgICAgICAgaGFuZGxlUmVzZXRFZGl0KCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzZXRJdGVtQ29sb3IoaW50IGNvbG9yKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBvbkNsaWNrQ29sb3JJdGVtIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobVN0YXRlID09IFNUQVRFX1NFTEVDVEVEIHx8IG1TdGF0ZSA9PSBTVEFURV9TRUxFQ1RfRklYKSB7Ci0gICAgICAgICAgICAgICAgY2hhbmdlQ29sb3JTZWxlY3RlZFRleHQoY29sb3IpOwotICAgICAgICAgICAgICAgIGhhbmRsZVJlc2V0RWRpdCgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0QWxpZ25tZW50KExheW91dC5BbGlnbm1lbnQgYWxpZ24pIHsKLSAgIC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9CQUNLR1JPVU5EX0NPTE9SKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc1NvZnRLZXlCbG9ja2VkKCkgewotICAgICAgICAgICAgcmV0dXJuIG1Tb2Z0S2V5QmxvY2tGbGFnOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGludCBnZXRFZGl0TW9kZSgpIHsKLSAgICAgICAgICAgIHJldHVybiBtTW9kZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBpbnQgZ2V0U2VsZWN0U3RhdGUoKSB7Ci0gICAgICAgICAgICByZXR1cm4gbVN0YXRlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGludCBnZXRTZWxlY3Rpb25TdGFydCgpIHsKLSAgICAgICAgICAgIHJldHVybiBtQ3VyU3RhcnQ7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgaW50IGdldFNlbGVjdGlvbkVuZCgpIHsKLSAgICAgICAgICAgIHJldHVybiBtQ3VyRW5kOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIGRvTmV4dEhhbmRsZSgpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGRvTmV4dEhhbmRsZTogIiArIG1Nb2RlICsgIiwiICsgbVN0YXRlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHN3aXRjaCAobU1vZGUpIHsKLSAgICAgICAgICAgIGNhc2UgTU9ERV9DT1BZOgotICAgICAgICAgICAgICAgIGhhbmRsZUNvcHkoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTU9ERV9DVVQ6Ci0gICAgICAgICAgICAgICAgaGFuZGxlQ3V0KCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIE1PREVfUEFTVEU6Ci0gICAgICAgICAgICAgICAgaGFuZGxlUGFzdGUoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTU9ERV9TSVpFOgotICAgICAgICAgICAgICAgIGhhbmRsZVNpemUoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTU9ERV9DT0xPUjoKLSAgICAgICAgICAgICAgICBoYW5kbGVDb2xvcigpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBNT0RFX0FMSUdOOgotICAgICAgICAgICAgICAgIGhhbmRsZUFsaWduKCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZUNhbmNlbCgpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGhhbmRsZUNhbmNlbCIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbU1vZGUgPSBNT0RFX05PVEhJTkc7Ci0gICAgICAgICAgICBtU3RhdGUgPSBTVEFURV9TRUxFQ1RfT0ZGOwotICAgICAgICAgICAgbUVkaXRGbGFnID0gZmFsc2U7Ci0gICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGhhbmRsZUNhbmNlbDoiICsgbUVTVC5nZXRJbnB1dFR5cGUoKSk7Ci0gICAgICAgICAgICB1bmJsb2NrU29mdEtleSgpOwotICAgICAgICAgICAgdW5zZXRTZWxlY3QoKTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBoYW5kbGVDb21wbGV0ZSgpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGhhbmRsZUNvbXBsZXRlIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIW1FZGl0RmxhZykgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtU3RhdGUgPT0gU1RBVEVfU0VMRUNURUQpIHsKLSAgICAgICAgICAgICAgICBtU3RhdGUgPSBTVEFURV9TRUxFQ1RfRklYOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZG9OZXh0SGFuZGxlKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgaGFuZGxlVGV4dFZpZXdGdW5jKGludCBtb2RlLCBpbnQgaWQpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGhhbmRsZVRleHRWaWV3OiAiICsgbU1vZGUgKyAiLCIgKyBtU3RhdGUgKwotICAgICAgICAgICAgICAgICAgICAgICAgIiwiICsgaWQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFtRWRpdEZsYWcpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobU1vZGUgPT0gTU9ERV9OT1RISU5HIHx8IG1Nb2RlID09IE1PREVfU0VMRUNUKSB7Ci0gICAgICAgICAgICAgICAgbU1vZGUgPSBtb2RlOwotICAgICAgICAgICAgICAgIGlmIChtU3RhdGUgPT0gU1RBVEVfU0VMRUNURUQpIHsKLSAgICAgICAgICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfU0VMRUNUX0ZJWDsKLSAgICAgICAgICAgICAgICAgICAgaGFuZGxlVGV4dFZpZXdGdW5jKG1vZGUsIGlkKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBoYW5kbGVTZWxlY3QoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKG1Nb2RlICE9IG1vZGUpIHsKLSAgICAgICAgICAgICAgICBoYW5kbGVDYW5jZWwoKTsKLSAgICAgICAgICAgICAgICBtTW9kZSA9IG1vZGU7Ci0gICAgICAgICAgICAgICAgaGFuZGxlVGV4dFZpZXdGdW5jKG1vZGUsIGlkKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobVN0YXRlID09IFNUQVRFX1NFTEVDVF9GSVgpIHsKLSAgICAgICAgICAgICAgICBtRVNULm9uVGV4dENvbnRleHRNZW51SXRlbShpZCk7Ci0gICAgICAgICAgICAgICAgaGFuZGxlUmVzZXRFZGl0KCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgaGFuZGxlQ29weSgpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGhhbmRsZUNvcHk6ICIgKyBtTW9kZSArICIsIiArIG1TdGF0ZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBoYW5kbGVUZXh0Vmlld0Z1bmMoTU9ERV9DT1BZLCBhbmRyb2lkLlIuaWQuY29weSk7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgaGFuZGxlQ3V0KCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gaGFuZGxlQ29weTogIiArIG1Nb2RlICsgIiwiICsgbVN0YXRlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGhhbmRsZVRleHRWaWV3RnVuYyhNT0RFX0NVVCwgYW5kcm9pZC5SLmlkLmN1dCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgaGFuZGxlUGFzdGUoKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBoYW5kbGVQYXN0ZSIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFtRWRpdEZsYWcpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtRVNULm9uVGV4dENvbnRleHRNZW51SXRlbShhbmRyb2lkLlIuaWQucGFzdGUpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZVNldFNwYW4oaW50IG1vZGUpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGhhbmRsZVNldFNwYW46IiArIG1FZGl0RmxhZyArICIsIgotICAgICAgICAgICAgICAgICAgICAgICAgKyBtU3RhdGUgKyAnLCcgKyBtTW9kZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIW1FZGl0RmxhZykgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICItLS0gaGFuZGxlU2V0U3BhbjogRWRpdGluZyBpcyBub3Qgc3RhcnRlZC4iKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobU1vZGUgPT0gTU9ERV9OT1RISU5HIHx8IG1Nb2RlID09IE1PREVfU0VMRUNUKSB7Ci0gICAgICAgICAgICAgICAgbU1vZGUgPSBtb2RlOwotICAgICAgICAgICAgICAgIGlmIChtU3RhdGUgPT0gU1RBVEVfU0VMRUNURUQpIHsKLSAgICAgICAgICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfU0VMRUNUX0ZJWDsKLSAgICAgICAgICAgICAgICAgICAgaGFuZGxlU2V0U3Bhbihtb2RlKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBoYW5kbGVTZWxlY3QoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKG1Nb2RlICE9IG1vZGUpIHsKLSAgICAgICAgICAgICAgICBoYW5kbGVDYW5jZWwoKTsKLSAgICAgICAgICAgICAgICBtTW9kZSA9IG1vZGU7Ci0gICAgICAgICAgICAgICAgaGFuZGxlU2V0U3Bhbihtb2RlKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBTVEFURV9TRUxFQ1RfRklYKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1FU1Quc2V0SGludE1lc3NhZ2UoSElOVF9NU0dfTlVMTCk7Ci0gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAobW9kZSkgewotICAgICAgICAgICAgICAgICAgICBjYXNlIE1PREVfQ09MT1I6Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRVNULm9uU2hvd0ZvcmVncm91bmRDb2xvckFsZXJ0KCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBNT0RFX1NJWkU6Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRVNULm9uU2hvd1NpemVBbGVydCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgTU9ERV9BTElHTjoKLSAgICAgICAgICAgICAgICAgICAgICAgIG1FU1Qub25TaG93QWxpZ25BbGVydCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiLS0tIGhhbmRsZVNldFNwYW46IGludmFsaWQgbW9kZS4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBoYW5kbGVTZXRTcGFuOiBkbyBub3RoaW5nLiIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBoYW5kbGVTaXplKCkgewotICAgICAgICAgICAgaGFuZGxlU2V0U3BhbihNT0RFX1NJWkUpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZUNvbG9yKCkgewotICAgICAgICAgICAgaGFuZGxlU2V0U3BhbihNT0RFX0NPTE9SKTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBoYW5kbGVBbGlnbigpIHsKLSAgICAgICAgICAgIGhhbmRsZVNldFNwYW4oTU9ERV9BTElHTik7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgaGFuZGxlU2VsZWN0KCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gaGFuZGxlU2VsZWN0OiIgKyBtRWRpdEZsYWcgKyAiLCIgKyBtU3RhdGUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFtRWRpdEZsYWcpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobVN0YXRlID09IFNUQVRFX1NFTEVDVF9PRkYpIHsKLSAgICAgICAgICAgICAgICBpZiAoaXNUZXh0U2VsZWN0ZWQoKSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiU2VsZWN0aW9uIGlzIG9mZiwgYnV0IHNlbGVjdGVkIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHNldFNlbGVjdFN0YXJ0UG9zKCk7Ci0gICAgICAgICAgICAgICAgYmxvY2tTb2Z0S2V5KCk7Ci0gICAgICAgICAgICAgICAgbUVTVC5zZXRIaW50TWVzc2FnZShISU5UX01TR19TRUxFQ1RfRU5EKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobVN0YXRlID09IFNUQVRFX1NFTEVDVF9PTikgewotICAgICAgICAgICAgICAgIGlmIChpc1RleHRTZWxlY3RlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJTZWxlY3Rpb24gbm93IHN0YXJ0LCBidXQgc2VsZWN0ZWQiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgc2V0U2VsZWN0ZWRFbmRQb3MoKTsKLSAgICAgICAgICAgICAgICBtRVNULnNldEhpbnRNZXNzYWdlKEhJTlRfTVNHX1BVU0hfQ09NUEVURSk7Ci0gICAgICAgICAgICAgICAgZG9OZXh0SGFuZGxlKCk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKG1TdGF0ZSA9PSBTVEFURV9TRUxFQ1RFRCkgewotICAgICAgICAgICAgICAgIGlmICghaXNUZXh0U2VsZWN0ZWQoKSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiU2VsZWN0aW9uIGlzIGRvbmUsIGJ1dCBub3Qgc2VsZWN0ZWQiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgc2V0U2VsZWN0ZWRFbmRQb3MoKTsKLSAgICAgICAgICAgICAgICBkb05leHRIYW5kbGUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBoYW5kbGVTZWxlY3RBbGwoKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBoYW5kbGVTZWxlY3RBbGwiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghbUVkaXRGbGFnKSB7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GVsc2UgewotICAgICAgICAgICAgICAgICAgICBtRVNULnNldFNlbGVjdGlvbihtQ3VyRW5kLCBtQ3VyU3RhcnQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtU3RhdGUgPSBTVEFURV9TRUxFQ1RFRDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICJTZWxlY3QgaXMgb24sIGJ1dCBjdXJzb3IgcG9zaXRpb25zIGFyZSBpbGxpZ2FsLjoiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUVTVC5nZXRUZXh0KCkubGVuZ3RoKCkgKyAiLCIgKyBtQ3VyU3RhcnQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCIgKyBtQ3VyRW5kKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCB1bnNldFNlbGVjdCgpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIG9mZlNlbGVjdCIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaW50IGN1cnJwb3MgPSBtRVNULmdldFNlbGVjdGlvblN0YXJ0KCk7Ci0gICAgICAgICAgICBtRVNULnNldFNlbGVjdGlvbihjdXJycG9zLCBjdXJycG9zKTsKLSAgICAgICAgICAgIG1TdGF0ZSA9IFNUQVRFX1NFTEVDVF9PRkY7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgc2V0U2VsZWN0U3RhcnRQb3MoKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBzZXRTZWxlY3RTdGFydFBvcyIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUN1clN0YXJ0ID0gbUVTVC5nZXRTZWxlY3Rpb25TdGFydCgpOwotICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfU0VMRUNUX09OOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIHNldFNlbGVjdGVkRW5kUG9zKCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gc2V0U2VsZWN0RW5kUG9zOiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1FU1QuZ2V0U2VsZWN0aW9uU3RhcnQoKSA9PSBtQ3VyU3RhcnQpIHsKLSAgICAgICAgICAgICAgICBzZXRTZWxlY3RlZEVuZFBvcyhtRVNULmdldFNlbGVjdGlvbkVuZCgpKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc2V0U2VsZWN0ZWRFbmRQb3MobUVTVC5nZXRTZWxlY3Rpb25TdGFydCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldFNlbGVjdGVkRW5kUG9zKGludCBwb3MpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIHNldFNlbGVjdGVkRW5kUG9zOiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUN1ckVuZCA9IHBvczsKLSAgICAgICAgICAgIHNldFNlbGVjdGlvbigpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSBib29sZWFuIGlzVGV4dFNlbGVjdGVkKCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gaXNUZXh0U2VsZWN0ZWQ6IiArIG1DdXJTdGFydCArICIsIgotICAgICAgICAgICAgICAgICAgICAgICAgKyBtQ3VyRW5kKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiAobUN1clN0YXJ0ICE9IG1DdXJFbmQpCi0gICAgICAgICAgICAgICAgICAgICYmIChtU3RhdGUgPT0gU1RBVEVfU0VMRUNURUQgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhdGUgPT0gU1RBVEVfU0VMRUNUX0ZJWCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgc2V0U3R5bGVkVGV4dFNwYW4oT2JqZWN0IHNwYW4sIGludCBzdGFydCwgaW50IGVuZCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gc2V0U3R5bGVkVGV4dFNwYW46IiArIG1Nb2RlICsgIiwiCi0gICAgICAgICAgICAgICAgICAgICAgICArIHN0YXJ0ICsgIiwiICsgZW5kKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChzdGFydCA8IGVuZCkgewotICAgICAgICAgICAgICAgIG1FU1QuZ2V0VGV4dCgpLnNldFNwYW4oc3Bhbiwgc3RhcnQsIGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFNwYW5uYWJsZS5TUEFOX0VYQ0xVU0lWRV9FWENMVVNJVkUpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtRVNULmdldFRleHQoKS5zZXRTcGFuKHNwYW4sIGVuZCwgc3RhcnQsCi0gICAgICAgICAgICAgICAgICAgICAgICBTcGFubmFibGUuU1BBTl9FWENMVVNJVkVfRVhDTFVTSVZFKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBjaGFuZ2VTaXplU2VsZWN0ZWRUZXh0KGludCBzaXplKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBjaGFuZ2VTaXplOiIgKyBzaXplKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHNldFN0eWxlZFRleHRTcGFuKG5ldyBBYnNvbHV0ZVNpemVTcGFuKHNpemUpLAotICAgICAgICAgICAgICAgIG1DdXJTdGFydCwgbUN1ckVuZCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgY2hhbmdlQ29sb3JTZWxlY3RlZFRleHQoaW50IGNvbG9yKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBjaGFuZ2VDb2xvcjoiICsgY29sb3IpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc2V0U3R5bGVkVGV4dFNwYW4obmV3IEZvcmVncm91bmRDb2xvclNwYW4oY29sb3IpLAotICAgICAgICAgICAgICAgIG1DdXJTdGFydCwgbUN1ckVuZCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgY2hhbmdlQWxpZ24oTGF5b3V0LkFsaWdubWVudCBhbGlnbikgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gY2hhbmdlQWxpZ246IiArIGFsaWduKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHNldFN0eWxlZFRleHRTcGFuKG5ldyBBbGlnbm1lbnRTcGFuLlN0YW5kYXJkKGFsaWduKSwKLSAgICAgICAgICAgICAgICAgICAgZmluZExpbmVTdGFydChtRVNULmdldFRleHQoKSwgbUN1clN0YXJ0KSwKLSAgICAgICAgICAgICAgICAgICAgZmluZExpbmVFbmQobUVTVC5nZXRUZXh0KCksIG1DdXJFbmQpKTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgaW50IGZpbmRMaW5lU3RhcnQoRWRpdGFibGUgdGV4dCwgaW50IGN1cnJlbnQpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGZpbmRMaW5lU3RhcnQ6IGN1cnI6IiArIGN1cnJlbnQgKwotICAgICAgICAgICAgICAgICAgICAgICAgIiwgbGVuZ3RoOiIgKyB0ZXh0Lmxlbmd0aCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGludCBwb3MgPSBjdXJyZW50OwotICAgICAgICAgICAgZm9yICg7IHBvcyA+IDA7IHBvcy0tKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckF0KHBvcyAtIDEpID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIHBvczsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBpbnNlcnRJbWFnZVNwYW4oSW1hZ2VTcGFuIHNwYW4pIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGluc2VydEltYWdlU3BhbiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHNwYW4gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gaW5zZXJ0aW1hZ2VzcGFuOiIgKyBzcGFuLmdldERyYXdhYmxlKCkuZ2V0SW50cmluc2ljSGVpZ2h0KCkgKyAiLCIgKyBzcGFuLmdldERyYXdhYmxlKCkuZ2V0SW50cmluc2ljV2lkdGgoKSk7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBpbnNlcnRpbWFnZXNwYW46IiArIHNwYW4uZ2V0RHJhd2FibGUoKS5nZXRDbGFzcygpKTsKLSAgICAgICAgICAgICAgICBpbnQgY3VycG9zID0gbUVTVC5nZXRTZWxlY3Rpb25TdGFydCgpOwotICAgICAgICAgICAgICAgIG1FU1QuZ2V0VGV4dCgpLmluc2VydChjdXJwb3MsICJcdUZGRkMiKTsKLSAgICAgICAgICAgICAgICBtRVNULmdldFRleHQoKS5zZXRTcGFuKHNwYW4sIGN1cnBvcywgY3VycG9zICsgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgIFNwYW5uYWJsZS5TUEFOX0VYQ0xVU0lWRV9FWENMVVNJVkUpOwotICAgICAgICAgICAgICAgIG1FU1Qubm90aWZ5U3RhdGVDaGFuZ2VkKG1Nb2RlLCBtU3RhdGUpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiLS0tIGluc2VydEltYWdlU3BhbjogbnVsbCBzcGFuIHdhcyBpbnNlcnRlZCIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSBpbnQgZmluZExpbmVFbmQoRWRpdGFibGUgdGV4dCwgaW50IGN1cnJlbnQpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGZpbmRMaW5lRW5kOiBjdXJyOiIgKyBjdXJyZW50ICsKLSAgICAgICAgICAgICAgICAgICAgICAgICIsIGxlbmd0aDoiICsgdGV4dC5sZW5ndGgoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpbnQgcG9zID0gY3VycmVudDsKLSAgICAgICAgICAgIGZvciAoOyBwb3MgPCB0ZXh0Lmxlbmd0aCgpOyBwb3MrKykgewotICAgICAgICAgICAgICAgIGlmIChwb3MgPiAwICYmIHRleHQuY2hhckF0KHBvcyAtIDEpID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIHBvczsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBibG9ja1NvZnRLZXkoKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBibG9ja1NvZnRLZXk6Iik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBJbnB1dE1ldGhvZE1hbmFnZXIgaW1tID0gKElucHV0TWV0aG9kTWFuYWdlcikgbUVTVC5nZXRDb250ZXh0KCkuCi0gICAgICAgICAgICBnZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuSU5QVVRfTUVUSE9EX1NFUlZJQ0UpOwotICAgICAgICAgICAgaW1tLmhpZGVTb2Z0SW5wdXRGcm9tV2luZG93KG1FU1QuZ2V0V2luZG93VG9rZW4oKSwgMCk7Ci0gICAgICAgICAgICBtRVNULnNldE9uQ2xpY2tMaXN0ZW5lcigKLSAgICAgICAgICAgICAgICAgICAgbmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBvbnRyYWNrYmFsbGNsaWNrOiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uRml4U2VsZWN0ZWRJdGVtKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9KTsKLSAgICAgICAgICAgIG1Tb2Z0S2V5QmxvY2tGbGFnID0gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCB1bmJsb2NrU29mdEtleSgpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIHVuYmxvY2tTb2Z0S2V5OiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUVTVC5zZXRPbkNsaWNrTGlzdGVuZXIobnVsbCk7Ci0gICAgICAgICAgICBtU29mdEtleUJsb2NrRmxhZyA9IGZhbHNlOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBjbGFzcyBTdHlsZWRUZXh0Q29udmVydGVyIHsKLSAgICAgICAgcHJpdmF0ZSBFZGl0U3R5bGVkVGV4dCBtRVNUOwotCi0gICAgICAgIHB1YmxpYyBTdHlsZWRUZXh0Q29udmVydGVyKEVkaXRTdHlsZWRUZXh0IGVzdCkgewotICAgICAgICAgICAgbUVTVCA9IGVzdDsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0SHRtbCgpIHsKLSAgICAgICAgICAgIFN0cmluZyBodG1sQm9keSA9IEh0bWwudG9IdG1sKG1FU1QuZ2V0VGV4dCgpKTsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGdldENvbnZlcnRlZEJvZHk6IiArIGh0bWxCb2R5KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBodG1sQm9keTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIGdldFVyaUFycmF5KEFycmF5TGlzdDxVcmk+IHVyaXMsIEVkaXRhYmxlIHRleHQpIHsKLSAgICAgICAgICAgIHVyaXMuY2xlYXIoKTsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGdldFVyaUFycmF5OiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaW50IGxlbiA9IHRleHQubGVuZ3RoKCk7Ci0gICAgICAgICAgICBpbnQgbmV4dDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgdGV4dC5sZW5ndGgoKTsgaSA9IG5leHQpIHsKLSAgICAgICAgICAgICAgICBuZXh0ID0gdGV4dC5uZXh0U3BhblRyYW5zaXRpb24oaSwgbGVuLCBJbWFnZVNwYW4uY2xhc3MpOwotICAgICAgICAgICAgICAgIEltYWdlU3BhbltdIGltYWdlcyA9IHRleHQuZ2V0U3BhbnMoaSwgbmV4dCwgSW1hZ2VTcGFuLmNsYXNzKTsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IGltYWdlcy5sZW5ndGg7IGorKykgewotICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGdldFVyaUFycmF5OiBmb3VuZEFycmF5IiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoSW1hZ2VTcGFuKSBpbWFnZXNbal0pLmdldFNvdXJjZSgpKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB1cmlzLmFkZChVcmkucGFyc2UoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChJbWFnZVNwYW4pIGltYWdlc1tqXSkuZ2V0U291cmNlKCkpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBTZXRIdG1sIChTdHJpbmcgaHRtbCkgewotICAgICAgICAgICAgZmluYWwgU3Bhbm5lZCBzcGFubmVkID0gSHRtbC5mcm9tSHRtbChodG1sLCBuZXcgSHRtbC5JbWFnZUdldHRlcigpIHsKLSAgICAgICAgICAgICAgICBwdWJsaWMgRHJhd2FibGUgZ2V0RHJhd2FibGUoU3RyaW5nIHNyYykgewotICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIHNldGh0bWw6IHNyYz0iK3NyYyk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzcmMuc3RhcnRzV2l0aCgiY29udGVudDovLyIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBVcmkgdXJpID0gVXJpLnBhcnNlKHNyYyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIElucHV0U3RyZWFtIGlzID0gbUVTVC5nZXRDb250ZXh0KCkuZ2V0Q29udGVudFJlc29sdmVyKCkub3BlbklucHV0U3RyZWFtKHVyaSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwIGJpdG1hcCA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlU3RyZWFtKGlzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBEcmF3YWJsZSBkcmF3YWJsZSA9IG5ldyBCaXRtYXBEcmF3YWJsZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRleHQoKS5nZXRSZXNvdXJjZXMoKSwgYml0bWFwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3YWJsZS5zZXRCb3VuZHMoMCwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdhYmxlLmdldEludHJpbnNpY1dpZHRoKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3YWJsZS5nZXRJbnRyaW5zaWNIZWlnaHQoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXMuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZHJhd2FibGU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICItLS0gc2V0IGh0bWw6IEZhaWxlZCB0byBsb2FkZWQgY29udGVudCAiICsgdXJpLCBlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiICB1bmtub3duIHNyYz0iK3NyYyk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0sIG51bGwpOwotICAgICAgICAgICAgbUVTVC5zZXRUZXh0KHNwYW5uZWQpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBjbGFzcyBTdHlsZWRUZXh0RGlhbG9nIHsKLSAgICAgICAgQnVpbGRlciBtQnVpbGRlcjsKLSAgICAgICAgQ2hhclNlcXVlbmNlIG1Db2xvclRpdGxlOwotICAgICAgICBDaGFyU2VxdWVuY2UgbVNpemVUaXRsZTsKLSAgICAgICAgQ2hhclNlcXVlbmNlIG1BbGlnblRpdGxlOwotICAgICAgICBDaGFyU2VxdWVuY2VbXSBtQ29sb3JOYW1lczsKLSAgICAgICAgQ2hhclNlcXVlbmNlW10gbUNvbG9ySW50czsKLSAgICAgICAgQ2hhclNlcXVlbmNlW10gbVNpemVOYW1lczsKLSAgICAgICAgQ2hhclNlcXVlbmNlW10gbVNpemVEaXNwbGF5SW50czsKLSAgICAgICAgQ2hhclNlcXVlbmNlW10gbVNpemVTZW5kSW50czsKLSAgICAgICAgQ2hhclNlcXVlbmNlW10gbUFsaWduTmFtZXM7Ci0gICAgICAgIEVkaXRTdHlsZWRUZXh0IG1FU1Q7Ci0KLSAgICAgICAgcHVibGljIFN0eWxlZFRleHREaWFsb2coRWRpdFN0eWxlZFRleHQgZXN0KSB7Ci0gICAgICAgICAgICBtRVNUID0gZXN0OwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0QnVpbGRlcihCdWlsZGVyIGJ1aWxkZXIpIHsKLSAgICAgICAgICAgIG1CdWlsZGVyID0gYnVpbGRlcjsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldENvbG9yQWxlcnRQYXJhbXMoQ2hhclNlcXVlbmNlIGNvbG9ydGl0bGUsCi0gICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlW10gY29sb3JuYW1lcywgQ2hhclNlcXVlbmNlW10gY29sb3JpbnRzKSB7Ci0gICAgICAgICAgICBtQ29sb3JUaXRsZSA9IGNvbG9ydGl0bGU7Ci0gICAgICAgICAgICBtQ29sb3JOYW1lcyA9IGNvbG9ybmFtZXM7Ci0gICAgICAgICAgICBtQ29sb3JJbnRzID0gY29sb3JpbnRzOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0U2l6ZUFsZXJ0UGFyYW1zKENoYXJTZXF1ZW5jZSBzaXpldGl0bGUsCi0gICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlW10gc2l6ZW5hbWVzLCBDaGFyU2VxdWVuY2VbXSBzaXplZGlzcGxheWludHMsCi0gICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlW10gc2l6ZXNlbmRpbnRzKSB7Ci0gICAgICAgICAgICBtU2l6ZVRpdGxlID0gc2l6ZXRpdGxlOwotICAgICAgICAgICAgbVNpemVOYW1lcyA9IHNpemVuYW1lczsKLSAgICAgICAgICAgIG1TaXplRGlzcGxheUludHMgPSBzaXplZGlzcGxheWludHM7Ci0gICAgICAgICAgICBtU2l6ZVNlbmRJbnRzID0gc2l6ZXNlbmRpbnRzOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0QWxpZ25BbGVydFBhcmFtcyhDaGFyU2VxdWVuY2UgYWxpZ250aXRsZSwKLSAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2VbXSBhbGlnbm5hbWVzKSB7Ci0gICAgICAgICAgICBtQWxpZ25UaXRsZSA9IGFsaWdudGl0bGU7Ci0gICAgICAgICAgICBtQWxpZ25OYW1lcyA9IGFsaWdubmFtZXM7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIGJvb2xlYW4gY2hlY2tDb2xvckFsZXJ0UGFyYW1zKCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gY2hlY2tQYXJhbXMiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtQnVpbGRlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIi0tLSBidWlsZGVyIGlzIG51bGwuIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfSBlbHNlIGlmIChtQ29sb3JUaXRsZSA9PSBudWxsIHx8IG1Db2xvck5hbWVzID09IG51bGwKLSAgICAgICAgICAgICAgICAgICAgfHwgbUNvbG9ySW50cyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIi0tLSBjb2xvciBhbGVydCBwYXJhbXMgYXJlIG51bGwuIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfSBlbHNlIGlmIChtQ29sb3JOYW1lcy5sZW5ndGggIT0gbUNvbG9ySW50cy5sZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiLS0tIHRoZSBsZW5ndGggb2YgY29sb3IgYWxlcnQgcGFyYW1zIGFyZSAiCi0gICAgICAgICAgICAgICAgICAgICAgICArICJkaWZmZXJlbnQuIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIGJvb2xlYW4gY2hlY2tTaXplQWxlcnRQYXJhbXMoKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBjaGVja1BhcmFtcyIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1CdWlsZGVyID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiLS0tIGJ1aWxkZXIgaXMgbnVsbC4iKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKG1TaXplVGl0bGUgPT0gbnVsbCB8fCBtU2l6ZU5hbWVzID09IG51bGwKLSAgICAgICAgICAgICAgICAgICAgfHwgbVNpemVEaXNwbGF5SW50cyA9PSBudWxsIHx8IG1TaXplU2VuZEludHMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICItLS0gc2l6ZSBhbGVydCBwYXJhbXMgYXJlIG51bGwuIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfSBlbHNlIGlmIChtU2l6ZU5hbWVzLmxlbmd0aCAhPSBtU2l6ZURpc3BsYXlJbnRzLmxlbmd0aAotICAgICAgICAgICAgICAgICAgICAmJiBtU2l6ZVNlbmRJbnRzLmxlbmd0aCAhPSBtU2l6ZURpc3BsYXlJbnRzLmxlbmd0aCkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICItLS0gdGhlIGxlbmd0aCBvZiBzaXplIGFsZXJ0IHBhcmFtcyBhcmUgIgotICAgICAgICAgICAgICAgICAgICAgICAgKyAiZGlmZmVyZW50LiIpOwotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSBib29sZWFuIGNoZWNrQWxpZ25BbGVydFBhcmFtcygpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGNoZWNrQWxpZ25BbGVydFBhcmFtcyIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1CdWlsZGVyID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiLS0tIGJ1aWxkZXIgaXMgbnVsbC4iKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKG1BbGlnblRpdGxlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiLS0tIGFsaWduIGFsZXJ0IHBhcmFtcyBhcmUgbnVsbC4iKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBvblNob3dGb3JlZ3JvdW5kQ29sb3JBbGVydERpYWxvZygpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIG9uU2hvd0ZvcmVncm91bmRDb2xvckFsZXJ0RGlhbG9nIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIWNoZWNrQ29sb3JBbGVydFBhcmFtcygpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUJ1aWxkZXIuc2V0VGl0bGUobUNvbG9yVGl0bGUpOwotICAgICAgICAgICAgbUJ1aWxkZXIuc2V0SWNvbigwKTsKLSAgICAgICAgICAgIG1CdWlsZGVyLgotICAgICAgICAgICAgc2V0SXRlbXMobUNvbG9yTmFtZXMsCi0gICAgICAgICAgICAgICAgICAgIG5ldyBEaWFsb2dJbnRlcmZhY2UuT25DbGlja0xpc3RlbmVyKCkgewotICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soRGlhbG9nSW50ZXJmYWNlIGRpYWxvZywgaW50IHdoaWNoKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKCJFRVRWTSIsICJtQnVpbGRlci5vbmNsaWNrOiIgKyB3aGljaCk7Ci0gICAgICAgICAgICAgICAgICAgIGludCBjb2xvciA9IEludGVnZXIucGFyc2VJbnQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKFN0cmluZykgbUNvbG9ySW50c1t3aGljaF0sIDE2KSAtIDB4MDEwMDAwMDA7Ci0gICAgICAgICAgICAgICAgICAgIG1FU1Quc2V0SXRlbUNvbG9yKGNvbG9yKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9KTsKLSAgICAgICAgICAgIG1CdWlsZGVyLnNob3coKTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBvblNob3dCYWNrZ3JvdW5kQ29sb3JBbGVydERpYWxvZygpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIG9uU2hvd0JhY2tncm91bmRDb2xvckFsZXJ0RGlhbG9nIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIWNoZWNrQ29sb3JBbGVydFBhcmFtcygpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUJ1aWxkZXIuc2V0VGl0bGUobUNvbG9yVGl0bGUpOwotICAgICAgICAgICAgbUJ1aWxkZXIuc2V0SWNvbigwKTsKLSAgICAgICAgICAgIG1CdWlsZGVyLgotICAgICAgICAgICAgc2V0SXRlbXMobUNvbG9yTmFtZXMsCi0gICAgICAgICAgICAgICAgICAgIG5ldyBEaWFsb2dJbnRlcmZhY2UuT25DbGlja0xpc3RlbmVyKCkgewotICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soRGlhbG9nSW50ZXJmYWNlIGRpYWxvZywgaW50IHdoaWNoKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKCJFRVRWTSIsICJtQnVpbGRlci5vbmNsaWNrOiIgKyB3aGljaCk7Ci0gICAgICAgICAgICAgICAgICAgIGludCBjb2xvciA9IEludGVnZXIucGFyc2VJbnQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKFN0cmluZykgbUNvbG9ySW50c1t3aGljaF0sIDE2KSAtIDB4MDEwMDAwMDA7Ci0gICAgICAgICAgICAgICAgICAgIG1FU1Quc2V0QmFja2dyb3VuZENvbG9yKGNvbG9yKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9KTsKLSAgICAgICAgICAgIG1CdWlsZGVyLnNob3coKTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgdm9pZCBvblNob3dTaXplQWxlcnREaWFsb2coKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBvblNob3dTaXplQWxlcnREaWFsb2ciKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghY2hlY2tTaXplQWxlcnRQYXJhbXMoKSkgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1CdWlsZGVyLnNldFRpdGxlKG1TaXplVGl0bGUpOwotICAgICAgICAgICAgbUJ1aWxkZXIuc2V0SWNvbigwKTsKLSAgICAgICAgICAgIG1CdWlsZGVyLgotICAgICAgICAgICAgc2V0SXRlbXMobVNpemVOYW1lcywKLSAgICAgICAgICAgICAgICAgICAgbmV3IERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIoKSB7Ci0gICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhEaWFsb2dJbnRlcmZhY2UgZGlhbG9nLCBpbnQgd2hpY2gpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIm1CdWlsZGVyLm9uY2xpY2s6IiArIHdoaWNoKTsKLSAgICAgICAgICAgICAgICAgICAgaW50IHNpemUgPSBJbnRlZ2VyCi0gICAgICAgICAgICAgICAgICAgIC5wYXJzZUludCgoU3RyaW5nKSBtU2l6ZURpc3BsYXlJbnRzW3doaWNoXSk7Ci0gICAgICAgICAgICAgICAgICAgIG1FU1Quc2V0SXRlbVNpemUoc2l6ZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSk7Ci0gICAgICAgICAgICBtQnVpbGRlci5zaG93KCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgb25TaG93QWxpZ25BbGVydERpYWxvZygpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIG9uU2hvd0FsaWduQWxlcnREaWFsb2ciKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghY2hlY2tBbGlnbkFsZXJ0UGFyYW1zKCkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtQnVpbGRlci5zZXRUaXRsZShtQWxpZ25UaXRsZSk7Ci0gICAgICAgICAgICBtQnVpbGRlci5zZXRJY29uKDApOwotICAgICAgICAgICAgbUJ1aWxkZXIuCi0gICAgICAgICAgICBzZXRJdGVtcyhtQWxpZ25OYW1lcywKLSAgICAgICAgICAgICAgICAgICAgbmV3IERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIoKSB7Ci0gICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhEaWFsb2dJbnRlcmZhY2UgZGlhbG9nLCBpbnQgd2hpY2gpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIm1CdWlsZGVyLm9uY2xpY2s6IiArIHdoaWNoKTsKLSAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkFsaWdubWVudCBhbGlnbiA9IExheW91dC5BbGlnbm1lbnQuQUxJR05fTk9STUFMOwotICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHdoaWNoKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgICAgICAgICAgICAgIGFsaWduID0gTGF5b3V0LkFsaWdubWVudC5BTElHTl9OT1JNQUw7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgotICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ24gPSBMYXlvdXQuQWxpZ25tZW50LkFMSUdOX0NFTlRFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBhbGlnbiA9IExheW91dC5BbGlnbm1lbnQuQUxJR05fT1BQT1NJVEU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1FU1Quc2V0QWxpZ25tZW50KGFsaWduKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9KTsKLSAgICAgICAgICAgIG1CdWlsZGVyLnNob3coKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHByaXZhdGUgY2xhc3MgU3R5bGVkVGV4dEFycm93S2V5TWV0aG9kIGV4dGVuZHMgQXJyb3dLZXlNb3ZlbWVudE1ldGhvZCB7Ci0gICAgICAgIEVkaXRvck1hbmFnZXIgbU1hbmFnZXI7Ci0gICAgICAgIFN0eWxlZFRleHRBcnJvd0tleU1ldGhvZChFZGl0b3JNYW5hZ2VyIG1hbmFnZXIpIHsKLSAgICAgICAgICAgIHN1cGVyKCk7Ci0gICAgICAgICAgICBtTWFuYWdlciA9IG1hbmFnZXI7Ci0gICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIGJvb2xlYW4gb25LZXlEb3duKFRleHRWaWV3IHdpZGdldCwgU3Bhbm5hYmxlIGJ1ZmZlciwKLSAgICAgICAgICAgICAgICBpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpIHsKLSAgICAgICAgICAgIGlmICghbU1hbmFnZXIuaXNTb2Z0S2V5QmxvY2tlZCgpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHN1cGVyLm9uS2V5RG93bih3aWRnZXQsIGJ1ZmZlciwga2V5Q29kZSwgZXZlbnQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGV4ZWN1dGVEb3duKHdpZGdldCwgYnVmZmVyLCBrZXlDb2RlKSkgewotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSBpbnQgZ2V0RW5kUG9zKFRleHRWaWV3IHdpZGdldCkgewotICAgICAgICAgICAgaW50IGVuZDsKLSAgICAgICAgICAgIGlmICh3aWRnZXQuZ2V0U2VsZWN0aW9uU3RhcnQoKSA9PSBtTWFuYWdlci5nZXRTZWxlY3Rpb25TdGFydCgpKSB7Ci0gICAgICAgICAgICAgICAgZW5kID0gd2lkZ2V0LmdldFNlbGVjdGlvbkVuZCgpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBlbmQgPSB3aWRnZXQuZ2V0U2VsZWN0aW9uU3RhcnQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBlbmQ7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIGJvb2xlYW4gdXAoVGV4dFZpZXcgd2lkZ2V0LCBTcGFubmFibGUgYnVmZmVyKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSB1cDoiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIExheW91dCBsYXlvdXQgPSB3aWRnZXQuZ2V0TGF5b3V0KCk7Ci0gICAgICAgICAgICBpbnQgZW5kID0gZ2V0RW5kUG9zKHdpZGdldCk7Ci0gICAgICAgICAgICBpbnQgbGluZSA9IGxheW91dC5nZXRMaW5lRm9yT2Zmc2V0KGVuZCk7Ci0gICAgICAgICAgICBpZiAobGluZSA+IDApIHsKLSAgICAgICAgICAgICAgICBpbnQgdG87Ci0gICAgICAgICAgICAgICAgaWYgKGxheW91dC5nZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSkgPT0KLSAgICAgICAgICAgICAgICAgICAgbGF5b3V0LmdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lIC0gMSkpIHsKLSAgICAgICAgICAgICAgICAgICAgZmxvYXQgaCA9IGxheW91dC5nZXRQcmltYXJ5SG9yaXpvbnRhbChlbmQpOwotICAgICAgICAgICAgICAgICAgICB0byA9IGxheW91dC5nZXRPZmZzZXRGb3JIb3Jpem9udGFsKGxpbmUgLSAxLCBoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB0byA9IGxheW91dC5nZXRMaW5lU3RhcnQobGluZSAtIDEpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtTWFuYWdlci5zZXRTZWxlY3RlZEVuZFBvcyh0byk7Ci0gICAgICAgICAgICAgICAgbU1hbmFnZXIub25DdXJzb3JNb3ZlZCgpOwotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSBib29sZWFuIGRvd24oVGV4dFZpZXcgd2lkZ2V0LCBTcGFubmFibGUgYnVmZmVyKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBkb3duOiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgTGF5b3V0IGxheW91dCA9IHdpZGdldC5nZXRMYXlvdXQoKTsKLSAgICAgICAgICAgIGludCBlbmQgPSBnZXRFbmRQb3Mod2lkZ2V0KTsKLSAgICAgICAgICAgIGludCBsaW5lID0gbGF5b3V0LmdldExpbmVGb3JPZmZzZXQoZW5kKTsKLSAgICAgICAgICAgIGlmIChsaW5lIDwgbGF5b3V0LmdldExpbmVDb3VudCgpIC0gMSkgewotICAgICAgICAgICAgICAgIGludCB0bzsKLSAgICAgICAgICAgICAgICBpZiAobGF5b3V0LmdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKSA9PQotICAgICAgICAgICAgICAgICAgICBsYXlvdXQuZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGxpbmUgKyAxKSkgewotICAgICAgICAgICAgICAgICAgICBmbG9hdCBoID0gbGF5b3V0LmdldFByaW1hcnlIb3Jpem9udGFsKGVuZCk7Ci0gICAgICAgICAgICAgICAgICAgIHRvID0gbGF5b3V0LmdldE9mZnNldEZvckhvcml6b250YWwobGluZSArIDEsIGgpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHRvID0gbGF5b3V0LmdldExpbmVTdGFydChsaW5lICsgMSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1NYW5hZ2VyLnNldFNlbGVjdGVkRW5kUG9zKHRvKTsKLSAgICAgICAgICAgICAgICBtTWFuYWdlci5vbkN1cnNvck1vdmVkKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIGJvb2xlYW4gbGVmdChUZXh0VmlldyB3aWRnZXQsIFNwYW5uYWJsZSBidWZmZXIpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGxlZnQ6Iik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBMYXlvdXQgbGF5b3V0ID0gd2lkZ2V0LmdldExheW91dCgpOwotICAgICAgICAgICAgaW50IHRvID0gbGF5b3V0LmdldE9mZnNldFRvTGVmdE9mKGdldEVuZFBvcyh3aWRnZXQpKTsKLSAgICAgICAgICAgIG1NYW5hZ2VyLnNldFNlbGVjdGVkRW5kUG9zKHRvKTsKLSAgICAgICAgICAgIG1NYW5hZ2VyLm9uQ3Vyc29yTW92ZWQoKTsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSBib29sZWFuIHJpZ2h0KFRleHRWaWV3IHdpZGdldCwgU3Bhbm5hYmxlIGJ1ZmZlcikgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gcmlnaHQ6Iik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBMYXlvdXQgbGF5b3V0ID0gd2lkZ2V0LmdldExheW91dCgpOwotICAgICAgICAgICAgaW50IHRvID0gbGF5b3V0LmdldE9mZnNldFRvUmlnaHRPZihnZXRFbmRQb3Mod2lkZ2V0KSk7Ci0gICAgICAgICAgICBtTWFuYWdlci5zZXRTZWxlY3RlZEVuZFBvcyh0byk7Ci0gICAgICAgICAgICBtTWFuYWdlci5vbkN1cnNvck1vdmVkKCk7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHByaXZhdGUgYm9vbGVhbiBleGVjdXRlRG93bihUZXh0VmlldyB3aWRnZXQsIFNwYW5uYWJsZSBidWZmZXIsCi0gICAgICAgICAgICAgICAgaW50IGtleUNvZGUpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGV4ZWN1dGVEb3duOiAiICsga2V5Q29kZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBib29sZWFuIGhhbmRsZWQgPSBmYWxzZTsKLQotICAgICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7Ci0gICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9VUDoKLSAgICAgICAgICAgICAgICBoYW5kbGVkIHw9IHVwKHdpZGdldCwgYnVmZmVyKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0RPV046Ci0gICAgICAgICAgICAgICAgaGFuZGxlZCB8PSBkb3duKHdpZGdldCwgYnVmZmVyKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0xFRlQ6Ci0gICAgICAgICAgICAgICAgaGFuZGxlZCB8PSBsZWZ0KHdpZGdldCwgYnVmZmVyKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUOgotICAgICAgICAgICAgICAgIGhhbmRsZWQgfD0gcmlnaHQod2lkZ2V0LCBidWZmZXIpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUjoKLSAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIub25GaXhTZWxlY3RlZEl0ZW0oKTsKLSAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIGhhbmRsZWQ7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwdWJsaWMgY2xhc3MgSG9yaXpvbnRhbExpbmVTcGFuIGV4dGVuZHMgSW1hZ2VTcGFuIHsKLSAgICAgICAgcHVibGljIEhvcml6b250YWxMaW5lU3BhbihpbnQgY29sb3IsIFZpZXcgdmlldykgewotICAgICAgICAgICAgc3VwZXIobmV3IEhvcml6b250YWxMaW5lRHJhd2FibGUoY29sb3IsIHZpZXcpKTsKLSAgICAgICAgfQotICAgIH0KLSAgICBwdWJsaWMgY2xhc3MgSG9yaXpvbnRhbExpbmVEcmF3YWJsZSBleHRlbmRzIFNoYXBlRHJhd2FibGUgewotICAgICAgICBwcml2YXRlIFZpZXcgbVZpZXc7Ci0gICAgICAgIHB1YmxpYyBIb3Jpem9udGFsTGluZURyYXdhYmxlKGludCBjb2xvciwgVmlldyB2aWV3KSB7Ci0gICAgICAgICAgICBzdXBlcihuZXcgUmVjdFNoYXBlKCkpOwotICAgICAgICAgICAgbVZpZXcgPSB2aWV3OwotICAgICAgICAgICAgcmVuZXdDb2xvcihjb2xvcik7Ci0gICAgICAgICAgICByZW5ld0JvdW5kcyh2aWV3KTsKLSAgICAgICAgfQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIHZvaWQgZHJhdyhDYW52YXMgY2FudmFzKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSBkcmF3OiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmVuZXdDb2xvcigpOwotICAgICAgICAgICAgcmVuZXdCb3VuZHMobVZpZXcpOwotICAgICAgICAgICAgc3VwZXIuZHJhdyhjYW52YXMpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIHJlbmV3Qm91bmRzKFZpZXcgdmlldykgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIGludCB3aWR0aCA9IG1WaWV3LmdldEJhY2tncm91bmQoKS5nZXRCb3VuZHMoKS53aWR0aCgpOwotICAgICAgICAgICAgICAgIGludCBoZWlnaHQgPSBtVmlldy5nZXRCYWNrZ3JvdW5kKCkuZ2V0Qm91bmRzKCkuaGVpZ2h0KCk7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSByZW5ld0JvdW5kczoiICsgd2lkdGggKyAiLCIgKyBoZWlnaHQpOwotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gcmVuZXdCb3VuZHM6IiArIG1WaWV3LmdldENsYXNzKCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaW50IHdpZHRoID0gbVZpZXcuZ2V0V2lkdGgoKTsKLSAgICAgICAgICAgIGlmICh3aWR0aCA+IDIwKSB7Ci0gICAgICAgICAgICAgICAgd2lkdGggLT0gMjA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzZXRCb3VuZHMoMCwgMCwgd2lkdGgsIDIpOwotICAgICAgICB9Ci0gICAgICAgIHByaXZhdGUgdm9pZCByZW5ld0NvbG9yKGludCBjb2xvcikgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICItLS0gcmVuZXdDb2xvcjoiICsgY29sb3IpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZ2V0UGFpbnQoKS5zZXRDb2xvcihjb2xvcik7Ci0gICAgICAgIH0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIHJlbmV3Q29sb3IoKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIi0tLSByZW5ld0NvbG9yOiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1WaWV3IGluc3RhbmNlb2YgVmlldykgewotICAgICAgICAgICAgICAgIEltYWdlU3BhbiBwYXJlbnQgPSBnZXRQYXJlbnRTcGFuKCk7Ci0gICAgICAgICAgICAgICAgRWRpdGFibGUgdGV4dCA9ICgoRWRpdFN0eWxlZFRleHQpbVZpZXcpLmdldFRleHQoKTsKLSAgICAgICAgICAgICAgICBpbnQgc3RhcnQgPSB0ZXh0LmdldFNwYW5TdGFydChwYXJlbnQpOwotICAgICAgICAgICAgICAgIEZvcmVncm91bmRDb2xvclNwYW5bXSBzcGFucyA9IHRleHQuZ2V0U3BhbnMoc3RhcnQsIHN0YXJ0LCBGb3JlZ3JvdW5kQ29sb3JTcGFuLmNsYXNzKTsKLSAgICAgICAgICAgICAgICBpZiAoc3BhbnMubGVuZ3RoID4gMCkgewotICAgICAgICAgICAgICAgICAgICByZW5ld0NvbG9yKHNwYW5zW3NwYW5zLmxlbmd0aCAtIDFdLmdldEZvcmVncm91bmRDb2xvcigpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcHJpdmF0ZSBJbWFnZVNwYW4gZ2V0UGFyZW50U3BhbigpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiLS0tIGdldFBhcmVudFNwYW46Iik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobVZpZXcgaW5zdGFuY2VvZiBFZGl0U3R5bGVkVGV4dCkgewotICAgICAgICAgICAgICAgIEVkaXRhYmxlIHRleHQgPSAoKEVkaXRTdHlsZWRUZXh0KW1WaWV3KS5nZXRUZXh0KCk7Ci0gICAgICAgICAgICAgICAgSW1hZ2VTcGFuW10gaW1hZ2VzID0gdGV4dC5nZXRTcGFucygwLCB0ZXh0Lmxlbmd0aCgpLCBJbWFnZVNwYW4uY2xhc3MpOwotICAgICAgICAgICAgICAgIGlmIChpbWFnZXMubGVuZ3RoID4gMCkgewotICAgICAgICAgICAgICAgICAgICBmb3IgKEltYWdlU3BhbiBpbWFnZTogaW1hZ2VzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW1hZ2UuZ2V0RHJhd2FibGUoKSA9PSB0aGlzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGltYWdlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0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UVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRwbS5zZXRBY3RpdmVQYXNzd29yZFN0YXRlKGNvbXB1dGVkUXVhbGl0eSwgcGFzc3dvcmQubGVuZ3RoKCkpOworICAgICAgICAgICAgICAgICAgICBpbnQgbGV0dGVycyA9IDA7CisgICAgICAgICAgICAgICAgICAgIGludCB1cHBlcmNhc2UgPSAwOworICAgICAgICAgICAgICAgICAgICBpbnQgbG93ZXJjYXNlID0gMDsKKyAgICAgICAgICAgICAgICAgICAgaW50IG51bWJlcnMgPSAwOworICAgICAgICAgICAgICAgICAgICBpbnQgc3ltYm9scyA9IDA7CisgICAgICAgICAgICAgICAgICAgIGludCBub25sZXR0ZXIgPSAwOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHBhc3N3b3JkLmxlbmd0aCgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgYyA9IHBhc3N3b3JkLmNoYXJBdChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjID49ICdBJyAmJiBjIDw9ICdaJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldHRlcnMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cHBlcmNhc2UrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYyA+PSAnYScgJiYgYyA8PSAneicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXR0ZXJzKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG93ZXJjYXNlKys7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPj0gJzAnICYmIGMgPD0gJzknKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVycysrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vbmxldHRlcisrOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeW1ib2xzKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9ubGV0dGVyKys7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZHBtLnNldEFjdGl2ZVBhc3N3b3JkU3RhdGUoTWF0aC5tYXgocXVhbGl0eSwgY29tcHV0ZWRRdWFsaXR5KSwgcGFzc3dvcmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAubGVuZ3RoKCksIGxldHRlcnMsIHVwcGVyY2FzZSwgbG93ZXJjYXNlLCBudW1iZXJzLCBzeW1ib2xzLCBub25sZXR0ZXIpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBwYXNzd29yZCBpcyBub3QgYW55dGhpbmcuCiAgICAgICAgICAgICAgICAgICAgIGRwbS5zZXRBY3RpdmVQYXNzd29yZFN0YXRlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9VTlNQRUNJRklFRCwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX1VOU1BFQ0lGSUVELCAwLCAwLCAwLCAwLCAwLCAwLCAwKTsKICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gQWRkIHRoZSBwYXNzd29yZCB0byB0aGUgcGFzc3dvcmQgaGlzdG9yeS4gV2UgYXNzdW1lIGFsbAorICAgICAgICAgICAgICAgIC8vIHBhc3N3b3JkCisgICAgICAgICAgICAgICAgLy8gaGFzaGVzIGhhdmUgdGhlIHNhbWUgbGVuZ3RoIGZvciBzaW1wbGljaXR5IG9mIGltcGxlbWVudGF0aW9uLgorICAgICAgICAgICAgICAgIFN0cmluZyBwYXNzd29yZEhpc3RvcnkgPSBnZXRTdHJpbmcoUEFTU1dPUkRfSElTVE9SWV9LRVkpOworICAgICAgICAgICAgICAgIGlmIChwYXNzd29yZEhpc3RvcnkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBwYXNzd29yZEhpc3RvcnkgPSBuZXcgU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBwYXNzd29yZEhpc3RvcnlMZW5ndGggPSBnZXRSZXF1ZXN0ZWRQYXNzd29yZEhpc3RvcnlMZW5ndGgoKTsKKyAgICAgICAgICAgICAgICBpZiAocGFzc3dvcmRIaXN0b3J5TGVuZ3RoID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmRIaXN0b3J5ID0gIiI7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmRIaXN0b3J5ID0gbmV3IFN0cmluZyhoYXNoKSArICIsIiArIHBhc3N3b3JkSGlzdG9yeTsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ3V0IGl0IHRvIGNvbnRhaW4gcGFzc3dvcmRIaXN0b3J5TGVuZ3RoIGhhc2hlcworICAgICAgICAgICAgICAgICAgICAvLyBhbmQgcGFzc3dvcmRIaXN0b3J5TGVuZ3RoIC0xIGNvbW1hcy4KKyAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmRIaXN0b3J5ID0gcGFzc3dvcmRIaXN0b3J5LnN1YnN0cmluZygwLCBNYXRoLm1pbihoYXNoLmxlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcGFzc3dvcmRIaXN0b3J5TGVuZ3RoICsgcGFzc3dvcmRIaXN0b3J5TGVuZ3RoIC0gMSwgcGFzc3dvcmRIaXN0b3J5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmxlbmd0aCgpKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNldFN0cmluZyhQQVNTV09SRF9ISVNUT1JZX0tF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ZXJuYWwvd2lkZ2V0L1Bhc3N3b3JkRW50cnlLZXlib2FyZC5qYXZhCisrKyBiL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC93aWRnZXQvUGFzc3dvcmRFbnRyeUtleWJvYXJkLmphdmEKQEAgLTY3LDggKzY3LDIyIEBACiAgICAgICAgIHRoaXMoY29udGV4dCwgeG1sTGF5b3V0UmVzSWQsIDApOwogICAgIH0KIAorICAgIHB1YmxpYyBQYXNzd29yZEVudHJ5S2V5Ym9hcmQoQ29udGV4dCBjb250ZXh0LCBpbnQgeG1sTGF5b3V0UmVzSWQsIGludCB3aWR0aCwgaW50IGhlaWdodCkgeworICAgICAgICB0aGlzKGNvbnRleHQsIHhtbExheW91dFJlc0lkLCAwLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICB9CisKICAgICBwdWJsaWMgUGFzc3dvcmRFbnRyeUtleWJvYXJkKENvbnRleHQgY29udGV4dCwgaW50IHhtbExheW91dFJlc0lkLCBpbnQgbW9kZSkgewogICAgICAgICBzdXBlcihjb250ZXh0LCB4bWxMYXlvdXRSZXNJZCwgbW9kZSk7CisgICAgICAgIGluaXQoY29udGV4dCk7CisgICAgfQorCisgICAgcHVibGljIFBhc3N3b3JkRW50cnlLZXlib2FyZChDb250ZXh0IGNvbnRleHQsIGludCB4bWxMYXlvdXRSZXNJZCwgaW50IG1vZGUsCisgICAgICAgICAgICBpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCwgeG1sTGF5b3V0UmVzSWQsIG1vZGUsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICBpbml0KGNvbnRleHQpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0KENvbnRleHQgY29udGV4dCkgewogICAgICAgICBmaW5hbCBSZXNvdXJjZXMgcmVzID0gY29udGV4dC5nZXRSZXNvdXJjZXMoKTsKICAgICAgICAgbVJlcyA9IHJlczsKICAgICAgICAgbVNoaWZ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AgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1VQOgogICAgICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX0NBTkNFTDoKLSAgICAgICAgICAgICAgICAgICAgbVRyYWNraW5nID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIG1UcmlnZ2VyZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgbU90aGVyU2xpZGVyLnNob3codHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgIG1DdXJyZW50U2xpZGVyLnJlc2V0KGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRTbGlkZXIuaGlkZVRhcmdldCgpOwotICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFNsaWRlciA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIG1PdGhlclNsaWRlciA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIHNldEdyYWJiZWRTdGF0ZShPblRyaWdnZXJMaXN0ZW5lci5OT19IQU5ETEUpOworICAgICAgICAgICAgICAgICAgICBjYW5jZWxHcmFiKCk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC02MjMsNiArNjE4LDE3IEBACiAgICAgICAgIHJldHVybiBtVHJhY2tpbmcgfHwgc3VwZXIub25Ub3VjaEV2ZW50KGV2ZW50KTsKICAgICB9CiAKKyAgICBwcml2YXRlIHZvaWQgY2FuY2VsR3JhYigpIHsKKyAgICAgICAgbVRyYWNraW5nID0gZmFsc2U7CisgICAgICAgIG1UcmlnZ2VyZWQgPSBmYWxzZTsKKyAgICAgICAgbU90aGVyU2xpZGVyLnNob3codHJ1ZSk7CisgICAgICAgIG1DdXJyZW50U2xpZGVyLnJlc2V0KGZhbHNlKTsKKyAgICAgICAgbUN1cnJlbnRTbGlkZXIuaGlkZVRhcmdldCgpOworICAgICAgICBtQ3VycmVudFNsaWRlciA9I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JZOworICAgICAgICBpbnQgZHJhZ0Rpc3RhbmNlID0gKGludCkgTWF0aC5jZWlsKE1hdGguaHlwb3QoZGlzdFgsIGRpc3RZKSk7CisgICAgICAgIGRvdWJsZSB0b3VjaEEgPSBNYXRoLmF0YW4yKGRpc3RYLCBkaXN0WSk7CisgICAgICAgIGZsb2F0IHJpbmdYID0gKGZsb2F0KSAobUxvY2tDZW50ZXJYICsgbVJpbmdSYWRpdXMgKiBNYXRoLnNpbih0b3VjaEEpKTsKKyAgICAgICAgZmxvYXQgcmluZ1kgPSAoZmxvYXQpIChtTG9ja0NlbnRlclkgKyBtUmluZ1JhZGl1cyAqIE1hdGguY29zKHRvdWNoQSkpOworCisgICAgICAgIHN3aXRjaCAobUxvY2tTdGF0ZSkgeworICAgICAgICAgICAgY2FzZSBTVEFURV9SRVNFVF9MT0NLOgorICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIlN0YXRlIFJFU0VUX0xPQ0siKTsKKyAgICAgICAgICAgICAgICBtV2F2ZVRpbWVyRGVsYXkgPSBtV2F2ZURlbGF5OworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUxpZ2h0V2F2ZXMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgLy9Ud2Vlbk1heC50byhtTGlnaHRXYXZlLmdldChpKSwgLjMsIHthbHBoYTowLCBlYXNlOlF1aW50LmVhc2VPdXR9KTsKKyAgICAgICAgICAgICAgICAgICAgRHJhd2FibGVIb2xkZXIgaG9sZGVyID0gbUxpZ2h0V2F2ZXMuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICBob2xkZXIuYWRkQW5pbVRvKDMwMCwgMCwgImFscGhhIiwgMC4wZiwgZmFsc2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1MaWdodFdhdmVzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICA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ICAgICAgICAgICAgICBtVW5sb2NrRGVmYXVsdC5yZW1vdmVBbmltYXRpb25Gb3IoInkiKTsKKyAgICAgICAgICAgICAgICBtVW5sb2NrRGVmYXVsdC5yZW1vdmVBbmltYXRpb25Gb3IoInNjYWxlWCIpOworICAgICAgICAgICAgICAgIG1VbmxvY2tEZWZhdWx0LnJlbW92ZUFuaW1hdGlvbkZvcigic2NhbGVZIik7CisgICAgICAgICAgICAgICAgbVVubG9ja0RlZmF1bHQucmVtb3ZlQW5pbWF0aW9uRm9yKCJhbHBoYSIpOworICAgICAgICAgICAgICAgIG1VbmxvY2tEZWZhdWx0LnNldFgobUxvY2tDZW50ZXJYKS5zZXRZKG1Mb2NrQ2VudGVyWSkuc2V0U2NhbGVYKDAuMWYpLnNldFNjYWxlWSgwLjFmKQorICAgICAgICAgICAgICAgICAgICAgICAgLnNldEFscGhhKDAuMGYpOworCisgICAgICAgICAgICAgICAgLy9Ud2Vlbk1heC50byh1bmxvY2tEZWZhdWx0LCAuNSwgeyBkZWxheTogLjEsIHNjYWxlWDogMSwgc2NhbGVZOiAxLAorICAgICAgICAgICAgICAgIC8vIGFscGhhOiAxLCBvdmVyd3JpdGU6IHRydWUsIGVhc2U6UXVpbnQuZWFzZU91dCAgIH0pOworICAgICAgICAgICAgICAgIG1VbmxvY2tEZWZhdWx0LmFkZEFuaW1UbyhEVVJBVElPTiwgU0hPUlRfREVMQVksICJzY2FsZVgiLCAxLjBmLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBtVW5sb2NrRGVmYXVsdC5hZGRBbmltVG8oRFVSQVRJT04sIFNIT1JUX0RFTEFZLCAic2NhbGVZIiwgMS4wZiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgbVVubG9ja0RlZmF1bHQuYWRkQW5pbVRvKERVUkFUSU9OLCBTSE9SVF9ERUxBWSwgImFscGhhIiwgMS4wZiwgdHJ1ZSk7CisKKyAgICAgICAgICAgICAgICAvL1R3ZWVuTWF4LnRvKHVubG9ja0hhbG8sIDAsIHsgeDogbG9ja1gsIHk6IGxvY2tZLCBzY2FsZVg6LjEsIHNjYWxlWTogLjEsCisgICAgICAgICAgICAgICAgLy8gYWxwaGE6IDAgICwgb3ZlcndyaXRlOiB0cnVlICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICBtVW5sb2NrSGFsby5yZW1vdmVBbmltYXRpb25Gb3IoIngiKTsKKyAgICAgICAgICAgICAgICBtVW5sb2NrSGFsby5yZW1vdmVBbmltYXRpb25Gb3IoInkiKTsKKyAgICAgICAgICAgICAgICBtVW5sb2NrSGFsby5yZW1vdmVBbmltYXRpb25Gb3IoInNjYWxlWCIpOworICAgICAgICAgICAgICAgIG1VbmxvY2tIYWxvLnJlbW92ZUFuaW1hdGlvbkZvcigic2NhbGVZIik7CisgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8ucmVtb3ZlQW5pbWF0aW9uRm9yKCJhbHBoYSIpOworICAgICAgICAgICAgICAgIG1VbmxvY2tIYWxvLnNldFgobUxvY2tDZW50ZXJYKS5zZXRZKG1Mb2NrQ2VudGVyWSkuc2V0U2NhbGVYKDAuMWYpLnNldFNjYWxlWSgwLjFmKQorICAgICAgICAgICAgICAgICAgICAgICAgLnNldEFscGhhKDAuMGYpOworCisgICAgICAgICAgICAgICAgLy9Ud2Vlbk1heC50byh1bmxvY2tIYWxvLCAuNSwgeyB4OiBsb2NrWCwgeTogbG9ja1ksIHNjYWxlWDogMSwgc2NhbGVZOiAxLAorICAgICAgICAgICAgICAgIC8vIGFscGhhOiAxICAsIG92ZXJ3cml0ZTogdHJ1ZSwgZWFzZTpRdWludC5lYXNlT3V0ICAgfSk7CisgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKERVUkFUSU9OLCBTSE9SVF9ERUxBWSwgIngiLCBtTG9ja0NlbnRlclgsIHRydWUpOworICAgICAgICAgICAgICAgIG1VbmxvY2tIYWxvLmFkZEFuaW1UbyhEVVJBVElPTiwgU0hPUlRfREVMQVksICJ5IiwgbUxvY2tDZW50ZXJZLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBtVW5sb2NrSGFsby5hZGRBbmltVG8oRFVSQVRJT04sIFNIT1JUX0RFTEFZLCAic2NhbGVYIiwgMS4wZiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKERVUkFUSU9OLCBTSE9SVF9ERUxBWSwgInNjYWxlWSIsIDEuMGYsIHRydWUpOworICAgICAgICAgICAgICAgIG1VbmxvY2tIYWxvLmFkZEFuaW1UbyhEVVJBVElPTiwgU0hPUlRfREVMQVksICJhbHBoYSIsIDEuMGYsIHRydWUpOworCisgICAgICAgICAgICAgICAgLy9sb2NrVGltZXIuc3RvcCgpOworICAgICAgICAgICAgICAgIHJlbW92ZUNhbGxiYWNrcyhtTG9ja1RpbWVyQWN0aW9ucyk7CisKKyAgICAgICAgICAgICAgICBtTG9ja1N0YXRlID0gU1RBVEVfUkVBRFk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgU1RBVEVfUkVBRFk6CisgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiU3RhdGUgUkVBRFkiKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBTVEFURV9TVEFSVF9BVFRFTVBUOgorICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIlN0YXRlIFNUQVJUX0FUVEVNUFQiKTsKKyAgICAgICAgICAgICAgICAvL1R3ZWVuTWF4LnRvKHVubG9ja0RlZmF1bHQsIDAsIHtzY2FsZVg6IC4xLCBzY2FsZVk6LjEsIGFscGhhOiAwLAorICAgICAgICAgICAgICAgIC8vIHg6bG9ja1ggKzE4MiwgeTogbG9ja1kgICwgb3ZlcndyaXRlOiB0cnVlICAgfSk7CisgICAgICAgICAgICAgICAgbVVubG9ja0RlZmF1bHQucmVtb3Zl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Sk7CisKKyAgICAgICAgICAgICAgICAvL1R3ZWVuTWF4LnRvKHVubG9ja1JpbmcsIDAuNSwge3NjYWxlWDogMSwgc2NhbGVZOiAxLAorICAgICAgICAgICAgICAgIC8vIGFscGhhOiAxLCBlYXNlOlF1aW50LmVhc2VPdXQsIG92ZXJ3cml0ZTogdHJ1ZSAgIH0pOworICAgICAgICAgICAgICAgIG1VbmxvY2tSaW5nLmFkZEFuaW1UbyhEVVJBVElPTiwgMCwgInNjYWxlWCIsIDEuMGYsIHRydWUpOworICAgICAgICAgICAgICAgIG1VbmxvY2tSaW5nLmFkZEFuaW1UbyhEVVJBVElPTiwgMCwgInNjYWxlWSIsIDEuMGYsIHRydWUpOworICAgICAgICAgICAgICAgIG1VbmxvY2tSaW5nLmFkZEFuaW1UbyhEVVJBVElPTiwgMCwgImFscGhhIiwgMS4wZiwgdHJ1ZSk7CisKKyAgICAgICAgICAgICAgICBwb3N0RGVsYXllZChtQWRkV2F2ZUFjdGlvbiwgbVdhdmVUaW1lckRlbGF5KTsKKworICAgICAgICAgICAgICAgIG1Mb2NrU3RhdGUgPSBTVEFURV9BVFRFTVBUSU5HOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIFNUQVRFX0FUVEVNUFRJTkc6CisgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiU3RhdGUgQVRURU1QVElORyIpOworICAgICAgICAgICAgICAgIC8vVHdlZW5NYXgudG8odW5sb2NrSGFsbywgMC40LCB7IHg6bW91c2VYLCB5Om1vdXNlWSwgc2NhbGVYOjEsIHNjYWxlWToxLAorICAgICAgICAgICAgICAgIC8vIGFscGhhOiAxLCBlYXNlOlF1aW50LmVhc2VPdXQgfSk7CisgICAgICAgICAgICAgICAgaWYgKGRyYWdEaXN0YW5jZSA+IG1TbmFwUmFkaXVzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChmaW5nZXJEb3duKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL1R3ZWVuTWF4LnRvKHVubG9ja0hhbG8sIDAuNCwge3g6cmluZ1gsIHk6cmluZ1ksIHNjYWxlWDoxLCBzY2FsZVk6MSwKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFscGhhOiAxICwgZWFzZTpRdWludC5lYXNlT3V0ICAgICwgb3ZlcndyaXRlOiB0cnVlIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKDAsIDAsICJ4IiwgcmluZ1gsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKDAsIDAsICJ5IiwgcmluZ1ksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKDAsIDAsICJzY2FsZVgiLCAxLjBmLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tIYWxvLmFkZEFuaW1UbygwLCAwLCAic2NhbGVZIiwgMS4wZiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVW5sb2NrSGFsby5hZGRBbmltVG8oMCwgMCwgImFscGhhIiwgMS4wZiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0gIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbUxvY2tTdGF0ZSA9IFNUQVRFX1VOTE9DS19BVFRFTVBUOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKDAsIDAsICJ4IiwgbW91c2VYLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKDAsIDAsICJ5IiwgbW91c2VZLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKDAsIDAsICJzY2FsZVgiLCAxLjBmLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKDAsIDAsICJzY2FsZVkiLCAxLjBmLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0hhbG8uYWRkQW5pbVRvKDAsIDAsICJhbHBoYSIsIDEuMGYsIHRydWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBTVEFURV9VTkxPQ0tfQVRURU1QVDoKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cudihUQUcsICJTdGF0ZSBVTkxPQ0tfQVRURU1QVCIpOworICAgICAgICAgICAgICAgIGlmIChkcmFnRGlzdGFuY2UgPiBtU25hcFJhZGl1cykgeworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBuID0gMDsgbiA8IG1MaWdodFdhdmVzLnNpemUoKTsgbisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL1R3ZWVuTWF4LnRvKHRoaXNbImxpZ2h0V2F2ZSIrbl0sIC41LHthbHBoYTowLCBkZWxheTogKDYrbi1jdXJyZW50V2F2ZSkqLjEsCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB4OnJpbmdYLCB5OnJpbmdZLCBzY2FsZVg6IC4xLCBzY2FsZVk6IC4xLCBlYXNlOlF1aW50LmVhc2VPdXR9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIERyYXdhYmxlSG9sZGVyIHdhdmUgPSBtTGlnaHRXYXZlcy5nZXQobik7CisgICAgICAgICAgICAgICAgICAgICAgICBsb25nIGRlbGF5ID0gMTAwMEwqKDYgKyBuIC0gbUN1cnJlbnRXYXZlKS8xMEw7CisgICAgICAgICAgICAgICAgICAgICAgICB3YXZlLmFkZEFuaW1UbyhEVVJBVElPTiwgZGVsYXksICJ4IiwgcmluZ1gsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgd2F2ZS5hZGRBbmltVG8oRFVSQVRJT04sIGRlbGF5LCAieSIsIHJpbmdZLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdhdmUuYWRkQW5pbVRvKERVUkFUSU9OLCBkZWxheSwgInNjYWxlWCIsIDAuMWYsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgd2F2ZS5hZGRBbmltVG8oRFVSQVRJT04sIGRlbGF5LCAic2NhbGVZIiwgMC4xZiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB3YXZlLmFkZEFuaW1UbyhEVVJBVElPTiwgZGVsYXksICJhbHBoYSIsIDAuMGYsIHRydWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUxpZ2h0V2F2ZXMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1MaWdodFdhdmVzLmdldChpKS5zdGFydEFuaW1hdGlvbnModGhpcyk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvL1R3ZWVuTWF4LnRvKHVubG9ja1JpbmcsIC41LCB7eDpyaW5nWCwgeTogcmluZ1ksIHNjYWxlWDogLjEsIHNjYWxlWTogLjEsCisgICAgICAgICAgICAgICAgICAgIC8vIGFscGhhOiAwLCBlYXNlOiBRdWludC5lYXNlT3V0ICAgfSk7CisgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tSaW5nLmFkZEFuaW1UbyhEVVJBVElPTiwgMCwgIngiLCByaW5nWCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBtVW5sb2NrUmluZy5hZGRBbmltVG8oRFVSQVRJT04sIDAsICJ5IiwgcmluZ1ksIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja1JpbmcuYWRkQW5pbVRvKERVUkFUSU9OLCAwLCAic2NhbGVYIiwgMC4xZiwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBtVW5sb2NrUmluZy5hZGRBbmltVG8oRFVSQVRJT04sIDAsICJzY2FsZVkiLCAwLjFmLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tSaW5nLmFkZEFuaW1UbyhEVVJBVElPTiwgMCwgImFscGhhIiwgMC4wZiwgZmFsc2UpOworCisgICAgICAgICAgICAgICAgICAgIC8vVHdlZW5NYXgudG8odW5sb2NrUmluZywgLjUsIHsgZGVsYXk6IDEuMywgYWxwaGE6IDAgICwgZWFzZTogUXVpbnQuZWFzZU91dCB9KTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja1JpbmcuYWRkQW5pbVRvKERVUkFUSU9OLCBGSU5BTF9ERUxBWSwgImFscGhhIiwgMC4wZiwgZmFsc2UpOworCisgICAgICAgICAgICAgICAgICAgIC8vVHdlZW5NYXgudG8odW5sb2NrRGVmYXVsdCwgMCwgeyB4OnJpbmdYLCB5OiByaW5nWSwgc2NhbGVYOiAuMSwgc2NhbGVZOiAuMSwKKyAgICAgICAgICAgICAgICAgICAgLy8gYWxwaGE6IDAgICwgb3ZlcndyaXRlOiB0cnVlIH0pOworICAgICAgICAgICAgICAgICAgICBtVW5sb2NrRGVmYXVsdC5yZW1vdmVBbmltYXRpb25Gb3IoIngiKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0RlZmF1bHQucmVtb3ZlQW5pbWF0aW9uRm9yKCJ5Iik7CisgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tEZWZhdWx0LnJlbW92ZUFuaW1hdGlvbkZvcigic2NhbGVYIik7CisgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tEZWZhdWx0LnJlbW92ZUFuaW1hdGlvbkZvcigic2NhbGVZIik7CisgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tEZWZhdWx0LnJlbW92ZUFuaW1hdGlvbkZvcigiYWxwaGEiKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0RlZmF1bHQuc2V0WChyaW5nWCkuc2V0WShyaW5nWSkuc2V0U2NhbGVYKDAuMWYpLnNldFNjYWxlWSgwLjFmKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRBbHBoYSgwLjBmKTsKKworICAgICAgICAgICAgICAgICAgICAvL1R3ZWVuTWF4LnRvKHVubG9ja0RlZmF1bHQsIC41LCB7IHg6cmluZ1gsIHk6IHJpbmdZLCBzY2FsZVg6IDEsIHNjYWxlWTogMSwKKyAgICAgICAgICAgICAgICAgICAgLy8gYWxwaGE6IDEgICwgZWFzZTogUXVpbnQuZWFzZU91dCAgLCBvdmVyd3JpdGU6IHRydWUgfSk7CisgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tEZWZhdWx0LmFkZEFuaW1UbyhEVVJBVElPTiwgMCwgIngiLCByaW5nWCwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tEZWZhdWx0LmFkZEFuaW1UbyhEVVJBVElPTiwgMCwgInkiLCByaW5nWSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tEZWZhdWx0LmFkZEFuaW1UbyhEVVJBVElPTiwgMCwgInNjYWxlWCIsIDEuMGYsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBtVW5sb2NrRGVmYXVsdC5hZGRBbmltVG8oRFVSQVRJT04sIDAsICJzY2FsZVkiLCAxLjBmLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0RlZmF1bHQuYWRkQW5pbVRvKERVUkFUSU9OLCAwLCAiYWxwaGEiLCAxLjBmLCB0cnVlKTsKKworICAgICAgICAgICAgICAgICAgICAvL1R3ZWVuTWF4LnRvKHVubG9ja0RlZmF1bHQsIC41LCB7IGRlbGF5OiAxLjMsIHNjYWxlWDogMywgc2NhbGVZOiAzLAorICAgICAgICAgICAgICAgICAgICAvLyBhbHBoYTogMSwgZWFzZTogUXVpbnQuZWFzZU91dCB9KTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0RlZmF1bHQuYWRkQW5pbVRvKERVUkFUSU9OLCBGSU5BTF9ERUxBWSwgInNjYWxlWCIsIDMuMGYsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0RlZmF1bHQuYWRkQW5pbVRvKERVUkFUSU9OLCBGSU5BTF9ERUxBWSwgInNjYWxlWSIsIDMuMGYsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgbVVubG9ja0RlZmF1bHQuYWRkQW5pbVRvKERVUkFUSU9OLCBGSU5BTF9ERUxBWSwgImFscGhhIiwgMS4wZiwgZmFsc2UpOworCisgICAgICAgICAgICAgICAgICAgIC8vVHdlZW5NYXgudG8odW5sb2NrSGFsbywgLjUsIHsgeDpyaW5nWCwgeTogcmluZ1kgLCBlYXNlOiBCYWNrLmVhc2VPdXQgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIG1VbmxvY2tIYWxvLmFkZEFuaW1UbyhEVVJBVElPTiwgMCwgIngiLCByaW5nWCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBtVW5sb2NrSGFsby5hZGRBbmltVG8oRFVSQVRJT04sIDAsICJ5IiwgcmluZ1ksIGZhbHNlKTsKKworICAgICAgICAgICAgICAgICAgICAvL1R3ZWVuTWF4LnRvKHVubG9ja0hhbG8sIC41LCB7IGRlbGF5OiAxLjMsIHNjYWxlWDogMywgc2NhbGVZOiAzLAorICAgICAgICAgICAgICAgICAgICAvLyBhbHBoYTogMSwgZWFzZTogUXVpbnQuZWFzZU91dCAgIH0pOworICAgICAgICAgICAgICAgICAgICBtVW5sb2NrSGFsby5hZGRBbmltVG8oRFVSQVRJT04sIEZJTkFMX0RFTEFZLCAic2NhbGVYIiwgMy4wZiwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBtVW5sb2NrSGFsby5hZGRBbmltVG8oRFVSQVRJT04sIEZJTkFMX0RFTEFZLCAic2NhbGVZIiwgMy4wZiwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBtVW5sb2NrSGFsby5hZGRBbmltVG8oRFVSQVRJT04sIEZJTkFMX0RFTEFZLCAiYWxwaGEiLCAxLjBmLCBmYWxzZSk7CisKKyAgICAgICAgICAgICAgICAgICAgcmVtb3ZlQ2FsbGJhY2tzKG1Mb2NrVGltZXJBY3Rpb25zKTsKKworICAgICAgICAgICAgICAgICAgICBwb3N0RGVsYXllZChtTG9ja1RpbWVyQWN0aW9ucywgUkVTRVRfVElNRU9VVCk7CisKKyAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2hUcmlnZ2VyRXZlbnQoT25UcmlnZ2VyTGlzdGVuZXIuQ0VOVEVSX0hBTkRMRSk7CisgICAgICAgICAgICAgICAgICAgIG1Mb2NrU3RhdGUgPSBTVEFURV9VTkxPQ0tfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtTG9ja1N0YXRlID0gU1RBVEVfUkVTRVRfTE9DSzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgU1RBVEVfVU5MT0NLX1NVQ0NFU1M6CisgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiU3RhdGUgVU5MT0NLX1NVQ0NFU1MiKTsKKyAgICAgICAgICAgICAgICByZW1vdmVDYWxsYmFja3MobUFkZFdhdmVBY3Rpb24pOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIlVua25vd24gc3RhdGUgIiArIG1Mb2NrU3RhdGUpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIG1VbmxvY2tEZWZhdWx0LnN0YXJ0QW5pbWF0aW9ucyh0aGlzKTsKKyAgICAgICAgbVVubG9ja0hhbG8uc3RhcnRBbmltYXRpb25zKHRoaXMpOworICAgICAgICBtVW5sb2NrUmluZy5zdGFydEFuaW1hdGlvbnModGhpcyk7CisgICAgfQorCisgICAgQml0bWFwRHJhd2FibGUgY3JlYXRlRHJhd2FibGUoaW50IHJlc0lkKSB7CisgICAgICAgIFJlc291cmNlcyByZXMgPSBnZXRSZXNvdXJjZXMoKTsKKyAgICAgICAgQml0bWFwIGJpdG1hcCA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlUmVzb3VyY2UocmVzLCByZXNJZCk7CisgICAgICAgIHJldHVybiBuZXcgQml0bWFwRHJhd2FibGUocmVzLCBiaXRtYXApOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgIHdhdmVVcGRhdGVGcmFtZShtTW91c2VYLCBtTW91c2VZLCBtRmluZ2VyRG93bik7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbURyYXdhYmxlcy5zaXplKCk7ICsraSkgeworICAgICAgICAgICAgbURyYXdhYmxlcy5nZXQoaSkuZHJhdyhjYW52YXMpOworICAgICAgICB9CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUxpZ2h0V2F2ZXMuc2l6ZSgpOyArK2kpIHsKKyAgICAgICAgICAgIG1MaWdodFdhdmVzLmdldChpKS5kcmF3KGNhbnZhcyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIFJ1bm5hYmxlIG1Mb2NrVGltZXJBY3Rpb25zID0gbmV3IFJ1bm5hYmxlKCkgeworICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cudihUQUcsICJMb2NrVGltZXJBY3Rpb25zIik7CisgICAgICAgICAgICAvLyByZXNldCBsb2NrIGFmdGVyIGluYWN0aXZpdHkKKyAgICAgICAgICAgIGlmIChtTG9ja1N0YXRlID09IFNUQVRFX0FUVEVNUFRJTkcpIHsKKyAgICAgICAgICAgICAgICBtTG9ja1N0YXRlID0gU1RBVEVfUkVTRVRfTE9DSzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIGZvciBwcm90b3R5cGUsIHJlc2V0IGFmdGVyIHN1Y2Nlc3NmdWwgdW5sb2NrCisgICAgICAgICAgICBpZiAobUxvY2tTdGF0ZSA9PSBTVEFURV9VTkxPQ0tfU1VDQ0VTUykgeworICAgICAgICAgICAgICAgIG1Mb2NrU3RhdGUgPSBTVEFURV9SRVNFVF9MT0NLOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaW52YWxpZGF0ZSgpOworICAgICAgICB9CisgICAgfTsKKworICAgIHByaXZhdGUgZmluYWwgUnVubmFibGUgbUFkZFdhdmVBY3Rpb24gPSBuZXcgUnVubmFibGUoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIGRvdWJsZSBkaXN0WCA9IG1Nb3VzZVggLSBtTG9ja0NlbnRlclg7CisgICAgICAgICAgICBkb3VibGUgZGlzdFkgPSBtTW91c2VZIC0gbUxvY2tDZW50ZXJZOworICAgICAgICAgICAgaW50IGRyYWdEaXN0YW5jZSA9IChpbnQpIE1hdGguY2VpbChNYXRoLmh5cG90KGRpc3RYLCBkaXN0WSkpOworICAgICAgICAgICAgaWYgKG1Mb2NrU3RhdGUgPT0gU1RBVEVfQVRURU1QVElORyAmJiBkcmFnRGlzdGFuY2UgPCBtU25hcFJhZGl1cworICAgICAgICAgICAgICAgICAgICAmJiBtV2F2ZVRpbWVyRGVsYXkgPj0gbVdhdmVEZWxheSkgeworICAgICAgICAgICAgICAgIG1XYXZlVGltZXJEZWxheSA9IE1hdGgubWluKFdBVkVfRFVSQVRJT04sIG1XYXZlVGltZXJEZWxheSArIERFTEFZX0lOQ1JFTUVOVCk7CisKKyAgICAgICAgICAgICAgICBEcmF3YWJsZUhvbGRlciB3YXZlID0gbUxpZ2h0V2F2ZXMuZ2V0KG1DdXJyZW50V2F2ZSk7CisgICAgICAg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W50LmVhc2VPdXR9KTsKKyAgICAgICAgICAgICAgICB3YXZlLmFkZEFuaW1UbygxMDAwLCBGSU5BTF9ERUxBWSwgImFscGhhIiwgMC4wZiwgZmFsc2UpOworICAgICAgICAgICAgICAgIHdhdmUuc3RhcnRBbmltYXRpb25zKFdhdmVWaWV3LnRoaXMpOworCisgICAgICAgICAgICAgICAgbUN1cnJlbnRXYXZlID0gKG1DdXJyZW50V2F2ZSsxKSAlIG1XYXZlQ291bnQ7CisgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiV2F2ZVRpbWVyRGVsYXk6IHN0YXJ0IG5ldyB3YXZlIGluICIgKyBtV2F2ZVRpbWVyRGVsYXkpOworICAgICAgICAgICAgICAgIHBvc3REZWxheWVkKG1BZGRXYXZlQWN0aW9uLCBtV2F2ZVRpbWVyRGVsYXkpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtV2F2ZVRpbWVyRGVsYXkgKz0gREVMQVlfSU5DUkVNRU5UMjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvblRvdWNoRXZlbnQoTW90aW9uRXZlbnQgZXZlbnQpIHsKKyAgICAgICAgZmluYWwgaW50IGFjdGlvbiA9IGV2ZW50LmdldEFjdGlvbigpOworICAgICAgICBtTW91c2VYID0gZXZlbnQuZ2V0WCgpOworICAgICAgICBtTW91c2VZID0gZXZlbnQuZ2V0WSgpOworICAgICAgICBib29sZWFuIGhhbmRsZWQgPSBmYWxzZTsKKyAgICAgICAgc3dpdGNoIChhY3Rpb24pIHsKKyAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX0RPV046CisgICAgICAgICAgICAgICAgcmVtb3ZlQ2FsbGJhY2tzKG1Mb2NrVGltZXJBY3Rpb25zKTsKKyAgICAgICAgICAgICAgICBtRmluZ2VyRG93biA9IHRydWU7CisgICAgICAgICAgICAgICAgc2V0R3JhYmJlZFN0YXRlKE9uVHJpZ2dlckxpc3RlbmVyLkNFTlRFUl9IQU5ETEUpOworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgeCA9IG1Nb3VzZVggLSBtVW5sb2NrSGFsby5nZXRYKCk7CisgICAgICAgICAgICAgICAgICAgIGZsb2F0IHkgPSBtTW91c2VZIC0gbVVubG9ja0hhbG8uZ2V0WSgpOworICAgICAgICAgICAgICAgICAgICBmbG9hdCBkaXN0ID0gKGZsb2F0KSBNYXRoLmh5cG90KHgsIHkpOworICAgICAgICAgICAgICAgICAgICBpZiAoZGlzdCA8IG1VbmxvY2tIYWxvLmdldFdpZHRoKCkqMC41ZikgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Mb2NrU3RhdGUgPT0gU1RBVEVfUkVBRFkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTG9ja1N0YXRlID0gU1RBVEVfU1RBUlRfQVRURU1QVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRToKKyAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fVVA6CisgICAgICAgICAgICAgICAgbUZpbmdlckRvd24gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBwb3N0RGVsYXllZChtTG9ja1RpbWVyQWN0aW9ucywgUkVTRVRfVElNRU9VVCk7CisgICAgICAgICAgICAgICAgc2V0R3JhYmJlZFN0YXRlKE9uVHJpZ2dlckxpc3RlbmVyLk5PX0hBTkRMRSk7CisgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX0NBTkNFTDoKKyAgICAgICAgICAgICAgICBtRmluZ2VyRG93biA9IGZhbHNlOworICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgcmV0dXJuIGhhbmRsZWQgPyB0cnVlIDogc3VwZXIub25Ub3VjaEV2ZW50KGV2ZW50KTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUcmlnZ2VycyBoYXB0aWMgZmVlZGJhY2suCisgICAgICovCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCB2aWJyYXRlKGxvbmcgZHVyYXRpb24pIHsKKyAgICAgICAgaWYgKG1WaWJyYXRvciA9PSBudWxsKSB7CisgICAgICAgICAgICBtVmlicmF0b3IgPSAoYW5kcm9pZC5vcy5WaWJyYXRvcikKKyAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5WSUJSQVRPUl9TRVJWSUNFKTsKKyAgICAgICAgfQorICAgICAgICBtVmlicmF0b3IudmlicmF0ZShkdXJhdGlvbik7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVnaXN0ZXJzIGEgY2FsbGJhY2sgdG8gYmUgaW52b2tlZCB3aGVuIHRoZSB1c2VyIHRyaWdnZXJzIGFuIGV2ZW50LgorICAgICAqCisgICAgICogQHBhcmFtIGxpc3RlbmVyIHRoZSBPbkRpYWxUcmlnZ2VyTGlzdGVuZXIgdG8gYXR0YWNoIHRvIHRoaXMgdmlldworICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldE9uVHJpZ2dlckxpc3RlbmVyKE9uVHJpZ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JhYmJlZFN0YXRlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnRlcmZhY2UgT25UcmlnZ2VyTGlzdGVuZXIgeworICAgICAgICAvKioKKyAgICAgICAgICogU2VudCB3aGVuIHRoZSB1c2VyIHJlbGVhc2VzIHRoZSBoYW5kbGUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBOT19IQU5ETEUgPSAwOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZW50IHdoZW4gdGhlIHVzZXIgZ3JhYnMgdGhlIGNlbnRlciBoYW5kbGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IENFTlRFUl9IQU5ETEUgPSAxMDsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ2FsbGVkIHdoZW4gdGhlIHVzZXIgZHJhZ3MgdGhlIGNlbnRlciByaW5nIGJleW9uZCBhIHRocmVzaG9sZC4KKyAgICAgICAgICovCisgICAgICAgIHZvaWQgb25UcmlnZ2VyKFZpZXcgdiwgaW50IHdoaWNoSGFuZGxlKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ2FsbGVkIHdoZW4gdGhlICJncmFiYmVkIHN0YXRlIiBjaGFuZ2VzIChpLmUuIHdoZW4gdGhlIHVzZXIgZWl0aGVyIGdyYWJzIG9yIHJlbGVhc2VzCisgICAgICAgICAqIG9uZSBvZiB0aGUgaGFuZGxlcy4pCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSB2IHRoZSB2aWV3IHRoYXQgd2FzIHRyaWdnZXJlZAorICAgICAgICAgKiBAcGFyYW0gZ3JhYmJlZFN0YXRlIHRoZSBuZXcgc3RhdGU6IHtAbGluayAjTk9fSEFORExFfSwge0BsaW5rICNDRU5URVJfSEFORExFfSwKKyAgICAgICAgICovCisgICAgICAgIHZvaWQgb25HcmFiYmVkU3RhdGVDaGFuZ2UoVmlldyB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vd3MgaXMgJWQsIGNodW5rTnVtIGlzICVkLCBjaHVua1BvcyBpcyAlZCIsIG1IZWFkZXItPm51bVJvd3MsIGNodW5rTnVtLCBjaHVua1Bvcyk7Ci0gICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjaHVua051bTsgaSsrKSB7Ci0gICAgICAgIHVpbnQzMl90IG5leHRDaHVua09mZnNldCA9ICooKHVpbnQzMl90ICopKG1EYXRhICsgY2h1bmtQdHJPZmZzZXQpKTsKLUxPR19XSU5ET1coIm5leHRDaHVua09mZnNldCBpcyAlZCIsIG5leHRDaHVua09mZnNldCk7Ci0gICAgICAgIGlmIChuZXh0Q2h1bmtPZmZzZXQgPT0gMCkgewotICAgICAgICAgICAgLy8gQWxsb2NhdGUgYSBuZXcgcm93IGNodW5rCi0gICAgICAgICAgICBuZXh0Q2h1bmtPZmZzZXQgPSBhbGxvYyhST1dfU0xPVF9DSFVOS19TSVpFLCB0cnVlKTsKLSAgICAgICAgICAgIGlmIChuZXh0Q2h1bmtPZmZzZXQgPT0gMCkgewotICAgICAgICAgICAgICAgIHJldHVybiBOVUxMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcm93Q2h1bmsgPSBvZmZzZXRUb1B0cihuZXh0Q2h1bmtPZmZzZXQpOwotTE9HX1dJTkRPVygiYWxsb2NhdGVkIG5ldyBjaHVuayBhdCAlZCwgcm93Q2h1bmsgPSAlcCIsIG5leHRDaHVua09mZnNldCwgcm93Q2h1bmspOwotICAgICAgICAgICAgKigodWludDMyX3QgKikobURhdGEgKyBjaHVua1B0ck9mZnNldCkpID0gcm93Q2h1bmsgLSBtRGF0YTsKLSAgICAgICAgICAgIC8vIE1hcmsgdGhlIG5ldyBjaHVuaydzIG5leHQgJ3BvaW50ZXInIGFzIG51bGwKLSAgICAgICAgICAgICooKHVpbnQzMl90ICopKHJvd0NodW5rICsgUk9XX1NMT1RfQ0hVTktfU0laRSAtIHNpemVvZih1aW50MzJfdCkpKSA9IDA7Ci0gICAgICAg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ZmVyIHRvIGFsbCByb3dzLiBFYWNoIHJvdyBkaXJlY3RvcnkgaGFzIGEKLSAqIGZpZWxkX3Nsb3RfdCBwZXIgY29sdW1uLCB3aGljaCBoYXMgdGhlIHNpemUsIG9mZnNldCwgYW5kIHR5cGUgb2YgdGhlIGRhdGEgZm9yIHRoYXQgZmllbGQuCi0gKiBOb3RlIHRoYXQgdGhlIGRhdGEgdHlwZXMgY29tZSBmcm9tIHNxbGl0ZTMuaC4KLSAqLwotY2xhc3MgQ3Vyc29yV2luZG93Ci17Ci1wdWJsaWM6Ci0gICAgICAgICAgICAgICAgICAgICAgICBDdXJzb3JXaW5kb3coc2l6ZV90IG1heFNpemUpOwotICAgICAgICAgICAgICAgICAgICAgICAgQ3Vyc29yV2luZG93KCl7fQotICAgIGJvb2wgICAgICAgICAgICAgICAgc2V0TWVtb3J5KGNvbnN0IHNwPElNZW1vcnk+Jik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB+Q3Vyc29yV2luZG93KCk7Ci0KLSAgICBib29sICAgICAgICAgICAgICAgIGluaXRCdWZmZXIoYm9vbCBsb2NhbE9ubHkpOwotICAgIHNwPElNZW1vcnk+ICAgICAgICAgZ2V0TWVtb3J5KCkge3JldHVybiBtTWVtb3J5O30KLQotICAgIHNpemVfdCAgICAgICAgICAgICAgc2l6ZSgpIHtyZXR1cm4gbVNpemU7fQotICAgIHVpbnQ4X3QgKiAgICAgICAgICAgZGF0YSgpIHtyZXR1cm4gbURhdGE7fQotICAgIHVpbnQzMl90ICAgICAgICAgICAgZ2V0TnVtUm93cygpIHtyZXR1cm4gbUhlYWRlci0+bnVtUm93czt9Ci0gICAgdWludDMyX3QgICAgICAgICAgICBnZXROdW1Db2x1bW5zKCkge3JldHVybiBtSGVhZGVyLT5udW1Db2x1bW5zO30KLSAgICB2b2lkICAgICAgICAgICAgICAgIGZyZWVMYXN0Um93KCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtSGVhZGVyLT5udW1Sb3dzID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZGVyLT5udW1Sb3dzLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgIGJvb2wgICAgICAgICAgICAgICAgc2V0TnVtQ29sdW1ucyh1aW50MzJfdCBudW1Db2x1bW5zKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY3VyID0gbUhlYWRlci0+bnVtQ29sdW1uczsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1ciA+IDAgJiYgY3VyICE9IG51bUNvbHVtbnMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExPR0UoIlRyeWluZyB0byBnbyBmcm9tICVkIGNvbHVtbnMgdG8gJWQiLCBjdXIsIG51bUNvbHVtbnMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkZXItPm51bUNvbHVtbnMgPSBudW1Db2x1bW5zOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICBpbnQzMl90ICAgICAgICAgICAgIGZyZWVTcGFjZSgpOwotCi0gICAgdm9pZCAgICAgICAgICAgICAgICBjbGVhcigpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIEFsbG9jYXRlIGEgcm93IHNsb3QgYW5kIGl0cyBkaXJlY3RvcnkuIFRoZSByZXR1cm5lZAotICAgICAgICAgICAgICAgICAgICAgICAgICogcG9pbnRlciBwb2ludHMgdG8gdGhlIGJlZ2luaW5nIG9mIHRoZSByb3cncyBkaXJlY3RvcnkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIG9yIE5VTEwgaWYgdGhlcmUgd2Fzbid0IHJvb20uIFRoZSBkaXJlY3RvcnkgaXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIGluaXRpYWxpZWQgd2l0aCBOVUxMIGVudHJpZXMgZm9yIGVhY2ggZmllbGQuCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBmaWVsZF9zbG90X3QgKiAgICAgIGFsbG9jUm93KCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qKgotICAgICAgICAgICAgICAgICAgICAgICAgICogQWxsb2NhdGUgYSBwb3J0aW9uIG9mIHRoZSB3aW5kb3cuIFJldHVybnMgdGhlIG9mZnNldAotICAgICAgICAgICAgICAgICAgICAgICAgICogb2YgdGhlIGFsbG9jYXRpb24sIG9yIDAgaWYgdGhlcmUgaXNuJ3QgZW5vdWdoIHNwYWNlLgotICAgICAgICAgICAgICAgICAgICAgICAgICogSWYgYWxpZ25lZCBpcyB0cnVlLCB0aGUgYWxsb2NhdGlvbiBnZXRzIDQgYnl0ZSBhbGlnbm1lbnQuCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICB1aW50MzJfdCAgICAgICAgICAgIGFsbG9jKHNpemVfdCBzaXplLCBib29sIGFsaWduZWQgPSBmYWxzZSk7Ci0KLSAgICB1aW50MzJfdCAgICAgICAgICAgIHJlYWRfZmllbGRfc2xvdChpbnQgcm93LCBpbnQgY29sdW1uLCBmaWVsZF9zbG90X3QgKiBzbG90KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyoqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBDb3B5IGRhdGEgaW50byB0aGUgd2luZG93IGF0IHRoZSBnaXZlbiBvZmZzZXQuCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICB2b2lkICAgICAgICAgICAgICAgIGNvcHlJbih1aW50MzJfdCBvZmZzZXQsIHVpbnQ4X3QgY29uc3QgKiBkYXRhLCBzaXplX3Qgc2l6ZSk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBjb3B5SW4odWludDMyX3Qgb2Zmc2V0LCBpbnQ2NF90IGRhdGEpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgY29weUluKHVpbnQzMl90IG9mZnNldCwgZG91YmxlIGRhdGEpOwotCi0gICAgdm9pZCAgICAgICAgICAgICAgICBjb3B5T3V0KHVpbnQzMl90IG9mZnNldCwgdWludDhfdCAqIGRhdGEsIHNpemVfdCBzaXplKTsKLSAgICBpbnQ2NF90ICAgICAgICAgICAgIGNvcHlPdXRMb25nKHVpbnQzMl90IG9mZnNldCk7Ci0gICAgZG91YmxlICAgICAgICAgICAgICBjb3B5T3V0RG91YmxlKHVpbnQzMl90IG9mZnNldCk7Ci0KLSAgICBib29sICAgICAgICAgICAgICAgIHB1dExvbmcodW5zaWduZWQgaW50IHJvdywgdW5zaWduZWQgaW50IGNvbCwgaW50NjRfdCB2YWx1ZSk7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICBwdXREb3VibGUodW5zaWduZWQgaW50IHJvdywgdW5zaWduZWQgaW50IGNvbCwgZG91YmxlIHZhbHVlKTsKLSAgICBib29sICAgICAgICAgICAgICAgIHB1dE51bGwodW5zaWduZWQgaW50IHJvdywgdW5zaWduZWQgaW50IGNvbCk7Ci0KLSAgICBib29sICAgICAgICAgICAgICAgIGdldExvbmcodW5zaWduZWQgaW50IHJvdywgdW5zaWduZWQgaW50IGNvbCwgaW50NjRfdCAqIHZhbHVlT3V0KTsKLSAgICBib29sICAgICAgICAgICAgICAgIGdldERvdWJsZSh1bnNpZ25lZCBpbnQgcm93LCB1bnNpZ25lZCBpbnQgY29sLCBkb3VibGUgKiB2YWx1ZU91dCk7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICBnZXROdWxsKHVuc2lnbmVkIGludCByb3csIHVuc2lnbmVkIGludCBjb2wsIGJvb2wgKiB2YWx1ZU91dCk7Ci0KLSAgICB1aW50OF90ICogICAgICAgICAgIG9mZnNldFRvUHRyKHVpbnQzMl90IG9mZnNldCkge3JldHVybiBtRGF0YSArIG9mZnNldDt9Ci0KLSAgICByb3dfc2xvdF90ICogICAgICAgIGFsbG9jUm93U2xvdCgpOwotCi0gICAgcm93X3Nsb3RfdCAqICAgICAgICBnZXRSb3dTbG90KGludCByb3cpOwotICAgIAotICAgICAgICAgICAgICAgICAgICAgICAgLyoqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiByZXR1cm4gTlVMTCBpZiBGYWlsZWQgdG8gZmluZCByb3dTbG90IG9yCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBJbnZhbGlkIHJvd1Nsb3QKLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIGZpZWxkX3Nsb3RfdCAqICAgICAgZ2V0RmllbGRTbG90V2l0aENoZWNrKGludCByb3csIGludCBjb2x1bW4pOwotICAgIGZpZWxkX3Nsb3RfdCAqICAgICAgZ2V0RmllbGRTbG90KGludCByb3csIGludCBjb2x1bW4pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZmllbGREaXJPZmZzZXQgPSBnZXRSb3dTbG90KHJvdyktPm9mZnNldDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgoZmllbGRfc2xvdF90ICopb2Zmc2V0VG9QdHIoZmllbGREaXJPZmZzZXQpKSArIGNvbHVtbjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLXByaXZhdGU6Ci0gICAgdWludDhfdCAqIG1EYXRhOwotICAgIHNpemVfdCBtU2l6ZTsKLSAgICBzaXplX3QgbU1heFNpemU7Ci0gICAgd2luZG93X2hlYWRlcl90ICogbUhlYWRlcjsKLSAgICBzcDxJTWVtb3J5PiBtTWVtb3J5OwotCi0gICAgLyoqCi0gICAgICog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yOworICAgICAgICAgICAgZGF0YSA9IChjaGFyKilza19yZWFsbG9jX3Rocm93KGRhdGEsIGJ1ZmZlclNpemUpOworICAgICAgICB9CisgICAgfQorICAgIGRhdGEgPSAoY2hhciopc2tfcmVhbGxvY190aHJvdyhkYXRhLCBzdHJlYW1MZW4pOworCisgICAgU2tNZW1vcnlTdHJlYW0qIHN0cmVhbU1lbSA9IG5ldyBTa01lbW9yeVN0cmVhbSgpOworICAgIHN0cmVhbU1lbS0+c2V0TWVtb3J5T3duZWQoZGF0YSwgc3RyZWFtTGVuKTsKKyAgICByZXR1cm4gc3RyZWFtTWVtOworfQorCitzdGF0aWMgam9iamVjdCBkb0J1aWxkVGlsZUluZGV4KEpOSUVudiogZW52LCBTa1N0cmVhbSogc3RyZWFtKSB7CisgICAgU2tJbWFnZURlY29kZXIqIGRlY29kZXIgPSBTa0ltYWdlRGVjb2Rlcjo6RmFjdG9yeShzdHJlYW0pOworICAgIGludCB3aWR0aCwgaGVpZ2h0OworICAgIGlmIChOVUxMID09IGRlY29kZXIpIHsKKyAgICAgICAgZG9UaHJvd0lPRShlbnYsICJJbWFnZSBmb3JtYXQgbm90IHN1cHBvcnRlZCIpOworICAgICAgICByZXR1cm4gbnVsbE9iamVjdFJldHVybigiU2tJbWFnZURlY29kZXI6OkZhY3RvcnkgcmV0dXJuZWQgbnVsbCIpOworICAgIH0KKworICAgIEphdmFQaXhlbEFsbG9jYXRvciAqamF2YUFsbG9jYXRvciA9IG5ldyBKYXZhUGl4ZWxBbGxvY2F0b3IoZW52LCB0cnVlKTsKKyAgICBkZWNvZGVyLT5zZXRBbGxvY2F0b3IoamF2YUFsbG9jYXRvcik7CisgICAgSmF2YU1lbW9yeVVzYWdlUmVwb3J0ZXIgKmphdmFNZW1vcnlSZXBvcnRlciA9IG5ldyBKYXZhTWVtb3J5VXNhZ2VSZXBvcnRlcihlbnYpOworICAgIGRlY29kZXItPnNldFJlcG9ydGVyKGphdmFNZW1vcnlSZXBvcnRlcik7Cis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0pOworICAgICAgICBmZFN0cmVhbS0+dW5yZWYoKTsKKyAgICB9CisKKyAgICByZXR1cm4gZG9CdWlsZFRpbGVJbmRleChlbnYsIHN0cmVhbSk7Cit9CisKK3N0YXRpYyBqb2JqZWN0IG5hdGl2ZU5ld0luc3RhbmNlRnJvbVN0cmVhbShKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGlzLCAgICAgICAvLyBJbnB1dFN0cmVhbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpieXRlQXJyYXkgc3RvcmFnZSwgLy8gYnl0ZVtdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamJvb2xlYW4gaXNTaGFyZWFibGUpIHsKKyAgICBqb2JqZWN0IGxhcmdlQml0bWFwID0gTlVMTDsKKyAgICBTa1N0cmVhbSogc3RyZWFtID0gQ3JlYXRlSmF2YUlucHV0U3RyZWFtQWRhcHRvcihlbnYsIGlzLCBzdG9yYWdlLCAxMDI0KTsKKworICAgIGlmIChzdHJlYW0pIHsKKyAgICAgICAgLy8gZm9yIG5vdyB3ZSBkb24ndCBhbGxvdyBzaGFyZWFibGUgd2l0aCBqYXZhIGlucHV0c3RyZWFtcworICAgICAgICBTa01lbW9yeVN0cmVhbSAqbVN0cmVhbSA9IGJ1aWxkU2tNZW1vcnlTdHJlYW0oc3RyZWFtKTsKKyAgICAgICAgbGFyZ2VCaXRtYXAgPSBkb0J1aWxkVGlsZUluZGV4KGVudiwgbVN0cmVhbSk7CisgICAgICAgIHN0cmVhbS0+dW5yZWYoKTsKKyAgICB9CisgICAgcmV0dXJuIGxhcmdlQml0bWFwOworfQorCitzdGF0aWMgam9iamVjdCBuYXRpdmVOZXdJbnN0YW5jZUZyb21Bc3NldChKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgbmF0aXZ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luYXRpdmVOZXdJbnN0YW5jZUZyb21TdHJlYW0KKyAgICB9LAorCisgICAgeyAgICJuYXRpdmVOZXdJbnN0YW5jZSIsCisgICAgICAgICIoTGphdmEvaW8vRmlsZURlc2NyaXB0b3I7WilMYW5kcm9pZC9ncmFwaGljcy9CaXRtYXBSZWdpb25EZWNvZGVyOyIsCisgICAgICAgICh2b2lkKiluYXRpdmVOZXdJbnN0YW5jZUZyb21GaWxlRGVzY3JpcHRvcgorICAgIH0sCisKKyAgICB7ICAgIm5hdGl2ZU5ld0luc3RhbmNlIiwKKyAgICAgICAgIihJWilMYW5kcm9pZC9ncmFwaGljcy9CaXRtYXBSZWdpb25EZWNvZGVyOyIsCisgICAgICAgICh2b2lkKiluYXRpdmVOZXdJbnN0YW5jZUZyb21Bc3NldAorICAgIH0sCit9OworCisjZGVmaW5lIGtDbGFzc1BhdGhOYW1lICAiYW5kcm9pZC9ncmFwaGljcy9CaXRtYXBSZWdpb25EZWNvZGVyIgorCitzdGF0aWMgamNsYXNzIG1ha2VfZ2xvYmFscmVmKEpOSUVudiogZW52LCBjb25zdCBjaGFyIGNsYXNzbmFtZVtdKSB7CisgICAgamNsYXNzIGMgPSBlbnYtPkZpbmRDbGFzcyhjbGFzc25hbWUpOworICAgIFNrQVNTRVJUKGMpOworICAgIHJldHVybiAoamNsYXNzKWVudi0+TmV3R2xvYmFsUmVmKGMpOworfQorCitzdGF0aWMgamZpZWxkSUQgZ2V0RmllbGRJRENoZWNrKEpOSUVudiogZW52LCBqY2xhc3MgY2xhenosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgZmllbGRuYW1lW10sIGNvbnN0IGNoYXIgdHlwZVtdKSB7CisgICAgamZpZWxkSUQgaWQgPSBlbnYtPkdldEZpZWxkSUQoY2xhenosIGZpZWxkbmFtZSwgdHlwZSk7CisgICAgU2tBU1NFUlQoaWQpOworICAgIHJldHVybiBpZDsKK30KKworaW50IHJlZ2lzdGVyX2FuZH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kIHNldFZpZXdwb3J0KEpOSUVudiogZW52LCBqb2JqZWN0LCBTa0NhbnZhcyogY2FudmFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwgaW50IGhlaWdodCkgewotICAgICAgICBjYW52YXMtPnNldFZpZXdwb3J0KHdpZHRoLCBoZWlnaHQpOwotICAgIH0KLSAgICAKICAgICBzdGF0aWMgdm9pZCBzZXRCaXRtYXAoSk5JRW52KiBlbnYsIGpvYmplY3QsIFNrQ2FudmFzKiBjYW52YXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIFNrQml0bWFwKiBiaXRtYXApIHsKICAgICAgICAgY2FudmFzLT5zZXRCaXRtYXBEZXZpY2UoKmJpdG1hcCk7CkBAIC03NDMsNDUgKzczNiw0OSBAQAogICAgICAgICBjYW52YXMtPmRyYXdWZXJ0aWNlcyhtb2RlLCBwdENvdW50LCB2ZXJ0cywgdGV4cywgY29sb3JzLCBOVUxMLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRpY2VzLCBpbmRleENvdW50LCAqcGFpbnQpOwogICAgIH0KLSAgICAKLSAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dF9fX0NJSUZGUGFpbnQoSk5JRW52KiBlbnYsIGpvYmplY3QsIFNrQ2FudmFzKiBjYW52YXMsCisKKworICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0X19fQ0lJRkZJUGFpbnQoSk5JRW52KiBlbnYsIGpvYmplY3QsIFNrQ2FudmFzKiBjYW52YXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpjaGFyQXJyYXkgdGV4dCwgaW50IGluZGV4LCBpbnQgY291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4LCBqZmxvYXQgeSwgU2tQYWludCogcGFpbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IHgsIGpmbG9hdCB5LCBpbnQgZmxhZ3MsIFNrUGFpbnQqIHBhaW50KSB7CiAgICAgICAgIGpjaGFyKiB0ZXh0QXJyYXkgPSBlbnYtPkdldENoYXJBcnJheUVsZW1lbnRzKHRleHQsIE5VTEwpOwotICAgICAgICBqc2l6ZSB0ZXh0Q291bnQgPSBlbnYtPkdldEFycmF5TGVuZ3RoKHRleHQpOwotICAgICAgICBTa1NjYWxhciB4XyA9IFNrRmxvYXRUb1NjYWxhcih4KTsKLSAgICAgICAgU2tTY2FsYXIgeV8gPSBTa0Zsb2F0VG9TY2FsYXIoeSk7Ci0gICAgICAgIGNhbnZhcy0+ZHJhd1RleHQodGV4dEFycmF5ICsgaW5kZXgsIGNvdW50IDw8IDEsIHhfLCB5XywgKnBhaW50KTsKLSAgICAgICAgZW52LT5SZWxlYXNlQ2hhckFycmF5RWxlbWVudHModGV4dCwgdGV4dEFycmF5LCAwKTsKKyAgICAgICAgVGV4dExheW91dDo6ZHJhd1RleHQocGFpbnQsIHRleHRBcnJheSArIGluZGV4LCBjb3VudCwgZmxhZ3MsIHgsIHksIGNhbnZhcyk7CisgICAgICAgIGVudi0+UmVsZWFzZUNoYXJBcnJheUVsZW1lbnRzKHRleHQsIHRleHRBcnJheSwgSk5JX0FCT1JUKTsKICAgICB9Ci0gCi0gICAgc3RhdGljIHZvaWQgZHJhd1RleHRfX1N0cmluZ0lJRkZQYWludChKTklFbnYqIGVudiwgam9iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTa0NhbnZhcyogY2FudmFzLCBqc3RyaW5nIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4LCBqZmxvYXQgeSwgU2tQYWludCogcGFpbnQpIHsKLSAgICAgICAgY29uc3Qgdm9pZCogdGV4dF8gPSBlbnYtPkdldFN0cmluZ0NoYXJzKHRleHQsIE5VTEwpOwotICAgICAgICBTa1NjYWxhciB4XyA9IFNrRmxvYXRUb1NjYWxhcih4KTsKLSAgICAgICAgU2tTY2FsYXIgeV8gPSBTa0Zsb2F0VG9TY2FsYXIoeSk7Ci0gICAgICAgIGNhbnZhcy0+ZHJhd1RleHQoKGNvbnN0IHVpbnQxNl90Kil0ZXh0XyArIHN0YXJ0LCAoZW5kIC0gc3RhcnQpIDw8IDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgeF8sIHlfLCAqcGFpbnQpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdDaGFycyh0ZXh0LCAoY29uc3QgamNoYXIqKSB0ZXh0Xyk7CisKKyAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dF9fU3RyaW5nSUlGRklQYWludChKTklFbnYqIGVudiwgam9iamVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNrQ2FudmFzKiBjYW52YXMsIGpzdHJpbmcgdGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwgaW50IGVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4LCBqZmxvYXQgeSwgaW50IGZsYWdzLCBTa1BhaW50KiBwYWludCkgeworICAgICAgICBjb25zdCBqY2hhciogdGV4dEFycmF5ID0gZW52LT5HZXRTdHJpbmdDaGFycyh0ZXh0LCBOVUxMKTsKKyAgICAgICAgVGV4dExheW91dDo6ZHJhd1RleHQocGFpbnQsIHRleHRBcnJheSArIHN0YXJ0LCBlbmQgLSBzdGFydCwgZmxhZ3MsIHgsIHksIGNhbnZhcyk7CisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ0NoYXJzKHRleHQsIHRleHRBcnJheSk7CiAgICAgfQotICAgIAotICAgIHN0YXRpYyB2b2lkIGRyYXdTdHJpbmcoSk5JRW52KiBlbnYsIGpvYmplY3QgY2FudmFzLCBqc3RyaW5nIHRleHQsCi0gICAgICAgICAgICAg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UGFpbnQqIHBhaW50KSB7CisKKyAgICAgICAgamNoYXIqIGNoYXJzID0gZW52LT5HZXRDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCBOVUxMKTsKKyAgICAgICAgVGV4dExheW91dDo6ZHJhd1RleHRSdW4ocGFpbnQsIGNoYXJzICsgY29udGV4dEluZGV4LCBpbmRleCAtIGNvbnRleHRJbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY291bnQsIGNvbnRleHRDb3VudCwgZGlyRmxhZ3MsIHgsIHksIGNhbnZhcyk7CisgICAgICAgIGVudi0+UmVsZWFzZUNoYXJBcnJheUVsZW1lbnRzKHRleHQsIGNoYXJzLCBKTklfQUJPUlQpOwogICAgIH0KLSAgICAKKworICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0UnVuX19TdHJpbmdJSUlJRkZJUGFpbnQoCisgICAgICAgIEpOSUVudiogZW52LCBqb2JqZWN0IG9iaiwgU2tDYW52YXMqIGNhbnZhcywganN0cmluZyB0ZXh0LCBqaW50IHN0YXJ0LAorICAgICAgICBqaW50IGVuZCwgamludCBjb250ZXh0U3RhcnQsIGppbnQgY29udGV4dEVuZCwKKyAgICAgICAgamZsb2F0IHgsIGpmbG9hdCB5LCBqaW50IGRpckZsYWdzLCBTa1BhaW50KiBwYWludCkgeworCisgICAgICAgIGppbnQgY291bnQgPSBlbmQgLSBzdGFydDsKKyAgICAgICAgamludCBjb250ZXh0Q291bnQgPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICBjb25zdCBqY2hhciogY2hhcnMgPSBlbnYtPkdldFN0cmluZ0NoYXJzKHRleHQsIE5VTEwpOworICAgICAgICBUZXh0TGF5b3V0OjpkcmF3VGV4dFJ1bihwYWludCwgY2hhcnMgKyBjb250ZXh0U3RhcnQsIHN0YXJ0IC0gY29udGV4dFN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudCwgY29udGV4dENvdW50LCBkaXJGbGFncywgeCwgeSwgY2FudmFzKTsKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nQ2hhcnModGV4dCwgY2hhcnMpOworICAgIH0KKwogICAgIHN0YXRpYyB2b2lkIGRyYXdQb3NUZXh0X19fQ0lJX0ZQYWludChKTklFbnYqIGVudiwgam9iamVjdCwgU2tDYW52YXMqIGNhbnZhcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamNoYXJBcnJheSB0ZXh0LCBpbnQgaW5kZXgsIGludCBjb3VudCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0QXJyYXkgcG9zLCBTa1BhaW50KiBwYWludCkgewpAQCAtODA0LDEwICs4MDEsMTEgQEAKICAgICAgICAgfQogICAgICAgICBkZWxldGVbXSBwb3NQdHI7CiAgICAgfQotIAorCiAgICAgc3RhdGljIHZvaWQgZHJhd1Bvc1RleHRfX1N0cmluZ19GUGFpbnQoSk5JRW52KiBlbnYsIGpvYmplY3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2tDYW52YXMqIGNhbnZhcywganN0cmluZyB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdEFycmF5IHBvcywgU2tQYWludCogcGFpbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSBwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2tQYWludCogcGFpbnQpIHsKICAgICAgICAgY29uc3Qgdm9pZCogdGV4dF8gPSB0ZXh0ID8gZW52LT5HZXRTdHJpbmdDaGFycyh0ZXh0LCBOVUxMKSA6IE5VTEw7CiAgICAgICAgIGludCBieXRlTGVuZ3RoID0gdGV4dCA/IGVudi0+R2V0U3RyaW5nTGVuZ3RoKHRleHQpIDogMDsKICAgICAgICAgZmxvYX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LCB2T2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoLCBjYW52YXMpOwogICAgICAgICBlbnYtPlJlbGVhc2VDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCB0ZXh0QXJyYXksIDApOwogICAgIH0KLSAKKwogICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0T25QYXRoX19TdHJpbmdQYXRoRkZQYWludChKTklFbnYqIGVudiwgam9iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTa0NhbnZhcyogY2FudmFzLCBqc3RyaW5nIHRleHQsIFNrUGF0aCogcGF0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgaE9mZnNldCwgamZsb2F0IHZPZmZzZXQsIFNrUGFpbnQqIHBhaW50KSB7CisgICAgICAgICAgICBTa0NhbnZhcyogY2FudmFzLCBqc3RyaW5nIHRleHQsIFNrUGF0aCogcGF0aCwKKyAgICAgICAgICAgIGpmbG9hdCBoT2Zmc2V0LCBqZmxvYXQgdk9mZnNldCwgamludCBiaWRpRmxhZ3MsIFNrUGFpbnQqIHBhaW50KSB7CiAgICAgICAgIGNvbnN0IGpjaGFyKiB0ZXh0XyA9IGVudi0+R2V0U3RyaW5nQ2hhcnModGV4dCwgTlVMTCk7Ci0gICAgICAgIGludCBieXRlTGVuZ3RoID0gZW52LT5HZXRTdHJpbmdMZW5ndGgodGV4dCkgPDwgMTsKLSAgICAgICAgY2FudmFzLT5kcmF3VGV4dE9uUGF0aEhWKHRleHRfLCBieXRlTGVuZ3RoLCAqcGF0aCwKLSAgICAgICAgICAgICAgICAgICAgU2tGbG9hdFRvU2NhbGFyKGhPZmZzZXQpLCBTa0Zsb2F0VG9TY2FsYXIodk9mZnNldCksICpwYWludCk7CisgICAgICAgIGludCBjb3VudCA9IGVudi0+R2V0U3RyaW5nTGVuZ3RoKHRleHQpOworICAgICAgICBUZXh0TGF5b3V0OjpkcmF3VGV4dE9uUGF0aChw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bmFtZXNwYWNlIHVpcmVuZGVyZXI7CisKIGNsYXNzIFNrQ29sb3JGaWx0ZXJHbHVlIHsKIHB1YmxpYzoKLQotICAgIHN0YXRpYyB2b2lkIGZpbmFsaXplcihKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwgU2tDb2xvckZpbHRlciogb2JqKSB7CisgICAgc3RhdGljIHZvaWQgZmluYWxpemVyKEpOSUVudiogZW52LCBqb2JqZWN0IGNsYXp6LCBTa0NvbG9yRmlsdGVyKiBvYmosIFNraWFDb2xvckZpbHRlciogZikgewogICAgICAgICBvYmotPnNhZmVVbnJlZigpOworICAgICAgICAvLyBmID09IE5VTEwgd2hlbiBub3QgIVVTRV9PUEVOR0xfUkVOREVSRVIsIHNvIG5vIG5lZWQgdG8gZGVsZXRlIG91dHNpZGUgdGhlIGlmZGVmCisjaWZkZWYgVVNFX09QRU5HTF9SRU5ERVJFUgorICAgICAgICBpZiAoYW5kcm9pZDo6dWlyZW5kZXJlcjo6Q2FjaGVzOjpoYXNJbnN0YW5jZSgpKSB7CisgICAgICAgICAgICBhbmRyb2lkOjp1aXJlbmRlcmVyOjpDYWNoZXM6OmdldEluc3RhbmNlKCkucmVzb3VyY2VDYWNoZS5kZXN0cnVjdG9yKGYpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVsZXRlIGY7CisgICAgICAgIH0KKyNlbmRpZgogICAgIH0KIAotICAgIHN0YXRpYyBTa0NvbG9yRmlsdGVyKiBDcmVhdGVQb3J0ZXJEdWZmRmlsdGVyKEpOSUVudiogZW52LCBqb2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgc3JjQ29sb3IsIFNrUG9ydGVyRHVmZjo6TW9kZSBtb2RlKSB7Ci0gICAgICAgIHJldHVybiBTa0NvbG9yRmlsdGVyOjpDcmVhdGVNb2RlRmlsdGVyKHNyY0NvbG9yLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNrUG9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gam9iamVjdCwgU2tDb2xvckZpbHRlciAqc2tGaWx0ZXIsCisgICAgICAgICAgICBqZmxvYXRBcnJheSBqYXJyYXkpIHsKKyNpZmRlZiBVU0VfT1BFTkdMX1JFTkRFUkVSCisgICAgICAgIEF1dG9KYXZhRmxvYXRBcnJheSBhdXRvQXJyYXkoZW52LCBqYXJyYXksIDIwKTsKKyAgICAgICAgY29uc3QgZmxvYXQqIHNyYyA9IGF1dG9BcnJheS5wdHIoKTsKKworICAgICAgICBmbG9hdCogY29sb3JNYXRyaXggPSBuZXcgZmxvYXRbMTZdOworICAgICAgICBtZW1jcHkoY29sb3JNYXRyaXgsIHNyYywgNCAqIHNpemVvZihmbG9hdCkpOworICAgICAgICBtZW1jcHkoJmNvbG9yTWF0cml4WzRdLCAmc3JjWzVdLCA0ICogc2l6ZW9mKGZsb2F0KSk7CisgICAgICAgIG1lbWNweSgmY29sb3JNYXRyaXhbOF0sICZzcmNbMTBdLCA0ICogc2l6ZW9mKGZsb2F0KSk7CisgICAgICAgIG1lbWNweSgmY29sb3JNYXRyaXhbMTJdLCAmc3JjWzE1XSwgNCAqIHNpemVvZihmbG9hdCkpOworCisgICAgICAgIGZsb2F0KiBjb2xvclZlY3RvciA9IG5ldyBmbG9hdFs0XTsKKyAgICAgICAgY29sb3JWZWN0b3JbMF0gPSBzcmNbNF07CisgICAgICAgIGNvbG9yVmVjdG9yWzFdID0gc3JjWzldOworICAgICAgICBjb2xvclZlY3RvclsyXSA9IHNyY1sxNF07CisgICAgICAgIGNvbG9yVmVjdG9yWzNdID0gc3JjWzE5XTsKKworICAgICAgICByZXR1cm4gbmV3IFNraWFDb2xvck1hdHJpeEZpbHRlcihza0ZpbHRlciwgY29sb3JNYXRyaXgsIGNvbG9yVmVjdG9yKTsKKyNlbHNlCisgICAgICAgIHJldHVybiBOVUxMOworI2VuZGlmCisgICAgfQorCisgICAgc3RhdGljIFNrQ29sb3JGaWx0ZXIqIENyZWF0ZVBvcnRlckR1ZmZGaWx0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gICAgfQotICAgIAotICAgIHN0YXRpYyB2b2lkIGdldFRleHRQYXRoX19fQ0lJRkZQYXRoKEpOSUVudiogZW52LCBqb2JqZWN0IGNsYXp6LCBTa1BhaW50KiBwYWludCwgamNoYXJBcnJheSB0ZXh0LCBpbnQgaW5kZXgsIGludCBjb3VudCwgamZsb2F0IHgsIGpmbG9hdCB5LCBTa1BhdGgqIHBhdGgpIHsKLSAgICAgICAgY29uc3QgamNoYXIqIHRleHRBcnJheSA9IGVudi0+R2V0Q2hhckFycmF5RWxlbWVudHModGV4dCwgTlVMTCk7Ci0gICAgICAgIHBhaW50LT5nZXRUZXh0UGF0aCh0ZXh0QXJyYXkgKyBpbmRleCwgY291bnQgPDwgMSwgU2tGbG9hdFRvU2NhbGFyKHgpLCBTa0Zsb2F0VG9TY2FsYXIoeSksIHBhdGgpOwotICAgICAgICBlbnYtPlJlbGVhc2VDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCBjb25zdF9jYXN0PGpjaGFyKj4odGV4dEFycmF5KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSk5JX0FCT1JUKTsKKworICAgIHN0YXRpYyBqZmxvYXQgZG9UZXh0UnVuQWR2YW5jZXMoSk5JRW52ICplbnYsIFNrUGFpbnQgKnBhaW50LCBjb25zdCBqY2hhciAqdGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgc3RhcnQsIGppbnQgY291bnQsIGppbnQgY29udGV4dENvdW50LCBqaW50IGZsYWdzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0QXJyYXkgYWR2YW5jZXMsIGppbnQgYWR2YW5jZXNJbmRleCkgeworICAgICAgICBqZmxvYXQgYWR2YW5jZXNBcnJheVtjb3VudF07CisgICAgICAgIGpmbG9hdCB0b3RhbEFkdmFuY2U7CisKKyAgICAgICAgVGV4dExheW91dDo6Z2V0VGV4dFJ1bkFkdmFuY2VzKHBhaW50LCB0ZXh0LCBzdGFydCwgY291bnQsIGNvbnRleHRDb3VudCwgZmxhZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZHZhbmNlc0FycmF5LCB0b3RhbEFkdmFuY2UpOworCisgICAgICAgIGlmIChhZHZhbmNlcyAhPSBOVUxMKSB7CisgICAgICAgICAgICBlbnYtPlNldEZsb2F0QXJyYXlSZWdpb24oYWR2YW5jZXMsIGFkdmFuY2VzSW5kZXgsIGNvdW50LCBhZHZhbmNlc0FycmF5KTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdG90YWxBZHZhbmNlOwogICAgIH0KLSAKLSAgICBzdGF0aWMgdm9pZCBnZXRUZXh0UGF0aF9fU3RyaW5nSUlGRlBhdGgoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIHBhaW50LCBqc3RyaW5nIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwgamZsb2F0IHgsIGpmbG9hdCB5LCBTa1BhdGgqIHBhdGgpIHsKKworICAgIHN0YXRpYyBmbG9hdCBnZXRUZXh0UnVuQWR2YW5jZXNfX19DSUlJSUlfRkkoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIHBhaW50LAorICAgICAgICAgICAgamNoYXJBcnJheSB0ZXh0LCBqaW50IGluZGV4LCBqaW50IGNvdW50LCBqaW50IGNvbnRleHRJbmRleCwgamludCBjb250ZXh0Q291bnQsCisgICAgICAgICAgICBqaW50IGZsYWdzLCBqZmxvYXRBcnJheSBhZHZhbmNlcywgamludCBhZHZhbmNlc0luZGV4KSB7CisgICAgICAgIGpjaGFyKiB0ZXh0QXJyYXkgPSBlbnYtPkdldENoYXJBcnJheUVsZW1lbnRzKHRleHQsIE5VTEwpOworICAgICAgICBqZmxvYXQgcmVzdWx0ID0gZG9UZXh0UnVuQWR2YW5jZXMoZW52LCBwYWludCwgdGV4dEFycmF5ICsgY29udGV4dEluZGV4LAorICAgICA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N0cmluZ0NoYXJzKHRleHQsIHRleHRBcnJheSk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgc3RhdGljIGppbnQgZG9UZXh0UnVuQ3Vyc29yKEpOSUVudiAqZW52LCBTa1BhaW50KiBwYWludCwgY29uc3QgamNoYXIgKnRleHQsIGppbnQgc3RhcnQsCisgICAgICAgICAgICBqaW50IGNvdW50LCBqaW50IGZsYWdzLCBqaW50IG9mZnNldCwgamludCBvcHQpIHsKKyAgICAgICAgU2tTY2FsYXIgc2NhbGFyQXJyYXlbY291bnRdOworICAgICAgICBqY2hhciBidWZmZXJbY291bnRdOworCisgICAgICAgIC8vIHRoaXMgaXMgd2hlcmUgd2UnZCBjYWxsIGhhcmZidXp6CisgICAgICAgIC8vIGZvciBub3cgd2UganVzdCB1c2UgdXNoYXBlLmMgYW5kIHdpZHRocyByZXR1cm5lZCBmcm9tIHNraWEKKworICAgICAgICBpbnQgd2lkdGhzOworICAgICAgICBpZiAoZmxhZ3MgJiAweDEpIHsgLy8gcnRsLCBjYWxsIGFyYWJpYyBzaGFwaW5nIGluIGNhc2UKKyAgICAgICAgICAgIFVFcnJvckNvZGUgc3RhdHVzID0gVV9aRVJPX0VSUk9SOworICAgICAgICAgICAgLy8gVXNlIGZpeGVkIGxlbmd0aCBzaW5jZSB3ZSBuZWVkIHRvIGtlZXAgc3RhcnQgYW5kIGNvdW50IHZhbGlkCisgICAgICAgICAgICB1X3NoYXBlQXJhYmljKHRleHQgKyBzdGFydCwgY291bnQsIGJ1ZmZlciwgY291bnQsCisgICAgICAgICAgICAgICAgICAgIFVfU0hBUEVfTEVOR1RIX0ZJWEVEX1NQQUNFU19ORUFSIHwgVV9TSEFQRV9URVhUX0RJUkVDVElPTl9MT0dJQ0FMIHwKKyAgICAgICAgICAgICAgICAgICAgVV9TSEFQRV9MRVRURVJTX1NIQVBFIHwgVV9TSEFQRV9YX0xBTUFMRUZfU1VCX0FMVEVSTkFURSwgJnN0YXR1cyk7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FpbmluZyB3aWR0aHMgemVyby4gIE5vdCBuaWNlLgorICAgICAgICAgICAgY29uc3QgamNoYXIgKmNoYXJzID0gdGV4dCArIHN0YXJ0OworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGNvdW50LCBwID0gd2lkdGhzIC0gMTsgLS1pID4gcDspIHsKKyAgICAgICAgICAgICAgICBpZiAoY2hhcnNbaV0gPj0gMHhkYzAwICYmIGNoYXJzW2ldIDwgMHhlMDAwICYmCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyc1tpLTFdID49IDB4ZDgwMCAmJiBjaGFyc1tpLTFdIDwgMHhkYzAwKSB7CisgICAgICAgICAgICAgICAgICAgIHNjYWxhckFycmF5W2ldID0gMDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgc2NhbGFyQXJyYXlbaV0gPSBzY2FsYXJBcnJheVstLXBdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGppbnQgcG9zID0gb2Zmc2V0IC0gc3RhcnQ7CisgICAgICAgIHN3aXRjaCAob3B0KSB7CisgICAgICAgIGNhc2UgQUZURVI6CisgICAgICAgICAgaWYgKHBvcyA8IGNvdW50KSB7CisgICAgICAgICAgICBwb3MgKz0gMTsKKyAgICAgICAgICB9CisgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCisgICAgICAgIGNhc2UgQVRfT1JfQUZURVI6CisgICAgICAgICAgd2hpbGUgKHBvcyA8IGNvdW50ICYmIHNjYWxhckFycmF5W3Bvc10gPT0gMCkgeworICAgICAgICAgICAgKytwb3M7CisgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEJFRk9SRToKKyAgICAgICAgICBpZiAocG9zID4gMCkgeworICAgICAgICAgICAgLS1wb3M7CisgICAgICAgICAgfQorICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaAorICAgICAgICBjYXNlIEFUX09SX0JFRk9SRToKKyAgICAgICAgICB3aGlsZSAocG9zID4gMCAmJiBzY2FsYXJBcnJheVtwb3NdID09IDApIHsKKyAgICAgICAgICAgIC0tcG9zOworICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBBVDoKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICBpZiAoc2NhbGFyQXJyYXlbcG9zXSA9PSAwKSB7CisgICAgICAgICAgICBwb3MgPSAtMTsKKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAocG9zICE9IC0xKSB7CisgICAgICAgICAgcG9zICs9IHN0YXJ0OworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHBvczsKKyAgICB9CisKKyAgICBzdGF0aWMgamludCBnZXRUZXh0UnVuQ3Vyc29yX19fQyhKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwgU2tQYWludCogcGFpbnQsIGpjaGFyQXJyYXkgdGV4dCwKKyAgICAgICAgICAgIGppbnQgY29udGV4dFN0YXJ0LCBqaW50IGNvbnRleHRDb3VudCwgamludCBmbGFncywgamludCBvZmZzZXQsIGppbnQgY3Vyc29yT3B0KSB7CisgICAgICAgIGpjaGFyKiB0ZXh0QXJyYXkgPSBlbnYtPkdldENoYXJBcnJheUVsZW1lbnRzKHRleHQsIE5VTEwpOworICAgICAgICBqaW50IHJlc3VsdCA9IGRvVGV4dFJ1bkN1cnNvcihlbnYsIHBhaW50LCB0ZXh0QXJyYXksIGNvbnRleHRTdGFydCwgY29udGV4dENvdW50LCBmbGFncywKKyAgICAgICAgICAgICAgICBvZmZzZXQsIGN1cnNvck9wdCk7CisgICAgICAgIGVudi0+UmVsZWFzZUNoYXJBcnJheUVsZW1lbnRzKHRleHQsIHRleHRBcnJheSwgSk5JX0FCT1JUKTsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBzdGF0aWMgamludCBnZXRUZXh0UnVuQ3Vyc29yX19TdHJpbmcoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIHBhaW50LCBqc3RyaW5nIHRleHQsCisgICAgICAgICAgICBqaW50IGNvbnRleHRTdGFydCwgamludCBjb250ZXh0RW5kLCBqaW50IGZsYWdzLCBqaW50IG9mZnNldCwgamludCBjdXJzb3JPcHQpIHsKKyAgICAgICAgY29uc3QgamNoYXIqIHRleHRBcnJheSA9IGVudi0+R2V0U3RyaW5nQ2hhcnModGV4dCwgTlVMTCk7CisgICAgICAgIGppbnQgcmVzdWx0ID0gZG9UZXh0UnVuQ3Vyc29yKGVudiwgcGFpbnQsIHRleHRBcnJheSwgY29udGV4dFN0YXJ0LAorICAgICAgICAgICAgICAgIGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQsIGZsYWdzLCBvZmZzZXQsIGN1cnNvck9wdCk7CisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ0NoYXJzKHRleHQsIHRleHRBcnJheSk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgc3RhdGljIHZvaWQgZ2V0VGV4dFBhdGgoSk5JRW52KiBlbnYsIFNrUGFpbnQqIHBhaW50LCBjb25zdCBqY2hhciogdGV4dCwgamludCBjb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGJpZGlGbGFncywgamZsb2F0IHgsIGpmbG9hdCB5LCBTa1BhdGggKnBhdGgpIHsKKyAgICAgICAgVGV4dExheW91dDo6Z2V0VGV4dFBhdGgocGFpbnQsIHRleHQsIGNvdW50LCBiaWRpRmxhZ3MsIHgsIHksIHBhdGgpOworICAgIH0KKworICAgIHN0YXRpYyB2b2lkIGdldFRleHRQYXRoX19fQyhKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwgU2tQYWludCogcGFpbnQsIGppbnQgYmlkaUZsYWdzLAorICAgICAgICAgICAgamNoYXJBcnJheSB0ZXh0LCBpbnQgaW5kZXgsIGludCBjb3VudCwgamZ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vU2NhbGFyKHgxKSwgU2tGbG9hdFRvU2NhbGFyKHkxKSk7CiAKLSAgICBzaXplX3QgICAgICBjb3VudCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoY29sb3JBcnJheSk7CisgICAgc2l6ZV90IGNvdW50ID0gZW52LT5HZXRBcnJheUxlbmd0aChjb2xvckFycmF5KTsKICAgICBjb25zdCBqaW50KiBjb2xvclZhbHVlcyA9IGVudi0+R2V0SW50QXJyYXlFbGVtZW50cyhjb2xvckFycmF5LCBOVUxMKTsKIAogICAgIFNrQXV0b1NUTWFsbG9jPDgsIFNrU2NhbGFyPiBzdG9yYWdlKHBvc0FycmF5ID8gY291bnQgOiAwKTsKICAgICBTa1NjYWxhciogICAgICAgICAgICAgICAgICAgcG9zID0gTlVMTDsKLSAgICAKKwogICAgIGlmIChwb3NBcnJheSkgewogICAgICAgICBBdXRvSmF2YUZsb2F0QXJyYXkgYXV0b1BvcyhlbnYsIHBvc0FycmF5LCBjb3VudCk7CiAgICAgICAgIGNvbnN0IGZsb2F0KiBwb3NWYWx1ZXMgPSBhdXRvUG9zLnB0cigpOwogICAgICAgICBwb3MgPSAoU2tTY2FsYXIqKXN0b3JhZ2UuZ2V0KCk7Ci0gICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CiAgICAgICAgICAgICBwb3NbaV0gPSBTa0Zsb2F0VG9TY2FsYXIocG9zVmFsdWVzW2ldKTsKKyAgICAgICAgfQogICAgIH0KLQorICAgIAogICAgIFNrU2hhZGVyKiBzaGFkZXIgPSBTa0dyYWRpZW50U2hhZGVyOjpDcmVhdGVMaW5lYXIocHRzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IFNrQ29sb3IqPihjb2xvclZhbHVlcyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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yAgICBzdG9yZWRCb3VuZHNbMF0gPSB4MDsgc3RvcmVkQm91bmRzWzFdID0geTA7CisgICAgc3RvcmVkQm91bmRzWzJdID0geDE7IHN0b3JlZEJvdW5kc1szXSA9IHkxOworICAgIGpmbG9hdCogc3RvcmVkUG9zaXRpb25zID0gbmV3IGpmbG9hdFtjb3VudF07CisgICAgdWludDMyX3QqIHN0b3JlZENvbG9ycyA9IG5ldyB1aW50MzJfdFtjb3VudF07CisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgIHN0b3JlZENvbG9yc1tpXSA9IHN0YXRpY19jYXN0PHVpbnQzMl90Pihjb2xvclZhbHVlc1tpXSk7CisgICAgfQorCisgICAgaWYgKHBvc0FycmF5KSB7CisgICAgICAgIEF1dG9KYXZhRmxvYXRBcnJheSBhdXRvUG9zKGVudiwgcG9zQXJyYXksIGNvdW50KTsKKyAgICAgICAgY29uc3QgZmxvYXQqIHBvc1ZhbHVlcyA9IGF1dG9Qb3MucHRyKCk7CisgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgc3RvcmVkUG9zaXRpb25zW2ldID0gcG9zVmFsdWVzW2ldOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgc3RvcmVkUG9zaXRpb25zWzBdID0gMC4wZjsKKyAgICAgICAgc3RvcmVkUG9zaXRpb25zWzFdID0gMS4wZjsKKyAgICB9CisKKyAgICBTa2lhU2hhZGVyKiBza2lhU2hhZGVyID0gbmV3IFNraWFMaW5lYXJHcmFkaWVudFNoYWRlcihzdG9yZWRCb3VuZHMsIHN0b3JlZENvbG9ycywKKyAgICAgICAgICAgIHN0b3JlZFBvc2l0aW9ucywgY291bnQsIHNoYWRlciwgc3RhdGljX2Nhc3Q8U2tTaGFkZXI6OlRpbGVNb2RlPih0aWxlTW9kZSksIE5VTEwsCisgICAgICAgICAgICAoc2hhZGVyLT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KiBza2lhU2hhZGVyID0gbmV3IFNraWFMaW5lYXJHcmFkaWVudFNoYWRlcihzdG9yZWRCb3VuZHMsIHN0b3JlZENvbG9ycywKKyAgICAgICAgICAgIHN0b3JlZFBvc2l0aW9ucywgMiwgc2hhZGVyLCBzdGF0aWNfY2FzdDxTa1NoYWRlcjo6VGlsZU1vZGU+KHRpbGVNb2RlKSwgTlVMTCwKKyAgICAgICAgICAgIChzaGFkZXItPmdldEZsYWdzKCkgJiBTa1NoYWRlcjo6a09wYXF1ZUFscGhhX0ZsYWcpID09IDApOworCisgICAgcmV0dXJuIHNraWFTaGFkZXI7CisjZWxzZQorICAgIHJldHVybiBOVUxMOworI2VuZGlmCit9CisKK3N0YXRpYyBTa1NoYWRlciogTGluZWFyR3JhZGllbnRfY3JlYXRlMihKTklFbnYqIGVudiwgam9iamVjdCBvLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgwLCBmbG9hdCB5MCwgZmxvYXQgeDEsIGZsb2F0IHkxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb2xvcjAsIGludCBjb2xvcjEsIGludCB0aWxlTW9kZSkKIHsKQEAgLTEyMCwxOCArMjE5LDE3IEBACiAgICAgU2tDb2xvciBjb2xvcnNbMl07CiAgICAgY29sb3JzWzBdID0gY29sb3IwOwogICAgIGNvbG9yc1sxXSA9IGNvbG9yMTsKLQorICAgIAogICAgIFNrU2hhZGVyKiBzID0gU2tHcmFkaWVudFNoYWRlcjo6Q3JlYXRlTGluZWFyKHB0cywgY29sb3JzLCBOVUxMLCAyLCAoU2tTaGFkZXI6OlRpbGVNb2RlKXRpbGVNb2RlKTsKKwogICAgIFRocm93SUFFX0lmTnVsbChlbnYsIHMpOwogICAgIHJldHVybiBzOwogfQogCiAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLwogCi1zdGF0aWMgU2tTaGFkZXIqIFJhZGlhbEdyYWRpZW50X2NyZWF0ZTEoSk5JRW52KiBlbnYsIGpvYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgcmFkaXVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnRBcnJheSBjb2xvckFycmF5LCBqZmxvYXRBcnJheSBwb3NBcnJheSwgaW50IHRpbGVNb2RlKQoteworc3RhdGljIFNrU2hhZGVyKiBSYWRpYWxHcmFkaWVudF9jcmVhdGUxKEpOSUVudiogZW52LCBqb2JqZWN0LCBmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCByYWRpdXMsCisgICAgICAgIGppbnRBcnJheSBjb2xvckFycmF5LCBqZmxvYXRBcnJheSBwb3NBcnJheSwgaW50IHRpbGVNb2RlKSB7CiAgICAgU2tQb2ludCBjZW50ZXI7CiAgICAgY2VudGVyLnNldChTa0Zsb2F0VG9TY2FsYXIoeCksIFNrRmxvYXRUb1NjYWxhcih5KSk7CiAKQEAgLTE2MSwxMCArMjU5LDggQEAKICAgICByZXR1cm4gc2hhZGVyOwogfQogCi1zdGF0aWMgU2tTaGFkZXIqIFJhZGlhbEdyYWRpZW50X2NyZWF0ZTIoSk5JRW52KiBlbnYsIGpvYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgcmFkaXVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb2xvcjAsIGludCBjb2xvcjEsIGludCB0aWxlTW9kZSkKLXsKK3N0YXRpYyBTa1NoYWRlciogUmFkaWFsR3JhZGllbnRfY3JlYXRlMihKTklFbnYqIGVudiwgam9iamVjdCwgZmxvYXQgeCwg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KKyAgICAgICAgY29uc3QgZmxvYXQqIHBvc1ZhbHVlcyA9IGF1dG9Qb3MucHRyKCk7CisgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgc3RvcmVkUG9zaXRpb25zW2ldID0gcG9zVmFsdWVzW2ldOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgc3RvcmVkUG9zaXRpb25zWzBdID0gMC4wZjsKKyAgICAgICAgc3RvcmVkUG9zaXRpb25zWzFdID0gMS4wZjsKKyAgICB9CisKKyAgICBTa2lhU2hhZGVyKiBza2lhU2hhZGVyID0gbmV3IFNraWFDaXJjdWxhckdyYWRpZW50U2hhZGVyKHgsIHksIHJhZGl1cywgc3RvcmVkQ29sb3JzLAorICAgICAgICAgICAgc3RvcmVkUG9zaXRpb25zLCBjb3VudCwgc2hhZGVyLCAoU2tTaGFkZXI6OlRpbGVNb2RlKSB0aWxlTW9kZSwgTlVMTCwKKyAgICAgICAgICAgIChzaGFkZXItPmdldEZsYWdzKCkgJiBTa1NoYWRlcjo6a09wYXF1ZUFscGhhX0ZsYWcpID09IDApOworCisgICAgZW52LT5SZWxlYXNlSW50QXJyYXlFbGVtZW50cyhjb2xvckFycmF5LCBjb25zdF9jYXN0PGppbnQqPihjb2xvclZhbHVlcyksIEpOSV9BQk9SVCk7CisgICAgcmV0dXJuIHNraWFTaGFkZXI7CisjZWxzZQorICAgIHJldHVybiBOVUxMOworI2VuZGlmCit9CisKK3N0YXRpYyBTa2lhU2hhZGVyKiBSYWRpYWxHcmFkaWVudF9wb3N0Q3JlYXRlMihKTklFbnYqIGVudiwgam9iamVjdCBvLCBTa1NoYWRlciogc2hhZGVyLAorICAgICAgICBmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCByYWRpdXMsIGludCBjb2xvcjAsIGludCBjb2xvcjEsIGludCB0aWxlTW9kZSkgeworI2lmZGVmIFVTRV9PUEVOR0xfUkVOREVSRVIKKyA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gamNvbG9ycywgamZsb2F0QXJyYXkganBvc2l0aW9ucykgewogICAgIHNpemVfdCAgICAgIGNvdW50ID0gZW52LT5HZXRBcnJheUxlbmd0aChqY29sb3JzKTsKICAgICBjb25zdCBqaW50KiBjb2xvcnMgPSBlbnYtPkdldEludEFycmF5RWxlbWVudHMoamNvbG9ycywgTlVMTCk7CiAgICAgCkBAIC0yMDksOCArMzU5LDcgQEAKIH0KIAogc3RhdGljIFNrU2hhZGVyKiBTd2VlcEdyYWRpZW50X2NyZWF0ZTIoSk5JRW52KiBlbnYsIGpvYmplY3QsIGZsb2F0IHgsIGZsb2F0IHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvbG9yMCwgaW50IGNvbG9yMSkKLXsKKyAgICAgICAgaW50IGNvbG9yMCwgaW50IGNvbG9yMSkgewogICAgIFNrQ29sb3IgY29sb3JzWzJdOwogICAgIGNvbG9yc1swXSA9IGNvbG9yMDsKICAgICBjb2xvcnNbMV0gPSBjb2xvcjE7CkBAIC0yMjAsMjAgKzM2OSw5NyBAQAogICAgIHJldHVybiBzOwogfQogCitzdGF0aWMgU2tpYVNoYWRlciogU3dlZXBHcmFkaWVudF9wb3N0Q3JlYXRlMShKTklFbnYqIGVudiwgam9iamVjdCBvLCBTa1NoYWRlciogc2hhZGVyLAorICAgICAgICBmbG9hdCB4LCBmbG9hdCB5LCBqaW50QXJyYXkgY29sb3JBcnJheSwgamZsb2F0QXJyYXkgcG9zQXJyYXkpIHsKKyNpZmRlZiBVU0VfT1BFTkdMX1JFTkRFUkVSCisgICAgc2l6ZV90IGNvdW50ID0gZW52LT5HZXRBcnJheUxlbmd0aChjb2xvckFycmF5KTsKKyAgICBjb25zdCBqaW50KiBjb2xvclZhbHVlcyA9IGVudi0+R2V0SW50QXJyYXlFbGVtZW50cyhjb2xvckFycmF5LCBOVUxMKTsKKworICAgIGpmbG9hdCogc3RvcmVkUG9zaXRpb25zID0gbmV3IGpmbG9hdFtjb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FX0xFTkdUSF9GSVhFRF9TUEFDRVNfTkVBUiB8CisgICAgICAgICAgICAgICAgICAgVV9TSEFQRV9URVhUX0RJUkVDVElPTl9MT0dJQ0FMIHwgVV9TSEFQRV9MRVRURVJTX1NIQVBFIHwKKyAgICAgICAgICAgICAgICAgICBVX1NIQVBFX1hfTEFNQUxFRl9TVUJfQUxURVJOQVRFLCAmc3RhdHVzKTsKKworICAgIGlmIChVX1NVQ0NFU1Moc3RhdHVzKSkgeworICAgICAgICAvLyB0cmltIG91dCAweGZmZmYgZm9sbG93aW5nIGxpZ2F0dXJlcywgaWYgYW55CisgICAgICAgIGludCBlbmQgPSAwOworICAgICAgICBmb3IgKGludCBpID0gc3RhcnQsIGUgPSBzdGFydCArIGNvdW50OyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICBpZiAoYnVmZmVyW2ldICE9IDB4ZmZmZikgeworICAgICAgICAgICAgICAgIGJ1ZmZlcltlbmQrK10gPSBidWZmZXJbaV07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgY291bnQgPSBlbmQ7CisgICAgICAgIC8vIExPRyhMT0dfSU5GTywgIkNTUlRMIiwgInN0YXJ0ICVkIGNvdW50ICVkIGNjb3VudCAlZFxuIiwgc3RhcnQsIGNvdW50LCBjb250ZXh0Q291bnQpOworICAgICAgICB1YmlkaV93cml0ZVJldmVyc2UoYnVmZmVyLCBjb3VudCwgc2hhcGVkLCBjb3VudCwgVUJJRElfRE9fTUlSUk9SSU5HIHwgVUJJRElfT1VUUFVUX1JFVkVSU0UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgVUJJRElfS0VFUF9CQVNFX0NPTUJJTklORywgJnN0YXR1cyk7CisgICAgICAgIGlmIChVX1NVQ0NFU1Moc3RhdHVzKSkgeworICAgICAgICAgICAgcmV0dXJuIGNvdW50OworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIC0xOworfQorCisvKioKKyAqIEJhc2ljIGNoYXJhY3Rlci1iY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JwYXJhIGJpZGlSZXE9JWQgZGlyPSVkIHJjPSVkXG4iLCBiaWRpUmVxLCBkaXIsIHJjKTsKKworICAgICAgICAgICAgICAgIGludDMyX3Qgc2xlbiA9IDA7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCByYzsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgIGludDMyX3Qgc3RhcnQ7CisgICAgICAgICAgICAgICAgICAgIGludDMyX3QgbGVuZ3RoOworICAgICAgICAgICAgICAgICAgICBVQmlEaURpcmVjdGlvbiBydW5EaXIgPSB1YmlkaV9nZXRWaXN1YWxSdW4oYmlkaSwgaSwgJnN0YXJ0LCAmbGVuZ3RoKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAocnVuRGlyID09IFVCSURJX1JUTCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2xlbiArPSBzaGFwZVJ0bFRleHQodGV4dCArIHN0YXJ0LCAwLCBsZW5ndGgsIGxlbmd0aCwgYnVmZmVyICsgc2xlbiwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1lbWNweShidWZmZXIgKyBzbGVuLCB0ZXh0ICsgc3RhcnQsIGxlbmd0aCAqIHNpemVvZihqY2hhcikpOworICAgICAgICAgICAgICAgICAgICAgICAgc2xlbiArPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKFVfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IHNsZW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHViaWRpX2Nsb3NlKGJpZGkpOworICAgIH0KKworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK2Jvb2wgVGV4dExheW91dDo6cHJlcGFyZVRleHQoU2tQYWludCAqcGFpbnQ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yaXogPSBwYWludC0+Z2V0VGV4dEFsaWduKCk7CisgICAgc3dpdGNoIChob3JpeikgeworICAgICAgICBjYXNlIFNrUGFpbnQ6OmtMZWZ0X0FsaWduOiB0cmltTGVmdCA9IGRpciAmIGtEaXJlY3Rpb25fTWFzazsgYnJlYWs7CisgICAgICAgIGNhc2UgU2tQYWludDo6a0NlbnRlcl9BbGlnbjogdHJpbUxlZnQgPSB0cmltUmlnaHQgPSB0cnVlOyBicmVhazsKKyAgICAgICAgY2FzZSBTa1BhaW50OjprUmlnaHRfQWxpZ246IHRyaW1SaWdodCA9ICEoZGlyICYga0RpcmVjdGlvbl9NYXNrKTsKKyAgICAgICAgZGVmYXVsdDogYnJlYWs7CisgICAgfQorICAgIGNvbnN0IGpjaGFyKiB3b3JrTGltaXQgPSB3b3JrVGV4dCArIGxlbjsKKworICAgIGlmICh0cmltTGVmdCkgeworICAgICAgICB3aGlsZSAod29ya1RleHQgPCB3b3JrTGltaXQgJiYgKndvcmtUZXh0ID09ICcgJykgeworICAgICAgICAgICAgKyt3b3JrVGV4dDsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAodHJpbVJpZ2h0KSB7CisgICAgICAgIHdoaWxlICh3b3JrTGltaXQgPiB3b3JrVGV4dCAmJiAqKHdvcmtMaW1pdCAtIDEpID09ICcgJykgeworICAgICAgICAgICAgLS13b3JrTGltaXQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAqb3V0Qnl0ZXMgPSAod29ya0xpbWl0IC0gd29ya1RleHQpIDw8IDE7CisgICAgKm91dFRleHQgPSB3b3JrVGV4dDsKKyAgICAqb3V0QnVmZmVyID0gYnVmZmVyOworCisgICAgcmV0dXJuIHRydWU7Cit9CisKKy8vIERyYXdzIG9yIGdldHMgdGhlIHBhdGggb2YgYSBwYXJhZ3JhcGggb2YgdGV4dCBvbiBhIHNpbmdsZSBsaW5lLCBydW5uaW5nIGJpZGkgYW5kIHNoYXBpbmcuCisvLyBUaGlzIHdpbGwgZHJh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pzaXplIHN0YXJ0LCBqc2l6ZSYgY291bnQsCisgICAgICAgIGpzaXplIGNvbnRleHRDb3VudCwgamNoYXIqIHNoYXBlZCkgeworICAgIFVFcnJvckNvZGUgc3RhdHVzID0gVV9aRVJPX0VSUk9SOworICAgIGNvdW50ID0gc2hhcGVSdGxUZXh0KGNvbnRleHQsIHN0YXJ0LCBjb3VudCwgY29udGV4dENvdW50LCBzaGFwZWQsIHN0YXR1cyk7CisgICAgaWYgKFVfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0gZWxzZSB7CisgICAgICAgIExPRyhMT0dfV0FSTiwgIkxBWU9VVCIsICJkcmF3VGV4dFJ1biBlcnJvciAlZFxuIiwgc3RhdHVzKTsKKyAgICB9CisgICAgcmV0dXJuIGZhbHNlOworfQorCit2b2lkIFRleHRMYXlvdXQ6OmRyYXdUZXh0UnVuKFNrUGFpbnQqIHBhaW50LCBjb25zdCBqY2hhciogY2hhcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgc3RhcnQsIGppbnQgY291bnQsIGppbnQgY29udGV4dENvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGlyRmxhZ3MsIGpmbG9hdCB4LCBqZmxvYXQgeSwgU2tDYW52YXMqIGNhbnZhcykgeworCisgICAgIFNrU2NhbGFyIHhfID0gU2tGbG9hdFRvU2NhbGFyKHgpOworICAgICBTa1NjYWxhciB5XyA9IFNrRmxvYXRUb1NjYWxhcih5KTsKKworICAgICB1aW50OF90IHJ0bCA9IGRpckZsYWdzICYgMHgxOworICAgICBpZiAocnRsKSB7CisgICAgICAgICBTa0F1dG9TVE1hbGxvYzw4MCwgamNoYXI+IGJ1ZmZlcihjb250ZXh0Q291bnQpOworICAgICAgICAgaWYgKHByZXBhcmVSdGxUZXh0UnVuKGNoYXJzLCBzdGFydCwgY291bnQsIGNvbnRleHRDb3VudCwgYnVmZmVyLmdldCgpKSkgeworICAgICAgICAgICAgIGNhbnZhcy0+ZHJhd1RleHQoYnVmZmVyLmdldCgpLCBjb3VudCA8PCAxLCB4XywgeV8sICpwYWludCk7CisgICAgICAgICB9CisgICAgIH0gZWxzZSB7CisgICAgICAgICBjYW52YXMtPmRyYXdUZXh0KGNoYXJzICsgc3RhcnQsIGNvdW50IDw8IDEsIHhfLCB5XywgKnBhaW50KTsKKyAgICAgfQorIH0KKwordm9pZCBUZXh0TGF5b3V0OjpnZXRUZXh0UnVuQWR2YW5jZXMoU2tQYWludCAqcGFpbnQsIGNvbnN0IGpjaGFyICpjaGFycywgamludCBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgY291bnQsIGppbnQgY29udGV4dENvdW50LCBqaW50IGRpckZsYWdzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0ICpyZXN1bHRBZHZhbmNlcywgamZsb2F0ICZyZXN1bHRUb3RhbEFkdmFuY2UpIHsKKyAgICBqY2hhciBidWZmZXJbY29udGV4dENvdW50XTsKKworICAgIFNrU2NhbGFyKiBzY2FsYXJBcnJheSA9IChTa1NjYWxhciAqKXJlc3VsdEFkdmFuY2VzOworICAgIHJlc3VsdFRvdGFsQWR2YW5jZSA9IDA7CisKKyAgICAvLyB0aGlzIGlzIHdoZXJlIHdlJ2QgY2FsbCBoYXJmYnV6egorICAgIC8vIGZvciBub3cgd2UganVzdCB1c2UgdXNoYXBlLmMKKworICAgIGludCB3aWR0aHM7CisgICAgY29uc3QgamNoYXIqIHRleHQ7CisgICAgaWYgKGRpckZsYWdzICYgMHgxKSB7IC8vIHJ0bCwgY2FsbCBhcmFiaWMgc2hhcGluZyBpbiBjYXNlCisgICAgICAgIFVFcnJvckNvZGUgc3RhdHVzID0gVV9aRVJPX0VSUk9SOworICAgICAgICAvLyBVc2UgZml4ZWQgbGVuZ3RoIHNpbmNlIHdlIG5lZWQgdG8ga2VlcCBzdGFydCBhbmQgY291bnQgdmFsaWQKKyAgICAgICAgdV9zaGFwZUFyYWJpYyhjaGFycywgY29udGV4dENvdW50LCBidWZmZXIsIGNvbnRleHRDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICBVX1NIQVBFX0xFTkdUSF9GSVhFRF9TUEFDRVNfTkVBUiB8CisgICAgICAgICAgICAgICAgICAgICAgVV9TSEFQRV9URVhUX0RJUkVDVElPTl9MT0dJQ0FMIHwgVV9TSEFQRV9MRVRURVJTX1NIQVBFIHwKKyAgICAgICAgICAgICAgICAgICAgICBVX1NIQVBFX1hfTEFNQUxFRl9TVUJfQUxURVJOQVRFLCAmc3RhdHVzKTsKKyAgICAgICAgLy8gd2Ugc2hvdWxkbid0IGZhaWwgdW5sZXNzIHRoZXJlJ3MgYW4gb3V0IG9mIG1lbW9yeSBjb25kaXRpb24sCisgICAgICAgIC8vIGluIHdoaWNoIGNhc2Ugd2UncmUgaG9zZWQgYW55d2F5CisgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCwgZSA9IGkgKyBjb3VudDsgaSA8IGU7ICsraSkgeworICAgICAgICAgIGlmIChidWZmZXJbaV0gPT0gMHhmZmZmKSB7CisgICAgICAgICAgICBidWZmZXJbaV0gPSAweDIwMGI7IC8vIHplcm8td2lkdGgtc3BhY2UgZm9yIHNraWEKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgdGV4dCA9IGJ1ZmZlciArIHN0YXJ0OworICAgICAgICB3aWR0aHMgPSBwYWludC0+Z2V0VGV4dFdpZHRocyh0ZXh0LCBjb3VudCA8PCAxLCBzY2FsYXJBcnJheSk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgdGV4dCA9IGNoYXJzICsgc3RhcnQ7CisgICAgICAgIHdpZHRocyA9IHBhaW50LT5nZXRUZXh0V2lkdGhzKHRleHQsIGNvdW50IDw8IDEsIHNjYWxhckFycmF5KTsKKyAgICB9CisKKyAgICBpZiAod2lkdGhzIDwgY291bnQpIHsKKyAgICAgICAgLy8gU2tpY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0gMiwKKyAgICAgICAga0JpZGlfRGVmYXVsdF9SVEwgPSAzLAorICAgICAgICBrQmlkaV9Gb3JjZV9MVFIgPSA0LAorICAgICAgICBrQmlkaV9Gb3JjZV9SVEwgPSA1LAorCisgICAgICAgIGtCaWRpX01hc2sgPSAweDcKKyAgICB9OworCisgICAgLyoKKyAgICAgKiBEcmF3cyBhIHVuaWRpcmVjdGlvbmFsIHJ1biBvZiB0ZXh0LgorICAgICAqLworICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0UnVuKFNrUGFpbnQqIHBhaW50LCBjb25zdCBqY2hhciogY2hhcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBzdGFydCwgamludCBjb3VudCwgamludCBjb250ZXh0Q291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRpckZsYWdzLCBqZmxvYXQgeCwgamZsb2F0IHksIFNrQ2FudmFzKiBjYW52YXMpOworCisgICAgc3RhdGljIHZvaWQgZ2V0VGV4dFJ1bkFkdmFuY2VzKFNrUGFpbnQgKnBhaW50LCBjb25zdCBqY2hhciAqY2hhcnMsIGppbnQgc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgY291bnQsIGppbnQgY29udGV4dENvdW50LCBqaW50IGRpckZsYWdzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgKnJlc3VsdEFkdmFuY2VzLCBqZmxvYXQgJnJlc3VsdFRvdGFsQWR2YW5jZSk7CisKKyAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dChTa1BhaW50KiBwYWludCwgY29uc3QgamNoYXIqIHRleHQsIGpzaXplIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGJpZGlGbGFncywgamZsb2F0IHgsIGpmbG9hdCB5LCBTa0NhbnZhcyogY2FudmFzKTsKKworICAgIHN0YXRpYyB2b2lkIGdldFRleHRQYXRoKFNrUGFpbnQgKnBhaW50LCBjb25zdCBqY2hhciAqdGV4dCwganNpemUgbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgYmlkaUZsYWdzLCBqZmxvYXQgeCwgamZsb2F0IHksIFNrUGF0aCAqcGF0aCk7CisKKyAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dE9uUGF0aChTa1BhaW50KiBwYWludCwgY29uc3QgamNoYXIqIHRleHQsIGpzaXplIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgYmlkaUZsYWdzLCBqZmxvYXQgaE9mZnNldCwgamZsb2F0IHZPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2tQYXRoKiBwYXRoLCBTa0NhbnZhcyogY2FudmFzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgIHN0YXRpYyBib29sIHByZXBhcmVUZXh0KFNrUGFpbnQgKnBhaW50LCBjb25zdCBqY2hhciogdGV4dCwganNpemUgbGVuLCBqaW50IGJpZGlGbGFncywKKyAgICAgICAgY29uc3QgamNoYXIqKiBvdXRUZXh0LCBpbnQzMl90KiBvdXRCeXRlcywgamNoYXIqKiBvdXRCdWZmZXIpOworICAgIHN0YXRpYyBib29sIHByZXBhcmVSdGxUZXh0UnVuKGNvbnN0IGpjaGFyKiBjb250ZXh0LCBqc2l6ZSBzdGFydCwganNpemUmIGNvdW50LAorICAgICAgICBqc2l6ZSBjb250ZXh0Q291bnQsIGpjaGFyKiBzaGFwZWQpOworICAgICAgICAKKworcHJpdmF0ZToKKyAgICBzdGF0aWMgYm9vbCBuZWVkc0xheW91dChjb25zdCBqY2hhciogdGV4dCwgamludCBsZW4sIGppbnQgYmlkaUZsYWdzKTsKKyAgICBzdGF0aWMgaW50IHNoYXBlUnRsVGV4dChjb25zdCBqY2hhciogY29udGV4dCwganNpemUgc3RhcnQsIGpzaXplIGNvdW50LCBqc2l6ZSBjb250ZXh0Q291bnQsCisgICAgICAgICAgICAgICAgICAg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gICAgICAgICAgICBjaGFyICp0eXBlID0gc3RydG9rKE5VTEwsICIsIik7Ci0gICAgICAgICAgICBjaGFyICp2YWx1ZUxpc3QgPSBzdHJ0b2soTlVMTCwgIiwiKTsKLSAgICAgICAgICAgIGNoYXIgKnBhcmFtTGlzdCA9IHN0cnRvayhOVUxMLCAiLCIpOwotICAgICAgICAgICAgaWYgKENPTVBBUkVfU1RSSU5HKHR5cGUsIEJMQUNLTElTVF9CWV9OQU1FKSkgewotICAgICAgICAgICAgICAgIC8vIEV4dHJhY3QgTmFtZSBmcm9tIFZhbHVlIGxpc3QKLSAgICAgICAgICAgICAgICBuZXdlbGVtLT5maWVsZFR5cGUgPSBCTF9UWVBFX05BTUU7Ci0gICAgICAgICAgICAgICAgbmV3ZWxlbS0+dmFsdWUgPSAoY2hhciAqKWNhbGxvYygxLCBzdHJsZW4odmFsdWVMaXN0KSk7Ci0gICAgICAgICAgICAgICAgaWYgKG5ld2VsZW0tPnZhbHVlID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgTE9HRSgiJXM6IG91dCBvZiBtZW1vcnkhIiwgX19GVU5DVElPTl9fKTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHZhbHVlTGlzdCsrOyAgLy8gU2tpcCBvcGVuIHF1b3RlCi0gICAgICAgICAgICAgICAgc3RybmNweShuZXdlbGVtLT52YWx1ZSwgdmFsdWVMaXN0LCBzdHJsZW4odmFsdWVMaXN0KSAtIDEpOwotCi0gICAgICAgICAgICAgICAgLy8gR2V0IFNjbyBTZXR0aW5ncyBmcm9tIFBhcmFtZXRlcnMKLSAgICAgICAgICAgICAgICBjaGFyICpwYXJhbSA9IHN0cnRvayhwYXJhbUxpc3QsICI7Iik7Ci0gICAgICAgICAgICAgICAgdWludDE2X3Qgc2NvVHlwZXMgPSAwOwotICAgICAgICAgICAgICAgIHdoaWxlIChwYXJhbSAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHVpbnQxNl90IHNjbzsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtWzBdID09ICctJykgewotICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0rKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjbyA9IHN0cjJzY29UeXBlKHBhcmFtKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY28gIT0gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29UeXBlcyAmPSB+c2NvOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHBhcmFtWzBdID09ICcrJykgewotICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0rKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjbyA9IHN0cjJzY29UeXBlKHBhcmFtKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY28gIT0gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29UeXBlcyB8PSBzY287Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyYW1bMF0gPT0gJz0nKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbSsrOwotICAgICAgICAgICAgICAgICAgICAgICAgc2NvID0gc3RyMnNjb1R5cGUocGFyYW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjbyAhPSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb1R5cGVzID0gc2NvOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgTE9HRSgiSW52YWxpZCBTQ08gdHlwZSBtdXN0IGJlID0sICsgb3IgLSIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBhcmFtID0gc3RydG9rKE5VTEwsICI7Iik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG5ld2VsZW0tPnNjb1R5cGUgPSBzY29UeXBlczsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgTE9HRSgiVW5rbm93biBTQ08gdHlwZSBlbnRyeSBpbiBCbGFja2xpc3QgZmlsZSIpOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGxpc3QpIHsKLSAgICAgICAgICAgICAgICBsaXN0LT5uZXh0ID0gbmV3ZWxlbTsKLSAgICAgICAgICAgICAgICBsaXN0ID0gbmV3ZWxlbTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgYmxhY2tsaXN0ID0gbGlzdCA9IG5ld2VsZW07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBMT0dJKCJFbnRyeSBuYW1lID0gJXMgU2NvVHlwZXMgPSAweCV4IiwgbmV3ZWxlbS0+dmFsdWUsCi0gICAgICAgICAgICAgICAgIG5ld2VsZW0tPnNjb1R5cGUpOwotICAgICAgICB9Ci0gICAgfQotICAgIGZjbG9zZShmcCk7Ci0gICAgcmV0dXJuOwotfQotc3RhdGljIHVpbnQxNl90IGdldFNjb1R5cGUoY2hhciAqYWRkcmVzcywgY29uc3QgY2hhciAqbmFtZSkgewotICAgIHVpbnQxNl90IHJldCA9IDA7Ci0gICAgc2NvQmxhY2tsaXN0X3QgKmxpc3QgPSBibGFja2xpc3Q7Ci0KLSAgICB3aGlsZSAobGlzdCAhPSBOVUxMKSB7Ci0gICAgICAgIGlmIChsaXN0LT5maWVsZFR5cGUgPT0gQkxfVFlQRV9OQU1FKSB7Ci0gICAgICAgICAgICBpZiAoQ09NUEFSRV9TVFJJTkcobmFtZSwgbGlzdC0+dmFsdWUpKSB7Ci0gICAgICAgICAgICAgICAgcmV0ID0gbGlzdC0+c2NvVHlwZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBsaXN0ID0gbGlzdC0+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ICAgIHsiSW50ZXJmYWNlIiwgREJVU19UWVBFX1NUUklOR30sCisgICAgeyJVVUlEIiwgREJVU19UWVBFX1NUUklOR30sCit9OworCiB0eXBlZGVmIHVuaW9uIHsKICAgICBjaGFyICpzdHJfdmFsOwogICAgIGludCBpbnRfdmFsOwpAQCAtMTg3LDYgKzE5Nyw3IEBACiAgICAgZGJ1c19ib29sX3QgcmV0OwogICAgIHZhX2xpc3QgbHN0OwogICAgIHZhX3N0YXJ0KGxzdCwgZmlyc3RfYXJnX3R5cGUpOworCiAgICAgcmV0ID0gZGJ1c19mdW5jX2FyZ3NfYXN5bmNfdmFsaXN0KGVudiwgY29ubiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZW91dF9tcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwbHksIHVzZXIsIG5hdCwKQEAgLTY5OSw2ICs3MTAsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHJlbW90ZV9kZXZpY2VfcHJvcGVydGllcykgLyBzaXplb2YoUHJvcGVydGllcykpOwogfQogCitqb2JqZWN0QXJyYXkgcGFyc2VfaW5wdXRfcHJvcGVydHlfY2hhbmdlKEpOSUVudiAqZW52LCBEQnVzTWVzc2FnZSAqbXNnKSB7CisgICAgcmV0dXJuIHBhcnNlX3Byb3BlcnR5X2NoYW5nZShlbnYsIG1zZywgKFByb3BlcnRpZXMgKikgJmlucHV0X3Byb3BlcnRpZXMsCisgICAgICAgICAgICAgICAgICAgIHNpemVvZihpbnB1dF9wcm9wZXJ0aWVzKSAvIHNpemVvZihQcm9wZXJ0aWVzKSk7Cit9CisKK2pvYmplY3RBcnJheSBwYXJzZV9wYW5fcHJvcGVydHlfY2hhbmdlKEpOSUVudiAqZW52LCBEQnVzTWVzc2FnZSAqbXNnKSB7CisgICAgcmV0dXJuIHBhcnNlX3Byb3BlcnR5X2NoYW5nZShlbnYsIG1zZywgKFByb3BlcnRpZXMgKik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Z19uYXRpdmUoSk5JRW52KiBlbnYsIGpvYmplY3Qgb2JqZWN0LCBqaW50IHJvdywgamludCBjb2x1bW4pCiB7CiAgICAgaW50MzJfdCBlcnI7CkBAIC00ODcsMTAgKzQyMyw5IEBACiAgICAgfQogfQogCi1zdGF0aWMgamJvb2xlYW4gaXNOdWxsX25hdGl2ZShKTklFbnYqIGVudiwgam9iamVjdCBvYmplY3QsIGppbnQgcm93LCBqaW50IGNvbHVtbikKK2Jvb2wgaXNOdWxsX25hdGl2ZShDdXJzb3JXaW5kb3cgKndpbmRvdywgamludCByb3csIGppbnQgY29sdW1uKQogewotICAgIEN1cnNvcldpbmRvdyAqIHdpbmRvdyA9IEdFVF9XSU5ET1coZW52LCBvYmplY3QpOwotTE9HX1dJTkRPVygiQ2hlY2tpbmcgZm9yIE5VTEwgYXQgJWQsJWQgZnJvbSAlcCIsIHJvdywgY29sdW1uLCB3aW5kb3cpOworICAgIExPR19XSU5ET1coIkNoZWNraW5nIGZvciBOVUxMIGF0ICVkLCVkIGZyb20gJXAiLCByb3csIGNvbHVtbiwgd2luZG93KTsKIAogICAgIGJvb2wgaXNOdWxsOwogICAgIGlmICh3aW5kb3ctPmdldE51bGwocm93LCBjb2x1bW4sICZpc051bGwpKSB7CkBAIC02NTIsNiArNTg3LDI2IEBACiAgICAgd2luZG93LT5mcmVlTGFzdFJvdygpOwogfQogCitzdGF0aWMgamludCBnZXRUeXBlX25hdGl2ZShKTklFbnYqIGVudiwgam9iamVjdCBvYmplY3QsIGppbnQgcm93LCBqaW50IGNvbHVtbikKK3sKKyAgICBpbnQzMl90IGVycjsKKyAgICBDdXJzb3JXaW5kb3cgKiB3aW5kb3cgPSBHRVRfV0lORE9XKGVudiwgb2JqZWN0KTsKKyAgICBMT0dfV0lORE9XKCJyZXR1cm5pbmcgY29sdW1uIHR5cGUgYWZmaW5pdHkgZm9yICVkLCVkIGZyb20gJXAiLCByb3csIGNvbHVtbiwgd2luZG93KTsKKworICAgIGlmIChpc051b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F5KQorICAgICAgICBnb3RvIGRvbmU7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhcmdjOyBpKyspIHsKKyAgICAgICAgY2hhciogYXJnID0gKGNoYXIgKilzcWxpdGUzX3ZhbHVlX3RleHQoYXJndltpXSk7CisgICAgICAgIGlmICghYXJnKSB7CisgICAgICAgICAgICBMT0dFKCJOVUxMIGFyZ3VtZW50IGluIGN1c3RvbV9mdW5jdGlvbl9jYWxsYmFjay4gIFRoaXMgc2hvdWxkIG5vdCBoYXBwZW4uIik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgam9iamVjdCBvYmogPSBlbnYtPk5ld1N0cmluZ1VURihhcmcpOworICAgICAgICBpZiAoIW9iaikKKyAgICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgICAgZW52LT5TZXRPYmplY3RBcnJheUVsZW1lbnQoc3RyQXJyYXksIGksIG9iaik7CisgICAgICAgIGVudi0+RGVsZXRlTG9jYWxSZWYob2JqKTsKKyAgICB9CisKKyAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKGZ1bmN0aW9uLCBtZXRob2RfY3VzdG9tX2Z1bmN0aW9uX2NhbGxiYWNrLCBzdHJBcnJheSk7CisKK2RvbmU6CisgICAgaWYgKGVudi0+RXhjZXB0aW9uQ2hlY2soKSkgeworICAgICAgICBMT0dFKCJBbiBleGNlcHRpb24gd2FzIHRocm93biBieSBjdXN0b20gc3FsaXRlMyBmdW5jdGlvbi4iKTsKKyAgICAgICAgTE9HRV9FWChlbnYpOworICAgICAgICBlbnYtPkV4Y2VwdGlvbkNsZWFyKCk7CisgICAgfQorfQorCitzdGF0aWMgamludCBuYXRpdmVfYWRkQ3VzdG9tRnVuY3Rpb24oSk5JRW52KiBlbnYsIGpvYmplY3Qgb2JqZWN0LAorICAgICAgICBqc3RyaW5nIG5hbWUsIGppbnQgbnVtQXJncywgam9iamVjdCBmdW5jdGlvbikKK3sKKyAgICBzcWxpdGUzICogaGFuZ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ZWN0KSk7CiAgICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICAgfQogICAgICAgICBMT0dfV0lORE9XKCJCb3VuZCB0byBzdGFydFBvcyAlZCIsIHN0YXJ0UG9zKTsKQEAgLTE2Nyw3ICsxNjgsNyBAQAogICAgICAgICAgICAgTE9HRSgic3RhcnRQb3MgJWQgPiBhY3R1YWwgcm93cyAlZCIsIHN0YXJ0UG9zLCBudW0pOwogICAgICAgICAgICAgcmV0dXJuIG51bTsKICAgICAgICAgfQotICAgIH0gCisgICAgfQogICAgIAogICAgIHdoaWxlKHN0YXJ0UG9zICE9IDAgfHwgbnVtUm93cyA8IG1heFJlYWQpIHsKICAgICAgICAgZXJyID0gc3FsaXRlM19zdGVwKHN0YXRlbWVudCk7CkBAIC0xODEsOCArMTgyLDkgQEAKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICBmaWVsZF9zbG90X3QgKiBmaWVsZERpciA9IHdpbmRvdy0+YWxsb2NSb3coKTsKICAgICAgICAgICAgICAgICBpZiAoIWZpZWxkRGlyKSB7Ci0gICAgICAgICAgICAgICAgICAgIExPR0UoIkZhaWxlZCBhbGxvY2F0aW5nIGZpZWxkRGlyIGF0IHN0YXJ0UG9zICVkIHJvdyAlZCIsIHN0YXJ0UG9zLCBudW1Sb3dzKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXJ0UG9zICsgbnVtUm93cyArIGZpbmlzaF9wcm9ncmFtX2FuZF9nZXRfcm93X2NvdW50KHN0YXRlbWVudCkgKyAxOworICAgICAgICAgICAgICAgICAgICBMT0dfV0lORE9XKCJGYWlsZWQgYWxsb2NhdGluZyBmaWVsZERpciBhdCBzdGFydFBvcyAlZCByb3cgJWQiLCBzdGFydFBvcywgbnVtUm93cyk7CisgICAgICAgICAgICAgICAgICAgIGdvdEFsbFJvd3MgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZ290byByZXR1cm5fY291bnQ7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCkBAIC0yMDUsOSArMjA3LDEwIEBACiAgICAgICAgICAgICAgICAgICAgIGludCBvZmZzZXQgPSB3aW5kb3ctPmFsbG9jKHNpemUpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIW9mZnNldCkgewogICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LT5mcmVlTGFzdFJvdygpOwotICAgICAgICAgICAgICAgICAgICAgICAgTE9HRSgiRmFpbGVkIGFsbG9jYXRpbmcgJXUgYnl0ZXMgZm9yIHRleHQvYmxvYiBhdCAlZCwlZCIsIHNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBMT0dfV0lORE9XKCJGYWlsZWQgYWxsb2NhdGluZyAldSBieXRlcyBmb3IgdGV4dC9ibG9iIGF0ICVkLCVkIiwgc2l6ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRQb3MgKyBudW1Sb3dzLCBpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdGFydFBvcyArIG51bVJvd3MgKyBmaW5pc2hfcHJvZ3JhbV9hbmRfZ2V0X3Jvd19jb3VudChzdGF0ZW1lbnQpICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdvdEFsbFJvd3MgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gcmV0dXJuX2NvdW50OwogICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgd2luZG93LT5jb3B5SW4ob2Zmc2V0LCB0ZXh0LCBzaXplKTsKQEAgLTIyNSw4ICsyMjgsOSBAQAogICAgICAgICAgICAgICAgICAgICBpbnQ2NF90IHZhbHVlID0gc3FsaXRlM19jb2x1bW5faW50NjQoc3RhdGVtZW50LCBpKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKCF3aW5kb3ctPnB1dExvbmcobnVtUm93cywgaSwgdmFsdWUpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3ctPmZyZWVMYXN0Um93KCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMT0dFKCJGYWlsZWQgYWxsb2NhdGluZyBzcGFjZSBmb3IgYSBsb25nIGluIGNvbHVtbiAlZCIsIGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXJ0UG9zICsgbnVtUm93cyArIGZpbmlzaF9wcm9ncmFtX2FuZF9nZXRfcm93X2NvdW50KHN0YXRlbWVudCkgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgTE9HX1dJTkRPVygiRmFpbGVkIGFsbG9jYXRpbmcgc3BhY2UgZm9yIGEgbG9uZyBpbiBjb2x1bW4gJWQiLCBpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdvdEFsbFJvd3MgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gcmV0dXJuX2NvdW50OwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIExPR19XSU5ET1coIiVkLCVkIGlzIElOVEVHRVIgMHglMDE2bGx4Iiwgc3RhcnRQb3MgKyBudW1Sb3dzLCBpLCB2YWx1ZSk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09IFNRTElURV9GTE9BVCkgewpAQCAtMjM0LDggKzIzOCw5IEBACiAgICAgICAgICAgICAgICAgICAgIGRvdWJsZSB2YWx1ZSA9IHNxbGl0ZTNfY29sdW1uX2RvdWJsZShzdGF0ZW1lbnQsIGkpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIXdpbmRvdy0+cHV0RG91YmxlKG51bVJvd3MsIGksIHZhbHVlKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LT5mcmVlTGFzdFJvdygpOwotICAgICAgICAgICAgICAgICAgICAgICAgTE9HRSgiRmFpbGVkIGFsbG9jYXRpbmcgc3BhY2UgZm9yIGEgZG91YmxlIGluIGNvbHVtbiAlZCIsIGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXJ0UG9zICsgbnVtUm93cyArIGZpbmlzaF9wcm9ncmFtX2FuZF9nZXRfcm93X2NvdW50KHN0YXRlbWVudCkgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgTE9HX1dJTkRPVygiRmFpbGVkIGFsbG9jYXRpbmcgc3BhY2UgZm9yIGEgZG91YmxlIGluIGNvbHVtbiAlZCIsIGkpOworICAgICAgICAgICAgICAgICAgICAgICAgZ290QWxsUm93cyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZ290byByZXR1cm5fY291bnQ7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgTE9HX1dJTkRPVygiJWQsJWQgaXMgRkxPQVQgJWxmIiwgc3RhcnRQb3MgKyBudW1Sb3dzLCBpLCB2YWx1ZSk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09IFNRTElURV9CTE9CKSB7CkBAIC0yNDUsOSArMjUwLDEwIEBACiAgICAgICAgICAgICAgICAgICAgIGludCBvZmZzZXQgPSB3aW5kb3ctPmFsbG9jKHNpemUpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIW9mZnNldCkgewogICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LT5mcmVlTGFzdFJvdygpOwotICAgICAgICAgICAgICAgICAgICAgICAgTE9HRSgiRmFpbGVkIGFsbG9jYXRpbmcgJXUgYnl0ZXMgZm9yIGJsb2IgYXQgJWQsJWQiLCBzaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgTE9HX1dJTkRPVygiRmFpbGVkIGFsbG9jYXRpbmcgJXUgYnl0ZXMgZm9yIGJsb2IgYXQgJWQsJWQiLCBzaXplLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydFBvcyArIG51bVJvd3MsIGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXJ0UG9zICsgbnVtUm93cyArIGZpbmlzaF9wcm9ncmFtX2FuZF9nZXRfcm93X2NvdW50KHN0YXRlbWVudCkgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgZ290QWxsUm93cyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZ290byByZXR1cm5fY291bnQ7CiAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICB3aW5kb3ctPmNvcHlJbihvZmZzZXQsIGJsb2IsIHNpemUpOwpAQCAtMjY5LDYgKzI3NSw3IEBACiAgICAgICAgICAgICAgICAgICAgIC8vIFVua25vd24gZGF0YQogICAgICAgICAgICAgICAgICAgICBMT0dFKCJVbmtub3duIGNvbHVtbiB0eXBlIHdoZW4gZmlsbGluZyBkYXRhYmFzZSB3aW5kb3ciKTsKICAgICAgICAgICAgICAgICAgICAgdGhyb3dfc3FsaXRlM19leGNlcHRpb24oZW52LCAiVW5rbm93biBjb2x1bW4gdHlwZSB3aGVuIGZpbGxpbmcgd2luZG93Iik7CisgICAgICAgICAgICAgICAgICAgIGdvdEV4Y2VwdGlvbiA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTI5MCw2ICsyOTcsOCBAQAogICAgICAgICAgICAgTE9HX1dJTkRPVygiRGF0YWJhc2UgbG9ja2VkLCByZXRyeWluZyIpOwogICAgICAgICAgICAgaWYgKHJldHJ5Q291bnQgPiA1MCkgewogICAgICAgICAgICAgICAgIExPR0UoIkJhaWxpbmcgb24gZGF0YWJhc2UgYnVzeSByZXR5Iik7CisgICAgICAgICAgICAgICAgdGhyb3dfc3FsaXRlM19leGNlcHRpb24oZW52LCBHRVRfSEFORExFKGVudiwgb2JqZWN0KSwgInJldHJ5Y291bnQgZXhjZWVkZWQiKTsKKyAgICAgICAgICAgICAgICBnb3RFeGNlcHRpb24gPSB0cnVlOwogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogCkBAIC0zMDAsMTggKzMwOSwzMyBAQAogICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICB0aHJvd19zcWxpdGUzX2V4Y2VwdGlvbihlbnYsIEdFVF9IQU5ETEUoZW52LCBvYmplY3QpKTsKKyAgICAgICAgICAgIGdvdEV4Y2VwdGlvbiA9IHRydWU7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQogICAgIH0KIAogICAgIExPR19XSU5ET1coIlJlc2V0dGluZyBzdGF0ZW1lbnQgJXAgYWZ0ZXIgZmV0Y2hpbmcgJWQgcm93cyBpbiAlZCBieXRlc1xuXG5cblxuIiwgc3RhdGVtZW50LAogICAgICAgICAgICAgbnVtUm93cywgd2luZG93LT5zaXplKCkgLSB3aW5kb3ctPmZyZWVTcGFjZSgpKTsKLS8vICAgIExPR0koIkZpbGxlZCB3aW5kb3cgd2l0aCAlZCByb3dzIGluICVkIGJ5dGVzIiwgbnVtUm93cywgd2luZG93LT5zaXplKCkgLSB3aW5kb3ctPmZyZWVTcGFjZSgpKTsKKyAgICBMT0dfV0lORE9XKCJGaWxsZWQgd2luZG93IHdpdGggJWQgcm93cyBpbiAlZCBieXRlcyIsIG51bVJvd3MsCisgICAgICAgICAgICB3aW5kb3ctPnNpemUoKSAtIHdpbmRvdy0+ZnJlZVNwYWNlKCkpOwogICAgIGlmIChlcnIgPT0gU1FMSVRFX1JPVykgeworICAgICAgICAvLyB0aGVyZSBpcyBtb3JlIGRhdGEgdG8gYmUgcmV0dXJuZWQuIGxldCB0aGUgY2FsbGVyIGtub3cgYnkgcmV0dXJuaW5nIC0xCiAgICAgICAgIHJldHVybiAtMTsKLSAgICB9IGVsc2UgeworICAgIH0KKyAgcmV0dXJuX2NvdW50OgorICAgIGlmIChzdGFydFBvcykgewogICAgICAgICBzcWxpdGUzX3Jlc2V0KHN0YXRlbWVudCk7Ci0gICAgICAgIHJldHVybiBzdGFydFBvcyArIG51bVJvd3M7CisgIC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YWlsZWQ6ICVzIiwgc3RyZXJyb3IoZXJybm8pKTsKKyAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIGVycm5vKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgaWYgKGxlbmd0aCA+IDApIHsKKyAgICAgICAgLy8gbW1hcCB0aGUgYXNobWVtIGFyZWEKKyAgICAgICAgdm9pZCAqIGFzaG1lbV9wdHIgPQorICAgICAgICAgICAgICAgIG1tYXAoTlVMTCwgbGVuZ3RoLCBQUk9UX1JFQUQgfCBQUk9UX1dSSVRFLCBNQVBfU0hBUkVELCBmZCwgMCk7CisgICAgICAgIGlmIChhc2htZW1fcHRyID09IE1BUF9GQUlMRUQpIHsKKyAgICAgICAgICAgIExPR0UoIm1tYXAgZmFpbGVkOiAlcyIsIHN0cmVycm9yKGVycm5vKSk7CisgICAgICAgICAgICBqbmlUaHJvd0lPRXhjZXB0aW9uKGVudiwgZXJybm8pOworICAgICAgICAgICAgY2xvc2UoZmQpOworICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgIH0KKworICAgICAgICAvLyBDb3B5IGRhdGEgdG8gYXNobWVtIGFyZWEKKyAgICAgICAgbWVtY3B5KGFzaG1lbV9wdHIsIGRhdGEsIGxlbmd0aCk7CisKKyAgICAgICAgLy8gbXVubWFwIGFzaG1lbSBhcmVhCisgICAgICAgIGlmIChtdW5tYXAoYXNobWVtX3B0ciwgbGVuZ3RoKSA8IDApIHsKKyAgICAgICAgICAgIExPR0UoIm11bm1hcCBmYWlsZWQ6ICVzIiwgc3RyZXJyb3IoZXJybm8pKTsKKyAgICAgICAgICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBlcnJubyk7CisgICAgICAgICAgICBjbG9zZShmZCk7CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIE1ha2UgYXNobWVtIGFyZWEgcmVhZC1vbmx5CisgICAgaWYgKG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kLCByZXBseSwgc2l6ZW9mKHJlcGx5KSkgIT0gMCkgewogICAgICAgICByZXR1cm4gKGpib29sZWFuKUpOSV9GQUxTRTsKQEAgLTk4LDYgKzEwMSwxMSBAQAogICAgIH0KIH0KIAorc3RhdGljIGpib29sZWFuIGFuZHJvaWRfbmV0X3dpZmlfaXNEcml2ZXJMb2FkZWQoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenopCit7CisgICAgcmV0dXJuIChqYm9vbGVhbikoOjppc193aWZpX2RyaXZlcl9sb2FkZWQoKSA9PSAxKTsKK30KKwogc3RhdGljIGpib29sZWFuIGFuZHJvaWRfbmV0X3dpZmlfbG9hZERyaXZlcihKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eikKIHsKICAgICByZXR1cm4gKGpib29sZWFuKSg6OndpZmlfbG9hZF9kcml2ZXIoKSA9PSAwKTsKQEAgLTEzMCw3ICsxMzgsNyBAQAogCiBzdGF0aWMganN0cmluZyBhbmRyb2lkX25ldF93aWZpX3dhaXRGb3JFdmVudChKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eikKIHsKLSAgICBjaGFyIGJ1ZlsyNTZdOworICAgIGNoYXIgYnVmW0JVRl9TSVpFXTsKIAogICAgIGludCBucmVhZCA9IDo6d2lmaV93YWl0X2Zvcl9ldmVudChidWYsIHNpemVvZiBidWYpOwogICAgIGlmIChucmVhZCA+IDApIHsKQEAgLTE1MCwxMyArMTU4LDU5IEBACiAgICAgcmV0dXJuIGRvSW50Q29tbWFuZCgiQUREX05FVFdPUksiKTsKIH0KIAorc3RhdGljIGpib29sZWFuIGFuZHJvaWRfbmV0X3dpZmlfd3BzUGJjQ29tbWFuZChKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwganN0cmluZyBic3NpZCkKK3sKKyAgICBjaGFyIGNtZHN0cltCVUZfU0laRV07CisgICAgamJvb2xlYW4gaXNDb3B5OworCisgICAgY29uc3QgY2hhciAqYnNzaWRTdHIgPSBlbnYtPkdldFN0cmluZ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pYyBqaW50IGFuZHJvaWRfbmV0X3dpZmlfd3BzUGluRnJvbURldmljZUNvbW1hbmQoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIGpzdHJpbmcgYnNzaWQpCit7CisgICAgY2hhciBjbWRzdHJbQlVGX1NJWkVdOworICAgIGpib29sZWFuIGlzQ29weTsKKworICAgIGNvbnN0IGNoYXIgKmJzc2lkU3RyID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhic3NpZCwgJmlzQ29weSk7CisgICAgaW50IG51bVdyaXR0ZW4gPSBzbnByaW50ZihjbWRzdHIsIHNpemVvZihjbWRzdHIpLCAiV1BTX1BJTiAlcyIsIGJzc2lkU3RyKTsKKyAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhic3NpZCwgYnNzaWRTdHIpOworCisgICAgaWYgKChudW1Xcml0dGVuID09IC0xKSB8fCAobnVtV3JpdHRlbiA+PSAoaW50KXNpemVvZihjbWRzdHIpKSkgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIHJldHVybiBkb0ludENvbW1hbmQoY21kc3RyKTsKK30KKworCiBzdGF0aWMgamJvb2xlYW4gYW5kcm9pZF9uZXRfd2lmaV9zZXROZXR3b3JrVmFyaWFibGVDb21tYW5kKEpOSUVudiogZW52LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGNsYXp6LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IG5ldElkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIG5hbWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgdmFsdWUpCiB7Ci0gICAgY2hhciBjbWRzdHJbMjU2XTsKKyAgICBjaGFyIGNtZHN0cltCVUZfU0laRV07CiAgICAgamJvb2xlYW4gaXNDb3B5OwogCiAgICAgY29uc3QgY2hhciAqbmFtZVN0ciA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMobmFtZSwgJmlzQ29weSk7CkBAIC0xNzksNyArMjMzLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IG5ldElkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgbmFtZSkKIHsKLSAgICBjaGFyIGNtZHN0clsyNTZdOworICAgIGNoYXIgY21kc3RyW0JVRl9TSVpFXTsKICAgICBqYm9vbGVhbiBpc0NvcHk7CiAKICAgICBjb25zdCBjaGFyICpuYW1lU3RyID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhuYW1lLCAmaXNDb3B5KTsKQEAgLTE5Nyw3ICsyNTEsNyBAQAogCiBzdGF0aWMgamJvb2xlYW4gYW5kcm9pZF9uZXRfd2lmaV9yZW1vdmVOZXR3b3JrQ29tbWFuZChKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwgamludCBuZXRJZCkKIHsKLSAgICBjaGFyIGNtZHN0clsyNTZdOworICAgIGNoYXIgY21kc3RyW0JVRl9TSVpFXTsKIAogICAgIGludCBudW1Xcml0dGVuID0gc25wcmludGYoY21kc3RyLCBzaXplb2YoY21kc3RyKSwgIlJFTU9WRV9ORVRXT1JLICVkIiwgbmV0SWQpOwogICAgIGludCBjbWRUb29Mb25nID0gbnVtV3JpdHRlbiA+PSAoaW50KXNpemVvZihjbWRzdHIpOwpAQCAtMjEwLDcgKzI2NCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgbmV0SWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpib29sZWFuIGRpc2FibGVPdGhlcnMpCiB7Ci0gICAgY2hhciBjbWRzdHJbMjU2XTsKKyAgICBjaGFyIGNtZHN0cltCVUZfU0laRV07CiAgICAgY29uc3QgY2hhciAqY21kID0gZGlzYWJsZU90aGVycyA/ICJTRUxFQ1RfTkVUV09SSyIgOiAiRU5BQkxFX05FVFdPUksiOwogCiAgICAgaW50IG51bVdyaXR0ZW4gPSBzbnByaW50ZihjbWRzdHIsIHNpemVvZihjbWRzdHIpLCAiJXMgJWQiLCBjbWQsIG5ldElkKTsKQEAgLTIyMSw3ICsyNzUsNyBAQAogCiBzdGF0aWMgamJvb2xlYW4gYW5kcm9pZF9uZXRfd2lmaV9kaXNhYmxlTmV0d29ya0NvbW1hbmQoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIGppbnQgbmV0SWQpCiB7Ci0gICAgY2hhciBjbWRzdHJbMjU2XTsKKyAgICBjaGFyIGNtZHN0cltCVUZfU0laRV07CiAKICAgICBpbnQgbnVtV3JpdHRlbiA9IHNucHJpbnRmKGNtZHN0ciwgc2l6ZW9mKGNtZHN0ciksICJESVNBQkxFX05FVFdPUksgJWQiLCBuZXRJZCk7CiAgICAgaW50IGNtZFRvb0xvbmcgPSBudW1Xcml0dGVuID49IChpbnQpc2l6ZW9mKGNtZHN0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AgICAgICAgIDMyCisKKy8qCisgKiBUaGlzIGlzIGEgcXNvcnQoKSBjYWxsYmFjay4KKyAqCisgKiBTZWUgZHVtcE5hdGl2ZUhlYXAoKSBmb3IgY29tbWVudHMgYWJvdXQgdGhlIGRhdGEgZm9ybWF0IGFuZCBzb3J0IG9yZGVyLgorICovCitzdGF0aWMgaW50IGNvbXBhcmVIZWFwUmVjb3Jkcyhjb25zdCB2b2lkKiB2cmVjMSwgY29uc3Qgdm9pZCogdnJlYzIpCit7CisgICAgY29uc3Qgc2l6ZV90KiByZWMxID0gKGNvbnN0IHNpemVfdCopIHZyZWMxOworICAgIGNvbnN0IHNpemVfdCogcmVjMiA9IChjb25zdCBzaXplX3QqKSB2cmVjMjsKKyAgICBzaXplX3Qgc2l6ZTEgPSAqcmVjMTsKKyAgICBzaXplX3Qgc2l6ZTIgPSAqcmVjMjsKKworICAgIGlmIChzaXplMSA8IHNpemUyKSB7CisgICAgICAgIHJldHVybiAxOworICAgIH0gZWxzZSBpZiAoc2l6ZTEgPiBzaXplMikgeworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgaW50cHRyX3QqIGJ0MSA9IChpbnRwdHJfdCopKHJlYzEgKyAyKTsKKyAgICBpbnRwdHJfdCogYnQyID0gKGludHB0cl90KikocmVjMiArIDIpOworICAgIGZvciAoc2l6ZV90IGlkeCA9IDA7IGlkeCA8IEJBQ0tUUkFDRV9TSVpFOyBpZHgrKykgeworICAgICAgICBpbnRwdHJfdCBhZGRyMSA9IGJ0MVtpZHhdOworICAgICAgICBpbnRwdHJfdCBhZGRyMiA9IGJ0MltpZHhdOworICAgICAgICBpZiAoYWRkcjEgPT0gYWRkcjIpIHsKKyAgICAgICAgICAgIGlmIChhZGRyMSA9PSAwKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGFkZHIxIDwgYWRkcjIpIHsKKyAgICAgICAgICAgIHJldHVybiA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3JkQ291bnQpOworICAgIGlmIChiYWNrdHJhY2VTaXplICE9IEJBQ0tUUkFDRV9TSVpFKSB7CisgICAgICAgIGZwcmludGYoZnAsICJXQVJOSU5HOiBtaXNtYXRjaGVkIGJhY2t0cmFjZSBzaXplcyAoJWQgdnMuICVkKVxuIiwKKyAgICAgICAgICAgIGJhY2t0cmFjZVNpemUsIEJBQ0tUUkFDRV9TSVpFKTsKKyAgICB9CisgICAgZnByaW50ZihmcCwgIlxuIik7CisKKyAgICAvKiByZS1zb3J0IHRoZSBlbnRyaWVzICovCisgICAgcXNvcnQoaW5mbywgcmVjb3JkQ291bnQsIGluZm9TaXplLCBjb21wYXJlSGVhcFJlY29yZHMpOworCisgICAgLyogZHVtcCB0aGUgZW50cmllcyB0byB0aGUgZmlsZSAqLworICAgIGNvbnN0IHVpbnQ4X3QqIHB0ciA9IGluZm87CisgICAgZm9yIChzaXplX3QgaWR4ID0gMDsgaWR4IDwgcmVjb3JkQ291bnQ7IGlkeCsrKSB7CisgICAgICAgIHNpemVfdCBzaXplID0gKihzaXplX3QqKSBwdHI7CisgICAgICAgIHNpemVfdCBhbGxvY2F0aW9ucyA9ICooc2l6ZV90KikgKHB0ciArIHNpemVvZihzaXplX3QpKTsKKyAgICAgICAgaW50cHRyX3QqIGJhY2t0cmFjZSA9IChpbnRwdHJfdCopIChwdHIgKyBzaXplb2Yoc2l6ZV90KSAqIDIpOworCisgICAgICAgIGZwcmludGYoZnAsICJ6ICVkICBzeiAlOHp1ICBudW0gJTR6dSAgYnQiLAorICAgICAgICAgICAgICAgIChzaXplICYgU0laRV9GTEFHX1pZR09URV9DSElMRCkgIT0gMCwKKyAgICAgICAgICAgICAgICBzaXplICYgflNJWkVfRkxBR19aWUdPVEVfQ0hJTEQsCisgICAgICAgICAgICAgICAgYWxsb2NhdGlvbnMpOworICAgICAgICBmb3IgKHNpemVfdCBidCA9IDA7IGJ0IDwgYmFja3RyYWNlU2l6ZTsgYnQrKykgeworICAgICAgICAgICAgaWYgKGJhY2t0cmFjZVtidF0gPT0gMCkgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBmcHJpbnRmKGZwLCAiICUwOHgiLCBiYWNrdHJhY2VbYnRdKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBmcHJpbnRmKGZwLCAiXG4iKTsKKworICAgICAgICBwdHIgKz0gaW5mb1NpemU7CisgICAgfQorCisgICAgZnJlZV9tYWxsb2NfbGVha19pbmZvKGluZm8pOworCisgICAgZnByaW50ZihmcCwgIk1BUFNcbiIpOworICAgIGNvbnN0IGNoYXIqIG1hcHMgPSAiL3Byb2Mvc2VsZi9tYXBzIjsKKyAgICBGSUxFKiBpbiA9IGZvcGVuKG1hcHMsICJyIik7CisgICAgaWYgKGluID09IE5VTEwpIHsKKyAgICAgICAgZnByaW50ZihmcCwgIkNvdWxkIG5vdCBvcGVuICVzXG4iLCBtYXBzKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBjaGFyIGJ1ZltCVUZTSVpdOworICAgIHdoaWxlIChzaXplX3QgbiA9IGZyZWFkKGJ1Ziwgc2l6ZW9mKGNoYXIpLCBCVUZTSVosIGluKSkgeworICAgICAgICBmd3JpdGUoYnVmLCBzaXplb2YoY2hhciksIG4sIGZwKTsKKyAgICB9CisgICAgZmNsb3NlKGluKTsKKworICAgIGZwcmludGYoZnAsICJFTkRcbiIpOworfQorI2VuZGlmIC8qSEFWRV9BTkRST0lEX09TKi8KKworLyoKKyAqIER1bXAgdGhlIG5hdGl2ZSBoZWFwLCB3cml0aW5nIGh1bWFuLXJlYWRhYmxlIG91dHB1dCB0byB0aGUgc3BlY2lmaWVkCisgKiBmaWxlIGRlc2NyaXB0b3IuCisgKi8KK3N0YXRpYyB2b2lkIGFuZHJvaWRfb3NfRGVidWdfZHVtcE5hdGl2ZUhlYXAoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosCisgICAgam9iamVjdCBmaWxlRGVzY3JpcHRvcikKK3sKKyAgICBpZiAoZmlsZURlc2NyaXB0b3IgPT0gTlVMTCkgeworICAgICAgICBqbmlUaHJvd051bGxQb2ludGVyRXhjZXB0aW9uKGVudiwgTlVMTCk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaW50IG9yaWdGZCA9IGpuaUdldEZERnJvbUZpbGVEZXNjcmlwdG9yKGVudiwgZmlsZURlc2NyaXB0b3IpOworICAgIGlmIChvcmlnRmQgPCAwKSB7CisgICAgICAgIGpuaVRocm93UnVudGltZUV4Y2VwdGlvbihlbnYsICJJbnZhbGlkIGZpbGUgZGVzY3JpcHRvciIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyogZHVwKCkgdGhlIGRlc2NyaXB0b3Igc28gd2UgZG9uJ3QgY2xvc2UgdGhlIG9yaWdpbmFsIHdpdGggZmNsb3NlKCkgKi8KKyAgICBpbnQgZmQgPSBkdXAob3JpZ0ZkKTsKKyAgICBpZiAoZmQgPCAwKSB7CisgICAgICAgIExPR1coImR1cCglZCkgZmFpbGVkOiAlc1xuIiwgb3JpZ0ZkLCBzdHJlcnJvcihlcnJubykpOworICAgICAgICBqbmlUaHJvd1J1bnRpbWVFeGNlcHRpb24oZW52LCAiZHVwKCkgZmFpbGVkIik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBGSUxFKiBmcCA9IGZkb3BlbihmZCwgInciKTsKKyAgICBpZiAoZnAgPT0gTlVMTCkgeworICAgICAgICBMT0dXKCJmZG9wZW4oJWQpIGZhaWxlZDogJXNcbiIsIGZkLCBzdHJlcnJvcihlcnJubykpOworICAgICAgICBjbG9zZShmZCk7CisgICAgICAgIGpuaVRocm93UnVudGltZUV4Y2VwdGlvbihlbnYsICJmZG9wZW4oKSBmYWlsZWQiKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworI2lmZGVmIEhBVkVfQU5EUk9JRF9PUworICAgIExPR0QoIk5hdGl2ZSB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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIihMamF2YS9sYW5nL1N0cmluZztMamF2YS9sYW5nL1N0cmluZztJKVYiKTsKKyAgICBtZXRob2Rfb25OZXR3b3JrRGV2aWNlRGlzY29ubmVjdGVkID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uTmV0d29ya0RldmljZURpc2Nvbm5lY3RlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7KVYiKTsKIAogICAgIG1ldGhvZF9vbkNyZWF0ZVBhaXJlZERldmljZVJlc3VsdCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvbkNyZWF0ZVBhaXJlZERldmljZVJlc3VsdCIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0kpViIpOwpAQCAtMTIwLDYgKzEzMSwxNCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0kpViIpOwogICAgIG1ldGhvZF9vbkRpc3BsYXlQYXNza2V5ID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uRGlzcGxheVBhc3NrZXkiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0lJKVYiKTsKKyAgICBtZXRob2Rfb25JbnB1dERldmljZVByb3BlcnR5Q2hhbmdlZCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvbklucHV0RGV2aWNlUHJvcGVydHlDaGFuZ2VkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIihMamF2YS9sYW5nL1N0cmluZztbTGphdmEvbGFuZy9TdHJpbmc7KVYiKTsKKyAgICBtZXRob2Rfb25JbnB1dERldmljZUNvbm5lY3Rpb25SZXN1bHQgPSBlbnYtPkdldE1ldGhvZElEKGNsYXp6LCAib25JbnB1dERldmljZUNvbm5lY3Rpb25SZXN1bHQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO1opViIpOworICAgIG1ldGhvZF9vblBhbkRldmljZVByb3BlcnR5Q2hhbmdlZCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvblBhbkRldmljZVByb3BlcnR5Q2hhbmdlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7W0xqYXZhL2xhbmcvU3RyaW5nOylWIik7CisgICAgbWV0aG9kX29uUGFuRGV2aWNlQ29ubmVjdGlvblJlc3VsdCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvblBhbkRldmljZUNvbm5lY3Rpb25SZXN1bHQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO1opViIpOwogICAgIG1ldGhvZF9vblJlcXVlc3RPb2JEYXRhID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uUmVxdWVzdE9vYkRhdGEiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0kpViIpOwogCkBAIC0yMzIsNiArMjUxLDI3IEBACiAgICAgICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOwogICAgICAgICB9CiAgICAgICAgIGRidXNfYnVzX2FkZF9tYXRjaChuYXQtPmNvbm4sCisgICAgICAgICAgICAgICAgInR5cGU9J3NpZ25hbCcsaW50ZXJmYWNlPSciQkxVRVpfREJVU19CQVNFX0lGQyIuSW5wdXQnIiwKKyAgICAgICAgICAgICAgICAmZXJyKTsKKyAgICAgICAgaWYgKGRidXNfZXJyb3JfaXNfc2V0KCZlcnIpKSB7CisgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUigmZXJyKTsKKyAgICAgICAgICAgIHJldHVybiBKTklfRkFMU0U7CisgICAgICAgIH0KKyAgICAgICAgZGJ1c19idXNfYWRkX21hdGNoKG5hdC0+Y29ubiwKKyAgICAgICAgICAgICAgICAidHlwZT0nc2lnbmFsJyxpbnRlcmZhY2U9JyJCTFVFWl9EQlVTX0JBU0VfSUZDIi5OZXR3b3JrJyIsCisgICAgICAgICAgICAgICAgJmVycik7CisgICAgICAgIGlmIChkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkgeworICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1IoJmVycik7CisgICAgICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOworICAgICAgICB9CisgICAgICAgIGRidXNfYnVzX2FkZF9tYXRjaChuYXQtPmNvbm4sCisgICAgICAgICAgICAgICAgInR5cGU9J3NpZ25hbCcsaW50ZXJmYWNlPSciQkxVRVpfREJVU19CQVNFX0lGQyIuTmV0d29ya1NlcnZlciciLAorICAgICAgICAgICAgICAgICZlcnIpOworICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKKyAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SKCZlcnIpOworICAgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgICAgICAgfQorICAgICAgICBkYnVzX2J1c19hZGRfbWF0Y2gobmF0LT5jb25uLAogICAgICAgICAgICAgICAgICJ0eXBlPSdzaWduYWwnLGludGVyZmFjZT0nb3JnLmJsdWV6LkF1ZGlvU2luayciLAogICAgICAgICAgICAgICAgICZlcnIpOwogICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKQEAgLTM5MCwxMyArNDMwLDMxIEBACiAgICAgICAgIGRidXNfY29ubmVjdGlvbl91bnJlZ2lzdGVyX29iamVjdF9wYXRoKG5hdC0+Y29ubiwgYWdlbnRfcGF0aCk7CiAKICAgICAgICAgZGJ1c19idXNfcmVtb3ZlX21hdGNoKG5hdC0+Y29ubiwKLSAgICAgICAgICAgICAgICAidHlwZT0nc2lnbmFsJyxpbnRlcmZhY2U9J29yZy5ibHVlei5BdWRpb1NpbmsnIiwKKyAgICAgICAgICAgICAgICAidHlwZT0nc2lnbmFsJyxpbnRlcmZhY2U9JyJCTFVFWl9EQlVTX0JBU0VfSUZDIi5BdWRpb1NpbmsnIiwKICAgICAgICAgICAgICAgICAmZXJyKTsKICAgICAgICAgaWYgKGRidXNfZXJyb3JfaXNfc2V0KCZlcnIpKSB7CiAgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUigmZXJyKTsKICAgICAgICAgfQogICAgICAgICBkYnVzX2J1c19yZW1vdmVfbWF0Y2gobmF0LT5jb25uLAotICAgICAgICAgICAgICAgICJ0eXBlPSdzaWduYWwnLGludGVyZmFjZT0nb3JnLmJsdWV6LkRldmljZSciLAorICAgICAgICAgICAgICAgICJ0eXBlPSdzaWduYWwnLGludGVyZmFjZT0nIkJMVUVaX0RCVVNfQkFTRV9JRkMiLkRldmljZSciLAorICAgICAgICAgICAgICAgICZlcnIpOworICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKKyAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SKCZlcnIpOworICAgICAgICB9CisgICAgICAgIGRidXNfYnVzX3JlbW92ZV9tYXRjaChuYXQtPmNvbm4sCisgICAgICAgICAgICAgICAgInR5cGU9J3NpZ25hbCcsaW50ZXJmYWNlPSciQkxVRVpfREJVU19CQVNFX0lGQyIuSW5wdXQnIiwKKyAgICAgICAgICAgICAgICAmZXJyKTsKKyAgICAgICAgaWYgKGRidXNfZXJyb3JfaXNfc2V0KCZlcnIpKSB7CisgICAgICAgICAgICB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IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uRGV2aWNlRGlzY29ubmVjdFJlcXVlc3RlZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihyZW1vdGVfZGV2aWNlX3BhdGgpKTsKICAgICAgICAgZ290byBzdWNjZXNzOworICAgIH0gZWxzZSBpZiAoZGJ1c19tZXNzYWdlX2lzX3NpZ25hbChtc2csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouSW5wdXQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUHJvcGVydHlDaGFuZ2VkIikpIHsKKworICAgICAgICBqb2JqZWN0QXJyYXkgc3RyX2FycmF5ID0KKyAgICAgICAgICAgICAgICAgICAgcGFyc2VfaW5wdXRfcHJvcGVydHlfY2hhbmdlKGVudiwgbXNnKTsKKyAgICAgICAgaWYgKHN0cl9hcnJheSAhPSBOVUxMKSB7CisgICAgICAgICAgICBjb25zdCBjaGFyICpjX3BhdGggPSBkYnVzX21lc3NhZ2VfZ2V0X3BhdGgobXNnKTsKKyAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uSW5wdXREZXZpY2VQcm9wZXJ0eUNoYW5nZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfcGF0aCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cl9hcnJheSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUl9XSVRIX01TRygmZXJyLCBtc2cpOworICAgICAgICB9CisgICAgICAgIGdvdG8gc3VjY2VzczsKKyAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouTmV0d29yayIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlByb3BlcnR5Q2hhbmdlZCIpKSB7CisKKyAgICAgICBqb2JqZWN0QXJyYXkgc3RyX2FycmF5ID0KKyAgICAgICAgICAgICAgICAgICBwYXJzZV9wYW5fcHJvcGVydHlfY2hhbmdlKGVudiwgbXNnKTsKKyAgICAgICBpZiAoc3RyX2FycmF5ICE9IE5VTEwpIHsKKyAgICAgICAgICAgY29uc3QgY2hhciAqY19wYXRoID0gZGJ1c19tZXNzYWdlX2dldF9wYXRoKG1zZyk7CisgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25QYW5EZXZpY2VQcm9wZXJ0eUNoYW5nZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW52LT5OZXdTdHJpbmdVVEYoY19wYXRoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJfYXJyYXkpOworICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7CisgICAgICAgfQorICAgICAgIGdvdG8gc3VjY2VzczsKKyAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouTmV0d29ya1NlcnZlciIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkRldmljZURpc2Nvbm5lY3RlZCIpKSB7CisgICAgICAgY2hhciAqY19hZGRyZXNzOworICAgICAgIGlmIChkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCAmZXJyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7CisgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25OZXR3b3JrRGV2aWNlRGlzY29ubmVjdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfYWRkcmVzcykpOworICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7CisgICAgICAgfQorICAgICAgIGdvdG8gc3VjY2VzczsKKyAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouTmV0d29ya1NlcnZlciIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkRldmljZUNvbm5lY3RlZCIpKSB7CisgICAgICAgY2hhciAqY19hZGRyZXNzOworICAgICAgIGNoYXIgKmNfaWZhY2U7CisgICAgICAgdWludDE2X3QgdXVpZDsKKworICAgICAgIGlmIChkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCAmZXJyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfaWZhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1VJTlQxNiwgJnV1aWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7CisgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25OZXR3b3JrRGV2aWNlQ29ubmVjdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfYWRkcmVzcyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW52LT5OZXdTdHJpbmdVVEYoY19pZmFjZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXVpZCk7CisgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKKyAgICAgICB9CisgICAgICAgZ290byBzdWNjZXNzOwogICAgIH0KIAogICAgIHJldCA9IGEyZHBfZXZlbnRfZmlsdGVyKG1zZywgZW52KTsKQEAgLTEyNzAsNiArMTM5NSw1NyBAQAogICAgIGVudi0+RGVsZXRlTG9jYWxSZWYoYWRkcik7CiAgICAgZnJlZSh1c2VyKTsKIH0KKwordm9pZCBvbklucHV0RGV2aWNlQ29ubmVjdGlvblJlc3VsdChEQnVzTWVzc2FnZSAqbXNnLCB2b2lkICp1c2VyLCB2b2lkICpuKSB7CisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworCisgICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gKG5hdGl2ZV9kYXRhX3QgKiluOworICAgIGNvbnN0IGNoYXIgKnBhdGggPSAoY29uc3QgY2hhciAqKXVzZXI7CisgICAgREJ1c0Vycm9yIGVycjsKKyAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CisgICAgSk5JRW52ICplbnY7CisgICAgbmF0LT52bS0+R2V0RW52KCh2b2lkKiopJmVudiwgbmF0LT5lbnZWZXIpOworCisgICAgYm9vbCByZXN1bHQgPSBKTklfVFJVRTsKKyAgICBpZiAoZGJ1c19zZXRfZXJyb3JfZnJvbV9tZXNzYWdlKCZlcnIsIG1zZykpIHsKKyAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1IoJmVycik7CisgICAgICAgIHJlc3VsdCA9IEpOSV9GQUxTRTsKKyAgICB9CisgICAgTE9HVigiLi4uIERldmljZSBQYXRoID0gJXMsIHJlc3VsdCA9ICVkIiwgcGF0aCwgcmVzdWx0KTsKKyAgICBqc3RyaW5nIGpQYXRoID0gZW52LT5OZXdTdHJpbmdVVEYocGF0aCk7CisgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLAorICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uSW5wdXREZXZpY2VDb25uZWN0aW9uUmVzdWx0LAorICAgICAgICAgICAgICAgICAgICAgICAgalBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQpOworICAgIGVudi0+RGVsZXRlTG9jYWxSZWYoalBhdGgpOworICAgIGZyZWUodXNlcik7Cit9CisKK3ZvaWQgb25QYW5EZXZpY2VDb25uZWN0aW9uUmVzdWx0KERCdXNNZXNzYWdlICptc2csIHZvaWQgKnVzZXIsIHZvaWQgKm4pIHsKKyAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CisKKyAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSAobmF0aXZlX2RhdGFfdCAqKW47CisgICAgY29uc3QgY2hhciAqcGF0aCA9IChjb25zdCBjaGFyICopdXNlcjsKKyAgICBEQnVzRXJyb3IgZXJyOworICAgIGRidXNfZXJyb3JfaW5pdCgmZXJyKTsKKyAgICBKTklFbnYgKmVudjsKKyAgICBuYXQtPnZtLT5HZXRFbnYoKHZvaWQqKikmZW52LCBuYXQtPmVudlZlcik7CisKKyAgICBib29sIHJlc3VsdCA9IEpOSV9UUlVFOworICAgIGlmIChkYnVzX3NldF9lcnJvcl9mcm9tX21lc3NhZ2UoJmVyciwgbXNnKSkgeworICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUigm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G9vcF9uYXRpdmVfZGF0YShlbnYsIGV2ZW50TG9vcCk7CisKKyAgICBpZiAobmF0ICYmIGV2ZW50TG9vcE5hdCkgeworICAgICAgICBjb25zdCBjaGFyICpjX3BhdGggPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKHBhdGgsIE5VTEwpOworCisgICAgICAgIGludCBsZW4gPSBlbnYtPkdldFN0cmluZ0xlbmd0aChwYXRoKSArIDE7CisgICAgICAgIGNoYXIgKmNvbnRleHRfcGF0aCA9IChjaGFyICopY2FsbG9jKGxlbiwgc2l6ZW9mKGNoYXIpKTsKKyAgICAgICAgc3RybGNweShjb250ZXh0X3BhdGgsIGNfcGF0aCwgbGVuKTsgIC8vIGZvciBjYWxsYmFjaworCisgICAgICAgIGJvb2wgcmV0ID0gZGJ1c19mdW5jX2FyZ3NfYXN5bmMoZW52LCBuYXQtPmNvbm4sIC0xLCBvbklucHV0RGV2aWNlQ29ubmVjdGlvblJlc3VsdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0X3BhdGgsIGV2ZW50TG9vcE5hdCwgY19wYXRoLCBEQlVTX0lOUFVUX0lGQUNFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDb25uZWN0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7CisKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMocGF0aCwgY19wYXRoKTsKKyAgICAgICAgcmV0dXJuIHJldCA/IEpOSV9UUlVFIDogSk5JX0ZBTFNFOworICAgIH0KKyNlbmRpZgorICAgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK3N0YXRpYyBqYm9vbGVhbiBkaXNjb25uZWN0SW5wdXREZXZpY2VOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgcGF0aCkgeworICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7CisgICAgam9iamVjdCBldmVudExvb3AgPSBlbnYtPkdldE9iamVjdEZpZWxkKG9iamVjdCwgZmllbGRfbUV2ZW50TG9vcCk7CisgICAgc3RydWN0IGV2ZW50X2xvb3BfbmF0aXZlX2RhdGFfdCAqZXZlbnRMb29wTmF0ID0KKyAgICAgICAgICAgIGdldF9FdmVudExvb3BfbmF0aXZlX2RhdGEoZW52LCBldmVudExvb3ApOworCisgICAgaWYgKG5hdCAmJiBldmVudExvb3BOYXQpIHsKKyAgICAgICAgY29uc3QgY2hhciAqY19wYXRoID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhwYXRoLCBOVUxMKTsKKworICAgICAgICBpbnQgbGVuID0gZW52LT5HZXRTdHJpbmdMZW5ndGgocGF0aCkgKyAxOworICAgICAgICBjaGFyICpjb250ZXh0X3BhdGggPSAoY2hhciAqKWNhbGxvYyhsZW4sIHNpemVvZihjaGFyKSk7CisgICAgICAgIHN0cmxjcHkoY29udGV4dF9wYXRoLCBjX3BhdGgsIGxlbik7ICAvLyBmb3IgY2FsbGJhY2sKKworICAgICAgICBib29sIHJldCA9IGRidXNfZnVuY19hcmdzX2FzeW5jKGVudiwgbmF0LT5jb25uLCAtMSwgb25JbnB1dERldmljZUNvbm5lY3Rpb25SZXN1bHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dF9wYXRoLCBldmVudExvb3BOYXQsIGNfcGF0aCwgREJVU19JTlBVVF9JRkFDRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRGlzY29ubmVjdCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOworCisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ1VURkNoYXJzKHBhdGgsIGNfcGF0aCk7CisgICAgICAgIHJldHVybiByZXQgPyBKTklfVFJVRSA6IEpOSV9GQUxTRTsKKyAgICB9CisjZW5kaWYKKyAgICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitzdGF0aWMgamJvb2xlYW4gc2V0Qmx1ZXRvb3RoVGV0aGVyaW5nTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCwgamJvb2xlYW4gdmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgc3JjX3JvbGUsIGpzdHJpbmcgYnJpZGdlKSB7CisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKKyAgICBpZiAobmF0KSB7CisgICAgICAgIERCdXNNZXNzYWdlICpyZXBseTsKKyAgICAgICAgY29uc3QgY2hhciAqY19yb2xlID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhzcmNfcm9sZSwgTlVMTCk7CisgICAgICAgIGNvbnN0IGNoYXIgKmNfYnJpZGdlID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhicmlkZ2UsIE5VTEwpOworICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgIExPR0UoInNldEJsdWV0b290aFRldGhlcmluZ05hdGl2ZSB0cnVlIik7CisgICAgICAgICAgICByZXBseSA9IGRidXNfZnVuY19hcmdzKGVudiwgbmF0LT5jb25uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldF9hZGFwdGVyX3BhdGgoZW52LCBvYmplY3QpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfTkVUV09SS1NFUlZFUl9JRkFDRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUmVnaXN0ZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX3JvbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfYnJpZGdlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExPR0UoInNldEJsdWV0b290aFRldGhlcmluZ05hdGl2ZSBmYWxzZSIpOworICAgICAgICAgICAgcmVwbHkgPSBkYnVzX2Z1bmNfYXJncyhlbnYsIG5hdC0+Y29ubiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRfYWRhcHRlcl9wYXRoKGVudiwgb2JqZWN0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX05FVFdPUktTRVJWRVJfSUZBQ0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVucmVnaXN0ZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX3JvbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOworICAgICAgICB9CisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ1VURkNoYXJzKHNyY19yb2xlLCBjX3JvbGUpOworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhicmlkZ2UsIGNfYnJpZGdlKTsKKyAgICAgICAgcmV0dXJuIHJlcGx5ID8gSk5JX1RSVUUgOiBKTklfRkFMU0U7CisgICAgfQorI2VuZGlmCisgICAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworc3RhdGljIGpib29sZWFuIGNvbm5lY3RQ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YXRoLCBsZW4pOyAgLy8gZm9yIGNhbGxiYWNrCisKKyAgICAgICAgYm9vbCByZXQgPSBkYnVzX2Z1bmNfYXJnc19hc3luYyhlbnYsIG5hdC0+Y29ubiwgLTEsb25QYW5EZXZpY2VDb25uZWN0aW9uUmVzdWx0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dF9wYXRoLCBldmVudExvb3BOYXQsIGNfcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfTkVUV09SS19JRkFDRSwgIkNvbm5lY3QiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7CisKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMocGF0aCwgY19wYXRoKTsKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMoc3JjUm9sZSwgc3JjKTsKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMoZHN0Um9sZSwgZHN0KTsKKyAgICAgICAgcmV0dXJuIHJldCA/IEpOSV9UUlVFIDogSk5JX0ZBTFNFOworICAgIH0KKyNlbmRpZgorICAgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK3N0YXRpYyBqYm9vbGVhbiBkaXNjb25uZWN0UGFuRGV2aWNlTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIHBhdGgpIHsKKyAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CisjaWZkZWYgSEFWRV9CTFVFVE9PVEgKKyAgICBMT0dFKCJkaXNjb25uZWN0UGFuRGV2aWNlTmF0aXZlIik7CisgICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKKyAgICBqb2JqZWN0IGV2ZW50TG9vcCA9IGVudi0+R2V0T2JqZWN0RmllbGQob2JqZWN0LCBmaWVsZF9tRXZlbnRMb29wKTsKKyAgICBzdHJ1Y3QgZXZlbnRfbG9vcF9uYXRpdmVfZGF0YV90ICpldmVudExvb3BOYXQgPQorICAgICAgICAgICAgZ2V0X0V2ZW50TG9vcF9uYXRpdmVfZGF0YShlbnYsIGV2ZW50TG9vcCk7CisKKyAgICBpZiAobmF0ICYmIGV2ZW50TG9vcE5hdCkgeworICAgICAgICBjb25zdCBjaGFyICpjX3BhdGggPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKHBhdGgsIE5VTEwpOworCisgICAgICAgIGludCBsZW4gPSBlbnYtPkdldFN0cmluZ0xlbmd0aChwYXRoKSArIDE7CisgICAgICAgIGNoYXIgKmNvbnRleHRfcGF0aCA9IChjaGFyICopY2FsbG9jKGxlbiwgc2l6ZW9mKGNoYXIpKTsKKyAgICAgICAgc3RybGNweShjb250ZXh0X3BhdGgsIGNfcGF0aCwgbGVuKTsgIC8vIGZvciBjYWxsYmFjaworCisgICAgICAgIGJvb2wgcmV0ID0gZGJ1c19mdW5jX2FyZ3NfYXN5bmMoZW52LCBuYXQtPmNvbm4sIC0xLG9uUGFuRGV2aWNlQ29ubmVjdGlvblJlc3VsdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0X3BhdGgsIGV2ZW50TG9vcE5hdCwgY19wYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfTkVUV09SS19JRkFDRSwgIkRpc2Nvbm5lY3QiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JT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x1ZShKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBpZGVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNob3J0IGRlbnNpdHksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3Qgb3V0VmFsdWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpib29sZWFuIHJlc29sdmUpCiB7CkBAIC03MTMsNyArNzE0LDcgQEAKICAgICBSZXNfdmFsdWUgdmFsdWU7CiAgICAgUmVzVGFibGVfY29uZmlnIGNvbmZpZzsKICAgICB1aW50MzJfdCB0eXBlU3BlY0ZsYWdzOwotICAgIHNzaXplX3QgYmxvY2sgPSByZXMuZ2V0UmVzb3VyY2UoaWRlbnQsICZ2YWx1ZSwgZmFsc2UsICZ0eXBlU3BlY0ZsYWdzLCAmY29uZmlnKTsKKyAgICBzc2l6ZV90IGJsb2NrID0gcmVzLmdldFJlc291cmNlKGlkZW50LCAmdmFsdWUsIGZhbHNlLCBkZW5zaXR5LCAmdHlwZVNwZWNGbGFncywgJmNvbmZpZyk7CiAjaWYgVEhST1dfT05fQkFEX0lECiAgICAgaWYgKGJsb2NrID09IEJBRF9JTkRFWCkgewogICAgICAgICBqbmlUaHJvd0V4Y2VwdGlvbihlbnYsICJqYXZhL2xhbmcvSWxsZWdhbFN0YXRlRXhjZXB0aW9uIiwgIkJhZCByZXNvdXJjZSEiKTsKQEAgLTE3MDMsNyArMTcwNCw3IEBACiAgICAgICAgICh2b2lkKikgYW5kcm9pZF9jb250ZW50X0Fzc2V0TWFuYWdlcl9nZXRSZXNvdXJjZVR5cGVOYW1lIH0sCiAgICAgeyAiZ2V0UmVzb3VyY2VFb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Jlci0+ZHJhd0NvbG9yKGNvbG9yLCBtb2RlKTsKK30KKworc3RhdGljIHZvaWQgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19kcmF3UmVjdChKTklFbnYqIGVudiwgam9iamVjdCBjYW52YXMsCisgICAgICAgIE9wZW5HTFJlbmRlcmVyKiByZW5kZXJlciwgamZsb2F0IGxlZnQsIGpmbG9hdCB0b3AsIGpmbG9hdCByaWdodCwgamZsb2F0IGJvdHRvbSwKKyAgICAgICAgU2tQYWludCogcGFpbnQpIHsKKyAgICByZW5kZXJlci0+ZHJhd1JlY3QobGVmdCwgdG9wLCByaWdodCwgYm90dG9tLCBwYWludCk7Cit9CisKK3N0YXRpYyB2b2lkIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfZHJhd1JlY3RzKEpOSUVudiogZW52LCBqb2JqZWN0IGNhbnZhcywKKyAgICAgICAgT3BlbkdMUmVuZGVyZXIqIHJlbmRlcmVyLCBTa1JlZ2lvbiogcmVnaW9uLCBTa1BhaW50KiBwYWludCkgeworICAgIFNrUmVnaW9uOjpJdGVyYXRvciBpdCgqcmVnaW9uKTsKKyAgICB3aGlsZSAoIWl0LmRvbmUoKSkgeworICAgICAgICBjb25zdCBTa0lSZWN0JiByID0gaXQucmVjdCgpOworICAgICAgICByZW5kZXJlci0+ZHJhd1JlY3Qoci5mTGVmdCwgci5mVG9wLCByLmZSaWdodCwgci5mQm90dG9tLCBwYWludCk7CisgICAgICAgIGl0Lm5leHQoKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfZHJhd1BhdGgoSk5JRW52KiBlbnYsIGpvYmplY3QgY2FudmFzLAorICAgICAgICBPcGVuR0xSZW5kZXJlciogcmVuZGVyZXIsIFNrUGF0aCogcGF0aCwgU2tQYWludCogcGFpbnQpIHsKKyAgICByZW5kZXJlci0+ZHJhd1BhdGgocGF0aCwgcGFpbnQpOworfQorCitzdGF0aWMgdm9pZ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MsIFNrUGFpbnQqIHBhaW50KSB7CisgICAgY29uc3QgamNoYXIgKndvcmtUZXh0OworICAgIGpjaGFyKiBidWZmZXIgPSBOVUxMOworICAgIGludDMyX3Qgd29ya0J5dGVzOworICAgIGlmIChUZXh0TGF5b3V0OjpwcmVwYXJlVGV4dChwYWludCwgdGV4dCwgY291bnQsIGZsYWdzLCAmd29ya1RleHQsICZ3b3JrQnl0ZXMsICZidWZmZXIpKSB7CisgICAgICAgIHJlbmRlcmVyLT5kcmF3VGV4dCgoY29uc3QgY2hhciopIHdvcmtUZXh0LCB3b3JrQnl0ZXMsIGNvdW50LCB4LCB5LCBwYWludCk7CisgICAgICAgIGZyZWUoYnVmZmVyKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkIHJlbmRlclRleHRSdW4oT3BlbkdMUmVuZGVyZXIqIHJlbmRlcmVyLCBjb25zdCBqY2hhciogdGV4dCwKKyAgICAgICAgamludCBzdGFydCwgamludCBjb3VudCwgamludCBjb250ZXh0Q291bnQsIGpmbG9hdCB4LCBqZmxvYXQgeSwKKyAgICAgICAgaW50IGZsYWdzLCBTa1BhaW50KiBwYWludCkgeworICAgIHVpbnQ4X3QgcnRsID0gZmxhZ3MgJiAweDE7CisgICAgaWYgKHJ0bCkgeworICAgICAgICBTa0F1dG9TVE1hbGxvYzw4MCwgamNoYXI+IGJ1ZmZlcihjb250ZXh0Q291bnQpOworICAgICAgICBqY2hhciogc2hhcGVkID0gYnVmZmVyLmdldCgpOworICAgICAgICBpZiAoVGV4dExheW91dDo6cHJlcGFyZVJ0bFRleHRSdW4odGV4dCwgc3RhcnQsIGNvdW50LCBjb250ZXh0Q291bnQsIHNoYXBlZCkpIHsKKyAgICAgICAgICAgIHJlbmRlcmVyLT5kcmF3VGV4dCgoY29uc3QgY2hhciopIHNoYXBlZCwgY291bnQgPDwgMSwgY291bnQsIHgsIHksIHBhaW50KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExPR1coImRyYXdUZXh0UnVuIGVycm9yIik7CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICByZW5kZXJlci0+ZHJhd1RleHQoKGNvbnN0IGNoYXIqKSAodGV4dCArIHN0YXJ0KSwgY291bnQgPDwgMSwgY291bnQsIHgsIHksIHBhaW50KTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfZHJhd1RleHRBcnJheShKTklFbnYqIGVudiwgam9iamVjdCBjYW52YXMsCisgICAgICAgIE9wZW5HTFJlbmRlcmVyKiByZW5kZXJlciwgamNoYXJBcnJheSB0ZXh0LCBpbnQgaW5kZXgsIGludCBjb3VudCwKKyAgICAgICAgamZsb2F0IHgsIGpmbG9hdCB5LCBpbnQgZmxhZ3MsIFNrUGFpbnQqIHBhaW50KSB7CisgICAgamNoYXIqIHRleHRBcnJheSA9IGVudi0+R2V0Q2hhckFycmF5RWxlbWVudHModGV4dCwgTlVMTCk7CisgICAgcmVuZGVyVGV4dChyZW5kZXJlciwgdGV4dEFycmF5ICsgaW5kZXgsIGNvdW50LCB4LCB5LCBmbGFncywgcGFpbnQpOworICAgIGVudi0+UmVsZWFzZUNoYXJBcnJheUVsZW1lbnRzKHRleHQsIHRleHRBcnJheSwgSk5JX0FCT1JUKTsKK30KKworc3RhdGljIHZvaWQgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19kcmF3VGV4dChKTklFbnYqIGVudiwgam9iamVjdCBjYW52YXMsCisgICAgICAgIE9wZW5HTFJlbmRlcmVyKiByZW5kZXJlciwganN0cmluZyB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCisgICAgICAgIGpmbG9hdCB4LCBqZmxvYXQgeSwgaW50IGZsYWdzLCBTa1BhaW50KiBwYWludCkgeworICAgIGNvbnN0IGpjaGFyKiB0ZXh0QXJyYXkgPSBlbnYtPkdldFN0cmluZ0NoYXJzKHRleHQsIE5VTEwpOworICAgIHJlbmRlclRleHQocmVuZG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HBoYSB9LAorCisgICAgeyAiblF1aWNrUmVqZWN0IiwgICAgICAgIihJRkZGRkkpWiIsICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19xdWlja1JlamVjdCB9LAorICAgIHsgIm5DbGlwUmVjdCIsICAgICAgICAgICIoSUZGRkZJKVoiLCAgICAgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfY2xpcFJlY3RGIH0sCisgICAgeyAibkNsaXBSZWN0IiwgICAgICAgICAgIihJSUlJSUkpWiIsICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19jbGlwUmVjdCB9LAorCisgICAgeyAiblRyYW5zbGF0ZSIsICAgICAgICAgIihJRkYpViIsICAgICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc190cmFuc2xhdGUgfSwKKyAgICB7ICJuUm90YXRlIiwgICAgICAgICAgICAiKElGKVYiLCAgICAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX3JvdGF0ZSB9LAorICAgIHsgIm5TY2FsZSIsICAgICAgICAgICAgICIoSUZGKVYiLCAgICAgICAgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfc2NhbGUgfSwKKworICAgIHsgIm5TZXRNYXRyaXgiLCAgICAgICAgICIoSUkpViIsICAgICAgICAgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfc2V0TWF0cml4IH0sCisgICAgeyAibkdldE1hdHJpeCIsICAgICAgICAgIihJKUkiLCAgICAgICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19nZXROYXRpdmVNYXRyaXggfSwKKyAgICB7ICJuR2V0TWF0cml4IiwgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX2dldE1hdHJp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ub2Y1dGUKKy5vMmZ0Cisub3I1YTF0bworLm8xcmEKKy5vcjNjCisub3IxZAorLm9yM3QKKy5vczMKKy5vczR0bAorLjRvdGgzCisub3V0MworLm91MgorLnBlZDVhbAorLjJwMmVkCisucDJlMmQyYQorLnBlNXRlCisucGUydAorLnBlNXRpdAorLnAyaTRlNAorLnBpbzVuNAorLjNwMmkxbworLnBpMnQKKy5wcmUzbQorLnByMgorLnJhNGMKKy5yYW40dAorLnJhMm4KKy5yYXRpbzVuMWEKKy5yYXRpbzJuNAorLnJhMXQyaW8KKy5yZWUyCisucmU1bWl0CisucmVzMgorLnJlNXN0YXQKKy5yZXMydAorLnJlczF0YQorLnIyaTRnCisucmkydDV1Cisucm80cQorLnJvczV0Cisucm93NWQKKy5ydTRkCisuM3M0YzJpM2U0CisuczFjaQorLjVzZTJsMmY1Cisuc2VsMWw1Cisuc2UybgorLnNlNXIyaWU0Cisuc2VyMWkKKy5zMmgyCisuc2kyCisuczNpbmc0CisuMnMxaW4KKy5zdDQKKy5zdGE1YjJsMgorLnMxdGEKKy5zMnRhYgorLnM0eTIKKy4xdGE0CisudGU0CisuM3RlbjVhMm4KKy50ZTFuYQorLnRoMgorLnRpMgorLnRpbDQKKy50aTFtNW81CisuMXRpbQorLnRpbmc0CisuMnQxaW4KKy50NGk0bjVrMgorLnRvMW40YQorLjF0bworLnRvMm4KKy50bzRwCisudG9wNWkKKy50bzJ1NXMKKy50b3UyCisudHJpYjV1dAorLnRyNGliCisudTFuMWEKKy51bjNjZQorLnVuZGVyNQorLnVuMWRlCisudTJuMWUKKy51NG41azIKKy51bjVvCisudW4zdTQKKy51cDMKKy51cmUzCisudXM1YTIKKy4ydXMKKy52ZW40ZGUKKy52ZTVyMWEKKy53aWw1aQorLndpMgorLndpbDIKKy55ZTQKKzRhYi4KK2E1YmFsCithNWJhMm4KK2FiZTIKK2FiNWVyZAorYWIyaTVhCithYjVpMnQ1YWIKK2FiaTJ0CithYmkxdGEKK2FiNWxhdAorYWIybDIKK2FiNW81bDFpegorYWJvbDJpCis0YWJyCithYjVyb2cKK2FiM3VsCithNGMyYTJyCithMWNhCithYzVhcmQKK2FjNWFybworYTVjZW91MgorYWMxZXIKK2E1Y2hlNHQKK2EyY2gKK2FjaGUyCis0YTJjaQorYTNjMmllNAorYTJjMWluCithM2MyaW8KK2FjNXJvYgorYWN0NWlmMgorYTJjMXQKK2FjM3VsCithYzR1bQorYTJkCithZDRkMWluCithZDFkNAorYWQ1ZXIuCisyYWRpCithM2Q0aTNhCithZDNpMWNhCithZGk0ZXIKK2FkMmllNAorYTNkMmlvCithM2RpdAorYTVkaTF1CithZDRsZQorYWQzb3cKK2ExZG8KK2FkNXJhMm4KK2ExZHIKK2FkNHN1CithMmQxczIKKzRhMWR1CithM2R1MmMKK2FkNXVtCithZTRyCithZXIyaTRlNAorYWVyMWkKK2EyZgorYTRmMWY0CithNGdhYgorYTFnYQorYWdhNG4KK2FnNWVsMWwKK2ExZ2U0bworNGFnNGV1CithZzFpCis0YWc0bDIKK2FnMW4KK2EyZ28KKzNhM2c0bzRnCithZzNvM25pCithZ28ybjIKK2E1Z3VlcgorYTJndWUKK2FnNXVsCithNGd5CithM2hhCithM2hlCithNGg0bDQKK2EzaG8KK2FpMgorYTVpMWEKK2EzaWMuCithaTVseQorYTRpNG4KK2FpbjVpbgorYTJpbmkKK2EyaTFuNW8KK2FpdDVlbgorYTJpdGUKK2ExagorYWsxZW4KK2FsNWFiCithbDNhMmQKK2E0bDJhMnIKKzRhbGRpNAorYTJsZAorMmFsZQorYWwzZW5kCithNGxlbnQyaQorYTFsZW4xdAorYTVsZTVvCithbDFpCithbDRpYS4KK2FsMmkxYQorYWwyaTRlNAorYWw1bGV2CithbDFsCithbDJsZQorNGFsbGljCithbGwyaQorNGEybG0KK2E1bG9nLgorYTRseS4KK2ExbHkKKzRhMmx5czQKKzVhNWx5czF0Cis1YWx5dAorM2FseXoKKzRhMW1hCithMm01YWIKK2FtM2FnCithbWE1cmEKK2FtMmEycgorYW01YXNjCithNG1hM3RpcworYTRtNWExdG8KK2FtNWVyMWEKK2FtM2ljCithbTVpZgorYW01aTFseQorYW0xaW4KK2FtMmk0bm8KK2EybW8KK2E1bW8ybgorYW1vcjVpCithbW8ycgorYW1wNWVuCithNG0xcAorYTJuCithbjNhZ2UKK2ExbmEKKzNhbmExbHkKK2EzbjJhMnIKK2FuM2FyM2MKK2FuYXI0aQorYTNuYXRpCithbjJhdAorNGFuZAorYW5kZTRzMgorYW4xZGUKK2FuM2RpczEKK2FuMWRsCithbjRkb3cKK2FuMWRvCithNW5lZQorYTNuZW4KK2FuNWUyc3QuCithMW5lcworYTJuZXN0CithM240ZXUKKzJhbmcKK2FuZzVpZTQKK2FuMWdsMgorYTRuMWljCithM25pZXMKK2FuMmllNAorYW4zaTNmCithbjRpbWUKK2FuMWltCithNW5pbTFpCithNW4yaW5lCithbjFpbgorYW4zaTRvCithM24yaXAKK2FuM2lzMmgKK2FuM2l0CithM25pMXUKK2FuNGtsaQorYTRuazIKK2FuMWsxbAorNWFubml6CithNG4xbjIKK2FubzQKK2FuNW90CithbjRvdGg1CithbjJzYTIKK2EybjFzMgorYW40czFjbworYW5zNGMKK2FuNHMxbjQKK2FuMnNwCithbnMzcG8KK2FuNHN0CithbjRzdTJyCithbjFzdQorYW50YTJsNAorYW4xdAorYW4xdGEKK2FuNHQyaWU0CithbnQyaQorNGFuMXRvCithbjJ0cgorYW40dHc0CithbjN1MWEKK2FuM3VsCithNW51cgorNGFvCithcDJhMnI0CithMXBhCithcDVhdAorYXA1ZXIzbworYTNwaDRlcgorNGFwaGkKK2E0cGlsbGEKK2FwaWwxbAorYXA1aWxsMmEycgorYXAzaTJuCithcDNpMXRhCithM3BpMnR1CithMnAybDIKK2FwbzRjNQorYXA1bzFsYQorYXBvcjVpCithMXA0b3IKK2Fwb3MzdAorYTFwb3MKK2FwczVlNHMKK2EycDFzMgorYXAyc2UKK2EzcHUKK2FxdWU1CithcXUyCisyYTJyCithcjNhMmMxdAorYTVyYWRlCithcmEyZAorYXI1YWRpczEKK2FyMmFkaQorYXIzYWwKK2E1cmFtZTF0ZQorYXJhbTNldAorYXIyYW40ZworYXJhMm4KK2FyYTNwCithcjRhdAorYTVyYTF0MmlvCithcjVhMXQyaXYKK2E1cmF1CithcjVhdjQKK2FyYXc0CithcmJhbDQKK2FyMWIKK2FyNGNoYTJuCithcjFjCithcjNjaGEKK2FyMmNoCithcjVkMmluZQorYXJkMmkKK2FyZDFpbjQKK2FyNGRyCithcjVlYXMKK2EzcmVlCithcjNlbjF0CithNXIyZTJzcworYXI0ZmkKK2FyMWYKK2FyNGY0bDIKK2FyMWkKK2FyNWkyYWwKK2FyMmkzYQorYXIzaTJhMm4KK2Ezcmk1ZXQKK2FyMmllNAorYXI0aW0KK2FyNWluMmF0CithcjJpMW5hCithcjNpMW8KK2FyMml6CithcjJtaQorYXIxbQorYXI1bzVkCithNXJvbmkKK2FybzJuCithM3JvbzIKK2FyMnAKK2FyM3EKK2FycmU0CithcjFyNAorYXI0c2EyCithNHJzMgorYXIyczJoCis0YXMuCithMnM0YWIKK2FzYTIKK2FzM2FuMXQKK2FzYTJuCithc2hpNAorYXMyaAorYTVzaWEuCithczJpMWEKK2Ezc2kxYgorYTNzaWMKKzVhNXNpNHQKK2FzazNpCithc2syCithczRsMgorYTRzb2MKK2Exc28KK2FzNXBoCithczRzMmgKK2Eyc3MKK2FzM3RlbgorYXMxdDRyCithc3UxcjVhCithMXN1Cithc3UycgorYTJ0YQorYXQzYWIybDIKK2EydGFiCithdDVhYworYXQzYWxvCithdGEybAorYXQ1YXAKK2F0ZTVjCithdDVlMmNoCithdDNlMWdvCithdGVnNAorYXQzZW4uCithdDNlcjFhCithdGVyNW4KK2E1dGVyMW5hCithdDNlc3QKK2F0NWV2Cis0YXRoCithdGg1ZW0KK2F0aDJlCithNXRoZTJuCithdDRobworYXRoNW9tCis0YXRpLgorYTV0MmkxYQorYTJ0NWk1YgorYXQxaWMKK2F0M2lmMgorYXRpb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kyYgorYjJpNGQKKzNiMmllNAorYmk1ZW4KK2JpNGVyCisyYjNpZgorMWJpbAorYmkzbDJpegorYmlsMWkKK2JpbjJhNXI0CitiaTFuYQorYjRpbjRkCitiaTVuZXQKK2IyaW5lCitiaTNvMmdyCitiMmlvCitiaTVvdTIKK2JpMnQKKzNiMmkzdDJpbworYmkxdGkKK2JpM3RyCiszYml0NXUxYQorYmkxdHUKK2I1aTR0egorYjFqCitiazQKK2IybDIKK2JsNGF0aDUKK2I0bGUuCitibGVuNAorNWJsZTFzcAorYmxlczIKK2IzbGlzCitiNGxvCitibHVuNHQKKzRiMW0KKzRiM24KK2JuZTVnCiszYm9kCitib2QzaQorYm80ZQorYm9sM2ljCitib2wyaQorYm9tNGJpCitibzRtMWIKK2JvMW40YQorYm8ybgorYm9uNWF0CiszYm9vMgorNWJvci4KKzRiMW8xcmEKK2JvcjVkCis1Ym9yZQorNWJvcmkKKzVib3M0CitiNW8xdGEKK2I0b3RoNQorYm80dG8KK2JvdW4yZDMKK2JvdTIKKzRicAorNGJyaXQKK2JyNG90aDMKKzJiNXMyCitic29yNAorYjFzbworMmJ0CitiMnQ0bAorYjR0bworYjN0cgorYnVmNGZlcjEKK2J1NGYxZgorYnU0Z2EKK2J1M2wyaQorYnUxbWk0CitidTRuCitidW50NGkKK2J1bjF0CitidTNyZQorYnVzNWllNAorYjJ1cworYnVzczRlCitidTJzcworNWJ1c3QKKzRidTF0YQorM2J1MXQyaW8KK2I0dTF0MmkKK2I1dTF0bworYjF2Cis0YjV3Cis1YnkuCitieXM0CisxY2EKK2NhYjNpbgorY2ExYjJsMgorY2EyY2g0CitjYTVkZW4KK2NhMmQKKzRjYWc0CisyYzVhaAorY2EzbGF0CitjYWw0bGEKK2NhbDFsCitjYWwybDVpbjQKK2NhbGwyaQorNGNhbG8KK2M0YW41ZAorY2EybgorY2FuNGUKK2NhNG40aWMKK2NhbjVpcworY2FuM2l6CitjYW40dHkKK2NhbjF0CitjYW55NAorY2E1cGVyCit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oYW5kLgoraDRhbmQKK2gyYW40ZworaGFuZzVlcgoraGFuMWc1bworaDVhNW5pegoraGE0bjRrMgoraGFuNHRlCitoYW4xdAoraGEycDNsMgoraGEycDV0CitoYTNyYTJuCitoMmEycgoraGE1cjJhcworaGFyMmQKK2hhcmQzZQoraGFyNGxlNAoraGFyMWwKK2hhcnA1ZW4KK2hhcjJwCitoYXI1dGVyCitoYTJzNXMKK2hhdW40Cis1aGF6CitoYXozYTEKK2gxYgorMWhlYTJkMQorM2hlMmEycgoraGU0Y2EybgoraGUxY2EKK2g1ZWNhdAoraDRlZAoraDRlNWRvNQoraGUzbDRpCitoZWw0bGlzCitoZWwxbAoraGVsbDJpCitoZWw0bHkKK2g1ZWxvCitoZTRtNHAKK2hlMm4KK2hlMW5hNAoraGVuNWF0CitoZTFvNXIKK2hlcDUKK2g0ZXIxYQoraGVyYTNwCitoZXI0YmEKK2gyZXIxYgoraGVyZTVhCitoM2VybgoraDVlcjFvdTIKK2gyZXJvCitoM2VyeQoraDFlcworaGUyczVwCitoZTR0CitoZTJ0NGVkCitoNGV1NAoraDFmCitoMWgKK2hpNWEybgoraDJpMWEKK2hpNGNvCitoaWdoNQoraDJpZworaDRpbDIKK2hpbWVyNAoraDRpMW5hCitoaW9uNGUKK2gyaW8KK2hpbzJuCitoMmk0cAoraGlyNGwKK2g0aXIKK2hpM3JvCitoaXI0cAoraGlyNHI0CitoaXMzZWwKK2g0aXNlCitoNGkyczRzCitoaXRoNWVyCitoMml0aAoraGl0aDJlCitoMmkydgorNGhrCis0aDFsNAoraGxhMm40CitoMmxvCitobG8zcmkKKzRoMW0KK2htZXQ0CisyaDFuCitoNW9kaXoKK2g1bzJkMXMyCitobzRnCitobzFnZTQKK2hvbDVhMnIKK2hvMWxhCiszaG9sNGUKK2hvNG1hCitobzJtZTMKK2hvMW40YQoraG8ybgoraG81bnkKKzNob29kCitob28yCitob28ybjQKK2hvcjVhdAoraG8xcmEKK2hvNXIyaXMKK2hvcnQzZQoraG81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VyMWEKK2k1bjJlMnNzCitpMW5lcworNGluMWdhCis0aW5nZQoraW41Z2VuCis0aW5naQoraW41Z2xpbmcKK2luZ2wyCis0aW4xZ28KKzRpbjFndQorMmluaQoraTVuaS4KK2k0bjRpMWEKK2luM2k0bworaW4xaXMKK2k1bmk0dGUuCitpbjJpdAoraW4yaXRlCis1aTNuMmkxdDJpbworaW5pMXRpCitpbjNpMXR5Cis0aTRuazIKKzRpNG4xbAorMmk0bjFuMgorMmkxbm8KK2k0bm80YworaW5vNHMKK2k0bm90CisyaTJuMXMyCitpbjNzZQoraW5zdTFyNWEKK2luMXN1CitpbnN1MnIKKzJpbnQuCitpbjF0CisyaW40dGgKK2luMXUKK2k1bjJ1cworNGlueQorMmlvCis0aW8uCitpbzFnZTQKK2lvMmdyCitpMW9sCitpbzRtCitpb24zYXQKK2lvMm4KK2lvMW4xYQoraW9uNGVyeQoraW9uMWVyCitpb24zaQoraTJvNXBoCitpb3IzaQoraTRvcworaTRvNXRoCitpNW90aQoraW80dG8KK2k0b3VyCitpb3UyCisyaXAKK2lwZTQKK2lwaHIyYXM0CitpcDRocjQKK2lwM2kKK2lwNGljCitpcDRyZTQKK2lwcjIKK2lwM3VsCitpM3F1YQoraXF1MgoraXE1dWUxZgoraXEzdTJpZAoraXEydWkyCitpcTN1aTN0Cis0aXIKK2kxcmEKK2kycmE0YgoraTRyYWMKK2lyZDVlCitpcmU0ZGUKK2kycjJlZAoraTRyZTFmCitpNHJlbDQKK2k0cmVzCitpcjVnaQoraXJnMgoraXIxaQoraXJpNWRlCitpcjJpZAoraXI0aXMKK2lyaTN0dQorNWk1cjJpegoraXI0bWluCitpcjFtCitpcm80ZworNWlyb24uCitpcm8ybgoraXI1dWwKKzJpcy4KK2lzNWFnCitpc2EyCitpczNhMnIKK2lzYXM1CisyaXMxYworaXMzY2gyCis0aXNlCitpczNlcgorM2k0czNmCitpczVoYTJuCitpczJoCitpczNobzJuMworaXNobzQKK2lzaDVvcAoraXMzaTFiCitpczJpNGQKK2k1c2lzCitpczVpMXQyaXYKK2lzaTF0aQorNGlzNGsyCitpc2xhMm40CitpczFsMgorNGlzNG0xczIKK2kyczFtCitpMnNvCitpc281bWVyCitpM3NvbQoraXNvMm1lCitpczFwCitpczJwaQoraXM0cHkKKzRpMnMxcworaXM0c2FsCitpczFzYTIKK2lzc2VuNAoraXM0czFlNHMKK2lzNHRhLgoraXMxdGEKK2lzMXRlCitpczF0MmkKK2lzdDRseQoraXMydGwKKzRpc3RyYWwKK2lzdDRyCitpczF0cmEKK2kyc3UKK2lzNXVzCis0aTN0YS4KK2kxdGEKK2l0YTRiaQoraTJ0YWIKK2k0dGFnCis0aXRhNW0KK2kzdGEybgoraTN0YXQKKzJpdGUKK2l0M2VyMWEKK2k1dGVyMWkKK2l0NGVzCisyaXRoCitpMXRpCis0aTF0MmkxYQorNGkydGljCitpdDNpMWNhCis1aTV0aWNrMQoraTJ0M2lnCitpdDVpbDFsCitpMnRpbQorMmkxdDJpbworNGl0aXMKK2k0dGkyczRtCitpMnQ1bzVtCitpMXRvCis0aXRvMm4KK2k0dHJhbQoraTF0cmEKK2l0NXJ5Cis0aTR0M3QyCitpdDN1MWF0CitpMXR1CitpdHUxYQoraTV0dWQyCitpdDN1bAorNGl0ei4KK2k0dHoKK2kxdQorMml2CitpdjNlbDFsCitpdjNlbi4KK2k0djNlci4KK2k0dmVycy4KK2l2ZTRyMXMyCitpdjVpbC4KK2kydmlsCitpdjVpbworaXYxaXQKK2k1dm9yZQoraXYzbzNybworaTR2M290Cis0aTV3CitpeDRvCis0aXkKKzRpejJhMnIyCitpemExCitpMnoxaTQKKzVpem9uMXQKK2kxem8KK2l6bzJuCis1amEKK2phYzRxCitqYTRwCisxamUKK2plNHI1czIKKzRqZXM0dDJpZTQKK2plc3QyaQorNGplczJ0eQoramV3Mworam80cAorNWp1ZGcKKzNrYS4KK2szYWIKK2s1YWcKK2thaXM0CitrYWkyCitrYWw0CitrMWIKK2syZWQKKzFrZWUKK2tlNGc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tCitsbzFyYTQKK2xvNHJhMXRvCitsbzVyMmllNAorbG9yNW91MgorNWxvcy4KK2xvczVldAorNWxvczVvM3BoaXoKK2xvMnNvCitsb3M0b3AKK2xvczJvcGgKKzVsb3M1bzFwaHkKK2xvczR0CitsbzR0YQorbG91bjVkCitsb3UyCisybG91dAorNGxvdgorMmxwCitscGE1YgorbDFwYQorbDNwaGEKK2w1cGhpCitscDVpbmcKK2xwaTJuCitsM3BpdAorbDRwMmwyCitsNXByMgorNGwxcgorMmwxczIKK2w0c2MKK2wyc2UKK2w0czJpZTQKKzRsdAorbHQ1YWcKK2wxdGEKK2x0YW5lNQorbHRhMm4KK2wxdGUKK2x0ZW40CitsdGVyMWE0CitsdGgzaQorbDV0aWVzLgorbHQyaWU0CitsdGlzNAorbDF0cgorbDF0dTIKK2x0dTFyM2EKK2x1NWEKK2x1M2JyCitsdTJjaDQKK2x1M2NpCitsdTNlbgorbHVmNAorbHU1aWQKK2wydWkyCitsdTRtYQorNWx1MW1pCitsNXVtbi4KK2x1NG0xbgorNWx1bTNuNGkxYQorbHUzbworbHVvM3IKKzRsdXAKK2x1MnNzNAorbDJ1cworbHVzM3RlCisxbHV0CitsNXZlbgorbDV2ZXQ0CisybDF3CisxbHkKKzRseWEKKzRseTFiCitseTVtZTQKK2x5M25vCisybHlzNAorbDV5M3MyZQorMW1hCisybWFiCittYTJjYQorbWE1Y2gyaW5lCittYTJjaAorbWE0Y2gxaW4KK21hNGM0bDQKK21hZzVpbgorbWFnMWkKKzVtYWcxbgorMm1haAorbWEyaWQ1CittYWkyCis0bWEybGQKK21hM2wyaWcKK21hbDFpCittYTVsaW4KK21hbDRsMmkKK21hbDFsCittYWw0dHkKK21hNGx0Cis1bWEzbjRpMWEKK21hMm4KK21hbjVpcworbWFuM2l6Cis0bWFwCittYTVyaTJuZS4KK20yYTJyCittYXIxaQorbWFyMmluNGUKK21hNXIyaXoKK21hcjRseQorbWFyMWwKK21hcjN2CittYTVzY2UKK21hczRlCittYXMxdAorNW1hdGUKK200YXRoMworbWEzdGlzCis0bWF0aTN6YTEKK21hMXRpegorNG0xYgorbTFiYTR0NQorbTViaWwKK200YjNpbmcKK21iMmk0dgorNG01YworNG1lLgorMm1lZAorNG1lZC4KKzVtZTNkNGkzYQorbTRlZGkKK21lM2QyaWU0CittNWU1ZDJ5CittZTJnCittZWw1bzJuCittZTRsNHQKK21lMm0KK21lMW0xbzMKKzFtZW4KK21lMW40YQorbWVuNWFjCittZW40ZGUKKzRtZW5lCittZW40aQorbWUybjFzNAorbWVuMXN1NQorM21lbjF0CittZW40dGUKK21lNW8ybgorbTVlcjFzYTIKK21lNHIxczIKKzJtZXMKKzNtZXN0MmkKK21lNHRhCittZXQzYTJsCittZTF0ZQorbWU1dGhpCittNGV0cgorNW1ldDNyaWMKK21lNXRyMmllNAorbWUzdHJ5CittZTR2Cis0bTFmCisybWgKKzVtaS4KK20yaTNhCittaTFkNGEKK20yaWQKK21pZDRnCittMmlnNAorM21pbDNpMWEKK21pbDFpCittNWk1bDJpZTQKK200aWwxbAorbWkxbjRhCiszbTRpbmQKK201aTNuZWUKK20yaW5lCittNGluZ2wyCittaW41Z2xpCittNWluZzFseQorbWluNHQKK200aW4xdQorbWlvdDQKK20yaW8KK20yaXMKK21pNHM0ZXIuCittNGlzZQorbWlzM2VyCittaXM1bDIKK21pczR0MmkKK201aTRzdHJ5CittaXN0NHIKKzRtMml0aAorbTJpegorNG1rCis0bTFsCittMW0KK21tYTVyeQorbTFtYQorbW0yYTJyCis0bTFuCittMW40YQorbTRuMWluCittbjRvCisxbW8KKzRtb2NyCis1bW9jNXJhMXRpegorbW8yZDEKK21vNGdvCittb2lzMgorbW9pMgorbW80aTVzZQorNG0yb2sKK21vNWxlc3QKK21vbGVzMgorbW8zbWUKK21vbjVldAorbW8ybgorbW9uNWdlCittbzNuNGkzYQorbW9uNGkyczFtCittb24xaXMKK21vbjRpc3QKK21vM25pegorbW9ub2w0CittbzNueS4KK21vMnIKKzRtbzVyYS4KK21vMXJhCittb3MyCittbzVzZXkKK21vM3NwCittNG90aDMKK201b3VmCittb3UyCiszbW8ydXMKK21vMnYKKzRtMXAKK21wYXJhNQorbTFwYQorbXAyYTJyCittcGE1cmFiCittcDRhNHI1aQorbTNwZTJ0CittcGhhczQKK20ycGkKK21wMmk0YQorbXA1aWVzCittcDJpZTQKK200cDFpMm4KK201cDRpcgorbXA1aXMKK21wbzNyaQorbTFwNG9yCittcG9zNWl0ZQorbTFwb3MKK200cG8ydXMKK21wb3UyCittcG92NQorbXA0dHIKK20ycDF0CittMnB5Cis0bTNyCis0bTFzMgorbTRzMmgKK201c2kKKzRtdAorMW11CittdWwyYTVyNAorbXUxbGEKKzVtdTRsdAorbXVsMXRpMworM211bQorbXVuMgorNG11cAorbXU0dQorNG13CisxbmEKKzJuMWEyYgorbjRhYnUKKzRuYWMuCituYTRjYQorbjVhMmMxdAorbmFnNWVyLgorbmFrNAorbmE0bDFpCituYTVsMmkxYQorNG5hNGx0CituYTVtaXQKK24yYTJuCituYW4xY2k0CituYW40aXQKK25hNG5rNAorbmFyM2MKK24yYTJyCis0bmFyZQorbmFyM2kKK25hcjRsCituNWFyMW0KK240YXMKK25hczRjCituYXM1dDJpCituMmF0CituYTN0YTJsCituYTJ0YQorbmF0NW81bTJpegorbmEydG9tCituYTF0bworbjJhdQorbmF1M3NlCituYTJ1cworM25hdXQKK25hdjRlCis0bjFiNAorbmMyYTJyNQorbjFjYQorbjRjZXMuCituM2NoYQorbjJjaAorbjVjaGVvCituY2hlMgorbjVjaDRpbDIKK24zY2hpcworbjJjMWluCituMWNpCituMmM0aXQKK25jb3UxcjVhCituMWNvCituY291MgorbjFjcgorbjFjdQorbjRkYWkyCituMWQyYQorbjVkYTJuCituMWRlCituZDVlMnN0LgorbmRlczIKK25kaTRiCituNWQyaWYKK24xZGl0CituM2RpegorbjVkdTJjCituMWR1CituZHU0cgorbmQyd2UKK25kMXcKKzJuZS4KK24zZTJhMnIKK24yZTJiCituZWIzdQorbmUyYworNW5lY2sxCisybmVkCituZTRnYXQKK25lMWdhCituZTRnNWExdDJpdgorNW5lZ2UKK25lNGxhCituZWw1aXoKK25lbDJpCituZTVtaQorbmU0bW8KKzFuZW4KKzRuZW5lCiszbmVvCituZTRwbworbmUycQorbjFlcgorbmUycmE1YgorbmVyMWEKK240ZXIzYTJyCituMmVyZQorbjRlcjVpCituZXI0cjQKKzFuZXMKKzJuZXMuCis0bmUxc3AKKzJuZXN0Cis0bmVzNHcyCiszbmV0MWljCituZTR2CituNWV2ZQorbmU0dworbjNmCituNGdhYgorbjFnYQorbjNnZWwKK25nZTRuNGUKK24xZ2VuCituNWdlcmUKK24zZ2VyMWkKK25nNWhhCituM2dpYgorbmcxaW4KK241Z2l0CituNGdsYTQKK25nbDIKK25nb3Y0CituMWdvCituZzVzMmgKK25nczIKK24xZ3UKK240Z3VtCituMmd5Cis0bjFoNAorbmhhNAorbmhhYjMKK25oZTQKKzNuNGkxYQorbmkzYTJuCituaTRhcAorbmkzYmEKK25pNGIybDIKK24yaTRkCituaTVkaQorbmk0ZXIKK24yaWU0CituaTJmaQorbmk1ZmljYXQKK25pZmkxY2EKK241aTFncgorbjJpZworbjRpazQKK24xaW0KK25pM20yaXoKK25pbTFpCituMWluCis1bmkybmUuCituMmluZQorbmluNGcKK24yaTRvCis1bjJpcy4KK25pczR0YQorbjJpdAorbjRpdGgKKzNuMmkxdDJpbworbmkxdGkKK24zaXRvcgorbmkxdG8KK25pM3RyCituMWoKKzRuazIKK241azJlcm8KK25rMWVyCituM2tldAorbmszaW4KK25rMWkKK24xazFsCis0bjFsCituNW0KK25tZTQKK25tZXQ0Cis0bjFuMgorbm5lNAorbm5pM2FsCituM240aTFhCitubjJpNHYKK25vYjRsMgorbm8zYmxlCituNW8xYzRsNAorNG4zbzJkCiszbm9lCis0bm9nCitubzFnZTQKK25vaXM1aQorbm9pMgorbm81bDRpCis1bm9sMW8xZ2lzCiszbm9taWMKK241bzVtMml6CitubzRtbworbm8zbXkKK25vNG4KK25vbjRhZworbm8xbjFhCitub241aQorbjVvbml6Cis0bm9wCis1bm9wNW81bDJpCitubzJyNWFiCitubzFyYQorbm80cmFyeQorbm9yMmEycgorNG5vczJjCitub3M0ZQorbm9zNXQKK25vNXRhCisxbm91MgorM25vdW4KK25vdjNlbDMKK25vd2wzCituMXA0CitucGk0CitucHJlNGMKK25wcjIKK24xcQorbjFyCitucnU0CisybjFzMgorbjJzNWFiCituc2EyCituc2F0aTQKK25zNGMKK24yc2UKK240czNlNHMKK25zMmlkMQorbnMyaWc0CituMnMxbDIKK24yczNtCituNHNvYworbjFzbworbnM0cGUKK241c3BpCituc3RhNWIybDIKK25zMXRhCituczJ0YWIKK24xdAorbjJ0YTRiCituMXRhCitudGU0cjNzMgorbnQyaQorbjV0aTJiCitudGk0ZXIKK250MmllNAorbnRpMmYyCituM3QyaW5lCituMnQxaW4KK240dDNpbmcKK250Mmk0cAorbnRyb2w1bDJpCitudHJvbDFsCituNHQ0czIKK250dTNtZQorbjF0dQorbjN0dW0KK251MWEKK251NGQKK251NWVuCitudWY0ZmUKK251NGYxZgorbjN1aTRuCituMnVpMgorM251M2l0CituNHVtCitudTFtZQorbjV1MW1pCiszbnU0bgorbjN1bworbnUzdHIKK24xdjIKK24xdzQKK255bTQKK255cDQKKzRuegorbjN6YTEKKzRvYQorb2EyZDMKK281YTVsZXMyCitvMmFsZQorb2FyZDMKK28yYTJyCitvYXM0ZQorb2FzdDVlCitvYXQ1aQorb2IzYTNiCitvNWIyYTJyCitvMWJlNGwKK28xYmkKK28yYmluCitvYjVpbmcKK28zYnIKK29iM3VsCitvMWNlCitvMmNoNAorbzNjaGU0dAorb2NoZTIKK29jaWYzCitvMWNpCitvNGNpbAorbzRjbGFtCitvMWM0bDQKK280Y29kCitvMWNvCitvYzNyYWMKK29jNXJhMXRpegorb2NyZTMKKzVvY3JpdAorb2NyaTIKK29jdG8ycjVhCitvMmMxdAorb2MxdG8KK29jM3UxbGEKK281Y3VyZQorb2Q1ZDFlZAorb2QxZDQKK29kM2ljCitvMWQyaTNvCitvMmRvNAorb2Q0b3IzCitvNGQ1dWN0LgorbzFkdQorb2R1MmMKK29kdTJjMXQKK280ZDV1YzR0MXMyCitvNGVsCitvNWVuZworbzNlcgorb2U0dGEKK28zZXYKK28yZmkKK29mNWl0ZQorb2Y0aTR0NHQyCitvMmc1YTVyCitvMWdhCitvNGc1YTF0Mml2CitvNGdhMXRvCitvMWdlCitvNWdlbmUKK28xZ2VuCitvNWdlbworbzRnZXIKK28zZzJpZTQKKzFvMWdpcworb2czaXQKK280Z2wyCitvNWcybHkKKzNvZ25pegorb2cxbmkKK280ZzRybworbzFncgorb2cydTVpMgorMW8xZ3kKKzJvMmc1eTNuCitvMWgyCitvaGFiNQorb2kyCitvaWMzZXMKK29pM2RlcgorbzJpZAorb2k0ZjFmNAorbzJpZzQKK29pNWxldAorbzNpbmcKK29pbnQ1ZXIKK29pbjF0CitvNWkyczFtCitvaTVzbzJuCitvaTJzbworb2lzdDVlbgorb2lzMXRlCitvaTN0ZXIKK28yaXRlCitvNWoKKzJvaworbzNrZW4KK29rNWllNAorb2sxaQorbzFsYQorbzRsYTJuCitvbGEyc3M0CitvMmwyZAorb2wyZDFlCitvbDNlcgorbzNsZXMyYworb2xlczIKK28zbGV0CitvbDRmaQorbzJsZgorb2wyaQorbzNsMmkxYQorbzNsaWNlCitvbDVpZC4KK29sMmlkCitvM2xpNGYKK281bDRpNGwKK29sM2luZworbzVsMmlvCitvNWwyaXMuCitvbDNpczJoCitvNWwyaXRlCitvbDFpdAorbzVsMmkxdDJpbworb2xpMXRpCitvNWwyaXYKK29sbDJpNGU0CitvbDFsCitvbGwyaQorb2w1bzNnaXoKK29sbzRyCitvbDVwMmwyCitvMmxwCitvNGwydAorb2wzdWIKK29sM3VtZQorb2wzdW4KK281bDJ1cworb2wydgorbzJseQorbzJtNWFoCitvMW1hCitvbWE1bAorb201YTF0aXoKK29tMmJlCitvNG0xYgorb200YjJsMgorbzJtZQorb20zZTFuNGEKK28xbWVuCitvbTVlcjJzZQorb21lNHIxczIKK280bWV0CitvbTVlM3RyeQorb200ZXRyCitvM20yaTNhCitvbTNpYy4KK29tM2kxY2EKK281bTJpZAorb20xaW4KK281bTJpbmkKKzVvbW1lbmQKK29tMW0KK29tMW1lbgorb21vNGdlCitvMW1vCitvNG1vMm4KK29tM3BpCitvNG0xcAorb21wcm81CitvbXByMgorbzJuCitvMW4xYQorb240YWMKK28zbjJhMm4KK29uMWMKKzNvbmNpbAorb24xY2kKKzJvbmQKK29uNWRvCitvM25lbgorbzJuNWVzdAorbzFuZXMKK29uNGd1CitvbjFpYworbzNuMmk0bworb24xaXMKK281bmkxdQorb24za2V5CitvNG5rMgorb240b2RpCitvNG4zbzJkCitvbjNvM215CitvMm4zczIKK29uNXNwaTQKK29uc3BpMXI1YQorb25zcDRpcgorb24xc3U0CitvbnRlbjQKK29uMXQKK29uM3Q0aQorb250aTJmNQorb241dW0KK29uMXZhNQorb24xdjIKK29vMgorb29kNWUKK29vZDVpCitvMm80aworb29wM2kKK28zb3JkCitvb3N0NQorbzJwYQorbzJwMmU1ZAorb3AxZXIKKzNvcGVyMWEKKzRvcDRlcmFnCisyb3BoCitvNXBoYTJuCitvNXBoNGVyCitvcDNpbmcKK29waTJuCitvM3BpdAorbzVwbzJuCitvNHBvc2kKK28xcG9zCitvMXByMgorb3AxdQorb3B5NQorbzFxCitvMXJhCitvNXJhLgorbzRyM2FnCitvcjVhbDFpegorb3JhbDFpCitvcjVhbjRnZQorb3JhMm4KK29yMmFuZworb3JlNWEKK281cmUxYTRsCitvcjNlaTIKK29yNGU1czJoCitvcjVlMnN0Lgorb3JlczJ0CitvcmV3NAorb3I0Z3UKK29yZzIKKzRvNXIyaTNhCitvcjNpMWNhCitvNXJpbAorb3IxaW4KK28xcjJpMW8KK29yM2kxdHkKK28zcmkxdQorb3IybWkKK29yMW0KK29ybjJlCitvNXJvZgorb3Izb3VnCitvcm91Mgorb3I1cGUKK29yMXAKKzNvcnJoNAorb3IxcjQKK29yNHNlCitvNHJzMgorb3JzNWVuCitvcnN0NAorb3IzdGhpCitvcjN0aHkKK29yNHR5CitvNXJ1bQorbzFyeQorb3MzYWwKK29zYTIKK29zMmMKK29zNGNlCitvM3Njb3AKK29zMWNvCis0b3Njb3BpCitvNXNjcgorb3M0aTRlNAorb3M1aTF0Mml2Citvc2kxdGkKK29zM2kxdG8KK29zM2kxdHkKK281c2k0dQorb3M0bDIKK28yc28KK28yczRwYQorb3M0cG8KK29zMnRhCitvNXN0YXRpCitvczV0aWwKK29zdDJpCitvczV0aXQKK280dGEybgorbzF0YQorb3RlbGU0Zworb3QzZXIuCitvdDVlNHIxczIKK280dGVzCis0b3RoCitvdGg1ZTFzaQorb3RoMmUKK290aDFlcworb3RoM2k0CitvdDNpYy4KK290NWkxY2EKK28zdGljZQorbzN0aWYyCitvM3Rpcworb3RvNXMyCitvMXRvCitvdTIKK291M2IybDIKK291Y2g1aQorb3UyY2gKK291NWV0CitvdTRsCitvdW5jNWVyCitvdW4yZAorb3U1djIKK292NGVuCitvdmVyNG5lCitvdmU0cjNzMgorb3Y0ZXJ0CitvM3ZpcworbzR2aTF0aTQKK281djRvbAorb3czZGVyCitvdzNlbAorb3c1ZXN0Mworb3cxaTIKK293bjVpCitvNHdvMgorb3kxYQorMXBhCitwYTRjYQorcGE0Y2UKK3BhMmM0dAorcDRhMmQKKzVwYWdhNG4KK3BhMWdhCitwM2FnYXQKK3A0YWkyCitwYTRpNG40CitwNGFsCitwYTFuNGEKK3BhMm4KK3BhbjNlbAorcGFuNHR5CitwYW4xdAorcGEzbnkKK3BhMXAKK3BhNHB1CitwYXJhNWIybDIKK3AyYTJyCitwYTJyYWIKK3BhcjVhZ2UKK3BhcjVkMmkKKzNwYXJlCitwYXI1ZWwKK3A0YTRyMWkKK3BhcjRpcworcGEydGUKK3BhNXRlcgorNXBhdGhpYworcDRhdGgKK3BhNXRoeQorcGE0dHJpYworcGExdHIKK3BhdjQKKzNwYXkKKz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ZTQKK3JhcjVlMWYKKzRyYXJpbAorcmFyMWkKK3IyYXMKK3JhdGlvMm40CityYTF0MmlvCityYXU0dAorcmE1dmFpMgorcmEydmEKK3JhdjNlbAorcmE1ejJpZTQKK3JhMnoxaQorcjFiCityNGJhYgorcjRiYWcKK3JiaTIKK3IyYjNpNGYKK3IyYmluCityNWIyaW5lCityYjVpbmcuCityYjRvCityMWMKK3IyY2UKK3IxY2VuNAorcjNjaGEKK3IyY2gKK3JjaDRlcgorcmNoZTIKK3I0Y2k0YgorcjFjaQorcjJjNGl0CityY3VtMworcjRkYWwKK3IxZDJhCityZDJpCityMWQ0aTRhCityZGk0ZXIKK3JkMmllNAorcmQxaW40CityZDNpbmcKKzJyZS4KK3JlMWE0bAorcmUzYTJuCityZTVhcjFyNAorcmUyYTJyCis1cmVhMnYKK3JlNGF3CityNWVicmF0CityMmUxYgorcmUzYnIKK3JlYzVvbDFsCityZTJjb2wKK3JlMWNvCityZTRjNW9tcGUKK3JlY280bTFwCityZTRjcmUKK3JlMWNyCisycjJlZAorcmUxZGUKK3JlM2RpczEKK3I0ZWRpCityZWQ1aXQKK3JlNGZhYworcmUxZgorcmUxZmEKK3JlMmZlCityZTVmZXIuCityZWZlcjEKK3JlM2ZpCityZTRmeQorcmVnM2lzCityZTVpdAorcmVpMgorcmUxbDJpCityZTVsdQorcjRlbjR0YQorcmVuMXQKK3JlbjR0ZQorcmUxbworcmU1cGkybgorcmU0cG9zaQorcmUxcG8KK3JlMXBvcworcmUxcHUKK3IxZXI0CityNGVyMWkKK3IyZXJvNAorcjRlNXJ1CityNGVzLgorcmU0c3BpCityZTFzcAorcmVzNHM1aTRiCityMmUyc3MKK3JlczFzaQorcmVzMnQKK3JlNXMydGEybAorcmVzMXRhCityMmUzc3Q0cgorcmU0dGVyCityZTR0aTR6CityZTN0cmkKK3I0ZXUyCityZTV1MXQyaQorcmV2MgorcmU0dmFsCityZTF2YQorcmV2M2VsCityNWV2NWVyLgorcmV2MWVyCityZTV2ZTRyMXMyCityZTV2ZXJ0CityZTV2aTRsCityZTF2aQorcmV2NW9sdQorcmU0d2gKK3IxZgorcjNmdTQKK3I0ZnkKK3JnMgorcmczZXIKK3IzZ2V0CityM2cxaWMKK3JnaTRuCityZzNpbmcKK3I1Z2lzCityNWdpdAorcjFnbDIKK3JnbzRuMgorcjFnbworcjNndQorcmg0Cis0cmguCis0cmhhbAorcjJpM2EKK3JpYTRiCityaTRhZworcjRpYgorcmliM2EKK3JpYzVhczUKK3JpMWNhCityNGljZQorNHIyaTFjaQorNXJpNWMyaWQKK3JpNGMyaWU0CityNGkxY28KK3JpZDVlcgorcjJpZAorcmkzZW5jCityMmllNAorcmkzZW4xdAorcmkxZXIKK3JpNWV0CityaWc1YTJuCityMmlnCityaTFnYQorNXI0aWdpCityaWwzaXoKK3JpbDFpCis1cmltYTJuCityaTFtYQorcmltNWkKKzNyaTFtbworcmltNHBlCityaTRtMXAKK3IyaTFuYQorNXJpbmEuCityNGluNGQKK3IyaW40ZQorcmluNGcKK3IyaTFvCis1cmlwaAorcjJpcAorcmlwaDVlCityaTJwMmwyCityaXA1bGljCityNGlxCityMmlzCityNGlzLgorcjJpczRjCityM2lzMmgKK3JpczRwCityaTN0YTNiCityaTF0YQorcjVpdGVkLgorcjJpdGUKK3JpMnQxZWQKK3JpdDVlci4KK3JpdDVlNHIxczIKK3I0aTJ0M2ljCityaTF0aQorcmkydHUKK3JpdDV1cgorcml2NWVsCityMml2CityaXYzZXQKK3JpdjNpCityM2oKK3Iza2V0CityazRsZQorcmsxbAorcms0bGluCityMWwKK3JsZTQKK3IybGVkCityNGwyaWcKK3I0bGlzCitybDVpczJoCityM2xvNAorcjFtCitybWE1YworcjFtYQorcjJtZQorcjNtZW4KK3JtNWU0cjFzMgorcm0zaW5nCityNG1pbmcuCityNG0yaW8KK3IzbWl0CityNG15CityNG4yYTJyCityMW5hCityM25lbAorcjRuMWVyCityNW5ldAorcjNuZXkKK3I1bmljCityMW5pczQKK3IzbjJpdAorcjNuMml2Citybm80CityNG5vdTIKK3IzbnUKK3JvYjNsMgorcjJvYworcm8zY3IKK3JvNGUKK3JvMWZlCitybzVmaWwKK3JvMmZpCityMm9rMgorcm81azFlcgorNXJvbGUuCityb201ZTF0ZQorcm8ybWUKK3JvNG1ldAorcm9tNGkKK3JvNG00cAorcm9uNGFsCitybzJuCitybzFuMWEKK3JvbjRlCitybzVuNGlzCityb240dGEKK3JvbjF0Cisxcm9vbQorcm9vMgorNXJvb3QKK3JvM3BlbAorcm9wM2ljCityb3IzaQorcm81cm8KK3JvMnM1cGVyCitybzJzNHMKK3JvNHRoMmUKK3I0b3RoCitybzR0eQorcm80dmEKK3JvdjVlbAorcm94NQorcjFwCityNHBlNGEKK3I1cGVuMXQKK3JwNWVyLgorcjNwZTJ0CitycDRoNAorcnAzaW5nCitycGkybgorcjNwbworcjFyNAorcnJlNGMKK3JyZTRmCityNHJlMW8KK3JyZTRzMnQKK3JyMmk0bworcnIyaTR2Citycm8ybjQKK3Jyb3M0CitycnlzNAorNHJzMgorcjFzYTIKK3JzYTV0aQorcnM0YworcjJzZQorcjNzZWMKK3JzZTRjcgorcjRzNWVyLgorcnMzZTRzCityNXNlNXYyCityMXMyaAorcjVzaGEKK3Ixc2kKK3I0c2k0YgorcnNvMm4zCityMXNvCityMXNwCityNXN3MgorcnRhMmNoNAorcjF0YQorcjR0YWcKK3IzdDJlMWIKK3IzdGVuNGQKK3IxdGU1bworcjF0aQorcjJ0NWkyYgorcnQyaTRkCityNHRpZXIKK3J0MmllNAorcjN0MmlnCitydGlsM2kKK3J0aWw0bAorcjR0aTFseQorcjR0aXN0CityNHQyaXYKK3IzdHJpCitydHIyb3BoNAorcnQ0czJoNAorcjR0MXMyCitydTNhCitydTNlNGwKK3J1M2VuCitydTRnbDIKK3J1M2k0bgorcjJ1aTIKK3J1bTNwMmwyCitydTRtMnAKK3J1Mm4KK3J1NG5rNQorcnVuNHR5CitydW4xdAorcjV1c2MyCityMnVzCitydTJ0MWk1bgor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gyaTRwCitzaDJpMnY1CitzaG80CitzaDVvMmwyZAorc2hvMm4zCitzaG9yNAorc2hvcnQ1Cis0c2gxdworc2kxYgorczVpYzNjCiszc2kyZGUuCitzMmlkCis1c2lkZTRzMgorNXNpMmRpCitzaTVkaXoKKzRzaWcxbjRhCitzMmlnCitzaWw0ZQorNHNpMWx5CisyczFpbgorczJpMW5hCis1c2kybmUuCitzMmluZQorczNpbmcKKzFzMmlvCis1c2lvMm4KK3NpbzFuNWEKK3M0aTJyCitzaTFyNWEKKzFzaXMKKzNzMmkxdDJpbworc2kxdGkKKzVzaTF1CisxczJpdgorNXNpegorc2syCis0c2tlCitzM2tldAorc2s1aW5lCitzazFpCitzazVpbjRnCitzMWwyCitzM2xhdAorczJsZQorc2wyaXRoNQorc2wxaXQKKzJzMW0KK3MzbWEKK3NtYWwxbDMKK3NtYTJuMworc21lbDQKK3M1bWVuCis1czRtMml0aAorc21vMmw1ZDQKK3MxbW8KK3MxbjQKKzFzbworc280Y2UKK3NvMmZ0Mworc280bGFiCitzbzFsYQorc28ybDNkMgorc28zbGljCitzb2wyaQorNXNvbDJ2Ciszc29tCiszczRvbi4KK3NvMm4KK3NvMW4xYTQKK3NvbjRnCitzNG9wCis1c29waDFpYworczJvcGgKK3M1bzNwaGl6CitzNW8xcGh5Citzb3I1Yworc29yNWQKKzRzb3YKK3NvNXZpCisyczFwYQorNXNwNGFpMgorc3BhNG4KK3NwZW40ZAorMnM1cGVvCisyc3BlcgorczJwaGUKKzNzcGg0ZXIKK3NwaG81CitzcGlsNAorc3A1aW5nCitzcGkybgorNHMzcDJpMW8KK3M0cDFseQorczFwMmwyCitzNHBvMm4KK3MxcDRvcjQKKzRzcDRvdAorc3F1YWw0bAorc3F1MgorczFyCisyc3MKK3Mxc2EyCitzc2FzMworczJzNWMKK3Mzc2VsCitzNXNlbjVnCitzNHNlcy4KK3NzMWU0cworczVzZXQKK3Mxc2kKK3M0czJpZTQKK3NzaTRlcgorczRzNWkxbHkKK3M0czFsMgorc3M0bGkKK3M0czFuNAorc3NwZW40ZDQKK3NzMnQKK3NzdTFyNWEKK3Mxc3UKK3NzdTJyCitzczV3MgorMnN0LgorczJ0YWcKK3MxdGEKK3MydGEybAorc3RhbTRpCis1c3Q0YW5kCitzdGEybgorczR0YTRwCis1c3RhdC4KK3M0dDFlZAorc3Rlcm41aQorczV0MmVybworc3RlMncKK3N0ZTF3NWEKK3MzdGgyZQorc3QyaQorczR0aS4KK3M1dDJpMWEKK3MxdGljCis1czR0aWNrMQorczR0MmllNAorczN0aWYyCitzdDNpbmcKK3MydDFpbgorNXN0NGlyCitzMXRsZQorczJ0bAorNXN0b2NrMQorczF0bworc3RvMm0zYQorNXN0b25lCitzdG8ybgorczR0b3AKKzNzdG9yZQorc3Q0cgorczR0cmEyZAorczF0cmEKKzVzdHJhMnR1CitzNHRyYXkKK3M0dHIyaWQKKzRzdHJ5Cis0c3QzdzQKK3MydHkKKzFzdQorc3UxYWwKK3N1NGIzCitzdTJnMworc3U1aXMKK3MydWkyCitzdWl0MworczR1bAorc3UybQorc3UxbTNpCitzdTJuCitzdTJyCis0c3YKK3N3MgorNHMxd28yCitzNHkKKzRzeTFjCiszc3lsCitzeW41bworc3k1cmluCisxdGEKKzN0YS4KKzJ0YWIKK3RhNWJsZXMyCit0YWIybDIKKzV0YWI1bzVsMWl6Cit0YWJvbDJpCis0dDRhMmNpCit0YTVkbwordGEyZAorNHRhMmY0Cit0YWk1bG8KK3RhaTIKK3RhMmwKK3RhNWxhCit0YWw1ZW4KK3QyYWxlCit0YWwzaQorNHRhbGsKK3RhbDRsaXMKK3RhbDFsCit0YWxsMmkKK3RhNWxvZwordGE1bW8KK3RhbjRkZQordGEybgordDRhbmQKKzF0YW4xdGEzCit0YW4xdAordGE1cGVyCit0YTVwMmwyCit0YXI0YQordDJhMnIKKzR0YXIxYworNHRhcmUKK3RhM3IyaXoKK3RhcjFpCit0YXM0ZQordGE1czR5Cis0dGF0MWljCit0YTR0dXIKK3RhMnR1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lxCit0aTNzYTIKKzN0NGlzZQordGkyczRtCit0aTVzbwordGlzNHAKKzV0aXN0aTFjYQordGlzMXQyaQordGlzMXRpYwordGkzdGwKK3RpNHUKKzF0Mml2Cit0aTF2NGEKKzF0aXoKK3RpM3phMQordGkzemU0bgordGkyemUKKzJ0bAordDVsYQordGxhMm40CiszdGxlLgorM3RsZWQKKzN0bGVzLgordGxlczIKK3Q1bGV0LgordDVsbworNHQxbQordG1lNAorMnQxbjIKKzF0bwordG8zYgordG81Y3JhdAorNHRvMmRvNAorMnRvZgordG8yZ3IKK3RvNWljCit0b2kyCit0bzJtYQordG80bTRiCit0bzNteQordG9uNGE0bDFpCit0bzJuCit0bzFuMWEKK3RvM24yYXQKKzR0b25vCis0dG9ueQordG8ycmEKK3RvM3IyaWU0Cit0b3I1aXoKK3RvczIKKzV0b3VyCit0b3UyCis0dG91dAordG8zdzJhMnIKKzR0MXAKKzF0cmEKK3QycmEzYgordHJhNWNoCit0cjRhMmNpNAordHJhMmM0aXQKK3RyYWM0dGUKK3RyYTJjMXQKK3RyMmFzNAordHJhNXZlbgordHJhdjVlMnM1Cit0cmU1ZgordHJlNG0KK3RyZW01aQorNXRyMmkzYQordHJpNWNlcwordHI0aWNlCis1dHJpM2MyaTFhCit0NHIyaTFjaQorNHRyaTRjM3MyCisydHJpbQordHIyaTR2Cit0cm81bTRpCit0cm9uNWkKK3RybzJuCis0dHJvbnkKK3RybzVwaGUKK3RyMm9waAordHJvM3NwCit0cm8zdgordHIydTVpMgordHIydXM0Cis0dDFzMgordDRzYwordHMyaDQKK3Q0c3cyCis0dDN0MgordDR0ZXMKK3Q1dG8KK3QxdHU0CisxdHUKK3R1MWEKK3R1M2EycgordHU0YjRpCit0dWQyCis0dHVlCis0dHVmNAorNXQydTNpMgorM3R1bQordHU0bmlzCit0dTFuaQorMnQzdXAuCiszdHVyZQorNXR1cmkKK3R1cjNpcwordHVyNW8KK3R1NXJ5CiszdDJ1cworNHR2Cit0dzQKKzR0MXdhCit0d2lzNAordHdpMgorNHQxd28yCisxdHkKKzR0eWEKKzJ0eWwKK3R5cGUzCit0eTVwaAorNHR6Cit0Mno0ZQorNHVhYgordWFjNAordWE1bmEKK3VhMm4KK3VhbjRpCit1YXI1YW4xdAordTJhMnIKK3VhcmEybgordWFyMmQKK3VhcjNpCit1YXIzdAordTFhdAordWF2NAordWI0ZQordTRiZWwKK3UzYmVyCit1NGIyZXJvCit1MWI0aQordTRiNWluZwordTNiNGxlLgordWIybDIKK3UzY2EKK3VjaTRiCit1MWNpCit1MmM0aXQKK3VjbGUzCit1MWM0bDQKK3UzY3IKK3UzY3UKK3U0Y3kKK3VkNWQ0Cit1ZDNlcgordWQ1ZXN0Cit1ZGVzMgordWRlMXY0Cit1MWRpYwordWQzaWVkCit1ZDJpZTQKK3VkM2llcwordWQ1aXMxCit1NWRpdAordTRkbzJuCit1MWRvCit1ZDRzaQordTJkMXMyCit1NGR1Cit1NGVuZQordWUybjFzNAordWVuNHRlCit1ZW4xdAordWVyNGlsCit1ZXIxaQorM3UxZmEKK3UzZjRsMgordWdoM2UybgordWc1aW4KKzJ1aTIKK3VpbDVpegordWlsMWkKK3VpNG4KK3UxaW5nCit1aXI0bQordTRpcgordWkxdGE0Cit1Mml2MwordWk0djRlci4KK3U1agorNHVrCit1MWxhCit1bGE1YgordTVsYXRpCit1bDJjaDQKK3U0bDFjMgorNXVsY2hlMgordWwzZGVyCit1MmxkCit1bDJkZQordWw0ZQordTFsZW4KK3VsNGdpCit1NGwxZzQKK3VsMmkKK3U1bDJpMWEKK3VsM2luZwordWw1aXMyaAordWw0bDJhMnIKK3VsMWwKK3VsNGxpNGIKK3VsbDJpCit1bDRsaXMKKzR1MmwzbQordTFsNG8KKzR1MmwxczIKK3VsczVlNHMKK3VsMnNlCit1bDF0aQordTRsdAordWwxdHJhMwordWwxdHIKKzR1bDF0dTIKK3UzbHUKK3VsNXVsCit1bDV2Cit1Mm01YWIKK3UxbWEKK3VtNGJpCit1NG0xYgordW00Yj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WU0dAoreTVnaQorNHkzaAoreTFpCit5M2xhCit5bGxhNWIybDIKK3lsMWwKK3kzbG8KK3k1bHUKK3ltYm9sNQoreTRtMWIKK3ltZTQKK3ltMXBhMworeTRtMXAKK3luM2M0aHI0Cit5bjJjaAoreW41ZAoreW41ZworeW41aWMKKzV5bngKK3kxbzQKK3lvNWQKK3k0bzVnCit5b200Cit5bzVuZXQKK3lvMm4KK3k0bzJuM3MyCit5NG9zCit5NHAyZWQKK3lwZXI1Cit5cDNpCit5M3BvCit5NHBvNGMKK3lwMnRhCit5MnAxdAoreTVwdQoreXJhNW0KK3lyNWkzYQoreTNybworeXI0cjQKK3lzNGMKK3kzczJlCit5czNpMWNhCit5MXMzaW8KKzN5MXNpcworeTRzbworeTJzczQKK3lzMXQKK3lzM3RhCit5c3UycjQKK3kxc3UKK3kzdGhpbgoreXQzaWMKK3kxdworemExCit6NWEyYgorejJhMnIyCis0emIKKzJ6ZQoremU0bgoremU0cAorejFlcgorejJlM3JvCit6ZXQ0CisyejFpCit6NGlsCit6NGlzCis1emwKKzR6bQorMXpvCit6bzRtCit6bzVvbAorem9vMgorenRlNAorNHoxejIKK3o0enkKKy5hczlzOG85YzhpOGE4dGUuCisuYXMxc28KKy5hc3NvMWNpCisuYXNzbzNjMmkxYQorLmFzOXM4bzljOGk4YTh0OGVzLgorLmRlOGM5bDhpOW44YTl0OGk4b24uCisuZGUxYzRsNAorLmRlY2w0aTFuYQorLmRlY2xpbjJhdAorLmRlY2xpbmExdDJpbworLmRlY2xpbmF0aW8ybgorLm9iOGw4aThnOWE5dDhvOHJ5LgorLm9iMmwyCisub2JsMmlnCisub2JsaTFnYQorLm9ibGlnYTF0bworLm9ibGlnYXRvMXJ5CisucGg4aThsOWE4bjl0OGg4cjhvOHA4aWMuCisucGg0aWwyCisucGhpMWxhCisucGhpbGEybgorLnBoaWxhbjF0CisucGhpbGFudDRocjQKKy5waGlsYW50aHJvcDNpYworLnByOGU4czhlOG50LgorLnAzcmUxczJlCis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1pbWVvZ3JhNHA0aDFzMgorLm1pOG05aThjOXI4aThlOHMuCisubWltMWkKKy5taW00aTFjcgorLm1pbWljcmkyCisubWltaWNyMmllNAorLm1pOG45aThzLgorLm0yaW5pCisubWluMWlzCisubWk4bjhpOXM4eThtOXA4bzlzOGk4dThtLgorLm1pbmlzNHkKKy5taW5pc3k0bTFwCisubWluaXN5bTFwb3MKKy5taW5pc3ltcG81c2k0dQorLm1pOG44aTlzOHk4bTlwOG85czhpOGEuCisubWluaXN5bXBvczJpMWEKKy5taTluOHU4dDllOHIuCisubTRpbjF1CisubWk5bjh1OHQ5ZThzOHQuCisubWk4czljOGg4aThlOXY4bzh1OHM5bDh5LgorLm0yaXMxYworLm1pczNjaDIKKy5taXNjaDJpZTQKKy5taXNjaGlldm91MgorLm1pc2NoaWV2bzJ1cworLm1pc2NoaWV2b3VzMWwyCisubWlzY2hpZXZvdXMxbHkKKy5taTlzOGU4cjhzLgorLm00aXNlCisubWlzM2VyCisubWlzZTRyMXMyCisubWk5czhvOGc5YTltOHkuCisubWkyc28KKy5taXNvMWdhCisubWlzbzJnYW0KKy5tbzhkOWU4bDlsOGk4bjhnLgorLm1vMmQxCisubW9kZWwxbAorLm1vZGVsbDJpCisubW9kZWwybGluNAorLm1vOGw5ZTljOHU4bDhlLgorLm1vbGUxY3UKKy5tb2xlNGN1bAorLm1vbGVjdWw0ZQorLm1vOGw5ZTljOHU4bDhlOHMuCisubW9sZWN1bGVzMgorLm1vOG45YThyOGM4aDhzLgorLm1vMW4xYQorLm1vbmFyM2MKKy5tb24yYTJyCisubW9uYXIyY2gKKy5tb25hcmM0aDFzMgorLm1vOG44ZTh5OWw4ZThuOWQ4ZThyLgorLm1vbmV5bGVuMWRlCisubW84bjhlOHk5bDhlOG45ZDhlOHI4cy4KKy5tb25leWxlbmRlNHI1czIKKy5tbzhuOG85YzhoOHI4bzhtOGUuCisubW9ubzJjaDQKKy5tb25vYzRocjQKKy5tb25vY2hybzJtZQorLm1vOG44bzllO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GVtcG9yYXIxaQorLnRlbXBvcmFyaTFseQorLnRlOG45dThyOGUuCisudGU4czh0OWI4ZThkLgorLnRlczJ0MWIKKy50ZXN0NGJlMmQKKy50ZTh4OHQ5dzhpOGQ4dDhoLgorLjN0ZXgKKy50ZXgxdDIKKy50ZXh0dzQKKy50ZXh0d2kyCisudGV4dHcyaWQKKy50ZXh0d2lkMnRoCisudGg4YThsOWE5bTh1OHMuCisudGhhM2xhCisudGhhbGEzbQorLnRoYWxhMW11CisudGhhbGFtMnVzCisudGg4ZThyOW04bzllOGw4YThzOXQ4aThjLgorLnRoMmUKKy50aGVyM200CisudGhlcjFtbworLnRoZXJtbzRlbAorLnRoZXJtb2UxbGEKKy50aGVybW9lbGFzdDJpCisudGhlcm1vZWxhczF0aWMKKy50aThtOGU5czh0OGE4bThwLgorLnRpMm1lcworLnRpbWVzMXRhCisudGltZXN0YTRtMXAKKy50aThtOGU5czh0OGE4bThwOHMuCisudGltZXN0YW0ycDFzMgorLnRvOG84bDlrOGk4dC4KKy50b28yCisudG9vbGsxaQorLnRvOG84bDlrOGk4dDhzLgorLnRvb2xraTR0MXMyCisudG84cDhvOWc4cjhhOHA4aDlpOWM4YThsLgorLnRvNXBvNGcKKy50b3BvMWdyCisudG9wbzVncmFwaDFpYworLnRvcG9ncjRhcGhpCisudG9wb2dyYXBoaTFjYQorLnRvOHE4dThlOHMuCisudG8xcQorLnRvcXUyCisudHI4YThpOXQ4bzhyOW84dThzLgorLjF0cmEKKy50cjJhaTIKKy50cmFpMXRvCisudHJhaXRvcm91MgorLnRyYWl0b3JvMnVzCisudHI4YThuOHM5YzhlOGk4djhlOHIuCisudHJhMm4KKy50cmEybjFzMgorLnRyYW5zNGMKKy50cmFuNHMzY2VpMgorLnRyYW5zY2UyaXYKKy50cjhhOG44czljOGU4aTh2OGU4cjhzLgorLnRyYW5zY2VpdmU0cjFzMgorLnRyOGE4bjhzOWc4cjhlOHM4cy4KKy50cmFuMnMzZworLnRyYW5zMWdyCisudH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isud2FsMWwKKy53YWwybGYKKy53YWxsZjRsMgorLndhbGxmbG93MWVyCisud2E4bDhsOWY4bDhvOHc5ZThyOHMuCisud2FsbGZsb3dlNHIxczIKKy53YThyOG05ZThzOHQuCisudzJhMnIKKy53YXIxbQorLndhcjJtZQorLndhcjJtZXMKKy53YThzOHQ4ZTl3OGE4dDhlOHIuCisud2FzNHQKKy53YXN0ZTJ3Cisud2FzdGUxdzVhCisud2FzdGV3YTF0ZQorLndhOHY4ZTlnOHU4aThkOGUuCisud2F2ZWczCisud2F2ZWcydWkyCisud2F2ZWd1MmlkCisud2E4djhlOWc4dThpOGQ4ZThzLgorLndhdmVndWlkZTRzMgorLndhOHY4ZTlsOGU4dC4KKy53YTh2OGU5bDhlOHQ4cy4KKy53YXZlbGU0dDFzMgorLndlOGI5bDhpOGs4ZS4KKy53MmUxYgorLndlYjJsMgorLndlYjNsNGlrCisud2U4ZThrOW44aThnOGg4dC4KKy53ZWVrbjJpZworLndlOGU4azluOGk4ZzhoOHQ4cy4KKy53ZWVrbmlnaDR0MXMyCisud2g4ZThlOGw5YzhoOGE4aThyLgorLndoZWU0bDFjMgorLndoZWVsMmNoCisud2hlZWxjaGFpMgorLndoZWVsY2hhNGlyCisud2g4ZThlOGw5YzhoOGE4aThyOHMuCisud2hlZWxjaGFpNHJzMgorLndoOGk4YzhoOWU4djhlOHIuCisud2hpNAorLndoNGkyY2gKKy53aGljaGUyCisud2hpY2hldjFlcgorLndoOGk4dDhlOXM4aThkOGU4ZC4KKy53aDJpdGUKKy53aGl0NGVzCisud2hpdGUxc2kKKy53aGl0ZTJzMmlkCisud2hpdGVzaTJkMWVkCisud2g4aTh0OGU5czhwOGE4YzhlLgorLndoaXRlMXNwCisud2hpdGUyczFwYQorLndoaXRlc3BhNGNlCisud2g4aTh0OGU5czhwOGE4YzhlOHMuCisud2k4ZDhlOXM4cDhyOGU4YThkLgorLncyaWQKKy53aWRlNHMyCisud2lkZTFzcAorLndpZGVzNHByZQorLndpZGVzcHIyCisud2lkZXNwcmVhMmQxCisud2k4bjhnOXM4cDhhOG4uCisud2luNGcKKy53aW5nczIKKy53aW5nMnMxcGEKKy53aW5nc3BhNG4KKy53aThuOGc5czhwOGE4bjhzLgorLndpbmdzcGEybjFzMgorLndpOG44ZzlzOHA4cjhlOGE4ZC4KKy53aW5nc3ByMgorLndpbmdzcHJlYTJkMQorLndpOHQ4YzhoOWM4cjhhOGY4dC4KKy53aTR0YworLndpdDRjaAorLndpdGNoY3JhMmY0dAorLndpdGNoY3JhMmYKKy53bzhyOGQ5czhwOGE4YzlpOG44Zy4KKy4xd28yCisud29yMmQxczIKKy53b3JkczRwCisud29yZDJzMXBhCisud29yZHNwNGEyY2kKKy53b3Jkc3BhMmMxaW4KKy53b3Jkc3BhYzFpbmcKKy53bzhyOGs5YThyOG84dThuOGQuCisud29yazJhMnIKKy53b3JrYXJvdTIKKy53b3JrYXJvdW4yZAorLndvOHI4azlhOHI4bzh1OG44ZDhzLgorLndvcmthcm91bjJkMXMyCisud284cjhrOWg4bzhyOHM4ZS4KKy53b3JraDQKKy53b3JraG9yNHNlCisud29ya2hvNHJzMgorLndvOHI4azloOG84cjhzOGU4cy4KKy53b3JraG9yczNlNHMKKy53cjhhOHA5YThyOG84dThuOGQuCisud3JhNAorLndyYXAyYTJyNAorLndyYTFwYQorLndyYXBhcm91MgorLndyYXBhcm91bjJkCisud3I4ZTh0OGM4aDllOGQuCisud3JlNHRjCisud3JldDRjaAorLndyZXRjaGUyCisud3JldDRjaDRlZAorLndyOGU4dDhjOGg5ZThkOWw4eS4KKy53cmV0Y2hlMmQxbHkKKy55ZThzOXQ4ZThyOXk4ZThhOHIuCisueWVzNAorLnllc3RlcnllMmEycgorLmFsOWc4ZTliOHI4YThpOXM4YzhoOGUuCisuYWxnZWJyYTJpczFjCisuYWxnZWJyYWlzM2NoMgorLmFsZ2VicmFpc2NoZTIKKy5hbDlsOGU5ZzhoOGU5bjh5LgorLmFsMWwKKy5hbDJsZQorLmFsM2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OHI5dDhlOGk5bDh1OG45ZzhlOG4uCisudmVydGVpMgorLnZlcnRlaWx1bjFnZW4KKy52aThpOGk4dDhoLgorLnY0aTVpNAorLnZpNGk1aTQKKy52aWkyaXRoCisudmk4aTh0OGguCisudmkyaXRoCisud2E4aDhyOXM4YzhoOGU4aThuOWw4aThjOGg5azhlOGk4dDhzOXQ4aDhlOG85cjhpOGUuCisud2E0aHI0Cisud2FoNHJzMgorLndhaHJzNGMKKy53YWhyczJjaDIKKy53YWhyc2NoZTIKKy53YWhyc2NoZWkyCisud2FocnNjaGU0aTRuMWwKKy53YWhyczJjaGVpbmw0aTJjaAorLndhaHJzY2hlaW5saWM0aGsKKy53YWhyc2NoZWlubGljaGtlaTIKKy53YWhyc2NoZWlubGljaGtlaTR0MXMyCisud2FocnNjaGVpbmxpY2hrZWl0czN0aDJlCisud2FocnNjaGVpbmxpY2hrZWl0c3RoZTFvNXIKKy53YWhyc2NoZWlubGljaGtlaXRzdGhlb3IyaWU0Cisud2U4cjluOGU4ci4KKy53MWVyCisud2VyNG4xZXIKKy53ZThyOXQ4aDhlOHI5aThhOG4uCisud2VydGgyZQorLndlcnRoZXIxaQorLndlcnRoZTFyMmkzYTQKKy53ZXJ0aGVyaTJhMm4KKy53aThuOWM4aDhlOHM5dDhlOHIuCisud2luMmNoCisud2luY2hlMgorLndpbmNoMWVzCisud2k4cjh0OXM4YzhoOGE4Zjh0LgorLnc0aXI0Cisud2lyNHQxczIKKy53aXJ0NHNjCisud2lydHMyY2gyCisud2lydHNjaGEyZgorLndpcnRzY2hhMmZ0Cisud2k4czlzOGU4bjlzOGM4aDhhOGY4dDlsOGk4YzhoLgorLnc0aTJzMXMKKy53aXNzZW40Cisud2lzc2UybjFzMgorLndpc3NlbnM0YworLndpc3NlbnMyY2gyCisud2lzc2Vuc2NoYTJmCisud2lzc2Vuc2NoYTJmdAorLndpc3NlbnNjaGFmMnRsCisud2lzc2VuczJjaGFmdGw0aTJjaAorLnh2OGk4aThpOHQ4a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dpZHRoPSIwZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6b3JpZW50YXRpb249Imhvcml6b250YWwiCisgICAgICAgICAgICAgICAgYW5kcm9pZDp2aXNpYmlsaXR5PSJnb25lIiAvPgorICAgICAgICAgICAgPEJ1dHRvbiBhbmRyb2lkOmlkPSJAK2lkL2J1dHRvbjEiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IjBkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfZ3Jhdml0eT0ibGVmdCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93ZWlnaHQ9IjEiCisgICAgICAgICAgICAgICAgYW5kcm9pZDptYXhMaW5lcz0iMiIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIgLz4KKyAgICAgICAgICAgIDxCdXR0b24gYW5kcm9pZDppZD0iQCtpZC9idXR0b24zIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSIwZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2dyYXZpdHk9ImNlbnRlcl9ob3Jpem9udGFsIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm1heExpbmVzPSIyIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IiAvPgorICAgICAgICAgICAgPEJ1dHRvbiBhbmRyb2lkOmlkPSJAK2lkL2J1dHRvbjIiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IjBkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfZ3Jhd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9ImdvbmUiIC8+CisgICAgICAgICAgICA8QnV0dG9uIGFuZHJvaWQ6aWQ9IkAraWQvYnV0dG9uMSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iMGRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9ncmF2aXR5PSJsZWZ0IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm1heExpbmVzPSIyIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IiAvPgorICAgICAgICAgICAgPEJ1dHRvbiBhbmRyb2lkOmlkPSJAK2lkL2J1dHRvbjMiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IjBkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfZ3Jhdml0eT0iY2VudGVyX2hvcml6b250YWwiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2VpZ2h0PSIxIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bWF4TGluZXM9IjIiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiIC8+CisgICAgICAgICAgICA8QnV0dG9uIGFuZHJvaWQ6aWQ9IkAraWQvYnV0dG9uMiIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iMGRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9ncmF2aXR5PSJyaWdodCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93ZWlnaHQ9IjEiCisgICAgICAgICAgICAgICAgYW5kcm9pZDptYXhMaW5lcz0iMiIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIgLz4K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L2JhY2tncm91bmRfZGFyayIKKyAgICAgICAgPgorICAgIDxTY3JvbGxWaWV3CisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJtYXRjaF9wYXJlbnQiCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0iMHB4IgorICAgICAgICBhbmRyb2lkOmxheW91dF93ZWlnaHQ9IjEiCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2Fib3ZlPSJAK2lkL2VtZXJnZW5jeUNhbGwiPgorICAgICAgICA8UmVsYXRpdmVMYXlvdXQgCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJtYXRjaF9wYXJlbnQiCisgICAgICAgICAgICAgICAgPgorICAgICAgICAKKyAgICAgICAgICAgIDxUZXh0VmlldyAKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL3RvcEhlYWRlciIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0iNjRkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRUb3A9InRydWUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luTGVmdD0iNGRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHRBcHBlYXJhbmNlPSI/YW5kcm9pZDphdHRyL3RleHRBcHBlYXJhbmNlTWVkaXVtIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0iY2VudGVyX3ZlcnRpY2FsIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6ZHJhd2FibGVMZWZ0PSJAZHJhd2FibGUvaWNfbG9ja19pZGxlX2xvY2siCisgICAgICAgICAgICAgICAgYW5kcm9pZDpkcmF3YWJsZVBhZGRpbmc9IjVkaXAiCisgICAgICAgICAgICAgICAgLz4KKyAgICAgICAgCisgICAgICAgICAgICA8IS0tIHNwYWNlciBiZWxvdyBoZWFkZXIgLS0+CisgICAgICAgICAgICA8VmlldworICAgICAgICAgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvc3BhY2VyVG9wIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJtYXRjaF9wYXJlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSIxZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2JlbG93PSJAaWQvdG9wSGVhZGVyIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6YmFja2dyb3VuZD0iQGRyYXdhYmxlL2RpdmlkZXJfaG9yaXpvbnRhbF9kYXJrIi8+CisgICAgICAgIAorICAgICAgICAgICAgPFRleHRWaWV3CisgICAgICAgICAgICAgICAgYW5kcm9pZDppZD0iQCtpZC9pbnN0cnVjdGlvbnMiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9iZWxvdz0iQCtpZC9zcGFjZXJUb3AiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luVG9wPSI4ZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X21hcmdpbkxlZnQ9IjlkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDp0ZXh0QXBwZWFyYW5jZT0iP2FuZHJvaWQ6YXR0ci90ZXh0QXBwZWFyYW5jZVNtYWxsIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6dGV4dD0iQGFuZHJvaWQ6c3RyaW5nL2xvY2tzY3JlZW5fZ2xvZ2luX2luc3RydWN0aW9ucyIKKyAgICAgICAgICAgICAgICAvPgorICAgICAgICAKKyAgICAgICAgICAgIDxFZGl0VGV4dAorICAgICAgICAgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvbG9naW4iCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9iZWxvdz0iQGlkL2luc3RydWN0aW9ucyIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5Ub3A9IjhkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luTGVmdD0iN2RpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5SaWdodD0iN2RpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmhpbnQ9IkBhbmRyb2lkOnN0cmluZy9sb2Nrc2NyZWVuX2dsb2dpbl91c2VybmFtZV9oaW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6aW5wdXRUeXBlPSJ0ZXh0RW1haWxBZGRyZXNzIgorICAgICAgICAgICAgICAgIC8+CisgICAgICAgIAorICAgICAgICAgICAgPEVkaXRUZXh0CisgICAgICAgICAgICAgICAgYW5kcm9pZDppZD0iQCtpZC9wYXNzd29yZCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2JlbG93PSJAaWQvbG9naW4iCisgICAgICAgICAgICAgICAgY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XIiCisgICAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHRTaXplPSIxOHNwIi8+CisKKyAgICAgICAgPCEtLSBzcGFjZXIgYWZ0ZXIgdGltZSBhbmQgZGF0ZSAtLT4KKyAgICAgICAgPFZpZXcKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJtYXRjaF9wYXJlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IjFkaXAiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5Cb3R0b209IjhkaXAiCisgICAgICAgICAgICBhbmRyb2lkOmJhY2tncm91bmQ9IkBhbmRyb2lkOmRyYXdhYmxlL2RpdmlkZXJfaG9yaXpvbnRhbF9kYXJrIgorICAgICAgICAgICAgICAgIC8+CisKKyAgICAgICAgPCEtLSBiYXR0ZXJ5IGluZm8gLS0+CisgICAgICAgIDxMaW5lYXJMYXlvdXQgYW5kcm9pZDppZD0iQCtpZC9iYXR0ZXJ5SW5mbyIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm9yaWVudGF0aW9uPSJob3Jpem9udGFsIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJtYXRjaF9wYXJlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpncmF2aXR5PSJjZW50ZXIiCisgICAgICAgICAgICAgID4KKworICAgICAgICAgICAgPEltYWdlVmlldyBhbmRyb2lkOmlkPSJAK2lkL2JhdHRlcnlJbmZvSWNvbiIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X21hc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QgYWxhcm0gaW5mbyAtLT4KKworICAgICAgICA8TGluZWFyTGF5b3V0IGFuZHJvaWQ6aWQ9IkAraWQvbmV4dEFsYXJtSW5mbyIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm9yaWVudGF0aW9uPSJob3Jpem9udGFsIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJtYXRjaF9wYXJlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpncmF2aXR5PSJjZW50ZXIiCisgICAgICAgICAgICAgID4KKworICAgICAgICAgICAgPEltYWdlVmlldworICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luUmlnaHQ9IjZkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpiYXNlbGluZUFsaWduZWQ9InRydWUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpzcmM9IkBhbmRyb2lkOmRyYXdhYmxlL2ljX2xvY2tfaWRsZV9hbGFybSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmdyYXZpdHk9ImNlbnRlciIKKyAgICAgICAgICAgIC8+CisKKyAgICAgICAgICAgIDxUZXh0VmlldyBhbmRyb2lkOmlkPSJAK2lkL25leHRBbGFybVRleHQiCisgICAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHRTa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yAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X21hcmdpblJpZ2h0PSI2ZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6YmFzZWxpbmVBbGlnbmVkPSJ0cnVlIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6c3JjPSJAYW5kcm9pZDpkcmF3YWJsZS9pY19sb2NrX2lkbGVfbG9jayIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmdyYXZpdHk9ImNlbnRlciIKKyAgICAgICAgICAgIC8+CisKKyAgICAgICAgICAgIDxUZXh0VmlldworICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDp0ZXh0U2l6ZT0iMThzcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHQ9IkBhbmRyb2lkOnN0cmluZy9sb2Nrc2NyZWVuX3NjcmVlbl9sb2NrZWQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpncmF2aXR5PSJjZW50ZXIiCisgICAgICAgICAgICAgICAgICAgIC8+CisgICAgICAgIDwvTGluZWFyTGF5b3V0PgorCisgICAgICAgIDwhLS0gbWVzc2FnZSBhYm91dCBob3cgdG8gdW5sb2NrCisgICAgICAgICAgICAgKHNob3duIHdoZW4gU0lNIGNhcmQgaXMgcHJlc2VudCkgLS0+CisgICAgICAgIDxUZXh0VmlldyBhbmRyb2lkOmlkPSJAK2lkL2xvY2tJbnN0cnVjdGlvbnMiCisgICAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0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jaF9wYXJlbnQiCisgICAgYW5kcm9pZDpvcmllbnRhdGlvbj0idmVydGljYWwiCisgICAgICAgID4KKyAgICAKKyAgICA8IS0tIGxlZnQgc2lkZTogc3RhdHVzIGFuZCBlbWVyZ2VuY3kgY2FsbCBidXR0b24gLS0+CisgICAgPExpbmVhckxheW91dAorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0iMGRpcCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMSIKKyAgICAgICAgICAgIGFuZHJvaWQ6b3JpZW50YXRpb249InZlcnRpY2FsIgorICAgICAgICAgICAgYW5kcm9pZDpncmF2aXR5PSJjZW50ZXJfdmVydGljYWwiCisgICAgICAgICAgICAgICAgPgorICAgICAgICA8aW5jbHVkZSBsYXlvdXQ9IkBsYXlvdXQva2V5Z3VhcmRfc2NyZWVuX3N0YXR1c19sYW5kIiAvPgorICAgIDwvTGluZWFyTGF5b3V0PgorICAgIAorICAgIDwhLS0gcmlnaHQgc2lkZTogcGFzc3dvcmQgLS0+CisgICAgPExpbmVhckxheW91dAorICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IjBkaXAiCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMSIKKyAgICAgICAgYW5kcm9pZDpvcmllbnRhdGlvbj0idmVydGljYWwiCisgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0iY2VudGVyIj4KKworICAgICAgICA8IS0tIFBhc3N3b3JkIGVudHJ5IGZpZWxkIC0tPgorICAgICAgICA8RWRpdFRleHQgYW5kcm9pZDppZD0iQCtpZC9wYXNzd29yZEVudHJ5IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ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mFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOm9yaWVudGF0aW9uPSJob3Jpem9udGFsIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luUmlnaHQ9IjZkaXAiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5MZWZ0PSI2ZGlwIgorICAgICAgICAgICAgYW5kcm9pZDpncmF2aXR5PSJjZW50ZXJfdmVydGljYWwiCisgICAgICAgICAgICBhbmRyb2lkOmJhY2tncm91bmQ9IkBhbmRyb2lkOmRyYXdhYmxlL2VkaXRfdGV4dCI+CisKKyAgICAgICAgICAgIDwhLS0gZGlzcGxheXMgZG90cyBhcyB1c2VyIGVudGVycyBwaW4gLS0+CisgICAgICAgICAgICA8VGV4dFZpZXcgYW5kcm9pZDppZD0iQCtpZC9waW5EaXNwbGF5IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSIwZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm1heExpbmVzPSIxIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6dGV4dEFwcGVhcmFuY2U9Ij9hbmRyb2lkOmF0dHIvdGV4dEFwcGVhcmFuY2VMYXJnZUludmVyc2UiCisgICAgICAgICAgICAgICAgYW5kcm9pZDp0ZXh0U3R5bGU9ImJvbGQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDppbnB1dFR5cGU9InRleHRQYXNzd29yZCIKKyAgICAgICAgICAgIC8+CisKKyAgICAgICAgICAgIDxJbWFnZUJ1dHRvbiBhbmRyb2lkOmlkPSJAK2lkL2JhY2tzcGFjZSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnNyYz0iQGFuZHJvaWQ6ZHJhd2FibGUva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kZTogc3RhdHVzIGFuZCBlbWVyZ2VuY3kgY2FsbCBidXR0b24gLS0+CisgICAgPExpbmVhckxheW91dAorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0iMGRpcCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMSIKKyAgICAgICAgICAgIGFuZHJvaWQ6b3JpZW50YXRpb249InZlcnRpY2FsIgorICAgICAgICAgICAgYW5kcm9pZDpncmF2aXR5PSJjZW50ZXJfdmVydGljYWwiCisgICAgICAgICAgICAgICAgPgorICAgICAgICA8aW5jbHVkZSBsYXlvdXQ9IkBsYXlvdXQva2V5Z3VhcmRfc2NyZWVuX3N0YXR1c19sYW5kIiAvPgorICAgIDwvTGluZWFyTGF5b3V0PgorCisgICAgPExpbmVhckxheW91dAorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0iMGRpcCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMSIKKyAgICAgICAgICAgIGFuZHJvaWQ6b3JpZW50YXRpb249InZlcnRpY2FsIgorICAgICAgICAgICAgICAgID4KKyAgICAgICAgPFRleHRWaWV3CisgICAgICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL3NjcmVlbkxvY2tlZCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2JlbG93PSJAaWQvc3RhdHVzMiIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X21hcmdpbkxlZnQ9IjI0ZGlwIgorICAgICAgICAgICAgYW5kcm9pZDp0ZXh0QXBwZWFyYW5jZT0iP2FuZHJvaWQ6YXR0ci90ZXh0QXBwZWFyYW5jZU1lZGl1bSIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X21hcmdpblRvcD0iMTJkaXAiCisgICAgICAgICAgICBhbmRyb2lkOmRyYXdhYmxlUGFkZGluZz0iNGRpcCIKKyAgICAgICAgICAgIC8+CisKKyAgICAgICAgPGNvbS5hbmRyb2lkLmludGVybmFsLndpZGdldC5XYXZlVmlldworICAgICAgICAgICAgYW5kcm9pZDppZD0iQCtpZC93YXZlX3ZpZXciCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAvPgorCisgICAgICAgIDwhLS0gImVtZXJnZW5jeSBjYWxscyBvbmx5IiBzaG93biB3aGVuIHNpbSBpcyBtaXNzaW5nIG9yIFBVS2QgLS0+CisgICAgICAgIDxUZXh0VmlldworICAgICAgICAgICAgYW5kcm9pZDppZD0iQCtpZC9lbWVyZ2VuY3lDYWxsVGV4dCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2JlbG93PSJAaWQvY2FycmllciIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2FsaWduUGFyZW50UmlnaHQ9InRydWUiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5Ub3A9IjBkaXAiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5SaWdodD0iOGRpcCIKKyAgICAgICAgICAgIGFuZH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XlvdXRfaGVpZ2h0PSJtYXRjaF9wYXJlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93ZWlnaHQ9IjEiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iMGRpcCIKKyAgICAgICAgICAgIGFuZHJvaWQ6b3JpZW50YXRpb249InZlcnRpY2FsIgorICAgICAgICAgICAgYW5kcm9pZDpncmF2aXR5PSJjZW50ZXJfdmVydGljYWwiCisgICAgICAgICAgICAgICAgPgorICAgICAgICA8aW5jbHVkZSBsYXlvdXQ9IkBsYXlvdXQva2V5Z3VhcmRfc2NyZWVuX3N0YXR1c19sYW5kIiAvPgorICAgIDwvTGluZWFyTGF5b3V0PgorCisgICAgPCEtLSByaWdodCBzaWRlIC0tPgorICAgIDxMaW5lYXJMYXlvdXQKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2VpZ2h0PSIxIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IjBkaXAiCisgICAgICAgICAgICBhbmRyb2lkOm9yaWVudGF0aW9uPSJob3Jpem9udGFsIgorICAgICAgICAgICAgYW5kcm9pZDpncmF2aXR5PSJjZW50ZXJfaG9yaXpvbnRhbCIKKyAgICAgICAgICAgICAgICA+CisgICAgICAgIDxUZXh0VmlldworICAgICAgICAgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvc2NyZWVuTG9ja2VkIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYmVsb3c9IkBpZC9zdGF0dXMyIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6dGV4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ICAgICAgYW5kcm9pZDpncmF2aXR5PSJjZW50ZXJfdmVydGljYWwiCisgICAgICAgICAgICAgICAgPgorICAgICAgICAKKyAgICAgICAgPGluY2x1ZGUgbGF5b3V0PSJAbGF5b3V0L2tleWd1YXJkX3NjcmVlbl9zdGF0dXNfbGFuZCIgLz4KKworICAgICAgICA8IS0tIGZvb3RlciAtLT4KKyAgICAgICAgPEZyYW1lTGF5b3V0CisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5MZWZ0PSIxNDBkaXAiCisgICAgICAgICAgICA+CisKKyAgICAgICAgICAgIDwhLS0gb3B0aW9uIDE6IGEgc2luZ2xlIGVtZXJnZW5jeSBjYWxsIGJ1dHRvbiAtLT4KKyAgICAgICAgICAgIDxSZWxhdGl2ZUxheW91dCBhbmRyb2lkOmlkPSJAK2lkL2Zvb3Rlck5vcm1hbCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0ibGVmdCIKKyAgICAgICAgICAgICAgICA+CisgICAgICAgICAgICAgICAgPEJ1dHRvbiBhbmRyb2lkOmlkPSJAK2lkL2VtZXJnZW5jeUNhbGxBbG9uZSIKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6dGV4dD0iQHN0cmluZy9sb2Nrc2NyZWVuX2VtZXJnZW5jeV9jYWxsIgorICAgICAgICAgICAgICAgICAgICBzdHlsZT0iQHN0eWxlL1dpZGdldC5CdXR0b24uVHJhbnNwYXJlbnQiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6ZHJhd2FibGVMZWZ0PSJAZHJhd2FibGUvaWNfZW1lcmdlbmN5IgorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOmRyYXdhYmxlUGFkZGluZz0iOGRpcCIKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDp2aXNpYmlsaXR5PSJnb25lIgorICAgICAgICAgICAgICAgICAgICAvPgorICAgICAgICAgICAgPC9SZWxhdGl2ZUxheW91dD4KKworICAgICAgICAgICAgPCEtLSBvcHRpb24gMjogYW4gZW1lcmdlbmN5IGNhbGwgYnV0dG9uLCBhbmQgYSAnZm9yZ290IHBhdHRlcm4/JyBidXR0b24gLS0+CisgICAgICAgICAgICA8TGluZWFyTGF5b3V0IGFuZHJvaWQ6aWQ9IkAraWQvZm9vdGVyRm9yZ290UGF0dGVybiIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm9yaWVudGF0aW9uPSJ2ZXJ0aWNhbCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0ibGVmdCIKKyAgICAgICAgICAgICAgICA+CisgICAgICAgICAgICAgICAgPEJ1dHRvbiBhbmRyb2lkOmlkPSJAK2lkL2ZvcmdvdFBhdHRlcm4iCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJtYXRjaF9wYXJlbnQiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3Jh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W91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmdyYXZpdHk9ImxlZnQiCisgICAgICAgICAgICAgICAgPgorICAgICAgICAgICAgICAgIDxCdXR0b24gYW5kcm9pZDppZD0iQCtpZC9lbWVyZ2VuY3lDYWxsQWxvbmUiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHQ9IkBzdHJpbmcvbG9ja3NjcmVlbl9lbWVyZ2VuY3lfY2FsbCIKKyAgICAgICAgICAgICAgICAgICAgc3R5bGU9IkBzdHlsZS9XaWRnZXQuQnV0dG9uLlRyYW5zcGFyZW50IgorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOmRyYXdhYmxlTGVmdD0iQGRyYXdhYmxlL2ljX2VtZXJnZW5jeSIKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDpkcmF3YWJsZVBhZGRpbmc9IjhkaXAiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6dmlzaWJpbGl0eT0iZ29uZSIKKyAgICAgICAgICAgICAgICAgICAgLz4KKyAgICAgICAgICAgIDwvUmVsYXRpdmVMYXlvdXQ+CisKKyAgICAgICAgICAgIDwhLS0gb3B0aW9uIDI6IGFuIGVtZXJnZW5jeSBjYWxsIGJ1dHRvbiwgYW5kIGEgJ2ZvcmdvdCBwYXR0ZXJuPycgYnV0dG9uIC0tPgorICAgICAgICAgICAgPExpbmVhckxheW91dCBhbmRyb2lkOmlkPSJAK2lkL2Zvb3RlckZvcmdvdFBhdHRlcm4iCisgICAgICAgICAgICAgICAgYW5kcm9pZDpvcmllbnRhdGlvbj0idmVydGljYWwiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmdyYXZpdHk9ImxlZnQiCisgICAgICAgICAgICAgICAgPgorICAgICAgICAgICAgICAgIDxCdXR0b24gYW5kcm9pZDppZD0iQCtpZC9mb3Jnb3RQYXR0ZXJuIgorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICAgICAgc3R5bGU9IkBzdHlsZS9XaWRnZXQuQnV0dG9uLlRyYW5zcGFyZW50IgorICAgICAgICAgICAgICAgICAgICAvPgorICAgICAgICAgICAgICAgIDxCdXR0b24gYW5kcm9pZDppZD0iQCtpZC9lbWVyZ2VuY3lDYWxsVG9nZXRoZXIiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJtYXRjaF9wYXJlbnQiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHQ9IkBzdHJpbmcvbG9ja3NjcmVlbl9lbWVyZ2VuY3lfY2FsbCIKKyAgICAgICAgICAgICAgICAgICAgc3R5bGU9IkBzdHlsZS9XaWRnZXQuQnV0dG9uLlRyYW5zcGFyZW50IgorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOmRyYXdhYmxlTGVmdD0iQGRyYXdhYmxlL2ljX2VtZXJnZW5jeSIKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDpkcmF3YWJsZVBhZGRpbmc9IjhkaXAiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6dmlzaW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bnRlbnQiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMCIgLz4KKworICAgICAgICA8L0xpbmVhckxheW91dD4KKworICAgICAgICA8RnJhbWVMYXlvdXQgYW5kcm9pZDppZD0iQCtpZC9wcmVmcyIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iMHB4IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMjUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luTGVmdD0iMTZkcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5SaWdodD0iMTZkcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5Ub3A9IjE2ZHAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luQm90dG9tPSIxNmRwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6YmFja2dyb3VuZD0iIzYwMjAyMDQwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6dmlzaWJpbGl0eT0iZ29uZSIgLz4KKyAgICA8L0xpbmVhckxheW91dD4KKworICAgIDxSZWxhdGl2ZUxheW91dCBhbmRyb2lkOmlkPSJAK2lkL2J1dHRvbl9iYXIiCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF93ZWlnaHQ9IjAiCisgICAgICAgIGFuZHJvaWQ6YmFja2dyb3VuZD0iQGFuZHJvaWQ6ZHJhd2FibGUvYm90dG9tX2JhciIKKyAgICAgICAgYW5kcm9pZDp2aXNpYmlsaXR5PSJnb25lIj4KKworICAgICAgICA8QnV0dG9uIGFuZHJvaWQ6aWQ9IkAraWQvYmFja19idXR0b24iCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iMTUwZGlwIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW49IjVkaXAiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9hbGlnblBhcmVudExlZnQ9InRydWUiCisgICAgICAgICAgICBhbmRyb2lkOmRyYXdhYmxlTGVmdD0iQGRyYXdhYmxlL2ljX2J0bl9iYWNrIgorICAgICAgICAgICAgYW5kcm9pZDpkcmF3YWJsZVBhZGRpbmc9IjNkaXAiCisgICAgICAgICAgICBhbmRyb2lkOnRleHQ9IkBzdHJpbmcvYmFja19idXR0b25fbGFiZWwiCisgICAgICAgIC8+CisgICAgICAgIDxMaW5lYXJMYXlvdXQKKyAgICAgICAgICAgIGFuZHJvaWQ6b3JpZW50YXRpb249Imhvcml6b250YWwiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9hbGlnblBhcmVudFJpZ2h0PSJ0cnVlIj4KKworICAgICAgICAgICAgPEJ1dHRvbiBhbmRyb2lkOmlkPSJAK2lkL3NraXBfYnV0dG9uIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSIxNTBkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luPSI1ZGlwIgorICAgICAgICAgICAgICAgIGFuZ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ICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luPSI1ZGlwIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRMZWZ0PSJ0cnVlIgorICAgICAgICAgICAgYW5kcm9pZDpkcmF3YWJsZUxlZnQ9IkBkcmF3YWJsZS9pY19idG5fYmFjayIKKyAgICAgICAgICAgIGFuZHJvaWQ6ZHJhd2FibGVQYWRkaW5nPSIzZGlwIgorICAgICAgICAgICAgYW5kcm9pZDp0ZXh0PSJAc3RyaW5nL2JhY2tfYnV0dG9uX2xhYmVsIgorICAgICAgICAvPgorICAgICAgICA8TGluZWFyTGF5b3V0CisgICAgICAgICAgICBhbmRyb2lkOm9yaWVudGF0aW9uPSJob3Jpem9udGFsIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRSaWdodD0idHJ1ZSI+CisKKyAgICAgICAgICAgIDxCdXR0b24gYW5kcm9pZDppZD0iQCtpZC9za2lwX2J1dHRvbiIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iMTUwZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X21hcmdpbj0iNWRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHQ9IkBzdHJpbmcvc2tpcF9idXR0b25fbGFiZWwiCisgICAgICAgICAgICAgICAgYW5kcm9pZDp2aXNpYmlsaXR5PSJnb25lIgorICAgICAgICAgICAgLz4KKworICAgICAgICAgICAgPEJ1dHRvbiBhbmRyb2lkOmlkPSJAK2lkL25leHRfYnV0dG9uIgorICAgICAgICAgIC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lkOmF0dHIvdGV4dENvbG9yUHJpbWFyeUludmVyc2UiCisgICAgICAgIGFuZHJvaWQ6dmlzaWJpbGl0eT0iZ29uZSIKKyAgICAvPgorCisgICAgPEltYWdlVmlldworICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL3NlYXJjaF9idXR0b24iCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF9ncmF2aXR5PSJjZW50ZXJfdmVydGljYWwiCisgICAgICAgIGFuZHJvaWQ6c3JjPSJAYW5kcm9pZDpkcmF3YWJsZS9pY19idG5fc2VhcmNoIgorICAgIC8+CisKKyAgICA8TGluZWFyTGF5b3V0CisgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvc2VhcmNoX2VkaXRfZnJhbWUiCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJ3cmFwX2NvbnRlbnQiCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF93ZWlnaHQ9IjEiCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2dyYXZpdHk9ImNlbnRlcl92ZXJ0aWNhbCIKKyAgICAgICAgYW5kcm9pZDpvcmllbnRhdGlvbj0iaG9yaXpvbnRhbCI+CisKKyAgICAgICAgPCEtLSBJbm5lciBsYXlvdXQgY29udGFpbnMgdGhlIGFwcCBpY29uLCBidXR0b24ocykgYW5kIEVkaXRUZXh0IC0tPgorICAgICAgICA8TGluZWFyTGF5b3V0CisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93ZWlnaHQ9IjEiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9ncmF2aXR5PSJjZW50ZXJfdmVydGljYWwiCisgICAgICAgICAgICBhbmRyb2lkOm9yaWVudGF0aW9uPSJob3Jpem9udGFsIgorICAgICAgICAgICAgYW5kcm9pZDpiYWNrZ3JvdW5kPSI/YW5kcm9pZDphdHRyL2VkaXRUZXh0QmFja2dyb3VuZCI+CisKKyAgICAgICAgICAgIDxJbWFnZVZpZXcKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL3NlYXJjaF9hcHBfaWNvbiIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IjI0ZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSIyNGRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5SaWdodD0iN2RpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9ncmF2aXR5PSJib3R0b20iCisgICAgICAgICAgICAgICAgYW5kcm9pZDpzcmM9IkBhbmRyb2lkOmRyYXdhYmxlL2ljX2J0bl9zZWFyY2giCisgICAgICAgICAgICAvPgorCisgICAgICAgICAgICA8QXV0b0NvbXBsZXRlVGV4dFZpZXcKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL3NlYXJjaF9zcmNfdGV4dCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iMGRwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm1pbldpZHRoPSIxMDBkcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9ncmF2aXR5PSJib3R0b20iCisgICAgICAgICAgICAgICAgYW5kcm9pZDpwYWRkaW5nTGVmdD0iOGRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnBhZGRpbmdSaWdodD0iNmRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmRyYXdhYmxlUGFkZGluZz0iMmRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnNpbmdsZUxpbmU9InRydWUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDplbGxpcHNpemU9ImVuZCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmJhY2tncm91bmQ9IkBudWxsIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6aW5wdXRUeXBlPSJ0ZXh0fHRleHRBdXRvQ29tcGxldGUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDppbWVPcHRpb25zPSJhY3Rpb25TZWFyY2giCisgICAgICAgICAgICAgICAgYW5kcm9pZDpkcm9wRG93bkhlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6ZHJvcERvd25BbmNob3I9IkBpZC9zZWFyY2hfZWRpdF9mcmFtZSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmRyb3BEb3duVmVydGljYWxPZmZzZXQ9IjBkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpkcm9wRG93bkhvcml6b250YWxPZmZzZXQ9IjBkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpwb3B1cEJhY2tncm91bmQ9Ij9hbmRyb2lkOmF0dHIvc2VhcmNoRHJvcGRvd25CYWNrZ3JvdW5kIgorICAgICAgICAgICAgLz4KKworICAgICAgICAgICAgPCEtLSBUT0RPOiBVc2UgdGhlIGdlbmVyaWMgZGlhbG9nIGNsb3NlIGRyYXdhYmxlIC0tPgorICAgICAgICAgICAgPEltYWdlVmlldworICAgICAgICAgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvc2VhcmNoX2Nsb3NlX2J0biIKKyAgICAgICAgICAgICAgIC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FyZS1zdHlsZWFibGU+CisKKworICAgIDwhLS0gPT09PT09PT09PT09PT09PT09PT09PT09PT0gLS0+CisgICAgPCEtLSBBbmltYXRvclNldCBjbGFzcyBhdHRyaWJ1dGVzIC0tPgorICAgIDwhLS0gPT09PT09PT09PT09PT09PT09PT09PT09PT0gLS0+CisgICAgPGVhdC1jb21tZW50IC8+CisKKyAgICA8ZGVjbGFyZS1zdHlsZWFibGUgbmFtZT0iQW5pbWF0b3JTZXQiPgorICAgICAgICA8IS0tIE5hbWUgb2YgdGhlIHByb3BlcnR5IGJlaW5nIGFuaW1hdGVkLiAtLT4KKyAgICAgICAgPGF0dHIgbmFtZT0ib3JkZXJpbmciPgorICAgICAgICAgICAgPCEtLSBjaGlsZCBhbmltYXRpb25zIHNob3VsZCBiZSBwbGF5ZWQgdG9nZXRoZXIuIC0tPgorICAgICAgICAgICAgPGVudW0gbmFtZT0idG9nZXRoZXIiIHZhbHVlPSIwIiAvPgorICAgICAgICAgICAgPCEtLSBjaGlsZCBhbmltYXRpb25zIHNob3VsZCBiZSBwbGF5ZWQgc2VxdWVudGlhbGx5LCBpbiB0aGUgc2FtZSBvcmRlciBhcyB0aGUgeG1sLiAtLT4KKyAgICAgICAgICAgIDxlbnVtIG5hbWU9InNlcXVlbnRpYWxseSIgdmFsdWU9IjEiIC8+CisgICAgICAgIDwvYXR0cj4KKyAgICA8L2RlY2xhcmUtc3R5bGVhYmxlPgorCisgICAgPCEtLSA9PT09PT09PT09PT09PT09PT09PT09PT09PSAtLT4KICAgICA8IS0tIFN0YXRlIGF0dHJpYnV0ZXMgICAgICAgICAgIC0tPgogICAgIDwhLS0gPT09PT09PT09PT09PT09PT09PT09PT09PT0gLS0+CiAgICAgPGVhdC1jb21tZW50IC8+CkBAIC0yOTE4LDYgKzMzMDQsNyBAQAogICAgICAgICAgPGxpPiJzdGF0ZV9sYXN0IgogICAgICAgICAgPGxpPiJzdGF0ZV9vbmx5IgogICAgICAgICAgPGxpPiJzdGF0ZV9w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bmRfbGlnaHRfdHJhbnNwYXJlbnQiIGlkPSIweDAxMDgwMGFhIiAvPgogICA8cHVibGljIHR5cGU9ImRyYXdhYmxlIiBuYW1lPSJzdGF0X25vdGlmeV9zZGNhcmRfcHJlcGFyZSIgaWQ9IjB4MDEwODAwYWIiIC8+Ci0gIAorCiA8IS0tID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgICBSZXNvdXJjZXMgYWRkZWQgaW4gdmVyc2lvbiA2IG9mIHRoZSBwbGF0Zm9ybSAoRWNsYWlyIDIuMC4xKS4KICAgICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IC0tPgpAQCAtMTIxMSw3ICsxMjExLDcgQEAKICAgPHB1YmxpYyB0eXBlPSJhdHRyIiBuYW1lPSJxdWlja0NvbnRhY3RCYWRnZVN0eWxlU21hbGxXaW5kb3dTbWFsbCIgaWQ9IjB4MDEwMTAyYjEiIC8+CiAgIDxwdWJsaWMgdHlwZT0iYXR0ciIgbmFtZT0icXVpY2tDb250YWN0QmFkZ2VTdHlsZVNtYWxsV2luZG93TWVkaXVtIiBpZD0iMHgwMTAxMDJiMiIgLz4KICAgPHB1YmxpYyB0eXBlPSJhdHRyIiBuYW1lPSJxdWlja0NvbnRhY3RCYWRnZVN0eWxlU21hbGxXaW5kb3dMYXJnZSIgaWQ9IjB4MDEwMTAyYjMiIC8+Ci0gIAorCiA8IS0tID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgICBSZXNvdXJjZXMgYWRkZWQgaW4gdmVyc2lvbiA3IG9mIHRoZSBwbGF0Zm9ybSAoRWNsYWlyIE1SMSkuCiAgICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAtLT4KQEAgLTEyMjAsNyArMTIyMCw3IEBACiAgIDxwdWJsaWMgdHlwZT0iYXR0ciIgbmFtZT0iYXV0aG9yIiBpZD0iMHgwMTAxMDJiNCIgLz4KICAgPHB1YmxpYyB0eXBlPSJhdHRyIiBuYW1lPSJhdXRvU3RhcnQiIGlkPSIweDAxMDEwMmI1IiAvPgogCi0gICAgCisKIDwhLS0gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAgIFJlc291cmNlcyBhZGRlZCBpbiB2ZXJzaW9uIDggb2YgdGhlIHBsYXRmb3JtIChFY2xhaXIgTVIyKS4KICAgICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IC0tPgpAQCAtMTI0MSwxOSArMTI0MSwxNiBAQAogICA8cHVibGljIHR5cGU9ImF0dHIiIG5hbWU9InRhYlN0cmlwRW5hYmxlZCIgaWQ9IjB4MDEwMTAyYmQiIC8+CiAKICAgPHB1YmxpYyB0eXBlPSJpZCIgbmFtZT0iY3VzdG9tIiBpZD0iMHgwMTAyMDAyYiIgLz4KLSAgICAKKwogICA8cHVibGljIHR5cGU9ImFuaW0iIG5hbWU9ImN5Y2xlX2ludGVycG9sYXRvciIgaWQ9IjB4MDEwYTAwMGMiIC8+CiAKIDwhLS0gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAgIFJlc291cmNlcyBpbnRyb2R1Y2VkIGluIEdpbmdlcmJyZWFkLgogICAgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gLS0+Ci0gICAgIAorICA8ZWF0LWNvbW1lbnQgLz4KICAgPHB1YmxpYyB0eXBlPSJhdHRyIiBuYW1lPSJsb2dvIiBpZD0iMHgwMTAxMDJiZSIgLz4KICAgPHB1YmxpYyB0eXBlPSJhdH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vL2FkZAorICAgICAgICBpbnQgbmV0SWQgPSBtV2lmaU1hbmFnZXIuYWRkTmV0d29yayhjb25maWcpOworICAgICAgICBhc3NlcnRUcnVlKG5ldElkICE9IC0xKTsKKworICAgICAgICAvL2NoZWNrIGNvbmZpZyBsaXN0CisgICAgICAgIExpc3Q8V2lmaUNvbmZpZ3VyYXRpb24+IGNvbmZpZ0xpc3QgPSBtV2lmaU1hbmFnZXIuZ2V0Q29uZmlndXJlZE5ldHdvcmtzKCk7CisgICAgICAgIGJvb2xlYW4gZm91bmQgPSBmYWxzZTsKKyAgICAgICAgZm9yIChXaWZpQ29uZmlndXJhdGlvbiBjIDogY29uZmlnTGlzdCkgeworICAgICAgICAgICAgaWYgKGMubmV0d29ya0lkID09IG5ldElkKSB7CisgICAgICAgICAgICAgICAgZm91bmQgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGFzc2VydFRydWUoZm91bmQpOworCisgICAgICAgIC8vcmVtb3ZlCisgICAgICAgIGJvb2xlYW4gcmV0ID0gbVdpZmlNYW5hZ2VyLnJlbW92ZU5ldHdvcmsobmV0SWQpOworICAgICAgICBhc3NlcnRUcnVlKHJldCk7CisKKyAgICAgICAgLy9jaGVjayBjb25maWcgbGlzdAorICAgICAgICBjb25maWdMaXN0ID0gbVdpZmlNYW5hZ2VyLmdldENvbmZpZ3VyZWROZXR3b3JrcygpOworICAgICAgICBmb3VuZCA9IGZhbHNlOworICAgICAgICBmb3IgKFdpZmlDb25maWd1cmF0aW9uIGMgOiBjb25maWdMaXN0KSB7CisgICAgICAgICAgICBpZiAoYy5uZXR3b3JrSWQgPT0gbmV0SWQpIHsKKyAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBhc3NlcnRGYWxzZShmb3VuZCk7CisgICAgfQorCisgICAgLy8gVGVzdCBjYXNlIDI6IGVuYWJsZS9kaXNhYmxlIGEgb3BlbiBuZXR3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ICAgICAvL2Rpc2FibGUgbmV0d29yaworICAgICAgICByZXQgPSBtV2lmaU1hbmFnZXIuZGlzYWJsZU5ldHdvcmsobmV0SWQpOworICAgICAgICBhc3NlcnRUcnVlKHJldCk7CisKKyAgICAgICAgLy9jaGVjayBjb25maWcgbGlzdAorICAgICAgICBjb25maWdMaXN0ID0gbVdpZmlNYW5hZ2VyLmdldENvbmZpZ3VyZWROZXR3b3JrcygpOworICAgICAgICBmb3IgKFdpZmlDb25maWd1cmF0aW9uIGMgOiBjb25maWdMaXN0KSB7CisgICAgICAgICAgICBpZiAoYy5uZXR3b3JrSWQgPT0gbmV0SWQpIHsKKyAgICAgICAgICAgICAgICBhc3NlcnRUcnVlKGMuc3RhdHVzID09IFN0YXR1cy5ESVNBQkxFRCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBUZXN0IGNhc2UgMzogcGluZyBzdXBwbGljYW50CisgICAgQExhcmdlVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RQaW5nU3VwcGxpY2FudCgpIHsKKyAgICAgICAgYXNzZXJ0VHJ1ZShtV2lmaU1hbmFnZXIucGluZ1N1cHBsaWNhbnQoKSk7CisgICAgICAgIG1XaWZpTWFuYWdlci5zZXRXaWZpRW5hYmxlZChmYWxzZSk7CisgICAgICAgIHNsZWVwQWZ0ZXJXaWZpRW5hYmxlKCk7CisKKyAgICAgICAgYXNzZXJ0RmFsc2UobVdpZmlNYW5hZ2VyLnBpbmdTdXBwbGljYW50KCkpOworICAgICAgICBtV2lmaU1hbmFnZXIuc2V0V2lmaUVuYWJsZWQodHJ1ZSk7CisgICAgICAgIHNsZWVwQWZ0ZXJXaWZpRW5hYmxlKCk7CisgICAgfQorCisgICAgLy8gVGVzdCBjYXNlIDQ6IHNhdmUgY29uZmlnCisgICAgQExhcmdlVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RTYXZlQ29uZmlnKCkgeworICAgICAgICBXaWZpQ29uZmlndXJhdGlvbiBjb25maWcgPSBuZXcgV2lmaUNvbmZpZ3VyYXRpb24oKTsKKyAgICAgICAgY29uZmlnLlNTSUQgPSAiXCJUZXN0U1NJRDNcIiI7CisgICAgICAgIGNvbmZpZy5hbGxvd2VkS2V5TWFuYWdlbWVudC5zZXQoS2V5TWdtdC5OT05FKTsKKworICAgICAgICAvL2FkZAorICAgICAgICBpbnQgbmV0SWQgPSBtV2lmaU1hbmFnZXIuYWRkTmV0d29yayhjb25maWcpOworICAgICAgICBhc3NlcnRUcnVlKG5ldElkICE9IC0xKTsKKworICAgICAgICBtV2lmaU1hbmFnZXIuc2F2ZUNvbmZpZ3VyYXRpb24oKTsKKworICAgICAgICAvL3Jlc3RhcnQgd2lmaQorICAgICAgICBtV2lmaU1hbmFnZXIuc2V0V2lmaUVuYWJsZWQoZmFsc2UpOworICAgICAgICBtV2lmaU1hbmFnZXIuc2V0V2lmaUVuYWJsZWQodHJ1ZSk7CisKKyAgICAgICAgc2xlZXBBZnRlcldpZmlFbmFibGUoKTsKKworICAgICAgICAvL2NoZWNrIGNvbmZpZyBsaXN0CisgICAgICAgIExpc3Q8V2lmaUNvbmZpZ3VyYXRpb24+IGNvbmZpZ0xpc3QgPSBtV2lmaU1hbmFnZXIuZ2V0Q29uZmlndXJlZE5ldHdvcmtzKCk7CisgICAgICAgIGJvb2xlYW4gZm91bmQgPSBmYWxzZTsKKyAgICAgICAgZm9yIChXaWZpQ29uZmlndXJhdGlvbiBjIDogY29uZmlnTGlzdCkgeworICAgICAgICAgICAgaWYgKGMuU1NJRC5lcXVhbHMoIlRlc3RTU0lEMyIpKSB7CisgICAgICAgICAgICAgICAgZm91bmQgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGFzc2VydFRydWUoZm91bmQpOworCisgICAgICAgIC8vcmVzdG9yZSBjb25maWcKKyAgICAgICAgYm9vbGVhbiByZXQgPSBtV2lmaU1hbmFnZXIucmVtb3ZlTmV0d29yayhuZXRJZCk7C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0FOX01PREUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoQWRhcHRlci5FUlJPUik7Ci0gICAgICAgICAgICAgICAgICAgIGFzc2VydE5vdFNhbWUobW9kZSwgQmx1ZXRvb3RoQWRhcHRlci5FUlJPUik7Ci0gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAobW9kZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNDQU5fTU9ERV9OT05FOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaXJlZEZsYWdzIHw9IFNDQU5fTU9ERV9OT05FX0ZMQUc7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU0NBTl9NT0RFX0NPTk5FQ1RBQkxFOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaXJlZEZsYWdzIHw9IFNDQU5fTU9ERV9DT05ORUNUQUJMRV9GTEFHOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNDQU5fTU9ERV9DT05ORUNUQUJMRV9ESVNDT1ZFUkFCTEU6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZpcmVkRmxhZ3MgfD0gU0NBTl9NT0RFX0NPTk5FQ1RBQkxFX0RJU0NPVkVSQUJMRV9GTEFHOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChCbHVldG9vdGhBZGFwdGVyLkFDVElPTl9TVEFURV9DSEFOR0VELmVxdWFscyhpbnRlbnQuZ2V0QWN0aW9uKCkpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhBZGFwdGVyLkVYVFJBX1NUQVRFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEFkYXB0ZXIuRVJST1IpOwotICAgICAgICAgICAgICAgICAgICBhc3NlcnROb3RTYW1lKHN0YXRlLCBCbHVldG9vdGhBZGFwdGVyLkVSUk9SKTsKLSAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChzdGF0ZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX09GRjoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmlyZWRGbGFncyB8PSBTVEFURV9PRkZfRkxBRzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9UVVJOSU5HX09OOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaXJlZEZsYWdzIHw9IFNUQVRFX1RVUk5JTkdfT05fRkxBRzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9PTjoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmlyZWRGbGFncyB8PSBTVEFURV9PTl9GTEFHOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX1RVUk5JTkdfT0ZGOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaXJlZEZsYWdzIHw9IFNUQVRFX1RVUk5JTkdfT0ZGX0ZMQUc7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEJsdWV0b290aEEyZHAuQUNUSU9OX1NJTktfU1RBVEVfQ0hBTkdFRC5lcXVhbHMoaW50ZW50LmdldEFjdGlvbigpKSkgewotICAgICAgICAgICAgICAgICAgICBtRmlyZWRGbGFncyB8PSBQUk9GSUxFX0EyRFBfRkxBRzsKLSAgICAgICAgICAgICAgICAgICAgaW50IHN0YXRlID0gaW50ZW50LmdldEludEV4dHJhKEJsdWV0b290aEEyZHAuRVhUUkFfU0lOS19TVEFURSwgLTEpOwotICAgICAgICAgICAgICAgICAgICBhc3NlcnROb3RTYW1lKHN0YXRlLCAtMSk7Ci0gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUEyZHBGaXJlZEZsYWdzIHw9IEEyRFBfU1RBVEVfRElTQ09OTkVDVEVEOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RJTkc6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUEyZHBGaXJlZEZsYWdzIHw9IEEyRFBfU1RBVEVfQ09OTkVDVElORzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUEyZHBGaXJlZEZsYWdzIHw9IEEyRFBfU1RBVEVfQ09OTkVDVEVEOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBMmRwLlNUQVRFX0RJU0NPTk5FQ1RJTkc6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUEyZHBGaXJlZEZsYWdzIHw9IEEyRFBfU1RBVEVfRElTQ09OTkVDVElORzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9QTEFZSU5HOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BMmRwRmlyZWRGbGFncyB8PSBBMkRQX1NUQVRFX1BMQVlJTkc7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEJsdWV0b290aEhlYWRzZXQuQUNUSU9OX1NUQVRFX0NIQU5HRUQuZXF1YWxzKGludGVudC5nZXRBY3Rpb24oKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUZpcmVkRmxhZ3MgfD0gUFJPRklMRV9IRUFEU0VUX0ZMQUc7Ci0gICAgICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhIZWFkc2V0LkVYVFJBX1NUQVRFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRVJST1IpOwotICAgICAgICAgICAgICAgICAgICBhc3NlcnROb3RTYW1lKHN0YXRlLCBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0VSUk9SKTsKLSAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChzdGF0ZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0RJU0NPTk5FQ1RFRDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZHNldEZpcmVkRmxhZ3MgfD0gSEVBRFNFVF9TVEFURV9ESVNDT05ORUNURUQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQ09OTkVDVElORzoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZHNldEZpcmVkRmxhZ3MgfD0gSEVBRFNFVF9TVEFURV9DT05ORUNUSU5HOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RFRDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZHNldEZpcmVkRmxhZ3MgfD0gSEVBRFNFVF9TVEFURV9DT05ORUNURUQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIExvZy5pKCJCVCIsIGludGVudC50b1N0cmluZygpKTsKKyAgICAgICAgICAgIGlmIChCbHVldG9vdGhBZGFwdGVyLkFDVElPTl9ESVNDT1ZFUllfU1RBUlRFRC5lcXVhbHMoaW50ZW50LmdldEFjdGlvbigpKSkgeworICAgICAgICAgICAgICAgIHNldEZpcmVkRmxhZyhESVNDT1ZFUllfU1RBUlRFRF9GTEFHKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoQmx1ZXRvb3RoQWRhcHRlci5BQ1RJT05fRElTQ09WRVJZX0ZJTklTSEVELmVxdWFscyhpbnRlbnQuZ2V0QWN0aW9uKCkpKSB7CisgICAgICAgICAgICAgICAgc2V0RmlyZWRGbGFnKERJU0NPVkVSWV9GSU5JU0hFRF9GTEFHKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoQmx1ZXRvb3RoQWRhcHRlci5BQ1RJT05fU0NBTl9NT0RFX0NIQU5HRUQuZXF1YWxzKGludGVudC5nZXRBY3Rpb24oKSkpIHsKKyAgICAgICAgICAgICAgICBpbnQgbW9kZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhBZGFwdGVyLkVYVFJBX1NDQU5fTU9ERSwgLTEpOworICAgICAgICAgICAgICAgIGFzc2VydE5vdFNhbWUoLTEsIG1vZGUpOworICAgICAgICAgICAgICAgIHN3aXRjaCAobW9kZSkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU0NBTl9NT0RFX05PTkU6CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRGaXJlZEZsYWcoU0NBTl9NT0RFX05PTkVfRkxBRyk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNDQU5fTU9ERV9DT05ORUNUQUJMRToKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEZpcmVkRmxhZyhTQ0FOX01PREVfQ09OTkVDVEFCTEVfRkxBRyk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNDQU5fTU9ERV9DT05ORUNUQUJMRV9ESVNDT1ZFUkFCTEU6CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRGaXJlZEZsYWcoU0NBTl9NT0RFX0NPTk5FQ1RBQkxFX0RJU0NPVkVSQUJMRV9GTEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBpbnQgZ2V0RmlyZWRGbGFncygpIHsKLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewotICAgICAgICAgICAgICAgIHJldHVybiBtRmlyZWRGbGFnczsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBpbnQgZ2V0QTJkcEZpcmVkRmxhZ3MoKSB7Ci0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbUEyZHBGaXJlZEZsYWdzOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGludCBnZXRIZWFkc2V0RmlyZWRGbGFncygpIHsKLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewotICAgICAgICAgICAgICAgIHJldHVybiBtSGVhZHNldEZpcmVkRmxhZ3M7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCByZXNldEZpcmVkRmxhZ3MoKSB7Ci0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgICAgICBtRmlyZWRGbGFncyA9IDA7Ci0gICAgICAgICAgICAgICAgbUEyZHBGaXJlZEZsYWdzID0gMDsKLSAgICAgICAgICAgICAgICBtSGVhZHNldEZpcmVkRmxhZ3MgPSAwOworICAgICAgICAgICAgfSBlbHNlIGlmIChCbHVldG9vdGhBZGFwdGVyLkFDVElPTl9TVEFURV9DSEFOR0VELmVxdWFscyhpbnRlbnQuZ2V0QWN0aW9uKCkpKSB7CisgICAgICAgICAgICAgICAgaW50IHN0YXRlID0gaW50ZW50LmdldEludEV4dHJhKEJsdWV0b290aEFkYXB0ZXIuRVhUUkFfU1RBVEUsIC0xKTsKKyAgICAgICAgICAgICAgICBhc3NlcnROb3RTYW1lKC0xLCBzdGF0ZSk7CisgICAgICAgICAgICAgICAgc3dpdGNoIChzdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfT0ZGOgorICAgICAgICAgICAgICAgICAgICAgICAgc2V0RmlyZWRGbGFnKFNUQVRFX09GRl9GTEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfVFVSTklOR19PTjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEZpcmVkRmxhZyhTVEFURV9UVVJOSU5HX09OX0ZMQUcpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9PTjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEZpcmVkRmxhZyhTVEFURV9PTl9GTEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfVFVSTklOR19PRkY6CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRGaXJlZEZsYWcoU1RBVEVfVFVSTklOR19PRkZfRkxBRyk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIEJsdWV0b290aFJlY2VpdmVyIG1CbHVldG9vdGhSZWNlaXZlciA9IG5ldyBCbHVldG9vdGhSZWNlaXZlcigpOwotCi0gICAgcHJpdmF0ZSBjbGFzcyBQYWlyUmVjZWl2ZXIgZXh0ZW5kcyBCcm9hZGNhc3RSZWNlaXZlciB7Ci0gICAgICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBQQUlSX0ZMQUcgPSAxOwotICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUEFJUl9TVEFURV9CT05ERUQgPSAxOwotICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUEFJUl9TVEFURV9CT05ESU5HID0gMSA8PCAxOwotICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUEFJUl9TVEFURV9OT05FID0gMSA8PCAyOwotCi0gICAgICAgIHByaXZhdGUgaW50I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AgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgICAgICBpZiAoQmx1ZXRvb3RoRGV2aWNlLkFDVElPTl9QQUlSSU5HX1JFUVVFU1QuZXF1YWxzKGludGVudC5nZXRBY3Rpb24oKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICYmIG1EZXZpY2UuZXF1YWxzKGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5FWFRSQV9ERVZJQ0UpKSkgewotICAgICAgICAgICAgICAgICAgICBpbnQgdHlwZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhEZXZpY2UuRVhUUkFfUEFJUklOR19WQVJJQU5ULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5FUlJPUik7Ci0gICAgICAgICAgICAgICAgICAgIGFzc2VydE5vdFNhbWUodHlwZSwgQmx1ZXRvb3RoRGV2aWNlLkVSUk9SKTsKLSAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0eXBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5QQUlSSU5HX1ZBUklBTlRfUElOOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1EZXZpY2Uuc2V0UGluKG1QaW4pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuUEFJUklOR19WQVJJQU5UX1BBU1NLRVk6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbURldmljZS5zZXRQYXNza2V5KG1QYXNza2V5KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLlBBSVJJTkdfVkFSSUFOVF9QQVNTS0VZX0NPTkZJUk1BVElPTjoKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLlBBSVJJTkdfVkFSSUFOVF9DT05TRU5UOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1EZXZpY2Uuc2V0UGFpcmluZ0NvbmZpcm1hdGlvbih0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLlBBSVJJTkdfVkFSSUFOVF9PT0JfQ09OU0VOVDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGV2aWNlLnNldFJlbW90ZU91dE9mQmFuZERhdGEoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoQmx1ZXRvb3RoRGV2aWNlLkFDVElPTl9CT05EX1NUQVRFX0NIQU5HRUQuZXF1YWxzKGludGVudC5nZXRBY3Rpb24oKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICYmIG1EZXZpY2UuZXF1YWxzKGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5FWFRSQV9ERVZJQ0UpKSkgewotICAgICAgICAgICAgICAgICAgICBtRmlyZWRGbGFncyB8PSBQQUlSX0ZMQUc7Ci0gICAgICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhEZXZpY2UuRVhUUkFfQk9ORF9TVEFURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhEZXZpY2UuRVJST1IpOwotICAgICAgICAgICAgICAgICAgICBhc3NlcnROb3RTYW1lKHN0YXRlLCBCbHVldG9vdGhEZXZpY2UuRVJST1IpOwotICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX0JPTkRFRDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGFpckZpcmVkRmxhZ3MgfD0gUEFJUl9TVEFURV9CT05ERUQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkc6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBhaXJGaXJlZEZsYWdzIHw9IFBBSVJfU1RBVEVfQk9ORElORzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLkJPTkRfTk9ORToKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGFpckZpcmVkRmxhZ3MgfD0gUEFJUl9TVEFURV9OT05FOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIW1EZXZpY2UuZXF1YWxzKGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoQmx1ZXRvb3RoRGV2aWNlLkVYVFJBX0RFVklDRSkpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoQmx1ZXRvb3RoRGV2aWNlLkFDVElPTl9QQUlSSU5HX1JFUVVFU1QuZXF1YWxzKGludGVudC5nZXRBY3Rpb24oKSkpIHsKKyAgICAgICAgICAgICAgICBpbnQgdmFyaWVudCA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhEZXZpY2UuRVhUUkFfUEFJUklOR19WQVJJQU5ULCAtMSk7CisgICAgICAgICAgICAgICAgYXNzZXJ0Tm90U2FtZSgtMSwgdmFyaWVudCk7CisgICAgICAgICAgICAgICAgc3dpdGNoKHZhcmllbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuUEFJUklOR19WQVJJQU5UX1BJTjoKKyAgICAgICAgICAgICAgICAgICAgICAgIG1EZXZpY2Uuc2V0UGluKG1QaW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLlBBSVJJTkdfVkFSSUFOVF9QQVNTS0VZOgorICAgICAgICAgICAgICAgICAgICAgICAgbURldmljZS5zZXRQYXNza2V5KG1QYXNza2V5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5QQUlSSU5HX1ZBUklBTlRfUEFTU0tFWV9DT05GSVJNQVRJT046CisgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLlBBSVJJTkdfVkFSSUFOVF9DT05TRU5UOgorICAgICAgICAgICAgICAgICAgICAgICAgbURldmljZS5zZXRQYWlyaW5nQ29uZmlybWF0aW9uKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLlBBSVJJTkdfVkFSSUFOVF9PT0JfQ09OU0VOVDoKKyAgICAgICAgICAgICAgICAgICAgICAgIG1EZXZpY2Uuc2V0UmVtb3RlT3V0T2ZCYW5kRGF0YSgpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGludCBnZXRGaXJlZEZsYWdzKCkgewotICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1GaXJlZEZsYWdzOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGludCBnZXRQYWlyRmlyZWRGbGFncygpIHsKLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewotICAgICAgICAgICAgICAgIHJldHVybiBtUGFpckZpcmVkRmxhZ3M7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCByZXNldEZpcmVkRmxhZ3MoKSB7Ci0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgICAgICBtRmlyZWRGbGFncyA9IDA7Ci0gICAgICAgICAgICAgICAgbVBhaXJGaXJlZEZsYWdzID0gMDsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoQmx1ZXRvb3RoRGV2aWNlLkFDVElPTl9CT05EX1NUQVRFX0NIQU5HRUQuZXF1YWxzKGludGVudC5nZXRBY3Rpb24oKSkpIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoRGV2aWNlLkVYVFJBX0JPTkRfU1RBVEUsIC0xKTsKKyAgICAgICAgICAgICAgICBhc3NlcnROb3RTYW1lKC0xLCBzdGF0ZSk7CisgICAgICAgICAgICAgICAgc3dpdGNoIChzdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX05PTkU6CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRGaXJlZEZsYWcoU1RBVEVfTk9ORV9GTEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkc6CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRGaXJlZEZsYWcoU1RBVEVfQk9ORElOR19GTEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX0JPTkRFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEZpcmVkRmxhZyhTVEFURV9CT05ERURfRkxBRyk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwcml2YXRlIGNsYXNzIENvbm5lY3RQcm9maWxlUmVjZWl2ZXIgZXh0ZW5kcyBGbGFnUmVjZWl2ZXIgeworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgU1RBVEVfRElTQ09OTkVDVEVEX0ZMQUcgPSAxOworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgU1RBVEVfQ09OTkVDVElOR19GTEFHID0gMSA8PCAxOworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgU1RBVEVfQ09OTkVDVEVEX0ZMQUcgPSAxIDw8IDI7CisgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTVEFURV9ESVNDT05ORUNUSU5HX0ZMQUcgPSAxIDw8IDM7CisKKyAgICAgICAgcHJpdmF0ZSBCbHVldG9vdGhEZXZpY2UgbURldmljZTsKKyAgICAgICAgcHJpdmF0ZSBpbnQgbVByb2ZpbGU7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1Db25uZWN0aW9uQWN0aW9uOworCisgICAgICAgIHB1YmxpYyBDb25uZWN0UHJvZmlsZVJlY2VpdmVyKEJsdWV0b290aERldmljZSBkZXZpY2UsIGludCBwcm9maWxlLCBpbnQgZXhwZWN0ZWRGbGFncykgeworICAgICAgICAgICAgc3VwZXIoZXhwZWN0ZWRGbGFncyk7CisKKyAgICAgICAgICAgIG1EZXZpY2UgPSBkZXZpY2U7CisgICAgICAgICAgICBtUHJvZmlsZSA9IHByb2ZpbGU7CisKKyAgICAgICAgICAgIHN3aXRjaChtUHJvZmlsZSkgeworICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoUHJvZmlsZS5BMkRQOgorICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGlvbkFjdGlvbiA9IEJsdWV0b290aEEyZHAuQUNUSU9OX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLkhFQURTRVQ6CisgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0aW9uQWN0aW9uID0gQmx1ZXRvb3RoSGVhZHNldC5BQ1RJT05fQ09OTkVDVElPTl9TVEFURV9DSEFOR0VEOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGlvbkFjdGlvbiA9IG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworCisgICAgICAgICAgICBpZiAobUNvbm5lY3Rpb25BY3Rpb24gIT0gbnVsbCAmJiBtQ29ubmVjdGlvbkFjdGlvbi5lcXVhbHMoaW50ZW50LmdldEFjdGlvbigpKSkgeworICAgICAgICAgICAgICAgIGlmICghbURldmljZS5lcXVhbHMoaW50ZW50LmdldFBhcmNlbGFibGVFeHRyYShCbHVldG9vdGhEZXZpY2UuRVhUUkFfREVWSUNFKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhQcm9maWxlLkVYVFJBX1NUQVRFLCAtMSk7CisgICAgICAgICAgICAgICAgYXNzZXJ0Tm90U2FtZSgtMSwgc3RhdGUpOworICAgICAgICAgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0RJU0NPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEZpcmVkRmxhZyhTVEFURV9ESVNDT05ORUNURURfRkxBRyk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RJTkc6CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRGaXJlZEZsYWcoU1RBVEVfQ09OTkVDVElOR19GTEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aFByb2ZpbGUuU1RBVEVfQ09OTkVDVEVEOgorICAgICAgICAgICAgICAgICAgICAgICAgc2V0RmlyZWRGbGFnKFNUQVRFX0NPTk5FQ1RFRF9GTEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aFByb2ZpbGUuU1RBVEVfRElTQ09OTkVDVElORzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEZpcmVkRmxhZyhTVEFURV9ESVNDT05ORUNUSU5HX0ZMQUcpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBCbHVldG9vdGhQcm9maWxlLlNlcnZpY2VMaXN0ZW5lciBtU2VydmljZUxpc3RlbmVyID0KKyAgICAgICAgICAgIG5ldyBCbHVldG9vdGhQcm9maWxlLlNlcnZpY2VMaXN0ZW5lcigpIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlQ29ubmVjdGVkKGludCBwcm9maWxlLCBCbHVldG9vdGhQcm9maWxlIHByb3h5KSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHByb2ZpbGUpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLkEyRFA6CisgICAgICAgICAgICAgICAgICAgICAgICBtQTJkcCA9IChCbHVldG9vdGhBMmRwKSBwcm94eTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aFByb2ZpbGUuSEVBRFNFVDoKKyAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkc2V0ID0gKEJsdWV0b290aEhlYWRzZXQpIHByb3h5OworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlRGlzY29ubmVjdGVkKGludCBwcm9maWxlKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHByb2ZpbGUpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLkEyRFA6CisgICAgICAgICAgICAgICAgICAgICAgICBtQTJkcCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLkhFQURTRVQ6CisgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZHNldCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCiAgICAgc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AgICAgIGludCBtYXNrID0gKEJsdWV0b290aFJlY2VpdmVyLlNUQVRFX1RVUk5JTkdfT05fRkxBRyB8IEJsdWV0b290aFJlY2VpdmVyLlNUQVRFX09OX0ZMQUcKICAgICAgICAgICAgICAgICB8IEJsdWV0b290aFJlY2VpdmVyLlNDQU5fTU9ERV9DT05ORUNUQUJMRV9GTEFHKTsKLSAgICAgICAgbUJsdWV0b290aFJlY2VpdmVyLnJlc2V0RmlyZWRGbGFncygpOworICAgICAgICBsb25nIHN0YXJ0ID0gLTE7CisgICAgICAgIEJsdWV0b290aFJlY2VpdmVyIHJlY2VpdmVyID0gZ2V0Qmx1ZXRvb3RoUmVjZWl2ZXIobWFzayk7CiAKICAgICAgICAgaW50IHN0YXRlID0gYWRhcHRlci5nZXRTdGF0ZSgpOwogICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7CiAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfT046CiAgICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShhZGFwdGVyLmlzRW5hYmxlZCgpKTsKKyAgICAgICAgICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX09GRjoKLSAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9UVVJOSU5HX09GRjoKLSAgICAgICAgICAgICAgICBhc3NlcnRGYWxzZShhZGFwdGVyLmlzRW5hYmxlZCgpKTsKLSAgICAgICAgICAgICAgICBhc3NlcnRUcnVlKGFkYXB0ZXIuZW5hYmxlKCkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX1RVUk5JTkdfT046CiAgICAgICAgICAgICAgICAgYXNzZXJ0RmFsc2UoYWRhcHRlci5pc0VuYWJ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KTsKLSAgICAgICAgICAgICAgICBpZiAoKG1CbHVldG9vdGhSZWNlaXZlci5nZXRGaXJlZEZsYWdzKCkgJiBtYXNrKSA9PSBtYXNrKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhSZWNlaXZlci5yZXNldEZpcmVkRmxhZ3MoKTsKLSAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgiZW5hYmxlKCkgY29tcGxldGVkIGluICVkIG1zIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzKSkpOworICAgICAgICAgICAgICAgIGlmICgocmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpICYgbWFzaykgPT0gbWFzaykgeworICAgICAgICAgICAgICAgICAgICBsb25nIGZpbmlzaCA9IHJlY2VpdmVyLmdldENvbXBsZXRlZFRpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXJ0ICE9IC0xICYmIGZpbmlzaCAhPSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgiZW5hYmxlKCkgY29tcGxldGVkIGluICVkIG1zIiwgKGZpbmlzaCAtIHN0YXJ0KSkpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoImVuYWJsZSgpIGNvbXBsZXRlZCIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJlbW92ZVJlY2VpdmVyKHJlY2VpdmVyKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC00MzYsOCArNDE2LDggQEAKICAgICAgICAgICAgIHNsZWVwKFBPTExfVElNRSk7CiAgICAgICAgIH0KIAotICAgICAgICBpbnQg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hBZGFwdGVyLlNUQVRFX09GRjoKICAgICAgICAgICAgICAgICBhc3NlcnRGYWxzZShhZGFwdGVyLmlzRW5hYmxlZCgpKTsKKyAgICAgICAgICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX09OOgotICAgICAgICAgICAgICAgIGFzc2VydFRydWUoYWRhcHRlci5pc0VuYWJsZWQoKSk7Ci0gICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShhZGFwdGVyLmRpc2FibGUoKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfVFVSTklOR19PTjoKICAgICAgICAgICAgICAgICBhc3NlcnRGYWxzZShhZGFwdGVyLmlzRW5hYmxlZCgpKTsKKyAgICAgICAgICAgICAgICBzdGFydCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOworICAgICAgICAgICAgICAgIGFzc2VydFRydWUoYWRhcHRlci5kaXNhYmxlKCkpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX09OOgorICAgICAgICAgICAgICAgIGFzc2VydFRydWUoYWRhcHRlci5pc0VuYWJsZWQoKSk7CisgICAgICAgICAgICAgICAgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKICAgICAgICAgICAgICAgICBhc3NlcnRUcnVlKGFkYXB0ZXIuZGlzYWJsZSgpKTsKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9UVVJOSU5HX09GRjoKQEAgLTQ2NSw3ICs0NDksOCBAQAogICAgICAgICAgICAgICAgIG1hc2sgPSAwOyAvLyBEb24ndCBjaGVj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hZ3MoKSAmIG1hc2spID09IG1hc2spIHsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyBmaW5pc2ggPSByZWNlaXZlci5nZXRDb21wbGV0ZWRUaW1lKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChzdGFydCAhPSAtMSAmJiBmaW5pc2ggIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlT3V0cHV0KFN0cmluZy5mb3JtYXQoImRpc2FibGUoKSBjb21wbGV0ZWQgaW4gJWQgbXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmluaXNoIC0gc3RhcnQpKSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZU91dHB1dCgiZGlzYWJsZSgpIGNvbXBsZXRlZCIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJlbW92ZVJlY2VpdmVyKHJlY2VpdmVyKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC00ODYsMTUgKzQ3NiwxNCBAQAogICAgICAgICAgICAgc2xlZXAoUE9MTF9USU1FKTsKICAgICAgICAgfQogCi0gICAgICAgIGludCBmaXJlZEZsYWdzID0gbUJsdWV0b290aFJlY2VpdmVyLmdldEZpcmVkRmxhZ3MoKTsKLSAgICAgICAgbUJsdWV0b290aFJlY2VpdmVyLnJlc2V0RmlyZWRGbGFncygpOworICAgICAgICBpbnQgZmlyZWRGbGFncyA9IHJlY2VpdmVyLmdldEZpcmVkRmxhZ3MoKTsKKyAgICAgICAgcmVtb3ZlUmVjZWl2ZXIocmVjZWl2ZXIpOwogICAgICAgICBmYWlsKFN0cmluZy5mb3JtYXQoImRpc2FibGUoKSB0aW1lb3V0OiBzdGF0ZT0lZCAoZXhwZWN0ZWQgJWQpLCBmbGFncz0weCV4IChleHBlY3RlZC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W50VGltZU1pbGxpcygpOwotICAgICAgICB3aGlsZSAoU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzIDwgU0VUX1NDQU5fTU9ERV9USU1FT1VUKSB7CisgICAgICAgIHdoaWxlIChTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHN0YXJ0IDwgU0VUX1NDQU5fTU9ERV9USU1FT1VUKSB7CiAgICAgICAgICAgICBzY2FuTW9kZSA9IGFkYXB0ZXIuZ2V0U2Nhbk1vZGUoKTsKICAgICAgICAgICAgIGlmIChzY2FuTW9kZSA9PSBCbHVldG9vdGhBZGFwdGVyLlNDQU5fTU9ERV9DT05ORUNUQUJMRV9ESVNDT1ZFUkFCTEUpIHsKLSAgICAgICAgICAgICAgICBpZiAoKG1CbHVldG9vdGhSZWNlaXZlci5nZXRGaXJlZEZsYWdzKCkgJiBtYXNrKSA9PSBtYXNrKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhSZWNlaXZlci5yZXNldEZpcmVkRmxhZ3MoKTsKKyAgICAgICAgICAgICAgICBpZiAoKHJlY2VpdmVyLmdldEZpcmVkRmxhZ3MoKSAmIG1hc2spID09IG1hc2spIHsKICAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgiZGlzY292ZXJhYmxlKCkgY29tcGxldGVkIGluICVkIG1zIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzKSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyZWNlaXZlci5nZXRDb21wbGV0ZWRUaW1lKCkgLSBzdGFydCkpKTsKKyAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUmVjZWl2ZXIocmVjZWl2ZXIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgIC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3RoQWRhcHRlci5TQ0FOX01PREVfQ09OTkVDVEFCTEUpIHsKLSAgICAgICAgICAgICAgICBpZiAoKG1CbHVldG9vdGhSZWNlaXZlci5nZXRGaXJlZEZsYWdzKCkgJiBtYXNrKSA9PSBtYXNrKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhSZWNlaXZlci5yZXNldEZpcmVkRmxhZ3MoKTsKKyAgICAgICAgICAgICAgICBpZiAoKHJlY2VpdmVyLmdldEZpcmVkRmxhZ3MoKSAmIG1hc2spID09IG1hc2spIHsKICAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgidW5kaXNjb3ZlcmFibGUoKSBjb21wbGV0ZWQgaW4gJWQgbXMiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHMpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHJlY2VpdmVyLmdldENvbXBsZXRlZFRpbWUoKSAtIHN0YXJ0KSkpOworICAgICAgICAgICAgICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscyhzY2FuTW9kZSwgQmx1ZXRvb3RoQWRhcHRlci5TQ0FOX01PREVfQ09OTkVDVEFCTEVfRElTQ09WRVJBQkxFKTsKKyAgICAgICAgICAgICAgICBhc3NlcnRFcXVhbHMoQmx1ZXRvb3RoQWRhcHRlci5TQ0FOX01PREVfQ09OTkVDVEFCTEVfRElTQ09WRVJBQkxFLCBzY2FuTW9kZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBzbGVlcChQT0xMX1RJTUUpOwogICAgICAgICB9CiAKLSAgICAgICAgaW50IGZpcmVkRmxhZ3MgPSBtQmx1ZXRvb3R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k9OREVEX0ZMQUc7CisgICAgICAgIGxvbmcgc3RhcnQgPSAtMTsKIAogICAgICAgICBpZiAoIWFkYXB0ZXIuaXNFbmFibGVkKCkpIHsKICAgICAgICAgICAgIGZhaWwoInBhaXIoKSBibHVldG9vdGggbm90IGVuYWJsZWQiKTsKICAgICAgICAgfQogCisgICAgICAgIFBhaXJSZWNlaXZlciByZWNlaXZlciA9IGdldFBhaXJSZWNlaXZlcihkZXZpY2UsIHBhc3NrZXksIHBpbiwgbWFzayk7CisKICAgICAgICAgaW50IHN0YXRlID0gZGV2aWNlLmdldEJvbmRTdGF0ZSgpOwogICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7CisgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX05PTkU6CisgICAgICAgICAgICAgICAgYXNzZXJ0RmFsc2UoYWRhcHRlci5nZXRCb25kZWREZXZpY2VzKCkuY29udGFpbnMoZGV2aWNlKSk7CisgICAgICAgICAgICAgICAgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICBhc3NlcnRUcnVlKGRldmljZS5jcmVhdGVCb25kKCkpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ESU5HOgorICAgICAgICAgICAgICAgIG1hc2sgPSAwOyAvLyBEb24ndCBjaGVjayBmb3IgcmVjZWl2ZWQgaW50ZW50cyBzaW5jZSB3ZSBtaWdodCBoYXZlIG1pc3NlZCB0aGVtLgorICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ERUQ6CiAgICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShhZGFwdGVyLmdldEJvbmRlZERldmljZXMoKS5jb250YWlucyhkZXZpY2UpKTsKICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkc6Ci0gICAgICAgICAgICAgICAgLy8gRG9uJ3QgY2hlY2sgZm9yIHJlY2VpdmVkIGludGVudHMgc2luY2Ugd2UgbWlnaHQgaGF2ZSBtaXNzZWQgdGhlbS4KLSAgICAgICAgICAgICAgICBtYXNrID0gcGFpck1hc2sgPSAwOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9OT05FOgotICAgICAgICAgICAgICAgIGFzc2VydEZhbHNlKGFkYXB0ZXIuZ2V0Qm9uZGVkRGV2aWNlcygpLmNvbnRhaW5zKGRldmljZSkpOwotICAgICAgICAgICAgICAgIGFzc2VydFRydWUoZGV2aWNlLmNyZWF0ZUJvbmQoKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGZhaWwoInBhaXIoKSBpbnZhbGlkZSBzdGF0ZTogc3RhdGU9IiArIHN0YXRlKTsKKyAgICAgICAgICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CisgICAgICAgICAgICAgICAgZmFpbChTdHJpbmcuZm9ybWF0KCJwYWlyKCkgaW52YWxpZCBzdGF0ZTogZGV2aWNlPSVzLCBzdGF0ZT0lZCIsIGRldmljZSwgc3RhdGUpKTsKICAgICAgICAgfQogCiAgICAgICAgIGxvbmcgcyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwpAQCAtNjY3LDMyNyArNjYxLDIxOSBAQAogICAgICAgICAgICAgc3RhdGUgPSBkZXZpY2UuZ2V0Qm9uZFN0YXRlKCk7CiAgICAgICAgICAgICBpZiAoc3RhdGUgPT0gQmx1ZXRvb3RoRGV2aWNlLkJPTkRfQk9OREVEKSB7CiAgICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShhZGFwdGVyLmdldEJvbmRlZERldmljZXMoKS5jb250YWlucyhkZXZpY2UpKTsKLSAgICAgICAgICAgICAgICBpZiAoKHBhaXJSZWNlaXZlci5nZXRGaXJlZEZsYWdzKCkgJiBtYXNrKSA9PSBtYXNrCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiAocGFpclJlY2VpdmVyLmdldFBhaXJGaXJlZEZsYWdzKCkgJiBwYWlyTWFzaykgPT0gcGFpck1hc2spIHsKLSAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgicGFpcigpIGNvbXBsZXRlZCBpbiAlZCBtczogZGV2aWNlPSVzIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzKSwgZGV2aWNlKSk7Ci0gICAgICAgICAgICAgICAgICAgIG1SZWNlaXZlcnMucmVtb3ZlKHBhaXJSZWNlaXZlcik7Ci0gICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LnVucmVnaXN0ZXJSZWNlaXZlcihwYWlyUmVjZWl2ZXIpOworICAgICAgICAgICAgICAgIGlmICgocmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpICYgbWFzaykgPT0gbWFzaykgeworICAgICAgICAgICAgICAgICAgICBsb25nIGZpbmlzaCA9IHJlY2VpdmVyLmdldENvbXBsZXRlZFRpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXJ0ICE9IC0xICYmIGZpbmlzaCAhPSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgicGFpcigpIGNvbXBsZXRlZCBpbiAlZCBtczogZGV2aWNlPSVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZpbmlzaCAtIHN0YXJ0KSwgZGV2aWNlKSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZU91dHB1dChTdHJpbmcuZm9ybWF0KCJwYWlyKCkgY29tcGxldGVkOiBkZXZpY2U9JXMiLCBkZXZpY2UpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBzbGVlcChQT0xMX1RJTUUpOwogICAgICAgICB9CiAKLSAgICAgICAgaW50IGZpcmVkRmxhZ3MgPSBwYWlyUmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpOwotICAgICAgICBpbnQgcGFpckZpcmVkRmxhZ3MgPSBwYWlyUmVjZWl2ZXIuZ2V0UGFpckZpcmVkRmxhZ3MoKTsKLSAgICAgICAgcGFpclJlY2VpdmVyLnJlc2V0RmlyZWRGbGFncygpOwotICAgICAgICBmYWlsKFN0cmluZy5mb3JtYXQoInBhaXIoKSB0aW1lb3V0OiBzdGF0ZT0lZCAoZXhwZWN0ZWQgJWQpLCBmbGFncz0weCV4IChleHBlY3RlZCAweCV4KSwgIgotICAgICAgICAgICAgICAgICsgInBhaXJGbGFncz0weCV4IChleHBlY3RlZCAweCV4KSIsIHN0YXRlLCBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ERUQsIGZpcmVkRmxhZ3MsCi0gICAgICAgICAgICAgICAgbWFzaywgcGFpckZpcmVkRmxhZ3MsIHBhaXJNYXNrKSk7CisgICAgICAgIGludCBmaXJlZEZsYWdzID0gcmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpOworICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CisgICAgICAgIGZhaWwoU3RyaW5nLmZvcm1hdCgicGFpcigpIHRpbWVvdXQ6IGRldmljZT0lcywgc3RhdGU9JWQgKGV4cGVjdGVkICVkKSwgIgorICAgICAgICAgICAgICAgICsgImZsYWdzPTB4JXggKGV4cGVjdGVkIDB4JXgpIiw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gICAgICAgICAgICAgIGFzc2VydFRydWUoZGV2aWNlLnJlbW92ZUJvbmQoKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkc6Ci0gICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShkZXZpY2UucmVtb3ZlQm9uZCgpKTsKLSAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLkJPTkRfTk9ORToKICAgICAgICAgICAgICAgICBhc3NlcnRGYWxzZShhZGFwdGVyLmdldEJvbmRlZERldmljZXMoKS5jb250YWlucyhkZXZpY2UpKTsKKyAgICAgICAgICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CiAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ESU5HOgorICAgICAgICAgICAgICAgIHN0YXJ0ID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7CisgICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShkZXZpY2UucmVtb3ZlQm9uZCgpKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLkJPTkRfQk9OREVEOgorICAgICAgICAgICAgICAgIGFzc2VydFRydWUoYWRhcHRlci5nZXRCb25kZWREZXZpY2VzKCkuY29udGFpbnMoZGV2aWNlKSk7CisgICAgICAgICAgICAgICAgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICBhc3NlcnRUcnVlKGRldmljZS5yZW1vdmVCb25kKCkpOworICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBmYWlsKCJ1bnBhaXIoKSBpbnZhbGlkI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SZWNlaXZlcik7Ci0gICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LnVucmVnaXN0ZXJSZWNlaXZlcihwYWlyUmVjZWl2ZXIpOworICAgICAgICAgICAgICAgIGlmICgocmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpICYgbWFzaykgPT0gbWFzaykgeworICAgICAgICAgICAgICAgICAgICBsb25nIGZpbmlzaCA9IHJlY2VpdmVyLmdldENvbXBsZXRlZFRpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXJ0ICE9IC0xICYmIGZpbmlzaCAhPSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgidW5wYWlyKCkgY29tcGxldGVkIGluICVkIG1zOiBkZXZpY2U9JXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmluaXNoIC0gc3RhcnQpLCBkZXZpY2UpKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlT3V0cHV0KFN0cmluZy5mb3JtYXQoInVucGFpcigpIGNvbXBsZXRlZDogZGV2aWNlPSVzIiwgZGV2aWNlKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUmVjZWl2ZXIocmVjZWl2ZXIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgaW50IGZpcmVkRmxhZ3MgPSBwYWlyUmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpOwotICAgICAgICBpbnQgcGFpckZpcmVkRmxhZ3MgPSBwYWlyUmVjZWl2ZXIuZ2V0UGFpckZpcmVkRmxhZ3MoKTsKLSAgICAgICAgcGFpclJlY2VpdmVyLnJlc2V0RmlyZWRGbGFncygpOwotICAgICAgICBmYWlsKFN0cmluZy5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gZGV2aWNlKTsKKyAgICAgICAgICAgIGZhaWwoU3RyaW5nLmZvcm1hdCgiY29ubmVjdFByb2ZpbGUoKSBkZXZpY2Ugbm90IHBhaXJlZDogZGV2aWNlPSVzLCBwcm9maWxlPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgZGV2aWNlLCBwcm9maWxlKSk7CiAgICAgICAgIH0KIAotICAgICAgICBpbnQgc3RhdGUgPSBtQTJkcC5nZXRTaW5rU3RhdGUoZGV2aWNlKTsKKyAgICAgICAgQmx1ZXRvb3RoUHJvZmlsZSBwcm94eSA9IGNvbm5lY3RQcm94eShhZGFwdGVyLCBwcm9maWxlKTsKKyAgICAgICAgaWYgKHByb3h5ID09IG51bGwpIHsKKyAgICAgICAgICAgIGZhaWwoU3RyaW5nLmZvcm1hdCgiY29ubmVjdFByb2ZpbGUoKSB1bmtub3duIHByb2ZpbGU6IGRldmljZT0lcywgcHJvZmlsZT0lZCIsCisgICAgICAgICAgICAgICAgICAgIGRldmljZSwgcHJvZmlsZSkpOworICAgICAgICB9CisKKyAgICAgICAgQ29ubmVjdFByb2ZpbGVSZWNlaXZlciByZWNlaXZlciA9IGdldENvbm5lY3RQcm9maWxlUmVjZWl2ZXIoZGV2aWNlLCBwcm9maWxlLCBtYXNrKTsKKworICAgICAgICBpbnQgc3RhdGUgPSBwcm94eS5nZXRDb25uZWN0aW9uU3RhdGUoZGV2aWNlKTsKICAgICAgICAgc3dpdGNoIChzdGF0ZSkgewotICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRDoKLSAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9QTEFZSU5HOgotICAgICAgICAgICAgICAgIGFzc2VydFRydWUobUEyZHAuaXNTaW5rQ29ubmVjdGVkKGRldmljZSkpOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBMmRwLlNUQVRFX0RJU0NPTk5FQ1RJTkc6Ci0gICAgICAgICAgICBjYXNlIEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEOgotICAgICAgICAgICAgICAgIGFzc2VydEZhbHNlKG1BMmRwLmlzU2lua0Nvbm5lY3RlZChkZXZpY2UpKTsKLSAgICAgICAgICAgICAgICBhc3NlcnRUcnVlKG1BMmRwLmNvbm5lY3RTaW5rKGRldmljZSkpOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RJTkc6CisgICAgICAgICAgICAgICAgbWFzayA9IDA7IC8vIERvbid0IGNoZWNrIGZvciByZWNlaXZlZCBpbnRlbnRzIHNpbmNlIHdlIG1pZ2h0IGhhdmUgbWlzc2VkIHRoZW0uCiAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVElORzoKLSAgICAgICAgICAgICAgICBhc3NlcnRGYWxzZShtQTJkcC5pc1NpbmtDb25uZWN0ZWQoZGV2aWNlKSk7Ci0gICAgICAgICAgICAgICAgLy8gRG9uJ3QgY2hlY2sgZm9yIHJlY2VpdmVkIGludGVudHMgc2luY2Ugd2UgbWlnaHQgaGF2ZSBtaXNzZWQgdGhlbS4KLSAgICAgICAgICAgICAgICBtYXNrID0gYTJkcE1hc2sxID0gYTJkcE1hc2syID0gYTJkcE1hc2szID0gMDsKKyAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9ESVNDT05ORUNURUQ6CisgICAgICAgICAgICBjYXNlIEJsdWV0b290aFByb2ZpbGUuU1RBVEVfRElTQ09OTkVDVElORzoKKyAgICAgICAgICAgICAgICBzdGFydCA9IFN5c3R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gICAgICAvLyBoYXZlIGZpcmVkIGlmIHdlIGFyZSBjaGVja2luZyBpZiBpbnRlbnRzIHNob3VsZCBiZSBmaXJlZC4KLSAgICAgICAgICAgICAgICBpbnQgZmlyZWRGbGFncyA9IG1CbHVldG9vdGhSZWNlaXZlci5nZXRGaXJlZEZsYWdzKCk7Ci0gICAgICAgICAgICAgICAgaW50IGEyZHBGaXJlZEZsYWdzID0gbUJsdWV0b290aFJlY2VpdmVyLmdldEEyZHBGaXJlZEZsYWdzKCk7Ci0gICAgICAgICAgICAgICAgaWYgKChtQmx1ZXRvb3RoUmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpICYgbWFzaykgPT0gbWFzawotICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChhMmRwRmlyZWRGbGFncyAmIGEyZHBNYXNrMSkgPT0gYTJkcE1hc2sxCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChhMmRwRmlyZWRGbGFncyAmIGEyZHBNYXNrMikgPT0gYTJkcE1hc2syCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChhMmRwRmlyZWRGbGFncyAmIGEyZHBNYXNrMykgPT0gYTJkcE1hc2szKSkgewotICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoUmVjZWl2ZXIucmVzZXRGaXJlZEZsYWdzKCk7Ci0gICAgICAgICAgICAgICAgICAgIHdyaXRlT3V0cHV0KFN0cmluZy5mb3JtYXQoImNvbm5lY3RBMmRwKCkgY29tcGxldGVkIGluICVkIG1zOiBkZXZpY2U9JXMiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHMpLCBkZXZpY2UpKTsKKyAgICAgICAgd2hpbGUgKFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gcyA8IENPTk5FQ1RfUFJPRklMRV9USU1FT1VUKSB7CisgICAgICAgICAgICBzdGF0ZSA9IHByb3h5LmdldENvbm5lY3Rpb25TdGF0ZShkZXZpY2UpOworICAgICAgICAgICAgaWYgKHN0YXRlID09IEJsdWV0b290aFByb2ZpbGUuU1RBVEVfQ09OTkVDVEVEKSB7CisgICAgICAgICAgICAgICAgaWYgKChyZWNlaXZlci5nZXRGaXJlZEZsYWdzKCkgJiBtYXNrKSA9PSBtYXNrKSB7CisgICAgICAgICAgICAgICAgICAgIGxvbmcgZmluaXNoID0gcmVjZWl2ZXIuZ2V0Q29tcGxldGVkVGltZSgpOworICAgICAgICAgICAgICAgICAgICBpZiAoc3RhcnQgIT0gLTEgJiYgZmluaXNoICE9IC0xKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZU91dHB1dChTdHJpbmcuZm9ybWF0KCJjb25uZWN0UHJvZmlsZSgpIGNvbXBsZXRlZCBpbiAlZCBtczogIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArImRldmljZT0lcywgcHJvZmlsZT0lZCIsIChmaW5pc2ggLSBzdGFydCksIGRldmljZSwgcHJvZmlsZSkpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgiY29ubmVjdFByb2ZpbGUoKSBjb21wbGV0ZWQ6IGRldmljZT0lcywgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJwcm9maWxlPSVkIiwgZGV2aWNlLCBwcm9maWxlKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUmVjZWl2ZXIocmVjZWl2ZXIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgc2xlZXAoUE9MTF9USU1FKTsKICAgICAgICAgfQogCi0gICAgICAgIGludCBmaXJlZEZsYWdzID0gbUJsdWV0b290aFJlY2VpdmVyLmdldEZpcmVkRmxhZ3MoKTsK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JvbmRlZERldmljZXMoKS5jb250YWlucyhkZXZpY2UpKSB7Ci0gICAgICAgICAgICBmYWlsKCJkaXNjb25uZWN0QTJkcCgpIGRldmljZSBub3QgcGFpcmVkOiBkZXZpY2U9IiArIGRldmljZSk7CisgICAgICAgICAgICBmYWlsKFN0cmluZy5mb3JtYXQoImRpc2Nvbm5lY3RQcm9maWxlKCkgZGV2aWNlIG5vdCBwYWlyZWQ6IGRldmljZT0lcywgcHJvZmlsZT0lZCIsCisgICAgICAgICAgICAgICAgICAgIGRldmljZSwgcHJvZmlsZSkpOwogICAgICAgICB9CiAKLSAgICAgICAgaW50IHN0YXRlID0gbUEyZHAuZ2V0U2lua1N0YXRlKGRldmljZSk7CisgICAgICAgIEJsdWV0b290aFByb2ZpbGUgcHJveHkgPSBjb25uZWN0UHJveHkoYWRhcHRlciwgcHJvZmlsZSk7CisgICAgICAgIGlmIChwcm94eSA9PSBudWxsKSB7CisgICAgICAgICAgICBmYWlsKFN0cmluZy5mb3JtYXQoImRpc2Nvbm5lY3RQcm9maWxlKCkgdW5rbm93biBwcm9maWxlOiBkZXZpY2U9JXMsIHByb2ZpbGU9JWQiLAorICAgICAgICAgICAgICAgICAgICBkZXZpY2UsIHByb2ZpbGUpKTsKKyAgICAgICAgfQorCisgICAgICAgIENvbm5lY3RQcm9maWxlUmVjZWl2ZXIgcmVjZWl2ZXIgPSBnZXRDb25uZWN0UHJvZmlsZVJlY2VpdmVyKGRldmljZSwgcHJvZmlsZSwgbWFzayk7CisKKyAgICAgICAgaW50IHN0YXRlID0gcHJveHkuZ2V0Q29ubmVjdGlvblN0YXRlKGRldmljZSk7CiAgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKLSAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQ6Ci0gICAgICAgICAgICAgICAgYXNzZXJ0RmFsc2UobUEyZHAuaXNTaW5rQ29ubmVjdGVkKGRldmljZSkpOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RFRDoKKyAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9DT05ORUNUSU5HOgorICAgICAgICAgICAgICAgIHN0YXJ0ID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7CisgICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShwcm94eS5kaXNjb25uZWN0KGRldmljZSkpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0RJU0NPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRDoKLSAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9QTEFZSU5HOgotICAgICAgICAgICAgICAgIGFzc2VydFRydWUobUEyZHAuaXNTaW5rQ29ubmVjdGVkKGRldmljZSkpOwotICAgICAgICAgICAgICAgIGFzc2VydFRydWUobUEyZHAuZGlzY29ubmVjdFNpbmsoZGV2aWNlKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVElORzoKLSAgICAgICAgICAgICAgICBhc3NlcnRGYWxzZShtQTJkcC5pc1NpbmtDb25uZWN0ZWQoZGV2aWNlKSk7Ci0gICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShtQTJkcC5kaXNjb25uZWN0U2luayhkZXZpY2UpKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNUSU5HOgotICAgICAgICAgICAgICAgIGFz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c3RhdGUgPT0gQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQpIHsKLSAgICAgICAgICAgICAgICBhc3NlcnRGYWxzZShtQTJkcC5pc1NpbmtDb25uZWN0ZWQoZGV2aWNlKSk7Ci0gICAgICAgICAgICAgICAgaWYgKChtQmx1ZXRvb3RoUmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpICYgbWFzaykgPT0gbWFzawotICAgICAgICAgICAgICAgICAgICAgICAgJiYgKG1CbHVldG9vdGhSZWNlaXZlci5nZXRBMmRwRmlyZWRGbGFncygpICYgYTJkcE1hc2spID09IGEyZHBNYXNrKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhSZWNlaXZlci5yZXNldEZpcmVkRmxhZ3MoKTsKLSAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgiZGlzY29ubmVjdEEyZHAoKSBjb21wbGV0ZWQgaW4gJWQgbXM6IGRldmljZT0lcyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gcyksIGRldmljZSkpOworICAgICAgICB3aGlsZSAoU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzIDwgRElTQ09OTkVDVF9QUk9GSUxFX1RJTUVPVVQpIHsKKyAgICAgICAgICAgIHN0YXRlID0gcHJveHkuZ2V0Q29ubmVjdGlvblN0YXRlKGRldmljZSk7CisgICAgICAgICAgICBpZiAoc3RhdGUgPT0gQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9ESVNDT05ORUNURUQpIHsKKyAgICAgICAgICAgICAgICBpZiAoKHJlY2VpdmVyLmdldEZpcmVkRmxhZ3MoKSAmIG1hc2spID09IG1hc2spIHsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyBmaW5pc2ggPSByZWNlaXZlci5nZXRDb21wbGV0ZWRUaW1lKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChzdGFydCAhPSAtMSAmJiBmaW5pc2ggIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlT3V0cHV0KFN0cmluZy5mb3JtYXQoImRpc2Nvbm5lY3RQcm9maWxlKCkgY29tcGxldGVkIGluICVkIG1zOiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsiZGV2aWNlPSVzLCBwcm9maWxlPSVkIiwgKGZpbmlzaCAtIHN0YXJ0KSwgZGV2aWNlLCBwcm9maWxlKSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZU91dHB1dChTdHJpbmcuZm9ybWF0KCJkaXNjb25uZWN0UHJvZmlsZSgpIGNvbXBsZXRlZDogZGV2aWNlPSVzLCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgInByb2ZpbGU9JWQiLCBkZXZpY2UsIHByb2ZpbGUpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZW1vdmVSZWNlaXZlcihyZWNlaXZlcik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBzbGVlcChQT0xMX1RJTUUpOwogICAgICAgICB9CiAKLSAgICAgICAgaW50IGZpcmVkRmxhZ3MgPSBtQmx1ZXRvb3RoUmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpOwotICAgICAgICBpbnQgYTJkcEZpcmVkRmxhZ3MgPSBtQmx1ZXRvb3RoUmVjZWl2ZXIuZ2V0QTJkcEZpcmVkRmxhZ3MoKTsKLSAgICAgICAgbUJsdWV0b290aFJlY2VpdmVyLnJlc2V0RmlyZWRGbGFncygpOwotICAgICAgICBmYWlsKFN0cmluZy5mb3JtYXQoImRpc2Nvbm5lY3RBMmRwKCkgdGltZW91dDogc3RhdGU9JWQgKGV4cGVjdGVkICVkKSw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Y3RlZCgpKSB7Ci0gICAgICAgICAgICBzbGVlcChQT0xMX1RJTUUpOwotICAgICAgICB9Ci0KLSAgICAgICAgaW50IHN0YXRlID0gbUhlYWRzZXQuZ2V0U3RhdGUoZGV2aWNlKTsKLSAgICAgICAgc3dpdGNoIChzdGF0ZSkgewotICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RFRDoKLSAgICAgICAgICAgICAgICBhc3NlcnRUcnVlKG1IZWFkc2V0LmlzQ29ubmVjdGVkKGRldmljZSkpOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9ESVNDT05ORUNURUQ6Ci0gICAgICAgICAgICAgICAgYXNzZXJ0RmFsc2UobUhlYWRzZXQuaXNDb25uZWN0ZWQoZGV2aWNlKSk7Ci0gICAgICAgICAgICAgICAgbUhlYWRzZXQuY29ubmVjdEhlYWRzZXQoZGV2aWNlKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9DT05ORUNUSU5HOgotICAgICAgICAgICAgICAgIGFzc2VydEZhbHNlKG1IZWFkc2V0LmlzQ29ubmVjdGVkKGRldmljZSkpOwotICAgICAgICAgICAgICAgIC8vIERvbid0IGNoZWNrIGZvciByZWNlaXZlZCBpbnRlbnRzIHNpbmNlIHdlIG1pZ2h0IGhhdmUgbWlzc2VkIHRoZW0uCi0gICAgICAgICAgICAgICAgbWFzayA9IGhlYWRzZXRNYXNrID0gMDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9FUlJPUjoKLSAgICAgICAgICAgICAgICBmYWlsKCJjb25uZWN0SGVhZHNldCgpIGVycm9yIHN0YXRlIik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGZhaWwoImNvbm5lY3RIZWFkc2V0KCkgaW52YWxpZCBzdGF0ZTogc3RhdGU9IiArIHN0YXRlKTsKLSAgICAgICAgfQotCi0gICAgICAgIGxvbmcgcyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICB3aGlsZSAoU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzIDwgQ09OTkVDVF9IRUFEU0VUX1RJTUVPVVQpIHsKLSAgICAgICAgICAgIHN0YXRlID0gbUhlYWRzZXQuZ2V0U3RhdGUoZGV2aWNlKTsKLSAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RFRCkgewotICAgICAgICAgICAgICAgIGFzc2VydFRydWUobUhlYWRzZXQuaXNDb25uZWN0ZWQoZGV2aWNlKSk7Ci0gICAgICAgICAgICAgICAgaWYgKChtQmx1ZXRvb3RoUmVjZWl2ZXIuZ2V0RmlyZWRGbGFncygpICYgbWFzaykgPT0gbWFzawotICAgICAgICAgICAgICAgICAgICAgICAgJiYgKG1CbHVldG9vdGhSZWNlaXZlci5nZXRIZWFkc2V0RmlyZWRGbGFncygpICYgaGVhZHNldE1hc2spID09IGhlYWRzZXRNYXNrKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhSZWNlaXZlci5yZXNldEZpcmVkRmxhZ3MoKTsKLSAgICAgICAgICAgICAgICAgICAgd3JpdGVPdXRwdXQoU3RyaW5nLmZvcm1hdCgiY29ubmVjdEhlYWRzZXQoKSBjb21wbGV0ZWQgaW4gJWQgbXM6IGRldmljZT0lcyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gcyksIGRldmljZSkpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgfQotICAg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yLmlzRW5hYmxlZCgpKSB7Ci0gICAgICAgICAgICBmYWlsKCJkaXNjb25uZWN0SGVhZHNldCgpIGJsdWV0b290aCBub3QgZW5hYmxlZCIpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFhZGFwdGVyLmdldEJvbmRlZERldmljZXMoKS5jb250YWlucyhkZXZpY2UpKSB7Ci0gICAgICAgICAgICBmYWlsKCJkaXNjb25uZWN0SGVhZHNldCgpIGRldmljZSBub3QgcGFpcmVkOiBkZXZpY2U9IiArIGRldmljZSk7Ci0gICAgICAgIH0KLQotICAgICAgICB3aGlsZSAoIW1IZWFkc2V0U2VydmljZUxpc3RlbmVyLmlzQ29ubmVjdGVkKCkpIHsKLSAgICAgICAgICAgIHNsZWVwKFBPTExfVElNRSk7Ci0gICAgICAgIH0KLQotICAgICAgICBpbnQgc3RhdGUgPSBtSGVhZHNldC5nZXRTdGF0ZShkZXZpY2UpOwotICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7Ci0gICAgICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQ09OTkVDVEVEOgotICAgICAgICAgICAgICAgIG1IZWFkc2V0LmRpc2Nvbm5lY3RIZWFkc2V0KGRldmljZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQ09OTkVDVElORzoKLSAgICAgICAgICAgICAgICBtSGVhZHNldC5kaXNjb25uZWN0SGVhZHNldChkZXZpY2UpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0RJU0NPTk5FQ1RFRDoKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRVJST1I6Ci0gICAgICAgICAgICAgICAgZmFpbCgiZGlzY29ubmVjdEhlYWRzZXQoKSBlcnJvciBzdGF0ZSIpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBmYWlsKCJkaXNjb25uZWN0SGVhZHNldCgpIGludmFsaWQgc3RhdGU6IHN0YXRlPSIgKyBzdGF0ZSk7Ci0gICAgICAgIH0KLQotICAgICAgICBsb25nIHMgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKLSAgICAgICAgd2hpbGUgKFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gcyA8IERJU0NPTk5FQ1RfSEVBRFNFVF9USU1FT1VUKSB7Ci0gICAgICAgICAgICBzdGF0ZSA9IG1IZWFkc2V0LmdldFN0YXRlKGRldmljZSk7Ci0gICAgICAgICAgICBpZiAoc3RhdGUgPT0gQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9ESVNDT05ORUNURUQpIHsKLSAgICAgICAgICAgICAgICBhc3NlcnRGYWxzZShtSGVhZHNldC5pc0Nvbm5lY3RlZChkZXZpY2UpKTsKLSAgICAgICAgICAgICAgICBpZiAoKG1CbHVldG9vdGhSZWNlaXZlci5nZXRGaXJlZEZsYWdzKCkgJiBtYXNrKSA9PSBtYXNrCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiAobUJsdWV0b290aFJlY2VpdmVyLmdldEhlYWRzZXRGaXJlZEZsYWdzKCkgJiBoZWFkc2V0TWFzaykgPT0gaGVhZHNldE1hc2spIHsKLSAgICAgICAgICAgICAgICAgICAgbUJsdWV0b290aFJlY2VpdmVyLnJlc2V0RmlyZWRGbGFncygpOwotICAgICAgICAgICAgICAgICAgICB3cml0ZU91dHB1dChTdHJpbmcuZm9ybWF0KCJkaXNjb25uZWN0SGVhZHNldCgpIGNvbXBsZXRlZCBpbiAlZCBtczogZGV2aWNlPSVzIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzKSwgZ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cml2YXRlIHZvaWQgcmVtb3ZlUmVjZWl2ZXIoQnJvYWRjYXN0UmVjZWl2ZXIgcmVjZWl2ZXIpIHsKKyAgICAgICAgbUNvbnRleHQudW5yZWdpc3RlclJlY2VpdmVyKHJlY2VpdmVyKTsKKyAgICAgICAgbVJlY2VpdmVycy5yZW1vdmUocmVjZWl2ZXIpOworICAgIH0KKworICAgIHByaXZhdGUgQmx1ZXRvb3RoUHJvZmlsZSBjb25uZWN0UHJveHkoQmx1ZXRvb3RoQWRhcHRlciBhZGFwdGVyLCBpbnQgcHJvZmlsZSkgeworICAgICAgICBhZGFwdGVyLmdldFByb2ZpbGVQcm94eShtQ29udGV4dCwgbVNlcnZpY2VMaXN0ZW5lciwgcHJvZmlsZSk7CisgICAgICAgIGxvbmcgcyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOworICAgICAgICBzd2l0Y2ggKHByb2ZpbGUpIHsKKyAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoUHJvZmlsZS5BMkRQOgorICAgICAgICAgICAgICAgIHdoaWxlIChtQTJkcCAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHMgPCBDT05ORUNUX1BST1hZX1RJTUVPVVQpIHsKKyAgICAgICAgICAgICAgICAgICAgc2xlZXAoUE9MTF9USU1FKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIG1BMmRwOworICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhQcm9maWxlLkhFQURTRVQ6CisgICAgICAgICAgICAgICAgd2hpbGUgKG1IZWFkc2V0ICE9IG51bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gcyA8IENPTk5FQ1RfUFJPWFlfVElNRU9VVCkgeworICAgICAgICAgICAgICAgICAgICBzbGVlcChQT0xMX1RJTUUpOworICAgICAgIC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Nhc2UgSFVHRToKICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBNZW1vcnlGaWxlIG1lbW9yeUZpbGUgPSBuZXcgTWVtb3J5RmlsZShudWxsLCA1MDAwMDAwKTsKLSAgICAgICAgICAgICAgICAgICAgbWVtb3J5RmlsZS53cml0ZUJ5dGVzKFRFU1RfQkxPQiwgMCwgMTAwMDAwMCwgVEVTVF9CTE9CLmxlbmd0aCk7Ci0gICAgICAgICAgICAgICAgICAgIG1lbW9yeUZpbGUuZGVhY3RpdmF0ZSgpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gQXNzZXRGaWxlRGVzY3JpcHRvci5mcm9tTWVtb3J5RmlsZShtZW1vcnlGaWxlKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBhcmNlbEZpbGVEZXNjcmlwdG9yLmZyb21EYXRhKFRFU1RfQkxPQiwgbnVsbCk7CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXgpIHsKICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZpbGVOb3RGb3VuZEV4Y2VwdGlvbigiRXJyb3IgcmVhZGluZyAiICsgdXJsICsgIjoiICsgZXgudG9TdHJpbmcoKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgY2FzZSBGSUxFOgogICAgICAgICAgICAgICAgIEZpbGUgZmlsZSA9IGdldENvbnRleHQoKS5nZXRGaWxlU3RyZWFtUGF0aChEQVRBX0ZJTEUpOwotICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkID0KLSAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLm9wZW4oZmlsZSwgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9SRUFEX09OTFkpOwotICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQXNzZXRGaWxlRGVzY3JpcHRvcihmZCwgMCwgQXNzZX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AgICBATWVkaXVtVGVzdAotICAgIHB1YmxpYyB2b2lkIHRlc3RDdXJzb3JVcGRhdGUoKSB7Ci0gICAgICAgIG1EYXRhYmFzZS5leGVjU1FMKAotICAgICAgICAgICAgIkNSRUFURSBUQUJMRSB0ZXN0IChfaWQgSU5URUdFUiBQUklNQVJZIEtFWSwgZCBJTlRFR0VSLCBzIElOVEVHRVIpOyIpOwotICAgICAgICBmb3IoaW50IGkgPSAwOyBpIDwgMjA7IGkrKykgewotICAgICAgICAgICAgbURhdGFiYXNlLmV4ZWNTUUwoIklOU0VSVCBJTlRPIHRlc3QgKGQsIHMpIFZBTFVFUyAoIiArIGkgKyAKLSAgICAgICAgICAgICAgICAiLCIgKyBpJTIgKyAiKTsiKTsKLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgQ3Vyc29yIGMgPSBtRGF0YWJhc2UucXVlcnkoInRlc3QiLCBudWxsLCAicyA9IDAiLCBudWxsLCBudWxsLCBudWxsLCBudWxsKTsKLSAgICAgICAgaW50IGRDb2wgPSBjLmdldENvbHVtbkluZGV4T3JUaHJvdygiZCIpOwotICAgICAgICBpbnQgc0NvbCA9IGMuZ2V0Q29sdW1uSW5kZXhPclRocm93KCJzIik7Ci0gICAgICAgIAotICAgICAgICBpbnQgY291bnQgPSAwOwotICAgICAgICB3aGlsZSAoYy5tb3ZlVG9OZXh0KCkpIHsKLSAgICAgICAgICAgIGFzc2VydFRydWUoYy51cGRhdGVJbnQoZENvbCwgMykpOwotICAgICAgICAgICAgY291bnQrKzsKLSAgICAgICAgfQotICAgICAgICBhc3NlcnRFcXVhbHMoMTAsIGNvdW50KTsKLSAgICAgICAgCi0gICAgICAgIGFzc2VydFRydWUoYy5jb21taXRVcGRhdGVzKCkpOwotICAgICAgICAKLSAgICAgICAgYXNzZXJ0VHJ1ZShjLnJlcXVlcnkoKSk7Ci0gICAgICAgIAotICAgICAgICBjb3VudCA9IDA7Ci0gICAgICAgIHdoaWxlIChjLm1vdmVUb05leHQoKSk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ICAgIHB1YmxpYyB2b2lkIG9uQ29ycnVwdGlvbihTUUxpdGVEYXRhYmFzZSBkYk9iaikgeworICAgICAgICAgICAgYm9vbGVhbiBkYXRhYmFzZU9rID0gZGJPYmouaXNEYXRhYmFzZUludGVncml0eU9rKCk7CisgICAgICAgICAgICAvLyBjbG9zZSB0aGUgZGF0YWJhc2UKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZGJPYmouY2xvc2UoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgLyogaWdub3JlICovCisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZGF0YWJhc2VPaykgeworICAgICAgICAgICAgICAgIC8vIGRhdGFiYXNlIGlzIGp1c3QgZmluZS4gbm8gbmVlZCB0byBkZWxldGUgdGhlIGRhdGFiYXNlIGZpbGUKKyAgICAgICAgICAgICAgICBMb2cuZSgiTXlEYXRhYmFzZUNvcnJ1cHRpb25IYW5kbGVyIiwgIm5vIGNvcnJ1cHRpb24gaW4gdGhlIGRhdGFiYXNlOiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1EYXRhYmFzZUZpbGUuZ2V0UGF0aCgpKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gZGF0YWJhc2UgaXMgY29ycnVwdC4gZGVsZXRlIHRoZSBkYXRhYmFzZSBmaWxlCisgICAgICAgICAgICAgICAgTG9nLmUoIk15RGF0YWJhc2VDb3JydXB0aW9uSGFuZGxlciIsICJkZWxldGluZyB0aGUgZGF0YWJhc2UgZmlsZTogIiArCisgICAgICAgICAgICAgICAgICAgICAgICBtRGF0YWJhc2VGaWxlLmdldFBhdGgoKSk7CisgICAgICAgICAgICAgICAgbmV3IEZpbGUoZGJEaXIsIERCX05BTUUpLmRlbGV0ZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQpcIE5vIG5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TiwgbVRlc3RQb29sLmdldFNpemUoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyhNQVhfQ09OTiwgbVRlc3RQb29sLmdldE1heFBvb2xTaXplKCkpOworICAgICAgICAvLyByZWxlYXNlIGRiMSBidXQgc2luY2UgaXQgaXMgYWxsb2NhdGVkIDIgdGltZXMsIGl0IHNob3VsZCBzdGlsbCByZW1haW4gJ2J1c3knCisgICAgICAgIG1UZXN0UG9vbC5yZWxlYXNlKGRiMSk7CisgICAgICAgIGFzc2VydEZhbHNlKG1UZXN0UG9vbC5pc0RhdGFiYXNlT2JqRnJlZShkYjEpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKDAsIG1UZXN0UG9vbC5nZXRGcmVlUG9vbFNpemUoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyhNQVhfQ09OTiwgbVRlc3RQb29sLmdldFNpemUoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyhNQVhfQ09OTiwgbVRlc3RQb29sLmdldE1heFBvb2xTaXplKCkpOworICAgICAgICAvLyByZWxlYXNlIGFsbCBjb25uZWN0aW9ucworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE1BWF9DT05OOyBpKyspIHsKKyAgICAgICAgICAgIG1UZXN0UG9vbC5yZWxlYXNlKGRiT2Jqcy5nZXQoaSkpOworICAgICAgICB9CisgICAgICAgIC8vIGFsbCBvYmplY3RzIGluIHRoZSBwb29sIHNob3VsZCBiZSBmcmVlZCBub3cKKyAgICAgICAgYXNzZXJ0RXF1YWxzKE1BWF9DT05OLCBtVGVzdFBvb2wuZ2V0RnJlZVBvb2xTaXplKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoTUFYX0NPTk4sIG1UZXN0UG9vbC5nZXRTaXplKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoTUFYX0NPTk4sIG1UZXN0UG9vbC5nZXRNYXhQb29sU2l6ZSgpKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogc2FtZSBhcyBhY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BtVGVzdFBvb2wuZ2V0RnJlZVBvb2xTaXplKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoMSwgbVRlc3RQb29sLmdldFNpemUoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyhNQVhfQ09OTiwgbVRlc3RQb29sLmdldE1heFBvb2xTaXplKCkpOworCisgICAgICAgIGFzc2VydEZhbHNlKG1UZXN0UG9vbC5pc0RhdGFiYXNlT2JqRnJlZShkYikpOworCisgICAgICAgIFNRTGl0ZURhdGFiYXNlIGRiMSA9IG1UZXN0UG9vbC5nZXQoVEVTVF9TUUwpOworICAgICAgICBhc3NlcnRFcXVhbHMoMCwgbVRlc3RQb29sLmdldEZyZWVQb29sU2l6ZSgpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKDIsIG1UZXN0UG9vbC5nZXRTaXplKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoTUFYX0NPTk4sIG1UZXN0UG9vbC5nZXRNYXhQb29sU2l6ZSgpKTsKKworICAgICAgICBhc3NlcnRGYWxzZShtVGVzdFBvb2wuaXNEYXRhYmFzZU9iakZyZWUoZGIxKSk7CisgICAgICAgIGFzc2VydEZhbHNlKGRiMS5lcXVhbHMoZGIpKTsKKworICAgICAgICBtVGVzdFBvb2wucmVsZWFzZShkYik7CisgICAgICAgIGFzc2VydEVxdWFscygxLCBtVGVzdFBvb2wuZ2V0RnJlZVBvb2xTaXplKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoMiwgbVRlc3RQb29sLmdldFNpemUoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyhNQVhfQ09OTiwgbVRlc3RQb29sLmdldE1heFBvb2xTaXplKCkpOworCisgICAgICAgIG1UZXN0UG9vbC5yZWxlYXNlKGRiMSk7CisgICAgICAgIGFzc2VydEVxdWFscygyLCBtVGVzdFBvb2wuZ2V0RnJlZVBvb2xTaXplKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoMiwgbVRlc3RQb29sLmdldFNpemUoKSk7Cisg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RlcnMgPSBwb29sT2JqLmdldE51bUhvbGRlcnMoKTsKKyAgICAgICAgICAgIGFzc2VydEVxdWFscyhwcmV2ICsgMSwgbnVtSG9sZGVycyk7CisgICAgICAgIH0KKyAgICAgICAgLy8gcmVsZWFzZSBpdCBOIHRpbWVzCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgICAgICAgICBtVGVzdFBvb2wucmVsZWFzZShkYjEpOworICAgICAgICAgICAgaW50IHByZXYgPSBudW1Ib2xkZXJzOworICAgICAgICAgICAgbnVtSG9sZGVycyA9IHBvb2xPYmouZ2V0TnVtSG9sZGVycygpOworICAgICAgICAgICAgYXNzZXJ0RXF1YWxzKHByZXYgLSAxLCBudW1Ib2xkZXJzKTsKKyAgICAgICAgICAgIGFzc2VydEZhbHNlKG1UZXN0UG9vbC5pc0RhdGFiYXNlT2JqRnJlZShkYjEpKTsKKyAgICAgICAgfQorICAgICAgICAvLyB0aGUgY29ubmVjdGlvbiBzaG91bGQgc3RpbGwgaGF2ZSAyIG1vcmUgaG9sZGVycworICAgICAgICBhc3NlcnRGYWxzZShtVGVzdFBvb2wuaXNEYXRhYmFzZU9iakZyZWUoZGIxKSk7CisgICAgICAgIGFzc2VydEVxdWFscygyLCBwb29sT2JqLmdldE51bUhvbGRlcnMoKSk7CisgICAgICAgIGFzc2VydEVxdWFscygwLCBtVGVzdFBvb2wuZ2V0RnJlZVBvb2xTaXplKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoTUFYX0NPTk4sIG1UZXN0UG9vbC5nZXRTaXplKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoTUFYX0NPTk4sIG1UZXN0UG9vbC5nZXRNYXhQb29sU2l6ZSgpKTsKKyAgICAgICAgLy8gcmVsZWFzZSAyIG1vcmUgdGltZXMKKyAgICAgICAgbVRlc3RQb29sLnJlbGVhc2UoZGIxKTsKKyAgICAgICAgbVRlc3RQb29sLnJlbGVhc2UoZGIxKTsKKyAgICA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worICAgICAgICBhc3NlcnRFcXVhbHMoTiwgYzEuZ2V0Q291bnQoKSk7CisgICAgICAgIGMxLmNsb3NlKCk7CisKKyAgICAgICAgLy8gc2Nyb2xsIHRocm91Z2ggQUxMIGRhdGEgaW4gdGhlIHRhYmxlIHVzaW5nIGEgY3Vyc29yLiBzaG91bGQgY2F1c2UgbXVsdGlwbGUgY2FsbHMgdG8KKyAgICAgICAgLy8gbmF0aXZlX2ZpbGxfd2luZG93IChhbmQgcmUtZmlsbHMgb2YgdGhlIEN1cnNvcldpbmRvdyBvYmplY3QpCisgICAgICAgIEN1cnNvciBjID0gbURhdGFiYXNlLnF1ZXJ5KHRlc3RUYWJsZSwgbmV3IFN0cmluZ1tdeyJjb2wxIiwgImRlc2MifSwKKyAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKTsKKyAgICAgICAgaW50IGkgPSAwOworICAgICAgICB3aGlsZSAoYy5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgIGludCB2YWwgPSBjLmdldEludCgwKTsKKyAgICAgICAgICAgIGFzc2VydFRydWUocm93cy5jb250YWlucyh2YWwpKTsKKyAgICAgICAgICAgIGFzc2VydFRydWUocm93cy5yZW1vdmUodmFsKSk7CisgICAgICAgIH0KKyAgICAgICAgLy8gZGlkIEkgc2VlIGFsbCB0aGUgcm93cyBpbiB0aGUgdGFibGU/CisgICAgICAgIGFzc2VydFRydWUocm93cy5pc0VtcHR5KCkpOworCisgICAgICAgIC8vIGNoYW5nZSBkYXRhIGFuZCBtYWtlIHN1cmUgdGhlIGN1cnNvciBwaWNrcyB1cCBuZXcgZGF0YSAmIGNvdW50CisgICAgICAgIHJvd3MgPSBuZXcgSGFzaFNldDxJbnRlZ2VyPigpOworICAgICAgICBtRGF0YWJhc2UuYmVnaW5UcmFuc2FjdGlvbigpOworICAgICAgICBpbnQgTSA9IE4gKyAxMDAwOworICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IE07IGorKykgeworICAgICAgICAgICAgcm93cy5hZGQoaik7CisgICAgICAgICAgICBpZiAoaiA8IE4pIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZhbHVlcy5wdXQoImNvbDEiLCBqKTsKKyAgICAgICAgICAgIG1EYXRhYmFzZS5pbnNlcnQodGVzdFRhYmxlLCBudWxsLCB2YWx1ZXMpOworICAgICAgICB9CisgICAgICAgIG1EYXRhYmFzZS5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgICAgbURhdGFiYXNlLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgIGFzc2VydEVxdWFscyhNLCByb3dzLnNpemUoKSk7CisgICAgICAgIGMucmVxdWVyeSgpOworICAgICAgICBpID0gMDsKKyAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICBpbnQgdmFsID0gYy5nZXRJbnQoMCk7CisgICAgICAgICAgICBhc3NlcnRUcnVlKHJvd3MuY29udGFpbnModmFsKSk7CisgICAgICAgICAgICBhc3NlcnRUcnVlKHJvd3MucmVtb3ZlKHZhbCkpOworICAgICAgICB9CisgICAgICAgIC8vIGRpZCBJIHNlZSBhbGwgZGF0YSBmcm9tIHRoZSBtb2RpZmllZCB0YWJsZQorICAgICAgICBhc3NlcnRUcnVlKHJvd3MuaXNFbXB0eSgpKTsKKworICAgICAgICAvLyBtb3ZlIGN1cnNvciBiYWNrIHRvIDFzdCByb3cgYW5kIHNjcm9sbCB0byBhYm91dCBoYWxmd2F5IGluIHRoZSByZXN1bHQgc2V0CisgICAgICAgIC8vIGFuZCB0aGVuIGRlbGV0ZSA3NSUgb2YgZGF0YSAtIGFuZCB0aGVuIGRvIHJlcXVlcnkKKyAgICAgICAgYy5tb3ZlVG9GaXJzdCgpOworICAgICAgICBpbnQgSyA9IE4gLyAyOworICAgICAgICBmb3IgKGludCBwID0gMDsgcCA8IEsgJiYgYy5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GlzKCkpOworICAgICAgICAgICAgICAgICAgICBtRGF0YWJhc2UudXBkYXRlKFRFU1RfVEFCTEUsIHZhbHVlcywgImkgPSAiICsgaSwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgREVMRVRFOgorICAgICAgICAgICAgICAgICAgICBtRGF0YWJhc2UuZGVsZXRlKFRFU1RfVEFCTEUsICJpID0gMSIsIG51bGwpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBkbyBhIHF1ZXJ5LiBldmVuIHRob3VnaCBxdWVyeSB1c2VzIGEgZGlmZmVyZW50IGRhdGFiYXNlIGNvbm5lY3Rpb24sCisgICAgICAgIC8vIGl0IHNob3VsZCBzdGlsbCBzZWUgdGhlIGFib3ZlIGNoYW5nZXMgdG8gZGF0YSBiZWNhdXNlIHRoZSBhYm92ZSBzdGFuZGFsb25lCisgICAgICAgIC8vIGluc2VydC91cGRhdGUvZGVsZXRlcyBhcmUgZG9uZSBpbiB0cmFuc2FjdGlvbnMgYXV0b21hdGljYWxseS4KKyAgICAgICAgU3RyaW5nIHNxbCA9ICJzZWxlY3QgY291bnQoKikgZnJvbSAiICsgVEVTVF9UQUJMRTsKKyAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0bXQgPSBtRGF0YWJhc2UuY29tcGlsZVN0YXRlbWVudChzcWwpOworICAgICAgICBmaW5hbCBpbnQgZXhwZWN0ZWRWYWx1ZSA9IChzdG10VHlwZSA9PSBERUxFVEUpID8gNCA6IDU7CisgICAgICAgIGFzc2VydEVxdWFscyhleHBlY3RlZFZhbHVlLCBzdG10LnNpbXBsZVF1ZXJ5Rm9yTG9uZygpKTsKKyAgICAgICAgc3RtdC5jbG9zZSgpOworICAgICAgICBDdXJzb3IgYyA9IG1EYXRhYmFzZS5yYXdRdWVyeShzcWwsIG51bGwpOworICAgICAgICBhc3NlcnRFcXVhbHMoMSwgYy5nZXRDb3VudCgpKTsKKyAgICAgICAgYy5tb3ZlVG9GaXJzdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoZXhwZWN0ZWRWYWx1ZSwgYy5nZXRMb25nKDApKTsKKyAgICAgICAgYy5jbG9zZSgpOworCisgICAgICAgIC8vIGRvIDUgbW9yZSBjaGFuZ2VzIGluIGEgdHJhbnNhY3Rpb24gYnV0IGRvIGEgcXVlcnkgYmVmb3JlIGFuZCBhZnRlciB0aGUgY29tbWl0CisgICAgICAgIG1EYXRhYmFzZS5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgIGZvciAoaW50IGkgPSAxMDsgaSA8IDE1OyBpKyspIHsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoImkiLCBpKTsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoImoiLCAiaSIgKyBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSk7CisgICAgICAgICAgICBtRGF0YWJhc2UuaW5zZXJ0KFRFU1RfVEFCTEUsIG51bGwsIHZhbHVlcyk7CisgICAgICAgICAgICBzd2l0Y2ggKHN0bXRUeXBlKSB7CisgICAgICAgICAgICAgICAgY2FzZSBVUERBVEU6CisgICAgICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoImoiLCAidSIgKyBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSk7CisgICAgICAgICAgICAgICAgICAgIG1EYXRhYmFzZS51cGRhdGUoVEVTVF9UQUJMRSwgdmFsdWVzLCAiaSA9ICIgKyBpLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBERUxFVEU6CisgICAgICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5kZWxldGUoVEVTVF9UQUJMRSwgImkgPSAxIiwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIG1EYXRhYmFzZ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VBaGVhZExvZ2dpbmcoKTsKKyAgICAgICAgICAgICAgICBtRGF0YWJhc2UubUNvbm5lY3Rpb25Qb29sLnNldE1heFBvb2xTaXplKGkgKyAxKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlLmRpc2FibGVXcml0ZUFoZWFkTG9nZ2luZygpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbURhdGFiYXNlLmV4ZWNTUUwoIkNSRUFURSBUQUJMRSB0MSAoaSBpbnQsIGogaW50KTsiKTsKKyAgICAgICAgICAgIG1EYXRhYmFzZS5leGVjU1FMKCJDUkVBVEUgVEFCTEUgdDIgKGkgaW50LCBqIGludCk7Iik7CisgICAgICAgICAgICBtRGF0YWJhc2UuYmVnaW5UcmFuc2FjdGlvbigpOworICAgICAgICAgICAgZm9yIChpbnQgayA9IDA7IGsgPCA1OyBrKyspIHsKKyAgICAgICAgICAgICAgICBtRGF0YWJhc2UuZXhlY1NRTCgiaW5zZXJ0IGludG8gdDEgdmFsdWVzKD8sPyk7IiwgbmV3IFN0cmluZ1tdIHtrKyIiLCBrKyIifSk7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlLmV4ZWNTUUwoImluc2VydCBpbnRvIHQyIHZhbHVlcyg/LD8pOyIsIG5ldyBTdHJpbmdbXSB7aysiIiwgaysiIn0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbURhdGFiYXNlLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOworICAgICAgICAgICAgbURhdGFiYXNlLmVuZFRyYW5zYWN0aW9uKCk7CisKKyAgICAgICAgICAgIC8vIHN0YXJ0IGEgd3JpdGVyCisgICAgICAgICAgICBXcml0ZXIgdyA9IG5ldyBXcml0ZXIobURhdGFiYXNlKTsKKworICAgICAgICAgICAgLy8gaW5pdGlhbGl6ZSBhbiBhcnJheSBvZiBjb3VudGVycyB0byBiZSBwYXNzZWQgdG8gdGhlIHJlYWRlcnMKKyAgICAgICAgICAgIFJlYWRlciByMSA9IG5ldyBSZWFkZXIobURhdGFiYXNlLCAidDEiLCB3LCAwKTsKKyAgICAgICAgICAgIFJlYWRlciByMiA9IG5ldyBSZWFkZXIobURhdGFiYXNlLCAidDIiLCB3LCAxKTsKKyAgICAgICAgICAgIHcuc3RhcnQoKTsKKyAgICAgICAgICAgIHIxLnN0YXJ0KCk7CisgICAgICAgICAgICByMi5zdGFydCgpOworCisgICAgICAgICAgICAvLyB3YWl0IGZvciBhbGwgdGhyZWFkcyB0byBkaWUKKyAgICAgICAgICAgIHcuam9pbigpOworICAgICAgICAgICAgcjEuam9pbigpOworICAgICAgICAgICAgcjIuam9pbigpOworCisgICAgICAgICAgICAvLyBwcmludCB0aGUgc3RhdHMKKyAgICAgICAgICAgIGludFtdW10gY291bnRzID0gZ2V0Q291bnRzKCk7CisgICAgICAgICAgICBidWZmW2ldID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKCJjb25ucG9vbC1zaXplID0gIik7CisgICAgICAgICAgICBidWZmW2ldLmFwcGVuZChpICsgMSk7CisgICAgICAgICAgICBidWZmW2ldLmFwcGVuZCgiLCBudW0geGFjdHMgYnkgd3JpdGVyID0gIik7CisgICAgICAgICAgICBidWZmW2ldLmFwcGVuZChnZXROdW1YYWN0cygpKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKCIsIG51bS1yZWFkcy1pbi14YWN0L05PVC1pbi14YWN0IGJ5IHJlYWRlcjEgPSAiKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKGNvdW50c1swXVsxXSArICIvIiArIGNvdW50c1swXVswXSk7CisgICAgICAgICAgICBidWZmW2ldLmFwcGVuZCgiLCBieSByZWFkZXIyID0gIik7CisgICAgICAgICAgICBidWZmW2ldLmFwcGVuZChjb3VudHNbMV1bMV0gKyAiLyIgKyBjb3VudHNbMV1bMF0pOworCisgICAgICAgICAgICBMb2cuaShUQUcsICJkb25lIHRlc3RpbmcgZm9yIGNvbm4tcG9vbC1zaXplIG9mICIgKyAoaSsxKSk7CisKKyAgICAgICAgICAgIGRiVGVhcmRvd24oKTsKKyAgICAgICAgICAgIGRiU2V0VXAoKTsKKyAgICAgICAgfQorICAgICAgICBMb2cuaShUQUcsICJkdXJhdGlvbiBvZiB0ZXN0ICIgKyBUSU1FX1RPX1JVTl9XQUxfVEVTVF9GT1IgKyAiIHNlYyIpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE07IGkrKykgeworICAgICAgICAgICAgTG9nLmkoVEFHLCBidWZmW2ldLnRvU3RyaW5nKCkpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGluWGFjdCA9IGZhbHNlOworICAgIHByaXZhdGUgaW50IG51bVhhY3RzOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBUSU1FX1RPX1JVTl9XQUxfVEVTVF9GT1IgPSAxNTsgLy8gbnVtIHNlYyB0aGlzIHRlc3Qgc2hvdWxkIHJ1bgorICAgIHByaXZhdGUgaW50W11bXSBjb3VudHMgPSBuZXcgaW50WzJdWzJdOworCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgYm9vbGVhbiBpblhhY3QoKSB7CisgICAgICAgIHJldHVybiBpblhhY3Q7CisgICAgfQorCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCBzZXRJblhhY3RGbGFnKGJvb2xlYW4gZmxhZykgeworICAgICAgICBpblhhY3QgPSBmbGFnOworICAgIH0KKworICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgc2V0Q291bnRzKGludCByZWFkZXJOdW0sIGludFtdIG51bVJlYWRzKSB7CisgICAgICAgIGNvdW50c1tyZWFkZXJOdW1dWzBdID0gbnVtUmVhZHNbMF07CisgICAgICAgIGNvdW50c1tyZWFkZXJOdW1dWzFdID0gbnVtUmVhZHNbMV07CisgICAgfQorCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgaW50W11bXSBnZXRDb3VudHMoKSB7CisgICAgICAgIHJldHVybiBjb3VudHM7CisgICAgfQorCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCBzZXROdW1YYWN0cyhpbnQgbnVtKSB7CisgICAgICAgIG51bVhhY3RzID0gbnVtOworICAgIH0KKworICAgIHByaXZhdGUgc3luY2hyb25pemVkIGludCBnZXROdW1YYWN0cygpIHsKKyAgICAgICAgcmV0dXJuIG51bVhhY3RzOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgV3JpdGVyIGV4dGVuZHMgVGhyZWFkIHsKKyAgICAgICAgcHJpdmF0ZSBTUUxpdGVEYXRhYmFzZSBkYiA9IG51bGw7CisgICAgICAgIHB1YmxpYyBXcml0ZXIoU1FMaXRlRGF0YWJhc2UgZGIpIHsKKyAgICAgICAgICAgIHRoaXMuZGIgPSBkYjsKKyAgICAgICAgfQorICAgICAgICBAT3ZlcnJpZGUgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgLy8gaW4gYSBsb29wLCBmb3IgTiBzZWMsIGRvIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICAgIC8vICAgIEJFR0lOIHRyYW5zYWN0aW9uCisgICAgICAgICAgICAvLyAgICBpbnNlcnQgaW50byB0YWJsZSB0MSwgdDIKKyAgICAgICAgICAgIC8vICAgIENvbW1pdAorICAgICAgICAgICAgbG9uZyBub3cgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgIGludCBrOworICAgICAgICAgICAgZm9yIChrID0gMDsoU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBub3cpIC8gMTAwMCA8IFRJTUVfVE9fUlVOX1dBTF9URVNUX0ZPUjsgaysrKSB7CisgICAgICAgICAgICAgICAgZGIuYmVnaW5UcmFuc2FjdGlvbk5vbkV4Y2x1c2l2ZSgpOworICAgICAgICAgICAgICAgIHNldEluWGFjdEZsYWcodHJ1ZSk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAxMDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGRiLmV4ZWNTUUwoImluc2VydCBpbnRvIHQxIHZhbHVlcyg/LD8pOyIsIG5ldyBTdHJpbmdbXSB7aSsiIiwgaSsiIn0pOworICAgICAgICAgICAgICAgICAgICBkYi5leGVjU1FMKCJpbnNlcnQgaW50byB0MiB2YWx1ZXMoPyw/KTsiLCBuZXcgU3RyaW5nW10ge2krIiIsIGkrIiJ9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZGIuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICAgICAgc2V0SW5YYWN0RmxhZyhmYWxzZSk7CisgICAgICAgICAgICAgICAgZGIuZW5kVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNldE51bVhhY3RzKGspOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBSZWFkZXIgZXh0ZW5kcyBUaHJlYWQgeworICAgICAgICBwcml2YXRlIFNRTGl0ZURhdGFiYXNlIGRiID0gbnVsbDsKKyAgICAgICAgcHJpdmF0ZSBTdHJpbmcgdGFibGUgPSBudWxsOworICAgICAgICBwcml2YXRlIFdyaXRlciB3ID0gbnVsbDsKKyAgICAgICAgcHJpdmF0ZSBpbnQgcmVhZGVyTnVtOworICAgICAgICBwcml2YXRlIGludFtdIG51bVJlYWRzID0gbmV3IGludFsyXTsKKyAgICAgICAgcHVibGljIFJlYWRlcihTUUxpdGVEYXRhYmFzZSBkYiwgU3RyaW5nIHRhYmxlLCBXcml0ZXIgdywgaW50IHJlYWRlck51bSkgeworICAgICAgICAgICAgdGhpcy5kYiA9IGRiOworICAgICAgICAgICAgdGhpcy50YWJsZSA9IHRhYmxlOworICAgICAgICAgICAgdGhpcy53ID0gdzsKKyAgICAgICAgICAgIHRoaXMucmVhZGVyTnVtID0gcmVhZGVyTnVtOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAvLyB3aGlsZSB0aGUgd3JpdGUgaXMgYWxpdmUsIGluIGEgbG9vcCBkbyB0aGUgcXVlcnkgb24gYSB0YWJsZQorICAgICAgICAgICAgd2hpbGUgKHcuaXNBbGl2ZSgpKSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAxMDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMubG9uZ0ZvclF1ZXJ5KGRiLCAic2VsZWN0IGNvdW50KCopIGZyb20gIiArIHRoaXMudGFibGUsIG51bGwpOworICAgICAgICAgICAgICAgICAgICAvLyB1cGRhdGUgY291bnQgb2YgcmVhZHMKKyAgICAgICAgICAgICAgICAgICAgbnVtUmVhZHNbaW5YYWN0KCkgPyAxIDogMF0gKz0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzZXRDb3VudHMocmVhZGVyTnVtLCBudW1SZWFkcyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIENsYXNzVG9UZXN0U3FsQ29tcGlsYXRpb25BbmRDYWNoaW5nIGV4dGVuZHMgU1FMaXRlUHJvZ3JhbSB7CisgICAgICAgIHByaXZhdGUgQ2xhc3NUb1Rlc3RTcWxDb21waWxhdGlvbkFuZENhY2hpbmcoU1FMaXRlRGF0YWJhc2UgZGIsIFN0cmluZyBzcWwpIHsKKyAgICAgICAgICAgIHN1cGVyKGRiLCBzcWwpOworICAgICAgICB9CisgICAgICAgIHB1YmxpYyBzdGF0aWMgQ2xhc3NUb1Rlc3RTcWxDb21waWxhdGlvbkFuZENhY2hpbmcgY3JlYXRlKFNRTGl0ZURhdGFiYXNlIGRiLCBTdHJpbmcgc3FsKSB7CisgICAgICAgICAgICBkYi5sb2NrKCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQ2xhc3NUb1Rlc3RTcWxDb21waWxhdGlvbkFuZENhY2hpbmcoZGIsIHNxbCk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGRiLnVubG9jaygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgQFNtYWxsVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RMcnVDYWNoaW5nT2ZTcWxpdGVDb21waWxlZFNxbE9ianMoKSB7CisgICAgICAgIGNyZWF0ZVRhYmxlQW5kQ2xlYXJDYWNoZSgpOworICAgICAgICAvLyBzZXQgY2FjaGUgc2l6ZQorICAgICAgICBpbnQgTiA9IFNRTGl0ZURhdGFiYXNlLk1BWF9TUUxfQ0FDSEVfU0laRTsKKyAgICAgICAgbURhdGFiYXNlLnNldE1heFNxbENhY2hlU2l6ZShOKTsKKworICAgICAgICAvLyBkbyBOKzEgcXVlcmllcyAtIGFuZCB3aGVuIHRoZSAwdGggZW50cnkgaXMgcmVtb3ZlZCBmcm9tIExSVSBjYWNoZSBkdWUgdG8gdGhlCisgICAgICAgIC8vIGluc2VydGlvbiBvZiAoTisxKXRoIGVudHJ5LCBtYWtlIHN1cmUgMHRoIGVudHJ5IGlzIGNsb3NlZAorICAgICAgICBBcnJheUxpc3Q8SW50ZWdlcj4gc3RtdE9ianMgPSBuZXcgQXJyYXlMaXN0PEludGVnZXI+KCk7CisgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IHNxbFN0cmluZ3MgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKKyAgICAgICAgaW50IHN0bXQwID0gMDsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBOKzE7IGkrKykgeworICAgICAgICAgICAgU3RyaW5nIHMgPSAiaW5zZXJ0IGludG8gdGVzdCB2YWx1Z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aWMgdm9pZCB0ZXN0U3RhdGVtZW50Q2xvc2VEaWZmVGhyZWFkKCkgdGhyb3dzIEludGVycnVwdGVkRXhjZXB0aW9uIHsKKyAgICAgICAgY3JlYXRlVGFibGVBbmRDbGVhckNhY2hlKCk7CisgICAgICAgIGZpbmFsIGludCBOID0gU1FMaXRlRGF0YWJhc2UuTUFYX1NRTF9DQUNIRV9TSVpFOworICAgICAgICBtRGF0YWJhc2Uuc2V0TWF4U3FsQ2FjaGVTaXplKE4pOworICAgICAgICAvLyBmaWxsIHVwIHN0YXRlbWVudCBjYWNoZSBpbiBtRGF0YWJhc2UgaW4gYSB0aHJlYWQKKyAgICAgICAgVGhyZWFkIHQxID0gbmV3IFRocmVhZCgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0bXQ7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBOOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgQ2xhc3NUb1Rlc3RTcWxDb21waWxhdGlvbkFuZENhY2hpbmcgYyA9CisgICAgICAgICAgICAgICAgICAgICAgICBDbGFzc1RvVGVzdFNxbENvbXBpbGF0aW9uQW5kQ2FjaGluZy5jcmVhdGUoZ2V0RGIoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImluc2VydCBpbnRvIHRlc3QgdmFsdWVzKCIgKyBpICsgIiwgPyk7Iik7CisgICAgICAgICAgICAgICAgICAgIC8vIGtlZXAgdHJhY2sgb2YgMHRoIGVudHJ5CisgICAgICAgICAgICAgICAgICAgIGlmIChpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0bXQwSWQgPSBjLmdldFNxbFN0YXRlbWVudElkKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYy5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgICAgdDEuc3RhcnQoKTsKKyAgICAgICAgLy8gd2FpdCBmb3IgdGhlIHRocmVhZCB0byBmaW5pc2gKKyAgICAgICAgdDEuam9pbigpOworICAgICAgICAvLyBtRGF0YWJhc2Ugc2hvdWxkbid0IGhhdmUgYW55IHN0YXRlbWVudHMgdG8gYmUgcmVsZWFzZWQKKyAgICAgICAgYXNzZXJ0RXF1YWxzKDAsIG1EYXRhYmFzZS5nZXRRdWV1ZWRVcFN0bXRMaXN0KCkuc2l6ZSgpKTsKKworICAgICAgICAvLyBhZGQgb25lIG1vcmUgdG8gdGhlIGNhY2hlIC0gYW5kIHRoZSBhYm92ZSAnc3RtdDBJZCcgc2hvdWxkIGZhbGwgb3V0IG9mIGNhY2hlCisgICAgICAgIC8vIGp1c3QgZm9yIHRoZSBoZWNrIG9mIGl0LCBkbyBpdCBpbiBhIHNlcGFyYXRlIHRocmVhZAorICAgICAgICBUaHJlYWQgdDIgPSBuZXcgVGhyZWFkKCkgeworICAgICAgICAgICAgQE92ZXJyaWRlIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBDbGFzc1RvVGVzdFNxbENvbXBpbGF0aW9uQW5kQ2FjaGluZyBzdG10MSA9CisgICAgICAgICAgICAgICAgICAgIENsYXNzVG9UZXN0U3FsQ29tcGlsYXRpb25BbmRDYWNoaW5nLmNyZWF0ZShnZXREYigpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnNlcnQgaW50byB0ZXN0IHZhbHVlcygxMDAsID8pOyIpOworICAgICAgICAgICAgICAgIHN0bXQxLmJpbmRMb25nKDEsIDEpOworICAgICAgICAgICAgICAgIHN0bXQxLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHQyLnN0YXJ0KCk7CisgICAgICAgIHQyLmpvaW4oKTsKKworICAgICAgICAvLyBjbG9zZSgpIGluIHRoZSBhYm92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dDBJZDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBzYW1lIGFzIGFib3ZlIC0gZXhjZXB0IHRoYXQgdGhlIHF1ZXVlIG9mIHN0YXRlbWVudHMgdG8gYmUgZmluYWxpemVkIGFyZSBmaW5hbGl6ZWQKKyAgICAgKiBieSBkYXRhYmFzZSBjbG9zZSgpIG9wZXJhdGlvbi4KKyAgICAgKi8KKyAgICBATGFyZ2VUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdFN0YXRlbWVudENsb3NlQnlEYkNsb3NlKCkgdGhyb3dzIEludGVycnVwdGVkRXhjZXB0aW9uIHsKKyAgICAgICAgY3JlYXRlVGFibGVBbmRDbGVhckNhY2hlKCk7CisgICAgICAgIC8vIGZpbGwgdXAgc3RhdGVtZW50IGNhY2hlIGluIG1EYXRhYmFzZSBpbiBhIHRocmVhZAorICAgICAgICBUaHJlYWQgdDEgPSBuZXcgVGhyZWFkKCkgeworICAgICAgICAgICAgQE92ZXJyaWRlIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBpbnQgTiA9IFNRTGl0ZURhdGFiYXNlLk1BWF9TUUxfQ0FDSEVfU0laRTsKKyAgICAgICAgICAgICAgICBnZXREYigpLnNldE1heFNxbENhY2hlU2l6ZShOKTsKKyAgICAgICAgICAgICAgICBTUUxpdGVTdGF0ZW1lbnQgc3RtdDsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkgKyspIHsKKyAgICAgICAgICAgICAgICAgICAgQ2xhc3NUb1Rlc3RTcWxDb21waWxhdGlvbkFuZENhY2hpbmcgYyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xhc3NUb1Rlc3RTcWxDb21waWxhdGlvbkFuZENhY2hpbmcuY3JlYXRlKGdldERiKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW5zZXJ0IGludG8gdGVzdCB2YWx1ZXMoIiArIGkgKyAiLCA/KTsiKTsKKyAgICAgICAgICAgICAgICAgICAgLy8ga2VlcCB0cmFjayBvZiAwdGggZW50cnkKKyAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc3RtdDBJZCA9IGMuZ2V0U3FsU3RhdGVtZW50SWQoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICB0MS5zdGFydCgpOworICAgICAgICAvLyB3YWl0IGZvciB0aGUgdGhyZWFkIHRvIGZpbmlzaAorICAgICAgICB0MS5qb2luKCk7CisKKyAgICAgICAgLy8gYWRkIG9uZSBtb3JlIHRvIHRoZSBjYWNoZSAtIGFuZCB0aGUgYWJvdmUgJ3N0bXQwSWQnIHNob3VsZCBmYWxsIG91dCBvZiBjYWNoZQorICAgICAgICAvLyBqdXN0IGZvciB0aGUgaGVjayBvZiBpdCwgZG8gaXQgaW4gYSBzZXBhcmF0ZSB0aHJlYWQKKyAgICAgICAgVGhyZWFkIHQyID0gbmV3IFRocmVhZCgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgQ2xhc3NUb1Rlc3RTcWxDb21waWxhdGlvbkFuZENhY2hpbmcgc3RtdDEgPQorICAgICAgICAgICAgICAgICAgICAgICAgQ2xhc3NUb1Rlc3RTcWxDb21waWxhdGlvbkFuZENhY2hpbmcuY3JlYXRlKGdldERiKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnNlcnQgaW50byB0ZXN0IHZhbHVlcygxMDAsID8pOyIpOworICAgICAgICAgICAgICAgIHN0bXQxLmJpbmRMb25nKDEsIDEpOworICAgICAgICAgICAgICAgIHN0bXQxLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHQyLn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mFzZS5pc0RiTG9ja2VkQnlPdGhlclRocmVhZHMoKSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogdGVzdCB0aGUgZm9sbG93aW5nCisgICAgICogaHR0cDovL2IvaXNzdWU/aWQ9Mjg3MTAzNworICAgICAqICAgICAgICAgIEN1cnNvciBjdXJzb3IgPSBkYi5xdWVyeSguLi4pOworICAgICAqICAgICAgICAgIC8vIHdpdGggV0FMIGVuYWJsZWQsIHRoZSBhYm92ZSB1c2VzIGEgcG9vbGVkIGRhdGFiYXNlIGNvbm5lY3Rpb24KKyAgICAgKiAgICAgICAgICBkYi5iZWdpblRyYW5zYWN0aW9uKCkKKyAgICAgKiAgICAgICAgICB0cnkgeworICAgICAqICAgICAgICAgICAgZGIuaW5zZXJ0KC4uLi4uLik7CisgICAgICogICAgICAgICAgICBjdXJzb3IucmVxdWVyeSgpOworICAgICAqICAgICAgICAgICAgLy8gc2luY2UgdGhlIGN1cnNvciB1c2VzIHBvb2xlZCBkYXRhYmFzZSBjb25uZWN0aW9uLCB0aGUgYWJvdmUgcmVxdWVyeQorICAgICAqICAgICAgICAgICAgLy8gd2lsbCBub3QgcmV0dXJuIHRoZSByZXN1bHRzIHRoYXQgd2VyZSBpbnNlcnRlZCBhYm92ZSBzaW5jZSB0aGUgaW5zZXJ0IGlzCisgICAgICogICAgICAgICAgICAvLyBkb25lIHVzaW5nIG1haW4gZGF0YWJhc2UgY29ubmVjdGlvbiBBTkQgdGhlIHRyYW5zYWN0aW9uIGlzIG5vdCBjb21taXR0ZWQgeWV0LgorICAgICAqICAgICAgICAgICAgLy8gZml4IGlzIHRvIG1ha2UgdGhlIGFib3ZlIGN1cnNvciB1c2UgdGhlIG1haW4gZGF0YWJhc2UgY29ubmVjdGlvbiAtIGFuZCBOT1QKKyAgICAgKiAgICAgICAgICAgIC8vIHRoZSBwb29sZWQgZGF0YWJhc2UgY29ubmVjdGlvbgorICAgICAqICAgICAgICAgICAgZGIuc2V0VHJhbnNhY3Rpb25TdW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RSArICIgdmFsdWVzKDEwMCwgOTkwOSk7Iik7CisgICAgICAgICAgICBhc3NlcnRFcXVhbHMoMiwgRGF0YWJhc2VVdGlscy5sb25nRm9yUXVlcnkobURhdGFiYXNlLAorICAgICAgICAgICAgICAgICAgICAic2VsZWN0IGNvdW50KCopIGZyb20gIiArIFRFU1RfVEFCTEUsIG51bGwpKTsKKyAgICAgICAgICAgIC8vIHF1ZXJ5IGluIGEgZGlmZmVyZW50IHRocmVhZC4gdGhhdCBjYXVzZXMgdGhlIGN1cnNvciB0byB1c2UgYSBwb29sZWQgY29ubmVjdGlvbgorICAgICAgICAgICAgLy8gYW5kIHNpbmNlIHRoaXMgdGhyZWFkIGhhc24ndCBjb21taXR0ZWQgaXRzIGNoYW5nZXMsIHRoZSBjdXJzb3Igc2hvdWxkIHN0aWxsIHNlZSBvbmx5CisgICAgICAgICAgICAvLyAxIHJvdworICAgICAgICAgICAgVGhyZWFkIHQgPSBuZXcgVGhyZWFkKCkgeworICAgICAgICAgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgIGMxLnJlcXVlcnkoKTsKKyAgICAgICAgICAgICAgICAgICAgYXNzZXJ0RXF1YWxzKDEsIGMxLmdldENvdW50KCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB0LnN0YXJ0KCk7CisgICAgICAgICAgICB0LmpvaW4oKTsKKyAgICAgICAgICAgIC8vIHNob3VsZCBiZSAyIHJvd3Mgbm93IC0gaW5jbHVkaW5nIHRoZSB0aGUgcm93IGluc2VydGVkIGFib3ZlCisgICAgICAgICAgICBtRGF0YWJhc2Uuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtRGF0YWJhc2UuZW5kVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgfQorICAgICAgICBjMS5jbG9zZSgpOworICAgI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CJJTlNFUlQgaW50byAiICsgVEVTVF9UQUJMRSArICIgdmFsdWVzKDEwMCwgOTkwOSk7Iik7CisgICAgICAgICAgICBhc3NlcnRFcXVhbHMoMiwgRGF0YWJhc2VVdGlscy5sb25nRm9yUXVlcnkobURhdGFiYXNlLAorICAgICAgICAgICAgICAgICAgICAic2VsZWN0IGNvdW50KCopIGZyb20gIiArIFRFU1RfVEFCTEUsIG51bGwpKTsKKyAgICAgICAgICAgIC8vIHJlcXVlcnkgb24gdGhlIHByZXZpb3VzbHkgb3BlbmVkIGN1cnNvcgorICAgICAgICAgICAgLy8gY3Vyc29yIHNob3VsZCBub3cgdXNlIHRoZSBtYWluIGRhdGFiYXNlIGNvbm5lY3Rpb24gYW5kIHNlZSAyIHJvd3MKKyAgICAgICAgICAgIGMucmVxdWVyeSgpOworICAgICAgICAgICAgYXNzZXJ0RXF1YWxzKDIsIGMuZ2V0Q291bnQoKSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAvLyByb2xsYmFjayB0aGUgY2hhbmdlCisgICAgICAgICAgICBtRGF0YWJhc2UuZXhlY1NRTCgicm9sbGJhY2s7Iik7CisgICAgICAgIH0KKyAgICAgICAgLy8gc2luY2UgdGhlIGNoYW5nZSBpcyByb2xsZWQgYmFjaywgZG8gdGhlIHNhbWUgcXVlcnkgYWdhaW4gYW5kIHNob3VsZCBub3cgZmluZCBvbmx5IDEgcm93CisgICAgICAgIGMucmVxdWVyeSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoMSwgYy5nZXRDb3VudCgpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKDEsIERhdGFiYXNlVXRpbHMubG9uZ0ZvclF1ZXJ5KG1EYXRhYmFzZSwKKyAgICAgICAgICAgICAgICAic2VsZWN0IGNvdW50KCopIGZyb20gIiArIFRFU1RfVEFCTEUsIG51bGwpKTsKKyAgICAgICAgYy5jbG9zZSgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIGh0dHA6Ly9i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gICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTiA9IDEwMDA7Ci0gICAgICAgICAgICBAT3ZlcnJpZGUgcHVibGljIHZvaWQgcnVuKCkgewotICAgICAgICAgICAgICAgIGludCBpID0gMDsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAvLyBleGVjdXRlIG1hbnkgdGltZXMKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IE47IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgU1FMaXRlU3RhdGVtZW50IHMxID0gbURhdGFiYXNlLmNvbXBpbGVTdGF0ZW1lbnQoc3RtdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzMS5iaW5kTG9uZygxLCBpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHMxLmV4ZWN1dGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHMxLmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBmYWlsKCJTUUxpdGVFeGNlcHRpb246ICIgKyBlLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOwotICAgICAgICAgICAgICAgICAgICBmYWlsKCJyYW5kb20gdW5leHBlY3RlZCBleGNlcHRpb246ICIgKyBlLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgUnVuU3RtdFRocmVhZCB0MSA9IG5ldyBSdW5TdG10VGhyZWFkKCk7Ci0gICAgICAgIHQxLnN0YXJ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ICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTiA9IDEwMDA7Ci0gICAgICAgICAgICBAT3ZlcnJpZGUgcHVibGljIHZvaWQgcnVuKCkgewotICAgICAgICAgICAgICAgIGludCBpID0gMDsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAvLyBleGVjdXRlIG1hbnkgdGltZXMKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IE47IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgczEuYmluZExvbmcoMSwgaSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzMS5leGVjdXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICAvLyBleHBlY3QgaXQKLSAgICAgICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShlLmdldE1lc3NhZ2UoKS5jb250YWlucygibGlicmFyeSByb3V0aW5lIGNhbGxlZCBvdXQgb2Ygc2VxdWVuY2U6IikpOwotICAgICAgICAgICAgICAgICAgICBleGNlcHRpb25SZWN2ZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOwotICAgICAgICAgICAgICAgICAgICBmYWlsKCJyYW5kb20gdW5leHBlY3RlZCBleGNlcHRpb246ICIgKyBlLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgUnVuU3RtdFRocmVhZCB0MSA9IG5ldyBSdW5TdG10VGhyZWFkKCk7Ci0gICAgICAgIHQxLnN0YXJ0KCk7Ci0gICAg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7CisgICAgICAgIGZpbmFsIFN0cmluZyBzdG10ID0gIlNFTEVDVCAqIEZST00gdGVzdF9wc3RtdCBXSEVSRSBpID0gPyI7CisgICAgICAgIGZpbmFsIFNRTGl0ZVN0YXRlbWVudCBzMSA9IG1EYXRhYmFzZS5jb21waWxlU3RhdGVtZW50KHN0bXQpOworICAgICAgICBjbGFzcyBSdW5TdG10VGhyZWFkIGV4dGVuZHMgVGhyZWFkIHsKKyAgICAgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgLy8gZG8gaXQgZW5vdWdoIHRpbWVzIHRvIG1ha2Ugc3VyZSB0aGVyZSBhcmUgbm8gY29ybmVyIGNhc2VzIGdvaW5nIHVudGVzdGVkCisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAxMDAwOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgbG9jaygpOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgczEuYmluZExvbmcoMSwgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzMS5leGVjdXRlKCk7CisgICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgICAgICB1bmxvY2soKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBUaHJlYWQueWllbGQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgUnVuU3RtdFRocmVhZCB0MSA9IG5ldyBSdW5TdG10VGhyZWFkKCk7CisgICAgICAgIHQxLnN0YXJ0KCk7CisgICAgICAgIFJ1blN0bXRUaHJlYWQgdDIgPSBuZXcgUnVuU3RtdFRocmVhZCgpOworICAgICAgICB0Mi5zdGFydCgpOworICAgICAgICB3aGlsZSAodDEuaXNBbGl2ZSgpIHx8IHQyLmlzQWxpdmUoKSkgeworICAgICAgICA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zc2FnZSBtc2cpIHsKKyAgICAgICAgICAgIGlmICghbXNnLmlzSW5Vc2UoKSkgeworICAgICAgICAgICAgICAgIGZhaWx1cmUobmV3IFJ1bnRpbWVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAibXNnLmlzSW51c2UgaXMgZmFsc2UsIHNob3VsZCBhbHdheXMgYmUgdHJ1ZSwgIyIgKyBtc2cud2hhdCkpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKG1Db3VudCA8PSBtTGFzdE1lc3NhZ2UpIHsKICAgICAgICAgICAgICAgICBpZiAobXNnLndoYXQgIT0gbUNvdW50KSB7CiAgICAgICAgICAgICAgICAgICAgIGZhaWx1cmUobmV3IFJ1bnRpbWVFeGNlcHRpb24oCkBAIC05OSw1ICsxMDMsMTc0IEBACiAKICAgICAgICAgdGVzdGVyLmRvVGVzdCgxMDAwKTsKICAgICB9Ci19CiAKKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBUZXN0RmllbGRJbnRlZ3JpdHlIYW5kbGVyIGV4dGVuZHMgVGVzdEhhbmRsZXJUaHJlYWQgeworICAgICAgICBIYW5kbGVyIG1IYW5kbGVyOworICAgICAgICBpbnQgbUxhc3RNZXNzYWdlOworICAgICAgICBpbnQgbUNvdW50OworCisgICAgICAgIHB1YmxpYyBUZXN0RmllbGRJbnRlZ3JpdHlIYW5kbGVyKCkgeworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgZ28oKSB7CisgICAgICAgICAgICBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgICAgICAgICAgVGVzdEZpZWxkSW50ZWdyaXR5SGFuZGxlci50aGlzLmhhbmRsZU1lc3NhZ2UobXNnKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICAgICAgaWYgKCFtc2cuaXNJblVzZSgpKSB7CisgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJtc2cuaXNJbnVzZSBpcyBmYWxzZSwgc2hvdWxkIGFsd2F5cyBiZSB0cnVlLCAjIiArIG1zZy53aGF0KSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUNvdW50IDw9IG1MYXN0TWVzc2FnZSkgeworICAgICAgICAgICAgICAgIGlmIChtc2cud2hhdCAhPSBtQ291bnQpIHsKKyAgICAgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRXhwZWN0ZWQgbWVzc2FnZSAjIiArIG1Db3VudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCByZWNlaXZlZCAjIiArIG1zZy53aGF0KSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtQ291bnQgPT0gbUxhc3RNZXNzYWdlKSB7CisgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUNvdW50Kys7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGZhaWx1cmUobmV3IFJ1bnRpbWVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiTWVzc2FnZSByZWNlaXZlZCBhZnRlciBkb25lLCAjIiArIG1zZy53aGF0KSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBATWVkaXVtVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RGaWVsZEludGVncml0eSgpIHRocm93cyBFeGNlcHRpb24geworCisgICAgICAgIFRlc3RIYW5kbGVyVGhyZWFkIHRlc3RlciA9IG5ldyBUZXN0RmllbGRJbnRlZ3JpdHlIYW5kbGVyKCkgeworICAgICAgICAgICAgQnVuZGxlIG1CdW5kbGU7CisKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGdvKCkgeworICAgICAgICAgICAgICAgIHN1cGVyLmdvKCk7CisgICAgICAgICAgICAgICAgbUxhc3RNZXNzYWdlID0gMTsKKyAgICAgICAgICAgICAgICBtQ291bnQgPSAwOworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlKG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoMCkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CisgICAgICAgICAgICAgICAgc3VwZXIuaGFuZGxlTWVzc2FnZShtc2cpOworICAgICAgICAgICAgICAgIGlmIChtc2cud2hhdCA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIG1zZy5mbGFncyA9IC0xOworICAgICAgICAgICAgICAgICAgICBtc2cud2hhdCA9IDE7CisgICAgICAgICAgICAgICAgICAgIG1zZy5hcmcxID0gNDU2OworICAgICAgICAgICAgICAgICAgICBtc2cuYXJnMiA9IDc4OTsKKyAgICAgICAgICAgICAgICAgICAgbXNnLm9iaiA9IHRoaXM7CisgICAgICAgICAgICAgICAgICAgIG1zZy5yZXBseVRvID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgbUJ1bmRsZSA9IG5ldyBCdW5kbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgbXNnLmRhdGEgPSBtQnVuZGxlOworICAgICAgICAgICAgICAgICAgICBtc2cuZGF0YS5wdXRTdHJpbmcoImtleSIsICJ2YWx1ZSIpOworCisgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgbmV3TXNnID0gbUhhbmRsZXIub2J0YWluTWVzc2FnZSgpOworICAgICAgICAgICAgICAgICAgICBuZXdNc2cuY29weUZyb20obXNnKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld01zZy5pc0luVXNlKCkgIT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZhaWx1cmUobmV3IFJ1bnRpbWVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJuZXdNc2cuaXNJblVzZSBpcyB0cnVlIHNob3VsZCBiZSBmYWxzZSBhZnRlciBjb3B5RnJvbSIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAobmV3TXNnLmZsYWdzICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZhaWx1cmUobmV3IFJ1bnRpbWVFeGNlcHRpb24oU3RyaW5nLmZvcm1hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgICJuZXdNc2cuZmxhZ3MgaXMgJWQgc2hvdWxkIGJlIDAgYWZ0ZXIgY29weUZyb20iLCBuZXdNc2cuZmxhZ3MpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld01zZy53aGF0ICE9IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZhaWx1cmUobmV3IFJ1bnRpbWVFeGNlcHRpb24oU3RyaW5nLmZvcm1hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm5ld01zZy53aGF0IGlzICVkIHNob3VsZCBiZSAlZCBhZnRlciBjb3B5RnJvbSIsIG5ld01zZy53aGF0LCAxKSkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdNc2cuYXJnMSAhPSA0NTYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZhaWx1cmUobmV3IFJ1bnRpbWVFeGNlcHRpb24oU3RyaW5nLmZvcm1hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm5ld01zZy5hcmcxIGlzICVkIHNob3VsZCBiZSAlZCBhZnRlciBjb3B5RnJvbSIsIG1zZy5hcmcxLCA0NTYpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld01zZy5hcmcyICE9IDc4OSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbihTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibmV3TXNnLmFyZzIgaXMgJWQgc2hvdWxkIGJlICVkIGFmdGVyIGNvcHlGcm9tIiwgbXNnLmFyZzIsIDc4OSkpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAobmV3TXNnLm9iaiAhPSB0aGlzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmYWlsdXJlKG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibmV3TXNnLm9iaiBzaG91bGQgYmUgJ3RoaXMnIGFmdGVyIGNvcHlGcm9tIikpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdNc2cucmVwbHlUbyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmYWlsdXJlKG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibmV3TXNnLnJlcGx5VG8gc2hvdWxkIGJlIG51bGwgYWZ0ZXIgY29weUZyb20iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld01zZy5kYXRhID09IG1CdW5kbGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZhaWx1cmUobmV3IFJ1bnRpbWVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJuZXdNc2cuZGF0YSBzaG91bGQgTk9UIGJlIG1CdW5kbGUgYWZ0ZXIgY29weUZyb20iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKCFuZXdNc2cuZGF0YS5nZXRTdHJpbmcoImtleSIpLmVxdWFscyhtQnVuZGxlLmdldFN0cmluZygia2V5IikpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmYWlsdXJlKG5ldyBSdW50aW1lRXhjZXB0aW9uKFN0cmluZy5mb3JtYXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJuZXdNc2cuZGF0YS5nZXRTdHJpbmcoXCJrZXlcIikgaXMgJXMgYW5kIGRvZXMgbm90IGVxdWFsIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbUJ1bmRsZS5nZXRTdHJpbmcoXCJrZXlcIikgd2hpY2ggaXMgJXMgYWZ0ZXIgY29weUZyb20iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdNc2cuZGF0YS5nZXRTdHJpbmcoImtleSIpLCAgbUJ1bmRsZS5nZXRTdHJpbmcoImtleSIpKSkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdNc2cud2hlbiAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmYWlsdXJlKG5ldyBSdW50aW1lRXhjZXB0aW9uKFN0cmluZy5mb3JtYXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJuZXdNc2cud2hlbiBpcyAlZCBzaG91bGQgYmUgMCBhZnRlciBjb3B5RnJvbSIsIG5ld01zZy53aGVuKSkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdNc2cudGFyZ2V0ICE9IG1IYW5kbGVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmYWlsdXJlKG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibmV3TXNnLnRhcmdldCBpcyBOT1QgbUhhbmRsZXIgYWZ0ZXIgY29weUZyb20iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld01zZy5jYWxsYmFjayAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmYWlsdXJlKG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibmV3TXNnLmNhbGxiYWNrIGlzIE5PVCBudWxsIGFmdGVyIGNvcHlGcm9tIikpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2UobmV3TXNnKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1zZy53aGF0ID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5pc0luVXNlKCkgIT0gdHJ1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbihTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibXNnLmlzSW5Vc2UgaXMgZmFsc2Ugc2hvdWxkIGJlIHRydWUgYWZ0ZXIgd2hlbiBwcm9jZXNzaW5nICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLndoYXQpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5hcmcxICE9IDQ1NikgeworICAgICAgICAgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbihTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibXNnLmFyZzEgaXMgJWQgc2hvdWxkIGJlICVkIHdoZW4gcHJvY2Vzc2luZyAjICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLmFyZzEsIDQ1NiwgbXNnLndoYXQpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5hcmcyICE9IDc4OSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbihTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibXNnLmFyZzIgaXMgJWQgc2hvdWxkIGJlICVkIHdoZW4gcHJvY2Vzc2luZyAjICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLmFyZzIsIDc4OSwgbXNnLndoYXQpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5vYmogIT0gdGhpcykgeworICAgICAgICAgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbihTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibXNnLm9iaiBzaG91bGQgYmUgJ3RoaXMnIHdoZW4gcHJvY2Vzc2luZyAjICVkIiwgbXNnLndoYXQpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5yZXBseVRvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZhaWx1cmUobmV3IFJ1bnRpbWVFeGNlcHRpb24oU3RyaW5nLmZvcm1hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm1zZy5yZXBseVRvIHNob3VsZCBiZSBudWxsIHdoZW4gcHJvY2Vzc2luZyAjICVkIiwgbXNnLndoYXQpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKCFtc2cuZGF0YS5nZXRTdHJpbmcoImtleSIpLmVxdWFscyhtQnVuZGxlLmdldFN0cmluZygia2V5IikpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmYWlsdXJlKG5ldyBSdW50aW1lRXhjZXB0aW9uKFN0cmluZy5mb3JtYXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJtc2cuZGF0YS5nZXRTdHJpbmcoXCJrZXlcIikgaXMgJXMgYW5kIGRvZXMgbm90IGVxdWFsIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbUJ1bmRsZS5nZXRTdHJpbmcoXCJrZXlcIikgd2hpY2ggaXMgJXMgd2hlbiBwcm9jZXNzaW5nICMgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cuZGF0YS5nZXRTdHJpbmcoImtleSIpLCAgbUJ1bmRsZS5nZXRTdHJpbmcoImtleSIpLCBtc2cud2hhdCkpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAobXNnLndoZW4gIT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbihTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibXNnLndoZW4gaXMgJWQgc2hvdWxkIGJlIDAgd2hlbiBwcm9jZXNzaW5nICMgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cud2hlbiwgbXNnLndoYXQpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy50YXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbihTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibXNnLnRhcmdldCBpcyBOT1QgbnVsbCB3aGVuIHByb2Nlc3NpbmcgIyAlZCIsIG1zZy53aGF0KSkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChtc2cuY2FsbGJhY2sgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmFpbHVyZShuZXcgUnVudGltZUV4Y2VwdGlvbihTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibXNnLmNhbGxiYWNrIGlzIE5PVCBudWxsIHdoZW4gcHJvY2Vzc2luZyAjICVkIiwgbXNnLndoYXQpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBmYWlsdXJlKG5ldyBSdW50aW1lRXhjZXB0aW9uKFN0cmluZy5mb3JtYXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuZXhwZWN0ZWQgbXNnLndoYXQgaXMgJWQiICsgbXNnLndoYXQpKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIHRlc3Rlci5kb1Rlc3QoMTAwMCk7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS90ZXN0cy9jb3JldGVzdHMvc3JjL2FuZHJvaWQvcGltL3ZjYXJkL1ZDYXJkRXhwb3J0ZXJUZXN0cy5qYXZhIGIvY29yZS90ZXN0cy9jb3JldGVzdHMvc3JjL2FuZHJvaWQvcGltL3ZjYXJkL1ZDYXJkRXhwb3J0ZXJUZXN0cy5qYXZhCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAyYmVjNDYyLi4wMDAwMDAwCi0tLSBhL2NvcmUvdGVzdHMvY29yZXRlc3RzL3NyYy9hbmRyb2lkL3BpbS92Y2FyZC9WQ2FyZEV4cG9ydGVyVGVzdHMuamF2YQorKysgL2Rldi9udWxsCkBAIC0xLDEyMjMgKzAsMCBAQAotLyoKLSAqIENvcHlyaWdodCAoQykgMjAwOSBUaGUgQW5kcm9pZCBP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KLQotICAgIC8qKgotICAgICAqIFRlc3RzIHRoYXQgdkNhcmQgY29tcG9zZXIgZW1pdHMgY29ycmVzcG9uZGluZyB0eXBlIHBhcmFtIHdoaWNoIHdlIGV4cGVjdC4KLSAgICAgKi8KLSAgICBwcml2YXRlIHZvaWQgdGVzdFBob25lVmFyaW91c1R5cGVTdXBwb3J0KGludCB2Y2FyZFR5cGUpIHsKLSAgICAgICAgbVZlcmlmaWVyLmluaXRGb3JFeHBvcnRUZXN0KHZjYXJkVHlwZSk7Ci0gICAgICAgIENvbnRhY3RFbnRyeSBlbnRyeSA9IG1WZXJpZmllci5hZGRJbnB1dEVudHJ5KCk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxMCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0hPTUUpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMjAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9XT1JLKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjMwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfRkFYX0hPTUUpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiNDAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9GQVhfV09SSyk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI1MCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX01PQklMRSk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI2MCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX1BBR0VSKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjcwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfT1RIRVIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiODAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DQVIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiOTAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DT01QQU5ZX01BSU4pOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTl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Ci0gICAgICAgIHRlc3RQaG9uZVZhcmlvdXNUeXBlU3VwcG9ydChWNDApOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFRlc3RzIHRoYXQgIlBSRUYicyBhcmUgZW1pdHRlZCBhcHByb3ByaWF0ZWx5LgotICAgICAqLwotICAgIHByaXZhdGUgdm9pZCB0ZXN0UGhvbmVQcmVmSGFuZGxpbmdDb21tb24oaW50IHZjYXJkVHlwZSkgewotICAgICAgICBtVmVyaWZpZXIuaW5pdEZvckV4cG9ydFRlc3QodmNhcmRUeXBlKTsKLSAgICAgICAgQ29udGFjdEVudHJ5IGVudHJ5ID0gbVZlcmlmaWVyLmFkZElucHV0RW50cnkoKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjEiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9IT01FKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjIiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9XT1JLKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuSVNfUFJJTUFSWSwgMSk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIzIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfRkFYX0hPTUUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgZW50cnkuYWRkQ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Y1Bob25lVHlwZUhhbmRsaW5nKGludCB2Y2FyZFR5cGUpIHsKLSAgICAgICAgbVZlcmlmaWVyLmluaXRGb3JFeHBvcnRUZXN0KHZjYXJkVHlwZSk7Ci0gICAgICAgIENvbnRhY3RFbnRyeSBlbnRyeSA9IG1WZXJpZmllci5hZGRJbnB1dEVudHJ5KCk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJNb2RlbSIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMiIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NVU1RPTSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLkxBQkVMLCAiTVNHIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIzIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJCQlMiKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjQiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIlZJREVPIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI1IikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjYiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIl9BVVRPX0NFTEwiKTsgIC8vIFRoZSBvbGQgaW5kaWNhdG9yIGZvciB0aGUgdHlwZSBtb2JpbGUuCi0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI3IikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJcdTY0M0FcdTVFMkYiKTsgIC8vIE1vYmlsZSBwaG9uZSBpbiBKYXBhbmVzZSBLYW5qaQotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiOCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UW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RUeXBlKSB7Ci0gICAgICAgIG1WZXJpZmllci5pbml0Rm9yRXhwb3J0VGVzdCh2Y2FyZFR5cGUpOwotICAgICAgICBDb250YWN0RW50cnkgZW50cnkgPSBtVmVyaWZpZXIuYWRkSW5wdXRFbnRyeSgpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuREFUQSwgInR5cGVfaG9tZUBleGFtcGxlLmNvbSIpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5UWVBFLCBFbWFpbC5UWVBFX0hPTUUpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuREFUQSwgInR5cGVfd29ya0BleGFtcGxlLmNvbSIpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5UWVBFLCBFbWFpbC5UWVBFX1dPUkspOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuREFUQSwgInR5cGVfbW9iaWxlQGV4YW1wbGUuY29tIikKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLlRZUEUsIEVtYWlsLlRZUEVfTU9CSUxFKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhFbWFpbC5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLkRBVEEsICJ0eXBlX290aGVyQGV4YW1wbGUuY29tIikKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLlRZUEUsIEVtYWlsLlRZUEVfT1RIRVIpOwotICAgICAgICBtVmVyaWZpZXIuYWRkUHJvcGVydHlOb2Rlc1ZlcmlmaWVyRWxlbVdpdGhFbXB0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1WZXJpZmllci5pbml0Rm9yRXhwb3J0VGVzdCh2Y2FyZFR5cGUpOwotICAgICAgICBDb250YWN0RW50cnkgZW50cnkgPSBtVmVyaWZpZXIuYWRkSW5wdXRFbnRyeSgpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKE9yZ2FuaXphdGlvbi5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KE9yZ2FuaXphdGlvbi5DT01QQU5ZLCAiQ29tcGFueVgiKQotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLkRFUEFSVE1FTlQsICJEZXBhcnRtZW50WSIpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uVElUTEUsICJUaXRsZVoiKQotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLkpPQl9ERVNDUklQVElPTiwgIkRlc2NyaXB0aW9uIFJhbWJkYSIpICAvLyBJZ25vcmVkLgotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLk9GRklDRV9MT0NBVElPTiwgIk1vdW50YWluIFZpZXciKSAgLy8gSWdub3JlZC4KLSAgICAgICAgICAgICAgICAucHV0KE9yZ2FuaXphdGlvbi5QSE9ORVRJQ19OQU1FLCAiUGhvbmV0aWNOYW1lISIpICAvLyBJZ25vcmVkCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uU1lNQk9MLCAiKF5vXikvfn4iKTsgIC8vIElnbm9yZSBoaW0gKGhlcikuCi0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoT3JnYW5pemF0aW9uLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXROdWxsKE9yZ2FuaXphdGlvbi5DT01QQU5ZKQotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLkRFUEFSVE1FTlQsICJEZXBhcnRtZW50WFgiKQotICAgICAgICAgICAgICAgIC5wd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7Ci0gICAgICAgIHRlc3RPcmdhbml6YXRpb25Db21tb24oVjIxKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCB0ZXN0T3JnYW5pemF0aW9uVjMwKCkgewotICAgICAgICB0ZXN0T3JnYW5pemF0aW9uQ29tbW9uKFYzMCk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdGVzdE9yZ2FuaXphdGlvblY0MCgpIHsKLSAgICAgICAgdGVzdE9yZ2FuaXphdGlvbkNvbW1vbihWNDApOwotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZCB0ZXN0SW1WYXJpb3VzVHlwZVN1cHBvcnRDb21tb24oaW50IHZjYXJkVHlwZSkgewotICAgICAgICBtVmVyaWZpZXIuaW5pdEZvckV4cG9ydFRlc3QodmNhcmRUeXBlKTsKLSAgICAgICAgQ29udGFjdEVudHJ5IGVudHJ5ID0gbVZlcmlmaWVyLmFkZElucHV0RW50cnkoKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhJbS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLlBST1RPQ09MLCBJbS5QUk9UT0NPTF9BSU0pCi0gICAgICAgICAgICAgICAgLnB1dChJbS5EQVRBLCAiYWltIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoSW0uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5QUk9UT0NPTCwgSW0uUFJPVE9DT0xfTVNOKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgIm1zbiIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEltLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uUFJPVE9DT0wsIEltLlBST1RPQ09MX1lBSE9PKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgInlhaG9vIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoSW0uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5QUk9UT0NPTCwgSW0uUFJPVE9DT0xfU0tZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5EQVRBLCAic2t5cGUiKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhJbS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLlBST1RPQ09MLCBJbS5QUk9UT0NPTF9RUSkKLSAgICAgICAgICAgICAgICAucHV0KEltLkRBVEEsICJxcSIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEltLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uUFJPVE9DT0wsIEltLlBST1RPQ09MX0dPT0dMRV9UQUxLKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgImdvb2dsZSB0YWxrIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoSW0uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5QUk9UT0NPTCwgSW0uUFJPVE9DT0xfSUNRKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgImljcSIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEltLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uUFJPVE9DT0wsIEltLlBST1RPQ09MX0pBQkJFUikKLSAgICAgICAgICAgICAgICAucHV0KEltLkRBVEEsICJqYWJiZXIiKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhJbS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLlBST1RPQ09MLCBJbS5QUk9UT0NPTF9ORVRNRUVUSU5HKQotICAgIC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YzMCk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdGVzdEltQmFzaWNWNDAoKSB7Ci0gICAgICAgIHRlc3RJbVZhcmlvdXNUeXBlU3VwcG9ydENvbW1vbihWNDApOwotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZCB0ZXN0SW1QcmVmSGFuZGxpbmdDb21tb24oaW50IHZjYXJkVHlwZSkgewotICAgICAgICBtVmVyaWZpZXIuaW5pdEZvckV4cG9ydFRlc3QodmNhcmRUeXBlKTsKLSAgICAgICAgQ29udGFjdEVudHJ5IGVudHJ5ID0gbVZlcmlmaWVyLmFkZElucHV0RW50cnkoKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhJbS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLlBST1RPQ09MLCBJbS5QUk9UT0NPTF9BSU0pCi0gICAgICAgICAgICAgICAgLnB1dChJbS5EQVRBLCAiYWltMSIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEltLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uUFJPVE9DT0wsIEltLlBST1RPQ09MX0FJTSkKLSAgICAgICAgICAgICAgICAucHV0KEltLkRBVEEsICJhaW0yIikKLSAgICAgICAgICAgICAgICAucHV0KEltLlRZUEUsIEltLlRZUEVfSE9NRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLklTX1BSSU1BUlksIDEpOwotCi0gICAgICAgIG1WZXJpZmllci5hZGRQcm9wZXJ0eU5vZGVzVmVyaWZpZXJFbGVtV2l0aEVtcHR5TmFtZSgpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZSgiWC1BSU0iLCAiYWltMSIpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZSgiWC1BSU0iLCAiYWltMiIsIG5ldyBUeXBlU2V0KCJIT01FIiwgIlBSRUYiKSk7Ci0gICAg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W50LlRZUEVfT1RIRVIpCi0gICAgICAgICAgICAgICAgLnB1dChFdmVudC5TVEFSVF9EQVRFLCAiMjAxOC0wMy0xMiIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEV2ZW50LkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoRXZlbnQuVFlQRSwgRXZlbnQuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChFdmVudC5MQUJFTCwgIlRoZSBsYXN0IGRheSIpCi0gICAgICAgICAgICAgICAgLnB1dChFdmVudC5TVEFSVF9EQVRFLCAiV2hlbiB0aGUgVG93ZXIgb2YgSGFub2kgd2l0aCA2NCByaW5ncyBpcyBjb21wbGV0ZWQuIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoRXZlbnQuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChFdmVudC5UWVBFLCBFdmVudC5UWVBFX0JJUlRIREFZKQotICAgICAgICAgICAgICAgIC5wdXQoRXZlbnQuU1RBUlRfREFURSwgIjIwMDktMDUtMTkiKTsgIC8vIFNob3VsZCBiZSBpZ25vcmVkLgotICAgICAgICBtVmVyaWZpZXIuYWRkUHJvcGVydHlOb2Rlc1ZlcmlmaWVyRWxlbVdpdGhFbXB0eU5hbWUoKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIkJEQVkiLCAiMjAwOC0xMC0yMiIpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZSgiWC1BTkRST0lELUNVU1RPTSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBnZXRBbmRyb2lkUHJvcFZhbHVlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudC5DT05URU5UX0lURU1fVFlQRSwgIjE5ODItMDYtMTYiLCBFdmVudC5UWVBFX0FOTklWRVJTQVJZKSkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlKCJYLUFORFJPSUQtQ1VTVE9NIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIGdldEFuZHJvaWRQcm9wVmFsdWUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50LkNPTlRFTlRfSVRFTV9UWVBFLCAiMjAxOC0wMy0xMiIsIEV2ZW50LlRZUEVfT1RIRVIpKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlgtQU5EUk9JRC1DVVNUT00iLAotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0QW5kcm9pZFByb3BWYWx1ZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnQuQ09OVEVOVF9JVEVNX1RZUEUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJXaGVuIHRoZSBUb3dlciBvZiBIYW5vaSB3aXRoIDY0IHJpbmdzIGlzIGNvbXBsZXRlZC4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudC5UWVBFX0NVU1RPTSwgIlRoZSBsYXN0IGRheSIpKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCB0ZXN0RXZlbnRWMjEoKSB7Ci0gICAgICAgIHRlc3RFdmVudENvbW1vbihWMjEpOwotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIHRlc3RFdmVudFYzMCgpIHsKLSAgICAgICAgdGVzdEV2ZW50Q29tbW9uKFYzMCk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdGVzdEV2ZW50VjQwKCkgewotICAgICAgICB0ZXN0RXZlbnRDb21tb24oVjQwKTsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQgdGVzdE5vdGVDb21tb24oaW50IHZjYXJkVHlwZSkgewotICAgICAgICBtVmVyaWZpZXIuaW5pdEZvckV4cG9ydFRlc3QodmNhcmRUeXBlKTsKLSAgICAgICAgQ29udGFjdEVudHJ5IGVudH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otICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludFtdIHNQaG90b0ludEFycmF5Rm9yQ29tcGxpY2F0ZWRDYXNlID0gewotICAgICAgICAweGZmLCAweGQ4LCAweGZmLCAweGUxLCAweDBhLCAweDBmLCAweDQ1LCAweDc4LCAweDY5LCAweDY2LCAweDAwLAotICAgICAgICAweDAwLCAweDRkLCAweDRkLCAweDAwLCAweDJhLCAweDAwLCAweDAwLCAweDAwLCAweDA4LCAweDAwLCAweDBkLAotICAgICAgICAweDAxLCAweDBlLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDBmLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweGFhLCAweDAxLCAweDBmLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDA3LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweGJhLCAweDAxLCAweDEwLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDA2LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweGMyLCAweDAxLCAweDEyLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAxLCAweDFhLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweGM4LCAweDAxLCAweDFiLCAweDAwLCAweDA1LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweGQwLCAweDAxLCAweDI4LCAweDAwLCAweDAzLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAxLCAweDMxLCAweDAwLCAweDAyLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDBlLCAweDAwLCAweDAwLCAweDAwLCAweGQ4LCAweDAxLCAweDMyLCAweDAwLAotICAgICAgICAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDE0LCAweDAwLCAweDAwLCAweDAwLCAweGU2LCAweDAyLCAweDEzLAotICAgICAgICAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDgyLAotICAgICAgICAweDk4LCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDBlLCAweDAwLCAweDAwLCAweDAwLCAweGZhLAotICAgICAgICAweDg3LCAweDY5LCAweDAwLCAweDA0LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDg0LCAweGM0LCAweGE1LCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDdjLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDA4LCAweDAwLCAweDAwLCAweDA0LCAweDFlLCAweDMyLCAweDMwLCAweDMwLCAweDM4LCAweDMxLAotICAgICAgICAweDMwLCAweDMyLCAweDM5LCAweDMxLCAweDMzLCAweDM1LCAweDM1LCAweDMzLCAweDMxLCAweDAwLCAweDAwLAotICAgICAgICAweDQ0LCAweDZmLCAweDQzLCAweDZmLCAweDRkLCAweDZmLCAweDAwLCAweDAwLCAweDQ0LCAweDM5LCAweDMwLAotICAgICAgICAweDM1LCAweDY5LCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDQ0LCAweDM5LCAweDMwLAotICAgICAgICAweDM1LCAweDY5LCAweDIwLCAweDU2LCAweDY1LCAweDcyLCAweDMxLCAweDJlLCAweDMwLCAweDMwLCAweDAwLAotICAgICAgICAweDMyLCAweDMwLCAweDMwLCAweDM4LCAweDNhLCAweDMxLCAweDMwLCAweDNhLCAweDMyLCAweDM5LCAweDIwLAotICAgICAgICAweDMxLCAweDMzLCAweDNhLCAweDM1LCAweDM1LCAweDNhLCAweDM0LCAweDM3LCAweDAwLCAweDIwLCAweDIwLAotICAgICAgICAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLAotICAgICAgICAweDAwLCAweDUwLCAweDcyLCAweDY5LCAweDZlLCAweDc0LCAweDQ5LCAweDRkLCAweDAwLCAweDMwLCAweDMzLAotICAgICAgICAweDMwLCAweDMwLCAweDAwLCAweDAwLCAweDAwLCAweDA2LCAweDAwLCAweDAxLCAweDAwLCAweDE0LCAweDAwLAotICAgICAgICAweDE0LCAweDAwLCAweDAyLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAzLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDM0LCAweDAxLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAxLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDEwLCAweDgwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDExLCAweDA5LCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDBmLCAweDBiLCAweDAwLAotICAgICAgICAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDA1LCAweDk3LCAweDAwLCAweDAwLCAweDI3LCAweDEwLAotICAgICAgICAweDAwLCAweDAwLCAweDA4LCAweGIwLCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDFjLAotICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDAyLCAweDVlLCAweDAwLCAweDAwLAotICAgICAgICAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDhiLCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLAotICAgICAgICAweDAwLCAweDAzLCAweGNiLCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDFiLCAweGU1LAotICAgICAgICAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDI4LCAweDgyLCAweDlhLCAweDAwLCAweDA1LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweDZhLCAweDgyLCAweDlkLCAweDAwLCAweDA1LAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweDcyLCAweDg4LCAweDIyLCAweDAwLAotICAgICAgICAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDkwLCAweDAwLAotICAgICAgICAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDA0LCAweDMwLCAweDMyLCAweDMyLCAweDMwLCAweDkwLAotICAgICAgICAweDAzLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDE0LCAweDAwLCAweDAwLCAweDAzLCAweDdhLAotICAgICAgICAweDkwLCAweDA0LCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDE0LCAweDAwLCAweDAwLCAweDAzLAotICAgICAgICAweDhlLCAweDkxLCAweDAxLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDA0LCAweDAxLCAweDAyLAotICAgICAgICAweDAzLCAweDAwLCAweDkxLCAweDAyLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDAzLCAweGEyLCAweDkyLCAweDAxLCAweDAwLCAweDBhLCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDAzLCAweGFhLCAweDkyLCAweDAyLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGIyLCAweDkyLCAweDA0LCAweDAwLCAweDBhLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGJhLCAweDkyLCAweDA1LCAweDAwLCAweDA1LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGMyLCAweDkyLCAweDA3LCAweDAwLCAweDAzLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDkyLCAweDA4LCAweDAwLAotICAgICAgICAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDkyLCAweDA5LAotICAgICAgICAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDkyLAotICAgICAgICAweDBhLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGNhLAotICAgICAgICAweDkyLCAweDdjLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDkyLCAweDg2LCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDE2LCAweDAwLCAweDAwLAotICAgICAgICAweDAzLCAweGQyLCAweGEwLCAweDAwLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDA0LCAweDMwLAotICAgICAgICAweDMxLCAweDMwLCAweDMwLCAweGEwLCAweDAxLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweGEwLCAweDAyLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDYwLCAweDAwLCAweDAwLCAweGEwLCAweDAzLCAweDAwLCAweDAzLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAweGEwLCAweDA1LCAweDAwLCAweDA0LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDA0LCAweDAwLCAweGEyLCAweDBlLCAweDAwLCAweDA1LAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGU4LCAweGEyLCAweDBmLCAweDAwLAotICAgICAgICAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGYwLCAweGEyLCAweDEwLAotICAgICAgICAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweGEyLAotICAgICAgICAweDE3LCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLAotICAgICAgICAweGEzLCAweDAwLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAzLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweGEzLCAweDAxLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweGE0LCAweDAxLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDAyLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDAzLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDA0LCAweDAwLCAweDA1LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGY4LCAweGE0LCAweDA1LCAweDAwLCAweDAzLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDFkLCAweDAwLCAweDAwLCAweGE0LCAweDA2LCAweDAwLCAweDAzLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDA3LCAweDAwLAotICAgICAgICAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDA4LAotICAgICAgICAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LAotICAgICAgICAweDA5LCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweGE0LCAweDBhLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweGE0LCAweDBjLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDUzLCAweDAwLAotICAgICAgICAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDAxLCAweDVlLCAweDAwLCAweDAwLCAweDAwLCAweDY0LAotICAgICAgICAweDMyLCAweDMwLCAweDMwLCAweDM4LCAweDNhLCAweDMxLCAweDMwLCAweDNhLCAweDMyLCAweDM5LCAweDIwLAotICAgICAgICAweDMxLCAweDMzLCAweDNhLCAweDM1LCAweDM1LCAweDNhLCAweDMzLCAweDMxLCAweDAwLCAweDMyLCAweDMwLAotICAgICAgICAweDMwLCAweDM4LCAweDNhLCAweDMxLCAweDMwLCAweDNhLCAweDMyLCAweDM5LCAweDIwLCAweDMxLCAweDMzLAotICAgICAgICAweDNhLCAweDM1LCAweDM1LCAweDNhLCAweDM0LCAweDM3LCAweDAwLCAweDAwLCAweDAwLCAweDI5LCAweDg4LAotICAgICAgICAweDAwLCAweDAwLCAweDFiLCAweDAwLCAweDAwLCAweDAwLCAweDAyLCAweGIyLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDY0LCAweDAwLCAweDAwLCAweDAxLCAweDVlLCAweDAwLCAweDAwLCAweDAwLCAweDY0LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDY0LCAweDAwLCAweDAwLCAweDAwLCAweDI1LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDBhLCAweDAwLCAweDAwLCAweDBlLCAweDkyLCAweDAwLCAweDAwLCAweDAzLCAweGU4LAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDMyLCAweDMwLCAweDMwLAotICAgICAgICAweDM4LCAweDMxLCAweDMwLCAweDMyLCAweDM5LCAweDMxLCAweDMzLCAweDM1LCAweDM1LCAweDMzLCAweDMxLAotICAgICAgICAweDAwLCAweDAwLCAweDIwLCAweDJhLCAweDAwLCAweDAwLCAweDAwLCAweDBhLCAweDAwLCAweDAwLCAweDJhLAotICAgICAgICAweGUyLCAweDAwLCAweDAwLCAweDAwLCAweDBhLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDA0LCAweDUyLCAweDM5LCAweDM4LCAweDAwLCAweDAwLCAweDAyLCAweDAwLCAweDA3LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDA0LCAweDMwLCAweDMxLCAweDMwLCAweDMwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDA2LCAweDAxLCAweDAzLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDA2LAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDFhLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDA0LCAweDZjLCAweDAxLCAweDFiLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDA0LCAweDc0LCAweDAxLCAweDI4LCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAyLCAweDAxLCAweDAwLCAweDA0LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDA0LCAweDdjLCAweDAyLCAweDAyLCAweDAwLCAweDA0LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDA1LCAweDhiLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDQ4LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweGZmLCAweGQ4LCAweGZmLCAweGRiLCAweDAwLCAweDg0LAotICAgICAgICAweDAwLCAweDIwLCAweDE2LCAweDE4LCAweDFjLCAweDE4LCAweDE0LCAweDIwLCAweDFjLCAweDFhLCAweDFjLAotICAgICAgICAweDI0LCAweDIyLCAweDIwLCAweDI2LCAweDMwLCAweDUwLCAweDM0LCAweDMwLCAweDJjLCAweDJjLCAweDMwLAotICAgICAgICAweDYyLCAweDQ2LCAweDRhLCAweDNhLCAweDUwLCAweDc0LCAweDY2LCAweDdhLCAweDc4LCAweDcyLCAweDY2LAotICAgICAgICAweDcwLCAweDZlLCAweDgwLCAweDkwLCAweGI4LCAweDljLCAweDgwLCAweDg4LCAweGFlLCAweDhhLCAweDZlLAotICAgICAgICAweDcwLCAweGEwLCAweGRhLCAweGEyLCAweGFlLCAweGJlLCAweGM0LCAweGNlLCAweGQwLCAweGNlLCAweDdjLAotICAgICAgICAweDlhLCAweGUyLCAweGYyLCAweGUwLCAweGM4LCAweGYwLCAweGI4LCAweGNhLCAweGNlLCAweGM2LCAweDAxLAotICAgICAgICAweDIyLCAweDI0LCAweDI0LCAweDMwLCAweDJhLCAweDMwLCAweDVlLCAweDM0LCAweDM0LCAweDVlLCAweGM2LAotICAgICAgICAweDg0LCAweDcwLCAweDg0LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LAotICAgICAgICAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LAotICAgICAgICAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LAotICAgICAgICAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LAotICAgICAgICAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGZmLCAweGMwLAotICAgICAgICAweDAwLCAweDExLCAweDA4LCAweDAwLCAweDc4LCAweDAwLCAweGEwLCAweDAzLCAweDAxLCAweDIxLCAweDAwLAotICAgICAgICAweDAyLCAweDExLCAweDAxLCAweDAzLCAweDExLCAweDAxLCAweGZmLCAweGM0LCAweDAxLCAweGEyLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDA1LCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LAotICAgICAgICAweDA2LCAweDA3LCAweDA4LCAweDA5LCAweDBhLCAweDBiLCAweDEwLCAweDAwLCAweDAyLCAweDAxLCAweDAzLAotICAgICAgICAweDAzLCAweDAyLCAweDA0LCAweDAzLCAweDA1LCAweDA1LCAweDA0LCAweDA0LCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDdkLCAweDAxLCAweDAyLCAweDAzLCAweDAwLCAweDA0LCAweDExLCAweDA1LCAweDEyLCAweDIxLCAweDMxLAotICAgICAgICAweDQxLCAweDA2LCAweDEzLCAweDUxLCAweDYxLCAweDA3LCAweDIyLCAweDcxLCAweDE0LCAweDMyLCAweDgxLAotICAgICAgICAweDkxLCAweGExLCAweDA4LCAweDIzLCAweDQyLCAweGIxLCAweGMxLCAweDE1LCAweDUyLCAweGQxLCAweGYwLAotICAgICAgICAweDI0LCAweDMzLCAweDYyLCAweDcyLCAweDgyLCAweDA5LCAweDBhLCAweDE2LCAweDE3LCAweDE4LCAweDE5LAotICAgICAgICAweDFhLCAweDI1LCAweDI2LCAweDI3LCAweDI4LCAweDI5LCAweDJhLCAweDM0LCAweDM1LCAweDM2LCAweDM3LAotICAgICAgICAweDM4LCAweDM5LCAweDNhLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LCAweDQ4LCAweDQ5LCAweDRhLAotICAgICAgICAweDUzLCAweDU0LCAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LAotICAgICAgICAweDY2LCAweDY3LCAweDY4LCAweDY5LCAweDZhLCAweDczLCAweDc0LCAweDc1LCAweDc2LCAweDc3LCAweDc4LAotICAgICAgICAweDc5LCAweDdhLCAweDgzLCAweDg0LCAweDg1LCAweDg2LCAweDg3LCAweDg4LCAweDg5LCAweDhhLCAweDkyLAotICAgICAgICAweDkzLCAweDk0LCAweDk1LCAweDk2LCAweDk3LCAweDk4LCAweDk5LCAweDlhLCAweGEyLCAweGEzLCAweGE0LAotICAgICAgICAweGE1LCAweGE2LCAweGE3LCAweGE4LCAweGE5LCAweGFhLCAweGIyLCAweGIzLCAweGI0LCAweGI1LCAweGI2LAotICAgICAgICAweGI3LCAweGI4LCAweGI5LCAweGJhLCAweGMyLCAweGMzLCAweGM0LCAweGM1LCAweGM2LCAweGM3LCAweGM4LAotICAgICAgICAweGM5LCAweGNhLCAweGQyLCAweGQzLCAweGQ0LCAweGQ1LCAweGQ2LCAweGQ3LCAweGQ4LCAweGQ5LCAweGRhLAotICAgICAgICAweGUxLCAweGUyLCAweGUzLCAweGU0LCAweGU1LCAweGU2LCAweGU3LCAweGU4LCAweGU5LCAweGVhLCAweGYxLAotICAgICAgICAweGYyLCAweGYzLCAweGY0LCAweGY1LCAweGY2LCAweGY3LCAweGY4LCAweGY5LCAweGZhLCAweDAxLCAweDAwLAotICAgICAgICAweDAzLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LCAweDA2LAotICAgICAgICAweDA3LCAweDA4LCAweDA5LCAweDBhLCAweDBiLCAweDExLCAweDAwLCAweDAyLCAweDAxLCAweDAyLCAweDA0LAotICAgICAgICAweDA0LCAweDAzLCAweDA0LCAweDA3LCAweDA1LCAweDA0LCAweDA0LCAweDAwLCAweDAxLCAweDAyLCAweDc3LAotICAgICAgICAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDExLCAweDA0LCAweDA1LCAweDIxLCAweDMxLCAweDA2LCAweDEyLAotICAgICAgICAweDQxLCAweDUxLCAweDA3LCAweDYxLCAweDcxLCAweDEzLCAweDIyLCAweDMyLCAweDgxLCAweDA4LCAweDE0LAotICAgICAgICAweDQyLCAweDkxLCAweGExLCAweGIxLCAweGMxLCAweDA5LCAweDIzLCAweDMzLCAweDUyLCAweGYwLCAweDE1LAotICAgICAgICAweDYyLCAweDcyLCAweGQxLCAweDBhLCAweDE2LCAweDI0LCAweDM0LCAweGUxLCAweDI1LCAweGYxLCAweDE3LAotICAgICAgICAweDE4LCAweDE5LCAweDFhLCAweDI2LCAweDI3LCAweDI4LCAweDI5LCAweDJhLCAweDM1LCAweDM2LCAweDM3LAotICAgICAgICAweDM4LCAweDM5LCAweDNhLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LCAweDQ4LCAweDQ5LCAweDRhLAotICAgICAgICAweDUzLCAweDU0LCAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LAotICAgICAgICAweDY2LCAweDY3LCAweDY4LCAweDY5LCAweDZhLCAweDczLCAweDc0LCAweDc1LCAweDc2LCAweDc3LCAweDc4LAotICAgICAgICAweDc5LCAweDdhLCAweDgyLCAweDgzLCAweDg0LCAweDg1LCAweDg2LCAweDg3LCAweDg4LCAweDg5LCAweDhhLAotICAgICAgICAweDkyLCAweDkzLCAweDk0LCAweDk1LCAweDk2LCAweDk3LCAweDk4LCAweDk5LCAweDlhLCAweGEyLCAweGEzLAotICAgICAgICAweGE0LCAweGE1LCAweGE2LCAweGE3LCAweGE4LCAweGE5LCAweGFhLCAweGIyLCAweGIzLCAweGI0LCAweGI1LAotICAgICAgICAweGI2LCAweGI3LCAweGI4LCAweGI5LCAweGJhLCAweGMyLCAweGMzLCAweGM0LCAweGM1LCAweGM2LCAweGM3LAotICAgICAgICAweGM4LCAweGM5LCAweGNhLCAweGQyLCAweGQzLCAweGQ0LCAweGQ1LCAweGQ2LCAweGQ3LCAweGQ4LCAweGQ5LAotICAgICAgICAweGRhLCAweGUyLCAweGUzLCAweGU0LCAweGU1LCAweGU2LCAweGU3LCAweGU4LCAweGU5LCAweGVhLCAweGYyLAotICAgICAgICAweGYzLCAweGY0LCAweGY1LCAweGY2LCAweGY3LCAweGY4LCAweGY5LCAweGZhLCAweGZmLCAweGRhLCAweDAwLAotICAgICAgICAweDBjLCAweDAzLCAweDAxLCAweDAwLCAweDAyLCAweDExLCAweDAzLCAweDExLCAweDAwLCAweDNmLCAweDAwLAotICAgICAgICAweDE0LCAweDU0LCAweGFhLCAweDJhLCAweDQ2LCAweDQ4LCAweGEyLCAweGE0LCAweDU1LCAweGE2LCAweDA0LAotICAgICAgICAweDhhLCAweDI5LCAweGUwLCAweDUzLCAweDEwLCAweGUwLCAweDI5LCAweGMwLCAweDUwLCAweDAzLCAweGIxLAotICAgICAgICAweDQ2LCAweDI5LCAweDgwLCAweDg0LCAweDUyLCAweDExLCAweDQwLCAweDBkLCAweDIyLCAweDlhLCAweDQ1LAotICAgICAgICAweDIwLCAweDIzLCAweDYxLCAweDUxLCAweDMwLCAweGEwLCAweDA4LCAweGM4LCAweGE4LCAweGQ4LCAweDUyLAotICAgICAgICAweDAyLCAweDI2LCAweDE1LCAweDBiLCAweDBhLCAweDAwLCAweGI0LCAweGEyLCAweGE1LCAweDVhLCAweDAwLAotICAgICAgICAweDkxLCAweDQ1LCAweDRhLCAweGEyLCAweDgxLCAweDkyLCAweDAxLCAweDRlLCAweDAyLCAweDk4LCAweDg3LAotICAgICAgICAweDBhLCAweDcwLCAweGEwLCAweDA3LCAweDYyLCAweDhjLCAweDUwLCAweDIxLCAweDBkLCAweDI1LCAweDAwLAotICAgICAgICAweDM0LCAweDhhLCAweDYxLCAweDE0LCAweDBjLCAweDYzLCAweDBhLCAweDg5LCAweDg1LCAweDAwLCAweDQ2LAotICAgICAgICAweGQ1LCAweDFiLCAweDUyLCAweDAyLCAweDE2LCAweGE4LCAweDk4LCAweDUwLCAweDA1LCAweDk0LCAweGE5LAotICAgICAgICAweDE2LCAweDgwLCAweDI1LCAweDVhLCAweDk1LCAweDY4LCAweDE4LCAweGYxLCAweDRmLCAweDE0LCAweGM0LAotICAgICAgICAweDNiLCAweGI1LCAweDIyLCAweGI2LCAweDM4LCAweDM0LCAweDAwLCAweGUzLCAweDIyLCAweDhlLCAweGY0LAotICAgICAgICAweDc5LCAweDhhLCAweDdiLCAweGQxLCAweDcxLCAweDAzLCAweDMwLCAweGM3LCAweDE0LCAweDgzLCAweGE1LAotICAgICAgICAweDAwLCAweDA2LCAweDk4LCAweDY4LCAweDAxLCAweDhkLCAweDUxLCAweDM1LCAweDAzLCAweDIyLCAweDZhLAotICAgICAgICAweDhkLCAweGE5LCAweDAxLCAweDEzLCAweDU0LCAweDRkLCAweDQwLCAweDEzLCAweGE1LCAweDRhLCAweDI4LAotICAgICAgICAweDAyLCAweDQ1LCAweDM1LCAweDJhLCAweDlhLCAweDAwLCAweDc4LCAweDM0LCAweGYwLCAweDY5LCAweDgwLAotICAgICAgICAweDM0LCAweDgxLCAweDQ1LCAweDQwLCAweGNlLCAweDU4LCAweGU2LCAweGEyLCAweDRjLCAweDA2LCAweGU0LAotICAgICAgICAweGZhLCAweGQxLCAweDkzLCAweDUwLCAweDIxLCAweGNhLCAweGU0LCAweDU1LCAweDg0LCAweDkwLCAweDMwLAotICAgICAgICAweGFiLCAweDhiLCAweDE4LCAweGE2LCAweDlhLCAweDZhLCAweGM0LCAweDMxLCAweGFhLCAweDI2LCAweGEwLAotICAgICAgICAweDY0LCAweDRkLCAweDUxLCAweGI1LCAweDIwLCAweDIzLCAweDZhLCAweDg5LCAweGE4LCAweDAyLCAweDQ0LAotICAgICAgICAweDM1LCAweDJhLCAweDlhLCAweDAwLCAweDk1LCAweDRkLCAweDQ4LCAweGE2LCAweDgwLCAweDI0LCAweDUzLAotICAgICAgICAweDRlLCAweGNlLCAweDA1LCAweDMwLCAweDJiLCAweDNiLCAweGVlLCAweDZhLCAweDkxLCAweDVkLCAweDc2LAotICAgICAgICAweDYzLCAweGJkLCAweDY1LCAweDdkLCAweDQwLCAweDY2LCAweDY4LCAweGE5LCAweDAyLCAweDQ1LCAweDJiLAotICAgICAgICAweGIzLCAweDllLCAweGI0LCAweGM1LCAweDZkLCAweGFkLCAweDlhLCAweGEwLCAweDJjLCAweDA2LCAweGM4LAotICAgICAgICAweGNkLCAweDA0LCAweGQ2LCAweGEyLCAweDIzLCAweDYzLCAweDUxLCAweGIxLCAweGEwLCAweDY0LCAweDRkLAotICAgICAgICAweDUxLCAweDkzLCAweDQ4LCAweDA4LCAweGRhLCAweGEyLCAweDZhLCAweDAwLCAweDcyLCAweDFhLCAweDk5LAotICAgICAgICAweDRkLCAweDAwLCAweDQ4LCAweGE2LCAweGE0LCAweDUzLCAweDRjLCAweDA3LCAweDg2LCAweDAzLCAweGJkLAotICAgICAgICAweDJiLCAweDljLCAweGE3LCAweDE0LCAweDk4LCAweDEwLCAweDg1LCAweDM0LCAweGUwLCAweGE2LCAweGIzLAotICAgICAgICAweGIwLCAweDBiLCAweGI1LCAweGE4LCAweDBhLCAweGQ0LCAweDU4LCAweDQyLCAweGVkLCAweDNlLCAweDk0LAotICAgICAgICAweGQyLCAweGE2LCAweDhiLCAweDAxLCAweDM0LCAweDQ0LCAweGVkLCAweGU2LCAweDljLCAweDRkLCAweDZhLAotICAgICAgICAweDgwLCAweDhkLCAweDhkLCAweDQ2LCAweGM2LCAweDgwLCAweDIzLCAweDYzLCAweDUxLCAweDlhLCAweDA2LAotICAgICAgICAweDQ2LCAweGQ1LCAweDEzLCAweDUyLCAweDAxLCAweDU0LCAweGQ0LCAweGFhLCAweDY4LCAweDAyLCAweDQwLAotICAgICAgICAweDZhLCAweDQwLCAweDc4LCAweGEwLCAweDA4LCAweDU5LCAweGNlLCAweGVlLCAweGI1LCAweDJhLCAweDM5LAotICAgICAgICAweGQ5LCAweDU5LCAweGE3LCAweGE4LCAweDAwLCAweDczLCAweGViLCAweDRlLCAweDBlLCAweDdkLCAweDY5LAotICAgICAgICAweDVjLCAweDA1LCAweGYzLCAweDBmLCAweGFkLCAweDFlLCAweDYxLCAweGY1LCAweGE3LCAweDcxLCAweDBiLAotICAgICAgICAweGU2LCAweDM1LCAweDIxLCAweDkwLCAweGQzLCAweGI4LCAweDBlLCAweDMyLCAweDEwLCAweDk1LCAweDEwLAotICAgICAgICAweDkxLCAweGIzLCAweGQ2LCAweDliLCAweDYwLCAweDRiLCAweDljLCAweDhhLCAweDYzLCAweDFhLCAweGIwLAotICAgICAgICAweDE4LCAweDRkLCAweDQ2LCAweGM2LCAweDgwLCAweDIyLCAweDZhLCAweDYxLCAweGE0LCAweDMxLCAweGFhLAotICAgICAgICAweDZhLCAweDU1LCAweDM0LCAweDAxLCAweDJhLCAweDlhLCAweDdlLCAweDc4LCAweGEwLCAweDA4LCAweDA5LAotICAgICAgICAweGY5LCAweGFhLCAweDU4LCAweGNmLCAweGNhLCAweDZiLCAweDNlLCAweGEwLCAweDAwLCAweGQzLCAweDgxLAotICAgICAgICAweGE5LCAweDAxLCAweDczLCAweDQ2LCAweDY5LCAweDgwLCAweGI5LCAweGE0LCAweGNkLCAweDAwLCAweDJiLAotICAgICAgICAweDFmLCAweDkyLCAweGEzLCAweDA3LCAweDlhLCAweDZmLCAweDcwLCAweDI2LCAweGNmLCAweDE0LCAweGQyLAotICAgICAgICAweDZiLCAweDUxLCAweDBjLCAweDYzLCAweDUxLCAweGIxLCAweGEwLCAweDA4LCAweGRhLCAweDk4LCAweDY5LAotICAgICAgICAweDBjLCAweDhkLCAweDRkLCAweDRhLCAweGE2LCAweDgwLCAweDI0LCAweDUzLCAweDUyLCAweDAzLCAweGM1LAotICAgICAgICAweDAyLCAweDIxLCAweDI3LCAweGU2LCAweGE5LCAweDIzLCAweDNmLCAweDI5LCAweGFjLCAweGZhLCAweDhjLAotICAgICAgICAweDAxLCAweGU2LCAweDljLCAweDBkLCAweDQ4LCAweDBhLCAweDBkLCAweDJlLCAweDY4LCAweDAxLCAweDczLAotICAgICAgICAweDQ5LCAweDlhLCAweDYwLCAweDJiLCAweDFmLCAweDkyLCAweDk4LCAweDNhLCAweGQzLCAweDdiLCAweDgxLAotICAgICAgICAweDM2LCAweDc4LCAweGE2LCAweDkzLCAweDVhLCAweDg4LCAweDhjLCAweDlhLCAweDYzLCAweDFhLCAweDAwLAotICAgICAgICAweDhjLCAweGQzLCAweDBkLCAweDIxLCAweDkxLCAweDI5LCAweGE5LCAweDE0LCAweGQwLCAweDA0LCAweDhhLAotICAgICAgICAweDY5LCAweGUwLCAweGQzLCAweDExLCAweDFiLCAweDFlLCAweDZhLCAweDQ4LCAweGNmLCAweGNhLCAweDZiLAotICAgICAgICAweDNlLCAweGEzLCAweDEwLCAweDFhLCAweDcwLCAweDM1LCAweDIwLCAweDM4LCAweDFhLCAweDVjLCAweGQyLAotICAgICAgICAweDAxLCAweDczLCAweDQ5LCAweDlhLCAweDYwLCAweDM5LCAweDhmLCAweGNhLCAweDI5LCAweDhiLCAweGY3LAotICAgICAgICAweGFhLCAweGJhLCAweDg4LCAweDk2LCAweDlhLCAweDZiLCAweDQwLCAweDE4LCAweGM2LCAweGEzLCAweDI2LAotICAgICAgICAweDgwLCAweDE4LCAweDY5LCAweGE2LCAweDkwLCAweGM4LCAweDE0LCAweGQ0LCAweDhhLCAweDY5LCAweDgwLAotICAgICAgICAweGYwLCAweDZhLCAweDQwLCAweDY4LCAweDEwLCAweGJiLCAweDQxLCAweGE3LCAweGUzLCAweDBiLCAweGM1LAotICAgICAgICAweDJiLCAweDAxLCAweDEwLCAweGE3LCAweDAzLCAweDU5LCAweDBjLCAweDc2LCAweDY5LCAweDczLCAweDQwLAotICAgICAgICAweDBiLCAweDlhLCAweDI4LCAweDExLCAweDI4LCAweDE5LCAweDVlLCAweDY5LCAweDAyLCAweDgxLCAweDVhLAotICAgICAgICAweGQ4LCAweDAwLCAweGQzLCAweDRkLCAweDUwLCAweDBjLCAweDZhLCAweDhjLCAweGQyLCAweDAxLCAweGE2LAotICAgICAgICAweDk4LCAweDY5LCAweDBjLCAweGFlLCAweGE2LCAweGE0LCAweDA2LCAweDgwLCAweDFlLCAweGE2LCAweDllLAotICAgICAgICAweDBkLCAweDMxLCAweDEyLCAweDAzLCAweDRmLCAweDA2LCAweDgwLCAweDEzLCAweDYwLCAweDM0LCAweGQzLAotICAgICAgICAweGMxLCAweGE4LCAweDkyLCAweDAxLCAweGYxLCAweDhkLCAweGRkLCAweDY5LCAweGNjLCAweGExLCAweDY5LAotICAgICAgICAweDViLCAweDRiLCAweDgwLCAweDgzLCAweDkzLCAweDUyLCAweDA0LCAweDE0LCAweGUyLCAweGFlLCAweDAzLAotICAgICAgICAweGE5LCAweDBkLCAweDY4LCAweDAzLCAweDRkLCAweDM0LCAweGQwLCAweDAzLCAweDBkLCAweDMwLCAweGQyLAotICAgICAgICAweDAxLCAweDg2LCAweDlhLCAweDY4LCAweDE5LCAweDU4LCAweDFhLCAweDc4LCAweGE0LCAweDA0LCAweDhhLAotICAgICAgICAweDY5LCAweGUwLCAweGQzLCAweDEwLCAweGUwLCAweDY5LCAweGUwLCAweGQwLCAweDAzLCAweGMxLCAweGE4LAotICAgICAgICAweGRiLCAweGFkLCAweDRjLCAweDgxLCAweDEyLCAweDQ1LCAweGQ2LCAweDlkLCAweDI1LCAweDFkLCAweDAwLAotICAgICAgICAweDZhLCAweGY1LCAweGE5LCAweGU4LCAweDgwLCAweDMxLCAweDI5LCAweDBkLCAweDU4LCAweDA4LCAweDY5LAotICAgICAgICAweDg2LCAweDgwLCAweDFhLCAweDY5LCAweDg2LCAweDkwLCAweDBjLCAweDM0LCAweGQzLCAweDQ4LCAweDY1LAotICAgICAgICAweDUxLCAweDRmLCAweDA2LCAweDk4LCAweDBmLCAweDE0LCAweGYwLCAweDY4LCAweDEwLCAweGYwLCAweDY5LAotICAgICAgICAweGUwLCAweGQwLCAweDAzLCAweDgxLCAweGE1LCAweDJiLCAweDlhLCAweDFhLCAweGI4LCAweDg3LCAweGE4LAotICAgICAgICAweGRiLCAweDRhLCAweDQ2LCAweDY4LCAweGI2LCAweDgwLCAweDJhLCAweGE4LCAweDE0LCAweGVhLCAweDEyLAotICAgICAgICAweGIwLCAweDA1LCAweDIxLCAweGE2LCAweDAyLCAweDFhLCAweDYxLCAweGEwLCAweDA2LCAweDlhLCAweDYxLAotICAgICAgICAweGE0LCAweDMxLCAweDg2LCAweDlhLCAweDY5LCAweDBjLCAweGE4LCAweDBkLCAweDNjLCAweDUzLCAweDAxLAotICAgICAgICAweGUyLCAweDllLCAweDI4LCAweDEwLCAweGYxLCAweDRlLCAweDA2LCAweDk4LCAweDBmLCAweDA2LCAweDllLAotICAgICAgICAweDBkLCAweDAyLCAweDFjLCAweDI5LCAweGMyLCAweDgwLCAweDE2LCAweDk2LCAweDgwLCAweDBhLCAweDRhLAotICAgICAgICAweDAwLCAweDQzLCAweDRkLCAweDM0LCAweDBjLCAweDYxLCAweGE2LCAweDFhLCAweDQwLCAweDM0LCAweGQzLAotICAgICAgICAweDRkLCAweDIxLCAweDgwLCAweGZmLCAweGQ5LCAweGZmLCAweGRiLCAweDAwLCAweDg0LCAweDAwLCAweDBhLAotICAgICAgICAweDA3LCAweDA3LCAweDA4LCAweDA3LCAweDA2LCAweDBhLCAweDA4LCAweDA4LCAweDA4LCAweDBiLCAweDBhLAotICAgICAgICAweDBhLCAweDBiLCAweDBlLCAweDE4LCAweDEwLCAweDBlLCAweDBkLCAweDBkLCAweDBlLCAweDFkLCAweDE1LAotICAgICAgICAweDE2LCAweDExLCAweDE4LCAweDIzLCAweDFmLCAweDI1LCAweDI0LCAweDIyLCAweDFmLCAweDIyLCAweDIxLAotICAgICAgICAweDI2LCAweDJiLCAweDM3LCAweDJmLCAweDI2LCAweDI5LCAweDM0LCAweDI5LCAweDIxLCAweDIyLCAweDMwLAotICAgICAgICAweDQxLCAweDMxLCAweDM0LCAweDM5LCAweDNiLCAweDNlLCAweDNlLCAweDNlLCAweDI1LCAweDJlLCAweDQ0LAotICAgICAgICAweDQ5LCAweDQzLCAweDNjLCAweDQ4LCAweDM3LCAweDNkLCAweDNlLCAweDNiLCAweDAxLCAweDBhLCAweDBiLAotICAgICAgICAweDBiLCAweDBlLCAweDBkLCAweDBlLCAweDFjLCAweDEwLCAweDEwLCAweDFjLCAweDNiLCAweDI4LCAweDIyLAotICAgICAgICAweDI4LCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLAotICAgICAgICAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLAotICAgICAgICAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLAotICAgICAgICAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLAotICAgICAgICAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweGZmLCAweGMwLCAweDAwLCAweDExLAotICAgICAgICAweDA4LCAweDAwLCAweDQ4LCAweDAwLCAweDYwLCAweDAzLCAweDAxLCAweDIxLCAweDAwLCAweDAyLCAweDExLAotICAgICAgICAweDAxLCAweDAzLCAweDExLCAweDAxLCAweGZmLCAweGM0LCAweDAxLCAweGEyLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDA1LCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LCAweDA2LCAweDA3LAotICAgICAgICAweDA4LCAweDA5LCAweDBhLCAweDBiLCAweDEwLCAweDAwLCAweDAyLCAweDAxLCAweDAzLCAweDAzLCAweDAyLAotICAgICAgICAweDA0LCAweDAzLCAweDA1LCAweDA1LCAweDA0LCAweDA0LCAweDAwLCAweDAwLCAweDAxLCAweDdkLCAweDAxLAotICAgICAgICAweDAyLCAweDAzLCAweDAwLCAweDA0LCAweDExLCAweDA1LCAweDEyLCAweDIxLCAweDMxLCAweDQxLCAweDA2LAotICAgICAgICAweDEzLCAweDUxLCAweDYxLCAweDA3LCAweDIyLCAweDcxLCAweDE0LCAweDMyLCAweDgxLCAweDkxLCAweGExLAotICAgICAgICAweDA4LCAweDIzLCAweDQyLCAweGIxLCAweGMxLCAweDE1LCAweDUyLCAweGQxLCAweGYwLCAweDI0LCAweDMzLAotICAgICAgICAweDYyLCAweDcyLCAweDgyLCAweDA5LCAweDBhLCAweDE2LCAweDE3LCAweDE4LCAweDE5LCAweDFhLCAweDI1LAotICAgICAgICAweDI2LCAweDI3LCAweDI4LCAweDI5LCAweDJhLCAweDM0LCAweDM1LCAweDM2LCAweDM3LCAweDM4LCAweDM5LAotICAgICAgICAweDNhLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LCAweDQ4LCAweDQ5LCAweDRhLCAweDUzLCAweDU0LAotICAgICAgICAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LCAweDY2LCAweDY3LAotICAgICAgICAweDY4LCAweDY5LCAweDZhLCAweDczLCAweDc0LCAweDc1LCAweDc2LCAweDc3LCAweDc4LCAweDc5LCAweDdhLAotICAgICAgICAweDgzLCAweDg0LCAweDg1LCAweDg2LCAweDg3LCAweDg4LCAweDg5LCAweDhhLCAweDkyLCAweDkzLCAweDk0LAotICAgICAgICAweDk1LCAweDk2LCAweDk3LCAweDk4LCAweDk5LCAweDlhLCAweGEyLCAweGEzLCAweGE0LCAweGE1LCAweGE2LAotICAgICAgICAweGE3LCAweGE4LCAweGE5LCAweGFhLCAweGIyLCAweGIzLCAweGI0LCAweGI1LCAweGI2LCAweGI3LCAweGI4LAotICAgICAgICAweGI5LCAweGJhLCAweGMyLCAweGMzLCAweGM0LCAweGM1LCAweGM2LCAweGM3LCAweGM4LCAweGM5LCAweGNhLAotICAgICAgICAweGQyLCAweGQzLCAweGQ0LCAweGQ1LCAweGQ2LCAweGQ3LCAweGQ4LCAweGQ5LCAweGRhLCAweGUxLCAweGUyLAotICAgICAgICAweGUzLCAweGU0LCAweGU1LCAweGU2LCAweGU3LCAweGU4LCAweGU5LCAweGVhLCAweGYxLCAweGYyLCAweGYzLAotICAgICAgICAweGY0LCAweGY1LCAweGY2LCAweGY3LCAweGY4LCAweGY5LCAweGZhLCAweDAxLCAweDAwLCAweDAzLCAweDAxLAotICAgICAgICAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LCAweDA2LCAweDA3LCAweDA4LAotICAgICAgICAweDA5LCAweDBhLCAweDBiLCAweDExLCAweDAwLCAweDAyLCAweDAxLCAweDAyLCAweDA0LCAweDA0LCAweDAzLAotICAgICAgICAweDA0LCAweDA3LCAweDA1LCAweDA0LCAweDA0LCAweDAwLCAweDAxLCAweDAyLCAweDc3LCAweDAwLCAweDAxLAotICAgICAgICAweDAyLCAweDAzLCAweDExLCAweDA0LCAweDA1LCAweDIxLCAweDMxLCAweDA2LCAweDEyLCAweDQxLCAweDUxLAotICAgICAgICAweDA3LCAweDYxLCAweDcxLCAweDEzLCAweDIyLCAweDMyLCAweDgxLCAweDA4LCAweDE0LCAweDQyLCAweDkxLAotICAgICAgICAweGExLCAweGIxLCAweGMxLCAweDA5LCAweDIzLCAweDMzLCAweDUyLCAweGYwLCAweDE1LCAweDYyLCAweDcyLAotICAgICAgICAweGQxLCAweDBhLCAweDE2LCAweDI0LCAweDM0LCAweGUxLCAweDI1LCAweGYxLCAweDE3LCAweDE4LCAweDE5LAotICAgICAgICAweDFhLCAweDI2LCAweDI3LCAweDI4LCAweDI5LCAweDJhLCAweDM1LCAweDM2LCAweDM3LCAweDM4LCAweDM5LAotICAgICAgICAweDNhLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LCAweDQ4LCAweDQ5LCAweDRhLCAweDUzLCAweDU0LAotICAgICAgICAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LCAweDY2LCAweDY3LAotICAgICAgICAweDY4LCAweDY5LCAweDZhLCAweDczLCAweDc0LCAweDc1LCAweDc2LCAweDc3LCAweDc4LCAweDc5LCAweDdhLAotICAgICAgICAweDgyLCAweDgzLCAweDg0LCAweDg1LCAweDg2LCAweDg3LCAweDg4LCAweDg5LCAweDhhLCAweDkyLCAweDkzLAotICAgICAgICAweDk0LCAweDk1LCAweDk2LCAweDk3LCAweDk4LCAweDk5LCAweDlhLCAweGEyLCAweGEzLCAweGE0LCAweGE1LAotICAgICAgICAweGE2LCAweGE3LCAweGE4LCAweGE5LCAweGFhLCAweGIyLCAweGIzLCAweGI0LCAweGI1LCAweGI2LCAweGI3LAotICAgICAgICAweGI4LCAweGI5LCAweGJhLCAweGMyLCAweGMzLCAweGM0LCAweGM1LCAweGM2LCAweGM3LCAweGM4LCAweGM5LAotICAgICAgICAweGNhLCAweGQyLCAweGQzLCAweGQ0LCAweGQ1LCAweGQ2LCAweGQ3LCAweGQ4LCAweGQ5LCAweGRhLCAweGUyLAotICAgICAgICAweGUzLCAweGU0LCAweGU1LCAweGU2LCAweGU3LCAweGU4LCAweGU5LCAweGVhLCAweGYyLCAweGYzLCAweGY0LAotICAgICAgICAweGY1LCAweGY2LCAweGY3LCAweGY4LCAweGY5LCAweGZhLCAweGZmLCAweGRhLCAweDAwLCAweDBjLCAweDAzLAotICAgICAgICAweDAxLCAweDAwLCAweDAyLCAweDExLCAweDAzLCAweDExLCAweDAwLCAweDNmLCAweDAwLCAweDllLCAweGQyLAotICAgICAgICAweDJlLCAweDA3LCAweDE1LCAweGFmLCAweDZkLCAweDA4LCAweGUyLCAweGIzLCAweDQ1LCAweDFhLCAweGY2LAotICAgICAgICAweGQwLCAweDAwLCAweDAxLCAweGM1LCAweDY4LCAweDQ1LCAweDE3LCAweDRhLCAweGI0LCAweDIyLCAweGU0LAotICAgICAgICAweDcwLCAweDhjLCAweDc0LCAweGE5LCAweDNjLCAweGExLCAweDhlLCAweDk1LCAweDQ4LCAweDk2LCAweDMxLAotICAgICAgICAweGUyLCAweDE4LCAweGU5LCAweDU1LCAweGE1LCAweDhjLCAweDdhLCAweDUwLCAweDA1LCAweDBiLCAweDg4LAotICAgICAgICAweDg2LCAweDBmLCAweDE1LCAweDhmLCAweDc1LCAweDFmLCAweDI2LCAweDkzLCAweDE5LCAweDkxLCAweDc3LAotICAgICAgICAweDE4LCAweGMxLCAweGFjLCAweDRiLCAweGM4LCAweGZhLCAweGQ2LCAweDYzLCAweDM3LCAweDZkLCAweDMxLAotICAgICAgICAweGI0LCAweDczLCAweDViLCAweDM2LCAweGEwLCAweDFjLCAweDUwLCAweDgwLCAweGQ3LCAweDgzLCAweGEwLAotICAgICAgICAweGFiLCAweGQxLCAweDYyLCAweGFkLCAweDA5LCAweDhmLCAweDE3LCAweDI5LCAweDAzLCAweGIyLCAweGNjLAotICAgICAgICAweGUwLCAweDc3LCAweDE0LCAweGEzLCAweDU2LCAweGIzLCAweDI3LCAweDFlLCAweDY3LCAweGU5LCAweDUyLAotICAgICAgICAweGVhLCAweGM2LCAweDNhLCAweDM2LCAweDQ4LCAweGVmLCAweDNkLCAweDI3LCAweDcwLCAweDIyLCAweDYwLAotICAgICAgICAweDQ3LCAweDUyLCAweDY5LCAweGIyLCAweGUyLCAweGFkLCAweDNiLCAweGVhLCAweDgwLCAweGEzLCAweDM4LAotICAgICAgICAweGUwLCAweGQ2LCAweDNkLCAweGQ4LCAweDFjLCAweGQwLCAweGNhLCAweDQ2LCAweDNkLCAweGQwLCAweDE4LAotICAgICAgICAweDM1LCAweDg5LCAweDc4LCAweGEzLCAweDlhLCAweGNkLCAweDhjLCAweGQyLCAweGIzLCAweDkzLCAweDJhLAotICAgICAgICAweDJiLCAweDY2LCAweGQ1LCAweGYxLCAweDhhLCAweDEwLCAweDFhLCAweGQ2LCAweGYyLCAweDAzLCAweDhhLAotICAgICAgICAweDllLCAweGU2LCAweGY0LCAweDVhLCAweGRiLCAweGVmLCAweGZlLCAweDIzLCAweGMwLCAweGE3LCAweDI3LAotICAgICAgICAweGNiLCAweDE2LCAweGM0LCAweGNjLCAweGRkLCAweGUyLCAweDc4LCAweDlhLCAweDY5LCAweDY2LCAweGNjLAotICAgICAgICAweDk5LCAweGUxLCAweDRkLCAweDQ3LCAweGJhLCAweGJjLCAweGQ5LCAweDZhLCAweGVlLCAweDI2LCAweDU5LAotICAgICAgICAweDU5LCAweDRkLCAweGFjLCAweDY5LCAweDM0LCAweDUyLCAweGU1LCAweDhmLCAweDU1LCAweGFkLCAweDU4LAotICAgICAgICAweGFlLCAweDg1LCAweGM0LCAweDIyLCAweDQxLCAweGRmLCAweGFkLCAweDc2LCAweDYxLCAweGU1LCAweDZmLAotICAgICAgICAweDc0LCAweDQ1LCAweDY5LCAweGRjLCAweDAwLCAweDc5LCAweGFjLCAweDhiLCAweGE2LCAweGM5LCAweDM1LAotICAgICAgICAweGQ0LCAweDM0LCAweDY0LCAweGRjLCAweDM3LCAweDA2LCAweGIxLCAweGFlLCAweDg4LCAweGMxLCAweGFjLAotICAgICAgICAweGQ4LCAweGM5LCAweDJjLCAweGE2LCAweGUwLCAweDczLCAweDViLCAweDM2LCAweGYzLCAweDc0LCAweGU2LAotICAgICAgICAweDg0LCAweDA1LCAweGUzLCAweGE5LCAweDQ3LCAweDZhLCAweDE0LCAweGI2LCAweDQ5LCAweDNkLCAweDg1LAotICAgICAgICAweDNhLCAweGVlLCAweGVlLCAweDJiLCAweGE4LCAweGUyLCAweDZmLCAweDMwLCAweDgxLCAweGU5LCAweDhhLAotICAgICAgICAweGNhLCAweGE0LCAweGUyLCAweGQzLCAweDhiLCAweDAxLCAweGIxLCAweGY5LCAweDA0LCAweDdmLCAweGFmLAotICAgICAgICAweDIzLCAweGYwLCAweGE5LCAweDU0LCAweDQxLCAweDljLCAweGZkLCAweGEzLCAweGY0LCAweGFlLCAweDY1LAotICAgICAgICAweDE4LCAweGY3LCAweDI1LCAweDhhLCAweGUyLCAweDAyLCAweDM4LCAweGI4LCAweGZkLCAweDJhLCAweDdiLAotICAgICAgICAweDViLCAweGE4LCAweDZkLCAweDZkLCAweDVkLCAweDlhLCAweDVkLCAweGNiLCAweGJiLCAweGQyLCAweGI2LAotICAgICAgICAweGE2LCAweGEzLCAweDE5LCAweDVlLCAweGUyLCAweDAzLCAweDdiLCAweDFkLCAweGMyLCAweDE3LCAweDhkLAotICAgICAgICAweGI4LCAweGFjLCAweGZiLCAweDg5LCAweDM5LCAweDM1LCAweGQ2LCAweDlhLCAweDZhLCAweGU4LCAweDY2LAotICAgICAgICAweDU1LCAweGNiLCAweGY1LCAweGFjLCAweDdiLCAweDk2LCAweGViLCAweDUwLCAweGM2LCAweDg4LCAweDZkLAotICAgICAgICAweDY2LCAweGU5LCAweGNkLCAweDZjLCAweGRiLCAweDRmLCAweGQzLCAweDlhLCAweDAwLCAweDJmLCAweGU2LAotICAgICAgICAweGY5LCAweGEzLCAweGU3LCAweGI1LCAweDRhLCAweDkzLCAweDdmLCAweGEyLCAweGM2LCAweDczLCAweGRjLAotICAgICAgICAweGQ3LCAweDE1LCAweDU1LCAweGVmLCAweDQ4LCAweDdkLCAweDA5LCAweDUyLCAweDZlLCAweDNhLCAweGQ0LAotICAgICAgICAweGFiLCAweDJmLCAweGJkLCAweDYxLCAweDE2LCAweDBjLCAweDczLCAweDQ5LCAweGM1LCAweDI0LCAweDkyLAotICAgICAgICAweDdmLCAweGEyLCAweDYzLCAweGZkLCAweGFhLCAweGQ2LCAweDJmLCAweDcxLCAweDBlLCAweGIxLCAweDkzLAotICAgICAgICAweGY3LCAweDJkLCAweGY1LCAweGE0LCAweDllLCAweDRlLCAweGI1LCAweGRkLCAweDRiLCAweGY4LCAweDY4LAotICAgICAgICAweDRjLCAweGNiLCAweGI5LCAweDkzLCAweGFkLCAweDY1LCAweGNlLCAweGQ5LCAweDI2LCAweGE5LCAweDhkLAotICAgICAgICAweDE5LCAweGY2LCAweGYyLCAweGY0LCAweGU2LCAweGI1LCAweGFkLCAweGU3LCAweGM2LCAweDM5LCAweGEwLAotICAgICAgICAweDE4LCAweGViLCAweGM5LCAweDc3LCAweDZjLCAweDM1LCAweDJhLCAweDRiLCAweGZlLCAweDhhLCAweDljLAotICAgICAgICAweGZmLCAweDAwLCAweDExLCAweGFlLCAweDNhLCAweDhiLCAweGRlLCAweDYxLCAweGQwLCAweDllLCAweDM5LAotICAgICAgICAweGI4LCAweGViLCAweDUzLCAweGFjLCAweGI5LCAweGFlLCAweDViLCAweDAwLCAweGYzLCAweDI3LCAweDE0LAotICAgICAgICAweDkyLCAweGM5LCAweGZlLCAweDhhLCAweDNmLCAweGRlLCAweDM1LCAweGFjLCAweDNhLCAweDg4LCAweDkyLAotICAgICAgICAweGNkLCAweGIxLCAweDZlLCAweDdkLCAweGNkLCAweDMyLCAweDY3LCAweGViLCAweGNkLCAweDdhLCAweDE0LAotICAgICAgICAweGZlLCAweDA0LCAweDI2LCAweDY2LCAweGNlLCAweGY5LCAweDI2LCAweGIzLCAweGU2LCAweDZlLCAweGI0LAotICAgICAgICAweGQ5LCAweDQ4LCAweGM4LCAweDgyLCAweDRlLCAweDA3LCAweDM1LCAweGE3LCAweDZmLCAweDJmLCAweDAyLAotICAgICAgICAweDlhLCAweDA2LCAweDVmLCAweDhjLCAweGE0LCAweDgzLCAweDBlLCAweDMyLCAweDJhLCAweDY5LCAweGUzLAotICAgICAgICAweGRkLCAweDEyLCAweDA4LCAweDk3LCAweDg1LCAweGVjLCAweDJhLCAweDJhLCAweDQyLCAweGYxLCAweDc2LAotICAgICAgICAweDI2LCAweGU0LCAweDZhLCAweDU5LCAweDBlLCAweDE4LCAweDEwLCAweDZhLCAweGQyLCAweDg5LCAweDAyLAotICAgICAgICAweDZlLCAweDJhLCAweDcxLCAweGViLCAweDVjLCAweDFjLCAweDhjLCAweGE2LCAweDQ4LCAweGJiLCAweGRjLAotICAgICAgICAweDYxLCAweDQxLCAweDM1LCAweDcyLCAweDI4LCAweDg3LCAweGQ5LCAweGY2LCAweDRhLCAweGI5LCAweGU3LAotICAgICAgICAweDM4LCAweGFlLCAweDhjLCAweDNkLCAweDM2LCAweGRkLCAweGRlLCAweGM0LCAweGIwLCAweDIxLCAweDUxLAotICAgICAgICAweDc2LCAweGE4LCAweGMwLCAweGFhLCAweDkzLCAweDMxLCAweGU2LCAweGJiLCAweDJkLCAweDY1LCAweDYxLAotICAgICAgICAweDE5LCAweGQzLCAweDFlLCAweGI1LCAweDQ2LCAweDVhLCAweDk2LCAweDVhLCAweDMwLCAweGEwLCAweDdlLAotICAgICAgICAweDA1LCAweDY5LCAweDViLCAweGM5LCAweGM2LCAweDI4LCAweDQwLCAweGNkLCAweDA4LCAweDY0LCAweDNjLAotICAgICAgICAweDczLCAweDU3LCAweGUxLCAweDk0LCAweGYxLCAweGNkLCAweDVhLCAweDIxLCAweDhjLCAweGI5LCAweDYzLAotICAgICAgICAweGU3LCAweDY3LCAweDFkLCAweGFiLCAweDQwLCAweGIxLCAweGZiLCAweDAwLCAweDFkLCAweGYwLCAweDJiLAotICAgICAgICAweDk5LCAweDJkLCAweDY2LCAweDNlLCAweDg4LCAweDc1LCAweDgxLCAweDNmLCAweDMxLCAweGY2LCAweGFiLAotICAgICAgICAweDY0LCAweGQ2LCAweGI0LCAweDE3LCAweGVlLCAweGQwLCAweDllLCAweGU0LCAweDMyLCAweDFhLCAweGE3LAotICAgICAgICAweDMxLCAweGFkLCAweDE4LCAweDE0LCAweDI2LCAweGVmLCAweDU0LCAweGE1LCAweGE4LCAweDY1LCAweGEzLAotICAgICAgICAweDljLCAweDgxLCAweGZhLCAweDU2LCAweDhjLCAweDJkLCAweGNlLCAweDY4LCAweDQwLCAweGNiLCAweGYxLAotICAgICAgICAweDM3LCAweGJkLCAweDVlLCAweDg1LCAweGVhLCAweGQxLCAweDBjLCAweGJiLCAweDE5LCAweDU2LCAweDIzLAotICAgICAgICAweDIwLCAweDFmLCAweGFkLCAweDVjLCAweDQyLCAweDA4LCAweDAzLCAweGI1LCAweDU1LCAweDkxLCAweDA0LAotICAgICAgICAweGM5LCAweDgwLCAweDM4LCAweDAwLCAweDBhLCAweDcxLCAweDM0LCAweDZjLCAweDMyLCAweDI3LCAweGU5LAotICAgICAgICAweDU1LCAweDI1LCAweDE1LCAweDJjLCAweDY4LCAweGEzLCAweDMwLCAweGViLCAweDU0LCAweGE1LCAweDE1LAotICAgICAgICAweDBjLCAweGQxLCAweDAwLCAweGZmLCAweGQ5fTsKLQotICAgIC8qIHBhY2thZ2UgKi8gc3RhdGljIGZpbmFsIGJ5dGVbXSBzUGhvdG9CeXRlQXJyYXlGb3JDb21wbGljYXRlZENhc2U7Ci0KLSAgICBzdGF0aWMgewotICAgICAgICBmaW5hbCBpbnQgbGVuZ3RoID0gc1Bob3RvSW50QXJyYXlGb3JDb21wbGljYXRlZENhc2UubGVuZ3RoOwotICAgICAgICBzUGhvdG9CeXRlQXJyYXlGb3JDb21wbGljYXRlZENhc2UgPSBuZXcgYnl0ZVtsZW5ndGhdOwotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBzUGhvdG9CeXRlQXJyYXlGb3JDb21wbGljYXRlZENhc2VbaV0gPSAoYnl0ZSlzUGhvdG9JbnRBcnJheUZvckNvbXBsaWNhdGVkQ2FzZVtpXTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIHRlc3RWMjFTaW1wbGVDYXNlMV9QYXJ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UFSWSwgMSk7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIzIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfSVNETik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoRW1haWwuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5EQVRBLCAidGVzdEBleGFtcGxlLmNvbSIpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5UWVBFLCBFbWFpbC5UWVBFX0hPTUUpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChFbWFpbC5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLkRBVEEsICJ0ZXN0MkBleGFtaW5hdGlvbi5jb20iKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuVFlQRSwgRW1haWwuVFlQRV9NT0JJTEUpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChPcmdhbml6YXRpb24uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uQ09NUEFOWSwgIkNvbXBhbnkiKQotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLlRJVExFLCAiRW5naW5lZXIiKQotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLlRZUEUsIE9yZ2FuaXphdGlvbi5UWVBFX1dPUkspOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKE9yZ2FuaXphdGlvbi5DT05URU5UX0lURU1fVFlQRS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zMjIyMjIyMjIiLCBuZXcgVHlwZVNldCgiVklERU8iKSkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJURUwiLCAiMDMzMzMzMzMzMyIsIG5ldyBUeXBlU2V0KCJWT0lDRSIpKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkFEUiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiOzsxMDAgV2F0ZXJzIEVkZ2U7QmF5dG93bjtMQTszMDMxNDtVbml0ZWQgU3RhdGVzIG9mIEFtZXJpY2EiLAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiIiwgIiIsICIxMDAgV2F0ZXJzIEVkZ2UiLCAiQmF5dG93biIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJMQSIsICIzMDMxNCIsICJVbml0ZWQgU3RhdGVzIG9mIEFtZXJpY2EiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbmV3IFR5cGVTZXQoIldPUksiKSwgbnVsbCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJMQUJFTCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiMTAwIFdhdGVycyBFZGdlXHJcbkJheXRvd24sIExBIDMwMzE0XHJcblVuaXRlZCAgU3RhdGVzIG9mIEFtZXJpY2EiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbUNvbnRlbnRWYWx1ZXNGb3JRUCwgbmV3IFR5cGVTZXQoIldPUksiKSwgbnVsbCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJBRFIiLAotICAgICAgICAgICAgICAgICAgICAgICAgIjs7NDIgUGxhbnRhdGlvbiBTdC47QmF5dG93bjtMQTszMDMxNDtVbml0ZWQgU3RhdGVzIG9mIEFtZXJpY2EiLAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiIiwgIiIsICI0MiBQbGFudGF0aW9uIFN0LiIsICJCYXl0b3duIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkxBIiwgIjMwMzE0IiwgIlVuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIpLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgVHlwZVNldCgiSE9NRSIpLCBudWxsKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkxBQkVMIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICI0MiBQbGFudGF0aW9uIFN0LlxyXG5CYXl0b3duLCBMQSAzMDMxNFxyXG5Vbml0ZWQgIFN0YXRlcyBvZiBBbWVyaWNhIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG1Db250ZW50VmFsdWVzRm9yUVAsCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgVHlwZVNldCgiSE9NRSIpLCBudWxsKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkVNQUlMIiwgImZvcnJlc3RndW1wQHdhbGxhZGFsbGEuY29tIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBUeXBlU2V0KCJQUkVGIiwgIklOVEVSTkVUIikpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiRU1BSUwiLCAiY2VsbEBleGFtcGxlLmNvbSIsIG5ldyBUeXBlU2V0KCJDRUxMIikpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiTk9URSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiVGhlIGZvbGxvd2luZyBub3RlIGlzIHRoZSBleGFtcGxlIGZyb20gUkZDIDIwNDUuIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJOT1RFIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICJOb3cncyB0aGUgdGltZSBmb3IgYWxsIGZvbGsgdG8gY29tZSB0byB0aGUgYWlkIG9mIHRoZWlyIGNvdW50cnkuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG1Db250ZW50VmFsdWVzRm9yUVAsIG51bGwsIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiUEhPVE8iLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgc1Bob3RvQnl0ZUFycmF5Rm9yQ29tcGxpY2F0ZWRDYXNlLCBtQ29udGVudFZhbHVlc0ZvckJhc2U2NFYyMSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBUeXBlU2V0KCJKUEVHIiksIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiWC1BVFRSSUJVVEUiLCAiU29tZSBTdHJpbmciKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkJEQVkiLCAiMTk4MDAxMDEiKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkdFTyIsICIzNS42NTYzODU0LDEzOS42OTk0MjMzIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJVUkwiLCAiaHR0cDovL3d3dy5leGFtcGxlLmNvbS8iKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIlJFViIsICIyMDA4MDQyNFQxOTUyNDNaIik7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogQ2hlY2tzIENvbnRhY3RTdHJ1Y3QgY29ycmVjdGx5IGluc2VydHMgdmFsdW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AgIC5wdXQoRW1haWwuREFUQSwgImZvcnJlc3RndW1wQHdhbGxhZGFsbGEuY29tIikKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLklTX1BSSU1BUlksIDEpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuVFlQRSwgRW1haWwuVFlQRV9NT0JJTEUpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5EQVRBLCAiY2VsbEBleGFtcGxlLmNvbSIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKE5vdGUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChOb3RlLk5PVEUsICJUaGUgZm9sbG93aW5nIG5vdGUgaXMgdGhlIGV4YW1wbGUgZnJvbSBSRkMgMjA0NS4iKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChOb3RlLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoTm90ZS5OT1RFLAotICAgICAgICAgICAgICAgICAgICAgICAgIk5vdydzIHRoZSB0aW1lIGZvciBhbGwgZm9sayB0byBjb21lIHRvIHRoZSBhaWQgb2YgdGhlaXIgY291bnRyeS4iKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG90by5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAvLyBObyBpbmZvcm1hdGlvbiBhYm91dCBpdHMgaW1hZ2UgZm9ybWF0IGNhbiBiZSBpbnNlcnRlZC4KLSAgICAgICAgICAgICAgICAucHV0KFBob3RvLlBIT1RPLCBzUGhvdG9CeXRlQXJyYXlGb3JDb21wbGljYXRlZENhc2UpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKEV2ZW50LkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoRXZlbnQuU1RBUl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wKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG1Db250ZW50VmFsdWVzRm9yU0ppcywgbnVsbCwgbnVsbCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJTT1VORCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHVGRjcxXHVGRjlEXHVGRjg0XHVGRjlFXHVGRjczO1x1RkY5Qlx1RkY3Mlx1RkY4NFx1RkY5RVx1MDAzMTs7OyIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBtQ29udGVudFZhbHVlc0ZvclNKaXMsCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgVHlwZVNldCgiWC1JUk1DLU4iKSwgbnVsbCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJBRFIiLAotICAgICAgICAgICAgICAgICAgICAgICAgIjtcdTY3NzFcdTRFQUNcdTkwRkRcdTZFMEJcdThDMzdcdTUzM0FcdTY4NUMiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTRFMThcdTc1M0FcdTAwMzJcdTAwMzZcdTAwMkRcdTAwMzFcdTMwQkIiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTMwRUJcdTMwRUFcdTMwQTJcdTMwRjNcdTMwQkZcdTMwRUZcdTMwRkNcdTAwMzYiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTk2OEU7Ozs7MTUwLTg1MTI7IiwKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoIiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJcdTY3NzFcdTRFQUNcdTkwRkRcdTZFMEJcdThDMzdcdTUzM0FcdTY4NUMiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlx1NEUxOFx1NzUzQVx1MDAzMlx1MDAzNlx1MDAyRFx1MDAzMVx1MzBCQiIgK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UJFTCwgIk5FQy1TRUNSRVQiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiOSIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIk5FQy1IT1RFTCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxMCIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIk5FQy1TQ0hPT0wiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTEiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfRkFYX0hPTUUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxMiIpOwotCi0gICAgICAgIGVsZW0gPSBtVmVyaWZpZXIuYWRkQ29udGVudFZhbHVlc1ZlcmlmaWVyRWxlbSgpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFN0cnVjdHVyZWROYW1lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuRkFNSUxZX05BTUUsICJcdTVCODlcdTg1RTRcdTMwRURcdTMwQTRcdTMwQzlcdTAwMzQiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuRElTUExBWV9OQU1FLCAiXHU1Qjg5XHU4NUU0XHUzMEVEXHUzMEE0XHUzMEM5XHUwMDM0IikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlBIT05FVElDX0dJVkVOX05BTUUsCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHVGRjcxXHVGRjlEXHVGRjg0XHVGRjlFXHVGRjczXHVGRjlCXHVGRjcyXHVGRjg0XHVGRjlFXHUwMDM0Iik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NVU1RPTSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLkxBQkVMLCAiTU9ERU0iKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTMiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfUEFHRVIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxNCIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIk5FQy1GQU1JTFkiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTUiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICA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N0PENvbnRhY3RFbnRyeT4oKTsKLQotICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIE1vY2tFbnRpdHlJdGVyYXRvciBpbXBsZW1lbnRzIEVudGl0eUl0ZXJhdG9yIHsKLSAgICAgICAgTGlzdDxFbnRpdHk+IG1FbnRpdHlMaXN0OwotICAgICAgICBJdGVyYXRvcjxFbnRpdHk+IG1JdGVyYXRvcjsKLQotICAgICAgICBwdWJsaWMgTW9ja0VudGl0eUl0ZXJhdG9yKExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgIG1FbnRpdHlMaXN0ID0gbmV3IEFycmF5TGlzdDxFbnRpdHk+KCk7Ci0gICAgICAgICAgICBFbnRpdHkgZW50aXR5ID0gbmV3IEVudGl0eShuZXcgQ29udGVudFZhbHVlcygpKTsKLSAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgZW50aXR5LmFkZFN1YlZhbHVlKERhdGEuQ09OVEVOVF9VUkksIGNvbnRlbnRWYWx1ZXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUVudGl0eUxpc3QuYWRkKGVudGl0eSk7Ci0gICAgICAgICAgICBtSXRlcmF0b3IgPSBtRW50aXR5TGlzdC5pdGVyYXRvcigpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzTmV4dCgpIHsKLSAgICAgICAgICAgIHJldHVybiBtSXRlcmF0b3IuaGFzTmV4dCgpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIEVudGl0eSBuZXh0KCkgewotICAgICAgICAgICAgcmV0dXJuIG1JdGVyYXRvci5uZXh0KCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCByZW1vdmUoKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgVW5zd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NlbGVjdGlvbkFyZ3MsIFN0cmluZyBzb3J0T3JkZXIpIHsKLSAgICAgICAgVGVzdENhc2UuYXNzZXJ0VHJ1ZShWQ2FyZENvbXBvc2VyLkNPTlRBQ1RTX1RFU1RfQ09OVEVOVF9VUkkuZXF1YWxzKHVyaSkpOwotICAgICAgICAvLyBJbiB0aGlzIHRlc3QsIGZvbGxvd2luZyBhcmd1bWVudHMgYXJlIG5vdCBzdXBwb3J0ZWQuCi0gICAgICAgIFRlc3RDYXNlLmFzc2VydE51bGwoc2VsZWN0aW9uKTsKLSAgICAgICAgVGVzdENhc2UuYXNzZXJ0TnVsbChzZWxlY3Rpb25BcmdzKTsKLSAgICAgICAgVGVzdENhc2UuYXNzZXJ0TnVsbChzb3J0T3JkZXIpOwotCi0gICAgICAgIHJldHVybiBuZXcgTW9ja0N1cnNvcigpIHsKLSAgICAgICAgICAgIGludCBtQ3VycmVudFBvc2l0aW9uID0gLTE7Ci0KLSAgICAgICAgICAgIEBPdmVycmlkZQotICAgICAgICAgICAgcHVibGljIGludCBnZXRDb3VudCgpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbUNvbnRhY3RFbnRyeUxpc3Quc2l6ZSgpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIG1vdmVUb0ZpcnN0KCkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50UG9zaXRpb24gPSAwOwotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIG1vdmVUb05leHQoKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1DdXJyZW50UG9zaXRpb24gPCBtQ29udGFjdEVudHJ5TGlzdC5zaXplKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRQb3NpdGlvbisrOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQmVmb3JlRmlyc3QoKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1DdXJyZW50UG9zaXRpb24gPCAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQWZ0ZXJMYXN0KCkgewotICAgICAgICAgICAgICAgIHJldHVybiBtQ3VycmVudFBvc2l0aW9uID49IG1Db250YWN0RW50cnlMaXN0LnNpemUoKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgICAgICBwdWJsaWMgaW50IGdldENvbHVtbkluZGV4KFN0cmluZyBjb2x1bW5OYW1lKSB7Ci0gICAgICAgICAgICAgICAgVGVzdENhc2UuYXNzZXJ0RXF1YWxzKENvbnRhY3RzLl9JRCwgY29sdW1uTmFtZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIDA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIEBPdmVycmlkZQotICAgICAgICAgICAgcHVibGljIGludCBnZXRJbnQoaW50IGNvbHVtbkluZGV4KSB7Ci0gICAgICAgICAgICAgICAgVGVzdENhc2UuYXNzZXJ0RXF1YWxzKDAsIGNvbHVtbkluZGV4KTsKLSAgICAgICAgICAgICAgICBUZXN0Q2FzZS5hc3NlcnRUcnVlKG1DdXJyZW50UG9zaXRpb24gPj0gMAotICAgICAgICAgICAgICAgICAgICAgICAgJiYgbUN1cnJlbnRQb3NpdGlvbiA8IG1Db250YWN0RW50cnlMaXN0LnNpemUoKSk7Ci0gICAgICAg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gICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlID09IG51bGwgfHwgVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUudG9TdHJpbmcoKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGtleVRvQmVSZW1vdmVkLmFkZChlbnRyeS5nZXRLZXkoKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZm9yIChTdHJpbmcga2V5OiBrZXlUb0JlUmVtb3ZlZCkgewotICAgICAgICAgICAgICAgICAgICBhY3R1YWxDb250ZW50VmFsdWVzLnJlbW92ZShrZXkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvKiBmb3IgdGVzdGluZwotICAgICAgICAgICAgICAgIExvZy5kKCJAQEAiLAotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nLmZvcm1hdCgiTWltZVR5cGU6ICVzLCBkYXRhOiAlcyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbWVUeXBlLCBhY3R1YWxDb250ZW50VmFsdWVzLnRvU3RyaW5nKCkpKTsgKi8KLSAgICAgICAgICAgICAgICAvLyBSZW1vdmUgUkFXX0NPTlRBQ1RfSUQgZW50cnkganVzdCBmb3Igc2FmZXR5LCBzaW5jZSB3ZSBkbyBub3QgY2FyZQotICAgICAgICAgICAgICAgIC8vIGhvdyByZXNvbHZlci1yZWxhdGVkIGNvZGUgaGFuZGxlcyB0aGUgZW50cnkgaW4gdGhpcyB1bml0IHRlc3QsCi0gICAgICAgICAgICAgICAgaWYgKGFjdHVhbENvbnRlbnRWYWx1ZXMuY29udGFpbnNLZXkoRGF0YS5SQVdfQ09OVEFDVF9JRCkpIHsKLSAgICAgICAgICAgICAgICAgICAgYWN0dWFsQ29udGVudFZhbHVlcy5yZW1vdmUoRGF0YS5SQVdfQ09OVEFDVF9JRCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGZpbmFsIENvbGxlY3Rpb248Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0NvbGxlY3Rpb24gPQotICAgICAgICAgICAgICAgICAgICBtTWltZVR5cGVUb0V4cGVjdGVkQ29udGVudFZhbHVlcy5nZXQobWltZVR5cGUpOwotICAgICAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzQ29sbGVjdGlvbi5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgVGVzdENhc2UuZmFpbCgiQ29udGVudFZhbHVlcyBmb3IgTWltZVR5cGUgIiArIG1pbWVUeXBlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGlzIG5vdCBleHBlY3RlZCBhdCBhbGwgKCIgKyBhY3R1YWxDb250ZW50VmFsdWVzICsgIikiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBjaGVja2VkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGV4cGVjdGVkQ29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNDb2xsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8qZm9yIHRlc3RpbmcKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoIkBAQCIsICJleHBlY3RlZDogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgY29udmVydFRvRWFzaWx5UmVhZGFibGVTdHJpbmcoZXhwZWN0ZWRDb250ZW50VmFsdWVzKSk7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKCJAQEAiLCAiYWN0dWFsICA6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGNvbnZlcnRUb0Vhc2lseVJlYWRhYmxlU3RyaW5nKGFjdHVhbENvbnRlbnRWYWx1ZXMpKTsqLwotICAgICAgICAgICAgICAgICAgICBpZiAoZXF1YWxzRm9yQ29udGVudFZhbHVlcyhleHBlY3RlZENvbnRlbnRWYWx1ZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0dWFsQ29udGVudFZhbHVlcykpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFRlc3RDYXNlLmFzc2VydFRydWUoY29udGVudFZhbHVlc0NvbGxlY3Rpb24ucmVtb3ZlKGV4cGVjdGVkQ29udGVudFZhbHVlcykpOwotICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2tlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoIWNoZWNrZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIlxuIik7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJVbmV4cGVjdGVkOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY29udmVydFRvRWFzaWx5UmVhZGFibGVTdHJpbmcoYWN0dWFsQ29udGVudFZhbHVlcykpOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIkV4cGVjdGVkICA6ICIpOwotICAgICAgICAgICAgICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgZXhwZWN0ZWRDb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0NvbGxlY3Rpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNvbnZlcnRUb0Vhc2lseVJlYWRhYmxlU3RyaW5nKGV4cGVjdGVkQ29udGVudFZhbHVlcykpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICA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7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICgiQkVHSU46VkNBUkQiLmVxdWFsc0lnbm9yZUNhc2UobGluZSkpIHsKLSAgICAgICAgICAgICAgICBpZiAoYmVnaW5FeGlzdHMpIHsKLSAgICAgICAgICAgICAgICAgICAgVGVzdENhc2UuZmFpbCgiTXVsdGlwbGUgXCJCRUdJTjpWQ0FSRFwiIGxpbmUgZm91bmQiKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBiZWdpbkV4aXN0cyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIkVORDpWQ0FSRCIuZXF1YWxzSWdub3JlQ2FzZShsaW5lKSkgewotICAgICAgICAgICAgICAgIGlmIChlbmRFeGlzdHMpIHsKLSAgICAgICAgICAgICAgICAgICAgVGVzdENhc2UuZmFpbCgiTXVsdGlwbGUgXCJFTkQ6VkNBUkRcIiBsaW5lIGZvdW5kIik7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZW5kRXhpc3RzID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmICgoVkNhcmRDb25maWcuaXNWZXJzaW9uMjEobVZDYXJkVHlwZSkgPyAiVkVSU0lPTjoyLjEiIDoKLSAgICAgICAgICAgICAgICAoVkNhcmRDb25maWcuaXNWZXJzaW9uMzAobVZDYXJkVHlwZSkgPyAiVkVSU0lPTjozLjAiIDoKLSAgICAgICAgICAgICAgICAgICAgIlZFUlNJT046NC4wIikpLmVxdWFsc0lnbm9yZUNhc2UobGluZSkpIHsKLSAgICAgICAgICAgICAgICBpZiAodmVyc2lvbkV4aXN0cykgewotICAgICAgICAgICAgICAgICAgICBUZXN0Q2FzZS5mYWlsKCJNdWx0aXBsZSBWRVJTSU9OIGxpbmUgKyBmb3VuZCIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHZlcnNpb25FeGlzdHMgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICghYmVnaW5FeGlzdHMpIHsKLSAgICAgICAgICAgICAgICBUZXN0Q2FzZS5mYWlsKCJQcm9wZXJ0eSBvdGhlciB0aGFuIEJFR0lOIGNhbWUgYmVmb3JlIEJFR0lOIHByb3BlcnR5OiAiICsgbGluZSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGVuZEV4aXN0cykgewotICAgICAgICAgICAgICAgIFRlc3RDYXNlLmZhaWwoIlByb3BlcnR5IG90aGVyIHRoYW4gRU5EIGNhbWUgYWZ0ZXIgRU5EIHByb3BlcnR5OiAiICsgbGluZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGZpbmFsIGludCBpbmRleCA9IG1FeHBlY3RlZExpbmVMaXN0LmluZGV4T2YobGluZSk7Ci0gICAgICAgICAgICBpZiAoaW5kZXggPj0gMCkgewotICAgICAgICAgICAgICAgIG1FeHBlY3RlZExpbmVMaXN0LnJlbW92ZShpbmRleCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIFRlc3RDYXNlLmZhaWwoIlVuZXhwZWN0ZWQgbGluZTogIiArIGxpbmUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFtRXhwZWN0ZWRMaW5lTGlzdC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgIFN0cmluZ0J1ZmZlciBidWZmZXIgPSBuZXcgU3RyaW5nQnVmZmVyKCk7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyBleHBlY3RlZExpbmUgOiBtRXhw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gICAgICAgICAgICB9Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnIicpOwotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZWxlbSk7Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnIicpOwotICAgICAgICB9Ci0gICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJdIik7Ci0gICAgICAgIGlmICghcHJvcEdyb3VwU2V0LmlzRW1wdHkoKSkgewotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiwgcHJvcEdyb3VwU2V0OiBbIik7Ci0gICAgICAgICAgICBmaXJzdCA9IHRydWU7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyBlbGVtIDogcHJvcEdyb3VwU2V0KSB7Ci0gICAgICAgICAgICAgICAgaWYgKGZpcnN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiwgIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCciJyk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZWxlbSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyInKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJdIik7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHByb3BWYWx1ZV92ZWN0b3IgIT0gbnVsbCAmJiBwcm9wVmFsdWVfdmVjdG9yLnNpemUoKSA+IDEpIHsKLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsIHByb3BWYWx1ZV92ZWN0b3Igc2l6ZTogIik7Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZChwcm9wVmFsdWVfdmVjdG9yLnNpemUoKSk7Ci0gICAgICAgIH0KLS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cXVhbHMoYWN0dWFsTm9kZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkTm9kZUxpc3QucmVtb3ZlKGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4cGVjdGVkTm9kZUxpc3Quc2l6ZSgpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtT3JkZXJlZE5vZGVNYXAucmVtb3ZlKHByb3BOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkQnV0RGlmZmVyZW50VmFsdWVMaXN0LmFkZChleHBlY3RlZE5vZGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gImFjdHVhbE5vZGUiIGlzIG5vdCBpbiBvcmRlcmVkIGV4cGVjdGVkIGxpc3QuCi0gICAgICAgICAgICAgICAgLy8gVHJ5IGxvb2tpbmcgb3ZlciB1bm9yZGVyZWQgZXhwZWN0ZWQgbGlzdC4KLSAgICAgICAgICAgICAgICBpZiAodHJ5Rm91bmRFeHBlY3RlZE5vZGVGcm9tVW5vcmRlcmVkTGlzdChhY3R1YWxOb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWRCdXREaWZmZXJlbnRWYWx1ZUxpc3QpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoIWV4cGVjdGVkQnV0RGlmZmVyZW50VmFsdWVMaXN0LmlzRW1wdHkoKSkgewotICAgICAgICAgICAgICAgICAgICAvLyBTYW1lIHByb3BOYW1lIGV4aXN0cyBidXQgd2l0aCBkaWZmZXJlbnQgdmFsdWUocykuCi0gICAgICAgICAgICAgICAgICAgIGZhaWxXaXRoRXhwZWN0ZWROb2RlTGlzdChwcm9wTmFtZSwgYWN0dWFsTm9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHBlY3RlZEJ1dERpZmZlcmVudFZhbHVlTGlzdCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gVGhlcmUncyBubyBleHBlY3RlZCBub2RlIHdpdGggc2FtZSBwcm9wTmFtZS4KLSAgICAgICAgICAgICAgICAgICAgVGVzdENhc2UuZmFpbCgiVW5leHBlY3RlZCBwcm9wZXJ0eSBcIiIgKyBwcm9wTmFtZSArICJcIiBleGlzdHMuIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgTGlzdDxQcm9wZXJ0eU5vZGU+IGV4cGVjdGVkQnV0RGlmZmVyZW50VmFsdWVMaXN0ID0KLSAgICAgICAgICAgICAgICBuZXcgQXJyYXlMaXN0PFByb3BlcnR5Tm9kZT4oKTsKLSAgICAgICAgICAgIGlmICh0cnlGb3VuZEV4cGVjdGVkTm9kZUZyb21Vbm9yZGVyZWRMaXN0KGFjdHVhbE5vZGUsIGV4cGVjdGVkQnV0RGlmZmVyZW50VmFsdWVMaXN0KSkgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKCFleHBlY3RlZEJ1dERpZmZlcmVudFZhbHVlTGlzdC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gU2FtZSBwcm9wTmFtZSBleGlzdHMgYnV0IHdpdGggZGlmZmVyZW50IHZhbHVlKHMpLgotICAgICAgICAgICAgICAgICAgICBmYWlsV2l0aEV4cGVjdGVkTm9kZUxpc3QocHJvcE5hbWUsIGFjdHVhbE5vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0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ggKElPRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgQW5kcm9pZFRlc3RDYXNlLmZhaWwoIlVuZXhwZWN0ZWQgSU9FeGNlcHRpb246ICIgKyBlLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdmVyaWZ5KCkgewotICAgICAgICBpZiAoIW1Jbml0aWFsaXplZCkgewotICAgICAgICAgICAgVGVzdENhc2UuZmFpbCgiTm90IGluaXRpYWxpemVkLiIpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChtVmVyaWZpZWQpIHsKLSAgICAgICAgICAgIFRlc3RDYXNlLmZhaWwoInZlcmlmeSgpIHdhcyBjYWxsZWQgdHdpY2UuIik7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobUlucHV0U3RyZWFtICE9IG51bGwpIHsKLSAgICAgICAgICAgIGlmIChtRXhwb3J0VGVzdFJlc29sdmVyICE9IG51bGwpewotICAgICAgICAgICAgICAgIFRlc3RDYXNlLmZhaWwoIlRoZXJlIGFyZSB0d28gaW5wdXQgc291cmNlcy4iKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHZlcmlmeUZvckltcG9ydFRlc3QoKTsKLSAgICAgICAgfSBlbHNlIGlmIChtRXhwb3J0VGVzdFJlc29sdmVyICE9IG51bGwpewotICAgICAgICAgICAgdmVyaWZ5Rm9yRXhwb3J0VGVzdCgpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgVGVzdENhc2UuZmFpbCgiTm8gaW5wdXQgaXMgZGV0ZXJtaW5lZCIpOwotICAgICAgICB9Ci0gICAgICAgIG1WZXJpZmllZCA9IHRydWU7Ci0gICAgfQotCi0gICAgcHJpdmF0ZSB2b2lkIHZlcmlmeUZvckltcG9ydFRlc3QoKSB7Ci0gICAgICAgIGlmIChtTGluZVZlcmlmaWVyICE9IG51bGwpIHsKLSAgICAgICAgICAgIEFuZHJvaWRUZXN0Q2FzZS5mYWlsKCJOb3Qgc3VwcG9ydGVkIG5vdy4iKTsKLSAgICAgICAgfQotCi0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICB2ZXJpZnlXaXRoSW5wdXRTdHJlYW0obUlucHV0U3RyZWFtKTsKLSAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgQW5kcm9pZFRlc3RDYXNlLmZhaWwoIklPRXhjZXB0aW9uIHdhcyB0aHJvd246ICIgKyBlLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICBpZiAobUlucHV0U3RyZWFtICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBtSW5wdXRTdHJlYW0uY2xvc2UoKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBFbnRpdHlJdGVyYXRvciBtb2NrR2V0RW50aXR5SXRlcmF0b3JNZXRob2QoCi0gICAgICAgICAgICBmaW5hbCBDb250ZW50UmVzb2x2ZXIgcmVzb2x2ZXIsCi0gICAgICAgICAgICBmaW5hbCBVcmkgdXJpLCBmaW5hbCBTdHJpbmcgc2VsZWN0aW9uLAotICAgICAgICAgICAgZmluYWwgU3RyaW5nW10gc2VsZWN0aW9uQXJncywgZmluYWwgU3RyaW5nIHNvcnRPcmRlcikgewotICAgICAgICBpZiAoRXhwb3J0VGVzdFJlc29sdmVyLmNsYXNzLmVxdWFscyhyZXNvbHZlci5nZXRDbGFzcygpKSkgewotICAgICAgICAgICAgcmV0dXJuICgoRXhwb3J0VGVzdFJlc29sdmVyKXJlc29sdmVyKS5nZXRQcm92aWRlcigpLnF1ZXJ5RW50aXRp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IG51bGwpKSB7Ci0gICAgICAgICAgICBBbmRyb2lkVGVzdENhc2UuZmFpbCgiaW5pdCgpIGZhaWxlZC4gUmVhc29uOiAiICsgY29tcG9zZXIuZ2V0RXJyb3JSZWFzb24oKSk7Ci0gICAgICAgIH0KLSAgICAgICAgQW5kcm9pZFRlc3RDYXNlLmFzc2VydEZhbHNlKGNvbXBvc2VyLmlzQWZ0ZXJMYXN0KCkpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgd2hpbGUgKCFjb21wb3Nlci5pc0FmdGVyTGFzdCgpKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgTWV0aG9kIG1vY2tHZXRFbnRpdHlJdGVyYXRvck1ldGhvZCA9IGdldE1vY2tHZXRFbnRpdHlJdGVyYXRvck1ldGhvZCgpOwotICAgICAgICAgICAgICAgICAgICBBbmRyb2lkVGVzdENhc2UuYXNzZXJ0Tm90TnVsbChtb2NrR2V0RW50aXR5SXRlcmF0b3JNZXRob2QpOwotICAgICAgICAgICAgICAgICAgICBBbmRyb2lkVGVzdENhc2UuYXNzZXJ0VHJ1ZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb3Nlci5jcmVhdGVPbmVFbnRyeShtb2NrR2V0RW50aXR5SXRlcmF0b3JNZXRob2QpKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOwotICAgICAgICAgICAgICAgICAgICBBbmRyb2lkVGVzdENhc2UuZmFpbChlLnRvU3RyaW5nKCkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIGNvbXBvc2VyLnRlcm1pbmF0ZSgpOwotICAgICAgICB9Ci0gICAgfQotfQpkaWZmIC0tZ2l0IGEvY29yZS90ZXN0cy9jb3JldGV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G5ldyBpbnRbXSB7IDAsIFJVTl9MRU5HVEhfTUFTSyB9KTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBEaXJlY3Rpb25zIERJUlNfQUxMX1JJR0hUX1RPX0xFRlQgPQorICAgICAgICBuZXcgRGlyZWN0aW9ucyhuZXcgaW50W10geyAwLCBSVU5fTEVOR1RIX01BU0sgfCBSVU5fUlRMX0ZMQUcgfSk7CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTFZMMV8xID0gMSB8ICgxIDw8IFJVTl9MRVZFTF9TSElGVCk7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IExWTDJfMSA9IDEgfCAoMiA8PCBSVU5fTEVWRUxfU0hJRlQpOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBMVkwyXzIgPSAyIHwgKDIgPDwgUlVOX0xFVkVMX1NISUZUKTsKKworICAgIHByaXZhdGUgc3RhdGljIFN0cmluZ1tdIHRleHRzID0geworICAgICAgICAiIiwKKyAgICAgICAgIiAiLAorICAgICAgICAiYSIsCisgICAgICAgICJhMSIsCisgICAgICAgICJhQSIsCisgICAgICAgICJhMWIiLAorICAgICAgICAiYTFBIiwKKyAgICAgICAgImFBMSIsCisgICAgICAgICJhQWIiLAorICAgICAgICAiYUExQiIsCisgICAgICAgICJhQTFCMiIsCisKKyAgICAgICAgLy8gcnRsCisgICAgICAgICJBIiwKKyAgICAgICAgIkExIiwKKyAgICAgICAgIkFhIiwKKyAgICAgICAgIkExQiIsCisgICAgICAgICJBMWEiLAorICAgICAgICAiQWExIiwKKyAgICAgICAgIkFhQiIKKyAgICB9OworCisgICAgLy8gRXhwZWN0ZWQgZGlyZWN0aW9ucyBhcmUgYW4gYXJyYXkgb2Ygc3RhcnQvbGVuZ3RoK2xldmVsIHBhaXJzLAorICAgIC8vIGluIHZpc3VhbCBvcmRlciBmcm9tIHRoZSBsZWFkaW5nIG1hcmdpbi4KKyAgICBwcml2YXRlIH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FycyA9IHNyYy50b0NoYXJBcnJheSgpOworICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IGNoYXJzLmxlbmd0aDsgKytqKSB7CisgICAgICAgICAgICBjaGFyIGMgPSBjaGFyc1tqXTsKKyAgICAgICAgICAgIGlmIChjID49ICdBJyAmJiBjIDw9ICdEJykgeworICAgICAgICAgICAgICAgIGNoYXJzW2pdID0gKGNoYXIpKEFMRUYgKyBjIC0gJ0EnKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBuZXcgU3RyaW5nKGNoYXJzLCAwLCBjaGFycy5sZW5ndGgpOworICAgIH0KKworICAgIC8vIEBTbWFsbFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0RGlyZWN0aW9ucygpIHsKKyAgICAgICAgU3RyaW5nQnVpbGRlciBidWYgPSBuZXcgU3RyaW5nQnVpbGRlcigiXG4iKTsKKyAgICAgICAgRm9ybWF0dGVyIGYgPSBuZXcgRm9ybWF0dGVyKGJ1Zik7CisKKyAgICAgICAgTGF5b3V0QnVpbGRlciBiID0gU3RhdGljTGF5b3V0VGVzdC5idWlsZGVyKCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgdGV4dHMubGVuZ3RoOyArK2kpIHsKKyAgICAgICAgICAgIGIuc2V0VGV4dChwc2V1ZG9CaWRpVG9SZWFsKHRleHRzW2ldKSk7CisgICAgICAgICAgICBjaGVja0RpcmVjdGlvbnMoYi5idWlsZCgpLCBpLCBiLnRleHQsIGV4cGVjdGVkLCBmKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoYnVmLmxlbmd0aCgpID4gMSkgeworICAgICAgICAgICAgZmFpbChidWYudG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBAU21hbGxUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdFRyYWlsaW5nV2hpdGVzcGFjZSgpIHsKKyAgICAgICAgTGF5b3V0QnVpbGRlciBiID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1aWxkKCk7CisgICAgICAgIGludCBuID0gNTsKKyAgICAgICAgZm9yIChpbnQgaSA9IGV4cGVjdGVkLmxlbmd0aCAtIDE7IC0taSA+PSAwOykgeworICAgICAgICAgICAgaW50IHQgPSBsLmdldE9mZnNldFRvTGVmdE9mKG4pOworICAgICAgICAgICAgaWYgKHQgIT0gZXhwZWN0ZWRbaV0pIHsKKyAgICAgICAgICAgICAgICBmYWlsKCJvZmZzZXRbIiArIGkgKyAiXSB0byBsZWZ0IG9mOiAiICsgbiArICIgZXhwZWN0ZWQ6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWRbaV0gKyAiIGdvdDogIiArIHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbiA9IHQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyB1dGlsaXR5LCBub3QgcmVhbGx5IGEgdGVzdAorICAgIC8qCisgICAgcHVibGljIHZvaWQgdGVzdE1lYXN1cmVUZXh0MSgpIHsKKyAgICAgICAgTGF5b3V0QnVpbGRlciBiID0gU3RhdGljTGF5b3V0VGVzdC5idWlsZGVyKCk7CisgICAgICAgIFN0cmluZyB0ZXh0ID0gIkFCQyI7IC8vICJhYkFCIgorICAgICAgICBiLnNldFRleHQocHNldWRvQmlkaVRvUmVhbCh0ZXh0KSk7CisgICAgICAgIExheW91dCBsID0gYi5idWlsZCgpOworICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnMgPSBsLmdldExpbmVEaXJlY3Rpb25zKDApOworCisgICAgICAgIFRleHRQYWludCB3b3JrUGFpbnQgPSBuZXcgVGV4dFBhaW50KCk7CisKKyAgICAgICAgaW50IGRpciA9IC0xOyAvLyBMRUZUX1RPX1JJR0hUCisgICAgICAgIGJvb2xlYW4gdHJhaWxpbmcgPSB0cnVlOworICAgICAgICBib29sZWFuIGFsdCA9IHRydWU7CisgICAgICAgIGRvIHsKKyAgICAgICAgICAgIGRpciA9IC1kaXI7CisgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgdHJhaWxpbmcgPSAhdHJhaWxpbmc7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgb2Zmc2V0ID0gMCwgZW5kID0gYi50ZXh0Lmxlbmd0aCgpOyBvZmZzZXQgPD0gZW5kOyArK29mZnNldCkgeworICAgICAgICAgICAgICAgICAgICBmbG9hdCB3aWR0aCA9IExheW91dC5tZWFzdXJlVGV4dChiLnBhaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdvcmtQYWludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgb2Zmc2V0LCBlbmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyLCBkaXJlY3Rpb25zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWlsaW5nLCBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmkoIkJJREkiLCAiZGlyOiAiICsgZGlyICsgIiB0cmFpbDogIiArIHRyYWlsaW5nICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIG9mZnNldDogIiArIG9mZnNldCArICIgd2lkdGg6ICIgKyB3aWR0aCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSB3aGlsZSAoIXRyYWlsaW5nKTsKKyAgICAgICAgfSB3aGlsZSAoZGlyID4gMCk7CisgICAgfQorICAgICovCisKKyAgICAvLyB1dGlsaXR5IGZvciBkaXNwbGF5aW5nIGFycmF5cyBpbiBoZXgKKyAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgaGV4QXJyYXkoaW50W10gYXJyYXkpIHsKKyAgICAgICAgU3RyaW5nQnVpbGRlciBzYiA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIHNiLmFwcGVuZCgneycpOworICAgICAgICBmb3IgKGludCBpIDogYXJyYXkpIHsKKyAgICAgICAgICAgIGlmIChzYi5sZW5ndGgoKSA+IDEpIHsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiwgIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzYi5hcHBlbmQoSW50ZWdlci50b0hleFN0cmluZyhpKSk7CisgICAgICAgIH0KKyAgICAgICAgc2IuYXBwZW5kKCd9Jyk7CisgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBjaGVja0RpcmVjdGlvbnMoTGF5b3V0IGwsIGludCBpLCBTdHJpbmcgdGV4dCwKKyAgICAgICAgICAgIERpcmVjdGlvbnNbXSBleHBlY3RlZERpcnMsIEZvcm1hdHRlciBmKSB7CisgICAgICAgIERpcmVjdGlvbnMgZXhwZWN0ZWQgPSBleHBlY3RlZERpcnNbaV07CisgICAgICAgIERpcmVjdGlvbnMgcmVzdWx0ID0gbC5nZXRMaW5lRGlyZWN0aW9ucygwKTsKKyAgICAgICAgaWYgKCFBcnJheXMuZXF1YWxzKGV4cGVjdGVkLm1EaXJlY3Rpb25zLCByZXN1bHQubURpcmVjdGlvbnMpKSB7CisgICAgICAgICAgICBmLmZvcm1hdCgiJW5bJTJkXSAnJXMnLCAlcyAhPSAlcyIsIGksIHRleHQsCisgICAgICAgICAgICAgICAgICAgIGhleEFycmF5KGV4cGVjdGVkLm1EaXJlY3Rpb25zKSwKKyAgICAgICAgICAgICAgICAgICAgaGV4QXJyYXkocmVzdWx0Lm1EaXJlY3Rpb25zKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZXhwZWN0RGlyZWN0aW9ucyhTdHJpbmcgbXNnLCBEaXJlY3Rpb25zIGV4cGVjdGVkLCBEaXJlY3Rpb25zIHJlc3VsdCkgeworICAgICAgICBpZiAoIUFycmF5cy5lcXVhbHMoZXhwZWN0ZWQubURpcmVjdGlvbnMsIHJlc3VsdC5tRGlyZWN0aW9ucykpIHsKKyA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BlciBncm91cC4KLSAgICAgICAgICogIAotICAgICAgICAgKiBAcGFyYW0gbnVtQ2hpbGRyZW5QZXJHcm91cCBUaGUgbnVtYmVyIG9mIGNoaWxkcmVuIHBlciBncm91cC4KLSAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyBFeHBhbmRhYmxlUGFyYW1zIHNldE51bUNoaWxkcmVuKGludFtdIG51bUNoaWxkcmVuKSB7Ci0gICAgICAgICAgICBtTnVtQ2hpbGRyZW4gPSBudW1DaGlsZHJlbjsKLSAgICAgICAgICAgIHJldHVybiB0aGlzOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqCi0gICAgICAgICAqIFNldHMgdGhlIG51bWJlciBvZiBpdGVtcyBvbiB0aGUgc3VwZXJjbGFzcyBiYXNlZCBvbiB0aGUgbnVtYmVyIG9mCi0gICAgICAgICAqIGdyb3VwcyBhbmQgY2hpbGRyZW4gcGVyIGdyb3VwLgotICAgICAgICAgKi8KLSAgICAgICAgcHJpdmF0ZSBFeHBhbmRhYmxlUGFyYW1zIHN1cGVyU2V0TnVtSXRlbXMoKSB7Ci0gICAgICAgICAgICBpbnQgbnVtSXRlbXMgPSAwOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBpZiAobU51bUNoaWxkcmVuICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gbU51bUNoaWxkcmVuLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgICAgICAgICAgICAgIG51bUl0ZW1zICs9IG1OdW1DaGlsZHJlbltpXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHN1cGVyLnNldE51bUl0ZW1zKG51bUl0ZW1zKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgcmV0dXJuIHRoaXM7Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgUGF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KGludCBpID0gYWRhcHRlci5nZXRHcm91cENvdW50KCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgZmluYWwgaW50IGN1ck51bUNoaWxkcmVuID0gYWRhcHRlci5nZXRDaGlsZHJlbkNvdW50KGkpOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBpZiAobnVtQ2hpbGRyZW4gPT0gY3VyTnVtQ2hpbGRyZW4gfHwgYXRMZWFzdE9uZUNoaWxkICYmIGN1ck51bUNoaWxkcmVuID4gMCkgewotICAgICAgICAgICAgICAgIHJldHVybiBpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICByZXR1cm4gLTE7Ci0gICAgfQotICAgIAotICAgIHB1YmxpYyBMaXN0PE15R3JvdXA+IGdldEdyb3VwcygpIHsKLSAgICAgICAgcmV0dXJuIG1Hcm91cHM7Ci0gICAgfQotICAgIAotICAgIHB1YmxpYyBFeHBhbmRhYmxlTGlzdEFkYXB0ZXIgZ2V0QWRhcHRlcigpIHsKLSAgICAgICAgcmV0dXJuIG1BZGFwdGVyOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFNpbXBsZSBleHBhbmRhYmxlIGxpc3QgYWRhcHRlci4KLSAgICAgKi8KLSAgICBwcm90ZWN0ZWQgY2xhc3MgTXlBZGFwdGVyIGV4dGVuZHMgQmFzZUV4cGFuZGFibGVMaXN0QWRhcHRlciB7Ci0gICAgICAgIHB1YmxpYyBPYmplY3QgZ2V0Q2hpbGQoaW50IGdyb3VwUG9zaXRpb24sIGludCBjaGlsZFBvc2l0aW9uKSB7Ci0gICAgICAgICAgICByZXR1cm4gZ2V0VmFsdWVBdFBvc2l0aW9uKEV4cGFuZGFibGVMaXN0Vmlldy5nZXRQYWNrZWRQb3NpdGlvbkZvckNoaWxkKGdyb3VwUG9zaXRpb24sCi0gICAgICAgICAgICAgICAgICAgIGNoaWxkUG9zaXRpb24pKTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpY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LSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBsb25nIGdldEdyb3VwSWQoaW50IGdyb3VwUG9zaXRpb24pIHsKLSAgICAgICAgICAgIHJldHVybiBtR3JvdXBzLmdldChncm91cFBvc2l0aW9uKS5pZDsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBWaWV3IGdldEdyb3VwVmlldyhpbnQgZ3JvdXBQb3NpdGlvbiwgYm9vbGVhbiBpc0V4cGFuZGVkLCBWaWV3IGNvbnZlcnRWaWV3LAotICAgICAgICAgICAgICAgIFZpZXdHcm91cCBwYXJlbnQpIHsKLSAgICAgICAgICAgIHJldHVybiBnZXRWaWV3KEV4cGFuZGFibGVMaXN0Vmlldy5nZXRQYWNrZWRQb3NpdGlvbkZvckdyb3VwKGdyb3VwUG9zaXRpb24pLAotICAgICAgICAgICAgICAgICAgICBjb252ZXJ0VmlldywgcGFyZW50KTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGlzQ2hpbGRTZWxlY3RhYmxlKGludCBncm91cFBvc2l0aW9uLCBpbnQgY2hpbGRQb3NpdGlvbikgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNTdGFibGVJZHMoKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotICAgICAgICAKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIGNsYXNzIE15R3JvdXAgewotICAgICAgICBwcml2YXRlIHN0YXRpYyBsb25nIG1OZXh0SWQgPSAxMDAwOwotICAgICAgICAKLSAgICAgICAgU3RyaW5nIG5hbWU7Ci0gICAgICAgIGxvbmcgaWQgPSBtTmV4dElkKys7Ci0gICAgICAgIExpc3Q8TXlDaGlsZD4gY2hpbGRyZW47Ci0gICAgICAgIAotICAgICAgICBwdWJsaWMgTXlHcm91cChpbnQgbnVtQ2hpbGRyZW4pIHsKL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gSU9FeGNlcHRpb24geworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoCisgICAgICAgICAgICAgICAgIntcImFcIjogXCJhbmRyb2lkXCIsIFwiYlwiOiBcImJhbmFuYVwifSIpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGFzc2VydEVxdWFscygiYSIsIHJlYWRlci5uZXh0TmFtZSgpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJhbmRyb2lkIiwgcmVhZGVyLm5leHRTdHJpbmcoKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiYiIsIHJlYWRlci5uZXh0TmFtZSgpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJiYW5hbmEiLCByZWFkZXIubmV4dFN0cmluZygpKTsKKyAgICAgICAgcmVhZGVyLmVuZE9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoSnNvblRva2VuLkVORF9ET0NVTUVOVCwgcmVhZGVyLnBlZWsoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdFJlYWRFbXB0eU9iamVjdCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigie30iKSk7CisgICAgICAgIHJlYWRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBhc3NlcnRGYWxzZShyZWFkZXIuaGFzTmV4dCgpKTsKKyAgICAgICAgcmVhZGVyLmVuZE9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoSnNvblRva2VuLkVORF9ET0NVTUVOVCwgcmVhZGVyLnBlZWsoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdFNraXBPYmplY3QoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoCisgICAgICAgICAgICAgICAgIntcImFcIjogeyBcImNcIjogW10sIFwiZFwiOiBbdHJ1ZSwgdHJ1ZSwge31dIH0sIFwiYlwiOiBcImJhbmFuYVwifSIpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGFzc2VydEVxdWFscygiYSIsIHJlYWRlci5uZXh0TmFtZSgpKTsKKyAgICAgICAgcmVhZGVyLnNraXBWYWx1ZSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoImIiLCByZWFkZXIubmV4dE5hbWUoKSk7CisgICAgICAgIHJlYWRlci5za2lwVmFsdWUoKTsKKyAgICAgICAgcmVhZGVyLmVuZE9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoSnNvblRva2VuLkVORF9ET0NVTUVOVCwgcmVhZGVyLnBlZWsoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdEhlbGxvV29ybGQoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmcganNvbiA9ICJ7XG4iICsKKyAgICAgICAgICAgICAgICAiICAgXCJoZWxsb1wiOiB0cnVlLFxuIiArCisgICAgICAgICAgICAgICAgIiAgIFwiZm9vXCI6IFtcIndvcmxkXCJdXG4iICsKKyAgICAgICAgICAgICAgICAifSI7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcihqc29uKSk7CisgICAgICAgIHJlYWRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoImhlbGxvIiwgcmVhZGVyLm5leHROYW1lKCkpOworICAgICAgICBhc3NlcnRFcXVhbHModHJ1ZSwgcmVhZGVyLm5leHRCb29sZWFuKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoImZvbyIsIHJlYWRlci5uZXh0TmFtZSgpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJ3b3JsZCIsIHJlYWRlci5uZXh0U3RyaW5nKCkpOworICAgICAgICByZWFkZXIuZW5kQXJyYXkoKTsKKyAgICAgICAgcmVhZGVyLmVuZE9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoSnNvblRva2VuLkVORF9ET0NVTUVOVCwgcmVhZGVyLnBlZWsoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdE51bGxzKCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgbmV3IEpzb25SZWFkZXIobnVsbCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKE51bGxQb2ludGVyRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0RW1wdHlTdHJpbmcoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICB0cnkgeworICAgICAgICAgICAgbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiIikpLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiIikpLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0Tm9Ub3BMZXZlbE9iamVjdCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJ0cnVlIikpLm5leHRCb29sZWFuKCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0Q2hhcmFjdGVyVW5lc2NhcGluZygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZyBqc29uID0gIltcImFcIiwiCisgICAgICAgICAgICAgICAgKyAiXCJhXFxcIlwiLCIKKyAgICAgICAgICAgICAgICArICJcIlxcXCJcIiwiCisgICAgICAgICAgICAgICAgKyAiXCI6XCIsIgorICAgICAgICAgICAgICAgICsgIlwiLFwiLCIKKyAgICAgICAgICAgICAgICArICJcIlxcYlwiLCIKKyAgICAgICAgICAgICAgICArICJcIlxcZlwiLCIKKyAgICAgICAgICAgICAgICArICJcIlxcblwiLCIKKyAgICAgICAgICAgICAgICArICJcIlxcclwiLCIKKyAgICAgICAgICAgICAgICArICJcIlxcdFwiLCIKKyAgICAgICAgICAgICAgICArICJcIiBcIiwiCisgICAgICAgICAgICAgICAgKyAiXCJcXFxcXCIsIgorICAgICAgICAgICAgICAgICsgIlwie1wiLCIKKyAgICAgICAgICAgICAgICArICJcIn1cIiwiCisgICAgICAgICAgICAgICAgKyAiXCJbXCIsIgorICAgICAgICAgICAgICAgICsgIlwiXVwiLCIKKyAgICAgICAgICAgICAgICArICJcIlxcdTAwMDBcIiwiCisgICAgICAgICAgICAgICAgKyAiXCJcXHUwMDE5XCIsIgorICAgICAgICAgICAgICAgICsgIlwiXFx1MjBBQ1wiIgorICAgICAgICAgICAgICAgICsgIl0iOworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoanNvbikpOworICAgICAgICByZWFkZXIuYmVnaW5BcnJheSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoImEiLCByZWFkZXIubmV4dFN0cmluZygpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzK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FcXVhbHMoIlx1MjBBQyIsIHJlYWRlci5uZXh0U3RyaW5nKCkpOworICAgICAgICByZWFkZXIuZW5kQXJyYXkoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKEpzb25Ub2tlbi5FTkRfRE9DVU1FTlQsIHJlYWRlci5wZWVrKCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RJbnRlZ2Vyc1dpdGhGcmFjdGlvbmFsUGFydFNwZWNpZmllZCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiWzEuMCwxLjAsMS4wXSIpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKDEuMCwgcmVhZGVyLm5leHREb3VibGUoKSk7CisgICAgICAgIGFzc2VydEVxdWFscygxLCByZWFkZXIubmV4dEludCgpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKDFMLCByZWFkZXIubmV4dExvbmcoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdERvdWJsZXMoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmcganNvbiA9ICJbLTAuMCwiCisgICAgICAgICAgICAgICAgKyAiMS4wLCIKKyAgICAgICAgICAgICAgICArICIxLjc5NzY5MzEzNDg2MjMxNTdFMzA4LCIKKyAgICAgICAgICAgICAgICArICI0LjlFLTMyNCwiCisgICAgICAgICAgICAgICAgKyAiMC4wLCIKKyAgICAgICAgICAgICAgICArICItMC41LCIKKyAgICAgICAgICAgICAgICArICIyLjIyNTA3Mzg1ODUwNzIwMTRFLTMwOCwiCisgICAgICAgICAgICAgICAgKyAiMy4xNDE1OTI2NTM1ODk3OTMsIgorICAgICAgICAgICAgICAgICsgIjIuNzE4MjgxODI4NDU5MDQ1XSI7CisgICAgICAgIEpzb25SZW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U3RyaW5nUmVhZGVyKGpzb24pKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0RG91YmxlKCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdExvbmdzKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgU3RyaW5nIGpzb24gPSAiWzAsMCwwLCIKKyAgICAgICAgICAgICAgICArICIxLDEsMSwiCisgICAgICAgICAgICAgICAgKyAiLTEsLTEsLTEsIgorICAgICAgICAgICAgICAgICsgIi05MjIzMzcyMDM2ODU0Nzc1ODA4LCIKKyAgICAgICAgICAgICAgICArICI5MjIzMzcyMDM2ODU0Nzc1ODA3XSI7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcihqc29uKSk7CisgICAgICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIGFzc2VydEVxdWFscygwTCwgcmVhZGVyLm5leHRMb25nKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoMCwgcmVhZGVyLm5leHRJbnQoKSk7CisgICAgICAgIGFzc2VydEVxdWFscygwLjAsIHJlYWRlci5uZXh0RG91YmxlKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoMUwsIHJlYWRlci5uZXh0TG9uZygpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKDEsIHJlYWRlci5uZXh0SW50KCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoMS4wLCByZWFkZXIubmV4dERvdWJsZSgpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKC0xTCwgcmVhZGVyLm5leHRMb25nKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoLTEsIHJlYWRlci5uZXh0SW50KCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoLTEuMCwgcmVhZGVyLm5leHREb3VibGUoKSk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIubmV4dEludCgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgICAgICBhc3NlcnRFcXVhbHMoTG9uZy5NSU5fVkFMVUUsIHJlYWRlci5uZXh0TG9uZygpKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0SW50KCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgICAgIGFzc2VydEVxdWFscyhMb25nLk1BWF9WQUxVRSwgcmVhZGVyLm5leHRMb25nKCkpOworICAgICAgICByZWFkZXIuZW5kQXJyYXkoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKEpzb25Ub2tlbi5FTkRfRE9DVU1FTlQsIHJlYWRlci5wZWVrKCkpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRoaXMgdGVzdCBmYWlscyBiZWNhdXNlIHRoZXJlJ3Mgbm8gZG91YmxlIGZvciA5MjIzMzcyMDM2ODU0Nzc1ODA2LCBhbmQKKyAgICAgKiBvdXIgbG9uZyBwYXJzaW5nIHVzZXMgRG91YmxlLnBhcnNlRG91YmxlKCkgZm9yIGZyYWN0aW9uYWwgdmFsdWVzLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHRlc3RIaWdoUHJlY2lzaW9uTG9uZygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZyBqc29uID0gIls5MjIzMzcyMDM2ODU0Nzc1ODA2LjAwMF0iOworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoanNvbikpOworICAgICAgICByZWFkZXIuYmVnaW5BcnJheSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoOTIyMzM3MjAzNjg1NDc3NTgwNkwsIHJlYWRlci5uZXh0TG9uZygpKTsKKyAgICAgICAgcmVhZGVyLmVuZEFycmF5KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdE51bWJlcldpdGhPY3RhbFByZWZpeCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZyBqc29uID0gIlswMV0iOworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoanNvbikpOworICAgICAgICByZWFkZXIuYmVnaW5BcnJheSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLm5leHRJbnQoKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0TG9uZygpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLm5leHREb3VibGUoKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKyAgICAgICAgYXNzZXJ0RXF1YWxzKCIwMSIsIHJlYWRlci5uZXh0U3RyaW5nKCkpOworICAgICAgICByZWFkZXIuZW5kQXJyYXkoKTsKKyAgICA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AgICByZWFkZXIubmV4dE51bGwoKTsKKyAgICAgICAgcmVhZGVyLm5leHROdWxsKCk7CisgICAgICAgIHJlYWRlci5lbmRBcnJheSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoSnNvblRva2VuLkVORF9ET0NVTUVOVCwgcmVhZGVyLnBlZWsoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdE1pc3NpbmdWYWx1ZSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigie1wiYVwiOn0iKSk7CisgICAgICAgIHJlYWRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoImEiLCByZWFkZXIubmV4dE5hbWUoKSk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIubmV4dFN0cmluZygpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdFByZW1hdHVyZUVuZE9mSW5wdXQoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoIntcImFcIjp0cnVlLCIpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGFzc2VydEVxdWFscygiYSIsIHJlYWRlci5uZXh0TmFtZSgpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKHRydWUsIHJlYWRlci5uZXh0Qm9vbGVhbigpKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0TmFtZSgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdFByZW1hdHVyZWx5Q2xvc2VkKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigie1wiYVwiOltdfSIpKTsKKyAgICAgICAgICAgIHJlYWRlci5iZWdpbk9iamVjdCgpOworICAgICAgICAgICAgcmVhZGVyLmNsb3NlKCk7CisgICAgICAgICAgICByZWFkZXIubmV4dE5hbWUoKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKworICAgICAgICB0cnkgeworICAgICAgICAgICAgSnNvblJlYWRlciByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJ7XCJhXCI6W119IikpOworICAgICAgICAgICAgcmVhZGVyLmNsb3NlKCk7CisgICAgICAgICAgICByZWFkZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKworICAgICAgICB0cnkgeworICAgICAgICAgICAgSnNvblJlYWRlciByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJ7XCJhXCI6dHJ1ZX0iKSk7CisgICAgICAgICAgICByZWFkZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0TmFtZSgpOworICAgICAgICAgICAgcmVhZGVyLnBlZWsoKTsKKyAgICAgICAgICAgIHJlYWRlci5jbG9zZSgpOworICAgICAgICAgICAgcmVhZGVyLm5leHRCb29sZWFuKCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdE5leHRGYWlsdXJlc0RvTm90QWR2YW5jZSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigie1wiYVwiOnRydWV9IikpOworICAgICAgICByZWFkZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0U3RyaW5nKCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgICAgIGFzc2VydEVxdWFscygiYSIsIHJlYWRlci5uZXh0TmFtZSgpKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0TmFtZSgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5lbmRBcnJheSgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIuZW5kT2JqZWN0KCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgICAgIGFzc2VydEVxdWFscyh0cnVlLCByZWFkZXIubmV4dEJvb2xlYW4oKSk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIubmV4dFN0cmluZygpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLm5leHROYW1lKCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIuYmVnaW5BcnJheSgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLmVuZEFycmF5KCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgICAgIHJlYWRlci5lbmRPYmplY3QoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKEpzb25Ub2tlbi5FTkRfRE9DVU1FTlQsIHJlYWRlci5wZWVrKCkpOworICAgICAgICByZWFkZXIuY2xvc2UoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0U3RyaW5nTnVsbElzTm90TnVsbCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiW1wibnVsbFwiXSIpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0TnVsbCgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3ROdWxsTGl0ZXJhbElzTm90QVN0cmluZygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgSnNvblJlYWRlciByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbbnVsbF0iKSk7CisgICAgICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIubmV4dFN0cmluZygpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RTdHJpY3ROYW1lVmFsdWVTZXBhcmF0b3IoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoIntcImFcIj10cnVlfSIpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGFzc2VydEVxdWFscygiYSIsIHJlYWRlci5uZXh0TmFtZSgpKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0Qm9vbGVhbigpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisKKyAgICAgICAgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigie1wiYVwiPT50cnVlfSIpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGFzc2VydEVxdWFscygiYSIsIHJlYWRlci5uZXh0TmFtZSgpKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0Qm9vbGVhbigpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdExlbmllbnROYW1lVmFsdWVTZXBhcmF0b3IoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoIntcImFcIj10cnVlfSIpKTsKKyAgICAgICAgcmVhZGVyLnNldExlbmllbnQodHJ1ZSk7CisgICAgICAgIHJlYWRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoImEiLCByZWFkZXIubmV4dE5hbWUoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyh0cnVlLCByZWFkZXIubmV4dEJvb2xlYW4oKSk7CisKKyAgICAgICAgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigie1wiYVwiPT50cnVlfSIpKTsKKyAgICAgICAgcmVhZGVyLnNldExlbmllbnQodHJ1ZSk7CisgICAgICAgIHJlYWRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoImEiLCByZWFkZXIubmV4dE5hbWUoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyh0cnVlLCByZWFkZXIubmV4dEJvb2xlYW4oKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdFN0cmljdENvbW1lbnRzKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgSnNvblJlYWRlciByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbLy8gY29tbWVudCBcbiB0cnVlXSIpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0Qm9vbGVhbigpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisKKyAgICAgICAgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiWyMgY29tbWVudCBcbiB0cnVlXSIpKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0Qm9vbGVhbigpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisKKyAgICAgICAgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiWy8qIGNvbW1lbnQgKi8gdHJ1ZV0iKSk7CisgICAgICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIubmV4dEJvb2xlYW4oKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RMZW5pZW50Q29tbWVudHMoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoIlsvLyBjb21tZW50IFxuIHRydWVdIikpOworICAgICAgICByZWFkZXIuc2V0TGVuaWVudCh0cnVlKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKHRydWUsIHJlYWRlci5uZXh0Qm9vbGVhbigpKTsKKworICAgICAgICByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbIyBjb21tZW50IFxuIHRydWVdIikpOworICAgICAgICByZWFkZXIuc2V0TGVuaWVudCh0cnVlKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKHRydWUsIHJlYWRlci5uZXh0Qm9vbGVhbigpKTsKKworICAgICAgICByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbLyogY29tbWVudCAqLyB0cnVlXSIpKTsKKyAgICAgICAgcmVhZGVyLnNldExlbmllbnQodHJ1ZSk7CisgICAgICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIGFzc2VydEVxdWFscyh0cnVlLCByZWFkZXIubmV4dEJvb2xlYW4oKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdFN0cmljdFVucXVvdGVkTmFtZXMoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoInthOnRydWV9IikpOworICAgICAgICByZWFkZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0TmFtZSgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdExlbmllbnRVbnF1b3RlZE5hbWVzKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgSnNvblJlYWRlciByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJ7YTp0cnVlfSIpKTsKKyAgICAgICAgcmVhZGVyLnNldExlbmllbnQodHJ1ZSk7CisgICAgICAgIHJlYWRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoImEiLCByZWFkZXIubmV4dE5hbWUoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdFN0cmljdFNpbmdsZVF1b3RlZE5hbWVzKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgSnNvblJlYWRlciByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJ7J2EnOnRydWV9IikpOworICAgICAgICByZWFkZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0TmFtZSgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdExlbmllbnRTaW5nbGVRdW90ZWROYW1lcygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigieydhJzp0cnVlfSIpKTsKKyAgICAgICAgcmVhZGVyLnNldExlbmllbnQodHJ1ZSk7CisgICAgICAgIHJlYWRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoImEiLCByZWFkZXIubmV4dE5hbWUoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdFN0cmljdFVucXVvdGVkU3RyaW5ncygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiW2FdIikpOworICAgICAgICByZWFkZXIuYmVnaW5BcnJheSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLm5leHRTdHJpbmcoKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RMZW5pZW50VW5xdW90ZWRTdHJpbmdzKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgSnNvblJlYWRlciByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbYV0iKSk7CisgICAgICAgIHJlYWRlci5zZXRMZW5pZW50KHRydWUpOworICAgICAgICByZWFkZXIuYmVnaW5BcnJheSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoImEiLCByZWFkZXIubmV4dFN0cmluZygpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0U3RyaWN0U2luZ2xlUXVvdGVkU3RyaW5ncygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiWydhJ10iKSk7CisgICAgICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIubmV4dFN0cmluZygpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdExlbmllbnRTaW5nbGVRdW90ZWRTdHJpbmdzKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgSnNvblJlYWRlciByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbJ2EnXSIpKTsKKyAgICAgICAgcmVhZGVyLnNldExlbmllbnQodHJ1ZSk7CisgICAgICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIGFzc2VydEVxdWFscygiYSIsIHJlYWRlci5uZXh0U3RyaW5nKCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RTdHJpY3RTZW1pY29sb25EZWxpbWl0ZWRBcnJheSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiW3RydWU7dHJ1ZV0iKSk7CisgICAgICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIubmV4dEJvb2xlYW4oKTsKKyAgICAgICAgICAgIHJlYWRlci5uZXh0Qm9vbGVhbigpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdExlbmllbnRTZW1pY29sb25EZWxpbWl0ZWRBcnJheSgpIHRocm93cyBJT0V4Y2VwdGlvbiB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ICAgICAgICByZWFkZXIuc2V0TGVuaWVudCh0cnVlKTsKKyAgICAgICAgcmVhZGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGFzc2VydEVxdWFscygiYSIsIHJlYWRlci5uZXh0TmFtZSgpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKHRydWUsIHJlYWRlci5uZXh0Qm9vbGVhbigpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJiIiwgcmVhZGVyLm5leHROYW1lKCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RTdHJpY3RVbm5lY2Vzc2FyeUFycmF5U2VwYXJhdG9ycygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEpzb25SZWFkZXIgcmVhZGVyID0gbmV3IEpzb25SZWFkZXIobmV3IFN0cmluZ1JlYWRlcigiW3RydWUsLHRydWVdIikpOworICAgICAgICByZWFkZXIuYmVnaW5BcnJheSgpOworICAgICAgICBhc3NlcnRFcXVhbHModHJ1ZSwgcmVhZGVyLm5leHRCb29sZWFuKCkpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLm5leHROdWxsKCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKworICAgICAgICByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbLHRydWVdIikpOworICAgICAgICByZWFkZXIuYmVnaW5BcnJheSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLm5leHROdWxsKCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKworICAgICAgICByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbdHJ1ZSxdIikpOworICAgICAgICByZWFkZXIuYmVnaW5BcnJheSgpOworICAgICAgICBhc3NlcnRFcXVhbHModHJ1ZSwgcmVhZGVyLm5leHRCb29sZWFuKCkpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVhZGVyLm5leHROdWxsKCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKworICAgICAgICByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbLF0iKSk7CisgICAgICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZWFkZXIubmV4dE51bGwoKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RMZW5pZW50VW5uZWNlc3NhcnlBcnJheVNlcGFyYXRvcnMoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBKc29uUmVhZGVyIHJlYWRlciA9IG5ldyBKc29uUmVhZGVyKG5ldyBTdHJpbmdSZWFkZXIoIlt0cnVlLCx0cnVlXSIpKTsKKyAgICAgICAgcmVhZGVyLnNldExlbmllbnQodHJ1ZSk7CisgICAgICAgIHJlYWRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIGFzc2VydEVxdWFscyh0cnVlLCByZWFkZXIubmV4dEJvb2xlYW4oKSk7CisgICAgICAgIHJlYWRlci5uZXh0TnVsbCgpOworICAgICAgICBhc3NlcnRFcXVhbHModHJ1ZSwgcmVhZGVyLm5leHRCb29sZWFuKCkpOworICAgICAgICByZWFkZXIuZW5kQXJyYXkoKTsKKworICAgICAgICByZWFkZXIgPSBuZXcgSnNvblJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKCJbLHRydWVdIikpOworICAgIC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KKworcHVibGljIGZpbmFsIGNsYXNzIEpzb25Xcml0ZXJUZXN0IGV4dGVuZHMgVGVzdENhc2UgeworCisgICAgcHVibGljIHZvaWQgdGVzdFdyb25nVG9wTGV2ZWxUeXBlKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgU3RyaW5nV3JpdGVyIHN0cmluZ1dyaXRlciA9IG5ldyBTdHJpbmdXcml0ZXIoKTsKKyAgICAgICAgSnNvbldyaXRlciBqc29uV3JpdGVyID0gbmV3IEpzb25Xcml0ZXIoc3RyaW5nV3JpdGVyKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoImEiKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0VHdvTmFtZXMoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmdXcml0ZXIgc3RyaW5nV3JpdGVyID0gbmV3IFN0cmluZ1dyaXRlcigpOworICAgICAgICBKc29uV3JpdGVyIGpzb25Xcml0ZXIgPSBuZXcgSnNvbldyaXRlcihzdHJpbmdXcml0ZXIpOworICAgICAgICBqc29uV3JpdGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiYSIpOworICAgICAgICB0cnkgeworICAgICAgICAgICAganNvbldyaXRlci5uYW1lKCJhIik7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdE5hbWVXaXRob3V0VmFsdWUoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmdXcml0ZXIgc3RyaW5nV3JpdGVyID0gbmV3IFN0cmluZ1dyaXRlcigpOworICAgICAgICBKc29uV3JpdGVyIGpzb25Xcml0ZXIgPSBuZXcgSnNvbldyaXRlcihzdHJpbmdXcml0ZXIpOworICAgICAgICBqc29uV3JpdGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiYSIpOworICAgICAgICB0cnkgeworICAgICAgICAgICAganNvbldyaXRlci5lbmRPYmplY3QoKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGV4cGVjdGVkKSB7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0VmFsdWVXaXRob3V0TmFtZSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ1dyaXRlciBzdHJpbmdXcml0ZXIgPSBuZXcgU3RyaW5nV3JpdGVyKCk7CisgICAgICAgIEpzb25Xcml0ZXIganNvbldyaXRlciA9IG5ldyBKc29uV3JpdGVyKHN0cmluZ1dyaXRlcik7CisgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGpzb25Xcml0ZXIudmFsdWUodHJ1ZSk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdE11bHRpcGxlVG9wTGV2ZWxWYWx1ZXMoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmdXcml0ZXIgc3RyaW5nV3JpdGVyID0gbmV3IFN0cmluZ1dyaXRlcigpOworICAgICAgICBKc29uV3JpdGVyIGpzb25Xcml0ZXIgPSBuZXcgSnNvbldyaXRlcihzdHJpbmdXcml0ZXIpOworICAgICAgICBqc29uV3JpdGVyLmJlZ2luQXJyYXkoKS5lbmRBcnJheSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAganNvbldyaXRlci5iZWdpbkFycmF5KCk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBleHBlY3RlZCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdEJhZE5lc3RpbmdPYmplY3QoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmdXcml0ZXIgc3RyaW5nV3JpdGVyID0gbmV3IFN0cmluZ1dyaXRlcigpOworICAgICAgICBKc29uV3JpdGVyIGpzb25Xcml0ZXIgPSBuZXcgSnNvbldyaXRlcihzdHJpbmdXcml0ZXIpOworICAgICAgICBqc29uV3JpdGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAganNvbldyaXRlci5iZWdpbk9iamVjdCgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAganNvbldyaXRlci5lbmRBcnJheSgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RCYWROZXN0aW5nQXJyYXkoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmdXcml0ZXIgc3RyaW5nV3JpdGVyID0gbmV3IFN0cmluZ1dyaXRlcigpOworICAgICAgICBKc29uV3JpdGVyIGpzb25Xcml0ZXIgPSBuZXcgSnNvbldyaXRlcihzdHJpbmdXcml0ZXIpOworICAgICAgICBqc29uV3JpdGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAganNvbldyaXRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBqc29uV3JpdGVyLmVuZE9iamVjdCgpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3ROdWxsTmFtZSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ1dyaXRlciBzdHJpbmdXcml0ZXIgPSBuZXcgU3RyaW5nV3JpdGVyKCk7CisgICAgICAgIEpzb25Xcml0ZXIganNvbldyaXRlciA9IG5ldyBKc29uV3JpdGVyKHN0cmluZ1dyaXRlcik7CisgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGpzb25Xcml0ZXIubmFtZShudWxsKTsKKyAgICAgICAgICAgIGZhaWwoKTsKKyAgICAgICAgfSBjYXRjaCAoTnVsbFBvaW50ZXJFeGNlcHRpb24gZXhwZWN0ZWQpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3ROdWxsU3RyaW5nVmFsdWUoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmdXcml0ZXIgc3RyaW5nV3JpdGVyID0gbmV3IFN0cmluZ1dyaXRlcigpOworICAgICAgICBKc29uV3JpdGVyIGpzb25Xcml0ZXIgPSBuZXcgSnNvbldyaXRlcihzdHJpbmdXcml0ZXIpOworICAgICAgICBqc29uV3JpdGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiYSIpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKG51bGwpOworICAgICAgICBqc29uV3JpdGVyLmVuZE9iamVjdCgpOworICAgICAgICBhc3NlcnRFcXVhbHMoIntcImFcIjpudWxsfSIsIHN0cmluZ1dyaXRlci50b1N0cmluZygpKTsKKyAgICB9CisKKyAg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VyKHN0cmluZ1dyaXRlcik7CisgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5BcnJheSgpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKC0wLjApOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKDEuMCk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoRG91YmxlLk1BWF9WQUxVRSk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoRG91YmxlLk1JTl9WQUxVRSk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoMC4wKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSgtMC41KTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZShEb3VibGUuTUlOX05PUk1BTCk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoTWF0aC5QSSk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoTWF0aC5FKTsKKyAgICAgICAganNvbldyaXRlci5lbmRBcnJheSgpOworICAgICAgICBqc29uV3JpdGVyLmNsb3NlKCk7CisgICAgICAgIGFzc2VydEVxdWFscygiWy0wLjAsIgorICAgICAgICAgICAgICAgICsgIjEuMCwiCisgICAgICAgICAgICAgICAgKyAiMS43OTc2OTMxMzQ4NjIzMTU3RTMwOCwiCisgICAgICAgICAgICAgICAgKyAiNC45RS0zMjQsIgorICAgICAgICAgICAgICAgICsgIjAuMCwiCisgICAgICAgICAgICAgICAgKyAiLTAuNSwiCisgICAgICAgICAgICAgICAgKyAiMi4yMjUwNzM4NTg1MDcyMDE0RS0zMDgsIgorICAgICAgICAgICAgICAgICsgIjMuMTQxNTkyNjUzNTg5NzkzLCIKKyAgICAgICAgICAgICAgICArICIyLjcxODI4MTgyODQ1OTA0NV0iLCBzdHJpbmdXcml0ZXIudG9TdHJpbmcoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdExvbmdzKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgU3RyaW5nV3JpdGVyIHN0cmluZ1dyaXRlciA9IG5ldyBTdHJpbmdXcml0ZXIoKTsKKyAgICAgICAgSnNvbldyaXRlciBqc29uV3JpdGVyID0gbmV3IEpzb25Xcml0ZXIoc3RyaW5nV3JpdGVyKTsKKyAgICAgICAganNvbldyaXRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoMCk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoMSk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoLTEpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKExvbmcuTUlOX1ZBTFVFKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZShMb25nLk1BWF9WQUxVRSk7CisgICAgICAgIGpzb25Xcml0ZXIuZW5kQXJyYXkoKTsKKyAgICAgICAganNvbldyaXRlci5jbG9zZSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoIlswLCIKKyAgICAgICAgICAgICAgICArICIxLCIKKyAgICAgICAgICAgICAgICArICItMSwiCisgICAgICAgICAgICAgICAgKyAiLTkyMjMzNzIwMzY4NTQ3NzU4MDgsIgorICAgICAgICAgICAgICAgICsgIjkyMjMzNzIwMzY4NTQ3NzU4MDddIiwgc3RyaW5nV3JpdGVyLnRvU3RyaW5nKCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RCb29sZWFucygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ1dyaXRlciBzdHJpbmdXcml0ZXIgPSBuZXcgU3RyaW5nV3JpdGVyKCk7CisgICAgICAgIEpzb25Xcml0ZXIganNvbldyaXRlciA9IG5ldyBKc29uV3JpdGVyKHN0cmluZ1dyaXRlcik7CisgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5BcnJheSgpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKHRydWUpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKGZhbHNlKTsKKyAgICAgICAganNvbldyaXRlci5lbmRBcnJheSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoIlt0cnVlLGZhbHNlXSIsIHN0cmluZ1dyaXRlci50b1N0cmluZygpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0TnVsbHMoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBTdHJpbmdXcml0ZXIgc3RyaW5nV3JpdGVyID0gbmV3IFN0cmluZ1dyaXRlcigpOworICAgICAgICBKc29uV3JpdGVyIGpzb25Xcml0ZXIgPSBuZXcgSnNvbldyaXRlcihzdHJpbmdXcml0ZXIpOworICAgICAgICBqc29uV3JpdGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAganNvbldyaXRlci5udWxsVmFsdWUoKTsKKyAgICAgICAganNvbldyaXRlci5lbmRBcnJheSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoIltudWxsXSIsIHN0cmluZ1dyaXRlci50b1N0cmluZygpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0U3RyaW5ncygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ1dyaXRlciBzdHJpbmdXcml0ZXIgPSBuZXcgU3RyaW5nV3JpdGVyKCk7CisgICAgICAgIEpzb25Xcml0ZXIganNvbldyaXRlciA9IG5ldyBKc29uV3JpdGVyKHN0cmluZ1dyaXRlcik7CisgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5BcnJheSgpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKCJhIik7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoImFcIiIpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKCJcIiIpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKCI6Iik7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoIiwiKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSgiXGIiKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSgiXGYiKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSgiXG4iKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSgiXHIiKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSgiXHQiKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSgiICIpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKCJcXCIpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKCJ7Iik7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoIn0iKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSgiWyIpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKCJdIik7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoIlwwIik7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoIlx1MDAxOSIpOworICAgICAgICBqc29uV3JpdGVyLmVuZEFycmF5KCk7CisgICAgICAgIGFzc2VydEVxdWFscygiW1wiYVwiLCIKKyAgICAgICAgICAgICAgICArICJcImFcXFwiXCIsIgorICAgICAgICAgICAgICAgICsgIlwiXFxcIlwiLCIKKyAgICAgICAgICAgICAgICArICJcIjpcIiwiCisgICAgICAgICAgICAgICAgKyAiXCIsXCIsIgorICAgICAgICAgICAgICAgICsgIlwiXFxiXCIsIgorICAgICAgICAgICAgICAgICsgIlwiXFxmXCIsIgorICAgICAgICAgICAgICAgICsgIlwiXFxuXCIsIgorICAgICAgICAgICAgICAgICsgIlwiXFxyXCIsIgorICAgICAgICAgICAgICAgICsgIlwiXFx0XCIsIgorICAgICAgICAgICAgICAgICsgIlwiIFwiLCIKKyAgICAgICAgICAgICAgICArICJcIlxcXFxcIiwiCisgICAgICAgICAgICAgICAgKyAiXCJ7XCIsIgorICAgICAgICAgICAgICAgICsgIlwifVwiLCIKKyAgICAgICAgICAgICAgICArICJcIltcIiwiCisgICAgICAgICAgICAgICAgKyAiXCJdXCIsIgorICAgICAgICAgICAgICAgICsgIlwiXFx1MDAwMFwiLCIKKyAgICAgICAgICAgICAgICArICJcI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sKKyAgICAgICAganNvbldyaXRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAganNvbldyaXRlci5uYW1lKCJhIikudmFsdWUoNSk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiYiIpLnZhbHVlKGZhbHNlKTsKKyAgICAgICAganNvbldyaXRlci5lbmRPYmplY3QoKTsKKyAgICAgICAganNvbldyaXRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBqc29uV3JpdGVyLm5hbWUoImMiKS52YWx1ZSg2KTsKKyAgICAgICAganNvbldyaXRlci5uYW1lKCJkIikudmFsdWUodHJ1ZSk7CisgICAgICAgIGpzb25Xcml0ZXIuZW5kT2JqZWN0KCk7CisgICAgICAgIGpzb25Xcml0ZXIuZW5kQXJyYXkoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJbe1wiYVwiOjUsXCJiXCI6ZmFsc2V9LCIKKyAgICAgICAgICAgICAgICArICJ7XCJjXCI6NixcImRcIjp0cnVlfV0iLCBzdHJpbmdXcml0ZXIudG9TdHJpbmcoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdEFycmF5c0luT2JqZWN0cygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ1dyaXRlciBzdHJpbmdXcml0ZXIgPSBuZXcgU3RyaW5nV3JpdGVyKCk7CisgICAgICAgIEpzb25Xcml0ZXIganNvbldyaXRlciA9IG5ldyBKc29uV3JpdGVyKHN0cmluZ1dyaXRlcik7CisgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAganNvbldyaXRlci5uYW1lKCJhIik7CisgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5BcnJheSgpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKDUpOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKGZhbHNlKTsKKyAgICAgICAganNvbldyaXRlci5lbmRBcnJheSgpOworICAgICAgICBqc29uV3JpdGVyLm5hbWUoImIiKTsKKyAgICAgICAganNvbldyaXRlci5iZWdpbkFycmF5KCk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoNik7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUodHJ1ZSk7CisgICAgICAgIGpzb25Xcml0ZXIuZW5kQXJyYXkoKTsKKyAgICAgICAganNvbldyaXRlci5lbmRPYmplY3QoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJ7XCJhXCI6WzUsZmFsc2VdLCIKKyAgICAgICAgICAgICAgICArICJcImJcIjpbNix0cnVlXX0iLCBzdHJpbmdXcml0ZXIudG9TdHJpbmcoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdERlZXBOZXN0aW5nQXJyYXlzKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgU3RyaW5nV3JpdGVyIHN0cmluZ1dyaXRlciA9IG5ldyBTdHJpbmdXcml0ZXIoKTsKKyAgICAgICAgSnNvbldyaXRlciBqc29uV3JpdGVyID0gbmV3IEpzb25Xcml0ZXIoc3RyaW5nV3JpdGVyKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAyMDsgaSsrKSB7CisgICAgICAgICAgICBqc29uV3JpdGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDIwOyBpKyspIHsKKyAgICAgICAgICAgIGpzb25Xcml0ZXIuZW5kQXJyYXkoKTsKKyAgICAgICAgfQorICAgICAgICBhc3NlcnRFcXVhbHMoIltbW1tbW1tbW1tbW1tbW1tbW1tbXV1dXV1dXV1dXV1dXV1dXV1dXV0iLCBzdHJpbmdXcml0ZXIudG9TdHJpbmcoKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdERlZXBOZXN0aW5nT2JqZWN0cygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ1dyaXRlciBzdHJpbmdXcml0ZXIgPSBuZXcgU3RyaW5nV3JpdGVyKCk7CisgICAgICAgIEpzb25Xcml0ZXIganNvbldyaXRlciA9IG5ldyBKc29uV3JpdGVyKHN0cmluZ1dyaXRlcik7CisgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAyMDsgaSsrKSB7CisgICAgICAgICAgICBqc29uV3JpdGVyLm5hbWUoImEiKTsKKyAgICAgICAgICAgIGpzb25Xcml0ZXIuYmVnaW5PYmplY3QoKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDIwOyBpKyspIHsKKyAgICAgICAgICAgIGpzb25Xcml0ZXIuZW5kT2JqZWN0KCk7CisgICAgICAgIH0KKyAgICAgICAganNvbldyaXRlci5lbmRPYmplY3QoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJ7XCJhXCI6e1wiYVwiOntcImFcIjp7XCJhXCI6e1wiYVwiOntcImFcIjp7XCJhXCI6e1wiYVwiOntcImFcIjp7XCJhXCI6IgorICAgICAgICAgICAgICAgICsgIntcImFcIjp7XCJhXCI6e1wiYVwiOntcImFcIjp7XCJhXCI6e1wiYVwiOntcImFcIjp7XCJhXCI6e1wiYVwiOntcImFcIjp7IgorICAgICAgICAgICAgICAgICsgIn19fX19fX19fX19fX19fX19fX19fSIsIHN0cmluZ1dyaXRlci50b1N0cmluZygpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0UmVwZWF0ZWROYW1lKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgU3RyaW5nV3JpdGVyIHN0cmluZ1dyaXRlciA9IG5ldyBTdHJpbmdXcml0ZXIoKTsKKyAgICAgICAgSnNvbldyaXRlciBqc29uV3JpdGVyID0gbmV3IEpzb25Xcml0ZXIoc3RyaW5nV3JpdGVyKTsKKyAgICAgICAganNvbldyaXRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBqc29uV3JpdGVyLm5hbWUoImEiKS52YWx1ZSh0cnVlKTsKKyAgICAgICAganNvbldyaXRlci5uYW1lKCJhIikudmFsdWUoZmFsc2UpOworICAgICAgICBqc29uV3JpdGVyLmVuZE9iamVjdCgpOworICAgICAgICAvLyBKc29uV3JpdGVyIGRvZXNuJ3QgYXR0ZW1wdCB0byBkZXRlY3QgZHVwbGljYXRlIG5hbWVzCisgICAgICAgIGFzc2VydEVxdWFscygie1wiYVwiOnRydWUsXCJhXCI6ZmFsc2V9Iiwgc3RyaW5nV3JpdGVyLnRvU3RyaW5nKCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RQcmV0dHlQcmludE9iamVjdCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ1dyaXRlciBzdHJpbmdXcml0ZXIgPSBuZXcgU3RyaW5nV3JpdGVyKCk7CisgICAgICAgIEpzb25Xcml0ZXIganNvbldyaXRlciA9IG5ldyBKc29uV3JpdGVyKHN0cmluZ1dyaXRlcik7CisgICAgICAgIGpzb25Xcml0ZXIuc2V0SW5kZW50KCIgICAiKTsKKworICAgICAgICBqc29uV3JpdGVyLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiYSIpLnZhbHVlKHRydWUpOworICAgICAgICBqc29uV3JpdGVyLm5hbWUoImIiKS52YWx1ZShmYWxzZSk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiYyIpLnZhbHVlKDUuMCk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiZSIpLm51bGxWYWx1ZSgpOworICAgICAgICBqc29uV3JpdGVyLm5hbWUoImYiKS5iZWdpbkFycmF5KCk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoNi4wKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSg3LjApOworICAgICAgICBqc29uV3JpdGVyLmVuZEFycmF5KCk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiZyIpLmJlZ2luT2JqZWN0KCk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiaCIpLnZhbHVlKDguMCk7CisgICAgICAgIGpzb25Xcml0ZXIubmFtZSgiaSIpLnZhbHVlKDkuMCk7CisgICAgICAgIGpzb25Xcml0ZXIuZW5kT2JqZWN0KCk7CisgICAgICAgIGpzb25Xcml0ZXIuZW5kT2JqZWN0KCk7CisKKyAgICAgICAgU3RyaW5nIGV4cGVjdGVkID0gIntcbiIKKyAgICAgICAgICAgICAgICArICIgICBcImFcIjogdHJ1ZSxcbiIKKyAgICAgICAgICAgICAgICArICIgICBcImJcIjogZmFsc2UsXG4iCisgICAgICAgICAgICAgICAgKyAiICAgXCJjXCI6IDUuMCxcbiIKKyAgICAgICAgICAgICAgICArICIgICBcImVcIjogbnVsbCxcbiIKKyAgICAgICAgICAgICAgICArICIgICBcImZcIjogW1xuIgorICAgICAgICAgICAgICAgICsgIiAgICAgIDYuMCxcbiIKKyAgICAgICAgICAgICAgICArICIgICAgICA3LjBcbiIKKyAgICAgICAgICAgICAgICArICIgICBdLFxuIgorICAgICAgICAgICAgICAgICsgIiAgIFwiZ1wiOiB7XG4iCisgICAgICAgICAgICAgICAgKyAiICAgICAgXCJoXCI6IDguMCxcbiIKKyAgICAgICAgICAgICAgICArICIgICAgICBcImlcIjogOS4wXG4iCisgICAgICAgICAgICAgICAgKyAiICAgfVxuIgorICAgICAgICAgICAgICAgICsgIn0iOworICAgICAgICBhc3NlcnRFcXVhbHMoZXhwZWN0ZWQsIHN0cmluZ1dyaXRlci50b1N0cmluZygpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0UHJldHR5UHJpbnRBcnJheSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZ1dyaXRlciBzdHJpbmdXcml0ZXIgPSBuZXcgU3RyaW5nV3JpdGVyKCk7CisgICAgICAgIEpzb25Xcml0ZXIganNvbldyaXRlciA9IG5ldyBKc29uV3JpdGVyKHN0cmluZ1dyaXRlcik7CisgICAgICAgIGpzb25Xcml0ZXIuc2V0SW5kZW50KCIgICAiKTsKKworICAgICAgICBqc29uV3JpdGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSh0cnVlKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZShmYWxzZSk7CisgICAgICAgIGpzb25Xcml0ZXIudmFsdWUoNS4wKTsKKyAgICAgICAganNvbldyaXRlci5udWxsVmFsdWUoKTsKKyAgICAgICAganNvbldyaXRlci5iZWdpbk9iamVjdCgpOworICAgICAgICBqc29uV3JpdGVyLm5hbWUoImEiKS52YWx1ZSg2LjApOworICAgICAgICBqc29uV3JpdGVyLm5hbWUoImIiKS52YWx1ZSg3LjApOworICAgICAgICBqc29uV3JpdGVyLmVuZE9iamVjdCgpOworICAgICAgICBqc29uV3JpdGVyLmJlZ2luQXJyYXkoKTsKKyAgICAgICAganNvbldyaXRlci52YWx1ZSg4LjApOworICAgICAgICBqc29uV3JpdGVyLnZhbHVlKDkuMCk7CisgICAgICAgIGpzb25Xcml0ZXIuZW5kQXJyYXkoKTsKKyAgICAgICAganNvbldyaXRlci5lbmRBcnJheSgpOworCisgICAgICAgIFN0cmluZyBleHBlY3RlZCA9ICJbXG4iCisgICAgICAgICAgICAgICAgKyAiICAgdHJ1ZSxcbiIKKyAgICAgICAgICAgICAgICArICIgICBmYWxzZSxcbiIKKyAgICAgICAgICAgICAgICArICIgICA1LjAsXG4iCisgICAgICAgICAgICAgICAgKyAiICAgbnVsbCxcbiIKKyAgICAgICAgICAgICAgICArICIgICB7XG4iCisgICAgICAgICAgICAgICAgKyAiICAgICAgXCJhXCI6IDYuMCxcbiIKKyAgICAgICAgICAgICAgICArICIgICAgICBcImJcIjogNy4wXG4iCisgICAgICAgICAgICAgICAgKyAiICAgfSxcbiIKKyAgICAgICAgICAgICAg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YXRpYyBTdHJpbmcgc1JlY2VpdmVkU2VsZWN0aW9uU3RyaW5nID0gU0VMRUNUSU9OX1NUUklOR19VTktOT1dOOworCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgc2V0VXAoKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgc3VwZXIuc2V0VXAoKTsKKyAgICAgICAgbVdvcmtlciA9IG5ldyBXb3JrZXIoKTsKKyAgICAgICAgc0luc3RhbmNlID0gdGhpczsKKyAgICAgICAgaWYgKHNFeGVjdXRlZFRlc3RDb3VudCA9PSAwKSB7CisgICAgICAgICAgICAvLyB1bnRpbCBKVW5pdDQgY29tZXMgdG8gcGxheSB3aXRoIEBCZWZvcmVUZXN0CisgICAgICAgICAgICBkaXNhYmxlQWNjZXNzaWJpbGl0eUFuZE1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSgpOworICAgICAgICAgICAgZW5hYmxlQWNjZXNzaWJpbGl0eUFuZE1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgdGVhckRvd24oKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKG1Xb3JrZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbVdvcmtlci5zdG9wKCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHNFeGVjdXRlZFRlc3RDb3VudCA9PSBURVNUX0NBU0VfQ09VTlQpIHsKKyAgICAgICAgICAgIC8vIHVudGlsIEpVbml0NCBjb21lcyB0byBwbGF5IHdpdGggQEFmdGVyVGVzdAorICAgICAgICAgICAgZGlzYWJsZUFjY2Vzc2liaWxpdHlBbmRNb2NrQWNjZXNzaWJpbGl0eVNlcnZpY2UoKTsKKyAgICAgICAgfQorICAgICAgICBzdXBlci50ZWFyRG93bigpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRlc3RzIG5hdmlnYXRpb24gYnkgY2hhcmFjdGVyLgorICAgICAqLworICAgIEBMYXJnZVRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0TmF2aWdhdGlvbkJ5Q2hhcmFjdGVyKCkgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgICAgIC8vIGEgYml0IHVnbHkgYnV0IGhlbHBzIGRldGVjdCBiZWdpbm5pbmcgYW5kIGVuZCBvZiBhbGwgdGVzdHMgc28gYWNjZXNzaWJpbGl0eQorICAgICAgICAvLyBhbmQgdGhlIG1vY2sgc2VydmljZSBhcmUgbm90IHRvZ2dsZWQgb24gZXZlcnkgdGVzdCAoZXhwZW5zaXZlKQorICAgICAgICBzRXhlY3V0ZWRUZXN0Q291bnQrKzsKKworICAgICAgICBTdHJpbmcgaHRtbCA9CisgICAgICAgICAgICAiPGh0bWw+IiArCisgICAgICAgICAgICAgICAiPGhlYWQ+IiArCisgICAgICAgICAgICAgICAiPC9oZWFkPiIgKworICAgICAgICAgICAgICAgIjxib2R5PiIgKworICAgICAgICAgICAgICAgICAgICI8cD4iICsKKyAgICAgICAgICAgICAgICAgICAgICAiYSA8Yj5iPC9iPiBjIiArCisgICAgICAgICAgICAgICAgICAgIjwvcD4iICsKKyAgICAgICAgICAgICAgICAgICAiPHA+IiArCisgICAgICAgICAgICAgICAgICAgICAiZCIgKworICAgICAgICAgICAgICAgICAgICAgIjxpbnB1dD5lPC9pbnB1dD4iICsKKyAgICAgICAgICAgICAgICAgICAiPC9wPiIgKworICAgICAgICAgICAgICAgIjwvYm9keT4iICsKKyAgICAgICAgICAgICAiPC9odG1sPiI7CisKKyAgICAgICAgV2ViVmlldyB3ZWJWaWV3ID0gY3JlYXRlV2ViVmV3V2l0aEh0bWwoaHRtbCk7CisKKyAgICAgICAgLy8gY2hhbmdlIG5hdmlnYXRpb24gYXhpcyB0byB3b3JkCisgICAgICAgIHNlbmRLZXlFdmVudCh3ZWJWaWV3LCBLZXlFdmVudC5LRVlDT0RFX0RQQ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Q+IiArCisgICAgICAgICAgICAgICAiPGJvZHk+IiArCisgICAgICAgICAgICAgICAgICAgIjxwPiIgKworICAgICAgICAgICAgICAgICAgICAgICJUaGlzIGlzIDxiPmE8L2I+IHNlbnRlbmNlIiArCisgICAgICAgICAgICAgICAgICAgIjwvcD4iICsKKyAgICAgICAgICAgICAgICAgICAiPHA+IiArCisgICAgICAgICAgICAgICAgICAgICAiIHNjYXR0ZXJlZCAiICsKKyAgICAgICAgICAgICAgICAgICAgICI8aW5wdXQ+YWxsPC9pbnB1dD4iICsKKyAgICAgICAgICAgICAgICAgICAgICIgb3ZlciAiICsKKyAgICAgICAgICAgICAgICAgICAiPC9wPiIgKworICAgICAgICAgICAgICAgICAgICI8ZGl2PiIgKworICAgICAgICAgICAgICAgICAgICAgIjxidXR0b24+dGhlIHBsYWNlLjwvYnV0dG9uPiIgKworICAgICAgICAgICAgICAgICAgICI8L2Rpdj4iICsKKyAgICAgICAgICAgICAgICI8L2JvZHk+IiArCisgICAgICAgICAgICAgIjwvaHRtbD4iOworCisgICAgICAgIFdlYlZpZXcgd2ViVmlldyA9IGNyZWF0ZVdlYlZld1dpdGhIdG1sKGh0bWwpOworCisgICAgICAgIC8vIGNoYW5nZSBuYXZpZ2F0aW9uIGF4aXMgdG8gd29yZAorICAgICAgICBzZW5kS2V5RXZlbnQod2ViVmlldywgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0RPV04sIE1FVEFfU1RBVEVfQUxUX0xFRlRfT04pOworICAgICAgICBhc3NlcnRTZWxlY3Rpb25TdHJpbmcoIjEiKTsgLy8gZXhwZWN0IHRoZSB3b3JkIG5hdmlnYXRpb24gYXhpcworCisgICAgICAgIC8vIGdvIHRvIHRoZSBmaXJzdCB3b3JkCisgICAgICAgIHNlbmRLZXlFdmVudCh3ZWJWaWV3LCBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTiwgMCk7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygiVGhpcyIpOworCisg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jdGlvblN0cmluZygidGhlIik7CisKKyAgICAgICAgLy8gZ28gdG8gdGhlIHNldmVudGggd29yZAorICAgICAgICBzZW5kS2V5RXZlbnQod2ViVmlldywgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQLCAwKTsKKyAgICAgICAgYXNzZXJ0U2VsZWN0aW9uU3RyaW5nKCJvdmVyIik7CisKKyAgICAgICAgLy8gZ28gdG8gdGhlIHNpeHRoIHdvcmQKKyAgICAgICAgc2VuZEtleUV2ZW50KHdlYlZpZXcsIEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCwgMCk7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygiYWxsIik7CisKKyAgICAgICAgLy8gZ28gdG8gdGhlIGZpZnRoIHdvcmQKKyAgICAgICAgc2VuZEtleUV2ZW50KHdlYlZpZXcsIEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCwgMCk7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygic2NhdHRlcmVkIik7CisKKyAgICAgICAgLy8gZ28gdG8gdGhlIGZvdXJ0aCB3b3JkCisgICAgICAgIHNlbmRLZXlFdmVudCh3ZWJWaWV3LCBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVAsIDApOworICAgICAgICBhc3NlcnRTZWxlY3Rpb25TdHJpbmcoInNlbnRlbmNlIik7CisKKyAgICAgICAgLy8gZ28gdG8gdGhlIHRoaXJkIHdvcmQKKyAgICAgICAgc2VuZEtleUV2ZW50KHdlYlZpZXcsIEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCwgMCk7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygiPGI+YTwvYj4iKTsKKworICAgICAgICAvLyBnbyB0byB0aGUgc2Vjb25kIHdvcmQKKyAgICAgICAgc2VuZEtleUV2ZW50KHdlYlZpZXcsIEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCwgMCk7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygiaXMiK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ICAgICAgICAgICAiPGhlYWQ+IiArCisgICAgICAgICAgICAgICI8L2hlYWQ+IiArCisgICAgICAgICAgICAgICI8Ym9keT4iICsKKyAgICAgICAgICAgICAgICAiPGRpdj4iICsKKyAgICAgICAgICAgICAgICAgICI8cD4iICsKKyAgICAgICAgICAgICAgICAgICAgIlRoaXMgaXMgdGhlIGZpcnN0IHNlbnRlbmNlIG9mIHRoZSBmaXJzdCBwYXJhZ3JhcGggYW5kIGhhcyBhbiA8Yj5pbmxpbmUgYm9sZCB0YWc8L2I+LiIgKworICAgICAgICAgICAgICAgICAgICAiVGhpcyBpcyB0aGUgc2Vjb25kIHNlbnRlbmNlIG9mIHRoZSBmaXJzdCBwYXJhZ3JhcGguIiArCisgICAgICAgICAgICAgICAgICAiPC9wPiIgKworICAgICAgICAgICAgICAgICAgIjxoMT5UaGlzIGlzIGEgaGVhZGluZzwvaDE+IiArCisgICAgICAgICAgICAgICAgICAiPHA+IiArCisgICAgICAgICAgICAgICAgICAgICJUaGlzIGlzIHRoZSBmaXJzdCBzZW50ZW5jZSBvZiB0aGUgc2Vjb25kIHBhcmFncmFwaC4iICsKKyAgICAgICAgICAgICAgICAgICAgIlRoaXMgaXMgdGhlIHNlY29uZCBzZW50ZW5jZSBvZiB0aGUgc2Vjb25kIHBhcmFncmFwaC4iICsKKyAgICAgICAgICAgICAgICAgICI8L3A+IiArCisgICAgICAgICAgICAgICAgIjwvZGl2PiIgKworICAgICAgICAgICAgICAiPC9ib2R5PiIgKworICAgICAgICAgICAgIjwvaHRtbD4iOworCisgICAgICAgIFdlYlZpZXcgd2ViVmlldyA9IGNyZWF0ZVdlYlZld1dpdGhIdG1sKGh0bWwpOworCisgICAgICAgIC8vIFNlbnRlbmNlIGF4aXMgaXMgdGhlIGRlZmF1bHQKKworICAgICAgICAvLyBnbyB0byB0aGUgZmlyc3Qgc2VudGVuY2UKKyAgICAgICAgc2VuZEtleUV2ZW50KHdlYlZpZXcsIEtleUV2ZW50LktFWUNPREVfRF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RXhlY3V0ZWRUZXN0Q291bnQrKzsKKworICAgICAgICBTdHJpbmcgaHRtbCA9CisgICAgICAgICAgICAiPCFET0NUWVBFIGh0bWw+IiArCisgICAgICAgICAgICAiPGh0bWw+IiArCisgICAgICAgICAgICAgICI8aGVhZD4iICsKKyAgICAgICAgICAgICAgIjwvaGVhZD4iICsKKyAgICAgICAgICAgICAgIjxib2R5PiIgKworICAgICAgICAgICAgICAgICI8aDE+SGVhZGluZyBvbmU8L2gxPiIgKworICAgICAgICAgICAgICAgICI8cD4iICsKKyAgICAgICAgICAgICAgICAgICJUaGlzIGlzIHNvbWUgdGV4dCIgKworICAgICAgICAgICAgICAgICI8L3A+IiArCisgICAgICAgICAgICAgICAgIjxoMj5IZWFkaW5nIHR3bzwvaDI+IiArCisgICAgICAgICAgICAgICAgIjxwPiIgKworICAgICAgICAgICAgICAgICAgIlRoaXMgaXMgc29tZSB0ZXh0IiArCisgICAgICAgICAgICAgICAgIjwvcD4iICsKKyAgICAgICAgICAgICAgICAiPGgzPkhlYWRpbmcgdGhyZWU8L2gzPiIgKworICAgICAgICAgICAgICAgICI8cD4iICsKKyAgICAgICAgICAgICAgICAgICJUaGlzIGlzIHNvbWUgdGV4dCIgKworICAgICAgICAgICAgICAgICI8L3A+IiArCisgICAgICAgICAgICAgICAgIjxoND5IZWFkaW5nIGZvdXI8L2g0PiIgKworICAgICAgICAgICAgICAgICI8cD4iICsKKyAgICAgICAgICAgICAgICAgICJUaGlzIGlzIHNvbWUgdGV4dCIgKworICAgICAgICAgICAgICAgICI8L3A+IiArCisgICAgICAgICAgICAgICAgIjxoNT5IZWFkaW5nIGZpdmU8L2g1PiIgKworICAgICAgICAgICAgICAgICI8cD4iICsKKyAgICAgICAgICAgICAgICAgICJUaGlzIGlzIHNvbWUgdGV4dCIgKworICAgICAgICAgICAgICAgICI8L3A+IiArCisgICAgICAgICAgICAgICAgIjxoNj5IZWFkaW5nIHNpeDwvaDY+IiArCisgICAgICAgICAgICAgICI8L2Jv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2gyPiIpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRlc3RzIG5hdmlnYXRpb24gYnkgc2libGluZy4KKyAgICAgKi8KKyAgICBATGFyZ2VUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdE5hdmlnYXRpb25CeVNpYmluZygpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICAvLyBhIGJpdCB1Z2x5IGJ1dCBoZWxwcyBkZXRlY3QgYmVnaW5uaW5nIGFuZCBlbmQgb2YgYWxsIHRlc3RzIHNvIGFjY2Vzc2liaWxpdHkKKyAgICAgICAgLy8gYW5kIHRoZSBtb2NrIHNlcnZpY2UgYXJlIG5vdCB0b2dnbGVkIG9uIGV2ZXJ5IHRlc3QgKGV4cGVuc2l2ZSkKKyAgICAgICAgc0V4ZWN1dGVkVGVzdENvdW50Kys7CisKKyAgICAgICAgU3RyaW5nIGh0bWwgPQorICAgICAgICAgICAgIjwhRE9DVFlQRSBodG1sPiIgKworICAgICAgICAgICAgIjxodG1sPiIgKworICAgICAgICAgICAgICAiPGhlYWQ+IiArCisgICAgICAgICAgICAgICI8L2hlYWQ+IiArCisgICAgICAgICAgICAgICI8Ym9keT4iICsKKyAgICAgICAgICAgICAgICAiPGgxPkhlYWRpbmcgb25lPC9oMT4iICsKKyAgICAgICAgICAgICAgICAiPHA+IiArCisgICAgICAgICAgICAgICAgICAiVGhpcyBpcyBzb21lIHRleHQiICsKKyAgICAgICAgICAgICAgICAiPC9wPiIgKworICAgICAgICAgICAgICAgICI8ZGl2PiIgKworICAgICAgICAgICAgICAgICAgIjxidXR0b24+SW5wdXQ8L2J1dHRvbj4iICsKKyAgICAgICAgICAgICAgICAiPC9kaXY+IiArCisgICAgICAgICAgICAgICI8L2JvZHk+IiArCisgICAgICAgICAgICAiPC9odG1sPiI7CisKKyAgICAgICAgV2ViVmlldyB3ZWJWaWV3ID0gY3JlYXRlV2ViVmV3V2l0aEh0bWwoaHRtbCk7CisKKyAgICAgICAgLy8gY2hhbmdlIG5hdm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ICAgICAgIFN0cmluZyBodG1sID0KKyAgICAgICAgICAgICI8IURPQ1RZUEUgaHRtbD4iICsKKyAgICAgICAgICAgICI8aHRtbD4iICsKKyAgICAgICAgICAgICAgIjxoZWFkPiIgKworICAgICAgICAgICAgICAiPC9oZWFkPiIgKworICAgICAgICAgICAgICAiPGJvZHk+IiArCisgICAgICAgICAgICAgICAgIjxkaXY+IiArCisgICAgICAgICAgICAgICAgICAiPGJ1dHRvbj5JbnB1dDwvYnV0dG9uPiIgKworICAgICAgICAgICAgICAgICI8L2Rpdj4iICsKKyAgICAgICAgICAgICAgIjwvYm9keT4iICsKKyAgICAgICAgICAgICI8L2h0bWw+IjsKKworICAgICAgICBXZWJWaWV3IHdlYlZpZXcgPSBjcmVhdGVXZWJWZXdXaXRoSHRtbChodG1sKTsKKworICAgICAgICAvLyBjaGFuZ2UgbmF2aWdhdGlvbiBheGlzIHRvIGRvY3VtZW50CisgICAgICAgIHNlbmRLZXlFdmVudCh3ZWJWaWV3LCBLZXlFdmVudC5LRVlDT0RFX0RQQURfTEVGVCwgTUVUQV9TVEFURV9BTFRfTEVGVF9PTik7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygiNiIpOyAvLyBleHBlY3QgdGhlIGRvY3VtZW50IG5hdmlnYXRpb24gYXhpcworCisgICAgICAgIC8vIGNoYW5nZSBuYXZpZ2F0aW9uIGF4aXMgdG8gcGFyZW50L2ZpcnN0IGNoaWxkCisgICAgICAgIHNlbmRLZXlFdmVudCh3ZWJWaWV3LCBLZXlFdmVudC5LRVlDT0RFX0RQQURfTEVGVCwgTUVUQV9TVEFURV9BTFRfTEVGVF9PTik7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygiNSIpOyAvLyBleHBlY3QgdGhlIHBhcmVudC9maXJzdCBjaGlsZCBuYXZpZ2F0aW9uIGF4aXMKKworICAgICAgICAvLyBnbyB0byB0aGUgZmlyc3QgY2hpbGQKKyAgICAgICAgc2VuZEtleUV2ZW50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9keT4iICsKKyAgICAgICAgICAgICI8L2h0bWw+IjsKKworICAgICAgICBXZWJWaWV3IHdlYlZpZXcgPSBjcmVhdGVXZWJWZXdXaXRoSHRtbChodG1sKTsKKworICAgICAgICAvLyBjaGFuZ2UgbmF2aWdhdGlvbiBheGlzIHRvIGRvY3VtZW50CisgICAgICAgIHNlbmRLZXlFdmVudCh3ZWJWaWV3LCBLZXlFdmVudC5LRVlDT0RFX0RQQURfTEVGVCwgTUVUQV9TVEFURV9BTFRfTEVGVF9PTik7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygiNiIpOyAvLyBleHBlY3QgdGhlIGRvY3VtZW50IG5hdmlnYXRpb24gYXhpcworCisgICAgICAgIC8vIGdvIHRvIHRoZSBib3R0b20gb2YgdGhlIGRvY3VtZW50CisgICAgICAgIHNlbmRLZXlFdmVudCh3ZWJWaWV3LCBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTiwgMCk7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygiQ2xpY2siKTsKKworICAgICAgICAvLyBnbyB0byB0aGUgdG9wIG9mIHRoZSBkb2N1bWVudCAocmV2ZXJzZSkKKyAgICAgICAgc2VuZEtleUV2ZW50KHdlYlZpZXcsIEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCwgMCk7CisgICAgICAgIGFzc2VydFNlbGVjdGlvblN0cmluZygiPGJvZHk+PGJ1dHRvbj5DbGljazwvYnV0dG9uPjwvYm9keT4iKTsKKworICAgICAgICAvLyBnbyB0byB0aGUgYm90dG9tIG9mIHRoZSBkb2N1bWVudCAocmV2ZXJzZSBhZ2FpbikKKyAgICAgICAgc2VuZEtleUV2ZW50KHdlYlZpZXcsIEtleUV2ZW50LktFWUNPREVfRFBBRF9ET1dOLCAwKTsKKyAgICAgICAgYXNzZXJ0U2VsZWN0aW9uU3RyaW5nKCJDbGljayIpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRlc3RzIHRoZSBzeW5jIGJldHdlZW4gdGhlIHRleHQgbmF2aWdhdGlvbiBhbmQgbmF2aWdhdGlvbiBieSBET00gZWxlbWVudHMuCisgICAgICovCisgICAgQExhcmdlVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RTeW5jQmV0d2VlblRleHRBbmREb21Ob2RlTmF2aWdhdGlvbigpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICAvLyBhIGJpdCB1Z2x5IGJ1dCBoZWxwcyBkZXRlY3QgYmVnaW5uaW5nIGFuZCBlbmQgb2YgYWxsIHRlc3RzIHNvIGFjY2Vzc2liaWxpdHkKKyAgICAgICAgLy8gYW5kIHRoZSBtb2NrIHNlcnZpY2UgYXJlIG5vdCB0b2dnbGVkIG9uIGV2ZXJ5IHRlc3QgKGV4cGVuc2l2ZSkKKyAgICAgICAgc0V4ZWN1dGVkVGVzdENvdW50Kys7CisKKyAgICAgICAgU3RyaW5nIGh0bWwgPQorICAgICAgICAgICAgIjwhRE9DVFlQRSBodG1sPiIgKworICAgICAgICAgICAgIjxodG1sPiIgKworICAgICAgICAgICAgICAiPGhlYWQ+IiArCisgICAgICAgICAgICAgICI8L2hlYWQ+IiArCisgICAgICAgICAgICAgICI8Ym9keT4iICsKKyAgICAgICAgICAgICAgICAiPHA+IiArCisgICAgICAgICAgICAgICAgICAiRmlyc3QiICsKKyAgICAgICAgICAgICAgICAiPC9wPiIgKworICAgICAgICAgICAgICAgICI8YnV0dG9uPlNlY29uZDwvYnV0dG9uPiIgKworICAgICAgICAgICAgICAgICI8cD4iICsKKyAgICAgICAgICAgICAgICAgICJUaGlyZCIgKworICAgICAgICAgICAgICAgICI8L3A+IiArCisgICAgICAgICAgICAgICI8L2JvZHk+IiArCisgICAgICAgICAgICAiPC9odG1sPiI7CisKKyAgICAgICAgV2ViVmlldyB3ZWJWaWV3ID0gY3JlYXRlV2ViVmV3V2l0aEh0bWwoaHRtbCk7CisKKyAgICAgICAgLy8gY2hhbmdlIG5hdmlnYXRpb24gYXhpcyB0byB3b3J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3RhcnQgPCBUSU1FT1VUX0VOQUJMRV9BQ0NFU1NJQklMSVRZX0FORF9NT0NLX1NFUlZJQ0UgJiYKKyAgICAgICAgICAgICAgICAhc0lzQWNjZXNzaWJpbGl0eVNlcnZpY2VSZWFkeSkgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChzVGVzdExvY2spIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBzVGVzdExvY2sud2FpdChpbmNyZW1lbnRTdGVwKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBpZSkgeworICAgICAgICAgICAgICAgICAgICAvKiBpZ25vcmUgKi8KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoIXNJc0FjY2Vzc2liaWxpdHlTZXJ2aWNlUmVhZHkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIk1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSBub3QgcmVhZHkuIERpZCB5b3UgYWRkICIgKworICAgICAgICAgICAgICAgICAgICAidGVzdHMgYW5kIGZvcmdvdCB0byB1cGRhdGUgQWNjZXNzaWJpbGl0eUluamVjdG9yVGVzdCNURVNUX0NBU0VfQ09VTlQ/Iik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBzY3J1YkNsYXNzKENsYXNzPD8+IHRlc3RDYXNlQ2xhc3MpIHsKKyAgICAgICAgLyogZG8gbm90aGluZyAtIGF2b2lkIHN1cGVyY2xhc3MgYmVoYXZpb3IgKi8KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBEaXNhYmxlcyBhY2Nlc3NpYmlsaXR5IGFuZCB0aGUgbW9jayBhY2Nlc3NpYmlsaXR5IHNlcnZpY2UuCisgICAgICovCisgICAgcHJpdmF0ZS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0YXJ0IDwgVElNRU9VVF9XQUlUX0ZPUl9TRUxFQ1RJT05fU1RSSU5HICYmCisgICAgICAgICAgICAgICAgc1JlY2VpdmVkU2VsZWN0aW9uU3RyaW5nID09IFNFTEVDVElPTl9TVFJJTkdfVU5LTk9XTikgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChzVGVzdExvY2spIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBzVGVzdExvY2sud2FpdChpbmNyZW1lbnRTdGVwKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBpZSkgeworICAgICAgICAgICAgICAgICAgICAvKiBpZ25vcmUgKi8KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChzUmVjZWl2ZWRTZWxlY3Rpb25TdHJpbmcgPT0gU0VMRUNUSU9OX1NUUklOR19VTktOT1dOKSB7CisgICAgICAgICAgICAgICAgZmFpbCgiTm8gc2VsZWN0aW9uIHN0cmluZyByZWNlaXZlZC4gRXhwZWN0ZWQ6ICIgKyBleHBlY3RlZFNlbGVjdGlvblN0cmluZyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBhc3NlcnRFcXVhbHMoZXhwZWN0ZWRTZWxlY3Rpb25TdHJpbmcsIHNSZWNlaXZlZFNlbGVjdGlvblN0cmluZyk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBzUmVjZWl2ZWRTZWxlY3Rpb25TdHJpbmcgPSBTRUxFQ1RJT05fU1RSSU5HX1VOS05PV047CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZW5kcyBhIHtAbGluayBLZXlFdmVudH0gKHVwIGFuZCBkb3duKSB0byB0aGUge0BsaW5rIFdlYlZpZXd9LgorICAgICAqCisgICAgICogQHBhcmFtIGtleUNvZGUgVGhlIGV2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KyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25QYWdlRmluaXNoZWQoV2ViVmlldyB2aWV3LCBTdHJpbmcgdXJsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtV29ya2VyLmdldEhhbmRsZXIoKS5wb3N0KG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc1Rlc3RMb2NrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzVGVzdExvY2subm90aWZ5QWxsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICAgICAgc3luY2hyb25pemVkIChzVGVzdExvY2spIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgc1Rlc3RMb2NrLndhaXQoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGllKSB7CisgICAgICAgICAgICAgICAgLyogaWdub3JlICovCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1XZWJWaWV3OworICAgIH0KKworICAgIC8qKgorICAgICAqIFRoaXMgaXMgYSB3b3JrZXIgdGhyZWFkIHJlc3BvbnNpYmxlIGZvciBjcmVhdGluZyB0aGUge0BsaW5rIFdlYlZpZXd9LgorICAgICAqLworICAgIHByaXZhdGUgY2xhc3MgV29ya2VyIGltcGxlbWVudHMgUnVubmFibGUgeworICAgICAgICBwcml2YXRlIGZpbmFsIE9iamVjdCBtV29ya2VyTG9jayA9IG5ldyBPYmplY3QoKTsKKyAgICAgICAgcHJpdmF0ZSBIYW5kbGVyIG1IYW5kbGVyOworCisgICAgICAgcHVibGljIFdvcmtlcigpIHsKKyAgICAgICAgICAgIG5ldyBUaHJlYWQodGhpcykuc3RhcnQoKTsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVdvcmtlckxvY2spIHsKKyAgICAgICAgICAgICAgICB3aGlsZSAobUhhbmRsZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVdvcmtlckxvY2sud2FpdCgpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogaWdub3JlICovCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1Xb3JrZXJMb2NrKSB7CisgICAgICAgICAgICAgICAgTG9vcGVyLnByZXBhcmUoKTsKKyAgICAgICAgICAgICAgICBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCk7CisgICAgICAgICAgICAgICAgbVdvcmtlckxvY2subm90aWZ5QWxsKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBMb29wZXIubG9vcCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEhhbmRsZXIgZ2V0SGFuZGxlcigpIHsKKyAgICAgICAgICAgIHJldHVybiBtSGFuZGxlcjsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHN0b3AoKSB7CisgICAgICAgICAgICBtSGFuZGxlci5nZXRMb29wZXIoKS5xdWl0KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBNb2NrIGFjY2Vzc2liaWxpdHkgc2VydmljZSB0byByZWNlaXZlIHRoZSBhY2Nlc3NpYmlsaXR5IGV2ZW50cworICAgICAqIHdpdGggdGhlIGN1cnJlbnQge0BsaW5rIFdlYlZpZXd9IHNlbGVjdGlvbi4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIE1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSBleHRlbmRzIEFjY2Vzc2liaWxpdHlTZXJ2aWNlIHsKKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1Jc1NlcnZpY2VJbmZvU2V0OworCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvblNlcnZpY2VDb25uZWN0ZWQoKSB7CisgICAgICAgICAgICBpZiAobUlzU2VydmljZUluZm9TZXQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY2Nlc3NpYmlsaXR5U2VydmljZUluZm8gaW5mbyA9IG5ldyBBY2Nlc3NpYmlsaXR5U2VydmljZUluZm8oKTsKKyAgICAgICAgICAgIGluZm8uZXZlbnRUeXBlcyA9IEFjY2Vzc2liaWxpdHlFdmVudC5UWVBFX1ZJRVdfU0VMRUNURUQ7CisgICAgICAgICAgICBpbmZvLmZlZWRiYWNrVHlwZSA9IEFjY2Vzc2liaWxpdHlTZXJ2aWNlSW5mby5GRUVEQkFDS19HRU5FUklDOworICAgICAgICAgICAgc2V0U2VydmljZUluZm8oaW5mbyk7CisgICAgICAgICAgICBtSXNTZXJ2aWNlSW5mb1NldCA9IHRydWU7CisKKyAgICAgICAgICAgIHNJc0FjY2Vzc2liaWxpdHlTZXJ2aWNlUmVhZHkgPSB0cnVlOworCisgICAgICAgICAgICBpZiAoc0luc3RhbmNlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNUZXN0TG9jaykgeworICAgICAgICAgICAgICAgIHNUZXN0TG9jay5ub3RpZnlBbGwoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkFjY2Vzc2liaWxpdHlFdmVudChBY2Nlc3NpYmlsaXR5RXZlbnQgZXZlbnQpIHsKKyAgICAgICAgICAgIGlmIChzSW5zdGFuY2UgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghZXZlbnQuZ2V0VGV4dCgpLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0ID0gZXZlbnQuZ2V0VGV4dCgpLmdldCgwKTsKKyAgICAgICAgICAgICAgICBzUmVjZWl2ZWRTZWxlY3Rpb25TdHJpbmcgPSAodGV4dCAhPSBudWxsKSA/IHRleHQudG9TdHJpbmcoKSA6IG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNUZXN0TG9jaykgeworICAgICAgICAgICAgICAgIHNUZXN0TG9jay5ub3RpZnlBbGwoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkludGVycnVwdCgpIHsKKyAgICAgICAgICAgIC8qIGRvIG5vdGhpbmcgKi8KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBvblVuYmluZChJbnRlbnQgaW50ZW50KSB7CisgICAgICAgICAgICBzSXNBY2Nlc3NpYmlsaXR5U2VydmljZVJlYWR5ID0gZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL3Rlc3RzL2NvcmV0ZXN0cy9zcmMvYW5kcm9pZC93ZWJraXQvWm9vbU1hbmFnZXJUZ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CBjaGlsZHJlbkNvdW50OyBjaGlsZEluZGV4KyspIHsKLSAgICAgICAgICAgICAgICAvLyBDaGVjayBjaGlsZCBpbmRleCBpbiBjb250ZXh0IG1lbnUKLSAgICAgICAgICAgICAgICBtTGlzdFV0aWwuYXJyb3dTY3JvbGxUb1NlbGVjdGVkUG9zaXRpb24oaW5kZXgpOwotICAgICAgICAgICAgICAgIG1lbnVMaXN0ZW5lci5leHBlY3RDaGlsZENvbnRleHRNZW51KGdyb3VwSW5kZXgsIGNoaWxkSW5kZXgpOwotICAgICAgICAgICAgICAgIFZpZXcgY2hpbGQgPSBtRXhwYW5kYWJsZUxpc3RWaWV3LmdldENoaWxkQXQoaW5kZXgKLSAgICAgICAgICAgICAgICAgICAgICAgIC0gbUV4cGFuZGFibGVMaXN0Vmlldy5nZXRGaXJzdFZpc2libGVQb3NpdGlvbigpKTsKLSAgICAgICAgICAgICAgICBtRXhwYW5kYWJsZUxpc3RWaWV3LnNob3dDb250ZXh0TWVudUZvckNoaWxkKGNoaWxkKTsKLSAgICAgICAgICAgICAgICBtSW5zdHJ1bWVudGF0aW9uLndhaXRGb3JJZGxlU3luYygpOwotICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnROdWxsKG1lbnVMaXN0ZW5lci5nZXRFcnJvck1lc3NhZ2UoKSwgbWVudUxpc3RlbmVyLmdldEVycm9yTWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICBpbmRleCsrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLy8gU2Nyb2xsaW5nIG9uIGZvb3RlciBlbGVtZW50cyBzaG91bGQgdHJpZ2dlciBhbiBBZGFwdGVyQ29udGV4dE1lbnUKLSAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1FeHBhbmRhYmxlTGlzdFZpZXcuZ2V0Rm9vdGVyVmlld3NDb3VudCgpOyBpKyspIHsKLSAgICAgICAgICAgIC8vIENoZWNrIGdyb3VwIGluZGV4IGluIGNvbnRleHQgb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ldENoaWxkVmlldyhpbnQgZ3JvdXBQb3NpdGlvbiwgaW50IGNoaWxkUG9zaXRpb24sIGJvb2xlYW4gaXNMYXN0Q2hpbGQsCi0gICAgICAgICAgICAgICAgVmlldyBjb252ZXJ0VmlldywgVmlld0dyb3VwIHBhcmVudCkgewotICAgICAgICAgICAgVGV4dFZpZXcgdGV4dFZpZXcgPSBnZXRHZW5lcmljVmlldygpOwotICAgICAgICAgICAgdGV4dFZpZXcuc2V0VGV4dChnZXRDaGlsZChncm91cFBvc2l0aW9uLCBjaGlsZFBvc2l0aW9uKS50b1N0cmluZygpKTsKLSAgICAgICAgICAgIHJldHVybiB0ZXh0VmlldzsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBPYmplY3QgZ2V0R3JvdXAoaW50IGdyb3VwUG9zaXRpb24pIHsKLSAgICAgICAgICAgIHJldHVybiBncm91cHNbZ3JvdXBQb3NpdGlvbl07Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgaW50IGdldEdyb3VwQ291bnQoKSB7Ci0gICAgICAgICAgICByZXR1cm4gZ3JvdXBzLmxlbmd0aDsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBsb25nIGdldEdyb3VwSWQoaW50IGdyb3VwUG9zaXRpb24pIHsKLSAgICAgICAgICAgIHJldHVybiBncm91cFBvc2l0aW9uOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIFZpZXcgZ2V0R3JvdXBWaWV3KGludCBncm91cFBvc2l0aW9uLCBib29sZWFuIGlzRXhwYW5kZWQsIFZpZXcgY29udmVydFZpZXcsCi0gICAgICAgICAgICAgICAgVmlld0dyb3VwIHBhcmVudCkgewotICAgICAgICAgICAgVGV4dFZpZXcgdGV4dFZpZXcgPSBnZXRHZW5lcmljVmlldygpOwotICAgICAgICAgICAgdGV4dFZpZXcuc2V0VGV4dChnZXRHcm91cChncm91cFBvc2l0aW9uKS50b1N0cmluZygpKTsKLSAgICAgICAgICAgIHJldHVybiB0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ICAnQycgICAgICcyJyAgICAgJ2MnICAgICAnQycgICAgICdjJyAgICAgJ0MnCitEICAgICAgICAgICAgICAgICAgICAgICAnRCcgICAgICczJyAgICAgJ2QnICAgICAnRCcgICAgICdkJyAgICAgJ0QnCitFICAgICAgICAgICAgICAgICAgICAgICAnRScgICAgICczJyAgICAgJ2UnICAgICAnRScgICAgICdlJyAgICAgJ0UnCitGICAgICAgICAgICAgICAgICAgICAgICAnRicgICAgICczJyAgICAgJ2YnICAgICAnRicgICAgICdmJyAgICAgJ0YnCitHICAgICAgICAgICAgICAgICAgICAgICAnRycgICAgICc0JyAgICAgJ2cnICAgICAnRycgICAgICdnJyAgICAgJ0cnCitIICAgICAgICAgICAgICAgICAgICAgICAnSCcgICAgICc0JyAgICAgJ2gnICAgICAnSCcgICAgICdoJyAgICAgJ0gnCitJICAgICAgICAgICAgICAgICAgICAgICAnSScgICAgICc0JyAgICAgJ2knICAgICAnSScgICAgICdpJyAgICAgJ0knCitKICAgICAgICAgICAgICAgICAgICAgICAnSicgICAgICc1JyAgICAgJ2onICAgICAnSicgICAgICdqJyAgICAgJ0onCitLICAgICAgICAgICAgICAgICAgICAgICAnSycgICAgICc1JyAgICAgJ2snICAgICAnSycgICAgICdrJyAgICAgJ0snCitMICAgICAgICAgICAgICAgICAgICAgICAnTCcgICAgICc1JyAgICAgJ2wnICAgICAnTCcgICAgICdsJyAgICAgJ0wnCitNICAgICAgICAgICAgICAgICAgICAgICAnTScgICAgICc2JyAgICAgJ20nICAgICAnTScgICAgICdtJyAgICAgJ00nCitOICAgICAgICAgICAgICAgICAgICAgICAnTicgICAgICc2JyAgICAgJ24nICAgICAnTicgICAgICduJyAgICAgJ04nCitPICAgICAgICAgICAgICAgICAgICAgICAnTycgICAgICc2JyAgICAgJ28nICAgICAnTycgICAgICdvJyAgICAgJ08nCitQICAgICAgICAgICAgICAgICAgICAgICAnUCcgICAgICc3JyAgICAgJ3AnICAgICAnUCcgICAgICdwJyAgICAgJ1AnCitRICAgICAgICAgICAgICAgICAgICAgICAnUScgICAgICc3JyAgICAgJ3EnICAgICAnUScgICAgICdxJyAgICAgJ1EnCitSICAgICAgICAgICAgICAgICAgICAgICAnUicgICAgICc3JyAgICAgJ3InICAgICAnUicgICAgICdyJyAgICAgJ1InCitTICAgICAgICAgICAgICAgICAgICAgICAnUycgICAgICc3JyAgICAgJ3MnICAgICAnUycgICAgICdzJyAgICAgJ1MnCitUICAgICAgICAgICAgICAgICAgICAgICAnVCcgICAgICc4JyAgICAgJ3QnICAgICAnVCcgICAgICd0JyAgICAgJ1QnCitVICAgICAgICAgICAgICAgICAgICAgICAnVScgICAgICc4JyAgICAgJ3UnICAgICAnVScgICAgICd1JyAgICAgJ1UnCitWICAgICAgICAgICAgICAgICAgICAgICAnVicgICAgICc4JyAgICAgJ3YnICAgICAnVicgICAgICd2JyAgICAgJ1YnCitXICAgICAgICAgICAgICAgICAgICAgICAnVycgICAgICc5JyAgICAgJ3cnICAgICAnVycgICAgICd3JyAgICAgJ1cnCitYICAgICAgICAgICAgICAgICAgICAgICAnWCcgICAgICc5JyAgICAgJ3gnICAgICAnWCcgICAgICd4JyAgICAgJ1gnCitZICAgICAgICAgICAgICAgICAgICAgICAnWScgICAgICc5JyAgICAgJ3knICAgICAnWScgICAgICd5JyAgICAgJ1knCitaICAgICAgICAgICAgICAgICAgICAgICAnWicgICAgICc5JyAgICAgJ3onICAgICAnWicgICAgICd6JyAgICAgJ1onCisKKzAgICAgICAgICAgICAgICAgICAgICAgICcwJyAgICAgJzAnICAgICAnMCcgICAgICcpJyAgICAgJzAnICAgICAnKScKKzEgICAgICAgICAgICAgICAgICAgICAgICcxJyAgICAgJzEnICAgICAnMScgICAgICchJyAgICAgJzEnICAgICAnIScKKzIgICAgICAgICAgICAgICAgICAgICAgICcyJyAgICAgJzInICAgICAnMicgICAgICdAJyAgICAgJzInICAgICAnQCcKKzMgICAgICAgICAgICAgICAgICAgICAgICczJyAgICAgJzMnICAgICAnMycgICAgICcjJyAgICAgJzMnICAgICAnIycKKzQgICAgICAgICAgICAgICAgICAgICAgICc0JyAgICAgJzQnICAgICAnNCcgICAgICckJyAgICAgJzQnICAgICAnJCcKKzUgICAgICAgICAgICAgICAgICAgICAgICc1JyAgICAgJzUnICAgICAnNScgICAgICclJyAgICAgJzUnICAgICAnJScKKzYgICAgICAgICAgICAgICAgICAgICAgICc2JyAgICAgJzYnICAgICAnNicgICAgICdeJyAgICAgJzYnICAgICAnXicKKzcgICAgICAgICAgICAgICAgICAgICAgICc3JyAgICAgJzcnICAgICAnNycgICAgICcmJyAgICAgJzcnICAgICAnJicKKzggICAgICAgICAgICAgICAgICAgICAgICc4JyAgICAgJzgnICAgICAnOCcgICAgICcqJyAgICAgJzgnICAgICAnKicKKzkgICAgICAgICAgICAgICAgICAgICAgICc5JyAgICAgJzknICAgICAnOScgICAgICcoJyAgICAgJzknICAgICAnKCcKKworU1BBQ0UgICAgICAgICAgICAgICAgICAgMHgyMCAgICAweDIwICAgIDB4MjAgICAgMHgyMCAgICAweDIwICAgIDB4MjAKK0VOVEVSICAgICAgICAgICAgICAgICAgIDB4YSAgICAgMHhhICAgICAweGEgICAgIDB4YSAgICAgMHhhICAgICAweGEKK1RBQiAgICAgICAgICAgICAgICAgICAgIDB4OSAgICAgMHg5ICAgICAweDkgICAgIDB4OSAgICAgMHg5ICAgICAweDkKKworQ09NTUEgICAgICAgICAgICAgICAgICAgJywnICAgICAnLCcgICAgICcsJyAgICAgJzwnICAgICAnLCcgICAgICc8JworUEVSSU9EICAgICAgICAgICAgICAgICAgJy4nICAgICAnLicgICAgICcuJyAgICAgJz4nICAgICAnLicgICAgICc+JworU0xBU0ggICAgICAgICAgICAgICAgICAgJy8nICAgICAnLycgICAgICcvJyAgICAgJz8nICAgICAnLycgICAgICc/JworR1JBVkUgICAgICAgICAgICAgICAgICAgJ2AnICAgICAnYCcgICAgICdgJyAgICAgJ34nICAgICAnYCcgICAgICd+JworTUlOVVMgICAgICAgICAgICAgICAgICAgJy0nICAgICAnLScgICAgICctJyAgICAgJ18nICAgICAnLScgICAgICdfJworRVFVQUxTICAgICAgICAgICAgICAgICAgJz0nICAgICAnPScgICAgICc9JyAgICAgJysnICAgICAnPScgICAgICcrJworTEVGVF9CUkFDS0VUICAgICAgICAgICAgJ1snICAgICAnWycgICAgICdbJyAgICAgJ3snICAgICAnWycgICAgICd7JworUklHSFRfQlJBQ0tFVCAgICAgICAgICAgJ10nICAgICAnXScgICAgICddJyAgICAgJ30nICAgICAnXScgICAgICd9JworQkFDS1NMQVNIICAgICAgICAgICAgICAgJ1wnICAgICAnXCcgICAgICdcJyAgICAgJ3wnICAgICAnXCcgICAgICd8JworU0VNSUNPTE9OICAgICAgICAgICAgICAgJzsnICAgICAnOycgICAgICc7JyAgICAgJzonICAgICAnOycgICAgICc6JworQVBPU1RST1BIRSAgICAgICAgICAgICAgJycnICAgICAnJycgICAgICcnJyAgICAgJyInICAgICAnJycgICAgICciJworCitOVU1QQURfMCAgICAgICAgICAgICAgICAnMCcgICAgICcwJyAgICAgJzAnICAgICAnMCcgICAgICcwJyAgICAgJzAnCitOVU1QQURfMSAgICAgICAgICAgICAgICAnMScgICAgICcxJyAgICAgJzEnICAgICAnMScgICAgICcxJyAgICAgJzEnCitOVU1QQURfMiAgICAgICAgICAgICAgICAnMicgICAgICcyJyAgICAgJzInICAgICAnMicgICAgICcyJyAgICAgJzInCitOVU1QQURfMyAgICAgICAgICAgICAgICAnMycgICAgICczJyAgICAgJzMnICAgICAnMycgICAgICczJyAgICAgJzMnCitOVU1QQURfNCAgICAgICAgICAgICAgICAnNCcgICAgICc0JyAgICAgJzQnICAgICAnNCcgICAgICc0JyAgICAgJzQnCitOVU1QQURfNSAgICAgICAgICAgICAgICAnNScgICAgICc1JyAgICAgJzUnICAgICAnNScgICAgICc1JyAgICAgJzUnCitOVU1QQURfNiAgICAgICAgICAgICAgICAnNicgICAgICc2JyAgICAgJzYnICAgICAnNicgICAgICc2JyAgICAgJzYnCitOVU1QQURfNyAgICAgICAgICAgICAgICAnNycgICAgICc3JyAgICAgJzcnICAgICAnNycgICAgICc3JyAgICAgJzcnCitOVU1QQURfOCAgICAgICAgICAgICAgICAnOCcgICAgICc4JyAgICAgJzgnICAgICAnOCcgICAgICc4JyAgICAgJzgnCitOVU1QQURfOSAgICAgICAgICAgICAgICAnOScgICAgICc5JyAgICAgJzknICAgICAnOScgICAgICc5JyAgICAgJzknCitOVU1QQURfTEVGVF9QQVJFTiAgICAgICAnKCcgICAgICcoJyAgICAgJygnICAgICAnKCcgICAgICcoJyAgICAgJygnCitOVU1QQURfUklHSFRfUEFSRU4gICAgICAnKScgICAgICcpJyAgICAgJyknICAgICAnKScgICAgICcpJyAgICAgJyknCitOVU1QQURfRElWSURFICAgICAgICAgICAnLycgICAgICcvJyAgICAgJy8nICAgICAnLycgICAgICcvJyAgICAgJy8nCitOVU1QQURfTVVMVElQTFkgICAgICAgICAnKicgICAgICcqJyAgICAgJyonICAgICAnKicgICAgICcqJyAgICAgJyonCitOVU1QQURfU1VCVFJBQ1QgICAgICAgICAnLScgICAgICctJyAgICAgJy0nICAgICAnLScgICAgICctJyAgICAgJy0nCitOVU1QQURfQUREICAgICAgICAgICAgICAnKycgICAgICcrJyAgICAgJysnICAgICAnKycgICAgICcrJyAgICAgJysnCitOVU1QQURfRE9UICAgICAgICAgICAgICAnLicgICAgICcuJyAgICAgJy4nICAgICAnLicgICAgICcuJyAgICAgJy4nCitOVU1QQURfQ09NTUEgICAgICAgICAgICAnLCcgICAgICcsJyAgICAgJywnICAgICAnLCcgICAgICcsJyAgICAgJywnCitOVU1QQURfRVFVQUxTICAgICAgICAgICAnPScgICAgICc9JyAgICAgJz0nICAgICAnPScgICAgICc9JyAgICAgJz0nCitOVU1QQURfRU5URVIgICAgICAgICAgICAweGEgICAgIDB4YSAgICAgMHhhICAgICAweGEgICAgIDB4YSAgICAgMHhhCmRpZmYgLS1naXQgYS9kYXRhL2tleWJvYXJkcy9HZW5lcmljLmtsIGIvZGF0YS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ggUEMgc3R5bGUgZXh0ZXJuYWwga2V5Ym9hcmRzLgorIworIyBUaGlzIGZpbGUgaXMgaW50ZW50aW9uYWxseSB2ZXJ5IGdlbmVyaWMgYW5kIGlzIGludGVuZGVkIHRvIHN1cHBvcnQgYSBicm9hZCByYW5nIG9mIGtleWJvYXJkcy4KKyMgRG8gbm90IGVkaXQgdGhlIGdlbmVyaWMga2V5IGxheW91dCB0byBzdXBwb3J0IGEgc3BlY2lmaWMga2V5Ym9hcmQ7IGluc3RlYWQsIGNyZWF0ZQorIyBhIG5ldyBrZXkgbGF5b3V0IGZpbGUgd2l0aCB0aGUgcmVxdWlyZWQga2V5Ym9hcmQgY29uZmlndXJhdGlvbi4KKyMKKwora2V5IDEgICAgIEVTQ0FQRQora2V5IDIgICAgIDEKK2tleSAzICAgICAyCitrZXkgNCAgICAgMwora2V5IDUgICAgIDQKK2tleSA2ICAgICA1CitrZXkgNyAgICAgNgora2V5IDggICAgIDcKK2tleSA5ICAgICA4CitrZXkgMTAgICAgOQora2V5IDExICAgIDAKK2tleSAxMiAgICBNSU5VUwora2V5IDEzICAgIEVRVUFMUwora2V5IDE0ICAgIERFTAora2V5IDE1ICAgIFRBQgora2V5IDE2ICAgIFEKK2tleSAxNyAgICBXCitrZXkgMTggICAgRQora2V5IDE5ICAgIFIKK2tleSAyMCAgICBUCitrZXkgMjEgICAgWQora2V5IDIyICAgIFUKK2tleSAyMyAgICBJCitrZXkgMjQgICAgTwora2V5IDI1ICAgIFAKK2tleSAyNiAgICBMRUZUX0JSQUNLRVQKK2tleSAyNyAgICBSSUdIVF9CUkFDS0VUCitrZXkgMjggICAgRU5URVIKK2tleSAyOSAgICBDVFJMX0xFRlQKK2tleSAzMCAgICBBCitrZXkgMzEgICAgUwora2V5IDMyICAgIEQKK2tleSAzMyAgICBGCitrZXkgMzQgICAgRwora2V5IDM1ICAgIEgKK2tleSAzNiAgICBKCitrZXkgMzcgICAgSwora2V5IDM4ICAgIEwKK2tleSAzOSAgICBTRU1JQ09MT04KK2tleSA0MCAgICBBUE9TVFJPUEhFCitrZXkgNDEgICAgR1JBVkUKK2tleSA0MiAgICBTSElGVF9MRUZUCitrZXkgNDMgICAgQkFDS1NMQVNICitrZXkgNDQgICAgWgora2V5IDQ1ICAgIFgKK2tleSA0NiAgICBDCitrZXkgNDcgICAgVgora2V5IDQ4ICAgIEIKK2tleSA0OSAgICBOCitrZXkgNTAgICAgTQora2V5IDUxICAgIENPTU1BCitrZXkgNTIgICAgUEVSSU9ECitrZXkgNTMgICAgU0xBU0gKK2tleSA1NCAgICBTSElGVF9SSUdIVAora2V5IDU1ICAgIE5VTVBBRF9NVUxUSVBMWQora2V5IDU2ICAgIEFMVF9MRUZUCitrZXkgNTcgICAgU1BBQ0UKK2tleSA1OCAgICBDQVBTX0xPQ0sKK2tleSA1OSAgICBGMQora2V5IDYwICAgIEYyCitrZXkgNjEgICAgRjMKK2tleSA2MiAgICBGNAora2V5IDYzICAgIEY1CitrZXkgNjQgICAgRjYKK2tleSA2NSAgICBGNwora2V5IDY2ICAgIEY4CitrZXkgNjcgICAgRjkKK2tleSA2OCAgICBGMTAKK2tleSA2OSAgICBOVU1fTE9DSwora2V5IDcwICAgIFNDUk9MTF9MT0NLCitrZXkgNzEgICAgTlVNUEFEXzcKK2tleSA3MiAgICBOVU1QQURfOAora2V5IDczICAgIE5VTVBBRF85CitrZXkgNzQgICAgTlVNUEFEX1NVQlRSQUNUCitrZXkgNzUgICAgTlVNUEFEXzQKK2tleSA3NiAgICBOVU1QQURfNQora2V5IDc3ICAgIE5VTVBBRF82CitrZXkgNzggICAgTlVNUEFEX0FERAora2V5IDc5ICAgIE5VTVBBRF8xCitrZXkgODAgICAgTlVNUEFEXzIKK2tleSA4MSAgICBOVU1QQURfMwora2V5IDgyICAgIE5VTVBBRF8wCitrZXkgODMgICAgTlVNUEFEX0RPVAorIyBrZXkgODQgKHVuZGVmaW5lZCkKKyMga2V5IDg1ICJLRVlfWkVOS0FLVUhBTktBS1UiCis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xNTcgIktFWV9DT01QVVRFUiIKK2tleSAxNTggICBCQUNLICAgICAgICAgICAgICBXQUtFX0RST1BQRUQKK2tleSAxNTkgICBGT1JXQVJECitrZXkgMTYwICAgTUVESUFfQ0xPU0UKK2tleSAxNjEgICBNRURJQV9FSkVDVAora2V5IDE2MiAgIE1FRElBX0VKRUNUCitrZXkgMTYzICAgTUVESUFfTkVYVAora2V5IDE2NCAgIE1FRElBX1BMQVlfUEFVU0UKK2tleSAxNjUgICBNRURJQV9QUkVWSU9VUwora2V5IDE2NiAgIE1FRElBX1NUT1AKK2tleSAxNjcgICBNRURJQV9SRUNPUkQKK2tleSAxNjggICBNRURJQV9SRVdJTkQKK2tleSAxNjkgICBDQUxMCisjIGtleSAxNzAgIktFWV9JU08iCisjIGtleSAxNzEgIktFWV9DT05GSUciCitrZXkgMTcyICAgSE9NRQorIyBrZXkgMTczICJLRVlfUkVGUkVTSCIKKyMga2V5IDE3NCAiS0VZX0VYSVQiCisjIGtleSAxNzUgIktFWV9NT1ZFIgorIyBrZXkgMTc2ICJLRVlfRURJVCIKK2tleSAxNzcgICBQQUdFX1VQCitrZXkgMTc4ICAgUEFHRV9ET1dOCitrZXkgMTc5ICAgTlVNUEFEX0xFRlRfUEFSRU4KK2tleSAxODAgICBOVU1QQURfUklHSFRfUEFSRU4KKyMga2V5IDE4MSAiS0VZX05FVyIKKyMga2V5IDE4MiAiS0VZX1JFRE8iCisjIGtleSAxODMgICBGMTMKKyMga2V5IDE4NCAgIEYxNAorIyBrZXkgMTg1ICAgRjE1CisjIGtleSAxODYgICBGMTYKKyMga2V5IDE4NyAgIEYxNworIyBrZXkgMTg4ICAgRjE4CisjIGtleSAxODkgICBGMTkKKyMga2V5IDE5MCAgIEYyMAorIyBrZXkgMTkxICAgRjIxCisjIGtleSAxOTIgICBGMjIKKyMga2V5IDE5MyAgIEYyMworIyBrZXkgMTk0ICAgRjI0CisjIGtleSAxOTUgKHVuZGVmaW5lZCkKKyMga2V5IDE5NiAodW5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yJyAgICAgJ2EnICAgICAnQScgICAgICdhJyAgICAgJ0EnCitCICAgICAgICAgICAgICAgJ0InICAgICAnMicgICAgICdiJyAgICAgJ0InICAgICAnYicgICAgICdCJworQyAgICAgICAgICAgICAgICdDJyAgICAgJzInICAgICAnYycgICAgICdDJyAgICAgJ2MnICAgICAnQycKK0QgICAgICAgICAgICAgICAnRCcgICAgICczJyAgICAgJ2QnICAgICAnRCcgICAgICdkJyAgICAgJ0QnCitFICAgICAgICAgICAgICAgJ0UnICAgICAnMycgICAgICdlJyAgICAgJ0UnICAgICAnZScgICAgICdFJworRiAgICAgICAgICAgICAgICdGJyAgICAgJzMnICAgICAnZicgICAgICdGJyAgICAgJ2YnICAgICAnRicKK0cgICAgICAgICAgICAgICAnRycgICAgICc0JyAgICAgJ2cnICAgICAnRycgICAgICdnJyAgICAgJ0cnCitIICAgICAgICAgICAgICAgJ0gnICAgICAnNCcgICAgICdoJyAgICAgJ0gnICAgICAnaCcgICAgICdIJworSSAgICAgICAgICAgICAgICdJJyAgICAgJzQnICAgICAnaScgICAgICdJJyAgICAgJ2knICAgICAnSScKK0ogICAgICAgICAgICAgICAnSicgICAgICc1JyAgICAgJ2onICAgICAnSicgICAgICdqJyAgICAgJ0onCitLICAgICAgICAgICAgICAgJ0snICAgICAnNScgICAgICdrJyAgICAgJ0snICAgICAnaycgICAgICdLJworTCAgICAgICAgICAgICAgICdMJyAgICAgJzUnICAgICAnbCcgICAgICdMJyAgICAgJ2wnICAgICAnTCcKK00gICAgICAgICAgICAgICAnTScgICAgICc2JyAgICAgJ20nICAgICAnTScgICAgICdtJyAgICAgJ00nCitOICAgICAgICAgICAgICAgJ04nICAgICAnNicgICAgICduJyAgICAgJ04nICAgICAnbicgICAgICdOJworTyAgICAgICAgICAgICAgICdPJyAgICAgJzYnICAgICAnbycgICAgICdPJyAgICAgJ28nICAgICAnTycKK1AgICAgICAgICAgICAgICAnUCcgICAgICc3JyAgICAgJ3AnICAgICAnUCcgICAgICdwJyAgICAgJ1AnCitRICAgICAgICAgICAgICAgJ1EnICAgICAnNycgICAgICdxJyAgICAgJ1EnICAgICAncScgICAgICdRJworUiAgICAgICAgICAgICAgICdSJyAgICAgJzcnICAgICAncicgICAgICdSJyAgICAgJ3InICAgICAnUicKK1MgICAgICAgICAgICAgICAnUycgICAgICc3JyAgICAgJ3MnICAgICAnUycgICAgICdzJyAgICAgJ1MnCitUICAgICAgICAgICAgICAgJ1QnICAgICAnOCcgICAgICd0JyAgICAgJ1QnICAgICAndCcgICAgICdUJworVSAgICAgICAgICAgICAgICdVJyAgICAgJzgnICAgICAndScgICAgICdVJyAgICAgJ3UnICAgICAnVScKK1YgICAgICAgICAgICAgICAnVicgICAgICc4JyAgICAgJ3YnICAgICAnVicgICAgICd2JyAgICAgJ1YnCitXICAgICAgICAgICAgICAgJ1cnICAgICAnOScgICAgICd3JyAgICAgJ1cnICAgICAndycgICAgICdXJworWCAgICAgICAgICAgICAgICdYJyAgICAgJzknICAgICAneCcgICAgICdYJyAgICAgJ3gnICAgICAnWCcKK1kgICAgICAgICAgICAgICAnWScgICAgICc5JyAgICAgJ3knICAgICAnWScgICAgICd5JyAgICAgJ1knCitaICAgICAgICAgICAgICAgJ1onICAgICAnOScgICAgICd6JyAgICAgJ1onICAgICAneicgICAgICdaJworCiswICAgICAgICAgICAgICAgJzAnICAgICAnMCcgICAgICcwJyAgICAgJyknICAgICAnMCcgICAgICcpJworMSAgICAgICAgICAgICAgICcxJyAgICAgJzEnICAgICAnMScgICAgICchJyAgICAgJzEnICAgICAnIScKKzIgICAgICAgICAgICAgICAnMicgICAgICcyJyAgICAgJzInICAgICAnQCcgICAgICcyJyAgICAgJ0AnCiszICAgICAgICAgICAgICAgJzMnICAgICAnMycgICAgICczJyAgICAgJyMnICAgICAnMycgICAgICcjJworNCAgICAgICAgICAgICAgICc0JyAgICAgJzQnICAgICAnNCcgICAgICckJyAgICAgJzQnICAgICAnJCcKKzUgICAgICAgICAgICAgICAnNScgICAgICc1JyAgICAgJzUnICAgICAnJScgICAgICc1JyAgICAgJyUnCis2ICAgICAgICAgICAgICAgJzYnICAgICAnNicgICAgICc2JyAgICAgJ14nICAgICAnNicgICAgICdeJworNyAgICAgICAgICAgICAgICc3JyAgICAgJzcnICAgICAnNycgICAgICcmJyAgICAgJzcnICAgICAnJicKKzggICAgICAgICAgICAgICAnOCcgICAgICc4JyAgICAgJzgnICAgICAnKicgICAgICc4JyAgICAgJyonCis5ICAgICAgICAgICAgICAgJzknICAgICAnOScgICAgICc5JyAgICAgJygnICAgICAnOScgICAgICcoJworCitTUEFDRSAgICAgICAgICAgMHgyMCAgICAweDIwICAgIDB4MjAgICAgMHgyMCAgICAweDIwICAgIDB4MjAKK0VOVEVSICAgICAgICAgICAweGEgICAgIDB4YSAgICAgMHhhICAgICAweGEgICAgIDB4YSAgICAgMHhhCitUQUIgICAgICAgICAgICAgMHg5ICAgICAweDkgICAgIDB4OSAgICAgMHg5ICAgICAweDkgICAgIDB4OQorCitDT01NQSAgICAgICAgICAgJywnICAgICAnLCcgICAgICcsJyAgICAgJzwnICAgICAnLCcgICAgICc8JworUEVSSU9EICAgICAgICAgICcuJyAgICAgJy4nICAgICAnLicgICAgICc+JyAgICAgJy4nICAgICAnPicKK1NMQVNIICAgICAgICAgICAnLycgICAgICcvJyAgICAgJy8nICAgICAnPycgICAgICcvJyAgICAgJz8nCitHUkFWRSAgICAgICAgICAgJ2AnICAgICAnYCcgICAgICdgJyAgICAgJ34nICAgICAnYCcgICAgICd+JworTUlOVVMgICAgICAgICAgICctJyAgICAgJy0nICAgICAnLScgICAgICdfJyAgICAgJy0nICAgICAnXycKK0VRVUFMUyAgICAgICAgICAnPScgICAgICc9JyAgICAgJz0nICAgICAnKycgICAgICc9JyAgICAgJysnCitMRUZUX0JSQUNLRVQgICAgJ1snICAgICAnWycgICAgICdbJyAgICAgJ3snICAgICAnWycgICAgICd7JworUklHSFRfQlJBQ0tFVCAgICddJyAgICAgJ10nICAgICAnXScgICAgICd9JyA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ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisjIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyMgbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisKK2tleSAxICAgICBCQUNLCitrZXkgMiAgICAgMQora2V5IDMgICAgIDIKK2tleSA0ICAgICAzCitrZXkgNSAgICAgNAora2V5IDYgICAgIDUKK2tleSA3ICAgICA2CitrZXkgOCAgICAgNwora2V5IDkgICAgIDgKK2tleSAxMCAgICA5CitrZXkgMTEgICAgMAora2V5IDEyICAgIE1JTlVTCitrZXkgMTMgICAgRVFVQUxTCitrZXkgMTQgICAgREVMCitrZXkgMTUgICAgVEFCCitrZXkgMTYgICAgUQora2V5IDE3ICAgIFcKK2tleSAxOCAgICBFCitrZXkgMTkgICAgUgora2V5IDIwICAgIFQKK2tleSAyMSAgICBZCitrZXkgMjIgICAgVQora2V5IDIzICAgIEkKK2tleSAyNCAgICBPCitrZXkgMjUgICAgUAora2V5IDI2ICAgIExFRlRfQlJBQ0tFVAora2V5IDI3ICAgIFJJR0hUX0JSQUNLRVQKK2tleSAyOCAgICBFTlRFUgora2V5IDI5ICAgIENUUkxfTEVGVAora2V5IDMwICAgIEEKK2tleSAzMSAgICBTCitrZXkgMzIgICAgRAora2V5IDMzICAgIEYKK2tleSAzNCAgICBHCitrZXkgMzUgICAgSAora2V5IDM2ICAgIEoKK2tleSAzNyAgICBLCitrZXkgMzggICAgTAora2V5IDM5ICAgIFNFTUlDT0xPTgora2V5IDQwICAgIEFQT1NUUk9QSEUKK2tleSA0MSAgICBHUkFWRQora2V5IDQ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pOworICB2YXIgdG9waWNQYXJlbnQgPSBudWxsOworICBmb3IgKHZhciBpID0gMDsgaSA8IHRvcGljcy5sZW5ndGg7IGkrKykgeworICAgIGlmICh0b3BpY1BhcmVudCA9PSBudWxsIHx8IGkgJSAxMCA9PSAwKSB7CisgICAgICAvLyBjcmVhdGUgYSBuZXcgY29sdW1uCisgICAgICB0b3BpY1BhcmVudCA9ICQoJ3VsJywgJCgnPHRkPjx1bD4nKS5hcHBlbmRUbygnI3Jlc291cmNlLXRvcGljLXRhYmxlIHRyJykpOworICAgIH0KKworICAgIHRvcGljUGFyZW50LmFwcGVuZCgKKyAgICAgICAgJCgnPGxpPicpLmFwcGVuZCgKKyAgICAgICAgICAkKCc8aDM+JykuYXBwZW5kKAorICAgICAgICAgICAgJCgnPGE+JykKKyAgICAgICAgICAgICAgLmF0dHIoJ2hyZWYnLCB0b1Jvb3QgKyAicmVzb3VyY2VzL2Jyb3dzZXIuaHRtbD90YWc9IiArIHRvcGljc1tpXS5uYW1lKQorICAgICAgICAgICAgICAuYXBwZW5kKCQoJzxzcGFuPicpCisgICAgICAgICAgICAgICAgLmFkZENsYXNzKCdlbicpCisgICAgICAgICAgICAgICAgLmh0bWwodG9waWNzW2ldLnRpdGxlKQorICAgICAgICAgICAgICApCisgICAgICAgICAgICApCisgICAgICAgICAgKQorICAgICAgICApOworICB9Cit9KSgpOworLy8tLT4KKzwvc2NyaXB0PgpcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZGlmZiAtLWdpdCBhL2RvY3MvaHRtbC9yZXNvdXJjZXMvdHV0b3JpYWxzL25vdGVwYWQvbm90ZXBhZC1leDIuamQgYi9kb2NzL2h0bWwvcmVzb3VyY2VzL3R1dG9yaWFscy9ub3RlcGFkL25vdGVwYWQtZXgyLmpkCmluZGV4IDI4OWI1ZmUuLjQ5OWI3OTYgMTAwNjQ0Ci0tLSBhL2RvY3MvaHRtbC9yZXNvdXJjZXMvdHV0b3JpYWxzL25vdGVwYWQv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ICAgICAgIG0ubWFwUmVjdChkZXZpY2VSLCBkc3RSKTsKKwogICAgICAgICAgICAgbmV3dyA9IE1hdGgucm91bmQoZGV2aWNlUi53aWR0aCgpKTsKICAgICAgICAgICAgIG5ld2ggPSBNYXRoLnJvdW5kKGRldmljZVIuaGVpZ2h0KCkpOwotICAgICAgICAgICAgYml0bWFwID0gY3JlYXRlQml0bWFwKG5ld3csIG5ld2gsIGhhc0FscGhhID8gQ29uZmlnLkFSR0JfODg4OCA6IENvbmZpZy5SR0JfNTY1KTsKLSAgICAgICAgICAgIGlmIChoYXNBbHBoYSkgewotICAgICAgICAgICAgICAgIGJpdG1hcC5lcmFzZUNvbG9yKDApOwotICAgICAgICAgICAgfQorCisgICAgICAgICAgICBiaXRtYXAgPSBjcmVhdGVCaXRtYXAobmV3dywgbmV3aCwgdHJhbnNmb3JtZWQgPyBDb25maWcuQVJHQl84ODg4IDogbmV3Q29uZmlnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1lZCB8fCBzb3VyY2UuaGFzQWxwaGEoKSk7CisKICAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoLWRldmljZVIubGVmdCwgLWRldmljZVIudG9wKTsKICAgICAgICAgICAgIGNhbnZhcy5jb25jYXQobSk7CisKICAgICAgICAgICAgIHBhaW50ID0gbmV3IFBhaW50KCk7CiAgICAgICAgICAgICBwYWludC5zZXRGaWx0ZXJCaXRtYXAoZmlsdGVyKTsKLSAgICAgICAgICAgIGlmICghbS5yZWN0U3RheXNSZWN0KCkpIHsKKyAgICAgICAgICAgIGlmICh0cmFuc2Zvcm1lZCkgewogICAgICAgICAgICAgICAgIHBhaW50LnNldEFudGlBbGlhcyh0cnVlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtNDc0LDggKzUwMywzMCBAQAogICAgICAqIEB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIGlmIHRoZSB3aWR0aCBvciBoZWlnaHQgYXJlIDw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tYXQgaXMgbm90IHN1cHBvcnRlZCBvciBjYW4gbm90IGJlIGRlY29kZWQuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBCaXRtYXBSZWdpb25EZWNvZGVyIG5ld0luc3RhbmNlKElucHV0U3RyZWFtIGlzLAorICAgICAgICAgICAgYm9vbGVhbiBpc1NoYXJlYWJsZSkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgLy8gd2UgbmVlZCBtYXJrL3Jlc2V0IHRvIHdvcmsgcHJvcGVybHkgaW4gSk5JCisKKyAgICAgICAgaWYgKCFpcy5tYXJrU3VwcG9ydGVkKCkpIHsKKyAgICAgICAgICAgIGlzID0gbmV3IEJ1ZmZlcmVkSW5wdXRTdHJlYW0oaXMsIDE2ICogMTAyNCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoaXMgaW5zdGFuY2VvZiBBc3NldE1hbmFnZXIuQXNzZXRJbnB1dFN0cmVhbSkgeworICAgICAgICAgICAgcmV0dXJuIG5hdGl2ZU5ld0luc3RhbmNlKAorICAgICAgICAgICAgICAgICAgICAoKEFzc2V0TWFuYWdlci5Bc3NldElucHV0U3RyZWFtKSBpcykuZ2V0QXNzZXRJbnQoKSwKKyAgICAgICAgICAgICAgICAgICAgaXNTaGFyZWFibGUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gcGFzcyBzb21lIHRlbXAgc3RvcmFnZSBkb3duIHRvIHRoZSBuYXRpdmUgY29kZS4gMTAyNCBpcyBtYWRlIHVwLAorICAgICAgICAgICAgLy8gYnV0IHNob3VsZCBiZSBsYXJnZSBlbm91Z2ggdG8gYXZvaWQgdG9vIG1hbnkgc21hbGwgY2FsbHMgYmFjaworICAgICAgICAgICAgLy8gaW50byBpcy5yZWFkKC4uLikuCisgICAgICAgICAgICBieXRlIFtdIHRlbXBTdG9yYWdlID0gbmV3IGJ5dGVbMTYgKiAxMDI0XTsKKyAgICAgICAgICAgIHJldHVybiBuYXRpdmVOZXdJbnN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IG1hdHJpeC4gVGhlIHJldHVybmVkCisgICAgICogcG9pbnRlciBpcyBhIHBvaW50ZXIgdG8gYW4gYXJyYXkgb2YgMTYgZmxvYXRzLgorICAgICAqIAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGludCBnZXROYXRpdmVNYXRyaXgoKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KICAgICAKICAgICAvKioKICAgICAgKiBSZXR1cm4gYSBuZXcgbWF0cml4IHdpdGggYSBjb3B5IG9mIHRoZSBjYW52YXMnIGN1cnJlbnQgdHJhbnNmb3JtYXRpb24KQEAgLTYyMSw3ICs2MzYsMTEgQEAKICAgICAgICAgRWRnZVR5cGUoaW50IG5hdGl2ZUludCkgewogICAgICAgICAgICAgdGhpcy5uYXRpdmVJbnQgPSBuYXRpdmVJbnQ7CiAgICAgICAgIH0KLSAgICAgICAgZmluYWwgaW50IG5hdGl2ZUludDsKKworICAgICAgICAvKioKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBmaW5hbCBpbnQgbmF0aXZlSW50OwogICAgIH0KIAogICAgIC8qKgpAQCAtOTU4LDYgKzk3NywyMSBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIERyYXdzIHRoZSBzcGVjaWZpZWQgYml0bWFwIGFzIGFuIE4tcGF0Y2ggKG1vc3Qgb2Z0ZW4sIGEgOS1wYXRjaGVzLikKKyAgICAgKgorICAgICAqIE5vdGU6IE9ubHkgc3VwcG9ydGVkIGJ5IGhhcmR3YXJlIGFjY2VsZXJhdGVkIGNhbnZhcyBhdCB0aGUgbW9tZW50LgorICAgICAqCisgICAgICogQHBhcmFtIGJpdG1hcCBUaGUgYml0bWFwIHRvIGRyYXcgYXMgYW4gTi1wYXRjaAorICAgICAqIEBwYXJhbSBjaHVua3MgVGhlIHBhdGNoZXMgaW5mb3JtYXRpb24gKG1hdGNoZXMgdGhlIG5hdGl2ZSBzdHJ1Y3QgUmVzX3BuZ185cGF0Y2gpCisgICAgICogQHBhcmFtIGRzdCBUaGUgZGVzdGluYXRpb24gcmVjdGFuZ2xlLgorICAgICAqIEBwYXJhbSBwYWludCBUaGUgcGFpbnQgdG8gZHJhdyB0aGUgYml0bWFwIHdpdGguIG1heSBiZSBudWxsCisgICAgICogCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBkcmF3UGF0Y2goQml0bWFwIGJpdG1hcCwgYnl0ZVtdIGNodW5rcywgUmVjdEYgZHN0LCBQYWludCBwYWludCkgeworICAgIH0gICAgCisgICAgCisgICAgLyoqCiAgICAgICogRHJhdyB0aGUgc3BlY2lmaWVkIGJpdG1hcCwgd2l0aCBpdHMgdG9wL2xlZnQgY29ybmVyIGF0ICh4LHkpLCB1c2luZwogICAgICAqIHRoZSBzcGVjaWZpZWQgcGFpbnQsIHRyYW5zZm9ybWVkIGJ5IHRoZSBjdXJyZW50IG1hdHJpeC4KICAgICAgKiAKQEAgLTEyNDYsOCArMTI4MCw4IEBACiAgICAgICAgICAgICAodGV4dC5sZW5ndGggLSBpbmRleCAtIGNvdW50KSkgPCAwKSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigpOwogICAgICAgICB9Ci0gICAgICAgIG5hdGl2ZV9kcmF3VGV4dChtTmF0aXZlQ2FudmFzLCB0ZXh0LCBpbmRleCwgY291bnQsIHgsIHksCi0gICAgICAgICAgICAgICAgICAgICAgICBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICBuYXRpdmVfZHJhd1RleHQobU5hdGl2ZUNhbnZhcywgdGV4dCwgaW5kZXgsIGNvdW50LCB4LCB5LCBwYWludC5tQmlkaUZsYWdzLAorICAgICAgICAgICAgICAgIHBhaW50Lm1OYXRpdmVQYWludCk7CiAgICAgfQogCiAgICAgLyoqCkBAIC0xMjU5LDcgKzEyOTMsMTAgQEAKICAgICAgKiBAcGFyYW0geSAgICAgVGhl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XJ0LCBlbmQsIHgsIHksIHBhaW50Lm1CaWRpRmxhZ3MsCisgICAgICAgICAgICAgICAgcGFpbnQubU5hdGl2ZVBhaW50KTsKICAgICB9CiAKICAgICAvKioKQEAgLTEyOTksMTYgKzEzMzYsMTA4IEBACiAgICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgU3RyaW5nIHx8IHRleHQgaW5zdGFuY2VvZiBTcGFubmVkU3RyaW5nIHx8CiAgICAgICAgICAgICB0ZXh0IGluc3RhbmNlb2YgU3Bhbm5hYmxlU3RyaW5nKSB7CiAgICAgICAgICAgICBuYXRpdmVfZHJhd1RleHQobU5hdGl2ZUNhbnZhcywgdGV4dC50b1N0cmluZygpLCBzdGFydCwgZW5kLCB4LCB5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50Lm1OYXRpdmVQYWludCk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAodGV4dCBpbnN0YW5jZW9mIEdyYXBoaWNzT3BlcmF0aW9ucykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50Lm1CaWRpRmxhZ3MsIHBhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIH0gZWxzZSBpZiAodGV4dCBpbnN0YW5jZW9mIEdyYXBoaWNzT3BlcmF0aW9ucykgewogICAgICAgICAgICAgKChHcmFwaGljc09wZXJhdGlvbnMpIHRleHQpLmRyYXdUZXh0KHRoaXMsIHN0YXJ0LCBlbmQsIHgsIHksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIHsKKyAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIGNoYXJbXSBidWYgPSBUZW1wb3JhcnlCdWZmZXIub2J0YWluKGVuZCAtIHN0YXJ0KTsKICAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBzdGFydCwgZW5kLCBidWYsIDApOwotICAgICAgICAgICAgZHJhd1RleHQoYnVmLCAwLCBlbmQgLSBzdGFydCwgeCwgeSwgcGFpbnQpOworICAgICAgICAgICAgbmF0aXZlX2RyYXdUZXh0KG1OYXRpdmVDYW52YXMsIGJ1ZiwgMCwgZW5kIC0gc3RhcnQsIHgsIHksIAorICAgICAgICAgICAgICAgICAgICBwYWludC5tQmlkaUZsYWdzLCBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICAgICAgVGVtcG9yYXJ5QnVmZmVyLnJlY3ljbGUoYnVmKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJlbmRlciBhIHJ1biBvZiBhbGwgTFRSIG9yIGFsbCBSVEwgdGV4dCwgd2l0aCBzaGFwaW5nLiBUaGlzIGRvZXMgbm90IHJ1bgorICAgICAqIGJpZGkgb24gdGhlIHByb3ZpZGVkIHRleHQsIGJ1dCByZW5kZXJzIGl0IGFzIGEgdW5pZm9ybSByaWdodC10by1sZWZ0IG9yCisgICAgICogbGVmdC10by1yaWdodCBydW4sIGFzIGluZGljYXRlZCBieSBkaXIuIEFsaWdubWVudCBvZiB0aGUgdGV4dCBpcyBhcworICAgICAqIGRldGVybWluZWQgYnkgdGhlIFBhaW50J3MgVGV4dEFsaWduIHZhbHVlLgorICAgICAqIAorICAgICAqIEBwYXJhbSB0ZXh0IHRoZSB0ZXh0IHRvIHJlbmRlcgorICAgICAqIEBwYXJhbSBpbmRleCB0aGUgc3RhcnQgb2YgdGhlIHRleHQgdG8gcmVuZGVyCisgICAgICogQHBhcmFtIGNvdW50IHRoZSBjb3VudCBvZiBjaGFycyB0byByZW5kZXIKKyAgICAgKiBAcGFyYW0gY29udGV4dEluZGV4IHRoZSBzdGFydCBvZiB0aGUgY29udGV4dCBmb3Igc2hhcGluZy4gIE11c3QgYmUKKyAgICAgKiAgICAgICAgIG5vIGdyZWF0ZXIgdGhhbiBpbmRleC4KKyAgICAgKiBAcGFyYW0gY29udGV4dENvdW50IHRoZSBudW1iZXIgb2YgY2hhcmFjdGVycyBpbiB0aGUgY29udGV4dCBmb3Igc2hhcGluZy4KKyAgICAgKiAgICAgICAgIENvbnRleEluZGV4ICsgY29udGV4dENvdW50IG11c3QgYmUgbm8gbGVzcyB0aGFuIGluZGV4CisgICAgICogICAgICAgICArIGNvdW50LgorICAgICAqIEBwYXJhbSB4IHRoZSB4IHBvc2l0aW9uIGF0IHdoaWNoIHRvIGRyYXcgdGhlIHRleHQKKyAgICAgKiBAcGFyYW0geSB0aGUgeSBwb3NpdGlvbiBhdCB3aGljaCB0byBkcmF3IHRoZSB0ZXh0CisgICAgICogQHBhcmFtIGRpciB0aGUgcnVuIGRpcmVjdGlvbiwgZWl0aGVyIHtAbGluayAjRElSRUNUSU9OX0xUUn0gb3IKKyAgICAgKiAgICAgICAgIHtAbGluayAjRElSRUNUSU9OX1JUTH0uCisgICAgICogQHBhcmFtIHBhaW50IHRoZSBwYWludAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgZHJhd1RleHRSdW4oY2hhcltdIHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LAorICAgICAgICAgICAgaW50IGNvbnRleHRJbmRleCwgaW50IGNvbnRleHRDb3VudCwgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGRpciwKKyAgICAgICAgICAgIFBhaW50IHBhaW50KSB7CisKKyAgICAgICAgaWYgKHRleHQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJ0ZXh0IGlzIG51bGwiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocGFpbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJwYWludCBpcyBudWxsIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKChpbmRleCB8IGNvdW50IHwgdGV4dC5sZW5ndGggLSBpbmRleCAtIGNvdW50KSA8IDApIHsK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V3IEluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oKTsKKyAgICAgICAgfQorCisgICAgICAgIGludCBmbGFncyA9IGRpciA9PSAwID8gMCA6IDE7CisKKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBTdHJpbmcgfHwgdGV4dCBpbnN0YW5jZW9mIFNwYW5uZWRTdHJpbmcgfHwKKyAgICAgICAgICAgICAgICB0ZXh0IGluc3RhbmNlb2YgU3Bhbm5hYmxlU3RyaW5nKSB7CisgICAgICAgICAgICBuYXRpdmVfZHJhd1RleHRSdW4obU5hdGl2ZUNhbnZhcywgdGV4dC50b1N0cmluZygpLCBzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIHgsIHksIGZsYWdzLCBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICB9IGVsc2UgaWYgKHRleHQgaW5zdGFuY2VvZiBHcmFwaGljc09wZXJhdGlvbnMpIHsKKyAgICAgICAgICAgICgoR3JhcGhpY3NPcGVyYXRpb25zKSB0ZXh0KS5kcmF3VGV4dFJ1bih0aGlzLCBzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIHgsIHksIGZsYWdzLCBwYWludCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQgY29udGV4dExlbiA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgICAgICBpbnQgbGVuID0gZW5kIC0gc3RhcnQ7CisgICAgICAgICAgICBjaGFyW10gYnVmID0gVGVtcG9yYXJ5QnVmZmVyLm9idGFpbihjb250ZXh0TGVuKTsKKyAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIGJ1ZiwgMCk7CisgICAgICAgICAgICBuYXRpdmVfZHJhd1RleHRSdW4obU5hdGl2ZUNhbnZhcywgYnVmLCBzdGFydCAtIGNvbnRleHRTdGFydCwgbGVuLAorICAgICAgICAgICAgICAgICAgICAwLCBjb250ZXh0TGVuLCB4LCB5LCBmbGFncywgcGFpbnQubU5hdGl2ZVBhaW50KTsKICAgICAgICAgICAgIFRlbXBvcmFyeUJ1ZmZlci5yZWN5Y2xlKGJ1Zik7CiAgICAgICAgIH0KICAgICB9CkBAIC0xMzY4LDcgKzE0OTcsNyBAQAogICAgICAgICB9CiAgICAgICAgIG5hdGl2ZV9kcmF3VGV4dE9uUGF0aChtTmF0aXZlQ2FudmFzLCB0ZXh0LCBpbmRleCwgY291bnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoLm5pKCksIGhPZmZzZXQsIHZPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQubUJpZGlGbGFncywgcGFpbnQubU5hdGl2ZVBhaW50KTsKICAgICB9CiAKICAgICAvKioKQEAgLTEzODgsNyArMTUxNyw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdk9mZnNldCwgUGFpbnQgcGFpbnQpIHsKICAgICAgICAgaWYgKHRleHQubGVuZ3RoKCkgPiAwKSB7CiAgICAgICAgICAgICBuYXRpdmVfZHJhd1RleHRPblBhdGgobU5hdGl2ZUNhbnZhcywgdGV4dCwgcGF0aC5uaSgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhPZmZzZXQsIHZPZmZzZXQsIHBhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaE9mZnNldCwgdk9mZnNldCwgcGFpbnQubUJpZGlGbGFncywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWludC5tTmF0aXZlUGFpbnQpOwogICAgICAgICB9CiAgICAgfQogCkBAIC0xNDMxLDI4ICsxNTYxLDc0IEBACiAgICAgICAgIGRyYXdQaWN0dXJlKHBpY3R1cmUpOwogICAgICAgICByZXN0b3JlKCk7CiAgICAgfQotICAgIAorCisgICAgLyoqCisgICAgICogPHA+QWNxdWlyZXMgdGhlIENhbnZhcyBjb250ZXh0LiBBZnRlciBpbnZva2luZyB0aGlzIG1ldGhvZCwgdGhlIENhbnZhcworICAgICAqIGNvbnRleHQgIGNhbiBiZSBtb2RpZmllZCBieSB0aGUgY2FsbGVyLiBGb3IgaW5zdGFuY2UsIGlmIHlvdSBhY3F1aXJlCisgICAgICogdGhlIGNvbnRleHQgb2YgYW4gT3BlbkdMIENhbnZhcyB5b3UgY2FuIHJlc2V0IHRoZSBHTCB2aWV3cG9ydCwgc2Npc3NvciwKKyAgICAgKiBldGMuPC9wPgorICAgICAqIAorICAgICAqIDxwPkEgY2FsbCB0byB7QGxpbmsgI2FjcXVpcmVDb250ZXh0KCl9IHNob3VsZCBhd2F5cyBiZSBmb2xsb3dlZCBieQorICAgICAqIGEgY2FsbCB0byB7QGxpbmsgI3JlbGVhc2VDb250ZXh0KCl9LCBwcmVmZXJyYWJseSB1c2luZyBhIHRyeSBibG9jazo8L3A+CisgICAgICogCisgICAgICogPHByZT4KKyAgICAgKiB0cnkgeworICAgICAqICAgICBpZiAoY2FudmFzLmFjcXVpcmVDb250ZXh0KCkpIHsKKyAgICAgKiAgICAgICAgIC8vIFVzZSB0aGUgY2FudmFzIGFuZC9vciBpdHMgY29udGV4dAorICAgICAqICAgICB9CisgICAgICogfSBmaW5hbGx5IHsKKyAgICAgKiAgICAgY2FudmFzLnJlbGVhc2VDb250ZXh0KCk7CisgICAgICogfQorICAgICAqIDwvcHJlPgorICAgICAqIAorICAgICAqIDxwPkFjcXVpcmluZyB0aGUgY29udGV4dCBjYW4gYmUgYW4gZXhwZW5zaXZlIG9wZXJhdGlvbiBhbmQgc2hvdWxkIG5vdAorICAgICAqIGJlIGRvbmUgdW5sZXNzIGFic29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RtYXAoaW50IG5hdGl2ZUNhbnZhcywgaW50IGJpdG1hcCk7Ci0gICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIHZvaWQgbmF0aXZlU2V0Vmlld3BvcnQoaW50IG5DYW52YXMsIGludCB3LCBpbnQgaCk7CiAgICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIGludCBuYXRpdmVfc2F2ZUxheWVyKGludCBuYXRpdmVDYW52YXMsIFJlY3RGIGJvdW5kcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBhaW50LCBpbnQgbGF5ZXJGbGFncyk7CiAgICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIGludCBuYXRpdmVfc2F2ZUxheWVyKGludCBuYXRpdmVDYW52YXMsIGZsb2F0IGwsCkBAIC0xNTU1LDEwICsxNzMxLDE5IEBACiAgICAgCiAgICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIHZvaWQgbmF0aXZlX2RyYXdUZXh0KGludCBuYXRpdmVDYW52YXMsIGNoYXJbXSB0ZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXgsIGludCBjb3VudCwgZmxvYXQgeCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeSwgaW50IHBhaW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeSwgaW50IGZsYWdzLCBpbnQgcGFpbnQpOwogICAgIHByaXZhdGUgc3RhdGljIG5hdGl2ZSB2b2lkIG5hdGl2ZV9kcmF3VGV4dChpbnQgbmF0aXZlQ2FudmFzLCBTdHJpbmcgdGV4dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LCBpbnQgZW5kLCBmbG9hdCB4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB5LCBpbnQgcGFpbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB5LCBpbnQgZmxhZ3MsIGludCBwYWludCk7CisKKyAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCBuYXRpdmVfZHJhd1RleHRSdW4oaW50IG5hdGl2ZUNhbnZhcywgU3RyaW5nIHRleHQsCisgICAgICAgICAgICBpbnQgc3RhcnQsIGludCBlbmQsIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLAorICAgICAgICAgICAgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGZsYWdzLCBpbnQgcGFpbnQpOworCisgICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIHZvaWQgbmF0aXZlX2RyYXdUZXh0UnVuKGludCBuYXRpdmVDYW52YXMsIGNoYXJbXSB0ZXh0LAorICAgICAgICAgICAgaW50IHN0YXJ0LCBpbnQgY291bnQsIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0Q291bnQsCisgICAgICAgICAgICBmbG9hdCB4LCBmbG9hdCB5LCBpbnQgZmxhZ3MsIGludCBwYWludCk7CisKICAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCBuYXRpdmVfZHJhd1Bvc1RleHQoaW50IG5hdGl2ZUNhbnZhcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhcltdIHRleHQsIGludCBpbmRleCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50LCBmbG9hdFtdIHBvcywKQEAgLTE1NzAsMTEgKzE3NTUsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhcltdIHRleHQsIGludCBpbmRleCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50LCBpbnQgcGF0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgaE9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdk9mZnNldCwgaW50IHBhaW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdk9mZnNldCwgaW50IGJpZGlGbGFncywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBhaW50KTsKICAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCBuYXRpdmVfZHJhd1RleHRPblBhdGgoaW50IG5hdGl2ZUNhbnZhcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHRleHQsIGludCBwYXRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBoT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB2T2Zmc2V0LCBpbnQgcGFpbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBoT2Zmc2V0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdk9mZnNldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmbGFncywgaW50IHBhaW50KTsKICAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCBuYXRpdmVfZHJhd1BpY3R1cmUoaW50IG5hdGl2ZUN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1LDEyIEBACiAgKiA8L3A+CiAgKi8KIHB1YmxpYyBjbGFzcyBOaW5lUGF0Y2ggeworICAgIHByaXZhdGUgZmluYWwgQml0bWFwIG1CaXRtYXA7CisgICAgcHJpdmF0ZSBmaW5hbCBieXRlW10gbUNodW5rOworICAgIHByaXZhdGUgUGFpbnQgbVBhaW50OworICAgIHByaXZhdGUgU3RyaW5nIG1TcmNOYW1lOyAgLy8gVXNlZnVsIGZvciBkZWJ1Z2dpbmcKKyAgICBwcml2YXRlIGZpbmFsIFJlY3RGIG1SZWN0ID0gbmV3IFJlY3RGKCk7CisgICAgCiAgICAgLyoqIAogICAgICAqIENyZWF0ZSBhIGRyYXdhYmxlIHByb2plY3Rpb24gZnJvbSBhIGJpdG1hcCB0byBuaW5lIHBhdGNoZXMuCiAgICAgICoKQEAgLTc0LDEwICs4MCwxNCBAQAogICAgICAqIEBwYXJhbSBsb2NhdGlvbiAgV2hlcmUgdG8gZHJhdyB0aGUgYml0bWFwLgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGRyYXcoQ2FudmFzIGNhbnZhcywgUmVjdEYgbG9jYXRpb24pIHsKLSAgICAgICAgbmF0aXZlRHJhdyhjYW52YXMubU5hdGl2ZUNhbnZhcywgbG9jYXRpb24sCi0gICAgICAgICAgICAgICAgICAgbUJpdG1hcC5uaSgpLCBtQ2h1bmssCi0gICAgICAgICAgICAgICAgICAgbVBhaW50ICE9IG51bGwgPyBtUGFpbnQubU5hdGl2ZVBhaW50IDogMCwKLSAgICAgICAgICAgICAgICAgICBjYW52YXMubURlbnNpdHksIG1CaXRtYXAubURlbnNpdHkpOworICAgICAgICBpZiAoIWNhbnZhcy5pc0hhcmR3YXJlQWNjZWxlcmF0ZWQoKSkgeworICAgICAgICAgICAgbmF0aXZlRHJhdyhjYW52YXMubU5hdGl2ZUNhbnZhcywgbG9jYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgIG1CaXRtYXAubmkoKSwgbUNodW5rLAorICAgICAgICAgICAgICAgICAgICAgICBtUGFpbnQgIT0gbnVsbCA/IG1QYWludC5tTmF0aXZlUGFpbnQgOiAwLAorICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMubURlbnNpdHksIG1CaXRtYXAubURlbnNpdHkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgY2FudmFzLmRyYXdQYXRjaChtQml0bWFwLCBtQ2h1bmssIGxvY2F0aW9uLCBtUGFpbnQpOworICAgICAgICB9CiAgICAgfQogICAgIAogICAgIC8qKiAKQEAgLTg3LDEwICs5NywxNSBAQAogICAgICAqIEBwYXJhbSBsb2NhdGlvbiAgV2hlcmUgdG8gZHJhdyB0aGUgYml0bWFwLgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGRyYXcoQ2FudmFzIGNhbnZhcywgUmVjdCBsb2NhdGlvbikgewotICAgICAgICBuYXRpdmVEcmF3KGNhbnZhcy5tTmF0aXZlQ2FudmFzLCBsb2NhdGlvbiwKLSAgICAgICAgICAgICAgICBtQml0bWFwLm5pKCksIG1DaHVuaywKLSAgICAgICAgICAgICAgICBtUGFpbnQgIT0gbnVsbCA/IG1QYWludC5tTmF0aXZlUGFpbnQgOiAwLAotICAgICAgICAgICAgICAgIGNhbnZhcy5tRGVuc2l0eSwgbUJpdG1hcC5tRGVuc2l0eSk7CisgICAgICAgIGlmICghY2FudmFzLmlzSGFyZHdhcmVBY2NlbGVyYXRlZCgpKSB7CisgICAgICAgICAgICBuYXRpdmVEcmF3KGNhbnZhcy5tTmF0aXZlQ2FudmFzLCBsb2NhdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1CaXRtYXAubmkoKSwgbUNodW5rLAorICAgICAgICAgICAgICAgICAgICAgICAgbVBhaW50ICE9IG51bGwgPyBtUGFpbnQubU5hdGl2ZVBhaW50IDogMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5tRGVuc2l0eSwgbUJpdG1hcC5tRGVuc2l0eSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtUmVjdC5zZXQobG9jYXRpb24pOworICAgICAgICAgICAgY2FudmFzLmRyYXdQYXRjaChtQml0bWFwLCBtQ2h1bmssIG1SZWN0LCBtUGFpbnQpOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqIApAQCAtMTAxLDkgKzExNiwxNCBAQAogICAgICAqIEBwYXJhbSBwYWludCAgICAgVGhlIFBhaW50IHRvIGRyYXcgdGhyb3VnaC4KICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBkcmF3KENhbnZhcyBjYW52YXMsIFJlY3QgbG9jYXRpb24sIFBhaW50IHBhaW50KSB7Ci0gICAgICAgIG5hdGl2ZURyYXcoY2FudmFzLm1OYXRpdmVDYW52YXMsIGxvY2F0aW9uLAotICAgICAgICAgICAgICAgIG1CaXRtYXAubmkoKSwgbUNodW5rLCBwYWludCAhPSBudWxsID8gcGFpbnQubU5hdGl2ZVBhaW50IDogMCwKLSAgICAgICAgICAgICAgICBjYW52YXMubURlbnNpdHksIG1CaXRtYXAubURlbnNpdHkpOworICAgICAgICBpZiAoIWNhbnZhcy5pc0hhcmR3YXJlQWNjZWxlcmF0ZWQoKSkgeworICAgICAgICAgICAgbmF0aXZlRHJhdyhjYW52YXMubU5hdGl2ZUNhbnZhcywgbG9jYXRpb24sCisgICAgICAgICAgICAgICAgICAgIG1CaXRtYXAubmkoKSwgbUNodW5rLCBwYWludCAhPSBudWxsID8gcGFpbnQubU5hdGl2ZVBhaW50IDogMCwKKyAgICAgICAgICAgICAgICAgICAgY2FudmFzLm1EZW5zaXR5LCBtQml0bWFwLm1EZW5zaXR5KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1SZWN0LnNldChsb2NhdGlvbik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1BhdGNoKG1CaXRtYXAsIG1DaHVuaywgbVJlY3QsIHBhaW50KTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIC8qKgpAQCAtMTMzLDExICsxNTMs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CisgICAgcHVibGljIGZsb2F0IHNoYWRvd0R5OworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGZsb2F0IHNoYWRvd1JhZGl1czsKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBpbnQgc2hhZG93Q29sb3I7CisKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyAgaW50ICAgICAgICAgbUJpZGlGbGFncyA9IEJJRElfREVGQVVMVF9MVFI7CiAgICAgCiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3R5bGVbXSBzU3R5bGVBcnJheSA9IHsKICAgICAgICAgU3R5bGUuRklMTCwgU3R5bGUuU1RST0tFLCBTdHlsZS5GSUxMX0FORF9TVFJPS0UKQEAgLTc2LDggKzEwNiwxMTYgQEAKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgREVGQVVMVF9QQUlOVF9GTEFHUyA9IERFVl9LRVJOX1RFWFRfRkxBRzsKIAogICAgIC8qKgotICAgICAqIFRoZSBTdHlsZSBzcGVjaWZpZXMgaWYgdGhlIHByaW1pdGl2ZSBiZWluZyBkcmF3biBpcyBmaWxsZWQsCi0gICAgICogc3Ryb2tlZCwgb3IgYm90aCAoaW4gdGhlIHNhbWUgY29sb3IpLiBUaGUgZGVmYXVsdCBpcyBGSUxMLgorICAgICAqIEJpZGkgZmxhZyB0byBzZXQgTFRSIHBhcmFncmFwaCBkaXJlY3Rpb24uCisgICAgICogCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBCSURJX0xUUiA9IDB4MDsKKworICAgIC8qKgorICAgICAqIEJpZGkgZmxhZyB0byBzZXQgUlRMIHBhcmFncmFwaCBkaXJlY3Rpb24uCisgICAgICogCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBCSURJX1JUTCA9IDB4MTsKKworICAgIC8qKgorICAgICAqIEJpZGkgZmxhZyB0byBkZXRlY3QgcGFyYWdyYXBoIGRpcmVjdGlvbiB2aWEgaGV1cmlzdGljcywgZGVmYXVsdGluZyB0bworICAgICAqIExUUi4KKyAgICAgKiAKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEJJRElfREVGQVVMVF9MVFIgPSAweDI7CisKKyAgICAvKioKKyAgICAgKiBCaWRpIGZsYWcgdG8gZGV0ZWN0IHBhcmFncmFwaCBkaXJlY3Rpb24gdmlhIGhldXJpc3RpY3MsIGRlZmF1bHRpbmcgdG8KKyAgICAgKiBSVEwuCisgICAgICogCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBCSURJX0RFRkFVTFRfUlRMID0gMHgzOworCisgICAgLyoqCisgICAgICogQmlkaSBmbGFnIHRvIG92ZXJyaWRlIGRpcmVjdGlvbiB0byBhbGwgTFRSIChpZ25vcmUgYmlkaSkuCisgICAgICogCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBCSURJX0ZPUkNFX0xUUiA9IDB4NDsKKworICAgIC8qKgorICAgICAqIEJpZGkgZmxhZyB0byBvdmVycmlkZSBkaXJlY3Rpb24gdG8gYWxsIFJUTCAoaWdub3JlIGJpZGkpLgorICAgICAqIAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQklESV9GT1JDRV9SVEwgPSAweDU7CisKKyAgICAvKioKKyAgICAgKiBNYXhpbXVtIEJpZGkgZmxhZyB2YWx1ZS4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBCSURJX01BWF9GTEFHX1ZBTFVFID0gQklESV9GT1JDRV9SVEw7CisKKyAgICAvKioKKyAgICAgKiBNYXNrIGZvciBiaWRpIGZsYWdzLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEJJRElfRkxBR19NQVNLID0gMHg3OworCisgICAgLyoqCisgICAgICogRmxhZyBmb3IgZ2V0VGV4dFJ1bkFkdmFuY2VzIGluZGljYXRpbmcgbGVmdC10by1yaWdodCBydW4gZGlyZWN0aW9uLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRElSRUNUSU9OX0xUUiA9IDA7CisKKyAgICAvKioKKyAgICAgKiBGbGFnIGZvciBnZXRUZXh0UnVuQWR2YW5jZXMgaW5kaWNhdGluZyByaWdodC10by1sZWZ0IHJ1biBkaXJlY3Rpb24uCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBESVJFQ1RJT05fUlRMID0gMTsKKworICAgIC8qKgorICAgICAqIE9wdGlvbiBmb3IgZ2V0VGV4dFJ1bkN1cnNvciB0byBjb21wdXRlIHRoZSB2YWxpZCBjdXJzb3IgYWZ0ZXIKKyAgICAgKiBvZmZzZXQgb3IgdGhlIGxpbWl0IG9mIHRoZSBjb250ZXh0LCB3aGljaGV2ZXIgaXMgbGVzcy4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IENVUlNPUl9BRlRFUiA9IDA7CisKKyAgICAvKioKKyAgICAgKiBPcHRpb24gZm9yIGdldFRleHRSdW5DdXJzb3IgdG8gY29tcHV0ZSB0aGUgdmFsaWQgY3Vyc29yIGF0IG9yIGFmdGVyCisgICAgICogdGhlIG9mZnNldCBvciB0aGUgbGltaXQgb2YgdGhlIGNvbnRleHQsIHdoaWNoZXZlciBpcyBsZXNzLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQ1VSU09SX0FUX09SX0F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CB0byBpdHMgZGVmYXVsdCBzZXR0aW5ncy4gKi8KQEAgLTIxNiw2ICszNTcsNyBAQAogICAgICAgICBzZXRGbGFncyhERUZBVUxUX1BBSU5UX0ZMQUdTKTsKICAgICAgICAgbUhhc0NvbXBhdFNjYWxpbmcgPSBmYWxzZTsKICAgICAgICAgbUNvbXBhdFNjYWxpbmcgPSBtSW52Q29tcGF0U2NhbGluZyA9IDE7CisgICAgICAgIG1CaWRpRmxhZ3MgPSBCSURJX0RFRkFVTFRfTFRSOwogICAgIH0KICAgICAKICAgICAvKioKQEAgLTIzOCw2ICszODAsNyBAQAogICAgICAgICAgICAgbUhhc0NvbXBhdFNjYWxpbmcgPSBzcmMubUhhc0NvbXBhdFNjYWxpbmc7CiAgICAgICAgICAgICBtQ29tcGF0U2NhbGluZyAgICA9IHNyYy5tQ29tcGF0U2NhbGluZzsKICAgICAgICAgICAgIG1JbnZDb21wYXRTY2FsaW5nID0gc3JjLm1JbnZDb21wYXRTY2FsaW5nOworICAgICAgICAgICAgbUJpZGlGbGFncyAgICAgID0gc3JjLm1CaWRpRmxhZ3M7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTI1MiwxMCArMzk1LDMzIEBACiAgICAgICAgICAgICBtSW52Q29tcGF0U2NhbGluZyA9IDEuMGYvZmFjdG9yOwogICAgICAgICB9CiAgICAgfQotICAgIAorCisgICAgLyoqCisgICAgICogUmV0dXJuIHRoZSBiaWRpIGZsYWdzIG9uIHRoZSBwYWludC4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIHRoZSBiaWRpIGZsYWdzIG9uIHRoZSBwYWludAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGludCBnZXRCaWRpRmxhZ3MoKSB7CisgICAgICAgIHJldHVybiBtQmlkaUZsYWdzOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCB0aGUgYmlkaSBmbGFncyBvbiB0aGUgcGFpbnQuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgIC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ludCBjb250ZXh0Q291bnQsIGludCBmbGFncywgZmxvYXRbXSBhZHZhbmNlcywKKyAgICAgICAgICAgIGludCBhZHZhbmNlc0luZGV4KSB7CisKKyAgICAgICAgaWYgKChpbmRleCB8IGNvdW50IHwgY29udGV4dEluZGV4IHwgY29udGV4dENvdW50IHwgYWR2YW5jZXNJbmRleAorICAgICAgICAgICAgICAgIHwgKGluZGV4IC0gY29udGV4dEluZGV4KQorICAgICAgICAgICAgICAgIHwgKChjb250ZXh0SW5kZXggKyBjb250ZXh0Q291bnQpIC0gKGluZGV4ICsgY291bnQpKQorICAgICAgICAgICAgICAgIHwgKGNoYXJzLmxlbmd0aCAtIChjb250ZXh0SW5kZXggKyBjb250ZXh0Q291bnQpKQorICAgICAgICAgICAgICAgIHwgKGFkdmFuY2VzID09IG51bGwgPyAwIDoKKyAgICAgICAgICAgICAgICAgICAgKGFkdmFuY2VzLmxlbmd0aCAtIChhZHZhbmNlc0luZGV4ICsgY291bnQpKSkpIDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IEluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZmxhZ3MgIT0gRElSRUNUSU9OX0xUUiAmJiBmbGFncyAhPSBESVJFQ1RJT05fUlRMKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ1bmtub3duIGZsYWdzIHZhbHVlOiAiICsgZmxhZ3MpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCFtSGFzQ29tcGF0U2NhbGluZykgeworICAgICAgICAgICAgcmV0dXJuIG5hdGl2ZV9nZXRUZXh0UnVuQWR2YW5jZXMobU5hdGl2ZVBhaW50LCBjaGFycywgaW5kZXgsIGNvdW50LAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0SW5kZXgsIGNvbnRleHRDb3VudCwgZmxhZ3MsIGFkdmFuY2VzLCBhZHZhbmNlc0luZGV4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QsIGludCBlbmQsCisgICAgICAgICAgICBpbnQgY29udGV4dFN0YXJ0LCBpbnQgY29udGV4dEVuZCwgaW50IGZsYWdzLCBmbG9hdFtdIGFkdmFuY2VzLAorICAgICAgICAgICAgaW50IGFkdmFuY2VzSW5kZXgpIHsKKworICAgICAgICBpZiAodGV4dCBpbnN0YW5jZW9mIFN0cmluZykgeworICAgICAgICAgICAgcmV0dXJuIGdldFRleHRSdW5BZHZhbmNlcygoU3RyaW5nKSB0ZXh0LCBzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIGZsYWdzLCBhZHZhbmNlcywgYWR2YW5jZXNJbmRleCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBTcGFubmVkU3RyaW5nIHx8CisgICAgICAgICAgICB0ZXh0IGluc3RhbmNlb2YgU3Bhbm5hYmxlU3RyaW5nKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0VGV4dFJ1bkFkdmFuY2VzKHRleHQudG9TdHJpbmcoKSwgc3RhcnQsIGVuZCwKKyAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0LCBjb250ZXh0RW5kLCBmbGFncywgYWR2YW5jZXMsIGFkdmFuY2VzSW5kZXgpOworICAgICAgICB9CisgICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgR3JhcGhpY3NPcGVyYXRpb25zKSB7CisgICAgICAgICAgICByZXR1cm4gKChHcmFwaGljc09wZXJhdGlvbnMpIHRleHQpLmdldFRleHRSdW5BZHZhbmNlcyhzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIGZsYWdzLCBhZHZhbmNlcywgYWR2YW5jZXNJbmRleCwgdGhpcyk7CisgICAgICAgIH0KKworICAgICAgICBpbnQgY29udGV4dExlbiA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAg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W5BZHZhbmNlcyhTdHJpbmcgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLCBpbnQgY29udGV4dFN0YXJ0LAorICAgICAgICAgICAgaW50IGNvbnRleHRFbmQsIGludCBmbGFncywgZmxvYXRbXSBhZHZhbmNlcywgaW50IGFkdmFuY2VzSW5kZXgpIHsKKworICAgICAgICBpZiAoKHN0YXJ0IHwgZW5kIHwgY29udGV4dFN0YXJ0IHwgY29udGV4dEVuZCB8IGFkdmFuY2VzSW5kZXggfCAoZW5kIC0gc3RhcnQpCisgICAgICAgICAgICAgICAgfCAoc3RhcnQgLSBjb250ZXh0U3RhcnQpIHwgKGNvbnRleHRFbmQgLSBlbmQpCisgICAgICAgICAgICAgICAgfCAodGV4dC5sZW5ndGgoKSAtIGNvbnRleHRFbmQpCisgICAgICAgICAgICAgICAgfCAoYWR2YW5jZXMgPT0gbnVsbCA/IDAgOgorICAgICAgICAgICAgICAgICAgICAoYWR2YW5jZXMubGVuZ3RoIC0gYWR2YW5jZXNJbmRleCAtIChlbmQgLSBzdGFydCkpKSkgPCAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigpOworICAgICAgICB9CisgICAgICAgIGlmIChmbGFncyAhPSBESVJFQ1RJT05fTFRSICYmIGZsYWdzICE9IERJUkVDVElPTl9SVEwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInVua25vd24gZmxhZ3MgdmFsdWU6ICIgKyBmbGFncyk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1IYXNDb21wYXRTY2FsaW5nKSB7CisgICAgICAgICAgICByZXR1cm4gbmF0aXZlX2dldFRleHRSdW5BZHZhbmNlcyhtTmF0aXZlUGFpbnQsIHRleHQsIHN0YXJ0LCBlbmQsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgZmxhZ3MsI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ZygpLCBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsCisgICAgICAgICAgICAgICAgICAgIGZsYWdzLCBvZmZzZXQsIGN1cnNvck9wdCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBHcmFwaGljc09wZXJhdGlvbnMpIHsKKyAgICAgICAgICAgIHJldHVybiAoKEdyYXBoaWNzT3BlcmF0aW9ucykgdGV4dCkuZ2V0VGV4dFJ1bkN1cnNvcigKKyAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0LCBjb250ZXh0RW5kLCBmbGFncywgb2Zmc2V0LCBjdXJzb3JPcHQsIHRoaXMpOworICAgICAgICB9CisKKyAgICAgICAgaW50IGNvbnRleHRMZW4gPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICBjaGFyW10gYnVmID0gVGVtcG9yYXJ5QnVmZmVyLm9idGFpbihjb250ZXh0TGVuKTsKKyAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgYnVmLCAwKTsKKyAgICAgICAgaW50IHJlc3VsdCA9IGdldFRleHRSdW5DdXJzb3IoYnVmLCAwLCBjb250ZXh0TGVuLCBmbGFncywgb2Zmc2V0LCBjdXJzb3JPcHQpOworICAgICAgICBUZW1wb3JhcnlCdWZmZXIucmVjeWNsZShidWYpOworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIG5leHQgY3Vyc29yIHBvc2l0aW9uIGluIHRoZSBydW4uICBUaGlzIGF2b2lkcyBwbGFjaW5nIHRoZQorICAgICAqIGN1cnNvciBiZXR3ZWVuIHN1cnJvZ2F0ZXMsIGJldHdlZW4gY2hhcmFjdGVycyB0aGF0IGZvcm0gY29uanVuY3RzLAorICAgICAqIGJldHdlZW4gYmFzZSBjaGFyYWN0ZXJzIGFuZCBjb21iaW5pbmcgbWFya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ZmluYWwgaW50IG1OYXRpdmVQYXRoOworCisgICAgLyoqCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBpc1NpbXBsZVBhdGggPSB0cnVlOworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIFJlZ2lvbiByZWN0czsKKyAgICBwcml2YXRlIGJvb2xlYW4gbURldGVjdFNpbXBsZVBhdGhzOwogCiAgICAgLyoqCiAgICAgICogQ3JlYXRlIGFuIGVtcHR5IHBhdGgKICAgICAgKi8KICAgICBwdWJsaWMgUGF0aCgpIHsKICAgICAgICAgbU5hdGl2ZVBhdGggPSBpbml0MSgpOworICAgICAgICBtRGV0ZWN0U2ltcGxlUGF0aHMgPSBIYXJkd2FyZVJlbmRlcmVyLmlzQXZhaWxhYmxlKCk7CiAgICAgfQogCiAgICAgLyoqCkBAIC00Myw2ICs2MCw3IEBACiAgICAgICAgICAgICB2YWxOYXRpdmUgPSBzcmMubU5hdGl2ZVBhdGg7CiAgICAgICAgIH0KICAgICAgICAgbU5hdGl2ZVBhdGggPSBpbml0Mih2YWxOYXRpdmUpOworICAgICAgICBtRGV0ZWN0U2ltcGxlUGF0aHMgPSBIYXJkd2FyZVJlbmRlcmVyLmlzQXZhaWxhYmxlKCk7CiAgICAgfQogICAgIAogICAgIC8qKgpAQCAtNTAsNiArNjgsMTAgQEAKICAgICAgKiBUaGlzIGRvZXMgTk9UIGNoYW5nZSB0aGUgZmlsbC10eXBlIHNldHRpbmcuCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgcmVzZXQoKSB7CisgICAgICAgIGlzU2ltcGxlUGF0aCA9IHRydWU7CisgICAgICAgIGlmIChtRGV0ZWN0U2ltcGxlUGF0aHMpIHsKKyAgICAgICAgICAgIGlmIChyZWN0cyAhPSBudWxsKSByZWN0cy5zZXRFbXB0eSgpOworICAgICAgICB9CiAgICAgICAgIG5hdGl2ZV9yZXNldChtTmF0aXZlUGF0aCk7CiAg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2h0LCAoaW50KSByZWN0LmJvdHRvbSwKKyAgICAgICAgICAgICAgICAgICAgUmVnaW9uLk9wLlVOSU9OKTsKKyAgICAgICAgfQogICAgICAgICBuYXRpdmVfYWRkUmVjdChtTmF0aXZlUGF0aCwgcmVjdCwgZGlyLm5hdGl2ZUludCk7CiAgICAgfQogCkBAIC0zNjMsOCArNDA1LDExIEBACiAgICAgICogQHBhcmFtIGJvdHRvbSBUaGUgYm90dG9tIG9mIGEgcmVjdGFuZ2xlIHRvIGFkZCB0byB0aGUgcGF0aAogICAgICAqIEBwYXJhbSBkaXIgICAgVGhlIGRpcmVjdGlvbiB0byB3aW5kIHRoZSByZWN0YW5nbGUncyBjb250b3VyCiAgICAgICovCi0gICAgcHVibGljIHZvaWQgYWRkUmVjdChmbG9hdCBsZWZ0LCBmbG9hdCB0b3AsIGZsb2F0IHJpZ2h0LCBmbG9hdCBib3R0b20sCi0gICAgICAgICAgICAgICAgICAgICAgICBEaXJlY3Rpb24gZGlyKSB7CisgICAgcHVibGljIHZvaWQgYWRkUmVjdChmbG9hdCBsZWZ0LCBmbG9hdCB0b3AsIGZsb2F0IHJpZ2h0LCBmbG9hdCBib3R0b20sIERpcmVjdGlvbiBkaXIpIHsKKyAgICAgICAgaWYgKG1EZXRlY3RTaW1wbGVQYXRocykgeworICAgICAgICAgICAgaWYgKHJlY3RzID09IG51bGwpIHJlY3RzID0gbmV3IFJlZ2lvbigpOworICAgICAgICAgICAgcmVjdHMub3AoKGludCkgbGVmdCwgKGludCkgdG9wLCAoaW50KSByaWdodCwgKGludCkgYm90dG9tLCBSZWdpb24uT3AuVU5JT04pOworICAgICAgICB9CiAgICAgICAgIG5hdGl2ZV9hZGRSZWN0KG1OYXRpdmVQYXRoLCBsZWZ0LCB0b3AsIHJpZ2h0LCBib3R0b20sIGRpci5uYXRpdmVJbnQpOwogICAgIH0KIApAQCAtMzc4LDYgKzQyMyw3IEBACiAgICAgICAgIGlmIChvdmFsID09IG51bGwpIHsKICAgICAg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pOwogICAgIHByaXZhdGUgc3RhdGljIG5hdGl2ZSB2b2lkIGZpbmFsaXplcihpbnQgblBhdGgpOwotCi0gICAgcHJpdmF0ZSBmaW5hbCBpbnQgbU5hdGl2ZVBhdGg7CiB9CmRpZmYgLS1naXQgYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvZ3JhcGhpY3MvUG9ydGVyRHVmZi5qYXZhIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL2dyYXBoaWNzL1BvcnRlckR1ZmYuamF2YQppbmRleCAzOTA0MjM0Li4yZWYxNjYyIDEwMDY0NAotLS0gYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvZ3JhcGhpY3MvUG9ydGVyRHVmZi5qYXZhCisrKyBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9ncmFwaGljcy9Qb3J0ZXJEdWZmLmphdmEKQEAgLTUzLDExICs1MywxOCBAQAogICAgICAgICAvKiogW1NhICogRGEsIFNjICogRGNdICovCiAgICAgICAgIE1VTFRJUExZICAgICgxNCksCiAgICAgICAgIC8qKiBbU2EgKyBEYSAtIFNhICogRGEsIFNjICsgRGMgLSBTYyAqIERjXSAqLwotICAgICAgICBTQ1JFRU4gICAgICAoMTUpOworICAgICAgICBTQ1JFRU4gICAgICAoMTUpLAorICAgICAgICAvKiogU2F0dXJhdGUoUyArIEQpICovCisgICAgICAgIEFERCAgICAgICAgICgxNiksCisgICAgICAgIE9WRVJMQVkgICAgICgxNyk7CiAKICAgICAgICAgTW9kZShpbnQgbmF0aXZlSW50KSB7CiAgICAgICAgICAgICB0aGlzLm5hdGl2ZUludCA9IG5hdGl2ZUludDsKICAgICAgICAgfQotICAgICAgICBmaW5hbCBpbnQgbmF0aXZlSW50OworCisgICAgICAgIC8qKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGZpbmFsIGludCBuYXRpdmVJbnQ7CiAgICAgfQogfQpkaWZmIC0tZ2l0IGEvZ3JhcGhpY3M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mFsdWVzIGZvciB0aGVzZSBtdXN0IG1hdGNoIHVwIHdpdGggdGhlIGVudW0gaW4gU2tSZWdpb24uaAogICAgIHB1YmxpYyBlbnVtIE9wIHsKQEAgLTMzLDcgKzM3LDExIEBACiAgICAgICAgIE9wKGludCBuYXRpdmVJbnQpIHsKICAgICAgICAgICAgIHRoaXMubmF0aXZlSW50ID0gbmF0aXZlSW50OwogICAgICAgICB9Ci0gICAgICAgIGZpbmFsIGludCBuYXRpdmVJbnQ7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgZmluYWwgaW50IG5hdGl2ZUludDsKICAgICB9CiAKICAgICAvKiogQ3JlYXRlIGFuIGVtcHR5IHJlZ2lvbgpAQCAtMzI1LDEwICszMzMsMTQgQEAKICAgICB9CiAKICAgICBwcm90ZWN0ZWQgdm9pZCBmaW5hbGl6ZSgpIHRocm93cyBUaHJvd2FibGUgewotICAgICAgICBuYXRpdmVEZXN0cnVjdG9yKG1OYXRpdmVSZWdpb24pOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbmF0aXZlRGVzdHJ1Y3RvcihtTmF0aXZlUmVnaW9uKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHN1cGVyLmZpbmFsaXplKCk7CisgICAgICAgIH0KICAgICB9CiAgICAgCi0gICAgLypwYWNrYWdlKi8gUmVnaW9uKGludCBuaSkgeworICAgIFJlZ2lvbihpbnQgbmkpIHsKICAgICAgICAgaWYgKG5pID09IDApIHsKICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCk7CiAgICAgICAgIH0KQEAgLTM0MSw3ICszNTMsNyBAQAogICAgICAgICB0aGlzKG5pKTsKICAgICB9CiAKLSAgICAvKnBhY2thZ2UqLyBmaW5hbCBpbnQgbmkoKSB7CisgICAgZmluYWwgaW50IG5pKCkgewogICAgICAgICByZXR1cm4gbU5hdGl2ZVJlZ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3IEluc2V0RHJhd2FibGUoKTsKICAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygiYml0bWFwIikpIHsKLSAgICAgICAgICAgIGRyYXdhYmxlID0gbmV3IEJpdG1hcERyYXdhYmxlKCk7CisgICAgICAgICAgICBkcmF3YWJsZSA9IG5ldyBCaXRtYXBEcmF3YWJsZShyKTsKICAgICAgICAgICAgIGlmIChyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICgoQml0bWFwRHJhd2FibGUpIGRyYXdhYmxlKS5zZXRUYXJnZXREZW5zaXR5KHIuZ2V0RGlzcGxheU1ldHJpY3MoKSk7CiAgICAgICAgICAgICB9CkBAIC04MDUsNiArODE4LDkgQEAKICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgfQogCisgICAgLyoqCisgICAgICogSW5mbGF0ZSB0aGlzIERyYXdhYmxlIGZyb20gYW4gWE1MIHJlc291cmNlLgorICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGluZmxhdGUoUmVzb3VyY2VzIHIsIFhtbFB1bGxQYXJzZXIgcGFyc2VyLCBBdHRyaWJ1dGVTZXQgYXR0cnMpCiAgICAgICAgICAgICB0aHJvd3MgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbiwgSU9FeGNlcHRpb24gewogCkBAIC04MTMsNiArODI5LDEyIEBACiAgICAgICAgIGEucmVjeWNsZSgpOwogICAgIH0KIAorICAgIC8qKgorICAgICAqIEluZmxhdGUgYSBEcmF3YWJsZSBmcm9tIGFuIFhNTCByZXNvdXJjZS4KKyAgICAgKgorICAgICAqIEB0aHJvd3MgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbgorICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24KKyAgICAgKi8KICAgICB2b2lkIGluZmxhdGVXaXRoQXR0cmlidXRlcyhSZXNvdXJjZXMgciwgWG1sUHVsbFBhcnNlciBwYXJzZXIsCiAgICAgICAgICAgICBUeXBlZEFycmF5IGF0dHJzLCBpbnQgdmlzaW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hYmxlQ29udGFpbmVycyBvciBkaXJlY3RseSB1c2Ugb25lIGl0cyBjaGlsZCBjbGFzc2VzLgorICovCiBwdWJsaWMgY2xhc3MgRHJhd2FibGVDb250YWluZXIgZXh0ZW5kcyBEcmF3YWJsZSBpbXBsZW1lbnRzIERyYXdhYmxlLkNhbGxiYWNrIHsKIAogICAgIC8qKgpAQCAtMTk2LDggKzIwNCw3IEBACiAgICAgICAgICAgICAgICAgbURyYXdhYmxlQ29udGFpbmVyU3RhdGUuZ2V0T3BhY2l0eSgpOwogICAgIH0KIAotICAgIHB1YmxpYyBib29sZWFuIHNlbGVjdERyYXdhYmxlKGludCBpZHgpCi0gICAgeworICAgIHB1YmxpYyBib29sZWFuIHNlbGVjdERyYXdhYmxlKGludCBpZHgpIHsKICAgICAgICAgaWYgKGlkeCA9PSBtQ3VySW5kZXgpIHsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQpAQCAtMjU1LDYgKzI2MiwxMiBAQAogICAgICAgICByZXR1cm4gdGhpczsKICAgICB9CiAKKyAgICAvKioKKyAgICAgKiBBIENvbnN0YW50U3RhdGUgdGhhdCBjYW4gY29udGFpbiBzZXZlcmFsIHtAbGluayBEcmF3YWJsZX1zLgorICAgICAqCisgICAgICogVGhpcyBjbGFzcyB3YXMgbWFkZSBwdWJsaWMgdG8gZW5hYmxlIHRlc3RpbmcsIGFuZCBpdHMgdmlzaWJpbGl0eSBtYXkgY2hhbmdlIGluIGEgZnV0dXJlCisgICAgICogcmVsZWFzZS4KKyAgICAgKi8KICAgICBwdWJsaWMgYWJzdHJhY3Qgc3RhdGljIGNsYXNzIERyYXdhYmxlQ29udGFpbmVyU3RhdGUgZXh0ZW5kcyBDb25zdGFudFN0YXRlIHsKICAgICAgICAgZmluYWwgRHJhd2FibGVDb250YWluZXIgbU93bmVyOwogCkBAIC00NDMsMTIgKzQ1NiwxMiBAQAogICAgICAgICAgICAgcmV0dXJuIG1Db25zdGFudE1pbmltdW1IZWl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sMTYgQEAKICAgICAgICAgICAgIGNhc2UgUkVDVEFOR0xFOgogICAgICAgICAgICAgICAgIGlmIChzdC5tUmFkaXVzQXJyYXkgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBtUGF0aC5yZXNldCgpOwotICAgICAgICAgICAgICAgICAgICBtUGF0aC5hZGRSb3VuZFJlY3QobVJlY3QsIHN0Lm1SYWRpdXNBcnJheSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhdGguRGlyZWN0aW9uLkNXKTsKKyAgICAgICAgICAgICAgICAgICAgbVBhdGguYWRkUm91bmRSZWN0KG1SZWN0LCBzdC5tUmFkaXVzQXJyYXksIFBhdGguRGlyZWN0aW9uLkNXKTsKICAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdQYXRoKG1QYXRoLCBtRmlsbFBhaW50KTsKICAgICAgICAgICAgICAgICAgICAgaWYgKGhhdmVTdHJva2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3UGF0aChtUGF0aCwgbVN0cm9rZVBhaW50KTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0Lm1SYWRpdXMgPiAwLjBmKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIHNpbmNlIHRoZSBjYWxsZXIgaXMgb25seSBnaXZpbmcgdXMgMSB2YWx1ZSwgd2Ugd2lsbCBmb3JjZQogICAgICAgICAgICAgICAgICAgICAvLyBpdCB0byBiZSBzcXVhcmUgaWYgdGhlIHJlY3QgaXMgdG9vIHNtYWxsIGluIG9uZSBkaW1lbnNpb24KICAgICAgICAgICAgICAgICAgICAgLy8gdG8gc2hvdyBpdC4gSWYgd2UgZGlkIG5vdGhpbmcsIFNraWEgd291bGQgY2xhbXAgdGhlIHJhZAotICAgICAgICAgICAgICAgICAgICAvLyBpbmRlcGVuZGVudGx5IGFsb25nIGVhY2ggYXhpcywgZ2l2aW5nIHVzIGEgdGhpbiBlbGxpcHMKKyAgICAgICAgICAgICAgICAgICAgLy8gaW5kZXBlbmRlbnRseSBhbG9uZyBlYWNoIGF4aXMsIGdpdmluZyB1cyBhIHRoaW4gZWxsaXBzZQogICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGUgcmVjdCB3ZXJlIHZlcnkgd2lkZSBidXQgbm90IHZlcnkgdGFsbAogICAgICAgICAgICAgICAgICAgICBmbG9hdCByYWQgPSBzdC5tUmFkaXVzOwogICAgICAgICAgICAgICAgICAgICBmbG9hdCByID0gTWF0aC5taW4obVJlY3Qud2lkdGgoKSwgbVJlY3QuaGVpZ2h0KCkpICogMC41ZjsKQEAgLTMzNSw2ICszMzMsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKGhhdmVTdHJva2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3Um91bmRSZWN0KG1SZWN0LCByYWQsIHJhZCwgbVN0cm9rZVBhaW50KTsKICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdChtUmVjdCwgbUZpbGxQYWludCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChoYXZlU3Ryb2tlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QobVJlY3QsIG1TdHJva2VQYWludCk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIE9WQUw6CmRpZmYgLS1naXQgYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvZ3JhcGhpY3MvZHJhd2FibGUvTGF5ZXJEcmF3YWJsZS5qYXZhIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL2dyYXBo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ICAgICAgaW50IGRlcHRoOworICAgICAgICB3aGlsZSAoKHR5cGUgPSBwYXJzZXIubmV4dCgpKSAhPSBYbWxQdWxsUGFyc2VyLkVORF9ET0NVTUVOVAorICAgICAgICAgICAgICAgICYmICgoZGVwdGggPSBwYXJzZXIuZ2V0RGVwdGgoKSkgPj0gaW5uZXJEZXB0aAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgdHlwZSAhPSBYbWxQdWxsUGFyc2VyLkVORF9UQUcpKSB7CisgICAgICAgICAgICBpZiAodHlwZSAhPSBYbWxQdWxsUGFyc2VyLlNUQVJUX1RBRykgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZGVwdGggPiBpbm5lckRlcHRoIHx8ICFwYXJzZXIuZ2V0TmFtZSgpLmVxdWFscygiaXRlbSIpKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFR5cGVkQXJyYXkgYSA9IHIub2J0YWluQXR0cmlidXRlcyhhdHRycywKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuTWlwbWFwRHJhd2FibGVJdGVtKTsKKworICAgICAgICAgICAgaW50IGRyYXdhYmxlUmVzID0gYS5nZXRSZXNvdXJjZUlkKAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5NaXBtYXBEcmF3YWJsZUl0ZW1fZHJhd2FibGUsIDApOworCisgICAgICAgICAgICBhLnJlY3ljbGUoKTsKKworICAgICAgICAgICAgRHJhd2FibGUgZHI7CisgICAgICAgICAgICBpZiAoZHJhd2FibGVSZXMgIT0gMCkgeworICAgICAgICAgICAgICAgIGRyID0gci5nZXREcmF3YWJsZShkcmF3YWJsZVJlcyk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHdoaWxlICgodHlwZSA9IHBhcnNlci5uZXh0KCkpID09IFhtbFB1bGxQYXJzZXIuVEVYVCkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAodHlwZSAhPSBYbWxQdWxsUGFyc2VyLlNUQVJUX1RBRykgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0UG9zaXRpb25EZXNjcmlwdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiOiA8aXRlbT4gdGFnIHJlcXVpcmVzIGEgJ2RyYXdhYmxlJyBhdHRyaWJ1dGUgb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgImNoaWxkIHRhZyBkZWZpbmluZyBhIGRyYXdhYmxlIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGRyID0gRHJhd2FibGUuY3JlYXRlRnJvbVhtbElubmVyKHIsIHBhcnNlciwgYXR0cnMpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtTWlwbWFwQ29udGFpbmVyU3RhdGUuYWRkRHJhd2FibGUoZHIpOworICAgICAgICB9CisKKyAgICAgICAgb25EcmF3YWJsZUFkZGVkKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIERyYXdhYmxlIG11dGF0ZSgpIHsKKyAgICAgICAgaWYgKCFtTXV0YXRlZCAmJiBzdXBlci5tdXRhdGUoKSA9PSB0aGlzKSB7CisgICAgICAgICAgICBtTWlwbWFwQ29udGFpbmVyU3RhdGUubU1pcG1hcEhlaWdodHMgPSBtTWlwbWFwQ29udGFpbmVyU3RhdGUubU1pcG1hcEhlaWdodHMuY2xvbmUoKTsKKyAgICAgICAgICAgIG1NdXRhdGVkID0gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBjbGFzcyBNaXBtYXBDb250YWluZXJTdGF0ZSBleHRlbmRzIERyYXdhYmxlQ29udGFpbmVyU3RhdGUgeworICAgICAgICBwcml2YXRlIGludFtdIG1NaXBtYXBIZWlnaHRzOworCisgICAgICAgIE1pcG1hcENvbnRhaW5lclN0YXRlKE1pcG1hcENvbnRhaW5lclN0YXRlIG9yaWcsIE1pcG1hcERyYXdhYmxlIG93bmVyLCBSZXNvdXJjZXMgcmVzKSB7CisgICAgICAgICAgICBzdXBlcihvcmlnLCBvd25lciwgcmVzKTsKKworICAgICAgICAgICAgaWYgKG9yaWcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1NaXBtYXBIZWlnaHRzID0gb3JpZy5tTWlwbWFwSGVpZ2h0czsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbU1pcG1hcEhlaWdodHMgPSBuZXcgaW50W2dldENoaWxkcmVuKCkubGVuZ3RoXTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gQ2hhbmdlIHRoZSBkZWZhdWx0IHZhbHVlCisgICAgICAgICAgICBzZXRDb25zdGFudFNpemUodHJ1ZSk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJucyB0aGUgaW5kZXggb2YgdGhlIGNoaWxkIG1pcG1hcCBkcmF3YWJsZSB0aGF0IHdpbGwgYmVzdCBmaXQgdGhlIHByb3ZpZGVkIGJvdW5kcy4KKyAgICAgICAgICogVGhpcyBpbmRleCBpcyBkZXRlcm1pbmVkIGJ5IGNvbXBhcmluZyBib3VuZHMnIGhlaWdodCBhbmQgY2hpbGRyZW4gaW50cmluc2ljIGhlaWdodHMuCisgICAgICAgICAqIFRoZSByZXR1cm5lZCBtaXBtYXAgaW5kZXggaXMgdGhlIHNtYWxsZXN0IG1pcG1hcCB3aGljaCBoZWlnaHQgaXMgZ3JlYXRlciBvciBlcXVhbCB0aGFuCisgICAgICAgICAqIHRoZSBib3VuZHMnIGhlaWdodC4gSWYgdGhlIGJvdW5kcycgaGVpZ2h0IGlzIGxhcmdlciB0aGFuIHRoZSBsYXJnZXN0IG1pcG1hcCwgdGhlIGxhcmdlc3QKKyAgICAgICAgICogbWlwbWFwIGluZGV4IGlzIHJldHVybmVkLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gYm91bmRzIFRoZSBib3VuZHMgb2YgdGhlIE1pcE1hcERyYXdhYmxlLgorICAgICAgICAgKiBAcmV0dXJuIFRoZSBpbmRleCBvZiB0aGUgY2hpbGQgRHJhd2FibGUgdGhhdCB3aWxsIGJlc3QgZml0IHRoZXNlIGJvdW5kcywgb3IgLTEgaWYgdGhlcmUKKyAgICAgICAgICogYXJlIG5vIGNoaWxkcmVuIG1pcG1hcHMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGluZGV4Rm9yQm91bmRzKFJlY3QgYm91bmRzKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgYm91bmRzSGVpZ2h0ID0gYm91bmRzLmhlaWdodCgpOworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgeworICAgICAgICAgICAgICAgIGlmIChib3VuZHNIZWlnaHQgPD0gbU1pcG1hcEhlaWdodHNbaV0pIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBObyBtaXBtYXAgbGFyZ2VyIHRoYW4gYm91bmRzIGZvdW5kLiBVc2UgbGFyZ2VzdCBvbmUgd2hpY2ggd2lsbCBiZSBzY2FsZWQgdXAuCisgICAgICAgICAgICBpZiAoTiA+IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gTiAtIDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBObyBEcmF3YWJsZSBtaXBtYXAgYXQgYWxsCisgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQWRkcyBhIERyYXdhYmxlIHRvIHRoZSBsaXN0IG9mIGF2YWlsYWJsZSBtaXBtYXAgRHJhd2FibGVzLiBUaGlzIGxpc3QgY2FuIGJlIHJldHJpZXZlZAorICAgICAgICAgKiB1c2luZyB7QGxpbmsgRHJhd2FibGVDb250YWluZXIuRHJhd2FibGVDb250YWluZXJTdGF0ZSNnZXRDaGlsZHJlbigpfSBhbmQgdGhpcyBtZXRob2QKKyAgICAgICAgICogZW5zdXJlcyB0aGF0IGl0IGlzIGFsd2F5cyBzb3J0ZWQgYnkgaW5jcmVhc2luZyB7QGxpbmsgRHJhd2FibGUjZ2V0SW50cmluc2ljSGVpZ2h0KCl9LgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gZHJhd2FibGUgVGhlIERyYXdhYmxlIHRoYXQgd2lsbCBiZSBhZGRlZCB0byBjaGlsZHJlbiBsaXN0CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBhZGREcmF3YWJsZShEcmF3YWJsZSBkcmF3YWJsZSkgeworICAgICAgICAgICAgLy8gSW5zZXJ0IGRyYXdhYmxlIGluIGxhc3QgcG9zaXRpb24sIGNvcnJlY3RseSByZXNldHRpbmcgY2FjaGVkIHZhbHVlcyBhbmQKKyAgICAgICAgICAgIC8vIGVzcGVjaWFsbHkgbUNvbXB1dGVkQ29uc3RhbnRTaXplCisgICAgICAgICAgICBpbnQgcG9zID0gYWRkQ2hpbGQoZHJhd2FibGUpOworCisgICAgICAgICAgICAvLyBCdWJibGUgc29ydCB0aGUgbGFzdCBkcmF3YWJsZSB0byByZXN0b3JlIHRoZSBzb3J0IGJ5IGludHJpbnNpYyBoZWlnaHQKKyAgICAgICAgICAgIGZpbmFsIGludCBkcmF3YWJsZUhlaWdodCA9IGRyYXdhYmxlLmdldEludHJpbnNpY0hlaWdodCgpOworCisgICAgICAgICAgICB3aGlsZSAocG9zID4gMCkgeworICAgICAgICAgICAgICAgIGZpbmFsIERyYXdhYmxlIHByZXZpb3VzRHJhd2FibGUgPSBtRHJhd2FibGVzW3Bvcy0xXTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcHJldmlvdXNJbnRyaW5zaWNIZWlnaHQgPSBwcmV2aW91c0RyYXdhYmxlLmdldEludHJpbnNpY0hlaWdodCgpOworCisgICAgICAgICAgICAgICAgaWYgKGRyYXdhYmxlSGVpZ2h0IDwgcHJldmlvdXNJbnRyaW5zaWNIZWlnaHQpIHsKKyAgICAgICAgICAgICAgICAgICAgbURyYXdhYmxlc1twb3NdID0gcHJldmlvdXNEcmF3YWJsZTsKKyAgICAgICAgICAgICAgICAgICAgbU1pcG1hcEhlaWdodHNbcG9zXSA9IHByZXZpb3VzSW50cmluc2ljSGVpZ2h0OworCisgICAgICAgICAgICAgICAgICAgIG1EcmF3YWJsZXNbcG9zLTFdID0gZHJhd2FibGU7CisgICAgICAgICAgICAgICAgICAgIG1NaXBtYXBIZWlnaHRzW3Bvcy0xXSA9IGRyYXdhYmxlSGVpZ2h0OworICAgICAgICAgICAgICAgICAgICBwb3MtLTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogSW50cmluc2ljIHNpemVzIGFyZSB0aG9zZSBvZiB0aGUgbGFyZ2VzdCBhdmFpbGFibGUgbWlwbWFwLgorICAgICAgICAgKiBNaW5pbXVtIHNpemVzIGFyZSB0aG9zZSBvZiB0aGUgc21hbGxlc3QgYXZhaWxhYmxlIG1pcG1hcC4KKyAgICAgICAgICovCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBjb21wdXRlQ29uc3RhbnRTaXplKCkgeworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgICAgICBpZiAoTiA+IDApIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBEcmF3YWJsZSBzbWFsbGVzdERyYXdhYmxlID0gbURyYXdhYmxlc1swXTsKKyAgICAgICAgICAgICAgICBtQ29uc3RhbnRNaW5pbXVtV2lkdGggPSBzbWFsbGVzdERyYXdhYmxlLmdldE1pbmltdW1XaWR0aCgpOworICAgICAgICAgICAgICAgIG1Db25zdGFudE1pbmltdW1IZWlnaHQgPSBzbWFsbGVzdERyYXdhYmxlLmdldE1pbmltdW1IZWlnaHQoKTsKKworICAgICAgICAgICAgICAgIGZpbmFsIERyYXdhYmxlIGxhcmdlc3REcmF3YWJsZSA9IG1EcmF3YWJsZXNbTi0xXTsKKyAgICAgICAgICAgICAgICBtQ29uc3RhbnRXaWR0aCA9IGxhcmdlc3REcmF3YWJsZS5nZXRJbnRyaW5zaWNXaWR0aCgpOworICAgICAgICAgICAgICAgIG1Db25zdGFudEhlaWdodCA9IGxhcmdlc3REcmF3YWJsZS5nZXRJbnRyaW5zaWNIZWlnaHQoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUNvbnN0YW50V2lkdGggPSBtQ29uc3RhbnRIZWlnaHQgPSAtMTsKKyAgICAgICAgICAgICAgICBtQ29uc3RhbnRNaW5pbXVtV2lkdGggPSBtQ29uc3RhbnRNaW5pbXVtSGVpZ2h0ID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Db21wdXRlZENvbnN0YW50U2l6ZSA9IHRydWU7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIERyYXdhYmxlIG5ld0RyYXdhYmxlKCkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBNaXBtYXBEcmF3YWJsZSh0aGlzLCBudWxsKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICA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BlLmphdmEKQEAgLTU3LDEzICs1NywxMSBAQAogICAgICAqLwogICAgIHB1YmxpYyBSb3VuZFJlY3RTaGFwZShmbG9hdFtdIG91dGVyUmFkaWksIFJlY3RGIGluc2V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdFtdIGlubmVyUmFkaWkpIHsKLSAgICAgICAgaWYgKG91dGVyUmFkaWkubGVuZ3RoIDwgOCkgewotICAgICAgICAgICAgdGhyb3cgbmV3IEFycmF5SW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3V0ZXIgcmFkaWkgbXVzdCBoYXZlID49IDggdmFsdWVzIik7CisgICAgICAgIGlmIChvdXRlclJhZGlpICE9IG51bGwgJiYgb3V0ZXJSYWRpaS5sZW5ndGggPCA4KSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgQXJyYXlJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uKCJvdXRlciByYWRpaSBtdXN0IGhhdmUgPj0gOCB2YWx1ZXMiKTsKICAgICAgICAgfQogICAgICAgICBpZiAoaW5uZXJSYWRpaSAhPSBudWxsICYmIGlubmVyUmFkaWkubGVuZ3RoIDwgOCkgewotICAgICAgICAgICAgdGhyb3cgbmV3IEFycmF5SW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW5uZXIgcmFkaWkgbXVzdCBoYXZlID49IDggdmFsdWVzIik7CisgICAgICAgICAgICB0aHJvdyBuZXcgQXJyYXlJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uKCJpbm5lciByYWRpaSBtdXN0IGhhdmUgPj0gOCB2YWx1ZXMiKTsKICAgICAgICAgfQogICAgICAgICBtT3V0ZXJSYWRpaSA9IG91dGVyUmFkaWk7CiAgICAgICAgIG1JbnNldCA9IGluc2V0OwpAQCAtOTcsOCArOTUsNyBAQAogICAgIC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tdXN0IGJlID49IDIiKTsKLSAgICAgICAgfQotICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHB0cywgb2Zmc2V0LCBtQ3ViaWNQb2ludHMsIDAsIDI0KTsKLSAgICAgICAgaWYgKG1Sb3dzICE9IHJvd3MgfHwgbUNvbHMgIT0gY29scykgewotICAgICAgICAgICAgbVJvd3MgPSByb3dzOwotICAgICAgICAgICAgbUNvbHMgPSBjb2xzOwotICAgICAgICB9Ci0gICAgICAgIG1EaXJ0eSA9IHRydWU7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogUmVmZXJlbmNlIGEgYml0bWFwIHRleHR1cmUgdG8gYmUgbWFwcGVkIG9udG8gdGhlIHBhdGNoLgotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldFRleHR1cmUoQml0bWFwIHRleHR1cmUpIHsKLSAgICAgICAgaWYgKG1UZXh0dXJlICE9IHRleHR1cmUpIHsKLSAgICAgICAgICAgIGlmIChtVGV4dHVyZSA9PSBudWxsIHx8Ci0gICAgICAgICAgICAgICAgICAgIG1UZXh0dXJlLmdldFdpZHRoKCkgIT0gdGV4dHVyZS5nZXRXaWR0aCgpIHx8Ci0gICAgICAgICAgICAgICAgICAgIG1UZXh0dXJlLmdldEhlaWdodCgpICE9IHRleHR1cmUuZ2V0SGVpZ2h0KCkpIHsKLSAgICAgICAgICAgICAgICAvLyBuZWVkIHRvIHJlY29tcHV0ZSB0ZXh0dXJlIGNvb3JkaW5hdGVzCi0gICAgICAgICAgICAgICAgbURpcnR5ID0gdHJ1ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1UZXh0dXJlID0gdGV4dHVyZTsKLSAgICAgICAgICAgIG1QYWludC5zZXRTaGFkZXIobmV3IEJpdG1hcFNoYWRlcih0ZXh0dXJlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNoYWRlci5UaWxlTW9kZS5DTEFNUCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTaGFkZXIuVGlsZU1vZGUuQ0xBTVApKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJldHVybiB0aGUgcGFpbnQgZmxhZ3MgZm9yIHRoZSBwYXRjaAotICAgICAqLwotICAgIHB1YmxpYyBpbnQgZ2V0UGFpbnRGbGFncygpIHsKLSAgICAgICAgcmV0dXJuIG1QYWludC5nZXRGbGFncygpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFNldCB0aGUgcGFpbnQgZmxhZ3MgZm9yIHRoZSBwYXRjaAotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldFBhaW50RmxhZ3MoaW50IGZsYWdzKSB7Ci0gICAgICAgIG1QYWludC5zZXRGbGFncyhmbGFncyk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogU2V0IHRoZSB4ZmVybW9kZSBmb3IgdGhlIHBhdGNoCi0gICAgICovCi0gICAgcHVibGljIHZvaWQgc2V0WGZlcm1vZGUoWGZlcm1vZGUgbW9kZSkgewotICAgICAgICBtUGFpbnQuc2V0WGZlcm1vZGUobW9kZSk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogU2V0IHRoZSBhbHBoYSBmb3IgdGhlIHBhdGNoCi0gICAgICovCi0gICAgcHVibGljIHZvaWQgc2V0QWxwaGEoaW50IGFscGhhKSB7Ci0gICAgICAgIG1QYWludC5zZXRBbHBoYShhbHBoYSk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogRHJhdyB0aGUgcGF0Y2ggb250byB0aGUgY2FudmFzLgotICAgICAqCi0gICAgICogc2V0Q3ViaWNCb3VuZGFyeSgpIGFuZCBzZXRUZXh0dXJlKCkgbXVzdCBiZSBjYWxsZWQgYmVmb3JlIGRyYXdpbmcuCi0gICAgICovCi0gICAgcHVibGljIHZvaWQgZHJhdyhDYW52YXMgY2FudmFzKSB7Ci0gICAgICAgIGlmIChtRGlydHkpIHsKLSAgICAgIC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cmlwdC9BbGxvY2F0aW9uLmphdmEKKysrIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9BbGxvY2F0aW9uLmphdmEKQEAgLTM1LDExICszNSwyNSBAQAogICAgIEJpdG1hcCBtQml0bWFwOwogCiAgICAgQWxsb2NhdGlvbihpbnQgaWQsIFJlbmRlclNjcmlwdCBycywgVHlwZSB0KSB7Ci0gICAgICAgIHN1cGVyKHJzKTsKLSAgICAgICAgbUlEID0gaWQ7CisgICAgICAgIHN1cGVyKGlkLCBycyk7CiAgICAgICAgIG1UeXBlID0gdDsKICAgICB9CiAKKyAgICBBbGxvY2F0aW9uKGludCBpZCwgUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIHN1cGVyKGlkLCBycyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgdm9pZCB1cGRhdGVGcm9tTmF0aXZlKCkgeworICAgICAgICBtUlMudmFsaWRhdGUoKTsKKyAgICAgICAgbU5hbWUgPSBtUlMubkdldE5hbWUobUlEKTsKKyAgICAgICAgaW50IHR5cGVJRCA9IG1SUy5uQWxsb2NhdGlvbkdldFR5cGUobUlEKTsKKyAgICAgICAgaWYodHlwZUlEICE9IDApIHsKKyAgICAgICAgICAgIG1UeXBlID0gbmV3IFR5cGUodHlwZUlELCBtUlMpOworICAgICAgICAgICAgbVR5cGUudXBkYXRlRnJvbU5hdGl2ZSgpOworICAgICAgICB9CisgICAgfQorCiAgICAgcHVibGljIFR5cGUgZ2V0VHlwZSgpIHsKICAgICAgICAgcmV0dXJuIG1UeXBlOwogICAgIH0KQEAgLTc2LDEwICs5MCw2MiBAQAogICAgICAgICBzdWJEYXRhMUQoMCwgbVR5cGUuZ2V0RWxlbWVudENvdW50KCksIGQpOwogICAgIH0KIAorICAgIHB1YmxpYyB2b2lkIHVwZGF0ZUZyb21CaXRtYXAoQml0bWFwIGIpCisgICAgICAgIHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24geworCisgICAgICAgIG1SUy52YWxpZGF0ZSgpOworICAgICAgICBpZihtVHlwZS5nZXRYKCkgIT0gYi5nZXRXaWR0aCgpIHx8CisgICAgICAgICAgIG1UeXBlLmdldFkoKSAhPSBiLmdldEhlaWdodCgpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgdXBkYXRlIGFsbG9jYXRpb24gZnJvbSBiaXRtYXAsIHNpemVzIG1pc21hdGNoIik7CisgICAgICAgIH0KKworICAgICAgICBtUlMubkFsbG9jYXRpb25VcGRhdGVGcm9tQml0bWFwKG1JRCwgYik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc3ViRGF0YShpbnQgeG9mZiwgRmllbGRQYWNrZXIgZnApIHsKKyAgICAgICAgaW50IGVTaXplID0gbVR5cGUubUVsZW1lbnQuZ2V0U2l6ZUJ5dGVzKCk7CisgICAgICAgIGZpbmFsIGJ5dGVbXSBkYXRhID0gZnAuZ2V0RGF0YSgpOworCisgICAgICAgIGludCBjb3VudCA9IGRhdGEubGVuZ3RoIC8gZVNpemU7CisgICAgICAgIGlmICgoZVNpemUgKiBjb3VudCkgIT0gZGF0YS5sZW5ndGgpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkZpZWxkIHBhY2tlciBsZW5ndGggIiArIGRhdGEubGVuZ3RoICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBub3QgZGl2aXNpYmxlIGJ5IGVsZW1lbnQgc2l6ZSAiICsgZVNpemUgKyAiLiIpOworICAgICAgICB9CisgICAgICAgIGRhdGExRENoZWNrcyh4b2ZmLCBjb3VudCwgZGF0YS5sZW5ndGgsIGRhdGEubGVuZ3RoKTsKKyAgICAgICAgbVJTLm5BbGxvY2F0aW9uU3ViRGF0YTFEKG1JRCwgeG9mZiwgY291bnQsIGRhdGEsIGRhdGEubGVuZ3RoKTsKKyAgICB9CisKKworICAgIHB1YmxpYyB2b2lkIHN1YkVsZW1lbnREYXRhKGludCB4b2ZmLCBpbnQgY29tcG9uZW50X251bWJlciwgRmllbGRQYWNrZXIgZnApIHsKKyAgICAgICAgaWYgKGNvbXBvbmVudF9udW1iZXIgPj0gbVR5cGUubUVsZW1lbnQubUVsZW1lbnRzLmxlbmd0aCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ29tcG9uZW50X251bWJlciAiICsgY29tcG9uZW50X251bWJlciArICIgb3V0IG9mIHJhbmdlLiIpOworICAgICAgICB9CisgICAgICAgIGlmKHhvZmYgPCAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJPZmZzZXQgbXVzdCBiZSA+PSAwLiIpOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgYnl0ZVtdIGRhdGEgPSBmcC5nZXREYXRhKCk7CisgICAgICAgIGludCBlU2l6ZSA9IG1UeXBlLm1FbGVtZW50Lm1FbGVtZW50c1tjb21wb25lbnRfbnVtYmVyXS5nZXRTaXplQnl0ZXMoKTsKKworICAgICAgICBpZiAoZGF0YS5sZW5ndGggIT0gZVNpemUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkZpZWxkIHBhY2tlciBzaXplbGVuZ3RoICIgKyBkYXRhLmxlbmd0aCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZG9lcyBub3QgbWF0Y2ggY29tcG9uZW50IHNpemUgIiArIGVTaXplICsgIi4iKTsKKyAgICAgICAgfQorCisgICAgICAgIG1SUy5uQWxsb2NhdGlvblN1YkVsZW1lbnREYXRhMUQobUlELCB4b2ZmLCBjb21wb25lbnRfbnVtYmVyLCBkYXRhLCBkYXRhLmxlbmd0aCk7CisgICAgfQorCiAgICAgcHJpdmF0ZSB2b2lkIGRhdGExRENoZWNrcyhpbnQgb2ZmLCBpbnQgY291bnQsIGludCBsZW4sIGludCBkYXRhU2l6ZSkgewogICAgICAgICBtUlMudmFsaWRhdGUoKTsKLSAgICAgICAgaWYoKG9mZiA8IDApIHx8IChjb3VudCA8IDEpIHx8ICgob2ZmICsgY291bnQpID4gbVR5cGUuZ2V0RWxlbWVudENvdW50KCkpKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJPZmZzZXQgb3IgQ291bnQgb3V0IG9mIGJvdW5kcy4iKTsKKyAgICAgICAgaWYob2ZmIDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiT2Zmc2V0IG11c3QgYmUgPj0gMC4iKTsKKyAgICAgICAgfQorICAgICAgICBpZihjb3VudCA8IDEpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNvdW50IG11c3QgYmUgPj0gMS4iKTsKKyAgICAgICAgfQorICAgICAgICBpZigob2ZmICsgY291bnQpID4gbVR5cGUuZ2V0RWxlbWVudENvdW50KCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk92ZXJmbG93LCBBdmFpbGFibGUgY291bnQgIiArIG1UeXBlLmdldEVsZW1lbnRDb3VudCgpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiwgZ290ICIgKyBjb3VudCArICIgYXQgb2Zmc2V0ICIgKyBvZmYgKyAiLiIpOwogICAgICAgICB9CiAgICAgICAgIGlmKChsZW4pIDwgZGF0YVNpemUpIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkFycmF5IHRvbyBzbW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gfQorICAgICovCiAKICAgICBwdWJsaWMgY2xhc3MgQWRhcHRlcjFEIGV4dGVuZHMgQmFzZU9iaiB7CiAgICAgICAgIEFkYXB0ZXIxRChpbnQgaWQsIFJlbmRlclNjcmlwdCBycykgewotICAgICAgICAgICAgc3VwZXIocnMpOwotICAgICAgICAgICAgbUlEID0gaWQ7CisgICAgICAgICAgICBzdXBlcihpZCwgcnMpOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIHZvaWQgc2V0Q29uc3RyYWludChEaW1lbnNpb24gZGltLCBpbnQgdmFsdWUpIHsKQEAgLTE4OSw4ICsyNjIsNyBAQAogCiAgICAgcHVibGljIGNsYXNzIEFkYXB0ZXIyRCBleHRlbmRzIEJhc2VPYmogewogICAgICAgICBBZGFwdGVyMkQoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgICAgIHN1cGVyKHJzKTsKLSAgICAgICAgICAgIG1JRCA9IGlkOworICAgICAgICAgICAgc3VwZXIoaWQsIHJzKTsKICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIHNldENvbnN0cmFpbnQoRGltZW5zaW9uIGRpbSwgaW50IHZhbHVlKSB7CkBAIC0zMTcsMTcgKzM4OSw2IEBACiAgICAgICAgIHJldHVybiBhOwogICAgIH0KIAotICAgIHN0YXRpYyBBbGxvY2F0aW9uIGNyZWF0ZUZyb21CaXRtYXBCb3hlZChSZW5kZXJTY3JpcHQgcnMsIEJpdG1hcCBiLCBFbGVtZW50IGRzdEZtdCwgYm9vbGVhbiBnZW5NaXBzKQotICAgICAgICB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKLQotICAgICAgICBycy52YWxpZGF0ZSgpOwotICAgICAgICBpbnQgaWQgPSBycy5uQWxsb2NhdGlvbkNyZWF0ZUZyb21CaXRtYXBCb3hlZChkc3RGbXQubUlELCBnZW5NaXBzLCBiKTsKLSAgICAgICAgaWYoaWQgPT0gMCkgewotICAg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VtZW50TmFtZXM7CisgICAgaW50W10gbUFycmF5U2l6ZXM7CiAKICAgICBEYXRhVHlwZSBtVHlwZTsKICAgICBEYXRhS2luZCBtS2luZDsKQEAgLTM3LDMwICszOSwzNiBAQAogICAgIHB1YmxpYyBlbnVtIERhdGFUeXBlIHsKICAgICAgICAgLy9GTE9BVF8xNiAoMSwgMiksCiAgICAgICAgIEZMT0FUXzMyICgyLCA0KSwKLSAgICAgICAgLy9GTE9BVF82NCAoMywgOCksCisgICAgICAgIEZMT0FUXzY0ICgzLCA4KSwKICAgICAgICAgU0lHTkVEXzggKDQsIDEpLAogICAgICAgICBTSUdORURfMTYgKDUsIDIpLAogICAgICAgICBTSUdORURfMzIgKDYsIDQpLAotICAgICAgICAvL1NJR05FRF82NCAoNywgOCksCisgICAgICAgIFNJR05FRF82NCAoNywgOCksCiAgICAgICAgIFVOU0lHTkVEXzggKDgsIDEpLAogICAgICAgICBVTlNJR05FRF8xNiAoOSwgMiksCiAgICAgICAgIFVOU0lHTkVEXzMyICgxMCwgNCksCi0gICAgICAgIC8vVU5TSUdORURfNjQgKDExLCA4KSwKKyAgICAgICAgVU5TSUdORURfNjQgKDExLCA4KSwKIAotICAgICAgICBVTlNJR05FRF81XzZfNSAoMTIsIDIpLAotICAgICAgICBVTlNJR05FRF81XzVfNV8xICgxMywgMiksCi0gICAgICAgIFVOU0lHTkVEXzRfNF80XzQgKDE0LCAyKSwKKyAgICAgICAgQk9PTEVBTigxMiwgMSksCiAKLSAgICAgICAgUlNfRUxFTUVOVCAoMTUsIDQpLAotICAgICAgICBSU19UWVBFICgxNiwgNCksCi0gICAgICAgIFJTX0FMTE9DQVRJT04gKDE3LCA0KSwKLSAgICAgICAgUlNfU0FNUExFUiAoMTgsIDQpLAotICAgICAgICBSU19TQ1JJUFQgKDE5LCA0KSwKLSAgICAgICAgUlNfTUVTSCAoMjAsIDQpLAotICAgICAgICBSU19QUk9HUkFNX0ZSQUdNRU5UICgyMSwgNCksCi0gICAgICAgIFJTX1BST0dSQU1fVkVSVEVYICgyMiwgNCksCi0gICAgICAgIFJTX1BST0dSQU1fUkFTVEVSICgyMywgNCksCi0gICAgICAgIFJTX1BST0dSQU1fU1RPUkUgKDI0LCA0KTsKKyAgICAgICAgVU5TSUdORURfNV82XzUgKDEzLCAyKSwKKyAgICAgICAgVU5TSUdORURfNV81XzVfMSAoMTQsIDIpLAorICAgICAgICBVTlNJR05FRF80XzRfNF80ICgxNSwgMiksCisKKyAgICAgICAgTUFUUklYXzRYNCAoMTYsIDY0KSwKKyAgICAgICAgTUFUUklYXzNYMyAoMTcsIDM2KSwKKyAgICAgICAgTUFUUklYXzJYMiAoMTgsIDE2KSwKKworICAgICAgICBSU19FTEVNRU5UICgxMDAwLCA0KSwKKyAgICAgICAgUlNfVFlQRSAoMTAwMSwgNCksCisgICAgICAgIFJTX0FMTE9DQVRJT04gKDEwMDIsIDQpLAorICAgICAgICBSU19TQU1QTEVSICgxMDAzLCA0KSwKKyAgICAgICAgUlNfU0NSSVBUICgxMDA0LCA0KSwKKyAgICAgICAgUlNfTUVTSCAoMTAwNSwgNCksCisgICAgICAgIFJTX1BST0dSQU1fRlJBR01FTlQgKDEwMDYsIDQpLAorICAgICAgICBSU19QUk9HUkFNX1ZFUlRFWCAoMTAwNywgNCksCisgICAgICAgIFJTX1BST0dSQU1fUkFTVEVSICgxMDA4LCA0KSwKKyAgICAgICAgUlNfUFJPR1JBTV9TVE9SRSAoMTAwOSwgNCk7CiAKICAgICAgICAgaW50IG1JRDsKICAgICAgICAgaW50IG1TaXplOwpAQCAtNzIsMTIgKzgwLDYgQEAKIAogICAgIHB1YmxpYyBlbnVtIERhdGFLaW5kIHsKICAgICAgICAgVVNFUiAoMCksCi0gICAgICAgIENPTE9SICgxKSwKLSAgICAgICAgUE9TSVRJT04gKDIpLAotICAgICAgICBURVhUVVJFICgzKSwKLSAgICAgICAgTk9STUFMICg0KSwKLSAgICAgICAgSU5ERVggKDUpLAotICAgICAgICBQT0lOVF9TSVpFKDYpLAogCiAgICAgICAgIFBJWEVMX0wgKDcpLAogICAgICAgICBQSVhFTF9BICg4KSwKQEAgLTkxLDQxICs5MywxNTQgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVU0VSX1U4KFJlbmRlclNjcmlwdCBycykgewotICAgICAgICBpZihycy5tRWxlbWVudF9VU0VSX1U4ID09IG51bGwpIHsKLSAgICAgICAgICAgIHJzLm1FbGVtZW50X1VTRVJfVTggPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5VTlNJR05FRF84KTsKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgQk9PTEVBTihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfQk9PTEVBTiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9CT09MRUFOID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuQk9PTEVBTik7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1VTRVJfVTg7CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9CT09MRUFOOwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVU0VSX0k4KFJlbmRlclNjcmlwdCBycykgewotICAgICAgICBpZihycy5tRWxlbWVudF9VU0VSX0k4ID09IG51bGwpIHsKLSAgICAgICAgICAgIHJzLm1FbGVtZW50X1VTRVJfSTggPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5TSUdORURfOCk7CisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IFU4KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9VOCA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9VOCA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlVOU0lHTkVEXzgpOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBycy5tRWxlbWVudF9VU0VSX0k4OworICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfVTg7CiAgICAgfQogCi0gICAgcHVibGljIHN0YXRpYyBFbGVtZW50IFVTRVJfVTMyKFJlbmRlclNjcmlwdCBycykgewotICAgICAgICBpZihycy5tRWxlbWVudF9VU0VSX1UzMiA9PSBudWxsKSB7Ci0gICAgICAgICAgICBycy5tRWxlbWVudF9VU0VSX1UzMiA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlVOU0lHTkVEXzMyKTsKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgSTgoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X0k4ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X0k4ID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuU0lHTkVEXzgpOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBycy5tRWxlbWVudF9VU0VSX1UzMjsKKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X0k4OwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVU0VSX0kzMihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfVVNFUl9JMzIgPT0gbnVsbCkgewotICAgICAgICAgICAgcnMubUVsZW1lbnRfVVNFUl9JMzIgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5TSUdORURfMzIpOworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVMTYoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1UxNiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9VMTYgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5VTlNJR05FRF8xNik7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1VTRVJfSTMyOworICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfVTE2OwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVU0VSX0YzMihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfVVNFUl9GMzIgPT0gbnVsbCkgewotICAgICAgICAgICAgcnMubUVsZW1lbnRfVVNFUl9GMzIgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5GTE9BVF8zMik7CisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEkxNihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfSTE2ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X0kxNiA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlNJR05FRF8xNik7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1VTRVJfRjMyOworICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfSTE2OwogICAgIH0KIAorICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVMzIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1UzMiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9VMzIgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5VTlNJR05FRF8zMik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1UzMjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgSTMyKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9JMzIgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfSTMyID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuU0lHTkVEXzMyKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfSTMyOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVNjQoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1U2NCA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9VNjQgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5VTlNJR05FRF82NCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1U2NDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgSTY0KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9JNjQgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfSTY0ID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuU0lHTkVEXzY0KTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfSTY0OworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBGMzIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X0YzMiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9GMzIgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5GTE9BVF8zMik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X0YzMjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgRjY0KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9GNjQgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfRjY0ID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuRkxPQVRfNjQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9GNjQ7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEVMRU1FTlQoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X0VMRU1FTlQgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfRUxFTUVOVCA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlJTX0VMRU1FTlQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9FTEVNRU5UOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBUWVBFKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9UWVBFID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X1RZUEUgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5SU19UWVBFKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfVFlQRTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgQUxMT0NBVElPTihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfQUxMT0NBVElPTiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9BTExPQ0FUSU9OID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuUlNfQUxMT0NBVElPTik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X0FMTE9DQVRJT047CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IFNBTVBMRVIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1NBTVBMRVIgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfU0FNUExFUiA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlJTX1NBTVBMRVIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9TQU1QTEVSOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBTQ1JJUFQoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1NDUklQVCA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9TQ1JJUFQgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5SU19TQ1JJUFQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9TQ1JJUFQ7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IE1FU0goUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X01FU0ggPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfTUVTSCA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlJTX01FU0gpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9NRVNIOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBQUk9HUkFNX0ZSQUdNRU5UKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9QUk9HUkFNX0ZSQUdNRU5UID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X1BST0dSQU1fRlJBR01FTlQgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5SU19QUk9HUkFNX0ZSQUdNRU5UKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfUFJPR1JBTV9GUkFHTUVOVDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgUFJPR1JBTV9WRVJURVgoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1BST0dSQU1fVkVSVEVYID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X1BST0dSQU1fVkVSVEVYID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuUlNfUFJPR1JBTV9WRVJURVgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9QUk9HUkFNX1ZFUlRFWDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgUFJPR1JBTV9SQVNURVIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1BST0dSQU1fUkFTVEVSID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X1BST0dSQU1fUkFTVEVSID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuUlNfUFJPR1JBTV9SQVNURVIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9QUk9HUkFNX1JBU1RFUjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgUFJPR1JBTV9TVE9SRShSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfUFJPR1JBTV9TVE9SRSA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9QUk9HUkFNX1NUT1JFID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuUlNfUFJPR1JBTV9TVE9SRSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1BST0dSQU1fU1RPUkU7CisgICAgfQorCisKICAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgQV84KFJlbmRlclNjcmlwdCBycykgewogICAgICAgICBpZihycy5tRWxlbWVudF9BXzggPT0gbnVsbCkgewogICAgICAgICAgICAgcnMubUVsZW1lbnRfQV84ID0gY3JlYXRlUGl4ZWwocnMsIERhdGFUeXBlLlVOU0lHTkVEXzgsIERhdGFLaW5kLlBJWEVMX0EpOwpAQCAtMTY4LDE2OCArMjgzLDE0MSBAQAogICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfUkdCQV84ODg4OwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBJTkRFWF8xNihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfSU5ERVhfMTYgPT0gbnVsbCkgewotICAgICAgICAgICAgcnMubUVsZW1lbnRfSU5ERVhfMTYgPSBjcmVhdGVJbmRleChycyk7CisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEYzMl8yKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9GTE9BVF8yID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X0ZMT0FUXzIgPSBjcmVhdGVWZWN0b3IocnMsIERhdGFUeXBlLkZMT0FUXzMyLCAyKTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfSU5ERVhfMTY7CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9GTE9BVF8yOwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBBVFRSSUJfUE9TSVRJT05fMihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfUE9TSVRJT05fMiA9PSBudWxsKSB7Ci0gICAgICAgICAgICBycy5tRWxlbWVudF9QT1NJVElPTl8yID0gY3JlYXRlQXR0cmliKHJzLCBEYXRhVHlwZS5GTE9BVF8zMiwgRGF0YUtpbmQuUE9TSVRJT04sIDIpOworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBGMzJfMyhSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfRkxPQVRfMyA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9GTE9BVF8zID0gY3JlYXRlVmVjdG9y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U2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1VDSEFSXzQgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfVUNIQVJfNCA9IGNyZWF0ZVZlY3RvcihycywgRGF0YVR5cGUuVU5TSUdORURfOCwgNCk7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1RFWFRVUkVfMjsKKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1VDSEFSXzQ7CiAgICAgfQogCi0gICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEFUVFJJQl9OT1JNQUxfMyhSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfTk9STUFMXzMgPT0gbnVsbCkgewotICAgICAgICAgICAgcnMubUVsZW1lbnRfTk9STUFMXzMgPSBjcmVhdGVBdHRyaWIocnMsIERhdGFUeXBlLkZMT0FUXzMyLCBEYXRhS2luZC5OT1JNQUwsIDMpOworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBNQVRSSVhfNFg0KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9NQVRSSVhfNFg0ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X01BVFJJWF80WDQgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5NQVRSSVhfNFg0KTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfTk9STUFMXzM7CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9NQVRSSVhfNFg0OworICAgIH0KKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgTUFUUklYNFg0KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICByZXR1cm4gTUFUUklYXzRYNChycyk7CiAgICAgfQogCi0gICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEFUVFJJQl9DT0xPUl9VOF80KFJlbmRlcl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m4gcnMubUVsZW1lbnRfQ09MT1JfRjMyXzQ7CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9NQVRSSVhfMlgyOwogICAgIH0KIAotICAgIEVsZW1lbnQoUmVuZGVyU2NyaXB0IHJzLCBFbGVtZW50W10gZSwgU3RyaW5nW10gbikgewotICAgICAgICBzdXBlcihycyk7CisgICAgRWxlbWVudChpbnQgaWQsIFJlbmRlclNjcmlwdCBycywgRWxlbWVudFtdIGUsIFN0cmluZ1tdIG4sIGludFtdIGFzKSB7CisgICAgICAgIHN1cGVyKGlkLCBycyk7CiAgICAgICAgIG1TaXplID0gMDsKICAgICAgICAgbUVsZW1lbnRzID0gZTsKICAgICAgICAgbUVsZW1lbnROYW1lcyA9IG47Ci0gICAgICAgIGludFtdIGlkcyA9IG5ldyBpbnRbbUVsZW1lbnRzLmxlbmd0aF07CisgICAgICAgIG1BcnJheVNpemVzID0gYXM7CiAgICAgICAgIGZvciAoaW50IGN0ID0gMDsgY3QgPCBtRWxlbWVudHMubGVuZ3RoOyBjdCsrICkgewotICAgICAgICAgICAgbVNpemUgKz0gbUVsZW1lbnRzW2N0XS5tU2l6ZTsKLSAgICAgICAgICAgIGlkc1tjdF0gPSBtRWxlbWVudHNbY3RdLm1JRDsKKyAgICAgICAgICAgIG1TaXplICs9IG1FbGVtZW50c1tjdF0ubVNpemUgKiBtQXJyYXlTaXplc1tjdF07CiAgICAgICAgIH0KLSAgICAgICAgbUlEID0gcnMubkVsZW1lbnRDcmVhdGUyKGlkcywgbUVsZW1lbnROYW1lcyk7CiAgICAgfQogCi0gICAgRWxlbWVudChSZW5kZXJTY3JpcHQgcnMsIERhdGFUeXBlIGR0LCBEYXRhS2luZCBkaywgYm9vbGVhbiBub3JtLCBpbnQgc2l6ZSkgewotICAgICAgICBzdXBlcihycyk7CisgICAgRWxlbWVudChpbnQgaWQsIFJlbmRlclNjcmlwdCBycywgRGF0YVR5cGUgZHQsIERhdGFLaW5kIGRrLCBib29sZWFuIG5vcm0sIGludCBzaXplKSB7CisgICAgICAgIHN1cGVyKGlkLCBycyk7CiAgICAgICAgIG1TaXplID0gZHQubVNpemUgKiBzaXplOwogICAgICAgICBtVHlwZSA9IGR0OwogICAgICAgICBtS2luZCA9IGRrOwogICAgICAgICBtTm9ybWFsaXplZCA9IG5vcm07CiAgICAgICAgIG1WZWN0b3JTaXplID0gc2l6ZTsKLSAgICAgICAgbUlEID0gcnMubkVsZW1lbnRDcmVhdGUoZHQubUlELCBkay5tSUQsIG5vcm0sIHNpemUpOworICAgIH0KKworICAgIEVsZW1lbnQoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgc3VwZXIoaWQsIHJzKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICB2b2lkIHVwZGF0ZUZyb21OYXRpdmUoKSB7CisKKyAgICAgICAgLy8gd2Ugd2lsbCBwYWNrIG1UeXBlOyBtS2luZDsgbU5vcm1hbGl6ZWQ7IG1WZWN0b3JTaXplOyBOdW1TdWJFbGVtZW50cworICAgICAgICBpbnRbXSBkYXRhQnVmZmVyID0gbmV3IGludFs1XTsKKyAgICAgICAgbVJTLm5FbGVtZW50R2V0TmF0aXZlRGF0YShtSUQsIGRhdGFCdWZmZXIpOworCisgICAgICAgIG1Ob3JtYWxpemVkID0gZGF0YUJ1ZmZlclsyXSA9PSAxID8gdHJ1ZSA6IGZhbHNlOworICAgICAgICBtVmVjdG9yU2l6ZSA9IGRhdGFCdWZmZXJbM107CisgICAgICAgIG1TaXplID0gMDsKKyAgICAgICAgZm9yIChEYXRhVHlwZSBkdDogRGF0YVR5cGUudmFsdWVzKCkpIHsKKyAgICAgICAgICAgIGlmKGR0Lm1JRCA9PSBkYXRhQnVmZmVyWzBdKXsKKyAgICAgICAgICAgICAgICBtVHlwZSA9IGR0OworICAgICAgICAgICAgICAgIG1TaXplID0gbVR5cGUubVNpemUgKiBtVmVjdG9yU2l6ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBmb3IgKERhdGFLaW5kIGRrOiBEYXRhS2luZC52YWx1ZXMoKSkgeworICAgICAgICAgICAgaWYoZGsubUlEID09IGRhdGFCdWZmZXJbMV0peworICAgICAgICAgICAgICAgIG1LaW5kID0gZGs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpbnQgbnVtU3ViRWxlbWVudHMgPSBkYXRhQnVmZmVyWzRdOworICAgICAgICBpZihudW1TdWJFbGVtZW50cyA+IDApIHsKKyAgICAgICAgICAgIG1FbGVtZW50cyA9IG5ldyBFbGVtZW50W251bVN1YkVsZW1lbnRzXTsKKyAgICAgICAgICAgIG1FbGVtZW50TmFtZXMgPSBuZXcgU3RyaW5nW251bVN1YkVsZW1lbnRzXTsKKworICAgICAgICAgICAgaW50W10gc3ViRWxlbWVudElkcyA9IG5ldyBpbnRbbnVtU3ViRWxlbWVudHNdOworICAgICAgICAgICAgbVJTLm5FbGVtZW50R2V0U3ViRWxlbWVudHMobUlELCBzdWJFbGVtZW50SWRzLCBtRWxlbWVudE5hbWVzKTsKKyAgICAgICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBudW1TdWJFbGVtZW50czsgaSArKykgeworICAgICAgICAgICAgICAgIG1FbGVtZW50c1tpXSA9IG5ldyBFbGVtZW50KHN1YkVsZW1lbnRJZHNbaV0sIG1SUyk7CisgICAgICAgICAgICAgICAgbUVsZW1lbnRzW2ldLnVwZGF0ZUZyb21OYXRpdmUoKTsKKyAgICAgICAgICAgICAgICBtU2l6ZSArPSBtRWxlbWVudHNbaV0ubVNpemU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKwogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIGRlc3Ryb3koKSB0aHJvd3MgSWxsZWdhbFN0YXRlRXhjZXB0aW9uIHsKICAgICAgICAgc3VwZXIuZGVzdHJveSgpOwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBjcmVhdGVGcm9tQ2xhc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RyaWIoUmVuZGVyU2NyaXB0IHJzLCBEYXRhVHlwZSBkdCwgRGF0YUtpbmQgZGssIGludCBzaXplKSB7Ci0gICAgICAgIGlmICghKGR0ID09IERhdGFUeXBlLkZMT0FUXzMyIHx8Ci0gICAgICAgICAgICAgIGR0ID09IERhdGFUeXBlLlVOU0lHTkVEXzggfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuVU5TSUdORURfMTYgfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuVU5TSUdORURfMzIgfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuU0lHTkVEXzggfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuU0lHTkVEXzE2IHx8Ci0gICAgICAgICAgICAgIGR0ID09IERhdGFUeXBlLlNJR05FRF8zMikpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVuc3VwcG9ydGVkIERhdGFUeXBlIik7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIShkayA9PSBEYXRhS2luZC5DT0xPUiB8fAotICAgICAgICAgICAgICBkayA9PSBEYXRhS2luZC5QT1NJVElPTiB8fAotICAgICAgICAgICAgICBkayA9PSBEYXRhS2luZC5URVhUVVJFIHx8Ci0gICAgICAgICAgICAgIGRrID09IERhdGFLaW5kLk5PUk1BTCB8fAotICAgICAgICAgICAgICBkayA9PSBEYXRhS2luZC5QT0lOVF9TSVpFIHx8Ci0gICAgICAgICAgICAgIGRrID09IERhdGFLaW5kLlVTRVIpKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbnN1cHBvcnRlZCBEYXRhS2luZCIpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGRrID09IERhdGFLaW5kLkNPTE9SICYmCi0gICAgICAgICAgICAoKGR0ICE9IERhdGFUeXBlLkZMT0FUX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VU0VSOwogICAgICAgICBib29sZWFuIG5vcm0gPSBmYWxzZTsKLSAgICAgICAgaWYgKGRrID09IERhdGFLaW5kLkNPTE9SICYmIGR0ID09IERhdGFUeXBlLlVOU0lHTkVEXzgpIHsKLSAgICAgICAgICAgIG5vcm0gPSB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIG5ldyBFbGVtZW50KHJzLCBkdCwgZGssIG5vcm0sIHNpemUpOworICAgICAgICBpbnQgaWQgPSBycy5uRWxlbWVudENyZWF0ZShkdC5tSUQsIGRrLm1JRCwgbm9ybSwgc2l6ZSk7CisgICAgICAgIHJldHVybiBuZXcgRWxlbWVudChpZCwgcnMsIGR0LCBkaywgbm9ybSwgc2l6ZSk7CiAgICAgfQogCiAgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IGNyZWF0ZVBpeGVsKFJlbmRlclNjcmlwdCBycywgRGF0YVR5cGUgZHQsIERhdGFLaW5kIGRrKSB7CkBAIC0zNjcsMTMgKzQ1NSwxNiBAQAogICAgICAgICAgICAgc2l6ZSA9IDQ7CiAgICAgICAgIH0KIAotICAgICAgICByZXR1cm4gbmV3IEVsZW1lbnQocnMsIGR0LCBkaywgdHJ1ZSwgc2l6ZSk7CisgICAgICAgIGJvb2xlYW4gbm9ybSA9IHRydWU7CisgICAgICAgIGludCBpZCA9IHJzLm5FbGVtZW50Q3JlYXRlKGR0Lm1JRCwgZGsubUlELCBub3JtLCBzaXplKTsKKyAgICAgICAgcmV0dXJuIG5ldyBFbGVtZW50KGlkLCBycywgZHQsIGRrLCBub3JtLCBzaXplKTsKICAgICB9CiAKICAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgewogICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOwogICAgICAgICBFbGVtZW50W10gbUVsZW1lbnRzOwogICAgICAgICBTdHJpbmdbXSBtRWxlbWVudE5hbWVzOworICAgICAgICBpbnRbXSBtQXJyYXlTaXplczsKICAgICAgICAgaW50IG1Db3VudDsKIAogICAgICAgICBwdWJsaWMgQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMpIHsKQEAgLTM4MSwyOSArNDcyLDQ5IEBACiAgICAgICAgICAgICBtQ291bnQgPSAwOwogICAgICAgICAgICAgbUVsZW1lbnRzID0gbmV3IEVsZW1lbnRbOF07CiAgICAgICAgICAgICBtRWxlbWVudE5hbWVzID0gbmV3IFN0cmluZ1s4XTsKKyAgICAgICAgICAgIG1BcnJheVNpemVzID0gbmV3IGludFs4XTsKICAgICAgICAgfQogCi0gICAgICAgIHB1YmxpYyB2b2lkIGFkZChFbGVtZW50IGVsZW1lbnQsIFN0cmluZyBuYW1lKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIGFkZChFbGVtZW50IGVsZW1lbnQsIFN0cmluZyBuYW1lLCBpbnQgYXJyYXlTaXplKSB7CisgICAgICAgICAgICBpZiAoYXJyYXlTaXplIDwgMSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkFycmF5IHNpemUgY2Fubm90IGJlIGxlc3MgdGhhbiAxLiIpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYobUNvdW50ID09IG1FbGVtZW50cy5sZW5ndGgpIHsKICAgICAgICAgICAgICAgICBFbGVtZW50W10gZSA9IG5ldyBFbGVtZW50W21Db3VudCArIDhdOwogICAgICAgICAgICAgICAgIFN0cmluZ1tdIHMgPSBuZXcgU3RyaW5nW21Db3VudCArIDhdOworICAgICAgICAgICAgICAgIGludFtdIGFzID0gbmV3IGludFttQ291bnQgKyA4XTsKICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1FbGVtZW50cywgMCwgZSwgMCwgbUNvdW50KTsKICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1FbGVtZW50TmFtZXMsIDAsIHMsIDAsIG1Db3VudCk7CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtQXJyYXlTaXplcywgMCwgYXMsIDAsIG1Db3VudCk7CiAgICAgICAgICAgICAgICAgbUVsZW1lbnRzID0gZTsKICAgICAgICAgICAgICAgICBtRWxlbWVudE5hbWVzID0gczsKKyAgICAgICAgICAgICAgICBtQXJyYXlTaXplcyA9IGFzOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgbUVsZW1lbnRzW21Db3VudF0gPSBlbGVtZW50OwogICAgICAgICAgICAgbUVsZW1lbnROYW1lc1ttQ291bnRdID0gbmFtZTsKKyAgICAgICAgICAgIG1BcnJheVNpemVzW21Db3VudF0gPSBhcnJheVNpemU7CiAgICAgICAgICAgICBtQ291bnQrKzsKICAgICAgICAgfQogCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZChFbGVtZW50IGVsZW1lbnQsIFN0cmluZyBuYW1lKSB7CisgICAgICAgICAgICBhZGQoZWxlbWVudCwgbmFtZSwgMSk7CisgICAgICAgIH0KKwogICAgICAgICBwdWJsaWMgRWxlbWVudCBjcmVhdGUoKSB7CiAgICAgICAgICAgICBtUlMudmFsaWRhdGUoKTsKICAgICAgICAgICAgIEVsZW1lbnRbXSBlaW4gPSBuZXcgRWxlbWVudFttQ291bnRdOwogICAgICAgICAgICAgU3RyaW5nW10gc2luID0gbmV3IFN0cmluZ1ttQ291bnRdOworICAgICAgICAgICAgaW50W10gYXNpbiA9IG5ldyBpbnRbbUNvdW50XTsKICAgICAgICAgICAgIGphdmEubGFuZy5TeXN0ZW0uYXJyYXljb3B5KG1FbGVtZW50cywgMCwgZWluLCAwLCBtQ291bnQpOwogICAgICAgICAgICAgamF2YS5sYW5nLlN5c3RlbS5hcnJheWNvcHkobUVsZW1lbnROYW1lcywgMCwgc2luLCAwLCBtQ291bnQpOwotICAgICAgICAgICAgcmV0dXJuIG5ldyBFbGVtZW50KG1SUywgZWluLCBzaW4pOworICAgICAgICAgICAgamF2YS5sYW5nLlN5c3RlbS5hcnJheWNvcHkobUFycmF5U2l6ZXMsIDAsIGFzaW4sIDAsIG1Db3VudCk7CisKKyAgICAgICAgICAgIGludFtdIGlkcyA9IG5ldyBpbnRbZWluLmxlbmd0aF07CisgICAgICAgICAgICBmb3IgKGludCBjdCA9IDA7IGN0IDwgZWluLmxlbmd0aDsgY3QrKyApIHsKKyAgICAgICAgICAgICAgICBpZHNbY3RdID0gZWluW2N0XS5tSUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQgaWQgPSBtUlMubkVsZW1lbnRDcmVhdGUyKGlkcywgc2luLCBhc2luKTsKKyAgICAgICAgICAgIHJldHVybiBuZXcgRWxlbWVudChpZCwgbVJTLCBlaW4sIHNpbiwgYXNpbik7CiAgICAgICAgIH0KICAgICB9CiAKZGlmZiAtLWdpdCBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvRmllbGRQYWNrZXIuamF2YSBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvRmllbGRQYWNrZXIuamF2YQppbmRleCBiMjZlNDdkLi5mZjNlMjJiIDEwMDY0NAotLS0gYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvcmVuZGVyc2NyaXB0L0ZpZWxkUGFja2VyLmphdmEKKysrIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9GaWVsZFBhY2tlci5qYXZhCkBAIC0zMywyMSArMzMsMjggQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHZvaWQgcmVzZXQoKSB7CisgICAgcHVibGljIHZvaWQgcmVzZXQoKSB7CiAgICAgICAgIG1Qb3MgPSAwOwogICAgIH0KKyAgICBwdWJsaWMgdm9pZCByZXNldChpbnQgaSkgeworICAgICAgICBtUG9zID0gaTsKKyAgICB9CiAKLSAgICB2b2lkIGFkZEk4KGJ5dGUgdikgeworICAgIHB1YmxpYyB2b2lkIHNraXAoaW50IGkpIHsKKyAgICAgICAgbVBvcyArPSBpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZEk4KGJ5dGUgdikgewogICAgICAgICBtRGF0YVttUG9zKytdID0gdjsKICAgICB9CiAKLSAgICB2b2lkIGFkZEkxNihzaG9ydCB2KSB7CisgICAgcHVibGljIHZvaWQgYWRkSTE2KHNob3J0IHYpIHsKICAgICAgICAgYWxpZ24oMik7CiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkodiAmIDB4ZmYpOwogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpKHYgPj4gOCk7CiAgICAgfQogCi0gICAgdm9pZCBhZGRJMzIoaW50IHYpIHsKKyAgICBwdWJsaWMgdm9pZCBhZGRJMzIoaW50IHYpIHsKICAgICAgICAgYWxpZ24oNCk7CiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkodiAmIDB4ZmYpOwogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpKCh2ID4+IDgpICYgMHhmZik7CkBAIC01NSw3ICs2Miw3IEBACiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkoKHYgPj4gMjQpICYgMHhmZik7CiAgICAgfQogCi0gICAgdm9pZCBhZGRJNjQobG9uZyB2KSB7CisgICAgcHVibGljIHZvaWQgYWRkSTY0KGxvbmcgdikgewogICAgICAgICBhbGlnbig4KTsKICAgICAgICAgbURhdGFbbVBvcysrXSA9IChieXRlKSh2ICYgMHhmZik7CiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkoKHYgPj4gOCkgJiAweGZmKTsKQEAgLTY3LDE1ICs3NCwxNyBAQAogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpKCh2ID4+IDU2KSAmIDB4ZmYpOwogICAgIH0KIAotICAgIHZvaWQgYWRkVTgoc2hvcnQgdikgeworICAgIHB1YmxpYyB2b2lkIGFkZFU4KHNob3J0IHYpIHsKICAgICAgICAgaWYgKCh2IDwgMCkgfHwgKHYgPiAweGZmKSkgeworICAgICAgICAgICAgYW5kcm9pZC51dGlsLkxvZy5lKCJycyIsICJGaWVsZFBhY2tlci5hZGRVOCggIiArIHYgKyAiICkiKTsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlNhdmluZyB2YWx1ZSBvdXQgb2YgcmFuZ2UgZm9yIHR5cGUiKTsKICAgICAgICAgfQogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpdjsKICAgICB9CiAKLSAgICB2b2lkIGFkZFUxNihpbnQgdikgeworICAgIHB1YmxpYyB2b2lkIGFkZFUxNihpbnQgdikgewogICAgICAgICBpZiAoKHYgPCAwKSB8fCAodiA+IDB4ZmZmZikpIHsKKyAgICAgICAgICAgIGFuZHJvaWQudXRpbC5Mb2cuZSgicnMiLCAiRmllbGRQYWNrZXIuYWRkVTE2KCAiICsgdiArICIgKSIpOwogICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiU2F2aW5nIHZhbHVlIG91dCBvZiByYW5nZSBmb3IgdHlwZSIpOwogICAgICAgICB9CiAgICAgICAgIGFsaWduKDIpOwpAQCAtODMsOCArOTIsOSBAQAogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpKHYgPj4gOCk7CiAgICAgfQogCi0gICAgdm9pZCBhZGRVMzIobG9uZyB2KSB7Ci0gICAgICAgIGlmICgodiA8IDApIHx8ICh2ID4gMHhmZmZmZmZmZikpIHsKKyAgICBwdWJsaWMgdm9pZCBhZGRVMzIobG9uZyB2KSB7CisgICAgICAgIGlmICgodiA8IDApIHx8ICh2ID4gMHhmZmZmZmZmZkwpKSB7CisgICAgICAgICAgICBhbmRyb2lkLnV0aWwuTG9nLmUoInJzIiwgIkZpZWxkUGFja2VyLmFkZFUzMiggIiArIHYgKyAiICkiKTsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlNhdmluZyB2YWx1ZSBvdXQgb2YgcmFuZ2UgZm9yIHR5cGUiKTsKICAgICAgICAgfQogICAgICAgICBhbGlnbig0KTsKQEAgLTk0LDggKzEwNCw5IEBACiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkoKHYgPj4gMjQpICYgMHhmZik7CiAgICAgfQogCi0gICAgdm9pZCBhZGRVNjQobG9uZyB2KSB7CisgICAgcHVibGljIHZvaWQgYWRkVTY0KGxvbmcgdikgewogICAgICAgICBpZiAodiA8IDApIHsKKyAgICAgICAgICAgIGFuZHJvaWQudXRpbC5Mb2cuZSgicnMiLCAiRmllbGRQYWNrZXIuYWRkVTY0KCAiICsgdiArICIgKSIpOwogICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiU2F2aW5nIHZhbHVlIG91dCBvZiByYW5nZSBmb3IgdHlwZSIpOwogICAgICAgICB9CiAgICAgICAgIGFsaWduKDgpOwpAQCAtMTA5LDE1ICsxMjAsMTU3IEBACiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkoKHYgPj4gNTYpICYgMHhmZik7CiAgICAgfQogCi0gICAgdm9pZCBhZGRGMzIoZmxvYXQgdikgeworICAgIHB1YmxpYyB2b2lkIGFkZEYzMihmbG9hdCB2KSB7CiAgICAgICAgIGFkZEkzMihGbG9hdC5mbG9hdFRvUmF3SW50Qml0cyh2KSk7CiAgICAgfQogCi0gICAgdm9pZCBhZGRGNjQoZmxvYXQgdikgeworICAgIHB1YmxpYyB2b2lkIGFkZEY2NChkb3VibGUgdikgewogICAgICAgICBhZGRJNjQoRG91YmxlLmRvdWJsZVRvUmF3TG9uZ0JpdHModikpOwogICAgIH0KIAotICAgIGZpbmFsIGJ5dGVbXSBnZXREYXRhKCkgeworICAgIHB1YmxpYyB2b2lkIGFkZE9iaihCYXNlT2JqIG9iaikgeworICAgICAgICBpZiAob2JqICE9IG51bGwpIHsKKyAgICAgICAgICAgIGFkZEkzMihvYmouZ2V0SUQoKSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBhZGRJMzIoMCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRGMzIoRmxvYXQyIHYpIHsKKyAgICAgICAgYWRkRjMyKHYueCk7CisgICAgICAgIGFkZEYzMih2LnkpOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRGMzIoRmxvYXQzIHYpIHsKKyAgICAgICAgYWRkRjMyKHYueCk7CisgICAgICAgIGFkZEYzMih2LnkpOworICAgICAgICBhZGRGMzIodi56KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkRjMyKEZsb2F0NCB2KSB7CisgICAgICAgIGFkZEYzMih2LngpOworICAgICAgICBhZGRGMzIodi55KTsKKyAgICAgICAgYWRkRjMyKHYueik7CisgICAgICAgIGFkZEYzMih2LncpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZEk4KEJ5dGUyIHYpIHsKKyAgICAgICAgYWRkSTgodi54KTsKKyAgICAgICAgYWRkSTgodi55KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkSTgoQnl0ZTMgdikgeworICAgICAgICBhZGRJOCh2LngpOworICAgICAgICBhZGRJOCh2LnkpOworICAgICAgICBhZGRJOCh2LnopOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRJOChCeXRlNCB2KSB7CisgICAgICAgIGFkZEk4KHYueCk7CisgICAgICAgIGFkZEk4KHYueSk7CisgICAgICAgIGFkZEk4KHYueik7CisgICAgICAgIGFkZEk4KHYudyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkVTgoU2hvcnQyIHYpIHsKKyAgICAgICAgYWRkVTgodi54KTsKKyAgICAgICAgYWRkVTgodi55KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkVTgoU2hvcnQzIHYpIHsKKyAgICAgICAgYWRkVTgodi54KTsKKyAgICAgICAgYWRkVTgodi55KTsKKyAgICAgICAgYWRkVTgodi56KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkVTgoU2hvcnQ0IHYpIHsKKyAgICAgICAgYWRkVTgodi54KTsKKyAgICAgICAgYWRkVTgodi55KTsKKyAgICAgICAgYWRkVTgodi56KTsKKyAgICAgICAgYWRkVTgodi53KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRJMTYoU2hvcnQyIHYpIHsKKyAgICAgICAgYWRkSTE2KHYueCk7CisgICAgICAgIGFkZEkxNih2LnkpOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRJMTYoU2hvcnQzIHYpIHsKKyAgICAgICAgYWRkSTE2KHYueCk7CisgICAgICAgIGFkZEkxNih2LnkpOworICAgICAgICBhZGRJMTYodi56KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkSTE2KFNob3J0NCB2KSB7CisgICAgICAgIGFkZEkxNih2LngpOworICAgICAgICBhZGRJMTYodi55KTsKKyAgICAgICAgYWRkSTE2KHYueik7CisgICAgICAgIGFkZEkxNih2LncpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZFUxNihJbnQyIHYpIHsKKyAgICAgICAgYWRkVTE2KHYueCk7CisgICAgICAgIGFkZFUxNih2LnkpOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRVMTYoSW50MyB2KSB7CisgICAgICAgIGFkZFUxNih2LngpOworICAgICAgICBhZGRVMTYodi55KTsKKyAgICAgICAgYWRkVTE2KHYueik7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZFUxNihJbnQ0IHYpIHsKKyAgICAgICAgYWRkVTE2KHYueCk7CisgICAgICAgIGFkZFUxNih2LnkpOworICAgICAgICBhZGRVMTYodi56KTsKKyAgICAgICAgYWRkVTE2KHYudyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkSTMyKEludDIgdikgeworICAgICAgICBhZGRJMzIodi54KTsKKyAgICAgICAgYWRkSTMyKHYueSk7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZEkzMihJbnQzIHYpIHsKKyAgICAgICAgYWRkSTMyKHYueCk7CisgICAgICAgIGFkZEkzMih2LnkpOworICAgICAgICBhZGRJMzIodi56KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkSTMyKEludDQgdikgeworICAgICAgICBhZGRJMzIodi54KTsKKyAgICAgICAgYWRkSTMyKHYueSk7CisgICAgICAgIGFkZEkzMih2LnopOworICAgICAgICBhZGRJMzIodi53KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRVMzIoSW50MiB2KSB7CisgICAgICAgIGFkZFUzMih2LngpOworICAgICAgICBhZGRVMzIodi55KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkVTMyKEludDMgdikgeworICAgICAgICBhZGRVMzIodi54KTsKKyAgICAgICAgYWRkVTMyKHYueSk7CisgICAgICAgIGFkZFUzMih2LnopOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRVMzIoSW50NCB2KSB7CisgICAgICAgIGFkZFUzMih2LngpOworICAgICAgICBhZGRVMzIodi55KTsKKyAgICAgICAgYWRkVTMyKHYueik7CisgICAgICAgIGFkZFUzMih2LncpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZE9iaihNYXRyaXg0ZiB2KSB7CisgICAgICAgIGZvciAoaW50IGk9MDsgaSA8IHYubU1hdC5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgYWRkRjMyKHYubU1hdFtpXSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRPYmooTWF0cml4M2YgdikgeworICAgICAgICBmb3IgKGludCBpPTA7IGkgPCB2Lm1NYXQubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIGFkZEYzMih2Lm1NYXRbaV0pOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkT2JqKE1hdHJpeDJmIHYpIHsKKyAgICAgICAgZm9yIChpb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X1JBU1RFUiwKKyAgICAgICAgUFJPR1JBTV9GUkFHTUVOVCwKKyAgICAgICAgUFJPR1JBTV9TVE9SRSwKKyAgICAgICAgU0FNUExFUiwKKyAgICAgICAgQU5JTUFUSU9OLAorICAgICAgICBBREFQVEVSXzFELAorICAgICAgICBBREFQVEVSXzJELAorICAgICAgICBTQ1JJUFRfQzsKKworICAgICAgICBwdWJsaWMgc3RhdGljIENsYXNzSUQgdG9DbGFzc0lEKGludCBpbnRJRCkgeworICAgICAgICAgICAgcmV0dXJuIENsYXNzSUQudmFsdWVzKClbaW50SURdOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gUmVhZCBvbmx5IGNsYXNzIHdpdGggaW5kZXggZW50cmllcworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgSW5kZXhFbnRyeSB7CisgICAgICAgIFJlbmRlclNjcmlwdCBtUlM7CisgICAgICAgIGludCBtSW5kZXg7CisgICAgICAgIGludCBtSUQ7CisgICAgICAgIFN0cmluZyBtTmFtZTsKKyAgICAgICAgQ2xhc3NJRCBtQ2xhc3NJRDsKKyAgICAgICAgQmFzZU9iaiBtTG9hZGVkT2JqOworCisgICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0TmFtZSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtTmFtZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBDbGFzc0lEIGdldENsYXNzSUQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUNsYXNzSUQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQmFzZU9iaiBnZXRPYmplY3QoKSB7CisgICAgICAgICAgICBtUlMudmFsaWRhdGUoKTsKKyAgICAgICAgICAgIEJhc2VPYmogb2JqID0gaW50ZXJuYWxDcmVhdGUobVJTLCB0aGlzKTsKKyAgICAgICAgICAgIHJldHVybiBvYmo7CisgICAgICAgIH0KKworICAgICAgICBzdGF0aWMgc3luY2hyb25pemVkIEJhc2VPYmogaW50ZXJuYWxDcmVhdGUoUmVuZGVyU2NyaXB0IHJzLCBJbmRleEVudHJ5IGVudHJ5KSB7CisgICAgICAgICAgICBpZihlbnRyeS5tTG9hZGVkT2JqICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZW50cnkubUxvYWRlZE9iajsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYoZW50cnkubUNsYXNzSUQgPT0gQ2xhc3NJRC5VTktOT1dOKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCBvYmplY3RJRCA9IHJzLm5GaWxlQTNER2V0RW50cnlCeUluZGV4KGVudHJ5Lm1JRCwgZW50cnkubUluZGV4KTsKKyAgICAgICAgICAgIGlmKG9iamVjdElEID09IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3dpdGNoIChlbnRyeS5tQ2xhc3NJRCkgeworICAgICAgICAgICAgY2FzZSBNRVNIOgorICAgICAgICAgICAgICAgIGVudHJ5Lm1Mb2FkZWRPYmogPSBuZXcgTWVzaChvYmplY3RJRCwgcnMpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBUWVBFOgorICAgICAgICAgICAgICAgIGVudHJ5Lm1Mb2FkZWRPYmogPSBuZXcgVHlwZShvYmplY3RJRCwgcnMpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBFTEVNRU5UOgorICAgICAgICAgICAgICAgIGVudHJ5Lm1Mb2FkZWRPYmogPSBudWxsOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBTExPQ0FUSU9OOgorICAgICAgICAgICAgICAgIGVudHJ5Lm1Mb2FkZWRPYmogPSBudWxsOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBQUk9HUkFNX1ZFUlRFWDoKKyAgICAgICAgICAgICAgICBlbnRyeS5tTG9hZGVkT2JqID0gbmV3IFByb2dyYW1WZXJ0ZXgob2JqZWN0SUQsIHJzKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgUFJPR1JBTV9SQVNURVI6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFBST0dSQU1fRlJBR01FTlQ6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFBST0dSQU1fU1RPUkU6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNBTVBMRVI6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEFOSU1BVElPTjoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQURBUFRFUl8xRDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQURBUFRFUl8yRDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU0NSSVBUX0M6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGVudHJ5Lm1Mb2FkZWRPYmoudXBkYXRlRnJvbU5hdGl2ZSgpOworCisgICAgICAgICAgICByZXR1cm4gZW50cnkubUxvYWRlZE9iajsKKyAgICAgICAgfQorCisgICAgICAgIEluZGV4RW50cnkoUmVuZGVyU2NyaXB0IHJzLCBpbnQgaW5kZXgsIGludCBpZCwgU3RyaW5nIG5hbWUsIENsYXNzSUQgY2xhc3NJRCkgeworICAgICAgICAgICAgbVJTID0gcnM7CisgICAgICAgICAgICBtSW5kZXggPSBpbmRleDsKKyAgICAgICAgICAgIG1JRCA9IGlkOworICAgICAgICAgICAgbU5hbWUgPSBuYW1lOworICAgICAgICAgICAgbUNsYXNzSUQgPSBjbGFzc0lEOworICAgICAgICAgICAgbUxvYWRlZE9iaiA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBJbmRleEVudHJ5W10gbUZpbGVFbnRyaWVzOworICAgIElucHV0U3RyZWFtIG1JbnB1dFN0cmVhbTsKKworICAgIEZpbGVBM0QoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMsIElucHV0U3RyZWFtIHN0cmVhbSkgeworICAgICAgICBzdXBlcihpZCwgcnMpOworICAgICAgICBtSW5wdXRTdHJlYW0gPSBzdHJlYW07CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGluaXRFbnRyaWVzKCkgeworICAgICAgICBpbnQgbnVtRmlsZUVudHJpZXMgPSBtUlMubkZpbGVBM0RHZXROdW1JbmRleEVudHJpZXMobUlEKTsKKyAgICAgICAgaWYobnVtRmlsZUVudHJpZXMgPD0gMCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgbUZpbGVFbnRyaWVzID0gbmV3IEluZGV4RW50cnlbbnVtRmlsZUVudHJpZXNdOworICAgICAgICBpbnRbXSBpZHMgPSBuZXcgaW50W251bUZpbGVFbnRyaWVzXTsKKyAgICAgICAgU3RyaW5nW10gbmFtZXMgPSBuZXcgU3RyaW5nW251bUZpbGVFbnRyaWVzXTsKKworICAgICAgICBtUlMubkZpbGVBM0RHZXRJbmRleEVudHJpZXMobUlELCBudW1GaWxlRW50cmllcywgaWRzLCBuYW1lcyk7CisKKyAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IG51bUZpbGVFbnRyaWVzOyBpICsrKSB7CisgICAgICAgICAgICBtRmlsZUVudHJpZXNbaV0gPSBuZXcgSW5kZXhFbnRyeShtUlMsIGksIG1JRCwgbmFtZXNbaV0sIENsYXNzSUQudG9DbGFzc0lEKGlkc1tpXSkpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXROdW1JbmRleEVudHJpZXMoKSB7CisgICAgICAgIGlmKG1GaWxlRW50cmllcyA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUZpbGVFbnRyaWVzLmxlbmd0aDsKKyAgICB9CisKKyAgICBwdWJsaWMgSW5kZXhFbnRyeSBnZXRJbmRleEVudHJ5KGludCBpbmRleCkgeworICAgICAgICBpZihnZXROdW1JbmRleEVudHJpZXMoKSA9PSAwIHx8IGluZGV4IDwgMCB8fCBpbmRleCA+PSBtRmlsZUVudHJpZXMubGVuZ3RoKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUZpbGVFbnRyaWVzW2luZGV4XTsKKyAgICB9CisKKyAgICBzdGF0aWMgcHVibGljIEZpbGVBM0QgY3JlYXRlRnJvbVJlc291cmNlKFJlbmRlclNjcmlwdCBycywgUmVzb3VyY2VzIHJlcywgaW50IGlkKQorICAgICAgICB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKKworICAgICAgICBycy52YWxpZGF0ZSgpOworICAgICAgICBJbnB1dFN0cmVhbSBpcyA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBmaW5hbCBUeXBlZFZhbHVlIHZhbHVlID0gbmV3IFR5cGVkVmFsdWUoKTsKKyAgICAgICAgICAgIGlzID0gcmVzLm9wZW5SYXdSZXNvdXJjZShpZCwgdmFsdWUpOworCisgICAgICAgICAgICBpbnQgYXNzZXQgPSAoKEFzc2V0TWFuYWdlci5Bc3NldElucHV0U3RyZWFtKSBpcykuZ2V0QXNzZXRJbnQoKTsKKworICAgICAgICAgICAgaW50IGZpbGVJZCA9IHJzLm5GaWxlQTNEQ3JlYXRlRnJvbUFzc2V0U3RyZWFtKGFzc2V0KTsKKworICAgICAgICAgICAgaWYoZmlsZUlkID09IDApIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJMb2FkIGZhaWxlZC4iKTsKKyAgICAgICAgICAg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gIFN0cmluZyBtTm9ybWFsRmlsZU5hbWU7CisgICAgICAgIFN0cmluZyBtQm9sZEZpbGVOYW1lOworICAgICAgICBTdHJpbmcgbUl0YWxpY0ZpbGVOYW1lOworICAgICAgICBTdHJpbmcgbUJvbGRJdGFsaWNGaWxlTmFtZTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBNYXA8U3RyaW5nLCBGb250RmFtaWx5PiBzRm9udEZhbWlseU1hcDsKKworICAgIHB1YmxpYyBlbnVtIFN0eWxlIHsKKyAgICAgICAgTk9STUFMLAorICAgICAgICBCT0xELAorICAgICAgICBJVEFMSUMsCisgICAgICAgIEJPTERfSVRBTElDOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgYWRkRmFtaWx5VG9NYXAoRm9udEZhbWlseSBmYW1pbHkpIHsKKyAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IGZhbWlseS5tTmFtZXMubGVuZ3RoOyBpICsrKSB7CisgICAgICAgICAgICBzRm9udEZhbWlseU1hcC5wdXQoZmFtaWx5Lm1OYW1lc1tpXSwgZmFtaWx5KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgaW5pdEZvbnRGYW1pbHlNYXAoKSB7CisgICAgICAgIHNGb250RmFtaWx5TWFwID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBGb250RmFtaWx5PigpOworCisgICAgICAgIEZvbnRGYW1pbHkgc2Fuc0ZhbWlseSA9IG5ldyBGb250RmFtaWx5KCk7CisgICAgICAgIHNhbnNGYW1pbHkubU5hbWVzID0gc1NhbnNOYW1lczsKKyAgICAgICAgc2Fuc0ZhbWlseS5tTm9ybWFsRmlsZU5hbWUgPSAiRHJvaWRTYW5zLnR0ZiI7CisgICAgICAgIHNhbnNGYW1pbHkubUJvbGRGaWxlTmFtZSA9ICJEcm9pZFNhbnMtQm9sZC50dGYiOworICAgICAgICBzYW5zRmFtaWx5Lm1JdGFsaWNGaWx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tZSA9ICJEcm9pZFNhbnNNb25vLnR0ZiI7CisgICAgICAgIGFkZEZhbWlseVRvTWFwKG1vbm9GYW1pbHkpOworICAgIH0KKworICAgIHN0YXRpYyB7CisgICAgICAgIGluaXRGb250RmFtaWx5TWFwKCk7CisgICAgfQorCisgICAgc3RhdGljIFN0cmluZyBnZXRGb250RmlsZU5hbWUoU3RyaW5nIGZhbWlseU5hbWUsIFN0eWxlIHN0eWxlKSB7CisgICAgICAgIEZvbnRGYW1pbHkgZmFtaWx5ID0gc0ZvbnRGYW1pbHlNYXAuZ2V0KGZhbWlseU5hbWUpOworICAgICAgICBpZihmYW1pbHkgIT0gbnVsbCkgeworICAgICAgICAgICAgc3dpdGNoKHN0eWxlKSB7CisgICAgICAgICAgICAgICAgY2FzZSBOT1JNQUw6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYW1pbHkubU5vcm1hbEZpbGVOYW1lOworICAgICAgICAgICAgICAgIGNhc2UgQk9MRDoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbWlseS5tQm9sZEZpbGVOYW1lOworICAgICAgICAgICAgICAgIGNhc2UgSVRBTElDOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFtaWx5Lm1JdGFsaWNGaWxlTmFtZTsKKyAgICAgICAgICAgICAgICBjYXNlIEJPTERfSVRBTElDOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFtaWx5Lm1Cb2xkSXRhbGljRmlsZU5hbWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8gRmFsbGJhY2sgaWYgd2UgY291bGQgbm90IGZpbmQgdGhlIGRlc2lyZWQgZmFtaWx5CisgICAgICAgIHJldHVybiAiRHJvaWRTYW5zLnR0ZiI7CisgICAgfQorCisgICAgRm9udChpbnQgaWQsIFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBzdXBlcihpZCwgcnMpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRha2VzIGEgc3BlY2lmaWMgZmlsZSBuYW1lIGFzIGFuIGFyZ3VtZW50CisgICAgICovCisgICAgc3RhdGljIHB1YmxpYyBGb250IGNyZWF0ZShSZW5kZXJTY3JpcHQgcnMsIFJlc291cmNlcyByZXMsIFN0cmluZyBmaWxlTmFtZSwgaW50IHNpemUpCisgICAgICAgIHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24geworCisgICAgICAgIHJzLnZhbGlkYXRlKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpbnQgZHBpID0gcmVzLmdldERpc3BsYXlNZXRyaWNzKCkuZGVuc2l0eURwaTsKKyAgICAgICAgICAgIGludCBmb250SWQgPSBycy5uRm9udENyZWF0ZUZyb21GaWxlKGZpbGVOYW1lLCBzaXplLCBkcGkpOworCisgICAgICAgICAgICBpZihmb250SWQgPT0gMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkZhaWxlZCBsb2FkaW5nIGEgZm9udCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRm9udCByc0ZvbnQgPSBuZXcgRm9udChmb250SWQsIHJzKTsKKworICAgICAgICAgICAgcmV0dXJuIHJzRm9udDsKKworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gSWdub3JlCisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBY2NlcHRzIG9uZSBvZiB0aGUgZm9sbG93aW5nIGZhbWlseSBuYW1lcyBhcyBhbiBhcmd1bWVudAorICAgICAqIGFuZCB3aWxsIGF0dGVtcCB0byBwcm9kdWNlIHRoZSBiZXN0IG1hdGNoIHdpdGggYSBzeXN0ZW0gZm9udAorICAgICAqICJzYW5zLXNlcmlmIiAiYXJpYWwiICJoZWx2ZXRpY2EiICJ0YWhvbWEiICJ2ZXJkYW5hIgorICAgICAqICJzZXJpZiIgInRpbWVz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YpOworICAgICAgICBjID0gKGZsb2F0KWphdmEubGFuZy5NYXRoLmNvcyhyb3QpOworICAgICAgICBzID0gKGZsb2F0KWphdmEubGFuZy5NYXRoLnNpbihyb3QpOworICAgICAgICBtTWF0WzBdID0gYzsKKyAgICAgICAgbU1hdFsxXSA9IC1zOworICAgICAgICBtTWF0WzJdID0gczsKKyAgICAgICAgbU1hdFszXSA9IGM7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbG9hZFNjYWxlKGZsb2F0IHgsIGZsb2F0IHkpIHsKKyAgICAgICAgbG9hZElkZW50aXR5KCk7CisgICAgICAgIG1NYXRbMF0gPSB4OworICAgICAgICBtTWF0WzNdID0geTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgbG9hZE11bHRpcGx5KE1hdHJpeDJmIGxocywgTWF0cml4MmYgcmhzKSB7CisgICAgICAgIGZvciAoaW50IGk9MCA7IGk8MiA7IGkrKykgeworICAgICAgICAgICAgZmxvYXQgcmkwID0gMDsKKyAgICAgICAgICAgIGZsb2F0IHJpMSA9IDA7CisgICAgICAgICAgICBmb3IgKGludCBqPTAgOyBqPDIgOyBqKyspIHsKKyAgICAgICAgICAgICAgICBmbG9hdCByaHNfaWogPSByaHMuZ2V0KGksaik7CisgICAgICAgICAgICAgICAgcmkwICs9IGxocy5nZXQoaiwwKSAqIHJoc19pajsKKyAgICAgICAgICAgICAgICByaTEgKz0gbGhzLmdldChqLDEpICogcmhzX2lqOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2V0KGksMCwgcmkwKTsKKyAgICAgICAgICAgIHNldChpLDEsIHJpMSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBtdWx0aXBseShNYXRyaXgyZiByaHMpIHsKKyAgICAgICAgTWF0cml4MmYgdG1wID0gbmV3IE1hdHJpeDJmKCk7CisgICAgICAgIHRtcC5sb2FkTXVsdGlwbHkodGhpcywgcmhzKTsKKyAgICAgICAgbG9hZCh0bXApOworICAgIH0KK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AgICAgICBmbG9hdCBjLCBzOworICAgICAgICByb3QgKj0gKGZsb2F0KShqYXZhLmxhbmcuTWF0aC5QSSAvIDE4MC4wZik7CisgICAgICAgIGMgPSAoZmxvYXQpamF2YS5sYW5nLk1hdGguY29zKHJvdCk7CisgICAgICAgIHMgPSAoZmxvYXQpamF2YS5sYW5nLk1hdGguc2luKHJvdCk7CisKKyAgICAgICAgZmxvYXQgbGVuID0gKGZsb2F0KWphdmEubGFuZy5NYXRoLnNxcnQoeCp4ICsgeSp5ICsgeip6KTsKKyAgICAgICAgaWYgKCEobGVuICE9IDEpKSB7CisgICAgICAgICAgICBmbG9hdCByZWNpcExlbiA9IDEuZiAvIGxlbjsKKyAgICAgICAgICAgIHggKj0gcmVjaXBMZW47CisgICAgICAgICAgICB5ICo9IHJlY2lwTGVuOworICAgICAgICAgICAgeiAqPSByZWNpcExlbjsKKyAgICAgICAgfQorICAgICAgICBmbG9hdCBuYyA9IDEuMGYgLSBjOworICAgICAgICBmbG9hdCB4eSA9IHggKiB5OworICAgICAgICBmbG9hdCB5eiA9IHkgKiB6OworICAgICAgICBmbG9hdCB6eCA9IHogKiB4OworICAgICAgICBmbG9hdCB4cyA9IHggKiBzOworICAgICAgICBmbG9hdCB5cyA9IHkgKiBzOworICAgICAgICBmbG9hdCB6cyA9IHogKiBzOworICAgICAgICBtTWF0WzBdID0geCp4Km5jICsgIGM7CisgICAgICAgIG1NYXRbM10gPSAgeHkqbmMgLSB6czsKKyAgICAgICAgbU1hdFs2XSA9ICB6eCpuYyArIHlzOworICAgICAgICBtTWF0WzFdID0gIHh5Km5jICsgenM7CisgICAgICAgIG1NYXRbNF0gPSB5KnkqbmMgKyAgYzsKKyAgICAgICAgbU1hdFs5XSA9ICB5eipuYyAtIHhzOworICAgICAgICBtTWF0WzJdID0gIHp4Km5jIC0geXM7CisgICAgICAgIG1NYXRbNl0gPSAgeXoqbmMgKyB4czsKKyAgICAgICAgbU1hdFs4XSA9IHoqeipuYyArICBjOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGxvYWRSb3RhdGUoZmxvYXQgcm90KSB7CisgICAgICAgIGZsb2F0IGMsIHM7CisgICAgICAgIHJvdCAqPSAoZmxvYXQpKGphdmEubGFuZy5NYXRoLlBJIC8gMTgwLjBmKTsKKyAgICAgICAgYyA9IChmbG9hdClqYXZhLmxhbmcuTWF0aC5jb3Mocm90KTsKKyAgICAgICAgcyA9IChmbG9hdClqYXZhLmxhbmcuTWF0aC5zaW4ocm90KTsKKyAgICAgICAgbU1hdFswXSA9IGM7CisgICAgICAgIG1NYXRbMV0gPSAtczsKKyAgICAgICAgbU1hdFszXSA9IHM7CisgICAgICAgIG1NYXRbNF0gPSBjOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGxvYWRTY2FsZShmbG9hdCB4LCBmbG9hdCB5KSB7CisgICAgICAgIGxvYWRJZGVudGl0eSgpOworICAgICAgICBtTWF0WzBdID0geDsKKyAgICAgICAgbU1hdFs0XSA9IHk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbG9hZFNjYWxlKGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopIHsKKyAgICAgICAgbG9hZElkZW50aXR5KCk7CisgICAgICAgIG1NYXRbMF0gPSB4OworICAgICAgICBtTWF0WzRdID0geTsKKyAgICAgICAgbU1hdFs4XSA9IHo7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbG9hZFRyYW5zbGF0ZShmbG9hdCB4LCBmbG9hdCB5KSB7CisgICAgICAgIGxvYWRJZGVudGl0eSgpOworICAgICAgICBtTWF0WzZdID0geDsKKyAgICAgICAgbU1hdFs3XSA9IHk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbG9hZE11bHRpcGx5KE1hdHJpeDNmIGxocywgTWF0cml4M2YgcmhzKSB7CisgICAgICAgIGZvciAoaW50IGk9MCA7IGk8MyA7IGkrKykgeworICAgICAgICAgICAgZmxvYXQgcmkwID0gMDsKKyAgICAgICAgICAgIGZsb2F0IHJpMSA9IDA7CisgICAgICAgICAgICBmbG9hdCByaTIgPSAwOworICAgICAgICAgICAgZm9yIChpbnQgaj0wIDsgajwzIDsgaisrKSB7CisgICAgICAgICAgICAgICAgZmxvYXQgcmhzX2lqID0gcmhzLmdldChpLGopOworICAgICAgICAgICAgICAgIHJpMCArPSBsaHMuZ2V0KGosMCkgKiByaHNfaWo7CisgICAgICAgICAgICAgICAgcmkxICs9IGxocy5nZXQoaiwxKSAqIHJoc19pajsKKyAgICAgICAgICAgICAgICByaTIgKz0gbGhzLmdldChqLDIpICogcmhzX2lqOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2V0KGksMCwgcmkwKTsKKyAgICAgICAgICAgIHNldChpLDEsIHJpMSk7CisgICAgICAgICAgICBzZXQoaSwyLCByaTIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbXVsdGlwbHkoTWF0cml4M2YgcmhzKSB7CisgICAgICAgIE1hdHJpeDNmIHRtcCA9IG5ldyBNYXRyaXgzZigpOworICAgICAgICB0bXAubG9hZE11bHRpcGx5KHRoaXMsIHJocyk7CisgICAgICAgIGxvYWQodG1wKTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgcm90YXRlKGZsb2F0IHJvdCwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgICAgICBNYXRyaXgzZiB0bXAgPSBuZXcgTWF0cml4M2YoKTsKKyAgICAgICAgdG1wLmxvYWRSb3RhdGUocm90LCB4LCB5LCB6KTsKKyAgICAgICAgbXVsdGlwbHkodG1wKTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgcm90YXRlKGZsb2F0IHJvdCkgeworICAgICAgICBNYXRyaXgzZiB0bXAgPSBuZXcgTWF0cml4M2YoKTsKKyAgICAgICAgdG1wLmxvYWRSb3RhdGUocm90KTsKKyAgICAgICAgbXVsdGlwbHkodG1wKTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgc2NhbGUoZmxvYXQgeCwgZmxvYXQgeSkgeworICAgICAgICBNYXRyaXgzZiB0bXAgPSBuZXcgTWF0cml4M2YoKTsKKyAgICAgICAgdG1wLmxvYWRTY2FsZSh4LCB5KTsKKyAgICAgICAgbXVsdGlwbHkodG1wKTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgc2NhbGUoZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgICAgICBNYXRyaXgzZiB0bXAgPSBuZXcgTWF0cml4M2YoKTsKKyAgICAgICAgdG1wLmxvYWRTY2FsZSh4LCB5LCB6KTsKKyAgICAgICAgbXVsdGlwbHkodG1wKTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgdHJhbnNsYXRlKGZsb2F0IHgsIGZsb2F0IHkpIHsKKyAgICAgICAgTWF0cml4M2YgdG1wID0gbmV3IE1hdHJpeDNmKCk7CisgICAgICAgIHRtcC5sb2FkVHJhbnNsYXRlKHgsIHkpOworICAgICAgICBtdWx0aXBseSh0bXApOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCB0cmFuc3Bvc2UoKSB7CisgICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCAyOyArK2kpIHsKKyAgICAgICAgICAgIGZvcihpbnQgaiA9IGkgKyAxOyBqIDwgMzsgKytqKSB7CisgICAgICAgICAgICAgICAgZmxvYXQgdGVtcCA9IG1NYXRbaSozICsgal07CisgICAgICAgICAgICAgICAgbU1hdFtpKjMgKyBqXSA9IG1NYXRbaiozICsgaV07CisgICAgICAgICAgICAgICAgbU1hdFtqKjMgKyBpXSA9IHRlbXA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKICAgICBmaW5hbCBmbG9hdFtdIG1NYXQ7CiB9CiAKZGlmZiAtLWdpdCBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvTWF0cml4NGYuamF2YSBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvTWF0cml4NGYuamF2YQppbmRleCBlYmQ1YmRlLi41ZmZjMjFhIDEwMDY0NAotLS0gYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvcmVuZGVyc2NyaXB0L01hdHJpeDRmLmphdmEKKysrIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9NYXRyaXg0Zi5qYXZhCkBAIC0xNzksNiArMTc5LDg1IEBACiAgICAgICAgIHRtcC5sb2FkVHJhbnNsYXRlKHgsIHksIHopOwogICAgICAgICBtdWx0aXBseSh0bXApOwogICAgIH0KKyAgICBwcml2YXRlIGZsb2F0IGNvbXB1dGVDb2ZhY3RvcihpbnQgaSwgaW50IGopIHsKKyAgICAgICAgaW50IGMwID0gKGkrMSkgJSA0OworICAgICAgICBpbnQgYzEgPSAoaSsyKSAlIDQ7CisgICAgICAgIGludCBjMiA9IChpKzMpICUgNDsKKyAgICAgICAgaW50IHIwID0gKGorMSkgJSA0OworICAgICAgICBpbnQgcjEgPSAoaisyKSAlIDQ7CisgICAgICAgIGludCByMiA9IChqKzMpICUgNDsKKworICAgICAgICBmbG9hdCBtaW5vciA9IChtTWF0W2MwICsgNCpyMF0gKiAobU1hdFtjMSArIDQqcjFdICogbU1hdFtjMiArIDQqcjJdIC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1hdFtjMSArIDQqcjJdICogbU1hdFtjMiArIDQqcjFdKSkKKyAgICAgICAgICAgICAgICAgICAgIC0gKG1NYXRbYzAgKyA0KnIxXSAqIChtTWF0W2MxICsgNCpyMF0gKiBtTWF0W2MyICsgNCpyMl0gLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWF0W2MxICsgNCpyMl0gKiBtTWF0W2MyICsgNCpyMF0pKQorICAgICAgICAgICAgICAgICAgICAgKyAobU1hdFtjMCArIDQqcjJdICogKG1NYXRbYzEgKyA0KnIwXSAqIG1NYXRbYzIgKyA0KnIxXSAtCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NYXRbYzEgKyA0KnIxXSAqIG1NYXRbYzIgKyA0KnIwXSkpOworCisgICAgICAgIGZsb2F0IGNvZmFjdG9yID0gKChpK2opICYgMSkgIT0gMCA/IC1taW5vciA6IG1pbm9yOworICAgICAgICByZXR1cm4gY29mYWN0b3I7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaW52ZXJzZSgpIHsKKworICAgICAgICBNYXRyaXg0ZiByZXN1bHQgPSBuZXcgTWF0cml4NGYoKTsKKworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDQ7ICsraSkgeworICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCA0OyArK2opIHsKKyAgICAgICAgICAgICAgICByZXN1bHQubU1hdFs0KmkgKyBqXSA9IGNvbXB1dGVDb2ZhY3RvcihpLCBqKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIERvdCBwcm9kdWN0IG9mIDB0aCBjb2x1bW4gb2Ygc291cmNlIGFuZCAwdGggcm93IG9mIHJlc3VsdAorICAgICAgICBmbG9hdCBkZXQgPSBtTWF0WzBdKnJlc3VsdC5tTWF0WzBdICsgbU1hdFs0XSpyZXN1bHQubU1hdFsxXSArCisgICAgICAgICAgICAgICAgICAgICBtTWF0WzhdKnJlc3VsdC5tTWF0WzJdICsgbU1hdFsxMl0qcmVzdWx0Lm1NYXRbM107CisKKyAgICAgICAgaWYgKE1hdGguYWJzKGRldCkgPCAxZS02KSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBkZXQgPSAxLjBmIC8gZGV0OworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDE2OyArK2kpIHsKKyAgICAgICAgICAgIG1NYXRbaV0gPSByZXN1bHQubU1hdFtpXSAqIGRldDsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGludmVyc2VUcmFuc3Bvc2UoKSB7CisKKyAgICAgICAgTWF0cml4NGYgcmVzdWx0ID0gbmV3IE1hdHJpeDRmKCk7CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCA0OyArK2kpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgNDsgKytqKSB7CisgICAgICAgICAgICAgICAgcmVzdWx0Lm1NYXRbNCpqICsgaV0gPSBjb21wdXRlQ29mYWN0b3IoaSwgaik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCBkZXQgPSBtTWF0WzBdKnJlc3VsdC5tTWF0WzBdICsgbU1hdFs0XSpyZXN1bHQubU1hdFs0XSArCisgICAgICAgICAgICAgICAgICAgICBtTWF0WzhdKnJlc3VsdC5tTWF0WzhdICsgbU1hdFsxMl0qcmVzdWx0Lm1NYXRbMTJdOworCisgICAgICAgIGlmIChNYXRoLmFicyhkZXQpIDwgMWUtNikgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZGV0ID0gMS4wZiAvIGRldDsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAxNjsgKytpKSB7CisgICAgICAgICAgICBtTWF0W2ldID0gcmVzdWx0Lm1NYXRbaV0gKiBkZXQ7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0cmFuc3Bvc2UoKSB7CisgICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCAzOyArK2kpIHsKKyAgICAgICAgICAgIGZvcihpbnQgaiA9IGkgKyAxOyBqIDwgNDsgKytqKSB7CisgICAgICAgICAgICAgICAgZmxvYXQgdGVtcCA9IG1NYXRbaSo0ICsgal07CisgICAgICAgICAgICAgICAgbU1hdFtpKjQgKyBqXSA9IG1NYXRbaio0ICsgaV07CisgICAgICAgICAgICAgICAgbU1hdFtqKjQg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gICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUluZGV4QnVmZmVycy5sZW5ndGg7CisgICAgfQorICAgIHB1YmxpYyBBbGxvY2F0aW9uIGdldEluZGV4QWxsb2NhdGlvbihpbnQgc2xvdCkgeworICAgICAgICByZXR1cm4gbUluZGV4QnVmZmVyc1tzbG90XTsKKyAgICB9CisgICAgcHVibGljIFByaW1pdGl2ZSBnZXRQcmltaXRpdmUoaW50IHNsb3QpIHsKKyAgICAgICAgcmV0dXJuIG1QcmltaXRpdmVzW3Nsb3RdOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHZvaWQgdXBkYXRlRnJvbU5hdGl2ZSgpIHsKKyAgICAgICAgbU5hbWUgPSBtUlMubkdldE5hbWUobUlEKTsKKyAgICAgICAgaW50IHZ0eENvdW50ID0gbVJTLm5NZXNoR2V0VmVydGV4QnVmZmVyQ291bnQobUlEKTsKKyAgICAgICAgaW50IGlkeENvdW50ID0gbVJTLm5NZXNoR2V0SW5kZXhDb3VudChtSUQpOworCisgICAgICAgIGludFtdIHZ0eElEcyA9IG5ldyBpbnRbdnR4Q291bnRdOworICAgICAgICBpbnRbXSBpZHhJRHMgPSBuZXcgaW50W2lkeENvdW50XTsKKyAgICAgICAgaW50W10gcHJpbWl0aXZlcyA9IG5ldyBpbnRbaWR4Q291bnRdOworCisgICAgICAgIG1SUy5uTWVzaEdldFZlcnRpY2VzKG1JRCwgdnR4SURzLCB2dHhDb3VudCk7CisgICAgICAgIG1SUy5uTWVzaEdldEluZGljZXMobUlELCBpZHhJRHMsIHByaW1pdGl2ZXMsIGlkeENvdW50KTsKKworICAgICAgICBtVmVydGV4QnVmZmVycyA9IG5ldyBBbGxvY2F0aW9uW3Z0eENvdW50XTsKKyAgICAgICAgbUluZGV4QnVmZmVycyA9IG5ldyBBbGxvY2F0aW9uW2lkeENvdW50XTsKKyAgICAgICAgbVByaW1pdGl2ZXMgPSBuZXcgUHJpbWl0aXZlW2lkeENvdW50XTsKKworICAgICAgICBmb3IoaW50IGkgPSAwOyBpIDwgdnR4Q291bnQ7IGkgKyspIHsKKyAgICAgICAgICAgIGlmKHZ0eElEc1tpXSAhPSAwKSB7CisgICAgICAgICAgICAgICAgbVZlcnRleEJ1ZmZlcnNbaV0gPSBuZXcgQWxsb2NhdGlvbih2dHhJRHNbaV0sIG1SUyk7CisgICAgICAgICAgICAgICAgbVZlcnRleEJ1ZmZlcnNbaV0udXBkYXRlRnJvbU5hdGl2ZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IGlkeENvdW50OyBpICsrKSB7CisgICAgICAgICAgICBpZihpZHhJRHNbaV0gIT0gMCkgeworICAgICAgICAgICAgICAgIG1JbmRleEJ1ZmZlcnNbaV0gPSBuZXcgQWxsb2NhdGlvbihpZHhJRHNbaV0sIG1SUyk7CisgICAgICAgICAgICAgICAgbUluZGV4QnVmZmVyc1tpXS51cGRhdGVGcm9tTmF0aXZlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtUHJpbWl0aXZlc1tpXSA9IFByaW1pdGl2ZS52YWx1ZXMoKVtwcmltaXRpdmVzW2ldXTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgQnVpbGRlciB7CisgICAgICAgIFJlbmRlclNjcmlwdCBtUlM7CisKKyAgICAgICAgY2xhc3MgRW50cnkgeworICAgICAgICAgICAgVHlwZSB0OworICAgICAgICAgICAgRWxlbWVudCBlOworICAgICAgICAgICAgaW50IHNpemU7CisgICAgICAgICAgICBQcmltaXRpdmUgcHJpbTsKKyAgICAgICAgfQorCisgICAgICAgIGludCBtVmVydGV4VHlwZUNvdW50OworICAgICAgICBFbnRyeVtdIG1WZXJ0ZXhUeXBlczsKKyAgICAgICAgVmVjdG9yIG1JbmRleFR5cGVzOworCisgICAgICAgIHB1YmxpYyBCdWlsZGVyKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICAgICAgbVJTID0gcnM7CisgICAgICAgICAgICBtVmVydGV4VHlwZUNvdW50ID0gMDsKKyAgICAgICAgICAgIG1WZXJ0ZXhUeXBlcyA9IG5ldyBFbnRyeVsxNl07CisgICAgICAgICAgICBtSW5kZXhUeXBlcyA9IG5ldyBWZWN0b3IoKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBpbnQgYWRkVmVydGV4VHlwZShUeXBlIHQpIHRocm93cyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24geworICAgICAgICAgICAgaWYgKG1WZXJ0ZXhUeXBlQ291bnQgPj0gbVZlcnRleFR5cGVzLmxlbmd0aCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIk1heCB2ZXJ0ZXggdHlwZXMgZXhjZWVkZWQuIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCBhZGRlZEluZGV4ID0gbVZlcnRleFR5cGVDb3VudDsKKyAgICAgICAgICAgIG1WZXJ0ZXhUeXBlc1ttVmVydGV4VHlwZUNvdW50XSA9IG5ldyBFbnRyeSgpOworICAgICAgICAgICAgbVZlcnRleFR5cGVzW21WZXJ0ZXhUeXBlQ291bnRdLnQgPSB0OworICAgICAgICAgICAgbVZlcnRleFR5cGVzW21WZXJ0ZXhUeXBlQ291bnRdLmUgPSBudWxsOworICAgICAgICAgICAgbVZlcnRleFR5cGVDb3VudCsrOworICAgICAgICAgICAgcmV0dXJuIGFkZGVkSW5kZXg7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgaW50IGFkZFZlcnRleFR5cGUoRWxlbWVudCBlLCBpbnQgc2l6ZSkgdGhyb3dzIElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBpZiAobVZlcnRleFR5cGVDb3VudCA+PSBtVmVydGV4VHlwZXMubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiTWF4IHZlcnRleCB0eXBlcyBleGNlZWRlZC4iKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50IGFkZGVkSW5kZXggPSBtVmVydGV4VHlwZUNvdW50OworICAgICAgICAgICAgbVZlcnRleFR5cGVzW21WZXJ0ZXhUeXBlQ291bnRdID0gbmV3IEVudHJ5KCk7CisgICAgICAgICAgICBtVmVydGV4VHlwZXNbbVZlcnRleFR5cGVDb3VudF0udCA9IG51bGw7CisgICAgICAgICAgICBtVmVydGV4VHlwZXNbbVZlcnRleFR5cGVDb3VudF0uZSA9IGU7CisgICAgICAgICAgICBtVmVydGV4VHlwZXNbbVZlcnRleFR5cGVDb3VudF0uc2l6ZSA9IHNpemU7CisgICAgICAgICAgICBtVmVydGV4VHlwZUNvdW50Kys7CisgICAgICAgICAgICByZXR1cm4gYWRkZWRJbmRleDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBpbnQgYWRkSW5kZXhUeXBlKFR5cGUgdCwgUHJpbWl0aXZlIHApIHsKKyAgICAgICAgICAgIGludCBhZGRlZEluZGV4ICA9IG1JbmRleFR5cGVzLnNpemUoKTsKKyAgICAgICAgICAgIEVudHJ5IGluZGV4VHlwZSA9IG5ldyBFbnRyeSgpOworICAgICAgICAgICAgaW5kZXhUeXBlLnQgPSB0OworICAgICAgICAgICAgaW5kZXhUeXBlLmUgPSBudWxsOworICAgICAgICAgICAgaW5kZXhUeXBlLnNpemUgPSAwOworICAgICAgICAgICAgaW5kZXhUeXBlLnByaW0gPSBwOworICAgICAgICAgICAgbUluZGV4VHlwZXMuYWRkRWxlbWVudChpbmRleFR5cGUpOworICAgICAgICAgICAgcmV0dXJuIGFkZGVkSW5kZXg7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgaW50IGFkZEluZGV4VHlwZShQcmltaXRpdmUgcCkgeworICAgICAgICAgICAgaW50IGFkZGVkSW5kZXggID0gbUluZGV4VHlwZXMuc2l6ZSgpOworICAgICAgICAgICAgRW50cnkgaW5kZXhUeXBlID0gbmV3IEVudHJ5KCk7CisgICAgICAgICAgICBpbmRleFR5cGUudCA9IG51bGw7CisgICAgICAgICAgICBpbmRleFR5cGUuZSA9IG51bGw7CisgICAgICAgICAgICBpbmRleFR5cGUuc2l6ZSA9IDA7CisgICAgICAgICAgICBpbmRleFR5cGUucHJpbSA9IHA7CisgICAgICAgICAgICBtSW5kZXhUeXBlcy5hZGRFbGVtZW50KGluZGV4VHlwZSk7CisgICAgICAgICAgICByZXR1cm4gYWRkZWRJbmRleDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBpbnQgYWRkSW5kZXhUeXBlKEVsZW1lbnQgZSwgaW50IHNpemUsIFByaW1pdGl2ZSBwKSB7CisgICAgICAgICAgICBpbnQgYWRkZWRJbmRleCAgPSBtSW5kZXhUeXBlcy5zaXplKCk7CisgICAgICAgICAgICBFbnRyeSBpbmRleFR5cGUgPSBuZXcgRW50cnkoKTsKKyAgICAgICAgICAgIGluZGV4VHlwZS50ID0gbnVsbDsKKyAgICAgICAgICAgIGluZGV4VHlwZS5lID0gZTsKKyAgICAgICAgICAgIGluZGV4VHlwZS5zaXplID0gc2l6ZTsKKyAgICAgICAgICAgIGluZGV4VHlwZS5wcmltID0gcDsKKyAgICAgICAgICAgIG1JbmRleFR5cGVzLmFkZEVsZW1lbnQoaW5kZXhUeXBlKTsKKyAgICAgICAgICAgIHJldHVybiBhZGRlZEluZGV4OworICAgICAgICB9CisKKyAgICAgICAgVHlwZSBuZXdUeXBlKEVsZW1lbnQgZSwgaW50IHNpemUpIHsKKyAgICAgICAgICAgIFR5cGUuQnVpbGRlciB0YiA9IG5ldyBUeXBlLkJ1aWxkZXIobVJTLCBlKTsKKyAgICAgICAgICAgIHRiLmFkZChEaW1lbnNpb24uWCwgc2l6ZSk7CisgICAgICAgICAgICByZXR1cm4gdGIuY3JlYXRlKCk7CisgICAgICAgIH0KKworICAgICAgICBzdGF0aWMgc3luY2hyb25pemVkIE1lc2ggaW50ZXJuYWxDcmVhdGUoUmVuZGVyU2NyaXB0IHJzLCBCdWlsZGVyIGIpIHsKKworICAgICAgICAgICAgaW50IGlkID0gcnMubk1lc2hDcmVhdGUoYi5tVmVydGV4VHlwZUNvdW50LCBiLm1JbmRleFR5cGVzLnNpemUoKSk7CisgICAgICAgICAgICBNZXNoIG5ld01lc2ggPSBuZXcgTWVzaChpZCwgcnMpOworICAgICAgICAgICAgbmV3TWVzaC5tSW5kZXhCdWZmZXJzID0gbmV3IEFsbG9jYXRpb25bYi5tSW5kZXhUeXBlcy5zaXplKCldOworICAgICAgICAgICAgbmV3TWVzaC5tUHJpbWl0aXZlcyA9IG5ldyBQcmltaXRpdmVbYi5tSW5kZXhUeXBlcy5zaXplKCldOworICAgICAgICAgICAgbmV3TWVzaC5tVmVydGV4QnVmZmVycyA9IG5ldyBBbGxvY2F0aW9uW2IubVZlcnRleFR5cGVDb3VudF07CisKKyAgICAgICAgICAgIGZvcihpbnQgY3QgPSAwOyBjdCA8IGIubUluZGV4VHlwZXMuc2l6ZSgpOyBjdCArKykgeworICAgICAgICAgICAgICAgIEFsbG9jYXRpb24gYWxsb2MgPSBudWxsOworICAgICAgICAgICAgICAgIEVudHJ5IGVudHJ5ID0gKEVudHJ5KWIubUluZGV4VHlwZXMuZWxlbWVudEF0KGN0KTsKKyAgICAgICAgICAgICAgICBpZiAoZW50cnkudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGFsbG9jID0gQWxsb2NhdGlvbi5jcmVhdGVUeXBlZChycywgZW50cnkudCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYoZW50cnkuZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGFsbG9jID0gQWxsb2NhdGlvbi5jcmVhdGVTaXplZChycywgZW50cnkuZSwgZW50cnkuc2l6ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBhbGxvY0lEID0gKGFsbG9jID09IG51bGwpID8gMCA6IGFsbG9jLmdldElEKCk7CisgICAgICAgICAgICAgICAgcnMubk1lc2hCaW5kSW5kZXgoaWQsIGFsbG9jSUQsIGVudHJ5LnByaW0ubUlELCBjdCk7CisgICAgICAgICAgICAgICAgbmV3TWVzaC5tSW5kZXhCdWZmZXJzW2N0XSA9IGFsbG9jOworICAgICAgICAgICAgICAgIG5ld01lc2gubVByaW1pdGl2ZXNbY3RdID0gZW50cnkucHJpbTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZm9yKGludCBjdCA9IDA7IGN0IDwgYi5tVmVydGV4VHlwZUNvdW50OyBjdCArKykgeworICAgICAgICAgICAgICAgIEFsbG9jYXRpb24gYWxsb2MgPSBudWxsOworICAgICAgICAgICAgICAgIEVudHJ5IGVudHJ5ID0gYi5tVmVydGV4VHlwZXNbY3RdOworICAgICAgICAgICAgICAgIGlmIChlbnRyeS50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYWxsb2MgPSBBbGxvY2F0aW9uLmNyZWF0ZVR5cGVkKHJzLCBlbnRyeS50KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYoZW50cnkuZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGFsbG9jID0gQWxsb2NhdGlvbi5jcmVhdGVTaXplZChycywgZW50cnkuZSwgZW50cnkuc2l6ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJzLm5NZXNoQmluZFZlcnRleChpZCwgYWxsb2MuZ2V0SUQoKSwgY3QpOworICAgICAgICAgICAgICAgIG5ld01lc2gubVZlcnRleEJ1ZmZlcnNbY3RdID0gYWxsb2M7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBuZXdNZXNoOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIE1lc2ggY3JlYXRlKCkgeworICAgICAgICAgICAgbVJTLnZhbGlkYXRlKCk7CisgICAgICAgICAgICBNZXNoIHNtID0gaW50ZXJuYWxDcmVhdGUobVJTLCB0aGlzKTsKKyAgICAgICAgICAgIHJldHVybiBzbTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgQWxsb2NhdGlvbkJ1aWxkZXIgeworICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOworCisgICAgICAgIGNsYXNzIEVudHJ5IHsKKyAgICAgICAgICAgIEFsbG9jYXRpb24gYTsKKyAgICAgICAgICAgIFByaW1pdGl2ZSBwcmltOworICAgICAgICB9CisKKyAgICAgICAgaW50IG1WZXJ0ZXhUeXBlQ291bnQ7CisgICAgICAgIEVudHJ5W10gbVZlcnRleFR5cGVzOworCisgICAgICAgIFZlY3RvciBtSW5kZXhUeXBlczsKKworICAgICAgICBwdWJsaWMgQWxsb2NhdGlvbkJ1aWxkZXIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgICAgICBtUlMgPSByczsKKyAgICAgICAgICAgIG1WZXJ0ZXhUeXBlQ291bnQgPSAwOworICAgICAgICAgICAgbVZlcnRleFR5cGVzID0gbmV3IEVudHJ5WzE2XTsKKyAgICAgICAgICAgIG1JbmRleFR5cGVzID0gbmV3IFZlY3RvcigpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGludCBhZGRWZXJ0ZXhBbGxvY2F0aW9uKEFsbG9jYXRpb24gYSkgdGhyb3dzIElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBpZiAobVZlcnRleFR5cGVDb3VudCA+PSBtVmVydGV4VHlwZXMubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiTWF4IHZlcnRleCB0eXBlcyBleGNlZWRlZC4iKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50IGFkZGVkSW5kZXggPSBtVmVydGV4VHlwZUNvdW50OworICAgICAgICAgICAgbVZlcnRleFR5cGVzW21WZXJ0ZXhUeXBlQ291bnRdID0gbmV3IEVudHJ5KCk7CisgICAgICAgICAgICBtVmVydGV4VHlwZXNbbVZlcnRleFR5cGVDb3VudF0uYSA9IGE7CisgICAgICAgICAgICBtVmVydGV4VHlwZUNvdW50Kys7CisgICAgICAgICAgICByZXR1cm4gYWRkZWRJbmRleDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBpbnQgYWRkSW5kZXhBbGxvY2F0aW9uKEFsbG9jYXRpb24gYSwgUHJpbWl0aXZlIHApIHsKKyAgICAgICAgICAgIGludCBhZGRlZEluZGV4ICA9IG1JbmRleFR5cGVzLnNpemUoKTsKKyAgICAgICAgICAgIEVudHJ5IGluZGV4VHlwZSA9IG5ldyBFbnRyeSgpOworICAgICAgICAgICAgaW5kZXhUeXBlLmEgPSBhOworICAgICAgICAgICAgaW5kZXhUeXBlLnByaW0gPSBwOworICAgICAgICAgICAgbUluZGV4VHlwZXMuYWRkRWxlbWVudChpbmRleFR5cGUpOworICAgICAgICAgICAgcmV0dXJuIGFkZGVkSW5kZXg7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgaW50IGFkZEluZGV4VHlwZShQcmltaXRpdmUgcCkgeworICAgICAgICAgICAgaW50IGFkZGVkSW5kZXggID0gbUluZGV4VHlwZXMuc2l6ZSgpOworICAgICAgICAgICAgRW50cnkgaW5kZXhUeXBlID0gbmV3IEVudHJ5KCk7CisgICAgICAgICAgICBpbmRleFR5cGUuYSA9IG51bGw7CisgICAgICAgICAgICBpbmRleFR5cGUucHJpbSA9IHA7CisgICAgICAgICAgICBtSW5kZXhUeXBlcy5hZGRFbGVtZW50KGluZGV4VHlwZSk7CisgICAgICAgICAgICByZXR1cm4gYWRkZWRJbmRleDsKKyAgICAgICAgfQorCisgICAgICAgIHN0YXRpYyBzeW5jaHJvbml6ZWQgTWVzaCBpbnRlcm5hbENyZWF0ZShSZW5kZXJTY3JpcHQgcnMsIEFsbG9jYXRpb25CdWlsZGVyIGIpIHsKKworICAgICAgICAgICAgaW50IGlkID0gcnMubk1lc2hDcmVhdGUoYi5tVmVydGV4VHlwZUNvdW50LCBiLm1JbmRleFR5cGVzLnNpemUoKSk7CisgICAgICAgICAgICBNZXNoIG5ld01lc2ggPSBuZXcgTWVzaChpZCwgcnMpOworICAgICAgICAgICAgbmV3TWVzaC5tSW5kZXhCdWZmZXJzID0gbmV3IEFsbG9jYXRpb25bYi5tSW5kZXhUeXBlcy5zaXplKCldOworICAgICAgICAgICAgbmV3TWVzaC5tUHJpbWl0aXZlcyA9IG5ldyBQcmltaXRpdmVbYi5tSW5kZXhUeXBlcy5zaXplKCldOworICAgICAgICAgICAgbmV3TWVzaC5tVmVydGV4QnVmZmVycyA9IG5ldyBBbGxvY2F0aW9uW2IubVZlcnRleFR5cGVDb3VudF07CisKKyAgICAgICAgICAgIGZvcihpbnQgY3QgPSAwOyBjdCA8IGIubUluZGV4VHlwZXMuc2l6ZSgpOyBjdCArKykgeworICAgICAgICAgICAgICAgIEVudHJ5IGVudHJ5ID0gKEVudHJ5KWIubUluZGV4VHlwZXMuZWxlbWVudEF0KGN0KTsKKyAgICAgICAgICAgICAgICBpbnQgYWxsb2NJRCA9IChlbnRyeS5hID09IG51bGwpID8gMCA6IGVudHJ5LmEuZ2V0SUQoKTsKKyAgICAgICAgICAgICAgICBycy5uTWVzaEJpbmRJbmRleChpZCwgYWxsb2NJRCwgZW50cnkucHJpbS5tSUQsIGN0KTsKKyAgICAgICAgICAgICAgICBuZXdNZXNoLm1JbmRleEJ1ZmZlcnNbY3RdID0gZW50cnkuYTsKKyAgICAgICAgICAgICAgICBuZXdNZXNoLm1QcmltaXRpdmVzW2N0XSA9IGVudHJ5LnByaW07CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvcihpbnQgY3QgPSAwOyBjdCA8IGIubVZlcnRleFR5cGVDb3VudDsgY3QgKyspIHsKKyAgICAgICAgICAgICAgICBFbnRyeSBlbnRyeSA9IGIubVZlcnRleFR5cGVzW2N0XTsKKyAgICAgICAgICAgICAgICBycy5uTWVzaEJpbmRWZXJ0ZXgoaWQsIGVudHJ5LmEubUlELCBjdCk7CisgICAgICAgICAgICAgICAgbmV3TWVzaC5tVmVydGV4QnVmZmVyc1tjdF0gPSBlbnRyeS5hOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gbmV3TWVzaDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBNZXNoIGNyZWF0ZSgpIHsKKyAgICAgICAgICAgIG1SUy52YWxpZGF0ZSgpOworICAgICAgICAgICAgTWVzaCBzbSA9IGludGVybmFsQ3JlYXRlKG1SUywgdGhpcyk7CisgICAgICAgICAgICByZXR1cm4gc207CisgICAgICAgIH0KKyAgICB9CisKKworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgVHJpYW5nbGVNZXNoQnVpbGRlciB7CisgICAgICAgIGZsb2F0IG1WdHhEYXRhW107CisgICAgICAgIGludCBtVnR4Q291bnQ7CisgICAgICAgIHNob3J0IG1JbmRleERhdGFbXTsKKyAgICAgICAgaW50IG1JbmRleENvdW50OworICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOworICAgICAgICBFbGVtZW50IG1FbGVtZW50OworCisgICAgICAgIGZsb2F0IG1OWCA9IDA7CisgICAgICAgIGZsb2F0IG1OWSA9IDA7CisgICAgICAgIGZsb2F0IG1OWiA9IC0xOworICAgICAgICBmbG9hdCBtUzAgPSAwOworICAgICAgICBmbG9hdCBtVDAgPSAwOworICAgICAgICBmbG9hdCBtUiA9IDE7CisgICAgICAgIGZsb2F0IG1HID0gMTsKKyAgICAgICAgZmxvYXQgbUIgPSAxOworICAgICAgICBmbG9hdCBtQSA9IDE7CisKKyAgICAgICAgaW50IG1WdHhTaXplOworICAgICAgICBpbnQgbUZsYWdzOworCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IENPTE9SID0gMHgwMDAxOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBOT1JNQUwgPSAweDAwMDI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRFWFRVUkVfMCA9IDB4MDEwMDsKKworICAgICAgICBwdWJsaWMgVHJpYW5nbGVNZXNoQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMsIGludCB2dHhTaXplLCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgICAgIG1SUyA9IHJzOworICAgICAgICAgICAgbVZ0eENvdW50ID0gMDsKKyAgICAgICAgICAgIG1JbmRleENvdW50ID0gMDsKKyAgICAgICAgICAgIG1WdHhEYXRhID0gbmV3IGZsb2F0WzEyOF07CisgICAgICAgICAgICBtSW5kZXhEYXRhID0gbmV3IHNob3J0WzEyOF07CisgICAgICAgICAgICBtVnR4U2l6ZSA9IHZ0eFNpemU7CisgICAgICAgICAgICBtRmxhZ3MgPSBmbGFnczsKKworICAgICAgICAgICAgaWYgKHZ0eFNpemUgPCAyIHx8IHZ0eFNpemUgPiAzKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVmVydGV4IHNpemUgb3V0IG9mIHJhbmdlLiIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIG1ha2VTcGFjZShpbnQgY291bnQpIHsKKyAgICAgICAgICAgIGlmICgobVZ0eENvdW50ICsgY291bnQpID49IG1WdHhEYXRhLmxlbmd0aCkgeworICAgICAgICAgICAgICAgIGZsb2F0IHRbXSA9IG5ldyBmbG9hdFttVnR4RGF0YS5sZW5ndGggKiAyXTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1WdHhEYXRhLCAwLCB0LCAwLCBtVnR4RGF0YS5sZW5ndGgpOworICAgICAgICAgICAgICAgIG1WdHhEYXRhID0gdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBsYXRjaCgpIHsKKyAgICAgICAgICAgIGlmICgobUZsYWdzICYgQ09MT1IpICE9IDApIHsKKyAgICAgICAgICAgICAgICBtYWtlU3BhY2UoNCk7CisgICAgICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gbVI7CisgICAgICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gbUc7CisgICAgICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gbUI7CisgICAgICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gbUE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoKG1GbGFncyAmIFRFWFRVUkVfMCkgIT0gMCkgeworICAgICAgICAgICAgICAgIG1ha2VTcGFjZSgyKTsKKyAgICAgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBtUzA7CisgICAgICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gbVQwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKChtRmxhZ3MgJiBOT1JNQUwpICE9IDApIHsKKyAgICAgICAgICAgICAgICBtYWtlU3BhY2UoMyk7CisgICAgICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gbU5YOworICAgICAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IG1OWTsKKyAgICAgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBtTlo7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBhZGRWZXJ0ZXgoZmxvYXQgeCwgZmxvYXQgeSkgeworICAgICAgICAgICAgaWYgKG1WdHhTaXplICE9IDIpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJhZGQgbWlzdG1hdGNoIHdpdGggZGVjbGFyZWQgY29tcG9uZW50cy4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1ha2VTcGFjZSgyKTsKKyAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHg7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSB5OworICAgICAgICAgICAgbGF0Y2goKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZFZlcnRleChmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCB6KSB7CisgICAgICAgICAgICBpZiAobVZ0eFNpemUgIT0gMykgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImFkZCBtaXN0bWF0Y2ggd2l0aCBkZWNsYXJlZCBjb21wb25lbnRzLiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbWFrZVNwYWNlKDMpOworICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0geDsKKyAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHk7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSB6OworICAgICAgICAgICAgbGF0Y2goKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFRleHR1cmUoZmxvYXQgcywgZmxvYXQgdCkgeworICAgICAgICAgICAgaWYgKChtRmxhZ3MgJiBURVhUVVJFXzApID09IDApIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJhZGQgbWlzdG1hdGNoIHdpdGggZGVjbGFyZWQgY29tcG9uZW50cy4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1TMCA9IHM7CisgICAgICAgICAgICBtVDAgPSB0OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0Tm9ybWFsKGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopIHsKKyAgICAgICAgICAgIGlmICgobUZsYWdzICYgTk9STUFMKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiYWRkIG1pc3RtYXRjaCB3aXRoIGRlY2xhcmVkIGNvbXBvbmVudHMuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTlggPSB4OworICAgICAgICAgICAgbU5ZID0geTsKKyAgICAgICAgICAgIG1OWiA9IHo7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRDb2xvcihmbG9hdCByLCBmbG9hdCBnLCBmbG9hdCBiLCBmbG9hdCBhKSB7CisgICAgICAgICAgICBpZiAoKG1GbGFncyAmIENPTE9SKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiYWRkIG1pc3RtYXRjaCB3aXRoIGRlY2xhcmVkIGNvbXBvbmVudHMuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtUiA9IHI7CisgICAgICAgICAgICBtRyA9IGc7CisgICAgICAgICAgICBtQiA9IGI7CisgICAgICAgICAgICBtQSA9IGE7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBhZGRUcmlhbmdsZShpbnQgaWR4MSwgaW50IGlkeDIsIGludCBpZHgzKSB7CisgICAgICAgICAgICBpZigoaWR4MSA+PSBtVnR4Q291bnQpIHx8IChpZHgxIDwgMCkgfHwKKyAgICAgICAgICAgICAgIChpZHgyID49IG1WdHhDb3VudCkgfHwgKGlkeDIgPCAwKSB8fAorICAgICAgICAgICAgICAgKGlkeDMgPj0gbVZ0eENvdW50KSB8fCAoaWR4MyA8IDApKSB7CisgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJJbmRleCBwcm92aWRlZCBncmVhdGVyIHRoYW4gdmVydGV4IGNvdW50LiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKChtSW5kZXhDb3VudCArIDMpID49IG1JbmRleERhdGEubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgc2hvcnQgdFtdID0gbmV3IHNob3J0W21JbmRleERhdGEubGVuZ3RoICogMl07CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtSW5kZXhEYXRhLCAwLCB0LCAwLCBtSW5kZXhEYXRhLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgbUluZGV4RGF0YSA9IHQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtSW5kZXhEYXRhW21JbmRleENvdW50KytdID0gKHNob3J0KWlkeDE7CisgICAgICAgICAgICBtSW5kZXhEYXRhW21JbmRleENvdW50KytdID0gKHNob3J0KWlkeDI7CisgICAgICAgICAgICBtSW5kZXhEYXRhW21JbmRleENvdW50KytdID0gKHNob3J0KWlkeDM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgTWVzaCBjcmVhdGUoYm9vbGVhbiB1cGxvYWRUb0J1ZmZlck9iamVjdCkgeworICAgICAgICAgICAgRWxlbWVudC5CdWlsZGVyIGIgPSBuZXcgRWxlbWVudC5CdWlsZGVyKG1SUyk7CisgICAgICAgICAgICBpbnQgZmxvYXRDb3VudCA9IG1WdHhTaXplOworICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5jcmVhdGVWZWN0b3IobVJTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlbWVudC5EYXRhVHlwZS5GTE9BVF8zMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1WdHhTaXplKSwgInBvc2l0aW9uIik7CisgICAgICAgICAgICBpZiAoKG1GbGFncyAmIENPTE9SKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgZmxvYXRDb3VudCArPSA0OworICAgICAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuRjMyXzQobVJTKSwgImNvbG9yIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoKG1GbGFncyAmIFRFWFRVUkVfMCkgIT0gMCkgeworICAgICAgICAgICAgICAgIGZsb2F0Q291bnQgKz0gMjsKKyAgICAgICAgICAgICAgICBiLmFkZChFbGVtZW50LkYzMl8yKG1SUyksICJ0ZXh0dXJlMCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKChtRmxhZ3MgJiBOT1JNQUwpICE9IDApIHsKKyAgICAgICAgICAgICAgICBmbG9hdENvdW50ICs9IDM7CisgICAgICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5GMzJfMyhtUlMpLCAibm9ybWFsIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRWxlbWVudCA9IGIuY3JlYXRlKCk7CisKKyAgICAgICAgICAgIEJ1aWxkZXIgc21iID0gbmV3IEJ1aWxkZXIobVJTKTsKKyAgICAgICAgICAgIHNtYi5hZGRWZXJ0ZXhUeXBlKG1FbGVtZW50LCBtVnR4Q291bnQgLyBmbG9hdENvdW50KTsKKyAgICAgICAgICAgIHNtYi5hZGRJbmRleFR5cGUoRWxlbWVudC5VMTYobVJTKSwgbUluZGV4Q291bnQsIFByaW1pdGl2ZS5UUklBTkdMRSk7CisKKyAgICAgICAgICAgIE1lc2ggc20gPSBzbWIuY3JlYXRlKCk7CisKKyAgICAgICAgICAgIHNtLmdldFZlcnRleEFsbG9jYXRpb24oMCkuZGF0YShtVnR4RGF0YSk7CisgICAgICAgICAgICBpZih1cGxvYWRUb0J1ZmZlck9iamVjdCkgeworICAgICAgICAgICAgICAgIHNtLmdldFZlcnRleEFsbG9jYXRpb24oMCkudXBsb2FkVG9CdWZmZXJPYmplY3QoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc20uZ2V0SW5kZXhBbGxvY2F0aW9uKDApLmRhdGEobUluZGV4RGF0YSk7CisgICAgICAgICAgICBzbS5nZXRJbmRleEFsbG9jYXRpb24oMCkudXBsb2FkVG9CdWZmZXJPYmplY3QoKTsKKworICAgICAgICAgICAgcm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IHB1YmxpYyB2b2lkIHNldFNoYWRlcihTdHJpbmcgcykgeworICAgICAgICBwdWJsaWMgQmFzZVByb2dyYW1CdWlsZGVyIHNldFNoYWRlcihTdHJpbmcgcykgewogICAgICAgICAgICAgbVNoYWRlciA9IHM7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBCYXNlUHJvZ3JhbUJ1aWxkZXIgc2V0U2hhZGVyKFJlc291cmNlcyByZXNvdXJjZXMsIGludCByZXNvdXJjZUlEKSB7CisgICAgICAgICAgICBieXRlW10gc3RyOworICAgICAgICAgICAgaW50IHN0ckxlbmd0aDsKKyAgICAgICAgICAgIElucHV0U3RyZWFtIGlzID0gcmVzb3VyY2VzLm9wZW5SYXdSZXNvdXJjZShyZXNvdXJjZUlEKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgc3RyID0gbmV3IGJ5dGVbMTAyNF07CisgICAgICAgICAgICAgICAgICAgIHN0ckxlbmd0aCA9IDA7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlKHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBieXRlc0xlZnQgPSBzdHIubGVuZ3RoIC0gc3RyTGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJ5dGVzTGVmdCA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZVtdIGJ1ZjIgPSBuZXcgYnl0ZVtzdHIubGVuZ3RoICogMl07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShzdHIsIDAsIGJ1ZjIsIDAsIHN0ci5sZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ciA9IGJ1ZjI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZXNMZWZ0ID0gc3RyLmxlbmd0aCAtIHN0ckxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBieXRlc1JlYWQgPSBpcy5yZWFkKHN0ciwgc3RyTGVuZ3RoLCBieXRlc0xlZnQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJ5dGVzUmVhZCA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJMZW5ndGggKz0gYnl0ZXNSZWFkOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgaXMuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUmVzb3VyY2VzLk5vdEZvdW5kRXhjZXB0aW9uKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbVNoYWRlciA9IG5ldyBTdHJpbmcoc3RyLCAwLCBzdHJMZW5ndGgsICJVVEYtOCIpOworICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoIlJlbmRlcnNjcmlwdCBzaGFkZXIgY3JlYXRpb24iLCAiQ291bGQgbm90IGRlY29kZSBzaGFkZXIgc3RyaW5nIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIHZvaWQgYWRkSW5wdXQoRWxlbWVudCBlKSB0aHJvd3MgSWxsZWdhbFN0YXRlRXhjZXB0aW9uIHsKQEAgLTExMSw2ICsxNTQsMTMgQEAKICAgICAgICAgICAgIG1PdXRwdXRzW21PdXRwdXRDb3VudCsrXSA9IGU7CiAgICAgICAgIH0KIAorICAgICAgICB2b2lkIHJlc2V0Q29uc3RhbnQoKSB7CisgICAgICAgICAgICBtQ29uc3RhbnRDb3VudCA9IDA7CisgICAgICAgICAgICBmb3IoaW50IGkgPSAwOyBpIDwgTUFYX0NPTlNUQU5UOyBpICsrKSB7CisgICAgICAgICAgICAgICAgbUNvbnN0YW50c1tpXSA9IG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKwogICAgICAgICBwdWJsaWMgaW50IGFkZENvbnN0YW50KFR5cGUgdCkgdGhyb3dzIElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiB7CiAgICAgICAgICAgICAvLyBTaG91bGQgY2hlY2sgZm9yIGNvbnNpc3RhbnQgYW5kIG5vbi1jb25mbGljdGluZyBuYW1lcy4uLgogICAgICAgICAgICAgaWYobUNvbnN0YW50Q291bnQgPj0gTUFYX0NPTlNUQU5UKSB7CkBAIC0xMjAsMTIgKzE3MCwxMyBAQAogICAgICAgICAgICAgcmV0dXJuIG1Db25zdGFudENvdW50Kys7CiAgICAgICAgIH0KIAotICAgICAgICBwdWJsaWMgdm9pZCBzZXRUZXh0dXJlQ291bnQoaW50IGNvdW50KSB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKKyAgICAgICAgcHVibGljIEJhc2VQcm9ncmFtQnVpbGRlciBzZXRUZXh0dXJlQ291bnQoaW50IGNvdW50KSB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKICAgICAgICAgICAgIC8vIFNob3VsZCBjaGVjayBmb3IgY29uc2lzdGFudCBhbmQgbm9uLWNvbmZsaWN0aW5nIG5hbWVzLi4uCi0gICAgICAgICAgICBpZihjb3VudCA+PSBNQVhfQ09OU1RBTlQpIHsKKyAgICAgICAgICAgIGlmKGNvdW50ID49IE1BWF9URVhUVVJFKSB7CiAgICAgICAgICAgICAgICAgdGhyb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ICAgICB9CiAKLSAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgeworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgQnVpbGRlciBleHRlbmRzIFNoYWRlckJ1aWxkZXIgewogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBNQVhfVEVYVFVSRSA9IDI7Ci0gICAgICAgIFJlbmRlclNjcmlwdCBtUlM7CisgICAgICAgIGludCBtTnVtVGV4dHVyZXM7CiAgICAgICAgIGJvb2xlYW4gbVBvaW50U3ByaXRlRW5hYmxlOworICAgICAgICBib29sZWFuIG1WYXJ5aW5nQ29sb3JFbmFibGU7CiAKICAgICAgICAgcHVibGljIGVudW0gRW52TW9kZSB7CiAgICAgICAgICAgICBSRVBMQUNFICgxKSwKQEAgLTEwMCwzOSArMTAxLDEyNiBAQAogICAgICAgICB9CiAgICAgICAgIFNsb3RbXSBtU2xvdHM7CiAKKyAgICAgICAgcHJpdmF0ZSB2b2lkIGJ1aWxkU2hhZGVyU3RyaW5nKCkgeworICAgICAgICAgICAgbVNoYWRlciAgPSAiLy9yc19zaGFkZXJfaW50ZXJuYWxcbiI7CisgICAgICAgICAgICBtU2hhZGVyICs9ICJ2YXJ5aW5nIGxvd3AgdmVjNCB2YXJDb2xvcjtcbiI7CisgICAgICAgICAgICBtU2hhZGVyICs9ICJ2YXJ5aW5nIHZlYzIgdmFyVGV4MDtcbiI7CisKKyAgICAgICAgICAgIG1TaGFkZXIgKz0gInZvaWQgbWFpbigpIHtcbiI7CisgICAgICAgICAgICBpZiAobVZhcnlpbmdDb2xvckVuYWJsZSkgeworICAgICAgICAgICAgICAgIG1TaGFkZXIgKz0gIiAgbG93cCB2ZWM0IGNvbCA9IHZhckNvbG9yO1xuIjsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVNoYWRlciArPSAiICBsb3dwIHZlYzQgY29sID0gVU5JX0NvbG9yO1xuIjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1OdW1UZXh0dXJlcyAhPSAwKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Qb2ludFNwcml0ZUVuYWJsZSkgeworICAgICAgICAgICAgICAgICAgICBtU2hhZGVyICs9ICIgIHZlYzIgdDAgPSBnbF9Qb2ludENvb3JkO1xuIjsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtU2hhZGVyICs9ICIgIHZlYzIgdDAgPSB2YXJUZXgwLnh5O1xuIjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBtTnVtVGV4dHVyZXM7IGkgKyspIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2gobVNsb3RzW2ldLmVudikgeworICAgICAgICAgICAgICAgIGNhc2UgUkVQTEFDRToKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChtU2xvdHNbaV0uZm9ybWF0KSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgQUxQSEE6CisgICAgICAgICAgICAgICAgICAgICAgICBtU2hhZGVyICs9ICIgIGNvbC5hID0gdGV4dHVyZTJEKFVOSV9UZXgwLCB0MCkuYTtcbiI7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBMVU1JTkFOQ0VfQUxQSEE6CisgICAgICAgICAgICAgICAgICAgICAgICBtU2hhZGVyICs9ICIgIGNvbC5yZ2JhID0gdGV4dHVyZTJEKFVOSV9UZXgwLCB0MCkucmdiYTtcbiI7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBSR0I6CisgICAgICAgICAgICAgICAgICAgICAgICBtU2hhZGVyICs9ICIgIGNvbC5yZ2IgPSB0ZXh0dXJlMkQoVU5JX1RleDAsIHQwKS5yZ2I7XG4iOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgUkdCQToKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TaGFkZXIgKz0gIiAgY29sLnJnYmEgPSB0ZXh0dXJlMkQoVU5JX1RleDAsIHQwKS5yZ2JhO1xuIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgTU9EVUxBVEU6CisgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAobVNsb3RzW2ldLmZvcm1hdCkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIEFMUEhBOgorICAgICAgICAgICAgICAgICAgICAgICAgbVNoYWRlciArPSAiICBjb2wuYSAqPSB0ZXh0dXJlMkQoVU5JX1RleDAsIHQwKS5hO1xuIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIExVTUlOQU5DRV9BTFBIQToKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TaGFkZXIgKz0gIiAgY29sLnJnYmEgKj0gdGV4dHVyZTJEKFVOSV9UZXgwLCB0MCkucmdiYTtcbiI7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBSR0I6CisgICAgICAgICAgICAgICAgICAgICAgICBtU2hhZGVyICs9ICIgIGNvbC5yZ2IgKj0gdGV4dHVyZTJEKFVOSV9UZXgwLCB0MCkucmdiO1xuIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFJHQkE6CisgICAgICAgICAgICAgICAgICAgICAgICBtU2hhZGVyICs9ICIgIGNvbC5yZ2JhICo9IHRleHR1cmUyRChVTklfVGV4MCwgdDApLnJnYmE7XG4iOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBERUNBTDoKKyAgICAgICAgICAgICAgICAgICAgbVNoYWRlciArPSAiICBjb2wgPSB0ZXh0dXJlMkQoVU5JX1RleDAsIHQwKTtcbiI7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbVNoYWRlciArPSAiICBnbF9GcmFnQ29sb3IgPSBjb2w7XG4iOworICAgICAgICAgICAgbVNoYWRlciArPSAifVxuIjsKKyAgICAgICAgfQorCiAgICAgICAgIHB1YmxpYyBCdWlsZGVyKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICAgICAgc3VwZXIocnMpOwogICAgICAgICAgICAgbVJTID0gcnM7CiAgICAgICAgICAgICBtU2xvdHMgPSBuZXcgU2xvdFtNQVhfVEVYVFVSRV07CiAgICAgICAgICAgICBtUG9pbnRTcHJpdGVFbmFibGUgPSBmYWxzZTsKICAgICAgICAgfQogCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldFRleHR1cmUoRW52TW9kZSBlbnYsIEZvcm1hdCBmbXQsIGludCBzbG90KQorICAgICAgICBwdWJsaWMgQnVpbGRlciBzZXRUZXh0dXJlKEVudk1vZGUgZW52LCBGb3JtYXQgZm10LCBpbnQgc2xvdCkKICAgICAgICAgICAgIHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gewogICAgICAgICAgICAgaWYoKHNsb3QgPCAwKSB8fCAoc2xvdCA+PSBNQVhfVEVYVFVSRSkpIHsKICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJNQVhfVEVYVFVSRSBleGNlZWRlZC4iKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1TbG90c1tzbG90XSA9IG5ldyBTbG90KGVudiwgZm10KTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICB9CiAKLSAgICAgICAgcHVibGljIHZvaWQgc2V0UG9pbnRTcHJpdGVUZXhDb29yZGluYXRlUmVwbGFjZW1lbnQoYm9vbGVhbiBlbmFibGUpIHsKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgc2V0UG9pbnRTcHJpdGVUZXhDb29yZGluYXRlUmVwbGFjZW1lbnQoYm9vbGVhbiBlbmFibGUpIHsKICAgICAgICAgICAgIG1Qb2ludFNwcml0ZUVuYWJsZSA9IGVuYWJsZTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICB9CiAKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgc2V0VmFyeWluZ0NvbG9yKGJvb2xlYW4gZW5hYmxlKSB7CisgICAgICAgICAgICBtVmFyeWluZ0NvbG9yRW5hYmxlID0gZW5hYmxlOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIFByb2dyYW1GcmFnbWVudCBjcmVhdGUoKSB7Ci0gICAgICAgICAgICBtUlMudmFsaWRhdGUoKTsKLSAgICAgICAgICAgIGludFtdIHRtcCA9IG5ldyBpbnRbTUFYX1RFWFRVUkUgKiAyICsgMV07Ci0gICAgICAgICAgICBpZiAobVNsb3RzWzBdICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0bXBbMF0gPSBtU2xvdHNbMF0uZW52Lm1JRDsKLSAgICAgICAgICAgICAgICB0bXBbMV0gPSBtU2xvdHNbMF0uZm9ybWF0Lm1JRDsKKyAgICAgICAgICAgIG1OdW1UZXh0dXJlcyA9IDA7CisgICAgICAgICAgICBmb3IoaW50IGkgPSAwOyBpIDwgTUFYX1RFWFRVUkU7IGkgKyspIHsKKyAgICAgICAgICAgICAgICBpZihtU2xvdHNbaV0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtTnVtVGV4dHVyZXMgKys7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1TbG90c1sxXSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdG1wWzJdID0gbVNsb3RzWzFdLmVudi5tSUQ7Ci0gICAgICAgICAgICAgICAgdG1wWzNdID0gbVNsb3RzWzFdLmZvcm1hdC5tSUQ7CisgICAgICAgICAgICByZXNldENvbnN0YW50KCk7CisgICAgICAgICAgICBidWlsZFNoYWRlclN0cmluZygpOworICAgICAgICAgICAgVHlwZSBjb25zdFR5cGUgPSBudWxsOworICAgICAgICAgICAgaWYgKCFtVmFyeWluZ0NvbG9yRW5hYmxlKSB7CisgICAgICAgICAgICAgICAgRWxlbWVudC5CdWlsZGVyIGIgPSBuZXcgRWxlbWVudC5CdWlsZGVyKG1SUyk7CisgICAgICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5GMzJfNChtUlMpLCAiQ29sb3IiKTsKKyAgICAgICAgICAgICAgICBUeXBlLkJ1aWxkZXIgdHlwZUJ1aWxkZXIgPSBuZXcgVHlwZS5CdWlsZGVyKG1SUywgYi5jcmVhdGUoKSk7CisgICAgICAgICAgICAgICAgdHlwZUJ1aWxkZXIuYWRkKERpbWVuc2lvbi5YLCAxKTsKKyAgICAgICAgICAgICAgICBjb25zdFR5cGUgPSB0eXBlQnVpbGRlci5jcmVhdGUoKTsKKyAgICAgICAgICAgICAgICBhZGRDb25zdGFudChjb25zdFR5cGUpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgdG1wWzRdID0gbVBvaW50U3ByaXRlRW5hYmxlID8gMSA6IDA7Ci0gICAgICAgICAgICBpbnQgaWQgPSBtUlMublByb2dyYW1GcmFnbWVudENyZWF0ZSh0bXApOwotICAgICAgICAgICAgUHJvZ3JhbUZyYWdtZW50IHBmID0gbmV3IFByb2dyYW1GcmFnbWVudChpZCwgbVJTKTsKKyAgICAgICAgICAgIHNldFRleHR1cmVDb3VudChtTnVtVGV4dHVyZXMpOworCisgICAgICAgIC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DdWxsTW9kZSB7CisgICAgICAgIEJBQ0sgKDApLAorICAgICAgICBGUk9OVCAoMSksCisgICAgICAgIE5PTkUgKDIpOworCisgICAgICAgIGludCBtSUQ7CisgICAgICAgIEN1bGxNb2RlKGludCBpZCkgeworICAgICAgICAgICAgbUlEID0gaWQ7CisgICAgICAgIH0KKyAgICB9CisKICAgICBib29sZWFuIG1Qb2ludFNtb290aDsKICAgICBib29sZWFuIG1MaW5lU21vb3RoOwogICAgIGJvb2xlYW4gbVBvaW50U3ByaXRlOwotICAgIGZsb2F0IG1Qb2ludFNpemU7CiAgICAgZmxvYXQgbUxpbmVXaWR0aDsKLSAgICBFbGVtZW50IG1JbjsKLSAgICBFbGVtZW50IG1PdXQ7CisgICAgQ3VsbE1vZGUgbUN1bGxNb2RlOwogCiAgICAgUHJvZ3JhbVJhc3RlcihpbnQgaWQsIFJlbmRlclNjcmlwdCBycykgewotICAgICAgICBzdXBlcihycyk7Ci0gICAgICAgIG1JRCA9IGlkOworICAgICAgICBzdXBlcihpZCwgcnMpOwogCi0gICAgICAgIG1Qb2ludFNpemUgPSAxLjBmOwogICAgICAgICBtTGluZVdpZHRoID0gMS4wZjsKICAgICAgICAgbVBvaW50U21vb3RoID0gZmFsc2U7CiAgICAgICAgIG1MaW5lU21vb3RoID0gZmFsc2U7CiAgICAgICAgIG1Qb2ludFNwcml0ZSA9IGZhbHNlOworCisgICAgICAgIG1DdWxsTW9kZSA9IEN1bGxNb2RlLkJBQ0s7CiAgICAgfQogCi0gICAgcHVibGljIHZvaWQgc2V0TGluZVdpZHRoKGZsb2F0IHcpIHsKKyAgICB2b2lkIHNldExpbmVXaWR0aChmbG9hdCB3KSB7CiAgICAgICAgIG1SUy52YWxpZGF0ZSgpOwogICAgICAgICBtTGluZVdpZHRoID0gdzsKICAgICAgICAgbVJTLm5Qcm9ncmFtUmFzdGVyU2V0TGluZVdpZHRoKG1JRCwgdyk7CiAgICAgfQogCi0gICAgcHVibGljIHZvaWQgc2V0UG9pb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IgewogICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOwotICAgICAgICBQcm9ncmFtUmFzdGVyIG1QUjsKKyAgICAgICAgYm9vbGVhbiBtUG9pbnRTcHJpdGU7CisgICAgICAgIGJvb2xlYW4gbVBvaW50U21vb3RoOworICAgICAgICBib29sZWFuIG1MaW5lU21vb3RoOworICAgICAgICBDdWxsTW9kZSBtQ3VsbE1vZGU7CiAKLSAgICAgICAgcHVibGljIEJ1aWxkZXIoUmVuZGVyU2NyaXB0IHJzLCBFbGVtZW50IGluLCBFbGVtZW50IG91dCkgeworICAgICAgICBwdWJsaWMgQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMpIHsKICAgICAgICAgICAgIG1SUyA9IHJzOwotICAgICAgICAgICAgbVBSID0gbmV3IFByb2dyYW1SYXN0ZXIoMCwgcnMpOworICAgICAgICAgICAgbVBvaW50U21vb3RoID0gZmFsc2U7CisgICAgICAgICAgICBtTGluZVNtb290aCA9IGZhbHNlOworICAgICAgICAgICAgbVBvaW50U3ByaXRlID0gZmFsc2U7CisgICAgICAgICAgICBtQ3VsbE1vZGUgPSBDdWxsTW9kZS5CQUNLOwogICAgICAgICB9CiAKLSAgICAgICAgcHVibGljIHZvaWQgc2V0UG9pbnRTcHJpdGVFbmFibGUoYm9vbGVhbiBlbmFibGUpIHsKLSAgICAgICAgICAgIG1QUi5tUG9pbnRTcHJpdGUgPSBlbmFibGU7CisgICAgICAgIHB1YmxpYyBCdWlsZGVyIHNldFBvaW50U3ByaXRlRW5hYmxlKGJvb2xlYW4gZW5hYmxlKSB7CisgICAgICAgICAgICBtUG9pbnRTcHJpdGUgPSBlbmFibGU7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKICAgICAgICAgfQogCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldFBvaW50U21vb3RoRW5hYmxlKGJvb2xlYW4gZW5hYmxlKSB7Ci0gICAgICAgICAgICBtUFIubVBvaW50U21vb3RoID0gZW5hYmxlOworICAgICAgICBwdWJsaWMgQnVpbGRlciBzZXRQb2ludFNtb290aEVuYWJsZShib29sZWFuIGVuYWJsZSkgeworICAgICAgICAgICAgbVBvaW50U21vb3RoID0gZW5hYmxlOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgIH0KIAotICAgICAgICBwdWJsaWMgdm9pZCBzZXRMaW5lU21vb3RoRW5hYmxlKGJvb2xlYW4gZW5hYmxlKSB7Ci0gICAgICAgICAgICBtUFIubUxpbmVTbW9vdGggPSBlbmFibGU7CisgICAgICAgIHB1YmxpYyBCdWlsZGVyIHNldExpbmVTbW9vdGhFbmFibGUoYm9vbGVhbiBlbmFibGUpIHsKKyAgICAgICAgICAgIG1MaW5lU21vb3RoID0gZW5hYmxlOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgIH0KIAorICAgICAgICBwdWJsaWMgQnVpbGRlciBzZXRDdWxsTW9kZShDdWxsTW9kZSBtKSB7CisgICAgICAgICAgICBtQ3VsbE1vZGUgPSBtOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KIAogICAgICAgICBzdGF0aWMgc3luY2hyb25pemVkIFByb2dyYW1SYXN0ZXIgaW50ZXJuYWxDcmVhdGUoUmVuZGVyU2NyaXB0IHJzLCBCdWlsZGVyIGIpIHsKLSAgICAgICAgICAgIGIubVBSLmludGVybmFsSW5pdCgpOwotICAgICAgICAgICAgUHJvZ3JhbVJhc3RlciBwciA9IGIubVBSOwotICAgICAgICAgICAgYi5tUFIgPSBuZXcgUHJvZ3JhbVJhc3RlcigwLCBiLm1SUyk7CisgICAgICAgICAgICBpbnQgaWQgPSBycy5uUHJvZ3JhbVJhc3RlckNyZWF0ZShiLm1Qb2ludFNtb290aCwgYi5tTGluZVNtb290aCwgYi5tUG9pbnRTcHJpdGUpOworICAgICAgICAgICAgUHJvZ3JhbVJhc3RlciBwciA9IG5ldyBQcm9ncmFtUmFzdGVyKGlkLCBycyk7CisgICAgICAgICAgICBwci5zZXRD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ICAgICBidWlsZGVyLnNldERlcHRoRnVuYyhQcm9ncmFtU3RvcmUuRGVwdGhGdW5jLkxFU1MpOworICAgICAgICAgICAgYnVpbGRlci5zZXRCbGVuZEZ1bmMoQmxlbmRTcmNGdW5jLk9ORSwgQmxlbmREc3RGdW5jLlpFUk8pOworICAgICAgICAgICAgYnVpbGRlci5zZXREaXRoZXJFbmFibGUoZmFsc2UpOworICAgICAgICAgICAgYnVpbGRlci5zZXREZXB0aE1hc2soZmFsc2UpOworICAgICAgICAgICAgcnMubVByb2dyYW1TdG9yZV9CTEVORF9OT05FX0RFUFRIX05PX1dSSVRFID0gYnVpbGRlci5jcmVhdGUoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubVByb2dyYW1TdG9yZV9CTEVORF9OT05FX0RFUFRIX05PX1dSSVRFOworICAgIH0KIAorICAgIHB1YmxpYyBzdGF0aWMgUHJvZ3JhbVN0b3JlIEJMRU5EX0FMUEhBX0RFUFRIX1RFU1QoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1Qcm9ncmFtU3RvcmVfQkxFTkRfQUxQSEFfREVQVEhfVEVTVCA9PSBudWxsKSB7CisgICAgICAgICAgICBQcm9ncmFtU3RvcmUuQnVpbGRlciBidWlsZGVyID0gbmV3IFByb2dyYW1TdG9yZS5CdWlsZGVyKHJzKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuc2V0RGVwdGhGdW5jKFByb2dyYW1TdG9yZS5EZXB0aEZ1bmMuTEVTUyk7CisgICAgICAgICAgICBidWlsZGVyLnNldEJsZW5kRnVuYyhCbGVuZFNyY0Z1bmMuU1JDX0FMUEhBLCBCbGVuZERzdEZ1bmMuT05FX01JTlVTX1NSQ19BTFBIQSk7CisgICAgICAgICAgICBidWlsZGVyLnNldERpdGhlckVuYWJsZShmYWxzZSk7CisgICAgICAgICAgICBidWlsZGVyLnNldERlcHRoTWFzayh0cnVlKTsKKyAgICAgICAgICAgIHJzLm1Qcm9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ICAgICAgfQorICAgICAgICByZXR1cm4gcnMubVByb2dyYW1TdG9yZV9CTEVORF9BRERfREVQVEhfVEVTVDsKKyAgICB9CisgICAgcHVibGljIHN0YXRpYyBQcm9ncmFtU3RvcmUgQkxFTkRfQUREX0RFUFRIX05PX0RFUFRIKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tUHJvZ3JhbVN0b3JlX0JMRU5EX0FERF9ERVBUSF9OT19ERVBUSCA9PSBudWxsKSB7CisgICAgICAgICAgICBQcm9ncmFtU3RvcmUuQnVpbGRlciBidWlsZGVyID0gbmV3IFByb2dyYW1TdG9yZS5CdWlsZGVyKHJzKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuc2V0RGVwdGhGdW5jKFByb2dyYW1TdG9yZS5EZXB0aEZ1bmMuQUxXQVlTKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuc2V0QmxlbmRGdW5jKEJsZW5kU3JjRnVuYy5PTkUsIEJsZW5kRHN0RnVuYy5PTkUpOworICAgICAgICAgICAgYnVpbGRlci5zZXREaXRoZXJFbmFibGUoZmFsc2UpOworICAgICAgICAgICAgYnVpbGRlci5zZXREZXB0aE1hc2soZmFsc2UpOworICAgICAgICAgICAgcnMubVByb2dyYW1TdG9yZV9CTEVORF9BRERfREVQVEhfTk9fREVQVEggPSBidWlsZGVyLmNyZWF0ZSgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tUHJvZ3JhbVN0b3JlX0JMRU5EX0FERF9ERVBUSF9OT19ERVBUSDsKKyAgICB9CisgICAgcHVibGljIHN0YXRpYyBQcm9ncmFtU3RvcmUgQkxFTkRfQUREX0RFUFRIX05PX1RFU1QoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1Qcm9ncmFtU3RvcmVfQkxFTkRfQUREX0RFUFRIX05PX1RFU1QgPT0gbnVsbCkgeworICAgICAgICAgICAgUHJvZ3JhbVN0b3JlLkJ1aWxkZXIgYnVpbGRlciA9IG5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gICAgICAgICAgICBycy5tUHJvZ3JhbVN0b3JlX0JMRU5EX0FERF9ERVBUSF9OT19XUklURSA9IGJ1aWxkZXIuY3JlYXRlKCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1Qcm9ncmFtU3RvcmVfQkxFTkRfQUREX0RFUFRIX05PX1dSSVRFOworICAgIH0KIAogICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgQnVpbGRlciB7CiAgICAgICAgIFJlbmRlclNjcmlwdCBtUlM7CkBAIC0xMTAsMzIgKzI0Miw0OSBAQAogICAgICAgICAgICAgbUNvbG9yTWFza0EgPSB0cnVlOwogICAgICAgICAgICAgbUJsZW5kU3JjID0gQmxlbmRTcmNGdW5jLk9ORTsKICAgICAgICAgICAgIG1CbGVuZERzdCA9IEJsZW5kRHN0RnVuYy5aRVJPOwotCi0KICAgICAgICAgfQogCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldERlcHRoRnVuYyhEZXB0aEZ1bmMgZnVuYykgeworICAgICAgICBwdWJsaWMgQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgICAgIG1SUyA9IHJzOworICAgICAgICAgICAgbUluID0gbnVsbDsKKyAgICAgICAgICAgIG1PdXQgPSBudWxsOworICAgICAgICAgICAgbURlcHRoRnVuYyA9IERlcHRoRnVuYy5BTFdBWVM7CisgICAgICAgICAgICBtRGVwdGhNYXNrID0gZmFsc2U7CisgICAgICAgICAgICBtQ29sb3JNYXNrUiA9IHRydWU7CisgICAgICAgICAgICBtQ29sb3JNYXNrRyA9IHRydWU7CisgICAgICAgICAgICBtQ29sb3JNYXNrQiA9IHRydWU7CisgICAgICAgICAgICBtQ29sb3JNYXNrQSA9IHRydWU7CisgICAgICAgICAgICBtQmxlbmRTcmMgPSBCbGVuZFNyY0Z1bmMuT05FOworICAgICAgICAgICAgbUJsZW5kRHN0ID0gQmxlbmREc3RGdW5jLlpFUk87CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQnVpbGRlciBzZXREZXB0aEZ1bmMoRGVwdGhGdW5jIGZ1bmMpIHsKICAgICAgICAgICAgIG1EZXB0aEZ1bmMgPSBmdW5jOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgIH0KIAotICAgICAgICBwdWJsaWMgdm9pZCBzZXREZXB0aE1hc2soYm9vbGVhbiBlbmFibGUpIHsKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgc2V0RGVwdGhNYXNrKGJvb2xlYW4gZW5hYmxlKSB7CiAgICAgICAgICAgICBtRGVwdGhNYXNrID0gZW5hYmxlOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgIH0KIAotICAgICAgICBwdWJsaWMgdm9pZCBzZXRDb2xvck1hc2soYm9vbGVhbiByLCBib29sZWFuIGcsIGJvb2xlYW4gYiwgYm9vbGVhbiBhKSB7CisgICAgICAgIHB1YmxpYyBCdWlsZGVyIHNldENvbG9yTWFzayhib29sZWFuIHIsIGJvb2xlYW4gZywgYm9vbGVhbiBiLCBib29sZWFuIGEpIHsKICAgICAgICAgICAgIG1Db2xvck1hc2tSID0gcjsKICAgICAgICAgICAgIG1Db2xvck1hc2tHID0gZzsKICAgICAgICAgICAgIG1Db2xvck1hc2tCID0gYjsKICAgICAgICAgICAgIG1Db2xvck1hc2tBID0gYTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICB9CiAKLSAgICAgICAgcHVibGljIHZvaWQgc2V0QmxlbmRGdW5jKEJsZW5kU3JjRnVuYyBzcmMsIEJsZW5kRHN0RnVuYyBkc3QpIHsKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgc2V0QmxlbmRGdW5jKEJsZW5kU3JjRnVuYyBzcmMsIEJsZW5kRHN0RnVuYyBkc3QpIHsKICAgICAgICAgICAgIG1CbGVuZFNyYyA9IHNyYzsKICAgICAgICAgICAgIG1CbGVuZERzdCA9IGRzdDsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICB9CiAKLSAgICAgICAgcHVibGljIHZvaWQgc2V0RGl0aGVyRW5hYmxlKGJvb2xlYW4gZW5hYmxlKSB7CisgICAgICAgIHB1YmxpYyBCdWlsZGVyIHNldERpdGhlckVuYWJsZShib29sZWFuIGVuYWJsZSkgewogICAgICAgICAgICAgbURpdGhlciA9IGVuYWJsZTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICB9CiAKICAgICAgICAgc3RhdGljIHN5bmNocm9uaXplZCBQcm9ncmFtU3RvcmUgaW50ZXJuYWxDcmVhdGUoUmVuZGVyU2NyaXB0IHJzLCBCdWlsZGVyIGIpIHsKQEAgLTE0NywxNyArMjk2LDE3IEBACiAgICAgICAgICAgICBpZiAoYi5tT3V0ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBvdXRJRCA9IGIubU91dC5tSUQ7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVCZWdpbihpbklELCBvdXRJRCk7Ci0gICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aEZ1bmMoYi5tRGVwdGhGdW5jLm1JRCk7Ci0gICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aE1hc2soYi5tRGVwdGhNYXNrKTsKLSAgICAgICAgICAgIHJzLm5Qcm9ncmFtRnJhZ21lbnRTdG9yZUNvbG9yTWFzayhiLm1Db2xvck1hc2tSLAorICAgICAgICAgICAgcnMublByb2dyYW1TdG9yZUJlZ2luKGluSUQsIG91dElEKTsKKyAgICAgICAgICAgIHJzLm5Qcm9ncmFtU3RvcmVEZXB0aEZ1bmMoYi5tRGVwdGhGdW5jLm1JRCk7CisgICAgICAgICAgICBycy5uUHJvZ3JhbVN0b3JlRGVwdGhNYXNrKGIubURlcHRoTWFzayk7CisgICAgICAgICAgICBycy5uUHJvZ3JhbVN0b3JlQ29sb3JNYXNrKGIubUNvbG9yTWFza1IsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYi5tQ29sb3JNYXNrRywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLm1Db2xvck1hc2tCLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIubUNvbG9yTWFza0EpOwotICAgICAgICAgICAgcnMublByb2dyYW1GcmFnbWVudFN0b3JlQmxlbmRGdW5jKGIubUJsZW5kU3JjLm1JRCwgYi5tQmxlbmREc3QubUlEKTsKLSAgICAgICAgICAgIHJzLm5Qcm9ncmFtRnJhZ21lbnRTdG9yZURpdGhlcihiLm1EaXRoZXIpOworICAgICAgICAgICAgcnMublByb2dyYW1TdG9yZUJsZW5kRnVuYyhiLm1CbGVuZFNyYy5tSUQsIGIubUJsZW5kRHN0Lm1JRCk7CisgICAgICAgICAgICBycy5uUHJvZ3JhbVN0b3JlRGl0aGVyKGIubURpdGhlcik7CiAKLSAgICAgICAgICAgIGludCBpZCA9IHJzLm5Qcm9ncmFtRnJhZ21lbnRTdG9yZUNyZWF0ZSgpOworICAgICAgICAgICAgaW50IGlkID0gcnMublByb2dyYW1TdG9yZUNyZWF0ZSgpOwogICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9ncmFtU3RvcmUoaWQsIHJzKTsKICAgICAgICAgfQogCmRpZmYgLS1naXQgYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvcmVuZGVyc2NyaXB0L1Byb2dyYW1WZXJ0ZXguamF2YSBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvUHJvZ3JhbVZlcnRleC5qYXZhCmluZGV4IDFiMTU1ZDcuLjY1YTBhZjIgMTAwNjQ0Ci0tLSBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvUHJvZ3JhbVZlcnRleC5qYXZhCisrKyBiL2dyYXBoaWNzL2phdm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bUJ1aWxkZXIgewogICAgICAgICBwdWJsaWMgU2hhZGVyQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMpIHsKICAgICAgICAgICAgIHN1cGVyKHJzKTsKQEAgLTgyLDEzICs2NCw3NSBAQAogICAgICAgICAgICAgdG1wW2lkeCsrXSA9IDM7CiAgICAgICAgICAgICB0bXBbaWR4KytdID0gbVRleHR1cmVDb3VudDsKIAotICAgICAgICAgICAgaW50IGlkID0gbVJTLm5Qcm9ncmFtVmVydGV4Q3JlYXRlMihtU2hhZGVyLCB0bXApOworICAgICAgICAgICAgaW50IGlkID0gbVJTLm5Qcm9ncmFtVmVydGV4Q3JlYXRlKG1TaGFkZXIsIHRtcCk7CiAgICAgICAgICAgICBQcm9ncmFtVmVydGV4IHB2ID0gbmV3IFByb2dyYW1WZXJ0ZXgoaWQsIG1SUyk7CiAgICAgICAgICAgICBpbml0UHJvZ3JhbShwdik7CiAgICAgICAgICAgICByZXR1cm4gcHY7CiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgZXh0ZW5kcyBTaGFkZXJCdWlsZGVyIHsKKyAgICAgICAgYm9vbGVhbiBtVGV4dHVyZU1hdHJpeEVuYWJsZTsKKworICAgICAgICBwdWJsaWMgQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMsIEVsZW1lbnQgaW4sIEVsZW1lbnQgb3V0KSB7CisgICAgICAgICAgICBzdXBlcihycyk7CisgICAgICAgIH0KKyAgICAgICAgcHVibGljIEJ1aWxkZXIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgICAgICBzdXBlcihycyk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQnVpbGRlciBzZXRUZXh0dXJlTWF0cml4RW5hYmxlKGJvb2xlYW4gZW5hYmxlKSB7CisgICAgICAgICAgICBtVGV4dHVyZU1hdHJpeEVuYWJsZSA9IGVuYWJsZTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisgICAgICAgIHN0YXRpYyBUeXBlIGdldENvbnN0YW50SW5wdXRUeXBlKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICAgICAgRWxlbWVudC5CdWlsZGVyIGIgPSBuZXcgRWxlbWVudC5CdWlsZGVyKHJzKTsKKyAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuTUFUUklYNFg0KHJzKSwgIk1WIik7CisgICAgICAgICAgICBiLmFkZChFbGVtZW50Lk1BVFJJWDRYNChycyksICJQIik7CisgICAgICAgICAgICBiLmFkZChFbGVtZW50Lk1BVFJJWDRYNChycyksICJUZXhNYXRyaXgiKTsKKyAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuTUFUUklYNFg0KHJzKSwgIk1WUCIpOworCisgICAgICAgICAgICBUeXBlLkJ1aWxkZXIgdHlwZUJ1aWxkZXIgPSBuZXcgVHlwZS5CdWlsZGVyKHJzLCBiLmNyZWF0ZSgpKTsKKyAgICAgICAgICAgIHR5cGVCdWlsZGVyLmFkZChEaW1lbnNpb24uWCwgMSk7CisgICAgICAgICAgICByZXR1cm4gdHlwZUJ1aWxkZXIuY3JlYXRlKCk7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgYnVpbGRTaGFkZXJTdHJpbmcoKSB7CisKKyAgICAgICAgICAgIG1TaGFkZXIgID0gIi8vcnNfc2hhZGVyX2ludGVybmFsXG4iOworICAgICAgICAgICAgbVNoYWRlciArPSAidmFyeWluZyB2ZWM0IHZhckNvbG9yO1xuIjsKKyAgICAgICAgICAgIG1TaGFkZXIgKz0gInZhcnlpbmcgdmVjMiB2YXJUZXgwO1xuIjsKKworICAgICAgICAgICAgbVNoYWRlciArPSAidm9pZCBtYWluKCkge1xuIjsKKyAgICAgICAgICAgIG1TaGFkZXIgKz0gIiAgZ2xfUG9zaXRpb24gPSBVTklfTVZQICogQVRUUklCX3Bvc2l0aW9uO1xuIjsKKyAgICAgICAgICAgIG1TaGFkZXIgKz0gIiAgZ2xfUG9pbnRTaXplID0gMS4wO1xuIjsKKworICAgICAgICAgICAgbVNoYWRlciArPSAiICB2YXJDb2xvciA9IEFUVFJJQl9jb2xvcjtcbiI7CisgICAgICAgICAgICBpZiAobVRleHR1cmVNYXRyaXhFbmFibGUpIHsKKyAgICAgICAgICAgICAgICBtU2hhZGVyICs9ICIgIHZhclRleDAgPSAoVU5JX1RleE1hdHJpeCAqIHZlYzQoQVRUUklCX3RleHR1cmUwLCAwLjAsIDEuMCkpLnh5O1xuIjsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVNoYWRlciArPSAiICB2YXJUZXgwID0gQVRUUklCX3RleHR1cmUwO1xuIjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1TaGFkZXIgKz0gIn1cbiI7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFByb2dyYW1WZXJ0ZXggY3JlYXRlKCkgeworICAgICAgICAgICAgYnVpbGRTaGFkZXJTdHJpbmcoKTsKKworICAgICAgICAgICAgYWRkQ29uc3RhbnQoZ2V0Q29uc3RhbnRJbnB1dFR5cGUobVJTKSk7CisKKyAgICAgICAgICAgIEVsZW1lbnQuQnVpbGRlciBiID0gbmV3IEVsZW1lbnQuQnVpbGRlcihtUlMpOworICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5GMzJfNChtUlMpLCAicG9zaXRpb24iKTsKKyAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuRjMyXzQobVJTKSwgImNvbG9yIik7CisgICAgICAgICAgICBiLmFkZChFbGVtZW50LkYzMl8zKG1SUyksICJub3JtYWwiKTsKKyAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuRjMyXzIobVJTKSwgInRleHR1cmUwIik7CisgICAgICAgICAgICBhZGRJbnB1dChiLmNyZWF0ZSgpKTsKKworICAgICAgICAgICAgcmV0dXJuIHN1cGVyLmNyZWF0ZSgpOworICAgICAgICB9CisgICAgfQorCiAKIAogICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgTWF0cml4QWxsb2NhdGlvbiB7CkBAIC0xMDEsMTYgKzE0NSwxNyBAQAogICAgICAgICBNYXRyaXg0ZiBtVGV4dHVyZTsKIAogICAgICAgICBwdWJsaWMgQWxsb2NhdGlvbiBtQWxsb2M7CisgICAgICAgIHByaXZhdGUgRmllbGRQYWNrZXIgbUlPQnVmZmVyOwogCiAgICAgICAgIHB1YmxpYyBNYXRyaXhBbGxvY2F0aW9uKFJlbmRlclNjcmlwdCBycykgewotICAgICAgICAgICAgbU1vZGVsID0gbmV3IE1hdHJpeDRmKCk7Ci0gICAgICAgICAgICBtUHJvamVjdGlvbiA9IG5ldyBNYXRyaXg0ZigpOwotICAgICAgICAgICAgbVRleHR1cmUgPSBuZXcgTWF0cml4NGYoKTsKLQotICAgICAgICAgICAgbUFsbG9jID0gQWxsb2NhdGlvbi5jcmVhdGVTaXplZChycywgRWxlbWVudC5jcmVhdGVVc2VyKHJzLCBFbGVtZW50LkRhdGFUeXBlLkZMT0FUXzMyKSwgNDgpOwotICAgICAgICAgICAgbUFsbG9jLnN1YkRhdGExRChNT0RFTFZJRVdfT0ZGU0VULCAxNiwgbU1vZGVsLm1NYXQpOwotICAgICAgICAgICAgbUFsbG9jLnN1YkRhdGExRChQUk9KRUNUSU9OX09GRlNFVCwgMTYsIG1Qcm9qZWN0aW9uLm1NYXQpOwotICAgICAgICAgICAgbUFsbG9jLnN1YkRhdGExRChURVhUVVJFX09GRlNFVCwgMTYsIG1UZXh0dXJlLm1NYXQpOworICAgICAgICAgICAgVHlwZSBjb25zdElucHV0VHlwZSA9IFByb2dyYW1WZXJ0ZXguQnVpbGRlci5nZXRDb25zdGFudElucHV0VHlwZShycyk7CisgICAgICAgICAgICBtQWxsb2MgPSBBbGxvY2F0aW9uLmNyZWF0ZVR5cGVkKHJzLCBjb25zdElucHV0VHlwZSk7CisgICAgICAgICAgICBpbnQgYnVmZmVyU2l6ZSA9IGNvbnN0SW5wdXRUeXBlLmdldEVsZW1lbnQoKS5nZXRTaXplQnl0ZXMoKSoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3RJbnB1dFR5cGUuZ2V0RWxlbWVudENvdW50KCk7CisgICAgICAgICAgICBtSU9CdWZmZXIgPSBuZXcgRmllbGRQYWNrZXIoYnVmZmVyU2l6ZSk7CisgICAgICAgICAgICBsb2FkTW9kZWx2aWV3KG5ldyBNYXRyaXg0ZigpKTsKKyAgICAgICAgICAgIGxvYWRQcm9qZWN0aW9uKG5ldyBNYXRyaXg0ZigpKTsKKyAgICAgICAgICAgIGxvYWRUZXh0dXJlKG5ldyBNYXRyaXg0ZigpKTsKICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIGRlc3Ryb3koKSB7CkBAIC0xMTgsMjQgKzE2MywzMiBAQAogICAgICAgICAgICAgbUFsbG9jID0gbnVsbDsKICAgICAgICAgfQogCisgICAgICAgIHByaXZhdGUgdm9pZCBhZGRUb0J1ZmZlcihpbnQgb2Zmc2V0LCBNYXRyaXg0ZiBtKSB7CisgICAgICAgICAgICBtSU9CdWZmZXIucmVzZXQob2Zmc2V0KTsKKyAgICAgICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCAxNjsgaSArKykgeworICAgICAgICAgICAgICAgIG1JT0J1ZmZlci5hZGRGMzIobS5tTWF0W2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1BbGxvYy5kYXRhKG1JT0J1ZmZlci5nZXREYXRhKCkpOworICAgICAgICB9CisKICAgICAgICAgcHVibGljIHZvaWQgbG9hZE1vZGVsdmlldyhNYXRyaXg0ZiBtKSB7CiAgICAgICAgICAgICBtTW9kZWwgPSBtOwotICAgICAgICAgICAgbUFsbG9jLnN1YkRhdGExRChNT0RFTFZJRVdfT0ZGU0VULCAxNiwgbS5tTWF0KTsKKyAgICAgICAgICAgIGFkZFRvQnVmZmVyKE1PREVMVklFV19PRkZTRVQqNCwgbSk7CiAgICAgICAgIH0KIAogICAgICAgICBwdWJsaWMgdm9pZCBsb2FkUHJvamVjdGlvbihNYXRyaXg0ZiBtKSB7CiAgICAgICAgICAgICBtUHJvamVjdGlvbiA9IG07Ci0gICAgICAgICAgICBtQWxsb2Muc3ViRGF0YTFEKFBST0pFQ1RJT05fT0ZGU0VULCAxNiwgbS5tTWF0KTsKKyAgICAgICAgICAgIGFkZFRvQnVmZmVyKFBST0pFQ1RJT05fT0ZGU0VUKjQsIG0pOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIHZvaWQgbG9hZFRleHR1cmUoTWF0cml4NGYgbSkgewogICAgICAgICAgICAgbVRleHR1cmUgPSBtOwotICAgICAgICAgICAgbUFsbG9jLnN1YkRhdGExRChURVhUVVJFX09GRlNFVCwgMTYsIG0ubU1hdCk7CisgICAgICAgICAgICBhZGRUb0J1ZmZlcihURVhUVVJFX09GRlNFVCo0LCBtKTsKICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIHNldHVwT3J0aG9XaW5kb3coaW50IHcsIGludCBoKSB7CiAgICAgICAgICAgICBtUHJvamVjdGlvbi5sb2FkT3J0aG8oMCx3LCBoLDAsIC0xLDEpOwotICAgICAgICAgICAgbUFsbG9jLnN1YkRhdGExRChQUk9KRUNUSU9OX09GRlNFVCwgMTYsIG1Qcm9qZWN0aW9uLm1NYXQpOworICAgICAgICAgICAgYWRkVG9CdWZmZXIoUFJPSkVDVElPTl9PRkZTRVQqNCwgbVByb2plY3Rpb24pOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIHZvaWQgc2V0dXBPcnRob05vcm1hbGl6ZWQoaW50IHcsIGludCBoKSB7CkBAIC0xNDcsNyArMjAwLDcgQEAKICAgICAgICAgICAgICAgICBmbG9hdCBhc3BlY3QgPSAoKGZsb2F0KWgpIC8gdzsKICAgICAgICAgICAgICAgICBtUHJvamVjdGlvbi5sb2FkT3J0aG8oLTEsMSwgLWFzcGVjdCxhc3BlY3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tcGxlc1ByZWYsIGZsb2F0IHNhbXBsZXNRKTsKKyAgICBzeW5jaHJvbml6ZWQgaW50IG5Db250ZXh0Q3JlYXRlR0woaW50IGRldiwgaW50IHZlciwKKyAgICAgICAgICAgICAgICAgaW50IGNvbG9yTWluLCBpbnQgY29sb3JQcmVmLAorICAgICAgICAgICAgICAgICBpbnQgYWxwaGFNaW4sIGludCBhbHBoYVByZWYsCisgICAgICAgICAgICAgICAgIGludCBkZXB0aE1pbiwgaW50IGRlcHRoUHJlZiwKKyAgICAgICAgICAgICAgICAgaW50IHN0ZW5jaWxNaW4sIGludCBzdGVuY2lsUHJlZiwKKyAgICAgICAgICAgICAgICAgaW50IHNhbXBsZXNNaW4sIGludCBzYW1wbGVzUHJlZiwgZmxvYXQgc2FtcGxlc1EpIHsKKyAgICAgICAgcmV0dXJuIHJzbkNvbnRleHRDcmVhdGVHTChkZXYsIHZlciwgY29sb3JNaW4sIGNvbG9yUHJlZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYU1pbiwgYWxwaGFQcmVmLCBkZXB0aE1pbiwgZGVwdGhQcmVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ZW5jaWxNaW4sIHN0ZW5jaWxQcmVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsZXNNaW4sIHNhbXBsZXNQcmVmLCBzYW1wbGVzUSk7CisgICAgfQorICAgIG5hdGl2ZSBpbnQgIHJzbkNvbnRleHRDcmVhdGUoaW50IGRldiwgaW50IHZlcik7CisgICAgc3luY2hyb25pemVkIGludCBuQ29udGV4dENyZWF0ZShpbnQgZGV2LCBpbnQgdmVyKSB7CisgICAgICAgIHJldHVybiByc25Db250ZXh0Q3JlYXRlKGRldiwgdmVyKTsKKyAgICB9CisgICAgbmF0aXZlIHZvaWQgcnNuQ29udGV4dERlc3Ryb3koaW50IGNvbik7CisgICAgc3luY2hyb25pemVkIHZvaWQgbkNvbnRleHREZXN0cm95KCkgeworICAgICAgICByc25Db250ZXh0RGVzdHJveShtQ29udGV4dCk7CisgICAgfQorICAgIG5hdGl2ZSB2b2lkIHJzbkNvbnRleHRTZXRTdXJmYWNlKGludCBjb24sIGludCB3LCBpbnQgaCwgU3VyZmFjZSBzdXIpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5Db250ZXh0U2V0U3VyZmFjZShpbnQgdywgaW50IGgsIFN1cmZhY2Ugc3VyKSB7CisgICAgICAgIHJzbkNvbnRleHRTZXRTdXJmYWNlKG1Db250ZXh0LCB3LCBoLCBzdXIpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25Db250ZXh0U2V0UHJpb3JpdHkoaW50IGNvbiwgaW50IHApOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5Db250ZXh0U2V0UHJpb3JpdHkoaW50IHApIHsKKyAgICAgICAgcnNuQ29udGV4dFNldFByaW9yaXR5KG1Db250ZXh0LCBwKTsKKyAgICB9CisgICAgbmF0aXZlIHZvaWQgcnNuQ29udGV4dER1bXAoaW50IGNvbiwgaW50IGJpdHMpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5Db250ZXh0RHVtcChpbnQgYml0cykgeworICAgICAgICByc25Db250ZXh0RHVtcChtQ29udGV4dCwgYml0cyk7CisgICAgfQorICAgIG5hdGl2ZSB2b2lkIHJzbkNvbnRleHRGaW5pc2goaW50IGNvbik7CisgICAgc3luY2hyb25pemVkIHZvaWQgbkNvbnRleHRGaW5pc2goKSB7CisgICAgICAgIHJzbkNvbnRleHRGaW5pc2gobUNvbnRleHQpOworICAgIH0KIAotICAgIG5hdGl2ZSB2b2lkIG5UeXBlQmVnaW4oaW50IGVsZW1lbnRJRCk7Ci0gICAgbmF0aXZlIHZvaWQgblR5cGVBZGQoaW50IGRpbSwgaW50IHZhbCk7Ci0gICAgbmF0aXZlIGludCAgblR5cGVDcmVhdGUoKTsKLSAgICBuYXRpdmUgdm9pZCBuVHlwZUZpbmFsRGVzdHJ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YXRpdmUgaW50ICBuQWxsb2NhdGlvbkNyZWF0ZUZyb21CaXRtYXBCb3hlZChpbnQgZHN0Rm10LCBib29sZWFuIGdlbk1pcHMsIEJpdG1hcCBibXApOwotICAgIG5hdGl2ZSBpbnQgIG5BbGxvY2F0aW9uQ3JlYXRlRnJvbUFzc2V0U3RyZWFtKGludCBkc3RGbXQsIGJvb2xlYW4gZ2VuTWlwcywgaW50IGFzc2V0U3RyZWFtKTsKKyAgICBuYXRpdmUgdm9pZCByc25Bc3NpZ25OYW1lKGludCBjb24sIGludCBvYmosIGJ5dGVbXSBuYW1lKTsKKyAgICBzeW5jaHJvbml6ZWQgdm9pZCBuQXNzaWduTmFtZShpbnQgb2JqLCBieXRlW10gbmFtZSkgeworICAgICAgICByc25Bc3NpZ25OYW1lKG1Db250ZXh0LCBvYmosIG5hbWUpOworICAgIH0KKyAgICBuYXRpdmUgU3RyaW5nIHJzbkdldE5hbWUoaW50IGNvbiwgaW50IG9iaik7CisgICAgc3luY2hyb25pemVkIFN0cmluZyBuR2V0TmFtZShpbnQgb2JqKSB7CisgICAgICAgIHJldHVybiByc25HZXROYW1lKG1Db250ZXh0LCBvYmopOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25PYmpEZXN0cm95KGludCBjb24sIGludCBpZCk7CisgICAgc3luY2hyb25pemVkIHZvaWQgbk9iakRlc3Ryb3koaW50IGlkKSB7CisgICAgICAgIHJzbk9iakRlc3Ryb3kobUNvbnRleHQsIGlkKTsKKyAgICB9CisgICAgbmF0aXZlIGludCAgcnNuRmlsZU9wZW4oaW50IGNvbiwgYnl0ZVtdIG5hbWUpOworICAgIHN5bmNocm9uaXplZCBpbnQgbkZpbGVPcGVuKGJ5dGVbXSBuYW1lKSB7CisgICAgICAgIHJldHVybiByc25GaWxlT3BlbihtQ29udGV4dCwgbmFtZSk7CisgICAgfQogCi0gICAgbmF0aXZlIHZvaWQgbkFsbG9jYXRpb25VcGxvYWRUb1RleHR1cmUoaW50IGFsbG9jLCBib29sZWFuIGdlbk1pcHMsIGludCBiYXNlTWlvTGV2ZWwpOwotICAgIG5hdGl2ZSB2b2lkIG5BbGxvY2F0aW9uVXBsb2FkVG9CdWZmZXJPYmplY3QoaW50IGFsbG9jKTsKKyAgICBuYXRpdmUgaW50ICByc25FbGVtZW50Q3JlYXRlKGludCBjb24sIGludCB0eXBlLCBpbnQga2luZCwgYm9vbGVhbiBub3JtLCBpbnQgdmVjU2l6ZSk7CisgICAgc3luY2hyb25pemVkIGludCBuRWxlbWVudENyZWF0ZShpbnQgdHlwZSwgaW50IGtpbmQsIGJvb2xlYW4gbm9ybSwgaW50IHZlY1NpemUpIHsKKyAgICAgICAgcmV0dXJuIHJzbkVsZW1lbnRDcmVhdGUobUNvbnRleHQsIHR5cGUsIGtpbmQsIG5vcm0sIHZlY1NpemUpOworICAgIH0KKyAgICBuYXRpdmUgaW50ICByc25FbGVtZW50Q3JlYXRlMihpbnQgY29uLCBpbnRbXSBlbGVtZW50cywgU3RyaW5nW10gbmFtZXMsIGludFtdIGFycmF5U2l6ZXMpOworICAgIHN5bmNocm9uaXplZCBpbnQgbkVsZW1lbnRDcmVhdGUyKGludFtdIGVsZW1lbnRzLCBTdHJpbmdbXSBuYW1lcywgaW50W10gYXJyYXlTaXplcykgeworICAgICAgICByZXR1cm4gcnNuRWxlbWVudENyZWF0ZTIobUNvbnRleHQsIGVsZW1lbnRzLCBuYW1lcywgYXJyYXlTaXplcyk7CisgICAgfQorICAgIG5hdGl2ZSB2b2lkIHJzbkVsZW1lbnRHZXROYXRpdmVEYXRhKGludCBjb24sIGludCBpZCwgaW50W10gZWxlbWVudERhdGEpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5FbGVtZW50R2V0TmF0aXZlRGF0YShpbnQgaWQsIGludFtdIGVsZW1lbnREYXRhKSB7CisgICAgICAgIHJzbkVsZW1lbnRHZXROYXRpdmVEYXRhKG1Db250ZXh0LCBpZCwgZWxlbWVudERhdGEpOworICAgIH0KKyAgICBu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iwgaW50IGFkLCBpbnQgYWxsb2MpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5BZGFwdGVyMkRCaW5kQWxsb2NhdGlvbihpbnQgYWQsIGludCBhbGxvYykgeworICAgICAgICByc25BZGFwdGVyMkRCaW5kQWxsb2NhdGlvbihtQ29udGV4dCwgYWQsIGFsbG9jKTsKKyAgICB9CisgICAgbmF0aXZlIHZvaWQgcnNuQWRhcHRlcjJEU2V0Q29uc3RyYWludChpbnQgY29uLCBpbnQgYWQsIGludCBkaW0sIGludCB2YWx1ZSk7CisgICAgc3luY2hyb25pemVkIHZvaWQgbkFkYXB0ZXIyRFNldENvbnN0cmFpbnQoaW50IGFkLCBpbnQgZGltLCBpbnQgdmFsdWUpIHsKKyAgICAgICAgcnNuQWRhcHRlcjJEU2V0Q29uc3RyYWludChtQ29udGV4dCwgYWQsIGRpbSwgdmFsdWUpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25BZGFwdGVyMkREYXRhKGludCBjb24sIGludCBhZCwgaW50W10gZCk7CisgICAgc3luY2hyb25pemVkIHZvaWQgbkFkYXB0ZXIyRERhdGEoaW50IGFkLCBpbnRbXSBkKSB7CisgICAgICAgIHJzbkFkYXB0ZXIyRERhdGEobUNvbnRleHQsIGFkLCBkKTsKKyAgICB9CisgICAgbmF0aXZlIHZvaWQgcnNuQWRhcHRlcjJERGF0YShpbnQgY29uLCBpbnQgYWQsIGZsb2F0W10gZCk7CisgICAgc3luY2hyb25pemVkIHZvaWQgbkFkYXB0ZXIyRERhdGEoaW50IGFkLCBmbG9hdFtdIGQpIHsKKyAgICAgICAgcnNuQWRhcHRlcjJERGF0YShtQ29udGV4dCwgYWQsIGQpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25BZGFwdGVyMkRTdWJEYXRhKGludCBjb24sIGludCBhZCwgaW50IHhvZmYsIGludCB5b2ZmLCBpbnQgdywgaW50IGgsIGludFtdIGQpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5BZ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aW50IHNsb3QpIHsKKyAgICAgICAgcnNuU2NyaXB0QmluZEFsbG9jYXRpb24obUNvbnRleHQsIHNjcmlwdCwgYWxsb2MsIHNsb3QpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25TY3JpcHRTZXRUaW1lWm9uZShpbnQgY29uLCBpbnQgc2NyaXB0LCBieXRlW10gdGltZVpvbmUpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5TY3JpcHRTZXRUaW1lWm9uZShpbnQgc2NyaXB0LCBieXRlW10gdGltZVpvbmUpIHsKKyAgICAgICAgcnNuU2NyaXB0U2V0VGltZVpvbmUobUNvbnRleHQsIHNjcmlwdCwgdGltZVpvbmUpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25TY3JpcHRJbnZva2UoaW50IGNvbiwgaW50IGlkLCBpbnQgc2xvdCk7CisgICAgc3luY2hyb25pemVkIHZvaWQgblNjcmlwdEludm9rZShpbnQgaWQsIGludCBzbG90KSB7CisgICAgICAgIHJzblNjcmlwdEludm9rZShtQ29udGV4dCwgaWQsIHNsb3QpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25TY3JpcHRJbnZva2VWKGludCBjb24sIGludCBpZCwgaW50IHNsb3QsIGJ5dGVbXSBwYXJhbXMpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5TY3JpcHRJbnZva2VWKGludCBpZCwgaW50IHNsb3QsIGJ5dGVbXSBwYXJhbXMpIHsKKyAgICAgICAgcnNuU2NyaXB0SW52b2tlVihtQ29udGV4dCwgaWQsIHNsb3QsIHBhcmFtcyk7CisgICAgfQorICAgIG5hdGl2ZSB2b2lkIHJzblNjcmlwdFNldFZhckkoaW50IGNvbiwgaW50IGlkLCBpbnQgc2xvdCwgaW50IHZhbCk7CisgICAgc3luY2hyb25pemVkIHZvaWQgblNjcmlwdFNldFZhckkoaW50IGlkLCBpbnQgc2xvdCwgaW50IHZhbCkgeworICAgICAgICByc25TY3JpcHRTZXRWYXJJKG1Db250ZX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pbnQgY29uLCBib29sZWFuIHBvaW50U21vb3RoLCBib29sZWFuIGxpbmVTbW9vdGgsIGJvb2xlYW4gcG9pbnRTcHJpdGUpOworICAgIHN5bmNocm9uaXplZCBpbnQgblByb2dyYW1SYXN0ZXJDcmVhdGUoYm9vbGVhbiBwb2ludFNtb290aCwgYm9vbGVhbiBsaW5lU21vb3RoLCBib29sZWFuIHBvaW50U3ByaXRlKSB7CisgICAgICAgIHJldHVybiByc25Qcm9ncmFtUmFzdGVyQ3JlYXRlKG1Db250ZXh0LCBwb2ludFNtb290aCwgbGluZVNtb290aCwgcG9pbnRTcHJpdGUpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25Qcm9ncmFtUmFzdGVyU2V0TGluZVdpZHRoKGludCBjb24sIGludCBwciwgZmxvYXQgdik7CisgICAgc3luY2hyb25pemVkIHZvaWQgblByb2dyYW1SYXN0ZXJTZXRMaW5lV2lkdGgoaW50IHByLCBmbG9hdCB2KSB7CisgICAgICAgIHJzblByb2dyYW1SYXN0ZXJTZXRMaW5lV2lkdGgobUNvbnRleHQsIHByLCB2KTsKKyAgICB9CisgICAgbmF0aXZlIHZvaWQgcnNuUHJvZ3JhbVJhc3RlclNldEN1bGxNb2RlKGludCBjb24sIGludCBwciwgaW50IG1vZGUpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5Qcm9ncmFtUmFzdGVyU2V0Q3VsbE1vZGUoaW50IHByLCBpbnQgbW9kZSkgeworICAgICAgICByc25Qcm9ncmFtUmFzdGVyU2V0Q3VsbE1vZGUobUNvbnRleHQsIHByLCBtb2RlKTsKKyAgICB9CisKKyAgICBuYXRpdmUgdm9pZCByc25Qcm9ncmFtQmluZENvbnN0YW50cyhpbnQgY29uLCBpbnQgcHYsIGludCBzbG90LCBpbnQgbUlEKTsKKyAgICBzeW5jaHJvbml6ZWQgdm9pZCBuUHJvZ3JhbUJpbmRDb25zdGFudHMoaW50IHB2LCBpbnQgc2xvdCwgaW50IG1JRCkgeworICAgIC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RyaW5nIHNoYWRlciwgaW50W10gcGFyYW1zKSB7CisgICAgICAgIHJldHVybiByc25Qcm9ncmFtVmVydGV4Q3JlYXRlKG1Db250ZXh0LCBzaGFkZXIsIHBhcmFtcyk7CisgICAgfQorCisgICAgbmF0aXZlIGludCAgcnNuTWVzaENyZWF0ZShpbnQgY29uLCBpbnQgdnR4Q291bnQsIGludCBpbmRleENvdW50KTsKKyAgICBzeW5jaHJvbml6ZWQgaW50IG5NZXNoQ3JlYXRlKGludCB2dHhDb3VudCwgaW50IGluZGV4Q291bnQpIHsKKyAgICAgICAgcmV0dXJuIHJzbk1lc2hDcmVhdGUobUNvbnRleHQsIHZ0eENvdW50LCBpbmRleENvdW50KTsKKyAgICB9CisgICAgbmF0aXZlIHZvaWQgcnNuTWVzaEJpbmRWZXJ0ZXgoaW50IGNvbiwgaW50IGlkLCBpbnQgYWxsb2MsIGludCBzbG90KTsKKyAgICBzeW5jaHJvbml6ZWQgdm9pZCBuTWVzaEJpbmRWZXJ0ZXgoaW50IGlkLCBpbnQgYWxsb2MsIGludCBzbG90KSB7CisgICAgICAgIHJzbk1lc2hCaW5kVmVydGV4KG1Db250ZXh0LCBpZCwgYWxsb2MsIHNsb3QpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25NZXNoQmluZEluZGV4KGludCBjb24sIGludCBpZCwgaW50IGFsbG9jLCBpbnQgcHJpbSwgaW50IHNsb3QpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5NZXNoQmluZEluZGV4KGludCBpZCwgaW50IGFsbG9jLCBpbnQgcHJpbSwgaW50IHNsb3QpIHsKKyAgICAgICAgcnNuTWVzaEJpbmRJbmRleChtQ29udGV4dCwgaWQsIGFsbG9jLCBwcmltLCBzbG90KTsKKyAgICB9CisgICAgbmF0aXZlIGludCAgcnNuTWVzaEdldFZlcnRleEJ1ZmZlckNvdW50KGludCBjb24sIGludCBpZCk7CisgICAgc3luY2hyb25pemVkIGludCBuTWVzaEdldFZlcnRleEJ1ZmZlckNvdW50KGludCBpZCkgeworICAgICAgICByZXR1cm4gcnNuTWVzaEdldFZlcnRleEJ1ZmZlckNvdW50KG1Db250ZXh0LCBpZCk7CisgICAgfQorICAgIG5hdGl2ZSBpbnQgIHJzbk1lc2hHZXRJbmRleENvdW50KGludCBjb24sIGludCBpZCk7CisgICAgc3luY2hyb25pemVkIGludCBuTWVzaEdldEluZGV4Q291bnQoaW50IGlkKSB7CisgICAgICAgIHJldHVybiByc25NZXNoR2V0SW5kZXhDb3VudChtQ29udGV4dCwgaWQpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25NZXNoR2V0VmVydGljZXMoaW50IGNvbiwgaW50IGlkLCBpbnRbXSB2dHhJZHMsIGludCB2dHhJZENvdW50KTsKKyAgICBzeW5jaHJvbml6ZWQgdm9pZCBuTWVzaEdldFZlcnRpY2VzKGludCBpZCwgaW50W10gdnR4SWRzLCBpbnQgdnR4SWRDb3VudCkgeworICAgICAgICByc25NZXNoR2V0VmVydGljZXMobUNvbnRleHQsIGlkLCB2dHhJZHMsIHZ0eElkQ291bnQpOworICAgIH0KKyAgICBuYXRpdmUgdm9pZCByc25NZXNoR2V0SW5kaWNlcyhpbnQgY29uLCBpbnQgaWQsIGludFtdIGlkeElkcywgaW50W10gcHJpbWl0aXZlcywgaW50IHZ0eElkQ291bnQpOworICAgIHN5bmNocm9uaXplZCB2b2lkIG5NZXNoR2V0SW5kaWNlcyhpbnQgaWQsIGludFtdIGlkeElkcywgaW50W10gcHJpbWl0aXZlcywgaW50IHZ0eElkQ291bnQpIHsKKyAgICAgICAgcnNuTWVzaEdldEluZGljZXMobUNvbnRleHQsIGlkLCBpZHhJZHMsIHByaW1pdGl2ZXMsIHZ0eElkQ291bnQpOworICAgIH0KKwogCiAgICAgcHJvdGVjdGVkIGludCAgICAgbURldjsKICAgICBwcm90ZWN0ZWQgaW50ICAgICBtQ29udGV4dDsKICAgICBAU3VwcHJlc3NXYXJuaW5ncyh7IkZpZWxkQ2FuQmV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HJvZ3JhbVJhc3RlciBtUHJvZ3JhbVJhc3Rlcl9DVUxMX0JBQ0s7CisgICAgUHJvZ3JhbVJhc3RlciBtUHJvZ3JhbVJhc3Rlcl9DVUxMX0ZST05UOworICAgIFByb2dyYW1SYXN0ZXIgbVByb2dyYW1SYXN0ZXJfQ1VMTF9OT05FOwogCiAgICAgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KICAgICAvLwpAQCAtMjY0LDI1ICs2MjIsMzIgQEAKICAgICAgICAgICAgIC8vIFRoaXMgZnVuY3Rpb24gaXMgYSB0ZW1wb3Jhcnkgc29sdXRpb24uICBUaGUgZmluYWwgc29sdXRpb24gd2lsbAogICAgICAgICAgICAgLy8gdXNlZCB0eXBlZCBhbGxvY2F0aW9ucyB3aGVyZSB0aGUgbWVzc2FnZSBpZCBpcyB0aGUgdHlwZSBpbmRpY2F0b3IuCiAgICAgICAgICAgICBpbnRbXSByYnVmID0gbmV3IGludFsxNl07Ci0gICAgICAgICAgICBtUlMubkNvbnRleHRJbml0VG9DbGllbnQoKTsKKyAgICAgICAgICAgIG1SUy5uQ29udGV4dEluaXRUb0NsaWVudChtUlMubUNvbnRleHQpOwogICAgICAgICAgICAgd2hpbGUobVJ1bikgewotICAgICAgICAgICAgICAgIGludCBtc2cgPSBtUlMubkNvbnRleHRHZXRNZXNzYWdlKHJidWYsIHRydWUpOwotICAgICAgICAgICAgICAgIGlmIChtc2cgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICAvLyBTaG91bGQgb25seSBoYXBwZW4gZHVyaW5nIHRlYXJkb3duLgotICAgICAgICAgICAgICAgICAgICAvLyBCdXQgd2Ugd2FudCB0byBhdm9pZCBzdGFydmluZyBvdGhlciB0aHJlYWRzIGR1cmluZwotICAgICAgICAgICAgICAgICAgICAvLyB0ZWFyZG93biBieSB5aWVsZGluZyB1bnRpbCB0aGUgbmV4dCBsaW5lIGluIHRoZSBkZXN0cnVjdG9yCi0gICAgICAgICAgICAgICAgICAgIC8vIGNhbiBleGVjdXRlIHRvIHNldCBtUnVuID0gZmFsc2UKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNsZWVwKDEsIDApOwotICAgICAgICAgICAgICAgICAgICB9IGNhdGNoKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByYnVmWzBdID0gMDsKKyAgICAgICAgICAgICAgICBpbnQgbXNnID0gbVJTLm5Db250ZXh0R2V0TWVzc2FnZShtUlMubUNvbnRleHQsIHJidWYsIHRydWUpOworICAgICAgICAgICAgICAgIGlmICgobXNnID09IDApKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIENhbiBoYXBwZW4gZm9yIHR3byByZWFzb25zCisgICAgICAgICAgICAgICAgICAgIGlmIChyYnVmWzBdID4gMCAmJiBtUnVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyAxOiBCdWZmZXIgbmVlZHMgdG8gYmUgZW5sYXJnZWQuCisgICAgICAgICAgICAgICAgICAgICAgICByYnVmID0gbmV3IGludFtyYnVmWzBdICsgMl07CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyAyOiB0ZWFyZG93bi4KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJ1dCB3ZSB3YW50IHRvIGF2b2lkIHN0YXJ2aW5nIG90aGVyIHRocmVhZHMgZHVyaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0ZWFyZG93biBieSB5aWVsZGluZyB1bnRpbCB0aGUgbmV4dCBsaW5lIGluIHRoZSBkZXN0cnVjdG9yCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBjYW4gZXhlY3V0ZSB0byBzZXQgbVJ1biA9IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsZWVwKDEsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGlmKG1SUy5tTWVzc2FnZUNhbGxiYWNrICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgbVJTLm1NZXNzYWdlQ2FsbGJhY2subURhdGEgPSByYnVmOwogICAgICAgICAgICAgICAgICAgICBtUlMubU1lc3NhZ2VDYWxsYmFjay5tSUQgPSBtc2c7CiAgICAgICAgICAgICAgICAgICAgIG1SUy5tTWVzc2FnZUNhbGxiYWNrLnJ1bigpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvL0xvZy5kKExPR19UQUcsICJNZXNzYWdlVGhyZWFkIG1zZyAiICsgbXNnICsgIiB2MSAiICsgcmJ1ZlswXSArICIgdjIgIiArIHJidWZbMV0gKyAiIHYzICIgK3JidWZbMl0pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIk1lc3NhZ2VUaHJlYWQgZXhpdGluZy4iKTsKICAgICAgICAgfQpAQCAtMzA3LDEyICs2NzIsMjAgQEAKICAgICAgICAgbkNvbnRleHREdW1wKGJpdHMpOwogICAgIH0KIAorICAgIHB1YmxpYyB2b2lkIGZpbmlzaCgpIHsKKyAgICAgICAgbkNvbnRleHRGaW5pc2goKTsKKyAgICB9CisKICAgICBwdWJsaWMgdm9pZCBkZXN0cm95KCkgewogICAgICAgICB2YWxpZGF0ZSgpOwotICAgICAgICBuQ29udGV4dERlaW5pdFRvQ2xpZW50KCk7CisgICAgICAgIG5Db250ZXh0RGVpbml0VG9DbGllbnQobUNvbn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9pZC52aWV3LlN1cmZhY2U7Ci0KK2ltcG9ydCBhbmRyb2lkLnZpZXcuU3VyZmFjZUhvbGRlcjsKK2ltcG9ydCBhbmRyb2lkLnZpZXcuU3VyZmFjZVZpZXc7CiAKIC8qKgogICogQGhpZGUKQEAgLTM0LDE2ICszNiw5OCBAQAogICAgIGludCBtV2lkdGg7CiAgICAgaW50IG1IZWlnaHQ7CiAKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIFN1cmZhY2VDb25maWcgeworICAgICAgICBpbnQgbURlcHRoTWluICAgICAgID0gMDsKKyAgICAgICAgaW50IG1EZXB0aFByZWYgICAgICA9IDA7CisgICAgICAgIGludCBtU3RlbmNpbE1pbiAgICAgPSAwOworICAgICAgICBpbnQgbVN0ZW5jaWxQcmVmICAgID0gMDsKKyAgICAgICAgaW50IG1Db2xvck1pbiAgICAgICA9IDg7CisgICAgICAgIGludCBtQ29sb3JQcmVmICAgICAgPSA4OworICAgICAgICBpbnQgbUFscGhhTWluICAgICAgID0gMDsKKyAgICAgICAgaW50IG1BbHBoYVByZWYgICAgICA9IDA7CisgICAgICAgIGludCBtU2FtcGxlc01pbiAgICAgPSAxOworICAgICAgICBpbnQgbVNhbXBsZXNQcmVmICAgID0gMTsKKyAgICAgICAgZmxvYXQgbVNhbXBsZXNRICAgICA9IDEuZjsKIAotICAgIHB1YmxpYyBSZW5kZXJTY3JpcHRHTChib29sZWFuIHVzZURlcHRoLCBib29sZWFuIGZvcmNlU1cpIHsKKyAgICAgICAgcHVibGljIFN1cmZhY2VDb25maWcoKSB7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgU3VyZmFjZUNvbmZpZyhTdXJmYWNlQ29uZmlnIHNjKSB7CisgICAgICAgICAgICBtRGVwdGhNaW4gPSBzYy5tRGVwdGhNaW47CisgICAgICAgICAgICBtRGVwdGhQcmVmID0gc2MubURlcHRoUHJlZjsKKyAgICAgICAgICAgIG1TdGVuY2lsTWluID0gc2MubVN0ZW5jaWxNaW47CisgICAgICAgICAgICBtU3RlbmNpbFByZWYgPSBzYy5tU3RlbmNpbFByZWY7CisgICAgICAgICAgICBtQ29sb3JNaW4gPSBzYy5tQ29sb3JNaW47CisgICAgICAgICAgICBtQ29sb3JQcmVmID0gc2MubUNvbG9yUHJlZjsKKyAgICAgICAgICAgIG1BbHBoYU1pbiA9IHNjLm1BbHBoYU1pbjsKKyAgICAgICAgICAgIG1BbHBoYVByZWYgPSBzYy5tQWxwaGFQcmVmOworICAgICAgICAgICAgbVNhbXBsZXNNaW4gPSBzYy5tU2FtcGxlc01pbjsKKyAgICAgICAgICAgIG1TYW1wbGVzUHJlZiA9IHNjLm1TYW1wbGVzUHJlZjsKKyAgICAgICAgICAgIG1TYW1wbGVzUSA9IHNjLm1TYW1wbGVzUTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCB2YWxpZGF0ZVJhbmdlKGludCB1bWluLCBpbnQgdXByZWYsIGludCBybWluLCBpbnQgcm1heCkgeworICAgICAgICAgICAgaWYgKHVtaW4gPCBybWluIHx8IHVtaW4gPiBybWF4KSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTWluaW11bSB2YWx1ZSBwcm92aWRlZCBvdXQgb2YgcmFuZ2UuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodXByZWYgPCB1bWluKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiUHJlZmVyZWQgbXVzdCBiZSA+PSBNaW5pbXVtLiIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0Q29sb3IoaW50IG1pbmltdW0sIGludCBwcmVmZXJlZCkgeworICAgICAgICAgICAgdmFsaWRhdGVSYW5nZShtaW5pbXVtLCBwcmVmZXJlZCwgNSwgOCk7CisgICAgICAgICAgICBtQ29sb3JNaW4gPSBtaW5pbXVtOworICAgICAgICAgICAgbUNvbG9yUHJlZiA9IHByZWZlcmVkOworICAgICAgICB9CisgICAgICAgIHB1YmxpYyB2b2lkIHNldEFscGhhKGludCBtaW5pbXVtLCBpbnQgcHJlZmVyZWQpIHsKKyAgICAgICAgICAgIHZhbGlkYXRlUmFuZ2UobWluaW11bSwgcHJlZmVyZWQsIDAsIDgpOworICAgICAgICAgICAgbUFscGhhTWluID0gbWluaW11bTsKKyAgICAgICAgICAgIG1BbHBoYVByZWYgPSBwcmVmZXJlZDsKKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgdm9pZCBzZXREZXB0aChpbnQgbWluaW11bSwgaW50IHByZWZlcmVkKSB7CisgICAgICAgICAgICB2YWxpZGF0ZVJhbmdlKG1pbmltdW0sIHByZWZlcmVkLCAwLCAyNCk7CisgICAgICAgICAgICBtRGVwdGhNaW4gPSBtaW5pbXVtOworICAgICAgICAgICAgbURlcHRoUHJlZiA9IHByZWZlcmVkOworICAgICAgICB9CisgICAgICAgIHB1YmxpYyB2b2lkIHNldFNhbXBsZXMoaW50IG1pbmltdW0sIGludCBwcmVmZXJlZCwgZmxvYXQgUSkgeworICAgICAgICAgICAgdmFsaWRhdGVSYW5nZShtaW5pbXVtLCBwcmVmZXJlZCwgMCwgMjQpOworICAgICAgICAgICAgaWYgKFEgPCAwLjBmIHx8IFEgPiAxLjBmKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiUXVhbGl0eSBvdXQgb2YgMC0xIHJhbmdlLiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVNhbXBsZXNNaW4gPSBtaW5pbXVtOworICAgICAgICAgICAgbVNhbXBsZXNQcmVmID0gcHJlZmVyZWQ7CisgICAgICAgICAgICBtU2FtcGxlc1EgPSBROworICAgICAgICB9CisgICAgfTsKKworICAgIFN1cmZhY2VDb25maWcgbVN1cmZhY2VDb25maWc7CisKKyAgICBwdWJsaWMgdm9pZCBjb25maWd1cmVTdXJmYWNlKFN1cmZhY2VIb2xkZXIgc2gpIHsKKyAgICAgICAgaWYgKG1TdXJmYWNlQ29uZmlnLm1BbHBoYU1pbiA+IDEpIHsKKyAgICAgICAgICAgIHNoLnNldEZvcm1hdChQaXhlbEZvcm1hdC5SR0JBXzg4ODgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc2guc2V0Rm9ybWF0KFBpeGVsRm9ybWF0LlJHQlhfODg4OCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBjaGVja1N1cmZhY2UoU3VyZmFjZUhvbGRlciBzaCkgeworICAgIH0KKworICAgIHB1YmxpYyBSZW5kZXJTY3JpcHRHTChTdXJmYWNlQ29uZmlnIHNjKSB7CisgICAgICAgIG1TdXJmYWNlQ29uZmlnID0gbmV3IFN1cmZhY2VDb25maWcoc2MpOworCiAgICAgICAgIG1TdXJmYWNlID0gbnVsbDsKICAgICAgICAgbVdpZHRoID0gMDsKICAgICAgICAgbUhlaWdodCA9IDA7CiAgICAgICAgIG1EZXYgPSBuRGV2aWNlQ3JlYXRlKCk7Ci0gICAgICAgIGlmKGZvcmNlU1cpIHsKLSAgICAgICAgICAgIG5EZXZpY2VTZXRDb25maWcobURldiwgMCwgMSk7Ci0gICAgICAgIH0KLSAgICAgICAgbUNvbnRleHQgPSBuQ29udGV4dENyZWF0ZUdMKG1EZXYsIDAsIHVzZURlcHRoKTsKKyAgICAgICAgbUNvbnRleHQgPSBuQ29udGV4dENyZWF0ZUdMKG1EZXYsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZUNvbmZpZy5tQ29sb3JNaW4sIG1TdXJmYWNlQ29uZmlnLm1Db2xvclByZWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZUNvbmZpZy5tQWxwaGFNaW4sIG1TdXJmYWNlQ29uZmlnLm1BbHBoYVByZWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZUNvbmZpZy5tRGVwdGhNaW4sIG1TdXJmYWNlQ29uZmlnLm1EZXB0aFByZWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZUNvbmZpZy5tU3RlbmNpbE1pbiwgbVN1cmZhY2VDb25maWcubVN0ZW5jaWxQcmVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN1cmZhY2VDb25maWcubVNhbXBsZXNNaW4sIG1TdXJmYWNlQ29uZmlnLm1TYW1wbGVzUHJlZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TdXJmYWNlQ29uZmlnLm1TYW1wbGVzUSk7CiAgICAgICAgIG1NZXNzYWdlVGhyZWFkID0gbmV3IE1lc3NhZ2VUaHJlYWQodGhpcyk7CiAgICAgICAgIG1NZXNzYWdlVGhyZWFkLnN0YXJ0KCk7CiAgICAgICAgIEVsZW1lbnQuaW5pdFByZWRlZmluZWQodGhpcyk7CkBAIC01Nyw2ICsxNDEsMTMgQEAKICAgICAgICAgbkNvbnRleHRTZXRTdXJmYWNlKHcsIGgsIG1TdXJmYWNlKTsKICAgICB9CiAKKyAgICBwdWJsaWMgaW50IGdldEhlaWdodCgpIHsKKyAgICAgICAgcmV0dXJuIG1IZWlnaHQ7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRXaWR0aCgpIHsKKyAgICAgICAgcmV0dXJuIG1XaWR0aDsKKyAgICB9CiAKICAgICB2b2lkIHBhdXNlKCkgewogICAgICAgICB2YWxpZGF0ZSgpOwpAQCAtNzQsOSArMTY1LDkgQEAKICAgICAgICAgbkNvbnRleHRCaW5kUm9vdFNjcmlwdChzYWZlSUQocykpOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIGNvbnRleHRCaW5kUHJvZ3JhbUZyYWdtZW50U3RvcmUoUHJvZ3JhbVN0b3JlIHApIHsKKyAg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ICB9CisKKyAgICBwdWJsaWMgc3RhdGljIFNhbXBsZXIgQ0xBTVBfTElORUFSX01JUF9MSU5FQVIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1TYW1wbGVyX0NMQU1QX0xJTkVBUl9NSVBfTElORUFSID09IG51bGwpIHsKKyAgICAgICAgICAgIEJ1aWxkZXIgYiA9IG5ldyBCdWlsZGVyKHJzKTsKKyAgICAgICAgICAgIGIuc2V0TWluKFZhbHVlLkxJTkVBUl9NSVBfTElORUFSKTsKKyAgICAgICAgICAgIGIuc2V0TWFnKFZhbHVlLkxJTkVBUik7CisgICAgICAgICAgICBiLnNldFdyYXBTKFZhbHVlLkNMQU1QKTsKKyAgICAgICAgICAgIGIuc2V0V3JhcFQoVmFsdWUuQ0xBTVApOworICAgICAgICAgICAgcnMubVNhbXBsZXJfQ0xBTVBfTElORUFSX01JUF9MSU5FQVIgPSBiLmNyZWF0ZSgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tU2FtcGxlcl9DTEFNUF9MSU5FQVJfTUlQX0xJTkVBUjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIFNhbXBsZXIgV1JBUF9ORUFSRVNUKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tU2FtcGxlcl9XUkFQX05FQVJFU1QgPT0gbnVsbCkgeworICAgICAgICAgICAgQnVpbGRlciBiID0gbmV3IEJ1aWxkZXIocnMpOworICAgICAgICAgICAgYi5zZXRNaW4oVmFsdWUuTkVBUkVTVCk7CisgICAgICAgICAgICBiLnNldE1hZyhWYWx1ZS5ORUFSRVNUKTsKKyAgICAgICAgICAgIGIuc2V0V3JhcFMoVmFsdWUuV1JBUCk7CisgICAgICAgICAgICBiLnNldFdyYXBUKFZhbHVlLldSQVApOworICAgICAgICAgICAgcnMubVNhbXBsZXJfV1JBUF9ORUFSRVNUID0gYi5jcmVhdGUoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubVNhbXBsZXJfV1JBUF9ORUFSRVNUOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgU2FtcGxlciBXUkFQX0xJTkVBUihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubVNhbXBsZXJfV1JBUF9MSU5FQVIgPT0gbnVsbCkgeworICAgICAgICAgICAgQnVpbGRlciBiID0gbmV3IEJ1aWxkZXIocnMpOworICAgICAgICAgICAgYi5zZXRNaW4oVmFsdWUuTElORUFSKTsKKyAgICAgICAgICAgIGIuc2V0TWFnKFZhbHVlLkxJTkVBUik7CisgICAgICAgICAgICBiLnNldFdyYXBTKFZhbHVlLldSQVApOworICAgICAgICAgICAgYi5zZXRXcmFwVChWYWx1ZS5XUkFQKTsKKyAgICAgICAgICAgIHJzLm1TYW1wbGVyX1dSQVBfTElORUFSID0gYi5jcmVhdGUoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubVNhbXBsZXJfV1JBUF9MSU5FQVI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBTYW1wbGVyIFdSQVBfTElORUFSX01JUF9MSU5FQVIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1TYW1wbGVyX1dSQVBfTElORUFSX01JUF9MSU5FQVIgPT0gbnVsbCkgeworICAgICAgICAgICAgQnVpbGRlciBiID0gbmV3IEJ1aWxkZXIocnMpOworICAgICAgICAgICAgYi5zZXRNaW4oVmFsdWUuTElORUFSX01JUF9MSU5FQVIpOworICAgICAgICAgICAgYi5zZXRNYWcoVmFsdWUuTElORUFSKTsKKyAgICAgICAgICAgIGIuc2V0V3JhcFMoVmFsdWUuV1JBUCk7CisgICAgICAgICAgICBiLnNldFdyYXBUKFZhbHVlLldSQVApOworICAgICAgICAgICAgcnMubVNhbXBsZXJfV1JBUF9MSU5FQVJfTUlQX0xJTkVBUiA9IGIuY3JlYXRlKCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1TYW1wbGVyX1dSQVBfTElORUFSX01JUF9MSU5FQVI7CisgICAgfQorCisKICAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgewogICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOwogICAgICAgICBWYWx1ZSBtTWluOwpAQCAtNTgsNiArMTMwLDcgQEAKICAgICAgICAgVmFsdWUgbVdyYXBTOwogICAgICAgICBWYWx1ZSBtV3JhcFQ7CiAgICAgICAgIFZhbHVlIG1XcmFwUjsKKyAgICAgICAgZmxvYXQgbUFuaXNvOwogCiAgICAgICAgIHB1YmxpYyBCdWlsZGVyKFJlbmRlclNjcmlwdCBycykgewogICAgICAgICAgICAgbVJTID0gcnM7CkBAIC02Niw2ICsxMzksNyBAQAogICAgICAgICAgICAgbVdyYXBTID0gVmFsdWUuV1JBUDsKICAgICAgICAgICAgIG1XcmFwVCA9IFZhbHVlLldSQVA7CiAgICAgICAgICAgICBtV3JhcFIgPSBWYWx1ZS5XUkFQOworICAgICAgICAgICAgbUFuaXNvID0gMS4wZjsKICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIHNldE1pbihWYWx1ZSB2KSB7CkBAIC0xMTAsNiArMTg0LDE0IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAorICAgICAgICBwdWJsaWMgdm9pZCBzZXRBbmlzb3Ryb3B5KGZsb2F0IHYpIHsKKyAgICAgICAgICAgIGlmKHYgPj0gMC4wZikgeworICAgICAgICAgICAgICAgIG1BbmlzbyA9IHY7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkludmFsaWQgdmFsdWUiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCiAgICAgICAgIHN0YXRpYyBzeW5jaHJvbml6ZWQgU2FtcGxlciBpbnRlcm5hbENyZWF0ZShSZW5kZXJTY3JpcHQgcnMsIEJ1aWxkZXIgYik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goZmxvYXQgZCkgewotICAgICAgICBtUlMudmFsaWRhdGUoKTsKLSAgICAgICAgbVJTLm5TY3JpcHRTZXRDbGVhckRlcHRoKG1JRCwgZCk7CisgICAgcHVibGljIHZvaWQgc2V0VmFyKGludCBpbmRleCwgZG91YmxlIHYpIHsKKyAgICAgICAgbVJTLm5TY3JpcHRTZXRWYXJEKG1JRCwgaW5kZXgsIHYpOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIHNldENsZWFyU3RlbmNpbChpbnQgc3RlbmNpbCkgewotICAgICAgICBtUlMudmFsaWRhdGUoKTsKLSAgICAgICAgbVJTLm5TY3JpcHRTZXRDbGVhclN0ZW5jaWwobUlELCBzdGVuY2lsKTsKKyAgICBwdWJsaWMgdm9pZCBzZXRWYXIoaW50IGluZGV4LCBpbnQgdikgeworICAgICAgICBtUlMublNjcmlwdFNldFZhckkobUlELCBpbmRleCwgdik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0VmFyKGludCBpbmRleCwgbG9uZyB2KSB7CisgICAgICAgIG1SUy5uU2NyaXB0U2V0VmFySihtSUQsIGluZGV4LCB2KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRWYXIoaW50IGluZGV4LCBib29sZWFuIHYpIHsKKyAgICAgICAgbVJTLm5TY3JpcHRTZXRWYXJJKG1JRCwgaW5kZXgsIHYgPyAxIDogMCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0VmFyKGludCBpbmRleCwgRmllbGRQYWNrZXIgdikgeworICAgICAgICBtUlMublNjcmlwdFNldFZhclYobUlELCBpbmRleCwgdi5nZXREYXRhKCkpOwogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIHNldFRpbWVab25lKFN0cmluZyB0aW1lWm9uZSkgewpAQCAtNzgsNzIgKzEwMywzOSBAQAogCiAgICAgcHVibGljIHN0YXRpYyBjbGFzcyBCdWlsZGVyIHsKICAgICAgICAgUmVuZGVyU2NyaXB0IG1SUzsKLSAgICAgICAgYm9vbGVhbiBtSXNSb290ID0gZmFsc2U7Ci0gICAgICAgIFR5cGVbXSBtVHlwZXM7Ci0gICAgICAgIFN0cmluZ1tdIG1OYW1lczsKLSAgICAgICAgYm9vbGVhbltdIG1Xcml0YWJsZTsKLSAgICAgICAgaW50IG1JbnZva2FibGVDb3VudCA9IDA7Ci0gICAgICAgIEludm9rYWJsZVtdIG1JbnZva2FibGVzOwogCiAgICAgICAgIEJ1aWxkZXIoUmVuZGVyU2NyaXB0IHJzKSB7CiAgICAgICAgICAgICBtUlMgPSByczsKLSAgICAgICAgICAgIG1UeXBlcyA9IG5ldyBUeXBlW01BWF9TTE9UXTsKLSAgICAgICAgICAgIG1OYW1lcyA9IG5ldyBTdHJpbmdbTUFYX1NMT1RdOwotICAgICAgICAgICAgbVdyaXRhYmxlID0gbmV3IGJvb2xlYW5bTUFYX1NMT1RdOwotICAgICAgICAgICAgbUludm9rYWJsZXMgPSBuZXcgSW52b2thYmxlW01BWF9TTE9UXTsKICAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldFR5cGUoVHlwZSB0LCBpbnQgc2xvdCkgewotICAgICAgICAgICAgbVR5cGVzW3Nsb3RdID0gdDsKLSAgICAgICAgICAgIG1OYW1lc1tzbG90XSA9IG51bGw7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzZXRUeXBlKFR5cGUgdCwgU3RyaW5nIG5hbWUsIGludCBzbG90KSB7Ci0gICAgICAgICAgICBtVHlwZXNbc2xvdF0gPSB0OwotICAgICAgICAgICAgbU5hbWVzW3Nsb3RdID0gbmFtZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBJbnZva2FibGUgYWRkSW52b2thYmxlKFN0cmluZyBmdW5jKSB7Ci0gICAgICAgICAgICBJbnZva2FibGUgaSA9IG5ldyBJbnZva2FibGUoKTsKLSAgICAgICAgICAgIGkubU5hbWUgPSBmdW5jOwotICAgICAgICAgICAgaS5tUlMgPSBtUlM7Ci0gICAgICAgICAgICBpLm1TbG90ID0gbUludm9rYWJsZUNvdW50OwotICAgICAgICAgICAgbUludm9rYWJsZXNbbUludm9rYWJsZUNvdW50KytdID0gaTsKLSAgICAgICAgICAgIHJldHVybiBpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0VHlwZShib29sZWFuIHdyaXRhYmxlLCBpbnQgc2xvdCkgewotICAgICAgICAgICAgbVdyaXRhYmxlW3Nsb3RdID0gd3JpdGFibGU7Ci0gICAgICAgIH0KLQotICAgICAgICB2b2lkIHRyYW5zZmVyQ3JlYXRlKCkgewotICAgICAgICAgICAgbVJTLm5TY3JpcHRTZXRSb290KG1Jc1Jvb3QpOwotICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IG1UeXBlcy5sZW5ndGg7IGN0KyspIHsKLSAgICAgICAgICAgICAgICBpZihtVHlwZXNbY3RdICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgbVJTLm5TY3JpcHRTZXRUeXBlKG1UeXBlc1tjdF0ubUlELCBtV3JpdGFibGVbY3RdLCBtTmFtZXNbY3RdLCBjdCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IG1JbnZva2FibGVDb3VudDsgY3QrKykgewotICAgICAgICAgICAgICAgIG1SUy5uU2NyaXB0U2V0SW52b2thYmxlKG1JbnZva2FibGVzW2N0XS5tTmFtZSwgY3QpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCB0cmFuc2Zlck9iamVjdChTY3JpcHQgcykgewotICAgICAgICAgICAgcy5tSXNSb290ID0gbUlzUm9vdDsKLSAgICAgICAgICAgIHMubVR5cGVzID0gbVR5cGVzOwotICAgICAgICAgICAgcy5tSW52b2thYmxlcyA9IG5ldyBJbnZva2FibGVbbUludm9rYWJsZUNvdW50XTsKLSAgICAgICAgICAgIGZvcihpbnQgY3Q9MDsgY3QgPCBtSW52b2thYmxlQ291bnQ7IGN0KyspIHsKLSAgICAgICAgICAgICAgICBzLm1JbnZva2FibGVzW2N0XSA9IG1JbnZva2FibGVzW2N0XTsKLSAgICAgICAgICAgICAgICBzLm1JbnZva2FibGVzW2N0XS5tU2NyaXB0ID0gczsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHMubUludm9rYWJsZXMgPSBudWxsOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0Um9vdChib29sZWFuIHIpIHsKLSAgICAgICAgICAgIG1Jc1Jvb3QgPSByOwotICAgICAgICB9Ci0KICAgICB9CiAKKworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgRmllbGRCYXNlIHsKKyAgICAgICAgcHJvdGVjdGVkIEVsZW1lbnQgbUVsZW1lbnQ7CisgICAgICAgIHByb3RlY3RlZCBBbGxvY2F0aW9uIG1BbGxvY2F0aW9uOworCisgICAgICAgIHByb3RlY3RlZCB2b2lkIGluaXQoUmVuZGVyU2NyaXB0IHJzLCBpbnQgZGlteCkgeworICAgICAgICAgICAgbUFsbG9jYXRpb24gPSBBbGxvY2F0aW9uLmNyZWF0ZVNpemVkKHJzLCBtRWxlbWVudCwgZGlteCk7CisgICAgICAgIH0KKworICAgICAgICBwcm90ZWN0ZWQgRmllbGRCYXNlKCkgeworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEVsZW1lbnQgZ2V0RWxlbWVudCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtRWxlbWVudDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBUeXBlIGdldFR5cGUoKSB7CisgICAgICAgICAgICByZXR1cm4gbUFsbG9jYXRpb24uZ2V0VHlwZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEFsbG9jYXRpb24gZ2V0QWxsb2NhdGlvbigpIHsKKyAgICAgICAgICAgIHJldHVybiBtQWxsb2NhdGlvbjsKKyAgICAgICAgfQ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IAotICAgICAgICBwdWJsaWMgQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgICAgIHN1cGVyKHJzKTsKLSAgICAgICAgfQogCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldFNjcmlwdChTdHJpbmcgcykgeworICAgIHByaXZhdGUgc3RhdGljIHN5bmNocm9uaXplZCBpbnQgaW50ZXJuYWxDcmVhdGUoUmVuZGVyU2NyaXB0IHJzLCBSZXNvdXJjZXMgcmVzb3VyY2VzLCBpbnQgcmVzb3VyY2VJRCkgeworICAgICAgICBieXRlW10gcGdtOworICAgICAgICBpbnQgcGdtTGVuZ3RoOworICAgICAgICBJbnB1dFN0cmVhbSBpcyA9IHJlc291cmNlcy5vcGVuUmF3UmVzb3VyY2UocmVzb3VyY2VJRCk7CisgICAgICAgIHRyeSB7CiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gcy5nZXRCeXRlcygiVVRGLTgiKTsKLSAgICAgICAgICAgICAgICBtUHJvZ3JhbUxlbmd0aCA9IG1Qcm9ncmFtLmxlbmd0aDsKLSAgICAgICAgICAgIH0gY2F0Y2ggKGphdmEuaW8uVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzZXRTY3JpcHQoUmVzb3VyY2VzIHJlc291cmNlcywgaW50IGlkKSB7Ci0gICAgICAgICAgICBJbnB1dFN0cmVhbSBpcyA9IHJlc291cmNlcy5vcGVuUmF3UmVzb3VyY2UoaWQpOwotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBzZXRTY3JpcHQoaXMpOwotICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgIGlzLmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBjYXRjaChJT0V4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJlc291cmNlcy5Ob3RGb3VuZEV4Y2VwdGlvbigpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0U2NyaXB0KElucHV0U3RyZWFtIGlzKSB0aHJvd3MgSU9FeGNlcHRpb24gewotICAgICAgICAgICAgYnl0ZVtdIGJ1ZiA9IG5ldyBieXRlWzEwMjRdOwotICAgICAgICAgICAgaW50IGN1cnJlbnRQb3MgPSAwOwotICAgICAgICAgICAgd2hpbGUodHJ1ZSkgewotICAgICAgICAgICAgICAgIGludCBieXRlc0xlZnQgPSBidWYubGVuZ3RoIC0gY3VycmVudFBvczsKLSAgICAgICAgICAgICAgICBpZiAoYnl0ZXNMZWZ0ID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgYnl0ZVtdIGJ1ZjIgPSBuZXcgYnl0ZVtidWYubGVuZ3RoICogMl07Ci0gICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoYnVmLCAwLCBidWYyLCAwLCBidWYubGVuZ3RoKTsKLSAgICAgICAgICAgICAgICAgICAgYnVmID0gYnVmMjsKLSAgICAgICAgICAgICAgICAgICAgYnl0ZXNMZWZ0ID0gYnVmLmxlbmd0aCAtIGN1cnJlbnRQb3M7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGludCBieXRlc1JlYWQgPSBpcy5yZWFkKGJ1ZiwgY3VycmVudFBvcywgYnl0ZXNMZWZ0KTsKLSAgICAgICAgICAgICAgICBpZiAoYnl0ZXNSZWFkIDw9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGN1cnJlbnRQb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AgICAgICBwdWJsaWMgdm9pZCBhZGREZWZpbmUoU3RyaW5nIG5hbWUsIGludCB2YWx1ZSkgewotICAgICAgICAgICAgbUludERlZmluZXMucHV0KG5hbWUsIHZhbHVlKTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIGFkZERlZmluZShTdHJpbmcgbmFtZSwgZmxvYXQgdmFsdWUpIHsKLSAgICAgICAgICAgIG1GbG9hdERlZmluZXMucHV0KG5hbWUsIHZhbHVlKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qKgotICAgICAgICAgKiBUYWtlcyB0aGUgYWxsIHB1YmxpYyBzdGF0aWMgZmluYWwgZmllbGRzIGZvciBhIGNsYXNzLCBhbmQgYWRkcyBkZWZpbmVzCi0gICAgICAgICAqIGZvciB0aGVtLCB1c2luZyB0aGUgbmFtZSBvZiB0aGUgZmllbGQgYXMgdGhlIG5hbWUgb2YgdGhlIGRlZmluZS4KLSAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyB2b2lkIGFkZERlZmluZXMoQ2xhc3MgY2wpIHsKLSAgICAgICAgICAgIGFkZERlZmluZXMoY2wuZ2V0RmllbGRzKCksIChNb2RpZmllci5TVEFUSUMgfCBNb2RpZmllci5GSU5BTCB8IE1vZGlmaWVyLlBVQkxJQyksIG51bGwpOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqCi0gICAgICAgICAqIFRha2VzIHRoZSBhbGwgcHVibGljIGZpZWxkcyBmb3IgYW4gb2JqZWN0LCBhbmQgYWRkcyBkZWZpbmVzCi0gICAgICAgICAqIGZvciB0aGVtLCB1c2luZyB0aGUgbmFtZSBvZiB0aGUgZmllbGQgYXMgdGhlIG5hbWUgb2YgdGhlIGRlZmluZS4KLSAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyB2b2lkIGFkZERlZmluZXMoT2JqZWN0IG8pIHsKLSAgICAgICAgICAgIGFkZERlZmluZXMoby5nZXRDbGFzcygpLmdldEZpZWxkcygpLCBNb2RpZmllci5QVUJMSUMsIG8pOwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCBhZGREZWZpbmVzKEZpZWxkW10gZmllbGRzLCBpbnQgbWFzaywgT2JqZWN0IG8pIHsKLSAgICAgICAgICAgIGZvciAoRmllbGQgZjogZmllbGRzKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChmLmdldE1vZGlmaWVycygpICYgbWFzaykgPT0gbWFzaykgewotICAgICAgICAgICAgICAgICAgICAgICAgQ2xhc3MgdCA9IGYuZ2V0VHlwZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQgPT0gaW50LmNsYXNzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUludERlZmluZXMucHV0KGYuZ2V0TmFtZSgpLCBmLmdldEludChvKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh0ID09IGZsb2F0LmNsYXNzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZsb2F0RGVmaW5lcy5wdXQoZi5nZXROYW1lKCksIGYuZ2V0RmxvYXQobykpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBnbSA9IG5ldyBieXRlWzEwMjRdOworICAgICAgICAgICAgICAgIHBnbUxlbmd0aCA9IDA7CisgICAgICAgICAgICAgICAgd2hpbGUodHJ1ZSkgeworICAgICAgICAgICAgICAgICAgICBpbnQgYnl0ZXNMZWZ0ID0gcGdtLmxlbmd0aCAtIHBnbUxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGJ5dGVzTGVmdCA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBieXRlW10gYnVmMiA9IG5ldyBieXRlW3BnbS5sZW5ndGggKiAyXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkocGdtLCAwLCBidWYyLCAwLCBwZ20ubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBnbSA9IGJ1ZjI7CisgICAgICAgICAgICAgICAgICAgICAgICBieXRlc0xlZnQgPSBwZ20ubGVuZ3RoIC0gcGdtTGVuZ3RoOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoSWxsZWdhbEFjY2Vzc0V4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBEbyB3ZSB3YW50IHRoaXMgbG9nPwotICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJhZGREZWZpbmVzIHNraXBwaW5nIGZpZWxkICIgKyBmLmdldE5hbWUoKSk7CisgICAgICAgICAgICAgICAgICAgIGludCBieXRlc1JlYWQgPSBpcy5yZWFkKHBnbSwgcGdtTGVuZ3RoLCBieXRlc0xlZnQpOworICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNSZWFkIDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHBnbUxlbmd0aCArPSBieXRlc1JlYWQ7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBpcy5jbG9zZSgpOwogICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSZXNvdXJjZXMuTm90Rm91bmRFeGNlcHRpb24oKTsKICAgICAgICAgfQogCi0gICAgICAgIHB1YmxpYyBTY3JpcHRDIGNyZWF0ZSgpIHsKLSAgICAgICAgICAgIHJldHVybiBpbnRlcm5hbENyZWF0ZSh0aGlzKTsKLSAgICAgICAgfQorICAgICAgICBycy5uU2NyaXB0Q0JlZ2luKCk7CisgICAgICAgIHJzLm5TY3JpcHRDU2V0U2N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ICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiTWF4IHZlcnRleCB0eXBlcyBleGNlZWRlZC4iKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaW50IGFkZGVkSW5kZXggPSBtVmVydGV4VHlwZUNvdW50OwotICAgICAgICAgICAgbVZlcnRleFR5cGVzW21WZXJ0ZXhUeXBlQ291bnRdID0gbmV3IEVudHJ5KCk7Ci0gICAgICAgICAgICBtVmVydGV4VHlwZXNbbVZlcnRleFR5cGVDb3VudF0uZSA9IGU7Ci0gICAgICAgICAgICBtVmVydGV4VHlwZXNbbVZlcnRleFR5cGVDb3VudF0uc2l6ZSA9IHNpemU7Ci0gICAgICAgICAgICBtVmVydGV4VHlwZUNvdW50Kys7Ci0gICAgICAgICAgICByZXR1cm4gYWRkZWRJbmRleDsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldEluZGV4VHlwZShUeXBlIHQpIHsKLSAgICAgICAgICAgIG1JbmRleFR5cGUudCA9IHQ7Ci0gICAgICAgICAgICBtSW5kZXhUeXBlLmUgPSBudWxsOwotICAgICAgICAgICAgbUluZGV4VHlwZS5zaXplID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldEluZGV4VHlwZShFbGVtZW50IGUsIGludCBzaXplKSB7Ci0gICAgICAgICAgICBtSW5kZXhUeXBlLnQgPSBudWxsOwotICAgICAgICAgICAgbUluZGV4VHlwZS5lID0gZTsKLSAgICAgICAgICAgIG1JbmRleFR5cGUuc2l6ZSA9IHNpemU7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzZXRQcmltaXRpdmUoUHJpbWl0aXZlIHApIHsKLSAgICAgICAgICAgIG1QcmltaXRpdmUgPSBwOwotICAgICAgICB9Ci0KLQotICAgICAgICBUeXBlIG5ld1R5cGUoRWxlbWVudCBlLCBpbnQgc2l6ZSkgewotICAgICAgICAgICAgVHlwZS5CdWlsZGVyIHRiID0gbmV3IFR5cGUuQnVpbGRlcihtUlMsIGUpOwotICAgICAgICAgICAgdGIuYWRkKERpbWVuc2lvbi5YLCBzaXplKTsKLSAgICAgICAgICAgIHJldHVybiB0Yi5jcmVhdGUoKTsKLSAgICAgICAgfQotCi0gICAgICAgIHN0YXRpYyBzeW5jaHJvbml6ZWQgU2ltcGxlTWVzaCBpbnRlcm5hbENyZWF0ZShSZW5kZXJTY3JpcHQgcnMsIEJ1aWxkZXIgYikgewotICAgICAgICAgICAgVHlwZVtdIHRvRGVzdHJveSA9IG5ldyBUeXBlWzE4XTsKLSAgICAgICAgICAgIGludCB0b0Rlc3Ryb3lDb3VudCA9IDA7Ci0KLSAgICAgICAgICAgIGludCBpbmRleElEID0gMDsKLSAgICAgICAgICAgIGlmIChiLm1JbmRleFR5cGUudCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaW5kZXhJRCA9IGIubUluZGV4VHlwZS50Lm1JRDsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoYi5tSW5kZXhUeXBlLnNpemUgIT0gMCkgewotICAgICAgICAgICAgICAgIGIubUluZGV4VHlwZS50ID0gYi5uZXdUeXBlKGIubUluZGV4VHlwZS5lLCBiLm1JbmRleFR5cGUuc2l6ZSk7Ci0gICAgICAgICAgICAgICAgaW5kZXhJRCA9IGIubUluZGV4VHlwZS50Lm1JRDsKLSAgICAgICAgICAgICAgICB0b0Rlc3Ryb3lbdG9EZXN0cm95Q291bnQrK10gPSBiLm1JbmRleFR5cGUudDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaW50W10gSURzID0gbmV3IGludFtiLm1WZXJ0ZXhUeXBlQ291bnRdOwotICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IGIubVZlcnRleFR5cGVDb3VudDsgY3QrKykgewotICAgICAgICAgICAgICAgIGlmIChiLm1WZXJ0ZXhUeXBlc1tjdF0udCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIElEc1tjdF0gPSBiLm1WZXJ0ZXhUeXBlc1tjdF0udC5tSUQ7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYi5tVmVydGV4VHlwZXNbY3RdLnQgPSBiLm5ld1R5cGUoYi5tVmVydGV4VHlwZXNbY3RdLmUsIGIubVZlcnRleFR5cGVzW2N0XS5zaXplKTsKLSAgICAgICAgICAgICAgICAgICAgSURzW2N0XSA9IGIubVZlcnRleFR5cGVzW2N0XS50Lm1JRDsKLSAgICAgICAgICAgICAgICAgICAgdG9EZXN0cm95W3RvRGVzdHJveUNvdW50KytdID0gYi5tVmVydGV4VHlwZXNbY3RdLnQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpbnQgaWQgPSBycy5uU2ltcGxlTWVzaENyZWF0ZSgwLCBpbmRleElELCBJRHMsIGIubVByaW1pdGl2ZS5tSUQpOwotICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IHRvRGVzdHJveUNvdW50OyBjdCsrKSB7Ci0gICAgICAgICAgICAgICAgdG9EZXN0cm95W2N0XS5kZXN0cm95KCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBuZXcgU2ltcGxlTWVzaChpZCwgcnMpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIFNpbXBsZU1lc2ggY3JlYXRlKCkgewotICAgICAgICAgICAgbVJTLnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICBTaW1wbGVNZXNoIHNtID0gaW50ZXJuYWxDcmVhdGUobVJTLCB0aGlzKTsKLSAgICAgICAgICAgIHNtLm1WZXJ0ZXhUeXBlcyA9IG5ldyBUeXBlW21WZXJ0ZXhUeXBlQ291bnRdOwotICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IG1WZXJ0ZXhUeXBlQ291bnQ7IGN0KyspIHsKLSAgICAgICAgICAgICAgICBzbS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WlsZGVyKFJlbmRlclNjcmlwdCBycywgaW50IHZ0eFNpemUsIGludCBmbGFncykgewotICAgICAgICAgICAgbVJTID0gcnM7Ci0gICAgICAgICAgICBtVnR4Q291bnQgPSAwOwotICAgICAgICAgICAgbUluZGV4Q291bnQgPSAwOwotICAgICAgICAgICAgbVZ0eERhdGEgPSBuZXcgZmxvYXRbMTI4XTsKLSAgICAgICAgICAgIG1JbmRleERhdGEgPSBuZXcgc2hvcnRbMTI4XTsKLSAgICAgICAgICAgIG1WdHhTaXplID0gdnR4U2l6ZTsKLSAgICAgICAgICAgIG1GbGFncyA9IGZsYWdzOwotCi0gICAgICAgICAgICBpZiAodnR4U2l6ZSA8IDIgfHwgdnR4U2l6ZSA+IDMpIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJWZXJ0ZXggc2l6ZSBvdXQgb2YgcmFuZ2UuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHZvaWQgbWFrZVNwYWNlKGludCBjb3VudCkgewotICAgICAgICAgICAgaWYgKChtVnR4Q291bnQgKyBjb3VudCkgPj0gbVZ0eERhdGEubGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdFtdID0gbmV3IGZsb2F0W21WdHhEYXRhLmxlbmd0aCAqIDJdOwotICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkobVZ0eERhdGEsIDAsIHQsIDAsIG1WdHhEYXRhLmxlbmd0aCk7Ci0gICAgICAgICAgICAgICAgbVZ0eERhdGEgPSB0OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIGxhdGNoKCkgewotICAgICAgICAgICAgaWYgKChtRmxhZ3MgJiBDT0xPUikgIT0gMCkgewotICAgICAgICAgICAgICAgIG1ha2VTcGFjZSg0KTsKLSAgICAgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBtUjsKLSAgICAgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBtRzsKLSAgICAgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBtQjsKLSAgICAgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBtQTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICgobUZsYWdzICYgVEVYVFVSRV8wKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgbWFrZVNwYWNlKDIpOwotICAgICAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IG1TMDsKLSAgICAgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBtVDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKG1GbGFncyAmIE5PUk1BTCkgIT0gMCkgewotICAgICAgICAgICAgICAgIG1ha2VTcGFjZSgzKTsKLSAgICAgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBtTlg7Ci0gICAgICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gbU5ZOwotICAgICAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IG1OWjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIGFkZFZlcnRleChmbG9hdCB4LCBmbG9hdCB5KSB7Ci0gICAgICAgICAgICBpZiAobVZ0eFNpemUgIT0gMikgewotICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImFkZCBtaXN0bWF0Y2ggd2l0aCBkZWNsYXJlZCBjb21wb25lbnRzLiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbWFrZVNwYWNlKDIpOwotICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0geDsKLSAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHk7Ci0gICAgICAgICAgICBsYXRjaCgpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgYWRkVmVydGV4KGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopIHsKLSAgICAgICAgICAgIGlmIChtVnR4U2l6ZSAhPSAzKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiYWRkIG1pc3RtYXRjaCB3aXRoIGRlY2xhcmVkIGNvbXBvbmVudHMuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtYWtlU3BhY2UoMyk7Ci0gICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSB4OwotICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0geTsKLSAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHo7Ci0gICAgICAgICAgICBsYXRjaCgpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0VGV4dHVyZShmbG9hdCBzLCBmbG9hdCB0KSB7Ci0gICAgICAgICAgICBpZiAoKG1GbGFncyAmIFRFWFRVUkVfMCkgPT0gMCkgewotICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImFkZCBtaXN0bWF0Y2ggd2l0aCBkZWNsYXJlZCBjb21wb25lbnRzLiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVMwID0gczsKLSAgICAgICAgICAgIG1UMCA9IHQ7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzZXROb3JtYWwoZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgewotICAgICAgICAgICAgaWYgKChtRmxhZ3MgJiBOT1JNQUwpID09IDApIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJhZGQgbWlzdG1hdGNoIHdpdGggZGVjbGFyZWQgY29tcG9uZW50cy4iKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1OWCA9IHg7Ci0gICAgICAgICAgICBtTlkgPSB5OwotICAgICAgICAgICAgbU5aID0gejsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldENvbG9yKGZsb2F0IHIsIGZsb2F0IGcsIGZsb2F0IGIsIGZsb2F0IGEpIHsKLSAgICAgICAgICAgIGlmICgobUZsYWdzICYgQ09MT1IpID09IDApIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJhZGQgbWlzdG1hdGNoIHdpdGggZGVjbGFyZWQgY29tcG9uZW50cy4iKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1SID0gcjsKLSAgICAgICAgICAgIG1HID0gZzsKLSAgICAgICAgICAgIG1CID0gYjsKLSAgICAgICAgICAgIG1BID0gYTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIGFkZFRyaWFuZ2xlKGludCBpZHgxLCBpbnQgaWR4MiwgaW50IGlkeDMpIHsKLSAgICAgICAgICAgIGlmKChpZHgxID49IG1WdHhDb3VudCkgfHwgKGlkeDEgPCAwKSB8fAotICAgICAgICAgICAgICAgKGlkeDIgPj0gbVZ0eENvdW50KSB8fCAoaWR4MiA8IDApIHx8Ci0gICAgICAgICAgICAgICAoaWR4MyA+PSBtVnR4Q291bnQpIHx8IChpZHgzIDwgMCkpIHsKLSAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkluZGV4IHByb3ZpZGVkIGdyZWF0ZXIgdGhhbiB2ZXJ0ZXggY291bnQuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKG1JbmRleENvdW50ICsgMykgPj0gbUluZGV4RGF0YS5sZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBzaG9ydCB0W10gPSBuZXcgc2hvcnRbbUluZGV4RGF0YS5sZW5ndGggKiAyXTsKLSAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1JbmRleERhdGEsIDAsIHQsIDAsIG1JbmRleERhdGEubGVuZ3RoKTsKLSAgICAgICAgICAgICAgICBtSW5kZXhEYXRhID0gdDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1JbmRleERhdGFbbUluZGV4Q291bnQrK10gPSAoc2hvcnQpaWR4MTsKLSAgICAgICAgICAgIG1JbmRleERhdGFbbUluZGV4Q291bnQrK10gPSAoc2hvcnQpaWR4MjsKLSAgICAgICAgICAgIG1JbmRleERhdGFbbUluZGV4Q291bnQrK10gPSAoc2hvcnQpaWR4MzsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBTaW1wbGVNZXNoIGNyZWF0ZSgpIHsKLSAgICAgICAgICAgIEVsZW1lbnQuQnVpbGRlciBiID0gbmV3IEVsZW1lbnQuQnVpbGRlcihtUlMpOwotICAgICAgICAgICAgaW50IGZsb2F0Q291bnQgPSBtVnR4U2l6ZTsKLSAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuY3JlYXRlQXR0cmliKG1SUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsZW1lbnQuRGF0YVR5cGUuRkxPQVRfMzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50LkRhdGFLaW5kLlBPU0lUSU9OLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVZ0eFNpemUpLCAicG9zaXRpb24iKTsKLSAgICAgICAgICAgIGlmICgobUZsYWdzICYgQ09MT1IpICE9IDApIHsKLSAgICAgICAgICAgICAgICBmbG9hdENvdW50ICs9IDQ7Ci0gICAgICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5jcmVhdGVBdHRyaWIobVJTLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsZW1lbnQuRGF0YVR5cGUuRkxPQVRfMzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlbWVudC5EYXRhS2luZC5DT0xPUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSwgImNvbG9yIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKG1GbGFncyAmIFRFWFRVUkVfMCkgIT0gMCkgewotICAgICAgICAgICAgICAgIGZsb2F0Q291bnQgKz0gMjsKLSAgICAgICAgICAgICAgICBiLmFkZChFbGVtZW50LmNyZWF0ZUF0dHJpYihtUlMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlbWVudC5EYXRhVHlwZS5GTE9BVF8zMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50LkRhdGFLaW5kLlRFWFRVUkUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiksICJ0ZXh0dXJlIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKG1GbGFncyAmIE5PUk1BTCkgIT0gMCkgewotICAgICAgICAgICAgICAgIGZsb2F0Q291bnQgKz0gMzsKLSAgICAgICAgICAgICAgICBiLmFkZChFbGVtZW50LmNyZWF0ZUF0dHJpYihtUlMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlbWVudC5EYXRhVHlwZS5GTE9BVF8zMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50LkRhdGFLaW5kLk5PUk1BTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzKSwgIm5vcm1hbCIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgb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7CisgICAgICAgIG1EaW1GYWNlcyA9IGRhdGFCdWZmZXJbNF0gPT0gMSA/IHRydWUgOiBmYWxzZTsKIAotICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IGZpZWxkcy5sZW5ndGg7IGN0KyspIHsKLSAgICAgICAgICAgICAgICBGaWVsZCBmID0gZmllbGRzW2N0XTsKLSAgICAgICAgICAgICAgICBDbGFzcyBmYyA9IGYuZ2V0VHlwZSgpOwotICAgICAgICAgICAgICAgIGlmKGZjID09IGludC5jbGFzcykgewotICAgICAgICAgICAgICAgICAgICBhclR5cGVzW2N0XSA9IEVsZW1lbnQuRGF0YVR5cGUuU0lHTkVEXzMyLm1JRDsKLSAgICAgICAgICAgICAgICAgICAgYXJCaXRzW2N0XSA9IDMyOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZihmYyA9PSBzaG9ydC5jbGFzcykgewotICAgICAgICAgICAgICAgICAgICBhclR5cGVzW2N0XSA9IEVsZW1lbnQuRGF0YVR5cGUuU0lHTkVEXzE2Lm1JRDsKLSAgICAgICAgICAgICAgICAgICAgYXJCaXRzW2N0XSA9IDE2OwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZihmYyA9PSBieXRlLmNsYXNzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFyVHlwZXNbY3RdID0gRWxlbWVudC5EYXRhVHlwZS5TSUdORURfOC5tSUQ7Ci0gICAgICAgICAgICAgICAgICAgIGFyQml0c1tjdF0gPSA4OwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZihmYyA9PSBmbG9hdC5jbGFzcykgewotICAgICAgICAgICAgICAgICAgICBhclR5cGVzW2N0XSA9IEVsZW1lbnQuRGF0YVR5cGUuRkxPQVRfMzIubUlEOwotICAgICAgICAgICAgICAgICAgICBhckJpdHNbY3RdID0gMzI7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2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5zaW9uVmFsdWVzOwogICAgICAgICBpbnQgbUVudHJ5Q291bnQ7CiAgICAgICAgIEVsZW1lbnQgbUVsZW1lbnQ7CiAKQEAgLTE3MCw3ICsxNDgsOCBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBtUlMgPSByczsKLSAgICAgICAgICAgIG1FbnRyaWVzID0gbmV3IEVudHJ5WzRdOworICAgICAgICAgICAgbURpbWVuc2lvbnMgPSBuZXcgRGltZW5zaW9uWzRdOworICAgICAgICAgICAgbURpbWVuc2lvblZhbHVlcyA9IG5ldyBpbnRbNF07CiAgICAgICAgICAgICBtRWxlbWVudCA9IGU7CiAgICAgICAgIH0KIApAQCAtMTc4LDQ2ICsxNTcsNDUgQEAKICAgICAgICAgICAgIGlmKHZhbHVlIDwgMSkgewogICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlZhbHVlcyBvZiBsZXNzIHRoYW4gMSBmb3IgRGltZW5zaW9ucyBhcmUgbm90IHZhbGlkLiIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYobUVudHJpZXMubGVuZ3RoID49IG1FbnRyeUNvdW50KSB7Ci0gICAgICAgICAgICAgICAgRW50cnlbXSBlbiA9IG5ldyBFbnRyeVttRW50cnlDb3VudCArIDhdOwotICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkobUVudHJpZXMsIDAsIGVuLCAwLCBtRW50cmllcy5sZW5ndGgpOwotICAgICAgICAgICAgICAgIG1FbnRyaWVzID0gZW47CisgICAgICAgICAgICBpZihtRGltZW5zaW9ucy5sZW5ndGggPj0gbUVudHJ5Q291bnQpIHsKKyAgICAgICAgICAgICAgICBEaW1lbnNpb25bXSBkbiA9IG5ldyBEaW1lbnNpb25bbUVudHJ5Q291bnQgKyA4XTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1EaW1lbnNpb25zLCAwLCBkbiwgMCwgbUVudHJ5Q291bnQpOworICAgICAgICAgICAgICAgIG1EaW1lbnNpb25zID0gZG47CisKKyAgICAgICAgICAgICAgICBpbnRbXSBpbiA9IG5ldyBpbnRbbUVudHJ5Q291bnQgKyA4XTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1EaW1lbnNpb25WYWx1ZXMsIDAsIGluLCAwLCBtRW50cnlDb3VudCk7CisgICAgICAgICAgICAgICAgbURpbWVuc2lvblZhbHVlcyA9IGluOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgbUVudHJpZXNbbUVudHJ5Q291bnRdID0gbmV3IEVudHJ5KCk7Ci0gICAgICAgICAgICBtRW50cmllc1ttRW50cnlDb3VudF0ubURpbSA9IGQ7Ci0gICAgICAgICAgICBtRW50cmllc1ttRW50cnlDb3VudF0ubVZhbHVlID0gdmFsdWU7CisgICAgICAgICAgICBtRGltZW5zaW9uc1ttRW50cnlDb3VudF0gPSBkOworICAgICAgICAgICAgbURpbWVuc2lvblZhbHVlc1ttRW50cnlDb3VudF0gPSB2YWx1ZTsKICAgICAgICAgICAgIG1FbnRyeUNvdW50Kys7CiAgICAgICAgIH0KIAotICAgICAgICBzdGF0aWMgc3luY2hyb25pemVkIFR5cGUgaW50ZXJuYWxDcmVhdGUoUmVuZGVyU2NyaXB0IHJzLCBCdWlsZGVyIGIpIHsKLSAgICAgICAgICAgIHJzLm5UeXBlQmVnaW4oYi5tRWxlbWVudC5tSUQpOwotICAgICAgICAgICAgZm9yIChpbnQgY3Q9MDsgY3QgPCBiLm1FbnRyeUNvdW50OyBjdCsrKSB7Ci0gICAgICAgICAgICAgICAgRW50cnkgZW4gPSBiLm1FbnRyaWVzW2N0XTsKLSAgICAgICAgICAgICAgICBycy5uVHlwZUFkZChlbi5tRGltLm1JRCwgZW4ubVZhbHVlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGludCBpZCA9IHJzLm5UeXBlQ3JlYXRlKCk7Ci0gICAgICAgICAgICByZXR1cm4gbmV3IFR5cGUoaWQsIHJzKTsKLSAgICAgICAgfQotCiAgICAgICAgIHB1YmxpYyBUeXBlIGNyZWF0ZSgpIHsKLSAgICAgICAgICAgIFR5cGUgdCA9IGludGVybmFsQ3JlYXRlKG1SUywgdGhpcyk7CisgICAgICAgICAgICBpbnQgZGltc1tdID0gbmV3IGludFttRW50cnlDb3VudF07CisgICAgICAgICAgICBmb3IgKGludCBjdD0wOyBjdCA8IG1FbnRyeUNvdW50OyBjdCsrKSB7CisgICAgICAgICAgICAgICAgZGltc1tjdF0gPSBtRGltZW5zaW9uc1tjdF0ubUlEOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQgaWQgPSBtUlMublR5cGVDcmVhdGUobUVsZW1lbnQuZ2V0SUQoKSwgZGltcywgbURpbWVuc2lvblZhbHVlcyk7CisgICAgICAgICAgICBUeXBlIHQgPSBuZXcgVHlwZShpZCwgbVJTKTsKICAgICAgICAgICAgIHQubUVsZW1lbnQgPSBtRWxlbWVudDsKIAogICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IG1FbnRyeUNvdW50OyBjdCsrKSB7Ci0gICAgICAgICAgICAgICAgaWYobUVudHJpZXNbY3RdLm1EaW0gPT0gRGltZW5zaW9uLlgpIHsKLSAgICAgICAgICAgICAgICAgICAgdC5tRGltWCA9IG1FbnRyaWVzW2N0XS5tVmFsdWU7CisgICAgICAgICAgICAgICAgaWYobURpbWVuc2lvbnNbY3RdID09IERpbWVuc2lvbi5YKSB7CisgICAgICAgICAgICAgICAgICAgIHQubURpbVggPSBtRGltZW5zaW9uVmFsdWVzW2N0XTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYobUVudHJpZXNbY3RdLm1EaW0gPT0gRGltZW5zaW9uLlkpIHsKLSAgICAgICAgICAgICAgICAgICAgdC5tRGltWSA9IG1FbnRyaWVzW2N0XS5tVmFsdWU7CisgICAgICAgICAgICAgICAgaWYobURpbWVuc2lvbnNbY3RdID09IERpbWVuc2lvbi5ZKSB7CisgICAgICAgICAgICAgICAgICAgIHQubURpbVkgPSBtRGltZW5zaW9uVmFsdWVzW2N0XTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYobUVudHJpZXNbY3RdLm1EaW0gPT0gRGltZW5zaW9uLlopIHsKLSAgICAgICAgICAgICAgICAgICAgdC5tRGltWiA9IG1FbnRyaWVzW2N0XS5tVmFsdWU7CisgICAgICAgICAgICAgICAgaWYobURpbWVuc2lvbnNbY3RdID09IERpbWVuc2lvbi5aKSB7CisgICAgICAgICAgICAgICAgICAgIHQubURpbVogPSBtRGltZW5zaW9uVmFsdWVzW2N0XTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYobUVudHJpZXNbY3RdLm1EaW0gPT0gRGltZW5zaW9uLkxPRCkgewotICAgICAgICAgICAgICAgICAgICB0Lm1EaW1MT0QgPSBtRW50cmllc1tjdF0ubVZhbHVlICE9IDA7CisgICAgICAgICAgICAgICAgaWYobURpbWVuc2lvbnNbY3RdID09IERpbWVuc2lvbi5MT0QpIHsKKyAgICAgICAgICAgICAgICAgICAgdC5tRGltTE9EID0gbURpbWVuc2lvblZhbHVlc1tjdF0gIT0gMDsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYobUVudHJpZXNbY3RdLm1EaW0gPT0gRGltZW5zaW9uLkZBQ0UpIHsKLSAgICAgICAgICAgICAgICAgICAgdC5tRGltRmFjZXMgPSBtRW50cmllc1tjdF0ubVZhbHVlICE9IDA7CisgICAgICAgICAgICAgICAgaWYobURpbWVuc2lvbnNbY3RdID09IERpbWVuc2lvbi5GQUNFKSB7CisgICAgICAgICAgICAgICAgICAgIHQubURpbUZhY2VzID0gbURpbWVuc2lvblZhbHVlc1tjdF0gIT0gMDsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICB0LmNhbGNFbGVtZW50Q291bnQoKTsKZGlmZiAtLWd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3RoaXMsIGppbnQgb2JqKQorc3RhdGljIGpzdHJpbmcKK25HZXROYW1lKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgUnNDb250ZXh0IGNvbiwgamludCBvYmopCiB7Ci0gICAgUnNDb250ZXh0IGNvbiA9IChSc0NvbnRleHQpKF9lbnYtPkdldEludEZpZWxkKF90aGlzLCBnQ29udGV4dElkKSk7CisgICAgTE9HX0FQSSgibkdldE5hbWUsIGNvbiglcCksIG9iaiglcCkiLCBjb24sICh2b2lkICopb2JqKTsKKyAgICBjb25zdCBjaGFyICpuYW1lID0gTlVMTDsKKyAgICByc2FHZXROYW1lKGNvbiwgKHZvaWQgKilvYmosICZuYW1lKTsKKyAgICBpZihuYW1lID09IE5VTEwgfHwgc3RybGVuKG5hbWUpID09IDApIHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICAgIHJldHVybiBfZW52LT5OZXdTdHJpbmdVVEYobmFtZSk7Cit9CisKK3N0YXRpYyB2b2lkCituT2JqRGVzdHJveShKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIFJzQ29udGV4dCBjb24sIGppbnQgb2JqKQorewogICAgIExPR19BUEkoIm5PYmpEZXN0cm95LCBjb24oJXApIG9iaiglcCkiLCBjb24sICh2b2lkICopb2JqKTsKICAgICByc09iakRlc3Ryb3koY29uLCAodm9pZCAqKW9iaik7CiB9CiAKLXN0YXRpYyB2b2lkCi1uT2JqRGVzdHJveU9PQihKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgb2JqKQotewotICAgIC8vIFRoaXMgZnVuY3Rpb24gb25seSBkaWZmZXJzIGZyb20gbk9iakRlc3Ryb3kgaW4gdGhhdCBpdCBjYWxscyB0aGUKLSAgICAvLyBzcGVjaWFsIE91dCBPZiBCYW5kIHZlcnNpb24gb2YgT2JqRGVzdHJveSB3aGljaCBpcyB0aHJlYWQgc2FmZS4KLSAgICBSc0NvbnRleHQgY29uID0gKFJzQ29udGV4dCkoX2Vudi0+R2V0SW50RmllbGQoX3RoaXMsIGdDb250ZXh0SWQpKTsKLSAgICBMT0dfQVBJKCJuT2JqRGVzdHJveU9PQiwgY29uKCVwKSBvYmooJXApIiwgY29uLCAodm9pZCAqKW9iaik7Ci0gICAgcnNPYmpEZXN0cm95T09CKGNvbiwgKHZvaWQgKilvYmopOwotfQogCiBzdGF0aWMgamludAotbkZpbGVPcGVuKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgamJ5dGVBcnJheSBzdHIpCituRmlsZU9wZW4oSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzLCBSc0NvbnRleHQgY29uLCBqYnl0ZUFycmF5IHN0cikKIHsKLSAgICBSc0NvbnRleHQgY29uID0gKFJzQ29udGV4dCkoX2Vudi0+R2V0SW50RmllbGQoX3RoaXMsIGdDb250ZXh0SWQpKTsKICAgICBMT0dfQVBJKCJuRmlsZU9wZW4sIGNvbiglcCkiLCBjb24pOwotCiAgICAgamludCBsZW4gPSBfZW52LT5HZXRBcnJheUxlbmd0aChzdHIpOwogICAgIGpieXRlICogY3B0ciA9IChqYnl0ZSAqKSBfZW52LT5HZXRQcmltaXRpdmVBcnJheUNyaXRpY2FsKHN0ciwgMCk7CiAgICAgamludCByZXQgPSAoamludClyc0ZpbGVPcGVuKGNvbiwgKGNvbnN0IGNoYXIgKiljcHRyLCBsZW4pOwpAQCAtMTU4LDE2ICsxNjEsMzEgQEAKIH0KIAogc3RhdGljIGppbnQKLW5Db250ZXh0Q3JlYXRlR0woSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzLCBqaW50IGRldiwgamludCB2ZXIsIGpib29sZWFuIHVzZURlcHRoKQorbkNvbnRleHRDcmVhdGVHTChKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgZGV2LCBqaW50IHZlciwKKyAgICAgICAgICAgICAgICAgaW50IGNvbG9yTWluLCBpbnQgY29sb3JQcmVmLAorICAgICAgICAgICAgICAgICBpbnQgYWxwaGFNaW4sIGludCBhbHBoYVByZWYsCisgICAgICAgICAgICAgICAgIGludCBkZXB0aE1pbiwgaW50IGRlcHRoUHJlZiwKKyAgICAgICAgICAgICAgICAgaW50IHN0ZW5jaWxNaW4sIGludCBzdGVuY2lsUHJlZiwKKyAgICAgICAgICAgICAgICAgaW50IHNhbXBsZXNNaW4sIGludCBzYW1wbGVzUHJlZiwgZmxvYXQgc2FtcGxlc1EpCiB7CisgICAgUnNTdXJmYWNlQ29uZmlnIHNjOworICAgIHNjLmFscGhhTWluID0gYWxwaGFNaW47CisgICAgc2MuYWxwaGFQcmVmID0gYWxwaGFQcmVmOworICAgIHNjLmNvbG9yTWluID0gY29sb3JNaW47CisgICAgc2MuY29sb3JQcmVmID0gY29sb3JQcmVmOworICAgIHNjLmRlcHRoTWluID0gZGVwdGhNaW47CisgICAgc2MuZGVwdGhQcmVmID0gZGVwdGhQcmVmOworICAgIHNjLnNhbXBsZXNNaW4gPSBzYW1wbGVzTWluOworICAgIHNjLnNhbXBsZXNQcmVmID0gc2FtcGxlc1ByZWY7CisgICAgc2Muc2FtcGxlc1EgPSBzYW1wbGVzUTsKKwogICAgIExPR19BUEkoIm5Db250ZXh0Q3JlYXRlR0wiKTsKLSAgICByZXR1cm4gKGppbnQpcnNDb250ZXh0Q3JlYXRlR0woKFJzRGV2aWNlKWRldiwgdmVyLCB1c2VEZXB0aCk7CisgICAgcmV0dXJuIChqaW50KXJzQ29udGV4dENyZWF0ZUdMKChSc0RldmljZSlkZXYsIHZlciwgc2MpOwogfQogCiBzdGF0aWMgdm9pZAotbkNvbnRleHRTZXRQcmlvcml0eShKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgcCkKK25Db250ZXh0U2V0UHJpb3JpdHkoSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzLCBSc0NvbnRleHQgY29uLCBqaW50IHApCiB7Ci0gICAgUnNDb250ZXh0IGNvbiA9IChSc0NvbnRleHQpKF9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V9lbnYtPkdldEludEZpZWxkKHduZCwgc3VyZmFjZUZpZWxkSUQpOworICAgICAgICB3aW5kb3cgPSAoU3VyZmFjZSopIGFuZHJvaWRfU3VyZmFjZV9nZXROYXRpdmVXaW5kb3coX2Vudiwgd25kKS5nZXQoKTsKICAgICB9CiAKICAgICByc0NvbnRleHRTZXRTdXJmYWNlKGNvbiwgd2lkdGgsIGhlaWdodCwgd2luZG93KTsKIH0KIAogc3RhdGljIHZvaWQKLW5Db250ZXh0RGVzdHJveShKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgY29uKQorbkNvbnRleHREZXN0cm95KEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgUnNDb250ZXh0IGNvbikKIHsKLSAgICBMT0dfQVBJKCJuQ29udGV4dERlc3Ryb3ksIGNvbiglcCkiLCAoUnNDb250ZXh0KWNvbik7Ci0gICAgcnNDb250ZXh0RGVzdHJveSgoUnNDb250ZXh0KWNvbik7CisgICAgTE9HX0FQSSgibkNvbnRleHREZXN0cm95LCBjb24oJXApIiwgY29uKTsKKyAgICByc0NvbnRleHREZXN0cm95KGNvbik7CiB9CiAKIHN0YXRpYyB2b2lkCi1uQ29udGV4dER1bXAoSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzLCBqaW50IGJpdHMpCituQ29udGV4dER1bXAoSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzLCBSc0NvbnRleHQgY29uLCBqaW50IGJpdHMpCiB7Ci0gICAgUnNDb250ZXh0IGNvbiA9IChSc0NvbnRleHQpKF9lbnYtPkdldEludEZpZWxkKF90aGlzLCBnQ29udGV4dElkKSk7CiAgICAgTE9HX0FQSSgibkNvbnRleHREdW1wLCBjb24oJXApICBiaXRzKCVpKSIsIChSc0NvbnRleHQpY29uLCBiaXRzKTsKICAgICByc0NvbnRleHREdW1wKChSc0NvbnRleHQpY29uLCBiaXRzKTsKIH0KIAogc3RhdGljIHZvaWQKLW5Db250ZXh0UGF1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yYXkgX25hbWVzKQorbkVsZW1lbnRDcmVhdGUyKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgUnNDb250ZXh0IGNvbiwgamludEFycmF5IF9pZHMsIGpvYmplY3RBcnJheSBfbmFtZXMsIGppbnRBcnJheSBfYXJyYXlTaXplcykKIHsKICAgICBpbnQgZmllbGRDb3VudCA9IF9lbnYtPkdldEFycmF5TGVuZ3RoKF9pZHMpOwotICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOwogICAgIExPR19BUEkoIm5FbGVtZW50Q3JlYXRlMiwgY29uKCVwKSIsIGNvbik7CiAKICAgICBqaW50ICppZHMgPSBfZW52LT5HZXRJbnRBcnJheUVsZW1lbnRzKF9pZHMsIE5VTEwpOworICAgIGppbnQgKmFycmF5U2l6ZXMgPSBfZW52LT5HZXRJbnRBcnJheUVsZW1lbnRzKF9hcnJheVNpemVzLCBOVUxMKTsKICAgICBjb25zdCBjaGFyICoqIG5hbWVBcnJheSA9IChjb25zdCBjaGFyICoqKWNhbGxvYyhmaWVsZENvdW50LCBzaXplb2YoY2hhciAqKSk7CiAgICAgc2l6ZV90KiBzaXplQXJyYXkgPSAoc2l6ZV90KiljYWxsb2MoZmllbGRDb3VudCwgc2l6ZW9mKHNpemVfdCkpOwogCkBAIC0yNzgsMTgzICsyODcsMTEyIEBACiAgICAgICAgIG5hbWVBcnJheVtjdF0gPSBfZW52LT5HZXRTdHJpbmdVVEZDaGFycyhzLCBOVUxMKTsKICAgICAgICAgc2l6ZUFycmF5W2N0XSA9IF9lbnYtPkdldFN0cmluZ1VURkxlbmd0aChzKTsKICAgICB9Ci0gICAgamludCBpZCA9IChqaW50KXJzRWxlbWVudENyZWF0ZTIoY29uLCBmaWVsZENvdW50LCAoUnNFbGVtZW50ICopaWRzLCBuYW1lQXJyYXksIHNpemVBcnJheSk7CisgICAgamludCBpZCA9IChqaW50K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gYXNzZXJ0KGRhdGFTaXplID09IDUpOworCisgICAgdWludDMyX3QgZWxlbWVudERhdGFbNV07CisgICAgcnNhRWxlbWVudEdldE5hdGl2ZURhdGEoY29uLCAoUnNFbGVtZW50KWlkLCBlbGVtZW50RGF0YSwgZGF0YVNpemUpOworCisgICAgZm9yKGppbnQgaSA9IDA7IGkgPCBkYXRhU2l6ZTsgaSArKykgeworICAgICAgICBfZW52LT5TZXRJbnRBcnJheVJlZ2lvbihfZWxlbWVudERhdGEsIGksIDEsIChjb25zdCBqaW50KikmZWxlbWVudERhdGFbaV0pOworICAgIH0KK30KKwogCiBzdGF0aWMgdm9pZAotblR5cGVCZWdpbihKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgZUlEKQorbkVsZW1lbnRHZXRTdWJFbGVtZW50cyhKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIFJzQ29udGV4dCBjb24sIGppbnQgaWQsIGppbnRBcnJheSBfSURzLCBqb2JqZWN0QXJyYXkgX25hbWVzKQogewotICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOwotICAgIExPR19BUEkoIm5UeXBlQmVnaW4sIGNvbiglcCkgZSglcCkiLCBjb24sIChSc0VsZW1lbnQpZUlEKTsKLSAgICByc1R5cGVCZWdpbihjb24sIChSc0VsZW1lbnQpZUlEKTsKLX0KKyAgICBpbnQgZGF0YVNpemUgPSBfZW52LT5HZXRBcnJheUxlbmd0aChfSURzKTsKKyAgICBMT0dfQVBJKCJuRWxlbWVudEdldFN1YkVsZW1lbnRzLCBjb24oJXApIiwgY29uKTsKIAotc3RhdGljIHZvaWQKLW5UeXBlQWRkKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgamludCBkaW0sIGppbnQgdmFsKQotewotICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGa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AqZGltUHRyID0gX2Vudi0+R2V0SW50QXJyYXlFbGVtZW50cyhfZGltcywgTlVMTCk7CisgICAgamludCAqZGltVmFsUHRyID0gX2Vudi0+R2V0SW50QXJyYXlFbGVtZW50cyhfZGltVmFsdWVzLCBOVUxMKTsKKworICAgIGppbnQgaWQgPSAoamludClyc2FUeXBlQ3JlYXRlKGNvbiwgKFJzRWxlbWVudCllaWQsIGNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChSc0RpbWVuc2lvbiAqKWRpbVB0ciwgKHVpbnQzMl90ICopZGltVmFsUHRyKTsKKworICAgIF9lbnYtPlJlbGVhc2VJbnRBcnJheUVsZW1lbnRzKF9kaW1zLCBkaW1QdHIsIEpOSV9BQk9SVCk7CisgICAgX2Vudi0+UmVsZWFzZUludEFycmF5RWxlbWVudHMoX2RpbVZhbHVlcywgZGltVmFsUHRyLCBKTklfQUJPUlQpOworICAgIHJldHVybiAoamludClpZDsKK30KKworc3RhdGljIHZvaWQKK25UeXBlR2V0TmF0aXZlRGF0YShKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIFJzQ29udGV4dCBjb24sIGppbnQgaWQsIGppbnRBcnJheSBfdHlwZURhdGEpCit7CisgICAgLy8gV2UgYXJlIHBhY2tpbmcgNiBpdGVtczogbURpbVg7IG1EaW1ZOyBtRGltWjsKKyAgICAvLyBtRGltTE9EOyBtRGltRmFjZXM7IG1FbGVtZW50OyBpbnRvIHR5cGVEYXRhCisgICAgaW50IGVsZW1lbnRDb3VudCA9IF9lbnYtPkdldEFycmF5TGVuZ3RoKF90eXBlRGF0YSk7CisKKyAgICBhc3NlcnQoZWxlbWVudENvdW50ID09IDYpOworICAgIExPR19BUEkoIm5UeXBlQ3JlYXRlLCBjb24oJXApIiwgY29uKTsKKworICAgIHVpbnQzMl90IHR5cGVEYXRhWzZdOworICAgIHJzYVR5cGVHZXROYXRpdmVEYXRhKGNvbiwgKFJzVHlwZSlpZCwgdHlwZURhdG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T5maWVsZENvdW50OyBjdCsrKSB7Ci0gICAgICAgIGNvbnN0IFR5cGVGaWVsZENhY2hlICp0ZmMgPSAmdGMtPmZpZWxkc1tjdF07Ci0gICAgICAgIGJ1ZiA9IHRmYy0+cmVhZFB0cihfZW52LCBfbywgdGZjLT5maWVsZCwgYnVmKTsKKyAgICBBc3NldCogYXNzZXQgPSByZWludGVycHJldF9jYXN0PEFzc2V0Kj4obmF0aXZlX2Fzc2V0KTsKKworICAgIGppbnQgaWQgPSAoamludClyc2FGaWxlQTNEQ3JlYXRlRnJvbUFzc2V0U3RyZWFtKGNvbiwgYXNzZXQtPmdldEJ1ZmZlcihmYWxzZSksIGFzc2V0LT5nZXRMZW5ndGgoKSk7CisgICAgcmV0dXJuIGlkOworfQorCitzdGF0aWMgaW50CituRmlsZUEzREdldE51bUluZGV4RW50cmllcyhKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIFJzQ29udGV4dCBjb24sIGppbnQgZmlsZUEzRCkKK3sKKyAgICBpbnQzMl90IG51bUVudHJpZXMgPSAwOworICAgIHJzYUZpbGVBM0RHZXROdW1JbmRleEVudHJpZXMoY29uLCAmbnVtRW50cmllcywgKFJzRmlsZSlmaWxlQTNEKTsKKyAgICByZXR1cm4gbnVtRW50cmllczsKK30KKworc3RhdGljIHZvaWQKK25GaWxlQTNER2V0SW5kZXhFbnRyaWVzKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgUnNDb250ZXh0IGNvbiwgamludCBmaWxlQTNELCBqaW50IG51bUVudHJpZXMsIGppbnRBcnJheSBfaWRzLCBqb2JqZWN0QXJyYXkgX2VudHJpZXMpCit7CisgICAgTE9HVigiX19fX19fbkZpbGVBM0QgJXUiLCAodWludDMyX3QpIGZpbGVBM0QpOworICAgIFJzRmlsZUluZGV4RW50cnkgKmZpbGVFbnRyaWVzID0gKFJzRmlsZUluZGV4RW50cnkqKW1hbGxvYygodWludDMyX3QpbnVtRW50cmllcyAqIHNpemVvZihSc0ZpbGVJbmRleEVudHJ5KSk7CisKKyAgICByc2FGaWxlQTNER2V0SW5kZXhFbnRyaWVzKGNvbiwgZmlsZUVudHJpZXMsICh1aW50MzJfdCludW1FbnRyaWVzLCAoUnNGaWxlKWZpbGVBM0QpOworCisgICAgZm9yKGppbnQgaSA9IDA7IGkgPCBudW1FbnRyaWVzOyBpICsrKSB7CisgICAgICAgIF9lbnYtPlNldE9iamVjdEFycmF5RWxlbWVudChfZW50cmllcywgaSwgX2Vudi0+TmV3U3RyaW5nVVRGKGZpbGVFbnRyaWVzW2ldLm9iamVjdE5hbWUpKTsKKyAgICAgICAgX2Vudi0+U2V0SW50QXJyYXlSZWdpb24oX2lkcywgaSwgMSwgKGNvbnN0IGppbnQqKSZmaWxlRW50cmllc1tpXS5jbGFzc0lEKTsKICAgICB9Ci0gICAgZnJlZShidWZBbGxvYyk7CisKKyAgICBmcmVlKGZpbGVFbnRyaWVzKTsKK30KKworc3RhdGljIGludAorbkZpbGVBM0RHZXRFbnRyeUJ5SW5kZXgoSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzLCBSc0NvbnRleHQgY29uLCBqaW50IGZpbGVBM0QsIGppbnQgaW5kZXgpCit7CisgICAgTE9HVigiX19fX19fbkZpbGVBM0QgJXUiLCAodWludDMyX3QpIGZpbGVBM0QpOworICAgIGppbnQgaWQgPSAoamludClyc2FGaWxlQTNER2V0RW50cnlCeUluZGV4KGNvbiwgKHVpbnQzMl90KWluZGV4LCAoUnNGaWxlKWZpbGVBM0QpOworICAgIHJldHVybiBpZDsKK30KKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworc3RhdGljIGludAorbkZvbnRDcmVhdGVGcm9tRmlsZShKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIFJzQ29udGV4dCBjb24sIGpzdHJpbmcgZmlsZU5hbWUsIGppbnQgZm9udFNpemUsIGppbnQgZHBpKQoreworICAgIGNvbnN0IGNoYX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iwgam9iamVjdCBfdGhpcywgUnNDb250ZXh0IGNvbiwgamludCBtZXNoKQoreworICAgIExPR19BUEkoIm5NZXNoR2V0VmVydGV4QnVmZmVyQ291bnQsIGNvbiglcCksIE1lc2goJXApIiwgY29uLCAoUnNNZXNoKW1lc2gpOworICAgIGppbnQgdnR4Q291bnQgPSAwOworICAgIHJzYU1lc2hHZXRWZXJ0ZXhCdWZmZXJDb3VudChjb24sIChSc01lc2gpbWVzaCwgJnZ0eENvdW50KTsKKyAgICByZXR1cm4gdnR4Q291bnQ7Cit9CisKK3N0YXRpYyBqaW50CituTWVzaEdldEluZGV4Q291bnQoSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzLCBSc0NvbnRleHQgY29uLCBqaW50IG1lc2gpCit7CisgICAgTE9HX0FQSSgibk1lc2hHZXRJbmRleENvdW50LCBjb24oJXApLCBNZXNoKCVwKSIsIGNvbiwgKFJzTWVzaCltZXNoKTsKKyAgICBqaW50IGlkeENvdW50ID0gMDsKKyAgICByc2FNZXNoR2V0SW5kZXhDb3VudChjb24sIChSc01lc2gpbWVzaCwgJmlkeENvdW50KTsKKyAgICByZXR1cm4gaWR4Q291bnQ7Cit9CisKK3N0YXRpYyB2b2lkCituTWVzaEdldFZlcnRpY2VzKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgUnNDb250ZXh0IGNvbiwgamludCBtZXNoLCBqaW50QXJyYXkgX2lkcywgaW50IG51bVZ0eElEcykKK3sKKyAgICBMT0dfQVBJKCJuTWVzaEdldFZlcnRpY2VzLCBjb24oJXApLCBNZXNoKCVwKSIsIGNvbiwgKFJzTWVzaCltZXNoKTsKKworICAgIFJzQWxsb2NhdGlvbiAqYWxsb2NzID0gKFJzQWxsb2NhdGlvbiopbWFsbG9jKCh1aW50MzJfdCludW1WdHhJRHMgKiBzaXplb2YoUnNBbGxvY2F0aW9uKSk7CisgICAgcnNhTWVzaEdldFZlcnRpY2VzKGNvbiwgKFJzTWVzaCltZXNoLCBhbGxvY3MsICh1aW50MzJfdCludW1WdHhJRHMpOworCisgICAgZm9yKGppbnQgaSA9IDA7IGkgPCBudW1WdHhJRHM7IGkgKyspIHsKKyAgICAgICAgX2Vudi0+U2V0SW50QXJyYXlSZWdpb24oX2lkcywgaSwgMSwgKGNvbnN0IGppbnQqKSZhbGxvY3NbaV0pOworICAgIH0KKworICAgIGZyZWUoYWxsb2NzKTsKK30KKworc3RhdGljIHZvaWQKK25NZXNoR2V0SW5kaWNlcyhKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIFJzQ29udGV4dCBjb24sIGppbnQgbWVzaCwgamludEFycmF5IF9pZHhJZHMsIGppbnRBcnJheSBfcHJpbWl0aXZlcywgaW50IG51bUluZGljZXMpCit7CisgICAgTE9HX0FQSSgibk1lc2hHZXRWZXJ0aWNlcywgY29uKCVwKSwgTWVzaCglcCkiLCBjb24sIChSc01lc2gpbWVzaCk7CisKKyAgICBSc0FsbG9jYXRpb24gKmFsbG9jcyA9IChSc0FsbG9jYXRpb24qKW1hbGxvYygodWludDMyX3QpbnVtSW5kaWNlcyAqIHNpemVvZihSc0FsbG9jYXRpb24pKTsKKyAgICB1aW50MzJfdCAqcHJpbXM9ICh1aW50MzJfdCopbWFsbG9jKCh1aW50MzJfdCludW1JbmRpY2VzICogc2l6ZW9mKHVpbnQzMl90KSk7CisKKyAgICByc2FNZXNoR2V0SW5kaWNlcyhjb24sIChSc01lc2gpbWVzaCwgYWxsb2NzLCBwcmltcywgKHVpbnQzMl90KW51bUluZGljZXMpOworCisgICAgZm9yKGppbnQgaSA9IDA7IGkgPCBudW1JbmRpY2VzOyBpICsrKSB7CisgICAgICAgIF9lbnYtPlNldEludEFycmF5UmVnaW9uKF9pZHhJZHMsIGksIDEsIChjb25zdCBqaW50KikmYWxsb2NzW2ldKTsKKyAgICAgICAgX2Vudi0+U2V0SW50QXJyYXlSZWdpb24oX3ByaW1pdGl2ZXMsIGksIDEsIChjb25zdCBqaW50KikmcHJpbXNbaV0pOworICAgIH0KKworICAgIGZyZWUoYWxsb2NzKTsKKyAgICBmcmVlKHByaW1zKTsKIH0KIAogLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCkBAIC0xMzU5LDEyNCArMTIyOCwxMzAgQEAKIHsibkRldmljZUNyZWF0ZSIsICAgICAgICAgICAgICAgICAgIigpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluRGV2aWNlQ3JlYXRlIH0sCiB7Im5EZXZpY2VEZXN0cm95IiwgICAgICAgICAgICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkRldmljZURlc3Ryb3kgfSwKIHsibkRldmljZVNldENvbmZpZyIsICAgICAgICAgICAgICAgIihJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluRGV2aWNlU2V0Q29uZmlnIH0sCi17Im5Db250ZXh0Q3JlYXRlIiwgICAgICAgICAgICAgICAgICIoSUkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRDcmVhdGUgfSwKLXsibkNvbnRleHRDcmVhdGVHTCIsICAgICAgICAgICAgICAgIihJSVopSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dENyZWF0ZUdMIH0sCi17Im5Db250ZXh0U2V0UHJpb3JpdHkiLCAgICAgICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRTZXRQcmlvcml0eSB9LAoteyJuQ29udGV4dFNldFN1cmZhY2UiLCAgICAgICAgICAgICAiKElJTGFuZHJvaWQvdmlldy9TdXJmYWNlOylWIiwgICAgICAgICAgKHZvaWQqKW5Db250ZXh0U2V0U3VyZmFjZSB9LAoteyJuQ29udGV4dERlc3Ryb3kiLCAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0RGVzdHJveSB9LAoteyJuQ29udGV4dER1bXAiLCAgICAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0RHVtcCB9LAoteyJuQ29udGV4dFBhdXNlIiwgICAgICAgICAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0UGF1c2UgfSwKLXsibkNvbnRleHRSZXN1bWUiLCAgICAgICAgICAgICAgICAgIigpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dFJlc3VtZSB9LAoteyJuQXNzaWduTmFtZSIsICAgICAgICAgICAgICAgICAgICAiKElbQilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Bc3NpZ25OYW1lIH0sCi17Im5PYmpEZXN0cm95IiwgICAgICAgICAgICAgICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbk9iakRlc3Ryb3kgfSwKLXsibk9iakRlc3Ryb3lPT0IiLCAgICAgICAgICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluT2JqRGVzdHJveU9PQiB9LAoteyJuQ29udGV4dEdldE1lc3NhZ2UiLCAgICAgICAgICAgICAiKFtJWilJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0R2V0TWVzc2FnZSB9LAoteyJuQ29udGV4dEluaXRUb0NsaWVudCIsICAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0SW5pdFRvQ2xpZW50IH0sCi17Im5Db250ZXh0RGVpbml0VG9DbGllbnQiLCAgICAgICAgICIoKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHREZWluaXRUb0NsaWVudCB9LAoreyJuQ29udGV4dEdldE1lc3NhZ2UiLCAgICAgICAgICAgICAiKElbSVopSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEdldE1lc3NhZ2UgfSwKK3sibkNvbnRleHRJbml0VG9DbGllbnQiLCAgICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRJbml0VG9DbGllbnQgfSwKK3sibkNvbnRleHREZWluaXRUb0NsaWVudCIsICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHREZWluaXRUb0NsaWVudCB9LAogCi17Im5GaWxlT3BlbiIsICAgICAgICAgICAgICAgICAgICAgICIoW0IpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkZpbGVPcGVuIH0sCiAKLXsibkVsZW1lbnRDcmVhdGUiLCAgICAgICAgICAgICAgICAgIihJSVpJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluRWxlbWVudENyZWF0ZSB9LAoteyJuRWxlbWVudENyZWF0ZTIiLCAgICAgICAgICAgICAgICAiKFtJW0xqYXZhL2xhbmcvU3RyaW5nOylJIiwgICAgICAgICAgICAgKHZvaWQqKW5FbGVtZW50Q3JlYXRlMiB9LAorLy8gQWxsIG1ldGhvZHMgYmVsb3cgYXJlIHRocmVhZCBwcm90ZWN0ZWQgaW4gamF2YS4KK3sicnNuQ29udGV4dENyZWF0ZSIsICAgICAgICAgICAgICAgICAiKElJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dENyZWF0ZSB9LAoreyJyc25Db250ZXh0Q3JlYXRlR0wiLCAgICAgICAgICAgICAgICIoSUlJSUlJSUlJSUlJRilJIiwgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0Q3JlYXRlR0wgfSwKK3sicnNuQ29udGV4dEZpbmlzaCIsICAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEZpbmlzaCB9LAoreyJyc25Db250ZXh0U2V0UHJpb3JpdHkiLCAgICAgICAgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0U2V0UHJpb3JpdHkgfSwKK3sicnNuQ29udGV4dFNldFN1cmZhY2UiLCAgICAgICAgICAgICAiKElJSUxhbmRyb2lkL3ZpZXcvU3VyZmFjZTspViIsICAgICAgICAgICh2b2lkKiluQ29udGV4dFNldFN1cmZhY2UgfSwKK3sicnNuQ29udGV4dERlc3Ryb3kiLCAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dERlc3Ryb3kgfSwKK3sicnNuQ29udGV4dER1bXAiLCAgICAgICAgICAgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dER1bXAgfSwKK3sicnNuQ29udGV4dFBhdXNlIiwgICAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dFBhdXNlIH0sCit7InJzbkNvbnRleHRSZXN1bWUiLCAgICAgICAgICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRSZXN1bWUgfSwKK3sicnNuQXNzaWduTmFtZSIsICAgICAgICAgICAgICAgICAgICAiKElJW0IpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQXNzaWduTmFtZSB9LAoreyJyc25HZXROYW1lIiwgICAgICAgICAgICAgICAgICAgICAgICIoSUkpTGphdmEvbGFuZy9TdHJpbmc7IiwgICAgICAgICAgICAgICAgKHZvaWQqKW5HZXROYW1lIH0sCit7InJzbk9iakRlc3Ryb3kiLCAgICAgICAgICAgICAgICAgICAgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbk9iakRlc3Ryb3kgfSwKIAoteyJuVHlwZUJlZ2luIiwgICAgICAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5UeXBlQmVnaW4gfSwKLXsiblR5cGVBZGQiLCAgICAgICAgICAgICAgICAgICAgICAgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluVHlwZUFkZCB9LAoteyJuVHlwZUNyZWF0ZSIsICAgICAgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5UeXBlQ3JlYXRlIH0sCi17Im5UeXBlRmluYWxEZXN0cm95IiwgICAgICAgICAgICAgICIoTGFuZHJvaWQvcmVuZGVyc2NyaXB0L1R5cGU7KVYiLCAgICAgICAodm9pZCopblR5cGVGaW5hbERlc3Ryb3kgfSwKLXsiblR5cGVTZXR1cEZpZWxkcyIsICAgICAgICAgICAgICAgIihMYW5kcm9pZC9yZW5kZXJzY3JpcHQvVHlwZTtbSVtJW0xqYXZhL2xhbmcvcmVmbGVjdC9GaWVsZDspViIsICh2b2lkKiluVHlwZVNldHVwRmllbGRzIH0sCit7InJzbkZpbGVPcGVuIiwgICAgICAgICAgICAgICAgICAgICAgIihJW0IpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkZpbGVPcGVuIH0sCit7InJzbkZpbGVBM0RDcmVhdGVGcm9tQXNzZXRTdHJlYW0iLCAgIihJSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkZpbGVBM0RDcmVhdGVGcm9tQXNzZXRTdHJlYW0gfSwKK3sicnNuRmlsZUEzREdldE51bUluZGV4RW50cmllcyIsICAgICAiKElJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluRmlsZUEzREdldE51bUluZGV4RW50cmllcyB9LAoreyJyc25GaWxlQTNER2V0SW5kZXhFbnRyaWVzIiwgICAgICAgICIoSUlJW0lbTGphdmEvbGFuZy9TdHJpbmc7KVYiLCAgICAgICAgICAgKHZvaWQqKW5GaWxlQTNER2V0SW5kZXhFbnRyaWVzIH0sCit7InJzbkZpbGVBM0RHZXRFbnRyeUJ5SW5kZXgiLCAgICAgICAgIihJSUkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkZpbGVBM0RHZXRFbnRyeUJ5SW5kZXggfSwKIAoteyJuQWxsb2NhdGlvbkNyZWF0ZVR5cGVkIiwgICAgICAgICAiKEkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uQ3JlYXRlVHlwZWQgfSwKLXsibkFsbG9jYXRpb25DcmVhdGVGcm9tQml0bWFwIiwgICAgIihJWkxhbmRyb2lkL2dyYXBoaWNzL0JpdG1hcDspSSIsICAgICAgICh2b2lkKiluQWxsb2NhdGlvbkNyZWF0ZUZyb21CaXRtYXAgfSwKLXsibkFsbG9jYXRpb25DcmVhdGVCaXRtYXBSZWYiLCAgICAgIihJTGFuZHJvaWQvZ3JhcGhpY3MvQml0bWFwOylJIiwgICAgICAgICh2b2lkKiluQWxsb2NhdGlvbkNyZWF0ZUJpdG1hcFJlZiB9LAoteyJuQWxsb2NhdGlvbkNyZWF0ZUZyb21CaXRtYXBCb3hlZCIsIihJWkxhbmRyb2lkL2dyYXBoaWNzL0JpdG1hcDspSSIsICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uQ3JlYXRlRnJvbUJpdG1hcEJveGVkIH0sCi17Im5BbGxvY2F0aW9uQ3JlYXRlRnJvbUFzc2V0U3RyZWFtIiwiKElaSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25DcmVhdGVGcm9tQXNzZXRTdHJlYW0gfSwKLXsibkFsbG9jYXRpb25VcGxvYWRUb1RleHR1cmUiLCAgICAgIihJWkkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvblVwbG9hZFRvVGV4dHVyZSB9LAoteyJuQWxsb2NhdGlvblVwbG9hZFRvQnVmZmVyT2JqZWN0IiwiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uVXBsb2FkVG9CdWZmZXJPYmplY3QgfSwKLXsibkFsbG9jYXRpb25TdWJEYXRhMUQiLCAgICAgICAgICAgIihJSUlbSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvblN1YkRhdGExRF9pIH0sCi17Im5BbGxvY2F0aW9uU3ViRGF0YTFEIiwgICAgICAgICAgICIoSUlJW1NJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25TdWJEYXRhMURfcyB9LAoteyJuQWxsb2NhdGlvblN1YkRhdGExRCIsICAgICAgICAgICAiKElJSVtCSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uU3ViRGF0YTFEX2IgfSwKLXsibkFsbG9jYXRpb25TdWJEYXRhMUQiLCAgICAgICAgICAgIihJSUlbRkkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvblN1YkRhdGExRF9mIH0sCi17Im5BbGxvY2F0aW9uU3ViRGF0YTJEIiwgICAgICAgICAgICIoSUlJSUlbSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25TdWJEYXRhMkRfaSB9LAoteyJuQWxsb2NhdGlvblN1YkRhdGEyRCIsICAgICAgICAgICAiKElJSUlJW0ZJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uU3ViRGF0YTJEX2YgfSwKLXsibkFsbG9jYXRpb25SZWFkIiwgICAgICAgICAgICAgICAgIihJW0kpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvblJlYWRfaSB9LAoteyJuQWxsb2NhdGlvblJlYWQiLCAgICAgICAgICAgICAgICAiKElbRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uUmVhZF9mIH0sCi17Im5BbGxvY2F0aW9uU3ViRGF0YUZyb21PYmplY3QiLCAgICIoSUxhbmRyb2lkL3JlbmRlcnNjcmlwdC9UeXBlO0lMamF2YS9sYW5nL09iamVjdDspViIsICAgKHZvaWQqKW5BbGxvY2F0aW9uU3ViRGF0YUZyb21PYmplY3QgfSwKLXsibkFsbG9jYXRpb25TdWJSZWFkRnJvbU9iamVjdCIsICAgIihJTGFuZHJvaWQvcmVuZGVyc2NyaXB0L1R5cGU7SUxqYXZhL2xhbmcvT2JqZWN0OylWIiwgICAodm9pZCopbkFsbG9jYXRpb25TdWJSZWFkRnJvbU9iamVjdCB9LAoreyJyc25Gb250Q3JlYXRlRnJvbUZpbGUiLCAgICAgICAgICAgICIoSUxqYXZhL2xhbmcvU3RyaW5nO0lJKUkiLCAgICAgICAgICAgICAgKHZvaWQqKW5Gb250Q3JlYXRlRnJvbUZpbGUgfSwKIAoteyJuQWRhcHRlcjFEQmluZEFsbG9jYXRpb24iLCAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMURCaW5kQWxsb2NhdGlvbiB9LAoteyJuQWRhcHRlcjFEU2V0Q29uc3RyYWludCIsICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMURTZXRDb25zdHJhaW50IH0sCi17Im5BZGFwdGVyMUREYXRhIiwgICAgICAgICAgICAgICAgICIoSVtJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIxRERhdGFfaSB9LAoteyJuQWRhcHRlcjFERGF0YSIsICAgICAgICAgICAgICAgICAiKElbRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMUREYXRhX2YgfSwKLXsibkFkYXB0ZXIxRFN1YkRhdGEiLCAgICAgICAgICAgICAgIihJSUlbSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjFEU3ViRGF0YV9pIH0sCi17Im5BZGFwdGVyMURTdWJEYXRhIiwgICAgICAgICAgICAgICIoSUlJW0YpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIxRFN1YkRhdGFfZiB9LAoteyJuQWRhcHRlcjFEQ3JlYXRlIiwgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMURDcmVhdGUgfSwKK3sicnNuRWxlbWVudENyZWF0ZSIsICAgICAgICAgICAgICAgICAiKElJSVpJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluRWxlbWVudENyZWF0ZSB9LAoreyJyc25FbGVtZW50Q3JlYXRlMiIsICAgICAgICAgICAgICAgICIoSVtJW0xqYXZhL2xhbmcvU3RyaW5nO1tJKUkiLCAgICAgICAgICAgKHZvaWQqKW5FbGVtZW50Q3JlYXRlMiB9LAoreyJyc25FbGVtZW50R2V0TmF0aXZlRGF0YSIsICAgICAgICAgICIoSUlbSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5FbGVtZW50R2V0TmF0aXZlRGF0YSB9LAoreyJyc25FbGVtZW50R2V0U3ViRWxlbWVudHMiLCAgICAgICAgICIoSUlbSVtMamF2YS9sYW5nL1N0cmluZzspViIsICAgICAgICAgICAgKHZvaWQqKW5FbGVtZW50R2V0U3ViRWxlbWVudHMgfSwKIAoteyJuQWRhcHRlcjJEQmluZEFsbG9jYXRpb24iLCAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkRCaW5kQWxsb2NhdGlvbiB9LAoteyJuQWRhcHRlcjJEU2V0Q29uc3RyYWludCIsICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkRTZXRDb25zdHJhaW50IH0sCi17Im5BZGFwdGVyMkREYXRhIiwgICAgICAgICAgICAgICAgICIoSVtJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIyRERhdGFfaSB9LAoteyJuQWRhcHRlcjJERGF0YSIsICAgICAgICAgICAgICAgICAiKElbRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkREYXRhX2YgfSwKLXsibkFkYXB0ZXIyRFN1YkRhdGEiLCAgICAgICAgICAgICAgIihJSUlJSVtJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjJEU3ViRGF0YV9pIH0sCi17Im5BZGFwdGVyMkRTdWJEYXRhIiwgICAgICAgICAgICAgICIoSUlJSUlbRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIyRFN1YkRhdGFfZiB9LAoteyJuQWRhcHRlcjJEQ3JlYXRlIiwgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkRDcmVhdGUgfSwKK3sicnNuVHlwZUNyZWF0ZSIsICAgICAgICAgICAgICAgICAgICAiKElJW0lbSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluVHlwZUNyZWF0ZSB9LAoreyJyc25UeXBlR2V0TmF0aXZlRGF0YSIsICAgICAgICAgICAgICIoSUlbSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5UeXBlR2V0TmF0aXZlRGF0YSB9LAogCi17Im5TY3JpcHRCaW5kQWxsb2NhdGlvbiIsICAgICAgICAgICIoSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdEJpbmRBbGxvY2F0aW9uIH0sCi17Im5TY3JpcHRTZXRDbGVhckNvbG9yIiwgICAgICAgICAgICIoSUZGRkYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldENsZWFyQ29sb3IgfSwKLXsiblNjcmlwdFNldENsZWFyRGVwdGgiLCAgICAgICAgICAgIihJRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0Q2xlYXJEZXB0aCB9LAoteyJuU2NyaXB0U2V0Q2xlYXJTdGVuY2lsIiwgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRDbGVhclN0ZW5jaWwgfSwKLXsiblNjcmlwdFNldFRpbWVab25lIiwgICAgICAgICAgICAgIihJW0IpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0VGltZVpvbmUgfSwKLXsiblNjcmlwdFNldFR5cGUiLCAgICAgICAgICAgICAgICAgIihJWkxqYXZhL2xhbmcvU3RyaW5nO0kpViIsICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0VHlwZSB9LAoteyJuU2NyaXB0U2V0Um9vdCIsICAgICAgICAgICAgICAgICAiKFopViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRSb290IH0sCi17Im5TY3JpcHRTZXRJbnZva2FibGUiLCAgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7SSlWIiwgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldEludm9rZSB9LAoteyJuU2NyaXB0SW52b2tlIiwgICAgICAgICAgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRJbnZva2UgfSwKK3sicnNuQWxsb2NhdGlvbkNyZWF0ZVR5cGVkIiwgICAgICAgICAiKElJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvbkNyZWF0ZVR5cGVkIH0sCit7InJzbkFsbG9jYXRpb25VcGRhdGVGcm9tQml0bWFwIiwgICAgIihJSUxhbmRyb2lkL2dyYXBoaWNzL0JpdG1hcDspViIsICAgICAgICAodm9pZCopbkFsbG9jYXRpb25VcGRhdGVGcm9tQml0bWFwIH0sCit7InJzbkFsbG9jYXRpb25DcmVhdGVGcm9tQml0bWFwIiwgICAgIihJSVpMYW5kcm9pZC9ncmFwaGljcy9CaXRtYXA7KUkiLCAgICAgICAodm9pZCopbkFsbG9jYXRpb25DcmVhdGVGcm9tQml0bWFwIH0sCit7InJzbkFsbG9jYXRpb25DcmVhdGVCaXRtYXBSZWYiLCAgICAgIihJSUxhbmRyb2lkL2dyYXBoaWNzL0JpdG1hcDspSSIsICAgICAgICAodm9pZCopbkFsbG9jYXRpb25DcmVhdGVCaXRtYXBSZWYgfSwKK3sicnNuQWxsb2NhdGlvbkNyZWF0ZUZyb21Bc3NldFN0cmVhbSIsIihJSVpJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvbkNyZWF0ZUZyb21Bc3NldFN0cmVhbSB9LAoreyJyc25BbGxvY2F0aW9uVXBsb2FkVG9UZXh0dXJlIiwgICAgICIoSUlaSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uVXBsb2FkVG9UZXh0dXJlIH0sCit7InJzbkFsbG9jYXRpb25VcGxvYWRUb0J1ZmZlck9iamVjdCIsIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25VcGxvYWRUb0J1ZmZlck9iamVjdCB9LAoreyJyc25BbGxvY2F0aW9uU3ViRGF0YTFEIiwgICAgICAgICAgICIoSUlJSVtJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uU3ViRGF0YTFEX2kgfSwKK3sicnNuQWxsb2NhdGlvblN1YkRhdGExRCIsICAgICAgICAgICAiKElJSUlbU0kpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvblN1YkRhdGExRF9zIH0sCit7InJzbkFsbG9jYXRpb25TdWJEYXRhMUQiLCAgICAgICAgICAgIihJSUlJW0JJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25TdWJEYXRhMURfYiB9LAoreyJyc25BbGxvY2F0aW9uU3ViRGF0YTFEIiwgICAgICAgICAgICIoSUlJSVtGSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uU3ViRGF0YTFEX2YgfSwKK3sicnNuQWxsb2NhdGlvblN1YkVsZW1lbnREYXRhMUQiLCAgICAiKElJSUlbQkkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvblN1YkVsZW1lbnREYXRhMUQgfSwKK3sicnNuQWxsb2NhdGlvblN1YkRhdGEyRCIsICAgICAgICAgICAiKElJSUlJSVtJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvblN1YkRhdGEyRF9pIH0sCit7InJzbkFsbG9jYXRpb25TdWJEYXRhMkQiLCAgICAgICAgICAgIihJSUlJSUlbRkkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25TdWJEYXRhMkRfZiB9LAoreyJyc25BbGxvY2F0aW9uUmVhZCIsICAgICAgICAgICAgICAgICIoSUlbSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uUmVhZF9pIH0sCit7InJzbkFsbG9jYXRpb25SZWFkIiwgICAgICAgICAgICAgICAgIihJSVtGKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25SZWFkX2YgfSwKK3sicnNuQWxsb2NhdGlvbkdldFR5cGUiLCAgICAgICAgICAgICAiKElJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvbkdldFR5cGV9LAoreyJyc25BbGxvY2F0aW9uUmVzaXplMUQiLCAgICAgICAgICAgICIoSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uUmVzaXplMUQgfSwKK3sicnNuQWxsb2NhdGlvblJlc2l6ZTJEIiwgICAgICAgICAgICAiKElJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvblJlc2l6ZTJEIH0sCiAKLXsiblNjcmlwdENCZWdpbiIsICAgICAgICAgICAgICAgICAgIigpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0Q0JlZ2luIH0sCi17Im5TY3JpcHRDU2V0U2NyaXB0IiwgICAgICAgICAgICAgICIoW0JJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdENTZXRTY3JpcHQgfSwKLXsiblNjcmlwdENDcmVhdGUiLCAgICAgICAgICAgICAgICAgIigpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0Q0NyZWF0ZSB9LAoteyJuU2NyaXB0Q0FkZERlZmluZUkzMiIsICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0kpViIsICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRDQWRkRGVmaW5lSTMyIH0sCi17Im5TY3JpcHRDQWRkRGVmaW5lRiIsICAgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7RilWIiwgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdENBZGREZWZpbmVGIH0sCit7InJzbkFkYXB0ZXIxREJpbmRBbGxvY2F0aW9uIiwgICAgICAgIihJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIxREJpbmRBbGxvY2F0aW9uIH0sCit7InJzbkFkYXB0ZXIxRFNldENvbnN0cmFpbnQiLCAgICAgICAgIihJSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIxRFNldENvbnN0cmFpbnQgfSwKK3sicnNuQWRhcHRlcjFERGF0YSIsICAgICAgICAgICAgICAgICAiKElJW0kpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjFERGF0YV9pIH0sCit7InJzbkFkYXB0ZXIxRERhdGEiLCAgICAgICAgICAgICAgICAgIihJSVtGKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIxRERhdGFfZiB9LAoreyJyc25BZGFwdGVyMURTdWJEYXRhIiwgICAgICAgICAgICAgICIoSUlJSVtJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMURTdWJEYXRhX2kgfSwKK3sicnNuQWRhcHRlcjFEU3ViRGF0YSIsICAgICAgICAgICAgICAiKElJSUlbRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjFEU3ViRGF0YV9mIH0sCit7InJzbkFkYXB0ZXIxRENyZWF0ZSIsICAgICAgICAgICAgICAgIihJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIxRENyZWF0ZSB9LAogCi17Im5Qcm9ncmFtRnJhZ21lbnRTdG9yZUJlZ2luIiwgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1GcmFnbWVudFN0b3JlQmVnaW4gfSwKLXsiblByb2dyYW1GcmFnbWVudFN0b3JlRGVwdGhGdW5jIiwgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aEZ1bmMgfSwKLXsiblByb2dyYW1GcmFnbWVudFN0b3JlRGVwdGhNYXNrIiwgIihaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aE1hc2sgfSwKLXsiblByb2dyYW1GcmFnbWVudFN0b3JlQ29sb3JNYXNrIiwgIihaWlpaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVDb2xvck1hc2sgfSwKLXsiblByb2dyYW1GcmFnbWVudFN0b3JlQmxlbmRGdW5jIiwgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVCbGVuZEZ1bmMgfSwKLXsiblByb2dyYW1GcmFnbWVudFN0b3JlRGl0aGVyIiwgICAgIihaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVEaXRoZXIgfSwKLXsiblByb2dyYW1GcmFnbWVudFN0b3JlQ3JlYXRlIiwgICAgIigpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVDcmVhdGUgfSwKK3sicnNuQWRhcHRlcjJEQmluZEFsbG9jYXRpb24iLCAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjJEQmluZEFsbG9jYXRpb24gfSwKK3sicnNuQWRhcHRlcjJEU2V0Q29uc3RyYWludCIsICAgICAgICAiKElJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjJEU2V0Q29uc3RyYWludCB9LAoreyJyc25BZGFwdGVyMkREYXRhIiwgICAgICAgICAgICAgICAgICIoSUlbSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkREYXRhX2kgfSwKK3sicnNuQWRhcHRlcjJERGF0YSIsICAgICAgICAgICAgICAgICAiKElJW0YpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjJERGF0YV9mIH0sCit7InJzbkFkYXB0ZXIyRFN1YkRhdGEiLCAgICAgICAgICAgICAgIihJSUlJSUlbSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIyRFN1YkRhdGFfaSB9LAoreyJyc25BZGFwdGVyMkRTdWJEYXRhIiwgICAgICAgICAgICAgICIoSUlJSUlJW0YpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkRTdWJEYXRhX2YgfSwKK3sicnNuQWRhcHRlcjJEQ3JlYXRlIiwgICAgICAgICAgICAgICAiKEkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjJEQ3JlYXRlIH0sCiAKLXsiblByb2dyYW1CaW5kQ29uc3RhbnRzIiwgICAgICAgICAgIihJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUJpbmRDb25zdGFudHMgfSwKLXsiblByb2dyYW1CaW5kVGV4dHVyZSIsICAgICAgICAgICAgIihJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUJpbmRUZXh0dXJlIH0sCi17Im5Qcm9ncmFtQmluZFNhbXBsZXIiLCAgICAgICAgICAgICIoSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1CaW5kU2FtcGxlciB9LAoreyJyc25TY3JpcHRCaW5kQWxsb2NhdGlvbiIsICAgICAgICAgICIoSUlJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRCaW5kQWxsb2NhdGlvbiB9LAoreyJyc25TY3JpcHRTZXRUaW1lWm9uZSIsICAgICAgICAgICAgICIoSUlbQilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRUaW1lWm9uZSB9LAoreyJyc25TY3JpcHRJbnZva2UiLCAgICAgICAgICAgICAgICAgICIoSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRJbnZva2UgfSwKK3sicnNuU2NyaXB0SW52b2tlViIsICAgICAgICAgICAgICAgICAiKElJSVtCKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0SW52b2tlViB9LAoreyJyc25TY3JpcHRTZXRWYXJJIiwgICAgICAgICAgICAgICAgICIoSUlJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRWYXJJIH0sCit7InJzblNjcmlwdFNldFZhckoiLCAgICAgICAgICAgICAgICAgIihJSUlKKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldFZhckogfSwKK3sicnNuU2NyaXB0U2V0VmFyRiIsICAgICAgICAgICAgICAgICAiKElJSUYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0VmFyRiB9LAoreyJyc25TY3JpcHRTZXRWYXJEIiwgICAgICAgICAgICAgICAgICIoSUlJRClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRWYXJEIH0sCit7InJzblNjcmlwdFNldFZhclYiLCAgICAgICAgICAgICAgICAgIihJSUlbQilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldFZhclYgfSwKIAoteyJuUHJvZ3JhbUZyYWdtZW50Q3JlYXRlIiwgICAgICAgICAiKFtJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRDcmVhdGUgfSwKLXsiblByb2dyYW1GcmFnbWVudENyZWF0ZTIiLCAgICAgICAgIihMamF2YS9sYW5nL1N0cmluZztbSSlJIiwgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50Q3JlYXRlMiB9LAoreyJyc25TY3JpcHRDQmVnaW4iLCAgICAgICAgICAgICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRDQmVnaW4gfSwKK3sicnNuU2NyaXB0Q1NldFNjcmlwdCIsICAgICAgICAgICAgICAiKElbQklJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0Q1NldFNjcmlwdCB9LAoreyJyc25TY3JpcHRDQ3JlYXRlIiwgICAgICAgICAgICAgICAgICIoSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRDQ3JlYXRlIH0sCiAKLXsiblByb2dyYW1SYXN0ZXJDcmVhdGUiLCAgICAgICAgICAgIihJSVpaWilJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVJhc3RlckNyZWF0ZSB9LAoteyJuUHJvZ3JhbVJhc3RlclNldFBvaW50U2l6ZSIsICAgICAiKElGKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtUmFzdGVyU2V0UG9pbnRTaXplIH0sCi17Im5Qcm9ncmFtUmFzdGVyU2V0TGluZVdpZHRoIiwgICAgICIoSUYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1SYXN0ZXJTZXRMaW5lV2lkdGggfSwKK3sicnNuUHJvZ3JhbVN0b3JlQmVnaW4iLCAgICAgICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVN0b3JlQmVnaW4gfSwKK3sicnNuUHJvZ3JhbVN0b3JlRGVwdGhGdW5jIiwgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVN0b3JlRGVwdGhGdW5jIH0sCit7InJzblByb2dyYW1TdG9yZURlcHRoTWFzayIsICAgICAgICAgIihJWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1TdG9yZURlcHRoTWFzayB9LAoreyJyc25Qcm9ncmFtU3RvcmVDb2xvck1hc2siLCAgICAgICAgICIoSVpaWlopViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtU3RvcmVDb2xvck1hc2sgfSwKK3sicnNuUHJvZ3JhbVN0b3JlQmxlbmRGdW5jIiwgICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVN0b3JlQmxlbmRGdW5jIH0sCit7InJzblByb2dyYW1TdG9yZURpdGhlciIsICAgICAgICAgICAgIihJWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1TdG9yZURpdGhlciB9LAoreyJyc25Qcm9ncmFtU3RvcmVDcmVhdGUiLCAgICAgICAgICAgICIoSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtU3RvcmVDcmVhdGUgfSwKIAoteyJuUHJvZ3JhbVZlcnRleENyZWF0ZSIsICAgICAgICAgICAiKFopSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtVmVydGV4Q3JlYXRlIH0sCi17Im5Qcm9ncmFtVmVydGV4Q3JlYXRlMiIsICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7W0kpSSIsICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1WZXJ0ZXhDcmVhdGUyIH0sCit7InJzblByb2dyYW1CaW5kQ29uc3RhbnRzIiwgICAgICAgICAgIihJSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1CaW5kQ29uc3RhbnRzIH0sCit7InJzblByb2dyYW1CaW5kVGV4dHVyZSIsICAgICAgICAgICAgIihJSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1CaW5kVGV4dHVyZSB9LAoreyJyc25Qcm9ncmFtQmluZFNhbXBsZXIiLCAgICAgICAgICAgICIoSUlJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtQmluZFNhbXBsZXIgfSwKIAoteyJuTGlnaHRCZWdpbiIsICAgICAgICAgICAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5MaWdodEJlZ2luIH0sCi17Im5MaWdodFNldElzTW9ubyIsICAgICAgICAgICAgICAgICIoWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkxpZ2h0U2V0SXNNb25vIH0sCi17Im5MaWdodFNldElzTG9jYWwiLCAgICAgICAgICAgICAgICIoWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkxpZ2h0U2V0SXNMb2NhbCB9LAoteyJuTGlnaHRDcmVhdGUiLCAgICAgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5MaWdodENyZWF0ZSB9LAoteyJuTGlnaHRTZXRDb2xvciIsICAgICAgICAgICAgICAgICAiKElGRkYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5MaWdodFNldENvbG9yIH0sCi17Im5MaWdodFNldFBvc2l0aW9uIiwgICAgICAgICAgICAgICIoSUZGRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkxpZ2h0U2V0UG9zaXRpb24gfSwKK3sicnNuUHJvZ3JhbUZyYWdtZW50Q3JlYXRlIiwgICAgICAgICIoSUxqYXZhL2xhbmcvU3RyaW5nO1tJKUkiLCAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50Q3JlYXRlIH0sCiAKLXsibkNvbnRleHRCaW5kUm9vdFNjcmlwdCIsICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEJpbmRSb290U2NyaXB0IH0sCi17Im5Db250ZXh0QmluZFByb2dyYW1GcmFnbWVudFN0b3JlIiwiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRCaW5kUHJvZ3JhbUZyYWdtZW50U3RvcmUgfSwKLXsibkNvbnRleHRCaW5kUHJvZ3JhbUZyYWdtZW50IiwgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEJpbmRQcm9ncmFtRnJhZ21lbnQgfSwKLXsibkNvbnRleHRCaW5kUHJvZ3JhbVZlcnRleCIsICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEJpbmRQcm9ncmFtVmVydGV4IH0sCi17Im5Db250ZXh0QmluZFByb2dyYW1SYXN0ZXIiLCAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRCaW5kUHJvZ3JhbVJhc3RlciB9LAoreyJyc25Qcm9ncmFtUmFzdGVyQ3JlYXRlIiwgICAgICAgICAgICIoSVpaWilJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtUmFzdGVyQ3JlYXRlIH0sCit7InJzblByb2dyYW1SYXN0ZXJTZXRMaW5lV2lkdGgiLCAgICAgIihJSUYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1SYXN0ZXJTZXRMaW5lV2lkdGggfSwKK3sicnNuUHJvZ3JhbVJhc3RlclNldEN1bGxNb2RlIiwgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVJhc3RlclNldEN1bGxNb2RlIH0sCiAKLXsiblNhbXBsZXJCZWdpbiIsICAgICAgICAgICAgICAgICAgIigpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2FtcGxlckJlZ2luIH0sCi17Im5TYW1wbGVyU2V0IiwgICAgICAgICAgICAgICAgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNhbXBsZXJTZXQgfSwKLXsiblNhbXBsZXJDcmVhdGUiLCAgICAgICAgICAgICAgICAgIigpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2FtcGxlckNyZWF0ZSB9LAoreyJyc25Qcm9ncmFtVmVydGV4Q3JlYXRlIiwgICAgICAgICAgIihJTGphdmEvbGFuZy9TdHJpbmc7W0kpSSIsICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtVmVydGV4Q3JlYXRlIH0sCiAKLXsiblNpbXBsZU1lc2hDcmVhdGUiLCAgICAgICAgICAgICAgIihJSVtJSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2ltcGxlTWVzaENyZWF0ZSB9LAoteyJuU2ltcGxlTWVzaEJpbmRWZXJ0ZXgiLCAgICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TaW1wbGVNZXNoQmluZFZlcnRleCB9LAoteyJuU2ltcGxlTWVzaEJpbmRJbmRleCIsICAgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TaW1wbGVNZXNoQmluZEluZGV4IH0sCit7InJzbkNvbnRleHRCaW5kUm9vdFNjcmlwdCIsICAgICAgICAgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRCaW5kUm9vdFNjcmlwdCB9LAoreyJyc25Db250ZXh0QmluZFByb2dyYW1TdG9yZSIsICAgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFByb2dyYW1TdG9yZSB9LAoreyJyc25Db250ZXh0QmluZFByb2dyYW1GcmFnbWVudCIsICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFByb2dyYW1GcmFnbWVudCB9LAoreyJyc25Db250ZXh0QmluZFByb2dyYW1WZXJ0ZXgiLCAgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFByb2dyYW1WZXJ0ZXggfSwKK3sicnNuQ29udGV4dEJpbmRQcm9ncmFtUmFzdGVyIiwgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEJpbmRQcm9ncmFtUmFzdGVyIH0sCisKK3sicnNuU2FtcGxlckJlZ2luIiwgICAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2FtcGxlckJlZ2luIH0sCit7InJzblNhbXBsZXJTZXQiLCAgICAgICAgICAgICAgICAgICAgIihJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNhbXBsZXJTZXQgfSwKK3sicnNuU2FtcGxlclNldDIiLCAgICAgICAgICAgICAgICAgICAiKElJRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2FtcGxlclNldDIgfSwKK3sicnNuU2FtcGxlckNyZWF0ZSIsICAgICAgICAgICAgICAgICAiKEkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2FtcGxlckNyZWF0ZSB9LAorCit7InJzbk1lc2hDcmVhdGUiLCAgICAgICAgICAgICAgICAgICAgIihJSUkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbk1lc2hDcmVhdGUgfSwKK3sicnNuTWVzaEJpbmRWZXJ0ZXgiLCAgICAgICAgICAgICAgICAiKElJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluTWVzaEJpbmRWZXJ0ZXggfSwKK3sicnNuTWVzaEJpbmRJbmRleCIsICAgICAgICAgICAgICAgICAiKElJSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluTWVzaEJpbmRJbmRleCB9LAorCit7InJzbk1lc2hHZXRWZXJ0ZXhCdWZmZXJDb3VudCIsICAgICAgIihJSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbk1lc2hHZXRWZXJ0ZXhCdWZmZXJDb3VudCB9LAoreyJyc25NZXNoR2V0SW5kZXhDb3VudCIsICAgICAgICAgICAgICIoSUkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5NZXNoR2V0SW5kZXhDb3VudCB9LAoreyJyc25NZXNoR2V0VmVydGljZXMiLCAgICAgICAgICAgICAgICIoSUlbSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5NZXNoR2V0VmVydGljZXMgfSwKK3sicnNuTWVzaEdldEluZGljZXMiLCAgICAgICAgICAgICAgICAiKElJW0lbSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluTWVzaEdldEluZGljZXMgfSwKIAogfTsKIApAQCAtMTUxMCwzICsxMzg1LDQgQEAKIGJhaWw6CiAgICAgcmV0dXJuIHJlc3VsdDsKIH0KKwpkaWZmIC0tZ2l0IGEvZ3JhcGhpY3MvdGVzdHMvZ3JhcGhpY3N0ZXN0cy9zcmMvYW5kcm9pZC9ncmFwaGljcy9CaXRtYXBGYWN0b3J5VGVzdC5qYXZhIGIvZ3JhcGhpY3MvdGVzdHMvZ3JhcGhpY3N0ZXN0cy9zcmMvYW5kcm9pZC9ncmFwaGljcy9CaXRtYXBGYWN0b3J5VGVzdC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjA5ODIwZWYKLS0tIC9kZXYvbnVsbAorKysgYi9ncmFwaGljcy90ZXN0cy9ncmFwaGljc3R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QgPCAwIHx8IHNvdXJjZUxlbmd0aCA8IDAgfHwgc291cmNlU3RhcnQgKyBzb3VyY2VMZW5ndGggPiBzb3VyY2UubGVuZ3RoKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJiYWQgc291cmNlIHN0YXJ0ICgiICsgc291cmNlU3RhcnQgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKSBvciBsZW5ndGggKCIgKyBzb3VyY2VMZW5ndGggKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKSBmb3IgYnVmZmVyIG9mIGxlbmd0aCAiICsgc291cmNlLmxlbmd0aCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGRlc3QgPT0gbnVsbCAmJiBkZXN0U2l6ZSAhPSAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJudWxsIGRlc3QgcmVxdWlyZXMgZGVzdFNpemUgPT0gMCIpOworICAgICAgICB9CisgICAgICAgIGlmICgoZGVzdFNpemUgIT0gMCkgJiYKKyAgICAgICAgICAgIChkZXN0U3RhcnQgPCAwIHx8IGRlc3RTaXplIDwgMCB8fCBkZXN0U3RhcnQgKyBkZXN0U2l6ZSA+IGRlc3QubGVuZ3RoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiYmFkIGRlc3Qgc3RhcnQgKCIgKyBkZXN0U3RhcnQgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKSBvciBzaXplICgiICsgZGVzdFNpemUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKSBmb3IgYnVmZmVyIG9mIGxlbmd0aCAiICsgZGVzdC5sZW5ndGgpOworICAgICAgICB9CisgICAgICAgIC8qIFZhbGlkYXRlIGlucHV0IG9wdGlvbnMgKi8KKyAgICAgICAgaWYgKCAoKG9wdGlvbnMmVEFTSEtFRUxfTUFTSykgPiAwKSAmJgorICAgICAgICAgICAgICEoKChvcHRpb25zICYgVEFTSEtFRUxfTUFTSyk9PVRBU0hLRUVMX0JFR0lOKSAgfHwKKyAgICAgICAgICAgICAgICgob3B0aW9ucyAmIFRBU0hLRUVMX01BU0spPT1UQVNIS0VFTF9FTkQgKSAgIHx8CisgICAgICAgICAgICAgICAoKG9wdGlvbnMgJiBUQVNIS0VFTF9NQVNLKT09VEFTSEtFRUxfUkVTSVpFICl8fAorICAgICAgICAgICAgICAgKChvcHRpb25zICYgVEFTSEtFRUxfTUFTSyk9PVRBU0hLRUVMX1JFUExBQ0VfQllfVEFUV0VFTCkpICl7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJXcm9uZyBUYXNoa2VlbCBhcmd1bWVudCIpOworICAgICAgICB9CisKKyAgICAgICAvLy9DTE9WRVI6T0ZGCisgICAgICAgLy9BY2NvcmRpbmcgdG8gU3RldmVuIExvb21pcywgdGhlIGNvZGUgaXMgdW5yZWFjaGFibGUgd2hlbiB5b3UgT1IgYWxsIHRoZSBjb25zdGFudHMgd2l0aGluIHRoZSBpZiBzdGF0ZW1lbnRzCisgICAgICAgaWYoKChvcHRpb25zJkxBTUFMRUZfTUFTSykgPiAwKSYmCisgICAgICAgICAgICAgICEoKChvcHRpb25zICYgTEFNQUxFRl9NQVNLKT09TEFNQUxFRl9CRUdJTikgIHx8CisgICAgICAgICAgICAgICAgKChvcHRpb25zICYgTEFNQUxFRl9NQVNLKT09TEFNQUxFRl9FTkQgKSAgIHx8CisgICAgICAgICAgICAgICAgKChvcHRpb25zICYgTEFNQUxFRl9NQVNLKT09TEFNQUxFRl9SRVNJWkUgKXx8CisgICAgICAgICAgICAgICAgICgob3B0aW9ucyAmIExBTUFMRUZfTUFTSyk9PUx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VhbCBvcmRlciBvciBpbiBsb2dpY2FsIG9yZGVyLjxicj4KKyAgICAgKiAnTEVUVEVSU19TSEFQRScgZmxhZ3MgY29udHJvbCB3aGV0aGVyIGNvbnZlcnNpb24gaXMgdG8gb3IgZnJvbQorICAgICAqIHByZXNlbnRhdGlvbiBmb3Jtcy48YnI+CisgICAgICogJ0RJR0lUUycgZmxhZ3MgY29udHJvbCB3aGV0aGVyIGRpZ2l0cyBhcmUgc2hhcGVkLCBhbmQgd2hldGhlciBmcm9tCisgICAgICogRXVyb3BlYW4gdG8gQXJhYmljLUluZGljIG9yIHZpY2UtdmVyc2EuPGJyPgorICAgICAqICdESUdJVF9UWVBFJyBmbGFncyBjb250cm9sIHdoZXRoZXIgc3RhbmRhcmQgb3IgZXh0ZW5kZWQgQXJhYmljLUluZGljCisgICAgICogZGlnaXRzIGFyZSB1c2VkIHdoZW4gcGVyZm9ybWluZyBkaWdpdCBjb252ZXJzaW9uLgorICAgICAqIEBzdGFibGUgSUNVIDIuMAorICAgICAqLworICAgIHB1YmxpYyBBcmFiaWNTaGFwaW5nKGludCBvcHRpb25zKSB7CisgICAgICAgIHRoaXMub3B0aW9ucyA9IG9wdGlvbnM7CisgICAgICAgIGlmICgob3B0aW9ucyAmIERJR0lUU19NQVNLKSA+IDB4ODApIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImJhZCBESUdJVFMgb3B0aW9ucyIpOworICAgICAgICB9CisKKyAgICAgICAgaXNMb2dpY2FsID0gKCAob3B0aW9ucyAmIFRFWFRfRElSRUNUSU9OX01BU0spID09IFRFWFRfRElSRUNUSU9OX0xPR0lDQUwgKTsKKyAgICAgICAgLyogVmFsaWRhdGUgb3B0aW9ucyAqLworICAgICAgICBzcGFjZXNSZWxhdGl2ZVRvVGV4dEJlZ2luRW5kID0gKCAob3B0aW9ucyAmIFNQQUNFU19SRUxBVElWRV9UT19URVhUX01BU0spID09IFNQQUNFU19SRU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gLyoqCisgICAgICogQml0IG1hc2sgZm9yIGxldHRlciBzaGFwaW5nIG9wdGlvbnMuCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgTEVUVEVSU19NQVNLID0gMHgxODsKKworCisgICAgLyoqCisgICAgICogRGlnaXQgc2hhcGluZyBvcHRpb246IGRvIG5vdCBwZXJmb3JtIGRpZ2l0IHNoYXBpbmcuCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRElHSVRTX05PT1AgPSAwOworCisgICAgLyoqCisgICAgICogRGlnaXQgc2hhcGluZyBvcHRpb246IFJlcGxhY2UgRXVyb3BlYW4gZGlnaXRzIChVKzAwMzAuLi5VKzAwMzkpIGJ5IEFyYWJpYy1JbmRpYyBkaWdpdHMuCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRElHSVRTX0VOMkFOID0gMHgyMDsKKworICAgIC8qKgorICAgICAqIERpZ2l0IHNoYXBpbmcgb3B0aW9uOiBSZXBsYWNlIEFyYWJpYy1JbmRpYyBkaWdpdHMgYnkgRXVyb3BlYW4gZGlnaXRzIChVKzAwMzAuLi5VKzAwMzkpLgorICAgICAqIEBzdGFibGUgSUNVIDIuMAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IERJR0lUU19BTjJFTiA9IDB4NDA7CisKKyAgICAvKioKKyAgICAgKiBEaWdpdCBzaGFwaW5nIG9wdGlvbjoKKyAgICAgKiBSZXBsYWNlIEV1cm9wZWFuIGRpZ2l0cyAoVSswMDMwLi4uVSswMDM5KSBieSBBcmFiaWMtSW5kaWMgZGlnaXRzCisgICAgICogaWYgdGhlIG1vc3QgcmVjZW50IHN0cm9uZ2x5IGRpcmVjdGlvbmFsIGNoYXJhY3RlcgorICAgICAqIG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GljIGZpbmFsIGNoYXIgTkVXX1RBSUxfQ0hBUiA9ICdcdUZFNzMnOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGNoYXIgT0xEX1RBSUxfQ0hBUiA9ICdcdTIwMEInOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTSEFQRV9NT0RFICAgICAgPSAwOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBERVNIQVBFX01PREUgICAgPSAxOworCisgICAgLyoqCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gZXF1YWxzKE9iamVjdCByaHMpIHsKKyAgICAgICAgcmV0dXJuIHJocyAhPSBudWxsICYmCisgICAgICAgICAgICByaHMuZ2V0Q2xhc3MoKSA9PSBBcmFiaWNTaGFwaW5nLmNsYXNzICYmCisgICAgICAgICAgICBvcHRpb25zID09ICgoQXJhYmljU2hhcGluZylyaHMpLm9wdGlvbnM7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgIC8vL0NMT1ZFUjpPRkYKKyAgICBwdWJsaWMgaW50IGhhc2hDb2RlKCkgeworICAgICAgICByZXR1cm4gb3B0aW9uczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAc3RhYmxlIElDVSAyLjAKKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICBTdHJpbmdCdWZmZXIgYnVmID0gbmV3IFN0cmluZ0J1ZmZlcihzdXBlci50b1N0cmluZygpKTsKKyAgICAgICAgYnVmLmFwcGVuZCgnWycpOworCisgICAgICAgIHN3aXRjaCAob3B0aW9ucyAmIExBTUFMRUZfTUFTSykgeworICAgICAgICBjYXNlIExBTUFMRUZfUkVTSVpFOiBidWYuYXBwZW5kKCJMYW1BbGVmIHJlc2l6ZSIpOyBicmVhazsKKyAgICAgICAgY2FzZSBMQU1BTEVGX05FQVI6IG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pbnQgTElOS0wgPSAyOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBMSU5LX01BU0sgPSAzOworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IGlycmVsZXZhbnRQb3NbXSA9IHsKKyAgICAgICAgMHgwLCAweDIsIDB4NCwgMHg2LCAweDgsIDB4QSwgMHhDLCAweEUKKyAgICB9OworCisvKgorICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGNoYXIgY29udmVydExhbUFsZWZbXSA9ICB7CisgICAgICAgICdcdTA2MjInLCAvLyBGRUY1CisgICAgICAgICdcdTA2MjInLCAvLyBGRUY2CisgICAgICAgICdcdTA2MjMnLCAvLyBGRUY3CisgICAgICAgICdcdTA2MjMnLCAvLyBGRUY4CisgICAgICAgICdcdTA2MjUnLCAvLyBGRUY5CisgICAgICAgICdcdTA2MjUnLCAvLyBGRUZBCisgICAgICAgICdcdTA2MjcnLCAvLyBGRUZCCisgICAgICAgICdcdTA2MjcnICAvLyBGRUZDCisgICAgfTsKKyovCisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgdGFpbEZhbWlseUlzb2xhdGVkRmluYWxbXSA9IHsKKyAgICAgICAgLyogRkVCMSAqLyAxLAorICAgICAgICAvKiBGRUIyICovIDEsCisgICAgICAgIC8qIEZFQjMgKi8gMCwKKyAgICAgICAgLyogRkVCNCAqLyAwLAorICAgICAgICAvKiBGRUI1ICovIDEsCisgICAgICAgIC8qIEZFQjYgKi8gMSwKKyAgICAgICAgLyogRkVCNyAqLyAwLAorICAgICAgICAvKiBGRUI4ICovIDAsCisgICAgICAgIC8qIEZFQjkgKi8gMSwKKyAgICAgICAgLyogRkVCQSAqLyAxLAorICAgICAgICAvKiBGRUJCICovIDAsCisgICAgICAgIC8qIEZFQkMgKi8gMCwKKyAgICAgICAgLyogRkVCRCAqLyAxLAorICAgICAgICAvKiBGRUJFICovIDEKKyAgICB9OworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IHRhc2hrZWVsTWVkaWFsW10gPSB7CisgICAgICAgIC8qIEZFNzAgKi8gMCwKKyAgICAgICAgLyogRkU3MSAqLyAxLAorICAgICAgICAvKiBGRTcyICovIDAsCisgICAgICAgIC8qIEZFNzMgKi8gMCwKKyAgICAgICAgLyogRkU3NCAqLyAwLAorICAgICAgICAvKiBGRTc1ICovIDAsCisgICAgICAgIC8qIEZFNzYgKi8gMCwKKyAgICAgICAgLyogRkU3NyAqLyAxLAorICAgICAgICAvKiBGRTc4ICovIDAsCisgICAgICAgIC8qIEZFNzkgKi8gMSwKKyAgICAgICAgLyogRkU3QSAqLyAwLAorICAgICAgICAvKiBGRTdCICovIDEsCisgICAgICAgIC8qIEZFN0MgKi8gMCwKKyAgICAgICAgLyogRkU3RCAqLyAxLAorICAgICAgICAvKiBGRTdFICovIDAsCisgICAgICAgIC8qIEZFN0YgKi8gMQorICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBjaGFyIHllaEhhbXphVG9ZZWhbXSA9CisgICAgeworICAgIC8qIGlzb2xhdGVkKi8gMHhGRUVGLAorICAgIC8qIGZpbmFsICAgKi8gMHhGRUYwCisgICAgfTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGNoYXIgY29udmVydE5vcm1hbGl6ZWRMYW1BbGVmW10gPSB7CisgICAgICAgICdcdTA2MjInLCAvLyAwNjVDCisgICAgICAgICdcdTA2MjMnLCAvLyAwNjVECisgICAgICAgICdcdTA2MjUnLCAvLyAwNjVFCisgICAgICAgICdcdTA2MjcnLCAvLyAwNjVGCisgICAgfTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludFtdIGFyYUxpbmsgPSB7CisgICAgICAgIDEgICAgICAgICAgICsgMzIgKyAyNTYgKiAweDExLCAgLyoweDA2MjIqLworICAgICAgICAxICAgICAgICAgICArIDMyICsgMjU2ICogMHgxMywgIC8qMHgwNjIzKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4MTUsICAvKjB4MDYyNCovCisgICAgICAgIDEgICAgICAgICAgICsgMzIgKyAyNTYgKiAweDE3LCAgLyoweDA2MjUqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHgxOSwgIC8qMHgwNjI2Ki8KKyAgICAgICAgMSAgICAgICAgICAgKyAzMiArIDI1NiAqIDB4MUQsICAvKjB4MDYyNyovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDFGLCAgLyoweDA2MjgqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHgyMywgIC8qMHgwNjI5Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4MjUsICAvKjB4MDYyQSovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDI5LCAgLyoweDA2MkIqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHgyRCwgIC8qMHgwNjJDKi8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4MzEsICAvKjB4MDYyRCovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDM1LCAgLyoweDA2MkUqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHgzOSwgIC8qMHgwNjJGKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4M0IsICAvKjB4MDYzMCovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDNELCAgLyoweDA2MzEqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHgzRiwgIC8qMHgwNjMyKi8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NDEsICAvKjB4MDYzMyovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDQ1LCAgLyoweDA2MzQqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg0OSwgIC8qMHgwNjM1Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NEQsICAvKjB4MDYzNiovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDUxLCAgLyoweDA2MzcqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg1NSwgIC8qMHgwNjM4Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NTksICAvKjB4MDYzOSovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDVELCAgLyoweDA2M0EqLworICAgICAgICAwLCAwLCAwLCAwLCAwLCAgICAgICAgICAgICAgICAgIC8qMHgwNjNCLTB4MDYzRiovCisgICAgICAgIDEgKyAyLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2NDAqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg2MSwgIC8qMHgwNjQxKi8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NjUsICAvKjB4MDY0MiovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDY5LCAgLyoweDA2NDMqLworICAgICAgICAxICsgMiAgICAgICArIDE2ICsgMjU2ICogMHg2RCwgIC8qMHgwNjQ0Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NzEsICAvKjB4MDY0NSovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDc1LCAgLyoweDA2NDYqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg3OSwgIC8qMHgwNjQ3Ki8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4N0QsICAvKjB4MDY0OCovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDdGLCAgLyoweDA2NDkqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg4MSwgIC8qMHgwNjRBKi8KKyAgICAgICAgNCwgNCwgNCwgNCwgICAgICAgICAgICAgICAgICAgICAvKjB4MDY0Qi0weDA2NEUqLworICAgICAgICA0LCA0LCA0LCA0LCAgICAgICAgICAgICAgICAgICAgIC8qMHgwNjRGLTB4MDY1MiovCisgICAgICAgIDQsIDQsIDQsIDAsIDAsICAgICAgICAgICAgICAgICAgLyoweDA2NTMtMHgwNjU3Ki8KKyAgICAgICAgMCwgMCwgMCwgMCwgICAgICAgICAgICAgICAgICAgICAvKjB4MDY1OC0weDA2NUIqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHg4NSwgIC8qMHgwNjVDKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4ODcsICAvKjB4MDY1RCovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDg5LCAgLyoweDA2NUUqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHg4QiwgIC8qMHgwNjVGKi8KKyAgICAgICAgMCwgMCwgMCwgMCwgMCwgICAgICAgICAgICAgICAgICAvKjB4MDY2MC0weDA2NjQqLworICAgICAgICAwLCAwLCAwLCAwLCAwLCAgICAgICAgICAgICAgICAgIC8qMHgwNjY1LTB4MDY2OSovCisgICAgICAgIDAsIDAsIDAsIDAsIDAsIDAsICAgICAgICAgICAgICAgLyoweDA2NkEtMHgwNjZGKi8KKyAgICAgICAgNCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDY3MCovCisgICAgICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2NzEqLworICAgICAgICAxICAgICAgICAgICArIDMyLCAgICAgICAgICAgICAgIC8qMHgwNjcyKi8KKyAgICAgICAgMSAgICAgICAgICAgKyAzMiwgICAgICAgICAgICAgICAvKjB4MDY3MyovCisgICAgICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2NzQqLworICAgICAgICAxICAgICAgICAgICArIDMyLCAgICAgICAgICAgICAgIC8qMHgwNjc1Ki8KKyAgICAgICAgMSwgMSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDY3Ni0weDA2NzcqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAgIC8qMHgwNjc4LTB4MDY3RCovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsICAgLyoweDA2N0UtMHgwNjgzKi8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAgICAgICAgICAgICAvKjB4MDY4NC0weDA2ODcqLworICAgICAgICAxLCAxLCAxLCAxLCAxLCAxLCAxLCAxLCAxLCAxLCAgIC8qMHgwNjg4LTB4MDY5MSovCisgICAgICAgIDEsIDEsIDEsIDEsIDEsIDEsIDEsIDEsICAgICAgICAgLyoweDA2OTItMHgwNjk5Ki8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgICAvKjB4MDY5QS0weDA2QTMqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsICAgICAgICAgICAgIC8qMHgwNjlBLTB4MDZBMyovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsICAgLyoweDA2QTQtMHgwNkFEKi8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAgICAgICAgICAgICAvKjB4MDZBNC0weDA2QUQqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAgIC8qMHgwNkFFLTB4MDZCNyovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgICAgICAgICAgICAgLyoweDA2QUUtMHgwNkI3Ki8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgICAvKjB4MDZCOC0weDA2QkYqLworICAgICAgICAxKzIsIDErMiwgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNkI4LTB4MDZCRiovCisgICAgICAgIDEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2QzAqLworICAgICAgICAxKzIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNkMxKi8KKyAgICAgICAgMSwgMSwgMSwgMSwgMSwgMSwgMSwgMSwgMSwgMSwgICAvKjB4MDZDMi0weDA2Q0IqLworICAgICAgICAxKzIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNkNDKi8KKyAgICAgICAgMSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDZDRCovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgICAgICAgICAgICAgLyoweDA2Q0UtMHgwNkQxKi8KKyAgICAgICAgMSwgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDZEMi0weDA2RDMqLworICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnRbXSBwcmVzTGluayA9IHsKKyAgICAgICAgMSArIDIsICAgICAgICAgICAgICAgICAgICAgICAgLyoweEZFNzAqLworICAgICAgICAxICsgMiwgICAgICAgICAgICAgICAgICAgICAgICAvKjB4RkU3MSovCisgICAgICAgIDEgKyAyLCAwLCAxKyAyLCAwLCAxKyAyLCAgICAgIC8qMHhGRTcyLTB4RkU3NiovCisgICAgICAgIDEgKyAyLCAgICAgICAgICAgICAgICAgICAgICAgIC8qMHhGRTc3Ki8KKyAgICAgICAgMSsgMiwgMSArIDIsIDErMiwgMSArIDIsICAgICAgLyoweEZFNzgtMHhGRTgxKi8KKyAgICAgICAgMSsgMiwgMSArIDIsIDErMiwgMSArIDIsICAgICAgLyoweEZFODItMHhGRTg1Ki8KKyAgICAgICAgMCwgMCArIDMyLCAxICsgMzIsIDAgKyAzMiwgICAgLyoweEZFODYtMHhGRTg5Ki8KKyAgICAgICAgMSArIDMyLCAwLCAxLCAgMCArIDMyLCAgICAgICAgLyoweEZFOEEtMHhGRThEKi8KKyAgICAgICAgMSArIDMyLCAwLCAyLCAgMSArIDIsICAgICAgICAgLyoweEZFOEUtMHhGRTkxKi8KKyAgICAgICAgMSwgMCArIDMyLCAxICsgMzIsIDAsICAgICAgICAgLyoweEZFOTItMHhGRTk1Ki8KKyAgICAgICAgMiwgMSArIDIsIDEsIDAsICAgICAgICAgICAgICAgLyoweEZFOTYtMHhGRTk5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFOUEtMHhGRTlEKi8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFOUUtMHhGRUExKi8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFQTItMHhGRUE1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFQTYtMHhGRUE5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFQUEtMHhGRUFEKi8KKyAgICAgICAgMSwgMCwgMSwgMCwgICAgICAgICAgICAgICAgICAgLyoweEZFQUUtMHhGRUIxKi8KKyAgICAgICAgMSwgMCwgMSwgMCwgICAgICAgICAgICAgICAgICAgLyoweEZFQjItMHhGRUI1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQjYtMHhGRUI5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQkEtMHhGRUJEKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQkUtMHhGRUMxKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQzItMHhGRUM1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQzYtMHhGRUM5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQ0EtMHhGRUNEKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQ0UtMHhGRUQxKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRDItMHhGRUQ1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRDYtMHhGRUQ5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFREEtMHhGRUREKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFREUtMHhGRUUxKi8KKyAgICAgICAgMSwgMCArIDE2LCAyICsgMTYsIDEgKyAyICsxNiwgLyoweEZFRTItMHhGRUU1Ki8KKyAgICAgICAgMSArIDE2LCAwLCAyLCAxKzIsICAgICAgICAgICAgLyoweEZFRTYtMHhGRUU5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRUEtMHhGRUVEKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRUUtMHhGRUYxKi8KKyAgICAgICAgMSwgMCwgMSwgMCwgICAgICAgICAgICAgICAgICAgLyoweEZFRjItMHhGRUY1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRjYtMHhGRUY5Ki8KKyAgICAgICAgMSwgMCwgMSwgMCwgICAgICAgICAgICAgICAgICAgLyoweEZFRkEtMHhGRUZEKi8KKyAgICAgICAgMSwgMCwgMSwgMCwKKyAgICAgICAgMQorICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBpbnRbXSBjb252ZXJ0RkV0bzA2ID0geworICAgICAgICAvKioqKioqKioqKiowKioqKioqMSoqKioqKjIqKioqKiozKioqKioqNCoqKio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ZXJzLiAgRGF0YSBpcyBpbiB2aXN1YWwKKyAgICAgKiBvcmRlci4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgc2hhcGVUb0FyYWJpY0RpZ2l0c1dpdGhDb250ZXh0KGNoYXJbXSBkZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgZGlnaXRCYXNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBsYXN0U3Ryb25nV2FzQUwpIHsKKyAgICAgICAgZGlnaXRCYXNlIC09ICcwJzsgLy8gbW92ZSBjb21tb24gYWRqdXN0bWVudCBvdXQgb2YgbG9vcAorCisgICAgICAgIGZvcihpbnQgaSA9IHN0YXJ0ICsgbGVuZ3RoOyAtLWkgPj0gc3RhcnQ7KSB7CisgICAgICAgICAgICBjaGFyIGNoID0gZGVzdFtpXTsKKyAgICAgICAgICAgIHN3aXRjaCAoQ2hhcmFjdGVyLmdldERpcmVjdGlvbmFsaXR5KGNoKSkgeworICAgICAgICAgICAgY2FzZSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfTEVGVF9UT19SSUdIVDoKKyAgICAgICAgICAgIGNhc2UgQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQ6CisgICAgICAgICAgICAgICAgbGFzdFN0cm9uZ1dhc0FMID0gZmFsc2U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUX0FSQUJJQzoKKyAgICAgICAgICAgICAgICBsYXN0U3Ryb25nV2FzQUwgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSOgorICAgICAgICAgICAgICAgIGlmIChsYXN0U3Ryb25nV2FzQUwgJiYgY2ggPD0gJ1x1MDAzOScpIHsKKyAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IChjaGFyKShjaCArIGRpZ2l0QmFzZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGludmVydEJ1ZmZlcgorICAgICAqIEZ1bmN0aW9uOiBUaGlzIGZ1bmN0aW9uIGludmVydHMgdGhlIGJ1ZmZlciwgaXQncyB1c2VkCisgICAgICogICAgICAgICAgIGluIGNhc2UgdGhlIHVzZXIgc3BlY2lmaWVzIHRoZSBidWZmZXIgdG8gYmUKKyAgICAgKiAgICAgICAgICAgVEVYVF9ESVJFQ1RJT05fTE9HSUNBTAorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgaW52ZXJ0QnVmZmVyKGNoYXJbXSBidWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZW5ndGgpIHsKKworICAgICAgICBmb3IoaW50IGkgPSBzdGFydCwgaiA9IHN0YXJ0ICsgbGVuZ3RoIC0gMTsgaSA8IGo7IGkrKywgLS1qKSB7CisgICAgICAgICAgICBjaGFyIHRlbXAgPSBidWZmZXJbaV07CisgICAgICAgICAgICBidWZmZXJbaV0gPSBidWZmZXJbal07CisgICAgICAgICAgICBidWZmZXJbal0gPSB0ZW1wOworICAgICAgICB9CisgIC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aW9uIHJldHVybnMgMSBvciAyIGZvciB0aGVzZSBzcGVjaWFsIGNoYXJhY3RlcnMKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgc3BlY2lhbENoYXIoY2hhciBjaCkgeworICAgICAgICBpZiAoKGNoID4gJ1x1MDYyMScgJiYgY2ggPCAnXHUwNjI2JykgfHwKKyAgICAgICAgICAgIChjaCA9PSAnXHUwNjI3JykgfHwKKyAgICAgICAgICAgIChjaCA+ICdcdTA2MkUnICYmIGNoIDwgJ1x1MDYzMycpIHx8CisgICAgICAgICAgICAoY2ggPiAnXHUwNjQ3JyAmJiBjaCA8ICdcdTA2NEEnKSB8fAorICAgICAgICAgICAgKGNoID09ICdcdTA2MjknKSkgeworICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgIH0gZWxzZSBpZiAoY2ggPj0gJ1x1MDY0QicgJiYgY2g8PSAnXHUwNjUyJykgeworICAgICAgICAgICAgcmV0dXJuIDI7CisgICAgICAgIH0gZWxzZSBpZiAoY2ggPj0gMHgwNjUzICYmIGNoIDw9IDB4MDY1NSB8fAorICAgICAgICAgICAgICAgICAgIGNoID09IDB4MDY3MCB8fAorICAgICAgICAgICAgICAgICAgIGNoID49IDB4RkU3MCAmJiBjaCA8PSAweEZFN0YpIHsKKyAgICAgICAgICAgIHJldHVybiAzOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBnZXRMaW5rCisgICAgICogRnVuY3Rpb246IFJlc29sdmVzIHRoZSBsaW5rIGJldHdlZW4gdGhlIGNoYXJhY3RlcnMgYXMKKyAgICAgKiAgICAgICAgICAgQXJhYmljIGNoYXJhY3RlcnMgaGF2ZSBmb3VyIGZvcm1zIDoKKyAgICAgKiAgICAgICAgICAgSXNvbGF0ZWQsIEluaXRpYWwsIE1pZGRsZSBhbmQgRmluYWwgRm9ybQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGludCBnZXRMaW5rKGNoYXIgY2gpIHsKKyAgICAgICAgaWYgKGNoID49ICdcdTA2MjInICYmIGNoIDw9ICdcdTA2RDMnKSB7CisgICAgICAgICAgICByZXR1cm4gYXJhTGlua1tjaCAtICdcdTA2MjInXTsKKyAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnXHUyMDBEJykgeworICAgICAgICAgICAgcmV0dXJuIDM7CisgICAgICAgIH0gZWxzZSBpZiAoY2ggPj0gJ1x1MjA2RCcgJiYgY2ggPD0gJ1x1MjA2RicpIHsKKyAgICAgICAgICAgIHJldHVybiA0OworICAgICAgICB9IGVsc2UgaWYgKGNoID49ICdcdUZFNzAnICYmIGNoIDw9ICdcdUZFRkMnKSB7CisgICAgICAgICAgICByZXR1cm4gcHJlc0xpbmtbY2ggLSAnXHVGRTcwJ107CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGNvdW50U3BhY2VzCisgICAgICogRnVuY3Rpb246IENvdW50cyB0aGUgbnVtYmVyIG9mIHNwYWNlcworICAgICAqICAgICAgICAgICBhdCBlYWNoIGVuZCBvZiB0aGUgbG9naWNhbCBidWZmZXIKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgY291bnRTcGFjZXNMZWZ0KGNoYXJbXSBkZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50KSB7CisgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCwgZSA9IHN0YXJ0ICsgY291bnQ7IGkgPCBlOyArK2kpIHsKKyAgICAgICAgICAgIGlmIChkZXN0W2ldICE9IFNQQUNFX0NIQVIpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gaSAtIHN0YXJ0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBjb3VudDsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgY291bnRTcGFjZXNSaWdodChjaGFyW10gZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50KSB7CisKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0ICsgY291bnQ7IC0taSA+PSBzdGFydDspIHsKKyAgICAgICAgICAgIGlmIChkZXN0W2ldICE9IFNQQUNFX0NIQVIpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gc3RhcnQgKyBjb3VudCAtIDEgLSBpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBjb3VudDsKKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBpc1Rhc2hrZWVsQ2hhcgorICAgICAqIEZ1bmN0aW9uOiBSZXR1cm5zIHRydWUgZm9yIFRhc2hrZWVsIGNoYXJhY3RlcnMgZWxzZSByZXR1cm4gZmFsc2UKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzVGFzaGtlZWxDaGFyKGNoYXIgY2gpIHsKKyAgICAgICAgcmV0dXJuICggY2ggPj0nXHUwNjRCJyAmJiBjaCA8PSAnXHUwNjUyJyApOworICAgIH0KKworICAgIC8qCisgICAgICpOYW1lICAgICA6IGlzU2VlblRhaWxGYW1pbHlDaGFyCisgICAgICpGdW5jdGlvbiA6IHJldHVybnMgMSBpZiB0aGUgY2hhcmFjdGVyIGlzIGEgc2VlbiBmYW1pbHkgaXNvbGF0ZWQgY2hhcmFjdGVyCisgICAgICogICAgICAgICAgIGluIHRoZSBGRSByYW5nZSBvdGhlcndpc2UgcmV0dXJucyAwCisgICAgICovCisKKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgaXNTZWVuVGFpbEZhbWlseUNoYXIoY2hhciBjaCkgeworICAgICAgICBpZiAoY2ggPj0gMHhmZWIxICYmIGNoIDwgMHhmZWJmKXsKKyAgICAgICAgICAgICByZXR1cm4gdGFpbEZhbWlseUlzb2xhdGVkRmluYWwgW2NoIC0gMHhGRUIxXTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKworICAgICAvKiBOYW1lICAgICA6IGlzU2VlbkZhbWlseUNoYXIKKyAgICAgICogRnVuY3Rpb24gOiByZXR1cm5zIDEgaWYgdGhlIGNoYXJhY3RlciBpcyBhIHNlZW4gZmFtaWx5IGNoYXJhY3RlciBpbiB0aGUgVW5pY29kZQorICAgICAgKiAgICAgICAgICAgIDA2IHJhbmdlIG90aGVyd2lzZSByZXR1cm5zIDAKKyAgICAgKi8KKworICAgIHByaXZhdGUgc3RhdGljIGludCBpc1NlZW5GYW1pbHlDaGFyKGNoYXIgIGNoKXsKKyAgICAgICAgaWYgKGNoID49IDB4NjMzICYmIGNoIDw9IDB4NjM2KXsKKyAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICB9ZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICpOYW1lICAgICA6IGlzVGFpbENoYXIKKyAgICAgKkZ1bmN0aW9uIDogcmV0dXJucyB0cnVlIGlmIHRoZSBjaGFyYWN0ZXIgbWF0Y2hlcyBvbmUgb2YgdGhlIHRhaWwgY2hhcmFjdGVycworICAgICAqICAgICAgICAgICAoMHhmZTczIG9yIDB4MjAwYikgb3RoZXJ3aXNlIHJldHVybnMgZmFsc2UKKyAgICAgKi8KKworICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNUYWlsQ2hhcihjaGFyIGNoKSB7CisgICAgICAgIGlmKGNoID09IE9MRF9UQUlMX0NIQVIgfHwgY2ggPT0gTkVXX1RBSUxfQ0hBUil7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICpOYW1lICAgICA6IGlzQWxlZk1ha3NvdXJhQ2hhcgorICAgICAqRnVuY3Rpb24gOiByZXR1cm5zIHRydWUgaWYgdGhlIGNoYXJhY3RlciBpcyBhIEFsZWYgTWFrc291cmEgRmluYWwgb3IgaXNvbGF0ZWQKKyAgICAgKiAgICAgICAgICAgb3RoZXJ3aXNlIHJldHVybnMgZmFsc2UKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzQWxlZk1ha3NvdXJhQ2hhcihjaGFyIGNoKSB7CisgICAgICAgIHJldHVybiAoIChjaCA9PSAweEZFRUYpIHx8ICggY2ggPT0gMHhGRUYwKSB8fCAoY2ggPT0gMHgwNjQ5KSk7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgICA6IGlzWWVoSGFtemFDaGFyCisgICAgICogRnVuY3Rpb24gOiByZXR1cm5zIHRydWUgaWYgdGhlIGNoYXJhY3RlciBpcyBhIHllaEhhbXphIGlzb2xhdGVkIG9yIHllaGhhbXphCisgICAgICogICAgICAgICAgICBmaW5hbCBpcyBmb3VuZCBvdGhlcndpc2UgcmV0dXJucyBmYWxzZQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNZZWhIYW16YUNoYXIoY2hhciBjaCkgeworICAgICAgICBpZigoY2g9PTB4RkU4OSl8fChjaD09MHhGRThBKSl7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfWVsc2V7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqTmFtZSAgICAgOiBpc1Rhc2hrZWVsQ2hhckZFCisgICAgICpGdW5jdGlvb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pIHsKKyAgICAgICAgICAgIHJldHVybiAyOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWU6IGlzSXNvbGF0ZWRUYXNoa2VlbENoYXIKKyAgICAgKiBGdW5jdGlvbjogQ2hlY2tzIGlmIHRoZSBUYXNoa2VlbCBDaGFyYWN0ZXIgaXMgaW4gdGhlIGlzb2xhdGVkIGZvcm0KKyAgICAgKiAgICAgICAgICAgKGkuZS4gVW5pY29kZSBGRSByYW5nZSkgcmV0dXJucyAxIGVsc2UgaWYgdGhlIFRhc2hrZWVsCisgICAgICogICAgICAgICAgIHdpdGggc2hhZGRhIGlzIGluIHRoZSBpc29sYXRlZCBmb3JtIChpLmUuIFVuaWNvZGUgRkMgcmFuZ2UpCisgICAgICogICAgICAgICAgIHJldHVybnMgMSBvdGhlcndpc2UgcmV0dXJucyAwCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgaW50IGlzSXNvbGF0ZWRUYXNoa2VlbENoYXIoY2hhciBjaCl7CisgICAgICAgIGlmIChjaCA+PSAweGZlNzAgJiYgY2ggPD0gMHhmZTdmICYmIGNoICE9IE5FV19UQUlMX0NIQVIgJiYgY2ggIT0gMHhGRTc1KXsKKyAgICAgICAgICAgIHJldHVybiAoMSAtIHRhc2hrZWVsTWVkaWFsIFtjaCAtIDB4RkU3MF0pOworICAgICAgICB9IGVsc2UgaWYoY2ggPj0gMHhmYzVlICYmIGNoIDw9IDB4ZmM2Myl7CisgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgfSBlbHNleworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBpc0FsZWZDaGFyCisgICAgICogRnVuY3Rpb246IFJldHVybnMgMSBmb3IgQWxlZiBjaGFyYWN0ZXJzIGVsc2UgcmV0dXJuIDAKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzQWxlZkNoYXIoY2hhciBjaCkgeworICAgICAgICByZXR1cm4gY2ggPT0gJ1x1MDYyMicgfHwgY2ggPT0gJ1x1MDYyMycgfHwgY2ggPT0gJ1x1MDYyNScgfHwgY2ggPT0gJ1x1MDYyNyc7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogaXNMYW1BbGVmQ2hhcgorICAgICAqIEZ1bmN0aW9uOiBSZXR1cm5zIHRydWUgZm9yIExhbUFsZWYgY2hhcmFjdGVycyBlbHNlIHJldHVybiBmYWxzZQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNMYW1BbGVmQ2hhcihjaGFyIGNoKSB7CisgICAgICAgIHJldHVybiBjaCA+PSAnXHVGRUY1JyAmJiBjaCA8PSAnXHVGRUZDJzsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzTm9ybWFsaXplZExhbUFsZWZDaGFyKGNoYXIgY2gpIHsKKyAgICAgICAgcmV0dXJuIGNoID49ICdcdTA2NUMnICYmIGNoIDw9ICdcdTA2NUYnOworICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGNhbGN1bGF0ZVNpemUKKyAgICAgKiBGdW5jdGlvbjogVGhpcyBmdW5jdGlvbiBjYWxjdWxhdGVzIHRoZSBkZXN0U2l6ZSB0byBiZSB1c2VkIGluIHByZWZsaWdodGluZworICAgICAqICAgICAgICAgICB3aGVuIHRoZSBkZXN0U2l6ZSBpcyBlcXVhbCB0byAwCisgICAgICovCisgICAgcHJpdmF0ZSBpbnQgY2FsY3VsYXRlU2l6ZShjaGFyW10gc291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNvdXJjZVN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNvdXJjZUxlbmd0aCkgeworCisgICAgICAgIGludCBkZXN0U2l6ZSA9IHNvdXJjZUxlbmd0aDsKKworICAgICAgICBzd2l0Y2ggKG9wdGlvbnMgJiBMRVRURVJTX01BU0spIHsKKyAgICAgICAgY2FzZSBMRVRURVJTX1NIQVBFOgorICAgICAgICBjYXNlIExFVFRFUlNfU0hBUEVfVEFTSEtFRUxfSVNPTEFURUQ6CisgICAgICAgICAgICBpZiAoaXNMb2dpY2FsKSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IHNvdXJjZVN0YXJ0LCBlID0gc291cmNlU3RhcnQgKyBzb3VyY2VMZW5ndGggLSAxOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoc291cmNlW2ldID09IExBTV9DSEFSICYmIGlzQWxlZkNoYXIoc291cmNlW2krMV0pKSB8fCBpc1Rhc2hrZWVsQ2hhckZFKHNvdXJjZVtpXSkpeworICAgICAgICAgICAgICAgICAgICAgICAgLS1kZXN0U2l6ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7IC8vIHZpc3VhbAorICAgICAgICAgICAgICAgIGZvcihpbnQgaSA9IHNvdXJjZVN0YXJ0ICsgMSwgZSA9IHNvdXJjZVN0YXJ0ICsgc291cmNlTGVuZ3RoOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoc291cmNlW2ldID09IExBTV9DSEFSICYmIGlzQWxlZkNoYXIoc291cmNlW2ktMV0pKSB8fCBpc1Rhc2hrZWVsQ2hhckZFKHNvdXJjZVtpXSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0tZGVzdFNpemU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIExFVFRFUlNfVU5TSEFQRToKKyAgICAgICAgICAgIGZvcihpbnQgaSA9IHNvdXJjZVN0YXJ0LCBlID0gc291cmNlU3RhcnQgKyBzb3VyY2VMZW5ndGg7IGkgPCBlOyArK2kpIHsKKyAgICAgICAgICAgICAgICBpZiAoaXNMYW1BbGVmQ2hhcihzb3VyY2VbaV0pKSB7CisgICAgICAgICAgICAgICAgICAgIGRlc3RTaXplKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGRlc3RTaXplOworICAgIH0KKworCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogY291bnRTcGFjZVN1YgorICAgICAqIEZ1bmN0aW9uOiBDb3VudHMgbnVtYmVyIG9mIHRpbWVzIHRoZSBzdWJDaGFyIGFwcGVhcnMgaW4gdGhlIGFycmF5CisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBpbnQgY291bnRTcGFjZVN1YihjaGFyIFtdIGRlc3QsaW50IGxlbmd0aCwgY2hhciBzdWJDaGFyKXsKKyAgICAgICAgaW50IGkgPSAwOworICAgICAgICBpbnQgY291bnQgPSAwOworICAgICAgICB3aGlsZSAoaSA8IGxlbmd0aCkgeworICAgICAgICAgIGlmIChkZXN0W2ldID09IHN1YkNoYXIpIHsKKyAgICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIGkrKzsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gY291bnQ7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogc2hpZnRBcnJheQorICAgICAqIEZ1bmN0aW9uOiBTaGlmdHMgY2hhcmFjdGVycyB0byByZXBsYWNlIHNwYWNlIHN1YiBjaGFyYWN0ZXJzCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyB2b2lkIHNoaWZ0QXJyYXkoY2hhciBbXSBkZXN0LGludCBzdGFydCwgaW50IGUsIGNoYXIgc3ViQ2hhcil7CisgICAgICAgIGludCB3ID0gZTsKKyAgICAgICAgaW50IHIgPSBlOworICAgICAgICB3aGlsZSAoLS1yID49IHN0YXJ0KSB7CisgICAgICAgICAgY2hhciBjaCA9IGRlc3Rbcl07CisgICAgICAgICAgaWYgKGNoICE9IHN1YkNoYXIpIHsKKyAgICAgICAgICAgIC0tdzsKKyAgICAgICAgICAgIGlmICh3ICE9IHIpIHsKKyAgICAgICAgICAgICAgZGVzdFt3XSA9IGNoOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgfQorICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogZmxpcEFycmF5CisgICAgICogRnVuY3Rpb246IGludmVydHMgYXJyYXksIHNvIHRoYXQgc3RhcnQgYmVjb21lcyBlbmQgYW5kIHZpY2UgdmVyc2EKKyAgICAgKi8KKyAgICAgIHB1YmxpYyBzdGF0aWMgaW50IGZsaXBBcnJheShjaGFyIFtdIGRlc3QsIGludCBzdGFydCwgaW50IGUsIGludCB3KXsKKyAgICAgICAgaW50IHI7CisgICAgICAgIGlmICh3ID4gc3RhcnQpIHsKKyAgICAgICAgLy8gc2hpZnQsIGFzc3VtZSBzbWFsbCBidWZmZXIgc2l6ZSBzbyBkb24ndCB1c2UgYXJyYXljb3B5CisgICAgICAgICAgciA9IHc7CisgICAgICAgICAgdyA9IHN0YXJ0OworICAgICAgICAgIHdoaWxlIChyIDwgZSkgeworICAgICAgICAgICAgZGVzdFt3KytdID0gZGVzdFtyKytdOworICAgICAgICAgICB9CisgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgIHcgPSBlOworICAgICAgICAgfQorICAgICAgICByZXR1cm4gdzsKKyAgICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICAgOiBoYW5kbGVUYXNoa2VlbFdpdGhUYXR3ZWVsCisgICAgICogRnVuY3Rpb24gOiBSZXBsYWNlcyBUYXNoa2VlbCBhcyBmb2xsb3dpbmc6CisgICAgICogICAgICAgICAgICBDYXNlIDEgOmlmIHRoZSBUYXNoa2VlbCBvbiB0YXR3ZWVsLCByZXBsYWNlIGl0IHdpdGggVGF0d2VlbC4KKyAgICAgKiAgICAgICAgICAgIENhc2UgMiA6aWYgdGhlIFRhc2hrZWVsIGFnZ3JlZ2F0ZWQgd2l0aCBTaGFkZGEgb24gVGF0d2VlbCwgcmVwbGFjZQorICAgICAqICAgICAgICAgICAgICAgICAgIGl0IHdpdGggU2hhZGRhIG9uIFRhdHdlZWwuCisgICAgICogICAgICAgICAgICBDYXNlIDM6IGlmIHRoZSBUYXNoa2VlbCBpcyBpc29sYXRlZCByZXBsYWNlIGl0IHdpdGggU3BhY2UuCisgICAgICoKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgaGFuZGxlVGFzaGtlZWxXaXRoVGF0d2VlbChjaGFyW10gZGVzdCwgaW50IHNvdXJjZUxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAgICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCBzb3VyY2VMZW5ndGg7IGkrKyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgaWYoKGlzVGFzaGtlZWxPblRhdHdlZWxDaGFyKGRlc3RbaV0pID09IDEpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IFRBVFdFRUxfQ0hBUjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKChpc1Rhc2hrZWVsT25UYXR3ZWVsQ2hhcihkZXN0W2ldKSA9PSAyKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbaV0gPSBTSEFEREFfVEFUV0VFTF9DSEFSOworICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoKGlzSXNvbGF0ZWRUYXNoa2VlbENoYXIoZGVzdFtpXSk9PTEpICYmIGRlc3RbaV0gIT0gU0hBRERBX0NIQVIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0W2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AgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGxlbk9wdGlvbnNUYXNoa2VlbCl7CisgICAgICAgICAgY2FzZSBUQVNIS0VFTF9CRUdJTjogbGVuT3B0aW9uc1Rhc2hrZWVsID0gVEFTSEtFRUxfRU5EOyBicmVhazsKKyAgICAgICAgICBjYXNlIFRBU0hLRUVMX0VORDogbGVuT3B0aW9uc1Rhc2hrZWVsID0gVEFTSEtFRUxfQkVHSU47IGJyZWFrOworICAgICAgICAgIGRlZmF1bHQ6IGJyZWFrOworICAgICAgICAgIH0KKyAgICAgICAgfQorCisKKyAgICAgIGlmIChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX05FQVIpIHsKKyAgICAgICAgICBmb3IgKGludCBpID0gc3RhcnQsIGUgPSBpICsgbGVuZ3RoOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICAgIGlmIChkZXN0W2ldID09IExBTUFMRUZfU1BBQ0VfU1VCKSB7CisgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gU1BBQ0VfQ0hBUl9GT1JfTEFNQUxFRjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAgICAgfSBlbHNlIHsKKworICAgICAgICAgIGZpbmFsIGludCBlID0gc3RhcnQgKyBsZW5ndGg7CisgICAgICAgICAgaW50IHdMID0gY291bnRTcGFjZVN1YihkZXN0LCBsZW5ndGgsIExBTUFMRUZfU1BBQ0VfU1VCKTsKKyAgICAgICAgICBpbnQgd1QgPSBjb3VudFNwYWNlU3ViKGRlc3QsIGxlbmd0aCwgVEFTSEtFRUxfU1BBQ0VfU1VCKTsKKworICAgICAgICAgIGlmIChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0VORCl7CisgICAgICAgICAgICBsYW1BbGVmT24gPSB0cnVlOworICAgICAgICAgIH0KKyAgICAgICAgICBpZiAobGVuT3B0aW9uc1Rhc2hrZWVsID09IFRBU0hLRUVMX0VORCl7CisgICAgICAgICAgICB0YXNoa2VlbE9uID0gdHJ1ZTsKKyAgICAgICAgICB9CisKKworICAgICAgICAgIGlmIChsYW1BbGVmT24gJiYgKGxlbk9wdGlvbnNMYW1BbGVmID09IExBTUFMRUZfRU5EKSkgeworICAgICAgICAgICAgc2hpZnRBcnJheShkZXN0LCBzdGFydCwgZSwgTEFNQUxFRl9TUEFDRV9TVUIpOworICAgICAgICAgICAgd2hpbGUgKHdMID4gc3RhcnQpIHsKKyAgICAgICAgICAgICAgICBkZXN0Wy0td0xdID0gU1BBQ0VfQ0hBUjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisKKyAgICAgICAgICBpZiAodGFzaGtlZWxPbiAmJiAobGVuT3B0aW9uc1Rhc2hrZWVsID09IFRBU0hLRUVMX0VORCkpeworICAgICAgICAgICAgc2hpZnRBcnJheShkZXN0LCBzdGFydCwgZSwgVEFTSEtFRUxfU1BBQ0VfU1VCKTsKKyAgICAgICAgICAgIHdoaWxlICh3VCA+IHN0YXJ0KSB7CisgICAgICAgICAgICAgICAgIGRlc3RbLS13VF0gPSBTUEFDRV9DSEFSOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAgICAgICAgIGxhbUFsZWZPbiA9IGZhbHNlOworICAgICAgICAgIHRhc2hrZWVsT24gPSBmYWxzZTsKKworICAgICAgICAgIGlmIChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX1JFU0laRSl7CisgICAgICAgICAgICBsYW1BbGVmT24gPSB0cnVlOworICAgICAgICAgIH0KKyAgICAgICAgICBpZiAobGVuT3B0aW9uc1Rhc2hrZWVsID09IFRBU0hLRUVMX1JFU0laRSl7CisgICAgICAgICAgICB0YXNoa2VlbE9uID0gdHJ1ZTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBpZiAobGFtQWxlZk9uICYmIChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX1JFU0laRSkpeworICAgICAgICAgICAgICBzaGlmdEFycmF5KGRlc3QsIHN0YXJ0LCBlLCBMQU1BTEVGX1NQQUNFX1NVQik7CisgICAgICAgICAgICAgIHdMID0gZmxpcEFycmF5KGRlc3Qsc3RhcnQsZSwgd0wpOworICAgICAgICAgICAgICBsZW5ndGggPSB3TCAtIHN0YXJ0OworICAgICAgICAgIH0KKyAgICAgICAgICBpZiAodGFzaGtlZWxPbiAmJiAobGVuT3B0aW9uc1Rhc2hrZWVsID09IFRBU0hLRUVMX1JFU0laRSkpIHsKKyAgICAgICAgICAgICAgc2hpZnRBcnJheShkZXN0LCBzdGFydCwgZSwgVEFTSEtFRUxfU1BBQ0VfU1VCKTsKKyAgICAgICAgICAgICAgd1QgPSBmbGlwQXJyYXkoZGVzdCxzdGFydCxlLCB3VCk7CisgICAgICAgICAgICAgIGxlbmd0aCA9IHdUIC0gc3RhcnQ7CisgICAgICAgICAgfQorCisgICAgICAgICAgbGFtQWxlZk9uID0gZmFsc2U7CisgICAgICAgICAgdGFzaGtlZWxPbiA9IGZhbHNlOworCisgICAgICAgICAgaWYgKChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0JFR0lOKSB8fAorICAgICAgICAgICAgICAobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9BVVRPKSl7CisgICAgICAgICAgICAgICAgbGFtQWxlZk9uID0gdHJ1ZTsKKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKGxlbk9wdGlvbnNUYXNoa2VlbCA9PSBUQVNIS0VFTF9CRUdJTil7CisgICAgICAgICAgICAgICAgdGFzaGtlZWxPbiA9IHRydWU7CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKGxhbUFsZWZPbiAmJiAoKGxlbk9wdGlvbnNMYW1BbGVmID09IExBTUFMRUZfQkVHSU4pfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9BVVRPKSkpIHsgLy8gc3BhY2VzIGF0IGJlZ2lubmluZworICAgICAgICAgICAgICBzaGlmdEFycmF5KGRlc3QsIHN0YXJ0LCBlLCBMQU1BTEVGX1NQQUNFX1NVQik7CisgICAgICAgICAgICAgICB3TCA9IGZsaXBBcnJheShkZXN0LHN0YXJ0LGUsIHdMKTsKKyAgICAgICAgICAgICAgICAgIHdoaWxlICh3TCA8IGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICBkZXN0W3dMKytdID0gU1BBQ0VfQ0hBUjsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpZih0YXNoa2VlbE9uICYmIChsZW5PcHRpb25zVGFzaGtlZWwgPT0gVEFTSEtFRUxfQkVHSU4pKXsKKyAgICAgICAgICAgICAgIHNoaWZ0QXJyYXkoZGVzdCwgc3RhcnQsIGUsIFRBU0hLRUVMX1NQQUNFX1NVQik7CisgICAgICAgICAgICAgICB3VCA9IGZsaXBBcnJheShkZXN0LHN0YXJ0LGUsIHdUKTsKKyAgICAgICAgICAgICAgICAgIHdoaWxlICh3VCA8IGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICBkZXN0W3dUKytdID0gU1BBQ0VfQ0hBUjsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICB9CisKKyAgICAgIHJldHVybiBsZW5ndGg7CisgIH0KKworCisgIC8qCisgICAqTmFtZSAgICAgOmV4cGFuZENvbXBvc2l0Q2hhckF0QmVnaW4KKyAgICpGdW5jdGlvbiA6RXhwYW5kcyB0aGUgTGFtQWxlZiBjaGFyYWN0ZXIgdG8gTGFtIGFuZCBBbGVmIGNvbnN1bWluZyB0aGUgcmVxdWlyZWQKKyAgICogICAgICAgICBzcGFjZSBmcm9tIGJlZ2lubmluZyBvZiB0aGUgYnVmZmVyLiBJZiB0aGUgdGV4dCB0eXBlIHdhcyB2aXN1YWxfTFRSCisgICAqICAgICAgICAgYW5kIHRoZSBvcHRpb24gU1BBQ0VTX1JFTEFUSVZFX1RPX1RFWFRfQkVHSU5fRU5EIHdhcyBzZWxlY3RlZAorICAgKiAgICAgICAgIHRoZSBzcGFjZXMgd2lsbCBiZSBsb2NhdGVkIGF0IGVuZCBvZiBidWZmZXIuCisgICAqICAgICAgICAgSWYgdGhlcmUgYXJlIG5vIHNwYWNlcyB0byBleHBhbmQgdGhlIExhbUFsZWYsIGFuIGV4Y2VwdGlvbiBpcyB0aHJvd24uCisqLworIHByaXZhdGUgYm9vbGVhbiBleHBhbmRDb21wb3NpdENoYXJBdEJlZ2luKGNoYXJbXSBkZXN0LGludCBzdGFydCwgaW50IGxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGFjb3VudCkgeworICAgICBib29sZWFuIHNwYWNlTm90Rm91bmQgPSBmYWxzZTsKKworICAgICBpZiAobGFjb3VudCA+IGNvdW50U3BhY2VzUmlnaHQoZGVzdCwgc3RhcnQsIGxlbmd0aCkpIHsKKyAgICAgICAgIHNwYWNlTm90Rm91bmQgPSB0cnVlOworICAgICAgICAgcmV0dXJuIHNwYWNlTm90Rm91bmQ7CisgICAgIH0KKyAgICAgZm9yIChpbnQgciA9IHN0YXJ0ICsgbGVuZ3RoIC0gbGFjb3VudCwgdyA9IHN0YXJ0ICsgbGVuZ3RoOyAtLXIgPj0gc3RhcnQ7KSB7CisgICAgICAgICBjaGFyIGNoID0gZGVzdFtyXTsKKyAgICAgICAgIGlmIChpc05vcm1hbGl6ZWRMYW1BbGVmQ2hhcihjaCkpIHsKKyAgICAgICAgICAgICBkZXN0Wy0td10gPSBMQU1fQ0hBUjsKKyAgICAgICAgICAgICBkZXN0Wy0td10gPSBjb252ZXJ0Tm9ybWFsaXplZExhbUFsZWZbY2ggLSAnXHUwNjVDJ107CisgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgIGRlc3RbLS13XSA9IGNoOworICAgICAgICAgfQorICAgICB9CisgICAgIHJldHVybiBzcGFjZU5vdEZvdW5kOworCisgIH0KKworICAvKgorICAgKk5hbWUgICAgIDog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BpZiAoaXNOb3JtYWxpemVkTGFtQWxlZkNoYXIoY2gpKSB7CisgICAgICAgICAgICAgIGRlc3RbdysrXSA9IGNvbnZlcnROb3JtYWxpemVkTGFtQWxlZltjaCAtICdcdTA2NUMnXTsKKyAgICAgICAgICAgICAgZGVzdFt3KytdID0gTEFNX0NIQVI7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgZGVzdFt3KytdID0gY2g7CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgcmV0dXJuIHNwYWNlTm90Rm91bmQ7CisgIH0KKworICAvKgorICAgKk5hbWUgICAgIDogZXhwYW5kQ29tcG9zaXRDaGFyQXROZWFyCisgICAqRnVuY3Rpb24gOiBFeHBhbmRzIHRoZSBMYW1BbGVmIGNoYXJhY3RlciBpbnRvIExhbSArIEFsZWYsIFllaEhhbXphIGNoYXJhY3RlcgorICAgKiAgICAgICAgICAgaW50byBZZWggKyBIYW16YSwgU2VlbkZhbWlseSBjaGFyYWN0ZXIgaW50byBTZWVuRmFtaWx5IGNoYXJhY3RlcgorICAgKiAgICAgICAgICAgKyBUYWlsLCB3aGlsZSBjb25zdW1pbmcgdGhlIHNwYWNlIG5leHQgdG8gdGhlIGNoYXJhY3Rlci4KKyAgICovCisKKyAgcHJpdmF0ZSBib29sZWFuIGV4cGFuZENvbXBvc2l0Q2hhckF0TmVhcihjaGFyW10gZGVzdCxpbnQgc3RhcnQsIGludCBsZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeWVoSGFtemFPcHRpb24sIGludCBzZWVuVGFpbE9wdGlvbiwgaW50IGxhbUFsZWZPcHRpb24peworCisgICAgICBib29sZWFuIHNwYWNlTm90Rm91bmQgPSBmYWxzZTsKKworCisKKyAgICAgIGlmIChpc05vcm1hbGl6ZWRMYW1BbGVmQ2hhcihkZXN0W3N0YXJ0XSkpIHsKKyAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICByZXR1cm4gc3BhY2VOb3RGb3VuZDsKKyAgICAgIH0KKyAgICAgIGZvciAoaW50IGkgPSBzdGFydCArIGxlbmd0aDsgLS1pID49c3RhcnQ7KSB7CisgICAgICAgICAgY2hhciBjaCA9IGRlc3RbaV07CisgICAgICAgICAgaWYgKGxhbUFsZWZPcHRpb24gPT0gMSAmJiBpc05vcm1hbGl6ZWRMYW1BbGVmQ2hhcihjaCkpIHsKKyAgICAgICAgICAgICAgaWYgKGk+c3RhcnQgJiZkZXN0W2ktMV0gPT0gU1BBQ0VfQ0hBUikgeworICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IExBTV9DSEFSOworICAgICAgICAgICAgICAgICAgZGVzdFstLWldID0gY29udmVydE5vcm1hbGl6ZWRMYW1BbGVmW2NoIC0gJ1x1MDY1QyddOworICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgc3BhY2VOb3RGb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICByZXR1cm4gc3BhY2VOb3RGb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH1lbHNlIGlmKHNlZW5UYWlsT3B0aW9uID09IDEgJiYgaXNTZWVuVGFpbEZhbWlseUNoYXIoY2gpID09IDEpeworICAgICAgICAgICAgICBpZihpPnN0YXJ0ICYmZGVzdFtpLTFdID09IFNQQUNFX0NIQVIpeworICAgICAgICAgICAgICAgICAgZGVzdFtpLTFdID0gdGFpbENoYXI7CisgICAgICAgICAgICAgIH0gZWxzZXsKKyAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwYWNlTm90Rm91bmQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9ZWxzZSBpZih5ZWhIYW16YU9wdGlvbiA9PSAxICYmIGlzWWVoSGFtemFDaGFyKGNoKSl7CisKKyAgICAgICAgICAgICAgIGlmKGk+c3RhcnQgJiZkZXN0W2ktMV0gPT0gU1BBQ0VfQ0hBUil7CisgICAgICAgICAgICAgICAgICBkZXN0W2ldID0geWVoSGFtemFUb1llaFtjaCAtIFlFSF9IQU1aQUZFX0NIQVJdOworICAgICAgICAgICAgICAgICAgZGVzdFtpLTFdID0gSEFNWkFGRV9DSEFSOworICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwYWNlTm90Rm91bmQ7CisgICAgICAgICAgICAgICAgfQorCisKKyAgICAgICAgICB9CisgICAgICB9CisgICAgICByZXR1cm4gZmFsc2U7CisKKyAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogZXhwYW5kQ29tcG9zaXRDaGFyCisgICAgICogRnVuY3Rpb246IExhbUFsZWYgbmVlZHMgc3BlY2lhbCBoYW5kbGluZyBhcyB0aGUgTGFtQWxlZiBpcworICAgICAqICAgICAgICAgICBvbmUgY2hhcmFjdGVyIHdoaWxlIGV4cGFuZGluZyBpdCB3aWxsIGdpdmUgdHdvCisgICAgICogICAgICAgICAgIGNoYXJhY3RlcnMgTGFtICsgQWxlZiwgc28gd2UgbmVlZCB0byBleHBhbmQgdGhlIExhbUFsZWYKKyAgICAgKiAgICAgICAgICAgaW4gbmVhciBvciBmYXIgc3BhY2VzIGFjY29yZGluZyB0byB0aGUgb3B0aW9ucyB0aGUgdXNlcgorICAgICAqICAgICAgICAgICBzcGVjaWZpZXMgb3IgaW5jcmVhc2UgdGhlIGJ1ZmZlciBzaXplLgorICAgICAqICAgICAgICAgICBEZXN0IGhhcyBlbm91Z2ggcm9vbSBmb3IgdGhlIGV4cGFuc2lvbiBpZiB3ZSBhcmUgZ3Jvd2luZy4KKyAgICAgKiAgICAgICAgICAgbGFtYWxlZiBhcmUgbm9ybWFsaXplZCB0byB0aGUgJ3NwZWNpYWwgY2hhcmFjdGVycycKKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBleHBhbmRDb21wb3NpdENoYXIoY2hhcltdIGRlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxhY291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2hhcGluZ01vZGUpIHRocm93cyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uIHsKKworICAgICAgICBpbnQgbGVuT3B0aW9uc0xhbUFsZWYgPSBvcHRpb25zICYgTEFNQUxFRl9NQVNLOworICAgICAgICBpbnQgbGVuT3B0aW9uc1NlZW4gPSBvcHRpb25zICYgU0VFTl9NQVNLOworICAgICAgICBpbnQgbGVuT3B0aW9uc1llaEhhbXphID0gb3B0aW9ucyAmIFlFSEhBTVpBX01BU0s7CisgICAgICAgIGJvb2xlYW4gc3BhY2VOb3RGb3VuZCA9IGZhbHNlOworCisgICAgICAgIGlmICghaXNMb2dpY2FsICYmICFzcGFjZXNSZWxhdGl2ZVRvVGV4dEJlZ2luRW5kKSB7CisgICAgICAgICAgICBzd2l0Y2ggKGxlbk9wdGlvbnNMYW1BbGVmKSB7CisgICAgICAgICAgICBjYXNlIExBTUFMRUZfQkVHSU46IGxlbk9wdGlvbnNMYW1BbGVmID0gTEFNQUxFRl9FTkQ7IGJyZWFrOworICAgICAgICAgICAgY2FzZSBMQU1BTEVGX0VORDogbGVuT3B0aW9uc0xhbUFsZWYgPSBMQU1BTEVGX0JFR0lOOyBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6IGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYoc2hhcGluZ01vZGUgPT0gMSl7CisgICAgICAgICAgICBpZihsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0FVVE8peworICAgICAgICAgICAgICAgIGlmKGlzTG9naWNhbCl7CisgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdEVuZChkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXRCZWdpbihkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdE5lYXIoZGVzdCwgc3RhcnQsIGxlbmd0aCwwLDAsMSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbigiTm8gc3BhY2Vmb3IgbGFtYWxlZiIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdEJlZ2luKGRlc3QsIHN0YXJ0LCBsZW5ndGgsIGxhY291bnQpOworICAgICAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdEVuZChkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdE5lYXIoZGVzdCwgc3RhcnQsIGxlbmd0aCwwLDAsMSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbigiTm8gc3BhY2Vmb3IgbGFtYWxlZiIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfWVsc2UgaWYobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9FTkQpeworICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdEVuZChkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlZm9yIGxhbWFsZWYiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9ZWxzZSBpZihsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0JFR0lOKXsKKyAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXRCZWdpbihkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlZm9yIGxhbWFsZWYiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9ZWxzZSBpZihsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX05FQVIpeworICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdE5lYXIoZGVzdCwgc3RhcnQsIGxlbmd0aCwwLDAsMSk7CisgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uKCJObyBzcGFjZWZvciBsYW1hbGVmIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB9ZWxzZSBpZihsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX1JFU0laRSl7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgciA9IHN0YXJ0ICsgbGVuZ3RoLCB3ID0gciArIGxhY291bnQ7IC0tciA+PSBzdGFydDspIHsKKyAgICAgICAgICAgICAgICAgICAgY2hhciBjaCA9IGRlc3Rbcl07CisgICAgICAgICAgICAgICAgICAgIGlmIChpc05vcm1hbGl6ZWRMYW1BbGVmQ2hhcihjaCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbLS13XSA9ICdcdTA2NDQnOworICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFstLXddID0gY29udmVydE5vcm1hbGl6ZWRMYW1BbGVmW2NoIC0gJ1x1MDY1QyddOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFstLXddID0gY2g7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGVuZ3RoICs9IGxhY291bnQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICBpZihsZW5PcHRpb25zU2VlbiA9PSBTRUVOX1RXT0NFTExfTkVBUil7CisgICAgICAgICAgICAgICAgc3BhY2VOb3RGb3VuZCA9IGV4cGFuZENvbXBvc2l0Q2hhckF0TmVhcihkZXN0LCBzdGFydCwgbGVuZ3RoLDAsMSwwKTsKKyAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlIGZvciBTZWVuIHRhaWwgZXhwYW5zaW9uIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYobGVuT3B0aW9uc1llaEhhbXphID09IFlFSEhBTVpBX1RXT0NFTExfTkVBUil7CisgICAgICAgICAgICAgICAgc3BhY2VOb3RGb3VuZCA9IGV4cGFuZENvbXBvc2l0Q2hhckF0TmVhcihkZXN0LCBzdGFydCwgbGVuZ3RoLDEsMCwwKTsKKyAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlIGZvciBZZWhIYW16YSBleHBhbnNpb24iKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgfQorCisKKyAgICAvKiBDb252ZXJ0IHRoZSBpbnB1dCBidWZmZXIgZnJvbSBGRXh4IFJhbmdlIGludG8gMDZ4eCBSYW5nZQorICAgICAqIHRvIHB1dCBhbGwgY2hhcmFjdGVycyBpbnRvIHRoZSAwNnh4IHJhbmdlCisgICAgICogZXZlbiB0aGUgbGFtYWxlZiBpcyBjb252ZXJ0ZWQgdG8gdGhlIHNwZWNpYWwgcmVnaW9uIGluCisgICAgICogdGhlIDA2eHggcmFuZ2UuICBSZXR1cm4gdGhlIG51bWJlciBvZiBsYW1hbGVmIGNoYXJzIGZvdW5kLgorICAgICAqLworICAgIHByaXZhdGUgaW50IG5vcm1hbGl6ZShjaGFyW10gZGVzdCwgaW50IHN0YXJ0LCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIGludCBsYWNvdW50ID0gMDsKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0LCBlID0gaSArIGxlbmd0aDsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgY2hhciBjaCA9IGRlc3RbaV07CisgICAgICAgICAgICBpZiAoY2ggPj0gJ1x1RkU3MCcgJiYgY2ggPD0gJ1x1RkVGQycpIHsKKyAgICAgICAgICAgICAgICBpZiAoaXNMYW1BbGVmQ2hhcihjaCkpIHsKKyAgICAgICAgICAgICAgICAgICAgKytsYWNvdW50OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZXN0W2ldID0gKGNoYXIpY29udmVydEZFdG8wNltjaCAtICdcdUZFNzAnXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbGFjb3VudDsKKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBkZXNoYXBlTm9ybWFsaXplCisgICAgICogRnVuY3Rpb246IENvbnZlcnQgdGhlIGlucHV0IGJ1ZmZlciBmcm9tIEZFeHggUmFuZ2UgaW50byAwNnh4IFJhbmdlCisgICAgICogICAgICAgICAgIGV2ZW4gdGhlIGxhbWFsZWYgaXMgY29udmVydGVkIHRvIHRoZSBzcGVjaWFsIHJlZ2lvbiBpbiB0aGUgMDZ4eCByYW5nZS4KKyAgICAgKiAgICAgICAgICAgQWNjb3JkaW5nIHRvIHRoZSBvcHRpb25zIHRoZSB1c2VyIGVudGVycywgYWxsIHNlZW4gZmFtaWx5IGNoYXJhY3RlcnMKKyAgICAgKiAgICAgICAgICAgZm9sbG93ZWQgYnkgYSB0YWlsIGNoYXJhY3RlciBhcmUgbWVyZ2VkIHRvIHNlZW4gdGFpbCBmYW1pbHkgY2hhcmFjdGVyIGFuZAorICAgICAqICAgICAgICAgICBhbnkgeWVoIGZvbGxvd2VkIGJ5IGEgaGFtemEgY2hhcmFjdGVyIGFyZSBtZXJnZWQgdG8geWVoaGFtemEgY2hhcmFjdGVyLgorICAgICAqICAgICAgICAgICBNZXRob2QgcmV0dXJucyB0aGUgbnVtYmVyIG9mIGxhbWFsZWYgY2hhcnMgZm91bmQuCisgICAgICovCisgICAgcHJpdmF0ZSBpbnQgZGVzaGFwZU5vcm1hbGl6ZShjaGFyW10gZGVzdCwgaW50IHN0YXJ0LCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIGludCBsYWNvdW50ID0gMDsKKyAgICAgICAgaW50IHllaEhhbXphQ29tcG9zZUVuYWJsZWQgPSAwOworICAgICAgICBpbnQgc2VlbkNvbXBvc2VFbmFibGVkID0gMDsKKworICAgICAgICB5ZWhIYW16YUNvbXBvc2VFbmFibGVkID0gKChvcHRpb25zJllFSEhBTVpBX01BU0spID09IFlFSEhBTVpBX1RXT0NFTExfTkVBUikgPyAxIDogMDsKKyAgICAgICAgc2VlbkNvbXBvc2VFbmFibGVkID0gKChvcHRpb25zJlNFRU5fTUFTSykgPT0gU0VFTl9UV09DRUxMX05FQVIpPyAxIDogMDsKKworICAgICAgICBmb3IgKGludCBpID0gc3RhcnQsIGUgPSBpICsgbGVuZ3RoOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICBjaGFyIGNoID0gZGVzdFtpXTsKKworICAgICAgICBpZiggKHllaEhhbXphQ29tcG9zZUVuYWJsZWQgPT0gMSkgJiYgKChjaCA9PSBIQU1aQTA2X0NIQVIpIHx8IChjaCA9PSBIQU1aQUZFX0NIQVIpKQorICAgICAgICAgICAgICAgJiYgKGkgPCAobGVuZ3RoIC0gMSkpICYmIGlzQWxlZk1ha3NvdXJhQ2hhcihkZXN0W2krMV0gKSkgeworICAgICAgICAgICAgICAgIGRlc3RbaV0gPSBTUEFDRV9DSEFSOworICAgICAgICAgICAgICAgIGRlc3RbaSsxXSA9IFlFSF9IQU1aQV9DSEFSOworICAgICAgIH0gZWxzZSBpZiAoIChzZWVuQ29tcG9zZUVuYWJsZWQgPT0gMSkgJiYgKGlzVGFpbENoYXIoY2gpKSAmJiAoaTwgKGxlbmd0aCAtIDEpKQorICAgICAgICAgICAgICAgICAgICAgICAmJiAoaXNTZWVuVGFpbEZhbWlseUNoYXIoZGVzdFtpKzFdKT09MSkgKSB7CisgICAgICAgICAgICAgICBkZXN0W2ldID0gU1BBQ0VfQ0hBUjsKKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoY2ggPj0gJ1x1RkU3MCcgJiYgY2ggPD0gJ1x1RkVGQycpIHsKKyAgICAgICAgICAgICAgICBpZiAoaXNMYW1BbGVmQ2hhcihjaCkpIHsKKyAgICAgICAgICAgICAgICAgICAgKytsYWNvdW50OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZXN0W2ldID0gKGNoYXIpY29udmVydEZFdG8wNltjaCAtICdcdUZFNzAnXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbGFjb3VudDsKKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBzaGFwZVVuaWNvZGUKKyAgICAgKiBGdW5jdGlvbjogQ29udmVydHMgYW4gQXJhYmljIFVuaWNvZGUgYnVmZmVyIGluIDA2eHggUmFuZ2UgaW50byBhIHNoYXBlZAorICAgICAqICAgICAgICAgICBhcmFiaWMgVW5pY29kZSBidWZmZXIgaW4gRkV4eCBSYW5nZQorICAgICAqLworICAgIHByaXZhdGUgaW50IHNoYXBlVW5pY29kZShjaGFyW10gZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVzdFNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB0YXNoa2VlbEZsYWcpdGhyb3dzIEFyYWJpY1NoYXBpbmdFeGNlcHRpb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rID4gMCB0aGVuIHRoZXJlIG1pZ2h0IGJlIG1vcmUgdGhhbiBvbmUgc2hhcGUKKyAgICAgICAgICAgIGlmICgoY3VyckxpbmsgJiAnXHVGRjAwJykgPiAwIHx8IGlzVGFzaGtlZWxDaGFyKGRlc3RbaV0pKSB7CisgICAgICAgICAgICAgICAgbncgPSBpIC0gMTsKKyAgICAgICAgICAgICAgICBueCA9IC0yOworICAgICAgICAgICAgICAgIHdoaWxlIChueCA8IDApIHsgLy8gd2UgbmVlZCB0byBrbm93IGFib3V0IG5leHQgY2hhcgorICAgICAgICAgICAgICAgICAgICBpZiAobncgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5leHRMaW5rID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIG54ID0gSW50ZWdlci5NQVhfVkFMVUU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXh0TGluayA9IGdldExpbmsoZGVzdFtud10pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChuZXh0TGluayAmIElSUkVMRVZBTlQpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBueCA9IG53OworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLW53OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKCgoY3VyckxpbmsgJiBBTEVGVFlQRSkgPiAwKSAmJiAoKGxhc3RMaW5rICYgTEFNVFlQRSkgPiAwKSkgeworICAgICAgICAgICAgICAgICAgICBsYW1hbGVmX2ZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgY2hhciB3TGFtYWxlZiA9IGNoYW5nZUxhbUFsZWYoZGVzdFtpXSk7IC8vIGdldCBmcm9tIDB4MDY1Qy0weDA2NWYKKyAgICAgICAgICAgICAgICAgICAgaWYgKHdMYW1hbGVmICE9ICdcdTAwMDAnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXBsYWNlIGFsZWYgYnkgbWFya2VyLCBpdCB3aWxsIGJlIHJlbW92ZWQgbGF0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbaV0gPSAnXHVmZmZmJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbbGFzdFBvc10gPSB3TGFtYWxlZjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBsYXN0UG9zOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgbGFzdExpbmsgPSBwcmV2TGluazsKKyAgICAgICAgICAgICAgICAgICAgY3VyckxpbmsgPSBnZXRMaW5rKHdMYW1hbGVmKTsgLy8gcmVxdWlyZXMgJ1x1MDAwMCcsIHVuZm9ydHVuYXRlbHkKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKChpID4gMCkgJiYgKGRlc3RbaS0xXSA9PSBTUEFDRV9DSEFSKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICggaXNTZWVuRmFtaWx5Q2hhcihkZXN0W2ldKSA9PSAxKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlZW5mYW1fZm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGRlc3RbaV0gPT0gWUVIX0hBTVpBX0NIQVIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHllaGhhbXphX2ZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKGk9PTApeworICAgICAgICAgICAgICAgICAgICBpZiAoIGlzU2VlbkZhbWlseUNoYXIoZGVzdFtpXSkgPT0gMSl7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWVuZmFtX2ZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkZXN0W2ldID09IFlFSF9IQU1aQV9DSEFSKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB5ZWhoYW16YV9mb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKworICAgICAgICAgICAgICAgIC8vIGdldCB0aGUgcHJvcGVyIHNoYXBlIGFjY29yZGluZyB0byBsaW5rIGFiaWxpdHkgb2YgbmVpZ2hib3JzCisgICAgICAgICAgICAgICAgLy8gYW5kIG9mIGNoYXJhY3RlcjsgZGVwZW5kcyBvbiB0aGUgb3JkZXIgb2YgdGhlIHNoYXBlcworICAgICAgICAgICAgICAgIC8vIChpc29sYXRlZCwgaW5pdGlhbCwgbWlkZGxlLCBmaW5hbCkgaW4gdGhlIGNvbXBhdGliaWxpdHkgYXJlYQorCisgICAgICAgICAgICAgICAgaW50IGZsYWcgPSBzcGVjaWFsQ2hhcihkZXN0W2ldKTsKKworICAgICAgICAgICAgICAgIGludCBzaGFwZSA9IHNoYXBlVGFibGVbbmV4dExpbmsgJiBMSU5LX01BU0tdCisgICAgICAgICAgICAgICAgICAgIFtsYXN0TGluayAmIExJTktfTUFTS10KKyAgICAgICAgICAgICAgICAgICAgW2N1cnJMaW5rICYgTElOS19NQVNLXTsKKworICAgICAgICAgICAgICAgIGlmIChmbGFnID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgc2hhcGUgJj0gMHgxOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZyA9PSAyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0YXNoa2VlbEZsYWcgPT0gMCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKChsYXN0TGluayAmIExJTktMKSAhPSAwKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKChuZXh0TGluayAmIExJTktSKSAhPSAwKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSAhPSAnXHUwNjRDJyAmJgorICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSAhPSAnXHUwNjREJyAmJgorICAgICAgICAgICAgICAgICAgICAgICAgISgobmV4dExpbmsgJiBBTEVGVFlQRSkgPT0gQUxFRlRZUEUgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhc3RMaW5rICYgTEFNVFlQRSkgPT0gTEFNVFlQRSkpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2hhcGUgPSAxOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgc2hhcGUgPSAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChmbGFnID09IDIpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRhc2hrZWVsRmxhZyA9PSAyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gVEFTSEtFRUxfU1BBQ0VfU1VCOworICAgICAgICAgICAgICAgICAgICAgICAgdGFzaGtlZWxfZm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gKGNoYXIpKCdcdUZFNzAnICsgaXJyZWxldmFudFBvc1tkZXN0W2ldIC0gJ1x1MDY0QiddICsgc2hhcGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIGVsc2UgbGVhdmUgdGFzaGtlZWwgYWxvbmUKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gKGNoYXIpKCdcdUZFNzAnICsgKGN1cnJMaW5rID4+IDgpICsgc2hhcGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gbW92ZSBvbmUgbm90Y2ggZm9yd2FyZAorICAgICAgICAgICAgaWYgKChjdXJyTGluayAmIElSUkVMRVZBTlQpID09IDApIHsKKyAgICAgICAgICAgICAgICBwcmV2TGluayA9IGxhc3RMaW5rOworICAgICAgICAgICAgICAgIGxhc3RMaW5rID0gY3Vyckxpbms7CisgICAgICAgICAgICAgICAgLy9wcmV2UG9zID0gbGFzdFBvczsKKyAgICAgICAgICAgICAgICBsYXN0UG9zID0gaTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLS1pOworICAgICAgICAgICAgaWYgKGkgPT0gbngpIHsKKyAgICAgICAgICAgICAgICBjdXJyTGluayA9IG5leHRMaW5rOworICAgICAgICAgICAgICAgIG54ID0gLTI7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGkgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICBjdXJyTGluayA9IGdldExpbmsoZGVzdFtpXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBJZiB3ZSBmb3VuZCBhIGxhbS9hbGVmIHBhaXIgaW4gdGhlIGJ1ZmZlcgorICAgICAgICAvLyBjYWxsIGhhbmRsZUdlbmVyYXRlZFNwYWNlcyB0byByZW1vdmUgdGhlIHNwYWNlcyB0aGF0IHdlcmUgYWRkZWQKKworICAgICAgICBkZXN0U2l6ZSA9IGxlbmd0aDsKKyAgICAgICAgaWYgKGxhbWFsZWZfZm91bmQgfHwgdGFzaGtlZWxfZm91bmQpIHsKKyAgICAgICAgICAgIGRlc3RTaXplID0gaGFuZGxlR2VuZXJhdGVkU3BhY2VzKGRlc3QsIHN0YXJ0LCBsZW5ndGgpOworICAgICAgICB9CisgICAgICAgIGlmIChzZWVuZmFtX2ZvdW5kIHx8IHllaGhhbXphX2ZvdW5kKXsKKyAgICAgICAgICAgIGRlc3RTaXplID0gZXhwYW5kQ29tcG9zaXRDaGFyKGRlc3QsIHN0YXJ0LCBkZXN0U2l6ZSwgbGFtYWxlZl9jb3VudCwgU0hBUEVfTU9ERSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGRlc3RTaXplOworICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGRlU2hhcGVVbmljb2RlCisgICAgICogRnVuY3Rpb246IENvbnZlcnRzIGFuIEFyYWJpYyBVbmljb2RlIGJ1ZmZlciBpbiBGRXh4IFJhbmdlIGludG8gdW5zaGFwZWQKKyAgICAgKiAgICAgICAgICAgYXJhYmljIFVuaWNvZGUgYnVmZmVyIGluIDA2eHggUmFuZ2UKKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBkZVNoYXBlVW5pY29kZShjaGFyW10gZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVzdFNpemUpIHRocm93cyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uIHsKKworICAgICAgICBpbnQgbGFtYWxlZl9jb3VudCA9IGRlc2hhcGVOb3JtYWxpemUoZGVzdCwgc3RhcnQsIGxlbmd0aCk7CisKKyAgICAgICAgLy8gSWYgdGhlcmUgd2FzIGEgbGFtYWxlZiBpbiB0aGUgYnVmZmVyIGNhbGwgZXhwYW5kTGFtQWxlZgorICAgICAgICBpZiAobGFtYWxlZl9jb3VudCAhPSAwKSB7CisgICAgICAgICAgICAvLyBuZWVkIHRvIGFkanVzdCBkZXN0IHRvIGZpdCBleHBhbmRlZCBidWZmZXIuLi4gISEhCisgICAgICAgICAgICBkZXN0U2l6ZSA9IGV4cGFuZENvbXBvc2l0Q2hhcihkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYW1hbGVmX2NvdW50LERFU0hBUEVfTU9ERSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBkZXN0U2l6ZSA9IGxlbmd0aDsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBkZXN0U2l6ZTsKKyAgICB9CisKKyAgICBwcml2YXRlIGludCBpbnRlcm5hbFNoYXBlKGNoYXJbXSBzb3VyY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc291cmNlU3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc291cmNlTGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhcltdIGRlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVzdFN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlc3RTaXplKSB0aHJvd3MgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbiB7CisKKyAgICAgICAgaWYgKHNvdXJjZUxlbmd0aCA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChkZXN0U2l6ZSA9PSAwKSB7CisgICAgICAgICAgICBpZiAoKChvcHRpb25zICYgTEVUVEVSU19NQVNLKSAhPSBMRVRURVJTX05PT1ApICYmCisgICAgICAgICAgICAgICAgKChvcHRpb25zICYgTEFNQUxFRl9NQVNLKSA9PSBMQU1BTEVGX1JFU0laRSkpIHsKKworICAgICAgICAgICAgICAgIHJldHVybiBjYWxjdWxhdGVTaXplKHNvdXJjZSwgc291cmNlU3RhcnQsIHNvdXJjZUxlbmd0aCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiBzb3VyY2VMZW5ndGg7IC8vIGJ5IGRlZmluaXRpb24KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIGFsd2F5cyB1c2UgdGVtcCBidWZmZXIKKyAgICAgICAgY2hhcltdIHRlbXAgPSBuZXcgY2hhcltzb3VyY2VMZW5ndGggKiAyXTsgLy8gYWxsIGxhbWFsZWZzIHJlcXVpcmluZyBleHBhbnNpb24KKyAgICAgICAgU3lzdGVtLmFycmF5Y29weShzb3VyY2UsIHNvdXJjZVN0YXJ0LCB0ZW1wLCAwLCBzb3VyY2VMZW5ndGgpOworCisgICAgICAgIGlmIChpc0xvZ2ljYWwpIHsKKyAgICAgICAgICAgIGludmVydEJ1ZmZlcih0ZW1wLCAwLCBzb3VyY2VMZW5ndGgpOworICAgICAgICB9CisKKyAgICAgICAgaW50IG91dHB1dFNpemUgPSBzb3VyY2VMZW5ndGg7CisKKyAgICAgICAgc3dpdGNoIChvcHRpb25zICYgTEVUVEVSU19NQVNLKSB7CisgICAgICAgIGNhc2UgTEVUVEVSU19TSEFQRV9UQVNIS0VFTF9JU09MQVRFRDoKKyAgICAgICAgICAgIG91dHB1dFNpemUgPSBzaGFwZVVuaWNvZGUodGVtcCwgMCwgc291cmNlTGVuZ3RoLCBkZXN0U2l6ZSwgMSk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIExFVFRFUlNfU0hBUEU6CisgICAgICAgICAgICBpZiggKChvcHRpb25zJlRBU0hLRUVMX01BU0spPiAwKSAmJgorICAgICAgICAgICAgICAgICgob3B0aW9ucyZUQVNIS0VFTF9NQVNLKSAhPVRBU0hLRUVMX1JFUExBQ0VfQllfVEFUV0VFTCkpIHsKKyAgICAgICAgICAgICAgICAgICAvKiBDYWxsIHRoZSBzaGFwaW5nIGZ1bmN0aW9uIHdpdGggdGFzaGtlZWwgZmxhZyA9PSAyIGZvciByZW1vdmFsIG9mIHRhc2hrZWVsICovCisgICAgICAgICAgICAgICAgb3V0cHV0U2l6ZSA9IHNoYXBlVW5pY29kZSh0ZW1wLCAwLCBzb3VyY2VMZW5ndGgsIGRlc3RTaXplLCAyKTsKKyAgICAgICAgICAgICAgICB9ZWxzZSB7CisgICAgICAgICAgICAgICAgICAgLy9kZWZhdWx0IENhbGwgdGhlIHNoYXBpbmcgZnVuY3Rpb24gd2l0aCB0YXNoa2VlbCBmbGFnID09IDEgKi8KKyAgICAgICAgICAgICAgICAgICAgb3V0cHV0U2l6ZSA9IHNoYXBlVW5pY29kZSh0ZW1wLCAwLCBzb3VyY2VMZW5ndGgsIGRlc3RTaXplLCAwKTsKKworICAgICAgICAgICAgICAgICAgIC8qQWZ0ZXIgc2hhcGluZyB0ZXh0IGNoZWNrIGlmIHVzZXIgd2FudHMgdG8gcmVtb3ZlIHRhc2hrZWVsIGFuZCByZXBsYWNlIGl0IHdpdGggdGF0d2VlbCovCisgICAgICAgICAgICAgICAgICAgaWYoIChvcHRpb25zJlRBU0hLRUVMX01BU0spID09IFRBU0hLRUVMX1JFUExBQ0VfQllfVEFUV0VFTCl7CisgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dFNpemUgPSBoYW5kbGVUYXNoa2VlbFdpdGhUYXR3ZWVsKHRlbXAsc291cmNlTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIExFVFRFUlNfVU5TSEFQRToKKyAgICAgICAgICAgIG91dHB1dFNpemUgPSBkZVNoYXBlVW5pY29kZSh0ZW1wLCAwLCBzb3VyY2VMZW5ndGgsIGRlc3RTaXplKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChvdXRwdXRTaXplID4gZGVzdFNpemUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uKCJub3QgZW5vdWdoIHJvb20gZm9yIHJlc3VsdCBkYXRhIik7CisgICAgICAgIH0KKworICAgICAgICBpZiAoKG9wdGlvbnMgJiBESUdJVFNfTUFTSykgIT0gRElHSVRTX05PT1ApIHsKKyAgICAgICAgICAgIGNoYXIgZGlnaXRCYXNlID0gJ1x1MDAzMCc7IC8vIEV1cm9wZWFuIGRpZ2l0cworICAgICAgICAgICAgc3dpdGNoIChvcHRpb25zICYgRElHSVRfVFlQRV9NQVNLKSB7CisgICAgICAgICAgICBjYXNlIERJR0lUX1RZUEVfQU46CisgICAgICAgICAgICAgICAgZGlnaXRCYXNlID0gJ1x1MDY2MCc7ICAvLyBBcmFiaWMtSW5kaWMgZGlnaXRzCisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRElHSVRfVFlQRV9BTl9FWFRFTkRFRDoKKyAgICAgICAgICAgICAgICBkaWdpdEJhc2UgPSAnXHUwNmYwJzsgIC8vIEVhc3Rlcm4gQXJhYmljLUluZGljIGRpZ2l0cyAoUGVyc2lhbiBhbmQgVXJkdSkKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3dpdGNoIChvcHRpb25zICYgRElHSVRTX01BU0spIHsKKyAgICAgICAgICAgIGNhc2UgRElHSVRTX0VOMkFOOgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IGRpZ2l0RGVsdGEgPSBkaWdpdEJhc2UgLSAnXHUwMDMwJzsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBvdXRwdXRTaXplOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgY2ggPSB0ZW1wW2ldOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoIDw9ICdcdTAwMzknICYmIGNoID49ICdcdTAwMzAnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcFtpXSArPSBkaWdpdERlbHRhOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIERJR0lUU19BTjJFTjoKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgZGlnaXRUb3AgPSAoY2hhcikoZGlnaXRCYXNlICsgOSk7CisgICAgICAgICAgICAgICAgICAgIGludCBkaWdpdERlbHRhID0gJ1x1MDAzMCcgLSBkaWdpdEJhc2U7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgb3V0cHV0U2l6ZTsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGNoID0gdGVtcFtpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaCA8PSBkaWdpdFRvcCAmJiBjaCA+PSBkaWdpdEJhc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wW2ldICs9IGRpZ2l0RGVsdGE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRElHSVRTX0VOMkFOX0lOSVRfTFI6CisgICAgICAgICAgICAgICAgc2hhcGVUb0FyYWJpY0RpZ2l0c1dpdGhDb250ZXh0KHRlbXAsIDAsIG91dHB1dFNpemUsIGRpZ2l0QmFzZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIERJR0lUU19FTjJBTl9JTklUX0FMOgorICAgICAgICAgICAgICAgIHNoYXBlVG9BcmFiaWNEaWdpdHNXaXRoQ29udGV4dCh0ZW1wLCAwLCBvdXRwdXRTaXplLCBkaWdpdEJhc2UsIHRydWUpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKGlzTG9naWNhbCkgeworICAgICAgICAgICAgaW52ZXJ0QnVmZmVyKHRlbXAsIDAsIG91dHB1dFNpemU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WQgYnkKKyAqIGFuIG9mZnNldCB0byB0aGUgbmV4dCBjaHVuayBpbiBhIGxpbmtlZC1saXN0IG9mIGFkZGl0aW9uYWwgY2h1bmsgb2Ygcm93X3Nsb3RfdHMgaW4gY2FzZQorICogdGhlIHByZS1hbGxvY2F0ZWQgY2h1bmsgaXNuJ3QgYmlnIGVub3VnaCB0byByZWZlciB0byBhbGwgcm93cy4gRWFjaCByb3cgZGlyZWN0b3J5IGhhcyBhCisgKiBmaWVsZF9zbG90X3QgcGVyIGNvbHVtbiwgd2hpY2ggaGFzIHRoZSBzaXplLCBvZmZzZXQsIGFuZCB0eXBlIG9mIHRoZSBkYXRhIGZvciB0aGF0IGZpZWxkLgorICogTm90ZSB0aGF0IHRoZSBkYXRhIHR5cGVzIGNvbWUgZnJvbSBzcWxpdGUzLmguCisgKi8KK2NsYXNzIEN1cnNvcldpbmRvdworeworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgQ3Vyc29yV2luZG93KHNpemVfdCBtYXhTaXplKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEN1cnNvcldpbmRvdygpe30KKyAgICBib29sICAgICAgICAgICAgICAgIHNldE1lbW9yeShjb25zdCBzcDxJTWVtb3J5PiYpOworICAgICAgICAgICAgICAgICAgICAgICAgfkN1cnNvcldpbmRvdygpOworCisgICAgYm9vbCAgICAgICAgICAgICAgICBpbml0QnVmZmVyKGJvb2wgbG9jYWxPbmx5KTsKKyAgICBzcDxJTWVtb3J5PiAgICAgICAgIGdldE1lbW9yeSgpIHtyZXR1cm4gbU1lbW9yeTt9CisKKyAgICBzaXplX3QgICAgICAgICAgICAgIHNpemUoKSB7cmV0dXJuIG1TaXplO30KKyAgICB1aW50OF90ICogICAgICAgICAgIGRhdGEoKSB7cmV0dXJuIG1EYXRhO30KKyAgICB1aW50MzJfdCAgICAgICAgICAgIGdldE51bVJvd3MoKSB7cmV0dXJuIG1IZWFkZXItPm51bVJvd3M7fQorICAgIHVpbnQzMl90ICAgICAgICAgICAgZ2V0TnVtQ29sdW1ucygpIHtyZXR1cm4gbUhlYWRlci0+bnVtQ29sdW1uczt9CisgICAgdm9pZCAgICAgICAgICAgICAgICBmcmVlTGFzdFJvdygpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUhlYWRlci0+bnVtUm93cyA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhlYWRlci0+bnVtUm93cy0tOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICBib29sICAgICAgICAgICAgICAgIHNldE51bUNvbHVtbnModWludDMyX3QgbnVtQ29sdW1ucykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGN1ciA9IG1IZWFkZXItPm51bUNvbHVtbnM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXIgPiAwICYmIGN1ciAhPSBudW1Db2x1bW5zKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMT0dFKCJUcnlpbmcgdG8gZ28gZnJvbSAlZCBjb2x1bW5zIHRvICVkIiwgY3VyLCBudW1Db2x1bW5zKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZGVyLT5udW1Db2x1bW5zID0gbnVtQ29sdW1uczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgaW50MzJfdCAgICAgICAgICAgICBmcmVlU3BhY2UoKTsKKworICAgIHZvaWQgICAgICAgICAgICAgICAgY2xlYXIoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBBbGxvY2F0ZSBhIHJvdyBzbG90IGFuZCBpdHMgZGlyZWN0b3J5LiBUaGUgcmV0dXJuZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHBvaW50ZXIgcG9pbnRzIHRvIHRoZSBiZWdpbmluZyBvZiB0aGUgcm93J3MgZGlyZWN0b3J5CisgICAgICAgICAgICAgICAgICAgICAgICAgKiBvciBOVUxMIGlmIHRoZXJlIHdhc24ndCByb29tLiBUaGUgZGlyZWN0b3J5IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbml0aWFsaWVkIHdpdGggTlVMTCBlbnRyaWVzIGZvciBlYWNoIGZpZWxkLgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgZmllbGRfc2xvdF90ICogICAgICBhbGxvY1JvdygpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIEFsbG9jYXRlIGEgcG9ydGlvbiBvZiB0aGUgd2luZG93LiBSZXR1cm5zIHRoZSBvZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIG9mIHRoZSBhbGxvY2F0aW9uLCBvciAwIGlmIHRoZXJlIGlzbid0IGVub3VnaCBzcGFjZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqIElmIGFsaWduZWQgaXMgdHJ1ZSwgdGhlIGFsbG9jYXRpb24gZ2V0cyA0IGJ5dGUgYWxpZ25tZW50LgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdWludDMyX3QgICAgICAgICAgICBhbGxvYyhzaXplX3Qgc2l6ZSwgYm9vbCBhbGlnbmVkID0gZmFsc2UpOworCisgICAgdWludDMyX3QgICAgICAgICAgICByZWFkX2ZpZWxkX3Nsb3QoaW50IHJvdywgaW50IGNvbHVtbiwgZmllbGRfc2xvdF90ICogc2xvdCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICogQ29weSBkYXRhIGludG8gdGhlIHdpbmRvdyBhdCB0aGUgZ2l2ZW4gb2Zmc2V0LgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdm9pZCAgICAgICAgICAgICAgICBjb3B5SW4odWludDMyX3Qgb2Zmc2V0LCB1aW50OF90IGNvbnN0ICogZGF0YSwgc2l6ZV90IHNpemUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgY29weUluKHVpbnQzMl90IG9mZnNldCwgaW50NjRfdCBkYXRhKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIGNvcHlJbih1aW50MzJfdCBvZmZzZXQsIGRvdWJsZSBkYXRhKTsKKworICAgIHZvaWQgICAgICAgICAgICAgICAgY29weU91dCh1aW50MzJfdCBvZmZzZXQsIHVpbnQ4X3QgKiBkYXRhLCBzaXplX3Qgc2l6ZSk7CisgICAgaW50NjRfdCAgICAgICAgICAgICBjb3B5T3V0TG9uZyh1aW50MzJfdCBvZmZzZXQpOworICAgIGRvdWJsZSAgICAgICAgICAgICAgY29weU91dERvdWJsZSh1aW50MzJfdCBvZmZzZXQpOworCisgICAgYm9vbCAgICAgICAgICAgICAgICBwdXRMb25nKHVuc2lnbmVkIGludCByb3csIHVuc2lnbmVkIGludCBjb2wsIGludDY0X3QgdmFsdWUpOworICAgIGJvb2wgICAgICAgICAgICAgICAgcHV0RG91YmxlKHVuc2lnbmVkIGludCByb3csIHVuc2lnbmVkIGludCBjb2wsIGRvdWJsZSB2YWx1ZSk7CisgICAgYm9vbCAgICAgICAgICAgICAgICBwdXROdWxsKHVuc2lnbmVkIGludCByb3csIHVuc2lnbmVkIGludCBjb2wpOworCisgICAgYm9vbCAgICAgICAgICAgICAgICBnZXRMb25nKHVuc2lnbmVkIGludCByb3csIHVuc2lnbmVkIGludCBjb2wsIGludDY0X3QgKiB2YWx1ZU91dCk7CisgICAgYm9vbCAgICAgICAgICAgICAgICBnZXREb3VibGUodW5zaWduZWQgaW50IHJvdywgdW5zaWduZWQgaW50IGNvbCwgZG91YmxlICogdmFsdWVPdXQpOworICAgIGJvb2wgICAgICAgICAgICAgICAgZ2V0TnVsbCh1bnNpZ25lZCBpbnQgcm93LCB1bnNpZ25lZCBpbnQgY29sLCBib29sICogdmFsdWVPdXQpOworCisgICAgdWludDhfdCAqICAgICAgICAgICBvZmZzZXRUb1B0cih1aW50MzJfdCBvZmZzZXQpIHtyZXR1cm4gbURhdGEgKyBvZmZzZXQ7fQorCisgICAgcm93X3Nsb3RfdCAqICAgICAgICBhbGxvY1Jvd1Nsb3QoKTsKKworICAgIHJvd19zbG90X3QgKiAgICAgICAgZ2V0Um93U2xvdChpbnQgcm93KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiByZXR1cm4gTlVMTCBpZiBGYWlsZWQgdG8gZmluZCByb3dTbG90IG9yCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBJbnZhbGlkIHJvd1Nsb3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIGZpZWxkX3Nsb3RfdCAqICAgICAgZ2V0RmllbGRTbG90V2l0aENoZWNrKGludCByb3csIGludCBjb2x1bW4pOworICAgIGZpZWxkX3Nsb3RfdCAqICAgICAgZ2V0RmllbGRTbG90KGludCByb3csIGludCBjb2x1bW4pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZmllbGREaXJPZmZzZXQgPSBnZXRSb3dTbG90KHJvdyktPm9mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgoZmllbGRfc2xvdF90ICopb2Zmc2V0VG9QdHIoZmllbGREaXJPZmZzZXQpKSArIGNvbHVtbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKK3ByaXZhdGU6CisgICAgdWludDhfdCAqIG1EYXRhOworICAgIHNpemVfdCBtU2l6ZTsKKyAgIC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ci4KKyAgICAgKi8KKyAgICBzdGF0aWMgQ2FtZXJhU291cmNlICpDcmVhdGVGcm9tQ2FtZXJhKGNvbnN0IHNwPElDYW1lcmE+ICZjYW1lcmEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMl90IGNhbWVyYUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2l6ZSB2aWRlb1NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMl90IGZyYW1lUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPFN1cmZhY2U+JiBzdXJmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBzdG9yZU1ldGFEYXRhSW5WaWRlb0J1ZmZlcnMgPSBmYWxzZSk7CiAKICAgICB2aXJ0dWFsIH5DYW1lcmFTb3VyY2UoKTsKIAogICAgIHZpcnR1YWwgc3RhdHVzX3Qgc3RhcnQoTWV0YURhdGEgKnBhcmFtcyA9IE5VTEwpOwogICAgIHZpcnR1YWwgc3RhdHVzX3Qgc3RvcCgpOwotCi0gICAgdmlydHVhbCBzcDxNZXRhRGF0YT4gZ2V0Rm9ybWF0KCk7Ci0KICAgICB2aXJ0dWFsIHN0YXR1c190IHJlYWQoCiAgICAgICAgICAgICBNZWRpYUJ1ZmZlciAqKmJ1ZmZlciwgY29uc3QgUmVhZE9wdGlvbnMgKm9wdGlvbnMgPSBOVUxMKTsKIAorICAgIC8qKgorICAgICAqIENoZWNrIHdoZXRoZXIgYSBDYW1lcmFTb3VyY2Ugb2JqZWN0IGlzIHByb3Blcmx5IGluaXRpYWxpemVkLgorICAgICAqIE11c3QgY2FsbCB0aGlzIG1ldGhvZCBiZWZvcmUgc3RvcCgpLgorICAgICAqIEByZXR1cm4gT0sgaWYgaW5pdGlhbGl6YXRpb24gaGFzI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wLDcgKzI0NiwxMCBAQAogICAgICAgICB1aW50MzJfdCAgICAgICAgY2xhc3NlczsKICAgICAgICAgdWludDhfdCogICAgICAgIGtleUJpdG1hc2s7CiAgICAgICAgIEtleUxheW91dE1hcCogICBsYXlvdXRNYXA7Ci0gICAgICAgIFN0cmluZzggICAgICAgICBrZXlsYXlvdXRGaWxlbmFtZTsKKyAgICAgICAgU3RyaW5nOCAgICAgICAgIGtleU1hcE5hbWU7CisgICAgICAgIGJvb2wgICAgICAgICAgICBkZWZhdWx0S2V5TWFwOworICAgICAgICBTdHJpbmc4ICAgICAgICAga2V5TGF5b3V0RmlsZW5hbWU7CisgICAgICAgIFN0cmluZzggICAgICAgICBrZXlDaGFyYWN0ZXJNYXBGaWxlbmFtZTsKICAgICAgICAgaW50ICAgICAgICAgICAgIGZkOwogICAgICAgICBkZXZpY2VfdCogICAgICAgbmV4dDsKICAgICAgICAgCkBAIC0yNTAsMTMgKzI1OSwxOSBAQAogCiAgICAgZGV2aWNlX3QqIGdldERldmljZUxvY2tlZChpbnQzMl90IGRldmljZUlkKSBjb25zdDsKICAgICBib29sIGhhc0tleWNvZGVMb2NrZWQoZGV2aWNlX3QqIGRldmljZSwgaW50IGtleWNvZGUpIGNvbnN0OwotICAgIAorCiAgICAgaW50MzJfdCBnZXRTY2FuQ29kZVN0YXRlTG9ja2VkKGRldmljZV90KiBkZXZpY2UsIGludDMyX3Qgc2NhbkNvZGUpIGNvbnN0OwogICAgIGludDMyX3QgZ2V0S2V5Q29kZVN0YXRlTG9ja2VkKGRldmljZV90KiBkZXZpY2UsIGludDMyX3Qga2V5Q29kZSkgY29uc3Q7CiAgICAgaW50MzJfdCBnZXRTd2l0Y2hTdGF0ZUxvY2tlZChkZXZpY2VfdCogZGV2aWNlLCBpbnQzMl90IHN3KSBjb25zdDsKICAgICBib29sIG1hcmtTdXBwb3J0ZWRLZXlDb2Rlc0xvY2tlZChkZXZpY2VfdCogZGV2aWNlLCBzaXplX3QgbnVtQ29kZXM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0gbU1heFNpemU7CisKKyAgICAgICAgICAgICAgICAvLyBQdXQgdGhlIHdpbmRvdyBpbnRvIGEgY2xlYW4gc3RhdGUKKyAgICAgICAgICAgICAgICBjbGVhcigpOworICAgICAgICAgICAgTE9HX1dJTkRPVygiQ3JlYXRlZCBDdXJzb3JXaW5kb3cgd2l0aCBuZXcgTWVtb3J5RGVhbGVyOiBtRnJlZU9mZnNldCA9ICVkLCBtU2l6ZSA9ICVkLCBtTWF4U2l6ZSA9ICVkLCBtRGF0YSA9ICVwIiwgbUZyZWVPZmZzZXQsIG1TaXplLCBtTWF4U2l6ZSwgbURhdGEpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAKKyAgICAgICAgTE9HRSgiQ3Vyc29yV2luZG93IGhlYXAgYWxsb2NhdGlvbiBmYWlsZWQiKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0gZWxzZSB7CisgICAgICAgIExPR0UoImZhaWxlZCB0byBjcmVhdGUgdGhlIEN1cnNvcldpbmRvdyBoZWFwIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9Cit9CisKK0N1cnNvcldpbmRvdzo6fkN1cnNvcldpbmRvdygpCit7CisgICAgLy8gRXZlcnl0aGluZyB0aGF0IG1hdHRlcnMgaXMgYSBzbWFydCBwb2ludGVyCit9CisKK3ZvaWQgQ3Vyc29yV2luZG93OjpjbGVhcigpCit7CisgICAgbUhlYWRlci0+bnVtUm93cyA9IDA7CisgICAgbUhlYWRlci0+bnVtQ29sdW1ucyA9IDA7CisgICAgbUZyZWVPZmZzZXQgPSBzaXplb2Yod2luZG93X2hlYWRlcl90KSArIFJPV19TTE9UX0NIVU5LX1NJWkU7CisgICAgLy8gTWFyayB0aGUgZmlyc3QgY2h1bmsncyBuZXh0ICdwb2ludGVyJyBhcyBudWxsCisgICAgKigodWludDMyX3QgKikobURhdGEgKyBtRnJlZU9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WYgKG1IZWFkZXItPm51bVJvd3MgPiAxKSB7CisgICAgICAgICAgICBMT0dWKCJub3QgZ3Jvd2luZyBzaW5jZSB0aGVyZSBhcmUgYWxyZWFkeSAlZCByb3cocyksIG1heCBzaXplICVkIiwgbUhlYWRlci0+bnVtUm93cywKKyAgICAgICAgICAgICAgICAgICAgbU1heFNpemUpOworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKworICAgICAgICAvLyBGaW5kIGEgbmV3IHNpemUgdGhhdCB3aWxsIGZpdCB0aGUgYWxsb2NhdGlvbgorICAgICAgICBpbnQgYWxsb2NhdGVkID0gbVNpemUgLSBmcmVlU3BhY2UoKTsKKyAgICAgICAgaW50IG5ld1NpemUgPSBtU2l6ZSArIFdJTkRPV19BTExPQ0FUSU9OX1NJWkU7CisgICAgICAgIHdoaWxlIChzaXplID4gKG5ld1NpemUgLSBhbGxvY2F0ZWQpKSB7CisgICAgICAgICAgICBuZXdTaXplICs9IFdJTkRPV19BTExPQ0FUSU9OX1NJWkU7CisgICAgICAgICAgICBpZiAobmV3U2l6ZSA+IG1NYXhTaXplKSB7CisgICAgICAgICAgICAgICAgTE9HRSgiQXR0ZW1wdGluZyB0byBncm93IHdpbmRvdyBiZXlvbmQgbWF4IHNpemUgKCVkKSIsIG1NYXhTaXplKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorTE9HX1dJTkRPVygiZm91bmQgc2l6ZSAlZCIsIG5ld1NpemUpOworICAgICAgICBtU2l6ZSA9IG5ld1NpemU7CisgICAgfQorCisgICAgdWludDMyX3Qgb2Zmc2V0ID0gbUZyZWVPZmZzZXQgKyBwYWRkaW5nOworICAgIG1GcmVlT2Zmc2V0ICs9IHNpemU7CisgICAgcmV0dXJuIG9mZnNldDsKK30KKworcm93X3Nsb3RfdCAqIEN1cnNvcldpbmRvdzo6Z2V0Um93U2xvdChpbnQgcm93KQoreworICAgIExPR19XSU5ET1coImVudGVyIGdldFJvd1Nsb3QgY3VycmVudCByb3cgbnVtICVkLCB0aGlzIHJvdyAlZCIsIG1IZWFkZXItPm51bVJvd3MsIHJvdyk7CisgICAgaW50IGNodW5rTnVtID0gcm93IC8gUk9XX1NMT1RfQ0hVTktfTlVNX1JPV1M7CisgICAgaW50IGNodW5rUG9zID0gcm93ICUgUk9XX1NMT1RfQ0hVTktfTlVNX1JPV1M7CisgICAgaW50IGNodW5rUHRyT2Zmc2V0ID0gc2l6ZW9mKHdpbmRvd19oZWFkZXJfdCkgKyBST1dfU0xPVF9DSFVOS19TSVpFIC0gc2l6ZW9mKHVpbnQzMl90KTsKKyAgICB1aW50OF90ICogcm93Q2h1bmsgPSBtRGF0YSArIHNpemVvZih3aW5kb3dfaGVhZGVyX3QpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY2h1bmtOdW07IGkrKykgeworICAgICAgICByb3dDaHVuayA9IG9mZnNldFRvUHRyKCooKHVpbnQzMl90ICopKG1EYXRhICsgY2h1bmtQdHJPZmZzZXQpKSk7CisgICAgICAgIGNodW5rUHRyT2Zmc2V0ID0gcm93Q2h1bmsgLSBtRGF0YSArIChST1dfU0xPVF9DSFVOS19OVU1fUk9XUyAqIHNpemVvZihyb3dfc2xvdF90KSk7CisgICAgfQorICAgIHJldHVybiAocm93X3Nsb3RfdCAqKShyb3dDaHVuayArIChjaHVua1BvcyAqIHNpemVvZihyb3dfc2xvdF90KSkpOworICAgIExPR19XSU5ET1coImV4aXQgZ2V0Um93U2xvdCBjdXJyZW50IHJvdyBudW0gJWQsIHRoaXMgcm93ICVkIiwgbUhlYWRlci0+bnVtUm93cywgcm93KTsgICAgCit9CisKK3Jvd19zbG90X3QgKiBDdXJzb3JXaW5kb3c6OmFsbG9jUm93U2xvdCgpCit7CisgICAgaW50IGNodW5rTnVtID0gbUhlYWRlci0+bnVtUm93cyAvIFJPV19TTE9UX0NIVU5LX05VTV9ST1dTOworICAgIGludCBjaHVua1BvcyA9IG1IZWFk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Q2h1bmtPZmZzZXQsIHJvd0NodW5rKTsKKyAgICAgICAgICAgICooKHVpbnQzMl90ICopKG1EYXRhICsgY2h1bmtQdHJPZmZzZXQpKSA9IHJvd0NodW5rIC0gbURhdGE7CisgICAgICAgICAgICAvLyBNYXJrIHRoZSBuZXcgY2h1bmsncyBuZXh0ICdwb2ludGVyJyBhcyBudWxsCisgICAgICAgICAgICAqKCh1aW50MzJfdCAqKShyb3dDaHVuayArIFJPV19TTE9UX0NIVU5LX1NJWkUgLSBzaXplb2YodWludDMyX3QpKSkgPSAwOworICAgICAgICB9IGVsc2UgeworTE9HX1dJTkRPVygiZm9sbHdpbmcgJ3BvaW50ZXInIHRvIG5leHQgY2h1bmssIG9mZnNldCBvZiBuZXh0IHBvaW50ZXIgaXMgJWQiLCBjaHVua1B0ck9mZnNldCk7CisgICAgICAgICAgICByb3dDaHVuayA9IG9mZnNldFRvUHRyKG5leHRDaHVua09mZnNldCk7CisgICAgICAgICAgICBjaHVua1B0ck9mZnNldCA9IHJvd0NodW5rIC0gbURhdGEgKyAoUk9XX1NMT1RfQ0hVTktfTlVNX1JPV1MgKiBzaXplb2Yocm93X3Nsb3RfdCkpOworICAgICAgICB9CisgICAgfQorICAgIG1IZWFkZXItPm51bVJvd3MrKzsKKworICAgIHJldHVybiAocm93X3Nsb3RfdCAqKShyb3dDaHVuayArIChjaHVua1BvcyAqIHNpemVvZihyb3dfc2xvdF90KSkpOworfQorCitmaWVsZF9zbG90X3QgKiBDdXJzb3JXaW5kb3c6OmdldEZpZWxkU2xvdFdpdGhDaGVjayhpbnQgcm93LCBpbnQgY29sdW1uKQoreworICBpZiAocm93IDwgMCB8fCByb3cgPj0gbUhlYWRlci0+bnVtUm93cyB8fCBjb2x1bW4gPCAwIHx8IGNvbHVtbiA+PSBtSGVhZGVyLT5udW1Db2x1bW5zKSB7CisgICAgICBMT0dFKCJCYWQgcmVxdWVzdCBmb3IgZmllbGQgc2xvdCAlZCwlZC4gbnVtUm93cyA9ICVk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RlcmZhY2VUb2tlbihJQ2FtZXJhOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX05VTV9WSURFT19CVUZGRVJTLCBkYXRhLCAmcmVwbHkpOworICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7CisgICAgfQorCisgICAgc3A8SU1lbW9yeT4gZ2V0VmlkZW9CdWZmZXIoaW50MzJfdCBpbmRleCkgY29uc3QKKyAgICB7CisgICAgICAgIExPR1YoImdldFZpZGVvQnVmZmVyOiAlZCIsIGluZGV4KTsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNhbWVyYTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGluZGV4KTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9WSURFT19CVUZGRVIsIGRhdGEsICZyZXBseSk7CisgICAgICAgIHNwPElNZW1vcnk+IG1lbSA9IGludGVyZmFjZV9jYXN0PElNZW1vcnk+KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcGx5LnJlYWRTdHJvbmdCaW5kZXIoKSk7CisgICAgICAgIHJldHVybiBtZW07CisgICAgfQorCisgICAgc3RhdHVzX3Qgc3RvcmVNZXRhRGF0YUluQnVmZmVycyhib29sIGVuYWJsZWQpCisgICAgeworICAgICAgICBMT0dWKCJzdG9yZU1ldGFEYXRhSW5CdWZmZXJzOiAlcyIsIGVuYWJsZWQ/ICJ0cnVlIjogImZhbHNlIik7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDYW1lcmE6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihlbmFibGVkKTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KFNUT1JFX01FVEFfREFUQV9JTl9CVUZGRVJTLCBkYXRhLCAmcmVwbHkpOworICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7CisgICAgfQorCiAgICAgLy8gY2hlY2sgcHJldmlldyBzdGF0ZQogICAgIGJvb2wgcHJldmlld0VuYWJsZWQoKQogICAgIHsKQEAgLTI1OCw3ICsyOTIsNyBAQAogICAgICAgICBjYXNlIFNFVF9QUkVWSUVXX0RJU1BMQVk6IHsKICAgICAgICAgICAgIExPR1YoIlNFVF9QUkVWSUVXX0RJU1BMQVkiKTsKICAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ2FtZXJhLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBzcDxJU3VyZmFjZT4gc3VyZmFjZSA9IGludGVyZmFjZV9jYXN0PElTdXJmYWNlPihkYXRhLnJlYWRTdHJvbmdCaW5kZXIoKSk7CisgICAgICAgICAgICBzcDxTdXJmYWNlPiBzdXJmYWNlID0gU3VyZmFjZTo6cmVhZEZyb21QYXJjZWwoZGF0YSk7CiAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRQcmV2aWV3RGlzcGxheShzdXJmYWNlKSk7CiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgIH0gYnJlYWs7CkBAIC0zMDAsNiArMzM0LDI2IEBACiAgICAgICAgICAgICByZWxlYXNlUmVjb3JkaW5nRnJhbWUobWVtKTsKICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKICAgICAgICAgfSBicmVhazsKKyAgICAgICAgY2FzZSBHRVRfTlVNX1ZJREVPX0JVRkZFUlM6IHsKKyAgICAgICAgICAgIExPR1YoIkdFVF9OVU1fVklERU9fQlVGRkVSUyIpOworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDYW1lcmEsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGdldE51bWJlck9mVmlkZW9CdWZmZXJzKCkpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9IGJyZWFrOworICAgICAgICBjYXNlIEdFVF9WSURFT19CVUZGRVI6IHsKKyAgICAgICAgICAgIExPR1YoIkdFVF9WSURFT19CVUZGRVIiKTsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ2FtZXJhLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICBpbnQzMl90IGluZGV4ID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cm9uZ0JpbmRlcihnZXRWaWRlb0J1ZmZlcihpbmRleCktPmFzQmluZGVyKCkpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9IGJyZWFrOworICAgICAgICBjYXNlIFNUT1JFX01FVEFfREFUQV9JTl9CVUZGRVJTOiB7CisgICAgICAgICAgICBMT0dWKCJTVE9SRV9NRVRBX0RBVEFfSU5fQlVGRkVSUyIpOworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDYW1lcmEsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIGJvb2wgZW5hYmxlZCA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdG9yZU1ldGFEYXRhSW5CdWZmZXJzKGVuYWJsZWQpKTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBQUkVWSUVXX0VOQUJMRUQ6IHsKICAgICAgICAgICAgIExPR1YoIlBSRVZJRVdfRU5BQkxFRCIpOwogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDYW1lcmEsIGRhdGEsIHJlcGx5KTsKQEAgLTM3Niw0ICs0MzAsMyBAQAogLy8gLS0tLS0tLS0tLS0tLS0tLS0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IENhY2hlczo6Z2V0UmVnaW9uTWVzaCgpIHsKKyAgICAvLyBDcmVhdGUgdGhlIG1lc2gsIDIgdHJpYW5nbGVzIGFuZCA0IHZlcnRpY2VzIHBlciByZWN0YW5nbGUgaW4gdGhlIHJlZ2lvbgorICAgIGlmICghbVJlZ2lvbk1lc2gpIHsKKyAgICAgICAgbVJlZ2lvbk1lc2ggPSBuZXcgVGV4dHVyZVZlcnRleFtSRUdJT05fTUVTSF9RVUFEX0NPVU5UICogNF07CisKKyAgICAgICAgdWludDE2X3QqIHJlZ2lvbkluZGljZXMgPSBuZXcgdWludDE2X3RbUkVHSU9OX01FU0hfUVVBRF9DT1VOVCAqIDZdOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IFJFR0lPTl9NRVNIX1FVQURfQ09VTlQ7IGkrKykgeworICAgICAgICAgICAgdWludDE2X3QgcXVhZCA9IGkgKiA0OworICAgICAgICAgICAgaW50IGluZGV4ID0gaSAqIDY7CisgICAgICAgICAgICByZWdpb25JbmRpY2VzW2luZGV4ICAgIF0gPSBxdWFkOyAgICAgICAvLyB0b3AtbGVmdAorICAgICAgICAgICAgcmVnaW9uSW5kaWNlc1tpbmRleCArIDFdID0gcXVhZCArIDE7ICAgLy8gdG9wLXJpZ2h0CisgICAgICAgICAgICByZWdpb25JbmRpY2VzW2luZGV4ICsgMl0gPSBxdWFkICsgMjsgICAvLyBib3R0b20tbGVmdAorICAgICAgICAgICAgcmVnaW9uSW5kaWNlc1tpbmRleCArIDNdID0gcXVhZCArIDI7ICAgLy8gYm90dG9tLWxlZnQKKyAgICAgICAgICAgIHJlZ2lvbkluZGljZXNbaW5kZXggKyA0XSA9IHF1YWQgKyAxOyAgIC8vIHRvcC1yaWdodAorICAgICAgICAgICAgcmVnaW9uSW5kaWNlc1tpbmRleCArIDVdID0gcXVhZCArIDM7ICAgLy8gYm90dG9tLXJpZ2h0CisgICAgICAgIH0KKworICAgICAgICBnbEdlbkJ1ZmZlcnMoMSwgJm1SZWd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AgaW5pdCgpOworCisgICAgaWYgKHdyaXRlci5zaXplKCkgPT0gMCkgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc2l6ZV90IHNpemUgPSB3cml0ZXIuc2l6ZSgpOworICAgIHZvaWQqIGJ1ZmZlciA9IHNrX21hbGxvY190aHJvdyhzaXplKTsKKyAgICB3cml0ZXIuZmxhdHRlbihidWZmZXIpOworICAgIG1SZWFkZXIuc2V0TWVtb3J5KGJ1ZmZlciwgc2l6ZSk7CisKKyAgICBtUkNQbGF5YmFjay5yZXNldCgmcmVjb3JkZXIubVJDUmVjb3JkZXIpOworICAgIG1SQ1BsYXliYWNrLnNldHVwQnVmZmVyKG1SZWFkZXIpOworCisgICAgbVRGUGxheWJhY2sucmVzZXQoJnJlY29yZGVyLm1URlJlY29yZGVyKTsKKyAgICBtVEZQbGF5YmFjay5zZXR1cEJ1ZmZlcihtUmVhZGVyKTsKKworICAgIENhY2hlcyYgY2FjaGVzID0gQ2FjaGVzOjpnZXRJbnN0YW5jZSgpOworCisgICAgY29uc3QgVmVjdG9yPFNrQml0bWFwKj4gJmJpdG1hcFJlc291cmNlcyA9IHJlY29yZGVyLmdldEJpdG1hcFJlc291cmNlcygpOworICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgYml0bWFwUmVzb3VyY2VzLnNpemUoKTsgaSsrKSB7CisgICAgICAgIFNrQml0bWFwKiByZXNvdXJjZSA9IGJpdG1hcFJlc291cmNlcy5pdGVtQXQoaSk7CisgICAgICAgIG1CaXRtYXBSZXNvdXJjZXMuYWRkKHJlc291cmNlKTsKKyAgICAgICAgY2FjaGVzLnJlc291cmNlQ2FjaGUuaW5jcmVtZW50UmVmY291bnQocmVzb3VyY2UpOworICAgIH0KKworICAgIGNvbnN0IFZlY3RvcjxTa2lhU2hhZGVyKj4gJnNoYWRlclJlc291cmNlcyA9IHJlY29yZGVyLmdldFNoYWRlclJlc291cmNlcygpOworICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpID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BSZXNvdXJjZXMuaXRlbUF0KGkpKTsKKyAgICB9CisgICAgbUJpdG1hcFJlc291cmNlcy5jbGVhcigpOworCisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtU2hhZGVyUmVzb3VyY2VzLnNpemUoKTsgaSsrKSB7CisgICAgICAgIGNhY2hlcy5yZXNvdXJjZUNhY2hlLmRlY3JlbWVudFJlZmNvdW50KG1TaGFkZXJSZXNvdXJjZXMuaXRlbUF0KGkpKTsKKyAgICB9CisgICAgbVNoYWRlclJlc291cmNlcy5jbGVhcigpOworCisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtUGFpbnRzLnNpemUoKTsgaSsrKSB7CisgICAgICAgIGRlbGV0ZSBtUGFpbnRzLml0ZW1BdChpKTsKKyAgICB9CisgICAgbVBhaW50cy5jbGVhcigpOworCisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtTWF0cmljZXMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgZGVsZXRlICBtTWF0cmljZXMuaXRlbUF0KGkpOworICAgIH0KKyAgICBtTWF0cmljZXMuY2xlYXIoKTsKKworICAgIG1QYXRoSGVhcC0+c2FmZVVucmVmKCk7Cit9CisKK3ZvaWQgRGlzcGxheUxpc3Q6OmluaXQoKSB7CisgICAgbVBhdGhIZWFwID0gTlVMTDsKK30KKwordm9pZCBEaXNwbGF5TGlzdDo6cmVwbGF5KE9wZW5HTFJlbmRlcmVyJiByZW5kZXJlcikgeworICAgIFRleHRDb250YWluZXIgdGV4dDsKKyAgICBtUmVhZGVyLnJld2luZCgpOworCisgICAgaW50IHNhdmVDb3VudCA9IHJlbmRlcmVyLmdldFNhdmVDb3VudCgpIC0gMTsKKworICAgIHdoaWxlICghbVJlYWRlci5lb2YoKSkgeworICAgICAgICBpbnQgb3AgPSBtUmVhZGVyLnJlYWRJbnQoKTsKKyAgICAgICAgc3dpdGNoIChvcCkgeworICAgICAgICAgICAgY2FzZSBBY3F1aXJlQ29udGV4dDogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLmFjcXVpcmVDb250ZXh0KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgUmVsZWFzZUNvbnRleHQ6IHsKKyAgICAgICAgICAgICAgICByZW5kZXJlci5yZWxlYXNlQ29udGV4dCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNhdmU6IHsKKyAgICAgICAgICAgICAgICByZW5kZXJlci5zYXZlKGdldEludCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBSZXN0b3JlOiB7CisgICAgICAgICAgICAgICAgcmVuZGVyZXIucmVzdG9yZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFJlc3RvcmVUb0NvdW50OiB7CisgICAgICAgICAgICAgICAgcmVuZGVyZXIucmVzdG9yZVRvQ291bnQoc2F2ZUNvdW50ICsgZ2V0SW50KCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNhdmVMYXllcjogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLnNhdmVMYXllcihnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgZ2V0UGFpbnQoKSwgZ2V0SW50KCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNhdmVMYXllckFscGhhOiB7CisgICAgICAgICAgICAgICAgcmVuZGVyZXIuc2F2ZUxheWVyQWxwaGEoZ2V0RmxvYXQoKSwgZ2V0RmxvYXQoKSwgZ2V0RmxvYXQoKSwgZ2V0RmxvYXQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGdldEludCgpLCBnZXRJbnQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgVHJhbnNsYXRlOiB7CisgICAgICAgICAgICAgICAgcmVuZGVyZXIudHJhbnNsYXRlKGdldEZsb2F0KCksIGdldEZsb2F0KCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFJvdGF0ZTogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLnJvdGF0ZShnZXRGbG9hdCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTY2FsZTogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLnNjYWxlKGdldEZsb2F0KCksIGdldEZsb2F0KCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNldE1hdHJpeDogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLnNldE1hdHJpeChnZXRNYXRyaXgoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQ29uY2F0TWF0cml4OiB7CisgICAgICAgICAgICAgICAgcmVuZGVyZXIuY29uY2F0TWF0cml4KGdldE1hdHJpeCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBDbGlwUmVjdDogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLmNsaXBSZWN0KGdldEZsb2F0KCksIGdldEZsb2F0KCksIGdldEZsb2F0KCksIGdldEZsb2F0KCksCisgICAgICAgICAgICAgICAgICAgICAgICAoU2tSZWdpb246Ok9wKSBnZXRJbnQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRHJhd0JpdG1hcDogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLmRyYXdCaXRtYXAoZ2V0Qml0bWFwKCksIGdldEZsb2F0KCksIGdldEZsb2F0KCksIGdldFBhaW50KCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIERyYXdCaXRtYXBNYXRyaXg6IHsKKyAgICAgICAgICAgICAgICByZW5kZXJlci5kcmF3Qml0bWFwKGdldEJpdG1hcCgpLCBnZXRNYXRyaXgoKSwgZ2V0UGFpbnQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRHJhd0JpdG1hcFJlY3Q6IHsKKyAgICAgICAgICAgICAgICByZW5kZXJlci5kcmF3Qml0bWFwKGdldEJpdG1hcCgpLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgZ2V0RmxvYXQoKSwgZ2V0RmxvYXQoKSwgZ2V0RmxvYXQoKSwgZ2V0RmxvYXQoKSwgZ2V0UGFpbnQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRHJhd1BhdGNoOiB7CisgICAgICAgICAgICAgICAgaW50MzJfdCogeERpdnMgPSBOVUxMOworICAgICAgICAgICAgICAgIGludDMyX3QqIHlEaXZzID0gTlVMTDsKKyAgICAgICAgICAgICAgICB1aW50MzJfdCogY29sb3JzID0gTlVMTDsKKyAgICAgICAgICAgICAgICB1aW50MzJfdCB4RGl2c0NvdW50ID0gMDsKKyAgICAgICAgICAgICAgICB1aW50MzJfdCB5RGl2c0NvdW50ID0gMDsKKyAgICAgICAgICAgICAgICBpbnQ4X3QgbnVtQ29sb3JzID0gMDsKKworICAgICAgICAgICAgICAgIFNrQml0bWFwKiBiaXRtYXAgPSBnZXRCaXRtYXAoKTsKKworICAgICAgICAgICAgICAgIHhEaXZzID0gZ2V0SW50cyh4RGl2c0NvdW50KTsKKyAgICAgICAgICAgICAgICB5RGl2cyA9IGdldEludHMoeURpdnNDb3VudCk7CisgICAgICAgICAgICAgICAgY29sb3JzID0gZ2V0VUludHMobnVtQ29sb3JzKTsKKworICAgICAgICAgICAgICAgIHJlbmRlcmVyLmRyYXdQYXRjaChiaXRtYXAsIHhEaXZzLCB5RGl2cywgY29sb3JzLCB4RGl2c0NvdW50LCB5RGl2c0NvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgbnVtQ29sb3JzLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRQYWludCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBEcmF3Q29sb3I6IHsKKyAgICAgICAgICAgICAgICByZW5kZXJlci5kcmF3Q29sb3IoZ2V0SW50KCksIChTa1hmZXJtb2RlOjpNb2RlKSBnZXRJbnQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRHJhd1JlY3Q6IHsKKyAgICAgICAgICAgICAgICByZW5kZXJlci5kcmF3UmVjdChnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRQYWludCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBEcmF3UGF0aDogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLmRyYXdQYXRoKGdldFBhdGgoKSwgZ2V0UGFpbnQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRHJhd0xpbmVzOiB7CisgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKKyAgICAgICAgICAgICAgICBmbG9hdCogcG9pbnRzID0gZ2V0RmxvYXRzKGNvdW50KTsKKyAgICAgICAgICAgICAgICByZW5kZXJlci5kcmF3TGluZXMocG9pbnRzLCBjb3VudCwgZ2V0UGFpbnQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRHJhd1RleHQ6IHsKKyAgICAgICAgICAgICAgICBnZXRUZXh0KCZ0ZXh0KTsKKyAgICAgICAgICAgICAgICByZW5kZXJlci5kcmF3VGV4dCh0ZXh0LnRleHQoKSwgdGV4dC5sZW5ndGgoKSwgZ2V0SW50KCksCisgICAgICAgICAgICAgICAgICAgICAgICBnZXRGbG9hdCgpLCBnZXRGbG9hdCgpLCBnZXRQYWludCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBSZXNldFNoYWRlcjogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLnJlc2V0U2hhZGVyKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2V0dXBTaGFkZXI6IHsKKyAgICAgICAgICAgICAgICByZW5kZXJlci5zZXR1cFNoYWRlcihnZXRTaGFkZXIoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgUmVzZXRDb2xvckZpbHRlcjogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLnJlc2V0Q29sb3JGaWx0ZXIoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTZXR1cENvbG9yRmlsdGVyOiB7CisgICAgICAgICAgICAgICAgcmVuZGVyZXIuc2V0dXBDb2xvckZpbHRlcihnZXRDb2xvckZpbHRlcigpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBSZXNldFNoYWRvdzogeworICAgICAgICAgICAgICAgIHJlbmRlcmVyLnJlc2V0U2hhZG93KCk7CisgICAgICAgICAgICB9CisgICAg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gICAgICAgIFJlbGVhc2VDb250ZXh0LAorICAgICAgICBTYXZlLAorICAgICAgICBSZXN0b3JlLAorICAgICAgICBSZXN0b3JlVG9Db3VudCwKKyAgICAgICAgU2F2ZUxheWVyLAorICAgICAgICBTYXZlTGF5ZXJBbHBoYSwKKyAgICAgICAgVHJhbnNsYXRlLAorICAgICAgICBSb3RhdGUsCisgICAgICAgIFNjYWxlLAorICAgICAgICBTZXRNYXRyaXgsCisgICAgICAgIENvbmNhdE1hdHJpeCwKKyAgICAgICAgQ2xpcFJlY3QsCisgICAgICAgIERyYXdCaXRtYXAsCisgICAgICAgIERyYXdCaXRtYXBNYXRyaXgsCisgICAgICAgIERyYXdCaXRtYXBSZWN0LAorICAgICAgICBEcmF3UGF0Y2gsCisgICAgICAgIERyYXdDb2xvciwKKyAgICAgICAgRHJhd1JlY3QsCisgICAgICAgIERyYXdQYXRoLAorICAgICAgICBEcmF3TGluZXMsCisgICAgICAgIERyYXdUZXh0LAorICAgICAgICBSZXNldFNoYWRlciwKKyAgICAgICAgU2V0dXBTaGFkZXIsCisgICAgICAgIFJlc2V0Q29sb3JGaWx0ZXIsCisgICAgICAgIFNldHVwQ29sb3JGaWx0ZXIsCisgICAgICAgIFJlc2V0U2hhZG93LAorICAgICAgICBTZXR1cFNoYWRvdworICAgIH07CisKKyAgICB2b2lkIHJlcGxheShPcGVuR0xSZW5kZXJlciYgcmVuZGVyZXIpOworCitwcml2YXRlOgorICAgIHZvaWQgaW5pdCgpOworCisgICAgY2xhc3MgVGV4dENvbnRhaW5lciB7CisgICAgcHVibGljOgorICAgICAgICBzaXplX3QgbGVuZ3RoKCkgY29uc3QgeworICAgICAgICAgICAgcmV0dXJuIG1CeXRlTGVuZ3RoOworICAgICAgICB9CisKKyAgICAgICAgY29uc3QgY2hhciogdGV4dCgpIGNvbnN0IHsKKyAgICAgICAgICAgIHJldHVybiAoY29uc3QgY2hhciopIG1UZXh0OworICAgICAgICB9CisKKyAgICAgICAgc2l6ZV90IG1CeXRlTGVuZ3RoOworICAgICAgICBjb25zdCBjaGFyKiBtVGV4dDsKKyAgICB9OworCisgICAgU2tCaXRtYXAqIGdldEJpdG1hcCgpIHsKKyAgICAgICAgcmV0dXJuIChTa0JpdG1hcCopIGdldEludCgpOworICAgIH0KKworICAgIFNraWFTaGFkZXIqIGdldFNoYWRlcigpIHsKKyAgICAgICAgcmV0dXJuIChTa2lhU2hhZGVyKikgZ2V0SW50KCk7CisgICAgfQorCisgICAgU2tpYUNvbG9yRmlsdGVyKiBnZXRDb2xvckZpbHRlcigpIHsKKyAgICAgICAgcmV0dXJuIChTa2lhQ29sb3JGaWx0ZXIqKSBnZXRJbnQoKTsKKyAgICB9CisKKyAgICBpbmxpbmUgaW50IGdldEluZGV4KCkgeworICAgICAgICByZXR1cm4gbVJlYWRlci5yZWFkSW50KCk7CisgICAgfQorCisgICAgaW5saW5lIGludCBnZXRJbnQoKSB7CisgICAgICAgIHJldHVybiBtUmVhZGVyLnJlYWRJbnQoKTsKKyAgICB9CisKKyAgICBTa01hdHJpeCogZ2V0TWF0cml4KCkgeworICAgICAgICByZXR1cm4gKFNrTWF0cml4KikgZ2V0SW50KCk7CisgICAgfQorCisgICAgU2tQYXRoKiBnZXRQYXRoKCkgeworICAgICAgICByZXR1cm4gJigqbVBhdGhIZWFwKVtnZXRJbnQoKSAtIDFdOworICAgIH0KKworICAgIFNrUGFpbnQqIGdldFBhaW50KCkgeworICAgICAgICByZXR1cm4gKFNrUGFpbnQqKSBnZXRJbnQoKTsKKyAgICB9CisKKyAgICBpbmxpbmUgZmxvYXQgZ2V0RmxvYXQoKSB7CisgICAgICAgIHJldHVybiBtUmVhZGVyLnJlYWRTY2FsYXIoKTsKKyAgICB9CisKKyAgICBpbnQzMl90KiBnZXRJbnRzKHVpbnQzMl90JiBjb3VudCkgeworICAgICAgICBjb3VudCA9IGdldEludCgpOworICAgICAgICByZXR1cm4gKGludDMyX3QqKSBtUmVhZGVyLnNraXAoY291bnQgKiBzaXplb2YoaW50MzJfdCkpOworICAgIH0KKworICAgIHVpbnQzMl90KiBnZXRVSW50cyhpbnQ4X3QmIGNvdW50KSB7CisgICAgICAgIGNvdW50ID0gZ2V0SW50KCk7CisgICAgICAgIHJldHVybiAodWludDMyX3QqKSBtUmVhZGVyLnNraXAoY291bnQgKiBzaXplb2YodWludDMyX3QpKTsKKyAgICB9CisKKyAgICBmbG9hdCogZ2V0RmxvYXRzKGludCYgY291bnQpIHsKKyAgICAgICAgY291bnQgPSBnZXRJbnQoKTsKKyAgICAgICAgcmV0dXJuIChmbG9hdCopIG1SZWFkZXIuc2tpcChjb3VudCAqIHNpemVvZihmbG9hdCkpOworICAgIH0KKworICAgIHZvaWQgZ2V0VGV4dChUZXh0Q29udGFpbmVyKiB0ZXh0KSB7CisgICAgICAgIHNpemVfdCBsZW5ndGggPSB0ZXh0LT5tQnl0ZUxlbmd0aCA9IGdldEludCgpOworICAgICAgICB0ZXh0LT5tVGV4dCA9IChjb25zdCBjaGFyKikgbVJlYWRlci5za2lwKGxlbmd0aCk7CisgICAgfQorCisgICAgUGF0aEhlYXAqIG1QYXRoSGVhcDsKKworICAgIFZlY3RvcjxTa0JpdG1hcCo+IG1CaXRtYXBSZXNvdXJjZXM7CisgICAgVmVjdG9yPFNraWFTaGFkZXIqPiBtU2hhZGVyUmVzb3VyY2VzOworICAgIFZlY3RvcjxTa2lhQ29sb3JGaWx0ZXIqPiBtRmlsdGVyUmVzb3VyY2VzOworCisgICAgVmVjdG9yPFNrUGFpbnQqPiBtUGFpbnRzOworICAgIFZlY3RvcjxTa01hdHJpeCo+IG1NYXRyaWNlczsKKworICAgIG11dGFibGUgU2tGbGF0dGVuYWJsZVJlYWRCdWZmZXIgbVJlYWRlcjsKKworICAgIFNrUmVmQ250UGxheWJhY2sgbVJDUGxheWJhY2s7CisgICAgU2tUeXBlZmFjZVBsYXliYWNrIG1URlBsYXliYWNrOworfTsKKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy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gVmVjdG9yPFNrQml0bWFwKj4mIGdldEJpdG1hcFJlc291cmNlcygpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIG1CaXRtYXBSZXNvdXJjZXM7CisgICAgfQorCisgICAgY29uc3QgVmVjdG9yPFNraWFTaGFkZXIqPiYgZ2V0U2hhZGVyUmVzb3VyY2VzKCkgY29uc3QgeworICAgICAgICByZXR1cm4gbVNoYWRlclJlc291cmNlczsKKyAgICB9CisKKyAgICBjb25zdCBWZWN0b3I8U2tQYWludCo+JiBnZXRQYWludHMoKSBjb25zdCB7CisgICAgICAgIHJldHVybiBtUGFpbnRzOworICAgIH0KKworICAgIGNvbnN0IFZlY3RvcjxTa01hdHJpeCo+JiBnZXRNYXRyaWNlcygpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIG1NYXRyaWNlczsKKyAgICB9CisKKyAgICBjb25zdCBWZWN0b3I8U2tpYUNvbG9yRmlsdGVyKj4mIGdldEZpbHRlclJlc291cmNlcygpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIG1GaWx0ZXJSZXNvdXJjZXM7CisgICAgfQorCitwcml2YXRlOgorICAgIGlubGluZSB2b2lkIGFkZE9wKERpc3BsYXlMaXN0OjpPcCBkcmF3T3ApIHsKKyAgICAgICAgbVdyaXRlci53cml0ZUludChkcmF3T3ApOworICAgIH0KKworICAgIGlubGluZSB2b2lkIGFkZEludChpbnQgdmFsdWUpIHsKKyAgICAgICAgbVdyaXRlci53cml0ZUludCh2YWx1ZSk7CisgICAgfQorCisgICAgdm9pZCBhZGRJbnRzKGNvbnN0IGludDMyX3QqIHZhbHVlcywgdWludDMyX3QgY291bnQpIHsKKyAgICAgICAgbVdyaXRlci53cml0ZUludChjb3VudCk7CisgICAgICAgIGZvciAodWludDMyX3QgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICBtV3JpdGVyLndyaXRlSW50KHZhbHVlc1tpXSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIGFkZFVJbnRzKGNvbnN0IHVpbnQzMl90KiB2YWx1ZXMsIGludDhfdCBjb3VudCkgeworICAgICAgICBtV3JpdGVyLndyaXRlSW50KGNvdW50KTsKKyAgICAgICAgZm9yIChpbnQ4X3QgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICBtV3JpdGVyLndyaXRlSW50KHZhbHVlc1tpXSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpbmxpbmUgdm9pZCBhZGRGbG9hdChmbG9hdCB2YWx1ZSkgeworICAgICAgICBtV3JpdGVyLndyaXRlU2NhbGFyKHZhbHVlKTsKKyAgICB9CisKKyAgICB2b2lkIGFkZEZsb2F0cyhjb25zdCBmbG9hdCogdmFsdWVzLCBpbnQgY291bnQpIHsKKyAgICAgICAgbVdyaXRlci53cml0ZUludChjb3VudCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgbVdyaXRlci53cml0ZVNjYWxhcih2YWx1ZXNbaV0pOworICAgICAgICB9CisgICAgfQorCisgICAgaW5saW5lIHZvaWQgYWRkUG9pbnQoZmxvYXQgeCwgZmxvYXQgeSkgeworICAgICAgICBtV3JpdGVyLndyaXRlU2NhbGFyKHgpOworICAgICAgICBtV3JpdGVyLndyaXRlU2NhbGFyKHkpOworICAgIH0KKworICAgIGlubGluZSB2b2lkIGFkZEJvdW5kcyhmbG9hdCBsZWZ0LCBmbG9hdCB0b3AsIGZsb2F0IHJpZ2h0LCBmbG9hdCBib3R0b20pIHsKKyAgICAgICAgbVdyaXRlci53cml0ZVNjYWxhcihsZWZ0KTsKKyAgICAgICAgbVdyaXRlci53cml0ZVNjYWxhcih0b3ApOworICAgICAgICBtV3JpdGVyLndyaXRlU2NhbGFyKHJpZ2h0KTsKKyAgICAgICAgbVdyaXRlci53cml0ZVNjYWxhcihib3R0b20pOworICAgIH0KKworICAgIGlubGluZSB2b2lkIGFkZFRleHQoY29uc3Qgdm9pZCogdGV4dCwgc2l6ZV90IGJ5dGVMZW5ndGgpIHsKKyAgICAgICAgbVdyaXRlci53cml0ZUludChieXRlTGVuZ3RoKTsKKyAgICAgICAgbVdyaXRlci53cml0ZVBhZCh0ZXh0LCBieXRlTGVuZ3RoKTsKKyAgICB9CisKKyAgICBpbmxpbmUgdm9pZCBhZGRQYXRoKGNvbnN0IFNrUGF0aCogcGF0aCkgeworICAgICAgICBpZiAobVBhdGhIZWFwID09IE5VTEwpIHsKKyAgICAgICAgICAgIG1QYXRoSGVhcCA9IG5ldyBQYXRoSGVhcCgpOworICAgICAgICB9CisgICAgICAgIGFkZEludChtUGF0aEhlYXAtPmFwcGVuZCgqcGF0aCkpOworICAgIH0KKworICAgIGlubGluZSB2b2lkIGFkZFBhaW50KFNrUGFpbnQqIHBhaW50KSB7CisgICAgICAgIGlmIChwYWludCA9PSBOVUxMKSB7CisgICAgICAgICAgICBhZGRJbnQoKGludClOVUxMKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBTa1BhaW50ICpwYWludENvcHkgPSAgbVBhaW50TWFwLnZhbHVlRm9yKHBhaW50KTsKKyAgICAgICAgaWYgKHBhaW50Q29weSA9PSBOVUxMIHx8IHBhaW50Q29weS0+Z2V0R2VuZXJhdGlvbklEKCkgIT0gcGFpbnQtPmdldEdlbmVyYXRpb25JRCgpKSB7CisgICAgICAgICAgICBwYWludENvcHkgPSBuZXcgU2tQYWludCgqcGFpbnQpOworICAgICAgICAgICAgbVBhaW50TWFwLmFkZChwYWludCwgcGFpbnRDb3B5KTsKKyAgICAgICAgICAgIG1QYWludHMuYWRkKHBhaW50Q29weSk7CisgICAgICAgIH0KKyAgICAgICAgYWRkSW50KChpbnQpcGFpbnRDb3B5KTsKKyAgICB9CisKKyAgICBpbmxpbmUgdm9pZCBhZGRNYXRyaXgoU2tNYXRyaXgqIG1hdHJpeCkgeworICAgICAgICAvLyBDb3B5aW5nIHRoZSBtYXRyaXgg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AgICAqIFdoZW4gYW4gRkJPIGlzIG9idGFpbmVkIGZyb20gdGhlIGNhY2hlLCBpdCBpcyByZW1vdmVkIGFuZCB0aGUKKyAgICAgKiB0b3RhbCBudW1iZXIgb2YgRkJPcyBhdmFpbGFibGUgaW4gdGhlIGNhY2hlIGRlY3JlYXNlcy4KKyAgICAgKgorICAgICAqIEByZXR1cm4gVGhlIG5hbWUgb2YgdGhlIEZCTywgb3IgMCBpZiBubyBGQk8gY2FuIGJlIG9idGFpbmVkLgorICAgICAqLworICAgIEdMdWludCBnZXQoKTsKKworICAgIC8qKgorICAgICAqIEFkZHMgdGhlIHNwZWNpZmllZCBGQk8gdG8gdGhlIGNhY2hlLgorICAgICAqCisgICAgICogQHBhcmFtIGZibyBUaGUgRkJPIHRvIGFkZCB0byB0aGUgY2FjaGUuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIFRydWUgaWYgdGhlIEZCTyB3YXMgYWRkZWQsIGZhbHNlIG90aGVyd2lzZS4KKyAgICAgKi8KKyAgICBib29sIHB1dChHTHVpbnQgZmJvKTsKKworICAgIC8qKgorICAgICAqIENsZWFycyB0aGUgY2FjaGUuIFRoaXMgY2F1c2VzIGFsbCBGQk9zIHRvIGJlIGRlbGV0ZWQuCisgICAgICovCisgICAgdm9pZCBjbGVhcigpOworCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCBzaXplIG9mIHRoZSBjYWNoZS4KKyAgICAgKi8KKyAgICB1aW50MzJfdCBnZXRTaXplKCk7CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBtYXhpbXVtIG51bWJlciBvZiBGQk9zIHRoYXQgdGhlIGNhY2hlIGNhbiBob2xkLgorICAgICAqLworICAgIHVpbnQzMl90IGdldE1heFNpemUoKTsKKworcHJpdmF0ZToKKyAgICBTb3J0ZWRWZWN0b3I8R0x1aW50PiBtQ2FjaGU7CisgICAgdWludDMyX3QgbU1heFNpemU7Cit9OyAvLyBjbGFzcyBGYm9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RtYXBIZWlnaHQ7CisKKyAgICBpZiAoYm91bmRzLT5ib3R0b20gPiBuUGVuWSkgeworICAgICAgICBib3VuZHMtPmJvdHRvbSA9IG5QZW5ZOworICAgIH0KKyAgICBpZiAoYm91bmRzLT5sZWZ0ID4gblBlblgpIHsKKyAgICAgICAgYm91bmRzLT5sZWZ0ID0gblBlblg7CisgICAgfQorICAgIGlmIChib3VuZHMtPnJpZ2h0IDwgblBlblggKyB3aWR0aCkgeworICAgICAgICBib3VuZHMtPnJpZ2h0ID0gblBlblggKyB3aWR0aDsKKyAgICB9CisgICAgaWYgKGJvdW5kcy0+dG9wIDwgblBlblkgKyBoZWlnaHQpIHsKKyAgICAgICAgYm91bmRzLT50b3AgPSBuUGVuWSArIGhlaWdodDsKKyAgICB9Cit9CisKK3ZvaWQgRm9udDo6ZHJhd0NhY2hlZEdseXBoKENhY2hlZEdseXBoSW5mbyogZ2x5cGgsIGludCB4LCBpbnQgeSkgeworICAgIGludCBuUGVuWCA9IHggKyBnbHlwaC0+bUJpdG1hcExlZnQ7CisgICAgaW50IG5QZW5ZID0geSArIGdseXBoLT5tQml0bWFwVG9wICsgZ2x5cGgtPm1CaXRtYXBIZWlnaHQ7CisKKyAgICBmbG9hdCB1MSA9IGdseXBoLT5tQml0bWFwTWluVTsKKyAgICBmbG9hdCB1MiA9IGdseXBoLT5tQml0bWFwTWF4VTsKKyAgICBmbG9hdCB2MSA9IGdseXBoLT5tQml0bWFwTWluVjsKKyAgICBmbG9hdCB2MiA9IGdseXBoLT5tQml0bWFwTWF4VjsKKworICAgIGludCB3aWR0aCA9IChpbnQpIGdseXBoLT5tQml0bWFwV2lkdGg7CisgICAgaW50IGhlaWdodCA9IChpbnQpIGdseXBoLT5tQml0bWFwSGVpZ2h0OworCisgICAgbVN0YXRlLT5hcHBlbmRNZXNoUXVhZChuUGVuWCwgblBlblksIDAsIHUxLCB2MiwKKyAgICAgICAgICAgIG5QZW5YICsgd2lkdGgsIG5QZW5ZLCAwLCB1M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8IGJYID49IChpbnQzMl90KSBiaXRtYXBXIHx8IGJZID49IChpbnQzMl90KSBiaXRtYXBIKSB7CisgICAgICAgICAgICAgICAgTE9HRSgiU2tpcHBpbmcgaW52YWxpZCBpbmRleCIpOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdWludDhfdCB0ZW1wQ29sID0gY2FjaGVCdWZmZXJbY2FjaGVZICogY2FjaGVXaWR0aCArIGNhY2hlWF07CisgICAgICAgICAgICBiaXRtYXBbYlkgKiBiaXRtYXBXICsgYlhdID0gdGVtcENvbDsKKyAgICAgICAgfQorICAgIH0KKworfQorCitGb250OjpDYWNoZWRHbHlwaEluZm8qIEZvbnQ6OmdldENhY2hlZFVURkNoYXIoU2tQYWludCogcGFpbnQsIGludDMyX3QgdXRmQ2hhcikgeworICAgIENhY2hlZEdseXBoSW5mbyogY2FjaGVkR2x5cGggPSBOVUxMOworICAgIHNzaXplX3QgaW5kZXggPSBtQ2FjaGVkR2x5cGhzLmluZGV4T2ZLZXkodXRmQ2hhcik7CisgICAgaWYgKGluZGV4ID49IDApIHsKKyAgICAgICAgY2FjaGVkR2x5cGggPSBtQ2FjaGVkR2x5cGhzLnZhbHVlQXQoaW5kZXgpOworICAgIH0gZWxzZSB7CisgICAgICAgIGNhY2hlZEdseXBoID0gY2FjaGVHbHlwaChwYWludCwgdXRmQ2hhcik7CisgICAgfQorCisgICAgLy8gSXMgdGhlIGdseXBoIHN0aWxsIGluIHRleHR1cmUgY2FjaGU/CisgICAgaWYgKCFjYWNoZWRHbHlwaC0+bUlzVmFsaWQpIHsKKyAgICAgICAgY29uc3QgU2tHbHlwaCYgc2tpYUdseXBoID0gcGFpbnQtPmdldFVuaWNoYXJNZXRyaWNzKHV0ZkNoYXIpOworICAgICAgICB1cGRhdGVHbHlwaENhY2hlKHBhaW50LCBza2lhR2x5cGgsIGNhY2hlZEdseXBoKTsKKyAgICB9CisKKyAgICByZXR1cm4gY2FjaGV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VTEwsIDAsIDAsIGJvdW5kcyk7Cit9CisKKyNkZWZpbmUgU2tBdXRvS2Vybl9BZGp1c3RGKHByZXYsIG5leHQpICgoKG5leHQpIC0gKHByZXYpICsgMzIpID4+IDYgPDwgMTYpCisKK3ZvaWQgRm9udDo6cmVuZGVyVVRGKFNrUGFpbnQqIHBhaW50LCBjb25zdCBjaGFyKiB0ZXh0LCB1aW50MzJfdCBzdGFydCwgdWludDMyX3QgbGVuLAorICAgICAgICBpbnQgbnVtR2x5cGhzLCBpbnQgeCwgaW50IHksIFJlbmRlck1vZGUgbW9kZSwgdWludDhfdCAqYml0bWFwLAorICAgICAgICB1aW50MzJfdCBiaXRtYXBXLCB1aW50MzJfdCBiaXRtYXBILFJlY3QgKmJvdW5kcykgeworICAgIGlmIChudW1HbHlwaHMgPT0gMCB8fCB0ZXh0ID09IE5VTEwgfHwgbGVuID09IDApIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIFNrRml4ZWQgcGVuWCA9IFNrSW50VG9GaXhlZCh4KTsKKyAgICBpbnQgcGVuWSA9IHk7CisgICAgaW50IGdseXBoc0xlZnQgPSAxOworICAgIGlmIChudW1HbHlwaHMgPiAwKSB7CisgICAgICAgIGdseXBoc0xlZnQgPSBudW1HbHlwaHM7CisgICAgfQorCisgICAgU2tGaXhlZCBwcmV2UnNiRGVsdGEgPSAwOworICAgIHBlblggKz0gU0tfRml4ZWQxIC8gMjsKKworICAgIHRleHQgKz0gc3RhcnQ7CisKKyAgICB3aGlsZSAoZ2x5cGhzTGVmdCA+IDApIHsKKyAgICAgICAgaW50MzJfdCB1dGZDaGFyID0gU2tVVEYxNl9OZXh0VW5pY2hhcigoY29uc3QgdWludDE2X3QqKikgJnRleHQpOworCisgICAgICAgIC8vIFJlYWNoZWQgdGhlIGVuZCBvZiB0aGUgc3RyaW5nCisgICAgICAgIGlmICh1dGZDaGFyIDwgMCkgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBDYWNoZWRHbHlwaEluZm8qIGNhY2hlZEdseXBoID0gZ2V0Q2FjaGVkVVRGQ2hhcihwYWludCwgdXRmQ2hhcik7CisgICAgICAgIHBlblggKz0gU2tBdXRvS2Vybl9BZGp1c3RGKHByZXZSc2JEZWx0YSwgY2FjaGVkR2x5cGgtPm1Mc2JEZWx0YSk7CisgICAgICAgIHByZXZSc2JEZWx0YSA9IGNhY2hlZEdseXBoLT5tUnNiRGVsdGE7CisKKyAgICAgICAgLy8gSWYgaXQncyBzdGlsbCBub3QgdmFsaWQsIHdlIGNvdWxkbid0IGNhY2hlIGl0LCBzbyB3ZSBzaG91bGRuJ3QgZHJhdyBnYXJiYWdlCisgICAgICAgIGlmIChjYWNoZWRHbHlwaC0+bUlzVmFsaWQpIHsKKyAgICAgICAgICAgIHN3aXRjaChtb2RlKSB7CisgICAgICAgICAgICBjYXNlIEZSQU1FQlVGRkVSOgorICAgICAgICAgICAgICAgIGRyYXdDYWNoZWRHbHlwaChjYWNoZWRHbHlwaCwgU2tGaXhlZEZsb29yKHBlblgpLCBwZW5ZKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQklUTUFQOgorICAgICAgICAgICAgICAgIGRyYXdDYWNoZWRHbHlwaChjYWNoZWRHbHlwaCwgU2tGaXhlZEZsb29yKHBlblgpLCBwZW5ZLCBiaXRtYXAsIGJpdG1hcFcsIGJpdG1hcEgpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNRUFTVVJFOgorICAgICAgICAgICAgICAgIG1lYXN1cmVDYWNoZWRHbHlwaChjYWNoZWRHbHlwaCwgU2tGaXhlZEZsb29yKHBlblgpLCBwZW5ZLCBib3VuZHMpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcGVuWCArPSBjYWNoZWRHbHlwaC0+bUFkdmFuY2VYOworCisgICAgICAgIC8vIElmIHdlIHdlcm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RvaShwcm9wZXJ0eSk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgTE9HRCgiICBVc2luZyBkZWZhdWx0IHRleHQgY2FjaGUgaGVpZ2h0IG9mICVpIHBpeGVscyIsIG1DYWNoZUhlaWdodCk7CisgICAgfQorfQorCitGb250UmVuZGVyZXI6On5Gb250UmVuZGVyZXIoKSB7CisgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IG1DYWNoZUxpbmVzLnNpemUoKTsgaSsrKSB7CisgICAgICAgIGRlbGV0ZSBtQ2FjaGVMaW5lc1tpXTsKKyAgICB9CisgICAgbUNhY2hlTGluZXMuY2xlYXIoKTsKKworICAgIGlmIChtSW5pdGlhbGl6ZWQpIHsKKyAgICAgICAgZGVsZXRlW10gbVRleHRNZXNoUHRyOworICAgICAgICBkZWxldGVbXSBtVGV4dFRleHR1cmU7CisgICAgfQorCisgICAgaWYgKG1UZXh0dXJlSWQpIHsKKyAgICAgICAgZ2xEZWxldGVUZXh0dXJlcygxLCAmbVRleHR1cmVJZCk7CisgICAgfQorCisgICAgVmVjdG9yPEZvbnQqPiBmb250c1RvRGVyZWZlcmVuY2UgPSBtQWN0aXZlRm9udHM7CisgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IGZvbnRzVG9EZXJlZmVyZW5jZS5zaXplKCk7IGkrKykgeworICAgICAgICBkZWxldGUgZm9udHNUb0RlcmVmZXJlbmNlW2ldOworICAgIH0KK30KKwordm9pZCBGb250UmVuZGVyZXI6OmZsdXNoQWxsQW5kSW52YWxpZGF0ZSgpIHsKKyAgICBpZiAobUN1cnJlbnRRdWFkSW5kZXggIT0gMCkgeworICAgICAgICBpc3N1ZURyYXdDb21tYW5kKCk7CisgICAgICAgIG1DdXJyZW50UXVhZEluZGV4ID0gMDsKKyAgICB9CisgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IG1BY3RpdmVGb250cy5zaXplKCk7IGkrKykgeworICAgICAgICBtQWN0aXZlRm9udHNbaV0tPm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AgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBJZiB0aGUgbmV3IGdseXBoIGRpZG4ndCBmaXQsIGZsdXNoIHRoZSBzdGF0ZSBzbyBmYXIgYW5kIGludmFsaWRhdGUgZXZlcnl0aGluZworICAgIGlmICghYml0bWFwRml0KSB7CisgICAgICAgIGZsdXNoQWxsQW5kSW52YWxpZGF0ZSgpOworCisgICAgICAgIC8vIFRyeSB0byBmaXQgaXQgYWdhaW4KKyAgICAgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IG1DYWNoZUxpbmVzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICBiaXRtYXBGaXQgPSBtQ2FjaGVMaW5lc1tpXS0+Zml0Qml0bWFwKGdseXBoLCAmc3RhcnRYLCAmc3RhcnRZKTsKKyAgICAgICAgICAgIGlmIChiaXRtYXBGaXQpIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIGlmIHdlIHN0aWxsIGRvbid0IGZpdCwgc29tZXRoaW5nIGlzIHdyb25nIGFuZCB3ZSBzaG91bGRuJ3QgZHJhdworICAgICAgICBpZiAoIWJpdG1hcEZpdCkgeworICAgICAgICAgICAgTE9HRSgiQml0bWFwIGRvZXNuJ3QgZml0IGluIGNhY2hlLiB3aWR0aCwgaGVpZ2h0ID0gJWksICVpIiwKKyAgICAgICAgICAgICAgICAgICAgKGludCkgZ2x5cGguZldpZHRoLCAoaW50KSBnbHlwaC5mSGVpZ2h0KTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgICpyZXRPcmlnaW5YID0gc3RhcnRYOworICAgICpyZXRPcmlnaW5ZID0gc3RhcnRZOworCisgICAgdWludDMyX3QgZW5kWCA9IHN0YXJ0WCArIGdseXBoLmZXaWR0aDsKKyAgICB1aW50MzJfdCBlbmRZID0gc3RhcnRZICsgZ2x5cGguZkhl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wgbUNsaXAtPmxlZnQgfHwgeTQgPiBtQ2xpcC0+Ym90dG9tKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBjb25zdCB1aW50MzJfdCB2ZXJ0c1BlclF1YWQgPSA0OworICAgIGNvbnN0IHVpbnQzMl90IGZsb2F0c1BlclZlcnQgPSA1OworICAgIGZsb2F0KiBjdXJyZW50UG9zID0gbVRleHRNZXNoUHRyICsgbUN1cnJlbnRRdWFkSW5kZXggKiB2ZXJ0c1BlclF1YWQgKiBmbG9hdHNQZXJWZXJ0OworCisgICAgKCpjdXJyZW50UG9zKyspID0geDE7CisgICAgKCpjdXJyZW50UG9zKyspID0geTE7CisgICAgKCpjdXJyZW50UG9zKyspID0gejE7CisgICAgKCpjdXJyZW50UG9zKyspID0gdTE7CisgICAgKCpjdXJyZW50UG9zKyspID0gdjE7CisKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB4MjsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB5MjsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB6MjsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB1MjsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB2MjsKKworICAgICgqY3VycmVudFBvcysrKSA9IHgzOworICAgICgqY3VycmVudFBvcysrKSA9IHkzOworICAgICgqY3VycmVudFBvcysrKSA9IHozOworICAgICgqY3VycmVudFBvcysrKSA9IHUzOworICAgICgqY3VycmVudFBvcysrKSA9IHYzOworCisgICAgKCpjdXJyZW50UG9zKyspID0geDQ7CisgICAgKCpjdXJyZW50UG9zKyspID0geTQ7CisgICAgKCpjdXJyZW50UG9zKyspID0gejQ7CisgICAgKCpjdXJyZW50UG9zKyspID0gdTQ7CisgICAgKCpjdXJyZW50UG9zKyspID0gdjQ7CisKKyAgICBtQ3VycmVudFF1YWRJbmRleCsrOworCisgICAgaWYgKG1Cb3VuZHMpIHsKKyAgICAgICAgbUJvdW5kcy0+bGVmdCA9IGZtaW4obUJvdW5kc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IHJlbWFpbmluZ0NhcGFjaXR5ID0gZ2V0UmVtYWluaW5nQ2FjaGVDYXBhY2l0eSgpOworICAgIHVpbnQzMl90IHByZWNhY2hlSWR4ID0gMDsKKyAgICB3aGlsZSAocmVtYWluaW5nQ2FwYWNpdHkgPiAyNSAmJiBwcmVjYWNoZUlkeCA8IG1MYXRpblByZWNhY2hlLnNpemUoKSkgeworICAgICAgICBtQ3VycmVudEZvbnQtPmdldENhY2hlZFVURkNoYXIocGFpbnQsIChpbnQzMl90KSBtTGF0aW5QcmVjYWNoZVtwcmVjYWNoZUlkeF0pOworICAgICAgICByZW1haW5pbmdDYXBhY2l0eSA9IGdldFJlbWFpbmluZ0NhY2hlQ2FwYWNpdHkoKTsKKyAgICAgICAgcHJlY2FjaGVJZHggKys7CisgICAgfQorfQorCit2b2lkIEZvbnRSZW5kZXJlcjo6c2V0Rm9udChTa1BhaW50KiBwYWludCwgdWludDMyX3QgZm9udElkLCBmbG9hdCBmb250U2l6ZSkgeworICAgIHVpbnQzMl90IGN1cnJlbnROdW1Gb250cyA9IG1BY3RpdmVGb250cy5zaXplKCk7CisgICAgbUN1cnJlbnRGb250ID0gRm9udDo6Y3JlYXRlKHRoaXMsIGZvbnRJZCwgZm9udFNpemUpOworCisgICAgY29uc3QgZmxvYXQgbWF4UHJlY2FjaGVGb250U2l6ZSA9IDQwLjBmOworICAgIGJvb2wgaXNOZXdGb250ID0gY3VycmVudE51bUZvbnRzICE9IG1BY3RpdmVGb250cy5zaXplKCk7CisKKyAgICBpZiAoaXNOZXdGb250ICYmIGZvbnRTaXplIDw9IG1heFByZWNhY2hlRm9udFNpemUpIHsKKyAgICAgICAgcHJlY2FjaGVMYXRpbihwYWludCk7CisgICAgfQorfQorCitGb250UmVuZGVyZXI6OkRyb3BTaGFkb3cgRm9udFJlbmRlcmVyOjpyZW5kZXJEcm9wU2hhZG93KFNrUGFpbnQqIHBhaW50LCBjb25zdCBjaGFyICp0ZXh0LAorICAgICAgICB1aW50MzJfdCBzdGFydEluZGV4LCB1aW50MzJfdCBsZW4sIGludCBudW1HbHlwaHMsIHVpbnQzMl90IHJhZGl1cykgeworICAgIGNoZWNrSW5pdCgpOworCisgICAgaWYgKCFtQ3VycmVudEZvbnQpIHsKKyAgICAgICAgRHJvcFNoYWRvdyBpbWFnZTsKKyAgICAgICAgaW1hZ2Uud2lkdGggPSAwOworICAgICAgICBpbWFnZS5oZWlnaHQgPSAwOworICAgICAgICBpbWFnZS5pbWFnZSA9IE5VTEw7CisgICAgICAgIGltYWdlLnBlblggPSAwOworICAgICAgICBpbWFnZS5wZW5ZID0gMDsKKyAgICAgICAgcmV0dXJuIGltYWdlOworICAgIH0KKworICAgIFJlY3QgYm91bmRzOworICAgIG1DdXJyZW50Rm9udC0+bWVhc3VyZVVURihwYWludCwgdGV4dCwgc3RhcnRJbmRleCwgbGVuLCBudW1HbHlwaHMsICZib3VuZHMpOworICAgIHVpbnQzMl90IHBhZGRlZFdpZHRoID0gKHVpbnQzMl90KSAoYm91bmRzLnJpZ2h0IC0gYm91bmRzLmxlZnQpICsgMiAqIHJhZGl1czsKKyAgICB1aW50MzJfdCBwYWRkZWRIZWlnaHQgPSAodWludDMyX3QpIChib3VuZHMudG9wIC0gYm91bmRzLmJvdHRvbSkgKyAyICogcmFkaXVzOworICAgIHVpbnQ4X3QqIGRhdGFCdWZmZXIgPSBuZXcgdWludDhfdFtwYWRkZWRXaWR0aCAqIHBhZGRlZEhlaWdodF07CisgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IHBhZGRlZFdpZHRoICogcGFkZGVkSGVpZ2h0OyBpKyspIHsKKyAgICAgICAgZGF0YUJ1ZmZlcltpXSA9IDA7CisgICAgfQorCisgICAgaW50IHBlblggPSByYWRpdXMgLSBib3VuZHMubGVmdDsKKyAgICBpbnQgcGVuWSA9IHJhZGl1cyAtIGJvdW5kcy5ib3R0b207CisKKyAgICBtQ3VycmVudEZvbnQtPnJlbmRlclVURihwYWludCwgdGV4dCwgc3RhcnRJbmRleCwgbGVuLCBudW1HbHlwaHMsIHBlblgsIHBlblksCisgICAgICAgICAgICBkYXRhQnVmZmVyLCBwYWRkZWRXaWR0aCwgcGFkZGVkSGVpZ2h0KTsKKyAgICBibHVySW1hZ2UoZGF0YUJ1ZmZlciwgcGFkZGVkV2lkdGgsIHBhZGRlZEhlaWdodCwgcmFkaXVzKTsKKworICAgIERyb3BTaGFkb3cgaW1hZ2U7CisgICAgaW1hZ2Uud2lkdGggPSBwYWRkZWRXaWR0aDsKKyAgICBpbWFnZS5oZWlnaHQgPSBwYWRkZWRIZWlnaHQ7CisgICAgaW1hZ2UuaW1hZ2UgPSBkYXRhQnVmZmVyOworICAgIGltYWdlLnBlblggPSBwZW5YOworICAgIGltYWdlLnBlblkgPSBwZW5ZOworICAgIHJldHVybiBpbWFnZTsKK30KKworYm9vbCBGb250UmVuZGVyZXI6OnJlbmRlclRleHQoU2tQYWludCogcGFpbnQsIGNvbnN0IFJlY3QqIGNsaXAsIGNvbnN0IGNoYXIgKnRleHQsCisgICAgICAgIHVpbnQzMl90IHN0YXJ0SW5kZXgsIHVpbnQzMl90IGxlbiwgaW50IG51bUdseXBocywgaW50IHgsIGludCB5LCBSZWN0KiBib3VuZHMpIHsKKyAgICBjaGVja0luaXQoKTsKKworICAgIGlmICghbUN1cnJlbnRGb250KSB7CisgICAgICAgIExPR0UoIk5vIGZvbnQgc2V0Iik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBtRHJhd24gPSBmYWxzZTsKKyAgICBtQm91bmRzID0gYm91bmRzOworICAgIG1DbGlwID0gY2xpcDsKKyAgICBtQ3VycmVudEZvbnQtPnJlbmRlclVURihwYWludCwgdGV4dCwgc3RhcnRJbmRleCwgbGVuLCBudW1HbHlwaHMsIHgsIHkpOworICAgIG1Cb3VuZHMgPSBOVUxMOworCisgICAgaWYgKG1DdXJyZW50UXVhZEluZGV4ICE9IDApIHsKKyAgICAgICAgaXNzdWVEcmF3Q29tbW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dodHMsIGludDMyX3QgcmFkaXVzLAorICAgICAgICBjb25zdCB1aW50OF90KiBzb3VyY2UsIHVpbnQ4X3QqIGRlc3QsIGludDMyX3Qgd2lkdGgsIGludDMyX3QgaGVpZ2h0KSB7CisgICAgZmxvYXQgYmx1cnJlZFBpeGVsID0gMC4wZjsKKyAgICBmbG9hdCBjdXJyZW50UGl4ZWwgPSAwLjBmOworCisgICAgZm9yKGludDMyX3QgeSA9IDA7IHkgPCBoZWlnaHQ7IHkgKyspIHsKKworICAgICAgICBjb25zdCB1aW50OF90KiBpbnB1dCA9IHNvdXJjZSArIHkgKiB3aWR0aDsKKyAgICAgICAgdWludDhfdCogb3V0cHV0ID0gZGVzdCArIHkgKiB3aWR0aDsKKworICAgICAgICBmb3IoaW50MzJfdCB4ID0gMDsgeCA8IHdpZHRoOyB4ICsrKSB7CisgICAgICAgICAgICBibHVycmVkUGl4ZWwgPSAwLjBmOworICAgICAgICAgICAgY29uc3QgZmxvYXQqIGdQdHIgPSB3ZWlnaHRzOworICAgICAgICAgICAgLy8gT3B0aW1pemF0aW9uIGZvciBub24tYm9yZGVyIHBpeGVscworICAgICAgICAgICAgaWYgKCh4ID4gcmFkaXVzKSAmJiAoeCA8ICh3aWR0aCAtIHJhZGl1cykpKSB7CisgICAgICAgICAgICAgICAgY29uc3QgdWludDhfdCAqaSA9IGlucHV0ICsgKHggLSByYWRpdXMpOworICAgICAgICAgICAgICAgIGZvcihpbnQgciA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQaXhlbCA9IChmbG9hdCkgKCppKTsKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsICs9IGN1cnJlbnRQaXhlbCAqIGdQdHJbMF07CisgICAgICAgICAgICAgICAgICAgIGdQdHIrKzsKKyAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZm9yKGludDMyX3QgciA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFN0ZXBwaW5nIGxlZnQgYW5kIHJpZ2h0IGF3YXkgZnJvbSB0aGUgcGl4ZWwKKyAgICAgICAgICAgICAgICAgICAgaW50IHZhbGlkVyA9IHggKyByOworICAgICAgICAgICAgICAgICAgICBpZih2YWxpZFcgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZFcgPSAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKHZhbGlkVyA+IHdpZHRoIC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRXID0gd2lkdGggLSAxOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudFBpeGVsID0gKGZsb2F0KShpbnB1dFt2YWxpZFddKTsKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsICs9IGN1cnJlbnRQaXhlbCAqIGdQdHJbMF07CisgICAgICAgICAgICAgICAgICAgIGdQdHIrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAqb3V0cHV0ID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsOworICAgICAgICAgICAgb3V0cHV0ICsrOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkIEZvbnRSZW5kZXJlcjo6dmVydGljYWxCbHVyKGZsb2F0KiB3ZWlnaHRzLCBpbnQzMl90IHJhZGl1cywKKyAgICAgICAgY29uc3QgdWludDhfdCogc291cmNlLCB1aW50OF90KiBkZXN0LCBpbnQzMl90IHdpZHRoLCBpbnQzMl90IGhlaWdodCkgeworICAgIGZsb2F0IGJsdXJyZWRQaXhlbCA9IDAuMGY7CisgICAgZmxvYXQgY3VycmVudFBpeGVsID0gMC4wZjsKKworICAgIGZvcihpbnQzMl90IHkgPSAwOyB5IDwgaGVpZ2h0OyB5ICsrKSB7CisKKyAgICAgICAgdWludDhfdCogb3V0cHV0ID0gZGVzdCArIHkgKiB3aWR0aDsKKworICAgICAgICBmb3IoaW50MzJfdCB4ID0gMDsgeCA8IHdpZHRoOyB4ICsrKSB7CisgICAgICAgICAgICBibHVycmVkUGl4ZWwgPSAwLjBmOworICAgICAgICAgICAgY29uc3QgZmxvYXQqIGdQdHIgPSB3ZWlnaHRzOworICAgICAgICAgICAgY29uc3QgdWludDhfdCogaW5wdXQgPSBzb3VyY2UgKyB4OworICAgICAgICAgICAgLy8gT3B0aW1pemF0aW9uIGZvciBub24tYm9yZGVyIHBpeGVscworICAgICAgICAgICAgaWYgKCh5ID4gcmFkaXVzKSAmJiAoeSA8IChoZWlnaHQgLSByYWRpdXMpKSkgeworICAgICAgICAgICAgICAgIGNvbnN0IHVpbnQ4X3QgKmkgPSBpbnB1dCArICgoeSAtIHJhZGl1cykgKiB3aWR0aCk7CisgICAgICAgICAgICAgICAgZm9yKGludDMyX3QgciA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQaXhlbCA9IChmbG9hdCkoKmkpOworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWwgKz0gY3VycmVudFBpeGVsICogZ1B0clswXTsKKyAgICAgICAgICAgICAgICAgICAgZ1B0cisrOworICAgICAgICAgICAgICAgICAgICBpICs9IHdpZHRoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZm9yKGludDMyX3QgciA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICAgICAgICAgIGludCB2YWxpZEggPSB5ICsgcjsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ2xhbXAgdG8gemVybyBhbmQgd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgaWYodmFsaWRIIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRIID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZih2YWxpZEggPiBoZWlnaHQgLSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZEggPSBoZWlnaHQgLSAxOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgY29uc3QgdWludDhfdCAqaSA9IGlucHV0ICsgdmFsaWRIICogd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQaXhlbCA9IChmbG9hdCkoKmkpOworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWwgKz0gY3VycmVudFBpeGVsICogZ1B0clswXTsKKyAgICAgICAgICAgICAgICAgICAgZ1B0cisrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICpvdXRwdXQgPSAodWludDhfdClibHVycmVkUGl4ZWw7CisgICAgICAgICAgICBvdXRwdXQgKys7CisgICAgICAgIH0KKyAgICB9Cit9CisKKwordm9pZCBGb250UmVuZGVyZXI6OmJsdXJJbWFnZSh1aW50OF90ICppbWFnZSwgaW50MzJfdCB3aWR0aCwgaW50MzJfdCBoZWlnaHQsIGludDMyX3QgcmFkaXVzKSB7CisgICAgZmxvYXQgKmdhdXNzaWFuID0gbmV3IGZsb2F0WzIgKiByYWRpdXMgKyAxXTsKKyAgICBjb21wdXRlR2F1c3NpYW5XZWlnaHRzKGdhdXNzaWFuLCByYWRpdXMpOworICAgIHVpbnQ4X3QqIHNjcmF0Y2ggPSBuZXcgdWludDhfdFt3aWR0aCAqIGhlaWdodF07CisgICAgaG9yaXpvbnRhbEJsdXIoZ2F1c3NpYW4sIHJhZGl1cywgaW1hZ2UsIHNjcmF0Y2gsIHdpZHRoLCBoZWlnaHQpOworICAgIHZlcnRpY2FsQmx1cihnYXVzc2lhbiwgcmFkaXVzLCBzY3JhdGNoLCBpb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lIHJlbmRlciB0YXJnZXQKKyAgICAgKi8KKyAgICB2b2lkIHJlbmRlclVURihTa1BhaW50KiBwYWludCwgY29uc3QgY2hhciAqdGV4dCwgdWludDMyX3Qgc3RhcnQsIHVpbnQzMl90IGxlbiwKKyAgICAgICAgICAgICAgICAgICAgIGludCBudW1HbHlwaHMsIGludCB4LCBpbnQgeSwKKyAgICAgICAgICAgICAgICAgICAgIHVpbnQ4X3QgKmJpdG1hcCA9IE5VTEwsIHVpbnQzMl90IGJpdG1hcFcgPSAwLCB1aW50MzJfdCBiaXRtYXBIID0gMCk7CisgICAgLyoqCisgICAgICogQ3JlYXRlcyBhIG5ldyBmb250IGFzc29jaWF0ZWQgd2l0aCB0aGUgc3BlY2lmaWVkIGZvbnQgc3RhdGUuCisgICAgICovCisgICAgc3RhdGljIEZvbnQqIGNyZWF0ZShGb250UmVuZGVyZXIqIHN0YXRlLCB1aW50MzJfdCBmb250SWQsIGZsb2F0IGZvbnRTaXplKTsKKworcHJvdGVjdGVkOgorICAgIGZyaWVuZCBjbGFzcyBGb250UmVuZGVyZXI7CisKKyAgICBlbnVtIFJlbmRlck1vZGUgeworICAgICAgICBGUkFNRUJVRkZFUiwKKyAgICAgICAgQklUTUFQLAorICAgICAgICBNRUFTVVJFLAorICAgIH07CisKKyAgICB2b2lkIHJlbmRlclVURihTa1BhaW50KiBwYWludCwgY29uc3QgY2hhciAqdGV4dCwgdWludDMyX3Qgc3RhcnQsIHVpbnQzMl90IGxlbiwKKyAgICAgICAgICAgICAgICAgICAgIGludCBudW1HbHlwaHMsIGludCB4LCBpbnQgeSwgUmVuZGVyTW9kZSBtb2RlLAorICAgICAgICAgICAgICAgICAgICAgdWludDhfdCAqYml0bWFwLCB1aW50MzJfdCBiaXRtYXBXLCB1aW50MzJfdCBiaXRtYXBILAorICAgICAgICAgICAgICAgICAgICAgUmVjdCAqYm91bmRzKTsKKworICAgIHZvaWQgbWVhc3VyZVVURihTa1BhaW50KiBwYWludCwgY29uc3QgY2hhciogdGV4dCwgdWludDMyX3Qgc3RhcnQsIHVpbnQzMl90IGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICBpbnQgbnVtR2x5cGhzLCBSZWN0ICpib3VuZHMpOworCisgICAgc3RydWN0IENhY2hlZEdseXBoSW5mbyB7CisgICAgICAgIC8vIEhhcyB0aGUgY2FjaGUgYmVlbiBpbnZhbGlkYXRlZD8KKyAgICAgICAgYm9vbCBtSXNWYWxpZDsKKyAgICAgICAgLy8gTG9jYXRpb24gb2YgdGhlIGNhY2hlZCBnbHlwaCBpbiB0aGUgYml0bWFwCisgICAgICAgIC8vIGluIGNhc2Ugd2UgbmVlZCB0byByZXNpemUgdGhlIHRleHR1cmUgb3IKKyAgICAgICAgLy8gcmVuZGVyIHRvIGJpdG1hcAorICAgICAgICB1aW50MzJfdCBtU3RhcnRYOworICAgICAgICB1aW50MzJfdCBtU3RhcnRZOworICAgICAgICB1aW50MzJfdCBtQml0bWFwV2lkdGg7CisgICAgICAgIHVpbnQzMl90IG1CaXRtYXBIZWlnaHQ7CisgICAgICAgIC8vIEFsc28gY2FjaGUgdGV4dHVyZSBjb29yZHMgZm9yIHRoZSBxdWFkCisgICAgICAgIGZsb2F0IG1CaXRtYXBNaW5VOworICAgICAgICBmbG9hdCBtQml0bWFwTWluVjsKKyAgICAgICAgZmxvYXQgbUJpdG1hcE1heFU7CisgICAgICAgIGZsb2F0IG1CaXRtYXBNYXhWOworICAgICAgICAvLyBNaW5pbWl6ZSBob3cgbXVjaCB3ZSBjYWxsIGZyZWV0eXBlCisgICAgICAgIHVpbnQzMl90IG1HbHlwaEluZGV4OworICAgICAgICB1aW50MzJfdCBtQWR2YW5jZVg7CisgICAgICAgIHVpbnQzMl90IG1BZHZhbmNlWTsKKyAgICAgICAgLy8gVmFsdWVzIGJlbG93IGNvbnRhaW4gYSBnbHlwaCdzIG9yaWdpbiBpbiB0aGUgYml0bWFwCisgICAgICAgIGludDMyX3QgbUJpdG1hcExlZnQ7CisgICAgICAg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yAgICB1aW50MzJfdCBtRm9udElkOworICAgIGZsb2F0IG1Gb250U2l6ZTsKK307CisKK2NsYXNzIEZvbnRSZW5kZXJlciB7CitwdWJsaWM6CisgICAgRm9udFJlbmRlcmVyKCk7CisgICAgfkZvbnRSZW5kZXJlcigpOworCisgICAgdm9pZCBpbml0KCk7CisgICAgdm9pZCBkZWluaXQoKTsKKworICAgIHZvaWQgc2V0R2FtbWFUYWJsZShjb25zdCB1aW50OF90KiBnYW1tYVRhYmxlKSB7CisgICAgICAgIG1HYW1tYVRhYmxlID0gZ2FtbWFUYWJsZTsKKyAgICB9CisKKyAgICB2b2lkIHNldEZvbnQoU2tQYWludCogcGFpbnQsIHVpbnQzMl90IGZvbnRJZCwgZmxvYXQgZm9udFNpemUpOworICAgIGJvb2wgcmVuZGVyVGV4dChTa1BhaW50KiBwYWludCwgY29uc3QgUmVjdCogY2xpcCwgY29uc3QgY2hhciAqdGV4dCwgdWludDMyX3Qgc3RhcnRJbmRleCwKKyAgICAgICAgICAgIHVpbnQzMl90IGxlbiwgaW50IG51bUdseXBocywgaW50IHgsIGludCB5LCBSZWN0KiBib3VuZHMpOworCisgICAgc3RydWN0IERyb3BTaGFkb3cgeworICAgICAgICBEcm9wU2hhZG93KCkgeyB9OworCisgICAgICAgIERyb3BTaGFkb3coY29uc3QgRHJvcFNoYWRvdyYgZHJvcFNoYWRvdyk6CisgICAgICAgICAgICB3aWR0aChkcm9wU2hhZG93LndpZHRoKSwgaGVpZ2h0KGRyb3BTaGFkb3cuaGVpZ2h0KSwKKyAgICAgICAgICAgIGltYWdlKGRyb3BTaGFkb3cuaW1hZ2UpLCBwZW5YKGRyb3BTaGFkb3cucGVuWCksCisgICAgICAgICAgICBwZW5ZKGRyb3BTaGFkb3cucGVuWSkgeworICAgICAgICB9CisKKyAgICAgICAgdWludDMyX3Qgd2lkdGg7CisgICAgICAgIHVpbnQzMl90IGhlaWdodDsKKyAgICAgICAgdWludDhfdCogaW1hZ2U7CisgICAgICAgIG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AgICByZXR1cm4gbVRleHR1cmVJZDsKKyAgICB9CisKK3Byb3RlY3RlZDoKKyAgICBmcmllbmQgY2xhc3MgRm9udDsKKworICAgIGNvbnN0IHVpbnQ4X3QqIG1HYW1tYVRhYmxlOworCisgICAgc3RydWN0IENhY2hlVGV4dHVyZUxpbmUgeworICAgICAgICB1aW50MTZfdCBtTWF4SGVpZ2h0OworICAgICAgICB1aW50MTZfdCBtTWF4V2lkdGg7CisgICAgICAgIHVpbnQzMl90IG1DdXJyZW50Um93OworICAgICAgICB1aW50MzJfdCBtQ3VycmVudENvbDsKKyAgICAgICAgYm9vbCBtRGlydHk7CisKKyAgICAgICAgQ2FjaGVUZXh0dXJlTGluZSh1aW50MTZfdCBtYXhXaWR0aCwgdWludDE2X3QgbWF4SGVpZ2h0LCB1aW50MzJfdCBjdXJyZW50Um93LAorICAgICAgICAgICAgICAgIHVpbnQzMl90IGN1cnJlbnRDb2wpOgorICAgICAgICAgICAgICAgICAgICBtTWF4SGVpZ2h0KG1heEhlaWdodCksCisgICAgICAgICAgICAgICAgICAgIG1NYXhXaWR0aChtYXhXaWR0aCksCisgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50Um93KGN1cnJlbnRSb3cpLAorICAgICAgICAgICAgICAgICAgICBtQ3VycmVudENvbChjdXJyZW50Q29sKSwKKyAgICAgICAgICAgICAgICAgICAgbURpcnR5KGZhbHNlKSB7CisgICAgICAgIH0KKworICAgICAgICBib29sIGZpdEJpdG1hcChjb25zdCBTa0dseXBoJiBnbHlwaCwgdWludDMyX3QgKnJldE9yaWdpblgsIHVpbnQzMl90ICpyZXRPcmlnaW5ZKSB7CisgICAgICAgICAgICBpZiAoZ2x5cGguZkhlaWdodCArIDIgPiBtTWF4SGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobUN1cnJlbnRDb2wgKyBnbHlwaC5mV2lkdGggKyAyIDwgbU1heFdpZHRoKSB7CisgICAgICAgICAgICAgICAgKnJldE9yaWdpblggPSBtQ3VycmVudENvbCArIDE7CisgICAgICAgICAgICAgICAgKnJldE9yaWdpblkgPSBtQ3VycmVudFJvdyArIDE7CisgICAgICAgICAgICAgICAgbUN1cnJlbnRDb2wgKz0gZ2x5cGguZldpZHRoICsgMjsKKyAgICAgICAgICAgICAgICBtRGlydHkgPSB0cnVlOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9OworCisgICAgdWludDMyX3QgZ2V0Q2FjaGVXaWR0aCgpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIG1DYWNoZVdpZHRoOworICAgIH0KKworICAgIHVpbnQzMl90IGdldENhY2hlSGVpZ2h0KCkgY29uc3QgeworICAgICAgICByZXR1cm4gbUNhY2hlSGVpZ2h0OworICAgIH0KKworICAgIHZvaWQgaW5pdFRleHRUZXh0dXJlKCk7CisgICAgYm9vbCBjYWNoZUJpdG1hcChjb25zdCBTa0dseXBoJiBnbHlwaCwgdWludDMyX3QgKnJldE9yaWdpblgsIHVpbnQzMl90ICpyZXRPcmlnaW5ZKTsKKworICAgIHZvaWQgZmx1c2hBbGxBbmRJbnZhbGlkYXRlKCk7CisgICAgdm9pZCBpbml0VmVydGV4QXJyYXlCdWZmZXJzKCk7CisKKyAgICB2b2lkIGNoZWNrSW5pdCgpOworCisgICAgU3RyaW5nMTYgbUxhdGluUHJlY2FjaGU7CisgICAgdm9pZCBwcmVjYWNoZUxhdGluKFNrUGFpbnQqIHBhaW50KTsKKworICAgIHZvaWQgaXNzdWVEcmF3Q29tbWFuZCgpOworICAgIHZvaWQgYXBwZW5kTWVzaFF1YWQoZmxvYXQgeDEsIGZsb2F0IHkxLCBmbG9hdCB6MSwgZmxvYXQgdTEsIGZsb2F0IHYxLCBmbG9hdCB4MiwgZmxvYXQgeTIsCisgICAgICAgICAgICB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AgIGNvbnN0IGZsb2F0IHYgPSBpIC8gMjU1LjBmOworICAgICAgICBjb25zdCBmbG9hdCBibGFjayA9IHBvdyh2LCBibGFja0dhbW1hKTsKKyAgICAgICAgY29uc3QgZmxvYXQgd2hpdGUgPSBwb3codiwgd2hpdGVHYW1tYSk7CisKKyAgICAgICAgbUJsYWNrR2FtbWFbaV0gPSB1aW50OF90KChmbG9hdCk6OmZsb29yKGJsYWNrICogMjU1LjBmICsgMC41ZikpOworICAgICAgICBtV2hpdGVHYW1tYVtpXSA9IHVpbnQ4X3QoKGZsb2F0KTo6Zmxvb3Iod2hpdGUgKiAyNTUuMGYgKyAwLjVmKSk7CisgICAgfQorCisgICAgLy8gQ29uZmlndXJlIHRoZSBmb250IHJlbmRlcmVycworICAgIG1EZWZhdWx0UmVuZGVyZXIuc2V0R2FtbWFUYWJsZSgmbURlZmF1bHRbMF0pOworICAgIG1CbGFja0dhbW1hUmVuZGVyZXIuc2V0R2FtbWFUYWJsZSgmbUJsYWNrR2FtbWFbMF0pOworICAgIG1XaGl0ZUdhbW1hUmVuZGVyZXIuc2V0R2FtbWFUYWJsZSgmbVdoaXRlR2FtbWFbMF0pOworfQorCitGb250UmVuZGVyZXImIEdhbW1hRm9udFJlbmRlcmVyOjpnZXRGb250UmVuZGVyZXIoY29uc3QgU2tQYWludCogcGFpbnQpIHsKKyAgICBpZiAocGFpbnQtPmdldFNoYWRlcigpID09IE5VTEwpIHsKKyAgICAgICAgdWludDMyX3QgYyA9IHBhaW50LT5nZXRDb2xvcigpOworICAgICAgICBjb25zdCBpbnQgciA9IChjID4+IDE2KSAmIDB4RkY7CisgICAgICAgIGNvbnN0IGludCBnID0gKGMgPj4gIDgpICYgMHhGRjsKKyAgICAgICAgY29uc3QgaW50IGIgPSAoYyAgICAgICkgJiAweEZGOworICAgICAgICBjb25zdCBpbnQgbHVtaW5hbmNlID0gKHIgKiAyICsgZyAqIDUgKyBiKSA+PiAzOworCisgICAgICAgIGlmIChsdW1pbmFuY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C4gVXBvbiByZW1vdmUgdGhlIHRleHR1cmUgaXMgZnJlZWQuCisgICAgICovCisgICAgdm9pZCByZW1vdmUoU2tTaGFkZXIqIHNoYWRlcik7CisgICAgLyoqCisgICAgICogQ2xlYXJzIHRoZSBjYWNoZS4gVGhpcyBjYXVzZXMgYWxsIHRleHR1cmVzIHRvIGJlIGRlbGV0ZWQuCisgICAgICovCisgICAgdm9pZCBjbGVhcigpOworCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgbWF4aW11bSBzaXplIG9mIHRoZSBjYWNoZSBpbiBieXRlcy4KKyAgICAgKi8KKyAgICB2b2lkIHNldE1heFNpemUodWludDMyX3QgbWF4U2l6ZSk7CisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgbWF4aW11bSBzaXplIG9mIHRoZSBjYWNoZSBpbiBieXRlcy4KKyAgICAgKi8KKyAgICB1aW50MzJfdCBnZXRNYXhTaXplKCk7CisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCBzaXplIG9mIHRoZSBjYWNoZSBpbiBieXRlcy4KKyAgICAgKi8KKyAgICB1aW50MzJfdCBnZXRTaXplKCk7CisKK3ByaXZhdGU6CisgICAgdm9pZCBnZW5lcmF0ZVRleHR1cmUoU2tCaXRtYXAqIGJpdG1hcCwgVGV4dHVyZSogdGV4dHVyZSk7CisKKyAgICBHZW5lcmF0aW9uQ2FjaGU8U2tTaGFkZXIqLCBUZXh0dXJlKj4gbUNhY2hlOworCisgICAgdWludDMyX3QgbVNpemU7CisgICAgdWludDMyX3QgbU1heFNpemU7CisKKyAgICAvKioKKyAgICAgKiBVc2VkIHRvIGFjY2VzcyBtQ2FjaGUgYW5kIG1TaXplLiBBbGwgbWV0aG9kcyBhcmUgYWNjZXNzZWQgZnJvbSBhIHNpbmdsZQorICAgICAqIHRocmVhZCBleGNlcHQgZm9yIHJlbW92ZSgpLgorICAgICAqLworICAgIG11dGFibGUgTXV0ZXggbUxvY2s7Cit9OyAvLyBjbGFzc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VzIG9mIHRoZSBsYXllci4KKyAgICAgKi8KKyAgICBSZWN0IHRleENvb3JkczsKKworICAgIC8qKgorICAgICAqIE5hbWUgb2YgdGhlIEZCTyB1c2VkIHRvIHJlbmRlciB0aGUgbGF5ZXIuIElmIHRoZSBuYW1lIGlzIDAKKyAgICAgKiB0aGlzIGxheWVyIGlzIG5vdCBiYWNrZWQgYnkgYW4gRkJPLCBidXQgYSBzaW1wbGUgdGV4dHVyZS4KKyAgICAgKi8KKyAgICBHTHVpbnQgZmJvOworCisgICAgLyoqCisgICAgICogT3BhY2l0eSBvZiB0aGUgbGF5ZXIuCisgICAgICovCisgICAgaW50IGFscGhhOworICAgIC8qKgorICAgICAqIEJsZW5kaW5nIG1vZGUgb2YgdGhlIGxheWVyLgorICAgICAqLworICAgIFNrWGZlcm1vZGU6Ok1vZGUgbW9kZTsKKyAgICAvKioKKyAgICAgKiBJbmRpY2F0ZXMgd2hldGhlciB0aGlzIGxheWVyIHNob3VsZCBiZSBibGVuZGVkLgorICAgICAqLworICAgIGJvb2wgYmxlbmQ7CisKKyAgICAvKioKKyAgICAgKiBJbmRpY2F0ZXMgd2hldGhlciB0aGlzIGxheWVyIGhhcyBiZWVuIHVzZWQgYWxyZWFkeS4KKyAgICAgKi8KKyAgICBib29sIGVtcHR5OworCisgICAgLyoqCisgICAgICogTmFtZSBvZiB0aGUgdGV4dHVyZSB1c2VkIHRvIHJlbmRlciB0aGUgbGF5ZXIuCisgICAgICovCisgICAgR0x1aW50IHRleHR1cmU7CisgICAgLyoqCisgICAgICogV2lkdGggb2YgdGhlIGxheWVyIHRleHR1cmUuCisgICAgICovCisgICAgdWludDMyX3Qgd2lkdGg7CisgICAgLyoqCisgICAgICogSGVpZ2h0IG9mIHRoZSBsYXllciB0ZXh0dXJlLgorICAgICAqLworICAgIHVpbnQzMl90IGhlaWdodDsKKworICAgIC8qKgorICAgICAqIERpcnR5IHJlZ2lvbiBpbmRpY2F0aW5nIHdoYXQgcGFydHMgb2YgdGh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7CisgICAgaWYgKGxheWVyKSB7CisgICAgICAgIG1TaXplIC09IGxheWVyLT53aWR0aCAqIGxheWVyLT5oZWlnaHQgKiA0OworICAgICAgICBnbERlbGV0ZVRleHR1cmVzKDEsICZsYXllci0+dGV4dHVyZSk7CisgICAgICAgIGRlbGV0ZSBsYXllcjsKKyAgICB9Cit9CisKK3ZvaWQgTGF5ZXJDYWNoZTo6Y2xlYXIoKSB7CisgICAgc2l6ZV90IGNvdW50ID0gbUNhY2hlLnNpemUoKTsKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgZGVsZXRlTGF5ZXIobUNhY2hlLml0ZW1BdChpKS5tTGF5ZXIpOworICAgIH0KKyAgICBtQ2FjaGUuY2xlYXIoKTsKK30KKworTGF5ZXIqIExheWVyQ2FjaGU6OmdldChjb25zdCB1aW50MzJfdCB3aWR0aCwgY29uc3QgdWludDMyX3QgaGVpZ2h0KSB7CisgICAgTGF5ZXIqIGxheWVyID0gTlVMTDsKKworICAgIExheWVyRW50cnkgZW50cnkod2lkdGgsIGhlaWdodCk7CisgICAgc3NpemVfdCBpbmRleCA9IG1DYWNoZS5pbmRleE9mKGVudHJ5KTsKKworICAgIGlmIChpbmRleCA+PSAwKSB7CisgICAgICAgIGVudHJ5ID0gbUNhY2hlLml0ZW1BdChpbmRleCk7CisgICAgICAgIG1DYWNoZS5yZW1vdmVBdChpbmRleCk7CisKKyAgICAgICAgbGF5ZXIgPSBlbnRyeS5tTGF5ZXI7CisgICAgICAgIG1TaXplIC09IGxheWVyLT53aWR0aCAqIGxheWVyLT5oZWlnaHQgKiA0OworCisgICAgICAgIExBWUVSX0xPR0QoIlJldXNpbmcgbGF5ZXIgJWR4JWQiLCBsYXllci0+d2lkdGgsIGxheWVyLT5oZWlnaHQpOworICAgIH0gZWxzZSB7CisgICAgICAgIExBWUVSX0xPR0QoIkNyZWF0aW5nIG5ldyBsYXllciAlZHglZCIsIGVudHJ5Lm1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JWQiLCBlbnRyeS5tV2lkdGgsIGVudHJ5Lm1IZWlnaHQpOworICAgICAgICB9CisjZW5kaWYKKyAgICB9CisKKyAgICByZXR1cm4gbGF5ZXI7Cit9CisKK2Jvb2wgTGF5ZXJDYWNoZTo6cHV0KExheWVyKiBsYXllcikgeworICAgIGNvbnN0IHVpbnQzMl90IHNpemUgPSBsYXllci0+d2lkdGggKiBsYXllci0+aGVpZ2h0ICogNDsKKyAgICAvLyBEb24ndCBldmVuIHRyeSB0byBjYWNoZSBhIGxheWVyIHRoYXQncyBiaWdnZXIgdGhhbiB0aGUgY2FjaGUKKyAgICBpZiAoc2l6ZSA8IG1NYXhTaXplKSB7CisgICAgICAgIC8vIFRPRE86IFVzZSBhbiBMUlUKKyAgICAgICAgd2hpbGUgKG1TaXplICsgc2l6ZSA+IG1NYXhTaXplKSB7CisgICAgICAgICAgICBzaXplX3QgcG9zaXRpb24gPSAwOworI2lmIExBWUVSX1JFTU9WRV9CSUdHRVNUCisgICAgICAgICAgICBwb3NpdGlvbiA9IG1DYWNoZS5zaXplKCkgLSAxOworI2VuZGlmCisgICAgICAgICAgICBMYXllciogdmljdGltID0gbUNhY2hlLml0ZW1BdChwb3NpdGlvbikubUxheWVyOworICAgICAgICAgICAgZGVsZXRlTGF5ZXIodmljdGltKTsKKyAgICAgICAgICAgIG1DYWNoZS5yZW1vdmVBdChwb3NpdGlvbik7CisKKyAgICAgICAgICAgIExBWUVSX0xPR0QoIiAgRGVsZXRpbmcgbGF5ZXIgJS4yZnglLjJmIiwgdmljdGltLT5sYXllci5nZXRXaWR0aCgpLAorICAgICAgICAgICAgICAgICAgICB2aWN0aW0tPmxheWVyLmdldEhlaWdodCgpKTsKKyAgICAgICAgfQorCisgICAgICAgIExheWVyRW50cnkgZW50cnkobGF5ZXIpOworCisgICAgICAgIG1DYWNoZS5hZGQoZW50cnkpOworICAgICAgICBtU2l6ZSArPSBzaXplOworCisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKyAgICBy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3QgZW5vdWdoIHNwYWNlIGF2YWlsYWJsZS4gQWRkaW5nIGEgbGF5ZXIgY2FuIGNhdXNlIG90aGVyIGxheWVycyB0bworICAgICAqIGJlIHJlbW92ZWQgZnJvbSB0aGUgY2FjaGUuCisgICAgICoKKyAgICAgKiBAcGFyYW0gbGF5ZXIgVGhlIGxheWVyIHRvIGFkZCB0byB0aGUgY2FjaGUKKyAgICAgKgorICAgICAqIEByZXR1cm4gVHJ1ZSBpZiB0aGUgbGF5ZXIgd2FzIGFkZGVkLCBmYWxzZSBvdGhlcndpc2UuCisgICAgICovCisgICAgYm9vbCBwdXQoTGF5ZXIqIGxheWVyKTsKKyAgICAvKioKKyAgICAgKiBDbGVhcnMgdGhlIGNhY2hlLiBUaGlzIGNhdXNlcyBhbGwgbGF5ZXJzIHRvIGJlIGRlbGV0ZWQuCisgICAgICovCisgICAgdm9pZCBjbGVhcigpOworCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgbWF4aW11bSBzaXplIG9mIHRoZSBjYWNoZSBpbiBieXRlcy4KKyAgICAgKi8KKyAgICB2b2lkIHNldE1heFNpemUodWludDMyX3QgbWF4U2l6ZSk7CisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgbWF4aW11bSBzaXplIG9mIHRoZSBjYWNoZSBpbiBieXRlcy4KKyAgICAgKi8KKyAgICB1aW50MzJfdCBnZXRNYXhTaXplKCk7CisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCBzaXplIG9mIHRoZSBjYWNoZSBpbiBieXRlcy4KKyAgICAgKi8KKyAgICB1aW50MzJfdCBnZXRTaXplKCk7CisKK3ByaXZhdGU6CisgICAgdm9pZCBkZWxldGVMYXllcihMYXllciogbGF5ZXIpOworCisgICAgc3RydWN0IExheWVyRW50cnkgeworICAgICAgICBMYXllckVudHJ5KCk6CisgICAgICAgICAgICBtTGF5ZXIoTlVMTCksIG1XaWR0aCgwKSwgbUhlaWdodCgwKSB7CisgICAgICAgIH0KKworICAgICAgICBMYXllckVudHJ5KGNvbnN0IHVpbnQzMl90IGxheWVyV2lkdGgsIGNvbnN0IHVpbnQzMl90IGxheWVySGVpZ2h0KTogbUxheWVyKE5VTEwpIHsKKyAgICAgICAgICAgIG1XaWR0aCA9IHVpbnQzMl90KGNlaWxmKGxheWVyV2lkdGggLyBmbG9hdChMQVlFUl9TSVpFKSkgKiBMQVlFUl9TSVpFKTsKKyAgICAgICAgICAgIG1IZWlnaHQgPSB1aW50MzJfdChjZWlsZihsYXllckhlaWdodCAvIGZsb2F0KExBWUVSX1NJWkUpKSAqIExBWUVSX1NJWkUpOworICAgICAgICB9CisKKyAgICAgICAgTGF5ZXJFbnRyeShjb25zdCBMYXllckVudHJ5JiBlbnRyeSk6CisgICAgICAgICAgICBtTGF5ZXIoZW50cnkubUxheWVyKSwgbVdpZHRoKGVudHJ5Lm1XaWR0aCksIG1IZWlnaHQoZW50cnkubUhlaWdodCkgeworICAgICAgICB9CisKKyAgICAgICAgTGF5ZXJFbnRyeShMYXllciogbGF5ZXIpOgorICAgICAgICAgICAgbUxheWVyKGxheWVyKSwgbVdpZHRoKGxheWVyLT53aWR0aCksIG1IZWlnaHQobGF5ZXItPmhlaWdodCkgeworICAgICAgICB9CisKKyAgICAgICAgYm9vbCBvcGVyYXRvcjwoY29uc3QgTGF5ZXJFbnRyeSYgcmhzKSBjb25zdCB7CisgICAgICAgICAgICBpZiAobVdpZHRoID09IHJocy5tV2lkdGgpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbUhlaWdodCA8IHJocy5tSGVpZ2h0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG1XaWR0aCA8IHJocy5tV2lkdGg7CisgICAgICAgIH0KKworICAgICAgICBib29sIG9wZXJhdG9yPT0oY29uc3QgTGF5ZXJFbnRyeSYgcmhzKSBjb25zdCB7CisgICAgICAgICAgICByZXR1cm4gbVdpZHRoID09IHJocy5tV2lkdGggJiYgbUhlaWdodCA9PSByaHMubUhlaWd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mxvYXQgcyA9IHNpbmYoYW5nbGUpOworCisgICAgY29uc3QgZmxvYXQgbGVuZ3RoID0gc3FydGYoeCAqIHggKyB5ICogeSArIHogKiB6KTsKKyAgICBmbG9hdCByZWNpcExlbiA9IDEuMGYgLyBsZW5ndGg7CisgICAgeCAqPSByZWNpcExlbjsKKyAgICB5ICo9IHJlY2lwTGVuOworICAgIHogKj0gcmVjaXBMZW47CisKKyAgICBjb25zdCBmbG9hdCBuYyA9IDEuMGYgLSBjOworICAgIGNvbnN0IGZsb2F0IHh5ID0geCAqIHk7CisgICAgY29uc3QgZmxvYXQgeXogPSB5ICogejsKKyAgICBjb25zdCBmbG9hdCB6eCA9IHogKiB4OworICAgIGNvbnN0IGZsb2F0IHhzID0geCAqIHM7CisgICAgY29uc3QgZmxvYXQgeXMgPSB5ICogczsKKyAgICBjb25zdCBmbG9hdCB6cyA9IHogKiBzOworCisgICAgZGF0YVtrU2NhbGVYXSA9IHggKiB4ICogbmMgKyAgYzsKKyAgICBkYXRhW2tTa2V3WF0gID0gICAgeHkgKiBuYyAtIHpzOworICAgIGRhdGFbOF0gICAgICAgPSAgICB6eCAqIG5jICsgeXM7CisgICAgZGF0YVtrU2tld1ldICA9ICAgIHh5ICogbmMgKyB6czsKKyAgICBkYXRhW2tTY2FsZVldID0geSAqIHkgKiBuYyArICBjOworICAgIGRhdGFbOV0gICAgICAgPSAgICB5eiAqIG5jIC0geHM7CisgICAgZGF0YVsyXSAgICAgICA9ICAgIHp4ICogbmMgLSB5czsKKyAgICBkYXRhWzZdICAgICAgID0gICAgeXogKiBuYyArIHhzOworICAgIGRhdGFba1NjYWxlWl0gPSB6ICogeiAqIG5jICsgIGM7CisKKyAgICBtU2ltcGxlTWF0cml4ID0gZmFsc2U7Cit9CisKK3ZvaWQgTWF0cml4NDo6bG9hZE11bHRpcGx5KGNvbnN0IE1hdHJpeDQmIHUsIGNvbnN0IE1hdHJpeDQmIHYpIHsKKyAgICBmb3IgKGludCBpID0gMCA7IGkgPCA0IDsgaSsrKSB7CisgICAgICAgIGZsb2F0IHggPSAwOworICAgICAgICBmbG9hdCB5ID0gMDsKKyAgICAgICAgZmxvYXQgeiA9IDA7CisgICAgICAgIGZsb2F0IHcgPSAwOworCisgICAgICAgIGZvciAoaW50IGogPSAwIDsgaiA8IDQgOyBqKyspIHsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IGUgPSB2LmdldChpLCBqKTsKKyAgICAgICAgICAgIHggKz0gdS5nZXQoaiwgMCkgKiBlOworICAgICAgICAgICAgeSArPSB1LmdldChqLCAxKSAqIGU7CisgICAgICAgICAgICB6ICs9IHUuZ2V0KGosIDIpICogZTsKKyAgICAgICAgICAgIHcgKz0gdS5nZXQoaiwgMykgKiBlOworICAgICAgICB9CisKKyAgICAgICAgc2V0KGksIDAsIHgpOworICAgICAgICBzZXQoaSwgMSwgeSk7CisgICAgICAgIHNldChpLCAyLCB6KTsKKyAgICAgICAgc2V0KGksIDMsIHcpOworICAgIH0KKworICAgIG1TaW1wbGVNYXRyaXggPSB1Lm1TaW1wbGVNYXRyaXggJiYgdi5tU2ltcGxlTWF0cml4OworfQorCit2b2lkIE1hdHJpeDQ6OmxvYWRPcnRobyhmbG9hdCBsZWZ0LCBmbG9hdCByaWdodCwgZmxvYXQgYm90dG9tLCBmbG9hdCB0b3AsIGZsb2F0IG5lYXIsIGZsb2F0IGZhcikgeworICAgIGxvYWRJZGVudGl0eSgpOworICAgIGRhdGFba1NjYWxlWF0gPSAyLjBmIC8gKHJpZ2h0IC0gbGVmdCk7CisgICAgZGF0YVtrU2NhbGVZXSA9IDIuMGYgLyAodG9wIC0gYm90dG9tKTsKKyAgICBkYXRhW2tTY2FsZVpdID0gLTIuMGYgLyAoZmFyIC0gbmVhcik7CisgICAgZGF0YVtrVHJhbnNsYXRlWF0gPSAtKHJpZ2h0ICsgbGVmdCkgLyAocmlnaHQgLSBsZWZ0KTsKKyAgICBkYXRhW2tUcmFuc2xhdGVZXSA9IC0odG9wICsgYm90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2h0LCBkYXRhW2tTY2FsZVhdLCBkYXRhW2tUcmFuc2xhdGVYXSk7CisgICAgICAgIE1VTF9BRERfU1RPUkUoci50b3AsIGRhdGFba1NjYWxlWV0sIGRhdGFba1RyYW5zbGF0ZVldKTsKKyAgICAgICAgTVVMX0FERF9TVE9SRShyLmJvdHRvbSwgZGF0YVtrU2NhbGVZXSwgZGF0YVtrVHJhbnNsYXRlWV0pOworCisgICAgICAgIGlmIChyLmxlZnQgPiByLnJpZ2h0KSB7CisgICAgICAgICAgICBmbG9hdCB4ID0gci5sZWZ0OworICAgICAgICAgICAgci5sZWZ0ID0gci5yaWdodDsKKyAgICAgICAgICAgIHIucmlnaHQgPSB4OworICAgICAgICB9CisKKyAgICAgICAgaWYgKHIudG9wID4gci5ib3R0b20pIHsKKyAgICAgICAgICAgIGZsb2F0IHkgPSByLnRvcDsKKyAgICAgICAgICAgIHIudG9wID0gci5ib3R0b207CisgICAgICAgICAgICByLmJvdHRvbSA9IHk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgZmxvYXQgdmVydGljZXNbXSA9IHsKKyAgICAgICAgci5sZWZ0LCByLnRvcCwKKyAgICAgICAgci5yaWdodCwgci50b3AsCisgICAgICAgIHIucmlnaHQsIHIuYm90dG9tLAorICAgICAgICByLmxlZnQsIHIuYm90dG9tCisgICAgfTsKKworICAgIGZsb2F0IHgsIHksIHo7CisKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IDg7IGkrPSAyKSB7CisgICAgICAgIGZsb2F0IHB4ID0gdmVydGljZXNbaV07CisgICAgICAgIGZsb2F0IHB5ID0gdmVydGljZXNbaSArIDFdOworCisgICAgICAgIHggPSBweCAqIGRhdGFba1NjYWxlWF0gKyBweSAqIGRhdGFba1NrZXdYXSArIGRhdGFba1RyYW5zbGF0ZVhdOworICAgICAgICB5ID0gcHggKiBkYXRhW2tTa2V3WV0gKyBweSAqIGRhdGFba1NjYWxlWV0gKyBkYXRhW2tUcmFu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worICAgICAgICB1LmxvYWRNdWx0aXBseSgqdGhpcywgdik7CisgICAgICAgIGxvYWQodSk7CisgICAgfQorCisgICAgdm9pZCBtdWx0aXBseShmbG9hdCB2KTsKKworICAgIHZvaWQgdHJhbnNsYXRlKGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopIHsKKyAgICAgICAgTWF0cml4NCB1OworICAgICAgICB1LmxvYWRUcmFuc2xhdGUoeCwgeSwgeik7CisgICAgICAgIG11bHRpcGx5KHUpOworICAgIH0KKworICAgIHZvaWQgc2NhbGUoZmxvYXQgc3gsIGZsb2F0IHN5LCBmbG9hdCBzeikgeworICAgICAgICBNYXRyaXg0IHU7CisgICAgICAgIHUubG9hZFNjYWxlKHN4LCBzeSwgc3opOworICAgICAgICBtdWx0aXBseSh1KTsKKyAgICB9CisKKyAgICB2b2lkIHJvdGF0ZShmbG9hdCBhbmdsZSwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgICAgICBNYXRyaXg0IHU7CisgICAgICAgIHUubG9hZFJvdGF0ZShhbmdsZSwgeCwgeSwgeik7CisgICAgICAgIG11bHRpcGx5KHUpOworICAgIH0KKworICAgIGJvb2wgY2hhbmdlc0JvdW5kcygpOworCisgICAgdm9pZCBjb3B5VG8oZmxvYXQqIHYpIGNvbnN0OworICAgIHZvaWQgY29weVRvKFNrTWF0cml4JiB2KSBjb25zdDsKKworICAgIHZvaWQgbWFwUmVjdChSZWN0JiByKSBjb25zdDsKKyAgICB2b2lkIG1hcFBvaW50KGZsb2F0JiB4LCBmbG9hdCYgeSkgY29uc3Q7CisKKyAgICBmbG9hdCBnZXRUcmFuc2xhdGVYKCk7CisgICAgZmxvYXQgZ2V0VHJhbnNsYXRlWSgpOworCisgICAgdm9pZCBkdW1wKCkgY29uc3Q7CisKK3ByaXZhdGU6CisgICAgYm9vbCBtU2ltcGxlTWF0cml4OworCisgICAgaW5saW5lIGZsb2F0IGdldChpbnQgaSwgaW50IGopIGNvbnN0IHsKK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JlbmRlcmVyOjpzYXZlTGF5ZXIoZmxvYXQgbGVmdCwgZmxvYXQgdG9wLCBmbG9hdCByaWdodCwgZmxvYXQgYm90dG9tLAorICAgICAgICBTa1BhaW50KiBwLCBpbnQgZmxhZ3MpIHsKKyAgICBjb25zdCBHTHVpbnQgcHJldmlvdXNGYm8gPSBtU25hcHNob3QtPmZibzsKKyAgICBjb25zdCBpbnQgY291bnQgPSBzYXZlU25hcHNob3QoZmxhZ3MpOworCisgICAgaW50IGFscGhhID0gMjU1OworICAgIFNrWGZlcm1vZGU6Ok1vZGUgbW9kZTsKKworICAgIGlmIChwKSB7CisgICAgICAgIGFscGhhID0gcC0+Z2V0QWxwaGEoKTsKKyAgICAgICAgaWYgKCFtQ2FjaGVzLmV4dGVuc2lvbnMuaGFzRnJhbWVidWZmZXJGZXRjaCgpKSB7CisgICAgICAgICAgICBjb25zdCBib29sIGlzTW9kZSA9IFNrWGZlcm1vZGU6OklzTW9kZShwLT5nZXRYZmVybW9kZSgpLCAmbW9kZSk7CisgICAgICAgICAgICBpZiAoIWlzTW9kZSkgeworICAgICAgICAgICAgICAgIC8vIEFzc3VtZSBTUkNfT1ZFUgorICAgICAgICAgICAgICAgIG1vZGUgPSBTa1hmZXJtb2RlOjprU3JjT3Zlcl9Nb2RlOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbW9kZSA9IGdldFhmZXJtb2RlKHAtPmdldFhmZXJtb2RlKCkpOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgbW9kZSA9IFNrWGZlcm1vZGU6OmtTcmNPdmVyX01vZGU7CisgICAgfQorCisgICAgaWYgKCFtU25hcHNob3QtPnByZXZpb3VzLT5pbnZpc2libGUpIHsKKyAgICAgICAgY3JlYXRlTGF5ZXIobVNuYXBzaG90LCBsZWZ0LCB0b3AsIHJpZ2h0LCBib3R0b20sIGFscGhhLCBtb2RlLCBmbGFncywgcHJldmlvdXNGYm8pOworICAgIH0KK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25hcHNob3QtPmludmlzaWJsZSkgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgZ2xBY3RpdmVUZXh0dXJlKGdUZXh0dXJlVW5pdHNbMF0pOworICAgIExheWVyKiBsYXllciA9IG1DYWNoZXMubGF5ZXJDYWNoZS5nZXQoYm91bmRzLmdldFdpZHRoKCksIGJvdW5kcy5nZXRIZWlnaHQoKSk7CisgICAgaWYgKCFsYXllcikgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgbGF5ZXItPm1vZGUgPSBtb2RlOworICAgIGxheWVyLT5hbHBoYSA9IGFscGhhOworICAgIGxheWVyLT5sYXllci5zZXQoYm91bmRzKTsKKyAgICBsYXllci0+dGV4Q29vcmRzLnNldCgwLjBmLCBib3VuZHMuZ2V0SGVpZ2h0KCkgLyBmbG9hdChsYXllci0+aGVpZ2h0KSwKKyAgICAgICAgICAgIGJvdW5kcy5nZXRXaWR0aCgpIC8gZmxvYXQobGF5ZXItPndpZHRoKSwgMC4wZik7CisKKyAgICAvLyBTYXZlIHRoZSBsYXllciBpbiB0aGUgc25hcHNob3QKKyAgICBzbmFwc2hvdC0+ZmxhZ3MgfD0gU25hcHNob3Q6OmtGbGFnSXNMYXllcjsKKyAgICBzbmFwc2hvdC0+bGF5ZXIgPSBsYXllcjsKKworICAgIGlmIChmYm9MYXllcikgeworICAgICAgICByZXR1cm4gY3JlYXRlRmJvTGF5ZXIobGF5ZXIsIGJvdW5kcywgc25hcHNob3QsIHByZXZpb3VzRmJvKTsKKyAgICB9IGVsc2UgeworICAgICAgICAvLyBDb3B5IHRoZSBmcmFtZWJ1ZmZlciBpbnRvIHRoZSBsYXllcgorICAgICAgICBnbEJpbmRUZXh0dXJlKEdMX1RFWFRVUkVfMkQsIGxheWVyLT50ZXh0dXJlKTsKKworICAgICAgICBpZiAobGF5ZXItPmVtcHR5KSB7CisgICAgICAgICAgICBnbENvcHlUZXhJbWFnZTJEKEdMX1RFWFRVUkVfM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XZpb3VzKSB7CisgICAgaWYgKCFjdXJyZW50LT5sYXllcikgeworICAgICAgICBMT0dFKCJBdHRlbXB0aW5nIHRvIGNvbXBvc2UgYSBsYXllciB0aGF0IGRvZXMgbm90IGV4aXN0Iik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBjb25zdCBib29sIGZib0xheWVyID0gY3VycmVudC0+ZmxhZ3MgJiBTbmFwc2hvdDo6a0ZsYWdJc0Zib0xheWVyOworCisgICAgaWYgKGZib0xheWVyKSB7CisgICAgICAgIC8vIFVuYmluZCBjdXJyZW50IEZCTyBhbmQgcmVzdG9yZSBwcmV2aW91cyBvbmUKKyAgICAgICAgZ2xCaW5kRnJhbWVidWZmZXIoR0xfRlJBTUVCVUZGRVIsIHByZXZpb3VzLT5mYm8pOworICAgIH0KKworICAgIExheWVyKiBsYXllciA9IGN1cnJlbnQtPmxheWVyOworICAgIGNvbnN0IFJlY3QmIHJlY3QgPSBsYXllci0+bGF5ZXI7CisKKyAgICBpZiAoIWZib0xheWVyICYmIGxheWVyLT5hbHBoYSA8IDI1NSkgeworICAgICAgICBkcmF3Q29sb3JSZWN0KHJlY3QubGVmdCwgcmVjdC50b3AsIHJlY3QucmlnaHQsIHJlY3QuYm90dG9tLAorICAgICAgICAgICAgICAgIGxheWVyLT5hbHBoYSA8PCAyNCwgU2tYZmVybW9kZTo6a0RzdEluX01vZGUsIHRydWUpOworICAgICAgICAvLyBSZXF1aXJlZCBiZWxvdywgY29tcG9zZUxheWVyUmVjdCgpIHdpbGwgZGl2aWRlIGJ5IDI1NQorICAgICAgICBsYXllci0+YWxwaGEgPSAyNTU7CisgICAgfQorCisgICAgbUNhY2hlcy51bmJpbmRNZXNoQnVmZmVyKCk7CisKKyAgICBnbEFjdGl2ZVRleHR1cmUoZ1RleHR1cmVVbml0c1swXSk7CisKKyAgICAvLyBXaGVuIHRoZSBsYXllciBpcyBzdG9yZWQgaW4gYW4gRkJPLCB3ZSBjYW4gc2F2ZSBhIGJpd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0KSB7CisjaWYgUkVOREVSX0xBWUVSU19BU19SRUdJT05TCisgICAgaWYgKGxheWVyLT5yZWdpb24uaXNSZWN0KCkpIHsKKyAgICAgICAgY29tcG9zZUxheWVyUmVjdChsYXllciwgcmVjdCk7CisgICAgICAgIGxheWVyLT5yZWdpb24uY2xlYXIoKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICghbGF5ZXItPnJlZ2lvbi5pc0VtcHR5KCkpIHsKKyAgICAgICAgc2l6ZV90IGNvdW50OworICAgICAgICBjb25zdCBhbmRyb2lkOjpSZWN0KiByZWN0cyA9IGxheWVyLT5yZWdpb24uZ2V0QXJyYXkoJmNvdW50KTsKKworICAgICAgICBzZXR1cERyYXcoKTsKKworICAgICAgICBQcm9ncmFtRGVzY3JpcHRpb24gZGVzY3JpcHRpb247CisgICAgICAgIGRlc2NyaXB0aW9uLmhhc1RleHR1cmUgPSB0cnVlOworCisgICAgICAgIGNvbnN0IGZsb2F0IGFscGhhID0gbGF5ZXItPmFscGhhIC8gMjU1LjBmOworICAgICAgICBjb25zdCBib29sIHNldENvbG9yID0gZGVzY3JpcHRpb24uc2V0Q29sb3IoYWxwaGEsIGFscGhhLCBhbHBoYSwgYWxwaGEpOworICAgICAgICBjaG9vc2VCbGVuZGluZyhsYXllci0+YmxlbmQgfHwgbGF5ZXItPmFscGhhIDwgMjU1LCBsYXllci0+bW9kZSwgZGVzY3JpcHRpb24sIGZhbHNlKTsKKworICAgICAgICB1c2VQcm9ncmFtKG1DYWNoZXMucHJvZ3JhbUNhY2hlLmdldChkZXNjcmlwdGlvbikpOworCisgICAgICAgIC8vIFRleHR1cmUKKyAgICAgICAgYmluZFRleHR1cmUobGF5ZXItPnRleHR1cmUpOworICAgICAgICBnbFVuaWZvcm0xaShtQ2FjaGVzLmN1cnJlbnRQcm9ncmFtLT5nZXRVbmlmb3JtKCJzYW1wbGVyIiksIDApOworCisgICAgICAgIC8vIEFsd2F5cyBwcmVtdWx0aXBsaWVk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dXJlWzBdKTsKKworICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGNvbnN0IGFuZHJvaWQ6OlJlY3QqIHIgPSAmcmVjdHNbaV07CisKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IHUxID0gci0+bGVmdCAqIHRleFg7CisgICAgICAgICAgICBjb25zdCBmbG9hdCB2MSA9IChyZWN0LmdldEhlaWdodCgpIC0gci0+dG9wKSAqIHRleFk7CisgICAgICAgICAgICBjb25zdCBmbG9hdCB1MiA9IHItPnJpZ2h0ICogdGV4WDsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IHYyID0gKHJlY3QuZ2V0SGVpZ2h0KCkgLSByLT5ib3R0b20pICogdGV4WTsKKworICAgICAgICAgICAgLy8gVE9ETzogUmVqZWN0IHF1YWRzIG91dHNpZGUgb2YgdGhlIGNsaXAKKyAgICAgICAgICAgIFRleHR1cmVWZXJ0ZXg6OnNldChtZXNoKyssIHItPmxlZnQsIHItPnRvcCwgdTEsIHYxKTsKKyAgICAgICAgICAgIFRleHR1cmVWZXJ0ZXg6OnNldChtZXNoKyssIHItPnJpZ2h0LCByLT50b3AsIHUyLCB2MSk7CisgICAgICAgICAgICBUZXh0dXJlVmVydGV4OjpzZXQobWVzaCsrLCByLT5sZWZ0LCByLT5ib3R0b20sIHUxLCB2Mik7CisgICAgICAgICAgICBUZXh0dXJlVmVydGV4OjpzZXQobWVzaCsrLCByLT5yaWdodCwgci0+Ym90dG9tLCB1MiwgdjIpOworCisgICAgICAgICAgICBudW1RdWFkcysrOworCisgICAgICAgICAgICBpZiAobnVtUXVhZHMgPj0gUkVHSU9OX01FU0hfUVVBRF9DT1VOVCkgeworICAgICAgICAgICAgICAgIGdsRHJhd0VsZW1lbnRzKEdMX1RSSUFOR0xFUywgbnVtUXVhZHMgKiA2LCBHTF9VTlNJR05FRF9TSE9SVCwgTlVMTCk7CisgICAgICAgICAgICAgICAgbnVtUXVhZHMgPSAwOworICAgICAgICAgICAgICAgIG1lc2ggPSBtQ2FjaGVzLmdldFJlZ2lvbk1lc2goKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChudW1RdWFkcyA+IDApIHsKKyAgICAgICAgICAgIGdsRHJhd0VsZW1lbnRzKEdMX1RSSUFOR0xFUywgbnVtUXVhZHMgKiA2LCBHTF9VTlNJR05FRF9TSE9SVCwgTlVMTCk7CisgICAgICAgIH0KKworICAgICAgICBnbEJpbmRCdWZmZXIoR0xfRUxFTUVOVF9BUlJBWV9CVUZGRVIsIDApOworICAgICAgICBnbERpc2FibGVWZXJ0ZXhBdHRyaWJBcnJheSh0ZXhDb29yZHNTbG90KTsKKworI2lmIERFQlVHX0xBWUVSU19BU19SRUdJT05TCisgICAgICAgIHVpbnQzMl90IGNvbG9yc1tdID0geworICAgICAgICAgICAgICAgIDB4N2ZmZjAwMDAsIDB4N2YwMGZmMDAsCisgICAgICAgICAgICAgICAgMHg3ZjAwMDBmZiwgMHg3ZmZmMDBmZiwKKyAgICAgICAgfTsKKworICAgICAgICBpbnQgb2Zmc2V0ID0gMDsKKyAgICAgICAgaW50MzJfdCB0b3AgPSByZWN0c1swXS50b3A7CisgICAgICAgIGludCBpID0gMDsKKworICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGlmICh0b3AgIT0gcmVjdHNbaV0udG9wKSB7CisgICAgICAgICAgICAgICAgb2Zmc2V0IF49IDB4MjsKKyAgICAgICAgICAgICAgICB0b3AgPSByZWN0c1tpXS50b3A7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFJlY3QgcihyZWN0c1tpXS5sZWZ0LCByZWN0c1tpXS50b3AsIHJlY3RzW2ldLnJpZ2h0LCByZWN0c1tpXS5ib3R0b20pOworICAgICAgICAgICAgZHJhd0NvbG9yUmVjdChyLmxlZnQsIHIudG9wLCByLnJpZ2h0LCByL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cmdldCkgJiYKKyAgICAgICAgICAgICAgICBtU25hcHNob3QtPnJlZ2lvbiAmJiBtZXNoLT5oYXNFbXB0eVF1YWRzKSB7CisgICAgICAgICAgICBjb25zdCBzaXplX3QgY291bnQgPSBtZXNoLT5xdWFkcy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBSZWN0IGJvdW5kcyA9IG1lc2gtPnF1YWRzLml0ZW1BdChpKTsKKyAgICAgICAgICAgICAgICBkaXJ0eUxheWVyKGJvdW5kcy5sZWZ0LCBib3VuZHMudG9wLCBib3VuZHMucmlnaHQsIGJvdW5kcy5ib3R0b20sCisgICAgICAgICAgICAgICAgICAgICAgICAqbVNuYXBzaG90LT50cmFuc2Zvcm0pOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZHJhd1RleHR1cmVNZXNoKGxlZnQsIHRvcCwgcmlnaHQsIGJvdHRvbSwgdGV4dHVyZS0+aWQsIGFscGhhIC8gMjU1LjBmLAorICAgICAgICAgICAgICAgIG1vZGUsIHRleHR1cmUtPmJsZW5kLCAoR0x2b2lkKikgMCwgKEdMdm9pZCopIGdNZXNoVGV4dHVyZU9mZnNldCwKKyAgICAgICAgICAgICAgICBHTF9UUklBTkdMRVMsIG1lc2gtPnZlcnRpY2VzQ291bnQsIGZhbHNlLCBmYWxzZSwgbWVzaC0+bWVzaEJ1ZmZlciwKKyAgICAgICAgICAgICAgICB0cnVlLCAhbWVzaC0+aGFzRW1wdHlRdWFkcyk7CisgICAgfQorfQorCit2b2lkIE9wZW5HTFJlbmRlcmVyOjpkcmF3TGluZXMoZmxvYXQqIHBvaW50cywgaW50IGNvdW50LCBTa1BhaW50KiBwYWludCkgeworICAgIGlmIChtU25hcHNob3QtPmludmlzaWJsZSkgcmV0dXJuOworCisgICAgaW50IGFscGhhOworICAgIFNrWGZlcm1vZGU6Ok1vZGUgbW9kZTsKKyAg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29uc3QgR0xzaXplaSBlbGVtZW50c0NvdW50ID0gaXNBQSA/IG1DYWNoZXMubGluZS5nZXRFbGVtZW50c0NvdW50KCkgOiBnTWVzaENvdW50OworICAgIGNvbnN0IEdMZW51bSBkcmF3TW9kZSA9IGlzQUEgPyBHTF9UUklBTkdMRVMgOiBHTF9UUklBTkdMRV9TVFJJUDsKKworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkgKz0gNCkgeworICAgICAgICBmbG9hdCB0eCA9IDAuMGY7CisgICAgICAgIGZsb2F0IHR5ID0gMC4wZjsKKworICAgICAgICBpZiAoaXNBQSkgeworICAgICAgICAgICAgbUNhY2hlcy5saW5lLnVwZGF0ZShwb2ludHNbaV0sIHBvaW50c1tpICsgMV0sIHBvaW50c1tpICsgMl0sIHBvaW50c1tpICsgM10sCisgICAgICAgICAgICAgICAgICAgIHN0cm9rZVdpZHRoLCB0eCwgdHkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdHkgPSBzdHJva2VXaWR0aCA8PSAxLjBmID8gMC4wZiA6IC1zdHJva2VXaWR0aCAqIDAuNWY7CisgICAgICAgIH0KKworICAgICAgICBjb25zdCBmbG9hdCBkeCA9IHBvaW50c1tpICsgMl0gLSBwb2ludHNbaV07CisgICAgICAgIGNvbnN0IGZsb2F0IGR5ID0gcG9pbnRzW2kgKyAzXSAtIHBvaW50c1tpICsgMV07CisgICAgICAgIGNvbnN0IGZsb2F0IG1hZyA9IHNxcnRmKGR4ICogZHggKyBkeSAqIGR5KTsKKyAgICAgICAgY29uc3QgZmxvYXQgYW5nbGUgPSBhY29zKGR4IC8gbWFnKTsKKworICAgICAgICBtTW9kZWxWaWV3LmxvYWRUcmFuc2xhdGUocG9pbnRzW2ldLCBwb2ludHNbaSArIDFdLCAwLjBmKTsKKyAgICAgICAgaWYgKGFuZ2xlID4gTUlOX0FOR0xFIHx8IGFuZ2xlIDwgLU1JTl9BTkdMRSkgeworICAgICAgICAgICAgbU1vZGV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9yID4+IDI0KSAmIDB4ZmYpID09IDI1NSkgeworICAgICAgICBjb2xvciB8PSBwLT5nZXRBbHBoYSgpIDw8IDI0OworICAgIH0KKworICAgIGRyYXdDb2xvclJlY3QobGVmdCwgdG9wLCByaWdodCwgYm90dG9tLCBjb2xvciwgbW9kZSk7Cit9CisKK3ZvaWQgT3BlbkdMUmVuZGVyZXI6OmRyYXdUZXh0KGNvbnN0IGNoYXIqIHRleHQsIGludCBieXRlc0NvdW50LCBpbnQgY291bnQsCisgICAgICAgIGZsb2F0IHgsIGZsb2F0IHksIFNrUGFpbnQqIHBhaW50KSB7CisgICAgaWYgKHRleHQgPT0gTlVMTCB8fCBjb3VudCA9PSAwIHx8IChwYWludC0+Z2V0QWxwaGEoKSA9PSAwICYmIHBhaW50LT5nZXRYZmVybW9kZSgpID09IE5VTEwpKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaWYgKG1TbmFwc2hvdC0+aW52aXNpYmxlKSByZXR1cm47CisKKyAgICBwYWludC0+c2V0QW50aUFsaWFzKHRydWUpOworCisgICAgZmxvYXQgbGVuZ3RoID0gLTEuMGY7CisgICAgc3dpdGNoIChwYWludC0+Z2V0VGV4dEFsaWduKCkpIHsKKyAgICAgICAgY2FzZSBTa1BhaW50OjprQ2VudGVyX0FsaWduOgorICAgICAgICAgICAgbGVuZ3RoID0gcGFpbnQtPm1lYXN1cmVUZXh0KHRleHQsIGJ5dGVzQ291bnQpOworICAgICAgICAgICAgeCAtPSBsZW5ndGggLyAyLjBmOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU2tQYWludDo6a1JpZ2h0X0FsaWduOgorICAgICAgICAgICAgbGVuZ3RoID0gcGFpbnQtPm1lYXN1cmVUZXh0KHRleHQsIGJ5dGVzQ291bnQpOworICAgICAgICAgICAgeCAtPSBsZW5ndGg7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0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XJsaW5lIGFuZCBzdHJpa2UtdGhyb3VnaAorICAgIHVpbnQzMl90IGZsYWdzID0gcGFpbnQtPmdldEZsYWdzKCk7CisgICAgaWYgKGZsYWdzICYgKFNrUGFpbnQ6OmtVbmRlcmxpbmVUZXh0X0ZsYWcgfCBTa1BhaW50OjprU3RyaWtlVGhydVRleHRfRmxhZykpIHsKKyAgICAgICAgZmxvYXQgdW5kZXJsaW5lV2lkdGggPSBsZW5ndGg7CisgICAgICAgIC8vIElmIGxlbmd0aCBpcyA+IDAuMGYsIHdlIGFscmVhZHkgbWVhc3VyZWQgdGhlIHRleHQgZm9yIHRoZSB0ZXh0IGFsaWdubWVudAorICAgICAgICBpZiAobGVuZ3RoIDw9IDAuMGYpIHsKKyAgICAgICAgICAgIHVuZGVybGluZVdpZHRoID0gcGFpbnQtPm1lYXN1cmVUZXh0KHRleHQsIGJ5dGVzQ291bnQpOworICAgICAgICB9CisKKyAgICAgICAgZmxvYXQgb2Zmc2V0WCA9IDA7CisgICAgICAgIHN3aXRjaCAocGFpbnQtPmdldFRleHRBbGlnbigpKSB7CisgICAgICAgICAgICBjYXNlIFNrUGFpbnQ6OmtDZW50ZXJfQWxpZ246CisgICAgICAgICAgICAgICAgb2Zmc2V0WCA9IHVuZGVybGluZVdpZHRoICogMC41ZjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2tQYWludDo6a1JpZ2h0X0FsaWduOgorICAgICAgICAgICAgICAgIG9mZnNldFggPSB1bmRlcmxpbmVXaWR0aDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAodW5kZXJsaW5lV2lkdGggPiAwLjBmKSB7CisgICAgICAgICAgICBjb25zdCBmbG9hdCB0ZXh0U2l6ZSA9IHBhaW50LT5nZXRUZXh0U2l6ZSgpOworICAgICAgICAgICAgY29uc3QgZmxvYXQgc3Ryb2tlV2lkdGggPSB0ZXh0U2l6ZSAqIGtTdGRVbmRlcmxpbmVfVGhpY2tuZXNzOworCisgICAgICAgICAgICBjb25zdCBmbG9hdCBsZWZ0ID0geCAtIG9mZnNldFg7CisgICAgICAgICAgICBmbG9hdCB0b3AgPSAwLjBmOworCisgICAgICAgICAgICBjb25zdCBpbnQgcG9pbnRzQ291bnQgPSA0ICogKGZsYWdzICYgU2tQYWludDo6a1N0cmlrZVRocnVUZXh0X0ZsYWcgPyAyIDogMSk7CisgICAgICAgICAgICBmbG9hdCBwb2ludHNbcG9pbnRzQ291bnRdOworICAgICAgICAgICAgaW50IGN1cnJlbnRQb2ludCA9IDA7CisKKyAgICAgICAgICAgIGlmIChmbGFncyAmIFNrUGFpbnQ6OmtVbmRlcmxpbmVUZXh0X0ZsYWcpIHsKKyAgICAgICAgICAgICAgICB0b3AgPSB5ICsgdGV4dFNpemUgKiBrU3RkVW5kZXJsaW5lX09mZnNldDsKKyAgICAgICAgICAgICAgICBwb2ludHNbY3VycmVudFBvaW50KytdID0gbGVmdDsKKyAgICAgICAgICAgICAgICBwb2ludHNbY3VycmVudFBvaW50KytdID0gdG9wOworICAgICAgICAgICAgICAgIHBvaW50c1tjdXJyZW50UG9pbnQrK10gPSBsZWZ0ICsgdW5kZXJsaW5lV2lkdGg7CisgICAgICAgICAgICAgICAgcG9pbnRzW2N1cnJlbnRQb2ludCsrXSA9IHRvcDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZsYWdzICYgU2tQYWludDo6a1N0cmlrZVRocnVUZXh0X0ZsYWcpIHsKKyAgICAgICAgICAgICAgICB0b3AgPSB5ICsgdGV4dFNpemUgKiBrU3RkU3RyaWtlVGhydV9PZmZzZXQ7CisgICAgICAgICAgICAgICAgcG9pbnRzW2N1cnJlbnRQb2ludCsrXSA9IGxlZnQ7CisgICAgICAgICAgICAgICAgcG9pbnRzW2N1cnJlbnRQb2ludCsrXSA9IHRvcDsKKyAgICAgICAgICAgICAgICBwb2ludHNbY3VycmVudFBvaW50KytdID0gbGVmdCArIHVuZGVybGluZVdpZHRoOworICAgICAgICAgICAgICAgIHBvaW50c1tjdXJyZW50UG9pbnQrK10gPSB0b3A7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFNrUGFpbnQgbGluZXNQYWludCgqcGFpbnQpOworICAgICAgICAgICAgbGluZXNQYWludC5zZXRTdHJva2VXaWR0aChzdHJva2VXaWR0aCk7CisKKyAgICAgICAgICAgIGRyYXdMaW5lcygmcG9pbnRzWzBdLCBwb2ludHNDb3VudCwgJmxpbmVzUGFpbnQpOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkIE9wZW5HTFJlbmRlcmVyOjpkcmF3Q29sb3JSZWN0KGZsb2F0IGxlZnQsIGZsb2F0IHRvcCwgZmxvYXQgcmlnaHQsIGZsb2F0IGJvdHRvbSwKKyAgICAgICAgaW50IGNvbG9yLCBTa1hmZXJtb2RlOjpNb2RlIG1vZGUsIGJvb2wgaWdub3JlVHJhbnNmb3JtKSB7CisgICAgc2V0dXBEcmF3KCk7CisKKyAgICAvLyBJZiBhIHNoYWRlciBpcyBzZXQsIHByZXNlcnZlIG9ubHkgdGhlIGFscGhhCisgICAgaWYgKG1TaGFkZXIpIHsKKyAgICAgICAgY29sb3IgfD0gMHgwMGZmZmZmZjsKKyAgICB9CisKKyAgICAvLyBSZW5kZXIgdXNpbmcgcHJlLW11bHRpcGxpZWQgYWxwaGEKKyAgICBjb25zdCBpbnQgYWxwaGEgPSAoY29sb3IgPj4gMjQpICYgMHhGRjsKKyAgICBjb25zdCBHTGZsb2F0IGEgPSBhbHBoYSAvIDI1NS4wZjsKKyAgICBjb25zdCBHTGZsb2F0IHIgPSBhICogKChjb2xvciA+PiAxNikgJiAweEZGKSAvIDI1NS4wZjsKKyAgICBjb25zdCBHTGZsb2F0IGcgPSBhICogKChjb2xvciA+PiAgOCkgJiAweEZGKSAvIDI1NS4wZjsKKyAgICBjb25zdCB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5yZW1vdmUoKTsKKyAgICAgICAgcHJvZ3JhbS0+dXNlKCk7CisgICAgICAgIG1DYWNoZXMuY3VycmVudFByb2dyYW0gPSBwcm9ncmFtOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIHJldHVybiB0cnVlOworfQorCit2b2lkIE9wZW5HTFJlbmRlcmVyOjpyZXNldERyYXdUZXh0dXJlVGV4Q29vcmRzKGZsb2F0IHUxLCBmbG9hdCB2MSwgZmxvYXQgdTIsIGZsb2F0IHYyKSB7CisgICAgVGV4dHVyZVZlcnRleCogdiA9ICZtTWVzaFZlcnRpY2VzWzBdOworICAgIFRleHR1cmVWZXJ0ZXg6OnNldFVWKHYrKywgdTEsIHYxKTsKKyAgICBUZXh0dXJlVmVydGV4OjpzZXRVVih2KyssIHUyLCB2MSk7CisgICAgVGV4dHVyZVZlcnRleDo6c2V0VVYodisrLCB1MSwgdjIpOworICAgIFRleHR1cmVWZXJ0ZXg6OnNldFVWKHYrKywgdTIsIHYyKTsKK30KKwordm9pZCBPcGVuR0xSZW5kZXJlcjo6Z2V0QWxwaGFBbmRNb2RlKFNrUGFpbnQqIHBhaW50LCBpbnQqIGFscGhhLCBTa1hmZXJtb2RlOjpNb2RlKiBtb2RlKSB7CisgICAgaWYgKHBhaW50KSB7CisgICAgICAgIGlmICghbUNhY2hlcy5leHRlbnNpb25zLmhhc0ZyYW1lYnVmZmVyRmV0Y2goKSkgeworICAgICAgICAgICAgY29uc3QgYm9vbCBpc01vZGUgPSBTa1hmZXJtb2RlOjpJc01vZGUocGFpbnQtPmdldFhmZXJtb2RlKCksIG1vZGUpOworICAgICAgICAgICAgaWYgKCFpc01vZGUpIHsKKyAgICAgICAgICAgICAgICAvLyBBc3N1bWUgU1JDX09WRVIKKyAgICAgICAgICAgICAgICAqbW9kZSA9IFNrWGZlcm1vZGU6OmtTcmNPdmVyX01vZGU7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAqbW9kZSA9IGdldFhmZXJtb2RlKHBhaW50LT5nZXRYZmVybW9kZSgpKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFNraWEgZHJhd3MgdXNpbmcgdGhlIGNvbG9yJ3MgYWxwaGEgY2hhbm5lbCBpZiA8IDI1NQorICAgICAgICAvLyBPdGhlcndpc2UsIGl0IHVzZXMgdGhlIHBhaW50J3MgYWxwaGEKKyAgICAgICAgaW50IGNvbG9yID0gcGFpbnQtPmdldENvbG9yKCk7CisgICAgICAgICphbHBoYSA9IChjb2xvciA+PiAyNCkgJiAweEZGOworICAgICAgICBpZiAoKmFscGhhID09IDI1NSkgeworICAgICAgICAgICAgKmFscGhhID0gcGFpbnQtPmdldEFscGhhKCk7CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICAqbW9kZSA9IFNrWGZlcm1vZGU6OmtTcmNPdmVyX01vZGU7CisgICAgICAgICphbHBoYSA9IDI1NTsKKyAgICB9Cit9CisKK1NrWGZlcm1vZGU6Ok1vZGUgT3BlbkdMUmVuZGVyZXI6OmdldFhmZXJtb2RlKFNrWGZlcm1vZGUqIG1vZGUpIHsKKyAgICBpZiAobW9kZSA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiBTa1hmZXJtb2RlOjprU3JjT3Zlcl9Nb2RlOworICAgIH0KKyAgICByZXR1cm4gbW9kZS0+Zk1vZGU7Cit9CisKK3ZvaWQgT3BlbkdMUmVuZGVyZXI6OnNldFRleHR1cmVXcmFwTW9kZXMoVGV4dHVyZSogdGV4dHVyZSwgR0xlbnVtIHdyYXBTLCBHTGVudW0gd3JhcFQpIHsKKyAgICBib29sIGJvdW5kID0gZmFsc2U7CisgICAgaWYgKHdyYXBTICE9IHRleHR1cmUtPndyYXBTKSB7CisgICAgICAgIGdsQmluZFRleHR1cmUoR0xfVEVYVFVSRV8yRCwgdGV4dHVyZS0+aWQpOworICAgICAgICBib3VuZCA9IHRydWU7CisgICAgICAgIGdsVGV4UGFyYW1ldGVyaShHTF9UR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JQ19EUkFXKTsKK30KKwordm9pZCBQYXRjaDo6Z2VuZXJhdGVSb3coVGV4dHVyZVZlcnRleComIHZlcnRleCwgZmxvYXQgeTEsIGZsb2F0IHkyLCBmbG9hdCB2MSwgZmxvYXQgdjIsCisgICAgICAgIGNvbnN0IGludDMyX3QgeERpdnNbXSwgdWludDMyX3QgeENvdW50LCBmbG9hdCBzdHJldGNoWCwgZmxvYXQgd2lkdGgsIGZsb2F0IGJpdG1hcFdpZHRoLAorICAgICAgICB1aW50MzJfdCYgcXVhZENvdW50LCBjb25zdCB1aW50MzJfdCBjb2xvcktleSkgeworICAgIGZsb2F0IHByZXZpb3VzU3RlcFggPSAwLjBmOworCisgICAgZmxvYXQgeDEgPSAwLjBmOworICAgIGZsb2F0IHUxID0gMC4wZjsKKworICAgIC8vIEdlbmVyYXRlIHRoZSByb3cgcXVhZCBieSBxdWFkCisgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IHhDb3VudDsgaSsrKSB7CisgICAgICAgIGZsb2F0IHN0ZXBYID0geERpdnNbaV07CisKKyAgICAgICAgZmxvYXQgeDIgPSAwLjBmOworICAgICAgICBpZiAoaSAmIDEpIHsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IHNlZ21lbnQgPSBzdGVwWCAtIHByZXZpb3VzU3RlcFg7CisgICAgICAgICAgICB4MiA9IHgxICsgc2VnbWVudCAqIHN0cmV0Y2hYOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgeDIgPSB4MSArIHN0ZXBYIC0gcHJldmlvdXNTdGVwWDsKKyAgICAgICAgfQorICAgICAgICBmbG9hdCB1MiA9IGZtYXgoMC4wZiwgc3RlcFggLSAwLjVmKSAvIGJpdG1hcFdpZHRoOworCisgICAgICAgIGdlbmVyYXRlUXVhZCh2ZXJ0ZXgsIHgxLCB5MSwgeDIsIHkyLCB1MSwgdjEsIHUyLCB2MiwgcXVhZENvdW50LCBjb2xvcktleSk7CisKKyAgICAgICAgeDEgPSB4MjsK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GNvbnN0IGZsb2F0IGJpdG1hcFdpZHRoLCBjb25zdCBmbG9hdCBiaXRtYXBIZWlnaHQsCisgICAgICAgICAgICBjb25zdCBmbG9hdCBwaXhlbFdpZHRoLCBjb25zdCBmbG9hdCBwaXhlbEhlaWdodCwKKyAgICAgICAgICAgIGNvbnN0IHVpbnQzMl90IHhDb3VudCwgY29uc3QgdWludDMyX3QgeUNvdW50LAorICAgICAgICAgICAgY29uc3QgaW50OF90IGVtcHR5Q291bnQsIGNvbnN0IHVpbnQzMl90IGNvbG9yS2V5KToKKyAgICAgICAgICAgIGJpdG1hcFdpZHRoKGJpdG1hcFdpZHRoKSwgYml0bWFwSGVpZ2h0KGJpdG1hcEhlaWdodCksCisgICAgICAgICAgICBwaXhlbFdpZHRoKHBpeGVsV2lkdGgpLCBwaXhlbEhlaWdodChwaXhlbEhlaWdodCksCisgICAgICAgICAgICB4Q291bnQoeENvdW50KSwgeUNvdW50KHlDb3VudCksCisgICAgICAgICAgICBlbXB0eUNvdW50KGVtcHR5Q291bnQpLCBjb2xvcktleShjb2xvcktleSkgeyB9CisgICAgUGF0Y2hEZXNjcmlwdGlvbihjb25zdCBQYXRjaERlc2NyaXB0aW9uJiBkZXNjcmlwdGlvbik6CisgICAgICAgICAgICBiaXRtYXBXaWR0aChkZXNjcmlwdGlvbi5iaXRtYXBXaWR0aCksIGJpdG1hcEhlaWdodChkZXNjcmlwdGlvbi5iaXRtYXBIZWlnaHQpLAorICAgICAgICAgICAgcGl4ZWxXaWR0aChkZXNjcmlwdGlvbi5waXhlbFdpZHRoKSwgcGl4ZWxIZWlnaHQoZGVzY3JpcHRpb24ucGl4ZWxIZWlnaHQpLAorICAgICAgICAgICAgeENvdW50KGRlc2NyaXB0aW9uLnhDb3VudCksIHlDb3VudChkZXNjcmlwdGlvbi55Q291bnQpLAorICAgICAgICAgICAgZW1wdHlDb3VudChkZXNjcmlwdGlvbi5lbXB0eUNvdW50KSwgY29sb3JLZXkoZGVzY3JpcHRpb24uY29sb3JLZXkpIHsgfQorCisgICAgZmxvYXQgYml0bWFwV2lkdGg7CisgICAgZmxvYXQgYml0bWFwSGVpZ2h0OworICAgIGZsb2F0IHBpeGVsV2lkdGg7CisgICAgZmxvYXQgcGl4ZWxIZWlnaHQ7CisgICAgdWludDMyX3QgeENvdW50OworICAgIHVpbnQzMl90IHlDb3VudDsKKyAgICBpbnQ4X3QgZW1wdHlDb3VudDsKKyAgICB1aW50MzJfdCBjb2xvcktleTsKKworICAgIGJvb2wgb3BlcmF0b3I8KGNvbnN0IFBhdGNoRGVzY3JpcHRpb24mIHJocykgY29uc3QgeworICAgICAgICBMVEVfRkxPQVQoYml0bWFwV2lkdGgpIHsKKyAgICAgICAgICAgIExURV9GTE9BVChiaXRtYXBIZWlnaHQpIHsKKyAgICAgICAgICAgICAgICBMVEVfRkxPQVQocGl4ZWxXaWR0aCkgeworICAgICAgICAgICAgICAgICAgICBMVEVfRkxPQVQocGl4ZWxIZWlnaHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExURV9JTlQoeENvdW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFRFX0lOVCh5Q291bnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFRFX0lOVChlbXB0eUNvdW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVEVfSU5UKGNvbG9yS2V5KSByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KK307IC8vIHN0cnVjdCBQYXRjaERlc2NyaXB0aW9uCisKKy8qKgorICogQW4gT3BlbkdMIHBhdGNoLiBUaGlzIGNvb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A9IDA7CisgICAgdWludDMyX3QgY29sb3JLZXkgPSAwOworCisgICAgaWYgKHVpbnQ4X3QobnVtQ29sb3JzKSA8IHNpemVvZih1aW50MzJfdCkgKiA0KSB7CisgICAgICAgIGZvciAoaW50OF90IGkgPSAwOyBpIDwgbnVtQ29sb3JzOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChjb2xvcnNbaV0gPT0gMHgwKSB7CisgICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRRdWFkcysrOworICAgICAgICAgICAgICAgIGNvbG9yS2V5IHw9IDB4MSA8PCBpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLy8gSWYgdGhlIDlwYXRjaCBpcyBtYWRlIG9mIG9ubHkgdHJhbnNwYXJlbnQgcXVhZHMKKyAgICBpZiAodHJhbnNwYXJlbnRRdWFkcyA9PSBpbnQ4X3QoKHdpZHRoICsgMSkgKiAoaGVpZ2h0ICsgMSkpKSB7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIGNvbnN0IFBhdGNoRGVzY3JpcHRpb24gZGVzY3JpcHRpb24oYml0bWFwV2lkdGgsIGJpdG1hcEhlaWdodCwKKyAgICAgICAgICAgIHBpeGVsV2lkdGgsIHBpeGVsSGVpZ2h0LCB3aWR0aCwgaGVpZ2h0LCB0cmFuc3BhcmVudFF1YWRzLCBjb2xvcktleSk7CisKKyAgICBzc2l6ZV90IGluZGV4ID0gbUNhY2hlLmluZGV4T2ZLZXkoZGVzY3JpcHRpb24pOworICAgIFBhdGNoKiBtZXNoID0gTlVMTDsKKyAgICBpZiAoaW5kZXggPj0gMCkgeworICAgICAgICBtZXNoID0gbUNhY2hlLnZhbHVlQXQoaW5kZXgpOworICAgIH0KKworICAgIGlmICghbWVzaCkgeworICAgICAgICBQQVRDSF9MT0dEKCJOZXcgcGF0Y2ggbWVzaCAiCisgICAgICAgICAgICAgICAgInhDb3VudD0lZCB5Q291bnQ9JWQsIHc9JS4yZiBoPSUuMm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WludDo6Sm9pbiBqb2luOworICAgIFNrUGFpbnQ6OkNhcCBjYXA7CisgICAgU2tQYWludDo6U3R5bGUgc3R5bGU7CisgICAgZmxvYXQgbWl0ZXI7CisgICAgZmxvYXQgc3Ryb2tlV2lkdGg7CisKKyAgICBib29sIG9wZXJhdG9yPChjb25zdCBQYXRoQ2FjaGVFbnRyeSYgcmhzKSBjb25zdCB7CisgICAgICAgIExURV9JTlQocGF0aCkgeworICAgICAgICAgICAgTFRFX0lOVChqb2luKSB7CisgICAgICAgICAgICAgICAgTFRFX0lOVChjYXApIHsKKyAgICAgICAgICAgICAgICAgICAgTFRFX0lOVChzdHlsZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTFRFX0ZMT0FUKG1pdGVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFRFX0ZMT0FUKHN0cm9rZVdpZHRoKSByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KK307IC8vIHN0cnVjdCBQYXRoQ2FjaGVFbnRyeQorCisvKioKKyAqIEFscGhhIHRleHR1cmUgdXNlZCB0byByZXByZXNlbnQgYSBwYXRoLgorICovCitzdHJ1Y3QgUGF0aFRleHR1cmU6IHB1YmxpYyBUZXh0dXJlIHsKKyAgICBQYXRoVGV4dHVyZSgpOiBUZXh0dXJlKCkgeworICAgIH0KKworICAgIC8qKgorICAgICAqIExlZnQgY29vcmRpbmF0ZSBvZiB0aGUgcGF0aCBib3VuZHMuCisgICAgICovCisgICAgZmxvYXQgbGVmdDsKKyAgICAvKioKKyAgICAgKiBUb3AgY29vcmRpbmF0ZSBvZiB0aGUgcGF0aCBib3VuZHMuCisgICAgICovCisgICAgZmxvYXQgdG9wOworICAgIC8qKgorICAgICAqIE9mZnNldCB0byBkcmF3IHR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bSB7CitwdWJsaWM6CisgICAgLyoqCisgICAgICogQ3JlYXRlcyBhIG5ldyBwcm9ncmFtIHdpdGggdGhlIHNwZWNpZmllZCB2ZXJ0ZXggYW5kIGZyYWdtZW50CisgICAgICogc2hhZGVycyBzb3VyY2VzLgorICAgICAqLworICAgIFByb2dyYW0oY29uc3QgY2hhciogdmVydGV4LCBjb25zdCBjaGFyKiBmcmFnbWVudCk7CisgICAgdmlydHVhbCB+UHJvZ3JhbSgpOworCisgICAgLyoqCisgICAgICogQmluZHMgdGhpcyBwcm9ncmFtIHRvIHRoZSBHTCBjb250ZXh0LgorICAgICAqLworICAgIHZpcnR1YWwgdm9pZCB1c2UoKTsKKworICAgIC8qKgorICAgICAqIE1hcmtzIHRoaXMgcHJvZ3JhbSBhcyB1bnVzZWQuIFRoaXMgd2lsbCBub3QgdW5iaW5kCisgICAgICogdGhlIHByb2dyYW0gZnJvbSB0aGUgR0wgY29udGV4dC4KKyAgICAgKi8KKyAgICB2aXJ0dWFsIHZvaWQgcmVtb3ZlKCk7CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBPcGVuR0wgbmFtZSBvZiB0aGUgc3BlY2lmaWVkIGF0dHJpYnV0ZS4KKyAgICAgKi8KKyAgICBpbnQgZ2V0QXR0cmliKGNvbnN0IGNoYXIqIG5hbWUpOworCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgT3BlbkdMIG5hbWUgb2YgdGhlIHNwZWNpZmllZCB1bmlmb3JtLgorICAgICAqLworICAgIGludCBnZXRVbmlmb3JtKGNvbnN0IGNoYXIqIG5hbWUpOworCisgICAgLyoqCisgICAgICogSW5kaWNhdGVzIHdoZXRoZXIgdGhpcyBwcm9ncmFtIGlzIGN1cnJlbnRseSBpbiB1c2Ugd2l0aAorICAgICAqIHRoZSBHTCBjb250ZXh0LgorICAgICAqLworICAgIGlubGluZSBib29sIGlzSW5Vc2UoKSBjb25zdCB7CisgICAgICAgIHJldHVybiBtVXNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEJpbmRzIHRoZSBwcm9ncmFtIHdpdGggdGhlIHNwZWNpZmllZCBwcm9qZWN0aW9uLCBtb2RlbFZpZXcgYW5kCisgICAgICogdHJhbnNmb3JtIG1hdHJpY2VzLgorICAgICAqLworICAgIHZvaWQgc2V0KGNvbnN0IG1hdDQmIHByb2plY3Rpb25NYXRyaXgsIGNvbnN0IG1hdDQmIG1vZGVsVmlld01hdHJpeCwKKyAgICAgICAgICAgICBjb25zdCBtYXQ0JiB0cmFuc2Zvcm1NYXRyaXgpOworCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgY29sb3IgYXNzb2NpYXRlZCB3aXRoIHRoaXMgc2hhZGVyLgorICAgICAqLworICAgIHZvaWQgc2V0Q29sb3IoY29uc3QgZmxvYXQgciwgY29uc3QgZmxvYXQgZywgY29uc3QgZmxvYXQgYiwgY29uc3QgZmxvYXQgYSk7CisKKyAgICAvKioKKyAgICAgKiBOYW1lIG9mIHRoZSBwb3NpdGlvbiBhdHRyaWJ1dGUuCisgICAgICovCisgICAgaW50IHBvc2l0aW9uOworCisgICAgLyoqCisgICAgICogTmFtZSBvZiB0aGUgdHJhbnNmb3JtIHVuaWZvcm0uCisgICAgICovCisgICAgaW50IHRyYW5zZm9ybTsKKworcHJvdGVjdGVkOgorICAgIC8qKgorICAgICAqIEFkZHMgYW4gYXR0cmlidXRlIHdpdGggdGhlIHNwZWNpZmllZCBuYW1lLgorICAgICAqCisgICAgICogQHJldHVybiBUaGUgT3BlbkdMIG5hbWUgb2YgdGhlIGF0dHJpYnV0ZS4KKyAgICAgKi8KKyAgICBpbnQgYWRkQXR0cmliKGNvbnN0IGNoYXIqIG5hbWUpOworCisgICAgLyoqCisgICAgICogQWRkcyBhIHVuaWZvcm0gd2l0aCB0aGUgc3BlY2lmaWVkIG5hbWUuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIFRoZSBPcGVuR0wgbmFtZSBvZiB0aGUgdW5pZm9ybS4KKyAgIC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QorICAgICAgICAiXG52b2lkIG1haW4odm9pZCkge1xuIgorICAgICAgICAiICAgIGdsX0ZyYWdDb2xvciA9IGNvbG9yICogdGV4dHVyZTJEKHNhbXBsZXIsIG91dFRleENvb3JkcykuYTtcbiIKKyAgICAgICAgIn1cblxuIjsKK2NvbnN0IGNoYXIqIGdGU19GYXN0X1NpbmdsZUdyYWRpZW50ID0KKyAgICAgICAgIlxudm9pZCBtYWluKHZvaWQpIHtcbiIKKyAgICAgICAgIiAgICBnbF9GcmFnQ29sb3IgPSB0ZXh0dXJlMkQoZ3JhZGllbnRTYW1wbGVyLCBsaW5lYXIpO1xuIgorICAgICAgICAifVxuXG4iOworY29uc3QgY2hhciogZ0ZTX0Zhc3RfU2luZ2xlTW9kdWxhdGVHcmFkaWVudCA9CisgICAgICAgICJcbnZvaWQgbWFpbih2b2lkKSB7XG4iCisgICAgICAgICIgICAgZ2xfRnJhZ0NvbG9yID0gY29sb3IuYSAqIHRleHR1cmUyRChncmFkaWVudFNhbXBsZXIsIGxpbmVhcik7XG4iCisgICAgICAgICJ9XG5cbiI7CisKKy8vIEdlbmVyYWwgY2FzZQorY29uc3QgY2hhciogZ0ZTX01haW5fRmV0Y2hDb2xvciA9CisgICAgICAgICIgICAgZnJhZ0NvbG9yID0gY29sb3I7XG4iOworY29uc3QgY2hhciogZ0ZTX01haW5fRmV0Y2hUZXh0dXJlWzJdID0geworICAgICAgICAvLyBEb24ndCBtb2R1bGF0ZQorICAgICAgICAiICAgIGZyYWdDb2xvciA9IHRleHR1cmUyRChzYW1wbGVyLCBvdXRUZXhDb29yZHMpO1xuIiwKKyAgICAgICAgLy8gTW9kdWxhdGUKKyAgICAgICAgIiAgICBmcmFnQ29sb3IgPSBjb2xvciAqIHRleHR1cmUyRChzYW1wbGVyLCBvdXRUZXhDb29yZHMpO1xuIgorfTsKK2NvbnN0IGNoYXIqIGdGU19NYWluX0ZldGNoQThUZXh0dXJlWzJdID0geworICAgICAgICAvLyBEb24ndCBtb2R1b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IGJpdG1hcENvbG9yID0gdGV4dHVyZTJEKGJpdG1hcFNhbXBsZXIsIHdyYXAob3V0Qml0bWFwVGV4Q29vcmRzKSk7XG4iOworY29uc3QgY2hhciogZ0ZTX01haW5fQmxlbmRTaGFkZXJzQkcgPQorICAgICAgICAiICAgIGZyYWdDb2xvciA9IGJsZW5kU2hhZGVycyhncmFkaWVudENvbG9yLCBiaXRtYXBDb2xvcikiOworY29uc3QgY2hhciogZ0ZTX01haW5fQmxlbmRTaGFkZXJzR0IgPQorICAgICAgICAiICAgIGZyYWdDb2xvciA9IGJsZW5kU2hhZGVycyhiaXRtYXBDb2xvciwgZ3JhZGllbnRDb2xvcikiOworY29uc3QgY2hhciogZ0ZTX01haW5fQmxlbmRTaGFkZXJzX01vZHVsYXRlWzNdID0geworICAgICAgICAvLyBEb24ndCBtb2R1bGF0ZQorICAgICAgICAiO1xuIiwKKyAgICAgICAgLy8gTW9kdWxhdGUKKyAgICAgICAgIiAqIGZyYWdDb2xvci5hO1xuIiwKKyAgICAgICAgLy8gTW9kdWxhdGUgd2l0aCBhbHBoYSA4IHRleHR1cmUKKyAgICAgICAgIiAqIHRleHR1cmUyRChzYW1wbGVyLCBvdXRUZXhDb29yZHMpLmE7XG4iCit9OworY29uc3QgY2hhciogZ0ZTX01haW5fR3JhZGllbnRTaGFkZXJfTW9kdWxhdGVbM10gPSB7CisgICAgICAgIC8vIERvbid0IG1vZHVsYXRlCisgICAgICAgICIgICAgZnJhZ0NvbG9yID0gZ3JhZGllbnRDb2xvcjtcbiIsCisgICAgICAgIC8vIE1vZHVsYXRlCisgICAgICAgICIgICAgZnJhZ0NvbG9yID0gZ3JhZGllbnRDb2xvciAqIGZyYWdDb2xvci5hO1xuIiwKKyAgICAgICAgLy8gTW9kdWxhdGUgd2l0aCBhbHBoYSA4IHRleHR1cmUKKyAgICAgICAgIiAgICBmcmFnQ29sb3IgPSBncmFkaWVudENvbG9yICogdGV4dHVyZTJEKHNhbXBsZXIsIG91dFRleENvb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4iLAorICAgICAgICAvLyBEc3QKKyAgICAgICAgInJldHVybiBkc3Q7XG4iLAorICAgICAgICAvLyBTcmNPdmVyCisgICAgICAgICJyZXR1cm4gc3JjICsgZHN0ICogKDEuMCAtIHNyYy5hKTtcbiIsCisgICAgICAgIC8vIERzdE92ZXIKKyAgICAgICAgInJldHVybiBkc3QgKyBzcmMgKiAoMS4wIC0gZHN0LmEpO1xuIiwKKyAgICAgICAgLy8gU3JjSW4KKyAgICAgICAgInJldHVybiBzcmMgKiBkc3QuYTtcbiIsCisgICAgICAgIC8vIERzdEluCisgICAgICAgICJyZXR1cm4gZHN0ICogc3JjLmE7XG4iLAorICAgICAgICAvLyBTcmNPdXQKKyAgICAgICAgInJldHVybiBzcmMgKiAoMS4wIC0gZHN0LmEpO1xuIiwKKyAgICAgICAgLy8gRHN0T3V0CisgICAgICAgICJyZXR1cm4gZHN0ICogKDEuMCAtIHNyYy5hKTtcbiIsCisgICAgICAgIC8vIFNyY0F0b3AKKyAgICAgICAgInJldHVybiB2ZWM0KHNyYy5yZ2IgKiBkc3QuYSArICgxLjAgLSBzcmMuYSkgKiBkc3QucmdiLCBkc3QuYSk7XG4iLAorICAgICAgICAvLyBEc3RBdG9wCisgICAgICAgICJyZXR1cm4gdmVjNChkc3QucmdiICogc3JjLmEgKyAoMS4wIC0gZHN0LmEpICogc3JjLnJnYiwgc3JjLmEpO1xuIiwKKyAgICAgICAgLy8gWG9yCisgICAgICAgICJyZXR1cm4gdmVjNChzcmMucmdiICogKDEuMCAtIGRzdC5hKSArICgxLjAgLSBzcmMuYSkgKiBkc3QucmdiLCAiCisgICAgICAgICAgICAgICAgInNyYy5hICsgZHN0LmEgLSAyLjAgKiBzcmMuYSAqIGRzdC5hKTtcbiIsCisgICAgICAgIC8vIEFkZAorICAgICAgICAicmV0dXJuIG1pbihzcmMgKyBkc3QsIDEuMCk7XG4iLAorICAgICAgICAvLyBNdWx0aXBseQorICAgICAgICAicmV0dXJuIHNyYyAqIGRzdDtcbiIsCisgICAgICAgIC8vIFNjcmVlbgorICAgICAgICAicmV0dXJuIHNyYyArIGRzdCAtIHNyYyAqIGRzdDtcbiIsCisgICAgICAgIC8vIE92ZXJsYXkKKyAgICAgICAgInJldHVybiBjbGFtcCh2ZWM0KG1peCgiCisgICAgICAgICAgICAgICAgIjIuMCAqIHNyYy5yZ2IgKiBkc3QucmdiICsgc3JjLnJnYiAqICgxLjAgLSBkc3QuYSkgKyBkc3QucmdiICogKDEuMCAtIHNyYy5hKSwgIgorICAgICAgICAgICAgICAgICJzcmMuYSAqIGRzdC5hIC0gMi4wICogKGRzdC5hIC0gZHN0LnJnYikgKiAoc3JjLmEgLSBzcmMucmdiKSArIHNyYy5yZ2IgKiAoMS4wIC0gZHN0LmEpICsgZHN0LnJnYiAqICgxLjAgLSBzcmMuYSksICIKKyAgICAgICAgICAgICAgICAic3RlcChkc3QuYSwgMi4wICogZHN0LnJnYikpLCAiCisgICAgICAgICAgICAgICAgInNyYy5hICsgZHN0LmEgLSBzcmMuYSAqIGRzdC5hKSwgMC4wLCAxLjApO1xuIiwKKyAgICAgICAgLy8gRGFya2VuCisgICAgICAgICJyZXR1cm4gdmVjNChzcmMucmdiICogKDEuMCAtIGRzdC5hKSArICgxLjAgLSBzcmMuYSkgKiBkc3QucmdiICsgIgorICAgICAgICAgICAgICAgICJtaW4oc3JjLnJnYiAqIGRzdC5hLCBkc3QucmdiICogc3JjLmEpLCBzcmMuYSArIGRzdC5hIC0gc3JjLmEgKiBkc3QuYSk7XG4iLAorICAgICAgICAvLyBMaWdodGVuCisgICAgICAgICJyZXR1cm4gdmVjNChzcmMucmdiICogKDEuMCAtIGRzdC5hKSArICgxLjAgLSBzcmMuYSkgKiBkc3QucmdiICsgIgorICAgICAgICAgICAgICAgICJtYXgoc3JjLnJnYiAqIGRzdC5hLCBkc3QucmdiICogc3JjLmEpLCBzcmMuYSArIGRzdC5hIC0gc3JjLmEgKiBkc3QuYSk7XG4iLAorfTsKKworLy8vLy8vLy8v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Xh0dXJlICYmCisgICAgICAgICAgICAgICAgZGVzY3JpcHRpb24uaGFzR3JhZGllbnQgJiYgIWRlc2NyaXB0aW9uLmhhc0JpdG1hcCAmJgorICAgICAgICAgICAgICAgIGRlc2NyaXB0aW9uLmdyYWRpZW50VHlwZSA9PSBQcm9ncmFtRGVzY3JpcHRpb246OmtHcmFkaWVudExpbmVhcjsKKworICAgICAgICBpZiAoc2luZ2xlQ29sb3IpIHsKKyAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX0Zhc3RfU2luZ2xlQ29sb3IpOworICAgICAgICAgICAgZmFzdCA9IHRydWU7CisgICAgICAgIH0gZWxzZSBpZiAoc2luZ2xlVGV4dHVyZSkgeworICAgICAgICAgICAgaWYgKCFkZXNjcmlwdGlvbi5tb2R1bGF0ZSkgeworICAgICAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX0Zhc3RfU2luZ2xlVGV4dHVyZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX0Zhc3RfU2luZ2xlTW9kdWxhdGVUZXh0dXJlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZhc3QgPSB0cnVlOworICAgICAgICB9IGVsc2UgaWYgKHNpbmdsZUE4VGV4dHVyZSkgeworICAgICAgICAgICAgaWYgKCFkZXNjcmlwdGlvbi5tb2R1bGF0ZSkgeworICAgICAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX0Zhc3RfU2luZ2xlQThUZXh0dXJlKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2hhZGVyLmFwcGVuZChnRlNfRmFzdF9TaW5nbGVNb2R1bGF0ZUE4VGV4dHVyZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmYXN0ID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIGlmIChzaW5nbGVHcmFkaWVudCkgeworICAgICAgICAgICAgaWYgKCFkZXNjcmlwdGlvbi5tb2R1bGF0ZSkgeworICAgICAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX0Zhc3RfU2luZ2xlR3JhZGllbnQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzaGFkZXIuYXBwZW5kKGdGU19GYXN0X1NpbmdsZU1vZHVsYXRlR3JhZGllbnQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmFzdCA9IHRydWU7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZmFzdCkgeworICAgICAgICAgICAgaWYgKERFQlVHX1BST0dSQU1fQ0FDSEUpIHsKKyAgICAgICAgICAgICAgICBQUk9HUkFNX0xPR0QoIioqKiBGYXN0IGNhc2U6XG4iKTsKKyAgICAgICAgICAgICAgICBQUk9HUkFNX0xPR0QoIioqKiBHZW5lcmF0ZWQgZnJhZ21lbnQgc2hhZGVyOlxuXG4iKTsKKyAgICAgICAgICAgICAgICBwcmludExvbmdTdHJpbmcoc2hhZGVyKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHNoYWRlcjsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChkZXNjcmlwdGlvbi5oYXNCaXRtYXApIHsKKyAgICAgICAgc2hhZGVyLmFwcGVuZChnRlNfVW5pZm9ybXNfQml0bWFwU2FtcGxlcik7CisgICAgfQorICAgIHNoYWRlci5hcHBlbmQoZ0ZTX1VuaWZvcm1zX0NvbG9yT3BbZGVzY3JpcHRpb24uY29sb3JPcF0pOworCisgICAgLy8gR2VuZXJhdGUgcmVxdWlyZWQgZnVuY3Rpb25zCisgICAgaWYgKGRlc2NyaXB0aW9uLmhhc0dyYWRpZW50ICYmIGRlc2NyaXB0aW9uLmhhc0JpdG1hcCkgeworICAgICAgICBnZW5lcmF0ZUJsZW5kKHNoYWRlciwgImJsZW5kU2hhZGVycyIsIGRlc2NyaXB0aW9uLnNoYWRlcnNNb2RlKTsKKyAg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vZHVsYXRlT3BdKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGlmICgoIWRlc2NyaXB0aW9uLmhhc0dyYWRpZW50ICYmICFkZXNjcmlwdGlvbi5oYXNCaXRtYXApIHx8IGRlc2NyaXB0aW9uLm1vZHVsYXRlKSB7CisgICAgICAgICAgICAgICAgc2hhZGVyLmFwcGVuZChnRlNfTWFpbl9GZXRjaENvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoZGVzY3JpcHRpb24uaGFzR3JhZGllbnQpIHsKKyAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX01haW5fRmV0Y2hHcmFkaWVudFtkZXNjcmlwdGlvbi5ncmFkaWVudFR5cGVdKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZGVzY3JpcHRpb24uaGFzQml0bWFwKSB7CisgICAgICAgICAgICBpZiAoIWRlc2NyaXB0aW9uLmlzQml0bWFwTnBvdCkgeworICAgICAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX01haW5fRmV0Y2hCaXRtYXApOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzaGFkZXIuYXBwZW5kKGdGU19NYWluX0ZldGNoQml0bWFwTnBvdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8gQ2FzZSB3aGVuIHdlIGhhdmUgdHdvIHNoYWRlcnMgc2V0CisgICAgICAgIGlmIChkZXNjcmlwdGlvbi5oYXNHcmFkaWVudCAmJiBkZXNjcmlwdGlvbi5oYXNCaXRtYXApIHsKKyAgICAgICAgICAgIGludCBvcCA9IGRlc2NyaXB0aW9uLmhhc0FscGhhOFRleHR1cmUgPyBNT0RVTEFURV9PUF9NT0RVTEFURV9BOCA6IG1vZHVsYXRlT3A7CisgICAgICAgICAgICBpZiAoZGVzY3JpcHRpb24uaXNCaXRtYXBGaXJzdCkgeworICAgICAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX01haW5fQmxlbmRTaGFkZXJzQkcpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzaGFkZXIuYXBwZW5kKGdGU19NYWluX0JsZW5kU2hhZGVyc0dCKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX01haW5fQmxlbmRTaGFkZXJzX01vZHVsYXRlW29wXSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAoZGVzY3JpcHRpb24uaGFzR3JhZGllbnQpIHsKKyAgICAgICAgICAgICAgICBpbnQgb3AgPSBkZXNjcmlwdGlvbi5oYXNBbHBoYThUZXh0dXJlID8gTU9EVUxBVEVfT1BfTU9EVUxBVEVfQTggOiBtb2R1bGF0ZU9wOworICAgICAgICAgICAgICAgIHNoYWRlci5hcHBlbmQoZ0ZTX01haW5fR3JhZGllbnRTaGFkZXJfTW9kdWxhdGVbb3BdKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoZGVzY3JpcHRpb24uaGFzQml0bWFwKSB7CisgICAgICAgICAgICAgICAgaW50IG9wID0gZGVzY3JpcHRpb24uaGFzQWxwaGE4VGV4dHVyZSA/IE1PRFVMQVRFX09QX01PRFVMQVRFX0E4IDogbW9kdWxhdGVPcDsKKyAgICAgICAgICAgICAgICBzaGFkZXIuYXBwZW5kKGdGU19NYWluX0JpdG1hcFNoYWRlcl9Nb2R1bGF0ZVtvcF0pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vIEFwcGx5IHRoZSBjb2xvciBvcCBpZiBuZWVkZWQKKyAgICAgICAgc2hhZGVyLmFwcGVuZChnRlNfTWFpbl9BcHBseUNvbG9yT3BbZGVzY3JpcHRpb24uY29sb3JPcF0pOworICAgICAgICAvLyBPdXRwdXQgdGhlIGZyYWdtZW50CisgICAgICAgIGlmICghYmxlbmRGcmFtZWJ1ZmZl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2hhZGVyLmFwcGVuZCgiXG52ZWMyIHdyYXAodmVjMiB0ZXhDb29yZHMpIHtcbiIpOworICAgIGlmICh3cmFwUyA9PSBHTF9NSVJST1JFRF9SRVBFQVQpIHsKKyAgICAgICAgc2hhZGVyLmFwcGVuZCgiICAgIGZsb2F0IHhNb2QyID0gbW9kKHRleENvb3Jkcy54LCAyLjApO1xuIik7CisgICAgICAgIHNoYWRlci5hcHBlbmQoIiAgICBpZiAoeE1vZDIgPiAxLjApIHhNb2QyID0gMi4wIC0geE1vZDI7XG4iKTsKKyAgICB9CisgICAgaWYgKHdyYXBUID09IEdMX01JUlJPUkVEX1JFUEVBVCkgeworICAgICAgICBzaGFkZXIuYXBwZW5kKCIgICAgZmxvYXQgeU1vZDIgPSBtb2QodGV4Q29vcmRzLnksIDIuMCk7XG4iKTsKKyAgICAgICAgc2hhZGVyLmFwcGVuZCgiICAgIGlmICh5TW9kMiA+IDEuMCkgeU1vZDIgPSAyLjAgLSB5TW9kMjtcbiIpOworICAgIH0KKyAgICBzaGFkZXIuYXBwZW5kKCIgICAgcmV0dXJuIHZlYzIoIik7CisgICAgc3dpdGNoICh3cmFwUykgeworICAgICAgICBjYXNlIEdMX0NMQU1QX1RPX0VER0U6CisgICAgICAgICAgICBzaGFkZXIuYXBwZW5kKCJ0ZXhDb29yZHMueCIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgR0xfUkVQRUFUOgorICAgICAgICAgICAgc2hhZGVyLmFwcGVuZCgibW9kKHRleENvb3Jkcy54LCAxLjApIik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBHTF9NSVJST1JFRF9SRVBFQVQ6CisgICAgICAgICAgICBzaGFkZXIuYXBwZW5kKCJ4TW9kMiIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHNoYWRlci5hcHBlbmQoIiwgIik7CisgICAgc3dpdGNoICh3cmFwVCkgeworICAgICAgICBjYXNlIEdMX0NMQU1QX1RPX0VER0U6CisgICAgICAgICAgICBzaGFkZXIuYXBwZW5kKCJ0ZXhDb29yZHMueSIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgR0xfUkVQRUFUOgorICAgICAgICAgICAgc2hhZGVyLmFwcGVuZCgibW9kKHRleENvb3Jkcy55LCAxLjApIik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBHTF9NSVJST1JFRF9SRVBFQVQ6CisgICAgICAgICAgICBzaGFkZXIuYXBwZW5kKCJ5TW9kMiIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHNoYWRlci5hcHBlbmQoIik7XG4iKTsKKyAgICBzaGFkZXIuYXBwZW5kKCJ9XG4iKTsKK30KKwordm9pZCBQcm9ncmFtQ2FjaGU6OnByaW50TG9uZ1N0cmluZyhjb25zdCBTdHJpbmc4JiBzaGFkZXIpIGNvbnN0IHsKKyAgICBzc2l6ZV90IGluZGV4ID0gMDsKKyAgICBzc2l6ZV90IGxhc3RJbmRleCA9IDA7CisgICAgY29uc3QgY2hhciogc3RyID0gc2hhZGVyLnN0cmluZygpOworICAgIHdoaWxlICgoaW5kZXggPSBzaGFkZXIuZmluZCgiXG4iLCBpbmRleCkpID4gLTEpIHsKKyAgICAgICAgU3RyaW5nOCBsaW5lKHN0ciwgaW5kZXggLSBsYXN0SW5kZXgpOworICAgICAgICBpZiAobGluZS5sZW5ndGgoKSA9PSAwKSBsaW5lLmFwcGVuZCgiXG4iKTsKKyAgICAgICAgUFJPR1JBTV9MT0dEKCIlcyIsIGxpbmUuc3RyaW5nKCkpOworICAgICAgICBpbmRleCsrOworICAgICAgICBzdHIgKz0gKGluZGV4IC0gbGFzdEluZGV4KTsKKyAgICAgICAgbGFzdEluZGV4ID0gaW5kZXg7CisgICAgfQorfQorCit9OyAvLyBuYW1lc3BhY2UgdWlyZW5kZXJlcgorfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL2xpYnMvaHd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0tFWV9BOF9URVhUVVJFOworICAgICAgICBpZiAoaGFzQml0bWFwKSB7CisgICAgICAgICAgICBrZXkgfD0gUFJPR1JBTV9LRVlfQklUTUFQOworICAgICAgICAgICAgaWYgKGlzQml0bWFwTnBvdCkgeworICAgICAgICAgICAgICAgIGtleSB8PSBQUk9HUkFNX0tFWV9CSVRNQVBfTlBPVDsKKyAgICAgICAgICAgICAgICBrZXkgfD0gZ2V0RW51bUZvcldyYXAoYml0bWFwV3JhcFMpIDw8IFBST0dSQU1fQklUTUFQX1dSQVBTX1NISUZUOworICAgICAgICAgICAgICAgIGtleSB8PSBnZXRFbnVtRm9yV3JhcChiaXRtYXBXcmFwVCkgPDwgUFJPR1JBTV9CSVRNQVBfV1JBUFRfU0hJRlQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKGhhc0dyYWRpZW50KSBrZXkgfD0gUFJPR1JBTV9LRVlfR1JBRElFTlQ7CisgICAgICAgIGtleSB8PSBwcm9ncmFtaWQoZ3JhZGllbnRUeXBlKSA8PCBQUk9HUkFNX0dSQURJRU5UX1RZUEVfU0hJRlQ7CisgICAgICAgIGlmIChpc0JpdG1hcEZpcnN0KSBrZXkgfD0gUFJPR1JBTV9LRVlfQklUTUFQX0ZJUlNUOworICAgICAgICBpZiAoaGFzQml0bWFwICYmIGhhc0dyYWRpZW50KSB7CisgICAgICAgICAgICBrZXkgfD0gKHNoYWRlcnNNb2RlICYgUFJPR1JBTV9NQVhfWEZFUk1PREUpIDw8IFBST0dSQU1fWEZFUk1PREVfU0hBREVSX1NISUZUOworICAgICAgICB9CisgICAgICAgIHN3aXRjaCAoY29sb3JPcCkgeworICAgICAgICAgICAgY2FzZSBrQ29sb3JNYXRyaXg6CisgICAgICAgICAgICAgICAga2V5IHw9IFBST0dSQU1fS0VZX0NPTE9SX01BVFJJWDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2Uga0NvbG9yTGlnaHRpbmc6Cisg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ICAgICAgICAgdWludDMyX3QoayAmIDB4ZmZmZmZmZmYpKTsKKyAgICB9CisKK3ByaXZhdGU6CisgICAgaW5saW5lIHVpbnQzMl90IGdldEVudW1Gb3JXcmFwKEdMZW51bSB3cmFwKSBjb25zdCB7CisgICAgICAgIHN3aXRjaCAod3JhcCkgeworICAgICAgICAgICAgY2FzZSBHTF9DTEFNUF9UT19FREdFOgorICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgY2FzZSBHTF9SRVBFQVQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgICBjYXNlIEdMX01JUlJPUkVEX1JFUEVBVDoKKyAgICAgICAgICAgICAgICByZXR1cm4gMjsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKK307IC8vIHN0cnVjdCBQcm9ncmFtRGVzY3JpcHRpb24KKworLyoqCisgKiBHZW5lcmF0ZXMgYW5kIGNhY2hlcyBwcm9ncmFtLiBQcm9ncmFtcyBhcmUgZ2VuZXJhdGVkIGJhc2VkIG9uCisgKiBQcm9ncmFtRGVzY3JpcHRpb25zLgorICovCitjbGFzcyBQcm9ncmFtQ2FjaGUgeworcHVibGljOgorICAgIFByb2dyYW1DYWNoZSgpOworICAgIH5Qcm9ncmFtQ2FjaGUoKTsKKworICAgIFByb2dyYW0qIGdldChjb25zdCBQcm9ncmFtRGVzY3JpcHRpb24mIGRlc2NyaXB0aW9uKTsKKworICAgIHZvaWQgY2xlYXIoKTsKKworcHJpdmF0ZToKKyAgICBQcm9ncmFtKiBnZW5lcmF0ZVByb2dyYW0oY29uc3QgUHJvZ3JhbURlc2NyaXB0aW9uJiBkZXNjcmlwdGlvbiwgcHJvZ3JhbWlkIGtleSk7CisgICAgU3RyaW5nOCBnZW5lcmF0ZVZlcnRleFNoYWRlcihjb25zdCBQcm9ncmFtRGVzY3JpcHRpb24mIGRlc2NyaXB0aW9uKTsKKyAgICBTdHJpbmc4IGdlbmVyYXRlRnJh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SZWdpb24KKyAgICB0eXBlZGVmIGZsb2F0IHZhbHVlX3R5cGU7CisKKyAgICBpbmxpbmUgUmVjdCgpOgorICAgICAgICAgICAgbGVmdCgwKSwKKyAgICAgICAgICAgIHRvcCgwKSwKKyAgICAgICAgICAgIHJpZ2h0KDApLAorICAgICAgICAgICAgYm90dG9tKDApIHsKKyAgICB9CisKKyAgICBpbmxpbmUgUmVjdChmbG9hdCBsZWZ0LCBmbG9hdCB0b3AsIGZsb2F0IHJpZ2h0LCBmbG9hdCBib3R0b20pOgorICAgICAgICAgICAgbGVmdChsZWZ0KSwKKyAgICAgICAgICAgIHRvcCh0b3ApLAorICAgICAgICAgICAgcmlnaHQocmlnaHQpLAorICAgICAgICAgICAgYm90dG9tKGJvdHRvbSkgeworICAgIH0KKworICAgIGlubGluZSBSZWN0KGZsb2F0IHdpZHRoLCBmbG9hdCBoZWlnaHQpOgorICAgICAgICAgICAgbGVmdCgwLjBmKSwKKyAgICAgICAgICAgIHRvcCgwLjBmKSwKKyAgICAgICAgICAgIHJpZ2h0KHdpZHRoKSwKKyAgICAgICAgICAgIGJvdHRvbShoZWlnaHQpIHsKKyAgICB9CisKKyAgICBpbmxpbmUgUmVjdChjb25zdCBSZWN0JiByKSB7CisgICAgICAgIHNldChyKTsKKyAgICB9CisKKyAgICBpbmxpbmUgUmVjdChSZWN0JiByKSB7CisgICAgICAgIHNldChyKTsKKyAgICB9CisKKyAgICBSZWN0JiBvcGVyYXRvcj0oY29uc3QgUmVjdCYgcikgeworICAgICAgICBzZXQocik7CisgICAgICAgIHJldHVybiAqdGhpczsKKyAgICB9CisKKyAgICBSZWN0JiBvcGVyYXRvcj0oUmVjdCYgcikgeworICAgICAgICBzZXQocik7CisgICAgICAgIHJldHVybiAqdGhpczsKKyAgICB9CisKKyAgICBmcmllbmQgaW50IG9wZXJhdG9yPT0oY29uc3QgUmVjdCYgYSwgY29uc3QgUmVjdCYgYikgeworICAgICAgICByZXR1cm4gIW1lbWNtcCgmYSwgJ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LT5yaWdodCA+IHJpZ2h0KSB0aGlzLT5yaWdodCA9IHJpZ2h0OworICAgICAgICAgICAgaWYgKHRoaXMtPmJvdHRvbSA+IGJvdHRvbSkgdGhpcy0+Ym90dG9tID0gYm90dG9tOworCisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgYm9vbCBpbnRlcnNlY3QoY29uc3QgUmVjdCYgcikgeworICAgICAgICByZXR1cm4gaW50ZXJzZWN0KHIubGVmdCwgci50b3AsIHIucmlnaHQsIHIuYm90dG9tKTsKKyAgICB9CisKKyAgICBib29sIHVuaW9uV2l0aChjb25zdCBSZWN0JiByKSB7CisgICAgICAgIGlmIChyLmxlZnQgPCByLnJpZ2h0ICYmIHIudG9wIDwgci5ib3R0b20pIHsKKyAgICAgICAgICAgIGlmIChsZWZ0IDwgcmlnaHQgJiYgdG9wIDwgYm90dG9tKSB7CisgICAgICAgICAgICAgICAgaWYgKGxlZnQgPiByLmxlZnQpIGxlZnQgPSByLmxlZnQ7CisgICAgICAgICAgICAgICAgaWYgKHRvcCA+IHIudG9wKSB0b3AgPSByLnRvcDsKKyAgICAgICAgICAgICAgICBpZiAocmlnaHQgPCByLnJpZ2h0KSByaWdodCA9IHIucmlnaHQ7CisgICAgICAgICAgICAgICAgaWYgKGJvdHRvbSA8IHIuYm90dG9tKSBib3R0b20gPSByLmJvdHRvbTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbGVmdCA9IHIubGVmdDsKKyAgICAgICAgICAgICAgICB0b3AgPSByLnRvcDsKKyAgICAgICAgICAgICAgICByaWdodCA9IHIucmlnaHQ7CisgICAgICAgICAgICAgICAgYm90dG9tID0gci5ib3R0b207CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC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sKKyAgICAgICAgLy8gSWYgd2UncmUgbm90IHRyYWNraW5nIHRoaXMgcmVzb3VyY2UsIGp1c3QgZGVsZXRlIGl0CisgICAgICAgIGlmIChDYWNoZXM6Omhhc0luc3RhbmNlKCkpIHsKKyAgICAgICAgICAgIENhY2hlczo6Z2V0SW5zdGFuY2UoKS5ncmFkaWVudENhY2hlLnJlbW92ZShyZXNvdXJjZS0+Z2V0U2tTaGFkZXIoKSk7CisgICAgICAgIH0KKyAgICAgICAgZGVsZXRlIHJlc291cmNlOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHJlZi0+ZGVzdHJveWVkID0gdHJ1ZTsKKyAgICBpZiAocmVmLT5yZWZDb3VudCA9PSAwKSB7CisgICAgICAgIGRlbGV0ZVJlc291cmNlUmVmZXJlbmNlKHJlc291cmNlLCByZWYpOworICAgICAgICByZXR1cm47CisgICAgfQorfQorCit2b2lkIFJlc291cmNlQ2FjaGU6OmRlc3RydWN0b3IoU2tpYUNvbG9yRmlsdGVyKiByZXNvdXJjZSkgeworICAgIFJlc291cmNlUmVmZXJlbmNlKiByZWYgPSBtQ2FjaGUtPmluZGV4T2ZLZXkocmVzb3VyY2UpID49IDAgPyBtQ2FjaGUtPnZhbHVlRm9yKHJlc291cmNlKSA6IE5VTEw7CisgICAgaWYgKHJlZiA9PSBOVUxMKSB7CisgICAgICAgIC8vIElmIHdlJ3JlIG5vdCB0cmFja2luZyB0aGlzIHJlc291cmNlLCBqdXN0IGRlbGV0ZSBpdAorICAgICAgICBkZWxldGUgcmVzb3VyY2U7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgcmVmLT5kZXN0cm95ZWQgPSB0cnVlOworICAgIGlmIChyZWYtPnJlZkNvdW50ID09IDApIHsKKyAgICAgICAgZGVsZXRlUmVzb3VyY2VSZWZlcmVuY2UocmVzb3VyY2UsIHJlZik7CisgICAgICAgIHJldHVybjsKKyAgICB9Cit9CisKK3ZvaWQgUmVzb3VyY2VDYWNoZTo6ZGVsZXRlUmVzb3VyY2VSZWZlcmVuY2Uodm9pZCogcmVzb3VyY2UsIFJlc291cmNlUmVmZXJlbmNlKiByZWYpIHsKKyAgICBpZiAocmVmLT5yZWN5Y2xlZCAmJiByZWYtPnJlc291cmNlVHlwZSA9PSBrQml0bWFwKSB7CisgICAgICAgICgoU2tCaXRtYXAqKSByZXNvdXJjZSktPnNldFBpeGVscyhOVUxMLCBOVUxMKTsKKyAgICB9CisgICAgaWYgKHJlZi0+ZGVzdHJveWVkKSB7CisgICAgICAgIHN3aXRjaCAocmVmLT5yZXNvdXJjZVR5cGUpIHsKKyAgICAgICAgICAgIGNhc2Uga0JpdG1hcDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBTa0JpdG1hcCogYml0bWFwID0gKFNrQml0bWFwKilyZXNvdXJjZTsKKyAgICAgICAgICAgICAgICBpZiAoQ2FjaGVzOjpoYXNJbnN0YW5jZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIENhY2hlczo6Z2V0SW5zdGFuY2UoKS50ZXh0dXJlQ2FjaGUucmVtb3ZlKGJpdG1hcCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGRlbGV0ZSBiaXRtYXA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2Uga1NoYWRlcjoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBTa2lhU2hhZGVyKiBzaGFkZXIgPSAoU2tpYVNoYWRlciopcmVzb3VyY2U7CisgICAgICAgICAgICAgICAgaWYgKENhY2hlczo6aGFzSW5zdGFuY2UoKSkgeworICAgICAgICAgICAgICAgICAgICBDYWNoZXM6OmdldEluc3RhbmNlKCkuZ3JhZGllbnRDYWNoZS5yZW1vdmUoc2hhZGVyLT5nZXRTa1NoYWRlcigpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZGVsZXRlIHNoYWRlcjsKKyAgICAgICAgICAgIH0KKyAgICAg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JsZShzLT5pbnZpc2libGUpLCB2aWV3cG9ydChzLT52aWV3cG9ydCksIGhlaWdodChzLT5oZWlnaHQpIHsKKyAgICAgICAgaWYgKHNhdmVGbGFncyAmIFNrQ2FudmFzOjprTWF0cml4X1NhdmVGbGFnKSB7CisgICAgICAgICAgICBtVHJhbnNmb3JtUm9vdC5sb2FkKCpzLT50cmFuc2Zvcm0pOworICAgICAgICAgICAgdHJhbnNmb3JtID0gJm1UcmFuc2Zvcm1Sb290OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdHJhbnNmb3JtID0gcy0+dHJhbnNmb3JtOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHNhdmVGbGFncyAmIFNrQ2FudmFzOjprQ2xpcF9TYXZlRmxhZykgeworICAgICAgICAgICAgbUNsaXBSZWN0Um9vdC5zZXQoKnMtPmNsaXBSZWN0KTsKKyAgICAgICAgICAgIGNsaXBSZWN0ID0gJm1DbGlwUmVjdFJvb3Q7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBjbGlwUmVjdCA9IHMtPmNsaXBSZWN0OworICAgICAgICB9CisKKyAgICAgICAgaWYgKChzLT5mbGFncyAmIFNuYXBzaG90OjprRmxhZ0NsaXBTZXQpICYmCisgICAgICAgICAgICAgICAgIShzLT5mbGFncyAmIFNuYXBzaG90OjprRmxhZ0RpcnR5TG9jYWxDbGlwKSkgeworICAgICAgICAgICAgbUxvY2FsQ2xpcC5zZXQocy0+bUxvY2FsQ2xpcCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmbGFncyB8PSBTbmFwc2hvdDo6a0ZsYWdEaXJ0eUxvY2FsQ2xpcDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzLT5mbGFncyAmIFNuYXBzaG90OjprRmxhZ0Zib1RhcmdldCkgeworICAgICAgICAgICAgZmxhZ3MgfD0gU25hcHNob3Q6OmtGbGFnRmJvVGFyZ2V0OworICAgICAgICAgICAgcmVnaW9uID0gcy0+cmVnaW9uOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmVnaW9uID0gTlVMTDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFZhcmlvdXMgZmxhZ3Mgc2V0IG9uICNmbGFncy4KKyAgICAgKi8KKyAgICBlbnVtIEZsYWdzIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEluZGljYXRlcyB0aGF0IHRoZSBjbGlwIHJlZ2lvbiB3YXMgbW9kaWZpZWQuIFdoZW4gdGhpcworICAgICAgICAgKiBzbmFwc2hvdCBpcyByZXN0b3JlZCBzbyBtdXN0IHRoZSBjbGlwLgorICAgICAgICAgKi8KKyAgICAgICAga0ZsYWdDbGlwU2V0ID0gMHgxLAorICAgICAgICAvKioKKyAgICAgICAgICogSW5kaWNhdGVzIHRoYXQgdGhpcyBzbmFwc2hvdCB3YXMgY3JlYXRlZCB3aGVuIHNhdmluZworICAgICAgICAgKiBhIG5ldyBsYXllci4KKyAgICAgICAgICovCisgICAgICAgIGtGbGFnSXNMYXllciA9IDB4MiwKKyAgICAgICAgLyoqCisgICAgICAgICAqIEluZGljYXRlcyB0aGF0IHRoaXMgc25hcHNob3QgaXMgYSBzcGVjaWFsIHR5cGUgb2YgbGF5ZXIKKyAgICAgICAgICogYmFja2VkIGJ5IGFuIEZCTy4gVGhpcyBmbGFnIG9ubHkgbWFrZXMgc2Vuc2Ugd2hlbiB0aGUKKyAgICAgICAgICogZmxhZyBrRmxhZ0lzTGF5ZXIgaXMgYWxzbyBzZXQuCisgICAgICAgICAqLworICAgICAgICBrRmxhZ0lzRmJvTGF5ZXIgPSAweDQsCisgICAgICAgIC8qKgorICAgICAgICAgKiBJbmRpY2F0ZXMgdGhhdCB0aGUgbG9jYWwgY2xpcCBzaG91bGQgYmUgcmVjb21wdXRlZC4KKyAgICAgICAgICovCisgICAgICAgIGtGbGFnRGlydHlMb2NhbENsaXAgPSAweDgsCisgICAgICAgIC8qKgorICAgICAgICAgKiBJbmRpY2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vbldpdGgocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNrUmVnaW9uOjprWE9SX09wOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTa1JlZ2lvbjo6a1JldmVyc2VEaWZmZXJlbmNlX09wOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTa1JlZ2lvbjo6a1JlcGxhY2VfT3A6CisgICAgICAgICAgICAgICAgY2xpcFJlY3QtPnNldChyKTsKKyAgICAgICAgICAgICAgICBjbGlwcGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChjbGlwcGVkKSB7CisgICAgICAgICAgICBmbGFncyB8PSBTbmFwc2hvdDo6a0ZsYWdDbGlwU2V0IHwgU25hcHNob3Q6OmtGbGFnRGlydHlMb2NhbENsaXA7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gY2xpcHBlZDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXRzIHRoZSBjdXJyZW50IGNsaXAuCisgICAgICovCisgICAgdm9pZCBzZXRDbGlwKGZsb2F0IGxlZnQsIGZsb2F0IHRvcCwgZmxvYXQgcmlnaHQsIGZsb2F0IGJvdHRvbSkgeworICAgICAgICBjbGlwUmVjdC0+c2V0KGxlZnQsIHRvcCwgcmlnaHQsIGJvdHRvbSk7CisgICAgICAgIGZsYWdzIHw9IFNuYXBzaG90OjprRmxhZ0NsaXBTZXQgfCBTbmFwc2hvdDo6a0ZsYWdEaXJ0eUxvY2FsQ2xpcDsKKyAgICB9CisKKyAgICBjb25zdCBSZWN0JiBnZXRMb2NhbENsaXAoKSB7CisgICAgICAgIGlmIChmbGFncyAmIFNuYXBzaG90OjprRmxhZ0RpcnR5TG9jYWxDbGlwKSB7CisgICAgICAgICAgICBtYXQ0IGludmVyc2U7CisgICAgICAgICAgICBpbnZlcnNlLmxvYWRJbn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hlbiB0aGUgZmxhZyBrRmxhZ0lzRmJvTGF5ZXIgaXMgc2V0LgorICAgICAqLworICAgIEdMdWludCBmYm87CisKKyAgICAvKioKKyAgICAgKiBJbmRpY2F0ZXMgdGhhdCB0aGlzIHNuYXBzaG90IGlzIGludmlzaWJsZSBhbmQgbm90aGluZyBzaG91bGQgYmUgZHJhd24KKyAgICAgKiBpbnNpZGUgaXQuCisgICAgICovCisgICAgYm9vbCBpbnZpc2libGU7CisKKyAgICAvKioKKyAgICAgKiBDdXJyZW50IHZpZXdwb3J0LgorICAgICAqLworICAgIFJlY3Qgdmlld3BvcnQ7CisKKyAgICAvKioKKyAgICAgKiBIZWlnaHQgb2YgdGhlIGZyYW1lYnVmZmVyIHRoZSBzbmFwc2hvdCBpcyByZW5kZXJpbmcgaW50by4KKyAgICAgKi8KKyAgICBpbnQgaGVpZ2h0OworCisgICAgLyoqCisgICAgICogQ29udGFpbnMgdGhlIHByZXZpb3VzIG9ydGhvIG1hdHJpeC4KKyAgICAgKi8KKyAgICBtYXQ0IG9ydGhvTWF0cml4OworCisgICAgLyoqCisgICAgICogTG9jYWwgdHJhbnNmb3JtYXRpb24uIEhvbGRzIHRoZSBjdXJyZW50IHRyYW5zbGF0aW9uLCBzY2FsZSBhbmQKKyAgICAgKiByb3RhdGlvbiB2YWx1ZXMuCisgICAgICovCisgICAgbWF0NCogdHJhbnNmb3JtOworCisgICAgLyoqCisgICAgICogQ3VycmVudCBjbGlwIHJlZ2lvbi4gVGhlIGNsaXAgaXMgc3RvcmVkIGluIGNhbnZhcy1zcGFjZSBjb29yZGluYXRlcywKKyAgICAgKiAoc2NyZWVuLXNwYWNlIGNvb3JkaW5hdGVzIGluIHRoZSByZWd1bGFyIGNhc2UuKQorICAgICAqLworICAgIFJlY3QqIGNsaXBSZWN0OworCisgICAgLyoqCisgICAgICogVGhlIGFuY2VzdG9yIGxheWVyJ3MgZGlydHkgcmVnaW9uLi4KKyAgICAgKi8KKyAgICBSZWdpb24qIHJlZ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CBjb25zdCBjaGFyKiBzcmNUZXh0KToKKyAgICAgICAgICAgIHJhZGl1cyhyYWRpdXMpLCBsZW4obGVuKSB7CisgICAgICAgIHRleHQgPSBuZXcgY2hhcltsZW5dOworICAgICAgICBtZW1jcHkodGV4dCwgc3JjVGV4dCwgbGVuKTsKKworICAgICAgICB0ZXh0U2l6ZSA9IHBhaW50LT5nZXRUZXh0U2l6ZSgpOworICAgICAgICB0eXBlZmFjZSA9IHBhaW50LT5nZXRUeXBlZmFjZSgpOworCisgICAgICAgIGhhc2ggPSAwOworICAgICAgICB1aW50MzJfdCBtdWx0aXBsaWVyID0gMTsKKyAgICAgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7CisgICAgICAgICAgICBoYXNoICs9IHRleHRbaV0gKiBtdWx0aXBsaWVyOworICAgICAgICAgICAgdWludDMyX3Qgc2hpZnRlZCA9IG11bHRpcGxpZXIgPDwgNTsKKyAgICAgICAgICAgIG11bHRpcGxpZXIgPSBzaGlmdGVkIC0gbXVsdGlwbGllcjsKKyAgICAgICAgfQorICAgIH0KKworICAgIFNoYWRvd1RleHQoY29uc3QgU2hhZG93VGV4dCYgc2hhZG93KToKKyAgICAgICAgICAgIHJhZGl1cyhzaGFkb3cucmFkaXVzKSwgbGVuKHNoYWRvdy5sZW4pLCBoYXNoKHNoYWRvdy5oYXNoKSwKKyAgICAgICAgICAgIHRleHRTaXplKHNoYWRvdy50ZXh0U2l6ZSksIHR5cGVmYWNlKHNoYWRvdy50eXBlZmFjZSkgeworICAgICAgICB0ZXh0ID0gbmV3IGNoYXJbc2hhZG93Lmxlbl07CisgICAgICAgIG1lbWNweSh0ZXh0LCBzaGFkb3cudGV4dCwgc2hhZG93Lmxlbik7CisgICAgfQorCisgICAgflNoYWRvd1RleHQoKSB7CisgICAgICAgIGRlbGV0ZVtdIHRleHQ7CisgICAgfQorCisgICAgdWludDMyX3QgcmFkaXVzOworICAgIHVpbnQzMl90IGxlbjsKKyAgICB1aW50MzJfdCBoYXNoOworICAgIGZsb2F0IHRleHRTaXplOworICAgIFNrVHlwZWZhY2UqIHR5cGVmYWNlOworICAgIGNoYXIgKnRleHQ7CisKKyAgICBib29sIG9wZXJhdG9yPChjb25zdCBTaGFkb3dUZXh0JiByaHMpIGNvbnN0IHsKKyAgICAgICAgaWYgKGhhc2ggPCByaHMuaGFzaCkgcmV0dXJuIHRydWU7CisgICAgICAgIGVsc2UgaWYgKGhhc2ggPT0gcmhzLmhhc2gpIHsKKyAgICAgICAgICAgIGlmIChsZW4gPCByaHMubGVuKSByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIGVsc2UgaWYgKGxlbiA9PSByaHMubGVuKSB7CisgICAgICAgICAgICAgICAgaWYgKHJhZGl1cyA8IHJocy5yYWRpdXMpIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKHJhZGl1cyA9PSByaHMucmFkaXVzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0U2l6ZSA8IHJocy50ZXh0U2l6ZSkgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRleHRTaXplID09IHJocy50ZXh0U2l6ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVmYWNlIDwgcmhzLnR5cGVmYWNlKSByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHR5cGVmYWNlID09IHJocy50eXBlZmFjZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJuY21wKHRleHQsIHJocy50ZXh0LCBsZW4pIDwgMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorfTsgLy8gc3RydWN0IFNoYWRvd1RleHQ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leHR1cmUuCisgKi8KK3N0cnVjdCBUZXh0dXJlIHsKKyAgICBUZXh0dXJlKCkgeworICAgICAgICBjbGVhbnVwID0gZmFsc2U7CisgICAgICAgIGJpdG1hcFNpemUgPSAwOworICAgICAgICB3cmFwUyA9IEdMX0NMQU1QX1RPX0VER0U7CisgICAgICAgIHdyYXBUID0gR0xfQ0xBTVBfVE9fRURHRTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBOYW1lIG9mIHRoZSB0ZXh0dXJlLgorICAgICAqLworICAgIEdMdWludCBpZDsKKyAgICAvKioKKyAgICAgKiBHZW5lcmF0aW9uIG9mIHRoZSBiYWNraW5nIGJpdG1hcCwKKyAgICAgKi8KKyAgICB1aW50MzJfdCBnZW5lcmF0aW9uOworICAgIC8qKgorICAgICAqIEluZGljYXRlcyB3aGV0aGVyIHRoZSB0ZXh0dXJlIHJlcXVpcmVzIGJsZW5kaW5nLgorICAgICAqLworICAgIGJvb2wgYmxlbmQ7CisgICAgLyoqCisgICAgICogV2lkdGggb2YgdGhlIGJhY2tpbmcgYml0bWFwLgorICAgICAqLworICAgIHVpbnQzMl90IHdpZHRoOworICAgIC8qKgorICAgICAqIEhlaWdodCBvZiB0aGUgYmFja2luZyBiaXRtYXAuCisgICAgICovCisgICAgdWludDMyX3QgaGVpZ2h0OworICAgIC8qKgorICAgICAqIEluZGljYXRlcyB3aGV0aGVyIHRoaXMgdGV4dHVyZSBzaG91bGQgYmUgY2xlYW5lZCB1cCBhZnRlciB1c2UuCisgICAgICovCisgICAgYm9vbCBjbGVhbnVwOworICAgIC8qKgorICAgICAqIE9wdGlvbmFsLCBzaXplIG9mIHRoZSBvcmlnaW5hbCBiaXRtYXAuCisgICAgICovCisgICAgdWludDMyX3QgYml0bWFwU2l6ZTsKKworICAgIC8qKgorICAgICAqIExhc3Qgd3JhcCBtb2RlcyBzZXQgb24gdGhpcyB0ZXh0dXJlLiBEZWZhdWx0cyB0byBHTF9DTEFNUF9UT19FREdFLgorICAgICA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KCk7CisgICAgVGV4dHVyZSogdGV4dHVyZSA9IG1DYWNoZS5nZXQoYml0bWFwKTsKKyAgICBtTG9jay51bmxvY2soKTsKKworICAgIGlmICghdGV4dHVyZSkgeworICAgICAgICBpZiAoYml0bWFwLT53aWR0aCgpID4gbU1heFRleHR1cmVTaXplIHx8IGJpdG1hcC0+aGVpZ2h0KCkgPiBtTWF4VGV4dHVyZVNpemUpIHsKKyAgICAgICAgICAgIExPR1coIkJpdG1hcCB0b28gbGFyZ2UgdG8gYmUgdXBsb2FkZWQgaW50byBhIHRleHR1cmUiKTsKKyAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICB9CisKKyAgICAgICAgY29uc3QgdWludDMyX3Qgc2l6ZSA9IGJpdG1hcC0+cm93Qnl0ZXMoKSAqIGJpdG1hcC0+aGVpZ2h0KCk7CisgICAgICAgIC8vIERvbid0IGV2ZW4gdHJ5IHRvIGNhY2hlIGEgYml0bWFwIHRoYXQncyBiaWdnZXIgdGhhbiB0aGUgY2FjaGUKKyAgICAgICAgaWYgKHNpemUgPCBtTWF4U2l6ZSkgeworICAgICAgICAgICAgbUxvY2subG9jaygpOworICAgICAgICAgICAgd2hpbGUgKG1TaXplICsgc2l6ZSA+IG1NYXhTaXplKSB7CisgICAgICAgICAgICAgICAgbUNhY2hlLnJlbW92ZU9sZGVzdCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUxvY2sudW5sb2NrKCk7CisgICAgICAgIH0KKworICAgICAgICB0ZXh0dXJlID0gbmV3IFRleHR1cmU7CisgICAgICAgIHRleHR1cmUtPmJpdG1hcFNpemUgPSBzaXplOworICAgICAgICBnZW5lcmF0ZVRleHR1cmUoYml0bWFwLCB0ZXh0dXJlLCBmYWxzZSk7CisKKyAgICAgICAgaWYgKHNpemUgPCBtTWF4U2l6ZSkgeworICAgICAgICAgICAgbUxvY2subG9jaygpOworICAgICAgICAgICAgbVNpemUgKz0gc2l6ZTsKKyAgICAgICAgICAgIFRFWFRVUkV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R5cGVuYW1lIEssIHR5cGVuYW1lIFY+CitjbGFzcyBHZW5lcmF0aW9uQ2FjaGUgeworcHVibGljOgorICAgIEdlbmVyYXRpb25DYWNoZSh1aW50MzJfdCBtYXhDYXBhY2l0eSk7CisgICAgdmlydHVhbCB+R2VuZXJhdGlvbkNhY2hlKCk7CisKKyAgICBlbnVtIENhcGFjaXR5IHsKKyAgICAgICAga1VubGltaXRlZENhcGFjaXR5LAorICAgIH07CisKKyAgICB2b2lkIHNldE9uRW50cnlSZW1vdmVkTGlzdGVuZXIoT25FbnRyeVJlbW92ZWQ8SywgVj4qIGxpc3RlbmVyKTsKKworICAgIHZvaWQgY2xlYXIoKTsKKworICAgIGJvb2wgY29udGFpbnMoSyBrZXkpIGNvbnN0OworICAgIFYgZ2V0KEsga2V5KTsKKyAgICBLIGdldEtleUF0KHVpbnQzMl90IGluZGV4KSBjb25zdDsKKyAgICBib29sIHB1dChLIGtleSwgViB2YWx1ZSk7CisgICAgViByZW1vdmUoSyBrZXkpOworICAgIFYgcmVtb3ZlT2xkZXN0KCk7CisgICAgViBnZXRWYWx1ZUF0KHVpbnQzMl90IGluZGV4KSBjb25zdDsKKworICAgIHVpbnQzMl90IHNpemUoKSBjb25zdDsKKworICAgIHZvaWQgYWRkVG9DYWNoZShzcDxFbnRyeTxLLCBWPiA+IGVudHJ5LCBLIGtleSwgViB2YWx1ZSk7CisgICAgdm9pZCBhdHRhY2hUb0NhY2hlKHNwPEVudHJ5PEssIFY+ID4gZW50cnkpOworICAgIHZvaWQgZGV0YWNoRnJvbUNhY2hlKHNwPEVudHJ5PEssIFY+ID4gZW50cnkpOworCisgICAgViByZW1vdmVBdChzc2l6ZV90IGluZGV4KTsKKworICAgIEtleWVkVmVjdG9yPEssIHNwPEVudHJ5PEssIFY+ID4gPiBtQ2FjaGU7CisgICAgdWludDMyX3QgbU1heENhcGFjaXR5OworCisgICAgT25FbnRyeVJlbW92ZWQ8SywgVj4qIG1MaXN0ZW5lcjsKKworICAgIH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UltcGwoKTsKKyAgICBjb25zdCBzaXplX3QgcyA9IGl0ZW1TaXplKCk7CisgICAgd2hpbGUgKGwgPD0gaCkgeworICAgICAgICBtaWQgPSBsICsgKGggLSBsKSAvIDI7CisgICAgICAgIGNvbnN0IHZvaWQqIGNvbnN0IGN1cnIgPSByZWludGVycHJldF9jYXN0PGNvbnN0IGNoYXIgKj4gKGEpICsgKG1pZCAqIHMpOworICAgICAgICBjb25zdCBpbnQgYyA9IGRvX2NvbXBhcmUoY3VyciwgaXRlbSk7CisgICAgICAgIGlmIChjID09IDApIHsKKyAgICAgICAgICAgIGVyciA9IGwgPSBtaWQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfSBlbHNlIGlmIChjIDwgMCkgeworICAgICAgICAgICAgbCA9IG1pZCArIDE7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBoID0gbWlkIC0gMTsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAob3JkZXIpIHsKKyAgICAgICAgKm9yZGVyID0gbDsKKyAgICB9CisgICAgcmV0dXJuIGVycjsKK30KKworc3NpemVfdCBTb3J0ZWRMaXN0SW1wbDo6YWRkKGNvbnN0IHZvaWQqIGl0ZW0pIHsKKyAgICBzaXplX3Qgb3JkZXI7CisgICAgc3NpemVfdCBpbmRleCA9IF9pbmRleE9yZGVyT2YoaXRlbSwgJm9yZGVyKTsKKyAgICBpbmRleCA9IFZlY3RvckltcGw6Omluc2VydEF0KGl0ZW0sIG9yZGVyLCAxKTsKKyAgICByZXR1cm4gaW5kZXg7Cit9CisKK3NzaXplX3QgU29ydGVkTGlzdEltcGw6Om1lcmdlKGNvbnN0IFZlY3RvckltcGwmIHZlY3RvcikgeworICAgIC8vIG5haXZlIG1lcmdlLi4uCisgICAgaWYgKCF2ZWN0b3IuaXNFbXB0eSgpKSB7CisgICAgICAgIGNvbnN0IHZvaWQqIGJ1ZmZlciA9IHZlY3Rvci5hcnJheUltcGwoKTsKKyAgICAgICAgY29uc3Qg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CiAKLSAgICBSU19LSU5EX1BJWEVMX0wsCisgICAgUlNfS0lORF9QSVhFTF9MID0gNywKICAgICBSU19LSU5EX1BJWEVMX0EsCiAgICAgUlNfS0lORF9QSVhFTF9MQSwKICAgICBSU19LSU5EX1BJWEVMX1JHQiwKICAgICBSU19LSU5EX1BJWEVMX1JHQkEsCi0KIH07CiAKIGVudW0gUnNTYW1wbGVyUGFyYW0gewpAQCAtMTIxLDcgKzEzNyw4IEBACiAgICAgUlNfU0FNUExFUl9NQUdfRklMVEVSLAogICAgIFJTX1NBTVBMRVJfV1JBUF9TLAogICAgIFJTX1NBTVBMRVJfV1JBUF9ULAotICAgIFJTX1NBTVBMRVJfV1JBUF9SCisgICAgUlNfU0FNUExFUl9XUkFQX1IsCisgICAgUlNfU0FNUExFUl9BTklTTwogfTsKIAogZW51bSBSc1NhbXBsZXJWYWx1ZSB7CkBAIC0yMDUsOSArMjIyLDk2IEBACiBlbnVtIFJzRXJyb3IgewogICAgIFJTX0VSUk9SX05PTkUsCiAgICAgUlNfRVJST1JfQkFEX1NIQURFUiwKLSAgICBSU19FUlJPUl9CQURfU0NSSVBUCisgICAgUlNfRVJST1JfQkFEX1NDUklQVCwKKyAgICBSU19FUlJPUl9CQURfVkFMVUUsCisgICAgUlNfRVJST1JfT1VUX09GX01FTU9SWQogfTsKIAorZW51bSBSc0FuaW1hdGlvbkludGVycG9sYXRpb24geworICAgIFJTX0FOSU1BVElPTl9JTlRFUlBPTEFUSU9OX1NURVAsCisgICAgUlNfQU5JTUFUSU9OX0lOVEVSUE9MQVRJT05fTElORUFSLAorICAgIFJTX0FOSU1BVElPTl9JTlRFUlBPTEFUSU9OX0JFWklFUiwKKyAgICBSU19BTklNQVRJT05fSU5URVJQT0xBVElPTl9DQVJESU5BTCwKKyAgICBSU19BTklNQVRJT05fSU5URVJQT0xBVElPTl9IRVJNSVRFLAorICAgIFJTX0FOSU1BVElPTl9JTlRFUlBPTEFUSU9OX0JTUExJTkUKK307CisKK2VudW0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V3IG1WaWV3OworICAgIHByaXZhdGUgU2Vuc29yTWFuYWdlciBtU2Vuc29yTWFuYWdlcjsKKworICAgIC8vIGdldCB0aGUgY3VycmVudCBsb29wZXIgKGZyb20geW91ciBBY3Rpdml0eSBVSSB0aHJlYWQgZm9yIGluc3RhbmNlCisKKworICAgIHB1YmxpYyB2b2lkIG9uU2Vuc29yQ2hhbmdlZChTZW5zb3JFdmVudCBldmVudCkgeworICAgICAgICAvL2FuZHJvaWQudXRpbC5Mb2cuZCgicnMiLCAic2Vuc29yOiAiICsgZXZlbnQuc2Vuc29yICsgIiwgeDogIiArIGV2ZW50LnZhbHVlc1swXSArICIsIHk6ICIgKyBldmVudC52YWx1ZXNbMV0gKyAiLCB6OiAiICsgZXZlbnQudmFsdWVzWzJdKTsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAoZXZlbnQuc2Vuc29yLmdldFR5cGUoKSA9PSBTZW5zb3IuVFlQRV9BQ0NFTEVST01FVEVSKSB7CisgICAgICAgICAgICAgICAgaWYobVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtVmlldy5zZXRBY2NlbChldmVudC52YWx1ZXNbMF0sIGV2ZW50LnZhbHVlc1sxXSwgZXZlbnQudmFsdWVzWzJdKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvbkFjY3VyYWN5Q2hhbmdlZChTZW5zb3Igc2Vuc29yLCBpbnQgYWNjdXJhY3kpIHsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvbkNyZWF0ZShCdW5kbGUgaWNpY2xlKSB7CisgICAgICAgIHN1cGVyLm9uQ3JlYXRlKGljaWNsZSk7CisKKyAgICAgICAgbVNlbnNvck1hbmFnZXIgPSAoU2Vuc29yTWFuYWdlcikgZ2V0U3lzdGVtU2VydmljZShTRU5TT1JfU0VSVklDRSk7CisKKyAgICAgICAgLy8gQ3JlYXRlIG91ciBQcmV2aWV3IHZpZXcgYW5kIHNldCBpdCBhcyB0aGUgY29udGVudCBvZiBvdXIKKyAgICAgICAgLy8gQWN0aXZpdHkKKyAgICAgICAgbVZpZXcgPSBuZXcgQmFsbHNWaWV3KHRoaXMpOworICAgICAgICBzZXRDb250ZW50VmlldyhtVmlldyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25SZXN1bWUoKSB7CisgICAgICAgIG1TZW5zb3JNYW5hZ2VyLnJlZ2lzdGVyTGlzdGVuZXIodGhpcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2Vuc29yTWFuYWdlci5nZXREZWZhdWx0U2Vuc29yKFNlbnNvci5UWVBFX0FDQ0VMRVJPTUVURVIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNlbnNvck1hbmFnZXIuU0VOU09SX0RFTEFZX0ZBU1RFU1QpOworCisgICAgICAgIC8vIElkZWFsbHkgYSBnYW1lIHNob3VsZCBpbXBsZW1lbnQgb25SZXN1bWUoKSBhbmQgb25QYXVzZSgpCisgICAgICAgIC8vIHRvIHRha2UgYXBwcm9wcmlhdGUgYWN0aW9uIHdoZW4gdGhlIGFjdGl2aXR5IGxvb3NlcyBmb2N1cworICAgICAgICBzdXBlci5vblJlc3VtZSgpOworICAgICAgICBtVmlldy5vblJlc3VtZSgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uUGF1c2UoKSB7CisgICAgICAgIExvZy5lKCJycyIsICJvblBhdXNlIik7CisKKyAgICAgICAgLy8gSWRlYWxseSBhIGdhbWUgc2hvdWxkIGltcGxlbWVudCBvblJlc3VtZSgpIGFuZCBvblBhdXNlKCkKKyAgICAgICAgLy8gdG8gdGFrZSBhcHByb3ByaWF0ZSBhY3Rpb24gd2hl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9ncmFtVmVydGV4KCkgeworICAgICAgICB1cGRhdGVQcm9qZWN0aW9uTWF0cmljZXMoKTsKKworICAgICAgICBQcm9ncmFtVmVydGV4LlNoYWRlckJ1aWxkZXIgc2IgPSBuZXcgUHJvZ3JhbVZlcnRleC5TaGFkZXJCdWlsZGVyKG1SUyk7CisgICAgICAgIFN0cmluZyB0ID0gICJ2YXJ5aW5nIHZlYzQgdmFyQ29sb3I7XG4iICsKKyAgICAgICAgICAgICAgICAgICAgInZvaWQgbWFpbigpIHtcbiIgKworICAgICAgICAgICAgICAgICAgICAiICB2ZWM0IHBvcyA9IHZlYzQoMC4wLCAwLjAsIDAuMCwgMS4wKTtcbiIgKworICAgICAgICAgICAgICAgICAgICAiICBwb3MueHkgPSBBVFRSSUJfcG9zaXRpb247XG4iICsKKyAgICAgICAgICAgICAgICAgICAgIiAgZ2xfUG9zaXRpb24gPSBVTklfTVZQICogcG9zO1xuIiArCisgICAgICAgICAgICAgICAgICAgICIgIHZhckNvbG9yID0gQVRUUklCX2NvbG9yO1xuIiArCisgICAgICAgICAgICAgICAgICAgICIgIGdsX1BvaW50U2l6ZSA9IEFUVFJJQl9zaXplO1xuIiArCisgICAgICAgICAgICAgICAgICAgICJ9XG4iOworICAgICAgICBzYi5zZXRTaGFkZXIodCk7CisgICAgICAgIHNiLmFkZENvbnN0YW50KG1WcENvbnN0cy5nZXRUeXBlKCkpOworICAgICAgICBzYi5hZGRJbnB1dChtUG9pbnRzLmdldEVsZW1lbnQoKSk7CisgICAgICAgIFByb2dyYW1WZXJ0ZXggcHZzID0gc2IuY3JlYXRlKCk7CisgICAgICAgIHB2cy5iaW5kQ29uc3RhbnRzKG1WcENvbnN0cy5nZXRBbGxvY2F0aW9uKCksIDApOworICAgICAgICBtU2NyaXB0LnNldF9nUFYocHZzKTsKKyAgICB9CisKKyAgICBwcml2YXRlIEFsbG9jYXRpb24gbG9hZFRleHR1cmUoaW50IGlkKSB7CisgICAgICAgIGZpbmFsIEFsbG9jYXRpb24gYWxsb2NhdGlvbiA9IEFsbG9jYXRpb24uY3JlYXRlRnJvbUJpdG1hcFJlc291cmNlKG1SUywgbVJlcywKKyAgICAgICAgICAgICAgICBpZCwgRWxlbWVudC5SR0JfNTY1KG1SUyksIGZhbHNlKTsKKyAgICAgICAgYWxsb2NhdGlvbi51cGxvYWRUb1RleHR1cmUoMCk7CisgICAgICAgIHJldHVybiBhbGxvY2F0aW9uOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXQoUmVuZGVyU2NyaXB0R0wgcnMsIFJlc291cmNlcyByZXMsIGludCB3aWR0aCwgaW50IGhlaWdodCkgeworICAgICAgICBtUlMgPSByczsKKyAgICAgICAgbVJlcyA9IHJlczsKKworICAgICAgICBQcm9ncmFtRnJhZ21lbnQuQnVpbGRlciBwZmIgPSBuZXcgUHJvZ3JhbUZyYWdtZW50LkJ1aWxkZXIocnMpOworICAgICAgICBwZmIuc2V0UG9pbnRTcHJpdGVUZXhDb29yZGluYXRlUmVwbGFjZW1lbnQodHJ1ZSk7CisgICAgICAgIHBmYi5zZXRUZXh0dXJlKFByb2dyYW1GcmFnbWVudC5CdWlsZGVyLkVudk1vZGUuTU9EVUxBVEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm9ncmFtRnJhZ21lbnQuQnVpbGRlci5Gb3JtYXQuUkdCQSwgMCk7CisgICAgICAgIHBmYi5zZXRWYXJ5aW5nQ29sb3IodHJ1ZSk7CisgICAgICAgIG1QRiA9IHBmYi5jcmVhdGUoKTsKKyAgICAgICAgcnMuY29udGV4dEJpbmRQcm9ncmFtRnJhZ21lbnQobVBGKTsKKworICAgICAgICBtUEYuYmluZFRleHR1cmUobG9hZFRleHR1cmUoUi5kcmF3YWJsZS5mbGFyZXMpLCAwKTsKKworICAgICAgICBtUG9pbnRzID0gbmV3IFNjcmlwdEZpZWxkX1BvaW50KG1SUywgUEFSVF9DT1VOVCk7CisgICAgICAgIG1BcmNzID0gbmV3IFNjcmlwdEZpZWx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3LktleUV2ZW50OworaW1wb3J0IGFuZHJvaWQudmlldy5Nb3Rpb25FdmVudDsKKworcHVibGljIGNsYXNzIEJhbGxzVmlldyBleHRlbmRzIFJTU3VyZmFjZVZpZXcgeworCisgICAgcHVibGljIEJhbGxzVmlldyhDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCk7CisgICAgICAgIC8vc2V0Rm9jdXNhYmxlKHRydWUpOworICAgIH0KKworICAgIHByaXZhdGUgUmVuZGVyU2NyaXB0R0wgbVJTOworICAgIHByaXZhdGUgQmFsbHNSUyBtUmVuZGVyOworCisgICAgcHVibGljIHZvaWQgc3VyZmFjZUNoYW5nZWQoU3VyZmFjZUhvbGRlciBob2xkZXIsIGludCBmb3JtYXQsIGludCB3LCBpbnQgaCkgeworICAgICAgICBzdXBlci5zdXJmYWNlQ2hhbmdlZChob2xkZXIsIGZvcm1hdCwgdywgaCk7CisgICAgICAgIGlmIChtUlMgPT0gbnVsbCkgeworICAgICAgICAgICAgUmVuZGVyU2NyaXB0R0wuU3VyZmFjZUNvbmZpZyBzYyA9IG5ldyBSZW5kZXJTY3JpcHRHTC5TdXJmYWNlQ29uZmlnKCk7CisgICAgICAgICAgICBtUlMgPSBjcmVhdGVSZW5kZXJTY3JpcHQoc2MpOworICAgICAgICAgICAgbVJTLmNvbnRleHRTZXRTdXJmYWNlKHcsIGgsIGhvbGRlci5nZXRTdXJmYWNlKCkpOworICAgICAgICAgICAgbVJlbmRlciA9IG5ldyBCYWxsc1JTKCk7CisgICAgICAgICAgICBtUmVuZGVyLmluaXQobVJTLCBnZXRSZXNvdXJjZXMoKSwgdywgaCk7CisgICAgICAgIH0KKyAgICAgICAgbVJlbmRlci51cGRhdGVQcm9qZWN0aW9uTWF0cmljZXMoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkRldGFjaGVkRnJvbVdpbmRvdygpIHsKKyAgICAgICAgaWYobVJTICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1SUyA9IG51bGw7CisgICAgICAgICAgICBkZXN0cm95UmVuZGVyU2NyaXB0KCk7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikKKyAgICB7CisgICAgICAgIGludCBhY3QgPSBldi5nZXRBY3Rpb25NYXNrZWQoKTsKKyAgICAgICAgaWYgKGFjdCA9PSBldi5BQ1RJT05fVVApIHsKKyAgICAgICAgICAgIG1SZW5kZXIubmV3VG91Y2hQb3NpdGlvbigwLCAwLCAwLCBldi5nZXRQb2ludGVySWQoMCkpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9IGVsc2UgaWYgKGFjdCA9PSBNb3Rpb25FdmVudC5BQ1RJT05fUE9JTlRFUl9VUCkgeworICAgICAgICAgICAgLy8gb25seSBvbmUgcG9pbnRlciBnb2luZyB1cCwgd2UgY2FuIGdldCB0aGUgaW5kZXggbGlrZSB0aGlzCisgICAgICAgICAgICBpbnQgcG9pbnRlckluZGV4ID0gZXYuZ2V0QWN0aW9uSW5kZXgoKTsKKyAgICAgICAgICAgIGludCBwb2ludGVySWQgPSBldi5nZXRQb2ludGVySWQocG9pbnRlckluZGV4KTsKKyAgICAgICAgICAgIG1SZW5kZXIubmV3VG91Y2hQb3NpdGlvbigwLCAwLCAwLCBwb2ludGVySWQpOworICAgICAgICB9CisgICAgICAgIGludCBjb3VudCA9IGV2LmdldEhpc3RvcnlTaXplKCk7CisgICAgICAgIGludCBwY291bnQgPSBldi5nZXRQb2ludGVyQ291bnQoKTsKKworICAgICAgICBmb3IgKGludCBwPTA7IHAgPCBwY291bnQ7IHArKykgeworICAgICAgICAgICAgaW50IGlkID0gZXYuZ2V0UG9pbnRlcklkKHApOworICAgICAgICAgICAgbVJlbmRlci5uZXdUb3VjaFBvc2l0aW9uKGV2LmdldFgocCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXYuZ2V0WShwKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5nZXRQcmVzc3VyZShwKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZCk7CisKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBtUmVuZGVyLm5ld1RvdWNoUG9zaXRpb24oZXYuZ2V0SGlzdG9yaWNhbFgocCwgaSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2LmdldEhpc3RvcmljYWxZKHAsIGkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5nZXRIaXN0b3JpY2FsUHJlc3N1cmUocCwgaSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICB2b2lkIHNldEFjY2VsKGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopIHsKKyAgICAgICAgaWYgKG1SZW5kZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIG1SZW5kZXIuc2V0QWNjZWwoeCwgLXkpOworICAgIH0KKworfQorCisKZGlmZiAtLWdpdCBhL2xpYnMvcnMvamF2YS9CYWxscy9zcmMvY29tL2FuZHJvaWQvYmFsbHMvYmFsbF9waHlzaWNzLnJzIGIvbGlicy9ycy9qYXZhL0JhbGxzL3NyYy9jb20vYW5kcm9pZC9iYWxscy9iYWxsX3BoeXNpY3MucnMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYjVmMTQ5YwotLS0gL2Rldi9udWxsCisrKyBiL2xpYnMvcnMvamF2YS9CYWxscy9zcm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YzsKKyAgICAgICAgZmxvYXQgbGVuMiA9IHZlYzIueCArIHZlYzIueTsKKworICAgICAgICBpZiAobGVuMiA8IDEwMDApIHsKKyAgICAgICAgICAgIGlmIChsZW4yID4gKDQqNCkpIHsKKyAgICAgICAgICAgICAgICAvLyBSZXB1bHNpb24KKyAgICAgICAgICAgICAgICBmbG9hdCBsZW4gPSBzcXJ0KGxlbjIpOworICAgICAgICAgICAgICAgIGlmIChsZW4gPCBhcmNJbnZTdHIpIHsKKyAgICAgICAgICAgICAgICAgICAgYXJjSW52U3RyID0gbGVuOworICAgICAgICAgICAgICAgICAgICBhcmNJRCA9IHhpbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZnYgLT0gKHZlYyAvIChsZW4gKiBsZW4gKiBsZW4pKSAqIDIwMDAwLmY7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChsZW4yIDwgMC4xKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBDb2xsaXNpb24KKyAgICAgICAgICAgICAgICBmbG9hdDIgYXhpcyA9IG5vcm1hbGl6ZSh2ZWMpOworICAgICAgICAgICAgICAgIGZsb2F0IGUxID0gZG90KGF4aXMsIGJhbGxJbi0+ZGVsdGEpOworICAgICAgICAgICAgICAgIGZsb2F0IGUyID0gZG90KGF4aXMsIGJQdHJbeGluXS5kZWx0YSk7CisgICAgICAgICAgICAgICAgZmxvYXQgZSA9IChlMSAtIGUyKSAqIDAuNDVmOworICAgICAgICAgICAgICAgIGlmIChlMSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZnYgLT0gYXhpcyAqIGU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZnYgKz0gYXhpcyAqIGU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAg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hbWUgPSAwOworCit2b2lkIGluaXRQYXJ0cyhpbnQgdywgaW50IGgpCit7CisgICAgdWludDMyX3QgZGltWCA9IHJzQWxsb2NhdGlvbkdldERpbVgocnNHZXRBbGxvY2F0aW9uKGJhbGxzMSkpOworCisgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IGRpbVg7IGN0KyspIHsKKyAgICAgICAgYmFsbHMxW2N0XS5wb3NpdGlvbi54ID0gcnNSYW5kKDAuZiwgKGZsb2F0KXcpOworICAgICAgICBiYWxsczFbY3RdLnBvc2l0aW9uLnkgPSByc1JhbmQoMC5mLCAoZmxvYXQpaCk7CisgICAgICAgIGJhbGxzMVtjdF0uZGVsdGEueCA9IDAuZjsKKyAgICAgICAgYmFsbHMxW2N0XS5kZWx0YS55ID0gMC5mOworICAgICAgICBiYWxsczFbY3RdLmFyY0lEID0gLTE7CisgICAgICAgIGJhbGxzMVtjdF0uY29sb3IgPSAwLmY7CisgICAgfQorfQorCisKKworaW50IHJvb3QoKSB7CisgICAgcnNnQ2xlYXJDb2xvcigwLmYsIDAuZiwgMC5mLCAxLmYpOworCisgICAgQmFsbENvbnRyb2xfdCBiYyA9IHswfTsKKyAgICBCYWxsX3QgKmJvdXQ7CisKKyAgICBpZiAoZnJhbWUgJiAxKSB7CisgICAgICAgIHJzU2V0T2JqZWN0KCZiYy5haW4sIHJzR2V0QWxsb2NhdGlvbihiYWxsczIpKTsKKyAgICAgICAgcnNTZXRPYmplY3QoJmJjLmFvdXQsIHJzR2V0QWxsb2NhdGlvbihiYWxsczEpKTsKKyAgICAgICAgYm91dCA9IGJhbGxzMjsKKyAgICB9IGVsc2UgeworICAgICAgICByc1NldE9iamVjdCgmYmMuYWluLCByc0dldEFsbG9jYXRpb24oYmFsbHMxKSk7CisgICAgICAgIHJzU2V0T2JqZWN0KCZiYy5hb3V0LCByc0dldEFsbG9jYXRpb24oYmFsbHMyKSk7CisgICAgICAgIGJvdXQgPSBiYWxsczE7CisgICAgfQorCisgICAgYmMuZGltWCA9IHJzQWxsb2NhdGlvbkdldERpbVgoYmMuYWluKTsKKyAgICBiYy5kdCA9IDEuZiAvIDMwLmY7CisKKyAgICByc0ZvckVhY2gocGh5c2ljc19zY3JpcHQsIGJjLmFpbiwgYmMuYW91dCwgJmJjKTsKKworICAgIHVpbnQzMl90IGFyY0lkeCA9IDA7CisgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IGJjLmRpbVg7IGN0KyspIHsKKyAgICAgICAgcG9pbnRbY3RdLnBvc2l0aW9uID0gYm91dFtjdF0ucG9zaXRpb247CisgICAgICAgIHBvaW50W2N0XS5jb2xvciA9IHJzUGFja0NvbG9yVG84ODg4KGJvdXRbY3RdLmNvbG9yKTsKKyAgICAgICAgcG9pbnRbY3RdLnNpemUgPSA2LmYgKyBib3V0W2N0XS5jb2xvci5nICogNi5mOworCisgICAgICAgIGlmIChib3V0W2N0XS5hcmNJRCA+PSAwKSB7CisgICAgICAgICAgICBhcmNbYXJjSWR4XS5wb3NpdGlvbiA9IGJvdXRbY3RdLnBvc2l0aW9uOworICAgICAgICAgICAgYXJjW2FyY0lkeF0uY29sb3IuciA9IG1pbihib3V0W2N0XS5hcmNTdHIsIDEuZikgKiAweGZmOworICAgICAgICAgICAgYXJjW2FyY0lkeF0uY29sb3IuZyA9IDA7CisgICAgICAgICAgICBhcmNbYXJjSWR4XS5jb2xvci5iID0gMDsKKyAgICAgICAgICAgIGFyY1thcmNJZHhdLmNvbG9yLmEgPSAweGZmOworICAgICAgICAgICAgYXJjW2FyY0lkeCsxXS5wb3NpdGlvbiA9IGJvdXRbYm91dFtjdF0uYXJjSURdLnBvc2l0aW9uOworICAgICAgICAgICAgYXJjW2FyY0lkeCsxXS5jb2xvciA9IGFyY1thcmNJZHhdLmNvbG9yOworICAgICAgICAgICAgYXJjSWR4ICs9IDI7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBmcmFtZSsrOworICAgIHJzZ0JpbmRQcm9ncmFtRnJhZ21lbnQoZ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Agc3RvcmVJMzIoY29uLCAyLCAwLCBuZXdQYXJ0KTsKLSAgICB9Ci0KLSAgICBkcmF3Q291bnQgPSAwOwotICAgIGZvciAoY3Q9MDsgY3QgPCBjb3VudDsgY3QrKykgewotICAgICAgICBzcmNJZHggPSBjdCAqIDUgKyAxOwotCi0gICAgICAgIGR4ID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCk7Ci0gICAgICAgIGR5ID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCArIDEpOwotICAgICAgICBsaWZlID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCArIDIpOwotICAgICAgICBwb3N4ID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCArIDMpOwotICAgICAgICBwb3N5ID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCArIDQpOwotCi0gICAgICAgIGlmIChsaWZlKSB7Ci0gICAgICAgICAgICBpZiAocG9zeSA8ICg0ODAgPDwgMTYpKSB7Ci0gICAgICAgICAgICAgICAgZHN0SWR4ID0gZHJhd0NvdW50ICogOTsKLSAgICAgICAgICAgICAgICBjID0gMHhmZmFmY2YgfCAoKGxpZmUgPj4gbGlmZVNoaWZ0KSA8PCAyNCk7Ci0KLSAgICAgICAgICAgICAgICBzdG9yZVUzMihjb24sIDEsIGRzdElkeCwgYyk7Ci0gICAgICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAxLCBkc3RJZHggKyAxLCBwb3N4KTsKLSAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sIDEsIGRzdElkeCArIDIsIHBvc3kpOwotCi0gICAgICAgICAgICAgICAgc3RvcmVVMzIoY29uLCAxLCBkc3RJZHggKyAzLCBjKTsKLSAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sIDEsIGRzdElkeCArIDQsIHBvc3ggKyAweDEwMDAwKTsKLSAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sIDEsIGRzdElkeCArIDUsIHBvc3kgKyBkeSAqIDQpOwotCi0gICAgICAgICAgICAgICAgc3RvcmVVMzIoY29uLCAxLCBkc3RJZHggKyA2LCBjKTsKLSAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sIDEsIGRzdElkeCArIDcsIHBvc3ggLSAweDEwMDAwKTsKLSAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sIDEsIGRzdElkeCArIDgsIHBvc3kgKyBkeSAqIDQpOwotICAgICAgICAgICAgICAgIGRyYXdDb3VudCArKzsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKGR5ID4gMCkgewotICAgICAgICAgICAgICAgICAgICBkeSA9ICgtZHkpID4+IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwb3N4ID0gcG9zeCArIGR4OwotICAgICAgICAgICAgcG9zeSA9IHBvc3kgKyBkeTsKLSAgICAgICAgICAgIGR5ID0gZHkgKyAweDQwMDsKLSAgICAgICAgICAgIGxpZmUgLS07Ci0KLSAgICAgICAgICAgIC8vc3RvcmVJMzIoY29uLCAyLCBzcmNJZHgsIGR4KTsKLSAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMiwgc3JjSWR4ICsgMSwgZHkpOwotICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAyLCBzcmNJZHggKyAyLCBsaWZlKTsKLSAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMiwgc3JjSWR4ICsgMywgcG9zeCk7Ci0gICAgICAgICAgICBzdG9yZUkzMihjb24sIDIsIHNyY0lkeCArIDQsIHBvc3kpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgZHJhd1RyaWFuZ2xlQXJyYXkoY29uLCBOQU1FRF9QYXJ0QnVmZmVyLCBkcmF3Q291bnQpOwotICAgIHJldHVybiAxOwotfQpkaWZmIC0tZ2l0IGEvbGlicy9ycy9qYXZhL0ZpbG0vcmVzL3Jhdy9maWxtc3RyaXAuYyBiL2xpYnMvcnMvamF2YS9GaWxtL3Jlcy9yYX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aW50IGN0PTA7IGN0IDwgbUltYWdlcy5sZW5ndGg7IGN0KyspIHsKLSAgICAgICAgICAgIEFsbG9jYXRpb24uQWRhcHRlcjJEIGEgPSBtSW1hZ2VzW2N0XS5jcmVhdGVBZGFwdGVyMkQoKTsKLQotICAgICAgICAgICAgaW50IHNpemUgPSA1MTI7Ci0gICAgICAgICAgICBpbnQgbWlwID0gMDsKLSAgICAgICAgICAgIHdoaWxlKHNpemUgPj0gMikgewotICAgICAgICAgICAgICAgIGEuc3ViRGF0YSgwLCAwLCAyLCBzaXplLCBibGFjayk7Ci0gICAgICAgICAgICAgICAgYS5zdWJEYXRhKHNpemUtMiwgMCwgMiwgc2l6ZSwgYmxhY2spOwotICAgICAgICAgICAgICAgIGEuc3ViRGF0YSgwLCAwLCBzaXplLCAyLCBibGFjayk7Ci0gICAgICAgICAgICAgICAgYS5zdWJEYXRhKDAsIHNpemUtMiwgc2l6ZSwgMiwgYmxhY2spOwotICAgICAgICAgICAgICAgIHNpemUgPj49IDE7Ci0gICAgICAgICAgICAgICAgbWlwKys7Ci0gICAgICAgICAgICAgICAgYS5zZXRDb25zdHJhaW50KERpbWVuc2lvbi5MT0QsIG1pcCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1JbWFnZXNbY3RdLnVwbG9hZFRvVGV4dHVyZSgxKTsKLSAgICAgICAgICAgIG1CdWZmZXJJRHNbY3RdID0gbUltYWdlc1tjdF0uZ2V0SUQoKTsKLSAgICAgICAgfQotICAgICAgICBtQWxsb2NJRHMuZGF0YShtQnVmZmVySURzKTsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQgaW5pdFN0YXRlKCkKLSAgICB7Ci0gICAgICAgIG1CdWZmZXJTdGF0ZSA9IG5ldyBpbnRbMTBdOwotICAgICAgICBtQWxsb2NTdGF0ZSA9IEFsbG9jYXRpb24uY3JlYXRlU2l6ZWQobVJTLAotICAgICAgICAgICAgRWxlbWVudC5jcmVhdGVVc2VyKG1SUyw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gICAgIG54ID0gMDsKLSAgICAgICAgICAgIG55ID0gMDsKLSAgICAgICAgICAgIG56ID0gMDsKLSAgICAgICAgICAgIHMgPSAwOwotICAgICAgICAgICAgdCA9IDA7Ci0gICAgICAgICAgICB4ID0gMDsKLSAgICAgICAgICAgIHkgPSAwOwotICAgICAgICAgICAgeiA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICB2b2lkIHh5eihmbG9hdCBfeCwgZmxvYXQgX3ksIGZsb2F0IF96KSB7Ci0gICAgICAgICAgICB4ID0gX3g7Ci0gICAgICAgICAgICB5ID0gX3k7Ci0gICAgICAgICAgICB6ID0gX3o7Ci0gICAgICAgIH0KLQotICAgICAgICB2b2lkIG54eXooZmxvYXQgX3gsIGZsb2F0IF95LCBmbG9hdCBfeikgewotICAgICAgICAgICAgbnggPSBfeDsKLSAgICAgICAgICAgIG55ID0gX3k7Ci0gICAgICAgICAgICBueiA9IF96OwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCBzdChmbG9hdCBfcywgZmxvYXQgX3QpIHsKLSAgICAgICAgICAgIHMgPSBfczsKLSAgICAgICAgICAgIHQgPSBfdDsKLSAgICAgICAgfQotCi0gICAgICAgIHZvaWQgY29tcHV0ZU5vcm0oVmVydGV4IHYxLCBWZXJ0ZXggdjIpIHsKLSAgICAgICAgICAgIGZsb2F0IGR4ID0gdjEueCAtIHYyLng7Ci0gICAgICAgICAgICBmbG9hdCBkeSA9IHYxLnkgLSB2Mi55OwotICAgICAgICAgICAgZmxvYXQgZHogPSB2MS56IC0gdjIuejsKLSAgICAgICAgICAgIGZsb2F0IGxlbiA9IChmbG9hdClqYXZhLmxhbmcuTWF0aC5zcXJ0KGR4KmR4ICsgZHkqZHkgKyBkeipkeik7Ci0gICAgICAgICAgICBkeCAvPSBsZW47Ci0gICAgICAgICAgICBkeSAvPSBsZW47Ci0gICAgICAgICAgICBkeiAvPSBsZW47Ci0KLSAgICAgICAgICAgIG54ID0gZHggKiBkejsKLSAgICAgICAgIC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5Ljc4OTM1OGYsCi0gICAgICAgICAgICA0NC42NjgxMzVmLCA3OC4xNDIzMjdmLAotICAgICAgICAgICAgNTcuNjc4OTIwZiwgNjkuODMyMzkwZiwKLSAgICAgICAgICAgIDcyLjUwNzMxM2YsIDY1LjUzNjUzNGYsCi0gICAgICAgICAgICA4Ny45NDUyODNmLCA2NS42MDQ3MzFmLAotICAgICAgICAgICAgMTA2LjkxODExN2YsIDY1LjY4ODU0MmYsCi0gICAgICAgICAgICAxMjUuMTQxNzk1ZiwgNjAuNDA5MDU2ZiwKLSAgICAgICAgICAgIDE0MS4xMzE2ODZmLCA1MC4xOTYzNzZmLAotICAgICAgICAgICAgMTUzLjU4NTEzN2YsIDM1Ljg4MjUwMmYsCi0gICAgICAgICAgICAxNjEuNDg3NjAwZiwgMTguNjMzNTQ1ZiwKLSAgICAgICAgICAgIDE2NC4xOTUyODNmLCAtMC4xNDUyNjlmLAotICAgICAgICAgICAgMTYxLjQ4NzYwMGYsIC0xOC45MjQwODRmLAotICAgICAgICAgICAgMTUzLjU4NTEzN2YsIC0zNi4xNzMwNDBmLAotICAgICAgICAgICAgMTQxLjEzMTY4NmYsIC01MC40ODY5MTRmLAotICAgICAgICAgICAgMTI1LjE0MTc5NWYsIC02MC42OTk1OTRmLAotICAgICAgICAgICAgMTA2LjkxODExN2YsIC02NS45NzkwODFmLAotICAgICAgICAgICAgODcuOTQ1MjgzZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICA4MGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgNjBmLCAtNjUuODk1MjY5ZiwKLSAgICAgICAgICAgIDQwZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICAyMGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgMGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgLTIwZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICAtNDBmLCAtNjUuODk1MjY5ZiwKLSAgICAgICAgICAgIC02MGYsI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AwOwotICAgICAgICBmb3IgKGludCBjdD0wOyBjdCA8IChjb3VudC0xKTsgY3QrKykgewotICAgICAgICAgICAgdC54ID0gLXZ0eFtjdCoyXSAvIDEwMC5mOwotICAgICAgICAgICAgdC56ID0gdnR4W2N0KjIrMV0gLyAxMDAuZjsKLSAgICAgICAgICAgIHQucyA9IHJ1bm5pbmdTOwotICAgICAgICAgICAgdC5ueCA9ICAodnR4W2N0KjIrM10gLSB2dHhbY3QqMiArMV0pOwotICAgICAgICAgICAgdC5ueSA9ICAodnR4W2N0KjIrMl0gLSB2dHhbY3QqMiAgIF0pOwotICAgICAgICAgICAgZmxvYXQgbGVuID0gKGZsb2F0KWphdmEubGFuZy5NYXRoLnNxcnQodC5ueCAqIHQubnggKyB0Lm55ICogdC5ueSk7Ci0gICAgICAgICAgICBydW5uaW5nUyArPSBsZW4gLyAxMDA7Ci0gICAgICAgICAgICB0Lm54IC89IGxlbjsKLSAgICAgICAgICAgIHQubnkgLz0gbGVuOwotICAgICAgICAgICAgdC55ID0gLTAuNWY7Ci0gICAgICAgICAgICB0LnQgPSAwOwotICAgICAgICAgICAgdG0uc2V0Tm9ybWFsKHQubngsIHQubnksIHQubnopOwotICAgICAgICAgICAgdG0uc2V0VGV4dHVyZSh0LnMsIHQudCk7Ci0gICAgICAgICAgICB0bS5hZGRWZXJ0ZXgodC54LCB0LnksIHQueik7Ci0gICAgICAgICAgICAvL2FuZHJvaWQudXRpbC5Mb2cuZSgicnMiLCAidnR4IHg9Iit0LngrIiB5PSIrdC55KyIgej0iK3QueisiIHM9Iit0LnMrIiB0PSIrdC50KTsKLSAgICAgICAgICAgIHQueSA9IC41ZjsKLSAgICAgICAgICAgIHQudCA9IDE7Ci0gICAgICAgICAgICB0bS5zZXRUZXh0dXJlKHQucywgdC50KTsKLSAgICAgICAgICAgIHRtLmFkZFZlcnRleCh0LngsIHQueSwgdC56KTsKLSAgICAgICAgICAgIC8vYW5kcm9pZC51dGlsLkxvZy5lKCJycyIsICJ2d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mFjZUNoYW5nZWQoU3VyZmFjZUhvbGRlciBob2xkZXIsIGludCBmb3JtYXQsIGludCB3LCBpbnQgaCkgewotICAgICAgICBzdXBlci5zdXJmYWNlQ2hhbmdlZChob2xkZXIsIGZvcm1hdCwgdywgaCk7Ci0gICAgICAgIGlmIChtUlMgPT0gbnVsbCkgewotICAgICAgICAgICAgbVJTID0gY3JlYXRlUmVuZGVyU2NyaXB0KHRydWUpOwotICAgICAgICAgICAgbVJTLmNvbnRleHRTZXRTdXJmYWNlKHcsIGgsIGhvbGRlci5nZXRTdXJmYWNlKCkpOwotICAgICAgICAgICAgbVJlbmRlciA9IG5ldyBGaWxtUlMoKTsKLSAgICAgICAgICAgIG1SZW5kZXIuaW5pdChtUlMsIGdldFJlc291cmNlcygpLCB3LCBoKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHByb3RlY3RlZCB2b2lkIG9uRGV0YWNoZWRGcm9tV2luZG93KCkgewotICAgICAgICBpZihtUlMgIT0gbnVsbCkgewotICAgICAgICAgICAgbVJTID0gbnVsbDsKLSAgICAgICAgICAgIGRlc3Ryb3lSZW5kZXJTY3JpcHQoKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBib29sZWFuIG9uS2V5RG93bihpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpCi0gICAgewotICAgICAgICAvLyBicmVhayBwb2ludCBhdCBoZXJlCi0gICAgICAgIC8vIHRoaXMgbWV0aG9kIGRvZXNuJ3Qgd29yayB3aGVuICdleHRlbmRzIFZpZXcnIGluY2x1ZGUgJ2V4dGVuZHMgU2Nyb2xsVmlldycuCi0gICAgICAgIHJldHVybiBzdXBlci5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpOwotICAgIH0KLQotCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGJvb2xlYW4gb25Ub3VjaEV2ZW50KE1vdGlvbkV2ZW50IGV2KQotIC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MgKiBwID0gKHN0cnVjdCBwb2ludF9zICopcG9pbnQ7Ci0KLSAgICBpZiAocmF0ZSkgewotICAgICAgICBmbG9hdCByTWF4ID0gKChmbG9hdClyYXRlKSAqIDAuMDA1ZjsKLSAgICAgICAgaW50IHggPSBDb250cm9sLT54OwotICAgICAgICBpbnQgeSA9IENvbnRyb2wtPnk7Ci0gICAgICAgIGludCBjb2xvciA9ICgoaW50KShDb250cm9sLT5yICogMjU1LmYpKSB8Ci0gICAgICAgICAgICAgICAgICAgICgoaW50KShDb250cm9sLT5nICogMjU1LmYpKSA8PCA4IHwKLSAgICAgICAgICAgICAgICAgICAgKChpbnQpKENvbnRyb2wtPmIgKiAyNTUuZikpIDw8IDE2IHwKLSAgICAgICAgICAgICAgICAgICAgKDB4ZjAgPDwgMjQpOwotICAgICAgICBzdHJ1Y3QgcG9pbnRfcyAqIG5wID0gJnBbbmV3UGFydF07Ci0KLSAgICAgICAgd2hpbGUgKHJhdGUtLSkgewotICAgICAgICAgICAgdmVjMlJhbmQoKGZsb2F0ICopJm5wLT5kZWx0YS54LCByTWF4KTsKLSAgICAgICAgICAgIG5wLT5wb3NpdGlvbi54ID0geDsKLSAgICAgICAgICAgIG5wLT5wb3NpdGlvbi55ID0geTsKLSAgICAgICAgICAgIG5wLT5jb2xvciA9IGNvbG9yOwotICAgICAgICAgICAgbmV3UGFydCsrOwotICAgICAgICAgICAgbnArKzsKLSAgICAgICAgICAgIGlmIChuZXdQYXJ0ID49IGNvdW50KSB7Ci0gICAgICAgICAgICAgICAgbmV3UGFydCA9IDA7Ci0gICAgICAgICAgICAgICAgbnAgPSAmcFtuZXdQYXJ0XTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGZvciAoY3Q9MDsgY3QgPCBjb3VudDsgY3QrKykgewotICAgICAgICBmbG9hdCBkeSA9IHAtPmRlbHRhLnkgKyAwLjE1ZjsKLSAgICAgICAgZmxvYXQgcG9zeSA9IHAtPnBvc2l0aW9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otICAgIHJzX21lc2ggcGFydE1lc2g7Ci19IENvbnRyb2xfdDsKLUNvbnRyb2xfdCAqQ29udHJvbDsKLQotdHlwZWRlZiBzdHJ1Y3QgUG9pbnRfc3sKLSAgICBmbG9hdDIgZGVsdGE7Ci0gICAgZmxvYXQyIHBvc2l0aW9uOwotICAgIHVuc2lnbmVkIGludCBjb2xvcjsKLX0gUG9pbnRfdDsKLVBvaW50X3QgKnBvaW50OwotCi1pbnQgbWFpbihpbnQgbGF1bmNoSUQpIHsKLSAgICBpbnQgY3Q7Ci0gICAgaW50IGNvdW50ID0gQ29udHJvbC0+Y291bnQ7Ci0gICAgaW50IHJhdGUgPSBDb250cm9sLT5yYXRlOwotICAgIGZsb2F0IGhlaWdodCA9IGdldEhlaWdodCgpOwotICAgIFBvaW50X3QgKiBwID0gcG9pbnQ7Ci0KLSAgICBpZiAocmF0ZSkgewotICAgICAgICBmbG9hdCByTWF4ID0gKChmbG9hdClyYXRlKSAqIDAuMDA1ZjsKLSAgICAgICAgaW50IHggPSBDb250cm9sLT54OwotICAgICAgICBpbnQgeSA9IENvbnRyb2wtPnk7Ci0gICAgICAgIGludCBjb2xvciA9ICgoaW50KShDb250cm9sLT5yICogMjU1LmYpKSB8Ci0gICAgICAgICAgICAgICAgICAgICgoaW50KShDb250cm9sLT5nICogMjU1LmYpKSA8PCA4IHwKLSAgICAgICAgICAgICAgICAgICAgKChpbnQpKENvbnRyb2wtPmIgKiAyNTUuZikpIDw8IDE2IHwKLSAgICAgICAgICAgICAgICAgICAgKDB4ZjAgPDwgMjQpOwotICAgICAgICBQb2ludF90ICogbnAgPSAmcFtuZXdQYXJ0XTsKLQotICAgICAgICB3aGlsZSAocmF0ZS0tKSB7Ci0gICAgICAgICAgICBucC0+ZGVsdGEgPSB2ZWMyUmFuZChyTWF4KTsKLSAgICAgICAgICAgIG5wLT5wb3NpdGlvbi54ID0geDsKLSAgICAgICAgICAgIG5wLT5wb3NpdGlvbi55ID0geTsKLSAgICAgICAgICA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jlmKSB7Ci0gICAgICAgICAgICAgICAgbVNELnIgPSAwLjhmOwotICAgICAgICAgICAgICAgIG1TRC5nID0gMC41ZjsKLSAgICAgICAgICAgICAgICBtU0QuYiA9IDEuZjsKLSAgICAgICAgICAgIH0KKyAgICBib29sZWFuIGhvbGRpbmdDb2xvcltdID0gbmV3IGJvb2xlYW5bMTBdOworICAgIHB1YmxpYyB2b2lkIG5ld1RvdWNoUG9zaXRpb24oZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgcHJlc3N1cmUsIGludCBpZCkgeworICAgICAgICBpZiAoaWQgPiBob2xkaW5nQ29sb3IubGVuZ3RoKSB7CisgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KLSAgICAgICAgbVNELnJhdGUgPSByYXRlOwotICAgICAgICBtU0QueCA9IHg7Ci0gICAgICAgIG1TRC55ID0geTsKLSAgICAgICAgbUludEFsbG9jLmRhdGEobVNEKTsKKyAgICAgICAgaW50IHJhdGUgPSAoaW50KShwcmVzc3VyZSAqIHByZXNzdXJlICogNTAwLmYpOworICAgICAgICBpZihyYXRlID4gNTAwKSB7CisgICAgICAgICAgICByYXRlID0gNTAwOworICAgICAgICB9CisgICAgICAgIGlmIChyYXRlID4gMCkgeworICAgICAgICAgICAgbVNjcmlwdC5pbnZva2VfYWRkUGFydGljbGVzKHJhdGUsIHgsIHksIGlkLCAhaG9sZGluZ0NvbG9yW2lkXSk7CisgICAgICAgICAgICBob2xkaW5nQ29sb3JbaWRdID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGhvbGRpbmdDb2xvcltpZF0gPSBmYWxzZTsKKyAgICAgICAgfQorCiAgICAgfQotCi0KLSAgICAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLwotCi0gICAgcHJpdmF0ZSBSZXNvdXJjZXMgbVJlczsKLQotICAgIHByaXZhdGUgUmVuZGVyU2NyaXB0R0wgbVJTOwotICAgIH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Y29udGV4dFNldFN1cmZhY2UodywgaCwgaG9sZGVyLmdldFN1cmZhY2UoKSk7CiAgICAgICAgICAgICBtUmVuZGVyID0gbmV3IEZvdW50YWluUlMoKTsKICAgICAgICAgICAgIG1SZW5kZXIuaW5pdChtUlMsIGdldFJlc291cmNlcygpLCB3LCBoKTsKQEAgLTcxLDE3ICs3MiwzMyBAQAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikKICAgICB7Ci0gICAgICAgIGludCBhY3QgPSBldi5nZXRBY3Rpb24oKTsKKyAgICAgICAgaW50IGFjdCA9IGV2LmdldEFjdGlvbk1hc2tlZCgpOwogICAgICAgICBpZiAoYWN0ID09IGV2LkFDVElPTl9VUCkgewotICAgICAgICAgICAgbVJlbmRlci5uZXdUb3VjaFBvc2l0aW9uKDAsIDAsIDApOworICAgICAgICAgICAgbVJlbmRlci5uZXdUb3VjaFBvc2l0aW9uKDAsIDAsIDAsIGV2LmdldFBvaW50ZXJJZCgwKSk7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0gZWxzZSBpZiAoYWN0ID09IE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX1VQKSB7CisgICAgICAgICAgICAvLyBvbmx5IG9uZSBwb2ludGVyIGdvaW5nIHVwLCB3ZSBjYW4gZ2V0IHRoZSBpbmRleCBsaWtlIHRoaXMKKyAgICAgICAgICAgIGludCBwb2ludGVySW5kZXggPSBldi5nZXRBY3Rpb25JbmRleCgpOworICAgICAgICAgICAgaW50IHBvaW50ZXJJZCA9IGV2LmdldFBvaW50ZXJJZChwb2ludGVySW5kZXgpOworICAgICAgICAgICAgbVJlbmRlci5uZXdUb3VjaFBvc2l0aW9uKDAsIDAsIDAsIHBvaW50ZXJJZCk7CiAgICAgICAgIH0KLSAgICAgICAgZmxvYXQgcmF0ZSA9IChldi5nZXRQcmVzc3VyZSgpICogNTAuZik7Ci0gICAgICAgIHJhdGUgKj0gcmF0ZTsKLSAgICAgICAgaWYocmF0ZSA+IDIwMDAuZikgewotICAgICAgICAgICAgcmF0ZSA9IDIwMDAuZjsKKyAgICAgICAgaW50IGNvdW50ID0gZXYuZ2V0SGlzdG9yeVNpemUoKTsKKyAgICAgICAgaW50IHBjb3VudCA9IGV2LmdldFBvaW50ZXJDb3VudCgpOworCisgICAgICAgIGZvciAoaW50IHA9MDsgcCA8IHBjb3VudDsgcCsrKSB7CisgICAgICAgICAgICBpbnQgaWQgPSBldi5nZXRQb2ludGVySWQocCk7CisgICAgICAgICAgICBtUmVuZGVyLm5ld1RvdWNoUG9zaXRpb24oZXYuZ2V0WChwKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5nZXRZKHApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2LmdldFByZXNzdXJlKHApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkKTsKKworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIG1SZW5kZXIubmV3VG91Y2hQb3NpdGlvbihldi5nZXRIaXN0b3JpY2FsWChwLCBpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXYuZ2V0SGlzdG9yaWNhbFkocCwgaSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2LmdldEhpc3RvcmljYWxQcmVzc3VyZShwLCBpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQpOworICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIG1SZW5kZXIubmV3VG91Y2hQb3NpdGlvbigoaW50KWV2LmdldFgoKSwgKGludClldi5nZXRZKCksIChpbnQpcmF0ZSk7CiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KIH0KZGlmZiAtLWdpdCB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bG9jYXRpb25HZXREaW1YKHJzR2V0QWxsb2NhdGlvbihwb2ludCkpOworICAgIGZsb2F0IGR5MiA9IGR0ICogKDEwLmYpOworICAgIFBvaW50X3QgKiBwID0gcG9pbnQ7CisgICAgZm9yIChpbnQgY3Q9MDsgY3QgPCBzaXplOyBjdCsrKSB7CisgICAgICAgIHAtPmRlbHRhLnkgKz0gZHkyOworICAgICAgICBwLT5wb3NpdGlvbiArPSBwLT5kZWx0YTsKKyAgICAgICAgaWYgKChwLT5wb3NpdGlvbi55ID4gaGVpZ2h0KSAmJiAocC0+ZGVsdGEueSA+IDApKSB7CisgICAgICAgICAgICBwLT5kZWx0YS55ICo9IC0wLjNmOworICAgICAgICB9CisgICAgICAgIHArKzsKKyAgICB9CisKKyAgICByc2dEcmF3TWVzaChwYXJ0TWVzaCk7CisgICAgcmV0dXJuIDE7Cit9CisKK3N0YXRpYyBmbG9hdDQgcGFydENvbG9yWzEwXTsKK3ZvaWQgYWRkUGFydGljbGVzKGludCByYXRlLCBmbG9hdCB4LCBmbG9hdCB5LCBpbnQgaW5kZXgsIGJvb2wgbmV3Q29sb3IpCit7CisgICAgaWYgKG5ld0NvbG9yKSB7CisgICAgICAgIHBhcnRDb2xvcltpbmRleF0ueCA9IHJzUmFuZCgwLjVmLCAxLjBmKTsKKyAgICAgICAgcGFydENvbG9yW2luZGV4XS55ID0gcnNSYW5kKDEuMGYpOworICAgICAgICBwYXJ0Q29sb3JbaW5kZXhdLnogPSByc1JhbmQoMS4wZik7CisgICAgfQorICAgIGZsb2F0IHJNYXggPSAoKGZsb2F0KXJhdGUpICogMC4wMmY7CisgICAgaW50IHNpemUgPSByc0FsbG9jYXRpb25HZXREaW1YKHJzR2V0QWxsb2NhdGlvbihwb2ludCkpOworICAgIHVjaGFyNCBjID0gcnNQYWNrQ29sb3JUbzg4ODgocGFydENvbG9yW2luZGV4XSk7CisKKyAgICBQb2ludF90ICogbnAgPSAmcG9pbnRbbmV3UGFydF07CisgICAgZmxvYXQ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3MgUGl4ZWwgewotICAgICAgICBwdWJsaWMgYnl0ZSBhOwotICAgICAgICBwdWJsaWMgYnl0ZSByOwotICAgICAgICBwdWJsaWMgYnl0ZSBnOwotICAgICAgICBwdWJsaWMgYnl0ZSBiOwotICAgIH0KLQogICAgIGNsYXNzIEZpbHRlckNhbGxiYWNrIGV4dGVuZHMgUmVuZGVyU2NyaXB0LlJTTWVzc2FnZSB7CiAgICAgICAgIHByaXZhdGUgUnVubmFibGUgbUFjdGlvbiA9IG5ldyBSdW5uYWJsZSgpIHsKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKLSAgICAgICAgICAgICAgICBtT3V0UGl4ZWxzQWxsb2NhdGlvbi5yZWFkRGF0YShtT3V0RGF0YSk7Ci0gICAgICAgICAgICAgICAgbUJpdG1hcC5zZXRQaXhlbHMobU91dERhdGEsIDAsIG1QYXJhbXMub3V0V2lkdGgsIDAsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICBtUGFyYW1zLm91dFdpZHRoLCBtUGFyYW1zLm91dEhlaWdodCk7CiAgICAgICAgICAgICAgICAgbURpc3BsYXlWaWV3LmludmFsaWRhdGUoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfTsKQEAgLTg5LDI5ICs5MiwyMTggQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBqYXZhRmlsdGVyKCkgeworICAgIGludCBpbltdOworICAgIGludCBpbnRlcm1bXTsKKyAgICBpbnQgb3V0W107CisgICAgaW50IE1BWF9SQURJVVMgPSAyNTsKKyAgICAvLyBTdG9yZSBvdXIgY29lZmZpY2llbnRzIGhlcmUKKyAgICBmbG9hdCBnYXVzc2lhbltdOworCisgICAgcHJpdmF0ZSBsb25nIGphdmFGaWx0ZXIoKSB7CisgICAgICAgIGZpbmFsIGludCB3aWR0aCA9IG1CaXRtYXBJbi5nZXRXaWR0aCgpOworICAgICAgICBmaW5hbCBpbnQgaGVpZ2h0ID0gbUJpdG1hcEluLmdldEhlaWdodCgpOworICAgICAgICBmaW5hbCBpbnQgY291bnQgPSB3aWR0aCAqIGhlaWdodDsKKworICAgICAgICBpZiAoaW4gPT0gbnVsbCkgeworICAgICAgICAgICAgaW4gPSBuZXcgaW50W2NvdW50XTsKKyAgICAgICAgICAgIGludGVybSA9IG5ldyBpbnRbY291bnRdOworICAgICAgICAgICAgb3V0ID0gbmV3IGludFtjb3VudF07CisgICAgICAgICAgICBnYXVzc2lhbiA9IG5ldyBmbG9hdFtNQVhfUkFESVVTICogMiArIDFdOworICAgICAgICAgICAgbUJpdG1hcEluLmdldFBpeGVscyhpbiwgMCwgd2lkdGgsIDAsIDAsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICB9CisKICAgICAgICAgbG9uZyB0ID0gamF2YS5sYW5nLlN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICBpbnQgY291bnQgPSBtUGFyYW1zLmluV2lkdGggKiBtUGFyYW1zLmluSGVpZ2h0OwotICAgICAgICBmbG9hdCB0aHJlc2hvbGQgPSBtUGFyYW1zLnRocmVzaG9sZCAqIDI1NS5mOwogCi0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICAgICAgZmluYWwgZmxvYXQgciA9IChmbG9hdCkoKG1JbkRhdGFbaV0gPj4gMCkgJiAweGZmKTsKLSAgICAgICAgICAgIGZpbmFsIGZsb2F0IGcgPSAoZmxvYXQpKChtSW5EYXRhW2ldID4+IDgpICYgMHhmZik7Ci0gICAgICAgICAgICBmaW5hbCBmbG9hdCBiID0gKGZsb2F0KSgobUluRGF0YVtpXSA+PiAxNikgJiAweGZmKTsKKyAgICAgICAgaW50IHcsIGgsIHI7CiAKLSAgICAgICAgICAgIGZpbmFsIGZsb2F0IGx1bWluYW5jZSA9IDAuMjEyNWYgKiByICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuNzE1NGYgKiBnICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDcyMWYgKiBiOwotICAgICAgICAgICAgaWYgKGx1bWluYW5jZSA+IHRocmVzaG9sZCkgewotICAgICAgICAgICAgICAgIG1PdXREYXRhW2ldID0gbUluRGF0YVtpXTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbU91dERhdGFbaV0gPSBtSW5EYXRhW2ldICYgMHhmZjAwMDAwMDsKKyAgICAgICAgZmxvYXQgZlJhZGl1cyA9IChmbG9hdCltUmFkaXVzOworICAgICAgICBpbnQgcmFkaXVzID0gKGludCltUmFkaXVzOworCisgICAgICAgIC8vIENvbXB1dGUgZ2F1c3NpYW4gd2VpZ2h0cyBmb3IgdGhlIGJsdXIKKyAgICAgICAgLy8gZSBpcyB0aGUgZXVsZXIncyBudW1iZXIKKyAgICAgICAgZmxvYXQgZSA9IDIuNzE4MjgxODI4NDU5MDQ1ZjsKKyAgICAgICAgZmxvYXQgcGkgPSAzLjE0MTU5MjY1MzU4OTc5MzJmOworICAgICAgICAvLyBnKHgpID0gKCAxIC8gc3FydCggMiAqIHBpICkgKiBzaWdtYSkgKiBlIF4gKCAteF4yIC8gMiAqIHNpZ21hXjIgKQorICAgICAgICAvLyB4IGlzIG9mIHRoZSBmb3JtIFstcmFkaXVzIC4uIDAgLi4gcmFkaXVzXQorICAgICAgICAvLyBhbmQgc2lnbWEgdmFyaWVzIHdpdGggcmFkaXVzLgorICAgICAgICAvLyBCYXNlZCBvbiBzb21lIGV4cGVyaW1lbnRhbCByYWRpdXMgdmFsdWVzIGFuZCBzaWdtYSdzCisgICAgICAgIC8vIHdlIGFwcHJveGltYXRlbHkgZml0IHNpZ21hID0gZihyYWRpdXMpIGFzCisgICAgICAgIC8vIHNpZ21hID0gcmFkaXVzICogMC40ICArIDAuNgorICAgICAgICAvLyBUaGUgbGFyZ2VyIHRoZSByYWRpdXMgZ2V0cywgdGhlIG1vcmUgb3VyIGdhdXNzaWFuIGJsdXIKKyAgICAgICAgL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bnRzIG5lZWQgdG8gYWRkIHVwIHRvIG9uZQorICAgICAgICBub3JtYWxpemVGYWN0b3IgPSAxLjBmIC8gbm9ybWFsaXplRmFjdG9yOworICAgICAgICBmb3IociA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICBmbG9hdFIgPSAoZmxvYXQpcjsKKyAgICAgICAgICAgIGdhdXNzaWFuW3IgKyByYWRpdXNdICo9IG5vcm1hbGl6ZUZhY3RvcjsKKyAgICAgICAgfQorCisgICAgICAgIGZsb2F0IGJsdXJyZWRQaXhlbFIgPSAwLjBmOworICAgICAgICBmbG9hdCBibHVycmVkUGl4ZWxHID0gMC4wZjsKKyAgICAgICAgZmxvYXQgYmx1cnJlZFBpeGVsQiA9IDAuMGY7CisgICAgICAgIGZsb2F0IGJsdXJyZWRQaXhlbEEgPSAwLjBmOworCisgICAgICAgIGZvcihoID0gMDsgaCA8IGhlaWdodDsgaCArKykgeworICAgICAgICAgICAgZm9yKHcgPSAwOyB3IDwgd2lkdGg7IHcgKyspIHsKKworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbFIgPSAwLjBmOworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbEcgPSAwLjBmOworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbEIgPSAwLjBmOworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbEEgPSAwLjBmOworCisgICAgICAgICAgICAgICAgZm9yKHIgPSAtcmFkaXVzOyByIDw9IHJhZGl1czsgciArKykgeworICAgICAgICAgICAgICAgICAgICAvLyBTdGVwcGluZyBsZWZ0IGFuZCByaWdodCBhd2F5IGZyb20gdGhlIHBpeGVsCisgICAgICAgICAgICAgICAgICAgIGludCB2YWxpZFcgPSB3ICsgcjsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ2xhbXAgdG8gemVybyBhbmQgd2lkdGggbWF4KCkgaXNuJ3QgZXhwb3NlZCBmb3IgaW50cyB5ZXQKKyAgICAgICAgICAgICAgICAgICAgaWYodmFsaWRXIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRXID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZih2YWxpZFcgPiB3aWR0aCAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkVyA9IHdpZHRoIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGludCBpbnB1dCA9IGluW2gqd2lkdGggKyB2YWxpZFddOworCisgICAgICAgICAgICAgICAgICAgIGludCBSID0gKChpbnB1dCA+PiAyNCkgJiAweGZmKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IEcgPSAoKGlucHV0ID4+IDE2KSAmIDB4ZmYpOworICAgICAgICAgICAgICAgICAgICBpbnQgQiA9ICgoaW5wdXQgPj4gOCkgJiAweGZmKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IEEgPSAoaW5wdXQgJiAweGZmKTsKKworICAgICAgICAgICAgICAgICAgICBmbG9hdCB3ZWlnaHQgPSBnYXVzc2lhbltyICsgcmFkaXVzXTsKKworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxSICs9IChmbG9hdCkoUikqd2VpZ2h0OworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxHICs9IChmbG9hdCkoRykqd2VpZ2h0OworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxCICs9IChmbG9hdCkoQikqd2VpZ2h0OworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxBICs9IChmbG9hdCkoQSkqd2VpZ2h0OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGludCBSID0gKGludClibHVycmVkUGl4ZWxSOworICAgICAgICAgICAgICAgIGludCBHID0gKGludClibHVycmVkUGl4ZWxHOworICAgICAgICAgICAgICAgIGludCBCID0gKGludClibHVycmVkUGl4ZWxCOworICAgICAgICAgICAgICAgIGludCBBID0gKGludClibHVycmVkUGl4ZWxBOworCisgICAgICAgICAgICAgICAgaW50ZXJtW2gqd2lkdGggKyB3XSA9IChSIDw8IDI0KSB8IChHIDw8IDE2KSB8IChCIDw8IDgpIHwgKEEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm9yKGggPSAwOyBoIDwgaGVpZ2h0OyBoICsrKSB7CisgICAgICAgICAgICBmb3IodyA9IDA7IHcgPCB3aWR0aDsgdyArKykgeworCisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsUiA9IDAuMGY7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsRyA9IDAuMGY7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQiA9IDAuMGY7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQSA9IDAuMGY7CisgICAgICAgICAgICAgICAgZm9yKHIgPSAtcmFkaXVzOyByIDw9IHJhZGl1czsgciArKykgeworICAgICAgICAgICAgICAgICAgICBpbnQgdmFsaWRIID0gaCArIHI7CisgICAgICAgICAgICAgICAgICAgIC8vIENsYW1wIHRvIHplcm8gYW5kIHdpZHRoCisgICAgICAgICAgICAgICAgICAgIGlmKHZhbGlkSCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkSCA9IDA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYodmFsaWRIID4gaGVpZ2h0IC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRIID0gaGVpZ2h0IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGludCBpbnB1dCA9IGludGVybVt2YWxpZEgqd2lkdGggKyB3XTsKKworICAgICAgICAgICAgICAgICAgICBpbnQgUiA9ICgoaW5wdXQgPj4gMjQpICYgMHhmZik7CisgICAgICAgICAgICAgICAgICAgIGludCBHID0gKChpbnB1dCA+PiAxNikgJiAweGZmKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IEIgPSAoKGlucHV0ID4+IDgpICYgMHhmZik7CisgICAgICAgICAgICAgICAgICAgIGludCBBID0gKGlucHV0ICYgMHhmZik7CisKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgd2VpZ2h0ID0gZ2F1c3NpYW5bciArIHJhZGl1c107CisKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsUiArPSAoZmxvYXQpKFIpKndlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsRyArPSAoZmxvYXQpKEcpKndlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQiArPSAoZmxvYXQpKEIpKndlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQSArPSAoZmxvYXQpKEEpKndlaWdodDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpbnQgUiA9IChpbnQpYmx1cnJlZFBpeGVsUjsKKyAgICAgICAgICAgICAgICBpbnQgRyA9IChpbnQpYmx1cnJlZFBpeGVsRzsKKyAgICAgICAgICAgICAgICBpbnQgQiA9IChpbnQpYmx1cnJlZFBpeGVsQjsKKyAgICAgICAgICAgICAgICBpbnQgQSA9IChpbnQpYmx1cnJlZFBpeGVsQTsKKworICAgICAgICAgICAgICAgIG91dFtoKndpZHRoICsgd10gPSAoUiA8PCAyNCkgfCAoRyA8PCAxNikgfCAoQiA8PCA4KSB8IChBKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCiAgICAgICAgIHQgPSBqYXZhLmxhbmcuU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSB0OworICAgICAgICBhbmRyb2lkLnV0aWwuTG9nLnYoIkltZyIsICJKYXZhIGZyYW1lIHRpbWUgbXMgIiArIHQpOworICAgICAgICBtQml0bWFwT3V0LnNldFBpeGVscyhvdXQsIDAsIHdpZHRoLCAwLCAwLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgcmV0dXJuIHQ7CisgICAgfQogCi0gICAgICAgIGFuZHJvaWQudXRpbC5Mb2cudigiSW1nIiwgImZyYW1lIHRpbWUgbXMgIiArIHQpOworICAgIHB1YmxpYyB2b2lkIG9uUHJvZ3Jlc3NDaGFuZ2VkKFNlZWtCYXIgc2Vla0JhciwgaW50IHByb2dyZXNzLCBib29sZWFuIGZyb21Vc2VyKSB7CisgICAgICAgIGlmIChmcm9tVXNlcikgeworCisgICAgICAgICAgICBpZihzZWVrQmFyID09IG1SYWRpdXNTZWVrQmFyKSB7CisgICAgICAgICAgICAgICAgZmxvYXQgZlJhZGl1cyA9IHByb2dyZXNzIC8gMTAwLjBmOworICAgICAgICAgICAgICAgIGZSYWRpdXMgKj0gKGZsb2F0KShNQVhfUkFESVVTKTsKKyAgICAgICAgICAgICAgICBtUmFkaXVzID0gKGludClmUmFkaXVzOworCisgICAgICAgICAgICAgICAgbVNjcmlwdC5zZXRfcmFkaXVzKG1SYWRpdXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihzZWVrQmFyID09IG1JbkJsYWNrU2Vla0JhcikgeworICAgICAgICAgICAgICAgIG1JbkJsYWNrID0gKGZsb2F0KXByb2dyZXNzOworICAgICAgICAgICAgICAgIG1TY3JpcHRWQmx1ci5pbnZva2Vfc2V0TGV2ZWxzKG1JbkJsYWNrLCBtT3V0QmxhY2ssIG1JbldoaXRlLCBtT3V0V2hpdGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihzZWVrQmFyID09IG1PdXRCbGFja1NlZWtCYXIpIHsKKyAgICAgICAgICAgICAgICBtT3V0QmxhY2sgPSAoZmxvYXQpcHJvZ3Jlc3M7CisgICAgICAgICAgICAgICAgbVNjcmlwdFZCbHVyLmludm9rZV9zZXRMZXZlbHMobUluQmxhY2ssIG1PdXRCbGFjaywgbUluV2hpdGUsIG1PdXRXaGl0ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHNlZWtCYXIgPT0gbUluV2hpdGVTZWVrQmFyKSB7CisgICAgICAgICAgICAgICAgbUluV2hpdGUgPSAoZmxvYXQpcHJvZ3Jlc3MgKyAxMjcuMGY7CisgICAgICAgICAgICAgICAgbVNjcmlwdFZCbHVyLmludm9rZV9zZXRMZXZlbHMobUluQmxhY2ssIG1PdXRCbGFjaywgbUluV2hpdGUsIG1PdXRXaGl0ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHNlZWtCYXIgPT0gbU91dFdoaXRlU2Vla0JhcikgeworICAgICAgICAgICAgICAgIG1PdXRXaGl0ZSA9IChmbG9hdClwcm9ncmVzcyArIDEyNy4wZjsKKyAgICAgICAgICAgICAgICBtU2NyaXB0VkJsdXIuaW52b2tlX3NldExldmVscyhtSW5CbGFjaywgbU91dEJsYWNrLCBtSW5XaGl0ZSwgbU91dFdoaXRlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoc2Vla0JhciA9PSBtR2FtbWFTZWVrQmFyKSB7CisgICAgICAgICAgICAgICAgbUdhbW1hID0gKGZsb2F0KXByb2dyZXNzLzEwMC4wZjsKKyAgICAgICAgICAgICAgICBtR2FtbWEgPSBNYXRoLm1heChtR2FtbWEsIDAuMWYpOworICAgICAgICAgICAgICAgIG1HYW1tYSA9IDEuMGYgLyBtR2FtbWE7CisgICAgICAgICAgICAgICAgbVNjcmlwdFZCbHVyLmludm9rZV9zZXRHYW1tYShtR2FtbWEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihzZWVrQmFyID09IG1TYXR1cmF0aW9uU2Vla0JhcikgeworICAgICAgICAgICAgICAgIG1TYXR1cmF0aW9uID0gKGZsb2F0KXByb2dyZXNzIC8gNTAuMGY7CisgICAgICAgICAgICAgICAgbVNjcmlwdFZCbHVyLmludm9rZV9zZXRTYXR1cmF0aW9uKG1TYXR1cmF0aW9uKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbG9uZyB0ID0gamF2YS5sYW5nLlN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOworICAgICAgICAgICAgaWYgKHRydWUpIHsKKyAgICAgICAgICAgICAgICBtU2NyaXB0Lmludm9rZV9maWx0ZXIoKTsKKyAgICAgICAgICAgICAgICBtUlMuZmluaXNoKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGphdmFGaWx0ZXIoKTsKKyAgICAgICAgICAgICAgICBtRGlzcGxheVZpZXcuaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0ID0gamF2YS5sYW5nLlN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gdDsKKyAgICAgICAgICAgIGFuZHJvaWQudXRpbC5Mb2cudigiSW1nIiwgIlJlbmRlcnNjcmlwdCBmcmFtZSB0aW1lIGNvcmUgbXMgIiArIHQpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb25TdGFydFRyYWNraW5nVG91Y2goU2Vla0JhciBzZWVrQmFyKSB7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb25TdG9wVHJhY2tpbmdUb3VjaChTZWVrQmFyIHNlZWtCYXIpIHsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTExOSw0NSArMzExLDU0IEBACiAgICAgICAgIHN1cGVyLm9uQ3JlYXRlKHNhdmVkSW5zdGFuY2VTdGF0ZSk7CiAgICAgICAgIHNldENvbnRlbnRWaWV3KFIubGF5b3V0Lm1haW4pOwogCi0gICAgICAgIG1CaXRtYXAgPSBsb2FkQml0bWFwKFIuZHJhd2FibGUuZGF0YSk7CisgICAgICAgIG1CaXRtYXBJbiA9IGxvYWRCaXRtYXAoUi5kcmF3YWJsZS5kYXRhKTsKKyAgICAgICAgbUJpdG1hcE91dCA9IGxvYWRCaXRtYXAoUi5kcmF3YWJsZS5kYXRhKTsKKyAgICAg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hpcyk7CiAKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRydWUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1JbnZva2FibGUuZXhlY3V0ZSgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgamF2YUZpbHRlcigpOwotICAgICAgICAgICAgICAgICAgICAgICAgbUJpdG1hcC5zZXRQaXhlbHMobU91dERhdGEsIDAsIG1QYXJhbXMub3V0V2lkdGgsIDAsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QYXJhbXMub3V0V2lkdGgsIG1QYXJhbXMub3V0SGVpZ2h0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1EaXNwbGF5Vmlldy5pbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CisgICAgICAgIG1JbkJsYWNrU2Vla0JhciA9IChTZWVrQmFyKWZpbmRWaWV3QnlJZChSLmlkLmluQmxhY2spOworICAgICAgICBtSW5CbGFja1NlZWtCYXIuc2V0T25TZWVrQmFyQ2hhbmdlTGlzdGVuZXIodGhpcyk7CisgICAgICAgIG1JbkJsYWNrU2Vla0Jhci5zZXRNYXgoMTI4KTsKKyAgICAgICAgbUluQmxhY2tTZWVrQmFyLnNldFByb2dyZXNzKDApOworICAgICAgICBtT3V0QmxhY2tTZWVrQmFyID0gKFNlZWtCYXIpZmluZFZpZXdCeUlkKFIuaWQub3V0QmxhY2spOworICAgICAgICBtT3V0QmxhY2tTZWVrQmFyLnNldE9uU2Vla0JhckNoYW5nZUxpc3RlbmVyKHRoaXMpOworICAgICAgICBtT3V0QmxhY2tTZWVrQmFyLnNldE1heCgxMjgpOworICAgICAgICBtT3V0QmxhY2tTZWVrQmFyLnNldFByb2dyZXNzKDApOwogCi0gICAgICAgICAgICBwdWJsaWMgdm9pZCBvblN0YXJ0VHJhY2tpbmdUb3Vja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cHQobVNjcmlwdEhCbHVyKTsKICAgICB9CiAKICAgICBwcml2YXRlIEJpdG1hcCBsb2FkQml0bWFwKGludCByZXNvdXJjZSkgewpAQCAtMjI5LDQgKzQxNCwzMCBAQAogICAgICAgICBzb3VyY2UucmVjeWNsZSgpOwogICAgICAgICByZXR1cm4gYjsKICAgICB9CisKKyAgICAvLyBidXR0b24gaG9vaworICAgIHB1YmxpYyB2b2lkIGJlbmNobWFyayhWaWV3IHYpIHsKKyAgICAgICAgYW5kcm9pZC51dGlsLkxvZy52KCJJbWciLCAiQmVuY2htYXJraW5nIik7CisgICAgICAgIGludCBvbGRSYWRpdXMgPSBtUmFkaXVzOworICAgICAgICBtUmFkaXVzID0gTUFYX1JBRElVUzsKKyAgICAgICAgbVNjcmlwdC5zZXRfcmFkaXVzKG1SYWRpdXMpOworCisgICAgICAgIGxvbmcgdCA9IGphdmEubGFuZy5TeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKworICAgICAgICBtU2NyaXB0Lmludm9rZV9maWx0ZXIoKTsKKyAgICAgICAgbVJTLmZpbmlzaCgpOworCisgICAgICAgIHQgPSBqYXZhLmxhbmcuU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSB0OworICAgICAgICBhbmRyb2lkLnV0aWwuTG9nLnYoIkltZyIsICJSZW5kZXJzY3JpcHQgZnJhbWUgdGltZSBjb3JlIG1zICIgKyB0KTsKKworICAgICAgICAvL2xvbmcgamF2YVRpbWUgPSBqYXZhRmlsdGVyKCk7CisgICAgICAgIC8vbUJlbmNobWFya1Jlc3VsdC5zZXRUZXh0KCJSUzogIiArIHQgKyAiIG1zICBKYXZhOiAiICsgamF2YVRpbWUgKyAiIG1zIik7CisgICAgICAgIG1CZW5jaG1hcmtSZXN1bHQuc2V0VGV4dCgiUlM6ICIgKyB0ICsgIiBtcyIpOworCisgICAgICAgIG1SYWRpdXMgPSBvbGRSYWRpdXM7CisgICAgICAgIG1TY3JpcHQuc2V0X3JhZGl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aCAtIGZzLT5yYWRpdXMpKSkgeworICAgICAgICBjb25zdCBmbG9hdDQgKmkgPSBpbnB1dCArICh4IC0gZnMtPnJhZGl1cyk7CisgICAgICAgIGZvcihpbnQgciA9IC1mcy0+cmFkaXVzOyByIDw9IGZzLT5yYWRpdXM7IHIgKyspIHsKKyAgICAgICAgICAgIGJsdXJyZWRQaXhlbCArPSBpLT54eXogKiBnUHRyWzBdOworICAgICAgICAgICAgZ1B0cisrOworICAgICAgICAgICAgaSsrOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgZm9yKGludCByID0gLWZzLT5yYWRpdXM7IHIgPD0gZnMtPnJhZGl1czsgciArKykgeworICAgICAgICAgICAgLy8gU3RlcHBpbmcgbGVmdCBhbmQgcmlnaHQgYXdheSBmcm9tIHRoZSBwaXhlbAorICAgICAgICAgICAgaW50IHZhbGlkVyA9IHJzQ2xhbXAoeCArIHIsICh1aW50KTAsICh1aW50KShmcy0+d2lkdGggLSAxKSk7CisgICAgICAgICAgICBibHVycmVkUGl4ZWwgKz0gaW5wdXRbdmFsaWRXXS54eXogKiBnUHRyWzBdOworICAgICAgICAgICAgZ1B0cisrOworICAgICAgICB9CisgICAgfQorCisgICAgb3V0cHV0LT54eXogPSBibHVycmVkUGl4ZWw7Cit9CisKZGlmZiAtLWdpdCBhL2xpYnMvcnMvamF2YS9JbWFnZVByb2Nlc3Npbmcvc3JjL2NvbS9hbmRyb2lkL3JzL2ltYWdlL2lwLnJzaCBiL2xpYnMvcnMvamF2YS9JbWFnZVByb2Nlc3Npbmcvc3JjL2NvbS9hbmRyb2lkL3JzL2ltYWdlL2lwLnJzaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xZDdhNzE5Ci0tLSAvZGV2L251bGwKKysrIGIvbGlicy9ycy9qYXZhL0ltYWdlUHJvY2Vzc2luZy9zcmMvY29tL2FuZHJvaWQvcnMvaW1hZ2UvaXAucnNoCkBAIC0wLDAgKzEsMT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F0NCAqaSA9IGlucHV0ICsgKCh5IC0gZnMtPnJhZGl1cykgKiBmcy0+d2lkdGgpOworICAgICAgICBmb3IoaW50IHIgPSAtZnMtPnJhZGl1czsgciA8PSBmcy0+cmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICBibHVycmVkUGl4ZWwgKz0gaS0+eHl6ICogZ1B0clswXTsKKyAgICAgICAgICAgIGdQdHIrKzsKKyAgICAgICAgICAgIGkgKz0gZnMtPndpZHRoOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgZm9yKGludCByID0gLWZzLT5yYWRpdXM7IHIgPD0gZnMtPnJhZGl1czsgciArKykgeworICAgICAgICAgICAgaW50IHZhbGlkSCA9IHJzQ2xhbXAoeSArIHIsICh1aW50KTAsICh1aW50KShmcy0+aGVpZ2h0IC0gMSkpOworICAgICAgICAgICAgY29uc3QgZmxvYXQ0ICppID0gaW5wdXQgKyB2YWxpZEggKiBmcy0+d2lkdGg7CisgICAgICAgICAgICBibHVycmVkUGl4ZWwgKz0gaS0+eHl6ICogZ1B0clswXTsKKyAgICAgICAgICAgIGdQdHIrKzsKKyAgICAgICAgfQorICAgIH0KKworICAgIGZsb2F0MyB0ZW1wID0gcnNNYXRyaXhNdWx0aXBseSgmY29sb3JNYXQsIGJsdXJyZWRQaXhlbCk7CisgICAgdGVtcCA9IChjbGFtcCh0ZW1wLCAwLmYsIDI1NS5mKSAtIGluQmxhY2spICogb3ZlckluV01pbkluQjsKKyAgICBpZiAoZ2FtbWEueCAhPSAxLjBmKQorICAgICAgICB0ZW1wID0gcG93KHRlbXAsIChmbG9hdDMpZ2FtbWEpOworICAgIHRlbXAgPSBjbGFtcCh0ZW1wICogb3V0V01pbk91dEIgKyBvdXRCbGFjaywgMC5mLCAyNTUuZik7CisKKyAgICBvdXRwdXQtPnh5eiA9IGNvbnZlcnRfdWNoYXIzKHRlbXApOworICAgIC8vb3V0cHV0LT53ID0gaW5wdXQtPnc7Cit9CisKZGlmZiAtLWdpd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ICAgIHByaXZhdGUgTWVzaCBtTWVzaDsKKworICAgIHByaXZhdGUgRm9udCBtSXRhbGljOworICAgIHByaXZhdGUgQWxsb2NhdGlvbiBtVGV4dEFsbG9jOworCisgICAgcHJpdmF0ZSBTY3JpcHRDX3NjZW5lZ3JhcGggbVNjcmlwdDsKKyAgICBwcml2YXRlIFNjcmlwdENfdHJhbnNmb3JtIG1UcmFuc2Zvcm1TY3JpcHQ7CisKKyAgICBpbnQgbUxhc3RYOworICAgIGludCBtTGFzdFk7CisKKyAgICBwdWJsaWMgdm9pZCB0b3VjaEV2ZW50KGludCB4LCBpbnQgeSkgeworICAgICAgICBpbnQgZHggPSBtTGFzdFggLSB4OworICAgICAgICBpZihNYXRoLmFicyhkeCkgPiA1MCB8fCBNYXRoLmFicyhkeCkgPCAzKSB7CisgICAgICAgICAgICBkeCA9IDA7CisgICAgICAgIH0KKworICAgICAgICBtUm90YXRpb24gLT0gZHg7CisgICAgICAgIGlmKG1Sb3RhdGlvbiA+IDM2MCkgeworICAgICAgICAgICAgbVJvdGF0aW9uIC09IDM2MDsKKyAgICAgICAgfQorICAgICAgICBpZihtUm90YXRpb24gPCAwKSB7CisgICAgICAgICAgICBtUm90YXRpb24gKz0gMzYwOworICAgICAgICB9CisKKyAgICAgICAgbVNjcmlwdC5zZXRfZ1JvdGF0ZSgtKGZsb2F0KW1Sb3RhdGlvbik7CisKKyAgICAgICAgbUxhc3RYID0geDsKKyAgICAgICAgbUxhc3RZID0geTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgaW5pdFBGUygpIHsKKyAgICAgICAgUHJvZ3JhbVN0b3JlLkJ1aWxkZXIgYiA9IG5ldyBQcm9ncmFtU3RvcmUuQnVpbGRlcihtUlMpOworCisgICAgICAgIGIuc2V0RGVwdGhGdW5jKFByb2dyYW1TdG9yZS5EZXB0aEZ1bmMuTEVTUyk7CisgICAgICAgIGIuc2V0RGl0aGVyRW5hYmxlKGZhbHNlKTsKKyAgICAgICAgYi5zZ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W50cnkuZ2V0Q2xhc3NJRCgpICE9IEZpbGVBM0QuQ2xhc3NJRC5NRVNIKSB7CisgICAgICAgICAgICBMb2cuZSgicnMiLCAiY291bGQgbm90IGxvYWQgbW9kZWwiKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIG1NZXNoID0gKE1lc2gpZW50cnkuZ2V0T2JqZWN0KCk7CisgICAgICAgICAgICBtU2NyaXB0LnNldF9nVGVzdE1lc2gobU1lc2gpOworICAgICAgICB9CisKKyAgICAgICAgbUl0YWxpYyA9IEZvbnQuY3JlYXRlKG1SUywgbVJlcywgIkRyb2lkU2VyaWYtSXRhbGljLnR0ZiIsIDgpOworICAgICAgICBtU2NyaXB0LnNldF9nSXRhbGljKG1JdGFsaWMpOworCisgICAgICAgIGluaXRUZXh0QWxsb2NhdGlvbigpOworCisgICAgICAgIGluaXRUcmFuc2Zvcm1IaWVyYXJjaHkoKTsKKworICAgICAgICBMb2cudigiPT09PT09PT1TY2VuZUdyYXBoPT09PT09PT0iLCAidHJhbnNmb3JtIGhpZXJhcmNoeSBpbml0aWFsaXplZCIpOworCisgICAgICAgIG1TY3JpcHQuYmluZF9nUm9vdE5vZGUobVJvb3RUcmFuc2Zvcm0uZ2V0RmllbGQoKSk7CisKKyAgICAgICAgbVNjcmlwdC5iaW5kX2dHcm91cChtR3JvdXAxLm1QYXJlbnQubUNoaWxkRmllbGQpOworICAgICAgICBtU2NyaXB0LmJpbmRfZ1JvYm90MShtUm9ib3QxLm1QYXJlbnQubUNoaWxkRmllbGQpOworICAgICAgICBtU2NyaXB0LnNldF9nUm9ib3QxSW5kZXgobVJvYm90MS5tSW5kZXhJblBhcmVudEdyb3VwKTsKKyAgICAgICAgbVNjcmlwdC5iaW5kX2dSb2JvdDIobVJvYm90Mi5tUGFyZW50Lm1DaGlsZEZpZWxkKTsKKyAgICAgICAgbVNjcmlwdC5zZXRfZ1JvYm90MkluZGV4KG1Sb2JvdDIubUluZGV4SW5QYXJ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ICBtUmVuZGVyLmluaXQobVJTLCBnZXRSZXNvdXJjZXMoKSwgdywgaCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkRldGFjaGVkRnJvbVdpbmRvdygpIHsKKyAgICAgICAgaWYobVJTICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1SUyA9IG51bGw7CisgICAgICAgICAgICBkZXN0cm95UmVuZGVyU2NyaXB0KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvbktleURvd24oaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50KQorICAgIHsKKyAgICAgICAgLy8gYnJlYWsgcG9pbnQgYXQgaGVyZQorICAgICAgICAvLyB0aGlzIG1ldGhvZCBkb2Vzbid0IHdvcmsgd2hlbiAnZXh0ZW5kcyBWaWV3JyBpbmNsdWRlICdleHRlbmRzIFNjcm9sbFZpZXcnLgorICAgICAgICByZXR1cm4gc3VwZXIub25LZXlEb3duKGtleUNvZGUsIGV2ZW50KTsKKyAgICB9CisKKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikKKyAgICB7CisgICAgICAgIGJvb2xlYW4gcmV0ID0gdHJ1ZTsKKyAgICAgICAgaW50IGFjdCA9IGV2LmdldEFjdGlvbigpOworICAgICAgICBpZiAoYWN0ID09IGV2LkFDVElPTl9VUCkgeworICAgICAgICAgICAgcmV0ID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBtUmVuZGVyLnRvdWNoRXZlbnQoKGludClldi5nZXRYKCksIChpbnQpZXYuZ2V0WSgpKTsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9Cit9CisKKwpkaWZmIC0tZ2l0IGEvbGlicy9ycy9qYXZhL01vZGVsVmlld2VyL3NyYy9jb20vYW5kcm9pZC9tb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pb24gLT0gMzYwOworICAgICAgICB9CisgICAgICAgIGlmKG1Sb3RhdGlvbiA8IDApIHsKKyAgICAgICAgICAgIG1Sb3RhdGlvbiArPSAzNjA7CisgICAgICAgIH0KKworICAgICAgICBtU2NyaXB0LnNldF9nUm90YXRlKChmbG9hdCltUm90YXRpb24pOworCisgICAgICAgIG1MYXN0WCA9IHg7CisgICAgICAgIG1MYXN0WSA9IHk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGluaXRQRlMoKSB7CisgICAgICAgIFByb2dyYW1TdG9yZS5CdWlsZGVyIGIgPSBuZXcgUHJvZ3JhbVN0b3JlLkJ1aWxkZXIobVJTKTsKKworICAgICAgICBiLnNldERlcHRoRnVuYyhQcm9ncmFtU3RvcmUuRGVwdGhGdW5jLkxFU1MpOworICAgICAgICBiLnNldERpdGhlckVuYWJsZShmYWxzZSk7CisgICAgICAgIGIuc2V0RGVwdGhNYXNrKHRydWUpOworICAgICAgICBtUFNCYWNrZ3JvdW5kID0gYi5jcmVhdGUoKTsKKworICAgICAgICBtU2NyaXB0LnNldF9nUEZTQmFja2dyb3VuZChtUFNCYWNrZ3JvdW5kKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgaW5pdFBGKCkgeworICAgICAgICBTYW1wbGVyLkJ1aWxkZXIgYnMgPSBuZXcgU2FtcGxlci5CdWlsZGVyKG1SUyk7CisgICAgICAgIGJzLnNldE1pbihTYW1wbGVyLlZhbHVlLkxJTkVBUik7CisgICAgICAgIGJzLnNldE1hZyhTYW1wbGVyLlZhbHVlLkxJTkVBUik7CisgICAgICAgIGJzLnNldFdyYXBTKFNhbXBsZXIuVmFsdWUuQ0xBTVApOworICAgICAgICBicy5zZXRXcmFwVChTYW1wbGVyLlZhbHVlLkNMQU1QKTsKKyAgICAgICAgbVNhbXBsZXIgPSBicy5jcmVhdGUoKTsKKworICAgICAgICBQcm9ncmFtRnJhZ21lbnQuQnVpbGRlciBiID0gbmV3IFByb2dyYW1GcmF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ICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0VGV4dEFsbG9jYXRpb24oKSB7CisgICAgICAgIFN0cmluZyBhbGxvY1N0cmluZyA9ICJEaXNwbGF5aW5nIGZpbGU6IFIucmF3LnJvYm90IjsKKyAgICAgICAgbVRleHRBbGxvYyA9IEFsbG9jYXRpb24uY3JlYXRlRnJvbVN0cmluZyhtUlMsIGFsbG9jU3RyaW5nKTsKKyAgICAgICAgbVNjcmlwdC5zZXRfZ1RleHRBbGxvYyhtVGV4dEFsbG9jKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgaW5pdFJTKCkgeworCisgICAgICAgIG1TY3JpcHQgPSBuZXcgU2NyaXB0Q19zaW1wbGVtb2RlbChtUlMsIG1SZXMsIFIucmF3LnNpbXBsZW1vZGVsLCB0cnVlKTsKKworICAgICAgICBpbml0UEZTKCk7CisgICAgICAgIGluaXRQRigpOworICAgICAgICBpbml0UFYoKTsKKworICAgICAgICBsb2FkSW1hZ2UoKTsKKworICAgICAgICBGaWxlQTNEIG1vZGVsID0gRmlsZUEzRC5jcmVhdGVGcm9tUmVzb3VyY2UobVJTLCBtUmVzLCBSLnJhdy5yb2JvdCk7CisgICAgICAgIEZpbGVBM0QuSW5kZXhFbnRyeSBlbnRyeSA9IG1vZGVsLmdldEluZGV4RW50cnkoMCk7CisgICAgICAgIGlmKGVudHJ5ID09IG51bGwgfHwgZW50cnkuZ2V0Q2xhc3NJRCgpICE9IEZpbGVBM0QuQ2xhc3NJRC5NRVNIKSB7CisgICAgICAgICAgICBMb2cuZSgicnMiLCAiY291bGQgbm90IGxvYWQgbW9kZWwiKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIG1NZXNoID0gKE1lc2gpZW50cnkuZ2V0T2JqZWN0KCk7CisgICAgICAgICAgICBtU2NyaXB0LnNldF9nVGVzdE1lc2gobU1lc2gpOworICAgICAgICB9CisKKyAgICAgICAgbUl0YWxpYyA9IEZvbnQu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wdChzYyk7CisgICAgICAgICAgICBtUlMuY29udGV4dFNldFN1cmZhY2UodywgaCwgaG9sZGVyLmdldFN1cmZhY2UoKSk7CisgICAgICAgICAgICBtUmVuZGVyID0gbmV3IFNpbXBsZU1vZGVsUlMoKTsKKyAgICAgICAgICAgIG1SZW5kZXIuaW5pdChtUlMsIGdldFJlc291cmNlcygpLCB3LCBoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uRGV0YWNoZWRGcm9tV2luZG93KCkgeworICAgICAgICBpZihtUlMgIT0gbnVsbCkgeworICAgICAgICAgICAgbVJTID0gbnVsbDsKKyAgICAgICAgICAgIGRlc3Ryb3lSZW5kZXJTY3JpcHQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uS2V5RG93bihpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpCisgICAgeworICAgICAgICAvLyBicmVhayBwb2ludCBhdCBoZXJlCisgICAgICAgIC8vIHRoaXMgbWV0aG9kIGRvZXNuJ3Qgd29yayB3aGVuICdleHRlbmRzIFZpZXcnIGluY2x1ZGUgJ2V4dGVuZHMgU2Nyb2xsVmlldycuCisgICAgICAgIHJldHVybiBzdXBlci5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpOworICAgIH0KKworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25Ub3VjaEV2ZW50KE1vdGlvbkV2ZW50IGV2KQorICAgIHsKKyAgICAgICAgYm9vbGVhbiByZXQgPSB0cnVlOworICAgICAgICBpbnQgYWN0ID0gZXYuZ2V0QWN0aW9uKCk7CisgICAgICAgIGlmIChhY3QgPT0gZXYuQUNUSU9OX1VQKSB7CisgICAgICAgICAgICByZXQgPSBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIG1SZW5kZXIudG91Y2hFdmVudCgoaW50KWV2LmdldFgoK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lmKGRhdGEtPmlzRGlydHkpIHsKKyAgICAgICAgZGF0YS0+aXNEaXJ0eSA9IDA7CisgICAgICAgIHRvQ2hpbGQuY2hhbmdlZCA9IDE7CisKKyAgICAgICAgLy8gUmVzZXQgb3VyIGxvY2FsIG1hdHJpeAorICAgICAgICByc01hdHJpeExvYWRJZGVudGl0eShsb2NhbE1hdCk7CisKKyAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IDE2OyBpICsrKSB7CisgICAgICAgICAgICBpZihkYXRhLT50cmFuc2Zvcm1UeXBlc1tpXSA9PSBUUkFOU0ZPUk1fTk9ORSkgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy9yc0RlYnVnKCJUcmFuc2Zvcm0gYWRkaW5nIHRyYW5zZm9ybWF0aW9uIiwgdHJhbnNmb3JtVHlwZXNbaV0pOworICAgICAgICAgICAgYXBwZW5kVHJhbnNmb3JtYXRpb24oZGF0YS0+dHJhbnNmb3JtVHlwZXNbaV0sIGRhdGEtPnRyYW5zZm9ybXNbaV0sIGxvY2FsTWF0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vcnNEZWJ1ZygiVHJhbnNmb3JtIGNoZWNraW5nIHBhcmVudCIsIChpbnQpMCk7CisKKyAgICBpZihwYXJlbnQpIHsKKyAgICAgICAgaWYocGFyZW50LT5jaGFuZ2VkKSB7CisgICAgICAgICAgICB0b0NoaWxkLmNoYW5nZWQgPSAxOworCisgICAgICAgICAgICByc01hdHJpeExvYWQoZ2xvYmFsTWF0LCBwYXJlbnQtPm1hdCk7CisgICAgICAgICAgICByc01hdHJpeE11bHRpcGx5KGdsb2JhbE1hdCwgbG9jYWxNYXQpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgeworICAgICAgICByc01hdHJpeExvYWQoZ2xvYmFsTWF0LCBsb2NhbE1hdCk7CisgICAgfQorCisgICAgLy9yc0RlYnVnKCJUcmFuc2Zvcm0gY2FsbGluZyBzZWxm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KworICAgIHB1YmxpYyB2b2lkIGluaXQoUmVuZGVyU2NyaXB0R0wgcnMsIFJlc291cmNlcyByZXMsIGludCB3aWR0aCwgaW50IGhlaWdodCkgeworICAgICAgICBtUlMgPSByczsKKyAgICAgICAgbVJlcyA9IHJlczsKKyAgICAgICAgbVdpZHRoID0gd2lkdGg7CisgICAgICAgIG1IZWlnaHQgPSBoZWlnaHQ7CisgICAgICAgIGluaXRSUygpOworICAgIH0KKworICAgIHByaXZhdGUgUmVzb3VyY2VzIG1SZXM7CisgICAgcHJpdmF0ZSBSZW5kZXJTY3JpcHRHTCBtUlM7CisgICAgcHJpdmF0ZSBGb250IG1JdGFsaWM7CisKKyAgICBTY3JpcHRGaWVsZF9MaXN0QWxsb2NzX3MgbUxpc3RBbGxvY3M7CisKKyAgICBwcml2YXRlIFNjcmlwdENfcnNsaXN0IG1TY3JpcHQ7CisKKyAgICBpbnQgbUxhc3RYOworICAgIGludCBtTGFzdFk7CisKKyAgICBwdWJsaWMgdm9pZCBvbkFjdGlvbkRvd24oaW50IHgsIGludCB5KSB7CisgICAgICAgIG1TY3JpcHQuc2V0X2dEWSgwLjBmKTsKKworICAgICAgICBtTGFzdFggPSB4OworICAgICAgICBtTGFzdFkgPSB5OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG9uQWN0aW9uTW92ZShpbnQgeCwgaW50IHkpIHsKKyAgICAgICAgaW50IGR4ID0gbUxhc3RYIC0geDsKKyAgICAgICAgaW50IGR5ID0gbUxhc3RZIC0geTsKKworICAgICAgICBpZihNYXRoLmFicyhkeSkgPD0gMikgeworICAgICAgICAgICAgZHkgPSAwOworICAgICAgICB9CisKKyAgICAgICAgbVNjcmlwdC5zZXRfZ0RZKGR5KTsKKworICAgICAgICBtTGFzdFggPSB4OworICAgICAgICBtTGFzdFkgPSB5OworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0UlMoKSB7CisKKyAgICAgICAgbVNjcmlwdCA9IG5ldyBTY3JpcHRDX3Jzb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y9zZXRGb2N1c2FibGUodHJ1ZSk7CisgICAgfQorCisgICAgcHJpdmF0ZSBSZW5kZXJTY3JpcHRHTCBtUlM7CisgICAgcHJpdmF0ZSBSc0xpc3RSUyBtUmVuZGVyOworCisKKyAgICBwdWJsaWMgdm9pZCBzdXJmYWNlQ2hhbmdlZChTdXJmYWNlSG9sZGVyIGhvbGRlciwgaW50IGZvcm1hdCwgaW50IHcsIGludCBoKSB7CisgICAgICAgIHN1cGVyLnN1cmZhY2VDaGFuZ2VkKGhvbGRlciwgZm9ybWF0LCB3LCBoKTsKKyAgICAgICAgaWYgKG1SUyA9PSBudWxsKSB7CisgICAgICAgICAgICBSZW5kZXJTY3JpcHRHTC5TdXJmYWNlQ29uZmlnIHNjID0gbmV3IFJlbmRlclNjcmlwdEdMLlN1cmZhY2VDb25maWcoKTsKKyAgICAgICAgICAgIHNjLnNldERlcHRoKDE2LCAyNCk7CisgICAgICAgICAgICBtUlMgPSBjcmVhdGVSZW5kZXJTY3JpcHQoc2MpOworICAgICAgICAgICAgbVJTLmNvbnRleHRTZXRTdXJmYWNlKHcsIGgsIGhvbGRlci5nZXRTdXJmYWNlKCkpOworICAgICAgICAgICAgbVJlbmRlciA9IG5ldyBSc0xpc3RSUygpOworICAgICAgICAgICAgbVJlbmRlci5pbml0KG1SUywgZ2V0UmVzb3VyY2VzKCksIHcsIGgpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25EZXRhY2hlZEZyb21XaW5kb3coKSB7CisgICAgICAgIGlmKG1SUyAhPSBudWxsKSB7CisgICAgICAgICAgICBtUlMgPSBudWxsOworICAgICAgICAgICAgZGVzdHJveVJlbmRlclNjcmlwdCgpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25LZXlEb3duKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkKKyAgICB7CisgICAgICAgIC8vIGJ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oKGZsb2F0IHdpZHRoLCBmbG9hdCBoZWlnaHQsIGludCB3UmVzb2x1dGlvbiwgaW50IGhSZXNvbHV0aW9uKSB7CisKKyAgICAgICAgTWVzaC5UcmlhbmdsZU1lc2hCdWlsZGVyIHRtYiA9IG5ldyBNZXNoLlRyaWFuZ2xlTWVzaEJ1aWxkZXIobVJTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIsIE1lc2guVHJpYW5nbGVNZXNoQnVpbGRlci5URVhUVVJFXzApOworCisgICAgICAgIGZvciAoaW50IHkgPSAwOyB5IDw9IGhSZXNvbHV0aW9uOyB5KyspIHsKKyAgICAgICAgICAgIGZpbmFsIGZsb2F0IG5vcm1hbGl6ZWRZID0gKGZsb2F0KXkgLyBoUmVzb2x1dGlvbjsKKyAgICAgICAgICAgIGZpbmFsIGZsb2F0IHlPZmZzZXQgPSAobm9ybWFsaXplZFkgLSAwLjVmKSAqIGhlaWdodDsKKyAgICAgICAgICAgIGZvciAoaW50IHggPSAwOyB4IDw9IHdSZXNvbHV0aW9uOyB4KyspIHsKKyAgICAgICAgICAgICAgICBmbG9hdCBub3JtYWxpemVkWCA9IChmbG9hdCl4IC8gd1Jlc29sdXRpb247CisgICAgICAgICAgICAgICAgZmxvYXQgeE9mZnNldCA9IChub3JtYWxpemVkWCAtIDAuNWYpICogd2lkdGg7CisgICAgICAgICAgICAgICAgdG1iLnNldFRleHR1cmUobm9ybWFsaXplZFgsIG5vcm1hbGl6ZWRZKTsKKyAgICAgICAgICAgICAgICB0bWIuYWRkVmVydGV4KHhPZmZzZXQsIHlPZmZzZXQpOworICAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGZvciAoaW50IHkgPSAwOyB5IDwgaFJlc29sdXRpb247IHkrKykgeworICAgICAgICAgICAgZmluYWwgaW50IGN1clkgPSB5ICogKHdSZXNvbHV0aW9uICsgMSk7CisgICAgICAgICAgICBmaW5hbCBpbnQgYmVsb3dZID0gKHk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XNWaWV3KENvbnRleHQgY29udGV4dCkgeworICAgICAgICBzdXBlcihjb250ZXh0KTsKKyAgICAgICAgLy9zZXRGb2N1c2FibGUodHJ1ZSk7CisgICAgfQorCisgICAgcHJpdmF0ZSBSZW5kZXJTY3JpcHRHTCBtUlM7CisgICAgcHJpdmF0ZSBSc1JlbmRlclN0YXRlc1JTIG1SZW5kZXI7CisKKworICAgIHB1YmxpYyB2b2lkIHN1cmZhY2VDaGFuZ2VkKFN1cmZhY2VIb2xkZXIgaG9sZGVyLCBpbnQgZm9ybWF0LCBpbnQgdywgaW50IGgpIHsKKyAgICAgICAgc3VwZXIuc3VyZmFjZUNoYW5nZWQoaG9sZGVyLCBmb3JtYXQsIHcsIGgpOworICAgICAgICBpZiAobVJTID09IG51bGwpIHsKKyAgICAgICAgICAgIFJlbmRlclNjcmlwdEdMLlN1cmZhY2VDb25maWcgc2MgPSBuZXcgUmVuZGVyU2NyaXB0R0wuU3VyZmFjZUNvbmZpZygpOworICAgICAgICAgICAgc2Muc2V0RGVwdGgoMTYsIDI0KTsKKyAgICAgICAgICAgIG1SUyA9IGNyZWF0ZVJlbmRlclNjcmlwdChzYyk7CisgICAgICAgICAgICBtUlMuY29udGV4dFNldFN1cmZhY2UodywgaCwgaG9sZGVyLmdldFN1cmZhY2UoKSk7CisgICAgICAgICAgICBtUmVuZGVyID0gbmV3IFJzUmVuZGVyU3RhdGVzUlMoKTsKKyAgICAgICAgICAgIG1SZW5kZXIuaW5pdChtUlMsIGdldFJlc291cmNlcygpLCB3LCBoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uRGV0YWNoZWRGcm9tV2luZG93KCkgeworICAgICAgICBpZihtUlMgIT0gbnVsbCkgeworICAgICAgICAgICAgbVJTID0gbnVsbDsKKyAgICAgICAgICAgIGRlc3Ryb3lSZW5kZXJTY3JpcHQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uS2V5RG93bihpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpCisgICAgeworICAgICAgICAvLyBicmVhayBwb2ludCBhdCBoZXJlCisgICAgICAgIC8vIHRoaXMgbWV0aG9kIGRvZXNuJ3Qgd29yayB3aGVuICdleHRlbmRzIFZpZXcnIGluY2x1ZGUgJ2V4dGVuZHMgU2Nyb2xsVmlldycuCisgICAgICAgIHJldHVybiBzdXBlci5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpOworICAgIH0KKworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25Ub3VjaEV2ZW50KE1vdGlvbkV2ZW50IGV2KQorICAgIHsKKyAgICAgICAgYm9vbGVhbiByZXQgPSBmYWxzZTsKKyAgICAgICAgaW50IGFjdCA9IGV2LmdldEFjdGlvbigpOworICAgICAgICBpZiAoYWN0ID09IGV2LkFDVElPTl9ET1dOKSB7CisgICAgICAgICAgICBtUmVuZGVyLm9uQWN0aW9uRG93bigoaW50KWV2LmdldFgoKSwgKGludClldi5nZXRZKCkpOworICAgICAgICAgICAgcmV0ID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorfQorCisKZGlmZiAtLWdpdCBhL2xpYnMvcnMvamF2YS9TYW1wbGVzL3NyYy9jb20vYW5kcm9pZC9zYW1wbGVzL3JzbGlzdC5ycyBiL2xpYnMvcnMvamF2YS9TYW1wbGVzL3NyYy9jb20vYW5kcm9pZC9zYW1wbGVzL3JzbGlzdC5ycwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4wMWIzN2FiCi0tLSAvZGV2L251bGwKKysrIGIvbGlicy9ycy9qYXZhL1NhbXBsZXMvc3JjL2NvbS9hbmRyb2lkL3NhbXBsZXMvcnNsaXN0LnJzCkBAIC0wLDAgKzEsNzMgQEAKKy8vIENvcHlyaWdodCAoQykgMjAwO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cit9IExpc3RBbGxvY3M7CisKK0xpc3RBbGxvY3MgKmdMaXN0OworCit2b2lkIGluaXQoKSB7CisgICAgZ0RZID0gMC4wZjsKK30KKworaW50IHRleHRQb3MgPSAwOworCitpbnQgcm9vdChpbnQgbGF1bmNoSUQpIHsKKworICAgIHJzZ0NsZWFyQ29sb3IoMC4wZiwgMC4wZiwgMC4wZiwgMC4wZik7CisgICAgcnNnQ2xlYXJEZXB0aCgxLjBmKTsKKworICAgIHRleHRQb3MgLT0gKGludClnRFkqMjsKKyAgICBnRFkgKj0gMC45NTsKKworICAgIHJzZ0ZvbnRDb2xvcigwLjlmLCAwLjlmLCAwLjlmLCAxLjBmKTsKKyAgICByc2dCaW5kRm9udChnSXRhbGljKTsKKyAgICBjb2xvcigwLjIsIDAuMiwgMC4yLCAwKTsKKworICAgIHJzX2FsbG9jYXRpb24gbGlzdEFsbG9jID0gezB9OworICAgIHJzU2V0T2JqZWN0KCZsaXN0QWxsb2MsIHJzR2V0QWxsb2NhdGlvbihnTGlzdCkpOworICAgIGludCBhbGxvY1NpemUgPSByc0FsbG9jYXRpb25HZXREaW1YKGxpc3RBbGxvYyk7CisKKyAgICBpbnQgd2lkdGggPSByc2dHZXRXaWR0aCgpOworICAgIGludCBoZWlnaHQgPSByc2dHZXRIZWlnaHQoKTsKKworICAgIGludCBpdGVtSGVpZ2h0ID0gODA7CisgICAgaW50IGN1cnJlbnRZUG9zID0gaXRlbUhlaWdodCArIHRleHRQb3M7CisKKyAgICBmb3IoaW50IGkgPSAwOyBpIDwgYWxsb2NTaXplOyBpICsrKSB7CisgICAgICAgIGlmKGN1cnJlbnRZUG9zIC0gaXRlbUhlaWdodCA+IGhlaWdodCkgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZihjdXJyZW50WVBvcyA+IDApIHsKKyAgICAgICAgICAgIHJzZ0RyYXdSZWN0KDAsIGN1cnJlbnRZUG9zIC0gMSwgd2lkdGgsIGN1cnJlbnRZUG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DA7IGkgPCAzOyBpICsrKSB7CisgICAgICAgIGZsb2F0IGlQbHVzT25lID0gKGZsb2F0KShpICsgMSk7CisgICAgICAgIHJzZ1Byb2dyYW1GcmFnbWVudENvbnN0YW50Q29sb3IoZ1Byb2dGcmFnbWVudENvbG9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMWYqaVBsdXNPbmUsIDAuMmYqaVBsdXNPbmUsIDAuM2YqaVBsdXNPbmUsIDEpOworICAgICAgICBmbG9hdCB5UG9zID0gMTUwICogKGZsb2F0KWk7CisgICAgICAgIHJzZ0RyYXdSZWN0KDAsIHlQb3MsIDIwMCwgeVBvcyArIDIwMCwgMCk7CisgICAgfQorCisgICAgcnNnQmluZFByb2dyYW1TdG9yZShnUHJvZ1N0b3JlQmxlbmRBbHBoYSk7CisgICAgZm9yKGkgPSAwOyBpIDwgMzsgaSArKykgeworICAgICAgICBmbG9hdCBpUGx1c09uZSA9IChmbG9hdCkoaSArIDEpOworICAgICAgICByc2dQcm9ncmFtRnJhZ21lbnRDb25zdGFudENvbG9yKGdQcm9nRnJhZ21lbnRDb2xvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjJmKmlQbHVzT25lLCAwLjNmKmlQbHVzT25lLCAwLjFmKmlQbHVzT25lLCAwLjUpOworICAgICAgICBmbG9hdCB5UG9zID0gMTUwICogKGZsb2F0KWk7CisgICAgICAgIHJzZ0RyYXdSZWN0KDE1MCwgeVBvcywgMzUwLCB5UG9zICsgMjAwLCAwKTsKKyAgICB9CisKKyAgICByc2dCaW5kUHJvZ3JhbVN0b3JlKGdQcm9nU3RvcmVCbGVuZEFkZCk7CisgICAgZm9yKGkgPSAwOyBpIDwgMzsgaSArKykgeworICAgICAgICBmbG9hdCBpUGx1c09uZSA9IChmbG9hdCkoaSArIDEpOworICAgICAgICByc2dQcm9ncmFtRnJhZ21lbnRDb25zdGFudENvbG9yKGdQcm9nRnJhZ21lbnRDb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XJ0WCArIHdpZHRoLCBzdGFydFkgKyBoZWlnaHQsIDAsIDEwLCAxMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydFggKyB3aWR0aCwgc3RhcnRZLCAwLCAxMCwgMCk7CisKKyAgICByc2dCaW5kUHJvZ3JhbVJhc3RlcihnQ3VsbEJhY2spOworCisgICAgcnNnRm9udENvbG9yKDEuMGYsIDEuMGYsIDEuMGYsIDEuMGYpOworICAgIHJzZ0JpbmRGb250KGdGb250TW9ubyk7CisgICAgaWYoYW5pc29Nb2RlID09IDApIHsKKyAgICAgICAgcnNnRHJhd1RleHQoIkFuaXNvdHJvcGljIGZpbHRlcmluZyA4IiwgMTAsIDQwKTsKKyAgICB9CisgICAgZWxzZSBpZihhbmlzb01vZGUgPT0gMSkgeworICAgICAgICByc2dEcmF3VGV4dCgiQW5pc290cm9waWMgZmlsdGVyaW5nIDE1IiwgMTAsIDQwKTsKKyAgICB9CisgICAgZWxzZSB7CisgICAgICAgIHJzZ0RyYXdUZXh0KCJNaXBsaW5lYXIgZmlsdGVyaW5nIiwgMTAsIDQwKTsKKyAgICB9Cit9CisKK2ludCByb290KGludCBsYXVuY2hJRCkgeworCisgICAgZ0R0ID0gcnNHZXREdCgpOworCisgICAgcnNnQ2xlYXJDb2xvcigwLjJmLCAwLjJmLCAwLjJmLCAwLjBmKTsKKyAgICByc2dDbGVhckRlcHRoKDEuMGYpOworCisgICAgc3dpdGNoKGdEaXNwbGF5TW9kZSkgeworICAgIGNhc2UgMDoKKyAgICAgICAgZGlzcGxheUZvbnRTYW1wbGVzKCk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgMToKKyAgICAgICAgZGlzcGxheVNoYWRlclNhbXBsZXMoKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSAyOgorICAgICAgICBkaXNwbGF5QmxlbmRpbmdTYW1wbGVzKCk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgMzoKKyAgICAgICAgZGlzcGxheU1lc2hTY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gICAgIFNjcmlwdEZpZWxkX0xpc3RBbGxvY3Nfcy5JdGVtIGxpc3RFbGVtID0gbmV3IFNjcmlwdEZpZWxkX0xpc3RBbGxvY3Nfcy5JdGVtKCk7CisgICAgICAgICAgICBsaXN0RWxlbS50ZXh0ID0gQWxsb2NhdGlvbi5jcmVhdGVGcm9tU3RyaW5nKG1SUywgdXRhW2ldLm5hbWUpOworICAgICAgICAgICAgbGlzdEVsZW0ucmVzdWx0ID0gdXRhW2ldLnJlc3VsdDsKKyAgICAgICAgICAgIG1MaXN0QWxsb2NzLnNldChsaXN0RWxlbSwgaSwgZmFsc2UpOworICAgICAgICAgICAgdXRhW2ldLnNldEl0ZW0obGlzdEVsZW0pOworICAgICAgICB9CisKKyAgICAgICAgbUxpc3RBbGxvY3MuY29weUFsbCgpOworCisgICAgICAgIG1TY3JpcHQuYmluZF9nTGlzdChtTGlzdEFsbG9jcyk7CisKKyAgICAgICAgbUZvbnQgPSBGb250LmNyZWF0ZUZyb21GYW1pbHkobVJTLCBtUmVzLCAic2VyaWYiLCBGb250LlN0eWxlLkJPTEQsIDgpOworICAgICAgICBtU2NyaXB0LnNldF9nRm9udChtRm9udCk7CisKKyAgICAgICAgbVJTLmNvbnRleHRCaW5kUm9vdFNjcmlwdChtU2NyaXB0KTsKKworICAgICAgICB0ZXN0X2l0ZXIgPSB1bml0VGVzdHMubGlzdEl0ZXJhdG9yKCk7CisgICAgICAgIHJlZnJlc2hUZXN0UmVzdWx0cygpOyAvKiBLaWNrIG9mZiB0aGUgZmlyc3QgdGVzdCAqLworCisgICAgICAgIFRpbWVyVGFzayBwVGFzayA9IG5ldyBUaW1lclRhc2soKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgcmVmcmVzaFRlc3RSZXN1bHRzKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgbVRpbWVyID0gbmV3IFRpbWVyKCk7CisgICAgICAgIG1UaW1lci5zY2hlZHVsZShwVGFzaywgUlNfVElNRVJfUEVSSU9ELCBSU19USU1FUl9QRVJJT0QpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNoZWNrQW5kUnVuTmV4dFRlc3QoKSB7CisgICAgICAgIGlmIChhY3RpdmVUZXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmICghYWN0aXZlVGVzdC5pc0FsaXZlKCkpIHsKKyAgICAgICAgICAgICAgICAvKiBQcm9wZXJseSBjbGVhbiB1cCBvbiBvdXIgbGFzdCB0ZXN0ICovCisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgYWN0aXZlVGVzdC5qb2luKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGFjdGl2ZVRlc3QgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKCFzdG9wVGVzdGluZyAmJiBhY3RpdmVUZXN0ID09IG51bGwpIHsKKyAgICAgICAgICAgIGlmICh0ZXN0X2l0ZXIuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgYWN0aXZlVGVzdCA9IHRlc3RfaXRlci5uZXh0KCk7CisgICAgICAgICAgICAgICAgYWN0aXZlVGVzdC5zdGFydCgpOworICAgICAgICAgICAgICAgIC8qIFRoaXMgcm91dGluZSB3aWxsIG9ubHkgZ2V0IGNhbGxlZCBvbmNlIHdoZW4gYSBuZXcgdGVzdAorICAgICAgICAgICAgICAgICAqIHNob3VsZCBzdGFydCBydW5uaW5nLiBUaGUgbWVzc2FnZSBoYW5kbGVyIGluIFVuaXRUZXN0LmphdmEKKyAgICAgICAgICAgICAgICAgKiBlbnN1cmVzIHRoaXMuICovCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAobVRpbWVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVRpbWVyLmNhbmNlbCgpOworICAgICAgICAgICAgICAgICAgICBtVGltZXIucHVyZ2UoKTsKKyAgICAgICAgICAgICAgICAgICAgbVRpbWVyID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZWZyZXNoVGVzdFJlc3VsdHMoKSB7CisgICAgICAgIGNoZWNrQW5kUnVuTmV4dFRlc3QoKTsKKworICAgICAgICBpZiAobUxpc3RBbGxvY3MgIT0gbnVsbCAmJiBtU2NyaXB0ICE9IG51bGwgJiYgbVJTICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1MaXN0QWxsb2NzLmNvcHlBbGwoKTsKKworICAgICAgICAgICAgbVNjcmlwdC5iaW5kX2dMaXN0KG1MaXN0QWxsb2NzKTsKKyAgICAgICAgICAgIG1SUy5jb250ZXh0QmluZFJvb3RTY3JpcHQobVNjcmlwdCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBjbGVhbnVwKCkgeworICAgICAgICBzdG9wVGVzdGluZyA9IHRydWU7CisgICAgICAgIFVuaXRUZXN0IHQgPSBhY3RpdmVUZXN0OworCisgICAgICAgIC8qIFN0b3AgcGVyaW9kaWMgcmVmcmVzaCBvZiB0ZXN0aW5nICovCisgICAgICAgIGlmIChtVGltZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbVRpbWVyLmNhbmNlbCgpOworICAgICAgICAgICAgbVRpbWVyLnB1cmdlKCk7CisgICAgICAgICAgICBtVGltZXIgPSBudWxsOworICAgICAgICB9CisKKyAgICAgICAgLyogV2FpdCB0byBleGl0IHVudGlsIHdlIGZpbmlzaCB0aGUgY3VycmVudCB0ZXN0ICovCisgICAgICAgIGlmICh0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgdC5qb2luKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgfQorICAgICAgICAgICAgdCA9IG51bGw7CisgICAgICAgIH0KKworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG5ld1RvdWNoUG9zaXRpb24oZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgcHJlc3N1cmUsIGludCBpZCkgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG9uQWN0aW9uRG93bihpbnQgeCwgaW50IHkpIHsKKyAgICAgICAgbVNjcmlwdC5zZXRfZ0RZKDAuMGYpOworICAgICAgICBtTGFzdFggPSB4OworICAgICAgICBtTGFzdFkgPSB5OworICAgICAgICByZWZyZXNoVGVzdFJlc3VsdHMoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvbkFjdGlvbk1vdmUoaW50IHgsIGludCB5KSB7CisgICAgICAgIGludCBkeCA9IG1MYXN0WCAtIHg7CisgICAgICAgIGludCBkeSA9IG1MYXN0WSAtIHk7CisKKyAgICAgICAgaWYgKE1hdGguYWJzKGR5KSA8PSAyKSB7CisgICAgICAgICAgICBkeSA9IDA7CisgICAgICAgIH0KKworICAgICAgICBtU2NyaXB0LnNldF9nRFkoZHkpOworCisgICAgICAgIG1MYXN0WCA9IHg7CisgICAgICAgIG1MYXN0WSA9IHk7CisgICAgICAgIHJlZnJlc2hUZXN0UmVzdWx0cygpOworICAgIH0KK30KZGlmZiAtLWdpdCBhL2xpYnMvcnMvamF2YS90ZXN0cy9zcmMvY29tL2FuZHJvaWQvcnMvdGVzdC9SU1Rlc3RWaWV3LmphdmEgYi9saWJzL3JzL2phdmEvdGVzdHMvc3JjL2NvbS9hbmRyb2lkL3JzL3Rlc3QvUlNUZXN0Vmlldy5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmM2NWY4YzYKLS0tI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KKyAgICBwcml2YXRlIFJlbmRlclNjcmlwdEdMIG1SUzsKKyAgICBwcml2YXRlIFJTVGVzdENvcmUgbVJlbmRlcjsKKworICAgIHB1YmxpYyB2b2lkIHN1cmZhY2VDaGFuZ2VkKFN1cmZhY2VIb2xkZXIgaG9sZGVyLCBpbnQgZm9ybWF0LCBpbnQgdywgaW50IGgpIHsKKyAgICAgICAgc3VwZXIuc3VyZmFjZUNoYW5nZWQoaG9sZGVyLCBmb3JtYXQsIHcsIGgpOworICAgICAgICBpZiAobVJTID09IG51bGwpIHsKKyAgICAgICAgICAgIFJlbmRlclNjcmlwdEdMLlN1cmZhY2VDb25maWcgc2MgPSBuZXcgUmVuZGVyU2NyaXB0R0wuU3VyZmFjZUNvbmZpZygpOworICAgICAgICAgICAgbVJTID0gY3JlYXRlUmVuZGVyU2NyaXB0KHNjKTsKKyAgICAgICAgICAgIG1SUy5jb250ZXh0U2V0U3VyZmFjZSh3LCBoLCBob2xkZXIuZ2V0U3VyZmFjZSgpKTsKKyAgICAgICAgICAgIG1SZW5kZXIgPSBuZXcgUlNUZXN0Q29yZSgpOworICAgICAgICAgICAgbVJlbmRlci5pbml0KG1SUywgZ2V0UmVzb3VyY2VzKCksIHcsIGgpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25EZXRhY2hlZEZyb21XaW5kb3coKSB7CisgICAgICAgIGlmKG1SUyAhPSBudWxsKSB7CisgICAgICAgICAgICBtUmVuZGVyLmNsZWFudXAoKTsKKyAgICAgICAgICAgIG1SUyA9IG51bGw7CisgICAgICAgICAgICBkZXN0cm95UmVuZGVyU2NyaXB0KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvbktleURvd24oaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN1cGVyLm9uS2V5RG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W5pdGlhbGl6ZUdsb2JhbHMoU2NyaXB0Q19wcmltaXRpdmVzIHMpIHsKKyAgICAgICAgZmxvYXQgcEYgPSBzLmdldF9mbG9hdFRlc3QoKTsKKyAgICAgICAgaWYgKHBGICE9IDEuOTlmKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcy5zZXRfZmxvYXRUZXN0KDIuOTlmKTsKKworICAgICAgICBkb3VibGUgcEQgPSBzLmdldF9kb3VibGVUZXN0KCk7CisgICAgICAgIGlmIChwRCAhPSAyLjA1KSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcy5zZXRfZG91YmxlVGVzdCgzLjA1KTsKKworICAgICAgICBieXRlIHBDID0gcy5nZXRfY2hhclRlc3QoKTsKKyAgICAgICAgaWYgKHBDICE9IC04KSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcy5zZXRfY2hhclRlc3QoKGJ5dGUpLTE2KTsKKworICAgICAgICBzaG9ydCBwUyA9IHMuZ2V0X3Nob3J0VGVzdCgpOworICAgICAgICBpZiAocFMgIT0gLTE2KSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcy5zZXRfc2hvcnRUZXN0KChzaG9ydCktMzIpOworCisgICAgICAgIGludCBwSSA9IHMuZ2V0X2ludFRlc3QoKTsKKyAgICAgICAgaWYgKHBJICE9IC0zMikgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIHMuc2V0X2ludFRlc3QoLTY0KTsKKworICAgICAgICBsb25nIHBMID0gcy5nZXRfbG9uZ1Rlc3QoKTsKKyAgICAgICAgaWYgKHBMICE9IDE3MTc5ODY5MTg0bCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIHMuc2V0X2xvbmdUZXN0KDE3MTc5ODY5MTg1bCk7CisKKyAgICAgICAgbG9uZyBwdUwgPSBzLmdldF91bG9uZ1Rlc3QoKTsKKyAgICAgICAgaWYgKHB1TCAhPSA0NjExNjg2MDE4NDI3Mzg3OTA0TCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIHMuc2V0X3Vsb25nVGVzdCg0NjExNjg2MDE4NDI3Mzg3OTAzTCk7CisKKworICAgICAgICBsb25nIHBMTCA9IHMuZ2V0X2xvbmdsb25nVGVzdCgpOworICAgICAgICBpZiAocExMICE9IDY4NzE5NDc2NzM2TCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIHMuc2V0X2xvbmdsb25nVGVzdCg2ODcxOTQ3NjczNUwpOworCisgICAgICAgIGxvbmcgcHU2NCA9IHMuZ2V0X3VpbnQ2NF90VGVzdCgpOworICAgICAgICBpZiAocHU2NCAhPSAxMTcxNzk4NjkxODRsKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcy5zZXRfdWludDY0X3RUZXN0KDExNzE3OTg2OTE4NWwpOworCisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgUmVuZGVyU2NyaXB0IHBSUyA9IFJlbmRlclNjcmlwdC5jcmVhdGUoKTsKKyAgICAgICAgU2NyaXB0Q19wcmltaXRpdmVzIHMgPSBuZXcgU2NyaXB0Q19wcmltaXRpdmVzKHBSUywgbVJlcywgUi5yYXcucHJpbWl0aXZlcywgdHJ1ZSk7CisgICAgICAgIHBSUy5tTWVzc2FnZUNhbGxiYWNrID0gbVJzTWVzc2FnZTsKKyAgICAgICAgaWYgKCFpbml0aWFsaXplR2xvYmFscyhzKSkgeworICAgICAgICAgICAgLy8gaW5pdGlhbGl6ZUdsb2JhbHMgZmFpbGVkCisgICAgICAgICAgICByZXN1bHQg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gPSBudW1UZXN0cysrOworICAgIH0KKworICAgIHByb3RlY3RlZCBVbml0VGVzdChSU1Rlc3RDb3JlIHJzdGMsIFN0cmluZyBuKSB7CisgICAgICAgIHRoaXMocnN0YywgbiwgMCk7CisgICAgfQorCisgICAgcHJvdGVjdGVkIFVuaXRUZXN0KFJTVGVzdENvcmUgcnN0YykgeworICAgICAgICB0aGlzIChyc3RjLCAiPFVua25vd24+Iik7CisgICAgfQorCisgICAgcHJvdGVjdGVkIFVuaXRUZXN0KCkgeworICAgICAgICB0aGlzIChudWxsKTsKKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgUlNNZXNzYWdlIG1Sc01lc3NhZ2UgPSBuZXcgUlNNZXNzYWdlKCkgeworICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICBpZiAocmVzdWx0ID09IDApIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKG1JRCkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIFJTX01TR19URVNUX1BBU1NFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBSU19NU0dfVEVTVF9GQUlMRUQ6CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC51dGlsLkxvZy52KCJSZW5kZXJTY3JpcHQiLCAiVW5pdCB0ZXN0IGdvdCB1bmV4cGVjdGVkIG1lc3NhZ2UiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtSXRlbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUl0ZW0ucmVzdWx0ID0gcmVzdWx0OworICAgICAgICAgICAgICAgIG1zZ0hhbmRsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIG1SU1RDLnJlZnJlc2hUZXN0UmVzdWx0cygpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgLyogSWdub3JlIHRoZSBjYXNlIHdoZXJlIG91ciBtZXNzYWdlIHJlY2VpdmVyIGhhcyBiZWVuCisgICAgICAgICAgICAgICAgICAgICAgIGRpc2Nvbm5lY3RlZC4gVGhpcyBoYXBwZW5zIHdoZW4gd2UgbGVhdmUgdGhlIGFwcGxpY2F0aW9uCisgICAgICAgICAgICAgICAgICAgICAgIGJlZm9yZSBpdCBmaW5pc2hlcyBydW5uaW5nIGFsbCBvZiB0aGUgdW5pdCB0ZXN0cy4gKi8KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHVibGljIHZvaWQgd2FpdEZvck1lc3NhZ2UoKSB7CisgICAgICAgIHdoaWxlICghbXNnSGFuZGxlZCkgeworICAgICAgICAgICAgeWllbGQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEl0ZW0oU2NyaXB0RmllbGRfTGlzdEFsbG9jc19zLkl0ZW0gaXRlbSkgeworICAgICAgICBtSXRlbSA9IGl0ZW07CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAvKiBUaGlzIG1ldGhvZCBuZWVkcyB0byBiZSBpbXBsZW1lbnRlZCBmb3IgZWFjaCBzdWJjbGFzcyAqLworICAgICAgICBpZiAobVJTVEMgIT0gbnVsbCkgeworICAgICAgICAgICAgbVJTVEMucmVmcmVzaFRlc3RSZXN1bHRzKCk7CisgICAgICAgIH0KKy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ICAgICAgICAgZGF0YV9mNFtpKzRdICogMC4yZiArCisgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfZjRbaSs1XSAqIDAuMmYgKworICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhX2Y0W2krNl0gKiAwLjFmICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9mNFtpKzddICogMC4wNWYgKworICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhX2Y0W2krOF0gKiAwLjA0ZiArCisgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfZjRbaSs5XSAqIDAuMDJmICsgMS5mKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGZsb2F0IHRpbWUgPSBlbmQoaW5kZXgpOworICAgIHJzRGVidWcoImZwX21hZDQgTSBvcHMiLCAxMDAwLmYgLyB0aW1lKTsKK30KKworc3RhdGljIHZvaWQgdGVzdF9tYWQodWludDMyX3QgaW5kZXgpIHsKKyAgICBzdGFydCgpOworCisgICAgZmxvYXQgdG90YWwgPSAwOworICAgIC8vIERvIH4xIGJpbGxpb24gb3BzCisgICAgZm9yIChpbnQgY3Q9MDsgY3QgPCAxMDAwICogKDEwMDAgLyAyMCk7IGN0KyspIHsKKyAgICAgICAgZm9yIChpbnQgaT0wOyBpIDwgKDEwMDApOyBpKyspIHsKKyAgICAgICAgICAgIGRhdGFfZjFbaV0gPSAoZGF0YV9mMVtpXSAqIDAuMDJmICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9mMVtpKzFdICogMC4wNGYgKworICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhX2YxW2krMl0gKiAwLjA1ZiArCisgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfZjFbaSszXSAqIDAuMWYgKworICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhX2YxW2krNF0gKiAwLjJmICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9mMVtpKzVdICogMC4yZiArCisgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfZjFbaSs2XSAqIDAuMWYgKworICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhX2YxW2krN10gKiAwLjA1ZiArCisgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfZjFbaSs4XSAqIDAuMDRmICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9mMVtpKzldICogMC4wMmYgKyAxLmYpOworICAgICAgICB9CisgICAgfQorCisgICAgZmxvYXQgdGltZSA9IGVuZChpbmRleCk7CisgICAgcnNEZWJ1ZygiZnBfbWFkIE0gb3BzIiwgMTAwMC5mIC8gdGltZSk7Cit9CisKK3N0YXRpYyB2b2lkIHRlc3Rfbm9ybSh1aW50MzJfdCBpbmRleCkgeworICAgIHN0YXJ0KCk7CisKKyAgICBmbG9hdCB0b3RhbCA9IDA7CisgICAgLy8gRG8gfjEwIE0gb3BzCisgICAgZm9yIChpbnQgY3Q9MDsgY3QgPCAxMDAwICogMTA7IGN0KyspIHsKKyAgICAgICAgZm9yIChpbnQgaT0wOyBpIDwgKDEwMDApOyBpKyspIHsKKyAgICAgICAgICAgIGRhdGFfZjRbaV0gPSBub3JtYWxpemUoZGF0YV9mNFtpXSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBmbG9hdCB0aW1lID0gZW5kKGluZGV4KTsKKyAgICByc0RlYnVnKCJmcF9ub3JtIE0gb3BzIiwgMTAuZiAvIHRpbWUpOworfQorCitzdGF0aWMgdm9pZCB0ZXN0X3NpbmNvczQodWludDMyX3QgaW5kZXgpIHsKKyAgICBzdGFydCgpOworCisgICAgZmxvYXQgdG90YWwgPSAwOworICAgIC8vIERvIH4xMCBNIG9wcworICAgIGZvciAoaW50IGN0PTA7IGN0IDwgMTAwMCAqIDEwIC8gNDsgY3QrKykgeworICAgICAgICBmb3IgKGludCBpPTA7IGkgPCAoMTAwMCk7IGkrKykgeworICAgICAgICAgICAgZGF0YV9mNFtpXSA9IHNpbihkYXRhX2Y0W2ldKS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0UG9zIDwgbGFzdEl0ZW0pIHsKKyAgICAgICAgdGV4dFBvcyA9IGxhc3RJdGVtOworICAgIH0KKworICAgIGludCBjdXJyZW50WVBvcyA9IGl0ZW1IZWlnaHQgKyB0ZXh0UG9zOworCisgICAgZm9yKGludCBpID0gMDsgaSA8IGFsbG9jU2l6ZTsgaSArKykgeworICAgICAgICBpZihjdXJyZW50WVBvcyAtIGl0ZW1IZWlnaHQgPiBoZWlnaHQpIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgaWYoY3VycmVudFlQb3MgPiAwKSB7CisgICAgICAgICAgICBzd2l0Y2goZ0xpc3RbaV0ucmVzdWx0KSB7CisgICAgICAgICAgICAgICAgY2FzZSAxOiAvKiBQYXNzZWQgKi8KKyAgICAgICAgICAgICAgICAgICAgcnNnRm9udENvbG9yKDAuNWYsIDAuOWYsIDAuNWYsIDEuMGYpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIC0xOiAvKiBGYWlsZWQgKi8KKyAgICAgICAgICAgICAgICAgICAgcnNnRm9udENvbG9yKDAuOWYsIDAuNWYsIDAuNWYsIDEuMGYpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDA6IC8qIFN0aWxsIFRlc3RpbmcgKi8KKyAgICAgICAgICAgICAgICAgICAgcnNnRm9udENvbG9yKDAuOWYsIDAuOWYsIDAuNWYsIDEuMGYpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OiAvKiBVbmtub3duICovCisgICAgICAgICAgICAgICAgICAgIHJzZ0ZvbnRDb2xvcigwLjlmLCAwLjlmLCAwLjlmLCAxLjBmKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByc2dEcmF3UmVjdCgwLCBjdXJyZW50WVBvcyAtIDEsIHdpZHRoLCBj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dldFNpemVCeXRlcygpKSB7CisgICAgICAgIExPR0UoIkVycm9yIEFsbG9jYXRpb246OnN1YkVsZW1lbnREYXRhIGRhdGEgc2l6ZSAlaSBkb2VzIG5vdCBtYXRjaCBmaWVsZCBzaXplICVpLiIsIHNpemVCeXRlcywgZS0+Z2V0U2l6ZUJ5dGVzKCkpOworICAgICAgICByc2MtPnNldEVycm9yKFJTX0VSUk9SX0JBRF9WQUxVRSwgInN1YkVsZW1lbnREYXRhIGJhZCBzaXplLiIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKGUtPmdldEhhc1JlZmVyZW5jZXMoKSkgeworICAgICAgICBlLT5pbmNSZWZzKGRhdGEpOworICAgICAgICBlLT5kZWNSZWZzKHB0cik7CisgICAgfQorCisgICAgbWVtY3B5KHB0ciwgZGF0YSwgc2l6ZUJ5dGVzKTsKKyAgICBzZW5kRGlydHkoKTsKKyAgICBtVXBsb2FkRGVmZXJlZCA9IHRydWU7Cit9CisKK3ZvaWQgQWxsb2NhdGlvbjo6c3ViRWxlbWVudERhdGEoQ29udGV4dCAqcnNjLCB1aW50MzJfdCB4LCB1aW50MzJfdCB5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLCB1aW50MzJfdCBjSWR4LCB1aW50MzJfdCBzaXplQnl0ZXMpCit7CisgICAgdWludDMyX3QgZVNpemUgPSBtVHlwZS0+Z2V0RWxlbWVudFNpemVCeXRlcygpOworICAgIHVpbnQ4X3QgKiBwdHIgPSBzdGF0aWNfY2FzdDx1aW50OF90ICo+KG1QdHIpOworICAgIHB0ciArPSBlU2l6ZSAqICh4ICsgeSAqIG1UeXBlLT5nZXREaW1YKCkpOworCisgICAgaWYgKHggPj0gbVR5cGUtPmdldERpbVgoKSkgeworICAgICAgICBMT0dFKCJFcnJvciBBbGxvY2F0aW9uOjpzdWJFbGVtZW50RGF0YSBYIG9mZnNldCAlaSBvdXQgb2YgcmFuZ2UuIiwgeCk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ICAgICAgICAgICAgIHVpbnQzMl90IHZhbHVlQ291bnQsIFJzQW5pbWF0aW9uSW50ZXJwb2xhdGlvbiBpbnRlcnAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FuaW1hdGlvbkVkZ2UgcHJlLCBSc0FuaW1hdGlvbkVkZ2UgcG9zdCkKK3sKKyAgICBpZiAodmFsdWVDb3VudCA8IDIpIHsKKyAgICAgICAgcnNjLT5zZXRFcnJvcihSU19FUlJPUl9CQURfVkFMVUUsICJBbmltYXRpb25zIHJlcXVpcmUgbW9yZSB0aGFuIDIgdmFsdWVzLiIpOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisgICAgQW5pbWF0aW9uICphID0gbmV3IEFuaW1hdGlvbihyc2MpOworICAgIGlmICghYSkgeworICAgICAgICByc2MtPnNldEVycm9yKFJTX0VSUk9SX09VVF9PRl9NRU1PUlkpOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBmbG9hdCAqdmluID0gKGZsb2F0ICopbWFsbG9jKHZhbHVlQ291bnQgKiBzaXplb2YoZmxvYXQpKTsKKyAgICBmbG9hdCAqdm91dCA9IChmbG9hdCAqKW1hbGxvYyh2YWx1ZUNvdW50ICogc2l6ZW9mKGZsb2F0KSk7CisgICAgYS0+bVZhbHVlc0lucHV0ID0gdmluOworICAgIGEtPm1WYWx1ZXNPdXRwdXQgPSB2b3V0OworICAgIGlmIChhLT5tVmFsdWVzSW5wdXQgPT0gTlVMTCB8fCBhLT5tVmFsdWVzT3V0cHV0ID09IE5VTEwpIHsKKyAgICAgICAgZGVsZXRlIGE7CisgICAgICAgIHJzYy0+c2V0RXJyb3IoUlNfRVJST1JfT1VUX09GX01FTU9SWSk7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIGEtPm1FZGdlUHJlID0gcHJlOworICAgIGEtPm1FZGdlUG9zdCA9IHBvc3Q7CisgICAgYS0+bUludGVycG9sYXRpb24gPSBpbnRlcnA7CisgICAgYS0+bVZhbHVlQ291bnQgPSB2YWx1ZUNvdW50OworCisgICAgbWVtY3B5KHZpbiwgaW5WYWx1ZXMsIHZhbHVlQ291bnQgKiBzaXplb2YoZmxvYXQpKTsKKyAgICBtZW1jcHkodm91dCwgb3V0VmFsdWVzLCB2YWx1ZUNvdW50ICogc2l6ZW9mKGZsb2F0KSk7CisgICAgYS0+bUlucHV0TWluID0gaW5WYWx1ZXNbMF07CisgICAgYS0+bUlucHV0TWF4ID0gaW5WYWx1ZXNbMF07CisKKyAgICBib29sIG5lZWRTb3J0ID0gZmFsc2U7CisgICAgZm9yICh1aW50MzJfdCBjdD0xOyBjdCA8IHZhbHVlQ291bnQ7IGN0KyspIHsKKyAgICAgICAgaWYgKGEtPm1JbnB1dE1pbiA+IHZpbltjdF0pIHsKKyAgICAgICAgICAgIG5lZWRTb3J0ID0gdHJ1ZTsKKyAgICAgICAgICAgIGEtPm1JbnB1dE1pbiA9IHZpbltjdF07CisgICAgICAgIH0KKyAgICAgICAgaWYgKGEtPm1JbnB1dE1heCA8IHZpbltjdF0pIHsKKyAgICAgICAgICAgIGEtPm1JbnB1dE1heCA9IHZpbltjdF07CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBuZWVkU29ydCA9IHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB3aGlsZSAoMSkgeworICAgICAgICBib29sIGNoYW5nZWQgPSBmYWxzZTsKKyAgICAgICAgZm9yICh1aW50MzJfdCBjdD0xOyBjdCA8IHZhbHVlQ291bnQ7IGN0KyspIHsKKyAgICAgICAgICAgIGlmICh2aW5bY3QtMV0gPiB2aW5bY3RdKSB7CisgICAgICAgICAgICAgICAgZmxvYXQgdCA9IHZpbltjdC0xXTsKKyAgICAgICAgICAgICAgICB2aW5bY3QtMV0gPSB2aW5bY3RdOworICAgICAgICAgICAgICAgIHZpbltjdF0gPSB0OworICAgICAgICAgICAgICAgIHQgPSB2b3V0W2N0LTFdOworICAgICAgICAgICAgICAgIHZvdXRbY3QtMV0gPSB2b3V0W2N0XTsKKyAgICAgICAgICAgICAgICB2b3V0W2N0XSA9IHQ7CisgICAgICAgICAgICAgICAgY2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFjaGFuZ2VkKSBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gYTsKK30KKyovCisKKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKy8vCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKK25hbWVzcGFjZSByZW5kZXJzY3JpcHQgeworCitSc0FuaW1hdGlvbiByc2lfQW5pbWF0aW9uQ3JlYXRlKENvbnRleHQgKnJzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZmxvYXQgKmluVmFsdWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmbG9hdCAqb3V0VmFsdWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB2YWx1ZUNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FuaW1hdGlvbkludGVycG9sYXRpb24gaW50ZXJwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FuaW1hdGlvbkVkZ2UgcHJlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FuaW1hdGlvbkVkZ2UgcG9zdCkKK3sKKyAgICAvL0xPR0UoInJzaV9FbGVtZW50Q3JlYXRlICVpICVpICVpICVpIiwgZHQsIGRrLCBub3JtLCB2ZWNTaXplKTsKKyAgICBBbmltYXRpb24gKmEgPSBOVUxMOy8vQW5pbWF0aW9uOjpjcmVhdGUocnNjLCBpblZhbHVlcywgb3V0VmFsdWVzLCB2YWx1ZUNvdW50LCBpbnRlcnAsIHByZSwgcG9zdCk7CisgICAgaWYgKGEgIT0gTlVMTCkgeworICAgICAgICB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cmlwdDsKQEAgLTkxLDYgKzk1LDI2IEBACiAgICAgICAgIG1Ob3JtYWxpemVkID0gdHJ1ZTsKICAgICAgICAgcnNBc3NlcnQobUtpbmQgPT0gUlNfS0lORF9QSVhFTF9SR0JBKTsKICAgICAgICAgcmV0dXJuOworCisgICAgY2FzZSBSU19UWVBFX01BVFJJWF80WDQ6CisgICAgICAgIG1UeXBlQml0cyA9IDE2ICogMzI7CisgICAgICAgIHJzQXNzZXJ0KG1WZWN0b3JTaXplID09IDEpOworICAgICAgICByc0Fzc2VydChtTm9ybWFsaXplZCA9PSBmYWxzZSk7CisgICAgICAgIHJzQXNzZXJ0KG1LaW5kID09IFJTX0tJTkRfVVNFUik7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfVFlQRV9NQVRSSVhfM1gzOgorICAgICAgICBtVHlwZUJpdHMgPSA5ICogMzI7CisgICAgICAgIHJzQXNzZXJ0KG1WZWN0b3JTaXplID09IDEpOworICAgICAgICByc0Fzc2VydChtTm9ybWFsaXplZCA9PSBmYWxzZSk7CisgICAgICAgIHJzQXNzZXJ0KG1LaW5kID09IFJTX0tJTkRfVVNFUik7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfVFlQRV9NQVRSSVhfMlgyOgorICAgICAgICBtVHlwZUJpdHMgPSA0ICogMzI7CisgICAgICAgIHJzQXNzZXJ0KG1WZWN0b3JTaXplID09IDEpOworICAgICAgICByc0Fzc2VydChtTm9ybWFsaXplZCA9PSBmYWxzZSk7CisgICAgICAgIHJzQXNzZXJ0KG1LaW5kID09IFJTX0tJTkRfVVNFUik7CisgICAgICAgIGJyZWFrOworCiAgICAgY2FzZSBSU19UWVBFX0VMRU1FTlQ6CiAgICAgY2FzZSBSU19UWVBFX1RZUEU6CiAgICAgY2FzZSBSU19UWVBFX0FMTE9DQVRJT046CkBAIC0xNDgsMTEgKzE3MiwxOSBAQAogICAgIGNhc2UgUlNfVFlQRV9VTlNJR05FRF82NDoKICAgICAgICAgbVR5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URUSCksCisgICAgWChFR0xfTkFUSVZFX1JFTkRFUkFCTEUpLAorICAgIFgoRUdMX05BVElWRV9WSVNVQUxfSUQpLAorICAgIFgoRUdMX05BVElWRV9WSVNVQUxfVFlQRSksCisgICAgWChFR0xfU0FNUExFUyksCisgICAgWChFR0xfU0FNUExFX0JVRkZFUlMpLAorICAgIFgoRUdMX1NVUkZBQ0VfVFlQRSksCisgICAgWChFR0xfVFJBTlNQQVJFTlRfVFlQRSksCisgICAgWChFR0xfVFJBTlNQQVJFTlRfUkVEX1ZBTFVFKSwKKyAgICBYKEVHTF9UUkFOU1BBUkVOVF9HUkVFTl9WQUxVRSksCisgICAgWChFR0xfVFJBTlNQQVJFTlRfQkxVRV9WQUxVRSksCisgICAgWChFR0xfQklORF9UT19URVhUVVJFX1JHQiksCisgICAgWChFR0xfQklORF9UT19URVhUVVJFX1JHQkEpLAorICAgIFgoRUdMX01JTl9TV0FQX0lOVEVSVkFMKSwKKyAgICBYKEVHTF9NQVhfU1dBUF9JTlRFUlZBTCksCisgICAgWChFR0xfTFVNSU5BTkNFX1NJWkUpLAorICAgIFgoRUdMX0FMUEhBX01BU0tfU0laRSksCisgICAgWChFR0xfQ09MT1JfQlVGRkVSX1RZUEUpLAorICAgIFgoRUdMX1JFTkRFUkFCTEVfVFlQRSksCisgICAgWChFR0xfQ09ORk9STUFOVCksCisgICB9OworI3VuZGVmIFgKKworICAgIGZvciAoc2l6ZV90IGogPSAwOyBqIDwgc2l6ZW9mKG5hbWVzKSAvIHNpemVvZihuYW1lc1swXSk7IGorKykgeworICAgICAgICBFR0xpbnQgdmFsdWUgPSAtMTsKKyAgICAgICAgRUdMaW50IHJldHVyblZhbCA9IGVnbEdldENvbmZpZ0F0dHJpYihkcHksIGNvbmZpZywgbmFtZXNbal0uYXR0cmlidXRlLCAmdmFsdWUpOworICAgICAgICBFR0xpbnQgZXJyb3IgPSBlZ2xHZXRFcnJvcigpOworICAgICAgICBpZiAocmV0dXJuVmFsICYmIGVycm9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250ZXh0KSB7CiAgICAgICAgICAgICAgdGFyZ2V0VGltZSA9IHJzYy0+cnVuUm9vdFNjcmlwdCgpOworCisgICAgICAgICAgICAgaWYocnNjLT5wcm9wcy5tTG9nVmlzdWFsKSB7CisgICAgICAgICAgICAgICAgIHJzYy0+ZGlzcGxheURlYnVnU3RhdHMoKTsKKyAgICAgICAgICAgICB9CisKICAgICAgICAgICAgICBtRHJhdyA9IHRhcmdldFRpbWUgJiYgIXJzYy0+bVBhdXNlZDsKICAgICAgICAgICAgICByc2MtPnRpbWVyU2V0KFJTX1RJTUVSX0NMRUFSX1NXQVApOwogICAgICAgICAgICAgIGVnbFN3YXBCdWZmZXJzKHJzYy0+bUVHTC5tRGlzcGxheSwgcnNjLT5tRUdMLm1TdXJmYWNlKTsKQEAgLTM0MSwxMCArNDcwLDcgQEAKICAgICAgICAgICAgICByc2MtPnRpbWVyUHJpbnQoKTsKICAgICAgICAgICAgICByc2MtPnRpbWVyUmVzZXQoKTsKICAgICAgICAgIH0KLSAgICAgICAgIGlmIChyc2MtPm1PYmpEZXN0cm95Lm1OZWVkVG9FbXB0eSkgewotICAgICAgICAgICAgIHJzYy0+b2JqRGVzdHJveU9PQlJ1bigpOwotICAgICAgICAgfQotICAgICAgICAgaWYgKHJzYy0+bVRocmVhZFByaW9yaXR5ID4gMCAmJiB0YXJnZXRUaW1lKSB7CisgICAgICAgICBpZiAodGFyZ2V0VGltZSA+IDEpIHsKICAgICAgICAgICAgICBpbnQzMl90IHQgPSAodGFyZ2V0VGltZSAtIChpbnQzMl90KShyc2MtPm1UaW1lTVNMYXN0U2NyaXB0ICsgcnNjLT5tVGltZU1TTGFzdFN3YXApKSAqIDEwMDA7CiAgICAgICAgICAgICAgaWYgKHQgPiAwKSB7CiAgICAgICAgICAgICAgICAgIHVzbGVlcCh0KTsKQEAgLTM1MiwzMyArNDc4LDg1IEBACiAgICAgICAgICB9CiAgICAgIH0KIAotICAgICBMT0dWKCJSUyBUaHJlYWQgZXhpdGluZyIpOworICAgICBMT0dWKCIlcCwgUlMgVGhyZWFkIGV4aXRpbmciLCByc2MpOwogICAgICBpZiAocnNjLT5tSXNHcmFwaGljc0NvbnRleHQpIHsKICAgICAgICAgIHJzYy0+bVJhc3Rlci5jbGVhcigpOwogICAgICAgICAgcnNjLT5tRnJhZ21lbnQuY2xlYXIoKTsKICAgICAgICAgIHJzYy0+bVZlcnRleC5jbGVhcigpOwogICAgICAgICAgcnNjLT5tRnJhZ21lbnRTdG9yZS5jbGVhcigpOworICAgICAgICAgcnNjLT5tRm9udC5jbGVhcigpOwogICAgICAgICAgcnNjLT5tUm9vdFNjcmlwdC5jbGVhcigpOwogICAgICAgICAgcnNjLT5tU3RhdGVSYXN0ZXIuZGVpbml0KHJzYyk7CiAgICAgICAgICByc2MtPm1TdGF0ZVZlcnRleC5kZWluaXQocnNjKTsKICAgICAgICAgIHJzYy0+bVN0YXRlRnJhZ21lbnQuZGVpbml0KHJzYyk7CiAgICAgICAgICByc2MtPm1TdGF0ZUZyYWdtZW50U3RvcmUuZGVpbml0KHJzYyk7CisgICAgICAgICByc2MtPm1TdGF0ZUZvbnQuZGVpbml0KHJzYyk7CiAgICAgIH0KICAgICAgT2JqZWN0QmFzZTo6emVyb0FsbFVzZXJSZWYocnNjKTsKIAotICAgICByc2MtPm1PYmpEZXN0cm95Lm1OZWVkVG9FbXB0eSA9IHRydWU7Ci0gICAgIHJzYy0+b2JqRGVzdHJveU9PQlJ1bigpOwotCiAgICAgIGlmIChyc2MtPm1Jc0dyYXBoaWNzQ29udGV4dCkgewogICAgICAgICAgcHRocmVhZF9tdXRleF9sb2NrKCZnSW5pdE11dGV4KTsKICAgICAgICAgIHJzYy0+ZGVpbml0RUdMKCk7CiAgICAgICAgICBwdGhyZWFkX211dGV4X3VubG9jaygmZ0luaXRNdXRleCk7CiAgICAgIH0KKyAgICAgZGVsZXRlIHJzYy0+bVRsc1N0cnVjdDsKIAotICAgICBMT0dWKCJSUyBUaHJlYWQgZXhpdGVkI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T19TVVJGQUNFLCBFR0xfTk9fQ09OVEVYVCk7CisgICAgICAgIHJldCA9IGVnbE1ha2VDdXJyZW50KG1FR0wubURpc3BsYXksIG1FR0wubVN1cmZhY2VEZWZhdWx0LCBtRUdMLm1TdXJmYWNlRGVmYXVsdCwgbUVHTC5tQ29udGV4dCk7CiAgICAgICAgIGNoZWNrRWdsRXJyb3IoImVnbE1ha2VDdXJyZW50IiwgcmV0KTsKIAogICAgICAgICByZXQgPSBlZ2xEZXN0cm95U3VyZmFjZShtRUdMLm1EaXNwbGF5LCBtRUdMLm1TdXJmYWNlKTsKICAgICAgICAgY2hlY2tFZ2xFcnJvcigiZWdsRGVzdHJveVN1cmZhY2UiLCByZXQpOwogCiAgICAgICAgIG1FR0wubVN1cmZhY2UgPSBOVUxMOwotICAgICAgICBtRUdMLm1XaWR0aCA9IDA7Ci0gICAgICAgIG1FR0wubUhlaWdodCA9IDA7Ci0gICAgICAgIG1XaWR0aCA9IDA7Ci0gICAgICAgIG1IZWlnaHQgPSAwOworICAgICAgICBtV2lkdGggPSAxOworICAgICAgICBtSGVpZ2h0ID0gMTsKICAgICB9CiAKICAgICBtV25kU3VyZmFjZSA9IHN1cjsKICAgICBpZiAobVduZFN1cmZhY2UgIT0gTlVMTCkgewotICAgICAgICBib29sIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgIGlmICghbUVHTC5tQ29udGV4dCkgewotICAgICAgICAgICAgZmlyc3QgPSB0cnVlOwotICAgICAgICAgICAgcHRocmVhZF9tdXRleF9sb2NrKCZnSW5pdE11dGV4KTsKLSAgICAgICAgICAgIGluaXRFR0wodHJ1ZSk7Ci0gICAgICAgICAgICBwdGhyZWFkX211dGV4X3VubG9jaygmZ0luaXRNdXRleCk7Ci0gICAgICAgIH0KKyAgICAgICAgbVdpZHRoID0gdzsKKyAgICAgICAgbUhlaWdodCA9IGg7CiAKICAgICAgICAgbUVHTC5tU3VyZmFjZSA9IGVnbENyZWF0ZVdpbmRvd1N1cmZhY2Uob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BnbEdldFN0cmluZyhHTF9WRU5ET1IpOwotICAgICAgICAgICAgbUdMLm1SZW5kZXJlciA9IGdsR2V0U3RyaW5nKEdMX1JFTkRFUkVSKTsKLSAgICAgICAgICAgIG1HTC5tRXh0ZW5zaW9ucyA9IGdsR2V0U3RyaW5nKEdMX0VYVEVOU0lPTlMpOwotCi0gICAgICAgICAgICAvL0xPR1YoIkVHTCBWZXJzaW9uICVpICVpIiwgbUVHTC5tTWFqb3JWZXJzaW9uLCBtRUdMLm1NaW5vclZlcnNpb24pOwotICAgICAgICAgICAgTE9HVigiR0wgVmVyc2lvbiAlcyIsIG1HTC5tVmVyc2lvbik7Ci0gICAgICAgICAgICAvL0xPR1YoIkdMIFZlbmRvciAlcyIsIG1HTC5tVmVuZG9yKTsKLSAgICAgICAgICAgIExPR1YoIkdMIFJlbmRlcmVyICVzIiwgbUdMLm1SZW5kZXJlcik7Ci0gICAgICAgICAgICAvL0xPR1YoIkdMIEV4dGVuc2lvbnMgJXMiLCBtR0wubUV4dGVuc2lvbnMpOwotCi0gICAgICAgICAgICBjb25zdCBjaGFyICp2ZXJwdHIgPSBOVUxMOwotICAgICAgICAgICAgaWYgKHN0cmxlbigoY29uc3QgY2hhciAqKW1HTC5tVmVyc2lvbikgPiA5KSB7Ci0gICAgICAgICAgICAgICAgaWYgKCFtZW1jbXAobUdMLm1WZXJzaW9uLCAiT3BlbkdMIEVTLUNNIiwgMTIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHZlcnB0ciA9IChjb25zdCBjaGFyICopbUdMLm1WZXJzaW9uICsgMTI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICghbWVtY21wKG1HTC5tVmVyc2lvbiwgIk9wZW5HTCBFUyAiLCAxMCkpIHsKLSAgICAgICAgICAgICAgICAgICAgdmVycHRyID0gKGNvbnN0IGNoYXIgKiltR0wubVZlcnNpb24gKyA5OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICA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oKSBjb25zdCB7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIHVpbnQzMl90IGdldFdpZHRoKCkgY29uc3Qge3JldHVybiAwO30KKyAgICB1aW50MzJfdCBnZXRIZWlnaHQoKSBjb25zdCB7cmV0dXJuIDA7fQorCisgICAgLy8gVGltZXJzCisgICAgZW51bSBUaW1lcnMgeworICAgICAgICBSU19USU1FUl9JRExFLAorICAgICAgICBSU19USU1FUl9JTlRFUk5BTCwKKyAgICAgICAgUlNfVElNRVJfU0NSSVBULAorICAgICAgICBSU19USU1FUl9DTEVBUl9TV0FQLAorICAgICAgICBfUlNfVElNRVJfVE9UQUwKKyAgICB9OworCisgICAgYm9vbCBjaGVja1ZlcnNpb24xXzEoKSBjb25zdCB7cmV0dXJuIGZhbHNlOyB9CisgICAgYm9vbCBjaGVja1ZlcnNpb24yXzAoKSBjb25zdCB7cmV0dXJuIGZhbHNlOyB9CisKKyAgICBzdHJ1Y3QgeworICAgICAgICBib29sIG1Mb2dUaW1lczsKKyAgICAgICAgYm9vbCBtTG9nU2NyaXB0czsKKyAgICAgICAgYm9vbCBtTG9nT2JqZWN0czsKKyAgICAgICAgYm9vbCBtTG9nU2hhZGVyczsKKyAgICAgICAgYm9vbCBtTG9nU2hhZGVyc0F0dHI7CisgICAgICAgIGJvb2wgbUxvZ1NoYWRlcnNVbmlmb3JtczsKKyAgICAgICAgYm9vbCBtTG9nVmlzdWFsOworICAgIH0gcHJvcHM7CisKKyAgICB2b2lkIGR1bXBEZWJ1ZygpIGNvbnN0IHsgICAgfQorICAgIHZvaWQgY2hlY2tFcnJvcihjb25zdCBjaGFyICopIGNvbnN0IHsgIH07CisgICAgdm9pZCBzZXRFcnJvcihSc0Vycm9yIGUsIGNvbnN0IGNoYXIgKm1zZyA9IE5VTEwpIHsgIH0KKworICAgIG11dGFibGUgY29uc3QgT2JqZWN0QmFzZSAqIG1PYmpIZWFkOworCisgICAgYm9vbCBleHRfT0VTX3RleHR1cmVfbnBvdCgpIGNvbnN0IHtyZXR1cm4gbUdMLk9FU190ZXh0dXJlX25wb3Q7fQorICAgIGZsb2F0IGV4dF90ZXh0dXJlX21heF9hbmlzbygpIGNvbnN0IHtyZXR1cm4gMS4wZjt9CisgICAgdWludDMyX3QgZ2V0TWF4RnJhZ21lbnRUZXh0dXJlcygpIGNvbnN0IHtyZXR1cm4gbUdMLm1NYXhGcmFnbWVudFRleHR1cmVJbWFnZVVuaXRzO30KKyAgICB1aW50MzJfdCBnZXRNYXhGcmFnbWVudFVuaWZvcm1WZWN0b3JzKCkgY29uc3Qge3JldHVybiBtR0wubU1heEZyYWdtZW50VW5pZm9ybVZlY3RvcnM7fQorICAgIHVpbnQzMl90IGdldE1heFZlcnRleFVuaWZvcm1WZWN0b3JzKCkgY29uc3Qge3JldHVybiBtR0wubU1heFZlcnRleFVuaWZvcm1WZWN0b3JzO30KKworcHJvdGVjdGVkOgorCisgICAgc3RydWN0IHsKKyAgICAgICAgY29uc3QgdWludDhfdCAqIG1WZW5kb3I7CisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKiBtUmVuZGVyZXI7CisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKiBtVmVyc2lvbjsKKyAgICAgICAgY29uc3QgdWludDhfdCAqIG1FeHRlbnNpb25zOworCisgICAgICAgIHVpbnQzMl90IG1NYWpvclZlcnNpb247CisgICAgICAgIHVpbnQzMl90IG1NaW5vclZlcnNpb247CisKKyAgICAgICAgaW50MzJfdCBtTWF4VmFyeWluZ1ZlY3RvcnM7CisgICAgICAgIGludDMyX3QgbU1heFRleHR1cmVJbWFnZVVuaXRzOworCisgICAgICAgIGludDMyX3QgbU1heEZyYWdtZW50VGV4dHVyZUltYWdlVW5pdHM7CisgICAgICAgIGludDMyX3QgbU1heEZyYWdtZW50VW5pZm9ybVZlY3RvcnM7CisKKyAgICAgICAgaW50MzJfdCBtTWF4VmVydGV4QXR0cmliczsKKyAgICAgICAgaW50MzJfdCBtTWF4VmVydGV4VW5pZm9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Sk7CisgICAgICAgICAgICBlbGVtLT5tRmllbGRzW2N0XS5lLnNldChmaWVsZEVsZW0pOworICAgICAgICAgICAgZWxlbS0+bUZpZWxkc1tjdF0ub2Zmc2V0Qml0cyA9IG9mZnNldDsKKyAgICAgICAgICAgIG9mZnNldCArPSBmaWVsZEVsZW0tPmdldFNpemVCaXRzKCk7CisgICAgICAgICAgICAvLyBDaGVjayBpZiBvdXIgc3ViLWVsZW1lbnRzIGhhdmUgcmVmZXJlbmNlcworICAgICAgICAgICAgaWYoZmllbGRFbGVtLT5tSGFzUmVmZXJlbmNlKSB7CisgICAgICAgICAgICAgICAgZWxlbS0+bUhhc1JlZmVyZW5jZSA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBXZSBuZWVkIHRvIGNoZWNrIGlmIHRoaXMgYWxyZWFkeSBleGlzdHMKKyAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgcnNjLT5tU3RhdGVFbGVtZW50Lm1FbGVtZW50cy5zaXplKCk7IGN0KyspIHsKKyAgICAgICAgRWxlbWVudCAqZWUgPSByc2MtPm1TdGF0ZUVsZW1lbnQubUVsZW1lbnRzW2N0XTsKKyAgICAgICAgaWYoZWUtPmlzRXF1YWwoZWxlbSkpIHsKKyAgICAgICAgICAgIE9iamVjdEJhc2U6OmNoZWNrRGVsZXRlKGVsZW0pOworICAgICAgICAgICAgZWUtPmluY1VzZXJSZWYoKTsKKyAgICAgICAgICAgIHJldHVybiBlZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJzYy0+bVN0YXRlRWxlbWVudC5tRWxlbWVudHMucHVzaChlbGVtKTsKKyAgICByZXR1cm4gZWxlbTsKK30KKworYm9vbCBFbGVtZW50Ojppc0VxdWFsKGNvbnN0IEVsZW1lbnQgKm90aGVyKSBjb25zdCB7CisgICAgaWYob3RoZXIgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIGlmICghb3RoZXItPmdldEZpZWxkQ291bnQoKSAmJiAhbUZpZWxkQ291bnQpIHsKKyAgICAgICAgaWYoKG90aGVyLT5nZXRUeXBlKCkgPT0gZ2V0VHlwZSgpKSAmJgorICAgICAgICAgICAob3RoZXItPmdldEtpbmQoKSA9PSBnZXRLaW5kKCkpICYmCisgICAgICAgICAgIChvdGhlci0+Z2V0Q29tcG9uZW50KCkuZ2V0SXNOb3JtYWxpemVkKCkgPT0gZ2V0Q29tcG9uZW50KCkuZ2V0SXNOb3JtYWxpemVkKCkpICYmCisgICAgICAgICAgIChvdGhlci0+Z2V0Q29tcG9uZW50KCkuZ2V0VmVjdG9yU2l6ZSgpID09IGdldENvbXBvbmVudCgpLmdldFZlY3RvclNpemUoKSkpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgaWYgKG90aGVyLT5nZXRGaWVsZENvdW50KCkgPT0gbUZpZWxkQ291bnQpIHsKKyAgICAgICAgZm9yICh1aW50MzJfdCBpPTA7IGkgPCBtRmllbGRDb3VudDsgaSsrKSB7CisgICAgICAgICAgICBpZiAoKCFvdGhlci0+bUZpZWxkc1tpXS5lLT5pc0VxdWFsKG1GaWVsZHNbaV0uZS5nZXQoKSkpIHx8CisgICAgICAgICAgICAgICAgKG90aGVyLT5tRmllbGRzW2ldLm5hbWUubGVuZ3RoKCkgIT0gbUZpZWxkc1tpXS5uYW1lLmxlbmd0aCgpKSB8fAorICAgICAgICAgICAgICAgIChvdGhlci0+bUZpZWxkc1tpXS5uYW1lICE9IG1GaWVsZHNbaV0ubmFtZSkgfHwKKyAgICAgICAgICAgICAgICAob3RoZXItPm1GaWVsZHNbaV0uYXJyYXlTaXplICE9IG1GaWVsZHNbaV0uYXJyYXlTaXplKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisgICAgcmV0dXJuIGZhbHNlOworfQogCiBjb25zdCBFbGVtZW50ICogRWxlbWVudDo6Y3JlYXRlKENvbnRleHQgKnJzYywgUnNEYXRhVHlwZSBkdCwgUnNEYXRhS2luZCBkaywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGlzTm9ybSwgdWludDMyX3QgdmVjU2l6ZSkKQEAgLTEwNCwxMiArMTk1LDEzIEBACiAgICAgRWxlbWVudCAqZSA9IG5ldyBFbGVtZW50KHJzYyk7CiAgICAgZS0+bUNvbXBvbmVudC5zZXQoZHQsIGRrLCBpc05vcm0sIHZlY1NpemUpOwogICAgIGUtPm1CaXRzID0gZS0+bUNvbXBvbmVudC5nZXRCaXRzKCk7CisgICAgZS0+bUhhc1JlZmVyZW5jZSA9IGUtPm1Db21wb25lbnQuaXNSZWZlcmVuY2UoKTsKICAgICByc2MtPm1TdGF0ZUVsZW1lbnQubUVsZW1lbnRzLnB1c2goZSk7CiAgICAgcmV0dXJuIGU7CiB9CiAKIGNvbnN0IEVsZW1lbnQgKiBFbGVtZW50OjpjcmVhdGUoQ29udGV4dCAqcnNjLCBzaXplX3QgY291bnQsIGNvbnN0IEVsZW1lbnQgKiplaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqKm5pbiwgY29uc3Qgc2l6ZV90ICogbGVuZ3RocykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICoqbmluLCBjb25zdCBzaXplX3QgKiBsZW5ndGhzLCBjb25zdCB1aW50MzJfdCAqYXNpbikKIHsKICAgICAvLyBMb29rIGZvciBhbiBleGlzdGluZyBtYXRjaC4KICAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgcnNjLT5tU3RhdGVFbGVtZW50Lm1FbGVtZW50cy5zaXplKCk7IGN0KyspIHsKQEAgLTExOSw3ICsyMTEsOCBAQAogICAgICAgICAgICAgZm9yICh1aW50MzJfdCBpPTA7IGkgPCBjb3VudDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgaWYgKChlZS0+bUZpZWxkc1tpXS5lLmdldCgpICE9IGVpbltpXSkgfHwKICAgICAgICAgICAgICAgICAgICAgKGVlLT5tRmllbGRzW2ldLm5hbWUubGVuZ3RoKCkgIT0gbGVuZ3Roc1tpXSkgfHwKLSAgICAgICAgICAgICAgICAgICAgKGVlLT5tRmllbGRzW2ldLm5hbWUgIT0gbmluW2ldKSkgeworICAgICAgICAgICAgICAgICAgICAoZWUtPm1GaWVsZHNbaV0ubmFtZSAhPSBuaW5baV0pIHx8CisgICAgICAgICAgICAgICAgICAgIChlZS0+bUZpZWxkc1tpXS5hcnJheVNpemUgIT0gYXNpbltpXSkpIHsKICAgICAgICAgICAgICAgICAgICAgbWF0Y2ggPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQpAQCAtMTM0LDU0ICsyMjcsMjMgQEAKICAgICBFbGVtZW50ICplID0gbmV3IEVsZW1lbnQocnNjKTsKICAgICBlLT5tRmllbGRzID0gbmV3IEVsZW1lbnRGaWVsZF90IFtjb3VudF07CiAgICAgZS0+bUZpZWxkQ291bnQgPSBjb3VudDsKKyAgICBzaXplX3QgYml0cyA9IDA7CiAgICAgZm9yIChzaXplX3QgY3Q9MDsgY3QgPCBjb3VudDsgY3QrKykgewogICAgICAgICBlLT5tRmllbGRzW2N0XS5lLnNldChlaW5bY3RdKTsKICAgICAgICAgZS0+bUZpZWxkc1tjdF0ubmFtZS5zZXRUbyhuaW5bY3RdLCBsZW5ndGhzW2N0XSk7CisgICAgICAgIGUtPm1GaWVsZHNbY3RdLm9mZnNldEJpdHMgPSBiaXRzOworICAgICAgICBlLT5tRmllbGRzW2N0XS5hcnJheVNpemUgPSBhc2luW2N0XTsKKyAgICAgICAgYml0cyArPSBlaW5bY3RdLT5nZXRTaXplQml0cygpOworCisgICAgICAgIGlmIChlaW5bY3RdLT5tSGFz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BwZW5kKG1Db21wb25lbnQuZ2V0Q1R5cGUoKSk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgcy5hcHBlbmQoInN0cnVjdCAiKTsKLSAgICAgICAgcy5hcHBlbmQoZ2V0Q1N0cnVjdEJvZHkoaW5kZW50KSk7Ci0gICAgfQotCi0gICAgcmV0dXJuIHM7Ci19Ci0KIFN0cmluZzggRWxlbWVudDo6Z2V0R0xTTFR5cGUodWludDMyX3QgaW5kZW50KSBjb25zdAogewogICAgIFN0cmluZzggczsKQEAgLTIwMSwxMCArMjYzLDYwIEBACiAgICAgcmV0dXJuIHM7CiB9CiAKK3ZvaWQgRWxlbWVudDo6aW5jUmVmcyhjb25zdCB2b2lkICpwdHIpIGNvbnN0Cit7CisgICAgaWYgKCFtRmllbGRDb3VudCkgeworICAgICAgICBpZiAobUNvbXBvbmVudC5pc1JlZmVyZW5jZSgpKSB7CisgICAgICAgICAgICBPYmplY3RCYXNlICpjb25zdCpvYnAgPSBzdGF0aWNfY2FzdDxPYmplY3RCYXNlICpjb25zdCo+KHB0cik7CisgICAgICAgICAgICBPYmplY3RCYXNlICpvYiA9IG9icFswXTsKKyAgICAgICAgICAgIGlmIChvYikgb2ItPmluY1N5c1JlZigpOworICAgICAgICB9CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBjb25zdCB1aW50OF90ICpwID0gc3RhdGljX2Nhc3Q8Y29uc3QgdWludDhfdCAqPihwdHIpOworICAgIGZvciAodWludDMyX3QgaT0wOyBpIDwgbUZpZWxkQ291bnQ7IGkrKykgeworICAgICAgICBpZiAobUZpZWxkc1tpXS5lLT5tSGFzUmVmZXJlbmNlKSB7CisgICAgICAgICAgICBwID0gJnBbbUZpZWxkc1tpXS5vZmZzZXRCaXRzID4+IDNdOworICAgICAgICAgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IG1GaWVsZHNbaV0uYXJyYXlTaXplOyBjdCsrKSB7CisgICAgICAgICAgICAgICAgbUZpZWxkc1tpXS5lLT5pbmNSZWZzKHApOworICAgICAgICAgICAgICAgIHAgKz0gbUZpZWxkc1tpXS5lLT5nZXRTaXplQnl0ZXMoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZCBFbGVtZW50OjpkZWNSZWZzKGNvbnN0IHZvaWQgKnB0cikgY29uc3QKK3sKKyAgICBpZiAoIW1GaWVsZENvdW50KSB7CisgICAgICAgIGlmIChtQ29tcG9uZW50LmlzUmVmZXJlbmNlKCkpIHsKKyAgICAgICAgICAgIE9iamVjdEJhc2UgKmNvbnN0Km9icCA9IHN0YXRpY19jYXN0PE9iamVjdEJhc2UgKmNvbnN0Kj4ocHRyKTsKKyAgICAgICAgICAgIE9iamVjdEJhc2UgKm9iID0gb2JwWzBdOworICAgICAgICAgICAgaWYgKG9iKSBvYi0+ZGVjU3lzUmVmKCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGNvbnN0IHVpbnQ4X3QgKnAgPSBzdGF0aWNfY2FzdDxjb25zdCB1aW50OF90ICo+KHB0cik7CisgICAgZm9yICh1aW50MzJfdCBpPTA7IGkgPCBtRmllbGRDb3VudDsgaSsrKSB7CisgICAgICAgIGlmIChtRmllbGRzW2ldLmUtPm1IYXNSZWZlcmVuY2UpIHsKKyAgICAgICAgICAgIHAgPSAmcFttRmllbGRzW2ldLm9mZnNldEJpdHMgPj4gM107CisgICAgICAgICAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgbUZpZWxkc1tpXS5hcnJheVNpemU7IGN0KyspIHsKKyAgICAgICAgICAgICAgICBtRmllbGRzW2ldLmUtPmRlY1JlZnMocCk7CisgICAgICAgICAgICAgICAgcCArPSBtRmllbGRzW2ldLmUtPmdldFNpemVCeXRlcygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQogCiAKIEVsZW1lbnRTdGF0ZTo6RWxlbWVudFN0YXRlKCkKIHsKKyAgICBjb25zdCB1a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udEJ1aWxkZXJDcmVhdGUoQ29udGV4dCAqcnNjKSB7CisgICAgcmV0dXJuIEVsZW1lbnQ6OmNyZWF0ZShyc2MsIG1CdWlsZGVyRWxlbWVudHMuc2l6ZSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKG1CdWlsZGVyRWxlbWVudHMuZWRpdEFycmF5KClbMF0pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKG1CdWlsZGVyTmFtZVN0cmluZ3MuZWRpdEFycmF5KClbMF0pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQnVpbGRlck5hbWVMZW5ndGhzLmVkaXRBcnJheSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQnVpbGRlckFycmF5cy5lZGl0QXJyYXkoKSk7Cit9CisKIAogLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KIC8vCkBAIC0yMzUsMTQgKzM3MCw0MSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgY291bnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFJzRWxlbWVudCAqIGVpbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqKiBuYW1lcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2l6ZV90ICogbmFtZUxlbmd0aHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNpemVfdCAqIG5hbWVMZW5ndGhzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1aW50MzJfdCAqIGFycmF5U2l6ZXMpCiB7CiAgICAgLy9MT0dFKCJyc2lfRWxlbWVudENyZWF0ZTIgJWkiLCBjb3VudCk7Ci0gICAgY29uc3QgRWxlbWVudCAqZSA9IEVsZW1lbnQ6OmNyZWF0ZShyc2MsIGNvdW50LCAoY29uc3QgRWxlbWVudC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pzdHJlYW0pIGNvbnN0OworICAgIHZpcnR1YWwgUnNBM0RDbGFzc0lEIGdldENsYXNzSWQoKSBjb25zdCB7IHJldHVybiBSU19BM0RfQ0xBU1NfSURfRUxFTUVOVDsgfQorICAgIHN0YXRpYyBFbGVtZW50ICpjcmVhdGVGcm9tU3RyZWFtKENvbnRleHQgKnJzYywgSVN0cmVhbSAqc3RyZWFtKTsKIAogICAgIHN0YXRpYyBjb25zdCBFbGVtZW50ICogY3JlYXRlKENvbnRleHQgKnJzYywgUnNEYXRhVHlwZSBkdCwgUnNEYXRhS2luZCBkaywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGlzTm9ybSwgdWludDMyX3QgdmVjU2l6ZSk7CiAgICAgc3RhdGljIGNvbnN0IEVsZW1lbnQgKiBjcmVhdGUoQ29udGV4dCAqcnNjLCBzaXplX3QgY291bnQsIGNvbnN0IEVsZW1lbnQgKiosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqKiwgY29uc3Qgc2l6ZV90ICogbGVuZ3Rocyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqKiwgY29uc3Qgc2l6ZV90ICogbGVuZ3RocywgY29uc3QgdWludDMyX3QgKmFzaW4pOworCisgICAgdm9pZCBpbmNSZWZzKGNvbnN0IHZvaWQgKikgY29uc3Q7CisgICAgdm9pZCBkZWNSZWZzKGNvbnN0IHZvaWQgKikgY29uc3Q7CisgICAgYm9vbCBnZXRIYXNSZWZlcmVuY2VzKCkgY29uc3Qge3JldHVybiBtSGFzUmVmZXJlbmNlO30KKworICAgIGJvb2wgaXNFcXVhbChjb25zdCBFbGVtZW50ICpvdGhlcikgY29uc3Q7CiAKIHByb3RlY3RlZDoKICAgICAvLyBkZWFsbG9jYXRlIGFueSBjb21wb25lbnRzIHRoYXQgYXJlIHBhcnQgb2YgdGhpcyBlbGVtZW50LgpAQCAtNzIsOSArODIsMTIgQEAKICAgICB0eXBlZGV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ICAgZGVsZXRlIG1JbmRleFtpXTsKKyAgICB9CisgICAgZm9yKHNpemVfdCBpID0gMDsgaSA8IG1Xcml0ZUluZGV4LnNpemUoKTsgaSArKykgeworICAgICAgICBkZWxldGUgbVdyaXRlSW5kZXhbaV07CisgICAgfQorICAgIGlmKG1Xcml0ZVN0cmVhbSkgeworICAgICAgICBkZWxldGUgbVdyaXRlU3RyZWFtOworICAgIH0KKyAgICBpZihtUmVhZFN0cmVhbSkgeworICAgICAgICBkZWxldGUgbVdyaXRlU3RyZWFtOworICAgIH0KKyAgICBpZihtQWxsb2MpIHsKKyAgICAgICAgZnJlZShtQWxsb2MpOworICAgIH0KIH0KIAotYm9vbCBGaWxlQTNEOjpsb2FkKENvbnRleHQgKnJzYywgRklMRSAqZikKK3ZvaWQgRmlsZUEzRDo6cGFyc2VIZWFkZXIoSVN0cmVhbSAqaGVhZGVyU3RyZWFtKQoreworICAgIG1NYWpvclZlcnNpb24gPSBoZWFkZXJTdHJlYW0tPmxvYWRVMzIoKTsKKyAgICBtTWlub3JWZXJzaW9uID0gaGVhZGVyU3RyZWFtLT5sb2FkVTMyKCk7CisgICAgdWludDMyX3QgZmxhZ3MgPSBoZWFkZXJTdHJlYW0tPmxvYWRVMzIoKTsKKyAgICBtVXNlNjRCaXRPZmZzZXRzID0gKGZsYWdzICYgMSkgIT0gMDsKKworICAgIHVpbnQzMl90IG51bUluZGV4RW50cmllcyA9IGhlYWRlclN0cmVhbS0+bG9hZFUzMigpOworICAgIGZvcih1aW50MzJfdCBpID0gMDsgaSA8IG51bUluZGV4RW50cmllczsgaSArKykgeworICAgICAgICBBM0RJbmRleEVudHJ5ICplbnRyeSA9IG5ldyBBM0RJbmRleEVudHJ5KCk7CisgICAgICAgIGhlYWRlclN0cmVhbS0+bG9hZFN0cmluZygmZW50cnktPm1PYmplY3ROYW1lKTsKKyAgICAgICAgTE9HVigiSGVhZGVyIGRhdGEsIGVudHJ5IG5hbWUgPSAlcyIsIGVudHJ5LT5tT2J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3RhcnRzID0gbmV3IHVpbnQxNl90W3AtPm1SZXN0YXJ0Q291bnRzXTsKLSAgICAgICAgZm9yICh1aW50MzJfdCBjdCA9IDA7IGN0IDwgcC0+bVJlc3RhcnRDb3VudHM7IGN0KyspIHsKLSAgICAgICAgICAgIHN3aXRjaChiaXRzKSB7Ci0gICAgICAgICAgICBjYXNlIDg6Ci0gICAgICAgICAgICAgICAgcC0+bVJlc3RhcnRzW2N0XSA9IGlvLT5sb2FkVTgoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMTY6Ci0gICAgICAgICAgICAgICAgcC0+bVJlc3RhcnRzW2N0XSA9IGlvLT5sb2FkVTE2KCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIDMyOgotICAgICAgICAgICAgICAgIHAtPm1SZXN0YXJ0c1tjdF0gPSBpby0+bG9hZFUzMigpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgTE9HRSgiICBpZHggJWkiLCBwLT5tUmVzdGFydHNbY3RdKTsKKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICB1aW50MzJfdCBvZmZzZXQgPSAodWludDMyX3QpbVdyaXRlSW5kZXhbaV0tPm1PZmZzZXQ7CisgICAgICAgICAgICBoZWFkZXJTdHJlYW0uYWRkVTMyKG9mZnNldCk7CisgICAgICAgICAgICBvZmZzZXQgPSAodWludDMyX3QpbVdyaXRlSW5kZXhbaV0tPm1MZW5ndGg7CisgICAgICAgICAgICBoZWFkZXJTdHJlYW0uYWRkVTMyKG9mZnNldCk7CiAgICAgICAgIH0KLSAgICB9IGVsc2UgewotICAgICAgICBwLT5tUmVzdGFydHMgPSBOVUxMOwogICAgIH0KIAotICAgIGllLT5tUnNPYmogPSBwOworICAgIC8vIFdyaXRlIG91ciBtYWdpYyBzdHJpbmcgc28gd2Uga25vdyB3ZSBhcmUgcmVhZGluZyB0aGUgcm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isgICAgICAgIH0KKyAgICAgICAgUnNBM0RDbGFzc0lEIGdldFR5cGUoKSBjb25zdCB7CisgICAgICAgICAgICByZXR1cm4gbVR5cGU7CisgICAgICAgIH0KICAgICB9OwogCi0gICAgYm9vbCBsb2FkKENvbnRleHQgKnJzYywgRklMRSAqZik7CisgICAgYm9vbCBsb2FkKEZJTEUgKmYpOworICAgIGJvb2wgbG9hZChjb25zdCB2b2lkICpkYXRhLCBzaXplX3QgbGVuZ3RoKTsKKworICAgIHNpemVfdCBnZXROdW1JbmRleEVudHJpZXMoKSBjb25zdDsKKyAgICBjb25zdCBBM0RJbmRleEVudHJ5KiBnZXRJbmRleEVudHJ5KHNpemVfdCBpbmRleCkgY29uc3Q7CisgICAgT2JqZWN0QmFzZSAqaW5pdGlhbGl6ZUZyb21FbnRyeShzaXplX3QgaW5kZXgpOworCisgICAgdm9pZCBhcHBlbmRUb0ZpbGUoT2JqZWN0QmFzZSAqb2JqKTsKKyAgICBib29sIHdyaXRlRmlsZShjb25zdCBjaGFyICpmaWxlbmFtZSk7CisKKyAgICAvLyBDdXJyZW50bHkgZmlsZXMgZG8gbm90IGdldCBzZXJpYWxpemVkLAorICAgIC8vIGJ1dCB3ZSBuZWVkIHRvIGluaGVyaXQgZnJvbSBPYmplY3RCYXNlIGZvciByZWYgdHJhY2tpbmcKKyAgICB2aXJ0dWFsIHZvaWQgc2VyaWFsaXplKE9TdHJlYW0gKnN0cmVhbSkgY29uc3QgeworICAgIH0KKyAgICB2aXJ0dWFsIFJzQTNEQ2xhc3NJRCBnZXRDbGFzc0lkKCkgY29uc3QgeworICAgICAgICByZXR1cm4gUlNfQTNEX0NMQVNTX0lEX1VOS05PV047CisgICAgfQogCiBwcm90ZWN0ZWQ6Ci0gICAgY2xhc3MgSU8KLSAgICB7Ci0gICAgcHVibGljOgotICAgICAgICBJTyhjb25zdCB1aW50OF90ICosIGJvb2wgdXNlNjQpOwotICAgIAotICAgICAgICBmbG9hdCBsb2FkRigpIHsKLSAgICAgICAgICAgIG1Qb3MgPSAobVBvcyArIDMpICYgKH4zKTsKLSAgICAgICAgICAgIGZsb2F0IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgZmxvYXQgKj4oJm1EYXRhW21Qb3NdKVswXTsKLSAgICAgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKGZsb2F0KTsKLSAgICAgICAgICAgIHJldHVybiB0bXA7Ci0gICAgICAgIH0KLSAgICAgICAgaW50MzJfdCBsb2FkSTMyKCkgewotICAgICAgICAgICAgbVBvcyA9IChtUG9zICsgMykgJiAofjMpOwotICAgICAgICAgICAgaW50MzJfdCB0bXAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IGludDMyX3QgKj4oJm1EYXRhW21Qb3NdKVswXTsKLSAgICAgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKGludDMyX3QpOwotICAgICAgICAgICAgcmV0dXJuIHRtcDsKLSAgICAgICAgfQotICAgICAgICB1aW50MzJfdCBsb2FkVTMyKCkgewotICAgICAgICAgICAgbVBvcyA9IChtUG9zICsgMykgJiAofjMpOwotICAgICAgICAgICAgdWludDMyX3QgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50MzJfdCAqPigmbURhdGFbbVBvc10pWzBdOwotICAgICAgICAgICAgbVBvcyArPSBzaXplb2YodWludDMyX3QpOwotICAgICAgICAgICAgcmV0dXJuIHRtcDsKLSAgICAgICAgfQotICAgICAgICB1aW50MTZfdCBsb2FkVTE2KCkgewotICAgICAgICAgICAgbVBvcyA9IChtUG9zICsgMSkgJiAofjEpOwotICAgICAgICAgICAgdWludDE2X3QgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50MTZfdCAqPigmbURhdGFbbVBvc10pWzBdOwotICAgICAgICAgICAgbVBvcyArPSBzaXplb2YodWludDE2X3QpOwotICAgICAgICAgICAgcmV0dXJuIHRtcDsKLSAgICAgICAgfQotICAgICAgICB1aW50OF90IGxvYWRVOCgp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0aCArPSBmb250c0RpcjsKKyAgICBmdWxsUGF0aCArPSBuYW1lOworCisgICAgRlRfRXJyb3IgZXJyb3IgPSBGVF9OZXdfRmFjZShtUlNDLT5tU3RhdGVGb250LmdldExpYigpLCBmdWxsUGF0aC5zdHJpbmcoKSwgMCwgJm1GYWNlKTsKKyAgICBpZihlcnJvcikgeworICAgICAgICBMT0dFKCJVbmFibGUgdG8gaW5pdGlhbGl6ZSBmb250ICVzIiwgZnVsbFBhdGguc3RyaW5nKCkpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgbUZvbnROYW1lID0gbmFtZTsKKyAgICBtRm9udFNpemUgPSBmb250U2l6ZTsKKyAgICBtRHBpID0gZHBpOworCisgICAgZXJyb3IgPSBGVF9TZXRfQ2hhcl9TaXplKG1GYWNlLCBmb250U2l6ZSAqIDY0LCAwLCBkcGksIDApOworICAgIGlmKGVycm9yKSB7CisgICAgICAgIExPR0UoIlVuYWJsZSB0byBzZXQgZm9udCBzaXplIG9uICVzIiwgZnVsbFBhdGguc3RyaW5nKCkpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgbUhhc0tlcm5pbmcgPSBGVF9IQVNfS0VSTklORyhtRmFjZSk7CisKKyAgICBtSW5pdGlhbGl6ZWQgPSB0cnVlOworICAgIHJldHVybiB0cnVlOworfQorCit2b2lkIEZvbnQ6OmludmFsaWRhdGVUZXh0dXJlQ2FjaGUoKQoreworICAgIGZvcih1aW50MzJfdCBpID0gMDsgaSA8IG1DYWNoZWRHbHlwaHMuc2l6ZSgpOyBpICsrKSB7CisgICAgICAgIG1DYWNoZWRHbHlwaHMudmFsdWVBdChpKS0+bUlzVmFsaWQgPSBmYWxzZTsKKyAgICB9Cit9CisKK3ZvaWQgRm9udDo6ZHJhd0NhY2hlZEdseXBoKENhY2hlZEdseXBoSW5mbyAqZ2x5cGgsIGludDMyX3QgeCwgaW50MzJfdCB5KQoreworICAgIEZvbnRTdGF0ZSAqc3RhdGUgPSAmbVJTQy0+bVN0YXRlRm9udDsKKworICAgIGludDMyX3QgblBlblggPSB4ICsgZ2x5cGgtPm1CaXRtYXBMZWZ0OworICAgIGludDMyX3QgblBlblkgPSB5IC0gZ2x5cGgtPm1CaXRtYXBUb3AgKyBnbHlwaC0+bUJpdG1hcEhlaWdodDsKKworICAgIGZsb2F0IHUxID0gZ2x5cGgtPm1CaXRtYXBNaW5VOworICAgIGZsb2F0IHUyID0gZ2x5cGgtPm1CaXRtYXBNYXhVOworICAgIGZsb2F0IHYxID0gZ2x5cGgtPm1CaXRtYXBNaW5WOworICAgIGZsb2F0IHYyID0gZ2x5cGgtPm1CaXRtYXBNYXhWOworCisgICAgaW50MzJfdCB3aWR0aCA9IChpbnQzMl90KSBnbHlwaC0+bUJpdG1hcFdpZHRoOworICAgIGludDMyX3QgaGVpZ2h0ID0gKGludDMyX3QpIGdseXBoLT5tQml0bWFwSGVpZ2h0OworCisgICAgc3RhdGUtPmFwcGVuZE1lc2hRdWFkKG5QZW5YLCBuUGVuWSwgMCwgdTEsIHYyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBuUGVuWCArIHdpZHRoLCBuUGVuWSwgMCwgdTIsIHYyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBuUGVuWCArIHdpZHRoLCBuUGVuWSAtIGhlaWdodCwgMCwgdTIsIHYxLAorICAgICAgICAgICAgICAgICAgICAgICAgICBuUGVuWCwgblBlblkgLSBoZWlnaHQsIDAsIHUxLCB2MSk7Cit9CisKK3ZvaWQgRm9udDo6ZHJhd0NhY2hlZEdseXBoKENhY2hlZEdseXBoSW5mbyogZ2x5cGgsIGludDMyX3QgeCwgaW50MzJfdCB5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDhfdCogYml0bWFwLCB1aW50MzJfdCBiaXRtYXBXLCB1aW50MzJfdCBiaXRtYXBIKSB7CisgICAgaW50MzJfdCBuUGVuWCA9IHggKyBnbHlwaC0+bUJpdG1hcExlZnQ7CisgICA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gICAgICAgICAgICBiaXRtYXBbYlkgKiBiaXRtYXBXICsgYlhdID0gdGVtcENvbDsKKyAgICAgICAgfQorICAgIH0KKworfQorCit2b2lkIEZvbnQ6Om1lYXN1cmVDYWNoZWRHbHlwaChDYWNoZWRHbHlwaEluZm8gKmdseXBoLCBpbnQzMl90IHgsIGludDMyX3QgeSwgUmVjdCAqYm91bmRzKSB7CisgICAgaW50MzJfdCBuUGVuWCA9IHggKyBnbHlwaC0+bUJpdG1hcExlZnQ7CisgICAgaW50MzJfdCBuUGVuWSA9IHkgLSBnbHlwaC0+bUJpdG1hcFRvcCArIGdseXBoLT5tQml0bWFwSGVpZ2h0OworCisgICAgaW50MzJfdCB3aWR0aCA9IChpbnQzMl90KSBnbHlwaC0+bUJpdG1hcFdpZHRoOworICAgIGludDMyX3QgaGVpZ2h0ID0gKGludDMyX3QpIGdseXBoLT5tQml0bWFwSGVpZ2h0OworCisgICAgaWYgKGJvdW5kcy0+Ym90dG9tID4gblBlblkpIHsKKyAgICAgICAgYm91bmRzLT5ib3R0b20gPSBuUGVuWTsKKyAgICB9CisgICAgaWYgKGJvdW5kcy0+bGVmdCA+IG5QZW5YKSB7CisgICAgICAgIGJvdW5kcy0+bGVmdCA9IG5QZW5YOworICAgIH0KKyAgICBpZiAoYm91bmRzLT5yaWdodCA8IG5QZW5YICsgd2lkdGgpIHsKKyAgICAgICAgYm91bmRzLT5yaWdodCA9IG5QZW5YICsgd2lkdGg7CisgICAgfQorICAgIGlmIChib3VuZHMtPnRvcCA8IG5QZW5ZICsgaGVpZ2h0KSB7CisgICAgICAgIGJvdW5kcy0+dG9wID0gblBlblkgKyBoZWlnaHQ7CisgICAgfQorfQorCit2b2lkIEZvbnQ6OnJlbmRlclVURihjb25zdCBjaGFyICp0ZXh0LCB1aW50MzJfdCBsZW4sIGludDMyX3QgeCwgaW50MzJfdCB5LAorICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3RhcnQsIGludDMyX3QgbnVtR2x5cGhzLAorICAgICAgICAgICAgICAgICAgICAgUmVuZGVyTW9kZSBtb2RlLCBSZWN0ICpib3VuZHMsCisgICAgICAgICAgICAgICAgICAgICB1aW50OF90ICpiaXRtYXAsIHVpbnQzMl90IGJpdG1hcFcsIHVpbnQzMl90IGJpdG1hcEgpCit7CisgICAgaWYoIW1Jbml0aWFsaXplZCB8fCBudW1HbHlwaHMgPT0gMCB8fCB0ZXh0ID09IE5VTEwgfHwgbGVuID09IDApIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmKG1vZGUgPT0gRm9udDo6TUVBU1VSRSkgeworICAgICAgICBpZiAoYm91bmRzID09IE5VTEwpIHsKKyAgICAgICAgICAgIExPR0UoIk5vIHJldHVybiByZWN0YW5nbGUgcHJvdmlkZWQgdG8gbWVhc3VyZSB0ZXh0Iik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgLy8gUmVzZXQgbWluIGFuZCBtYXggb2YgdGhlIGJvdW5kaW5nIGJveCB0byBzb21ldGhpbmcgbGFyZ2UKKyAgICAgICAgYm91bmRzLT5zZXQoMWU2LCAtMWU2LCAtMWU2LCAxZTYpOworICAgIH0KKworICAgIGludDMyX3QgcGVuWCA9IHgsIHBlblkgPSB5OworICAgIGludDMyX3QgZ2x5cGhzTGVmdCA9IDE7CisgICAgaWYobnVtR2x5cGhzID4gMCkgeworICAgICAgICBnbHlwaHNMZWZ0ID0gbnVtR2x5cGhzOworICAgIH0KKworICAgIHNpemVfdCBpbmRleCA9IHN0YXJ0OworICAgIHNpemVfdCBuZXh0SW5kZXggPSAwOworCisgICAgd2hpbGUgKGdseXBoc0xlZnQgPiAwKSB7CisKKyAgICAgICAgaW50MzJfdCB1dGZDaGFyID0gdXRmMzJfYXQodGV4dCwgbGVuLCBpbmRleCwgJm5leHRJbmRleCk7CisKKyAgICAgICAgLy8gUmVhY2hlZCB0aGUgZW5kIG9mIHRoZSBzdHJpbmcgb3IgZW5jb3VudGVyZWQKKyAgICAgICAgaWYodXRmQ2hhciA8IDApIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgLy8gTW92ZSB0byB0aGUgbmV4dCBjaGFyYWN0ZXIgaW4gdGhlIGFycmF5CisgICAgICAgIGluZGV4ID0gbmV4dEluZGV4OworCisgICAgICAgIENhY2hlZEdseXBoSW5mbyAqY2FjaGVkR2x5cGggPSBnZXRDYWNoZWRVVEZDaGFyKHV0ZkNoYXIpOworCisgICAgICAgIC8vIElmIGl0J3Mgc3RpbGwgbm90IHZhbGlkLCB3ZSBjb3VsZG4ndCBjYWNoZSBpdCwgc28gd2Ugc2hvdWxkbid0IGRyYXcgZ2FyYmFnZQorICAgICAgICBpZihjYWNoZWRHbHlwaC0+bUlzVmFsaWQpIHsKKyAgICAgICAgICAgIHN3aXRjaChtb2RlKSB7CisgICAgICAgICAgICBjYXNlIEZSQU1FQlVGRkVSOgorICAgICAgICAgICAgICAgIGRyYXdDYWNoZWRHbHlwaChjYWNoZWRHbHlwaCwgcGVuWCwgcGVuWSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEJJVE1BUDoKKyAgICAgICAgICAgICAgICBkcmF3Q2FjaGVkR2x5cGgoY2FjaGVkR2x5cGgsIHBlblgsIHBlblksIGJpdG1hcCwgYml0bWFwVywgYml0bWFwSCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE1FQVNVUkU6CisgICAgICAgICAgICAgICAgbWVhc3VyZUNhY2hlZEdseXBoKGNhY2hlZEdseXBoLCBwZW5YLCBwZW5ZLCBib3VuZHMpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcGVuWCArPSAoY2FjaGVkR2x5cGgtPm1BZHZhbmNlLnggPj4gNik7CisKKyAgICAgICAgLy8gSWYgd2Ugd2VyZSBnaXZlbiBhIHNwZWNpZmljIG51bWJlciBvZ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pdmVGb250c1tpXTsKKyAgICAgICAgaWYoaXRoRm9udC0+bUZvbnROYW1lID09IG5hbWUgJiYgaXRoRm9udC0+bUZvbnRTaXplID09IGZvbnRTaXplICYmIGl0aEZvbnQtPm1EcGkgPT0gZHBpKSB7CisgICAgICAgICAgICByZXR1cm4gaXRoRm9udDsKKyAgICAgICAgfQorICAgIH0KKworICAgIEZvbnQgKm5ld0ZvbnQgPSBuZXcgRm9udChyc2MpOworICAgIGJvb2wgaXNJbml0aWFsaXplZCA9IG5ld0ZvbnQtPmluaXQobmFtZSwgZm9udFNpemUsIGRwaSk7CisgICAgaWYoaXNJbml0aWFsaXplZCkgeworICAgICAgICBhY3RpdmVGb250cy5wdXNoKG5ld0ZvbnQpOworICAgICAgICByc2MtPm1TdGF0ZUZvbnQucHJlY2FjaGVMYXRpbihuZXdGb250KTsKKyAgICAgICAgcmV0dXJuIG5ld0ZvbnQ7CisgICAgfQorCisgICAgT2JqZWN0QmFzZTo6Y2hlY2tEZWxldGUobmV3Rm9udCk7CisgICAgcmV0dXJuIE5VTEw7CisKK30KKworRm9udDo6fkZvbnQoKQoreworICAgIGlmKG1GYWNlKSB7CisgICAgICAgIEZUX0RvbmVfRmFjZShtRmFjZSk7CisgICAgfQorCisgICAgZm9yICh1aW50MzJfdCBjdCA9IDA7IGN0IDwgbVJTQy0+bVN0YXRlRm9udC5tQWN0aXZlRm9udHMuc2l6ZSgpOyBjdCsrKSB7CisgICAgICAgIGlmIChtUlNDLT5tU3RhdGVGb250Lm1BY3RpdmVGb250c1tjdF0gPT0gdGhpcykgeworICAgICAgICAgICAgbVJTQy0+bVN0YXRlRm9udC5tQWN0aXZlRm9udHMucmVtb3ZlQXQoY3QpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBmb3IodWludDMyX3QgaSA9IDA7IGkgPCBtQ2FjaGVkR2x5cGhzLnNpemUoKTsgaSArKykgeworICAgICAgICBDYWNoZWRHbHlwaEluZm8gKmdseXBoID0gbUNhY2hlZEdseXBocy52YWx1ZUF0KGkpOworICAgICAgICBkZWxldGUgZ2x5cGg7CisgICAgfQorfQorCitGb250U3RhdGU6OkZvbnRTdGF0ZSgpCit7CisgICAgbUluaXRpYWxpemVkID0gZmFsc2U7CisgICAgbU1heE51bWJlck9mUXVhZHMgPSAxMDI0OworICAgIG1DdXJyZW50UXVhZEluZGV4ID0gMDsKKyAgICBtUlNDID0gTlVMTDsKKyAgICBtTGlicmFyeSA9IE5VTEw7CisKKyAgICAvLyBHZXQgdGhlIHJlbmRlcmVyIHByb3BlcnRpZXMKKyAgICBjaGFyIHByb3BlcnR5W1BST1BFUlRZX1ZBTFVFX01BWF07CisKKyAgICAvLyBHZXQgdGhlIGdhbW1hCisgICAgZmxvYXQgZ2FtbWEgPSBERUZBVUxUX1RFWFRfR0FNTUE7CisgICAgaWYgKHByb3BlcnR5X2dldChQUk9QRVJUWV9URVhUX0dBTU1BLCBwcm9wZXJ0eSwgTlVMTCkgPiAwKSB7CisgICAgICAgIExPR0QoIiAgU2V0dGluZyB0ZXh0IGdhbW1hIHRvICVzIiwgcHJvcGVydHkpOworICAgICAgICBnYW1tYSA9IGF0b2YocHJvcGVydHkpOworICAgIH0gZWxzZSB7CisgICAgICAgIExPR0QoIiAgVXNpbmcgZGVmYXVsdCB0ZXh0IGdhbW1hIG9mICUuMmYiLCBERUZBVUxUX1RFWFRfR0FNTUEpOworICAgIH0KKworICAgIC8vIEdldCB0aGUgYmxhY2sgZ2FtbWEgdGhyZXNob2xkCisgICAgaW50MzJfdCBibGFja1RocmVzaG9sZCA9IERFRkFVTFRfVEVYVF9CTEFDS19HQU1NQV9USFJFU0hPTEQ7CisgICAgaWYgKHByb3BlcnR5X2dldChQUk9QRVJUWV9URVhUX0JMQUNLX0dBTU1BX1RIUkVTSE9MRCwgcHJvcGVydHksIE5VTEwpID4gMCkgeworICAgICAgICBMT0dEKCIgIFNldHRpbmcgdGV4dCBibGFjayBnYW1tYSB0aHJlc2h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W1lbnRzKEdMX1RSSUFOR0xFUywgbUN1cnJlbnRRdWFkSW5kZXggKiA2LCBHTF9VTlNJR05FRF9TSE9SVCwgKHVpbnQxNl90ICopKDApKTsKKworICAgIC8vIFJlc2V0IHRoZSBzdGF0ZQorICAgIG1SU0MtPnNldFZlcnRleCgoUHJvZ3JhbVZlcnRleCAqKXRtcFYuZ2V0KCkpOworICAgIG1SU0MtPnNldFJhc3RlcigoUHJvZ3JhbVJhc3RlciAqKXRtcFIuZ2V0KCkpOworICAgIG1SU0MtPnNldEZyYWdtZW50KChQcm9ncmFtRnJhZ21lbnQgKil0bXBGLmdldCgpKTsKKyAgICBtUlNDLT5zZXRGcmFnbWVudFN0b3JlKChQcm9ncmFtU3RvcmUgKil0bXBQUy5nZXQoKSk7Cit9CisKK3ZvaWQgRm9udFN0YXRlOjphcHBlbmRNZXNoUXVhZChmbG9hdCB4MSwgZmxvYXQgeTEsIGZsb2F0IHoxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUxLCBmbG9hdCB2MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MiwgZmxvYXQgeTIsIGZsb2F0IHoyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUyLCBmbG9hdCB2MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MywgZmxvYXQgeTMsIGZsb2F0IHozLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUzLCBmbG9hdCB2MywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4NCwgZmxvYXQgeTQsIGZsb2F0IHo0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHU0LCBmbG9hdCB2NCkKK3sKKyAgICBjb25zdCB1aW50MzJfdCB2ZXJ0c1BlclF1YWQgPSA0OworICAgIGNvbnN0IHVpbnQzMl90IGZsb2F0c1BlclZlcnQgPSA1OworICAgIGZsb2F0ICpjdXJyZW50UG9zID0gbVRleHRNZXNoUHRyICsgbUN1cnJlbnRRdWFkSW5kZXggKiB2ZXJ0c1BlclF1YWQgKiBmbG9hdHNQZXJWZXJ0OworCisgICAgLy8gQ3VsbCB0aGluZ3MgdGhhdCBhcmUgb2ZmIHRoZSBzY3JlZW4KKyAgICBmbG9hdCB3aWR0aCA9IChmbG9hdCltUlNDLT5nZXRXaWR0aCgpOworICAgIGZsb2F0IGhlaWdodCA9IChmbG9hdCltUlNDLT5nZXRIZWlnaHQoKTsKKworICAgIGlmKHgxID4gd2lkdGggfHwgeTEgPCAwLjBmIHx8IHgyIDwgMCB8fCB5NCA+IGhlaWdodCkgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLypMT0dFKCJWMCB4OiAlZiB5OiAlZiB6OiAlZiIsIHgxLCB5MSwgejEpOworICAgIExPR0UoIlYxIHg6ICVmIHk6ICVmIHo6ICVmIiwgeDIsIHkyLCB6Mik7CisgICAgTE9HRSgiVjIgeDogJWYgeTogJWYgejogJWYiLCB4MywgeTMsIHozKTsKKyAgICBMT0dFKCJWMyB4OiAlZiB5OiAlZiB6OiAlZiIsIHg0LCB5NCwgejQpOyovCisKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB4MTsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB5MTsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB6MTsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB1MTsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB2MTsKKworICAgICgqY3VycmVudFBvcysrKSA9IHgyOworICAgICgqY3VycmVudFBvcysrKSA9IHkyOworICAgICgqY3VycmVudFBvcysrKSA9IHoyOworICAgICgqY3VycmVudFBvcysrKSA9IHUyOworICAgICgqY3VycmVudFBvcysrKSA9IHYyOworCisgICAgKCpjdXJyZW50UG9zKyspID0geDM7CisgICAgKCpjdXJyZW50UG9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m9udCAqZm9udCkgeworICAgIC8vIFJlbWFpbmluZyBjYXBhY2l0eSBpcyBtZWFzdXJlZCBpbiAlCisgICAgdWludDMyX3QgcmVtYWluaW5nQ2FwYWNpdHkgPSBnZXRSZW1haW5pbmdDYWNoZUNhcGFjaXR5KCk7CisgICAgdWludDMyX3QgcHJlY2FjaGVJZHggPSAwOworICAgIHdoaWxlKHJlbWFpbmluZ0NhcGFjaXR5ID4gMjUgJiYgcHJlY2FjaGVJZHggPCBtTGF0aW5QcmVjYWNoZS5zaXplKCkpIHsKKyAgICAgICAgZm9udC0+Z2V0Q2FjaGVkVVRGQ2hhcigoaW50MzJfdCltTGF0aW5QcmVjYWNoZVtwcmVjYWNoZUlkeF0pOworICAgICAgICByZW1haW5pbmdDYXBhY2l0eSA9IGdldFJlbWFpbmluZ0NhY2hlQ2FwYWNpdHkoKTsKKyAgICAgICAgcHJlY2FjaGVJZHggKys7CisgICAgfQorfQorCisKK3ZvaWQgRm9udFN0YXRlOjpyZW5kZXJUZXh0KGNvbnN0IGNoYXIgKnRleHQsIHVpbnQzMl90IGxlbiwgaW50MzJfdCB4LCBpbnQzMl90IHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzdGFydEluZGV4LCBpbnQzMl90IG51bUdseXBocywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvbnQ6OlJlbmRlck1vZGUgbW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvbnQ6OlJlY3QgKmJvdW5kcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ4X3QgKmJpdG1hcCwgdWludDMyX3QgYml0bWFwVywgdWludDMyX3QgYml0bWFwSCkKK3sKKyAgICBjaGVja0luaXQoKTsKKworICAgIC8vIFJlbmRlciBjb2RlIGhlcmUKKyAgICBGb250ICpjdXJyZW50Rm9udCA9IG1SU0MtPmdldEZvbnQoKTsKKyAgICBpZighY3VycmVudEZvbnQpIHsKKyAgICAgICAgaWYoIW1EZWZhdWx0LmdldCgpKSB7CisgICAgICAgICAgICBtRGVmYXVsdC5zZXQoRm9udDo6Y3JlYXRlKG1SU0MsICJEcm9pZFNhbnMudHRmIiwgMTYsIDk2KSk7CisgICAgICAgIH0KKyAgICAgICAgY3VycmVudEZvbnQgPSBtRGVmYXVsdC5nZXQoKTsKKyAgICB9CisgICAgaWYoIWN1cnJlbnRGb250KSB7CisgICAgICAgIExPR0UoIlVuYWJsZSB0byBpbml0aWFsaXplIGFueSBmb250cyIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgY3VycmVudEZvbnQtPnJlbmRlclVURih0ZXh0LCBsZW4sIHgsIHksIHN0YXJ0SW5kZXgsIG51bUdseXBocywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGUsIGJvdW5kcywgYml0bWFwLCBiaXRtYXBXLCBiaXRtYXBIKTsKKworICAgIGlmKG1DdXJyZW50UXVhZEluZGV4ICE9IDApIHsKKyAgICAgICAgaXNzdWVEcmF3Q29tbWFuZCgpOworICAgICAgICBtQ3VycmVudFF1YWRJbmRleCA9IDA7CisgICAgfQorfQorCit2b2lkIEZvbnRTdGF0ZTo6bWVhc3VyZVRleHQoY29uc3QgY2hhciAqdGV4dCwgdWludDMyX3QgbGVuLCBGb250OjpSZWN0ICpib3VuZHMpIHsKKyAgICByZW5kZXJUZXh0KHRleHQsIGxlbiwgMCwgMCwgMCwgLTEsIEZvbnQ6Ok1FQVNVUkUsIGJvdW5kcyk7Cit9CisKK3ZvaWQgRm9udFN0YXRlOjpzZXRGb250Q29sb3IoZmxvYXQgciwgZmxvYXQgZywgZmxvYXQgYiwgZmxvYXQgYSkgeworICAgIG1Db25zdGFudHMubUZvbnRDb2xvclswXSA9IHI7CisgICAgbUNvbnN0YW50cy5tRm9udENvbG9yWzFdID0gZzsKKyAgICBtQ29uc3RhbnRzLm1Gb250Q29sb3JbMl0gPSBiOworICAgIG1Db25zdGFudHMubUZvbnRDb2xvclszXSA9IGE7CisKKyA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dCBpID0gMDsgaSA8IG1DYWNoZUxpbmVzLnNpemUoKTsgaSArKykgeworICAgICAgICBkZWxldGUgbUNhY2hlTGluZXNbaV07CisgICAgfQorICAgIG1DYWNoZUxpbmVzLmNsZWFyKCk7CisKKyAgICBtRGVmYXVsdC5jbGVhcigpOworCisgICAgVmVjdG9yPEZvbnQqPiBmb250c1RvRGVyZWZlcmVuY2UgPSBtQWN0aXZlRm9udHM7CisgICAgZm9yKHVpbnQzMl90IGkgPSAwOyBpIDwgZm9udHNUb0RlcmVmZXJlbmNlLnNpemUoKTsgaSArKykgeworICAgICAgICBmb250c1RvRGVyZWZlcmVuY2VbaV0tPnplcm9Vc2VyUmVmKCk7CisgICAgfQorCisgICAgaWYobUxpYnJhcnkpIHsKKyAgICAgICAgRlRfRG9uZV9GcmVlVHlwZSggbUxpYnJhcnkgKTsKKyAgICAgICAgbUxpYnJhcnkgPSBOVUxMOworICAgIH0KK30KKworbmFtZXNwYWNlIGFuZHJvaWQgeworbmFtZXNwYWNlIHJlbmRlcnNjcmlwdCB7CisKK1JzRm9udCByc2lfRm9udENyZWF0ZUZyb21GaWxlKENvbnRleHQgKnJzYywgY2hhciBjb25zdCAqbmFtZSwgdWludDMyX3QgZm9udFNpemUsIHVpbnQzMl90IGRwaSkKK3sKKyAgICBGb250ICpuZXdGb250ID0gRm9udDo6Y3JlYXRlKHJzYywgbmFtZSwgZm9udFNpemUsIGRwaSk7CisgICAgaWYobmV3Rm9udCkgeworICAgICAgICBuZXdGb250LT5pbmNVc2VyUmVmKCk7CisgICAgfQorICAgIHJldHVybiBuZXdGb250OworfQorCit9IC8vIHJlbmRlcnNjcmlwdAorfSAvLyBhbmRyb2lkCmRpZmYgLS1naXQgYS9saWJzL3JzL3JzRm9udC5oIGIvbGlicy9ycy9yc0ZvbnQuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4wMDEyYjg0Ci0tLSAvZGV2L251bGwKKysrIGIvbGlicy9ycy9yc0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mlnaHQ7CisgICAgICAgIGludDMyX3QgYm90dG9tOworICAgICAgICB2b2lkIHNldChpbnQzMl90IGwsIGludDMyX3QgciwgaW50MzJfdCB0LCBpbnQzMl90IGIpIHsKKyAgICAgICAgICAgIGxlZnQgPSBsOworICAgICAgICAgICAgcmlnaHQgPSByOworICAgICAgICAgICAgdG9wID0gdDsKKyAgICAgICAgICAgIGJvdHRvbSA9IGI7CisgICAgICAgIH0KKyAgICB9OworCisgICAgfkZvbnQoKTsKKworICAgIC8vIEN1cnJlbnRseSBmaWxlcyBkbyBub3QgZ2V0IHNlcmlhbGl6ZWQsCisgICAgLy8gYnV0IHdlIG5lZWQgdG8gaW5oZXJpdCBmcm9tIE9iamVjdEJhc2UgZm9yIHJlZiB0cmFja2luZworICAgIHZpcnR1YWwgdm9pZCBzZXJpYWxpemUoT1N0cmVhbSAqc3RyZWFtKSBjb25zdCB7CisgICAgfQorICAgIHZpcnR1YWwgUnNBM0RDbGFzc0lEIGdldENsYXNzSWQoKSBjb25zdCB7CisgICAgICAgIHJldHVybiBSU19BM0RfQ0xBU1NfSURfVU5LTk9XTjsKKyAgICB9CisKKyAgICBzdGF0aWMgRm9udCAqIGNyZWF0ZShDb250ZXh0ICpyc2MsIGNvbnN0IGNoYXIgKm5hbWUsIHVpbnQzMl90IGZvbnRTaXplLCB1aW50MzJfdCBkcGkpOworCitwcm90ZWN0ZWQ6CisKKyAgICBmcmllbmQgY2xhc3MgRm9udFN0YXRlOworCisgICAgLy8gUG9pbnRlciB0byB0aGUgdXRmIGRhdGEsIGxlbmd0aCBvZiBkYXRhLCB3aGVyZSB0byBzdGFydCwgbnVtYmVyIG9mIGdseXBocyBvdCByZWFkCisgICAgLy8gKGVhY2ggZ2x5cGggbWF5IGJlIGxvbmdlciB0aGFuIGEgY2hhciBiZWNhdXNlIHdlIGFyZSBkZWFsaW5nIHdpdGggdXRmIGRhdGEpCisgICAgLy8gTGFzdCB0d28gdmFyaWFibGVzIGFyZSB0aGUgaW5pdGlhbCBwZW4gcG9zaXRpb24KKyAgICB2b2lkIHJlbmRlclVURihjb25zdCBjaGFyICp0ZXh0LCB1aW50MzJfdCBsZW4sIGludDMyX3QgeCwgaW50MzJfdCB5LAorICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHN0YXJ0LCBpbnQzMl90IG51bUdseXBocywKKyAgICAgICAgICAgICAgICAgICBSZW5kZXJNb2RlIG1vZGUgPSBGUkFNRUJVRkZFUiwgUmVjdCAqYm91bmRzID0gTlVMTCwKKyAgICAgICAgICAgICAgICAgICB1aW50OF90ICpiaXRtYXAgPSBOVUxMLCB1aW50MzJfdCBiaXRtYXBXID0gMCwgdWludDMyX3QgYml0bWFwSCA9IDApOworCisgICAgdm9pZCBpbnZhbGlkYXRlVGV4dHVyZUNhY2hlKCk7CisgICAgc3RydWN0IENhY2hlZEdseXBoSW5mbworICAgIHsKKyAgICAgICAgLy8gSGFzIHRoZSBjYWNoZSBiZWVuIGludmFsaWRhdGVkPworICAgICAgICBib29sIG1Jc1ZhbGlkOworICAgICAgICAvLyBMb2NhdGlvbiBvZiB0aGUgY2FjaGVkIGdseXBoIGluIHRoZSBiaXRtYXAKKyAgICAgICAgLy8gaW4gY2FzZSB3ZSBuZWVkIHRvIHJlc2l6ZSB0aGUgdGV4dHVyZQorICAgICAgICB1aW50MzJfdCBtQml0bWFwTWluWDsKKyAgICAgICAgdWludDMyX3QgbUJpdG1hcE1pblk7CisgICAgICAgIHVpbnQzMl90IG1CaXRtYXBXaWR0aDsKKyAgICAgICAgdWludDMyX3QgbUJpdG1hcEhlaWdodDsKKyAgICAgICAgLy8gQWxzbyBjYWNoZSB0ZXh0dXJlIGNvb3JkcyBmb3IgdGhlIHF1YWQKKyAgICAgICAgZmxvYXQgbUJpdG1hcE1pblU7CisgICAgICAgIGZsb2F0IG1CaXRtYXBNaW5WOworICAgICAgICBmbG9hdCBtQml0bWFwTWF4VTsKKyAgICAgICAgZmxvYXQgbUJpdG1hcE1heFY7CisgICAgICAgIC8vIE1pbmltaXplIGhvdyBtdWNoIHdlIGNhbGwgZnJlZXR5cGUKKyAgICAgICAgRlRfVUludCBtR2x5cGhJbmRleDsKKyAgICAgICAgRlRfVmVjdG9yIG1BZHZhbmNlOworICAgICAgICAvLyBWYWx1ZXMgYmVsb3cgY29udGFpbiBhIGdseXBoJ3Mgb3JpZ2luIGluIHRoZSBiaXRtYXAKKyAgICAgICAgRlRfSW50IG1CaXRtYXBMZWZ0OworICAgICAgICBGVF9JbnQgbUJpdG1hcFRvcDsKKyAgICB9OworCisgICAgU3RyaW5nOCBtRm9udE5hbWU7CisgICAgdWludDMyX3QgbUZvbnRTaXplOworICAgIHVpbnQzMl90IG1EcGk7CisKKyAgICBGb250KENvbnRleHQgKnJzYyk7CisgICAgYm9vbCBpbml0KGNvbnN0IGNoYXIgKm5hbWUsIHVpbnQzMl90IGZvbnRTaXplLCB1aW50MzJfdCBkcGkpOworCisgICAgRlRfRmFjZSBtRmFjZTsKKyAgICBib29sIG1Jbml0aWFsaXplZDsKKyAgICBib29sIG1IYXNLZXJuaW5nOworCisgICAgRGVmYXVsdEtleWVkVmVjdG9yPHVpbnQzMl90LCBDYWNoZWRHbHlwaEluZm8qID4gbUNhY2hlZEdseXBoczsKKyAgICBDYWNoZWRHbHlwaEluZm8qIGdldENhY2hlZFVURkNoYXIoaW50MzJfdCB1dGZDaGFyKTsKKworICAgIENhY2hlZEdseXBoSW5mbyAqY2FjaGVHbHlwaCh1aW50MzJfdCBnbHlwaCk7CisgICAgdm9pZCB1cGRhdGVHbHlwaENhY2hlKENhY2hlZEdseXBoSW5mbyAqZ2x5cGgpOworICAgIHZvaWQgbWVhc3VyZUNhY2hlZEdseXBoKENhY2hlZEdseXBoSW5mbyAqZ2x5cGgsIGludDMyX3QgeCwgaW50MzJfdCB5LCBSZWN0ICpib3VuZHMpOworICAgIHZvaWQgZHJhd0NhY2hlZEdseXBoKENhY2hlZEdseXBoSW5mbyAqZ2x5cGgsIGludDMyX3QgeCwgaW50MzJfdCB5KTsKKyAgICB2b2lkIGRyYXdDYWNoZWRHbHlwaChDYWNoZWRHbHlwaEluZm8gKmdseXBoLCBpbnQzMl90IHgsIGludDMyX3QgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OF90ICpiaXRtYXAsIHVpbnQzMl90IGJpdG1hcFcsIHVpbnQzMl90IGJpdG1hcEgpOworfTsKKworY2xhc3MgRm9udFN0YXRlCit7CitwdWJsaWM6CisgICAgRm9udFN0YXRlKCk7CisgICAgfkZvbnRTdGF0ZSgpOworCisgICAgdm9pZCBpbml0KENvbnRleHQgKnJzYyk7CisgICAgdm9pZCBkZWluaXQoQ29udGV4dCAqcnNjKTsKKworICAgIE9iamVjdEJhc2VSZWY8Rm9udD4gbURlZmF1bHQ7CisgICAgT2JqZWN0QmFzZVJlZjxGb250PiBtTGFzdDsKKworICAgIHZvaWQgcmVuZGVyVGV4dChjb25zdCBjaGFyICp0ZXh0LCB1aW50MzJfdCBsZW4sIGludDMyX3QgeCwgaW50MzJfdCB5LAorICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzdGFydEluZGV4ID0gMCwgaW50IG51bUdseXBocyA9IC0xLAorICAgICAgICAgICAgICAgICAgICBGb250OjpSZW5kZXJNb2RlIG1vZGUgPSBGb250OjpGUkFNRUJVRkZFUiwKKyAgICAgICAgICAgICAgICAgICAgRm9udDo6UmVjdCAqYm91bmRzID0gTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgdWludDhfdCAqYml0bWFwID0gTlVMTCwgdWludDMyX3QgYml0bWFwVyA9IDAsIHVpbnQzMl90IGJpdG1hcEggPSAwKTsKKworICAgIHZvaWQgbWVhc3VyZVRleHQoY29uc3QgY2hhciAqdGV4dCwgdWludDMyX3QgbGVuLCBGb250OjpSZWN0ICpib3VuZHMpOworCisgICAgdm9pZCBzZXRGb250Q29sb3IoZmxvYXQgciwgZmxvYXQgZywgZmxvYXQgYiwgZmxvYXQgYSk7CisgICAgdm9pZCBnZXRGb250Q29sb3IoZmxvYXQgKnIsIGZsb2F0ICpnLCBmbG9hdCAqYiwgZmxvYXQgKmEpIGNvbnN0OworCitwcm90ZWN0ZWQ6CisKKyAgICBmcmllbmQgY2xhc3MgRm9udDsKKworICAgIHN0cnVjdCBDYWNoZVRleHR1cmVMaW5lCisgICAgeworICAgICAgICB1aW50MzJfdCBtTWF4SGVpZ2h0OworICAgICAgICB1aW50MzJfdCBtTWF4V2lkdGg7CisgICAgICAgIHVpbnQzMl90IG1DdXJyZW50Um93OworICAgICAgICB1aW50MzJfdCBtQ3VycmVudENvbDsKKyAgICAgICAgYm9vbCBtRGlydHk7CisKKyAgICAgICAgQ2FjaGVUZXh0dXJlTGluZSh1aW50MzJfdCBtYXhIZWlnaHQsIHVpbnQzMl90IG1heFdpZHRoLCB1aW50MzJfdCBjdXJyZW50Um93LCB1aW50MzJfdCBjdXJyZW50Q29sKSA6CisgICAgICAgICAgICBtTWF4SGVpZ2h0KG1heEhlaWdodCksIG1NYXhXaWR0aChtYXhXaWR0aCksIG1DdXJyZW50Um93KGN1cnJlbnRSb3cpLCBtQ3VycmVudENvbChjdXJyZW50Q29sKSwKKyAgICAgICAgICAgIG1EaXJ0eShmYWxzZSkgIHsKKyAgICAgICAgfQorCisgICAgICAgIGJvb2wgZml0Qml0bWFwKEZUX0JpdG1hcCAqYml0bWFwLCB1aW50MzJfdCAqcmV0T3JpZ2luWCwgdWludDMyX3QgKnJldE9yaWdpblkpIHsKKyAgICAgICAgICAgIGlmKCh1aW50MzJfdCliaXRtYXAtPnJvd3MgPiBtTWF4SGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZihtQ3VycmVudENvbCArICh1aW50MzJfdCliaXRtYXAtPndpZHRoIDwgbU1heFdpZHRoKSB7CisgICAgICAgICAgICAgICAqcmV0T3JpZ2luWCA9IG1DdXJyZW50Q29sOworICAgICAgICAgICAgICAgKnJldE9yaWdpblkgPSBtQ3VycmVudFJvdzsKKyAgICAgICAgICAgICAgIG1DdXJyZW50Q29sICs9IGJpdG1hcC0+d2lkdGg7CisgICAgICAgICAgICAgICBtRGlydHkgPSB0cnVlOworICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICBWZWN0b3I8Q2FjaGVUZXh0dXJlTGluZSo+IG1DYWNoZUxpbmVzOworICAgIHVpbnQzMl90IGdldFJlbWFpbmluZ0NhY2hlQ2FwYWNpdHkoKTsKKworICAgIHZvaWQgcHJlY2FjaGVMYXRpbihGb250ICpmb250KTsKKyAgICBTdHJpbmc4IG1MYXRpblByZWNhY2hlOworCisgICAgQ29udGV4dCAqbVJTQzsKKworICAgIHN0cnVjdCB7CisgICAgICAgIGZsb2F0IG1Gb250Q29sb3JbNF07CisgICAgICAgIGZsb2F0IG1HYW1tYTsKKyAgICB9IG1Db25zdGFudHM7CisgICAgYm9vbCBtQ29uc3RhbnRzRGlydHk7CisKKyAgICBmbG9hdCBtQmxhY2tHYW1tYTsKKyAgICBmbG9hdCBtV2hpdGVHYW1tYTsKKworICAgIGZsb2F0IG1CbGFja1RocmVzaG9sZDsKKyAgICBmbG9hdCBtV2hpdGVUaHJlc2hvbGQ7CisKKyAgICAvLyBGcmVlIHR5cGUgbGlicmFyeSwgd2Ugb25seSBuZWVkIG9uZSBjb3B5CisgICAgRlRfTGlicmFyeSBtTGlicmFyeTsKKyAgICBGVF9MaWJyYXJ5IGdldExpYigpOworICAgIFZlY3RvcjxGb250Kj4gbUFjdGl2ZUZvbnRzOworCisgICAgLy8gUmVuZGVyIHN0YXRlIGZvciB0aGUgZm9udAorICAgIE9iamVjdEJhc2VSZWY8QWxsb2NhdGlvbj4gbUZvbnRTaGFkZXJGQ29uc3RhbnQ7CisgICAgT2JqZWN0QmFzZVJlZjxQcm9ncmFtRnJhZ21lbnQ+I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sbG9jYXRpb24+IG1WZXJ0ZXhBcnJheTsKKworCisgICAgYm9vbCBtSW5pdGlhbGl6ZWQ7CisKKyAgICB2b2lkIGNoZWNrSW5pdCgpOworCisgICAgdm9pZCBpc3N1ZURyYXdDb21tYW5kKCk7CisKKyAgICB2b2lkIGFwcGVuZE1lc2hRdWFkKGZsb2F0IHgxLCBmbG9hdCB5MSwgZmxvYXQgejEsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUxLCBmbG9hdCB2MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDIsIGZsb2F0IHkyLCBmbG9hdCB6MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTIsIGZsb2F0IHYyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MywgZmxvYXQgeTMsIGZsb2F0IHozLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MywgZmxvYXQgdjMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHg0LCBmbG9hdCB5NCwgZmxvYXQgejQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHU0LCBmbG9hdCB2NCk7CisKK307CisKKworfQorfQorCisjZW5kaWYKZGlmZiAtLWdpdCBhL2xpYnMvcnMvcnNIYW5kY29kZS5oIGIvbGlicy9ycy9yc0hhbmRjb2RlLmgKaW5kZXggODAwZWRkZC4uYzAyZmQ0MiAxMDA2NDQKLS0tIGEvbGlicy9ycy9yc0hhbmRjb2RlLmgKKysrIGIvbGlicy9ycy9yc0hhbmRjb2RlLmgKQEAgLTEsNiArMSw1NyBAQAogCiAjZGVmaW5lIERBVEFfU1lOQ19TSVpFIDEwMjQKIAorc3RhdGljIGlubGluZSB2b2lkIHJzSENBUElfQ29udGV4dEZpbmlzaCAoUnNDb250ZXh0IHJzYykKK3sKKyAgICBUaHJlYWRJTyAqaW8gPSAmKChDb250ZXh0ICopcnNjKS0+bUlPOworICAg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worICAgICAgICBpby0+bVRvQ29yZS5jb21taXQoUlNfQ01EX0lEX1NjcmlwdEludm9rZVYsIHNpemUpOworICAgIH0gZWxzZSB7CisgICAgICAgIGlvLT5tVG9Db3JlLmNvbW1pdFN5bmMoUlNfQ01EX0lEX1NjcmlwdEludm9rZVYsIHNpemUpOworICAgIH0KK30KKworCitzdGF0aWMgaW5saW5lIHZvaWQgcnNIQ0FQSV9TY3JpcHRTZXRWYXJWIChSc0NvbnRleHQgcnNjLCBSc1NjcmlwdCB2YSwgdWludDMyX3Qgc2xvdCwgY29uc3Qgdm9pZCAqIGRhdGEsIHVpbnQzMl90IHNpemVCeXRlcykKK3sKKyAgICBUaHJlYWRJTyAqaW8gPSAmKChDb250ZXh0ICopcnNjKS0+bUlPOworICAgIHVpbnQzMl90IHNpemUgPSBzaXplb2YoUlNfQ01EX1NjcmlwdFNldFZhclYpOworICAgIGlmIChzaXplQnl0ZXMgPCBEQVRBX1NZTkNfU0laRSkgeworICAgICAgICBzaXplICs9IChzaXplQnl0ZXMgKyAzKSAmIH4zOworICAgIH0KKyAgICBSU19DTURfU2NyaXB0U2V0VmFyViAqY21kID0gc3RhdGljX2Nhc3Q8UlNfQ01EX1NjcmlwdFNldFZhclYgKj4oaW8tPm1Ub0NvcmUucmVzZXJ2ZShzaXplKSk7CisgICAgY21kLT5zID0gdmE7CisgICAgY21kLT5zbG90ID0gc2xvdDsKKyAgICBjbWQtPmRhdGFMZW4gPSBzaXplQnl0ZXM7CisgICAgY21kLT5kYXRhID0gZGF0YTsKKyAgICBpZiAoc2l6ZUJ5dGVzIDwgREFUQV9TWU5DX1NJWkUpIHsKKyAgICAgICAgY21kLT5kYXRhID0gKHZvaWQgKikoY21kKzEpOworICAgICAgICBtZW1jcHkoY21kKzEsIGRhdGEsIHNpemVCeXRlcyk7CisgICAgICAgIGlvLT5tVG9Db3JlLmNvbW1pdChSU19DTURfSURfU2NyaXB0U2V0VmFyViwgc2l6ZSk7CisgICAgfSBlbHNlIHsK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PEdMRVMvZ2wuaD4KLSNpbmNsdWRlIDxHTEVTL2dsZXh0Lmg+Ci0KIE1lc2g6Ok1lc2goQ29udGV4dCAqcnNjKSA6IE9iamVjdEJhc2UocnNjKQogewotICAgIG1BbGxvY0ZpbGUgPSBfX0ZJTEVfXzsKLSAgICBtQWxsb2NMaW5lID0gX19MSU5FX187Ci0gICAgbVZlcnRpY2llcyA9IE5VTEw7Ci0gICAgbVZlcnRpY2llc0NvdW50ID0gMDsKICAgICBtUHJpbWl0aXZlcyA9IE5VTEw7CiAgICAgbVByaW1pdGl2ZXNDb3VudCA9IDA7CisgICAgbVZlcnRleEJ1ZmZlcnMgPSBOVUxMOworICAgIG1WZXJ0ZXhCdWZmZXJDb3VudCA9IDA7CiB9CiAKIE1lc2g6On5NZXNoKCkKIHsKKyAgICBpZihtVmVydGV4QnVmZmVycykgeworICAgICAgICBkZWxldGVbXSBtVmVydGV4QnVmZmVyczsKKyAgICB9CisKKyAgICBpZihtUHJpbWl0aXZlcykgeworICAgICAgICBmb3IodWludDMyX3QgaSA9IDA7IGkgPCBtUHJpbWl0aXZlc0NvdW50OyBpICsrKSB7CisgICAgICAgICAgICBkZWxldGUgbVByaW1pdGl2ZXNbaV07CisgICAgICAgIH0KKyAgICAgICAgZGVsZXRlW10gbVByaW1pdGl2ZXM7CisgICAgfQogfQogCit2b2lkIE1lc2g6OnJlbmRlcihDb250ZXh0ICpyc2MpIGNvbnN0Cit7CisgICAgZm9yKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBtUHJpbWl0aXZlc0NvdW50OyBjdCArKykgeworICAgICAgICByZW5kZXJQcmltaXRpdmUocnNjLCBjdCk7CisgICAgfQorfQorCit2b2lkIE1lc2g6OnJlbmRlclByaW1pdGl2ZShDb250ZXh0ICpyc2MsIHVpbnQzMl90IHByaW1JbmRleCkgY29uc3QgeworICAgIGlmIChwcmltSW5kZXggPj0gbVByaW1pdGl2ZXNDb3VudCkgeworICAgICAgICBMT0dFKCJJbnZhbGlkIHByaW1pdGl2ZSBpbmRleCIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgUHJpbWl0aXZlX3QgKnByaW0gPSBtUHJpbWl0aXZlc1twcmltSW5kZXhdOworCisgICAgaWYgKHByaW0tPm1JbmRleEJ1ZmZlci5nZXQoKSkgeworICAgICAgICByZW5kZXJQcmltaXRpdmVSYW5nZShyc2MsIHByaW1JbmRleCwgMCwgcHJpbS0+bUluZGV4QnVmZmVyLT5nZXRUeXBlKCktPmdldERpbVgoKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICByZW5kZXJQcmltaXRpdmVSYW5nZShyc2MsIHByaW1JbmRleCwgMCwgbVZlcnRleEJ1ZmZlcnNbMF0tPmdldFR5cGUoKS0+Z2V0RGltWCgpKTsKK30KKwordm9pZCBNZXNoOjpyZW5kZXJQcmltaXRpdmVSYW5nZShDb250ZXh0ICpyc2MsIHVpbnQzMl90IHByaW1JbmRleCwgdWludDMyX3Qgc3RhcnQsIHVpbnQzMl90IGxlbikgY29uc3QKK3sKKyAgICBpZiAobGVuIDwgMSB8fCBwcmltSW5kZXggPj0gbVByaW1pdGl2ZXNDb3VudCkgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcnNjLT5jaGVja0Vycm9yKCJNZXNoOjpyZW5kZXJQcmltaXRpdmVSYW5nZSAxIik7CisgICAgVmVydGV4QXJyYXkgdmE7CisgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IG1WZXJ0ZXhCdWZmZXJDb3VudDsgY3QrKykgeworICAgICAgICBtVmVydGV4QnVmZmVyc1tjdF0tPnVwbG9hZENoZWNrKHJzYyk7CisgICAgICAgIGlmIChtVmVydGV4QnVmZmVyc1tjdF0tPmdldElzQnVmZmVyT2JqZWN0KCkpIHsKKyAgICAgICAgICAgIHZhLnNldEFjdGl2ZUJ1ZmZlcihtVmVydGV4QnVmZmVyc1tjdF0tPmdldEJ1ZmZlck9iamVjdElEKCkpOworICAgICAgICB9IGVs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wgInBvc2l0aW9uIikgPT0gMCkgeworICAgICAgICAgICAgICAgIHZlY3RvclNpemUgPSBidWZmZXJFbGVtLT5nZXRGaWVsZChjdCktPmdldENvbXBvbmVudCgpLmdldFZlY3RvclNpemUoKTsKKyAgICAgICAgICAgICAgICBzdHJpZGUgPSBidWZmZXJFbGVtLT5nZXRTaXplQnl0ZXMoKSAvIHNpemVvZihmbG9hdCk7CisgICAgICAgICAgICAgICAgdWludDMyX3Qgb2Zmc2V0ID0gYnVmZmVyRWxlbS0+Z2V0RmllbGRPZmZzZXRCeXRlcyhjdCk7CisgICAgICAgICAgICAgICAgcG9zUHRyID0gKGZsb2F0KikoKHVpbnQ4X3QqKW1WZXJ0ZXhCdWZmZXJzW2N0XS0+Z2V0UHRyKCkgKyBvZmZzZXQpOworICAgICAgICAgICAgICAgIG51bVZlcnRzID0gYnVmZmVyVHlwZS0+Z2V0RGltWCgpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmKHBvc1B0cikgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBtQkJveE1pblswXSA9IG1CQm94TWluWzFdID0gbUJCb3hNaW5bMl0gPSAxZTY7CisgICAgbUJCb3hNYXhbMF0gPSBtQkJveE1heFsxXSA9IG1CQm94TWF4WzJdID0gLTFlNjsKKyAgICBpZighcG9zUHRyKSB7CisgICAgICAgIExPR0UoIlVuYWJsZSB0byBjb21wdXRlIGJvdW5kaW5nIGJveCIpOworICAgICAgICBtQkJveE1pblswXSA9IG1CQm94TWluWzFdID0gbUJCb3hNaW5bMl0gPSAwLjBmOworICAgICAgICBtQkJveE1heFswXSA9IG1CQm94TWF4WzFdID0gbUJCb3hNYXhbMl0gPSAwLjBmOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgZm9yKHVpbnQzMl90IGkgPSAwOyBpIDwgbnVtVmVydHM7IGkgKyspIHsKKyAgICAgICAgZm9yKH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HZbMl0pOwotICAgIHZbMF0gPSB2WzBdIC8gczsKLSAgICB2WzFdID0gdlsxXSAvIHM7Ci0gICAgdlsyXSA9IHZbMl0gLyBzOwotfQotCi1zdGF0aWMgdm9pZCBub2lzZV9pbml0KCkKLXsKLSAgICBpbnQgaSwgaiwgazsKLSAgICAKLSAgICBmb3IgKGkgPSAwOyBpIDwgQjsgaSsrKSB7Ci0gICAgICAgIHBbaV0gPSBpOwotICAgICAgICAKLSAgICAgICAgZzFbaV0gPSAoZmxvYXQpKChyYW5kKCkgJSAoQiArIEIpKSAtIEIpIC8gQjsKLSAgICAgICAgCi0gICAgICAgIGZvciAoaiA9IDA7IGogPCAyOyBqKyspCi0gICAgICAgICAgICBnMltpXVtqXSA9IChmbG9hdCkoKHJhbmQoKSAlIChCICsgQikpIC0gQikgLyBCOwotICAgICAgICBTQ19ub3JtYWxpemVmMihnMltpXSk7Ci0gICAgICAgIAotICAgICAgICBmb3IgKGogPSAwOyBqIDwgMzsgaisrKQotICAgICAgICAgICAgZzNbaV1bal0gPSAoZmxvYXQpKChyYW5kKCkgJSAoQiArIEIpKSAtIEIpIC8gQjsKLSAgICAgICAgU0Nfbm9ybWFsaXplZjMoZzNbaV0pOwotICAgIH0KLSAgICAKLSAgICBmb3IgKGkgPSBCLTE7IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgIGsgPSBwW2ldOwotICAgICAgICBwW2ldID0gcFtqID0gcmFuZCgpICUgQl07Ci0gICAgICAgIHBbal0gPSBrOwotICAgIH0KLSAgICAKLSAgICBmb3IgKGkgPSAwOyBpIDwgQiArIDI7IGkrKykgewotICAgICAgICBwW0IgKyBpXSA9IHBbaV07Ci0gICAgICAgIGcxW0IgKyBpXSA9IGcxW2ldOwotICAgICAgICBmb3IgKGogPSAwOyBqIDwgMjsgaisrKQotICAgICAgICAgICAgZzJbQiArIGldW2pdID0gZzJbaV1bal07Ci0gICAgICAgIGZvciAoaiA9IDA7IGogPCAzOyBqKyspCi0gICAgICAgICA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gIHJzYyAlcCIsIG1SU0MpOwpAQCAtMTM3LDYgKzE4OSw4IEBACiAgICAgICAgIG1SU0MtPm1PYmpIZWFkLT5tUHJldiA9IHRoaXM7CiAgICAgfQogICAgIG1SU0MtPm1PYmpIZWFkID0gdGhpczsKKworICAgIGFzeW5jVW5sb2NrKCk7CiB9CiAKIHZvaWQgT2JqZWN0QmFzZTo6cmVtb3ZlKCkgY29uc3QKQEAgLTE0Nyw2ICsyMDEsNyBAQAogICAgICAgICByc0Fzc2VydCghbU5leHQpOwogICAgICAgICByZXR1cm47CiAgICAgfQorCiAgICAgaWYgKG1SU0MtPm1PYmpIZWFkID09IHRoaXMpIHsKICAgICAgICAgbVJTQy0+bU9iakhlYWQgPSBtTmV4dDsKICAgICB9CkBAIC0xODgsNiArMjQzLDggQEAKIAogdm9pZCBPYmplY3RCYXNlOjpkdW1wQWxsKENvbnRleHQgKnJzYykKIHsKKyAgICBhc3luY0xvY2soKTsKKwogICAgIExPR1YoIkR1bXBpbmcgYWxsIG9iamVjdHMiKTsKICAgICBjb25zdCBPYmplY3RCYXNlICogbyA9IHJzYy0+bU9iakhlYWQ7CiAgICAgd2hpbGUgKG8pIHsKQEAgLTE5NSw1ICsyNTIsMjMgQEAKICAgICAgICAgby0+ZHVtcExPR1YoIiAgIik7CiAgICAgICAgIG8gPSBvLT5tTmV4dDsKICAgICB9CisKKyAgICBhc3luY1VubG9jaygpOworfQorCitib29sIE9iamVjdEJhc2U6OmlzVmFsaWQoY29uc3QgQ29udGV4dCAqcnNjLCBjb25zdCBPYmplY3RCYXNlICpvYmopCit7CisgICAgYXN5bmNMb2NrKCk7CisKKyAgICBjb25zdCBPYmplY3RCYXNlICogbyA9IHJzYy0+bU9iakhlYWQ7CisgICAgd2hpbGUgKG8pIHsKKyAgICAgICAgaWYgKG8gPT0gb2JqKSB7CisgICAgICAgICAgICBhc3luY1VubG9jaygpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAg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W1lbnRzID0gTlVMTDsKICAgICBtQ29uc3RhbnRUeXBlcyA9IE5VTEw7CkBAIC00MCwxNCArNDYsMTMgQEAKICAgICBtT3V0cHV0Q291bnQgPSAwOwogICAgIG1Db25zdGFudENvdW50ID0gMDsKICAgICBtSXNWYWxpZCA9IGZhbHNlOworICAgIG1Jc0ludGVybmFsID0gZmFsc2U7CiB9CiAKIFByb2dyYW06OlByb2dyYW0oQ29udGV4dCAqcnNjLCBjb25zdCBjaGFyICogc2hhZGVyVGV4dCwgdWludDMyX3Qgc2hhZGVyTGVuZ3RoLAogICAgICAgICAgICAgICAgICBjb25zdCB1aW50MzJfdCAqIHBhcmFtcywgdWludDMyX3QgcGFyYW1MZW5ndGgpIDoKICAgICBPYmplY3RCYXNlKHJzYykKIHsKLSAgICBtQWxsb2NGaWxlID0gX19GSUxFX187Ci0gICAgbUFsbG9jTGluZSA9IF9fTElORV9fOwogICAgIG1EaXJ0eSA9IHRydWU7CiAgICAgbVNoYWRlcklEID0gMDsKICAgICBtQXR0cmliQ291bnQgPSAwOwpAQCAtNzMsNiArNzgsOCBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgbVRleHR1cmVzID0gbmV3IE9iamVjdEJhc2VSZWY8QWxsb2NhdGlvbj5bbVRleHR1cmVDb3VudF07CisgICAgbVNhbXBsZXJzID0gbmV3IE9iamVjdEJhc2VSZWY8U2FtcGxlcj5bbVRleHR1cmVDb3VudF07CiAgICAgbUlucHV0RWxlbWVudHMgPSBuZXcgT2JqZWN0QmFzZVJlZjxFbGVtZW50PlttSW5wdXRDb3VudF07CiAgICAgbU91dHB1dEVsZW1lbnRzID0gbmV3IE9iamVjdEJhc2VSZWY8RWxlbWVudD5bbU91dHB1dENvdW50XTsKICAgICBtQ29uc3RhbnRUeXBlcyA9IG5ldyBPYmplY3RCYXNlUmVmPFR5cGU+W21Db25zdGFudENvdW50XTsKQEAgLTkxLDE1ICs5OCwzNyBAQAogICAgICAgICAgICAgbUNvbnN0YW50VHlwZXNbY29uc3RhbnQrK10uc2V0KHJlaW50ZXJwcmV0X2Nhc3Q8VHlwZSAqPihwYXJhbXNbY3QrMV0pKTsKICAgICAgICAgfQogICAgIH0KKyAgICBtSXNJbnRlcm5hbCA9IGZhbHNlOworICAgIHVpbnQzMl90IGludGVybmFsVG9rZW5MZW4gPSBzdHJsZW4oUlNfU0hBREVSX0lOVEVSTkFMKTsKKyAgICBpZihzaGFkZXJMZW5ndGggPiBpbnRlcm5hbFRva2VuTGVuICYmCisgICAgICAgc3RybmNtcChSU19TSEFERVJfSU5URVJOQUwsIHNoYWRlclRleHQsIGludGVybmFsVG9rZW5MZW4pID09IDApIHsKKyAgICAgICAgbUlzSW50ZXJuYWwgPSB0cnVlOworICAgICAgICBzaGFkZXJUZXh0ICs9IGludGVybmFsVG9rZW5MZW47CisgICAgICAgIHNoYWRlckxlbmd0aCAtPSBpbnRlcm5hbFRva2VuTGVuOworICAgIH0KICAgICBtVXNlclNoYWRlci5zZXRUbyhzaGFkZXJUZXh0LCBzaGFkZXJMZW5ndGgpOwogfQogCiBQcm9ncmFtOjp+UHJvZ3JhbSgpCiB7Ci0gICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IE1BWF9VTklGT1JNUzsgY3QrKykgewotICAgICAgICBiaW5kQWxsb2NhdGlvbihOVUxMLCBjdCk7CisgICAgaWYobVJTQy0+cHJvcHMubUxvZ1NoYWRlcnMpIHsKKyAgICAgICAgTE9HVigiUHJvZ3JhbTo6flByb2dyYW0gd2l0aCBzaGFkZXIgaWQgJXUiLCBtU2hhZGVySUQpOwogICAgIH0KIAorICAgIGlmKG1TaGFkZXJJRCkgeworICAgICAgICBnbERlbGV0ZVNoYWRlcihtU2hhZGVySUQpOworICAgIH0KKworICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBNQVhfVU5JRk9STVM7IGN0KyspIHsKKyAgICAgICAgYmluZEFsbG9jYXRpb24oTlVMTCwgTlVMTCwgY3QpOworICAgIH0KKworICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBtVGV4dHVyZUNvdW50OyBjdCsrKSB7CisgICAgICAgIGJpbmRUZXh0dXJlKE5VTEwsIGN0LCBOVUxMKTsKKyAgICAgICAgYmluZFNhbXBsZXIoTlVMTCwgY3QsIE5VTEwpOworICAgIH0KKyAgICBkZWxldGVbXSBtVGV4dHVyZXM7CisgICAgZGVsZXRlW10gbVNhbXBsZXJzOwogICAgIGRlbGV0ZVtdIG1JbnB1dEVsZW1lbnRzOwogICAgIGRlbGV0ZVtdIG1PdXRwdXRFbGVtZW50czsKICAgICBkZWxldGVbXSBtQ29uc3RhbnRUeXBlczsKQEAgLTEwOSw4ICsxMzgsMjIgQEAKIH0KIAogCi12b2lkIFByb2dyYW06OmJpbmRBbGxvY2F0aW9uKEFsbG9jYXRpb24gKmFsbG9jLCB1aW50MzJfdCBzbG90KQordm9pZCBQcm9ncmFtOjpiaW5kQWxsb2NhdGlvbihDb250ZXh0ICpyc2MsIEFsbG9jYXRpb24gKmFsbG9jLCB1aW50MzJfdCBzbG90KQogeworICAgIGlmIChhbGxvYyAhPSBOVUxMKSB7CisgICAgICAgIGlmIChzbG90ID49IG1Db25zdGFudENvdW50KSB7CisgICAgICAgICAgICBMT0dFKCJBdHRlbXB0IHRvIGJpbmQgYWxsb2MgYXQgc2xvdCAldSwgb24gc2hhZGVyIGlkICV1LCBidXQgY29uc3QgY291bnQgaXMgJXUiLAorICAgICAgICAgICAgICAgICBzbG90LCAodWludDMyX3QpdGhpcywgbUNvbnN0YW50Q291bnQpOworICAgICAgICAgICAgcnNjLT5zZXRFcnJvcihSU19FUlJPUl9CQURfU0hBREVSLCAiQ2Fubm90IGJpbmQgYWxsb2NhdGlvbiIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmICghYWxsb2MtPmdldFR5cGUoKS0+aXNFcXVhbChtQ29uc3RhbnRUeXBlc1tzbG90XS5nZXQoKSkpIHsKKyAgICAgICAgICAgIExPR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lKGZpZWxkKTsKIAorICAgICAgICAgICAgaWYgKGZuWzBdID09ICcjJykgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBDYW5ub3QgYmUgY29tcGxleAorICAgICAgICAgICAgcnNBc3NlcnQoIWYtPmdldEZpZWxkQ291bnQoKSk7CisgICAgICAgICAgICBpZihmLT5nZXRUeXBlKCkgPT0gUlNfVFlQRV9NQVRSSVhfNFg0KSB7CisgICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoInVuaWZvcm0gbWF0NCBVTklfIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKGYtPmdldFR5cGUoKSA9PSBSU19UWVBFX01BVFJJWF8zWDMpIHsKKyAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZCgidW5pZm9ybSBtYXQzIFVOSV8iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoZi0+Z2V0VHlwZSgpID09IFJTX1RZUEVfTUFUUklYXzJYMikgeworICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKCJ1bmlmb3JtIG1hdDIgVU5JXyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgc3dpdGNoKGYtPmdldENvbXBvbmVudCgpLmdldFZlY3RvclNpemUoKSkgeworICAgICAgICAgICAgICAgIGNhc2UgMTogbVNoYWRlci5hcHBlbmQoInVuaWZvcm0gZmxvYXQgVU5JXyIpOyBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDI6IG1TaGFkZXIuYXBwZW5kKCJ1bmlmb3JtIHZlYzIgVU5JXyIpOyBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDM6IG1TaGFkZXIuYXBwZW5kKCJ1bmlmb3JtIHZlYzMgVU5JXyIpOyBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDQ6IG1TaGFkZXIuYXBwZW5kKCJ1bmlmb3JtIHZlYzQgVU5JXyIpOyBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByc0Fzc2VydCgwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKGZuKTsKKyAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKCI7XG4iKTsKKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZCBQcm9ncmFtOjpzZXR1cFVzZXJDb25zdGFudHMoQ29udGV4dCAqcnNjLCBTaGFkZXJDYWNoZSAqc2MsIGJvb2wgaXNGcmFnbWVudCkgeworICAgIHVpbnQzMl90IHVpZHggPSAwOworICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBtQ29uc3RhbnRDb3VudDsgY3QrKykgeworICAgICAgICBBbGxvY2F0aW9uICphbGxvYyA9IG1Db25zdGFudHNbY3RdLmdldCgpOworICAgICAgICBpZiAoIWFsbG9jKSB7CisgICAgICAgICAgICBMT0dFKCJBdHRlbXB0aW5nIHRvIHNldCBjb25zdGFudHMgb24gc2hhZGVyIGlkICV1LCBidXQgYWxsb2MgYXQgc2xvdCAldSBpcyBub3Qgc2V0IiwgKHVpbnQzMl90KXRoaXMsIGN0KTsKKyAgICAgICAgICAgIHJzYy0+c2V0RXJyb3IoUlNfRVJST1JfQkFEX1NIQURFUiwgIk5vIGNvbnN0YW50IGFsbG9jYXRpb24gYm91bmQiKTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisKKyAgICAgICAgY29uc3QgdWludDhfdCAqZGF0YSA9IHN0YXRpY19jYXN0PGNvbnN0IHVpbnQ4X3QgKj4oYWxsb2MtPmdldFB0cigpKTsKKyAgICAgICAgY29uc3QgRWxlbWVudCAqZSA9IG1Db25zdGFudFR5cGVzW2N0XS0+Z2V0RWxlbWVudCgpOworICAgICAgICBmb3IgKHVpbnQzMl90IGZpZWxkPTA7IGZpZWxkIDwgZS0+Z2V0RmllbGRDb3VudCgpOyBmaWVsZCsrKSB7CisgICAgICAgICAgICBjb25zdCBFbGVtZW50ICpmID0gZS0+Z2V0RmllbGQoZmllbGQpOworICAgICAgICAgICAgY29uc3QgY2hhciAqZmllbGROYW1lID0gZS0+Z2V0RmllbGROYW1lKGZpZWxkKTsKKyAgICAgICAgICAgIC8vIElmIHRoaXMgZmllbGQgaXMgcGFkZGluZywgc2tpcCBpdAorICAgICAgICAgICAgaWYoZmllbGROYW1lWzBdID09ICcjJykgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB1aW50MzJfdCBvZmZzZXQgPSBlLT5nZXRGaWVsZE9mZnNldEJ5dGVzKGZpZWxkKTsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0ICpmZCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgZmxvYXQgKj4oJmRhdGFbb2Zmc2V0XSk7CisKKyAgICAgICAgICAgIGludDMyX3Qgc2xvdCA9IC0xOworICAgICAgICAgICAgaWYoIWlzRnJhZ21lbnQpIHsKKyAgICAgICAgICAgICAgICBzbG90ID0gc2MtPnZ0eFVuaWZvcm1TbG90KHVpZHgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgc2xvdCA9IHNjLT5mcmFnVW5pZm9ybVNsb3QodWlkeCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmKHJzYy0+cHJvcHMubUxvZ1NoYWRlcnNVbmlmb3JtcykgeworICAgICAgICAgICAgICAgIExPR1YoIlVuaWZvcm0gIHNsb3Q9JWksIG9mZnNldD0laSwgY29uc3RhbnQ9JWksIGZpZWxkPSVpLCB1aWR4PSVpLCBuYW1lPSVzIiwgc2xvdCwgb2Zmc2V0LCBjdCwgZmllbGQsIHVpZHgsIGZpZWxkTmFtZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoc2xvdCA+PSAwKSB7CisgICAgICAgICAgICAgICAgaWYoZi0+Z2V0VHlwZSgpID09IFJTX1RZUEVfTUFUUklYXzRYNCkgeworICAgICAgICAgICAgICAgICAgICBpZihyc2MtPnByb3BzLm1Mb2dTaGFkZXJzVW5pZm9ybXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExPR1YoIk1hdHJpeDR4NCIpOworICAgICAgICAgICAgICAgICAgICAgICAgTE9HVigieyVmLCAlZiwgJWYsICVmIiwgIGZkWzBdLCBmZFs0XSwgZmRbOF0sIGZkWzEyXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBMT0dWKCIgJWYsICVmLCAlZiwgJWYiLCAgZmRbMV0sIGZkWzVdLCBmZFs5XSwgZmRbMTNdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIExPR1YoIiAlZiwgJWYsICVmLCAlZiIsICBmZFsyXSwgZmRbNl0sIGZkWzEwXSwgZmRbMTRdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIExPR1YoIiAlZiwgJWYsICVmLCAlZn0iLCBmZFszXSwgZmRbN10sIGZkWzExXSwgZmRbMTVdKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBnbFVuaWZvcm1NYXRyaXg0ZnYoc2xvdCwgMSwgR0xfRkFMU0UsIGZkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZihmLT5nZXRUeXBlKCkgPT0gUlNfVFlQRV9NQVRSSVhfM1gzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmKHJzYy0+cHJvcHMubUxvZ1NoYWRlcnNVbmlmb3JtcykgeworICAgICAgICAgICAgICAgICAgICAgICAgTE9HVigiTWF0cml4M3gzIik7CisgICAgICAgICAgICAgICAgICAgICAgICBMT0dWKCJ7JWYsICVmLCAlZiIsICBmZFswXSwgZmRbM10sIGZkWzZdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIExPR1YoIiAlZiwgJWYsICVmIiwgIGZkWzFdLCBmZFs0XSwgZmRbN10pOworICAgICAgICAgICAgICAgICAgICAgICAgTE9HVigiICVmLCAlZiwgJWZ9IiwgZmRbMl0sIGZkWzVdLCBmZFs4XSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZ2xVbmlmb3JtTWF0cml4M2Z2KHNsb3QsIDEsIEdMX0ZBTFNFLCBmZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYoZi0+Z2V0VHlwZSgpID09IFJTX1RZUEVfTUFUUklYXzJYMikgeworICAgICAgICAgICAgICAgICAgICBpZihyc2MtPnByb3BzLm1Mb2dTaGFkZXJzVW5pZm9ybXMpeworICAgICAgICAgICAgICAgICAgICAgICAgTE9HVigiTWF0cml4MngyIik7CisgICAgICAgICAgICAgICAgICAgICAgICBMT0dWKCJ7JWYsICVmIiwgIGZkWzBdLCBmZFsyXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBMT0dWKCIgJWYsICVmfSIsIGZkWzFdLCBmZFszXSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZ2xVbmlmb3JtTWF0cml4MmZ2KHNsb3QsIDEsIEdMX0ZBTFNFLCBmZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzd2l0Y2goZi0+Z2V0Q29tcG9uZW50KCkuZ2V0VmVjdG9yU2l6ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHJzYy0+cHJvcHMubUxvZ1NoYWRlcnNVbmlmb3JtcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExPR1YoIlVuaWZvcm0gMSA9ICVmIiwgZmRbMF0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZ2xVbmlmb3JtMWZ2KHNsb3QsIDEsIGZkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICBpZihyc2MtPnByb3BzLm1Mb2dTaGFkZXJzVW5pZm9ybXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMT0dWKCJVbmlmb3JtIDIgPSAlZiAlZiIsIGZkWzBdLCBmZFsxXSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBnbFVuaWZvcm0yZnYoc2xvdCwgMSwgZmQpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgMzoKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHJzYy0+cHJvcHMubUxvZ1NoYWRlcnNVbmlmb3JtcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExPR1YoIlVuaWZvcm0gMyA9ICVmICVmICVmIiwgZmRbMF0sIGZkWzFdLCBmZFsyXSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBnbFVuaWZvcm0zZnYoc2xvdCwgMSwgZmQpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHJzYy0+cHJvcHMubUxvZ1NoYWRlcnNVbmlmb3JtcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExPR1YoIlVuaWZvcm0gNCA9ICVmICVmICVmICVmIiwgZmRbMF0sIGZkWzFdLCBmZFsyXSwgZmRbM10pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZ2xVbmlmb3JtNGZ2KHNsb3QsIDEsIGZkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgcnNBc3NlcnQoMCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICB1aWR4ICsrOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkIFByb2dyYW06OmluaXRBZGRVc2VyRWxlbWVudChjb25zdCBFbGVtZW50ICplLCBTdHJpbmc4ICpuYW1lcywgdWludDMyX3QgKmNvdW50LCBjb25zdCBjaGFyICpwcmVmaXgpCit7CisgICAgcnNBc3NlcnQoZS0+Z2V0RmllbGRDb3VudCgpKTsKKyAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgZS0+Z2V0RmllbGRDb3VudCgpOyBjdCsrKSB7CisgICAgICAgIGNvbnN0IEVsZW1lbnQgKmNlID0gZS0+Z2V0RmllbGQoY3QpOworICAgICAgICBpZiAoY2UtPmdldEZpZWxkQ291bnQoKSkgeworICAgICAgICAgICAgaW5pdEFkZFVzZXJFbGVtZW50KGNlLCBuYW1lcywgY291bnQsIHByZWZpeCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZihlLT5nZXRGaWVsZE5hbWUoY3QpWzBdICE9ICcjJykgeworICAgICAgICAgICAgU3RyaW5nOCB0bXAocHJlZml4KTsKKyAgICAgICAgICAgIHRtcC5hcHBlbmQoZS0+Z2V0RmllbGROYW1lKGN0KSk7CisgICAgICAgICAgICBuYW1lc1sqY291bnRdLnNldFRvKHRtcC5zdHJpbmcoKSk7CisgICAgICAgICAgICAoKmNvdW50KSsrOworICAgICAgICB9CisgICAgfQorfQogCiBuYW1lc3BhY2UgYW5kcm9pZCB7CiBuYW1lc3BhY2UgcmVuZGVyc2NyaXB0IHsKQEAgLTI0NCwxOSArNDQxLDE5IEBACiB2b2lkIHJzaV9Qcm9ncmFtQmluZENvbnN0YW50cyhDb250ZXh0ICpyc2MsIFJz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XJhbXNbNF0gIT0gMDsKLQotICAgIG1UZXh0dXJlRW5hYmxlTWFzayA9IDA7Ci0gICAgaWYgKG1FbnZNb2Rlc1swXSkgewotICAgICAgICBtVGV4dHVyZUVuYWJsZU1hc2sgfD0gMTsKLSAgICB9Ci0gICAgaWYgKG1FbnZNb2Rlc1sxXSkgewotICAgICAgICBtVGV4dHVyZUVuYWJsZU1hc2sgfD0gMjsKLSAgICB9Ci0gICAgaW5pdChyc2MpOwotfQotCiBQcm9ncmFtRnJhZ21lbnQ6OlByb2dyYW1GcmFnbWVudChDb250ZXh0ICpyc2MsIGNvbnN0IGNoYXIgKiBzaGFkZXJUZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2hhZGVyTGVuZ3RoLCBjb25zdCB1aW50MzJfdCAqIHBhcmFtcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHBhcmFtTGVuZ3RoKSA6CiAgICAgUHJvZ3JhbShyc2MsIHNoYWRlclRleHQsIHNoYWRlckxlbmd0aCwgcGFyYW1zLCBwYXJhbUxlbmd0aCkKIHsKLSAgICBtQWxsb2NGaWxlID0gX19GSUxFX187Ci0gICAgbUFsbG9jTGluZSA9IF9fTElORV9fOworICAgIG1Db25zdGFudENvbG9yWzBdID0gMS5mOworICAgIG1Db25zdGFudENvbG9yWzFdID0gMS5mOworICAgIG1Db25zdGFudENvbG9yWzJdID0gMS5mOworICAgIG1Db25zdGFudENvbG9yWzNdID0gMS5mOwogCiAgICAgaW5pdChyc2MpOwotICAgIG1UZXh0dXJlRW5hYmxlTWFzayA9ICgxIDw8IG1UZXh0dXJlQ291bnQpIC0xOwogfQogCi0KIFByb2dyYW1GcmFnbWVudDo6flByb2dyYW1GcmFnbWVudCgpCiB7CisgICAgaWYobVNoYWRlcklEKSB7CisgICAgICAgIG1SU0MtPm1TaGFkZXJDYWNoZS5jbGVhbnVwRnJhZ21lbnQobVNoYWRlcklEKTsKKy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db25zdGFudHNbMF0tPmdldFB0cigpLCBtQ29uc3RhbnRDb2xvciwgNCpzaXplb2YoZmxvYXQpKTsKKyAgICBtRGlydHkgPSB0cnVlOworfQorCit2b2lkIFByb2dyYW1GcmFnbWVudDo6c2V0dXBHTDIoQ29udGV4dCAqcnNjLCBQcm9ncmFtRnJhZ21lbnRTdGF0ZSAqc3RhdGUsIFNoYWRlckNhY2hlICpzYykKK3sKKyAgICAvL0xPR0UoInNnbDIgZnJhZzEgJXgiLCBnbEdldEVycm9yKCkpOwogICAgIGlmICgoc3RhdGUtPm1MYXN0LmdldCgpID09IHRoaXMpICYmICFtRGlydHkpIHsKICAgICAgICAgcmV0dXJuOwogICAgIH0KICAgICBzdGF0ZS0+bUxhc3Quc2V0KHRoaXMpOwogCi0gICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IE1BWF9URVhUVVJFOyBjdCsrKSB7Ci0gICAgICAgIGdsQWN0aXZlVGV4dHVyZShHTF9URVhUVVJFMCArIGN0KTsKLSAgICAgICAgaWYgKCEobVRleHR1cmVFbmFibGVNYXNrICYgKDEgPDwgY3QpKSB8fCAhbVRleHR1cmVzW2N0XS5nZXQoKSkgewotICAgICAgICAgICAgZ2xEaXNhYmxlKEdMX1RFWFRVUkVfMkQpOwotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBnbEVuYWJsZShHTF9URVhUVVJFXzJEKTsKLSAgICAgICAgaWYgKHJzYy0+Y2hlY2tWZXJzaW9uMV8xKCkpIHsKLSAgICAgICAgICAgIGlmIChtUG9pbnRTcHJpdGVFbmFibGUpIHsKLSAgICAgICAgICAgICAgICBnbEVuYWJsZShHTF9QT0lOVF9TUFJJVEVfT0VTKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZ2xEaXNhYmxlKEdMX1BPSU5UX1NQUklURV9PRVMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZ2xUZXhFbnZpKEdMX1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zJfdCBjdD0wOyBjdCA8IG1UZXh0dXJlQ291bnQ7IGN0KyspIHsKLSAgICAgICAgICAgIGNoYXIgYnVmWzI1Nl07Ci0gICAgICAgICAgICBzcHJpbnRmKGJ1ZiwgInVuaWZvcm0gc2FtcGxlcjJEIHVuaV9UZXglaTtcbiIsIGN0KTsKKyAgICAgICAgICAgIHNwcmludGYoYnVmLCAidW5pZm9ybSBzYW1wbGVyMkQgVU5JX1RleCVpO1xuIiwgY3QpOwogICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoYnVmKTsKICAgICAgICAgfQotCiAgICAgICAgIG1TaGFkZXIuYXBwZW5kKG1Vc2VyU2hhZGVyKTsKICAgICB9IGVsc2UgewotICAgICAgICB1aW50MzJfdCBtYXNrID0gbVRleHR1cmVFbmFibGVNYXNrOwotICAgICAgICB1aW50MzJfdCB0ZXhOdW0gPSAwOwotICAgICAgICB3aGlsZSAobWFzaykgewotICAgICAgICAgICAgaWYgKG1hc2sgJiAxKSB7Ci0gICAgICAgICAgICAgICAgY2hhciBidWZbNjRdOwotICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKCJ1bmlmb3JtIHNhbXBsZXIyRCB1bmlfVGV4Iik7Ci0gICAgICAgICAgICAgICAgc3ByaW50ZihidWYsICIlaSIsIHRleE51bSk7Ci0gICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoYnVmKTsKLSAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZCgiO1xuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtYXNrID4+PSAxOwotICAgICAgICAgICAgdGV4TnVtKys7Ci0gICAgICAgIH0KLQotCi0gICAgICAgIG1TaGFkZXIuYXBwZW5kKCJ2b2lkIG1haW4oKSB7XG4iKTsKLSAgICAgICAgbVNoYWRlci5hcHBlbmQoIiAgdmVjNCBjb2wgPSB2YXJDb2xvcjtcbiIpOwotCi0gICAgICAgIGlmIChtVGV4dHVyZUVuYWJsZU1hc2spIHsKLSAgICAgICAgICAgIGlmIChtUG9pbnRTcHJpdGVFbmFibGUpIHsKLSAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZCgiICB2ZWMyIHQwID0gZ2xfUG9pbnRDb29yZDtcbiIpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZCgiICB2ZWMyIHQwID0gdmFyVGV4MC54eTtcbiIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgbWFzayA9IG1UZXh0dXJlRW5hYmxlTWFzazsKLSAgICAgICAgdGV4TnVtID0gMDsKLSAgICAgICAgd2hpbGUgKG1hc2spIHsKLSAgICAgICAgICAgIGlmIChtYXNrICYgMSkgewotICAgICAgICAgICAgICAgIHN3aXRjaChtRW52TW9kZXNbdGV4TnVtXSkgewotICAgICAgICAgICAgICAgIGNhc2UgUlNfVEVYX0VOVl9NT0RFX05PTkU6Ci0gICAgICAgICAgICAgICAgICAgIHJzQXNzZXJ0KDApOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIFJTX1RFWF9FTlZfTU9ERV9SRVBMQUNFOgotICAgICAgICAgICAgICAgICAgICBzd2l0Y2gobVRleHR1cmVGb3JtYXRzW3RleE51bV0pIHsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgotICAgICAgICAgICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoIiAgY29sLmEgPSB0ZXh0dXJlMkQodW5pX1RleDAsIHQwKS5hO1xuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoIiAgY29sLnJnYmEgPSB0ZXh0dXJlMkQodW5pX1RleDAsIHQwKS5yZ2JhO1xuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAzOgotICAgICAgICAgICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoIiAgY29sLnJnYiA9IHRleHR1cmUyRCh1bmlfVGV4MCwgdDApLnJnYjtcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKCIgIGNvbC5yZ2JhID0gdGV4dHVyZTJEKHVuaV9UZXgwLCB0MCkucmdiYTtcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBSU19URVhfRU5WX01PREVfTU9EVUxBVEU6Ci0gICAgICAgICAgICAgICAgICAgIHN3aXRjaChtVGV4dHVyZUZvcm1hdHNbdGV4TnVtXSkgewotICAgICAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZCgiICBjb2wuYSAqPSB0ZXh0dXJlMkQodW5pX1RleDAsIHQwKS5hO1xuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoIiAgY29sLnJnYmEgKj0gdGV4dHVyZTJEKHVuaV9UZXgwLCB0MCkucmdiYTtcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKCIgIGNvbC5yZ2IgKj0gdGV4dHVyZTJEKHVuaV9UZXgwLCB0MCkucmdiO1xuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSA0OgotICAgICAgICAgICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoIiAgY29sLnJnYmEgKj0gdGV4dHVyZTJEKHVuaV9UZXgwLCB0MCkucmdiYTtcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBSU19URVhfRU5WX01PREVfREVDQUw6Ci0gICAgICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKCIgIGNvbCA9IHRleHR1cmUyRCh1bmlfVGV4MCwgdDApO1xuIik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQotICAgICAgICAgICAgbWFzayA+Pj0gMTsKLSAgICAgICAgICAgIHRleE51bSsrOwotICAgICAgICB9Ci0KLSAgICAgICAgLy9tU2hhZGVyLmFwcGVuZCgiICBjb2wuYSA9IDEuMDtcbiIpOwotICAgICAgICAvL21TaGFkZXIuYXBwZW5kKCIgIGNvbC5yID0gMC41O1xuIik7Ci0KLSAgICAgICAgbVNoYWRlci5hcHBlbmQoIiAgZ2xfRnJhZ0NvbG9yID0gY29sO1xuIik7Ci0gICAgICAgIG1TaGFkZXIuYXBwZW5kKCJ9XG4iKTsKKyAgICAgICAgTE9HRSgiUHJvZ3JhbUZyYWdtZW50OjpjcmVhdGVTaGFkZXIgY2Fubm90IGNyZWF0ZSBwcm9ncmFtLCBzaGFkZXIgY29kZSBub3QgZGVmaW5lZCIpOworICAgICAgICByc0Fzc2VydCgwKTsKICAgICB9CiB9CiAKIHZvaWQgUHJvZ3JhbUZyYWdtZW50Ojppbml0KENvbnRleHQgKnJzYykKIHsKLSAgICBtVW5pZm9ybUNvdW50ID0gMjsKLSAgICBtVW5pZm9ybU5hbWVzWzB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AgICB9IGVsc2UgewotICAgICAgICBnbERpc2FibGUoR0xfTElORV9TTU9PVEgpOwotICAgIH0KLQotICAgIGlmIChyc2MtPmNoZWNrVmVyc2lvbjFfMSgpKSB7Ci0gICAgICAgIGlmIChtUG9pbnRTcHJpdGUpIHsKLSAgICAgICAgICAgIGdsRW5hYmxlKEdMX1BPSU5UX1NQUklURV9PRVMpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZ2xEaXNhYmxlKEdMX1BPSU5UX1NQUklURV9PRVMpOwotICAgICAgICB9Ci0gICAgfQorICAgIG1DdWxsID0gbW9kZTsKKyAgICBtRGlydHkgPSB0cnVlOwogfQogCiB2b2lkIFByb2dyYW1SYXN0ZXI6OnNldHVwR0wyKGNvbnN0IENvbnRleHQgKnJzYywgUHJvZ3JhbVJhc3RlclN0YXRlICpzdGF0ZSkKIHsKLSAgICBpZiAoc3RhdGUtPm1MYXN0LmdldCgpID09IHRoaXMpIHsKKyAgICBpZiAoc3RhdGUtPm1MYXN0LmdldCgpID09IHRoaXMgJiYgIW1EaXJ0eSkgewogICAgICAgICByZXR1cm47CiAgICAgfQogICAgIHN0YXRlLT5tTGFzdC5zZXQodGhpcyk7CisgICAgbURpcnR5ID0gZmFsc2U7CisKKyAgICBzd2l0Y2gobUN1bGwpIHsKKyAgICAgICAgY2FzZSBSU19DVUxMX0JBQ0s6CisgICAgICAgICAgICBnbEVuYWJsZShHTF9DVUxMX0ZBQ0UpOworICAgICAgICAgICAgZ2xDdWxsRmFjZShHTF9CQUNLKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFJTX0NVTExfRlJPTlQ6CisgICAgICAgICAgICBnbEVuYWJsZShHTF9DVUxMX0ZBQ0UpOworICAgICAgICAgICAgZ2xDdWxsRmFjZShHTF9GUk9OVCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBSU19DVUxMX05PTkU6CisgICAgICAgICAgICBnbERpc2FibGUoR0xfQ1VMTF9G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gorICAgICAgICBtRGVwdGhUZXN0RW5hYmxlID0gZmFsc2U7CisgICAgICAgIG1EZXB0aEZ1bmMgPSBHTF9BTFdBWVM7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfREVQVEhfRlVOQ19MRVNTOgorICAgICAgICBtRGVwdGhGdW5jID0gR0xfTEVTUzsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19ERVBUSF9GVU5DX0xFUVVBTDoKKyAgICAgICAgbURlcHRoRnVuYyA9IEdMX0xFUVVBTDsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19ERVBUSF9GVU5DX0dSRUFURVI6CisgICAgICAgIG1EZXB0aEZ1bmMgPSBHTF9HUkVBVEVSOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0RFUFRIX0ZVTkNfR0VRVUFMOgorICAgICAgICBtRGVwdGhGdW5jID0gR0xfR0VRVUFMOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0RFUFRIX0ZVTkNfRVFVQUw6CisgICAgICAgIG1EZXB0aEZ1bmMgPSBHTF9FUVVBTDsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19ERVBUSF9GVU5DX05PVEVRVUFMOgorICAgICAgICBtRGVwdGhGdW5jID0gR0xfTk9URVFVQUw7CisgICAgICAgIGJyZWFrOworICAgIH0KK30KKwordm9pZCBQcm9ncmFtU3RvcmU6OnNldERlcHRoTWFzayhib29sIG1hc2spCit7CisgICAgbURlcHRoV3JpdGVFbmFibGUgPSBtYXNrOworfQorCit2b2lkIFByb2dyYW1TdG9yZTo6c2V0QmxlbmRGdW5jKFJzQmxlbmRTcmNGdW5jIHNyYywgUnNCbGVuZERzdEZ1bmMgZHN0KQoreworICAgIG1CbGVuZEVuYWJsZSA9IHRydWU7CisgICAgaWYgKChzcmMgPT0gUlNfQkxFTkRfU1JDX09ORSkgJiYKKyAgICAgICAgKGRzdCA9PSBSU19CTEVORF9EU1RfWkVSTykpIHsKKyAgICAgICAgbUJsZW5kRW5hYmxlID0gZmFsc2U7CisgICAgfQorCisgICAgc3dpdGNoKHNyYykgeworICAgIGNhc2UgUlNfQkxFTkRfU1JDX1pFUk86CisgICAgICAgIG1CbGVuZFNyYyA9IEdMX1pFUk87CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfU1JDX09ORToKKyAgICAgICAgbUJsZW5kU3JjID0gR0xfT05FOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0JMRU5EX1NSQ19EU1RfQ09MT1I6CisgICAgICAgIG1CbGVuZFNyYyA9IEdMX0RTVF9DT0xPUjsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9TUkNfT05FX01JTlVTX0RTVF9DT0xPUjoKKyAgICAgICAgbUJsZW5kU3JjID0gR0xfT05FX01JTlVTX0RTVF9DT0xPUjsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9TUkNfU1JDX0FMUEhBOgorICAgICAgICBtQmxlbmRTcmMgPSBHTF9TUkNfQUxQSEE7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfU1JDX09ORV9NSU5VU19TUkNfQUxQSEE6CisgICAgICAgIG1CbGVuZFNyYyA9IEdMX09ORV9NSU5VU19TUkNfQUxQSEE7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfU1JDX0RTVF9BTFBIQToKKyAgICAgICAgbUJsZW5kU3JjID0gR0xfRFNUX0FMUEhBOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0JMRU5EX1NSQ19PTkVfTUlOVVNfRFNUX0FMUEhBOgorICAgICAgICBtQmxlbmRTcmMgPSBHTF9PTkVfTUlOVVNfRFNUX0FMUEhBOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0JMRU5EX1NSQ19TUkNfQUxQSEFfU0FUVVJBVEU6CisgICAgICAgIG1CbGVuZFNyYyA9IEdMX1NSQ19BTFBIQV9TQVRVUkFURTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgc3dpdGNoKGRzdCkgeworICAgIGNhc2UgUlNfQkxFTkRfRFNUX1pFUk86CisgICAgICAgIG1CbGVuZERzdCA9IEdMX1pFUk87CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfRFNUX09ORToKKyAgICAgICAgbUJsZW5kRHN0ID0gR0xfT05FOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0JMRU5EX0RTVF9TUkNfQ09MT1I6CisgICAgICAgIG1CbGVuZERzdCA9IEdMX1NSQ19DT0xPUjsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9EU1RfT05FX01JTlVTX1NSQ19DT0xPUjoKKyAgICAgICAgbUJsZW5kRHN0ID0gR0xfT05FX01JTlVTX1NSQ19DT0xPUjsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9EU1RfU1JDX0FMUEhBOgorICAgICAgICBtQmxlbmREc3QgPSBHTF9TUkNfQUxQSEE7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfRFNUX09ORV9NSU5VU19TUkNfQUxQSEE6CisgICAgICAgIG1CbGVuZERzdCA9IEdMX09ORV9NSU5VU19TUkNfQUxQSEE7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfRFNUX0RTVF9BTFBIQToKKyAgICAgICAgbUJsZW5kRHN0ID0gR0xfRFNUX0FMUEhBOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0JMRU5EX0RTVF9PTkVfTUlOVVNfRFNUX0FMUEhBOgorICAgICAgICBtQmxlbmREc3QgPSBHTF9PTkVfTUlOVVNfRFNUX0FMUEhBOworICAgICAgICBicmVhazsKKyAgICB9Cit9CisKK3ZvaWQgUHJvZ3JhbVN0b3JlOjpzZXRDb2xvck1hc2soYm9vbCByLCBib29sIGcsIGJvb2wgYiwgYm9vbCBhKQorewor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5kKG1Vbmlmb3JtTmFtZXNbMF0pOwotICAgICAgICBtU2hhZGVyLmFwcGVuZCgiO1xuIik7CiAKLSAgICAgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IG1Db25zdGFudENvdW50OyBjdCsrKSB7Ci0gICAgICAgICAgICBjb25zdCBFbGVtZW50ICplID0gbUNvbnN0YW50VHlwZXNbY3RdLT5nZXRFbGVtZW50KCk7Ci0gICAgICAgICAgICBmb3IgKHVpbnQzMl90IGZpZWxkPTA7IGZpZWxkIDwgZS0+Z2V0RmllbGRDb3VudCgpOyBmaWVsZCsrKSB7Ci0gICAgICAgICAgICAgICAgY29uc3QgRWxlbWVudCAqZiA9IGUtPmdldEZpZWxkKGZpZWxkKTsKLQotICAgICAgICAgICAgICAgIC8vIENhbm5vdCBiZSBjb21wbGV4Ci0gICAgICAgICAgICAgICAgcnNBc3NlcnQoIWYtPmdldEZpZWxkQ291bnQoKSk7Ci0gICAgICAgICAgICAgICAgc3dpdGNoKGYtPmdldENvbXBvbmVudCgpLmdldFZlY3RvclNpemUoKSkgewotICAgICAgICAgICAgICAgIGNhc2UgMTogbVNoYWRlci5hcHBlbmQoInVuaWZvcm0gZmxvYXQgVU5JXyIpOyBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDI6IG1TaGFkZXIuYXBwZW5kKCJ1bmlmb3JtIHZlYzIgVU5JXyIpOyBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDM6IG1TaGFkZXIuYXBwZW5kKCJ1bmlmb3JtIHZlYzMgVU5JXyIpOyBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDQ6IG1TaGFkZXIuYXBwZW5kKCJ1bmlmb3JtIHZlYzQgVU5JXyIpOyBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICByc0Fzc2VydCgwKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZChlLT5nZXRGaWVsZE5hbWUoZmllbGQpKTsKLSAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZCgiO1xuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQorICAgICAgICBhcHBlbmRVc2VyQ29uc3RhbnRzKCk7CiAKICAgICAgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IG1JbnB1dENvdW50OyBjdCsrKSB7CiAgICAgICAgICAgICBjb25zdCBFbGVtZW50ICplID0gbUlucHV0RWxlbWVudHNbY3RdLmdldCgpOwogICAgICAgICAgICAgZm9yICh1aW50MzJfdCBmaWVsZD0wOyBmaWVsZCA8IGUtPmdldEZpZWxkQ291bnQoKTsgZmllbGQrKykgewogICAgICAgICAgICAgICAgIGNvbnN0IEVsZW1lbnQgKmYgPSBlLT5nZXRGaWVsZChmaWVsZCk7CisgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqZm4gPSBlLT5nZXRGaWVsZE5hbWUoZmllbGQpOworCisgICAgICAgICAgICAgICAgaWYgKGZuWzBdID09ICcjJykgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAvLyBDYW5ub3QgYmUgY29tcGxleAogICAgICAgICAgICAgICAgIHJzQXNzZXJ0KCFmLT5nZXRGaWVsZENvdW50KCkpOwpAQCAtMTYyLDE0OSArNzgsMTIxIEBACiAgICAgICAgICAgICAgICAgICAgIHJzQXNzZXJ0KDApOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKGUtPmdldEZpZWxkTmFtZShmaWVsZCkpOworICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKGZuKTsKICAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZCgiO1xuIik7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgbVNoYWRlci5hcHBlbmQobVVzZXJTaGFkZXIpOw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gYmVjYXVzZSBhbGxvY2F0aW9uIGlzIG1pc3NpbmciKTsKKyAgICAgICAgICAgIHJzYy0+c2V0RXJyb3IoUlNfRVJST1JfQkFEX1NIQURFUiwgIkZpeGVkIGZ1bmN0aW9uIGFsbG9jYXRpb24gbWlzc2luZyIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGZsb2F0ICpmID0gc3RhdGljX2Nhc3Q8ZmxvYXQgKj4obUNvbnN0YW50c1swXS0+Z2V0UHRyKCkpOworICAgICAgICBNYXRyaXggbXZwOworICAgICAgICBtdnAubG9hZCgmZltSU19QUk9HUkFNX1ZFUlRFWF9QUk9KRUNUSU9OX09GRlNFVF0pOworICAgICAgICBNYXRyaXggdDsKKyAgICAgICAgdC5sb2FkKCZmW1JTX1BST0dSQU1fVkVSVEVYX01PREVMVklFV19PRkZTRVRdKTsKKyAgICAgICAgbXZwLm11bHRpcGx5KCZ0KTsKKyAgICAgICAgZm9yKHVpbnQzMl90IGkgPSAwOyBpIDwgMTY7IGkgKyspIHsKKyAgICAgICAgICAgIGZbUlNfUFJPR1JBTV9WRVJURVhfTVZQX09GRlNFVCArIGldID0gbXZwLm1baV07CisgICAgICAgIH0KICAgICB9CiAKICAgICByc2MtPmNoZWNrRXJyb3IoIlByb2dyYW1WZXJ0ZXg6OnNldHVwR0wyIGJlZ2luIHVuaWZvcm1zIik7Ci0gICAgdWludDMyX3QgdWlkeCA9IDE7Ci0gICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IG1Db25zdGFudENvdW50OyBjdCsrKSB7Ci0gICAgICAgIEFsbG9jYXRpb24gKmFsbG9jID0gbUNvbnN0YW50c1tjdCsxXS5nZXQoKTsKLSAgICAgICAgaWYgKCFhbGxvYykgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBjb25zdCB1aW50OF90ICpkYXRhID0gc3RhdGljX2Nhc3Q8Y29uc3QgdWludDhfdCAqPihhbGxvYy0+Z2V0UHRyKCkpOwotICAgICAgICBjb25zdCBFbGVtZW50ICplID0gbUNvbnN0YW50VHlwZXNbY3RdLT5nZXRFbGVtZW50KCk7Ci0gICAgICAgIGZvciAodWludDMyX3QgZmllbGQ9MDsgZmllbGQgPCBlLT5nZXRGaWVsZENvdW50KCk7IGZpZWxkKyspIHsKLSAgICAgICAgICAgIGNvbnN0IEVsZW1lbnQgKmYgPSBlLT5nZXRGaWVsZChmaWVsZCk7Ci0gICAgICAgICAgICB1aW50MzJfdCBvZmZzZXQgPSBlLT5nZXRGaWVsZE9mZnNldEJ5dGVzKGZpZWxkKTsKLSAgICAgICAgICAgIGludDMyX3Qgc2xvdCA9IHNjLT52dHhVbmlmb3JtU2xvdCh1aWR4KTsKLQotICAgICAgICAgICAgY29uc3QgZmxvYXQgKmZkID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCBmbG9hdCAqPigmZGF0YVtvZmZzZXRdKTsKLQotICAgICAgICAgICAgLy9MT0dFKCJVbmlmb3JtICBzbG90PSVpLCBvZmZzZXQ9JWksIGNvbnN0YW50PSVpLCBmaWVsZD0laSwgdWlkeD0laSIsIHNsb3QsIG9mZnNldCwgY3QsIGZpZWxkLCB1aWR4KTsKLSAgICAgICAgICAgIGlmIChzbG90ID49IDApIHsKLSAgICAgICAgICAgICAgICBzd2l0Y2goZi0+Z2V0Q29tcG9uZW50KCkuZ2V0VmVjdG9yU2l6ZSgpKSB7Ci0gICAgICAgICAgICAgICAgY2FzZSAxOgotICAgICAgICAgICAgICAgICAgICAvL0xPR0UoIlVuaWZvcm0gMSA9ICVmIiwgZmRbMF0pOwotICAgICAgICAgICAgICAgICAgICBnbFVuaWZvcm0xZnYoc2xvdCwgMSwgZmQpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgIC8vTE9HRSgiVW5pZm9ybSAyID0gJWYgJWYiLCBmZFswXSwgZmRbMV0pOwotICAgICAgICAgICAgICAgICAgICBnbFVuaWZvcm0yZnYoc2xvdCwgMSwgZmQpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICAgICAgICAgIC8vTE9HRSgiVW5pZm9ybSAzID0gJWYgJWYgJWYiLCBmZFswXSwgZmRbMV0sIGZkWzJdKTsKLSAgICAgICAgICAgICAgICAgICAgZ2xVbmlmb3JtM2Z2KHNsb3QsIDEsIGZkKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSA0OgotICAgICAgICAgICAgICAgICAgICAvL0xPR0UoIlVuaWZvcm0gNCA9ICVmICVmICVmICVmIiwgZmRbMF0sIGZkWzFdLCBmZFsyXSwgZmRbM10pOwotICAgICAgICAgICAgICAgICAgICBnbFVuaWZvcm00ZnYoc2xvdCwgMSwgZmQpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICByc0Fzc2VydCgwKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB1aWR4ICsrOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IG1Db25zdGFudENvdW50OyBjdCsrKSB7Ci0gICAgICAgIHVpbnQzMl90IGdsU2xvdCA9IHNjLT52dHhVbmlmb3JtU2xvdChjdCArIDEpOwotCi0gICAgfQorICAgIHNldHVwVXNlckNvbnN0YW50cyhyc2MsIHNjLCBmYWxzZSk7CiAKICAgICBzdGF0ZS0+bUxhc3Quc2V0KHRoaXMpOwogICAgIHJzYy0+Y2hlY2tFcnJvcigiUHJvZ3JhbVZlcnRleDo6c2V0dXBHTDIiKTsKIH0KIAotdm9pZCBQcm9ncmFtVmVydGV4OjphZGRMaWdodChjb25zdCBMaWdodCAqbCkKK3ZvaWQgU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KENvbnRleHQgKnJzYykKIHsKICAgICBtQXR0cmliQ291bnQgPSAwOwogICAgIGlmIChtVXNlclNoYWRlci5zaXplKCkgPiAwKSB7CiAgICAgICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBtSW5wdXRDb3VudDsgY3QrKykgewotICAgICAgICAgICAgaW5pdEFkZFVzZXJFbGVtZW50KG1JbnB1dEVsZW1lbnRzW2N0XS5nZXQoKSwgbUF0dHJpYk5hbWVzLCAmbUF0dHJpYkNvdW50LCAiQVRUUklCXyIpOworICAgICAgICAgICAgaW5pdEFkZFVzZXJFbGVtZW50KG1JbnB1dEVsZW1lbnRzW2N0XS5nZXQoKSwgbUF0dHJpYk5hbWVzLCAmbUF0dHJpYkNvdW50LCBSU19TSEFERVJfQVRUUik7CiAgICAgICAgIH0KLQotICAgICAgICBtVW5pZm9ybUNvdW50ID0gMTsKLSAgICAgICAgbVVuaWZvcm1OYW1lc1swXS5zZXRUbygiVU5JX01WUCIpOworICAgICAgICBtVW5pZm9ybUNvdW50ID0gMDsKICAgICAgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IG1Db25zdGFudENvdW50OyBjdCsrKSB7Ci0gICAgICAgICAgICBpbml0QWRkVXNlckVsZW1lbnQobUNvbnN0YW50VHlwZXNbY3RdLT5nZXRFbGVtZW50KCksIG1Vbmlmb3JtTmFtZXMsICZtVW5pZm9ybUNvdW50LCAiVU5JXyIpOworICAgICAgICAgICAgaW5pdEFkZFVzZXJFbGVtZW50KG1Db25zdGFudFR5cGVzW2N0XS0+Z2V0RWxlbWVudCgpLCBtVW5pZm9ybU5hbWVzLCAmbVVuaWZvcm1Db3VudCwgUlNfU0hBREVSX1VOSSk7CiAgICAgICAgIH0KLSAgICB9IGVsc2UgewotICAgICAgICBtVW5pZm9ybUNvdW50ID0gMjsKLSAgICAgICAgbVVuaWZvcm1OYW1lc1swXS5zZXRUbygiVU5JX01WUCIpOwotICAgICAgICBtVW5pZm9ybU5hbWVzWzFdLn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ICAgICAgICAgICAgICAgICAgc3MtPm1NYWdGaWx0ZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcy0+bU1pbkZpbHRlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzLT5tV3JhcFMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcy0+bVdyYXBULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3MtPm1XcmFwUik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcy0+bVdyYXBSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3MtPm1Bbmlzbyk7CiAgICAgcy0+aW5jVXNlclJlZigpOwogICAgIHJldHVybiBzOwogfQpkaWZmIC0tZ2l0IGEvbGlicy9ycy9yc1NhbXBsZXIuaCBiL2xpYnMvcnMvcnNTYW1wbGVyLmgKaW5kZXggMDUwNjA4MS4uNDk0NjM1NSAxMDA2NDQKLS0tIGEvbGlicy9ycy9yc1NhbXBsZXIuaAorKysgYi9saWJzL3JzL3JzU2FtcGxlci5oCkBAIC0zNiwyMiArMzYsMjggQEAKICAgICAgICAgICAgIFJzU2FtcGxlclZhbHVlIG1pbkZpbHRlciwKICAgICAgICAgICAgIFJzU2FtcGxlclZhbHVlIHdyYXBTLAogICAgICAgICAgICAgUnNTYW1wbGVyVmFsdWUgd3JhcFQsCi0gICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSB3cmFwUik7CisgICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSB3cmFwUiwKKyAgICAgICAgICAgIGZsb2F0IGFuaXNvID0gMS4wZik7CiAKICAgICB2aXJ0dWFsIH5TYW1wbGVyKCk7CiAKICAgICB2b2lkIGJpbmQoQWxsb2NhdGlvbiAqKTsKLSAgICB2b2lkIHNldHVwR0woY29uc3QgQ29udGV4dCAqLCBib29sIG5wb3QpOworICAgIHZvaWQgc2V0dXBHTChjb25zdCBDb250ZXh0ICosIGNvbnN0IEFsbG9jYXRpb24gK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NwcAorKysgYi9saWJzL3JzL3JzU2NyaXB0LmNwcApAQCAtMjEsMjAgKzIxLDUzIEBACiAKIFNjcmlwdDo6U2NyaXB0KENvbnRleHQgKnJzYykgOiBPYmplY3RCYXNlKHJzYykKIHsKLSAgICBtQWxsb2NGaWxlID0gX19GSUxFX187Ci0gICAgbUFsbG9jTGluZSA9IF9fTElORV9fOwogICAgIG1lbXNldCgmbUVudmlyb21lbnQsIDAsIHNpemVvZihtRW52aXJvbWVudCkpOwotICAgIG1FbnZpcm9tZW50Lm1DbGVhckNvbG9yWzBdID0gMDsKLSAgICBtRW52aXJvbWVudC5tQ2xlYXJDb2xvclsxXSA9IDA7Ci0gICAgbUVudmlyb21lbnQubUNsZWFyQ29sb3JbMl0gPSAwOwotICAgIG1FbnZpcm9tZW50Lm1DbGVhckNvbG9yWzNdID0gMTsKLSAgICBtRW52aXJvbWVudC5tQ2xlYXJEZXB0aCA9IDE7Ci0gICAgbUVudmlyb21lbnQubUNsZWFyU3RlbmNpbCA9IDA7Ci0gICAgbUVudmlyb21lbnQubUlzUm9vdCA9IGZhbHNlOworCisgICAgbVNsb3RzID0gTlVMTDsKKyAgICBtVHlwZXMgPSBOVUxMOwogfQogCiBTY3JpcHQ6On5TY3JpcHQoKQogeworICAgIGlmKG1TbG90cykgeworICAgICAgICBkZWxldGUgW10gbVNsb3RzOworICAgICAgICBtU2xvdHMgPSBOVUxMOworICAgIH0KKyAgICBpZihtVHlwZXMpIHsKKyAgICAgICAgZGVsZXRlIFtdIG1UeXBlczsKKyAgICAgICAgbVR5cGVzID0gTlVMTDsKKyAgICB9Cit9CisKK3ZvaWQgU2NyaXB0Ojppbml0U2xvdHMoKSB7CisgICAgaWYobUVudmlyb21lbnQubUZpZWxkQ291bnQgPiAwKSB7CisgICAgICAgIG1TbG90cyA9IG5ldyBPYmplY3RCYXNlUmVmPEFsbG9jYXRpb24+W21FbnZpcm9tZW50Lm1GaWVsZENvdW50XTsKKyAgICAgICAgbVR5cGVzID0gb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2xlYXJTdGVuY2lsOwotCi0gICAgICAgIHVpbnQzMl90IG1TdGFydFRpbWVNaWxsaXM7CisgICAgICAgIGludDY0X3QgbVN0YXJ0VGltZU1pbGxpczsKKyAgICAgICAgaW50NjRfdCBtTGFzdER0VGltZTsKICAgICAgICAgY29uc3QgY2hhciogbVRpbWVab25lOwogCiAgICAgICAgIE9iamVjdEJhc2VSZWY8UHJvZ3JhbVZlcnRleD4gbVZlcnRleDsKICAgICAgICAgT2JqZWN0QmFzZVJlZjxQcm9ncmFtRnJhZ21lbnQ+IG1GcmFnbWVudDsKICAgICAgICAgT2JqZWN0QmFzZVJlZjxQcm9ncmFtUmFzdGVyPiBtUmFzdGVyOwotICAgICAgICBPYmplY3RCYXNlUmVmPFByb2dyYW1GcmFnbWVudFN0b3JlPiBtRnJhZ21lbnRTdG9yZTsKLSAgICAgICAgSW52b2tlRnVuY190IG1JbnZva2FibGVzW01BWF9TQ1JJUFRfQkFOS1NdOworICAgICAgICBPYmplY3RCYXNlUmVmPFByb2dyYW1TdG9yZT4gbUZyYWdtZW50U3RvcmU7CisKKyAgICAgICAgdWludDMyX3QgbUludm9rZUZ1bmN0aW9uQ291bnQ7CisgICAgICAgIEludm9rZUZ1bmNfdCAqbUludm9rZUZ1bmN0aW9uczsKKyAgICAgICAgdWludDMyX3QgbUZpZWxkQ291bnQ7CisgICAgICAgIHZvaWQgKiogbUZpZWxkQWRkcmVzczsKKwogICAgICAgICBjaGFyICogbVNjcmlwdFRleHQ7CiAgICAgICAgIHVpbnQzMl90IG1TY3JpcHRUZXh0TGVuZ3RoOworCisgICAgICAgIGJvb2wgbUlzVGhyZWFkYWJsZTsKICAgICB9OwogICAgIEVudmlyb21lbnRfdCBtRW52aXJvbWVudDsKIAotICAgIHVpbnQzMl90IG1Db3Vuc3RhbnRCdWZmZXJDb3VudDsKKyAgICB2b2lkIGluaXRTbG90cygpOworICAgIHZvaWQgc2V0U2xvdCh1aW50MzJfdCBzbG90LCBBbGxvY2F0aW9u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AgICBpZiAobUJjY1NjcmlwdCkgeworICAgICAgICBiY2NEZWxldGVTY3JpcHQobUJjY1NjcmlwdCk7CiAgICAgfQogICAgIGZyZWUobUVudmlyb21lbnQubVNjcmlwdFRleHQpOwogICAgIG1FbnZpcm9tZW50Lm1TY3JpcHRUZXh0ID0gTlVMTDsKIH0KIAotdm9pZCBTY3JpcHRDOjpzZXR1cFNjcmlwdCgpCit2b2lkIFNjcmlwdEM6OnNldHVwU2NyaXB0KENvbnRleHQgKnJzYykKIHsKLSAgICBmb3IgKGludCBjdD0wOyBjdCA8IE1BWF9TQ1JJUFRfQkFOS1M7IGN0KyspIHsKLSAgICAgICAgaWYgKG1Qcm9ncmFtLm1TbG90UG9pbnRlcnNbY3RdKSB7Ci0gICAgICAgICAgICAqbVByb2dyYW0ubVNsb3RQb2ludGVyc1tjdF0gPSBtU2xvdHNbY3RdLT5nZXRQdHIoKTsKKyAgICBzZXR1cEdMU3RhdGUocnNjKTsKKyAgICBtRW52aXJvbWVudC5tU3RhcnRUaW1lTWlsbGlzCisgICAgICAgICAgICAgICAgPSBuYW5vc2Vjb25kc190b19taWxsaXNlY29uZHMoc3lzdGVtVGltZShTWVNURU1fVElNRV9NT05PVE9OSUMpKTsKKworICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBtRW52aXJvbWVudC5tRmllbGRDb3VudDsgY3QrKykgeworICAgICAgICBpZiAobVNsb3RzW2N0XS5nZXQoKSAmJiAhbVR5cGVzW2N0XS5nZXQoKSkgeworICAgICAgICAgICAgbVR5cGVzW2N0XS5zZXQobVNsb3RzW2N0XS0+Z2V0VHlwZSgpKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghbVR5cGVzW2N0XS5nZXQoKSkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB2b2lkICpwdHIgPSBOVUxMOworICAgICAgICBpZiAobVNsb3RzW2N0XS5nZXQoKSkgeworICAgICAgICAgICAgcHRyID0gbVNsb3RzW2N0XS0+Z2V0UHRyKCk7CisgICAgICAgIH0KKyAgICAgICAgdm9pZCAqKmRlc3QgPSAoKHZvaWQgKioqKW1FbnZpcm9tZW50Lm1GaWVsZEFkZHJlc3MpW2N0XTsKKworICAgICAgICBpZiAocnNjLT5wcm9wcy5tTG9nU2NyaXB0cykgeworICAgICAgICAgICAgTE9HVigiJXAgU2NyaXB0Qzo6c2V0dXBTY3JpcHQgc2xvdD0laSAgZHN0PSVwICBzcmM9JXAgIHR5cGU9JXAiLCByc2MsIGN0LCBkZXN0LCBwdHIsIG1TbG90c1tjdF0tPmdldFR5cGUoKSk7CisKKyAgICAgICAgICAgIC8vY29uc3QgdWludDMyX3QgKnAzMiA9IChjb25zdCB1aW50MzJfdCAqKXB0cjsKKyAgICAgICAgICAgIC8vZm9yICh1aW50MzJfdCBjdDI9MDsgY3QyIDwgbVNsb3RzW2N0XS0+Z2V0VHlwZSgpLT5nZXREaW1YKCk7IGN0MisrKSB7CisgICAgICAgICAgICAgICAgLy9MT0dFKCIgICVpID0gMHglMDh4ICIsIGN0MiwgcDMyW2N0Ml0pOworICAgICAgICAgICAgLy99CisgICAgICAgIH0KKworICAgICAgICBpZiAoZGVzdCkgeworICAgICAgICAgICAgKmRlc3QgPSBwdHI7CiAgICAgICAgIH0KICAgICB9CiB9CiAKLQotdWludDMyX3QgU2NyaXB0Qzo6cnVuKENvbnRleHQgKnJzYywgdWludDMyX3QgbGF1bmNoSW5kZXgpCitjb25zdCBBbGxvY2F0aW9uICpTY3JpcHRDOjpwdHJUb0FsbG9jYXRpb24oY29uc3Qgdm9pZCAqcHRyKSBjb25zdAogewotICAgIGlmIChtUHJvZ3JhbS5tU2NyaXB0ID09IE5VTEwpIHsKLSAgICAgICAgcnNjLT5zZXRFcnJvcihSU19FUlJPUl9CQURfU0NSSVBULCAiQXR0ZW1wdGVkIHRvIHJ1biBiYWQgc2NyaXB0Iik7Ci0gICAgICAgIHJldHVybiAwOworICAgIGlmICghcHRyKSB7CisgICAgICAgIHJldHVybiBOVUxMOwogICAgIH0KKyAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgbUVudmlyb21lbnQubUZpZWxkQ291bnQ7IGN0KyspIHsKKyAgICAgICAgaWYgKCFtU2xvdHNbY3RdLmdldCgpKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIGlmIChtU2xvdHNbY3RdLT5nZXRQdHIoKSA9PSBwdHIpIHsKKyAgICAgICAgICAgIHJldHVybiBtU2xvdHNbY3RdLmdldCgpOworICAgICAgICB9CisgICAgfQorICAgIExPR0UoIlNjcmlwdEM6OnB0clRvQWxsb2NhdGlvbiwgZmFpbGVkIHRvIGZpbmQgJXAiLCBwdHIpOworICAgIHJldHVybiBOVUxMOworfQogCi0gICAgQ29udGV4dDo6U2NyaXB0VExTU3RydWN0ICogdGxzID0KLSAgICAoQ29udGV4dDo6U2NyaXB0VExTU3RydWN0ICopcHRocmVhZF9nZXRzcGVjaWZpYyhDb250ZXh0OjpnVGhyZWFkVExTS2V5KTsKK1NjcmlwdCAqIFNjcmlwdEM6OnNldFRMUyhTY3JpcHQgKnNjKQoreworICAgIENvbnRleHQ6OlNjcmlwdFRMU1N0cnVjdCAqIHRscyA9IChDb250ZXh0OjpTY3JpcHRUTFNTdHJ1Y3QgKikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdGhyZWFkX2dldHNwZWNpZmljKENvbnRleHQ6OmdUaHJlYWRUTFNLZXkpOwogICAgIHJzQXNzZXJ0KHRscyk7CisgICAgU2NyaXB0ICpvbGQgPSB0bHMtPm1TY3JpcHQ7CisgICAgdGxzLT5tU2NyaXB0ID0gc2M7CisgICAgcmV0dXJuIG9sZDsKK30KIAorCit2b2lkIFNjcmlwdEM6OnNldHVwR0xTdGF0ZShDb250ZXh0ICpyc2MpCit7CiAgICAgaWYgKG1FbnZpcm9tZW50Lm1GcmFnbWVudFN0b3JlLmdldCgpKSB7CiAgICAgICAgIHJzYy0+c2V0RnJhZ21lbnRTdG9yZShtRW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tLm1Sb290KCk7CisKKyAgICBpZiAocnNjLT5wcm9wcy5tTG9nU2NyaXB0cykgeworICAgICAgICBMT0dWKCIlcCBTY3JpcHRDOjpydW4gaW52b2tpbmcgY29tcGxldGUsIHJldD0laSIsIHJzYywgcmV0KTsKKyAgICB9CisKKyAgICBzZXRUTFMob2xkVExTKTsKICAgICByZXR1cm4gcmV0OwogfQogCisKK3R5cGVkZWYgc3RydWN0IHsKKyAgICBDb250ZXh0ICpyc2M7CisgICAgU2NyaXB0QyAqc2NyaXB0OworICAgIGNvbnN0IEFsbG9jYXRpb24gKiBhaW47CisgICAgQWxsb2NhdGlvbiAqIGFvdXQ7CisgICAgY29uc3Qgdm9pZCAqIHVzcjsKKworICAgIHVpbnQzMl90IG1TbGljZVNpemU7CisgICAgdm9sYXRpbGUgaW50IG1TbGljZU51bTsKKworICAgIGNvbnN0IHVpbnQ4X3QgKnB0ckluOworICAgIHVpbnQzMl90IGVTdHJpZGVJbjsKKyAgICB1aW50OF90ICpwdHJPdXQ7CisgICAgdWludDMyX3QgZVN0cmlkZU91dDsKKworICAgIHVpbnQzMl90IHhTdGFydDsKKyAgICB1aW50MzJfdCB4RW5kOworICAgIHVpbnQzMl90IHlTdGFydDsKKyAgICB1aW50MzJfdCB5RW5kOworICAgIHVpbnQzMl90IHpTdGFydDsKKyAgICB1aW50MzJfdCB6RW5kOworICAgIHVpbnQzMl90IGFycmF5U3RhcnQ7CisgICAgdWludDMyX3QgYXJyYXlFbmQ7CisKKyAgICB1aW50MzJfdCBkaW1YOworICAgIHVpbnQzMl90IGRpbVk7CisgICAgdWludDMyX3QgZGltWjsKKyAgICB1aW50MzJfdCBkaW1BcnJheTsKK30gTVRMYXVuY2hTdHJ1Y3Q7Cit0eXBlZGVmIGludCAoKnJzX3QpKGNvbnN0IHZvaWQgKiwgdm9pZCAqLCBjb25zdCB2b2lkICosIHVpbnQzMl90LCB1aW50MzJfdCwgdWludDMyX3QsIHVpbnQzMl90KTsKKworc3RhdGljIHZvaWQgd2NfeHkodm9pZCAqdXNyLCB1aW50MzJfdCBpZHgpCit7CisgICAgTVRMYXVuY2hTdHJ1Y3QgKm10bHMgPSAoTVRMYXVuY2hTdHJ1Y3QgKil1c3I7CisKKyAgICB3aGlsZSAoMSkgeworICAgICAgICB1aW50MzJfdCBzbGljZSA9ICh1aW50MzJfdClhbmRyb2lkX2F0b21pY19pbmMoJm10bHMtPm1TbGljZU51bSk7CisgICAgICAgIHVpbnQzMl90IHlTdGFydCA9IG10bHMtPnlTdGFydCArIHNsaWNlICogbXRscy0+bVNsaWNlU2l6ZTsKKyAgICAgICAgdWludDMyX3QgeUVuZCA9IHlTdGFydCArIG10bHMtPm1TbGljZVNpemU7CisgICAgICAgIHlFbmQgPSByc01pbih5RW5kLCBtdGxzLT55RW5kKTsKKyAgICAgICAgaWYgKHlFbmQgPD0geVN0YXJ0KSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICAvL0xPR0UoInVzciBpZHggJWksIHggJWksJWkgIHkgJWksJWkiLCBpZHgsIG10bHMtPnhTdGFydCwgbXRscy0+eEVuZCwgeVN0YXJ0LCB5RW5kKTsKKyAgICAgICAgLy9MT0dFKCJ1c3IgcHRyIGluICVwLCAgb3V0ICVwIiwgbXRscy0+cHRySW4sIG10bHMtPnB0ck91dCk7CisgICAgICAgIGZvciAodWludDMyX3QgeSA9IHlTdGFydDsgeSA8IHlFbmQ7IHkrKykgeworICAgICAgICAgICAgdWludDMyX3Qgb2Zmc2V0ID0gbXRscy0+ZGltWCAqIHk7CisgICAgICAgICAgICB1aW50OF90ICp4UHRyT3V0ID0gbXRscy0+cHRyT3V0ICsgKG10bHMtPmVTdHJpZGVPdXQgKiBvZmZzZXQpOworICAgICAgICAgICAgY29uc3QgdWludDhfdCAqeFB0ckluID0gbXRscy0+cHRySW4gKyAobXRscy0+ZVN0cmlkZUluICogb2Zmc2V0KTsKKworICAgICAgICAgICAgZm9yICh1aW50MzJfdCB4ID0gbXRscy0+eFN0YXJ0OyB4IDwgbXRscy0+eEVuZDsgeCsrKSB7CisgICAgICAgICAgICAgICAgKChyc190KW10bHMtPnNjcmlwdC0+bVByb2dyYW0ubVJvb3QpICh4UHRySW4sIHhQdHJPdXQsIG10bHMtPnVzciwgeCwgeSwgMCwgMCk7CisgICAgICAgICAgICAgICAgeFB0ckluICs9IG10bHMtPmVTdHJpZGVJbjsKKyAgICAgICAgICAgICAgICB4UHRyT3V0ICs9IG10bHMtPmVTdHJpZGVPdXQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKK30KKworc3RhdGljIHZvaWQgd2NfeCh2b2lkICp1c3IsIHVpbnQzMl90IGlkeCkKK3sKKyAgICBNVExhdW5jaFN0cnVjdCAqbXRscyA9IChNVExhdW5jaFN0cnVjdCAqKXVzcjsKKworICAgIHdoaWxlICgxKSB7CisgICAgICAgIHVpbnQzMl90IHNsaWNlID0gKHVpbnQzMl90KWFuZHJvaWRfYXRvbWljX2luYygmbXRscy0+bVNsaWNlTnVtKTsKKyAgICAgICAgdWludDMyX3QgeFN0YXJ0ID0gbXRscy0+eFN0YXJ0ICsgc2xpY2UgKiBtdGxzLT5tU2xpY2VTaXplOworICAgICAgICB1aW50MzJfdCB4RW5kID0geFN0YXJ0ICsgbXRscy0+bVNsaWNlU2l6ZTsKKyAgICAgICAgeEVuZCA9IHJzTWluKHhFbmQsIG10bHMtPnhFbmQpOworICAgICAgICBpZiAoeEVuZCA8PSB4U3RhcnQpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIC8vTE9HRSgidXNyIGlkeCAlaSwgeCAlaSwlaSAgeSAlaSwlaSIsIGlkeCwgbXRscy0+eFN0YXJ0LCBtdGxzLT54RW5kLCB5U3RhcnQsIHlFbmQpOworICAgICAgICAvL0xPR0UoInVzciBwdHIgaW4gJXAsICBvdXQgJXAiLCBtdGxzLT5wdHJJbiwgbXRscy0+cHRyT3V0KTsKKyAgICAgICAgdWludDhfdCAqeFB0ck91dCA9IG10bHMtPnB0ck91dCArIChtdGxzLT5lU3RyaWRlT3V0ICogeFN0YXJ0KTsKKyAgICAgICAgY29uc3QgdWludDhfdCAqeFB0ckluID0gbXRscy0+cHRySW4gKyAobXRscy0+ZVN0cmlkZUluICogeFN0YXJ0KTsKKyAgICAgICAgZm9yICh1aW50MzJfdCB4ID0geFN0YXJ0OyB4IDwgeEVuZDsgeCsrKSB7CisgICAgICAgICAgICAoKHJzX3QpbXRscy0+c2NyaXB0LT5tUHJvZ3JhbS5tUm9vdCkgKHhQdHJJbiwgeFB0ck91dCwgbXRscy0+dXNyLCB4LCAwLCAwLCAwKTsKKyAgICAgICAgICAgIHhQdHJJbiArPSBtdGxzLT5lU3RyaWRlSW47CisgICAgICAgICAgICB4UHRyT3V0ICs9IG10bHMtPmVTdHJpZGVPdXQ7CisgICAgICAgIH0KKyAgICB9CisKK30KKwordm9pZCBTY3JpcHRDOjpydW5Gb3JFYWNoKENvbnRleHQgKnJzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBBbGxvY2F0aW9uICogYWluLAorICAgICAgICAgICAgICAgICAgICAgICAgIEFsbG9jYXRpb24gKiBhb3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKiB1c3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUnNTY3JpcHRDYWxsICpzYykKK3sKKyAgICBNVExhdW5jaFN0cnVjdCBtdGxzOworICAgIG1lbXNldCgmbXRscywgMCwgc2l6ZW9mKG10bHMpKTsKKworICAgIGlmIChhaW4pIHsKKyAgICAgICAgbXRscy5kaW1YID0gYWluLT5nZXRUeXBlKCktPmdldERpbVgoKTsKKyAgICAgICAgbXRscy5kaW1ZID0gYWluLT5nZXRUeXBlKCktPmdldERpbVkoKTsKKyAgICAgICAgbXRscy5kaW1aID0gYWluLT5nZXRUeXBlKCktPmdldERpbVooKTsKKyAgICAgICAgLy9tdGxzLmRpbUFycmF5ID0gYWluLT5nZXRUeXBlKCktPmdldERpbUFycmF5KCk7CisgICAgfSBlbHNlIGlmIChhb3V0KSB7CisgICAgICAgIG10bHMuZGltWCA9IGFvdXQtPmdldFR5cGUoKS0+Z2V0RGltWCgpOworICAgICAgICBtdGxzLmRpbVkgPSBhb3V0LT5nZXRUeXBlKCktPmdldERpbVkoKTsKKyAgICAgICAgbXRscy5kaW1aID0gYW91dC0+Z2V0VHlwZSgpLT5nZXREaW1aKCk7CisgICAgICAgIC8vbXRscy5kaW1BcnJheSA9IGFvdXQtPmdldFR5cGUoKS0+Z2V0RGltQXJyYXkoKTsKKyAgICB9IGVsc2UgeworICAgICAgICByc2MtPnNldEVycm9yKFJTX0VSUk9SX0JBRF9TQ1JJUFQsICJyc0ZvckVhY2ggY2FsbGVkIHdpdGggbnVsbCBhbGxvY2F0aW9ucyIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKCFzYyB8fCAoc2MtPnhFbmQgPT0gMCkpIHsKKyAgICAgICAgbXRscy54RW5kID0gbXRscy5kaW1YOworICAgIH0gZWxzZSB7CisgICAgICAgIHJzQXNzZXJ0KHNjLT54U3RhcnQgPCBtdGxzLmRpbVgpOworICAgICAgICByc0Fzc2VydChzYy0+eEVuZCA8PSBtdGxzLmRpbVgpOworICAgICAgICByc0Fzc2VydChzYy0+eFN0YXJ0IDwgc2MtPnhFbmQpOworICAgICAgICBtdGxzLnhTdGFydCA9IHJzTWluKG10bHMuZGltWCwgc2MtPnhTdGFydCk7CisgICAgICAgIG10bHMueEVuZCA9IHJzTWluKG10bHMuZGltWCwgc2MtPnhFbmQpOworICAgICAgICBpZiAobXRscy54U3RhcnQgPj0gbXRscy54RW5kKSByZXR1cm47CisgICAgfQorCisgICAgaWYgKCFzYyB8fCAoc2MtPnlFbmQgPT0gMCkpIHsKKyAgICAgICAgbXRscy55RW5kID0gbXRscy5kaW1ZOworICAgIH0gZWxzZSB7CisgICAgICAgIHJzQXNzZXJ0KHNjLT55U3RhcnQgPCBtdGxzLmRpbVkpOworICAgICAgICByc0Fzc2VydChzYy0+eUVuZCA8PSBtdGxzLmRpbVkpOworICAgICAgICByc0Fzc2VydChzYy0+eVN0YXJ0IDwgc2MtPnlFbmQpOworICAgICAgICBtdGxzLnlTdGFydCA9IHJzTWluKG10bHMuZGltWSwgc2MtPnlTdGFydCk7CisgICAgICAgIG10bHMueUVuZCA9IHJzTWluKG10bHMuZGltWSwgc2MtPnlFbmQpOworICAgICAgICBpZiAobXRscy55U3RhcnQgPj0gbXRscy55RW5kKSByZXR1cm47CisgICAgfQorCisgICAgbXRscy54RW5kID0gcnNNYXgoKHVpbnQzMl90KTEsIG10bHMueEVuZCk7CisgICAgbXRscy55RW5kID0gcnNNYXgoKHVpbnQzMl90KTEsIG10bHMueUVuZCk7CisgICAgbXRscy56RW5kID0gcnNNYXgoKHVpbnQzMl90KTEsIG10bHMuekVuZCk7CisgICAgbXRscy5hcnJheUVuZCA9IHJzTWF4KCh1aW50MzJfdCkxLCBtdGxzLmFycmF5RW5kKTsKKworICAgIHJzQXNzZXJ0KGFpbi0+Z2V0VHlwZSgpLT5nZXREaW1aKCkgPT0gMCk7CisKKyAgICBzZXR1cFNjcmlwdChyc2MpOworICAgIFNjcmlwdCAqIG9sZFRMUyA9IHNldFRMUyh0aGlzKTsKKworCisgICAgbXRscy5yc2MgPSByc2M7CisgICAgbXRscy5haW4gPSBhaW47CisgICAgbXRscy5hb3V0ID0gYW91dDsKKyAgICBtdGxzLnNjcmlwdCA9IHRoaXM7CisgICAgbXRscy51c3IgPSB1c3I7CisgICAgbXRscy5tU2xpY2VTaXplID0gMTA7CisgICAgbXRscy5tU2xpY2VOdW0gPSAwOworCisgICAgbXRscy5wdHJJbiA9IE5VTEw7CisgICAgbXRscy5lU3RyaWRlSW4gPSAwOworICAgIGlmIChhaW4pIHsKKyAgICAgICAgbXRscy5wdHJJbiA9IChjb25zdCB1aW50OF90ICopYWluLT5nZXRQdHIoKTsKKyAgICAgICAgbXRscy5lU3RyaWRlSW4gPSBhaW4tPmdldFR5cGUoKS0+Z2V0RWxlbWVudFNpemVCeXRlcygpOworICAgIH0KKworICAgIG10bHMucHRyT3V0ID0gTlVMTDsKKyAgICBtdGxzLmVTdHJpZGVPdXQgPSAwOworICAgIGlmIChhb3V0KSB7CisgICAgICAgIG10bHMucHRyT3V0ID0gKHVpbnQ4X3QgKilhb3V0LT5nZXRQdHIoKTsKKyAgICAgICAgbXRscy5lU3RyaWRlT3V0ID0gYW91dC0+Z2V0VHlwZSgpLT5nZXRFbGVtZW50U2l6ZUJ5dGVzKCk7CisgICAgfQorCisgICAgaWYgKChyc2MtPmdldFdvcmtlclBvb2xTaXplKCkgPiAxKSAmJiBtRW52aXJvbWVudC5tSXNUaHJlYWRhYmxlKSB7CisgICAgICAgIGlmIChtdGxzLmRpbVkgPiAxKSB7CisgICAgICAgICAgICByc2MtPmxhdW5jaFRocmVhZHMod2NfeHksICZtdGxzKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJzYy0+bGF1bmNoVGhyZWFkcyh3Y194LCAmbXRscyk7CisgICAgICAgIH0KKworICAgICAgICAvL0xPR0UoImxhdW5jaCAxIik7CisgICAgfSBlbHNlIHsKKyAgICAgICAgLy9MT0dFKCJsYXVuY2ggMyIpOworICAgICAgICBmb3IgKHVpbnQzMl90IGFyID0gbXRscy5hcnJheVN0YXJ0OyBhciA8IG10bHMuYXJyYXlFbmQ7IGFyKyspIHsKKyAgICAgICAgICAgIGZvciAodWludDMyX3QgeiA9IG10bHMuelN0YXJ0OyB6IDwgbXRscy56RW5kOyB6KyspIHsKKyAgICAgICAgICAgICAgICBmb3IgKHVpbnQzMl90IHkgPSBtdGxzLnlTdGFydDsgeSA8IG10bHMueUVuZDsgeSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IG9mZnNldCA9IG10bHMuZGltWCAqIG10bHMuZGltWSAqIG10bHMuZGltWiAqIGFyICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXRscy5kaW1YICogbXRscy5kaW1ZICogeiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG10bHMuZGltWCAqIHk7CisgICAgICAgICAgICAgICAgICAgIHVpbnQ4X3QgKnhQdHJPdXQgPSBtdGxzLnB0ck91dCArIChtdGxzLmVTdHJpZGVPdXQgKiBvZmZzZXQpOworICAgICAgICAgICAgICAgICAgICBjb25zdCB1aW50OF90ICp4UHRySW4gPSBtdGxzLnB0ckluICsgKG10bHMuZVN0cmlkZUluICogb2Zmc2V0KTsKKworICAgICAgICAgICAgICAgICAgICBmb3IgKHVpbnQzMl90IHggPSBtdGxzLnhTdGFydDsgeCA8IG10bHMueEVuZDsgeCsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAoKHJzX3QpbVByb2dyYW0ubVJvb3QpICh4UHRySW4sIHhQdHJPdXQsIHVzciwgeCwgeSwgeiwgYXIpOworICAgICAgICAgICAgICAgICAgICAgICAgeFB0ckluICs9IG10bHMuZVN0cmlkZUluOworICAgICAgICAgICAgICAgICAgICAgICAgeFB0ck91dCArPSBtdGxzLmVTdHJpZGVPdXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzZXRUTFMob2xkVExTKTsKK30KKwordm9pZCBTY3JpcHRDOjpJbnZva2UoQ29udGV4dCAqcnNjLCB1aW50MzJfdCBzbG90LCBjb25zdCB2b2lkICpkYXRhLCB1aW50MzJfdCBsZW4pCit7CisgICAgLy9MT0dFKCJyc2lfU2NyaXB0SW52b2tlICVpIiwgc2xvdCk7CisgICAgaWYgKChzbG90ID49IG1FbnZpcm9tZW50Lm1JbnZva2VGdW5jdGlvbkNvdW50KSB8fAorICAgICAgICAobUVudmlyb21lbnQubUludm9rZUZ1bmN0aW9uc1tzbG90XSA9PSBOVUxMKSkgeworICAgICAgICByc2Mt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ZhdWx0UHJvZ3JhbVJhc3RlcigpKTsKIAotICAgIGlmIChzLT5tUHJvZ3JhbS5tU2NyaXB0KSB7CisgICAgaWYgKHMtPm1Qcm9ncmFtLm1Sb290KSB7CiAgICAgICAgIGNvbnN0IHN0YXRpYyBpbnQgcHJhZ21hTWF4ID0gMTY7Ci0gICAgICAgIEFDQ3NpemVpIHByYWdtYUNvdW50OwotICAgICAgICBBQ0NjaGFyICogc3RyW3ByYWdtYU1heF07Ci0gICAgICAgIGFjY0dldFByYWdtYXMocy0+bUFjY1NjcmlwdCwgJnByYWdtYUNvdW50LCBwcmFnbWFNYXgsICZzdHJbMF0pOworICAgICAgICBCQ0NzaXplaSBwcmFnbWFDb3VudDsKKyAgICAgICAgQkNDY2hhciAqIHN0cltwcmFnbWFNYXhdOworICAgICAgICBiY2NHZXRQcmFnbWFzKHMtPm1CY2NTY3JpcHQsICZwcmFnbWFDb3VudCwgcHJhZ21hTWF4LCAmc3RyWzBdKTsKIAogICAgICAgICBmb3IgKGludCBjdD0wOyBjdCA8IHByYWdtYUNvdW50OyBjdCs9MikgeworICAgICAgICAgICAgLy9MT0dFKCJwcmFnbWUgJXMgJXMiLCBzdHJbY3RdLCBzdHJbY3QrMV0pOwogICAgICAgICAgICAgaWYgKCFzdHJjbXAoc3RyW2N0XSwgInZlcnNpb24iKSkgewogICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgfQpAQCAtMjA4LDExICs0NzgsNiBAQAogICAgICAgICAgICAgICAgICAgICBzLT5tRW52aXJvbWVudC5tVmVydGV4LmNsZWFyKCk7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBQcm9ncmFtVmVydGV4ICogcHYgPSAoUHJvZ3JhbVZlcnRleCAqKXJzYy0+bG9va3VwTmFtZShzdHJbY3QrMV0pOwotICAgICAgICAgICAgICAgIGlmIChwdiAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHMtPm1FbnZpcm9tZW50Lm1WZXJ0ZXguc2V0KHB2KTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIExPR0UoIlVucmVjb25pemVkIHZhbHVlICVzIHBhc3NlZCB0byBzdGF0ZVZlcnRleCIsIHN0cltjdCsxXSk7CiAgICAgICAgICAgICB9CiAKQEAgLTIyNCwxMSArNDg5LDYgQEAKICAgICAgICAgICAgICAgICAgICAgcy0+bUVudmlyb21lbnQubVJhc3Rlci5jbGVhcigpOwogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgUHJvZ3JhbVJhc3RlciAqIHByID0gKFByb2dyYW1SYXN0ZXIgKilyc2MtPmxvb2t1cE5hbWUoc3RyW2N0KzFdKTsKLSAgICAgICAgICAgICAgICBpZiAocHIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBzLT5tRW52aXJvbWVudC5tUmFzdGVyLnNldChwcik7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBMT0dFKCJVbnJlY29uaXplZCB2YWx1ZSAlcyBwYXNzZWQgdG8gc3RhdGVSYXN0ZXIiLCBzdHJbY3QrMV0pOwogICAgICAgICAgICAgfQogCkBAIC0yNDAsMTEgKzUwMCw2IEBACiAgICAgICAgICAgICAgICAgICAgIHMtPm1FbnZpcm9tZW50Lm1GcmFnbWVudC5jbGVhcigpOwogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgUHJvZ3JhbUZyYWdtZW50ICogcGYgPSAoUHJvZ3JhbUZyYWdtZW50ICopcnNjLT5sb29rdXBOYW1lKHN0cltjdCsxXSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBmICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgcy0+bUVudmlyb21lbnQubUZyYWdtZW50LnNldChwZik7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBMT0dFKCJVbnJlY29uaXplZCB2YWx1ZSAlcyBwYXNzZWQgdG8gc3RhdGVGcmFnbWVudCIsIHN0cltjdCsxXSk7CiAgICAgICAgICAgICB9CiAKQEAgLTI1NiwxMiArNTExLDYgQEAKICAgICAgICAgICAgICAgICAgICAgcy0+bUVudmlyb21lbnQubUZyYWdtZW50U3RvcmUuY2xlYXIoKTsKICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFByb2dyYW1GcmFnbWVudFN0b3JlICogcGZzID0KLSAgICAgICAgICAgICAgICAgICAgKFByb2dyYW1GcmFnbWVudFN0b3JlICopcnNjLT5sb29rdXBOYW1lKHN0cltjdCsxXSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBmcyAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHMtPm1FbnZpcm9tZW50Lm1GcmFnbWVudFN0b3JlLnNldChwZnMpOwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgTE9HRSgiVW5yZWNvbml6ZWQgdmFsdWUgJXMgcGFzc2VkIHRvIHN0YXRlU3RvcmUiLCBzdHJbY3QrMV0pOwogICAgICAgICAgICAgfQogCkBAIC0yNzMsMTExICs1MjIsNiBAQAogICAgIH0KIH0KIAotc3RhdGljIHZvaWQgYXBwZW5kRWxlbWVudEJvZHkoU3RyaW5nOCAqcywgY29uc3QgRWxlbWVudCAqZSkKLXsKLSAgICBzLT5hcHBlbmQoIiB7XG4iKTsKLSAgICBmb3IgKHNpemVfdCBjdDI9MDsgY3QyIDwgZS0+Z2V0RmllbGRDb3VudCgpOyBjd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ci0gICAgICAgICAgICBzdHItPmFwcGVuZChzKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtU2xvdE5hbWVzW2N0XS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgIFN0cmluZzggczsKLSAgICAgICAgICAgIGlmIChlLT5nZXROYW1lKCkpIHsKLSAgICAgICAgICAgICAgICAvLyBVc2UgdGhlIG5hbWVkIHN0cnVjdAotICAgICAgICAgICAgICAgIHMuc2V0VG8oZS0+Z2V0TmFtZSgpKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gY3JlYXRlIGFuIHN0cnVjdCBuYW1lZCBmcm9tIHRoZSBzbG90LgotICAgICAgICAgICAgICAgIHMuc2V0VG8oInN0cnVjdCAiKTsKLSAgICAgICAgICAgICAgICBzLmFwcGVuZChtU2xvdE5hbWVzW2N0XSk7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQoIl9zIik7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQoZS0+Z2V0Q1N0cnVjdEJvZHkoKSk7Ci0gICAgICAgICAgICAgICAgLy9hcHBlbmRFbGVtZW50Qm9keSgmcywgZSk7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQoIjtcbiIpOwotICAgICAgICAgICAgICAgIHMuYXBwZW5kKCJzdHJ1Y3QgIik7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQobVNsb3ROYW1lc1tjdF0pOwotICAgICAgICAgICAgICAgIHMuYXBwZW5kKCJfcyIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzLmFwcGVuZCgiICogIik7Ci0gICAgICAgICAgICBzLmFwcGVuZChtU2xvdE5hbWVzW2N0XSk7Ci0gICAgICAgICAgICBzLmFwcGVuZCgiO1xuIik7Ci0gICAgICAgICAgICBpZiAocnNjLT5wcm9wcy5tTG9nU2NyaXB0cykgewotICAgICAgICAgICAgICAgIExPR1YoIiVzIiwgc3RhdGljX2Nhc3Q8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oSUQpOworICAgIGNvbnN0IEFsbG9jYXRpb24gKnB0clRvQWxsb2NhdGlvbihjb25zdCB2b2lkICopIGNvbnN0OworCisKKyAgICB2aXJ0dWFsIHZvaWQgSW52b2tlKENvbnRleHQgKnJzYywgdWludDMyX3Qgc2xvdCwgY29uc3Qgdm9pZCAqZGF0YSwgdWludDMyX3QgbGVuKTsKKworICAgIHZpcnR1YWwgdWludDMyX3QgcnVuKENvbnRleHQgKik7CisKKyAgICB2aXJ0dWFsIHZvaWQgcnVuRm9yRWFjaChDb250ZXh0ICpyc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQWxsb2NhdGlvbiAqIGFpbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBbGxvY2F0aW9uICogYW91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICogdXNyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFJzU2NyaXB0Q2FsbCAqc2MgPSBOVUxMKTsKKworICAgIHZpcnR1YWwgdm9pZCBzZXJpYWxpemUoT1N0cmVhbSAqc3RyZWFtKSBjb25zdCB7ICAgIH0KKyAgICB2aXJ0dWFsIFJzQTNEQ2xhc3NJRCBnZXRDbGFzc0lkKCkgY29uc3QgeyByZXR1cm4gUlNfQTNEX0NMQVNTX0lEX1NDUklQVF9DOyB9CisgICAgc3RhdGljIFR5cGUgKmNyZWF0ZUZyb21TdHJlYW0oQ29udGV4dCAqcnNjLCBJU3RyZWFtICpzdHJlYW0pIHsgcmV0dXJuIE5VTEw7IH0KKworcHJvdGVjdGVkOgorICAgIHZvaWQgc2V0dXBTY3JpcHQoQ29udGV4dCAqKTsKKyAgICB2b2lkIHNldHVwR0xTdGF0ZShDb250ZXh0ICopOworICAgIFNjcmlwdCAqIHNldFRMUyhTY3JpcHQgKik7CiB9OwogCiBjbGFzcyBTY3JpcHRDU3RhdGUKQEAgLTY0LDMwICs3OSwyMiBAQAogICAgIFNjcml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b3RhdGUocm90LCB4LCB5LCB6KTsKLX0KLQotc3RhdGljIHZvaWQgU0NfbWF0cml4TG9hZFNjYWxlKHJzY19NYXRyaXggKm1hdCwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikKLXsKLSAgICBNYXRyaXggKm0gPSByZWludGVycHJldF9jYXN0PE1hdHJpeCAqPihtYXQpOwotICAgIG0tPmxvYWRTY2FsZSh4LCB5LCB6KTsKLX0KLQotc3RhdGljIHZvaWQgU0NfbWF0cml4TG9hZFRyYW5zbGF0ZShyc2NfTWF0cml4ICptYXQsIGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopCi17Ci0gICAgTWF0cml4ICptID0gcmVpbnRlcnByZXRfY2FzdDxNYXRyaXggKj4obWF0KTsKLSAgICBtLT5sb2FkVHJhbnNsYXRlKHgsIHksIHopOwotfQotCi1zdGF0aWMgdm9pZCBTQ19tYXRyaXhMb2FkTXVsdGlwbHkocnNjX01hdHJpeCAqbWF0LCBjb25zdCByc2NfTWF0cml4ICpsaHMsIGNvbnN0IHJzY19NYXRyaXggKnJocykKLXsKLSAgICBNYXRyaXggKm0gPSByZWludGVycHJldF9jYXN0PE1hdHJpeCAqPihtYXQpOwotICAgIG0tPmxvYWRNdWx0aXBseShyZWludGVycHJldF9jYXN0PGNvbnN0IE1hdHJpeCAqPihsaHMpLAotICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IE1hdHJpeCAqPihyaHMpKTsKLX0KLQotc3RhdGljIHZvaWQgU0NfbWF0cml4TXVsdGlwbHkocnNjX01hdHJpeCAqbWF0LCBjb25zdCByc2NfTWF0cml4ICpyaHMpCi17Ci0gICAgTWF0cml4ICptID0gcmVpbnRlcnByZXRfY2FzdDxNYXRyaXggKj4obWF0KTsKLSAgICBtLT5tdWx0aXBseShyZWludGVycHJldF9jYXN0PGNvbnN0IE1hdHJpeCAqPihyaHMpKTsKLX0KLQotc3RhdGljIHZvaWQgU0NfbWF0cml4Um90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yc2MtPmNoZWNrVmVyc2lvbjJfMCgpKSB7Ci0gICAgICAgIHZhLnNldHVwR0wyKHJzYywgJnJzYy0+bVN0YXRlVmVydGV4QXJyYXksICZyc2MtPm1TaGFkZXJDYWNoZSk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgdmEuc2V0dXBHTChyc2MsICZyc2MtPm1TdGF0ZVZlcnRleEFycmF5KTsKLSAgICB9Ci0KLSAgICBnbERyYXdBcnJheXMoR0xfUE9JTlRTLCAwLCAxKTsKLX0KLQotc3RhdGljIHZvaWQgU0NfZHJhd1F1YWRUZXhDb29yZHMoZmxvYXQgeDEsIGZsb2F0IHkxLCBmbG9hdCB6MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUxLCBmbG9hdCB2MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgyLCBmbG9hdCB5MiwgZmxvYXQgejIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MiwgZmxvYXQgdjIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MywgZmxvYXQgeTMsIGZsb2F0IHozLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTMsIGZsb2F0IHYzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDQsIGZsb2F0IHk0LCBmbG9hdCB6NCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHU0LCBmbG9hdCB2NCkKLXsKLSAgICBHRVRfVExTKCk7Ci0gICAgaWYgKCFyc2MtPnNldHVwQ2hlY2soKSkgewotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgLy9MT0dFKCJRdWFkIik7Ci0gICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDEsIHkxLCB6MSk7Ci0gICAgLy9MT0dFKCIlNC4yZiwgJ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7Ci0gICAgZmxvYXQgcHYgPSB6ICogKDEuMGYgLSB5KTsKLSAgICBmbG9hdCBxdiA9IHogKiAoMS4wZiAtIHkgKiBmKTsKLSAgICBmbG9hdCB0diA9IHogKiAoMS4wZiAtIHkgKiAoMS4wZiAtIGYpKTsKLQotICAgIHN3aXRjaCAoaWhmKSB7Ci0gICAgICAgIGNhc2UgMDogICAgICAgICAvLyBSZWQgaXMgdGhlIGRvbWluYW50IGNvbG9yCi0gICAgICAgICAgICByZWQgPSB6OwotICAgICAgICAgICAgZ3JlZW4gPSB0djsKLSAgICAgICAgICAgIGJsdWUgPSBwdjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDE6ICAgICAgICAgLy8gR3JlZW4gaXMgdGhlIGRvbWluYW50IGNvbG9yCi0gICAgICAgICAgICByZWQgPSBxdjsKLSAgICAgICAgICAgIGdyZWVuID0gejsKLSAgICAgICAgICAgIGJsdWUgPSBwdjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICByZWQgPSBwdjsKLSAgICAgICAgICAgIGdyZWVuID0gejsKLSAgICAgICAgICAgIGJsdWUgPSB0djsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDM6ICAgICAgICAgLy8gQmx1ZSBpcyB0aGUgZG9taW5hbnQgY29sb3IKLSAgICAgICAgICAgIHJlZCA9IHB2OwotICAgICAgICAgICAgZ3JlZW4gPSBxdjsKLSAgICAgICAgICAgIGJsdWUgPSB6OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgNDoKLSAgICAgICAgICAgIHJlZCA9IHR2OwotICAgICAgICAgICAgZ3JlZW4gPSBwdjsKLSAgICAgICAgICAgIGJsdWUgPSB6OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgNTogICAgICAgICAvLyBSZWQgaXMgdGhlIGRvbWluYW50IGNvbG9yCi0gICAgICAgICAgICByZWQg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ICAgICAgICAgIDo6PSBhICAjIHNpZ25lZCBjaGFyCisvLyAgICAgICAgICAgICAgICAgOjo9IGggICMgdW5zaWduZWQgY2hhcgorLy8gICAgICAgICAgICAgICAgIDo6PSBzICAjIHNob3J0CisvLyAgICAgICAgICAgICAgICAgOjo9IHQgICMgdW5zaWduZWQgc2hvcnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gaSAgIyBpbnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gaiAgIyB1bnNpZ25lZCBpbnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gbCAgIyBsb25nCisvLyAgICAgICAgICAgICAgICAgOjo9IG0gICMgdW5zaWduZWQgbG9uZworLy8gICAgICAgICAgICAgICAgIDo6PSB4ICAjIGxvbmcgbG9uZywgX19pbnQ2NAorLy8gICAgICAgICAgICAgICAgIDo6PSB5ICAjIHVuc2lnbmVkIGxvbmcgbG9uZywgX19pbnQ2NAorLy8gICAgICAgICAgICAgICAgIDo6PSBmICAjIGZsb2F0CisvLyAgICAgICAgICAgICAgICAgOjo9IGQgICMgZG91YmxlCiAKLSAgICAvLyBtYXRoCi0gICAgeyAibW9kZiIsICh2b2lkICopJmZtb2QsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQsIGZsb2F0KSIgfSwKLSAgICB7ICJhYnMiLCAodm9pZCAqKSZhYnMsCi0gICAgICAgICJpbnQiLCAiKGludCkiIH0sCi0gICAgeyAiYWJzZiIsICh2b2lkICopJmZhYnNmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJzaW5mX2Zhc3QiLCAodm9pZCAqKSZTQ19zaW5mX2Zhc3QsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImNvc2ZfZmFzdCIsICh2b2lkICopJlNDX2Nvc2ZfZmFzdCwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAic2luZiIsICh2b2lkICopJnNpbmYsCi0gIC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sCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImxvZ2YiLCAodm9pZCAqKSZsb2dmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJwb3dmIiwgKHZvaWQgKikmcG93ZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCwgZmxvYXQpIiB9LAotICAgIHsgIm1heGYiLCAodm9pZCAqKSZTQ19tYXhmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0LCBmbG9hdCkiIH0sCi0gICAgeyAibWluZiIsICh2b2lkICopJlNDX21pbmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQsIGZsb2F0KSIgfSwKLSAgICB7ICJzcXJ0IiwgKHZvaWQgKikmc3FydCwKLSAgICAgICAgImludCIsICIoaW50KSIgfSwKLSAgICB7ICJzcXJ0ZiIsICh2b2lkICopJnNxcnRmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJzcXIiLCAodm9pZCAqKSZTQ19zcXIsCi0gICAgICAgICJpbnQiLCAiKGludCkiIH0sCi0gICAgeyAic3FyZiIsICh2b2lkICopJlNDX3NxcmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgInNpZ24iLCAodm9pZCAqKSZTQ19zaWduLAotICAgICAgICAiaW50IiwgIihpbnQpIiB9LAotICAgIHsgInNpZ25mIiwgKHZvaWQgKikmU0Nfc2lnbmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImNsYW1wIiwgKHZvaWQgKikmU0NfY2xhbXAsCi0gICAgICAgICJpbnQiLCAiKGludCwgaW50LCBpbnQpIiB9LAotICAgIHsgImNsYW1wZiIsICh2b2lkICopJlNDX2NsYW1wZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCwgZmxvYXQsIGZsb2F0KSIgfSwKLSAgICB7ICJkaXN0ZjIiLCAodm9pZ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9IGEgICMgc2lnbmVkIGNoYXIKKy8vICAgICAgICAgICAgICAgICA6Oj0gaCAgIyB1bnNpZ25lZCBjaGFyCisvLyAgICAgICAgICAgICAgICAgOjo9IHMgICMgc2hvcnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gdCAgIyB1bnNpZ25lZCBzaG9ydAorLy8gICAgICAgICAgICAgICAgIDo6PSBpICAjIGludAorLy8gICAgICAgICAgICAgICAgIDo6PSBqICAjIHVuc2lnbmVkIGludAorLy8gICAgICAgICAgICAgICAgIDo6PSBsICAjIGxvbmcKKy8vICAgICAgICAgICAgICAgICA6Oj0gbSAgIyB1bnNpZ25lZCBsb25nCisvLyAgICAgICAgICAgICAgICAgOjo9IHggICMgbG9uZyBsb25nLCBfX2ludDY0CisvLyAgICAgICAgICAgICAgICAgOjo9IHkgICMgdW5zaWduZWQgbG9uZyBsb25nLCBfX2ludDY0CisvLyAgICAgICAgICAgICAgICAgOjo9IGYgICMgZmxvYXQKKy8vICAgICAgICAgICAgICAgICA6Oj0gZCAgIyBkb3VibGUKKworc3RhdGljIFNjcmlwdENTdGF0ZTo6U3ltYm9sVGFibGVfdCBnU3ltc1tdID0geworICAgIC8vIE9wZW5DTCBtYXRoCisgICAgeyAiX1o0YWNvc2YiLCAodm9pZCAqKSZhY29zZiwgdHJ1ZSB9LAorICAgIHsgIl9aNWFjb3NoZiIsICh2b2lkICopJmFjb3NoZiwgdHJ1ZSB9LAorICAgIHsgIl9aNmFjb3NwaWYiLCAodm9pZCAqKSZTQ19hY29zcGksIHRydWUgfSwKKyAgICB7ICJfWjRhc2luZiIsICh2b2lkICopJmFzaW5mLCB0cnVlIH0sCisgICAgeyAiX1o1YXNpbmhmIiwgKHZvaWQgKikmYXNpbmhmLCB0cnVlIH0sCisgICAgeyAiX1o2YXNpbnBpZiIsICh2b2lkICopJlNDX2FzaW5waSwgdHJ1ZSB9LAorICAgIHsgIl9aNGF0YW5mIiwgKHZvaWQgKikmYXRhbmYsIHRydWUgfSwKK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y8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKworc3RhdGljIHZvaWQgU0NfZHJhd1F1YWRUZXhDb29yZHMoZmxvYXQgeDEsIGZsb2F0IHkxLCBmbG9hdCB6MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUxLCBmbG9hdCB2MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgyLCBmbG9hdCB5MiwgZmxvYXQgejIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MiwgZmxvYXQgdjIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MywgZmxvYXQgeTMsIGZsb2F0IHozLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTMsIGZsb2F0IHYzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDQsIGZsb2F0IHk0LCBmbG9hdCB6NCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHU0LCBmbG9hdCB2NCkKK3sKKyAgICBHRVRfVExTKCk7CisgICAgaWYgKCFyc2MtPnNldHVwQ2hlY2soKSkgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLy9MT0dFKCJRdWFkIik7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDEsIHkxLCB6MSk7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDIsIHkyLCB6Mik7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDMsIHkzLCB6Myk7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDQsIHk0LCB6NCk7CisKKyAgICBmbG9hdCB2dHhbXSA9IHt4MSx5MSx6MSwgeDIseTIsejIsIHgzLHkzLHozLCB4NCx5NCx6NH07CisgICAgY29uc3QgZmxvYXQgdGV4W10gPSB7dTEsdjEsIHUyLHYyLCB1Myx2MywgdTQsdjR9OworCisgICAgVmVydGV4QXJyYXkgdmE7CisgICAgdmEuYWRkKEdMX0ZMT0FULCAzLCAxMiwgZmFsc2UsICh1aW50MzJfdCl2dHgsICJBVFRSSUJfcG9zaXRpb24iKTsKKyAgICB2YS5hZGQoR0xfRkxPQVQsIDIsIDgsIGZhbHNlLCAodWludDMyX3QpdGV4LCAiQVRUUklCX3RleHR1cmUwIik7CisgICAgdmEuc2V0dXBHTDIocnNjLCAmcnNjLT5tU3RhdGVWZXJ0ZXhBcnJheSwgJnJzYy0+bVNoYWRlckNhY2hlKTsKKworICAgIGdsRHJhd0FycmF5cyhHTF9UUklBTkdMRV9GQU4sIDAsIDQpOworfQorCitzdGF0aWMgdm9pZCBTQ19kcmF3UXVhZChmbG9hdCB4MSwgZmxvYXQgeTEsIGZsb2F0IHoxLAorICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDIsIGZsb2F0IHkyLCBmbG9hdCB6MiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgzLCBmbG9hdCB5MywgZmxvYXQgejMsCisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4NCwgZmxvYXQgeTQsIGZsb2F0IHo0KQoreworICAgIFNDX2RyYXdRdWFkVGV4Q29vcmRzKHgxLCB5MSwgejEsIDAsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgeDIsIHkyLCB6MiwgMSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4MywgeTMsIHozLCAxLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgIHg0LCB5NCwgejQsIDAsIDApOworfQorCitzdGF0aWMgdm9pZCBTQ19kcmF3U3ByaXRlU2NyZWVuc3BhY2UoZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeiwgZmxvYXQgdywgZmxvY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uZGVyKHJzYyk7Cit9CisKK3N0YXRpYyB2b2lkIFNDX2RyYXdNZXNoUHJpbWl0aXZlKFJzTWVzaCB2c20sIHVpbnQzMl90IHByaW1JbmRleCkKK3sKKyAgICBDSEVDS19PQkoodnNtKTsKKyAgICBHRVRfVExTKCk7CisgICAgTWVzaCAqc20gPSBzdGF0aWNfY2FzdDxNZXNoICo+KHZzbSk7CisgICAgaWYgKCFyc2MtPnNldHVwQ2hlY2soKSkgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHNtLT5yZW5kZXJQcmltaXRpdmUocnNjLCBwcmltSW5kZXgpOworfQorCitzdGF0aWMgdm9pZCBTQ19kcmF3TWVzaFByaW1pdGl2ZVJhbmdlKFJzTWVzaCB2c20sIHVpbnQzMl90IHByaW1JbmRleCwgdWludDMyX3Qgc3RhcnQsIHVpbnQzMl90IGxlbikKK3sKKyAgICBDSEVDS19PQkoodnNtKTsKKyAgICBHRVRfVExTKCk7CisgICAgTWVzaCAqc20gPSBzdGF0aWNfY2FzdDxNZXNoICo+KHZzbSk7CisgICAgaWYgKCFyc2MtPnNldHVwQ2hlY2soKSkgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHNtLT5yZW5kZXJQcmltaXRpdmVSYW5nZShyc2MsIHByaW1JbmRleCwgc3RhcnQsIGxlbik7Cit9CisKK3N0YXRpYyB2b2lkIFNDX21lc2hDb21wdXRlQm91bmRpbmdCb3goUnNNZXNoIHZzbSwgZmxvYXQgKm1pblgsIGZsb2F0ICptaW5ZLCBmbG9hdCAqbWluWiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgKm1heFgsIGZsb2F0ICptYXhZLCBmbG9hdCAqbWF4WikKK3sKKyAgICBDSEVDS19PQkoodnNtKTsKKyAgICBHRVRfVExTKCk7CisgICAgTWVzaCAqc20gPSBzdGF0aWNfY2FzdDxNZXNoICo+KHZzbSk7CisgICAgc20tPmNvbXB1dGVC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jYXN0PEFsbG9jYXRpb24gKj4odmEpOworICAgIGNvbnN0IGNoYXIgKnRleHQgPSAoY29uc3QgY2hhciAqKWFsbG9jLT5nZXRQdHIoKTsKKyAgICBzaXplX3QgYWxsb2NTaXplID0gYWxsb2MtPmdldFR5cGUoKS0+Z2V0U2l6ZUJ5dGVzKCk7CisgICAgcnNjLT5tU3RhdGVGb250LnJlbmRlclRleHQodGV4dCwgYWxsb2NTaXplLCB4LCB5KTsKK30KKworc3RhdGljIHZvaWQgU0NfRHJhd1RleHQoY29uc3QgY2hhciAqdGV4dCwgaW50IHgsIGludCB5KQoreworICAgIEdFVF9UTFMoKTsKKyAgICBzaXplX3QgdGV4dExlbiA9IHN0cmxlbih0ZXh0KTsKKyAgICByc2MtPm1TdGF0ZUZvbnQucmVuZGVyVGV4dCh0ZXh0LCB0ZXh0TGVuLCB4LCB5KTsKK30KKworc3RhdGljIHZvaWQgU0Nfc2V0TWV0cmljcyhGb250OjpSZWN0ICptZXRyaWNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMl90ICpsZWZ0LCBpbnQzMl90ICpyaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCAqdG9wLCBpbnQzMl90ICpib3R0b20pCit7CisgICAgaWYobGVmdCkgeworICAgICAgICAqbGVmdCA9IG1ldHJpY3MtPmxlZnQ7CisgICAgfQorICAgIGlmKHJpZ2h0KSB7CisgICAgICAgICpyaWdodCA9IG1ldHJpY3MtPnJpZ2h0OworICAgIH0KKyAgICBpZih0b3ApIHsKKyAgICAgICAgKnRvcCA9IG1ldHJpY3MtPnRvcDsKKyAgICB9CisgICAgaWYoYm90dG9tKSB7CisgICAgICAgICpib3R0b20gPSBtZXRyaWNzLT5ib3R0b207CisgICAgfQorfQorCitzdGF0aWMgdm9pZCBTQ19NZWFzdXJlVGV4dEFsbG9jKFJzQWxsb2NhdGlvbiB2YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCAqbGVmdCwgaW50MzJfdCAqcmlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgKnRvcCwgaW50MzJfdCAqYm90dG9tKQoreworICAgIENIRUNLX09CSih2YSk7CisgICAgR0VUX1RMUygpOworICAgIEFsbG9jYXRpb24gKmFsbG9jID0gc3RhdGljX2Nhc3Q8QWxsb2NhdGlvbiAqPih2YSk7CisgICAgY29uc3QgY2hhciAqdGV4dCA9IChjb25zdCBjaGFyICopYWxsb2MtPmdldFB0cigpOworICAgIHNpemVfdCB0ZXh0TGVuID0gYWxsb2MtPmdldFR5cGUoKS0+Z2V0U2l6ZUJ5dGVzKCk7CisgICAgRm9udDo6UmVjdCBtZXRyaWNzOworICAgIHJzYy0+bVN0YXRlRm9udC5tZWFzdXJlVGV4dCh0ZXh0LCB0ZXh0TGVuLCAmbWV0cmljcyk7CisgICAgU0Nfc2V0TWV0cmljcygmbWV0cmljcywgbGVmdCwgcmlnaHQsIHRvcCwgYm90dG9tKTsKK30KKworc3RhdGljIHZvaWQgU0NfTWVhc3VyZVRleHQoY29uc3QgY2hhciAqdGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgKmxlZnQsIGludDMyX3QgKnJpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCAqdG9wLCBpbnQzMl90ICpib3R0b20pCit7CisgICAgR0VUX1RMUygpOworICAgIHNpemVfdCB0ZXh0TGVuID0gc3RybGVuKHRleHQpOworICAgIEZvbnQ6OlJlY3QgbWV0cmljczsKKyAgICByc2MtPm1TdGF0ZUZvbnQubWVhc3VyZVRleHQodGV4dCwgdGV4dExlbiwgJm1ldHJpY3MpOworICAgIFNDX3NldE1ldHJpY3MoJm1ldHJpY3MsIGxlZnQsIHJpZ2h0LCB0b3AsIGJvdHRvbSk7Cit9CisKK3N0YXRpYyB2b2lkIFNDX0JpbmRGb250KFJzRm9udCBmb250KQoreworICAgIENIRUNLX09CSihmb250KTsKKyAgICBHRVRfVExTKCk7CisgICAgcnNpX0NvbnRleHRCaW5kRm9udChyc2MsIGZvbnQpOworfQorCitzdGF0aWMgdm9pZCBTQ19Gb250Q29sb3IoZmxvYXQgciwgZmxvYXQgZywgZmxvYXQgYiwgZmxvYXQgYSkKK3sKKyAgICBHRVRfVExTKCk7CisgICAgcnNjLT5tU3RhdGVGb250LnNldEZvbnRDb2xvcihyLCBnLCBiLCBhKTsKK30KKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLyBDbGFzcyBpbXBsZW1lbnRhdGlvbgorLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKKy8vIGxsdm0gbmFtZSBtYW5nbGluZyByZWYKKy8vICA8YnVpbHRpbi10eXBlPiA6Oj0gdiAgIyB2b2lkCisvLyAgICAgICAgICAgICAgICAgOjo9IGIgICMgYm9vbAorLy8gICAgICAgICAgICAgICAgIDo6PSBjICAjIGNoYXIKKy8vICAgICAgICAgICAgICAgICA6Oj0gYSAgIyBzaWduZWQgY2hhcgorLy8gICAgICAgICAgICAgICAgIDo6PSBoICAjIHVuc2lnbmVkIGNoYXIKKy8vICAgICAgICAgICAgICAgICA6Oj0gcyAgIyBzaG9ydAorLy8gICAgICAgICAgICAgICAgIDo6PSB0ICAjIHVuc2lnbmVkIHNob3J0CisvLyAgICAgICAgICAgICAgICAgOjo9IGkgICMgaW50CisvLyAgICAgICAgICAgICAgICAgOjo9IGogICMgdW5zaWduZWQgaW50CisvLyAgICAgICAgICAgICAgICAgOjo9IGwgICMgbG9uZworLy8gICAgICAgICAgICAgICAgIDo6PSBtICAjIHVuc2lnbmVkIGxvbmcKKy8vICAgICAgICAgICAgICAgICA6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1aW50MzJfdCBjdCA9IDA7IGN0IDwgZW50cnlDb3VudDsgY3QgKyspIHsKKyAgICAgICAgaWYgKChtRW50cmllc1tjdF0tPnZ0eCA9PSB2dHgtPmdldFNoYWRlcklEKCkpICYmCisgICAgICAgICAgICAobUVudHJpZXNbY3RdLT5mcmFnID09IGZyYWctPmdldFNoYWRlcklEKCkpKSB7CiAKLSAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgbUVudHJ5Q291bnQ7IGN0KyspIHsKLSAgICAgICAgaWYgKChtRW50cmllc1tjdF0udnR4ID09IHZ0eC0+Z2V0U2hhZGVySUQoKSkgJiYKLSAgICAgICAgICAgIChtRW50cmllc1tjdF0uZnJhZyA9PSBmcmFnLT5nZXRTaGFkZXJJRCgpKSkgewotCi0gICAgICAgICAgICAvL0xPR1YoIlNDIHVzaW5nIHByb2dyYW0gJWkiLCBtRW50cmllc1tjdF0ucHJvZ3JhbSk7Ci0gICAgICAgICAgICBnbFVzZVByb2dyYW0obUVudHJpZXNbY3RdLnByb2dyYW0pOwotICAgICAgICAgICAgbUN1cnJlbnQgPSAmbUVudHJpZXNbY3RdOworICAgICAgICAgICAgLy9MT0dWKCJTQyB1c2luZyBwcm9ncmFtICVpIiwgbUVudHJpZXNbY3RdLT5wcm9ncmFtKTsKKyAgICAgICAgICAgIGdsVXNlUHJvZ3JhbShtRW50cmllc1tjdF0tPnByb2dyYW0pOworICAgICAgICAgICAgbUN1cnJlbnQgPSBtRW50cmllc1tjdF07CiAgICAgICAgICAgICAvL0xPR1YoIlNoYWRlckNhY2hlIGhpdCwgdXNpbmcgJWkiLCBjdCk7CiAgICAgICAgICAgICByc2MtPmNoZWNrRXJyb3IoIlNoYWRlckNhY2hlOjpsb29rdXAgKGhpdCkiKTsKICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9CiAgICAgfQotICAgIC8vIE5vdCBpbiBjYWNoZSwgYWRkIGl0LgogCi0gICAgaWYgKG1FbnRyeUFsbG9jY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VudCsrOwogICAgIHJzYy0+Y2hlY2tFcnJvcigiU2hhZGVyQ2FjaGU6Omxvb2t1cCAobWlzcykiKTsKICAgICByZXR1cm4gdHJ1ZTsKIH0KIAoraW50MzJfdCBTaGFkZXJDYWNoZTo6dnR4QXR0cmliU2xvdChjb25zdCBTdHJpbmc4ICZhdHRyTmFtZSkgY29uc3QgeworICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBtQ3VycmVudC0+dnR4QXR0ckNvdW50OyBjdCsrKSB7CisgICAgICAgIGlmKGF0dHJOYW1lID09IG1DdXJyZW50LT5tVnR4QXR0cmliTmFtZXNbY3RdKSB7CisgICAgICAgICAgICByZXR1cm4gbUN1cnJlbnQtPm1WdHhBdHRyaWJTbG90c1tjdF07CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIC0xOworfQorCiB2b2lkIFNoYWRlckNhY2hlOjpjbGVhbnVwVmVydGV4KHVpbnQzMl90IGlkKQogeworICAgIGludDMyX3QgbnVtRW50cmllcyA9IChpbnQzMl90KW1FbnRyaWVzLnNpemUoKTsKKyAgICBmb3IoaW50MzJfdCBjdCA9IDA7IGN0IDwgbnVtRW50cmllczsgY3QgKyspIHsKKyAgICAgICAgaWYgKG1FbnRyaWVzW2N0XS0+dnR4ID09IGlkKSB7CisgICAgICAgICAgICBnbERlbGV0ZVByb2dyYW0obUVudHJpZXNbY3RdLT5wcm9ncmFtKTsKKworICAgICAgICAgICAgZnJlZShtRW50cmllc1tjdF0pOworICAgICAgICAgICAgbUVudHJpZXMucmVtb3ZlQXQoY3QpOworICAgICAgICAgICAgbnVtRW50cmllcyA9IChpbnQzMl90KW1FbnRyaWVzLnNpemUoKTsKKyAgICAgICAgICAgIGN0IC0tOworICAgICAgICB9CisgICAgfQogfQogCiB2b2lkIFNoYWRlckNhY2hlOjpjbGVhbnVwRnJhZ21lbnQodWludDMyX3QgaWQpCiB7CisgICAgaW50MzJfdCBudW1FbnRyaWVzID0gKGludDMyX3QpbUVudHJ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GUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworI2luY2x1ZGUgInJzU2lnbmFsLmgiCisKK3VzaW5nIG5hbWVzcGFjZSBhbmRyb2lkOwordXNpbmcgbmFtZXNwYWNlIGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDsKKworCitTaWduYWw6OlNpZ25hbCgpCit7CisgICAgbVNldCA9IHRydWU7Cit9CisKK1NpZ25hbDo6flNpZ25hbCgpCit7CisgICAgcHRocmVhZF9tdXRleF9kZXN0cm95KCZtTXV0ZXgpOworICAgIHB0aHJlYWRfY29uZF9kZXN0cm95KCZtQ29uZGl0aW9uKTsKK30KKworYm9vbCBTaWduYWw6OmluaXQoKQoreworICAgIGludCBzdGF0dXMgPSBwdGhyZWFkX211dGV4X2luaXQoJm1NdXRleCwgTlVMTCk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJMb2NrbGVzc0ZpZm8gbXV0ZXggaW5pdCBmYWlsdXJlIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBzdGF0dXMgPSBwdGhyZWFkX2NvbmRfaW5pdCgmbUNvbmRpdGlvbiwgTlVMTCk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJMb2NrbGVzc0ZpZm8gY29uZGl0aW9uIGluaXQgZmFpbHVyZSIpOworICAgICAgICBwdGhyZWFkX211dGV4X2Rlc3Ryb3koJm1NdXRleCk7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICByZXR1cm4gdHJ1ZTsKK30KKwordm9pZCBTaWduYWw6OnNldCgpCit7CisgICAgaW50IHN0YXR1czsKKworICAgIHN0YXR1cyA9IHB0aHJlYWRfbXV0ZXhfbG9jaygmbU11dGV4KTsKKyAgICBpZiAoc3RhdHVzKSB7CisgICAgICAgIExPR0UoIkxvY2tsZXNzQ29tbWFuZEZpZm86IGVycm9yICVpIGxvY2tpbmcgZm9yIHNldCBjb25kaXRpb24uIiwgc3RhdHVzKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIG1TZXQgPSB0cnVlOworCisgICAgc3RhdHVzID0gcHRocmVhZF9jb25kX3NpZ25hbCgmbUNvbmRpdGlvbik7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJMb2NrbGVzc0NvbW1hbmRGaWZvOiBlcnJvciAlaSBvbiBzZXQgY29uZGl0aW9uLiIsIHN0YXR1cyk7CisgICAgfQorCisgICAgc3RhdHVzID0gcHRocmVhZF9tdXRleF91bmxvY2soJm1NdXRleCk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJMb2NrbGVzc0NvbW1hbmRGaWZvOiBlcnJvciAlaSB1bmxvY2tpbmcgZm9yIHNldCBjb25kaXRpb24uIiwgc3RhdHVzKTsKKyAgICB9Cit9CisKK3ZvaWQgU2lnbmFsOjp3YWl0KCkKK3sKKyAgICBpbnQgc3RhdHVzOworCisgICAgc3RhdHVzID0gcHRocmVhZF9tdXRleF9sb2NrKCZtTXV0ZXgpOworICAgIGlmIChzdGF0dXMpIHsKKyAgICAgICAgTE9HRSgiTG9ja2xlc3NDb21tYW5kRmlmbzogZXJyb3IgJWkgbG9ja2luZyBmb3IgY29uZGl0aW9uLiIsIHN0YXR1cyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAoIW1TZXQpIHsKKyAgICAgICAgc3RhdHVzID0gcHRocmVhZF9jb25kX3dhaXQoJm1Db25kaXRpb24sICZtTXV0ZXgpOworICAgICAgICBpZiAoc3RhdHVzKSB7CisgICAgICAgICAgICBMT0dFKCJMb2NrbGVzc0NvbW1hbmRGaWZvOiBlcnJvciAlaSB3YWl0aW5nIG9uIGNvbmRpdGlvbi4iLCBzdGF0dXMpOworICAgICAgICB9CisgICAgfQorICAgIG1TZXQg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AofjcpOworICAgICAgICB0bXAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IHVpbnQ2NF90ICo+KCZtRGF0YVttUG9zXSlbMF07CisgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKHVpbnQ2NF90KTsKKyAgICAgICAgcmV0dXJuIHRtcDsKKyAgICB9CisgICAgcmV0dXJuIGxvYWRVMzIoKTsKK30KKwordm9pZCBJU3RyZWFtOjpsb2FkU3RyaW5nKFN0cmluZzggKnMpCit7CisgICAgdWludDMyX3QgbGVuID0gbG9hZFUzMigpOworICAgIHMtPnNldFRvKChjb25zdCBjaGFyICopJm1EYXRhW21Qb3NdLCBsZW4pOworICAgIG1Qb3MgKz0gbGVuOworfQorCisKKy8vIE91dHB1dCBzdHJlYW0gaW1wbGVtZW50YXRpb24KKworT1N0cmVhbTo6T1N0cmVhbSh1aW50NjRfdCBsZW4sIGJvb2wgdXNlNjQpCit7CisgICAgbURhdGEgPSAodWludDhfdCopbWFsbG9jKGxlbik7CisgICAgbUxlbmd0aCA9IGxlbjsKKyAgICBtUG9zID0gMDsKKyAgICBtVXNlNjQgPSB1c2U2NDsKK30KKworT1N0cmVhbTo6fk9TdHJlYW0oKQoreworICAgIGZyZWUobURhdGEpOworfQorCit2b2lkIE9TdHJlYW06OmFkZEJ5dGVBcnJheShjb25zdCB2b2lkICpzcmMsIHNpemVfdCBudW1CeXRlcykKK3sKKyAgICAvLyBXZSBuZWVkIHRvIHBvdGVudGlhbGx5IGdyb3cgbW9yZSB0aGFuIG9uY2UgaWYgdGhlIG51bWJlciBvZiBieWVzIHdlIHdyaXRlIGlzIHN1YnN0YW50aWFsCisgICAgd2hpbGUobVBvcyArIG51bUJ5dGVzID49IG1MZW5ndGgpIHsKKyAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICB9CisgICAgbWVtY3B5KG1EYXRhICsgbVBvcywgc3JjLCBudW1CeXRlcyk7CisgICAgbVBvcyArPSBudW1CeXRlczsKK30KKwordm9pZCBPU3RyZWFtOjphZGRPZmZzZXQodWludDY0X3QgdikKK3sKKyAgICBpZiAobVVzZTY0KSB7CisgICAgICAgIG1Qb3MgPSAobVBvcyArIDcpICYgKH43KTsKKyAgICAgICAgaWYobVBvcyArIHNpemVvZih2KSA+PSBtTGVuZ3RoKSB7CisgICAgICAgICAgICBncm93U2l6ZSgpOworICAgICAgICB9CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkodiAmIDB4ZmYpOworICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKCh2ID4+IDgpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMTYpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMjQpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMzIpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNDApICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNDgpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNTYpICYgMHhmZik7CisgICAgfQorICAgIGVsc2UgeworICAgICAgICBhZGRVMzIodik7CisgICAgfQorfQorCit2b2lkIE9TdHJlYW06OmFkZFN0cmluZyhTdHJpbmc4ICpzKQoreworICAgIHVpbnQzMl90IGxlbiA9IHMtPnNpemUoKTsKKyAgICBhZGRVMzIobGVuKTsKKyAgICBpZihtUG9zICsgbGVuKnNpemVvZihjaGFyKSA+PSBtTGVuZ3RoKSB7CisgICAgICAgIGdyb3dTaXplKCk7CisgICAgfQorICAgIGNoYXIgKnN0cmluZ0RhdGEgPSByZWludGVycHJldF9jYXN0PGNoYXIgKj4oJm1EYXRhW21Qb3NdKTsKKyAgICBmb3IodWludDMyX3Qga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ID0gKG1Qb3MgKyAzKSAmICh+Myk7CisgICAgICAgIGludDMyX3QgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCBpbnQzMl90ICo+KCZtRGF0YVttUG9zXSlbMF07CisgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKGludDMyX3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICB1aW50MzJfdCBsb2FkVTMyKCkgeworICAgICAgICBtUG9zID0gKG1Qb3MgKyAzKSAmICh+Myk7CisgICAgICAgIHVpbnQzMl90IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDMyX3QgKj4oJm1EYXRhW21Qb3NdKVswXTsKKyAgICAgICAgbVBvcyArPSBzaXplb2YodWludDMyX3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICB1aW50MTZfdCBsb2FkVTE2KCkgeworICAgICAgICBtUG9zID0gKG1Qb3MgKyAxKSAmICh+MSk7CisgICAgICAgIHVpbnQxNl90IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDE2X3QgKj4oJm1EYXRhW21Qb3NdKVswXTsKKyAgICAgICAgbVBvcyArPSBzaXplb2YodWludDE2X3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICBpbmxpbmUgdWludDhfdCBsb2FkVTgoKSB7CisgICAgICAgIHVpbnQ4X3QgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90ICo+KCZtRGF0YVttUG9zXSlbMF07CisgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKHVpbnQ4X3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICB2b2lkIGxvYWRCeXRlQXJyYXkodm9pZCAqZGVzdCwgc2l6ZV90IG51bUJ5dGVzKTsKKyAgICB1aW50NjRfdCBsb2FkT2Zmc2V0KCk7CisgICAgdm9pZCBsb2FkU3RyaW5nKFN0cmluZzggKnMpOworICAgIHVpbnQ2NF90IGdldFBvcygpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIG1Qb3M7CisgICAgfQorICAgIHZvaWQgcmVzZXQodWludDY0X3QgcG9zKSB7CisgICAgICAgIG1Qb3MgPSBwb3M7CisgICAgfQorICAgIHZvaWQgcmVzZXQoKSB7CisgICAgICAgIG1Qb3MgPSAwOworICAgIH0KKyAgICAKKyAgICBjb25zdCB1aW50OF90ICogZ2V0UHRyKCkgY29uc3QgeworICAgICAgICByZXR1cm4gbURhdGE7CisgICAgfQorcHJvdGVjdGVkOgorICAgIGNvbnN0IHVpbnQ4X3QgKiBtRGF0YTsKKyAgICB1aW50NjRfdCBtUG9zOworICAgIGJvb2wgbVVzZTY0OworfTsKKworY2xhc3MgT1N0cmVhbQoreworcHVibGljOgorICAgIE9TdHJlYW0odWludDY0X3QgbGVuZ3RoLCBib29sIHVzZTY0KTsKKyAgICB+T1N0cmVhbSgpOworICAgIAorICAgIHZvaWQgYWxpZ24odWludDMyX3QgYnl0ZXMpIHsKKyAgICAgICAgbVBvcyA9IChtUG9zICsgKGJ5dGVzIC0gMSkpICYgKH4oYnl0ZXMgLSAxKSk7CisgICAgICAgIGlmKG1Qb3MgPj0gbUxlbmd0aCkgeworICAgICAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIGFkZEYoZmxvYXQgdikgeworICAgICAgICB1aW50MzJfdCB1aW50ViA9ICpyZWludGVycHJldF9jYXN0PHVpbnQzMl90Kj4gKCZ2KTsKKyAgICAgICAgYWRkVTMyKHVpbnRWKTsKKyAgICB9CisgICAgdm9pZCBhZGRJMzIoaW50MzJfdCB2KSB7CisgICAgICAgIG1Qb3MgPSAobVBvcyArIDMpICYgKH4zKTsKKyAgICAgICAgaWYobVBvcyArIHNpemVvZih2KSA+PSBtTGVuZ3RoKSB7CisgICAgICAgICAgICBncm93U2l6ZSgpOworICAgICAgICB9CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkodiAmIDB4ZmYpOworICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKCh2ID4+IDgpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMTYpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMjQpICYgMHhmZik7CisgICAgfQorICAgIHZvaWQgYWRkVTMyKHVpbnQzMl90IHYpIHsKKyAgICAgICAgbVBvcyA9IChtUG9zICsgMykgJiAofjMpOworICAgICAgICBpZihtUG9zICsgc2l6ZW9mKHYpID49IG1MZW5ndGgpIHsKKyAgICAgICAgICAgIGdyb3dTaXplKCk7CisgICAgICAgIH0KKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSh2ICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gOCkgJiAweGZmKTsKKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSgodiA+PiAxNikgJiAweGZmKTsKKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSgodiA+PiAyNCkgJiAweGZmKTsKKyAgICB9CisgICAgdm9pZCBhZGRVMTYodWludDE2X3QgdikgeworICAgICAgICBtUG9zID0gKG1Qb3MgKyAxKSAmICh+MSk7CisgICAgICAgIGlmKG1Qb3MgKyBzaXplb2YodikgPj0gbUxlbmd0aCkgeworICAgICAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICAgICAgfQorICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKHYgJiAweGZmKTsKKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSh2ID4+IDgpOworICAgIH0KKyAgICBpbmxpbmUgdm9pZCBhZGRVOCh1aW50OF90IHYpIHsKKyAgICAgICAgaWYobVBvcyArIDEgPj0gbUxlbmd0aCkgeworICAgICAgIC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WN0b3JTaXplKCk7Ci0gICAgICAgICAgICBtR0wubVBvaW50U2l6ZS5vZmZzZXQgPSBtRWxlbWVudC0+Z2V0RmllbGRPZmZzZXRCeXRlcyhjdCk7Ci0gICAgICAgICAgICBtR0wubVBvaW50U2l6ZS50eXBlID0gYy5nZXRHTFR5cGUoKTsKLSAgICAgICAgICAgIG1HTC5tUG9pbnRTaXplLm5vcm1hbGl6ZWQgPSBmYWxzZTsKLSAgICAgICAgICAgIG1HTC5tUG9pbnRTaXplLm5hbWUuc2V0VG8oIlBvaW50U2l6ZSIpOwotICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgYnJlYWs7CisgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IG1FbGVtZW50LT5nZXRGaWVsZENvdW50KCk7IGN0KyspIHsKKyAgICAgICAgaWYoaXNWYWxpZEdMQ29tcG9uZW50KGN0KSkgeworICAgICAgICAgICAgbUF0dHJpYnNTaXplICsrOwogICAgICAgICB9CiAgICAgfQorICAgIGlmKG1BdHRyaWJzKSB7CisgICAgICAgIGRlbGV0ZSBbXSBtQXR0cmliczsKKyAgICAgICAgbUF0dHJpYnMgPSBOVUxMOworICAgIH0KKyAgICBpZihtQXR0cmlic1NpemUpIHsKKyAgICAgICAgbUF0dHJpYnMgPSBuZXcgVmVydGV4QXJyYXk6OkF0dHJpYlttQXR0cmlic1NpemVdOworICAgIH0KKworICAgIHVpbnQzMl90IHVzZXJOdW0gPSAwOworICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBtRWxlbWVudC0+Z2V0RmllbGRDb3VudCgpOyBjdCsrKSB7CisgICAgICAgIGNvbnN0IENvbXBvbmVudCAmYyA9IG1FbGVtZW50LT5nZXRGaWVsZChjdCktPmdldENvbXBvbmVudCgpOworCisgICAgICAgIGlmKCFpc1ZhbGlkR0xDb21wb25lbnQoY3QpKSB7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCisgICAg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zaXplKSB7Ci0gICAgICAgIHZhLT5hZGRMZWdhY3kobUdMLm1WdHgudHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICBtR0wubVZ0eC5zaXplLAotICAgICAgICAgICAgICAgICAgICAgIHN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgICBSU19LSU5EX1BPU0lUSU9OLAotICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgIG1HTC5tVnR4Lm9mZnNldCk7Ci0gICAgfQotCi0gICAgaWYgKG1HTC5tTm9ybS5zaXplKSB7Ci0gICAgICAgIHZhLT5hZGRMZWdhY3kobUdMLm1Ob3JtLnR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAzLAotICAgICAgICAgICAgICAgICAgICAgc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgUlNfS0lORF9OT1JNQUwsCi0gICAgICAgICAgICAgICAgICAgICBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgIG1HTC5tTm9ybS5vZmZzZXQpOwotICAgIH0KLQotICAgIGlmIChtR0wubUNvbG9yLnNpemUpIHsKLSAgICAgICAgdmEtPmFkZExlZ2FjeShtR0wubUNvbG9yLnR5cGUsCi0gICAgICAgICAgICAgICAgICAgICBtR0wubUNvbG9yLnNpemUsCi0gICAgICAgICAgICAgICAgICAgICBzdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICBSU19LSU5EX0NPTE9SLAotICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwKLSAgICAgICAgICAgICAgICAgICAgIG1HTC5tQ29sb3Iub2Zmc2V0KTsKLSAgICB9Ci0KLSAgICBpZiAobUdMLm1UZXguc2l6ZSkgewotICAgICAgICB2YS0+YWRkTGVnYWN5KG1HTC5tVGV4LnR5cGUsCi0gICAgICAgICAgICAgICAgICAgICBtR0wubVRleC5zaXplLAotICAgICAgICAgICAgICAgICAgICAgc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgUlNfS0lORF9URVhUVVJFLAotICAgICAgICAgICAgICAgICAgICAgZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICBtR0wubVRleC5vZmZzZXQpOwotICAgIH0KLQotICAgIGlmIChtR0wubVBvaW50U2l6ZS5zaXplKSB7Ci0gICAgICAgIHZhLT5hZGRMZWdhY3kobUdMLm1Qb2ludFNpemUudHlwZSwKLSAgICAgICAgICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgICAgICAgICBzdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICBSU19LSU5EX1BPSU5UX1NJWkUsCi0gICAgICAgICAgICAgICAgICAgICBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgIG1HTC5tUG9pbnRTaXplLm9mZnNldCk7Ci0gICAgfQotCi19Ci0KLXZvaWQgVHlwZTo6ZW5hYmxlR0xWZXJ0ZXhCdWZmZXIyKFZlcnRleEFycmF5ICp2YSkgY29uc3QKLXsKLSAgICAvLyBEbyBsZWdhY3kgYnVmZmVycwotICAgIGVuYWJsZUdMVmVydGV4QnVmZmVyKHZhKTsKLQotICAgIHVpbnQzMl90IHN0cmlkZSA9IG1FbGVtZW50LT5nZXRTaXplQnl0ZXMoKTsKLSAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgUlNfTUFYX0FUVFJJQlM7IGN0KyspIHsKLSAgICAgICAgaWYgKG1HTC5tVXNlcltjdF0uc2l6ZSkgewotICAgICAgICAgICAgdmEtPmFkZFVzZXIobUdMLm1Vc2VyW2N0XSwgc3RyaWRlKTsKKyAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgbUF0dHJpYnNTaXplOyBjdCsrKSB7CisgICAgICAgIC8vIExvYWQgdXAgdG8gUlNfTUFYX0FUVFJJQlMgaW5wdXRzCisgICAgICAgIC8vIFRPRE86IGdyb3cgdmVydGV4YXJyYXkgZHluYW1pY2FsbHkKKyAgICAgICAgaWYoY3QgPj0gUlNfTUFYX0FUVFJJQlMpIHsKKyAgICAgICAgICAgIExPR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VgoKSA9PSBtRGltWCAmJgorICAgICAgICBvdGhlci0+Z2V0RGltWSgpID09IG1EaW1ZICYmCisgICAgICAgIG90aGVyLT5nZXREaW1aKCkgPT0gbURpbVogJiYKKyAgICAgICAgb3RoZXItPmdldERpbUxPRCgpID09IG1EaW1MT0QgJiYKKyAgICAgICAgb3RoZXItPmdldERpbUZhY2VzKCkgPT0gbUZhY2VzKSB7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKyAgICByZXR1cm4gZmFsc2U7Cit9CisKK1R5cGUgKiBUeXBlOjpnZXRUeXBlKENvbnRleHQgKnJzYywgY29uc3QgRWxlbWVudCAqZSwKKyAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRpbVgsIHVpbnQzMl90IGRpbVksIHVpbnQzMl90IGRpbVosCisgICAgICAgICAgICAgICAgICAgICBib29sIGRpbUxPRCwgYm9vbCBkaW1GYWNlcykKK3sKKyAgICBUeXBlU3RhdGUgKiBzdGMgPSAmcnNjLT5tU3RhdGVUeXBlOworCisgICAgT2JqZWN0QmFzZTo6YXN5bmNMb2NrKCk7CisgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IHN0Yy0+bVR5cGVzLnNpemUoKTsgY3QrKykgeworICAgICAgICBUeXBlICp0ID0gc3RjLT5tVHlwZXNbY3RdOworICAgICAgICBpZiAodC0+Z2V0RWxlbWVudCgpICE9IGUpIGNvbnRpbnVlOworICAgICAgICBpZiAodC0+Z2V0RGltWCgpICE9IGRpbVgpIGNvbnRpbnVlOworICAgICAgICBpZiAodC0+Z2V0RGltWSgpICE9IGRpbVkpIGNvbnRpbnVlOworICAgICAgICBpZiAodC0+Z2V0RGltWigpICE9IGRpbVopIGNvbnRpbnVlOworICAgICAgICBpZiAodC0+Z2V0RGltTE9EKCkgIT0gZGltTE9EKSBjb250aW51ZTsKKyAgICAgICAgaWYgKHQtPmdldERpbUZhY2VzKCkgIT0gZGltRmFjZXMpIGNvbnRpbnVlOworICAgICAgICB0LT5pbmNVc2VyUmVmKCk7CisgICAgICAgIE9iamVjdEJhc2U6OmFzeW5jVW5sb2NrKCk7CisgICAgICAgIHJldHVybiB0OworICAgIH0KKyAgICBPYmplY3RCYXNlOjphc3luY1VubG9jaygpOworCisKKyAgICBUeXBlICpudCA9IG5ldyBUeXBlKHJzYyk7CisgICAgbnQtPm1FbGVtZW50LnNldChlKTsKKyAgICBudC0+bURpbVggPSBkaW1YOworICAgIG50LT5tRGltWSA9IGRpbVk7CisgICAgbnQtPm1EaW1aID0gZGltWjsKKyAgICBudC0+bURpbUxPRCA9IGRpbUxPRDsKKyAgICBudC0+bUZhY2VzID0gZGltRmFjZXM7CisgICAgbnQtPmNvbXB1dGUoKTsKKyAgICBudC0+aW5jVXNlclJlZigpOworCisgICAgT2JqZWN0QmFzZTo6YXN5bmNMb2NrKCk7CisgICAgc3RjLT5tVHlwZXMucHVzaChudCk7CisgICAgT2JqZWN0QmFzZTo6YXN5bmNVbmxvY2soKTsKKworICAgIHJldHVybiBudDsKK30KKworVHlwZSAqIFR5cGU6OmNsb25lQW5kUmVzaXplMUQoQ29udGV4dCAqcnNjLCB1aW50MzJfdCBkaW1YKSBjb25zdAoreworICAgIHJldHVybiBnZXRUeXBlKHJzYywgbUVsZW1lbnQuZ2V0KCksIGRpbVgsCisgICAgICAgICAgICAgICAgICAgbURpbVksIG1EaW1aLCBtRGltTE9ELCBtRmFjZXMpOworfQorCitUeXBlICogVHlwZTo6Y2xvbmVBbmRSZXNpemUyRChDb250ZXh0ICpyc2MsIHVpbnQzMl90IGRpbVgsIHVpbnQzMl90IGRpbVkpIGNvbnN0Cit7CisgICAgcmV0dXJuIGdldFR5cGUocnNjLCBtRWxlbWVudC5nZXQoKSwgZGltWCwgZGltWSwKKyAgICAgICAgICAgICAgICAgICBtRGltWiwgbURpbUxPRCwgbUZhY2VzKTsKK30KKwogCiAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8v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OwotCi0gICAgICAgIGNhc2UgUlNfS0lORF9OT1JNQUw6Ci0gICAgICAgICAgICAvL2xvZ0F0dHJpYihOT1JNQUwpOwotICAgICAgICAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZShHTF9OT1JNQUxfQVJSQVkpOwotICAgICAgICAgICAgcnNBc3NlcnQobUF0dHJpYnNbY3RdLnNpemUgPT0gMyk7Ci0gICAgICAgICAgICBnbEJpbmRCdWZmZXIoR0xfQVJSQVlfQlVGRkVSLCBtQXR0cmlic1tjdF0uYnVmZmVyKTsKLSAgICAgICAgICAgIGdsTm9ybWFsUG9pbnRlcihtQXR0cmlic1tjdF0udHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0uc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopbUF0dHJpYnNbY3RdLm9mZnNldCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFJTX0tJTkRfQ09MT1I6Ci0gICAgICAgICAgICAvL2xvZ0F0dHJpYihDT0xPUik7Ci0gICAgICAgICAgICBnbEVuYWJsZUNsaWVudFN0YXRlKEdMX0NPTE9SX0FSUkFZKTsKLSAgICAgICAgICAgIGdsQmluZEJ1ZmZlcihHTF9BUlJBWV9CVUZGRVIsIG1BdHRyaWJzW2N0XS5idWZmZXIpOwotICAgICAgICAgICAgZ2xDb2xvclBvaW50ZXIobUF0dHJpYnNbY3RdLnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0udHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS5zdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKW1BdHRyaWJzW2N0XS5vZmZzZXQpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBSU19LSU5EX1RFWFRVUkU6Ci0gICAgICAgICAgICAvL2xvZ0F0dHJpYihURVhUVVJFKTsKLSAgICAgICAgICAgIGdsRW5hYmxlQ2xpZW50U3RhdGUoR0xfVEVYVFVSRV9DT09SRF9BUlJBWSk7Ci0gICAgICAgICAgICBnbEJpbmRCdWZmZXIoR0xfQVJSQVlfQlVGRkVSLCBtQXR0cmlic1tjdF0uYnVmZmVyKTsKLSAgICAgICAgICAgIGdsVGV4Q29vcmRQb2ludGVyKG1BdHRyaWJzW2N0XS5zaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0uc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKiltQXR0cmlic1tjdF0ub2Zmc2V0KTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgUlNfS0lORF9QT0lOVF9TSVpFOgotICAgICAgICAgICAgLy9sb2dBdHRyaWIoUE9JTlRfU0laRSk7Ci0gICAgICAgICAgICBnbEVuYWJsZUNsaWVudFN0YXRlKEdMX1BPSU5UX1NJWkVfQVJSQVlfT0VTKTsKLSAgICAgICAgICAgIGdsQmluZEJ1ZmZlcihHTF9BUlJBWV9CVUZGRVIsIG1BdHRyaWJzW2N0XS5idWZmZXIpOwotICAgICAgICAgICAgZ2xQb2ludFNpemVQb2ludGVyT0VTKG1BdHRyaWJzW2N0XS50eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS5zdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKiltQXR0cmlic1tjdF0ub2Zmc2V0KTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICByc0Fzc2VydCgwKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJzYy0+Y2hlY2tFcnJvcigiV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tPnByb3BzLm1Mb2dTaGFkZXJzQXR0cikgeworICAgICAgICAgICAgbG9nQXR0cmliKGN0LCBzbG90KTsKICAgICAgICAgfQotCi0gICAgICAgIC8vbG9nQXR0cmliKGN0LCBzbG90KTsKKyAgICAgICAgaWYoc2xvdCA8IDApIHsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CiAgICAgICAgIGdsRW5hYmxlVmVydGV4QXR0cmliQXJyYXkoc2xvdCk7CiAgICAgICAgIGdsQmluZEJ1ZmZlcihHTF9BUlJBWV9CVUZGRVIsIG1BdHRyaWJzW2N0XS5idWZmZXIpOwotCiAgICAgICAgIGdsVmVydGV4QXR0cmliUG9pbnRlcihzbG90LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnNpemUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0udHlwZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS5ub3JtYWxpemVkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopbUF0dHJpYnNbY3RdLm9mZnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0ucHRyICsgbUF0dHJpYnNbY3RdLm9mZnNldCk7CiAgICAgfQogICAgIHN0YXRlLT5tTGFzdEVuYWJsZUNvdW50ID0gbUNvdW50OwogICAgIHJzYy0+Y2hlY2tFcnJvcigiVmVydGV4QXJyYXk6OnNldHVwR0wyIGRvbmUiKTsKZGlmZiAtLWdpdCBhL2xpYnMvcnMvcnNWZXJ0ZXhBcnJheS5oIGIvbGlicy9ycy9yc1ZlcnRleEFycmF5LmgKaW5kZXggMzkwNGNiNi4uZGVhN2Q0MSAxMDA2NDQKLS0tIGEvbGlicy9ycy9yc1ZlcnRleEFycm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AgICByZXR1cm4gcjsgXAorfSBcCitzdGF0aWMgdHlwZW91dCMjMyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBjb252ZXJ0XyMjdHlwZW91dCMjMyh0eXBlaW4jIzMgdikgeyBcCisgICAgdHlwZW91dCMjMyByID0geyh0eXBlb3V0KXYueCwgKHR5cGVvdXQpdi55LCAodHlwZW91dCl2Lnp9OyBcCisgICAgcmV0dXJuIHI7IFwKK30gXAorc3RhdGljIHR5cGVvdXQjIzQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY29udmVydF8jI3R5cGVvdXQjIzQodHlwZWluIyM0IHYpIHsgXAorICAgIHR5cGVvdXQjIzQgciA9IHsodHlwZW91dCl2LngsICh0eXBlb3V0KXYueSwgKHR5cGVvdXQpdi56LCAodHlwZW91dCl2Lnd9OyBcCisgICAgcmV0dXJuIHI7IFwKK30KKworI2RlZmluZSBDVlRfRlVOQyh0eXBlKSAgICAgIENWVF9GVU5DXzIodHlwZSwgdWNoYXIpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVlRfRlVOQ18yKHR5cGUsIGNoYXIpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVlRfRlVOQ18yKHR5cGUsIHVzaG9ydCkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENWVF9GVU5DXzIodHlwZSwgc2hvcnQpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVlRfRlVOQ18yKHR5cGUsIGludCkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENWVF9GVU5DXzIodHlwZSwgdWludCkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENWVF9GVU5DXzIodHlwZSwgZmxvYXQpCisKK0NWVF9GVU5DKGNoYXIpCitDVlRfRlVOQyh1Y2hhcikKK0NWVF9GVU5DKHNob3J0KQorQ1ZUX0ZVTkModXNob3J0KQorQ1ZUX0ZVTkMoaW50KQorQ1ZUX0ZVTkModWludCkKK0NWVF9GVU5DKGZsb2F0KQorCisKKworLy8gRmxvYXQgb3BzLCA2LjExLjIKKworI2RlZmluZSBERUZfRlVOQ18xKGZuYykgXAorc3RhdGljIGZsb2F0MiBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmbmMoZmxvYXQyIHYpIHsgXAorICAgIGZsb2F0MiByOyBcCisgICAgci54ID0gZm5jKHYueCk7IFwKKyAgICByLnkgPSBmbmModi55KTsgXAorICAgIHJldHVybiByOyBcCit9IFwKK3N0YXRpYyBmbG9hdDMgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZm5jKGZsb2F0MyB2KSB7IFwKKyAgICBmbG9hdDMgcjsgXAorICAgIHIueCA9IGZuYyh2LngpOyBcCisgICAgci55ID0gZm5jKHYueSk7IFwKKyAgICByLnogPSBmbmModi56KTsgXAorICAgIHJldHVybiByOyBcCit9IFwKK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZm5jKGZsb2F0NCB2KSB7IFwKKyAgICBmbG9hdDQgcjsgXAorICAgIHIueCA9IGZuYyh2LngpOyBcCisgICAgci55ID0gZm5jKHYueSk7IFwKKyAgICByLnogPSBmbmModi56KTsgXAorICAgIHIudyA9IGZuYyh2LncpOyBcCisgICAgcmV0dXJuIHI7IFwKK30KKworI2RlZmluZSBERUZfRlVOQ18yKGZuYykgXAorc3RhdGljIGZsb2F0MiBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmbmMoZmxvYXQyIHYxLCBmbG9hdDIgdjIpIHsgXAorICAgIGZsb2F0MiByOyBcCisgICAgci54ID0gZm5jKHYxLngsIHYyLngpOyBcCisgICAgci55ID0gZm5jKHYxLnksIHYyLnkpOyBcCisgICAgcmV0dXJuIHI7IFwKK30gXAorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmbmMoZmxvYXQz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gZnJhY3QoZmxvYXQyIHYsIGZsb2F0MiAqaXB0cikgeworICAgIGZsb2F0IHRbMl07CisgICAgZmxvYXQyIHI7CisgICAgci54ID0gZnJhY3Qodi54LCAmdFswXSk7CisgICAgci55ID0gZnJhY3Qodi55LCAmdFsxXSk7CisgICAgaXB0clswXSA9IHRbMF07CisgICAgaXB0clsxXSA9IHRbMV07CisgICAgcmV0dXJuIHI7Cit9CitzdGF0aWMgZmxvYXQzIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGZyYWN0KGZsb2F0MyB2LCBmbG9hdDMgKmlwdHIpIHsKKyAgICBmbG9hdCB0WzNdOworICAgIGZsb2F0MyByOworICAgIHIueCA9IGZyYWN0KHYueCwgJnRbMF0pOworICAgIHIueSA9IGZyYWN0KHYueSwgJnRbMV0pOworICAgIHIueiA9IGZyYWN0KHYueiwgJnRbMl0pOworICAgIGlwdHJbMF0gPSB0WzBdOworICAgIGlwdHJbMV0gPSB0WzFdOworICAgIGlwdHJbMl0gPSB0WzJdOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmcmFjdChmbG9hdDQgdiwgZmxvYXQ0ICppcHRyKSB7CisgICAgZmxvYXQgdFs0XTsKKyAgICBmbG9hdDQgcjsKKyAgICByLnggPSBmcmFjdCh2LngsICZ0WzBdKTsKKyAgICByLnkgPSBmcmFjdCh2LnksICZ0WzFdKTsKKyAgICByLnogPSBmcmFjdCh2LnosICZ0WzJdKTsKKyAgICByLncgPSBmcmFjdCh2LncsICZ0WzNdKTsKKyAgICBpcHRyWzBdID0gdFswXTsKKyAgICBpcHRyWzFdID0gdFsxXTsKKyAgICBpcHRyWzJdID0gdFsyXTsKKyAgICBpcHRyWzNdID0gdFszXTsKKyAgICByZXR1cm4gcjsKK30KKworZXh0ZXJuIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGZyZXhwKGZ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WF4KGNoYXIgdjEsIGNoYXIgdjIpIHsKKyAgICByZXR1cm4gdjEgPiB2MiA/IHYxIDogdjI7Cit9CisKKworCisKKy8vIDYuMTEuNAorCitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY2xhbXAoZmxvYXQgYW1vdW50LCBmbG9hdCBsb3csIGZsb2F0IGhpZ2gpIHsKKyAgICByZXR1cm4gYW1vdW50IDwgbG93ID8gbG93IDogKGFtb3VudCA+IGhpZ2ggPyBoaWdoIDogYW1vdW50KTsKK30KK3N0YXRpYyBmbG9hdDIgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY2xhbXAoZmxvYXQyIGFtb3VudCwgZmxvYXQyIGxvdywgZmxvYXQyIGhpZ2gpIHsKKyAgICBmbG9hdDIgcjsKKyAgICByLnggPSBhbW91bnQueCA8IGxvdy54ID8gbG93LnggOiAoYW1vdW50LnggPiBoaWdoLnggPyBoaWdoLnggOiBhbW91bnQueCk7CisgICAgci55ID0gYW1vdW50LnkgPCBsb3cueSA/IGxvdy55IDogKGFtb3VudC55ID4gaGlnaC55ID8gaGlnaC55IDogYW1vdW50LnkpOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBjbGFtcChmbG9hdDMgYW1vdW50LCBmbG9hdDMgbG93LCBmbG9hdDMgaGlnaCkgeworICAgIGZsb2F0MyByOworICAgIHIueCA9IGFtb3VudC54IDwgbG93LnggPyBsb3cueCA6IChhbW91bnQueCA+IGhpZ2gueCA/IGhpZ2gueCA6IGFtb3VudC54KTsKKyAgICByLnkgPSBhbW91bnQueSA8IGxvdy55ID8gbG93LnkgOiAoYW1vdW50LnkgPiBoaWdoLnkgPyBoaWdoLnkgOiBhbW91bnQueSk7CisgICAgci56ID0gYW1vdW50LnogPCBsb3cueiA/IGxvdy56IDogKGFtb3VudC56ID4gaGlnaC56ID8gaGlnaC56IDogYW1vdW50LnopOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBjbGFtcChmbG9hdDQgYW1vdW50LCBmbG9hdDQgbG93LCBmbG9hdDQgaGlnaCkgeworICAgIGZsb2F0NCByOworICAgIHIueCA9IGFtb3VudC54IDwgbG93LnggPyBsb3cueCA6IChhbW91bnQueCA+IGhpZ2gueCA/IGhpZ2gueCA6IGFtb3VudC54KTsKKyAgICByLnkgPSBhbW91bnQueSA8IGxvdy55ID8gbG93LnkgOiAoYW1vdW50LnkgPiBoaWdoLnkgPyBoaWdoLnkgOiBhbW91bnQueSk7CisgICAgci56ID0gYW1vdW50LnogPCBsb3cueiA/IGxvdy56IDogKGFtb3VudC56ID4gaGlnaC56ID8gaGlnaC56IDogYW1vdW50LnopOworICAgIHIudyA9IGFtb3VudC53IDwgbG93LncgPyBsb3cudyA6IChhbW91bnQudyA+IGhpZ2gudyA/IGhpZ2gudyA6IGFtb3VudC53KTsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDIgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY2xhbXAoZmxvYXQyIGFtb3VudCwgZmxvYXQgbG93LCBmbG9hdCBoaWdoKSB7CisgICAgZmxvYXQyIHI7CisgICAgci54ID0gYW1vdW50LnggPCBsb3cgPyBsb3cgOiAoYW1vdW50LnggPiBoaWdoID8gaGlnaCA6IGFtb3VudC54KTsKKyAgICByLnkgPSBhbW91bnQueSA8IGxvdyA/IGxvdyA6IChhbW91bnQueSA+IGhpZ2ggPyBoaWdoIDogYW1vdW50LnkpOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBjbGFtcChmbG9hdDMgYW1vdW50LCBmbG9hdCBsb3csIGZsb2F0IGhpZ2gpIHsKKyAgICBmbG9hdDMgcjsKKyAgICByLnggPSBhbW91bnQueCA8IGxvdyA/IGxvdyA6IChhbW91bnQueCA+IGhpZ2ggPyBoaWdoIDogYW1vdW50LngpOworICAgIHIueSA9IGFtb3VudC55IDwgbG93ID8gbG93IDogKGFtb3VudC55ID4gaGlnaCA/IGhpZ2ggOiBhbW91bnQueSk7CisgICAgci56ID0gYW1vdW50LnogPCBsb3cgPyBsb3cgOiAoYW1vdW50LnogPiBoaWdoID8gaGlnaCA6IGFtb3VudC56KTsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY2xhbXAoZmxvYXQ0IGFtb3VudCwgZmxvYXQgbG93LCBmbG9hdCBoaWdoKSB7CisgICAgZmxvYXQ0IHI7CisgICAgci54ID0gYW1vdW50LnggPCBsb3cgPyBsb3cgOiAoYW1vdW50LnggPiBoaWdoID8gaGlnaCA6IGFtb3VudC54KTsKKyAgICByLnkgPSBhbW91bnQueSA8IGxvdyA/IGxvdyA6IChhbW91bnQueSA+IGhpZ2ggPyBoaWdoIDogYW1vdW50LnkpOworICAgIHIueiA9IGFtb3VudC56IDwgbG93ID8gbG93IDogKGFtb3VudC56ID4gaGlnaCA/IGhpZ2ggOiBhbW91bnQueik7CisgICAgci53ID0gYW1vdW50LncgPCBsb3cgPyBsb3cgOiAoYW1vdW50LncgPiBoaWdoID8gaGlnaCA6IGFtb3VudC53KTsKKyAgICByZXR1cm4gcjsKK30KKworc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGRlZ3JlZXMoZmxvYXQgcmFkaWFucykgeworICAgIHJldHVybiByYWRpYW5zICogKDE4MC5mIC8gTV9QSSk7Cit9CitERUZfRlVOQ18xKGRlZ3JlZXMpCisKK3N0YXRpYyBmbG9hdCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBtYXgoZmxvYXQgdjEsIGZsb2F0IHYyKSB7CisgICAgcmV0dXJuIHYxID4gdjIgPyB2MSA6IHYyOworfQorc3RhdGljIGZsb2F0MiBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBtYXgoZmxvYXQyIHYxLCBmbG9hdDIgdjIpIHsKKyAgICBmbG9hdDIgcjsKKyAgICByLnggPSB2MS54ID4gdjIueCA/IHYxLnggOiB2Mi54OworICAgIHIueSA9IHYxLnkgPiB2Mi55ID8gdjEueSA6IHYyLnk7CisgICAgcmV0dXJuIHI7Cit9CitzdGF0aWMgZmxvYXQzIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIG1heChmbG9hdDMgdjEsIGZsb2F0MyB2MikgeworICAgIGZsb2F0MyByOworICAgIHIueCA9IHYxLnggPiB2Mi54ID8gdjEueCA6IHYyLng7CisgICAgci55ID0gdjEueSA+IHYyLnkgPyB2MS55IDogdjIueTsKKyAgICByLnogPSB2MS56ID4gdjIueiA/IHYxLnogOiB2Mi56OworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBtYXgoZmxvYXQ0IHYxLCBmbG9hdDQgdjIpIHsKKyAgICBmbG9hdDQgcjsKKyAgICByLnggPSB2MS54ID4gdjIueCA/IHYxLnggOiB2Mi54OworICAgIHIueSA9IHYxLnkgPiB2Mi55ID8gdjEueSA6IHYyLnk7CisgICAgci56ID0gdjEueiA+IHYyLnogPyB2MS56IDogdjIuejsKKyAgICByLncgPSB2MS53ID4gdjIudyA/IHYxLncgOiB2Mi53OworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0MiBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBtYXgoZmxvYXQyIHYxLCBmbG9hdCB2MikgeworICAgIGZsb2F0MiByOworICAgIHIueCA9IHYxLnggPiB2MiA/IHYxLnggOiB2MjsKKyAgICByLnkgPSB2MS55ID4gdjIgPyB2MS55IDogdjI7CisgICAgcmV0dXJuIHI7Cit9CitzdGF0aWMgZmxvYXQzIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIG1heChmbG9hdDMgdjEsIGZsb2F0IHYyKSB7CisgICAgZmxvYXQzIHI7CisgICAgci54ID0gdjEueCA+IHYyID8gdjEueCA6IHYyOworICAgIHIueSA9IHYxLnkgPiB2MiA/IHYxLnkgOiB2MjsKKyAgICByLnogPSB2MS56ID4gdjIgPyB2MS56IDogdjI7CisgICAgcmV0dXJuIHI7Cit9CitzdGF0aWMgZmxvYXQ0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIG1heChmbG9hdDQgdjEsIGZsb2F0IHYyKSB7CisgICAgZmxvYXQ0IHI7CisgICAgci54ID0gdjEueCA+IHYyID8gdjEueCA6IHYyOworICAgIHIueSA9IHYxLnkgPiB2MiA/IHYxLnkgOiB2MjsKKyAgICByLnogPSB2MS56ID4gdjIgPyB2MS56IDogdjI7CisgICAgci53ID0gdjEudyA+IHYyID8gdjEudyA6IHYyOworICAgIHJldHVybiByOworfQorCitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgbWluKGZsb2F0IHYxLCBmbG9hdCB2MikgeworICAgIHJldHVybiB2MSA8IHYyID8gdjEgOiB2MjsKK30KK3N0YXRpYyBmbG9hdDIgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgbWluKGZsb2F0MiB2MSwgZmxvYXQyIHYyKSB7CisgICAgZmxvYXQyIHI7CisgICAgci54ID0gdjEueCA8IHYyLnggPyB2MS54IDogdjIueDsKKyAgICByLnkgPSB2MS55IDwgdjIueSA/IHYxLnkgOiB2Mi55OworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBtaW4oZmxvYXQzIHYxLCBmbG9hdDMgdjIpIHsKKyAgICBmbG9hdDMgcjsKKyAgICByLnggPSB2MS54IDwgdjIueCA/IHYxLnggOiB2Mi54OworICAgIHIueSA9IHYxLnkgPCB2Mi55ID8gdjEueSA6IHYyLnk7CisgICAgci56ID0gdjEueiA8IHYyLnogPyB2MS56IDogdjIuejsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgbWluKGZsb2F0NCB2MSwgZmxvYXQ0IHYyKSB7CisgICAgZmxvYXQ0IHI7CisgICAgci54ID0gdjEueCA8IHYyLnggPyB2MS54IDogdjIueDsKKyAgICByLnkgPSB2MS55IDwgdjIueSA/IHYxLnkgOiB2Mi55OworICAgIHIueiA9IHYxLnogPCB2Mi56ID8gdjEueiA6IHYyLno7CisgICAgci53ID0gdjEudyA8IHYyLncgPyB2MS53IDogdjIudzsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDIgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgbWluKGZsb2F0MiB2MSwgZmxvYXQgdjIpIHsKKyAgICBmbG9hdDIgcjsKKyAgICByLnggPSB2MS54IDwgdjIgPyB2MS54IDogdjI7CisgICAgci55ID0gdjEueSA8IHYyID8gdjEueSA6IHYyOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBtaW4oZmxvYXQzIHYxLCBmbG9hdCB2MikgeworICAgIGZsb2F0MyByOworICAgIHIueCA9IHYxLnggPCB2MiA/IHYxLnggOiB2MjsKKyAgICByLnkgPSB2MS55IDwgdjIgPyB2MS55IDogdjI7CisgICAgci56ID0gdjEueiA8IHYyID8gdjEueiA6IHYyOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBtaW4oZmxvYXQ0IHYxLCBmbG9hdCB2MikgeworICAgIGZsb2F0NCByOworICAgIHIueCA9IHYxLnggPCB2MiA/IHYxLnggOiB2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GVfXygob3ZlcmxvYWRhYmxlKSkgc2lnbihmbG9hdCB2KSB7CisgICAgaWYgKHYgPiAwKSByZXR1cm4gMS5mOworICAgIGlmICh2IDwgMCkgcmV0dXJuIC0xLmY7CisgICAgcmV0dXJuIHY7Cit9CitERUZfRlVOQ18xKHNpZ24pCisKKy8vIDYuMTEuNQorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBjcm9zcyhmbG9hdDMgbGhzLCBmbG9hdDMgcmhzKSB7CisgICAgZmxvYXQzIHI7CisgICAgci54ID0gbGhzLnkgKiByaHMueiAgLSBsaHMueiAqIHJocy55OworICAgIHIueSA9IGxocy56ICogcmhzLnggIC0gbGhzLnggKiByaHMuejsKKyAgICByLnogPSBsaHMueCAqIHJocy55ICAtIGxocy55ICogcmhzLng7CisgICAgcmV0dXJuIHI7Cit9CisKK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY3Jvc3MoZmxvYXQ0IGxocywgZmxvYXQ0IHJocykgeworICAgIGZsb2F0NCByOworICAgIHIueCA9IGxocy55ICogcmhzLnogIC0gbGhzLnogKiByaHMueTsKKyAgICByLnkgPSBsaHMueiAqIHJocy54ICAtIGxocy54ICogcmhzLno7CisgICAgci56ID0gbGhzLnggKiByaHMueSAgLSBsaHMueSAqIHJocy54OworICAgIHIudyA9IDAuZjsKKyAgICByZXR1cm4gcjsKK30KKworc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGRvdChmbG9hdCBsaHMsIGZsb2F0IHJocykgeworICAgIHJldHVybiBsaHMgKiByaHM7Cit9CitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZG90KGZsb2F0MiBsaHMsIGZsb2F0MiByaHMpIHsKKyAgICByZXR1cm4gbGhzLngqcmhzLnggKyBsaHMueSpyaHMueTsKK30KK3N0YX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YyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIHJzRGVidWcoY29uc3QgY2hhciAqcywgZmxvYXQzIHYpIHsKKyAgICByc0RlYnVnKHMsIHYueCwgdi55LCB2LnopOworfQorc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgcnNEZWJ1Zyhjb25zdCBjaGFyICpzLCBmbG9hdDQgdikgeworICAgIHJzRGVidWcocywgdi54LCB2LnksIHYueiwgdi53KTsKK30KKworc3RhdGljIHVjaGFyNCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSByc1BhY2tDb2xvclRvODg4OChmbG9hdCByLCBmbG9hdCBnLCBmbG9hdCBiKQoreworICAgIHVjaGFyNCBjOworICAgIGMueCA9ICh1Y2hhcikociAqIDI1NS5mKTsKKyAgICBjLnkgPSAodWNoYXIpKGcgKiAyNTUuZik7CisgICAgYy56ID0gKHVjaGFyKShiICogMjU1LmYpOworICAgIGMudyA9IDI1NTsKKyAgICByZXR1cm4gYzsKK30KKworc3RhdGljIHVjaGFyNCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSByc1BhY2tDb2xvclRvODg4OChmbG9hdCByLCBmbG9hdCBnLCBmbG9hdCBiLCBmbG9hdCBhKQoreworICAgIHVjaGFyNCBjOworICAgIGMueCA9ICh1Y2hhcikociAqIDI1NS5mKTsKKyAgICBjLnkgPSAodWNoYXIpKGcgKiAyNTUuZik7CisgICAgYy56ID0gKHVjaGFyKShiICogMjU1LmYpOworICAgIGMudyA9ICh1Y2hhcikoYSAqIDI1NS5mKTsKKyAgICByZXR1cm4gYzsKK30KKworc3RhdGljIHVjaGFyNCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSByc1BhY2tDb2xvclRvODg4OChmbG9hdDMgY29sb3IpCit7CisgICAgY29sb3IgKj0gMjU1LmY7CisgICAgdWNoYXI0IGMgPSB7Y29sb3IueCwgY29sb3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yBjb2xdID0gdjsKK30KKworc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeEdldChjb25zdCByc19tYXRyaXg0eDQgKm0sIHVpbnQzMl90IHJvdywgdWludDMyX3QgY29sKSB7CisgICAgcmV0dXJuIG0tPm1bcm93ICogNCArIGNvbF07Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeFNldChyc19tYXRyaXgzeDMgKm0sIHVpbnQzMl90IHJvdywgdWludDMyX3QgY29sLCBmbG9hdCB2KSB7CisgICAgbS0+bVtyb3cgKiAzICsgY29sXSA9IHY7Cit9CisKK3N0YXRpYyBmbG9hdCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhHZXQoY29uc3QgcnNfbWF0cml4M3gzICptLCB1aW50MzJfdCByb3csIHVpbnQzMl90IGNvbCkgeworICAgIHJldHVybiBtLT5tW3JvdyAqIDMgKyBjb2xdOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhTZXQocnNfbWF0cml4MngyICptLCB1aW50MzJfdCByb3csIHVpbnQzMl90IGNvbCwgZmxvYXQgdikgeworICAgIG0tPm1bcm93ICogMiArIGNvbF0gPSB2OworfQorCitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4R2V0KGNvbnN0IHJzX21hdHJpeDJ4MiAqbSwgdWludDMyX3Qgcm93LCB1aW50MzJfdCBjb2wpIHsKKyAgICByZXR1cm4gbS0+bVtyb3cgKiAyICsgY29sXTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZElkZW50aXR5KHJzX21hdHJpeDR4NCAqbSkgeworICAgIG0tPm1bMF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hdCAqdikgeworICAgIG0tPm1bMF0gPSB2WzBdOworICAgIG0tPm1bMV0gPSB2WzFdOworICAgIG0tPm1bMl0gPSB2WzJdOworICAgIG0tPm1bM10gPSB2WzNdOworICAgIG0tPm1bNF0gPSB2WzRdOworICAgIG0tPm1bNV0gPSB2WzVdOworICAgIG0tPm1bNl0gPSB2WzZdOworICAgIG0tPm1bN10gPSB2WzddOworICAgIG0tPm1bOF0gPSB2WzhdOworICAgIG0tPm1bOV0gPSB2WzldOworICAgIG0tPm1bMTBdID0gdlsxMF07CisgICAgbS0+bVsxMV0gPSB2WzExXTsKKyAgICBtLT5tWzEyXSA9IHZbMTJdOworICAgIG0tPm1bMTNdID0gdlsxM107CisgICAgbS0+bVsxNF0gPSB2WzE0XTsKKyAgICBtLT5tWzE1XSA9IHZbMTVdOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkKHJzX21hdHJpeDN4MyAqbSwgY29uc3QgZmxvYXQgKnYpIHsKKyAgICBtLT5tWzBdID0gdlswXTsKKyAgICBtLT5tWzFdID0gdlsxXTsKKyAgICBtLT5tWzJdID0gdlsyXTsKKyAgICBtLT5tWzNdID0gdlszXTsKKyAgICBtLT5tWzRdID0gdls0XTsKKyAgICBtLT5tWzVdID0gdls1XTsKKyAgICBtLT5tWzZdID0gdls2XTsKKyAgICBtLT5tWzddID0gdls3XTsKKyAgICBtLT5tWzhdID0gdls4XTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZChyc19tYXRyaXgyeDIgKm0sIGNvbnN0IGZsb2F0ICp2KSB7CisgICAgbS0+bVswXSA9IHZbMF07CisgICAgbS0+bVsxXSA9IHZbMV07CisgICAgbS0+bVsyXSA9IHZbMl07CisgICAgbS0+bVszXSA9IHZbM107Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRl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+bVsxMV0gPSAwLmY7CisgICAgbS0+bVsxMl0gPSAwLmY7CisgICAgbS0+bVsxM10gPSAwLmY7CisgICAgbS0+bVsxNF0gPSAwLmY7CisgICAgbS0+bVsxNV0gPSAxLmY7Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWQocnNfbWF0cml4NHg0ICptLCBjb25zdCByc19tYXRyaXgyeDIgKnYpIHsKKyAgICBtLT5tWzBdID0gdi0+bVswXTsKKyAgICBtLT5tWzFdID0gdi0+bVsxXTsKKyAgICBtLT5tWzJdID0gMC5mOworICAgIG0tPm1bM10gPSAwLmY7CisgICAgbS0+bVs0XSA9IHYtPm1bM107CisgICAgbS0+bVs1XSA9IHYtPm1bNF07CisgICAgbS0+bVs2XSA9IDAuZjsKKyAgICBtLT5tWzddID0gMC5mOworICAgIG0tPm1bOF0gPSB2LT5tWzZdOworICAgIG0tPm1bOV0gPSB2LT5tWzddOworICAgIG0tPm1bMTBdID0gMS5mOworICAgIG0tPm1bMTFdID0gMC5mOworICAgIG0tPm1bMTJdID0gMC5mOworICAgIG0tPm1bMTNdID0gMC5mOworICAgIG0tPm1bMTRdID0gMC5mOworICAgIG0tPm1bMTVdID0gMS5mOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkKHJzX21hdHJpeDN4MyAqbSwgY29uc3QgcnNfbWF0cml4M3gzICp2KSB7CisgICAgbS0+bVswXSA9IHYtPm1bMF07CisgICAgbS0+bVsxXSA9IHYtPm1bMV07CisgICAgbS0+bVsyXSA9IHYtPm1bMl07CisgICAgbS0+bVszXSA9IHYtPm1bM107CisgICAgbS0+bVs0XSA9IHYtPm1bNF07CisgICAgbS0+bVs1XSA9IHYtPm1bNV07CisgICAgbS0+bVs2XSA9IHYtPm1bNl07CisgICAgbS0+bVs3XSA9IHYtPm1bN107CisgICAgbS0+bVs4XSA9IHYtPm1bOF07Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWQocnNfbWF0cml4MngyICptLCBjb25zdCByc19tYXRyaXgyeDIgKnYpIHsKKyAgICBtLT5tWzBdID0gdi0+bVswXTsKKyAgICBtLT5tWzFdID0gdi0+bVsxXTsKKyAgICBtLT5tWzJdID0gdi0+bVsyXTsKKyAgICBtLT5tWzNdID0gdi0+bVszXTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZFJvdGF0ZShyc19tYXRyaXg0eDQgKm0sIGZsb2F0IHJvdCwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgIGZsb2F0IGMsIHM7CisgICAgbS0+bVszXSA9IDA7CisgICAgbS0+bVs3XSA9IDA7CisgICAgbS0+bVsxMV09IDA7CisgICAgbS0+bVsxMl09IDA7CisgICAgbS0+bVsxM109IDA7CisgICAgbS0+bVsxNF09IDA7CisgICAgbS0+bVsxNV09IDE7CisgICAgcm90ICo9IChmbG9hdCkoTV9QSSAvIDE4MC4wZik7CisgICAgYyA9IGNvcyhyb3QpOworICAgIHMgPSBzaW4ocm90KTsKKworICAgIGNvbnN0IGZsb2F0IGxlbiA9IHgqeCArIHkqeSArIHoqejsKKyAgICBpZiAobGVuICE9IDEpIHsKKyAgICAgICAgY29uc3QgZmxvYXQgcmVjaXBMZW4gPSAxLmYgLyBzcXJ0KGxlbik7CisgICAgICAgIHggKj0gcmVjaXBMZW47CisgICAgICAgIHkgKj0gcmVjaXBMZW47CisgICAgICAgIHogKj0gcmVjaXBMZW47CisgICAgfQorICAgIGNvbnN0IGZsb2F0IG5jID0gMS4wZiAtIGM7CisgICAgY29uc3QgZmxvYXQgeHkgPSB4ICogeTsKKyAgICBjb25zdCBmbG9hdCB5eiA9IHkgKiB6OworICAgIGNvbnN0IGZsb2F0IHp4ID0geiAqIHg7CisgICAgY29uc3QgZmxvYXQgeHMgPSB4ICogczsKKyAgICBjb25zdCBmbG9hdCB5cyA9IHkgKiBzOworICAgIGNvbnN0IGZsb2F0IHpzID0geiAqIHM7CisgICAgbS0+bVsgMF0gPSB4KngqbmMgKyAgYzsKKyAgICBtLT5tWyA0XSA9ICB4eSpuYyAtIHpzOworICAgIG0tPm1bIDhdID0gIHp4Km5jICsgeXM7CisgICAgbS0+bVsgMV0gPSAgeHkqbmMgKyB6czsKKyAgICBtLT5tWyA1XSA9IHkqeSpuYyArICBjOworICAgIG0tPm1bIDldID0gIHl6Km5jIC0geHM7CisgICAgbS0+bVsgMl0gPSAgengqbmMgLSB5czsKKyAgICBtLT5tWyA2XSA9ICB5eipuYyArIHhzOworICAgIG0tPm1bMTBdID0geip6Km5jICsgIGM7Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWRTY2FsZShyc19tYXRyaXg0eDQgKm0sIGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopIHsKKyAgICByc01hdHJpeExvYWRJZGVudGl0eShtKTsKKyAgICBtLT5tWzBdID0geDsKKyAgICBtLT5tWzVdID0geTsKKyAgICBtLT5tWzEwXSA9IHo7Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWRUcmFuc2xhdGUocnNfbWF0cml4NHg0ICptLCBmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCB6KSB7CisgICAgcnNNYXRyaXhMb2FkSWRlbnRpdHkobSk7CisgICAgbS0+bVsxMl0gPSB4OworICAgIG0tPm1bMTNdID0geTsKKyAgICBtLT5tWzE0XSA9IHo7Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWRNdWx0aXBseShyc19tYXRyaXg0eDQgKm0sIGNvbnN0IHJzX21hdHJpeDR4NCAqbGhzLCBjb25zdCByc19tYXRyaXg0eDQgKnJocykgeworICAgIGZvciAoaW50IGk9MCA7IGk8NCA7IGkrKykgeworICAgICAgICBmbG9hdCByaTAgPSAwOworICAgICAgICBmbG9hdCByaTEgPSAwOworICAgICAgICBmbG9hdCByaTIgPSAwOworICAgICAgICBmbG9hdCByaTMgPSAwOworICAgICAgICBmb3IgKGludCBqPTAgOyBqPDQgOyBqKyspIHsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IHJoc19paiA9IHJzTWF0cml4R2V0KHJocywgaSxqKTsKKyAgICAgICAgICAgIHJpMCArPSByc01hdHJpeEdldChsaHMsIGosIDApICogcmhzX2lqOworICAgICAgICAgICAgcmkxICs9IHJzTWF0cml4R2V0KGxocywgaiwgMSkgKiByaHNfaWo7CisgICAgICAgICAgICByaTIgKz0gcnNNYXRyaXhHZXQobGhzLCBqLCAyKSAqIHJoc19pajsKKyAgICAgICAgICAgIHJpMyArPSByc01hdHJpeEdldChsaHMsIGosIDMpICogcmhzX2lqOworICAgICAgICB9CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDAsIHJpMCk7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDEsIHJpMSk7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDIsIHJpMik7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDMsIHJpMyk7CisgICAgfQorfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXg0eDQgKm0sIGNvbnN0IHJzX21hdHJpeDR4NCAqcmhzKSB7CisgICAgcnNfbWF0cml4NHg0IG10OworICAgIHJzTWF0cml4TG9hZE11bHRpcGx5KCZtdCwgbSwgcmhzKTsKKyAgICByc01hdHJpeExvYWQobSwgJm10KTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZE11bHRpcGx5KHJzX21hdHJpeDN4MyAqbSwgY29uc3QgcnNfbWF0cml4M3gzICpsaHMsIGNvbnN0IHJzX21hdHJpeDN4MyAqcmhzKSB7CisgICAgZm9yIChpbnQgaT0wIDsgaTwzIDsgaSsrKSB7CisgICAgICAgIGZsb2F0IHJpMCA9IDA7CisgICAgICAgIGZsb2F0IHJpMSA9IDA7CisgICAgICAgIGZsb2F0IHJpMiA9IDA7CisgICAgICAgIGZvciAoaW50IGo9MCA7IGo8MyA7IGorKykgeworICAgICAgICAgICAgY29uc3QgZmxvYXQgcmhzX2lqID0gcnNNYXRyaXhHZXQocmhzLCBpLGopOworICAgICAgICAgICAgcmkwICs9IHJzTWF0cml4R2V0KGxocywgaiwgMCkgKiByaHNfaWo7CisgICAgICAgICAgICByaTEgKz0gcnNNYXRyaXhHZXQobGhzLCBqLCAxKSAqIHJoc19pajsKKyAgICAgICAgICAgIHJpMiArPSByc01hdHJpeEdldChsaHMsIGosIDIpICogcmhzX2lqOworICAgICAgICB9CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDAsIHJpMCk7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDEsIHJpMSk7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDIsIHJpMik7CisgICAgfQorfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXgzeDMgKm0sIGNvbnN0IHJzX21hdHJpeDN4MyAqcmhzKSB7CisgICAgcnNfbWF0cml4M3gzIG10OworICAgIHJzTWF0cml4TG9hZE11bHRpcGx5KCZtdCwgbSwgcmhzKTsKKyAgICByc01hdHJpeExvYWQobSwgJm10KTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZE11bHRpcGx5KHJzX21hdHJpeDJ4MiAqbSwgY29uc3QgcnNfbWF0cml4MngyICpsaHMsIGNvbnN0IHJzX21hdHJpeDJ4MiAqcmhzKSB7CisgICAgZm9yIChpbnQgaT0wIDsgaTwyIDsgaSsrKSB7CisgICAgICAgIGZsb2F0IHJpMCA9IDA7CisgICAgICAgIGZsb2F0IHJpMSA9IDA7CisgICAgICAgIGZvciAoaW50IGo9MCA7IGo8MiA7IGorKykgeworICAgICAgICAgICAgY29uc3QgZmxvYXQgcmhzX2lqID0gcnNNYXRyaXhHZXQocmhzLCBpLGopOworICAgICAgICAgICAgcmkwICs9IHJzTWF0cml4R2V0KGxocywgaiwgMCkgKiByaHNfaWo7CisgICAgICAgICAgICByaTEgKz0gcnNNYXRyaXhHZXQobGhzLCBqLCAxKSAqIHJoc19pajsKKyAgICAgICAgfQorICAgICAgICByc01hdHJpeFNldChtLCBpLCAwLCByaTApOworICAgICAgICByc01hdHJpeFNldChtLCBpLCAxLCByaTEpOworICAgIH0KK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TXVsdGlwbHkocnNfbWF0cml4MngyICptLCBjb25zdCByc19tYXRyaXgyeDIgKnJocykgeworICAgIHJzX21hdHJpeDJ4MiBtdDsKKyAgICByc01hdHJpeExvYWRNdWx0aXBseSgmbXQsIG0sIHJocyk7CisgICAgcnNNYXRyaXhMb2FkKG0sICZtdCk7Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeFJvdGF0ZShyc19tYXRyaXg0eDQgKm0sIGZsb2F0IHJvdCwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgIHJzX21hdHJpeDR4NCBtMTsKKyAgICByc01hdHJpeExvYWRSb3RhdGUoJm0xLCByb3QsIHgsIHksIHopOworICAgIHJzTWF0cml4TXVsdGlwbHkobSwgJm0xKTs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zcGVjdDsKKyAgICByc01hdHJpeExvYWRGcnVzdHVtKG0sIGxlZnQsIHJpZ2h0LCBib3R0b20sIHRvcCwgbmVhciwgZmFyKTsKK30KKworc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXg0eDQgKm0sIGZsb2F0NCBpbikgeworICAgIGZsb2F0NCByZXQ7CisgICAgcmV0LnggPSAobS0+bVswXSAqIGluLngpICsgKG0tPm1bNF0gKiBpbi55KSArIChtLT5tWzhdICogaW4ueikgKyAobS0+bVsxMl0gKiBpbi53KTsKKyAgICByZXQueSA9IChtLT5tWzFdICogaW4ueCkgKyAobS0+bVs1XSAqIGluLnkpICsgKG0tPm1bOV0gKiBpbi56KSArIChtLT5tWzEzXSAqIGluLncpOworICAgIHJldC56ID0gKG0tPm1bMl0gKiBpbi54KSArIChtLT5tWzZdICogaW4ueSkgKyAobS0+bVsxMF0gKiBpbi56KSArIChtLT5tWzE0XSAqIGluLncpOworICAgIHJldC53ID0gKG0tPm1bM10gKiBpbi54KSArIChtLT5tWzddICogaW4ueSkgKyAobS0+bVsxMV0gKiBpbi56KSArIChtLT5tWzE1XSAqIGluLncpOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TXVsdGlwbHkocnNfbWF0cml4NHg0ICptLCBmbG9hdDMgaW4pIHsKKyAgICBmbG9hdDQgcmV0OworICAgIHJldC54ID0gKG0tPm1bMF0gKiBpbi54KSArIChtLT5tWzRdICogaW4ueSkgKyAobS0+bVs4XSAqIGluLnopICsgbS0+bVsxMl07CisgICAgcmV0LnkgPSAobS0+bVsxXSAqIGluLngpICsgKG0tPm1bNV0gKiBpbi55KSArIChtLT5tWzldICogaW4ueikgKyBtLT5tWzEzXTsKKyAgICByZXQueiA9IChtLT5tWzJdICogaW4ueCkgKyAobS0+bVs2XSAqIGluLnkpICsgKG0tPm1bMTBdICogaW4ueikgKyBtLT5tWzE0XTsKKyAgICByZXQudyA9IChtLT5tWzNdICogaW4ueCkgKyAobS0+bVs3XSAqIGluLnkpICsgKG0tPm1bMTFdICogaW4ueikgKyBtLT5tWzE1XTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgZmxvYXQ0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeE11bHRpcGx5KHJzX21hdHJpeDR4NCAqbSwgZmxvYXQyIGluKSB7CisgICAgZmxvYXQ0IHJldDsKKyAgICByZXQueCA9IChtLT5tWzBdICogaW4ueCkgKyAobS0+bVs0XSAqIGluLnkpICsgbS0+bVsxMl07CisgICAgcmV0LnkgPSAobS0+bVsxXSAqIGluLngpICsgKG0tPm1bNV0gKiBpbi55KSArIG0tPm1bMTNdOworICAgIHJldC56ID0gKG0tPm1bMl0gKiBpbi54KSArIChtLT5tWzZdICogaW4ueSkgKyBtLT5tWzE0XTsKKyAgICByZXQudyA9IChtLT5tWzNdICogaW4ueCkgKyAobS0+bVs3XSAqIGluLnkpICsgbS0+bVsxNV07CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXgzeDMgKm0sIGZsb2F0MyBpbikgeworICAgIGZsb2F0MyByZXQ7CisgICAgcmV0LnggPSAobS0+bVswXSAqIGluLngpICsgKG0tPm1bM10gKiBpbi55KSArIChtLT5tWzZdICogaW4ueik7CisgICAgcmV0LnkgPSAobS0+bVsxXSAqIGluLngpICsgKG0tPm1bNF0gKiBpbi55KSArIChtLT5tWzddICogaW4ueik7CisgICAgcmV0LnogPSAobS0+bVsyXSAqIGluLngpICsgKG0tPm1bNV0gKiBpbi55KSArIChtLT5tWzhdICogaW4ueik7CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXgzeDMgKm0sIGZsb2F0MiBpbikgeworICAgIGZsb2F0MyByZXQ7CisgICAgcmV0LnggPSAobS0+bVswXSAqIGluLngpICsgKG0tPm1bM10gKiBpbi55KTsKKyAgICByZXQueSA9IChtLT5tWzFdICogaW4ueCkgKyAobS0+bVs0XSAqIGluLnkpOworICAgIHJldC56ID0gKG0tPm1bMl0gKiBpbi54KSArIChtLT5tWzVdICogaW4ueSk7CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGZsb2F0MiBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXgyeDIgKm0sIGZsb2F0MiBpbikgeworICAgIGZsb2F0MiByZXQ7CisgICAgcmV0LnggPSAobS0+bVswXSAqIGluLngpICsgKG0tPm1bMl0gKiBpbi55KTsKKyAgICByZXQueSA9IChtLT5tWzFdICogaW4ueCkgKyAobS0+bVszXSAqIGluLnkpOworICAgIHJldHVybiByZXQ7Cit9CisKKy8vIFJldHVybnMgdHJ1ZSBpZiB0aGUgbWF0cml4IHdhcyBzdWNjZXNzZnVsbHkgaW52ZXJzZWQKK3N0YXRpYyBib29sIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeEludmVyc2UocnNfbWF0cml4NHg0ICptKSB7CisgICAgcnNfbWF0cml4NHg0IHJlc3VsdDsKKworICAgIGludCBpLCBqOworICAgIGZvciAoaSA9IDA7IGkgPCA0OyArK2kpIHsKKyAgICAgICAgZm9yIChqID0gMDsgaiA8IDQ7ICsraikgeworICAgICAgICAgICAgLy8gY29tcHV0ZUNvZmFjdG9yIGZvciBpbnQgaSwgaW50IGoKKyAgICAgICAgICAgIGludCBjMCA9IChpKzEpICUgNDsKKyAgICAgICAgICAgIGludCBjMSA9IChpKzIpICUgNDsKKyAgICAgICAgICAgIGludCBjMiA9IChpKzMpICUgNDsKKyAgICAgICAgICAgIGludCByMCA9IChqKzEpICUgNDsKKyAgICAgICAgICAgIGludCByMSA9IChqKzIpICUgNDsKKyAgICAgICAgICAgIGludCByMiA9IChqKzMpICUgNDsKKworICAgICAgICAgICAgZmxvYXQgbWlub3IgPSAobS0+bVtjMCArIDQqcjBdICogKG0tPm1bYzEgKyA0KnIxXSAqIG0tPm1bYzIgKyA0KnIyXSAtIG0tPm1bYzEgKyA0KnIyXSAqIG0tPm1bYzIgKyA0KnIxXSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgLSAobS0+bVtjMCArIDQqcjFdICogKG0tPm1bYzEgKyA0KnIwXSAqIG0tPm1bYzIgKyA0KnIyXSAtIG0tPm1bYzEgKyA0KnIyXSAqIG0tPm1bYzIgKyA0KnIwXSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgKyAobS0+bVtjMCArIDQqcjJdICogKG0tPm1bYzEgKyA0KnIwXSAqIG0tPm1bYzIgKyA0KnIxXSAtIG0tPm1bYzEgKyA0KnIxXSAqIG0tPm1bYzIgKyA0KnIwXSkpOworCisgICAgICAgICAgICBmbG9hdCBjb2ZhY3RvciA9IChpK2opICYgMSA/IC1taW5vciA6IG1pbm9yOworCisgICAgICAgICAgICByZXN1bHQubVs0KmkgKyBqXSA9IGNvZmFjdG9yOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gRG90IHByb2R1Y3Qgb2YgMHRoIGNvbHVtbiBvZiBzb3VyY2UgYW5kIDB0aCByb3cgb2YgcmVzdWx0CisgICAgZmxvYXQgZGV0ID0gbS0+bVswXSpyZXN1bHQubVswXSArIG0tPm1bNF0qcmVzdWx0Lm1bMV0gKworICAgICAgICAgICAgICAgICBtLT5tWzhdKnJlc3VsdC5tWzJdICsgbS0+bVsxMl0qcmVzdWx0Lm1bM107CisKKyAgICBpZiAoZmFicyhkZXQpIDwgMWUtNikgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgZGV0ID0gMS4wZiAvIGRldDsKKyAgICBmb3IgKGkgPSAwOyBpIDwgMTY7ICsraSkgeworICAgICAgICBtLT5tW2ldID0gcmVzdWx0Lm1baV0gKiBkZXQ7CisgICAgfQorCisgICAgcmV0dXJuIHRydWU7Cit9CisKKy8vIFJldHVybnMgdHJ1ZSBpZiB0aGUgbWF0cml4IHdhcyBzdWNjZXNzZnVsbHkgaW52ZXJzZWQKK3N0YXRpYyBib29sIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeEludmVyc2VUcmFuc3Bvc2UocnNfbWF0cml4NHg0ICptKSB7CisgICAgcnNfbWF0cml4NHg0IHJlc3VsdDsKKworICAgIGludCBpLCBqOworICAgIGZvciAoaSA9IDA7IGkgPCA0OyArK2kpIHsKKyAgICAgICAgZm9yIChqID0gMDsgaiA8IDQ7ICsraikgeworICAgICAgICAgICAgLy8gY29tcHV0ZUNvZmFjdG9yIGZvciBpbnQgaSwgaW50IGoKKyAgICAgICAgICAgIGludCBjMCA9IChpKzEpICUgNDsKKyAgICAgICAgICAgIGludCBjMSA9IChpKzIpICUgNDsKKyAgICAgICAgICAgIGludCBjMiA9IChpKzMpICUgNDsKKyAgICAgICAgICAgIGludCByMCA9IChqKzEpICUgNDsKKyAgICAgICAgICAgIGludCByMSA9IChqKzIpICUgNDsKKyAgICAgICAgICAgIGludCByMiA9IChqKzMpICUgNDsKKworICAgICAgICAgICAgZmxvYXQgbWlub3IgPSAobS0+bVtjMCArIDQqcjBdICogKG0tPm1bYzEgKyA0KnIxXSAqIG0tPm1bYzIgKyA0KnIyXSAtIG0tPm1bYzEgKyA0KnIyXSAqIG0tPm1bYzIgKyA0KnIxXSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgLSAobS0+bVtjMCArIDQqcjFdICogKG0tPm1bYzEgKyA0KnIwXSAqIG0tPm1bYzIgKyA0KnIyXSAtIG0tPm1bYzEgKyA0KnIyXSAqIG0tPm1bYzIgKyA0KnIwXSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgKyAobS0+bVtjMCArIDQqcjJdICogKG0tPm1bYzEgKyA0KnIwXSAqIG0tPm1bYzIgKyA0KnIxXSAtIG0tPm1bYzEgKyA0KnIxXSAqIG0tPm1bYzIgKyA0KnIwXSkpOworCisgICAgICAgICAgICBmbG9hdCBjb2ZhY3RvciA9IChpK2opICYgMSA/IC1taW5vciA6IG1pbm9yOworCisgICAgICAgICAgICByZXN1bHQubVs0KmogKyBpXSA9IGNvZmFjdG9yOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gRG90IHByb2R1Y3Qgb2YgMHRoIGNvbHVtbiBvZiBzb3VyY2UgYW5kIDB0aCBjb2x1bW4gb2YgcmVzdWx0CisgICAgZmxvYXQgZGV0ID0gbS0+bVswXSpyZXN1bHQubVswXSArIG0tPm1bNF0qcmVzdWx0Lm1bNF0gKworICAgICAgICAgICAgICAgICBtLT5tWzhdKnJlc3VsdC5tWzhdICsgbS0+bVsxMl0qcmVzdWx0Lm1bMTJdOworCisgICAgaWYgKGZhYnMoZGV0KSA8IDFlLTYpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIGRldCA9IDEuMGYgLyBkZXQ7CisgICAgZm9yIChpID0gMDsgaSA8IDE2OyArK2kpIHsKKyAgICAgICAgbS0+bVtpXSA9IHJlc3VsdC5tW2ldICogZGV0OworICAgIH0KKworICAgIHJldHVybiB0cnVlOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhUcmFuc3Bvc2UocnNfbWF0cml4NHg0ICptKSB7CisgICAgaW50IGksIGo7CisgICAgZmxvYXQgdGVtcDsKKyAgICBmb3IgKGkgPSAwOyBpIDwgMzsgKytpKSB7CisgICAgICAgIGZvciAoaiA9IGkgKyAxOyBqIDwgNDsgKytqKSB7CisgICAgICAgICAgICB0ZW1wID0gbS0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AgIHEtPncgPSB3OworICAgIHEtPnggPSB4OworICAgIHEtPnkgPSB5OworICAgIHEtPnogPSB6OworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNRdWF0ZXJuaW9uU2V0KHJzX3F1YXRlcm5pb24gKnEsIGNvbnN0IHJzX3F1YXRlcm5pb24gKnJocykgeworICAgIHEtPncgPSByaHMtPnc7CisgICAgcS0+eCA9IHJocy0+eDsKKyAgICBxLT55ID0gcmhzLT55OworICAgIHEtPnogPSByaHMtPno7Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc1F1YXRlcm5pb25NdWx0aXBseShyc19xdWF0ZXJuaW9uICpxLCBmbG9hdCBzKSB7CisgICAgcS0+dyAqPSBzOworICAgIHEtPnggKj0gczsKKyAgICBxLT55ICo9IHM7CisgICAgcS0+eiAqPSBzOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNRdWF0ZXJuaW9uTXVsdGlwbHkocnNfcXVhdGVybmlvbiAqcSwgY29uc3QgcnNfcXVhdGVybmlvbiAqcmhzKSB7CisgICAgcS0+dyA9IC1xLT54KnJocy0+eCAtIHEtPnkqcmhzLT55IC0gcS0+eipyaHMtPnogKyBxLT53KnJocy0+dzsKKyAgICBxLT54ID0gIHEtPngqcmhzLT53ICsgcS0+eSpyaHMtPnogLSBxLT56KnJocy0+eSArIHEtPncqcmhzLT54OworICAgIHEtPnkgPSAtcS0+eCpyaHMtPnogKyBxLT55KnJocy0+dyArIHEtPnoqcmhzLT56ICsgcS0+dypyaHMtPnk7CisgICAgcS0+eiA9ICBxLT54KnJocy0+eSAtIHEtPnkqcmhzLT54ICsgcS0+eipyaHMtPncgKyBxLT53KnJocy0+ejsKK30KKworc3RhdGljIHZvaWQKK3JzUXVhdGVybmlvbkFkZChyc19xdWF0ZXJuaW9uICpxLCBjb25zdCByc19xdWF0ZXJuaW9uICpyaHMpIHsKKyAgICBxLT53ICo9IHJocy0+dzsKKyAgICBxLT54ICo9IHJocy0+eDsKKyAgICBxLT55ICo9IHJocy0+eTsKKyAgICBxLT56ICo9IHJocy0+ejsKK30KKworc3RhdGljIHZvaWQKK3JzUXVhdGVybmlvbkxvYWRSb3RhdGVVbml0KHJzX3F1YXRlcm5pb24gKnEsIGZsb2F0IHJvdCwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgIHJvdCAqPSAoZmxvYXQpKE1fUEkgLyAxODAuMGYpICogMC41ZjsKKyAgICBmbG9hdCBjID0gY29zKHJvdCk7CisgICAgZmxvYXQgcyA9IHNpbihyb3QpOworCisgICAgcS0+dyA9IGM7CisgICAgcS0+eCA9IHggKiBzOworICAgIHEtPnkgPSB5ICogczsKKyAgICBxLT56ID0geiAqIHM7Cit9CisKK3N0YXRpYyB2b2lkCityc1F1YXRlcm5pb25Mb2FkUm90YXRlKHJzX3F1YXRlcm5pb24gKnEsIGZsb2F0IHJvdCwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgIGNvbnN0IGZsb2F0IGxlbiA9IHgqeCArIHkqeSArIHoqejsKKyAgICBpZiAobGVuICE9IDEpIHsKKyAgICAgICAgY29uc3QgZmxvYXQgcmVjaXBMZW4gPSAxLmYgLyBzcXJ0KGxlbik7CisgICAgICAgIHggKj0gcmVjaXBMZW47CisgICAgICAgIHkgKj0gcmVjaXBMZW47CisgICAgICAgIHogKj0gcmVjaXBMZW47CisgICAgfQorICAgIHJzUXVhdGVybmlvbkxvYWRSb3RhdGVVbml0KHEsIHJvdCwgeCwgeSwgeik7Cit9CisKK3N0YXRpYyB2b2lkCityc1F1YXRlcm5pb25Db25qdWdhdGUocnNfcXVhdGVybmlvbiAqcSkgeworICAgIHEtPnggPSAtcS0+eDsKKyAgICBxLT55ID0gLXEtPnk7CisgICAgcS0+eiA9IC1xLT56OworfQorCitzdGF0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F0ZXJuaW9uTXVsdGlwbHkoJnRlbXBxMCwgLTEuMGYpOworICAgICAgICBhbmdsZSAqPSAtMS4wZjsKKyAgICB9CisKKyAgICBmbG9hdCBzY2FsZSwgaW52U2NhbGU7CisgICAgaWYgKGFuZ2xlICsgMS4wZiA+IDAuMDVmKSB7CisgICAgICAgIGlmICgxLjBmIC0gYW5nbGUgPj0gMC4wNWYpIHsKKyAgICAgICAgICAgIGZsb2F0IHRoZXRhID0gYWNvcyhhbmdsZSk7CisgICAgICAgICAgICBmbG9hdCBpbnZTaW5UaGV0YSA9IDEuMGYgLyBzaW4odGhldGEpOworICAgICAgICAgICAgc2NhbGUgPSBzaW4odGhldGEgKiAoMS4wZiAtIHQpKSAqIGludlNpblRoZXRhOworICAgICAgICAgICAgaW52U2NhbGUgPSBzaW4odGhldGEgKiB0KSAqIGludlNpblRoZXRhOworICAgICAgICB9CisgICAgICAgIGVsc2UgeworICAgICAgICAgICAgc2NhbGUgPSAxLjBmIC0gdDsKKyAgICAgICAgICAgIGludlNjYWxlID0gdDsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIHsKKyAgICAgICAgcnNRdWF0ZXJuaW9uU2V0KCZ0ZW1wcTEsIHRlbXBxMC56LCAtdGVtcHEwLnksIHRlbXBxMC54LCAtdGVtcHEwLncpOworICAgICAgICBzY2FsZSA9IHNpbihNX1BJICogKDAuNWYgLSB0KSk7CisgICAgICAgIGludlNjYWxlID0gc2luKE1fUEkgKiB0KTsKKyAgICB9CisKKyAgICByc1F1YXRlcm5pb25TZXQocSwgdGVtcHEwLncqc2NhbGUgKyB0ZW1wcTEudyppbnZTY2FsZSwgdGVtcHEwLngqc2NhbGUgKyB0ZW1wcTEueCppbnZTY2FsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBxMC55KnNjYWxlICsgdGVtcHExLnkqaW52U2NhbGUsIHRlbXBxMC56KnNjYWxlICsgdGVtcHExLnoqaW52U2NhbGUpOworfQorCitzdGF0aWMgdm9pZCByc1F1YXRlcm5pb25HZXRNYXRyaXhVbml0KHJzX21hdHJpeDR4NCAqbSwgY29uc3QgcnNfcXVhdGVybmlvbiAqcSkgeworICAgIGZsb2F0IHgyID0gMi4wZiAqIHEtPnggKiBxLT54OworICAgIGZsb2F0IHkyID0gMi4wZiAqIHEtPnkgKiBxLT55OworICAgIGZsb2F0IHoyID0gMi4wZiAqIHEtPnogKiBxLT56OworICAgIGZsb2F0IHh5ID0gMi4wZiAqIHEtPnggKiBxLT55OworICAgIGZsb2F0IHd6ID0gMi4wZiAqIHEtPncgKiBxLT56OworICAgIGZsb2F0IHh6ID0gMi4wZiAqIHEtPnggKiBxLT56OworICAgIGZsb2F0IHd5ID0gMi4wZiAqIHEtPncgKiBxLT55OworICAgIGZsb2F0IHd4ID0gMi4wZiAqIHEtPncgKiBxLT54OworICAgIGZsb2F0IHl6ID0gMi4wZiAqIHEtPnkgKiBxLT56OworCisgICAgbS0+bVswXSA9IDEuMGYgLSB5MiAtIHoyOworICAgIG0tPm1bMV0gPSB4eSAtIHd6OworICAgIG0tPm1bMl0gPSB4eiArIHd5OworICAgIG0tPm1bM10gPSAwLjBmOworCisgICAgbS0+bVs0XSA9IHh5ICsgd3o7CisgICAgbS0+bVs1XSA9IDEuMGYgLSB4MiAtIHoyOworICAgIG0tPm1bNl0gPSB5eiAtIHd4OworICAgIG0tPm1bN10gPSAwLjBmOworCisgICAgbS0+bVs4XSA9IHh6IC0gd3k7CisgICAgbS0+bVs5XSA9IHl6IC0gd3g7CisgICAgbS0+bVsxMF0gPSAxLjBmIC0geDIgLSB5MjsKKyAgICBtLT5tWzExXSA9IDAuMGY7CisKKyAgICBtLT5tWzEyXSA9IDAuMGY7CisgICAgbS0+bVsxM10gPSAwLjBmOworICAgIG0tPm1bMTRdID0gMC4wZjsKKyAgICBtLT5tWzE1XSA9IDEuMGY7Cit9CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vL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XdQcm9qLT5tWzhdOworICAgIHJpZ2h0LT53ID0gbW9kZWxWaWV3UHJvai0+bVsxNV0gLSBtb2RlbFZpZXdQcm9qLT5tWzEyXTsKKworICAgIHRvcC0+eCA9IG1vZGVsVmlld1Byb2otPm1bM10gLSBtb2RlbFZpZXdQcm9qLT5tWzFdOworICAgIHRvcC0+eSA9IG1vZGVsVmlld1Byb2otPm1bN10gLSBtb2RlbFZpZXdQcm9qLT5tWzVdOworICAgIHRvcC0+eiA9IG1vZGVsVmlld1Byb2otPm1bMTFdIC0gbW9kZWxWaWV3UHJvai0+bVs5XTsKKyAgICB0b3AtPncgPSBtb2RlbFZpZXdQcm9qLT5tWzE1XSAtIG1vZGVsVmlld1Byb2otPm1bMTNdOworCisgICAgYm90dG9tLT54ID0gbW9kZWxWaWV3UHJvai0+bVszXSArIG1vZGVsVmlld1Byb2otPm1bMV07CisgICAgYm90dG9tLT55ID0gbW9kZWxWaWV3UHJvai0+bVs3XSArIG1vZGVsVmlld1Byb2otPm1bNV07CisgICAgYm90dG9tLT56ID0gbW9kZWxWaWV3UHJvai0+bVsxMV0gKyBtb2RlbFZpZXdQcm9qLT5tWzldOworICAgIGJvdHRvbS0+dyA9IG1vZGVsVmlld1Byb2otPm1bMTVdICsgbW9kZWxWaWV3UHJvai0+bVsxM107CisKKyAgICBuZWFyLT54ID0gbW9kZWxWaWV3UHJvai0+bVszXSArIG1vZGVsVmlld1Byb2otPm1bMl07CisgICAgbmVhci0+eSA9IG1vZGVsVmlld1Byb2otPm1bN10gKyBtb2RlbFZpZXdQcm9qLT5tWzZdOworICAgIG5lYXItPnogPSBtb2RlbFZpZXdQcm9qLT5tWzExXSArIG1vZGVsVmlld1Byb2otPm1bMTBdOworICAgIG5lYXItPncgPSBtb2RlbFZpZXdQcm9qLT5tWzE1XSArIG1vZGVsVmlld1Byb2otPm1bMTRdOworCisgICAgZmFyLT54ID0gbW9kZWxWaWV3UHJvai0+bVszXSAtIG1vZGVsVmlld1Byb2otPm1b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wgLXNwaGVyZS0+dykgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIGRpc3RUb0NlbnRlciA9IGRvdChyaWdodC0+eHl6LCBzcGhlcmUtPnh5eikgKyByaWdodC0+dzsKKyAgICBpZihkaXN0VG9DZW50ZXIgPCAtc3BoZXJlLT53KSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgZGlzdFRvQ2VudGVyID0gZG90KHRvcC0+eHl6LCBzcGhlcmUtPnh5eikgKyB0b3AtPnc7CisgICAgaWYoZGlzdFRvQ2VudGVyIDwgLXNwaGVyZS0+dykgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIGRpc3RUb0NlbnRlciA9IGRvdChib3R0b20tPnh5eiwgc3BoZXJlLT54eXopICsgYm90dG9tLT53OworICAgIGlmKGRpc3RUb0NlbnRlciA8IC1zcGhlcmUtPncpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBkaXN0VG9DZW50ZXIgPSBkb3QobmVhci0+eHl6LCBzcGhlcmUtPnh5eikgKyBuZWFyLT53OworICAgIGlmKGRpc3RUb0NlbnRlciA8IC1zcGhlcmUtPncpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBkaXN0VG9DZW50ZXIgPSBkb3QoZmFyLT54eXosIHNwaGVyZS0+eHl6KSArIGZhci0+dzsKKyAgICBpZihkaXN0VG9DZW50ZXIgPCAtc3BoZXJlLT53KSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgcmV0dXJuIHRydWU7Cit9CisKKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKy8vIGludCBvcHMKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKK19faW5saW5lX18gc3RhdGljIHVp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lvbgorICAgIGlmIChidWZmZXIgIT0gMCkgeyAvLyB0aGlzIHNob3VsZCBhbHdheXMgaGFwcGVuIGJ5IGNvbnN0cnVjdGlvbgogICAgICAgICBMT0dFX0lGKGJ1ZmZlci0+aGFuZGxlID09IE5VTEwsIAogICAgICAgICAgICAgICAgICJTdXJmYWNlIChpZGVudGl0eT0lZCkgcmVxdWVzdEJ1ZmZlciglZCwgJXUsICV1LCAldSwgJTA4eCkgIgogICAgICAgICAgICAgICAgICJyZXR1cm5lZCBhIGJ1ZmZlciB3aXRoIGEgbnVsbCBoYW5kbGUiLApAQCAtMTA1MiwxMyArMTA2NSw4IEBACiAgICAgICAgIGVyciA9IG1TaGFyZWRCdWZmZXJDbGllbnQtPmdldFN0YXR1cygpOwogICAgICAgICBMT0dFX0lGKGVyciwgICJTdXJmYWNlIChpZGVudGl0eT0lZCkgc3RhdGUgPSAlZCIsIG1JZGVudGl0eSwgZXJyKTsKICAgICAgICAgaWYgKCFlcnIgJiYgYnVmZmVyLT5oYW5kbGUgIT0gTlVMTCkgewotICAgICAgICAgICAgZXJyID0gZ2V0QnVmZmVyTWFwcGVyKCkucmVnaXN0ZXJCdWZmZXIoYnVmZmVyLT5oYW5kbGUpOwotICAgICAgICAgICAgTE9HV19JRihlcnIsICJyZWdpc3RlckJ1ZmZlciguLi4pIGZhaWxlZCAlZCAoJXMpIiwKLSAgICAgICAgICAgICAgICAgICAgZXJyLCBzdHJlcnJvcigtZXJyKSk7Ci0gICAgICAgICAgICBpZiAoZXJyID09IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICAgICAgY3VycmVudEJ1ZmZlciA9IGJ1ZmZlcjsKLSAgICAgICAgICAgICAgICBjdXJyZW50QnVmZmVyLT5zZXRJbmRleChpbmRleCk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBjdXJyZW50QnVmZmVyID0gYnVmZmVyOworICAgICAgICAgICAgY3VycmVudEJ1ZmZlci0+c2V0SW5kZXgoaW5kZXgpOwogICAg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EtleWJvYXJkUHJvcGVydGllcyhkZXZpY2UsIHRydWUpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIGNoYXIgcHJvcE5hbWVbMTAwXTsKLSAgICAgICAgc3ByaW50Zihwcm9wTmFtZSwgImh3LmtleWJvYXJkcy4ldS5kZXZuYW1lIiwgZGV2aWNlLT5pZCk7Ci0gICAgICAgIHByb3BlcnR5X3NldChwcm9wTmFtZSwgbmFtZSk7CisgICAgICAgIHNldEtleWJvYXJkUHJvcGVydGllcyhkZXZpY2UsIGZhbHNlKTsKKworICAgICAgICAvLyBMb2FkIHRoZSBrZXlsYXlvdXQuCisgICAgICAgIGlmICghZGV2aWNlLT5rZXlMYXlvdXRGaWxlbmFtZS5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGRldmljZS0+bGF5b3V0TWFwLT5sb2FkKGRldmljZS0+a2V5TGF5b3V0RmlsZW5hbWUpOworICAgICAgICAgICAgaWYgKHN0YXR1cykgeworICAgICAgICAgICAgICAgIExPR0UoIkVycm9yICVkIGxvYWRpbmcga2V5IGxheW91dCBmaWxlICclcycuIiwgc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlLT5rZXlMYXlvdXRGaWxlbmFtZS5zdHJpbmcoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KIAogICAgICAgICAvLyAnUScga2V5IHN1cHBvcnQgPSBjaGVhcCB0ZXN0IG9mIHdoZXRoZXIgdGhpcyBpcyBhbiBhbHBoYS1jYXBhYmxlIGtiZAogICAgICAgICBpZiAoaGFzS2V5Y29kZUxvY2tlZChkZXZpY2UsIEFLRVlDT0RFX1EpKSB7CiAgICAgICAgICAgICBkZXZpY2UtPmNsYXNzZXMgfD0gSU5QVVRfREVWSUNFX0NMQVNTX0FMUEhBS0VZOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIC8vIFNlZSBpZiB0aGlzIGRldmljZSBoYXM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V0KHByb3BOYW1lLCAiIik7Cit9CisKIGJvb2wgRXZlbnRIdWI6Omhhc0tleWNvZGVMb2NrZWQoZGV2aWNlX3QqIGRldmljZSwgaW50IGtleWNvZGUpIGNvbnN0CiB7CiAgICAgaWYgKGRldmljZS0+a2V5Qml0bWFzayA9PSBOVUxMIHx8IGRldmljZS0+bGF5b3V0TWFwID09IE5VTEwpIHsKQEAgLTkxMiwxMyArMTAzNywxMCBAQAogICAgICAgICAgICAgaWYgKGRldmljZS0+aWQgPT0gbUZpcnN0S2V5Ym9hcmRJZCkgewogICAgICAgICAgICAgICAgIExPR1coImJ1aWx0LWluIGtleWJvYXJkIGRldmljZSAlcyAoaWQ9JWQpIGlzIGNsb3NpbmchIHRoZSBhcHBzIHdpbGwgbm90IGxpa2UgdGhpcyIsCiAgICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2UtPnBhdGguc3RyaW5nKCksIG1GaXJzdEtleWJvYXJkSWQpOwotICAgICAgICAgICAgICAgIG1GaXJzdEtleWJvYXJkSWQgPSAwOwotICAgICAgICAgICAgICAgIHByb3BlcnR5X3NldCgiaHcua2V5Ym9hcmRzLjAuZGV2bmFtZSIsIE5VTEwpOworICAgICAgICAgICAgICAgIG1GaXJzdEtleWJvYXJkSWQgPSAtMTsKKyAgICAgICAgICAgICAgICBjbGVhcktleWJvYXJkUHJvcGVydGllcyhkZXZpY2UsIHRydWUpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gY2xlYXIgdGhlIHByb3BlcnR5Ci0gICAgICAgICAgICBjaGFyIHByb3BOYW1lWzEwMF07Ci0gICAgICAgICAgICBzcHJpbnRmKHByb3BOYW1lLCAiaHcua2V5Ym9hcmRzLiV1LmRldm5hbWUiLCBkZXZpY2UtPmlkKTsKLSAgICAgICAgICAgIHByb3BlcnR5X3NldChwcm9wTmFtZSwgTlVMTCk7CisgICAgICAgICAgICBjbGVhcktleWJvYXJkUHJvcGVydGllcyhkZXZpY2UsIGZhbHNlKTsKICAgIC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A9PSBBS0VZX0VWRU5UX0FDVElPTl9ET1dOCisgICAgICAgICAgICAgICAgJiYgKGVudHJ5LT5wb2xpY3lGbGFncyAmIFBPTElDWV9GTEFHX1RSVVNURUQpCisgICAgICAgICAgICAgICAgJiYgIWVudHJ5LT5pc0luamVjdGVkKCkpIHsKKyAgICAgICAgICAgIGlmIChtS2V5UmVwZWF0U3RhdGUubGFzdEtleUVudHJ5CisgICAgICAgICAgICAgICAgICAgICYmIG1LZXlSZXBlYXRTdGF0ZS5sYXN0S2V5RW50cnktPmtleUNvZGUgPT0gZW50cnktPmtleUNvZGUpIHsKKyAgICAgICAgICAgICAgICAvLyBXZSBoYXZlIHNlZW4gdHdvIGlkZW50aWNhbCBrZXkgZG93bnMgaW4gYSByb3cgd2hpY2ggaW5kaWNhdGVzIHRoYXQgdGhlIGRldmljZQorICAgICAgICAgICAgICAgIC8vIGRyaXZlciBpcyBhdXRvbWF0aWNhbGx5IGdlbmVyYXRpbmcga2V5IHJlcGVhdHMgaXRzZWxmLiAgV2UgdGFrZSBub3RlIG9mIHRoZQorICAgICAgICAgICAgICAgIC8vIHJlcGVhdCBoZXJlLCBidXQgd2UgZGlzYWJsZSBvdXIgb3duIG5leHQga2V5IHJlcGVhdCB0aW1lciBzaW5jZSBpdCBpcyBjbGVhciB0aGF0CisgICAgICAgICAgICAgICAgLy8gd2Ugd2lsbCBub3QgbmVlZCB0byBzeW50aGVzaXplIGtleSByZXBlYXRzIG91cnNlbHZlcy4KKyAgICAgICAgICAgICAgICBlbnRyeS0+cmVwZWF0Q291bnQgPSBtS2V5UmVwZWF0U3RhdGUubGFzdEtleUVudHJ5LT5yZXBlYXRDb3VudCArIDE7CisgICAgICAgICAgICAgICAgcmVzZXRLZXlSZXBlYXRMb2NrZWQoKTsKKyAgICAgICAgICAgICAgICBtS2V5UmVwZWF0U3RhdGUubmV4dFJlcGVhdFRpbWUgPSBMT05HX0xPTkdfTUFYOyAvLyBkb24ndCBnZW5lcmF0ZSByZXBlYX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xdWlyZSBsb2NrCisgICAgICAgIEF1dG9NdXRleCBfbChtTG9jayk7CisKKyAgICAgICAgY29uc3QgSW5wdXRXaW5kb3cqIGZyb21XaW5kb3cgPSBnZXRXaW5kb3dMb2NrZWQoZnJvbUNoYW5uZWwpOworICAgICAgICBjb25zdCBJbnB1dFdpbmRvdyogdG9XaW5kb3cgPSBnZXRXaW5kb3dMb2NrZWQodG9DaGFubmVsKTsKKyAgICAgICAgaWYgKCEgZnJvbVdpbmRvdyB8fCAhIHRvV2luZG93KSB7CisjaWYgREVCVUdfRk9DVVMKKyAgICAgICAgICAgIExPR0QoIkNhbm5vdCB0cmFuc2ZlciBmb2N1cyBiZWNhdXNlIGZyb20gb3IgdG8gd2luZG93IG5vdCBmb3VuZC4iKTsKKyNlbmRpZgorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIGlmIChmcm9tV2luZG93ID09IHRvV2luZG93KSB7CisjaWYgREVCVUdfRk9DVVMKKyAgICAgICAgICAgIExPR0QoIlRyaXZpYWwgdHJhbnNmZXIgdG8gc2FtZSB3aW5kb3cuIik7CisjZW5kaWYKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgYm9vbCBmb3VuZCA9IGZhbHNlOworICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1Ub3VjaFN0YXRlLndpbmRvd3Muc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgIGNvbnN0IFRvdWNoZWRXaW5kb3cmIHRvdWNoZWRXaW5kb3cgPSBtVG91Y2hTdGF0ZS53aW5kb3dzW2ldOworICAgICAgICAgICAgaWYgKHRvdWNoZWRXaW5kb3cud2luZG93ID09IGZyb21XaW5kb3cpIHsKKyAgICAgICAgICAgICAgICBpbnQzMl90IG9sZFRhcmdldEZsYWdzID0gdG91Y2hlZFdpbmRvdy50YXJnZXRGbGFnczsKKyAgICAgICAgICAgICAgICBCaXRTZXQzMiBwb2ludGVySWRzID0gdG91Y2hlZFdpbmRvdy5wb2ludGVySWRzOworCisgICAgICAgICAgICAgICAgbVRvdWNoU3RhdGUud2luZG93cy5yZW1vdmVBdChpKTsKKworICAgICAgICAgICAgICAgIGludDMyX3QgbmV3VGFyZ2V0RmxhZ3MgPSAwOworICAgICAgICAgICAgICAgIGlmIChvbGRUYXJnZXRGbGFncyAmIElucHV0VGFyZ2V0OjpGTEFHX0ZPUkVHUk9VTkQpIHsKKyAgICAgICAgICAgICAgICAgICAgbmV3VGFyZ2V0RmxhZ3MgfD0gSW5wdXRUYXJnZXQ6OkZMQUdfRk9SRUdST1VORDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRvV2luZG93LT5sYXlvdXRQYXJhbXNGbGFncyAmIElucHV0V2luZG93OjpGTEFHX1NQTElUX1RPVUNIKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXdUYXJnZXRGbGFncyB8PSBJbnB1dFRhcmdldDo6RkxBR19TUExJVDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtVG91Y2hTdGF0ZS5hZGRPclVwZGF0ZVdpbmRvdyh0b1dpbmRvdywgbmV3VGFyZ2V0RmxhZ3MsIHBvaW50ZXJJZHMpOworCisgICAgICAgICAgICAgICAgZm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKCEgZm91bmQpIHsKKyNpZiBERUJVR19GT0NVUworICAgICAgICAgICAgTE9HRCgiRm9jdXMgdHJhbnNmZXIgZmFpbGVkIGJlY2F1c2UgZnJvbSB3aW5kb3cgZGlkIG5vdCBoYXZlIGZvY3VzLiIpOworI2VuZGlmCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBzc2l6ZV90IGZyb21Db25uZWN0aW9uSW5kZXggPSBnZXRDb25uZWN0aW9uSW5kZX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5jbGVhcigpOwogfQogCit2b2lkIElucHV0RGlzcGF0Y2hlcjo6SW5wdXRTdGF0ZTo6Y29weVBvaW50ZXJTdGF0ZVRvKElucHV0U3RhdGUmIG90aGVyKSBjb25zdCB7CisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtTW90aW9uTWVtZW50b3Muc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgY29uc3QgTW90aW9uTWVtZW50byYgbWVtZW50byA9IG1Nb3Rpb25NZW1lbnRvcy5pdGVtQXQoaSk7CisgICAgICAgIGlmIChtZW1lbnRvLnNvdXJjZSAmIEFJTlBVVF9TT1VSQ0VfQ0xBU1NfUE9JTlRFUikgeworICAgICAgICAgICAgZm9yIChzaXplX3QgaiA9IDA7IGogPCBvdGhlci5tTW90aW9uTWVtZW50b3Muc2l6ZSgpOyApIHsKKyAgICAgICAgICAgICAgICBjb25zdCBNb3Rpb25NZW1lbnRvJiBvdGhlck1lbWVudG8gPSBvdGhlci5tTW90aW9uTWVtZW50b3MuaXRlbUF0KGopOworICAgICAgICAgICAgICAgIGlmIChtZW1lbnRvLmRldmljZUlkID09IG90aGVyTWVtZW50by5kZXZpY2VJZAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgbWVtZW50by5zb3VyY2UgPT0gb3RoZXJNZW1lbnRvLnNvdXJjZSkgeworICAgICAgICAgICAgICAgICAgICBvdGhlci5tTW90aW9uTWVtZW50b3MucmVtb3ZlQXQoaik7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaiArPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG90aGVyLm1Nb3Rpb25NZW1lbnRvcy5wdXNoKG1lbWVudG8pOworICAgICAgICB9CisgICAgfQorfQorCiBib29sIElucHV0RGlzcGF0Y2hlcjo6SW5wdXRTdGF0ZTo6c2hvdWxkQ2FuY2VsRXZlbnQoaW50MzJfdCBldmVudFNvdXJjZSwKIC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ICBjb25zdCBjaGFyKiByb290ID0gZ2V0ZW52KCJBTkRST0lEX1JPT1QiKTsKIAogICAgIHNwcmludGYocHJvcE5hbWUsICJody5rZXlib2FyZHMuJXUuZGV2bmFtZSIsIGlkKTsKICAgICBlcnIgPSBwcm9wZXJ0eV9nZXQocHJvcE5hbWUsIGRldiwgIiIpOwogICAgIGlmIChlcnIgPiAwKSB7CiAgICAgICAgIC8vIHJlcGxhY2UgYWxsIHRoZSBzcGFjZXMgd2l0aCB1bmRlcnNjb3JlcwotICAgICAgICBzdHJjcHkodG1wZm4sIGRldik7Ci0gICAgICAgIGZvciAoY2hhciAqcCA9IHN0cmNocih0bXBmbiwgJyAnKTsgcCAmJiAqcDsgcCA9IHN0cmNocih0bXBmbiwgJyAnKSkKKyAgICAgICAgc3RyY3B5KGZuLCBkZXYpOworICAgICAgICBmb3IgKGNoYXIgKnAgPSBzdHJjaHIoZm4sICcgJyk7IHAgJiYgKnA7IHAgPSBzdHJjaHIocCArIDEsICcgJykpCiAgICAgICAgICAgICAqcCA9ICdfJzsKLSAgICAgICAgc25wcmludGYocGF0aCwgc2l6ZW9mKHBhdGgpLCAiJXMvdXNyL2tleWNoYXJzLyVzLmtjbS5iaW4iLCByb290LCB0bXBmbik7Ci0gICAgICAgIC8vTE9HRCgibG9hZDogZGV2PSclcycgcGF0aD0nJXMnXG4iLCBkZXYsIHBhdGgpOwotICAgICAgICBydiA9IHRyeV9maWxlKHBhdGgpOwotICAgICAgICBpZiAocnYgIT0gTlVMTCkgewotICAgICAgICAgICAgcmV0dXJuIHJ2OworICAgICAgICBzbnByaW50ZihwYXRoLCBzaXplb2YocGF0aCksICIlcy91c3Iva2V5Y2hhcnMvJXMua2NtLmJpbiIsIHJvb3QsIGZuKTsKKyAgICAgICAgbWFwID0gdHJ5X2ZpbGUocGF0aCk7CisgICAgICAgIGlmIChtYXApIHsKKyAgICAgICAgICAgIHJldHVybiBtYXA7CiAgICAgICAgIH0KICAgICAgICAgTE9HVygiRXJyb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KICAgICB9CisKKyAgICAvLyBBbGxvdyBvdmVycmlkaW5nIGRlbnNpdHkKKyAgICBjb25zdCBSZXNUYWJsZV9jb25maWcqIGRlc2lyZWRDb25maWcgPSAmbVBhcmFtczsKKyAgICBSZXNUYWJsZV9jb25maWcqIG92ZXJyaWRlQ29uZmlnID0gTlVMTDsKKyAgICBpZiAoZGVuc2l0eSA+IDApIHsKKyAgICAgICAgb3ZlcnJpZGVDb25maWcgPSAoUmVzVGFibGVfY29uZmlnKikgbWFsbG9jKHNpemVvZihSZXNUYWJsZV9jb25maWcpKTsKKyAgICAgICAgaWYgKG92ZXJyaWRlQ29uZmlnID09IE5VTEwpIHsKKyAgICAgICAgICAgIExPR0UoIkNvdWxkbid0IG1hbGxvYyBSZXNUYWJsZV9jb25maWcgZm9yIG92ZXJyaWRlczogJXMiLCBzdHJlcnJvcihlcnJubykpOworICAgICAgICAgICAgcmV0dXJuIEJBRF9JTkRFWDsKKyAgICAgICAgfQorICAgICAgICBtZW1jcHkob3ZlcnJpZGVDb25maWcsICZtUGFyYW1zLCBzaXplb2YoUmVzVGFibGVfY29uZmlnKSk7CisgICAgICAgIG92ZXJyaWRlQ29uZmlnLT5kZW5zaXR5ID0gZGVuc2l0eTsKKyAgICAgICAgZGVzaXJlZENvbmZpZyA9IG92ZXJyaWRlQ29uZmlnOworICAgIH0KKworICAgIHNzaXplX3QgcmMgPSBCQURfVkFMVUU7CiAgICAgc2l6ZV90IGlwID0gZ3JwLT5wYWNrYWdlcy5zaXplKCk7CiAgICAgd2hpbGUgKGlwID4gMCkgewogICAgICAgICBpcC0tOwpAQCAtMTkzMSwxMiArMTk1OSwxMyBAQAogICAgICAgICBjb25zdCBSZXNUYWJsZV90eXBlKiB0eXBlOwogICAgICAgICBjb25zdCBSZXNUYWJsZV9lbnRyeSogZW50cnk7CiAgICAgICAgIGNvbnN0IFR5cGUqIHR5cGVDbGFzczsKLSAgICAgICAgc3NpemVfdCBvZmZzZXQgPSBnZXRFbnRyeShwYWNrYWdlLCB0LCBlLCAmbVBhcmFtcywgJnR5cGUsICZlbnRyeSwgJnR5cGVDbGFzcyk7CisgICAgICAgIHNzaXplX3Qgb2Zmc2V0ID0gZ2V0RW50cnkocGFja2FnZSwgdCwgZSwgZGVzaXJlZENvbmZpZywgJnR5cGUsICZlbnRyeSwgJnR5cGVDbGFzcyk7CiAgICAgICAgIGlmIChvZmZzZXQgPD0gMCkgewogICAgICAgICAgICAgaWYgKG9mZnNldCA8IDApIHsKICAgICAgICAgICAgICAgICBMT0dXKCJGYWlsdXJlIGdldHRpbmcgZW50cnkgZm9yIDB4JTA4eCAodD0lZCBlPSVkKSBpbiBwYWNrYWdlICV6ZCAoZXJyb3IgJWQpXG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgcmVzSUQsIHQsIGUsIGlwLCAoaW50KW9mZnNldCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG9mZnNldDsKKyAgICAgICAgICAgICAgICByYyA9IG9mZnNldDsKKyAgICAgICAgICAgICAgICBnb3RvIG91dDsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICB9CkBAIC0xOTUxLDEzICsxOTgwLDE0IEBACiAKICAgICAgICAgVEFCTEVfTk9JU1koYW91dCA8PCAiUmVzb3VyY2UgdHlwZSBkYXRhOiAiCiAgICAgICAgICAgICAgIDw8IEhleER1bXAodHlwZSwgZHRvaGwodHlwZS0+aGVhZGVyLnNpemUpKSA8PCBlbmRsKTsKLSAgICAgICAgCisKICAgICAgICAgaWYgKChzaXplX3Qpb2Zmc2V0ID4gKGR0b2hsKHR5cGUtPmhlYWRlci5zaXplKS1zaXplb2YoUmVzX3ZhbHVlKSkpIHsKICAgICAgICAgICAgIExPR1coIlJlc1RhYmxlX2l0ZW0gYXQgJWQgaXMgYmV5b25kIHR5cGUgY2h1bmsgZGF0YSAlZCIsCiAgICAgICAgICAgICAgICAgIChpbnQpb2Zmc2V0LCBkdG9obCh0eXBlLT5oZWFkZXIuc2l6ZSkpOwotICAgICAgICAgICAgcmV0dXJuIEJBRF9UWVBFOworICAgICAgICAgICAgcmMgPSBCQURfVFlQRTsKKyAgICAgICAgICAgIGdvdG8gb3V0OwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIGNvbnN0IFJlc192YWx1ZSogaXRlbSA9CiAgICAgICAgICAgICAoY29uc3QgUmVzX3ZhbHVlKikoKChjb25zdCB1aW50OF90Kil0eXBlKSArIG9mZnNldCk7CiAgICAgICAgIFJlc1RhYmxlX2NvbmZpZyB0aGlzQ29uZmlnOwpAQCAtMTk5OSwxMCArMjAyOSwxNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgIG91dFZhbHVlLT5kYXRhLCAmbGVuKSkuc3RyaW5nKCkKICAgICAgICAgICAgICAgICAgICAgIDogIiIsCiAgICAgICAgICAgICAgICAgICAgICBvdXRWYWx1ZS0+ZGF0YSkpOwotICAgICAgICByZXR1cm4gYmVzdFBhY2thZ2UtPmhlYWRlci0+aW5kZXg7CisgICAgICAgIHJjID0gYmVzdFBhY2thZ2UtPmhlYWRlci0+aW5kZXg7CisgICAgICAgIGdvdG8gb3V0OwogICAgIH0KIAotICAgIHJldHVybiBCQURfVkFMVUU7CitvdXQ6CisgICAgaWYgKG92ZXJyaWRlQ29uZmlnICE9IE5VTEwpIHsKKyAgICAgICAgZnJlZShvdmVycmlkZUNvbmZpZyk7CisgICAgfQorCisgICAgcmV0dXJuIHJjOwogfQogCiBzc2l6ZV90IFJlc1RhYmxlOjpyZXNvbHZlUmVmZXJlbmNlKFJlc192YWx1ZSogdmFsdWUsIHNzaXplX3QgYmxvY2tJbmRleCwKQEAgLTIwMTUsNyArMjA1MSw3IEBACiAgICAgICAgIGlmIChvdXRMYXN0UmVmKSAqb3V0TGFzdFJlZiA9IHZhbHVlLT5kYXRhOwogICAgICAgICB1aW50MzJfdCBsYXN0UmVmID0gdmFsdWUtPmRhdGE7CiAgICAgICAgIHVpbnQzMl90IG5ld0ZsYWdzID0gMDsKLSAgICAgICAgY29uc3Qgc3NpemVfdCBuZXdJbmRleCA9IGdldFJlc291cmNlKHZhbHVlLT5kYXRhLCB2YWx1ZSwgdHJ1ZSwgJm5ld0ZsYWdzLAorICAgICAgICBjb25zdCBzc2l6ZV90IG5ld0luZGV4ID0gZ2V0UmVzb3VyY2UodmFsdWUtPmRhdGEsIHZhbHVlLCB0cnVlLCAwLCAmbmV3RmxhZ3MsCiAgICAgICAgICAgICAgICAgb3V0Q29uZmlnKTsKICAgICAgICAgaWYgKG5ld0luZGV4ID09IEJBRF9JTkRFWCkgewogICAgICAgICAgICAgcmV0dXJuIEJBRF9JTkRFWDsKQEAgLTI2MDksNiArMjY0NSwyNCBAQAogICAgICAgICAqb3V0VHlwZSA9ICpkZWZUeXBlOwogICAgIH0KICAgICAqb3V0TmFtZSA9IFN0cmluZzE2KHAsIGVuZC1wKTsKKyAgICBpZigqKm91dFBhY2thZ2UgPT0gMCkgeworICAgICAgICBpZihvdXRFcnJvck1zZykgeworICAgICAgICAgICAgKm91dEVycm9yTXNnID0gIlJlc291cmNlIHBhY2thZ2UgY2Fubm90IGJlIGFuIGVtcHR5IHN0cmluZyI7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBpZigqKm91dFR5cGUgPT0gMCkgeworICAgICAgICBpZihvdXRFcnJvck1zZykgeworICAgICAgICAgICAgKm91dEVycm9yTXNnID0gIlJlc291cmNlIHR5cGUgY2Fubm90IGJlIGFuIGVtcHR5IHN0cmluZyI7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBpZigqKm91dE5hbWUgPT0gMCkgeworICAgICAgICBpZihvdXRFcnJvck1zZykgeworICAgICAgICAgICAgKm91dEVycm9yTXNnID0gIlJlc291cmNlIGlkIGNhbm5vdCBiZSBhbiBlbXB0eSBzdHJpbmciOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CiAgICAgcmV0dXJuIHRydWU7CiB9CiAKQEAgLTQxMjcsMTMgKzQxODEsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgKDB4MDBmZjAwMDAgJiAoKHR5cGVJbmRleCsxKTw8MTYpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAoMHgwMDAwZmZmZiAmIChlbnRyeUluZGV4KSk7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZV9uYW1lIHJlc05hbWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLT5nZXRSZXNvdXJjZU5hbWUocmVzSUQsICZyZXNOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgc3BlYyByZXNvdXJjZSAweCUwOHggJXM6JXMvJXM6IGZsYWdzPTB4JTA4eFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNJRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnBhY2thZ2UsIHJlc05hbWUucGFja2FnZUxlbiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS50eXBlLCByZXNOYW1lLnR5cGVMZW4pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQVIxNl9UT19DU1RSKHJlc05hbWUubmFtZSwgcmVzTmFtZS5uYW1lTGVuKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdG9obCh0eXBlQ29uZmlncy0+dHlwZVNwZWNGbGFnc1tlbnRyeUluZGV4XSkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMtPmdldFJlc291cmNlTmFtZShyZXNJRCwgJnJlc05hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICBzcGVjIHJlc291cmNlIDB4JTA4eCAlczolcy8lczogZmxhZ3M9MHglMDh4XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5wYWNrYWdlLCByZXNOYW1lLnBhY2thZ2VMZW4pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnR5cGUsIHJlc05hbWUudHlwZUxlbiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQVIxNl9UT19DU1RSKHJlc05hbWUubmFtZSwgcmVzTmFtZS5uYW1lTGVuKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHRvaGwodHlwZUNvbmZpZ3MtPnR5cGVTcGVjRmxhZ3NbZW50cnlJbmRleF0pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICBJTlZBTElEIFRZUEUgQ09ORklHIEZPUiBSRVNPVVJDRSAweCUwOHhcbiIsIHJlc0lEKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBjb25maWdJbmRleD0wOyBjb25maWdJbmRleDxOVEM7IGNvbmZpZ0luZGV4KyspIHsKQEAgLTQzNDAsMTEgKzQzOTcsMTQgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgKDB4MDBmZjAwMDAgJiAoKHR5cGVJbmRleCsxKTw8MTYpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAoMHgwMDAwZmZmZiAmIChlbnRyeUluZGV4KSk7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZV9uYW1lIHJlc05hbWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLT5nZXRSZXNvdXJjZU5hbWUocmVzSUQsICZyZXNOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgICByZXNvdXJjZSAweCUwOHggJXM6JXMvJXM6ICIsIHJlc0lELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnBhY2thZ2UsIHJlc05hbWUucGFja2FnZUxlbiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQVIxNl9UT19DU1RSKHJlc05hbWUudHlwZSwgcmVzTmFtZS50eXBlTGVuKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5uYW1lLCByZXNOYW1lLm5hbWVMZW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLT5nZXRSZXNvdXJjZU5hbWUocmVzSUQsICZyZXNOYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgICByZXNvdXJjZSAweCUwOHggJXM6JXMvJXM6ICIsIHJlc0lELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5wYWNrYWdlLCByZXNOYW1lLnBhY2thZ2VMZW4pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS50eXBlLCByZXNOYW1lLnR5cGVMZW4pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5uYW1lLCByZXNOYW1lLm5hbWVMZW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICAgIElOVkFMSUQgUkVTT1VSQ0UgMHglMDh4OiAiLCByZXNJRCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHRoaXNPZmZzZXQmMHgzKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJOT04tSU5URUdFUiBPRkZTRVQ6ICVwXG4iLCAodm9pZCopdGhpc09mZnNldCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CkBAIC00NDAyLDE4ICs0NDYyLDE5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50X3ZhbHVlKHBrZywgdmFsdWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYmFnUHRyICE9IE5VTEwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaW50IE4gPSBkdG9obChiYWdQdHItPmNvdW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUmVzVGFibGVfbWFwKiBtYXBQdHIgPSAoY29uc3QgUmVzVGFibGVfbWFwKikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChjb25zdCB1aW50OF90KillbnQpICsgZXNpemUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1aW50OF90KiBiYXNlTWFwUHRyID0gKGNvbnN0IHVpbnQ4X3QqKWVudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IG1hcE9mZnNldCA9IGVzaXplOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBSZXNUYWJsZV9tYXAqIG1hcFB0ciA9IChSZXNUYWJsZV9tYXAqKShiYXNlTWFwUHRyK21hcE9mZnNldCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgICAgIFBhcmVudD0weCUwOHgsIENvdW50PSVkXG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHRvaGwoYmFnUHRyLT5wYXJlbnQuaWRlbnQpLCBOKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TiAmJiBtYXBPZmZzZXQgPCAodHlwZVNpemUtc2l6ZW9mKFJlc1RhYmxlX21hcCkpOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgICAgICMlaSAoS2V5PTB4JTA4eCk6ICIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwgZHRvaGwobWFwUHRyLT5uYW1lLmlkZW50KSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS5jb3B5RnJvbV9kdG9oKG1hcFB0ci0+dmFsdWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRfdmFsdWUocGtnLCB2YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzaXplX3Qgc2l6ZSA9IGR0b2hzKG1hcFB0ci0+dmFsdWUuc2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBQdHIgPSAoUmVzVGFibGVfbWFwKikoKChjb25zdCB1aW50OF90KiltYXBQdHIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZSArIHNpemVvZigqbWFwUHRyKS1zaXplb2YobWFwUHRyLT52YWx1ZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwT2Zmc2V0ICs9IHNpemUgKyBzaXplb2YoKm1hcFB0ciktc2l6ZW9mKG1hcFB0ci0+dmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgIC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pb247CisKK2ltcG9ydCBhbmRyb2lkLm9zLlBhcmNlbDsKK2ltcG9ydCBhbmRyb2lkLm9zLlBhcmNlbGFibGU7CisKKy8qKgorICogVGhpcyBjbGFzcyB3cmFwcyB0aGUgY291bnRyeSBpbmZvcm1hdGlvbi4KKyAqCisgKiBAaGlkZQorICovCitwdWJsaWMgY2xhc3MgQ291bnRyeSBpbXBsZW1lbnRzIFBhcmNlbGFibGUgeworICAgIC8qKgorICAgICAqIFRoZSBjb3VudHJ5IGNvZGUgY2FtZSBmcm9tIHRoZSBtb2JpbGUgbmV0d29yaworICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IENPVU5UUllfU09VUkNFX05FVFdPUksgPSAwOworCisgICAgLyoqCisgICAgICogVGhlIGNvdW50cnkgY29kZSBjYW1lIGZyb20gdGhlIGxvY2F0aW9uIHNlcnZpY2UKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBDT1VOVFJZX1NPVVJDRV9MT0NBVElPTiA9IDE7CisKKyAgICAvKioKKyAgICAgKiBUaGUgY291bnRyeSBjb2RlIHdhcyByZWFkIGZyb20gdGhlIFNJTSBjYXJkCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQ09VTlRSWV9TT1VSQ0VfU0lNID0gMjsKKworICAgIC8qKgorICAgICAqIFRoZSBjb3VudHJ5IGNvZGUgY2FtZSBmcm9tIHRoZSBzeXN0ZW0gbG9jYWxlIHNldHRpbmcKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBDT1VOVFJZX1NPVVJDRV9MT0NBTEUgPSAzOworCisgICAgLyoqCisgICAgICogVGhlIElTTyAzMTY2LTEgdHdvIGxldHRlcnMgY291bnRyeSBjb2RlLgorICAgICAqLworICAgIHByaXZhdGUgZmluYWwgU3RyaW5nIG1Db3VudHJ5SXNvOworCisgICAgLyoqCisgICAgICogV2hlcmUgdGhlIGNvdW50cnkgY29kZSBjYW1lIGZyb20uCisgICAgICovCisgICAgcHJpdmF0ZSBmaW5hbCBpbnQgbVNvdXJjZTsKKworICAgIHByaXZhdGUgaW50IG1IYXNoQ29kZTsKKyAgICAvKioKKyAgICAgKgorICAgICAqIEBwYXJhbSBjb3VudHJ5SXNvIHRoZSBJU08gMzE2Ni0xIHR3byBsZXR0ZXJzIGNvdW50cnkgY29kZS4KKyAgICAgKiBAcGFyYW0gc291cmNlIHdoZXJlIHRoZSBjb3VudHJ5SXNvIGNhbWUgZnJvbSwgY291bGQgYmUgb25lIG9mIGJlbG93CisgICAgICogICAgICAgIHZhbHVlcworICAgICAqICAgICAgICA8cD4KKyAgICAgKiAgICAgICAgPHVsPgorICAgICAqICAgICAgICA8bGk+e0BsaW5rICNDT1VOVFJZX1NPVVJDRV9ORVRXT1JLfTwvbGk+CisgICAgICogICAgICAgIDxsaT57QGxpbmsgI0NPVU5UUllfU09VUkNFX0xPQ0FUSU9OfTwvbGk+CisgICAgICogICAgICAgIDxsaT57QGxpbmsgI0NPVU5UUllfU09VUkNFX1NJTX08L2xpPgorICAgICAqICAgICAgICA8bGk+e0BsaW5rICNDT1VOVFJZX1NPVVJDRV9MT0NBTEV9PC9saT4KKyAgICAgKiAgICAgICAgPC91bD4KKyAgICAgKi8KKyAgICBwdWJsaWMgQ291bnRyeShmaW5hbCBTdHJpbmcgY291bnRyeUlzbywgZmluYWwgaW50IHNvdXJjZSkgeworICAgICAgICBpZiAoY291bnRyeUlzbyA9PSBudWxsIHx8IHNvdXJjZSA8IENPVU5UUllfU09VUkNFX05FVFdPUksKKyAgICAgICAgICAgICAgICB8fCBzb3VyY2UgPiBDT1VOVFJZX1NPVVJDRV9MT0NBTEUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oKTsKKyAgICAgICAgfQorICAgICAgICBtQ291bnRyeUlzbyA9IGNvdW50cnlJc28udG9Mb3dlckNhc2UoKTsKKyAgICAgICAgbVNvdXJjZSA9IHNvdXJjZTsKKyAgICB9CisKKyAgICBwdWJsaWMgQ291bnRyeShDb3VudHJ5IGNvdW50cnkpIHsKKyAgICAgICAgbUNvdW50cnlJc28gPSBjb3VudHJ5Lm1Db3VudHJ5SXNvOworICAgICAgICBtU291cmNlID0gY291bnRyeS5tU291cmNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdGhlIElTTyAzMTY2LTEgdHdvIGxldHRlcnMgY291bnRyeSBjb2RlCisgICAgICovCisgICAgcHVibGljIGZpbmFsIFN0cmluZyBnZXRDb3VudHJ5SXNvKCkgeworICAgICAgICByZXR1cm4gbUNvdW50cnlJc287CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiB3aGVyZSB0aGUgY291bnRyeSBjb2RlIGNhbWUgZnJvbSwgY291bGQgYmUgb25lIG9mIGJlbG93IHZhbHVlcworICAgICAqICAgICAgICAgPHA+CisgICAgICogICAgICAgICA8dWw+CisgICAgICogICAgICAgICA8bGk+e0BsaW5rICNDT1VOVFJZX1NPVVJDRV9ORVRXT1JLfTwvbGk+CisgICAgICogICAgICAgICA8bGk+e0BsaW5rICNDT1VOVFJZX1NPVVJDRV9MT0NBVElPTn08L2xpPgorICAgICAqICAgICAgICAgPGxpPntAbGluayAjQ09VTlRSWV9TT1VSQ0VfU0lNfTwvbGk+CisgICAgICogICAgICAgICA8bGk+e0BsaW5rICNDT1VOVFJZX1NPVVJDRV9MT0NBTEV9PC9saT4KKyAgICAgKiAgICAgICAgIDwvdWw+CisgICAgICovCisgICAgcHVibGljIGZpbmFsIGludCBnZXRTb3VyY2UoKSB7CisgICAgICAgIHJldHVybiBtU291cmNlOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgUGFyY2VsYWJsZS5DcmVhdG9yPENvdW50cnk+IENSRUFUT1IgPSBuZXcgUGFyY2VsYWJsZS5DcmVhdG9yPENvdW50cnk+KCkgeworICAgICAgICBwdWJsaWMgQ291bnRyeSBjcmVhdGVGcm9tUGFyY2VsKFBhcmNlbCBpbikgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBDb3VudHJ5KGluLnJlYWRTdHJpbmcoKSwgaW4ucmVhZEludCgpKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBDb3VudHJ5W10gbmV3QXJyYXkoaW50IHNpemUpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgQ291bnRyeVtzaXplXTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICBwdWJsaWMgaW50IGRlc2NyaWJlQ29udGVudHMoKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIHBhcmNlbCwgaW50IGZsYWdzKSB7CisgICAgICAgIHBhcmNlbC53cml0ZVN0cmluZyhtQ291bnRyeUlzbyk7CisgICAgICAgIHBhcmNlbC53cml0ZUludChtU291cmNlKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iamVjdCkgeworICAgICAgICBpZiAob2JqZWN0ID09IHRoaXMpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmIChvYmplY3QgaW5zdGFuY2VvZiBDb3VudHJ5KSB7CisgICAgICAgICAgICBDb3VudHJ5IGMgPSAoQ291bnRyeSkgb2JqZWN0OworICAgICAgICAgICAgcmV0dXJuIG1Db3VudHJ5SXNvLmVxdWFscyhjLmdldENvdW50cnlJc28oKSkgJiYgbVNvdXJjZSA9PSBjLmdldFNvdXJjZSgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgaW50IGhhc2hDb2RlKCkgeworICAgICAgICBpbnQgaGFzaCA9IG1IYXNoQ29kZTsKKyAgICAgICAgaWYgKGhhc2gg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G5ldyBIYW5kbGVyKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvbkNvdW50cnlEZXRlY3RlZChmaW5hbCBDb3VudHJ5IGNvdW50cnkpIHsKKyAgICAgICAgICAgIG1IYW5kbGVyLnBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgbUxpc3RlbmVyLm9uQ291bnRyeURldGVjdGVkKGNvdW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgU3RyaW5nIFRBRyA9ICJDb3VudHJ5RGV0ZWN0b3IiOworICAgIHByaXZhdGUgZmluYWwgSUNvdW50cnlEZXRlY3RvciBtU2VydmljZTsKKyAgICBwcml2YXRlIGZpbmFsIEhhc2hNYXA8Q291bnRyeUxpc3RlbmVyLCBMaXN0ZW5lclRyYW5zcG9ydD4gbUxpc3RlbmVyczsKKworICAgIC8qKgorICAgICAqIEBoaWRlIC0gaGlkZSB0aGlzIGNvbnN0cnVjdG9yIGJlY2F1c2UgaXQgaGFzIGEgcGFyYW1ldGVyIG9mIHR5cGUKKyAgICAgKiAgICAgICBJQ291bnRyeURldGVjdG9yLCB3aGljaCBpcyBhIHN5c3RlbSBwcml2YXRlIGNsYXNzLiBUaGUgcmlnaHQgd2F5IHRvCisgICAgICogICAgICAgY3JlYXRlIGFuIGluc3RhbmNlIG9mIHRoaXMgY2xhc3MgaXMgdXNpbmcgdGhlIGZhY3RvcnkKKyAgICAgKiAgICAgICBDb250ZXh0LmdldFN5c3RlbVNlcnZpY2UuCisgICAgICovCisgICAgcHVibGljIENvdW50cnlEZXRlY3RvcihJQ291bnRyeURldGVjdG9yIHNlcnZpY2UpIHsKKyAgICAgICAgbVNlcnZpY2UgPSBzZXJ2aWNlO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Bsb29wZXIgaXMgbnVsbCB0aGVuIHRoZQorICAgICAqICAgICAgICBjYWxsYmFja3Mgd2lsbCBiZSBjYWxsZWQgb24gdGhlIG1haW4gdGhyZWFkLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGFkZENvdW50cnlMaXN0ZW5lcihDb3VudHJ5TGlzdGVuZXIgbGlzdGVuZXIsIExvb3BlciBsb29wZXIpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtTGlzdGVuZXJzKSB7CisgICAgICAgICAgICBpZiAoIW1MaXN0ZW5lcnMuY29udGFpbnNLZXkobGlzdGVuZXIpKSB7CisgICAgICAgICAgICAgICAgTGlzdGVuZXJUcmFuc3BvcnQgdHJhbnNwb3J0ID0gbmV3IExpc3RlbmVyVHJhbnNwb3J0KGxpc3RlbmVyLCBsb29wZXIpOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIG1TZXJ2aWNlLmFkZENvdW50cnlMaXN0ZW5lcih0cmFuc3BvcnQpOworICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXJzLnB1dChsaXN0ZW5lciwgdHJhbnNwb3J0KTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJhZGRDb3VudHJ5TGlzdGVuZXI6IFJlbW90ZUV4Y2VwdGlvbiIsIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJlbW92ZSB0aGUgbGlzdGVuZXIKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCByZW1vdmVDb3VudHJ5TGlzdGVuZXIoQ291bnRyeUxpc3RlbmVyIGxpc3RlbmVyKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobUxpc3RlbmVycykgeworICAgICAgICAgICAgTGlzdGVuZXJUcmFuc3BvcnQgdHJhbnNwb3J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isgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhQcm9maWxlLkhFQURTRVQpOworICAgICAgICB9CiAKICAgICAgICAgLy8gUmVnaXN0ZXIgZm9yIGRldmljZSBjb25uZWN0aW9uIGludGVudCBicm9hZGNhc3RzLgogICAgICAgICBJbnRlbnRGaWx0ZXIgaW50ZW50RmlsdGVyID0KICAgICAgICAgICAgICAgICBuZXcgSW50ZW50RmlsdGVyKEludGVudC5BQ1RJT05fSEVBRFNFVF9QTFVHKTsKLSAgICAgICAgaW50ZW50RmlsdGVyLmFkZEFjdGlvbihCbHVldG9vdGhBMmRwLkFDVElPTl9TSU5LX1NUQVRFX0NIQU5HRUQpOwotICAgICAgICBpbnRlbnRGaWx0ZXIuYWRkQWN0aW9uKEJsdWV0b290aEhlYWRzZXQuQUNUSU9OX1NUQVRFX0NIQU5HRUQpOwotICAgICAgICBpbnRlbnRGaWx0ZXIuYWRkQWN0aW9uKEludGVudC5BQ1RJT05fRE9DS19FVkVOVCk7CisKKyAgICAgICAgaW50ZW50RmlsdGVyLmFkZEFjdGlvbihCbHVldG9vdGhBMmRwLkFDVElPTl9DT05ORUNUSU9OX1NUQVRFX0NIQU5HRUQpOwogICAgICAgICBpbnRlbnRGaWx0ZXIuYWRkQWN0aW9uKEJsdWV0b290aEhlYWRzZXQuQUNUSU9OX0FVRElPX1NUQVRFX0NIQU5HRUQpOworICAgICAgICBpbnRlbnRGaWx0ZXIuYWRkQWN0aW9uKEJsdWV0b290aEhlYWRzZXQuQUNUSU9OX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRCk7CisgICAgICAgIGludGVudEZpbHRlci5hZGRBY3Rpb24oSW50ZW50LkFDVElPTl9ET0NLX0VWRU5UKTsKKyAgICAgICAgaW50ZW50RmlsdGVyLmFkZEFjdGlvbihJbnRlbnQuQUNUSU9OX1VTQl9BTkxHX0hFQURTRVRfUExVRyk7CisgICAgICAgIGludGVudEZpbHRlci5hZGRBY3Rpb24oSW50ZW50LkFDVElPTl9VU0JfREdUTF9IRUFEU0VUX1BMVUcpOwogICAgICAgICBjb250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIobVJlY2VpdmVyLCBpbnRlbnRGaWx0ZXIpOwogCiAgICAgICAgIC8vIFJlZ2lzdGVyIGZvciBtZWRpYSBidXR0b24gaW50ZW50IGJyb2FkY2FzdHMuCkBAIC0xMDAwLDcgKzEwMDksNyBAQAogCiAgICAgICAgIHB1YmxpYyB2b2lkIGluY0NvdW50KCkgewogICAgICAgICAgICAgc3luY2hyb25pemVkKG1TY29DbGllbnRzKSB7Ci0gICAgICAgICAgICAgICAgcmVxdWVzdFNjb1N0YXRlKEJsdWV0b290aEhlYWRzZXQuQVVESU9fU1RBVEVfQ09OTkVDVEVEKTsKKyAgICAgICAgICAgICAgICByZXF1ZXN0U2NvU3RhdGUoQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9BVURJT19DT05ORUNURUQpOwogICAgICAgICAgICAgICAgIGlmIChtU3RhcnRjb3VudCA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtQ2IubGlua1RvRGVhdGgodGhpcywgMCk7CkBAIC0xMDI2LDcgKzEwMzUsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgImRlY0NvdW50KCkgZ29pbmcgdG8gMCBidXQgbm90IHJlZ2lzdGVyZWQgdG8gYmluZGVyIik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcmVxdWVzdFNjb1N0YXRlKEJsdWV0b290aEhlYWRzZXQuQVVESU9fU1RBVEVfRElTQ09OTkVDVEVEKTsKKyAgICAgICAgICAgICAgICAgICAgcmVxdWVzdFNjb1N0YXRlKEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQVVESU9fRElTQ09OTkVDVEVEKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTEwNDIsNyArMTA1MSw3IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1TdGFydGNvdW50ID0gMDsKICAgICAgICAgICAgICAgICBpZiAoc3RvcFNjbykgewotICAgICAgICAgICAgICAgICAgICByZXF1ZXN0U2NvU3RhdGUoQmx1ZXRvb3RoSGVhZHNldC5BVURJT19TVEFURV9ESVNDT05ORUNURUQpOworICAgICAgICAgICAgICAgICAgICByZXF1ZXN0U2NvU3RhdGUoQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9BVURJT19ESVNDT05ORUNURUQpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtMTA2OCwxMiArMTA3NywxMiBAQAogCiAgICAgICAgIHByaXZhdGUgdm9pZCByZXF1ZXN0U2NvU3RhdGUoaW50IHN0YXRlKSB7CiAgICAgICAgICAgICBpZiAodG90YWxDb3VudCgpID09IDAgJiYKLSAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoSGVhZHNldENvbm5lY3RlZCAmJgorICAgICAgICAgICAgICAgIG1CbHVldG9vdGhIZWFkc2V0RGV2aWNlICE9IG51bGwgJiYKICAgICAgICAgICAgICAgICBBdWRpb1NlcnZpY2UudGhpcy5tTW9kZSA9PSBBdWRpb1N5c3RlbS5NT0RFX05PUk1BTCkgewotICAgICAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhIZWFkc2V0LkFVRElPX1NUQVRFX0NPTk5FQ1RFRCkgewotICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoSGVhZHNldC5zdGFydFZvaWNlUmVjb2duaXRpb24oKTsKKyAgICAgICAgICAgICAgICBpZiAoc3RhdGUgPT0gQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9BVURJT19DT05ORUNURUQpIHsKKyAgICAgICAgICAgICAgICAgICAgbUJsdWV0b290aEhlYWRzZXQuc3RhcnRWb2ljZVJlY29nbml0aW9uKG1CbHVldG9vdGhIZWFkc2V0RGV2aWNlKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoSGVhZHNldC5zdG9wVm9pY2VSZWNvZ25pdGlvbigpOworICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoSGVhZHNldC5zdG9wVm9pY2VSZWNvZ25pdGlvbihtQmx1ZXRvb3RoSGVhZHNldERldmljZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0xMTAzLDIzICsxMTEyLDI1IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIEJsdWV0b290aEhlYWRzZXQuU2VydmljZUxpc3RlbmVyIG1CbHVldG9vdGhIZWFkc2V0U2VydmljZUxpc3RlbmVyID0KLSAgICAgICAgbmV3IEJsdWV0b290aEhlYWRzZXQuU2VydmljZUxpc3RlbmVyKCkgewotICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VDb25uZWN0ZWQoKSB7Ci0gICAgICAgICAgICBpZiAobUJsdWV0b290aEhlYWRzZXQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZSBkZXZpY2UgPSBtQmx1ZXRvb3RoSGVhZHNldC5nZXRDdXJyZW50SGVhZHNldCgpOwotICAgICAgICAgICAgICAgIGlmIChtQmx1ZXRvb3RoSGVhZHNldC5nZXRTdGF0ZShkZXZpY2UpID09IEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQ09OTkVDVEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhIZWFkc2V0Q29ubmVjdGVkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9CisgICAgcHJpdmF0ZSBCbHVldG9vdGhQcm9maWxlLlNlcnZpY2VMaXN0ZW5lciBtQmx1ZXRvb3RoUHJvZmlsZVNlcnZpY2VMaXN0ZW5lciA9CisgICAgICAgIG5ldyBCbHVldG9vdGhQcm9maWxlLlNlcnZpY2VMaXN0ZW5lcigpIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlQ29ubmVjdGVkKGludCBwcm9maWxlLCBCbHVldG9vdGhQcm9maWxlIHByb3h5KSB7CisgICAgICAgICAgICBtQmx1ZXRvb3RoSGVhZHNldCA9IChCbHVldG9vdGhIZWFkc2V0KSBwcm94eTsKKyAgICAgICAgICAgIExpc3Q8Qmx1ZXRvb3RoRGV2aWNlPiBkZXZpY2VMaXN0ID0gbUJsdWV0b290aEhlYWRzZXQuZ2V0Q29ubmVjdGVkRGV2aWNlcygpOworICAgICAgICAgICAgaWYgKGRldmljZUxpc3Quc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgIG1CbHVldG9vdGhIZWFkc2V0RGV2aWNlID0gZGV2aWNlTGlzdC5nZXQoMCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1CbHVldG9vdGhIZWFkc2V0RGV2aWNlID0gbnVsbDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VEaXNjb25uZWN0ZWQoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIG9uU2VydmljZURpc2Nvbm5lY3RlZChpbnQgcHJvZmlsZSkgewogICAgICAgICAgICAgaWYgKG1CbHVldG9vdGhIZWFkc2V0ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBCbHVldG9vdGhEZXZpY2UgZGV2aWNlID0gbUJsdWV0b290aEhlYWRzZXQuZ2V0Q3VycmVudEhlYWRzZXQoKTsKLSAgICAgICAgICAgICAgICBpZiAobUJsdWV0b290aEhlYWRzZXQuZ2V0U3RhdGUoZGV2aWNlKSA9PSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0RJU0NPTk5FQ1RFRCkgewotICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoSGVhZHNldENvbm5lY3RlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIExpc3Q8Qmx1ZXRvb3RoRGV2aWNlPiBkZXZpY2VzID0gbUJsdWV0b290aEhlYWRzZXQuZ2V0Q29ubmVjdGVkRGV2aWNlcygpOworICAgICAgICAgICAgICAgIGlmIChkZXZpY2VzLnNpemUoKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhIZWFkc2V0RGV2aWNlID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgY2xlYXJBbGxTY29DbGllbnRzKCk7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1CbHVldG9vdGhIZWFkc2V0ID0gbnVsbDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH07CkBAIC0xODA4LDIzICsxODE5LDI5IEBACiAgICAgICAgICAgICAgICAgICAgIGNhc2UgSW50ZW50LkVYVFJBX0RPQ0tfU1RBVEVfQ0FSOgogICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gQXVkaW9TeXN0ZW0uRk9SQ0VfQlRfQ0FSX0RPQ0s7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBJbnRlbnQuRVhUUkFfRE9DS19TVEFURV9MRV9ERVNLOgorICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gQXVkaW9TeXN0ZW0uRk9SQ0VfQU5BTE9HX0RPQ0s7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBJbnRlbnQuRVhUUkFfRE9DS19TVEFURV9IRV9ERVNLOgorICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gQXVkaW9TeXN0ZW0uRk9SQ0VfRElHSVRBTF9ET0NLOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgSW50ZW50LkVYVFJBX0RPQ0tfU1RBVEVfVU5ET0NLRUQ6CiAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBBdWRpb1N5c3RlbS5GT1JDRV9OT05FOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5zZXRGb3JjZVVzZShBdWRpb1N5c3RlbS5GT1JfRE9DSywgY29uZmlnKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhBMmRwLkFDVElPTl9TSU5LX1NUQVRFX0NIQU5HRUQpKSB7Ci0gICAgICAgICAgICAgICAgaW50IHN0YXRlID0gaW50ZW50LmdldEludEV4dHJhKEJsdWV0b290aEEyZHAuRVhUUkFfU0lOS19TVEFURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQpOworICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEJsdWV0b290aEEyZHAuQUNUSU9OX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRCkpIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoUHJvZmlsZS5FWFRSQV9TVEFURSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9ESVNDT05ORUNURUQpOwogICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZSBidERldmljZSA9IGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoQmx1ZXRvb3RoRGV2aWNlLkVYVFJBX0RFVklDRSk7CiAgICAgICAgICAgICAgICAgU3RyaW5nIGFkZHJlc3MgPSBidERldmljZS5nZXRBZGRyZXNzKCk7Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBpc0Nvbm5lY3RlZCA9IChtQ29ubmVjdGVkRGV2aWNlcy5jb250YWluc0tleShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0JMVUVUT09USF9BMkRQKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChTdHJpbmcpbUNvbm5lY3RlZERldmljZXMuZ2V0KEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfQkxVRVRPT1RIX0EyRFApKS5lcXVhbHMoYWRkcmVzcykpOworICAgICAgICAgICAgICAgIGJvb2xlYW4gaXNDb25uZWN0ZWQgPQorICAgICAgICAgICAgICAgICAgICAobUNvbm5lY3RlZERldmljZXMuY29udGFpbnNLZXkoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9CTFVFVE9PVEhfQTJEUCkgJiYKKyAgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWREZXZpY2VzLmdldChBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0JMVUVUT09USF9BMkRQKS5lcXVhbHMoYWRkcmVzcykpOwogCi0gICAgICAgICAgICAgICAgaWYgKGlzQ29ubmVjdGVkICYmCi0gICAgICAgICAgICAgICAgICAgIHN0YXRlICE9IEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVEICYmIHN0YXRlICE9IEJsdWV0b290aEEyZHAuU1RBVEVfUExBWUlORykgeworICAgICAgICAgICAgICAgIGlmIChpc0Nvbm5lY3RlZCAmJiBzdGF0ZSAhPSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RFRCkgewogICAgICAgICAgICAgICAgICAgICBpZiAoYnREZXZpY2UuaXNCbHVldG9vdGhEb2NrKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX0RJU0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRlID09IEJsdWV0b290aFByb2ZpbGUuU1RBVEVfRElTQ09OTkVDVEVEKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW50cm9kdWN0aW9uIG9mIGEgZGVsYXkgZm9yIHRyYW5zaWVudCBkaXNjb25uZWN0aW9ucyBvZiBkb2NrcyB3aGVuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcG93ZXIgaXMgcmFwaWRseSB0dXJuZWQgb2ZmL29uLCB0aGlzIG1lc3NhZ2Ugd2lsbCBiZSBjYW5jZWxlZCBpZgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIHJlY29ubmVjdCB0aGUgZG9jayB1bmRlciBhIHByZXNldCBkZWxheQpAQCAtMTgzNCw5ICsxODUxLDcgQEAKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VBMmRwRGV2aWNlVW5hdmFpbGFibGVOb3coYWRkcmVzcyk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFpc0Nvbm5lY3RlZCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc3RhdGUgPT0gQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUQgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlID09IEJsdWV0b290aEEyZHAuU1RBVEVfUExBWUlORykpIHsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFpc0Nvbm5lY3RlZCAmJiBzdGF0ZSA9PSBCbHVldG9vdGhQcm9maWxlLlNUQVRFX0NPTk5FQ1RFRCkgewogICAgICAgICAgICAgICAgICAgICBpZiAoYnREZXZpY2UuaXNCbHVldG9vdGhEb2NrKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgY291bGQgYmUgYSByZWNvbm5lY3Rpb24gYWZ0ZXIgYSB0cmFuc2llbnQgZGlzY29ubmVjdGlvbgogICAgICAgICAgICAgICAgICAgICAgICAgY2FuY2VsQTJkcERldmljZVRpbWVvdXQoKTsKQEAgLTE4NTEsOSArMTg2Niw5IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgbWFrZUEyZHBEZXZpY2VBdmFpbGFibGUoYWRkcmVzcyk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEJsdWV0b290aEhlYWRzZXQuQUNUSU9OX1NUQVRFX0NIQU5HRUQpKSB7Ci0gICAgICAgICAgICAgICAgaW50IHN0YXRlID0gaW50ZW50LmdldEludEV4dHJhKEJsdWV0b290aEhlYWRzZXQuRVhUUkFfU1RBVEUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRVJST1IpOworICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEJsdWV0b290aEhlYWRzZXQuQUNUSU9OX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRCkpIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoUHJvZmlsZS5FWFRSQV9TVEFURSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9ESVNDT05ORUNURUQpOwogICAgICAgICAgICAgICAgIGludCBkZXZpY2UgPSBBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0JMVUVUT09USF9TQ087CiAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGJ0RGV2aWNlID0gaW50ZW50LmdldFBhcmNlbGFibGVFeHRyYShCbHVldG9vdGhEZXZpY2UuRVhUUkFfREVWSUNFKTsKICAgICAgICAgICAgICAgICBTdHJpbmcgYWRkcmVzcyA9IG51bGw7CkBAIC0xODc0LDIxICsxODg5LDIxIEBACiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgYm9vbGVhbiBpc0Nvbm5lY3RlZCA9IChtQ29ubmVjdGVkRGV2aWNlcy5jb250YWluc0tleShkZXZpY2UpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFN0cmluZyltQ29ubmVjdGVkRGV2aWNlcy5nZXQoZGV2aWNlKSkuZXF1YWxzKGFkZHJlc3MpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWREZXZpY2VzLmdldChkZXZpY2UpLmVxdWFscyhhZGRyZXNzKSk7CiAKLSAgICAgICAgICAgICAgICBpZiAoaXNDb25uZWN0ZWQgJiYgc3RhdGUgIT0gQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9DT05ORUNURUQpIHsKKyAgICAgICAgICAgICAgICBpZiAoaXNDb25uZWN0ZWQgJiYgc3RhdGUgIT0gQmx1ZXRvb3RoUHJvZmlsZS5TVEFURV9DT05ORUNURUQpIHsKICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKGRldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLkRFVklDRV9TVEFURV9VTkFWQUlMQUJMRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHJlc3MpOwogICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkRGV2aWNlcy5yZW1vdmUoZGV2aWNlKTsKLSAgICAgICAgICAgICAgICAgICAgbUJsdWV0b290aEhlYWRzZXRDb25uZWN0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgbUJsdWV0b290aEhlYWRzZXREZXZpY2UgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICBjbGVhckFsbFNjb0NsaWVudHMoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFpc0Nvbm5lY3RlZCAmJiBzdGF0ZSA9PSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWlzQ29ubmVjdGVkICYmIHN0YXRlID09IEJsdWV0b290aFByb2ZpbGUuU1RBVEVfQ09OTkVDVEVEKSB7CiAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLnNldERldmljZUNvbm5lY3Rpb25TdGF0ZShkZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ERVZJQ0VfU1RBVEVfQVZBSUxBQkxFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkcmVzcyk7CiAgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWREZXZpY2VzLnB1dChuZXcgSW50ZWdlcihkZXZpY2UpLCBhZGRyZXNzKTsKLSAgICAgICAgICAgICAgICAgICAgbUJsdWV0b290aEhlYWRzZXRDb25uZWN0ZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoSGVhZHNldERldmljZSA9IGJ0RGV2aWNlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhJbnRlbnQuQUNUSU9OX0hFQURTRVRfUExVRykpIHsKICAgICAgICAgICAgICAgICBpbnQgc3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoInN0YXRlIiwgMCk7CkBAIC0xOTIxLDE2ICsxOTM2LDQxIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkRGV2aWNlcy5wdXQoIG5ldyBJbnRlZ2VyKEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfV0lSRURfSEVBRFBIT05FKSwgIiIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEludGVudC5BQ1RJT05fVVNCX0FOTEdfSEVBRFNFVF9QTFVHKSkgeworICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYSgic3RhdGUiLCAwKTsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJCcm9hZGNhc3QgUmVjZWl2ZXI6IEdvdCBBQ1RJT05fVVNCX0FOTEdfSEVBRFNFVF9QTFVHLCBzdGF0ZSA9ICIrc3RhdGUpOworICAgICAgICAgICAgICAgIGJvb2xlYW4gaXNDb25uZWN0ZWQgPSBtQ29ubmVjdGVkRGV2aWNlcy5jb250YWluc0tleShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0FOTEdfRE9DS19IRUFEU0VUKTsKKyAgICAgICAgICAgICAgICBpZiAoc3RhdGUgPT0gMCAmJiBpc0Nvbm5lY3RlZCkgeworICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5zZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9BTkxHX0RPQ0tfSEVBRFNFVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLkRFVklDRV9TVEFURV9VTkFWQUlMQUJMRSwgIiIpOworICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkRGV2aWNlcy5yZW1vdmUoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9BTkxHX0RPQ0tfSEVBRFNFVCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0ZSA9PSAxICYmICFpc0Nvbm5lY3RlZCkgIHsKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfQU5MR19ET0NLX0hFQURTRVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ERVZJQ0VfU1RBVEVfQVZBSUxBQkxFLCAiIik7CisgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWREZXZpY2VzLnB1dCggbmV3IEludGVnZXIoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9BTkxHX0RPQ0tfSEVBRFNFVCksICIiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9VU0JfREdUTF9IRUFEU0VUX1BMVUcpKSB7CisgICAgICAgICAgICAgICAgaW50IHN0YXRlID0gaW50ZW50LmdldEludEV4dHJhKCJzdGF0ZSIsIDApOworICAgICAgICAgICAgICAgIExvZy52KFRBRywgIkJyb2FkY2FzdCBSZWNlaXZlcjogR290IEFDVElPTl9VU0JfREdUTF9IRUFEU0VUX1BMVUcsIHN0YXRlID0gIitzdGF0ZSk7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBpc0Nvbm5lY3RlZCA9IG1Db25uZWN0ZWREZXZpY2VzLmNvbnRhaW5zS2V5KEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfREdUTF9ET0NLX0hFQURTRVQpOworICAgICAgICAgICAgICAgIGlmIChzdGF0ZSA9PSAwICYmIGlzQ29ubmVjdGVkKSB7CisgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLnNldERldmljZUNvbm5lY3Rpb25TdGF0ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0RHVExfRE9DS19IRUFEU0VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uREVWSUNFX1NUQVRFX1VOQVZBSUxBQkxFLCAiIik7CisgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWREZXZpY2VzLnJlbW92ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0RHVExfRE9DS19IRUFEU0VUKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0YXRlID09IDEgJiYgIWlzQ29ubmVjdGVkKSAgeworICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5zZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9ER1RMX0RPQ0tfSEVBRFNFVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLkRFVklDRV9TVEFURV9BVkFJTEFCTEUsICIiKTsKKyAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RlZERldmljZXMucHV0KCBuZXcgSW50ZWdlcihBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0RHVExfRE9DS19IRUFEU0VUKSwgIiIpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhIZWFkc2V0LkFDVElPTl9BVURJT19TVEFURV9DSEFOR0VEKSkgewotICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhIZWFkc2V0LkVYVFJBX0FVRElPX1NUQVRFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0VSUk9SKTsKKyAgICAgICAgICAgICAgICBpbnQgc3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoUHJvZmlsZS5FWFRSQV9TVEFURSwgLTEpOwogICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVNjb0NsaWVudHMpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKCFtU2NvQ2xpZW50cy5pc0VtcHR5KCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoSGVhZHNldC5BVURJT19TVEFURV9DT05ORUNURUQ6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQVVESU9fQ09OTkVDVEVEOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gQXVkaW9NYW5hZ2VyLlNDT19BVURJT19TVEFURV9DT05ORUNURUQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuQVVESU9fU1RBVEVfRElTQ09OTkVDVEVEOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0FVRElPX0RJU0NPTk5FQ1RFRDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IEF1ZGlvTWFuYWdlci5TQ09fQVVESU9fU1RBVEVfRElTQ09OTkVDVEVEOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKZGlmZiAtLWdpdCBhL21lZGlhL2phdmEvYW5kcm9pZC9tZWRpYS9BdWRpb1N5c3RlbS5qYXZhIGIvbWVkaWEvamF2YS9hbmRyb2lkL21lZGlhL0F1ZGlvU3lzdGVtLmphdmEKaW5kZXggYTQ4MThmZi4uNTQ0Mjc5MSAxMDA2NDQKLS0tIGEvbWVkaWEvamF2YS9hbmRy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dXRpb24uCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUVVBTElUWV9DSUYgPSAzOworCisgICAgLyoqCisgICAgICogUXVhbGl0eSBsZXZlbCBjb3JyZXNwb25kaW5nIHRvIHRoZSA0ODBwICg3MjAgeCA0ODApIHJlc29sdXRpb24uCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUVVBTElUWV80ODBQID0gNDsKKworICAgIC8qKgorICAgICAqIFF1YWxpdHkgbGV2ZWwgY29ycmVzcG9uZGluZyB0byB0aGUgNzIwcCAoMTI4MCB4IDcyMCkgcmVzb2x1dGlvbi4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBRVUFMSVRZXzcyMFAgPSA1OworCisgICAgLyoqCisgICAgICogUXVhbGl0eSBsZXZlbCBjb3JyZXNwb25kaW5nIHRvIHRoZSAxMDgwcCAoMTkyMCB4IDEwODgpIHJlc29sdXRpb24uCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUVVBTElUWV8xMDgwUCA9IDY7CisKKyAgICAvKioKKyAgICAgKiBUaW1lIGxhcHNlIHF1YWxpdHkgbGV2ZWwgY29ycmVzcG9uZGluZyB0byB0aGUgbG93ZXN0IGF2YWlsYWJsZSByZXNvbHV0aW9uLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFFVQUxJVFlfVElNRV9MQVBTRV9MT1cgID0gMTAwMDsKKworICAgIC8qKgorICAgICAqIFRpbWUgbGFwc2UgcXVhbGl0eSBsZXZlbCBjb3JyZXNwb25kaW5nIHRvIHRoZSBoaWdoZXN0IGF2YWlsYWJsZSByZXNvbHV0aW9uLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFFVQUxJVFlfVElNRV9MQVBTRV9ISUdIID0gMTAwMTsKKworICAgIC8qKgorICAgICAqIFRpbWUgbGFwc2UgcXVhbGl0e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QRV9GTDsKKworICAgIC8vIE90aGVyIHBvcHVsYXIgZmlsZSB0eXBlcworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZJTEVfVFlQRV9URVhUICAgICAgICAgID0gMTAwOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZJTEVfVFlQRV9IVE1MICAgICAgICAgID0gMTAxOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZJTEVfVFlQRV9QREYgICAgICAgICAgID0gMTAyOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZJTEVfVFlQRV9YTUwgICAgICAgICAgID0gMTAzOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZJTEVfVFlQRV9NU19XT1JEICAgICAgID0gMTA0OworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZJTEVfVFlQRV9NU19FWENFTCAgICAgID0gMTA1OworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZJTEVfVFlQRV9NU19QT1dFUlBPSU5UID0gMTA2OworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZJTEVfVFlQRV9GTEFDICAgICAgICAgID0gMTA3OworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZJTEVfVFlQRV9aSVAgICAgICAgICAgID0gMTA4OwogICAgIAogICAgIHN0YXRpYyBjbGFzcyBNZWRpYUZpbGVUeXBlIHsKICAgICAKQEAgLTk2LDE1ICsxMTAsMzIgQEAKICAgICAgICAgfQogICAgIH0KICAgICAKLSAgICBwcml2YXRlIHN0YXRpYyBIYXNoTWFwPFN0cmluZywgTWVkaWFGaWxlVHlwZT4gc0ZpbGVUeXBlTWFwIAorICAgIHByaXZhdGUgc3RhdGljIEhhc2hNYXA8U3RyaW5nLCBNZWRpYUZpbGVUeXBlPiBzRmlsZVR5cGVNYXAKICAgICAgICAgICAgID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBNZWRpYUZpbGVUeXBlP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pZGVvRGVjb2RlcnMoKTsKLSAgICAgICAgZm9yIChWaWRlb0RlY29kZXIgZGVjb2RlcjogZGVjb2RlcnMpIHsKLSAgICAgICAgICAgIGlmIChkZWNvZGVyID09IFZpZGVvRGVjb2Rlci5WSURFT19ERUNPREVSX1dNVikgewotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBmYWxzZTsKLSAgICB9Ci0KICAgICBzdGF0aWMgewotICAgICAgICBhZGRGaWxlVHlwZSgiTVAzIiwgRklMRV9UWVBFX01QMywgImF1ZGlvL21wZWciKTsKLSAgICAgICAgYWRkRmlsZVR5cGUoIk00QSIsIEZJTEVfVFlQRV9NNEEsICJhdWRpby9tcDQiKTsKLSAgICAgICAgYWRkRmlsZVR5cGUoIldBViIsIEZJTEVfVFlQRV9XQVYsICJhdWRpby94LXdhdiIpOworICAgICAgICBhZGRGaWxlVHlwZSgiTVAzIiwgRklMRV9UWVBFX01QMywgImF1ZGlvL21wZWciLCBNdHBDb25zdGFudHMuRk9STUFUX01QMyk7CisgICAgICAgIGFkZEZpbGVUeXBlKCJNNEEiLCBGSUxFX1RZUEVfTTRBLCAiYXVkaW8vbXA0IiwgTXRwQ29uc3RhbnRzLkZPUk1BVF9NUEVHKTsKKyAgICAgICAgYWRkRmlsZVR5cGUoIldBViIsIEZJTEVfVFlQRV9XQVYsICJhdWRpby94LXdhdiIsIE10cENvbnN0YW50cy5GT1JNQVRfV0FWKTsKICAgICAgICAgYWRkRmlsZVR5cGUoIkFNUiIsIEZJTEVfVFlQRV9BTVIsICJhdWRpby9hbXIiKTsKICAgICAgICAgYWRkRmlsZVR5cGUoIkFXQiIsIEZJTEVfVFlQRV9BV0IsICJhdWRpby9hbXItd2IiKTsKICAgICAgICAgaWYgKGlzV01BRW5hYmxlZCgpKSB7Ci0gICAgICAgICAgICBhZGRGaWxlVHlwZSgiV01BIiwgRklMRV9UWVBFX1dNQSwgImF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BDb25zdGFudHMuRk9STUFUX0ZMQUMpOworICAgICAgICBhZGRGaWxlVHlwZSgiWklQIiwgRklMRV9UWVBFX1pJUCwgImFwcGxpY2F0aW9uL3ppcCIpOwogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBpc0F1ZGlvRmlsZVR5cGUoaW50IGZpbGVUeXBlKSB7CiAgICAgICAgIHJldHVybiAoKGZpbGVUeXBlID49IEZJUlNUX0FVRElPX0ZJTEVfVFlQRSAmJgogICAgICAgICAgICAgICAgIGZpbGVUeXBlIDw9IExBU1RfQVVESU9fRklMRV9UWVBFKSB8fAogICAgICAgICAgICAgICAgIChmaWxlVHlwZSA+PSBGSVJTVF9NSURJX0ZJTEVfVFlQRSAmJgogICAgICAgICAgICAgICAgIGZpbGVUeXBlIDw9IExBU1RfTUlESV9GSUxFX1RZUEUpKTsKICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gaXNWaWRlb0ZpbGVUeXBlKGludCBmaWxlVHlwZSkgewogICAgICAgICByZXR1cm4gKGZpbGVUeXBlID49IEZJUlNUX1ZJREVPX0ZJTEVfVFlQRSAmJgogICAgICAgICAgICAgICAgIGZpbGVUeXBlIDw9IExBU1RfVklERU9fRklMRV9UWVBFKTsKICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gaXNJbWFnZUZpbGVUeXBlKGludCBmaWxlVHlwZSkgewogICAgICAgICByZXR1cm4gKGZpbGVUeXBlID49IEZJUlNUX0lNQUdFX0ZJTEVfVFlQRSAmJgogICAgICAgICAgICAgICAgIGZpbGVUeXBlIDw9IExBU1RfSU1BR0VfRklMRV9UWVBFKTsKICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gaXNQbGF5TGlzdEZpbGVUeXBlKGludCBmaWxlVHlwZSkgewogICAgICAgICByZXR1cm4gKGZpbGVUeXBlID49IEZJUlNUX1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gICAgIHJldHVybiAobWVkaWFGaWxlVHlwZSA9PSBudWxsID8gbnVsbCA6IG1lZGlhRmlsZVR5cGUubWltZVR5cGUpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgaW50IGdldEZvcm1hdENvZGUoU3RyaW5nIGZpbGVOYW1lLCBTdHJpbmcgbWltZVR5cGUpIHsKKyAgICAgICAgaWYgKG1pbWVUeXBlICE9IG51bGwpIHsKKyAgICAgICAgICAgIEludGVnZXIgdmFsdWUgPSBzTWltZVR5cGVUb0Zvcm1hdE1hcC5nZXQobWltZVR5cGUpOworICAgICAgICAgICAgaWYgKHZhbHVlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUuaW50VmFsdWUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpbnQgbGFzdERvdCA9IGZpbGVOYW1lLmxhc3RJbmRleE9mKCcuJyk7CisgICAgICAgIGlmIChsYXN0RG90ID4gMCkgeworICAgICAgICAgICAgU3RyaW5nIGV4dGVuc2lvbiA9IGZpbGVOYW1lLnN1YnN0cmluZyhsYXN0RG90ICsgMSk7CisgICAgICAgICAgICBJbnRlZ2VyIHZhbHVlID0gc0ZpbGVUeXBlVG9Gb3JtYXRNYXAuZ2V0KGV4dGVuc2lvbik7CisgICAgICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZS5pbnRWYWx1ZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuRk9STUFUX1VOREVGSU5FRDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBnZXRNaW1lVHlwZUZvckZvcm1hdENvZGUoaW50IGZvcm1hdENvZGUpIHsKKyAgICAgICAgcmV0dXJuIHNGb3JtYXRUb01pbWVUeXBlTWFwLmdldChmb3JtYXRDb2RlKTsKKyAgICB9CiB9CmRpZmYgL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24KICAgICBwcml2YXRlIG5hdGl2ZSB2b2lkIF9zZXRPdXRwdXRGaWxlKEZpbGVEZXNjcmlwdG9yIGZkLCBsb25nIG9mZnNldCwgbG9uZyBsZW5ndGgpCiAgICAgICAgIHRocm93cyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24sIElPRXhjZXB0aW9uOworICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgX3NldE91dHB1dEZpbGVBdXgoRmlsZURlc2NyaXB0b3IgZmQpCisgICAgICAgIHRocm93cyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24sIElPRXhjZXB0aW9uOwogICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgX3ByZXBhcmUoKSB0aHJvd3MgSWxsZWdhbFN0YXRlRXhjZXB0aW9uLCBJT0V4Y2VwdGlvbjsKIAogICAgIC8qKgpAQCAtNTA2LDYgKzYxOCwyMiBAQAogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJObyB2YWxpZCBvdXRwdXQgZmlsZSIpOwogICAgICAgICB9CisKKyAgICAgICAgaWYgKG1QcmVwYXJlQXV4aWxpYXJ5RmlsZSkgeworICAgICAgICAgICAgaWYgKG1QYXRoQXV4ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBGaWxlT3V0cHV0U3RyZWFtIGZvcyA9IG5ldyBGaWxlT3V0cHV0U3RyZWFtKG1QYXRoQXV4KTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBfc2V0T3V0cHV0RmlsZUF1eChmb3MuZ2V0RkQoKSk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgZm9zLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChtRmRBdXggIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIF9zZXRPdXRwdXRGaWxlQXV4KG1GZEF1eCk7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oQ29udGV4dCBjKSB7CiAgICAgICAgIG5hdGl2ZV9zZXR1cCgpOwpAQCAtMzg1LDYgKzM4MywxMSBAQAogCiAgICAgcHJpdmF0ZSBNeU1lZGlhU2Nhbm5lckNsaWVudCBtQ2xpZW50ID0gbmV3IE15TWVkaWFTY2FubmVyQ2xpZW50KCk7CiAKKyAgICBwcml2YXRlIGJvb2xlYW4gaXNEcm1FbmFibGVkKCkgeworICAgICAgICBTdHJpbmcgcHJvcCA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KCJkcm0uc2VydmljZS5lbmFibGVkIik7CisgICAgICAgIHJldHVybiBwcm9wICE9IG51bGwgJiYgcHJvcC5lcXVhbHMoInRydWUiKTsKKyAgICB9CisgICAgCiAgICAgcHJpdmF0ZSBjbGFzcyBNeU1lZGlhU2Nhbm5lckNsaWVudCBpbXBsZW1lbnRzIE1lZGlhU2Nhbm5lckNsaWVudCB7CiAKICAgICAgICAgcHJpdmF0ZSBTdHJpbmcgbUFydGlzdDsKQEAgLTQzMSw2ICs0MzQsOSBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBtTWltZVR5cGUgPSBudWxsOworICAgICAgICAgICAgbUZpbGVUeXBlID0gMDsKKyAgICAgICAgICAgIG1GaWxlU2l6ZSA9IGZpbGVTaXplOworCiAgICAgICAgICAgICAvLyB0cnkgbWltZVR5cGUgZmlyc3QsIGlmIGl0IGlzIHNwZWNpZmllZAogICAgICAgICAgICAgaWYgKG1pbWVUeXBlICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBtRmlsZVR5cGUgPSBNZWRpYUZpbGUuZ2V0RmlsZVR5cGVGb3JNaW1lVHlwZShtaW1lVHlwZSk7CkBAIC00MzgsNyArNDQ0LDYgQEAKICAgICAgICAgICAgICAgICAgICAgbU1pbWVUeXBlID0gbWltZVR5cGU7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgbUZpbGVTaXplID0gZmlsZVNpemU7CiAKICAgICAgICAgICAgIC8vIGlmIG1pbWVUeXBlIHdhcyBub3Qgc3BlY2lmaWVkLCBjb21wdXRlIGZpbGUgdHlwZSBiYXNlZCBvbiBmaWxlIGV4dGVuc2lvbi4KICAgICAgICAgICAgIGlmIChtTWltZVR5cGUgPT0gbnVsbCkgewpAQCAtNDQ5LDEzICs0NTQsMjcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIGlmIChpc0RybUVuYWJsZWQoKSAmJiBNZWRpYUZpbGUuaXNEcm1GaWxlVHlwZShtRmlsZVR5cGUpKSB7CisgICAgICAgICAgICAgICAgbUZpbGVUeXBlID0gZ2V0RmlsZVR5cGVGcm9tRHJtKHBhdGgpOworICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBTdHJpbmcga2V5ID0gcGF0aDsKICAgICAgICAgICAgIGlmIChtQ2FzZUluc2Vuc2l0aXZlUGF0aHMpIHsKICAgICAgICAgICAgICAgICBrZXkgPSBwYXRoLnRvTG93ZXJDYXNlKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBGaWxlQ2FjaGVFbnRyeSBlbnRyeSA9IG1GaWxlQ2FjaGUuZ2V0KGtleSk7CiAgICAgICAgICAgICBpZiAoZW50cnkgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGVudHJ5ID0gbmV3IEZpbGVDYWNoZUVudHJ5KG51bGwsIDAsIHBhdGgsIDApOworICAgICAgICAgICAgICAgIFVyaSB0YWJsZVVyaTsKKyAgICAgICAgICAgICAgICBpZiAoTWVkaWFGaWxlLmlzVmlkZW9GaWxlVHlwZShtRmlsZVR5cGUpKSB7CisgICAgICAgICAgICAgICAgICAgIHRhYmxlVXJpID0gbVZpZGVvVXJpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoTWVkaWFGaWxlLmlzSW1hZ2VGaWxlVHlwZShtRmlsZVR5cGUpKSB7CisgICAgICAgICAgICAgICAgICAgIHRhYmxlVXJpID0gbUltYWdlc1VyaTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKE1lZGlhRmlsZS5pc0F1ZGlvRmlsZVR5cGUobUZpbGVUeXBlKSkgeworICAgICAgICAgICAgICAgICAgICB0YWJsZVVyaSA9IG1BdWRpb1VyaTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB0YWJsZVVyaSA9IG1GaWxlc1VyaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZW50cnkgPSBuZXcgRmlsZUNhY2hlRW50cnkodGFibGVVcmksIDAsIHBhdGgsIDAsIDApOwogICAgICAgICAgICAgICAgIG1GaWxlQ2FjaGUucHV0KGtleSwgZW50cnkpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZW50cnkubVNlZW5JbkZpbGVTeXN0ZW0gPSB0cnVlOwpAQCAtNTAwLDcgKzUxOSw4IEBACiAgICAgICAgICAgICBkb1NjYW5GaWxlKHBhdGgsIG1pbWVUeXBlLCBsYXN0TW9kaWZpZWQsIGZpbGVTaXplLCBmYWxzZSk7CiAgICAgICAgIH0KIAotICAgICAgICBwdWJsaWMgVXJpIGRvU2NhbkZpbGUoU3RyaW5nIHBhdGgsIFN0cmluZyBtaW1lVHlwZSwgbG9uZyBsYXN0TW9kaWZpZWQsIGxvbmcgZmlsZVNpemUsIGJvb2xlYW4gc2NhbkFsd2F5cykgeworICAgICAgICBwdWJsaWMgVXJpIGRvU2NhbkZpbGUoU3RyaW5nIHBhdGgsIFN0cmluZyBtaW1lVHlwZSwgbG9uZyBsYXN0TW9kaWZpZWQsCisgICAgICAgICAgICAgICAgbG9uZyBmaWxlU2l6ZSwgYm9vbGVhbiBzY2FuQWx3YXlzKSB7CiAgICAgICAgICAgICBVcmkgcmVzdWx0ID0gbnVsbDsKIC8vICAgICAgICAgICAgbG9uZyB0MSA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwogICAgICAgICAgICAgdHJ5IHsKQEAgLTUxNSw3ICs1MzUsOSBAQAogICAgICAgICAgICAgICAgICAgICBib29sZWFuIG11c2ljID0gKGxvd3BhdGguaW5kZXhPZihNVVNJQ19ESVIpID4gMCkgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICghcmluZ3RvbmVzICYmICFub3RpZmljYXRpb25zICYmICFhbGFybXMgJiYgIXBvZGNhc3RzKTsKIAotICAgICAgICAgICAgICAgICAgICBpZiAoIU1lZGlhRmlsZS5pc0ltYWdlRmlsZVR5cGUobUZpbGVUeXBlKSkgeworICAgICAgICAgICAgICAgICAgICAvLyB3ZSBvbmx5IGV4dHJhY3QgbWV0YWRhdGEgZm9yIGF1ZGlvIGFuZCB2aWRlbyBmaWxlcworICAgICAgICAgICAgICAgICAgICBpZiAoTWVkaWFGaWxlLmlzQXVkaW9GaWxlVHlwZShtRmlsZVR5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgTWVkaWFGaWxlLmlzVmlkZW9GaWxlVHlwZShtRmlsZVR5cGUpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzRmlsZShwYXRoLCBtaW1lVHlwZSwgdGhpcyk7CiAgICAgICAgICAgICAgICAgICAgIH0KIApAQCAtNTU1LDcgKzU3Nyw4IEBACiAgICAgICAgICAgICAgICAgbVRpdGxlID0gdmFsdWU7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKG5hbWUuZXF1YWxzSWdub3JlQ2FzZSgiYXJ0aXN0IikgfHwgbmFtZS5zdGFydHNXaXRoKCJhcnRpc3Q7IikpIHsKICAgICAgICAgICAgICAgICBtQXJ0aXN0ID0gdmFsdWUudHJpbSgpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFsc0lnbm9yZUNhc2UoImFsYnVtYXJ0aXN0IikgfHwgbmFtZS5zdGFydHNXaXRoKCJhbGJ1bWFydGlzdDsiKSkgeworICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFsc0lnbm9yZU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AgICAgICAgICAgICBsYXN0U2xhc2grKzsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGxhc3RTbGFzaCA8IHRpdGxlLmxlbmd0aCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnN1YnN0cmluZyhsYXN0U2xhc2gpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIHRydW5jYXRlIHRoZSBmaWxlIGV4dGVuc2lvbiAoaWYgYW55KQotICAgICAgICAgICAgICAgIGludCBsYXN0RG90ID0gdGl0bGUubGFzdEluZGV4T2YoJy4nKTsKLSAgICAgICAgICAgICAgICBpZiAobGFzdERvdCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5zdWJzdHJpbmcoMCwgbGFzdERvdCk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRpdGxlID0gTWVkaWFGaWxlLmdldEZpbGVUaXRsZSh2YWx1ZXMuZ2V0QXNTdHJpbmcoTWVkaWFTdG9yZS5NZWRpYUNvbHVtbnMuREFUQSkpOwogICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoTWVkaWFTdG9yZS5NZWRpYUNvbHVtbnMuVElUTEUsIHRpdGxlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIFN0cmluZyBhbGJ1bSA9IHZhbHVlcy5nZXRBc1N0cmluZyhBdWRpby5NZWRpYS5BTEJVTSk7CkBAIC03MTUsNyArNzEwLDcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBsb25nIHJvd0lkID0gZW50cnkubVJvd0lkOwotICAgICAgICAgICAgaWYgKGlzQXVkaW8gJiYgcm93SWQgPT0gMCkgeworICAgICAgICAgICAgaWYgKE1lZGlhRmlsZS5pc0F1ZGlvRmlsZVR5cGUobUZpbGVUeXBlKSAmJiAocm93SWQgPT0gMCB8fCBtTXRwT2JqZWN0SGFuZGxlICE9IDApKSB7CiAgICAgICAgICAgICAgICAgLy8gT25seSBzZXQgdGhlc2UgZm9yIG5ldyBlbnRyaWVzLiBGb3IgZXhpc3RpbmcgZW50cmllcywgdGhleQogICAgICAgICAgICAgICAgIC8vIG1heSBoYXZlIGJlZW4gbW9kaWZpZWQgbGF0ZXIsIGFuZCB3ZSB3YW50IHRvIGtlZXAgdGhlIGN1cnJlbnQKICAgICAgICAgICAgICAgICAvLyB2YWx1ZXMgc28gdGhhdCBjdXN0b20gcmluZ3RvbmVzIHN0aWxsIHNob3cgdXAgaW4gdGhlIHJpbmd0b25lCkBAIC03NjgsOCArNzYzLDE1IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCisgICAgICAgICAgICBVcmkgdGFibGVVcmkgPSBlbnRyeS5tVGFibGVVcmk7CiAgICAgICAgICAgICBVcmkgcmVzdWx0ID0gbnVsbDsKICAgICAgICAgICAgIGlmIChyb3dJZCA9PSAwKSB7CisgICAgICAgICAgICAgICAgaWYgKG1NdHBPYmplY3RIYW5kbGUgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KE1lZGlhU3RvcmUuTWVkaWFDb2x1bW5zLk1FRElBX1NDQU5ORVJfTkVXX09CSkVDVF9JRCwgbU10cE9iamVjdEhhbmRsZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICh0YWJsZVVyaSA9PSBtRmlsZXNVcmkpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChGaWxlcy5GaWxlQ29sdW1ucy5GT1JNQVQsIE1lZGlhRmlsZS5nZXRGb3JtYXRDb2RlKGVudHJ5Lm1QYXRoLCBtTWltZVR5cGUpKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgLy8gbmV3IGZpbGUsIGluc2VydCBpdAogICAgICAgICAgICAgICAgIHJlc3VsdCA9IG1NZWRpYVByb3ZpZGVyLmluc2VydCh0YWJsZVVyaSwgdmFsdWVzKTsKICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9IG51bGwpIHsKQEAgLTg4Myw5ICs4ODUsMzAgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCisgICAgICAgIHByaXZhdGUgaW50IGdldEZpbGVUeXBlRnJvbURybShTdHJpbmcgcGF0aCkgeworICAgICAgICAgICAgaWYgKCFpc0RybUVuYWJsZWQoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQgcmVzdWx0RmlsZVR5cGUgPSAwOworCisgICAgICAgICAgICBpZiAobURybU1hbmFnZXJDbGllbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Ecm1NYW5hZ2VyQ2xpZW50ID0gbmV3IERybU1hbmFnZXJDbGllbnQobUNvbnRleHQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobURybU1hbmFnZXJDbGllbnQuY2FuSGFuZGxlKHBhdGgsIG51bGwpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGRybU1pbWV0eXBlID0gbURybU1hbmFnZXJDbGllbnQuZ2V0T3JpZ2luYWxNaW1lVHlwZShwYXRoKTsKKyAgICAgICAgICAgICAgICBpZiAoZHJtTWltZXR5cGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtTWltZVR5cGUgPSBkcm1NaW1ldHlwZTsKKyAgICAgICAgICAgICAgICAgICAgcmVzdWx0RmlsZVR5cGUgPSBNZWRpYUZpbGUuZ2V0RmlsZVR5cGVGb3JNaW1lVHlwZShkcm1NaW1ldHlwZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHJlc3VsdEZpbGVUeXBlOworICAgICAgICB9CisKICAgICB9OyAvLyBlbmQgb2YgYW5vbnltb3VzIE1lZGlhU2Nhbm5lckNsaWVudCBpbnN0YW5jZQogCi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gIGMgPSBtTWVkaWFQcm92aWRlci5xdWVyeShtQXVkaW9VcmksIEFVRElPX1BST0pFQ1RJT04sIHdoZXJlLCBzZWxlY3Rpb25BcmdzLCBudWxsKTsKKyAgICAgICAgICAgIGlmIChwcmVzY2FuRmlsZXMpIHsKKyAgICAgICAgICAgICAgICAvLyBGaXJzdCByZWFkIGV4aXN0aW5nIGZpbGVzIGZyb20gdGhlIGZpbGVzIHRhYmxlCiAKLSAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICB3aGlsZSAoYy5tb3ZlVG9OZXh0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgcm93SWQgPSBjLmdldExvbmcoSURfQVVESU9fQ09MVU1OX0lOREVYKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwYXRoID0gYy5nZXRTdHJpbmcoUEFUSF9BVURJT19DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyBsYXN0TW9kaWZpZWQgPSBjLmdldExvbmcoREFURV9NT0RJRklFRF9BVURJT19DT0xVTU5fSU5ERVgpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IGNvbnNpZGVyIGVudHJpZXMgd2l0aCBhYnNvbHV0ZSBwYXRoIG5hbWVzLgotICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBhbGxvd3Mgc3RvcmluZyBVUklzIGluIHRoZSBkYXRhYmFzZSB3aXRob3V0IHRoZQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWVkaWEgc2Nhbm5lciByZW1vdmluZyB0aGVtLgotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhdGguc3RhcnRzV2l0aCgiLyIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IHBhdGg7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1DYXNlSW5zZW5zaXRpdmVQYXRocykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSBwYXRoLnRvTG93ZXJDYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaWxlQ2FjaGUucHV0KGtleSwgbmV3IEZpbGVDYWNoZUVudHJ5KG1BdWRpb1VyaSwgcm93SWQsIHBhdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0TW9kaWZpZWQpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgIGMuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgYyA9IG51bGw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBSZWFkIGV4aXN0aW5nIGZpbGVzIGZyb20gdGhlIHZpZGVvIHRhYmxlCi0gICAgICAgICAgICBpZiAoZmlsZVBhdGggIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHdoZXJlID0gTWVkaWFTdG9yZS5WaWRlby5NZWRpYS5EQVRBICsgIj0/IjsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgd2hlcmUgPSBudWxsOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYyA9IG1NZWRpYVByb3ZpZGVyLnF1ZXJ5KG1WaWRlb1VyaSwgVklERU9fUFJPSkVDVElPTiwgd2hlcmUsIHNlbGVjdGlvbkFyZ3MsIG51bGwpOwotCi0gICAgICAgICAgICBpZiAoYyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsb25nIHJvd0lkID0gYy5nZXRMb25nKElEX1ZJREVPX0NPTFVNTl9JTkRFWCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcGF0aCA9IGMuZ2V0U3RyaW5nKFBBVEhfVklERU9fQ09MVU1OX0lOREVYKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgbGFzdE1vZGlmaWVkID0gYy5nZXRMb25nKERBVEVfTU9ESUZJRURfVklERU9fQ09MVU1OX0lOREVYKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gT25seSBjb25zaWRlciBlbnRyaWVzIHdpdGggYWJzb2x1dGUgcGF0aCBuYW1lcy4KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgYWxsb3dzIHN0b3JpbmcgVVJJcyBpbiB0aGUgZGF0YWJhc2Ugd2l0aG91dCB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1lZGlhIHNjYW5uZXIgcmVtb3ZpbmcgdGhlbS4KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXRoLnN0YXJ0c1dpdGgoIi8iKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBrZXkgPSBwYXRoOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQ2FzZUluc2Vuc2l0aXZlUGF0aHMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5ID0gcGF0aC50b0xvd2VyQ2FzZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmlsZUNhY2hlLnB1dChrZXksIG5ldyBGaWxlQ2FjaGVFbnRyeShtVmlkZW9VcmksIHJvd0lkLCBwYXRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdE1vZGlmaWVkKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgICAgICBjLmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGMgPSBudWxsOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gUmVhZCBleGlzdGluZyBmaWxlcyBmcm9tIHRoZSBpbWFnZXMgdGFibGUKLSAgICAgICAgICAgIGlmIChmaWxlUGF0aCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgd2hlcmUgPSBNZWRpYVN0b3JlLkltYWdlcy5NZWRpYS5EQVRBICsgIj0/IjsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgd2hlcmUgPSBudWxsOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbU9yaWdpbmFsQ291bnQgPSAwOwotICAgICAgICAgICAgYyA9IG1NZWRpYVByb3ZpZGVyLnF1ZXJ5KG1JbWFnZXNVcmksIElNQUdFU19QUk9KRUNUSU9OLCB3aGVyZSwgc2VsZWN0aW9uQXJncywgbnVsbCk7Ci0KLSAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBtT3JpZ2luYWxDb3VudCA9IGMuZ2V0Q291bnQoKTsKLSAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsb25nIHJvd0lkID0gYy5nZXRMb25nKElEX0lNQUdFU19DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHBhdGggPSBjLmdldFN0cmluZyhQQVRIX0lNQUdFU19DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICBsb25nIGxhc3RNb2RpZmllZCA9IGMuZ2V0TG9uZyhEQVRFX01PRElGSUVEX0lNQUdFU19DT0xVTU5fSU5ERVgpOwotCi0gICAgICAgICAgICAgICAgICAgICAgIC8vIE9ubHkgY29uc2lkZXIgZW50cmllcyB3aXRoIGFic29sdXRlIHBhdGggbmFtZXMuCi0gICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgYWxsb3dzIHN0b3JpbmcgVVJJcyBpbiB0aGUgZGF0YWJhc2Ugd2l0aG91dCB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgLy8gbWVkaWEgc2Nhbm5lciByZW1vdmluZyB0aGVtLgotICAgICAgICAgICAgICAgICAgICAgICBpZiAocGF0aC5zdGFydHNXaXRoKCIvIikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBrZXkgPSBwYXRoOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1DYXNlSW5zZW5zaXRpdmVQYXRocykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleSA9IHBhdGgudG9Mb3dlckNhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaWxlQ2FjaGUucHV0KGtleSwgbmV3IEZpbGVDYWNoZUVudHJ5KG1JbWFnZXNVcmksIHJvd0lkLCBwYXRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0TW9kaWZpZWQpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgYy5jbG9zZSgpOwotICAgICAgICAgICAgICAgICAgICBjID0gbnVsbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtUHJvY2Vzc1BsYXlsaXN0cykgewotICAgICAgICAgICAgICAgIC8vIFJlYWQgZXhpc3RpbmcgZmlsZXMgZnJvbSB0aGUgcGxheWxpc3RzIHRhYmxlCi0gICAgICAgICAgICAgICAgaWYgKGZpbGVQYXRoICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgd2hlcmUgPSBNZWRpYVN0b3JlLkF1ZGlvLlBsYXlsaXN0cy5EQVRBICsgIj0/IjsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB3aGVyZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGMgPSBtTWVkaWFQcm92aWRlci5xdWVyeShtUGxheWxpc3RzVXJpLCBQTEFZTElTVFNfUFJPSkVDVElPTiwgd2hlcmUsIHNlbGVjdGlvbkFyZ3MsIG51bGwpOworICAgICAgICAgICAgICAgIGMgPSBtTWVkaWFQcm92aWRlci5xdWVyeShtRmlsZXNVcmksIEZJTEVTX1BSRVNDQU5fUFJPSkVDVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHdoZXJlLCBzZWxlY3Rpb25BcmdzLCBudWxsKTsKIAogICAgICAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChjLm1vdmVUb05leHQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwYXRoID0gYy5nZXRTdHJpbmcoUEFUSF9QTEFZTElTVFNfQ09MVU1OX0lOREVYKTsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsb25nIHJvd0lkID0gYy5nZXRMb25nKEZJTEVTX1BSRVNDQU5fSURfQ09MVU1OX0lOREVYKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwYXRoID0gYy5nZXRTdHJpbmcoRklMRVNfUFJFU0NBTl9QQVRIX0NPTFVNTl9JTkRFWCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZm9ybWF0ID0gYy5nZXRJbnQoRklMRVNfUFJFU0NBTl9GT1JNQVRfQ09MVU1OX0lOREVYKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgbGFzdE1vZGlmaWVkID0gYy5nZXRMb25nKEZJTEVTX1BSRVNDQU5fREFURV9NT0RJRklFRF9DT0xVTU5fSU5ERVgpOwogCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhdGggIT0gbnVsbCAmJiBwYXRoLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nIHJvd0lkID0gYy5nZXRMb25nKElEX1BMQVlMSVNUU19DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nIGxhc3RNb2RpZmllZCA9IGMuZ2V0TG9uZyhEQVRFX01PRElGSUVEX1BMQVlMSVNUU19DT0xVTU5fSU5ERVgpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBrZXkgPSBwYXRoOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUNhc2VJbnNlbnNpdGl2ZVBhdGhzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSBwYXRoLnRvTG93ZXJDYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZpbGVDYWNoZS5wdXQoa2V5LCBuZXcgRmlsZUNhY2hlRW50cnkobVBsYXlsaXN0c1VyaSwgcm93SWQsIHBhdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdE1vZGlmaWVkKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IGNvbnNpZGVyIGVudHJpZXMgd2l0aCBhYnNvbHV0ZSBwYXRoIG5hbWVzLgorICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBhbGxvd3Mgc3RvcmluZyBVUklzIGluIHRoZSBkYXRhYmFzZSB3aXRob3V0IHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWVkaWEgc2Nhbm5lciByZW1vdmluZyB0aGVtLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhdGguc3RhcnRzV2l0aCgiLyIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IHBhdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1DYXNlSW5zZW5zaXRpdmVQYXRocykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSBwYXRoLnRvTG93ZXJDYXNlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZUNhY2hlRW50cnkgZW50cnkgPSBuZXcgRmlsZUNhY2hlRW50cnkobUZpbGVzVXJpLCByb3dJZCwgcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RNb2RpZmllZCwgZm9ybWF0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmlsZUNhY2hlLnB1dChrZXksIGVudHJ5KTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGMuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGMgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGMuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgYyA9IG51bGw7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0xMDQxLDYgKzk2OSwxNCBAQAogICAgICAgICAgICAgICAgIGMuY2xvc2UoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQorCisgICAgICAgIC8vIGNvbXB1dGUgb3JpZ2luYWwgc2l6ZSBvZiBpbWFnZXMKKyAgICAgICAgbU9yaWdpbmFsQ291bnQgPSAwOworICAgICAgICBjID0gbU1lZGlhUHJvdmlkZXIucXVlcnkobUltYWdlc1VyaSwgSURfUFJPSkVDVElPTiwgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgIGlmIChjICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1PcmlnaW5hbENvdW50ID0gYy5nZXRDb3VudCgpOworICAgICAgICAgICAgYy5jbG9zZSgpOworICAgICAgICB9CiAgICAgfQogCiAgICAgcHJpdmF0ZSBib29sZWFuIGluU2NhbkRpcmVjdG9yeShTdHJpbmcgcGF0aCwgU3RyaW5nW10gZGlyZWN0b3JpZXMpIHsKQEAgLTExMDcsMTIgKzEwNDMsMTQgQEAKICAgICAgICAgICAgIC8vIHJlbW92ZSBkYXRhYmFzZSBlbnRyaWVzIGZvciBmaWxlcyB0aGF0IG5vIGxvbmdlciBleGlzdC4KICAgICAgICAgICAgIGJvb2xlYW4gZmlsZU1pc3NpbmcgPSBmYWxzZTsKIAotICAgICAgICAgICAgaWYgKCFlbnRyeS5tU2VlbkluRmlsZVN5c3RlbSkgewotICAgICAgICAgICAgICAgIGlmIChpblNjYW5EaXJlY3RvcnkocGF0aCwgZGlyZWN0b3JpZXMpKSB7CisgICAgICAgICAgICBpZiAoIWVudHJ5Lm1TZWVuSW5GaWxlU3lzdGVtICYmICFNdHBDb25zdGFudHMuaXNBYnN0cmFjdE9iamVjdChlbnRyeS5tRm9ybWF0KSkgeworICAgICAgICAgICAgICAgIGlmIChlbnRyeS5tRm9ybWF0ICE9IE10cENvbnN0YW50cy5GT1JNQVRfQVNTT0NJQVRJT04gJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIGluU2NhbkRpcmVjdG9yeShwYXRoLCBkaXJlY3RvcmllcykpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gd2UgZGlkbid0IHNlZSB0aGlzIGZpbGUgaW4gdGhlIHNjYW4gZGlyZWN0b3J5LgogICAgICAgICAgICAgICAgICAgICBmaWxlTWlzc2luZyA9IHRydWU7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGZpbGUgaXMgb3V0c2lkZSBvZiBvdXIgc2NhbiBkaXJlY3RvcnksCisgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBmaWxlIGFjdHVhbGx5IGEgZGlyZWN0b3J5IG9yIG90aGVyIGFic3RyYWN0IG9iamVjdAorICAgICAgICAgICAgICAgICAgICAvLyBvciBpcyBvdXRzaWRlIG9mIG91ciBzY2FuIGRpcmVjdG9yeSwKICAgICAgICAgICAgICAgICAgICAgLy8gc28gd2UgbmVlZCB0byBjaGVjayBmb3IgZmlsZSBleGlzdGVuY2UgaGVyZS4KICAgICAgICAgICAgICAgICAgICAgRmlsZSB0ZXN0RmlsZSA9IG5ldyBGaWxlKHBhdGgpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIXRlc3RGaWxlLmV4aXN0cygpKSB7CkBAIC0xMTMyLDkgKzEwNzAsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyB2YWx1ZXMgPSBuZXcgQ29udGVudFZhbHVlcygpOwogICAgICAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KE1lZGlhU3RvcmUuQXVkaW8uUGxheWxpc3RzLkRBVEEsICIiKTsKICAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChNZWRpYVN0b3JlLkF1ZGlvLlBsYXlsaXN0cy5EQVRFX01PRElGSUVELCAwKTsKLSAgICAgICAgICAgICAgICAgICAgbU1lZGlhUHJvdmlkZXIudXBkYXRlKENvbnRlbnRVcmlzLndpdGhBcHBlbmRlZElkKG1QbGF5bGlzdHNVcmksIGVudHJ5Lm1Sb3dJZCksIHZhbHVlcywgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgIG1NZWRpYVByb3ZpZGVyLnVwZGF0ZShDb250ZW50VXJpcy53aXRoQXBwZW5kZWRJZChtUGxheWxpc3RzVXJpLCBlbnRyeS5tUm93SWQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcywgbnVsbCwgbnVsbCk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbU1lZGlhUHJvdmlkZXIuZGVsZXRlKENvbnRlbnRVcmlzLndpdGhBcHBlbmRlZElkKGVudHJ5Lm1UYWJsZVVyaSwgZW50cnkubVJvd0lkKSwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgIG1NZWRpYVByb3ZpZGVyLmRlbGV0ZShDb250ZW50VXJpcy53aXRoQXBwZW5kZWRJZChtRmlsZXNVcmksIGVudHJ5Lm1Sb3dJZCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCk7CiAgICAgICAgICAgICAgICAgICAgIGl0ZXJhdG9yLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTExNjIsNiArMTEwMiw3IEBACiAgICAgICAgIG1WaWRlb1VyaSA9IFZpZGVvLk1lZGlhLmdldENvbnRlbnRVcmkodm9sdW1lTmFtZSk7CiAgICAgICAgIG1JbWFnZXNVcmkgPSBJbWFnZXMuTWVkaWEuZ2V0Q29udGVudFVyaSh2b2x1bWVOYW1lKTsKICAgICAgICAgbVRodW1ic1VyaSA9IEltYWdlcy5UaHVtYm5haWxzLmdldENvbnRlbnRVcmkodm9sdW1lTmFtZSk7CisgICAgICAgIG1GaWxlc1VyaSA9IEZpbGVzLmdldENvbnRlbnRVcmkodm9sdW1lTmFtZSk7CiAKICAgICAgICAgaWYgKCF2b2x1bWVOYW1lLmVxdWFscygiaW50ZXJuYWwiKSkgewogICAgICAgICAgICAgLy8gd2Ugb25seSBzdXBwb3J0IHBsYXlsaXN0cyBvbiBleH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ljIGZpbmFsIGludCBGT1JNQVRfREVGSU5FRCA9IDB4MzgwMDsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfRVhJRl9KUEVHID0gMHgzODAxOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9USUZGX0VQID0gMHgzODAyOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9GTEFTSFBJWCA9IDB4MzgwMzsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQk1QID0gMHgzODA0OworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9DSUZGID0gMHgzODA1OworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9HSUYgPSAweDM4MDc7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0pGSUYgPSAweDM4MDg7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0NEID0gMHgzODA5OworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9QSUNUID0gMHgzODBBOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9QTkcgPSAweDM4MEI7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1RJRkYgPSAweDM4MEQ7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1RJRkZfSVQgPSAweDM4MEU7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0pQMiA9IDB4MzgwRjsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfSlBYID0gMHgzODEwOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9VTkRFRklORURfRklSTVdBUkUgPSAweEI4MDI7CisgICAgcHVibGljIHN0YXRpYyBmaW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gT0JKRUNUICAgICAgICAgICAgICA9IDU7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgT0JKRUNUX0lEICAgICAgICAgICA9IDY7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgU1RPUkFHRV9DSElMRFJFTiAgICA9IDc7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgT0JKRUNUX0NISUxEUkVOICAgICA9IDg7CisKKyAgICAvKiogVGhlIG5hbWVzIG9mIHRoZSBjb2x1bW5zIGluIHRoZSBwcm9qZWN0aW9uICovCisgICAgcHJpdmF0ZSBTdHJpbmdbXSBtQ29sdW1uczsKKworICAgIC8qKiBUaGUgbnVtYmVyIG9mIHJvd3MgaW4gdGhlIGN1cnNvciAqLworICAgIHByaXZhdGUgaW50IG1Db3VudCA9IE5PX0NPVU5UOworCisKKyAgICBwdWJsaWMgTXRwQ3Vyc29yKE10cENsaWVudCBjbGllbnQsIGludCBxdWVyeVR5cGUsIGludCBkZXZpY2VJRCwgbG9uZyBzdG9yYWdlSUQsIGxvbmcgb2JqZWN0SUQsCisgICAgICAgICAgICBTdHJpbmdbXSBwcm9qZWN0aW9uKSB7CisgICAgICAgIGlmIChjbGllbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJjbGllbnQgbnVsbCBpbiBNdHBDdXJzb3IgY29uc3RydWN0b3IiKTsKKyAgICAgICAgfQorICAgICAgICBtQ29sdW1ucyA9IHByb2plY3Rpb247CisKKyAgICAgICAgSGFzaE1hcDxTdHJpbmcsIEludGVnZXI+IG1hcDsKKyAgICAgICAgc3dpdGNoIChxdWVyeVR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgREVWSUNFOgorICAgICAgICAgICAgY2FzZSBERVZJQ0VfSUQ6CisgICAgICAgICAgICAgICAgbWFwID0gc0RldmljZVByb2plY3Rpb25NYXA7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNUT1JBR0U6CisgICAgICAgICAgICBjYXNlIFNUT1JBR0VfSUQ6CisgICAgICAgICAgICAgICAgbWFwID0gc1N0b3JhZ2VQcm9qZWN0aW9uTWFwOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1Q6CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9JRDoKKyAgICAgICAgICAgIGNhc2UgU1RPUkFHRV9DSElMRFJFTjoKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0NISUxEUkVOOgorICAgICAgICAgICAgICAgIG1hcCA9IHNPYmplY3RQcm9qZWN0aW9uTWFwOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ1bmtub3duIHF1ZXJ5IHR5cGUgIiAgKyBxdWVyeVR5cGUpOworICAgICAgICB9CisKKyAgICAgICAgaW50W10gY29sdW1ucyA9IG5ldyBpbnRbcHJvamVjdGlvbi5sZW5ndGhdOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHByb2plY3Rpb24ubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIEludGVnZXIgaWQgPSBtYXAuZ2V0KHByb2plY3Rpb25baV0pOworICAgICAgICAgICAgaWYgKGlkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ1bmtub3duIGNvbHVtbiAiICArIHByb2plY3Rpb25baV0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY29sdW1uc1tpXSA9IGlkLmludFZhbHVlKCk7CisgICAgICAgIH0KKyAgICAgICAgbmF0aXZlX3NldHVwKGNsaWVudCwgcXVlcnlUeXBlLCBkZXZpY2VJRCwgc3RvcmFnZUlELCBvYmplY3RJRCwgY29sdW1ucyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgZmluYWxpemUoKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBuYXRpdmVfZmluYWxpemUoKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHN1cGVyLmZpbmFsaXplKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgaW50IGdldENvdW50KCkgeworICAgICAgICBpZiAobUNvdW50ID09IE5PX0NPVU5UKSB7CisgICAgICAgICAgICBmaWxsV2luZG93KDApOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtQ291bnQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gcmVxdWVyeSgpIHsKKyAgICAgICAgTG9nLmQoVEFHLCAicmVxdWVyeSIpOworICAgICAgICBtQ291bnQgPSBOT19DT1VOVDsKKyAgICAgICAgaWYgKG1XaW5kb3cgIT0gbnVsbCkgeworICAgICAgICAgICAgbVdpbmRvdy5jbGVhcigpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBzdXBlci5yZXF1ZXJ5KCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGZpbGxXaW5kb3coaW50IHN0YXJ0UG9zKSB7CisgICAgICAgIGlmIChtV2luZG93ID09IG51bGwpIHsKKyAgICAgICAgICAgIC8vIElmIHRoZXJlIGlzbid0IGEgd2luZG93IHNldCBhbHJlYWR5IGl0IHdpbGwgb25seSBiZSBhY2Nlc3NlZCBsb2NhbGx5CisgICAgICAgICAgICBtV2luZG93ID0gbmV3IEN1cnNvcldpbmRvdyh0cnVlIC8qIHRoZSB3aW5kb3cgaXMgbG9jYWwgb25seSAqLyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVdpbmRvdy5jbGVhcigpOworICAgICAgICB9CisgICAgICAgIG1XaW5kb3cuc2V0U3RhcnRQb3NpdGlvbihzdGFydFBvcyk7CisgICAgICAgIG1Db3VudCA9IG5hdGl2ZV9maWxsX3dpbmRvdyhtV2luZG93LCBzdGFydFBvcyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZ1tdIGdldENvbHVtbk5hbWVzKCkgeworICAgICAgICBMb2cuZChUQUcsICJnZXRDb2x1bW5OYW1lcyByZXR1cm5pbmcgIiArIG1Db2x1bW5zKTsKKyAgICAgICAgcmV0dXJuIG1Db2x1bW5zOworICAgIH0KKworICAgIC8qIERldmljZSBDb2x1bW4gSURzICovCisgICAgIC8qIFRoZXNlIG11c3QgbWF0Y2ggdGhlIHZhbHVlcyBpbiBNdHBDdXJzb3IuY3BwICovCisgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgREVWSUNFX1JPV19JRCAgICAgICAgICA9IDE7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IERFVklDRV9NQU5VRkFDVFVSRVIgICAgPSAyOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBERVZJQ0VfTU9ERUwgICAgICAgICAgID0gMzsKKworICAgIC8qIFN0b3JhZ2UgQ29sdW1uIElEcyAqLworICAgIC8qIFRoZXNlIG11c3QgbWF0Y2ggdGhlIHZhbHVlcyBpbiBNdHBDdXJzb3IuY3BwICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFNUT1JBR0VfUk9XX0lEICAgICAgICAgPSAxMDE7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFNUT1JBR0VfSURFTlRJRklFUiAgICAgPSAxMDI7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFNUT1JBR0VfREVTQ1JJUFRJT04gICAgPSAxMDM7CisKKyAgICAvKiBPYmplY3QgQ29sdW1uIElEcyAqLworICAgIC8qIFRoZXNlIG11c3QgbWF0Y2ggdGhlIHZhbHVlcyBpbiBNdHBDdXJzb3IuY3BwIC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RpYVBhdGgoU3RyaW5nIHBhdGgpIHsKKyAgICAgICAgLy8gY29udmVydCBleHRlcm5hbCBzdG9yYWdlIHBhdGggdG8gbWVkaWEgcGF0aAorICAgICAgICBpZiAocGF0aCAhPSBudWxsICYmIG1NZWRpYVN0b3JhZ2VQYXRoICE9IG51bGwKKyAgICAgICAgICAgICAgICAmJiBtRXh0ZXJuYWxTdG9yYWdlUGF0aCAhPSBudWxsCisgICAgICAgICAgICAgICAgJiYgcGF0aC5zdGFydHNXaXRoKG1FeHRlcm5hbFN0b3JhZ2VQYXRoKSkgeworICAgICAgICAgICAgcGF0aCA9IG1NZWRpYVN0b3JhZ2VQYXRoICsgcGF0aC5zdWJzdHJpbmcobUV4dGVybmFsU3RvcmFnZVBhdGgubGVuZ3RoKCkpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBwYXRoOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBvcGVuRGV2aWNlUHJvcGVydGllc0RhdGFiYXNlKENvbnRleHQgY29udGV4dCkgeworICAgICAgICBtRGV2aWNlUHJvcERiID0gY29udGV4dC5vcGVuT3JDcmVhdGVEYXRhYmFzZSgiZGV2aWNlLXByb3BlcnRpZXMiLCBDb250ZXh0Lk1PREVfUFJJVkFURSwgbnVsbCk7CisgICAgICAgIGludCB2ZXJzaW9uID0gbURldmljZVByb3BEYi5nZXRWZXJzaW9uKCk7CisKKyAgICAgICAgLy8gaW5pdGlhbGl6ZSBpZiBuZWNlc3NhcnkKKyAgICAgICAgaWYgKHZlcnNpb24gIT0gREVWSUNFX1BST1BFUlRJRVNfREFUQUJBU0VfVkVSU0lPTikgeworICAgICAgICAgICAgbURldmljZVByb3BEYi5leGVjU1FMKCJDUkVBVEUgVEFCTEUgcHJvcGVydGllcyAoIiArCisgICAgICAgICAgICAgICAgICAgICJfaWQgSU5URUdFUiBQUklNQVJZIEtFWSBBVVRPSU5DUkVNRU5ULCIgKworICAgICAgICAgICAgICAgICAgICAiY29kZSBJTlRFR0VSIFVOSVFVRSBPTiBDT05GTElDVCBSRVBMQUNFLCIgKworICAgICAgICAgICAgICAgICAgICAidmFsdWUgVEVYVCIgKworICAgICAgICAgICAgICAgICAgICAiKTsiKTsKKyAgICAgICAgICAgIG1EZXZpY2VQcm9wRGIuZXhlY1NRTCgiQ1JFQVRFIElOREVYIHByb3BlcnR5X2luZGV4IE9OIHByb3BlcnRpZXMgKGNvZGUpOyIpOworICAgICAgICAgICAgbURldmljZVByb3BEYi5zZXRWZXJzaW9uKERFVklDRV9QUk9QRVJUSUVTX0RBVEFCQVNFX1ZFUlNJT04pOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgYmVnaW5TZW5kT2JqZWN0KFN0cmluZyBwYXRoLCBpbnQgZm9ybWF0LCBpbnQgcGFyZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdG9yYWdlLCBsb25nIHNpemUsIGxvbmcgbW9kaWZpZWQpIHsKKyAgICAgICAgbURhdGFiYXNlTW9kaWZpZWQgPSB0cnVlOworICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgIHZhbHVlcy5wdXQoRmlsZXMuRmlsZUNvbHVtbnMuREFUQSwgcGF0aCk7CisgICAgICAgIHZhbHVlcy5wdXQoRmlsZXMuRmlsZUNvbHVtbnMuRk9STUFULCBmb3JtYXQpOworICAgICAgICB2YWx1ZXMucHV0KEZpbGVzLkZpbGVDb2x1bW5zLlBBUkVOVCwgcGFyZW50KTsKKyAgICAgICAgLy8gc3RvcmFnZSBpcyBpZ25vcmVkIGZvciBub3cKKyAgICAgICAgdmFsdWVzLnB1dChGaWxlcy5GaWxlQ29sdW1ucy5TSVpFLCBzaXplKTsKKyAgICAgICAgdmFsdWVzLnB1dChGaWxlcy5GaWxlQ29sdW1ucy5EQVRFX01PRElGSUVELCBtb2RpZmllZCk7CisKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIFVyaSB1cmkgPSBtTWVkaWFQcm92aWRlci5pbnNlcnQobU9iamVjdHNVcmksIHZhbHVlcyk7CisgICAgICAgICAgICBpZiAodXJpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gSW50ZWdlci5wYXJzZUludCh1cmkuZ2V0UGF0aFNlZ21lbnRzKCkuZ2V0KDIpKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVtb3RlRXhjZXB0aW9uIGluIGJlZ2luU2VuZE9iamVjdCIsIGUpOworICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGVuZFNlbmRPYmplY3QoU3RyaW5nIHBhdGgsIGludCBoYW5kbGUsIGludCBmb3JtYXQsIGJvb2xlYW4gc3VjY2VlZGVkKSB7CisgICAgICAgIGlmIChzdWNjZWVkZWQpIHsKKyAgICAgICAgICAgIC8vIGhhbmRsZSBhYnN0cmFjdCBwbGF5bGlzdHMgc2VwYXJhdGVseQorICAgICAgICAgICAgLy8gdGhleSBkbyBub3QgZXhpc3QgaW4gdGhlIGZpbGUgc3lzdGVtIHNvIGRvbid0IHVzZSB0aGUgbWVkaWEgc2Nhbm5lciBoZXJlCisgICAgICAgICAgICBpZiAoZm9ybWF0ID09IE10cENvbnN0YW50cy5GT1JNQVRfQUJTVFJBQ1RfQVZfUExBWUxJU1QpIHsKKyAgICAgICAgICAgICAgICAvLyBTdHJpcCBXaW5kb3dzIE1lZGlhIFBsYXllciBmaWxlIGV4dGVuc2lvbgorICAgICAgICAgICAgICAgIGlmIChwYXRoLmVuZHNXaXRoKCIucGxhIikpIHsKKyAgICAgICAgICAgICAgICAgICAgcGF0aCA9IHBhdGguc3Vic3RyaW5nKDAsIHBhdGgubGVuZ3RoKCkgLSA0KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBleHRyYWN0IG5hbWUgZnJvbSBwYXRoCisgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBwYXRoOworICAgICAgICAgICAgICAgIGludCBsYXN0U2xhc2ggPSBuYW1lLmxhc3RJbmRleE9mKCcvJyk7CisgICAgICAgICAgICAgICAgaWYgKGxhc3RTbGFzaCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIG5hbWUgPSBuYW1lLnN1YnN0cmluZyhsYXN0U2xhc2ggKyAxKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKDEpOworICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoQXVkaW8uUGxheWxpc3RzLkRBVEEsIHBhdGgpOworICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoQXVkaW8uUGxheWxpc3RzLk5BTUUsIG5hbWUpOworICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoTWVkaWFDb2x1bW5zLk1FRElBX1NDQU5ORVJfTkVXX09CSkVDVF9JRCwgaGFuZGxlKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBVcmkgdXJpID0gbU1lZGlhUHJvdmlkZXIuaW5zZXJ0KEF1ZGlvLlBsYXlsaXN0cy5FWFRFUk5BTF9DT05URU5UX1VSSSwgdmFsdWVzKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJSZW1vdGVFeGNlcHRpb24gaW4gZW5kU2VuZE9iamVjdCIsIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbU1lZGlhU2Nhbm5lci5zY2FuTXRwRmlsZShwYXRoLCBtVm9sdW1lTmFtZSwgaGFuZGxlLCBmb3JtYXQpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVsZXRlRmlsZShoYW5kbGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnRbXSBnZXRPYmplY3RMaXN0KGludCBzdG9yYWdlSUQsIGludCBmb3JtYXQsIGludCBwYXJlbnQpIHsKKyAgICAgICAgLy8gd2UgY2FuIGlnbm9yZSBzdG9yYWdlSUQgdW50aWwgd2Ugc3VwcG9ydCBtdWx0aXBsZSBzdG9yYWdlcworICAgICAgICBMb2cuZChUQUcsICJnZXRPYmplY3RMaXN0IHBhcmVudDogIiArIHBhcmVudCk7CisgICAgICAgIEN1cnNvciBjID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChmb3JtYXQgIT0gMCkgeworICAgICAgICAgICAgICAgIGMgPSBtTWVkaWFQcm92aWRlci5xdWVyeShtT2JqZWN0c1VyaSwgSURfUFJPSkVDVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQVJFTlRfRk9STUFUX1dIRVJFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXSB7IEludGVnZXIudG9TdHJpbmcocGFyZW50KSwgSW50ZWdlci50b1N0cmluZyhmb3JtYXQpIH0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBjID0gbU1lZGlhUHJvdmlkZXIucXVlcnkobU9iamVjdHNVcmksIElEX1BST0pFQ1RJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEFSRU5UX1dIRVJFLCBuZXcgU3RyaW5nW10geyBJbnRlZ2VyLnRvU3RyaW5nKHBhcmVudCkgfSwgbnVsbCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAibnVsbCBjdXJzb3IiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBjb3VudCA9IGMuZ2V0Q291bnQoKTsKKyAgICAgICAgICAgIGlmIChjb3VudCA+IDApIHsKKyAgICAgICAgICAgICAgICBpbnRbXSByZXN1bHQgPSBuZXcgaW50W2NvdW50XTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgYy5tb3ZlVG9OZXh0KCk7CisgICAgICAgICAgICAgICAgICAgIHJlc3VsdFtpXSA9IGMuZ2V0SW50KDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJyZXR1cm5pbmcgIiArIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIlJlbW90ZUV4Y2VwdGlvbiBpbiBnZXRPYmplY3RMaXN0IiwgZSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBpZiAoYyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYy5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHByaXZhdGUgaW50IGdldE51bU9iamVjdHMoaW50IHN0b3JhZ2VJRCwgaW50IGZvcm1hdCwgaW50IHBhcmVudCkgeworICAgICAgICAvLyB3ZSBjYW4gaWdub3JlIHN0b3JhZ2VJRCB1bnRpbCB3ZSBzdXBwb3J0IG11bHRpcGxlIHN0b3JhZ2VzCisgICAgICAgIExvZy5kKFRBRywgImdldE9iamVjdExpc3QgcGFyZW50OiAiICsgcGFyZW50KTsKKyAgICAgICAgQ3Vyc29yIGMgPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKGZvcm1hdCAhPSAwKSB7CisgICAgICAgICAgICAgICAgYyA9IG1NZWRpYVByb3ZpZGVyLnF1ZXJ5KG1PYmplY3RzVXJpLCBJRF9QUk9KRUNUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBBUkVOVF9GT1JNQVRfV0hFUkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tdIHsgSW50ZWdlci50b1N0cmluZyhwYXJlbnQpLCBJbnRlZ2VyLnRvU3RyaW5nKGZvcm1hdCkgfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGMgPSBtTWVkaWFQcm92aWRlci5xdWVyeShtT2JqZWN0c1VyaSwgSURfUFJPSkVDVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQVJFTlRfV0hFUkUsIG5ldyBTdHJpbmdbXSB7IEludGVnZXIudG9TdHJpbmcocGFyZW50KSB9LCBudWxsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gYy5nZXRDb3VudCgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVtb3RlRXhjZXB0aW9uIGluIGdldE51bU9iamVjdHMiLCBlKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBjLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIHByaXZhdGUgaW50W10gZ2V0U3VwcG9ydGVkUGxheWJhY2tGb3JtYXRzKCkgeworICAgICAgICByZXR1cm4gbmV3IGludFtdIHsKKyAgICAgICAgICAgIC8vIGFsbG93IHRyYW5zZmVyaW5nIGFyYml0cmFyeSBmaWxlcworICAgICAgICAgICAgTXRwQ29uc3RhbnRzLkZPUk1BVF9VTkRFRklORUQsCisKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5GT1JNQVRfQVNTT0NJQVRJT04sCisgICAgICAgICAgICBNdHBDb25zdGFudHMuRk9STUFUX1RFWFQsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuRk9STUFUX0hUTUwsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuRk9STUFUX1dBViwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5GT1JNQVRfTVAzLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLkZPUk1BVF9NUEVHLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLkZPUk1BVF9FWElGX0pQRUcsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuRk9STUFUX1RJRkZfRVAsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuRk9STUFUX0dJRiwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5GT1JNQVRfSkZJRiwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5GT1JNQVRfUE5HLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLkZPUk1BVF9USUZGLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLkZPUk1BVF9XTUEsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuRk9STUFUX09HRywKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5GT1JNQVRfQUFDLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLkZPUk1BVF9NUDRfQ09OVEFJTkVSLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLkZPUk1BVF9NUDIsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuRk9STUFUXzNHUF9DT05UQUlORVIsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuRk9STUFUX0FCU1RSQUNUX0FWX1BMQVlMSVNULAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLkZPUk1BVF9XUExfUExBWUxJU1QsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuRk9STUFUX00zVV9QTEFZTElTVCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5GT1JNQVRfUExTX1BMQVlMSVNULAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLkZPUk1BVF9YTUxfRE9DVU1FTlQsCisgICAgICAgIH07CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnRbXSBnZXRTdXBwb3J0ZWRDYXB0dXJlRm9ybWF0cygpIHsKKyAgICAgICAgLy8gbm8gY2FwdHVyZSBmb3JtYXRzIHlldAorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBzdGF0aWMgZmluYWwgaW50W10gRklMRV9QUk9QRVJUSUVTID0geworICAgICAgICAgICAgLy8gTk9URSBtdXN0IG1hdGNoIGJlZ2lubmluZyBvZiBBVURJT19QUk9QRVJUSUVTLCBWSURFT19QUk9QRVJUSUVTCisgICAgICAgICAgICAvLyBhbmQgSU1BR0VfUFJPUEVSVElFUyBiZWxvdworICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX1NUT1JBR0VfSUQsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfT0JKRUNUX0ZPUk1BVCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9QUk9URUNUSU9OX1NUQVRVUywKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9PQkpFQ1RfU0laRSwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9PQkpFQ1RfRklMRV9OQU1FLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX0RBVEVfTU9ESUZJRUQsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfUEFSRU5UX09CSkVDVCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9QRVJTSVNURU5UX1VJRCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9OQU1FLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX0RBVEVfQURERUQsCisgICAgfTsKKworICAgIHN0YXRpYyBmaW5hbCBpbnRbXSBBVURJT19QUk9QRVJUSUVTID0geworICAgICAgICAgICAgLy8gTk9URSBtdXN0IG1hdGNoIEZJTEVfUFJPUEVSVElFUyBhYm92ZQorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX1NUT1JBR0VfSUQsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfT0JKRUNUX0ZPUk1BVCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9QUk9URUNUSU9OX1NUQVRVUywKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9PQkpFQ1RfU0laRSwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9PQkpFQ1RfRklMRV9OQU1FLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX0RBVEVfTU9ESUZJRUQsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfUEFSRU5UX09CSkVDVCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9QRVJTSVNURU5UX1VJRCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9OQU1FLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX0RJU1BMQVlfTkFNRSwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9EQVRFX0FEREVELAorCisgICAgICAgICAgICAvLyBhdWRpbyBzcGVjaWZpYyBwcm9wZXJ0aWVzCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfQVJUSVNULAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX0FMQlVNX05BTUUsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfQUxCVU1fQVJUSVNULAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX1RSQUNLLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX09SSUdJTkFMX1JFTEVBU0VfREFURSwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9EVVJBVElPTiwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9HRU5SRSwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9DT01QT1NFUiwKKyAgICB9OworCisgICAgc3RhdGljIGZpbmFsIGludFtdIFZJREVPX1BST1BFUlRJRVMgPSB7CisgICAgICAgICAgICAvLyBOT1RFIG11c3QgbWF0Y2ggRklMRV9QUk9QRVJUSUVTIGFib3ZlCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfU1RPUkFHRV9JRCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9PQkpFQ1RfRk9STUFULAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX1BST1RFQ1RJT05fU1RBVFVTLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX09CSkVDVF9TSVpFLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX09CSkVDVF9GSUxFX05BTUUsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfREFURV9NT0RJRklFRCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9QQVJFTlRfT0JKRUNULAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX1BFUlNJU1RFTlRfVUlELAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX05BTUUsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfRElTUExBWV9OQU1FLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX0RBVEVfQURERUQsCisKKyAgICAgICAgICAgIC8vIHZpZGVvIHNwZWNpZmljIHByb3BlcnRpZXMKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9BUlRJU1QsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfQUxCVU1fTkFNRSwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9EVVJBVElPTiwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9ERVNDUklQVElPTiwKKyAgICB9OworCisgICAgc3RhdGljIGZpbmFsIGludFtdIElNQUdFX1BST1BFUlRJRVMgPSB7CisgICAgICAgICAgICAvLyBOT1RFIG11c3QgbWF0Y2ggRklMRV9QUk9QRVJUSUVTIGFib3ZlCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfU1RPUkFHRV9JRCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9PQkpFQ1RfRk9STUFULAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX1BST1RFQ1RJT05fU1RBVFVTLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX09CSkVDVF9TSVpFLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX09CSkVDVF9GSUxFX05BTUUsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfREFURV9NT0RJRklFRCwKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9QQVJFTlRfT0JKRUNULAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX1BFUlNJU1RFTlRfVUlELAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX05BTUUsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuUFJPUEVSVFlfRElTUExBWV9OQU1FLAorICAgICAgICAgICAgTXRwQ29uc3RhbnRzLlBST1BFUlRZX0RBVEVfQURERUQsCisKKyAgICAgICAgICAgIC8vIGltYWdlIHNwZWNpZmljIHByb3BlcnRpZXMKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5QUk9QRVJUWV9ERVNDUklQVElPTiwKKyAgICB9OworCisgICAgcHJpdmF0ZSBpbnRbXSBnZXRTdXBwb3J0ZWRPYmplY3RQcm9wZXJ0aWVzKGludCBmb3JtYXQpIHsKKyAgICAgICAgc3dpdGNoIChmb3JtYXQpIHsKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLkZPUk1BVF9NUDM6CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5GT1JNQVRfV0FWOgorICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuRk9STUFUX1dNQToKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLkZPUk1BVF9PR0c6CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5GT1JNQVRfQUFDOgorICAgICAgICAgICAgICAgIHJldHVybiBBVURJT19QUk9QRVJUSUVTOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuRk9STUFUX01QRUc6CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5GT1JNQVRfM0dQX0NPTlRBSU5FUjoKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLkZPUk1BVF9XTVY6CisgICAgICAgICAgICAgICAgcmV0dXJuIFZJREVPX1BST1BFUlRJRVM7CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5GT1JNQVRfRVhJRl9KUEVHOgorICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuRk9STUFUX0dJRjoKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLkZPUk1BVF9QTkc6CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5GT1JNQVRfQk1QOgorICAgICAgICAgICAgICAgIHJldHVybiBJTUFHRV9QUk9QRVJUSUVTOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICByZXR1cm4gRklMRV9QUk9QRVJUSUVTOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnRbXSBnZXRTdXBwb3J0ZWREZXZpY2VQcm9wZXJ0aWVzKCkgeworICAgICAgICByZXR1cm4gbmV3IGludFtdIHsKKyAgICAgICAgICAgIE10cENvbnN0YW50cy5ERVZJQ0VfUFJPUEVSVFlfU1lOQ0hST05JWkFUSU9OX1BBUlRORVIsCisgICAgICAgICAgICBNdHBDb25zdGFudHMuREVWSUNFX1BST1BFUlRZX0RFVklDRV9GUklFTkRMWV9OQU1FLAorICAgICAgICB9OworICAgIH0KKworICAgIHByaXZhdGUgU3RyaW5nIHF1ZXJ5U3RyaW5nKGludCBpZCwgU3RyaW5nIGNvbHVtbikgeworICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICAvLyBmb3Igbm93IHdlIGFyZSBvbmx5IHJlYWRpbmcgcHJvcGVydGllcyBmcm9tIHRoZSAib2JqZWN0cyIgdGFibGUKKyAgICAgICAgICAgIGMgPSBtTWVkaWFQcm92aWRlci5xdWVyeShtT2JqZWN0c1VyaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nIFtdIHsgRmlsZXMuRmlsZUNvbHVtbnMuX0lELCBjb2x1bW4gfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBJRF9XSEVSRSwgbmV3IFN0cmluZ1tdIHsgSW50ZWdlci50b1N0cmluZyhpZCkgfSwgbnVsbCk7CisgICAgICAgICAgICBpZiAoYyAhPSBudWxsICYmIGMubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGMuZ2V0U3RyaW5nKDEpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gIiI7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBjLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIFN0cmluZyBxdWVyeUdlbnJlKGludCBpZCkgeworICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBVcmkgdXJpID0gQXVkaW8uR2VucmVzLmdldENvbnRlbnRVcmlGb3JBdWRpb0lkKG1Wb2x1bWVOYW1lLCBpZCk7CisgICAgICAgICAgICBjID0gbU1lZGlhUHJvdmlkZXIucXVlcnkodXJpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmcgW10geyBGaWxlcy5GaWxlQ29sdW1ucy5fSUQsIEF1ZGlvLkdlbnJlc0NvbHVtbnMuTkFNRSB9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCAmJiBjLm1vdmVUb05leHQoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBjLmdldFN0cmluZygxKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuICIiOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAicXVlcnlHZW5yZSBleGNlcHRpb24iLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGMuY2xvc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBxdWVyeUludChpbnQgaWQsIFN0cmluZyBjb2x1bW4sIGxvbmdbXSBvdXRWYWx1ZSkgeworICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICAvLyBmb3Igbm93IHdlIGFyZSBvbmx5IHJlYWRpbmcgcHJvcGVydGllcyBmcm9tIHRoZSAib2JqZWN0cyIgdGFibGUKKyAgICAgICAgICAgIGMgPSBtTWVkaWFQcm92aWRlci5xdWVyeShtT2JqZWN0c1VyaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nIFtdIHsgRmlsZXMuRmlsZUNvbHVtbnMuX0lELCBjb2x1bW4gfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBJRF9XSEVSRSwgbmV3IFN0cmluZ1tdIHsgSW50ZWdlci50b1N0cmluZyhpZCkgfSwgbnVsbCk7CisgICAgICAgICAgICBpZiAoYyAhPSBudWxsICYmIGMubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgb3V0VmFsdWVbMF0gPSBjLmdldExvbmcoMSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBpZiAoYyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYy5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBTdHJpbmcgbmFtZUZyb21QYXRoKFN0cmluZyBwYXRoKSB7CisgICAgICAgIC8vIGV4dHJhY3QgbmFtZSBmcm9tIGZ1bGwgcGF0aAorICAgICAgICBpbnQgc3RhcnQgPSAwOworICAgICAgICBpbnQgbGFzdFNsYXNoID0gcGF0aC5sYXN0SW5kZXhPZignLycpOworICAgICAgICBpZiAobGFzdFNsYXNoID49IDApIHsKKyAgICAgICAgICAgIHN0YXJ0ID0gbGFzdFNsYXNoICsgMTsKKyAgICAgICAgfQorICAgICAgICBpbnQgZW5kID0gcGF0aC5sZW5ndGgoKTsKKyAgICAgICAgaWYgKGVuZCAtIHN0YXJ0ID4gMjU1KSB7CisgICAgICAgICAgICBlbmQgPSBzdGFydCArIDI1NTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcGF0aC5zdWJzdHJpbmcoc3RhcnQsIGVuZCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgcmVuYW1lRmlsZShpbnQgaGFuZGxlLCBTdHJpbmcgbmV3TmFtZSkgeworICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisKKyAgICAgICAgLy8gZmlyc3QgY29tcHV0ZSBjdXJyZW50IHBhdGgKKyAgICAgICAgU3RyaW5nIHBhdGggPSBudWxsOworICAgICAgICBTdHJpbmdbXSB3aGVyZUFyZ3MgPSBuZXcgU3RyaW5nW10geyAgSW50ZWdlci50b1N0cmluZyhoYW5kbGUpIH07CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBjID0gbU1lZGlhUHJvdmlkZXIucXVlcnkobU9iamVjdHNVcmksIFBBVEhfUFJPSkVDVElPTiwgSURfV0hFUkUsIHdoZXJlQXJncywgbnVsbCk7CisgICAgICAgICAgICBpZiAoYyAhPSBudWxsICYmIGMubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgcGF0aCA9IGV4dGVybmFsVG9NZWRpYVBhdGgoYy5nZXRTdHJpbmcoMSkpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVtb3RlRXhjZXB0aW9uIGluIGdldE9iamVjdEZpbGVQYXRoIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX0dFTkVSQUxfRVJST1I7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBpZiAoYyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYy5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChwYXRoID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfSEFORExFOworICAgICAgICB9CisKKyAgICAgICAgLy8gbm93IHJlbmFtZSB0aGUgZmlsZS4gIG1ha2Ugc3VyZSB0aGlzIHN1Y2NlZWRzIGJlZm9yZSB1cGRhdGluZyBkYXRhYmFzZQorICAgICAgICBGaWxlIG9sZEZpbGUgPSBuZXcgRmlsZShwYXRoKTsKKyAgICAgICAgaW50IGxhc3RTbGFzaCA9IHBhdGgubGFzdEluZGV4T2YoJy8nKTsKKyAgICAgICAgaWYgKGxhc3RTbGFzaCA8PSAxKSB7CisgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX0dFTkVSQUxfRVJST1I7CisgICAgICAgIH0KKyAgICAgICAgU3RyaW5nIG5ld1BhdGggPSBwYXRoLnN1YnN0cmluZygwLCBsYXN0U2xhc2ggKyAxKSArIG5ld05hbWU7CisgICAgICAgIEZpbGUgbmV3RmlsZSA9IG5ldyBGaWxlKG5ld1BhdGgpOworICAgICAgICBib29sZWFuIHN1Y2Nlc3MgPSBvbGRGaWxlLnJlbmFtZVRvKG5ld0ZpbGUpOworICAgICAgICBMb2cuZChUQUcsICJyZW5hbWluZyAiKyBwYXRoICsgIiB0byAiICsgbmV3UGF0aCArIChzdWNjZXNzID8gIiBzdWNjZWVkZWQiIDogIiBmYWlsZWQiKSk7CisgICAgICAgIGlmICghc3VjY2VzcykgeworICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9HRU5FUkFMX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgLy8gZmluYWxseSB1cGRhdGUgZGF0YWJhc2UKKyAgICAgICAgQ29udGVudFZhbHVlcyB2YWx1ZXMgPSBuZXcgQ29udGVudFZhbHVlcygpOworICAgICAgICB2YWx1ZXMucHV0KEZpbGVzLkZpbGVDb2x1bW5zLkRBVEEsIG5ld1BhdGgpOworICAgICAgICBpbnQgdXBkYXRlZCA9IDA7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICAvLyBub3RlIC0gd2UgYXJlIHJlbHlpbmcgb24gYSBzcGVjaWFsIGNhc2UgaW4gTWVkaWFQcm92aWRlci51cGRhdGUoKSB0byB1cGRhdGUKKyAgICAgICAgICAgIC8vIHRoZSBwYXRocyBmb3IgYWxsIGNoaWxkcmVuIGluIHRoZSBjYXNlIHdoZXJlIHRoaXMgaXMgYSBkaXJlY3RvcnkuCisgICAgICAgICAgICB1cGRhdGVkID0gbU1lZGlhUHJvdmlkZXIudXBkYXRlKG1PYmplY3RzVXJpLCB2YWx1ZXMsIElEX1dIRVJFLCB3aGVyZUFyZ3MpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVtb3RlRXhjZXB0aW9uIGluIG1NZWRpYVByb3ZpZGVyLnVwZGF0ZSIsIGUpOworICAgICAgICB9CisgICAgICAgIGlmICh1cGRhdGVkID09IDApIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIlVuYWJsZSB0byB1cGRhdGUgcGF0aCBmb3IgIiArIHBhdGggKyAiIHRvICIgKyBuZXdQYXRoKTsKKyAgICAgICAgICAgIC8vIHRoaXMgc2hvdWxkbid0IGhhcHBlbiwgYnV0IGlmIGl0IGRvZXMgd2UgbmVlZCB0byByZW5hbWUgdGhlIGZpbGUgdG8gaXRzIG9yaWdpbmFsIG5hbWUKKyAgICAgICAgICAgIG5ld0ZpbGUucmVuYW1lVG8ob2xkRmlsZSk7CisgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX0dFTkVSQUxfRVJST1I7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX09LOworICAgIH0KKworICAgIHByaXZhdGUgaW50IGdldE9iamVjdFByb3BlcnR5KGludCBoYW5kbGUsIGludCBwcm9wZXJ0eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nW10gb3V0SW50VmFsdWUsIGNoYXJbXSBvdXRTdHJpbmdWYWx1ZSkgeworICAgICAgICBMb2cuZChUQUcsICJnZXRPYmplY3RQcm9wZXJ0eTogIiArIHByb3BlcnR5KTsKKyAgICAgICAgU3RyaW5nIGNvbHVtbiA9IG51bGw7CisgICAgICAgIGJvb2xlYW4gaXNTdHJpbmcgPSBmYWxzZTsKKworICAgICAgICBzd2l0Y2ggKHByb3BlcnR5KSB7CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5QUk9QRVJUWV9TVE9SQUdFX0lEOgorICAgICAgICAgICAgICAgIG91dEludFZhbHVlWzBdID0gbVN0b3JhZ2VJRDsKKyAgICAgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX09LOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfT0JKRUNUX0ZPUk1BVDoKKyAgICAgICAgICAgICAgICBjb2x1bW4gPSBGaWxlcy5GaWxlQ29sdW1ucy5GT1JNQVQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5QUk9QRVJUWV9QUk9URUNUSU9OX1NUQVRVUzoKKyAgICAgICAgICAgICAgICAvLyBwcm90ZWN0aW9uIHN0YXR1cyBpcyBhbHdheXMgMAorICAgICAgICAgICAgICAgIG91dEludFZhbHVlWzBdID0gMDsKKyAgICAgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX09LOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfT0JKRUNUX1NJWkU6CisgICAgICAgICAgICAgICAgY29sdW1uID0gRmlsZXMuRmlsZUNvbHVtbnMuU0laRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLlBST1BFUlRZX09CSkVDVF9GSUxFX05BTUU6CisgICAgICAgICAgICAgICAgLy8gc3BlY2lhbCBjYXNlIC0gbmVlZCB0byBleHRyYWN0IGZpbGUgbmFtZSBmcm9tIGZ1bGwgcGF0aAorICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IHF1ZXJ5U3RyaW5nKGhhbmRsZSwgRmlsZXMuRmlsZUNvbHVtbnMuREFUQSk7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBuYW1lRnJvbVBhdGgodmFsdWUpOworICAgICAgICAgICAgICAgICAgICB2YWx1ZS5nZXRDaGFycygwLCB2YWx1ZS5sZW5ndGgoKSwgb3V0U3RyaW5nVmFsdWUsIDApOworICAgICAgICAgICAgICAgICAgICBvdXRTdHJpbmdWYWx1ZVt2YWx1ZS5sZW5ndGgoKV0gPSAwOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX09LOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfSEFORExFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLlBST1BFUlRZX05BTUU6CisgICAgICAgICAgICAgICAgLy8gZmlyc3QgdHJ5IHRpdGxlCisgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBxdWVyeVN0cmluZyhoYW5kbGUsIE1lZGlhQ29sdW1ucy5USVRMRSk7CisgICAgICAgICAgICAgICAgLy8gdGhlbiB0cnkgbmFtZQorICAgICAgICAgICAgICAgIGlmIChuYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbmFtZSA9IHF1ZXJ5U3RyaW5nKGhhbmRsZSwgQXVkaW8uUGxheWxpc3RzQ29sdW1ucy5OQU1FKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gaWYgdGl0bGUgYW5kIG5hbWUgZmFpbCwgZXh0cmFjdCBuYW1lIGZyb20gZnVsbCBwYXRoCisgICAgICAgICAgICAgICAgaWYgKG5hbWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBuYW1lID0gcXVlcnlTdHJpbmcoaGFuZGxlLCBGaWxlcy5GaWxlQ29sdW1ucy5EQVRBKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5hbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSA9IG5hbWVGcm9tUGF0aChuYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG5hbWUuZ2V0Q2hhcnMoMCwgbmFtZS5sZW5ndGgoKSwgb3V0U3RyaW5nVmFsdWUsIDApOworICAgICAgICAgICAgICAgICAgICBvdXRTdHJpbmdWYWx1ZVtuYW1lLmxlbmd0aCgpXSA9IDA7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfT0s7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9JTlZBTElEX09CSkVDVF9IQU5ETEU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfREFURV9NT0RJRklFRDoKKyAgICAgICAgICAgICAgICBjb2x1bW4gPSBGaWxlcy5GaWxlQ29sdW1ucy5EQVRFX01PRElGSUVEOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfREFURV9BRERFRDoKKyAgICAgICAgICAgICAgICBjb2x1bW4gPSBGaWxlcy5GaWxlQ29sdW1ucy5EQVRFX0FEREVEOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfT1JJR0lOQUxfUkVMRUFTRV9EQVRFOgorICAgICAgICAgICAgICAgIGNvbHVtbiA9IEF1ZGlvLkF1ZGlvQ29sdW1ucy5ZRUFSOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfUEFSRU5UX09CSkVDVDoKKyAgICAgICAgICAgICAgICBjb2x1bW4gPSBGaWxlcy5GaWxlQ29sdW1ucy5QQVJFTlQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5QUk9QRVJUWV9QRVJTSVNURU5UX1VJRDoKKyAgICAgICAgICAgICAgICAvLyBQVUlEIGlzIGNvbmNhdGVuYXRpb24gb2Ygc3RvcmFnZUlEIGFuZCBvYmplY3QgaGFuZGxlCisgICAgICAgICAgICAgICAgbG9uZyBwdWlkID0gbVN0b3JhZ2VJRDsKKyAgICAgICAgICAgICAgICBwdWlkIDw8PSAzMjsKKyAgICAgICAgICAgICAgICBwdWlkICs9IGhhbmRsZTsKKyAgICAgICAgICAgICAgICBvdXRJbnRWYWx1ZVswXSA9IHB1aWQ7CisgICAgICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9PSzsKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLlBST1BFUlRZX0RVUkFUSU9OOgorICAgICAgICAgICAgICAgIGNvbHVtbiA9IEF1ZGlvLkF1ZGlvQ29sdW1ucy5EVVJBVElPTjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLlBST1BFUlRZX1RSQUNLOgorICAgICAgICAgICAgICAgIGlmIChxdWVyeUludChoYW5kbGUsIEF1ZGlvLkF1ZGlvQ29sdW1ucy5UUkFDSywgb3V0SW50VmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHRyYWNrIGlzIHN0b3JlZCBpbiBsb3dlciAzIGRlY2ltYWwgZGlnaXRzCisgICAgICAgICAgICAgICAgICAgIG91dEludFZhbHVlWzBdICU9IDEwMDA7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfT0s7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9JTlZBTElEX09CSkVDVF9IQU5ETEU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfRElTUExBWV9OQU1FOgorICAgICAgICAgICAgICAgIGNvbHVtbiA9IE1lZGlhQ29sdW1ucy5ESVNQTEFZX05BTUU7CisgICAgICAgICAgICAgICAgaXNTdHJpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfQVJUSVNUOgorICAgICAgICAgICAgICAgIGNvbHVtbiA9IEF1ZGlvLkF1ZGlvQ29sdW1ucy5BUlRJU1Q7CisgICAgICAgICAgICAgICAgaXNTdHJpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfQUxCVU1fTkFNRToKKyAgICAgICAgICAgICAgICBjb2x1bW4gPSBBdWRpby5BdWRpb0NvbHVtbnMuQUxCVU07CisgICAgICAgICAgICAgICAgaXNTdHJpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfQUxCVU1fQVJUSVNUOgorICAgICAgICAgICAgICAgIGNvbHVtbiA9IEF1ZGlvLkF1ZGlvQ29sdW1ucy5BTEJVTV9BUlRJU1Q7CisgICAgICAgICAgICAgICAgaXNTdHJpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfR0VOUkU6CisgICAgICAgICAgICAgICAgU3RyaW5nIGdlbnJlID0gcXVlcnlHZW5yZShoYW5kbGUpOworICAgICAgICAgICAgICAgIGlmIChnZW5yZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGdlbnJlLmdldENoYXJzKDAsIGdlbnJlLmxlbmd0aCgpLCBvdXRTdHJpbmdWYWx1ZSwgMCk7CisgICAgICAgICAgICAgICAgICAgIG91dFN0cmluZ1ZhbHVlW2dlbnJlLmxlbmd0aCgpXSA9IDA7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfT0s7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9JTlZBTElEX09CSkVDVF9IQU5ETEU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfQ09NUE9TRVI6CisgICAgICAgICAgICAgICAgY29sdW1uID0gQXVkaW8uQXVkaW9Db2x1bW5zLkNPTVBPU0VSOworICAgICAgICAgICAgICAgIGlzU3RyaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLlBST1BFUlRZX0RFU0NSSVBUSU9OOgorICAgICAgICAgICAgICAgIGNvbHVtbiA9IEltYWdlcy5JbWFnZUNvbHVtbnMuREVTQ1JJUFRJT047CisgICAgICAgICAgICAgICAgaXNTdHJpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX09CSkVDVF9QUk9QX05PVF9TVVBQT1JURUQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAoaXNTdHJpbmcpIHsKKyAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IHF1ZXJ5U3RyaW5nKGhhbmRsZSwgY29sdW1uKTsKKyAgICAgICAgICAgIGlmICh2YWx1ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdmFsdWUuZ2V0Q2hhcnMoMCwgdmFsdWUubGVuZ3RoKCksIG91dFN0cmluZ1ZhbHVlLCAwKTsKKyAgICAgICAgICAgICAgICBvdXRTdHJpbmdWYWx1ZVt2YWx1ZS5sZW5ndGgoKV0gPSAwOworICAgICAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfT0s7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAocXVlcnlJbnQoaGFuZGxlLCBjb2x1bW4sIG91dEludFZhbHVlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfT0s7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8gcXVlcnkgZmFpbGVkIGlmIHdlIGdldCBoZXJlCisgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfSEFORExFOworICAgIH0KKworICAgIHByaXZhdGUgaW50IHNldE9iamVjdFByb3BlcnR5KGludCBoYW5kbGUsIGludCBwcm9wZXJ0eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nIGludFZhbHVlLCBTdHJpbmcgc3RyaW5nVmFsdWUpIHsKKyAgICAgICAgTG9nLmQoVEFHLCAic2V0T2JqZWN0UHJvcGVydHk6ICIgKyBwcm9wZXJ0eSk7CisKKyAgICAgICAgc3dpdGNoIChwcm9wZXJ0eSkgeworICAgICAgICAgICAgY2FzZSBNdHBDb25zdGFudHMuUFJPUEVSVFlfT0JKRUNUX0ZJTEVfTkFNRToKKyAgICAgICAgICAgICAgICByZXR1cm4gcmVuYW1lRmlsZShoYW5kbGUsIHN0cmluZ1ZhbHVlKTsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX09CSkVDVF9QUk9QX05PVF9TVVBQT1JURUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGludCBnZXREZXZpY2VQcm9wZXJ0eShpbnQgcHJvcGVydHksIGxvbmdbXSBvdXRJbnRWYWx1ZSwgY2hhcltdIG91dFN0cmluZ1ZhbHVlKSB7CisgICAgICAgIExvZy5kKFRBRywgImdldERldmljZVByb3BlcnR5OiAiICsgcHJvcGVydHkpOworCisgICAgICAgIHN3aXRjaCAocHJvcGVydHkpIHsKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLkRFVklDRV9QUk9QRVJUWV9TWU5DSFJPTklaQVRJT05fUEFSVE5FUjoKKyAgICAgICAgICAgIGNhc2UgTXRwQ29uc3RhbnRzLkRFVklDRV9QUk9QRVJUWV9ERVZJQ0VfRlJJRU5ETFlfTkFNRToKKyAgICAgICAgICAgICAgICAvLyB3cml0YWJsZSBzdHJpbmcgcHJvcGVydGllcyBrZXB0IGluIG91ciBkZXZpY2UgcHJvcGVydHkgZGF0YWJhc2UKKyAgICAgICAgICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgYyA9IG1EZXZpY2VQcm9wRGIucXVlcnkoInByb3BlcnRpZXMiLCBERVZJQ0VfUFJPUEVSVFlfUFJPSkVDVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIERFVklDRV9QUk9QRVJUWV9XSEVSRSwgbmV3IFN0cmluZ1tdIHsgIEludGVnZXIudG9TdHJpbmcocHJvcGVydHkpIH0sCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoYyAhPSBudWxsICYmIGMubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdmFsdWUgPSBjLmdldFN0cmluZygxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZW5ndGggPSB2YWx1ZS5sZW5ndGgoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPiAyNTUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSAyNTU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS5nZXRDaGFycygwLCBsZW5ndGgsIG91dFN0cmluZ1ZhbHVlLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG91dFN0cmluZ1ZhbHVlW2xlbmd0aF0gPSAwOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgb3V0U3RyaW5nVmFsdWVbMF0gPSAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfT0s7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYy5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9ERVZJQ0VfUFJPUF9OT1RfU1VQUE9SVEVEOworICAgIH0KKworICAgIHByaXZhdGUgaW50IHNldERldmljZVByb3BlcnR5KGludCBwcm9wZXJ0eSwgbG9uZyBpbnRWYWx1ZSwgU3RyaW5nIHN0cmluZ1ZhbHVlKSB7CisgICAgICAgIExvZy5kKFRBRywgInNldERldmljZVByb3BlcnR5OiAiICsgcHJvcGVydHkgKyAiIDogIiArIHN0cmluZ1ZhbHVlKTsKKworICAgICAgICBzd2l0Y2ggKHByb3BlcnR5KSB7CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5ERVZJQ0VfUFJPUEVSVFlfU1lOQ0hST05JWkFUSU9OX1BBUlRORVI6CisgICAgICAgICAgICBjYXNlIE10cENvbnN0YW50cy5ERVZJQ0VfUFJPUEVSVFlfREVWSUNFX0ZSSUVORExZX05BTUU6CisgICAgICAgICAgICAgICAgLy8gd3JpdGFibGUgc3RyaW5nIHByb3BlcnRpZXMga2VwdCBpbiBvdXIgZGV2aWNlIHByb3BlcnR5IGRhdGFiYXNlCisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyB2YWx1ZXMgPSBuZXcgQ29udGVudFZhbHVlcygpOworICAgICAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KCJjb2RlIiwgcHJvcGVydHkpOworICAgICAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KCJ2YWx1ZSIsIHN0cmluZ1ZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgbURldmljZVByb3BEYi5pbnNlcnQoInByb3BlcnRpZXMiLCAiY29kZSIsIHZhbHVlcyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfT0s7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9HRU5FUkFMX0VSUk9SOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfREVWSUNFX1BST1BfTk9UX1NVUFBPUlRFRDsKKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gZ2V0T2JqZWN0SW5mbyhpbnQgaGFuZGxlLCBpbnRbXSBvdXRTdG9yYWdlRm9ybWF0UGFyZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgY2hhcltdIG91dE5hbWUsIGxvbmdbXSBvdXRTaXplTW9kaWZpZWQpIHsKKyAgICAgICAgTG9nLmQoVEFHLCAiZ2V0T2JqZWN0SW5mbzogIiArIGhhbmRsZSk7CisgICAgICAgIEN1cnNvciBjID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGMgPSBtTWVkaWFQcm92aWRlci5xdWVyeShtT2JqZWN0c1VyaSwgT0JKRUNUX0lORk9fUFJPSkVDVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBJRF9XSEVSRSwgbmV3IFN0cmluZ1tdIHsgIEludGVnZXIudG9TdHJpbmcoaGFuZGxlKSB9LCBudWxsKTsKKyAgICAgICAgICAgIGlmIChjICE9IG51bGwgJiYgYy5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICBvdXRTdG9yYWdlRm9ybWF0UGFyZW50WzBdID0gbVN0b3JhZ2VJRDsKKyAgICAgICAgICAgICAgICBvdXRTdG9yYWdlRm9ybWF0UGFyZW50WzFdID0gYy5nZXRJbnQoMik7CisgICAgICAgICAgICAgICAgb3V0U3RvcmFnZUZvcm1hdFBhcmVudFsyXSA9IGMuZ2V0SW50KDMpOworCisgICAgICAgICAgICAgICAgLy8gZXh0cmFjdCBuYW1lIGZyb20gcGF0aAorICAgICAgICAgICAgICAgIFN0cmluZyBwYXRoID0gYy5nZXRTdHJpbmcoMSk7CisgICAgICAgICAgICAgICAgaW50IGxhc3RTbGFzaCA9IHBhdGgubGFzdEluZGV4T2YoJy8nKTsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnQgPSAobGFzdFNsYXNoID49IDAgPyBsYXN0U2xhc2ggKyAxIDogMCk7CisgICAgICAgICAgICAgICAgaW50IGVuZCA9IHBhdGgubGVuZ3RoKCk7CisgICAgICAgICAgICAgICAgaWYgKGVuZCAtIHN0YXJ0ID4gMjU1KSB7CisgICAgICAgICAgICAgICAgICAgIGVuZCA9IHN0YXJ0ICsgMjU1OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwYXRoLmdldENoYXJzKHN0YXJ0LCBlbmQsIG91dE5hbWUsIDApOworICAgICAgICAgICAgICAgIG91dE5hbWVbZW5kIC0gc3RhcnRdID0gMDsKKworICAgICAgICAgICAgICAgIG91dFNpemVNb2RpZmllZFswXSA9IGMuZ2V0TG9uZyg0KTsKKyAgICAgICAgICAgICAgICBvdXRTaXplTW9kaWZpZWRbMV0gPSBjLmdldExvbmcoNSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJSZW1vdGVFeGNlcHRpb24gaW4gZ2V0T2JqZWN0SW5mbyIsIGUpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGMuY2xvc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgZ2V0T2JqZWN0RmlsZVBhdGgoaW50IGhhbmRsZSwgY2hhcltdIG91dEZpbGVQYXRoLCBsb25nW10gb3V0RmlsZUxlbmd0aCkgeworICAgICAgICBMb2cuZChUQUcsICJnZXRPYmplY3RGaWxlUGF0aDogIiArIGhhbmRsZSk7CisgICAgICAgIGlmIChoYW5kbGUgPT0gMCkgeworICAgICAgICAgICAgLy8gc3BlY2lhbCBjYXNlIHJvb3QgZGlyZWN0b3J5CisgICAgICAgICAgICBtTWVkaWFTdG9yYWdlUGF0aC5nZXRDaGFycygwLCBtTWVkaWFTdG9yYWdlUGF0aC5sZW5ndGgoKSwgb3V0RmlsZVBhdGgsIDApOworICAgICAgICAgICAgb3V0RmlsZVBhdGhbbU1lZGlhU3RvcmFnZVBhdGgubGVuZ3RoKCldID0gMDsKKyAgICAgICAgICAgIG91dEZpbGVMZW5ndGhbMF0gPSAwOworICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9PSzsKKyAgICAgICAgfQorICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBjID0gbU1lZGlhUHJvdmlkZXIucXVlcnkobU9iamVjdHNVcmksIFBBVEhfU0laRV9QUk9KRUNUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIElEX1dIRVJFLCBuZXcgU3RyaW5nW10geyAgSW50ZWdlci50b1N0cmluZyhoYW5kbGUpIH0sIG51bGwpOworICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCAmJiBjLm1vdmVUb05leHQoKSkgeworICAgICAgICAgICAgICAgIFN0cmluZyBwYXRoID0gZXh0ZXJuYWxUb01lZGlhUGF0aChjLmdldFN0cmluZygxKSk7CisgICAgICAgICAgICAgICAgcGF0aC5nZXRDaGFycygwLCBwYXRoLmxlbmd0aCgpLCBvdXRGaWxlUGF0aCwgMCk7CisgICAgICAgICAgICAgICAgb3V0RmlsZVBhdGhbcGF0aC5sZW5ndGgoKV0gPSAwOworICAgICAgICAgICAgICAgIG91dEZpbGVMZW5ndGhbMF0gPSBjLmdldExvbmcoMik7CisgICAgICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9PSzsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9JTlZBTElEX09CSkVDVF9IQU5ETEU7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJSZW1vdGVFeGNlcHRpb24gaW4gZ2V0T2JqZWN0RmlsZVBhdGgiLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBNdHBDb25zdGFudHMuUkVTUE9OU0VfR0VORVJBTF9FUlJPUjsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBjLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGludCBkZWxldGVSZWN1cnNpdmUoaW50IGhhbmRsZSkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgIGludFtdIGNoaWxkcmVuID0gZ2V0T2JqZWN0TGlzdCgwIC8qIHN0b3JhZ2VJRCAqLywgMCAvKiBmb3JtYXQgKi8sIGhhbmRsZSk7CisgICAgICAgIFVyaSB1cmkgPSBGaWxlcy5nZXRNdHBPYmplY3RzVXJpKG1Wb2x1bWVOYW1lLCBoYW5kbGUpOworICAgICAgICAvLyBkZWxldGUgcGFyZW50IGZpcnN0LCB0byBhdm9pZCBwb3RlbnRpYWwgaW5maW5pdGUgcmVjdXJzaW9uCisgICAgICAgIGludCBjb3VudCA9IG1NZWRpYVByb3ZpZGVyLmRlbGV0ZSh1cmksIG51bGwsIG51bGwpOworICAgICAgICBpZiAoY291bnQgPT0gMSkgeworICAgICAgICAgICAgaWYgKGNoaWxkcmVuICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNoaWxkcmVuLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGNvdW50ICs9IGRlbGV0ZVJlY3Vyc2l2ZShjaGlsZHJlbltpXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBjb3VudDsKKyAgICB9CisKKyAgICBwcml2YXRlIGludCBkZWxldGVGaWxlKGludCBoYW5kbGUpIHsKKyAgICAgICAgTG9nLmQoVEFHLCAiZGVsZXRlRmlsZTogIiArIGhhbmRsZSk7CisgICAgICAgIG1EYXRhYmFzZU1vZGlmaWVkID0gdHJ1ZTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChkZWxldGVSZWN1cnNpdmUoaGFuZGxlKSA+IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX09LOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX0lOVkFMSURfT0JKRUNUX0hBTkRMRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIlJlbW90ZUV4Y2VwdGlvbiBpbiBkZWxldGVGaWxlIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gTXRwQ29uc3RhbnRzLlJFU1BPTlNFX0dFTkVSQUxfRVJST1I7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGludFtdIGdldE9iamVjdFJlZmVyZW5jZXMoaW50IGhhbmRsZSkgeworICAgICAgICBMb2cuZChUQUcsICJnZXRPYmplY3RSZWZlcmVuY2VzIGZvcjogIiArIGhhbmRsZSk7CisgICAgICAgIFVyaSB1cmkgPSBGaWxlcy5nZXRNdHBSZWZlcmVuY2VzVXJpKG1Wb2x1bWVOYW1lLCBoYW5kbGUpOworICAgICAgICBDdXJzb3IgYyA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBjID0gbU1lZGlhUHJvdmlkZXIucXVlcnkodXJpLCBJRF9QUk9KRUNUSU9OLCBudWxsLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgIGlmIChjID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBjb3VudCA9IGMuZ2V0Q291bnQoKTsKKyAgICAgICAgICAgIGlmIChjb3VudCA+IDApIHsKKyAgICAgICAgICAgICAgICBpbnRbXSByZXN1bHQgPSBuZXcgaW50W2NvdW50XTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgYy5tb3ZlVG9OZXh0KCk7CisgICAgICAgICAgICAgICAgICAgIHJlc3VsdFtpXSA9IGMuZ2V0SW50KDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVtb3RlRXhjZXB0aW9uIGluIGdldE9iamVjdExpc3QiLCBlKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBjLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgc2V0T2JqZWN0UmVmZXJlbmNlcyhpbnQgaGFuZGxlLCBpbnRbXSByZWZlcmVuY2VzKSB7CisgICAgICAgIG1EYXRhYmFzZU1vZGlmaWVkID0gdHJ1ZTsKKyAgICAgICAgVXJpIHVyaSA9IEZpbGVzLmdldE10cFJlZmVyZW5jZXNVcmkobVZvbHVtZU5hbWUsIGhhbmRsZSk7CisgICAgICAgIGludCBjb3VudCA9IHJlZmVyZW5jZXMubGVuZ3RoOworICAgICAgICBDb250ZW50VmFsdWVzW10gdmFsdWVzTGlzdCA9IG5ldyBDb250ZW50VmFsdWVzW2NvdW50XTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgICAgICB2YWx1ZXMucHV0KEZpbGVzLkZpbGVDb2x1bW5zLl9JRCwgcmVmZXJlbmNlc1tpXSk7CisgICAgICAgICAgICB2YWx1ZXNMaXN0W2ldID0gdmFsdWVzOworICAgICAgICB9CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAoY291bnQgPT0gbU1lZGlhUHJvdmlkZXIuYnVsa0luc2VydCh1cmksIHZhbHVlc0xpc3QpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE10cENvbnN0YW50cy5SRVNQT05TRV9PSzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIlJlbW90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QVFAgc3VwcG9ydCBhcyBVU0IgcmVzcG9uZGVyLgorICoge0BoaWRlfQorICovCitwdWJsaWMgY2xhc3MgTXRwU2VydmVyIHsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBUQUcgPSAiTXRwU2VydmVyIjsKKworICAgIHN0YXRpYyB7CisgICAgICAgIFN5c3RlbS5sb2FkTGlicmFyeSgibWVkaWFfam5pIik7CisgICAgfQorCisgICAgcHVibGljIE10cFNlcnZlcihNdHBEYXRhYmFzZSBkYXRhYmFzZSwgU3RyaW5nIHN0b3JhZ2VQYXRoKSB7CisgICAgICAgIG5hdGl2ZV9zZXR1cChkYXRhYmFzZSwgc3RvcmFnZVBhdGgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgdGhyb3dzIFRocm93YWJsZSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBuYXRpdmVfZmluYWxpemUoKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHN1cGVyLmZpbmFsaXplKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzdGFydCgpIHsKKyAgICAgICAgbmF0aXZlX3N0YXJ0KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc3RvcCgpIHsKKyAgICAgICAgbmF0aXZlX3N0b3AoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZW5kT2JqZWN0QWRkZWQoaW50IGhhbmRsZSkgeworICAgICAgICBuYXRpdmVfc2VuZF9vYmplY3RfYWRkZWQoaGFuZGxlKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZW5kT2JqZWN0UmVtb3ZlZChpbnQgaGFuZGxlKSB7CisgICAgICAgIG5hdGl2ZV9zZW5kX29iamVjdF9yZW1vdmVkKGhhbmRsZSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UHRwTW9kZ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vaWQgZW5hYmxlRHVja2luZyhpbnQgdGhyZXNob2xkLCBpbnQgZHVja2VkVHJhY2tWb2x1bWUpIHsNCisgICAgICAgIGlmICh0aHJlc2hvbGQgPCAwIHx8IHRocmVzaG9sZCA+IDEwMCkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkludmFsaWQgdGhyZXNob2xkIHZhbHVlOiAiICsgdGhyZXNob2xkKTsNCisgICAgICAgIH0NCisNCisgICAgICAgIGlmIChkdWNrZWRUcmFja1ZvbHVtZSA8IDAgfHwgZHVja2VkVHJhY2tWb2x1bWUgPiAxMDApIHsNCisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJJbnZhbGlkIGR1Y2tlZFRyYWNrVm9sdW1lIHZhbHVlOiAiDQorICAgICAgICAgICAgICAgICAgICArIGR1Y2tlZFRyYWNrVm9sdW1lKTsNCisgICAgICAgIH0NCisNCisgICAgICAgIG1EdWNraW5nVGhyZXNob2xkID0gdGhyZXNob2xkOw0KKyAgICAgICAgbUR1Y2tlZFRyYWNrVm9sdW1lID0gZHVja2VkVHJhY2tWb2x1bWU7DQorICAgICAgICBtSXNEdWNraW5nRW5hYmxlZCA9IHRydWU7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEByZXR1cm4gdHJ1ZSBpZiBkdWNraW5nIGlzIGVuYWJsZWQNCisgICAgICovDQorICAgIHB1YmxpYyBib29sZWFuIGlzRHVja2luZ0VuYWJsZWQoKSB7DQorICAgICAgICByZXR1cm4gbUlzRHVja2luZ0VuYWJsZWQ7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEByZXR1cm4gVGhlIGR1Y2tpbmcgdGhyZXNob2xkDQorICAgICAqLw0KKyAgICBwdWJsaWMgaW50IGdldER1Y2tpbmdUaHJlc2hob2xkKCkgew0KKyAgICAgICAgcmV0dXJuIG1EdWNraW5nVGhyZXNob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AgICAgKiBAcmV0dXJuIFRoZSB3YXZlZm9ybSBkYXRhDQorICAgICAqLw0KKyAgICBwdWJsaWMgV2F2ZWZvcm1EYXRhIGdldFdhdmVmb3JtRGF0YSgpIHsNCisgICAgICAgIGlmIChtV2F2ZWZvcm1EYXRhID09IG51bGwpIHsNCisgICAgICAgICAgICByZXR1cm4gbnVsbDsNCisgICAgICAgIH0NCisNCisgICAgICAgIFdhdmVmb3JtRGF0YSB3YXZlZm9ybURhdGEgPSBtV2F2ZWZvcm1EYXRhLmdldCgpOw0KKyAgICAgICAgaWYgKHdhdmVmb3JtRGF0YSAhPSBudWxsKSB7DQorICAgICAgICAgICAgcmV0dXJuIHdhdmVmb3JtRGF0YTsNCisgICAgICAgIH0gZWxzZSBpZiAobUF1ZGlvV2F2ZWZvcm1GaWxlbmFtZSAhPSBudWxsKSB7DQorICAgICAgICAgICAgd2F2ZWZvcm1EYXRhID0gbmV3IFdhdmVmb3JtRGF0YShtQXVkaW9XYXZlZm9ybUZpbGVuYW1lKTsNCisgICAgICAgICAgICBtV2F2ZWZvcm1EYXRhID0gbmV3IFNvZnRSZWZlcmVuY2U8V2F2ZWZvcm1EYXRhPih3YXZlZm9ybURhdGEpOw0KKyAgICAgICAgICAgIHJldHVybiB3YXZlZm9ybURhdGE7DQorICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgIHJldHVybiBudWxsOw0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorICAgIC8qDQorICAgICAqIHtAaW5oZXJpdERvY30NCisgICAgICovDQorICAgIEBPdmVycmlkZQ0KKyAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iamVjdCkgew0KKyAgICAgICAgaWYgKCEob2JqZWN0IGluc3RhbmNlb2YgQXVkaW9UcmFjaykpIHsNCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gbVVuaXF1ZUlkLmVxdWFscygoKEF1ZGlvVHJhY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AgICAgICAgIFRZUEVfR1JBRElFTlQsIFRZUEVfU0VQSUEsIFRZUEVfTkVHQVRJVkUsIFRZUEVfRklGVElFUy4NCisgICAgICogQHBhcmFtIGNvbG9yIElmIHR5cGUgaXMgVFlQRV9DT0xPUiwgY29sb3IgaXMgdGhlIFJHQiBjb2xvciBhcyA4ODguDQorICAgICAqICAgICAgICAgICAgICBJZiB0eXBlIGlzIFRZUEVfR1JBRElFTlQsIGNvbG9yIGlzIHRoZSBSR0IgY29sb3IgYXQgdGhlDQorICAgICAqICAgICAgICAgICAgICB0b3Agb2YgdGhlIGZyYW1lLiBPdGhlcndpc2UsIGNvbG9yIGlzIGlnbm9yZWQNCisgICAgICovDQorICAgIHB1YmxpYyBFZmZlY3RDb2xvcihNZWRpYUl0ZW0gbWVkaWFJdGVtLCBTdHJpbmcgZWZmZWN0SWQsIGxvbmcgc3RhcnRUaW1lTXMsIGxvbmcgZHVyYXRpb25NcywNCisgICAgICAgICAgICBpbnQgdHlwZSwgaW50IGNvbG9yKSB7DQorICAgICAgICBzdXBlcihtZWRpYUl0ZW0sIGVmZmVjdElkLCBzdGFydFRpbWVNcywgZHVyYXRpb25Ncyk7DQorICAgICAgICBzd2l0Y2ggKHR5cGUpIHsNCisgICAgICAgICAgICBjYXNlIFRZUEVfQ09MT1I6DQorICAgICAgICAgICAgY2FzZSBUWVBFX0dSQURJRU5UOiB7DQorICAgICAgICAgICAgICAgIG1Db2xvciA9IGNvbG9yOw0KKyAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICB9DQorDQorICAgICAgICAgICAgY2FzZSBUWVBFX1NFUElBOg0KKyAgICAgICAgICAgIGNhc2UgVFlQRV9ORUdBVElWRToNCisgICAgICAgICAgICBjYXNlIFRZUEVfRklGVElFUzogew0KKyAgICAgICAgICAgICAgICBtQ29sb3IgPSAtMTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgfQ0KKw0KKyAgICAgICAgICAgIGRlZmF1bHQ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gICAgICAgbVNjYWxlZEhlaWdodCA9IG1IZWlnaHQ7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoNCisgICAgICoge0Bpbmhlcml0RG9jfQ0KKyAgICAgKi8NCisgICAgQE92ZXJyaWRlDQorICAgIHB1YmxpYyBpbnQgZ2V0RmlsZVR5cGUoKSB7DQorICAgICAgICBpZiAobUZpbGVuYW1lLmVuZHNXaXRoKCIuanBnIikgfHwgbUZpbGVuYW1lLmVuZHNXaXRoKCIuanBlZyIpKSB7DQorICAgICAgICAgICAgcmV0dXJuIE1lZGlhUHJvcGVydGllcy5GSUxFX0pQRUc7DQorICAgICAgICB9IGVsc2UgaWYgKG1GaWxlbmFtZS5lbmRzV2l0aCgiLnBuZyIpKSB7DQorICAgICAgICAgICAgcmV0dXJuIE1lZGlhUHJvcGVydGllcy5GSUxFX1BORzsNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgcmV0dXJuIE1lZGlhUHJvcGVydGllcy5GSUxFX1VOU1VQUE9SVEVEOw0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorICAgIC8qDQorICAgICAqIHtAaW5oZXJpdERvY30NCisgICAgICovDQorICAgIEBPdmVycmlkZQ0KKyAgICBwdWJsaWMgaW50IGdldFdpZHRoKCkgew0KKyAgICAgICAgcmV0dXJuIG1XaWR0aDsNCisgICAgfQ0KKw0KKyAgICAvKg0KKyAgICAgKiB7QGluaGVyaXREb2N9DQorICAgICAqLw0KKyAgICBAT3ZlcnJpZGUNCisgICAgcHVibGljIGludCBnZXRIZWlnaHQoKSB7DQorICAgICAgICByZXR1cm4gbUhlaWdodDsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQHJldHVybiBUaGUgc2NhbGVkIHdpZHRoIG9mIHRoZSBpbWFnZS4NCisgICAgICovDQorICAgIHB1YmxpYyBpbnQgZ2V0U2NhbGVkV2lkdGgoKSB7DQorICAgICAgICByZXR1cm4gbVNjYWxlZFdpZHRoOw0KKyAgICB9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NCisgICAgQE92ZXJyaWRlDQorICAgIHB1YmxpYyBsb25nIGdldER1cmF0aW9uKCkgew0KKyAgICAgICAgcmV0dXJuIG1EdXJhdGlvbk1zOw0KKyAgICB9DQorDQorICAgIC8qDQorICAgICAqIHtAaW5oZXJpdERvY30NCisgICAgICovDQorICAgIEBPdmVycmlkZQ0KKyAgICBwdWJsaWMgbG9uZyBnZXRUaW1lbGluZUR1cmF0aW9uKCkgew0KKyAgICAgICAgcmV0dXJuIG1EdXJhdGlvbk1zOw0KKyAgICB9DQorDQorICAgIC8qDQorICAgICAqIHtAaW5oZXJpdERvY30NCisgICAgICovDQorICAgIEBPdmVycmlkZQ0KKyAgICBwdWJsaWMgQml0bWFwIGdldFRodW1ibmFpbChpbnQgd2lkdGgsIGludCBoZWlnaHQsIGxvbmcgdGltZU1zKSB0aHJvd3MgSU9FeGNlcHRpb24gew0KKyAgICAgICAgcmV0dXJuIHNjYWxlSW1hZ2UobUZpbGVuYW1lLCB3aWR0aCwgaGVpZ2h0KTsNCisgICAgfQ0KKw0KKyAgICAvKg0KKyAgICAgKiB7QGluaGVyaXREb2N9DQorICAgICAqLw0KKyAgICBAT3ZlcnJpZGUNCisgICAgcHVibGljIEJpdG1hcFtdIGdldFRodW1ibmFpbExpc3QoaW50IHdpZHRoLCBpbnQgaGVpZ2h0LCBsb25nIHN0YXJ0TXMsIGxvbmcgZW5kTXMsDQorICAgICAgICAgICAgaW50IHRodW1ibmFpbENvdW50KSB0aHJvd3MgSU9FeGNlcHRpb24gew0KKyAgICAgICAgZmluYWwgQml0bWFwIHRodW1ibmFpbCA9IHNjYWxlSW1hZ2UobUZpbGVuYW1lLCB3aWR0aCwgaGVpZ2h0KTsNCisgICAgICAgIGZpbmFsIEJpdG1hcFtdIHRodW1ibmFpbEFycmF5ID0gbmV3IEJpdG1hcFt0aHVtYm5haWxDb3VudF07DQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHRodW1ibmFpbENvdW50OyBpKyspIHsNCisgIC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RoICsgIngiICsgbmF0aXZlSGVpZ2h0DQorICAgICAgICAgICAgICAgICAgICArICIsIHJlc2l6ZSB0bzogIiArIHdpZHRoICsgIngiICsgaGVpZ2h0KTsNCisgICAgICAgIH0NCisNCisgICAgICAgIGZpbmFsIEJpdG1hcCBzcmNCaXRtYXA7DQorICAgICAgICBmbG9hdCBiaXRtYXBXaWR0aCwgYml0bWFwSGVpZ2h0Ow0KKyAgICAgICAgaWYgKG5hdGl2ZVdpZHRoID4gd2lkdGggfHwgbmF0aXZlSGVpZ2h0ID4gaGVpZ2h0KSB7DQorICAgICAgICAgICAgZmxvYXQgZHggPSAoKGZsb2F0KW5hdGl2ZVdpZHRoKSAvICgoZmxvYXQpd2lkdGgpOw0KKyAgICAgICAgICAgIGZsb2F0IGR5ID0gKChmbG9hdCluYXRpdmVIZWlnaHQpIC8gKChmbG9hdCloZWlnaHQpOw0KKyAgICAgICAgICAgIGlmIChkeCA+IGR5KSB7DQorICAgICAgICAgICAgICAgIGJpdG1hcFdpZHRoID0gd2lkdGg7DQorICAgICAgICAgICAgICAgIGJpdG1hcEhlaWdodCA9IG5hdGl2ZUhlaWdodCAvIGR4Ow0KKyAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgIGJpdG1hcFdpZHRoID0gbmF0aXZlV2lkdGggLyBkeTsNCisgICAgICAgICAgICAgICAgYml0bWFwSGVpZ2h0ID0gaGVpZ2h0Ow0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICAvLyBDcmVhdGUgdGhlIGJpdG1hcCBmcm9tIGZpbGUNCisgICAgICAgICAgICBpZiAobmF0aXZlV2lkdGggLyBiaXRtYXBXaWR0aCA+IDEpIHsNCisgICAgICAgICAgICAgICAgZmluYWwgQml0bWFwRmFjdG9yeS5PcHRpb25zIG9wdGlvbnMgPSBuZXcgQml0bWFwRmFjdG9yeS5PcHRpb25zKCk7DQorICAgICAgICAgICAgICAgIG9wdGlvbnMuaW5TYW1wbGVTaXplID0gbmF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AgIH0NCisNCisgICAgLyoqDQorICAgICAqIEByZXR1cm4gVGhlIGlkIG9mIHRoZSBtZWRpYSBpdGVtDQorICAgICAqLw0KKyAgICBwdWJsaWMgU3RyaW5nIGdldElkKCkgew0KKyAgICAgICAgcmV0dXJuIG1VbmlxdWVJZDsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQHJldHVybiBUaGUgbWVkaWEgc291cmNlIGZpbGUgbmFtZQ0KKyAgICAgKi8NCisgICAgcHVibGljIFN0cmluZyBnZXRGaWxlbmFtZSgpIHsNCisgICAgICAgIHJldHVybiBtRmlsZW5hbWU7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIElmIGFzcGVjdCByYXRpbyBvZiB0aGUgTWVkaWFJdGVtIGlzIGRpZmZlcmVudCBmcm9tIHRoZSBhc3BlY3QgcmF0aW8gb2YNCisgICAgICogdGhlIGVkaXRvciB0aGVuIHRoaXMgQVBJIGNvbnRyb2xzIHRoZSByZW5kZXJpbmcgbW9kZS4NCisgICAgICoNCisgICAgICogQHBhcmFtIHJlbmRlcmluZ01vZGUgcmVuZGVyaW5nIG1vZGUuIEl0IGlzIG9uZSBvZjoNCisgICAgICogICAgICAgICAgICB7QGxpbmsgI1JFTkRFUklOR19NT0RFX0JMQUNLX0JPUkRFUn0sDQorICAgICAqICAgICAgICAgICAge0BsaW5rICNSRU5ERVJJTkdfTU9ERV9TVFJFVENIfQ0KKyAgICAgKi8NCisgICAgcHVibGljIHZvaWQgc2V0UmVuZGVyaW5nTW9kZShpbnQgcmVuZGVyaW5nTW9kZSkgew0KKyAgICAgICAgbVJlbmRlcmluZ01vZGUgPSByZW5kZXJpbmdNb2RlOw0KKyAgICAgICAgaWYgKG1CZWdpblRyYW5zaXRpb24gIT0gbnVsbCkgew0KKyAgICAgICAgICAgIG1CZWdpblRyYW5zaXRpb24uaW52YWxpZGF0ZSgpOw0KKyAgICAgICAgfQ0KKw0KKyAgICAgICAgaWYgKG1FbmRUcmFuc2l0aW9uICE9IG51bGwpIHsNCisgICAgICAgICAgICBtRW5kVHJhbnNpdGlvbi5pbnZhbGlkYXRlKCk7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEByZXR1cm4gVGhlIHJlbmRlcmluZyBtb2RlDQorICAgICAqLw0KKyAgICBwdWJsaWMgaW50IGdldFJlbmRlcmluZ01vZGUoKSB7DQorICAgICAgICByZXR1cm4gbVJlbmRlcmluZ01vZGU7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEBwYXJhbSB0cmFuc2l0aW9uIFRoZSBiZWdpbm5pbmcgdHJhbnNpdGlvbg0KKyAgICAgKi8NCisgICAgdm9pZCBzZXRCZWdpblRyYW5zaXRpb24oVHJhbnNpdGlvbiB0cmFuc2l0aW9uKSB7DQorICAgICAgICBtQmVnaW5UcmFuc2l0aW9uID0gdHJhbnNpdGlvbjsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQHJldHVybiBUaGUgYmVnaW4gdHJhbnNpdGlvbg0KKyAgICAgKi8NCisgICAgcHVibGljIFRyYW5zaXRpb24gZ2V0QmVnaW5UcmFuc2l0aW9uKCkgew0KKyAgICAgICAgcmV0dXJuIG1CZWdpblRyYW5zaXRpb247DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEBwYXJhbSB0cmFuc2l0aW9uIFRoZSBlbmQgdHJhbnNpdGlvbg0KKyAgICAgKi8NCisgICAgdm9pZCBzZXRFbmRUcmFuc2l0aW9uKFRyYW5zaXRpb24gdHJhbnNpdGlvbikgew0KKyAgICAgICAgbUVuZFRyYW5zaXRpb24gPSB0cmFuc2l0aW9uOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBAcmV0dXJuIFRoZSBlbmQgdHJhbnNpdGlvbg0KKyAgICAgKi8NCisgICAgcHVibGljIFRyYW5zaXRpb24gZ2V0RW5kVHJhbnNpdGlvbigpIHsNCisgICAgICAgIHJldHVybiBtRW5kVHJhbnNpdGlv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IG92ZXJsYXlJZCkgew0KKyAgICAgICAgZm9yIChPdmVybGF5IG92ZXJsYXkgOiBtT3ZlcmxheXMpIHsNCisgICAgICAgICAgICBpZiAob3ZlcmxheS5nZXRJZCgpLmVxdWFscyhvdmVybGF5SWQpKSB7DQorICAgICAgICAgICAgICAgIG1PdmVybGF5cy5yZW1vdmUob3ZlcmxheSk7DQorICAgICAgICAgICAgICAgIGlmIChvdmVybGF5IGluc3RhbmNlb2YgT3ZlcmxheUZyYW1lKSB7DQorICAgICAgICAgICAgICAgICAgICAoKE92ZXJsYXlGcmFtZSlvdmVybGF5KS5pbnZhbGlkYXRlKCk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgaW52YWxpZGF0ZVRyYW5zaXRpb25zKG92ZXJsYXkpOw0KKyAgICAgICAgICAgICAgICByZXR1cm4gb3ZlcmxheTsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorDQorICAgICAgICByZXR1cm4gbnVsbDsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogRmluZCB0aGUgb3ZlcmxheSB3aXRoIHRoZSBzcGVjaWZpZWQgaWQNCisgICAgICoNCisgICAgICogQHBhcmFtIG92ZXJsYXlJZCBUaGUgb3ZlcmxheSBpZA0KKyAgICAgKg0KKyAgICAgKiBAcmV0dXJuIFRoZSBvdmVybGF5IHdpdGggdGhlIHNwZWNpZmllZCBpZCAobnVsbCBpZiBpdCBkb2VzIG5vdCBleGlzdCkNCisgICAgICovDQorICAgIHB1YmxpYyBPdmVybGF5IGdldE92ZXJsYXkoU3RyaW5nIG92ZXJsYXlJZCkgew0KKyAgICAgICAgZm9yIChPdmVybGF5IG92ZXJsYXkgOiBtT3ZlcmxheXMpIHsNCisgICAgICAgICAgICBpZiAob3ZlcmxheS5nZXRJZCgpLmVxdWFscyhvdmVybGF5SWQpKSB7DQorICAgICAgICAgICAgICAgIHJldHVybiBvdmVybGF5Ow0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH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0KGludCB3aWR0aCwgaW50IGhlaWdodCwgbG9uZyBzdGFydE1zLCBsb25nIGVuZE1zLA0KKyAgICAgICAgICAgIGludCB0aHVtYm5haWxDb3VudCkgdGhyb3dzIElPRXhjZXB0aW9uOw0KKw0KKyAgICAvKg0KKyAgICAgKiB7QGluaGVyaXREb2N9DQorICAgICAqLw0KKyAgICBAT3ZlcnJpZGUNCisgICAgcHVibGljIGJvb2xlYW4gZXF1YWxzKE9iamVjdCBvYmplY3QpIHsNCisgICAgICAgIGlmICghKG9iamVjdCBpbnN0YW5jZW9mIE1lZGlhSXRlbSkpIHsNCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gbVVuaXF1ZUlkLmVxdWFscygoKE1lZGlhSXRlbSlvYmplY3QpLm1VbmlxdWVJZCk7DQorICAgIH0NCisNCisgICAgLyoNCisgICAgICoge0Bpbmhlcml0RG9jfQ0KKyAgICAgKi8NCisgICAgQE92ZXJyaWRlDQorICAgIHB1YmxpYyBpbnQgaGFzaENvZGUoKSB7DQorICAgICAgICByZXR1cm4gbVVuaXF1ZUlkLmhhc2hDb2RlKCk7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEludmFsaWRhdGUgdGhlIHN0YXJ0IGFuZCBlbmQgdHJhbnNpdGlvbnMgaWYgbmVjZXNzYXJ5DQorICAgICAqDQorICAgICAqIEBwYXJhbSBlZmZlY3QgVGhlIGVmZmVjdCB0aGF0IHdhcyBhZGRlZCBvciByZW1vdmVkDQorICAgICAqLw0KKyAgICB2b2lkIGludmFsaWRhdGVUcmFuc2l0aW9ucyhFZmZlY3QgZWZmZWN0KSB7DQorICAgICAgICAvLyBDaGVjayBpZiB0aGUgZWZmZWN0IG92ZXJsYXBzIHdpdGggdGhlIGJlZ2lubmluZyBhbmQgZW5kIHRyYW5zaXRpb25zDQorICAgICAgICBpZiAobUJlZ2luVHJhbnNpdGlvbiAhPSBudWxsKSB7DQorICAgICAgICA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aW5UcmFuc2l0aW9uLmludmFsaWRhdGUoKTsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorDQorICAgICAgICBpZiAobUVuZFRyYW5zaXRpb24gIT0gbnVsbCkgew0KKyAgICAgICAgICAgIGlmIChvdmVybGF5LmdldFN0YXJ0VGltZSgpICsgb3ZlcmxheS5nZXREdXJhdGlvbigpID4gZ2V0RHVyYXRpb24oKQ0KKyAgICAgICAgICAgICAgICAgICAgLSBtRW5kVHJhbnNpdGlvbi5nZXREdXJhdGlvbigpKSB7DQorICAgICAgICAgICAgICAgIG1FbmRUcmFuc2l0aW9uLmludmFsaWRhdGUoKTsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEFkanVzdCB0aGUgZHVyYXRpb24gdHJhbnNpdGlvbnMuDQorICAgICAqLw0KKyAgICBwcm90ZWN0ZWQgdm9pZCBhZGp1c3RUcmFuc2l0aW9ucygpIHsNCisgICAgICAgIC8vIENoZWNrIGlmIHRoZSBkdXJhdGlvbiBvZiB0cmFuc2l0aW9ucyBuZWVkIHRvIGJlIGFkanVzdGVkDQorICAgICAgICBpZiAobUJlZ2luVHJhbnNpdGlvbiAhPSBudWxsKSB7DQorICAgICAgICAgICAgZmluYWwgbG9uZyBtYXhEdXJhdGlvbk1zID0gbUJlZ2luVHJhbnNpdGlvbi5nZXRNYXhpbXVtRHVyYXRpb24oKTsNCisgICAgICAgICAgICBpZiAobUJlZ2luVHJhbnNpdGlvbi5nZXREdXJhdGlvbigpID4gbWF4RHVyYXRpb25Ncykgew0KKyAgICAgICAgICAgICAgICBtQmVnaW5UcmFuc2l0aW9uLnNldER1cmF0aW9uKG1heER1cmF0aW9uTXMpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisNCisgICAgICAgIGlmIChtRW5kVHJhbnNpdGlvbiAhPSBudWxsKSB7DQorICAgICAgICAgICAgZmluYWwgbG9uZyBtYXhEdXJhdGlvbk1zID0gbUVuZFRyYW5zaXRpb24uZ2V0TWF4aW11bUR1cmF0aW9uKCk7DQorICAgICAgICAgICAgaWYgKG1FbmRUcmFuc2l0aW9uLmdldER1cmF0aW9uKCkgPiBtYXhEdXJhdGlvbk1zKSB7DQorICAgICAgICAgICAgICAgIG1FbmRUcmFuc2l0aW9uLnNldER1cmF0aW9uKG1heER1cmF0aW9uTXMpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQWRqdXN0IHRoZSBzdGFydCB0aW1lIGFuZC9vciBkdXJhdGlvbiBvZiBlZmZlY3RzLg0KKyAgICAgKi8NCisgICAgcHJvdGVjdGVkIHZvaWQgYWRqdXN0RWZmZWN0cygpIHsNCisgICAgICAgIGZpbmFsIExpc3Q8RWZmZWN0PiBlZmZlY3RzID0gZ2V0QWxsRWZmZWN0cygpOw0KKyAgICAgICAgZm9yIChFZmZlY3QgZWZmZWN0IDogZWZmZWN0cykgew0KKyAgICAgICAgICAgIC8vIEFkanVzdCB0aGUgc3RhcnQgdGltZSBpZiBuZWNlc3NhcnkNCisgICAgICAgICAgICBmaW5hbCBsb25nIGVmZmVjdFN0YXJ0VGltZU1zOw0KKyAgICAgICAgICAgIGlmIChlZmZlY3QuZ2V0U3RhcnRUaW1lKCkgPiBnZXREdXJhdGlvbigpKSB7DQorICAgICAgICAgICAgICAgIGVmZmVjdFN0YXJ0VGltZU1zID0gMDsNCisgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICBlZmZlY3RTdGFydFRpbWVNcyA9IGVmZmVjdC5nZXRTdGFydFRpbWUoKTsNCisgICAgICAgICAgICB9DQorDQorICAgICAgICAgICAgLy8gQWRqdXN0IHRoZSBkdXJhdGlvbiBpZiBuZWNlc3NhcnkNCisgICAgICAgICAgICBmaW5hbCBsb25nIGVmZmVjdER1cmF0aW9uTXM7DQorICAgICAgICAgICAgaWYgKGVmZmVjdFN0YXJ0VGltZU1zICs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GlvbigpKSB7DQorICAgICAgICAgICAgICAgIG92ZXJsYXlTdGFydFRpbWVNcyA9IDA7DQorICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgb3ZlcmxheVN0YXJ0VGltZU1zID0gb3ZlcmxheS5nZXRTdGFydFRpbWUoKTsNCisgICAgICAgICAgICB9DQorDQorICAgICAgICAgICAgLy8gQWRqdXN0IHRoZSBkdXJhdGlvbiBpZiBuZWNlc3NhcnkNCisgICAgICAgICAgICBmaW5hbCBsb25nIG92ZXJsYXlEdXJhdGlvbk1zOw0KKyAgICAgICAgICAgIGlmIChvdmVybGF5U3RhcnRUaW1lTXMgKyBvdmVybGF5LmdldER1cmF0aW9uKCkgPiBnZXREdXJhdGlvbigpKSB7DQorICAgICAgICAgICAgICAgIG92ZXJsYXlEdXJhdGlvbk1zID0gZ2V0RHVyYXRpb24oKSAtIG92ZXJsYXlTdGFydFRpbWVNczsNCisgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICBvdmVybGF5RHVyYXRpb25NcyA9IG92ZXJsYXkuZ2V0RHVyYXRpb24oKTsNCisgICAgICAgICAgICB9DQorDQorICAgICAgICAgICAgaWYgKG92ZXJsYXlTdGFydFRpbWVNcyAhPSBvdmVybGF5LmdldFN0YXJ0VGltZSgpIHx8DQorICAgICAgICAgICAgICAgICAgICBvdmVybGF5RHVyYXRpb25NcyAhPSBvdmVybGF5LmdldER1cmF0aW9uKCkpIHsNCisgICAgICAgICAgICAgICAgb3ZlcmxheS5zZXRTdGFydFRpbWVBbmREdXJhdGlvbihvdmVybGF5U3RhcnRUaW1lTXMsIG92ZXJsYXlEdXJhdGlvbk1zKTsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCit9DQpkaWZmIC0tZ2l0IGEvbWVkaWEvamF2YS9hbmRyb2lkL21lZGlhL3ZpZGVvZWRpdG9yL01lZGlhUHJvcGVydGllcy5qYXZhIGIvbWVkaWEvamF2YS9hbmR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1dGlvbnMgPSBBU1BFQ1RfUkFUSU9fM18yX1JFU09MVVRJT05TOw0KKyAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICB9DQorDQorICAgICAgICAgICAgY2FzZSBBU1BFQ1RfUkFUSU9fNF8zOiB7DQorICAgICAgICAgICAgICAgIHJlc29sdXRpb25zID0gQVNQRUNUX1JBVElPXzRfM19SRVNPTFVUSU9OUzsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgfQ0KKw0KKyAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzVfMzogew0KKyAgICAgICAgICAgICAgICByZXNvbHV0aW9ucyA9IEFTUEVDVF9SQVRJT181XzNfUkVTT0xVVElPTlM7DQorICAgICAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgIH0NCisNCisgICAgICAgICAgICBjYXNlIEFTUEVDVF9SQVRJT18xMV85OiB7DQorICAgICAgICAgICAgICAgIHJlc29sdXRpb25zID0gQVNQRUNUX1JBVElPXzExXzlfUkVTT0xVVElPTlM7DQorICAgICAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgIH0NCisNCisgICAgICAgICAgICBjYXNlIEFTUEVDVF9SQVRJT18xNl85OiB7DQorICAgICAgICAgICAgICAgIHJlc29sdXRpb25zID0gQVNQRUNUX1JBVElPXzE2XzlfUkVTT0xVVElPTlM7DQorICAgICAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgIH0NCisNCisgICAgICAgICAgICBkZWZhdWx0OiB7DQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVua25vd24gYXNwZWN0IHJhdGlvOiAiICsgYXNwZWN0UmF0aW8pOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisNCisgICAgICAgIHJldHVybiByZXNvbHV0aW9uczsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQHJldHVybiBUaGUgYX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AgICAgICAgICAgbUJlZ2luVHJhbnNpdGlvbi5pbnZhbGlkYXRlKCk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKw0KKyAgICAgICAgaWYgKGVuZE1zICE9IG1FbmRCb3VuZGFyeVRpbWVNcykgew0KKyAgICAgICAgICAgIGlmIChtRW5kVHJhbnNpdGlvbiAhPSBudWxsKSB7DQorICAgICAgICAgICAgICAgIG1FbmRUcmFuc2l0aW9uLmludmFsaWRhdGUoKTsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorDQorICAgICAgICBtQmVnaW5Cb3VuZGFyeVRpbWVNcyA9IGJlZ2luTXM7DQorICAgICAgICBtRW5kQm91bmRhcnlUaW1lTXMgPSBlbmRNczsNCisNCisgICAgICAgIGFkanVzdFRyYW5zaXRpb25zKCk7DQorDQorICAgICAgICAvLyBOb3RlIHRoYXQgdGhlIHN0YXJ0IGFuZCBkdXJhdGlvbiBvZiBhbnkgZWZmZWN0cyBhbmQgb3ZlcmxheXMgYXJlDQorICAgICAgICAvLyBub3QgYWRqdXN0ZWQgbm9yIGFyZSB0aGV5IGF1dG9tYXRpY2FsbHkgcmVtb3ZlZCBpZiB0aGV5IGZhbGwNCisgICAgICAgIC8vIG91dHNpZGUgdGhlIG5ldyBib3VuZGFyaWVzLg0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBAcmV0dXJuIFRoZSBib3VuZGFyeSBiZWdpbiB0aW1lDQorICAgICAqLw0KKyAgICBwdWJsaWMgbG9uZyBnZXRCb3VuZGFyeUJlZ2luVGltZSgpIHsNCisgICAgICAgIHJldHVybiBtQmVnaW5Cb3VuZGFyeVRpbWVNczsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQHJldHVybiBUaGUgYm91bmRhcnkgZW5kIHRpbWUNCisgICAgICovDQorICAgIHB1YmxpYyBsb25nIGdldEJvdW5kYXJ5RW5kVGltZSgpIHsNCisgICAgICAgIHJldHVybiBtRW5kQm91bmRhcnlUaW1lTXM7DQorICAgIH0NCisNCisgICAgLyoNCisgICAgICoge0Bpbmhlcml0RG9jfQ0KKyAgICAgKi8NCisgICAgQE92ZXJyaWRlDQorICAgIHB1YmxpYyB2b2lkIGFkZEVmZmVjdChFZmZlY3QgZWZmZWN0KSB7DQorICAgICAgICBpZiAoZWZmZWN0IGluc3RhbmNlb2YgRWZmZWN0S2VuQnVybnMpIHsNCisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJLZW4gQnVybnMgZWZmZWN0cyBjYW5ub3QgYmUgYXBwbGllZCB0byBNZWRpYVZpZGVvSXRlbSIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgc3VwZXIuYWRkRWZmZWN0KGVmZmVjdCk7DQorICAgIH0NCisNCisgICAgLyoNCisgICAgICoge0Bpbmhlcml0RG9jfQ0KKyAgICAgKi8NCisgICAgQE92ZXJyaWRlDQorICAgIHB1YmxpYyBCaXRtYXAgZ2V0VGh1bWJuYWlsKGludCB3aWR0aCwgaW50IGhlaWdodCwgbG9uZyB0aW1lTXMpIHsNCisgICAgICAgIHJldHVybiBudWxsOw0KKyAgICB9DQorDQorICAgIC8qDQorICAgICAqIHtAaW5oZXJpdERvY30NCisgICAgICovDQorICAgIEBPdmVycmlkZQ0KKyAgICBwdWJsaWMgQml0bWFwW10gZ2V0VGh1bWJuYWlsTGlzdChpbnQgd2lkdGgsIGludCBoZWlnaHQsIGxvbmcgc3RhcnRNcywgbG9uZyBlbmRNcywNCisgICAgICAgICAgICBpbnQgdGh1bWJuYWlsQ291bnQpIHRocm93cyBJT0V4Y2VwdGlvbiB7DQorICAgICAgICByZXR1cm4gbnVsbDsNCisgICAgfQ0KKw0KKyAgICAvKg0KKyAgICAgKiB7QGluaGVyaXREb2N9DQorICAgICAqLw0KKyAgICBAT3ZlcnJpZGUNCisgICAgcHVibGljIGludCBnZXRBc3BlY3RSYXRpbygpIHsNCisgICAgICAgIHJldHVybiBtQXNwZWN0UmF0aW87DQorICAgIH0NCisNCisgICAgLyoNCisgICAgICoge0Bpbmhlcml0RG9jfQ0KKyAgICAgKi8NCisgICAgQE92ZXJyaWRlDQorICAgIHB1YmxpYyBpbnQgZ2V0RmlsZVR5cGUoKSB7DQorICAgICAgICByZXR1cm4gbUZpbGVUeXBlOw0KKyAgICB9DQorDQorICAgIC8qDQorICAgICAqIHtAaW5oZXJpdERvY30NCisgICAgICovDQorICAgIEBPdmVycmlkZQ0KKyAgICBwdWJsaWMgaW50IGdldFdpZHRoKCkgew0KKyAgICAgICAgcmV0dXJuIG1XaWR0aDsNCisgICAgfQ0KKw0KKyAgICAvKg0KKyAgICAgKiB7QGluaGVyaXREb2N9DQorICAgICAqLw0KKyAgICBAT3ZlcnJpZGUNCisgICAgcHVibGljIGludCBnZXRIZWlnaHQoKSB7DQorICAgICAgICByZXR1cm4gbUhlaWdodDsNCisgICAgfQ0KKw0KKyAgICAvKg0KKyAgICAgKiB7QGluaGVyaXREb2N9DQorICAgICAqLw0KKyAgICBAT3ZlcnJpZGUNCisgICAgcHVibGljIGxvbmcgZ2V0RHVyYXRpb24oKSB7DQorICAgICAgICByZXR1cm4gbUR1cmF0aW9uTXM7DQorICAgIH0NCisNCisgICAgLyoNCisgICAgICoge0Bpbmhlcml0RG9jfQ0KKyAgICAgKi8NCisgICAgQE92ZXJyaWRlDQorICAgIHB1YmxpYyBsb25nIGdldFRpbWVsaW5lRHVyYXRpb24oKSB7DQorICAgICAgICByZXR1cm4gbUVuZEJvdW5kYXJ5VGltZU1zIC0gbUJlZ2luQm91bmRhcnlUaW1lTXM7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFJlbmRlciBhIGZyYW1lIGFjY29yZGluZyB0byB0aGUgcGxheWJhY2sgKGluIHRoZSBuYXRpdmUgYXNwZWN0IHJhdGlvKSBmb3INCisgICAgICogdGhlIHNwZWNpZmllZCBtZWRpYSBpdGVtLiBBbGwgZWZmZWN0cyBhbmQgb3ZlcmxheX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AgIC8qKg0KKyAgICAgKiBAcmV0dXJuIFRoZSB2aWRlbyBwcm9maWxlDQorICAgICAqLw0KKyAgICBwdWJsaWMgaW50IGdldFZpZGVvUHJvZmlsZSgpIHsNCisgICAgICAgIHJldHVybiBtVmlkZW9Qcm9maWxlOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBAcmV0dXJuIFRoZSB2aWRlbyBiaXRyYXRlDQorICAgICAqLw0KKyAgICBwdWJsaWMgaW50IGdldFZpZGVvQml0cmF0ZSgpIHsNCisgICAgICAgIHJldHVybiBtVmlkZW9CaXRyYXRlOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBAcmV0dXJuIFRoZSBhdWRpbyBiaXRyYXRlDQorICAgICAqLw0KKyAgICBwdWJsaWMgaW50IGdldEF1ZGlvQml0cmF0ZSgpIHsNCisgICAgICAgIHJldHVybiBtQXVkaW9CaXRyYXRlOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBAcmV0dXJuIFRoZSBudW1iZXIgb2YgZnJhbWVzIHBlciBzZWNvbmQNCisgICAgICovDQorICAgIHB1YmxpYyBpbnQgZ2V0RnBzKCkgew0KKyAgICAgICAgcmV0dXJuIG1GcHM7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEByZXR1cm4gVGhlIGF1ZGlvIGNvZGVjDQorICAgICAqLw0KKyAgICBwdWJsaWMgaW50IGdldEF1ZGlvVHlwZSgpIHsNCisgICAgICAgIHJldHVybiBtQXVkaW9UeXBlOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBAcmV0dXJuIFRoZSBudW1iZXIgb2YgYXVkaW8gY2hhbm5lbHMNCisgICAgICovDQorICAgIHB1YmxpYyBpbnQgZ2V0QXVkaW9DaGFubmVscygpIHsNCisgICAgICAgIHJldHVybiBtQXVkaW9DaGFubmVsczsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQHJldHVybiBUaGUgYXVkaW8gc2Ftc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ZlcmxheUlkLCBzdGFydFRpbWVNcywgZHVyYXRpb25Ncyk7DQorICAgICAgICBtRmlsZW5hbWUgPSBmaWxlbmFtZTsNCisgICAgICAgIG1CaXRtYXAgPSBCaXRtYXBGYWN0b3J5LmRlY29kZUZpbGUobUZpbGVuYW1lKTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQHJldHVybiBHZXQgdGhlIG92ZXJsYXkgYml0bWFwDQorICAgICAqLw0KKyAgICBwdWJsaWMgQml0bWFwIGdldEJpdG1hcCgpIHsNCisgICAgICAgIHJldHVybiBtQml0bWFwOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBAcGFyYW0gYml0bWFwIFRoZSBvdmVybGF5IGJpdG1hcA0KKyAgICAgKi8NCisgICAgcHVibGljIHZvaWQgc2V0Qml0bWFwKEJpdG1hcCBiaXRtYXApIHsNCisgICAgICAgIG1CaXRtYXAgPSBiaXRtYXA7DQorICAgICAgICBpZiAobUZpbGVuYW1lICE9IG51bGwpIHsNCisgICAgICAgICAgICAvLyBEZWxldGUgdGhlIGZpbGUNCisgICAgICAgICAgICBuZXcgRmlsZShtRmlsZW5hbWUpLmRlbGV0ZSgpOw0KKyAgICAgICAgICAgIC8vIEludmFsaWRhdGUgdGhlIGZpbGVuYW1lDQorICAgICAgICAgICAgbUZpbGVuYW1lID0gbnVsbDsNCisgICAgICAgIH0NCisNCisgICAgICAgIC8vIEludmFsaWRhdGUgdGhlIHRyYW5zaXRpb25zIGlmIG5lY2Vzc2FyeQ0KKyAgICAgICAgZ2V0TWVkaWFJdGVtKCkuaW52YWxpZGF0ZVRyYW5zaXRpb25zKHRoaXMpOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIGZpbGUgbmFtZSBvZiB0aGlzIG92ZXJsYXkNCisgICAgICovDQorICAgIFN0cmluZyBnZXRGaWxlbmFtZSgpIHsNCisgICAgICAgIHJldHVybiBtRmlsZW5hbWU7DQorICAgIH0NC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sZXRlKCk7DQorICAgICAgICAgICAgbUZpbGVuYW1lID0gbnVsbDsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSB0cmFuc2l0aW9uIGlzIGdlbmVyYXRlZA0KKyAgICAgKi8NCisgICAgYm9vbGVhbiBpc0dlbmVyYXRlZCgpIHsNCisgICAgICAgIHJldHVybiAobUZpbGVuYW1lICE9IG51bGwpOw0KKyAgICB9DQorDQorICAgIC8qDQorICAgICAqIHtAaW5oZXJpdERvY30NCisgICAgICovDQorICAgIEBPdmVycmlkZQ0KKyAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iamVjdCkgew0KKyAgICAgICAgaWYgKCEob2JqZWN0IGluc3RhbmNlb2YgVHJhbnNpdGlvbikpIHsNCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gbVVuaXF1ZUlkLmVxdWFscygoKFRyYW5zaXRpb24pb2JqZWN0KS5tVW5pcXVlSWQpOw0KKyAgICB9DQorDQorICAgIC8qDQorICAgICAqIHtAaW5oZXJpdERvY30NCisgICAgICovDQorICAgIEBPdmVycmlkZQ0KKyAgICBwdWJsaWMgaW50IGhhc2hDb2RlKCkgew0KKyAgICAgICAgcmV0dXJuIG1VbmlxdWVJZC5oYXNoQ29kZSgpOw0KKyAgICB9DQorfQ0KZGlmZiAtLWdpdCBhL21lZGlhL2phdmEvYW5kcm9pZC9tZWRpYS92aWRlb2VkaXRvci9UcmFuc2l0aW9uQWxwaGEuamF2YSBiL21lZGlhL2phdmEvYW5kcm9pZC9tZWRpYS92aWRlb2VkaXRvci9UcmFuc2l0aW9uQWxwaGEuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDc1NQppbmRleCAwMDAwMDAwLi4zMGU2NmZjCi0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvamF2YS9hbmRyb2lkL21lZGlhL3ZpZ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Jvd3MgSU9FeGNlcHRpb24sCisgICAgICAgICAgICBDbGFzc05vdEZvdW5kRXhjZXB0aW9uLCBOb1N1Y2hNZXRob2RFeGNlcHRpb24sIEludm9jYXRpb25UYXJnZXRFeGNlcHRpb24sCisgICAgICAgICAgICBJbGxlZ2FsQWNjZXNzRXhjZXB0aW9uLCBJbnN0YW50aWF0aW9uRXhjZXB0aW9uIHsKKyAgICAgICAgLy8gSWYgdGhlIHByb2plY3QgcGF0aCBkb2VzIG5vdCBleGlzdCBjcmVhdGUgaXQKKyAgICAgICAgZmluYWwgRmlsZSBkaXIgPSBuZXcgRmlsZShwcm9qZWN0UGF0aCk7CisgICAgICAgIGlmICghZGlyLmV4aXN0cygpKSB7CisgICAgICAgICAgICBpZiAoIWRpci5ta2RpcnMoKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBGaWxlTm90Rm91bmRFeGNlcHRpb24oIkNhbm5vdCBjcmVhdGUgcHJvamVjdCBwYXRoOiAiICsgcHJvamVjdFBhdGgpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBDcmVhdGUgdGhlIGZpbGUgd2hpY2ggaGlkZXMgdGhlIG1lZGlhIGZpbGVzCisgICAgICAgICAgICAgICAgLy8gZnJvbSB0aGUgbWVkaWEgc2Nhbm5lcgorICAgICAgICAgICAgICAgIGlmICghbmV3IEZpbGUoZGlyLCAiLm5vbWVkaWEiKS5jcmVhdGVOZXdGaWxlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZpbGVOb3RGb3VuZEV4Y2VwdGlvbigiQ2Fubm90IGNyZWF0ZSBmaWxlIC5ub21lZGlhIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZmluYWwgQ2xhc3M8Pz4gY2xzID0gQ2xhc3MuZm9yTmFtZShjbGFzc05hbWUpOworICAgICAgICBmaW5hbCBDbGFzczw/PiBwYXJ0eXBlc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orICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIFByZXZpZXdUaHJlYWQobG9uZyBmcm9tTXMsIGxvbmcgdG9NcywgYm9vbGVhbiBsb29wLCBpbnQgY2FsbGJhY2tBZnRlckZyYW1lQ291bnQsCisgICAgICAgICAgICAgICAgUHJldmlld1Byb2dyZXNzTGlzdGVuZXIgbGlzdGVuZXIpIHsKKyAgICAgICAgICAgIG1Qb3NpdGlvbk1zID0gbUZyb21NcyA9IGZyb21NczsKKyAgICAgICAgICAgIGlmICh0b01zIDwgMCkgeworICAgICAgICAgICAgICAgIG1Ub01zID0gbUR1cmF0aW9uTXM7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1Ub01zID0gdG9NczsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Mb29wID0gbG9vcDsKKyAgICAgICAgICAgIG1DYWxsYmFja0FmdGVyRnJhbWVDb3VudCA9IGNhbGxiYWNrQWZ0ZXJGcmFtZUNvdW50OworICAgICAgICAgICAgbUxpc3RlbmVyID0gbGlzdGVuZXI7CisgICAgICAgICAgICBtUnVuID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgICAgICovCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiPT09PiBQcmV2aWV3VGhyZWFkLnJ1biBlbnRlciIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaW50IGZyYW1lQ291bnQgPSAwOworICAgICAgICAgICAgd2hpbGUgKG1SdW4pIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBzbGVlcChGUkFNRV9EVVJBVElPTik7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZyYW1lQ291bnQrKzsKKyAgICAgICAgICAgICAgICBtUG9zaXRpb25NcyArPSBGUkFNRV9EVVJBVElPTjsKKworICAgICAgICAgICAgICAgIGlmIChtUG9zaXRpb25NcyA+PSBtVG9NcykgeworICAgICAgICAgICAgICAgICAgICBpZiAoIW1Mb29wKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXIub25Qcm9ncmVzcyhWaWRlb0VkaXRvclRlc3RJbXBsLnRoaXMsIG1Qb3NpdGlvbk1zLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJQcmV2aWV3VGhyZWFkLnJ1biBwbGF5YmFjayBjb21wbGV0ZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaXJlIGEgbm90aWZpY2F0aW9uIGZvciB0aGUgZW5kIG9mIHRoZSBjbGlwCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXIub25Qcm9ncmVzcyhWaWRlb0VkaXRvclRlc3RJbXBsLnRoaXMsIG1Ub01zLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJld2luZAorICAgICAgICAgICAgICAgICAgICAgICAgbVBvc2l0aW9uTXMgPSBtRnJvbU1zOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1MaXN0ZW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxpc3RlbmVyLm9uUHJvZ3Jlc3MoVmlkZW9FZGl0b3JUZXN0SW1wbC50aGlzLCBtUG9zaXRpb25NcywgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlByZXZpZXdUaHJlYWQucnVuIHBsYXliYWNrIGNvbXBsZXRlIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZUNvdW50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChmcmFtZUNvdW50ID09IG1DYWxsYmFja0FmdGVyRnJhbWVDb3VudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1MaXN0ZW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxpc3RlbmVyLm9uUHJvZ3Jlc3MoVmlkZW9FZGl0b3JUZXN0SW1wbC50aGlzLCBtUG9zaXRpb25NcywgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVDb3VudCA9IDA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICI9PT0+IFByZXZpZXdUaHJlYWQucnVuIGV4aXQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBTdG9wIHRoZSBwcmV2aWV3CisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gVGhlIHN0b3AgcG9zaXRpb24KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBsb25nIHN0b3BQcmV2aWV3KCkgeworICAgICAgICAgICAgbVJ1biA9IGZhbHNlOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBqb2luKCk7CisgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG1Qb3NpdGlvbk1zOworICAgICAgICB9CisgICAgfTsKKworICAgIC8qKgorICAgICAqIENvbnN0cnVjdG9yCisgICAgICoKKyAgICAgKiBAcGFyYW0gcHJvamVjdFBhdGgKKyAgICAgKi8KKyAgICBwdWJsaWMgVmlkZW9FZGl0b3JUZXN0SW1wbChTdHJpbmcgcHJvamVjdFBhdGgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIG1Qcm9qZWN0UGF0aCA9IHByb2plY3RQYXRoOworICAgICAgICBmaW5hbCBGaWxlIHByb2plY3RYbWwgPSBuZXcgRmlsZShwcm9qZWN0UGF0aCwgUFJPSkVDVF9GSUxFTkFNRSk7CisgICAgICAgIGlmIChwcm9qZWN0WG1sLmV4aXN0cygpKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGxvYWQoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbihleCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtQXNwZWN0UmF0aW8gPSBNZWRpYVByb3BlcnRpZXMuQVNQRUNUX1JBVElPXzE2Xzk7CisgICAgICAgICAgICBtRHVyYXRpb25NcyA9IDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIGdldFBhdGgoKSB7CisgICAgICAgIHJldHVybiBtUHJvamVjdFBhdGg7CisgICAgfQorCisgICAgLyoKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIGFkZE1lZGlhSXRlbShNZWRpYUl0ZW0gbWVkaWFJdGVtKSB7CisgICAgICAgIGlmIChtUHJldmlld1RocmVhZCAhPSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJQcmV2aWV3aW5nIGlzIGluIHByb2dyZXNzIik7CisgICAgICAgIH0KKworICAgICAgICBpZiAobU1lZGlhSXRlbXMuY29udGFpbnMobWVkaWFJdGVtKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTWVkaWEgaXRlbSBhbHJlYWR5IGV4aXN0czogIiArIG1lZGlhSXRlbS5nZXRJZCgpKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEludmFsaWRhdGUgdGhlIGVuZCB0cmFuc2l0aW9uIGlmIG5lY2Vzc2FyeQorICAgICAgICBmaW5hbCBpbnQgbWVkaWFJdGVtc0NvdW50ID0gbU1lZGlhSXRlbXMuc2l6ZSgpOworICAgICAgICBpZiAoIG1lZGlhSXRlbXNDb3VudCA+IDApIHsKKyAgICAgICAgICAgIHJlbW92ZVRyYW5zaXRpb25BZnRlcihtZWRpYUl0ZW1zQ291bnQgLSAxKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEFkZCB0aGUgbmV3IG1lZGlhIGl0ZW0KKyAgICAgICAgbU1lZGlhSXRlbXMuYWRkKG1lZGlhSXRlbSk7CisKKyAgICAgICAgY29tcHV0ZVRpbWVsaW5lRHVyYXRpb24oKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgaW5zZXJ0TWVkaWFJdGVtKE1lZGlhSXRlbSBtZWRpYUl0ZW0sIFN0cmluZyBhZnRlck1lZGlhSXRlbUlkKSB7CisgICAgICAgIGlmIChtUHJldmlld1RocmVhZCAhPSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJQcmV2aWV3aW5nIGlzIGluIHByb2dyZXNzIik7CisgICAgICAgIH0KKworICAgICAgICBpZiAobU1lZGlhSXRlbXMuY29udGFpbnMobWVkaWFJdGVtKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTWVkaWEgaXRlbSBhbHJlYWR5IGV4aXN0czogIiArIG1lZGlhSXRlbS5nZXRJZCgpKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChhZnRlck1lZGlhSXRlbUlkID09IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtTWVkaWFJdGVtcy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgLy8gSW52YWxpZGF0ZSB0aGUgdHJhbnNpdGlvbiBhdCB0aGUgYmVnaW5uaW5nIG9mIHRoZSB0aW1lbGluZQorICAgICAgICAgICAgICAgIHJlbW92ZVRyYW5zaXRpb25CZWZvcmUoMCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTWVkaWFJdGVtcy5hZGQoMCwgbWVkaWFJdGVtKTsKKyAgICAgICAgICAgIGNvbXB1dGVUaW1lbGluZUR1cmF0aW9uKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgbWVkaWFJdGVtQ291bnQgPSBtTWVkaWFJdGVtcy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1lZGlhSXRlbUNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBNZWRpYUl0ZW0gbWkgPSBtTWVkaWFJdGVtcy5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKG1pLmdldElkKCkuZXF1YWxzKGFmdGVyTWVkaWFJdGVtSWQpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIEludmFsaWRhdGUgdGhlIHRyYW5zaXRpb24gYXQgdGhpcyBwb3NpdGlvbgorICAgICAgICAgICAgICAgICAgICByZW1vdmVUcmFuc2l0aW9uQWZ0ZXIoaSk7CisgICAgICAgICAgICAgICAgICAgIC8vIEluc2VydCB0aGUgbmV3IG1lZGlhIGl0ZW0KKyAgICAgICAgICAgICAgICAgICAgbU1lZGlhSXRlbXMuYWRkKGkgKyAxLCBtZWRpYUl0ZW0pOworICAgICAgICAgICAgICAgICAgICBjb21wdXRlVGltZWxpbmVEdXJhdGlvbigpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTWVkaWFJdGVtIG5vdCBmb3VuZDogIiArIGFmdGVyTWVkaWFJdGVtSWQpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIG1vdmVNZWRpYUl0ZW0oU3RyaW5nIG1lZGlhSXRlbUlkLCBTdHJpbmcgYWZ0ZXJNZWRpYUl0ZW1JZCkgeworICAgICAgICBpZiAobVByZXZpZXdUaHJlYWQgIT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiUHJldmlld2luZyBpcyBpbiBwcm9ncmVzcyIpOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgTWVkaWFJdGVtIG1vdmVNZWRpYUl0ZW0gPSByZW1vdmVNZWRpYUl0ZW0obWVkaWFJdGVtSWQpOworICAgICAgICBpZiAobW92ZU1lZGlhSXRlbSA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJUYXJnZXQgTWVkaWFJdGVtIG5vdCBmb3VuZDogIiArIG1lZGlhSXRlbUlkKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChhZnRlck1lZGlhSXRlbUlkID09IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtTWVkaWFJdGVtcy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgLy8gSW52YWxpZGF0ZSBhZGphY2VudCB0cmFuc2l0aW9ucyBhdCB0aGUgaW5zZXJ0aW9uIHBvaW50CisgICAgICAgICAgICAgICAgcmVtb3ZlVHJhbnNpdGlvbkJlZm9yZSgwKTsKKworICAgICAgICAgICAgICAgIC8vIEluc2VydCB0aGUgbWVkaWEgaXRlbSBhdCB0aGUgbmV3IHBvc2l0aW9uCisgICAgICAgICAgICAgICAgbU1lZGlhSXRlbXMuYWRkKDAsIG1vdmVNZWRpYUl0ZW0pOworICAgICAgICAgICAgICAgIGNvbXB1dGVUaW1lbGluZUR1cmF0aW9uKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkNhbm5vdCBtb3ZlIG1lZGlhIGl0ZW0gKGl0IGlzIHRoZSBvbmx5IGl0ZW0pIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgbWVkaWFJdGVtQ291bnQgPSBtTWVkaWFJdGVtcy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1lZGlhSXRlbUNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBNZWRpYUl0ZW0gbWkgPSBtTWVkaWFJdGVtcy5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKG1pLmdldElkKCkuZXF1YWxzKGFmdGVyTWVkaWFJdGVtSWQpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIEludmFsaWRhdGUgYWRqYWNlbnQgdHJhbnNpdGlvbnMgYXQgdGhlIGluc2VydGlvbiBwb2ludAorICAgICAgICAgICAgICAgICAgICByZW1vdmVUcmFuc2l0aW9uQWZ0ZXIoaSk7CisgICAgICAgICAgICAgICAgICAgIC8vIEluc2VydCB0aGUgbWVkaWEgaXRlbSBhdCB0aGUgbmV3IHBvc2l0aW9uCisgICAgICAgICAgICAgICAgICAgIG1NZWRpYUl0ZW1zLmFkZChpICsgMSwgbW92ZU1lZGlhSXRlbSk7CisgICAgICAgICAgICAgICAgICAgIGNvbXB1dGVUaW1lbGluZUR1cmF0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk1lZGlhSXRlbSBub3QgZm91bmQ6ICIgKyBhZnRlck1lZGlhSXRlbUlkKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqLworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgTWVkaWFJdGVtIHJlbW92ZU1lZGlhSXRlbShTdHJpbmcgbWVkaWFJdGVtSWQpIHsKKyAgICAgICAgaWYgKG1QcmV2aWV3VGhyZWFkICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIlByZXZpZXdpbmcgaXMgaW4gcHJvZ3Jlc3MiKTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIE1lZGlhSXRlbSBtZWRpYUl0ZW0gPSBnZXRNZWRpYUl0ZW0obWVkaWFJdGVtSWQpOworICAgICAgICBpZiAobWVkaWFJdGVtICE9IG51bGwpIHsKKyAgICAgICAgICAgIC8vIFJlbW92ZSB0aGUgbWVkaWEgaXRlbQorICAgICAgICAgICAgbU1lZGlhSXRlbXMucmVtb3ZlKG1lZGlhSXRlbSk7CisgICAgICAgICAgICAvLyBSZW1vdmUgdGhlIGFkamFjZW50IHRyYW5zaXRpb25zCisgICAgICAgICAgICByZW1vdmVBZGphY2VudFRyYW5zaXRpb25zKG1lZGlhSXRlbSk7CisgICAgICAgICAgICBjb21wdXRlVGltZWxpbmVEdXJhdGlvbigpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG1lZGlhSXRlbTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIE1lZGlhSXRlbSBnZXRNZWRpYUl0ZW0oU3RyaW5nIG1lZGlhSXRlbUlkKSB7CisgICAgICAgIGZvciAoTWVkaWFJdGVtIG1lZGlhSXRlbSA6IG1NZWRpYUl0ZW1zKSB7CisgICAgICAgICAgICBpZiAobWVkaWFJdGVtLmdldElkKCkuZXF1YWxzKG1lZGlhSXRlbUlkKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBtZWRpYUl0ZW07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIExpc3Q8TWVkaWFJdGVtPiBnZXRBbGxNZWRpYUl0ZW1zKCkgeworICAgICAgICByZXR1cm4gbU1lZGlhSXRlbXM7CisgICAgfQorCisgICAgLyoKKyAgICAgK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2V0QWxsVHJhbnNpdGlvbnMoKSB7CisgICAgICAgIHJldHVybiBtVHJhbnNpdGlvbnM7CisgICAgfQorCisgICAgLyoKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCisgICAgcHVibGljIFRyYW5zaXRpb24gZ2V0VHJhbnNpdGlvbihTdHJpbmcgdHJhbnNpdGlvbklkKSB7CisgICAgICAgIGZvciAoVHJhbnNpdGlvbiB0cmFuc2l0aW9uIDogbVRyYW5zaXRpb25zKSB7CisgICAgICAgICAgICBpZiAodHJhbnNpdGlvbi5nZXRJZCgpLmVxdWFscyh0cmFuc2l0aW9uSWQpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRyYW5zaXRpb247CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgYWRkQXVkaW9UcmFjayhBdWRpb1RyYWNrIGF1ZGlvVHJhY2spIHsKKyAgICAgICAgaWYgKG1QcmV2aWV3VGhyZWFkICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIlByZXZpZXdpbmcgaXMgaW4gcHJvZ3Jlc3MiKTsKKyAgICAgICAgfQorCisgICAgICAgIG1BdWRpb1RyYWNrcy5hZGQoYXVkaW9UcmFjayk7CisgICAgfQorCisgICAgLyoKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIGluc2VydEF1ZGlvVHJhY2soQXVkaW9UcmFjayBhdWRpb1RyYWNrLCBTdHJpbmcgYWZ0ZXJBdWRpb1RyYWNrSWQpIHsKKyAgICAgICAgaWYgKG1QcmV2aWV3VGhyZWFkICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIlByZXZpZXdpbmcgaXMgaW4gcHJvZ3Jlc3MiKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChhZnRlckF1ZGlvVHJhY2tJZCA9PSBudWxsKSB7CisgICAgICAgICAgICBtQXVkaW9UcmFja3MuYWRkKDAsIGF1ZGlvVHJhY2spOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZmluYWwgaW50IGF1ZGlvVHJhY2tDb3VudCA9IG1BdWRpb1RyYWNrcy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGF1ZGlvVHJhY2tDb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgQXVkaW9UcmFjayBhdCA9IG1BdWRpb1RyYWNrcy5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGF0LmdldElkKCkuZXF1YWxzKGFmdGVyQXVkaW9UcmFja0lkKSkgeworICAgICAgICAgICAgICAgICAgICBtQXVkaW9UcmFja3MuYWRkKGkgKyAxLCBhdWRpb1RyYWNrKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQXVkaW9UcmFjayBub3QgZm91bmQ6ICIgKyBhZnRlckF1ZGlvVHJhY2tJZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgbW92ZUF1ZGlvVHJhY2soU3RyaW5nIGF1ZGlvVHJhY2tJZCwgU3RyaW5nIGFmdGVyQXVkaW9UcmFja0lkKSB7CisgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIk5vdCBzdXBwb3J0ZWQiKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIEF1ZGlvVHJhY2sgcmVtb3ZlQXVkaW9UcmFjayhTdHJpbmcgYXVkaW9UcmFja0lkKSB7CisgICAgICAgIGlmIChtUHJldmlld1RocmVhZCAhPSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJQcmV2aWV3aW5nIGlzIGluIHByb2dyZXNzIik7CisgICAgICAgIH0KKworICAgICAgICBmaW5hbCBBdWRpb1RyYWNrIGF1ZGlvVHJhY2sgPSBnZXRBdWRpb1RyYWNrKGF1ZGlvVHJhY2tJZCk7CisgICAgICAgIGlmIChhdWRpb1RyYWNrICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1BdWRpb1RyYWNrcy5yZW1vdmUoYXVkaW9UcmFjayk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gYXVkaW9UcmFjazsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgQXVkaW9UcmFjayBnZXRBdWRpb1RyYWNrKFN0cmluZyBhdWRpb1RyYWNrSWQpIHsKKyAgICAgICAgZm9yIChBdWRpb1RyYWNrIGF0IDogbUF1ZGlvVHJhY2tzKSB7CisgICAgICAgICAgICBpZiAoYXQuZ2V0SWQoKS5lcXVhbHMoYXVkaW9UcmFja0lkKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBhdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqLworICAgIHB1YmxpYyBMaXN0PEF1ZGlvVHJhY2s+IGdldEFsbEF1ZGlvVHJhY2tzKCkgeworICAgICAgICByZXR1cm4gbUF1ZGlvVHJhY2tzOworICAgIH0KKworICAgIC8qCisgICAgICo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ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAobWVkaWFJdGVtIGluc3RhbmNlb2YgTWVkaWFJbWFnZUl0ZW0pIHsKKyAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9EVVJBVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIExvbmcudG9TdHJpbmcobWVkaWFJdGVtLmdldFRpbWVsaW5lRHVyYXRpb24oKSkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmaW5hbCBMaXN0PE92ZXJsYXk+IG92ZXJsYXlzID0gbWVkaWFJdGVtLmdldEFsbE92ZXJsYXlzKCk7CisgICAgICAgICAgICBpZiAob3ZlcmxheXMuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgIHNlcmlhbGl6ZXIuc3RhcnRUYWcoIiIsIFRBR19PVkVSTEFZUyk7CisgICAgICAgICAgICAgICAgZm9yIChPdmVybGF5IG92ZXJsYXkgOiBvdmVybGF5cykgeworICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLnN0YXJ0VGFnKCIiLCBUQUdfT1ZFUkxBWSk7CisgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZXIuYXR0cmlidXRlKCIiLCBBVFRSX0lELCBvdmVybGF5LmdldElkKCkpOworICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9UWVBFLCBvdmVybGF5LmdldENsYXNzKCkuZ2V0U2ltcGxlTmFtZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUoIiIsIEFUVFJfQkVHSU5fVElNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb25nLnRvU3RyaW5nKG92ZXJsYXkuZ2V0U3RhcnRUaW1lKCkpKTsKKyAgICAgICAgICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUoIiIsIEFUVFJfRFVSQVRJT04sIExvbmcudG9TdHJpbmcob3ZlcmxheS5nZXREdXJhdGlvbigpKSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChvdmVybGF5IGluc3RhbmNlb2YgT3ZlcmxheUZyYW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBPdmVybGF5RnJhbWUgb3ZlcmxheUZyYW1lID0gKE92ZXJsYXlGcmFtZSlvdmVybGF5OworICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUZyYW1lLnNhdmUoZ2V0UGF0aCgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdmVybGF5RnJhbWUuZ2V0RmlsZW5hbWUoKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUoIiIsIEFUVFJfRklMRU5BTUUsIG92ZXJsYXlGcmFtZS5nZXRGaWxlbmFtZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIFNhdmUgdGhlIHVzZXIgYXR0cmlidXRlcworICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLnN0YXJ0VGFnKCIiLCBUQUdfT1ZFUkxBWV9VU0VSX0FUVFJJQlVURVMpOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBNYXA8U3RyaW5nLCBTdHJpbmc+IHVzZXJBdHRyaWJ1dGVzID0gb3ZlcmxheS5nZXRVc2VyQXR0cmlidXRlcygpOworICAgICAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBuYW1lIDogdXNlckF0dHJpYnV0ZXMua2V5U2V0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyB2YWx1ZSA9IHVzZXJBdHRyaWJ1dGVzLmdldChuYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUoIiIsIG5hbWUsIHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmVuZFRhZygiIiwgVEFHX09WRVJMQVlfVVNFUl9BVFRSSUJVVEVTKTsKKworICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmVuZFRhZygiIiwgVEFHX09WRVJMQVkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmVuZFRhZygiIiwgVEFHX09WRVJMQVlTKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgTGlzdDxFZmZlY3Q+IGVmZmVjdHMgPSBtZWRpYUl0ZW0uZ2V0QWxsRWZmZWN0cygpOworICAgICAgICAgICAgaWYgKGVmZmVjdHMuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgIHNlcmlhbGl6ZXIuc3RhcnRUYWcoIiIsIFRBR19FRkZFQ1RTKTsKKyAgICAgICAgICAgICAgICBmb3IgKEVmZmVjdCBlZmZlY3QgOiBlZmZlY3RzKSB7CisgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZXIuc3RhcnRUYWcoIiIsIFRBR19FRkZFQ1QpOworICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9JRCwgZWZmZWN0LmdldElkKCkpOworICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9UWVBFLCBlZmZlY3QuZ2V0Q2xhc3MoKS5nZXRTaW1wbGVOYW1lKCkpOworICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9CRUdJTl9USU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvbmcudG9TdHJpbmcoZWZmZWN0LmdldFN0YXJ0VGltZSgpKSk7CisgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZXIuYXR0cmlidXRlKCIiLCBBVFRSX0RVUkFUSU9OLCBMb25nLnRvU3RyaW5nKGVmZmVjdC5nZXREdXJhdGlvbigpKSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChlZmZlY3QgaW5zdGFuY2VvZiBFZmZlY3RDb2xvcikgeworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgRWZmZWN0Q29sb3IgY29sb3JFZmZlY3QgPSAoRWZmZWN0Q29sb3IpZWZmZWN0OworICAgICAgICAgICAgICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUoIiIsIEFUVFJfQ09MT1JfRUZGRUNUX1RZUEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVnZXIudG9TdHJpbmcoY29sb3JFZmZlY3QuZ2V0VHlwZSgpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29sb3JFZmZlY3QuZ2V0VHlwZSgpID09IEVmZmVjdENvbG9yLlRZUEVfQ09MT1IgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3JFZmZlY3QuZ2V0VHlwZSgpID09IEVmZmVjdENvbG9yLlRZUEVfR1JBRElFTlQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9DT0xPUl9FRkZFQ1RfVkFMVUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyLnRvU3RyaW5nKGNvbG9yRWZmZWN0LmdldENvbG9yKCkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlZmZlY3QgaW5zdGFuY2VvZiBFZmZlY3RLZW5CdXJucykgeworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgUmVjdCBzdGFydFJlY3QgPSAoKEVmZmVjdEtlbkJ1cm5zKWVmZmVjdCkuZ2V0U3RhcnRSZWN0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9TVEFSVF9SRUNUX0wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVnZXIudG9TdHJpbmcoc3RhcnRSZWN0LmxlZnQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZXIuYXR0cmlidXRlKCIiLCBBVFRSX1NUQVJUX1JFQ1RfVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50ZWdlci50b1N0cmluZyhzdGFydFJlY3QudG9wKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9TVEFSVF9SRUNUX1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVnZXIudG9TdHJpbmcoc3RhcnRSZWN0LnJpZ2h0KSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9TVEFSVF9SRUNUX0IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVnZXIudG9TdHJpbmcoc3RhcnRSZWN0LmJvdHRvbSkpOworCisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBSZWN0IGVuZFJlY3QgPSAoKEVmZmVjdEtlbkJ1cm5zKWVmZmVjdCkuZ2V0RW5kUmVjdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUoIiIsIEFUVFJfRU5EX1JFQ1RfTCwgSW50ZWdlci50b1N0cmluZyhlbmRSZWN0LmxlZnQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZXIuYXR0cmlidXRlKCIiLCBBVFRSX0VORF9SRUNUX1QsIEludGVnZXIudG9TdHJpbmcoZW5kUmVjdC50b3ApKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZXIuYXR0cmlidXRlKCIiLCBBVFRSX0VORF9SRUNUX1IsIEludGVnZXIudG9TdHJpbmcoZW5kUmVjdC5yaWdodCkpOworICAgICAgICAgICAgICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUoIiIsIEFUVFJfRU5EX1JFQ1RfQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50ZWdlci50b1N0cmluZyhlbmRSZWN0LmJvdHRvbSkpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgc2VyaWFsaXplci5lbmRUYWcoIiIsIFRBR19FRkZFQ1QpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmVuZFRhZygiIiwgVEFHX0VGRkVDVFMpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzZXJpYWxpemVyLmVuZFRhZygiIiwgVEFHX01FRElBX0lURU0pOworICAgICAgICB9CisgICAgICAgIHNlcmlhbGl6ZXIuZW5kVGFnKCIiLCBUQUdfTUVESUFfSVRFTVMpOworCisgICAgICAgIHNlcmlhbGl6ZXIuc3RhcnRUYWcoIiIsIFRBR19UUkFOU0lUSU9OUyk7CisKKyAgICAgICAgZm9yIChUcmFuc2l0aW9uIHRyYW5zaXRpb24gOiBtVHJhbnNpdGlvbnMpIHsKKyAgICAgICAgICAgIHNlcmlhbGl6ZXIuc3RhcnRUYWcoIiIsIFRBR19UUkFOU0lUSU9OKTsKKyAgICAgICAgICAgIHNlcmlhbGl6ZXIuYXR0cmlidXRlKCIiLCBBVFRSX0lELCB0cmFuc2l0aW9uLmdldElkKCkpOworICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUoIiIsIEFUVFJfVFlQRSwgdHJhbnNpdGlvbi5nZXR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cmluZygoKFRyYW5zaXRpb25TbGlkaW5nKXRyYW5zaXRpb24pLmdldERpcmVjdGlvbigpKSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHRyYW5zaXRpb24gaW5zdGFuY2VvZiBUcmFuc2l0aW9uQWxwaGEpIHsKKyAgICAgICAgICAgICAgICBUcmFuc2l0aW9uQWxwaGEgdGEgPSAoVHJhbnNpdGlvbkFscGhhKXRyYW5zaXRpb247CisgICAgICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUoIiIsIEFUVFJfQkxFTkRJTkcsIEludGVnZXIudG9TdHJpbmcodGEuZ2V0QmxlbmRpbmdQZXJjZW50KCkpKTsKKyAgICAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiIiwgQVRUUl9JTlZFUlQsIEJvb2xlYW4udG9TdHJpbmcodGEuaXNJbnZlcnQoKSkpOworICAgICAgICAgICAgICAgIGlmICh0YS5nZXRNYXNrRmlsZW5hbWUoKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZXIuYXR0cmlidXRlKCIiLCBBVFRSX01BU0ssIHRhLmdldE1hc2tGaWxlbmFtZSgpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzZXJpYWxpemVyLmVuZFRhZygiIiwgVEFHX1RSQU5TSVRJT04pOworICAgICAgICB9CisgICAgICAgIHNlcmlhbGl6ZXIuZW5kVGFnKCIiLCBUQUdfVFJBTlNJVElPTlMpOworCisgICAgICAgIHNlcmlhbGl6ZXIuc3RhcnRUYWcoIiIsIFRBR19BVURJT19UUkFDS1MpOworICAgICAgICBmb3IgKEF1ZGlvVHJhY2sgYXQgOiBtQXVkaW9UcmFja3MpIHsKKyAgICAgICAgICAgIHNlcmlhbGl6ZXIuc3RhcnRUYWcoIiIsIFRBR19BVURJT19UUkFDSyk7CisgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZSgiI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gICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChUQUdfTUVESUFfSVRFTS5lcXVhbHMobmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBtZWRpYUl0ZW1JZCA9IHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZSgiIiwgQVRUUl9JRCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgdHlwZSA9IHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZSgiIiwgQVRUUl9UWVBFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBmaWxlbmFtZSA9IHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZSgiIiwgQVRUUl9GSUxFTkFNRSk7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcmVuZGVyaW5nTW9kZSA9IEludGVnZXIucGFyc2VJbnQocGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKCIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBVFRSX1JFTkRFUklOR19NT0RFKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNZWRpYUltYWdlSXRlbS5jbGFzcy5nZXRTaW1wbGVOYW1lKCkuZXF1YWxzKHR5cGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgbG9uZyBkdXJhdGlvbk1zID0gTG9uZy5wYXJzZUxvbmcocGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKCIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVRUUl9EVVJBVElPTikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRNZWRpYUl0ZW0gPSBuZXcgTWVkaWFJbWFnZUl0ZW0odGhpcywgbWVkaWFJdGVtSWQsIGZpbGVuYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb25NcywgcmVuZGVyaW5nTW9kZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKE1lZGlhVmlkZW9JdGVtLmNsYXNzLmdldFNpbXBsZU5hbWUoKS5lcXVhbHModHlwZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGJlZ2luTXMgPSBMb25nLnBhcnNlTG9uZyhwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUoIiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBVFRSX0JFR0lOX1RJTUUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGVuZE1zID0gTG9uZy5wYXJzZUxvbmcocGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKCIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVRUUl9FTkRfVElNRSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCB2b2x1bWUgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZSgiIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFUVFJfVk9MVU1FKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBtdXRlZCA9IEJvb2xlYW4ucGFyc2VCb29sZWFuKHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZSgiIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFUVFJfTVVURUQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgYXVkaW9XYXZlZm9ybUZpbGVuYW1lID0gcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKCIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVRUUl9BVURJT19XQVZFRk9STV9GSUxFTkFNRSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE1lZGlhSXRlbSA9IG5ldyBNZWRpYVZpZGVvSXRlbSh0aGlzLCBtZWRpYUl0ZW1JZCwgZmlsZW5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5kZXJpbmdNb2RlLCBiZWdpbk1zLCBlbmRNcywgdm9sdW1lLCBtdXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvV2F2ZWZvcm1GaWxlbmFtZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGJlZ2luVGltZU1zID0gTG9uZy5wYXJzZUxvbmcocGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKCIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVRUUl9CRUdJTl9USU1FKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgbG9uZyBlbmRUaW1lTXMgPSBMb25nLnBhcnNlTG9uZyhwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUoIiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBVFRSX0VORF9USU1FKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChNZWRpYVZpZGVvSXRlbSljdXJyZW50TWVkaWFJdGVtKS5zZXRFeHRyYWN0Qm91bmRhcmllcyhiZWdpblRpbWVNcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZFRpbWVNcyk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdm9sdW1lUGVyY2VudCA9IEludGVnZXIucGFyc2VJbnQocGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKCIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVRUUl9WT0xVTUUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKE1lZGlhVmlkZW9JdGVtKWN1cnJlbnRNZWRpYUl0ZW0pLnNldFZvbHVtZSh2b2x1bWVQZXJjZW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiVW5rbm93biBtZWRpYSBpdGVtIHR5cGU6ICIgKyB0eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50TWVkaWFJdGVtID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRNZWRpYUl0ZW0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NZWRpYUl0ZW1zLmFkZChjdXJyZW50TWVkaWFJdGVtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChUQUdfVFJBTlNJVElPTi5lcXVhbHMobmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFRyYW5zaXRpb24gdHJhbnNpdGlvbiA9IHBhcnNlVHJhbnNpdGlvbihwYXJzZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zaXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFuc2l0aW9ucy5hZGQodHJhbnNpdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVEFHX09WRVJMQVkuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE1lZGlhSXRlbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE92ZXJsYXkgPSBwYXJzZU92ZXJsYXkocGFyc2VyLCBjdXJyZW50TWVkaWFJdGVtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE92ZXJsYXkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50TWVkaWFJdGVtLmFkZE92ZXJsYXkoY3VycmVudE92ZXJsYXkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChUQUdfT1ZFUkxBWV9VU0VSX0FUVFJJQlVURVMuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE92ZXJsYXkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBhdHRyaWJ1dGVzQ291bnQgPSBwYXJzZXIuZ2V0QXR0cmlidXRlQ291bnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGF0dHJpYnV0ZXNDb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRPdmVybGF5LnNldFVzZXJBdHRyaWJ1dGUocGFyc2VyLmdldEF0dHJpYnV0ZU5hbWUoaSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKGkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVEFHX0VGRkVDVC5lcXVhbHMobmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50TWVkaWFJdGVtICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBFZmZlY3QgZWZmZWN0ID0gcGFyc2VFZmZlY3QocGFyc2VyLCBjdXJyZW50TWVkaWFJdGVtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWZmZWN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE1lZGlhSXRlbS5hZGRFZmZlY3QoZWZmZWN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVEFHX0FVRElPX1RSQUNLLmVxdWFscyhuYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgQXVkaW9UcmFjayBhdWRpb1RyYWNrID0gcGFyc2VBdWRpb1RyYWNrKHBhcnNlcik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXVkaW9UcmFjayAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkQXVkaW9UcmFjayhhdWRpb1RyYWNrKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXNlIFhtbFB1bGxQYXJzZXIuRU5EX1RBRzogeworICAgICAgICAgICAgICAgICAgICBuYW1lID0gcGFyc2VyLmdldE5hbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKFRBR19NRURJQV9JVEVNLmVxdWFscyhuYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE1lZGlhSXRlbSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVEFHX09WRVJMQVkuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50T3ZlcmxheSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgZGVmYXVsdDogeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBldmVudFR5cGUgPSBwYXJzZXIubmV4dCgpOworICAgICAgICB9CisKKyAgICAgICAgY29tcHV0ZVRpbWVsaW5lRHVyYXRpb24oKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBQYXJzZSB0aGUgdHJhbnNpdGlvbgorICAgICAqCisgICAgICogQHBhcmFtIHBhcnNlciBUaGUgcGFyc2VyCisgICAgICogQHJldHVybiBUaGUgdHJhbnNpdGlvbgorICAgICAqLworICAgIHByaXZhdGUgVHJhbnNpdGlvbiBwYXJzZVRyYW5zaXRpb24oWG1sUHVsbFBhcnNlciBwYXJzZXIpIHsKKyAgICAgICAgZmluYWwgU3RyaW5nIHRyYW5zaXRpb25JZCA9IHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZSgiIiwgQVRUUl9JRCk7CisgICAgICAgIGZpbmFsIFN0cmluZyB0eXBlID0gcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKCIiLCBBVFRSX1RZUEUpOworICAgICAgICBmaW5hbCBsb25nIGR1cmF0aW9uTXMgPSBMb25nLnBhcnNlTG9uZyhwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUoIiIsIEFUVFJfRFVSQVRJT04pKTsKKyAgICAgICAgZmluYWwgaW50IGJlaGF2aW9yID0gSW50ZWdlci5wYXJzZUludChwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUoIiIsIEFUVFJfQkVIQVZJT1IpKTsKKworICAgICAgICBmaW5hbCBTdHJpbmcgYmVmb3JlTWVkaWFJdGVtSWQgPSBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUoIiIsIEFUVFJfQkVGT1JFX01FRElBX0lURU1fSUQpOworICAgICAgICBmaW5hbCBNZWRpYUl0ZW0gYmVmb3JlTW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cmFuc2l0aW9uIDogbVRyYW5zaXRpb25zKSB7CisgICAgICAgICAgICBpZiAoIXRyYW5zaXRpb24uaXNHZW5lcmF0ZWQoKSkgeworICAgICAgICAgICAgICAgIHRyYW5zaXRpb24uZ2VuZXJhdGUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2UgdGhlIHVzZXIgbWF5IGhhZCBjYWxsZWQgc2V0RHVyYXRpb24gb24KKyAgICAgICAgLy8gTWVkaWFJbWFnZUl0ZW1zCisgICAgICAgIGNvbXB1dGVUaW1lbGluZUR1cmF0aW9uKCk7CisgICAgfQorCisgICAgLyoKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVsZWFzZSgpIHsKKyAgICAgICAgc3RvcFByZXZpZXcoKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgbG9uZyBnZXREdXJhdGlvbigpIHsKKyAgICAgICAgLy8gU2luY2UgTWVkaWFJbWFnZUl0ZW0gY2FuIGNoYW5nZSBkdXJhdGlvbiB3ZSBuZWVkIHRvIGNvbXB1dGUgdGhlCisgICAgICAgIC8vIGR1cmF0aW9uIGhlcmUKKyAgICAgICAgY29tcHV0ZVRpbWVsaW5lRHVyYXRpb24oKTsKKyAgICAgICAgcmV0dXJuIG1EdXJhdGlvbk1zOworICAgIH0KKworICAgIC8qCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0QXNwZWN0UmF0aW8oKSB7CisgICAgICAgIHJldHVybiBtQXNwZWN0UmF0aW87CisgICAgfQorCisgICAgLyoKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0QXNwZWN0UmF0aW8oaW50IGFzcGVjdFJhdGlvKSB7CisgICAgICAgIG1Bc3BlY3RSYXRpbyA9IGFzcGVjdFJhdGlvOworICAgIH0KKworICAgIC8qCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqLworICAgIHB1YmxpYyBsb25nIHJlbmRlclByZXZpZXdGcmFtZShTdXJmYWNlSG9sZGVyIHN1cmZhY2VIb2xkZXIsIGxvbmcgdGltZU1zKSB7CisgICAgICAgIGlmIChtUHJldmlld1RocmVhZCAhPSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJQcmV2aWV3aW5nIGlzIGluIHByb2dyZXNzIik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRpbWVNczsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgc3RhcnRQcmV2aWV3KFN1cmZhY2VIb2xkZXIgc3VyZmFjZUhvbGRlciwgbG9uZyBmcm9tTXMsIGxvbmcgdG9NcywKKyAgICAgICAgICAgIGJvb2xlYW4gbG9vcCwgaW50IGNhbGxiYWNrQWZ0ZXJGcmFtZUNvdW50LCBQcmV2aWV3UHJvZ3Jlc3NMaXN0ZW5lciBsaXN0ZW5lcikgeworICAgICAgICBpZiAoZnJvbU1zID49IG1EdXJhdGlvbk1zKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgbVByZXZpZXdUaHJlYWQgPSBuZXcgUHJldmlld1RocmVhZChmcm9tTXMsIHRvTXMsIGxvb3AsIGNhbGxiYWNrQWZ0ZXJGcmFtZUNvdW50LCBsaXN0ZW5lcik7CisgICAgICAgIG1QcmV2aWV3VGhyZWFkLnN0YXJ0KCk7CisgICAgfQorCisgICAgLyoKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCBsb25nIHN0b3BQcmV2aWV3KCkgeworICAgICAgICBmaW5hbCBsb25nIHN0b3BUaW1lTXM7CisgICAgICAgIGlmIChtUHJldmlld1RocmVhZCAhPSBudWxsKSB7CisgICAgICAgICAgICBzdG9wVGltZU1zID0gbVByZXZpZXdUaHJlYWQuc3RvcFByZXZpZXcoKTsKKyAgICAgICAgICAgIG1QcmV2aWV3VGhyZWFkID0gbnVsbDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHN0b3BUaW1lTXMgPSAwOworICAgICAgICB9CisgICAgICAgIHJldHVybiBzdG9wVGltZU1zOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbXB1dGUgdGhlIGR1cmF0aW9uCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGNvbXB1dGVUaW1lbGluZUR1cmF0aW9uKCkgeworICAgICAgICBtRHVyYXRpb25NcyA9IDA7CisgICAgICAgIGZpbmFsIGludCBtZWRpYUl0ZW1zQ291bnQgPSBtTWVkaWFJdGVtcy5zaXplKCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbWVkaWFJdGVtc0NvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGZpbmFsIE1lZGlhSXRlbSBtZWRpYUl0ZW0gPSBtTWVkaWFJdGVtcy5nZXQoaSk7CisgICAgICAgICAgICBtRHVyYXRpb25NcyArPSBtZWRpYUl0ZW0uZ2V0VGltZWxpbmVEdXJhdGlvbigpOworICAgICAgICAgICAgaWYgKG1lZGlhSXRlbS5nZXRFbmRUcmFuc2l0aW9uKCkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChpIDwgbWVkaWFJdGVtc0NvdW50IC0gMSkgeworICAgICAgICAgICAgICAgICAgICBtRHVyYXRpb25NcyAtPSBtZWRpYUl0ZW0uZ2V0RW5kVHJhbnNpdGlvbigpLmdldER1cmF0aW9uKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVtb3ZlIHRy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gICAgICAgICBlbmRUcmFuc2l0aW9uLmludmFsaWRhdGUoKTsKKyAgICAgICAgICAgIG1UcmFuc2l0aW9ucy5yZW1vdmUoZW5kVHJhbnNpdGlvbik7CisgICAgICAgIH0KKworICAgICAgICBtZWRpYUl0ZW0uc2V0QmVnaW5UcmFuc2l0aW9uKG51bGwpOworICAgICAgICBtZWRpYUl0ZW0uc2V0RW5kVHJhbnNpdGlvbihudWxsKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZW1vdmUgdGhlIHRyYW5zaXRpb24gYmVmb3JlIHRoaXMgbWVkaWEgaXRlbQorICAgICAqCisgICAgICogQHBhcmFtIGluZGV4IFRoZSBtZWRpYSBpdGVtIGluZGV4CisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHJlbW92ZVRyYW5zaXRpb25CZWZvcmUoaW50IGluZGV4KSB7CisgICAgICAgIGZpbmFsIE1lZGlhSXRlbSBtZWRpYUl0ZW0gPSBtTWVkaWFJdGVtcy5nZXQoaW5kZXgpOworICAgICAgICBmaW5hbCBJdGVyYXRvcjxUcmFuc2l0aW9uPiBpdCA9IG1UcmFuc2l0aW9ucy5pdGVyYXRvcigpOworICAgICAgICB3aGlsZSAoaXQuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICBUcmFuc2l0aW9uIHQgPSBpdC5uZXh0KCk7CisgICAgICAgICAgICBpZiAodC5nZXRCZWZvcmVNZWRpYUl0ZW0oKSA9PSBtZWRpYUl0ZW0pIHsKKyAgICAgICAgICAgICAgICBpdC5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICB0LmludmFsaWRhdGUoKTsKKyAgICAgICAgICAgICAgICBtZWRpYUl0ZW0uc2V0QmVnaW5UcmFuc2l0aW9uKG51bGwpOworICAgICAgICAgICAgICAgIGlmIChpbmRleCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgbU1lZGlhSXRlbXMuZ2V0KGluZGV4IC0gMSkuc2V0RW5kVHJhbnNpdGlvbihudWxsKT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AgICAgbUdhaW5zID0gbnVsbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb25zdHJ1Y3RvcgorICAgICAqCisgICAgICogQHBhcmFtIGF1ZGlvV2F2ZWZvcm1GaWxlbmFtZSBUaGUgbmFtZSBvZiB0aGUgYXVkaW8gd2F2ZWZvcm0gZmlsZQorICAgICAqLworICAgIFdhdmVmb3JtRGF0YShTdHJpbmcgYXVkaW9XYXZlZm9ybUZpbGVuYW1lKSB7CisgICAgICAgIC8vIFRPRE86IFJlYWQgdGhlc2UgdmFsdWVzIGZyb20gdGhlIGZpbGUKKyAgICAgICAgbUZyYW1lRHVyYXRpb25NcyA9IDIwOworICAgICAgICBtRnJhbWVzQ291bnQgPSAzMDAwMDAgLyBtRnJhbWVEdXJhdGlvbk1zOworICAgICAgICBtR2FpbnMgPSBuZXcgc2hvcnRbbUZyYW1lc0NvdW50XTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRnJhbWVzQ291bnQ7IGkrKykgeworICAgICAgICAgICAgbUdhaW5zW2ldID0gKHNob3J0KSgoaSAqIDUpICUgMjU2KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gVGhlIGR1cmF0aW9uIG9mIGEgZnJhbWUgaW4gbWlsbGlzZWNvbmRzCisgICAgICovCisgICAgcHVibGljIGludCBnZXRGcmFtZUR1cmF0aW9uKCkgeworICAgICAgICByZXR1cm4gbUZyYW1lRHVyYXRpb25NczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSBudW1iZXIgb2YgZnJhbWVzIHdpdGhpbiB0aGUgd2F2ZWZvcm0gZGF0YQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0RnJhbWVzQ291bnQoKSB7CisgICAgICAgIHJldHVybiBtRnJhbWVzQ291bnQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgYXJyYXkgb2YgZnJhbWUgZ2F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luaXR9LAogICAgIHsibmF0aXZlX3NldHVwIiwgICAgICAgICIoTGphdmEvbGFuZy9PYmplY3Q7KVYiLCAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVBsYXllcl9uYXRpdmVfc2V0dXB9LAogICAgIHsibmF0aXZlX2ZpbmFsaXplIiwgICAgICIoKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVBsYXllcl9uYXRpdmVfZmluYWxpemV9LAotICAgIHsibmF0aXZlX3N1c3BlbmRfcmVzdW1lIiwgIihaKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVBsYXllcl9uYXRpdmVfc3VzcGVuZF9yZXN1bWV9LAogICAgIHsiZ2V0QXVkaW9TZXNzaW9uSWQiLCAgICIoKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVBsYXllcl9nZXRfYXVkaW9fc2Vzc2lvbl9pZH0sCiAgICAgeyJzZXRBdWRpb1Nlc3Npb25JZCIsICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilhbmRyb2lkX21lZGlhX01lZGlhUGxheWVyX3NldF9hdWRpb19zZXNzaW9uX2lkfSwKICAgICB7InNldEF1eEVmZmVjdFNlbmRMZXZlbCIsICIoRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKWFuZHJvaWRfbWVkaWFfTWVkaWFQbGF5ZXJfc2V0QXV4RWZmZWN0U2VuZExldmVsfSwKQEAgLTc4OCw2ICs3NzQsMTAgQEAKIGV4dGVybiBpbnQgcmVnaXN0ZXJfYW5kcm9pZF9tZWRpYV9NZWRpYVNjYW5uZXIoSk5JRW52ICplbnYpOwogZXh0ZXJuIGludCByZWdpc3Rlcl9hbmRyb2lkX21lZGlhX1J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wUCkpKSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBjYW1jb3JkZXJfcXVhbGl0eSBxID0gc3RhdGljX2Nhc3Q8Y2FtY29yZGVyX3F1YWxpdHk+KHF1YWxpdHkpOworICAgIHJldHVybiBzUHJvZmlsZXMtPmhhc0NhbWNvcmRlclByb2ZpbGUoaWQsIHEpOworfQorCiBzdGF0aWMgamludAogYW5kcm9pZF9tZWRpYV9NZWRpYVByb2ZpbGVzX25hdGl2ZV9nZXRfbnVtX3ZpZGVvX2RlY29kZXJzKEpOSUVudiAqZW52LCBqb2JqZWN0IHRoaXopCiB7CkBAIC0yODksNiArMzA1LDggQEAKICAgICB7Im5hdGl2ZV9pbml0IiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIigpViIsICAgICAgICAgICAgICAgICAgICAodm9pZCAqKWFuZHJvaWRfbWVkaWFfTWVkaWFQcm9maWxlc19uYXRpdmVfaW5pdH0sCiAgICAgeyJuYXRpdmVfZ2V0X2NhbWNvcmRlcl9wcm9maWxlIiwgICAgICAgICAgICIoSUkpTGFuZHJvaWQvbWVkaWEvQ2FtY29yZGVyUHJvZmlsZTsiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVByb2ZpbGVzX25hdGl2ZV9nZXRfY2FtY29yZGVyX3Byb2ZpbGV9LAorICAgIHsibmF0aXZlX2hhc19jYW1jb3JkZXJfcHJvZmlsZSIsICAgICAgICAgICAiKElJKVoiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVByb2ZpbGVzX25hdGl2ZV9oYXNfY2FtY29yZGVyX3Byb2ZpbGV9LAogfTsKIAogc3RhdGljIEpOSU5hdGl2ZU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ZvaWQgICAgZGV2aWNlUmVtb3ZlZChNdHBEZXZpY2UgKmRldmljZSk7CisKKyAgICBqb2JqZWN0ICAgICAgICAgbUNsaWVudDsKKyAgICBNdHBEZXZpY2UqICAgICAgbUV2ZW50RGV2aWNlOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgIE15Q2xpZW50KEpOSUVudiAqZW52LCBqb2JqZWN0IGNsaWVudCk7CisgICAgdm9pZCAgICAgICAgICAgIGNsZWFudXAoSk5JRW52ICplbnYpOworfTsKKworTXRwQ2xpZW50KiBnZXRfY2xpZW50X2Zyb21fb2JqZWN0KEpOSUVudiogZW52LCBqb2JqZWN0IGphdmFDbGllbnQpCit7CisgICAgcmV0dXJuIChNdHBDbGllbnQqKWVudi0+R2V0SW50RmllbGQoamF2YUNsaWVudCwgZmllbGRfY29udGV4dCk7Cit9CisKKworTXlDbGllbnQ6Ok15Q2xpZW50KEpOSUVudiAqZW52LCBqb2JqZWN0IGNsaWVudCkKKyAgICA6ICAgbUNsaWVudChlbnYtPk5ld0dsb2JhbFJlZihjbGllbnQpKQoreworfQorCit2b2lkIE15Q2xpZW50OjpjbGVhbnVwKEpOSUVudiAqZW52KSB7CisgICAgZW52LT5EZWxldGVHbG9iYWxSZWYobUNsaWVudCk7Cit9CisKK3ZvaWQgTXlDbGllbnQ6OmRldmljZUFkZGVkKE10cERldmljZSAqZGV2aWNlKSB7CisgICAgSk5JRW52KiBlbnYgPSBBbmRyb2lkUnVudGltZTo6Z2V0Sk5JRW52KCk7CisgICAgY29uc3QgY2hhciogbmFtZSA9IGRldmljZS0+Z2V0RGV2aWNlTmFtZSgpOworICAgIExPR0QoIk15Q2xpZW50OjpkZXZpY2VBZGRlZCAlc1xuIiwgbmFtZSk7CisKKyAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG1DbGllbnQsIG1ldGhvZF9kZXZpY2VBZGRlZCwgZGV2aWNlLT5nZXRJRCgpKTsKKworICAgIGNoZWNrQW5kQ2xlYXJFeGNlcHRpb25Gcm9tQ2FsbGJhY2soZW52LCBfX0ZVTkNUSU9OX18pOworfQorCit2b2lkIE15Q2xpZW50OjpkZXZpY2VSZW1vdmVkKE10cERldmljZSAqZGV2aWNlKSB7CisgICAgSk5JRW52KiBlbnYgPSBBbmRyb2lkUnVudGltZTo6Z2V0Sk5JRW52KCk7CisgICAgY29uc3QgY2hhciogbmFtZSA9IGRldmljZS0+Z2V0RGV2aWNlTmFtZSgpOworICAgIExPR0QoIk15Q2xpZW50OjpkZXZpY2VSZW1vdmVkICVzXG4iLCBuYW1lKTsKKworICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobUNsaWVudCwgbWV0aG9kX2RldmljZVJlbW92ZWQsIGRldmljZS0+Z2V0SUQoKSk7CisKKyAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKK30KKworI2VuZGlmIC8vIEhBVkVfQU5EUk9JRF9PUworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK3N0YXRpYyB2b2lkCithbmRyb2lkX21lZGlhX010cENsaWVudF9zZXR1cChKTklFbnYgKmVudiwgam9iamVjdCB0aGl6KQoreworI2lmZGVmIEhBVkVfQU5EUk9JRF9PUworICAgIExPR0QoInNldHVwXG4iKTsKKyAgICBNeUNsaWVudCogY2xpZW50ID0gbmV3IE15Q2xpZW50KGVudiwgdGhpeik7CisgICAgY2xpZW50LT5zdGFydCgpOworICAgIGVudi0+U2V0SW50RmllbGQodGhpeiwgZmllbGRfY29udGV4dCwgKGludCljbGllbnQpOworI2VuZGlmCit9CisKK3N0YXRpYyB2b2lkCithbmRyb2lkX21lZGlhX010cENsaWVudF9maW5hbGl6ZShKTklFbnYgKmVudiwgam9iamVjdCB0aGl6KQoreworI2lmZGVmIEhBVkVfQU5EUk9JRF9PUworICAgIExPR0QoImZpbmFsaXplXG4iKTsKKyAgICBNeUNsaWVudCAqY2xpZW50ID0gKE15Q2xpZW50ICopZW52LT5HZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0KTsKKyAgICBjbGllbnQtPmNsZWFudXAoZW52KTsKKyAgICBkZWxldGUgY2xpZW50OworICAgIGVudi0+U2V0SW50RmllbGQodGhpeiwgZmllbGRfY29udGV4dCwgMCk7CisjZW5kaWYKK30KKworc3RhdGljIGpib29sZWFuCithbmRyb2lkX21lZGlhX010cENsaWVudF9zdGFydChKTklFbnYgKmVudiwgam9iamVjdCB0aGl6KQoreworI2lmZGVmIEhBVkVfQU5EUk9JRF9PUworICAgIExPR0QoInN0YXJ0XG4iKTsKKyAgICBNeUNsaWVudCAqY2xpZW50ID0gKE15Q2xpZW50ICopZW52LT5HZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0KTsKKyAgICByZXR1cm4gY2xpZW50LT5zdGFydCgpOworI2Vsc2UKKyAgICByZXR1cm4gZmFsc2U7CisjZW5kaWYKK30KKworc3RhdGljIHZvaWQKK2FuZHJvaWRfbWVkaWFfTXRwQ2xpZW50X3N0b3AoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeikKK3sKKyNpZmRlZiBIQVZFX0FORFJPSURfT1MKKyAgICBMT0dEKCJzdG9wXG4iKTsKKyAgICBNeUNsaWVudCAqY2xpZW50ID0gKE15Q2xpZW50ICopZW52LT5HZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0KTsKKyAgICBjbGllbnQtPnN0b3AoKTsKKyNlbmRpZgorfQorCitzdGF0aWMgamJvb2xlYW4KK2FuZHJvaWRfbWVkaWFfTXRwQ2xpZW50X2RlbGV0ZV9vYmplY3QoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwKKyAgICAgICAgamludCBkZXZpY2VfaWQsIGpsb25nIG9iamVjdF9pZCkKK3sKKyNpZmRlZiBIQVZFX0FORFJPSURfT1MKKyAgICBNeUNsaWVudCAqY2xpZW50ID0gKE15Q2xpZW50ICopZW52LT5HZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0KTsKKyAgICBNdHBEZXZpY2UqIGRldmljZSA9IGNsaWVudC0+Z2V0RGV2aWNlKGRldmljZV9pZCk7CisgICAgaWYgKGRldmljZSkKKyAgICAgICAgcmV0dXJuIGRldmljZS0+ZGVsZXRlT2JqZWN0KG9iamVjdF9pZCk7CisgICAgZWxzZQorICNlbmRpZgorICAgICAgICByZXR1cm4gTlVMTDsKK30KKworc3RhdGljIGpsb25nCithbmRyb2lkX21lZGlhX010cENsaWVudF9nZXRfcGFyZW50KEpOSUVudiAqZW52LCBqb2JqZWN0IHRoaXosCisgICAgICAgIGppbnQgZGV2aWNlX2lkLCBqbG9uZyBvYmplY3RfaWQpCit7CisjaWZkZWYgSEFWRV9BTkRST0lEX09TCisgICAgTXlDbGllbnQgKmNsaWVudCA9IChNeUNsaWVudCAqKWVudi0+R2V0SW50RmllbGQodGhpeiwgZmllbGRfY29udGV4dCk7CisgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBjbGllbnQtPmdldERldmljZShkZXZpY2VfaWQpOworICAgIGlmIChkZXZpY2UpCisgICAgICAgIHJldHVybiBkZXZpY2UtPmdldFBhcmVudChvYmplY3RfaWQpOworICAgIGVsc2UKKyNlbmRpZgorICAgICAgICByZXR1cm4gLTE7Cit9CisKK3N0YXRpYyBqbG9uZworYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRfZ2V0X3N0b3JhZ2VfaWQoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwKKyAgICAgICAgamludCBkZXZpY2VfaWQsIGpsb25nIG9iamVjdF9pZCkKK3sKKyAjaWZkZWYgSEFWRV9BTkRST0lEX09TCisgICAgTXlDbGllbnQgKmNsaWVudCA9IChNeUNsaWVudCAqKWVudi0+R2V0SW50RmllbGQodGhpeiwgZmllbGRfY29udGV4dCk7CisgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBjbGllbnQtPmdldERldmljZShkZXZpY2VfaWQpOworICAgIGlmIChkZXZpY2UpCisgICAgICAgIHJldHVybiBkZXZpY2UtPmdldFN0b3JhZ2VJRChvYmplY3RfaWQpOworICAgIGVsc2UKKyNlbmRpZgorICAgICAgICByZXR1cm4gLTE7Cit9CisKK3N0YXRpYyBqb2JqZWN0CithbmRyb2lkX21lZGlhX010cENsaWVudF9vcGVuX2ZpbGUoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwKKyAgICAgICAgamludCBkZXZpY2VfaWQsIGpsb25nIG9iamVjdF9pZCkKK3sKKyNpZmRlZiBIQVZFX0FORFJPSURfT1MKKyAgICBNeUNsaWVudCAqY2xpZW50ID0gKE15Q2xpZW50ICopZW52LT5HZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0KTsKKyAgICBNdHBEZXZpY2UqIGRldmljZSA9IGNsaWVudC0+Z2V0RGV2aWNlKGRldmljZV9pZCk7CisgICAgaWYgKCFkZXZpY2UpCisgICAgICAgIHJldHVybiBOVUxMOworCisgICAgTXRwT2JqZWN0SW5mbyogaW5mbyA9IGRldmljZS0+Z2V0T2JqZWN0SW5mbyhvYmplY3RfaWQpOworICAgIGlmICghaW5mbykKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgaW50IG9iamVjdF9zaXplID0gaW5mby0+bUNvbXByZXNzZWRTaXplOworICAgIGRlbGV0ZSBpbmZvOworICAgIGludCBmZCA9IGRldmljZS0+cmVhZE9iamVjdChvYmplY3RfaWQsIG9iamVjdF9zaXplKTsKKyAgICBpZiAoZmQgPCAwKQorICAgICAgICByZXR1cm4gTlVMTDsKKworICAgIGpvYmplY3QgZmlsZURlc2NyaXB0b3IgPSBlbnYtPk5ld09iamVjdChnRmlsZURlc2NyaXB0b3JPZmZzZXRzLm1DbGFzcywKKyAgICAgICAgZ0ZpbGVEZXNjcmlwdG9yT2Zmc2V0cy5tQ29uc3RydWN0b3IpOworICAgIGlmIChmaWxlRGVzY3JpcHRvciAhPSBOVUxMKSB7CisgICAgICAgIGVudi0+U2V0SW50RmllbGQoZmlsZURlc2NyaXB0b3IsIGdGaWxlRGVzY3JpcHRvck9mZnNldHMubURlc2NyaXB0b3IsIGZkKTsKKyAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisgICAgcmV0dXJuIGVudi0+TmV3T2JqZWN0KGdQYXJjZWxGaWxlRGVzY3JpcHRvck9mZnNldHMubUNsYXNzLAorICAgICAgICBnUGFyY2VsRmlsZURlc2NyaXB0b3JPZmZzZXRzLm1Db25zdHJ1Y3RvciwgZmlsZURlc2NyaXB0b3IpOworI2VuZGlmCisgICAgcmV0dXJuIE5VTEw7Cit9CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworc3RhdGljIEpOSU5hdGl2ZU1ldGhvZCBnTWV0aG9kc1tdID0geworICAgIHsibmF0aXZlX3NldHVwIiwgICAgICAgICAgICAiKClWIiwgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRfc2V0dXB9LAorICAgIHsibmF0aXZlX2ZpbmFsaXplIiwgICAgICAgICAiKClWIiwgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRfZmluYWxpemV9LAorICAgIHsibmF0aXZlX3N0YXJ0IiwgICAgICAgICAgICAiKClaIiwgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRfc3RhcnR9LAorICAgIHsibmF0aXZlX3N0b3AiLCAgICAgICAgICAgICAiKClWIiwgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRfc3RvcH0sCisgICAgeyJuYXRpdmVfZGVsZXRlX29iamVjdCIsICAgIihJSilaIiwgKHZvaWQgKilhbmRyb2lkX21lZGlhX010cENsaWVudF9kZWxldGVfb2JqZWN0fSwKKyAgICB7Im5hdGl2ZV9nZXRfcGFyZW50IiwgICAgICAiKElKKUoiLCAodm9pZCAqKWFuZHJvaWRfbWVkaWFfTXRwQ2xpZW50X2dldF9wYXJlbnR9LAorICAgIHsibmF0aXZlX2dldF9zdG9yYWdlX2lkIiwgICIoSUopSiIsICh2b2lkICopYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRfZ2V0X3N0b3JhZ2VfaWR9LAorICAgIHsibmF0aXZlX29wZW5fZmlsZSIsICAgICAgICIoSUopTGFuZHJvaWQvb3MvUGFyY2VsRmlsZURlc2NyaXB0b3I7IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKWFuZHJvaWRfbWVkaWFfTXRwQ2xpZW50X29wZW5fZmlsZX0sCit9OworCitzdGF0aWMgY29uc3QgY2hhciogY29uc3Qga0NsYXNzUGF0aE5hbWUgPSAiYW5kcm9pZC9tZWRpYS9NdHBDbGllbnQiOworCitpbnQgcmVnaXN0ZXJfYW5kcm9pZF9tZWRpYV9NdHBDbGllbnQoSk5JRW52ICplbnYpCit7CisgICAgamNsYXNzIGNsYXp6OworCisgICAgTE9HRCgicmVnaXN0ZXJfYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRcbiIpOworCisgICAgY2xhenogPSBlbnYtPkZpbmRDbGFzcygiYW5kcm9pZC9tZWRpYS9NdHBDbGllbnQiKTsKKyAgICBpZiAoY2xhenogPT0gTlVMTCkgeworICAgICAgICBMT0dFKCJDYW4ndCBmaW5kIGFuZHJvaWQvbWVkaWEvTXRwQ2xpZW50Iik7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisgICAgbWV0aG9kX2RldmljZUFkZGVkID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgImRldmljZUFkZGVkIiwgIihJKVYiKTsKKyAgICBpZiAobWV0aG9kX2RldmljZUFkZGVkID09IE5VTEwpIHsKKyAgICAgICAgTE9HR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wKKyAgICAgICAgamludCBxdWVyeVR5cGUsIGppbnQgZGV2aWNlSUQsIGpsb25nIHN0b3JhZ2VJRCwgamxvbmcgb2JqZWN0SUQsIGppbnRBcnJheSBqYXZhQ29sdW1ucykKK3sKKyNpZmRlZiBIQVZFX0FORFJPSURfT1MKKyAgICBMT0dEKCJhbmRyb2lkX21lZGlhX010cEN1cnNvcl9zZXR1cCBxdWVyeVR5cGU6ICVkIGRldmljZUlEOiAlZCBzdG9yYWdlSUQ6ICVsbGQgb2JqZWN0SUQ6ICVsbGRcbiIsCisgICAgICAgICAgICAgICAgcXVlcnlUeXBlLCBkZXZpY2VJRCwgc3RvcmFnZUlELCBvYmplY3RJRCk7CisKKyAgICBpbnQqIGNvbHVtbnMgPSBOVUxMOworICAgIGludCBjb2x1bW5Db3VudCA9IDA7CisgICAgaWYgKGphdmFDb2x1bW5zKSB7CisgICAgICAgIGNvbHVtbnMgPSBlbnYtPkdldEludEFycmF5RWxlbWVudHMoamF2YUNvbHVtbnMsIDApOworICAgICAgICBjb2x1bW5Db3VudCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoamF2YUNvbHVtbnMpOworICAgIH0KKworICAgIE10cENsaWVudCogY2xpZW50ID0gZ2V0X2NsaWVudF9mcm9tX29iamVjdChlbnYsIGphdmFDbGllbnQpOworICAgIE10cEN1cnNvciogY3Vyc29yID0gbmV3IE10cEN1cnNvcihjbGllbnQsIHF1ZXJ5VHlwZSwKKyAgICAgICAgICAgIGRldmljZUlELCBzdG9yYWdlSUQsIG9iamVjdElELCBjb2x1bW5Db3VudCwgY29sdW1ucyk7CisKKyAgICBpZiAoY29sdW1ucykKKyAgICAgICAgZW52LT5SZWxlYXNlSW50QXJyYXlFbGVtZW50cyhqYXZhQ29sdW1ucywgY29sdW1ucywgMCk7CisgICAgZW52LT5TZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0LCAoaW50KWN1cnNvcik7CisjZW5kaWYKK30KKworc3RhdGljIHZvaWQKK2FuZHJvaWRfbWVkaWFfTXRwQ3Vyc29yX2ZpbmFsaXplKEpOSUVudiAqZW52LCBqb2JqZWN0IHRoaXopCit7CisjaWZkZWYgSEFWRV9BTkRST0lEX09TCisgICAgTE9HRCgiZmluYWxpemVcbiIpOworICAgIE10cEN1cnNvciAqY3Vyc29yID0gKE10cEN1cnNvciAqKWVudi0+R2V0SW50RmllbGQodGhpeiwgZmllbGRfY29udGV4dCk7CisgICAgZGVsZXRlIGN1cnNvcjsKKyNlbmRpZgorfQorCitzdGF0aWMgamludAorYW5kcm9pZF9tZWRpYV9NdHBDdXJzb3JfZmlsbF93aW5kb3coSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwgam9iamVjdCBqYXZhV2luZG93LCBqaW50IHN0YXJ0UG9zKQoreworI2lmZGVmIEhBVkVfQU5EUk9JRF9PUworICAgIEN1cnNvcldpbmRvdyogd2luZG93ID0gZ2V0X3dpbmRvd19mcm9tX29iamVjdChlbnYsIGphdmFXaW5kb3cpOworICAgIGlmICghd2luZG93KSB7CisgICAgICAgIExPR0UoIkludmFsaWQgQ3Vyc29yV2luZG93Iik7CisgICAgICAgIGpuaVRocm93RXhjZXB0aW9uKGVudiwgImphdmEvbGFuZy9JbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiQmFkIEN1cnNvcldpbmRvdyIpOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgICAgTXRwQ3Vyc29yICpjdXJzb3IgPSAoTXRwQ3Vyc29yICopZW52LT5HZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0KTsKKworICAgIHJldHVybiBjdXJzb3ItPmZpbGxXaW5kb3cod2luZG93LCBzdGFydFBvcyk7CisjZWxzZQorICAgIHJldHVybiAwOworI2VuZGlmCit9CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworc3RhdGljIEpOSU5hdGl2ZU1ldGhvZCBnTWV0aG9kc1tdID0geworICAgIHsibmF0aXZlX3NldHVwIiwgICAgICAgICAgICAiKExhbmRyb2lkL21lZGlhL010cENsaWVudDtJSUpKW0kpViIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilhbmRyb2lkX21lZGlhX010cEN1cnNvcl9zZXR1cH0sCisgICAgeyJuYXRpdmVfZmluYWxpemUiLCAgICAgICAgICIoKVYiLCAgKHZvaWQgKilhbmRyb2lkX21lZGlhX010cEN1cnNvcl9maW5hbGl6ZX0sCisgICAgeyJuYXRpdmVfZmlsbF93aW5kb3ciLCAgICAgICIoTGFuZHJvaWQvZGF0YWJhc2UvQ3Vyc29yV2luZG93O0kpSSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilhbmRyb2lkX21lZGlhX010cEN1cnNvcl9maWxsX3dpbmRvd30sCisKK307CisKK3N0YXRpYyBjb25zdCBjaGFyKiBjb25zdCBrQ2xhc3NQYXRoTmFtZSA9ICJhbmRyb2lkL21lZGlhL010cEN1cnNvciI7CisKK2ludCByZWdpc3Rlcl9hbmRyb2lkX21lZGlhX010cEN1cnNvcihKTklFbnYgKmVudikKK3sKKyAgICBqY2xhc3MgY2xheno7CisKKyAgICBMT0dEKCJyZWdpc3Rlcl9hbmRyb2lkX21lZGlhX010cEN1cnNvclxuIik7CisKKyAgICBjbGF6eiA9IGVudi0+RmluZENsYXNzKCJhbmRyb2lkL21lZGlhL010cEN1cnNvciIpOworICAgIGlmIChjbGF6eiA9PSBOVUxMKSB7CisgICAgICAgIExPR0UoIkNhbid0IGZpbmQgYW5kcm9pZC9tZWRpYS9NdHBDdXJzb3IiKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBmaWVsZF9jb250ZXh0ID0gZW52LT5HZXRGaWVsZElEKGNsYXp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3Nlc3Npb25TdGFydGVkOworc3RhdGljIGptZXRob2RJRCBtZXRob2Rfc2Vzc2lvbkVuZGVkOworCitzdGF0aWMgamZpZWxkSUQgZmllbGRfY29udGV4dDsKKworTXRwRGF0YWJhc2UqIGdldE10cERhdGFiYXNlKEpOSUVudiAqZW52LCBqb2JqZWN0IGRhdGFiYXNlKSB7CisgICAgcmV0dXJuIChNdHBEYXRhYmFzZSAqKWVudi0+R2V0SW50RmllbGQoZGF0YWJhc2UsIGZpZWxkX2NvbnRleHQpOworfQorCisjaWZkZWYgSEFWRV9BTkRST0lEX09TCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK2NsYXNzIE15TXRwRGF0YWJhc2UgOiBwdWJsaWMgTXRwRGF0YWJhc2UgeworcHJpdmF0ZToKKyAgICBqb2JqZWN0ICAgICAgICAgbURhdGFiYXNlOworICAgIGppbnRBcnJheSAgICAgICBtSW50QnVmZmVyOworICAgIGpsb25nQXJyYXkgICAgICBtTG9uZ0J1ZmZlcjsKKyAgICBqY2hhckFycmF5ICAgICAgbVN0cmluZ0J1ZmZlcjsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXlNdHBEYXRhYmFzZShKTklFbnYgKmVudiwgam9iamVjdCBjbGllbnQpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgICAgICAgICAgICAgfk15TXRwRGF0YWJhc2UoKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFudXAoSk5JRW52ICplbnYpOworCisgICAgdmlydHVhbCBNdHBPYmplY3RIYW5kbGUgICAgICAgICBiZWdpblNlbmRPYmplY3QoY29uc3QgY2hhciogcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUlEIHN0b3JhZ2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ2NF90IHNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVfdCBtb2RpZmllZCk7CisKKyAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICAgICAgICAgIGVuZFNlbmRPYmplY3QoY29uc3QgY2hhciogcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBzdWNjZWVkZWQpOworCisgICAgdmlydHVhbCBNdHBPYmplY3RIYW5kbGVMaXN0KiAgICBnZXRPYmplY3RMaXN0KE10cFN0b3JhZ2VJRCBzdG9yYWdlSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCk7CisKKyAgICB2aXJ0dWFsIGludCAgICAgICAgICAgICAgICAgICAgIGdldE51bU9iamVjdHMoTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCk7CisKKyAgICAvLyBjYWxsZWUgc2hvdWxkIGRlbGV0ZVtdIHRoZSByZXN1bHRzIGZyb20gdGhlc2UKKyAgICAvLyByZXN1bHRzIGNhbiBiZSBOVUxMCisgICAgdmlydHVhbCBNdHBPYmplY3RGb3JtYXRMaXN0KiAgICBnZXRTdXBwb3J0ZWRQbGF5YmFja0Zvcm1hdHMoKTsKKyAgICB2aXJ0dWFsIE10cE9iamVjdEZvcm1hdExpc3QqICAgIGdldFN1cHBvcnRlZENhcHR1cmVGb3JtYXRzKCk7CisgICAgdmlydHVhbCBNdHBPYmplY3RQcm9wZXJ0eUxpc3QqICBnZXRTdXBwb3J0ZWRPYmplY3RQcm9wZXJ0aWVzKE10cE9iamVjdEZvcm1hdCBmb3JtYXQpOworICAgIHZpcnR1YWwgTXRwRGV2aWNlUHJvcGVydHlMaXN0KiAgZ2V0U3VwcG9ydGVkRGV2aWNlUHJvcGVydGllcygpOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RQcm9wZXJ0eVZhbHVlKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdFByb3BlcnR5IHByb3BlcnR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBzZXRPYmplY3RQcm9wZXJ0eVZhbHVlKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdFByb3BlcnR5IHByb3BlcnR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXREZXZpY2VQcm9wZXJ0eVZhbHVlKE10cERldmljZVByb3BlcnR5IHByb3BlcnR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBzZXREZXZpY2VQcm9wZXJ0eVZhbHVlKE10cERldmljZVByb3BlcnR5IHByb3BlcnR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICByZXNldERldmljZVByb3BlcnR5KE10cERldmljZVByb3BlcnR5IHByb3BlcnR5KTsKKworICAgIHZpcnR1YWwgTXRwUmVzcG9uc2VDb2RlICAgICAgICAgZ2V0T2JqZWN0SW5mbyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RGaWxlUGF0aChNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBTdHJpbmcmIGZpbGVQYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ2NF90JiBmaWxlTGVuZ3RoKTsKKyAgICB2aXJ0dWFsIE10cFJlc3BvbnNlQ29kZSAgICAgICAgIGRlbGV0ZUZpbGUoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSk7CisKKyAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldE9iamVjdFByb3BlcnR5SW5mbyhNdHBPYmplY3RQcm9wZXJ0eSBwcm9wZXJ0eSwgaW50JiB0eXBlKTsKKyAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldERldmljZVByb3BlcnR5SW5mbyhNdHBEZXZpY2VQcm9wZXJ0eSBwcm9wZXJ0eSwgaW50JiB0eXBlKTsKKworICAgIHZpcnR1YWwgTXRwT2JqZWN0SGFuZGxlTGlzdCogICAgZ2V0T2JqZWN0UmVmZXJlbmNlcyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlKTsKKworICAgIHZpcnR1YWwgTXRwUmVzcG9uc2VDb2RlICAgICAgICAgc2V0T2JqZWN0UmVmZXJlbmNlcyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGVMaXN0KiByZWZlcmVuY2VzKTsKKworICAgIHZpcnR1YWwgTXRwUHJvcGVydHkqICAgICAgICAgICAgZ2V0T2JqZWN0UHJvcGVydHlEZXNjKE10cE9iamVjdFByb3BlcnR5IHByb3BlcnR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0KTsKKworICAgIHZpcnR1YWwgTXRwUHJvcGVydHkqICAgICAgICAgICAgZ2V0RGV2aWNlUHJvcGVydHlEZXNjKE10cERldmljZVByb3BlcnR5IHByb3BlcnR5KTsKKworICAgIHZpcnR1YWwgdm9pZCAgICAgICAgICAgICAgICAgICAgc2Vzc2lvblN0YXJ0ZWQoKTsKKworICAgIHZpcnR1YWwgdm9pZCAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbkVuZGVkKCk7Cit9OworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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nJheSllbnYtPk5ld0dsb2JhbFJlZihpbnRBcnJheSk7CisgICAgbG9uZ0FycmF5ID0gZW52LT5OZXdMb25nQXJyYXkoMik7CisgICAgaWYgKCFsb25nQXJyYXkpCisgICAgICAgIGdvdG8gb3V0X29mX21lbW9yeTsKKyAgICBtTG9uZ0J1ZmZlciA9IChqbG9uZ0FycmF5KWVudi0+TmV3R2xvYmFsUmVmKGxvbmdBcnJheSk7CisgICAgY2hhckFycmF5ID0gZW52LT5OZXdDaGFyQXJyYXkoMjU2KTsKKyAgICBpZiAoIWNoYXJBcnJheSkKKyAgICAgICAgZ290byBvdXRfb2ZfbWVtb3J5OworICAgIG1TdHJpbmdCdWZmZXIgPSAoamNoYXJBcnJheSllbnYtPk5ld0dsb2JhbFJlZihjaGFyQXJyYXkpOworICAgIHJldHVybjsKKworb3V0X29mX21lbW9yeToKKyAgICBlbnYtPlRocm93TmV3KGVudi0+RmluZENsYXNzKCJqYXZhL2xhbmcvT3V0T2ZNZW1vcnlFcnJvciIpLCBOVUxMKTsKK30KKwordm9pZCBNeU10cERhdGFiYXNlOjpjbGVhbnVwKEpOSUVudiAqZW52KSB7CisgICAgZW52LT5EZWxldGVHbG9iYWxSZWYobURhdGFiYXNlKTsKKyAgICBlbnYtPkRlbGV0ZUdsb2JhbFJlZihtSW50QnVmZmVyKTsKKyAgICBlbnYtPkRlbGV0ZUdsb2JhbFJlZihtTG9uZ0J1ZmZlcik7CisgICAgZW52LT5EZWxldGVHbG9iYWxSZWYobVN0cmluZ0J1ZmZlcik7Cit9CisKK015TXRwRGF0YWJhc2U6On5NeU10cERhdGFiYXNlKCkgeworfQorCitNdHBPYmplY3RIYW5kbGUgTXlNdHBEYXRhYmFzZTo6YmVnaW5TZW5kT2JqZWN0KGNvbnN0IGNoYXIqIHBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBwYXJlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2VJRCBzdG9yYWdlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50NjRfdCBzaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lX3QgbW9kaWZpZWQpIHsKKyAgICBKTklFbnYqIGVudiA9IEFuZHJvaWRSdW50aW1lOjpnZXRKTklFbnYoKTsKKyAgICBqc3RyaW5nIHBhdGhTdHIgPSBlbnYtPk5ld1N0cmluZ1VURihwYXRoKTsKKyAgICBNdHBPYmplY3RIYW5kbGUgcmVzdWx0ID0gZW52LT5DYWxsSW50TWV0aG9kKG1EYXRhYmFzZSwgbWV0aG9kX2JlZ2luU2VuZE9iamVjdCwKKyAgICAgICAgICAgIHBhdGhTdHIsIChqaW50KWZvcm1hdCwgKGppbnQpcGFyZW50LCAoamludClzdG9yYWdlLAorICAgICAgICAgICAgKGpsb25nKXNpemUsIChqbG9uZyltb2RpZmllZCk7CisKKyAgICBpZiAocGF0aFN0cikKKyAgICAgICAgZW52LT5EZWxldGVMb2NhbFJlZihwYXRoU3RyKTsKKyAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCit2b2lkIE15TXRwRGF0YWJhc2U6OmVuZFNlbmRPYmplY3QoY29uc3QgY2hhciogcGF0aCwgTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwgYm9vbCBzdWNjZWVkZWQpIHsKKyAgICBKTklFbnYqIGVudiA9IEFuZHJvaWRSdW50aW1lOjpnZXRKTklFbnYoKTsKKyAgICBqc3RyaW5nIHBhdGhTdHIgPSBlbnYtPk5ld1N0cmluZ1VURihwYXRoKTsKKyAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG1EYXRhYmFzZSwgbWV0aG9kX2VuZFNlbmRPYmplY3QsIHBhdGhTdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAoamludCloYW5kbGUsIChqaW50KWZvcm1hdCwgKGpib29sZWFuKXN1Y2NlZWRlZCk7CisKKyAgICBpZiAocGF0aFN0cikKKyAgICAgICAgZW52LT5EZWxldGVMb2NhbFJlZihwYXRoU3RyKTsKKyAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKK30KKworTXRwT2JqZWN0SGFuZGxlTGlzdCogTXlNdHBEYXRhYmFzZTo6Z2V0T2JqZWN0TGlzdChNdHBTdG9yYWdlSUQgc3RvcmFnZUlELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBwYXJlbnQpIHsKKyAgICBKTklFbnYqIGVudiA9IEFuZHJvaWRSdW50aW1lOjpnZXRKTklFbnYoKTsKKyAgICBqaW50QXJyYXkgYXJyYXkgPSAoamludEFycmF5KWVudi0+Q2FsbE9iamVjdE1ldGhvZChtRGF0YWJhc2UsIG1ldGhvZF9nZXRPYmplY3RMaXN0LAorICAgICAgICAgICAgICAgIChqaW50KXN0b3JhZ2VJRCwgKGppbnQpZm9ybWF0LCAoamludClwYXJlbnQpOworICAgIGlmICghYXJyYXkpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIE10cE9iamVjdEhhbmRsZUxpc3QqIGxpc3QgPSBuZXcgTXRwT2JqZWN0SGFuZGxlTGlzdCgpOworICAgIGppbnQqIGhhbmRsZXMgPSBlbnYtPkdldEludEFycmF5RWxlbWVudHMoYXJyYXksIDApOworICAgIGpzaXplIGxlbmd0aCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoYXJyYXkpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspCisgICAgICAgIGxpc3QtPnB1c2goaGFuZGxlc1tpXSk7CisgICAgZW52LT5SZWxlYXNlSW50QXJyYXlFbGVtZW50cyhhcnJheSwgaGFuZGxlcywgMCk7CisgICAgZW52LT5EZWxldGVMb2NhbFJlZihhcnJheSk7CisKKyAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gbGlzdDsKK30KKworaW50IE15TXRwRGF0YWJhc2U6OmdldE51bU9iamVjdHMoTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCkgeworICAgIEpOSUVudiogZW52ID0gQW5kcm9pZFJ1bnRpbWU6OmdldEpOSUVudigpOworICAgIGludCByZXN1bHQgPSBlbnYtPkNhbGxJbnRNZXRob2QobURhdGFiYXNlLCBtZXRob2RfZ2V0TnVtT2JqZWN0cywKKyAgICAgICAgICAgICAgICAoamludClzdG9yYWdlSUQsIChqaW50KWZvcm1hdCwgKGppbnQpcGFyZW50KTsKKworICAgIGNoZWNrQW5kQ2xlYXJFeGNlcHRpb25Gcm9tQ2FsbGJhY2soZW52LCBfX0ZVTkNUSU9OX18pOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK010cE9iamVjdEZvcm1hdExpc3QqIE15TXRwRGF0YWJhc2U6OmdldFN1cHBvcnRlZFBsYXliYWNrRm9ybWF0cygpIHsKKyAgICBKTklFbnYqIGVudiA9IEFuZHJvaWRSdW50aW1lOjp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bnRzKGFycmF5LCAwKTsKKyAgICBqc2l6ZSBsZW5ndGggPSBlbnYtPkdldEFycmF5TGVuZ3RoKGFycmF5KTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKQorICAgICAgICBsaXN0LT5wdXNoKHByb3BlcnRpZXNbaV0pOworICAgIGVudi0+UmVsZWFzZUludEFycmF5RWxlbWVudHMoYXJyYXksIHByb3BlcnRpZXMsIDApOworICAgIGVudi0+RGVsZXRlTG9jYWxSZWYoYXJyYXkpOworCisgICAgY2hlY2tBbmRDbGVhckV4Y2VwdGlvbkZyb21DYWxsYmFjayhlbnYsIF9fRlVOQ1RJT05fXyk7CisgICAgcmV0dXJuIGxpc3Q7Cit9CisKK010cERldmljZVByb3BlcnR5TGlzdCogTXlNdHBEYXRhYmFzZTo6Z2V0U3VwcG9ydGVkRGV2aWNlUHJvcGVydGllcygpIHsKKyAgICBKTklFbnYqIGVudiA9IEFuZHJvaWRSdW50aW1lOjpnZXRKTklFbnYoKTsKKyAgICBqaW50QXJyYXkgYXJyYXkgPSAoamludEFycmF5KWVudi0+Q2FsbE9iamVjdE1ldGhvZChtRGF0YWJhc2UsCisgICAgICAgICAgICBtZXRob2RfZ2V0U3VwcG9ydGVkRGV2aWNlUHJvcGVydGllcyk7CisgICAgaWYgKCFhcnJheSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwRGV2aWNlUHJvcGVydHlMaXN0KiBsaXN0ID0gbmV3IE10cERldmljZVByb3BlcnR5TGlzdCgpOworICAgIGppbnQqIHByb3BlcnRpZXMgPSBlbnYtPkdldEludEFycmF5RWxlbWVudHMoYXJyYXksIDApOworICAgIGpzaXplIGxlbmd0aCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoYXJyYXkpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspCisgICAgICAgIGxpc3QtPnB1c2gocHJvcGVydGllc1tpXSk7CisgICAgZW52LT5SZWxlYXNlSW50QXJyYXlFbGVtZW50cyhhcnJheSwgcHJvcGVydGllcywgMCk7CisgICAgZW52LT5EZWxldGVMb2NhbFJlZihhcnJheSk7CisKKyAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gbGlzdDsKK30KKworTXRwUmVzcG9uc2VDb2RlIE15TXRwRGF0YWJhc2U6OmdldE9iamVjdFByb3BlcnR5VmFsdWUoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0UHJvcGVydHkgcHJvcGVydHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQmIHBhY2tldCkgeworICAgIGludCAgICAgICAgIHR5cGU7CisKKyAgICBpZiAoIWdldE9iamVjdFByb3BlcnR5SW5mbyhwcm9wZXJ0eSwgdHlwZSkpCisgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfT0JKRUNUX1BST1BfTk9UX1NVUFBPUlRFRDsKKworICAgIEpOSUVudiogZW52ID0gQW5kcm9pZFJ1bnRpbWU6OmdldEpOSUVudigpOworICAgIGppbnQgcmVzdWx0ID0gZW52LT5DYWxsSW50TWV0aG9kKG1EYXRhYmFzZSwgbWV0aG9kX2dldE9iamVjdFByb3BlcnR5LAorICAgICAgICAgICAgICAgIChqaW50KWhhbmRsZSwgKGppbnQpcHJvcGVydHksIG1Mb25nQnVmZmVyLCBtU3RyaW5nQnVmZmVyKTsKKyAgICBpZiAocmVzdWx0ICE9IE1UUF9SRVNQT05TRV9PSykgeworICAgICAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBqbG9uZyogbG9uZ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2UgTVRQX1RZUEVfSU5UODoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQ4KGxvbmdWYWx1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UODoKKyAgICAgICAgICAgIHBhY2tldC5wdXRVSW50OChsb25nVmFsdWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMTY6CisgICAgICAgICAgICBwYWNrZXQucHV0SW50MTYobG9uZ1ZhbHVlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQxNjoKKyAgICAgICAgICAgIHBhY2tldC5wdXRVSW50MTYobG9uZ1ZhbHVlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDMyOgorICAgICAgICAgICAgcGFja2V0LnB1dEludDMyKGxvbmdWYWx1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMzI6CisgICAgICAgICAgICBwYWNrZXQucHV0VUludDMyKGxvbmdWYWx1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ2NDoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQ2NChsb25nVmFsdWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDY0OgorICAgICAgICAgICAgcGFja2V0LnB1dFVJbnQ2NChsb25nVmFsdWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMTI4OgorICAgICAgICAgICAgcGFja2V0LnB1dEludDEyOChsb25nVmFsdWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDEyODoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQxMjgobG9uZ1ZhbHVlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1NUUjoKKyAgICAgICAgeworICAgICAgICAgICAgamNoYXIqIHN0ciA9IGVudi0+R2V0Q2hhckFycmF5RWxlbWVudHMobVN0cmluZ0J1ZmZlciwgMCk7CisgICAgICAgICAgICBwYWNrZXQucHV0U3RyaW5nKHN0cik7CisgICAgICAgICAgICBlbnYtPlJlbGVhc2VDaGFyQXJyYXlFbGVtZW50cyhtU3RyaW5nQnVmZmVyLCBzdHIsIDApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBMT0dFKCJ1bnN1cHBvcnRlZCB0eXBlIGluIGdldE9iamVjdFByb3BlcnR5VmFsdWVcbiIpOworICAgICAgICAgICAgcmV0dXJuIE1UUF9SRVNQT05TRV9JTlZBTElEX09CSkVDVF9QUk9QX0ZPUk1BVDsKKyAgICB9CisKKyAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gTVRQX1JFU1BPTlNFX09LOworfQorCitNdHBSZXNwb25zZUNvZGUgTXlNdHBEYXRhYmFzZTo6c2V0T2JqZWN0UHJvcGVydHlWYWx1ZShNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RQcm9wZXJ0eSBwcm9wZXJ0eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldCYgcGFja2V0KSB7CisgICAgaW50ICAgICAgICAgdHlwZTsKKworICAgIGlmICghZ2V0T2JqZWN0UHJvcGVydHlJbmZvKHByb3BlcnR5LCB0eXBlKSkKKyAgICAgICAgcmV0dXJuIE1UUF9SRVNQT05TRV9PQkpFQ1RfUFJPUF9OT1RfU1VQUE9SVEVEOworCisgICAgSk5JRW52KiBlbnYgPSBBbmRyb2lkUnVudGltZTo6Z2V0Sk5JRW52KCk7CisgICAgamxvbmcgbG9uZ1ZhbHVlID0gMDsKKyAgICBqc3RyaW5nIHN0cmluZ1ZhbHVlID0gTlVMTDsKKworICAgIHN3aXRjaCAodHlwZSkgeworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDg6CisgICAgICAgICAgICBsb25nVmFsdWUgPSBwYWNrZXQuZ2V0SW50OCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDg6CisgICAgICAgICAgICBsb25nVmFsdWUgPSBwYWNrZXQuZ2V0VUludDgoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDE2OgorICAgICAgICAgICAgbG9uZ1ZhbHVlID0gcGFja2V0LmdldEludDE2KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMTY6CisgICAgICAgICAgICBsb25nVmFsdWUgPSBwYWNrZXQuZ2V0VUludDE2KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQzMjoKKyAgICAgICAgICAgIGxvbmdWYWx1ZSA9IHBhY2tldC5nZXRJbnQzMigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDMyOgorICAgICAgICAgICAgbG9uZ1ZhbHVlID0gcGFja2V0LmdldFVJbnQzMigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UNjQ6CisgICAgICAgICAgICBsb25nVmFsdWUgPSBwYWNrZXQuZ2V0SW50NjQoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ2NDoKKyAgICAgICAgICAgIGxvbmdWYWx1ZSA9IHBhY2tldC5nZXRVSW50NjQoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1NUUjoKKyAgICAgICAgeworICAgICAgICAgICAgTXRwU3RyaW5nQnVmZmVyIGJ1ZmZlcjsKKyAgICAgICAgICAgIHBhY2tldC5nZXRTdHJpbmcoYnVmZmVyKTsKKyAgICAgICAgICAgIHN0cmluZ1ZhbHVlID0gZW52LT5OZXdTdHJpbmdVVEYoKGNvbnN0IGNoYXIgKilidWZmZXIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBMT0dFKCJ1bnN1cHBvcnRlZCB0eXBlIGluIGdldE9iamVjdFByb3BlcnR5VmFsdWVcbiIpOworICAgICAgICAgICAgcmV0dXJuIE1UUF9SRVNQT05TRV9JTlZBTElEX09CSkVDVF9QUk9QX0ZPUk1BVDsKKyAgICB9CisKKyAgICBqaW50IHJlc3VsdCA9IGVudi0+Q2FsbEludE1ldGhvZChtRGF0YWJhc2UsIG1ldGhvZF9zZXRPYmplY3RQcm9wZXJ0eSwKKyAgICAgICAgICAgICAgICAoamludCloYW5kbGUsIChqaW50KXByb3BlcnR5LCBsb25nVmFsdWUsIHN0cmluZ1ZhbHVlKTsKKyAgICBpZiAoc3RyaW5nVmFsdWUpCisgICAgICAgIGVudi0+RGVsZXRlTG9jYWxSZWYoc3RyaW5nVmFsdWUpOworCisgICAgY2hlY2tBbmRDbGVhckV4Y2VwdGlvbkZyb21DYWxsYmFjayhlbnYsIF9fRlVOQ1RJT05fXyk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworTXRwUmVzcG9uc2VDb2RlIE15TXRwRGF0YWJhc2U6OmdldERldmljZVByb3BlcnR5VmFsdWUoTXRwRGV2aWNlUHJvcGVydHkgcHJvcGVydHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQmIHBhY2tldCkgeworICAgIGludCAgICAgICAgIHR5cGU7CisKKyAgICBpZiAoIWdldERldmljZVByb3BlcnR5SW5mbyhwcm9wZXJ0eSwgdHlwZSkpCisgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfREVWSUNFX1BST1BfTk9UX1NVUFBPUlRFRDsKKworICAgIEpOSUVudiogZW52ID0gQW5kcm9pZFJ1bnRpbWU6OmdldEpOSUVudigpOworICAgIGppbnQgcmVzdWx0ID0gZW52LT5DYWxsSW50TWV0aG9kKG1EYXRhYmFzZSwgbWV0aG9kX2dldERldmljZVByb3BlcnR5LAorICAgICAgICAgICAgICAgIChqaW50KXByb3BlcnR5LCBtTG9uZ0J1ZmZlciwgbVN0cmluZ0J1ZmZlcik7CisgICAgaWYgKHJlc3VsdCAhPSBNVFBfUkVTUE9OU0VfT0spIHsKKyAgICAgICAgY2hlY2tBbmRDbGVhckV4Y2VwdGlvbkZyb21DYWxsYmFjayhlbnYsIF9fRlVOQ1RJT05fXyk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgamxvbmcqIGxvbmdWYWx1ZXMgPSBlbnYtPkdldExvbmdBcnJheUVsZW1lbnRzKG1Mb25nQnVmZmVyLCAwKTsKKyAgICBqbG9uZyBsb25nVmFsdWUgPSBsb25nVmFsdWVzWzBdOworICAgIGVudi0+UmVsZWFzZUxvbmdBcnJheUVsZW1lbnRzKG1Mb25nQnVmZmVyLCBsb25nVmFsdWVzLCAwKTsKKworICAgIHN3aXRjaCAodHlwZSkgeworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDg6CisgICAgICAgICAgICBwYWNrZXQucHV0SW50OChsb25nVmFsdWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDg6CisgICAgICAgICAgICBwYWNrZXQucHV0VUludDgobG9uZ1ZhbHVlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDE2OgorICAgICAgICAgICAgcGFja2V0LnB1dEludDE2KGxvbmdWYWx1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMTY6CisgICAgICAgICAgICBwYWNrZXQucHV0VUludDE2KGxvbmdWYWx1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQzMjoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQzMihsb25nVmFsdWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDMyOgorICAgICAgICAgICAgcGFja2V0LnB1dFVJbnQzMihsb25nVmFsdWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UNjQ6CisgICAgICAgICAgICBwYWNrZXQucHV0SW50NjQobG9uZ1ZhbHVlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ2NDoKKyAgICAgICAgICAgIHBhY2tldC5wdXRVSW50NjQobG9uZ1ZhbHVlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDEyODoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQxMjgobG9uZ1ZhbHVlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQxMjg6CisgICAgICAgICAgICBwYWNrZXQucHV0SW50MTI4KGxvbmdWYWx1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9TVFI6CisgICAgICAgIHsKKyAgICAgICAgICAgIGpjaGFyKiBzdHIgPSBlbnYtPkdldENoYXJBcnJheUVsZW1lbnRzKG1TdHJpbmdCdWZmZXIsIDApOworICAgICAgICAgICAgcGFja2V0LnB1dFN0cmluZyhzdHIpOworICAgICAgICAgICAgZW52LT5SZWxlYXNlQ2hhckFycmF5RWxlbWVudHMobVN0cmluZ0J1ZmZlciwgc3RyLCAwKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgTE9HRSgidW5zdXBwb3J0ZWQgdHlwZSBpbiBnZXREZXZpY2VQcm9wZXJ0eVZhbHVlXG4iKTsKKyAgICAgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfSU5WQUxJRF9ERVZJQ0VfUFJPUF9GT1JNQVQ7CisgICAgfQorCisgICAgY2hlY2tBbmRDbGVhckV4Y2VwdGlvbkZyb21DYWxsYmFjayhlbnYsIF9fRlVOQ1RJT05fXyk7CisgICAgcmV0dXJuIE1UUF9SRVNQT05TRV9PSzsKK30KKworTXRwUmVzcG9uc2VDb2RlIE15TXRwRGF0YWJhc2U6OnNldERldmljZVByb3BlcnR5VmFsdWUoTXRwRGV2aWNlUHJvcGVydHkgcHJvcGVydHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQmIHBhY2tldCkgeworICAgIGludCAgICAgICAgIHR5cGU7CisKKyAgICBpZiAoIWdldERldmljZVByb3BlcnR5SW5mbyhwcm9wZXJ0eSwgdHlwZSkpCisgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfREVWSUNFX1BST1BfTk9UX1NVUFBPUlRFRDsKKworICAgIEpOSUVudiogZW52ID0gQW5kcm9pZFJ1bnRpbWU6OmdldEpOSUVudigpOworICAgIGpsb25nIGxvbmdWYWx1ZSA9IDA7CisgICAganN0cmluZyBzdHJpbmdWYWx1ZSA9IE5VTEw7CisKKyAgICBzd2l0Y2ggKHR5cGUpIHsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ4OgorICAgICAgICAgICAgbG9uZ1ZhbHVlID0gcGFja2V0LmdldEludDgoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ4OgorICAgICAgICAgICAgbG9uZ1ZhbHVlID0gcGFja2V0LmdldFVJbnQ4KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQxNjoKKyAgICAgICAgICAgIGxvbmdWYWx1ZSA9IHBhY2tldC5nZXRJbnQxNigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDE2OgorICAgICAgICAgICAgbG9uZ1ZhbHVlID0gcGFja2V0LmdldFVJbnQxNigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMzI6CisgICAgICAgICAgICBsb25nVmFsdWUgPSBwYWNrZXQuZ2V0SW50MzIoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQzMjoKKyAgICAgICAgICAgIGxvbmdWYWx1ZSA9IHBhY2tldC5nZXRVSW50MzIoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDY0OgorICAgICAgICAgICAgbG9uZ1ZhbHVlID0gcGFja2V0LmdldEludDY0KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UNjQ6CisgICAgICAgICAgICBsb25nVmFsdWUgPSBwYWNrZXQuZ2V0VUludDY0KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9TVFI6CisgICAgICAgIHsKKyAgICAgICAgICAgIE10cFN0cmluZ0J1ZmZlciBidWZmZXI7CisgICAgICAgICAgICBwYWNrZXQuZ2V0U3RyaW5nKGJ1ZmZlcik7CisgICAgICAgICAgICBzdHJpbmdWYWx1ZSA9IGVudi0+TmV3U3RyaW5nVVRGKChjb25zdCBjaGFyICopYnVmZmVyKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgTE9HRSgidW5zdXBwb3J0ZWQgdHlwZSBpbiBzZXREZXZpY2VQcm9wZXJ0eVZhbHVlXG4iKTsKKyAgICAgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfUFJPUF9GT1JNQVQ7CisgICAgfQorCisgICAgamludCByZXN1bHQgPSBlbnYtPkNhbGxJbnRNZXRob2QobURhdGFiYXNlLCBtZXRob2Rfc2V0RGV2aWNlUHJvcGVydHksCisgICAgICAgICAgICAgICAgKGppbnQpcHJvcGVydHksIGxvbmdWYWx1ZSwgc3RyaW5nVmFsdWUpOworICAgIGlmIChzdHJpbmdWYWx1ZSkKKyAgICAgICAgZW52LT5EZWxldGVMb2NhbFJlZihzdHJpbmdWYWx1ZSk7CisKKyAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitNdHBSZXNwb25zZUNvZGUgTXlNdHBEYXRhYmFzZTo6cmVzZXREZXZpY2VQcm9wZXJ0eShNdHBEZXZpY2VQcm9wZXJ0eSBwcm9wZXJ0eSkgeworICAgIHJldHVybiAtMTsKK30KKworTXRwUmVzcG9uc2VDb2RlIE15TXRwRGF0YWJhc2U6OmdldE9iamVjdEluZm8oTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldCYgcGFja2V0KSB7CisgICAgY2hhciAgICBkYXRlWzIwXTsKKworICAgIEpOSUVudiogZW52ID0gQW5kcm9pZFJ1bnRpbWU6OmdldEpOSUVudigpOworICAgIGpib29sZWFuIHJlc3VsdCA9IGVudi0+Q2FsbEJvb2xlYW5NZXRob2QobURhdGFiYXNlLCBtZXRob2RfZ2V0T2JqZWN0SW5mbywKKy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Q2hhckFycmF5RWxlbWVudHMobVN0cmluZ0J1ZmZlciwgc3RyLCAwKTsKKworICAgIHBhY2tldC5wdXRFbXB0eVN0cmluZygpOworICAgIGZvcm1hdERhdGVUaW1lKG1vZGlmaWVkLCBkYXRlLCBzaXplb2YoZGF0ZSkpOworICAgIHBhY2tldC5wdXRTdHJpbmcoZGF0ZSk7ICAgLy8gZGF0ZSBtb2RpZmllZAorICAgIHBhY2tldC5wdXRFbXB0eVN0cmluZygpOyAgIC8vIGtleXdvcmRzCisKKyAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gTVRQX1JFU1BPTlNFX09LOworfQorCitNdHBSZXNwb25zZUNvZGUgTXlNdHBEYXRhYmFzZTo6Z2V0T2JqZWN0RmlsZVBhdGgoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwU3RyaW5nJiBmaWxlUGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50NjRfdCYgZmlsZUxlbmd0aCkgeworICAgIEpOSUVudiogZW52ID0gQW5kcm9pZFJ1bnRpbWU6OmdldEpOSUVudigpOworICAgIGppbnQgcmVzdWx0ID0gZW52LT5DYWxsSW50TWV0aG9kKG1EYXRhYmFzZSwgbWV0aG9kX2dldE9iamVjdEZpbGVQYXRoLAorICAgICAgICAgICAgICAgIChqaW50KWhhbmRsZSwgbVN0cmluZ0J1ZmZlciwgbUxvbmdCdWZmZXIpOworICAgIGlmIChyZXN1bHQgIT0gTVRQX1JFU1BPTlNFX09LKSB7CisgICAgICAgIGNoZWNrQW5kQ2xlYXJFeGNlcHRpb25Gcm9tQ2FsbGJhY2soZW52LCBfX0ZVTkNUSU9OX18pOworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIGpjaGFyK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NpemVvZihrT2JqZWN0UHJvcGVydHlUYWJsZVswXSk7CisgICAgY29uc3QgUHJvcGVydHlUYWJsZUVudHJ5KiBlbnRyeSA9IGtPYmplY3RQcm9wZXJ0eVRhYmxlOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKywgZW50cnkrKykgeworICAgICAgICBpZiAoZW50cnktPnByb3BlcnR5ID09IHByb3BlcnR5KSB7CisgICAgICAgICAgICB0eXBlID0gZW50cnktPnR5cGU7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZmFsc2U7Cit9CisKK2Jvb2wgTXlNdHBEYXRhYmFzZTo6Z2V0RGV2aWNlUHJvcGVydHlJbmZvKE10cERldmljZVByb3BlcnR5IHByb3BlcnR5LCBpbnQmIHR5cGUpIHsKKyAgICBpbnQgY291bnQgPSBzaXplb2Yoa0RldmljZVByb3BlcnR5VGFibGUpIC8gc2l6ZW9mKGtEZXZpY2VQcm9wZXJ0eVRhYmxlWzBdKTsKKyAgICBjb25zdCBQcm9wZXJ0eVRhYmxlRW50cnkqIGVudHJ5ID0ga0RldmljZVByb3BlcnR5VGFibGU7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrLCBlbnRyeSsrKSB7CisgICAgICAgIGlmIChlbnRyeS0+cHJvcGVydHkgPT0gcHJvcGVydHkpIHsKKyAgICAgICAgICAgIHR5cGUgPSBlbnRyeS0+dHlwZTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBmYWxzZTsKK30KKworTXRwT2JqZWN0SGFuZGxlTGlzdCogTXlNdHBEYXRhYmFzZTo6Z2V0T2JqZWN0UmVmZXJlbmNlcyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlKSB7CisgICAgSk5JRW52KiBlbnYgPSBBbmRyb2lkUnVudGltZTo6Z2V0Sk5JRW52KCk7CisgICAgamludEFycmF5IGFycmF5ID0gKGppbnRBcnJheSllbnYtPkNhbGxPYmplY3RNZXRob2QobURhdGFiYXNlLCBtZXRob2RfZ2V0T2JqZWN0UmVmZXJlbmNlcywKKyAgICAgICAgICAgICAgICAoamludCloYW5kbGUpOworICAgIGlmICghYXJyYXkpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIE10cE9iamVjdEhhbmRsZUxpc3QqIGxpc3QgPSBuZXcgTXRwT2JqZWN0SGFuZGxlTGlzdCgpOworICAgIGppbnQqIGhhbmRsZXMgPSBlbnYtPkdldEludEFycmF5RWxlbWVudHMoYXJyYXksIDApOworICAgIGpzaXplIGxlbmd0aCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoYXJyYXkpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspCisgICAgICAgIGxpc3QtPnB1c2goaGFuZGxlc1tpXSk7CisgICAgZW52LT5SZWxlYXNlSW50QXJyYXlFbGVtZW50cyhhcnJheSwgaGFuZGxlcywgMCk7CisgICAgZW52LT5EZWxldGVMb2NhbFJlZihhcnJheSk7CisKKyAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gbGlzdDsKK30KKworTXRwUmVzcG9uc2VDb2RlIE15TXRwRGF0YWJhc2U6OnNldE9iamVjdFJlZmVyZW5jZXMoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGVMaXN0KiByZWZlcmVuY2VzKSB7CisgICAgSk5JRW52KiBlbnYgPSBBbmRyb2lkUnVudGltZTo6Z2V0Sk5JRW52KCk7CisgICAgaW50IGNvdW50ID0gcmVmZXJlbmNlcy0+c2l6ZSgpOworICAgIGppbnRBcnJheSBhcnJheSA9IGVudi0+TmV3SW50QXJyYXkoY291bnQpOworICAgIGlmICghYXJyYXkpIHsKKyAgICAgICAgTE9HRSgib3V0IG9mIG1lbW9yeSBpbiBzZXRPYmplY3RSZWZlcmVuY2VzIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgamludCogaGFuZGxlcyA9IGVudi0+R2V0SW50QXJyYXlFbGVtZW50cyhhcnJheSwgMCk7CisgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgaGFuZGxlc1tpXSA9ICgqcmVmZXJlbmNlcylbaV07CisgICAgZW52LT5SZWxlYXNlSW50QXJyYXlFbGVtZW50cyhhcnJheSwgaGFuZGxlcywgMCk7CisgICAgTXRwUmVzcG9uc2VDb2RlIHJlc3VsdCA9IGVudi0+Q2FsbEludE1ldGhvZChtRGF0YWJhc2UsIG1ldGhvZF9zZXRPYmplY3RSZWZlcmVuY2VzLAorICAgICAgICAgICAgICAgIChqaW50KWhhbmRsZSwgYXJyYXkpOworICAgIGVudi0+RGVsZXRlTG9jYWxSZWYoYXJyYXkpOworCisgICAgY2hlY2tBbmRDbGVhckV4Y2VwdGlvbkZyb21DYWxsYmFjayhlbnYsIF9fRlVOQ1RJT05fXyk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworTXRwUHJvcGVydHkqIE15TXRwRGF0YWJhc2U6OmdldE9iamVjdFByb3BlcnR5RGVzYyhNdHBPYmplY3RQcm9wZXJ0eSBwcm9wZXJ0eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCkgeworICAgIE10cFByb3BlcnR5KiByZXN1bHQgPSBOVUxMOworICAgIHN3aXRjaCAocHJvcGVydHkpIHsKKyAgICAgICAgY2FzZSBNVFBfUFJPUEVSVFlfT0JKRUNUX0ZPUk1BVDoKKyAgICAgICAgY2FzZSBNVFBfUFJPUEVSVFlfUFJPVEVDVElPTl9TVEFUVVM6CisgICAgICAgIGNhc2UgTVRQX1BST1BFUlRZX1RSQUNLOgorICAgICAgICAgICAgcmVzdWx0ID0gbmV3IE10cFByb3BlcnR5KHByb3BlcnR5LCBNVFBfVFlQRV9VSU5UMTYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1BST1BFUlRZX1NUT1JBR0VfSUQ6CisgICAgICAgIGNhc2UgTVRQX1BST1BFUlRZX1BBUkVOVF9PQkpFQ1Q6CisgICAgICAgIGNhc2UgTVRQX1BST1BFUlRZX0RVUkFUSU9OOgorICAgICAgICAgICAgcmVzdWx0ID0gbmV3IE10cFByb3BlcnR5KHByb3BlcnR5LCBNVFBfVFlQRV9VSU5UMzIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1BST1BFUlRZX09CSkVDVF9TSVpFOgorICAgICAgICAgICAgcmVzdWx0ID0gbmV3IE10cFByb3BlcnR5KHByb3BlcnR5LCBNVFBfVFlQRV9VSU5UNjQpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1BST1BFUlRZX1BFUlNJU1RFTlRfVUlEOgorICAgICAgICAgICAgcmVzdWx0ID0gbmV3IE10cFByb3BlcnR5KHByb3BlcnR5LCBNVFBfVFlQRV9VSU5UMTI4KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9QUk9QRVJUWV9OQU1FOgorICAgICAgICBjYXNlIE1UUF9QUk9QRVJUWV9EQVRFX01PRElGSUVEOgorICAgICAgICBjYXNlIE1UUF9QUk9QRVJUWV9ESVNQTEFZX05BTUU6CisgICAgICAgIGNhc2UgTVRQX1BST1BFUlRZX0RBVEVfQURERUQ6CisgICAgICAgIGNhc2UgTVRQX1BST1BFUlRZX0FSVElTVDoKKyAgICAgICAgY2FzZSBNVFBfUFJPUEVSVFlfQUxCVU1fTkFNRToKKyAgICAgICAgY2FzZSBNVFBfUFJPUEVSVFlfQUxCVU1fQVJUSVNUOgorICAgICAgICB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ICAgIC8vIHNldCBjdXJyZW50IHZhbHVlCisgICAgICAgICAgICBKTklFbnYqIGVudiA9IEFuZHJvaWRSdW50aW1lOjpnZXRKTklFbnYoKTsKKyAgICAgICAgICAgIGppbnQgcmV0ID0gZW52LT5DYWxsSW50TWV0aG9kKG1EYXRhYmFzZSwgbWV0aG9kX2dldERldmljZVByb3BlcnR5LAorICAgICAgICAgICAgICAgICAgICAgICAgKGppbnQpcHJvcGVydHksIG1Mb25nQnVmZmVyLCBtU3RyaW5nQnVmZmVyKTsKKyAgICAgICAgICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKSB7CisgICAgICAgICAgICAgICAgamNoYXIqIHN0ciA9IGVudi0+R2V0Q2hhckFycmF5RWxlbWVudHMobVN0cmluZ0J1ZmZlciwgMCk7CisgICAgICAgICAgICAgICAgcmVzdWx0LT5zZXRDdXJyZW50VmFsdWUoc3RyKTsKKyAgICAgICAgICAgICAgICBlbnYtPlJlbGVhc2VDaGFyQXJyYXlFbGVtZW50cyhtU3RyaW5nQnVmZmVyLCBzdHIsIDApOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBMT0dFKCJ1bmFibGUgdG8gcmVhZCBkZXZpY2UgcHJvcGVydHksIHJlc3BvbnNlOiAlMDRYIiwgcmV0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2hlY2tBbmRDbGVhckV4Y2VwdGlvbkZyb21DYWxsYmFjayhlbnYsIF9fRlVOQ1RJT05fXyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK3ZvaWQgTXlNdHBEYXRhYmFzZTo6c2Vzc2lvblN0YXJ0ZWQoKSB7CisgICAgSk5JRW52KiBlbnYgPSBBbmRyb2lkUnVudGltZTo6Z2V0Sk5JRW52KCk7CisgICAgZW52LT5DYWxsVm9pZE1ldGhvZChtRGF0YWJhc2UsIG1ldGhvZF9zZXN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pZiAoY2xhenogPT0gTlVMTCkgeworICAgICAgICBMT0dFKCJDYW4ndCBmaW5kIGFuZHJvaWQvbWVkaWEvTXRwRGF0YWJhc2UiKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBtZXRob2RfYmVnaW5TZW5kT2JqZWN0ID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgImJlZ2luU2VuZE9iamVjdCIsICIoTGphdmEvbGFuZy9TdHJpbmc7SUlJSkopSSIpOworICAgIGlmIChtZXRob2RfYmVnaW5TZW5kT2JqZWN0ID09IE5VTEwpIHsKKyAgICAgICAgTE9HRSgiQ2FuJ3QgZmluZCBiZWdpblNlbmRPYmplY3QiKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBtZXRob2RfZW5kU2VuZE9iamVjdCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJlbmRTZW5kT2JqZWN0IiwgIihMamF2YS9sYW5nL1N0cmluZztJSVopViIpOworICAgIGlmIChtZXRob2RfZW5kU2VuZE9iamVjdCA9PSBOVUxMKSB7CisgICAgICAgIExPR0UoIkNhbid0IGZpbmQgZW5kU2VuZE9iamVjdCIpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorICAgIG1ldGhvZF9nZXRPYmplY3RMaXN0ID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgImdldE9iamVjdExpc3QiLCAiKElJSSlbSSIpOworICAgIGlmIChtZXRob2RfZ2V0T2JqZWN0TGlzdCA9PSBOVUxMKSB7CisgICAgICAgIExPR0UoIkNhbid0IGZpbmQgZ2V0T2JqZWN0TGlzdCIpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorICAgIG1ldGhvZF9nZXROdW1PYmplY3RzID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgImdldE51bU9iamVjdHMiLCAiKElJSSlJIik7CisgICAgaWYgKG1ldGhvZF9nZXROdW1PYmplY3RzID09IE5VTEwpIHsKKyAgICAgICAgTE9HR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ldHVybiAtMTsKKyAgICB9CisgICAgbWV0aG9kX3NldERldmljZVByb3BlcnR5ID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgInNldERldmljZVByb3BlcnR5IiwgIihJSkxqYXZhL2xhbmcvU3RyaW5nOylJIik7CisgICAgaWYgKG1ldGhvZF9zZXREZXZpY2VQcm9wZXJ0eSA9PSBOVUxMKSB7CisgICAgICAgIExPR0UoIkNhbid0IGZpbmQgc2V0RGV2aWNlUHJvcGVydHkiKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBtZXRob2RfZ2V0T2JqZWN0SW5mbyA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJnZXRPYmplY3RJbmZvIiwgIihJW0lbQ1tKKVoiKTsKKyAgICBpZiAobWV0aG9kX2dldE9iamVjdEluZm8gPT0gTlVMTCkgeworICAgICAgICBMT0dFKCJDYW4ndCBmaW5kIGdldE9iamVjdEluZm8iKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBtZXRob2RfZ2V0T2JqZWN0RmlsZVBhdGggPSBlbnYtPkdldE1ldGhvZElEKGNsYXp6LCAiZ2V0T2JqZWN0RmlsZVBhdGgiLCAiKElbQ1tKKUkiKTsKKyAgICBpZiAobWV0aG9kX2dldE9iamVjdEZpbGVQYXRoID09IE5VTEwpIHsKKyAgICAgICAgTE9HRSgiQ2FuJ3QgZmluZCBnZXRPYmplY3RGaWxlUGF0aCIpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorICAgIG1ldGhvZF9kZWxldGVGaWxlID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgImRlbGV0ZUZpbGUiLCAiKEkpSSIpOworICAgIGlmIChtZXRob2RfZGVsZXRlRmlsZSA9PSBOVUxMKSB7CisgICAgICAgIExPR0UoIkNhbid0IGZpbmQgZGVsZXRlRmlsZSIpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorICAgIG1ldGhvZF9nZXRPYmplY3RSZWZlc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phdmFTZXJ2ZXIpLAorICAgICAgICAgICAgbUZkKC0xKQorICAgIHsKKyAgICB9CisKKyAgICB2b2lkIHNldFB0cE1vZGUoYm9vbCB1c2VQdHApIHsKKyAgICAgICAgc011dGV4LmxvY2soKTsKKyAgICAgICAgaWYgKG1GZCA+PSAwKSB7CisgICAgICAgICAgICBpb2N0bChtRmQsIE1UUF9TRVRfSU5URVJGQUNFX01PREUsCisgICAgICAgICAgICAgICAgICAgICh1c2VQdHAgPyBNVFBfSU5URVJGQUNFX01PREVfUFRQIDogTVRQX0lOVEVSRkFDRV9NT0RFX01UUCkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaW50IGZkID0gb3BlbigiL2Rldi9tdHBfdXNiIiwgT19SRFdSKTsKKyAgICAgICAgICAgIGlmIChmZCA+PSAwKSB7CisgICAgICAgICAgICAgICAgaW9jdGwoZmQsIE1UUF9TRVRfSU5URVJGQUNFX01PREUsCisgICAgICAgICAgICAgICAgICAgICAgICAodXNlUHRwID8gTVRQX0lOVEVSRkFDRV9NT0RFX1BUUCA6IE1UUF9JTlRFUkZBQ0VfTU9ERV9NVFApKTsKKyAgICAgICAgICAgICAgICBjbG9zZShmZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgc011dGV4LnVubG9jaygpOworICAgIH0KKworICAgIHZpcnR1YWwgYm9vbCB0aHJlYWRMb29wKCkgeworICAgICAgICBzTXV0ZXgubG9jaygpOworICAgICAgICBtRmQgPSBvcGVuKCIvZGV2L210cF91c2IiLCBPX1JEV1IpOworICAgICAgICBwcmludGYoIm9wZW4gcmV0dXJuZWQgJWRcbiIsIG1GZCk7CisgICAgICAgIGlmIChtRmQgPCAwKSB7CisgICAgICAgICAgICBMT0dFKCJjb3VsZCBub3Qgb3BlbiBNVFAgZHJpdmVyXG4iKTsKKyAgICAgICAgICAgIHNNdXRleC51bmxvY2soKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIG1TZXJ2ZXIgPSBuZXcgTXRwU2VydmVyKG1GZCwgbURhdGFiYXNlLCBBSURfU0RDQVJEX1JXLCAwNjY0LCAwNzc1KTsKKyAgICAgICAgbVNlcnZlci0+YWRkU3RvcmFnZShtU3RvcmFnZVBhdGgpOworICAgICAgICBzTXV0ZXgudW5sb2NrKCk7CisKKyAgICAgICAgTE9HRCgiTXRwVGhyZWFkIG1TZXJ2ZXItPnJ1biIpOworICAgICAgICBtU2VydmVyLT5ydW4oKTsKKworICAgICAgICBzTXV0ZXgubG9jaygpOworICAgICAgICBjbG9zZShtRmQpOworICAgICAgICBtRmQgPSAtMTsKKyAgICAgICAgZGVsZXRlIG1TZXJ2ZXI7CisgICAgICAgIG1TZXJ2ZXIgPSBOVUxMOworCisgICAgICAgIEpOSUVudiogZW52ID0gQW5kcm9pZFJ1bnRpbWU6OmdldEpOSUVudigpOworICAgICAgICBlbnYtPlNldEludEZpZWxkKG1KYXZhU2VydmVyLCBmaWVsZF9jb250ZXh0LCAwKTsKKyAgICAgICAgZW52LT5EZWxldGVHbG9iYWxSZWYobUphdmFTZXJ2ZXIpOworICAgICAgICBzTXV0ZXgudW5sb2NrKCk7CisKKyAgICAgICAgTE9HRCgidGhyZWFkTG9vcCByZXR1cm5pbmciKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHZvaWQgc2VuZE9iamVjdEFkZGVkKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpIHsKKyAgICAgICAgc011dGV4LmxvY2soKTsKKyAgICAgICAgaWYgKG1TZXJ2ZXIpCisgICAgICAgICAgICBtU2VydmVyLT5zZW5kT2JqZWN0QWRkZWQoaGFuZGxlKTsKKyAgICAgICAgc011dGV4LnVubG9jaygpOworICAgIH0KKworICAgIHZvaWQgc2VuZE9iamVjdFJlbW92ZWQoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSkgeworICAgICAgICBzTXV0ZXgubG9jaygpOworICAgICAgICBpZiAobVNlc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bGUpOworI2VuZGlmCit9CisKK3N0YXRpYyB2b2lkCithbmRyb2lkX21lZGlhX010cFNlcnZlcl9zZXRfcHRwX21vZGUoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwgamJvb2xlYW4gdXNlUHRwKQoreworI2lmZGVmIEhBVkVfQU5EUk9JRF9PUworICAgIExPR0QoInNldF9wdHBfbW9kZVxuIik7CisgICAgTXRwVGhyZWFkICp0aHJlYWQgPSAoTXRwVGhyZWFkICopZW52LT5HZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0KTsKKyAgICBpZiAodGhyZWFkKQorICAgICAgICB0aHJlYWQtPnNldFB0cE1vZGUodXNlUHRwKTsKKyAjZW5kaWYKK30KKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitzdGF0aWMgSk5JTmF0aXZlTWV0aG9kIGdNZXRob2RzW10gPSB7CisgICAgeyJuYXRpdmVfc2V0dXAiLCAgICAgICAgICAgICAgICAiKExhbmRyb2lkL21lZGlhL010cERhdGFiYXNlO0xqYXZhL2xhbmcvU3RyaW5nOylWIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilhbmRyb2lkX21lZGlhX010cFNlcnZlcl9zZXR1cH0sCisgICAgeyJuYXRpdmVfZmluYWxpemUiLCAgICAgICAgICAgICAiKClWIiwgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NdHBTZXJ2ZXJfZmluYWxpemV9LAorICAgIHsibmF0aXZlX3N0YXJ0IiwgICAgICAgICAgICAgICAgIigpViIsICAodm9pZCAqKWFuZHJvaWRfbWVkaWFfTXRwU2VydmVyX3N0YXJ0fSwKKyAgICB7Im5hdGl2ZV9zdG9wIiwgICAgICAgICAgICAgICAgICIoKVYiLCAgKHZvaWQgKilhbmRyb2lkX21lZGlh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gICAgIHJldHVybiBOT19FUlJPUjsKICAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfVklERU9fU1VSRkFDRTogeworICAgICAgICBjYXNlIFNFVF9WSURFT19JU1VSRkFDRTogewogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllciwgZGF0YSwgcmVwbHkpOwogICAgICAgICAgICAgc3A8SVN1cmZhY2U+IHN1cmZhY2UgPSBpbnRlcmZhY2VfY2FzdDxJU3VyZmFjZT4oZGF0YS5yZWFkU3Ryb25nQmluZGVyKCkpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0VmlkZW9JU3VyZmFjZShzdXJmYWNlKSk7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisgICAgICAgIGNhc2UgU0VUX1ZJREVPX1NVUkZBQ0U6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIHNwPFN1cmZhY2U+IHN1cmZhY2UgPSBTdXJmYWNlOjpyZWFkRnJvbVBhcmNlbChkYXRhKTsKICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldFZpZGVvU3VyZmFjZShzdXJmYWNlKSk7CiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgIH0gYnJlYWs7CkBAIC0zNDEsMTYgKzMzNiw2IEBACiAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRNZXRhZGF0YUZpbHRlcihkYXRhKSk7CiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU1VTUEVORDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndya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C0xNTksNiArMTYwLDE1IEBACiAgICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKICAgICB9CiAKKyAgICBzdGF0dXNfdCBzZXRPdXRwdXRGaWxlQXV4aWxpYXJ5KGludCBmZCkgeworICAgICAgICBMT0dWKCJzZXRPdXRwdXRGaWxlQXV4aWxpYXJ5KCVkKSIsIGZkKTsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU1lZGlhUmVjb3JkZXI6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVGaWxlRGVzY3JpcHRvcihmZCk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChTRVRfT1VUUFVUX0ZJTEVfQVVYSUxJQVJZX0ZELCBkYXRhLCAmcmVwbHkpOworICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7CisgICAgfQorCiAgICAgc3RhdHVzX3Qgc2V0VmlkZW9TaXplKGludCB3aWR0aCwgaW50IGhlaWdodCkKICAgICB7CiAgICAgICAgIExPR1YoInNldFZpZGVvU2l6ZSglZHglZCkiLCB3aWR0aCwgaGVpZ2h0KTsKQEAgLTM3Nyw2ICszODcsMTMgQEAKICAgICAgICAgICAgIDo6Y2xvc2UoZmQpOwogICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwogICAgICAgICB9IGJyZWFrOworICAgICAgICBjYXNlIFNFVF9PVVRQVVRfRklMRV9BVVhJTElBUllfRkQ6IHsKKyAgICAgICAgICAgIExPR1YoIlNFVF9PVVRQVVRfRklMRV9BVVhJTElBUllfRkQiKTsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOworICAgICAgICAgICAgaW50IGZkID0gZHVwKGRhdGEucmVhZEZpbGVEZXNjcmlwdG9yKCkpOworICAgICAgICAgICAgcmVw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fQ09ORklHLAogICAgIFNFVF9DT05GSUcsCisgICAgRU5BQkxFX0dSQVBISUNfQlVGRkVSUywKICAgICBVU0VfQlVGRkVSLAorICAgIFVTRV9HUkFQSElDX0JVRkZFUiwKKyAgICBTVE9SRV9NRVRBX0RBVEFfSU5fQlVGRkVSUywKICAgICBBTExPQ19CVUZGRVIsCiAgICAgQUxMT0NfQlVGRkVSX1dJVEhfQkFDS1VQLAogICAgIEZSRUVfQlVGRkVSLApAQCAtMjE2LDYgKzIxOSwxOSBAQAogICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7CiAgICAgfQogCisgICAgdmlydHVhbCBzdGF0dXNfdCBlbmFibGVHcmFwaGljQnVmZmVycygKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX1UzMiBwb3J0X2luZGV4LCBPTVhfQk9PTCBlbmFibGUpIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU9NWDo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludFB0cigoaW50cHRyX3Qpbm9kZSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihwb3J0X2luZGV4KTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKCh1aW50MzJfdCllbmFibGUpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoRU5BQkxFX0dSQVBISUNfQlVGRkVSUywgZGF0YSwgJnJlcGx5KTsKKworICAgICAgICBzdGF0dXNfdCBlcnIgPSByZXBseS5yZWFkSW50MzIoKTsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKICAgICB2aXJ0dWFsIHN0YXR1c190IHVzZUJ1ZmZlcigKICAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX1UzMiBwb3J0X2luZGV4LCBjb25zdCBzcDxJTWVtb3J5PiAmcGFyYW1zLAogICAgICAgICAgICAgYnVmZmVyX2lkICpidWZmZXIpIHsKQEAgLTIzOCw2ICsyNTQsNDIgQEAKICAgICAgICAgcmV0dXJuIGVycjsKICAgICB9CiAKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgdXNlR3JhcGhpY0J1ZmZlcigKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX1UzMiBwb3J0X2luZGV4LAorICAgICAgICAgICAgY29uc3Qgc3A8R3JhcGhpY0J1ZmZlcj4gJmdyYXBoaWNCdWZmZXIsIGJ1ZmZlcl9pZCAqYnVmZmVyKSB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnRQdHIoKGludHB0cl90KW5vZGUpOworICAgICAgICBkYXRhLndyaXRlSW50MzIocG9ydF9pbmRleCk7CisgICAgICAgIGRhdGEud3JpdGUoKmdyYXBoaWNCdWZmZXIpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoVVNFX0dSQVBISUNfQlVGRkVSLCBkYXRhLCAmcmVwbHkpOworCisgICAgICAgIHN0YXR1c190IGVyciA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAqYnVmZmVyID0gMDsKKworICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgfQorCisgICAgICAgICpidWZmZXIgPSAodm9pZCopcmVwbHkucmVhZEludFB0cigpOworCisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCBzdG9yZU1ldGFEYXRhSW5CdWZmZXJzKAorICAgICAgICAgICAgbm9kZV9pZCBub2RlLCBPTVhfVTMyIHBvcnRfaW5kZXgsIE9NWF9CT09MIGVuYWJsZSkgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJT01YOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICBkYXRhLndyaXRlSW50UHRyKChpbnRwdHJfdClub2RlKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKHBvcnRfaW5kZXgpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoKHVpbnQzMl90KWVuYWJsZSk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChTVE9SRV9NRVRBX0RBVEFfSU5fQlVGRkVSUywgZGF0YSwgJnJlcGx5KTsKKworICAgICAgICBzdGF0dXNfdCBlcnIgPSByZXBseS5yZWFkSW50MzIoKTsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKICAgICB2aXJ0dWFsIHN0YXR1c190IGFsbG9jYXRlQnVmZmVyKAogICAgICAgICAgICAgbm9kZV9pZCBub2RlLCBPTVhfVTMyIHBvcnRfaW5kZXgsIHNpemVfdCBzaXplLAogICAgICAgICAgICAgYnVmZmVyX2lkICpidWZmZXIsIHZvaWQgKipidWZmZXJfZGF0YSkgewpAQCAtNTQxLDYgKzU5MywyMCBAQAogICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwogICAgICAgICB9CiAKKyAgICAgICAgY2FzZSBFTkFCTEVfR1JBUEhJQ19CVUZGRVJTOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7CisgICAgICAgICAgICBPTVhfVTMyIHBvcnRfaW5kZXggPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgT01YX0JPT0wgZW5hYmxlID0gKE9NWF9CT09MKWRhdGEucmVhZEludDMyKCk7CisKKyAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGVuYWJsZUdyYXBoaWNCdWZmZXJzKG5vZGUsIHBvcnRfaW5kZXgsIGVuYWJsZSk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihlcnIpOworCisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0KKwogICAgICAgICBjYXNlIFVTRV9CVUZGRVI6CiAgICAgICAgIHsKICAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJT01YLCBkYXRhLCByZXBseSk7CkBAIC01NjEsNiArNjI3LDQxIEBACiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgIH0KIAorICAgICAgICBjYXNlIFVTRV9HUkFQSElDX0JVRkZFUjoKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKKworICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOworICAgICAgICAgICAgT01YX1UzMiBwb3J0X2luZGV4ID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHNwPEdyYXBoaWNCdWZmZXI+IGdyYXBoaWNCdWZmZXIgPSBuZXcgR3JhcGhpY0J1ZmZlcigpOworICAgICAgICAgICAgZGF0YS5yZWFkKCpncmFwaGljQnVmZmVyKTsKKworICAgICAgICAgICAgYnVmZmVyX2lkIGJ1ZmZlcjsKKyAgICAgICAgICAgIHN0YXR1c190IGVyciA9IHVzZUdyYXBoaWNCdWZmZXIoCisgICAgICAgICAgICAgICAgICAgIG5vZGUsIHBvcnRfaW5kZXgsIGdyYXBoaWNCdWZmZXIsICZidWZmZXIpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZXJyKTsKKworICAgICAgICAgICAgaWYgKGVyciA9PSBPSykgeworICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludFB0cigoaW50cHRyX3QpYnVmZmVyKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBTVE9SRV9NRVRBX0RBVEFfSU5fQlVGRkVSUzoKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKKworICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOworICAgICAgICAgICAgT01YX1UzMiBwb3J0X2luZGV4ID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIE9NWF9CT09MIGVuYWJsZSA9IChPTVhfQk9PTClkYXRhLnJlYWRJbnQzMigpOworCisgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBzdG9yZU1ldGFEYXRhSW5CdWZmZXJzKG5vZGUsIHBvcnRfaW5kZXgsIGVuYWJsZSk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihlcnIpOworCisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0KKwogICAgICAgICBjYXNlIEFMTE9DX0JVRkZFUjoKICAgICAgICAgewogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKZGlmZiAtLWdpdCBhL21lZGlhL2xpYm1lZGlhL01lZGlhUHJvZmlsZXMuY3BwIGIvbWVkaWEvbGlibWVkaWEvTWVkaWFQcm9maWxlcy5jcHAKaW5kZXggMzg2OTM4OS4uOWFkNjNmMCAxMDA2NDQKLS0tIGEvbWVkaWEvbGlibWVkaWEvTWVkaWFQcm9maWxlcy5jcHAKKysrIGIvbWVkaWEvbGlibWVkaWEvTWVkaWFQcm9maWxlcy5jcHAKQEAgLTU5LDggKzU5LDIxIEBACiB9OwogCiBjb25zdCBNZWRpYVByb2ZpbGVzOjpOYW1lVG9UYWdNYXAgTWVkaWFQcm9maWxlczo6c0NhbWNvcmRlclF1YWxpdHlOYW1lTWFwW10g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gICAgICAgIG5hbWUsIGNhbWVyYUlkLCBxdWFsaXR5KTsKLQogICAgIGludCBpbmRleCA9IC0xOwogICAgIGZvciAoc2l6ZV90IGkgPSAwLCBuID0gbUNhbWNvcmRlclByb2ZpbGVzLnNpemUoKTsgaSA8IG47ICsraSkgewogICAgICAgICBpZiAobUNhbWNvcmRlclByb2ZpbGVzW2ldLT5tQ2FtZXJhSWQgPT0gY2FtZXJhSWQgJiYKQEAgLTY4Myw2ICs3NzgsMTcgQEAKICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAgICAgfQorICAgIHJldHVybiBpbmRleDsKK30KKworaW50IE1lZGlhUHJvZmlsZXM6OmdldENhbWNvcmRlclByb2ZpbGVQYXJhbUJ5TmFtZShjb25zdCBjaGFyICpuYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY2FtZXJhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbWNvcmRlcl9xdWFsaXR5IHF1YWxpdHkpIGNvbnN0Cit7CisgICAgTE9HVigiZ2V0Q2FtY29yZGVyUHJvZmlsZVBhcmFtQnlOYW1lOiAlcyBmb3IgY2FtZXJhICVkLCBxdWFsaXR5ICVkIiwKKyAgICAgICAgIG5hbWUsIGNhbWVyYUlkLCBxdWFsaXR5KTsKKworICAgIGludCBpbmRleCA9IGdldENhbWNvcmRlclByb2ZpbGVJbmRleChjYW1lcmFJZCwgcXVhbGl0eSk7CiAgICAgaWYgKGluZGV4ID09IC0xKSB7CiAgICAgICAgIExPR0UoIlRoZSBnaXZlbiBjYW1jb3JkZXIgcHJvZmlsZSBjYW1lcmEgJWQgcXVhbGl0eSAlZCBpcyBub3QgZm91bmQiLAogICAgICAgICAgICAgIGNhbWVyYUlkLCBxdWFsaXR5KTsKQEAgLTcwNSw2ICs4MTEsMTEgQEAKICAgICByZXR1cm4gLTE7CiB9CiAKK2Jvb2wgT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k9XTikgewogICAgICAgICAgICAgLy8gSWYgdGhlIHR5cGUgaXMgdW5rbm93biwgc3RhdCgpIHRoZSBmaWxlIGluc3RlYWQuCkBAIC0xNTAsMjkgKzEzNywyMCBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGlmICh0eXBlID09IERUX1JFRyB8fCB0eXBlID09IERUX0RJUikgewotICAgICAgICAgICAgaW50IG5hbWVMZW5ndGggPSBzdHJsZW4obmFtZSk7Ci0gICAgICAgICAgICBib29sIGlzRGlyZWN0b3J5ID0gKHR5cGUgPT0gRFRfRElSKTsKLQotICAgICAgICAgICAgaWYgKG5hbWVMZW5ndGggPiBwYXRoUmVtYWluaW5nIHx8IChpc0RpcmVjdG9yeSAmJiBuYW1lTGVuZ3RoICsgMSA+IHBhdGhSZW1haW5pbmcpKSB7Ci0gICAgICAgICAgICAgICAgLy8gcGF0aCB0b28gbG9uZyEKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc3RyY3B5KGZpbGVTcG90LCBuYW1lKTsKLSAgICAgICAgICAgIGlmIChpc0RpcmVjdG9yeSkgeworICAgICAgICAgICAgaWYgKHR5cGUgPT0gRFRfRElSKSB7CiAgICAgICAgICAgICAgICAgLy8gaWdub3JlIGRpcmVjdG9yaWVzIHdpdGggYSBuYW1lIHRoYXQgc3RhcnRzIHdpdGggJy4nCiAgICAgICAgICAgICAgICAgLy8gZm9yIGV4YW1wbGUsIHRoZSBNYWMgIi5UcmFzaGVzIiBkaXJlY3RvcnkKICAgICAgICAgICAgICAgICBpZiAobmFtZVswXSA9PSAnLicpIGNvbnRpbnVlOwogCiAgICAgICAgICAgICAgICAgc3RyY2F0KGZpbGVTcG90LCAiLyIpOwotICAgICAgICAgICAgICAgIGludCBlcnIgPSBkb1Byb2Nlc3NEaXJlY3RvcnkocGF0aCwgcGF0aFJlbWFpbmluZyAtIG5hbWVMZW5ndGggLSAxLCBleHRlbnNpb25z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sKKyAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOworICAgIH0KKyAgICBpZiAobUlzQXV4aWxpYXJ5T3V0cHV0RmlsZVNldCkgeworICAgICAgICBMT0dFKCJvdXRwdXQgZmlsZSBoYXMgYWxyZWFkeSBiZWVuIHNldCIpOworICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047CisgICAgfQorICAgIGlmICghKG1DdXJyZW50U3RhdGUgJiBNRURJQV9SRUNPUkRFUl9EQVRBU09VUkNFX0NPTkZJR1VSRUQpKSB7CisgICAgICAgIExPR0UoInNldE91dHB1dEZpbGUgY2FsbGVkIGluIGFuIGludmFsaWQgc3RhdGUoJWQpIiwgbUN1cnJlbnRTdGF0ZSk7CisgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKKyAgICB9CisKKyAgICBzdGF0dXNfdCByZXQgPSBtTWVkaWFSZWNvcmRlci0+c2V0T3V0cHV0RmlsZUF1eGlsaWFyeShmZCk7CisgICAgaWYgKE9LICE9IHJldCkgeworICAgICAgICBMT0dWKCJzZXRPdXRwdXRGaWxlQXV4aWxpYXJ5IGZhaWxlZDogJWQiLCByZXQpOworICAgICAgICBtQ3VycmVudFN0YXRlID0gTUVESUFfUkVDT1JERVJfRVJST1I7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorICAgIG1Jc0F1eGlsaWFyeU91dHB1dEZpbGVTZXQgPSB0cnVlOworICAgIHJldHVybiByZXQ7Cit9CisKIHN0YXR1c190IE1lZGlhUmVjb3JkZXI6OnNldFZpZGVvU2l6ZShpbnQgd2lkdGgsIGludCBoZWlnaHQpCiB7CiAgICAgTE9HVigic2V0VmlkZW9TaXplKCVkLCAlZCkiLCB3aWR0aCwgaGVpZ2h0KTsKQEAgLTU3MSw2ICs1OTcsNyBAQAogICAgIG1Jc0F1ZGlvRW5jb2RlclNldCA9IGZhbHNlOwogICAgIG1Jc1ZpZGVvRW5jb2RlclNldCA9IGZhbHNlOwogIC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ZXggNDQ5MmUyMC4uZTE5N2NkZSAxMDA2NDQKLS0tIGEvbWVkaWEvbGlibWVkaWFwbGF5ZXJzZXJ2aWNlL01lZGlhUGxheWVyU2VydmljZS5oCisrKyBiL21lZGlhL2xpYm1lZGlhcGxheWVyc2VydmljZS9NZWRpYVBsYXllclNlcnZpY2UuaApAQCAtMjA2LDcgKzIwNiw4IEBACiAKICAgICAgICAgLy8gSU1lZGlhUGxheWVyIGludGVyZmFjZQogICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICBkaXNjb25uZWN0KCk7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHNldFZpZGVvU3VyZmFjZShjb25zdCBzcDxJU3VyZmFjZT4mIHN1cmZhY2UpOworICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzZXRWaWRlb0lTdXJmYWNlKGNvbnN0IHNwPElTdXJmYWNlPiYgc3VyZmFjZSk7CisgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHNldFZpZGVvU3VyZmFjZShjb25zdCBzcDxTdXJmYWNlPiYgc3VyZmFjZSk7CiAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHByZXBhcmVBc3luYygpOwogICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzdGFydCgpOwogICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzdG9wKCk7CkBAIC0yMjQsOCArMjI1LDYgQEAKICAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgZ2V0TWV0YWRhdGEoYm9vbCB1cGRhdGVfb25seSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhcHBseV9maWx0ZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbCAqcmVwbHkpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzdXNw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KyAgICAgICAgfQogICAgIH0gZWxzZSB7CiAgICAgICAgIExPR0UoInNldFBhcmFtZXRlcjogZmFpbGVkIHRvIGZpbmQga2V5ICVzIiwga2V5LnN0cmluZygpKTsKICAgICB9CkBAIC03OTAsNyArODgzLDE0IEBACiAgICAgaWYgKG1BdWRpb1NvdXJjZSAhPSBBVURJT19TT1VSQ0VfTElTVF9FTkQpIHsKICAgICAgICAgc291cmNlID0gY3JlYXRlQXVkaW9Tb3VyY2UoKTsKICAgICB9IGVsc2UgewotICAgICAgICBzdGF0dXNfdCBlcnIgPSBzZXR1cFZpZGVvRW5jb2Rlcigmc291cmNlKTsKKworICAgICAgICBzcDxDYW1lcmFTb3VyY2U+IGNhbWVyYVNvdXJjZTsKKyAgICAgICAgc3RhdHVzX3QgZXJyID0gc2V0dXBDYW1lcmFTb3VyY2UoJmNhbWVyYVNvdXJjZSk7CisgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgIH0KKworICAgICAgICBlcnIgPSBzZXR1cFZpZGVvRW5jb2RlcihjYW1lcmFTb3VyY2UsIG1WaWRlb0JpdFJhdGUsICZzb3VyY2UpOwogICAgICAgICBpZiAoZXJyICE9IE9LKSB7CiAgICAgICAgICAgICByZXR1cm4gZXJyOwogICAgICAgICB9CkBAIC04MjYsOCArOTI2LDE0IEBACiAgICAgICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7CiAgICAgICAgIH0KIAorICAgICAgICBzcDxDYW1lcmFTb3VyY2U+IGNhbWVyYVNvdXJjZTsKKyAgICAgICAgc3RhdHVzX3QgZXJyID0gc2V0dXBDYW1lcmFTb3VyY2UoJmNhbWVyYVNvdXJjZSk7CisgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgIH0KKwogICAgICAgICBzcDxNZWRpYVNvdXJjZT4gZW5jb2RlcjsKLSAgICAgICAgc3Rh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VTktOT1dOX0VSUk9SOworICAgICAgICB9CisgICAgICAgIExPR1YoIkNyZWF0aW5nIE1lZGlhU291cmNlU3BsaXR0ZXIiKTsKKyAgICAgICAgc3A8Q2FtZXJhU291cmNlPiBjYW1lcmFTb3VyY2U7CisgICAgICAgIHN0YXR1c190IGVyciA9IHNldHVwQ2FtZXJhU291cmNlKCZjYW1lcmFTb3VyY2UpOworICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICB9CisgICAgICAgIG1DYW1lcmFTb3VyY2VTcGxpdHRlciA9IG5ldyBNZWRpYVNvdXJjZVNwbGl0dGVyKGNhbWVyYVNvdXJjZSk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgbUNhbWVyYVNvdXJjZVNwbGl0dGVyID0gTlVMTDsKKyAgICB9CisKKyAgICBpbnQzMl90IHRvdGFsQml0UmF0ZTsKKyAgICBzdGF0dXNfdCBlcnIgPSBzZXR1cE1QRUc0UmVjb3JkaW5nKG1DYXB0dXJlQXV4VmlkZW8sCisgICAgICAgICAgICBtT3V0cHV0RmQsIG1WaWRlb1dpZHRoLCBtVmlkZW9IZWlnaHQsCisgICAgICAgICAgICBtVmlkZW9CaXRSYXRlLCAmdG90YWxCaXRSYXRlLCAmbVdyaXRlcik7CisgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgIGludDY0X3Qgc3RhcnRUaW1lVXMgPSBzeXN0ZW1UaW1lKCkgLyAxMDAwOworICAgIHNwPE1ldGFEYXRhPiBtZXRhID0gbmV3IE1ldGFEYXRhOworICAgIHNldHVwTVBFRzRNZXRhRGF0YShzdGFydFRpbWVVcywgdG90YWxCaXRSYXRlLCAmbWV0YSk7CisKKyAgICBlcnIgPSBtV3JpdGVyLT5zdGFydChtZXRhLmdldCgpKTsKKyAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisg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IgIT0gT0spIHsKKyAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgIH0KKworICAgICAgICBzcDxNZXRhRGF0YT4gbWV0YUF1eCA9IG5ldyBNZXRhRGF0YTsKKyAgICAgICAgc2V0dXBNUEVHNE1ldGFEYXRhKHN0YXJ0VGltZVVzLCB0b3RhbEJpdHJhdGVBdXgsICZtZXRhQXV4KTsKKworICAgICAgICByZXR1cm4gbVdyaXRlckF1eC0+c3RhcnQobWV0YUF1eC5nZXQoKSk7CisgICAgfQorCisgICAgcmV0dXJuIE9LOwogfQogCiBzdGF0dXNfdCBTdGFnZWZyaWdodFJlY29yZGVyOjpwYXVzZSgpIHsKQEAgLTExMTYsMzUgKzEzMTgsNTAgQEAKICAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CiAgICAgfQogICAgIG1Xcml0ZXItPnBhdXNlKCk7CisKKyAgICBpZiAobUNhcHR1cmVBdXhWaWRlbykgeworICAgICAgICBpZiAobVdyaXRlckF1eCA9PSBOVUxMKSB7CisgICAgICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKKyAgICAgICAgfQorICAgICAgICBtV3JpdGVyQXV4LT5wYXVzZSgpOworICAgIH0KKwogICAgIHJldHVybiBPSzsKIH0KIAogc3RhdHVzX3QgU3RhZ2VmcmlnaHRSZWNvcmRlcjo6c3RvcCgpIHsKICAgICBMT0dWKCJzdG9wIik7CiAgICAgc3RhdHVzX3QgZXJyID0gT0s7CisKKyAgICBpZiAobUNhcHR1cmVUaW1lTGFwc2UgJiYgbUNhbWVyYVNvdXJjZVRpbWVMYXBzZSAhPSBOVUxMKSB7CisgICAgICAgIG1DYW1lcmFTb3VyY2VUaW1lTGFwc2UtPnN0YXJ0UXVpY2tSZWFkUmV0dXJucygpOworICAgICAgICBtQ2FtZXJhU291cmNlVGltZUxhcHNlID0gTlVMTDsKKyAgICB9CisKKyAgICBpZiAobUNhcHR1cmVBdXhWaWRlbykgeworICAgICAgICBpZiAobVdyaXRlckF1eCAhPSBOVUxMKSB7CisgICAgICAgICAgICBtV3JpdGVyQXV4LT5zdG9wKCk7CisgICAgICAgICAgICBtV3JpdGVyQXV4LmNsZWFyKCk7CisgICAgICAgIH0KKyAgICB9CisKICAgICBpZiAobVdyaXRlciAhPSBOVUxMKSB7CiAgICAgICAgIGVyciA9IG1Xcml0ZXItPnN0b3AoKTsKICAgICAgICAgbVdyaXRlci5jbGVhcigpOwogICAgIH0KIAotICAgIGlmIChtQ2FtZXJhICE9IDApIHsKLSAgICAgICAgTE9HVigiRGlzY29ubmVjdCBjYW1lcmEiKTsKLSAgICAgICAgaW50NjRfdCB0b2tlbiA9IElQQ1RocmVhZFN0YXRlOjpzZWxmKCktPmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7Ci0gICAgICAgIGlmICgobUZsYWdzICYgRkxBR1NfSE9UX0NBTUVSQSkgPT0gMCkgewotICAgICAgICAgICAgTE9HVigiQ2FtZXJhIHdhcyBjb2xkIHdoZW4gd2Ugc3RhcnRlZCwgc3RvcHBpbmcgcHJldmlldyIpOwotICAgICAgICAgICAgbUNhbWVyYS0+c3RvcFByZXZpZXcoKTsKLSAgICAgICAgfQotICAgICAgICBtQ2FtZXJhLT51bmxvY2soKTsKLSAgICAgICAgbUNhbWVyYS5jbGVhcigpOwotICAgICAgICBJUENUaHJlYWRTdGF0ZTo6c2VsZigpLT5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KHRva2VuKTsKLSAgICAgICAgbUZsYWdzID0gMDsKLSAgICB9Ci0KICAgICBpZiAobU91dHB1dEZkID49IDApIHsKICAgICAgICAgOjpjbG9zZShtT3V0cHV0RmQpOwogICAgICAgICBtT3V0cHV0RmQgPSAtMTsKICAgICB9CiAKKyAgICBpZiAobUNhcHR1cmVBdXhWaWRlbykgeworICAgICAgICBpZiAobU91dHB1dEZkQXV4ID49IDApIHsKKyAgICAgICAgICAgIDo6Y2xvc2UobU91dHB1dEZkQXV4KTsKKyAgICAgICAgICAgIG1PdX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cmFjdG9yLmNwcCAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgRVNEUy5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKQEAgLTI1LDYgKzI3LDcgQEAKICAgICAgICAgTWVkaWFEZWZzLmNwcCAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgTWVkaWFFeHRyYWN0b3IuY3BwICAgICAgICAgICAgICAgIFwKICAgICAgICAgTWVkaWFTb3VyY2UuY3BwICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgTWVkaWFTb3VyY2VTcGxpdHRlci5jcHAgICAgICAgICAgIFwKICAgICAgICAgTWV0YURhdGEuY3BwICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgTnVDYWNoZWRTb3VyY2UyLmNwcCAgICAgICAgICAgICAgIFwKICAgICAgICAgTnVIVFRQRGF0YVNvdXJjZS5jcHAgICAgICAgICAgICAgIFwKQEAgLTYwLDYgKzYzLDcgQEAKICAgICAgICAgbGlic29uaXZveCAgICAgICAgXAogICAgICAgICBsaWJ2b3JiaXNpZGVjICAgICBcCiAgICAgICAgIGxpYnN1cmZhY2VmbGluZ2VyX2NsaWVudCBcCisgICAgICAgIGxpYnN0YWdlZnJpZ2h0X3l1diBcCiAgICAgICAgIGxpYmNhbWVyYV9jbGllbnQgXAogICAgICAgICBsaWJkcm1mcmFtZXdvcmsKIApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvQXdlc29tZVBsYXllci5jcHAgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9Bd2Vzb21lUGxheWVyLmNwcAppbmRleCBlMGJjZGMzLi5jYTkwYzBjIDEwMDY0NAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9Bd2Vzb21lUGxheWVyLmNwcAorKysgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9Bd2Vzb21lUGxheWVyLmNwcApAQCAtNDUsNyArNDUsNyBAQAogI2luY2x1ZGUgPG1lZGlhL3N0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WRXaWR0aCwgZGVjb2RlZEhlaWdodCk7CiAgICAgfQogCkBAIC0xMzksNyArMTQwLDggQEAKICAgICAgICAgICAgIGJvb2wgcHJldmlld09ubHksCiAgICAgICAgICAgICBjb25zdCBjaGFyICpjb21wb25lbnROYW1lLAogICAgICAgICAgICAgT01YX0NPTE9SX0ZPUk1BVFRZUEUgY29sb3JGb3JtYXQsCi0gICAgICAgICAgICBjb25zdCBzcDxJU3VyZmFjZT4gJnN1cmZhY2UsCisgICAgICAgICAgICBjb25zdCBzcDxJU3VyZmFjZT4gJmlzdXJmYWNlLAorICAgICAgICAgICAgY29uc3Qgc3A8U3VyZmFjZT4gJnN1cmZhY2UsCiAgICAgICAgICAgICBzaXplX3QgZGlzcGxheVdpZHRoLCBzaXplX3QgZGlzcGxheUhlaWdodCwKICAgICAgICAgICAgIHNpemVfdCBkZWNvZGVkV2lkdGgsIHNpemVfdCBkZWNvZGVkSGVpZ2h0KTsKIApAQCAtMTUxLDcgKzE1Myw4IEBACiAgICAgICAgIGJvb2wgcHJldmlld09ubHksCiAgICAgICAgIGNvbnN0IGNoYXIgKmNvbXBvbmVudE5hbWUsCiAgICAgICAgIE9NWF9DT0xPUl9GT1JNQVRUWVBFIGNvbG9yRm9ybWF0LAotICAgICAgICBjb25zdCBzcDxJU3VyZmFjZT4gJnN1cmZhY2UsCisgICAgICAgIGNvbnN0IHNwPElTdXJmYWNlPiAmaXN1cmZhY2UsCisgICAgICAgIGNvbnN0IHNwPFN1cmZhY2U+ICZzdXJmYWNlLAogICAgICAgICBzaXplX3QgZGlzcGxheVdpZHRoLCBzaXplX3QgZGlzcGxheUhlaWdodCwKICAgICAgICAgc2l6ZV90IGRlY29kZWRXaWR0aCwgc2l6ZV90IGRlY29kZWRIZWlnaHQpIHsKICAgICBpZiAoIXByZXZpZXdPbmx5KSB7CkBAIC0xNzcsNyArMTgwLDcgQEAKIAogICAgICAgICAgICAgaWYgKGZ1bmMpIHsKICAgICAgICAgICAgICAgICBtVGFyZ2V0ID0KLSAgICAgICAgICAgICAgICAgICAgKCpmdW5jKShzdXJmYWNlLCBjb21wb25lbnROYW1lLCBjb2xvckZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgKCpmdW5jKShpc3VyZmFjZSwgY29tcG9uZW50TmFtZSwgY29sb3JGb3JtYXQsCiAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5V2lkdGgsIGRpc3BsYXlIZWlnaHQsCiAgICAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVkV2lkdGgsIGRlY29kZWRIZWlnaHQpOwogICAgICAgICAgICAgfQpAQCAtMTkxLDYgKzE5NCwzNSBAQAogICAgIH0KIH0KIAorc3RydWN0IEF3ZXNvbWVOYXRpdmVXaW5kb3dSZW5kZXJlciA6IHB1YmxpYyBBd2Vzb21lUmVuZGVyZXIgeworICAgIEF3ZXNvbWVOYXRpdmVXaW5kb3dSZW5kZXJlcihjb25zdCBzcDxBTmF0aXZlV2luZG93PiAmbmF0aXZlV2luZG93KQorICAgICAgICA6IG1OYXRpdmVXaW5kb3cobmF0aXZlV2luZG93KSB7CisgICAgfQorCisgICAgdmlydHVhbCB2b2lkIHJlbmRlcihNZWRpYUJ1ZmZlciAqYnVmZmVyKSB7CisgICAgICAgIHN0YXR1c190IGVyciA9IG1OYXRpdmVXaW5kb3ctPnF1ZXVlQnVmZmVyKAorICAgICAgICAgICAgICAgIG1OYXRpdmVXaW5kb3cuZ2V0KCksIGJ1ZmZlci0+Z3JhcGhpY0J1ZmZlcigpLmdldCgpKTsKKyAgICAgICAgaWYgKGVyciAhPSAwKSB7CisgICAgICAgICAgICBMT0dFKCJxdWV1ZUJ1ZmZlciBmYWlsZWQgd2l0aCBlcnJvciAlcyAoJWQpIiwgc3RyZXJyb3IoLWVyciksCisgICAgICAgICAgICAgICAgICAgIC1lcnIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgc3A8TWV0YURhdGE+IG1ldGFEYXRhID0gYnVmZm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AgICAgICAgICAgICAgICBtSVN1cmZhY2UsCisgICAgICAgICAgICAgICAgICAgIG1TdXJmYWNlLAorICAgICAgICAgICAgICAgICAgICBtVmlkZW9XaWR0aCwgbVZpZGVvSGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICBkZWNvZGVkV2lkdGgsIGRlY29kZWRIZWlnaHQpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgLy8gT3VyIE9NWCBjb2RlY3MgYWxsb2NhdGUgYnVmZmVycyBvbiB0aGUgbWVkaWFfc2VydmVyIHNpZGUKICAgICAgICAgICAgIC8vIHRoZXJlZm9yZSB0aGV5IHJlcXVpcmUgYSByZW1vdGUgSU9NWFJlbmRlcmVyIHRoYXQga25vd3MgaG93CiAgICAgICAgICAgICAvLyB0byBkaXNwbGF5IHRoZW0uCkBAIC04MjIsMTYgKzg5MCw2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAoT01YX0NPTE9SX0ZPUk1BVFRZUEUpZm9ybWF0LAogICAgICAgICAgICAgICAgICAgICAgICAgZGVjb2RlZFdpZHRoLCBkZWNvZGVkSGVpZ2h0LAogICAgICAgICAgICAgICAgICAgICAgICAgbVZpZGVvV2lkdGgsIG1WaWRlb0hlaWdodCkpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgLy8gT3RoZXIgZGVjb2RlcnMgYXJlIGluc3RhbnRpYXRlZCBsb2NhbGx5IGFuZCBhcyBhIGNvbnNlcXVlbmNlCi0gICAgICAgICAgICAvLyBhbGxvY2F0ZSB0aGVpciBidWZmZXJzIGluIGxvY2FsIGFkZHJlc3Mgc3BhY2UuCi0gICAgICAgICAgICBtVmlkZW9SZW5kZXJlciA9IG5ldyBBd2Vzb21lTG9jYWxSZW5kZXJlcigKLSAgICAgICAgICAgICAgICBmYWxzZSwgIC8vIHByZXZpZXdPbmx5Ci0gICAgICAgICAgICAgICAgY29tcG9uZW50LAotICAgICAgICAgICAgICAgIChPTVhfQ09MT1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CisgICAgICAgICAgICAgICAgICAgIG5vdGlmeVZpZGVvU2l6ZV9sKCk7CisKICAgICAgICAgICAgICAgICAgICAgaWYgKG1WaWRlb1JlbmRlcmVyICE9IE5VTEwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1WaWRlb1JlbmRlcmVySXNQcmV2aWV3ID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICBpbml0UmVuZGVyZXJfbCgpOwpAQCAtMTIxMywxNyArMTI4NiwxMSBAQAogICAgICAgICBtVmlkZW9UaW1lVXMgPSB0aW1lVXM7CiAgICAgfQogCisgICAgYm9vbCB3YXNTZWVraW5nID0gbVNlZWtpbmc7CiAgICAgZmluaXNoU2Vla0lmTmVjZXNzYXJ5KHRpbWVVcyk7CiAKICAgICBUaW1lU291cmNlICp0cyA9IChtRmxhZ3MgJiBBVURJT19BVF9FT1MpID8gJm1TeXN0ZW1UaW1lU291cmNlIDogbVRpbWVTb3VyY2U7CiAKLSAgICBpZiAobURlY3J5cHRIYW5kbGUgIT0gTlVMTCkgewotICAgICAgICBtRHJtTWFuYWdlckNsaWVudC0+c2V0UGxheWJhY2tTdGF0dXMobURlY3J5cHRIYW5kbGUsCi0gICAgICAgICAgICAgICAgUGxheWJhY2s6OlBBVVNFLCAwKTsKLSAgICAgICAgbURybU1hbmFnZXJDbGllbnQtPnNldFBsYXliYWNrU3RhdHVzKG1EZWNyeXB0SGFuZGxlLAotICAgICAgICAgICAgICAgIFBsYXliYWNrOjpTVEFSVCwgdGltZVVzIC8gMTAwMCk7Ci0gICAgfQotCiAgICAgaWYgKG1GbGFncyAmIEZJUlNUX0ZSQU1FKSB7CiAgICAgICAgIG1GbGFncyAmPSB+RklSU1RfRlJBTUU7CiAKQEAgLTEyNDAsNiArMTMwNywxMSBAQAogCiAgICAgaW50NjRfdCBsYXRlbmVzc1VzID0gbm93VXMgLSB0aW1lVXM7CiAKKyAgICBpZiAod2FzU2Vla2luZykgeworICAgICAgICAvLyBMZXQncyBka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laWdodCkgeworICAgIGludDY0X3QgdG9rZW4gPSBJUENUaHJlYWRTdGF0ZTo6c2VsZigpLT5jbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgIFN0cmluZzggcyA9IG1DYW1lcmEtPmdldFBhcmFtZXRlcnMoKTsKKyAgICBJUENUaHJlYWRTdGF0ZTo6c2VsZigpLT5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KHRva2VuKTsKKworICAgIENhbWVyYVBhcmFtZXRlcnMgcGFyYW1zKHMpOworICAgIFZlY3RvcjxTaXplPiBzdXBwb3J0ZWRTaXplczsKKyAgICBwYXJhbXMuZ2V0U3VwcG9ydGVkUGljdHVyZVNpemVzKHN1cHBvcnRlZFNpemVzKTsKKworICAgIGludDMyX3QgbWluUGljdHVyZVNpemUgPSBJTlRfTUFYOworICAgIGZvciAodWludDMyX3QgaSA9IDA7IGkgPCBzdXBwb3J0ZWRTaXplcy5zaXplKCk7ICsraSkgeworICAgICAgICBpbnQzMl90IHBpY3R1cmVXaWR0aCA9IHN1cHBvcnRlZFNpemVzW2ldLndpZHRoOworICAgICAgICBpbnQzMl90IHBpY3R1cmVIZWlnaHQgPSBzdXBwb3J0ZWRTaXplc1tpXS5oZWlnaHQ7CisKKyAgICAgICAgaWYgKChwaWN0dXJlV2lkdGggPj0gd2lkdGgpICYmIChwaWN0dXJlSGVpZ2h0ID49IGhlaWdodCkpIHsKKyAgICAgICAgICAgIGludDMyX3QgcGljdHVyZVNpemUgPSBwaWN0dXJlV2lkdGgqcGljdHVyZUhlaWdodDsKKyAgICAgICAgICAgIGlmIChwaWN0dXJlU2l6ZSA8IG1pblBpY3R1cmVTaXplKSB7CisgICAgICAgICAgICAgICAgbWluUGljdHVyZVNpemUgPSBwaWN0dXJlU2l6ZTsKKyAgICAgICAgICAgICAgICBtUGljdHVyZVdpZHRoID0gcGljdHVyZVdpZHRoOworICAgICAgICAgICAgICAgIG1QaWN0dXJlSGVpZ2h0ID0gcGljdHVyZUhlaWdodDsKK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pZiAobUxhc3RSZWFkQ29tcGxldGVkKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgbUFsbFJlYWRzQ29tcGxldGVDb25kaXRpb24ud2FpdChtTG9jayk7CisgICAgQ0hFQ0sobUxhc3RSZWFkQ29tcGxldGVkKTsKK30KKwordm9pZCBNZWRpYVNvdXJjZVNwbGl0dGVyOjpzaWduYWxSZWFkQ29tcGxldGVfbG9jayhib29sIHJlYWRBYm9ydGVkKSB7CisgICAgaWYgKCFyZWFkQWJvcnRlZCkgeworICAgICAgICBtTnVtYmVyT2ZDdXJyZW50UmVhZHMrKzsKKyAgICB9CisKKyAgICBpZiAobU51bWJlck9mQ3VycmVudFJlYWRzID09IG1OdW1iZXJPZkNsaWVudHNTdGFydGVkKSB7CisgICAgICAgIG1MYXN0UmVhZENvbXBsZXRlZCA9IHRydWU7CisgICAgICAgIG1OdW1iZXJPZkN1cnJlbnRSZWFkcyA9IDA7CisgICAgICAgIG1BbGxSZWFkc0NvbXBsZXRlQ29uZGl0aW9uLmJyb2FkY2FzdCgpOworICAgIH0KK30KKworc3RhdHVzX3QgTWVkaWFTb3VyY2VTcGxpdHRlcjo6cGF1c2UoaW50IGNsaWVudElkKSB7CisgICAgcmV0dXJuIEVSUk9SX1VOU1VQUE9SVEVEOworfQorCisvLyBDbGllbnQKKworTWVkaWFTb3VyY2VTcGxpdHRlcjo6Q2xpZW50OjpDbGllbnQoCisgICAgICAgIHNwPE1lZGlhU291cmNlU3BsaXR0ZXI+IHNwbGl0dGVyLAorICAgICAgICBpbnQzMl90IGNsaWVudElkKSB7CisgICAgbVNwbGl0dGVyID0gc3BsaXR0ZXI7CisgICAgbUNsaWVudElkID0gY2xpZW50SWQ7Cit9CisKK3N0YXR1c190IE1lZGlhU291cmNlU3BsaXR0ZXI6OkNsaWVudDo6c3RhcnQoTWV0YURhdGEgKnBhcmFtcykgeworICAgIHJldHVybiBtU3BsaXR0ZXItPnN0YXJ0KG1DbGllbnRJZCwgcGFyYW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k7CisgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgIGVyciA9IG5hdGl2ZV93aW5kb3dfc2V0X2J1ZmZlcnNfZ2VvbWV0cnkoCisgICAgICAgICAgICBtTmF0aXZlV2luZG93LmdldCgpLAorICAgICAgICAgICAgZGVmLmZvcm1hdC52aWRlby5uRnJhbWVXaWR0aCwKKyAgICAgICAgICAgIGRlZi5mb3JtYXQudmlkZW8ubkZyYW1lSGVpZ2h0LAorICAgICAgICAgICAgZGVmLmZvcm1hdC52aWRlby5lQ29sb3JGb3JtYXQpOworCisgICAgaWYgKGVyciAhPSAwKSB7CisgICAgICAgIExPR0UoIm5hdGl2ZV93aW5kb3dfc2V0X2J1ZmZlcnNfZ2VvbWV0cnkgZmFpbGVkOiAlcyAoJWQpIiwKKyAgICAgICAgICAgICAgICBzdHJlcnJvcigtZXJyKSwgLWVycik7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgLy8gSW5jcmVhc2UgdGhlIGJ1ZmZlciBjb3VudCBieSBvbmUgdG8gYWxsb3cgZm9yIHRoZSBBTmF0aXZlV2luZG93IHRvIGhvbGQKKyAgICAvLyBvbiB0byBvbmUgb2YgdGhlIGJ1ZmZlcnMuCisgICAgZGVmLm5CdWZmZXJDb3VudEFjdHVhbCsrOworICAgIGVyciA9IG1PTVgtPnNldFBhcmFtZXRlcigKKyAgICAgICAgICAgIG1Ob2RlLCBPTVhfSW5kZXhQYXJhbVBvcnREZWZpbml0aW9uLCAmZGVmLCBzaXplb2YoZGVmKSk7CisgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgIC8vIFNldCB1cCB0aGUgbmF0aXZlIHdpbmRvdy4KKyAgICAvLyBYWFggVE9ETzogR2V0IHRoZSBncmFsbG9jIHVzYWdlIGZsYWdzIGZyb20gdGhlIE9NWCBwbHVnaW4hCisgICAgZXJyID0gbmF0aXZlX3dpb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srKSB7CisgICAgICAgIGFuZHJvaWRfbmF0aXZlX2J1ZmZlcl90KiBidWY7CisgICAgICAgIGVyciA9IG1OYXRpdmVXaW5kb3ctPmRlcXVldWVCdWZmZXIobU5hdGl2ZVdpbmRvdy5nZXQoKSwgJmJ1Zik7CisgICAgICAgIGlmIChlcnIgIT0gMCkgeworICAgICAgICAgICAgTE9HRSgiZGVxdWV1ZUJ1ZmZlciBmYWlsZWQ6ICVzICglZCkiLCBzdHJlcnJvcigtZXJyKSwgLWVycik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHNwPEdyYXBoaWNCdWZmZXI+IGdyYXBoaWNCdWZmZXIobmV3IEdyYXBoaWNCdWZmZXIoYnVmLCBmYWxzZSkpOworICAgICAgICBJT01YOjpidWZmZXJfaWQgYnVmZmVySWQ7CisgICAgICAgIGVyciA9IG1PTVgtPnVzZUdyYXBoaWNCdWZmZXIobU5vZGUsIGtQb3J0SW5kZXhPdXRwdXQsIGdyYXBoaWNCdWZmZXIsCisgICAgICAgICAgICAgICAgJmJ1ZmZlcklkKTsKKyAgICAgICAgaWYgKGVyciAhPSAwKSB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIENPREVDX0xPR1YoInJlZ2lzdGVyZWQgZ3JhcGhpYyBidWZmZXIgd2l0aCBJRCAlcCAocG9pbnRlciA9ICVwKSIsCisgICAgICAgICAgICAgICAgYnVmZmVySWQsIGdyYXBoaWNCdWZmZXIuZ2V0KCkpOworCisgICAgICAgIEJ1ZmZlckluZm8gaW5mbzsKKyAgICAgICAgaW5mby5tRGF0YSA9IE5VTEw7CisgICAgICAgIGluZm8ubVNpemUgPSBkZWYubkJ1ZmZlclNpemU7CisgICAgICAgIGluZm8ubUJ1ZmZlciA9IGJ1ZmZlcklkOworICAgICAgICBpbmZvLm1Pd25lZEJ5Q29tcG9uZW50ID0gZmFsc2U7CisgICAgICAgIGluZm8ubU93bmVkQnlOYXRpdmVXa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ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgYnVmZmVycy0+cmVtb3ZlQXQoaSk7CiAjaWYgMAogICAgICAgICAgICAgfSBlbHNlIGlmIChtUG9ydFN0YXR1c1trUG9ydEluZGV4T3V0cHV0XSA9PSBFTkFCTEVECkBAIC0xNzc2LDggKzE5ODYsMTAgQEAKICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICBNZWRpYUJ1ZmZlciAqYnVmZmVyID0gaW5mby0+bU1lZGlhQnVmZmVyOworICAgICAgICAgICAgICAgIGJvb2wgaXNHcmFwaGljQnVmZmVyID0gYnVmZmVyLT5ncmFwaGljQnVmZmVyKCkgIT0gTlVMTDsKIAotICAgICAgICAgICAgICAgIGlmIChtc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS5yYW5nZV9vZmZzZXQKKyAgICAgICAgICAgICAgICBpZiAoIWlzR3JhcGhpY0J1ZmZlcgorICAgICAgICAgICAgICAgICAgICAmJiBtc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS5yYW5nZV9vZmZzZXQKICAgICAgICAgICAgICAgICAgICAgICAgICsgbXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEucmFuZ2VfbGVuZ3RoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPiBidWZmZXItPnNpemUoKSkgewogICAgICAgICAgICAgICAgICAgICBDT0RFQ19MT0dFKApAQCAtMTgwMSw3ICsyMDEzLDcgQEAKICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0SW50MzIoa0tleUlzQ29kZWNDb25maWcsIHRydWUpOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGlmIChtUXVpcmtzICYga091dHB1dEJ1ZmZlcnNBcmVVbnJlYWRhYmxlKSB7CisgICAgICAgICAgICAgICAgaWYgKGlzR3JhcGhpY0J1ZmZlciB8fCBtUXVpcmtzICYga091dHB1dEJ1ZmZlcnNBcmVVbnJlYWRhYmxlKSB7CiAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDMyKGtLZXlJc1VucmVhZGFibGUsIHRydWUpOwogICAgICAgICAgICAgICAgIH0KIApAQCAtMTg3MSw3ICsyMDgzLDQzIEBACiAKICAgICAgICAgY2FzZSBPTVhfRXZlbnRQb3J0U2V0dGluZ3NDaGFuZ2VkOgogICAgICAgICB7Ci0gICAgICAgICAgICBvblBvcnRTZXR0aW5nc0NoYW5nZWQoZGF0YTEpOworICAgICAgICAgICAgQ09ERUNfTE9HVigiT01YX0V2ZW50UG9ydFNldHRpbmdzQ2hhbmdlZChwb3J0PSVsZCwgZGF0YTI9MHglMDhseCkiLAorICAgICAgICAgICAgICAgICAgICAgICBkYXRhMSwgZGF0YTIpOworCisgICAgICAgICAgICBpZiAoZGF0YTIgPT0gMCB8fCBkYXRhMiA9PSBPTVhfSW5kZXhQYXJhbVBvcnREZWZpbml0aW9uKSB7CisgICAgICAgICAgICAgICAgb25Qb3J0U2V0dGluZ3NDaGFuZ2VkKGRhdGExKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0YTEgPT0ga1BvcnRJbmRleE91dHB1dAorICAgICAgICAgICAgICAgICAgICAmJiBkYXRhMiA9PSBPTVhfSW5kZXhDb25maWdDb21tb25PdXRwdXRDcm9wKSB7CisKKyAgICAgICAgICAgICAgICBPTVhfQ09ORklHX1JFQ1RUWVBFIHJlY3Q7CisgICAgICAgICAgICAgICAgcmVjdC5uUG9ydEluZGV4ID0ga1BvcnRJbmRleE91dHB1dDsKKyAgICAgICAgICAgICAgICBJbml0T01YUGFyYW1zKCZyZWN0KTsKKworICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgbU9NWC0+Z2V0Q29uZmlnKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTm9kZSwgT01YX0luZGV4Q29uZmlnQ29tbW9uT3V0cHV0Q3JvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlY3QsIHNpemVvZihyZWN0KSk7CisKKyAgICAgICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7CisgICAgICAgICAgICAgICAgICAgIENPREVDX0xPR1YoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm91dHB1dCBjcm9wICglbGQsICVsZCwgJWxkLCAlbGQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWN0Lm5MZWZ0LCByZWN0Lm5Ub3AsIHJlY3QubldpZHRoLCByZWN0Lm5IZWlnaHQpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChtTmF0aXZlV2luZG93ICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZHJvaWRfbmF0aXZlX3JlY3RfdCBjcm9wOworICAgICAgICAgICAgICAgICAgICAgICAgY3JvcC5sZWZ0ID0gcmVjdC5uTGVmdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNyb3AudG9wID0gcmVjdC5uVG9wOworICAgICAgICAgICAgICAgICAgICAgICAgY3JvcC5yaWdodCA9IGNyb3AubGVmdCArIHJlY3QubldpZHRoIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNyb3AuYm90dG9tID0gY3JvcC50b3AgKyByZWN0Lm5IZWlnaHQgLSAxOworCisgICAgICAgICAgICAgICAgICAgICAgICBDSEVDS19FUSgwLCBuYXRpdmVfd2luZG93X3NldF9jcm9wKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5hdGl2ZVdpbmRvdy5nZXQoKSwgJmNyb3ApKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIENPREVDX0xPR0UoImdldENvbmZpZyhPTVhfSW5kZXhDb25maWdDb21tb25PdXRwdXRDcm9wKSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJldHVybmVkIGVycm9yIDB4JTA4eCIsIGVycik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KIApAQCAtMjIwMSw2ICsyNDQ5LDE1IEBACiAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgbm9ib2R5IGJ1dCB1cyBvd25zIHRoaXMgYnVmZmVyIGF0IHRoaXMgcG9pbnQuCiAgICAgICAgICAgICBDSEVDS19FUShpbmZvLT5tTWVkaWFCdWZmZXItPnJlZmNvdW50KCksIDApOwogCisgICAgICAgICAgICAvLyBDYW5jZWwgdGhlIGJ1ZmZlciBpZiBpdCBiZWxvbmdzIHRvIGFuIEFOYXRpdmVXaW5kb3cuCisgICAgICAgICAgICBzcDxHcmFwaGljQnVmZmVyPiBncmFwaGljQnVmZmVyID0gaW5mby0+bU1lZGlhQnVmZmVyLT5ncmFwaGljQnVmZmVyKCk7CisgICAgICAgICAgICBpZiAoIWluZm8tPm1Pd25lZEJ5TmF0aXZlV2luZG93ICYmIGdyYXBoaWNCdWZmZXIgIT0gMCkgeworICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGNhbmNlbEJ1ZmZlclRvTmF0aXZlV2luZG93KGluZm8pOworICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgICAgICAgIHN0aWNreUVyciA9IGVycjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIGluZm8tPm1NZWRpYUJ1ZmZlci0+cmVsZWFzZSgpOwogICAgICAgICB9CiAKQEAgLTIyNjEsNiArMjUxOCw3IEBACiAgICAgQ0hFQ0tfRVEobVBvcnRTdGF0dXNbcG9ydEluZGV4XSwgRU5BQkxFRCk7CiAgICAgbVBvcnRTdGF0dXNbcG9ydEluZGV4XSA9IERJU0FCTElORzsKIAorICAgIENPREVDX0xPR1YoInNlbmRpbmcgT01YX0N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AgICBpZiAoZXJyICE9IE9LKSB7CkBAIC0zMDk5LDcgKzMzNzcsMzIgQEAKIAogICAgICAgICBpZiAoaW5mby0+bU1lZGlhQnVmZmVyID09IGJ1ZmZlcikgewogICAgICAgICAgICAgQ0hFQ0tfRVEobVBvcnRTdGF0dXNba1BvcnRJbmRleE91dHB1dF0sIEVOQUJMRUQpOwotICAgICAgICAgICAgZmlsbE91dHB1dEJ1ZmZlcihpbmZvKTsKKyAgICAgICAgICAgIGlmIChidWZmZXItPmdyYXBoaWNCdWZmZXIoKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgZmlsbE91dHB1dEJ1ZmZlcihpbmZvKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc3A8TWV0YURhdGE+IG1ldGFEYXRhID0gaW5mby0+bU1lZGlhQnVmZmVyLT5tZXRhX2RhdGEoKTsKKyAgICAgICAgICAgICAgICBpbnQzMl90IHJlbmRlcmVkID0gMDsKKyAgICAgICAgICAgICAgICBpZiAoIW1ldGFEYXRhLT5maW5kSW50MzIoa0tleVJlbmRlcmVkLCAmcmVuZGVyZWQpKSB7CisgICAgICAgICAgICAgICAgICAgIHJlbmRlcmVkID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFyZW5kZXJlZCkgeworICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBjYW5jZWxCdWZmZXJUb05hdGl2ZVdpbmRvdyhpbmZvKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGVyciA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGluZm8tPm1Pd25lZEJ5TmF0aXZlV2luZG93ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBEZXF1ZXVlIHRoZSBuZXh0IGJ1ZmZlciBmcm9tIHRoZSBuYXRpdmUgd2luZG93LgorICAgICAgICAgICAgICAgIEJ1ZmZlckluZm8gKm5leHRCdWZJbmZvID0gZGVxdWV1ZUJ1ZmZlckZyb21OYXRpdmVXaW5kb3coKTsKKyAgICAgICAgICAgICAgICBpZiAobmV4dEJ1ZkluZm8gPT0gMCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gR2l2ZSB0aGUgYnVmZmVyIHRvIHRoZSBPTVggbm9kZSB0byBmaWxsLgorICAgICAgICAgICAgICAgIGZpbGxPdXRwdXRCdWZmZXIobmV4dEJ1ZkluZm8pOworICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgfQpAQCAtMzQzMiw2ICszNzM1LDE4IEBACiAgICAgcHJpbnRmKCJ9XG4iKTsKIH0KIAorc3RhdHVzX3QgT01YQ29kZWM6OmluaXROYXRpdmVXaW5kb3coKSB7CisgICAgLy8gRW5hYmxlIHVzZSBvZiBhIEdyYXBoaWNCdWZmZXIgYXMgdGhlIG91dHB1dCBmb3IgdGhpcyBub2RlLiAgVGhpcyBtdXN0CisgICAgLy8gaGFwcGVuIGJlZm9yZSBnZXR0aW5nIHRoZSBJbmRleFBhcmFtUG9ydERlZmluaXRpb24gcGFyYW1ldGVyIGJlY2F1c2UgaXQKKyAgICAvLyB3aWxsIGFmZmVjdCB0aGUgcGl4ZWwgZm9ybWF0IHRoYXQgdGhlIG5vZGUgcmVwb3J0cy4KKyAgICBzdGF0dXNfdCBlcnIgPSBtT01YLT5lbmFibGVHcmFwaGljQnVmZmVycyhtTm9kZSwga1BvcnRJbmRleE91dHB1dCwgT01YX1RSVUUpOworICAgIGlmIChlcnIgIT0gMCkgeworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgIHJldHVybiBPSzsKK30KKwogdm9pZCBPTVhDb2RlYzo6aW5pdE91dHB1dEZvcm1hdChjb25zdCBzcDxNZXRhRGF0YT4gJmlucHV0Rm9ybWF0KSB7CiAgICAgbU91dHB1dEZvcm1hdCA9IG5ldyBNZXRhRGF0YTsKICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRDU3RyaW5nKGtLZXlEZWNvZGVyQ29tcG9uZW50LCBtQ29tcG9uZW50TmFtZSk7CkBAIC0zNTY2LDE3ICszODgxLDggQEAKICAgICAgICAgICAgICAgICBDSEVDSyghIlVua25vd24gY29tcHJlc3Npb24gZm9ybWF0LiIpOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAoIXN0cmNtcChtQ29tcG9uZW50TmFtZSwgIk9NWC5QVi5hdmNkZWMiKSkgewotICAgICAgICAgICAgICAgIC8vIFRoaXMgY29tcG9uZW50IGFwcGVhcnMgdG8gYmUgbHlpbmcgdG8gbWUuCi0gICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoCi0gICAgICAgICAgICAgICAgICAgICAgICBrS2V5V2lkdGgsICh2aWRlb19kZWYtPm5GcmFtZVdpZHRoICsgMTUpICYgLTE2KTsKLSAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRJbnQzMigKLSAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlIZWlnaHQsICh2aWRlb19kZWYtPm5GcmFtZUhlaWdodCArIDE1KSAmIC0xNik7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldEludDMyKGtLZXlXaWR0aCwgdmlkZW9fZGVmLT5uRnJhbWVXaWR0aCk7Ci0gICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoa0tleUhlaWdodCwgdmlkZW9fZGVmLT5uRnJhbWVIZWlnaHQpOwotICAgICAgICAgICAgfQotCisgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRJbnQzMihrS2V5V2lkdGgsIHZ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Q0xldmVsMToKKyAgICAgICAgICAgIGxldmVsID0gQVZDX0xFVkVMMV9COworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsMWI6CisgICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWwxMToKKyAgICAgICAgICAgIGxldmVsID0gQVZDX0xFVkVMMV8xOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsMTI6CisgICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDFfMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE9NWF9WSURFT19BVkNMZXZlbDEzOgorICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwxXzM7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWwyOgorICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsMjE6CisgICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDJfMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE9NWF9WSURFT19BVkNMZXZlbDIyOgorICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwyXzI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWwzOgorICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwzOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsMzE6CisgICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDNfMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE9NWF9WSURFT19BVkNMZXZlbDMyOgorICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwzXzI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWw0OgorICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUw0OworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsNDE6CisgICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDRfMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE9NWF9WSURFT19BVkNMZXZlbDQyOgorICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUw0XzI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWw1OgorICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUw1OworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsNTE6CisgICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDVfMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgTE9HRSgiVW5rbm93biBvbXggbGV2ZWw6ICVkIiwgb214TGV2ZWwpOworICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKKyAgICB9CisgICAgKnB2TGV2ZWwgPSBsZXZlbDsKKyAgICByZXR1cm4gT0s7Cit9CisKIGlubGluZSBzdGF0aWMgdm9pZCBDb252ZXJ0WVVWNDIwU2VtaVBsYW5hclRvWVVWNDIwUGxhbmFyKAogICAgICAgICB1aW50OF90ICppbnl1diwgdWludDhfdCogb3V0eXV2LAogICAgICAgICBpbnQzMl90IHdpZHRoLCBpbnQzMl90IGhlaWdodCkgewpAQCAtMjMxLDEwICszMDUsMTYgQEAKICAgICBtRW5jUG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pYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvbTR2X2gyNjMvZW5jL000dkgyNjNFbmNvZGVyLmNwcApAQCAtMzIsNiArMzIsMTA0IEBACiAKIG5hbWVzcGFjZSBhbmRyb2lkIHsKIAorc3RhdGljIHN0YXR1c190IENvbnZlcnRPbXhQcm9maWxlTGV2ZWwoCisgICAgICAgIE1QNEVuY29kaW5nTW9kZSBtb2RlLAorICAgICAgICBpbnQzMl90IG9teFByb2ZpbGUsCisgICAgICAgIGludDMyX3Qgb214TGV2ZWwsCisgICAgICAgIFByb2ZpbGVMZXZlbFR5cGUqIHB2UHJvZmlsZUxldmVsKSB7CisgICAgTE9HVigiQ29udmVydE9teFByb2ZpbGVMZXZlbDogJWQvJWQvJWQiLCBtb2RlLCBvbXhQcm9maWxlLCBvbXhMZXZlbCk7CisgICAgUHJvZmlsZUxldmVsVHlwZSBwcm9maWxlTGV2ZWw7CisgICAgaWYgKG1vZGUgPT0gSDI2M19NT0RFKSB7CisgICAgICAgIHN3aXRjaCAob214UHJvZmlsZSkgeworICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fSDI2M1Byb2ZpbGVCYXNlbGluZToKKyAgICAgICAgICAgICAgICBpZiAob214TGV2ZWwgPiBPTVhfVklERU9fSDI2M0xldmVsNDUpIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HRSgiVW5zdXBwb3J0ZWQgbGV2ZWwgKCVkKSBmb3IgSDI2MyIsIG9teExldmVsKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBMT0dXKCJQViBkb2VzIG5vdCBzdXBwb3J0IGxldmVsIGNvbmZpZ3VyYXRpb24gZm9yIEgyNjMiKTsKKyAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gQ09SRV9QUk9GSUxFX0xFVkVMMjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBMT0dFKCJVbnN1cHBvcnRlZCBwcm9maWxlICglZCkgZm9yIEgyNjMiLCBvbXhQcm9maWxlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgICAgICB9CisgICAgfSBlbHNlIHsgIC8vIE1QRUc0CisgICAgICAgIHN3aXRjaCAob214UHJvZmlsZSkgeworICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRQcm9maWxlU2ltcGxlOgorICAgICAgICAgICAgICAgIHN3aXRjaCAob214TGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRMZXZlbDBiOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gU0lNUExFX1BST0ZJTEVfTEVWRUwwOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwxOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gU0lNUExFX1BST0ZJTEVfTEVWRUwxOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwyOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gU0lNUExFX1BST0ZJTEVfTEVWRUwyOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwzOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gU0lNUExFX1BST0ZJTEVfTEVWRUwzOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICBMT0dFKCJVbnN1cHBvcnRlZCBsZXZlbCAoJWQpIGZvciBNUEVHNCBzaW1wbGUgcHJvZmlsZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb214TGV2ZWwpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0UHJvZmlsZVNpbXBsZVNjYWxhYmxlOgorICAgICAgICAgICAgICAgIHN3aXRjaCAob214TGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRMZXZlbDBiOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gU0lNUExFX1NDQUxBQkxFX1BST0ZJTEVfTEVWRUwwOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwxOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gU0lNUExFX1NDQUxBQkxFX1BST0ZJTEVfTEVWRUwxOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwyOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gU0lNUExFX1NDQUxBQkxFX1BST0ZJTEVfTEVWRUwyOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICBMT0dFKCJVbnN1cHBvcnRlZCBsZXZlbCAoJWQpIGZvciBNUEVHNCBzaW1wbGUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic2NhbGFibGUgcHJvZmlsZSIsIG9teExldmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRQcm9maWxlQ29yZToKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKG9teExldmVsKSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwxOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gQ09SRV9QUk9GSUxFX0xFVkVMMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIE9NWF9WSURFT19NUEVHNExldmVsMjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbCA9IENPUkVfUFJPRklMRV9MRVZFTDI7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIExPR0UoIlVuc3VwcG9ydGVkIGxldmVsICglZCkgZm9yIE1QRUc0IGNvcmUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicHJvZmlsZSIsIG9teExldmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRQcm9maWxlQ29yZVNjYWxhYmxlOgorICAgICAgICAgICAgICAgIHN3aXRjaCAob214TGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRMZXZlbDE6CisgICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlTGV2ZWwgPSBDT1JFX1NDQUxBQkxFX1BST0ZJTEVfTEVWRUwxOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwyOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gQ09SRV9TQ0FMQUJMRV9QUk9GSUxFX0xFVkVMMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIE9NWF9WSURFT19NUEVHNExldmVsMzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbCA9IENPUkVfU0NBTEFCTEVfUFJPRklMRV9MRVZFTDM7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIExPR0UoIlVuc3VwcG9ydGVkIGxldmVsICglZCkgZm9yIE1QRUc0IGNvcmUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic2NhbGFibGUgcHJvZmlsZSIsIG9teExldmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBMT0dFKCJVbnN1cHBvcnRlZCBNUEVHNCBwcm9maWxlICglZCkiLCBvbXhQcm9maWxlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgICAgICB9CisgICAgfQorCisgICAgKnB2UHJvZmlsZUxldmVsID0gcHJvZmlsZUxldmVsOworICAgIHJldHVybiBPSzsKK30KKwogaW5saW5lIHN0YXRpYyB2b2lkIENvbnZlcnRZVVY0MjBTZW1pUGxhbmFyVG9ZVVY0MjBQbGFuYXIoCiAgICAgICAgIHVpbnQ4X3QgKmlueXV2LCB1aW50OF90KiBvdXR5dXYsCiAgICAgICAgIGludDMyX3Qgd2lkdGgsIGludDMyX3QgaGVpZ2h0KSB7CkBAIC0xNTAsOSArMjQ4LDE0IEBACiAgICAgL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R0aCwgbURlY29kZWRIZWlnaHQsCisgICAgICAgICAgICAgICAgZGF0YSwgMCwgZHN0LCBidWYtPnN0cmlkZSAqIDIpOworICAgIH0gZWxzZSBpZiAobVlVVk1vZGUgPT0gWVVWNDIwc3BUb1lVVjQyMHNwKSB7CisgICAgICAgIC8vIElucHV0IGFuZCBvdXRwdXQgYXJlIGJvdGggWVVWNDIwc3AsIGJ1dCB0aGUgYWxpZ25tZW50IHJlcXVpcmVtZW50cworICAgICAgICAvLyBhcmUgZGlmZmVyZW50LgorICAgICAgICBzaXplX3Qgc3JjWVN0cmlkZSA9IG1EZWNvZGVkV2lkdGg7CisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKnNyY1kgPSAoY29uc3QgdWludDhfdCAqKWRhdGE7CisgICAgICAgIHVpbnQ4X3QgKmRzdFkgPSAodWludDhfdCAqKWRzdDsKKyAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtRGVjb2RlZEhlaWdodDsgKytpKSB7CisgICAgICAgICAgICBtZW1jcHkoZHN0WSwgc3JjWSwgbURlY29kZWRXaWR0aCk7CisgICAgICAgICAgICBzcmNZICs9IHNyY1lTdHJpZGU7CisgICAgICAgICAgICBkc3RZICs9IGJ1Zi0+c3RyaWRlOworICAgICAgICB9CisKKyAgICAgICAgc2l6ZV90IHNyY1VWU3RyaWRlID0gKG1EZWNvZGVkV2lkdGggKyAxKSAmIH4xOworICAgICAgICBzaXplX3QgZHN0VVZTdHJpZGUgPSBBTElHTihtRGVjb2RlZFdpZHRoIC8gMiwgMzIpICogMjsKKworICAgICAgICBjb25zdCB1aW50OF90ICpzcmNVViA9IChjb25zdCB1aW50OF90ICopZGF0YQorICAgICAgICAgICAgKyBtRGVjb2RlZEhlaWdodCAqIG1EZWNvZGVkV2lkdGg7CisKKyAgICAgICAgc2l6ZV90IGRzdFVWT2Zmc2V0ID0gQUxJR04oQUxJR04obURlY29kZWRIZWlnaHQsIDMyKSAqIGJ1Zi0+c3RyaWRlLC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ZWNvZGVkV2lkdGggLyAyLCAzMikgKiAyOworCisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKnNyY1UgPSAoY29uc3QgdWludDhfdCAqKWRhdGEKKyAgICAgICAgICAgICsgbURlY29kZWRIZWlnaHQgKiBtRGVjb2RlZFdpZHRoOworCisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKnNyY1YgPQorICAgICAgICAgICAgc3JjVSArICgobURlY29kZWRXaWR0aCArIDEpIC8gMikgKiAoKG1EZWNvZGVkSGVpZ2h0ICsgMSkgLyAyKTsKKworICAgICAgICBzaXplX3QgZHN0VVZPZmZzZXQgPSBBTElHTihBTElHTihtRGVjb2RlZEhlaWdodCwgMzIpICogYnVmLT5zdHJpZGUsIDQwOTYpOworICAgICAgICB1aW50OF90ICpkc3RVViA9ICh1aW50OF90ICopZHN0ICsgZHN0VVZPZmZzZXQ7CisKKyAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCAobURlY29kZWRIZWlnaHQgKyAxKSAvIDI7ICsraSkgeworICAgICAgICAgICAgZm9yIChzaXplX3QgaiA9IDA7IGogPCAobURlY29kZWRXaWR0aCArIDEpIC8gMjsgKytqKSB7CisgICAgICAgICAgICAgICAgZHN0VVZbMiAqIGogKyAxXSA9IHNyY1Vbal07CisgICAgICAgICAgICAgICAgZHN0VVZbMiAqIGpdID0gc3JjVltqXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNyY1UgKz0gc3JjVVZTdHJpZGU7CisgICAgICAgICAgICBzcmNWICs9IHNyY1VWU3RyaWRlOworICAgICAgICAgICAgZHN0VVYgKz0gZHN0VVZTdHJpZGU7CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICBtZW1jcHkoZHN0LCBkYXRhLCBzaXplKTsKKyAgICB9CisKKyAgICBDSEVDS19FUSgwLCBtYXBwZXIudW5sb2NrKGJ1Zi0+aGFuZGxlKSk7CisKKyAgICBpZiAoKGVyciA9IG1TdXJmYWNlLT5xdW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lZCBjaGFyIGI7Ci0KLSAgICBociA9IHBSZWFkZXItPlJlYWQocG9zLCAxLCAmYik7Ci0gICAgaWYgKGhyIDwgMCkKLSAgICAgICAgcmV0dXJuIGhyOwotICAgICAgICAKLSAgICBhc3NlcnQoaHIgPT0gMEwpOwotICAgIAotICAgIGlmIChiICYgMHg4MCkgICAgICAgLy8xMDAwIDAwMDAKLSAgICB7Ci0gICAgICAgIGxlbiA9IDE7Ci0gICAgICAgIGIgJj0gMHg3RjsgICAgICAvLzAxMTEgMTExMQotICAgIH0gICAgICAgIAotICAgIGVsc2UgaWYgKGIgJiAweDQwKSAgLy8wMTAwIDAwMDAKLSAgICB7Ci0gICAgICAgIGxlbiA9IDI7Ci0gICAgICAgIGIgJj0gMHgzRjsgICAgICAvLzAwMTEgMTExMQotICAgIH0KLSAgICBlbHNlIGlmIChiICYgMHgyMCkgIC8vMDAxMCAwMDAwCi0gICAgewotICAgICAgICBsZW4gPSAzOwotICAgICAgICBiICY9IDB4MUY7ICAgICAgLy8wMDAxIDExMTEKLSAgICB9Ci0gICAgZWxzZSBpZiAoYiAmIDB4MTApICAvLzAwMDEgMDAwMAotICAgIHsKLSAgICAgICAgbGVuID0gNDsKLSAgICAgICAgYiAmPSAweDBGOyAgICAgIC8vMDAwMCAxMTExCi0gICAgfQotICAgIGVsc2UgaWYgKGIgJiAweDA4KSAgLy8wMDAwIDEwMDAKLSAgICB7Ci0gICAgICAgIGxlbiA9IDU7Ci0gICAgICAgIGIgJj0gMHgwNzsgICAgICAvLzAwMDAgMDExMQotICAgIH0KLSAgICBlbHNlIGlmIChiICYgMHgwNCkgIC8vMDAwMCAwMTAwCi0gICAgewotICAgICAgICBsZW4gPSA2OwotICAgICAgICBiICY9IDB4MDM7ICAgICAgLy8wMDAwIDAwMTEKLSAgICB9Ci0gICAgZWxzZSBpZiAoYiAmIDB4MDIpICAvLzAwMDAgMDAxMAotICAgIHsKLSAgICAgICAgbGVuID0gNzsKLSAgICAgICAgYiAmPSAweDAxOyAgICAgIC8vMDAwMCAwMDAxCi0gICAgfQotICAgIGVsc2UgCi0gICAgewotICAgICAgICBhc3NlcnQoYiAmIDB4MDEpOyAgLy8wMDAwIDAwMDEKLSAgICAgICAgbGVuID0gODsKLSAgICAgICAgYiA9IDA7ICAgICAgICAgICAgIC8vMDAwMCAwMDAwCi0gICAgfQotICAgIAotICAgIGFzc2VydCgoYXZhaWxhYmxlIC0gcG9zKSA+PSBsZW4pOwotICAgIAotICAgIGxvbmcgbG9uZyByZXN1bHQgPSBiOwotICAgICsrcG9zOwotICAgIGZvciAobG9uZyBpID0gMTsgaSA8IGxlbjsgKytpKQotICAgIHsKLSAgICAgICAgaHIgPSBwUmVhZGVyLT5SZWFkKHBvcywgMSwgJmIpOwotICAgICAgICAKLSAgICAgICAgaWYgKGhyIDwgMCkKLSAgICAgICAgICAgIHJldHVybiBocjsKLSAgICAgICAgICAgIAotICAgICAgICBhc3NlcnQoaHIgPT0gMEwpOwotICAgICAgICAKLSAgICAgICAgcmVzdWx0IDw8PSA4OwotICAgICAgICByZXN1bHQgfD0gYjsKLSAgICAgICAgCi0gICAgICAgICsrcG9zOwotICAgIH0KLSAgICAKLSAgICByZXR1cm4gcmVzdWx0OwotfQotICAgIAotICAgIAotbG9uZyBsb25nIG1rdnBhcnNlcjo6R2V0VUludExlbmd0aCgKLSAgICBJTWt2UmVhZGVyKiBwUmVhZGVyLAotICAgIGxvbmcgbG9uZyBwb3MsIAotICAgIGxvbmcmIGxlbikKLXsKLSAgICBhc3NlcnQocFJlYWRlcik7Ci0gICAgYXNzZXJ0KHBvcyA+PSAwKTsKLSAgICAKLSAgICBsb25nIGxvbmcgdG90YWwsIGF2YWlsYWJsZTsKLQotICAgIGxvbmcgaHIgPSBwUmVhZGVyLT5MZW5ndGgoJnRvdGFsLCAmYXZhaWxhYmxlKTsKLSAgICBhc3NlcnQoaHIgPj0gMCk7Ci0gICAgYXNzZXJ0KGF2YWlsYWJsZSA8PSB0b3RhbCk7Ci0gICAgCi0gICAgaWYgKHBvcyA+PSBhdmFpbGFibGUpCi0gICAgICAgIHJldHVybiBwb3M7ICAvL3RvbyBmZXcgYnl0ZXMgYXZhaWxhYmxlCi0gICAgCi0gICAgdW5zaWduZWQgY2hhciBiOwotICAgIAotICAgIGhyID0gcFJlYWRlci0+UmVhZChwb3MsIDEsICZiKTsKLSAgICAKLSAgICBpZiAoaHIgPCAwKQotICAgICAgICByZXR1cm4gaHI7Ci0KLSAgICBhc3NlcnQoaHIgPT0gMEwpOwotICAgIAotICAgIGlmIChiID09IDApICAvL3dlIGNhbid0IGhhbmRsZSB1LWludCB2YWx1ZXMgbGFyZ2VyIHRoYW4gOCBieXRlcwotICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOwotICAgIAotICAgIHVuc2lnbmVkIGNoYXIgbSA9IDB4ODA7Ci0gICAgbGVuID0gMTsKLSAgICAKLSAgICB3aGlsZSAoIShiICYgbSkpCi0gICAgewotICAgICAgICBtID4+PSAxOwotICAgICAgICArK2xlbjsKLSAgICB9Ci0gICAgCi0gICAgcmV0dXJuIDA7ICAvL3N1Y2Nlc3MKLX0KLQotCi1sb25nIGxvbmcgbWt2cGFyc2VyOjpTeW5jUmVhZFVJbnQoCi0gICAgSU1rdlJlYWRlciogcFJlYWRlciwKLSAgICBsb25nIGxvbmcgcG9zLCAKLSAgICBsb25nIGxvbmcgc3RvcCwKLSAgICBsb25nJiBsZW4pCi17Ci0gICAgYXNzZXJ0KHBSZWFkZXIpOwotCi0gICAgaWYgKHBvcyA+PSBzdG9wKQotICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOwotICAgIAotICAgIHVuc2lnbmVkIGNoYXIgYjsKLSAgICAKLSAgICBsb25nIGhyID0gcFJlYWRlci0+UmVhZChwb3MsIDEsICZiKTsKLSAgICAKLSAgICBpZiAoaHIgPCAwKQotICAgICAgICByZXR1cm4gaHI7Ci0gICAgICAgIAotICAgIGlmIChociAhPSAwTCkKLSAgICAgICAgcmV0dXJuIEVfQlVGRkVSX05PVF9GVUxMOwotCi0gICAgaWYgKGIgPT0gMCkgIC8vd2UgY2FuJ3QgaGFuZGxlIHUtaW50IHZhbHVlcyBsYXJnZXIgdGhhbiA4IGJ5dGVzCi0gICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7Ci0gICAgCi0gICAgdW5zaWduZWQgY2hhciBtID0gMHg4MDsKLSAgICBsZW4gPSAxOwotICAgICAgICAKLSAgICB3aGlsZSAoIShiICYgbSkpCi0gICAgewotICAgICAgICBtID4+PSAxOwotICAgICAgICArK2xlbjsKLSAgICB9Ci0gICAgCi0gICAgaWYgKChwb3MgKyBsZW4pID4gc3RvcCkKLSAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsKLSAgICAgICAgCi0gICAgbG9uZyBsb25nIHJlc3VsdCA9IGIgJiAofm0pOwotICAgICsrcG9zOwotICAgIAotICAgIGZvciAoaW50IGkgPSAxOyBpIDwgbGVuOyArK2kpCi0gICAgewotICAgICAgICBociA9IHBSZWFkZXItPlJlYWQocG9zLCAxLCAmYik7Ci0gICAgICAgIAotICAgICAgICBpZiAoaHIgPCAwKQotICAgICAgICAgICAgcmV0dXJuIGhyOwotICAgICAgICAgICAKLSAgICAgICAgaWYgKGhyICE9IDBMKQotICAgICAgICAgICAgcmV0dXJuIEVfQlVGRkVSX05PVF9GVUxMOwotICAgICAgICAgICAgCi0gICAgICAgIHJlc3VsdCA8PD0gODsKLSAgICAgICAgcmVzdWx0IHw9IGI7Ci0gICAgICAgIAotICAgICAgICArK3BvczsKLSAgICB9Ci0gICAgCi0gICAgcmV0dXJuIHJlc3VsdDsKLX0KLQotCi1sb25nIGxvbmcgbWt2cGFyc2VyOjpVbnNlcmlhbGl6ZVVJbnQoCi0gICAgSU1rdlJlYWRlciogcFJlYWRlciwgCi0gICAgbG9uZyBsb25nIHBvcywKLSAgICBsb25nIGxvbmcgc2l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YXIqKSZyZXN1bHQ7Ci0gICAgdW5zaWduZWQgY2hhciogcSA9IHAgKyA0OwotICAgIAotICAgIGZvciAoOzspCi0gICAgewotICAgICAgICBociA9IHBSZWFkZXItPlJlYWQocG9zLCAxLCAtLXEpOwotICAgICAgICBhc3NlcnQoaHIgPT0gMEwpOwotICAgICAgICAKLSAgICAgICAgaWYgKHEgPT0gcCkKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgCi0gICAgICAgICsrcG9zOwotICAgIH0KLSAgICAKLSAgICByZXR1cm4gcmVzdWx0OwotfQotCi0KLWRvdWJsZSBta3ZwYXJzZXI6OlVuc2VyaWFsaXplOERvdWJsZSgKLSAgICBJTWt2UmVhZGVyKiBwUmVhZGVyLCAKLSAgICBsb25nIGxvbmcgcG9zKQotewotICAgIGFzc2VydChwUmVhZGVyKTsKLSAgICBhc3NlcnQocG9zID49IDApOwotICAgIAotICAgIGRvdWJsZSByZXN1bHQ7Ci0gICAgCi0gICAgdW5zaWduZWQgY2hhciogY29uc3QgcCA9ICh1bnNpZ25lZCBjaGFyKikmcmVzdWx0OwotICAgIHVuc2lnbmVkIGNoYXIqIHEgPSBwICsgODsKLSAgICAKLSAgICBmb3IgKDs7KQotICAgIHsKLSAgICAgICAgY29uc3QgbG9uZyBociA9IHBSZWFkZXItPlJlYWQocG9zLCAxLCAtLXEpOwotICAgICAgICBhc3NlcnQoaHIgPT0gMEwpOwotICAgICAgICAKLSAgICAgICAgaWYgKHEgPT0gcCkKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgCi0gICAgICAgICsrcG9zOwotICAgIH0KLSAgICAKLSAgICByZXR1cm4gcmVzdWx0OwotfQotCi1zaWduZWQgY2hhciBta3ZwYXJzZXI6OlVuc2VyaWFsaXplMVNJbnQoCi0gICAgSU1rdlJlYWRlciogcFJlYWRlciwKLSAgICBsb25nIGxvbmcgcG9zKQotewotICAgIGFzc2VydChwUmVhZGVyKTsKLSAgICBhc3NlcnQocG9z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gICAgYXNzZXJ0KGhyID09IDBMKTsKLSAgICAgICAgCi0gICAgICAgIGlmIChxID09IHApCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIAotICAgICAgICArK3BvczsKLSAgICB9Ci0gICAgCi0gICAgcmV0dXJuIHJlc3VsdDsKLX0KLQotCi1ib29sIG1rdnBhcnNlcjo6TWF0Y2goCi0gICAgSU1rdlJlYWRlciogcFJlYWRlciwKLSAgICBsb25nIGxvbmcmIHBvcywKLSAgICB1bnNpZ25lZCBsb25nIGlkXywKLSAgICBsb25nIGxvbmcmIHZhbCkKLQotewotICAgIGFzc2VydChwUmVhZGVyKTsKLSAgICBhc3NlcnQocG9zID49IDApOwotICAgIAotICAgIGxvbmcgbG9uZyB0b3RhbCwgYXZhaWxhYmxlOwotCi0gICAgbG9uZyBociA9IHBSZWFkZXItPkxlbmd0aCgmdG90YWwsICZhdmFpbGFibGUpOwotICAgIGFzc2VydChociA+PSAwKTsKLSAgICBhc3NlcnQoYXZhaWxhYmxlIDw9IHRvdGFsKTsKLSAgICAKLSAgICBsb25nIGxlbjsKLQotICAgIGNvbnN0IGxvbmcgbG9uZyBpZCA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsKLSAgICBhc3NlcnQoaWQgPj0gMCk7Ci0gICAgYXNzZXJ0KGxlbiA+IDApOwotICAgIGFzc2VydChsZW4gPD0gOCk7Ci0gICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IGF2YWlsYWJsZSk7Ci0gICAgCi0gICAgaWYgKCh1bnNpZ25lZCBsb25nKWlkICE9IGlkXykKLSAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAKLSAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkCi0gICAgCi0gICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgYXNzZXJ0KHNpemUgPj0gMCk7Ci0gICAgYXNzZXJ0KH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sb25nIGxvbmcgdG90YWwsIGF2YWlsYWJsZTsKLSAgICAKLSAgICBsb25nIGhyID0gcFJlYWRlci0+TGVuZ3RoKCZ0b3RhbCwgJmF2YWlsYWJsZSk7Ci0gICAgCi0gICAgaWYgKGhyIDwgMCkgCi0gICAgICAgIHJldHVybiBocjsKLSAgICAKLSAgICBwb3MgPSAwOyAgICAKLSAgICBsb25nIGxvbmcgZW5kID0gKDEwMjQgPCBhdmFpbGFibGUpPyAxMDI0OiBhdmFpbGFibGU7ICAgIAotCi0gICAgZm9yICg7OykKLSAgICB7ICAgIAotICAgICAgICB1bnNpZ25lZCBjaGFyIGIgPSAwOwotICAgIAotICAgICAgICB3aGlsZSAocG9zIDwgZW5kKQotICAgICAgICB7Ci0gICAgICAgICAgICBociA9IHBSZWFkZXItPlJlYWQocG9zLCAxLCAmYik7Ci0gICAgICAgICAgIAotICAgICAgICAgICAgaWYgKGhyIDwgMCkKLSAgICAgICAgICAgICAgICByZXR1cm4gaHI7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGlmIChiID09IDB4MUEpCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICArK3BvczsKLSAgICAgICAgfQotICAgIAotICAgICAgICBpZiAoYiAhPSAweDFBKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKHBvcyA+PSAxMDI0KSB8fAotICAgICAgICAgICAgICAgIChhdmFpbGFibGUgPj0gdG90YWwpIHx8IAotICAgICAgICAgICAgICAgICgodG90YWwgLSBhdmFpbGFibGUpIDwgNSkpCi0gICAgICAgICAgICAgICAgICByZXR1cm4gLTE7Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICByZXR1cm4gYXZhaWxhYmxlICsgNTsgIC8vNSA9IDQtYnl0ZSBJRCArIDFzdCBieXRlIG9mIHNpemUKLSAgICAgICAgfQotICAgIAotICAgICAgICBpZiAoKHRvdGFsIC0gcG9zKSA8IDUpCi0gICAgICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOwotICAgICAgICAgICAgCi0gICAgICAgIGlmICgoYXZhaWxhYmxlIC0gcG9zKSA8IDUpCi0gICAgICAgICAgICByZXR1cm4gcG9zICsgNTsgIC8vdHJ5IGFnYWluIGxhdGVyCi0KLSAgICAgICAgbG9uZyBsZW47ICAgICAgICAgICAgCi0KLSAgICAgICAgY29uc3QgbG9uZyBsb25nIHJlc3VsdCA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsKLSAgICAgICAgCi0gICAgICAgIGlmIChyZXN1bHQgPCAwKSAgLy9lcnJvcgotICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKLSAgICAgICAgICAgIAotICAgICAgICBpZiAocmVzdWx0ID09IDB4MEE0NURGQTMpICAvL1JlYWRJZCBtYXNrcy1vZmYgbGVuZ3RoIGluZGljYXRvciBiaXRzCi0gICAgICAgIHsKLSAgICAgICAgICAgIGFzc2VydChsZW4gPT0gNCk7Ci0gICAgICAgICAgICBwb3MgKz0gbGVuOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICArK3BvczsgIC8vdGhyb3cgYXdheSBqdXN0IHRoZSAweDFBIGJ5dGUsIGFuZCB0cnkgYWdhaW4KLSAgICB9Ci0gICAgICAgIAotICAgIGxvbmcgbGVuOwotICAgIGxvbmcgbG9uZyByZXN1bHQgPSBHZXRVSW50TGVuZ3RoKHBSZWFkZXIsIHBvcywgbGVuKTsKLSAgICAKLSAgICBpZiAocmVzdWx0IDwgMCkgIC8vZXJyb3IKLSAgICAgICAgcmV0dXJuIHJlc3VsdDsKLSAgICAgICAgCi0gICAgaWYgKHJlc3VsdCA+IDApICAvL25lZWQgbW9yZSBkYXRhCi0gICAgICAgIHJldHVybiByZXN1bHQ7Ci0gICAgICAgIAotICAgIGFzc2VydChsZW4gPiAwKTsKLSAgICBhc3NlcnQobGVuIDw9IDgpOwotICAgIAotICAgIGlm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AgICAgZWxzZSBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDAyRjIsIG1fbWF4SWRMZW5ndGgpKSAgICAgICAgCi0gICAgICAgICAgICA7Ci0gICAgICAgIGVsc2UgaWYgKE1hdGNoKHBSZWFkZXIsIHBvcywgMHgwMkYzLCBtX21heFNpemVMZW5ndGgpKSAgICAgIAotICAgICAgICAgICAgOwotICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MDI4MiwgbV9kb2NUeXBlKSkgICAgICAgICAgICAKLSAgICAgICAgICAgIDsgCi0gICAgICAgIGVsc2UgaWYgKE1hdGNoKHBSZWFkZXIsIHBvcywgMHgwMjg3LCBtX2RvY1R5cGVWZXJzaW9uKSkgICAgIAotICAgICAgICAgICAgOwotICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MDI4NSwgbV9kb2NUeXBlUmVhZFZlcnNpb24pKSAKLSAgICAgICAgICAgIDsKLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICByZXN1bHQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgICAgICBhc3NlcnQocmVzdWx0ID4gMCk7Ci0gICAgICAgICAgICBhc3NlcnQobGVuID4gMCk7Ci0gICAgICAgICAgICBhc3NlcnQobGVuIDw9IDgpOwotICAgICAgICAKLSAgICAgICAgICAgIHBvcyArPSBsZW47Ci0gICAgICAgICAgICBhc3NlcnQocG9zIDwgZW5kKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgcmVzdWx0ID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOwotICAgICAgICAgICAgYXNzZXJ0KHJlc3VsdCA+PSAwKTsKLSAgICAgICAgICAgIGFzc2VydChsZW4gPiAwKTsKLSAgICAgICAgICAgIGFzc2VydChsZW4gPD0gOCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHBvcyArPSBsZW4gKyByZX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GVuKTsKLSAgICAgICAgCi0gICAgICAgIGlmIChyZXN1bHQpICAvL2Vycm9yLCBvciB0b28gZmV3IGF2YWlsYWJsZSBieXRlcwotICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKLSAgICAgICAgICAgIAotICAgICAgICBpZiAoKHBvcyArIGxlbikgPiB0b3RhbCkKLSAgICAgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7Ci0gICAgICAgICAgICAKLSAgICAgICAgaWYgKChwb3MgKyBsZW4pID4gYXZhaWxhYmxlKQotICAgICAgICAgICAgcmV0dXJuIHBvcyArIGxlbjsKLQotICAgICAgICAvL1RPRE86IGlmIHdlIGxpYmVyYWxpemUgdGhlIGJlaGF2aW9yIG9mIFJlYWRVSW50LCB3ZSBjYW4KLSAgICAgICAgLy9wcm9iYWJseSBlbGltaW5hdGUgaGF2aW5nIHRvIHVzZSBHZXRVSW50TGVuZ3RoIGhlcmUuCi0gICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZCA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsKLSAgICAgICAgCi0gICAgICAgIGlmIChpZCA8IDApICAvL2Vycm9yCi0gICAgICAgICAgICByZXR1cm4gaWQ7Ci0gICAgICAgICAgICAKLSAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBJRAotICAgICAgICAKLSAgICAgICAgLy9SZWFkIFNpemUKLSAgICAgICAgCi0gICAgICAgIHJlc3VsdCA9IEdldFVJbnRMZW5ndGgocFJlYWRlciwgcG9zLCBsZW4pOwotICAgICAgICAKLSAgICAgICAgaWYgKHJlc3VsdCkgIC8vZXJyb3IsIG9yIHRvbyBmZXcgYXZhaWxhYmxlIGJ5dGVzCi0gICAgICAgICAgICByZXR1cm4gcmVzdWx0OwotICAgICAgICAgICAgCi0gICAgICAgIGlmICgocG9zICsgbGVuKSA+IHRvdGFsKQotICAgICAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsKLSAgICAgICAgICAgIAotICAgICAgICBpZiAoKHBvcyArIGxlbikgPiBhdmFpbGFibGUpCi0gICAgICAgICAgICByZXR1cm4gcG9zICsgbGVuOwotCi0gICAgICAgIC8vVE9ETzogaWYgd2UgbGliZXJhbGl6ZSB0aGUgYmVoYXZpb3Igb2YgUmVhZFVJbnQsIHdlIGNhbgotICAgICAgICAvL3Byb2JhYmx5IGVsaW1pbmF0ZSBoYXZpbmcgdG8gdXNlIEdldFVJbnRMZW5ndGggaGVyZS4KLSAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgIAotICAgICAgICBpZiAoc2l6ZSA8IDApCi0gICAgICAgICAgICByZXR1cm4gc2l6ZTsKLSAgICAgICAgICAgIAotICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGxlbmd0aCBvZiBzaXplIG9mIGVsZW1lbnQKLSAgICAgICAgCi0gICAgICAgIC8vUG9zIG5vdyBwb2ludHMgdG8gc3RhcnQgb2YgcGF5bG9hZAotICAgICAgICAKLSAgICAgICAgaWYgKChwb3MgKyBzaXplKSA+IHRvdGFsKQotICAgICAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsKLSAgICAgICAgCi0gICAgICAgIGlmIChpZCA9PSAweDA4NTM4MDY3KSAgLy9TZWdtZW50IElECi0gICAgICAgIHsKLSAgICAgICAgICAgIHBTZWdtZW50ID0gbmV3ICBTZWdtZW50KHBSZWFkZXIsIHBvcywgc2l6ZSk7IAotICAgICAgICAgICAgYXNzZXJ0KHBTZWdtZW50KTsgIC8vVE9ETyAgIAotCi0gICAgICAgICAgICByZXR1cm4gMDsgICAgLy9zdWNjZXNzCi0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIHBvcyArPSBzaXplOyAgLy9jb25zdW1lIHBheWxvYWQKLSAgICB9Ci0gICAgCi0gICAgYXNzZXJ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AgICAgaWYgKHJlc3VsdCkgIC8vZXJyb3IsIG9yIHRvbyBmZXcgYXZhaWxhYmxlIGJ5dGVzCi0gICAgICAgICAgICByZXR1cm4gcmVzdWx0OwotICAgICAgICAgICAgCi0gICAgICAgIGlmICgocG9zICsgbGVuKSA+IHN0b3ApCi0gICAgICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOwotICAgICAgICAgICAgCi0gICAgICAgIGlmICgocG9zICsgbGVuKSA+IGF2YWlsYWJsZSkKLSAgICAgICAgICAgIHJldHVybiBwb3MgKyBsZW47Ci0gICAgICAgICAgICAKLSAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkcG9zID0gcG9zOwotICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChtX3BSZWFkZXIsIGlkcG9zLCBsZW4pOwotICAgICAgICAKLSAgICAgICAgaWYgKGlkIDwgMCkgIC8vZXJyb3IKLSAgICAgICAgICAgIHJldHVybiBpZDsKLSAgICAgICAgICAgIAotICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIElECi0gICAgICAgIAotICAgICAgICAvL1JlYWQgU2l6ZQotICAgICAgICByZXN1bHQgPSBHZXRVSW50TGVuZ3RoKG1fcFJlYWRlciwgcG9zLCBsZW4pOwotICAgICAgICAKLSAgICAgICAgaWYgKHJlc3VsdCkgIC8vZXJyb3IsIG9yIHRvbyBmZXcgYXZhaWxhYmxlIGJ5dGVzCi0gICAgICAgICAgICByZXR1cm4gcmVzdWx0OwotICAgICAgICAgICAgCi0gICAgICAgIGlmICgocG9zICsgbGVuKSA+IHN0b3ApCi0gICAgICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOwotICAgICAgICAgICAgCi0gICAgICAgIGlmICgocG9zICsgbGVuKSA+IGF2YWlsYWJsZSkKLSAgICAgICAgICAgIHJldHVybiBwb3MgKyBsZW47Ci0KLSAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChtX3BSZWFkZXIsIHBvcywgbGVuKTsKLSAgICAgICAgCi0gICAgICAgIGlmIChzaXplIDwgMCkKLSAgICAgICAgICAgIHJldHVybiBzaXplOwotICAgICAgICAgICAgCi0gICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgbGVuZ3RoIG9mIHNpemUgb2YgZWxlbWVudAotICAgICAgICAKLSAgICAgICAgLy9Qb3Mgbm93IHBvaW50cyB0byBzdGFydCBvZiBwYXlsb2FkCi0gICAgICAgIAotICAgICAgICBpZiAoKHBvcyArIHNpemUpID4gc3RvcCkKLSAgICAgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7Ci0gICAgICAgICAgICAKLSAgICAgICAgLy9XZSByZWFkIEVCTUwgZWxlbWVudHMgZWl0aGVyIGluIHRvdGFsIG9yIG5vdGhpbmcgYXQgYWxsLgotICAgICAgICAgICAgCi0gICAgICAgIGlmICgocG9zICsgc2l6ZSkgPiBhdmFpbGFibGUpCi0gICAgICAgICAgICByZXR1cm4gcG9zICsgc2l6ZTsKLSAgICAgICAgCi0gICAgICAgIGlmIChpZCA9PSAweDA1NDlBOTY2KSAgLy9TZWdtZW50IEluZm8gSUQKLSAgICAgICAgewotICAgICAgICAgICAgYXNzZXJ0KG1fcEluZm8gPT0gTlVMTCk7Ci0gICAgICAgICAgICBtX3BJbmZvID0gbmV3ICBTZWdtZW50SW5mbyh0aGlzLCBwb3MsIHNpemUpOwotICAgICAgICAgICAgYXNzZXJ0KG1fcEluZm8pOyAgLy9UT0RPCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIGlmIChtX3BUcmFja3MpCi0gICAgICAgICAgICAgICAgYlF1aXQgPSB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGlkID09IDB4MDY1NEFFNkIpICAvL1RyYWNrcyBJRAotICAgICAgICB7Ci0gICAgICAgICAgICBhc3NlcnQobV9wVHJhY2tzID09IE5VTEwpOwotICAgICAgICAgICAgbV9wVHJhY2tzID0gbmV3ICBUcmFja3ModGhpcywgcG9zLCBzaXplKTsKLSAgICAgICAgICAgIGFzc2VydChtX3BUcmFja3MpOyAgLy9UT0RPCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIGlmIChtX3BJbmZvKQotICAgICAgICAgICAgICAgIGJRdWl0ID0gdHJ1ZTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChpZCA9PSAweDBGNDNCNjc1KSAgLy9DbHVzdGVyIElECi0gICAgICAgIHsKLSNpZiAwCi0gICAgICAgICAgICBpZiAobV9wSW5mbyA9PSBOVUxMKSAgLy9UT0RPOiBsaWJlcmFsaXplCi0gICAgICAgICAgICAgICAgOyAgCi0gICAgICAgICAgICBlbHNlIGlmIChtX3BUcmFja3MgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICA7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgLy9QYXJzZUNsdXN0ZXIoaWRwb3MsIHBvcywgc2l6ZSk7ICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgQ2x1c3Rlcjo6UGFyc2UodGhpcywgbV9jbHVzdGVycywgcG9zLCBzaXplKTsKLSNlbmRpZgotICAgICAgICAgICAgYlF1aXQgPSB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBtX3BvcyA9IHBvcyArIHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZAotICAgIH0KLSAgICAKLSAgICBhc3NlcnQobV9wb3MgPD0gc3RvcCk7Ci0gICAgCi0gICAgcmV0dXJuIDA7ICAvL3N1Y2Nlc3MKLX0KLQotCi1sb25nIFNlZ21lbnQ6OlBhcnNlQ2x1c3RlcihDbHVzdGVyKiYgcENsdXN0ZXIsIGxvbmcgbG9uZyYgcG9zXykgY29uc3QKLXsKLSAgICBwQ2x1c3RlciA9IE5VTEw7Ci0gICAgcG9zXyA9IC0xOwotICAgIAotICAgIGNvbnN0IGxvbmcgbG9uZyBzdG9wID0gbV9zdGFydCArIG1fc2l6ZTsKLSAgICBhc3NlcnQobV9wb3MgPD0gc3RvcCk7Ci0gICAgCi0gICAgbG9uZyBsb25nIHBvcyA9IG1fcG9zOwotICAgIGxvbmcgbG9uZyBvZmYgPSAtMTsKLSAgIAotIAotICAgIHdoaWxlIChwb3MgPCBzdG9wKQotICAgIHsKLSAgICAgICAgbG9uZyBsZW47Ci0gICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZHBvcyA9IHBvczsKLSAgICAgICAgCi0gICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZCA9IFN5bmNSZWFkVUludChtX3BSZWFkZXIsIHBvcywgc3RvcCwgbGVuKTsKLSAgICAgICAgCi0gICAgICAgIGlmIChpZCA8IDApICAvL2Vycm9yCi0gICAgICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3Q8bG9uZz4oaWQpOwotICAgICAgICAgICAgCi0gICAgICAgIGlmIChpZCA9PSAwKQotICAgICAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsKLSAgICAgICAgICAgIAotICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkICAgICAgICAKLSAgICAgICAgYXNzZXJ0KHBvcyA8IHN0b3ApOwotCi0gICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplID0gU3luY1JlYWRVSW50KG1fcFJlYWRlciwgcG9zLCBzdG9wLCBsZW4pOwotICAgICAgICAKLSAgICAgICAgaWYgKHNpemUgPCAwKSAgLy9lcnJvcgotICAgICAgICAgICAgcmV0dXJuIHN0YXRpY19jYXN0PGxvbmc+KHNpemUpOwotICAgICAgICAgICAgCi0gICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgc2l6ZQotICAgICAgICBhc3NlcnQocG9zIDw9IHN0b3ApOwotICAgICAgICAgICAgCi0gICAgICAgIGlmIChzaXplID09IDApICAvL3dlaXJkCi0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIAotICAgICAgICAvL3BvcyBub3cgcG9pbnRzIHRvIHN0YXJ0IG9mIHBheWxvYWQKLSAgICAgICAgICAgIAotICAgICAgICBwb3MgKz0gc2l6ZTsgIC8vY29uc3VtZSBwYXlsb2FkCi0gICAgICAgIGFzc2VydChwb3MgPD0gc3RvcCk7Ci0KLSAgICAgICAgaWYgKG9mZiA+PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBwb3NfID0gaWRwb3M7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChpZCA9PSAweDBGNDNCNjc1KSAgLy9DbHVzdGVyIElECi0gICAgICAgICAgICBvZmYgPSBpZHBvcyAtIG1fc3RhcnQ7Ci0gICAgfQotICAgIAotICAgIFNlZ21lbnQqIGNvbnN0IHRoaXNfID0gY29uc3RfY2FzdDxTZWdtZW50Kj4odGhpcyk7Ci0gICAgY29uc3Qgc2l6ZV90IGlkeCA9IG1fY2x1c3RlckNvdW50OwotICAgIAotICAgIGlmIChwb3MgPj0gc3RvcCkKLSAgICB7Ci0gICAgICAgIHBvc18gPSBzdG9wOwotICAgICAgICAKLSNpZiAwICAgICAgICAKLSAgICAgICAgaWYgKG9mZiA8IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBDbHVzdGVyID0gQ2x1c3Rlcjo6Q3JlYXRlRW5kT2ZTdHJlYW0odGhpc18sIGlkeCk7Ci0gICAgICAgICAgICByZXR1cm4gMUw7Ci0gICAgICAgIH0KLSNlbHNlCi0gICAgICAgIGlmIChvZmYgPCAwKQotICAgICAgICAgICAgcmV0dXJuIDFMOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIC8vUmVhZGluZyAwIGJ5dGVzIGF0IHBvcyBtaWdodCB3b3JrIHRvbyAtLSBpdCB3b3VsZCBkZXBlbmQgCi0gICAgICAgIC8vb24gaG93IHRoZSByZWFkZXIgaXMgaW1wbGVtZW50ZWQuCi0gICAgICAgIAotICAgICAgICB1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RlciwgaWRwb3MsIGxlbik7Ci0gICAgICAgIAotICAgICAgICBpZiAoaWQgPCAwKSAgLy9lcnJvcgotICAgICAgICAgICAgcmV0dXJuIHN0YXRpY19jYXN0PGxvbmc+KGlkKTsKLSAgICAgICAgICAgIAotICAgICAgICBpbmRleCArPSBsZW47ICAvL2NvbnN1bWUgSUQKLSAgICAgICAgCi0gICAgICAgIC8vUmVhZCBTaXplCi0gICAgICAgIHJlc3VsdCA9IEdldFVJbnRMZW5ndGgobV9wUmVhZGVyLCBpbmRleCwgbGVuKTsKLSAgICAgICAgCi0gICAgICAgIGlmIChyZXN1bHQgPCAwKSAgLy9lcnJvcgotICAgICAgICAgICAgcmV0dXJuIHN0YXRpY19jYXN0PGxvbmc+KHJlc3VsdCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgaWYgKChpbmRleCArIGxlbikgPiBzdG9wKQotICAgICAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsKLSAgICAgICAgICAgIAotICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KG1fcFJlYWRlciwgaW5kZXgsIGxlbik7Ci0gICAgICAgIAotICAgICAgICBpZiAoc2l6ZSA8IDApICAvL2Vycm9yCi0gICAgICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3Q8bG9uZz4oc2l6ZSk7Ci0gICAgICAgICAgICAKLSAgICAgICAgaW5kZXggKz0gbGVuOyAgLy9jb25zdW1lIGxlbmd0aCBvZiBzaXplIG9mIGVsZW1lbnQKLSAKLSAgICAgICAgaWYgKGlkID09IDB4MEY0M0I2NzUpIC8vIENsdXN0ZXIgSUQgCi0gICAgICAgICAgICBicmVhazsKLQkKLSAgICAgICAgaWYgKGlkID09IDB4MDE0RDlCNzQpIC8vIFNlZWtIZWFkIElEIAotICAgICAgICB7Ci0gICAgICAgICAgICBQYXJzZVNlZWtIZWFkKGluZGV4LCBzaXplLCBOVUxMKTsgCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBpbmRleCArPSBzaXplOwotICAgIH0KLSAgICAgICAgCi0gICAgaWYgKG1fY2x1c3RlckNvdW50ID09IDApCi0gICAgICAgIHJldHVybiAtMUw7Ci0KLSAgICB3aGlsZSAobV9wb3MgPCBzdG9wKQotICAgIHsKLSAgICAgICAgbG9uZyBsb25nIHBvcyA9IG1fcG9zOwotICAgICAgICAKLSAgICAgICAgbG9uZyBsZW47Ci0KLSAgICAgICAgbG9uZyBsb25nIHJlc3VsdCA9IEdldFVJbnRMZW5ndGgobV9wUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgIAotICAgICAgICBpZiAocmVzdWx0IDwgMCkgIC8vZXJyb3IKLSAgICAgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdDxsb25nPihyZXN1bHQpOwotICAgICAgICAgICAgCi0gICAgICAgIGlmICgocG9zICsgbGVuKSA+IHN0b3ApCi0gICAgICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOwotICAgICAgICAgICAgCi0gICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZHBvcyA9IHBvczsKLSAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQobV9wUmVhZGVyLCBpZHBvcywgbGVuKTsKLSAgICAgICAgCi0gICAgICAgIGlmIChpZCA8IDApICAvL2Vycm9yCi0gICAgICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3Q8bG9uZz4oaWQpOwotICAgICAgICAgICAgCi0gICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgSUQKLSAgICAgICAgCi0gICAgICAgIC8vUmVhZCBTaXplCi0gICAgICAgIHJlc3VsdCA9IEdldFVJbnRMZW5ndGgobV9wUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgIAotICAgICAgICBpZiAocmVzdWx0IDwgMCkgIC8vZXJyb3IKLSAgICAgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdDxsb25nPihyZXN1bHQpOwotICAgICAgICAgICAgCi0gICAgICAgIGlmICgocG9zICsgbGVuKSA+IHN0b3ApCi0JICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOwotICAgICAgICAgICAgCi0gICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplID0gUmVhZFVJbnQobV9wUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgCi0gICAgICAgIGlmIChzaXplIDwgMCkgIC8vZXJyb3IKLSAgICAgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdDxsb25nPihzaXplKTsKLSAgICAgICAgICAgIAotICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGxlbmd0aCBvZiBzaXplIG9mIGVsZW1lbnQKLSAgICAgICAgCi0gICAgICAgIC8vUG9zIG5vdyBwb2ludHMgdG8gc3RhcnQgb2YgcGF5bG9hZAotICAgICAgICAKLSAgICAgICAgaWYgKChwb3MgKyBzaXplKSA+IHN0b3ApCi0gICAgICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOwotICAgICAgICAgICAgCi0gICAgICAgIGlmIChpZCA9PSAweDBGNDNCNjc1KSAgLy9DbHVzdGVyIElECi0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBpZiAoaWQgPT0gMHgwMTREOUI3NCkgIC8vU2Vla0hlYWQgSUQKLSAgICAgICAgewotICAgICAgICAgICAgbV9jbHVzdGVycyA9IG5ldyBDbHVzdGVyKlttX2NsdXN0ZXJDb3VudF07ICAgCi0gICAgICAgICAgICBzaXplX3QgaW5kZXggPSAwOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBQYXJzZVNlZWtIZWFkKHBvcywgc2l6ZSwgJmluZGV4KTsgICAgICAgICAgICAKLSAgICAgICAgICAgIGFzc2VydChpbmRleCA9PSBtX2NsdXN0ZXJDb3VudCk7Ci0gICAgICAgIH0gICAgICAgICAgICAKLSAgICAgICAgZWxzZSBpZiAoaWQg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ICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGFzc2VydChtX2NsdXN0ZXJzKTsKLSAgICAgICAgICAgIGFzc2VydChtX2NsdXN0ZXJDb3VudCA+IDApOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBzaXplX3QmIGluZGV4ID0gKnBJbmRleDsKLSAgICAgICAgICAgIGFzc2VydChpbmRleCA8IG1fY2x1c3RlckNvdW50KTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgQ2x1c3RlciomIHBDbHVzdGVyID0gbV9jbHVzdGVyc1tpbmRleF07Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHBDbHVzdGVyID0gQ2x1c3Rlcjo6UGFyc2UodGhpcywgaW5kZXgsIHNlZWtPZmYpOwotICAgICAgICAgICAgYXNzZXJ0KHBDbHVzdGVyKTsgIC8vVE9ETwotICAgICAgICAgICAgCi0gICAgICAgICAgICArK2luZGV4OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgaWYgKHNlZWtJZCA9PSAweDAxNEQ5Qjc0KSAgLy9TZWVrSGVhZCBJRAotICAgIHsKLSAgICAgICAgUGFyc2VTZWNvbmRhcnlTZWVrSGVhZChzZWVrT2ZmLCBwSW5kZXgpOwotICAgIH0KLX0KLQotCi1sb25nIGxvbmcgU2VnbWVudDo6VW5wYXJzZWQoKSBjb25zdAotewotICAgIGNvbnN0IGxvbmcgbG9uZyBzdG9wID0gbV9zdGFydCArIG1fc2l6ZTsKLQotICAgIGNvbnN0IGxvbmcgbG9uZyByZXN1bHQgPSBzdG9wIC0gbV9wb3M7Ci0gICAgYXNzZXJ0KHJlc3VsdCA+PSAwKTsKLSAgICAKLSAgICByZXR1cm4gcmVzdWx0OwotfQotCi0KLSNpZiAwICAvL05PVEU6IHRvbyBpbmVmZmljaWVudAotbG9uZyBsb25nIFNlZ21lbnQ6OkxvYWQobG9uZyBsb25nIHRpbWVfbnMpCi17Ci0gICAgaWYgKFVucGFyc2VkKCkgPD0gMC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zQxLCBtX3BXcml0aW5nQXBwQXNVVEY4KSkgIC8vWzU3XVs0MV0KLSAgICAgICAgICAgIGFzc2VydChtX3BXcml0aW5nQXBwQXNVVEY4KTsKLSAgICAgICAgICAgIAotICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4M0JBOSwgbV9wVGl0bGVBc1VURjgpKSAgICAgICAgLy9bN0JdW0E5XQotICAgICAgICAgICAgYXNzZXJ0KG1fcFRpdGxlQXNVVEY4KTsKLQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxvbmcgbGVuOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgICAgICAvL2lkOwotICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOwotICAgICAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkCi0gICAgICAgICAgICBhc3NlcnQoKHN0b3AgLSBwb3MpID4gMCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOwotICAgICAgICAgICAgYXNzZXJ0KHNpemUgPj0gMCk7Ci0gICAgICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHBvcyArPSBsZW4gKyBzaXplOyAgLy9jb25zdW1lIHNpemUgYW5kIHBheWxvYWQKLSAgICAgICAgICAgIGFzc2VydChwb3MgPD0gc3RvcCk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgCi0gICAgYXNzZXJ0KHBvcyA9PSBzdG9wKTsKLX0KLQotU2VnbWVudEluZm86On5TZWdtZ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gbGVuKTsKLSAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPOiBoYW5kbGUgZXJyb3IgY2FzZQotICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7Ci0jZW5kaWYKLSAgICAgICAgaWYgKE1hdGNoKHBSZWFkZXIsIHBvcywgMHgzMCwgbV93aWR0aCkpICAgICAgICAgCi0gICAgICAgICAgICA7Ci0gICAgICAgIGVsc2UgaWYgKE1hdGNoKHBSZWFkZXIsIHBvcywgMHgzQSwgbV9oZWlnaHQpKSAgIAotICAgICAgICAgICAgOwotICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MDM4M0UzLCBtX3JhdGUpKSAKLSAgICAgICAgICAgIDsKLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBsb25nIGxlbjsKLSAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZCA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsKLSAgICAgICAgICAgIGFzc2VydChpZCA+PSAwKTsgIC8vVE9ETzogaGFuZGxlIGVycm9yIGNhc2UKLSAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsKLSAgICAgICAgCi0gICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOwotICAgICAgICAgICAgYXNzZXJ0KHNpemUgPj0gMCk7ICAvL1RPRE86IGhhbmRsZSBlcnJvciBjYXNlCi0gICAgICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgbGVuZ3RoIG9mIHNpemUKLSAgICAgICAgICAgIGFzc2VydC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Ci17Ci0gICAgYXNzZXJ0KGkudHlwZSA9PSAyKTsKLSAgICBhc3NlcnQoaS5udW1iZXIgPiAwKTsKLQotICAgIElNa3ZSZWFkZXIqIGNvbnN0IHBSZWFkZXIgPSBwU2VnbWVudC0+bV9wUmVhZGVyOwotICAgIAotICAgIGNvbnN0IFNldHRpbmdzJiBzID0gaS5zZXR0aW5nczsKLSAgICBhc3NlcnQocy5zdGFydCA+PSAwKTsKLSAgICBhc3NlcnQocy5zaXplID49IDApOwotICAgIAotICAgIGxvbmcgbG9uZyBwb3MgPSBzLnN0YXJ0OwotICAgIGFzc2VydChwb3MgPj0gMCk7Ci0gICAgCi0gICAgY29uc3QgbG9uZyBsb25nIHN0b3AgPSBwb3MgKyBzLnNpemU7Ci0gICAgCi0gICAgd2hpbGUgKHBvcyA8IHN0b3ApCi0gICAgewotI2lmZGVmIF9ERUJVRwotICAgICAgICBsb25nIGxlbjsKLSAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOwotICAgICAgICBhc3NlcnQoaWQgPj0gMCk7ICAvL1RPRE86IGhhbmRsZSBlcnJvciBjYXNlCi0gICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsKLSNlbmRpZgotICAgICAgICBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDM1LCBtX3JhdGUpKSAgICAgICAgICAgIAotICAgICAgICAgICAgOwotICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MUYsIG1fY2hhbm5lbHMpKSAgIAotICAgICAgICAgICAgOwotICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MjI2NCwgbV9iaXREZXB0aCkpICAKLSAgICAgICAgICAgIDsgICAgICAgICAgICAKLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBsb25nIGxlbjsKLSAgICAgICAgICAgIGNvbnN0IGxvb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LSAgICAgICAgYXNzZXJ0KChwb3MxICsgbGVuKSA8PSBzdG9wKTsKLSAgICAgICAgCi0gICAgICAgIHBvczEgKz0gbGVuOyAgLy9jb25zdW1lIGlkCi0gICAgICAgIAotICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KHBSZWFkZXIsIHBvczEsIGxlbik7Ci0gICAgICAgIGFzc2VydChzaXplID49IDApOwotICAgICAgICBhc3NlcnQoKHBvczEgKyBsZW4pIDw9IHN0b3ApOwotICAgICAgICAKLSAgICAgICAgcG9zMSArPSBsZW47ICAvL2NvbnN1bWUgbGVuZ3RoIG9mIHNpemUKLSAgICAgICAgCi0gICAgICAgIC8vcG9zIG5vdyBkZXNpbmF0ZXMgc3RhcnQgb2YgZWxlbWVudAotICAgICAgICBpZiAoaWQgPT0gMHgyRSkgIC8vVHJhY2tFbnRyeSBJRAotICAgICAgICAgICAgKytjb3VudDsKLSAgICAgICAgICAgIAotICAgICAgICBwb3MxICs9IHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZAotICAgICAgICBhc3NlcnQocG9zMSA8PSBzdG9wKTsKLSAgICB9ICAgIAotCi0gICAgaWYgKGNvdW50IDw9IDApCi0gICAgICAgIHJldHVybjsKLQotICAgIG1fdHJhY2tFbnRyaWVzID0gbmV3IFRyYWNrKltjb3VudF07Ci0gICAgbV90cmFja0VudHJpZXNFbmQgPSBtX3RyYWNrRW50cmllczsKLQotICAgIGxvbmcgbG9uZyBwb3MgPSBtX3N0YXJ0OwotCi0gICAgd2hpbGUgKHBvcyA8IHN0b3ApCi0gICAgewotICAgICAgICBsb25nIGxlbjsKLSAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOwotICAgICAgICBhc3NlcnQoaWQgPj0gMCk7Ci0gICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsKLSAgICAgICAgCi0gICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgaWQKLSAgICAgICAgCi0gICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplMSA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsKLSAgICAgICAgYXNzZXJ0KHNpemUxID49IDApOwotICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7Ci0gICAgICAgIAotICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGxlbmd0aCBvZiBzaXplCi0gICAgICAgIAotICAgICAgICAvL3BvcyBub3cgZGVzaW5hdGVzIHN0YXJ0IG9mIGVsZW1lbnQKLSAgICAgICAgCi0gICAgICAgIGlmIChpZCA9PSAweDJFKSAgLy9UcmFja0VudHJ5IElECi0gICAgICAgICAgICBQYXJzZVRyYWNrRW50cnkocG9zLCBzaXplMSwgKm1fdHJhY2tFbnRyaWVzRW5kKyspOwotICAgICAgICAgICAgCi0gICAgICAgIHBvcyArPSBzaXplMTsgIC8vY29uc3VtZSBwYXlsb2FkCi0gICAgICAgIGFzc2VydChwb3MgPD0gc3RvcCk7Ci0gICAgfSAgICAKLX0KLQotdW5zaWduZWQgbG9uZyBUcmFja3M6OkdldFRyYWNrc0NvdW50KCkgY29uc3QKLXsKLSAgICBjb25zdCBwdHJkaWZmX3QgcmVzdWx0ID0gbV90cmFja0VudHJpZXNFbmQgLSBtX3RyYWNrRW50cmllczsKLSAgICBhc3NlcnQocmVzdWx0ID49IDApOwotICAgIAotICAgIHJldHVybiBzdGF0aWNfY2FzdDx1bnNpZ25lZCBsb25nPihyZXN1bHQpOwotfQotCi0KLXZvaWQgVHJhY2tzOjpQYXJzZVRyYWNrRW50cnkoCi0gICAgbG9uZyBsb25nIHN0YXJ0LAotICAgIGxvbmcgbG9uZyBzaXplLAotICAgIFRyYWNrKiYgcFRyYWNrKQotewotICAgIElNa3ZSZWFkZXIqIGNvbnN0IHBSZWFkZXIgPSBtX3BTZWdtZW50LT5tX3BSZWFkZXI7Ci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ICAgICAgICAgIDsgIAotCi0gICAgICAgIGVsc2UgaWYgKE1hdGNoKHBSZWFkZXIsIHBvcywgMHgyM0EyLCBpLmNvZGVjUHJpdmF0ZSwgJmkuY29kZWNQcml2YXRlU2l6ZSkpICAKLSAgICAgICAgICAgIDsgIAotCi0gICAgICAgIGVsc2UgaWYgKE1hdGNoKHBSZWFkZXIsIHBvcywgMHgwNTg2ODgsIGkuY29kZWNOYW1lQXNVVEY4KSkgICAKLSAgICAgICAgICAgIGFzc2VydChpLmNvZGVjTmFtZUFzVVRGOCk7ICAKLQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxvbmcgbGVuOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgICAgICBhc3NlcnQoaWQgPj0gMCk7ICAvL1RPRE86IGhhbmRsZSBlcnJvciBjYXNlCi0gICAgICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgaWQKLSAgICAgICAgICAgIAotICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTsgIC8vVE9ETzogaGFuZGxlIGVycm9yIGNhc2UKLSAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBsZW5ndGggb2Ygc2l6ZQotICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIHN0YXJ0ID0gcG9zOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBwb3MgKz0gc2l6ZTsgIC8vY29uc3VtZSBwYX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KLSAgICAgICAgVHJhY2sqIHBUcmFjayA9ICppKys7Ci0gICAgICAgIGRlbGV0ZSBwVHJhY2s7Ci0gICAgICAgIHBUcmFjayA9IE5VTEw7ICAgIAotICAgIH0KLQotICAgIGRlbGV0ZVtdIG1fdHJhY2tFbnRyaWVzOwotfQotCi0KLVRyYWNrKiBUcmFja3M6OkdldFRyYWNrQnlOdW1iZXIodW5zaWduZWQgbG9uZyB0bikgY29uc3QKLXsKLSAgICBUcmFjayoqIGkgPSBtX3RyYWNrRW50cmllczsKLSAgICBUcmFjayoqIGNvbnN0IGogPSBtX3RyYWNrRW50cmllc0VuZDsKLQotICAgIHdoaWxlIChpICE9IGopCi0gICAgewotICAgICAgICBUcmFjayogY29uc3QgcFRyYWNrID0gKmkrKzsKLSAgICAgICAKLSAgICAgICAgaWYgKHBUcmFjayA9PSBOVUxMKQotICAgICAgICAgICAgY29udGludWU7Ci0KLSAgICAgICAgaWYgKHRuID09IHBUcmFjay0+R2V0TnVtYmVyKCkpCi0gICAgICAgICAgICByZXR1cm4gcFRyYWNrOwotICAgIH0KLQotICAgIHJldHVybiBOVUxMOyAgLy9ub3QgZm91bmQKLX0KLQotCi1UcmFjayogVHJhY2tzOjpHZXRUcmFja0J5SW5kZXgodW5zaWduZWQgbG9uZyBpZHgpIGNvbnN0Ci17Ci0gICAgY29uc3QgcHRyZGlmZl90IGNvdW50ID0gbV90cmFja0VudHJpZXNFbmQgLSBtX3RyYWNrRW50cmllczsKLSAgICAgICAKLSAgICBpZiAoaWR4ID49IHN0YXRpY19jYXN0PHVuc2lnbmVkIGxvbmc+KGNvdW50KSkKLSAgICAgICAgIHJldHVybiBOVUxMOwotCi0gICAgcmV0dXJuIG1fdHJhY2tFbnRyaWVzW2lkeF07Ci19Ci0KLQotdm9pZCBDbHVzdGVyOjpMb2FkKCkKLXsKLSAgICBhc3NlcnQobV9wU2VnbWVudCk7Ci0gICAgCi0gICAgaWYgKG1fc3RhcnQgPiAwKQotICAgIHsKLSAgICA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IHBvcywgMHg2NywgdGltZWNvZGUpKQotICAgICAgICAgICAgYnJlYWs7ICAgICAgICAgICAgCi0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOwotICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPCi0gICAgICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgaWQKLSAgICAgICAgICAgIAotICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTsgIC8vVE9ETwotICAgICAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIHNpemUKLSAgICAgICAgICAgIAotICAgICAgICAgICAgaWYgKGlkID09IDB4MjApICAvL0Jsb2NrR3JvdXAgSUQKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgIGlmIChpZCA9PSAweDIzKSAgLy9TaW1wbGVCbG9jayBJRAotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBwb3MgKz0gc2l6ZTsgIC8vY29uc3VtZSBwYXlsb2FkCi0gICAgICAgICAgICBhc3NlcnQocG9zIDw9IHN0b3ApOwotICAgICAgICB9Ci0gICAgfQotICAgIAotICAgIGFzc2VydChwb3MgPD0gc3RvcCk7Ci0gICAgYXNzZXJ0KHRpbWVjb2RlID49IDApOwotICAgIAotICAgIG1fdGltZWNvZGUgPSB0aW1lY29kZTsKLX0KLQotCi1DbHVzdGVyKiBD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doaWxlIChpZHggPCBzdG9wKQotICAgIHsKLSAgICAgICAgaWYgKE1hdGNoKHBSZWFkZXIsIGlkeCwgMHg2NywgdGltZWNvZGUpKQotICAgICAgICAgICAgYXNzZXJ0KHRpbWVjb2RlID09IG1fdGltZWNvZGUpOwotICAgICAgICBlbHNlIAotICAgICAgICB7Ci0gICAgICAgICAgICBsb25nIGxlbjsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQocFJlYWRlciwgaWR4LCBsZW4pOwotICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPCi0gICAgICAgICAgICBhc3NlcnQoKGlkeCArIGxlbikgPD0gc3RvcCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGlkeCArPSBsZW47ICAvL2NvbnN1bWUgaWQKLSAgICAgICAgICAgIAotICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBpZHgsIGxlbik7Ci0gICAgICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTsgIC8vVE9ETwotICAgICAgICAgICAgYXNzZXJ0KChpZHggKyBsZW4pIDw9IHN0b3ApOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBpZHggKz0gbGVuOyAgLy9jb25zdW1lIHNpemUKLSAgICAgICAgICAgIAotICAgICAgICAgICAgaWYgKGlkID09IDB4MjApICAvL0Jsb2NrR3JvdXAgSUQKLSAgICAgICAgICAgICAgICArK21fZW50cmllc0NvdW50OwotICAgICAgICAgICAgZWxzZSBpZiAoaWQgPT0gMHgyMykgIC8vU2ltcGxlQmxvY2sgSUQKLSAgICAgICAgICAgICAgICArK21fZW50cmllc0NvdW50OwotCi0gICAgICAgICAgICBpZHggKz0gc2l6ZTsgIC8vY29uc3VtZSBwYXlsb2FkCi0KLSAgICAgICAgICAgIGFzc2VydChpZHggPD0gc3RvcCk7Ci0gICAgICAgIH0gIAotICAgIH0KLQotICAgIGlmIChtX2VudHJpZXNDb3VudCA9PSAwKQotICAgICAgICByZXR1cm47Ci0gICAgIAotICAgIG1fcEVudHJpZXMgPSBuZXcgQmxvY2tFbnRyeSpbbV9lbnRyaWVzQ291bnRdOwotICAgIHNpemVfdCBpbmRleCA9IDA7Ci0gICAgCi0gICAgd2hpbGUgKHBvcyA8IHN0b3ApCi0gICAgewotICAgICAgICBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDY3LCB0aW1lY29kZSkpCi0gICAgICAgICAgICBhc3NlcnQodGltZWNvZGUgPT0gbV90aW1lY29kZSk7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgbG9uZyBsZW47Ci0gICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgICAgICBhc3NlcnQoaWQgPj0gMCk7ICAvL1RPRE8KLSAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBpZAotICAgICAgICAgICAgCi0gICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsKLSAgICAgICAgICAgIGFzc2VydChzaXplID49IDApOyAgLy9UT0RPCi0gICAgICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgc2l6ZQotICAgICAgICAgICAgCi0gICAgICAgICAgICBpZiAoaWQgPT0gMHgyMCkgIC8vQmxvY2tHcm91cCBJRAotICAgICAgICAgICAgICAgIFBhcnNlQmxvY2tHcm91cChwb3MsIHNpemUsIGluZGV4KyspOwotICAgICAgICAgICAgZWxzZSBpZiAoaWQgPT0gMHgyM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OwotfQotCi0gICAgICAgIAotY29uc3QgQmxvY2tFbnRyeSogQ2x1c3Rlcjo6R2V0TmV4dChjb25zdCBCbG9ja0VudHJ5KiBwRW50cnkpIGNvbnN0Ci17Ci0gICAgYXNzZXJ0KHBFbnRyeSk7Ci0gICAgCi0gICAgc2l6ZV90IGlkeCA9IHBFbnRyeS0+R2V0SW5kZXgoKTsKLSAgICAKLSAgICArK2lkeDsKLQotICAgIGlmIChpZHggPT0gbV9lbnRyaWVzQ291bnQpIAotICAgICAgcmV0dXJuIE5VTEw7Ci0KLSAgICByZXR1cm4gbV9wRW50cmllc1tpZHhdOwotCi19Ci0KLQotY29uc3QgQmxvY2tFbnRyeSogQ2x1c3Rlcjo6R2V0RW50cnkoY29uc3QgVHJhY2sqIHBUcmFjaykKLXsKLQotICAgIGFzc2VydChwVHJhY2spOwotICAgIAotICAgIGlmIChtX3BTZWdtZW50ID09IE5VTEwpICAvL0VPUwotICAgICAgICByZXR1cm4gcFRyYWNrLT5HZXRFT1MoKTsKLSAgICAKLSAgICBMb2FkQmxvY2tFbnRyaWVzKCk7Ci0gICAgCi0gICAgQmxvY2tFbnRyeSogaSA9ICptX3BFbnRyaWVzOwotICAgIEJsb2NrRW50cnkqIGogPSAqbV9wRW50cmllcyArIG1fZW50cmllc0NvdW50OwotICAgIHdoaWxlIChpICE9IGopCi0gICAgewotICAgICAgICBCbG9ja0VudHJ5KiBwRW50cnkgPSBpOwotICAgICAgICBpKys7Ci0gICAgICAgIGFzc2VydChwRW50cnkpOwotICAgICAgICBhc3NlcnQoIXBFbnRyeS0+RU9TKCkpOwotICAgICAgICAKLSAgICAgICAgY29uc3QgQmxvY2sqIGNvbnN0IHBCbG9jayA9IHBFbnRyeS0+R2V0QmxvY2soKTsKLSAgICAgICAgYXNzZXJ0KHBCbG9jayk7Ci0gICAgICAgIAotICAgICAgICBpZiAocEJsb2NrLT5HZXRUcmFja051bWJlcigpICE9IHBUcmFjay0+R2V0TnVtYmVyKCkpCi0gICAgIC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ID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOwotICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPCi0gICAgICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgSUQKLSAgICAgICAgICAgIAotICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7Ci0gICAgICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTsgIC8vVE9ETwotICAgICAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIHNpemUKLSAgICAgICAgICAgIAotICAgICAgICAgICAgc3dpdGNoIChpZCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjYXNlIDB4MjM6ICAvL1NpbXBsZUJsb2NrIElECi0gICAgICAgICAgICAgICAgICAgIGJTaW1wbGVCbG9jayA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIC8vWUVTLCBGQUxMIFRIUk9VR0ggVE8gTkVYVCBDQVNFCi0KLSAgICAgICAgICAgICAgICBjYXNlIDB4MjE6ICAvL0Jsb2NrIElECi0gICAgICAgICAgICAgICAgICAgIFBhcnNlQmxvY2socG9zLCBzaXplKTsgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICBwb3MgKz0gc2l6ZTsgIC8vY29uc3VtZSBwYXlsb2FkCi0gICAgICAgICAgICBhc3Nl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QgbGVuIGlzIDgNCisNCisgICAgdW5zaWduZWQgY2hhciBiOw0KKw0KKyAgICBociA9IHBSZWFkZXItPlJlYWQocG9zLCAxLCAmYik7DQorICAgIGlmIChociA8IDApDQorICAgICAgICByZXR1cm4gaHI7DQorDQorICAgIGFzc2VydChociA9PSAwTCk7DQorDQorICAgIGlmIChiICYgMHg4MCkgICAgICAgLy8xMDAwIDAwMDANCisgICAgew0KKyAgICAgICAgbGVuID0gMTsNCisgICAgICAgIGIgJj0gMHg3RjsgICAgICAvLzAxMTEgMTExMQ0KKyAgICB9DQorICAgIGVsc2UgaWYgKGIgJiAweDQwKSAgLy8wMTAwIDAwMDANCisgICAgew0KKyAgICAgICAgbGVuID0gMjsNCisgICAgICAgIGIgJj0gMHgzRjsgICAgICAvLzAwMTEgMTExMQ0KKyAgICB9DQorICAgIGVsc2UgaWYgKGIgJiAweDIwKSAgLy8wMDEwIDAwMDANCisgICAgew0KKyAgICAgICAgbGVuID0gMzsNCisgICAgICAgIGIgJj0gMHgxRjsgICAgICAvLzAwMDEgMTExMQ0KKyAgICB9DQorICAgIGVsc2UgaWYgKGIgJiAweDEwKSAgLy8wMDAxIDAwMDANCisgICAgew0KKyAgICAgICAgbGVuID0gNDsNCisgICAgICAgIGIgJj0gMHgwRjsgICAgICAvLzAwMDAgMTExMQ0KKyAgICB9DQorICAgIGVsc2UgaWYgKGIgJiAweDA4KSAgLy8wMDAwIDEwMDANCisgICAgew0KKyAgICAgICAgbGVuID0gNTsNCisgICAgICAgIGIgJj0gMHgwNzsgICAgICAvLzAwMDAgMDExMQ0KKyAgICB9DQorICAgIGVsc2UgaWYgKGIgJiAweDA0KSAgLy8wMDAwIDAxMDANCisgICAgew0KKyAgICAgICAgbGVuID0gNjsNCisgICAgICAgIGIgJj0gMHgwMzsgICAgICAvLzAwMDAgMDAxMQ0KKyAgICB9DQorICAgIGVsc2UgaWYgKGIgJiAweDAyKSAgLy8wMDAwIDAwMTANCisgICAgew0KKyAgICAgICAgbGVuID0gNzsNCisgICAgICAgIGIgJj0gMHgwMTsgICAgICAvLzAwMDAgMDAwMQ0KKyAgICB9DQorICAgIGVsc2UNCisgICAgew0KKyAgICAgICAgYXNzZXJ0KGIgJiAweDAxKTsgIC8vMDAwMCAwMDAxDQorICAgICAgICBsZW4gPSA4Ow0KKyAgICAgICAgYiA9IDA7ICAgICAgICAgICAgIC8vMDAwMCAwMDAwDQorICAgIH0NCisNCisgICAgYXNzZXJ0KChhdmFpbGFibGUgLSBwb3MpID49IGxlbik7DQorDQorICAgIGxvbmcgbG9uZyByZXN1bHQgPSBiOw0KKyAgICArK3BvczsNCisgICAgZm9yIChsb25nIGkgPSAxOyBpIDwgbGVuOyArK2kpDQorICAgIHsNCisgICAgICAgIGhyID0gcFJlYWRlci0+UmVhZChwb3MsIDEsICZiKTsNCisNCisgICAgICAgIGlmIChociA8IDApDQorICAgICAgICAgICAgcmV0dXJuIGhyOw0KKw0KKyAgICAgICAgYXNzZXJ0KGhyID09IDBMKTsNCisNCisgICAgICAgIHJlc3VsdCA8PD0gODsNCisgICAgICAgIHJlc3VsdCB8PSBiOw0KKw0KKyAgICAgICAgKytwb3M7DQorICAgIH0NCisNCisgICAgcmV0dXJuIHJlc3VsdDsNCit9DQorDQorDQorbG9uZyBsb25nIG1rdnBhcnNlcjo6R2V0VUludExlbmd0aCgNCisgICAgSU1rdlJlYWRlciogcFJlYWRlciwNCisgICAgbG9uZyBsb25nIHBvcywNCisgICAgbG9uZyYgbGVuKQ0KK3sNCisgICAgYXNzZXJ0KHBSZWFkZXIpOw0KKyAgICBhc3NlcnQocG9zID49IDApOw0KKw0KKyAgICBsb25nIGxvbmcgdG90YWwsIGF2YWlsYWJsZTsNCisNCisgICAgbG9uZyBociA9IHBSZWFkZXItPkxlbmd0aCgmdG90YWwsICZhdmFpbGFibGUpOw0KKyAgICBhc3NlcnQoaHIgPj0gMCk7DQorICAgIGFzc2VydChhdmFpbGFibGUgPD0gdG90YWwpOw0KKw0KKyAgICBpZi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gICAgICAgcmV0dXJuIEVfQlVGRkVSX05PVF9GVUxMOw0KKw0KKyAgICBpZiAoYiA9PSAwKSAgLy93ZSBjYW4ndCBoYW5kbGUgdS1pbnQgdmFsdWVzIGxhcmdlciB0aGFuIDggYnl0ZXMNCisgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7DQorDQorICAgIHVuc2lnbmVkIGNoYXIgbSA9IDB4ODA7DQorICAgIGxlbiA9IDE7DQorDQorICAgIHdoaWxlICghKGIgJiBtKSkNCisgICAgew0KKyAgICAgICAgbSA+Pj0gMTsNCisgICAgICAgICsrbGVuOw0KKyAgICB9DQorDQorICAgIGlmICgocG9zICsgbGVuKSA+IHN0b3ApDQorICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOw0KKw0KKyAgICBsb25nIGxvbmcgcmVzdWx0ID0gYiAmICh+bSk7DQorICAgICsrcG9zOw0KKw0KKyAgICBmb3IgKGludCBpID0gMTsgaSA8IGxlbjsgKytpKQ0KKyAgICB7DQorICAgICAgICBociA9IHBSZWFkZXItPlJlYWQocG9zLCAxLCAmYik7DQorDQorICAgICAgICBpZiAoaHIgPCAwKQ0KKyAgICAgICAgICAgIHJldHVybiBocjsNCisNCisgICAgICAgIGlmIChociAhPSAwTCkNCisgICAgICAgICAgICByZXR1cm4gRV9CVUZGRVJfTk9UX0ZVTEw7DQorDQorICAgICAgICByZXN1bHQgPDw9IDg7DQorICAgICAgICByZXN1bHQgfD0gYjsNCisNCisgICAgICAgICsrcG9zOw0KKyAgICB9DQorDQorICAgIHJldHVybiByZXN1bHQ7DQorfQ0KKw0KKw0KK2xvbmcgbG9uZyBta3ZwYXJzZXI6OlVuc2VyaWFsaXplVUludCgNCisgICAgSU1rdlJlYWRlciogcFJlYWRlciwNCisgICAgbG9uZyBsb25nIHBvcywNCisgICAgbG9uZyBsb25nIHNpemUpDQorew0KKyAgICBhc3NlcnQocFJlYWRlcik7DQorICAgIGFzc2VydCh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CisgICAgew0KKyAgICAgICAgaHIgPSBwUmVhZGVyLT5SZWFkKHBvcywgMSwgLS1xKTsNCisgICAgICAgIGFzc2VydChociA9PSAwTCk7DQorDQorICAgICAgICBpZiAocSA9PSBwKQ0KKyAgICAgICAgICAgIGJyZWFrOw0KKw0KKyAgICAgICAgKytwb3M7DQorICAgIH0NCisNCisgICAgcmV0dXJuIHJlc3VsdDsNCit9DQorDQorDQorZG91YmxlIG1rdnBhcnNlcjo6VW5zZXJpYWxpemU4RG91YmxlKA0KKyAgICBJTWt2UmVhZGVyKiBwUmVhZGVyLA0KKyAgICBsb25nIGxvbmcgcG9zKQ0KK3sNCisgICAgYXNzZXJ0KHBSZWFkZXIpOw0KKyAgICBhc3NlcnQocG9zID49IDApOw0KKw0KKyAgICBkb3VibGUgcmVzdWx0Ow0KKw0KKyAgICB1bnNpZ25lZCBjaGFyKiBjb25zdCBwID0gKHVuc2lnbmVkIGNoYXIqKSZyZXN1bHQ7DQorICAgIHVuc2lnbmVkIGNoYXIqIHEgPSBwICsgODsNCisNCisgICAgZm9yICg7OykNCisgICAgew0KKyAgICAgICAgY29uc3QgbG9uZyBociA9IHBSZWFkZXItPlJlYWQocG9zLCAxLCAtLXEpOw0KKyAgICAgICAgYXNzZXJ0KGhyID09IDBMKTsNCisNCisgICAgICAgIGlmIChxID09IHApDQorICAgICAgICAgICAgYnJlYWs7DQorDQorICAgICAgICArK3BvczsNCisgICAgfQ0KKw0KKyAgICByZXR1cm4gcmVzdWx0Ow0KK30NCisNCitzaWduZWQgY2hhciBta3ZwYXJzZXI6OlVuc2VyaWFsaXplMVNJbnQoDQorICAgIElNa3ZSZWFkZXIqIHBSZWFkZXIsDQorICAgIGxvbmcgbG9uZyBwb3MpDQorew0KKyAgICBhc3NlcnQocFJlYWRlcik7DQorICAgIGFzc2VydChwb3MgPj0gMCk7DQorDQorICAgIGxvbmcgbG9uZyB0b3RhbCwgYXZhaWxhYmxlOw0KKw0KKyAgICBsb25nIGhyID0gcFJl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BSZWFkZXIsIHBvcyArIGlkbGVuLCBzaXplbGVuKTsNCisNCisgICAgc3dpdGNoIChzaXplKQ0KKyAgICB7DQorICAgICAgICBjYXNlIDQ6DQorICAgICAgICBjYXNlIDg6DQorICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICBkZWZhdWx0Og0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCisgICAgfQ0KKw0KKyAgICBwb3MgKz0gaWRsZW4gKyBzaXplbGVuOyAgLy9jb25zdW1lIGlkIGFuZCBzaXplIGZpZWxkcw0KKyAgICBhc3NlcnQoKHBvcyArIHNpemUpIDw9IGF2YWlsYWJsZSk7DQorDQorICAgIGlmIChzaXplID09IDQpDQorICAgICAgICB2YWwgPSBVbnNlcmlhbGl6ZTRGbG9hdChwUmVhZGVyLCBwb3MpOw0KKyAgICBlbHNlDQorICAgIHsNCisgICAgICAgIGFzc2VydChzaXplID09IDgpOw0KKyAgICAgICAgdmFsID0gVW5zZXJpYWxpemU4RG91YmxlKHBSZWFkZXIsIHBvcyk7DQorICAgIH0NCisNCisgICAgcG9zICs9IHNpemU7ICAvL2NvbnN1bWUgc2l6ZSBvZiBwYXlsb2FkDQorDQorICAgIHJldHVybiB0cnVlOw0KK30NCisNCisNCitib29sIG1rdnBhcnNlcjo6TWF0Y2goDQorICAgIElNa3ZSZWFkZXIqIHBSZWFkZXIsDQorICAgIGxvbmcgbG9uZyYgcG9zLA0KKyAgICB1bnNpZ25lZCBsb25nIGlkXywNCisgICAgc2hvcnQmIHZhbCkNCit7DQorICAgIGFzc2VydChwUmVhZGVyKTsNCisgICAgYXNzZXJ0KHBvcyA+PSAwKTsNCisNCisgICAgbG9uZyBsb25nIHRvdGFsLCBhdmFpbGFibGU7DQorDQorICAgIGxvbmcgaHIgPSBwUmVhZGVyLT5MZW5ndGgoJnRvdGFsLCAmYXZhaWxhYmxlKTsNCisgICAgYXNzZXJ0KGhyID49IDApOw0KKyAgICBhc3NlcnQoYXZhaWxhYmxlIDw9IH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Qk1MSGVhZGVyOjp+RUJNTEhlYWRlcigpDQorew0KKyAgICBkZWxldGVbXSBtX2RvY1R5cGU7DQorfQ0KKw0KK2xvbmcgbG9uZyBFQk1MSGVhZGVyOjpQYXJzZSgNCisgICAgSU1rdlJlYWRlciogcFJlYWRlciwNCisgICAgbG9uZyBsb25nJiBwb3MpDQorew0KKyAgICBhc3NlcnQocFJlYWRlcik7DQorDQorICAgIGxvbmcgbG9uZyB0b3RhbCwgYXZhaWxhYmxlOw0KKw0KKyAgICBsb25nIGhyID0gcFJlYWRlci0+TGVuZ3RoKCZ0b3RhbCwgJmF2YWlsYWJsZSk7DQorDQorICAgIGlmIChociA8IDApDQorICAgICAgICByZXR1cm4gaHI7DQorDQorICAgIHBvcyA9IDA7DQorICAgIGxvbmcgbG9uZyBlbmQgPSAoMTAyNCA8IGF2YWlsYWJsZSk/IDEwMjQ6IGF2YWlsYWJsZTsNCisNCisgICAgZm9yICg7OykNCisgICAgew0KKyAgICAgICAgdW5zaWduZWQgY2hhciBiID0gMDsNCisNCisgICAgICAgIHdoaWxlIChwb3MgPCBlbmQpDQorICAgICAgICB7DQorICAgICAgICAgICAgaHIgPSBwUmVhZGVyLT5SZWFkKHBvcywgMSwgJmIpOw0KKw0KKyAgICAgICAgICAgIGlmIChociA8IDApDQorICAgICAgICAgICAgICAgIHJldHVybiBocjsNCisNCisgICAgICAgICAgICBpZiAoYiA9PSAweDFBKQ0KKyAgICAgICAgICAgICAgICBicmVhazsNCisNCisgICAgICAgICAgICArK3BvczsNCisgICAgICAgIH0NCisNCisgICAgICAgIGlmIChiICE9IDB4MUEpDQorICAgICAgICB7DQorICAgICAgICAgICAgaWYgKChwb3MgPj0gMTAyNCkgfHwNCisgICAgICAgICAgICAgICAgKGF2YWlsYWJsZSA+PSB0b3RhbCkgfHwNCisgICAgICAgICAgICAgICAgKCh0b3RhbCAtIGF2YWlsYWJsZSkgPCA1KSkNCisgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7DQorDQorICAgICAgICAgICAgcmV0dXJuIGF2YWlsYWJsZSArIDU7ICAvLzUgPSA0LWJ5dGUgSUQgKyAxc3QgYnl0ZSBvZiBzaXplDQorICAgICAgICB9DQorDQorICAgICAgICBpZiAoKHRvdGFsIC0gcG9zKSA8IDUpDQorICAgICAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsNCisNCisgICAgICAgIGlmICgoYXZhaWxhYmxlIC0gcG9zKSA8IDUpDQorICAgICAgICAgICAgcmV0dXJuIHBvcyArIDU7ICAvL3RyeSBhZ2FpbiBsYXRlcg0KKw0KKyAgICAgICAgbG9uZyBsZW47DQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgcmVzdWx0ID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOw0KKw0KKyAgICAgICAgaWYgKHJlc3VsdCA8IDApICAvL2Vycm9yDQorICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsNCisNCisgICAgICAgIGlmIChyZXN1bHQgPT0gMHgwQTQ1REZBMykgIC8vUmVhZElkIG1hc2tzLW9mZiBsZW5ndGggaW5kaWNhdG9yIGJpdHMNCisgICAgICAgIHsNCisgICAgICAgICAgICBhc3NlcnQobGVuID09IDQpOw0KKyAgICAgICAgICAgIHBvcyArPSBsZW47DQorICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICB9DQorDQorICAgICAgICArK3BvczsgIC8vdGhyb3cgYXdheSBqdXN0IHRoZSAweDFBIGJ5dGUsIGFuZCB0cnkgYWdhaW4NCisgICAgfQ0KKw0KKyAgICBsb25nIGxlbjsNCisgICAgbG9uZyBsb25nIHJlc3VsdCA9IEdldFVJbnRMZW5ndGgocFJlYWRlciwgcG9zLCBsZW4pOw0KKw0KKyAgICBpZiAocmVzdWx0IDwgMCkgIC8vZXJyb3INCisgICAgICAgIHJldHVybiByZXN1bHQ7DQorDQorICAgIGlmIChyZXN1bHQgPiAwKSAgLy9uZWVkIG1vcmUgZGF0YQ0KKyAg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GNoKHBSZWFkZXIsIHBvcywgMHgwMkY3LCBtX3JlYWRWZXJzaW9uKSkNCisgICAgICAgICAgICA7DQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MDJGMiwgbV9tYXhJZExlbmd0aCkpDQorICAgICAgICAgICAgOw0KKyAgICAgICAgZWxzZSBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDAyRjMsIG1fbWF4U2l6ZUxlbmd0aCkpDQorICAgICAgICAgICAgOw0KKyAgICAgICAgZWxzZSBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDAyODIsIG1fZG9jVHlwZSkpDQorICAgICAgICAgICAgOw0KKyAgICAgICAgZWxzZSBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDAyODcsIG1fZG9jVHlwZVZlcnNpb24pKQ0KKyAgICAgICAgICAgIDsNCisgICAgICAgIGVsc2UgaWYgKE1hdGNoKHBSZWFkZXIsIHBvcywgMHgwMjg1LCBtX2RvY1R5cGVSZWFkVmVyc2lvbikpDQorICAgICAgICAgICAgOw0KKyAgICAgICAgZWxzZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIHJlc3VsdCA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsNCisgICAgICAgICAgICBhc3NlcnQocmVzdWx0ID4gMCk7DQorICAgICAgICAgICAgYXNzZXJ0KGxlbiA+IDApOw0KKyAgICAgICAgICAgIGFzc2VydChsZW4gPD0gOCk7DQorDQorICAgICAgICAgICAgcG9zICs9IGxlbjsNCisgICAgICAgICAgICBhc3NlcnQocG9zIDwgZW5kKTsNCisNCisgICAgICAgICAgICByZXN1bHQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICAgICAgYXNzZXJ0KHJlc3VsdCA+PSAwKTsNCisgICAgICAgICAgICBhc3NlcnQobGVuID4gMCk7DQorICAgICAgICAgICAgYXNzZXJ0KGxlbiA8PSA4KTsNCisNCisgICAgICAgICAgICBwb3MgKz0gbGVuICsgcmVzdWx0Ow0KKyAgICAgICAgICAgIGFzc2VydChwb3MgPD0gZW5kKTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICBhc3NlcnQocG9zID09IGVuZCk7DQorDQorICAgIHJldHVybiAwOw0KK30NCisNCisNCitTZWdtZW50OjpTZWdtZW50KA0KKyAgICBJTWt2UmVhZGVyKiBwUmVhZGVyLA0KKyAgICBsb25nIGxvbmcgc3RhcnQsDQorICAgIGxvbmcgbG9uZyBzaXplKSA6DQorICAgIG1fcFJlYWRlcihwUmVhZGVyKSwNCisgICAgbV9zdGFydChzdGFydCksDQorICAgIG1fc2l6ZShzaXplKSwNCisgICAgbV9wb3Moc3RhcnQpLA0KKyAgICBtX3BJbmZvKE5VTEwpLA0KKyAgICBtX3BUcmFja3MoTlVMTCksDQorICAgIG1fcEN1ZXMoTlVMTCksDQorICAgIG1fY2x1c3RlcnMoTlVMTCksDQorICAgIG1fY2x1c3RlckNvdW50KDApLA0KKyAgICBtX2NsdXN0ZXJQcmVsb2FkQ291bnQoMCksDQorICAgIG1fY2x1c3RlclNpemUoMCkNCit7DQorfQ0KKw0KKw0KK1NlZ21lbnQ6On5TZWdtZW50KCkNCit7DQorICAgIGNvbnN0IGxvbmcgY291bnQgPSBtX2NsdXN0ZXJDb3VudCArIG1fY2x1c3RlclByZWxvYWRDb3VudDsNCisNCisgICAgQ2x1c3RlcioqIGkgPSBtX2NsdXN0ZXJzOw0KKyAgICBDbHVzdGVyKiogaiA9IG1fY2x1c3RlcnMgKyBjb3VudDsNCisNCisgICAgd2hpbGUgKGkgIT0gaikNCisgICAgew0KKyAgICAgICAgQ2x1c3RlciogY29uc3QgcCA9ICppKys7DQorICAgICAgICBhc3NlcnQocCk7DQorDQorICAgICAgICBkZWxldGUgcDsNCisgICAgfQ0KKw0KKyAgICBkZWxldGVbXSBtX2NsdXN0ZXJzOw0KKw0KKyAgICBkZWxldGUgbV9wVHJhY2tzOw0KK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AgYSBtYXhpbXVtIG9mLCBzYXksIDEwIHRpbWVzLg0KKw0KKyAgICB3aGlsZSAocG9zIDwgdG90YWwpDQorICAgIHsNCisgICAgICAgIC8vUmVhZCBJRA0KKw0KKyAgICAgICAgbG9uZyBsZW47DQorICAgICAgICBsb25nIGxvbmcgcmVzdWx0ID0gR2V0VUludExlbmd0aChwUmVhZGVyLCBwb3MsIGxlbik7DQorDQorICAgICAgICBpZiAocmVzdWx0KSAgLy9lcnJvciwgb3IgdG9vIGZldyBhdmFpbGFibGUgYnl0ZXMNCisgICAgICAgICAgICByZXR1cm4gcmVzdWx0Ow0KKw0KKyAgICAgICAgaWYgKChwb3MgKyBsZW4pID4gdG90YWwpDQorICAgICAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsNCisNCisgICAgICAgIGlmICgocG9zICsgbGVuKSA+IGF2YWlsYWJsZSkNCisgICAgICAgICAgICByZXR1cm4gcG9zICsgbGVuOw0KKw0KKyAgICAgICAgLy9UT0RPOiBpZiB3ZSBsaWJlcmFsaXplIHRoZSBiZWhhdmlvciBvZiBSZWFkVUludCwgd2UgY2FuDQorICAgICAgICAvL3Byb2JhYmx5IGVsaW1pbmF0ZSBoYXZpbmcgdG8gdXNlIEdldFVJbnRMZW5ndGggaGVyZS4NCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZCA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsNCisNCisgICAgICAgIGlmIChpZCA8IDApICAvL2Vycm9yDQorICAgICAgICAgICAgcmV0dXJuIGlkOw0KKw0KKyAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBJRA0KKw0KKyAgICAgICAgLy9SZWFkIFNpemUNCisNCisgICAgICAgIHJlc3VsdCA9IEdldFVJbnRMZW5ndGgocFJlYWRlciwgcG9zLCBsZW4pOw0KKw0KKyAgICAgICAgaWYgKHJlc3VsdCkgIC8vZXJyb3IsIG9yIHRvbyBmZXcgYXZhaWxhYmxlIGJ5dGVzDQorICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsNCisNCisgICAgICAgIGlmICgocG9zICsgbGVuKSA+IHRvdGFsKQ0KKyAgICAgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7DQorDQorICAgICAgICBpZiAoKHBvcyArIGxlbikgPiBhdmFpbGFibGUpDQorICAgICAgICAgICAgcmV0dXJuIHBvcyArIGxlbjsNCisNCisgICAgICAgIC8vVE9ETzogaWYgd2UgbGliZXJhbGl6ZSB0aGUgYmVoYXZpb3Igb2YgUmVhZFVJbnQsIHdlIGNhbg0KKyAgICAgICAgLy9wcm9iYWJseSBlbGltaW5hdGUgaGF2aW5nIHRvIHVzZSBHZXRVSW50TGVuZ3RoIGhlcmUuDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsNCisNCisgICAgICAgIGlmIChzaXplIDwgMCkNCisgICAgICAgICAgICByZXR1cm4gc2l6ZTsNCisNCisgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgbGVuZ3RoIG9mIHNpemUgb2YgZWxlbWVudA0KKw0KKyAgICAgICAgLy9Qb3Mgbm93IHBvaW50cyB0byBzdGFydCBvZiBwYXlsb2FkDQorDQorICAgICAgICBpZiAoKHBvcyArIHNpemUpID4gdG90YWwpDQorICAgICAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsNCisNCisgICAgICAgIGlmIChpZCA9PSAweDA4NTM4MDY3KSAgLy9TZWdtZW50IElEDQorICAgICAgICB7DQorICAgICAgICAgICAgcFNlZ21lbnQgPSBuZXcgIFNlZ21lbnQocFJlYWRlciwgcG9zLCBzaXplKTsNCisgICAgICAgICAgICBhc3NlcnQocFNlZ21lbnQpOyAgLy9UT0RPDQorDQorICAgICAgICAgICAgcmV0dXJuIDA7ICAgIC8vc3VjY2Vzcw0KKyAgICAgICA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G9uZyBsb25nIHJlc3VsdCA9IEdldFVJbnRMZW5ndGgobV9wUmVhZGVyLCBwb3MsIGxlbik7DQorDQorICAgICAgICBpZiAocmVzdWx0KSAgLy9lcnJvciwgb3IgdG9vIGZldyBhdmFpbGFibGUgYnl0ZXMNCisgICAgICAgICAgICByZXR1cm4gcmVzdWx0Ow0KKw0KKyAgICAgICAgaWYgKChwb3MgKyBsZW4pID4gc3RvcCkNCisgICAgICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOw0KKw0KKyAgICAgICAgaWYgKChwb3MgKyBsZW4pID4gYXZhaWxhYmxlKQ0KKyAgICAgICAgICAgIHJldHVybiBwb3MgKyBsZW47DQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgaWRwb3MgPSBwb3M7DQorICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChtX3BSZWFkZXIsIGlkcG9zLCBsZW4pOw0KKw0KKyAgICAgICAgaWYgKGlkIDwgMCkgIC8vZXJyb3INCisgICAgICAgICAgICByZXR1cm4gaWQ7DQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIElEDQorDQorICAgICAgICAvL1JlYWQgU2l6ZQ0KKyAgICAgICAgcmVzdWx0ID0gR2V0VUludExlbmd0aChtX3BSZWFkZXIsIHBvcywgbGVuKTsNCisNCisgICAgICAgIGlmIChyZXN1bHQpICAvL2Vycm9yLCBvciB0b28gZmV3IGF2YWlsYWJsZSBieXRlcw0KKyAgICAgICAgICAgIHJldHVybiByZXN1bHQ7DQorDQorICAgICAgICBpZiAoKHBvcyArIGxlbikgPiBzdG9wKQ0KKyAgICAgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7DQorDQorICAgICAgICBpZiAoKHBvcyArIGxlbikgPiBhdmFpbGFibGUpDQorICAgICAgICAgICAgcmV0dXJuIHBvcyArIGxlbjsNCisNCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplID0gUmVhZFVJbnQobV9wUmVhZGVyLCBwb3MsIGxlbik7DQorDQorICAgICAgICBpZiAoc2l6ZSA8IDApDQorICAgICAgICAgICAgcmV0dXJuIHNpemU7DQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGxlbmd0aCBvZiBzaXplIG9mIGVsZW1lbnQNCisNCisgICAgICAgIC8vUG9zIG5vdyBwb2ludHMgdG8gc3RhcnQgb2YgcGF5bG9hZA0KKw0KKyAgICAgICAgaWYgKChwb3MgKyBzaXplKSA+IHN0b3ApDQorICAgICAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsNCisNCisgICAgICAgIC8vV2UgcmVhZCBFQk1MIGVsZW1lbnRzIGVpdGhlciBpbiB0b3RhbCBvciBub3RoaW5nIGF0IGFsbC4NCisNCisgICAgICAgIGlmICgocG9zICsgc2l6ZSkgPiBhdmFpbGFibGUpDQorICAgICAgICAgICAgcmV0dXJuIHBvcyArIHNpemU7DQorDQorICAgICAgICBpZiAoaWQgPT0gMHgwNTQ5QTk2NikgIC8vU2VnbWVudCBJbmZvIElEDQorICAgICAgICB7DQorICAgICAgICAgICAgYXNzZXJ0KG1fcEluZm8gPT0gTlVMTCk7DQorDQorICAgICAgICAgICAgbV9wSW5mbyA9IG5ldyBTZWdtZW50SW5mbyh0aGlzLCBwb3MsIHNpemUpOw0KKyAgICAgICAgICAgIGFzc2VydChtX3BJbmZvKTsgIC8vVE9ETw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZSBpZiAoaWQgPT0gMHgwNjU0QUU2QikgIC8vVHJhY2tzIElEDQorICAgICAgICB7DQorICAgICAgICAgICAgYXNzZXJ0KG1fcFRyYWNrcyA9PSBOVUxMKTsNCisNCisgICAgICAgICAgICBtX3BUcmFja3MgPSBuZXcgVHJhY2tzKHRoaXMsIHBvcywgc2l6ZSk7DQorICAgICAgICAgICAgYXNzZXJ0KG1fcFRyYWNrcyk7ICAvL1RPRE8NCisgICAgICAgIH0NCisgICAgICAgIGVsc2UgaWYgKGlkID09IDB4MEM1M0JCNkIpICAvL0N1ZXMgSUQNCisgICAgICAgIHsNCisgICAgICAgICAgICBpZiAobV9wQ3VlcyA9PSBOVUxMKQ0KKyAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgbV9wQ3VlcyA9IG5ldyBDdWVzKHRoaXMsIHBvcywgc2l6ZSk7DQorICAgICAgICAgICAgICAgIGFzc2VydChtX3BDdWVzKTsgIC8vVE9ETw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgICAgIGVsc2UgaWYgKGlkID09IDB4MDE0RDlCNzQpICAvL1NlZWtIZWFkIElEDQorICAgICAgICB7DQorICAgICAgICAgICAgUGFyc2VTZWVrSGVhZChwb3MsIHNpemUpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZSBpZiAoaWQgPT0gMHgwRjQzQjY3NSkgIC8vQ2x1c3RlciBJRA0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGJRdWl0ID0gdHJ1ZTsNCisgICAgICAgIH0NCisNCisgICAgICAgIGlmICghYlF1aXQpDQorICAgICAgICAgICAgbV9wb3MgPSBwb3MgKyBzaXplOyAgLy9jb25zdW1lIHBheWxvYWQNCisgICAgfQ0KKw0KKyAgICBhc3NlcnQobV9wb3MgPD0gc3RvcCk7DQorDQorICAgIGlmIChtX3BJbmZvID09IE5VTEwpICAvL1RPRE86IGxpYmVyYWxpemUgdGhpcyBiZWhhdmlvcg0KKyAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsNCisNCisgICAgaWYgKG1fcFRyYWNrcyA9PSBOVUxMKQ0KKyAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsNCisNCisgICAgcmV0dXJuIDA7ICAvL3N1Y2Nlc3MNCit9DQorDQorDQorI2lmIDANCitsb25nIFNlZ21lbnQ6OlBhcnNlQ2x1c3RlcihDbHVzdGVyKiYgcENsdXN0ZXIsIGxvbmcgbG9uZyYgcG9zXykgY29uc3QNCit7DQorICAgIHBDbHVzdGVyID0gTlVMTDsNCisgICAgcG9zXyA9IC0xOw0KKw0KKyAgICBjb25zdCBsb25nIGxvbmcgc3RvcCA9IG1fc3RhcnQgKyBtX3NpemU7DQorICAgIGFzc2VydChtX3BvcyA8PSBzdG9wKTsNCisNCisgICAgbG9uZyBsb25nIHBvcyA9IG1fcG9zOw0KKyAgICBsb25nIGxvbmcgb2ZmID0gLTE7DQorDQorICAgIHdoaWxlIChwb3MgPCBzdG9wKQ0KKyAgICB7DQorICAgICAgICBsb25nIGxlbjsNCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZHBvcyA9IHBvczsNCisNCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZCA9IFN5bmNSZWFkVUludChtX3BSZWFkZXIsIHBvcywgc3RvcCwgbGVuKTsNCisNCisgICAgICAgIGlmIChpZCA8IDApICAvL2Vycm9yDQorICAgICAgICAgICAgcmV0dXJuIHN0YXRpY19jYXN0PGxvbmc+KGlkKTsNCisNCisgICAgICAgIGlmIChpZCA9PSAwKQ0KKyAgICAgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7DQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkDQorICAgICAgICBhc3NlcnQocG9zIDwgc3RvcCk7DQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFN5bmNSZWFkVUludChtX3BSZWFkZXIsIHBvcywgc3RvcCwgbGVuKTsNCisNCisgICAgICAgIGlmIChzaXplIDwgMCkgIC8vZXJyb3INCisgICAgICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3Q8bG9uZz4oc2l6ZSk7DQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIHNpemUNCisgICAgICAgIGFzc2VydChwb3MgPD0gc3RvcCk7DQorDQorICAgICAgICBpZi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uZ3RoKG1fcFJlYWRlciwgcG9zLCBsZW4pOw0KKw0KKyAgICAgICAgaWYgKHJlc3VsdCA8IDApICAvL2Vycm9yDQorICAgICAgICAgICAgcmV0dXJuIHN0YXRpY19jYXN0PGxvbmc+KHJlc3VsdCk7DQorDQorICAgICAgICBpZiAoKHBvcyArIGxlbikgPiBzdG9wKQ0KKyAgICAgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7DQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgaWRwb3MgPSBwb3M7DQorICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChtX3BSZWFkZXIsIGlkcG9zLCBsZW4pOw0KKw0KKyAgICAgICAgaWYgKGlkIDwgMCkgIC8vZXJyb3INCisgICAgICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3Q8bG9uZz4oaWQpOw0KKw0KKyAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBJRA0KKw0KKyAgICAgICAgLy9SZWFkIFNpemUNCisgICAgICAgIHJlc3VsdCA9IEdldFVJbnRMZW5ndGgobV9wUmVhZGVyLCBwb3MsIGxlbik7DQorDQorICAgICAgICBpZiAocmVzdWx0IDwgMCkgIC8vZXJyb3INCisgICAgICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3Q8bG9uZz4ocmVzdWx0KTsNCisNCisgICAgICAgIGlmICgocG9zICsgbGVuKSA+IHN0b3ApDQorICAgICAgICAgICAgcmV0dXJuIEVfRklMRV9GT1JNQVRfSU5WQUxJRDsNCisNCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplID0gUmVhZFVJbnQobV9wUmVhZGVyLCBwb3MsIGxlbik7DQorDQorICAgICAgICBpZiAoc2l6ZSA8IDApICAvL2Vycm9yDQorICAgICAgICAgICAgcmV0dXJuIHN0YXRpY19jYXN0PGxvbmc+KHNpemUpOw0KKw0KKyAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBsZW5ndGggb2Ygc2l6ZSBvZiBlbGVtZW50DQorDQorICAgICAgICBpZiAoc2l6ZSA9PSAwKSAgLy93ZWlyZA0KKyAgICAgICAgew0KKyAgICAgICAgICAgIG1fcG9zID0gcG9zOw0KKyAgICAgICAgICAgIGNvbnRpbnVlOw0KKyAgICAgICAgfQ0KKw0KKyAgICAgICAgLy9Qb3Mgbm93IHBvaW50cyB0byBzdGFydCBvZiBwYXlsb2FkDQorDQorICAgICAgICBpZiAoKHBvcyArIHNpemUpID4gc3RvcCkNCisgICAgICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOw0KKw0KKyAgICAgICAgaWYgKGlkID09IDB4MEM1M0JCNkIpICAvL0N1ZXMgSUQNCisgICAgICAgIHsNCisgICAgICAgICAgICBpZiAobV9wQ3VlcyA9PSBOVUxMKQ0KKyAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgbV9wQ3VlcyA9IG5ldyBDdWVzKHRoaXMsIHBvcywgc2l6ZSk7DQorICAgICAgICAgICAgICAgIGFzc2VydChtX3BDdWVzKTsgIC8vVE9ETw0KKyAgICAgICAgICAgIH0NCisNCisgICAgICAgICAgICBtX3BvcyA9IHBvcyArIHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZA0KKyAgICAgICAgICAgIGNvbnRpbnVlOw0KKyAgICAgICAgfQ0KKw0KKyAgICAgICAgaWYgKGlkICE9IDB4MEY0M0I2NzUpICAvL0NsdXN0ZXIgSUQNCisgICAgICAgIHsNCisgICAgICAgICAgICBtX3BvcyA9IHBvcyArIHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZA0KKyAgICAgICAgICAgIGNvbnRpbnVlOw0KKyAgICAgICAgfQ0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBpZHggPSBtX2NsdXN0ZXJDb3VudDsNCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZG9mZiA9IGlkcG9zIC0gbV9zdGFydDsNCisNCisgICAgICAgIGlmIChtX2NsdXN0ZXJQcmVsb2FkQ291bnQgPiAwKQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGFzc2VydChpZHggPCBtX2NsdXN0ZXJTaXplKTsNCisNCisgICAgICAgICAgICBDbHVzdGVyKiBjb25zdCBwQ2x1c3RlciA9IG1fY2x1c3RlcnNbaWR4XTsNCisgICAgICAgICAgICBhc3NlcnQocENsdXN0ZXIpOw0KKyAgICAgICAgICAgIGFzc2VydChwQ2x1c3Rlci0+bV9pbmRleCA8IDApOw0KKw0KKyAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBvZmZfID0gcENsdXN0ZXItPm1fcG9zOw0KKyAgICAgICAgICAgIGFzc2VydChvZmZfKTsNCisNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgb2ZmID0gb2ZmXyAqICgob2ZmXyA+PSAwKSA/IDEgOiAtMSk7DQorICAgICAgICAgICAgYXNzZXJ0KGlkb2ZmIDw9IG9mZik7DQorDQorICAgICAgICAgICAgaWYgKGlkb2ZmID09IG9mZikgIC8vY2x1c3RlciBoYXMgYmVlbiBwcmVsb2FkZWQgYWxyZWFkeQ0KKyAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgcENsdXN0ZXItPm1faW5kZXggPSBpZHg7DQorICAgICAgICAgICAgICAgICsrbV9jbHVzdGVyQ291bnQ7DQorICAgICAgICAgICAgICAgIC0tbV9jbHVzdGVyUHJlbG9hZENvdW50Ow0KKw0KKyAgICAgICAgICAgICAgICBtX3BvcyA9IHBvcyArIHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZA0KKyAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorDQorICAgICAgICBDbHVzdGVyKiBjb25zdCBwQ2x1c3RlciA9IENsdXN0ZXI6OlBhcnNlKHRoaXMsIGlkeCwgaWRvZmYpOw0KKyAgICAgICAgYXNzZXJ0KHBDbHVzdGVyKTsNCisgICAgICAgIGFzc2VydChwQ2x1c3Rlci0+bV9pbmRleCA9PSBpZHgpOw0KKw0KKyAgICAgICAgQXBwZW5kQ2x1c3RlcihwQ2x1c3Rlcik7DQorICAgICAgICBhc3NlcnQobV9jbHVzdGVycyk7DQorICAgICAgICBhc3NlcnQoaWR4IDwgbV9jbHVzdGVyU2l6ZSk7DQorICAgICAgICBhc3NlcnQobV9jbHVzdGVyc1tpZHhdID09IHBDbHVzdGVyKTsNCisNCisgICAgICAgIG1fcG9zID0gcG9zICsgc2l6ZTsgIC8vY29uc3VtZSBwYXlsb2FkDQorICAgICAgICBicmVhazsNCisgICAgfQ0KKw0KKyAgICBhc3NlcnQobV9wb3MgPD0gc3RvcCk7DQorICAgIHJldHVybiAwOw0KK30NCisNCisNCit2b2lkIFNlZ21lbnQ6OkFwcGVuZENsdXN0ZXIoQ2x1c3RlciogcENsdXN0ZXIpDQorew0KKyAgICBhc3NlcnQocENsdXN0ZXIpOw0KKyAgICBhc3NlcnQocENsdXN0ZXItPm1faW5kZXggPj0gMCk7DQorDQorICAgIGNvbnN0IGxvbmcgY291bnQgPSBtX2NsdXN0ZXJDb3VudCArIG1fY2x1c3RlclByZWxvYWRDb3VudDsNCisNCisgICAgbG9uZyYgc2l6ZSA9IG1fY2x1c3RlclNpemU7DQorICAgIGFzc2VydChzaXplID49IGNvdW50KTsNCisNCisgICAgY29uc3QgbG9uZyBpZHggPSBwQ2x1c3Rlci0+bV9pbmRleDsNCisgICAgYXNzZXJ0KGlkeCA9PSBtX2NsdXN0ZXJDb3VudCk7DQorDQorICAgIGlmIChjb3VudCA+PSBzaXplKQ0KKyAgICB7DQorICAgICAgICBsb25nIG47DQorDQorICAgICAgICBpZiAoc2l6ZSA+IDApDQorICAgICAgICAgICAgbiA9IDIgKiBzaXplOw0KKyAgICAgICAgZWxzZSBpZiAobV9wSW5mbyA9PSAwKQ0KKyAgICAgICAgICAgIG4gPSAyMDQ4Ow0KKyAgICAgICAgZWxzZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBucyA9IG1fcEluZm8tPkdldER1cmF0aW9uKCk7DQorDQorICAgICAgICAgICAgaWYgKG5zIDw9IDApDQorICAgICAgICAgICAgICAgIG4gPSAyMDQ4Ow0KKyAgICAgICAgICAgIGVsc2UNCisgICAgICAgICAgICB7DQorICAgICAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzZWMgPSAobnMgKyA5OTk5OTk5OTlMTCkgLyAxMDAwMDAwMDAwTEw7DQorICAgICAgICAgICAgICAgIG4gPSBzdGF0aWNfY2FzdDxsb25nPihzZWMpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisNCisgICAgICAgIENsdXN0ZXIqKiBjb25zdCBxcSA9IG5ldyBDbHVzdGVyKltuXTsNCisgICAgICAgIENsdXN0ZXIqKiBxID0gcXE7DQorDQorICAgICAgICBDbHVzdGVyKiogcCA9IG1fY2x1c3RlcnM7DQorICAgICAgICBDbHVzdGVyKiogY29uc3QgcHAgPSBwICsgY291bnQ7DQorDQorICAgICAgICB3aGlsZSAocCAhPSBwcCkNCisgICAgICAgICAgICAqcSsrID0gKnArKzsNCisNCisgICAgICAgIGRlbGV0ZVtdIG1fY2x1c3RlcnM7DQorDQorICAgICAgICBtX2NsdXN0ZXJzID0gcXE7DQorICAgICAgICBzaXplID0gbjsNCisgICAgfQ0KKw0KKyAgICBpZiAobV9jbHVzdGVyUHJlbG9hZENvdW50ID4gMCkNCisgICAgew0KKyAgICAgICAgYXNzZXJ0KG1fY2x1c3RlcnMpOw0KKw0KKyAgICAgICAgQ2x1c3RlcioqIGNvbnN0IHAgPSBtX2NsdXN0ZXJzICsgbV9jbHVzdGVyQ291bnQ7DQorICAgICAgICBhc3NlcnQoKnApOw0KKyAgICAgICAgYXNzZXJ0KCgqcCktPm1faW5kZXggPCAwKTsNCisNCisgICAgICAgIENsdXN0ZXIqKiBxID0gcCArIG1fY2x1c3RlclByZWxvYWRDb3VudDsNCisgICAgICAgIGFzc2VydChxIDwgKG1fY2x1c3RlcnMgKyBzaXplKSk7DQorDQorICAgICAgICBmb3IgKDs7KQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIENsdXN0ZXIqKiBjb25zdCBxcSA9IHEgLSAxOw0KKyAgICAgICAgICAgIGFzc2VydCgoKnFxKS0+bV9pbmRleCA8IDApOw0KKw0KKyAgICAgICAgICAgICpxID0gKnFxOw0KKyAgICAgICAgICAgIHEgPSBxcTsNCisNCisgICAgICAgICAgICBpZiAocSA9PSBwKQ0KKyAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICBtX2NsdXN0ZXJzW2lkeF0gPSBwQ2x1c3RlcjsNCisgICAgKyttX2NsdXN0ZXJDb3VudDsNCit9DQorDQorDQordm9pZCBTZWdtZW50OjpQcmVsb2FkQ2x1c3RlcihDbHVzdGVyKiBwQ2x1c3RlciwgcHRyZGlmZl90IGlkeCkNCit7DQorICAgIGFzc2VydChwQ2x1c3Rlcik7DQorICAgIGFzc2VydChwQ2x1c3Rlci0+bV9pbmRleCA8IDApOw0KKyAgICBhc3NlcnQoaWR4ID49IG1fY2x1c3RlckNvdW50KTsNCisNCisgICAgY29uc3QgbG9uZyBjb3VudCA9IG1fY2x1c3RlckNvdW50ICsgbV9jbHVzdGVyUHJlbG9hZENvdW50Ow0KKw0KKyAgICBsb25nJiBzaXplID0gbV9jbHVzdGVyU2l6ZTsNCisgICAgYXNzZXJ0KHNpemUgPj0gY291bnQpOw0KKw0KKyAgICBpZiAoY291bnQgPj0gc2l6ZSkNCisgICAgew0KKyAgICAgICAgbG9uZyBuOw0KKw0KKyAgICAgICAgaWYgKHNpemUgPiAwKQ0KKyAgICAgICAgICAgIG4gPSAyICogc2l6ZTsNCisgICAgICAgIGVsc2UgaWYgKG1fcEluZm8gPT0gMCkNCisgICAgICAgICAgICBuID0gMjA0ODsNCisgICAgICAgIGVsc2UNCisgICAgICAgIHsNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgbnMgPSBtX3BJbmZvLT5HZXREdXJhdGlvbigpOw0KKw0KKyAgICAgICAgICAgIGlmIChucyA8PSAwKQ0KKyAgICAgICAgICAgICAgICBuID0gMjA0ODsNCisgICAgICAgICAgICBlbHNlDQorICAgICAgICAgICAgew0KKyAgICAgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgc2VjID0gKG5zICsgOTk5OTk5OTk5TEwpIC8gMTAwMDAwMDAwMExMOw0KKyAgICAgICAgICAgICAgICBuID0gc3RhdGljX2Nhc3Q8bG9uZz4oc2VjKTsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorDQorICAgICAgICBDbHVzdGVyKiogY29uc3QgcXEgPSBuZXcgQ2x1c3Rlcipbbl07DQorICAgICAgICBDbHVzdGVyKiogcSA9IHFxOw0KKw0KKyAgICAgICAgQ2x1c3RlcioqIHAgPSBtX2NsdXN0ZXJzOw0KKyAgICAgICAgQ2x1c3RlcioqIGNvbnN0IHBwID0gcCArIGNvdW50Ow0KKw0KKyAgICAgICAgd2hpbGUgKHAgIT0gcHApDQorICAgICAgICAgICAgKnErKyA9ICpwKys7DQorDQorICAgICAgICBkZWxldGVbXSBtX2NsdXN0ZXJzOw0KKw0KKyAgICAgICAgbV9jbHVzdGVycyA9IHFxOw0KKyAgICAgICAgc2l6ZSA9IG47DQorICAgIH0NCisNCisgICAgYXNzZXJ0KG1fY2x1c3RlcnMpOw0KKw0KKyAgICBDbHVzdGVyKiogY29uc3QgcCA9IG1fY2x1c3RlcnMgKyBpZHg7DQorDQorICAgIENsdXN0ZXIqKiBxID0gbV9jbHVzdGVycyArIGNvdW50Ow0KKyAgICBhc3NlcnQocSA+PSBwKTsNCisgICAgYXNzZXJ0KHEgPCAobV9jbHVzdGVycyArIHNpemUpKTsNCisNCisgICAgd2hpbGUgKHEgPiBwKQ0KKyAgICB7DQorICAgICAgICBDbHVzdGVyKiogY29uc3QgcXEgPSBxIC0gMTsNCisgICAgICAgIGFzc2VydCgo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nIHBvcyA9IG1fcG9zOw0KKw0KKyAgICAgICAgbG9uZyBsZW47DQorDQorICAgICAgICBsb25nIGxvbmcgcmVzdWx0ID0gR2V0VUludExlbmd0aChtX3BSZWFkZXIsIHBvcywgbGVuKTsNCisNCisgICAgICAgIGlmIChyZXN1bHQgPCAwKSAgLy9lcnJvcg0KKyAgICAgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdDxsb25nPihyZXN1bHQpOw0KKw0KKyAgICAgICAgaWYgKChwb3MgKyBsZW4pID4gc3RvcCkNCisgICAgICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOw0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkcG9zID0gcG9zOw0KKyAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQobV9wUmVhZGVyLCBpZHBvcywgbGVuKTsNCisNCisgICAgICAgIGlmIChpZCA8IDApICAvL2Vycm9yDQorICAgICAgICAgICAgcmV0dXJuIHN0YXRpY19jYXN0PGxvbmc+KGlkKTsNCisNCisgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgSUQNCisNCisgICAgICAgIC8vUmVhZCBTaXplDQorICAgICAgICByZXN1bHQgPSBHZXRVSW50TGVuZ3RoKG1fcFJlYWRlciwgcG9zLCBsZW4pOw0KKw0KKyAgICAgICAgaWYgKHJlc3VsdCA8IDApICAvL2Vycm9yDQorICAgICAgICAgICAgcmV0dXJuIHN0YXRpY19jYXN0PGxvbmc+KHJlc3VsdCk7DQorDQorICAgICAgICBpZiAoKHBvcyArIGxlbikgPiBzdG9wKQ0KKyAgICAgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7DQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KG1fcFJlYWRlciwgcG9zLCBsZW4pOw0KKw0KKyAgICAgICAgaWYgKHNpemUgPCAwKSAgLy9lcnJvcg0KKyAgICAgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdDxsb25nPihzaXplKTsNCisNCisgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgbGVuZ3RoIG9mIHNpemUgb2YgZWxlbWVudA0KKw0KKyAgICAgICAgLy9Qb3Mgbm93IHBvaW50cyB0byBzdGFydCBvZiBwYXlsb2FkDQorDQorICAgICAgICBpZiAoKHBvcyArIHNpemUpID4gc3RvcCkNCisgICAgICAgICAgICByZXR1cm4gRV9GSUxFX0ZPUk1BVF9JTlZBTElEOw0KKw0KKyAgICAgICAgaWYgKGlkID09IDB4MEY0M0I2NzUpICAvL0NsdXN0ZXIgSUQNCisgICAgICAgIHsNCisgICAgICAgICAgICBjb25zdCBsb25nIGlkeCA9IG1fY2x1c3RlckNvdW50Ow0KKyAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBvZmYgPSBpZHBvcyAtIG1fc3RhcnQ7DQorDQorICAgICAgICAgICAgQ2x1c3RlciogY29uc3QgcENsdXN0ZXIgPSBDbHVzdGVyOjpQYXJzZSh0aGlzLCBpZHgsIG9mZik7DQorICAgICAgICAgICAgYXNzZXJ0KHBDbHVzdGVyKTsNCisgICAgICAgICAgICBhc3NlcnQocENsdXN0ZXItPm1faW5kZXggPT0gaWR4KTsNCisNCisgICAgICAgICAgICBBcHBlbmRDbHVzdGVyKHBDbHVzdGVyKTsNCisgICAgICAgICAgICBhc3NlcnQobV9jbHVzdGVycyk7DQorICAgICAgICAgICAgYXNzZXJ0KG1fY2x1c3RlclNpemUgPiBpZHgpOw0KKyAgICAgICAgICAgIGFzc2VydChtX2NsdXN0ZXJzW2lkeF0gPT0gcENsdXN0ZXIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZSBpZiAoaWQgPT0gMHgwQzUzQkI2QikgIC8vQ3VlcyBJRA0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGFzc2VydChtX3BDdWVzID09IE5VTEwpOw0KKw0KKyAgICAgICAgICAgIG1fcEN1ZXMgPSBuZXcgQ3Vlcyh0aGlzLCBwb3MsIHNpemUpOw0KKyAgICAgICAgICAgIGFzc2VydChtX3BDdWVzKTsgIC8vVE9ETw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZSBpZiAoaWQgPT0gMHgwNTQ5QTk2NikgIC8vU2VnbWVudEluZm8gSUQNCisgICAgICAgIHsNCisgICAgICAgICAgICBhc3NlcnQobV9wSW5mbyA9PSBOVUxMKTsNCisNCisgICAgICAgICAgICBtX3BJbmZvID0gbmV3ICBTZWdtZW50SW5mbyh0aGlzLCBwb3MsIHNpemUpOw0KKyAgICAgICAgICAgIGFzc2VydChtX3BJbmZvKTsNCisgICAgICAgIH0NCisgICAgICAgIGVsc2UgaWYgKGlkID09IDB4MDY1NEFFNkIpICAvL1RyYWNrcyBJRA0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGFzc2VydChtX3BUcmFja3MgPT0gTlVMTCk7DQorDQorICAgICAgICAgICAgbV9wVHJhY2tzID0gbmV3IFRyYWNrcyh0aGlzLCBwb3MsIHNpemUpOw0KKyAgICAgICAgICAgIGFzc2VydChtX3BUcmFja3MpOyAgLy9UT0RPDQorICAgICAgICB9DQorDQorICAgICAgICBtX3BvcyA9IHBvcyArIHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZA0KKyAgICB9DQorDQorICAgIGFzc2VydChtX3BvcyA+PSBzdG9wKTsNCisNCisgICAgaWYgKG1fcEluZm8gPT0gTlVMTCkNCisgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7ICAvL1RPRE86IGlnbm9yZSB0aGlzIGNhc2U/DQorDQorICAgIGlmIChtX3BUcmFja3MgPT0gTlVMTCkNCisgICAgICAgIHJldHVybiBFX0ZJTEVfRk9STUFUX0lOVkFMSUQ7DQorDQorICAgIGlmIChtX2NsdXN0ZXJzID09IE5VTEwpICAvL1RPRE86IGlnbm9yZSB0aGlzIGNhc2U/DQorICAgICAgICByZXR1cm4gR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Ck7DQorDQorICAgICAgICBkZWxldGUgcENQOw0KKyAgICB9DQorDQorICAgIGRlbGV0ZVtdIG1fY3VlX3BvaW50czsNCit9DQorDQorDQordm9pZCBDdWVzOjpJbml0KCkgY29uc3QNCit7DQorICAgIGlmIChtX2N1ZV9wb2ludHMpDQorICAgICAgICByZXR1cm47DQorDQorICAgIGFzc2VydChtX2NvdW50ID09IDApOw0KKyAgICBhc3NlcnQobV9wcmVsb2FkX2NvdW50ID09IDApOw0KKw0KKyAgICBJTWt2UmVhZGVyKiBjb25zdCBwUmVhZGVyID0gbV9wU2VnbWVudC0+bV9wUmVhZGVyOw0KKw0KKyAgICBjb25zdCBsb25nIGxvbmcgc3RvcCA9IG1fc3RhcnQgKyBtX3NpemU7DQorICAgIGxvbmcgbG9uZyBwb3MgPSBtX3N0YXJ0Ow0KKw0KKyAgICBzaXplX3QgY3VlX3BvaW50c19zaXplID0gMDsNCisNCisgICAgd2hpbGUgKHBvcyA8IHN0b3ApDQorICAgIHsNCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZHBvcyA9IHBvczsNCisNCisgICAgICAgIGxvbmcgbGVuOw0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOw0KKyAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPDQorICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7DQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIElEDQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsNCisgICAgICAgIGFzc2VydChzaXplID49IDApOw0KKyAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOw0KKw0KKyAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBTaXplIGZpZWxkDQorICAgICAgICBhc3NlcnQoKHBvcyArIHNpemUpIDw9IHN0b3ApOw0KKw0KKyAgICAgICAgaWYgKGlkID09IDB4M0IpICAvL0N1ZVBvaW50IElEDQorICAgICAgICAgICAgUHJlbG9hZEN1ZVBvaW50KGN1ZV9wb2ludHNfc2l6ZSwgaWRwb3MpOw0KKw0KKyAgICAgICAgcG9zICs9IHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZA0KKyAgICAgICAgYXNzZXJ0KHBvcyA8PSBzdG9wKTsNCisgICAgfQ0KK30NCisNCisNCit2b2lkIEN1ZXM6OlByZWxvYWRDdWVQb2ludCgNCisgICAgc2l6ZV90JiBjdWVfcG9pbnRzX3NpemUsDQorICAgIGxvbmcgbG9uZyBwb3MpIGNvbnN0DQorew0KKyAgICBhc3NlcnQobV9jb3VudCA9PSAwKTsNCisNCisgICAgaWYgKG1fcHJlbG9hZF9jb3VudCA+PSBjdWVfcG9pbnRzX3NpemUpDQorICAgIHsNCisgICAgICAgIHNpemVfdCBuOw0KKw0KKyAgICAgICAgaWYgKGN1ZV9wb2ludHNfc2l6ZSA+IDApDQorICAgICAgICAgICAgbiA9IHN0YXRpY19jYXN0PHNpemVfdD4oMiAqIGN1ZV9wb2ludHNfc2l6ZSk7DQorICAgICAgICBlbHNlDQorICAgICAgICB7DQorICAgICAgICAgICAgY29uc3QgU2VnbWVudEluZm8qIGNvbnN0IHBJbmZvID0gbV9wU2VnbWVudC0+R2V0SW5mbygpOw0KKw0KKyAgICAgICAgICAgIGlmIChwSW5mbyA9PSBOVUxMKQ0KKyAgICAgICAgICAgICAgICBuID0gMjA0ODsNCisgICAgICAgICAgICBlbHNlDQorICAgICAgICAgICAgew0KKyAgICAgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgbnMgPSBwSW5mby0+R2V0RHVyYXRpb24oKTsNCisNCisgICAgICAgICAgICAgICAgaWYgKG5zIDw9IDApDQorICAgICAgICAgICAgICAgICAgICBuID0gMjA0ODsNCisgICAgICAgICAgICAgICAgZWxzZQ0KKyAgICAgICAgICAgICAgICB7DQorICAgICAgICAgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgc2VjID0gKG5zICsgOTk5OTk5OTk5TEwpIC8gMTAwMDAwMDAwMExMOw0KKyAgICAgICAgICAgICAgICAgICAgbiA9IHN0YXRpY19jYXN0PHNpemVfdD4oc2VjKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisNCisgICAgICAgIEN1ZVBvaW50KiogY29uc3QgcXEgPSBuZXcgQ3VlUG9pbnQqW25dOw0KKyAgICAgICAgQ3VlUG9pbnQqKiBxID0gcXE7ICAvL2JlZ2lubmluZyBvZiB0YXJnZXQNCisNCisgICAgICAgIEN1ZVBvaW50KiogcCA9IG1fY3VlX3BvaW50czsgICAgICAgICAgICAgICAgLy9iZWdpbm5pbmcgb2Ygc291cmNlDQorICAgICAgICBDdWVQb2ludCoqIGNvbnN0IHBwID0gcCArIG1fcHJlbG9hZF9jb3VudDsgIC8vZW5kIG9mIHNvdXJjZQ0KKw0KKyAgICAgICAgd2hpbGUgKHAgIT0gcHApDQorICAgICAgICAgICAgKnErKyA9ICpwKys7DQorDQorICAgICAgICBkZWxldGVbXSBtX2N1ZV9wb2ludHM7DQorDQorICAgICAgICBtX2N1ZV9wb2ludHMgPSBxcTsNCisgICAgICAgIGN1ZV9wb2ludHNfc2l6ZSA9IG47DQorICAgIH0NCisNCisgICAgQ3VlUG9pbnQqIGNvbnN0IHBDUCA9IG5ldyBDdWVQb2ludChtX3ByZWxvYWRfY291bnQsIHBvcyk7DQorICAgIG1fY3VlX3BvaW50c1ttX3ByZWxvYWRfY291bnQrK10gPSBwQ1A7DQorfQ0KKw0KKw0KK2Jvb2wgQ3Vlczo6TG9hZEN1ZVBvaW50KCkgY29uc3QNCit7DQorICAgIC8vb2RiZ3N0cmVhbSBvczsNCisgICAgLy9vcyA8PCAiQ3Vlczo6TG9hZEN1ZVBvaW50IiA8PCBlbmRsOw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b3MgPD0gc3RvcCk7DQorDQorICAgICAgICAgICAgY29udGludWU7DQorICAgICAgICB9DQorDQorICAgICAgICBhc3NlcnQobV9wcmVsb2FkX2NvdW50ID4gMCk7DQorDQorICAgICAgICBDdWVQb2ludCogY29uc3QgcENQID0gbV9jdWVfcG9pbnRzW21fY291bnRdOw0KKyAgICAgICAgYXNzZXJ0KHBDUCk7DQorICAgICAgICBhc3NlcnQoKHBDUC0+R2V0VGltZUNvZGUoKSA+PSAwKSB8fCAoLXBDUC0+R2V0VGltZUNvZGUoKSA9PSBpZHBvcykpOw0KKw0KKyAgICAgICAgcENQLT5Mb2FkKHBSZWFkZXIpOw0KKyAgICAgICAgKyttX2NvdW50Ow0KKyAgICAgICAgLS1tX3ByZWxvYWRfY291bnQ7DQorDQorICAgICAgICBtX3BvcyArPSBzaXplOyAgLy9jb25zdW1lIHBheWxvYWQNCisgICAgICAgIGFzc2VydChtX3BvcyA8PSBzdG9wKTsNCisNCisgICAgICAgIGJyZWFrOw0KKyAgICB9DQorDQorICAgIHJldHVybiAobV9wb3MgPCBzdG9wKTsNCit9DQorDQorDQorYm9vbCBDdWVzOjpGaW5kKA0KKyAgICBsb25nIGxvbmcgdGltZV9ucywNCisgICAgY29uc3QgVHJhY2sqIHBUcmFjaywNCisgICAgY29uc3QgQ3VlUG9pbnQqJiBwQ1AsDQorICAgIGNvbnN0IEN1ZVBvaW50OjpUcmFja1Bvc2l0aW9uKiYgcFRQKSBjb25zdA0KK3sNCisgICAgYXNzZXJ0KHRpbWVfbnMgPj0gMCk7DQorICAgIGFzc2VydChwVHJhY2spOw0KKw0KKyAgICBMb2FkQ3VlUG9pbnQoKTsNCisNCisgICAgYXNzZXJ0KG1fY3VlX3BvaW50cyk7DQorICAgIGFzc2VydChtX2NvdW50ID4gMCk7DQorDQorICAgIEN1ZVBvaW50KiogY29uc3QgaWkgPSBtX2N1ZV9wb2ludHM7DQorICAgIEN1ZVBvaW50KiogaSA9IGlpOw0KKw0KKyAgICBDdWVQb2ludCoqIGNvbnN0IGpqID0gaWkgKyBtX2NvdW50ICsgbV9wcmVsb2FkX2NvdW50Ow0KKyAgICBDdWVQb2ludCoqIGogPSBqajsNCisNCisgICAgcENQID0gKmk7DQorICAgIGFzc2VydChwQ1ApOw0KKw0KKyAgICBpZiAodGltZV9ucyA8PSBwQ1AtPkdldFRpbWUobV9wU2VnbWVudCkpDQorICAgIHsNCisgICAgICAgIHBUUCA9IHBDUC0+RmluZChwVHJhY2spOw0KKyAgICAgICAgcmV0dXJuIChwVFAgIT0gTlVMTCk7DQorICAgIH0NCisNCisgICAgSU1rdlJlYWRlciogY29uc3QgcFJlYWRlciA9IG1fcFNlZ21lbnQtPm1fcFJlYWRlcjsNCisNCisgICAgd2hpbGUgKGkgPCBqKQ0KKyAgICB7DQorICAgICAgICAvL0lOVkFSSUFOVDoNCisgICAgICAgIC8vW2lpLCBpKSA8PSB0aW1lX25zDQorICAgICAgICAvL1tpLCBqKSAgPw0KKyAgICAgICAgLy9baiwgamopID4gdGltZV9ucw0KKw0KKyAgICAgICAgQ3VlUG9pbnQqKiBjb25zdCBrID0gaSArIChqIC0gaSkgLyAyOw0KKyAgICAgICAgYXNzZXJ0KGsgPCBqaik7DQorDQorICAgICAgICBDdWVQb2ludCogY29uc3QgcENQID0gKms7DQorICAgICAgICBhc3NlcnQocENQKTsNCisNCisgICAgICAgIHBDUC0+TG9hZChwUmVhZGVyKTsNCisNCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyB0ID0gcENQLT5HZXRUaW1lKG1fcFNlZ21lbnQpOw0KKw0KKyAgICAgICAgaWYgKHQgPD0gdGltZV9ucykNCisgICAgICAgICAgICBpID0gayArIDE7DQorICAgICAgICBlbHNlDQorICAgICAgICAgICAgaiA9IGs7DQorDQorICAgICAgICBhc3NlcnQoaSA8PSBqKTsNCisgICAgfQ0KKw0KKyAgICBhc3NlcnQoaSA9PSBqKTsNCisgICAgYXNzZXJ0KGkgPD0gamopOw0KKyAgICBhc3Nlcn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cFRQKSBjb25zdA0KK3sNCisgICAgcENQID0gMDsNCisgICAgcFRQID0gMDsNCisNCisgICAgaWYgKG1fY291bnQgPT0gMCkNCisgICAgICAgIHJldHVybiBmYWxzZTsNCisNCisgICAgYXNzZXJ0KG1fY3VlX3BvaW50cyk7DQorDQorICAgIGNvbnN0IEN1ZVBvaW50KiBjb25zdCogY29uc3QgaWkgPSBtX2N1ZV9wb2ludHM7DQorICAgIGNvbnN0IEN1ZVBvaW50KiBjb25zdCogaSA9IGlpOw0KKw0KKyAgICBjb25zdCBDdWVQb2ludCogY29uc3QqIGNvbnN0IGpqID0gaWkgKyBtX2NvdW50Ow0KKyAgICBjb25zdCBDdWVQb2ludCogY29uc3QqIGogPSBqajsNCisNCisgICAgd2hpbGUgKGkgPCBqKQ0KKyAgICB7DQorICAgICAgICAvL0lOVkFSSUFOVDoNCisgICAgICAgIC8vW2lpLCBpKSA8PSB0aW1lX25zDQorICAgICAgICAvL1tpLCBqKSAgPw0KKyAgICAgICAgLy9baiwgamopID4gdGltZV9ucw0KKw0KKyAgICAgICAgY29uc3QgQ3VlUG9pbnQqIGNvbnN0KiBjb25zdCBrID0gaSArIChqIC0gaSkgLyAyOw0KKyAgICAgICAgYXNzZXJ0KGsgPCBqaik7DQorDQorICAgICAgICBwQ1AgPSAqazsNCisgICAgICAgIGFzc2VydChwQ1ApOw0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBsb25nIHQgPSBwQ1AtPkdldFRpbWUobV9wU2VnbWVudCk7DQorDQorICAgICAgICBpZiAodCA8PSB0aW1lX25zKQ0KKyAgICAgICAgICAgIGkgPSBrICsgMTsNCisgICAgICAgIGVsc2UNCisgICAgICAgICAgICBqID0gazsNCisNCisgICAgICAgIGFzc2VydChpIDw9IGopOw0KKyAgICB9DQorDQorICAgIGFzc2VydChpID09IGopOw0KKyAgICBhc3NlcnQoaSA8PSBqaik7DQorDQorICAgIGlmIChpID49IGpqKSAgLy90aW1lX25zIGlzIGdyZWF0ZXIgdG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pqKTsNCisNCisgICAgICAgIENsdXN0ZXIqIGNvbnN0IHBDbHVzdGVyID0gKms7DQorICAgICAgICBhc3NlcnQocENsdXN0ZXIpOw0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBsb25nIHBvc18gPSBwQ2x1c3Rlci0+bV9wb3M7DQorICAgICAgICBhc3NlcnQocG9zXyk7DQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgcG9zID0gcG9zXyAqICgocG9zXyA8IDApID8gLTEgOiAxKTsNCisNCisgICAgICAgIGlmIChwb3MgPCB0cC5tX3BvcykNCisgICAgICAgICAgICBpID0gayArIDE7DQorICAgICAgICBlbHNlIGlmIChwb3MgPiB0cC5tX3BvcykNCisgICAgICAgICAgICBqID0gazsNCisgICAgICAgIGVsc2UNCisgICAgICAgICAgICByZXR1cm4gcENsdXN0ZXItPkdldEVudHJ5KGNwLCB0cCk7DQorICAgIH0NCisNCisgICAgYXNzZXJ0KGkgPT0gaik7DQorDQorICAgIENsdXN0ZXIqIGNvbnN0IHBDbHVzdGVyID0gQ2x1c3Rlcjo6UGFyc2UodGhpcywgLTEsIHRwLm1fcG9zKTsNCisgICAgY29uc3QgcHRyZGlmZl90IGlkeCA9IGkgLSBtX2NsdXN0ZXJzOw0KKw0KKyAgICBQcmVsb2FkQ2x1c3RlcihwQ2x1c3RlciwgaWR4KTsNCisgICAgYXNzZXJ0KG1fY2x1c3RlcnMpOw0KKyAgICBhc3NlcnQobV9jbHVzdGVyUHJlbG9hZENvdW50ID4gMCk7DQorICAgIGFzc2VydChtX2NsdXN0ZXJzW2lkeF0gPT0gcENsdXN0ZXIpOw0KKw0KKyAgICByZXR1cm4gcENsdXN0ZXItPkdldEVudHJ5KGNwLCB0cCk7DQorfQ0KKw0KKw0KKw0KK0N1ZVBvaW50OjpDdWVQb2ludChzaXplX3QgaWR4LCBsb25nIGxvbmcgcG9zKSA6DQorICAgIG1faW5kZXgoaWR4KSwNCisgICAgbV90aW1lY29kZSgtMSAqIHBvcyksD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emUgPj0gMCk7DQorICAgICAgICAvL2Fzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgIHBvc18gKz0gbGVuOyAgLy9jb25zdW1lIFNpemUgZmllbGQNCisgICAgICAgIC8vYXNzZXJ0KChwb3MgKyBzaXplKSA8PSBzdG9wKTsNCisNCisgICAgICAgIC8vcG9zXyBub3cgcG9pbnRzIHRvIHN0YXJ0IG9mIHBheWxvYWQNCisNCisgICAgICAgIHN0b3AgPSBwb3NfICsgc2l6ZTsNCisgICAgfQ0KKw0KKyAgICBsb25nIGxvbmcgcG9zID0gcG9zXzsNCisNCisgICAgLy9GaXJzdCBjb3VudCBudW1iZXIgb2YgdHJhY2sgcG9zaXRpb25zDQorDQorICAgIHdoaWxlIChwb3MgPCBzdG9wKQ0KKyAgICB7DQorICAgICAgICBsb25nIGxlbjsNCisNCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBpZCA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsNCisgICAgICAgIGFzc2VydChpZCA+PSAwKTsgIC8vVE9ETw0KKyAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOw0KKw0KKyAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBJRA0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTsNCisgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgU2l6ZSBmaWVsZA0KKyAgICAgICAgYXNzZXJ0KChwb3MgKyBzaXplKSA8PSBzdG9wKTsNCisNCisgICAgICAgIGlmIChpZCA9PSAweDMzKSAgLy9DdWVUaW1lIElEDQorICAgICAgICAgICAgbV90aW1lY29kZSA9IFVuc2VyaWFsaXplVUludChwUmVhZGVyLCBwb3MsIHNpemUpOw0KKw0KKyAgICAgICAgZWxzZSBpZiAoaWQgPT0gMHgzNykgLy9DdWVUcmFja1Bvc2l0aW9uKHMpIElEDQorICAgICAgICAgICAgKyttX3RyYWNrX3Bvc2l0aW9uc19jb3VudDsNCisNCisgICAgICAgIHBvcyArPSBzaXplOyAgLy9jb25zdW1lIHBheWxvYWQNCisgICAgICAgIGFzc2VydChwb3MgPD0gc3RvcCk7DQorICAgIH0NCisNCisgICAgYXNzZXJ0KG1fdGltZWNvZGUgPj0gMCk7DQorICAgIGFzc2VydChtX3RyYWNrX3Bvc2l0aW9uc19jb3VudCA+IDApOw0KKw0KKyAgICAvL29zIDw8ICJDdWVQb2ludDo6TG9hZChjb250J2QpOiBpZHBvcz0iIDw8IGlkcG9zDQorICAgIC8vICAgPDwgIiB0aW1lY29kZT0iIDw8IG1fdGltZWNvZGUNCisgICAgLy8gICA8PCBlbmRsOw0KKw0KKyAgICBtX3RyYWNrX3Bvc2l0aW9ucyA9IG5ldyBUcmFja1Bvc2l0aW9uW21fdHJhY2tfcG9zaXRpb25zX2NvdW50XTsNCisNCisgICAgLy9Ob3cgcGFyc2UgdHJhY2sgcG9zaXRpb25zDQorDQorICAgIFRyYWNrUG9zaXRpb24qIHAgPSBtX3RyYWNrX3Bvc2l0aW9uczsNCisgICAgcG9zID0gcG9zXzsNCisNCisgICAgd2hpbGUgKHBvcyA8IHN0b3ApDQorICAgIHsNCisgICAgICAgIGxvbmcgbGVuOw0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOw0KKyAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPDQorICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7DQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIElEDQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6Z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QorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICBhc3NlcnQoaWQgPj0gMCk7ICAvL1RPRE8NCisgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgSUQNCisNCisgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOw0KKyAgICAgICAgYXNzZXJ0KHNpemUgPj0gMCk7DQorICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7DQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIFNpemUgZmllbGQNCisgICAgICAgIGFzc2VydCgocG9zICsgc2l6ZSkgPD0gc3RvcCk7DQorDQorICAgICAgICBpZiAoaWQgPT0gMHg3NykgIC8vQ3VlVHJhY2sgSUQNCisgICAgICAgICAgICBtX3RyYWNrID0gVW5zZXJpYWxpemVVSW50KHBSZWFkZXIsIHBvcywgc2l6ZSk7DQorDQorICAgICAgICBlbHNlIGlmIChpZCA9PSAweDcxKSAgLy9DdWVDbHVzdGVyUG9zIElEDQorICAgICAgICAgICAgbV9wb3MgPSBVbnNlcmlhbGl6ZVVJbnQocFJlYWRlciwgcG9zLCBzaXplKTsNCisNCisgICAgICAgIGVsc2UgaWYgKGlkID09IDB4MTM3OCkgIC8vQ3VlQmxvY2tOdW1iZXINCisgICAgICAgICAgICBtX2Jsb2NrID0gVW5zZXJpYWxpemVVSW50KHBSZWFkZXIsIHBvcywgc2l6ZSk7DQorDQorICAgICAgICBwb3MgKz0gc2l6ZTsgIC8vY29uc3VtZSBwYXlsb2FkDQorICAgICAgICBhc3NlcnQocG9zIDw9IHN0b3ApOw0KKyAgICB9DQorDQorICAgIGFzc2VydChtX3BvcyA+PSAwKTsNCisgICAgLy9hc3Nl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yBsb25nIHNpemUgPSBSZWFkVUludChtX3BSZWFkZXIsIHBvcywgbGVuKTsNCisgICAgICAgIGFzc2VydChzaXplID49IDApOyAgLy9UT0RPDQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGxlbmd0aCBvZiBzaXplIG9mIGVsZW1lbnQNCisgICAgICAgIGFzc2VydCgocG9zICsgc2l6ZSkgPD0gc3RvcCk7ICAvL1RPRE8NCisNCisgICAgICAgIC8vUG9zIG5vdyBwb2ludHMgdG8gc3RhcnQgb2YgcGF5bG9hZA0KKw0KKyAgICAgICAgaWYgKHNpemUgPT0gMCkgIC8vd2VpcmQNCisgICAgICAgICAgICBjb250aW51ZTsNCisNCisgICAgICAgIGlmIChpZCA9PSAweDBGNDNCNjc1KSAgLy9DbHVzdGVyIElEDQorICAgICAgICB7DQorICAgICAgICAgICAgb2ZmX25leHQgPSBpZHBvcyAtIG1fc3RhcnQ7DQorICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICB9DQorDQorICAgICAgICBwb3MgKz0gc2l6ZTsgIC8vY29uc3VtZSBwYXlsb2FkDQorICAgIH0NCisNCisgICAgaWYgKG9mZl9uZXh0IDw9IDApDQorICAgICAgICByZXR1cm4gMDsNCisNCisgICAgQ2x1c3RlcioqIGNvbnN0IGlpID0gbV9jbHVzdGVycyArIG1fY2x1c3RlckNvdW50Ow0KKyAgICBDbHVzdGVyKiogaSA9IGlpOw0KKw0KKyAgICBDbHVzdGVyKiogY29uc3QgamogPSBpaSArIG1fY2x1c3RlclByZWxvYWRDb3VudDsNCisgICAgQ2x1c3RlcioqIGogPSBqajsNCisNCisgICAgd2hpbGUgKGkgPCBqKQ0KKyAgICB7DQorICAgICAgICAvL0lOVkFSSUFOVDoNCisgICAgICAgIC8vWzAsIGkpIDwgcG9zX25leHQNCisgICAgICAgIC8vW2ksIGopID8NCisgICAgICAgIC8vW2osIGpqKSAgPiBwb3NfbmV4dA0KKw0KKyAgICAgICAgQ2x1c3RlcioqIGNvbnN0IGsgPSBpICsgKGogLSBpKSAvIDI7DQorICAgICAgICBhc3NlcnQoayA8IGpqKTsNCisNCisgICAgICAgIENsdXN0ZXIqIGNvbnN0IHBOZXh0ID0gKms7DQorICAgICAgICBhc3NlcnQocE5leHQpOw0KKyAgICAgICAgYXNzZXJ0KHBOZXh0LT5tX2luZGV4IDwgMCk7DQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgcG9zXyA9IHBOZXh0LT5tX3BvczsNCisgICAgICAgIGFzc2VydChwb3NfKTsNCisNCisgICAgICAgIHBvcyA9IHBvc18gKiAoKHBvc18gPCAwKSA/IC0xIDogMSk7DQorDQorICAgICAgICBpZiAocG9zIDwgb2ZmX25leHQpDQorICAgICAgICAgICAgaSA9IGsgKyAxOw0KKyAgICAgICAgZWxzZSBpZiAocG9zID4gb2ZmX25leHQpDQorICAgICAgICAgICAgaiA9IGs7DQorICAgICAgICBlbHNlDQorICAgICAgICAgICAgcmV0dXJuIHBOZXh0Ow0KKyAgICB9DQorDQorICAgIGFzc2VydChpID09IGopOw0KKw0KKyAgICBDbHVzdGVyKiBjb25zdCBwTmV4dCA9IENsdXN0ZXI6OlBhcnNlKHRoaXMsIC0xLCBvZmZfbmV4dCk7DQorICAgIGNvbnN0IHB0cmRpZmZfdCBpZHhfbmV4dCA9IGkgLSBtX2NsdXN0ZXJzOyAgLy9pbnNlcnRpb24gcG9zaXRpb24NCisNCisgICAgUHJlbG9hZENsdXN0ZXIocE5leHQsIGlkeF9uZXh0KTsNCisgICAgYXNzZXJ0KG1fY2x1c3RlcnMpOw0KKyAgICBhc3NlcnQoaWR4X25leHQgPCBtX2NsdXN0ZXJTaXplKTsNCisgICAgYXNzZXJ0KG1fY2x1c3RlcnNbaWR4X25leHRdID09IHBOZXh0KTsNCisNCisgICAgcmV0dXJuIHBOZXh0Ow0KK30NCisNCisNCitDbHVzdGVyKiBTZWdtZW50OjpGaW5kQ2x1c3Rlcihsb25nIGxvbmcgdGltZV9ucykNCit7DQorICAgIGlmICgobV9jbHVzdGVycyA9PSBOVUxMKSB8fCAobV9jbHVzdGVyQ291bnQgPD0gMCkpDQorICAgICAgICByZXR1cm4gJm1fZW9zOw0KKw0KKyAgICB7DQorICAgICAgICBDbHVzdGVyKiBjb25zdCBwQ2x1c3RlciA9IG1fY2x1c3RlcnNbMF07DQorICAgICAgICBhc3NlcnQocENsdXN0ZXIpOw0KKyAgICAgICAgYXNzZXJ0KHBDbHVzdGVyLT5tX2luZGV4ID09IDApOw0KKw0KKyAgICAgICAgaWYgKHRpbWVfbnMgPD0gcENsdXN0ZXItPkdldFRpbWUoKSkNCisgICAgICAgICAgICByZXR1cm4gcENsdXN0ZXI7DQorICAgIH0NCisNCisgICAgLy9CaW5hcnkgc2VhcmNoIG9mIGNsdXN0ZXIgYXJyYXkNCisNCisgICAgbG9uZyBpID0gMDsNCisgICAgbG9uZyBqID0gbV9jbHVzdGVyQ291bnQ7DQorDQorICAgIHdoaWxlIChpIDwgaikNCisgICAgew0KKyAgICAgICAgLy9JTlZBUklBTlQ6DQorICAgICAgICAvL1swLCBpKSA8PSB0aW1lX25zDQorICAgICAgICAvL1tpLCBqKSA/DQorICAgICAgICAvL1tqLCBtX2NsdXN0ZXJDb3VudCkgID4gdGltZV9ucw0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBrID0gaSArIChqIC0gaSkgLyAyOw0KKyAgICAgICAgYXNzZXJ0KGsgPCBtX2NsdXN0ZXJDb3VudCk7DQorDQorICAgICAgICBDbHVzdGVyKiBjb25zdCBwQ2x1c3RlciA9IG1fY2x1c3RlcnNba107DQorICAgICAgICBhc3NlcnQocENsdXN0ZXIpOw0KKyAgICAgICAgYXNzZXJ0KHBDbHVzdGVyLT5tX2luZGV4ID09IGspOw0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBsb25nIHQgPSBwQ2x1c3Rlci0+R2V0VGltZSgpOw0KKw0KKyAgICAgICAgaWYgKHQgPD0gdGltZV9ucykNCisgICAgICAgICAgICBpID0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9PSB0aGlzKTsNCisNCisgICAgICAgIGlmICh0aW1lX25zIDw9IHBDbHVzdGVyLT5HZXRUaW1lKCkpDQorICAgICAgICAgICAgcmV0dXJuIHBDbHVzdGVyLT5HZXRFbnRyeShwVHJhY2spOw0KKyAgICB9DQorDQorICAgIENsdXN0ZXIqKiBjb25zdCBqID0gaSArIG1fY2x1c3RlckNvdW50Ow0KKw0KKyAgICBpZiAocFRyYWNrLT5HZXRUeXBlKCkgPT0gMikgIC8vYXVkaW8NCisgICAgew0KKyAgICAgICAgLy9UT0RPOiB3ZSBjb3VsZCBkZWNpZGUgdG8gdXNlIGN1ZXMgZm9yIHRoaXMsIGFzIHdlIGRvIGZvciB2aWRlby4NCisgICAgICAgIC8vQnV0IHdlIG9ubHkgdXNlIGl0IGZvciB2aWRlbyBiZWNhdXNlIGxvb2tpbmcgYXJvdW5kIGZvciBhIGtleWZyYW1lDQorICAgICAgICAvL2NhbiBnZXQgZXhwZW5zaXZlLiAgQXVkaW8gZG9lc24ndCByZXF1aXJlIGFueXRoaW5nIHNwZWNpYWwgc28gYQ0KKyAgICAgICAgLy9zdHJhaWdodCBjbHVzdGVyIHNlYXJjaCBpcyBnb29kIGVub3VnaCAod2UgYXNzdW1lKS4NCisNCisgICAgICAgIENsdXN0ZXIqKiBsbyA9IGk7DQorICAgICAgICBDbHVzdGVyKiogaGkgPSBqOw0KKw0KKyAgICAgICAgd2hpbGUgKGxvIDwgaGkpDQorICAgICAgICB7DQorICAgICAgICAgICAgLy9JTlZBUklBTlQ6DQorICAgICAgICAgICAgLy9baSwgbG8pIDw9IHRpbWVfbnMNCisgICAgICAgICAgICAvL1tsbywgaGkpID8NCisgICAgICAgICAgICAvL1toaSwgaikgID4gdGltZV9ucw0KKw0KKyAgICAgICAgICAgIENsdXN0ZXIqKiBjb25zdCBtaWQgPSBsbyArIChoaSAtIGxvKSAvIDI7DQorICAgICAgICAgICAgYXNzZXJ0KG1pZCA8IGhpKTsNCisNCisgICAgICAgICAgICBDbHVzdGVyKiBjb25zdCBwQ2x1c3RlciA9ICptaWQ7DQorICAgICAgICAgICAgYXNzZXJ0KHBDbHVzdGVyKTsNCisgICAgICAgICAgICBhc3NlcnQocENsdXN0ZXItPm1faW5kZXggPT0gbG9uZyhtaWQgLSBtX2NsdXN0ZXJzKSk7DQorICAgICAgICAgICAgYXNzZXJ0KHBDbHVzdGVyLT5tX3BTZWdtZW50ID09IHRoaXMpOw0KKw0KKyAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyB0ID0gcENsdXN0ZXItPkdldFRpbWUoKTsNCisNCisgICAgICAgICAgICBpZiAodCA8PSB0aW1lX25zKQ0KKyAgICAgICAgICAgICAgICBsbyA9IG1pZCArIDE7DQorICAgICAgICAgICAgZWxzZQ0KKyAgICAgICAgICAgICAgICBoaSA9IG1pZDsNCisNCisgICAgICAgICAgICBhc3NlcnQobG8gPD0gaGkpOw0KKyAgICAgICAgfQ0KKw0KKyAgICAgICAgYXNzZXJ0KGxvID09IGhpKTsNCisgICAgICAgIGFzc2VydChsbyA+IGkpOw0KKyAgICAgICAgYXNzZXJ0KGxvIDw9IGopOw0KKw0KKyAgICAgICAgQ2x1c3RlciogY29uc3QgcENsdXN0ZXIgPSAqLS1sbzsNCisgICAgICAgIGFzc2VydChwQ2x1c3Rlcik7DQorICAgICAgICBhc3NlcnQocENsdXN0ZXItPkdldFRpbWUoKSA8PSB0aW1lX25zKTsNCisNCisgICAgICAgIHJldHVybiBwQ2x1c3Rlci0+R2V0RW50cnkocFRyYWNrKTsNCisgICAgfQ0KKw0KKyAgICBhc3NlcnQocFRyYWNrLT5HZXRUeXBlKCkgPT0gMSk7ICAvL3ZpZGVvDQorDQorICAgIENsdXN0ZXIqKiBsbyA9IGk7DQorICAgIENsdXN0ZXIqKiBoaSA9IGo7DQorDQorICAgIHdoaWxlIChsbyA8IGhpKQ0KKyAgICB7DQorICAgICAgICAvL0lOVkFSSUFOVDoNCisgICAgICAgIC8vW2ksIGxvKSA8PSB0aW1lX25zDQorICAgICAgICAvL1tsbywgaGkpID8NCisgICAgICAgIC8vW2hpLCBqKSAgPiB0aW1lX25zDQorDQorICAgICAgICBDbHVzdGVyKiogY29uc3QgbWlkID0gbG8gKyAoaGkgLSBsbykgLyAyOw0KKyAgICAgICAgYXNzZXJ0KG1pZCA8IGhpKTsNCisNCisgICAgICAgIENsdXN0ZXIqIGNvbnN0IHBDbHVzdGVyID0gKm1pZDsNCisgICAgICAgIGFzc2VydChwQ2x1c3Rlcik7DQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgdCA9IHBDbHVzdGVyLT5HZXRUaW1lKCk7DQorDQorICAgICAgICBpZiAodCA8PSB0aW1lX25zKQ0KKyAgICAgICAgICAgIGxvID0gbWlkICsgMTsNCisgICAgICAgIGVsc2UNCisgICAgICAgICAgICBoaSA9IG1pZDsNCisNCisgICAgICAgIGFzc2VydChsbyA8PSBoaSk7DQorICAgIH0NCisNCisgICAgYXNzZXJ0KGxvID09IGhpKTsNCisgICAgYXNzZXJ0KGxvID4gaSk7DQorICAgIGFzc2VydChsbyA8PSBqKTsNCisNCisgICAgQ2x1c3RlciogcENsdXN0ZXIgPSAqLS1sbzsNCisgICAgYXNzZXJ0KHBDbHVzdGVyKTsNCisgICAgYXNzZXJ0KHBDbHVzdGVyLT5HZXRUaW1lKCkgPD0gdGltZV9ucyk7DQorDQorICAgIHsNCisgICAgICAgIGNvbnN0IEJsb2NrRW50cnkqIGNvbnN0IHBCbG9ja0VudHJ5ID0gcENsdXN0ZXItPkdldEVudHJ5KHBUcmFjayk7DQorICAgICAgICBhc3NlcnQocEJsb2NrRW50cnkpOw0KKw0KKyAgICAgICAgaWYgKCFwQmxvY2tFbnRyeS0+RU9TKCkpICAvL2ZvdW5kIGEga2V5ZnJhbWUNCisgICAgICAgIHsNCisgICAgICAgICAgICBjb25zdCBCbG9jayogY29uc3QgcEJsb2NrID0gcEJsb2NrRW50cnktPkdldEJsb2NrKCk7DQorICAgICAgICAgICAgYXNzZX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orICAgIGxvbmcgbG9uZyBwb3MgPSBzdGFydDsNCisgICAgY29uc3QgbG9uZyBsb25nIHN0b3AgPSBzdGFydCArIHNpemVfOw0KKw0KKyAgICBtX3RpbWVjb2RlU2NhbGUgPSAxMDAwMDAwOw0KKyAgICBtX2R1cmF0aW9uID0gLTE7DQorDQorICAgIHdoaWxlIChwb3MgPCBzdG9wKQ0KKyAgICB7DQorICAgICAgICBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDBBRDdCMSwgbV90aW1lY29kZVNjYWxlKSkNCisgICAgICAgICAgICBhc3NlcnQobV90aW1lY29kZVNjYWxlID4gMCk7DQorDQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MDQ4OSwgbV9kdXJhdGlvbikpDQorICAgICAgICAgICAgYXNzZXJ0KG1fZHVyYXRpb24gPj0gMCk7DQorDQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MEQ4MCwgbV9wTXV4aW5nQXBwQXNVVEY4KSkgICAvL1s0RF1bODBdDQorICAgICAgICAgICAgYXNzZXJ0KG1fcE11eGluZ0FwcEFzVVRGOCk7DQorDQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MTc0MSwgbV9wV3JpdGluZ0FwcEFzVVRGOCkpICAvL1s1N11bNDFdDQorICAgICAgICAgICAgYXNzZXJ0KG1fcFdyaXRpbmdBcHBBc1VURjgpOw0KKw0KKyAgICAgICAgZWxzZSBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDNCQTksIG1fcFRpdGxlQXNVVEY4KSkgICAgICAgLy9bN0JdW0E5XQ0KKyAgICAgICAgICAgIGFzc2VydChtX3BUaXRsZUFzVVRGOCk7DQorDQorICAgICAgICBlbHNlDQorICAgICAgICB7DQorICAgICAgICAgICAgbG9uZyBsZW47DQorDQorICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOw0KKyAgICAgICAgICAgIC8vaWQ7DQorICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOw0KKyAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkDQorICAgICAgICAgICAgYXNzZXJ0KChzdG9wIC0gcG9zKSA+IDApOw0KKw0KKyAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOw0KKyAgICAgICAgICAgIGFzc2VydChzaXplID49IDApOw0KKyAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAgICBwb3MgKz0gbGVuICsgc2l6ZTsgIC8vY29uc3VtZSBzaXplIGFuZCBwYXlsb2FkDQorICAgICAgICAgICAgYXNzZXJ0KHBvcyA8PSBzdG9wKTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICBhc3NlcnQocG9zID09IHN0b3ApOw0KK30NCisNCitTZWdtZW50SW5mbzo6flNlZ21lbnRJbmZvKCkNCit7DQorICAgIGlmIChtX3BNdXhpbmdBcHBBc1VURjgpDQorICAgIHsNCisgICAgICAgIGRlbGV0ZVtdIG1fcE11eGluZ0FwcEFzVVRGODsNCisgICAgICAgIG1fcE11eGluZ0FwcEFzVVRGOCA9IE5VTEw7DQorICAgIH0NCisNCisgICAgaWYgKG1fcFdyaXRpbmdBcHBBc1VURjgpDQorICAgIHsNCisgICAgICAgIGRlbGV0ZVtdIG1fcFdyaXRpbmdBcHBBc1VURjg7DQorICAgICAgICBtX3BXcml0aW5nQXBwQXNVVEY4ID0gTlVMTDsNCisgICAgfQ0KKw0KKyAgICBpZiAobV9wVGl0bGVBc1VURjgpDQorICAgIHsNCisgICAgICAgIGRlbGV0ZVtdIG1fcFRpdGxlQXNVVEY4Ow0KKyAgICAgICAgbV9wVGl0bGVBc1VURjggPSBOVUxMOw0KKyAgICB9DQorfQ0KKw0KK2xvbmcgbG9uZyBTZWdtZW50SW5mbzo6R2V0VGltZUNvZGVTY2FsZSgpIGNvbnN0DQorew0KKyAgICByZXR1cm4gbV90aW1lY29kZVNjYWxlOw0KK30NCisNCisNCitsb25nIGxvbmcgU2VnbWVudEluZm86OkdldER1cmF0aW9uKCkgY29uc3QNCit7DQorICAgIGlmIChtX2R1cmF0aW9uIDwgMCkNCisgICAgICAgIHJldHVybiAtMTsNCisNCisgICAgYXNzZXJ0KG1fdGltZWNvZGVTY2FsZSA+PSAxKTsNCisNCisgICAgY29uc3QgZG91YmxlIGRkID0gZG91YmxlKG1fZHVyYXRpb24pICogZG91YmxlKG1fdGltZWNvZGVTY2FsZSk7DQorICAgIGNvbnN0IGxvbmcgbG9uZyBkID0gc3RhdGljX2Nhc3Q8bG9uZyBsb25nPihkZCk7DQorDQorICAgIHJldHVybiBkOw0KK30NCisNCitjb25zdCBjaGFyKiBTZWdtZW50SW5mbzo6R2V0TXV4aW5nQXBwQXNVVEY4KCkgY29uc3QNCit7DQorICAgIHJldHVybiBtX3BNdXhpbmdBcHBBc1VURjg7DQorfQ0KKw0KKw0KK2NvbnN0IGNoYXIqIFNlZ21lbnRJbmZvOjpHZXRXcml0aW5nQXBwQXNVVEY4KCkgY29uc3QNCit7DQorICAgIHJldHVybiBtX3BXcml0aW5nQXBwQXNVVEY4Ow0KK30NCisNCitjb25zdCBjaGFyKiBTZWdtZW50SW5mbzo6R2V0VGl0bGVBc1VURjgoKSBjb25zdA0KK3sNCisgICAgcmV0dXJuIG1fcFRpdGxlQXNVVEY4Ow0KK30NCisNCitUcmFjazo6VHJhY2soU2VnbWVudCogcFNlZ21lbnQsIGNvbnN0IEluZm8mIGkpIDoNCisgICAgbV9wU2VnbWVudChwU2VnbWVudCksDQorICAgIG1faW5mbyhpKQ0KK3sNCit9DQorDQorVHJhY2s6On5UcmFjaygpDQ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ICAgICBwQmxvY2tFbnRyeSA9IEdldEVPUygpOw0KKyAgICAgICAgICAgIHJldHVybiAxOw0KKyAgICAgICAgfQ0KKw0KKyAgICAgICAgaWYgKHBDbHVzdGVyLT5FT1MoKSkNCisgICAgICAgIHsNCisgICAgICAgICAgICBpZiAobV9wU2VnbWVudC0+VW5wYXJzZWQoKSA8PSAwKSAgLy9hbGwgY2x1c3RlcnMgaGF2ZSBiZWVuIGxvYWRlZA0KKyAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgcEJsb2NrRW50cnkgPSBHZXRFT1MoKTsNCisgICAgICAgICAgICAgICAgcmV0dXJuIDE7DQorICAgICAgICAgICAgfQ0KKw0KKyAgICAgICAgICAgIHBCbG9ja0VudHJ5ID0gMDsNCisgICAgICAgICAgICByZXR1cm4gRV9CVUZGRVJfTk9UX0ZVTEw7DQorICAgICAgICB9DQorDQorICAgICAgICBwQmxvY2tFbnRyeSA9IHBDbHVzdGVyLT5HZXRGaXJzdCgpOw0KKw0KKyAgICAgICAgd2hpbGUgKHBCbG9ja0VudHJ5KQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGNvbnN0IEJsb2NrKiBjb25zdCBwQmxvY2sgPSBwQmxvY2tFbnRyeS0+R2V0QmxvY2soKTsNCisgICAgICAgICAgICBhc3NlcnQocEJsb2NrKTsNCisNCisgICAgICAgICAgICBpZiAocEJsb2NrLT5HZXRUcmFja051bWJlcigpID09IG1faW5mby5udW1iZXIpDQorICAgICAgICAgICAgICAgIHJldHVybiAwOw0KKw0KKyAgICAgICAgICAgIHBCbG9ja0VudHJ5ID0gcENsdXN0ZXItPkdldE5leHQocEJsb2NrRW50cnkpOw0KKyAgICAgICAgfQ0KKw0KKyAgICAgICAgcENsdXN0ZXIgPSBtX3BTZWdtZW50LT5HZXROZXh0KHBDbHVzdGVyKTsNCisgICAgfQ0KKw0KKyAgICAvL05PVEU6IGlmIHdlIGdldCBoZXJlLCBpdCBtZWFucyB0aGF0IHdlIGRpZG4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ICBjb25zdCBCbG9jayogY29uc3QgcE5leHRCbG9jayA9IHBOZXh0RW50cnktPkdldEJsb2NrKCk7DQorICAgICAgICAgICAgYXNzZXJ0KHBOZXh0QmxvY2spOw0KKw0KKyAgICAgICAgICAgIGlmIChwTmV4dEJsb2NrLT5HZXRUcmFja051bWJlcigpID09IG1faW5mby5udW1iZXIpDQorICAgICAgICAgICAgICAgIHJldHVybiAwOw0KKw0KKyAgICAgICAgICAgIHBOZXh0RW50cnkgPSBwQ2x1c3Rlci0+R2V0TmV4dChwTmV4dEVudHJ5KTsNCisgICAgICAgIH0NCisNCisgICAgICAgIHBDbHVzdGVyID0gbV9wU2VnbWVudC0+R2V0TmV4dChwQ2x1c3Rlcik7DQorDQorICAgICAgICBpZiAocENsdXN0ZXIgPT0gTlVMTCkNCisgICAgICAgIHsNCisgICAgICAgICAgICBwTmV4dEVudHJ5ID0gR2V0RU9TKCk7DQorICAgICAgICAgICAgcmV0dXJuIDE7DQorICAgICAgICB9DQorDQorICAgICAgICBpZiAocENsdXN0ZXItPkVPUygpKQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGlmIChtX3BTZWdtZW50LT5VbnBhcnNlZCgpIDw9IDApICAgLy9hbGwgY2x1c3RlcnMgaGF2ZSBiZWVuIGxvYWRlZA0KKyAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgcE5leHRFbnRyeSA9IEdldEVPUygpOw0KKyAgICAgICAgICAgICAgICByZXR1cm4gMTsNCisgICAgICAgICAgICB9DQorDQorICAgICAgICAgICAgLy9UT0RPOiB0aGVyZSBpcyBhIHBvdGVudGlhbCBPKG5eMikgcHJvYmxlbSBoZXJlOiB3ZSB0ZWxsIHRoZQ0KKyAgICAgICAgICAgIC8vY2FsbGVyIHRvIChwcmUpbG9hZCBhbm90aGVyIGNsdXN0ZXIsIHdoaWNoIGhlIGRvZXMsIGJ1dCB0aGVuIGhlDQorICAgICAgICAgICAgLy9jYWxscyBHZXROZXh0IGFnYWluLCB3aGlj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MCk7DQorDQorICAgIElNa3ZSZWFkZXIqIGNvbnN0IHBSZWFkZXIgPSBwU2VnbWVudC0+bV9wUmVhZGVyOw0KKw0KKyAgICBjb25zdCBTZXR0aW5ncyYgcyA9IGkuc2V0dGluZ3M7DQorICAgIGFzc2VydChzLnN0YXJ0ID49IDApOw0KKyAgICBhc3NlcnQocy5zaXplID49IDApOw0KKw0KKyAgICBsb25nIGxvbmcgcG9zID0gcy5zdGFydDsNCisgICAgYXNzZXJ0KHBvcyA+PSAwKTsNCisNCisgICAgY29uc3QgbG9uZyBsb25nIHN0b3AgPSBwb3MgKyBzLnNpemU7DQorDQorICAgIHdoaWxlIChwb3MgPCBzdG9wKQ0KKyAgICB7DQorI2lmZGVmIF9ERUJVRw0KKyAgICAgICAgbG9uZyBsZW47DQorICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICBhc3NlcnQoaWQgPj0gMCk7ICAvL1RPRE86IGhhbmRsZSBlcnJvciBjYXNlDQorICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7DQorI2VuZGlmDQorICAgICAgICBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDMwLCBtX3dpZHRoKSkNCisgICAgICAgICAgICA7DQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4M0EsIG1faGVpZ2h0KSkNCisgICAgICAgICAgICA7DQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MDM4M0UzLCBtX3JhdGUpKQ0KKyAgICAgICAgICAgIDsNCisgICAgICAgIGVsc2UNCisgICAgICAgIHsNCisgICAgICAgICAgICBsb25nIGxlbjsNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPOiBoYW5kbGUgZXJyb3IgY2FzZQ0KKyAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkDQorDQorICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICAgICAgYXNzZXJ0KHNpemUgPj0gMCk7ICAvL1RPRE86IGhhbmRsZSBlcnJvciBjYXNlDQorICAgICAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOw0KKw0KKyAgICAgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgbGVuZ3RoIG9mIHNpemUNCisgICAgICAgICAgICBhc3NlcnQoKHBvcyArIHNpemUpIDw9IHN0b3ApOw0KKw0KKyAgICAgICAgICAgIC8vcG9zIG5vdyBkZXNpZ25hdGVzIHN0YXJ0IG9mIHBheWxvYWQNCisNCisgICAgICAgICAgICBwb3MgKz0gc2l6ZTsgIC8vY29uc3VtZSBwYXlsb2FkDQorICAgICAgICAgICAgYXNzZXJ0KHBvcyA8PSBzdG9wKTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICByZXR1cm47DQorfQ0KKw0KKw0KK2Jvb2wgVmlkZW9UcmFjazo6VmV0RW50cnkoY29uc3QgQmxvY2tFbnRyeSogcEJsb2NrRW50cnkpIGNvbnN0DQorew0KKyAgICBhc3NlcnQocEJsb2NrRW50cnkpOw0KKw0KKyAgICBjb25zdCBCbG9jayogY29uc3QgcEJsb2NrID0gcEJsb2NrRW50cnktPkdldEJsb2NrKCk7DQorICAgIGFzc2VydChwQmxvY2spOw0KKyAgICBhc3NlcnQocEJsb2NrLT5HZXRUcmFja051bWJlcigpID09IG1faW5mby5udW1iZXIpOw0KKw0KKyAgICByZXR1cm4gcEJsb2NrLT5Jc0tleSgpOw0KK30NCisNCisNCits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ICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPOiBoYW5kbGUgZXJyb3IgY2FzZQ0KKyAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOw0KKyNlbmRpZg0KKyAgICAgICAgaWYgKE1hdGNoKHBSZWFkZXIsIHBvcywgMHgzNSwgbV9yYXRlKSkNCisgICAgICAgICAgICA7DQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MUYsIG1fY2hhbm5lbHMpKQ0KKyAgICAgICAgICAgIDsNCisgICAgICAgIGVsc2UgaWYgKE1hdGNoKHBSZWFkZXIsIHBvcywgMHgyMjY0LCBtX2JpdERlcHRoKSkNCisgICAgICAgICAgICA7DQorICAgICAgICBlbHNlDQorICAgICAgICB7DQorICAgICAgICAgICAgbG9uZyBsZW47DQorICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOw0KKyAgICAgICAgICAgIGFzc2VydChpZCA+PSAwKTsgIC8vVE9ETzogaGFuZGxlIGVycm9yIGNhc2UNCisgICAgICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7DQorDQorICAgICAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBpZA0KKw0KKyAgICAgICAgICAgIGNvbnN0IGxvbmcgbG9uZyBzaXplID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOw0KKyAgICAgICAgICAgIGFzc2VydChzaXplID49IDApOyAgLy9UT0RPOiBoYW5kbGUgZXJyb3IgY2FzZQ0KKyAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGxlbmd0aCBvZiBzaXplDQorICAgICAgICAgICAgYXNzZXJ0KChwb3MgKyBzaXplKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAg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nRyaWVzKE5VTEwpLA0KKyAgICBtX3RyYWNrRW50cmllc0VuZChOVUxMKQ0KK3sNCisgICAgbG9uZyBsb25nIHN0b3AgPSBtX3N0YXJ0ICsgbV9zaXplOw0KKyAgICBJTWt2UmVhZGVyKiBjb25zdCBwUmVhZGVyID0gbV9wU2VnbWVudC0+bV9wUmVhZGVyOw0KKw0KKyAgICBsb25nIGxvbmcgcG9zMSA9IG1fc3RhcnQ7DQorICAgIGludCBjb3VudCA9IDA7DQorDQorICAgIHdoaWxlIChwb3MxIDwgc3RvcCkNCisgICAgew0KKyAgICAgICAgbG9uZyBsZW47DQorICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MxLCBsZW4pOw0KKyAgICAgICAgYXNzZXJ0KGlkID49IDApOw0KKyAgICAgICAgYXNzZXJ0KChwb3MxICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgIHBvczEgKz0gbGVuOyAgLy9jb25zdW1lIGlkDQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KHBSZWFkZXIsIHBvczEsIGxlbik7DQorICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTsNCisgICAgICAgIGFzc2VydCgocG9zMSArIGxlbikgPD0gc3RvcCk7DQorDQorICAgICAgICBwb3MxICs9IGxlbjsgIC8vY29uc3VtZSBsZW5ndGggb2Ygc2l6ZQ0KKw0KKyAgICAgICAgLy9wb3Mgbm93IGRlc2luYXRlcyBzdGFydCBvZiBlbGVtZW50DQorICAgICAgICBpZiAoaWQgPT0gMHgyRSkgIC8vVHJhY2tFbnRyeSBJRA0KKyAgICAgICAgICAgICsrY291bnQ7DQorDQorICAgICAgICBwb3MxICs9IHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZA0KKyAgICAgICAgYXNzZXJ0KHBvczEgPD0gc3RvcCk7DQorICAgIH0NCisNCisgICAgaWYgKGNvdW50IDw9IDApDQorICAgICAgICByZXR1cm47DQorDQorICAgIG1fdHJhY2tFbnRyaWVzID0gbmV3IFRyYWNrKltjb3VudF07DQorICAgIG1fdHJhY2tFbnRyaWVzRW5kID0gbV90cmFja0VudHJpZXM7DQorDQorICAgIGxvbmcgbG9uZyBwb3MgPSBtX3N0YXJ0Ow0KKw0KKyAgICB3aGlsZSAocG9zIDwgc3RvcCkNCisgICAgew0KKyAgICAgICAgbG9uZyBsZW47DQorICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICBhc3NlcnQoaWQgPj0gMCk7DQorICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7DQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkDQorDQorICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZTEgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICBhc3NlcnQoc2l6ZTEgPj0gMCk7DQorICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7DQorDQorICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGxlbmd0aCBvZiBzaXplDQorDQorICAgICAgICAvL3BvcyBub3cgZGVzaW5hdGVzIHN0YXJ0IG9mIGVsZW1lbnQNCisNCisgICAgICAgIGlmIChpZCA9PSAweDJFKSAgLy9UcmFja0VudHJ5IElEDQorICAgICAgICAgICAgUGFyc2VUcmFja0VudHJ5KHBvcywgc2l6ZTEsICptX3RyYWNrRW50cmllc0VuZCsrKTsNCisNCisgICAgICAgIHBvcyArPSBzaXplMTsgIC8vY29uc3VtZSBwYXlsb2FkDQorICAgICAgICBhc3NlcnQocG9zIDw9IHN0b3ApOw0KKyAgICB9DQorfQ0KKw0KKw0KK3Vuc2lnbmVkIGxvbmcgVHJhY2tzOjpHZXRUcmFja3NDb3VudCgpIGNvbnN0DQorew0KKyAgICBjb25z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F0Y2gocFJlYWRlciwgcG9zLCAweDMzQzUsIGkudWlkKSkNCisgICAgICAgICAgICA7DQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MDMsIGkudHlwZSkpDQorICAgICAgICAgICAgOw0KKyAgICAgICAgZWxzZSBpZiAoTWF0Y2gocFJlYWRlciwgcG9zLCAweDEzNkUsIGkubmFtZUFzVVRGOCkpDQorICAgICAgICAgICAgYXNzZXJ0KGkubmFtZUFzVVRGOCk7DQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MDYsIGkuY29kZWNJZCkpDQorICAgICAgICAgICAgOw0KKyAgICAgICAgZWxzZSBpZiAoTWF0Y2gocFJlYWRlciwNCisgICAgICAgICAgICAgICAgICAgICAgIHBvcywNCisgICAgICAgICAgICAgICAgICAgICAgIDB4MjNBMiwNCisgICAgICAgICAgICAgICAgICAgICAgIGkuY29kZWNQcml2YXRlLA0KKyAgICAgICAgICAgICAgICAgICAgICAgaS5jb2RlY1ByaXZhdGVTaXplKSkNCisgICAgICAgICAgICA7DQorICAgICAgICBlbHNlIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4MDU4Njg4LCBpLmNvZGVjTmFtZUFzVVRGOCkpDQorICAgICAgICAgICAgYXNzZXJ0KGkuY29kZWNOYW1lQXNVVEY4KTsNCisgICAgICAgIGVsc2UNCisgICAgICAgIHsNCisgICAgICAgICAgICBsb25nIGxlbjsNCisNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPOiBoYW5kbGUgZXJyb3IgY2FzZQ0KKyAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkDQorDQorICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICAgICAgYXNzZXJ0KHNpemUgPj0gMCk7ICAvL1RPRE86IGhhbmRsZSBlcnJvciBjYXNlDQorICAgICAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOw0KKw0KKyAgICAgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgbGVuZ3RoIG9mIHNpemUNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgc3RhcnQgPSBwb3M7DQorDQorICAgICAgICAgICAgcG9zICs9IHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZA0KKyAgICAgICAgICAgIGFzc2VydChwb3MgPD0gc3RvcCk7DQorDQorICAgICAgICAgICAgaWYgKGlkID09IDB4NjApDQorICAgICAgICAgICAgew0KKyAgICAgICAgICAgICAgICB2aWRlb1NldHRpbmdzLnN0YXJ0ID0gc3RhcnQ7DQorICAgICAgICAgICAgICAgIHZpZGVvU2V0dGluZ3Muc2l6ZSA9IHNpemU7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIGVsc2UgaWYgKGlkID09IDB4NjEpDQorICAgICAgICAgICAgew0KKyAgICAgICAgICAgICAgICBhdWRpb1NldHRpbmdzLnN0YXJ0ID0gc3RhcnQ7DQorICAgICAgICAgICAgICAgIGF1ZGlvU2V0dGluZ3Muc2l6ZSA9IHNpemU7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorICAgIGFzc2VydChwb3MgPT0gc3RvcCk7DQorICAgIC8vVE9ETzogcHJvcGVydGx5IHZldCBpbmZvLm51bWJlciwgdG8gZW5zdXJlIGJvdGggaXRzIGV4aXN0ZW5jZSwNCisgICAgLy9hbmQgdGhhdCBpdCBpcyB1bmlxdWUgYW1vbmcgYWxsIHRyYWNrcy4NCisgICAgYXNzZXJ0KGkubnVtYmVyID4gMCk7DQor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YWNrIHR5cGVzIHlldC4NCisgICAgICAgIC8vIFRPRE86IHN1cHBvcnQgb3RoZXIgdHJhY2sgdHlwZXMNCisgICAgICAgIGkuQ2xlYXIoKTsNCisNCisgICAgICAgIHBUcmFjayA9IE5VTEw7DQorICAgIH0NCisNCisgICAgcmV0dXJuOw0KK30NCisNCisNCitUcmFja3M6On5UcmFja3MoKQ0KK3sNCisgICAgVHJhY2sqKiBpID0gbV90cmFja0VudHJpZXM7DQorICAgIFRyYWNrKiogY29uc3QgaiA9IG1fdHJhY2tFbnRyaWVzRW5kOw0KKw0KKyAgICB3aGlsZSAoaSAhPSBqKQ0KKyAgICB7DQorICAgICAgICBUcmFjayogY29uc3QgcFRyYWNrID0gKmkrKzsNCisgICAgICAgIGRlbGV0ZSBwVHJhY2s7DQorICAgIH0NCisNCisgICAgZGVsZXRlW10gbV90cmFja0VudHJpZXM7DQorfQ0KKw0KKw0KK1RyYWNrKiBUcmFja3M6OkdldFRyYWNrQnlOdW1iZXIodW5zaWduZWQgbG9uZyB0bl8pIGNvbnN0DQorew0KKyAgICBjb25zdCBsb25nIGxvbmcgdG4gPSB0bl87DQorDQorICAgIFRyYWNrKiogaSA9IG1fdHJhY2tFbnRyaWVzOw0KKyAgICBUcmFjayoqIGNvbnN0IGogPSBtX3RyYWNrRW50cmllc0VuZDsNCisNCisgICAgd2hpbGUgKGkgIT0gaikNCisgICAgew0KKyAgICAgICAgVHJhY2sqIGNvbnN0IHBUcmFjayA9ICppKys7DQorDQorICAgICAgICBpZiAocFRyYWNrID09IE5VTEwpDQorICAgICAgICAgICAgY29udGludWU7DQorDQorICAgICAgICBpZiAodG4gPT0gcFRyYWNrLT5HZXROdW1iZXIoKSkNCisgICAgICAgICAgICByZXR1cm4gcFRyYWNrOw0KKyAgICB9DQorDQorICAgIHJldHVybiBOVUxMOyAgLy9ub3QgZm91bmQNCit9DQorDQorDQorVHJhY2sqIFRyYWNrczo6R2V0VHJhY2tCeUluZGV4KHVuc2lnbmVkIGxvbmcgaWR4KSBjb25zdA0KK3sNCisgICAgY29uc3QgcHRyZGlmZl90IGNvdW50ID0gbV90cmFja0VudHJpZXNFbmQgLSBtX3RyYWNrRW50cmllczsNCisNCisgICAgaWYgKGlkeCA+PSBzdGF0aWNfY2FzdDx1bnNpZ25lZCBsb25nPihjb3VudCkpDQorICAgICAgICAgcmV0dXJuIE5VTEw7DQorDQorICAgIHJldHVybiBtX3RyYWNrRW50cmllc1tpZHhdOw0KK30NCisNCisNCit2b2lkIENsdXN0ZXI6OkxvYWQoKQ0KK3sNCisgICAgYXNzZXJ0KG1fcFNlZ21lbnQpOw0KKyAgICBhc3NlcnQobV9wb3MpOw0KKyAgICBhc3NlcnQobV9zaXplKTsNCisNCisgICAgaWYgKG1fcG9zID4gMCkgIC8vbG9hZGVkDQorICAgIHsNCisgICAgICAgIGFzc2VydChtX3NpemUgPiAwKTsNCisgICAgICAgIGFzc2VydChtX3RpbWVjb2RlID49IDApOw0KKyAgICAgICAgcmV0dXJuOw0KKyAgICB9DQorDQorICAgIGFzc2VydChtX3BvcyA8IDApOyAgLy9ub3QgbG9hZGVkIHlldA0KKyAgICBhc3NlcnQobV9zaXplIDwgMCk7DQorICAgIGFzc2VydChtX3RpbWVjb2RlIDwgMCk7DQorDQorICAgIElNa3ZSZWFkZXIqIGNvbnN0IHBSZWFkZXIgPSBtX3BTZWdtZW50LT5tX3BSZWFkZXI7DQorDQorICAgIG1fcG9zICo9IC0xOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JlbGF0aXZlIHRvIHNlZ21lbnQNCisgICAgbG9uZyBsb25nIHBvcyA9IG1fcFNlZ21lbnQtPm1fc3RhcnQgKyBtX3BvczsgIC8vYWJzb2x1dGUNCisNCisgICAgbG9uZyBsZW47DQorDQorICAgIGNvbnN0IGxvbmcgbG9uZyBpZF8gPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgIGFzc2VydChpZF8gPj0gMCk7DQorICAgIGFzc2VydChpZF8gPT0gMHgwRjQzQjY3NSk7ICAvL0NsdXN0ZXIgSUQNCisNCisgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBpZA0KKw0KKyAgICBjb25zdCBsb25nIGxvbmcgc2l6ZV8gPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgIGFzc2VydChzaXplXyA+PSAwKTsNCisNCisgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBzaXplDQorDQorICAgIG1fc2l6ZSA9IHNpemVfOw0KKyAgICBjb25zdCBsb25nIGxvbmcgc3RvcCA9IHBvcyArIHNpemVfOw0KKw0KKyAgICBsb25nIGxvbmcgdGltZWNvZGUgPSAtMTsNCisNCisgICAgd2hpbGUgKHBvcyA8IHN0b3ApDQorICAgIHsNCisgICAgICAgIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4NjcsIHRpbWVjb2RlKSkNCisgICAgICAgICAgICBicmVhazsNCisgICAgICAgIGVsc2UNCisgICAgICAgIHsNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPDQorICAgICAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOw0KKw0KKyAgICAgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgaWQNCisNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsNCisgICAgICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTsgIC8vVE9ETw0KKyAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIHNpemUNCisNCisgICAgICAgICAgICBpZiAoaWQgPT0gMHgyMCkgIC8vQmxvY2tHcm91cCBJRA0KKyAgICAgICAgICAgICAgICBicmVhazsNCisNCisgICAgICAgICAgICBpZiAoaWQgPT0gMHgyMykgIC8vU2ltcGxlQmxvY2sgSUQNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorDQorICAgICAgICAgICAgcG9zICs9IHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZA0KKyAgICAgICAgICAgIGFzc2VydChwb3MgPD0gc3RvcCk7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgYXNzZXJ0KHBvcyA8PSBzdG9wKTsNCisgICAgYXNzZXJ0KHRpbWVjb2RlID49IDApOw0KKw0KKyAgICBtX3RpbWVjb2RlID0gdGltZWNvZGU7DQorfQ0KKw0KKw0KK0NsdXN0ZXIqIENsdXN0ZXI6OlBhcnNlKA0KKyAgICBTZWdtZW50KiBwU2VnbWVudCwNCisgICAgbG9uZyBpZHgsDQorICAgIGxvbmcgbG9uZyBvZmYpDQorew0KKyAgICBhc3NlcnQocFNlZ21lbnQpOw0KKyAgICBhc3NlcnQob2ZmID49IDApOw0KKyAgICBhc3NlcnQob2ZmIDwgcFNlZ21lbnQtPm1fc2l6ZSk7DQorDQorICAgIENsdXN0ZXIqIGNvbnN0IHBDbHVzdGVyID0gbmV3IENsdXN0ZXIocFNlZ21lbnQsIGlkeCwgLW9mZik7DQorICAgIGFzc2VydChwQ2x1c3Rlcik7DQorDQorICAgIHJldHVybiBwQ2x1c3RlcjsNCit9DQorDQorDQorQ2x1c3Rlcjo6Q2x1c3RlcigpIDoNCisgICAgbV9wU2VnbWVudChOVUxMKSwNCisgICAgbV9pbmRleCgwKSwNCisgICAgbV9wb3MoMCksDQorICAgIG1fc2l6ZSgwKSwNCisgICAgbV90aW1lY29kZSgwKSwNCisgICAgbV9lbnRyaWVzKE5VTEwpLA0KKyAgICBtX2VudHJpZXNDb3VudCgwKQ0KK3sNCit9DQorDQorDQorQ2x1c3Rlcjo6Q2x1c3RlcigNCisgICAgU2VnbWVudCogcFNlZ21lbnQsDQorICAgIGxvbmcgaWR4LA0KKyAgICBsb25nIGxvbmcgb2ZmKSA6DQorICAgIG1fcFNlZ21lbnQocFNlZ21lbnQpLA0KKyAgICBtX2luZGV4KGlkeCksDQorICAgIG1fcG9zKG9mZiksDQorICAgIG1fc2l6ZSgtMSksDQorICAgIG1fdGltZWNvZGUoLTEpLA0KKyAgICBtX2VudHJpZXMoTlVMTCksDQorICAgIG1fZW50cmllc0NvdW50KDApDQorew0KK30NCisNCisNCitDbHVzdGVyOjp+Q2x1c3RlcigpDQorew0KKyAgICBCbG9ja0VudHJ5KiogaSA9IG1fZW50cmllczsNCisgICAgQmxvY2tFbnRyeSoqIGNvbnN0IGogPSBtX2VudHJpZXMgKyBtX2VudHJpZXNDb3VudDsNCisNCisgICAgd2hpbGUgKGkgIT0gaikNCisgICAgew0KKyAgICAgICAgIEJsb2NrRW50cnkqIHAgPSAqaSsrOw0KKyAgICAgICAgIGFzc2VydChwKTsNCisNCisgICAgICAgICBkZWxldGUgcDsNCisgICAgfQ0KKw0KKyAgICBkZWxldGVbXSBtX2VudHJpZXM7DQorfQ0KKw0KKw0KK2Jvb2wgQ2x1c3Rlcjo6RU9TKCkgY29uc3QNCit7DQorICAgIHJldHVybiAobV9wU2VnbWVudCA9PSBOVUxMKTsNCit9DQorDQorDQordm9pZCBDbHVzdGVyOjpMb2FkQmxvY2tFbnRyaWVzKCkNCit7DQorICAgIGlmIChtX2VudHJpZXMpDQorICAgICAgICByZXR1cm47DQorDQorICAgIGFzc2VydChtX3BTZWdtZW50KTsNCisgICAgYXNzZXJ0KG1fcG9zKTsNCisgICAgYXNzZXJ0KG1fc2l6ZSk7DQorICAgIGFzc2VydChtX2VudHJpZXNDb3VudCA9PSAwKTsNCisNCisgICAgSU1rdlJlYWRlciogY29uc3QgcFJlYWRlciA9IG1fcFNlZ21lbnQtPm1fcFJlYWRlcjsNCisNCisgICAgaWYgKG1fcG9zIDwgMCkNCisgICAgICAgIG1fcG9zICo9IC0x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SAwOw0KKw0KKyAgICB3aGlsZSAoaWR4IDwgc3RvcCkNCisgICAgew0KKyAgICAgICAgaWYgKE1hdGNoKHBSZWFkZXIsIGlkeCwgMHg2NywgdGltZWNvZGUpKQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGlmIChtX3RpbWVjb2RlID49IDApDQorICAgICAgICAgICAgICAgIGFzc2VydCh0aW1lY29kZSA9PSBtX3RpbWVjb2RlKTsNCisgICAgICAgICAgICBlbHNlDQorICAgICAgICAgICAgICAgIG1fdGltZWNvZGUgPSB0aW1lY29kZTsNCisgICAgICAgIH0NCisgICAgICAgIGVsc2UNCisgICAgICAgIHsNCisgICAgICAgICAgICBsb25nIGxlbjsNCisNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBpZHgsIGxlbik7DQorICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPDQorICAgICAgICAgICAgYXNzZXJ0KChpZHggKyBsZW4pIDw9IHN0b3ApOw0KKw0KKyAgICAgICAgICAgIGlkeCArPSBsZW47ICAvL2NvbnN1bWUgaWQNCisNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KHBSZWFkZXIsIGlkeCwgbGVuKTsNCisgICAgICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTsgIC8vVE9ETw0KKyAgICAgICAgICAgIGFzc2VydCgoaWR4ICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAgICBpZHggKz0gbGVuOyAgLy9jb25zdW1lIHNpemUNCisNCisgICAgICAgICAgICBpZiAoaWQgPT0gMHgyMCkgIC8vQmxvY2tHcm91cCBJRA0KKyAgICAgICAgICAgICAgICArK21fZW50cmllc0NvdW50Ow0KKyAgICAgICAgICAgIGVsc2UgaWYgKGlkID09IDB4MjMpICAvL1NpbXBsZUJsb2NrIElEDQorICAgICAgICAgICAgICAgICsrbV9lbnRyaWVzQ291bnQ7DQorDQorICAgICAgICAgICAgaWR4ICs9IHNpemU7ICAvL2NvbnN1bWUgcGF5bG9hZA0KKyAgICAgICAgICAgIGFzc2VydChpZHggPD0gc3RvcCk7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgYXNzZXJ0KGlkeCA9PSBzdG9wKTsNCisgICAgYXNzZXJ0KG1fdGltZWNvZGUgPj0gMCk7DQorDQorICAgIGlmIChtX2VudHJpZXNDb3VudCA9PSAwKSAgLy9UT0RPOiBoYW5kbGUgZW1wdHkgY2x1c3RlcnMNCisgICAgICAgIHJldHVybjsNCisNCisgICAgbV9lbnRyaWVzID0gbmV3IEJsb2NrRW50cnkqW21fZW50cmllc0NvdW50XTsNCisgICAgc2l6ZV90IGluZGV4ID0gMDsNCisNCisgICAgd2hpbGUgKHBvcyA8IHN0b3ApDQorICAgIHsNCisgICAgICAgIGlmIChNYXRjaChwUmVhZGVyLCBwb3MsIDB4NjcsIHRpbWVjb2RlKSkNCisgICAgICAgICAgICBhc3NlcnQodGltZWNvZGUgPT0gbV90aW1lY29kZSk7DQorICAgICAgICBlbHNlDQorICAgICAgICB7DQorICAgICAgICAgICAgbG9uZyBsZW47DQorICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIGlkID0gUmVhZFVJbnQocFJlYWRlciwgcG9zLCBsZW4pOw0KKyAgICAgICAgICAgIGFzc2VydChpZCA+PSAwKTsgIC8vVE9ETw0KKyAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIGlkDQorDQorICAgICAgICAgICAgY29uc3QgbG9uZyBsb25nIHNpemUgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICAgICAgYXNzZXJ0KHNpemUgPj0gMCk7ICAvL1RPRE8NCisgICAgICAgICAgICBhc3NlcnQoKHBvcyArIGxlbikgPD0gc3RvcCk7DQorDQorICAgICAgICAgICAgcG9zICs9IGxlbjsgIC8vY29uc3VtZSBzaXplDQorDQorICAgICAgICAgICAgaWYgKGlkID09IDB4MjApICAvL0Jsb2NrR3JvdXAgSUQNCisgICAgICAgICAgICAgICAgUGFyc2VCbG9ja0dyb3VwKHBvcywgc2l6ZSwgaW5kZXgrKyk7DQorICAgICAgICAgICAgZWxzZSBpZiAoaWQgPT0gMHgyMykgIC8vU2ltcGxlQmxvY2sgSUQNCisgICAgICAgICAgICAgICAgUGFyc2VTaW1wbGVCbG9jayhwb3MsIHNpemUsIGluZGV4KyspOw0KKw0KKyAgICAgICAgICAgIHBvcyArPSBzaXplOyAgLy9jb25zdW1lIHBheWxvYWQNCisgICAgICAgICAgICBhc3NlcnQocG9zIDw9IHN0b3ApOw0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorICAgIGFzc2VydChwb3MgPT0gc3RvcCk7DQorICAgIGFzc2VydCh0aW1lY29kZSA+PSAwKTsNCisgICAgYXNzZXJ0KGluZGV4ID09IG1fZW50cmllc0NvdW50KTsNCit9DQorDQorDQorDQorbG9uZyBsb25nIENsdXN0ZXI6OkdldFRpbWVDb2RlKCkNCit7DQorICAgIExvYWQoKTsNCisgICAgcmV0dXJuIG1fdGltZWNvZGU7DQorfQ0KKw0KKw0KK2xvbmcgbG9uZyBDbHVzdGVyOjpHZXRUaW1lKCkNCit7DQorICAgIGNvbnN0IGxvbmcgbG9uZyB0YyA9IEdldFRpbWVDb2RlKCk7DQorICAgIGFzc2VydCh0YyA+PSAwKTsNCisNCisgICAgY29uc3QgU2VnbWVudEluZm8qIGNvbnN0IHBJbmZvID0gbV9wU2VnbWVudC0+R2V0SW5mbygpOw0KKyAgICBhc3NlcnQocEluZm8pOw0KKw0KKyAgICBjb25zdCBsb25nIGxvbmcgc2NhbGUgPSBwSW5mby0+R2V0VGltZUNvZGVTY2FsZSgpOw0KKyAgICBhc3NlcnQoc2NhbGUgPj0gMSk7DQorDQorICAgIGNvbnN0IGxvbmcgbG9uZyB0ID0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NCit7DQorICAgIGFzc2VydChwVHJhY2spOw0KKw0KKyAgICBpZiAobV9wU2VnbWVudCA9PSBOVUxMKSAgLy9FT1MNCisgICAgICAgIHJldHVybiBwVHJhY2stPkdldEVPUygpOw0KKw0KKyAgICBMb2FkQmxvY2tFbnRyaWVzKCk7DQorDQorICAgIGlmICgobV9lbnRyaWVzID09IE5VTEwpIHx8IChtX2VudHJpZXNDb3VudCA9PSAwKSkNCisgICAgICAgIHJldHVybiBOVUxMOw0KKw0KKyAgICBCbG9ja0VudHJ5KiogaSA9IG1fZW50cmllczsNCisgICAgYXNzZXJ0KGkpOw0KKw0KKyAgICBCbG9ja0VudHJ5KiogY29uc3QgaiA9IGkgKyBtX2VudHJpZXNDb3VudDsNCisNCisgICAgd2hpbGUgKGkgIT0gaikNCisgICAgew0KKyAgICAgICAgY29uc3QgQmxvY2tFbnRyeSogY29uc3QgcEVudHJ5ID0gKmkrKzsNCisgICAgICAgIGFzc2VydChwRW50cnkpOw0KKyAgICAgICAgYXNzZXJ0KCFwRW50cnktPkVPUygpKTsNCisNCisgICAgICAgIGNvbnN0IEJsb2NrKiBjb25zdCBwQmxvY2sgPSBwRW50cnktPkdldEJsb2NrKCk7DQorICAgICAgICBhc3NlcnQocEJsb2NrKTsNCisNCisgICAgICAgIGlmIChwQmxvY2stPkdldFRyYWNrTnVtYmVyKCkgIT0gcFRyYWNrLT5HZXROdW1iZXIoKSkNCisgICAgICAgICAgICBjb250aW51ZTsNCisNCisgICAgICAgIGlmIChwVHJhY2stPlZldEVudHJ5KHBFbnRyeSkpDQorICAgICAgICAgICAgcmV0dXJuIHBFbnRyeTsNCisgICAgfQ0KKw0KKyAgICByZXR1cm4gcFRyYWNrLT5HZXRFT1MoKTsgIC8vbm8gc2F0aXNmYWN0b3J5IGJsb2NrIGZvdW5kDQorfQ0KKw0KKw0KK2NvbnN0IEJsb2NrRW50cnkqDQorQ2x1c3Rlcjo6R2V0RW50cnkoDQorICAgIGNvbnN0IEN1ZVBvaW50JiBjcCwNCisgICAgY29uc3QgQ3VlUG9pbnQ6OlRyYWNrUG9zaXRpb24mIHRwKQ0KK3sNCisgICAgYXNzZXJ0KG1fcFNlZ21lbnQpOw0KKw0KKyAgICBMb2FkQmxvY2tFbnRyaWVzKCk7DQorDQorICAgIGlmIChtX2VudHJpZXMgPT0gTlVMTCkNCisgICAgICAgIHJldHVybiBOVUxMOw0KKw0KKyAgICBjb25zdCBsb25nIGxvbmcgY291bnQgPSBtX2VudHJpZXNDb3VudDsNCisNCisgICAgaWYgKGNvdW50IDw9IDApDQorICAgICAgICByZXR1cm4gTlVMTDsNCisNCisgICAgY29uc3QgbG9uZyBsb25nIHRjID0gY3AuR2V0VGltZUNvZGUoKTsNCisNCisgICAgaWYgKCh0cC5tX2Jsb2NrID4gMCkgJiYgKHRwLm1fYmxvY2sgPD0gY291bnQpKQ0KKyAgICB7DQorICAgICAgICBjb25zdCBzaXplX3QgYmxvY2sgPSBzdGF0aWNfY2FzdDxzaXplX3Q+KHRwLm1fYmxvY2spOw0KKyAgICAgICAgY29uc3Qgc2l6ZV90IGluZGV4ID0gYmxvY2sgLSAxOw0KKw0KKyAgICAgICAgY29uc3QgQmxvY2tFbnRyeSogY29uc3QgcEVudHJ5ID0gbV9lbnRyaWVzW2luZGV4XTsNCisgICAgICAgIGFzc2VydChwRW50cnkpOw0KKyAgICAgICAgYXNzZXJ0KCFwRW50cnktPkVPUygpKTsNCisNCisgICAgICAgIGNvbnN0IEJsb2NrKiBjb25zdCBwQmxvY2sgPSBwRW50cnktPkdldEJsb2NrKCk7DQorICAgICAgICBhc3NlcnQocEJsb2NrKTsNCisNCisgICAgICAgIGlmICgocEJsb2NrLT5HZXRUcmFja051bWJlcigpID09IHRwLm1fdHJhY2spICYmDQorICAgICAgICAgICAgKHBCbG9jay0+R2V0VGltZUNvZGUodGhpcykgPT0gdGMpKQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIHJldHVybiBwRW50cnk7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgY29uc3QgQmxvY2tFbnRyeSogY29uc3QqIGkgPSBtX2VudHJpZXM7DQorICAgIGNvbnN0IEJsb2NrRW50cnkqIGNvbnN0KiBjb25zdCBqID0gaSArIGNvdW50Ow0KKw0KKyAgICB3aGlsZSAoaSAhPSBqKQ0KKyAgICB7DQorICAgICAgICBjb25zdCBCbG9ja0VudHJ5KiBjb25zdCBwRW50cnkgPSAqaSsrOw0KKyAgICAgICAgYXNzZXJ0KHBFbnRyeSk7DQorICAgICAgICBhc3NlcnQoIXBFbnRyeS0+RU9TKCkpOw0KKw0KKyAgICAgICAgY29uc3QgQmxvY2sqIGNvbnN0IHBCbG9jayA9IHBFbnRyeS0+R2V0QmxvY2soKTsNCisgICAgICAgIGFzc2VydChwQmxvY2spOw0KKw0KKyAgICAgICAgaWYgKHBCbG9jay0+R2V0VHJhY2tOdW1iZXIoKSAhPSB0cC5tX3RyYWNrKQ0KKyAgICAgICAgICAgIGNvbnRpbnVlOw0KKw0KKyAgICAgICAgY29uc3QgbG9uZyBsb25nIHRjXyA9IHBCbG9jay0+R2V0VGltZUNvZGUodGhpcyk7DQorDQorICAgICAgICBpZiAodGNfIDwgdGMpDQorICAgICAgICAgICAgY29udGludWU7DQorDQorICAgICAgICBpZiAodGNfID4gdGMpDQorICAgICAgICAgICAgcmV0dXJuIE5VTEw7DQorDQorICAgICAgICBjb25zdCBUcmFja3MqIGNvbnN0IHBUcmFja3MgPSBtX3BTZWdtZW50LT5HZXRUcmFja3MoKTsNCisgICAgICAgIGFzc2VydChwVHJhY2tzKTsNCisNCisgICAgICAgIGNvbnN0IGxvbmcgdG4gPSBzdGF0aWNfY2FzdDxsb25nPih0cC5tX3RyYWNrKTsNCisgICAgICAgIGNvbnN0IFRyYWNrKiBjb25zdCBwVHJhY2sgPSBwVHJhY2tzLT5HZXRUcmFja0J5TnVtYmVyKHRuKTsNCisNCisgICAgICAgIGlmIChwVHJhY2sgPT0gTlVMTCkNCisgICAgICAgICAgICByZX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Y2soKTsNCisgICAgICAgIGFzc2VydChwQmxvY2spOw0KKw0KKyAgICAgICAgaWYgKHBCbG9jay0+R2V0VHJhY2tOdW1iZXIoKSAhPSBwVHJhY2stPkdldE51bWJlcigpKQ0KKyAgICAgICAgICAgIGNvbnRpbnVlOw0KKw0KKyAgICAgICAgaWYgKHBCbG9jay0+SXNLZXkoKSkNCisgICAgICAgICAgICByZXR1cm4gcEVudHJ5Ow0KKyAgICB9DQorDQorICAgIHJldHVybiBwVHJhY2stPkdldEVPUygpOyAgLy9ubyBzYXRpc2ZhY3RvcnkgYmxvY2sgZm91bmQNCit9DQorDQorDQorDQorQmxvY2tFbnRyeTo6QmxvY2tFbnRyeSgpDQorew0KK30NCisNCisNCitCbG9ja0VudHJ5Ojp+QmxvY2tFbnRyeSgpDQorew0KK30NCisNCisNCitTaW1wbGVCbG9jazo6U2ltcGxlQmxvY2soDQorICAgIENsdXN0ZXIqIHBDbHVzdGVyLA0KKyAgICBzaXplX3QgaWR4LA0KKyAgICBsb25nIGxvbmcgc3RhcnQsDQorICAgIGxvbmcgbG9uZyBzaXplKSA6DQorICAgIG1fcENsdXN0ZXIocENsdXN0ZXIpLA0KKyAgICBtX2luZGV4KGlkeCksDQorICAgIG1fYmxvY2soc3RhcnQsIHNpemUsIHBDbHVzdGVyLT5tX3BTZWdtZW50LT5tX3BSZWFkZXIpDQorew0KK30NCisNCisNCitib29sIFNpbXBsZUJsb2NrOjpFT1MoKSBjb25zdA0KK3sNCisgICAgcmV0dXJuIGZhbHNlOw0KK30NCisNCisNCitDbHVzdGVyKiBTaW1wbGVCbG9jazo6R2V0Q2x1c3RlcigpIGNvbnN0DQorew0KKyAgICByZXR1cm4gbV9wQ2x1c3RlcjsNCit9DQorDQorDQorc2l6ZV90IFNpbXBsZUJsb2NrOjpHZXRJbmRleCgpIGNvbnN0DQorew0KKyAgICByZXR1cm4gbV9pbmRleDsNCit9DQorDQorDQorY29uc3QgQmxvY2sqIFNpbXBsZUJsb2NrOjpHZ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AgICAgICAgICAgICAgIG1fbmV4dFRpbWVDb2RlID0gdDsNCisgICAgICAgICAgICBlbHNlDQorICAgICAgICAgICAgICAgIGFzc2VydChmYWxzZSk7DQorDQorICAgICAgICAgICAgYlJlZmVyZW5jZUJsb2NrID0gdHJ1ZTsNCisgICAgICAgIH0NCisgICAgICAgIGVsc2UNCisgICAgICAgIHsNCisgICAgICAgICAgICBsb25nIGxlbjsNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgaWQgPSBSZWFkVUludChwUmVhZGVyLCBwb3MsIGxlbik7DQorICAgICAgICAgICAgYXNzZXJ0KGlkID49IDApOyAgLy9UT0RPDQorICAgICAgICAgICAgYXNzZXJ0KChwb3MgKyBsZW4pIDw9IHN0b3ApOw0KKw0KKyAgICAgICAgICAgIHBvcyArPSBsZW47ICAvL2NvbnN1bWUgSUQNCisNCisgICAgICAgICAgICBjb25zdCBsb25nIGxvbmcgc2l6ZSA9IFJlYWRVSW50KHBSZWFkZXIsIHBvcywgbGVuKTsNCisgICAgICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTsgIC8vVE9ETw0KKyAgICAgICAgICAgIGFzc2VydCgocG9zICsgbGVuKSA8PSBzdG9wKTsNCisNCisgICAgICAgICAgICBwb3MgKz0gbGVuOyAgLy9jb25zdW1lIHNpemUNCisNCisgICAgICAgICAgICBzd2l0Y2ggKGlkKQ0KKyAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgY2FzZSAweDIzOiAgLy9TaW1wbGVCbG9jayBJRA0KKyAgICAgICAgICAgICAgICAgICAgYlNpbXBsZUJsb2NrID0gdHJ1ZTsNCisgICAgICAgICAgICAgICAgICAgIC8vWUVTLCBGQUxMIFRIUk9VR0ggVE8gTkVYVCBDQVNFDQorDQorICAgICAgICAgICAgICAgIGNhc2UgMHgyMTogIC8vQmxvY2sgSUQNCisgICAgICAgICAgICAgICAgICAgIFBhcnNlQmxvY2socG9zLCBzaXplKTsNCisgICAgICAgICAgICAgICAgICA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oZSByZWZlcmVuY2VkIGJsb2NrDQorDQorICAgICAgICB2b2lkIFBhcnNlKElNa3ZSZWFkZXIqLCBsb25nIGxvbmcsIGxvbmcgbG9uZyk7DQorICAgIH07DQorDQorICAgIGNvbnN0IFRyYWNrUG9zaXRpb24qIEZpbmQoY29uc3QgVHJhY2sqKSBjb25zdDsNCisNCitwcml2YXRlOg0KKyAgICBjb25zdCBzaXplX3QgbV9pbmRleDsNCisgICAgbG9uZyBsb25nIG1fdGltZWNvZGU7DQorICAgIFRyYWNrUG9zaXRpb24qIG1fdHJhY2tfcG9zaXRpb25zOw0KKyAgICBzaXplX3QgbV90cmFja19wb3NpdGlvbnNfY291bnQ7DQorDQorfTsNCisNCisNCitjbGFzcyBDdWVzDQorew0KKyAgICBmcmllbmQgY2xhc3MgU2VnbWVudDsNCisNCisgICAgQ3VlcyhTZWdtZW50KiwgbG9uZyBsb25nIHN0YXJ0LCBsb25nIGxvbmcgc2l6ZSk7DQorICAgIH5DdWVzKCk7DQorDQorICAgIEN1ZXMoY29uc3QgQ3VlcyYpOw0KKyAgICBDdWVzJiBvcGVyYXRvcj0oY29uc3QgQ3VlcyYpOw0KKw0KK3B1YmxpYzoNCisgICAgU2VnbWVudCogY29uc3QgbV9wU2VnbWVudDsNCisgICAgY29uc3QgbG9uZyBsb25nIG1fc3RhcnQ7DQorICAgIGNvbnN0IGxvbmcgbG9uZyBtX3NpemU7DQorDQorICAgIGJvb2wgRmluZCggIC8vbG93ZXIgYm91bmQgb2YgdGltZV9ucw0KKyAgICAgICAgbG9uZyBsb25nIHRpbWVfbnMsDQorICAgICAgICBjb25zdCBUcmFjayosDQorICAgICAgICBjb25zdCBDdWVQb2ludComLA0KKyAgICAgICAgY29uc3QgQ3VlUG9pbnQ6OlRyYWNrUG9zaXRpb24qJikgY29uc3Q7DQorDQorI2lmIDANCisgICAgYm9vbCBGaW5kTmV4dCggIC8vdXBwZXJfYm91bmQgb2YgdGltZV9ucw0KKyAgICAgICAgbG9uZyBs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HNlKSB7CisgICAgfQorCiAgICAgdm9pZCBDb3B5RnJvbU9NWChjb25zdCBPTVhfQlVGRkVSSEVBREVSVFlQRSAqaGVhZGVyKSB7CiAgICAgICAgIGlmICghbUlzQmFja3VwKSB7CiAgICAgICAgICAgICByZXR1cm47CkBAIC02MSw2ICs2Nyw3IEBACiAgICAgfQogCiBwcml2YXRlOgorICAgIHNwPEdyYXBoaWNCdWZmZXI+IG1HcmFwaGljQnVmZmVyOwogICAgIHNwPElNZW1vcnk+IG1NZW07CiAgICAgc2l6ZV90IG1TaXplOwogICAgIGJvb2wgbUlzQmFja3VwOwpAQCAtMjQwLDYgKzI0Nyw3NCBAQAogICAgIHJldHVybiBTdGF0dXNGcm9tT01YRXJyb3IoZXJyKTsKIH0KIAorc3RhdHVzX3QgT01YTm9kZUluc3RhbmNlOjplbmFibGVHcmFwaGljQnVmZmVycygKKyAgICAgICAgT01YX1UzMiBwb3J0SW5kZXgsIE9NWF9CT09MIGVuYWJsZSkgeworICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7CisKKyAgICBPTVhfSU5ERVhUWVBFIGluZGV4OworICAgIE9NWF9FUlJPUlRZUEUgZXJyID0gT01YX0dldEV4dGVuc2lvbkluZGV4KAorICAgICAgICAgICAgbUhhbmRsZSwKKyAgICAgICAgICAgIGNvbnN0X2Nhc3Q8T01YX1NUUklORz4oIk9NWC5nb29nbGUuYW5kcm9pZC5pbmRleC5lbmFibGVBbmRyb2lkTmF0aXZlQnVmZmVycyIpLAorICAgICAgICAgICAgJmluZGV4KTsKKworICAgIGlmIChlcnIgIT0gT01YX0Vycm9yTm9uZSkgeworICAgICAgICBMT0dFKCJPTVhfR2V0RXh0ZW5zaW9uSW5kZXggZmFpbGVkIik7CisKKyAgICAgICAgcmV0dXJuIFN0YXR1c0Zyb21PTVhFcnJvcihlcnIpOworICAgIH0KKworICAgIE9NWF9WRVJTSU9OVFlQRSB2ZXI7CisgICAgdmVyLnMublZlcnNpb25N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AgICAgICB9CisKKyAgICAgICAgY29uc3QgY2hhciAqY29sb25Qb3MgPSBzdHJjaHIocywgJzsnKTsKKworICAgICAgICBzaXplX3QgbGVuID0KKyAgICAgICAgICAgIChjb2xvblBvcyA9PSBOVUxMKSA/IHN0cmxlbihzKSA6IGNvbG9uUG9zIC0gczsKKworICAgICAgICBpZiAobGVuID49IGtleUxlbiArIDEgJiYgc1trZXlMZW5dID09ICc9JyAmJiAhc3RybmNtcChzLCBrZXksIGtleUxlbikpIHsKKyAgICAgICAgICAgIHZhbHVlLT5zZXRUbygmc1trZXlMZW4gKyAxXSwgbGVuIC0ga2V5TGVuIC0gMSk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChjb2xvblBvcyA9PSBOVUxMKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBzID0gY29sb25Qb3MgKyAxOworICAgIH0KK30KKworc3RhdGljIHNwPEFCdWZmZXI+IGRlY29kZUhleChjb25zdCBBU3RyaW5nICZzKSB7CisgICAgaWYgKChzLnNpemUoKSAlIDIpICE9IDApIHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgc2l6ZV90IG91dExlbiA9IHMuc2l6ZSgpIC8gMjsKKyAgICBzcDxBQnVmZmVyPiBidWZmZXIgPSBuZXcgQUJ1ZmZlcihvdXRMZW4pOworICAgIHVpbnQ4X3QgKm91dCA9IGJ1ZmZlci0+ZGF0YSgpOworCisgICAgdWludDhfdCBhY2N1bSA9IDA7CisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBzLnNpemUoKTsgKytpKSB7CisgICAgICAgIGNoYXIgYyA9IHMuY19zdHIoKVtpXTsKKyAgICAgICAgdW5zaWduZWQgdmFsdWU7CisgICAgICAgIGlmIChjID49ICcwJyAmJiBjIDw9ICc5JykgeworICAgICAgICAgICAgdmFsdWUgPSBjIC0gJzAnOworICAgICAgICB9IGVsc2UgaWYgKGMgPj0gJ2EnICYmIGMgPD0gJ2YnKSB7CisgICAgICAgICAgICB2YWx1ZSA9IGMgLSAnYScgKyAxMDsKKyAgICAgICAgfSBlbHNlIGlmIChjID49ICdBJyAmJiBjIDw9ICdGJykgeworICAgICAgICAgICAgdmFsdWUgPSBjIC0gJ0EnICsgMTA7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgfQorCisgICAgICAgIGFjY3VtID0gKGFjY3VtIDw8IDQpIHwgdmFsdWU7CisKKyAgICAgICAgaWYgKGkgJiAxKSB7CisgICAgICAgICAgICAqb3V0KysgPSBhY2N1bTsKKworICAgICAgICAgICAgYWNjdW0gPSAwOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGJ1ZmZlcjsKK30KKworc3RhdGljIHN0YXR1c190IHBhcnNlQXVkaW9PYmplY3RUeXBlKAorICAgICAgICBBQml0UmVhZGVyICpiaXRzLCB1bnNpZ25lZCAqYXVkaW9PYmplY3RUeXBlKSB7CisgICAgKmF1ZGlvT2JqZWN0VHlwZSA9IGJpdHMtPmdldEJpdHMoNSk7CisgICAgaWYgKCgqYXVkaW9PYmplY3RUeXBlKSA9PSAzMSkgeworICAgICAgICAqYXVkaW9PYmplY3RUeXBlID0gMzIgKyBiaXRzLT5nZXRCaXRzKDYpOworICAgIH0KKworICAgIHJldHVybiBPSzsKK30KKworc3RhdGljIHN0YXR1c190IHBhcnNlR0FTcGVjaWZpY0NvbmZpZygKKyAgICAgICAgQUJpdFJlYWRlciAqYml0cywKKyAgICAgICAgdW5zaWduZWQgYXVkaW9PYmplY3RUeXBlLCB1bnNpZ25lZCBjaGFubmVsQ29uZmlndXJhdGlvbikgeworICAgIHVuc2lnbmVkIGZyYW1lTGVuZ3RoRmxhZyA9IGJpdHMtPmdldEJpdHMoMSk7CisgICAgdW5zaWduZWQgZGVwZW5kc09uQ29yZUNvZGVyID0gYml0cy0+Z2V0Q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gICAgICAgICAgIC8vIEVycm9yUHJvdGVjdGlvblNwZWNpZmljQ29uZmlnCisgICAgICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7ICAvLyBYWFggdG8gYmUgaW1wbGVtZW50ZWQKKworICAgICAgICAgICAgaWYgKGVwQ29uZmlnID09IDMpIHsKKyAgICAgICAgICAgICAgICB1bnNpZ25lZCBkaXJlY3RNYXBwaW5nID0gYml0cy0+Z2V0Qml0cygxKTsKKyAgICAgICAgICAgICAgICBDSEVDS19FUShkaXJlY3RNYXBwaW5nLCAxdSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyNpZiAwCisgICAgLy8gVGhpcyBpcyBub3Qgc3VwcG9ydGVkIGhlcmUgYXMgdGhlIHVwcGVyIGxheWVycyBkaWQgbm90IGV4cGxpY2l0bHkKKyAgICAvLyBzaWduYWwgdGhlIGxlbmd0aCBvZiBBdWRpb1NwZWNpZmljQ29uZmlnLgorCisgICAgaWYgKGV4dGVuc2lvbkF1ZGlvT2JqZWN0VHlwZSAhPSA1ICYmIGJpdHMtPm51bUJpdHNMZWZ0KCkgPj0gMTYpIHsKKyAgICAgICAgdW5zaWduZWQgc3luY0V4dGVuc2lvblR5cGUgPSBiaXRzLT5nZXRCaXRzKDExKTsKKyAgICAgICAgaWYgKHN5bmNFeHRlbnNpb25UeXBlID09IDB4MmI3KSB7CisgICAgICAgICAgICBDSEVDS19FUShwYXJzZUF1ZGlvT2JqZWN0VHlwZShiaXRzLCAmZXh0ZW5zaW9uQXVkaW9PYmplY3RUeXBlKSwKKyAgICAgICAgICAgICAgICAgICAgIChzdGF0dXNfdClPSyk7CisKKyAgICAgICAgICAgIHNiclByZXNlbnQgPSBiaXRzLT5nZXRCaXRzKDEpOworCisgICAgICAgICAgICBpZiAoc2JyUHJlc2VudCA9PSAxKSB7CisgICAgICAgICAgICAgICAgdW5zaWduZWQgZXh0ZW5zaW9uU2FtcGxpbmdGcmVxSW5kZXggPSBiaXRzLT5nZXRCaXRzKDQpOworICAgICAgICAgICAgICAgIGlmIChleHRlbnNpb25TYW1wbGluZ0ZyZXFJbmRleCA9PSAweDBmKSB7CisgICAgICAgICAgICAgICAgICAgIC8qIHVuc2lnbmVkIGV4dGVuc2lvblNhbXBsaW5nRnJlcXVlbmN5ID0gKi9iaXRzLT5nZXRCaXRzKDI0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisjZW5kaWYKKworICAgIHJldHVybiBPSzsKK30KKworc3RhdGljIHN0YXR1c190IHBhcnNlU3RyZWFtTXV4Q29uZmlnKAorICAgICAgICBBQml0UmVhZGVyICpiaXRzLAorICAgICAgICB1bnNpZ25lZCAqbnVtU3ViRnJhbWVzLAorICAgICAgICB1bnNpZ25lZCAqZnJhbWVMZW5ndGhUeXBlLAorICAgICAgICBib29sICpvdGhlckRhdGFQcmVzZW50LAorICAgICAgICB1bnNpZ25lZCAqb3RoZXJEYXRhTGVuQml0cykgeworICAgIHVuc2lnbmVkIGF1ZGlvTXV4VmVyc2lvbiA9IGJpdHMtPmdldEJpdHMoMSk7CisKKyAgICB1bnNpZ25lZCBhdWRpb011eFZlcnNpb25BID0gMDsKKyAgICBpZiAoYXVkaW9NdXhWZXJzaW9uID09IDEpIHsKKyAgICAgICAgYXVkaW9NdXhWZXJzaW9uQSA9IGJpdHMtPmdldEJpdHMoMSk7CisgICAgfQorCisgICAgQ0hFQ0tfRVEoYXVkaW9NdXhWZXJzaW9uQSwgMHUpOyAgLy8gb3RoZXJ3aXNlIGZ1dHVyZSBzcGVjCisKKyAgICBpZiAoYXVkaW9NdXhWZXJzaW9uICE9IDApIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX1VOU1VQUE9SVEVEOyAgLy8gWFhYIHRvIGJlIGltcGxlbWVudGVkOworICAgIH0KKyAgICBDSEVDS19FUShhdWRpb011eFZlcnNpb24sIDB1KTsgIC8vIFhYWCB0byBiZSBpbXBsZW1lbn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b25seQorICAgICAgICAgICAgLy8gYSBzaW5nbGUgbGF5ZXIuCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgMToKKyAgICAgICAgeworICAgICAgICAgICAgLyogdW5zaWduZWQgZnJhbWVMZW5ndGggPSAqL2JpdHMtPmdldEJpdHMoOSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgMzoKKyAgICAgICAgY2FzZSA0OgorICAgICAgICBjYXNlIDU6CisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHVuc2lnbmVkIENFTFBmcmFtZUxlbmd0aFRhYmxlSW5kZXggPSAqL2JpdHMtPmdldEJpdHMoNik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgNjoKKyAgICAgICAgY2FzZSA3OgorICAgICAgICB7CisgICAgICAgICAgICAvKiB1bnNpZ25lZCBIVlhDZnJhbWVMZW5ndGhUYWJsZUluZGV4ID0gKi9iaXRzLT5nZXRCaXRzKDEpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgKm90aGVyRGF0YVByZXNlbnQgPSBiaXRzLT5nZXRCaXRzKDEpOworICAgICpvdGhlckRhdGFMZW5CaXRzID0gMDsKKyAgICBpZiAoKm90aGVyRGF0YVByZXNlbnQpIHsKKyAgICAgICAgaWYgKGF1ZGlvTXV4VmVyc2lvbiA9PSAxKSB7CisgICAgICAgICAgICBUUkVTUEFTUygpOyAgLy8gWFhYIHRvIGJlIGltcGxlbWVudGVkCisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAqb3RoZXJEYXRhTGVuQml0cyA9IDA7CisKKyAgICAgICAgICAgIHVuc2lnbmVkIG90aGVyRGF0YUxlbkVzYzsKKyAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICAoKm90aGVyR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zd2l0Y2ggKG1GcmFtZUxlbmd0aFR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB1bnNpZ25lZCBtdXhTbG90TGVuZ3RoQnl0ZXMgPSAwOworICAgICAgICAgICAgICAgIHVuc2lnbmVkIHRtcDsKKyAgICAgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgICAgIENIRUNLX0xUKG9mZnNldCwgYnVmZmVyLT5zaXplKCkpOworICAgICAgICAgICAgICAgICAgICB0bXAgPSBwdHJbb2Zmc2V0KytdOworICAgICAgICAgICAgICAgICAgICBtdXhTbG90TGVuZ3RoQnl0ZXMgKz0gdG1wOworICAgICAgICAgICAgICAgIH0gd2hpbGUgKHRtcCA9PSAweGZmKTsKKworICAgICAgICAgICAgICAgIHBheWxvYWRMZW5ndGggPSBtdXhTbG90TGVuZ3RoQnl0ZXM7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgVFJFU1BBU1MoKTsgIC8vIFhYWCB0byBiZSBpbXBsZW1lbnRlZAorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgQ0hFQ0tfTEUob2Zmc2V0ICsgcGF5bG9hZExlbmd0aCwgYnVmZmVyLT5zaXplKCkpOworCisgICAgICAgIG1lbWNweShvdXQtPmRhdGEoKSArIG91dC0+c2l6ZSgpLCAmcHRyW29mZnNldF0sIHBheWxvYWRMZW5ndGgpOworICAgICAgICBvdXQtPnNldFJhbmdlKDAsIG91dC0+c2l6ZSgpICsgcGF5bG9hZExlbmd0aCk7CisKKyAgICAgICAgb2Zmc2V0ICs9IHBheWxvYWRMZW5ndGg7CisKKyAgICAgICAgaWYgKG1PdGhlckRhdGFQcmVzZW50KSB7CisgICAgICAgICAgICAvLyBXZSB3YW50IHRvIHN0YXkgYnl0ZS1hbGlnbmVkLgorCisgICAgICAgICAgICBDSEVDSygobU90aGVyRGF0YUxlbkJpdHMgJSA4KSA9PSAwKTsKKyAgICAgICAgICAgIENIRUNLX0xFKG9mZnNldCArIChtT3RoZXJEYXRhTGVuQml0cyAvIDgpLCBidWZmZXItPnNpemUoKSk7CisgICAgICAgICAgICBvZmZzZXQgKz0gbU90aGVyRGF0YUxlbkJpdHMgLyA4OworICAgICAgICB9CisgICAgfQorCisgICAgQ0hFQ0tfRVEob2Zmc2V0LCBidWZmZXItPnNpemUoKSk7CisKKyAgICByZXR1cm4gb3V0OworfQorCitBTVBFRzRBdWRpb0Fzc2VtYmxlcjo6QU1QRUc0QXVkaW9Bc3NlbWJsZXIoCisgICAgICAgIGNvbnN0IHNwPEFNZXNzYWdlPiAmbm90aWZ5LCBjb25zdCBBU3RyaW5nICZwYXJhbXMpCiAgICAgOiBtTm90aWZ5TXNnKG5vdGlmeSksCisgICAgICBtTXV4Q29uZmlnUHJlc2VudChmYWxzZSksCiAgICAgICBtQWNjZXNzVW5pdFJUUFRpbWUoMCksCiAgICAgICBtTmV4dEV4cGVjdGVkU2VxTm9WYWxpZChmYWxzZSksCiAgICAgICBtTmV4dEV4cGVjdGVkU2VxTm8oMCksCiAgICAgICBtQWNjZXNzVW5pdERhbWFnZWQoZmFsc2UpIHsKKyAgICBBU3RyaW5nIHZhbDsKKyAgICBpZiAoIUdldEF0dHJpYnV0ZShwYXJhbXMuY19zdHIoKSwgImNwcmVzZW50IiwgJnZhbCkpIHsKKyAgICAgICAgbU11eENvbmZpZ1ByZXNlbnQgPSB0cnVlOworICAgIH0gZWxzZSBpZiAodmFsID09ICIwIikgeworICAgICAgICBtTXV4Q29uZmlnUHJlc2VudCA9IGZhbHNlOworICAgIH0gZWxzZSB7CisgICAgICAgIENIRUNLKHZhbCA9PSAiMSIpOworICAgICAgICBtTXV4Q29uZmlnUHJlc2VudCA9IHRydWU7CisgICAgfQorCisgICAgQ0hFQ0soR2V0QXR0cmlidXRlKHBhcmFtcy5jX3N0cigpLCAiY29uZmlnIiwgJnZhbCkpOworCisgICAgc3A8QUJ1ZmZlcj4gY29uZmlnID0gZGVjb2RlSGV4KHZhbCk7CisgICAgQ0hFQ0soY29uZmlnICE9IE5VTEwpOworCisgICAgQUJpdFJlYWRlciBiaXRzKGNvbmZpZy0+ZGF0YSgpLCBjb25maWctPnNpemUoKSk7CisgICAgc3RhdHVzX3QgZXJyID0gcGFyc2VTdHJlYW1NdXhDb25maWcoCisgICAgICAgICAgICAmYml0cywgJm1OdW1TdWJGcmFtZXMsICZtRnJhbWVMZW5ndGhUeXBlLAorICAgICAgICAgICAgJm1PdGhlckRhdGFQcmVzZW50LCAmbU90aGVyRGF0YUxlbkJpdHMpOworCisgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpTk9fRVJST1IpOwogfQogCiBBTVBFRzRBdWRpb0Fzc2VtYmxlcjo6fkFNUEVHNEF1ZGlvQXNzZW1ibGVyKCkgewpAQCAtMTA4LDEzICs0NzEsNyBAQAogICAgIHdoaWxlIChpdCAhPSBtUGFja2V0cy5lbmQoKSkgewogICAgICAgICBjb25zdCBzcDxBQnVmZmVyPiAmdW5pdCA9ICppdDsKIAotICAgICAgICBzaXplX3QgbiA9IDA7Ci0gICAgICAgIHdoaWxlICh1bml0LT5kYXRhKClbbl0gPT0gMHhmZikgewotICAgICAgICAgICAgKytuOwotICAgICAgICB9Ci0gICAgICAgICsrbjsKLQotICAgICAgICB0b3RhbFNpemUgKz0gdW5pdC0+c2l6ZSgpIC0gbjsKKyAgICAgICAgdG90YWxTaXplICs9IHVuaXQtPnNpemUoKTsKICAgICAgICAgKytpdDsKICAgICB9CiAKQEAgLTEyNCwyMCArNDgxLDEzIEBACiAgICAgd2hpbGUgKGl0ICE9IG1QYWNrZXRzLmVuZCgpKSB7CiAgICAgICAgIGNvbnN0IHNwPEFCdWZmZXI+ICZ1bml0ID0gKml0OwogCi0gICAgICAgIHNpemVfdCBuID0gMDsKLSAgICAgICAgd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VN0cmluZyAqcGF0aCwKKyAgICAgICAgQVN0cmluZyAqdXNlciwgQVN0cmluZyAqcGFzcykgewogICAgIGhvc3QtPmNsZWFyKCk7CiAgICAgKnBvcnQgPSAwOwogICAgIHBhdGgtPmNsZWFyKCk7CisgICAgdXNlci0+Y2xlYXIoKTsKKyAgICBwYXNzLT5jbGVhcigpOwogCiAgICAgaWYgKHN0cm5jYXNlY21wKCJydHNwOi8vIiwgdXJsLCA3KSkgewogICAgICAgICByZXR1cm4gZmFsc2U7CkBAIC0xMzMsNiArMTM5LDI0IEBACiAgICAgICAgIHBhdGgtPnNldFRvKHNsYXNoUG9zKTsKICAgICB9CiAKKyAgICBzc2l6ZV90IGF0UG9zID0gaG9zdC0+ZmluZCgiQCIpOworCisgICAgaWYgKGF0UG9zID49IDApIHsKKyAgICAgICAgLy8gU3BsaXQgb2YgdXNlcjpwYXNzQCBmcm9tIGhvc3RuYW1lLgorCisgICAgICAgIEFTdHJpbmcgdXNlclBhc3MoKmhvc3QsIDAsIGF0UG9zKTsKKyAgICAgICAgaG9zdC0+ZXJhc2UoMCwgYXRQb3MgKyAxKTsKKworICAgICAgICBzc2l6ZV90IGNvbG9uUG9zID0gdXNlclBhc3MuZmluZCgiOiIpOworCisgICAgICAgIGlmIChjb2xvblBvcyA8IDApIHsKKyAgICAgICAgICAgICp1c2VyID0gdXNlclBhc3M7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB1c2VyLT5zZXRUbyh1c2VyUGFzcywgMCwgY29sb25Qb3MpOworICAgICAgICAgICAgcGFzcy0+c2V0VG8odXNlclBhc3MsIGNvbG9uUG9zICsgMSwgdXNlclBhc3Muc2l6ZSgpIC0gY29sb25Qb3MgLSAxKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIGNvbnN0IGNoYXIgKmNvbG9uUG9zID0gc3RyY2hyKGhvc3QtPmNfc3RyKCksICc6Jyk7CiAKICAgICBpZiAoY29sb25Qb3MgIT0gTlVMTCkgewpAQCAtMT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Bmb3IgKHNpemVfdCBpID0gMDsgaSA8IDE2OyArK2kpIHsKKyAgICAgICAgY2hhciBuaWJibGUgPSBrZXlbaV0gPj4gNDsKKyAgICAgICAgaWYgKG5pYmJsZSA8PSA5KSB7CisgICAgICAgICAgICBuaWJibGUgKz0gJzAnOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbmliYmxlICs9ICdhJyAtIDEwOworICAgICAgICB9CisgICAgICAgIG91dC0+YXBwZW5kKCZuaWJibGUsIDEpOworCisgICAgICAgIG5pYmJsZSA9IGtleVtpXSAmIDB4MGY7CisgICAgICAgIGlmIChuaWJibGUgPD0gOSkgeworICAgICAgICAgICAgbmliYmxlICs9ICcwJzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG5pYmJsZSArPSAnYScgLSAxMDsKKyAgICAgICAgfQorICAgICAgICBvdXQtPmFwcGVuZCgmbmliYmxlLCAxKTsKKyAgICB9Cit9CisjZW5kaWYKKworc3RhdGljIHZvaWQgR2V0TWV0aG9kQW5kVVJMKAorICAgICAgICBjb25zdCBBU3RyaW5nICZyZXF1ZXN0LCBBU3RyaW5nICptZXRob2QsIEFTdHJpbmcgKnVybCkgeworICAgIHNzaXplX3Qgc3BhY2UxID0gcmVxdWVzdC5maW5kKCIgIik7CisgICAgQ0hFQ0tfR0Uoc3BhY2UxLCAwKTsKKworICAgIHNzaXplX3Qgc3BhY2UyID0gcmVxdWVzdC5maW5kKCIgIiwgc3BhY2UxICsgMSk7CisgICAgQ0hFQ0tfR0Uoc3BhY2UyLCAwKTsKKworICAgIG1ldGhvZC0+c2V0VG8ocmVxdWVzdCwgMCwgc3BhY2UxKTsKKyAgICB1cmwtPnNldFRvKHJlcXVlc3QsIHNwYWNlMSArIDEsIHNwYWNlMiAtIHNwYWNlMSk7Cit9CisKK3ZvaWQgQVJUU1BDb25uZWN0aW9uOjphZGRBdXRoZW50aWNhdGlvbihBU3RyaW5nICpyZXF1ZXN0KSB7CisgICAgaWYgKG1BdXRoVHlwZSA9PSBOT05FKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBGaW5kIHRoZSBib3VuZGFyeSBiZXR3ZWVuIGhlYWRlcnMgYW5kIHRoZSBib2R5LgorICAgIHNzaXplX3QgaSA9IHJlcXVlc3QtPmZpbmQoIlxyXG5cclxuIik7CisgICAgQ0hFQ0tfR0UoaSwgMCk7CisKKyAgICBpZiAobUF1dGhUeXBlID09IEJBU0lDKSB7CisgICAgICAgIEFTdHJpbmcgdG1wOworICAgICAgICB0bXAuYXBwZW5kKG1Vc2VyKTsKKyAgICAgICAgdG1wLmFwcGVuZCgiOiIpOworICAgICAgICB0bXAuYXBwZW5kKG1QYXNzKTsKKworICAgICAgICBBU3RyaW5nIG91dDsKKyAgICAgICAgZW5jb2RlQmFzZTY0KHRtcC5jX3N0cigpLCB0bXAuc2l6ZSgpLCAmb3V0KTsKKworICAgICAgICBBU3RyaW5nIGZyYWdtZW50OworICAgICAgICBmcmFnbWVudC5hcHBlbmQoIkF1dGhvcml6YXRpb246IEJhc2ljICIpOworICAgICAgICBmcmFnbWVudC5hcHBlbmQob3V0KTsKKyAgICAgICAgZnJhZ21lbnQuYXBwZW5kKCJcclxuIik7CisKKyAgICAgICAgcmVxdWVzdC0+aW5zZXJ0KGZyYWdtZW50LCBpICsgMik7CisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworI2lmIGRlZmluZWQoSEFWRV9BTkRST0lEX09TKQorICAgIENIRUNLX0VRKChpbnQpbUF1dGhUeXBlLCAoaW50KURJR0VTVCk7CisKKyAgICBBU3RyaW5nIG1ldGhvZCwgdXJsOworICAgIEdldE1ldGhvZEFuZFVSTCgqcmVxdWVzdCwgJm1ldGhvZCwgJnVybCk7CisKKyAgICBBU3RyaW5nIEExOworICAgIEExLmFwcGVuZChtVXNlcik7CisgICAgQTEuYXBwZW5kKCI6Iik7CisgICAgQTEuYXBwZW5kKCJTdHJlYW1pbmcgU2VydmVyIik7CisgICAgQTEuYXBwZW5kKCI6Iik7CisgICAgQTEuYXBwZW5kKG1QYXNzKTsKKworICAgIEFTdHJpbmcgQTI7CisgICAgQTIuYXBwZW5kKG1ldGhvZCk7CisgICAgQTIuYXBwZW5kKCI6Iik7CisgICAgQTIuYXBwZW5kKHVybCk7CisKKyAgICBBU3RyaW5nIEhBMSwgSEEyOworICAgIEgoQTEsICZIQTEpOworICAgIEgoQTIsICZIQTIpOworCisgICAgQVN0cmluZyB0bXA7CisgICAgdG1wLmFwcGVuZChIQTEpOworICAgIHRtcC5hcHBlbmQoIjoiKTsKKyAgICB0bXAuYXBwZW5kKG1Ob25jZSk7CisgICAgdG1wLmFwcGVuZCgiOiIpOworICAgIHRtcC5hcHBlbmQoSEEyKTsKKworICAgIEFTdHJpbmcgZGlnZXN0OworICAgIEgodG1wLCAmZGlnZXN0KTsKKworICAgIEFTdHJpbmcgZnJhZ21lbnQ7CisgICAgZnJhZ21lbnQuYXBwZW5kKCJBdXRob3JpemF0aW9uOiBEaWdlc3QgIik7CisgICAgZnJhZ21lbnQuYXBwZW5kKCJub25jZT1cIiIpOworICAgIGZyYWdtZW50LmFwcGVuZChtTm9uY2UpOworICAgIGZyYWdtZW50LmFwcGVuZCgiXCIsICIpOworICAgIGZyYWdtZW50LmFwcGVuZCgidXNlcm5hbWU9XCIiKTsKKyAgICBmcmFnbWVudC5hcHBlbmQobVVzZXIpOworICAgIGZyYWdtZW50LmFwcGVuZCgiXCIsICIpOworICAgIGZyYWdtZW50LmFwcGVuZCgidXJpPVwiIik7CisgICAgZnJhZ21lbnQuYXBwZW5kKHVybCk7CisgICAgZnJhZ21lbnQuYXBwZW5kKCJcIiwgIik7CisgICAgZnJhZ21lbnQuYXBwZW5kKCJyZXNwb25zZT1cIiIpOworICAgIGZyYWdtZW50LmFwcGVuZChkaWdlc3QpOworICAgIGZyYWdtZW50LmFwcGVuZCgiXCIiKTsKKyAgICBmcmFnbWVudC5hcHBlbmQoIlxyXG4iKTsKKworICAgIHJlcXVlc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m4tPmNvbm5lY3QobVNlc3Npb25VUkwuY19zdHIoKSwgcmVwbHkpOworICAgICAgICBtQ29ubi0+Y29ubmVjdChtT3JpZ2luYWxTZXNzaW9uVVJMLmNfc3RyKCksIHJlcGx5KTsKICAgICB9CiAKICAgICB2b2lkIGRpc2Nvbm5lY3QoY29uc3Qgc3A8QU1lc3NhZ2U+ICZkb25lTXNnKSB7CkBAIC0zMTIsNyArMzMwLDcgQEAKICAgICAgICAgICAgICAgICBpbnQzMl90IHJlY29ubmVjdDsKICAgICAgICAgICAgICAgICBpZiAobXNnLT5maW5kSW50MzIoInJlY29ubmVjdCIsICZyZWNvbm5lY3QpICYmIHJlY29ubmVjdCkgewogICAgICAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVwbHkgPSBuZXcgQU1lc3NhZ2UoJ2Nvbm4nLCBpZCgpKTsKLSAgICAgICAgICAgICAgICAgICAgbUNvbm4tPmNvbm5lY3QobVNlc3Npb25VUkwuY19zdHIoKSwgcmVwbHkpOworICAgICAgICAgICAgICAgICAgICBtQ29ubi0+Y29ubmVjdChtT3JpZ2luYWxTZXNzaW9uVVJMLmNfc3RyKCksIHJlcGx5KTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAobmV3IEFNZXNzYWdlKCdxdWl0JywgaWQoKSkpLT5wb3N0KCk7CiAgICAgICAgICAgICAgICAgfQpAQCAtOTIyLDcgKzk0MCw3IEBACiAgICAgICAgIENIRUNLKEdldEF0dHJpYnV0ZShyYW5nZS5jX3N0cigpLCAibnB0IiwgJnZhbCkpOwogICAgICAgICBmbG9hdCBucHQxLCBucHQyOwogCi0gICAgICAgIGlmICh2YWwgPT0gIm5vdy0iKSB7CisgICAgICAgIGlmICh2YWwgPT0gIm5vdy0iIHx8IHZhbCA9PSAiMC0iKSB7CiAgICAgICAgICAgICAvLyBUaGlzIGlzIGEgbGl2ZSBzdHJlYW0gYW5kIHRoZXJlZm9yZSBub3Qgc2Vla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sKKyAgICAgICAgTE9HRSgiRm9ybWF0IG5vdCBzdXBwb3J0ZWQiKTsKKyAgICB9CisgICAgcmV0dXJuIG51bWJlck9mQnl0ZXM7Cit9CisKK2Jvb2wgWVVWSW1hZ2U6OmluaXRpYWxpemVZVVZQb2ludGVycygpIHsKKyAgICBpbnQzMl90IG51bWJlck9mUGl4ZWxzID0gbVdpZHRoICogbUhlaWdodDsKKworICAgIGlmIChtWVVWRm9ybWF0ID09IFlVVjQyMFBsYW5hcikgeworICAgICAgICBtWWRhdGEgPSAodWludDhfdCAqKW1CdWZmZXI7CisgICAgICAgIG1VZGF0YSA9IG1ZZGF0YSArIG51bWJlck9mUGl4ZWxzOworICAgICAgICBtVmRhdGEgPSBtVWRhdGEgKyAobnVtYmVyT2ZQaXhlbHMgPj4gMik7CisgICAgfSBlbHNlIGlmIChtWVVWRm9ybWF0ID09IFlVVjQyMFNlbWlQbGFuYXIpIHsKKyAgICAgICAgLy8gVSBhbmQgViBjaGFubmVscyBhcmUgaW50ZXJsZWF2ZWQgYXMgVlVWVVZVLgorICAgICAgICAvLyBTbyBWIGRhdGEgc3RhcnRzIGF0IHRoZSBlbmQgb2YgWSBjaGFubmVsIGFuZAorICAgICAgICAvLyBVIGRhdGEgc3RhcnRzIHJpZ2h0IGFmdGVyIFYncyBzdGFydC4KKyAgICAgICAgbVlkYXRhID0gKHVpbnQ4X3QgKiltQnVmZmVyOworICAgICAgICBtVmRhdGEgPSBtWWRhdGEgKyBudW1iZXJPZlBpeGVsczsKKyAgICAgICAgbVVkYXRhID0gbVZkYXRhICsgMTsKKyAgICB9IGVsc2UgeworICAgICAgICBMT0dFKCJGb3JtYXQgbm90IHN1cHBvcnRlZCIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIHJldHVybiB0cnVlOworfQorCitZVVZJbWFnZTo6fllVVkltYWdlKCkgeworICAgIGlmIChtT3duQnVmZmVyKSBkZWxldGVbXSBtQnVmZmVyOworfQorCitib29sIFlVVklt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luY3JlbWVudCk7CisKKyAgICBpbnQzMl90IHlEZXN0T2Zmc2V0SW5jcmVtZW50OworICAgIGludDMyX3QgdURlc3RPZmZzZXRJbmNyZW1lbnQ7CisgICAgaW50MzJfdCB2RGVzdE9mZnNldEluY3JlbWVudDsKKyAgICBkZXN0SW1hZ2UuZ2V0T2Zmc2V0SW5jcmVtZW50c1BlckRhdGFSb3coCisgICAgICAgICAgICAmeURlc3RPZmZzZXRJbmNyZW1lbnQsICZ1RGVzdE9mZnNldEluY3JlbWVudCwgJnZEZXN0T2Zmc2V0SW5jcmVtZW50KTsKKworICAgIC8vIENvcHkgWQorICAgIHsKKyAgICAgICAgc2l6ZV90IG51bWJlck9mWUJ5dGVzUGVyUm93ID0gKHNpemVfdCkgd2lkdGg7CisgICAgICAgIHVpbnQ4X3QgKnlTcmNBZGRyID0geVNyY0FkZHJCYXNlOworICAgICAgICB1aW50OF90ICp5RGVzdEFkZHIgPSB5RGVzdEFkZHJCYXNlOworICAgICAgICBmb3IgKGludDMyX3Qgb2Zmc2V0WSA9IDA7IG9mZnNldFkgPCBoZWlnaHQ7ICsrb2Zmc2V0WSkgeworICAgICAgICAgICAgbWVtY3B5KHlEZXN0QWRkciwgeVNyY0FkZHIsIG51bWJlck9mWUJ5dGVzUGVyUm93KTsKKworICAgICAgICAgICAgeVNyY0FkZHIgKz0geVNyY09mZnNldEluY3JlbWVudDsKKyAgICAgICAgICAgIHlEZXN0QWRkciArPSB5RGVzdE9mZnNldEluY3JlbWVudDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIENvcHkgVQorICAgIHsKKyAgICAgICAgc2l6ZV90IG51bWJlck9mVUJ5dGVzUGVyUm93ID0gKHNpemVfdCkgKHdpZHRoID4+IDEpOworICAgICAgICB1aW50OF90ICp1U3JjQWRkciA9IHVTcmNBZGRyQmFzZTsKKyAgICAgICAgdWludDhfdCAqdURlc3RBZGRyID0gdURlc3RBZGRyQmFzZTsKKyAgICAgICAgLy8gRXZlcnkgb3RoZXIgcm93IGhhcyBhbiBlbnRyeSBmb3IgVS9WIGNoYW5uZWwgdmFsdWVzLiBIZW5jZSBvbmx5CisgICAgICAgIC8vIGdvIGhhbGYgdGhlIGhlaWdodC4KKyAgICAgICAgZm9yIChpbnQzMl90IG9mZnNldFkgPSAwOyBvZmZzZXRZIDwgKGhlaWdodCA+PiAxKTsgKytvZmZzZXRZKSB7CisgICAgICAgICAgICBtZW1jcHkodURlc3RBZGRyLCB1U3JjQWRkciwgbnVtYmVyT2ZVQnl0ZXNQZXJSb3cpOworCisgICAgICAgICAgICB1U3JjQWRkciArPSB1U3JjT2Zmc2V0SW5jcmVtZW50OworICAgICAgICAgICAgdURlc3RBZGRyICs9IHVEZXN0T2Zmc2V0SW5jcmVtZW50OworICAgICAgICB9CisgICAgfQorCisgICAgLy8gQ29weSBWCisgICAgeworICAgICAgICBzaXplX3QgbnVtYmVyT2ZWQnl0ZXNQZXJSb3cgPSAoc2l6ZV90KSAod2lkdGggPj4gMSk7CisgICAgICAgIHVpbnQ4X3QgKnZTcmNBZGRyID0gdlNyY0FkZHJCYXNlOworICAgICAgICB1aW50OF90ICp2RGVzdEFkZHIgPSB2RGVzdEFkZHJCYXNlOworICAgICAgICAvLyBFdmVyeSBvdGhlciBwaXhlbCByb3cgaGFzIGEgVS9WIGRhdGEgcm93LiBIZW5jZSBvbmx5IGdvIGhhbGYgdGhlIGhlaWdodC4KKyAgICAgICAgZm9yIChpbnQzMl90IG9mZnNldFkgPSAwOyBvZmZzZXRZIDwgKGhlaWdodCA+PiAxKTsgKytvZmZzZXRZKSB7CisgICAgICAgICAgICBtZW1jcHkodkRlc3RBZGRyLCB2U3JjQWRkciwgbnVtYmVyT2ZWQnl0ZXNQZXJSb3cpOworCisgICAgICAgICAgICB2U3JjQWRkciArPSB2U3JjT2Zmc2V0SW5jcmVtZW50OworICAgICAgICAgICAgdkRlc3RBZGRyICs9IHZEZXN0T2Zmc2V0SW5jcmVtZW50OworICAgICAgICB9CisgICAgfQor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gbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyMKKyMgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyMKKyMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorIyBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorIyBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorIyBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyMKKworTE9DQUxfUEFUSDo9ICQoY2FsbCBteS1kaXIpCisKK2lmbmVxICgkKFRBUkdFVF9TSU1VTEFUT1IpLHRydWUpCisKK2luY2x1ZGUgJChDTEVBUl9WQVJTKQorCitMT0NBTF9TUkNfRklMRVM6PSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cENsaWVudC5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwQ3Vyc29yLmNwcCAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0LmNwcCAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cERlYnVnLmNwcCAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwRGV2aWNlLmNwcCAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBFdmVudFBhY2tldC5jcHAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cERldmljZUluZm8uY3BwICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SW5mby5jcHAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFByb3BlcnR5LmNwcCAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwUmVxdWVzdFBhY2tldC5jcHAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBSZXNwb25zZVBhY2tldC5jcHAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFNlcnZlci5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUluZm8uY3BwICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBTdHJpbmdCdWZmZXIuY3BwICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2UuY3BwICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwVXRpbHMuY3BwICAgICAgICAgICAgICAgICAgICAgICAgICBcCisKK0xPQ0FMX01PRFVMRTo9IGxpYm10cAorCitMT0NBTF9DRkxBR1MgOj0gLURNVFBfREVWSUNFIC1ETVRQX0hPU1QKKworaW5jbHVkZSAkKEJVSUxEX1NUQVRJQ19MSUJSQVJZKQorCitlbmRpZgorCitpZmVxICgkKEhPU1RfT1MpLGxpbnV4KQorCitpbmNsdWRlICQoQ0xFQVJfVkFSUykKKworTE9DQUxfU1JDX0ZJTEVTOj0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBDbGllbnQuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cEN1cnNvci5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldC5jcHAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBEZWJ1Zy5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cERldmljZS5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwRXZlbnRQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBEZXZpY2VJbmZvLmNwcCAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cE9iamVjdEluZm8uY3BwICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwUGFja2V0LmNwcCAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBQcm9wZXJ0eS5jcHAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFJlcXVlc3RQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwUmVzcG9uc2VQYWNrZXQuY3BwICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBTdG9yYWdlSW5mby5jcHAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFN0cmluZ0J1ZmZlci5jcHAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZS5jcHAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBVdGlscy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XJuIHRydWU7CisgICAgcmV0dXJuIGZhbHNlOworfQorCitjbGFzcyBNdHBDbGllbnRUaHJlYWQgOiBwdWJsaWMgVGhyZWFkIHsKK3ByaXZhdGU6CisgICAgTXRwQ2xpZW50KiAgIG1DbGllbnQ7CisKK3B1YmxpYzoKKyAgICBNdHBDbGllbnRUaHJlYWQoTXRwQ2xpZW50KiBjbGllbnQpCisgICAgICAgIDogbUNsaWVudChjbGllbnQpCisgICAgeworICAgIH0KKworICAgIHZpcnR1YWwgYm9vbCB0aHJlYWRMb29wKCkgeworICAgICAgICByZXR1cm4gbUNsaWVudC0+dGhyZWFkTG9vcCgpOworICAgIH0KK307CisKKworTXRwQ2xpZW50OjpNdHBDbGllbnQoKQorICAgIDogICBtVGhyZWFkKE5VTEwpLAorICAgICAgICBtVXNiSG9zdENvbnRleHQoTlVMTCksCisgICAgICAgIG1Eb25lKGZhbHNlKQoreworfQorCitNdHBDbGllbnQ6On5NdHBDbGllbnQoKSB7CisgICAgdXNiX2hvc3RfY2xlYW51cChtVXNiSG9zdENvbnRleHQpOworfQorCitib29sIE10cENsaWVudDo6c3RhcnQoKSB7CisgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1NdXRleCk7CisKKyAgICBpZiAobVRocmVhZCkKKyAgICAgICAgcmV0dXJuIHRydWU7CisKKyAgICBtVXNiSG9zdENvbnRleHQgPSB1c2JfaG9zdF9pbml0KCk7CisgICAgaWYgKCFtVXNiSG9zdENvbnRleHQpCisgICAgICAgIHJldHVybiBmYWxzZTsKKworICAgIG1UaHJlYWQgPSBuZXcgTXRwQ2xpZW50VGhyZWFkKHRoaXMpOworICAgIG1UaHJlYWQtPnJ1bigiTXRwQ2xpZW50VGhyZWFkIik7CisgICAgLy8gd2FpdCBmb3IgdGhlIHRocmVhZCB0byBkbyBpbml0aWFsIGRldmljZSBkaXNjb3ZlcnkgYmVmb3JlIHJldHVybmluZworICAgIG1UaHJlYWRTdGFydENvbmRpdGlvbi53YWl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cnVjdCB1c2JfaW50ZXJmYWNlX2Rlc2NyaXB0b3IgKilkZXNjOworCisgICAgICAgICAgICBpZiAoaW50ZXJmYWNlLT5iSW50ZXJmYWNlQ2xhc3MgPT0gVVNCX0NMQVNTX1NUSUxMX0lNQUdFICYmCisgICAgICAgICAgICAgICAgaW50ZXJmYWNlLT5iSW50ZXJmYWNlU3ViQ2xhc3MgPT0gMSAmJiAvLyBTdGlsbCBJbWFnZSBDYXB0dXJlCisgICAgICAgICAgICAgICAgaW50ZXJmYWNlLT5iSW50ZXJmYWNlUHJvdG9jb2wgPT0gMSkgICAgIC8vIFBpY3R1cmUgVHJhbnNmZXIgUHJvdG9jb2wgKFBJTUEgMTU0NzApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgTE9HRCgiRm91bmQgY2FtZXJhOiBcIiVzXCIgXCIlc1wiXG4iLCB1c2JfZGV2aWNlX2dldF9tYW51ZmFjdHVyZXJfbmFtZShkZXZpY2UpLAorICAgICAgICAgICAgICAgICAgICAgICAgdXNiX2RldmljZV9nZXRfcHJvZHVjdF9uYW1lKGRldmljZSkpOworICAgICAgICAgICAgfSBlbHNlIGlmIChpbnRlcmZhY2UtPmJJbnRlcmZhY2VDbGFzcyA9PSAweEZGICYmCisgICAgICAgICAgICAgICAgICAgIGludGVyZmFjZS0+YkludGVyZmFjZVN1YkNsYXNzID09IDB4RkYgJiYKKyAgICAgICAgICAgICAgICAgICAgaW50ZXJmYWNlLT5iSW50ZXJmYWNlUHJvdG9jb2wgPT0gMCkgeworICAgICAgICAgICAgICAgIGNoYXIqIGludGVyZmFjZU5hbWUgPSB1c2JfZGV2aWNlX2dldF9zdHJpbmcoZGV2aWNlLCBpbnRlcmZhY2UtPmlJbnRlcmZhY2UpOworICAgICAgICAgICAgICAgIGlmICghaW50ZXJmYWNlTmFtZSB8fCBzdHJjbXAoaW50ZXJmYWNlTmFtZSwgIk1UUCIpKQorICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAvLyBMb29rcyBsaWtlIGFuIGFuZHJvaWQgc3R5bGUgTVRQIGRldmljZQorICAgICAgICAgICAgICAgIExPR0QoIkZvdW5kIE1UUCBkZXZpY2U6IFwiJXNcIiBcIiVzXCJcbiIsIHVzYl9kZXZpY2VfZ2V0X21hbnVmYWN0dXJlcl9uYW1lKGRldmljZSksCisgICAgICAgICAgICAgICAgICAgICAgICB1c2JfZGV2aWNlX2dldF9wcm9kdWN0X25hbWUoZGV2aWNlKSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIGxvb2sgZm9yIHNwZWNpYWwgY2FzZWQgZGV2aWNlcyBiYXNlZCBvbiB2ZW5kb3IvcHJvZHVjdCBJRAorICAgICAgICAgICAgICAgIC8vIHdlIGFyZSBkb2luZyB0aGlzIG1haW5seSBmb3IgdGVzdGluZyBwdXJwb3NlcworICAgICAgICAgICAgICAgIHVpbnQxNl90IHZlbmRvciA9IHVzYl9kZXZpY2VfZ2V0X3ZlbmRvcl9pZChkZXZpY2UpOworICAgICAgICAgICAgICAgIHVpbnQxNl90IHByb2R1Y3QgPSB1c2JfZGV2aWNlX2dldF9wcm9kdWN0X2lkKGRldmljZSk7CisgICAgICAgICAgICAgICAgaWYgKCFpc010cERldmljZSh2ZW5kb3IsIHByb2R1Y3QpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIG5vdCBhbiBNVFAgb3IgUFRQIGRldmljZQorICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gcmVxdWVzdCBNVFAgT1Mgc3RyaW5nIGFuZCBkZXNjcmlwdG9yCisgICAgICAgICAgICAgICAgLy8gc29tZSBtdXNpYyBwbGF5ZXJzIG5lZWQgdG8gc2VlIHRoaXMgYmVmb3JlIGVudGVyaW5nIE1UUCBtb2RlLgorICAgICAgICAgICAgICAgIGNoYXIgYnVmZmVyWzI1Nl07CisgICAgICAgICAgICAgICAgbWVtc2V0KGJ1ZmZlciwgMCwgc2l6ZW9mKGJ1ZmZlcikpOworICAgICAgICAgICAgICAgIGludCByZXQgPSB1c2JfZGV2aWNlX3NlbmRfY29udHJvbChkZXZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICBVU0JfRElSX0lOfFVTQl9SRUNJUF9ERVZJQ0V8VVNCX1RZUEVfU1RBTkRBUkQsCisgICAgICAgICAgICAgICAgICAgICAgICBVU0JfUkVRX0dFVF9ERVNDUklQVE9SLCAoVVNCX0RUX1NUUklORyA8PCA4KSB8IDB4RUUsCisgICAgICAgICAgICAgICAgICAgICAgICAwLCBzaXplb2YoYnVmZmVyKSwgYnVmZmVyKTsKKyAgICAgICAgICAgICAgICBwcmludGYoInVzYl9kZXZpY2Vfc2VuZF9jb250cm9sIHJldHVybmVkICVkIGVycm5vOiAlZFxuIiwgcmV0LCBlcnJubyk7CisgICAgICAgICAgICAgICAgaWYgKHJldCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJnb3QgTVRQIHN0cmluZyAlc1xuIiwgYnVmZmVyKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gdXNiX2RldmljZV9zZW5kX2NvbnRyb2woZGV2aWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVTQl9ESVJfSU58VVNCX1JFQ0lQX0RFVklDRXxVU0JfVFlQRV9WRU5ET1IsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgNCwgc2l6ZW9mKGJ1ZmZlciksIGJ1ZmZlcik7CisgICAgICAgICAgICAgICAgICAgIHByaW50ZigiT1MgZGVzY3JpcHRvciBnb3QgJWRcbiIsIHJldCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJubyBNVFAgc3RyaW5nXG4iKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGlmIHdlIGd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DsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgZXBfb3V0X2Rlc2MgPSBlcDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVwLT5ibUF0dHJpYnV0ZXMgPT0gVVNCX0VORFBPSU5UX1hGRVJfSU5UICYmCisgICAgICAgICAgICAgICAgICAgIGVwLT5iRW5kcG9pbnRBZGRyZXNzICYgVVNCX0VORFBPSU5UX0RJUl9NQVNLKSB7CisgICAgICAgICAgICAgICAgICAgIGVwX2ludHJfZGVzYyA9IGVwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghZXBfaW5fZGVzYyB8fCAhZXBfb3V0X2Rlc2MgfHwgIWVwX2ludHJfZGVzYykgeworICAgICAgICAgICAgICAgIExPR0UoImVuZHBvaW50cyBub3QgZm91bmRcbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBtRG9uZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfaW4gPSB1c2JfZW5kcG9pbnRfb3BlbihkZXZpY2UsIGVwX2luX2Rlc2MpOworICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfb3V0ID0gdXNiX2VuZHBvaW50X29wZW4oZGV2aWNlLCBlcF9vdXRfZGVzYyk7CisgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcF9pbnRyID0gdXNiX2VuZHBvaW50X29wZW4oZGV2aWNlLCBlcF9pbnRyX2Rlc2MpOworCisgICAgICAgICAgICBpZiAodXNiX2RldmljZV9jbGFpbV9pbnRlcmZhY2UoZGV2aWNlLCBpbnRlcmZhY2UtPmJJbnRlcmZhY2VOdW1iZXIpKSB7CisgICAgICAgICAgICAgICAgTE9HRSgidXNiX2RldmljZV9jbGFpbV9pbnRlcmZhY2UgZmFpbGVkIGVycm5vOiAlZFxuIiwgZXJybm8pOworICAgICAgICAgICAgICAgIHVzYl9lbmRwb2ludF9jbG9zZShlcF9pbik7CisgICAgICAgICAgICAgICAgdXNiX2VuZHBvaW50X2Nsb3NlKGVwX291dCk7CisgICAgICAgICAgICAgICAgdXNiX2VuZHBvaW50X2Nsb3NlKGVwX2ludHIpOworICAgICAgICAgICAgICAgIHJldHVybiBtRG9uZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgTXRwRGV2aWNlKiBtdHBEZXZpY2UgPSBuZXcgTXRwRGV2aWNlKGRldmljZSwgaW50ZXJmYWNlLT5iSW50ZXJmYWNlTnVtYmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgZXBfaW4sIGVwX291dCwgZXBfaW50cik7CisgICAgICAgICAgICBtRGV2aWNlTGlzdC5hZGQobXRwRGV2aWNlKTsKKyAgICAgICAgICAgIG10cERldmljZS0+aW5pdGlhbGl6ZSgpOworICAgICAgICAgICAgZGV2aWNlQWRkZWQobXRwRGV2aWNlKTsKKyAgICAgICAgICAgIHJldHVybiBtRG9uZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHVzYl9kZXZpY2VfY2xvc2UoZGV2aWNlKTsKKyAgICByZXR1cm4gbURvbmU7Cit9CisKK2Jvb2wgTXRwQ2xpZW50Ojp1c2JEZXZpY2VSZW1vdmVkKGNvbnN0IGNoYXIgKmRldm5hbWUpIHsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IG1EZXZpY2VMaXN0LnNpemUoKTsgaSsrKSB7CisgICAgICAgIE10cERldmljZSogZGV2aWNlID0gbURldmljZUxpc3RbaV07CisgICAgICAgIGlmICghc3RyY21wKGRldm5hbWUsIGRldmljZS0+Z2V0RGV2aWNlTmFtZSgpKSkgeworICAgICAgICAgICAgZGV2aWNlUmVtb3ZlZChkZXZpY2UpOworICAgICAgICAgICAgbURldmljZUxpc3QucmVtb3ZlQXQoaSk7CisgICAgICAgICAgICBkZWxldGUgZGV2aWNlOworICAgICAgICAgICAgTE9HRCgiQ2FtZ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mb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICovCisKKyNpZm5kZWYgX01UUF9DTElFTlRfSAorI2RlZmluZSBfTVRQX0NMSUVOVF9ICisKKyNpbmNsdWRlICJNdHBUeXBlcy5oIgorCisjaW5jbHVkZSA8dXRpbHMvdGhyZWFkcy5oPgorCitzdHJ1Y3QgdXNiX2hvc3RfY29udGV4dDsKKworbmFtZXNwYWNlIGFuZHJvaWQgeworCitjbGFzcyBNdHBDbGllbnRUaHJlYWQ7CisKK2NsYXNzIE10cENsaWVudCB7Citwcml2YXRlOgorICAgIE10cERldmljZUxpc3QgICAgICAgICAgICAgICBtRGV2aWNlTGlzdDsKKyAgICBNdHBDbGllbnRUaHJlYWQqICAgICAgICAgICAgbVRocmVhZDsKKyAgICBDb25kaXRpb24gICAgICAgICAgICAgICAgICAgbVRocmVhZFN0YXJ0Q29uZGl0aW9uOworICAgIE11dGV4ICAgICAgICAgICAgICAgICAgICAgICBtTXV0ZXg7CisgICAgc3RydWN0IHVzYl9ob3N0X2NvbnRleHQqICAgIG1Vc2JIb3N0Q29udGV4dDsKKyAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgbURvbmU7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBDbGllbnQoKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgICAgICB+TXRwQ2xpZW50KCk7CisKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBzdGFydCgpOworICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIHN0b3AoKTsKKworICAgIGlubGluZSBNdHBEZXZpY2VMaXN0JiAgIGdldERldmljZUxpc3QoKSB7IHJldHVybiBtRGV2aWNlTGlzdDsgfQorICAgIE10cERldmljZSogICAgICAgICAgICAgIGdldERldmljZShpbnQgaWQpOworCisKKyAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICBkZXZpY2VBZGRlZChNdHBEZXZpY2UgKmRldmljZSkgPSAwOworICAgIHZpcnR1YWwgdm9pZCAgICAgICAgICAgIGRldmljZVJlbW92ZWQoTXRwRGV2aWNlICpkZXZpY2UpID0gMDsKKworcHJpdmF0ZToKKyAgICAvLyB0aGVzZSByZXR1cm4gdHJ1ZSBpZiB3ZSBzaG91bGQgc3RvcCBtb25pdG9yaW5nIFVTQiBhbmQgY2xlYW4gdXAKKyAgICBib29sICAgICAgICAgICAgICAgICAgICB1c2JEZXZpY2VBZGRlZChjb25zdCBjaGFyICpkZXZuYW1lKTsKKyAgICBib29sICAgICAgICAgICAgICAgICAgICB1c2JEZXZpY2VSZW1vdmVkKGNvbnN0IGNoYXIgKmRldm5hbWUpOworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIHVzYkRpc2NvdmVyeURvbmUoKTsKKworICAgIGZyaWVuZCBjbGFzcyBNdHBDbGllbnRUaHJlYWQ7CisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgdGhyZWFkTG9vcCgpOworICAgIHN0YXRpYyBpbnQgICAgICAgICAgICAgIHVzYl9kZXZpY2VfYWRkZWQoY29uc3QgY2hhciAqZGV2bmFtZSwgdm9pZCogY2xpZW50X2RhdGEpOworICAgIHN0YXRpYyBpbnQgICAgICAgICAgICAgIHVzYl9kZXZpY2VfcmVtb3ZlZChjb25zdCBjaGFyICpkZXZuYW1lLCB2b2lkKiBjbGllbnRfZGF0YSk7CisgICAgc3RhdGljIGludCAgICAgICAgICAgICAgdXNiX2Rpc2NvdmVyeV9kb25lKHZvaWQqIGNsaWVudF9kYXRhKTsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKyNlbmRpZiAvLyBfTVRQX0NMSUVOVF9ICmRpZmYgLS1naXQgYS9tZWRpYS9tdHAvTXRwQ3Vyc29yLmNwcCBiL21lZGlhL210cC9NdHBDdXJzb3IuY3BwCm5ldyBmaWxlIG1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gICAgICAgICAgaW50IGNvbHVtbkNvdW50LCBpbnQqIGNvbHVtbnMpCisgICAgICAgIDogICBtQ2xpZW50KGNsaWVudCksCisgICAgICAgICAgICBtUXVlcnlUeXBlKHF1ZXJ5VHlwZSksCisgICAgICAgICAgICBtRGV2aWNlSUQoZGV2aWNlSUQpLAorICAgICAgICAgICAgbVN0b3JhZ2VJRChzdG9yYWdlSUQpLAorICAgICAgICAgICAgbVFiamVjdElEKG9iamVjdElEKSwKKyAgICAgICAgICAgIG1Db2x1bW5Db3VudChjb2x1bW5Db3VudCksCisgICAgICAgICAgICBtQ29sdW1ucyhOVUxMKQoreworICAgIGlmIChjb2x1bW5zKSB7CisgICAgICAgIG1Db2x1bW5zID0gbmV3IGludFtjb2x1bW5Db3VudF07CisgICAgICAgIG1lbWNweShtQ29sdW1ucywgY29sdW1ucywgY29sdW1uQ291bnQgKiBzaXplb2YoaW50KSk7CisgICAgfQorfQorCitNdHBDdXJzb3I6On5NdHBDdXJzb3IoKSB7CisgICAgZGVsZXRlW10gbUNvbHVtbnM7Cit9CisKK2ludCBNdHBDdXJzb3I6OmZpbGxXaW5kb3coQ3Vyc29yV2luZG93KiB3aW5kb3csIGludCBzdGFydFBvcykgeworICAgIExPR0QoIk10cEN1cnNvcjo6ZmlsbFdpbmRvdyBtUXVlcnlUeXBlOiAlZFxuIiwgbVF1ZXJ5VHlwZSk7CisKKyAgICBzd2l0Y2ggKG1RdWVyeVR5cGUpIHsKKyAgICAgICAgY2FzZSBERVZJQ0U6CisgICAgICAgICAgICByZXR1cm4gZmlsbERldmljZXMod2luZG93LCBzdGFydFBvcyk7CisgICAgICAgIGNhc2UgREVWSUNFX0lEOgorICAgICAgICAgICAgcmV0dXJuIGZpbGxEZXZpY2Uod2luZG93LCBzdGFydFBvcyk7CisgICAgICAgIGNhc2UgU1RPUkFHRToKKyAgICAgICAgICAgIHJldHVybiBmaWxsU3RvcmFnZXMod2luZG93LCBzdGFydFBvcyk7CisgICAgICAgIGNhc2UgU1RPUkFHRV9JRDoKKyAgICAgICAgICAgIHJldHVybiBmaWxsU3RvcmFnZSh3aW5kb3csIHN0YXJ0UG9zKTsKKyAgICAgICAgY2FzZSBPQkpFQ1Q6CisgICAgICAgICAgICByZXR1cm4gZmlsbE9iamVjdHMod2luZG93LCAwLCBzdGFydFBvcyk7CisgICAgICAgIGNhc2UgT0JKRUNUX0lEOgorICAgICAgICAgICAgcmV0dXJuIGZpbGxPYmplY3Qod2luZG93LCBzdGFydFBvcyk7CisgICAgICAgIGNhc2UgU1RPUkFHRV9DSElMRFJFTjoKKyAgICAgICAgICAgIHJldHVybiBmaWxsT2JqZWN0cyh3aW5kb3csIC0xLCBzdGFydFBvcyk7CisgICAgICAgIGNhc2UgT0JKRUNUX0NISUxEUkVOOgorICAgICAgICAgICAgcmV0dXJuIGZpbGxPYmplY3RzKHdpbmRvdywgbVFiamVjdElELCBzdGFydFBvcyk7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBMT0dFKCJNdHBDdXJzb3I6OmZpbGxXaW5kb3c6IHVua25vd24gcXVlcnkgdHlwZSAlZFxuIiwgbVF1ZXJ5VHlwZSk7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICB9Cit9CisKK2ludCBNdHBDdXJzb3I6OmZpbGxEZXZpY2VzKEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpIHsKKyAgICBpbnQgY291bnQgPSAwOworICAgIE10cERldmljZUxpc3QmIGRldmljZUxpc3QgPSBtQ2xpZW50LT5nZXREZXZpY2VMaXN0KCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkZXZpY2VMaXN0LnNpemUoKTsgaSsrKSB7CisgICAgICAgIE10cERldmljZSogZGV2aWNlID0gZGV2aWNlTGlzdFtpXTsKKyAgICAgICAgaWYgKGZpbGxEZXZpY2Uod2luZG93LCBkZXZpY2UsIHN0YXJ0UG9zKSkgeworICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgIHN0YXJ0UG9zKys7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gY291bnQ7Cit9CisKK2ludCBNdHBDdXJzb3I6OmZpbGxEZXZpY2UoQ3Vyc29yV2luZG93KiB3aW5kb3csIGludCBzdGFydFBvcykgeworICAgIE10cERldmljZSogZGV2aWNlID0gbUNsaWVudC0+Z2V0RGV2aWNlKG1EZXZpY2VJRCk7CisgICAgaWYgKGRldmljZSAmJiBmaWxsRGV2aWNlKHdpbmRvdywgZGV2aWNlLCBzdGFydFBvcykpCisgICAgICAgIHJldHVybiAxOworICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIDA7Cit9CisKK2ludCBNdHBDdXJzb3I6OmZpbGxTdG9yYWdlcyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKSB7CisgICAgaW50IGNvdW50ID0gMDsKKyAgICBNdHBEZXZpY2UqIGRldmljZSA9IG1DbGllbnQtPmdldERldmljZShtRGV2aWNlSUQpOworICAgIGlmICghZGV2aWNlKQorICAgICAgICByZXR1cm4gMDsKKyAgICBNdHBTdG9yYWdlSURMaXN0KiBzdG9yYWdlSURzID0gZGV2aWNlLT5nZXRTdG9yYWdlSURzKCk7CisgICAgaWYgKCFzdG9yYWdlSURzKQorICAgICAgICByZXR1cm4gMDsKKworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3RvcmFnZUlEcy0+c2l6ZSgpOyBpKyspIHsKKyAgICAgICAgTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCA9ICgqc3RvcmFnZUlEcylbaV07CisgICAgICAgIGlmIChmaWxsU3RvcmFnZSh3aW5kb3csIGRldmljZSwgc3RvcmFnZUlELCBzdGFydFBvcykpIHsKKyAgICAgICAgICAgIGNvdW50Kys7CisgICAgICAgICAgICBzdGFydFBvcysrOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgZGVsZXRlIHN0b3JhZ2VJRHM7CisgICAgcmV0dXJuIGNvdW50OworfQorCitpbnQgTXRwQ3Vyc29yOjpmaWxsU3RvcmFnZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKSB7CisgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBtQ2xpZW50LT5nZXREZXZpY2UobURldmljZUlEKTsKKyAgICBpZiAoZGV2aWNlICYmIGZpbGxTdG9yYWdlKHdpbmRvdywgZGV2aWNlLCBtU3RvcmFnZUlELCBzdGFydFBvcykpCisgICAgICAgIHJldHVybiAxOworICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIDA7Cit9CisKK2ludCBNdHBDdXJzb3I6OmZpbGxPYmplY3RzKEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgcGFyZW50LCBpbnQgc3RhcnRQb3MpIHsKKyAgICBpbnQgY291bnQgPSAwOworICAgIE10cERldmljZSogZGV2aWNlID0gbUNsaWVudC0+Z2V0RGV2aWNlKG1EZXZpY2VJRCk7CisgICAgaWYgKCFkZXZpY2UpCisgICAgICAgIHJldHVybiAwOworICAgIE10cE9iamVjdEhhbmRsZUxpc3QqIGhhbmRsZXMgPSBkZXZpY2UtPmdldE9iamVjdEhhbmRsZXMobVN0b3JhZ2VJRCwgMCwgcGFyZW50KTsKKyAgICBpZiAoIWhhbmRsZXMpCisgICAgICAgIHJldHVybiAwOworCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBoYW5kbGVzLT5zaXplKCk7IGkrKykgeworICAgICAgICBNdHBPYmplY3RIYW5kbGUgaGFuZGxlID0gKCpoYW5kbGVzKVtpXTsKKyAgICAgICAgaWYgKGZpbGxPYmplY3Qod2luZG93LCBkZXZpY2UsIGhhbmRsZSwgc3RhcnRQb3MpKSB7CisgICAgICAgICAgICBjb3VudCsrOworICAgICAgICAgICAgc3RhcnRQb3MrKzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIGRlbGV0ZSBoYW5kbGVzOworICAgIHJldHVybiBjb3VudDsKK30KKworaW50IE10cEN1cnNvcjo6ZmlsbE9iamVjdChDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKSB7CisgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBtQ2xpZW50LT5nZXREZXZpY2UobURldmljZUlEKTsKKyAgICBpZiAoZGV2aWNlICYmIGZpbGxPYmplY3Qod2luZG93LCBkZXZpY2UsIG1RYmplY3RJRCwgc3RhcnRQb3MpKQorICAgICAgICByZXR1cm4gMTsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiAwOworfQorCitib29sIE10cEN1cnNvcjo6ZmlsbERldmljZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgTXRwRGV2aWNlKiBkZXZpY2UsIGludCByb3cpIHsKKyAgICBNdHBEZXZpY2VJbmZvKiBkZXZpY2VJbmZvID0gZGV2aWNlLT5nZXREZXZpY2VJbmZvKCk7CisgICAgaWYgKCFkZXZpY2VJbmZvKQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgaWYgKCFwcmVwYXJlUm93KHdpbmRvdykpCisgICAgICAgIHJldHVybiBmYWxzZTsKKworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUNvbHVtbkNvdW50OyBpKyspIHsKKyAgICAgICAgc3dpdGNoIChtQ29sdW1uc1tpXSkgeworICAgICAgICAgICAgY2FzZSBERVZJQ0VfUk9XX0lEOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIGRldmljZS0+Z2V0SUQoKSwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgREVWSUNFX01BTlVGQUNUVVJFUjoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dFN0cmluZyh3aW5kb3csIGRldmljZUluZm8tPm1NYW51ZmFjdHVyZXIsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIERFVklDRV9NT0RFTDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dFN0cmluZyh3aW5kb3csIGRldmljZUluZm8tPm1Nb2RlbCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgTE9HRSgiZmlsbERldmljZTogdW5rbm93biBjb2x1bW4gJWRcbiIsIG1Db2x1bW5zW2ldKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gdHJ1ZTsKK30KKworYm9vbCBNdHBDdXJzb3I6OmZpbGxTdG9yYWdlKEN1cnNvcldpbmRvdyogd2luZG93LCBNdHBEZXZpY2UqIGRldmljZSwKKyAgICAgICAgTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwgaW50IHJvdykgeworCitMT0dEKCJmaWxsU3RvcmFnZSAlZFxuIiwgc3RvcmFnZUlEKTsKKworICAgIE10cFN0b3JhZ2VJbmZvKiBzdG9yYWdlSW5mbyA9IGRldmljZS0+Z2V0U3RvcmFnZUluZm8oc3RvcmFnZUlEKTsKKyAgICBpZiAoIXN0b3JhZ2VJbmZvKQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgaWYgKCFwcmVwYXJlUm93KHdpbmRvdykpIHsKKyAgICAgICAgZGVsZXRlIHN0b3JhZ2VJbmZvOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgY29uc3QgY2hhciogdGV4dDsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IG1Db2x1bW5Db3VudDsgaSsrKSB7CisgICAgICAgIHN3aXRjaCAobUNvbHVtbnNbaV0pIHsKKyAgICAgICAgICAgIGNhc2UgU1RPUkFHRV9ST1dfSUQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgc3RvcmFnZUlELCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTVE9SQUdFX0lERU5USUZJRVI6CisgICAgICAgICAgICAgICAgdGV4dCA9IHN0b3JhZ2VJbmZvLT5tVm9sdW1lSWRlbnRpZmllcjsKKyAgICAgICAgICAgICAgICBpZiAoIXRleHQgfHwgIXRleHRbMF0pCisgICAgICAgICAgICAgICAgICAgIHRleHQgPSAiQ2FtZXJhIFN0b3JhZ2UiOworICAgICAgICAgICAgICAgIGlmICghcHV0U3RyaW5nKHdpbmRvdywgdGV4dCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU1RPUkFHRV9ERVNDUklQVElPTjoKKyAgICAgICAgICAgICAgICB0ZXh0ID0gc3RvcmFnZUluZm8tPm1TdG9yYWdlRGVzY3JpcHRpb247CisgICAgICAgICAgICAgICAgaWYgKCF0ZXh0IHx8ICF0ZXh0WzBdKQorICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gIlN0b3JhZ2UgRGVzY3JpcHRpb24iOworICAgICAgICAgICAgICAgIGlmICghcHV0U3RyaW5nKHdpbmRvdywgdGV4dCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgTE9HRSgiZmlsbFN0b3JhZ2U6IHVua25vd24gY29sdW1uICVkXG4iLCBtQ29sdW1uc1tpXSk7CisgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICB9CisgICAgfQorCisgICAgZGVsZXRlIHN0b3JhZ2VJbmZvOworICAgIHJldHVybiB0cnVlOworCitmYWlsOgorICAgIGRlbGV0ZSBzdG9yYWdlSW5mbzsKKyAgICByZXR1cm4gZmFsc2U7Cit9CisKK2Jvb2wgTXRwQ3Vyc29yOjpmaWxsT2JqZWN0KEN1cnNvcldpbmRvdyogd2luZG93LCBNdHBEZXZpY2UqIGRldmljZSwKKyAgICAgICAgTXRwT2JqZWN0SGFuZGxlIG9iamVjdElELCBpbnQgcm93KSB7CisKKyAgICBNdHBPYmplY3RJbmZvKiBvYmplY3RJbmZvID0gZGV2aWNlLT5nZXRPYmplY3RJbmZvKG9iamVjdElEKTsKKyAgICBpZiAoIW9iamVjdEluZm8pCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAvLyBvYmplY3RJbmZvLT5wcmludCgpOworICAgIGlmICghcHJlcGFyZVJvdyh3aW5kb3cpKSB7CisgICAgICAgIGRlbGV0ZSBvYmplY3RJbmZvOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtQ29sdW1uQ291bnQ7IGkrKykgeworICAgICAgICBzd2l0Y2ggKG1Db2x1bW5zW2ldKSB7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9ST1dfSUQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SUQsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9TVE9SQUdFX0lEOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1TdG9yYWdlSUQsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9GT1JNQVQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUZvcm1hdCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1BST1RFQ1RJT05fU1RBVFVTOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1Qcm90ZWN0aW9uU3RhdHVzLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfU0laRToKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tQ29tcHJlc3NlZFNpemUsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9USFVNQl9GT1JNQVQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVRodW1iRm9ybWF0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfVEhVTUJfU0laRToKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tVGh1bWJDb21wcmVzc2VkU2l6ZSwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1RIVU1CX1dJRFRIOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1UaHVtYlBpeFdpZHRoLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfVEhVTUJfSEVJR0hUOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1UaHVtYlBpeEhlaWdodCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0lNQUdFX1dJRFRIOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1JbWFnZVBpeFdpZHRoLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfSU1BR0VfSEVJR0hUOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1JbWFnZVBpeEhlaWdodCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0lNQUdFX0RFUFRIOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1JbWFnZVBpeERlcHRoLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfUEFSRU5UOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1QYXJlbnQsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9BU1NPQ0lBVElPTl9UWVBFOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1Bc3NvY2lhdGlvblR5cGUsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9BU1NPQ0lBVElPTl9ERVNDOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1Bc3NvY2lhdGlvbkRlc2MsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9TRVFVRU5DRV9OVU1CRVI6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVNlcXVlbmNlTnVtYmVyLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfTkFNRToKKyAgICAgICAgICAgICAgICBpZiAoIXB1dFN0cmluZyh3aW5kb3csIG9iamVjdEluZm8tPm1OYW1lLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfREFURV9DUkVBVEVEOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1EYXRlQ3JlYXRlZCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0RBVEVfTU9ESUZJRUQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bURhdGVNb2RpZmllZCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0tFWVdPUkRTOgorICAgICAgICAgICAgICAgIGlmICghcHV0U3RyaW5nKHdpbmRvdywgb2JqZWN0SW5mby0+bUtleXdvcmRzLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfVEhVTUI6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRUaHVtYm5haWwod2luZG93LCBvYmplY3RJRCwgb2JqZWN0SW5mby0+bUZvcm1hdCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBMT0dFKCJmaWxsT2JqZWN0OiB1bmtub3duIGNvbHVtbiAlZFxuIiwgbUNvbHVtbnNbaV0pOworICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGRlbGV0ZSBvYmplY3RJbmZvOworICAgIHJldHVybiB0cnVlOworCitmYWlsOgorICAgIGRlbGV0ZSBvYmplY3RJbmZvOworICAgIHJldHVybiBmYWxzZTsKK30KKworYm9vbCBNdHBDdXJzb3I6OnByZXBhcmVSb3coQ3Vyc29yV2luZG93KiB3aW5kb3cpIHsKKyAgICBpZiAoIXdpbmRvdy0+c2V0TnVtQ29sdW1ucyhtQ29sdW1uQ291bnQpKSB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RlICJNdHBUeXBlcy5oIgorCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK2NsYXNzIEN1cnNvcldpbmRvdzsKKworY2xhc3MgTXRwQ3Vyc29yIHsKK3ByaXZhdGU6CisgICAgZW51bSB7CisgICAgICAgIERFVklDRSAgICAgICAgICAgICAgPSAxLAorICAgICAgICBERVZJQ0VfSUQgICAgICAgICAgID0gMiwKKyAgICAgICAgU1RPUkFHRSAgICAgICAgICAgICA9IDMsCisgICAgICAgIFNUT1JBR0VfSUQgICAgICAgICAgPSA0LAorICAgICAgICBPQkpFQ1QgICAgICAgICAgICAgID0gNSwKKyAgICAgICAgT0JKRUNUX0lEICAgICAgICAgICA9IDYsCisgICAgICAgIFNUT1JBR0VfQ0hJTERSRU4gICAgPSA3LAorICAgICAgICBPQkpFQ1RfQ0hJTERSRU4gICAgID0gOCwKKyAgICB9OworCisgICAgTXRwQ2xpZW50KiAgICAgIG1DbGllbnQ7CisgICAgaW50ICAgICAgICAgICAgIG1RdWVyeVR5cGU7CisgICAgaW50ICAgICAgICAgICAgIG1EZXZpY2VJRDsKKyAgICBNdHBTdG9yYWdlSUQgICAgbVN0b3JhZ2VJRDsKKyAgICBNdHBPYmplY3RIYW5kbGUgbVFiamVjdElEOworICAgIGludCAgICAgICAgICAgICBtQ29sdW1uQ291bnQ7CisgICAgaW50KiAgICAgICAgICAgIG1Db2x1bW5zOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgTXRwQ3Vyc29yKE10cENsaWVudCogY2xpZW50LCBpbnQgcXVlcnlUeXBlLCBpbnQgZGV2aWNlSUQsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHBTdG9yYWdlSUQgc3RvcmFnZUlELCBNdHBPYmplY3RIYW5kbGUgb2JqZWN0SUQsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY29sdW1uQ291bnQsIGludCogY29sdW1ucyk7CisgICAgdmlydHVhbCAgICAgfk10cEN1cnNvcigpOworCisgICAgaW50ICAgICAgICAgZmlsbFdpbmRvdyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKworcHJpdmF0ZToKKyAgICBpbnQgICAgICAgICBmaWxsRGV2aWNlcyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsRGV2aWNlKEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpOworICAgIGludCAgICAgICAgIGZpbGxTdG9yYWdlcyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsU3RvcmFnZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsT2JqZWN0cyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHBhcmVudCwgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsT2JqZWN0KEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpOworCisgICAgYm9vbCAgICAgICAgZmlsbERldmljZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgTXRwRGV2aWNlKiBkZXZpY2UsIGludCBzdGFydFBvcyk7CisgICAgYm9vbCAgICAgICAgZmlsbFN0b3JhZ2UoQ3Vyc29yV2luZG93KiB3aW5kb3csIE10cERldmljZSogZGV2aWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwgaW50IHJvdyk7CisgICAgYm9vbCAgICAgICAgZmlsbE9iamVjdChDdXJzb3JXaW5kb3cqIHdpbmRvdywgTXRwRGV2aWNlKiBkZXZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGUgb2JqZWN0SUQsIGludCByb3cpOworCisgICAgYm9vbCAgICAgICAgcHJlcGFyZVJvdyhDdXJzb3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oaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcmVzdWx0LT5wdXNoKGdldEludDgoKSk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworVUludDhMaXN0KiBNdHBEYXRhUGFja2V0OjpnZXRBVUludDgoKSB7CisgICAgVUludDhMaXN0KiByZXN1bHQgPSBuZXcgVUludDhMaXN0OworICAgIGludCBjb3VudCA9IGdldFVJbnQzMigpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcmVzdWx0LT5wdXNoKGdldFVJbnQ4KCkpOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK0ludDE2TGlzdCogTXRwRGF0YVBhY2tldDo6Z2V0QUludDE2KCkgeworICAgIEludDE2TGlzdCogcmVzdWx0ID0gbmV3IEludDE2TGlzdDsKKyAgICBpbnQgY291bnQgPSBnZXRVSW50MzIoKTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHJlc3VsdC0+cHVzaChnZXRJbnQxNigpKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitVSW50MTZMaXN0KiBNdHBEYXRhUGFja2V0OjpnZXRBVUludDE2KCkgeworICAgIFVJbnQxNkxpc3QqIHJlc3VsdCA9IG5ldyBVSW50MTZMaXN0OworICAgIGludCBjb3VudCA9IGdldFVJbnQzMigpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcmVzdWx0LT5wdXNoKGdldFVJbnQxNigpKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitJbnQzMkxpc3QqIE10cERhdGFQYWNrZXQ6OmdldEFJbnQzMigpIHsKKyAgICBJbnQzMkxpc3QqIHJlc3VsdCA9IG5ldyBJbnQzMkxpc3Q7CisgICAgaW50IGNvdW50ID0gZ2V0VUludDMyKCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICByZXN1bHQtPnB1c2goZ2V0SW50MzIoKSk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworVUludDMyTGlzdCogTXRwRGF0YVBhY2tldDo6Z2V0QVVJbnQzMigpIHsKKyAgICBVSW50MzJMaXN0KiByZXN1bHQgPSBuZXcgVUludDMyTGlzdDsKKyAgICBpbnQgY291bnQgPSBnZXRVSW50MzIoKTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHJlc3VsdC0+cHVzaChnZXRVSW50MzIoKSk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworSW50NjRMaXN0KiBNdHBEYXRhUGFja2V0OjpnZXRBSW50NjQoKSB7CisgICAgSW50NjRMaXN0KiByZXN1bHQgPSBuZXcgSW50NjRMaXN0OworICAgIGludCBjb3VudCA9IGdldFVJbnQzMigpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcmVzdWx0LT5wdXNoKGdldEludDY0KCkpOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK1VJbnQ2NExpc3QqIE10cERhdGFQYWNrZXQ6OmdldEFVSW50NjQoKSB7CisgICAgVUludDY0TGlzdCogcmVzdWx0ID0gbmV3IFVJbnQ2NExpc3Q7CisgICAgaW50IGNvdW50ID0gZ2V0VUludDMyKCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICByZXN1bHQtPnB1c2goZ2V0VUludDY0KCkpOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK3ZvaWQgTXRwRGF0YVBhY2tldDo6cHV0SW50OChpbnQ4X3QgdmFsdWUpIHsKKyAgICBhbGxvY2F0ZShtT2Zmc2V0ICsgMSk7CisgICAgbUJ1ZmZlclttT2Zmc2V0KytdID0gKHVpbnQ4X3QpdmFsdWU7CisgICAgaWYgKG1QYWNrZXRTaXplIDwgbU9mZnNldCkKKyAgICAgICAgb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V0SW50OCgqdmFsdWVzKyspOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50OChjb25zdCB1aW50OF90KiB2YWx1ZXMsIGludCBjb3VudCkgeworICAgIHB1dFVJbnQzMihjb3VudCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICBwdXRVSW50OCgqdmFsdWVzKyspOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFJbnQxNihjb25zdCBpbnQxNl90KiB2YWx1ZXMsIGludCBjb3VudCkgeworICAgIHB1dFVJbnQzMihjb3VudCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICBwdXRJbnQxNigqdmFsdWVzKyspOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50MTYoY29uc3QgdWludDE2X3QqIHZhbHVlcywgaW50IGNvdW50KSB7CisgICAgcHV0VUludDMyKGNvdW50KTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHB1dFVJbnQxNigqdmFsdWVzKyspOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50MTYoY29uc3QgVUludDE2TGlzdCogdmFsdWVzKSB7CisgICAgc2l6ZV90IGNvdW50ID0gKHZhbHVlcyA/IHZhbHVlcy0+c2l6ZSgpIDogMCk7CisgICAgcHV0VUludDMyKGNvdW50KTsKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHB1dFVJbnQxNigoKnZhbHVlcylbaV0pOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFJbnQzMihjb25zdCBpbnQzMl90KiB2YWx1ZXMsIGludCBjb3VudCkgeworICAgIHB1dFVJbnQzMihjb3VudCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICBwdXRJbnQzMigqdmFsdWVzKyspOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50MzIoY29uc3QgdWludDMyX3QqIHZhbHVlcywgaW50IGNvdW50KSB7CisgICAgcHV0VUludDMyKGNvdW50KTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHB1dFVJbnQzMigqdmFsdWVzKyspOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50MzIoY29uc3QgVUludDMyTGlzdCogbGlzdCkgeworICAgIGlmICghbGlzdCkgeworICAgICAgICBwdXRFbXB0eUFycmF5KCk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgc2l6ZV90IHNpemUgPSBsaXN0LT5zaXplKCk7CisgICAgICAgIHB1dFVJbnQzMihzaXplKTsKKyAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBzaXplOyBpKyspCisgICAgICAgICAgICBwdXRVSW50MzIoKCpsaXN0KVtpXSk7CisgICAgfQorfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFJbnQ2NChjb25zdCBpbnQ2NF90KiB2YWx1ZXMsIGludCBjb3VudCkgeworICAgIHB1dFVJbnQzMihjb3VudCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICBwdXRJbnQ2NCgqdmFsdWVzKyspOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50NjQoY29uc3QgdWludDY0X3QqIHZhbHVlcywgaW50IGNvdW50KSB7CisgICAgcHV0VUludDMyKGNvdW50KTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHB1dFVJbnQ2NCgqdmFsdWVzKyspOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dFN0cmluZyhjb25zdCBNdHBTdHJpbmdCdWZmZXImIHN0cmluZykgeworICAgIHN0cmluZy53cml0ZVRvUGFja2V0KHRoaXMpOworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dFN0cmluZyhjb25zdCBjaGFyKiBzKSB7CisgICAgTXRwU3RyaW5nQnVmZmVyIHN0cmluZyhzKTsKKyAgICBzdHJpbmcud3JpdGVUb1BhY2tldCh0aGlzKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRTdHJpbmcoY29uc3QgdWludDE2X3QqIHN0cmluZykgeworICAgIGludCBjb3VudCA9IDA7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAyNTY7IGkrKykgeworICAgICAgICBpZiAoc3RyaW5nW2ldKQorICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHB1dFVJbnQ4KGNvdW50ID4gMCA/IGNvdW50ICsgMSA6IDApOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcHV0VUludDE2KHN0cmluZ1tpXSk7CisgICAgLy8gb25seSB0ZXJtaW5hdGUgd2l0aCB6ZXJvIGlmIHN0cmluZyBpcyBub3QgZW1wdHkKKyAgICBpZiAoY291bnQgPiAwKQorICAgICAgICBwdXRVSW50MTYoMCk7Cit9CisKKyNpZmRlZiBNVFBfREVWSUNFIAoraW50IE10cERhdGFQYWNrZXQ6OnJlYWQoaW50IGZkKSB7CisgICAgLy8gZmlyc3QgcmVhZCB0aGUgaGVhZGVyCisgICAgaW50IHJldCA9IDo6cmVhZChmZCwgbUJ1ZmZlciwgTVRQX0NPTlRBSU5FUl9IRUFERVJfU0laRSk7CisgICAgaWYgKHJldCAhPSBNVFBfQ09OVEFJTkVSX0hFQURFUl9TSVpFKQorICAgICAgICByZXR1cm4gLTE7CisgICAgLy8gdGhlbiB0aGUgZm9sbG93aW5nIGRhdGEKKyAgICBpbnQgdG90YWwgPSBNdHBQYWNrZXQ6OmdldFVJbnQzMihNVFBfQ09OVEFJTkVSX0xFTkdUSF9PRk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QUlORVJfTEVOR1RIX09GRlNFVCk7CisgICAgICAgIHdoaWxlICh0b3RhbExlbmd0aCA+IGxlbmd0aCkgeworICAgICAgICAgICAgYWxsb2NhdGUobGVuZ3RoICsgbUFsbG9jYXRpb25JbmNyZW1lbnQpOworICAgICAgICAgICAgaW50IHJldCA9IHRyYW5zZmVyKGVwLCBtQnVmZmVyICsgbGVuZ3RoLCBtQWxsb2NhdGlvbkluY3JlbWVudCk7CisgICAgICAgICAgICBpZiAocmV0ID49IDApCisgICAgICAgICAgICAgICAgbGVuZ3RoICs9IHJldDsKKyAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgIGxlbmd0aCA9IHJldDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAobGVuZ3RoID49IDApCisgICAgICAgIG1QYWNrZXRTaXplID0gbGVuZ3RoOworICAgIHJldHVybiBsZW5ndGg7Cit9CisKK2ludCBNdHBEYXRhUGFja2V0OjpyZWFkRGF0YShzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcCwgdm9pZCogYnVmZmVyLCBpbnQgbGVuZ3RoKSB7CisgICAgaW50IHBhY2tldFNpemUgPSB1c2JfZW5kcG9pbnRfbWF4X3BhY2tldChlcCk7CisgICAgaW50IHJlYWQgPSAwOworICAgIHdoaWxlIChyZWFkIDwgbGVuZ3RoKSB7CisgICAgICAgIGludCByZXQgPSB0cmFuc2ZlcihlcCwgKGNoYXIgKilidWZmZXIgKyByZWFkLCBwYWNrZXRTaXplKTsKKyAgICAgICAgaWYgKHJldCA8IDApIHsKK3ByaW50ZigiTXRwRGF0YVBhY2tldDo6cmVhZERhdGEgcmV0dXJuaW5nICVkXG4iLCByZXQpOworICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgfQorICAgICAgICByZWFkICs9IHJldDsKKyAgICB9CitwcmludGYoIk10cERhdGFQYWNrZXQ6OnJlYWREYXRhIHJldHVybm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ICBpbnQgcmV0ID0gdHJhbnNmZXIoZXAsIG1CdWZmZXIsIE1UUF9DT05UQUlORVJfSEVBREVSX1NJWkUpOworICAgIGlmIChyZXQgPT0gTVRQX0NPTlRBSU5FUl9IRUFERVJfU0laRSkKKyAgICAgICAgcmV0ID0gdHJhbnNmZXIoZXAsIG1CdWZmZXIgKyBNVFBfQ09OVEFJTkVSX0hFQURFUl9TSVpFLAorICAgICAgICAgICAgICAgICAgICAgICAgbVBhY2tldFNpemUgLSBNVFBfQ09OVEFJTkVSX0hFQURFUl9TSVpFKTsKKyAgICByZXR1cm4gKHJldCA8IDAgPyByZXQgOiAwKTsKK30KKworaW50IE10cERhdGFQYWNrZXQ6OndyaXRlKHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwLCB2b2lkKiBidWZmZXIsIHVpbnQzMl90IGxlbmd0aCkgeworICAgIGludCByZXQgPSAwOworICAgIGludCBwYWNrZXRTaXplID0gdXNiX2VuZHBvaW50X21heF9wYWNrZXQoZXApOworICAgIHdoaWxlIChsZW5ndGggPiAwKSB7CisgICAgICAgIGludCB3cml0ZSA9IChsZW5ndGggPiBwYWNrZXRTaXplID8gcGFja2V0U2l6ZSA6IGxlbmd0aCk7CisgICAgICAgIGludCByZXQgPSB0cmFuc2ZlcihlcCwgYnVmZmVyLCB3cml0ZSk7CisgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGxlbmd0aCAtPSByZXQ7CisgICAgfQorICAgIHJldHVybiAocmV0IDwgMCA/IHJldCA6IDApOworfQorCisjZW5kaWYgLy8gTVRQX0hPU1QKKwordm9pZCogTXRwRGF0YVBhY2tldDo6Z2V0RGF0YShpbnQmIG91dExlbmd0aCkgY29uc3QgeworICAgIGludCBsZW5ndGggPSBtUGFja2V0U2l6ZSAtIE1UUF9DT05UQUlORVJfSEVBREVSX1NJWkU7CisgICAgaWYgKGxlbmd0aCA+IDApIHsKKyAgICAgICAgdm9pZCogcmVzdWx0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ciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCisjaWZuZGVmIF9NVFBfREFUQV9QQUNLRVRfSAorI2RlZmluZSBfTVRQX0RBVEFfUEFDS0VUX0gKKworI2luY2x1ZGUgIk10cFBhY2tldC5oIgorI2luY2x1ZGUgIm10cC5oIgorCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK2NsYXNzIE10cFN0cmluZ0J1ZmZlcjsKKworY2xhc3MgTXRwRGF0YVBhY2tldCA6IHB1YmxpYyBNdHBQYWNrZXQgeworcHJpdmF0ZToKKyAgICAvLyBjdXJyZW50IG9mZnNldCBmb3IgZ2V0L3B1dCBtZXRob2RzCisgICAgaW50ICAgICAgICAgICAgICAgICBtT2Zmc2V0OworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0KCk7CisgICAgdmlydHVhbCAgICAgICAgICAgICB+TXRwRGF0YVBhY2tldCgpOworCisgICAgdmlydHVhbCB2b2lkICAgICAgICByZXNldCgpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRPcGVyYXRpb25Db2RlKE10cE9wZXJhdGlvbkNvZGUgY29kZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRUcmFuc2FjdGlvbklEKE10cFRyYW5zYWN0aW9uSUQgaWQpOworCisgICAgaW5saW5lIHVpbnQ4X3QgICAgICBnZXRVSW50OCgpIHsgcmV0dXJuICh1aW50OF90KW1CdWZmZXJbbU9mZnNldCsrXTsgfQorICAgIGlubGluZSBpbnQ4X3QgICAgICAgZ2V0SW50OCgpIHsgcmV0dXJuIChpbnQ4X3QpbUJ1ZmZlclttT2Zmc2V0KytdOyB9CisgICAgdWludDE2X3QgICAgICAgICAgICBnZXRVSW50MTYoKTsKKyAgICBpbmxpbmUgaW50MTZfdCAgICAgIGdldEludDE2KCkgeyByZXR1cm4gKGludDE2X3QpZ2V0VUludDE2KCk7IH0KKyAgICB1aW50MzJfdCAgICAgICAgICAgIGdldFVJbnQzMigpOworICAgIGlubGluZSBpbnQzMl90ICAgICAgZ2V0SW50MzIoKSB7IHJldHVybiAoaW50MzJfdClnZXRVSW50MzIoKTsgfQorICAgIHVpbnQ2NF90ICAgICAgICAgICAgZ2V0VUludDY0KCk7CisgICAgaW5saW5lIGludDY0X3QgICAgICBnZXRJbnQ2NCgpIHsgcmV0dXJuIChpbnQ2NF90KWdldFVJbnQ2NCgpOyB9CisgICAgdm9pZCAgICAgICAgICAgICAgICBnZXRVSW50MTI4KHVpbnQxMjhfdCYgdmFsdWUpOworICAgIGlubGluZSB2b2lkICAgICAgICAgZ2V0SW50MTI4KGludDEyOF90JiB2YWx1ZSkgeyBnZXRVSW50MTI4KCh1aW50MTI4X3QmKXZhbHVlKTsgfQorICAgIHZvaWQgICAgICAgICAgICAgICAgZ2V0U3RyaW5nKE10cFN0cmluZ0J1ZmZlciYgc3RyaW5nKTsKKworICAgIEludDhMaXN0KiAgICAgICAgICAgZ2V0QUludDgoKTsKKyAgICBVSW50OExpc3QqICAgICAgICAgIGdldEFVSW50OCgpOworICAgIEludDE2TGlzdCogICAgICAgICAgZ2V0QUludDE2KCk7CisgICAgVUludDE2TGlzdCogICAgICAgICBnZXRBVUludDE2KCk7CisgICAgSW50MzJMaXN0KiAgICAgICAgICBnZXRBSW50MzIoKTsKKyAgICBVSW50MzJMaXN0KiAgICAgICAgIGdldEFVSW50MzIoKTsKKyAgICBJbnQ2NExpc3QqICAgICAgICAgIGdldEFJbnQ2NCgpOworICAgIFVJbnQ2NExpc3QqICAgICAgICAgZ2V0QVVJbnQ2NCgpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRJbnQ4KGludDhfdCB2YWx1ZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50OCh1aW50OF90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEludDE2KGludDE2X3QgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0VUludDE2KHVpbnQxNl90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEludDMyKGludDMyX3QgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0VUludDMyKHVpbnQzMl90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEludDY0KGludDY0X3QgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0VUludDY0KHVpbnQ2NF90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEludDEyOChjb25zdCBpbnQxMjhfdCYgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0VUludDEyOChjb25zdCB1aW50MTI4X3QmIHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEludDEyOChpbnQ2NF90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFVJbnQxMjgodWludDY0X3QgdmFsdWUpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBSW50OChjb25zdCBpbnQ4X3QqIHZhbHVlcywgaW50IGNvdW50KTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFVSW50OChjb25zdCB1aW50OF90KiB2YWx1ZXMsIGludCBjb3VudCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBSW50MTYoY29uc3QgaW50MTZfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQxNihjb25zdCB1aW50MTZfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQxNihjb25zdCBVSW50MTZMaXN0KiB2YWx1ZXMpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QUludDMyKGNvbnN0IGludDMyX3QqIHZhbHVlcywgaW50IGNvdW50KTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFVSW50MzIoY29uc3QgdWludDMyX3QqIHZhbHVlcywgaW50IGNvdW50KTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFVSW50MzIoY29uc3QgVUludDMyTGlzdCogbGlzdCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBSW50NjQoY29uc3QgaW50NjRfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQ2NChjb25zdCB1aW50NjRfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0U3RyaW5nKGNvbnN0IE10cFN0cmluZ0J1ZmZlciYgc3RyaW5nKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFN0cmluZyhjb25zdCBjaGFyKiBzdHJpbmcpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0U3RyaW5nKGNvbnN0IHVpbnQxNl90KiBzdHJpbmcpOworICAgIGlubGluZSB2b2lkICAgICAgICAgcHV0RW1wdHlTdHJpbmcoKSB7IHB1dFVJbnQ4KDApOyB9CisgICAgaW5saW5lIHZvaWQgICAgICAgICBwdXRFbXB0eUFycmF5KCkgeyBwdXRVSW50MzIoMCk7IH0KKworCisjaWZkZWYgTVRQX0RFVklDRQorICAgIC8vIGZpbGwgb3VyIGJ1ZmZlciB3aXRoIGRhdGEgZnJvbSB0aGUgZ2l2ZW4gZmlsZSBkZXNjcmlwdG9yCisgICAgaW50ICAgICAgICAgICAgICAgICByZWFkKGludCBmZCk7CisgICAgaW50ICAgICAgICAgICAgICAgICByZWFkRGF0YUhlYWRlcihpbnQgZmQpOworCisgICAgLy8gd3JpdGUgb3VyIGRhdGEgdG8gdGhlIGdpdmVuIGZpbGUgZGVzY3JpcHRvcgorICAgIGludCAgICAgICAgICAgICAgICAgd3JpdGUoaW50IGZkKTsKKyAgICBpbnQgICAgICAgICAgICAgICAgIHdyaXRlRGF0YUhlYWRlcihpbnQgZmQsIHVpbnQzMl90IGxlbmd0aCk7CisjZW5kaWYKKworI2lmZGVmIE1UUF9IT1NUCisgICAgaW50ICAgICAgICAgICAgICAgICByZWFkKHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwKTsKKyAgICBpbnQgICAgICAgICAgICAgICAgIHJlYWREYXRhKHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwLCB2b2lkKiBidWZmZXIsIGludCBsZW5ndGgpOworICAgIGludCAgICAgICAgICAgICAgICAgcmVhZERhdGFIZWFkZXIoc3RydWN0IHVzYl9lbmRwb2ludCAqZXApOworCisgICAgaW50ICAgICAgICAgICAgICAgICB3cml0ZURhdGFIZWFkZXIoc3RydWN0IHVzYl9lbmRwb2ludCAqZXAsIHVpbnQzMl90IGxlbmd0aCk7CisgICAgaW50ICAgICAgICAgICAgICAgICB3cml0ZShzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcCk7CisgICAgaW50ICAgICAgICAgICAgICAgICB3cml0ZShzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcCwgdm9pZCogYnVmZmVyLCB1aW50MzJfdCBsZW5ndGgpOworI2VuZGlmCisKKyAgICBpbmxpbmUgYm9vbCAgICAgICAgIGhhc0RhdGEoKSBjb25zdCB7IHJldHVybiBtUGFja2V0U2l6ZSA+IE1UUF9DT05UQUlORVJfSEVBREVSX1NJWkU7IH0KKyAgICB2b2lkKiAgICAgICAgICAgICAgIGdldERhdGEoaW50JiBvdXRMZW5ndGgpIGNvbnN0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zc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCisjaWZuZGVmIF9NVFBfREFUQUJBU0VfSAorI2RlZmluZSBfTVRQX0RBVEFCQVNFX0gKKworI2luY2x1ZGUgIk10cFR5cGVzLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgTXRwRGF0YVBhY2tldDsKK2NsYXNzIE10cFByb3BlcnR5OworCitjbGFzcyBNdHBEYXRhYmFzZSB7CitwdWJsaWM6CisgICAgdmlydHVhbCB+TXRwRGF0YWJhc2UoKSB7fQorCisgICAgLy8gY2FsbGVkIGZyb20gU2VuZE9iamVjdEluZm8gdG8gcmVzZXJ2ZSBhIGRhdGFiYXNlIGVudHJ5IGZvciB0aGUgaW5jb21pbmcgZmlsZQorICAgIHZpcnR1YWwgTXRwT2JqZWN0SGFuZGxlICAgICAgICAgYmVnaW5TZW5kT2JqZWN0KGNvbnN0IGNoYXIqIHBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBwYXJlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2VJRCBzdG9yYWdlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50NjRfdCBzaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lX3QgbW9kaWZpZWQpID0gMDsKKworICAgIC8vIGNhbGxlZCB0byByZXBvcnQgc3VjY2VzcyBvciBmYWlsdXJlIG9mIHRoZSBTZW5kT2JqZWN0IGZpbGUgdHJhbnNmZXIKKyAgICAvLyBzdWNjZXNzIHNob3VsZCBzaWduYWwgYSBub3RpZmljYXRpb24gb2YgdGhlIG5ldyBvYmplY3QncyBjcmVhdGlvbiwKKyAgICAvLyBmYWlsdXJlIHNob3VsZCByZW1vdmUgdGhlIGRhdGFiYXNlIGVudHJ5IGNyZWF0ZWQgaW4gYmVnaW5TZW5kT2JqZWN0CisgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgICAgICAgICBlbmRTZW5kT2JqZWN0KGNvbnN0IGNoYXIqIHBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgc3VjY2VlZGVkKSA9IDA7CisKKyAgICB2aXJ0dWFsIE10cE9iamVjdEhhbmRsZUxpc3QqICAgIGdldE9iamVjdExpc3QoTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCkgPSAwOworCisgICAgdmlydHVhbCBpbnQgICAgICAgICAgICAgICAgICAgICBnZXROdW1PYmplY3RzKE10cFN0b3JhZ2VJRCBzdG9yYWdlSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBwYXJlbnQpID0gMDsKKworICAgIC8vIGNhbGxlZSBzaG91bGQgZGVsZXRlW10gdGhlIHJlc3VsdHMgZnJvbSB0aGVzZQorICAgIC8vIHJlc3VsdHMgY2FuIGJlIE5VTEwKKyAgICB2aXJ0dWFsIE10cE9iamVjdEZvcm1hdExpc3QqICAgIGdldFN1cHBvcnRlZFBsYXliYWNrRm9ybWF0cygpID0gMDsKKyAgICB2aXJ0dWFsIE10cE9iamVjdEZvcm1hdExpc3QqICAgIGdldFN1cHBvcnRlZENhcHR1cmVGb3JtYXRzKCkgPSAwOworICAgIHZpcnR1YWwgTXRwT2JqZWN0UHJvcGVydHlMaXN0KiAgZ2V0U3VwcG9ydGVkT2JqZWN0UHJvcGVydGllcyhNdHBPYmplY3RGb3JtYXQgZm9ybWF0KSA9IDA7CisgICAgdmlydHVhbCBNdHBEZXZpY2VQcm9wZXJ0eUxpc3QqICBnZXRTdXBwb3J0ZWREZXZpY2VQcm9wZXJ0aWVzKCkgPSAwOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RQcm9wZXJ0eVZhbHVlKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdFByb3BlcnR5IHByb3BlcnR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpID0gMDsKKworICAgIHZpcnR1YWwgTXRwUmVzcG9uc2VDb2RlICAgICAgICAgc2V0T2JqZWN0UHJvcGVydHlWYWx1ZShNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RQcm9wZXJ0eSBwcm9wZXJ0eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldCYgcGFja2V0KSA9IDA7CisKKyAgICB2aXJ0dWFsIE10cFJlc3BvbnNlQ29kZSAgICAgICAgIGdldERldmljZVByb3BlcnR5VmFsdWUoTXRwRGV2aWNlUHJvcGVydHkgcHJvcGVydHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQmIHBhY2tldCkgPSAwOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBzZXREZXZpY2VQcm9wZXJ0eVZhbHVlKE10cERldmljZVByb3BlcnR5IHByb3BlcnR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpID0gMDsKKworICAgIHZpcnR1YWwgTXRwUmVzcG9uc2VDb2RlICAgICAgICAgcmVzZXREZXZpY2VQcm9wZXJ0eShNdHBEZXZpY2VQcm9wZXJ0eSBwcm9wZXJ0eSkgPSAwOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RJbmZvKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQmIHBhY2tldCkgPSAwOworCisgICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RGaWxlUGF0aChNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBTdHJpbmcmIGZpbGVQYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ2NF90JiBmaWxlTGVuZ3RoKSA9IDA7CisKKyAgICB2aXJ0dWFsIE10cFJlc3BvbnNlQ29kZSAgICAgICAgIGRlbGV0ZUZpbGUoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSkgPSAwOworCisgICAgdmlydHVhbCBNdHBPYmplY3RIYW5kbGVMaXN0KiAgICBnZXRPYmplY3RSZWZlcmVuY2VzKE10cE9iamVjdEhh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Uk1BVF9FWEVDVVRBQkxFIiwgICAgICAgICAgICAgICAgICAgICAgMHgzMDAzIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9URVhUIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA0IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9IVE1MIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA1IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9EUE9GIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA2IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BSUZGIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA3IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9XQVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA4IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9NUDMiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA5IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BVkkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDBBIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9NUEVHIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDBCIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BU0YiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDBDIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9ERUZJTkVEIiwgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODAwIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9FWElGX0pQRUciLCAgICAgICAgICAgICAgICAgICAgICAgMHgzODAxIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9USUZGX0VQIiwgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODAyIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9GTEFTSFBJWCIsICAgICAgICAgICAgICAgICAgICAgICAgMHgzODAzIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9CTVAiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA0IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9DSUZGIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA1IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9HSUYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA3IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9KRklGIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA4IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9DRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA5IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9QSUNUIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBBIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9QTkciLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBCIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9USUZGIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBEIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9USUZGX0lUIiwgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBFIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9KUDIiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBGIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9KUFgiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODEwIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9VTkRFRklORURfRklSTVdBUkUiLCAgICAgICAgICAgICAgMHhCODAyIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9XSU5ET1dTX0lNQUdFX0ZPUk1BVCIsICAgICAgICAgICAgMHhCODgxIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9VTkRFRklORURfQVVESU8iLCAgICAgICAgICAgICAgICAgMHhCOTAwIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9XTUEiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTAxIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9PR0ciLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTAyIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BQUMiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTAzIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BVURJQkxFIiwgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTA0IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9GTEFDIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTA2IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9VTkRFRklORURfVklERU8iLCAgICAgICAgICAgICAgICAgMHhCOTgwIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9XTVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTgxIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9NUDRfQ09OVEFJTkVSIiwgICAgICAgICAgICAgICAgICAgMHhCOTgyIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9NUDIiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTgzIH0sCisgICAgeyAiTVRQX0ZPUk1BVF8zR1BfQ09OVEFJTkVSIiwgICAgICAgICAgICAgICAgICAgMHhCOTg0IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9VTkRFRklORURfQ09MTEVDVElPTiIsICAgICAgICAgICAgMHhCQTAwIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BQlNUUkFDVF9NVUxUSU1FRElBX0FMQlVNIiwgICAgICAgMHhCQTAxIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BQlNUUkFDVF9JTUFHRV9BTEJVTSIsICAgICAgICAgICAgMHhCQTAyIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BQlNUUkFDVF9BVURJT19BTEJVTS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IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9VTkRFRklORURfRE9DVU1FTlQiLCAgICAgICAgICAgICAgMHhCQTgwIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BQlNUUkFDVF9ET0NVTUVOVCIsICAgICAgICAgICAgICAgMHhCQTgxIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9YTUxfRE9DVU1FTlQiLCAgICAgICAgICAgICAgICAgICAgMHhCQTgyIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9NU19XT1JEX0RPQ1VNRU5UIiwgICAgICAgICAgICAgICAgMHhCQTgzIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9NSFRfQ09NUElMRURfSFRNTF9ET0NVTUVOVCIsICAgICAgMHhCQTg0IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9NU19FWENFTF9TUFJFQURTSEVFVCIsICAgICAgICAgICAgMHhCQTg1IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9NU19QT1dFUlBPSU5UX1BSRVNFTlRBVElPTiIsICAgICAgMHhCQTg2IH0sCisgICAgeyAiTVRQX0ZPUk1BVF9VTkRFRklORURfTUVTU0FHRSIsICAgICAgICAgICAgICAgMHhCQjAwIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BQlNUUkFDVF9NRVNTU0FHRSIsICAgICAgICAgICAgICAgMHhCQjAxIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9VTkRFRklORURfQ09OVEFDVCIsICAgICAgICAgICAgICAgMHhCQjgwIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9BQlNUUkFDVF9DT05UQUNUIiwgICAgICAgICAgICAgICAgMHhCQjgxIH0sCisgICAgeyAiTVRQX0ZPUk1BVF9WQ0FSRF8yIiwgICAgICAgICAgICAgICAgICAgICAgICAgMHhCQjgyIH0sCisgICAgeyAwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgIH0sCit9OworCitzdGF0aWMgY29uc3QgQ29kZUVudHJ5IHNPYmplY3RQcm9wQ29kZXNbXSA9IHsKKyAgICB7ICJNVFBfUFJPUEVSVFlfU1RPUkFHRV9JRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfT0JKRUNUX0ZPUk1BVCIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUFJPVEVDVElPTl9TVEFUVVMiLCAgICAgICAgICAgICAgICAgICAgICAweERDMDMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfT0JKRUNUX1NJWkUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQVNTT0NJQVRJT05fVFlQRSIsICAgICAgICAgICAgICAgICAgICAgICAweERDMDUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQVNTT0NJQVRJT05fREVTQyIsICAgICAgICAgICAgICAgICAgICAgICAweERDMDYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfT0JKRUNUX0ZJTEVfTkFNRSIsICAgICAgICAgICAgICAgICAgICAgICAweERDMDcgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfREFURV9DUkVBVEVEIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDggfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfREFURV9NT0RJRklFRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDkgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfS0VZV09SRFMiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEFSRU5UX09CSkVDVCIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUxMT1dFRF9GT0xERVJfQ09OVEVOVFMiLCAgICAgICAgICAgICAgICAweERDMEMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfSElEREVOIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU1lTVEVNX09CSkVDVCIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEVSU0lTVEVOVF9VSUQiLCAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU1lOQ19JRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUFJPUEVSVFlfQkFHIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTkFNRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQ1JFQVRFRF9CWSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQVJUSVNUIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfREFURV9BVVRIT1JFRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDcgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfREVTQ1JJUFRJT04iLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDggfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVVJMX1JFRkVSRU5DRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDkgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTEFOR1VBR0VfTE9DQUxFIiwgICAgICAgICAgICAgICAgICAgICAgICAweERDNEEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQ09QWVJJR0hUX0lORk9STUFUSU9OIiwgICAgICAgICAgICAgICAgICAweERDNEIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU09VUkNFIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNEMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfT1JJR0lOX0xPQ0FUSU9OIiwgICAgICAgICAgICAgICAgICAgICAgICAweERDNEQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfREFURV9BRERFRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNEUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTk9OX0NPTlNVTUFCTEUiLCAgICAgICAgICAgICAgICAgICAgICAgICAweERDNEYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQ09SUlVQVF9VTlBMQVlBQkxFIiwgICAgICAgICAgICAgICAgICAgICAweERDNTAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUFJPRFVDRVJfU0VSSUFMX05VTUJFUiIsICAgICAgICAgICAgICAgICAweERDNTEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX0ZPUk1BVCIsICAgICAgICAgICAweERDODEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX1NJWkUiLCAgICAgICAgICAgICAweERDODIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX0hFSUdIVCIsICAgICAgICAgICAweERDODMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX1dJRFRIIiwgICAgICAgICAgICAweERDODQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX0RVUkFUSU9OIiwgICAgICAgICAweERDODUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX0RBVEEiLCAgICAgICAgICAgICAweERDODYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfV0lEVEgiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDODcgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfSEVJR0hUIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDODggfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRFVSQVRJT04iLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDODkgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUkFUSU5HIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVFJBQ0siLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfR0VOUkUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQ1JFRElUUyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTFlSSUNTIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU1VCU0NSSVBUSU9OX0NPTlRFTlRfSUQiLCAgICAgICAgICAgICAgICAweERDOEYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUFJPRFVDRURfQlkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVVNFX0NPVU5UIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU0tJUF9DT1VOVCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTEFTVF9BQ0NFU1NFRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEFSRU5UQUxfUkFUSU5HIiwgICAgICAgICAgICAgICAgICAgICAgICAweERDOTQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTUVUQV9HRU5SRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQ09NUE9TRVIiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRUZGRUNUSVZFX1JBVElORyIsICAgICAgICAgICAgICAgICAgICAgICAweERDOTcgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU1VCVElUTEUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTggfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfT1JJR0lOQUxfUkVMRUFTRV9EQVRFIiwgICAgICAgICAgICAgICAgICAweERDOTkgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUxCVU1fTkFNRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOUEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUxCVU1fQVJUSVNUIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOUIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTU9PRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOUMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRFJNX1NUQVRVUyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOUQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU1VCX0RFU0NSSVBUSU9OIiwgICAgICAgICAgICAgICAgICAgICAgICAweERDOUUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfSVNfQ1JPUFBFRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRDEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfSVNfQ09MT1VSX0NPUlJFQ1RFRCIsICAgICAgICAgICAgICAgICAgICAweERDRDIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfSU1BR0VfQklUX0RFUFRIIiwgICAgICAgICAgICAgICAgICAgICAgICAweERDRDMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRl9OVU1CRVIiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRDQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRVhQT1NVUkVfVElNRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRDUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRVhQT1NVUkVfSU5ERVgiLCAgICAgICAgICAgICAgICAgICAgICAgICAweERDRDYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVE9UQUxfQklUUkFURSIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQklUUkFURV9UWVBFIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU0FNUExFX1JBVEUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTlVNQkVSX09GX0NIQU5ORUxTIiwgICAgICAgICAgICAgICAgICAgICAweERFOTQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQVVESU9fQklUX0RFUFRIIiwgICAgICAgICAgICAgICAgICAgICAgICAweERFOTUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU0NBTl9UWVBFIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTcgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQVVESU9fV0FWRV9DT0RFQyIsICAgICAgICAgICAgICAgICAgICAgICAweERFOTkgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQVVESU9fQklUUkFURSIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOUEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVklERU9fRk9VUkNDX0NPREVDIiwgICAgICAgICAgICAgICAgICAgICAweERFOUIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVklERU9fQklUUkFURSIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOUMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRlJBTUVTX1BFUl9USE9VU0FORF9TRUNPTkRTIiwgICAgICAgICAgICAweERFOUQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfS0VZRlJBTUVfRElTVEFOQ0UiLCAgICAgICAgICAgICAgICAgICAgICAweERFOUUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQlVGRkVSX1NJWkUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOUYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRU5DT0RJTkdfUVVBTElUWSIsICAgICAgICAgICAgICAgICAgICAgICAweERFQTAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRU5DT0RJTkdfUFJPRklMRSIsICAgICAgICAgICAgICAgICAgICAgICAweERFQTEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRElTUExBWV9OQU1FIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRTAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQk9EWV9URVhUIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRTEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU1VCSkVDVCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRTIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUFJJT1JJVFkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRTMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfR0lWRU5fTkFNRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTUlERExFX05BTUVTIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRkFNSUxZX05BTUUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUFJFRklYIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfU1VGRklYIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVUSUNfR0lWRU5fTkFNRSIsICAgICAgICAgICAgICAgICAgICAweEREMDUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVUSUNfRkFNSUxZX05BTUUiLCAgICAgICAgICAgICAgICAgICAweEREMDYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRU1BSUxfUFJJTUFSWSIsICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDcgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRU1BSUxfUEVSU09OQUxfMSIsICAgICAgICAgICAgICAgICAgICAgICAweEREMDggfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRU1BSUxfUEVSU09OQUxfMiIsICAgICAgICAgICAgICAgICAgICAgICAweEREMDkgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRU1BSUxfQlVTSU5FU1NfMSIsICAgICAgICAgICAgICAgICAgICAgICAweEREMEEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRU1BSUxfQlVTSU5FU1NfMiIsICAgICAgICAgICAgICAgICAgICAgICAweEREMEIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRU1BSUxfT1RIRVJTIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMEMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX1BSSU1BUlkiLCAgICAgICAgICAgICAgICAgICAweEREMEQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX1BFUlNPTkFMIiwgICAgICAgICAgICAgICAgICAweEREMEUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX1BFUlNPTkFMXzIiLCAgICAgICAgICAgICAgICAweEREMEYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX0JVU0lORVNTIiwgICAgICAgICAgICAgICAgICAweEREMTAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX0JVU0lORVNTXzIiLCAgICAgICAgICAgICAgICAweEREMTEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX01PQklMRSIsICAgICAgICAgICAgICAgICAgICAweEREMTIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX01PQklMRV8yIiwgICAgICAgICAgICAgICAgICAweEREMTMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRkFYX05VTUJFUl9QUklNQVJZIiwgICAgICAgICAgICAgICAgICAgICAweEREMTQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRkFYX05VTUJFUl9QRVJTT05BTCIsICAgICAgICAgICAgICAgICAgICAweEREMTUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRkFYX05VTUJFUl9CVVNJTkVTUyIsICAgICAgICAgICAgICAgICAgICAweEREMTYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEFHRVJfTlVNQkVSIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMTcgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX09USEVSUyIsICAgICAgICAgICAgICAgICAgICAweEREMTggfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUFJJTUFSWV9XRUJfQUREUkVTUyIsICAgICAgICAgICAgICAgICAgICAweEREMTkgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEVSU09OQUxfV0VCX0FERFJFU1MiLCAgICAgICAgICAgICAgICAgICAweEREMUEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQlVTSU5FU1NfV0VCX0FERFJFU1MiLCAgICAgICAgICAgICAgICAgICAweEREMUIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfSU5TVEFOVF9NRVNTQU5HRVJfQUREUkVTUyIsICAgICAgICAgICAgICAweEREMUMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfSU5TVEFOVF9NRVNTQU5HRVJfQUREUkVTU18yIiwgICAgICAgICAgICAweEREMUQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfSU5TVEFOVF9NRVNTQU5HRVJfQUREUkVTU18zIiwgICAgICAgICAgICAweEREMUUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfUEVSU09OQUxfRlVMTCIsICAgICAgICAgICAweEREMUYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfUEVSU09OQUxfTElORV8xIiwgICAgICAgICAweEREMjAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfUEVSU09OQUxfTElORV8yIiwgICAgICAgICAweEREMjEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfUEVSU09OQUxfQ0lUWSIsICAgICAgICAgICAweEREMjIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERF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ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfTElORV8yIiwgICAgICAgICAgICAweEREMkYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfQ0lUWSIsICAgICAgICAgICAgICAweEREMzAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfUkVHSU9OIiwgICAgICAgICAgICAweEREMzEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfUE9TVEFMX0NPREUiLCAgICAgICAweEREMzIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfQ09VTlRSWSIsICAgICAgICAgICAweEREMzMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfT1JHQU5JWkFUSU9OX05BTUUiLCAgICAgICAgICAgICAgICAgICAgICAweEREMzQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUEhPTkVUSUNfT1JHQU5JWkFUSU9OX05BTUUiLCAgICAgICAgICAgICAweEREMzUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfUk9MRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMzYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQklSVEhEQVRFIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMzcgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTUVTU0FHRV9UTyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENDAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTUVTU0FHRV9DQyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENDEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTUVTU0FHRV9CQ0MiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENDIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTUVTU0FHRV9SRUFEIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENDMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTUVTU0FHRV9SRUNFSVZFRF9USU1FIiwgICAgICAgICAgICAgICAgICAweERENDQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTUVTU0FHRV9TRU5ERVIiLCAgICAgICAgICAgICAgICAgICAgICAgICAweERENDUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfQkVHSU5fVElNRSIsICAgICAgICAgICAgICAgICAgICAweERENTAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfRU5EX1RJTUUiLCAgICAgICAgICAgICAgICAgICAgICAweERENTEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfTE9DQVRJT04iLCAgICAgICAgICAgICAgICAgICAgICAweERENTIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfUkVRVUlSRURfQVRURU5ERUVTIiwgICAgICAgICAgICAweERENTQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfT1BUSU9OQUxfQVRURU5ERUVTIiwgICAgICAgICAgICAweERENTUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfUkVTT1VSQ0VTIiwgICAgICAgICAgICAgICAgICAgICAweERENTYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfQUNDRVBURUQiLCAgICAgICAgICAgICAgICAgICAgICAweERENTcgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfVEVOVEFUSVZFIiwgICAgICAgICAgICAgICAgICAgICAweERENTggfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfREVDTElORUQiLCAgICAgICAgICAgICAgICAgICAgICAweERENTkgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfUkVNQUlOREVSX1RJTUUiLCAgICAgICAgICAgICAgICAweERENUEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfT1dORVIiLCAgICAgICAgICAgICAgICAgICAgICAgICAweERENUIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQUNUSVZJVFlfU1RBVFVTIiwgICAgICAgICAgICAgICAgICAgICAgICAweERENUMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfT1dORVIiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENUQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfRURJVE9SIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENUUgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfV0VCTUFTVEVSIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENUYgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVVJMX1NPVVJDRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENjAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVVJMX0RFU1RJTkFUSU9OIiwgICAgICAgICAgICAgICAgICAgICAgICAweERENjEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVElNRV9CT09LTUFSSyIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERENjIgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfT0JKRUNUX0JPT0tNQVJLIiwgICAgICAgICAgICAgICAgICAgICAgICAweERENjMgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfQllURV9CT09LTUFSSyIsICAgICAgICAgICAgICAgICAgICAgICAgICAweERENjQgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTEFTVF9CVUlMRF9EQVRFIiwgICAgICAgICAgICAgICAgICAgICAgICAweERENzAgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfVElNRV9UT19MSVZFIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENzEgfSwKKyAgICB7ICJNVFBfUFJPUEVSVFlfTUVESUFfR1VJRCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENzIgfSwKKyAgICB7IDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgfSwKK307CisKK3N0YXRpYyBjb25zdCBDb2RlRW50cnkgc0RldmljZVByb3BDb2Rlc1tdID0geworICAgIHsgIk1UUF9ERVZJQ0VfUFJPUEVSVFlfVU5ERUZJTkVEIiwgICAgICAgICAgICAgICAgICAgICAgIDB4NTAwMCB9LAorICAgIHsgIk1UUF9ERVZJQ0VfUFJPUEVSVFlfQkFUVEVSWV9MRVZFTCIsICAgICAgICAgICAgICAgICAgIDB4NTAwMSB9LAorICAgIHsgIk1UUF9ERVZJQ0VfUFJPUEVSVFlfRlVOQ1RJT05BTF9NT0RFIiwgICAgICAgICAgICAgICAgIDB4NTAwMiB9LAorICAgIHsgIk1UUF9ERVZJQ0VfUFJPUEVSVFlfSU1BR0VfU0laRSIsICAgICAgICAgICAgICAgICAgICAgIDB4NTAwMyB9LAorICAgIHsgIk1UUF9ERVZJQ0VfUFJPUEVSVFlfQ09NUFJFU1NJT05fU0VUVElORyIsICAgICAgICAgICAgIDB4NTAwNCB9LAorICAgIHsgIk1UUF9ERVZJQ0VfUFJPUEVSVFlfV0hJVEVfQkFMQU5DRSIsICAgICAgICAgICAgICAgICAgIDB4NTAwNSB9LAorICAgIHsgIk1UUF9ERVZJQ0VfUFJPUEVSVFlfUkdCX0dBSU4iLCAgICAgICAgICAgICAgICAgICAgICAgIDB4NTAwNiB9LAorICAgIHsgIk1UUF9ERVZJQ0VfUFJPUEVSVFlfRl9OVU1CRVIiLCAgICAgICAgICAgICAgICAgICAgICAgIDB4NTAwNyB9LAorICAgIHsgIk1UUF9ERVZJQ0VfUFJPUEVSVFlfRk9DQUxfTEVOR1RIIiwgICAgICAgICAgICAgICAgIC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UgPHVzYmhvc3QvdXNiaG9zdC5oPgorCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK010cERldmljZTo6TXRwRGV2aWNlKHN0cnVjdCB1c2JfZGV2aWNlKiBkZXZpY2UsIGludCBpbnRlcmZhY2UsCisgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcF9pbiwgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfb3V0LAorICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfaW50cikKKyAgICA6ICAgbURldmljZShkZXZpY2UpLAorICAgICAgICBtSW50ZXJmYWNlKGludGVyZmFjZSksCisgICAgICAgIG1FbmRwb2ludEluKGVwX2luKSwKKyAgICAgICAgbUVuZHBvaW50T3V0KGVwX291dCksCisgICAgICAgIG1FbmRwb2ludEludHIoZXBfaW50ciksCisgICAgICAgIG1EZXZpY2VJbmZvKE5VTEwpLAorICAgICAgICBtSUQodXNiX2RldmljZV9nZXRfdW5pcXVlX2lkKGRldmljZSkpLAorICAgICAgICBtU2Vzc2lvbklEKDApLAorICAgICAgICBtVHJhbnNhY3Rpb25JRCgwKQoreworfQorCitNdHBEZXZpY2U6On5NdHBEZXZpY2UoKSB7CisgICAgY2xvc2UoKTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IG1EZXZpY2VQcm9wZXJ0aWVzLnNpemUoKTsgaSsrKQorICAgICAgICBkZWxldGUgbURldmljZVByb3BlcnRpZXNbaV07Cit9CisKK3ZvaWQgTXRwRGV2aWNlOjppbml0aWFsaXplKCkgeworICAgIG9wZW5TZXNzaW9uKCk7CisgICAgbURldmljZUluZm8gPSBnZXREZXZpY2VJbmZvKCk7CisgICAgaWYgKG1EZXZpY2VJbmZvKSB7CisgICAgICAgIG1EZXZpY2VJbmZvLT5wcmludCgpOworCisgICAgICAgIGlmIChtRGV2aWNlSW5mby0+bURldmljZVByb3BlcnRpZXMpIHsKKyAgICAgICAgICAgIGludCBjb3VudCA9IG1EZXZpY2VJbmZvLT5tRGV2aWNlUHJvcGVydGllcy0+c2l6ZSgpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgTXRwRGV2aWNlUHJvcGVydHkgcHJvcENvZGUgPSAoKm1EZXZpY2VJbmZvLT5tRGV2aWNlUHJvcGVydGllcylbaV07CisgICAgICAgICAgICAgICAgTXRwUHJvcGVydHkqIHByb3BlcnR5ID0gZ2V0RGV2aWNlUHJvcERlc2MocHJvcENvZGUpOworICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0eSkgeworICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eS0+cHJpbnQoKTsKKyAgICAgICAgICAgICAgICAgICAgbURldmljZVByb3BlcnRpZXMucHVzaChwcm9wZXJ0eSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQorCit2b2lkIE10cERldmljZTo6Y2xvc2UoKSB7CisgICAgaWYgKG1EZXZpY2UpIHsKKyAgICAgICAgdXNiX2RldmljZV9yZWxlYXNlX2ludGVyZmFjZShtRGV2aWNlLCBtSW50ZXJmYWNlKTsKKyAgICAgICAgdXNiX2RldmljZV9jbG9zZShtRGV2aWNlKTsKKyAgICAgICAgbURldmljZSA9IE5VTEw7CisgICAgfQorfQorCitjb25zdCBjaGFyKiBNdHBEZXZpY2U6OmdldERldmljZU5hbWUoKSB7CisgICAgaWYgKG1EZXZpY2UpCisgICAgICAgIHJldHVybiB1c2JfZGV2aWNlX2dldF9uYW1lKG1EZXZpY2UpOworICAgIGVsc2UKKyAgICAgICAgcmV0dXJuICI/Pz8iOworfQorCitib29sIE10cERldmljZTo6b3BlblNlc3Npb24oKSB7CisgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1NdXRleCk7CisKKyAgICBtU2Vzc2lvbklEID0gMDsKKyAgICBtVHJhbnNhY3Rpb25JRCA9IDA7CisgICAgTXRwU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ICAgICAgTXRwRGV2aWNlSW5mbyogaW5mbyA9IG5ldyBNdHBEZXZpY2VJbmZvOworICAgICAgICBpbmZvLT5yZWFkKG1EYXRhKTsKKyAgICAgICAgcmV0dXJuIGluZm87CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCitNdHBTdG9yYWdlSURMaXN0KiBNdHBEZXZpY2U6OmdldFN0b3JhZ2VJRHMoKSB7CisgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1NdXRleCk7CisKKyAgICBtUmVxdWVzdC5yZXNldCgpOworICAgIGlmICghc2VuZFJlcXVlc3QoTVRQX09QRVJBVElPTl9HRVRfU1RPUkFHRV9JRFMpKQorICAgICAgICByZXR1cm4gTlVMTDsKKyAgICBpZiAoIXJlYWREYXRhKCkpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIE10cFJlc3BvbnNlQ29kZSByZXQgPSByZWFkUmVzcG9uc2UoKTsKKyAgICBpZiAocmV0ID09IE1UUF9SRVNQT05TRV9PSykgeworICAgICAgICByZXR1cm4gbURhdGEuZ2V0QVVJbnQzMigpOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKworTXRwU3RvcmFnZUluZm8qIE10cERldmljZTo6Z2V0U3RvcmFnZUluZm8oTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCkgeworICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTXV0ZXgpOworCisgICAgbVJlcXVlc3QucmVzZXQoKTsKKyAgICBtUmVxdWVzdC5zZXRQYXJhbWV0ZXIoMSwgc3RvcmFnZUlEKTsKKyAgICBpZiAoIXNlbmRSZXF1ZXN0KE1UUF9PUEVSQVRJT05fR0VUX1NUT1JBR0VfSU5GTykpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIGlmICghcmVhZERhdGEoKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwUmVzcG9uc2VDb2RlIHJldCA9IHJlYWRSZXNwb25zZSgpOworICAgIGlm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tRGF0YS5nZXREYXRhKG91dExlbmd0aCk7CisgICAgICAgIH0KKyAgICB9CisgICAgb3V0TGVuZ3RoID0gMDsKKyAgICByZXR1cm4gTlVMTDsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERldmljZTo6c2VuZE9iamVjdEluZm8oTXRwT2JqZWN0SW5mbyogaW5mbykgeworICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTXV0ZXgpOworCisgICAgbVJlcXVlc3QucmVzZXQoKTsKKyAgICBNdHBPYmplY3RIYW5kbGUgcGFyZW50ID0gaW5mby0+bVBhcmVudDsKKyAgICBpZiAocGFyZW50ID09IDApCisgICAgICAgIHBhcmVudCA9IE1UUF9QQVJFTlRfUk9PVDsKKworICAgIG1SZXF1ZXN0LnNldFBhcmFtZXRlcigxLCBpbmZvLT5tU3RvcmFnZUlEKTsKKyAgICBtUmVxdWVzdC5zZXRQYXJhbWV0ZXIoMiwgaW5mby0+bVBhcmVudCk7CisKKyAgICBtRGF0YS5wdXRVSW50MzIoaW5mby0+bVN0b3JhZ2VJRCk7CisgICAgbURhdGEucHV0VUludDE2KGluZm8tPm1Gb3JtYXQpOworICAgIG1EYXRhLnB1dFVJbnQxNihpbmZvLT5tUHJvdGVjdGlvblN0YXR1cyk7CisgICAgbURhdGEucHV0VUludDMyKGluZm8tPm1Db21wcmVzc2VkU2l6ZSk7CisgICAgbURhdGEucHV0VUludDE2KGluZm8tPm1UaHVtYkZvcm1hdCk7CisgICAgbURhdGEucHV0VUludDMyKGluZm8tPm1UaHVtYkNvbXByZXNzZWRTaXplKTsKKyAgICBtRGF0YS5wdXRVSW50MzIoaW5mby0+bVRodW1iUGl4V2lkdGgpOworICAgIG1EYXRhLnB1dFVJbnQzMihpbmZvLT5tVGh1bWJQaXhIZWlnaHQpOworICAgIG1EYXRhLnB1dFVJbnQzMihpbmZvLT5tSW1hZ2VQaXhXaWR0aCk7CisgICAgbURhdGEucHV0VUludDMyKGluZm8tPm1JbWFnZVBpeE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AgICAgIGluZm8tPm1QYXJlbnQgPSBtUmVzcG9uc2UuZ2V0UGFyYW1ldGVyKDIpOworICAgICAgICAgICAgaW5mby0+bUhhbmRsZSA9IG1SZXNwb25zZS5nZXRQYXJhbWV0ZXIoMyk7CisgICAgICAgICAgICByZXR1cm4gaW5mby0+bUhhbmRsZTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gKE10cE9iamVjdEhhbmRsZSktMTsKK30KKworYm9vbCBNdHBEZXZpY2U6OnNlbmRPYmplY3QoTXRwT2JqZWN0SW5mbyogaW5mbywgaW50IHNyY0ZEKSB7CisgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1NdXRleCk7CisKKyAgICBpbnQgcmVtYWluaW5nID0gaW5mby0+bUNvbXByZXNzZWRTaXplOworICAgIG1SZXF1ZXN0LnJlc2V0KCk7CisgICAgbVJlcXVlc3Quc2V0UGFyYW1ldGVyKDEsIGluZm8tPm1IYW5kbGUpOworICAgIGlmIChzZW5kUmVxdWVzdChNVFBfT1BFUkFUSU9OX1NFTkRfT0JKRUNUKSkgeworICAgICAgICAvLyBzZW5kIGRhdGEgaGVhZGVyCisgICAgICAgIHdyaXRlRGF0YUhlYWRlcihNVFBfT1BFUkFUSU9OX1NFTkRfT0JKRUNULCByZW1haW5pbmcpOworCisgICAgICAgIGNoYXIgYnVmZmVyWzY1NTM2XTsKKyAgICAgICAgd2hpbGUgKHJlbWFpbmluZyA+IDApIHsKKyAgICAgICAgICAgIGludCBjb3VudCA9IHJlYWQoc3JjRkQsIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlcikpOworICAgICAgICAgICAgaWYgKGNvdW50ID4gMCkgeworICAgICAgICAgICAgICAgIGludCB3cml0dGVuID0gbURhdGEud3JpdGUobUVuZHBvaW50T3V0LCBidWZmZXIsIGNvdW50KTsKKyAgICAgICAgICAgICAgICAvLyBGSVhNRSBjaGVjayBlcnJvcgorICAgICAgICAgICAgICAgIHJlbWFpbmluZyAtPSBjb3VudDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgTXRwUmVzcG9uc2VDb2RlIHJldCA9IHJlYWRSZXNwb25zZSgpOworICAgIHJldHVybiAocmVtYWluaW5nID09IDAgJiYgcmV0ID09IE1UUF9SRVNQT05TRV9PSyk7Cit9CisKK2Jvb2wgTXRwRGV2aWNlOjpkZWxldGVPYmplY3QoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSkgeworICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTXV0ZXgpOworCisgICAgbVJlcXVlc3QucmVzZXQoKTsKKyAgICBtUmVxdWVzdC5zZXRQYXJhbWV0ZXIoMSwgaGFuZGxlKTsKKyAgICBpZiAoc2VuZFJlcXVlc3QoTVRQX09QRVJBVElPTl9ERUxFVEVfT0JKRUNUKSkgeworICAgICAgICBNdHBSZXNwb25zZUNvZGUgcmV0ID0gcmVhZFJlc3BvbnNlKCk7CisgICAgICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKQorICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICAgIHJldHVybiBmYWxzZTsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERldmljZTo6Z2V0UGFyZW50KE10cE9iamVjdEhhbmRsZSBoYW5kbGUpIHsKKyAgICBNdHBPYmplY3RJbmZvKiBpbmZvID0gZ2V0T2JqZWN0SW5mbyhoYW5kbGUpOworICAgIGlmIChpbmZvKQorICAgICAgICByZXR1cm4gaW5mby0+bVBhcmVudDsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiAtMTsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERldmljZTo6Z2V0U3RvcmFnZUlEKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpIHsKKyAgICBNdHBPYmplY3RJbmZvKiBpbmZvID0gZ2V0T2JqZWN0SW5mbyhoYW5kbGUpOworICAgIGlmIChpbmZvKQorICAgICAgICByZXR1cm4gaW5mby0+bVN0b3JhZ2VJRDsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiAtMTsKK30KKworTXRwUHJvcGVydHkqIE10cERldmljZTo6Z2V0RGV2aWNlUHJvcERlc2MoTXRwRGV2aWNlUHJvcGVydHkgY29kZSkgeworICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTXV0ZXgpOworCisgICAgbVJlcXVlc3QucmVzZXQoKTsKKyAgICBtUmVxdWVzdC5zZXRQYXJhbWV0ZXIoMSwgY29kZSk7CisgICAgaWYgKCFzZW5kUmVxdWVzdChNVFBfT1BFUkFUSU9OX0dFVF9ERVZJQ0VfUFJPUF9ERVNDKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgaWYgKCFyZWFkRGF0YSgpKQorICAgICAgICByZXR1cm4gTlVMTDsKKyAgICBNdHBSZXNwb25zZUNvZGUgcmV0ID0gcmVhZFJlc3BvbnNlKCk7CisgICAgaWYgKHJldCA9PSBNVFBfUkVTUE9OU0VfT0spIHsKKyAgICAgICAgTXRwUHJvcGVydHkqIHByb3BlcnR5ID0gbmV3IE10cFByb3BlcnR5OworICAgICAgICBwcm9wZXJ0eS0+cmVhZChtRGF0YSk7CisgICAgICAgIHJldHVybiBwcm9wZXJ0eTsKKyAgICB9CisgICAgcmV0dXJuIE5VTEw7Cit9CisKK2NsYXNzIFJlYWRPYmplY3RUaHJlYWQgOiBwdWJsaWMgVGhyZWFkIHsKK3ByaXZhdGU6CisgICAgTXRwRGV2aWNlKiAgICAgICAgICBtRGV2aWNlOworICAgIE10cE9iamVjdEhhbmRsZSAgICAgbUhhbmRsZTsKKyAgICBpbnQgICAgICAgICAgICAgICAgIG1PYmplY3RTaXplOworICAgIHZvaWQqICAgICAgICAgICAgICAgbUluaXRpYWxEYXRhOworICAgIGludCAgICAgICAgICAgICAgICAgbUluaXRpYWxEYXRhTGVuZ3RoOworICAgIGludCAgICAgICAgICAgICAgICAgbUZEOworCitwdWJsaWM6CisgICAgUmVhZE9iamVjdFRocmVhZChNdHBEZXZpY2UqIGRldmljZSwgTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwgaW50IG9iamVjdFNpemUpCisgICAgICAgIDogbURldmljZShkZXZpY2UpLAorICAgICAgICAgIG1IYW5kbGUoaGFuZGxlKSwKKyAgICAgICAgICBtT2JqZWN0U2l6ZShvYmplY3RTaXplKSwKKyAgICAgICAgICBtSW5pdGlhbERhdGEoTlVMTCksCisgICAgICAgICAgbUluaXRpYWxEYXRhTGVuZ3RoKDApCisgICAgeworICAgIH0KKworICAgIHZpcnR1YWwgflJlYWRPYmplY3RUaHJlYWQoKSB7CisgICAgICAgIGlmIChtRkQgPj0gMCkKKyAgICAgICAgICAgIGNsb3NlKG1GRCk7CisgICAgICAgIGZyZWUobUluaXRpYWxEYXRhKTsKKyAgICB9CisKKyAgICAvLyByZXR1cm5zIGZpbGUgZGVzY3JpcHRvcgorICAgIGludCBpbml0KCkgeworICAgICAgICBtRGV2aWNlLT5tUmVxdWVzdC5yZXNldCgpOworICAgICAgICBtRGV2aWNlLT5tUmVxdWVzdC5zZXRQYXJhbWV0ZXIoMSwgbUhhbmRsZSk7CisgICAgICAgIGlmIChtRGV2aWNlLT5zZW5kUmVxdWVzdChNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1QpCisgICAgICAgICAgICAgICAgJiYgbURldmljZS0+bURhdGEucmVhZERhdGFIZWFkZXIobURldmljZS0+bUVuZHBvaW50SW4pKSB7CisKKyAgICAgICAgICAgIC8vIG1EYXRhIHdpbGwgY29udGFpbiBoZWFkZXIgYW5kIHBvc3NpYmx5IHRoZSBiZWdpbm5pbmcgb2YgdGhlIG9iamVjdCBkYXRhCisgICAgICAgICAgICBtSW5pdGlhbERhdGEgPSBtRGV2aWNlLT5tRGF0YS5nZXREYXRhKG1Jbml0aWFsRGF0YUxlbmd0aCk7CisKKyAgICAgICAgICAgIC8vIGNyZWF0ZSBhIHBpcGUgZm9yIHRoZSBjbGllbnQgdG8gcmVhZCBmcm9tCisgICAgICAgICAgICBpbnQgcGlwZWZkWzJdOworICAgICAgICAgICAgaWYgKHBpcGUocGlwZWZkKSA8IDApIHsKKyAgICAgICAgICAgICAgICBMT0dFKCJwaXBlIGZhaWxlZCAoJXMpIiwgc3RyZXJyb3IoZXJybm8pKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1GRCA9IHBpcGVmZFsxXTsKKyAgICAgICAgICAgIHJldHVybiBwaXBlZmRbMF07CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHZpcnR1YWwgYm9vbCB0aHJlYWRMb29wKCkgeworICAgICAgICBpbnQgcmVtYWluaW5nID0gbU9iamVjdFNpemU7CisgICAgICAgIGlmIChtSW5pdGlhbERhdGEpIHsKKyAgICAgICAgICAgIHdyaXRlKG1GRCwgbUluaXRpYWxEYXRhLCBtSW5pdGlhbERhdGFMZW5ndGgpOworICAgICAgICAgICAgcmVtYWluaW5nIC09IG1Jbml0aWFsRGF0YUxlbmd0aDsKKyAgICAgICAgICAgIGZyZWUobUluaXRpYWxEYXRhKTsKKyAgICAgICAgICAgIG1Jbml0aWFsRGF0YSA9IE5VTEw7CisgICAgICAgIH0KKworICAgICAgICBjaGFyIGJ1ZmZlclsxNjM4NF07CisgICAgICAgIHdoaWxlIChyZW1haW5pbmcgPiAwKSB7CisgICAgICAgICAgICBpbnQgcmVhZFNpemUgPSAocmVtYWluaW5nID4gc2l6ZW9mKGJ1ZmZlcikgPyBzaXplb2YoYnVmZmVyKSA6IHJlbWFpbmluZyk7CisgICAgICAgICAgICBpbnQgY291bnQgPSBtRGV2aWNlLT5tRGF0YS5yZWFkRGF0YShtRGV2aWNlLT5tRW5kcG9pbnRJbiwgYnVmZmVyLCByZWFkU2l6ZSk7CisgICAgICAgICAgICBpbnQgd3JpdHRlbjsKKyAgICAgICAgICAgIGlmIChjb3VudCA+PSAwKSB7CisgICAgICAgICAgICAgICAgaW50IHdyaXR0ZW4gPSB3cml0ZShtRkQsIGJ1ZmZlciwgY291bnQpOworICAgICAgICAgICAgICAgIC8vIEZJWE1FIGNoZWNrIGVycm9yCisgICAgICAgICAgICAgICAgcmVtYWluaW5nIC09IGNvdW50OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIE10cFJlc3BvbnNlQ29kZSByZXQgPSBtRGV2aWNlLT5yZWFkUmVzcG9uc2UoKTsKKyAgICAgICAgbURldmljZS0+bU11dGV4LnVubG9jaygpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorfTsKKworICAgIC8vIHJldHVybnMgdGhlIGZpbGUgZGVzY3JpcHRvciBmb3IgYSBwaXBlIHRvIHJlYWQgdGhlIG9iamVjdCdzIGRhdGEKK2ludCBNdHBEZXZpY2U6OnJlYWRPYmplY3QoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwgaW50IG9iamVjdFNpemUpIHsKKyAgICBtTXV0ZXgubG9jaygpOworCisgICAgUmVhZE9iamVjdFRocmVhZCogdGhyZWFkID0gbmV3IFJlYWRPYmplY3RUaHJlYWQodGhpcywgaGFuZGxlLCBvYmplY3RTaXplKTsKKyAgICBpbnQgZmQgPSB0aHJlYWQtPmluaXQoKTsKKyAgICBpZiAoZmQgPCAwKSB7CisgICAgICAgIGRlbGV0ZSB0aHJlYWQ7CisgICAgICAgIG1NdXRleC51bmxvY2soKTsKKyAgICB9IGVsc2UgeworICAgICAgICB0aHJlYWQtPnJ1bigiUmVhZE9iamVjdFRocmVhZCIpOworICAgIH0KKyAgICByZXR1cm4gZmQ7Cit9CisKK2Jvb2wgTXRwRGV2aWNlOjpzZW5kUmVxdWVzdChNdHBPcGVyYXRpb25Db2RlIG9wZXJhdGlvbikgeworICAgIExPR1YoInNlbmRSZXF1ZXN0OiAlc1xuIiwgTXRwRGVidWc6OmdldE9wZXJhdGlvbkNvZGVOYW1lKG9wZXJhdGlvbikpOworICAgIG1SZXF1ZXN0LnNldE9wZXJhdGlvbkNvZGUob3BlcmF0aW9uKTsKKyAgICBpZiAobVRyYW5zYWN0aW9uSUQgPiAwKQorICAgICAgICBtUmVxdWVzdC5zZXRUcmFuc2FjdGlvbklEKG1UcmFuc2FjdGlvbklEKyspOworICAgIGludCByZXQgPSBtUmVxdWVzdC53cml0ZShtRW5kcG9pbnRPdXQpOworICAgIG1SZXF1ZXN0LmR1bXAoKTsKKyAgICByZXR1cm4gKHJldCA+IDApOworfQorCitib29sIE10cERldmljZTo6c2VuZERhdGEoKSB7CisgICAgTE9HVigic2VuZERhdGFcbiIpOworICAgIG1EYXRhLnNldE9wZXJhdGlvbkNvZGUobVJlcXVlc3QuZ2V0T3BlcmF0aW9uQ29kZSgpKTsKKyAgICBtRGF0YS5zZXRUcmFuc2FjdGlvbklEKG1SZXF1ZXN0LmdldFRyYW5zYWN0aW9uSUQoKSk7CisgICAgaW50IHJldCA9IG1EYXRhLndyaXRlKG1FbmRwb2ludE91dCk7CisgICAgbURhdGEuZHVtcCgpOworICAgIHJldHVybiAocmV0ID4gMCk7Cit9CisKK2Jvb2wgTXRwRGV2aWNlOjpyZWFkRGF0YSgpIHsKKyAgICBtRGF0YS5yZXNldCgpOworICAgIGludCByZXQgPSBtRGF0YS5yZWFkKG1FbmRwb2ludEluKTsKKyAgICBMT0dWKCJyZWFkRGF0YSByZXR1cm5lZCAlZFxuIiwgcmV0KTsKKyAgICBpZiAocmV0ID49IE1UUF9DT05UQUlORVJfSEVBREVSX1NJWkUpIHsKKyAgICAgICAgbURhdGEuZHVtcCgpOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisgICAgZWxzZSB7CisgICAgICAgIExPR1YoInJlYWRSZXNwb25zZSBmYWlsZWRcbiIpOworICAgIC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K25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgTXRwRGV2aWNlSW5mbzsKK2NsYXNzIE10cE9iamVjdEluZm87CitjbGFzcyBNdHBTdG9yYWdlSW5mbzsKKworY2xhc3MgTXRwRGV2aWNlIHsKK3ByaXZhdGU6CisgICAgc3RydWN0IHVzYl9kZXZpY2UqICAgICAgbURldmljZTsKKyAgICBpbnQgICAgICAgICAgICAgICAgICAgICBtSW50ZXJmYWNlOworICAgIHN0cnVjdCB1c2JfZW5kcG9pbnQqICAgIG1FbmRwb2ludEluOworICAgIHN0cnVjdCB1c2JfZW5kcG9pbnQqICAgIG1FbmRwb2ludE91dDsKKyAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50KiAgICBtRW5kcG9pbnRJbnRyOworICAgIE10cERldmljZUluZm8qICAgICAgICAgIG1EZXZpY2VJbmZvOworICAgIE10cFByb3BlcnR5TGlzdCAgICAgICAgIG1EZXZpY2VQcm9wZXJ0aWVzOworCisgICAgLy8gYSB1bmlxdWUgSUQgZm9yIHRoZSBkZXZpY2UKKyAgICBpbnQgICAgICAgICAgICAgICAgICAgICBtSUQ7CisKKyAgICAvLyBjdXJyZW50IHNlc3Npb24gSUQKKyAgICBNdHBTZXNzaW9uSUQgICAgICAgICAgICBtU2Vzc2lvbklEOworICAgIC8vIGN1cnJlbnQgdHJhbnNhY3Rpb24gSUQKKyAgICBNdHBUcmFuc2FjdGlvbklEICAgICAgICBtVHJhbnNhY3Rpb25JRDsKKworICAgIE10cFJlcXVlc3RQYWNrZXQgICAgICAgIG1SZXF1ZXN0OworICAgIE10cERhdGFQYWNrZXQgICAgICAgICAgIG1EYXRhOworICAgIE10cFJlc3BvbnNlUGFja2V0ICAgICAgIG1SZXNwb25zZTsKKworICAgIC8vIHRvIGVuc3VyZSBvbmx5IG9uZSBNVFAgdHJhbnNhY3Rpb24gYXQgYSB0aW1lCisgICAgTXV0ZXggICAgICAgICAgICAgICAgICAgbU11dGV4OworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGV2aWNlKHN0cnVjdCB1c2JfZGV2aWNlKiBkZXZpY2UsIGludCBpbnRlcmZhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcF9pbiwgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfb3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfaW50cik7CisgICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfk10cERldmljZSgpOworCisgICAgaW5saW5lIGludCAgICAgICAgICAgICAgZ2V0SUQoKSBjb25zdCB7IHJldHVybiBtSUQ7IH0KKworICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemUoKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICBjbG9zZSgpOworICAgIGNvbnN0IGNoYXIqICAgICAgICAgICAgIGdldERldmljZU5hbWUoKTsKKworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIG9wZW5TZXNzaW9uKCk7CisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgY2xvc2VTZXNzaW9uKCk7CisKKyAgICBNdHBEZXZpY2VJbmZvKiAgICAgICAgICBnZXREZXZpY2VJbmZvKCk7CisgICAgTXRwU3RvcmFnZUlETGlzdCogICAgICAgZ2V0U3RvcmFnZUlEcygpOworICAgIE10cFN0b3JhZ2VJbmZvKiAgICAgICAgIGdldFN0b3JhZ2VJbmZvKE10cFN0b3JhZ2VJRCBzdG9yYWdlSUQpOworICAgIE10cE9iamVjdEhhbmRsZUxpc3QqICAgIGdldE9iamVjdEhhbmRsZXMoTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCk7CisgICAgTXRwT2JqZWN0SW5mbyogICAgICAgICAgZ2V0T2JqZWN0SW5mbyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlKTsKKyAgICB2b2lkKiAgICAgICAgICAgICAgICAgICBnZXRUaHVtYm5haWwoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwgaW50JiBvdXRMZW5ndGgpOworICAgIE10cE9iamVjdEhhbmRsZSAgICAgICAgIHNlbmRPYmplY3RJbmZvKE10cE9iamVjdEluZm8qIGluZm8pOworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIHNlbmRPYmplY3QoTXRwT2JqZWN0SW5mbyogaW5mbywgaW50IHNyY0ZEKTsKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBkZWxldGVPYmplY3QoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSk7CisgICAgTXRwT2JqZWN0SGFuZGxlICAgICAgICAgZ2V0UGFyZW50KE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOworICAgIE10cE9iamVjdEhhbmRsZSAgICAgICAgIGdldFN0b3JhZ2VJRChNdHBPYmplY3RIYW5kbGUgaGFuZGxlKTsKKworICAgIE10cFByb3BlcnR5KiAgICAgICAgICAgIGdldERldmljZVByb3BEZXNjKE10cERldmljZVByb3BlcnR5IGNvZGUpOworCisgICAgLy8gcmV0dXJucyB0aGUgZmlsZSBkZXNjcmlwdG9yIGZvciBhIHBpcGUgdG8gcmVhZCB0aGUgb2JqZWN0J3MgZGF0YQorICAgIGludCAgICAgICAgICAgICAgICAgICAgIHJlYWRPYmplY3QoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwgaW50IG9iamVjdFNpemUpOworCitwcml2YXRlOgorICAgIGZyaWVuZCBjbGFzcyBSZWFkT2JqZWN0VGhyZWFkOworCisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgc2VuZFJlcXVlc3QoTXRwT3BlcmF0aW9uQ29kZSBvcGVyYXRpb24pOworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIHNlbmREYXRhKCk7CisgICAgYm9vbCAgICAgIC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VMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCisjZGVmaW5lIExPR19UQUcgIk10cERldmljZUluZm8iCisKKyNpbmNsdWRlICJNdHBEZWJ1Zy5oIgorI2luY2x1ZGUgIk10cERhdGFQYWNrZXQuaCIKKyNpbmNsdWRlICJNdHBEZXZpY2VJbmZvLmgiCisjaW5jbHVkZSAiTXRwU3RyaW5nQnVmZmVyLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworTXRwRGV2aWNlSW5mbzo6TXRwRGV2aWNlSW5mbygpCisgICAgOiAgIG1TdGFuZGFyZFZlcnNpb24oMCksCisgICAgICAgIG1WZW5kb3JFeHRlbnNpb25JRCgwKSwKKyAgICAgICAgbVZlbmRvckV4dGVuc2lvblZlcnNpb24oMCksCisgICAgICAgIG1WZW5kb3JFeHRlbnNpb25EZXNjKE5VTEwpLAorICAgICAgICBtRnVuY3Rpb25hbENvZGUoMCksCisgICAgICAgIG1PcGVyYXRpb25zKE5VTEwpLAorICAgICAgICBtRXZlbnRzKE5VTEwpLAorICAgICAgICBtRGV2aWNlUHJvcGVydGllcyhOVUxMKSwKKyAgICAgICAgbUNhcHR1cmVGb3JtYXRzKE5VTEwpLAorICAgICAgICBtUGxheWJhY2tGb3JtYXRzKE5VTEwpLAorICAgICAgICBtTWFudWZhY3R1cmVyKE5VTEwpLAorICAgICAgICBtTW9kZWwoTlVMTCksCisgICAgICAgIG1WZXJzaW9uKE5VTEwpLAorICAgICAgICBtU2VyaWFsKE5VTEwpCit7Cit9CisKK010cERldmljZUluZm86On5NdHBEZXZpY2VJbmZvKCkgeworICAgIGlmIChtVmVuZG9yRXh0ZW5zaW9uRGVzYykKKyAgICAgICAgZnJlZShtVmVuZG9yRXh0ZW5zaW9uRGVzYyk7CisgICAgZGVsZXRlIG1PcGVyYXRpb25zOworICAgIGRlbGV0ZSBtRXZlbnRzOworICAgIGRlbGV0ZSBtRGV2aWNlUHJvcGVydGllczsKKyAgICBkZWxldGUgbUNhcHR1cmVGb3JtYXRzOworICAgIGRlbGV0ZSBtUGxheWJhY2tGb3JtYXRzOworICAgIGlmIChtTWFudWZhY3R1cmVyKQorICAgICAgICBmcmVlKG1NYW51ZmFjdHVyZXIpOworICAgIGlmIChtTW9kZWwpCisgICAgICAgIGZyZWUobU1vZGVsKTsKKyAgICBpZiAobVZlcnNpb24pCisgICAgICAgIGZyZWUobVZlcnNpb24pOworICAgIGlmIChtU2VyaWFsKQorICAgICAgICBmcmVlKG1TZXJpYWwpOworfQorCit2b2lkIE10cERldmljZUluZm86OnJlYWQoTXRwRGF0YVBhY2tldCYgcGFja2V0KSB7CisgICAgTXRwU3RyaW5nQnVmZmVyIHN0cmluZzsKKworICAgIC8vIHJlYWQgdGhlIGRldmljZSBpbmZvCisgICAgbVN0YW5kYXJkVmVyc2lvbiA9IHBhY2tldC5nZXRVSW50MTYoKTsKKyAgICBtVmVuZG9yRXh0ZW5zaW9uSUQgPSBwYWNrZXQuZ2V0VUludDMyKCk7CisgICAgbVZlbmRvckV4dGVuc2lvblZlcnNpb24gPSBwYWNrZXQuZ2V0VUludDE2KCk7CisKKyAgICBwYWNrZXQuZ2V0U3RyaW5nKHN0cmluZyk7CisgICAgbVZlbmRvckV4dGVuc2lvbkRlc2MgPSBzdHJkdXAoKGNvbnN0IGNoYXIgKilzdHJpbmcpOworCisgICAgbUZ1bmN0aW9uYWxDb2RlID0gcGFja2V0LmdldFVJbnQxNigpOworICAgIG1PcGVyYXRpb25zID0gcGFja2V0LmdldEFVSW50MTYoKTsKKyAgICBtRXZlbnRzID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IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICovCisKKyNpZm5kZWYgX01UUF9ERVZJQ0VfSU5GT19ICisjZGVmaW5lIF9NVFBfREVWSUNFX0lORk9fSAorCitzdHJ1Y3Qgc3RhdDsKKworbmFtZXNwYWNlIGFuZHJvaWQgeworCitjbGFzcyBNdHBEYXRhUGFja2V0OworCitjbGFzcyBNdHBEZXZpY2VJbmZvIHsKK3B1YmxpYzoKKyAgICB1aW50MTZfdCAgICAgICAgICAgICAgICBtU3RhbmRhcmRWZXJzaW9uOworICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgIG1WZW5kb3JFeHRlbnNpb25JRDsKKyAgICB1aW50MTZfdCAgICAgICAgICAgICAgICBtVmVuZG9yRXh0ZW5zaW9uVmVyc2lvbjsKKyAgICBjaGFyKiAgICAgICAgICAgICAgICAgICBtVmVuZG9yRXh0ZW5zaW9uRGVzYzsKKyAgICB1aW50MTZfdCAgICAgICAgICAgICAgICBtRnVuY3Rpb25hbENvZGU7CisgICAgVUludDE2TGlzdCogICAgICAgICAgICAgbU9wZXJhdGlvbnM7CisgICAgVUludDE2TGlzdCogICAgICAgICAgICAgbUV2ZW50czsKKyAgICBNdHBEZXZpY2VQcm9wZXJ0eUxpc3QqICBtRGV2aWNlUHJvcGVydGllczsKKyAgICBNdHBPYmplY3RGb3JtYXRMaXN0KiAgICBtQ2FwdHVyZUZvcm1hdHM7CisgICAgTXRwT2JqZWN0Rm9ybWF0TGlzdCogICAgbVBsYXliYWNrRm9ybWF0czsKKyAgICBjaGFyKiAgICAgICAgICAgICAgICAgICBtTWFudWZhY3R1cmVyOworICAgIGNoYXIqICAgICAgICAgICAgICAgICAgIG1Nb2RlbDsKKyAgICBjaGFyKiAgICAgICAgICAgICAgICAgICBtVmVyc2lvbjsKKyAgICBjaGFyKiAgICAgICAgICAgICAgICAgICBtU2VyaWFsOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGV2aWNlSW5mbygpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgICAgIH5NdHBEZXZpY2VJbmZvKCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICByZWFkKE10cERhdGFQYWNrZXQmIHBhY2tldCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICBwcmludCgpOworfTsKKworfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKKworI2VuZGlmIC8vIF9NVFBfREVWSUNFX0lORk9fSApkaWZmIC0tZ2l0IGEvbWVkaWEvbXRwL010cEV2ZW50UGFja2V0LmNwcCBiL21lZGlhL210cC9NdHBFdmVudFBhY2tldC5jcHAKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZmM3NDU0MgotLS0gL2Rldi9udWxsCisrKyBiL21lZGlhL210cC9NdHBFdmVudFBhY2tldC5jcHAKQEAgLTAsMCArMSw2NyBAQAorLyoKKyAqIENvcHlyaWdodCAoQykgMjAxMCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0CisgKgorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICoKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBv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HJvdGVjdGlvblN0YXR1cygwKSwKKyAgICAgICAgbUNvbXByZXNzZWRTaXplKDApLAorICAgICAgICBtVGh1bWJGb3JtYXQoMCksCisgICAgICAgIG1UaHVtYkNvbXByZXNzZWRTaXplKDApLAorICAgICAgICBtVGh1bWJQaXhXaWR0aCgwKSwKKyAgICAgICAgbVRodW1iUGl4SGVpZ2h0KDApLAorICAgICAgICBtSW1hZ2VQaXhXaWR0aCgwKSwKKyAgICAgICAgbUltYWdlUGl4SGVpZ2h0KDApLAorICAgICAgICBtSW1hZ2VQaXhEZXB0aCgwKSwKKyAgICAgICAgbVBhcmVudCgwKSwKKyAgICAgICAgbUFzc29jaWF0aW9uVHlwZSgwKSwKKyAgICAgICAgbUFzc29jaWF0aW9uRGVzYygwKSwKKyAgICAgICAgbVNlcXVlbmNlTnVtYmVyKDApLAorICAgICAgICBtTmFtZShOVUxMKSwKKyAgICAgICAgbURhdGVDcmVhdGVkKDApLAorICAgICAgICBtRGF0ZU1vZGlmaWVkKDApLAorICAgICAgICBtS2V5d29yZHMoTlVMTCkKK3sKK30KKworTXRwT2JqZWN0SW5mbzo6fk10cE9iamVjdEluZm8oKSB7CisgICAgaWYgKG1OYW1lKQorICAgICAgICBmcmVlKG1OYW1lKTsKKyAgICBpZiAobUtleXdvcmRzKQorICAgICAgICBmcmVlKG1LZXl3b3Jkcyk7Cit9CisKK3ZvaWQgTXRwT2JqZWN0SW5mbzo6cmVhZChNdHBEYXRhUGFja2V0JiBwYWNrZXQpIHsKKyAgICBNdHBTdHJpbmdCdWZmZXIgc3RyaW5nOworICAgIHRpbWVfdCB0aW1lOworCisgICAgbVN0b3JhZ2VJRCA9IHBhY2tldC5nZXRVSW50MzIoKTsKKyAgICBtRm9ybWF0ID0gcGFja2V0LmdldFVJbnQxNigpOworICAgIG1Qcm90ZWN0aW9uU3RhdHVzID0gcGFja2V0LmdldFVJbnQxNigpOworICAgIG1Db21wcmVzc2VkU2l6ZSA9IHBhY2tldC5nZXRVSW50Mz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gdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCisjaWZuZGVmIF9NVFBfT0JKRUNUX0lORk9fSAorI2RlZmluZSBfTVRQX09CSkVDVF9JTkZPX0gKKworI2luY2x1ZGUgIk10cFR5cGVzLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgTXRwRGF0YVBhY2tldDsKKworY2xhc3MgTXRwT2JqZWN0SW5mbyB7CitwdWJsaWM6CisgICAgTXRwT2JqZWN0SGFuZGxlICAgICBtSGFuZGxlOworICAgIE10cFN0b3JhZ2VJRCAgICAgICAgbVN0b3JhZ2VJRDsKKyAgICBNdHBPYmplY3RGb3JtYXQgICAgIG1Gb3JtYXQ7CisgICAgdWludDE2X3QgICAgICAgICAgICBtUHJvdGVjdGlvblN0YXR1czsKKyAgICB1aW50MzJfdCAgICAgICAgICAgIG1Db21wcmVzc2VkU2l6ZTsKKyAgICBNdHBPYmplY3RGb3JtYXQgICAgIG1UaHVtYkZvcm1hdDsKKyAgICB1aW50MzJfdCAgICAgICAgICAgIG1UaHVtYkNvbXByZXNzZWRTaXplOworICAgIHVpbnQzMl90ICAgICAgICAgICAgbVRodW1iUGl4V2lkdGg7CisgICAgdWludDMyX3QgICAgICAgICAgICBtVGh1bWJQaXhIZWlnaHQ7CisgICAgdWludDMyX3QgICAgICAgICAgICBtSW1hZ2VQaXhXaWR0aDsKKyAgICB1aW50MzJfdCAgICAgICAgICAgIG1JbWFnZVBpeEhlaWdodDsKKyAgICB1aW50MzJfdCAgICAgICAgICAgIG1JbWFnZVBpeERlcHRoOworICAgIE10cE9iamVjdEhhbmRsZSAgICAgbVBhcmVudDsKKyAgICB1aW50MTZfdCAgICAgICAgICAgIG1Bc3NvY2lhdGlvblR5cGU7CisgICAgdWludDMyX3QgICAgICAgICAgICBtQXNzb2NpYXRpb25EZXNjOworICAgIHVpbnQzMl90ICAgICAgICAgICAgbVNlcXVlbmNlTnVtYmVyOworICAgIGNoYXIqICAgICAgICAgICAgICAgbU5hbWU7CisgICAgdGltZV90ICAgICAgICAgICAgICBtRGF0ZUNyZWF0ZWQ7CisgICAgdGltZV90ICAgICAgICAgICAgICBtRGF0ZU1vZGlmaWVkOworICAgIGNoYXIqICAgICAgICAgICAgICAgbUtleXdvcmRzOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RJbmZvKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgfk10cE9iamVjdEluZm8oKTsKKworICAgIHZvaWQgICAgICAgICAgICAgICAgcmVhZChNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICBwcmludCgpOworfTsKKworfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKKworI2VuZGlmIC8vIF9NVFBfT0JKRUNUX0lORk9fSApkaWZmIC0tZ2l0IGEvbWVkaWEvbXRwL010cFBhY2tldC5jcHAgYi9tZWRpYS9tdHAvTXRwUGFja2V0LmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi40MmJmOGJhCi0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvbXRwL010cFBhY2tldC5jcHAKQEAgLTAsMCArMSwxNTQgQEAKKy8qCisgKiBDb3B5cmlnaHQgKEMpIDIwMTAgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91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yAgICAgICAgc3ByaW50ZihidWZwdHIsICIlMDJYICIsIG1CdWZmZXJbaV0pOworICAgICAgICBidWZwdHIgKz0gc3RybGVuKGJ1ZnB0cik7CisgICAgICAgIGlmIChpICUgRFVNUF9CWVRFU19QRVJfUk9XID09IChEVU1QX0JZVEVTX1BFUl9ST1cgLSAxKSkgeworICAgICAgICAgICAgTE9HVigiJXMiLCBidWZmZXIpOworICAgICAgICAgICAgYnVmcHRyID0gYnVmZmVyOworICAgICAgICB9CisgICAgfQorICAgIGlmIChidWZwdHIgIT0gYnVmZmVyKSB7CisgICAgICAgIC8vIHByaW50IGxhc3QgbGluZQorICAgICAgICBMT0dWKCIlcyIsIGJ1ZmZlcik7CisgICAgfQorICAgIExPR1YoIlxuIik7Cit9CisKK3VpbnQxNl90IE10cFBhY2tldDo6Z2V0VUludDE2KGludCBvZmZzZXQpIGNvbnN0IHsKKyAgICByZXR1cm4gKCh1aW50MTZfdCltQnVmZmVyW29mZnNldCArIDFdIDw8IDgpIHwgKHVpbnQxNl90KW1CdWZmZXJbb2Zmc2V0XTsKK30KKwordWludDMyX3QgTXRwUGFja2V0OjpnZXRVSW50MzIoaW50IG9mZnNldCkgY29uc3QgeworICAgIHJldHVybiAoKHVpbnQzMl90KW1CdWZmZXJbb2Zmc2V0ICsgM10gPDwgMjQpIHwgKCh1aW50MzJfdCltQnVmZmVyW29mZnNldCArIDJdIDw8IDE2KSB8CisgICAgICAgICAgICgodWludDMyX3QpbUJ1ZmZlcltvZmZzZXQgKyAxXSA8PCA4KSAgfCAodWludDMyX3QpbUJ1ZmZlcltvZmZzZXRdOworfQorCit2b2lkIE10cFBhY2tldDo6cHV0VUludDE2KGludCBvZmZzZXQsIHVpbnQxNl90IHZhbHVlKSB7CisgICAgbUJ1ZmZlcltvZmZzZXQrK10gPSAodWludDhfdCkodmFsdWUgJiAweEZGKTsKKyAgICBtQnVmZmVyW29mZnNldCsrXSA9ICh1aW50OF90KSgodmFsdWUgPj4gOCkgJiAweEZG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R1bXAoKTsKKworICAgIHVpbnQxNl90ICAgICAgICAgICAgZ2V0Q29udGFpbmVyQ29kZSgpIGNvbnN0OworICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0Q29udGFpbmVyQ29kZSh1aW50MTZfdCBjb2RlKTsKKworICAgIE10cFRyYW5zYWN0aW9uSUQgICAgZ2V0VHJhbnNhY3Rpb25JRCgpIGNvbnN0OworICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0VHJhbnNhY3Rpb25JRChNdHBUcmFuc2FjdGlvbklEIGlkKTsKKworICAgIHVpbnQzMl90ICAgICAgICAgICAgZ2V0UGFyYW1ldGVyKGludCBpbmRleCkgY29uc3Q7CisgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRQYXJhbWV0ZXIoaW50IGluZGV4LCB1aW50MzJfdCB2YWx1ZSk7CisKKyNpZmRlZiBNVFBfSE9TVAorICAgIGludCAgICAgICAgICAgICAgICAgdHJhbnNmZXIoc3RydWN0IHVzYl9lbmRwb2ludCAqZXAsIHZvaWQqIGJ1ZmZlciwgaW50IGxlbmd0aCk7CisjZW5kaWYKKworcHJvdGVjdGVkOgorICAgIHVpbnQxNl90ICAgICAgICAgICAgZ2V0VUludDE2KGludCBvZmZzZXQpIGNvbnN0OworICAgIHVpbnQzMl90ICAgICAgICAgICAgZ2V0VUludDMyKGludCBvZmZzZXQpIGNvbnN0OworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0VUludDE2KGludCBvZmZzZXQsIHVpbnQxNl90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFVJbnQzMihpbnQgb2Zmc2V0LCB1aW50MzJfdCB2YWx1ZSk7Cit9OworCit9OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAorCisjZW5kaWYgLy8gX01UUF9QQUNLRVRfSApkaWZmIC0tZ2l0IGEvbWVkaWEvbXRwL010cFByb3BlcnR5LmNwcCBiL21lZGlhL210cC9NdHBQcm9wZXJ0eS5jcHAKbmV3IG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cnR5LmgiCisjaW5jbHVkZSAiTXRwU3RyaW5nQnVmZmVyLmgiCisjaW5jbHVkZSAiTXRwVXRpbHMuaCIKKworbmFtZXNwYWNlIGFuZHJvaWQgeworCitNdHBQcm9wZXJ0eTo6TXRwUHJvcGVydHkoKQorICAgIDogICBtQ29kZSgwKSwKKyAgICAgICAgbVR5cGUoMCksCisgICAgICAgIG1Xcml0ZWFibGUoZmFsc2UpLAorICAgICAgICBtRGVmYXVsdEFycmF5TGVuZ3RoKDApLAorICAgICAgICBtRGVmYXVsdEFycmF5VmFsdWVzKE5VTEwpLAorICAgICAgICBtQ3VycmVudEFycmF5TGVuZ3RoKDApLAorICAgICAgICBtQ3VycmVudEFycmF5VmFsdWVzKE5VTEwpLAorICAgICAgICBtR3JvdXBDb2RlKDApLAorICAgICAgICBtRm9ybUZsYWcoa0Zvcm1Ob25lKSwKKyAgICAgICAgbUVudW1MZW5ndGgoMCksCisgICAgICAgIG1FbnVtVmFsdWVzKE5VTEwpCit7CisgICAgbWVtc2V0KCZtRGVmYXVsdFZhbHVlLCAwLCBzaXplb2YobURlZmF1bHRWYWx1ZSkpOworICAgIG1lbXNldCgmbUN1cnJlbnRWYWx1ZSwgMCwgc2l6ZW9mKG1DdXJyZW50VmFsdWUpKTsKKyAgICBtZW1zZXQoJm1NaW5pbXVtVmFsdWUsIDAsIHNpemVvZihtTWluaW11bVZhbHVlKSk7CisgICAgbWVtc2V0KCZtTWF4aW11bVZhbHVlLCAwLCBzaXplb2YobU1heGltdW1WYWx1ZSkpOworfQorCitNdHBQcm9wZXJ0eTo6TXRwUHJvcGVydHkoTXRwUHJvcGVydHlDb2RlIHByb3BDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFUeXBlIHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCB3cml0ZWFibGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlZmF1bHRWYWx1ZSkKKyAgICA6ICAgbUNvZGUocHJvcENvZGUpLAorICAgICAgICBtVHlwZSh0eXBlKSwKKyAgICAgICAgbVdyaXRlYWJsZSh3cml0ZWFibGUpLAorICAgICAgICBtRGVmYXVsdEFycmF5TGVuZ3RoKDApLAorICAgICAgICBtRGVmYXVsdEFycmF5VmFsdWVzKE5VTEwpLAorICAgICAgICBtQ3VycmVudEFycmF5TGVuZ3RoKDApLAorICAgICAgICBtQ3VycmVudEFycmF5VmFsdWVzKE5VTEwpLAorICAgICAgICBtR3JvdXBDb2RlKDApLAorICAgICAgICBtRm9ybUZsYWcoa0Zvcm1Ob25lKSwKKyAgICAgICAgbUVudW1MZW5ndGgoMCksCisgICAgICAgIG1FbnVtVmFsdWVzKE5VTEwpCit7CisgICAgbWVtc2V0KCZtRGVmYXVsdFZhbHVlLCAwLCBzaXplb2YobURlZmF1bHRWYWx1ZSkpOworICAgIG1lbXNldCgmbUN1cnJlbnRWYWx1ZSwgMCwgc2l6ZW9mKG1DdXJyZW50VmFsdWUpKTsKKyAgICBtZW1zZXQoJm1NaW5pbXVtVmFsdWUsIDAsIHNpemVvZihtTWluaW11bVZhbHVlKSk7CisgICAgbWVtc2V0KCZtTWF4aW11bVZhbHVlLCAwLCBzaXplb2YobU1heGltdW1WYWx1ZSkpOworCisgICAgaWYgKGRlZmF1bHRWYWx1ZSkgeworICAgICAgICBzd2l0Y2ggKHR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UODoKKyAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLnUuaTggPSBkZWZhdWx0VmFsdWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ4OgorICAgICAgICAgICAgICAgIG1EZWZhdWx0VmFsdWUudS51OCA9IGRlZmF1bHRWYWx1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMTY6CisgICAgICAgICAgICAgICAgbURlZmF1bHRWYWx1ZS51LmkxNiA9IGRlZmF1bHRWYWx1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDE2OgorICAgICAgICAgICAgICAgIG1EZWZhdWx0VmFsdWUudS51MTYgPSBkZWZhdWx0VmFsdWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDMyOgorICAgICAgICAgICAgICAgIG1EZWZhdWx0VmFsdWUudS5pMzIgPSBkZWZhdWx0VmFsdWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQzMjoKKyAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLnUudTMyID0gZGVmYXVsdFZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ2NDoKKyAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLnUuaTY0ID0gZGVmYXVsdFZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UNjQ6CisgICAgICAgICAgICAgICAgbURlZmF1bHRWYWx1ZS51LnU2NCA9IGRlZmF1bHRWYWx1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgTE9HRSgidW5rbm93biB0eXBlICUwNFggaW4gTXRwUHJvcGVydHk6Ok10cFByb3BlcnR5IiwgdHlwZSk7CisgICAgICAgIH0KKyAgICB9Cit9CisKK010cFByb3BlcnR5Ojp+TXRwUHJvcGVydHkoKSB7CisgICAgaWYgKG1UeXBlID09IE1UUF9UWVBFX1NUUikgeworICAgICAgICAvLyBmcmVlIGFsbCBzdHJpbmdzCisgICAgICAgIGZyZWUobURlZmF1bHRWYWx1ZS5zdHIpOworICAgICAgICBmcmVlKG1DdXJyZW50VmFsdWUuc3RyKTsKKyAgICAgICAgZnJlZShtTWluaW11bVZhbHVlLnN0cik7CisgICAgICAgIGZyZWUobU1heGltdW1WYWx1ZS5zdHIpOworICAgICAgICBpZiAobURlZmF1bHRBcnJheVZhbHVlcykgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRGVmYXVsdEFycmF5TGVuZ3RoOyBpKyspCisgICAgICAgICAgICAgICAgZnJlZShtRGVmYXVsdEFycmF5VmFsdWVzW2ldLnN0cik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1DdXJyZW50QXJyYXlWYWx1ZXMpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUN1cnJlbnRBcnJheUxlbmd0aDsgaSsrKQorICAgICAgICAgICAgICAgIGZyZWUobUN1cnJlbnRBcnJheVZhbHVlc1tpXS5zdHIpOworICAgICAgICB9CisgICAgICAgIGlmIChtRW51bVZhbHVlcykgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRW51bUxlbmd0aDsgaSsrKQorICAgICAgICAgICAgICAgIGZyZWUobUVudW1WYWx1ZXNbaV0uc3RyKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBkZWxldGVbXSBtRGVmYXVsdEFycmF5VmFsdWVzOworICAgIGRlbGV0ZVtdIG1DdXJyZW50QXJyYXlWYWx1ZXM7CisgICAgZGVsZXRlW10gbUVudW1WYWx1ZXM7Cit9CisKK3ZvaWQgTXRwUHJvcGVydHk6OnJlYWQoTXRwRGF0YVBhY2tldCYgcGFja2V0KSB7CisgICAgYm9vbCBkZXZpY2VQcm9wID0gaXNEZXZpY2VQcm9wZXJ0eSgpOworCisgICAgbUNvZGUgPSBwYWNrZXQuZ2V0VUludDE2KCk7CisgICAgbVR5cGUgPSBwYWNrZXQuZ2V0VUludDE2KCk7CisgICAgbVdyaXRlYWJsZSA9IChwYWNrZXQuZ2V0VUludDgoKSA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DoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BVUlOVDY0OgorICAgICAgICBjYXNlIE1UUF9UWVBFX0FJTlQxMjg6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQVVJTlQxMjg6CisgICAgICAgICAgICB3cml0ZUFycmF5VmFsdWVzKHBhY2tldCwgbURlZmF1bHRBcnJheVZhbHVlcywgbURlZmF1bHRBcnJheUxlbmd0aCk7CisgICAgICAgICAgICBpZiAoZGV2aWNlUHJvcCkKKyAgICAgICAgICAgICAgICB3cml0ZUFycmF5VmFsdWVzKHBhY2tldCwgbUN1cnJlbnRBcnJheVZhbHVlcywgbUN1cnJlbnRBcnJheUxlbmd0aCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHdyaXRlVmFsdWUocGFja2V0LCBtRGVmYXVsdFZhbHVlKTsKKyAgICAgICAgICAgIGlmIChkZXZpY2VQcm9wKQorICAgICAgICAgICAgICAgIHdyaXRlVmFsdWUocGFja2V0LCBtQ3VycmVudFZhbHVlKTsKKyAgICB9CisgICAgcGFja2V0LnB1dFVJbnQzMihtR3JvdXBDb2RlKTsKKyAgICBpZiAoIWRldmljZVByb3ApCisgICAgICAgIHBhY2tldC5wdXRVSW50OChtRm9ybUZsYWcpOworICAgIGlmIChtRm9ybUZsYWcgPT0ga0Zvcm1SYW5nZSkgeworICAgICAgICAgICAgd3JpdGVWYWx1ZShwYWNrZXQsIG1NaW5pbXVtVmFsdWUpOworICAgICAgICAgICAgd3JpdGVWYWx1ZShwYWNrZXQsIG1NYXhpbXVtVmFsdWUpOworICAgICAgICAgICAgd3JpdGVWYWx1ZShwYWNrZXQsIG1TdGVwU2l6ZSk7CisgICAgfSBlbHNlIGlmIChtRm9ybUZsYWcgPT0ga0Zvcm1FbnVtKSB7CisgICAgICAgIHBhY2tldC5wdXRVSW50MTYobUVudW1MZW5ndGgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1FbnVt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eworICAgIE10cFN0cmluZ0J1ZmZlciBzdHJpbmdCdWZmZXI7CisKKyAgICBzd2l0Y2ggKG1UeXBlKSB7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UODoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BSU5UODoKKyAgICAgICAgICAgIHZhbHVlLnUuaTggPSBwYWNrZXQuZ2V0SW50OCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDg6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQVVJTlQ4OgorICAgICAgICAgICAgdmFsdWUudS51OCA9IHBhY2tldC5nZXRVSW50OCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMTY6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQUlOVDE2OgorICAgICAgICAgICAgdmFsdWUudS5pMTYgPSBwYWNrZXQuZ2V0SW50MTYoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQxNjoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BVUlOVDE2OgorICAgICAgICAgICAgdmFsdWUudS51MTYgPSBwYWNrZXQuZ2V0VUludDE2KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQzMjoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BSU5UMzI6CisgICAgICAgICAgICB2YWx1ZS51LmkzMiA9IHBhY2tldC5nZXRJbnQzMigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDMyOgorICAgICAgICBjYXNlIE1UUF9UWVBFX0FVSU5UMzI6CisgICAgICAgICAgICB2YWx1ZS51LnUzMiA9IHBhY2tldC5nZXRVSW50MzIoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDY0OgorICAgICAgICBjYXNlIE1UUF9UWVBFX0FJTlQ2NDoKKyAgICAgICAgICAgIHZhbHVlLnUuaTY0ID0gcGFja2V0LmdldEludDY0KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UNjQ6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQVVJTlQ2NDoKKyAgICAgICAgICAgIHZhbHVlLnUudTY0ID0gcGFja2V0LmdldFVJbnQ2NCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMTI4OgorICAgICAgICBjYXNlIE1UUF9UWVBFX0FJTlQxMjg6CisgICAgICAgICAgICBwYWNrZXQuZ2V0SW50MTI4KHZhbHVlLnUuaTEyOCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMTI4OgorICAgICAgICBjYXNlIE1UUF9UWVBFX0FVSU5UMTI4OgorICAgICAgICAgICAgcGFja2V0LmdldFVJbnQxMjgodmFsdWUudS51MTI4KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1NUUjoKKyAgICAgICAgICAgIHBhY2tldC5nZXRTdHJpbmcoc3RyaW5nQnVmZmVyKTsKKyAgICAgICAgICAgIHZhbHVlLnN0ciA9IHN0cmR1cChzdHJpbmdCdWZmZXIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBMT0dFKCJ1bmtub3duIHR5cGUgJTA0WCBpbiBNdHBQcm9wZXJ0eTo6cmVhZFZhbHVlIiwgbVR5cGUpOworICAgIH0KK30KKwordm9pZCBNdHBQcm9wZXJ0eTo6d3JpdGVWYWx1ZShNdHBEYXRhUGFja2V0JiBwYWNrZXQsIE10cFByb3BlcnR5VmFsdWUmIHZhbHVlKSB7CisgICAgTXRwU3RyaW5nQnVmZmVyIHN0cmluZ0J1ZmZlcjsKKworICAgIHN3aXRjaCAobVR5cGUpIHsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ4OgorICAgICAgICBjYXNlIE1UUF9UWVBFX0FJTlQ4OgorICAgICAgICAgICAgcGFja2V0LnB1dEludDgodmFsdWUudS5pOCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UODoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BVUlOVDg6CisgICAgICAgICAgICBwYWNrZXQucHV0VUludDgodmFsdWUudS51OCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQxNjoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BSU5UMTY6CisgICAgICAgICAgICBwYWNrZXQucHV0SW50MTYodmFsdWUudS5pMTYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDE2OgorICAgICAgICBjYXNlIE1UUF9UWVBFX0FVSU5UMTY6CisgICAgICAgICAgICBwYWNrZXQucHV0VUludDE2KHZhbHVlLnUudTE2KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDMyOgorICAgICAgICBjYXNlIE1UUF9UWVBFX0FJTlQzMjoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQzMih2YWx1ZS51LmkzMik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMzI6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQVVJTlQzMjoKKyAgICAgICAgICAgIHBhY2tldC5wdXRVSW50MzIodmFsdWUudS51MzIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UNjQ6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQUlOVDY0OgorICAgICAgICAgICAgcGFja2V0LnB1dEludDY0KHZhbHVlLnUuaTY0KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ2NDoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BVUlOVDY0OgorICAgICAgICAgICAgcGFja2V0LnB1dFVJbnQ2NCh2YWx1ZS51LnU2NCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQxMjg6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQUlOVDEyODoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQxMjgodmFsdWUudS5pMTI4KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQxMjg6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQVVJTlQxMjg6CisgICAgICAgICAgICBwYWNrZXQucHV0VUludDEyOCh2YWx1ZS51LnUxMjgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfU1RSOgorICAgICAgICAgICAgaWYgKHZhbHVlLnN0cikKKyAgICAgICAgICAgICAgICBwYWNrZXQucHV0U3RyaW5nKHZhbHVlLnN0cik7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgcGFja2V0LnB1dEVtcHR5U3RyaW5nKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIExPR0UoInVua25vd24gdHlwZSAlMDRYIGluIE10cFByb3BlcnR5Ojp3cml0ZVZhbHVlIiwgbVR5cGUpOworICAgIH0KK30KKworTXRwUHJvcGVydHlWYWx1ZSogTXRwUHJvcGVydHk6OnJlYWRBcnJheVZhbHVlcyhNdHBEYXRhUGFja2V0JiBwYWNrZXQsIGludCYgbGVuZ3RoKSB7CisgICAgbGVuZ3RoID0gcGFja2V0LmdldFVJbnQzMigpOworICAgIGlmIChsZW5ndGggPT0gMCkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwUHJvcGVyd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ICAgICB1MTI4OworICAgIH0gdTsKKyAgICAvLyBzdHJpbmcgaW4gVVRGOCBmb3JtYXQKKyAgICBjaGFyKiAgICAgICAgICAgICAgIHN0cjsKK307CisKK2NsYXNzIE10cFByb3BlcnR5IHsKK3B1YmxpYzoKKyAgICBNdHBQcm9wZXJ0eUNvZGUgICAgIG1Db2RlOworICAgIE10cERhdGFUeXBlICAgICAgICAgbVR5cGU7CisgICAgYm9vbCAgICAgICAgICAgICAgICBtV3JpdGVhYmxlOworICAgIE10cFByb3BlcnR5VmFsdWUgICAgbURlZmF1bHRWYWx1ZTsKKyAgICBNdHBQcm9wZXJ0eVZhbHVlICAgIG1DdXJyZW50VmFsdWU7CisKKyAgICAvLyBmb3IgYXJyYXkgdHlwZXMKKyAgICBpbnQgICAgICAgICAgICAgICAgIG1EZWZhdWx0QXJyYXlMZW5ndGg7CisgICAgTXRwUHJvcGVydHlWYWx1ZSogICBtRGVmYXVsdEFycmF5VmFsdWVzOworICAgIGludCAgICAgICAgICAgICAgICAgbUN1cnJlbnRBcnJheUxlbmd0aDsKKyAgICBNdHBQcm9wZXJ0eVZhbHVlKiAgIG1DdXJyZW50QXJyYXlWYWx1ZXM7CisKKyAgICBlbnVtIHsKKyAgICAgICAga0Zvcm1Ob25lID0gMCwKKyAgICAgICAga0Zvcm1SYW5nZSA9IDEsCisgICAgICAgIGtGb3JtRW51bSA9IDIsCisgICAgfTsKKworICAgIHVpbnQzMl90ICAgICAgICAgICAgbUdyb3VwQ29kZTsKKyAgICB1aW50OF90ICAgICAgICAgICAgIG1Gb3JtRmxhZzsKKworICAgIC8vIGZvciByYW5nZSBmb3JtCisgICAgTXRwUHJvcGVydHlWYWx1ZSAgICBtTWluaW11bVZhbHVlOworICAgIE10cFByb3BlcnR5VmFsdWUgICAgbU1heGltdW1WYWx1ZTsKKyAgICBNdHBQcm9wZXJ0eVZhbHVlICAgIG1TdGVwU2l6ZTsKKworICAgIC8vIGZvciBlbnVtIGZvcm0KKyAgICBpbnQgICAgICAgICAgICAgICAgIG1FbnVtTGVuZ3RoOworICAgIE10cFByb3BlcnR5VmFsdWUqICAgbUVudW1WYWx1ZXM7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cFByb3BlcnR5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBNdHBQcm9wZXJ0eShNdHBQcm9wZXJ0eUNvZGUgcHJvcENvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YVR5cGUgdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHdyaXRlYWJsZSA9IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkZWZhdWx0VmFsdWUgPSAwKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgIH5NdHBQcm9wZXJ0eSgpOworCisgICAgaW5saW5lIE10cFByb3BlcnR5Q29kZSBnZXRQcm9wZXJ0eUNvZGUoKSBjb25zdCB7IHJldHVybiBtQ29kZTsgfQorCisgICAgdm9pZCAgICAgICAgICAgICAgICByZWFkKE10cERhdGFQYWNrZXQmIHBhY2tldCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICB3cml0ZShNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICBzZXREZWZhdWx0VmFsdWUoY29uc3QgdWludDE2X3QqIHN0cmluZyk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRDdXJyZW50VmFsdWUoY29uc3QgdWludDE2X3QqIHN0cmluZyk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIHByaW50KCk7CisKKyAgICBpbmxpbmUgYm9vbCAgICAgICAgIGlzRGV2aWNlUHJvcGVydHkoKSBjb25zdCB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICggICAoKG1Db2RlICYgMHhGMDAwKSA9PSAweDUwMDApCisgICAgICAgICAgICAgIC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UGFja2V0IDogcHVibGljIE10cFBhY2tldCB7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cFJlc3BvbnNlUGFja2V0KCk7CisgICAgdmlydHVhbCAgICAgICAgICAgICB+TXRwUmVzcG9uc2VQYWNrZXQoKTsKKworI2lmZGVmIE1UUF9ERVZJQ0UKKyAgICAvLyB3cml0ZSBvdXIgZGF0YSB0byB0aGUgZ2l2ZW4gZmlsZSBkZXNjcmlwdG9yCisgICAgaW50ICAgICAgICAgICAgICAgICB3cml0ZShpbnQgZmQpOworI2VuZGlmCisKKyNpZmRlZiBNVFBfSE9TVAorICAgIC8vIHJlYWQgb3VyIGJ1ZmZlciBmcm9tIHRoZSBnaXZlbiBlbmRwb2ludAorICAgIGludCAgICAgICAgICAgICAgICAgcmVhZChzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcCk7CisjZW5kaWYKKworICAgIGlubGluZSBNdHBSZXNwb25zZUNvZGUgICAgICBnZXRSZXNwb25zZUNvZGUoKSBjb25zdCB7IHJldHVybiBnZXRDb250YWluZXJDb2RlKCk7IH0KKyAgICBpbmxpbmUgdm9pZCAgICAgICAgICAgICAgICAgc2V0UmVzcG9uc2VDb2RlKE10cFJlc3BvbnNlQ29kZSBjb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IHJldHVybiBzZXRDb250YWluZXJDb2RlKGNvZGUpOyB9Cit9OworCit9OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAorCisjZW5kaWYgLy8gX01UUF9SRVNQT05TRV9QQUNLRVRfSApkaWZmIC0tZ2l0IGEvbWVkaWEvbXRwL010cFNlcnZlci5jcHAgYi9tZWRpYS9tdHAvTXRwU2VydmVyLmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mNzRmMzk1Ci0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvbXRwL010cFNlcnZlci5jcHAKQE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RvIG91ciBpbmRleAorICAgIE10cFN0b3JhZ2UqIHN0b3JhZ2UgPSBuZXcgTXRwU3RvcmFnZShpbmRleCwgZmlsZVBhdGgsIG1EYXRhYmFzZSk7CisgICAgYWRkU3RvcmFnZShzdG9yYWdlKTsKK30KKworTXRwU3RvcmFnZSogTXRwU2VydmVyOjpnZXRTdG9yYWdlKE10cFN0b3JhZ2VJRCBpZCkgeworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbVN0b3JhZ2VzLnNpemUoKTsgaSsrKSB7CisgICAgICAgIE10cFN0b3JhZ2UqIHN0b3JhZ2UgPSAgbVN0b3JhZ2VzW2ldOworICAgICAgICBpZiAoc3RvcmFnZS0+Z2V0U3RvcmFnZUlEKCkgPT0gaWQpCisgICAgICAgICAgICByZXR1cm4gc3RvcmFnZTsKKyAgICB9CisgICAgcmV0dXJuIE5VTEw7Cit9CisKK3ZvaWQgTXRwU2VydmVyOjpydW4oKSB7CisgICAgaW50IGZkID0gbUZEOworCisgICAgTE9HVigiTXRwU2VydmVyOjpydW4gZmQ6ICVkXG4iLCBmZCk7CisKKyAgICB3aGlsZSAoMSkgeworICAgICAgICBpbnQgcmV0ID0gbVJlcXVlc3QucmVhZChmZCk7CisgICAgICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgICAgICBMT0dFKCJyZXF1ZXN0IHJlYWQgcmV0dXJuZWQgJWQsIGVycm5vOiAlZCIsIHJldCwgZXJybm8pOworICAgICAgICAgICAgaWYgKGVycm5vID09IEVDQU5DRUxFRCkgeworICAgICAgICAgICAgICAgIC8vIHJldHVybiB0byB0b3Agb2YgbG9vcCBhbmQgd2FpdCBmb3IgbmV4dCBjb21tYW5kCisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBNdHBPcGVyYXRpb25Db2RlIG9wZXJhdGlvbiA9IG1SZXF1ZXN0LmdldE9wZXJhdGlvbkNvZGUoKTsKKyAgICAgICAgTXRwVHJhbnNhY3Rpb25JRCB0cmFuc2FjdGlvbiA9IG1SZXF1ZXN0LmdldFRyYW5zYWN0aW9uSUQoKTsKKworICAgICAgICBMT0dWKCJvcGVyYXRpb246ICVzIiwgTXRwRGVidWc6OmdldE9wZXJhdGlvbkNvZGVOYW1lKG9wZXJhdGlvbikpOworICAgICAgICBtUmVxdWVzdC5kdW1wKCk7CisKKyAgICAgICAgLy8gRklYTUUgbmVlZCB0byBnZW5lcmFsaXplIHRoaXMKKyAgICAgICAgYm9vbCBkYXRhSW4gPSAob3BlcmF0aW9uID09IE1UUF9PUEVSQVRJT05fU0VORF9PQkpFQ1RfSU5GTworICAgICAgICAgICAgICAgICAgICB8fCBvcGVyYXRpb24gPT0gTVRQX09QRVJBVElPTl9TRVRfT0JKRUNUX1JFRkVSRU5DRVMKKyAgICAgICAgICAgICAgICAgICAgfHwgb3BlcmF0aW9uID09IE1UUF9PUEVSQVRJT05fU0VUX09CSkVDVF9QUk9QX1ZBTFVFCisgICAgICAgICAgICAgICAgICAgIHx8IG9wZXJhdGlvbiA9PSBNVFBfT1BFUkFUSU9OX1NFVF9ERVZJQ0VfUFJPUF9WQUxVRSk7CisgICAgICAgIGlmIChkYXRhSW4pIHsKKyAgICAgICAgICAgIGludCByZXQgPSBtRGF0YS5yZWFkKGZkKTsKKyAgICAgICAgICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgICAgICAgICAgTE9HRSgiZGF0YSByZWFkIHJldHVybmVkICVkLCBlcnJubzogJWQiLCByZXQsIGVycm5vKTsKKyAgICAgICAgICAgICAgICBpZiAoZXJybm8gPT0gRUNBTkNFTEVEKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybiB0byB0b3Agb2YgbG9vcCBhbmQgd2FpdCBmb3IgbmV4dCBjb21tYW5kCisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIExPR1YoInJlY2VpdmVkIGRhdGE6Iik7CisgICAgICAgICAgICBtRGF0YS5kdW1wKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtRGF0YS5yZXNldCgpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGhhbmRsZVJlcXVlc3QoKSkgeworICAgICAgICAgICAgaWYgKCFkYXRhSW4gJiYgbURhdGEuaGFzRGF0YSgpKSB7CisgICAgICAgICAgICAgICAgbURhdGEuc2V0T3BlcmF0aW9uQ29kZShvcGVyYXRpb24pOworICAgICAgICAgICAgICAgIG1EYXRhLnNldFRyYW5zYWN0aW9uSUQodHJhbnNhY3Rpb24pOworICAgICAgICAgICAgICAgIExPR1YoInNlbmRpbmcgZGF0YToiKTsKKyAgICAgICAgICAgICAgICBtRGF0YS5kdW1wKCk7CisgICAgICAgICAgICAgICAgcmV0ID0gbURhdGEud3JpdGUoZmQpOworICAgICAgICAgICAgICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIExPR0UoInJlcXVlc3Qgd3JpdGUgcmV0dXJuZWQgJWQsIGVycm5vOiAlZCIsIHJldCwgZXJybm8pOworICAgICAgICAgICAgICAgICAgICBpZiAoZXJybm8gPT0gRUNBTkNFTEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm4gdG8gdG9wIG9mIGxvb3AgYW5kIHdhaXQgZm9yIG5leHQgY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtUmVzcG9uc2Uuc2V0VHJhbnNhY3Rpb25JRCh0cmFuc2FjdGlvbik7CisgICAgICAgICAgICBMT0dWKCJzZW5kaW5nIHJlc3BvbnNlICUwNFgiLCBtUmVzcG9uc2UuZ2V0UmVzcG9uc2VDb2RlKCkpOworICAgICAgICAgICAgcmV0ID0gbVJlc3BvbnNlLndyaXRlKGZkKTsKKyAgICAgICAgICAgIG1SZXNwb25zZS5kdW1wKCk7CisgICAgICAgICAgICBpZiAocmV0IDwgMCkgeworICAgICAgICAgICAgICAgIExPR0UoInJlcXVlc3Qgd3JpdGUgcmV0dXJuZWQgJWQsIGVycm5vOiAlZCIsIHJldCwgZXJybm8pOworICAgICAgICAgICAgICAgIGlmIChlcnJubyA9PSBFQ0FOQ0VMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIHRvIHRvcCBvZiBsb29wIGFuZCB3YWl0IGZvciBuZXh0IGNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgTE9HVigic2tpcHBpbmcgcmVzcG9uc2VcbiIpOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKG1TZXNzaW9uT3BlbikKKyAgICAgICAgbURhdGFiYXNlLT5zZXNzaW9uRW5kZWQoKTsKK30KKwordm9pZCBNdHBTZXJ2ZXI6OnNlbmRPYmplY3RBZGRlZChNdHBPYmplY3RIYW5kbGUgaGFuZGxlKSB7CisgICAgaWYgKG1TZXNzaW9uT3BlbikgeworICAgICAgICBMT0dEKCJzZW5kT2JqZWN0QWRkZWQgJWRcbiIsIGhhbmRsZSk7CisgICAgICAgIG1FdmVudC5zZXRFdmVudENvZGUoTVRQX0VWRU5UX09CSkVDVF9BRERFRCk7CisgICAgICAgIG1FdmVudC5zZXRUcmFuc2FjdGlvbklEKG1SZXF1ZXN0LmdldFRyYW5zYWN0aW9uSUQoKSk7CisgICAgICAgIG1FdmVudC5zZXRQYXJhbWV0ZXIoMSwgaGFuZGxlKTsKKyAgICAgICAgaW50IHJldCA9IG1FdmVudC53cml0ZShtRkQp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kT2JqZWN0SW5mbyIpOworICAgICAgICBtU2VuZE9iamVjdEhhbmRsZSA9IGtJbnZhbGlkT2JqZWN0SGFuZGxlOworICAgIH0KKworICAgIHN3aXRjaCAob3BlcmF0aW9uKSB7CisgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9HRVRfREVWSUNFX0lORk86CisgICAgICAgICAgICByZXNwb25zZSA9IGRvR2V0RGV2aWNlSW5mbygpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9PUEVOX1NFU1NJT046CisgICAgICAgICAgICByZXNwb25zZSA9IGRvT3BlblNlc3Npb24oKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fQ0xPU0VfU0VTU0lPTjoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9DbG9zZVNlc3Npb24oKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX1NUT1JBR0VfSURTOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldFN0b3JhZ2VJRHMoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9TVE9SQUdFX0lORk86CisgICAgICAgICAgICByZXNwb25zZSA9IGRvR2V0U3RvcmFnZUluZm8oKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9QUk9QU19TVVBQT1JURUQ6CisgICAgICAgICAgICByZXNwb25zZSA9IGRvR2V0T2JqZWN0UHJvcHNTdXBwb3J0ZWQoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9IQU5ETEVTOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE9iamVjdEhhbmRsZXMoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX05VTV9PQkpFQ1RTOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE51bU9iamVjdHMoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9SRUZFUkVOQ0VTOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE9iamVjdFJlZmVyZW5jZXMoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fU0VUX09CSkVDVF9SRUZFUkVOQ0VTOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb1NldE9iamVjdFJlZmVyZW5jZXMoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9QUk9QX1ZBTFVFOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE9iamVjdFByb3BWYWx1ZSgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9TRVRfT0JKRUNUX1BST1BfVkFMVUU6CisgICAgICAgICAgICByZXNwb25zZSA9IGRvU2V0T2JqZWN0UHJvcFZhbHVlKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9ERVZJQ0VfUFJPUF9WQUxVRToKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXREZXZpY2VQcm9wVmFsdWUoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fU0VUX0RFVklDRV9QUk9QX1ZBTFVFOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb1NldERldmljZVByb3BWYWx1ZSgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9SRVNFVF9ERVZJQ0VfUFJPUF9WQUxVRToKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9SZXNldERldmljZVByb3BWYWx1ZSgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUX0lORk86CisgICAgICAgICAgICByZXNwb25zZSA9IGRvR2V0T2JqZWN0SW5mbygpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE9iamVjdCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9TRU5EX09CSkVDVF9JTkZPOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb1NlbmRPYmplY3RJbmZvKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX1NFTkRfT0JKRUNUOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb1NlbmRPYmplY3QoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fREVMRVRFX09CSkVDVDoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9EZWxldGVPYmplY3QoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9QUk9QX0RFU0M6CisgICAgICAgICAgICByZXNwb25zZSA9IGRvR2V0T2JqZWN0UHJvcERlc2MoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX0RFVklDRV9QUk9QX0RFU0M6CisgICAgICAgICAgICByZXNwb25zZSA9IGRvR2V0RGV2aWNlUHJvcERlc2MoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAg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bW9kaWZpZWQKKyAgICAvLyBrZXl3b3JkcyBmb2xsb3cKKworICAgIHRpbWVfdCBtb2RpZmllZFRpbWU7CisgICAgaWYgKCFwYXJzZURhdGVUaW1lKG1vZGlmaWVkLCBtb2RpZmllZFRpbWUpKQorICAgICAgICBtb2RpZmllZFRpbWUgPSAwOworCisgICAgaWYgKHBhdGhbcGF0aC5zaXplKCkgLSAxXSAhPSAnLycpCisgICAgICAgIHBhdGggKz0gIi8iOworICAgIHBhdGggKz0gKGNvbnN0IGNoYXIgKiluYW1lOworCisgICAgTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSA9IG1EYXRhYmFzZS0+YmVnaW5TZW5kT2JqZWN0KChjb25zdCBjaGFyKilwYXRoLAorICAgICAgICAgICAgZm9ybWF0LCBwYXJlbnQsIHN0b3JhZ2VJRCwgbVNlbmRPYmplY3RGaWxlU2l6ZSwgbW9kaWZpZWRUaW1lKTsKKyAgICBpZiAoaGFuZGxlID09IGtJbnZhbGlkT2JqZWN0SGFuZGxlKSB7CisgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfR0VORVJBTF9FUlJPUjsKKyAgICB9CisKKyAgaWYgKGZvcm1hdCA9PSBNVFBfRk9STUFUX0FTU09DSUFUSU9OKSB7CisgICAgICAgIG1vZGVfdCBtYXNrID0gdW1hc2soMCk7CisgICAgICAgIGludCByZXQgPSBta2RpcigoY29uc3QgY2hhciAqKXBhdGgsIG1EaXJlY3RvcnlQZXJtaXNzaW9uKTsKKyAgICAgICAgdW1hc2sobWFzayk7CisgICAgICAgIGlmIChyZXQgJiYgcmV0ICE9IC1FRVhJU1QpCisgICAgICAgICAgICByZXR1cm4gTVRQX1JFU1BPTlNFX0dFTkVSQUxfRVJST1I7CisgICAgICAgIGNob3duKChjb25zdCBjaGFyICopcGF0aCwgZ2V0dWlkKCksIG1GaWxlR3JvdXApOworICAgIH0gZWxzZSB7CisgICAgICAgIG1TZW5kT2JqZWN0RmlsZVBhdGggPSBwYXRoOworICA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AgbWZyOworICAgIG1mci5mZCA9IG9wZW4obVNlbmRPYmplY3RGaWxlUGF0aCwgT19SRFdSIHwgT19DUkVBVCB8IE9fVFJVTkMpOworICAgIGlmIChtZnIuZmQgPCAwKSB7CisgICAgICAgIHJlc3VsdCA9IE1UUF9SRVNQT05TRV9HRU5FUkFMX0VSUk9SOworICAgICAgICBnb3RvIGRvbmU7CisgICAgfQorICAgIGZjaG93bihtZnIuZmQsIGdldHVpZCgpLCBtRmlsZUdyb3VwKTsKKyAgICAvLyBzZXQgcGVybWlzc2lvbnMKKyAgICBtYXNrID0gdW1hc2soMCk7CisgICAgZmNobW9kKG1mci5mZCwgbUZpbGVQZXJtaXNzaW9uKTsKKyAgICB1bWFzayhtYXNrKTsKKworICAgIG1mci5vZmZzZXQgPSAwOworICAgIG1mci5sZW5ndGggPSBtU2VuZE9iamVjdEZpbGVTaXplOworCisgICAgLy8gdHJhbnNmZXIgdGhlIGZpbGUKKyAgICByZXQgPSBpb2N0bChtRkQsIE1UUF9SRUNFSVZFX0ZJTEUsICh1bnNpZ25lZCBsb25nKSZtZnIpOworICAgIGNsb3NlKG1mci5mZCk7CisKKyAgICBMT0dWKCJNVFBfUkVDRUlWRV9GSUxFIHJldHVybmVkICVkIiwgcmV0KTsKKworICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgIHVubGluayhtU2VuZE9iamVjdEZpbGVQYXRoKTsKKyAgICAgICAgaWYgKGVycm5vID09IEVDQU5DRUxFRCkKKyAgICAgICAgICAgIHJlc3VsdCA9IE1UUF9SRVNQT05TRV9UUkFOU0FDVElPTl9DQU5DRUxMRUQ7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHJlc3VsdCA9IE1UUF9SRVNQT05TRV9HRU5FUkFMX0VSUk9SOworICAgIH0KKworZG9uZToKKyAgICBtRGF0YWJhc2UtPmVuZFNlbmRPYmplY3QobVNlbmRPYmplY3RGaWxlUGF0aCwgbVNlbmRPYmplY3RIYW5kbGUsIG1TZW5kT2JqZWN0Rm9ybWF0LAorICAgICAgICAgICAgcmVzdWx0ID09IE1UUF9SRVNQT05TRV9PSyk7CisgICAgbVNlbmRPYmplY3RIYW5kbGUgPSBrSW52YWxpZE9iamVjdEhhbmRsZTsKKyAgICBtU2VuZE9iamVjdEZvcm1hdCA9IDA7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworc3RhdGljIHZvaWQgZGVsZXRlUmVjdXJzaXZlKGNvbnN0IGNoYXIqIHBhdGgpIHsKKyAgICBjaGFyIHBhdGhidWZbUEFUSF9NQVhdOworICAgIGludCBwYXRoTGVuZ3RoID0gc3RybGVuKHBhdGgpOworICAgIGlmIChwYXRoTGVuZ3RoID49IHNpemVvZihwYXRoYnVmKSAtIDEpIHsKKyAgICAgICAgTE9HRSgicGF0aCB0b28gbG9uZzogJXNcbiIsIHBhdGgpOworICAgIH0KKyAgICBzdHJjcHkocGF0aGJ1ZiwgcGF0aCk7CisgICAgaWYgKHBhdGhidWZbcGF0aExlbmd0aCAtIDFdICE9ICcvJykgeworICAgICAgICBwYXRoYnVmW3BhdGhMZW5ndGgrK10gPSAnLyc7CisgICAgfQorICAgIGNoYXIqIGZpbGVTcG90ID0gcGF0aGJ1ZiArIHBhdGhMZW5ndGg7CisgICAgaW50IHBhdGhSZW1haW5pbmcgPSBzaXplb2YocGF0aGJ1ZikgLSBwYXRoTGVuZ3RoIC0gMTsKKworICAgIERJUiogZGlyID0gb3BlbmRpcihwYXRoKTsKKyAgICBpZiAoIWRpcikgeworICAgICAgICBMT0dFKCJvcGVuZGlyICVzIGZhaWxlZDogJXMiLCBwYXRoLCBzdHJlcnJvcihlcnJubykpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc3RydWN0IGRpcmVudCogZW50cnk7CisgICAgd2hpbGUgKChlbnRyeSA9IHJlYWRkaXIoZGlyKSkpIHsKKyAgICAgICAgY29uc3QgY2hhciogbmFtZSA9IGVudHJ5LT5kX25hbWU7CisKKyAgICAgICAgLy8gaWdub3JlICIuIiBhbmQgIi4uIgorICAgICAgICBpZiAobmFtZVswXSA9PSAnLicgJiYgKG5hbWVbMV0gPT0gMCB8fCAobmFtZVsxXSA9PSAnLicgJiYgbmFtZVsyXSA9PSAwKSkpIHsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisKKyAgICAgICAgaW50IG5hbWVMZW5ndGggPSBzdHJsZW4obmFtZSk7CisgICAgICAgIGlmIChuYW1lTGVuZ3RoID4gcGF0aFJlbWFpbmluZykgeworICAgICAgICAgICAgTE9HRSgicGF0aCAlcy8lcyB0b28gbG9uZ1xuIiwgcGF0aCwgbmFtZSk7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICBzdHJjcHkoZmlsZVNwb3QsIG5hbWUpOworCisgICAgICAgIGludCB0eXBlID0gZW50cnktPmRfdHlwZTsKKyAgICAgICAgaWYgKGVudHJ5LT5kX3R5cGUgPT0gRFRfRElSKSB7CisgICAgICAgICAgICBkZWxldGVSZWN1cnNpdmUocGF0aGJ1Zik7CisgICAgICAgICAgICBybWRpcihwYXRoYnVmKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHVubGluayhwYXRoYnVmKTsKKyAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQgZGVsZXRlUGF0aChjb25zdCBjaGFyKiBwYXRoKSB7CisgICAgc3RydWN0IHN0YXQgc3RhdGJ1ZjsKKyAgICBpZiAoc3RhdChwYXRoLCAmc3RhdGJ1ZikgPT0gMCkgeworICAgICAgICBpZiAoU19JU0RJUihzdGF0YnVmLnN0X21vZGUpKSB7CisgICAgICAgICAgICBkZWxldGVSZWN1cnNpdmUocGF0aCk7CisgICAgICAgICAgICBybWRpcihwYXRoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHVubGluayhwYXRoKTsKKyAgICAgICAgfQorICAgIH0gZWxzZSB7CisgICAgICAgIExPR0UoImRlbGV0ZVBhdGggc3RhdCBm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3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworI2lmbmRlZiBfTVRQX1NFUlZFUl9ICisjZGVmaW5lIF9NVFBfU0VSVkVSX0gKKworI2luY2x1ZGUgIk10cFJlcXVlc3RQYWNrZXQuaCIKKyNpbmNsdWRlICJNdHBEYXRhUGFja2V0LmgiCisjaW5jbHVkZSAiTXRwUmVzcG9uc2VQYWNrZXQuaCIKKyNpbmNsdWRlICJNdHBFdmVudFBhY2tldC5oIgorI2luY2x1ZGUgIm10cC5oIgorCisjaW5jbHVkZSAiTXRwVXRpbHMuaCIKKworbmFtZXNwYWNlIGFuZHJvaWQgeworCitjbGFzcyBNdHBEYXRhYmFzZTsKK2NsYXNzIE10cFN0b3JhZ2U7CisKK2NsYXNzIE10cFNlcnZlciB7CisKK3ByaXZhdGU6CisgICAgLy8gZmlsZSBkZXNjcmlwdG9yIGZvciBNVFAga2VybmVsIGRyaXZlcgorICAgIGludCAgICAgICAgICAgICAgICAgbUZEOworCisgICAgTXRwRGF0YWJhc2UqICAgICAgICBtRGF0YWJhc2U7CisKKyAgICAvLyBncm91cCB0byBvd24gbmV3IGZpbGVzIGFuZCBmb2xkZXJzCisgICAgaW50ICAgICAgICAgICAgICAgICBtRmlsZUdyb3VwOworICAgIC8vIHBlcm1pc3Npb25zIGZvciBuZXcgZmlsZXMgYW5kIGRpcmVjdG9yaWVzCisgICAgaW50ICAgICAgICAgICAgICAgICBtRmlsZVBlcm1pc3Npb247CisgICAgaW50ICAgICAgICAgICAgICAgICBtRGlyZWN0b3J5UGVybWlzc2lvbjsKKworICAgIC8vIGN1cnJlbnQgc2Vzc2lvbiBJRAorICAgIE10cFNlc3Npb25JRCAgICAgICAgbVNlc3Npb25JRDsKKyAgICAvLyB0cnVlIGlmIHdlIGhhdmUgYW4gb3BlbiBzZXNzaW9uIGFuZCBtU2Vzc2lvbklEIGlzIHZhbGlkCisgICAgYm9vbCAgICAgICAgICAgICAgICBtU2Vzc2lvbk9wZW47CisKKyAgICBNdHBSZXF1ZXN0UGFja2V0ICAgIG1SZXF1ZXN0OworICAgIE10cERhdGFQYWNrZXQgICAgICAgbURhdGE7CisgICAgTXRwUmVzcG9uc2VQYWNrZXQgICBtUmVzcG9uc2U7CisgICAgTXRwRXZlbnRQYWNrZXQgICAgICBtRXZlbnQ7CisKKyAgICBNdHBTdG9yYWdlTGlzdCAgICAgIG1TdG9yYWdlczsKKworICAgIC8vIGhhbmRsZSBmb3IgbmV3IG9iamVjdCwgc2V0IGJ5IFNlbmRPYmplY3RJbmZvIGFuZCB1c2VkIGJ5IFNlbmRPYmplY3QKKyAgICBNdHBPYmplY3RIYW5kbGUgICAgIG1TZW5kT2JqZWN0SGFuZGxlOworICAgIE10cE9iamVjdEZvcm1hdCAgICAgbVNlbmRPYmplY3RGb3JtYXQ7CisgICAgTXRwU3RyaW5nICAgICAgICAgICBtU2VuZE9iamVjdEZpbGVQYXRoOworICAgIHNpemVfdCAgICAgICAgICAgICAgbVNlbmRPYmplY3RGaWxlU2l6ZTsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgTXRwU2VydmVyKGludCBmZCwgTXRwRGF0YWJhc2UqIGRhdGFiYXNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZpbGVHcm91cCwgaW50IGZpbGVQZXJtLCBpbnQgZGlyZWN0b3J5UGVybSk7CisgICAgdmlydHVhbCAgICAgICAgICAgICB+TXRwU2VydmVyKCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIGFkZFN0b3JhZ2UoY29uc3QgY2hhciogZmlsZVBhdGgpOworICAgIGlubGluZSB2b2lkICAgICAgICAgYWRkU3RvcmFnZShNdHBTdG9yYWdlKiBzdG9yYWdlKSB7IG1TdG9yYWdlcy5wdXNoKHN0b3JhZ2UpOyB9CisgICAgTXRwU3RvcmFnZSogICAgICAgICBnZXRTdG9yYWdlKE10cFN0b3JhZ2VJRCBpZCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBydW4oKTsKKworICAgIHZvaWQgICAgICAgICAgICAgICAgc2VuZE9iamVjdEFkZGVkKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgc2VuZE9iamVjdFJlbW92ZWQoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSk7CisKK3ByaXZhdGU6CisgICAgYm9vbCAgICAgICAgICAgICAgICBoYW5kbGVSZXF1ZXN0KCk7CisKKyAgICBNdHBSZXNwb25zZUNvZGUgICAgIGRvR2V0RGV2aWNlSW5mbygpOworICAgIE10cFJlc3BvbnNlQ29kZSAgICAgZG9PcGVuU2Vzc2lvbigpOworICAgIE10cFJlc3BvbnNlQ29kZSAgICAgZG9DbG9zZVNlc3Npb24oKTsKKyAgICBNdHBSZXNwb25zZUNvZGUgICAgIGRvR2V0U3RvcmFnZUlEcygpOworICAgIE10cFJlc3BvbnNlQ29kZSAgICAgZG9HZXRTdG9yYWdlSW5mbygpOworICAgIE10cFJlc3BvbnNlQ29kZSAgICAgZG9HZXRPYmplY3RQcm9wc1N1cHBvcnRlZCgpOworICAgIE10cFJlc3BvbnNlQ29kZSAgICAgZG9HZXRPYmplY3RIYW5kbGVzKCk7CisgICAgTXRwUmVzcG9uc2VDb2RlICAgICBkb0dldE51bU9iamVjdHMoKTsKKyAgICBNdHBSZXNwb25zZUNvZGUgICAgIGRvR2V0T2JqZWN0UmVmZXJlbmNlcygpOworICAgIE10cFJlc3BvbnNlQ29kZSAgICAgZG9TZXRPYmplY3RSZWZlcmVuY2VzKCk7CisgICAgTXRwUmVzcG9uc2VDb2RlICAgICBkb0dldE9iamVjdFByb3BWYWx1ZSgpOworICAgIE10cFJlc3BvbnNlQ29kZSAgICAgZG9TZXRPYmplY3RQcm9wVmFsdWUoKTsKKyAgICBNdHBSZXNwb25zZUNvZGUgICAgIGRvR2V0RGV2aWNlUHJvcFZhbHVlKCk7CisgICAgTXRwUmVzcG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mUgbGFzdCBieXRlCisgICAgICAgICAgICAgICAgbGVuZ3RoLS07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoKGNoICYgMHhGMCkgPT0gMHhFMCkgeworICAgICAgICAgICAgLy8gMyBieXRlIGNoYXIKKyAgICAgICAgICAgIGlmICghICpzcmMrKykgeworICAgICAgICAgICAgICAgIC8vIGxhc3QgY2hhcmFjdGVyIHdhcyB0cnVuY2F0ZWQsIHNvIGlnbm9yZSBsYXN0IGJ5dGUKKyAgICAgICAgICAgICAgICBsZW5ndGgtLTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghICpzcmMrKykgeworICAgICAgICAgICAgICAgIC8vIGxhc3QgY2hhcmFjdGVyIHdhcyB0cnVuY2F0ZWQsIHNvIGlnbm9yZSBsYXN0IHR3byBieXRlcworICAgICAgICAgICAgICAgIGxlbmd0aCAtPSAyOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGNvdW50Kys7CisgICAgfQorCisgICAgbUJ5dGVDb3VudCA9IGxlbmd0aCArIDE7CisgICAgbUJ1ZmZlcltsZW5ndGhdID0gMDsKKyAgICBtQ2hhckNvdW50ID0gY291bnQ7Cit9CisKK3ZvaWQgTXRwU3RyaW5nQnVmZmVyOjpzZXQoY29uc3QgdWludDE2X3QqIHNyYykgeworICAgIGludCBjb3VudCA9IDA7CisgICAgdWludDE2X3QgY2g7CisgICAgdWludDhfdCogZGVzdCA9IG1CdWZmZXI7CisKKyAgICB3aGlsZSAoKGNoID0gKnNyYysrKSAhPSAwICYmIGNvdW50IDwgMjU1KSB7CisgICAgICAgIGlmIChjaCA+PSAweDA4MDApIHsKKyAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHhFMCB8IChjaCA+PiAxMikpOworICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweDgwIHwgKChjaCA+PiA2KSAmIDB4M0YpKTsKKyAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHg4MCB8IChjaCAmIDB4M0YpKTsKKyAgICAgICAgfSBlbHNlIGlmIChjaCA+PSAweDgwKSB7CisgICAgICAgICAgICAqZGVzdCsrID0gKHVpbnQ4X3QpKDB4QzAgfCAoY2ggPj4gNikpOworICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweDgwIHwgKGNoICYgMHgzRikpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgKmRlc3QrKyA9IGNoOworICAgICAgICB9CisgICAgICAgIGNvdW50Kys7CisgICAgfQorICAgICpkZXN0KysgPSAwOworICAgIG1DaGFyQ291bnQgPSBjb3VudDsKKyAgICBtQnl0ZUNvdW50ID0gZGVzdCAtIG1CdWZmZXI7Cit9CisKK3ZvaWQgTXRwU3RyaW5nQnVmZmVyOjpyZWFkRnJvbVBhY2tldChNdHBEYXRhUGFja2V0KiBwYWNrZXQpIHsKKyAgICBpbnQgY291bnQgPSBwYWNrZXQtPmdldFVJbnQ4KCk7CisgICAgdWludDhfdCogZGVzdCA9IG1CdWZmZXI7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgIHVpbnQxNl90IGNoID0gcGFja2V0LT5nZXRVSW50MTYoKTsKKyAgICAgICAgaWYgKGNoID49IDB4MDgwMCkgeworICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweEUwIHwgKGNoID4+IDEyKSk7CisgICAgICAgICAgICAqZGVzdCsrID0gKHVpbnQ4X3QpKDB4ODAgfCAoKGNoID4+IDYpICYgMHgzRikpOworICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweDgwIHwgKGNoICYgMHgzRikpOworICAgICAgICB9IGVsc2UgaWYgKGNoID49IDB4ODApIHsKKyAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHhDMCB8IChjaCA+PiA2KSk7CisgICAgICAgICAgICAqZGVzdCsrID0gKHVpbnQ4X3QpKDB4ODAgfCAoY2ggJiAweDNGKSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAqZGVzdCsrID0gY2g7CisgICAgICAgIH0KKyAgICB9CisgICAgKmRlc3QrKyA9IDA7CisgICAgbUNoYXJDb3VudCA9IGNvdW50OworICAgIG1CeXRlQ291bnQgPSBkZXN0IC0gbUJ1ZmZlcjsKK30KKwordm9pZCBNdHBTdHJpbmdCdWZmZXI6OndyaXRlVG9QYWNrZXQoTXRwRGF0YVBhY2tldCogcGFja2V0KSBjb25zdCB7CisgICAgaW50IGNvdW50ID0gbUNoYXJDb3VudDsKKyAgICBjb25zdCB1aW50OF90KiBzcmMgPSBtQnVmZmVyOworICAgIHBhY2tldC0+cHV0VUludDgoY291bnQgPiAwID8gY291bnQgKyAxIDogMCk7CisKKyAgICAvLyBleHBhbmQgdXRmOCB0byAxNiBiaXQgY2hhcnMKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgdWludDE2X3QgY2g7CisgICAgICAgIHVpbnQxNl90IGNoMSA9ICpzcmMrKzsKKyAgICAgICAgaWYgKChjaDEgJiAweDgwKSA9PSAwKSB7CisgICAgICAgICAgICAvLyBzaW5nbGUgYnl0ZSBjaGFyYWN0ZXIKKyAgICAgICAgICAgIGNoID0gY2gxOworICAgICAgICB9IGVsc2UgaWYgKChjaDEgJiAweEUwKSA9PSAweEMwKSB7CisgICAgICAgICAgICAvLyB0d28gYnl0ZSBjaGFyYWN0ZXIKKyAgICAgICAgICAgIHVpbnQxNl90IGNoMiA9ICpzcmMrKzsKKyAgICAgICAgICAgIGNoID0gKChjaDEgJiAweDFGKSA8PCA2KSB8IChjaDIgJiAweDNGKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIHRocmVlIGJ5dGUgY2hhcmFjdGVyCisgICAg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gICAgICAgICAgICAgICAgTXRwU3RyaW5nQnVmZmVyKGNvbnN0IGNoYXIqIHNyYyk7CisgICAgICAgICAgICAgICAgICAgIE10cFN0cmluZ0J1ZmZlcihjb25zdCB1aW50MTZfdCogc3JjKTsKKyAgICAgICAgICAgICAgICAgICAgTXRwU3RyaW5nQnVmZmVyKGNvbnN0IE10cFN0cmluZ0J1ZmZlciYgc3JjKTsKKyAgICB2aXJ0dWFsICAgICAgICAgfk10cFN0cmluZ0J1ZmZlcigpOworCisgICAgdm9pZCAgICAgICAgICAgIHNldChjb25zdCBjaGFyKiBzcmMpOworICAgIHZvaWQgICAgICAgICAgICBzZXQoY29uc3QgdWludDE2X3QqIHNyYyk7CisKKyAgICB2b2lkICAgICAgICAgICAgcmVhZEZyb21QYWNrZXQoTXRwRGF0YVBhY2tldCogcGFja2V0KTsKKyAgICB2b2lkICAgICAgICAgICAgd3JpdGVUb1BhY2tldChNdHBEYXRhUGFja2V0KiBwYWNrZXQpIGNvbnN0OworCisgICAgaW5saW5lIGludCAgICAgIGdldENoYXJDb3VudCgpIGNvbnN0IHsgcmV0dXJuIG1DaGFyQ291bnQ7IH0KKyAgICBpbmxpbmUgaW50ICAgICAgZ2V0Qnl0ZUNvdW50KCkgY29uc3QgeyByZXR1cm4gbUJ5dGVDb3VudDsgfQorCisJaW5saW5lIG9wZXJhdG9yIGNvbnN0IGNoYXIqKCkgY29uc3QgeyByZXR1cm4gKGNvbnN0IGNoYXIgKiltQnVmZmVyOyB9Cit9OworCit9OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAorCisjZW5kaWYgLy8gX01UUF9TVFJJTkdfQlVGRkVSX0gKZGlmZiAtLWdpdCBhL21lZGlhL210cC9NdHBUeXBlcy5oIGIvbWVkaWEvbXRwL010cFR5cGVzLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNzIwYzg1NAotLS0gL2Rldi9udWxsCisrKyBiL21lZGlhL210cC9NdHBUeXBlcy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OworCisgICAgaWYgKHNzY2FuZihkYXRlVGltZSwgIiUwNGQlMDJkJTAyZFQlMDJkJTAyZCUwMmQiLAorICAgICAgICAgICAgJnllYXIsICZtb250aCwgJmRheSwgJmhvdXIsICZtaW51dGUsICZzZWNvbmQpICE9IDYpCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICBjb25zdCBjaGFyKiB0YWlsID0gZGF0ZVRpbWUgKyAxNTsKKyAgICAvLyBza2lwIG9wdGlvbmFsIHRlbnRoIG9mIHNlY29uZAorICAgIGlmICh0YWlsWzBdID09ICcuJyAmJiB0YWlsWzFdKQorICAgICAgICB0YWlsICs9IDI7CisgICAgLy9GSVhNRSAtIHN1cHBvcnQgKy8taGhtbQorICAgIGJvb2wgdXNlVVRDID0gKHRhaWxbMF0gPT0gJ1onKTsKKworICAgIC8vIGhhY2sgdG8gY29tcHV0ZSB0aW1lem9uZQorICAgIHRpbWVfdCBkdW1teTsKKyAgICBsb2NhbHRpbWVfcigmZHVtbXksICZ0bSk7CisKKyAgICB0bS50bV9zZWMgPSBzZWNvbmQ7CisgICAgdG0udG1fbWluID0gbWludXRlOworICAgIHRtLnRtX2hvdXIgPSBob3VyOworICAgIHRtLnRtX21kYXkgPSBkYXk7CisgICAgdG0udG1fbW9uID0gbW9udGg7CisgICAgdG0udG1feWVhciA9IHllYXIgLSAxOTAwOworICAgIHRtLnRtX3dkYXkgPSAwOworICAgIHRtLnRtX2lzZHN0ID0gLTE7CisgICAgaWYgKHVzZVVUQykKKyAgICAgICAgb3V0U2Vjb25kcyA9IG1rdGltZSgmdG0pOworICAgIGVsc2UKKyAgICAgICAgb3V0U2Vjb25kcyA9IG1rdGltZV90eigmdG0sIHRtLnRtX3pvbmUpOworCisgICAgcmV0dXJuIHRydWU7Cit9CisKK3ZvaWQgZm9ybWF0RGF0ZVRpbWUodGltZV90IHNlY29uZHMsIGNoYXIqIGJ1ZmZlciwgaW50IGJ1ZmZlckxlbmd0aCkgeworICAgIHN0cnVjdCB0bS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lQRV9BSU5UNjQgICAgICAgICAweDQwMDcgICAgICAgICAgLy8gQXJyYXkgb2Ygc2lnbmVkIDY0LWJpdCBpbnRlZ2VycworI2RlZmluZSBNVFBfVFlQRV9BVUlOVDY0ICAgICAgICAweDQwMDggICAgICAgICAgLy8gQXJyYXkgb2YgdW5zaWduZWQgNjQtYml0IGludGVnZXJzCisjZGVmaW5lIE1UUF9UWVBFX0FJTlQxMjggICAgICAgIDB4NDAwOSAgICAgICAgICAvLyBBcnJheSBvZiBzaWduZWQgMTI4LWJpdCBpbnRlZ2VycworI2RlZmluZSBNVFBfVFlQRV9BVUlOVDEyOCAgICAgICAweDQwMEEgICAgICAgICAgLy8gQXJyYXkgb2YgdW5zaWduZWQgMTI4LWJpdCBpbnRlZ2VycworI2RlZmluZSBNVFBfVFlQRV9TVFIgICAgICAgICAgICAweEZGRkYgICAgICAgICAgLy8gVmFyaWFibGUtbGVuZ3RoIFVuaWNvZGUgc3RyaW5nCisKKy8vIE1UUCBGb3JtYXQgQ29kZXMKKyNkZWZpbmUgTVRQX0ZPUk1BVF9VTkRFRklORUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDAwICAgLy8gVW5kZWZpbmVkIG9iamVjdAorI2RlZmluZSBNVFBfRk9STUFUX0FTU09DSUFUSU9OICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDEgICAvLyBBc3NvY2lhdGlvbiAoZm9yIGV4YW1wbGUsIGEgZm9sZGVyKQorI2RlZmluZSBNVFBfRk9STUFUX1NDUklQVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDIgICAvLyBEZXZpY2UgbW9kZWwtc3BlY2lmaWMgc2NyaXB0CisjZGVmaW5lIE1UUF9GT1JNQVRfRVhFQ1VUQUJMRSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwMyAgIC8vIERldmljZSBtb2RlbC1zcGVjaWZpYyBiaW5hcnkgZXhlY3V0YWJsZQorI2RlZmluZSBNVFBfRk9STUFUX1RFWFQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDQgICAvLyBUZXh0IGZpbGUKKyNkZWZpbmUgTVRQX0ZPUk1BVF9IVE1MICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA1ICAgLy8gSHlwZXJ0ZXh0IE1hcmt1cCBMYW5ndWFnZSBmaWxlICh0ZXh0KQorI2RlZmluZSBNVFBfRk9STUFUX0RQT0YgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDYgICAvLyBEaWdpdGFsIFByaW50IE9yZGVyIEZvcm1hdCBmaWxlICh0ZXh0KQorI2RlZmluZSBNVFBfRk9STUFUX0FJRkYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDcgICAvLyBBdWRpbyBjbGlwCisjZGVmaW5lIE1UUF9GT1JNQVRfV0FWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwOCAgIC8vIEF1ZGlvIGNsaXAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9NUDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA5ICAgLy8gQXVkaW8gY2xpcAorI2RlZmluZSBNVFBfRk9STUFUX0FWSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMEEgICAvLyBWaWRlbyBjbGlwCisjZGVmaW5lIE1UUF9GT1JNQVRfTVBFRyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwQiAgIC8vIFZpZGVvIGNsaXAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BU0YgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDBDICAgLy8gTWljcm9zb2Z0IEFkdmFuY2VkIFN0cmVhbWluZyBGb3JtYXQgKHZpZGVvKQorI2RlZmluZSBNVFBfRk9STUFUX0RFRklORUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDAgICAvLyBVbmtub3duIGltYWdlIG9iamVjdAorI2RlZmluZSBNVFBfRk9STUFUX0VYSUZfSlBFRyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDEgICAvLyBFeGNoYW5nZWFibGUgRmlsZSBGb3JtYXQsIEpFSURBIHN0YW5kYXJkCisjZGVmaW5lIE1UUF9GT1JNQVRfVElGRl9FUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwMiAgIC8vIFRhZyBJbWFnZSBGaWxlIEZvcm1hdCBmb3IgRWxlY3Ryb25pYyBQaG90b2dyYXBoeQorI2RlZmluZSBNVFBfRk9STUFUX0ZMQVNIUElYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDMgICAvLyBTdHJ1Y3R1cmVkIFN0b3JhZ2UgSW1hZ2UgRm9ybWF0CisjZGVmaW5lIE1UUF9GT1JNQVRfQk1QICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwNCAgIC8vIE1pY3Jvc29mdCBXaW5kb3dzIEJpdG1hcCBmaWxlCisjZGVmaW5lIE1UUF9GT1JNQVRfQ0lGRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwNSAgIC8vIENhbm9uIENhbWVyYSBJbWFnZSBGaWxlIEZvcm1hdAorI2RlZmluZSBNVFBfRk9STUFUX0dJRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDcgICAvLyBHcmFwaGljcyBJbnRlcmNoYW5nZSBGb3JtYXQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9KRklGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA4ICAgLy8gSlBFRyBGaWxlIEludGVyY2hhbmdlIEZvcm1hdAorI2RlZmluZSBNVFBfRk9STUFUX0NEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDkgICAvLyBQaG90b0NEIEltYWdlIFBhYworI2RlZmluZSBNVFBfRk9STUFUX1BJQ1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEEgICAvLyBRdWlja2RyYXcgSW1hZ2UgRm9ybWF0CisjZGVmaW5lIE1UUF9GT1JNQVRfUE5HICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwQiAgIC8vIFBvcnRhYmxlIE5ldHdvcmsgR3JhcGhpY3MKKyNkZWZpbmUgTVRQX0ZPUk1BVF9USUZGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBEICAgLy8gVGFnIEltYWdlIEZpbGUgRm9ybWF0CisjZGVmaW5lIE1UUF9GT1JNQVRfVElGRl9JVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwRSAgIC8vIFRhZyBJbWFnZSBGaWxlIEZvcm1hdCBmb3IgSW5mb3JtYXRpb24gVGVjaG5vbG9neSAoZ3JhcGhpYyBhcnRzKQorI2RlZmluZSBNVFBfRk9STUFUX0pQMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEYgICAvLyBKUEVHMjAwMCBCYXNlbGluZSBGaWxlIEZvcm1hdAorI2RlZmluZSBNVFBfRk9STUFUX0pQWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MTAgICAvLyBKUEVHMjAwMCBFeHRlbmRlZCBGaWxlIEZvcm1hdAorI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9GSVJNV0FSRSAgICAgICAgICAgICAgICAgICAweEI4MDIKKyNkZWZpbmUgTVRQX0ZPUk1BVF9XSU5ET1dTX0lNQUdFX0ZPUk1BVCAgICAgICAgICAgICAgICAgMHhCODgxCisjZGVmaW5lIE1UUF9GT1JNQVRfVU5ERUZJTkVEX0FVRElPICAgICAgICAgICAgICAgICAgICAgIDB4QjkwMAorI2RlZmluZSBNVFBfRk9STUFUX1dNQSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDEKKyNkZWZpbmUgTVRQX0ZPUk1BVF9PR0cgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTAyCisjZGVmaW5lIE1UUF9GT1JNQVRfQUFDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4QjkwMworI2RlZmluZSBNVFBfRk9STUFUX0FVRElCTEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9GTEFDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTA2CisjZGVmaW5lIE1UUF9GT1JNQVRfVU5ERUZJTkVEX1ZJREVPICAgICAgICAgICAgICAgICAgICAgIDB4Qjk4MAorI2RlZmluZSBNVFBfRk9STUFUX1dNViAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5ODEKKyNkZWZpbmUgTVRQX0ZPUk1BVF9NUDRfQ09OVEFJTkVSICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTgyICAvLyBJU08gMTQ0OTYtMQorI2RlZmluZSBNVFBfRk9STUFUX01QMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5ODMKKyNkZWZpbmUgTVRQX0ZPUk1BVF8zR1BfQ09OVEFJTkVSICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTg0ICAvLyAzR1BQIGZpbGUgZm9ybWF0LiBEZXRhaWxzOiBodHRwOi8vd3d3LjNncHAub3JnL2Z0cC9TcGVjcy9odG1sLWluZm8vMjYyNDQuaHRtIChwYWdlIHRpdGxlIC0gXHUyMDFjVHJhbnNwYXJlbnQgZW5kLXRvLWVuZCBwYWNrZXQgc3dpdGNoZWQgc3RyZWFtaW5nIHNlcnZpY2UsIDNHUFAgZmlsZSBmb3JtYXRcdTIwMWQpLgorI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9DT0xMRUNUSU9OICAgICAgICAgICAgICAgICAweEJBMDAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BQlNUUkFDVF9NVUxUSU1FRElBX0FMQlVNICAg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T1JNQVRfTTNVX1BMQVlMSVNUICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkExMQorI2RlZmluZSBNVFBfRk9STUFUX01QTF9QTEFZTElTVCAgICAgICAgICAgICAgICAgICAgICAgICAweEJBMTIKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BU1hfUExBWUxJU1QgICAgICAgICAgICAgICAgICAgICAgICAgMHhCQTEzCisjZGVmaW5lIE1UUF9GT1JNQVRfUExTX1BMQVlMSVNUICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkExNAorI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9ET0NVTUVOVCAgICAgICAgICAgICAgICAgICAweEJBODAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BQlNUUkFDVF9ET0NVTUVOVCAgICAgICAgICAgICAgICAgICAgMHhCQTgxCisjZGVmaW5lIE1UUF9GT1JNQVRfWE1MX0RPQ1VNRU5UICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkE4MgorI2RlZmluZSBNVFBfRk9STUFUX01TX1dPUkRfRE9DVU1FTlQgICAgICAgICAgICAgICAgICAgICAweEJBODMKKyNkZWZpbmUgTVRQX0ZPUk1BVF9NSFRfQ09NUElMRURfSFRNTF9ET0NVTUVOVCAgICAgICAgICAgMHhCQTg0CisjZGVmaW5lIE1UUF9GT1JNQVRfTVNfRVhDRUxfU1BSRUFEU0hFRVQgICAgICAgICAgICAgICAgIDB4QkE4NQorI2RlZmluZSBNVFBfRk9STUFUX01TX1BPV0VSUE9JTlRfUFJFU0VOVEFUSU9OICAgICAgICAgICAweEJBODYKKyNkZWZpbmUgTVRQX0ZPUk1BVF9VTkRFRklORURfTUVTU0FHRSAgICAgICAgICAgICAgICAgICAgMHhCQjAwCisjZGVmaW5lIE1UUF9GT1JNQVRfQUJTVFJBQ1RfTUVTU1NBR0UgICAgICAgICAgICAgICAgICAgIDB4QkIwMQorI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9DT05UQUNUICAgICAgICAgICAgICAgICAgICAweEJCODAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BQlNUUkFDVF9DT05UQUNUICAgICAgICAgICAgICAgICAgICAgMHhCQjgxCisjZGVmaW5lIE1UUF9GT1JNQVRfVkNBUkRfMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkI4MgorCisvLyBNVFAgT2JqZWN0IFByb3BlcnR5IENvZGVzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TVE9SQUdFX0lEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX09CSkVDVF9GT1JNQVQgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwMgorI2RlZmluZSBNVFBfUFJPUEVSVFlfUFJPVEVDVElPTl9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgMHhEQzAzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9PQkpFQ1RfU0laRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FTU09DSUFUSU9OX1RZUEUgICAgICAgICAgICAgICAgICAgICAgIDB4REMwNQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQVNTT0NJQVRJT05fREVTQyAgICAgICAgICAgICAgICAgICAgICAgMHhEQzA2CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9PQkpFQ1RfRklMRV9OQU1FICAgICAgICAgICAgICAgICAgICAgICAweERDMDcKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0RBVEVfQ1JFQVRFRCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwOAorI2RlZmluZSBNVFBfUFJPUEVSVFlfREFURV9NT0RJRklFRCAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzA5CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9LRVlXT1JEUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BBUkVOVF9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwQgorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUxMT1dFRF9GT0xERVJfQ09OVEVOVFMgICAgICAgICAgICAgICAgMHhEQzBDCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9ISURERU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NZU1RFTV9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwRQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEVSU0lTVEVOVF9VSUQgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TWU5DX0lEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BST1BFUlRZX0JBRyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0MworI2RlZmluZSBNVFBfUFJPUEVSVFlfTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQ0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9DUkVBVEVEX0JZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FSVElTVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0NgorI2RlZmluZSBNVFBfUFJPUEVSVFlfREFURV9BVVRIT1JFRCAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQ3CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9ERVNDUklQVElPTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDgKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1VSTF9SRUZFUkVOQ0UgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0OQorI2RlZmluZSBNVFBfUFJPUEVSVFlfTEFOR1VBR0VfTE9DQUxFICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzRBCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9DT1BZUklHSFRfSU5GT1JNQVRJT04gICAgICAgICAgICAgICAgICAweERDNEIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NPVVJDRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0QworI2RlZmluZSBNVFBfUFJPUEVSVFlfT1JJR0lOX0xPQ0FUSU9OICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzRECisjZGVmaW5lIE1UUF9QUk9QRVJUWV9EQVRFX0FEREVEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNEUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX05PTl9DT05TVU1BQkxFICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0RgorI2RlZmluZSBNVFBfUFJPUEVSVFlfQ09SUlVQVF9VTlBMQVlBQkxFICAgICAgICAgICAgICAgICAgICAgMHhEQzUwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QUk9EVUNFUl9TRVJJQUxfTlVNQkVSICAgICAgICAgICAgICAgICAweERDNTEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1JFUFJFU0VOVEFUSVZFX1NBTVBMRV9GT1JNQVQgICAgICAgICAgIDB4REM4MQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX1NJWkUgICAgICAgICAgICAgMHhEQzgyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfSEVJR0hUICAgICAgICAgICAweERDODMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1JFUFJFU0VOVEFUSVZFX1NBTVBMRV9XSURUSCAgICAgICAgICAgIDB4REM4NAorI2RlZmluZSBNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX0RVUkFUSU9OICAgICAgICAgMHhEQzg1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfREFUQSAgICAgICAgICAgICAweERDODYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1dJRFRIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4NworI2RlZmluZSBNVFBfUFJPUEVSVFlfSEVJR0hUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzg4CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9EVVJBVElPTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDODkKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1JBVElORyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4QQorI2RlZmluZSBNVFBfUFJPUEVSVFlfVFJBQ0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzhCCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9HRU5SRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0NSRURJVFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4RAorI2RlZmluZSBNVFBfUFJPUEVSVFlfTFlSSUNTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzhFCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUJTQ1JJUFRJT05fQ09OVEVOVF9JRCAgICAgICAgICAgICAgICAweERDOEYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BST0RVQ0VEX0JZICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MAorI2RlZmluZSBNVFBfUFJPUEVSVFlfVVNFX0NPVU5UICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzkxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TS0lQX0NPVU5UICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0xBU1RfQUNDRVNTRUQgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MworI2RlZmluZSBNVFBfUFJPUEVSVFlfUEFSRU5UQUxfUkFUSU5HICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzk0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVRBX0dFTlJFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0NPTVBPU0VSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5NgorI2RlZmluZSBNVFBfUFJPUEVSVFlfRUZGRUNUSVZFX1JBVElORyAgICAgICAgICAgICAgICAgICAgICAgMHhEQzk3CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUJUSVRMRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTgKKyNkZWZpbmUgTVRQX1BST1BFUlRZX09SSUdJTkFMX1JFTEVBU0VfREFURSAgICAgICAgICAgICAgICAgIDB4REM5OQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUxCVU1fTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzlBCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BTEJVTV9BUlRJU1QgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOUIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01PT0QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5QworI2RlZmluZSBNVFBfUFJPUEVSVFlfRFJNX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzlECisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUJfREVTQ1JJUFRJT04gICAgICAgICAgICAgICAgICAgICAgICAweERDOUUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0lTX0NST1BQRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENEMQorI2RlZmluZSBNVFBfUFJPUEVSVFlfSVNfQ09MT1VSX0NPUlJFQ1RFRCAgICAgICAgICAgICAgICAgICAgMHhEQ0QyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9JTUFHRV9CSVRfREVQVEggICAgICAgICAgICAgICAgICAgICAgICAweERDRDMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0ZfTlVNQkVSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENENAorI2RlZmluZSBNVFBfUFJPUEVSVFlfRVhQT1NVUkVfVElNRSAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0Q1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FWFBPU1VSRV9JTkRFWCAgICAgICAgICAgICAgICAgICAgICAgICAweERDRDYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1RPVEFMX0JJVFJBVEUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5MQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQklUUkFURV9UWVBFICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERTkyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TQU1QTEVfUkFURSAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX05VTUJFUl9PRl9DSEFOTkVMUyAgICAgICAgICAgICAgICAgICAgIDB4REU5NAorI2RlZmluZSBNVFBfUFJPUEVSVFlfQVVESU9fQklUX0RFUFRIICAgICAgICAgICAgICAgICAgICAgICAgMHhERTk1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TQ0FOX1RZUEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTcKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FVRElPX1dBVkVfQ09ERUMgICAgICAgICAgICAgICAgICAgICAgIDB4REU5OQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQVVESU9fQklUUkFURSAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERTlBCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9WSURFT19GT1VSQ0NfQ09ERUMgICAgICAgICAgICAgICAgICAgICAweERFOUIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1ZJREVPX0JJVFJBVEUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5QworI2RlZmluZSBNVFBfUFJPUEVSVFlfRlJBTUVTX1BFUl9USE9VU0FORF9TRUNPTkRTICAgICAgICAgICAgMHhERTlECisjZGVmaW5lIE1UUF9QUk9QRVJUWV9LRVlGUkFNRV9ESVNUQU5DRSAgICAgICAgICAgICAgICAgICAgICAweERFOUUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0JVRkZFUl9TSVpFICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5RgorI2RlZmluZSBNVFBfUFJPUEVSVFlfRU5DT0RJTkdfUVVBTElUWSAgICAgICAgICAgICAgICAgICAgICAgMHhERUEwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FTkNPRElOR19QUk9GSUxFICAgICAgICAgICAgICAgICAgICAgICAweERFQTEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0RJU1BMQVlfTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMAorI2RlZmluZSBNVFBfUFJPUEVSVFlfQk9EWV9URVhUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0UxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUJKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRTIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BSSU9SSVRZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMworI2RlZmluZSBNVFBfUFJPUEVSVFlfR0lWRU5fTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDAwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NSURETEVfTkFNRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0ZBTUlMWV9OQU1FICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwMgorI2RlZmluZSBNVFBfUFJPUEVSVFlfUFJFRklYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDAzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUZGSVggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FVElDX0dJVkVOX05BTUUgICAgICAgICAgICAgICAgICAgIDB4REQwNQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVUSUNfRkFNSUxZX05BTUUgICAgICAgICAgICAgICAgICAgMHhERDA2CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FTUFJTF9QUklNQVJZICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDcKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VNQUlMX1BFUlNPTkFMXzEgICAgICAgICAgICAgICAgICAgICAgIDB4REQwOAorI2RlZmluZSBNVFBfUFJPUEVSVFlfRU1BSUxfUEVSU09OQUxfMiAgICAgICAgICAgICAgICAgICAgICAgMHhERDA5CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FTUFJTF9CVVNJTkVTU18xICAgICAgICAgICAgICAgICAgICAgICAweEREMEEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VNQUlMX0JVU0lORVNTXzIgICAgICAgICAgICAgICAgICAgICAgIDB4REQwQgorI2RlZmluZSBNVFBfUFJPUEVSVFlfRU1BSUxfT1RIRVJTICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDBDCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfUFJJTUFSWSAgICAgICAgICAgICAgICAgICAweEREMEQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9QRVJTT05BTCAgICAgICAgICAgICAgICAgIDB4REQwRQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX1BFUlNPTkFMXzIgICAgICAgICAgICAgICAgMHhERDBGCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfQlVTSU5FU1MgICAgICAgICAgICAgICAgICAweEREMTAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9CVVNJTkVTU18yICAgICAgICAgICAgICAgIDB4REQxMQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX01PQklMRSAgICAgICAgICAgICAgICAgICAgMHhERDEyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfTU9CSUxFXzIgICAgICAgICAgICAgICAgICAweEREMTMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0ZBWF9OVU1CRVJfUFJJTUFSWSAgICAgICAgICAgICAgICAgICAgIDB4REQxNAorI2RlZmluZSBNVFBfUFJPUEVSVFlfRkFYX05VTUJFUl9QRVJTT05BTCAgICAgICAgICAgICAgICAgICAgMHhERDE1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9GQVhfTlVNQkVSX0JVU0lORVNTICAgICAgICAgICAgICAgICAgICAweEREMTYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BBR0VSX05VTUJFUiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQxNworI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX09USEVSUyAgICAgICAgICAgICAgICAgICAgMHhERDE4CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QUklNQVJZX1dFQl9BRERSRVNTICAgICAgICAgICAgICAgICAgICAweEREMTkKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BFUlNPTkFMX1dFQl9BRERSRVNTICAgICAgICAgICAgICAgICAgIDB4REQxQQorI2RlZmluZSBNVFBfUFJP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ZGVmaW5lIE1UUF9QUk9QRVJUWV9PUkdBTklaQVRJT05fTkFNRSAgICAgICAgICAgICAgICAgICAgICAweEREMzQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FVElDX09SR0FOSVpBVElPTl9OQU1FICAgICAgICAgICAgIDB4REQzNQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUk9MRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDM2CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9CSVJUSERBVEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMzcKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01FU1NBR0VfVE8gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0MAorI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVTU0FHRV9DQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDQxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVNTQUdFX0JDQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENDIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01FU1NBR0VfUkVBRCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0MworI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVTU0FHRV9SRUNFSVZFRF9USU1FICAgICAgICAgICAgICAgICAgMHhERDQ0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVNTQUdFX1NFTkRFUiAgICAgICAgICAgICAgICAgICAgICAgICAweERENDUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX0JFR0lOX1RJTUUgICAgICAgICAgICAgICAgICAgIDB4REQ1MAorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfRU5EX1RJTUUgICAgICAgICAgICAgICAgICAgICAgMHhERDUxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9MT0NBVElPTiAgICAgICAgICAgICAgICAgICAgICAweERENTIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX1JFUVVJUkVEX0FUVEVOREVFUyAgICAgICAgICAgIDB4REQ1NAorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfT1BUSU9OQUxfQVRURU5ERUVTICAgICAgICAgICAgMHhERDU1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9SRVNPVVJDRVMgICAgICAgICAgICAgICAgICAgICAweERENTYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX0FDQ0VQVEVEICAgICAgICAgICAgICAgICAgICAgIDB4REQ1NworI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfVEVOVEFUSVZFICAgICAgICAgICAgICAgICAgICAgMHhERDU4CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9ERUNMSU5FRCAgICAgICAgICAgICAgICAgICAgICAweERENTkKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX1JFTUFJTkRFUl9USU1FICAgICAgICAgICAgICAgIDB4REQ1QQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfT1dORVIgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDVCCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgICAweERENUMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX09XTkVSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1RAorI2RlZmluZSBNVFBfUFJPUEVSVFlfRURJVE9SICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDVFCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9XRUJNQVNURVIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENUYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1VSTF9TT1VSQ0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MAorI2RlZmluZSBNVFBfUFJPUEVSVFlfVVJMX0RFU1RJTkFUSU9OICAgICAgICAgICAgICAgICAgICAgICAgMHhERDYxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9USU1FX0JPT0tNQVJLICAgICAgICAgICAgICAgICAgICAgICAgICAweERENjIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX09CSkVDVF9CT09LTUFSSyAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MworI2RlZmluZSBNVFBfUFJPUEVSVFlfQllURV9CT09LTUFSSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDY0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9MQVNUX0JVSUxEX0RBVEUgICAgICAgICAgICAgICAgICAgICAgICAweERENzAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1RJTUVfVE9fTElWRSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ3MQorI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVESUFfR1VJRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDcyCisKKy8vIE1UUCBEZXZpY2UgUHJvcGVydHkgQ29kZXMKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9VTkRFRklORUQgICAgICAgICAgICAgICAgICAgICAgIDB4NTAwMAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0JBVFRFUllfTEVWRUwgICAgICAgICAgICAgICAgICAgMHg1MDAxCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRlVOQ1RJT05BTF9NT0RFICAgICAgICAgICAgICAgICAweDUwMDIKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9JTUFHRV9TSVpFICAgICAgICAgICAgICAgICAgICAgIDB4NTAwMworI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0NPTVBSRVNTSU9OX1NFVFRJTkcgICAgICAgICAgICAgMHg1MDA0CisjZGV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VFlfREFURVRJTUUgICAgICAgICAgICAgICAgICAgICAgICAweDUwMTEKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9DQVBUVVJFX0RFTEFZICAgICAgICAgICAgICAgICAgIDB4NTAxMgorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1NUSUxMX0NBUFRVUkVfTU9ERSAgICAgICAgICAgICAgMHg1MDEzCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfQ09OVFJBU1QgICAgICAgICAgICAgICAgICAgICAgICAweDUwMTQKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9TSEFSUE5FU1MgICAgICAgICAgICAgICAgICAgICAgIDB4NTAxNQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0RJR0lUQUxfWk9PTSAgICAgICAgICAgICAgICAgICAgMHg1MDE2CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRUZGRUNUX01PREUgICAgICAgICAgICAgICAgICAgICAweDUwMTcKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9CVVJTVF9OVU1CRVIgICAgICAgICAgICAgICAgICAgIDB4NTAxOAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0JVUlNUX0lOVEVSVkFMICAgICAgICAgICAgICAgICAgMHg1MDE5CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfVElNRUxBUFNFX05VTUJFUiAgICAgICAgICAgICAgICAweDUwMUEKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9USU1FTEFQU0VfSU5URVJWQUwgICAgICAgICAgICAgIDB4NTAxQgorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0ZPQ1VTX01FVEVSSU5HX01PREUgICAgICAgICAgICAgMHg1MDFDCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfVVBMT0FEX1VSTCAgICAgICAgICAgICAgICAgICAgICA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IE9wZXJhdGlvbiBDb2RlcworI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9ERVZJQ0VfSU5GTyAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAxCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fT1BFTl9TRVNTSU9OICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDIKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9DTE9TRV9TRVNTSU9OICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwMworI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9TVE9SQUdFX0lEUyAgICAgICAgICAgICAgICAgICAgICAgMHgxMDA0CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX1NUT1JBR0VfSU5GTyAgICAgICAgICAgICAgICAgICAgICAweDEwMDUKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfTlVNX09CSkVDVFMgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwNgorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfSEFORExFUyAgICAgICAgICAgICAgICAgICAgMHgxMDA3CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9JTkZPICAgICAgICAgICAgICAgICAgICAgICAweDEwMDgKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwOQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9USFVNQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDBBCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fREVMRVRFX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMEIKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9TRU5EX09CSkVDVF9JTkZPICAgICAgICAgICAgICAgICAgICAgIDB4MTAwQworI2RlZmluZSBNVFBfT1BFUkFUSU9OX1NFTkRfT0JKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDBECisjZGVmaW5lIE1UUF9PUEVSQVRJT05fSU5JVElBVEVfQ0FQVFVSRSAgICAgICAgICAgICAgICAgICAgICAweDEwMEUKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9GT1JNQVRfU1RPUkUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwRgorI2RlZmluZSBNVFBfT1BFUkFUSU9OX1JFU0VUX0RFVklDRSAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDEwCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fU0VMRl9URVNUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMTEKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9TRVRfT0JKRUNUX1BST1RFQ1RJT04gICAgICAgICAgICAgICAgIDB4MTAxMgorI2RlZmluZSBNVFBfT1BFUkFUSU9OX1BPV0VSX0RPV04gICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDEzCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX0RFVklDRV9QUk9QX0RFU0MgICAgICAgICAgICAgICAgICAweDEwMTQKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfREVWSUNFX1BST1BfVkFMVUUgICAgICAgICAgICAgICAgIDB4MTAxNQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX1NFVF9ERVZJQ0VfUFJPUF9WQUxVRSAgICAgICAgICAgICAgICAgMHgxMDE2CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fUkVTRVRfREVWSUNFX1BST1BfVkFMVUUgICAgICAgICAgICAgICAweDEwMTcKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9URVJNSU5BVEVfT1BFTl9DQVBUVVJFICAgICAgICAgICAgICAgIDB4MTAxOAorI2RlZmluZSBNVFBfT1BFUkFUSU9OX01PVkVfT0JKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDE5CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fQ09QWV9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMUEKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfUEFSVElBTF9PQkpFQ1QgICAgICAgICAgICAgICAgICAgIDB4MTAxQgorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0lOSVRJQVRFX09QRU5fQ0FQVFVSRSAgICAgICAgICAgICAgICAgMHgxMDFDCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9QUk9QU19TVVBQT1JURUQgICAgICAgICAgICAweDk4MDEKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUX1BST1BfREVTQyAgICAgICAgICAgICAgICAgIDB4OTgwMgorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUFJPUF9WQUxVRSAgICAgICAgICAgICAgICAgMHg5ODAzCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fU0VUX09CSkVDVF9QUk9QX1ZBTFVFICAgICAgICAgICAgICAgICAweDk4MDQKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUX1JFRkVSRU5DRVMgICAgICAgICAgICAgICAgIDB4OTgxMAorI2RlZmluZSBNVFBfT1BFUkFUSU9OX1NFVF9PQkpFQ1RfUkVGRVJFTkNFUyAgICAgICAgICAgICAgICAgMHg5ODExCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fU0tJUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDk4MjAKKworLy8gTVRQIFJlc3BvbnNlIENvZGVzCisjZGVmaW5lIE1UUF9SRVNQT05TRV9VTkRFRklORUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAwCisjZGVmaW5lIE1UUF9SRVNQT05TRV9PSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAxCisjZGVmaW5lIE1UUF9SRVNQT05TRV9HRU5FUkFMX0VSUk9SICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAyCisjZGVmaW5lIE1UUF9SRVNQT05TRV9TRVNTSU9OX05PVF9PUEVOICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAzCisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX1RSQU5TQUNUSU9OX0lEICAgICAgICAgICAgICAgICAgICAgMHgyMDA0CisjZGVmaW5lIE1UUF9SRVNQT05TRV9PUEVSQVRJT05fTk9UX1NVUFBPUlRFRCAgICAgICAgICAgICAgICAgICAgMHgyMDA1CisjZGVmaW5lIE1UUF9SRVNQT05TRV9QQVJBTUVURVJfTk9UX1NVUFBPUlRFRCAgICAgICAgICAgICAgICAgICAgMHgyMDA2CisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTkNPTVBMRVRFX1RSQU5TRkVSICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDA3CisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX1NUT1JBR0VfSUQgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDA4CisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX09CSkVDVF9IQU5ETEUgICAgICAgICAgICAgICAgICAgICAgMHgyMDA5CisjZGVmaW5lIE1UUF9SRVNQT05TRV9ERVZJQ0VfUFJPUF9OT1RfU1VQUE9SVEVEICAgICAgICAgICAgICAgICAgMHgyMDBBCisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX09CSkVDVF9GT1JNQVRfQ09ERSAgICAgICAgICAgICAgICAgMHgyMDBCCisjZGVmaW5lIE1UUF9SRVNQT05TRV9TVE9SQUdFX0ZVTEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDBDCisjZGVmaW5lIE1UUF9SRVNQT05TRV9PQkpFQ1RfV1JJVEVfUFJPVEVDVEVEICAgICAgICAgICAgICAgICAgICAgMHgyMDBECisjZGVmaW5lIE1UUF9SRVNQT05TRV9TVE9SRV9SRUFEX09OTFkgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDBFCisjZGVmaW5lIE1UUF9SRVNQT05TRV9BQ0NFU1NfREVOSUVEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDBGCisjZGVmaW5lIE1UUF9SRVNQT05TRV9OT19USFVNQk5BSUxfUFJFU0VOVCAgICAgICAgICAgICAgICAgICAgICAgMHgyMDEwCisjZGVmaW5lIE1UUF9SRVNQT05TRV9TRUxGX1RFU1RfRkFJTEVEICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDExCisjZGVmaW5lIE1UUF9SRVNQT05TRV9QQVJUSUFMX0RFTEVUSU9OICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDEyCisjZGVmaW5lIE1UUF9SRVNQT05TRV9TVE9SRV9OT1RfQVZBSUxBQkxFICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDEzCisjZGVmaW5lIE1UUF9SRVNQT05TRV9TUEVDSUZJQ0FUSU9OX0JZX0ZPUk1BVF9VTlNVUFBPUlRFRCAgICAgICAgMHgyMDE0CisjZGVmaW5lIE1UUF9SRVNQT05TRV9OT19WQUxJRF9PQkpFQ1RfSU5GTyAgICAgICAgICAgICAgICAgICAgICAgMHgyMDE1CisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX0NPREVfRk9STUFUICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDE2CisjZGVmaW5lIE1UUF9SRVNQT05TRV9VTktOT1dOX1ZFTkRPUl9DT0RFICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDE3CisjZGVmaW5lIE1UUF9SRVNQT05TRV9DQVBUVVJFX0FMUkVBRFlfVEVSTUlOQVRFRCAgICAgICAgICAgICAgICAgMHgyMDE4CisjZGVmaW5lIE1UUF9SRVNQT05TRV9ERVZJQ0VfQlVTWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDE5CisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX1BBUkVOVF9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgMHgyMDFBCisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX0RFVklDRV9QUk9QX0ZPUk1BVCAgICAgICAgICAgICAgICAgMHgyMDFCCisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX0RFVklDRV9QUk9QX1ZBTFVFICAgICAgICAgICAgICAgICAgMHgyMDFDCisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX1BBUkFNRVRFUiAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDFECisjZGVmaW5lIE1UUF9SRVNQT05TRV9TRVNTSU9OX0FMUkVBRFlfT1BFTiAgICAgICAgICAgICAgICAgICAgICAgMHgyMDFFCisjZGVmaW5lIE1UUF9SRVNQT05TRV9UUkFOU0FDVElPTl9DQU5DRUxMRUQgICAgICAgICAgICAgICAgICAgICAgMHgyMDFGCisjZGVmaW5lIE1UUF9SRVNQT05TRV9TUEVDSUZJQ0FUSU9OX09GX0RFU1RJTkFUSU9OX1VOU1VQUE9SVEVEICAgMHgyMDIwCisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX09CSkVDVF9QUk9QX0NPREUgICAgICAgICAgICAgICAgICAgMHhBODAxCisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX09CSkVDVF9QUk9QX0ZPUk1BVCAgICAgICAgICAgICAgICAgMHhBODAyCisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX09CSkVDVF9QUk9QX1ZBTFVFICAgICAgICAgICAgICAgICAgMHhBODAzCisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX09CSkVDVF9SRUZFUkVOQ0UgICAgICAgICAgICAgICAgICAgMHhBODA0CisjZGVmaW5lIE1UUF9SRVNQT05TRV9HUk9VUF9OT1RfU1VQUE9SVEVEICAgICAgICAgICAgICAgICAgICAgICAgMHhBODA1CisjZGVmaW5lIE1UUF9SRVNQT05TRV9JTlZBTElEX0RBVEFTRVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhBODA2CisjZGVmaW5lIE1UUF9SRVNQT05TRV9TUEVDSUZJQ0FUSU9OX0JZX0dST1VQX1VOU1VQUE9SVEVEICAgICAgICAgMHhBODA3CisjZGVmaW5lIE1UUF9SRVNQT05TRV9TUEVDSUZJQ0FUSU9OX0JZX0RFUFRIX1VOU1VQUE9SVEVEICAgICAgICAgMHhBODA4CisjZGVmaW5lIE1UUF9SRVNQT05TRV9PQkpFQ1RfVE9PX0xBUkdFICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhBODA5CisjZGVmaW5lIE1UUF9SRVNQT05TRV9PQkpFQ1RfUFJPUF9OT1RfU1VQUE9SVEVEICAgICAgICAgICAgICAgICAgMHhBODBBCisKKy8vIE1UUCBFdmVudCBDb2RlcworI2RlZmluZSBNVFBfRVZFTlRfVU5ERUZJTkVEICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwMAorI2RlZmluZSBNVFBfRVZFTlRfQ0FOQ0VMX1RSQU5TQUNUSU9OICAgICAgICAgICAgICAgIDB4NDAwMQorI2RlZmluZSBNVFBfRVZFTlRfT0JKRUNUX0FEREVEICAgICAgICAgICAgICAgICAgICAgIDB4NDAwMgorI2RlZmluZSBNVFBfRVZFTlRfT0JKRUNUX1JFTU9WRUQgICAgICAgICAgICAgICAgICAgIDB4NDAwMworI2RlZmluZSBNVFBfRVZFTlRfU1RPUkVfQURERUQgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwNAorI2RlZmluZSBNVFBfRVZFTlRfU1RPUkVfUkVNT1ZFRCAgICAgICAgICAgICAgICAgICAgIDB4NDAwNQorI2RlZmluZSBNVFBfRVZFTlRfREVWSUNFX1BST1BfQ0hBTkdFRCAgICAgICAgICAgICAgIDB4NDAwNgorI2RlZmluZSBNVFBfRVZFTlRfT0JKRUNUX0lORk9fQ0hBTkdFRCAgICAgICAgICAg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ICAgICAgICAgICAgdXJpID0gTXRwLk9iamVjdC5nZXRDb250ZW50VXJpRm9yU3RvcmFnZUNoaWxkcmVuKG1EZXZpY2VJRCwgbVN0b3JhZ2VJRCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHVyaSA9IE10cC5PYmplY3QuZ2V0Q29udGVudFVyaUZvck9iamVjdENoaWxkcmVuKG1EZXZpY2VJRCwgbU9iamVjdElEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIExvZy5kKFRBRywgInF1ZXJ5ICIgKyB1cmkpOworICAgICAgICAgICAgYyA9IGdldENvbnRlbnRSZXNvbHZlcigpLnF1ZXJ5KHVyaSwgT0JKRUNUX0NPTFVNTlMsIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICAgICAgc3RhcnRNYW5hZ2luZ0N1cnNvcihjKTsKKyAgICAgICAgICAgIG1DdXJzb3IgPSBjOworCisgICAgICAgICAgICAvLyBNYXAgQ3Vyc29yIGNvbHVtbnMgdG8gdmlld3MgZGVmaW5lZCBpbiBzaW1wbGVfbGlzdF9pdGVtXzEueG1sCisgICAgICAgICAgICBtQWRhcHRlciA9IG5ldyBPYmplY3RDdXJzb3JBZGFwdGVyKHRoaXMsIGMpOworICAgICAgICAgICAgc2V0TGlzdEFkYXB0ZXIobUFkYXB0ZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25MaXN0SXRlbUNsaWNrKExpc3RWaWV3IGwsIFZpZXcgdiwgaW50IHBvc2l0aW9uLCBsb25nIGlkKSB7CisgICAgICAgIGxvbmcgcm93SUQgPSBtQWRhcHRlci5nZXRJdGVtSWQocG9zaXRpb24pOworICAgICAgICBDdXJzb3IgYyA9IGdldENvbnRlbnRSZXNvbHZlcigpLnF1ZXJ5KAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5nZXRDb250ZW50VXJpKG1EZXZpY2VJRCwgcm93SUQpLAorICAgICAgICAgICAgICAgICAgICAgICAgT0JKRUNUX0NPTFVNTlMsIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICBMb2cuZChUQUcsICJxdWVyeSByZXR1cm5lZCAiICsgYyArICIgY291bnQ6ICIgKyBjLmdldENvdW50KCkpOworICAgICAgICBsb25nIGZvcm1hdCA9IDA7CisgICAgICAgIGlmIChjICE9IG51bGwgJiYgYy5nZXRDb3VudCgpID09IDEpIHsKKyAgICAgICAgICAgIGMubW92ZVRvRmlyc3QoKTsKKyAgICAgICAgICAgIGxvbmcgcm93SWQgPSBjLmdldExvbmcoSURfQ09MVU1OKTsKKyAgICAgICAgICAgIFN0cmluZyBuYW1lID0gYy5nZXRTdHJpbmcoTkFNRV9DT0xVTU4pOworICAgICAgICAgICAgZm9ybWF0ID0gYy5nZXRMb25nKEZPUk1BVF9DT0xVTU4pOworICAgICAgICAgICAgTG9nLmQoVEFHLCAicm93SWQ6ICIgKyByb3dJZCArICIgbmFtZTogIiArIG5hbWUgKyAiIGZvcm1hdDogIiArIGZvcm1hdCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZvcm1hdCA9PSBNdHBDb25zdGFudHMuRk9STUFUX0FTU09DSUFUSU9OKSB7CisgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCh0aGlzLCBPYmplY3RCcm93c2VyLmNsYXNzKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgiZGV2aWNlIiwgbURldmljZUlEKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgic3RvcmFnZSIsIG1TdG9yYWdlSUQpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJvYmplY3QiLCByb3dJRCk7CisgICAgICAgICAgICBzdGFydEFjdGl2aXR5KGludGVudCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCh0aGlzLCBPYmplY3RWaWV3ZXIuY2xhc3MpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJkZXZpY2UiLCBtRGV2aWNlSUQpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJzdG9yYWdlIiwgbVN0b3JhZ2VJRCk7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoIm9iamVjdCIsIHJvd0lEKTsKKyAgICAgICAgICAgIHN0YXJ0QWN0aXZpdHkoaW50ZW50KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgT2JqZWN0Q3Vyc29yQWRhcHRlciBleHRlbmRzIFJlc291cmNlQ3Vyc29yQWRhcHRlciB7CisKKyAgICAgICAgcHVibGljIE9iamVjdEN1cnNvckFkYXB0ZXIoQ29udGV4dCBjb250ZXh0LCBDdXJzb3IgYykgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgUi5sYXlvdXQub2JqZWN0X2xpc3QsIGMpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGJpbmRWaWV3KFZpZXcgdmlldywgQ29udGV4dCBjb250ZXh0LCBDdXJzb3IgY3Vyc29yKSB7CisgICAgICAgICAgICBJbWFnZVZpZXcgdGh1bWJWaWV3ID0gKEltYWdlVmlldyl2aWV3LmZpbmRWaWV3QnlJZChSLmlkLnRodW1ibmFpbCk7CisgICAgICAgICAgICBUZXh0VmlldyBuYW1lVmlldyA9IChUZXh0Vmlldyl2aWV3LmZpbmRWaWV3QnlJZChSLmlkLm5hbWUpOworCisgICAgICAgICAgICAvLyBnZXQgdGhlIHRodW1ibmFpbAorICAgICAgICAgICAgYnl0ZVtdIHRodW1ibmFpbCA9IGN1cnNvci5nZXRCbG9iKFRIVU1CX0NPTFVNTik7CisgICAgICAgICAgICBpZiAodGh1bWJuYWlsICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBCaXRtYXAgYml0bWFwID0gQml0bWFwRmFjdG9yeS5kZWNvZGVCeXRlQXJyYXkodGh1bWJuYWlsLCAwLCB0aHVtYm5haWwubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBpZiAoYml0bWFwICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGh1bWJWaWV3LnNldEltYWdlQml0bWFwKGJpdG1hcCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBnZXQgdGhlIG5hbWUKKyAgICAgICAgICAgIFN0cmluZyBuYW1lID0gY3Vyc29yLmdldFN0cmluZyhOQU1FX0NPTFVNTik7CisgICAgICAgICAgICBpZiAobmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbmFtZSA9ICIiOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbmFtZVZpZXcuc2V0VGV4dChuYW1lKTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL21lZGlhL3Rlc3RzL0NhbWVyYUJyb3dzZXIvc3JjL2NvbS9hbmRyb2lkL2NhbWVyYWJyb3dzZXIvT2JqZWN0Vmlld2VyLmphdmEgYi9tZWRpYS90ZXN0cy9DYW1lcmFCcm93c2VyL3NyYy9jb20vYW5kcm9pZC9jYW1lcmFicm93c2VyL09iamVjdFZpZXdlci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjlmMmY5OGUKLS0tIC9kZXYvbnVsbAorKysgYi9tZWRpYS90ZXN0cy9DYW1lcmFCcm93c2VyL3NyYy9jb20vYW5kcm9pZC9jYW1lcmFicm93c2VyL09iamVjdFZpZXdlci5qYXZhCkBAIC0wLDAgKzEsMjU0IEBACisvKgorICogQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QKKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5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FsIFN0cmluZ1tdIE9CSkVDVF9DT0xVTU5TID0KKyAgICAgICAgbmV3IFN0cmluZ1tdIHsgIE10cC5PYmplY3QuX0lELAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5OQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5TSVpFLAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5USFVNQl9XSURUSCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuVEhVTUJfSEVJR0hULAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5USFVNQl9TSVpFLAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5JTUFHRV9XSURUSCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuSU1BR0VfSEVJR0hULAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5JTUFHRV9ERVBUSCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuU0VRVUVOQ0VfTlVNQkVSLAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5EQVRFX0NSRUFURUQsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LkRBVEVfTU9ESUZJRUQsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LktFWVdPUkRTLAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5USFVNQiwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuRk9STUFULAorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKKworICAgICAgICBzZXRDb250ZW50VmlldyhSLmxheW91dC5vYmplY3RfaW5mbyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25SZXN1bWUoKSB7CisgICAgICAgIHN1cGVyLm9uUmVzdW1lKCk7CisKKyAgICAgICAgbURldmljZUlEID0gZ2V0SW50ZW50KCkuZ2V0SW50RXh0cmEoImRldmljZSIsIDApOworICAgICAgICBtU3RvcmFnZUlEID0gZ2V0SW50ZW50KCkuZ2V0TG9uZ0V4dHJhKCJzdG9yYWdlIiwgMCk7CisgICAgICAgIG1PYmplY3RJRCA9IGdldEludGVudCgpLmdldExvbmdFeHRyYSgib2JqZWN0IiwgMCk7CisKKyAgICAgICAgaWYgKG1EZXZpY2VJRCAhPSAwICYmIG1PYmplY3RJRCAhPSAwKSB7CisgICAgICAgIEN1cnNvciBjID0gZ2V0Q29udGVudFJlc29sdmVyKCkucXVlcnkoCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LmdldENvbnRlbnRVcmkobURldmljZUlELCBtT2JqZWN0SUQpLAorICAgICAgICAgICAgICAgICAgICAgICAgT0JKRUNUX0NPTFVNTlMsIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICAgICAgYy5tb3ZlVG9GaXJzdCgpOworICAgICAgICAgICAgVGV4dFZpZXcgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5uYW1lKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChjLmdldFN0cmluZygxKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLnNpemUpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9TdHJpbmcoYy5nZXRMb25nKDIpKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLnRodW1iX3dpZHRoKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZygzKSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC50aHVtYl9oZWlnaHQpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9TdHJpbmcoYy5nZXRMb25nKDQpKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLnRodW1iX3NpemUpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9TdHJpbmcoYy5nZXRMb25nKDUpKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLndpZHRoKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZyg2KSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5oZWlnaHQpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9TdHJpbmcoYy5nZXRMb25nKDcpKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLmRlcHRoKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZyg4KSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5zZXF1ZW5jZSk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoTG9uZy50b1N0cmluZyhjLmdldExvbmcoOSkpKTsKKyAgICAgICAgICAgIHZpZXcgPSAoVGV4dFZpZXcpZmluZFZpZXdCeUlkKFIuaWQuY3JlYXRlZCk7CisgICAgICAgICAgICBEYXRlIGRhdGUgPSBuZXcgRGF0ZShjLmdldExvbmcoMTApICogMTAwMCk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoZGF0ZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIHZpZXcgPSAoVGV4dFZpZXcpZmluZFZpZXdCeUlkKFIuaWQubW9kaWZpZWQpOworICAgICAgICAgICAgZGF0ZSA9IG5ldyBEYXRlKGMuZ2V0TG9uZygxMSkgKiAxMDAwKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChkYXRlLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5rZXl3b3Jkcyk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoYy5nZXRTdHJpbmcoMTIpKTsKKyAgICAgICAgICAgIGJ5dGVbXSB0aHVtYm5haWwgPSBjLmdldEJsb2IoMTMpOworICAgICAgICAgICAgaWYgKHRodW1ibmFpbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgSW1hZ2VWaWV3IHRodW1iVmlldyA9IChJbWFnZVZpZXcpZmluZFZpZXdCeUlkKFIuaWQudGh1bWJuYWlsKTsKKyAgICAgICAgICAgICAgICBCaXRtYXAgYml0bWFwID0gQml0bWFwRmFjdG9yeS5kZWNvZGVCeXRlQXJyYXkodGh1bWJuYWlsLCAwLCB0aHVtYm5haWwubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBpZiAoYml0bWFwICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGh1bWJWaWV3LnNldEltYWdlQml0bWFwKGJpdG1hcCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5mb3JtYXQpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9IZXhTdHJpbmcoYy5nZXRMb25nKDE0KSkudG9VcHBlckNhc2UoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvbkNyZWF0ZU9wdGlvbnNNZW51KE1lbnUgbWVudSkgeworICAgICAgICBNZW51SW5mbGF0ZXIgaW5mbGF0ZXIgPSBnZXRNZW51SW5mbGF0ZXIoKTsKKyAgICAgICAgaW5mbGF0ZXIuaW5mbGF0ZShSLm1lbnUub2JqZWN0X21lbnUsIG1lbnUpOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvblByZXBhcmVPcHRpb25zTWVudShNZW51IG1lbnUpIHsKKyAgICAgICAgTWVudUl0ZW0gaXRlbSA9IG1lbnUuZmluZEl0ZW0oUi5pZC5zYXZlKTsKKyAgICAgICAgaXRlbS5zZXRFbmFibGVkKHRydWUpOworICAgICAgICBpdGVtID0gbWVudS5maW5kSXRlbShSLmlkLmRlbGV0ZSk7CisgICAgICAgIGl0ZW0uc2V0RW5hYmxlZCh0cnVlKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25PcHRpb25zSXRlbVNlbGVjdGVkKE1lbnVJdGVtIGl0ZW0pIHsKKyAgICAgICAgc3dpdGNoIChpdGVtLmdldEl0ZW1JZCgpKSB7CisgICAgICAgICAgICBjYXNlIFIuaWQuc2F2ZToKKyAgICAgICAgICAgICAgICBzYXZlKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICBjYXNlIFIuaWQuZGVsZXRlOgorICAgICAgICAgICAgICAgIGRlbGV0ZSgpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgZ2V0VGltZXN0YW1wKCkgeworICAgICAgICBDYWxlbmRhciBjID0gQ2FsZW5kYXIuZ2V0SW5zdGFuY2UoKTsKKyAgICAgICAgYy5zZXRUaW1lSW5NaWxsaXMoU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkpOworICAgICAgICByZXR1cm4gU3RyaW5nLmZvcm1hdCgiJXRZLSV0bS0ldGQtJXRILSV0TS0ldFMiLCBjLCBjLCBjLCBjLCBjLCBjKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2F2ZSgpIHsKKyAgICAgICAgYm9vbGVhbiBzdWNjZXNzID0gZmFsc2U7CisgICAgICAgIFVyaSB1cmkgPSBNdHAuT2JqZWN0LmdldENvbnRlbnRVcmkobURldmljZUlELCBtT2JqZWN0SUQpOworICAgICAgICBGaWxlIGRlc3RGaWxlID0gbnVsbDsKKyAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IgcGZkID0gbnVsbDsKKyAgICAgICAgRmlsZUlucHV0U3RyZWFtIGZpcyA9IG51bGw7CisgICAgICAgIEZpbGVPdXRwdXRTdHJlYW0gZm9zID0gbnVsbDsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgcGZkID0gZ2V0Q29udGVudFJlc29sdmVyKCkub3BlbkZpbGVEZXNjcmlwdG9yKHVyaSwgInIiKTsKKyAgICAgICAgICAgIExvZy5kKFRBRywgInNhdmUgZ290IHBmZCAiICsgcGZkKTsKKyAgICAgICAgICAgIGlmIChwZmQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZpcyA9IG5ldyBGaWxlSW5wdXRTdHJlYW0ocGZkLmdldEZpbGVEZXNjcmlwdG9yKCkpOworICAgICAgICAgICAgICAgIExvZy5kKFRBRywgInNhdmUgZ290IGZpcyAiICsgZmlzKTsKKyAgICAgICAgICAgICAgICBGaWxlIGRlc3REaXIgPSBFbnZpcm9ubWVudC5nZXRFeHRlcm5hbFN0b3JhZ2VQdWJsaWNEaXJlY3RvcnkoCisgICAgICAgICAgICAgICAgICAgICAgICBFbnZpcm9ubWVudC5ESVJFQ1RPUllfRENJTSk7CisgICAgICAgICAgICAgICAgZGVzdERpci5ta2RpcnMoKTsKKyAgICAgICAgICAgICAgICBkZXN0RmlsZSA9IG5ldyBGaWxlKGRlc3REaXIsICJDYW1lcmFCcm93c2VyLSIgKyBnZXRUaW1lc3RhbXAoKSArICIuanBlZyIpOworCisKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJzYXZlIGdvdCBkZXN0RmlsZSAiICsgZGVzdEZpbGUpOworCisgICAgICAgICAgICAgICAgaWYgKGRlc3RGaWxlLmV4aXN0cygpKSB7CisgICAgICAgICAgICAgICAgICAgIGRlc3RGaWxlLmRlbGV0ZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3MgPSBuZXcgRmlsZU91dHB1dFN0cmVhbShkZXN0RmlsZSk7CisKKyAgICAgICAgICAgICAgICBieXRlW10gYnVmZmVyID0gbmV3IGJ5dGVbNjU1MzZdOworICAgICAgICAgICAgICAgIGludCBieXRlc1JlYWQ7CisgICAgICAgICAgICAgICAgd2hpbGUgKChieXRlc1JlYWQgPSBmaXMucmVhZChidWZmZXIpKSA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGZvcy53cml0ZShidWZmZXIsIDAsIGJ5dGVzUmVhZCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gdGVtcG9yYXJ5IHdvcmthcm91bmQgdW50aWwgd2Ugc3RyYWlnaHRlbiBvdXQgcGVybWlzc2lvbnMgaW4gL2RhdGEvbWVkaWEKKyAgICAgICAgICAgICAgICBGaWxlVXRpbHMuc2V0UGVybWlzc2lvbnMoZGVzdERpci5nZXRQYXRoKCksIDA3NzUsIFByb2Nlc3MubXlVaWQoKSwgUHJvY2Vzcy5TRENBUkRfUldfR0lEKTsKKyAgICAgICAgICAgICAgICBGaWxlVXRpbHMuc2V0UGVybWlzc2lvbnMoZGVzdEZpbGUuZ2V0UGF0aCgpLCAwNjY0LCBQcm9jZXNzLm15VWlkKCksIFByb2Nlc3MuU0RDQVJEX1JXX0dJRCk7CisKKyAgICAgICAgICAgICAgICBzdWNjZXNzID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIkV4Y2VwdGlvbiBpbiBPYmplY3RWaWV3LnNhdmUiLCBlKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChmaXMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGZpcy5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGZvcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgZm9zLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocGZkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBwZmQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChzdWNjZXNzKSB7CisgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX01FRElBX1NDQU5ORVJfU0NBTl9GSUxFKTsKKyAgICAgICAgICAgIGludGVudC5zZXREYXRhKFVyaS5mcm9tRmlsZShkZXN0RmlsZSkpOworICAgICAgICAgICAgc2VuZEJyb2FkY2FzdChpbnRlbnQpOworICAgICAgICAgICAgVG9hc3QubWFrZVRleHQodGhpcywgUi5zdHJpbmcub2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ICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uUmVzdW1lKCkgeworICAgICAgICBzdXBlci5vblJlc3VtZSgpOworCisgICAgICAgIG1EZXZpY2VJRCA9IGdldEludGVudCgpLmdldEludEV4dHJhKCJkZXZpY2UiLCAwKTsKKyAgICAgICAgaWYgKG1EZXZpY2VJRCAhPSAwKSB7CisgICAgICAgICAgICBDdXJzb3IgYyA9IGdldENvbnRlbnRSZXNvbHZlcigpLnF1ZXJ5KE10cC5TdG9yYWdlLmdldENvbnRlbnRVcmkobURldmljZUlEKSwKKyAgICAgICAgICAgICAgICAgICAgU1RPUkFHRV9DT0xVTU5TLCBudWxsLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgIExvZy5kKFRBRywgInF1ZXJ5IHJldHVybmVkICIgKyBjKTsKKyAgICAgICAgICAgIHN0YXJ0TWFuYWdpbmdDdXJzb3IoYyk7CisKKyAgICAgICAgICAgIC8vIE1hcCBDdXJzb3IgY29sdW1ucyB0byB2aWV3cyBkZWZpbmVkIGluIHNpbXBsZV9saXN0X2l0ZW1fMS54bWwKKyAgICAgICAgICAgIG1BZGFwdGVyID0gbmV3IFNpbXBsZUN1cnNvckFkYXB0ZXIodGhpcywKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC5SLmxheW91dC5zaW1wbGVfbGlzdF9pdGVtXzEsIGMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tdIHsgTXRwLlN0b3JhZ2UuREVTQ1JJUFRJT04gfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgaW50W10geyBhbmRyb2lkLlIuaWQudGV4dDEsIGFuZHJvaWQuUi5pZC50ZXh0MiB9KTsKKyAgICAgICAgICAgIHNldExpc3RBZGFwdGVyKG1BZGFwdGVyKTsKKyAgICAgICAgfQorICAgIH0KKworICA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gIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZShDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgTG9nLmQoVEFHLCAib25SZWNlaXZlICIgKyBpbnRlbnQpOworICAgICAgICBpZiAoVXNiLkFDVElPTl9VU0JfQ0FNRVJBX0FUVEFDSEVELmVxdWFscyhpbnRlbnQuZ2V0QWN0aW9uKCkpKSB7CisgICAgICAgICAgICBVcmkgdXJpID0gaW50ZW50LmdldERhdGEoKTsKKyAgICAgICAgICAgIGludGVudCA9IG5ldyBJbnRlbnQoY29udGV4dCwgU3RvcmFnZUJyb3dzZXIuY2xhc3MpOworICAgICAgICAgICAgaW50ZW50LnNldEZsYWdzKEludGVudC5GTEFHX0FDVElWSVRZX05FV19UQVNLKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgLy8gVE9ETyAtIGFkZCBhIHdyYXBwZXIgdG8gTXRwLkRldmljZSBmb3IgdGhpcworICAgICAgICAgICAgICAgIGludCBpZCA9IEludGVnZXIucGFyc2VJbnQodXJpLmdldFBhdGhTZWdtZW50cygpLmdldCgxKSk7CisgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJkZXZpY2UiLCBpZCk7CisgICAgICAgICAgICAgICAgY29udGV4dC5zdGFydEFjdGl2aXR5KGludGVudCk7CisgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImJhZCBkZXZpY2UgVXJpICIgKyB1cmkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvbWVkaWEvdGVzdHMvbXRwL0FuZHJvaWQubWsgYi9tZWRpYS90ZXN0cy9tdHAvQW5kcm9pZC5tawpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hOTA3NGVkCi0tLSAvZGV2L251bGwKKysrIG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mljZSogZGV2aWNlLCBNdHBTdG9yYWdlSUQgc3RvcmFnZSkKKyAgICA6ICAgbURldmljZShkZXZpY2UpLAorICAgICAgICBtU3RvcmFnZShzdG9yYWdlKSwKKyAgICAgICAgbUhhbmRsZSgwKQoreworfQorCitNdHBGaWxlOjpNdHBGaWxlKE10cERldmljZSogZGV2aWNlLCBNdHBTdG9yYWdlSUQgc3RvcmFnZSwgTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSkKKyAgICA6ICAgbURldmljZShkZXZpY2UpLAorICAgICAgICBtU3RvcmFnZShzdG9yYWdlKSwKKyAgICAgICAgbUhhbmRsZShoYW5kbGUpCit7Cit9CisKK010cEZpbGU6Ok10cEZpbGUoTXRwRmlsZSogZmlsZSkKKyAgICA6ICAgbURldmljZShmaWxlLT5tRGV2aWNlKSwKKyAgICAgICAgbVN0b3JhZ2UoZmlsZS0+bVN0b3JhZ2UpLAorICAgICAgICBtSGFuZGxlKGZpbGUtPm1IYW5kbGUpCit7Cit9CisKK010cEZpbGU6On5NdHBGaWxlKCkgeworfQorCit2b2lkIE10cEZpbGU6OnByaW50KCkgeworICAgIGlmIChtSGFuZGxlKSB7CisKKyAgICB9IGVsc2UgaWYgKG1TdG9yYWdlKSB7CisgICAgICAgIHByaW50ZigiJXhcbiIsIG1TdG9yYWdlKTsKKyAgICB9IGVsc2UgeworICAgICAgICBpbnQgaWQgPSBtRGV2aWNlLT5nZXRJRCgpOworICAgICAgICBNdHBEZXZpY2VJbmZvKiBpbmZvID0gbURldmljZS0+Z2V0RGV2aWNlSW5mbygpOworICAgICAgICBpZiAoaW5mbykKKyAgICAgICAgICAgIHByaW50ZigiJWRcdCVzICVzICVzXG4iLCBpZCwgaW5mby0+bU1hbnVmYWN0dXJlciwgaW5mby0+bU1vZGVsLCBpbmZvLT5tU2VyaWFsKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcHJpbnRmKCIlZFx0KG5vIGRldmljZSBpbmZvIGF2YWlsYWJsZSlcbiIsIGlkKTsKKyAgICAgICAgZGVsZXRlIGluZm87CisgICAgfQorfQorCitNdHBPYmplY3RJbmZvKiBNdHBGaWxlOjpnZXRPYmplY3RJbmZvKCkgeworICAgIHJldHVybiBtRGV2aWNlLT5nZXRPYmplY3RJbmZvKG1IYW5kbGUpOworfQorCit2b2lkIE10cEZpbGU6Omxpc3QoKSB7CisgICAgaWYgKG1TdG9yYWdlKSB7CisgICAgICAgIE10cE9iamVjdEhhbmRsZUxpc3QqIGhhbmRsZXMgPSBtRGV2aWNlLT5nZXRPYmplY3RIYW5kbGVzKG1TdG9yYWdlLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1IYW5kbGUgPyBtSGFuZGxlIDogLTEpKTsKKyAgICAgICAgaWYgKGhhbmRsZXMpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaGFuZGxlcy0+c2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGUgaGFuZGxlID0gKCpoYW5kbGVzKVtpXTsKKyAgICAgICAgICAgICAgICBNdHBPYmplY3RJbmZvKiBpbmZvID0gbURldmljZS0+Z2V0T2JqZWN0SW5mbyhoYW5kbGUpOworICAgICAgICAgICAgICAgIGlmIChpbmZvKSB7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgbW9kaWZpZWRbMTAwXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IHRtIHRtOworCisgICAgICAgICAgICAgICAgICAgIGdtdGltZV9yKCZpbmZvLT5tRGF0ZU1vZGlmaWVkLCAmdG0pOworICAgICAgICAgICAgICAgICAgICBzdHJmdGltZShtb2RpZmllZCwgc2l6ZW9mKG1vZGlmaWVkKSwgIiVhICViICVlICVIOiVNOiVTIEdNVCAlWSIsICZ0bSk7CisgICAgICAgICAgICAgICAgICAgIHByaW50ZigiJXMgSGFuZGxlOiAlZCBGb3JtYXQ6ICUwNFggU2l6ZTogJWQgTW9kaWZpZWQ6ICVzXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8tPm1OYW1lLCBoYW5kbGUsIGluZm8tPm1Gb3JtYXQsIGluZm8tPm1Db21wcmVzc2VkU2l6ZSwgbW9kaWZpZWQpOworICAgICAgICAgICAgICAgICAgICBkZWxldGUgaW5mbzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBkZWxldGUgaGFuZGxlczsKKyAgICAgICAgfQorICAgIH0gZWxzZSB7CisgICAgICAgIC8vIGxpc3Qgc3RvcmFnZSB1bml0cyBmb3IgZGV2aWNlCisgICAgICAgIE10cFN0b3JhZ2VJRExpc3QqIHN0b3JhZ2VMaXN0ID0gbURldmljZS0+Z2V0U3RvcmFnZUlEcygpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHN0b3JhZ2VMaXN0LT5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCA9ICgqc3RvcmFnZUxpc3QpW2ldOworICAgICAgICAgICAgcHJpbnRmKCIleFxuIiwgc3RvcmFnZUlEKTsKKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZCBNdHBGaWxlOjppbml0KE10cENsaWVudCogY2xpZW50KSB7CisgICAgc0NsaWVudCA9IGNsaWVudDsKK30KKworTXRwRmlsZSogTXRwRmlsZTo6cGFyc2VQYXRoKE10cEZpbGUqIGJhc2UsIGNoYXIqIHBhdGgpIHsKKyAgICBNdHBEZXZpY2UqIGRldmljZSA9IE5VTEw7CisgICAgTXRwU3RvcmFnZUlEIHN0b3JhZ2UgPSAwOworICAgIE10cE9iamVjdEhhbmRsZSBoYW5kbGUgPSAwOworCisgICAgaWYgKHBhdGhbMF0gIT0gJy8nICYmIGJhc2UpIHsKKyAgICAgICAgZGV2aWNlID0gYmFzZS0+bURldmljZTsKKyAgICAgICAgc3RvcmFnZSA9IGJhc2UtPm1TdG9yYWdlOworICAgICAgICBoYW5kbGUgPSBiYXNlLT5tSGFuZGxlOworICAgIH0KKworICAgIC8vIHBhcnNlIGFuIGFic29sdXRlIHBhdGgKKyAgICBpZiAocGF0aFswXSA9PSAnLycpCisgICAgICAgIHBhdGgrKzsKKyAgICBjaGFyKiB0b2sgPSBzdHJ0b2socGF0aCwgIi8iKTsKKyAgICB3aGlsZSAodG9rKSB7CisgICAgICAgIGlmIChzdG9yYWdlKSB7CisgICAgICAgICAgICAvLyBmaW5kIGNoaWxkIG9mIGN1cnJlbnQgaGFuZGxlCisgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGVMaXN0KiBoYW5kbGVzID0gZGV2aWNlLT5nZXRPYmplY3RIYW5kbGVzKHN0b3JhZ2UsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhhbmRsZSA/IGhhbmRsZSA6IC0xKSk7CisgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGUgY2hpbGRIYW5kbGUgPSAwOworCisgICAgICAgICAgICBpZiAoaGFuZGxlcykgeworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaGFuZGxlcy0+c2l6ZSgpICYmICFjaGlsZEhhbmRsZTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBoYW5kbGUgPSAoKmhhbmRsZXMpW2ldOworICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RJbmZvKiBpbmZvID0gZGV2aWNlLT5nZXRPYmplY3RJbmZvKGhhbmRsZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChpbmZvICYmICFzdHJjbXAodG9rLCBpbmZvLT5tTmFtZSkpCisgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZEhhbmRsZSA9IGhhbmRsZTsKKyAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGluZm87CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGRlbGV0ZSBoYW5kbGVzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGNoaWxkSGFuZGxlKQorICAgICAgICAgICAgICAgIGhhbmRsZSA9IGNoaWxkSGFuZGxlOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICB9IGVsc2UgaWYgKGRldmljZSkgeworICAgICAgICAgICAgdW5zaWduZWQgaW50IGlkOworICAgICAgICAgICAgLy8gZmluZCBzdG9yYWdlIGZvciB0aGUgZGV2aWNlCisgICAgICAgICAgICBpZiAoc3NjYW5mKHRvaywgIiV4IiwgJmlkKSA9PSAxKSB7CisgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUlETGlzdCogc3RvcmFnZUxpc3QgPSBkZXZpY2UtPmdldFN0b3JhZ2VJRHMoKTsKKyAgICAgICAgICAgICAgICBib29sIGZvdW5kID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzdG9yYWdlTGlzdC0+c2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCgqc3RvcmFnZUxpc3QpW2ldID09IGlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoZm91bmQpCisgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UgPSBpZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gZmluZCBkZXZpY2UKKyAgICAgICAgICAgIHVuc2lnbmVkIGludCBpZDsKKyAgICAgICAgICAgIGlmIChzc2NhbmYodG9rLCAiJWQiLCAmaWQpID09IDEpCisgICAgICAgICAgICAgICAgZGV2aWNlID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maWxlKSB7CisgICAgICAgICAgICBkZWxldGUgc0N1cnJlbnREaXJlY3Rvcnk7CisgICAgICAgICAgICBzQ3VycmVudERpcmVjdG9yeSA9IGZpbGU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBmaW5kICVzXG4iLCBhcmd2WzBdKTsKKyAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgbGlzdF9kZXZpY2VzKCkgeworICAgIC8vIFRPRE8gLSBuZWVkIHRvIG1ha2Ugc3VyZSB0aGUgbGlzdCB3aWxsIG5vdCBjaGFuZ2Ugd2hpbGUgaXRlcmF0aW5nCisgICAgTXRwRGV2aWNlTGlzdCYgZGV2aWNlcyA9IHNDbGllbnQtPmdldERldmljZUxpc3QoKTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGRldmljZXMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBkZXZpY2VzW2ldOworICAgICAgICBNdHBGaWxlKiBmaWxlID0gbmV3IE10cEZpbGUoZGV2aWNlKTsKKyAgICAgICAgZmlsZS0+cHJpbnQoKTsKKyAgICAgICAgZGVsZXRlIGZpbGU7CisgICAgfQorfQorCitzdGF0aWMgaW50IGxpc3QoaW50IGFyZ2MsIGNoYXIqIGFyZ3ZbXSkgeworICAgIGlmIChhcmdjID09IDApIHsKKyAgICAgICAgLy8gbGlzdCBjd2QKKyAgICAgICAgaWYgKHNDdXJyZW50RGlyZWN0b3J5KSB7CisgICAgICAgICAgICBzQ3VycmVudERpcmVjdG9yeS0+bGlzdCgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbGlzdF9kZXZpY2VzKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGFyZ2M7IGkrKykgeworICAgICAgICBjaGFyKiBwYXRoID0gYXJndltpXTsKKyAgICAgICAgaWYgKCFzdHJjbXAocGF0aCwgIi8iKSkgeworICAgICAgICAgICAgbGlzdF9kZXZpY2VzKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBNdHBGaWxlKiBmaWxlID0gcGFyc2VfcGF0aChwYXRoKTsKKyAgICAgICAgICAgIGlmICghZmlsZSkgeworICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiY291bGQgbm90IGZpbmQgJXNcbiIsIHBhdGgpOworICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZpbGUtPmxpc3QoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGdldF9maWxlKGludCBhcmdjLCBjaGFyKiBhcmd2W10pIHsKKyAgICBpbnQgcmV0ID0gLTE7CisgICAgaW50IHNyY0ZEID0gLTE7CisgICAgaW50IGRlc3RGRCA9IC0xOworICAgIE10cEZpbGUqIHNyY0ZpbGUgPSBOVUxMOworICAgIE10cE9iamVjdEluZm8qIGluZm8gPSBOVUxMOworICAgIGNoYXIqIGRlc3Q7CisKKyAgICBpZiAoYXJnYyA8IDEpIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJub3QgZW5vdWdoIGFyZ3VtZW50c1xuIik7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9IGVsc2UgaWYgKGFyZ2MgPiAyKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAidG9vIG1hbnkgYXJndW1lbnRzXG4iKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIC8vIGZpbmQgc291cmNlIG9iamVjdAorICAgIGNoYXIqIHNyYyA9IGFyZ3ZbMF07CisgICAgc3JjRmlsZSA9IHBhcnNlX3BhdGgoc3JjKTsKKyAgICBpZiAoIXNyY0ZpbGUpIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3QgZmluZCAlc1xuIiwgc3JjKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBpbmZvID0gc3JjRmlsZS0+Z2V0T2JqZWN0SW5mbygpOworICAgIGlmICghaW5mbykgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBmaW5kIG9iamVjdCBpbmZvIGZvciAlc1xuIiwgc3JjKTsKKyAgICAgICAgZ290byBmYWlsOworICAgIH0KKyAgICBpZiAoaW5mby0+bUZvcm1hdCA9PSBNVFBfRk9STUFUX0FTU09DSUFUSU9OKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAiY29weWluZyBkaXJlY3RvcmllcyBub3QgaW1wbGVtZW50ZWQgeWV0XG4iKTsKKyAgICAgICAgZ290byBmYWlsOworICAgIH0KKworICAgIGRlc3QgPSAoYXJnYyA+IDEgPyBhcmd2WzFdIDogaW5mby0+bU5hbWUpOworICAgIGRlc3RGRCA9IG9wZW4oZGVzdCwgT19XUk9OTFkgfCBPX0NSRUFUIHwgT19UUlVOQywgU19JUlVTUiB8IFNfSVdVU1IgfCBTX0lSR1JQIHwgU19JUk9USCk7CisgICAgaWYgKGRlc3RGRCA8IDApIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3QgY3JlYXRlICVzXG4iLCBkZXN0KTsKKyAgICAgICAgZ290byBmYWlsOworICAgIH0KKyAgICBzcmNGRCA9IHNyY0ZpbGUtPmdldERldmljZSgpLT5yZWFkT2JqZWN0KGluZm8tPm1IYW5kbGUsIGluZm8tPm1Db21wcmVzc2VkU2l6ZSk7CisgICAgaWYgKHNyY0ZEIDwgMCkKKyAgICAgICAgZ290byBmYWlsOworCisgICAgY2hhciBidWZmZXJbNjU1MzZdOworICAgIHdoaWxlICgxKSB7CisgICAgICAgIGludCBjb3VudCA9IHJlYWQoc3JjRkQsIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlcikpOworICAgICAgICBpZiAoY291bnQgPD0gMCkKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB3cml0ZShkZXN0RkQsIGJ1ZmZlciwgY291bnQpOworICAgIH0KKyAgICAvLyBGSVhNRSAtIGVycm9yIGNoZWNraW5nIGFuZCByZXBvcnRpbmcKKyAgICByZXQgPSAwOworCitmYWlsOgorICAgIGRlbGV0ZSBzcmNGaWxlOworICAgIGRlbGV0ZSBpbmZvOworICAgIGlmIChzcmNGRCA+PSAwKQorICAgICAgICBjbG9zZShzcmNGRCk7CisgICAgaWYgKGRlc3RGRCA+PSAwKQorICAgICAgICBjbG9zZShkZXN0RkQpOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgcHV0X2ZpbGUoaW50IGFyZ2MsIGNoYXIqIGFyZ3ZbXSkgeworICAgIGludCByZXQgPSAtMTsKKyAgICBpbnQgc3JjRkQgPSAtMTsKKyAgICBNdHBGaWxlKiBkZXN0RmlsZSA9IE5VTEw7CisgICAgTXRwT2JqZWN0SW5mbyogc3JjSW5mbyA9IE5VTEw7CisgICAgTXRwT2JqZWN0SW5mbyogZGVzdEluZm8gPSBOVUxMOworICAgIE10cE9iamVjdEhhbmRsZSBoYW5kbGU7CisgICAgc3RydWN0IHN0YXQgc3RhdGJ1ZjsKKyAgICBjb25zdCBjaGFyKiBsYXN0U2xhc2g7CisKKyAgICBpZiAoYXJnYyA8IDEpIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJub3QgZW5vdWdoIGFyZ3VtZW50c1xuIik7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9IGVsc2UgaWYgKGFyZ2MgPiAyKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAidG9vIG1hbnkgYXJndW1lbnRzXG4iKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBjb25zdCBjaGFyKiBzcmMgPSBhcmd2WzBdOworICAgIHNyY0ZEID0gb3BlbihzcmMsIE9fUkRPTkxZKTsKKyAgICBpZiAoc3JjRkQgPCAwKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAiY291bGQgbm90IG9wZW4gJXNcbiIsIHNyYyk7CisgICAgICAgIGdvdG8gZmFpbDsKKyAgICB9CisgICAgaWYgKGFyZ2MgPT0gMikgeworICAgICAgICAgY2hhciogZGVzdCA9IGFyZ3ZbMV07CisgICAgICAgIGRlc3RGaWxlID0gcGFyc2VfcGF0aChkZXN0KTsKKyAgICAgICAgaWYgKCFkZXN0RmlsZSkgeworICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3QgZmluZCAlc1xuIiwgZGVzdCk7CisgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICBpZiAoIXNDdXJyZW50RGlyZWN0b3J5KSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImN1cnJlbnQgd29ya2luZyBkaXJlY3Rvcnkgbm90IHNldFxuIik7CisgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgIH0KKyAgICAgICAgZGVzdEZpbGUgPSBuZXcgTXRwRmlsZShzQ3VycmVudERpcmVjdG9yeSk7CisgICAgfQorCisgICAgZGVzdEluZm8gPSBkZXN0RmlsZS0+Z2V0T2JqZWN0SW5mbygpOworICAgIGlmICghZGVzdEluZm8pIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3QgZmluZCBvYmplY3QgaW5mbyBkZXN0aW5hdGlvbiBkaXJlY3RvcnlcbiIpOworICAgICAgICBnb3RvIGZhaWw7CisgICAgfQorICAgIGlmIChkZXN0SW5mby0+bUZvcm1hdCAhPSBNVFBfRk9STUFUX0FTU09DSUFUSU9OKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAiZGVzdGluYXRpb24gbm90IGEgZGlyZWN0b3J5XG4iKTsKKyAgICAgICAgZ290byBmYWlsOworICAgIH0KKworICAgIGlmIChmc3RhdChzcmNGR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ByZXQ7Cit9CisKK3R5cGVkZWYgaW50ICgqIGNvbW1hbmRfZnVuYykoaW50IGFyZ2MsIGNoYXIqIGFyZ3ZbXSk7CisKK3N0cnVjdCBjb21tYW5kX3RhYmxlX2VudHJ5IHsKKyAgICBjb25zdCBjaGFyKiBuYW1lOworICAgIGNvbW1hbmRfZnVuYyBmdW5jOworfTsKKworY29uc3QgY29tbWFuZF90YWJsZV9lbnRyeSBjb21tYW5kX2xpc3RbXSA9IHsKKyAgICB7ICAgImNkIiwgICAgICAgc2V0X2N3ZCAgICAgICAgIH0sCisgICAgeyAgICJscyIsICAgICAgIGxpc3QgICAgICAgICAgICB9LAorICAgIHsgICAiZ2V0IiwgICAgICBnZXRfZmlsZSAgICAgICAgfSwKKyAgICB7ICAgInB1dCIsICAgICAgcHV0X2ZpbGUgICAgICAgIH0sCisgICAgeyAgIE5VTEwsICAgICAgIE5VTEwgICAgICAgICAgICB9LAorfTsKKworCitzdGF0aWMgaW50IGRvX2NvbW1hbmQoaW50IGFyZ2MsIGNoYXIqIGFyZ3ZbXSkgeworICAgIGNvbnN0IGNvbW1hbmRfdGFibGVfZW50cnkqIGNvbW1hbmQgPSBjb21tYW5kX2xpc3Q7CisgICAgY29uc3QgY2hhciogbmFtZSA9ICphcmd2Kys7CisgICAgYXJnYy0tOworCisgICAgd2hpbGUgKGNvbW1hbmQtPm5hbWUpIHsKKyAgICAgICAgaWYgKCFzdHJjbXAoY29tbWFuZC0+bmFtZSwgbmFtZSkpCisgICAgICAgICAgICByZXR1cm4gY29tbWFuZC0+ZnVuYyhhcmdjLCBhcmd2KTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgY29tbWFuZCsrOworICAgIH0KKyAgICBmcHJpbnRmKHN0ZGVyciwgInVua25vd24gY29tbWFuZCAlc1xuIiwgbmFtZSk7CisgICAgcmV0dXJuIC0xOworfQorCitzdGF0aWMgaW50IHNoZWxsKCkgeworICAgIGludCBhcmdjOworICAgIGludCByZXN1bHQgPSAwOworI2RlZmluZSBNQVhfQVJHUyAgICAxMDAKKyAgICBjaGFyKiBhcmd2W01BWF9BUkdTXTsKKworI2lmIEhBVkVfUkVBRExJTkUKKyAgICB1c2luZ19oaXN0b3J5KCk7CisjZW5kaWYKKworICAgIHdoaWxlICgxKSB7CisjaWYgSEFWRV9SRUFETElORQorICAgICAgICBjaGFyKiBsaW5lID0gcmVhZGxpbmUoUFJPTVBUKTsKKyAgICAgICAgaWYgKCFsaW5lKSB7CisgICAgICAgICAgICBwcmludGYoIlxuIik7CisgICAgICAgICAgICBleGl0KDApOworICAgICAgICB9CisjZWxzZQorICAgICAgICBjaGFyICAgIGJ1ZmZlclsxMDAwXTsKKyAgICAgICAgcHJpbnRmKCIlcyIsIFBST01QVCk7CisgICAgICAgIGNoYXIqIGxpbmUgPSBOVUxMOworICAgICAgICBzaXplX3QgbGVuZ3RoID0gMDsKKworICAgICAgICBidWZmZXJbMF0gPSAwOworICAgICAgICBmZ2V0cyhidWZmZXIsIHNpemVvZihidWZmZXIpLCBzdGRpbik7CisgICAgICAgIGludCBjb3VudCA9IHN0cmxlbihidWZmZXIpOworICAgICAgICBpZiAoY291bnQgPiAwICYmIGJ1ZmZlclswXSA9PSAoY2hhcilFT0YpIHsKKyAgICAgICAgICAgIHByaW50ZigiXG4iKTsKKyAgICAgICAgICAgIGV4aXQoMCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGNvdW50ID4gMCAmJiBsaW5lW2NvdW50IC0gMV0gPT0gJ1xuJykKKyAgICAgICAgICAgIGxpbmVbY291bnQgLSAxXSA9PSAwOworI2VuZGlmCisgICAgICAgIGNoYXIqIHRvayA9IHN0cnRvayhsaW5lLCAiIFx0XG5cciIpOworICAgICAgICBpZiAoIXRvaykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICBpZiAoIXN0cmNtcCh0b2ssICJxdWl0IikgfHwgIXN0cmNtcCh0b2ssICJleGl0IikpIHsKKyAgICAgICAgICAgIGV4aXQoMCk7CisgICAgICAgIH0KKyNpZiBIQVZFX1JFQURMSU5FCisgICAgICAgIGFkZF9oaXN0b3J5KGxpbmUpOworI2VuZGlmCisgICAgICAgIGFyZ2MgPSAwOworICAgICAgICB3aGlsZSAodG9rKSB7CisgICAgICAgICAgICBpZiAoYXJnYyArIDEgPT0gTUFYX0FSR1MpIHsKKyAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgInRvbyBtYW55IGFyZ3VtZW50c1xuIik7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gLTE7CisgICAgICAgICAgICAgICAgZ290byBib3R0b21fb2ZfbG9vcDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYXJndlthcmdjKytdID0gc3RyZHVwKHRvayk7CisgICAgICAgICAgICB0b2sgPSBzdHJ0b2soTlVMTCwgIiBcdFxuXHIiKTsKKyAgICAgICAgfQorCisgICAgICAgIHJlc3VsdCA9IGRvX2NvbW1hbmQoYXJnYywgYXJndik7CisKK2JvdHRvbV9vZl9sb29wOgorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGFyZ2M7IGkrKykKKyAgICAgICAgICAgIGZyZWUoYXJndltpXSk7CisgICAgICAgIGZyZWUobGluZSk7CisgICAgfQorCisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIqIGFyZ3ZbXSkgeworICAgIGluaXQoKTsKKworICAgIGlmIChhcmdjID09IDEpCisgICAgICAgIHJldHVybiBzaGVsbCgpOworICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIGRvX2NvbW1hbmQoYXJnYyAtIDEsIGFyZ3YgKyAxKTsKK30KZGlmZiAtLWdpdCBhL21lZGlhL3Rlc3RzL3BsYXllcnMvaW52b2tlX21vY2tfbWVkaWFfcGxheWVyLmNwcCBiL21lZGlhL3Rlc3RzL3BsYXllcnMvaW52b2tlX21vY2tfbWVkaWFfcGxheWVyLmNwcAppbmRleCBiM2NjOGI2Li41MzMwOGJlIDEwMDY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UVESUFfUExBWSAgICAgID0gMTI2LAorICAgIEFLRVlDT0RFX01FRElBX1BBVVNFICAgICA9IDEyNywKKyAgICBBS0VZQ09ERV9NRURJQV9DTE9TRSAgICAgPSAxMjgsCisgICAgQUtFWUNPREVfTUVESUFfRUpFQ1QgICAgID0gMTI5LAorICAgIEFLRVlDT0RFX01FRElBX1JFQ09SRCAgICA9IDEzMCwKKyAgICBBS0VZQ09ERV9GMSAgICAgICAgICAgICAgPSAxMzEsCisgICAgQUtFWUNPREVfRjIgICAgICAgICAgICAgID0gMTMyLAorICAgIEFLRVlDT0RFX0YzICAgICAgICAgICAgICA9IDEzMywKKyAgICBBS0VZQ09ERV9GNCAgICAgICAgICAgICAgPSAxMzQsCisgICAgQUtFWUNPREVfRjUgICAgICAgICAgICAgID0gMTM1LAorICAgIEFLRVlDT0RFX0Y2ICAgICAgICAgICAgICA9IDEzNiwKKyAgICBBS0VZQ09ERV9GNyAgICAgICAgICAgICAgPSAxMzcsCisgICAgQUtFWUNPREVfRjggICAgICAgICAgICAgID0gMTM4LAorICAgIEFLRVlDT0RFX0Y5ICAgICAgICAgICAgICA9IDEzOSwKKyAgICBBS0VZQ09ERV9GMTAgICAgICAgICAgICAgPSAxNDAsCisgICAgQUtFWUNPREVfRjExICAgICAgICAgICAgID0gMTQxLAorICAgIEFLRVlDT0RFX0YxMiAgICAgICAgICAgICA9IDE0MiwKKyAgICBBS0VZQ09ERV9OVU1fTE9DSyAgICAgICAgPSAxNDMsCisgICAgQUtFWUNPREVfTlVNUEFEXzAgICAgICAgID0gMTQ0LAorICAgIEFLRVlDT0RFX05VTVBBRF8xICAgICAgICA9IDE0NSwKKyAgICBBS0VZQ09ERV9OVU1QQURfMiAgICAgICAgPSAxNDYsCisgICAgQUtFWUNPREVfTlVNUEFEXzMgICAgICAgID0gMTQ3LAorICAgIEFLRVlDT0RFX05VTVBBRF80ICAgICAgICA9IDE0OCwKKyAgICBBS0VZQ09ERV9OVU1QQURfNSAgICAgICAgPSAx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EVSVFlfVU5TVVBQT1JURUQgICAgPSAtNCwKKyAgICBBTkRST0lEX1RUU19QUk9QRVJUWV9TSVpFX1RPT19TTUFMTCA9IC01LAorICAgIEFORFJPSURfVFRTX01JU1NJTkdfUkVTT1VSQ0VTICAgICAgID0gLTYKK30gYW5kcm9pZF90dHNfcmVzdWx0X3Q7CisKK3R5cGVkZWYgZW51bSB7CisgICAgQU5EUk9JRF9UVFNfTEFOR19DT1VOVFJZX1ZBUl9BVkFJTEFCTEUgPSAyLAorICAgIEFORFJPSURfVFRTX0xBTkdfQ09VTlRSWV9BVkFJTEFCTEUgICAgPSAxLAorICAgIEFORFJPSURfVFRTX0xBTkdfQVZBSUxBQkxFICAgICAgICAgICAgPSAwLAorICAgIEFORFJPSURfVFRTX0xBTkdfTUlTU0lOR19EQVRBICAgICAgICAgPSAtMSwKKyAgICBBTkRST0lEX1RUU19MQU5HX05PVF9TVVBQT1JURUQgICAgICAgID0gLTIKK30gYW5kcm9pZF90dHNfc3VwcG9ydF9yZXN1bHRfdDsKKwordHlwZWRlZiBlbnVtIHsKKyAgICBBTkRST0lEX1RUU19TWU5USF9ET05FICAgICAgICAgICAgICA9IDAsCisgICAgQU5EUk9JRF9UVFNfU1lOVEhfUEVORElORyAgICAgICAgICAgPSAxCit9IGFuZHJvaWRfdHRzX3N5bnRoX3N0YXR1c190OworCit0eXBlZGVmIGVudW0geworICAgIEFORFJPSURfVFRTX0NBTExCQUNLX0hBTFQgICAgICAgICAgID0gMCwKKyAgICBBTkRST0lEX1RUU19DQUxMQkFDS19DT05USU5VRSAgICAgICA9IDEKK30gYW5kcm9pZF90dHNfY2FsbGJhY2tfc3RhdHVzX3Q7CisKKy8vIFN1cHBvcnRlZCBhdWRpbyBmb3JtYXRzCit0eXBlZGVmIGVudW0geworICAgIEFORFJPSURfVFRTX0FVRElPX0ZPUk1BVF9JTlZBTElEICAgID0gLTEsCisgICAgQU5EUk9JRF9UVFNfQVVESU9fRk9STUFUX0RFRkFVTFQgICA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90ZSBhYm91dCB0aGUgZm9ybWF0IG9mIHRoZSBpbnB1dDogdGhlIHRleHQgcGFyYW1ldGVyIG1heSB1c2UgdGhlCisgICAgLy8gZm9sbG93aW5nIGVsZW1lbnRzCisgICAgLy8gYW5kIHRoZWlyIHJlc3BlY3RpdmUgYXR0cmlidXRlcyBhcyBkZWZpbmVkIGluIHRoZSBTU01MIDEuMCBzcGVjaWZpY2F0aW9uOgorICAgIC8vICAgICogbGFuZworICAgIC8vICAgICogc2F5LWFzOgorICAgIC8vICAgICAgICAgIG8gaW50ZXJwcmV0LWFzCisgICAgLy8gICAgKiBwaG9uZW1lCisgICAgLy8gICAgKiB2b2ljZToKKyAgICAvLyAgICAgICAgICBvIGdlbmRlciwKKyAgICAvLyAgICAgICAgICBvIGFnZSwKKyAgICAvLyAgICAgICAgICBvIHZhcmlhbnQsCisgICAgLy8gICAgICAgICAgbyBuYW1lCisgICAgLy8gICAgKiBlbXBoYXNpcworICAgIC8vICAgICogYnJlYWs6CisgICAgLy8gICAgICAgICAgbyBzdHJlbmd0aCwKKyAgICAvLyAgICAgICAgICBvIHRpbWUKKyAgICAvLyAgICAqIHByb3NvZHk6CisgICAgLy8gICAgICAgICAgbyBwaXRjaCwKKyAgICAvLyAgICAgICAgICBvIGNvbnRvdXIsCisgICAgLy8gICAgICAgICAgbyByYW5nZSwKKyAgICAvLyAgICAgICAgICBvIHJhdGUsCisgICAgLy8gICAgICAgICAgbyBkdXJhdGlvbiwKKyAgICAvLyAgICAgICAgICBvIHZvbHVtZQorICAgIC8vICAgICogbWFyaworICAgIC8vIERpZmZlcmVuY2VzIGJldHdlZW4gdGhpcyB0ZXh0IGZvcm1hdCBhbmQgU1NNTCBhcmU6CisgICAgLy8gICAgKiBmdWxsIFNTTUwgZG9jdW1lbnRzIGFyZSBub3Qgc3VwcG9ydGVkCisgICAgLy8gICAgKiBuYW1lc3BhY2VzIGFyZSBub3Qgc3VwcG9ydGVkCisgICAgLy8gVGV4dCBpcyBjb2RlZ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vciBzdWJjbGFzc2VkIGJ5IGNsaWVudHMgb2YgR0xTdXJmYWNlVmlldy4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkF0dGFjaGVkVG9XaW5kb3coKSB7CisgICAgICAgIHN1cGVyLm9uQXR0YWNoZWRUb1dpbmRvdygpOworICAgICAgICBpZiAoTE9HX0FUVEFDSF9ERVRBQ0gpIHsKKyAgICAgICAgICAgIExvZy5kKFRBRywgIm9uQXR0YWNoZWRUb1dpbmRvdyByZWF0dGFjaCA9IiArIG1EZXRhY2hlZCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1EZXRhY2hlZCAmJiAobVJlbmRlcmVyICE9IG51bGwpKSB7CisgICAgICAgICAgICBpbnQgcmVuZGVyTW9kZSA9IFJFTkRFUk1PREVfQ09OVElOVU9VU0xZOworICAgICAgICAgICAgaWYgKG1HTFRocmVhZCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmVuZGVyTW9kZSA9IG1HTFRocmVhZC5nZXRSZW5kZXJNb2RlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtR0xUaHJlYWQgPSBuZXcgR0xUaHJlYWQobVJlbmRlcmVyKTsKKyAgICAgICAgICAgIGlmIChyZW5kZXJNb2RlICE9IFJFTkRFUk1PREVfQ09OVElOVU9VU0xZKSB7CisgICAgICAgICAgICAgICAgbUdMVGhyZWFkLnNldFJlbmRlck1vZGUocmVuZGVyTW9kZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtR0xUaHJlYWQuc3RhcnQoKTsKKyAgICAgICAgfQorICAgICAgICBtRGV0YWNoZWQgPSBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIG1ldGhvZCBpcyB1c2VkIGFzIHBhcnQgb2YgdGhlIFZpZXcgY2xhc3MgYW5kIGlzIG5vdCBub3JtYWxseQorICAgICAqIGNhbGxlZCBvciBzdWJjbGFzc2VkIG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gKzEzMDIsMTEgQEAKIAogICAgICAgICAvLyBjdXJfYyBoYXMgdG8gYmUgdmFsaWQgaGVyZSAoYnV0IGNvdWxkIGJlIHRlcm1pbmF0ZWQpCiAgICAgICAgIGlmIChjdHggIT0gRUdMX05PX0NPTlRFWFQpIHsKLSAgICAgICAgICAgIHNldEdsVGhyZWFkU3BlY2lmaWMoYy0+Y254LT5ob29rc1tjLT52ZXJzaW9uXSk7CisgICAgICAgICAgICBzZXRHTEhvb2tzVGhyZWFkU3BlY2lmaWMoYy0+Y254LT5ob29rc1tjLT52ZXJzaW9uXSk7CiAgICAgICAgICAgICBzZXRDb250ZXh0KGN0eCk7CiAgICAgICAgICAgICBfYy5hY3F1aXJlKCk7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBzZXRHbFRocmVhZFNwZWNpZmljKCZnSG9va3NOb0NvbnRleHQpOworICAgICAgICAgICAgc2V0R0xIb29rc1RocmVhZFNwZWNpZmljKCZnSG9va3NOb0NvbnRleHQpOwogICAgICAgICAgICAgc2V0Q29udGV4dChFR0xfTk9fQ09OVEVYVCk7CiAgICAgICAgIH0KICAgICAgICAgX2N1cl9jLnJlbGVhc2UoKTsKQEAgLTE0MTMsNiArMTQ5OCw5IEBACiAgICAgICAgICAgICAgICAgICAgIC8vIEV4dGVuc2lvbnMgYXJlIGluZGVwZW5kZW50IG9mIHRoZSBib3VuZCBjb250ZXh0CiAgICAgICAgICAgICAgICAgICAgIGNueC0+aG9va3NbR0xFU3YxX0lOREVYXS0+ZXh0LmV4dGVuc2lvbnNbc2xvdF0gPQogICAgICAgICAgICAgICAgICAgICBjbngtPmhvb2tzW0dMRVN2Ml9JTkRFWF0tPmV4dC5leHRlbnNpb25zW3Nsb3RdID0KKyNpZiBFR0xfVFJBQ0UKKyAgICAgICAgICAgICAgICAgICAgZ0hvb2tzVHJhY2UuZXh0LmV4dGVuc2lvbnNbc2xvdF0gPQorI2VuZGlmCiAgICAgICAgICAgICAgICAgICAgICAgICA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ICAgICAgRUdMU3luY0tIUiBzeW5jID0gYy0+Y254LT5lZ2wuZWdsQ3JlYXRlU3luY0tIUigKKyAgICAgICAgICAgICAgICBkcC0+ZGlzcFtjLT5pbXBsXS5kcHksIHR5cGUsIGF0dHJpYl9saXN0KTsKKyAgICAgICAgaWYgKHN5bmMgPT0gRUdMX05PX1NZTkNfS0hSKQorICAgICAgICAgICAgcmV0dXJuIHN5bmM7CisgICAgICAgIHJlc3VsdCA9IChlZ2xfc3luY190KiluZXcgZWdsX3N5bmNfdChkcHksIGN0eCwgc3luYyk7CisgICAgfQorICAgIHJldHVybiAoRUdMU3luY0tIUilyZXN1bHQ7Cit9CisKK0VHTEJvb2xlYW4gZWdsRGVzdHJveVN5bmNLSFIoRUdMRGlzcGxheSBkcHksIEVHTFN5bmNLSFIgc3luYykKK3sKKyAgICBlZ2xfZGlzcGxheV90IGNvbnN0ICogY29uc3QgZHAgPSBnZXRfZGlzcGxheShkcHkpOworICAgIGlmIChkcCA9PSAwKSB7CisgICAgICAgIHJldHVybiBzZXRFcnJvcihFR0xfQkFEX0RJU1BMQVksIEVHTF9GQUxTRSk7CisgICAgfQorCisgICAgU3luY1JlZiBfcyhzeW5jKTsKKyAgICBpZiAoIV9zLmdldCgpKSByZXR1cm4gc2V0RXJyb3IoRUdMX0JBRF9QQVJBTUVURVIsIEVHTF9GQUxTRSk7CisgICAgZWdsX3N5bmNfdCogc3luY09iamVjdCA9IGdldF9zeW5jKHN5bmMpOworCisgICAgRUdMQ29udGV4dCBjdHggPSBzeW5jT2JqZWN0LT5jb250ZXh0OworICAgIENvbnRleHRSZWYgX2MoY3R4KTsKKyAgICBpZiAoIV9jLmdldCgpKSByZXR1cm4gc2V0RXJyb3IoRUdMX0JBRF9DT05URVhULCBFR0xfRkFMU0UpOworICAgIGlmICghdmFsaWRhdGVfZGlzcGxheV9jb250ZXh0KGRweSwgY3R4KSkKKyAgICAgICAgcmV0dXJuIEVHTF9GQUxTRTsKKworICAgIGVnbF9jb250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0tLS0tLS0tLS0tLS0tLS0KKworc3RydWN0IEdMZW51bVN0cmluZyB7CisgICAgR0xlbnVtIGU7CisgICAgY29uc3QgY2hhciogczsKK307CisKKyN1bmRlZiBHTF9FTlVNCisjZGVmaW5lIEdMX0VOVU0oVkFMLE5BTUUpIHtWQUwsICNOQU1FfSwKKworc3RhdGljIEdMZW51bVN0cmluZyBnX2VudW1uYW1lc1tdID0geworI2luY2x1ZGUgImVudW1zLmluIgorfTsKKyN1bmRlZiBHTF9FTlVNCisKK3N0YXRpYyBpbnQgY29tcGFyZUdMRW51bShjb25zdCB2b2lkKiBhLCBjb25zdCB2b2lkKiBiKSB7CisgICAgcmV0dXJuICgoY29uc3QgR0xlbnVtU3RyaW5nKikgYSktPmUgLSAoKGNvbnN0IEdMZW51bVN0cmluZyopIGIpLT5lOworfQorCitzdGF0aWMgY29uc3QgY2hhciogR0xFbnVtVG9TdHJpbmcoR0xlbnVtIGUpIHsKKyAgICBHTGVudW1TdHJpbmcga2V5ID0ge2UsICIifTsKKyAgICBjb25zdCBHTGVudW1TdHJpbmcqIHJlc3VsdCA9IChjb25zdCBHTGVudW1TdHJpbmcqKSBic2VhcmNoKAorICAgICAgICAma2V5LCBnX2VudW1uYW1lcywKKyAgICAgICAgc2l6ZW9mKGdfZW51bW5hbWVzKSAvIHNpemVvZihnX2VudW1uYW1lc1swXSksCisgICAgICAgIHNpemVvZihnX2VudW1uYW1lc1swXSksIGNvbXBhcmVHTEVudW0pOworICAgIGlmIChyZXN1bHQpIHsKKyAgICAgICAgcmV0dXJuIHJlc3VsdC0+czsKKyAgICB9CisgICAgcmV0dXJuIE5VTEw7Cit9CisKK3N0YXRpYyBjb25zdCBjaGFyKiBHTGJvb2xlYW5Ub1N0cmluZyhHTGJvb2xlYW4gYXJnKSB7CisgICAgcmV0dXJuIGFyZyA/ICJHTF9UUlVFIiA6ICJHTF9GQUxTRSI7Cit9CisKK3N0YXRpYyBHTGVudW1TdHJpbmcgZ19iaXRmaWVsZE5hbWVzW10gPSB7CisgICAgezB4MDAwMDQwMDAsICJHTF9DT0xPUl9CVUZGRVJfQklUIn0sCisgICAgezB4MDAwMDA0MDAsICJHTF9TVEVOQ0lMX0JVRkZFUl9CSVQifSwKKyAgICB7MHgwMDAwMDEwMCwgIkdMX0RFUFRIX0JVRkZFUl9CSVQifQorfTsKKworY2xhc3MgU3RyaW5nQnVpbGRlciB7CisgICAgc3RhdGljIGNvbnN0IGludCBsaW5lU2l6ZSA9IDUwMDsKKyAgICBjaGFyIGxpbmVbbGluZVNpemVdOworICAgIGludCBsaW5lX2luZGV4OworcHVibGljOgorICAgIFN0cmluZ0J1aWxkZXIoKSB7CisgICAgICAgIGxpbmVfaW5kZXggPSAwOworICAgICAgICBsaW5lWzBdID0gJ1wwJzsKKyAgICB9CisgICAgdm9pZCBhcHBlbmQoY29uc3QgY2hhciogZm10LCAuLi4pIHsKKyAgICAgICAgdmFfbGlzdCBhcmdwOworICAgICAgICB2YV9zdGFydChhcmdwLCBmbXQpOworICAgICAgICBsaW5lX2luZGV4ICs9IHZzbnByaW50ZihsaW5lICsgbGluZV9pbmRleCwgbGluZVNpemUtbGluZV9pbmRleCwgZm10LCBhcmdwKTsKKyAgICAgICAgdmFfZW5kKGFyZ3ApOworICAgIH0KKyAgICBjb25zdCBjaGFyKiBnZXRTdHJpbmcoKSB7CisgICAgICAgIGxpbmVfaW5kZXggPSAwOworICAgICAgICBsaW5lW2xpbmVTaXplLTFdID0gJ1wwJzsKKyAgICAgICAgcmV0dXJuIGxpbmU7CisgICAgfQorfTsKKworCitzdGF0aWMgdm9pZCBUcmFjZUdMU2hhZGVyU291cmNlKEdMdWludCBzaGFkZXIsIEdMc2l6ZWkgY291bnQsCisgICAgY29uc3QgR0xjaGFyKiogc3RyaW5nLCBjb25zdCBHTGludCogbGVuZ3RoKSB7CisgICAgTE9HRCgiY29uc3QgY2hhciogc2hhZGVyU3JjW10gPSB7Iik7CisgICAgZm9yIChHTHNpemVpIGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICBjb25zdCBjaGFyKiBjb21tYSA9IGkgPCBjb3VudC0xID8gIiwiIDogIiI7CisgICAgICAgIGNvbnN0IEdMY2hhciogcyA9IHN0cmluZ1tpXTsKKyAgICAgICAgaWYgKGxlbmd0aCkgeworICAgICAgICAgICAgR0xpbnQgbGVuID0gbGVuZ3RoW2ldOworICAgICAgICAgICAgTE9HRCgiICAgIFwiJSpzXCIlcyIsIGxlbiwgcywgY29tbWEpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgTE9HRCgiICAgIFwiJXNcIiVzIiwgcywgY29tbWEpOworICAgICAgICB9CisgICAgfQorICAgIExPR0QoIn07Iik7CisgICAgaWYgKGxlbmd0aCkgeworICAgICAgICBMT0dEKCJjb25zdCBHTGludCogc2hhZGVyTGVuZ3RoW10gPSB7Iik7CisgICAgICAgIGZvciAoR0xzaXplaSBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGNvbnN0IGNoYXIqIGNvbW1hID0gaSA8IGNvdW50LTEgPyAiLCIgOiAiIjsKKyAgICAgICAgICAgIEdMaW50IGxlbiA9IGxlbmd0aFtpXTsKKyAgICAgICAgICAgIExPR0QoIiAgICBcIiVkXCIlcyIsIGxlbiwgY29tbWEpOworICAgICAgICB9CisgICAgICAgIExPR0QoIn07Iik7CisgICAgICAgIExPR0QoImdsU2hhZGVyU291cmNlKCV1LCAldSwgc2hhZGVyU3JjLCBzaGFkZXJMZW5ndGgpOyIsCisgICAgICAgICAgICBzaGFkZXIsIGNvdW50KTsKKyAgICB9IGVsc2UgeworICAgICAgICBMT0dEKCJnbFNoYWRlclNvdXJjZSgldSwgJXUsIHNoYWRlclNyYywgKGNvbnN0IEdMaW50KikgMCk7IiwKKyAgICAgICAgICAgIHNoYWRlciwgY291bnQpOworICAgIH0KK30KKworc3RhdGljIHZvaWQgVHJhY2VWYWx1ZShpbnQgZWxlbWVudENvdW50LCBjaGFyIHR5cGUsCisgICAgICAgIEdMc2l6ZWkgY2h1bmtDb3VudCwgR0xzaXplaSBjaHVua1NpemUsIGNvbnN0IHZvaWQqIHZhbHVlKSB7CisgICAgU3RyaW5nQnVpbGRlciBzdHJpbmdCdWlsZGVyOworICAgIEdMc2l6ZWkgY291bnQgPSBjaHVua0NvdW50ICogY2h1bmtTaXplOworICAgIGJvb2wgaXNGbG9hdCA9IHR5cGUgPT0gJ2YnOworICAgIGNvbnN0IGNoYXIqIHR5cGVTdHJpbmcgPSBpc0Zsb2F0ID8gIkdMZmxvYXQiIDogIkdMaW50IjsKKyAgICBMT0dEKCJjb25zdCAlcyB2YWx1ZVtdID0geyIsIHR5cGVTdHJpbmcpOworICAgIGZvciAoR0xzaXplaSBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyOworICAgICAgICBidWlsZGVyLmFwcGVuZCgiICAgICIpOworICAgICAgICBmb3IgKGludCBlID0gMDsgZSA8IGVsZW1lbnRDb3VudDsgZSsrKSB7CisgICAgICAgICAgICBjb25zdCBjaGFyKiBjb21tYSA9ICIsICI7CisgICAgICAgICAgICBpZiAoZSA9PSBlbGVtZW50Q291bnQtMSkgeworICAgICAgICAgICAgICAgIGlmIChpID09IGNvdW50IC0gMSkgeworICAgICAgICAgICAgICAgICAgICBjb21tYSA9ICIiOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGNvbW1hID0gIiwiOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChpc0Zsb2F0KSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiVnJXMiLCAqIChHTGZsb2F0KikgdmFsdWUsIGNvbW1hKTsKKyAgICAgICAgICAgICAgICB2YWx1ZSA9ICh2b2lkKikgKCgoR0xmbG9hdCopIHZhbHVlKSArIDEpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAg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gICAgcmV0dXJuOworICAgIH0KKworICAgIC8vIGdsVW5pZm9ybVhYdgorCisgICAgaWYgKG5hbWVMZW4gPT0gMTIgJiYgc3RybmNtcChuYW1lLCAiZ2xVbmlmb3JtIiwgOSkgPT0gMCAmJiBuYW1lWzExXSA9PSAndicpIHsKKyAgICAgICAgaW50IGVsZW1lbnRDb3VudCA9IG5hbWVbOV0gLSAnMCc7IC8vIDEuLjQKKyAgICAgICAgY2hhciB0eXBlID0gbmFtZVsxMF07IC8vICdmJyBvciAnaScKKyAgICAgICAgdmFfYXJnKGFyZ3AsIGNvbnN0IGNoYXIqKTsKKyAgICAgICAgR0x1aW50IGxvY2F0aW9uID0gdmFfYXJnKGFyZ3AsIEdMdWludCk7CisgICAgICAgIHZhX2FyZyhhcmdwLCBjb25zdCBjaGFyKik7CisgICAgICAgIEdMc2l6ZWkgY291bnQgPSB2YV9hcmcoYXJncCwgR0xzaXplaSk7CisgICAgICAgIHZhX2FyZyhhcmdwLCBjb25zdCBjaGFyKik7CisgICAgICAgIGNvbnN0IHZvaWQqIHZhbHVlID0gKGNvbnN0IHZvaWQqKSB2YV9hcmcoYXJncCwgdm9pZCopOworICAgICAgICB2YV9lbmQoYXJncCk7CisgICAgICAgIFRyYWNlVW5pZm9ybXYoZWxlbWVudENvdW50LCB0eXBlLCBsb2NhdGlvbiwgY291bnQsIHZhbHVlKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8vIGdsVW5pZm9ybU1hdHJpeFhmdgorCisgICAgaWYgKG5hbWVMZW4gPT0gMTggJiYgc3RybmNtcChuYW1lLCAiZ2xVbmlmb3JtTWF0cml4IiwgMTUpID09IDAKKyAgICAgICAgICAgICYmIG5hbWVbMTZdID09ICdmJyAmJiBuYW1lWzE3XSA9PSAndicpIHsKKyAgICAgICAgaW50IG1hdHJpeFNpZGVMZW5ndGggPSBuYW1lWzE1XSAtICcwJzsgLy8gMi4uNAorICAgICAgICB2YV9hcmcoYXJncCwgY29uc3QgY2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BhcmcgPSB2YV9hcmcoYXJncCwgY29uc3Qgdm9pZCopOworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiglcykgMHglMDh4IiwgdHlwZSwgKHNpemVfdCkgYXJnKTsKKyAgICAgICAgfSBlbHNlIGlmIChzdHJjbXAodHlwZSwgIkdMYml0ZmllbGQiKSA9PSAwKSB7CisgICAgICAgICAgICBzaXplX3QgYXJnID0gdmFfYXJnKGFyZ3AsIHNpemVfdCk7CisgICAgICAgICAgICBib29sIGZpcnN0ID0gdHJ1ZTsKKyAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgc2l6ZW9mKGdfYml0ZmllbGROYW1lcykgLyBzaXplb2YoZ19iaXRmaWVsZE5hbWVzWzBdKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgY29uc3QgR0xlbnVtU3RyaW5nKiBiID0gJmdfYml0ZmllbGROYW1lc1tpXTsKKyAgICAgICAgICAgICAgICBpZiAoYi0+ZSAmIGFyZykgeworICAgICAgICAgICAgICAgICAgICBpZiAoZmlyc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiIHwgIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiVzIiwgYi0+cyk7CisgICAgICAgICAgICAgICAgICAgIGFyZyAmPSB+Yi0+ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZmlyc3QgfHwgYXJnICE9IDApIHsKKyAgICAgICAgICAgICAgICBpZiAoIWZpcnN0KSB7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIgfCAiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIjB4JTA4eCIsIGFyZyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoc3RyY21wKHR5cGUsICJHTGJvb2xlYW4iKSA9PSAwKSB7CisgICAgICAgICAgICBHTGJvb2xlYW4gYXJnID0gdmFfYXJnKGFyZ3AsIGludCk7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiJXMiLCBHTGJvb2xlYW5Ub1N0cmluZyhhcmcpKTsKKyAgICAgICAgfSBlbHNlIGlmIChzdHJjbXAodHlwZSwgIkdMY2xhbXBmIikgPT0gMCkgeworICAgICAgICAgICAgZG91YmxlIGFyZyA9IHZhX2FyZyhhcmdwLCBkb3VibGUpOworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiVnIiwgYXJnKTsKKyAgICAgICAgfSBlbHNlIGlmIChzdHJjbXAodHlwZSwgIkdMZW51bSIpID09IDApIHsKKyAgICAgICAgICAgIEdMZW51bSBhcmcgPSB2YV9hcmcoYXJncCwgaW50KTsKKyAgICAgICAgICAgIGNvbnN0IGNoYXIqIHMgPSBHTEVudW1Ub1N0cmluZyhhcmcpOworICAgICAgICAgICAgaWYgKHMpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiJXMiLCBzKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIjB4JXgiLCBhcmcpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKHN0cmNtcCh0eXBlLCAiR0xmaXhlZCIpID09IDApIHsKKyAgICAgICAgICAgIGludCBhcmcgPSB2YV9hcmcoYXJncCwgaW50KTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIweCUwOHgiLCBhcmcpOworICAgICAgICB9IGVsc2UgaWYgKHN0cmNtcCh0eXBlLCAiR0xmbG9hdCIpID09IDApIHsKKyAgICAgICAgICAgIGRvdWJsZSBhcmcgPSB2YV9hcmcoYXJncCwgZG91YmxlKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIlZyIsIGFyZyk7CisgICAgICAgIH0gZWxzZSBpZiAoc3RyY21wKHR5cGUsICJHTGludCIpID09IDApIHsKKyAgICAgICAgICAgIGludCBhcmcgPSB2YV9hcmcoYXJncCwgaW50KTsKKyAgICAgICAgICAgIGNvbnN0IGNoYXIqIHMgPSBOVUxMOworICAgICAgICAgICAgaWYgKHN0cmNtcChuYW1lLCAiZ2xUZXhQYXJhbWV0ZXJpIikgPT0gMCkgeworICAgICAgICAgICAgICAgIHMgPSBHTEVudW1Ub1N0cmluZyhhcmcpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHMpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiJXMiLCBzKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiVkIiwgYXJnKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChzdHJjbXAodHlwZSwgIkdMaW50cHRyIikgPT0gMCkgeworICAgICAgICAgICAgaW50IGFyZyA9IHZhX2FyZyhhcmdwLCB1bnNpZ25lZCBpbnQpOworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiV1IiwgYXJnKTsKKyAgICAgICAgfSBlbHNlIGlmIChzdHJjbXAodHlwZSwgIkdMc2l6ZWkiKSA9PSAwKSB7CisgICAgICAgICAgICBpbnQgYXJnID0gdmFfYXJnKGFyZ3AsIHNpemVfdCk7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiJXUiLCBhcmcpOworICAgICAgICB9IGVsc2UgaWYgKHN0cmNtcCh0eXBlLCAiR0xzaXplaXB0ciIpID09IDApIHsKKyAgICAgICAgICAgIGludCBhcmcgPSB2YV9hcmcoYXJncCwgc2l6ZV90KTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIldSIsIGFyZyk7CisgICAgICAgIH0gZWxzZSBpZiAoc3RyY21wKHR5cGUsICJHTHVpbnQiKSA9PSAwKSB7CisgICAgICAgICAgICBpbnQgYXJnID0gdmFfYXJnKGFyZ3AsIHVuc2lnbmVkIGludCk7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiJXUiLCBhcmcpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIi8qID8/PyAlcyAqLyIsIHR5cGUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgYnVpbGRlci5hcHBlbmQoIik7Iik7CisgICAgTE9HRCgiJXMiLCBidWlsZGVyLmdldFN0cmluZygpKTsKKyAgICB2YV9lbmQoYXJncCk7Cit9CisKKyN1bmRlZiBUUkFDRV9HTF9WT0lECisjdW5kZWYgVFJBQ0VfR0wKKworI2RlZmluZSBUUkFDRV9HTF9WT0lEKF9hcGksIF9hcmdzLCBfYXJnTGlzdCwgLi4uKSAgICAgICAgICAgICAgICAgICAgICAgICBcCitzdGF0aWMgdm9pZCBUcmFjaW5nXyAjIyBfYXBpIF9hcmdzIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBUcmFjZUdMKCNfYXBpLCBfX1ZBX0FSR1NfXyk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIGdsX2hvb2tzX3Q6OmdsX3QgY29uc3QgKiBjb25zdCBfYyA9ICZnZXRHTFRyYWNlVGhyZWFkU3BlY2lmaWMoKS0+Z2w7ICBcCisgICAgX2MtPl9hcGkgX2FyZ0xpc3Q7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK30KKworI2RlZmluZSBUUkFDRV9HTChfdHlwZSwgX2FwaSwgX2FyZ3MsIF9hcmdMaXN0LCAuLi4pICAgICAgICAgICAgICAgICAgICAgICBcCitzdGF0aWMgX3R5c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gIG5leHQgaWYgJGxpbmUgPX4gL15cLy87CisgIG5leHQgaWYgJGxpbmUgPX4gL14jLzsKKyAgbmV4dCBpZiAkbGluZSA9fiAvXlxzKiQvOworICBpZiAoJGxpbmUgIX4gL15HTF9FTlRSWVwoKFteLF0rKSwgKFteLF0rKSwgKFteXCldKylcKS8pIHsKKyAgICBuZXh0OworICB9CisgIG15ICR0eXBlID0gJDE7CisgIG15ICRuYW1lID0gJDI7CisgIG15ICRhcmdzID0gJDM7CisgIAorICBteSBAYXJncyA9IHNwbGl0ICcsJywgJGFyZ3M7CisgIG15ICRsZW4gPSBzY2FsYXIoQGFyZ3MpOworICBteSAkbm9uVm9pZEFyZ0xlbiA9IDA7CisgIGZvciAobXkgJG51bSA9IDA7ICRudW0gPCAkbGVuOyAkbnVtKyspIHsKKyAgICBpZiAoJGFyZ3NbJG51bV0gbmUgInZvaWQiKSB7CisgICAgICAkbm9uVm9pZEFyZ0xlbisrOworICAgIH0KKyAgfQorICBpZiAoJHR5cGUgZXEgInZvaWQiKSB7CisgICAgcHJpbnRmKCJUUkFDRV9HTF9WT0lEKCIpOworICB9IGVsc2UgeworICAgIHByaW50ZigiVFJBQ0VfR0woJXMsICIsICR0eXBlKTsKKyAgfQorICAKKyAgcHJpbnRmKCIlcywgKCVzKSwgKCIsICRuYW1lLCAkYXJncyk7CisgICAgZm9yIChteSAkbnVtID0gMDsgJG51bSA8ICRsZW47ICRudW0rKykgeworICAgIGlmICgkYXJnc1skbnVtXSBuZSAidm9pZCIpIHsKKyAgICAgIGlmICgkbnVtID4gMCkgeworICAgICAgICBwcmludCAiLCAiOworICAgICAgfQorICAgICAgIworICAgICAgIyBleHRyYWN0IHRoZSBuYW1lIGZyb20gdGhlIHBhcmFtZXRlcgorICAgICAgIyB0eXBlIG5hbWUKKyAgICAgICMgY29uc3QgdHlwZSAqbmFtZQorICAgICAgIyB0eXBlICpuYW1lCisgICAgICAjIHR5cGUgbmFtZVs0XQorICAgICAgIworICAgICAgaWYgKCRhcmdzWyRudW1dID1+IC8oXFMrXHMpK1wqKlxzKihbXHddKykvKSB7CisgICAgICAgIHByaW50ZigiJXMiLCAkMik7CisgICAgICB9CisgICAgfQorICB9CisgIHByaW50ZigiKSwgJWQiLCAkbm9uVm9pZEFyZ0xlbik7CisgIGZvciAobXkgJG51bSA9IDA7ICRudW0gPCAkbGVuOyAkbnVtKyspIHsKKyAgICBpZiAoJGFyZ3NbJG51bV0gbmUgInZvaWQiKSB7CisgICAgICAjCisgICAgICAjIGV4dHJhY3QgdGhlIG5hbWUgZnJvbSB0aGUgcGFyYW1ldGVyCisgICAgICAjIHR5cGUgbmFtZQorICAgICAgIyBjb25zdCB0eXBlICpuYW1lCisgICAgICAjIHR5cGUgKm5hbWUKKyAgICAgICMgdHlwZSBuYW1lWzRdCisgICAgICAjCisgICAgICBteSAkYXJnID0gJGFyZ3NbJG51bV07CisgICAgICBpZiAoJGFyZyA9fiAvKFxTK1xzKStcKipccyooW1x3XSspLykgeworICAgICAgICBteSAkbmFtZSA9ICQyOworICAgICAgICBpZiAoJGFyZyA9fiAvKChjb25zdCApKihcUytccykrXCoqKVxzKihbXHddKykvKSB7CisgICAgICAgICAgbXkgJHR5cGUgPSBydHJpbSgkMSk7CisgICAgICAgICAgcHJpbnRmKCIsIFwiJXNcIiwgJXMiLCAkdHlwZSwgJG5hbWUpOworICAgICAgICB9CisgICAgICB9CisgICAgfQorICB9CisgIHByaW50ZigiKVxuIik7Cit9CisKKworCisKKwpkaWZmIC0tZ2l0IGEvb3BlbmdsL2xpYnMvdHJhY2UuaW4gYi9vcGVuZ2wvbGlicy90cmFjZS5pbgpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zZDQ5MmFmCi0tLSAvZGV2L251bGwKKysrIGIvb3BlbmdsL2xpYnMvdHJhY2UuaW4KQEAgLTAsMCArMSwzNzYgQEAKK1RSQUNFX0dMX1ZPSUQoZ2xBY3RpdmVUZXh0dXJlLCAoR0xlbnVt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ihzaGFkZXIpOworICAgICAgICBHTGludCBjb21waWxlZCA9IDA7CisgICAgICAgIGdsR2V0U2hhZGVyaXYoc2hhZGVyLCBHTF9DT01QSUxFX1NUQVRVUywgJmNvbXBpbGVkKTsKKyAgICAgICAgaWYgKCFjb21waWxlZCkgeworICAgICAgICAgICAgR0xpbnQgaW5mb0xlbiA9IDA7CisgICAgICAgICAgICBnbEdldFNoYWRlcml2KHNoYWRlciwgR0xfSU5GT19MT0dfTEVOR1RILCAmaW5mb0xlbik7CisgICAgICAgICAgICBpZiAoaW5mb0xlbikgeworICAgICAgICAgICAgICAgIGNoYXIqIGJ1ZiA9IChjaGFyKikgbWFsbG9jKGluZm9MZW4pOworICAgICAgICAgICAgICAgIGlmIChidWYpIHsKKyAgICAgICAgICAgICAgICAgICAgZ2xHZXRTaGFkZXJJbmZvTG9nKHNoYWRlciwgaW5mb0xlbiwgTlVMTCwgYnVmKTsKKyAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJDb3VsZCBub3QgY29tcGlsZSBzaGFkZXIgJWQ6XG4lc1xuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFkZXJUeXBlLCBidWYpOworICAgICAgICAgICAgICAgICAgICBmcmVlKGJ1Zik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkd1ZXNzaW5nIGF0IEdMX0lORk9fTE9HX0xFTkdUSCBzaXplXG4iKTsKKyAgICAgICAgICAgICAgICBjaGFyKiBidWYgPSAoY2hhciopIG1hbGxvYygweDEwMDApOworICAgICAgICAgICAgICAgIGlmIChidWYpIHsKKyAgICAgICAgICAgICAgICAgICAgZ2xHZXRTaGFkZXJJbmZvTG9nKHNoYWRlciwgMHgxMDAwLCBOVUxMLCBidWYpOworICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkNvdWxkIG5vdCBjb21waWxlIHNoYWRlciAlZDpcbiVzXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYWRlclR5cGUsIGJ1Zik7CisgICAgICAgICAgICAgICAgICAgIGZyZWUoYnVmKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBnbERlbGV0ZVNoYWRlcihzaGFkZXIpOworICAgICAgICAgICAgc2hhZGVyID0gMDsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gc2hhZGVyOworfQorCitHTHVpbnQgY3JlYXRlUHJvZ3JhbShjb25zdCBjaGFyKiBwVmVydGV4U291cmNlLCBjb25zdCBjaGFyKiBwRnJhZ21lbnRTb3VyY2UpIHsKKyAgICBHTHVpbnQgdmVydGV4U2hhZGVyID0gbG9hZFNoYWRlcihHTF9WRVJURVhfU0hBREVSLCBwVmVydGV4U291cmNlKTsKKyAgICBpZiAoIXZlcnRleFNoYWRlcikgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBHTHVpbnQgcGl4ZWxTaGFkZXIgPSBsb2FkU2hhZGVyKEdMX0ZSQUdNRU5UX1NIQURFUiwgcEZyYWdtZW50U291cmNlKTsKKyAgICBpZiAoIXBpeGVsU2hhZGVyKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIEdMdWludCBwcm9ncmFtID0gZ2xDcmVhdGVQcm9ncmFtKCk7CisgICAgaWYgKHByb2dyYW0pIHsKKyAgICAgICAgZ2xBdHRhY2hTaGFkZXIocHJvZ3JhbSwgdmVydGV4U2hhZGVyKTsKKyAgICAgICAgY2hlY2tHbEVycm9yKCJnbEF0dGFjaFNoYWRlciIpOworICAgICAgICBnbEF0dGFjaFNoYWRlcihwcm9ncmFtLCBwaXhlbFNoYWRlcik7CisgICAgICAgIGNoZWNrR2xFcnJvcigiZ2xBdHRhY2hTaGFkZXIiKTsKKyAgICAgICAgZ2xMaW5rUHJvZ3JhbShwcm9ncmFtKTsKKyAgICAgICAgR0xpbnQgbGlua1N0YXR1cyA9IEdMX0ZBTFNFOworICAgICAgICBnbEdldFByb2dyYW1pdihwcm9ncmFtLCBHTF9MSU5LX1NUQVRVUywgJmxpbmtTdGF0dXMpOworICAgICAgICBpZiAobGlua1N0YXR1cyAhPSBHTF9UUlVFKSB7CisgICAgICAgICAgICBHTGludCBidWZMZW5ndGggPSAwOworICAgICAgICAgICAgZ2xHZXRQcm9ncmFtaXYocHJvZ3JhbSwgR0xfSU5GT19MT0dfTEVOR1RILCAmYnVmTGVuZ3RoKTsKKyAgICAgICAgICAgIGlmIChidWZMZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBjaGFyKiBidWYgPSAoY2hhciopIG1hbGxvYyhidWZMZW5ndGgpOworICAgICAgICAgICAgICAgIGlmIChidWYpIHsKKyAgICAgICAgICAgICAgICAgICAgZ2xHZXRQcm9ncmFtSW5mb0xvZyhwcm9ncmFtLCBidWZMZW5ndGgsIE5VTEwsIGJ1Zik7CisgICAgICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiQ291bGQgbm90IGxpbmsgcHJvZ3JhbTpcbiVzXG4iLCBidWYpOworICAgICAgICAgICAgICAgICAgICBmcmVlKGJ1Zik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZ2xEZWxldGVQcm9ncmFtKHByb2dyYW0pOworICAgICAgICAgICAgcHJvZ3JhbSA9IDA7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIHByb2dyYW07Cit9CisKK0dMdWludCBnUHJvZ3JhbTsKK0dMaW50IGd2UG9zaXRpb25IYW5kbGU7CitHTGludCBnWXV2VGV4U2FtcGxlckhhbmRsZTsKKworYm9vbCBzZXR1cEdyYXBoaWNzKGludCB3LCBpbnQgaCkgeworICAgIGdQcm9ncmFtID0gY3JlYXRlUHJvZ3JhbShnVmVydGV4U2hhZGVyLCBnRnJhZ21lbnRTaGFkZXIpOworICAgIGlmICghZ1Byb2dyYW0pIHsKK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KikoJmJ1ZikpOworICAgIGlmIChlcnIgIT0gMCkgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgInl1dlRleEJ1ZmZlci0+bG9jayguLi4pIGZhaWxlZDogJWRcbiIsIGVycik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgZm9yIChpbnQgeCA9IDA7IHggPCB5dXZUZXhXaWR0aDsgeCsrKSB7CisgICAgICAgIGZvciAoaW50IHkgPSAwOyB5IDwgeXV2VGV4SGVpZ2h0OyB5KyspIHsKKyAgICAgICAgICAgIGludCBwYXJpdHlYID0gKHggLyBibG9ja1dpZHRoKSAmIDE7CisgICAgICAgICAgICBpbnQgcGFyaXR5WSA9ICh5IC8gYmxvY2tIZWlnaHQpICYgMTsKKyAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgaW50ZW5zaXR5ID0gKHBhcml0eVggXiBwYXJpdHlZKSA/IDYzIDogMTkxOworICAgICAgICAgICAgYnVmW3l1dlRleE9mZnNldFkgKyAoeSAqIHl1dlRleFN0cmlkZVkpICsgeF0gPSBpbnRlbnNpdHk7CisgICAgICAgICAgICBpZiAoeCA8IHl1dlRleFdpZHRoIC8gMiAmJiB5IDwgeXV2VGV4SGVpZ2h0IC8gMikgeworICAgICAgICAgICAgICAgIGJ1Zlt5dXZUZXhPZmZzZXRVICsgKHkgKiB5dXZUZXhTdHJpZGVVKSArIHhdID0gaW50ZW5zaXR5OworICAgICAgICAgICAgICAgIGlmICh5dXZUZXhTYW1lVVYpIHsKKyAgICAgICAgICAgICAgICAgICAgYnVmW3l1dlRleE9mZnNldFYgKyAoeSAqIHl1dlRleFN0cmlkZVYpICsgeF0gPSBpbnRlbnNpdHk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh4IDwgeXV2VGV4V2lkdGggLyA0ICYmIHkgPCB5dXZUZXhIZWlnaHQgLyA0KSB7CisgICAgICAgICAgICAgICAgICAgIGJ1Zlt5dXZUZXhPZmZzZXRWICsgKHkqMiAqIH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R0xfU1VDQ0VTUykgeworICAgICAgICAgICAgcHJpbnRmKCIgJXM6ICIsIG5hbWVzW2pdLm5hbWUpOworICAgICAgICAgICAgcHJpbnRmKCIlZCAoMHgleCkiLCB2YWx1ZSwgdmFsdWUpOworICAgICAgICB9CisgICAgfQorICAgIHByaW50ZigiXG4iKTsKK30KKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIqKiBhcmd2KSB7CisgICAgRUdMQm9vbGVhbiByZXR1cm5WYWx1ZTsKKyAgICBFR0xDb25maWcgbXlDb25maWcgPSB7MH07CisKKyAgICBFR0xpbnQgY29udGV4dF9hdHRyaWJzW10gPSB7IEVHTF9DT05URVhUX0NMSUVOVF9WRVJTSU9OLCAyLCBFR0xfTk9ORSB9OworICAgIEVHTGludCBzX2NvbmZpZ0F0dHJpYnNbXSA9IHsKKyAgICAgICAgICAgIEVHTF9TVVJGQUNFX1RZUEUsIEVHTF9XSU5ET1dfQklULAorICAgICAgICAgICAgRUdMX1JFTkRFUkFCTEVfVFlQRSwgRUdMX09QRU5HTF9FUzJfQklULAorICAgICAgICAgICAgRUdMX05PTkUgfTsKKyAgICBFR0xpbnQgbWFqb3JWZXJzaW9uOworICAgIEVHTGludCBtaW5vclZlcnNpb247CisgICAgRUdMQ29udGV4dCBjb250ZXh0OworICAgIEVHTFN1cmZhY2Ugc3VyZmFjZTsKKyAgICBFR0xpbnQgdywgaDsKKworICAgIEVHTERpc3BsYXkgZHB5OworCisgICAgY2hlY2tFZ2xFcnJvcigiPGluaXQ+Iik7CisgICAgZHB5ID0gZWdsR2V0RGlzcGxheShFR0xfREVGQVVMVF9ESVNQTEFZKTsKKyAgICBjaGVja0VnbEVycm9yKCJlZ2xHZXREaXNwbGF5Iik7CisgICAgaWYgKGRweSA9PSBFR0xfTk9fRElTUExBWSkgeworICAgICAgICBwcmludGYoImVnbEdldERpc3BsYXkgcmV0dXJuZWQgRUdMX05PX0RJU1BMQVkuXG4iKTsKKyAgICAgICAgcmV0dXJuIDA7C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VTaGFkZXIoc2hhZGVyVHlwZSk7CisgICAgaWYgKHNoYWRlcikgeworICAgICAgICBnbFNoYWRlclNvdXJjZShzaGFkZXIsIDEsICZwU291cmNlLCBOVUxMKTsKKyAgICAgICAgZ2xDb21waWxlU2hhZGVyKHNoYWRlcik7CisgICAgICAgIEdMaW50IGNvbXBpbGVkID0gMDsKKyAgICAgICAgZ2xHZXRTaGFkZXJpdihzaGFkZXIsIEdMX0NPTVBJTEVfU1RBVFVTLCAmY29tcGlsZWQpOworICAgICAgICBpZiAoIWNvbXBpbGVkKSB7CisgICAgICAgICAgICBHTGludCBpbmZvTGVuID0gMDsKKyAgICAgICAgICAgIGdsR2V0U2hhZGVyaXYoc2hhZGVyLCBHTF9JTkZPX0xPR19MRU5HVEgsICZpbmZvTGVuKTsKKyAgICAgICAgICAgIGlmIChpbmZvTGVuKSB7CisgICAgICAgICAgICAgICAgY2hhciogYnVmID0gKGNoYXIqKSBtYWxsb2MoaW5mb0xlbik7CisgICAgICAgICAgICAgICAgaWYgKGJ1ZikgeworICAgICAgICAgICAgICAgICAgICBnbEdldFNoYWRlckluZm9Mb2coc2hhZGVyLCBpbmZvTGVuLCBOVUxMLCBidWYpOworICAgICAgICAgICAgICAgICAgICBMT0dFKCJDb3VsZCBub3QgY29tcGlsZSBzaGFkZXIgJWQ6XG4lc1xuIiwgc2hhZGVyVHlwZSwgYnVmKTsKKyAgICAgICAgICAgICAgICAgICAgZnJlZShidWYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBnbERlbGV0ZVNoYWRlcihzaGFkZXIpOworICAgICAgICAgICAgICAgIHNoYWRlciA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIHNoYWRlcjsKK30KKworZW51bSB7CisgICAgQV9QT1MsCisgICAgQV9DT0xPUiwKKyAgICBBX1RFWDAsCisgICAgQV9URVgxCit9OworCitHTHVpbnQgY3JlYXRlUHJvZ3JhbShjb25zdCBj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ZlYzIgdl90ZXgwO1xuIgorICAgICJ2YXJ5aW5nIHZlYzIgdl90ZXgxO1xuIgorICAgICJ1bmlmb3JtIHZlYzIgdV90ZXhPZmY7XG4iCisKKyAgICAidm9pZCBtYWluKCkge1xuIgorICAgICIgICAgdl9jb2xvciA9IGFfY29sb3I7XG4iCisgICAgIiAgICB2X3RleDAgPSBhX3RleDA7XG4iCisgICAgIiAgICB2X3RleDEgPSBhX3RleDE7XG4iCisgICAgIiAgICB2X3RleDAueCArPSB1X3RleE9mZi54O1xuIgorICAgICIgICAgdl90ZXgxLnkgKz0gdV90ZXhPZmYueTtcbiIKKyAgICAiICAgIGdsX1Bvc2l0aW9uID0gYV9wb3M7XG4iCisgICAgIn1cbiI7CisKK3N0YXRpYyB2b2lkIHNldHVwVkEoKSB7CisgICAgc3RhdGljIGNvbnN0IGZsb2F0IHZ0eFtdID0geworICAgICAgICAtMS4wZiwtMS4wZiwKKyAgICAgICAgIDEuMGYsLTEuMGYsCisgICAgICAgIC0xLjBmLCAxLjBmLAorICAgICAgICAgMS4wZiwgMS4wZiB9OworICAgIHN0YXRpYyBjb25zdCBmbG9hdCBjb2xvcltdID0geworICAgICAgICAxLjBmLDAuMGYsMS4wZiwxLjBmLAorICAgICAgICAwLjBmLDAuMGYsMS4wZiwxLjBmLAorICAgICAgICAxLjBmLDEuMGYsMC4wZiwxLjBmLAorICAgICAgICAxLjBmLDEuMGYsMS4wZiwxLjBmIH07CisgICAgc3RhdGljIGNvbnN0IGZsb2F0IHRleDBbXSA9IHsKKyAgICAgICAgMC4wZiwwLjBmLAorICAgICAgICAxLjBmLDAuMGYsCisgICAgICAgIDAuMGYsMS4wZiwKKyAgICAgICAgMS4wZiwxLjBmIH07CisgICAgc3RhdGljIGNvbnN0IGZsb2F0IHRleDFbXSA9IHsKKyAgICAgICAgMS4wZiwwLjBmLAorICAgICAgICAxLjBmLDEuMGYsCisgICAgICAgIDAuMGYsMS4wZiwKKyAgICAgICAgMC4wZiwwLjBmIH07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pbnQgcGdtLCB1aW50MzJfdCBwYXNzQ291bnQpIHsKKyAgICBpZiAod2FybXVwKSB7CisgICAgICAgIGdsQ2xlYXIoR0xfREVQVEhfQlVGRkVSX0JJVCB8IEdMX0NPTE9SX0JVRkZFUl9CSVQpOworICAgICAgICBnbERyYXdBcnJheXMoR0xfVFJJQU5HTEVfU1RSSVAsIDAsIDQpOworICAgICAgICBwdFN3YXAoKTsKKyAgICAgICAgZ2xGaW5pc2goKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHN0YXJ0VGltZXIoKTsKKyAgICBnbENsZWFyKEdMX0RFUFRIX0JVRkZFUl9CSVQgfCBHTF9DT0xPUl9CVUZGRVJfQklUKTsKKyAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgcGFzc0NvdW50OyBjdCsrKSB7CisgICAgICAgIGludCBsb2MgPSBnbEdldFVuaWZvcm1Mb2NhdGlvbihwZ20sICJ1X3RleE9mZiIpOworICAgICAgICBnbFVuaWZvcm0yZihsb2MsICgoZmxvYXQpY3QpIC8gcGFzc0NvdW50LCAoKGZsb2F0KWN0KSAvIDIuZiAvIHBhc3NDb3VudCk7CisKKyAgICAgICAgcmFuZFVuaWZvcm0ocGdtLCAidV9jb2xvciIpOworICAgICAgICByYW5kVW5pZm9ybShwZ20sICJ1XzAiKTsKKyAgICAgICAgcmFuZFVuaWZvcm0ocGdtLCAidV8xIik7CisgICAgICAgIHJhbmRVbmlmb3JtKHBnbSwgInVfMiIpOworICAgICAgICByYW5kVW5pZm9ybShwZ20sICJ1XzMiKTsKKyAgICAgICAgZ2xEcmF3QXJyYXlzKEdMX1RSSUFOR0xFX1NUUklQLCAwLCA0KTsKKyAgICB9CisgICAgcHRTd2FwKCk7CisgICAgZ2xGaW5pc2goKTsKKyAgICBlbmRUaW1lcihwYXNzQ291bnQpOworfQorCisKK3N0YXRpYyB1aW50MzJfdCByZ2IodWludDMyX3QgciwgdWludDMyX3QgZywgdWludDMyX3QgYikKK3s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ihzdGRlcnIsICJhZnRlciAlcygpIGVnbEVycm9yICVzICgweCV4KVxuIiwgb3AsIEVHTFV0aWxzOjpzdHJlcnJvcihlcnJvciksCisgICAgICAgICAgICAgICAgZXJyb3IpOworICAgIH0KK30KKworc3RhdGljIHZvaWQgY2hlY2tHbEVycm9yKGNvbnN0IGNoYXIqIG9wKSB7CisgICAgZm9yIChHTGludCBlcnJvciA9IGdsR2V0RXJyb3IoKTsgZXJyb3I7IGVycm9yCisgICAgICAgICAgICA9IGdsR2V0RXJyb3IoKSkgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImFmdGVyICVzKCkgZ2xFcnJvciAoMHgleClcbiIsIG9wLCBlcnJvcik7CisgICAgfQorfQorCitib29sIGRvVGVzdCh1aW50MzJfdCB3LCB1aW50MzJfdCBoKTsKKworc3RhdGljIEVHTERpc3BsYXkgZHB5Oworc3RhdGljIEVHTFN1cmZhY2Ugc3VyZmFjZTsKKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIqKiBhcmd2KSB7CisgICAgRUdMQm9vbGVhbiByZXR1cm5WYWx1ZTsKKyAgICBFR0xDb25maWcgbXlDb25maWcgPSB7MH07CisKKyAgICBFR0xpbnQgY29udGV4dF9hdHRyaWJzW10gPSB7IEVHTF9DT05URVhUX0NMSUVOVF9WRVJTSU9OLCAyLCBFR0xfTk9ORSB9OworICAgIEVHTGludCBzX2NvbmZpZ0F0dHJpYnNbXSA9IHsKKyAgICAgICAgICAgIEVHTF9TVVJGQUNFX1RZUEUsIEVHTF9XSU5ET1dfQklULAorICAgICAgICAgICAgRUdMX1JFTkRFUkFCTEVfVFlQRSwgRUdMX09QRU5HTF9FUzJfQklULAorICAgICAgICAgICAgRUdMX05PTkUgfTsKKyAgICBFR0xpbnQgbWFqb3JWZXJzaW9uOworICAgIEVHTGludCBtaW5vclZlcnNpb247CisgICAgRUdMQ29udGV4dCBjb250ZXh0OworICAgIEVHTGludCB3LCBoOworCisKKyAgICBjaGVja0VnbEVycm9y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GZPdXQpOworICAgICAgICAgICAgICAgICBmT3V0ID0gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIExPR0koIldyaXRpbmcgdG86ICVzXG4iLGZpbGVOYW1lKTsKKyAgICAgICAgICAgIGZPdXQgPSBmb3BlbihmaWxlTmFtZSwgInciKTsKKyAgICAgICAgICAgIGlmIChmT3V0ID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBMT0dFKCJDb3VsZCBub3Qgb3BlbjogJXNcbiIsIGZpbGVOYW1lKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgTE9HSSgiXG52YXJDb2xvciwgdGV4Q291bnQsIG1vZHVsYXRlLCBleHRyYU1hdGgsIHRleFNpemUsIGJsZW5kLCBNcHBzLCBEQzYwXG4iKTsKKyAgICAgICAgICAgIGlmIChmT3V0KSBmcHJpbnRmKGZPdXQsInZhckNvbG9yLCB0ZXhDb3VudCwgbW9kdWxhdGUsIGV4dHJhTWF0aCwgdGV4U2l6ZSwgYmxlbmQsIE1wcHMsIERDNjBcclxuIik7CisgICAgfQorfQorCitKTklFWFBPUlQgdm9pZCBKTklDQUxMIEphdmFfY29tX2FuZHJvaWRfZ2xwZXJmX0dMUGVyZkxpYl9zdGVwKEpOSUVudiAqIGVudiwgam9iamVjdCBvYmopCit7CisgICAgaWYgKCEgZG9uZSkgeworICAgICAgICBpZiAoc3RhdGVDbG9jayA+IDAgJiYgKChzdGF0ZUNsb2NrICYgMSkgPT0gMCkpIHsKKyAgICAgICAgICAgIC8vZW5kVGltZXIoMTAwKTsKKyAgICAgICAgfQorICAgICAgICBkb1Rlc3QoKTsKKyAgICAgICAgc3RhdGVDbG9jaysrOworICAgIH0gZWxzZSB7CisgICAgICAgICAgICBnbENsZWFyKEdMX0RFUFRIX0JVRkZFUl9CSVQgfCBHTF9DT0xPUl9CVUZGRVJfQklUKTsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9vcGVuZ2wvdGVzdHMvZ2xfcGVyZmFw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RvcnkgeworICAgICAgICBwcml2YXRlIHN0YXRpYyBpbnQgRUdMX0NPTlRFWFRfQ0xJRU5UX1ZFUlNJT04gPSAweDMwOTg7CisgICAgICAgIHB1YmxpYyBFR0xDb250ZXh0IGNyZWF0ZUNvbnRleHQoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGRpc3BsYXksIEVHTENvbmZpZyBlZ2xDb25maWcpIHsKKyAgICAgICAgICAgIExvZy53KFRBRywgImNyZWF0aW5nIE9wZW5HTCBFUyAyLjAgY29udGV4dCIpOworICAgICAgICAgICAgY2hlY2tFZ2xFcnJvcigiQmVmb3JlIGVnbENyZWF0ZUNvbnRleHQiLCBlZ2wpOworICAgICAgICAgICAgaW50W10gYXR0cmliX2xpc3QgPSB7RUdMX0NPTlRFWFRfQ0xJRU5UX1ZFUlNJT04sIDIsIEVHTDEwLkVHTF9OT05FIH07CisgICAgICAgICAgICBFR0xDb250ZXh0IGNvbnRleHQgPSBlZ2wuZWdsQ3JlYXRlQ29udGV4dChkaXNwbGF5LCBlZ2xDb25maWcsIEVHTDEwLkVHTF9OT19DT05URVhULCBhdHRyaWJfbGlzdCk7CisgICAgICAgICAgICBjaGVja0VnbEVycm9yKCJBZnRlciBlZ2xDcmVhdGVDb250ZXh0IiwgZWdsKTsKKyAgICAgICAgICAgIHJldHVybiBjb250ZXh0OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgZGVzdHJveUNvbnRleHQoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGRpc3BsYXksIEVHTENvbnRleHQgY29udGV4dCkgeworICAgICAgICAgICAgZWdsLmVnbERlc3Ryb3lDb250ZXh0KGRpc3BsYXksIGNvbnRleHQpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBjaGVja0VnbEVycm9yKFN0cmluZyBwcm9tcHQsIEVHTDEwIGVnbCkgeworICAgICAgICBpbnQgZXJyb3I7CisgICAgICAgIHdoaWxlICgoZXJyb3IgPSBlZ2wuZWdsR2V0RXJyb3IoKSkgIT0gRUdMMTAuRUdMX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgU3RyaW5nLmZvcm1hdCgiJXM6IEVHTCBlcnJvcjogMHgleCIsIHByb21wdCwgZXJyb3IpKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIENvbmZpZ0Nob29zZXIgaW1wbGVtZW50cyBHTFN1cmZhY2VWaWV3LkVHTENvbmZpZ0Nob29zZXIgeworICAgICAgICBwcml2YXRlIHN0YXRpYyBpbnQgRUdMX09QRU5HTF9FUzJfQklUID0gNDsKKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgaW50W10gc19jb25maWdBdHRyaWJzMiA9CisgICAgICAgIHsKKyAgICAgICAgICAgIEVHTDEwLkVHTF9SRURfU0laRSwgNCwKKyAgICAgICAgICAgIEVHTDEwLkVHTF9HUkVFTl9TSVpFLCA0LAorICAgICAgICAgICAgRUdMMTAuRUdMX0JMVUVfU0laRSwgNCwKKyAgICAgICAgICAgIEVHTDEwLkVHTF9SRU5ERVJBQkxFX1RZUEUsIEVHTF9PUEVOR0xfRVMyX0JJVCwKKyAgICAgICAgICAgIEVHTDEwLkVHTF9OT05FCisgICAgICAgIH07CisKKyAgICAgICAgcHVibGljIENvbmZpZ0Nob29zZXIoaW50IHIsIGludCBnLCBpbnQgYiwgaW50IGEsIGludCBkZXB0aCwgaW50IHN0ZW5jaWwpIHsKKyAgICAgICAgICAgIG1SZWRTaXplID0gcjsKKyAgICAgICAgICAgIG1HcmVlblNpemUgPSBnOworICAgICAgICAgICAgbUJsdWVTaXplID0gYjsKKyAgICAgICAgICAgIG1BbHBoYVNpemUgPSBhOworICAgICAgICAgICAgbURlcHRoU2l6ZSA9IGRlcHRoOworICAgICAgICAgICAgbVN0ZW5jaWxTaXplID0gc3RlbmNpbDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBFR0xDb25maWcgY2hvb3NlQ29uZmlnKEVHTDEwIGVnbCwgRUdMRGlzcGxheSBkaXNwbGF5KSB7CisKKyAgICAgICAgICAgIGludFtdIG51bV9jb25maWcgPSBuZXcgaW50WzFdOworICAgICAgICAgICAgZWdsLmVnbENob29zZUNvbmZpZyhkaXNwbGF5LCBzX2NvbmZpZ0F0dHJpYnMyLCBudWxsLCAwLCBudW1fY29uZmlnKTsKKworICAgICAgICAgICAgaW50IG51bUNvbmZpZ3MgPSBudW1fY29uZmlnWzBdOworCisgICAgICAgICAgICBpZiAobnVtQ29uZmlncyA8PSAwKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTm8gY29uZmlncyBtYXRjaCBjb25maWdTcGVjIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBFR0xDb25maWdbXSBjb25maWdzID0gbmV3IEVHTENvbmZpZ1tudW1Db25maWdzXTsKKyAgICAgICAgICAgIGVnbC5lZ2xDaG9vc2VDb25maWcoZGlzcGxheSwgc19jb25maWdBdHRyaWJzMiwgY29uZmlncywgbnVtQ29uZmlncywgbnVtX2NvbmZpZyk7CisgICAgICAgICAgICAvLyBwcmludENvbmZpZ3MoZWdsLCBkaXNwbGF5LCBjb25maWdzKTsKKyAgICAgICAgICAgIHJldHVybiBjaG9vc2VDb25maWcoZWdsLCBkaXNwbGF5LCBjb25maWdzKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBFR0xDb25maWcgY2hvb3NlQ29uZmlnKEVHTDEwIGVnbCwgRUdMRGlzcGxheSBkaXNwbGF5LAorICAgICAgICAgICAgICAgIEVHTENvbmZpZ1tdIGNvbmZpZ3MpIHsKKyAgICAgICAgICAgIEVHTENvbmZpZyBjbG9zZXN0Q29uZmlnID0gbnVsbDsKKyAgICAgICAgICAgIGludCBjbG9zZXN0RGlzdGFuY2UgPSAxMDAwOworICAgICAgICAgICAgZm9yKEVHTENvbmZpZyBjb25maWcgOiBjb25maWdzKSB7CisgICAgICAgICAgICAgICAgaW50IGQgPSBmaW5kQ29uZmlnQXR0cmliKGVnbCwgZGlzcGxheSwgY29uZmlnLAorICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0RFUFRIX1NJWkUsIDApOworICAgICAgICAgICAgICAgIGludCBzID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9TVEVOQ0lMX1NJWkUsIDApOworICAgICAgICAgICAgICAgIGlmIChkID49IG1EZXB0aFNpemUgJiYgcz49IG1TdGVuY2lsU2l6ZSkgeworICAgICAgICAgICAgICAgICAgICBpbnQgciA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX1JFRF9TSVpFLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGcgPSBmaW5kQ29uZmlnQXR0cmliKGVnbCwgZGlzcGxheSwgY29uZmlnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfR1JFRU5fU0laRSwgMCk7CisgICAgICAgICAgICAgICAgICAgIGludCBiID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9CTFVFX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICBpbnQgYSA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0FMUEhBX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICBpbnQgZGlzdGFuY2UgPSBNYXRoLmFicyhyIC0gbVJlZFNpemUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgTWF0aC5hYnMoZyAtIG1HcmVlblNpemUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgTWF0aC5hYnMoYiAtIG1CbHVlU2l6ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBNYXRoLmFicyhhIC0gbUFscGhhU2l6ZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChkaXN0YW5jZSA8IGNsb3Nlc3REaXN0YW5jZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2VzdERpc3RhbmNlID0gZGlzdGFuY2U7CisgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZXN0Q29uZmlnID0gY29uZmlnOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGNsb3Nlc3RDb25maWc7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIGludCBmaW5kQ29uZmlnQXR0cmliKEVHTDEwIGVnbCwgRUdMRGlzcGxheSBkaXNwbGF5LAorICAgICAgICAgICAgICAgIEVHTENvbmZpZyBjb25maWcsIGludCBhdHRyaWJ1dGUsIGludCBkZWZhdWx0VmFsdWUpIHsKKworICAgICAgICAgICAgaWYgKGVnbC5lZ2xHZXRDb25maWdBdHRyaWIoZGlzcGxheSwgY29uZmlnLCBhdHRyaWJ1dGUsIG1WYWx1ZSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVZhbHVlWzBdOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRWYWx1ZTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBwcmludENvbmZpZ3MoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGRpc3BsYXksCisgICAgICAgICAgICBFR0xDb25maWdbXSBjb25maWdzKSB7CisgICAgICAgICAgICBpbnQgbnVtQ29uZmlncyA9IGNvbmZpZ3MubGVuZ3RoOworICAgICAgICAgICAgTG9nLncoVEFHLCBTdHJpbmcuZm9ybWF0KCIlZCBjb25maWd1cmF0aW9ucyIsIG51bUNvbmZpZ3MpKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtQ29uZmlnczsgaSsrKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCBTdHJpbmcuZm9ybWF0KCJDb25maWd1cmF0aW9uICVkOlxuIiwgaSkpOworICAgICAgICAgICAgICAgIHByaW50Q29uZmlnKGVnbCwgZGlzcGxheSwgY29uZmlnc1tpXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgcHJpbnRDb25maWcoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGRpc3BsYXksCisgICAgICAgICAgICAgICAgRUdMQ29uZmlnIGNvbmZpZykgeworICAgICAgICAgICAgaW50W10gYXR0cmlidXRlcyA9IHsKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0JVRkZFUl9TSVpFLAorICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfQUxQSEFfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0JMVUVfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0dSRUVOX1NJWkUsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9SRURfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0RFUFRIX1NJWkUsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9TVEVOQ0lMX1NJWkUsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9DT05GSUdfQ0FWRUFULAorICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfQ09ORklHX0lELAorICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfTEVWRUwsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9NQVhfUEJVRkZFUl9IRUlHSFQsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9NQVhfUEJVRkZFUl9QSVhFTFMsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9NQVhfUEJVRkZFUl9XSURUSCwKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX05BVElWRV9SRU5ERVJBQkxFLAorICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfTkFUSVZFX1ZJU1VBTF9JRCwKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX05BVElWRV9WSVNVQUxfVFlQRSwKKyAgICAgICAgICAgICAgICAgICAgMHgzMDMwLCAvLyBFR0wxMC5FR0xfUFJFU0VSVkVEX1JFU09VUkNFUywKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX1NBTVBMRVMsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9TQU1QTEVfQlVGRkVSUywKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX1NVUkZBQ0VfVFlQRSwKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX1RSQU5TUEFSRU5UX1RZUEUsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9UUkFOU1BBUkVOVF9SRURfVkFMVUUsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9UUkFOU1BBUkVOVF9HUkVFTl9WQUxVRSwKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX1RSQU5TUEFSRU5UX0JMVUVfVkFMVUUsCisgICAgICAgICAgICAgICAgICAgIDB4MzAzOSwgLy8gRUdMMTAuRUdMX0JJTkRfVE9fVEVYVFVSRV9SR0IsCisgICAgICAgICAgICAgICAgICAgIDB4MzAzQSwgLy8gRUdMMTAuRUdMX0JJTkRfVE9fVEVYVFVSRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAweDMwM0IsIC8vIEVHTDEwLkVHTF9NSU5fU1dBUF9JTlRFUlZBTCwKKyAgICAgICAgICAgICAgICAgICAgMHgzMDNDLCAvLyBFR0wxMC5FR0xfTUFYX1NXQVBfSU5URVJWQUwsCisgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9MVU1JTkFOQ0VfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0FMUEhBX01BU0tfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0NPTE9SX0JVRkZFUl9UWVBFLAorICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfUkVOREVSQUJMRV9UWVBFLAorICAgICAgICAgICAgICAgICAgICAweDMwNDIgLy8gRUdMMTAuRUdMX0NPTkZPUk1BTlQKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBTdHJpbmdbXSBuYW1lcyA9IHsKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9CVUZGRVJfU0laRSIsCisgICAgICAgICAgICAgICAgICAgICJFR0xfQUxQSEFfU0laRSIsCisgICAgICAgICAgICAgICAgICAgICJFR0xfQkxVRV9TSVpFIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9HUkVFTl9TSVpFIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9SRURfU0laRSIsCisgICAgICAgICAgICAgICAgICAgICJFR0xfREVQVEhfU0laRSIsCisgICAgICAgICAgICAgICAgICAgICJFR0xfU1RFTkNJTF9TSVpFIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9DT05GSUdfQ0FWRUFUIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9DT05GSUdfSUQiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX0xFVkVMIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9NQVhfUEJVRkZFUl9IRUlHSFQiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX01BWF9QQlVGRkVSX1BJWEVMUyIsCisgICAgICAgICAgICAgICAgICAgICJFR0xfTUFYX1BCVUZGRVJfV0lEVEgiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX05BVElWRV9SRU5ERVJBQkxFIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9OQVRJVkVfVklTVUFMX0lEIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9OQVRJVkVfVklTVUFMX1RZUEUiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX1BSRVNFUlZFRF9SRVNPVVJDRVMiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX1NBTVBMRVMiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX1NBTVBMRV9CVUZGRVJTIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9TVVJGQUNFX1RZUEUiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX1RSQU5TUEFSRU5UX1RZUEUiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX1RSQU5TUEFSRU5UX1JFRF9WQUxVRSIsCisgICAgICAgICAgICAgICAgICAgICJFR0xfVFJBTlNQQVJFTlRfR1JFRU5fVkFMVUUiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX1RSQU5TUEFSRU5UX0JMVUVfVkFMVUUiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX0JJTkRfVE9fVEVYVFVSRV9SR0IiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX0JJTkRfVE9fVEVYVFVSRV9SR0JBIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9NSU5fU1dBUF9JTlRFUlZBTCIsCisgICAgICAgICAgICAgICAgICAgICJFR0xfTUFYX1NXQVBfSU5URVJWQUwiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX0xVTUlOQU5DRV9TSVpFIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9BTFBIQV9NQVNLX1NJWkUiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX0NPTE9SX0JVRkZFUl9UWVBFIiwKKyAgICAgICAgICAgICAgICAgICAgIkVHTF9SRU5ERVJBQkxFX1RZUEUiLAorICAgICAgICAgICAgICAgICAgICAiRUdMX0NPTkZPUk1BTlQiCisgICAgICAgICAgICB9OworICAgICAgICAgICAgaW50W10gdmFsdWUgPSBuZXcgaW50WzFdOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhdHRyaWJ1dGVzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgaW50IGF0dHJpYnV0ZSA9IGF0dHJpYnV0ZXNbaV07CisgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBuYW1lc1tpXTsKKyAgICAgICAgICAgICAgICBpZiAoIGVnbC5lZ2xHZXRDb25maWdBdHRyaWIoZGlzcGxheSwgY29uZmlnLCBhdHRyaWJ1dGUsIHZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsIFN0cmluZy5mb3JtYXQoIiAgJXM6ICVkXG4iLCBuYW1lLCB2YWx1ZVswXSkpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIExvZy53KFRBRywgU3RyaW5nLmZvcm1hdCgiICAlczogZmFpbGVkXG4iLCBuYW1lKSk7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlIChlZ2wuZWdsR2V0RXJyb3IoKSAhPSBFR0wxMC5FR0xfU1VDQ0VTUyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gU3ViY2xhc3NlcyBjYW4gYWRqdXN0IHRoZXNlIHZhbHVlczoKKyAgICAgICAgcHJvdGVjdGVkIGludCBtUmVkU2l6ZTsKKyAgICAgICAgcHJvdGVjdGVkIGludCBtR3JlZW5TaXplOworICAgICAgICBwcm90ZWN0ZWQgaW50IG1CbHVlU2l6ZTsKKyAgICAgICAgcHJvdGVjdGVkIGludCBtQWxwaGFTaXplOworICAgICAgICBwcm90ZWN0ZWQgaW50IG1EZXB0aFNpemU7CisgICAgICAgIHByb3RlY3RlZCBpbnQgbVN0ZW5jaWxTaXplOworICAgICAgICBw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YmxvY2tIZWlnaHQpICYgMTsKKyAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgaW50ZW5zaXR5ID0gKHBhcml0eVggXiBwYXJpdHlZKSA/IDYzIDogMTkxOworICAgICAgICAgICAgYnVmW3l1dlRleE9mZnNldFkgKyAoeSAqIHl1dlRleFN0cmlkZVkpICsgeF0gPSBpbnRlbnNpdHk7CisgICAgICAgICAgICBpZiAoeCA8IHl1dlRleFdpZHRoIC8gMiAmJiB5IDwgeXV2VGV4SGVpZ2h0IC8gMikgeworICAgICAgICAgICAgICAgIGJ1Zlt5dXZUZXhPZmZzZXRVICsgKHkgKiB5dXZUZXhTdHJpZGVVKSArIHhdID0gaW50ZW5zaXR5OworICAgICAgICAgICAgICAgIGlmICh5dXZUZXhTYW1lVVYpIHsKKyAgICAgICAgICAgICAgICAgICAgYnVmW3l1dlRleE9mZnNldFYgKyAoeSAqIHl1dlRleFN0cmlkZVYpICsgeF0gPSBpbnRlbnNpdHk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh4IDwgeXV2VGV4V2lkdGggLyA0ICYmIHkgPCB5dXZUZXhIZWlnaHQgLyA0KSB7CisgICAgICAgICAgICAgICAgICAgIGJ1Zlt5dXZUZXhPZmZzZXRWICsgKHkqMiAqIHl1dlRleFN0cmlkZVYpICsgeCoyICsgMF0gPQorICAgICAgICAgICAgICAgICAgICBidWZbeXV2VGV4T2Zmc2V0ViArICh5KjIgKiB5dXZUZXhTdHJpZGVWKSArIHgqMiArIDFdID0KKyAgICAgICAgICAgICAgICAgICAgYnVmW3l1dlRleE9mZnNldFYgKyAoKHkqMisxKSAqIHl1dlRleFN0cmlkZVYpICsgeCoyICsgMF0gPQorICAgICAgICAgICAgICAgICAgICBidWZbeXV2VGV4T2Zmc2V0ViArICgoeSoyKzEpICogeXV2VGV4U3RyaWRlVikgKyB4KjIgKyAxXSA9IGludGVuc2l0eTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0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gICBFR0xDb25maWcgbXlDb25maWcgPSB7MH07CisKKyAgICBFR0xpbnQgY29udGV4dF9hdHRyaWJzW10gPSB7IEVHTF9DT05URVhUX0NMSUVOVF9WRVJTSU9OLCAxLCBFR0xfTk9ORSB9OworICAgIEVHTGludCBzX2NvbmZpZ0F0dHJpYnNbXSA9IHsKKyAgICAgICAgICAgIEVHTF9TVVJGQUNFX1RZUEUsIEVHTF9XSU5ET1dfQklULAorICAgICAgICAgICAgRUdMX1JFTkRFUkFCTEVfVFlQRSwgRUdMX09QRU5HTF9FU19CSVQsCisgICAgICAgICAgICBFR0xfTk9ORSB9OworICAgIEVHTGludCBtYWpvclZlcnNpb247CisgICAgRUdMaW50IG1pbm9yVmVyc2lvbjsKKyAgICBFR0xDb250ZXh0IGNvbnRleHQ7CisgICAgRUdMU3VyZmFjZSBzdXJmYWNlOworICAgIEVHTGludCB3LCBoOworCisgICAgRUdMRGlzcGxheSBkcHk7CisKKyAgICBjaGVja0VnbEVycm9yKCI8aW5pdD4iKTsKKyAgICBkcHkgPSBlZ2xHZXREaXNwbGF5KEVHTF9ERUZBVUxUX0RJU1BMQVkpOworICAgIGNoZWNrRWdsRXJyb3IoImVnbEdldERpc3BsYXkiKTsKKyAgICBpZiAoZHB5ID09IEVHTF9OT19ESVNQTEFZKSB7CisgICAgICAgIHByaW50ZigiZWdsR2V0RGlzcGxheSByZXR1cm5lZCBFR0xfTk9fRElTUExBWS5cbiIpOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICByZXR1cm5WYWx1ZSA9IGVnbEluaXRpYWxpemUoZHB5LCAmbWFqb3JWZXJzaW9uLCAmbWlub3JWZXJzaW9uKTsKKyAgICBjaGVja0VnbEVycm9yKCJlZ2xJbml0aWFsaXplIiwgcmV0dXJuVmFsdWUpOworICAgIGZwcmludGYoc3RkZXJyLCAiRUdMIHZlcnNpb24gJWQuJWRcbiIsIG1ham9yVmVyc2lvbiwgbWlub3JWZXJzaW9uKTsKKyAgICBpZi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WNlKGRweSwgY29udGV4dCkpIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJDb3VsZCBub3Qgc2V0IHVwIHRleHR1cmUgc3VyZmFjZS5cbiIpOworICAgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgICBpZighc2V0dXBHcmFwaGljcyh3LCBoKSkgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkNvdWxkIG5vdCBzZXQgdXAgZ3JhcGhpY3MuXG4iKTsKKyAgICAgICAgcmV0dXJuIDE7CisgICAgfQorCisgICAgZm9yICg7OykgeworICAgICAgICBzdGF0aWMgaW50IGRpciA9IC0xOworCisgICAgICAgIHJlbmRlckZyYW1lKHcsIGgpOworICAgICAgICBlZ2xTd2FwQnVmZmVycyhkcHksIHN1cmZhY2UpOworICAgICAgICBjaGVja0VnbEVycm9yKCJlZ2xTd2FwQnVmZmVycyIpOworCisgICAgICAgIGlmICh3IDw9IDEwIHx8IGggPD0gMTApCisgICAgICAgIHsKKyAgICAgICAgICAgIGRpciA9IC1kaXI7CisgICAgICAgIH0KKworICAgICAgICBpZiAodyA+PSAxMzAwIHx8IGggPj0gOTAwKQorICAgICAgICB7CisgICAgICAgICAgICBkaXIgPSAtZGlyOworICAgICAgICB9CisKKworICAgICAgICB3ICs9IGRpcjsKKyAgICAgICAgaCArPSBkaXI7CisgICAgfQorCisgICAgcmV0dXJuIDA7Cit9CmRpZmYgLS1naXQgYS9vcGVuZ2wvdGVzdHMvdGVzdEZyYW1lcmF0ZS9BbmRyb2lkLm1rIGIvb3BlbmdsL3Rlc3RzL3Rlc3RGcmFtZXJhdGUvQW5kcm9pZC5tawpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41MDBhYmYzCi0tLSAvZGV2L251bGwKKysrIGIvb3BlbmdsL3Rlc3RzL3Rlc3RGcmFtZXJhdGUvQW5kcm9pZC5tawpAQCAtMCwwICsxLDE5IEBACisjIyMjIyMjIyMjIyMjIyMjIyMjIyMj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MDAwMC5mIC8gZWxhcHNlZFRpbWVfdXM7CisgICAgICAgIGlmIChtTGFzdFRpbWVfdXMgPiAwICYmIGVsYXBzZWRUaW1lX3VzID4gbG9uZ0ZyYW1lVGltZV9tcyoxMDAwKSB7CisgICAgICAgICAgTG9nLnYoVEFHLCAiTG9uZyBmcmFtZTogIiArIGVsYXBzZWRUaW1lX3VzLzEwMDAuZiArICIgbXMgKCIgKyBmcHMgKyAiIGZwcykiKTsKKyAgICAgICAgICBpZiAobU51bVNob3J0RnJhbWVzRWxhcHNlZCA+IDApIHsKKyAgICAgICAgICAgIExvZy52KFRBRywgIiAgU2hvcnQgZnJhbWVzIHNpbmNlIGxhc3QgbG9uZyBmcmFtZTogIiArIG1OdW1TaG9ydEZyYW1lc0VsYXBzZWQpOworICAgICAgICAgICAgbU51bVNob3J0RnJhbWVzRWxhcHNlZCA9IDA7CisgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgKyttTnVtU2hvcnRGcmFtZXNFbGFwc2VkOworICAgICAgICB9CisKKyAgICAgICAgbUxhc3RUaW1lX3VzID0gbm93X3VzOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgUmVuZGVyZXIgaW1wbGVtZW50cyBHTFN1cmZhY2VWaWV3LlJlbmRlcmVyIHsKKyAgICAgICAgcHVibGljIFJlbmRlcmVyKCkgeworICAgICAgICB9CisKKworICAgICAgICBwdWJsaWMgdm9pZCBvbkRyYXdGcmFtZShHTDEwIGdsKSB7CisgICAgICAgICAgICBsb25nIG5vd191cyA9IFN5c3RlbS5uYW5vVGltZSgpIC8gMTAwMDsKKyAgICAgICAgICAgIHJlZ2lzdGVyVGltZShub3dfdXMpOworCisgICAgICAgICAgICBmbG9hdCByZWQgPSAobm93X3VzICUgMTAwMDAwMCkgLyAxMDAwMDAwLmY7CisgICAgICAgICAgICBmbG9hdCBncmVlbiA9IChub3dfdXMgJSAyMDAwMDAwKSAvIDIwMDAwMDAuZjsKKyAgICAgICAgIC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ICAgICAgICBmbG9hdCB4ID0gZXZlbnQuZ2V0WCgpOworICAgICAgICAgICAgZmxvYXQgeSA9IGV2ZW50LmdldFkoKTsKKyAgICAgICAgICAgIGxvbmcgIHQgPSBldmVudC5nZXRFdmVudFRpbWUoKTsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CisgICAgICAgICAgICAgICAgbURUID0gdCAtIG1UOworICAgICAgICAgICAgICAgIG1UID0gdDsKKyAgICAgICAgICAgICAgICBtRFggPSB4IC0gbVg7CisgICAgICAgICAgICAgICAgbVggPSB4OworICAgICAgICAgICAgICAgIG1EWSA9IHkgLSBtWTsKKyAgICAgICAgICAgICAgICBtWSA9IHk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgUmVuZGVyZXIgaW1wbGVtZW50cyBHTFN1cmZhY2VWaWV3LlJlbmRlcmVyIHsKKyAgICAgICAgcHJpdmF0ZSBmbG9hdCBtU2NhbGVYLCBtU2NhbGVZLCBtT2Zmc2V0WCwgbU9mZnNldFk7CisgICAgICAgIHByaXZhdGUgZmluYWwgZmxvYXQgTVNfUEVSX0ZSQU1FID0gMTAwMCAvIDYwOworICAgICAgICBwdWJsaWMgUmVuZGVyZXIoKSB7CisgICAgICAgICAgICBtVHJpYW5nbGVWZXJ0aWNlcyA9IEJ5dGVCdWZmZXIuYWxsb2NhdGVEaXJlY3QobVRyaWFuZ2xlVmVydGljZXNEYXRhLmxlbmd0aCAqIDQpCisgICAgICAgICAgICAgICAgLm9yZGVyKEJ5dGVPcmRlci5uYXRpdmVPcmRlcigpKS5hc0Zsb2F0QnVmZmVyKCk7CisgICAgICAgIH0KKworCisgICAgICAgIHB1YmxpYyB2b2lkIG9uRHJhd0ZyYW1lKEdMMTAgZ2wpIHsKKyAgICAgICAgICAgIEdMRVMyMC5nbENsZWFyQ29sb3IoMC40ZiwgMC40ZiwgMC40ZiwgMS4wZik7CisgICAgICAgICAgICBHTEVTMjAuZ2xDbGVhciggR0xFUzIwLkdMX0RFUFRIX0JVRkZFUl9CSVQgfCBHTEVTMjAuR0xfQ09MT1JfQlVGRkVSX0JJVCk7CisgICAgICAgICAgICBHTEVTMjAuZ2xVc2VQcm9ncmFtKG1Qcm9ncmFtKTsKKyAgICAgICAgICAgIGNoZWNrR2xFcnJvcigiZ2xVc2VQcm9ncmFtIik7CisKKyAgICAgICAgICAgIGZsb2F0IHgsIHksIGR4LCBkeTsKKyAgICAgICAgICAgIGxvbmcgdCwgZHQ7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQoVGVzdExhdGVuY3lWaWV3LnRoaXMpIHsKKyAgICAgICAgICAgICAgICB4ID0gbVg7CisgICAgICAgICAgICAgICAgeSA9IG1ZOworICAgICAgICAgICAgICAgIGR4ID0gbURYOworICAgICAgICAgICAgICAgIGR5ID0gbURZOworICAgICAgICAgICAgICAgIGR0ID0gbURUOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZHQgPiAwKSB7CisgICAgICAgICAgICAgICAgZHggPSBkeCAqIE1TX1BFUl9GUkFNRSAvIGR0OworICAgICAgICAgICAgICAgIGR5ID0gZHkgKiBNU19QRVJfRlJBTUUgLyBkdDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgR0xFUzIwLmdsRW5hYmxlVmVydGV4QXR0cmliQXJyYXkobXZQb3NpdGlvbkhhbmRsZSk7CisgICAgICAgICAgICBjaGVja0dsRXJyb3IoImdsRW5hYmxlVmVydGV4QXR0cmliQXJyYXkiKTsKKyAgICAgICAgICAgIEdMRVMyMC5nbEVuYWJsZVZlcnRleEF0dHJpYkFycmF5KG12Q29sb3JIYW5kbGUpOworICAgICAgICAgICAgY2hlY2tHbEVycm9yKCJnbEVuYWJsZVZlcnRleEF0dHJpYkFycmF5Iik7CisgICAgICAgICAgICBmb3IoaW50IHN0ZXAgPSAwOyBzdGVwIDwgODsgc3RlcCsrKSB7CisgICAgICAgICAgICAgICAgZmxvYXQgc3ggPSAoeCArIGR4ICogc3RlcCkgKiBtU2NhbGVYICsgbU9mZnNldFg7CisgICAgICAgICAgICAgICAgZmxvYXQgc3kgPSAoeSArIGR5ICogc3RlcCkgKiBtU2NhbGVZICsgbU9mZnNldFk7CisgICAgICAgICAgICAgICAgaW50IGNiYXNlID0gc3RlcCAqIDQ7CisKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1UcmlhbmdsZVZlcnRpY2VzRGF0YS5sZW5ndGg7IGkgKz0gNikgeworICAgICAgICAgICAgICAgICAgICBtVHJpYW5nbGVWZXJ0aWNlc0RhdGEyW2ldID0gc3ggKyBtVHJpYW5nbGVWZXJ0aWNlc0RhdGFbaV07CisgICAgICAgICAgICAgICAgICAgIG1UcmlhbmdsZVZlcnRpY2VzRGF0YTJbaSsxXSA9IC1zeSArIG1UcmlhbmdsZVZlcnRpY2VzRGF0YVtpKzFdOworICAgICAgICAgICAgICAgICAgICBtVHJpYW5nbGVWZXJ0aWNlc0RhdGEyW2krMl0gPSBtQ29sb3JzW2NiYXNlXTsKKyAgICAgICAgICAgICAgICAgICAgbVRyaWFuZ2xlVmVydGljZXNEYXRhMltpKzNdID0gbUNvbG9yc1tjYmFzZSsxXTsKKyAgICAgICAgICAgICAgICAgICAgbVRyaWFuZ2xlVmVydGljZXNEYXRhMltpKzRdID0gbUNvbG9yc1tjYmFzZSsyXTsKKyAgICAgICAgICAgICAgICAgICAgbVRyaWFuZ2xlVmVydGljZXNEYXRhMltpKzVdID0gbUNvbG9yc1tjYmFzZSszXTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVRyaWFuZ2xlVmVydGljZXMucG9zaXRpb24oMCk7CisgICAgICAgICAgICAgICAgbVRyaWFuZ2xlVmVydGljZXMucHV0KG1UcmlhbmdsZVZlcnR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U9mZnNldFkgPSAtMWY7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblN1cmZhY2VDcmVhdGVkKEdMMTAgZ2wsIEVHTENvbmZpZyBjb25maWcpIHsKKyAgICAgICAgICAgIG1Qcm9ncmFtID0gY3JlYXRlUHJvZ3JhbShtVmVydGV4U2hhZGVyLCBtRnJhZ21lbnRTaGFkZXIpOworICAgICAgICAgICAgaWYgKG1Qcm9ncmFtID09IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtdlBvc2l0aW9uSGFuZGxlID0gR0xFUzIwLmdsR2V0QXR0cmliTG9jYXRpb24obVByb2dyYW0sICJhUG9zaXRpb24iKTsKKyAgICAgICAgICAgIGNoZWNrR2xFcnJvcigiZ2xHZXRBdHRyaWJMb2NhdGlvbiIpOworICAgICAgICAgICAgaWYgKG12UG9zaXRpb25IYW5kbGUgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGdldCBhdHRyaWIgbG9jYXRpb24gZm9yIHZQb3NpdGlvbiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbXZDb2xvckhhbmRsZSA9IEdMRVMyMC5nbEdldEF0dHJpYkxvY2F0aW9uKG1Qcm9ncmFtLCAiYUNvbG9yIik7CisgICAgICAgICAgICBjaGVja0dsRXJyb3IoImdsR2V0QXR0cmliTG9jYXRpb24iKTsKKyAgICAgICAgICAgIGlmIChtdkNvbG9ySGFuZGxlID09IC0xKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNvdWxkIG5vdCBnZXQgYXR0cmliIGxvY2F0aW9uIGZvciB2Q29sb3IiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgaW50IGxvYWRTaGFkZXIoaW50IHNoYWRlclR5cGUsIFN0cmluZyBzb3VyY2UpIHsKKyAgICAgICAgICAgIGludCBzaGFkZXIgPSBHTEVTMjAuZ2xDcmVhdGVTaGFkZXIoc2hhZGVyVHlwZSk7CisgICAgICAgICAgICBpZiAoc2hhZGVyICE9IDApIHsKKyAgICAgICAgICAgICAgICBHTEVTMjAuZ2xTaGFkZXJTb3VyY2Uoc2hhZGVyLCBzb3VyY2UpOworICAgICAgICAgICAgICAgIEdMRVMyMC5nbENvbXBpbGVTaGFkZXIoc2hhZGVyKTsKKyAgICAgICAgICAgICAgICBpbnRbXSBjb21waWxlZCA9IG5ldyBpbnRbMV07CisgICAgICAgICAgICAgICAgR0xFUzIwLmdsR2V0U2hhZGVyaXYoc2hhZGVyLCBHTEVTMjAuR0xfQ09NUElMRV9TVEFUVVMsIGNvbXBpbGVkLCAwKTsKKyAgICAgICAgICAgICAgICBpZiAoY29tcGlsZWRbMF0gPT0gMCkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJDb3VsZCBub3QgY29tcGlsZSBzaGFkZXIgIiArIHNoYWRlclR5cGUgKyAiOiIpOworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsIEdMRVMyMC5nbEdldFNoYWRlckluZm9Mb2coc2hhZGVyKSk7CisgICAgICAgICAgICAgICAgICAgIEdMRVMyMC5nbERlbGV0ZVNoYWRlcihzaGFkZXIpOworICAgICAgICAgICAgICAgICAgICBzaGFkZXIgPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBzaGFkZXI7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIGludCBjcmVhdGVQcm9ncmFtKFN0cmluZyB2ZXJ0ZXhTb3VyY2UsIFN0cmluZyBmcmFnbWVudFNvdXJjZSkgeworICAgICAgICAgICAgaW50IHZlcnRleFNoYWRlciA9IGxvYWRTaGFkZXIoR0xFUzIwLkdMX1ZFUlRFWF9TSEFERVIsIHZlcnRleFNvdXJjZSk7CisgICAgICAgICAgICBpZiAodmVydGV4U2hhZGVyID09IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50IHBpeGVsU2hhZGVyID0gbG9hZFNoYWRlcihHTEVTMjAuR0xfRlJBR01FTlRfU0hBREVSLCBmcmFnbWVudFNvdXJjZSk7CisgICAgICAgICAgICBpZiAocGl4ZWxTaGFkZXIgPT0gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQgcHJvZ3JhbSA9IEdMRVMyMC5nbENyZWF0ZVByb2dyYW0oKTsKKyAgICAgICAgICAgIGlmIChwcm9ncmFtICE9IDApIHsKKyAgICAgICAgICAgICAgICBHTEVTMjAuZ2xBdHRhY2hTaGFkZXIocHJvZ3JhbSwgdmVydGV4U2hhZGVyKTsKKyAgICAgICAgICAgICAgICBjaGVja0dsRXJyb3IoImdsQXR0YWNoU2hhZGVyIHZlcnRleFNoYWRlciIpOworICAgICAgICAgICAgICAgIEdMRVMyMC5nbEF0dGFjaFNoYWRlcihwcm9ncmFtLCBwaXhlbFNoYWRlcik7CisgICAgICAgICAgICAgICAgY2hlY2tHbEVycm9yKCJnbEF0dGFjaFNoYWRlciBwaXhlbFNoYWRlciIpOworICAgICAgICAgICAgICAgIEdMRVMyMC5nbExpbmtQcm9ncmFtKHByb2dyYW0pOworICAgICAgICAgICAgICAgIGludFtdIGxpbmtTdGF0dXMgPSBuZXcgaW50WzFdOworICAgICAgICAgICAgICAgIEdMRVMyMC5nbEdldFByb2dyYW1pdihwcm9ncmFtLCBHTEVTMjAuR0xfTElOS19TVEFUVVMsIGxpbmtTdGF0dXMsIDApOworICAgICAgICAgICAgICAgIGlmIChsaW5rU3RhdHVzWzBdICE9IEdMRVMyMC5HTF9UUlVFKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkNvdWxkIG5vdCBsaW5rIHByb2dyYW06ICIpOworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsIEdMRVMyMC5nbEdldFByb2dyYW1JbmZvTG9nKHByb2dyYW0pKTsKKyAgICAgICAgICAgICAgICAgICAgR0xFUzIwLmdsRGVsZXRlUHJvZ3JhbShwcm9ncmFtKTsKKyAgICAgICAgICAgICAgICAgICAgcHJvZ3JhbSA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHByb2dyYW07CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgY2hlY2tHbEVycm9yKFN0cmluZyBvcCkgeworICAgICAgICAgICAgaW50IGVycm9yOworICAgICAgICAgICAgd2hpbGUgKChlcnJvciA9IEdMRVMyMC5nbEdldEVycm9yKCkpICE9IEdMRVMyMC5HTF9OT19FUlJPUikgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgb3AgKyAiOiBnbEVycm9yICIgKyBlcnJvcik7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24ob3AgKyAiOiBnbEVycm9yICIgKyBlcnJvcik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBYLCBZLCBSIEcgQiBBCisgICAgICAgIHByaXZhdGUgZmluYWwgZmxvYXRbXSBtVHJpYW5nbGVWZXJ0aWNlc0RhdGEgPSB7CisgICAgICAgICAgICAgICAgLTAuMDI1ZiwgMC4zZiwgMC4wZiwgMS4wZiwgMC4wZiwgMS4wZiwKKyAgICAgICAgICAgICAgICAgMC4wZiAgLCAwLjBmLCAwLjBmLCAxLjBmLCAwLjBmLCAxLjBmLAorICAgICAgICAgICAgICAgICAwLjAyNWYsIDAuM2YsIDEuMGYsIDEuMGYsIDI1NS4wZiwgMS4wZgorICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgLy8gQ29sb3IgY2FzY2FkZToKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBmbG9hdFtdIG1Db2xvcnMgPSB7CisgICAgICAgICAgICAgICAgMC4wZiwgMC4wZiwgMC4wZiwgMS4wZiwKKyAgICAgICAgICAgICAgICAwLjVmLCAwLjBmLCAwLjBmLCAxLjBmLAorICAgICAgICAgICAgICAgIDAuMGYsIDAuNWYsIDAuMGYsIDEuMGYsCisgICAgICAgICAgICAgICAgMC41ZiwgMC41ZiwgMC4wZiwgMS4wZiwKKworICAgICAgICAgICAgICAgIDAuMGYsIDAuMGYsIDAuNWYsIDEuMGYsCisgICAgICAgICAgICAgICAgMS4wZiwgMC4wZiwgMC4wZiwgMS4wZiwKKyAgICAgICAgICAgICAgICAxLjBmLCAxLjBmLCAxLjBmLCAxLjBmLAorICAgICAgICAgICAgICAgIDAuMGYsIDEuMGYsIDAuMGYsIDEuMGYKKyAgICAgICAgfTsKKworICAgICAgICBwcml2YXRlIGZsb2F0W10gbVRyaWFuZ2xlVmVydGljZXNEYXRhMiA9IG5ldyBmbG9hdFttVHJpYW5nbGVWZXJ0aWNlc0RhdGEubGVuZ3RoXTsKKyAgICAgICAgcHJpdmF0ZSBGbG9hdEJ1ZmZlciBtVHJpYW5nbGVWZXJ0aWNlczsKKworICAgICAgICBwcml2YXRlIGZpbmFsIFN0cmluZyBtVmVydGV4U2hhZGVyID0gImF0dHJpYnV0ZSB2ZWM0IGFQb3NpdGlvbjtcbiIKKyAgICAgICAgICAgICsgImF0dHJpYnV0ZSB2ZWM0IGFDb2xvcjtcbiIKKyAgICAgICAgICAgICsgInZhcnlpbmcgdmVjNCB2Q29sb3I7XG4iCisgICAgICAgICAgICArICJ2b2lkIG1haW4oKSB7XG4iCisgICAgICAgICAgICArICIgIGdsX1Bvc2l0aW9uID0gYVBvc2l0aW9uO1xuIgorICAgICAgICAgICAgKyAiICB2Q29sb3IgPSBhQ29sb3I7XG4iCisgICAgICAgICAgICArICJ9XG4iOworCisgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nIG1GcmFnbWVudFNoYWRlciA9ICJwcmVjaXNpb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DaGFyQnVmZmVyIG1JbmRleEJ1ZmZlcjsKKworICAgICAgIHByaXZhdGUgaW50IG1XOworICAgICAgIHByaXZhdGUgaW50IG1IOworICAgICAgIHByaXZhdGUgaW50IG1JbmRleENvdW50OworCisgICAgICAgcHVibGljIEdyaWQoaW50IHcsIGludCBoKSB7CisgICAgICAgICAgIGlmICh3IDwgMCB8fCB3ID49IDY1NTM2KSB7CisgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ3Iik7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgaWYgKGggPCAwIHx8IGggPj0gNjU1MzYpIHsKKyAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImgiKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBpZiAodyAqIGggPj0gNjU1MzYpIHsKKyAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIncgKiBoID49IDY1NTM2Iik7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBtVyA9IHc7CisgICAgICAgICAgIG1IID0gaDsKKyAgICAgICAgICAgaW50IHNpemUgPSB3ICogaDsKKworICAgICAgICAgICBtVmVydGV4Qnl0ZUJ1ZmZlciA9IEJ5dGVCdWZmZXIuYWxsb2NhdGVEaXJlY3QoVkVSVEVYX1NJWkUgKiBzaXplKQorICAgICAgICAgICAgICAgLm9yZGVyKEJ5dGVPcmRlci5uYXRpdmVPcmRlcigpKTsKKyAgICAgICAgICAgbVZlcnRleEJ1ZmZlciA9IG1WZXJ0ZXhCeXRlQnVmZmVyLmFzRmxvYXRCdWZmZXIoKTsKKworICAgICAgICAgICBpbnQgcXVhZFcgPSBtVyAtIDE7CisgICAgICAgICAgIGludCBxdWFkSCA9IG1IIC0gMTsKKyAgICAgICAgICAgaW50IHF1YWRDb3VudCA9IHF1YWRXICogcXVhZEg7CisgICAgICAgICAgIGludCBpbmRleENvdW50ID0gcXVhZENvdW50ICogNjsKKyAgICAgICAgICAgbUluZGV4Q291bnQgPSBpbmRleENvdW50OworICAgICAgICAgICBtSW5kZXhCdWZmZXIgPSBCeXRlQnVmZmVyLmFsbG9jYXRlRGlyZWN0KENIQVJfU0laRSAqIGluZGV4Q291bnQpCisgICAgICAgICAgICAgICAub3JkZXIoQnl0ZU9yZGVyLm5hdGl2ZU9yZGVyKCkpLmFzQ2hhckJ1ZmZlcigpOworCisgICAgICAgICAgIC8qCisgICAgICAgICAgICAqIEluaXRpYWxpemUgdHJpYW5nbGUgbGlzdCBtZXNoLgorICAgICAgICAgICAgKgorICAgICAgICAgICAgKiAgICAgWzBdLS0tLS1bICAxXSAuLi4KKyAgICAgICAgICAgICogICAgICB8ICAgIC8gICB8CisgICAgICAgICAgICAqICAgICAgfCAgIC8gICAgfAorICAgICAgICAgICAgKiAgICAgIHwgIC8gICAgIHwKKyAgICAgICAgICAgICogICAgIFt3XS0tLS0tW3crMV0gLi4uCisgICAgICAgICAgICAqICAgICAgfCAgICAgICB8CisgICAgICAgICAgICAqCisgICAgICAgICAgICAqLworCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGludCBpID0gMDsKKyAgICAgICAgICAgICAgIGZvciAoaW50IHkgPSAwOyB5IDwgcXVhZEg7IHkrKykgeworICAgICAgICAgICAgICAgICAgIGZvciAoaW50IHggPSAwOyB4IDwgcXVhZFc7IHgrKykgeworICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGEgPSAoY2hhcikgKHkgKiBtVyArIHgpOworICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGIgPSAoY2hhcikgKHkgKiBtVyArIHggKyAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgY2hhciBjID0gKGNoYXIpICgoeSArIDEpICogbVcgKyB4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgY2hhciBkID0gKGNoYXIpICgoeSArIDEpICogbVcgKyB4ICsgMSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgbUluZGV4QnVmZmVyLnB1dChpKyssIGEpOworICAgICAgICAgICAgICAgICAgICAgICBtSW5kZXhCdWZmZXIucHV0KGkrKywgYyk7CisgICAgICAgICAgICAgICAgICAgICAgIG1JbmRleEJ1ZmZlci5wdXQoaSsrLCBiKTsKKworICAgICAgICAgICAgICAgICAgICAgICBtSW5kZXhCdWZmZXIucHV0KGkrKywgYik7CisgICAgICAgICAgICAgICAgICAgICAgIG1JbmRleEJ1ZmZlci5wdXQoaSsrLCBjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgbUluZGV4QnVmZmVyLnB1dChpKyssIGQpOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorCisgICAgICAgfQorCisgICAgICAgcHVibGljIHZvaWQgc2V0KGludCBpLCBpbnQgaiwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgICAgICAgICBpZiAoaSA8IDAgfHwgaSA+PSBtVykgeworICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiaSIpOworICAgICAgICAgICB9CisgICAgICAgICAgIGlmIChqIDwgMCB8fCBqID49IG1IKSB7CisgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJqIik7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBpbnQgaW5kZXggPSBtVyAqIGogKyBpOworCisgICAgICAgICAgIG1WZXJ0ZXhCdWZmZXIucG9zaXRpb24oaW5kZXggKiBWRVJURVhfU0laRSAvIEZMT0FUX1NJWkUpOworICAgICAgICAgICBtVmVydGV4QnVmZmVyLnB1dCh4KTsKKyAgICAgICAgICAgbVZlcnRleEJ1ZmZlci5wdXQoeSk7CisgICAgICAgICAgIG1WZXJ0ZXhCdWZmZXIucHV0KHopOworICAgICAgIH0KKworICAgICAgIHB1YmxpYyB2b2lkIGNyZWF0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U9OID0gNTc7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IERBVEFCQVNFX1ZFUlNJT04gPSA1OTsKIAogICAgIHByaXZhdGUgQ29udGV4dCBtQ29udGV4dDsKIApAQCAtNzM0LDYgKzczMSw1MCBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgdXBncmFkZVZlcnNpb24gPSA1NzsKICAgICAgICAgfQorCisgICAgICAgIGlmICh1cGdyYWRlVmVyc2lvbiA9PSA1NykgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIE5ldyBzZXR0aW5ncyB0bzoKKyAgICAgICAgICAgICAqICAxLiBFbmFibGUgaW5qZWN0aW9uIG9mIGFjY2Vzc2liaWxpdHkgc2NyaXB0cyBpbiBXZWJWaWV3cy4KKyAgICAgICAgICAgICAqICAyLiBEZWZpbmUgdGhlIGtleSBiaW5kaW5ncyBmb3IgdHJhdmVyc2luZyB3ZWIgY29udGVudCBpbiBXZWJWaWV3cy4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgZGIuYmVnaW5UcmFuc2FjdGlvbigpOworICAgICAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0bXQgPSBudWxsOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBzdG10ID0gZGIuY29tcGlsZVN0YXRlbWVudCgiSU5TRVJUIElOVE8gc2VjdXJlKG5hbWUsdmFsdWUpIgorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIFZBTFVFUyg/LD8pOyIpOworICAgICAgICAgICAgICAgIGxvYWRCb29sZWFuU2V0dGluZyhzdG10LCBTZXR0aW5ncy5TZWN1cmUuQUNDRVNTSUJJTElUWV9TQ1JJUFRfSU5KRUNUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgUi5ib29sLmRlZl9hY2Nlc3NpYmlsaXR5X3NjcmlwdF9pbmplY3Rpb24pOworICAgICAgICAgICAgICAgIHN0bXQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICBzdG10ID0gZGIuY29tcGlsZVN0YXRlbWVudCgiSU5TRVJUIElOVE8gc2VjdXJlKG5hbWUsdmFsdWUpIgorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIFZBTFVFUyg/LD8pOyIpOworICAgICAgICAgICAgICAgIGxvYWRTdHJpbmdTZXR0aW5nKHN0bXQsIFNldHRpbmdzLlNlY3VyZS5BQ0NFU1NJQklMSVRZX1dFQl9DT05URU5UX0tFWV9CSU5ESU5HUywKKyAgICAgICAgICAgICAgICAgICAgICAgIFIuc3RyaW5nLmRlZl9hY2Nlc3NpYmlsaXR5X3dlYl9jb250ZW50X2tleV9iaW5kaW5ncyk7CisgICAgICAgICAgICAgICAgZGIuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGRiLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICAgICAgaWYgKHN0bXQgIT0gbnVsbCkgc3RtdC5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdXBncmFkZVZlcnNpb24gPSA1ODsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh1cGdyYWRlVmVyc2lvbiA9PSA1OCkgeworICAgICAgICAgICAgLyogQWRkIGRlZmF1bHQgZm9yIG5ldyBBdXRvIFRpbWUgWm9uZSAqLworICAgICAgICAgICAgZGIuYmVnaW5UcmFuc2FjdGlvbigpOworICAgICAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0bXQgPSBudWxsOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBzdG10ID0gZGIuY29tcGlsZVN0YXRlbWVudCgiSU5TRVJUIElOVE8gc2VjdXJlKG5hbWUsdmFsdWUpIgorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIFZBTFVFUyg/LD8pOyIpOworICAgICAgICAgICAgICAgIGxvYWRCb29sZWFuU2V0dGluZyhzdG10LCBTZXR0aW5ncy5TeXN0ZW0uQVVUT19USU1FX1pPTkUsCisgICAgICAgICAgICAgICAgICAgICAgICBSLmJvb2wuZGVmX2F1dG9fdGltZV96b25lKTsgLy8gU3luYyB0aW1lem9uZSB0byBOSVRaCisgICAgICAgICAgICAgICAgZGIuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGRiLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICAgICAgaWYgKHN0bXQgIT0gbnVsbCkgc3RtdC5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdXBncmFkZVZlcnNpb24gPSA1OTsKKyAgICAgICAgfQorCiAgICAgICAgIC8vICoqKiBSZW1lbWJlciB0byB1cGRhdGUgREFUQUJBU0VfVkVSU0lPTiBhYm92ZSEKIAogICAgICAgICBpZiAodXBncmFkZVZlcnNpb24gIT0gY3VycmVudFZlcnNpb24pIHsKQEAgLTg3Niw3ICs5MTcsNyBAQAogICAgICAgICAgICAgICAgIFN0cmluZyBjbHMgPSBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgImNsYXNzIik7CiAgICAgICAgICAgICAgICAgU3RyaW5nIHNob3J0Y3V0U3RyID0gcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJzaG9ydGN1dCIpOwogCi0gICAgICAgICAgICAgICAgaW50IHNob3J0Y3V0VmFsdWUgPSAoaW50KSBzaG9ydGN1dFN0ci5jaGFyQXQoMCk7CisgICAgICAgICAgICAgICAgaW50IHNob3J0Y3V0VmFsdWUgPSBzaG9ydGN1dFN0ci5jaGFyQXQoMCk7CiAgICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHNob3J0Y3V0U3RyKSkgewogICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJVbmFibGUgdG8gZ2V0IHNob3J0Y3V0IGZvcjogIiArIHBrZyArICIvIiArIGNscyk7CiAgICAgICAgICAgICAgICAgfQpAQCAtMTA0NCw3ICsxMDg1LDEwIEBACiAgICAgCiAgICAgICAgICAgICBsb2FkQm9vbGVhblNldHRpbmcoc3RtdCwgU2V0dGluZ3MuU3lzdGVtLkFVVE9fVElNRSwKICAgICAgICAgICAgICAgICAgICAgUi5ib29sLmRlZl9hdXRvX3RpbWUpOyAvLyBTeW5jIHRpbWUgdG8gTklUWgotICAgIAorCisgICAgICAgICAgICBsb2FkQm9vbGVhblNldHRpbmcoc3RtdCwgU2V0dGluZ3MuU3lzdGVtLkFVVE9fVElNRV9aT05FLAorICAgICAgICAgICAgICAgICAgICBSLmJvb2wuZGVmX2F1dG9fdGltZV96b25lKTsgLy8gU3luYyB0aW1lem9uZSB0byBOSVRaCisKICAgICAgICAgICAgIGxvYWRJbnRlZ2VyU2V0dGluZyhzdG10LCBTZXR0aW5ncy5TeXN0ZW0uU0NSRUVOX0JSSUdIVE5FU1MsCiAgICAgICAgICAgICAgICAgICAgIFIuaW50ZWdlci5kZWZfc2NyZWVuX2JyaWdodG5lc3MpOwogICAgIApAQCAtMTA2OCw2ICsxMTEyLDkgQEAKICAgICAKICAgICAgICAgICAgIGxvYWRCb29sZWFuU2V0dGluZyhzdG10LCBTZXR0aW5ncy5TeXN0ZW0uVklCUkFURV9JTl9TSUxFTlQsCiAgICAgICAgICAgICAgICAgICAgIFIuYm9vbC5kZWZfdmlicmF0ZV9pbl9zaWxlbnQpOworCisgICAgICAgICAgICBsb2FkQm9vbGVhblNldHRpbmcoc3RtdCwgU2V0dGluZ3MuU3lzdGVtLlVTRV9QVFBfSU5URVJGQUNFLAorICAgICAgICAgICAgICAgICAgICBSLmJvb2wuZGVmX3VzZV9wdHBfaW50ZXJmYWNlKTsKICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIGlmIChzdG10ICE9IG51bGwpIHN0bXQuY2xvc2UoKTsKICAgICAgICAgfQpAQCAtMTE4NCw2ICsxMjMxLDEyIEBACiA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BzdHJpbmcvc3RhdHVzX2Jhcl9jbGVhcl9hbGxfYnV0dG9uIgorICAgICAgICAgICAgICAgIC8+CisKKyAgICAgICAgICAgIDxUZXh0VmlldyBhbmRyb2lkOmlkPSJAK2lkL2RvX25vdF9kaXN0dXJiIgorICAgICAgICAgICAgICAgIHN0eWxlPSI/YW5kcm9pZDphdHRyL3RleHRBcHBlYXJhbmNlIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfZ3Jhdml0eT0icmlnaHR8Y2VudGVyX3ZlcnRpY2FsIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X21hcmdpblRvcD0iMmRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5Cb3R0b209IjFkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luUmlnaHQ9IjEwZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6cGFkZGluZz0iNmRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHRTaXplPSIxNHNwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6dGV4dD0iQHN0cmluZy9zdGF0dXNfYmFyX2RvX25vdF9kaXN0dXJiX2J1dHRvbiIKKyAgICAgICAgICAgICAgICAvPgorCisgICAgICAgIDwvTGluZWFyTGF5b3V0PgorCisgICAgICAgIDxjb20uYW5kcm9pZC5zeXN0ZW11aS5zdGF0dXNiYXIudGFibGV0Lk5vdGlmaWNhdGlvbkljb25BcmVhCisgICAgICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL25vdGlmaWNhdGlvbkljb25zIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfdG9MZWZ0T2Y9IkAraWQvbm90aWZpY2F0aW9uVHJpZ2dlciIKKyAgICAgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0iY2VudGVyX3ZlcnRpY2FsIgorICAgICAgICAgICAgYW5kcm9pZDpvcmllbnRhdGlvbj0iaG9yaXpvbnRhbCIKKyAgICAgICAgICAgID4KKyAgICAgICAgICAgIDxjb20uYW5kcm9pZC5zeXN0ZW11aS5zdGF0dXNiYXIudGFibGV0LklucHV0TWV0aG9kQnV0dG9uCisgICAgICAgICAgICAgICAgYW5kcm9pZDppZD0iQCtpZC9pbWVCdXR0b24iCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5MZWZ0PSI4ZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6c3JjPSJAZHJhd2FibGUvaWNfc3lzYmFyX2ltZV9kZWZhdWx0IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6YmFja2dyb3VuZD0iQGRyYXdhYmxlL2ljX3N5c2Jhcl9pY29uX2JnIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6dmlzaWJpbGl0eT0iaW52aXNpYmxlIgorICAgICAgICAgICAgICAgIC8+CisgICAgICAgICAgICA8dmlldworICAgICAgICAgICAgICAgIGNsYXNzPSJjb20uYW5kcm9pZC5zeXN0ZW11aS5zdGF0dXNiYXIudGFibGV0Lk5vdGlmaWNhdGlvbkljb25BcmVhJEljb25MYXlvdXQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDppZD0i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GNoX3BhcmVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2NlbnRlckluUGFyZW50PSJ0cnVlIgorICAgICAgICAgICAgLz4KKworICAgICAgICA8TGluZWFyTGF5b3V0CisgICAgICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL25hdmlnYXRpb25BcmVhIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRMZWZ0PSJ0cnVlIgorICAgICAgICAgICAgYW5kcm9pZDpvcmllbnRhdGlvbj0iaG9yaXpvbnRhbCIKKyAgICAgICAgICAgID4KKworICAgICAgICAgICAgPGNvbS5hbmRyb2lkLnN5c3RlbXVpLnN0YXR1c2Jhci5LZXlCdXR0b25WaWV3IGFuZHJvaWQ6aWQ9IkAraWQvYmFjayIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6cGFkZGluZ0xlZnQ9IjE1ZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6cGFkZGluZ1JpZ2h0PSIxNWRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnNyYz0iQGRyYXdhYmxlL2ljX3N5c2Jhcl9iYWNrIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6YmFja2dyb3VuZD0iQGRyYXdhYmxlL2ljX3N5c2Jhcl9pY29uX2JnIgorICAgICAgICAgICAgICAgIHN5c3RlbXVpOmtleUNvZGU9IjQiCisgICAgICAgICAgICAgICAgLz4KKyAgICAgICAgICAgIDxjb20uYW5kcm9pZC5zeXN0ZW11aS5zdGF0dXNiYXIuS2V5QnV0dG9uVmlldyBhbmRyb2lkOmlkPSJAK2lkL2hvbWUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnBhZGRpbmdMZWZ0PSIxNWRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnBhZGRpbmdSaWdodD0iMTVkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpzcmM9IkBkcmF3YWJsZS9pY19zeXNiYXJfaG9tZSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmJhY2tncm91bmQ9IkBkcmF3YWJsZS9pY19zeXNiYXJfaWNvbl9iZyIKKyAgICAgICAgICAgICAgICBzeXN0ZW11aTprZXlDb2RlPSIzIgorICAgICAgICAgICAgICAgIC8+CisgICAgICAgICAgICA8SW1hZ2VCdXR0b24gYW5kcm9pZDppZD0iQCtpZC9yZWNlbnRfYXBwcyIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0ibWF0Y2hfcGFyZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6c3JjPSJAZHJhd2FibGUvaWNfc3lzYmFyX3JlY2VudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmJhY2tncm91bmQ9IkBkcmF3YWJsZS9pY19zeXNiYXJfaWNvbl9iZyIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnBhZGRpbmdMZWZ0PSIxNWRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnBhZGRpbmdSaWdodD0iMTVkaXAiCisgICAgICAgICAgICAgICAgLz4KKyAgICAgICAgICAgIDxjb20uYW5kcm9pZC5zeXN0ZW11aS5zdGF0dXNiYXIuS2V5QnV0dG9uVmlldyBhbmRyb2lkOmlkPSJAK2lkL21lbnUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnBhZGRpbmdMZWZ0PSIxNWRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnBhZGRpbmdSaWdodD0iMTVkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpzcmM9IkBkcmF3YWJsZS9pY19zeXNiYXJfbWVudSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmJhY2tncm91bmQ9IkBkcmF3YWJsZS9pY19zeXNiYXJfaWNvbl9iZyIKKyAgICAgICAgICAgICAgICBzeXN0ZW11aTprZXlDb2RlPSI4MiIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnZpc2liaWxpdHk9ImludmlzaWJsZSIKKyAgICAgICAgICAgICAgICAvPgorICAgICAgICAgICAgPGNvbS5hbmRyb2lkLnN5c3RlbXVpLnN0YXR1c2Jhci50YWJsZXQuU2hpcnRQb2NrZXQKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL3BvY2tldCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iNzFkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJtYXRjaF9wYXJlbnQiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpiYWNrZ3JvdW5kPSJAZHJhd2FibGUvaWNfc3lzYmFyX2ljb25fYmciCisgICAgICAgICAgICAgICAgYW5kcm9pZDpwYWRkaW5nTGVmdD0iMTVkaXAiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpwYWRkaW5nUmlnaHQ9IjE1ZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6YW5pbWF0ZUxheW91dENoYW5nZXM9InRydWUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpjbGlja2FibGU9InRydWUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpkZXNjZW5kYW50Rm9jdXNhYmlsaXR5PSJibG9ja3NEZXNjZW5kYW50cyIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmdyYXZpdHk9ImNlbnRlciIKKyAgICAgICAgICAgICAgICA+CisgICAgICAgICAgICAgICAgPEltYWdlVmlldyAKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDppZD0iQCtpZC9wb2NrZXRfaWNvbiIKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDpzcmM9IkBkcmF3YWJsZS9pY19zeXNiYXJfcG9ja2V0IgorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOnZpc2liaWxpdHk9ImludmlzaWJsZSIKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0iY2VudGVyIgorICAgICAgICAgICAgICAgICAgICAvPgorICAgICAgICAgICAgPC9jb20uYW5kcm9pZC5zeXN0ZW11aS5zdGF0dXNiYXIudGFibGV0LlNoaXJ0UG9ja2V0PgorICAgICAgICA8L0xpbmVhckxheW91dD4KKyAgICA8L1JlbGF0aXZlTGF5b3V0PgorCisgICAgPCEtLSBJdCdzIGN1cnRhaW5zIGZvciB5b3UuIC0tPgorICAgIDxJbWFnZVZpZXcKKyAgICAgICAgYW5kcm9pZDppZD0iQCtpZC9saWdodHNfb3V0IgorICAgICAgICBhbmRyb2lkOnNyYz0iQGRyYXdhYmxlL2ljX3N5c2Jhcl9saWdodHN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3JhcF9jb250ZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOnNpbmdsZUxpbmU9InRydWUiCisgICAgICAgICAgICBhbmRyb2lkOnRleHRTaXplPSI1MHNwIgorICAgICAgICAgICAgYW5kcm9pZDp0ZXh0U3R5bGU9Im5vcm1hbCIKKyAgICAgICAgICAgIGFuZHJvaWQ6dGV4dENvbG9yPSIjRkZGRkZGRkYiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9jZW50ZXJIb3Jpem9udGFsPSJ0cnVlIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRCb3R0b209InRydWUiCisgICAgICAgICAgICAvPgorCisgICAgICAgIDxSZWxhdGl2ZUxheW91dAorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IjI1NmRpcCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0iMTkyZGlwIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRSaWdodD0idHJ1ZSIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X21hcmdpblJpZ2h0PSI0OGRpcCIKKyAgICAgICAgICAgID4KKyAgICAgICAgICAgIDxJbWFnZVZpZXcgYW5kcm9pZDppZD0iQCtpZC9zaWduYWxfbWV0ZXIiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IjI1NmRpcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9hbGlnblBhcmVudEJvdHRvbT0idHJ1ZSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnNjYWxlVHlwZT0iY2VudGVyQ3JvcCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOnNyYz0iQGRyYXdhYmxlL3N5c2Jhcl9zaWduYWwiCisgICAgICAgICAgICAgICAgLz4KKworICAgICAgICAgICAgPFRleHRWaWV3IGFuZHJvaWQ6aWQ9IkAraWQvc2lnbmFsX2luZm8iCisgICAgICAgICAgICAgICAgc3R5bGU9IkBzdHlsZS9UZXh0QXBwZWFyYW5jZS5TdGF0dXNCYXIuU3lzdGVtUGFuZWwiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9Im1hdGNoX3BhcmVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IjI0ZGlwIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0iY2VudGVyIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2Fib3ZlPSJAaWQvc2lnbmFsX21ldGVyIgorICAgICAgICAgICAgICAgIC8+CisgICAgICAgIDwvUmVsYXRpdmVMYXlvdXQ+CisKKyAgICAgICAgPEltYWdlVmlldworICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRMZWZ0PSJ0cnVlIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRCb3R0b209InRydWUiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5Cb3R0b209IjhkaXAiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5MZWZ0PSI4ZGlwIgorICAgICAgICAgICAgYW5kcm9pZDpzcmM9IkBkcmF3YWJsZS9pY19zeXNiYXJfYmF0dGVyeV9vbiIKKyAgICAgICAgICAgIC8+CisgICAgICAgIDxJbWFnZVZpZXcKKyAgICAgICA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aGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9hbGlnblBhcmVudExlZnQ9InRydWUiCisgICAgICAgICAgICBhbmRyb2lkOm9yaWVudGF0aW9uPSJob3Jpem9udGFsIgorICAgICAgICAgICAgPgorICAgICAgICAgICAgPCEtLSBUT0RPOiBhbGFybSAtLT4KKyAgICAgICAgICAgIDwhLS0gVE9ETzogc3luYyAtLT4KKyAgICAgICAgICAgIDxUZXh0VmlldyBhbmRyb2lkOmlkPSJAK2lkL2RhdGUiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICAvPgorICAgICAgICA8L0xpbmVhckxheW91dD4KKworICAgICAgICA8VGV4dFZpZXcgYW5kcm9pZDppZD0iQCtpZC9zZXR0aW5nc19idXR0b24iCisgICAgICAgICAgICBzdHlsZT0iQHN0eWxlL1RleHRBcHBlYXJhbmNlLlN0YXR1c0Jhci5UZXh0QnV0dG9uIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRSaWdodD0idHJ1ZSIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2NlbnRlclZlcnRpY2FsPSJ0cnVlIgorICAgICAgICAgICAgYW5kcm9pZDpwYWRkaW5nUmlnaHQ9IjMyZGlwIgorICAgICAgICAgICAgYW5kcm9pZDpwYWRkaW5nTGVmdD0iMzJkaXAiCisgICAgICAgICAgICBhbmRyb2lkOnRleHRTaXplPSIyMHNwIgorICAgICAgICAgICAgYW5kcm9pZDp0ZX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N5c3RlbVVJU2VydmljZSI7CisKKyAgICAvKioKKyAgICAgKiBUaGUgY2xhc3MgbmFtZXMgb2YgdGhlIHN0dWZmIHRvIHN0YXJ0LgorICAgICAqLworICAgIGZpbmFsIE9iamVjdFtdIFNFUlZJQ0VTID0gbmV3IE9iamVjdFtdIHsKKyAgICAgICAgICAgIFIuc3RyaW5nLmNvbmZpZ19zdGF0dXNCYXJDb21wb25lbnQsCisgICAgICAgICAgICBjb20uYW5kcm9pZC5zeXN0ZW11aS5wb3dlci5Qb3dlclVJLmNsYXNzLAorICAgICAgICB9OworCisgICAgLyoqCisgICAgICogSG9sZCBhIHJlZmVyZW5jZSBvbiB0aGUgc3R1ZmYgd2Ugc3RhcnQuCisgICAgICovCisgICAgU3lzdGVtVUlbXSBtU2VydmljZXM7CisKKyAgICBwcml2YXRlIENsYXNzIGNob29zZUNsYXNzKE9iamVjdCBvKSB7CisgICAgICAgIGlmIChvIGluc3RhbmNlb2YgSW50ZWdlcikgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIGNsID0gZ2V0U3RyaW5nKChJbnRlZ2VyKW8pOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZ2V0Q2xhc3NMb2FkZXIoKS5sb2FkQ2xhc3MoY2wpOworICAgICAgICAgICAgfSBjYXRjaCAoQ2xhc3NOb3RGb3VuZEV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKGV4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChvIGluc3RhbmNlb2YgQ2xhc3MpIHsKKyAgICAgICAgICAgIHJldHVybiAoQ2xhc3MpbzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJVbmtub3duIHN5c3RlbSB1aSBzZXJ2aWNlOiAiICsgbyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvbkNyZWF0ZSgpIHsKKyAgICAgICAgZmluYWwgaW50IE4gPSBTRVJWSUNFUy5sZW5ndGg7CisgICAgICAgIG1TZXJ2aWNlcyA9IG5ldyBTeXN0ZW1VSVtOXTsKKyAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgQ2xhc3MgY2wgPSBjaG9vc2VDbGFzcyhTRVJWSUNFU1tpXSk7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAibG9hZGluZzogIiArIGNsKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbVNlcnZpY2VzW2ldID0gKFN5c3RlbVVJKWNsLm5ld0luc3RhbmNlKCk7CisgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQWNjZXNzRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oZXgpOworICAgICAgICAgICAgfSBjYXRjaCAoSW5zdGFudGlhdGlvbkV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKGV4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1TZXJ2aWNlc1tpXS5tQ29udGV4dCA9IHRoaXM7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAicnVubmluZzogIiArIG1TZXJ2aWNlc1tpXSk7CisgICAgICAgICAgICBtU2VydmljZXNbaV0uc3RhcnQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIE5vYm9keSBiaW5kcyB0byB1cy4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgSUJpbmRlciBvbkJpbmQoSW50ZW50IGludGVudCkgeworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBkdW1wKEZpbGVEZXNjcmlwdG9yIGZkLCBQcmludFdyaXRlciBwdywgU3RyaW5nW10gYXJncykgeworICAgICAgICBpZiAoY2hlY2tDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24uRFVNUCkKKyAgICAgICAgICAgICAgICAhPSBQYWNrYWdlTWFuYWdlci5QRVJNSVNTSU9OX0dSQU5URUQpIHsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIlBlcm1pc3Npb24gRGVuaWFsOiBjYW4ndCBkdW1wIFN0YXR1c0JhciBmcm9tIGZyb20gcGlkPSIKKyAgICAgICAgICAgICAgICAgICAgKyBCaW5kZXIuZ2V0Q2FsbGluZ1BpZCgpCisgICAgICAgICAgICAgICAgICAgICsgIiwgdWlkPSIgKyBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChhcmdzID09IG51bGwgfHwgYXJncy5sZW5ndGggPT0gMCkgeworICAgICAgICAgICAgZm9yIChTeXN0ZW1VSSB1aTogbVNlcnZpY2VzKSB7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiZHVtcGluZyBzZXJ2aWNlOiAiICsgdWkuZ2V0Q2xhc3MoKS5nZXROYW1lKCkpOworICAgICAgICAgICAgICAgIHVpLmR1bXAoZmQsIHB3LCBhcmdzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIFN0cmluZyBzdmMgPSBhcmdzWzBdOworICAgICAgICAgICAgZm9yIChTeXN0ZW1VSSB1aTogbVNlcnZpY2VzKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSB1aS5nZXRDbGFzcygpLmdldE5hbWUoKTsKKyAgICAgICAgICAgICAgICBpZiAobmFtZS5lbmRzV2l0aChzdmMpKSB7Cisg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KKyAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHBsdWdnZWQgPSBtUGx1Z1R5cGUgIT0gMDsKKyAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIG9sZFBsdWdnZWQgPSBvbGRQbHVnVHlwZSAhPSAwOworCisgICAgICAgICAgICAgICAgaW50IG9sZEJ1Y2tldCA9IGZpbmRCYXR0ZXJ5TGV2ZWxCdWNrZXQob2xkQmF0dGVyeUxldmVsKTsKKyAgICAgICAgICAgICAgICBpbnQgYnVja2V0ID0gZmluZEJhdHRlcnlMZXZlbEJ1Y2tldChtQmF0dGVyeUxldmVsKTsKKworICAgICAgICAgICAgICAgIGlmIChmYWxzZSkgeworICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiYnVja2V0cyAgIC4uLi4uIiArIG1Mb3dCYXR0ZXJ5QWxlcnRDbG9zZUxldmVsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIC4uICIgKyBtTG93QmF0dGVyeVJlbWluZGVyTGV2ZWxzWzBdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIC4uICIgKyBtTG93QmF0dGVyeVJlbWluZGVyTGV2ZWxzWzFdKTsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImxldmVsICAgICAgICAgICIgKyBvbGRCYXR0ZXJ5TGV2ZWwgKyAiIC0tPiAiICsgbUJhdHRlcnlMZXZlbCk7CisgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJzdGF0dXMgICAgICAgICAiICsgb2xkQmF0dGVyeVN0YXR1cyArICIgLS0+ICIgKyBtQmF0dGVyeVN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJwbHVnVHlwZSAgICAgICAiICsgb2xkUGx1Z1R5cGUgKyAiIC0tPiAiICsgbVBsdWdUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImludmFsaWRDaGFyZ2VyICIgKyBvbGRJbnZhbGlkQ2hhcmdlciArICIgLS0+ICIgKyBtSW52YWxpZENoYXJnZXIpOworICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiYnVja2V0ICAgICAgICAgIiArIG9sZEJ1Y2tldCArICIgLS0+ICIgKyBidWNrZXQpOworICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAicGx1Z2dlZCAgICAgICAgIiArIG9sZFBsdWdnZWQgKyAiIC0tPiAiICsgcGx1Z2dlZCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKG9sZEludmFsaWRDaGFyZ2VyID09IDAgJiYgbUludmFsaWRDaGFyZ2VyICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgInNob3dpbmcgaW52YWxpZCBjaGFyZ2VyIHdhcm5pbmciKTsKKyAgICAgICAgICAgICAgICAgICAgc2hvd0ludmFsaWRDaGFyZ2VyRGlhbG9nKCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9sZEludmFsaWRDaGFyZ2VyICE9IDAgJiYgbUludmFsaWRDaGFyZ2VyID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImNsb3NpbmcgaW52YWxpZCBjaGFyZ2VyIHdhcm5pbmciKTsKKyAgICAgICAgICAgICAgICAgICAgZGlzbWlzc0ludmFsaWRDaGFyZ2VyRGlhbG9nKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtSW52YWxpZENoYXJnZXJEaWFsb2cgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAvLyBpZiBpbnZhbGlkIGNoYXJnZXIgaXMgc2hvd2luZywgZG9uJ3Qgc2hvdyBsb3cgYmF0dGVyeQorICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKCFwbHVnZ2VkCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoYnVja2V0IDwgb2xkQnVja2V0IHx8IG9sZFBsdWdnZWQpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBtQmF0dGVyeVN0YXR1cyAhPSBCYXR0ZXJ5TWFuYWdlci5CQVRURVJZX1NUQVRVU19VTktOT1dOCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBidWNrZXQgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJzaG93aW5nIGxvdyBiYXR0ZXJ5IHdhcm5pbmc6IGxldmVsPSIgKyBtQmF0dGVyeUxldmVsKTsKKyAgICAgICAgICAgICAgICAgICAgc2hvd0xvd0JhdHRlcnlXYXJuaW5nKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwbHVnZ2VkIHx8IChidWNrZXQgPiBvbGRCdWNrZXQgJiYgYnVja2V0ID4gMCkpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImNsb3NpbmcgbG93IGJhdHRlcnkgd2FybmluZzogbGV2ZWw9IiArIG1CYXR0ZXJ5TGV2ZWwpOworICAgICAgICAgICAgICAgICAgICBkaXNtaXNzTG93QmF0dGVyeVdhcm5pbmcoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1CYXR0ZXJ5TGV2ZWxUZXh0VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHNob3dMb3dCYXR0ZXJ5V2FybmluZygpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInVua25vd24gaW50ZW50OiAiICsgaW50ZW50KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisKKyAgICB2b2lkIGRpc21pc3NMb3dCYXR0ZXJ5V2FybmluZygpIHsKKyAgICAgICAgaWYgKG1Mb3dCYXR0ZXJ5RGlhbG9nICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1Mb3dCYXR0ZXJ5RGlhbG9nLmRpc21pc3MoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHZvaWQgc2hvd0xvd0JhdHRlcnlXYXJuaW5nKCkgeworICAgICAgICBDaGFyU2VxdWVuY2UgbGV2ZWxUZXh0ID0gbUNvbnRleHQuZ2V0U3RyaW5nKAorICAgICAgICAgICAgICAgIFIuc3RyaW5nLmJhdHRlcnlfbG93X3BlcmNlbnRfZm9ybWF0LCBtQmF0dGVyeUxldmVsKTsKKworICAgICAgICBpZiAobUJhdHRlcnlMZXZlbFRleHRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1CYXR0ZXJ5TGV2ZWxUZXh0Vmlldy5zZXRUZXh0KGxldmVsVGV4dCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBWaWV3IHYgPSBWaWV3LmluZmxhdGUobUNvbnRleHQsIFIubGF5b3V0LmJhdHRlcnlfbG93LCBudWxsKTsKKyAgICAgICAgICAgIG1CYXR0ZXJ5TGV2ZWxUZXh0VmlldyA9IChUZXh0Vmlldyl2LmZpbmRWaWV3QnlJZChSLmlkLmxldmVsX3BlcmNlbnQpOworCisgICAgICAgICAgICBtQmF0dGVyeUxldmVsVGV4dFZpZXcuc2V0VGV4dChsZXZlbFRleHQpOworCisgICAgICAgICAgICBBbGVydERpYWxvZy5CdWlsZGVyIGIgPSBuZXcgQWxlcnREaWFsb2cuQnVpbGRlcihtQ29udGV4dCk7CisgICAgICAgICAgICAgICAgYi5zZXRDYW5jZWxhYmxlKHRydWUpOworICAgICAgICAgICAgICAgIGIuc2V0VGl0bGUoUi5zdHJpbmcuYmF0dGVyeV9sb3dfdGl0bGUpOworICAgICAgICAgICAgICAgIGIuc2V0Vmlldyh2KTsKKyAgICAgICAgICAgICAgICBiLnNldEljb24oYW5kcm9pZC5SLmRyYXdhYmxlLmljX2RpYWxvZ19hbGVydCk7CisgICAgICAgICAgICAgICAgYi5zZXRQb3NpdGl2ZUJ1dHRvbihhbmRyb2lkLlIuc3RyaW5nLm9rLCBudWxsKTsKKworICAgICAgICAgICAgZmluYWwgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9QT1dFUl9VU0FHRV9TVU1NQVJZKTsKKyAgICAgICAgICAgIGludGVudC5zZXRGbGFncyhJbnRlbnQuRkxBR19BQ1RJVklUWV9ORVdfVEFTSworICAgICAgICAgICAgICAgICAgICB8IEludGVudC5GTEFHX0FDVElWSVRZX01VTFRJUExFX1RBU0sKKyAgICAgICAgICAgICAgICAgICAgfCBJbnRlbnQuRkxBR19BQ1RJVklUWV9FWENMVURFX0ZST01fUkVDRU5UUworICAgICAgICAgICAgICAgICAgICB8IEludGVudC5GTEFHX0FDVElWSVRZX05PX0hJU1RPUlkpOworICAgICAgICAgICAgaWYgKGludGVudC5yZXNvbHZlQWN0aXZpdHkobUNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKSkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGIuc2V0TmVnYXRpdmVCdXR0b24oUi5zdHJpbmcuYmF0dGVyeV9sb3dfd2h5LAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soRGlhbG9nSW50ZXJmYWNlIGRpYWxvZywgaW50IHdoaWNoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5zdGFydEFjdGl2aXR5KGludGVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUxvd0JhdHRlcnlEaWFsb2cgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Mb3dCYXR0ZXJ5RGlhbG9nLmRpc21pc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBBbGVydERpYWxvZyBkID0gYi5jcmVhdGUoKTsKKyAgICAgICAgICAgIGQuc2V0T25EaXNtaXNzTGlzdGVuZXIobmV3IERpYWxvZ0ludGVyZmFjZS5PbkRpc21pc3NMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25EaXNtaXNzKERpYWxvZ0ludGVyZmFjZSBkaWFsb2cpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Mb3dCYXR0ZXJ5RGlhbG9nID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1CYXR0ZXJ5TGV2ZWxUZXh0VmlldyA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGQuZ2V0V2luZG93KCkuc2V0VHlwZShXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5UWVBFX1NZU1RFTV9BTEVSVCk7CisgICAgICAgICAgICBkLnNob3coKTsKKyAgICAgICAgICAgIG1Mb3dCYXR0ZXJ5RGlhbG9nID0gZDsKKyAgICAgICAgfQorCitpZiAoZmFsc2UpIHsgLy8gZ2V0UmluZ3RvbmUgQU5ScworICAgICAgICBmaW5hbCBDb250ZW50UmVzb2x2ZXIgY3IgPSBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKTsKKyAgICAgICAgaWYgKFNldHRpbmdzLlN5c3RlbS5nZXRJbnQoY3IsIFNldHRpbmdzLlN5c3RlbS5QT1dFUl9TT1VORFNfRU5BQkxFRCwgMSkgPT0gMSkgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIHNvdW5kUGF0aCA9IFNldHRpbmdzLlN5c3RlbS5nZXRTdHJpbmcoY3IsCisgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlN5c3RlbS5MT1dfQkFUVEVSWV9TT1VORCk7CisgICAgICAgICAgICBpZiAoc291bmRQYXRoICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBVcmkgc291bmRVcmkgPSBVcmkucGFyc2UoImZpbGU6Ly8iICsgc291bmRQYXRoKTsKKyAgICAgICAgICAgICAgICBpZiAoc291bmRVcmkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBSaW5ndG9uZSBzZnggPSBSaW5ndG9uZU1hbmFnZXIuZ2V0UmluZ3RvbmUobUNvbnRleHQsIHNvdW5kVXJpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNmeCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZnguc2V0U3RyZWFtVHlwZShBdWRpb01hbmFnZXIuU1RSRUFNX1NZU1RFTSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZngucGxheSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9Cit9CisgICAgfQorCisgICAgdm9pZCBkaXNtaXNzSW52YWxpZENoYXJnZXJEaWFsb2coKSB7CisgICAgICAgIGlmIChtSW52YWxpZENoYXJnZXJEaWFsb2cgIT0gbnVsbCkgeworICAgICAgICAgICAgbUludmFsaWRDaGFyZ2VyRGlhbG9nLmRpc21pc3MoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHZvaWQgc2hvd0ludmFsaWRDaGFyZ2VyRGlhbG9nKCkgeworICAgICAgICBkaXNtaXNzTG93QmF0dGVyeVdhcm5pbmcoKTsKKworICAgICAgICBBbGVydERpYWxvZy5CdWlsZGVyIGIgPSBuZXcgQWxlcnREaWFsb2cuQnVpbGRlcihtQ29udGV4dCk7CisgICAgICAgICAgICBiLnNldENhbmNlbGFibGUodHJ1ZSk7CisgICAgICAgICAgICBiLnNldE1lc3NhZ2UoUi5zdHJpbmcuaW52YWxpZF9jaGFyZ2VyKTsKKyAgICAgICAgICAgIGIuc2V0SWNvbihhbmRyb2lkLlIuZHJhd2FibGUuaWNfZGlhbG9nX2FsZXJ0KTsKKyAgICAgICAgICAgIGIuc2V0UG9zaXRpdmVCdXR0b24oYW5kcm9pZC5SLnN0cmluZy5vaywgbnVsbCk7CisKKyAgICAgICAgQWxlcnREaWFsb2cgZCA9IGIuY3JlYXRlKCk7CisgICAgICAgICAgICBkLnNldE9uRGlzbWlzc0xpc3RlbmVyKG5ldyBEaWFsb2dJbnRlcmZhY2UuT25EaXNtaXNzTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uRGlzbWlzcyhEaWFsb2dJbnRlcmZhY2UgZGlhbG9nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtSW52YWxpZENoYXJnZXJEaWFsb2cgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgbUJhdHRlcnlMZXZlbFRleHRWaWV3ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgIGQuZ2V0V2luZG93KCkuc2V0VHlwZShXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5UWVBFX1NZU1RFTV9BTEVSVCk7CisgICAgICAgIGQuc2hvdygpOworICAgICAgICBtSW52YWxpZENoYXJnZXJEaWFsb2cgPSBkOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBkdW1wKEZpbGVEZXNjcmlwdG9yIGZkLCBQcmludFdyaXRlciBwdywgU3RyaW5nW10gYXJncykgeworICAgICAgICBwdy5wcmludCgibUxvd0JhdHRlcnlBbGVydENsb3NlTGV2ZWw9Iik7CisgICAgICAgIHB3LnByaW50bG4obUxvd0JhdHRlcnlBbGVydENsb3NlTGV2ZWwpOworICAgICAgICBwdy5wcmludCgibUxvd0JhdHRlcnlSZW1pbmRlckxldmVscz0iKTsKKyAgICAgICAgcHcucHJpbnRsbihBcnJheXMudG9TdHJpbmcobUxvd0JhdHRlcnlSZW1pbmRlckxldmVscykp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bUNhcm91c2VsVmlldzsKKyAgICBwcml2YXRlIExvY2FsQ2Fyb3VzZWxWaWV3SGVscGVyIG1IZWxwZXI7CisgICAgcHJpdmF0ZSBWaWV3IG1Ob1JlY2VudHNWaWV3OworICAgIHByaXZhdGUgQml0bWFwIG1Mb2FkaW5nQml0bWFwOworICAgIHByaXZhdGUgQml0bWFwIG1SZWNlbnRPdmVybGF5OworICAgIHByaXZhdGUgYm9vbGVhbiBtSGlkZGVuID0gZmFsc2U7CisgICAgcHJpdmF0ZSBib29sZWFuIG1IaWRpbmcgPSBmYWxzZTsKKyAgICBwcml2YXRlIERldGFpbEluZm8gbURldGFpbEluZm87CisKKyAgICAvKioKKyAgICAgKiBUaGlzIGNsYXNzIGlzIGEgY29udGFpbmVyIGZvciBhbGwgaXRlbXMgYXNzb2NpYXRlZCB3aXRoIHRoZSBEZXRhaWxWaWV3IHdlJ2xsCisgICAgICogYmUgZHJhd2luZyB0byBhIGJpdG1hcCBhbmQgc2VuZGluZyB0byBDYXJvdXNlbC4KKyAgICAgKgorICAgICAqLworICAgIHN0YXRpYyBmaW5hbCBjbGFzcyBEZXRhaWxJbmZvIHsKKyAgICAgICAgcHVibGljIERldGFpbEluZm8oVmlldyBfdmlldywgVGV4dFZpZXcgX3RpdGxlLCBUZXh0VmlldyBfZGVzYykgeworICAgICAgICAgICAgdmlldyA9IF92aWV3OworICAgICAgICAgICAgdGl0bGUgPSBfdGl0bGU7CisgICAgICAgICAgICBkZXNjcmlwdGlvbiA9IF9kZXNjOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIERyYXdzIHZpZXcgaW50byB0aGUgZ2l2ZW4gYml0bWFwLCBpZiBwcm92aWRlZAorICAgICAgICAgKiBAcGFyYW0gYml0bWFwCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgQml0bWFwIGRyYXcoQml0bWFwIGJpdG1hcCkgeworICAgICAgICAgICAgcmVzaXplVmlldyh2aWV3LCBERVRBSUxfVEVYVFVSRV9NQVhfV0lEVEgsIERFVEFJTF9URVhUVVJFX01BWF9IRUlHSFQpOworICAgICAgICAgICAgaW50IGRlc2lyZWRXaWR0aCA9IHZpZXcuZ2V0V2lkdGgoKTsKKyAgICAgICAgICAgIGludCBkZXNpcmVkSGVpZ2h0ID0gdmlldy5nZXRIZWlnaHQoKTsKKyAgICAgICAgICAgIGlmIChiaXRtYXAgPT0gbnVsbCB8fCBkZXNpcmVkV2lkdGggIT0gYml0bWFwLmdldFdpZHRoKCkKKyAgICAgICAgICAgICAgICAgICAgfHwgZGVzaXJlZEhlaWdodCAhPSBiaXRtYXAuZ2V0SGVpZ2h0KCkpIHsKKyAgICAgICAgICAgICAgICBiaXRtYXAgPSBCaXRtYXAuY3JlYXRlQml0bWFwKGRlc2lyZWRXaWR0aCwgZGVzaXJlZEhlaWdodCwgQ29uZmlnLkFSR0JfODg4OCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBDYW52YXMgY2FudmFzID0gbmV3IENhbnZhcyhiaXRtYXApOworICAgICAgICAgICAgdmlldy5kcmF3KGNhbnZhcyk7CisgICAgICAgICAgICByZXR1cm4gYml0bWFwOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEZvcmNlIGEgbGF5b3V0IHBhc3Mgb24gdGhlIGdpdmVuIHZpZXcuCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIHZvaWQgcmVzaXplVmlldyhWaWV3IHZpZXcsIGludCBtYXhXaWR0aCwgaW50IG1heEhlaWdodCkgeworICAgICAgICAgICAgaW50IHdpZHRoU3BlYyA9IE1lYXN1cmVTcGVjLmdldE1vZGUoTWVhc3VyZVNwZWMuQVRfTU9TVCkKKyAgICAgICAgICAgICAgICAgICAgfCBNZWFzdXJlU3BlYy5nZXRTaXplKG1heFdpZHRoKTsKKyAgICAgICAgICAgIGludCBoZWlnaHRTcGVjID0gTWVhc3VyZVNwZWMuZ2V0TW9kZShNZWFzdXJlU3BlYy5BVF9NT1NUKQorICAgIC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ICAgICAgIGludCBwb3NpdGlvbjsgLy8gcG9zaXRpb24gaW4gbGlzdAorCisgICAgICAgIHB1YmxpYyBBY3Rpdml0eURlc2NyaXB0aW9uKEJpdG1hcCBfdGh1bWJuYWlsLAorICAgICAgICAgICAgICAgIERyYXdhYmxlIF9pY29uLCBTdHJpbmcgX2xhYmVsLCBTdHJpbmcgX2Rlc2MsIGludCBfaWQsIGludCBfcG9zKQorICAgICAgICB7CisgICAgICAgICAgICB0aHVtYm5haWwgPSBfdGh1bWJuYWlsOworICAgICAgICAgICAgaWNvbiA9IF9pY29uOworICAgICAgICAgICAgbGFiZWwgPSBfbGFiZWw7CisgICAgICAgICAgICBkZXNjcmlwdGlvbiA9IF9kZXNjOworICAgICAgICAgICAgaWQgPSBfaWQ7CisgICAgICAgICAgICBwb3NpdGlvbiA9IF9wb3M7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBjbGVhcigpIHsKKyAgICAgICAgICAgIGljb24gPSBudWxsOworICAgICAgICAgICAgdGh1bWJuYWlsID0gbnVsbDsKKyAgICAgICAgICAgIGxhYmVsID0gbnVsbDsKKyAgICAgICAgICAgIGRlc2NyaXB0aW9uID0gbnVsbDsKKyAgICAgICAgICAgIGludGVudCA9IG51bGw7CisgICAgICAgICAgICBtYXRyaXggPSBudWxsOworICAgICAgICAgICAgaWQgPSAtMTsKKyAgICAgICAgICAgIHBvc2l0aW9uID0gLTE7CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHJpdmF0ZSBBY3Rpdml0eURlc2NyaXB0aW9uIGZpbmRBY3Rpdml0eURlc2NyaXB0aW9uKGludCBpZCkgeworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1BY3Rpdml0eURlc2NyaXB0aW9ucy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgQWN0aXZpdHlEZXNjcmlwdGlvbiBpdGVtID0gbUFjdGl2aXR5RGVzY3JpcHRpb25zLmdldChpKTsKKyAgICAgICAgICAgIGlmIChpdGVtICE9IG51bGwgJiYgaXRlbS5pZCA9PSBpZCkgeworICAgICAgICAgICAgICAgIHJldHVybiBpdGVtOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgTG9jYWxDYXJvdXNlbFZpZXdIZWxwZXIgZXh0ZW5kcyBDYXJvdXNlbFZpZXdIZWxwZXIgeworICAgICAgICBwcml2YXRlIERldGFpbFRleHR1cmVQYXJhbWV0ZXJzIG1EZXRhaWxQYXJhbXMgPSBuZXcgRGV0YWlsVGV4dHVyZVBhcmFtZXRlcnMoMTAuMGYsIDIwLjBmKTsKKworICAgICAgICBwdWJsaWMgTG9jYWxDYXJvdXNlbFZpZXdIZWxwZXIoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0KTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgRGV0YWlsVGV4dHVyZVBhcmFtZXRlcnMgZ2V0RGV0YWlsVGV4dHVyZVBhcmFtZXRlcnMoaW50IGlkKSB7CisgICAgICAgICAgICByZXR1cm4gbURldGFpbFBhcmFtczsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2FyZFNlbGVjdGVkKGludCBuKSB7CisgICAgICAgICAgICBpZiAobiA8IG1BY3Rpdml0eURlc2NyaXB0aW9ucy5zaXplKCkpIHsKKyAgICAgICAgICAgICAgICBBY3Rpdml0eURlc2NyaXB0aW9uIGl0ZW0gPSBtQWN0aXZpdHlEZXNjcmlwdGlvbnMuZ2V0KG4pOworICAgICAgICAgICAgICAgIC8vIHByZXBhcmUgYSBsYXVuY2ggaW50ZW50IGFuZCBzZW5kIGl0CisgICAgICAgICAgICAgICAgaWYgKGl0ZW0uaW50ZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaXRlbS5pbnRlbnQuYWRkRmxhZ3MoSW50ZW50LkZMQUdfQUNUSVZJVFlfTEFVTkNIRURfRlJPTV9ISVNUT1JZKTsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIlN0YXJ0aW5nIGludGVudCAiICsgaXRlbS5pbnRlbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRBY3Rpdml0eShpdGVtLmludGVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICBvdmVycmlkZVBlbmRpbmdUcmFuc2l0aW9uKFIuYW5pbS5yZWNlbnRfYXBwX2VudGVyLCBSLmFuaW0ucmVjZW50X2FwcF9sZWF2ZSk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEFjdGl2aXR5Tm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLncoIlJlY2VudCIsICJVbmFibGUgdG8gbGF1bmNoIHJlY2VudCB0YXNrIiwgZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZmluaXNoKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBCaXRtYXAgZ2V0VGV4dHVyZShmaW5hbCBpbnQgaWQpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIm9uUmVxdWVzdFRleHR1cmUoIiArIGlkICsgIikiKTsKKyAgICAgICAgICAgIEFjdGl2aXR5RGVzY3JpcHRpb24gaW5mbzsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZChtQWN0aXZpdHlEZXNjcmlwdGlvbnMpIHsKKyAgICAgICAgICAgICAgICBpbmZvID0gbUFjdGl2aXR5RGVzY3JpcHRpb25zLmdldChpZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBCaXRtYXAgYml0bWFwID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChpbmZvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBiaXRtYXAgPSBjb21wb3NpdGVCaXRtYXAoaW5mbyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gYml0bWFwOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBCaXRtYXAgZ2V0RGV0YWlsVGV4dHVyZShpbnQgbikgeworICAgICAgICAgICAgQml0bWFwIGJpdG1hcCA9IG51bGw7CisgICAgICAgICAgICBpZiAobiA8IG1BY3Rpdml0eURlc2NyaXB0aW9ucy5zaXplKCkpIHsKKyAgICAgICAgICAgICAgICBBY3Rpdml0eURlc2NyaXB0aW9uIGl0ZW0gPSBtQWN0aXZpdHlEZXNjcmlwdGlvbnMuZ2V0KG4pOworICAgICAgICAgICAgICAgIG1EZXRhaWxJbmZvLnRpdGxlLnNldFRleHQoaXRlbS5sYWJlbCk7CisgICAgICAgICAgICAgICAgbURldGFpbEluZm8uZGVzY3JpcHRpb24uc2V0VGV4dChpdGVtLmRlc2NyaXB0aW9uKTsKKyAgICAgICAgICAgICAgICBiaXRtYXAgPSBtRGV0YWlsSW5mby5kcmF3KG51bGwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGJpdG1hcDsKKyAgICAgICAgfQorICAgIH07CisKKyAgICBwcml2YXRlIEJpdG1hcCBjb21wb3NpdGVCaXRtYXAoQWN0aXZpdHlEZXNjcmlwdGlvbiBpbmZvKSB7CisgICAgICAgIGZpbmFsIGludCB0YXJnZXRXaWR0aCA9IFRFWFRVUkVfV0lEVEg7CisgICAgICAgIGZpbmFsIGludCB0YXJnZXRIZWlnaHQgPSBURVhUVVJFX0hFSUdIVDsKKyAgICAgICAgZmluYWwgaW50IGJvcmRlciA9IDM7IC8vIGluc2V0IGFsb25nIHRoZSBlZGdlIGZvciB0aHVtbm5haWwgY29udGVudAorICAgICAgICBmaW5hbCBpb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Jvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgbmV3VGh1bWJuYWlsKGZpbmFsIGludCBpZCwgZmluYWwgQml0bWFwIGJpdG1hcCwgQ2hhclNlcXVlbmNlIGRlc2NyaXB0aW9uKQorICAgICAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgaW50IHcgPSBiaXRtYXAuZ2V0V2lkdGgoKTsKKyAgICAgICAgICAgIGludCBoID0gYml0bWFwLmdldEhlaWdodCgpOworICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiTmV3IHRodW1ibmFpbCBmb3IgaWQ9IiArIGlkICsgIiwgZGltZW5zaW9ucz0iICsgdyArICJ4IiArIGgKKyAgICAgICAgICAgICAgICAgICAgKyAiIGRlc2NyaXB0aW9uICciICsgZGVzY3JpcHRpb24gKyAiJyIpOworICAgICAgICAgICAgQWN0aXZpdHlEZXNjcmlwdGlvbiBpbmZvID0gZmluZEFjdGl2aXR5RGVzY3JpcHRpb24oaWQpOworICAgICAgICAgICAgaWYgKGluZm8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGluZm8udGh1bWJuYWlsID0gYml0bWFwOworICAgICAgICAgICAgICAgIGluZm8uZGVzY3JpcHRpb24gPSBkZXNjcmlwdGlvbjsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdGh1bWJXaWR0aCA9IGJpdG1hcC5nZXRXaWR0aCgpOworICAgICAgICAgICAgICAgIGZpbmFsIGludCB0aHVtYkhlaWdodCA9IGJpdG1hcC5nZXRIZWlnaHQoKTsKKyAgICAgICAgICAgICAgICBpZiAoKG1Qb3J0cmFpdE1vZGUgJiYgdGh1bWJXaWR0aCA+IHRodW1iSGVpZ2h0KQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFtUG9ydHJhaXRNb2RlICYmIHRodW1iV2lkdGggPCB0aHVtYkhlaWdodCkpIHsKKyAgICAgICAgICAgICAgICAgICAgTWF0cml4IG1hdHJpeCA9IG5ldyBNYXRyaXgoKTsKKyAgICAgICAgICAgICAgICAgICAgbWF0cml4LnNldFJvdGF0ZSg5MC4wZiwgKGZsb2F0KSB0aHVtYldpZHRoIC8gMiwgKGZsb2F0KSB0aHVtYkhlaWdodCAvIDIpOworICAgICAgICAgICAgICAgICAgICBpbmZvLm1hdHJpeCA9IG1hdHJpeDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpbmZvLm1hdHJpeCA9IG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIEZvcmNlIENhcm91c2VsIHRvIHJlcXVlc3QgbmV3IHRleHR1cmVzIGZvciB0aGlzIGl0ZW0uCisgICAgICAgICAgICAgICAgbUNhcm91c2VsVmlldy5zZXRUZXh0dXJlRm9ySXRlbShpbmZvLnBvc2l0aW9uLCBudWxsKTsKKyAgICAgICAgICAgICAgICBtQ2Fyb3VzZWxWaWV3LnNldERldGFpbFRleHR1cmVGb3JJdGVtKGluZm8ucG9zaXRpb24sIDAsIDAsIDAsIDAsIG51bGwpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cudihUQUcsICJDYW4ndCBmaW5kIHZpZXcgZm9yIGlkICIgKyBpZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgLyoqCisgICAgICogV2UgbmV2ZXIgcmVhbGx5IGZpbmlzaCgpIFJlY2VudEFwcGxpY2F0aW9uc0FjdGl2aXR5LCBzaW5jZSB3ZSBkb24ndCB3YW50IHRvCisgICAgICogZ2V0IGRlc3Ryb3llZCBhbmQgcGF5IHRoZSBzdGFydC11cCBjb3N0IHRvIHJlc3RhcnQgaXQuCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZmluaXNoKCkgeworICAgICAgICBtb3ZlVGFza1RvQmFjayh0cnVlKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbk5ld0ludGVudChJbnRlbnQgaW50ZW50KSB7CisgICAgICAgIG1IaWRkZW4gPSAhbUhpZGRlbjsKKyAgICAgICAgaWYgKG1IaWRkZW4pIHsKKyAgICAgICAgICAgIG1IaWRpbmcgPSB0cnVlOworICAgICAgICAgICAgbW92ZVRhc2tUb0JhY2sodHJ1ZSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtSGlkaW5nID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgc3VwZXIub25OZXdJbnRlbnQoaW50ZW50KTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkNyZWF0ZShCdW5kbGUgc2F2ZWRJbnN0YW5jZVN0YXRlKSB7CisgICAgICAgIHN1cGVyLm9uQ3JlYXRlKHNhdmVkSW5zdGFuY2VTdGF0ZSk7CisKKyAgICAgICAgZmluYWwgUmVzb3VyY2VzIHJlcyA9IGdldFJlc291cmNlcygpOworICAgICAgICBmaW5hbCBWaWV3IGRlY29yVmlldyA9IGdldFdpbmRvdygpLmdldERlY29yVmlldygpOworCisgICAgICAgIGdldFdpbmRvdygpLmdldERlY29yVmlldygpLnNldEJhY2tncm91bmRDb2xvcigweDgwMDAwMDAwKTsKKworICAgICAgICBpZiAobUNhcm91c2VsVmlldyA9PSBudWxsKSB7CisgICAgICAgICAgICBsb25nIHQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgIHNldENvbnRlbnRWaWV3KFIubGF5b3V0LnJlY2VudF9hcHBzX2FjdGl2aXR5KTsKKyAgICAgICAgICAgIGxvbmcgZWxhcHNlZCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gdDsKKyAgICAgICAgICAgIExvZy52KFRBRywgIlJlY2VudHMgbGF5b3V0IHRvb2sgIiArIGVsYXBzZWQgKyAibXMgdG8gbG9hZCIpOworICAgICAgICAgICAgbUxvYWRpbmdCaXRtYXAgPSBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKHJlcywgUi5kcmF3YWJsZS5yZWNlbnRfcmV6X2JvcmRlcik7CisgICAgICAgICAgICBtQ2Fyb3VzZWxWaWV3ID0gKENhcm91c2VsVmlldylmaW5kVmlld0J5SWQoUi5pZC5jYXJvdXNlbCk7CisgICAgICAgICAgICBtSGVscGVyID0gbmV3IExvY2FsQ2Fyb3VzZWxWaWV3SGVscGVyKHRoaXMpOworICAgICAgICAgICAgbUhlbHBlci5zZXRDYXJvdXNlbFZpZXcobUNhcm91c2VsVmlldyk7CisKKyAgICAgICAgICAgIG1DYXJvdXNlbFZpZXcuc2V0U2xvdENvdW50KENBUkRfU0xPVFMpOworICAgICAgICAgICAgbUNhcm91c2VsVmlldy5zZXRWaXNpYmxlU2xvdHMoVklTSUJMRV9TTE9UUyk7CisgICAgICAgICAgICBtQ2Fyb3VzZWxWaWV3LmNyZWF0ZUNhcmRzKDApOworICAgICAgICAgICAgbUNhcm91c2VsVmlldy5zZXRTdGFydEFuZ2xlKChmbG9hdCkgLSgyLjBmKk1hdGguUEkgKiA1IC8gQ0FSRF9TTE9UUykpOworICAgICAgICAgICAgbUNhcm91c2VsVmlldy5zZXREZWZhdWx0Qml0bWFwKG1Mb2FkaW5nQml0bWFwKTsKKyAgICAgICAgICAgIG1DYXJvdXNlbFZpZXcuc2V0TG9hZGluZ0JpdG1hcChtTG9hZGluZ0JpdG1hcCk7CisgICAgICAgICAgICBtQ2Fyb3VzZWxWaWV3LnNldFJlekluQ2FyZENvdW50KDMuMGYpOworICAgICAgICAgICAgbUNhcm91c2VsVmlldy5nZXRIb2xkZXIoKS5zZXRGb3JtYXQoUGl4ZWxGb3JtYXQuVFJBTlNMVUNFTlQpOworCisgICAgICAgICAgICBtTm9SZWNlbnRzVmlldyA9IChWaWV3KSBmaW5kVmlld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pIHsKKyAgICAgICAgc3VwZXIub25Db25maWd1cmF0aW9uQ2hhbmdlZChuZXdDb25maWcpOworICAgICAgICBtUG9ydHJhaXRNb2RlID0gbmV3Q29uZmlnLm9yaWVudGF0aW9uID09IENvbmZpZ3VyYXRpb24uT1JJRU5UQVRJT05fUE9SVFJBSVQ7CisgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIkNPTkZJRyBDSEFOR0UsIG1Qb3J0cmFpdE1vZGUgPSAiICsgbVBvcnRyYWl0TW9kZSk7CisgICAgICAgIHJlZnJlc2goKTsKKyAgICB9CisKKyAgICB2b2lkIHVwZGF0ZVJ1bm5pbmdUYXNrcygpIHsKKyAgICAgICAgbVJ1bm5pbmdUYXNrTGlzdCA9IG1BY3Rpdml0eU1hbmFnZXIuZ2V0UnVubmluZ1Rhc2tzKE1BWF9UQVNLUywgMCwgbVRodW1ibmFpbFJlY2VpdmVyKTsKKyAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiUG9ydHJhaXQ6ICIgKyBtUG9ydHJhaXRNb2RlKTsKKyAgICAgICAgZm9yIChSdW5uaW5nVGFza0luZm8gciA6IG1SdW5uaW5nVGFza0xpc3QpIHsKKyAgICAgICAgICAgIGlmIChyLnRodW1ibmFpbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW50IHRodW1iV2lkdGggPSByLnRodW1ibmFpbC5nZXRXaWR0aCgpOworICAgICAgICAgICAgICAgIGludCB0aHVtYkhlaWdodCA9IHIudGh1bWJuYWlsLmdldEhlaWdodCgpOworICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIkdvdCB0aHVtYm5haWwgIiArIHRodW1iV2lkdGggKyAieCIgKyB0aHVtYkhlaWdodCk7CisgICAgICAgICAgICAgICAgQWN0aXZpdHlEZXNjcmlwdGlvbiBkZXNjID0gZmluZEFjdGl2aXR5RGVzY3JpcHRpb24oci5pZCk7CisgICAgICAgICAgICAgICAgaWYgKGRlc2MgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBkZXNjLnRodW1ibmFpbCA9IHIudGh1bWJuYWlsOworICAgICAgICAgICAgICAgICAgICBkZXNjLmRlc2NyaXB0aW9uID0gci5kZXNjcmlwdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChtUG9ydHJhaXRNb2RlICYmIHRodW1iV2lkdGggPiB0aHVtYkhlaWdodCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIW1Qb3J0cmFpdE1vZGUgJiYgdGh1bWJXaWR0aCA8IHRodW1iSGVpZ2h0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTWF0cml4IG1hdHJpeCA9IG5ldyBNYXRyaXgoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1hdHJpeC5zZXRSb3RhdGUoOTAuMGYsIChmbG9hdCkgdGh1bWJXaWR0aCAvIDIsIChmbG9hdCkgdGh1bWJIZWlnaHQgLyAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc2MubWF0cml4ID0gbWF0cml4OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiQ291bGRuJ3QgZmluZCBBY3Rpdml0eURlc2MgZm9yIGlkPSIgKyByLmlkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIioqKiBSVU5OSU5HIFRIVU1CTkFJTCBXQVMgTlVMTCAqKioiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB1cGRhdGVSZWNlbnRUYXNrcygpIHsKKyAgICAgICAgZmluYWwgUGFja2FnZU1hbmFnZXIgcG0gPSBnZXRQYWNrYWdlTWFuYWdlcigpOworICAgICAgICBmaW5hbCBBY3Rpdml0eU1hbmFnZXIgYW0gPSAoQWN0aXZpdHlNYW5hZ2VyKSBnZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuQUNUSVZJVFlfU0VSVklDRSk7CisKKyAgICAgICAgZmluYWwgTGlzdDxBY3Rpdml0eU1hbmFnZXIuUmVjZW50VGFza0luZm8+IHJlY2VudFRhc2tzID0KKyAgICAgICAgICAgICAgICBhbS5nZXRSZWNlbnRUYXNrcyhNQVhfVEFTS1MsIEFjdGl2aXR5TWFuYWdlci5SRUNFTlRfSUdOT1JFX1VOQVZBSUxBQkxFKTsKKworICAgICAgICBBY3Rpdml0eUluZm8gaG9tZUluZm8gPSBuZXcgSW50ZW50KEludGVudC5BQ1RJT05fTUFJTikuYWRkQ2F0ZWdvcnkoSW50ZW50LkNBVEVHT1JZX0hPTUUpCisgICAgICAgICAgICAgICAgICAgIC5yZXNvbHZlQWN0aXZpdHlJbmZvKHBtLCAwKTsKKworICAgICAgICAvLyBJY29uVXRpbGl0aWVzIGljb25VdGlsaXRpZXMgPSBuZXcgSWNvblV0aWxpdGllcyh0aGlzKTsgLy8gRklYTUUKKworICAgICAgICBpbnQgbnVtVGFza3MgPSByZWNlbnRUYXNrcy5zaXplKCk7CisgICAgICAgIG1BY3Rpdml0eURlc2NyaXB0aW9ucy5jbGVhcigpOworICAgICAgICBmb3IgKGludCBpID0gMCwgaW5kZXggPSAwOyBpIDwgbnVtVGFza3MgJiYgKGluZGV4IDwgTUFYX1RBU0tTKTsgKytpKSB7CisgICAgICAgICAgICBmaW5hbCBBY3Rpdml0eU1hbmFnZXIuUmVjZW50VGFza0luZm8gcmVjZW50SW5mbyA9IHJlY2VudFRhc2tzLmdldChpKTsKKworICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQocmVjZW50SW5mby5iYXNlSW50ZW50KTsKKyAgICAgICAgICAgIGlmIChyZWNlbnRJbmZvLm9yaWdBY3Rpdml0eSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW50ZW50LnNldENvbXBvbmVudChyZWNlbnRJbmZvLm9yaWdBY3Rpdml0eSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFNraXAgdGhlIGN1cnJlbnQgaG9tZSBhY3Rpdml0eS4KKyAgICAgICAgICAgIGlmIChob21lSW5mbyAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgICYmIGhvbWVJbmZvLnBhY2thZ2VOYW1lLmVxdWFscyhpbnRlbnQuZ2V0Q29tcG9uZW50KCkuZ2V0UGFja2FnZU5hbWUoKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgaG9tZUluZm8ubmFtZS5lcXVhbHMoaW50ZW50LmdldENvbXBvbmVudCgpLmdldENsYXNzTmFtZSgpKSkgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnRlbnQuc2V0RmxhZ3MoKGludGVudC5nZXRGbGFncygpJn5JbnRlbnQuRkxBR19BQ1RJVklUWV9SRVNFVF9UQVNLX0lGX05FRURFRCkKKyAgICAgICAgICAgICAgICAgICAgfCBJbnRlbnQuRkxBR19BQ1RJVklUWV9ORVdfVEFTSyk7CisgICAgICAgICAgICBmaW5hbCBSZXNvbHZlSW5mbyByZXNvbHZlSW5mbyA9IHBtLnJlc29sdmVBY3Rpdml0eShpbnRlbnQsIDApOworICAgICAgICAgICAgaWYgKHJlc29sdmVJbmZvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBBY3Rpdml0eUluZm8gaW5mbyA9IHJlc29sdmVJbmZvLmFjdGl2aXR5SW5mbzsKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgdGl0bGUgPSBpbmZvLmxvYWRMYWJlbChwbSkudG9TdHJpbmcoKTsKKyAgICAgICAgICAgICAgICBEcmF3YWJsZSBpY29uID0gaW5mby5sb2FkSWNvbihwbSk7CisKKyAgICAgICAgICAgICAgICBpbnQgaWQgPSByZWNlbnRUYXNrcy5nZXQoaSkuaWQ7CisgICAgICAgICAgICAgICAgaWYgKGlkICE9IC0xICYmIHRpdGxlICE9IG51bGwgJiYgdGl0bGUubGVuZ3RoKCkgPiAwICYmIGljb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAvLyBpY29uID0gbnVsbDsgRklYTUU6IGljb25VdGlsaXRpZXMuY3JlYXRlSWNvbkRyYXdhYmxlKGljb24pOworICAgICAgICAgICAgICAgICAgICBBY3Rpdml0eURlc2NyaXB0aW9uIGl0ZW0gPSBuZXcgQWN0aXZpdHlEZXNjcmlwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBpY29uLCB0aXRsZSwgbnVsbCwgaWQsIGluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgaXRlbS5pbnRlbnQgPSBpbnRlbnQ7CisgICAgICAgICAgICAgICAgICAgIG1BY3Rpdml0eURlc2NyaXB0aW9ucy5hZGQoaXRlbSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIkFkZGVkIGl0ZW1bIiArIGluZGV4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiXSwgaWQ9IiArIGl0ZW0uaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIHRpdGxlPSIgKyBpdGVtLmxhYmVsKTsKKyAgICAgICAgICAgICAgICAgICAgKytpbmRleDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cudihUQUcsICJTS0lQUElORyBpdGVtICIgKyBpZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCBSdW5uYWJsZSBtUmVmcmVzaFJ1bm5hYmxlID0gbmV3IFJ1bm5hYmxlKCkgeworICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICB1cGRhdGVSZWNlbnRUYXNrcygpOworICAgICAg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CBudWxsKS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldElNRUJ1dHRvblZpc2libGUoYm9vbGVhbiB2aXNpYmxlKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobUxpc3QpIHsKKyAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE1TR19TSE9XX0lNRV9CVVRUT04pOworICAgICAgICAgICAgbUhhbmRsZXIub2J0YWluTWVzc2FnZShNU0dfU0hPV19JTUVfQlVUVE9OLCB2aXNpYmxlID8gMSA6IDAsIDAsIG51bGwpLnNlbmRUb1RhcmdldCgpOworICAgICAgICB9CisgICAgfQorCiAgICAgcHJpdmF0ZSBmaW5hbCBjbGFzcyBIIGV4dGVuZHMgSGFuZGxlciB7CiAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKICAgICAgICAgICAgIGZpbmFsIGludCB3aGF0ID0gbXNnLndoYXQgJiBNU0dfTUFTSzsKQEAgLTE5Niw2ICsyMjUsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1DYWxsYmFja3MuYW5pbWF0ZUNvbGxhcHNlKCk7CiAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBNU0dfU0VUX0xJR0hUU19PTjoKKyAgICAgICAgICAgICAgICAgICAgbUNhbGxiYWNrcy5zZXRMaWdodHNPbihtc2cuYXJnMSAhPSAwKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBNU0dfU0hPV19NRU5VOgorICAgICAgICAgICAgICAgICAgICBtQ2FsbGJhY2tzLnNldE1lbnVLZXlWaXNpYmxlKG1zZy5hcmcxICE9IDApOworICAgICAgICAgICAgICAgIC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lFdmVudC5GTEFHX0ZST01fU1lTVEVNCisgICAgICAgICAgICAgICAgICAgICAgICB8IEtleUV2ZW50LkZMQUdfVklSVFVBTF9IQVJEX0tFWQorICAgICAgICAgICAgICAgICAgICAgICAgfCBLZXlFdmVudC5GTEFHX0xPTkdfUFJFU1MpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHB1YmxpYyBLZXlCdXR0b25WaWV3KENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzKSB7CisgICAgICAgIHRoaXMoY29udGV4dCwgYXR0cnMsIDApOworICAgIH0KKworICAgIHB1YmxpYyBLZXlCdXR0b25WaWV3KENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzLCBpbnQgZGVmU3R5bGUpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCwgYXR0cnMpOworCisgICAgICAgIFR5cGVkQXJyYXkgYSA9IGNvbnRleHQub2J0YWluU3R5bGVkQXR0cmlidXRlcyhhdHRycywgUi5zdHlsZWFibGUuS2V5QnV0dG9uVmlldywKKyAgICAgICAgICAgICAgICBkZWZTdHlsZSwgMCk7CisKKyAgICAgICAgbUNvZGUgPSBhLmdldEludGVnZXIoUi5zdHlsZWFibGUuS2V5QnV0dG9uVmlld19rZXlDb2RlLCAwKTsKKyAgICAgICAgaWYgKG1Db2RlID09IDApIHsKKyAgICAgICAgICAgIFNsb2cudyhTdGF0dXNCYXJTZXJ2aWNlLlRBRywgIktleUJ1dHRvblZpZXcgd2l0aG91dCBrZXkgY29kZSBpZD0weCIKKyAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGdldElkKCkpKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgYS5yZWN5Y2xlKCk7CisKKyAgICAgICAgbVdpbmRvd01hbmFnZXIgPSBJV2luZG93TWFuYWdlci5TdHViLmFzSW50ZXJmYWNlKAorICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoQ29udGV4dC5XSU5ET1dfU0VSVklDRSkpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikgeworICAgICAgICBmaW5hbCBpbnQgYWN0aW9uID0gZXYuZ2V0QWN0aW9uKCk7CisgICAgICAgIGludCB4LCB5OworCisgICAgICAgIHN3aXRjaCAoYWN0aW9uKSB7CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOOgorICAgICAgICAgICAgICAgIC8vU2xvZy5kKCJLZXlCdXR0b25WaWV3IiwgInByZXNzIik7CisgICAgICAgICAgICAgICAgbURvd25UaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgICAgICAgICAgbVJlcGVhdCA9IDA7CisgICAgICAgICAgICAgICAgbVNlbmRpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIG1Mb25nUHJlc3NlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIHNlbmRFdmVudChLZXlFdmVudC5BQ1RJT05fRE9XTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIEtleUV2ZW50LkZMQUdfRlJPTV9TWVNURU0gfCBLZXlFdmVudC5GTEFHX1ZJUlRVQUxfSEFSRF9LRVksIG1Eb3duVGltZSk7CisgICAgICAgICAgICAgICAgc2V0UHJlc3NlZCh0cnVlKTsKKyAgICAgICAgICAgICAgICByZW1vdmVDYWxsYmFja3MobUNoZWNrTG9uZ1ByZXNzKTsKKyAgICAgICAgICAgICAgICBwb3N0RGVsYXllZChtQ2hlY2tMb25nUHJlc3MsIFZpZXdDb25maWd1cmF0aW9uLmdldExvbmdQcmVzc1RpbWVvdXQoKSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFOgorICAgICAgICAgICAgICAgIGlmIChtU2VuZGluZykgeworICAgICAgICAgICAgICAgICAgICB4ID0gKGludClldi5nZXRYKCk7CisgICAgICAgICAgICAgICAgICAgIHkgPSAoaW50KWV2LmdldFkoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHggPCAwIHx8IHggPj0gZ2V0V2lkdGgoKSB8fCB5IDwgMCB8fCB5ID49IGdldEhlaWdodCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtU2VuZGluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZEV2ZW50KEtleUV2ZW50LkFDVElPTl9VUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgS2V5RXZlbnQuRkxBR19GUk9NX1NZU1RFTSB8IEtleUV2ZW50LkZMQUdfVklSVFVBTF9IQVJEX0tFWQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgS2V5RXZlbnQuRkxBR19DQU5DRUxFRCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRQcmVzc2VkKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUNhbGxiYWNrcyhtQ2hlY2tMb25nUHJlc3MpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fVVA6CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6CisgICAgICAgICAgICAgICAgc2V0UHJlc3NlZChmYWxzZSk7CisgICAgICAgICAgICAgICAgaWYgKG1TZW5kaW5nICYmICFtTG9uZ1ByZXNzZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgbVNlbmRpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgc2VuZEV2ZW50KEtleUV2ZW50LkFDVElPTl9VUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBLZXlFdmVudC5GTEFHX0ZST01fU1lTVEVNIHwgS2V5RXZlbnQuRkxBR19WSVJUVUFMX0hBUkRfS0VZKTsKKyAgICAgICAgICAgICAgICAgICAgcmVtb3ZlQ2FsbGJhY2tzKG1DaGVja0xvbmdQcmVzcyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgdm9pZCBzZW5kRXZlbnQoaW50IGFjdGlvbiwgaW50IGZsYWdzKSB7CisgICAgICAgIHNlbmRFdmVudChhY3Rpb24sIGZsYWdzLCBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSk7CisgICAgfQorCisgICAgdm9pZCBzZW5kRXZlbnQoaW50IGFjdGlvbiwgaW50IGZsYWdzLCBsb25nIHdoZW4pIHsKKyAgICAgICAgZmluYWwgS2V5RXZlbnQgZXYgPSBuZXcgS2V5RXZlbnQobURvd25UaW1lLCB3aGVuLCBhY3Rpb24sIG1Db2RlLCBtUmVwZWF0LAorICAgICAgICAgICAgICAgIDAsIDAsIDAsIGZsYWdzLCBJbnB1dERldmljZS5TT1VSQ0VfS0VZQk9BUkQpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgLy9TbG9nLmQoU3RhdHVzQmFyU2VydmljZS5UQUcsICJpbmplY3RpbmcgZXZlbnQgIiArIGV2KTsKKyAgICAgICAgICAgIG1XaW5kb3dNYW5hZ2VyLmluamVjdElucHV0RXZlbnROb1dhaXQoZXYpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgIC8vIFN5c3RlbSBwcm9jZXNzIGlzIGRlYWQKKyAgICAgICAgfQorICAgIH0KK30KKworCmRpZmYgLS1naXQgYS9wYWNrYWdlcy9TeXN0ZW1VSS9zcmMvY29tL2FuZHJvaWQvc3lzdGVtdWkvc3RhdHVzYmFyL0xhdGVzdEl0ZW1WaWV3LmphdmEgYi9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YXRlIGZpbmFsIEFycmF5TGlzdDxFbnRyeT4gbUVudHJpZXMgPSBuZXcgQXJyYXlMaXN0PEVudHJ5PigpOworICAgIHByaXZhdGUgZmluYWwgQ29tcGFyYXRvcjxFbnRyeT4gbUVudHJ5Q21wID0gbmV3IENvbXBhcmF0b3I8RW50cnk+KCkgeworICAgICAgICBwdWJsaWMgaW50IGNvbXBhcmUoRW50cnkgYSwgRW50cnkgYikgeworICAgICAgICAgICAgcmV0dXJuIChpbnQpKGEubm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi53aGVuIC0gYi5ub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLndoZW4pOworICAgICAgICB9CisgICAgfTsKIAogICAgIHB1YmxpYyBpbnQgc2l6ZSgpIHsKICAgICAgICAgcmV0dXJuIG1FbnRyaWVzLnNpemUoKTsKICAgICB9CiAKLSAgICBwdWJsaWMgRW50cnkgZ2V0RW50cnlBdChpbnQgaW5kZXgpIHsKLSAgICAgICAgcmV0dXJuIG1FbnRyaWVzLmdldChpbmRleCk7CisgICAgcHVibGljIEVudHJ5IGdldChpbnQgaSkgeworICAgICAgICByZXR1cm4gbUVudHJpZXMuZ2V0KGkpOwogICAgIH0KIAotICAgIHB1YmxpYyBpbnQgZmluZEVudHJ5KElCaW5kZXIga2V5KSB7Ci0gICAgICAgIGZpbmFsIGludCBOID0gbUVudHJpZXMuc2l6ZSgpOwotICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7Ci0gICAgICAgICAgICBFbnRyeSBlbnRyeSA9IG1FbnRyaWVzLmdldChpKTsKLSAgICAgICAgICAgIGlmIChlbnRyeS5rZXkgPT0ga2V5KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGk7CisgICAgcHVibGljIEVudHJ5IGZpbmRCeUtleShJQmluZGVyIGtleSkgeworICAgICAgICBmb3IgKEVudHJ5IGUgOiBtRW50cmllcykgeworICAgICAgICAgICAgaWYgKGUua2V5ID09IGtleSkgeworICAgICAgICAgICAgICAgIHJldHVybiBlOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIGludCBhZGQoRW50cnkgZW50cnkpIHsKKyAgICAgICAgaW50IGk7CisgICAgICAgIGludCBOID0gbUVudHJpZXMuc2l6ZSgpOworICAgICAgICBmb3IgKGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChtRW50cnlDbXAuY29tcGFyZShtRW50cmllcy5nZXQoaSksIGVudHJ5KSA+IDApIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBtRW50cmllcy5hZGQoaSwgZW50cnkpOworICAgICAgICByZXR1cm4gaTsKICAgICB9CiAKICAgICBwdWJsaWMgaW50IGFkZChJQmluZGVyIGtleSwgU3RhdHVzQmFyTm90aWZpY2F0aW9uIG5vdGlmaWNhdGlvbiwgVmlldyByb3csIFZpZXcgY29udGVudCwKQEAgLTY2LDQyICs4OCwyMyBAQAogICAgICAgICBlbnRyeS5jb250ZW50ID0gY29udGVudDsKICAgICAgICAgZW50cnkuZXhwYW5kZWQgPSBleHBhbmRlZDsKICAgICAgICAgZW50cnkuaWNvbiA9IGljb247Ci0gICAgICAgIGZpbmFsIGludCBpbmRleCA9IGNob29zZUluZGV4KG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24ud2hlbik7Ci0gICAgICAgIG1FbnRyaWVzLmFkZChpbmRleCwgZW50cnkpOwotICAgICAgICByZXR1cm4gaW5kZXg7CisgICAgICAgIHJldHVybiBhZGQoZW50cnkpOwogICAgIH0KIAogICAgIHB1YmxpYyBFbnRyeSByZW1vdmUoSUJpbmRlciBrZXkpIHsKLSAgICAgICAgZmluYWwgaW50IE4gPSBtRW50cmllcy5zaXplKCk7Ci0gICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKLSAgICAgICAgICAgIEVudHJ5IGVudHJ5ID0gbUVudHJpZXMuZ2V0KGkpOwotICAgICAgICAgICAgaWYgKGVudHJ5LmtleSA9PSBrZXkpIHsKLSAgICAgICAgICAgICAgICBtRW50cmllcy5yZW1vdmUoaSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGVudHJ5OwotICAgICAgICAgICAgfQorICAgICAgICBFbnRyeSBlID0gZmluZEJ5S2V5KGtleSk7CisgICAgICAgIGlmIChlICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1FbnRyaWVzLnJlbW92ZShlKTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gbnVsbDsKLSAgICB9Ci0KLSAgICBwcml2YXRlIGludCBjaG9vc2VJbmRleChmaW5hbCBsb25nIHdoZW4pIHsKLSAgICAgICAgZmluYWwgaW50IE4gPSBtRW50cmllcy5zaXplKCk7Ci0gICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKLSAgICAgICAgICAgIEVudHJ5IGVudHJ5ID0gbUVudHJpZXMuZ2V0KGkpOwotICAgICAgICAgICAgaWYgKGVudHJ5Lm5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24ud2hlbiA+IHdoZW4pIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gaTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTjsKKyAgICAgICAgcmV0dXJuIGU7CiAgICAgfQogCiAgICAgLyoqCiAgICAgICogUmV0dXJuIHdoZXRoZXIgdGhlcmUgYXJlIGFueSB2aXNpYmxlIGl0ZW1zIChpLmUuIGl0ZW1zIHdpdGhvdXQgYW4gZXJyb3IpLgogICAgICAqLwogICAgIHB1YmxpYyBib29sZWFuIGhhc1Zpc2libGVJdGVtcygpIHsKLSAgICAgICAgZmluYWwgaW50IE4gPSBtRW50cmllcy5zaXplKCk7Ci0gICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKLSAgICAgICAgICAgIEVudHJ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7CisgICAgZmxvYXQgbUFuaW1BY2NlbDsKKyAgICBsb25nIG1BbmltTGFzdFRpbWU7CisgICAgYm9vbGVhbiBtQW5pbWF0aW5nUmV2ZWFsID0gZmFsc2U7CisgICAgaW50IG1WaWV3RGVsdGE7CisgICAgaW50W10gbUFic1BvcyA9IG5ldyBpbnRbMl07CisKKyAgICAvLyBmb3IgZGlzYWJsaW5nIHRoZSBzdGF0dXMgYmFyCisgICAgaW50IG1EaXNhYmxlZCA9IDA7CisKKyAgICBwcml2YXRlIGNsYXNzIEV4cGFuZGVkRGlhbG9nIGV4dGVuZHMgRGlhbG9nIHsKKyAgICAgICAgRXhwYW5kZWREaWFsb2coQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlLlRoZW1lX0xpZ2h0X05vVGl0bGVCYXIpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGRpc3BhdGNoS2V5RXZlbnQoS2V5RXZlbnQgZXZlbnQpIHsKKyAgICAgICAgICAgIGJvb2xlYW4gZG93biA9IGV2ZW50LmdldEFjdGlvbigpID09IEtleUV2ZW50LkFDVElPTl9ET1dOOworICAgICAgICAgICAgc3dpdGNoIChldmVudC5nZXRLZXlDb2RlKCkpIHsKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9CQUNLOgorICAgICAgICAgICAgICAgIGlmICghZG93bikgeworICAgICAgICAgICAgICAgICAgICBhbmltYXRlQ29sbGFwc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gc3VwZXIuZGlzcGF0Y2hLZXlFdmVudChldmVudCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzdGFydCgpIHsKKyAgICAgICAgbURpc3BsYXkgPSAoKFdpbmRvd01hbmFnZXIpbUNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LldJTkRPV19TRVJWSUNFKSkKKyAgICAgICAgICAgICAgICAuZ2V0RGVmYXVsdERpc3BsYXkoKTsKKworICAgICAgICBzdXBlci5zdGFydCgpOworCisgICAgICAgIGFkZEludHJ1ZGVyVmlldygpOworCisgICAgICAgIC8vIExhc3RseSwgY2FsbCB0byB0aGUgaWNvbiBwb2xpY3kgdG8gaW5zdGFsbC91cGRhdGUgYWxsIHRoZSBpY29ucy4KKyAgICAgICAgbUljb25Qb2xpY3kgPSBuZXcgU3RhdHVzQmFyUG9saWN5KG1Db250ZXh0KTsKKyAgICB9CisKKyAgICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgIC8vIENvbnN0cnVjdGluZyB0aGUgdmlldworICAgIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgcHJvdGVjdGVkIFZpZXcgbWFrZVN0YXR1c0JhclZpZXcoKSB7CisgICAgICAgIGZpbmFsIENvbnRleHQgY29udGV4dCA9IG1Db250ZXh0OworCisgICAgICAgIFJlc291cmNlcyByZXMgPSBjb250ZXh0LmdldFJlc291cmNlcygpOworCisgICAgICAgIG1JY29uU2l6ZSA9IHJlcy5nZXREaW1lbnNpb25QaXhlbFNpemUoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5kaW1lbi5zdGF0dXNfYmFyX2ljb25fc2l6ZSk7CisKKyAgICAgICAgRXhwYW5kZWRWaWV3IGV4cGFuZGVkID0gKEV4cGFuZGVkVmlldylWaWV3LmluZmxhdGUoY29udGV4dCwKKyAgICAgICAgICAgICAgICBSLmxheW91dC5zdGF0dXNf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ICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQsCisgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsCisgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuVFlQRV9TVEFUVVNfQkFSX1BBTkVMLAorICAgICAgICAgICAgICAgIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfTEFZT1VUX0lOX1NDUkVFTgorICAgICAgICAgICAgICAgICAgICB8IFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfTEFZT1VUX05PX0xJTUlUUworICAgICAgICAgICAgICAgICAgICB8IFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfTk9UX1RPVUNIX01PREFMCisgICAgICAgICAgICAgICAgICAgIHwgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19OT1RfRk9DVVNBQkxFCisgICAgICAgICAgICAgICAgICAgIHwgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19BTFRfRk9DVVNBQkxFX0lNLAorICAgICAgICAgICAgICAgIFBpeGVsRm9ybWF0LlRSQU5TTFVDRU5UKTsKKyAgICAgICAgbHAuZ3Jhdml0eSA9IEdyYXZpdHkuVE9QIHwgR3Jhdml0eS5GSUxMX0hPUklaT05UQUw7CisgICAgICAgIGxwLnkgKz0gaGVpZ2h0ICogMS41OyAvLyBGSVhNRQorICAgICAgICBscC5zZXRUaXRsZSgiSW50cnVkZXJBbGVydCIpOworICAgICAgICBscC53aW5kb3dBbmltYXRpb25zID0gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZS5BbmltYXRpb25fU3RhdHVzQmFyX0ludHJ1ZGVyQWxlcnQ7CisKKyAgICAgICAgV2luZG93TWFuYWdlckltcGwuZ2V0RGVmYXVsdCgpLmFkZFZpZXcobUludHJ1ZGVyQWxlcnRWaWV3LCBscCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkSWNvbihTdHJpbmcgc2xvdCwgaW50IGluZGV4LCBpbnQgdmlld0luZGV4LCBTdGF0dXNCYXJJY29uIGljb24pIHsKKyAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJhZGRJY29uIHNsb3Q9IiArIHNsb3QgKyAiIGluZGV4PSIgKyBpbmRleCArICIgdmlld0luZGV4PSIgKyB2aWV3SW5kZXgKKyAgICAgICAgICAgICAgICArICIgaWNvbj0iICsgaWNvbik7CisgICAgICAgIFN0YXR1c0Jhckljb25WaWV3IHZpZXcgPSBuZXcgU3RhdHVzQmFySWNvblZpZXcobUNvbnRleHQsIHNsb3QpOworICAgICAgICB2aWV3LnNldChpY29uKTsKKyAgICAgICAgbVN0YXR1c0ljb25zLmFkZFZpZXcodmlldywgdmlld0luZGV4LCBuZXcgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcyhtSWNvblNpemUsIG1JY29uU2l6ZSkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHVwZGF0ZUljb24oU3RyaW5nIHNsb3QsIGludCBpbmRleCwgaW50IHZpZXdJbmRleCwKKyAgICAgICAgICAgIFN0YXR1c0Jhckljb24gb2xkLCBTdGF0dXNCYXJJY29uIGljb24pIHsKKyAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJ1cGRhdGVJY29uIHNsb3Q9IiArIHNsb3QgKyAiIGluZGV4PSIgKyBpbmRleCArICIgdmlld0luZGV4PSIgKyB2aWV3SW5kZXgKKyAgICAgICAgICAgICAgICArICIgb2xkPSIgKyBvbGQgKyAiIGljb249IiArIGljb24pOworICAgICAgICBTdGF0dXNCYXJJY29uVmlldyB2aWV3ID0gKFN0YXR1c0Jhckljb25WaWV3KW1TdGF0dXNJY29ucy5nZXRDaGlsZEF0KHZpZXdJbmRleCk7CisgICAgICAgIHZpZXcuc2V0KGljb24pOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHJlbW92ZUljb24oU3RyaW5nIHNsb3QsIGludCBpbmRleCwgaW50IHZpZXdJbmRleCkgeworICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgInJlbW92ZUljb24gc2xvdD0iICsgc2xvdCArICIgaW5kZXg9IiArIGluZGV4ICsgIiB2aWV3SW5kZXg9IiArIHZpZXdJbmRleCk7CisgICAgICAgIG1TdGF0dXNJY29ucy5yZW1vdmVWaWV3QXQodmlld0luZGV4KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGROb3RpZmljYXRpb24oSUJpbmRlciBrZXksIFN0YXR1c0Jhck5vdGlmaWNhdGlvbiBub3RpZmljYXRpb24pIHsKKyAgICAgICAgU3RhdHVzQmFySWNvblZpZXcgaWNvblZpZXcgPSBhZGROb3RpZmljYXRpb25WaWV3cyhrZXksIG5vdGlmaWNhdGlvbik7CisgICAgICAgIGlmIChpY29uVmlldyA9PSBudWxsKSByZXR1cm47CisKKyAgICAgICAgYm9vbGVhbiBpbW1lcnNpdmUgPSBmYWxzZTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGltbWVyc2l2ZSA9IEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCkuaXNUb3BBY3Rpdml0eUltbWVyc2l2ZSgpOworICAgICAgICAgICAgU2xvZy5kKFRBRywgIlRvcCBhY3Rpdml0eSBpcyAiICsgKGltbWVyc2l2ZT8iaW1tZXJzaXZlIjoibm90IGltbWVyc2l2ZSIpKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGltbWVyc2l2ZSkgeworICAgICAgICAgICAgaWYgKChub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmZsYWdzICYgTm90aWZpY2F0aW9uLkZMQUdfSElHSF9QUklPUklUWSkgIT0gMCkgeworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJQcmVzZW50aW5nIGhpZ2gtcHJpb3JpdHkgbm90aWZpY2F0aW9uIGluIGltbWVyc2l2ZSBhY3Rpdml0eSIpOworICAgICAgICAgICAgICAgIC8vIHNwZWNpYWwgbmV3IHRyYW5zaWVudCB0aWNrZXIgbW9kZQorICAgICAgICAgICAgICAgIC8vIDEuIFBvcHVsYXRlIG1JbnRydWRlckFsZXJ0VmlldworCisgICAgICAgICAgICAgICAgSW1hZ2VWaWV3IGFsZXJ0SWNvbiA9IChJbWFnZVZpZXcpIG1JbnRydWRlckFsZXJ0Vmlldy5maW5kVmlld0J5SWQoUi5pZC5hbGVydEljb24pOworICAgICAgICAgICAgICAgIFRleHRWaWV3IGFsZXJ0VGV4dCA9IChUZXh0VmlldykgbUludHJ1ZGVyQWxlcnRWaWV3LmZpbmRWaWV3QnlJZChSLmlkLmFsZXJ0VGV4dCk7CisgICAgICAgICAgICAgICAgYWxlcnRJY29uLnNldEltYWdlRHJhd2FibGUoU3RhdHVzQmFySWNvblZpZXcuZ2V0SWNvbigKKyAgICAgICAgICAgICAgICAgICAgYWxlcnRJY29uLmdldENvbnRleHQoKSwKKyAgICAgICAgICAgICAgICAgICAgaWNvblZpZXcuZ2V0U3RhdHVzQmFySWNvbigpKSk7CisgICAgICAgICAgICAgICAgYWxlcnRUZXh0LnNldFRleHQobm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi50aWNrZXJUZXh0KTsKKworICAgICAgICAgICAgICAgIFZpZXcgYnV0dG9uID0gbUludHJ1ZGVyQWxlcnRWaWV3LmZpbmRWaWV3QnlJZChSLmlkLmludHJ1ZGVyX2FsZXJ0X2NvbnRlbnQpOworICAgICAgICAgICAgICAgIGJ1dHRvbi5zZXRPbkNsaWNrTGlzdGVuZXIoCisgICAgICAgICAgICAgICAgICAgIG5ldyBMYXVuY2hlcihub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmNvbnRlbnRJbnRlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ucGtnLCBub3RpZmljYXRpb24udGFnLCBub3RpZmljYXRpb24uaWQpKTsKKworICAgICAgICAgICAgICAgIC8vIDIuIEFuaW1hdGUgbUludHJ1ZGVyQWxlcnRWaWV3IGluCisgICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZEVtcHR5TWVzc2FnZShNU0dfU0hPV19JTlRSVURFUik7CisKKyAgICAgICAgICAgICAgICAvLyAzLiBTZXQgYWxhcm0gdG8gYWdlIHRoZSBub3RpZmljYXRpb24gb2ZmIChUT0RPKQorICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE1TR19ISURFX0lOVFJVREVSKTsKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlRGVsYXllZChNU0dfSElERV9JTlRSVURFUiwgSU5UUlVERVJfQUxFUlRfREVDQVlfTVMpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uZnVsbFNjcmVlbkludGVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAvLyBub3QgaW1tZXJzaXZlICYgYSBmdWxsLXNjcmVlbiBhbGVydCBzaG91bGQgYmUgc2hvd24KKyAgICAgICAgICAgIFNsb2cuZChUQUcsICJOb3RpZmljYXRpb24gaGFzIGZ1bGxTY3JlZW5JbnRlbnQgYW5kIGFjdGl2aXR5IGlzIG5vdCBpbW1lcnNpdmU7IgorICAgICAgICAgICAgICAgICAgICArICIgc2VuZGluZyBmdWxsU2NyZWVuSW50ZW50Iik7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uZnVsbFNjcmVlbkludGVudC5zZW5kKCk7CisgICAgICAgICAgICB9IGNhdGNoIChQZW5kaW5nSW50ZW50LkNhbmNlbGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIH0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5rbm93biBrZXk6ICIgKyBrZXkpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG9sZExpc3QgPSBtTGF0ZXN0OworICAgICAgICB9CisgICAgICAgIGZpbmFsIFN0YXR1c0Jhck5vdGlmaWNhdGlvbiBvbGROb3RpZmljYXRpb24gPSBvbGRFbnRyeS5ub3RpZmljYXRpb247CisgICAgICAgIGZpbmFsIFJlbW90ZVZpZXdzIG9sZENvbnRlbnRWaWV3ID0gb2xkTm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5jb250ZW50VmlldzsKKworICAgICAgICBmaW5hbCBSZW1vdGVWaWV3cyBjb250ZW50VmlldyA9IG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uY29udGVudFZpZXc7CisKKyAgICAgICAgaWYgKGZhbHNlKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAib2xkIG5vdGlmaWNhdGlvbjogd2hlbj0iICsgb2xkTm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi53aGVuCisgICAgICAgICAgICAgICAgICAgICsgIiBvbmdvaW5nPSIgKyBvbGROb3RpZmljYXRpb24uaXNPbmdvaW5nKCkKKyAgICAgICAgICAgICAgICAgICAgKyAiIGV4cGFuZGVkPSIgKyBvbGRFbnRyeS5leHBhbmRlZAorICAgICAgICAgICAgICAgICAgICArICIgY29udGVudFZpZXc9IiArIG9sZENvbnRlbnRWaWV3KTsKKyAgICAgICAgICAgIFNsb2cuZChUQUcsICJuZXcgbm90aWZpY2F0aW9uOiB3aGVuPSIgKyBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLndoZW4KKyAgICAgICAgICAgICAgICAgICAgKyAiIG9uZ29pbmc9IiArIG9sZE5vdGlmaWNhdGlvbi5pc09uZ29pbmcoKQorICAgICAgICAgICAgICAgICAgICArICIgY29udGVudFZpZXc9IiArIGNvbnRlbnRWaWV3KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIENhbiB3ZSBqdXN0IHJlYXBwbHkgdGhlIFJlbW90ZVZpZXdzIGluIHBsYWNlPyAgSWYgd2hlbiBkaWRuJ3QgY2hhbmdlLCB0aGUgb3JkZXIKKyAgICAgICAgLy8gZGlkbid0IGNoYW5nZS4KKyAgICAgICAgaWYgKG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24ud2hlbiA9PSBvbGROb3RpZmljYXRpb24ubm90aWZpY2F0aW9uLndoZW4KKyAgICAgICAgICAgICAgICAmJiBub3RpZmljYXRpb24uaXNPbmdvaW5nKCkgPT0gb2xkTm90aWZpY2F0aW9uLmlzT25nb2luZygpCisgICAgICAgICAgICAgICAgJiYgb2xkRW50cnkuZXhwYW5kZWQgIT0gbnVsbAorICAgICAgICAgICAgICAgICYmIGNvbnRlbnRWaWV3ICE9IG51bGwgJiYgb2xkQ29udGVudFZpZXcgIT0gbnVsbAorICAgICAgICAgICAgICAgICYmIGNvbnRlbnRWaWV3LmdldFBhY2thZ2UoKSAhPSBudWxsCisgICAgICAgICAgICAgICAgJiYgb2xkQ29udGVudFZpZXcuZ2V0UGFja2FnZSgpICE9IG51bGwKKyAgICAgICAgICAgICAgICAmJiBvbGRDb250ZW50Vmlldy5nZXRQYWNrYWdlKCkuZXF1YWxzKGNvbnRlbnRWaWV3LmdldFBhY2thZ2UoKSkKKyAgICAgICAgICAgICAgICAmJiBvbGRDb250ZW50Vmlldy5nZXRMYXlvdXRJZCgpID09IGNvbnRlbnRWaWV3LmdldExheW91dElkKCkpIHsKKyAgICAgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAicmV1c2luZyBub3RpZmljYXRpb24iKTsKKyAgICAgICAgICAgIG9sZEVudHJ5Lm5vdGlmaWNhdGlvbiA9IG5vdGlmaWNhdGlvbjsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgLy8gUmVhcHBseSB0aGUgUmVtb3RlVmlld3MKKyAgICAgICAgICAgICAgICBjb250ZW50Vmlldy5yZWFwcGx5KG1Db250ZXh0LCBvbGRFbnRyeS5jb250ZW50KTsKKyAgICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGNvbnRlbnRJbnRlbnQKKyAgICAgICAgICAgICAgICBmaW5hbCBQZW5kaW5nSW50ZW50IGNvbnRlbnRJbnRlbnQgPSBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmNvbnRlbnRJbnRlbnQ7CisgICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRJbnRlbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBvbGRFbnRyeS5jb250ZW50LnNldE9uQ2xpY2tMaXN0ZW5lcihuZXcgTGF1bmNoZXIoY29udGVudEludGVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm90aWZpY2F0aW9uLnBrZywgbm90aWZpY2F0aW9uLnRhZywgbm90aWZpY2F0aW9uLmlkKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgb2xkRW50cnkuY29udGVudC5zZXRPbkNsaWNrTGlzdGVuZXIobnVsbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSB0aGUgaWNvbi4KKyAgICAgICAgICAgICAgICBmaW5hbCBTdGF0dXNCYXJJY29uIGljID0gbmV3IFN0YXR1c0Jhckljb24obm90aWZpY2F0aW9uLnBrZywKKyAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uaWNvbiwgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5pY29uTGV2ZWwsCisgICAgICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLm51bWJlcik7CisgICAgICAgICAgICAgICAgaWYgKCFvbGRFbnRyeS5pY29uLnNldChpYykpIHsKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlTm90aWZpY2F0aW9uRXJyb3Ioa2V5LCBub3RpZmljYXRpb24sICJDb3VsZG4ndCB1cGRhdGUgaWNvbjogIiArIGljKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvLyBJdCBmYWlsZWQgdG8gYWRkIGNsZWFubHkuICBMb2csIGFuZCByZW1vdmUgdGhlIHZpZXcgZnJvbSB0aGUgcGFuZWwuCisgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIkNvdWxkbid0IHJlYXBwbHkgdmlld3MgZm9yIHBhY2thZ2UgIiArIGNvbnRlbnRWaWV3LmdldFBhY2thZ2UoKSwgZSk7CisgICAgICAgICAgICAgICAgcmVtb3ZlTm90aWZpY2F0aW9uVmlld3Moa2V5KTsKKyAgICAgICAgICAgICAgICBhZGROb3RpZmljYXRpb25WaWV3cyhrZXksIG5vdGlmaWNhdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgIm5vdCByZXVzaW5nIG5vdGlmaWNhdGlvbiIpOworICAgICAgICAgICAgcmVtb3ZlTm90aWZpY2F0aW9uVmlld3Moa2V5KTsKKyAgICAgICAgICAgIGFkZE5vdGlmaWNhdGlvblZpZXdzKGtleSwgbm90aWZpY2F0aW9uKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFJlc3RhcnQgdGhlIHRpY2tlciBpZiBpdCdzIHN0aWxsIHJ1bm5pbmcKKyAgICAgICAgaWYgKG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24udGlja2VyVGV4dCAhPSBudWxsCisgICAgICAgICAgICAgICAgJiYgIVRleHRVdGlscy5lcXVhbHMobm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi50aWNrZXJUZXh0LAorICAgICAgICAgICAgICAgICAgICBvbGRFbnRyeS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XgpIHsKKyAgICAgICAgZmluYWwgaW50IGxhdGVzdFNpemUgPSBtTGF0ZXN0LnNpemUoKTsKKyAgICAgICAgaWYgKGlzT25nb2luZykgeworICAgICAgICAgICAgcmV0dXJuIGxhdGVzdFNpemUgKyAobU9uZ29pbmcuc2l6ZSgpIC0gdmlld0luZGV4KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBsYXRlc3RTaXplIC0gdmlld0luZGV4OworICAgICAgICB9CisgICAgfQorCisgICAgVmlld1tdIG1ha2VOb3RpZmljYXRpb25WaWV3KFN0YXR1c0Jhck5vdGlmaWNhdGlvbiBub3RpZmljYXRpb24sIFZpZXdHcm91cCBwYXJlbnQpIHsKKyAgICAgICAgTm90aWZpY2F0aW9uIG4gPSBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uOworICAgICAgICBSZW1vdGVWaWV3cyByZW1vdGVWaWV3cyA9IG4uY29udGVudFZpZXc7CisgICAgICAgIGlmIChyZW1vdGVWaWV3cyA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGNyZWF0ZSB0aGUgcm93IHZpZXcKKyAgICAgICAgTGF5b3V0SW5mbGF0ZXIgaW5mbGF0ZXIgPSAoTGF5b3V0SW5mbGF0ZXIpbUNvbnRleHQuZ2V0U3lzdGVtU2VydmljZSgKKyAgICAgICAgICAgICAgICBDb250ZXh0LkxBWU9VVF9JTkZMQVRFUl9TRVJWSUNFKTsKKyAgICAgICAgVmlldyByb3cgPSBpbmZsYXRlci5pbmZsYXRlKFIubGF5b3V0LnN0YXR1c19iYXJfbGF0ZXN0X2V2ZW50LCBwYXJlbnQsIGZhbHNlKTsKKworICAgICAgICAvLyBiaW5kIHRoZSBjbGljayBldmVudCB0byB0aGUgY29udGVudCBhcmVhCisgICAgICAgIFZpZXdHcm91cCBjb250ZW50ID0gKFZpZXdHcm91cClyb3cuZmluZFZpZXdCeUlkKFIuaWQuY29udGVudCk7CisgICAgICAgIGNvbnRlbnQuc2V0RGVzY2VuZGFudEZvY3VzYWJpbGl0eShWaWV3R3JvdXAuRk9DVVNfQkxPQ0tfREVTQ0VOREFOVFMpOworICAgICAgICBjb250ZW50LnNldE9uRm9jdXNDaGFuZ2VMaXN0ZW5lcihtRm9jdXNDaGFuZ2VMaXN0ZW5lcik7CisgICAgICAgIFBlbmRpbmdJbnRlbnQgY29udGVudEludGVudCA9IG4uY29udGVudEludGVudDsKKyAgICAgICAgaWYgKGNvbnRlbnRJbnRlbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgY29udGVudC5zZXRPbkNsaWNrTGlzdGVuZXIobmV3IExhdW5jaGVyKGNvbnRlbnRJbnRlbnQsIG5vdGlmaWNhdGlvbi5wa2csCisgICAgICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24udGFnLCBub3RpZmljYXRpb24uaWQpKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNvbnRlbnQuc2V0T25DbGlja0xpc3RlbmVyKG51bGwpOworICAgICAgICB9CisKKyAgICAgICAgVmlldyBleHBhbmRlZCA9IG51bGw7CisgICAgICAgIEV4Y2VwdGlvbiBleGNlcHRpb24gPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgZXhwYW5kZWQgPSByZW1vdGVWaWV3cy5hcHBseShtQ29udGV4dCwgY29udGVudCk7CisgICAgICAgIH0KKyAgICAgICAgY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgZXhjZXB0aW9uID0gZTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZXhwYW5kZWQgPT0gbnVsbCkgeworICAgICAgICAgICAgU3RyaW5nIGlkZW50ID0gbm90aWZpY2F0aW9uLnBrZyArICIvMHgiICsgSW50ZWdlci50b0hleFN0cmluZyhub3RpZmljYXRpb24uaWQpOworICAgICAgICAgICAgU2xvZy5lKFRBRywgImNvdWxkbid0IGluZmxhdGUgdmlldyBmb3Igbm90aWZpY2F0aW9uICIgKyBpZGVudCwgZXhjZXB0aW9uKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgY29udGVudC5hZGRWaWV3KGV4cGFuZGVkKTsKKyAgICAgICAgICAgIHJvdy5zZXREcmF3aW5nQ2FjaGVFbmFibGVkKHRydWUpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG5ldyBWaWV3W10geyByb3csIGNvbnRlbnQsIGV4cGFuZGVkIH07CisgICAgfQorCisgICAgU3RhdHVzQmFySWNvblZpZXcgYWRkTm90aWZpY2F0aW9uVmlld3MoSUJpbmRlciBrZXksIFN0YXR1c0Jhck5vdGlmaWNhdGlvbiBub3RpZmljYXRpb24pIHsKKyAgICAgICAgTm90aWZpY2F0aW9uRGF0YSBsaXN0OworICAgICAgICBWaWV3R3JvdXAgcGFyZW50OworICAgICAgICBmaW5hbCBib29sZWFuIGlzT25nb2luZyA9IG5vdGlmaWNhdGlvbi5pc09uZ29pbmcoKTsKKyAgICAgICAgaWYgKGlzT25nb2luZykgeworICAgICAgICAgICAgbGlzdCA9IG1PbmdvaW5nOworICAgICAgICAgICAgcGFyZW50ID0gbU9uZ29pbmdJdGVtczsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGxpc3QgPSBtTGF0ZXN0OworICAgICAgICAgICAgcGFyZW50ID0gbUxhdGVzdEl0ZW1zOworICAgICAgICB9CisgICAgICAgIC8vIENvbnN0cnVjdCB0aGUgZXhwYW5kZWQgdmlldy4KKyAgICAgICAgZmluYWwgVmlld1tdIHZpZXdzID0gbWFrZU5vdGlmaWNhdGlvblZpZXcobm90aWZpY2F0aW9uLCBwYXJlbnQpOworICAgICAgICBpZiAodmlld3MgPT0gbnVsbCkgeworICAgICAgICAgICAgaGFuZGxlTm90aWZpY2F0aW9uRXJyb3Ioa2V5LCBub3RpZmljYXRpb24sICJDb3VsZG4ndCBleHBhbmQgUmVtb3RlVmlld3MgZm9yOiAiCisgICAgICAgICAgICAgICAgICAgICsgbm90aWZpY2F0aW9uKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIGZpbmFsIFZpZXcgcm93ID0gdmlld3NbMF07CisgICAgICAgIGZpbmFsIFZpZXcgY29udGVudCA9IHZpZXdzWzFdOworICAgICAgICBmaW5hbCBWaWV3IGV4cGFuZGVkID0gdmlld3NbMl07CisgICAgICAgIC8vIENvbnN0cnVjdCB0aGUgaWNvbi4KKyAgICAgICAgZmluYWwgU3RhdHVzQmFySWNvblZpZXcgaWNvblZpZXcgPSBuZXcgU3RhdHVzQmFySWNvblZpZXcobUNvbnRleHQsCisgICAgICAgICAgICAgICAgbm90aWZpY2F0aW9uLnBrZyArICIvMHgiICsgSW50ZWdlci50b0hleFN0cmluZyhub3RpZmljYXRpb24uaWQpKTsKKyAgICAgICAgZmluYWwgU3RhdHVzQmFySWNvbiBpYyA9IG5ldyBTdGF0dXNCYXJJY29uKG5vdGlmaWNhdGlvbi5wa2csIG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uaWNvbiwKKyAgICAgICAgICAgICAgICAgICAgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5pY29uTGV2ZWwsIG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24ubnVtYmVyKTsKKyAgICAgICAgaWYgKCFpY29uVmlldy5zZXQoaWMpKSB7CisgICAgICAgICAgICBoYW5kbGVOb3RpZmljYXRpb25FcnJvcihrZXksIG5vdGlmaWNhdGlvbiwgIkNvdWxkaW5nIGNyZWF0ZSBpY29uOiAiICsgaWMpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgLy8gQWRkIHRoZSBleHBhbmRlZCB2aWV3LgorICAgICAgICBmaW5hbCBpbnQgdmlld0luZGV4ID0gbGlzdC5hZGQoa2V5LCBub3RpZmljYXRpb24sIHJvdywgY29udGVudCwgZXhwYW5kZWQsIGljb25WaWV3KTsKKyAgICAgICAgcGFyZW50LmFkZFZpZXcocm93LCB2aWV3SW5kZXgpOworICAgICAgICAvLyBBZGQgdGhlIGljb24uCisgICAgICAgIGZpbmFsIGludCBpY29uSW5kZXggPSBjaG9vc2VJY29uSW5kZXgoaXNPbmdvaW5nLCB2aWV3SW5kZXgpOworICAgICAgICBtTm90aWZpY2F0aW9uSWNvbnMuYWRkVmlldyhpY29uVmlldywgaWNvbkluZGV4KTsKKyAgICAgICAgcmV0dXJuIGljb25WaWV3OworICAgIH0KKworICAgIFN0YXR1c0Jhck5vdGlmaWNhdGlvbiByZW1vdmVOb3RpZmljYXRpb25WaWV3cyhJQmluZGVyIGtleSkgeworICAgICAgICBOb3RpZmljYXRpb25EYXRhLkVudHJ5IGVudHJ5ID0gbU9uZ29pbmcucmVtb3ZlKGtleSk7CisgICAgICAgIGlmIChlbnRyeSA9PSBudWxsKSB7CisgICAgICAgICAgICBlbnRyeSA9IG1MYXRlc3QucmVtb3ZlKGtleSk7CisgICAgICAgICAgICBpZiAoZW50cnkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJyZW1vdmVOb3RpZmljYXRpb24gZm9yIHVua25vd24ga2V5OiAiICsga2V5KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBSZW1vdmUgdGhlIGV4cGFuZGVkIHZpZXcuCisgICAgICAgICgoVmlld0dyb3VwKWVudHJ5LnJvdy5nZXRQYXJlbnQoKSkucmVtb3ZlVmlldyhlbnRyeS5yb3cpOworICAgICAgICAvLyBSZW1vdmUgdGhlIGljb24uCisgICAgICAgICgoVmlld0dyb3VwKWVudHJ5Lmljb24uZ2V0UGFyZW50KCkpLnJlbW92ZVZpZXcoZW50cnkuaWNvbik7CisKKyAgICAgICAgcmV0dXJuIGVudHJ5Lm5vdGlmaWNhdGlvbjsKKyAgIC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AqLworICAgIHB1YmxpYyB2b2lkIGRpc2FibGUoaW50IHN0YXRlKSB7CisgICAgICAgIGZpbmFsIGludCBvbGQgPSBtRGlzYWJsZWQ7CisgICAgICAgIGZpbmFsIGludCBkaWZmID0gc3RhdGUgXiBvbGQ7CisgICAgICAgIG1EaXNhYmxlZCA9IHN0YXRlOworCisgICAgICAgIGlmICgoZGlmZiAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9FWFBBTkQpICE9IDApIHsKKyAgICAgICAgICAgIGlmICgoc3RhdGUgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfRVhQQU5EKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkRJU0FCTEVfRVhQQU5EOiB5ZXMiKTsKKyAgICAgICAgICAgICAgICBhbmltYXRlQ29sbGFwc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoKGRpZmYgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfTk9USUZJQ0FUSU9OX0lDT05TKSAhPSAwKSB7CisgICAgICAgICAgICBpZiAoKHN0YXRlICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05PVElGSUNBVElPTl9JQ09OUykgIT0gMCkgeworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJESVNBQkxFX05PVElGSUNBVElPTl9JQ09OUzogeWVzIik7CisgICAgICAgICAgICAgICAgaWYgKG1UaWNraW5nKSB7CisgICAgICAgICAgICAgICAgICAgIG1UaWNrZXIuaGFsdCgpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNldE5vdGlmaWNhdGlvbkljb25WaXNpYmlsaXR5KGZhbHNlLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0uZmFkZV9vdXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkRJU0FCTEVfTk9USUZJQ0FUSU9OX0lDT05TOiBubyIpOworICAgICAgICAgICAgICAgIGlmICghbUV4cGFuZGVkVmlzaWJsZSkgeworICAgICAgICAgICAgICAgICAgICBzZXROb3RpZmljYXRpb25JY29uVmlzaWJpbGl0eSh0cnVlLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0uZmFkZV9pbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKChkaWZmICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05PVElGSUNBVElPTl9USUNLRVIpICE9IDApIHsKKyAgICAgICAgICAgIGlmIChtVGlja2luZyAmJiAoc3RhdGUgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfTk9USUZJQ0FUSU9OX1RJQ0tFUikgIT0gMCkgeworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJESVNBQkxFX05PVElGSUNBVElPTl9USUNLRVI6IHllcyIpOworICAgICAgICAgICAgICAgIG1UaWNrZXIuaGFsdCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQWxsIGNoYW5nZXMgdG8gdGhlIHN0YXR1cyBiYXIgYW5kIG5vdGlmaWNhdGlvbnMgZnVubmVsIHRocm91Z2ggaGVyZSBhbmQgYXJlIGJhdGNoZWQuCisgICAgICovCisgICAgcHJpdmF0ZSBjbGFzcyBIIGV4dGVuZHMgSGFuZGxlciB7CisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtKSB7CisgICAgICAgICAgICBzd2l0Y2ggKG0ud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0FOSU1BVEU6CisgICAgICAgICAgICAgICAgICAgIGRvQW5pbWF0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0FOSU1BVEVfUkVWRUFMOgorICAgICAgICAgICAgICAgICAgICBkb1JldmVhbEFuaW1hdGlvbigpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19TSE9XX0lOVFJVREVSOgorICAgICAgICAgICAgICAgICAgICBzZXRJbnRydWRlckFsZXJ0VmlzaWJpbGl0eSh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBNU0dfSElERV9JTlRSVURFUjoKKyAgICAgICAgICAgICAgICAgICAgc2V0SW50cnVkZXJBbGVydFZpc2liaWxpdHkoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIFZpZXcuT25Gb2N1c0NoYW5nZUxpc3RlbmVyIG1Gb2N1c0NoYW5nZUxpc3RlbmVyID0gbmV3IFZpZXcuT25Gb2N1c0NoYW5nZUxpc3RlbmVyKCkgeworICAgICAgICBwdWJsaWMgdm9pZCBvbkZvY3VzQ2hhbmdlKFZpZXcgdiwgYm9vbGVhbiBoYXNGb2N1cykgeworICAgICAgICAgICAgLy8gQmVjYXVzZSAndicgaXMgYSBWaWV3R3JvdXAsIGFsbCBpdHMgY2hpbGRyZW4gd2lsbCBiZSAodW4pc2VsZWN0ZWQKKyAgICAgICAgICAgIC8vIHRvbywgd2hpY2ggYWxsb3dzIG1hcnF1ZWVpbmcgdG8gd29yay4KKyAgICAgICAgICAgIHYuc2V0U2VsZWN0ZWQoaGFzRm9jdXMpOworICAgICAgICB9CisgICAgfTsKKworICAgIHByaXZhdGUgdm9pZCBtYWtlRXhwYW5kZWRWaXNpYmxlKCkgeworICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgIk1ha2UgZXhwYW5kZWQgdmlzaWJsZTogZXhwYW5kZWQgdmlzaWJsZT0iICsgbUV4cGFuZGVkVmlzaWJsZSk7CisgICAgICAgIGlmIChtRXhwYW5kZWRWaXNpYmxlKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgbUV4cGFuZGVkVmlzaWJsZSA9IHRydWU7CisgICAgICAgIHZpc2liaWxpdHlDaGFuZ2VkKHRydWUpOworCisgICAgICAgIHVwZGF0ZUV4cGFuZGVkVmlld1BvcyhFWFBBTkRFRF9MRUFWRV9BTE9ORSk7CisgICAgICAgIG1FeHBhbmRlZFBhcmFtcy5mbGFncyAmPSB+V2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19OT1RfRk9DVVNBQkxFOworICAgICAgICBtRXhwYW5kZWRQYXJhbXMuZmxhZ3MgfD0gV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19BTFRfRk9DVVNBQkxFX0lNOworICAgICAgICBtRXhwYW5kZWREaWFsb2cuZ2V0V2luZG93KCkuc2V0QXR0cmlidXRlcyhtRXhwYW5kZWRQYXJhbXMpOworICAgICAgICBtRXhwYW5kZWRWaWV3LnJlcXVlc3RGb2N1cyhWaWV3LkZPQ1VTX0ZPUldBUkQpOworICAgICAgICBtVHJhY2tpbmdWaWV3LnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKworICAgICAgICBpZiAoIW1UaWNraW5nKSB7CisgICAgICAgICAgICBzZXREYXRlVmlld1Zpc2liaWxpdHkodHJ1ZSwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hbmltLmZhZGVfaW4pOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYW5pbWF0ZUV4cGFuZCgpIHsKKyAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJBbmltYXRlIGV4cGFuZDogZXhwYW5kZWQ9IiArIG1FeHBhbmRlZCk7CisgICAgICAgIGlmICgobURpc2FibGVkICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX0VYUEFORCkgIT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIDsKKyAgICAgICAgfQorICAgICAgICBpZiAobUV4cGFuZGVkKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBwcmVwYXJlVHJhY2tpbmcoMCwgdHJ1ZSk7CisgICAgICAgIHBlcmZvcm1GbGluZygwLCAyMDAwLjBmLCB0cnVlKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhbmltYXRlQ29sbGFwc2UoKSB7CisgICAgICAgIGlmIChTUEVXKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAiYW5pbWF0ZUNvbGxhcHNlKCk6IG1FeHBhbmRlZD0iICsgbUV4cGFuZGVkCisgICAgICAgICAgICAgICAgICAgICsgIiBtRXhwYW5kZWRWaXNpYmxlPSIgKyBtRXhwYW5kZWRWaXNpYmxlCisgICAgICAgICAgICAgICAgICAgICsgIiBtRXhwYW5kZWQ9IiArIG1FeHBhbmRlZAorICAgICAgICAgICAgICAgICAgICArICIgbUFuaW1hdGluZz0iICsgbUFuaW1hdGluZworICAgICAgICAgICAgICAgICAgICArICIgbUFuaW1ZPSIgKyBtQW5pbVkKKyAgICAgICAgICAgICAgICAgICAgKyAiIG1BbmltVmVsPSIgKyBtQW5pbVZlbCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1FeHBhbmRlZFZpc2libGUpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGludCB5OworICAgICAgICBpZiAobUFuaW1hdGluZykgeworICAgICAgICAgICAgeSA9IChpbnQpbUFuaW1ZOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgeSA9IG1EaXNwbGF5LmdldEhlaWdodCgpLTE7CisgICAgICAgIH0KKyAgICAgICAgLy8gTGV0IHRoZSBmbGluZyB0aGluayB0aGF0IHdlJ3JlIG9wZW4gc28gaXQgZ29lcyBpbiB0aGUgcmlnaHQgZGlyZWN0aW9uCisgICAgICAgIC8vIGFuZCBkb2Vzbid0IHRyeSB0byByZS1vcGVuIHRoZSB3aW5kb3dzaGFkZS4KKyAgICAgICAgbUV4cGFuZGVkID0gdHJ1ZTsKKyAgICAgICAgcHJlcGFyZVRyYWNraW5nKHksIGZhbHNlKTsKKyAgICAgICAgcGVyZm9ybUZsaW5nKHksIC0yMDAwLjBmLCB0cnVlKTsKKyAgICB9CisKKyAgICB2b2lkIHBlcmZvcm1FeHBhbmQoKSB7CisgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAicGVyZm9ybUV4cGFuZDogbUV4cGFuZGVkPSIgKyBtRXhwYW5kZWQpOworICAgICAgICBpZiAoKG1EaXNhYmxlZCAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9FWFBBTkQpICE9IDApIHsKKyAgICAgICAgICAgIHJldHVybiA7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1FeHBhbmRlZCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgbUV4cGFuZGVkID0gdHJ1ZTsKKyAgICAgICAgbWFrZUV4cGFuZGVkVmlzaWJsZSgpOworICAgICAgICB1cGRhdGVFeHBhbmRlZFZpZXdQb3MoRVhQQU5ERURfRlVMTF9PUEVOKTsKKworICAgICAgICBpZiAoZmFsc2UpIHBvc3RTdGFydFRyYWNpbmcoKTsKKyAgICB9CisKKyAgICB2b2lkIHBlcmZvcm1Db2xsYXBzZSgpIHsKKyAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJwZXJmb3JtQ29sbGFwc2U6IG1FeHBhbmRlZD0iICsgbUV4cGFuZGVkCisgICAgICAgICAgICAgICAgKyAiIG1FeHBhbmRlZFZpc2libGU9IiArIG1FeHBhbmRlZFZpc2libGUpOworCisgICAgICAgIGlmICghbUV4cGFuZGVkVmlzaWJsZSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIG1FeHBhbmRlZFZpc2libGUgPSBmYWxzZTsKKyAgICAgICAgdmlza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FuaW1ZKTsKKyAgICAgICAgICAgIGluY3JlbWVudEFuaW0oKTsKKyAgICAgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAiZG9BbmltYXRpb24gYWZ0ZXIgIG1BbmltWT0iICsgbUFuaW1ZKTsKKyAgICAgICAgICAgIGlmIChtQW5pbVkgPj0gbURpc3BsYXkuZ2V0SGVpZ2h0KCktMSkgeworICAgICAgICAgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAiQW5pbWF0aW9uIGNvbXBsZXRlZCB0byBleHBhbmRlZCBzdGF0ZS4iKTsKKyAgICAgICAgICAgICAgICBtQW5pbWF0aW5nID0gZmFsc2U7CisgICAgICAgICAgICAgICAgdXBkYXRlRXhwYW5kZWRWaWV3UG9zKEVYUEFOREVEX0ZVTExfT1BFTik7CisgICAgICAgICAgICAgICAgcGVyZm9ybUV4cGFuZCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAobUFuaW1ZIDwgbVN0YXR1c0JhclZpZXcuZ2V0SGVpZ2h0KCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgIkFuaW1hdGlvbiBjb21wbGV0ZWQgdG8gY29sbGFwc2VkIHN0YXRlLiIpOworICAgICAgICAgICAgICAgIG1BbmltYXRpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB1cGRhdGVFeHBhbmRlZFZpZXdQb3MoMCk7CisgICAgICAgICAgICAgICAgcGVyZm9ybUNvbGxhcHNlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICB1cGRhdGVFeHBhbmRlZFZpZXdQb3MoKGludCltQW5pbVkpOworICAgICAgICAgICAgICAgIG1DdXJBbmltYXRpb25UaW1lICs9IEFOSU1fRlJBTUVfRFVSQVRJT047CisgICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2VBdFRpbWUobUhhbmRsZXIub2J0YWluTWVzc2FnZShNU0dfQU5JTUFURSksIG1DdXJBbmltYXRpb25UaW1lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHZvaWQgc3RvcFRyYWNraW5nKCkgeworICAgICAgICBtVHJhY2tpbmcgPSBmYWxzZTsKKyAgICAgICAgbVZlbG9jaXR5VHJhY2tlci5yZWN5Y2xlKCk7CisgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIgPSBudWxsOworICAgIH0KKworICAgIHZvaWQgaW5jcmVtZW50QW5pbSgpIHsKKyAgICAgICAgbG9uZyBub3cgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKKyAgICAgICAgZmxvYXQgdCA9ICgoZmxvYXQpKG5vdyAtIG1BbmltTGFzdFRpbWUpKSAvIDEwMDA7ICAgICAgICAgICAgLy8gbXMgLT4gcworICAgICAgICBmaW5hbCBmbG9hdCB5ID0gbUFuaW1ZOworICAgICAgICBmaW5hbCBmbG9hdCB2ID0gbUFuaW1WZWw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBweC9zCisgICAgICAgIGZpbmFsIGZsb2F0IGEgPSBtQW5pbUFjY2VsOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHB4L3MvcworICAgICAgICBtQW5pbVkgPSB5ICsgKHYqdCkgKyAoMC41ZiphKnQqdCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBweAorICAgICAgICBtQW5pbVZlbCA9IHYgKyAoYSp0KTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBweC9zCisgICAgICAgIG1BbmltTGFzdFRpbWUgPSBub3c7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1zCisgICAgICAgIC8vU2xvZy5kKFRBRywgInk9IiArIHkgKyAiIHY9IiArIHYgKyAiIGE9IiArIGEgKyAiIHQ9IiArIHQgKyAiIG1BbmltWT0iICsgbUFuaW1ZCisgICAgICAgIC8vICAgICAgICArICIgbUFuaW1BY2NlbD0iICsgbUFuaW1BY2NlbCk7CisgICAgfQorCisgICAgdm9pZCBkb1JldmVhbEFuaW1hdGlvbigpIHsKKyAgICAgICAgZmluYWwgaW50IGggPSBtQ2xvc2VWaWV3LmdldEhlaWdodCgpICsgbVN0YXR1c0JhclZpZXcuZ2V0SGVpZ2h0KCk7CisgICAgICAgIGlmIChtQW5pbWF0aW5nUmV2ZWFsICYmIG1BbmltYXRpbmcgJiYgbUFuaW1ZIDwgaCkgeworICAgICAgICAgICAgaW5jcmVtZW50QW5pbSgpOworICAgICAgICAgICAgaWYgKG1BbmltWSA+PSBoKSB7CisgICAgICAgICAgICAgICAgbUFuaW1ZID0gaDsKKyAgICAgICAgICAgICAgICB1cGRhdGVFeHBhbmRlZFZpZXdQb3MoKGludCltQW5pbVkpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB1cGRhdGVFeHBhbmRlZFZpZXdQb3MoKGludCltQW5pbVkpOworICAgICAgICAgICAgICAgIG1DdXJBbmltYXRpb25UaW1lICs9IEFOSU1fRlJBTUVfRFVSQVRJT047CisgICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2VBdFRpbWUobUhhbmRsZXIub2J0YWluTWVzc2FnZShNU0dfQU5JTUFURV9SRVZFQUwpLAorICAgICAgICAgICAgICAgICAgICAgICAgbUN1ckFuaW1hdGlvblRpbWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgdm9pZCBwcmVwYXJlVHJhY2tpbmcoaW50IHksIGJvb2xlYW4gb3BlbmluZykgeworICAgICAgICBtVHJhY2tpbmcgPSB0cnVlOworICAgICAgICBtVmVsb2NpdHlUcmFja2VyID0gVmVsb2NpdHlUcmFja2VyLm9idGFpbigpOworICAgICAgICBpZiAob3BlbmluZykgeworICAgICAgICAgICAgbUFuaW1BY2NlbCA9IDIwMDAuMGY7CisgICAgICAgICAgICBtQW5pbVZlbCA9IDIwMDsKKyAgICAgICAgICAgIG1BbmltWSA9IG1TdGF0dXNCYXJWaWV3LmdldEhlaWdodCgpOworICAgICAgICAgICAgdXBkYXRlRXhwYW5kZWRWaWV3UG9zKChpbnQpbUFuaW1ZKTsKKyAgICAgICAgICAgIG1BbmltYXRpbmcgPSB0cnVlOworICAgICAgICAgICAgbUFuaW1hdGluZ1JldmVhbCA9IHRydWU7CisgICAgICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfQU5JTUFURSk7CisgICAgICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfQU5JTUFURV9SRVZFQUwpOworICAgICAgICAgICAgbG9uZyBub3cgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgIG1BbmltTGFzdFRpbWUgPSBub3c7CisgICAgICAgICAgICBtQ3VyQW5pbWF0aW9uVGltZSA9IG5vdyArIEFOSU1fRlJBTUVfRFVSQVRJT047CisgICAgICAgICAgICBtQW5pbWF0aW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlQXRUaW1lKG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoTVNHX0FOSU1BVEVfUkVWRUFMKSwKKyAgICAgICAgICAgICAgICAgICAgbUN1ckFuaW1hdGlvblRpbWUpOworICAgICAgICAgICAgbWFrZUV4cGFuZGVkVmlzaWJsZSgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gaXQncyBvcGVuLCBjbG9zZSBpdD8KKyAgICAgICAgICAgIGlmIChtQW5pbWF0aW5nKSB7CisgICAgICAgICAgICAgICAgbUFuaW1hdGluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE1TR19BTklNQVRFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHVwZGF0ZUV4cGFuZGVkVmlld1Bvcyh5ICsgbVZpZXdEZWx0YSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIHBlcmZvcm1GbGluZyhpbnQgeSwgZmxvYXQgdmVsLCBib29sZWFuIGFsd2F5cykgeworICAgICAgICBtQW5pbWF0aW5nUmV2ZWFsID0gZmFsc2U7CisgICAgICAgIG1EaXNwbGF5SGVpZ2h0ID0gbURpc3BsYXkuZ2V0SGVpZ2h0KCk7CisKKyAgICAgICAgbUFuaW1ZID0geTsKKyAgICAgICAgbUFuaW1WZWwgPSB2ZWw7CisKKyAgICAgICAgLy9TbG9nLmQoVEFHLCAic3RhcnRpbmcgd2l0aCBtQW5pbVk9IiArIG1BbmltWSArICIgbUFuaW1WZWw9IiArIG1BbmltVmVsKTsKKworICAgICAgICBpZiAobUV4cGFuZGVkKSB7CisgICAgICAgICAgICBpZiAoIWFsd2F5cyAmJiAoCisgICAgICAgICAgICAgICAgICAgIHZlbCA+IDIwMC4wZgorICAgICAgICAgICAgICAgICAgICB8fCAoeSA+IChtRGlzcGxheUhlaWdodC0yNSkgJiYgdmVsID4gLTIwMC4wZikpKSB7CisgICAgICAgICAgICAgICAgLy8gV2UgYXJlIGV4cGFuZGVkLCBidXQgdGhleSBkaWRuJ3QgbW92ZSBzdWZmaWNpZW50bHkgdG8gY2F1c2UKKyAgICAgICAgICAgICAgICAvLyB1cyB0byByZXRyYWN0LiAgQW5pbWF0ZSBiYWNrIHRvIHRoZSBleHBhbmRlZCBwb3NpdGlvbi4KKyAgICAgICAgICAgICAgICBtQW5pbUFjY2VsID0gMjAwMC4wZjsKKyAgICAgICAgICAgICAgICBpZiAodmVsIDwgMCkgeworICAgICAgICAgICAgICAgICAgICBtQW5pbVZlbCA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gV2UgYXJlIGV4cGFuZGVkIGFuZCBhcmUgbm93IGdvaW5nIHRvIGFuaW1hdGUgYXdheS4KKyAgICAgICAgICAgICAgICBtQW5pbUFjY2VsID0gLTIwMDAuMGY7CisgICAgICAgICAgICAgICAgaWYgKHZlbCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgbUFuaW1WZWwgPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGlmIChhbHdheXMgfHwgKAorICAgICAgICAgICAgICAgICAgICB2ZWwgPiAyMDAuMGYKKyAgICAgICAgICAgICAgICAgICAgfHwgKHkgPiAobURpc3BsYXlIZWlnaHQvMikgJiYgdmVsID4gLTIwMC4wZikpKSB7CisgICAgICAgICAgICAgICAgLy8gV2UgYXJlIGNvbGxhcHNlZCwgYW5kIHRoZXkgbW92ZWQgZW5vdWdoIHRvIGFsbG93IHVzIHRvCisgICAgICAgICAgICAgICAgLy8gZXhwYW5kLiAgQW5pbWF0ZSBpbiB0aGUgbm90aWZpY2F0aW9ucy4KKyAgICAgICAgICAgICAgICBtQW5pbUFjY2VsID0gMjAwMC4wZjsKKyAgICAgICAgICAgICAgICBpZiAodmVsIDwgMCkgeworICAgICAgICAgICAgICAgICAgICBtQW5pbVZlbCA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gV2UgYXJlIGNvbGxhcHNlZCwgYnV0IHRoZXkgZGlkbid0IG1vdmUgc3VmZmljaWVudGx5IHRvIGNhdXNlCisgICAgICAgICAgICAgICAgLy8gdXMgdG8gcmV0cmFjdC4gIEFuaW1hdGUgYmFjayB0byB0aGUgY29sbGFwc2VkIHBvc2l0aW9uLgorICAgICAgICAgICAgICAgIG1BbmltQWNjZWwgPSAtMjAwMC4wZjsKKyAgICAgICAgICAgICAgICBpZiAodmVsID4gMCkgeworICAgICAgICAgICAgICAgICAgICBtQW5pbVZlbCA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vU2xvZy5kKFRBRywgIm1BbmltWT0iICsgbUFuaW1ZICsgIiBtQW5pbVZlbD0iICsgbUFuaW1WZWwKKyAgICAgICAgLy8gICAgICAgICsgIiBtQW5pbUFjY2VsPSIgKyBtQW5pbUFjY2VsKTsKKworICAgICAgICBsb25nIG5vdyA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOworICAgICAgICBtQW5pbUxhc3RUaW1lID0gbm93OworICAgICAgICBtQ3VyQW5pbWF0aW9uVGltZSA9IG5vdyArIEFOSU1fRlJBTUVfRFVSQVRJT047CisgICAgICAgIG1BbmltYXRpbmcgPSB0cnVlOworICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfQU5JTUFURSk7CisgICAgICAgIG1IYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE1TR19BTklNQVRFX1JFVkVBTCk7CisgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlQXRUaW1lKG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoTVNHX0FOSU1BVEUpLCBtQ3VyQW5pbWF0aW9uVGltZSk7CisgICAgICAgIHN0b3BUcmFja2luZygpOworICAgIH0KKworICAgIGJvb2xlYW4gaW50ZXJjZXB0VG91Y2hFdmVudChNb3Rpb25FdmVudCBldmVudCkgeworICAgICAgICBpZiAoU1BFVykgeworICAgICAgICAgICAgU2xvZy5kKFRBRywgIlRvdWNoOiByYXdZPSIgKyBldmVudC5nZXRSYXdZKCkgKyAiIGV2ZW50PSIgKyBldmVudCArICIgbURpc2FibGVkPSIKKyAgICAgICAgICAgICAgICArIG1EaXNhYmxlZCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoKG1EaXNhYmxlZCAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9FWFBBTkQpICE9IDApIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIGludCBzdGF0dXNCYXJTaXplID0gbVN0YXR1c0JhclZpZXcuZ2V0SGVpZ2h0KCk7CisgICAgICAgIGZpbmFsIGludCBoaXRTaXplID0gc3RhdHVzQmFyU2l6ZSoyOworICAgICAgICBpZiAoZXZlbnQuZ2V0QWN0aW9uKCkgPT0gTW90aW9uRXZlbnQuQUNUSU9OX0RPV04pIHsKKyAgICAgICAgICAgIGZpbmFsIGludCB5ID0gKGludClldmVudC5nZXRSYXdZKCk7CisKKyAgICAgICAgICAgIGlmICghbUV4cGFuZGVkKSB7CisgICAgICAgICAgICAgICAgbVZpZXdEZWx0YSA9IHN0YXR1c0JhclNpemUgLSB5OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtVHJhY2tpbmdWaWV3LmdldExvY2F0aW9uT25TY3JlZW4obUFic1Bvcyk7CisgICAgICAgICAgICAgICAgbVZpZXdEZWx0YSA9IG1BYnNQb3NbMV0gKyBtVHJhY2tpbmdWaWV3LmdldEhlaWdodCgpIC0geTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICgoIW1FeHBhbmRlZCAmJiB5IDwgaGl0U2l6ZSkgfHwKKyAgICAgICAgICAgICAgICAgICAgKG1FeHBhbmRlZCAmJiB5ID4gKG1EaXNwbGF5LmdldEhlaWdodCgpLWhpdFNpemUpKSkgeworCisgICAgICAgICAgICAgICAgLy8gV2UgZHJvcCBldmVudHMgYXQgdGhlIGVkZ2Ugb2YgdGhlIHNjcmVlbiB0byBtYWtlIHRoZSB3aW5kb3dzaGFkZSBjb21lCisgICAgICAgICAgICAgICAgLy8gZG93biBieSBhY2NpZGVudCBsZXNzLCBlc3BlY2lhbGx5IHdoZW4gcHVzaGluZyBvcGVuIGEgZGV2aWNlIHdpdGggYSBrZXlib2FyZAorICAgICAgICAgICAgICAgIC8vIHRoYXQgcm90YXRlcyAobGlrZSBnMSBhbmQgZHJvaWQpCisgICAgICAgICAgICAgICAgaW50IHggPSAoaW50KWV2ZW50LmdldFJhd1goKTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZWRnZUJvcmRlciA9IG1FZGdlQm9yZGVyOworICAgICAgICAgICAgICAgIGlmICh4ID49IGVkZ2VCb3JkZXIgJiYgeCA8IG1EaXNwbGF5LmdldFdpZHRoKCkgLSBlZGdlQm9yZGVyKSB7CisgICAgICAgICAgICAgICAgICAgIHByZXBhcmVUcmFja2luZyh5LCAhbUV4cGFuZGVkKTsvLyBvcGVuaW5nIGlmIHdlJ3JlIG5vdCBhbHJlYWR5IGZ1bGx5IHZpc2libGUKKyAgICAgICAgICAgICAgICAgICAgbVZlbG9jaXR5VHJhY2tlci5hZGRNb3ZlbWVudChldmVudCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKG1UcmFja2luZykgeworICAgICAgICAgICAgbVZlbG9jaXR5VHJhY2tlci5hZGRNb3ZlbWVudChldmVudCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgbWluWSA9IHN0YXR1c0JhclNpemUgKyBtQ2xvc2VWaWV3LmdldEhlaWdodCgpOworICAgICAgICAgICAgaWYgKGV2ZW50LmdldEFjdGlvbigpID09IE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFKSB7CisgICAgICAgICAgICAgICAgaW50IHkgPSAoaW50KWV2ZW50LmdldFJhd1koKTsKKyAgICAgICAgICAgICAgICBpZiAobUFuaW1hdGluZ1JldmVhbCAmJiB5IDwgbWluWSkgeworICAgICAgICAgICAgICAgICAgICAvLyBub3RoaW5nCisgICAgICAgICAgICAgICAgfSBlbHNlICB7CisgICAgICAgICAgICAgICAgICAgIG1BbmltYXRpbmdSZXZlYWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgdXBkYXRlRXhwYW5kZWRWaWV3UG9zKHkgKyBtVmlld0RlbHRhKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50LmdldEFjdGlvbigpID09IE1vdGlvbkV2ZW50LkFDVElPTl9VUCkgeworICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIuY29tcHV0ZUN1cnJlbnRWZWxvY2l0eSgxMDAwKTsKKworICAgICAgICAgICAgICAgIGZsb2F0IHlWZWwgPSBtVmVsb2NpdHlUcmFja2VyLmdldFlWZWxvY2l0eSgpOworICAgICAgICAgICAgICAgIGJvb2xlYW4gbmVnYXRpdmUgPSB5VmVsIDwgMDsKKworICAgICAgICAgICAgICAgIGZsb2F0IHhWZWwgPSBtVmVsb2NpdHlUcmFja2VyLmdldFhWZWxvY2l0eSgpOworICAgICAgICAgICAgICAgIGlmICh4VmVsIDwgMCkgeworICAgICAgICAgICAgICAgICAgICB4VmVsID0gLXhWZWw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICh4VmVsID4gMTUwLjBmKSB7CisgICAgICAgICAgICAgICAgICAgIHhWZWwgPSAxNTAuMGY7IC8vIGxpbWl0IGhvdyBtdWNoIHdlIGNhcmUgYWJvdXQgdGhlIHggYXhpcworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGZsb2F0IHZlbCA9IChmbG9hdClNYXRoLmh5cG90KHlWZWwsIHhWZWwpOworICAgICAgICAgICAgICAgIGlmIChuZWdhdGl2ZSkgeworICAgICAgICAgICAgICAgICAgICB2ZWwgPSAtdmVsOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHBlcmZvcm1GbGluZygoaW50KWV2ZW50LmdldFJhd1koKSwgdmVsLCBmYWxzZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0TGlnaHRzT24oYm9vbGVhbiBvbikgeworICAgICAgICBpZiAoIW9uKSB7CisgICAgICAgICAgICAvLyBBbGwgd2UgZG8gZm9yICJsaWdodHMgb3V0IiBtb2RlIG9uIGEgcGhvbmUgaXMgaGlkZSB0aGUgc3RhdHVzIGJhciwKKyAgICAgICAgICAgIC8vIHdoaWNoIHRoZSB3aW5kb3cgbWFuYWdlciBkb2VzLiAgQnV0IHdlIGRvIG5lZWQgdG8gaGlkZSB0aGUgd2luZG93c2hhZGUKKyAgICAgICAgICAgIC8vIG9uIG91ciBvd24uCisgICAgICAgICAgICBhbmltYXRlQ29sbGFwc2UoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIE5vdCBzdXBwb3J0ZWQKKyAgICBwdWJsaWMgdm9pZCBzZXRNZW51S2V5VmlzaWJsZShib29sZWFuIHZpc2libGUpIHsgfQorICAgIHB1YmxpYyB2b2lkIHNldElNRUJ1dHRvblZpc2libGUoYm9vbGVhbiB2aXNpYmxlKSB7IH0KKworICAgIHByaXZhdGUgY2xhc3MgTGF1bmNoZXIgaW1wbGVtZW50cyBWaWV3Lk9uQ2xpY2tMaXN0ZW5lciB7CisgICAgICAgIHByaXZhdGUgUGVuZGluZ0ludGVudCBtSW50ZW50OworICAgICAgICBwcml2YXRlIFN0cmluZyBtUGtnOworICAgICAgICBwcml2YXRlIFN0cmluZyBtVGFnOworICAgICAgICBwcml2YXRlIGludCBtSWQ7CisKKyAgICAgICAgTGF1bmNoZXIoUGVuZGluZ0ludGVudCBpbnRlbnQsIFN0cmluZyBwa2csIFN0cmluZyB0YWcsIGludCBpZCkgeworICAgICAgICAgICAgbUludGVudCA9IGludGVudDsKKyAgICAgICAgICAgIG1Qa2cgPSBwa2c7CisgICAgICAgICAgICBtVGFnID0gdGFnOworICAgICAgICAgICAgbUlkID0gaWQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAvLyBUaGUgaW50ZW50IHdlIGFyZSBzZW5kaW5nIGlzIGZvciB0aGUgYXBwbGljYXRpb24sIHdoaWNoCisgICAgICAgICAgICAgICAgLy8gd29uJ3QgaGF2ZSBwZXJtaXNzaW9uIHRvIGltbWVkaWF0ZWx5IHN0YXJ0IGFuIGFjdGl2aXR5IGFmdGVyCisgICAgICAgICAgICAgICAgLy8gdGhlIHVzZXIgc3dpdGNoZXMgdG8gaG9tZS4gIFdlIGtub3cgaXQgaXMgc2FmZSB0byBkbyBhdCB0aGlzCisgICAgICAgICAgICAgICAgLy8gcG9pbnQsIHNvIG1ha2Ugc3VyZSBuZXcgYWN0aXZpdHkgc3dpdGNoZXMgYXJlIG5vdyBhbGxvd2VkLgorICAgICAgICAgICAgICAgIEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCkucmVzdW1lQXBwU3dpdGNoZXMoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtSW50ZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpbnRbXSBwb3MgPSBuZXcgaW50WzJdOworICAgICAgICAgICAgICAgIHYuZ2V0TG9jYXRpb25PblNjcmVlbihwb3MpOworICAgICAgICAgICAgICAgIEludGVudCBvdmVybGF5ID0gbmV3IEludGVudCgpOworICAgICAgICAgICAgICAgIG92ZXJsYXkuc2V0U291cmNlQm91bmRzKAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFJlY3QocG9zWzBdLCBwb3NbMV0sIHBvc1swXSt2LmdldFdpZHRoKCksIHBvc1sxXSt2LmdldEhlaWdodCgpKSk7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgbUludGVudC5zZW5kKG1Db250ZXh0LCAwLCBvdmVybGF5KTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChQZW5kaW5nSW50ZW50LkNhbmNlbGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhlIHN0YWNrIHRyYWNlIGlzbid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ZXJ3aXNlPyAgQW5kIHRyeWluZyB0bworICAgICAgICAvLyBydW4gYSB0aWNrZXIgd2l0aG91dCBiZWluZyBhdHRhY2hlZCB3aWxsIGNyYXNoIQorICAgICAgICBpZiAobi5ub3RpZmljYXRpb24udGlja2VyVGV4dCAhPSBudWxsICYmIG1TdGF0dXNCYXJWaWV3LmdldFdpbmRvd1Rva2VuKCkgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKDAgPT0gKG1EaXNhYmxlZCAmIChTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfTk9USUZJQ0FUSU9OX0lDT05TCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfTk9USUZJQ0FUSU9OX1RJQ0tFUikpKSB7CisgICAgICAgICAgICAgICAgbVRpY2tlci5hZGRFbnRyeShuKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENhbmNlbCB0aGlzIG5vdGlmaWNhdGlvbiBhbmQgdGVsbCB0aGUgU3RhdHVzQmFyTWFuYWdlclNlcnZpY2UgLyBOb3RpZmljYXRpb25NYW5hZ2VyU2VydmljZQorICAgICAqIGFib3V0IHRoZSBmYWlsdXJlLgorICAgICAqCisgICAgICogV0FSTklORzogdGhpcyB3aWxsIGNhbGwgYmFjayBpbnRvIHVzLiAgRG9uJ3QgaG9sZCBhbnkgbG9ja3MuCisgICAgICovCisgICAgdm9pZCBoYW5kbGVOb3RpZmljYXRpb25FcnJvcihJQmluZGVyIGtleSwgU3RhdHVzQmFyTm90aWZpY2F0aW9uIG4sIFN0cmluZyBtZXNzYWdlKSB7CisgICAgICAgIHJlbW92ZU5vdGlmaWNhdGlvbihrZXkpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbUJhclNlcnZpY2Uub25Ob3RpZmljYXRpb25FcnJvcihuLnBrZywgbi50YWcsIG4uaWQsIG4udWlkLCBuLmluaXRpYWxQaWQsIG1lc3NhZ2UpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgIC8vIFRoZSBlbmQgaXMgbmlnaC4KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgTXlUaWNrZXIgZXh0ZW5kcyBUaWNrZXIgeworICAgICAgICBNeVRpY2tlcihDb250ZXh0IGNvbnRleHQsIFZpZXcgc2IpIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIHNiKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCB0aWNrZXJTdGFydGluZygpIHsKKyAgICAgICAgICAgIG1UaWNraW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIG1JY29ucy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICBtVGlja2VyVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICBtVGlja2VyVmlldy5zdGFydEFuaW1hdGlvbihsb2FkQW5pbShjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0ucHVzaF91cF9pbiwgbnVsbCkpOworICAgICAgICAgICAgbUljb25zLnN0YXJ0QW5pbWF0aW9uKGxvYWRBbmltKGNvbS5hbmRyb2lkLmludGVybmFsLlIuYW5pbS5wdXNoX3VwX291dCwgbnVsbCkpOworICAgICAgICAgICAgaWYgKG1FeHBhbmRlZFZpc2libGUpIHsKKyAgICAgICAgICAgICAgICBzZXREYXRlVmlld1Zpc2liaWxpdHkoZmFsc2UsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYW5pbS5wdXNoX3VwX291dCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgdGlja2VyRG9uZSgpIHsKKyAgICAgICAgICAgIG1JY29ucy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICBtVGlja2VyVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICBtSWNvbnMuc3RhcnRBbmltYXRpb24obG9hZEFuaW0oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hbmltLnB1c2hfZG93bl9pbiwgbnVsbCkpOworICAgICAgICAgICAgbVRpY2tlclZpZXcuc3RhcnRBbmltYXRpb24obG9hZEFuaW0oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hbmltLnB1c2hfZG93bl9vdXQsCisgICAgICAgICAgICAgICAgICAgICAgICBtVGlja2luZ0RvbmVMaXN0ZW5lcikpOworICAgICAgICAgICAgaWYgKG1FeHBhbmRlZFZpc2libGUpIHsKKyAgICAgICAgICAgICAgICBzZXREYXRlVmlld1Zpc2liaWxpdHkodHJ1ZSwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hbmltLnB1c2hfZG93bl9pbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCB0aWNrZXJIYWx0aW5nKCkgeworICAgICAgICAgICAgbUljb25zLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgIG1UaWNrZXJWaWV3LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgIG1JY29ucy5zdGFydEFuaW1hdGlvbihsb2FkQW5pbShjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0uZmFkZV9pbiwgbnVsbCkpOworICAgICAgICAgICAgbVRpY2tlclZpZXcuc3RhcnRBbmltYXRpb24obG9hZEFuaW0oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hbmltLmZhZGVfb3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgbVRpY2tpbmdEb25lTGlzdGVuZXIpKTsKKyAgICAgICAgICAgIGlmIChtRXhwYW5kZWRWaXNpYmxlKSB7CisgICAgICAgICAgICAgICAgc2V0RGF0ZVZpZXdWaXNpYmlsaXR5KHRydWUsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYW5pbS5mYWRlX2luKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIEFuaW1hdGlvbi5BbmltYXRpb25MaXN0ZW5lciBtVGlja2luZ0RvbmVMaXN0ZW5lciA9IG5ldyBBbmltYXRpb24uQW5pbWF0aW9uTGlzdGVuZXIoKSB7OworICAgICAgICBwdWJsaWMgdm9pZCBvbkFuaW1hdGlvbkVuZChBbmltYXRpb24gYW5pbWF0aW9uKSB7CisgICAgICAgICAgICBtVGlja2luZyA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uUmVwZWF0KEFuaW1hdGlvbiBhbmltYXRpb24pIHsKKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgdm9pZCBvbkFuaW1hdGlvblN0YXJ0KEFuaW1hdGlvbiBhbmltYXRpb24pIHsKKyAgICAgICAgfQorICAgIH07CisKKyAgICBwcml2YXRlIEFuaW1hdGlvbiBsb2FkQW5pbShpbnQgaWQsIEFuaW1hdGlvbi5BbmltYXRpb25MaXN0ZW5lciBsaXN0ZW5lcikgeworICAgICAgICBBbmltYXRpb24gYW5pbSA9IEFuaW1hdGlvblV0aWxzLmxvYWRBbmltYXRpb24obUNvbnRleHQsIGlkKTsKKyAgICAgICAgaWYgKGxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIGFuaW0uc2V0QW5pbWF0aW9uTGlzdGVuZXIobGlzdGVuZXIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBhbmltOworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmcgdmlld0luZm8oVmlldyB2KSB7CisgICAgICAgIHJldHVybiAiKCIgKyB2LmdldExlZnQoKSArICIsIiArIHYuZ2V0VG9wKCkgKyAiKSgiICsgdi5nZXRSaWdodCgpICsgIiwiICsgdi5nZXRCb3R0b20oKQorICAgICAgICAgICAgICAgICsgIiAiICsgdi5nZXRXaWR0aCgpICsgIngiICsgdi5nZXRIZWlnaHQoKSArICIpIjsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBkdW1wKEZpbGVEZXNjcmlwdG9yIGZkLCBQcmludFdyaXRlciBwdywgU3RyaW5nW10gYXJncykgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1RdWV1ZUxvY2spIHsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIkN1cnJlbnQgU3RhdHVzIEJhciBzdGF0ZToiKTsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbUV4cGFuZGVkPSIgKyBtRXhwYW5kZWQKKyAgICAgICAgICAgICAgICAgICAgKyAiLCBtRXhwYW5kZWRWaXNpYmxlPSIgKyBtRXhwYW5kZWRWaXNpYmxlKTsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbVRpY2tpbmc9IiArIG1UaWNraW5nKTsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbVRyYWNraW5nPSIgKyBtVHJhY2tpbmcpOworICAgICAgICAgICAgcHcucHJpbnRsbigiICBtQW5pbWF0aW5nPSIgKyBtQW5pbWF0aW5nCisgICAgICAgICAgICAgICAgICAgICsgIiwgbUFuaW1ZPSIgKyBtQW5pbVkgKyAiLCBtQW5pbVZlbD0iICsgbUFuaW1WZWwKKyAgICAgICAgICAgICAgICAgICAgKyAiLCBtQW5pbUFjY2VsPSIgKyBtQW5pbUFjY2VsKTsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbUN1ckFuaW1hdGlvblRpbWU9IiArIG1DdXJBbmltYXRpb25UaW1lCisgICAgICAgICAgICAgICAgICAgICsgIiBtQW5pbUxhc3RUaW1lPSIgKyBtQW5pbUxhc3RUaW1lKTsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbURpc3BsYXlIZWlnaHQ9IiArIG1EaXNwbGF5SGVpZ2h0CisgICAgICA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0bGU6ICIgKyB2aWV3SW5mbyhtTm9Ob3RpZmljYXRpb25zVGl0bGUpKTsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbUNsb3NlVmlldzogIiArIHZpZXdJbmZvKG1DbG9zZVZpZXcpKTsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbVRpY2tlclZpZXc6ICIgKyB2aWV3SW5mbyhtVGlja2VyVmlldykpOworICAgICAgICAgICAgcHcucHJpbnRsbigiICBtU2Nyb2xsVmlldzogIiArIHZpZXdJbmZvKG1TY3JvbGxWaWV3KQorICAgICAgICAgICAgICAgICAgICArICIgc2Nyb2xsICIgKyBtU2Nyb2xsVmlldy5nZXRTY3JvbGxYKCkgKyAiLCIgKyBtU2Nyb2xsVmlldy5nZXRTY3JvbGxZKCkpOworICAgICAgICAgICAgcHcucHJpbnRsbigibU5vdGlmaWNhdGlvbkxpbmVhckxheW91dDogIiArIHZpZXdJbmZvKG1Ob3RpZmljYXRpb25MaW5lYXJMYXlvdXQpKTsKKyAgICAgICAgfQorICAgICAgICAvKgorICAgICAgICBzeW5jaHJvbml6ZWQgKG1Ob3RpZmljYXRpb25EYXRhKSB7CisgICAgICAgICAgICBpbnQgTiA9IG1Ob3RpZmljYXRpb25EYXRhLm9uZ29pbmdDb3VudCgpOworICAgICAgICAgICAgcHcucHJpbnRsbigiICBvbmdvaW5nQ291bnQuc2l6ZT0iICsgTik7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgU3RhdHVzQmFyTm90aWZpY2F0aW9uIG4gPSBtTm90aWZpY2F0aW9uRGF0YS5nZXRPbmdvaW5nKGkpOworICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgICBbIiArIGkgKyAiXSBrZXk9IiArIG4ua2V5ICsgIiB2aWV3PSIgKyBuLnZpZXcpOworICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgICAgICAgICAgZGF0YT0iICsgbi5kYXRhKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIE4gPSBtTm90aWZpY2F0aW9uRGF0YS5sYXRlc3RDb3VudCgpOworICAgICAgICAgICAgcHcucHJpbnRsbigiICBvbmdvaW5nQ291bnQuc2l6ZT0iICsgTik7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgU3RhdHVzQmFyTm90aWZpY2F0aW9uIG4gPSBtTm90aWZpY2F0aW9uRGF0YS5nZXRMYXRlc3QoaSk7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICAgIFsiICsgaSArICJdIGtleT0iICsgbi5rZXkgKyAiIHZpZXc9IiArIG4udmlldyk7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICAgICAgICAgICBkYXRhPSIgKyBuLmRhdGEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgICovCisKKyAgICAgICAgaWYgKGZhbHNlKSB7CisgICAgICAgICAgICBwdy5wcmludGxuKCJzZWUgdGhlIGxvZ2NhdCBmb3IgYSBkdW1wIG9mIHRoZSB2aWV3cyB3ZSBoYXZlIGNyZWF0ZWQuIik7CisgICAgICAgICAgICAvLyBtdXN0IGhhcHBlbiBvbiB1aSB0aHJlYWQKKyAgICAgICAgICAgIG1IYW5kbGVyLnBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtU3RhdHVzQmFyVmlldy5nZXRMb2NhdGlvbk9uU2NyZWVuKG1BYnNQb3MpOworICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIm1TdGF0dXNCYXJWaWV3OiAtLS0tLSAoIiArIG1BYnNQb3NbMF0gKyAiLCIgKyBtQWJzUG9zWzFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIikgIiArIG1TdGF0dXNCYXJWaWV3LmdldFdpZHRoKCkgKyAieCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtU3RhdHVzQmFyVmlldy5nZXRIZWlnaHQoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtU3RhdHVzQmFyVmlldy5kZWJ1ZygpOworCisgICAgICAgICAgICAgICAgICAgICAgICBtRXhwYW5kZWRWaWV3LmdldExvY2F0aW9uT25TY3JlZW4obUFic1Bvcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAibUV4cGFuZGVkVmlldzogLS0tLS0gKCIgKyBtQWJzUG9zWzBdICsgIiwiICsgbUFic1Bvc1sxXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIpICIgKyBtRXhwYW5kZWRWaWV3LmdldFdpZHRoKCkgKyAieCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtRXhwYW5kZWRWaWV3LmdldEhlaWdodCgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1FeHBhbmRlZFZpZXcuZGVidWcoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgbVRyYWNraW5nVmlldy5nZXRMb2NhdGlvbk9uU2NyZWVuKG1BYnNQb3MpOworICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIm1UcmFja2luZ1ZpZXc6IC0tLS0tICgiICsgbUFic1Bvc1swXSArICIsIiArIG1BYnNQb3NbMV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiKSAiICsgbVRyYWNraW5nVmlldy5nZXRXaWR0aCgpICsgIngiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbVRyYWNraW5nVmlldy5nZXRIZWlnaHQoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVHJhY2tpbmdWaWV3LmRlYnVnKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHZvaWQgb25CY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QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpKTsKKyAgICAgICAgbUV4cGFuZGVkRGlhbG9nLmdldFdpbmRvdygpLnNldEJhY2tncm91bmREcmF3YWJsZShudWxsKTsKKyAgICAgICAgbUV4cGFuZGVkRGlhbG9nLnNob3coKTsKKyAgICAgICAgRnJhbWVMYXlvdXQgaGFjayA9IChGcmFtZUxheW91dCltRXhwYW5kZWRWaWV3LmdldFBhcmVudCgpOworICAgIH0KKworICAgIHZvaWQgc2V0RGF0ZVZpZXdWaXNpYmlsaXR5KGJvb2xlYW4gdmlzaWJsZSwgaW50IGFuaW0pIHsKKyAgICAgICAgbURhdGVWaWV3LnNldFVwZGF0ZXModmlzaWJsZSk7CisgICAgICAgIG1EYXRlVmlldy5zZXRWaXNpYmlsaXR5KHZpc2libGUgPyBWaWV3LlZJU0lCTEUgOiBWaWV3LklOVklTSUJMRSk7CisgICAgICAgIG1EYXRlVmlldy5zdGFydEFuaW1hdGlvbihsb2FkQW5pbShhbmltLCBudWxsKSk7CisgICAgfQorCisgICAgdm9pZCBzZXROb3RpZmljYXRpb25JY29uVmlzaWJpbGl0eShib29sZWFuIHZpc2libGUsIGludCBhbmltKSB7CisgICAgICAgIGludCBvbGQgPSBtTm90aWZpY2F0aW9uSWNvbnMuZ2V0VmlzaWJpbGl0eSgpOworICAgICAgICBpbnQgdiA9IHZpc2libGUgPyBWaWV3LlZJU0lCTEUgOiBWaWV3LklOVklTSUJMRTsKKyAgICAgICAgaWYgKG9sZCAhPSB2KSB7CisgICAgICAgICAgICBtTm90aWZpY2F0aW9uSWNvbnMuc2V0VmlzaWJpbGl0eSh2KTsKKyAgICAgICAgICAgIG1Ob3RpZmljYXRpb25JY29ucy5zdGFydEFuaW1hdGlvbihsb2FkQW5pbShhbmltLCBudWxsKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIHVwZGF0ZUV4cGFuZGVkVmlld1BvcyhpbnQgZXhwYW5kZWRQb3NpdGlvbikgeworICAgICAgICBpZiAoU1BFVykgeworICAgICAgICAgICAgU2xvZy5kKFRBRywgInVwZGF0ZUV4cGFuZGVkVmlld1BvcyBiZWZvcmUgZXhwYW5kZWRQb3NpdGlvbj0iICsgZXhwYW5kZWRQb3NpdGlvbgorICAgICAgICAgICAgICAgICAgICArICIgbVRyYWNraW5nUGFyYW1zLnk9IiArIG1UcmFja2luZ1BhcmFtcy55CisgICAgICAgICAgICAgICAgICAgICsgIiBtVHJhY2tpbmdQb3NpdGlvbj0iICsgbVRyYWNraW5nUG9zaXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgaW50IGggPSBtU3RhdHVzQmFyVmlldy5nZXRIZWlnaHQoKTsKKyAgICAgICAgaW50IGRpc3BoID0gbURpc3BsYXkuZ2V0SGVpZ2h0KCk7CisKKyAgICAgICAgLy8gSWYgdGhlIGV4cGFuZGVkIHZpZXcgaXMgbm90IHZpc2libGUsIG1ha2Ugc3VyZSB0aGV5J3JlIHN0aWxsIG9mZiBzY3JlZW4uCisgICAgICAgIC8vIE1heWJlIHRoZSB2aWV3IHdhcyByZXNpemVkLgorICAgICAgICBpZiAoIW1FeHBhbmRlZFZpc2libGUpIHsKKyAgICAgICAgICAgIGlmIChtVHJhY2tpbmdWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtVHJhY2tpbmdQb3NpdGlvbiA9IC1kaXNwaDsKKyAgICAgICAgICAgICAgICBpZiAobVRyYWNraW5nUGFyYW1zICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVRyYWNraW5nUGFyYW1zLnkgPSBtVHJhY2tpbmdQb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlckltcGwuZ2V0RGVmYXVsdCgpLnVwZGF0ZVZpZXdMYXlvdXQobVRyYWNraW5nVmlldywgbVRyYWNraW5nUGFyYW1zKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUV4cGFuZGVkUGFyYW1zICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtRXhwYW5kZWRQYXJhbXMueSA9IC1kaXNwaDsKKyAgICAgICAgICAgICAgICBtRXhwYW5kZWREaWFsb2cuZ2V0V2luZG93KCkuc2V0QXR0cmlidXRlcyhtRXhwYW5kZWRQYXJhbXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgLy8gdHJhY2tpbmcgdmlldy4uLgorICAgICAgICBpbnQgcG9zOworICAgICAgICBpZiAoZXhwYW5kZWRQb3NpdGlvbiA9PSBFWFBBTkRFRF9GVUxMX09QRU4pIHsKKyAgICAgICAgICAgIHBvcyA9IGg7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZXhwYW5kZWRQb3NpdGlvbiA9PSBFWFBBTkRFRF9MRUFWRV9BTE9ORSkgeworICAgICAgICAgICAgcG9zID0gbVRyYWNraW5nUG9zaXRpb247CisgICAgICAgIH0KKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBpZiAoZXhwYW5kZWRQb3NpdGlvbiA8PSBkaXNwaCkgeworICAgICAgICAgICAgICAgIHBvcyA9IGV4cGFuZGVkUG9zaXRpb247CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHBvcyA9IGRpc3BoOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcG9zIC09IGRpc3BoLWg7CisgICAgICAgIH0KKyAgICAgICAgbVRyYWNraW5nUG9zaXRpb24gPSBtVHJhY2tpbmdQYXJhbXMueSA9IHBvczsKKyAgICAgICAgbVRyYWNraW5nUGFyYW1zLmhlaWdodCA9IGRpc3BoLWg7CisgICAgICAgIFdpbmRvd01hbmFnZXJJbXBsLmdldERlZmF1bHQoKS51cGRhdGVWaWV3TGF5b3V0KG1UcmFja2luZ1ZpZXcsIG1UcmFja2luZ1BhcmFtcyk7CisKKyAgICAgICAgaWYgKG1FeHBhbmRlZFBhcmFtcyAhPSBudWxsKSB7CisgICAgICAgICAgICBtQ2xvc2VWaWV3LmdldExvY2F0aW9uSW5XaW5kb3cobVBvc2l0aW9uVG1wKTsKKyAgICAgICAgICAgIGZpbmFsIGludCBjbG9zZVBvcyA9IG1Qb3NpdGlvblRtcFsxXTsKKworICAgICAgICAgICAgbUV4cGFuZGVkQ29udGVudHMuZ2V0TG9jYXRpb25JbldpbmRvdyhtUG9zaXRpb25UbXApOworICAgICAgICAgICAgZmluYWwgaW50IGNvbnRlbnRzQm90dG9tID0gbVBvc2l0aW9uVG1wWzFdICsgbUV4cGFuZGVkQ29udGVudHMuZ2V0SGVpZ2h0KCk7CisKKyAgICAgICAgICAgIG1FeHBhbmRlZFBhcmFtcy55ID0gcG9zICsgbVRyYWNraW5nVmlldy5nZXRIZWlnaHQoKQorICAgICAgICAgICAgICAgICAgICAtIChtVHJhY2tpbmdQYXJhbXMuaGVpZ2h0LWNsb3NlUG9zKSAtIGNvbnRlbnRzQm90dG9tOworICAgICAgICAgICAgaW50IG1heCA9IGg7CisgICAgICAgICAgICBpZiAobUV4cGFuZGVkUGFyYW1zLnkgPiBtYXgpIHsKKyAgICAgICAgICAgICAgICBtRXhwYW5kZWRQYXJhbXMueSA9IG1heDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBtaW4gPSBtVHJhY2tpbmdQb3NpdGlvbjsKKyAgICAgICAgICAgIGlmIChtRXhwYW5kZWRQYXJhbXMueSA8IG1pbikgeworICAgICAgICAgICAgICAgIG1FeHBhbmRlZFBhcmFtcy55ID0gbWluOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBib29sZWFuIHZpc2libGUgPSAobVRyYWNraW5nUG9zaXRpb24gKyBtVHJhY2tpbmdWaWV3LmdldEhlaWdodCgpKSA+IGg7CisgICAgICAgICAgICBpZiAoIXZpc2libGUpIHsKKyAgICAgICAgICAgICAg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ZmICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX0VYUEFORCkgIT0gMCkgeworICAgICAgICAgICAgaWYgKChuZXQgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfRVhQQU5EKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkRJU0FCTEVfRVhQQU5EOiB5ZXMiKTsKKyAgICAgICAgICAgICAgICBhbmltYXRlQ29sbGFwc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoKGRpZmYgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfTk9USUZJQ0FUSU9OX0lDT05TKSAhPSAwKSB7CisgICAgICAgICAgICBpZiAoKG5ldCAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9OT1RJRklDQVRJT05fSUNPTlMpICE9IDApIHsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiRElTQUJMRV9OT1RJRklDQVRJT05fSUNPTlM6IHllcyIpOworICAgICAgICAgICAgICAgIGlmIChtVGlja2luZykgeworICAgICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uSWNvbnMuc2V0VmlzaWJpbGl0eShWaWV3LklOVklTSUJMRSk7CisgICAgICAgICAgICAgICAgICAgIG1UaWNrZXIuaGFsdCgpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNldE5vdGlmaWNhdGlvbkljb25WaXNpYmlsaXR5KGZhbHNlLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0uZmFkZV9vdXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkRJU0FCTEVfTk9USUZJQ0FUSU9OX0lDT05TOiBubyIpOworICAgICAgICAgICAgICAgIGlmICghbUV4cGFuZGVkVmlzaWJsZSkgeworICAgICAgICAgICAgICAgICAgICBzZXROb3RpZmljYXRpb25JY29uVmlzaWJpbGl0eSh0cnVlLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0uZmFkZV9pbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKChkaWZmICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05PVElGSUNBVElPTl9USUNLRVIpICE9IDApIHsKKyAgICAgICAgICAgIGlmIChtVGlja2luZyAmJiAobmV0ICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05PVElGSUNBVElPTl9USUNLRVIpICE9IDApIHsKKyAgICAgICAgICAgICAgICBtVGlja2VyLmhhbHQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgVmlldy5PbkNsaWNrTGlzdGVuZXIgbUNsZWFyQnV0dG9uTGlzdGVuZXIgPSBuZXcgVmlldy5PbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1CYXJTZXJ2aWNlLm9uQ2xlYXJBbGxOb3RpZmljYXRpb25zKCk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAvLyBzeXN0ZW0gcHJvY2VzcyBpcyBkZWFkIGlmIHdlJ3JlIGhlcmUuCisgICAgICAgICAgICB9CisgICAgICAgICAgICBhbmltYXRlQ29sbGFwc2UoKTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICBwcml2YXRlIEJyb2FkY2FzdFJlY2VpdmVyIG1Ccm9hZGNhc3RSZWNlaXZlciA9IG5ldyBCcm9hZGNhc3RSZWNlaXZlcigpIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludG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C5vcy5WaWJyYXRvciltQ29udGV4dC5nZXRTeXN0ZW1TZXJ2aWNlKAorICAgICAgICAgICAgICAgIENvbnRleHQuVklCUkFUT1JfU0VSVklDRSk7CisgICAgICAgIHZpYi52aWJyYXRlKDI1MCk7CisgICAgfQorCisgICAgUnVubmFibGUgbVN0YXJ0VHJhY2luZyA9IG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgdmlicmF0ZSgpOworICAgICAgICAgICAgU3lzdGVtQ2xvY2suc2xlZXAoMjUwKTsKKyAgICAgICAgICAgIFNsb2cuZChUQUcsICJzdGFydFRyYWNpbmciKTsKKyAgICAgICAgICAgIGFuZHJvaWQub3MuRGVidWcuc3RhcnRNZXRob2RUcmFjaW5nKCIvZGF0YS9zdGF0dXNiYXItdHJhY2VzL3RyYWNlIik7CisgICAgICAgICAgICBtSGFuZGxlci5wb3N0RGVsYXllZChtU3RvcFRyYWNpbmcsIDEwMDAwKTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICBSdW5uYWJsZSBtU3RvcFRyYWNpbmcgPSBuZXcgUnVubmFibGUoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIGFuZHJvaWQub3MuRGVidWcuc3RvcE1ldGhvZFRyYWNpbmcoKTsKKyAgICAgICAgICAgIFNsb2cuZChUQUcsICJzdG9wVHJhY2luZyIpOworICAgICAgICAgICAgdmlicmF0ZSgpOworICAgICAgICB9CisgICAgfTsKK30KKwpkaWZmIC0tZ2l0IGEvcGFja2FnZXMvU3lzdGVtVUkvc3JjL2NvbS9hbmRyb2lkL3N5c3RlbXVpL3N0YXR1c2Jhci9TdGF0dXNCYXJQb2xpY3kuamF2YSBiL3BhY2thZ2VzL1N5c3RlbVVJL3NyYy9jb20vYW5kcm9pZC9zeXN0ZW11aS9zdGF0dXNiYXIvU3RhdHVzQmFyUG9saWN5LmphdmEKaW5kZXggOWVm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xJY29uSWQ7CkBAIC0zMTksOSArMjk4LDYgQEAKICAgICBwcml2YXRlIGJvb2xlYW4gbVZvbHVtZVZpc2libGU7CiAKICAgICAvLyBibHVldG9vdGggZGV2aWNlIHN0YXR1cwotICAgIHByaXZhdGUgaW50IG1CbHVldG9vdGhIZWFkc2V0U3RhdGU7Ci0gICAgcHJpdmF0ZSBib29sZWFuIG1CbHVldG9vdGhBMmRwQ29ubmVjdGVkOwotICAgIHByaXZhdGUgaW50IG1CbHVldG9vdGhQYmFwU3RhdGU7CiAgICAgcHJpdmF0ZSBib29sZWFuIG1CbHVldG9vdGhFbmFibGVkOwogCiAgICAgLy8gd2lmaQpAQCAtMzYxLDE3ICszMzcsOCBAQAogICAgICAgICAgICAgZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhJbnRlbnQuQUNUSU9OX1NZTkNfU1RBVEVfQ0hBTkdFRCkpIHsKICAgICAgICAgICAgICAgICB1cGRhdGVTeW5jU3RhdGUoaW50ZW50KTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9CQVRURVJZX0xPVykpIHsKLSAgICAgICAgICAgICAgICBvbkJhdHRlcnlMb3coaW50ZW50KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9CQVRURVJZX09LQVkpCi0gICAgICAgICAgICAgICAgICAgIHx8IGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9QT1dFUl9DT05ORUNURUQpKSB7Ci0gICAgICAgICAgICAgICAgb25CYXR0ZXJ5T2theShpbnRlbnQpOwotICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhBZGFwdGVyLkFDVElPTl9TVEFURV9DSEFOR0VEKSB8fAotICAgICAgICAgICAgICAgICAgICBhY3Rpb24uZXF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cHRlci5BQ1RJT05fQ09OTkVDVElPTl9TVEFURV9DSEFOR0VEKTsKICAgICAgICAgZmlsdGVyLmFkZEFjdGlvbihXaWZpTWFuYWdlci5XSUZJX1NUQVRFX0NIQU5HRURfQUNUSU9OKTsKICAgICAgICAgZmlsdGVyLmFkZEFjdGlvbihXaWZpTWFuYWdlci5TVVBQTElDQU5UX0NPTk5FQ1RJT05fQ0hBTkdFX0FDVElPTik7CiAgICAgICAgIGZpbHRlci5hZGRBY3Rpb24oV2lmaU1hbmFnZXIuTkVUV09SS19TVEFURV9DSEFOR0VEX0FDVElPTik7CkBAIC01MzEsMTc5ICs0OTAsNiBAQAogICAgICAgICBmaW5hbCBpbnQgaWQgPSBpbnRlbnQuZ2V0SW50RXh0cmEoImljb24tc21hbGwiLCAwKTsKICAgICAgICAgaW50IGxldmVsID0gaW50ZW50LmdldEludEV4dHJhKCJsZXZlbCIsIDApOwogICAgICAgICBtU2VydmljZS5zZXRJY29uKCJiYXR0ZXJ5IiwgaWQsIGxldmVsKTsKLQotICAgICAgICBib29sZWFuIHBsdWdnZWQgPSBpbnRlbnQuZ2V0SW50RXh0cmEoInBsdWdnZWQiLCAwKSAhPSAwOwotICAgICAgICBsZXZlbCA9IGludGVudC5nZXRJbnRFeHRyYSgibGV2ZWwiLCAtMSk7Ci0gICAgICAgIGlmIChmYWxzZSkgewotICAgICAgICAgICAgU2xvZy5kKFRBRywgInVwZGF0ZUJhdHRlcnkgbGV2ZWw9IiArIGxldmVsCi0gICAgICAgICAgICAgICAgICAgICsgIiBwbHVnZ2VkPSIgKyBwbHVnZ2VkCi0gICAgICAgICAgICAgICAgICAgICsgIiBtQmF0dGVyeVBsdWdnZWQ9IiArIG1CYXR0ZXJ5UGx1Z2dlZAotICAgICAgICAgICAgICAgICAgICArICIgbUJhdHRlcnlMZXZlbD0iICsgbUJhdHRlcnlMZXZlbAotICAgICAgICAgICAgICAgICAgICArICIgbUJhdHRlcnlGaXJzdD0iICsgbUJhdHRlcnlGa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LSAgICAgICAgICAgIG1CYXR0ZXJ5TGV2ZWxUZXh0Vmlldz0oVGV4dFZpZXcpdi5maW5kVmlld0J5SWQoUi5pZC5sZXZlbF9wZXJjZW50KTsKLQotICAgICAgICAgICAgbUJhdHRlcnlMZXZlbFRleHRWaWV3LnNldFRleHQobGV2ZWxUZXh0KTsKLQotICAgICAgICAgICAgQWxlcnREaWFsb2cuQnVpbGRlciBiID0gbmV3IEFsZXJ0RGlhbG9nLkJ1aWxkZXIobUNvbnRleHQpOwotICAgICAgICAgICAgICAgIGIuc2V0Q2FuY2VsYWJsZSh0cnVlKTsKLSAgICAgICAgICAgICAgICBiLnNldFRpdGxlKFIuc3RyaW5nLmJhdHRlcnlfbG93X3RpdGxlKTsKLSAgICAgICAgICAgICAgICBiLnNldFZpZXcodik7Ci0gICAgICAgICAgICAgICAgYi5zZXRJY29uKGFuZHJvaWQuUi5kcmF3YWJsZS5pY19kaWFsb2dfYWxlcnQpOwotICAgICAgICAgICAgICAgIGIuc2V0UG9zaXRpdmVCdXR0b24oYW5kcm9pZC5SLnN0cmluZy5vaywgbnVsbCk7Ci0KLSAgICAgICAgICAgICAgICBmaW5hbCBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX1BPV0VSX1VTQUdFX1NVTU1BUlkpOwotICAgICAgICAgICAgICAgIGludGVudC5zZXRGbGFncyhJbnRlbnQuRkxBR19BQ1RJVklUWV9ORVdfVEFTSwotICAgICAgICAgICAgICAgICAgICAgICAgfCBJbnRlbnQuRkxBR19BQ1RJVklUWV9NVUxUSVBMRV9UQVNLCi0gICAgICAgICAgICAgICAgICAgICAgICB8IEludGVudC5GTEFHX0FDVElWSVRZX0VYQ0xVREVfRlJPTV9SRUNFTlRTCi0gICAgICAgICAgICAgICAgICAgICAgICB8IEludGVudC5GTEFHX0FDVElWSVRZX05PX0hJU1RPUlkpOwotICAgICAgICAgICAgICAgIGlmIChpbnRlbnQucmVzb2x2ZUFjdGl2aXR5KG1Db250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCkpICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgYi5zZXROZWdhdGl2ZUJ1dHRvbihSLnN0cmluZy5iYXR0ZXJ5X2xvd193aHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKERpYWxvZ0ludGVyZmFjZSBkaWFsb2csIGludCB3aGljaCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LnN0YXJ0QWN0aXZpdHkoaW50ZW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUxvd0JhdHRlcnlEaWFsb2cgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTG93QmF0dGVyeURpYWxvZy5kaXNtaXNzKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9KTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIEFsZXJ0RGlhbG9nIGQgPSBiLmNyZWF0ZSgpOwotICAgICAgICAgICAgZC5zZXRPbkRpc21pc3NMaXN0ZW5lcihtTG93QmF0dGVyeUxpc3RlbmVyKTsKLSAgICAgICAgICAgIGQuZ2V0V2luZG93KCkuc2V0VHlwZShXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5UWVBFX1NZU1RFTV9BTEVSVCk7Ci0gICAgICAgICAgICBkLnNob3coKTsKLSAgICAgICAgICAgIG1Mb3dCYXR0ZXJ5RGlhbG9nID0gZDsKLSAgICAgICAgfQotCi0gICAgICAgIGZpbmFsIENvbnRlbnRSZXNvbHZlciBjciA9IG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpOwotICAgICAgICBpZiAoU2V0dGluZ3MuU3lzdGVtLmdldEludChjciwKLSAgICAgICAgICAgICAgICBTZXR0aW5ncy5TeXN0ZW0uUE9XRVJfU09VTkRTX0VOQUJMRUQsIDEpID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBzb3VuZFBhdGggPSBTZXR0aW5ncy5TeXN0ZW0uZ2V0U3RyaW5nKGNyLAotICAgICAgICAgICAgICAgIFNldHRpbmdzLlN5c3RlbS5MT1dfQkFUVEVSWV9TT1VORCk7Ci0gICAgICAgICAgICBpZiAoc291bmRQYXRoICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBVcmkgc291bmRVcmkgPSBVcmkucGFyc2UoImZpbGU6Ly8iICsgc291bmRQYXRoKTsKLSAgICAgICAgICAgICAgICBpZiAoc291bmRVcmkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBmaW5hbCBSaW5ndG9uZSBzZnggPSBSaW5ndG9uZU1hbmFnZXIuZ2V0UmluZ3RvbmUobUNvbnRleHQsIHNvdW5kVXJpKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHNmeCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZnguc2V0U3RyZWFtVHlwZShBdWRpb01hbmFnZXIuU1RSRUFNX1NZU1RFTSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZngucGxheSgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBmaW5hbCB2b2lkIHVwZGF0ZUNhbGxTdGF0ZShpbnQgc3RhdGUpIHsKLSAgICAgICAgbVBob25lU3RhdGUgPSBzdGF0ZTsKLSAgICAgICAgaWYgKGZhbHNlKSB7Ci0gICAgICAgICAgICBTbG9nLmQoVEFHLCAibVBob25lU3RhdGU9IiArIG1QaG9uZVN0YXRlCi0gICAgICAgICAgICAgICAgICAgICsgIiBtTG93QmF0dGVyeURpYWxvZz0iICsgbUxvd0JhdHRlcnlEaWFsb2cKLSAgICAgICAgICAgICAgICAgICAgKyAiIG1CYXR0ZXJ5U2hvd0xvd09uRW5kQ2FsbD0iICsgbUJhdHRlcnlTaG93TG93T25FbmRDYWxsKTsKLSAgICAgICAgfQotICAgICAgICBpZiAobVBob25lU3RhdGUgPT0gVGVsZXBob255TWFuYWdlci5DQUxMX1NUQVRFX0lETEUpIHsKLSAgICAgICAgICAgIGlmIChtQmF0dGVyeVNob3dMb3dPbkVuZENhbGwpIHsKLSAgICAgICAgICAgICAgICBpZiAoIW1CYXR0ZXJ5UGx1Z2dlZCkgewotICAgICAgICAgICAgICAgICAgICBzaG93TG93QmF0dGVyeVdhcm5pbmcoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUJhdHRlcnlTaG93TG93T25FbmRDYWxsID0gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAobUxvd0JhdHRlcnlEaWFsb2cgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1Mb3dCYXR0ZXJ5RGlhbG9nLmRpc21pc3MoKTsKLSAgICAgICAgICAgICAgICBtQmF0dGVyeVNob3dMb3dPbkVuZENhbGwgPSB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBEaWFsb2dJbnRlcmZhY2UuT25EaXNtaXNzTGlzdGVuZXIgbUxvd0JhdHRlcnlMaXN0ZW5lcgotICAgICAgICAgICAgPSBuZXcgRGlhbG9nSW50ZXJmYWNlLk9uRGlzbWlzc0xpc3RlbmVyKCkgewotICAgICAgICBwdWJsaWMgdm9pZCBvbkRpc21pc3MoRGlhbG9nSW50ZXJmYWNlIGRpYWxvZykgewotICAgICAgICAgICAgbUxvd0JhdHRlcnlEaWFsb2cgPSBud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F3YWJsZS5zdGF0X3N5c19kYXRhX2JsdWV0b290aF9jb25uZWN0ZWQ7Ci0gICAgICAgIH0KLQogICAgICAgICBtU2VydmljZS5zZXRJY29uKCJibHVldG9vdGgiLCBpY29uSWQsIDApOwogICAgICAgICBtU2VydmljZS5zZXRJY29uVmlzaWJpbGl0eSgiYmx1ZXRvb3RoIiwgbUJsdWV0b290aEVuYWJsZWQpOwogICAgIH0KQEAgLTEyMDQsMTggKzk3Nyw0IEBACiAgICAgICAgIH0KICAgICAgICAgbVNlcnZpY2Uuc2V0SWNvbigicGhvbmVfc2lnbmFsIiwgbVBob25lU2lnbmFsSWNvbklkLCAwKTsKICAgICB9Ci0KLQotICAgIHByaXZhdGUgY2xhc3MgU3RhdHVzQmFySGFuZGxlciBleHRlbmRzIEhhbmRsZXIgewotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgewotICAgICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgewotICAgICAgICAgICAgY2FzZSBFVkVOVF9CQVRURVJZX0NMT1NFOgotICAgICAgICAgICAgICAgIGlmIChtc2cuYXJnMSA9PSBtQmF0dGVyeVZpZXdTZXF1ZW5jZSkgewotICAgICAgICAgICAgICAgICAgICBjbG9zZUxhc3RCYXR0ZXJ5VmlldygpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KIH0KZGlmZiAtLWdpdCBhL3BhY2thZ2VzL1N5c3RlbVVJL3NyYy9jb20vYW5kcm9pZC9zeXN0ZW11aS9zdGF0dXNiYXIvU3RhdHVzQmFyU2VydmljZS5qYXZhIGIvcGFja2FnZXMvU3lzdGVtVUkvc3JjL2NvbS9hbmRyb2lkL3N5c3RlbXVpL3N0YXR1c2Jhci9TdGF0dXNCYXJTZXJ2aWNlLmphdmEKaW5kZXggZGUzMGNjZC4u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ICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgSUJpbmRlciBvbkJpbmQoSW50ZW50IGludGVudCkgewotICAgICAgICByZXR1cm4gbnVsbDsKLSAgICB9Ci0KLSAgICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICAgIC8vIENvbnN0cnVjdGluZyB0aGUgdmlldwotICAgIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgcHJpdmF0ZSB2b2lkIG1ha2VTdGF0dXNCYXJWaWV3KENvbnRleHQgY29udGV4dCkgewotICAgICAgICBSZXNvdXJjZXMgcmVzID0gY29udGV4dC5nZXRSZXNvdXJjZXMoKTsKLQotICAgICAgICBtSWNvblNpemUgPSByZXMuZ2V0RGltZW5zaW9uUGl4ZWxTaXplKGNvbS5hbmRyb2lkLmludGVybmFsLlIuZGltZW4uc3RhdHVzX2Jhcl9pY29uX3NpemUpOwotCi0gICAgICAgIEV4cGFuZGVkVmlldyBleHBhbmRlZCA9IChFeHBhbmRlZFZpZXcpVmlldy5pbmZsYXRlKGNvbnRleHQsCi0gICAgICAgICAgICAgICAgUi5sYXlvdXQuc3RhdHVzX2Jhcl9leHBhbmRlZCwgbnVsbCk7Ci0gICAgICAgIGV4cGFuZGVkLm1TZXJ2aWNlID0gdGhpczsKLQotICAgICAgICBTdGF0dXNCYXJWaWV3IHNiID0gKFN0YXR1c0JhclZpZXcpVmlldy5pbmZsYXRlKGNvbnRleHQsIFIubGF5b3V0LnN0YXR1c19iYXIsIG51bGwpOwotICAgICAgICBzYi5tU2VydmljZSA9IHRoaXM7Ci0KLSAgICAgICAgLy8gZmlndXJlIG91dCB3aGljaCBwaXhlbC1mb3JtYXQgdG8gdXNlIGZvciB0aGUgc3RhdHVzIGJhci4KLSAgICAgICAgbVBpeGVsR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VzQmFySWNvbiBvbGQsIFN0YXR1c0Jhckljb24gaWNvbikgewotICAgICAgICBpZiAoU1BFV19JQ09OUykgewotICAgICAgICAgICAgU2xvZy5kKFRBRywgInVwZGF0ZUljb24gc2xvdD0iICsgc2xvdCArICIgaW5kZXg9IiArIGluZGV4ICsgIiB2aWV3SW5kZXg9IiArIHZpZXdJbmRleAotICAgICAgICAgICAgICAgICAgICArICIgb2xkPSIgKyBvbGQgKyAiIGljb249IiArIGljb24pOwotICAgICAgICB9Ci0gICAgICAgIFN0YXR1c0Jhckljb25WaWV3IHZpZXcgPSAoU3RhdHVzQmFySWNvblZpZXcpbVN0YXR1c0ljb25zLmdldENoaWxkQXQodmlld0luZGV4KTsKLSAgICAgICAgdmlldy5zZXQoaWNvbik7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgcmVtb3ZlSWNvbihTdHJpbmcgc2xvdCwgaW50IGluZGV4LCBpbnQgdmlld0luZGV4KSB7Ci0gICAgICAgIGlmIChTUEVXX0lDT05TKSB7Ci0gICAgICAgICAgICBTbG9nLmQoVEFHLCAicmVtb3ZlSWNvbiBzbG90PSIgKyBzbG90ICsgIiBpbmRleD0iICsgaW5kZXggKyAiIHZpZXdJbmRleD0iICsgdmlld0luZGV4KTsKLSAgICAgICAgfQotICAgICAgICBtU3RhdHVzSWNvbnMucmVtb3ZlVmlld0F0KHZpZXdJbmRleCk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgYWRkTm90aWZpY2F0aW9uKElCaW5kZXIga2V5LCBTdGF0dXNCYXJOb3RpZmljYXRpb24gbm90aWZpY2F0aW9uKSB7Ci0gICAgICAgIGJvb2xlYW4gc2hvdWxkVGljayA9IHRydWU7Ci0gICAgICAgIGlmIChub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmZ1bGxTY3JlZW5JbnRlbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgc2hvdWxkVGljayA9IGZhbHNlOwotICAgICAgICAgICAgU2xvZy5kKFRBRywgIk5vdGlmaWNhdGlvbiBoYXMgZnVsbFNjcmVlbkludGVudDsgc2VuZGluZyBmdWxsU2NyZWVuSW50ZW50Iik7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uZnVsbFNjcmVlbkludGVudC5zZW5kKCk7Ci0gICAgICAgICAgICB9IGNhdGNoIChQZW5kaW5nSW50ZW50LkNhbmNlbGVkRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSAKLQotICAgICAgICBTdGF0dXNCYXJJY29uVmlldyBpY29uVmlldyA9IGFkZE5vdGlmaWNhdGlvblZpZXdzKGtleSwgbm90aWZpY2F0aW9uKTsKLSAgICAgICAgaWYgKGljb25WaWV3ID09IG51bGwpIHJldHVybjsKLQotICAgICAgICBpZiAoc2hvdWxkVGljaykgewotICAgICAgICAgICAgdGljayhub3RpZmljYXRpb24pOwotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICAvLyBSZWNhbGN1bGF0ZSB0aGUgcG9zaXRpb24gb2YgdGhlIHNsaWRpbmcgd2luZG93cyBhbmQgdGhlIHRpdGxlcy4KLSAgICAgICAgc2V0QXJlVGhlcmVOb3RpZmljYXRpb25zKCk7Ci0gICAgICAgIHVwZGF0ZUV4cGFuZGVkVmlld1BvcyhFWFBBTkRFRF9MRUFWRV9BTE9ORSk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdXBkYXRlTm90aWZpY2F0aW9uKElCaW5kZXIga2V5LCBTdGF0dXNCYXJOb3RpZmljYXRpb24gbm90aWZpY2F0aW9uKSB7Ci0gICAgICAgIE5vdGlmaWNhdGlvbkRhdGEgb2xkTGlzdDsKLSAgICAgICAgaW50IG9sZEluZGV4ID0gbU9uZ29pbmcuZmluZEVudHJ5KGtleSk7Ci0gICAgICAgIGlmIChvbGRJbmRleCA+PSAwKSB7Ci0gICAgICAgICAgICBvbGRMaXN0ID0gbU9uZ29pbmc7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBvbGRJbmRleCA9IG1MYXRlc3QuZmluZEVudHJ5KGtleSk7Ci0gICAgICAgICAgICBpZiAob2xkSW5kZXggPCAwKSB7Ci0gICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInVwZGF0ZU5vdGlmaWNhdGlvbiBmb3IgdW5rbm93biBrZXk6ICIgKyBrZXkpOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG9sZExpc3QgPSBtTGF0ZXN0OwotICAgICAgICB9Ci0gICAgICAgIGZpbmFsIE5vdGlmaWNhdGlvbkRhdGEuRW50cnkgb2xkRW50cnkgPSBvbGRMaXN0LmdldEVudHJ5QXQob2xkSW5kZXgpOwotICAgICAgICBmaW5hbCBTdGF0dXNCYXJOb3RpZmljYXRpb24gb2xkTm90aWZpY2F0aW9uID0gb2xkRW50cnkubm90aWZpY2F0aW9uOwotICAgICAgICBmaW5hbCBSZW1vdGVWaWV3cyBvbGRDb250ZW50VmlldyA9IG9sZE5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uY29udGVudFZpZXc7Ci0KLSAgICAgICAgZmluYWwgUmVtb3RlVmlld3MgY29udGVudFZpZXcgPSBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmNvbnRlbnRWaWV3OwotCi0gICAgICAgIGlmIChmYWxzZSkgewotICAgICAgICAgICAgU2xvZy5kKFRBRywgIm9sZCBub3RpZmljYXRpb246IHdoZW49IiArIG9sZE5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24ud2hlbgotICAgICAgICAgICAgICAgICAgICArICIgb25nb2luZz0iICsgb2xkTm90aWZpY2F0aW9uLmlzT25nb2luZygpCi0gICAgICAgICAgICAgICAgICAgICsgIiBleHBhbmRlZD0iICsgb2xkRW50cnkuZXhwYW5kZWQKLSAgICAgICAgICAgICAgICAgICAgKyAiIGNvbnRlbnRWaWV3PSIgKyBvbGRDb250ZW50Vmlldyk7Ci0gICAgICAgICAgICBTbG9nLmQoVEFHLCAibmV3IG5vdGlmaWNhdGlvbjogd2hlbj0iICsgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi53aGVuCi0gICAgICAgICAgICAgICAgICAgICsgIiBvbmdvaW5nPSIgKyBvbGROb3RpZmljYXRpb24uaXNPbmdvaW5nKCkKLSAgICAgICAgICAgICAgICAgICAgKyAiIGNvbnRlbnRWaWV3PSIgKyBjb250ZW50Vmlldyk7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBDYW4gd2UganVzdCByZWFwcGx5IHRoZSBSZW1vdGVWaWV3cyBpbiBwbGFjZT8gIElmIHdoZW4gZGlkbid0IGNoYW5nZSwgdGhlIG9yZGVyCi0gICAgICAgIC8vIGRpZG4ndCBjaGFuZ2UuCi0gICAgICAgIGlmIChub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLndoZW4gPT0gb2xkTm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi53aGVuCi0gICAgICAgICAgICAgICAgJiYgbm90aWZpY2F0aW9uLmlzT25nb2luZygpID09IG9sZE5vdGlmaWNhdGlvbi5pc09uZ29pbmcoKQotICAgICAgICAgICAgICAgICYmIG9sZEVudHJ5LmV4cGFuZGVkICE9IG51bGwKLSAgICAgICAgICAgICAgICAmJiBjb250ZW50VmlldyAhPSBudWxsICYmIG9sZENvbnRlbnRWaWV3ICE9IG51bGwKLSAgICAgICAgICAgICAgICAmJiBjb250ZW50Vmlldy5nZXRQYWNrYWdlKCkgIT0gbnVsbAotICAgICAgICAgICAgICAgICYmIG9sZENvbnRlbnRWaWV3LmdldFBhY2thZ2UoKSAhPSBudWxsCi0gICAgICAgICAgICAgICAgJiYgb2xkQ29udGVudFZpZXcuZ2V0UGFja2FnZSgpLmVxdWFscyhjb250ZW50Vmlldy5nZXRQYWNrYWdlKCkpCi0gICAgICAgICAgICAgICAgJiYgb2xkQ29udGVudFZpZXcuZ2V0TGF5b3V0SWQoKSA9PSBjb250ZW50Vmlldy5nZXRMYXlvdXRJZCgpKSB7Ci0gICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgInJldXNpbmcgbm90aWZpY2F0aW9uIik7Ci0gICAgICAgICAgICBvbGRFbnRyeS5ub3RpZmljYXRpb24gPSBub3RpZmljYXRpb247Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIC8vIFJlYXBwbHkgdGhlIFJlbW90ZVZpZXdzCi0gICAgICAgICAgICAgICAgY29udGVudFZpZXcucmVhcHBseSh0aGlzLCBvbGRFbnRyeS5jb250ZW50KTsKLSAgICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGNvbnRlbnRJbnRlbnQKLSAgICAgICAgICAgICAgICBmaW5hbCBQZW5kaW5nSW50ZW50IGNvbnRlbnRJbnRlbnQgPSBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmNvbnRlbnRJbnRlbnQ7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRJbnRlbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBvbGRFbnRyeS5jb250ZW50LnNldE9uQ2xpY2tMaXN0ZW5lcihuZXcgTGF1bmNoZXIoY29udGVudEludGVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm90aWZpY2F0aW9uLnBrZywgbm90aWZpY2F0aW9uLnRhZywgbm90aWZpY2F0aW9uLmlkKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSB0aGUgaWNvbi4KLSAgICAgICAgICAgICAgICBmaW5hbCBTdGF0dXNCYXJJY29uIGljID0gbmV3IFN0YXR1c0Jhckljb24obm90aWZpY2F0aW9uLnBrZywKLSAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uaWNvbiwgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5pY29uTGV2ZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLm51bWJlcik7Ci0gICAgICAgICAgICAgICAgaWYgKCFvbGRFbnRyeS5pY29uLnNldChpYykpIHsKLSAgICAgICAgICAgICAgICAgICAgaGFuZGxlTm90aWZpY2F0aW9uRXJyb3Ioa2V5LCBub3RpZmljYXRpb24sICJDb3VsZG4ndCB1cGRhdGUgaWNvbjogIiArIGljKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAvLyBJdCBmYWlsZWQgdG8gYWRkIGNsZWFubHkuICBMb2csIGFuZCByZW1vdmUgdGhlIHZpZXcgZnJvbSB0aGUgcGFuZWwuCi0gICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIkNvdWxkbid0IHJlYXBwbHkgdmlld3MgZm9yIHBhY2thZ2UgIiArIGNvbnRlbnRWaWV3LmdldFBhY2thZ2UoKSwgZSk7Ci0gICAgICAgICAgICAgICAgcmVtb3ZlTm90aWZpY2F0aW9uVmlld3Moa2V5KTsKLSAgICAgICAgICAgICAgICBhZGROb3RpZmljYXRpb25WaWV3cyhrZXksIG5vdGlmaWNhdGlvbik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgIm5vdCByZXVzaW5nIG5vdGlmaWNhdGlvbiIpOwotICAgICAgICAgICAgcmVtb3ZlTm90aWZpY2F0aW9uVmlld3Moa2V5KTsKLSAgICAgICAgICAgIGFkZE5vdGlmaWNhdGlvblZpZXdzKGtleSwgbm90aWZpY2F0aW9uKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8vIFJlc3RhcnQgdGhlIHRpY2tlciBpZiBpdCdzIHN0aWxsIHJ1bm5pbmcKL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ubGF5b3V0LnN0YXR1c19iYXJfbGF0ZXN0X2V2ZW50LCBwYXJlbnQsIGZhbHNlKTsKLQotICAgICAgICAvLyBiaW5kIHRoZSBjbGljayBldmVudCB0byB0aGUgY29udGVudCBhcmVhCi0gICAgICAgIFZpZXdHcm91cCBjb250ZW50ID0gKFZpZXdHcm91cClyb3cuZmluZFZpZXdCeUlkKFIuaWQuY29udGVudCk7Ci0gICAgICAgIGNvbnRlbnQuc2V0RGVzY2VuZGFudEZvY3VzYWJpbGl0eShWaWV3R3JvdXAuRk9DVVNfQkxPQ0tfREVTQ0VOREFOVFMpOwotICAgICAgICBjb250ZW50LnNldE9uRm9jdXNDaGFuZ2VMaXN0ZW5lcihtRm9jdXNDaGFuZ2VMaXN0ZW5lcik7Ci0gICAgICAgIFBlbmRpbmdJbnRlbnQgY29udGVudEludGVudCA9IG4uY29udGVudEludGVudDsKLSAgICAgICAgaWYgKGNvbnRlbnRJbnRlbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgY29udGVudC5zZXRPbkNsaWNrTGlzdGVuZXIobmV3IExhdW5jaGVyKGNvbnRlbnRJbnRlbnQsIG5vdGlmaWNhdGlvbi5wa2csCi0gICAgICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24udGFnLCBub3RpZmljYXRpb24uaWQpKTsKLSAgICAgICAgfQotCi0gICAgICAgIFZpZXcgZXhwYW5kZWQgPSBudWxsOwotICAgICAgICBFeGNlcHRpb24gZXhjZXB0aW9uID0gbnVsbDsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGV4cGFuZGVkID0gcmVtb3RlVmlld3MuYXBwbHkodGhpcywgY29udGVudCk7Ci0gICAgICAgIH0KLSAgICAgICAgY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgZXhjZXB0aW9uID0gZTsKLSAgICAgICAgfQotICAgICAgICBpZiAoZXhwYW5kZWQgPT0gbnVsbCkgewotICAgICAgICAgICAgU3RyaW5nIGlkZW50ID0gbm90aWZpY2F0aW9uLnBrZyArICIvMHgiICsgSW50ZWdlci50b0hleFN0cmluZyhub3RpZmljYXRpb24uaWQpOwotICAgICAgICAgICAgU2xvZy5lKFRBRywgImNvdWxkbid0IGluZmxhdGUgdmlldyBmb3Igbm90aWZpY2F0aW9uICIgKyBpZGVudCwgZXhjZXB0aW9uKTsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgY29udGVudC5hZGRWaWV3KGV4cGFuZGVkKTsKLSAgICAgICAgICAgIHJvdy5zZXREcmF3aW5nQ2FjaGVFbmFibGVkKHRydWUpOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIG5ldyBWaWV3W10geyByb3csIGNvbnRlbnQsIGV4cGFuZGVkIH07Ci0gICAgfQotCi0gICAgU3RhdHVzQmFySWNvblZpZXcgYWRkTm90aWZpY2F0aW9uVmlld3MoSUJpbmRlciBrZXksIFN0YXR1c0Jhck5vdGlmaWNhdGlvbiBub3RpZmljYXRpb24pIHsKLSAgICAgICAgTm90aWZpY2F0aW9uRGF0YSBsaXN0OwotICAgICAgICBWaWV3R3JvdXAgcGFyZW50OwotICAgICAgICBmaW5hbCBib29sZWFuIGlzT25nb2luZyA9IG5vdGlmaWNhdGlvbi5pc09uZ29pbmcoKTsKLSAgICAgICAgaWYgKGlzT25nb2luZykgewotICAgICAgICAgICAgbGlzdCA9IG1PbmdvaW5nOwotICAgICAgICAgICAgcGFyZW50ID0gbU9uZ29pbmdJdGVtczsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGxpc3QgPSBtTGF0ZXN0OwotICAgICAgICAgICAgcGFyZW50ID0gbUxhdGVzdEl0ZW1zOwotICAgICAgICB9Ci0gICAgICAgIC8vIENvbnN0cnVjdCB0aGUgZXhwYW5kZWQgdmlldy4KLSAgICAgICAgZmluYWwgVmlld1tdIHZpZXdzID0gbWFrZU5vdGlmaWNhdGlvblZpZXcobm90aWZpY2F0aW9uLCBwYXJlbnQpOwotICAgICAgICBpZiAodmlld3MgPT0gbnVsbCkgewotICAgICAgICAgICAgaGFuZGxlTm90aWZpY2F0aW9uRXJyb3Ioa2V5LCBub3RpZmljYXRpb24sICJDb3VsZG4ndCBleHBhbmQgUmVtb3RlVmlld3MgZm9yOiAiCi0gICAgICAgICAgICAgICAgICAgICsgbm90aWZpY2F0aW9uKTsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9Ci0gICAgICAgIGZpbmFsIFZpZXcgcm93ID0gdmlld3NbMF07Ci0gICAgICAgIGZpbmFsIFZpZXcgY29udGVudCA9IHZpZXdzWzFdOwotICAgICAgICBmaW5hbCBWaWV3IGV4cGFuZGVkID0gdmlld3NbMl07Ci0gICAgICAgIC8vIENvbnN0cnVjdCB0aGUgaWNvbi4KLSAgICAgICAgZmluYWwgU3RhdHVzQmFySWNvblZpZXcgaWNvblZpZXcgPSBuZXcgU3RhdHVzQmFySWNvblZpZXcodGhpcywKLSAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ucGtnICsgIi8weCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKG5vdGlmaWNhdGlvbi5pZCkpOwotICAgICAgICBmaW5hbCBTdGF0dXNCYXJJY29uIGljID0gbmV3IFN0YXR1c0Jhckljb24obm90aWZpY2F0aW9uLnBrZywgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5pY29uLAotICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmljb25MZXZlbCwgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5udW1iZXIpOwotICAgICAgICBpZiAoIWljb25WaWV3LnNldChpYykpIHsKLSAgICAgICAgICAgIGhhbmRsZU5vdGlmaWNhdGlvbkVycm9yKGtleSwgbm90aWZpY2F0aW9uLCAiQ291bGRpbmcgY3JlYXRlIGljb246ICIgKyBpYyk7Ci0gICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgfQotICAgICAgICAvLyBBZGQgdGhlIGV4cGFuZGVkIHZpZXcuCi0gICAgICAgIGZpbmFsIGludCB2aWV3SW5kZXggPSBsaXN0LmFkZChrZXksIG5vdGlmaWNhdGlvbiwgcm93LCBjb250ZW50LCBleHBhbmRlZCwgaWNvblZpZXcpOwotICAgICAgICBwYXJlbnQuYWRkVmlldyhyb3csIHZpZXdJbmRleCk7Ci0gICAgICAgIC8vIEFkZCB0aGUgaWNvbi4KLSAgICAgICAgZmluYWwgaW50IGljb25JbmRleCA9IGNob29zZUljb25JbmRleChpc09uZ29pbmcsIHZpZXdJbmRleCk7Ci0gICAgICAgIG1Ob3RpZmljYXRpb25JY29ucy5hZGRWaWV3KGljb25WaWV3LCBpY29uSW5kZXgpOwotICAgICAgICByZXR1cm4gaWNvblZpZXc7Ci0gICAgfQotCi0gICAgU3RhdHVzQmFyTm90aWZpY2F0aW9uIHJlbW92ZU5vdGlmaWNhdGlvblZpZXdzKElCaW5kZXIga2V5KSB7Ci0gICAgICAgIE5vdGlmaWNhdGlvbkRhdGEuRW50cnkgZW50cnkgPSBtT25nb2luZy5yZW1vdmUoa2V5KTsKLSAgICAgICAgaWYgKGVudHJ5ID09IG51bGwpIHsKLSAgICAgICAgICAgIGVudHJ5ID0gbUxhdGVzdC5yZW1vdmUoa2V5KTsKLSAgICAgICAgICAgIGlmIChlbnRyeSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInJlbW92ZU5vdGlmaWNhdGlvbiBmb3IgdW5rbm93biBrZXk6ICIgKyBrZXkpOwotICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIC8vIFJlbW92ZSB0aGUgZXhwYW5kZWQgdmlldy4KLSAgICAgICAgKChWaWV3R3JvdXApZW50cnkucm93LmdldFBhcmVudCgpKS5yZW1vdmVWaWV3KGVudHJ5LnJvdyk7Ci0gICAgICAgIC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WaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotICAgIC8qKgotICAgICAqIFN0YXRlIGlzIG9uZSBvciBtb3JlIG9mIHRoZSBESVNBQkxFIGNvbnN0YW50cyBmcm9tIFN0YXR1c0Jhck1hbmFnZXIuCi0gICAgICovCi0gICAgcHVibGljIHZvaWQgZGlzYWJsZShpbnQgc3RhdGUpIHsKLSAgICAgICAgZmluYWwgaW50IG9sZCA9IG1EaXNhYmxlZDsKLSAgICAgICAgZmluYWwgaW50IGRpZmYgPSBzdGF0ZSBeIG9sZDsKLSAgICAgICAgbURpc2FibGVkID0gc3RhdGU7Ci0KLSAgICAgICAgaWYgKChkaWZmICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX0VYUEFORCkgIT0gMCkgewotICAgICAgICAgICAgaWYgKChzdGF0ZSAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9FWFBBTkQpICE9IDApIHsKLSAgICAgICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgIkRJU0FCTEVfRVhQQU5EOiB5ZXMiKTsKLSAgICAgICAgICAgICAgICBhbmltYXRlQ29sbGFwc2UoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoKGRpZmYgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfTk9USUZJQ0FUSU9OX0lDT05TKSAhPSAwKSB7Ci0gICAgICAgICAgICBpZiAoKHN0YXRlICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05PVElGSUNBVElPTl9JQ09OUykgIT0gMCkgewotICAgICAgICAgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAiRElTQUJMRV9OT1RJRklDQVRJT05fSUNPTlM6IHllcyIpOwotICAgICAgICAgICAgICAgIGlmIChtVGlja2luZykgewotICAgICAgICAgICAgICAgICAgICBtVGlja2VyLmhhbHQoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBzZXROb3RpZmljYXRpb25JY29uVmlzaWJpbGl0eShmYWxzZSwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hbmltLmZhZGVfb3V0KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAiRElTQUJMRV9OT1RJRklDQVRJT05fSUNPTlM6IG5vIik7Ci0gICAgICAgICAgICAgICAgaWYgKCFtRXhwYW5kZWRWaXNpYmxlKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNldE5vdGlmaWNhdGlvbkljb25WaXNpYmlsaXR5KHRydWUsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYW5pbS5mYWRlX2luKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSBpZiAoKGRpZmYgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfTk9USUZJQ0FUSU9OX1RJQ0tFUikgIT0gMCkgewotICAgICAgICAgICAgaWYgKG1UaWNraW5nICYmIChzdGF0ZSAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9OT1RJRklDQVRJT05fVElDS0VSKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJESVNBQkxFX05PVElGSUNBVElPTl9USUNLRVI6IHllcyIpOwotICAgICAgICAgICAgICAgIG1UaWNrZXIuaGFsdCgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogQWxsIGNoYW5nZXMgdG8gdGhlIHN0YXR1cyBiYXIgYW5kIG5vdGlmaWNhdGlvbnMgZnVubmVsIHRocm91Z2ggaGVyZSBhbmQgYXJlIGJhdGNoZWQuCi0gICAgICovCi0gICAgcHJpdmF0ZSBjbGFzcyBIIGV4dGV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XNhYmxlZCAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9FWFBBTkQpICE9IDApIHsKLSAgICAgICAgICAgIHJldHVybiA7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKG1FeHBhbmRlZCkgewotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJlcGFyZVRyYWNraW5nKDAsIHRydWUpOwotICAgICAgICBwZXJmb3JtRmxpbmcoMCwgMjAwMC4wZiwgdHJ1ZSk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgYW5pbWF0ZUNvbGxhcHNlKCkgewotICAgICAgICBpZiAoU1BFVykgewotICAgICAgICAgICAgU2xvZy5kKFRBRywgImFuaW1hdGVDb2xsYXBzZSgpOiBtRXhwYW5kZWQ9IiArIG1FeHBhbmRlZAotICAgICAgICAgICAgICAgICAgICArICIgbUV4cGFuZGVkVmlzaWJsZT0iICsgbUV4cGFuZGVkVmlzaWJsZQotICAgICAgICAgICAgICAgICAgICArICIgbUV4cGFuZGVkPSIgKyBtRXhwYW5kZWQKLSAgICAgICAgICAgICAgICAgICAgKyAiIG1BbmltYXRpbmc9IiArIG1BbmltYXRpbmcKLSAgICAgICAgICAgICAgICAgICAgKyAiIG1BbmltWT0iICsgbUFuaW1ZCi0gICAgICAgICAgICAgICAgICAgICsgIiBtQW5pbVZlbD0iICsgbUFuaW1WZWwpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFtRXhwYW5kZWRWaXNpYmxlKSB7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBpbnQgeTsKLSAgICAgICAgaWYgKG1BbmltYXRpbmcpIHsKLSAgICAgICAgICAgIHkgPSAoaW50KW1BbmltWTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHkgPSBtRGlzcGxheS5nZXRIZWlnaHQoKS0xOwotICAgICAgICB9Ci0gICAgICAgIC8vIExldCB0aGUgZmxpbmcgd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k7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIW1FeHBhbmRlZCkgewotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIG1FeHBhbmRlZCA9IGZhbHNlOwotICAgIH0KLQotICAgIHZvaWQgZG9BbmltYXRpb24oKSB7Ci0gICAgICAgIGlmIChtQW5pbWF0aW5nKSB7Ci0gICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgImRvQW5pbWF0aW9uIik7Ci0gICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgImRvQW5pbWF0aW9uIGJlZm9yZSBtQW5pbVk9IiArIG1BbmltWSk7Ci0gICAgICAgICAgICBpbmNyZW1lbnRBbmltKCk7Ci0gICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgImRvQW5pbWF0aW9uIGFmdGVyICBtQW5pbVk9IiArIG1BbmltWSk7Ci0gICAgICAgICAgICBpZiAobUFuaW1ZID49IG1EaXNwbGF5LmdldEhlaWdodCgpLTEpIHsKLSAgICAgICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgIkFuaW1hdGlvbiBjb21wbGV0ZWQgdG8gZXhwYW5kZWQgc3RhdGUuIik7Ci0gICAgICAgICAgICAgICAgbUFuaW1hdGluZyA9IGZhbHNlOwotICAgICAgICAgICAgICAgIHVwZGF0ZUV4cGFuZGVkVmlld1BvcyhFWFBBTkRFRF9GVUxMX09QRU4pOwotICAgICAgICAgICAgICAgIHBlcmZvcm1FeHBhbmQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKG1BbmltWSA8IG1TdGF0dXNCYXJWaWV3LmdldEhlaWdodCgpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJBbmltYXRpb24gY29tcGxldGVkIHRvIGNvbGxhcHNlZCBzdGF0ZS4iKTsKLSAgICAgICAgICAgICAgICBtQW5pbWF0aW5nID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgdXBkYXRlRXhwYW5kZWRWaWV3UG9zKDApOwotICAgICAgICAgICAgICAgIHBlcmZvcm1Db2xsYXBzZSgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgdXBkYXRlRXhwYW5kZWRWaWV3UG9zKChpbnQpbUFuaW1ZKTsKLSAgICAgICAgICAgICAgICBtQ3VyQW5pbWF0aW9uVGltZSArPSBBTklNX0ZSQU1FX0RVUkFUSU9OOwotICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlQXRUaW1lKG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoTVNHX0FOSU1BVEUpLCBtQ3VyQW5pbWF0aW9uVGltZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICB2b2lkIHN0b3BUcmFja2luZygpIHsKLSAgICAgICAgbVRyYWNraW5nID0gZmFsc2U7Ci0gICAgICAgIG1WZWxvY2l0eVRyYWNrZXIucmVjeWNsZSgpOwotICAgICAgICBtVmVsb2NpdHlUcmFja2VyID0gbnVsbDsKLSAgICB9Ci0KLSAgICB2b2lkIGluY3JlbWVudEFuaW0oKSB7Ci0gICAgICAgIGxvbmcgbm93ID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7Ci0gICAgICAgIGZsb2F0IHQgPSAoKGZsb2F0KShub3cgLSBtQW5pbUxhc3RUaW1lKSkgLyAxMDAwOyAgICAgICAgICAgIC8vIG1zIC0+IHMKLSAgICAgICAgZmluYWwgZmxvYXQgeSA9IG1BbmltWTsKLSAgICAgICAgZmluYWwgZmxvYXQgdiA9IG1BbmltVmVsOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcHgvcwotICAgICAgICBmaW5hbCBmbG9hdCBhID0gbUFuaW1BY2NlbDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBweC9zL3MKLSAgICAgICAgbUFuaW1ZID0geSArICh2KnQpICsgKDAuNWYqYSp0KnQpOyAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcHgKLSAgICAgICAgbUFuaW1WZWwgPSB2ICsgKGEqdCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcHgvcwotICAgICAgICBtQW5pbUxhc3RUaW1lID0gbm93OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBtcwotICAgICAgICAvL1Nsb2cuZChUQUcsICJ5PSIgKyB5ICsgIiB2PSIgKyB2ICsgIiBhPSIgKyBhICsgIiB0PSIgKyB0ICsgIiBtQW5pbVk9IiArIG1BbmltWQotICAgICAgICAvLyAgICAgICAgKyAiIG1BbmltQWNjZWw9IiArIG1BbmltQWNjZWwpOwotICAgIH0KLQotICAgIHZvaWQgZG9SZXZlYWxBbmltYXRpb24oKSB7Ci0gICAgICAgIGZpbmFsIGludCBoID0gbUNsb3NlVmlldy5nZXRIZWlnaHQoKSArIG1TdGF0dXNCYXJWaWV3LmdldEhlaWdodCgpOwotICAgICAgICBpZiAobUFuaW1hdGluZ1JldmVhbCAmJiBtQW5pbWF0aW5nICYmIG1BbmltWSA8IGgpIHsKLSAgICAgICAgICAgIGluY3JlbWVudEFuaW0oKTsKLSAgICAgICAgICAgIGlmIChtQW5pbVkgPj0gaCkgewotICAgICAgICAgICAgICAgIG1BbmltWSA9IGg7Ci0gICAgICAgICAgICAgICAgdXBkYXRlRXhwYW5kZWRWaWV3UG9zKChpbnQpbUFuaW1ZKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgdXBkYXRlRXhwYW5kZWRWaWV3UG9zKChpbnQpbUFuaW1ZKTsKLSAgICAgICAgICAgICAgICBtQ3VyQW5pbWF0aW9uVGltZSArPSBBTklNX0ZSQU1FX0RVUkFUSU9OOwotICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNz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WVzc2FnZUF0VGltZShtSGFuZGxlci5vYnRhaW5NZXNzYWdlKE1TR19BTklNQVRFX1JFVkVBTCksCi0gICAgICAgICAgICAgICAgICAgIG1DdXJBbmltYXRpb25UaW1lKTsKLSAgICAgICAgICAgIG1ha2VFeHBhbmRlZFZpc2libGUoKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIGl0J3Mgb3BlbiwgY2xvc2UgaXQ/Ci0gICAgICAgICAgICBpZiAobUFuaW1hdGluZykgewotICAgICAgICAgICAgICAgIG1BbmltYXRpbmcgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfQU5JTUFURSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB1cGRhdGVFeHBhbmRlZFZpZXdQb3MoeSArIG1WaWV3RGVsdGEpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgdm9pZCBwZXJmb3JtRmxpbmcoaW50IHksIGZsb2F0IHZlbCwgYm9vbGVhbiBhbHdheXMpIHsKLSAgICAgICAgbUFuaW1hdGluZ1JldmVhbCA9IGZhbHNlOwotICAgICAgICBtRGlzcGxheUhlaWdodCA9IG1EaXNwbGF5LmdldEhlaWdodCgpOwotCi0gICAgICAgIG1BbmltWSA9IHk7Ci0gICAgICAgIG1BbmltVmVsID0gdmVsOwotCi0gICAgICAgIC8vU2xvZy5kKFRBRywgInN0YXJ0aW5nIHdpdGggbUFuaW1ZPSIgKyBtQW5pbVkgKyAiIG1BbmltVmVsPSIgKyBtQW5pbVZlbCk7Ci0KLSAgICAgICAgaWYgKG1FeHBhbmRlZCkgewotICAgICAgICAgICAgaWYgKCFhbHdheXMgJiYgKAotICAgICAgICAgICAgICAgICAgICB2ZWwgPiAyMDAuMGYKLSAgICAgICAgICAgICAgICAgICAgfHwgKHkgPiAobURpc3BsYXlIZWlnaHQtMjUpICYmIHZlbCA+IC0yMDAuMGYpKSkgewotICAgICAgICAgICAgICAgIC8vIFdlIGFyZSBleHBhbmRlZCwgYnV0IHRoZXkgZGlkbid0IG1vdmUgc3VmZmljaWVudGx5IHRvIGNhdXNlCi0gICAgICAgICAgICAgICAgLy8gdXMgdG8gcmV0cmFjdC4gIEFuaW1hdGUgYmFjayB0byB0aGUgZXhwYW5kZWQgcG9zaXRpb24uCi0gICAgICAgICAgICAgICAgbUFuaW1BY2NlbCA9IDIwMDAuMGY7Ci0gICAgICAgICAgICAgICAgaWYgKHZlbCA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbUFuaW1WZWwgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIC8vIFdlIGFyZSBleHBhbmRlZCBhbmQgYXJlIG5vdyBnb2luZyB0byBhbmltYXRlIGF3YXkuCi0gICAgICAgICAgICAgICAgbUFuaW1BY2NlbCA9IC0yMDAwLjBmOwotICAgICAgICAgICAgICAgIGlmICh2ZWwgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1BbmltVmVsID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoYWx3YXlzIHx8ICgKLSAgICAgICAgICAgICAgICAgICAgdmVsID4gMjAwLjBmCi0gICAgICAgICAgICAgICAgICAgIHx8ICh5ID4gKG1EaXNwbGF5SGVpZ2h0LzIpICYmIHZlbCA+IC0yMDAuMGYpKSkgewotICAgICAgICAgICAgICAgIC8vIFdlIGFyZSBjb2xsYXBzZWQsIGFuZCB0aGV5IG1vdmVkIGVub3VnaCB0byBhbGxvdyB1cyB0bwotICAgICAgICAgICAgICAgIC8vIGV4cGFuZC4gIEFuaW1hdGUgaW4gdGhlIG5vdGlmaWNhdGlvbnMuCi0gICAgICAgICAgICAgICAgbUFuaW1BY2NlbCA9IDIwMDAuMGY7Ci0gICAgICAgICAgICAgICAgaWYgKHZlbCA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbUFuaW1WZWwgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIC8vIFdlIGFyZSBjb2xsYXBzZWQsIGJ1dCB0aGV5IGRpZG4ndCBtb3ZlIHN1ZmZpY2llbnRseSB0byBjYXVzZQotICAgICAgICAgICAgICAgIC8vIHVzIHRvIHJldHJhY3QuICBBbmltYXRlIGJhY2sgdG8gdGhlIGNvbGxhcHNlZCBwb3NpdGlvbi4KLSAgICAgICAgICAgICAgICBtQW5pbUFjY2VsID0gLTIwMDAuMGY7Ci0gICAgICAgICAgICAgICAgaWYgKHZlbCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbUFuaW1WZWwgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAvL1Nsb2cuZChUQUcsICJtQW5pbVk9IiArIG1BbmltWSArICIgbUFuaW1WZWw9IiArIG1BbmltVmVsCi0gICAgICAgIC8vICAgICAgICArICIgbUFuaW1BY2NlbD0iICsgbUFuaW1BY2NlbCk7Ci0KLSAgICAgICAgbG9uZyBub3cgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKLSAgICAgICAgbUFuaW1MYXN0VGltZSA9IG5vdzsKLSAgICAgICAgbUN1ckFuaW1hdGlvblRpbWUgPSBub3cgKyBBTklNX0ZSQU1FX0RVUkFUSU9OOwotICAgICAgICBtQW5pbWF0aW5nID0gdHJ1ZTsKLSAgICAgICAgbUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTVNHX0FOSU1BVEUpOwotICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfQU5JTUFURV9SRVZFQUwpOwotICAgICAgICBtSGFuZGxlci5zZW5kTWVzc2FnZUF0VGltZShtSGFuZGxlci5vYnRhaW5NZXNzYWd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wotICAgICAgICAgICAgZmluYWwgaW50IG1pblkgPSBzdGF0dXNCYXJTaXplICsgbUNsb3NlVmlldy5nZXRIZWlnaHQoKTsKLSAgICAgICAgICAgIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSkgewotICAgICAgICAgICAgICAgIGludCB5ID0gKGludClldmVudC5nZXRSYXdZKCk7Ci0gICAgICAgICAgICAgICAgaWYgKG1BbmltYXRpbmdSZXZlYWwgJiYgeSA8IG1pblkpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gbm90aGluZwotICAgICAgICAgICAgICAgIH0gZWxzZSAgewotICAgICAgICAgICAgICAgICAgICBtQW5pbWF0aW5nUmV2ZWFsID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUV4cGFuZGVkVmlld1Bvcyh5ICsgbVZpZXdEZWx0YSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBNb3Rpb25FdmVudC5BQ1RJT05fVVApIHsKLSAgICAgICAgICAgICAgICBtVmVsb2NpdHlUcmFja2VyLmNvbXB1dGVDdXJyZW50VmVsb2NpdHkoMTAwMCk7Ci0KLSAgICAgICAgICAgICAgICBmbG9hdCB5VmVsID0gbVZlbG9jaXR5VHJhY2tlci5nZXRZVmVsb2NpdHkoKTsKLSAgICAgICAgICAgICAgICBib29sZWFuIG5lZ2F0aXZlID0geVZlbCA8IDA7Ci0KLSAgICAgICAgICAgICAgICBmbG9hdCB4VmVsID0gbVZlbG9jaXR5VHJhY2tlci5nZXRYVmVsb2NpdHkoKTsKLSAgICAgICAgICAgICAgICBpZiAoeFZlbCA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgeFZlbCA9IC14VmVsOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoeFZlbCA+IDE1MC4wZikgewotICAgICAgICAgICAgICAgICAgICB4VmVsID0gMTUwLjBmOyAvLyBsaW1pdCBob3cgbXVjaCB3ZSBjYXJlIGFib3V0IHRoZSB4IGF4aXMKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBmbG9hdCB2ZWwgPSAoZmxvYXQpTWF0aC5oeXBvdCh5VmVsLCB4VmVsKTsKLSAgICAgICAgICAgICAgICBpZiAobmVnYXRpdmUpIHsKLSAgICAgICAgICAgICAgICAgICAgdmVsID0gLXZlbDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwZXJmb3JtRmxpbmcoKGludClldmVudC5nZXRSYXdZKCksIHZlbCwgZmFsc2UpOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgIH0KLQotICAgIHByaXZhdGUgY2xhc3MgTGF1bmNoZXIgaW1wbGVtZW50cyBWaWV3Lk9uQ2xpY2tMaXN0ZW5lciB7Ci0gICAgICAgIHByaXZhdGUgUGVuZGluZ0ludGVudCBtSW50ZW50OwotICAgICAgICBwcml2YXRlIFN0cmluZyBtUGtnOwotICAgICAgICBwcml2YXRlIFN0cmluZyBtVGFnOwotICAgICAgICBwcml2YXRlIGludCBtSWQ7Ci0KLSAgICAgICAgTGF1bmNoZXIoUGVuZGluZ0ludGVudCBpbnRlbnQsIFN0cmluZyBwa2csIFN0cmluZyB0YWcsIGludCBpZCkgewotICAgICAgICAgICAgbUludGVudCA9IGludGVudDsKLSAgICAgICAgICAgIG1Qa2cgPSBwa2c7Ci0gICAgICAgICAgICBtVGFnID0gdGFnOwotICAgICAgICAgICAgbUlkID0gaWQ7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgewotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAvLyBUaGUgaW50ZW50IHdlIGFyZSBzZW5kaW5nIGlzIGZvciB0aGUgYXBwbGljYXRpb24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mQgaXMgbmlnaC4KLSAgICAgICAgfQotICAgIH0KLQotICAgIHByaXZhdGUgY2xhc3MgTXlUaWNrZXIgZXh0ZW5kcyBUaWNrZXIgewotICAgICAgICBNeVRpY2tlcihDb250ZXh0IGNvbnRleHQsIFN0YXR1c0JhclZpZXcgc2IpIHsKLSAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIHNiKTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICB2b2lkIHRpY2tlclN0YXJ0aW5nKCkgewotICAgICAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJ0aWNrZXJTdGFydGluZyIpOwotICAgICAgICAgICAgbVRpY2tpbmcgPSB0cnVlOwotICAgICAgICAgICAgbUljb25zLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKLSAgICAgICAgICAgIG1UaWNrZXJWaWV3LnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKLSAgICAgICAgICAgIG1UaWNrZXJWaWV3LnN0YXJ0QW5pbWF0aW9uKGxvYWRBbmltKGNvbS5hbmRyb2lkLmludGVybmFsLlIuYW5pbS5wdXNoX3VwX2luLCBudWxsKSk7Ci0gICAgICAgICAgICBtSWNvbnMuc3RhcnRBbmltYXRpb24obG9hZEFuaW0oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hbmltLnB1c2hfdXBfb3V0LCBudWxsKSk7Ci0gICAgICAgICAgICBpZiAobUV4cGFuZGVkVmlzaWJsZSkgewotICAgICAgICAgICAgICAgIHNldERhdGVWaWV3VmlzaWJpbGl0eShmYWxzZSwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hbmltLnB1c2hfdXBfb3V0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICB2b2lkIHRpY2tlckRvbmUoKSB7Ci0gICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgInRpY2tlckRvbmUiKTs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QotICAgICAgICAgICAgICAgICE9IFBhY2thZ2VNYW5hZ2VyLlBFUk1JU1NJT05fR1JBTlRFRCkgewotICAgICAgICAgICAgcHcucHJpbnRsbigiUGVybWlzc2lvbiBEZW5pYWw6IGNhbid0IGR1bXAgU3RhdHVzQmFyIGZyb20gZnJvbSBwaWQ9IgotICAgICAgICAgICAgICAgICAgICArIEJpbmRlci5nZXRDYWxsaW5nUGlkKCkKLSAgICAgICAgICAgICAgICAgICAgKyAiLCB1aWQ9IiArIEJpbmRlci5nZXRDYWxsaW5nVWlkKCkpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgc3luY2hyb25pemVkIChtUXVldWVMb2NrKSB7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCJDdXJyZW50IFN0YXR1cyBCYXIgc3RhdGU6Iik7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCIgIG1FeHBhbmRlZD0iICsgbUV4cGFuZGVkCi0gICAgICAgICAgICAgICAgICAgICsgIiwgbUV4cGFuZGVkVmlzaWJsZT0iICsgbUV4cGFuZGVkVmlzaWJsZSk7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCIgIG1UaWNraW5nPSIgKyBtVGlja2luZyk7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCIgIG1UcmFja2luZz0iICsgbVRyYWNraW5nKTsKLSAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbUFuaW1hdGluZz0iICsgbUFuaW1hdGluZwotICAgICAgICAgICAgICAgICAgICArICIsIG1BbmltWT0iICsgbUFuaW1ZICsgIiwgbUFuaW1WZWw9IiArIG1BbmltVmVsCi0gICAgICAgICAgICAgICAgICAgICsgIiwgbUFuaW1BY2NlbD0iICsgbUFuaW1BY2NlbCk7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCIgIG1DdXJBbmltYXRpb25UaW1lPSIgKyBtQ3VyQW5pbWF0aW9uVGltZQotICAgICAgICAgICAgICAgICAgICArICIgbUFuaW1MYX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XRpb25JY29ucy5zdGFydEFuaW1hdGlvbihsb2FkQW5pbShhbmltLCBudWxsKSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICB2b2lkIHVwZGF0ZUV4cGFuZGVkVmlld1BvcyhpbnQgZXhwYW5kZWRQb3NpdGlvbikgewotICAgICAgICBpZiAoU1BFVykgewotICAgICAgICAgICAgU2xvZy5kKFRBRywgInVwZGF0ZUV4cGFuZGVkVmlld1BvcyBiZWZvcmUgZXhwYW5kZWRQb3NpdGlvbj0iICsgZXhwYW5kZWRQb3NpdGlvbgotICAgICAgICAgICAgICAgICAgICArICIgbVRyYWNraW5nUGFyYW1zLnk9IiAKLSAgICAgICAgICAgICAgICAgICAgKyAoKG1UcmFja2luZ1BhcmFtcyA9PSBudWxsKSA/ICI/Pz8iIDogbVRyYWNraW5nUGFyYW1zLnkpCi0gICAgICAgICAgICAgICAgICAgICsgIiBtVHJhY2tpbmdQb3NpdGlvbj0iICsgbVRyYWNraW5nUG9zaXRpb24pOwotICAgICAgICB9Ci0KLSAgICAgICAgaW50IGggPSBtU3RhdHVzQmFyVmlldy5nZXRIZWlnaHQoKTsKLSAgICAgICAgaW50IGRpc3BoID0gbURpc3BsYXkuZ2V0SGVpZ2h0KCk7Ci0KLSAgICAgICAgLy8gSWYgdGhlIGV4cGFuZGVkIHZpZXcgaXMgbm90IHZpc2libGUsIG1ha2Ugc3VyZSB0aGV5J3JlIHN0aWxsIG9mZiBzY3JlZW4uCi0gICAgICAgIC8vIE1heWJlIHRoZSB2aWV3IHdhcyByZXNpemVkLgotICAgICAgICBpZiAoIW1FeHBhbmRlZFZpc2libGUpIHsKLSAgICAgICAgICAgIGlmIChtVHJhY2tpbmdWaWV3ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtVHJhY2tpbmdQb3NpdGlvbiA9IC1kaXNwaDsKLSAgICAgICAgICAgICAgICBpZiAobVRyYWNraW5nUGFyYW1zICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgbVRyYWNraW5nUGFyYW1zLnkgPSBtVHJhY2tpbmdQb3NpdGlvbjsKLSAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlckltcGwuZ2V0RGVmYXVsdCgpLnVwZGF0ZVZpZXdMYXlvdXQobVRyYWNraW5nVmlldywgbVRyYWNraW5nUGFyYW1zKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobUV4cGFuZGVkUGFyYW1zICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtRXhwYW5kZWRQYXJhbXMueSA9IC1kaXNwaDsKLSAgICAgICAgICAgICAgICBtRXhwYW5kZWREaWFsb2cuZ2V0V2luZG93KCkuc2V0QXR0cmlidXRlcyhtRXhwYW5kZWRQYXJhbXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gdHJhY2tpbmcgdmlldy4uLgotICAgICAgICBpbnQgcG9zOwotICAgICAgICBpZiAoZXhwYW5kZWRQb3NpdGlvbiA9PSBFWFBBTkRFRF9GVUxMX09QRU4pIHsKLSAgICAgICAgICAgIHBvcyA9IGg7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoZXhwYW5kZWRQb3NpdGlvbiA9PSBFWFBBTkRFRF9MRUFWRV9BTE9ORSkgewotICAgICAgICAgICAgcG9zID0gbVRyYWNraW5nUG9zaXRpb247Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICBpZiAoZXhwYW5kZWRQb3NpdGlvbiA8PSBkaXNwaCkgewotICAgICAgICAgICAgICAgIHBvcyA9IGV4cGFuZGVkUG9zaXRpb247Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHBvcyA9IGRpc3BoOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcG9zIC09IGRpc3BoLWg7Ci0gICAgICAgIH0KLSAgICAgICAgbVRyYWNraW5nUG9zaXRpb24gPSBtVHJhY2tpbmdQYXJhbXMueSA9IHBvczsKLSAgICAgICAgbVRyYWNraW5nUGFyYW1zLmhlaWdodCA9IGRpc3BoLWg7Ci0gICAgICAgIFdpbmRvd01hbmFnZXJJbXBsLmdldERlZmF1bHQoKS51cGRhdGVWaWV3TGF5b3V0KG1UcmFja2luZ1ZpZXcsIG1UcmFja2luZ1BhcmFtcyk7Ci0KLSAgICAgICAgaWYgKG1FeHBhbmRlZFBhcmFtcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICBtQ2xvc2VWaWV3LmdldExvY2F0aW9uSW5XaW5kb3cobVBvc2l0aW9uVG1wKTsKLSAgICAgICAgICAgIGZpbmFsIGludCBjbG9zZVBvcyA9IG1Qb3NpdGlvblRtcFsxXTsKLQotICAgICAgICAgICAgbUV4cGFuZGVkQ29udGVudHMuZ2V0TG9jYXRpb25JbldpbmRvdyhtUG9zaXRpb25UbXApOwotICAgICAgICAgICAgZmluYWwgaW50IGNvbnRlbnRzQm90dG9tID0gbVBvc2l0aW9uVG1wWzFdICsgbUV4cGFuZGVkQ29udGVudHMuZ2V0SGVpZ2h0KCk7Ci0KLSAgICAgICAgICAgIGlmIChleHBhbmRlZFBvc2l0aW9uICE9IEVYUEFOREVEX0xFQVZFX0FMT05FKSB7Ci0gICAgICAgICAgICAgICAgbUV4cGFuZGVkUGFyYW1zLnkgPSBwb3MgKyBtVHJhY2tpbmdWaWV3LmdldEhlaWdodCgpCi0gICAgICAgICAgICAgICAgICAgICAgICAtIChtVHJhY2tpbmdQYXJhbXMuaGVpZ2h0LWNsb3NlUG9zKSAtIGNvbnRlbnRzQm90dG9tOwotICAgICAgICAgICAgICAgIGludCBtYXggPSBoOwotICAgICAgICAgICAgICAgIGlmIChtRXhwYW5kZWRQYXJhbXMueSA+IG1heCkgewotICAgICAgICAgICAgICAgICAgICBtRXhwYW5kZWRQYXJhbXMueSA9IG1heDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaW50IG1pbiA9IG1UcmFja2luZ1Bvc2l0aW9uOwotICAgICAgICAgICAgICAgIGlmIChtRXhwYW5kZWRQYXJhbXMueSA8IG1pbikgewotICAgICAgICAgICAgICAgICAgICBtRXhwYW5kZWRQYXJhbXMueSA9IG1pbjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBib29sZWFuIHZpc2libGUgPSAobVRyYWNraW5nUG9zaXRpb24gKyBtVHJhY2tpbmdWaWV3LmdldEhlaWdodCgpKSA+IGg7Ci0gICAgICAgICAgICAgICAgaWYgKCF2aXNpYmxlKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBjb250ZW50cyBhcmVuJ3QgdmlzaWJsZSwgbW92ZSB0aGUgZXhwYW5kZWQgdmlldyB3YXkgb2ZmIHNjcmVlbgotICAgICAgICAgICAgICAgICAgICAvLyBiZWNhdXNlIHRoZSB3aW5kb3cgaXRzZWxmIGV4dGVuZHMgYmVsb3cgdGhlIGNvbnRlbnQgdmlldy4KLSAgICAgICAgICAgICAgICAgICAgbUV4cGFuZGVkUGFyYW1zLnkgPSAtZGlzcGg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1FeHBhbmRlZERpYWxvZy5nZXRXaW5kb3coKS5zZXRBdHRyaWJ1dGVzKG1FeHBhbmRlZFBhcmFtcyk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgInVwZGF0ZUV4cGFuZGVkVmlld1BvcyB2aXNpYmlsaXR5Q2hhbmdlZCgiICsgdmlzaWJsZSArICIpIik7Ci0gICAgICAgICAgICAgICAgdmlzaWJpbGl0eUNoYW5nZWQodmlzaWJsZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKyAgICAgICAgLy8gVE9ETyBscC53aW5kb3dBbmltYXRpb25zID0gUi5zdHlsZS5BbmltYXRpb25fU3RhdHVzQmFyOworICAgICAgICBXaW5kb3dNYW5hZ2VySW1wbC5nZXREZWZhdWx0KCkuYWRkVmlldyhzYiwgbHApOwogCiAgICAgICAgIGlmIChTUEVXKSB7Ci0gICAgICAgICAgICBTbG9nLmQoVEFHLCAidXBkYXRlRXhwYW5kZWRWaWV3UG9zIGFmdGVyICBleHBhbmRlZFBvc2l0aW9uPSIgKyBleHBhbmRlZFBvc2l0aW9uCi0gICAgICAgICAgICAgICAgICAgICsgIiBtVHJhY2tpbmdQYXJhbXMueT0iICsgbVRyYWNraW5nUGFyYW1zLnkKLSAgICAgICAgICAgICAgICAgICAgKyAiIG1UcmFja2luZ1Bvc2l0aW9uPSIgKyBtVHJhY2tpbmdQb3NpdGlvbgotICAgICAgICAgICAgICAgICAgICArICIgbUV4cGFuZGVkUGFyYW1zLnk9IiArIG1FeHBhbmRlZFBhcmFtcy55Ci0gICAgICAgICAgICAgICAgICAgICsgIiBtRXhwYW5kZWRQYXJhbXMuaGVpZ2h0PSIgKyBtRXhwYW5kZWRQYXJhbXMuaGVpZ2h0KTsKKyAgICAgICAgICAgIFNsb2cuZChUQUcsICJBZGRlZCBzdGF0dXMgYmFyIHZpZXc6IGdyYXZpdHk9MHgiICsgSW50ZWdlci50b0hleFN0cmluZyhscC5ncmF2aXR5KSAKKyAgICAgICAgICAgICAgICAgICArICIgaWNvbnM9IiArIGljb25MaXN0LnNpemUoKQorICAgICAgICAgICAgICAgICAgICsgIiBkaXNhYmxlZD0weCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKHN3aXRjaGVzWzBdKQorICAgICAgICAgICAgICAgICAgICsgIiBsaWdodHM9IiArIHN3aXRjaGVzWzFdCisgICAgICAgICAgICAgICAgICAgKyAiIG1lbnU9IiArIHN3aXRjaGVzWzJdCisgICAgICAgICAgICAgICAgICAgKyAiIGltZUJ1dHRvbj0iICsgc3dpdGNoZXNbM10KKyAgICAgICAgICAgICAgICAgICApOwogICAgICAgICB9CiAgICAgfQotCi0gICAgaW50IGdldEV4cGFuZGVkSGVpZ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nZXIuRElTQUJMRV9OT1RJRklDQVRJT05fSUNPTlMpICE9IDApIHsKLSAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiRElTQUJMRV9OT1RJRklDQVRJT05fSUNPTlM6IHllcyIpOwotICAgICAgICAgICAgICAgIGlmIChtVGlja2luZykgewotICAgICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uSWNvbnMuc2V0VmlzaWJpbGl0eShWaWV3LklOVklTSUJMRSk7Ci0gICAgICAgICAgICAgICAgICAgIG1UaWNrZXIuaGFsdCgpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHNldE5vdGlmaWNhdGlvbkljb25WaXNpYmlsaXR5KGZhbHNlLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0uZmFkZV9vdXQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkRJU0FCTEVfTk9USUZJQ0FUSU9OX0lDT05TOiBubyIpOwotICAgICAgICAgICAgICAgIGlmICghbUV4cGFuZGVkVmlzaWJsZSkgewotICAgICAgICAgICAgICAgICAgICBzZXROb3RpZmljYXRpb25JY29uVmlzaWJpbGl0eSh0cnVlLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0uZmFkZV9pbik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKChkaWZmICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05PVElGSUNBVElPTl9USUNLRVIpICE9IDApIHsKLSAgICAgICAgICAgIFNsb2cuZChUQUcsICJESVNBQkxFX05PVElGSUNBVElPTl9USUNLRVI6ICIKLSAgICAgICAgICAgICAgICArICgoKG5ldCAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9OT1RJRklDQVRJT05fVElDS0VSKSAhPSAwKQotICAgICAgICAgICA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ICAgICAgICBib29sZWFuIG5pZ2h0TW9kZSA9IChuZXdDb25maWcudWlNb2RlICYgQ29uZmlndXJhdGlvbi5VSV9NT0RFX05JR0hUX01BU0spCisgICAgICAgICAgICAgICAgPT0gQ29uZmlndXJhdGlvbi5VSV9NT0RFX05JR0hUX1lFUzsKKyAgICAgICAgaWYgKG1OaWdodE1vZGUgIT0gbmlnaHRNb2RlKSB7CisgICAgICAgICAgICBtTmlnaHRNb2RlID0gbmlnaHRNb2RlOworICAgICAgICAgICAgbVN0YXJ0QWxwaGEgPSBnZXRDdXJBbHBoYSgpOworICAgICAgICAgICAgbUVuZEFscGhhID0gbU5pZ2h0TW9kZSA/IDB4ODAgOiAweDAwOworICAgICAgICAgICAgbUVuZFRpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSArIERJTV9BTklNX1RJTUU7CisgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpbnQgZ2V0Q3VyQWxwaGEoKSB7CisgICAgICAgIGxvbmcgdGltZSA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOworICAgICAgICBpZiAodGltZSA+IG1FbmRUaW1lKSB7CisgICAgICAgICAgICByZXR1cm4gbUVuZEFscGhhOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtRW5kQWxwaGEKKyAgICAgICAgICAgICAgICAtIChpbnQpKCgobUVuZEFscGhhLW1TdGFydEFscGhhKSAqIChtRW5kVGltZS10aW1lKSAvIERJTV9BTklNX1RJTUUpKTsKKyAgICB9CisgICAgCisgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIHZvaWQgb25TaXplQ2hhbmdlZChpbnQgdywgaW50IGgsIGludCBvbGR3LCBpbnQgb2xkaCkgewogICAgICAgICBzdXBlci5vblNpemVDaGFuZ2VkKHcsIGgsIG9sZHcsIG9sZGgpOwotICAgICAgICBtU2VydmljZS51cGRhdGVFeHBhbmRlZFZpZXdQb3MoU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k7CisgICAgICAgIC8vIFRPRE86IHJlYWQgdGhlIGN1cnJlbnQgaWNvbiAmIHZpc2liaWxpdHkgc3RhdGUgZGlyZWN0bHkgZnJvbSB0aGUgc2VydmljZQorCisgICAgICAgIC8vIFRPRE86IHJlZ2lzdGVyIGZvciBub3RpZmljYXRpb25zIGFib3V0IGNoYW5nZXMgdG8gdmlzaWJpbGl0eSAmIHN1YnR5cGUgZnJvbSBzZXJ2aWNlCisKKyAgICAgICAgc2V0T25DbGlja0xpc3RlbmVyKG5ldyBWaWV3Lk9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKKyAgICAgICAgICAgICAgICBtSW1tLnNob3dJbnB1dE1ldGhvZFN1YnR5cGVQaWNrZXIoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25BdHRhY2hlZFRvV2luZG93KCkgeworICAgICAgICBtSWNvbiA9IChJbWFnZVZpZXcpIGZpbmRWaWV3QnlJZChSLmlkLmltZUJ1dHRvbik7CisKKyAgICAgICAgcmVmcmVzaFN0YXR1c0ljb24obUtleWJvYXJkU2hvd24pOworICAgIH0KKworICAgIHByaXZhdGUgSW5wdXRNZXRob2RJbmZvIGdldEN1cnJlbnRJbnB1dE1ldGhvZEluZm8oKSB7CisgICAgICAgIFN0cmluZyBjdXJJbnB1dE1ldGhvZElkID0gU2V0dGluZ3MuU2VjdXJlLmdldFN0cmluZyhnZXRDb250ZXh0KCkKKyAgICAgICAgICAgICAgICAuZ2V0Q29udGVudFJlc29sdmVyKCksIFNldHRpbmdzLlNlY3VyZS5ERUZBVUxUX0lOUFVUX01FVEhPRCk7CisgICAgICAgIExpc3Q8SW5wdXRNZXRob2RJbmZvPiBpbWlzID0gbUltbS5nZXRFbmFibGVkSW5wdXRNZXRob2RMaXN0KCk7CisgICAgICAgIGlmIChjdXJJbnB1dE1ldGhvZElkICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoSW5wdXRNZXRob2RJbmZvIGltaTogaW1pcykgeworICAgICAgICAgICAgICAgIGlmIChpbWkuZ2V0SWQoKS5lcXVhbHMoY3VySW5wdXRNZXRob2RJZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGltaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHJpdmF0ZSBEcmF3YWJsZSBnZXRDdXJyZW50U3VidHlwZUljb24oKSB7CisgICAgICAgIGZpbmFsIFBhY2thZ2VNYW5hZ2VyIHBtID0gZ2V0Q29udGV4dCgpLmdldFBhY2thZ2VNYW5hZ2VyKCk7CisgICAgICAgIElucHV0TWV0aG9kSW5mbyBpbWkgPSBnZXRDdXJyZW50SW5wdXRNZXRob2RJbmZvKCk7CisgICAgICAgIElucHV0TWV0aG9kU3VidHlwZSBzdWJ0eXBlID0gbUltbS5nZXRDdXJyZW50SW5wdXRNZXRob2RTdWJ0eXBlKCk7CisgICAgICAgIERyYXdhYmxlIGljb24gPSBudWxsOworICAgICAgICBpZiAoaW1pICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChERUJVRykgeworICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIi0tLSBVcGRhdGUgaWNvbnMgb2YgSU1FOiAiICsgaW1pLmdldFBhY2thZ2VOYW1lKCkgKyAiLCIgKyBzdWJ0eXBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChzdWJ0eXBlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gcG0uZ2V0RHJhd2FibGUoaW1pLmdldFBhY2thZ2VOYW1lKCksIHN1YnR5cGUuZ2V0SWNvblJlc0lkKCksCisgICAgICAgICAgICAgICAgICAgICAgICBpbWkuZ2V0U2VydmljZUluZm8oKS5hcHBsaWNhdGlvbkluZm8pOworICAgICAgICAgICAgfSBlbHNlIGlmIChpbWkuZ2V0U3VidHlwZXMoKS5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHBtLmdldERyYXdhYmxlKGltaS5nZXRQYWNrYWdlTmFtZSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgaW1pLmdldFN1YnR5cGVzKCkuZ2V0KDApLmdldEljb25SZXNJZCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgaW1pLmdldFNlcnZpY2VJbmZvKCkuYXBwbGljYXRpb25JbmZvKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBtLmdldEFwcGxpY2F0aW9uSW5mbyhpbWkuZ2V0UGFja2FnZU5hbWUoKSwgMCkubG9hZEljb24ocG0pOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFBhY2thZ2VNYW5hZ2VyLk5hbWVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkN1cnJlbnQgSU1FIGNhbm4ndCBiZSBmb3VuZDogIiArIGltaS5nZXRQYWNrYWdlTmFtZSgpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlZnJlc2hTdGF0dXNJY29uKGJvb2xlYW4ga2V5Ym9hcmRTaG93bikgeworICAgICAgICBpZiAoIWtleWJvYXJkU2hvd24pIHsKKyAgICAgICAgICAgIHNldFZpc2liaWxpdHkoVmlldy5JTlZJU0lCTEUpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpO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sKK2ltcG9ydCBhbmRyb2lkLndpZGdldC5JbWFnZVZpZXc7CitpbXBvcnQgYW5kcm9pZC52aWV3Lk1vdGlvbkV2ZW50OworCitpbXBvcnQgY29tLmFuZHJvaWQuc3lzdGVtdWkuUjsKKworCitwdWJsaWMgY2xhc3MgTm90aWZpY2F0aW9uSWNvbkFyZWEgZXh0ZW5kcyBMaW5lYXJMYXlvdXQgeworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBUQUcgPSAiTm90aWZpY2F0aW9uSWNvbkFyZWEiOworCisgICAgSWNvbkxheW91dCBtSWNvbkxheW91dDsKKworICAgIHB1YmxpYyBOb3RpZmljYXRpb25JY29uQXJlYShDb250ZXh0IGNvbnRleHQsIEF0dHJpYnV0ZVNldCBhdHRycykgeworICAgICAgICBzdXBlcihjb250ZXh0LCBhdHRycyk7CisKKyAgICAgICAgbUljb25MYXlvdXQgPSAoSWNvbkxheW91dClmaW5kVmlld0J5SWQoUi5pZC5pY29ucyk7CisgICAgfQorCisgICAgc3RhdGljIGNsYXNzIEljb25MYXlvdXQgZXh0ZW5kcyBMaW5lYXJMYXlvdXQgeworICAgICAgICBwdWJsaWMgSWNvbkxheW91dChDb250ZXh0IGNvbnRleHQsIEF0dHJpYnV0ZVNldCBhdHRycykgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgYXR0cnMpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25JbnRlcmNlcHRUb3VjaEV2ZW50KE1vdGlvbkV2ZW50IGUpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgfQorfQorCisKKwpkaWZmIC0tZ2l0IGEvcGFja2FnZXMvU3lzdGVtVUkvc3JjL2NvbS9hbmRyb2lkL3N5c3RlbXVpL3N0YXR1c2Jhci90YWJsZXQvTm90aWZpY2F0aW9uUGFuZWwuamF2YSBiL3BhY2thZ2VzL1N5c3RlbVVJL3NyYy9jb20vYW5kcm9pZ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SUdIVCA9IDc1OworICAgIHByaXZhdGUgVGFibGV0U3RhdHVzQmFyU2VydmljZSBtQmFyOworICAgIHByaXZhdGUgVGV4dFZpZXcgbU5vUmVjZW50czsKKyAgICBwcml2YXRlIExpbmVhckxheW91dCBtUmVjZW50c0NvbnRhaW5lcjsKKyAgICBwcml2YXRlIGZsb2F0IG1EZW5zaXR5OworICAgIHByaXZhdGUgSG9yaXpvbnRhbFNjcm9sbFZpZXcgbVNjcm9sbFZpZXc7CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0luQ29udGVudEFyZWEoaW50IHgsIGludCB5KSB7CisgICAgICAgIGZpbmFsIGludCBsID0gZ2V0UGFkZGluZ0xlZnQoKTsKKyAgICAgICAgZmluYWwgaW50IHIgPSBnZXRXaWR0aCgpIC0gZ2V0UGFkZGluZ1JpZ2h0KCk7CisgICAgICAgIGZpbmFsIGludCB0ID0gZ2V0UGFkZGluZ1RvcCgpOworICAgICAgICBmaW5hbCBpbnQgYiA9IGdldEhlaWdodCgpIC0gZ2V0UGFkZGluZ0JvdHRvbSgpOworICAgICAgICByZXR1cm4geCA+PSBsICYmIHggPCByICYmIHkgPj0gdCAmJiB5IDwgYjsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRCYXIoVGFibGV0U3RhdHVzQmFyU2VydmljZSBiYXIpIHsKKyAgICAgICAgbUJhciA9IGJhcjsKKyAgICB9CisKKyAgICBwdWJsaWMgUmVjZW50QXBwc1BhbmVsKENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzKSB7CisgICAgICAgIHRoaXMoY29udGV4dCwgYXR0cnMsIDApOworICAgIH0KKworICAgIHB1YmxpYyBSZWNlbnRBcHBzUGFuZWwoQ29udGV4dCBjb250ZXh0LCBBdHRyaWJ1dGVTZXQgYXR0cnMsIGludCBkZWZTdHlsZSkgeworICAgICAgICBzdXBlcihjb250ZXh0LCBhdHRycywgZGVmU3R5bGUpOworICAgICAgICBtRGVuc2l0e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UpOworICAgICAgICAgICAgbVJlY2VudHNDb250YWluZXIuc2Nyb2xsVG8oMCwgMCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVmcmVzaEljb25zKCkgeworICAgICAgICBtUmVjZW50c0NvbnRhaW5lci5yZW1vdmVBbGxWaWV3cygpOworICAgICAgICBmaW5hbCBDb250ZXh0IGNvbnRleHQgPSBnZXRDb250ZXh0KCk7CisgICAgICAgIGZpbmFsIFBhY2thZ2VNYW5hZ2VyIHBtID0gY29udGV4dC5nZXRQYWNrYWdlTWFuYWdlcigpOworICAgICAgICBmaW5hbCBBY3Rpdml0eU1hbmFnZXIgYW0gPSAoQWN0aXZpdHlNYW5hZ2VyKQorICAgICAgICAgICAgICAgIGNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LkFDVElWSVRZX1NFUlZJQ0UpOworICAgICAgICBmaW5hbCBMaXN0PEFjdGl2aXR5TWFuYWdlci5SZWNlbnRUYXNrSW5mbz4gcmVjZW50VGFza3MgPQorICAgICAgICAgICAgICAgIGFtLmdldFJlY2VudFRhc2tzKE1BWF9SRUNFTlRfVEFTS1MsIEFjdGl2aXR5TWFuYWdlci5SRUNFTlRfSUdOT1JFX1VOQVZBSUxBQkxFKTsKKworICAgICAgICBBY3Rpdml0eUluZm8gaG9tZUluZm8gPSBuZXcgSW50ZW50KEludGVudC5BQ1RJT05fTUFJTikKKyAgICAgICAgICAgICAgICAuYWRkQ2F0ZWdvcnkoSW50ZW50LkNBVEVHT1JZX0hPTUUpCisgICAgICAgICAgICAgICAgLnJlc29sdmVBY3Rpdml0eUluZm8ocG0sIDApOworCisgICAgICAgIGludCBudW1UYXNrcyA9IHJlY2VudFRhc2tzLnNpemUoKTsKKyAgICAgICAgZmluYWwgaW50IHdpZHRoID0gKGludCkgKG1EZW5zaXR5ICogSVRFTV9XSURUSCArIDAuNWYpOworICAgICAgICBmaW5hbCBpbnQgaGVpZ2h0ID0gKGludCkgKG1EZW5zaXR5ICogSVRFTV9IRUlHSFQgKyAwLjVmKTsKKyAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcyBsYXlvdXRQYXJhbXMgPSBuZXcgVmlld0dyb3VwLkxheW91dFBhcmFtcyh3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1UYXNrczsgKytpKSB7CisgICAgICAgICAgICBmaW5hbCBBY3Rpdml0eU1hbmFnZXIuUmVjZW50VGFza0luZm8gaW5mbyA9IHJlY2VudFRhc2tzLmdldChpKTsKKworICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoaW5mby5iYXNlSW50ZW50KTsKKyAgICAgICAgICAgIGlmIChpbmZvLm9yaWdBY3Rpdml0eSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW50ZW50LnNldENvbXBvbmVudChpbmZvLm9yaWdBY3Rpdml0eSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIEV4Y2x1ZGUgaG9tZSBhY3Rpdml0eS4KKyAgICAgICAgICAgIGlmIChob21lSW5mbyAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgICYmIGhvbWVJbmZvLnBhY2thZ2VOYW1lLmVxdWFscyhpbnRlbnQuZ2V0Q29tcG9uZW50KCkuZ2V0UGFja2FnZU5hbWUoKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgaG9tZUluZm8ubmFtZS5lcXVhbHMoaW50ZW50LmdldENvbXBvbmVudCgpLmdldENsYXNzTmFtZSgpKSkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50ZW50LnNldEZsYWdzKChpbnRlbnQuZ2V0RmxhZ3MoKSZ+SW50ZW50LkZMQUdfQUNUSVZJVFlfUkVTRVRfVEFTS19JRl9ORUVERUQpCisgICAgICAgICAgICAgICAgICAgIHwgSW50ZW50LkZMQUdfQUNUSVZJVFlfTkVXX1RBU0spOworICAgICAgICAgICAgZmluYWwgUmVzb2x2ZUluZm8gcmVzb2x2ZUluZm8gPSBwbS5yZXNvbHZlQWN0aXZpdHkoaW50ZW50LCAwKTsKKyAgICAgICAgICAgIGlmIChyZXNvbHZlSW5mbyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZmluYWwgQWN0aXZpdHlJbmZvIGFjdGl2aXR5SW5mbyA9IHJlc29sdmVJbmZvLmFjdGl2aXR5SW5mbzsKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgdGl0bGUgPSBhY3Rpdml0eUluZm8ubG9hZExhYmVsKHBtKS50b1N0cmluZygpOworICAgICAgICAgICAgICAgIERyYXdhYmxlIGljb24gPSBhY3Rpdml0eUluZm8ubG9hZEljb24ocG0pOworCisgICAgICAgICAgICAgICAgaWYgKHRpdGxlICE9IG51bGwgJiYgdGl0bGUubGVuZ3RoKCkgPiAwICYmIGljb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBJbWFnZVZpZXcgaW1hZ2VWaWV3ID0gbmV3IEltYWdlVmlldyhtQ29udGV4dCk7CisgICAgICAgICAgICAgICAgICAgIGltYWdlVmlldy5zZXRTY2FsZVR5cGUoSW1hZ2VWaWV3LlNjYWxlVHlwZS5GSVRfWFkpOworICAgICAgICAgICAgICAgICAgICBpbWFnZVZpZXcuc2V0TGF5b3V0UGFyYW1zKGxheW91dFBhcmFtcyk7CisgICAgICAgICAgICAgICAgICAgIGltYWdlVmlldy5zZXRPbkNsaWNrTGlzdGVuZXIodGhpcyk7CisgICAgICAgICAgICAgICAgICAgIGltYWdlVmlldy5zZXRUYWcoaW50ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgaW1hZ2VWaWV3LnNldEltYWdlRHJhd2FibGUoaWNvbik7CisgICAgICAgICAgICAgICAgICAgIG1SZWNlbnRzQ29udGFpbmVyLmFkZFZpZXcoaW1hZ2VWaWV3KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg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W1hZ2VWaWV3IG1JY29uOworICAgIHByaXZhdGUgSW1hZ2VWaWV3IG1QcmV2aWV3SWNvbjsKKyAgICBwcml2YXRlIFRleHRWaWV3IG1EZXNjcmlwdGlvbjsKKyAgICBwcml2YXRlIFRleHRWaWV3IG1BbHRUZXh0OworCisgICAgcHVibGljIFNoaXJ0UG9ja2V0KENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzKSB7CisgICAgICAgIHN1cGVyKGNvbnRleHQsIGF0dHJzKTsKKyAgICAgICAgc2V0dXBXaW5kb3coKTsKKyAgICB9CisKKyAgICAvLyBUT0RPOiAicGluIGFyZWEiIHBhbmVsLCBkcmFnZ2luZyB0aGluZ3Mgb3V0CisgICAgT2JqZWN0QW5pbWF0b3IgbUFuaW1IaWRlLCBtQW5pbVNob3c7CisgICAgCisgICAgcHJvdGVjdGVkIHZvaWQgb25BdHRhY2hlZFRvV2luZG93KCkgeworICAgICAgICAvLyBEcmFnIEFQSSBub3Rlczogd2UgbXVzdCBiZSB2aXNpYmxlIHRvIHJlY2VpdmUgZHJhZyBldmVudHMKKyAgICAgICAgc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworCisgICAgICAgIG1JY29uID0gKEltYWdlVmlldykgZmluZFZpZXdCeUlkKFIuaWQucG9ja2V0X2ljb24pOworICAgICAgICByZWZyZXNoU3RhdHVzSWNvbigpOworCisgICAgICAgIHNldE9uQ2xpY2tMaXN0ZW5lcihuZXcgVmlldy5PbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgIGlmIChtQ2xpcHBpbmcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAobVdpbmRvdy5nZXRWaXNpYmlsaXR5KCkgPT0gVmlldy5WSVNJQkxFKSBoaWRlV2luZG93KCk7IAorICAgICAgICAgICAgICAgICAgICBlbHNlIHNob3dXaW5kb3coKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0pOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZWZyZXNoU3RhdHVzSWNvbigpIHsKKyAgICAgICAgc2V0Q2xpY2thYmxlKG1DbGlwcGluZyAhPSBudWxsKTsKKyAgICAgICAgbUljb24uc2V0SW1hZ2VSZXNvdXJjZShtQ2xpcHBpbmcgPT0gbnVsbAorICAgICAgICAgICAgICAgID8gUi5kcmF3YWJsZS5pY19zeXNiYXJfcG9ja2V0X2hpZGRlbgorICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5pY19zeXNiYXJfcG9ja2V0X2hvbGRpbmcpOworICAgICAgICBtSWNvbi5zZXRWaXNpYmlsaXR5KG1DbGlwcGluZyA9PSBudWxsID8gVmlldy5JTlZJU0lCTEUgOiBWaWV3LlZJU0lCTEUpOworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIHZvaWQgc2hvd1dpbmRvdygpIHsKKyAgICAgICAgZ2V0SGFuZGxlcigpLnBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIG1XaW5kb3cuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgICAgIHJlZnJlc2hTdGF0dXNJY29uKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0pOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBoaWRlV2luZG93KCkgeworICAgICAgICBnZXRIYW5kbGVyKCkucG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgbVdpbmRvdy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgcmVmcmVzaFN0YXR1c0ljb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgdm9pZCBoaWRlV2luZG93SW5KdXN0QVNlYygpIHsKKyAgICAgICAgZ2V0SGFuZGxlcigpLnBvc3REZWxheWVkKG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBtV2luZG93LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgICAgICByZWZyZXNoU3RhdHVzSWNvbigpOworICAgICAgICAgICAgfQorICAgICAgICB9LAorICAgICAgICAyNTApOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzdGFzaChDbGlwRGF0YSBjbGlwcGluZykgeworICAgICAgICBtQ2xpcHBpbmcgPSBjbGlwcGluZzsKKyAgICAgICAgaWYgKG1DbGlwcGluZyAhPSBudWxsKSB7CisgICAgICAgICAgICBCaXRtYXAgaWNvbiA9IG1DbGlwcGluZy5nZXRJY29uKCk7CisgICAgICAgICAgICBtRGVzY3JpcHRpb24uc2V0VGV4dChtQ2xpcHBpbmcuZ2V0RGVzY3JpcHRpb24oKS5nZXRMYWJlbCgpKTsKKyAgICAgICAgICAgIGlmIChpY29uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtUHJldmlld0ljb24uc2V0SW1hZ2VCaXRtYXAoaWNvbik7CisgICAgICAgICAgICAgICAgbVByZXZpZXdJY29uLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgICAgICBtQWx0VGV4dC5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1QcmV2aWV3SWNvbi5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgbUFsdFRleHQuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgICAgIGlmIChtQ2xpcHBpbmcuZ2V0SXRlbUNvdW50KCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IGZpZ3VyZSBvdXQgaG93IHRvIHZpc3VhbGl6ZSBldmVyeSBraW5kIG9mIENsaXBEYXRhIQorICAgICAgICAgICAgICAgICAgICBtQWx0VGV4dC5zZXRUZXh0KG1DbGlwcGluZy5nZXRJdGVtKDApLmNvZXJjZVRvVGV4dChnZXRDb250ZXh0KCkpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gaXNJblZpZXdDb250ZW50QXJlYShWaWV3IHYsIGludCB4LCBpbnQgeSkgeworICAgICAgICBmaW5hbCBpbnQgbCA9IHYuZ2V0UGFkZGluZ0xlZnQoKTsKKyAgICAgICAgZmluYWwgaW50IHIgPSB2LmdldFdpZHRoKCkgLSB2LmdldFBhZGRpbmdSaWdodCgpOworICAgICAgICBmaW5hbCBpbnQgdCA9IHYuZ2V0UGFkZGluZ1RvcCgpOworICAgICAgICBmaW5hbCBpbnQgYiA9IHYuZ2V0SGVpZ2h0KCkgLSB2LmdldFBhZGRpbmdCb3R0b20oKTsKKyAgICAgICAgcmV0dXJuIHggPj0gbCAmJiB4IDwgciAmJiB5ID49IHQgJiYgeSA8IGI7CisgICAgfQorCisgICAgVmlldy5PblRvdWNoTGlzdGVuZXIgbVdpbmRvd1RvdWNoTGlzdGVuZXIgPSBuZXcgVmlldy5PblRvdWNoTGlzdGVuZXIoKSB7CisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2goVmlldyB2LCBNb3Rpb25FdmVudCBldikgeworICAgICAgICAgICAgZmluYWwgaW50IGFjdGlvbiA9IGV2LmdldEFjdGlvbigpOworICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fT1VUU0lERQorICAgICAgICAgICAgICAgICAgICB8fCAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhaXNJblZpZXdDb250ZW50QXJlYShtV2luZG93LCAoaW50KWV2LmdldFgoKSwgKGludClldi5nZXRZKCkpKSkgeworICAgICAgICAgICAgICAgIGhpZGVXaW5kb3coKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOKSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkFDVElPTl9ET1dOIik7CisgICAgICAgICAgICAgICAgZmluYWwgQ2xpcERhdGEgY2xpcCA9IG1DbGlwcGluZzsKKyAgICAgICAgICAgICAgICBpZiAoY2xpcCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIEJpdG1hcCBpY29uID0gY2xpcC5nZXRJY29uKCk7CisgICAgICAgICAgICAgICAgICAgIERyYWdUaHVtYm5haWxCdWlsZGVyIHRodW1iOworICAgICAgICAgICAgICAgICAgICBpZiAoaWNvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHVtYiA9IG5ldyBEcmFnVGh1bWJuYWlsQnVpbGRlcih2KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25Qcm92aWRlVGh1bWJuYWlsTWV0cmljcyhQb2ludCB0aHVtYm5haWxTaXplLCBQb2ludCB0aHVtYm5haWxUb3VjaFBvaW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRodW1ibmFpbFNpemUuc2V0KGljb24uZ2V0V2lkdGgoKSwgaWNvbi5nZXRIZWlnaHQoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRodW1ibmFpbFRvdWNoUG9pbnQuc2V0KHRodW1ibmFpbFNpemUueCAvIDIsIHRodW1ibmFpbFNpemUueSAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkRyYXdUaHVtYm5haWwoQ2FudmFzIGNhbnZhcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChpY29uLCAwLCAwLCBuZXcgUGFpbnQoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVoaGgsIHdoYXQgbm93PworICAgICAgICAgICAgICAgICAgICAgICAgdGh1bWIgPSBuZXcgRHJhZ1RodW1ibmFpbEJ1aWxkZXIobVdpbmRvdy5maW5kVmlld0J5SWQoUi5pZC5wcmV2aWV3KSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB2LnN0YXJ0RHJhZyhjbGlwLCB0aHVtYiwgZmFsc2UpOworCisgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IG9ubHkgZGlzY2FyZCB0aGUgY2xpcHBpbmcgaWYgaXQgd2FzIGFjY2VwdGVkCisgICAgICAgICAgICAgICAgICAgIHN0YXNoKG51bGwpOworCisgICAgICAgICAgICAgICAgICAgIGhpZGVXaW5kb3dJbkp1c3RBU2VjKCk7IC8vIHdpbGwgcmVmcmVzaCB0aGUgaWNvbgorCisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICBwcml2YXRlIHZvaWQgc2V0dXBXaW5kb3coKSB7CisgICAgICAgIG1XaW5kb3cgPSBWaWV3LmluZmxhdGUoZ2V0Q29udGV4dCgpLCBSLmxheW91dC5zeXNiYXJfcGFuZWxfcG9ja2V0LCBudWxsKTsKKworICAgICAgICBtUHJldmlld0ljb24gPSAoSW1hZ2VWaWV3KSBtV2luZG93LmZpbmRWaWV3QnlJZChSLmlkLmljb24pOworICAgICAgICBtRGVzY3JpcHRpb24gPSAoVGV4dFZpZXcpIG1XaW5kb3cuZmluZFZpZXdCeUlkKFIuaWQuZGVzY3JpcHRpb24pOworICAgICAgICBtQWx0VGV4dCA9IChUZXh0VmlldykgbVdpbmRvdy5maW5kVmlld0J5SWQoUi5pZC5hbHQpOworCisgICAgICAgIG1XaW5kb3cuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICBtV2luZG93LnNldE9uVG91Y2hMaXN0ZW5lcihtV2luZG93VG91Y2hMaXN0ZW5lcik7CisgICAgICAgIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIGxwID0gbmV3IFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zKAorICAgICAgICAgICAgICAgIDQwMCwKKyAgICAgICAgICAgICAgICAyNTAsCisgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuVFlQRV9TVEFUVVNfQkFSX1BBTkVMLAorICAgICAgICAgICAgICAgIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfTEFZT1VUX0lOX1NDUkVFTgorICAgICAgICAgICAgICAgICAgICB8IFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfQUxUX0ZPQ1VTQUJMRV9JTSwKKyAgICAgICAgICAgICAgICBQaXhlbEZvcm1hdC5UUkFOU0xVQ0VOVCk7CisgICAgICAgIGxwLmdyYXZpdHkgPSBHcmF2aXR5LkJPVFRPTSB8IEdyYXZpdHkuUklHSFQ7CisvLyAgICAgICAgaW50IHBvc1tdID0gbmV3IGludFsyXTsKKy8vICAgICAgICBnZXRMb2NhdGlvbk9uU2NyZWVuKHBvcyk7CisvLyAgICAgICAgbHAueCA9IHBvc1sxXTsKKy8vICAgICAgICBscC55ID0gMDsKKyAgICAgICAgbHAuc2V0VGl0bGUoIlNoaXJ0UG9ja2V0Iik7CisgICAgICAgIGxwLndpbmRvd0FuaW1hdGlvbnMgPSBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlLkFuaW1hdGlvbl9TbGlkaW5nQ2FyZDsKKworICAgICAgICBXaW5kb3dNYW5hZ2VySW1wbC5nZXREZWZhdWx0KCkuYWRkVmlldyhtV2luZG93LCBscCk7CisKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBvbkRyYWdFdmVudChEcmFnRXZlbnQgZXZlbnQpIHsKKyAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAib25EcmFnRXZlbnQ6ICIgKyBldmVudCk7CisgICAgICAgIGlmIChtSWNvbiAhPSBudWxsKSB7CisgICAgICAgICAgICBzd2l0Y2ggKGV2ZW50LmdldEFjdGlvbigpKSB7CisgICAgICAgICAgICAgICAgLy8gV2Ugd2FudCB0byBhcHBlYXIgd2hlbmV2ZXIgYSBwb3RlbnRpYWwgZHJhZyB0YWtlcyBvZmYgZnJvbSBhbnl3aGVyZSBpbiB0aGUgVUkuCisgICAgICAgICAgICAgICAgY2FzZSBEcmFnRXZlbnQuQUNUSU9OX0RSQUdfU1RBUlRFRDoKKyAgICAgICAgICAgICAgICAgICAgbUljb24uc2V0SW1hZ2VSZXNvdXJjZShtQ2xpcHBpbmcgPT0gbnVsbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUi5kcmF3YWJsZS5pY19zeXNiYXJfcG9ja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBSLmRyYXdhYmxlLmljX3N5c2Jhcl9wb2NrZXRfaG9sZGluZyk7CisgICAgICAgICAgICAgICAgICAgIG1JY29uLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBEcmFnRXZlbnQuQUNUSU9OX0RSQUdfRU5URVJFRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAiZW50ZXJlZCEiKTsKKyAgICAgICAgICAgICAgICAgICAgbUljb24uc2V0SW1hZ2VSZXNvdXJjZShSLmRyYXdhYmxlLmljX3N5c2Jhcl9wb2NrZXRfZHJhZyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgRHJhZ0V2ZW50LkFDVElPTl9EUkFHX0VYSVRFRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAiZXhpdGVkISIpOworICAgICAgICAgICAgICAgICAgICBtSWNvbi5zZXRJbWFnZVJlc291cmNlKG1DbGlwcGluZyA9PSBudWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBSLmRyYXdhYmxlLmljX3N5c2Jhcl9wb2NrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFIuZHJhd2FibGUuaWNfc3lzYmFyX3BvY2tldF9ob2xkaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBEcmFnRXZlbnQuQUNUSU9OX0RST1A6CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgU2xvZy5kKFRBRywgImRyb3BwZWQhIik7CisgICAgICAgICAgICAgICAgICAgIHN0YXNoKGV2ZW50LmdldENsaXBEYXRhKCkpOworICAgICAgICAgICAgICAgICAgICByZWZyZXNoU3RhdHVzSWNvbigpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIERyYWdFdmVudC5BQ1RJT05fRFJBR19FTkRFRDoKKyAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFN0YXR1c0ljb24oKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRyd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W5hZ2VyLlJJTkdFUl9NT0RFX0NIQU5HRURfQUNUSU9OKSkgeworICAgICAgICAgICAgICAgIHJlZnJlc2hTb3VuZCgpOworICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEludGVudC5BQ1RJT05fQkFUVEVSWV9DSEFOR0VEKSkgeworICAgICAgICAgICAgICAgIHVwZGF0ZUJhdHRlcnkoaW50ZW50KTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhXaWZpTWFuYWdlci5SU1NJX0NIQU5HRURfQUNUSU9OKQorICAgICAgICAgICAgICAgICAgICB8fCBhY3Rpb24uZXF1YWxzKFdpZmlNYW5hZ2VyLldJRklfU1RBVEVfQ0hBTkdFRF9BQ1RJT04pCisgICAgICAgICAgICAgICAgICAgIHx8IGFjdGlvbi5lcXVhbHMoV2lmaU1hbmFnZXIuU1VQUExJQ0FOVF9TVEFURV9DSEFOR0VEX0FDVElPTikKKyAgICAgICAgICAgICAgICAgICAgfHwgYWN0aW9uLmVxdWFscyhXaWZpTWFuYWdlci5ORVRXT1JLX1NUQVRFX0NIQU5HRURfQUNUSU9OKSkgeworICAgICAgICAgICAgICAgIHVwZGF0ZVdpZmlTdGF0ZShpbnRlbnQpOworICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKFRlbGVwaG9ueUludGVudHMuQUNUSU9OX1NJTV9TVEFURV9DSEFOR0VEKSkgeworICAgICAgICAgICAgICAgIHVwZGF0ZVNpbVN0YXRlKGludGVudCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoQWRhcHRlci5BQ1RJT05fU1RBVEVfQ0hBTkdFRCkpIHsKKyAgICAgICAgICAgICAgICByZWZyZXNoQmx1ZXRvb3RoKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHJpdmF0ZSBmaW5hbCB2b2lkIHVwZGF0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fQorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgbVNpbVN0YXRlID0gSWNjQ2FyZC5TdGF0ZS5ORVRXT1JLX0xPQ0tFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1TaW1TdGF0ZSA9IEljY0NhcmQuU3RhdGUuVU5LTk9XTjsKKyAgICAgICAgfQorICAgICAgICB1cGRhdGVEYXRhU3RhdGUoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gaXNDZG1hKCkgeworICAgICAgICByZXR1cm4gKG1TaWduYWxTdHJlbmd0aCAhPSBudWxsKSAmJiAhbVNpZ25hbFN0cmVuZ3RoLmlzR3NtKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGlzRXZkbygpIHsKKyAgICAgICAgcmV0dXJuICggKG1TZXJ2aWNlU3RhdGUgIT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgJiYgKChtU2VydmljZVN0YXRlLmdldFJhZGlvVGVjaG5vbG9neSgpCisgICAgICAgICAgICAgICAgICAgICAgICA9PSBTZXJ2aWNlU3RhdGUuUkFESU9fVEVDSE5PTE9HWV9FVkRPXzApCisgICAgICAgICAgICAgICAgICAgICB8fCAobVNlcnZpY2VTdGF0ZS5nZXRSYWRpb1RlY2hub2xvZ3koKQorICAgICAgICAgICAgICAgICAgICAgICAgPT0gU2VydmljZVN0YXRlLlJBRElPX1RFQ0hOT0xPR1lfRVZET19BKQorICAgICAgICAgICAgICAgICAgICAgfHwgKG1TZXJ2aWNlU3RhdGUuZ2V0UmFkaW9UZWNobm9sb2d5KCkKKyAgICAgICAgICAgICAgICAgICAgICAgID09IFNlcnZpY2VTdGF0ZS5SQURJT19URUNITk9MT0dZX0VWRE9fQikpKTsKKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gaGFzU2VydmljZSgpIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlU3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgc3dpdGNoIChtU2VydmljZVN0YXRlLmdldFN0YXRlKCkpIHsKKyAgICAgICAgICAgICAgICBjYXNlIFNlcnZpY2VTdGF0ZS5TVEFURV9PVVRfT0ZfU0VSVklDRToKKyAgICAgICAgICAgICAgICBjYXNlIFNlcnZpY2VTdGF0ZS5TVEFURV9QT1dFUl9PRkY6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgaW50IGdldENkbWFMZXZlbCgpIHsKKyAgICAgICAgaWYgKG1TaWduYWxTdHJlbmd0aCA9PSBudWxsKSByZXR1cm4gMDsKKyAgICAgICAgZmluYWwgaW50IGNkbWFEYm0gPSBtU2lnbmFsU3RyZW5ndGguZ2V0Q2RtYURibSgpOworICAgICAgICBmaW5hbCBpbnQgY2RtYUVjaW8gPSBtU2lnbmFsU3RyZW5ndGguZ2V0Q2RtYUVjaW8oKTsKKyAgICAgICAgaW50IGxldmVsRGJtID0gMDsKKyAgICAgICAgaW50IGxldmVsRWNpbyA9IDA7CisKKyAgICAgICAgaWYgKGNkbWFEYm0gPj0gLTc1KSBsZXZlbERibSA9IDQ7CisgICAgICAgIGVsc2UgaWYgKGNkbWFEYm0gPj0gLTg1KSBsZXZlbERibSA9IDM7CisgICAgICAgIGVsc2UgaWYgKGNkbWFEYm0gPj0gLTk1KSBsZXZlbERibSA9IDI7CisgICAgICAgIGVsc2UgaWYgKGNkbWFEYm0gPj0gLTEwMCkgbGV2ZWxEYm0gPSAxOworICAgICAgICBlbHNlIGxldmVsRGJtID0gMDsKKworICAgICAgICAvLyBFYy9JbyBhcmUgaW4gZEIqMTAKKyAgICAg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NlIGlmIChldmRvU25yID49IDUpIGxldmVsRXZkb1NuciA9IDM7CisgICAgICAgIGVsc2UgaWYgKGV2ZG9TbnIgPj0gMykgbGV2ZWxFdmRvU25yID0gMjsKKyAgICAgICAgZWxzZSBpZiAoZXZkb1NuciA+PSAxKSBsZXZlbEV2ZG9TbnIgPSAxOworICAgICAgICBlbHNlIGxldmVsRXZkb1NuciA9IDA7CisKKyAgICAgICAgcmV0dXJuIChsZXZlbEV2ZG9EYm0gPCBsZXZlbEV2ZG9TbnIpID8gbGV2ZWxFdmRvRGJtIDogbGV2ZWxFdmRvU25yOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB1cGRhdGVEYXRhU3RhdGUoKSB7CisgICAgICAgIG1EYXRhQ29ubmVjdGVkID0gaGFzU2VydmljZSgpICYmIChtRGF0YVN0YXRlID09IFRlbGVwaG9ueU1hbmFnZXIuREFUQV9DT05ORUNURUQpOworCisgICAgICAgIGlmIChpc0NkbWEoKSkgeworICAgICAgICAgICAgLy8gdGhlc2UgZnVuY3Rpb25zIHJldHVybiBhIHZhbHVlIGZyb20gMCB0byA0LCBpbmNsdXNpdmUKKyAgICAgICAgICAgIGlmICgobVBob25lU3RhdGUgPT0gVGVsZXBob255TWFuYWdlci5DQUxMX1NUQVRFX0lETEUpICYmIGlzRXZkbygpKXsKKyAgICAgICAgICAgICAgICBtRGF0YUxldmVsID0gZ2V0RXZkb0xldmVsKCkgKiAyNTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbURhdGFMZXZlbCA9IGdldENkbWFMZXZlbCgpICogMjU7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBHU00KKyAgICAgICAgICAgIAorICAgICAgICAgICAgaW50IGFzdSA9IChtU2lnbmFsU3RyZW5ndGggPT0gbnVsbCkgPyAwIDogbVNpZ25hbFN0cmVuZ3RoLmdldEdzbVNpZ25hbFN0cmVuZ3RoKCk7CisKKyAgICAgICAgICAgIC8vIGFzdSBvbiBbMCwzMV07IDk5ID0gdW5rbm93bgorICAgICAgICAgICAgLy8gQW5kcm9pZCBoYXMgaGlzdG9yaWNhbGx5IHNob3duIGFueXRoaW5nID49MTIgYXMgImZ1bGwiCisgICAgICAgICAgICAvLyBYWFg6IHR1bmUgdGhpcyBiYXNlZCBvbiBJbmR1c3RyeSBCZXN0IFByYWN0aWNlcyhUTSkKKyAgICAgICAgICAgIGlmIChhc3UgPD0gMiB8fCBhc3UgPT0gOTkpIG1EYXRhTGV2ZWwgPSAwOworICAgICAgICAgICAgZWxzZSBtRGF0YUxldmVsID0gKGludCkoKChmbG9hdClNYXRoLm1heChhc3UsIDE1KSAvIDE1KSAqIDEwMCk7CisKKyAgICAgICAgICAgIG1EYXRhUm9hbWluZyA9IG1QaG9uZS5pc05ldHdvcmtSb2FtaW5nKCk7CisKKyAgICAgICAgICAgIG1EYXRhQ29ubmVjdGVkID0gbURhdGFDb25uZWN0ZWQKKyAgICAgICAgICAgICAgICAmJiAobVNpbVN0YXRlID09IEljY0NhcmQuU3RhdGUuUkVBRFkgfHwgbVNpbVN0YXRlID09IEljY0NhcmQuU3RhdGUuVU5LTk9XTik7CisgICAgICAgIH0KKworICAgICAgICBpZiAoREVCVUdfU0lHTkFMIHx8IERFQlVHKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAidXBkYXRlRGF0YVN0YXRlOiBjb25uZWN0ZWQ9IiArIG1EYXRhQ29ubmVjdGVkIAorICAgICAgICAgICAgICAgICAgICArICIgbGV2ZWw9IiArIG1EYXRhTGV2ZWwKKyAgICAgICAgICAgICAgICAgICAgKyAiIGlzRXZkbz0iICsgaXNFdmRvKCkKKyAgICAgICAgICAgICAgICAgICAgKyAiIGlzQ2RtYT0iICsgaXNDZG1hKCkKKyAgICAgICAgICAgICAgICAgICAgKyAiIG1QaG9uZVN0YXRlPSIgKyBtUGhvbmVTdGF0ZQorICAgICAgICAgICAgICAgICAgICArICIgbURhdGFTdGF0ZT0iICsgbURhdGFTdGF0ZQorICAgICAgICAgICAgICAgICAgICApOworICAgICAgICB9CisKKyAgICAgICAgcmVmcmVzaFNpZ25hbE1ldGVycygpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB1cGRhdGVXaWZpU3RhdGUoSW50ZW50IGludGVudCkgeworICAgICAgICBpZiAoREVCVUcpCisgICAgICAgICAgICBTbG9nLmQoVEFHLCAidXBkYXRlV2lmaVN0YXRlOiAiICsgaW50ZW50KTsKKworICAgICAgICBmaW5hbCBTdHJpbmcgYWN0aW9uID0gaW50ZW50LmdldEFjdGlvbigpOworICAgICAgICBmaW5hbCBib29sZWFuIHdhc0Nvbm5lY3RlZCA9IG1XaWZpQ29ubmVjdGVkOworCisgICAgICAgIGlmIChhY3Rpb24uZXF1YWxzKFdpZmlNYW5hZ2VyLldJRklfU1RBVEVfQ0hBTkdFRF9BQ1RJT04pKSB7CisgICAgICAgICAgICBtV2lmaUVuYWJsZWQgPSBpbnRlbnQuZ2V0SW50RXh0cmEoV2lmaU1hbmFnZXIuRVhUUkFfV0lGSV9TVEFURSwKKyAgICAgICAgICAgICAgICAgICAgV2lmaU1hbmFnZXIuV0lGSV9TVEFURV9VTktOT1dOKSA9PSBXaWZpTWFuYWdlci5XSUZJX1NUQVRFX0VOQUJMRUQ7CisgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhXaWZpTWFuYWdlci5ORVRXT1JLX1NUQVRFX0NIQU5HRURfQUNUSU9OKSkgeworICAgICAgICAgICAgZmluYWwgTmV0d29ya0luZm8gbmV0d29ya0luZm8gPSAoTmV0d29ya0luZm8pCisgICAgICAgICAgICAgICAgICAgIGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoV2lmaU1hbmFnZXIuRVhUUkFfTkVUV09SS19JTkZPKTsKKyAgICAgICAgICAgIG1XaWZpQ29ubmVjdGVkID0gbmV0d29ya0luZm8gIT0gbnVsbCAmJiBuZXR3b3JrSW5mby5pc0Nvbm5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ICJ1cGRhdGVXaWZpU3RhdGU6IGp1c3QgY29ubmVjdGVkOiBpbmZvPSIgKyBpbmZvKTsKKworICAgICAgICAgICAgaWYgKGluZm8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIC8vIGdyYWIgdGhlIGluaXRpYWwgc2lnbmFsIHN0cmVuZ3RoCisgICAgICAgICAgICAgICAgbVdpZmlMZXZlbCA9IFdpZmlNYW5hZ2VyLmNhbGN1bGF0ZVNpZ25hbExldmVsKGluZm8uZ2V0UnNzaSgpLCAxMDEpOworCisgICAgICAgICAgICAgICAgLy8gZmluZCB0aGUgU1NJRAorICAgICAgICAgICAgICAgIG1XaWZpU3NpZCA9IGluZm8uZ2V0U1NJRCgpOworICAgICAgICAgICAgICAgIGlmIChtV2lmaVNzaWQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAvLyBPSywgaXQncyBub3QgaW4gdGhlIGNvbm5lY3Rpb25JbmZvOyB3ZSBoYXZlIHRvIGdvIGh1bnRpbmcgZm9yIGl0CisgICAgICAgICAgICAgICAgICAgIExpc3Q8V2lmaUNvbmZpZ3VyYXRpb24+IG5ldHdvcmtzID0gbVdpZmlNYW5hZ2VyLmdldENvbmZpZ3VyZWROZXR3b3JrcygpOworICAgICAgICAgICAgICAgICAgICBmb3IgKFdpZmlDb25maWd1cmF0aW9uIG5ldCA6IG5ldHdvcmtzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV0Lm5ldHdvcmtJZCA9PSBpbmZvLmdldE5ldHdvcmtJZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdpZmlTc2lkID0gbmV0LlNTSUQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZWZyZXNoU2lnbmFsTWV0ZXJzKCk7CisgICAgfQorCisgICAgLy8gZmlndXJlIG91dCB3aGF0IHRvIHNob3c6IGZpcnN0IHdpZmksIHRoZW4gM0csIHRoZW4gbm90aGluZworICAgIHZvaWQgcmVmcmVzaFNpZ25hbE1ldGVycygpIHsKKyAgICAgICAgaWYgKG1TaWduYWxNZXRlciA9PSBudWxsKSByZXR1cm47IC8vIG5vIFVJIHlldAorCisgICAgICAgIENvbnRleHQgY3R4dCA9IGdldENvbnRleHQoKTsKKworICAgICAgICBTdHJpbmcgdGV4dCA9IG51bGw7CisgICAgICAgIGludCBsZXZlbCA9IDA7CisKKyAgICAgICAgaWYgKG1XaWZpQ29ubmVjdGVkKSB7CisgICAgICAgICAgICBpZiAobVdpZmlTc2lkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0ZXh0ID0gY3R4dC5nZXRTdHJpbmcoUi5zdHJpbmcuc3lzdGVtX3BhbmVsX3NpZ25hbF9tZXRlcl93aWZpX25vc3NpZCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRleHQgPSBjdHh0LmdldFN0cmluZyhSLnN0cmluZy5zeXN0ZW1fcGFuZWxfc2lnbmFsX21ldGVyX3dpZmlfc3NpZF9mb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1XaWZpU3NpZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBsZXZlbCA9IG1XaWZpTGV2ZWw7CisgICAgICAgIH0gZWxzZSBpZiAobURhdGFDb25uZWN0ZWQpIHsKKyAgICAgICAgICAgIHRleHQgPSBjdHh0LmdldFN0cmluZyhSLnN0cmluZy5zeXN0ZW1fcGFuZWxfc2lnbmFsX21ldGVyX2RhdGFfY29ubmVjdGVkKTsKKyAgICAgICAgICAgIGxldmVsID0gbURhdGFMZXZlbDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRleHQgPSBjdHh0LmdldFN0cmluZyhSLnN0cmluZy5zeXN0ZW1f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Igbm93CisgICAgICAgIG1CYXIuc2V0QmF0dGVyeU1ldGVyKGxldmVsLCBwbHVnZ2VkKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIFN5c3RlbVBhbmVsKENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzKSB7CisgICAgICAgIHRoaXMoY29udGV4dCwgYXR0cnMsIDApOworICAgIH0KKworICAgIHB1YmxpYyBTeXN0ZW1QYW5lbChDb250ZXh0IGNvbnRleHQsIEF0dHJpYnV0ZVNldCBhdHRycywgaW50IGRlZlN0eWxlKSB7CisgICAgICAgIHN1cGVyKGNvbnRleHQsIGF0dHJzLCBkZWZTdHlsZSk7CisKKyAgICAgICAgLy8gZ2V0IG5vdGlmaWVkIG9mIHBob25lIHN0YXRlIGNoYW5nZXMKKyAgICAgICAgVGVsZXBob255TWFuYWdlciB0ZWxlcGhvbnlNYW5hZ2VyID0KKyAgICAgICAgICAgICAgICAoVGVsZXBob255TWFuYWdlcikgY29udGV4dC5nZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuVEVMRVBIT05ZX1NFUlZJQ0UpOworICAgICAgICB0ZWxlcGhvbnlNYW5hZ2VyLmxpc3RlbihtUGhvbmVTdGF0ZUxpc3RlbmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX1NFUlZJQ0VfU1RBVEUKKyAgICAgICAgICAgICAgICAgICAgICAgIHwgUGhvbmVTdGF0ZUxpc3RlbmVyLkxJU1RFTl9TSUdOQUxfU1RSRU5HVEhTCisgICAgICAgICAgICAgICAgICAgICAgICB8IFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fQ0FMTF9TVEFURQorICAgICAgICAgICAgICAgICAgICAgICAgfCBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX0RBVEFfQ09OTkVDVElPTl9TVEFURQorICAgICAgICAgICAgICAgICAgICAgICAgfCBQaG9uZVN0YXRlTGlzdGVuZX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kgeworICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKKyAgICAgICAgICAgICAgICBUb2FzdC5tYWtlVGV4dChnZXRDb250ZXh0KCksICJPcmllbnRhdGlvbiBjb250cm9sIG5vdCBpbXBsZW1lbnRlZDsgcGxlYXNlIGFkanVzdCBuZWNrIGFuZ2xlLiIsIFRvYXN0LkxFTkdUSF9TSE9SVCkuc2hvdygpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKworICAgICAgICBtQWlycGxhbmVCdXR0b24gPSAoSW1hZ2VCdXR0b24pZmluZFZpZXdCeUlkKFIuaWQuYWlycGxhbmUpOworICAgICAgICBtQWlycGxhbmVCdXR0b24uc2V0QWxwaGEobUFpcnBsYW5lTW9kZSA/IDB4RkYgOiAweDdGKTsKKyAgICAgICAgbUFpcnBsYW5lQnV0dG9uLnNldE9uQ2xpY2tMaXN0ZW5lcihuZXcgVmlldy5PbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgIGJvb2xlYW4gbmV3TW9kZSA9ICFnZXRBaXJwbGFuZU1vZGUoKTsKKyAgICAgICAgICAgICAgICBUb2FzdC5tYWtlVGV4dChnZXRDb250ZXh0KCksICJBdHRlbXB0aW5nIHRvIHR1cm4gIgorICAgICAgICAgICAgICAgICAgICArIChuZXdNb2RlID8gIm9uIiA6ICJvZmYiKSArICIgYWlycGxhbmUgbW9kZSAoZmxha3kpLiIsCisgICAgICAgICAgICAgICAgICAgIFRvYXN0LkxFTkdUSF9TSE9SVCkuc2hvdygpOworICAgICAgICAgICAgICAgIHNldEFpcnBsYW5lTW9kZShuZXdNb2RlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisKKyAgICAgICAgbUdwc0J1dHRvbiA9IChJbWFnZUJ1dHRvbilmaW5kVmlld0J5SWQoUi5pZC5ncHMpOworICAgICAgICBtR3BzQn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1vdGVFeGNlcHRpb24gZSkgeworLy8gICAgICAgIH0gY2F0Y2ggKFNldHRpbmdzLlNldHRpbmdOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisvLyAgICAgICAgfQorLy8gICAgICAgIHJldHVybiBmYWxzZTsKKy8vICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByb3RhdGVCcmlnaHRuZXNzKCkgeworICAgICAgICBpbnQgaWNvbiA9IFIuZHJhd2FibGUuaWNfc3lzYmFyX2JyaWdodG5lc3M7CisgICAgICAgIGludCBiZyA9IFIuZHJhd2FibGUuc3lzYmFyX3RvZ2dsZV9iZ19vbjsKKyAgICAgICAgQ29udGV4dCBjb250ZXh0ID0gZ2V0Q29udGV4dCgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgSVBvd2VyTWFuYWdlciBwb3dlciA9IElQb3dlck1hbmFnZXIuU3R1Yi5hc0ludGVyZmFjZSgKKyAgICAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuZ2V0U2VydmljZSgicG93ZXIiKSk7CisgICAgICAgICAgICBpZiAocG93ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlciBjciA9IGNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCk7CisgICAgICAgICAgICAgICAgaW50IGJyaWdodG5lc3MgPSBTZXR0aW5ncy5TeXN0ZW0uZ2V0SW50KGNyLAorICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU3lzdGVtLlNDUkVFTl9CUklHSFRORVNTKTsKKyAgICAgICAgICAgICAgICBpbnQgYnJpZ2h0bmVzc01vZGUgPSBTZXR0aW5ncy5TeXN0ZW0uU0NSRUVOX0JSSUdIVE5FU1NfTU9ERV9NQU5VQUw7CisgICAgICAgICAgICAgICAgLy9Pbmx5IGdldCBicmlnaHRuZXNzIHNldHRpbmcgaWYgYXZhaWxhYmxlCisgICAgICAgICAgICAgICAgaWYgKGNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0Qm9vbGVhbigKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYm9vbC5jb25maWdfYXV0b21hdGljX2JyaWdodG5lc3NfYXZhaWxhYmxlKSkgeworICAgICAgICAgICAgICAgICAgICBicmlnaHRuZXNzTW9kZSA9IFNldHRpbmdzLlN5c3RlbS5nZXRJbnQoY3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU3lzdGVtLlNDUkVFTl9CUklHSFRORVNTX01PREUpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIFJvdGF0ZSBBVVRPIC0+IE1JTklNVU0gLT4gREVGQVVMVCAtPiBNQVhJTVVNCisgICAgICAgICAgICAgICAgLy8gVGVjaG5pY2FsbHksIG5vdCBhIHRvZ2dsZS4uLgorICAgICAgICAgICAgICAgIGlmIChicmlnaHRuZXNzTW9kZSA9PSBTZXR0aW5ncy5TeXN0ZW0uU0NSRUVOX0JSSUdIVE5FU1NfTU9ERV9BVVRPTUFUSUMpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJpZ2h0bmVzcyA9IE1JTklNVU1fQkFDS0xJR0hUOworICAgICAgICAgICAgICAgICAgICBpY29uID0gUi5kcmF3YWJsZS5pY19zeXNiYXJfYnJpZ2h0bmVzc19sb3c7CisgICAgICAgICAgICAgICAgICAgIGJyaWdodG5lc3NNb2RlID0gU2V0dGluZ3MuU3lzdGVtLlNDUkVFTl9CUklHSFRORVNTX01PREVfTUFOVUFMOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYnJpZ2h0bmVzcyA8IERFRkFVTFRfQkFDS0xJR0hUKSB7CisgICAgICAgICAgICAgICAgICAgIGJyaWdodG5lc3MgPSBERUZBVUxUX0JBQ0tMSUdIVDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJyaWdodG5lc3MgPCBNQVhJTVVNX0JBQ0tMSUdIVCkgeworICAgICAgICAgICAgICAgICAgICBicmlnaHRuZXNzID0gTUFYSU1VTV9CQUNLTElHSFQ7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgYnJpZ2h0bmVzc01vZGUgPSBTZXR0aW5ncy5TeXN0ZW0uU0NSRUVOX0JSSUdIVE5FU1NfTU9ERV9BVVRPTUFUSUM7CisgICAgICAgICAgICAgICAgICAgIGJyaWdodG5lc3MgPSBNSU5JTVVNX0JBQ0tMSUdIVDsKKyAgICAgICAgICAgICAgICAgICAgaWNvbiA9IFIuZHJhd2FibGUuaWNfc3lzYmFyX2JyaWdodG5lc3NfYXV0bzsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoY29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRCb29sZWFuKAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5ib29sLmNvbmZpZ19hdXRvbWF0aWNfYnJpZ2h0bmVzc19hdmFpbGFibGUpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFNldCBzY3JlZW4gYnJpZ2h0bmVzcyBtb2RlIChhdXRvbWF0aWMgb3IgbWFudWFsKQorICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TeXN0ZW0ucHV0SW50KGNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU3lzdGVtLlNDUkVFTl9CUklHSFRORVNTX01PREUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJpZ2h0bmVzc01vZGUpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB3ZSBzZXQgdGhlIGJyaWdodG5lc3MgaWYgYXV0b21hdGljIG1vZGUgaXNuJ3QgYXZhaWxhYmxlCisgICAgICAgICAgICAgICAgICAgIGJyaWdodG5lc3NNb2RlID0gU2V0dGluZ3MuU3lzdGVtLlNDUkVFTl9CUklHSFRORVNTX01PREVfTUFOVUFMOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoYnJpZ2h0bmVzc01vZGUgPT0gU2V0dGluZ3MuU3lzdGVtLlNDUkVFTl9CUklHSFRORVNTX01PREVfTUFOVUFMKSB7CisgICAgICAgICAgICAgICAgICAgIHBvd2VyLnNldEJhY2tsaWdodEJyaWdodG5lc3MoYnJpZ2h0bmVzcyk7CisgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlN5c3RlbS5wdXRJbnQoY3IsIFNldHRpbmdzLlN5c3RlbS5TQ1JFRU5fQlJJR0hUTkVTUywgYnJpZ2h0bmVzcyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICB9IGNhdGNoIChTZXR0aW5ncy5TZXR0aW5nTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICB9CisKKyAgICAgICAgbUJyaWdodG5lc3NCdXR0b24uc2V0SW1hZ2VSZXNvdXJjZShpY29uKTsKKyAgICAgICAgbUJyaWdodG5lc3NCdXR0b24uc2V0QmFja2dyb3VuZFJlc291cmNlKGJnKTsKKyAgICB9CisKKyAgICBQaG9uZVN0YXRlTGlzdGVuZXIgbVBob25lU3RhdGVMaXN0ZW5lciA9IG5ldyBQaG9uZVN0YXRlTGlzdGVuZXIoKSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VTdGF0ZUNoYW5nZWQoU2VydmljZVN0YXRlIHNlcnZpY2VTdGF0ZSkgeworICAgICAgICAgICAgaWYgKERFQlVHX1NJR05BTCB8fCBERUJVRykgeworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJwaG9uZSBzZXJ2aWNlIHN0YXRlIGNoYW5nZWQ6ICIgKyBzZXJ2aWNlU3RhdGUuZ2V0U3RhdGUoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtU2VydmljZVN0YXRlID0gc2VydmljZVN0YXRlOworICAgICAgICAgICAgbUFpcnBsYW5lTW9kZSA9IHNlcnZpY2VTdGF0ZS5nZXRTdGF0ZSgpID09IFNlcnZpY2VTdGF0ZS5TVEFURV9QT1dFUl9PRkY7CisgICAgICAgICAgICBpZiAobUFpcnBsYW5lQnV0dG9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQWlycGxhbmVCdXR0b24uc2V0SW1hZ2VSZXNvdXJjZShtQWlycGxhbmVNb2RlIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUi5kcmF3YWJsZS5pY19zeXNiYXJfYWlycGxhbmVfb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFIuZHJhd2FibGUuaWNfc3lzYmFyX2FpcnBsYW5lX29mZik7CisgICAgICAgICAgICAgICAgbUFpcnBsYW5lQnV0dG9uLnNldEJhY2tncm91bmRSZXNvdXJjZShtQWlycGxhbmVNb2RlIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUi5kcmF3YWJsZS5zeXNiYXJfdG9nZ2xlX2JnX29uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBSLmRyYXdhYmxlLnN5c2Jhcl90b2dnbGVfYmdfb2ZmKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHVwZGF0ZURhdGFTdGF0ZSgpOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvblNpZ25hbFN0cmVuZ3Roc0NoYW5nZWQoU2lnbmFsU3RyZW5ndGggc2lnbmFsU3RyZW5ndGgpIHsKKyAgICAgICAgICAgIGlmIChERUJVR19TSUdOQUwgfHwgREVCVUcpIHsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAib25TaWduYWxTdHJlbmd0aHNDaGFuZ2VkOiAiICsgc2lnbmFsU3RyZW5ndGgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVNpZ25hbFN0cmVuZ3RoID0gc2lnbmFsU3RyZW5ndGg7CisgICAgICAgICAgICB1cGRhdGVEYXRhU3RhdGUoKTsKKyAgICAgICAgfQorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25DYWxsU3RhdGVDaGFuZ2VkKGludCBzdGF0ZSwgU3RyaW5nIGluY29taW5nTnVtYmVyKSB7CisgICAgICAgICAgICBtUGhvbmVTdGF0ZSA9IHN0YXRlOworICAgICAgICAgICAgLy8gSW4gY2RtYSwgaWYgYSB2b2ljZSBjYWxsIGlzIG1hZGUsIFJTU0kgc2hvdWxkIHN3aXRjaCB0byAxeC4KKyAgICAgICAgICAgIGlmIChpc0NkbWEoKSkgeworICAgICAgICAgICAgICAgIHVwZGF0ZURhdGFTdGF0ZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uRGF0YUNvbm5lY3Rpb25TdGF0ZUNoYW5nZWQoaW50IHN0YXRlLCBpbnQgbmV0d29ya1R5cGUpIHsKKyAgICAgICAgICAgIGlmIChERUJVR19TSUdOQUwgfHwgREVCVUcpIHsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAib25EYXRhQ29ubmVjdGlvblN0YXRlQ2hhbmdlZDogc3RhdGU9IiArIHN0YXRlIAorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHR5cGU9IiArIG5ldHdvcmtUeXBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1EYXRhU3RhdGUgPSBzdGF0ZTsKKy8vICAgICAgICAgICAgdXBkYXRlRGF0YU5ldFR5cGUobmV0d29ya1R5cGUpOworICAgICAgICAgICAgdXBkYXRlRGF0YVN0YXRlKCk7CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHJpdmF0ZSBib29sZWFuIGdldEFpcnBsYW5lTW9kZSgpIHsKKyAgICAgICAgcmV0dXJuIG1BaXJwbGFuZU1vZGU7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldEFpcnBsYW5lTW9kZShib29sZWFuIG9uKSB7CisgICAgICAgIFNldHRpbmdzLlN5c3RlbS5wdXRJbnQoCisgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgU2V0dGluZ3MuU3lzdGVtLkFJUlBMQU5FX01PREVfT04sCisgICAgICAgICAgICAgICAgb24gPyAxIDogMCk7CisgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEludGVudC5BQ1RJT05fQUlSUExBTkVfTU9ERV9DSEFOR0VEKTsKKyAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFUExBQ0VfUEVORElORyk7CisgICAgICAgIGludGVudC5wdXRFeHRyYSgic3RhdGUiLCBvbik7CisgICAgICAgIGdldENvbnRleHQoKS5zZW5kQnJvYWRjYXN0KGludGVudCk7CisgICAgfQorCisgICAgYm9vbGVhbiBnZXRTaWxlbnRNb2RlKCkgeworICAgICAgICByZXR1cm4gbUF1ZGlvTWFuYWdlci5nZXRSaW5nZXJNb2RlKCkgIT0gQXVkaW9NYW5hZ2VyLlJJTkdFUl9NT0RFX05PUk1BTDsKKyAgICB9CisKKyAgICB2b2lkIHNldFNpbGVudE1vZGUoYm9vbGVhbiBvbikgeworICAgICAgICBpZiAob24pIHsKKyAgICAgICAgICAgIG1BdWRpb01hbmFnZXIuc2V0UmluZ2VyTW9kZSgoU2V0dGluZ3MuU3lzdGVtLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKKyAgICAgICAgICAgICAgICBTZXR0aW5ncy5TeXN0ZW0uVklCUkFURV9JTl9TSUxFTlQsIDEpID09IDEpCisgICAgICAgICAgICAgICAgPyBBdWRpb01hbmFnZXIuUklOR0VSX01PREVfVklCUkFURQorICAgICAgICAgICAgICAgIDogQXVkaW9NYW5hZ2VyLlJJTkdFUl9NT0RFX1NJTEVOVCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtQXVkaW9NYW5hZ2VyLnNldFJpbmdlck1vZGUoQXVkaW9NYW5hZ2VyLlJJTkdFUl9NT0RFX05PUk1BTCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIHJlZnJlc2hTb3VuZCgpIHsKKyAgICAgICAgYm9vbGVhbiBzaWxlbnQgPSBnZXRTaWxlbnRNb2RlKCk7CisgICAgICAgIG1Tb3VuZEJ1dHRvbi5zZXRJbWFnZVJlc291cmNlKCFzaWxlbnQgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUi5kcmF3YWJsZS5pY19zeXNiYXJfc291bmRfb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBSLmRyYXdhYmxlLmljX3N5c2Jhcl9zb3VuZF9vZmYpOworICAgICAgICBtU291bmRCdXR0b24uc2V0QmFja2dyb3VuZFJlc291cmNlKCFzaWxlbnQgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUi5kcmF3YWJsZS5zeXNiYXJfdG9nZ2xlX2JnX29uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5zeXNiYXJfdG9nZ2xlX2JnX29mZik7CisgICAgfQorCisgICAgdm9pZCB0b2dnbGVCbHVldG9vdGgoKSB7CisgICAgICAgIGlmIChtQmx1ZXRvb3RoQWRhcHRlciA9PSBudWxsKSByZXR1cm47CisgICAgICAgIGlmIChtQmx1ZXRvb3RoQWRhcHRlci5pc0VuYWJsZWQoKSkgeworICAgICAgICAgICAgbUJsdWV0b290aEFkYXB0ZXIuZGlzYWJsZSgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUJsdWV0b290aEFkYXB0ZXIuZW5hYmxlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIHJlZnJlc2hCbHVldG9vdGgoKSB7CisgICAgICAgIGJvb2xlYW4gb24gPSBtQmx1ZXRvb3RoQWRhcHRlciAhPSBudWxsICYmIG1CbHVldG9vdGhBZGFwdGVyLmlzRW5hYmxlZCgpOworICAgICAgICBtQmx1ZXRvb3RoQnV0dG9uLnNldEltYWdlUmVzb3VyY2Uob24gPyBSLmRyYXdhYmxlLmljX3N5c2Jhcl9ibHVldG9vdGhfb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5pY19zeXNiYXJfYmx1ZXRvb3RoX29mZik7CisgICAgICAgIG1CbHVldG9vdGhCdXR0b24uc2V0QmFja2dyb3VuZFJlc291cmNlKG9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUi5kcmF3YWJsZS5zeXNiYXJfdG9nZ2xlX2JnX29uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5zeXNiYXJfdG9nZ2xlX2JnX29mZik7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGlzR3BzRW5hYmxlZCgpIHsKKyAgICAgICAgQ29udGVudFJlc29sdmVyIHJlcyA9IG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpOworICAgICAgICByZXR1cm4gU2V0dGluZ3MuU2VjdXJlLmlzTG9jYXRpb25Qcm92aWRlckVuYWJsZWQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcywgTG9jYXRpb25NYW5hZ2VyLkdQU19QUk9WSURFUik7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHRvZ2dsZUdwcygpIHsKKyAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnNldExvY2F0aW9uUHJvdmlkZXJFbmFibGVkKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAorICAgICAgICAgICAgICAgIExvY2F0aW9uTWFuYWdlci5HUFNfUFJPVklERVIsICFpc0dwc0VuYWJsZWQoKSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlZnJlc2hHcHMoKSB7CisgICAgICAgIGJvb2xlYW4gb24gPSBpc0dwc0VuYWJsZWQoKTsKKyAgICAgICAgbUdwc0J1dHRvbi5zZXRJbWFnZVJlc291cmNlKG9uID8gUi5kcmF3YWJsZS5pY19zeXNiYXJfZ3BzX29uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFIuZHJhd2FibGUuaWNfc3lzYmFyX2dwc19vZmYpOworICAgICAgICBtR3BzQnV0dG9uLnNldEJhY2tncm91bmRSZXNvdXJjZShvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFIuZHJhd2FibGUuc3lzYmFyX3RvZ2dsZV9iZ19vbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFIuZHJhd2FibGUuc3lzYmFyX3RvZ2dsZV9iZ19vZmYpOworICAgIH0KK30KZGlmZiAtLWdpdCBhL3BhY2thZ2VzL1N5c3RlbVVJL3NyYy9jb20vYW5kcm9pZC9zeXN0ZW11aS9zdGF0dXNiYXIvdGFibGV0L1RhYmxldFN0YXR1c0JhclNlcnZpY2UuamF2YSBiL3BhY2thZ2VzL1N5c3RlbVVJL3NyYy9jb20vYW5kcm9pZC9zeXN0ZW11aS9zdGF0dXNiYXIvdGFibGV0L1RhYmxldFN0YXR1c0JhclNlcnZpY2UuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hYmNmZWM4Ci0tLSAvZGV2L251bGwKKysrIGIvcG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VZpZXcgbUJhdHRlcnlNZXRlcjsKKyAgICBJbWFnZVZpZXcgbVNpZ25hbE1ldGVyOworICAgIEltYWdlVmlldyBtU2lnbmFsSWNvbjsKKworICAgIFZpZXcgbUJhckNvbnRlbnRzOworICAgIFZpZXcgbUN1cnRhaW5zOworCisgICAgTm90aWZpY2F0aW9uSWNvbkFyZWEuSWNvbkxheW91dCBtSWNvbkxheW91dDsKKworICAgIFRhYmxldFRpY2tlciBtVGlja2VyOworICAgIFZpZXcgbVRpY2tlclZpZXc7CisgICAgYm9vbGVhbiBtVGlja2luZzsKKworICAgIC8vIGZvciBkaXNhYmxpbmcgdGhlIHN0YXR1cyBiYXIKKyAgICBpbnQgbURpc2FibGVkID0gMDsKKworICAgIGJvb2xlYW4gbU5vdGlmaWNhdGlvbnNPbiA9IHRydWU7CisgICAgcHJpdmF0ZSBSZWNlbnRBcHBzUGFuZWwgbVJlY2VudHNQYW5lbDsKKworICAgIHByb3RlY3RlZCB2b2lkIGFkZFBhbmVsV2luZG93cygpIHsKKyAgICAgICAgZmluYWwgQ29udGV4dCBjb250ZXh0ID0gbUNvbnRleHQ7CisKKyAgICAgICAgZmluYWwgUmVzb3VyY2VzIHJlcyA9IGNvbnRleHQuZ2V0UmVzb3VyY2VzKCk7CisgICAgICAgIGZpbmFsIGludCBiYXJIZWlnaHQ9IHJlcy5nZXREaW1lbnNpb25QaXhlbFNpemUoCisgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmRpbWVuLnN0YXR1c19iYXJfaGVpZ2h0KTsKKworICAgICAgICAvLyBOb3RpZmljYXRpb24gUGFuZWwKKyAgICAgICAgbU5vdGlmaWNhdGlvblBhbmVsID0gKE5vdGlmaWNhdGlvblBhbmVsKVZpZXcuaW5mbGF0ZShjb250ZXh0LAorICAgICAgICAgICAgICAgIFIubGF5b3V0LnN5c2Jhcl9wYW5lbF9ub3RpZmljYXRpb25zLCBudWxsKTsKKyAgICAgICAgbU5vdGlmaWNhdGlv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uUGVla1NjcnViUmlnaHQuc2V0QW5pbWF0b3IoTGF5b3V0VHJhbnNpdGlvbi5ESVNBUFBFQVJJTkcsIAorICAgICAgICAgICAgICAgIE9iamVjdEFuaW1hdG9yLm9mSW50KG51bGwsICJsZWZ0IiwgLTUxMiwgMCkpOworICAgICAgICBtTm90aWZpY2F0aW9uUGVla1NjcnViUmlnaHQuc2V0RHVyYXRpb24oNTAwKTsKKworICAgICAgICBtTm90aWZpY2F0aW9uUGVla1NjcnViTGVmdCA9IG5ldyBMYXlvdXRUcmFuc2l0aW9uKCk7CisgICAgICAgIG1Ob3RpZmljYXRpb25QZWVrU2NydWJMZWZ0LnNldEFuaW1hdG9yKExheW91dFRyYW5zaXRpb24uQVBQRUFSSU5HLCAKKyAgICAgICAgICAgICAgICBPYmplY3RBbmltYXRvci5vZkludChudWxsLCAibGVmdCIsIDUxMiwgMCkpOworICAgICAgICBtTm90aWZpY2F0aW9uUGVla1NjcnViTGVmdC5zZXRBbmltYXRvcihMYXlvdXRUcmFuc2l0aW9uLkRJU0FQUEVBUklORywgCisgICAgICAgICAgICAgICAgT2JqZWN0QW5pbWF0b3Iub2ZJbnQobnVsbCwgImxlZnQiLCA1MTIsIDApKTsKKyAgICAgICAgbU5vdGlmaWNhdGlvblBlZWtTY3J1YkxlZnQuc2V0RHVyYXRpb24oNTAwKTsKKworICAgICAgICAvLyBYWFg6IHNldElnbm9yZUNoaWxkcmVuPworICAgICAgICBscCA9IG5ldyBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcygKKyAgICAgICAgICAgICAgICA1MTIsIC8vIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5ULAorICAgICAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5ULAorICAgICAgICAgICAgICAgIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLlRZUEVfU1RBVFVTX0JBUl9QQU5FTCwKKyAgICAgICAgICAg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Glvbl9TbGlkaW5nQ2FyZDsKKworICAgICAgICAgICAgV2luZG93TWFuYWdlckltcGwuZ2V0RGVmYXVsdCgpLmFkZFZpZXcobVJlY2VudHNQYW5lbCwgbHApOworICAgICAgICAgICAgbVJlY2VudHNQYW5lbC5zZXRCYXIodGhpcyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzdGFydCgpIHsKKyAgICAgICAgc3VwZXIuc3RhcnQoKTsgLy8gd2lsbCBhZGQgdGhlIG1haW4gYmFyIHZpZXcKKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgVmlldyBtYWtlU3RhdHVzQmFyVmlldygpIHsKKyAgICAgICAgZmluYWwgQ29udGV4dCBjb250ZXh0ID0gbUNvbnRleHQ7CisgICAgICAgIGZpbmFsIFJlc291cmNlcyByZXMgPSBjb250ZXh0LmdldFJlc291cmNlcygpOworCisgICAgICAgIG1JY29uU2l6ZSA9IHJlcy5nZXREaW1lbnNpb25QaXhlbFNpemUoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5kaW1lbi5zdGF0dXNfYmFyX2ljb25fc2l6ZSk7CisKKyAgICAgICAgZmluYWwgVGFibGV0U3RhdHVzQmFyVmlldyBzYiA9IChUYWJsZXRTdGF0dXNCYXJWaWV3KVZpZXcuaW5mbGF0ZSgKKyAgICAgICAgICAgICAgICBjb250ZXh0LCBSLmxheW91dC5zdGF0dXNfYmFyLCBudWxsKTsKKyAgICAgICAgbVN0YXR1c0JhclZpZXcgPSBzYjsKKworICAgICAgICBzYi5zZXRIYW5kbGVyKG1IYW5kbGVyKTsKKworICAgICAgICBtQmFyQ29udGVudHMgPSBzYi5maW5kVmlld0J5SWQoUi5pZC5iYXJfY29udGVudHMpOworICAgICAgICBtQ3VydGFpbnMgPSBzYi5maW5kVmlld0J5SWQoUi5pZC5saWdodHNfb3V0KTsKKyAgICAgICAgbVN5c3RlbUluZm8gPSBzYi5maW5kVmlld0J5S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91dCgpOworICAgICAgICBtTm90aWZpY2F0aW9uRmxpbmdWZWxvY2l0eSA9IDMwMDsgLy8gcHgvcworCisgICAgICAgIG1UaWNrZXIgPSBuZXcgVGFibGV0VGlja2VyKGNvbnRleHQsIChGcmFtZUxheW91dClzYi5maW5kVmlld0J5SWQoUi5pZC50aWNrZXIpKTsKKworICAgICAgICAvLyBTeXN0ZW0gaW5mbyAoY2VudGVyKQorICAgICAgICBtQmF0dGVyeU1ldGVyID0gKEltYWdlVmlldykgc2IuZmluZFZpZXdCeUlkKFIuaWQuYmF0dGVyeSk7CisgICAgICAgIG1TaWduYWxNZXRlciA9IChJbWFnZVZpZXcpIHNiLmZpbmRWaWV3QnlJZChSLmlkLnNpZ25hbCk7CisgICAgICAgIG1TaWduYWxJY29uID0gKEltYWdlVmlldykgc2IuZmluZFZpZXdCeUlkKFIuaWQuc2lnbmFsX2ljb24pOworCisgICAgICAgIC8vIFRoZSBuYXZpZ2F0aW9uIGJ1dHRvbnMKKyAgICAgICAgbU5hdmlnYXRpb25BcmVhID0gc2IuZmluZFZpZXdCeUlkKFIuaWQubmF2aWdhdGlvbkFyZWEpOworICAgICAgICBtTWVudUJ1dHRvbiA9IG1OYXZpZ2F0aW9uQXJlYS5maW5kVmlld0J5SWQoUi5pZC5tZW51KTsKKworICAgICAgICAvLyBUaGUgYmFyIGNvbnRlbnRzIGJ1dHRvbnMKKyAgICAgICAgbUlucHV0TWV0aG9kQnV0dG9uID0gKElucHV0TWV0aG9kQnV0dG9uKSBtQmFyQ29udGVudHMuZmluZFZpZXdCeUlkKFIuaWQuaW1lQnV0dG9uKTsKKworICAgICAgICAvLyBzZXQgdGhlIGluaXRpYWwgdmlldyB2aXNpYmlsaXR5CisgICAgICAgIHNldEFyZVRoZXJlTm90aWZpY2F0aW9ucygpOworICAgICAgICByZWZyZXNoTm90aWZpY2F0aW9uVHJpZ2dlcigpOworCisgICAgICAgIC8vIEFkZCB0aGUgd2luZG93cworICAgICAgICBhZGRQYW5lbFdpbmRvd3MoKTsKKworICAgICAgICBtUGlsZSA9IChWaWV3R3JvdXApbU5vdGlmaWNhdGlvblBhbmVsLmZpbmRWaWV3QnlJZChSLmlkLmNvbnRlbnQpOworICAgICAgICBtUGlsZS5yZW1vdmVBbGxWaWV3cygpOworCisgICAgICAgIFNjcm9sbFZpZXcgc2Nyb2xsZXIgPSAoU2Nyb2xsVmlldyltUGlsZS5nZXRQYXJlbnQoKTsKKyAgICAgICAgc2Nyb2xsZXIuc2V0RmlsbFZpZXdwb3J0KHRydWUpOworCisgICAgICAgIHJldHVybiBzYjsKKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgaW50IGdldFN0YXR1c0JhckdyYXZpdHkoKSB7CisgICAgICAgIHJldHVybiBHcmF2aXR5LkJPVFRPTSB8IEdyYXZpdHkuRklMTF9IT1JJWk9OVEFMOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgSCBleHRlbmRzIEhhbmRsZXIgeworICAgICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbSkgeworICAgICAgICAgICAgc3dpdGNoIChtLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19PUEVOX05PVElGSUNBVElPTl9QRUVLOgorICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIFNsb2cuZChUQUcsICJvcGVuaW5nIG5vdGlmaWNhdGlvbiBwZWVrIHdpbmRvdzsgYXJnPSIgKyBtLmFyZzEpOworICAgICAgICAgICAgICAgICAgICBpZiAobS5hcmcxID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbU5vdG5zLnNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtTm90aWZpY2F0aW9uUGVla0luZGV4IDwgTikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbkRhdGEuRW50cnkgZW50cnkgPSBtTm90bnMuZ2V0KE4tMS1tTm90aWZpY2F0aW9uUGVla0luZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeS5pY29uLnNldEJhY2tncm91bmRDb2xvcigwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IHBlZWtJbmRleCA9IG0uYXJnMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwZWVrSW5kZXggPCBOKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImxvYWRpbmcgcGVlazogIiArIHBlZWtJbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTm90aWZpY2F0aW9uRGF0YS5FbnRyeSBlbnRyeSA9IG1Ob3Rucy5nZXQoTi0xLXBlZWtJbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTm90aWZpY2F0aW9uRGF0YS5FbnRyeSBjb3B5ID0gbmV3IE5vdGlmaWNhdGlvbkRhdGEuRW50cnkoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeS5rZXksIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW50cnkubm90aWZpY2F0aW9uLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJ5Lmljb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZmxhdGVWaWV3cyhjb3B5LCBtTm90aWZpY2F0aW9uUGVla1Jvdyk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeS5pY29uLnNldEJhY2tncm91bmRDb2xvcigweDIwRkZGRkZGKTsKKworLy8gICAgICAgICAgICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb25QZWVrUm93LnNldExheW91dFRyYW5zaXRpb24oCisvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZWtJbmRleCA8IG1Ob3RpZmljYXRpb25QZWVrSW5kZXggCisvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1Ob3RpZmljYXRpb25QZWVrU2NydWJMZWZ0CisvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1Ob3RpZmljYXRpb25QZWVrU2NydWJSaWdodCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uUGVla1Jvdy5yZW1vdmVBbGxWaWV3cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb25QZWVrUm93LmFkZFZpZXcoY29weS5yb3cpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5vdGlmaWNhdGlvblBlZWtXaW5kb3cuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb25QYW5lbC5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uUGVla0luZGV4ID0gcGVla0luZGV4OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0NMT1NFX05PVElGSUNBVElPTl9QRUVLOgorICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIFNsb2cuZChUQUcsICJjbG9zaW5nIG5vdGlmaWNhdGlvbiBwZWVrIHdpbmRvdyIpOworICAgICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uUGVla1dpbmRvdy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb25QZWVrUm93LnJlbW92ZUFsbFZpZXdzKCk7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbU5vdG5zLnNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Ob3RpZmljYXRpb25QZWVrSW5kZXggPCBOKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBOb3RpZmljYXRpb25EYXRhLkVudHJ5IGVudHJ5ID0gbU5vdG5zLmdldChOLTEtbU5vdGlmaWNhdGlvblBlZWtJbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeS5pY29uLnNldEJhY2tncm91bmRDb2xvcigwKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19PUEVOX05PVElGSUNBVElPTl9QQU5FTDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAib3BlbmluZyBub3RpZmljYXRpb25zIHBhbmVsIik7CisgICAgICAgICAgICAgICAgICAgIGlmIChtTm90aWZpY2F0aW9uUGFuZWwuZ2V0VmlzaWJpbGl0eSgpID09IFZpZXcuR09ORSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbU5vdGlmaWNhdGlvblBlZWtXaW5kb3cuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworCisgICAgICAgICAgICAgICAgICAgICAgICBtRG9Ob3REaXN0dXJiQnV0dG9uLnNldFRleHQobU5vdGlmaWNhdGlvbnNPbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFIuc3RyaW5nLnN0YXR1c19iYXJfZG9fbm90X2Rpc3R1cmJfYnV0dG9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUi5zdHJpbmcuc3RhdHVzX2Jhcl9wbGVhc2VfZGlzdHVyYl9idXR0b24pOworICAgICAgICAgICAgICAgICAgICAgICAgbU5vdGlmaWNhdGlvblBhbmVsLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldFZpZXdWaXNpYmlsaXR5KG1Ob3RpZmljYXRpb25JY29uQXJlYSwgVmlldy5HT05FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSLmFuaW0ubm90aWZpY2F0aW9uX2ljb25zX291dCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRWaWV3VmlzaWJpbGl0eShtTm90aWZpY2F0aW9uQnV0dG9ucywgVmlldy5WSVNJQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSLmFuaW0ubm90aWZpY2F0aW9uX2J1dHRvbnNfaW4pOworICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaE5vdGlmaWNhdGlvblRyaWdnZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19DTE9TRV9OT1RJRklDQVRJT05fUEFORUw6CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgU2xvZy5kKFRBRywgImNsb3Npbmcgbm90aWZpY2F0aW9ucyBwYW5lbCIpOworICAgICAgICAgICAgICAgICAgICBpZiAobU5vdGlmaWNhdGlvblBhbmVsLmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LlZJU0lCTEUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb25QYW5lbC5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRWaWV3VmlzaWJpbGl0eShtTm90aWZpY2F0aW9uSWNvbkFyZWEsIFZpZXcuVklTSUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUi5hbmltLm5vdGlmaWNhdGlvbl9pY29uc19pbik7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRWaWV3VmlzaWJpbGl0eShtTm90aWZpY2F0aW9uQnV0dG9ucywgVmlldy5HT05FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSLmFuaW0ubm90aWZpY2F0aW9uX2J1dHRvbnNfb3V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hOb3RpZmljYXRpb25UcmlnZ2VyKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBNU0dfT1BFTl9TWVNURU1fUEFORUw6CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgU2xvZy5kKFRBRywgIm9wZW5pbmcgc3lzdGVtIHBhbmVsIik7CisgICAgICAgICAgICAgICAgICAgIG1TeXN0ZW1QYW5lbC5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0NMT1NFX1NZU1RFTV9QQU5FTDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAiY2xvc2luZyBzeXN0ZW0gcGFuZWwiKTsKKyAgICAgICAgICAgICAgICAgICAgbVN5c3RlbVBhbmVsLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBNU0dfT1BFTl9SRUNFTlRTX1BBTkVMOgorICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIFNsb2cuZChUQUcsICJvcGVuaW5nIHJlY2VudHMgcGFuZWwiKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1SZWNlbnRzUGFuZWwgIT0gbnVsbCkgbVJlY2VudHNQYW5lbC5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0NMT1NFX1JFQ0VOVFNfUEFORUw6CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgU2xvZy5kKFRBRywgImNsb3NpbmcgcmVjZW50cyBwYW5lbCIpOworICAgICAgICAgICAgICAgICAgICBpZiAobVJlY2VudHNQYW5lbCAhPSBudWxsKSBtUmVjZW50c1BhbmVsLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZWZyZXNoTm90aWZpY2F0aW9uVHJpZ2dlcigpIHsKKyAgICAgICAgaWYgKG1Ob3RpZmljYXRpb25UcmlnZ2VyID09IG51bGwpIHJldHVybjsKKworICAgICAgICBpbnQgcmVzSWQ7CisgICAgICAgIGJvb2xlYW4gcGFuZWwgPSAobU5vdGlmaWNhdGlvblBhbmVsICE9IG51bGwgCisgICAgICAgICAgICAgICAgJiYgbU5vdGlmaWNhdGlvblBhbmVsLmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LlZJU0lCTEUpOworICAgICAgICBpZiAoIW1Ob3RpZmljYXRpb25zT24pIHsKKyAgICAgICAgICAgIHJlc0lkID0gUi5kcmF3YWJsZS5pY19zeXNiYXJfbm90aV9kbmQ7CisgICAgICAgIH0gZWxzZSBpZiAobU5vdG5zLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIHJlc0lkID0gcGFuZWwgPyBSLmRyYXdhYmxlLmljX3N5c2Jhcl9ub3RpX2F2YWlsX29wZW4gOiBSLmRyYXdhYmxlLmljX3N5c2Jhcl9ub3RpX2F2YWlsOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmVzSWQgPSBwYW5lbCA/IFIuZHJhd2FibGUuaWNfc3lzYmFyX25vdGlfbm9uZV9vcGVuIDogUi5kcmF3YWJsZS5pY19zeXNiYXJfbm90aV9ub25lOworICAgICAgICB9CisgICAgICAgIG1Ob3RpZmljYXRpb25UcmlnZ2VyLnNldEltYWdlUmVzb3VyY2UocmVzSWQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEJhdHRlcnlNZXRlcihpbnQgbGV2ZWwsIGJv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0SW1hZ2VSZXNvdXJjZShpc1dpZmkgPyBSLmRyYXdhYmxlLmljX3N5c2Jhcl93aWZpX21pbmkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5pY19zeXNiYXJfd2lmaV9taW5pKTsgLy8gWFhYCisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRJY29uKFN0cmluZyBzbG90LCBpbnQgaW5kZXgsIGludCB2aWV3SW5kZXgsIFN0YXR1c0Jhckljb24gaWNvbikgeworICAgICAgICBpZiAoREVCVUcpIFNsb2cuZChUQUcsICJhZGRJY29uKCIgKyBzbG90ICsgIikgLT4gIiArIGljb24pOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHVwZGF0ZUljb24oU3RyaW5nIHNsb3QsIGludCBpbmRleCwgaW50IHZpZXdJbmRleCwKKyAgICAgICAgICAgIFN0YXR1c0Jhckljb24gb2xkLCBTdGF0dXNCYXJJY29uIGljb24pIHsKKyAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAidXBkYXRlSWNvbigiICsgc2xvdCArICIpIC0+ICIgKyBpY29uKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZW1vdmVJY29uKFN0cmluZyBzbG90LCBpbnQgaW5kZXgsIGludCB2aWV3SW5kZXgpIHsKKyAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAicmVtb3ZlSWNvbigiICsgc2xvdCArICIpIik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkTm90aWZpY2F0aW9uKElCaW5kZXIga2V5LCBTdGF0dXNCYXJOb3RpZmljYXRpb24gbm90aWZpY2F0aW9uKSB7CisgICAgICAgIGlmIChERUJVRykgU2xvZy5kKFRBRywgImFkZE5vdGlmaWNhdGlvbigiICsga2V5ICsgIiAtPiAiICsgbm90aWZpY2F0aW9uICsgIikiKTsKKyAgICAgICAgYWRkTm90aWZp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ICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGljayhub3RpZmljYXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgc2V0QXJlVGhlcmVOb3RpZmljYXRpb25zKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdXBkYXRlTm90aWZpY2F0aW9uKElCaW5kZXIga2V5LCBTdGF0dXNCYXJOb3RpZmljYXRpb24gbm90aWZpY2F0aW9uKSB7CisgICAgICAgIGlmIChERUJVRykgU2xvZy5kKFRBRywgInVwZGF0ZU5vdGlmaWNhdGlvbigiICsga2V5ICsgIiAtPiAiICsgbm90aWZpY2F0aW9uICsgIikgLy8gVE9ETyIpOworCisgICAgICAgIGZpbmFsIE5vdGlmaWNhdGlvbkRhdGEuRW50cnkgb2xkRW50cnkgPSBtTm90bnMuZmluZEJ5S2V5KGtleSk7CisgICAgICAgIGlmIChvbGRFbnRyeSA9PSBudWxsKSB7CisgICAgICAgICAgICBTbG9nLncoVEFHLCAidXBkYXRlTm90aWZpY2F0aW9uIGZvciB1bmtub3duIGtleTogIiArIGtleSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBmaW5hbCBTdGF0dXNCYXJOb3RpZmljYXRpb24gb2xkTm90aWZpY2F0aW9uID0gb2xkRW50cnkubm90aWZpY2F0aW9uOworICAgICAgICBmaW5hbCBSZW1vdGVWaWV3cyBvbGRDb250ZW50VmlldyA9IG9sZE5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uY29udGVudFZpZXc7CisKKyAgICAgICAgZmluYWwgUmVtb3RlVmlld3MgY29udGVudFZpZXcgPSBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmNvbnRlbnRWaWV3OworCisgICAgICAgIGlmIChmYWxzZSkgeworICAgICAgICAgICAgU2xvZy5kKFRBRywgIm9sZCBub3RpZmljYXRpb246IHdoZW49IiArIG9sZE5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24ud2hlbgorICAgICAgICAgICAgICAgICAgICArICIgb25nb2luZz0iICsgb2xkTm90aWZpY2F0aW9uLmlzT25nb2luZygpCisgICAgICAgICAgICAgICAgICAgICsgIiBleHBhbmRlZD0iICsgb2xkRW50cnkuZXhwYW5kZWQKKyAgICAgICAgICAgICAgICAgICAgKyAiIGNvbnRlbnRWaWV3PSIgKyBvbGRDb250ZW50Vmlldyk7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAibmV3IG5vdGlmaWNhdGlvbjogd2hlbj0iICsgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi53aGVuCisgICAgICAgICAgICAgICAgICAgICsgIiBvbmdvaW5nPSIgKyBvbGROb3RpZmljYXRpb24uaXNPbmdvaW5nKCkKKyAgICAgICAgICAgICAgICAgICAgKyAiIGNvbnRlbnRWaWV3PSIgKyBjb250ZW50Vmlldyk7CisgICAgICAgIH0KKworICAgICAgICAvLyBDYW4gd2UganVzdCByZWFwcGx5IHRoZSBSZW1vdGVWaWV3cyBpbiBwbGFjZT8gIElmIHdoZW4gZGlkbid0IGNoYW5nZSwgdGhlIG9yZGVyCisgICAgICAgIC8vIGRpZG4ndCBjaGFuZ2UuCisgICAgICAgIGlmIChub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLndoZW4gPT0gb2xkTm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi53aGVuCisgICAgICAgICAgICAgICAgJiYgbm90aWZpY2F0aW9uLmlzT25nb2luZygpID09IG9sZE5vdGlmaWNhdGlvbi5pc09uZ29pbmcoKQorICAgICAgICAgICAgICAgICYmIG9sZEVudHJ5LmV4cGFuZGVkICE9IG51bGwKKyAgICAgICAgICAgICAgICAmJiBjb250ZW50VmlldyAhPSBudWxsCisgICAgICAgICAgICAgICAgJiYgb2xkQ29udGVudFZpZXcgIT0gbnVsbAorICAgICAgICAgICAgICAgICYmIGNvbnRlbnRWaWV3LmdldFBhY2thZ2UoKSAhPSBudWxsCisgICAgICAgICAgICAgICAgJiYgb2xkQ29udGVudFZpZXcuZ2V0UGFja2FnZSgpICE9IG51bGwKKyAgICAgICAgICAgICAgICAmJiBvbGRDb250ZW50Vmlldy5nZXRQYWNrYWdlKCkuZXF1YWxzKGNvbnRlbnRWaWV3LmdldFBhY2thZ2UoKSkKKyAgICAgICAgICAgICAgICAmJiBvbGRDb250ZW50Vmlldy5nZXRMYXlvdXRJZCgpID09IGNvbnRlbnRWaWV3LmdldExheW91dElkKCkpIHsKKyAgICAgICAgICAgIGlmIChERUJVRykgU2xvZy5kKFRBRywgInJldXNpbmcgbm90aWZpY2F0aW9uIGZvciBrZXk6ICIgKyBrZXkpOworICAgICAgICAgICAgb2xkRW50cnkubm90aWZpY2F0aW9uID0gbm90aWZpY2F0aW9uOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAvLyBSZWFwcGx5IHRoZSBSZW1vdGVWaWV3cworICAgICAgICAgICAgICAgIGNvbnRlbnRWaWV3LnJlYXBwbHkobUNvbnRleHQsIG9sZEVudHJ5LmNvbnRlbnQpOworICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgY29udGVudEludGVudAorICAgICAgICAgICAgICAgIGZpbmFsIFBlbmRpbmdJbnRlbnQgY29udGVudEludGVudCA9IG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uY29udGVudEludGVudDsKKyAgICAgICAgICAgICAgICBpZiAoY29udGVudEludGVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG9sZEVudHJ5LmNvbnRlbnQuc2V0T25DbGlja0xpc3RlbmVyKG5ldyBOb3RpZmljYXRpb25DbGlja2VyKGNvbnRlbnRJbnRlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5wa2csIG5vdGlmaWNhdGlvbi50YWcsIG5vdGlmaWNhdGlvbi5pZCkpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG9sZEVudHJ5LmNvbnRlbnQuc2V0T25DbGlja0xpc3RlbmVyKG51bGwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBVcGRhdGUgdGhlIGljb24uCisgICAgICAgICAgICAgICAgZmluYWwgU3RhdHVzQmFySWNvbiBpYyA9IG5ldyBTdGF0dXNCYXJJY29uKG5vdGlmaWNhdGlvbi5wa2csCisgICAgICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmljb24sIG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uaWNvbkxldmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5udW1iZXIpOworICAgICAgICAgICAgICAgIGlmICghb2xkRW50cnkuaWNvbi5zZXQoaWMpKSB7CisgICAgICAgICAgICAgICAgICAgIGhhbmRsZU5vdGlmaWNhdGlvbkVycm9yKGtleSwgbm90aWZpY2F0aW9uLCAiQ291bGRuJ3QgdXBkYXRlIGljb246ICIgKyBpYyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgLy8gSXQgZmFpbGVkIHRvIGFkZCBjbGVhbmx5LiAgTG9nLCBhbmQgcmVtb3ZlIHRoZSB2aWV3IGZyb20gdGhlIHBhbmVsLgorICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJDb3VsZG4ndCByZWFwcGx5IHZpZXdzIGZvciBwYWNrYWdlICIgKyBjb250ZW50Vmlldy5nZXRQYWNrYWdlKCksIGUpOworICAgICAgICAgICAgICAgIHJlbW92ZU5vdGlmaWNhdGlvblZpZXdzKGtleSk7CisgICAgICAgICAgICAgICAgYWRkTm90aWZpY2F0aW9uVmlld3Moa2V5LCBub3RpZmljYXRpb24pOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAibm90IHJldXNpbmcgbm90aWZpY2F0aW9uIGZvciBrZXk6ICIgKyBrZXkpOworICAgICAgICAgICAgcmVtb3ZlTm90aWZpY2F0aW9uVmlld3Moa2V5KTsKKyAgICAgICAgICAgIGFkZE5vdGlmaWNhdGlvblZpZXdzKGtleSwgbm90aWZpY2F0aW9uKTsKKyAgICAgICAgfQorICAgICAgICAvLyBUT0RPOiB0aWNrZXI7IGltbWVyc2l2ZSBtb2RlCisKKyAgICAgICAgc2V0QXJlVGhlcmVOb3RpZmljYXRpb25zKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcmVtb3ZlTm90aWZpY2F0aW9uKElCaW5kZXIga2V5KSB7CisgICAgICAgIGlmIChERUJVRykgU2xvZy5kKFRBRywgInJlbW92ZU5vdGlmaWNhdGlvbigiICsga2V5ICsgIikgLy8gVE9ETyIpOworICAgICAgICByZW1vdmVOb3RpZmljYXRpb25WaWV3cyhrZXkpOworICAgICAgICBzZXRBcmVUaGVyZU5vdGlmaWNhdGlvbnMoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBkaXNhYmxlKGludCBzdGF0ZSkgeworICAgICAgICBpbnQgb2xkID0gbURpc2FibGVkOworICAgICAgICBpbnQgZGlmZiA9IHN0YXRlIF4gb2xkOworICAgICAgICBTbG9nLmQoVEFHLCAiZGlzYWJsZS4uLiBvbGQ9MHgiICsgSW50ZWdlci50b0hleFN0cmluZyhvbGQpCisgICAgICAgICAgICAgICAgKyAiIGRpZmY9MHgiICsgSW50ZWdlci50b0hleFN0cmluZyhkaWZmKQorICAgICAgICAgICAgICAgICsgIiBzdGF0ZT0weCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKHN0YXRlKSk7CisgICAgICAgIG1EaXNhYmxlZCA9IHN0YXRlOworCisgICAgICAgIC8vIGFjdCBhY2NvcmRpbmdseQorICAgICAgICBpZiAoKGRpZmYgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfRVhQQU5EKSAhPSAwKSB7CisgICAgICAgICAgICBpZiAoKHN0YXRlICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX0VYUEFORCkgIT0gMCkgeworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJESVNBQkxFX0VYUEFORDogeWVzIik7CisgICAgICAgICAgICAgICAgYW5pbWF0ZUNvbGxhcHNlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKChkaWZmICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05PVElGSUNBVElPTl9JQ09OUykgIT0gMCkgeworICAgICAgICAgICAgaWYgKChzdGF0ZSAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9OT1RJRklDQVRJT05fSUNPTlMpICE9IDApIHsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiRElTQUJMRV9OT1RJRklDQVRJT05fSUNPTlM6IHllcyIpOworICAgICAgICAgICAgICAgIHNldFZpZXdWaXNpYmlsaXR5KG1Ob3RpZmljYXRpb25UcmlnZ2VyLCBWaWV3LkdPTkUsCisgICAgICAgICAgICAgICAgICAgICAgICBSLmFuaW0ubm90aWZpY2F0aW9uX2ljb25zX291dCk7CisgICAgICAgICAgICAgICAgc2V0Vmlld1Zpc2liaWxpdHkobU5vdGlmaWNhdGlvbkljb25BcmVhLCBWaWV3LkdPTkUsCisgICAgICAgICAgICAgICAgICAgICAgICBSLmFuaW0ubm90aWZpY2F0aW9uX2ljb25zX291dCk7CisgICAgICAgICAgICAgICAgbVRpY2tlci5oYWx0KCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJESVNBQkxFX05PVElGSUNBVElPTl9JQ09OUzogbm8iKTsKKyAgICAgICAgICAgICAgICBzZXRWaWV3VmlzaWJpbGl0eShtTm90aWZpY2F0aW9uVHJpZ2dlciwgVmlldy5WSVNJQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgUi5hbmltLm5vdGlmaWNhdGlvbl9pY29uc19pbik7CisgICAgICAgICAgICAgICAgc2V0Vmlld1Zpc2liaWxpdHkobU5vdGlmaWNhdGlvbkljb25BcmVhLCBWaWV3LlZJU0lCTEUsCisgICAgICAgICAgICAgICAgICAgICAgICBSLmFuaW0ubm90aWZpY2F0aW9uX2ljb25zX2luKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmICgoZGlmZiAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9OT1RJRklDQVRJT05fVElDS0VSKSAhPSAwKSB7CisgICAgICAgICAgICBpZiAoKHN0YXRlICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05PVElGSUNBVElPTl9USUNLRVIpICE9IDApIHsKKyAgICAgICAgICAgICAgICBtVGlja2VyLmhhbHQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoKGRpZmYgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfU1lTVEVNX0lORk8pICE9IDApIHsKKyAgICAgICAgICAgIGlmICgoc3RhdGUgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfU1lTVEVNX0lORk8pICE9IDApIHsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiRElTQUJMRV9TWVNURU1fSU5GTzogeWVzIik7CisgICAgICAgICAgICAgICAgc2V0Vmlld1Zpc2liaWxpdHkobVN5c3RlbUluZm8sIFZpZXcuR09ORSwgUi5hbmltLm5hdmlnYXRpb25fb3V0KTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkRJU0FCTEVfU1lTVEVNX0lORk86IG5vIik7CisgICAgICAgICAgICAgICAgc2V0Vmlld1Zpc2liaWxpdHkobVN5c3RlbUluZm8sIFZpZXcuVklTSUJMRSwgUi5hbmltLm5hdmlnYXRpb25faW4pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmICgoZGlmZiAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9OQVZJR0FUSU9OKSAhPSAwKSB7CisgICAgICAgICAgICBpZiAoKHN0YXRlICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05BVklHQVRJT04pICE9IDApIHsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiRElTQUJMRV9OQVZJR0FUSU9OOiB5ZXMiKTsKKyAgICAgICAgICAgICAgICBzZXRWaWV3VmlzaWJpbGl0eShtTmF2aWdhdGlvbkFyZWEsIFZpZXcuR09ORSwgUi5hbmltLm5hdmlnYXRpb25fb3V0KTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkRJU0FCTEVfTkFWSUdBVElPTjogbm8iKTsKKyAgICAgICAgICAgICAgICBzZXRWaWV3VmlzaWJpbGl0eShtTmF2aWdhdGlvbkFyZWEsIFZpZXcuVklTSUJMRSwgUi5hbmltLm5hdmlnYXRpb25faW4pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGhhc1RpY2tlcihOb3RpZmljYXRpb24gbikgeworICAgICAgICByZXR1cm4gIVRleHRVdGlscy5pc0VtcHR5KG4udGlja2VyVGV4dCkKKyAgICAgICAgICAgICAgICB8fCAhVGV4dFV0aWxzLmlzRW1wdHkobi50aWNrZXJUaXRsZSkKKyAgICAgICAgICAgICAgICB8fCAhVGV4dFV0aWxzLmlzRW1wdHkobi50aWNrZXJTdWJ0aXRsZSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHRpY2soU3RhdHVzQmFyTm90aWZpY2F0aW9uIG4pIHsKKyAgICAgICAgLy8gRG9uJ3Qgc2hvdyB0aGUgdGlja2VyIHdoZW4gdGhlIHdpbmRvd3NoY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WaWV3LkdPTkUsIFIuYW5pbS5zdGF0dXNfYmFyX291dCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRNZW51S2V5VmlzaWJsZShib29sZWFuIHZpc2libGUpIHsKKyAgICAgICAgaWYgKERFQlVHKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAodmlzaWJsZT8ic2hvd2luZyI6ImhpZGluZyIpICsgIiB0aGUgTUVOVSBidXR0b24iKTsKKyAgICAgICAgfQorICAgICAgICBzZXRWaWV3VmlzaWJpbGl0eShtTWVudUJ1dHRvbiwKKyAgICAgICAgICAgICAgICB2aXNpYmxlID8gVmlldy5WSVNJQkxFIDogVmlldy5JTlZJU0lCTEUsCisgICAgICAgICAgICAgICAgdmlzaWJsZSA/IFIuYW5pbS5uYXZpZ2F0aW9uX2luIDogUi5hbmltLm5hdmlnYXRpb25fb3V0KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRJTUVCdXR0b25WaXNpYmxlKGJvb2xlYW4gdmlzaWJsZSkgeworICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgIFNsb2cuZChUQUcsICh2aXNpYmxlPyJzaG93aW5nIjoiaGlkaW5nIikgKyAiIHRoZSBJTUUgYnV0dG9uIik7CisgICAgICAgIH0KKyAgICAgICAgbUlucHV0TWV0aG9kQnV0dG9uLnNldElNRUJ1dHRvblZpc2libGUodmlzaWJsZSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldEFyZVRoZXJlTm90aWZpY2F0aW9ucygpIHsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBoYXNDbGVhcmFibGUgPSBtTm90bnMuaGFzQ2xlYXJhYmxlSXRlbXMoKTsKKworICAgICAgICAvL1Nsb2cuZChUQUcsICJzZXRBcmVUaGVyZU5vdGlmaWNhdGlvbnMgaGFzQ2xlcmFibGU9IiArIGhhc0NsZWFyYWJsZSk7CisKKyAgICAgICAgLy8gU2hvdyBvciBoaWRlIHRoZSAiQ2xlYXIgYWxsIiBidXR0b24uICBOb3RlIHRoYXQgd2UgZG9uJ3QgZG8gYW4gYW5pbWF0aW9uCisgICAgICAgIC8vIGlmIGl0J3Mgbm90IG9uIHNjcmVlbiwgc28gdGhhdCBpZiBzb21lb25lIG9wZW5zIHRoZSBiYXIgcmlnaHQgdGhlbiB0aGV5CisgICAgICAgIC8vIGRvbid0IHNlZSB0aGUgYW5pbWF0aW9uIGluIHByb2dyZXNzLgorICAgICAgICAvLyAobm8gb25nb2luZyBub3RpZmljYXRpb25zIGFyZSBjbGVhcmFibGUpCisgICAgICAgIGlmIChoYXNDbGVhcmFibGUpIHsKKyAgICAgICAgICAgIGlmIChtTm90aWZpY2F0aW9uQnV0dG9ucy5nZXRWaXNpYmlsaXR5KCkgPT0gVmlldy5WSVNJQkxFKSB7CisgICAgICAgICAgICAgICAgc2V0Vmlld1Zpc2liaWxpdHkobUNsZWFyQnV0dG9uLCBWaWV3LlZJU0lCTEUsIFIuYW5pbS5ub3RpZmljYXRpb25fYnV0dG9uc19pbik7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1DbGVhckJ1dHRvbi5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAobU5vdGlmaWNhdGlvbkJ1dHRvbnMuZ2V0VmlzaWJpbGl0eSgpID09IFZpZXcuVklTSUJMRSkgeworICAgICAgICAgICAgICAgIHNldFZpZXdWaXNpYmlsaXR5KG1DbGVhckJ1dHRvbiwgVmlldy5HT05FLCBSLmFuaW0ubm90aWZpY2F0aW9uX2J1dHRvbnNfb3V0KTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUNsZWFyQnV0dG9uLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgIG1PbmdvaW5nVGl0bGUuc2V0VmlzaWJpbGl0eShvbmdvaW5nID8gVmlldy5WSVNJQkxFIDogVmlldy5HT05FKTsKKyAgICAgICAgbUxhdGVzdFRpdGxlLnNldFZpc2liaWxpdHkobGF0ZXN0ID8gVmlldy5WSVNJQkxFIDogVmlldy5HT05FKTsKKworICAgICAgICBpZiAob25nb2luZyB8fCBsYXRlc3QpIHsKKyAgICAgICAgICAgIG1Ob05vdGlmaWNhdGlvbnNUaXRsZS5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtTm9Ob3RpZmljYXRpb25zVGl0bGUuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICB9CisgICAgICAgICovCisgICAgfQorCisgICAgLyoqCisgICAgICogQ2FuY2VsIHRoaXMgbm90aWZpY2F0aW9uIGFuZCB0ZWxsIHRoZSBzdGF0dXMgYmFyIHNlcnZpY2UgYWJvdXQgdGhlIGZhaWx1cmUuIEhvbGQgbm8gbG9ja3MuCisgICAgICovCisgICAgdm9pZCBoYW5kbGVOb3RpZmljYXRpb25FcnJvcihJQmluZGVyIGtleSwgU3RhdHVzQmFyTm90aWZpY2F0aW9uIG4sIFN0cmluZyBtZXNzYWdlKSB7CisgICAgICAgIHJlbW92ZU5vdGlmaWNhdGlvbihrZXkpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbUJhclNlcnZpY2Uub25Ob3RpZmljYXRpb25FcnJvcihuLnBrZywgbi50YWcsIG4uaWQsIG4udWlkLCBuLmluaXRpYWxQaWQsIG1lc3NhZ2UpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgIC8vIFRoZSBlbmQgaXMgbmlnaC4KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgQ2xvY2tUb3VjaExpc3RlbmVyIGltcGxlbWVudHMgVmlldy5PblRvdWNoTGlzdGVuZXIgeworICAgICAgICBWZWxvY2l0eVRyYWNrZXIgbVZUOworICAgICAgICBwdWJsaWMgYm9vbGVhbiBvblRvdWNoIChWaWV3IHYsIE1vdGlvbkV2ZW50IGV2ZW50KSB7CisgICAgICAgICAgICBzd2l0Y2ggKGV2ZW50LmdldEFjdGlvbigpKSB7CisgICAgICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTjoKKyAgICAgICAgICAgICAgICAgICAgbVZUID0gVmVsb2NpdHlUcmFja2VyLm9idGFpbigpOworICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKKyAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9PVVRTSURFOgorICAgICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX01PVkU6CisgICAgICAgICAgICAgICAgICAgIGlmIChtVlQgPT0gbnVsbCkgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIG1WVC5hZGRNb3ZlbWVudChldmVudCk7CisgICAgICAgICAgICAgICAgICAgIG1WVC5jb21wdXRlQ3VycmVudFZlbG9jaXR5KDEwMDApOworICAgICAgICAgICAgICAgICAgICBpZiAobVZULmdldFlWZWxvY2l0eSgpIDwgLTIwMCAmJiBtU3lzdGVtUGFuZWwuZ2V0VmlzaWJpbGl0eSgpID09IFZpZXcuR09ORSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTVNHX09QRU5fU1lTVEVNX1BBTkVMKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2UoTVNHX09QRU5fU1lTVEVNX1BBTkVMKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9VUDoKKyAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6CisgICAgICAgICAgICAgICAgICAgIG1WVC5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgICAgIG1WVCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBWaWV3Lk9uQ2xpY2tMaXN0ZW5lciBtT25DbGlja0xpc3RlbmVyID0gbmV3IFZpZXcuT25DbGlja0xpc3RlbmVyKCkgeworICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgaWYgKHYgPT0gbUNsZWFyQnV0dG9uKSB7CisgICAgICAgICAgICAgICAgb25DbGlja0NsZWFyQnV0dG9uKCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHYgPT0gbURvTm90RGlzdHVyYkJ1dHRvbikgeworICAgICAgICAgICAgICAgIG9uQ2xpY2tEb05vdERpc3R1cmIoKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodiA9PSBtTm90aWZpY2F0aW9uVHJpZ2dlcikgeworICAgICAgICAgICAgICAgIG9uQ2xpY2tOb3RpZmljYXRpb25UcmlnZ2VyKCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHYgPT0gbVN5c3RlbUluZm8pIHsKKyAgICAgICAgICAgICAgICBvbkNsaWNrU3lzdGVtSW5mbygpOworICAgICAgICAgICAgfSBlbHNlIGlmICh2ID09IG1SZWNlbnRCdXR0b24pIHsKKyAgICAgICAgICAgICAgICBvbkNsaWNrUmVjZW50QnV0dG9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgdm9pZCBvbkNsaWNrQ2xlYXJCdXR0b24oKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtQmFyU2VydmljZS5vbkNsZWFyQWxsTm90aWZpY2F0aW9ucygpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgIC8vIHN5c3RlbSBwcm9jZXNzIGlzIGRlYWQgaWYgd2UncmUgaGVyZS4KKyAgICAgICAgfQorICAgICAgICBhbmltYXRlQ29sbGFwc2UoKTsKKyAgICAgICAgcmVmcmVzaE5vdGlmaWNhdGlvblRyaWdnZXIoKTsKKyAgICB9CisKKyAgICB2b2lkIG9uQ2xpY2tEb05vdERpc3R1cmIoKSB7CisgICAgICAgIG1Ob3RpZmljYXRpb25zT24gPSAhbU5vdGlmaWNhdGlvbnNPbjsKKyAgICAgICAgbUljb25MYXlvdXQuc2V0VmlzaWJpbGl0eShtTm90aWZpY2F0aW9uc09uID8gVmlldy5WSVNJQkxFIDogVmlldy5JTlZJU0lCTEUpOyAvLyBUT0RPOiBhbmltYXRpb24KKyAgICAgICAgYW5pbWF0ZUNvbGxhcHNlKCk7CisgICAgICAgIHJlZnJlc2hOb3RpZmljYXRpb25UcmlnZ2VyKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb25DbGlja05vdGlmaWNhdGlvblRyaWdnZXIoKSB7CisgICAgICAgIGlmIChERUJVRykgU2xvZy5kKFRBRywgImNsaWNrZWQgbm90aWZpY2F0aW9uIGljb25zIik7CisgICAgICAgIGlmICgobURpc2FibGVkICYgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX0VYUEFORCkgPT0gMCkgeworICAgICAgICAgICAgaWYgKCFtTm90aWZpY2F0aW9uc09uKSB7CisgICAgICAgICAgICAgICAgbU5vdGlmaWNhdGlvbnNPbiA9IHRydWU7CisgICAgICAgICAgICAgICAgbUljb25MYXlvdXQuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOyAvLyBUT0RPOiBhbmltYXRpb24KKyAgICAgICAgICAgICAgICByZWZyZXNoTm90aWZpY2F0aW9uVHJpZ2dlcigpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpbnQgbXNnID0gKG1Ob3RpZmljYXRpb25QYW5lbC5nZXRWaXNpYmlsaXR5KCkgPT0gVmlldy5HT05FKQorICAgICAgICAgICAgICAgICAgICA/IE1TR19PUEVOX05PVElGSUNBVElPTl9QQU5FTAorICAgICAgICAgICAgICAgICAgICA6IE1TR19DTE9TRV9OT1RJRklDQVRJT05fUEFORUw7CisgICAgICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMobXNnKTsKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvbkNsaWNrU3lzdGVtSW5mbygpIHsKKyAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAiY2xpY2tlZCBzeXN0ZW0gaW5mbyIpOworICAgICAgICBpZiAoKG1EaXNhYmxlZCAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9FWFBBTkQpID09IDApIHsKKyAgICAgICAgICAgIGludCBtc2cgPSAobVN5c3RlbVBhbmVsLmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LkdPTkUpCisgICAgICAgICAgICAgICAgPyBNU0dfT1BFTl9TWVNURU1fUEFORUwKKyAgICAgICAgICAgICAgICA6IE1TR19DTE9TRV9TWVNURU1fUEFORUw7CisgICAgICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhtc2cpOworICAgICAgICAgICAgbUhhbmRsZXIuc2VuZEVtcHR5TWVzc2FnZShtc2cpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb25DbGlja1JlY2VudEJ1dHRvbigpIHsKKyAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAiY2xpY2tlZCByZWNlbnQgYXBwcyIpOworICAgICAgICBpZiAobVJlY2VudHNQYW5lbCA9PSBudWxsKSB7CisgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCgpOworICAgICAgICAgICAgaW50ZW50LnNldENsYXNzKG1Db250ZXh0LCBSZWNlbnRBcHBsaWNhdGlvbnNBY3Rpdml0eS5jbGFzcyk7CisgICAgICAgICAgICBpbnRlbnQuc2V0RmxhZ3MoSW50ZW50LkZMQUdfQUNUSVZJVFlfTkVXX1RBU0sKKyAgICAgICAgICAgICAgICAgICAgfCBJbnRlbnQuRkxBR19BQ1RJVklUWV9FWENMVURFX0ZST01fUkVDRU5UUyk7CisgICAgICAgICAgICBtQ29udGV4dC5zdGFydEFjdGl2aXR5KGludGVudCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAoKG1EaXNhYmxlZCAmIFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9FWFBBTkQpID09IDApIHsKKyAgICAgICAgICAgICAgICBpbnQgbXNnID0gKG1SZWNlbnRzUGFuZWwuZ2V0VmlzaWJpbGl0eSgpID09IFZpZXcuR09ORSkKKyAgICAgICAgICAgICAgICAgICAgPyBNU0dfT1BFTl9SRUNFTlRTX1BBTkVMCisgICAgICAgICAgICAgICAgICAgIDogTVNHX0NMT1NFX1JFQ0VOVFNfUEFORUw7CisgICAgICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMobXNnKTsKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIE5vdGlmaWNhdGlvbkNsaWNrZXIgaW1wbGVtZW50cyBWaWV3Lk9uQ2xpY2tMaXN0ZW5lciB7CisgICAgICAgIHByaXZhdGUgUGVuZGluZ0ludGVudCBtSW50ZW50OworICAgICAgICBwcml2YXRlIFN0cmluZyBtUGtnOworICAgICAgICBwcml2YXRlIFN0cmluZyBtVGFnOworICAgICAgICBwcml2YXRlIGludCBtSWQ7CisKKyAgICAgICAgTm90aWZpY2F0aW9uQ2xpY2tlcihQZW5kaW5nSW50ZW50IGludGVudCwgU3RyaW5nIHBrZywgU3RyaW5nIHRhZywgaW50IGlkKSB7CisgICAgICAgICAgICBtSW50ZW50ID0gaW50ZW50OworICAgICAgICAgICAgbVBrZyA9IHBrZzsKKyAgICAgICAgICAgIG1UYWcgPSB0YWc7CisgICAgICAgICAgICBtSWQgPSBpZDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIC8vIFRoZSBpbnRlbnQgd2UgYXJlIHNlbmRpbmcgaXMgZm9yIHRoZSBhcHBsaWNhdGlvbiwgd2hpY2gKKyAgICAgICAgICAgICAgICAvLyB3b24ndCBoYXZlIHBlcm1pc3Npb24gdG8gaW1tZWRpYXRlbHkgc3RhcnQgYW4gYWN0aXZpdHkgYWZ0ZXIKKyAgICAgICAgICAgICAgICAvLyB0aGUgdXNlciBzd2l0Y2hlcyB0byBob21lLiAgV2Uga25vdyBpdCBpcyBzYWZlIHRvIGRvIGF0IHRoaXMKKyAgICAgICAgICAgICAgICAvLyBwb2ludCwgc28gbWFrZSBzdXJlIG5ldyBhY3Rpdml0eSBzd2l0Y2hlcyBhcmUgbm93IGFsbG93ZWQuCisgICAgICAgICAgICAgICAgQWN0aXZpdHlNYW5hZ2VyTmF0aXZlLmdldERlZmF1bHQoKS5yZXN1bWVBcHBTd2l0Y2hlcygpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1JbnRlbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGludFtdIHBvcyA9IG5ldyBpbnRbMl07CisgICAgICAgICAgICAgICAgdi5nZXRMb2NhdGlvbk9uU2NyZWVuKHBvcyk7CisgICAgICAgICAgICAgICAgSW50ZW50IG92ZXJsYXkgPSBuZXcgSW50ZW50KCk7CisgICAgICAgICAgICAgICAgb3ZlcmxheS5zZXRTb3VyY2VCb3VuZHMoCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgUmVjdChwb3NbMF0sIHBvc1sxXSwgcG9zWzBdK3YuZ2V0V2lkdGgoKSwgcG9zWzFdK3YuZ2V0SGVpZ2h0KCkpKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBtSW50ZW50LnNlbmQobUNvbnRleHQsIDAsIG92ZXJsYXkpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFBlbmRpbmdJbnRlbnQuQ2FuY2VsZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAvLyB0aGUgc3RhY2sgdHJhY2UgaXNuJ3QgdmVyeSBoZWxwZnVsIGhlcmUuICBKdXN0IGxvZyB0aGUgZXhjZXB0aW9uIG1lc3NhZ2UuCisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJTZW5kaW5nIGNvbnRlbnRJbnRlbnQgZmFpbGVkOiAiICsgZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1CYXJTZXJ2aWNlLm9uTm90aWZpY2F0aW9uQ2xpY2sobVBrZywgbVRhZywgbUlkKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgIC8vIHN5c3RlbSBwcm9jZXNzIGlzIGRlYWQgaWYgd2UncmUgaGVyZS4KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gY2xvc2UgdGhlIHNoYWRlIGlmIGl0IHdhcyBvcGVuCisgICAgICAgICAgICBhbmltYXRlQ29sbGFwc2UoKTsKKworICAgICAgICAgICAgLy8gSWYgdGhpcyBjbGljayB3YXMgb24gdGhlIGludHJ1ZGVyIGFsZXJ0LCBoaWRlIHRoYXQgaW5zdGVhZAorLy8gICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKE1TR19ISURFX0lOVFJVREVSKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIFN0YXR1c0Jhck5vdGlmaWNhdGlvbiByZW1vdmVOb3RpZmljYXRpb25WaWV3cyhJQmluZGVyIGtleSkgeworICAgICAgICBOb3RpZmljYXRpb25EYXRhLkVudHJ5IGVudHJ5ID0gbU5vdG5zLnJlbW92ZShrZXkpOworICAgICAgICBpZiAoZW50cnkgPT0gbnVsbCkgeworICAgICAgICAgICAgU2xvZy53KFRBRywgInJlbW92ZU5vdGlmaWNhdGlvbiBmb3IgdW5rbm93biBrZXk6ICIgKyBrZXkpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgLy8gUmVtb3ZlIHRoZSBleHBhbmRlZCB2aWV3LgorICAgICAgICBWaWV3R3JvdXAgcm93UGFyZW50ID0gKFZpZXdHcm91cCllbnRyeS5yb3cuZ2V0UGFyZW50KCk7CisgICAgICAgIGlmIChyb3dQYXJlbnQgIT0gbnVsbCkgcm93UGFyZW50LnJlbW92ZVZpZXcoZW50cnkucm93KTsKKyAgICAgICAgLy8gUmVtb3ZlIHRoZSBpY29uLgorLy8gICAgICAgIFZpZXdHcm91cCBpY29uUGFyZW50ID0gKFZpZXdHcm91cCllbnRyeS5pY29uLmdldFBhcmVudCgpOworLy8gICAgICAgIGlmIChpY29uUGFyZW50ICE9IG51bGwpIGljb25QYXJlbnQucmVtb3ZlVmlldyhlbnRyeS5pY29uKTsKKyAgICAgICAgcmVmcmVzaEljb25zKCk7CisKKyAgICAgICAgcmV0dXJuIGVudHJ5Lm5vdGlmaWNhdGlvbjsKKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIE5vdGlmaWNhdGlvbkljb25Ub3VjaExpc3RlbmVyIGltcGxlbWVudHMgVmlldy5PblRvdWNoTGlzdGVuZXIgeworICAgICAgICBWZWxvY2l0eVRyYWNrZXIgbVZUOworCisgICAgICAgIHB1YmxpYyBOb3RpZmljYXRpb25JY29uVG91Y2hMaXN0ZW5lcigpIHsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2goVmlldyB2LCBNb3Rpb25FdmVudCBldmVudCkgeworICAgICAgICAgICAgYm9vbGVhbiBwZWVraW5nID0gbU5vdGlmaWNhdGlvblBlZWtXaW5kb3cuZ2V0VmlzaWJpbGl0eSgpICE9IFZpZXcuR09ORTsKKyAgICAgICAgICAgIGJvb2xlYW4gcGFuZWxTaG93aW5nID0gbU5vdGlmaWNhdGlvblBhbmVsLmdldFZpc2liaWxpdHkoKSAhPSBWaWV3LkdPTkU7CisgICAgICAgICAgICBpZiAocGFuZWxTaG93aW5nKSByZXR1cm4gZmFsc2U7CisKKyAgICAgICAgICAgIHN3aXRjaCAoZXZlbnQuZ2V0QWN0aW9uKCkpIHsKKyAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOOgorICAgICAgICAgICAgICAgICAgICBtVlQgPSBWZWxvY2l0eVRyYWNrZXIub2J0YWluKCk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCisgICAgICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fT1VUU0lERToKKyAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFOgorICAgICAgICAgICAgICAgICAgICAvLyBwZWVrIGFuZCBzd2l0Y2ggaWNvbnMgaWYgbmVjZXNzYXJ5CisgICAgICAgICAgICAgICAgICAgIGludCBudW1JY29ucyA9IG1JY29uTGF5b3V0LmdldENoaWxkQ291bnQoKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHBlZWtJbmRleCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpKChmbG9hdClldmVudC5nZXRYKCkgKiBudW1JY29ucyAvIG1JY29uTGF5b3V0LmdldFdpZHRoKCkpOworICAgICAgICAgICAgICAgICAgICBpZiAocGVla0luZGV4ID4gbnVtSWNvbnMgLSAxKSBwZWVrSW5kZXggPSBudW1JY29ucyAtIDE7CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHBlZWtJbmRleCA8IDApIHBlZWtJbmRleCA9IDA7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFwZWVraW5nIHx8IG1Ob3RpZmljYXRpb25QZWVrSW5kZXggIT0gcGVla0luZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIFNsb2cuZChUQUcsICJ3aWxsIHBlZWsgYXQgbm90aWZpY2F0aW9uICMiICsgcGVla0luZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgcGVla01zZyA9IG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoTVNHX09QRU5fTk9USUZJQ0FUSU9OX1BFRUspOworICAgICAgICAgICAgICAgICAgICAgICAgcGVla01zZy5hcmcxID0gcGVla0luZGV4OworCisgICAgICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfT1BFTl9OT1RJRklDQVRJT05fUEVFSyk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vIGRlbGF5IGlmIHdlJ3JlIHNjcnViYmluZyBsZWZ0LXJpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kTWVzc2FnZURlbGF5ZWQocGVla01zZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVla2luZyA/IDAgOiBtTm90aWZpY2F0aW9uUGVla1RhcER1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGZvciBmbGluZworICAgICAgICAgICAgICAgICAgICBpZiAobVZUICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1WVC5hZGRNb3ZlbWVudChldmVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVlQuY29tcHV0ZUN1cnJlbnRWZWxvY2l0eSgxMDAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlcXVpcmUgYSBsaXR0bGUgbW9yZSBvb21waCBvbmNlIHdlJ3JlIGFscmVhZHkgaW4gcGVla2Fib28gbW9kZQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFwYW5lbFNob3dpbmcgJiYgKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwZWVraW5nICYmIG1WVC5nZXRZVmVsb2NpdHkoKSA8IC1tTm90aWZpY2F0aW9uRmxpbmdWZWxvY2l0eSozKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChtVlQuZ2V0WVZlbG9jaXR5KCkgPCAtbU5vdGlmaWNhdGlvbkZsaW5nVmVsb2NpdHkpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE1TR19PUEVOX05PVElGSUNBVElPTl9QRUVLKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfT1BFTl9OT1RJRklDQVRJT05fUEFORUwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2UoTVNHX0NMT1NFX05PVElGSUNBVElPTl9QRUVLKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKE1TR19PUEVOX05PVElGSUNBVElPTl9QQU5FTCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fVVA6CisgICAgICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fQ0FOQ0VMOgorICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfT1BFTl9OT1RJRklDQVRJT05fUEVFSyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChwZWVraW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlRGVsYXllZChNU0dfQ0xPU0VfTk9USUZJQ0FUSU9OX1BFRUssIDI1MCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbVZULnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgbVZUID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBTdGF0dXNCYXJJY29uVmlldyBhZGROb3RpZmljYXRpb25WaWV3cyhJQmluZGVyIGtleSwgU3RhdHVzQmFyTm90aWZpY2F0aW9uIG5vdGlmaWNhdGlvbikgeworICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgIFNsb2cuZChUQUcsICJhZGROb3RpZmljYXRpb25WaWV3cyhrZXk9IiArIGtleSArICIsIG5vdGlmaWNhdGlvbj0iICsgbm90aWZpY2F0aW9uKTsKKyAgICAgICAgfQorICAgICAgICAvLyBDb25zdHJ1Y3QgdGhlIGljb24uCisgICAgICAgIGZpbmFsIFN0YXR1c0Jhckljb25WaWV3IGljb25WaWV3ID0gbmV3IFN0YXR1c0Jhckljb25WaWV3KG1Db250ZXh0LAorICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5wa2cgKyAiLzB4IiArIEludGVnZXIudG9IZXhTdHJpbmcobm90aWZpY2F0aW9uLmlkKSk7CisgICAgICAgIGljb25WaWV3LnNldFNjYWxlVHlwZShJbWFnZVZpZXcuU2NhbGVUeXBlLkNFTlRFUl9JTlNJREUpOworCisgICAgICAgIGZpbmFsIFN0YXR1c0Jhckljb24gaWMgPSBuZXcgU3RhdHVzQmFySWNvbihub3RpZmljYXRpb24ucGtnLAorICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmljb24sCisgICAgICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uaWNvbkxldmVsLAorICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLm51bWJlcik7CisgICAgICAgIGlmICghaWNvblZpZXcuc2V0KGljKSkgeworICAgICAgICAgICAgaGFuZGxlTm90aWZpY2F0aW9uRXJyb3Ioa2V5LCBub3RpZmljYXRpb24sICJDb3VsZG4ndCBhdHRhY2ggU3RhdHVzQmFySWNvbjogIiArIGljKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIC8vIENvbnN0cnVjdCB0aGUgZXhwYW5kZWQgdmlldy4KKyAgICAgICAgTm90aWZpY2F0aW9uRGF0YS5FbnRyeSBlbnRyeSA9IG5ldyBOb3RpZmljYXRpb25EYXRhLkVudHJ5KGtleSwgbm90aWZpY2F0aW9uLCBpY29uVmlldyk7CisgICAgICAgIGlmICghaW5mbGF0ZVZpZXdzKGVudHJ5LCBtUGlsZSkpIHsKKyAgICAgICAgICAgIGhhbmRsZU5vdGlmaWNhdGlvbkVycm9yKGtleSwgbm90aWZpY2F0aW9uLCAiQ291bGRuJ3QgZXhwYW5kIFJlbW90ZVZpZXdzIGZvcjogIgorICAgICAgICAgICAgICAgICAgICArIG5vdGlmaWNhdGlvbik7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEFkZCB0aGUgaWNvbi4KKyAgICAgICAgbU5vdG5zLmFkZChlbnRyeSk7CisgICAgICAgIHJlZnJlc2hJY29ucygpOworCisgICAgICAgIHJldHVybiBpY29uVmlldzsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVmcmVzaEljb25zKCkgeworICAgICAgICAvLyBYWFg6IG5lZWQgdG8gaW1wbGVtZW50IGEgbmV3IGxpbWl0ZWQgbGluZWFyIGxheW91dCBjbGFzcworICAgICAgICAvLyB0byBhdm9pZCByZW1vdmluZyAmIHJlYWRkaW5nIGV2ZXJ5dGhpbmcKKworICAgICAgICBmaW5hbCBpbnQgSUNPTl9MSU1JVCA9IDQ7CisgICAgICAgIGZpbmFsIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMgcGFyYW1zCisgICAgICAgICAgICA9IG5ldyBMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zKG1JY29uU2l6ZSwgbUljb25TaXplKTsKKworICAgICAgICBpbnQgTiA9IG1Ob3Rucy5zaXplKCk7CisKKyAgICAgICAgaWYgKERFQlVHKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAicmVmcmVzaGluZyBpY29uczogIiArIE4gKyAiIG5vdGlmaWNhdGlvbnMsIG1JY29uTGF5b3V0PSIgKyBtSWNvbkxheW91dCk7CisgICAgICAgIH0KKworICAgICAgICBBcnJheUxpc3Q8Vmlldz4gdG9TaG93ID0gbmV3IEFycmF5TGlzdDxWaWV3PigpOworCisgICAgICAgIGZvciAoaW50IGk9MDsgaTxJQ09OX0xJTUlUOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChpPj1OKSBicmVhazsKKyAgICAgICAgICAgIHRvU2hvdy5hZGQobU5vdG5zLmdldChOLWktMSkuaWNvbik7CisgICAgICAgIH0KKworICAgICAgICBBcnJheUxpc3Q8Vmlldz4gdG9SZW1vdmUgPSBuZXcgQXJyYXlMaXN0PFZpZXc+KCk7CisgICAgICAgIGZvciAoaW50IGk9MDsgaTxtSWNvbkxheW91dC5nZXRDaGlsZENvdW50KCk7IGkrKykgeworICAgICAgICAgICAgVmlldyBjaGlsZCA9IG1JY29uTGF5b3V0LmdldENoaWxkQXQoaSk7CisgICAgICAgICAgICBpZiAoIXRvU2hvdy5jb250YWlucyhjaGlsZCkpIHsKKyAgICAgICAgICAgICAgICB0b1JlbW92ZS5hZGQoY2hpbGQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm9yIChWaWV3IHJlbW92ZSA6IHRvUmVtb3ZlKSB7CisgICAgICAgICAgICBtSWNvbkxheW91dC5yZW1vdmVWaWV3KHJlbW92ZSk7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGludCBpPTA7IGk8dG9TaG93LnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICBWaWV3IHYgPSB0b1Nob3cuZ2V0KGkpOworICAgICAgICAgICAgaWYgKHYuZ2V0UGFyZW50KCkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1JY29uTGF5b3V0LmFkZFZpZXcodG9TaG93LmdldChpKSwgaSwgcGFyYW1zKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGxvYWROb3RpZmljYXRpb25QYW5lbCgpOworICAgICAgICByZWZyZXNoTm90aWZpY2F0aW9uVHJpZ2dlcigpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBsb2FkTm90aWZpY2F0aW9uUGFuZWwoKSB7CisgICAgICAgIGludCBOID0gbU5vdG5zLnNpemUoKTsKKworICAgICAgICBBcnJheUxpc3Q8Vmlldz4gdG9TaG93ID0gbmV3IEFycmF5TGlzdDxWaWV3PigpOworCisgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgIFZpZXcgcm93ID0gbU5vdG5zLmdldChOLWktMSkucm93OworICAgICAgICAgICAgdG9TaG93LmFkZChyb3cpOworICAgICAgICB9CisKKyAgICAgICAgQXJyYXlMaXN0PFZpZXc+IHRvUmVtb3ZlID0gbmV3IEFycmF5TGlzdDxWaWV3PigpOworICAgICAgICBmb3IgKGludCBpPTA7IGk8bVBpbGUuZ2V0Q2hpbGRDb3VudCgpOyBpKyspIHsKKyAgICAgICAgICAgIFZpZXcgY2hpbGQgPSBtUGlsZS5nZXRDaGlsZEF0KGkpOworICAgICAgICAgICAgaWYgKCF0b1Nob3cuY29udGFpbnMoY2hpbGQpKSB7CisgICAgICAgICAgICAgICAgdG9SZW1vdmUuYWRkKGNoaWxkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGZvciAoVmlldyByZW1vdmUgOiB0b1JlbW92ZSkgeworICAgICAgICAgICAgbVBpbGUucmVtb3ZlVmlldyhyZW1vdmUpOworICAgICAgICB9CisKKyAgICAgICAgZm9yIChpbnQgaT0wOyBpPHRvU2hvdy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgVmlldyB2ID0gdG9TaG93LmdldChpKTsKKyAgICAgICAgICAgIGlmICh2LmdldFBhcmVudCgpID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtUGlsZS5hZGRWaWV3KHRvU2hvdy5nZXQoaSkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGluZmxhdGVWaWV3cyhOb3RpZmljYXRpb25EYXRhLkVudHJ5IGVudHJ5LCBWaWV3R3JvdXAgcGFyZW50KSB7CisgICAgICAgIFN0YXR1c0Jhck5vdGlmaWNhdGlvbiBzYm4gPSBlbnRyeS5ub3RpZmljYXRpb247CisgICAgICAgIFJlbW90ZVZpZXdzIHJlbW90ZVZpZXdzID0gc2JuLm5vdGlmaWNhdGlvbi5jb250ZW50VmlldzsKKyAgICAgICAgaWYgKHJlbW90ZVZpZXdzID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGNyZWF0ZSB0aGUgcm93IHZpZXcKKyAgICAgICAgTGF5b3V0SW5mbGF0ZXIgaW5mbGF0ZXIgPSAoTGF5b3V0SW5mbGF0ZXIpbUNvbnRleHQuZ2V0U3lzdGVtU2VydmljZSgKKyAgICAgICAgICAgICAgICBDb250ZXh0LkxBWU9VVF9JTkZMQVRFUl9TRVJWSUNFKTsKKyAgICAgICAgVmlldyByb3cgPSBpbmZsYXRlci5pbmZsYXRlKFIubGF5b3V0LnN0YXR1c19iYXJfbGF0ZXN0X2V2ZW50LCBwYXJlbnQsIGZhbHNlKTsKKyAgICAgICAgVmlldyB2ZXRvQnV0dG9uID0gcm93LmZpbmRWaWV3QnlJZChSLmlkLnZldG8pOworICAgICAgICBpZiAoZW50cnkubm90aWZpY2F0aW9uLmlzQ2xlYXJhYmxlKCkpIHsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyBfcGtnID0gc2JuLnBrZzsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyBfdGFnID0gc2JuLnRhZzsKKyAgICAgICAgICAgIGZpbmFsIGludCBfaWQgPSBzYm4uaWQ7CisgICAgICAgICAgICB2ZXRvQnV0dG9uLnNldE9uQ2xpY2tMaXN0ZW5lcihuZXcgVmlldy5PbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1CYXJTZXJ2aWNlLm9uTm90aWZpY2F0aW9uQ2xlYXIoX3BrZywgX3RhZywgX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN5c3RlbSBwcm9jZXNzIGlzIGRlYWQgaWYgd2UncmUgaGVyZS4KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAvLyAgICAgICAgICAgICAgICAgICAgYW5pbWF0ZUNvbGxhcHNlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHZldG9CdXR0b24uc2V0VmlzaWJpbGl0eShWaWV3LklOVklTSUJMRSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBiaW5kIHRoZSBjbGljayBldmVudCB0byB0aGUgY29udGVudCBhcmVhCisgICAgICAgIFZpZXdHcm91cCBjb250ZW50ID0gKFZpZXdHcm91cClyb3cuZmluZFZpZXdCeUlkKFIuaWQuY29udGVudCk7CisgICAgICAgIC8vIFhYWDogdXBkYXRlIHRvIGFsbG93IGNvbnRyb2xzIHdpdGhpbiBub3RpZmljYXRpb24gdmlld3MKKyAgICAgICAgY29udGVudC5zZXREZXNjZW5kYW50Rm9jdXNhYmlsaXR5KFZpZXdHcm91cC5GT0NVU19CTE9DS19ERVNDRU5EQU5UUyk7CisvLyAgICAgICAgY29udGVudC5zZXRPbkZvY3VzQ2hhbmdlTGlzdGVuZXIobUZvY3VzQ2hhbmdlTGlzdGVuZXIpOworICAgICAgICBQZW5kaW5nSW50ZW50IGNvbnRlbnRJbnRlbnQgPSBzYm4ubm90aWZpY2F0aW9uLmNvbnRlbnRJbnRlbnQ7CisgICAgICAgIGlmIChjb250ZW50SW50ZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGNvbnRlbnQuc2V0T25DbGlja0xpc3RlbmVyKG5ldyBOb3RpZmljYXRpb25DbGlja2VyKGNvbnRlbnRJbnRlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICBzYm4ucGtnLCBzYm4udGFnLCBzYm4uaWQpKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNvbnRlbnQuc2V0T25DbGlja0xpc3RlbmVyKG51bGwpOworICAgICAgICB9CisKKyAgICAgICAgVmlldyBleHBhbmRlZCA9IG51bGw7CisgICAgICAgIEV4Y2VwdGlvbiBleGNlcHRpb24gPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgZXhwYW5kZWQgPSByZW1vdGVWaWV3cy5hcHBseShtQ29udGV4dCwgY29udGVudCk7CisgICAgICAgIH0KKyAgICAgICAgY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgZXhjZXB0aW9uID0gZTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZXhwYW5kZWQgPT0gbnVsbCkgeworICAgICAgICAgICAgU3RyaW5nIGlkZW50ID0gc2JuLnBrZyArICIvMHgiICsgSW50ZWdlci50b0hleFN0cmluZyhzYm4uaWQpOworICAgICAgICAgICAgU2xvZy5lKFRBRywgImNvdWxkbid0IGluZmxhdGUgdmlldyBmb3Igbm90aWZpY2F0aW9uICIgKyBpZGVudCwgZXhjZXB0aW9uKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNvbnRlbnQuYWRkVmlldyhleHBhbmRlZCk7CisgICAgICAgICAgICByb3cuc2V0RHJhd2luZ0NhY2hlRW5hYmxlZCh0cnVlKTsKKyAgICAgICAgfQorCisgICAgICAgIGVudHJ5LnJvdyA9IHJvdzsKKyAgICAgICAgZW50cnkuY29udGVudCA9IGNvbnRlbnQ7CisgICAgICAgIGVudHJ5LmV4cGFuZGVkID0gZXhwYW5kZWQ7CisKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgcHVibGljIGNsYXNzIFNldExpZ2h0c09uTGlzdGVuZXIgaW1wbGVtZW50cyBWaWV3Lk9uTG9uZ0NsaWNrTGlzdGVuZXIsCisgICAgICAgICAgIFZpZXcuT25DbGlja0xpc3RlbmVyIHsKKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1PbjsKKworICAgICAgICBTZXRMaWdodHNPbkxpc3RlbmVyKGJvb2xlYW4gb24pIHsKKyAgICAgICAgICAgIG1PbiA9IG9uOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbUJhclNlcnZpY2Uuc2V0TGlnaHRzT24obU9uKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgIC8vIHN5c3RlbSBwcm9jZXNzCisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbkxvbmdDbGljayhWaWV3IHYpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbUJhclNlcnZpY2Uuc2V0TGlnaHRzT24obU9uKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgIC8vIHN5c3RlbSBwcm9jZXNzCisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgfQorCisgICAgcHVibGljIGNsYXNzIFRvdWNoT3V0c2lkZUxpc3RlbmVyIGltcGxlbWVudHMgVmlldy5PblRvdWNoTGlzdGVuZXIgeworICAgICAgICBwcml2YXRlIGludCBtTXNnOworICAgICAgICBwcml2YXRlIFN0YXR1c0JhclBhbmVsIG1QYW5lbDsKKworICAgICAgICBwdWJsaWMgVG91Y2hPdXRzaWRlTGlzdGVuZXIoaW50IG1zZywgU3RhdHVzQmFyUGFuZWwgcGFuZWwpIHsKKyAgICAgICAgICAgIG1Nc2cgPSBtc2c7CisgICAgICAgICAgICBtUGFuZWwgPSBwYW5lbDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2goVmlldyB2LCBNb3Rpb25FdmVudCBldikgeworICAgICAgICAgICAgZmluYWwgaW50IGFjdGlvbiA9IGV2LmdldEFjdGlvbigpOworICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fT1VUU0lERQorICAgICAgICAgICAgICAgICAgICB8fCAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhbVBhbmVsLmlzSW5Db250ZW50QXJlYSgoaW50KWV2LmdldFgoKSwgKGludClldi5nZXRZKCkpKSkgeworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKG1Nc2cpOworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2UobU1zZyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2V0Vmlld1Zpc2liaWxpdHkoVmlldyB2LCBpbnQgdmlzLCBpbnQgYW5pbSkgeworICAgICAgICBpZiAodi5nZXRWaXNpYmlsaXR5KCkgIT0gdmlzKSB7CisgICAgICAgICAgICAvL1Nsb2cuZChUQUcsICJzZXRWaWV3VmlzaWJpbGl0eSB2aXM9IiArICh2aXMgPT0gVmlldy5WSVNJQkxFKSArICIgdj0iICsgdik7CisgICAgICAgICAgICB2LnNldEFuaW1hdGlvbihBbmltYXRpb25VdGlscy5sb2FkQW5pbWF0aW9uKG1Db250ZXh0LCBhbmltKSk7CisgICAgICAgICAgICB2LnNldFZpc2liaWxpdHkodmlzKTsKKyAgICAgICAgfQorICAgIH0KKworCisgICAgcHVibGljIHZvaWQgZHVtcChGaWxlRGVzY3JpcHRvciBmZCwgUHJpbnRXcml0ZXIgcHcsIFN0cmluZ1tdIGFyZ3MpIHsKKyAgICAgICAgcHcucHJpbnQoIm1EaXNhYmxlZD0weCIpOworICAgICAgICBwdy5wcmludGxuKEludGVnZXIudG9IZXhTdHJpbmcobURpc2FibGVkKSk7CisgICAgfQorfQorCisKZGlmZiA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mIChldmVudEluc2lkZShtSWdub3JlQ2hpbGRyZW5baV0sIGV2KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHN1cGVyLm9uSW50ZXJjZXB0VG91Y2hFdmVudChldik7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGV2ZW50SW5zaWRlKFZpZXcgdiwgTW90aW9uRXZlbnQgZXYpIHsKKyAgICAgICAgLy8gYXNzdW1lIHRoYXQgeCBhbmQgeSBhcmUgd2luZG93IGNvb3JkcyBiZWNhdXNlIHdlIGFyZS4KKyAgICAgICAgZmluYWwgaW50IHggPSAoaW50KWV2LmdldFgoKTsKKyAgICAgICAgZmluYWwgaW50IHkgPSAoaW50KWV2LmdldFkoKTsKKworICAgICAgICBmaW5hbCBpbnRbXSBwID0gbVBvczsKKyAgICAgICAgdi5nZXRMb2NhdGlvbkluV2luZG93KHApOworCisgICAgICAgIGZpbmFsIGludCBsID0gcFswXTsKKyAgICAgICAgZmluYWwgaW50IHQgPSBwWzFdOworICAgICAgICBmaW5hbCBpbnQgciA9IHBbMF0gKyB2LmdldFdpZHRoKCk7CisgICAgICAgIGZpbmFsIGludCBiID0gcFsxXSArIHYuZ2V0SGVpZ2h0KCk7CisKKyAgICAgICAgcmV0dXJuIHggPj0gbCAmJiB4IDwgciAmJiB5ID49IHQgJiYgeSA8IGI7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0SGFuZGxlcihIYW5kbGVyIGgpIHsKKyAgICAgICAgbUhhbmRsZXIgPSBoOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldElnbm9yZUNoaWxkcmVuKGludCBpbmRleCwgVmlldyBpZ25vcmUsIFZpZXcgcGFuZWwpIHsKKyAgICAgICAgbUlnbm9yZUNoaWxkcmVuW2luZGV4XSA9IGl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ZvaWQgYWRkKFN0YXR1c0Jhck5vdGlmaWNhdGlvbiBub3RpZmljYXRpb24pIHsKKyAgICAgICAgaWYgKGZhbHNlKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAiYWRkIG1DdXJyZW50Tm90aWZpY2F0aW9uPSIgKyBtQ3VycmVudE5vdGlmaWNhdGlvbgorICAgICAgICAgICAgICAgICAgICArICIgbVF1ZXVlUG9zPSIgKyBtUXVldWVQb3MgKyAiIG1RdWV1ZT0iICsgQXJyYXlzLnRvU3RyaW5nKG1RdWV1ZSkpOworICAgICAgICB9CisgICAgICAgIG1RdWV1ZVttUXVldWVQb3NdID0gbm90aWZpY2F0aW9uOworCisgICAgICAgIC8vIElmIG5vdGhpbmcgaXMgcnVubmluZyBub3csIHN0YXJ0IHRoZSBuZXh0IG9uZQorICAgICAgICBpZiAobUN1cnJlbnROb3RpZmljYXRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgc2VuZEVtcHR5TWVzc2FnZShNU0dfQURWQU5DRSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAobVF1ZXVlUG9zIDwgbVF1ZXVlLmxlbmd0aCAtIDEpIHsKKyAgICAgICAgICAgIG1RdWV1ZVBvcysrOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaGFsdCgpIHsKKyAgICAgICAgcmVtb3ZlTWVzc2FnZXMoTVNHX0FEVkFOQ0UpOworICAgICAgICBpZiAobUN1cnJlbnRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbVF1ZXVlLmxlbmd0aDsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBtUXVldWVbaV0gPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVF1ZXVlUG9zID0gMDsKKyAgICAgICAgICAgIHNlbmRFbXB0eU1lc3NhZ2UoTVNHX0FEVkFOQ0UpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CisgICAgICAgICAgICBjYXNlIE1TR19BRFZBTkNFOgorICAgICAgICAgICAgICAgIGFkdmFuY2UoKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBhZHZhbmNlKCkgeworICAgICAgICAvLyBPdXQgd2l0aCB0aGUgb2xkLi4uCisgICAgICAgIGlmIChtQ3VycmVudFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgbVBhcmVudC5yZW1vdmVWaWV3KG1DdXJyZW50Vmlldyk7CisgICAgICAgICAgICBtQ3VycmVudFZpZXcgPSBudWxsOworICAgICAgICAgICAgbUN1cnJlbnROb3RpZmljYXRpb24gPSBudWxsOworICAgICAgICB9CisKKyAgICAgICAgLy8gSW4gd2l0aCB0aGUgbmV3Li4uCisgICAgICAgIGZpbmFsIFN0YXR1c0Jhck5vdGlmaWNhdGlvbiBuZXh0ID0gZGVxdWV1ZSgpOworICAgICAgICBpZiAobmV4dCAhPSBudWxsKSB7CisgICAgICAgICAgICBtQ3VycmVudE5vdGlmaWNhdGlvbiA9IG5leHQ7CisgICAgICAgICAgICBtQ3VycmVudFZpZXcgPSBtYWtlVGlja2VyVmlldyhuZXh0KTsKKyAgICAgICAgICAgIG1QYXJlbnQuYWRkVmlldyhtQ3VycmVudFZpZXcpOworICAgICAgICAgICAgc2VuZEVtcHR5TWVzc2FnZURlbGF5ZWQoTVNHX0FEVkFOQ0UsIEFEVkFOQ0VfREVMQVkpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBTdGF0dXNCYXJOb3RpZmljYXRpb24gZGVxdWV1ZSgpIHsKKyAgICAgICAgU3RhdHVzQmFyTm90aWZpY2F0aW9uIG5vdGlmaWNhdGlvbiA9IG1RdWV1ZVswXTsKKyAgICAgICAgaWYgKGZhbHNlKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAiZGVxdWV1ZSBtUXVldWVQb3M9IiArIG1RdWV1ZVBvcyArICIgbVF1ZXVlPSIgKyBBcnJheXMudG9TdHJpbmcobVF1ZXVlKSk7CisgICAgICAgIH0KKyAgICAgICAgZmluYWwgaW50IE4gPSBtUXVldWVQb3M7CisgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgIG1RdWV1ZVtpXSA9IG1RdWV1ZVtpKzFdOworICAgICAgICB9CisgICAgICAgIG1RdWV1ZVtOXSA9IG51bGw7CisgICAgICAgIGlmIChtUXVldWVQb3MgPiAwKSB7CisgICAgICAgICAgICBtUXVldWVQb3MtLTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbm90aWZpY2F0aW9uOworICAgIH0KKworICAgIHByaXZhdGUgVmlldyBtYWtlVGlja2VyVmlldyhTdGF0dXNCYXJOb3RpZmljYXRpb24gbm90aWZpY2F0aW9uKSB7CisgICAgICAgIGZpbmFsIE5vdGlmaWNhdGlvbiBuID0gbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbjsKKworICAgICAgICBMYXlvdXRJbmZsYXRlciBpbmZsYXRlciA9IChMYXlvdXRJbmZsYXRlciltQ29udGV4dC5nZXRTeXN0ZW1TZXJ2aWNlKAorICAgICAgICAgICAgICAgIENvbnRleHQuTEFZT1VUX0lORkxBVEVSX1NFUlZJQ0UpOworCisgICAgICAgIGludCBsYXlvdXRJZDsKKyAgICAgICAgVmlld0dyb3VwIGdyb3VwOworICAgICAgICBpZiAobi50aWNrZXJUaXRsZSAhPSBudWxsIHx8IG4udGlja2VyU3VidGl0bGUgIT0gbnVsbCkgeworICAgICAgICAgICAgZ3JvdXAgPSAoVmlld0dyb3VwKWluZmxhdGVyLmluZmxhdGUoUi5sYXlvdXQudGlja2VyLCBtUGFyZW50LCBmYWxzZSk7CisgICAgICAgICAgICBpZiAobi50aWNrZXJUaXRsZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZmluYWwgVGV4dFZpZXcgdGl0bGUgPSAoVGV4dFZpZXcpZ3JvdXAuZmluZFZpZXdCeUlkKFIuaWQudGl0bGUpOworICAgICAgICAgICAgICAgIHRpdGxlLnNldFRleHQobi50aWNrZXJUaXRsZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobi50aWNrZXJTdWJ0aXRsZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZmluYWwgVGV4dFZpZXcgc3VidGl0bGUgPSAoVGV4dFZpZXcpZ3JvdXAuZmluZFZpZXdCeUlkKFIuaWQuc3VidGl0bGUpOworICAgICAgICAgICAgICAgIHN1YnRpdGxlLnNldFRleHQobi50aWNrZXJTdWJ0aXRsZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBncm91cCA9IChWaWV3R3JvdXApaW5mbGF0ZXIuaW5mbGF0ZShSLmxheW91dC50aWNrZXJfY29tcGF0LCBtUGFyZW50LCBmYWxzZSk7CisgICAgICAgICAgICBUZXh0VmlldyB0diA9IChUZXh0Vmlldylncm91cC5maW5kVmlld0J5SWQoUi5pZC50ZXh0KTsKKyAgICAgICAgICAgIHR2LnNldFRleHQobi50aWNrZXJUZXh0KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIE5vIG1vcmUgdGhhbiAyIGljb25zLgorICAgICAgICBpZiAobi50aWNrZXJJY29ucyAhPSBudWxsKSB7CisgICAgICAgICAgICBpbnQgTiA9IG4udGlja2VySWNvbnMubGVuZ3RoOworICAgICAgICAgICAgaWYgKE4gPiAyKSB7CisgICAgICAgICAgICAgICAgTiA9IDI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmb3IgKGludCBpPU4tMTsgaT49IDA7IGktLSkgeworICAgICAgICAgICAgICAgIEJpdG1hcCBiID0gbi50aWNrZXJJY29uc1tpXTsKKyAgICAgICAgICAgICAgICBpZiAoYiAh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pb1RyYWNrKiAgICAgICAgICAgICAgIG1BdWRpb091dDsKICAgICAgICAgaW50OF90ICAgICAgICAgICAgICAgICAgICBtUGxheVN0YXRlOwpAQCAtMTY4LDcgKzE2OCw3IEBACiAKICAgICAgICAgU3ludGhQcm94eUpuaVN0b3JhZ2UoKSB7CiAgICAgICAgICAgICB0dHNfcmVmID0gTlVMTDsKLSAgICAgICAgICAgIG1OYXRpdmVTeW50aEludGVyZmFjZSA9IE5VTEw7CisgICAgICAgICAgICBtRW5naW5lID0gTlVMTDsKICAgICAgICAgICAgIG1FbmdpbmVMaWJIYW5kbGUgPSBOVUxMOwogICAgICAgICAgICAgbUF1ZGlvT3V0ID0gTlVMTDsKICAgICAgICAgICAgIG1QbGF5U3RhdGUgPSAgU1lOVEhQTEFZU1RBVEVfSVNfU1RPUFBFRDsKQEAgLTE4NCw5ICsxODQsOSBAQAogICAgICAgICB+U3ludGhQcm94eUpuaVN0b3JhZ2UoKSB7CiAgICAgICAgICAgICAvL0xPR1YoImVudGVyaW5nIH5TeW50aFByb3h5Sm5pU3RvcmFnZSgpIik7CiAgICAgICAgICAgICBraWxsQXVkaW8oKTsKLSAgICAgICAgICAgIGlmIChtTmF0aXZlU3ludGhJbnRlcmZhY2UpIHsKLSAgICAgICAgICAgICAgICBtTmF0aXZlU3ludGhJbnRlcmZhY2UtPnNodXRkb3duKCk7Ci0gICAgICAgICAgICAgICAgbU5hdGl2ZVN5bnRoSW50ZXJmYWNlID0gTlVMTDsKKyAgICAgICAgICAgIGlmIChtRW5naW5lKSB7CisgICAgICAgICAgICAgICAgbUVuZ2luZS0+ZnVuY3MtPnNodXRkb3duKG1FbmdpbmUpOworICAgICAgICAgICAgICAgIG1FbmdpbmUgPSBOVUxMOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKG1FbmdpbmVMaWJIYW5kbGUpIHsKICAgICAgICAgICAgICAgICAvL0xPR0UoIn5TeW50aFByb3h5Sm5pU3RvcmFnZSgpOiBiZWZvcmUg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Z0ZXIgPSBOVUxMOwogICAgICAgICAgICAgTE9HVigiTnVsbDogc3BlZWNoIGhhcyBjb21wbGV0ZWQiKTsKKyAgICAgICAgICAgIHJldHVybiBBTkRST0lEX1RUU19DQUxMQkFDS19IQUxUOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKGJ1ZmZlclNpemUgPiAwKSB7Ci0gICAgICAgICAgICBwcmVwQXVkaW9UcmFjayhwSm5pRGF0YSwgcEZvckFmdGVyLT5zdHJlYW1UeXBlLCByYXRlLCAoQXVkaW9TeXN0ZW06OmF1ZGlvX2Zvcm1hdClmb3JtYXQsIGNoYW5uZWwpOworICAgICAgICBpZiAoKnBCdWZmZXJTaXplID4gMCkgeworICAgICAgICAgICAgcHJlcEF1ZGlvVHJhY2socEpuaURhdGEsIHBGb3JBZnRlci0+c3RyZWFtVHlwZSwgcmF0ZSwgZW5jb2RpbmcsIGNoYW5uZWwpOwogICAgICAgICAgICAgaWYgKHBKbmlEYXRhLT5tQXVkaW9PdXQpIHsKICAgICAgICAgICAgICAgICBwSm5pRGF0YS0+bVBsYXlMb2NrLmxvY2soKTsKICAgICAgICAgICAgICAgICBpZihwSm5pRGF0YS0+bUF1ZGlvT3V0LT5zdG9wcGVkKCkKQEAgLTMwMywyOCArMzIwLDMxIEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHBKbmlEYXRhLT5tUGxheUxvY2sudW5sb2NrKCk7CiAgICAgICAgICAgICAgICAgaWYgKGJVc2VGaWx0ZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgYXBwbHlGaWx0ZXIoKGludDE2X3QqKXdhdiwgYnVmZmVyU2l6ZS8yKTsKKyAgICAgICAgICAgICAgICAgICAgYXBwbHlGaWx0ZXIoKGludDE2X3QqKSpwV2F2LCAqcEJ1ZmZlclNpemUvMik7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBKbmlEYXRhLT5tQXVkaW9PdXQtPndyaXRlKHdhdiwgYnVmZmVyU2l6ZSk7Ci0gICAgICAgICAgICAgICAgbWVtc2V0KHdhdiwgMCwgYnVmZmVyU2l6ZSk7CisgICAgICAgICAgICAgICAgcEpuaURhdGEtPm1BdWRpb091dC0+d3JpdGUoKnBXYXYsICpwQnVmZmVyU2l6ZSk7CisgICAgICAgICAgICAgICAgbWVtc2V0KCpwV2F2LCAwLCAqcEJ1ZmZlclNpemUpOwogICAgICAgICAgICAgICAgIC8vTE9HVigiQXVkaW9UcmFjayB3cm90ZTogJWQgYnl0ZXMiLCBidWZmZXJTaXplKTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgTE9HRSgiQ2FuJ3QgcGxheSwgbnVsbCBhdWRpb3RyYWNrIik7CisgICAgICAgICAgICAgICAgZGVsZXRlIHBGb3JBZnRlcjsKKyAgICAgICAgICAgICAgICBwRm9yQWZ0ZXIgPSBOVUxMOworICAgICAgICAgICAgICAgIHJldHVybiBBTkRST0lEX1RUU19DQUxMQkFDS19IQUxUOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfSBlbHNlICBpZiAocEZvckFmdGVyLT51c2FnZU1vZGUgPT0gVVNBR0VNT0RFX1dSSVRFX1RPX0ZJTEUpIHsKICAgICAgICAgLy9MT0dWKCJTYXZlIHRvIGZpbGUiKTsKLSAgICAgICAgaWYgKHdhdiA9PSBOVUxMKSB7CisgICAgICAgIGlmICgqcFdhdiA9PSBOVUxMKSB7CiAgICAgICAgICAgICBkZWxldGUgcEZvckFmdGVyOwogICAgICAgICAgICAgTE9HVigiTnVsbDogc3BlZWNoIGhhcyBjb21wbGV0ZWQiKTsKLSAgICAgICAgICAgIHJldHVybiBUVFNfQ0FMTEJBQ0tfSEFMVDsKKyAgICAgICAgICAgIHJldHVybiBBTkRST0lEX1RUU19DQUxMQkFDS19IQUxUOwogICAgICAgICB9Ci0gICAgICAgIGlmIChidWZmZXJTaXplID4gMCl7CisgICAgICAgIGlmICgqcEJ1ZmZlclNpemUgPiAwK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GVyR2FpbiwgamZsb2F0IGF0dGVudWF0aW9uSW5EYiwgamZsb2F0IGZyZXFJbkh6LCBqZmxvYXQgc2xvcGUpCiB7Ci0gICAgaW50IHJlc3VsdCA9IFRUU19TVUNDRVNTOworICAgIGludCByZXN1bHQgPSBBTkRST0lEX1RUU19TVUNDRVNTOwogCiAgICAgYlVzZUZpbHRlciA9IGFwcGx5RmlsdGVyOwogICAgIGlmIChhcHBseUZpbHRlcikgewpAQCAtMzczLDcgKzM5Myw3IEBACiAgICAgICAgICAgICBpbml0aWFsaXplRVEoKTsKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIExPR0UoIkludmFsaWQgc2xvcGUsIGNhbid0IGJlIG51bGwiKTsKLSAgICAgICAgICAgIHJlc3VsdCA9IFRUU19GQUlMVVJFOworICAgICAgICAgICAgcmVzdWx0ID0gQU5EUk9JRF9UVFNfRkFJTFVSRTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMzg1LDcgKzQwNSw3IEBACiBhbmRyb2lkX3R0c19TeW50aFByb3h5X25hdGl2ZV9zZXR1cChKTklFbnYgKmVudiwgam9iamVjdCB0aGl6LAogICAgICAgICBqb2JqZWN0IHdlYWtfdGhpcywganN0cmluZyBuYXRpdmVTb0xpYiwganN0cmluZyBlbmdDb25maWcpCiB7Ci0gICAgaW50IHJlc3VsdCA9IFRUU19GQUlMVVJFOworICAgIGludCByZXN1bHQgPSBBTkRST0lEX1RUU19GQUlMVVJFOwogCiAgICAgYlVzZUZpbHRlciA9IGZhbHNlOwogCkBAIC00MDIsMTggKzQyMiwyOCBAQAogICAgIGlmIChlbmdpbmVfbGliX2hhbmRsZSA9PSBOVUxMKSB7CiAgICAgICAgTE9HRSgiYW5kcm9pZF90dHNfU3ludGhQcm94eV9uYXRpdmVfc2V0dXAoKTogZW5naW5lX2xpYl9oYW5kbGUgPT0gTlVMTCIpOwogICAgIH0gZWxzZSB7Ci0gICAgICAgIFR0c0VuZ2luZSAqKCpnZXRfVHRzRW5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wvcG9saWN5L2ltcGwvS2V5Z3VhcmRWaWV3QmFzZS5qYXZhCisrKyBiL3BvbGljeS9zcmMvY29tL2FuZHJvaWQvaW50ZXJuYWwvcG9saWN5L2ltcGwvS2V5Z3VhcmRWaWV3QmFzZS5qYXZhCkBAIC0xNDIsOCArMTQyLDEwIEBACiAgICAgICAgIGZpbmFsIGludCBrZXlDb2RlID0gZXZlbnQuZ2V0S2V5Q29kZSgpOwogICAgICAgICBpZiAoZXZlbnQuZ2V0QWN0aW9uKCkgPT0gS2V5RXZlbnQuQUNUSU9OX0RPV04pIHsKICAgICAgICAgICAgIHN3aXRjaCAoa2V5Q29kZSkgeworICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QTEFZOgorICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QQVVTRToKICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUExBWV9QQVVTRToKLSAgICAgICAgICAgICAgICAgICAgLyogU3VwcHJlc3MgUExBWVBBVVNFIHRvZ2dsZSB3aGVuIHBob25lIGlzIHJpbmdpbmcgb3IKKyAgICAgICAgICAgICAgICAgICAgLyogU3VwcHJlc3MgUExBWS9QQVVTRSB0b2dnbGUgd2hlbiBwaG9uZSBpcyByaW5naW5nIG9yCiAgICAgICAgICAgICAgICAgICAgICAqIGluLWNhbGwgdG8gYXZvaWQgbXVzaWMgcGxheWJhY2sgKi8KICAgICAgICAgICAgICAgICAgICAgaWYgKG1UZWxlcGhvbnlNYW5hZ2VyID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1UZWxlcGhvbnlNYW5hZ2VyID0gKFRlbGVwaG9ueU1hbmFnZXIpIGdldENvbnRleHQoKS5nZXRTeXN0ZW1TZXJ2aWNlKApAQCAtMTUzLDExICsxNTUsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGVsZXBob255TWFuYWdlci5nZXRDYWxsU3RhdGUoKSAhPSBUZWxlcGhvbnlNYW5hZ2VyLkNBTExfU1RBVEVfSURMRSkgewogICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7ICAvLyBzdXBwcmVzcyBrZXkgZXZlbnQKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9IRUFEU0VUSE9PSzogCi0gICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1NUT1A6IAotICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9ORVhUOiAKLSAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUFJFVklPVVM6IAotICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9SRVdJTkQ6IAorICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NVVRFOgorICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9IRUFEU0VUSE9PSzoKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfU1RPUDoKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfTkVYVDoKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUFJFVklPVVM6CisgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1JFV0lORDoKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUkVDT1JEOgogICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9GQVNUX0ZPUldBUkQ6IHsKICAgICAgICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9NRURJQV9CVVRUT04sIG51bGwpOwogICAgICAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoSW50ZW50LkVYVFJBX0tFWV9FVkVOVCwgZXZlbnQpOwpAQCAtMTY2LDcgKzE3MCw4IEBACiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9VUDoKLSAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfVk9MVU1FX0RPV046IHsKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfVk9MVU1FX0RPV046CisgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9NVVRFOiB7CiAgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1BdWRpb01hbmFnZXIgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdWRpb01hbmFnZXIgPSAoQXVkaW9NYW5hZ2VyKSBnZXRDb250ZXh0KCkuZ2V0U3lzdGVtU2VydmljZSgKQEAgLTE3NSw2ICsxODAsNyBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIC8vIFZvbHVtZSBidXR0b25zIHNob3VsZCBvbmx5IGZ1bmN0aW9uIGZvciBtdXNpYy4KICAgICAgICAgICAgICAgICAgICAgaWYgKG1BdWRpb01hbmFnZXIuaXNNdXNpY0FjdGl2ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBBY3R1YWxseSBoYW5kbGUgTVVURS4KICAgICAgICAgICAgICAgICAgICAgICAgIG1BdWRpb01hbmFnZXIuYWRqdXN0U3RyZWFtVm9sdW1lKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9NYW5hZ2VyLlNUUkVBTV9NVVNJQywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfVVAKQEAgLTE4OSwxMiArMTk1LDE1IEBACiAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuZ2V0QWN0aW9uKCkgPT0gS2V5RXZlbnQuQUNUSU9OX1VQKSB7CiAgICAgICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTVVURToKLSAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfSEVBRFNFVEhPT0s6IAotICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QTEFZX1BBVVNFOiAKLSAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfU1RPUDogCi0gICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX05FWFQ6IAotICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QUkVWSU9VUzogCi0gICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1JFV0lORDogCisgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0hFQURTRVRIT09LOgorICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QTEFZOgorICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QQVVTRToKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUExBWV9QQVVTRToKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfU1RPUDoKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfTkVYVDoKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUFJFVklPVVM6CisgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1JFV0lORDoKKyAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUkVDT1JEOgogICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9GQVNUX0ZPUldBUkQ6IHsKICAgICAgICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9NRURJQV9CVVRUT04sIG51bGwpOwogICAgICAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoSW50ZW50LkVYVFJBX0tFWV9FVkVOVCwgZXZlbnQpOwpkaWZmIC0tZ2l0IGEvcG9saWN5L3NyYy9jb20vYW5kcm9pZC9pbnRlcm5hbC9wb2xpY3kvaW1wbC9LZXlndWFyZFZpZXdNYW5hZ2VyLmphdmEgYi9wb2xpY3kvc3JjL2NvbS9hbmRyb2lkL2ludGVybmFsL3BvbGljeS9pbXBsL0tleWd1YXJkVmlld01hbmFnZXIuamF2YQppbmRleCBiYTFkN2Y1Li43MGE0YjIwIDEwMDY0NAotLS0gYS9wb2xpY3kvc3JjL2NvbS9hbmRyb2lkL2ludGVybmFsL3BvbGljeS9pbXBsL0tleWd1YXJkVmlld01hbmFnZXIuamF2YQorKysgYi9wb2xpY3kvc3JjL2NvbS9hbmRyb2lkL2ludGVybmFsL3BvbGljeS9pbXBsL0tleWd1YXJkVmlld01hbmFnZXIuamF2YQpAQCAtMTEzLDcgKzExMywxNSBAQAogICAgICAgICAgICAgICAgICAgICBmbGFncywgUGl4ZWxGb3JtYXQuVFJBTlNMVUNFTlQpOwogICAgICAgICAgICAgbHAuc29mdElucHV0TW9kZSA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V0CiAgICAgICAgICAgICAgICAgLy8gaGF2aW5nIHRvIHVubG9jayB0aGUgc2NyZWVuKQotICAgICAgICAgICAgICAgIGxvbmcgd2hlbiA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpICsgS0VZR1VBUkRfREVMQVlfTVM7Ci0gICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoREVMQVlFRF9LRVlHVUFSRF9BQ1RJT04pOwotICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgic2VxIiwgbURlbGF5ZWRTaG93aW5nU2VxdWVuY2UpOwotICAgICAgICAgICAgICAgIFBlbmRpbmdJbnRlbnQgc2VuZGVyID0gUGVuZGluZ0ludGVudC5nZXRCcm9hZGNhc3QobUNvbnRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAwLCBpbnRlbnQsIFBlbmRpbmdJbnRlbnQuRkxBR19DQU5DRUxfQ1VSUkVOVCk7Ci0gICAgICAgICAgICAgICAgbUFsYXJtTWFuYWdlci5zZXQoQWxhcm1NYW5hZ2VyLkVMQVBTRURfUkVBTFRJTUVfV0FLRVVQLCB3aGVuLAotICAgICAgICAgICAgICAgICAgICAgICAgc2VuZGVyKTsKLSAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgInNldHRpbmcgYWxhcm0gdG8gdHVybiBvZmYga2V5Z3VhcmQsIHNlcSA9ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbURlbGF5ZWRTaG93aW5nU2VxdWVuY2UpOworICAgICAgICAgICAgICAgIGZpbmFsIENvbnRlbnRSZXNvbHZlciBjciA9IG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpOworCisgICAgICAgICAgICAgICAgLy8gRnJvbSBEaXNwbGF5U2V0dGluZ3MKKyAgICAgICAgICAgICAgICBsb25nIGRpc3BsYXlUaW1lb3V0ID0gU2V0dGluZ3MuU3lzdGVtLmdldEludChjciwgU0NSRUVOX09GRl9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICAgICAgS0VZR1VBUkRfRElTUExBWV9USU1FT1VUX0RFTEFZX0RFRkFVTFQpOworCisgICAgICAgICAgICAgICAgLy8gRnJvbSBTZWN1cml0eVNldHRpbmdzCisgICAgICAgICAgICAgICAgZmluYWwgbG9uZyBsb2NrQWZ0ZXJUaW1lb3V0ID0gU2V0dGluZ3MuU2VjdXJlLmdldEludChjciwKKyAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5MT0NLX1NDUkVFTl9MT0NLX0FGVEVSX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICBLRVlHVUFSRF9MT0NLX0FGVEVSX0RFTEFZX0RFRkFVTFQpOworCisgICAgICAgICAgICAgICAgLy8gRnJvbSBEZXZpY2VQb2xpY3lBZG1pbgorICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgcG9saWN5VGltZW91dCA9IG1Mb2NrUGF0dGVyblV0aWxzLmdldERldmljZVBvbGljeU1hbmFnZXIoKQorICAgICAgICAgICAgICAgICAgICAgICAgLmdldE1heGltdW1UaW1lVG9Mb2NrKG51bGwpOworCisgICAgICAgICAgICAgICAgbG9uZyB0aW1lb3V0OworICAgICAgICAgICAgICAgIGlmIChwb2xpY3lUaW1lb3V0ID4gMCkgeworICAgICAgICAgICAgICAgICAgICAvLyBwb2xpY3kgaW4gZWZmZWN0LiBNYWtlIHN1cmUgd2UgZG9uJ3QgZ28gYmV5b25kIHBvbGljeSBsaW1pdC4KKyAgICAgICAgICAgICAgICAgICAgZGlzcGxheVRpbWVvdXQgPSBNYXRoLm1heChkaXNwbGF5VGltZW91dCwgMCk7IC8vIGlnbm9yZSBuZWdhdGl2ZSB2YWx1ZXMKKyAgICAgICAgICAgICAgICAgICAgdGltZW91dCA9IE1hdGgubWluKHBvbGljeVRpbWVvdXQgLSBkaXNwbGF5VGltZW91dCwgbG9ja0FmdGVyVGltZW91dCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdGltZW91dCA9IGxvY2tBZnRlclRpbWVvdXQ7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHRpbWVvdXQgPD0gMCkgeworICAgICAgICAgICAgICAgICAgICAvLyBMb2NrIG5vdworICAgICAgICAgICAgICAgICAgICBtU3VwcHJlc3NOZXh0TG9ja1NvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgZG9LZXlndWFyZCgpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIExvY2sgaW4gdGhlIGZ1dHVyZQorICAgICAgICAgICAgICAgICAgICBsb25nIHdoZW4gPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKSArIHRpbWVvdXQ7CisgICAgICAgICAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KERFTEFZRURfS0VZR1VBUkRfQUNUSU9OKTsKKyAgICAgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJzZXEiLCBtRGVsYXllZFNob3dpbmdTZXF1ZW5jZSk7CisgICAgICAgICAgICAgICAgICAgIFBlbmRpbmdJbnRlbnQgc2VuZGVyID0gUGVuZGluZ0ludGVudC5nZXRCcm9hZGNhc3QobUNvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgaW50ZW50LCBQZW5kaW5nSW50ZW50LkZMQUdfQ0FOQ0VMX0NVUlJFTlQpOworICAgICAgICAgICAgICAgICAgICBtQWxhcm1NYW5hZ2VyLnNldChBbGFybU1hbmFnZXIuRUxBUFNFRF9SRUFMVElNRV9XQUtFVVAsIHdoZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJzZXR0aW5nIGFsYXJtIHRvIHR1cm4gb2ZmIGtleWd1YXJkLCBzZXEgPSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtRGVsYXllZFNob3dpbmdTZXF1ZW5jZSk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIGlmICh3aHkgPT0gV2luZG93TWFuYWdlclBvbGljeS5PRkZfQkVDQVVTRV9PRl9QUk9YX1NFTlNPUikgewogICAgICAgICAgICAgICAgIC8vIERvIG5vdCBlbmFibGUgdGhlIGtleWd1YXJkIGlmIHRoZSBwcm94IHNlbnNvciBmb3JjZWQgdGhlIHNjcmVlbiBvZmYuCiAgICAgICAgICAgICB9IGVsc2UgewpAQCAtNzQ5LDEzICs3ODYsMTcgQEAKICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7CiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfVk9MVU1FX1VQOgogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9ET1dOOgorICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9NVVRFOgogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01VVEU6CiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfSEVBRFNFVEhPT0s6CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUExBWToKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QQVVTRToKICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QTEFZX1BBVVNFOgogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1NUT1A6CiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfTkVYVDoKICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJ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3dvcmRRdWFsaXR5KCkKICAgICAgICAgICAgICAgICAgICAgPT0gRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX1NPTUVUSElORzsKLSAgICAgICAgICAgIGlmIChpc1NlY3VyZSgpICYmIHVzaW5nTG9ja1BhdHRlcm4pIHsKKworICAgICAgICAgICAgYm9vbGVhbiBzaG93U2xpZGluZ1RhYiA9IGdldFJlc291cmNlcygpLmdldEJvb2xlYW4oUi5ib29sLmNvbmZpZ19lbmFibGVTbGlkaW5nVGFiRmlyc3QpOworICAgICAgICAgICAgaWYgKGlzU2VjdXJlKCkgJiYgKHVzaW5nTG9ja1BhdHRlcm4gfHwgIXNob3dTbGlkaW5nVGFiKSkgewogICAgICAgICAgICAgICAgIHJldHVybiBNb2RlLlVubG9ja1NjcmVlbjsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIE1vZGUuTG9ja1NjcmVlbjsKQEAgLTY2Nyw2ICs2NjksNyBAQAogICAgICAgICAgICAgICAgIGNhc2UgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX05VTUVSSUM6CiAgICAgICAgICAgICAgICAgY2FzZSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQUxQSEFCRVRJQzoKICAgICAgICAgICAgICAgICBjYXNlIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9BTFBIQU5VTUVSSUM6CisgICAgICAgICAgICAgICAgY2FzZSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQ09NUExFWDoKICAgICAgICAgICAgICAgICAgICAgY3VycmVudE1vZGUgPSBVbmxvY2tNb2RlLlBhc3N3b3JkOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUV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ck1vZGUoKSA9PSBBdWRpb01hbmFnZXIuUklOR0VSX01PREVfVklCUkFURSk7CisKKyAgICAgICAgICAgIG1TbGlkaW5nVGFiLnNldFJpZ2h0VGFiUmVzb3VyY2VzKAorICAgICAgICAgICAgICAgICAgICBtU2lsZW50TW9kZSA/ICggdmliZSA/IFIuZHJhd2FibGUuaWNfam9nX2RpYWxfdmlicmF0ZV9vbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFIuZHJhd2FibGUuaWNfam9nX2RpYWxfc291bmRfb2ZmICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBSLmRyYXdhYmxlLmljX2pvZ19kaWFsX3NvdW5kX29uLAorICAgICAgICAgICAgICAgICAgICBtU2lsZW50TW9kZSA/IFIuZHJhd2FibGUuam9nX3RhYl90YXJnZXRfeWVsbG93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5qb2dfdGFiX3RhcmdldF9ncmF5LAorICAgICAgICAgICAgICAgICAgICBtU2lsZW50TW9kZSA/IFIuZHJhd2FibGUuam9nX3RhYl9iYXJfcmlnaHRfc291bmRfb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBSLmRyYXdhYmxlLmpvZ190YWJfYmFyX3JpZ2h0X3NvdW5kX29mZiwKKyAgICAgICAgICAgICAgICAgICAgbVNpbGVudE1vZGUgPyBSLmRyYXdhYmxlLmpvZ190YWJfcmlnaHRfc291bmRfb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBSLmRyYXdhYmxlLmpvZ190YWJfcmlnaHRfc291bmRfb2ZmKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKiB7QGluaGVyaXREb2N9ICovCisgICAgICAgIHB1YmxpYyB2b2lkIG9uVHJpZ2dlcihWaWV3IHYsIGludCB3aGljaEhhbmRsZSkgeworICAgICAgICAgICAgaWYgKHdoaWNoSGFuZGxlID09IFNsaWRpbmdUYWIuT25UcmlnZ2VyTGlzdGVuZXIuTEVGVF9IQU5ETEUpIHsKKyAgICAgICAgICAgICAgICBtQ2FsbGJhY2suZ29Ub1VubG9ja1NjcmVlbigpOworICAgICAgICAgICAgfSBlbHNlIGlmICh3aGljaEhhbmRsZSA9PSBTbGlkaW5nVGFiLk9uVHJpZ2dlckxpc3RlbmVyLlJJR0hUX0hBTkRMRSkgeworICAgICAgICAgICAgICAgIC8vIHRvZ2dsZSBzaWxlbnQgbW9kZQorICAgICAgICAgICAgICAgIG1TaWxlbnRNb2RlID0gIW1TaWxlbnRNb2RlOworICAgICAgICAgICAgICAgIGlmIChtU2lsZW50TW9kZSkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHZpYmUgPSAoU2V0dGluZ3MuU3lzdGVtLmdldEludCgKKyAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRleHQoKS5nZXRDb250ZW50UmVzb2x2ZXIoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlN5c3RlbS5WSUJSQVRFX0lOX1NJTEVOVCwgMSkgPT0gMSk7CisKKyAgICAgICAgICAgICAgICAgICAgbUF1ZGlvTWFuYWdlci5zZXRSaW5nZXJNb2RlKHZpYmUKKyAgICAgICAgICAgICAgICAgICAgICAgID8gQXVkaW9NYW5hZ2VyLlJJTkdFUl9NT0RFX1ZJQlJBVEUKKyAgICAgICAgICAgICAgICAgICAgICAgIDogQXVkaW9NYW5hZ2VyLlJJTkdFUl9NT0RFX1NJTEVOVCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbUF1ZGlvTWFuYWdlci5zZXRSaW5nZXJNb2RlKEF1ZGlvTWFuYWdlci5SSU5HRVJfTU9ERV9OT1JNQUwpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHVwZGF0ZVJpZ2h0VGFiUmVzb3VyY2VzKCk7CisKKyAgICAgICAgICAgICAgICBTdHJpbmcgbWVzc2FnZSA9IG1TaWxlbnRNb2RlID8KKyAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRleHQoKS5nZXRTdHJpbmcoUi5zdHJpbmcuZ2xvYmFsX2FjdGlvbl9zaWxlbnRfbW9kZV9vbl9zdGF0dXMpIDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRleHQoKS5nZXRTdHJpbmcoUi5zdHJpbmcuZ2xvYmFsX2FjdGlvbl9zaWxlbnRfbW9kZV9vZmZfc3RhdHVzKTsKKworICAgICAgICAgICAgICAgIGZpbmFsIGludCB0b2FzdEljb24gPSBtU2lsZW50TW9kZQorICAgICAgICAgICAgICAgICAgICA/IFIuZHJhd2FibGUuaWNfbG9ja19yaW5nZXJfb2ZmCisgICAgICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5pY19sb2NrX3Jpbmdlcl9vbjsKKworICAgICAgICAgICAgICAgIGZpbmFsIGludCB0b2FzdENvbG9yID0gbVNpbGVudE1vZGUKKyAgICAgICAgICAgICAgICAgICAgPyBnZXRDb250ZXh0KCkuZ2V0UmVzb3VyY2VzKCkuZ2V0Q29sb3IoUi5jb2xvci5rZXlndWFyZF90ZXh0X2NvbG9yX3NvdW5kb2ZmKQorICAgICAgICAgICAgICAgICAgICA6IGdldENvbnRleHQoKS5nZXRSZXNvdXJjZXMoKS5nZXRDb2xvcihSLmNvbG9yLmtleWd1YXJkX3RleHRfY29sb3Jfc291bmRvbik7CisgICAgICAgICAgICAgICAgdG9hc3RNZXNzYWdlKG1TY3JlZW5Mb2NrZWQsIG1lc3NhZ2UsIHRvYXN0Q29sb3IsIHRvYXN0SWNvbik7CisgICAgICAgICAgICAgICAgbUNhbGxiYWNrLnBva2VXYWtlbG9jaygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoqIHtAaW5oZXJpdERvY30gKi8KKyAgICAgICAgcHVibGljIHZvaWQgb25HcmFiYmVkU3RhdGVDaGFuZ2UoVm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vb2xlYW4gdmliZSA9IG1TaWxlbnRNb2RlCi0gICAgICAgICAgICAmJiAobUF1ZGlvTWFuYWdlci5nZXRSaW5nZXJNb2RlKCkgPT0gQXVkaW9NYW5hZ2VyLlJJTkdFUl9NT0RFX1ZJQlJBVEUpOwotCi0gICAgICAgIG1TZWxlY3Rvci5zZXRSaWdodFRhYlJlc291cmNlcygKLSAgICAgICAgICAgICAgICBtU2lsZW50TW9kZSA/ICggdmliZSA/IFIuZHJhd2FibGUuaWNfam9nX2RpYWxfdmlicmF0ZV9vbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5pY19qb2dfZGlhbF9zb3VuZF9vZmYgKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5pY19qb2dfZGlhbF9zb3VuZF9vbiwKLSAgICAgICAgICAgICAgICBtU2lsZW50TW9kZSA/IFIuZHJhd2FibGUuam9nX3RhYl90YXJnZXRfeWVsbG93Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBSLmRyYXdhYmxlLmpvZ190YWJfdGFyZ2V0X2dyYXksCi0gICAgICAgICAgICAgICAgbVNpbGVudE1vZGUgPyBSLmRyYXdhYmxlLmpvZ190YWJfYmFyX3JpZ2h0X3NvdW5kX29uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBSLmRyYXdhYmxlLmpvZ190YWJfYmFyX3JpZ2h0X3NvdW5kX29mZiwKLSAgICAgICAgICAgICAgICBtU2lsZW50TW9kZSA/IFIuZHJhd2FibGUuam9nX3RhYl9yaWdodF9zb3VuZF9vbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUi5kcmF3YWJsZS5qb2dfdGFiX3JpZ2h0X3NvdW5kX29mZik7Ci0gICAgfQotCiAgICAgcHJpdmF0ZSB2b2lkIHJlc2V0U3RhdHVzSW5mbyhLZXlndWFyZFVwZGF0ZU1vbml0b3IgdXBkYXRlTW9uaXRvcikgewogIC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dFUl9NT0RFX1ZJQlJBVEUKLSAgICAgICAgICAgICAgICAgICAgOiBBdWRpb01hbmFnZXIuUklOR0VSX01PREVfU0lMRU5UKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbUF1ZGlvTWFuYWdlci5zZXRSaW5nZXJNb2RlKEF1ZGlvTWFuYWdlci5SSU5HRVJfTU9ERV9OT1JNQUwpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1cGRhdGVSaWdodFRhYlJlc291cmNlcygpOwotCi0gICAgICAgICAgICBTdHJpbmcgbWVzc2FnZSA9IG1TaWxlbnRNb2RlID8KLSAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldFN0cmluZyhSLnN0cmluZy5nbG9iYWxfYWN0aW9uX3NpbGVudF9tb2RlX29uX3N0YXR1cykgOgotICAgICAgICAgICAgICAgICAgICBnZXRDb250ZXh0KCkuZ2V0U3RyaW5nKFIuc3RyaW5nLmdsb2JhbF9hY3Rpb25fc2lsZW50X21vZGVfb2ZmX3N0YXR1cyk7Ci0KLSAgICAgICAgICAgIGZpbmFsIGludCB0b2FzdEljb24gPSBtU2lsZW50TW9kZQotICAgICAgICAgICAgICAgID8gUi5kcmF3YWJsZS5pY19sb2NrX3Jpbmdlcl9vZmYKLSAgICAgICAgICAgICAgICA6IFIuZHJhd2FibGUuaWNfbG9ja19yaW5nZXJfb247Ci0KLSAgICAgICAgICAgIGZpbmFsIGludCB0b2FzdENvbG9yID0gbVNpbGVudE1vZGUKLSAgICAgICAgICAgICAgICA/IGdldENvbnRleHQoKS5nZXRSZXNvdXJjZXMoKS5nZXRDb2xvcihSLmNvbG9yLmtleWd1YXJkX3RleHRfY29sb3Jfc291bmRvZmYpCi0gICAgICAgICAgICAgICAgOiBnZXRDb250ZXh0KCkuZ2V0UmVzb3VyY2VzKCkuZ2V0Q29sb3IoUi5jb2xvci5rZXlndWFyZF90ZXh0X2NvbG9yX3NvdW5kb24pOwotICA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k7CisgICAgICAgIG1TdGF0dXNWaWV3LnJlZnJlc2hUaW1lQW5kRGF0ZURpc3BsYXkoKTsKICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgdXBkYXRlU3RhdHVzTGluZXMoKSB7Ci0gICAgICAgIGlmICghbVN0YXR1cy5zaG93U3RhdHVzTGluZXMoKQotICAgICAgICAgICAgICAgIHx8IChtQ2hhcmdpbmcgPT0gbnVsbCAmJiBtTmV4dEFsYXJtID09IG51bGwpKSB7Ci0gICAgICAgICAgICBtU3RhdHVzMS5zZXRWaXNpYmlsaXR5KFZpZXcuSU5WSVNJQkxFKTsKLSAgICAgICAgICAgIG1TdGF0dXMyLnNldFZpc2liaWxpdHkoVmlldy5JTlZJU0lCTEUpOwotICAgICAgICB9IGVsc2UgaWYgKG1DaGFyZ2luZyAhPSBudWxsICYmIG1OZXh0QWxhcm0gPT0gbnVsbCkgewotICAgICAgICAgICAgLy8gY2hhcmdpbmcgb25seQotICAgICAgICAgICAgbVN0YXR1czEuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwotICAgICAgICAgICAgbVN0YXR1czIuc2V0VmlzaWJpbGl0eShWaWV3LklOVklTSUJMRSk7Ci0KLSAgICAgICAgICAgIG1TdGF0dXMxLnNldFRleHQobUNoYXJnaW5nKTsKLSAgICAgICAgICAgIG1TdGF0dXMxLnNldENvbXBvdW5kRHJhd2FibGVzV2l0aEludHJpbnNpY0JvdW5kcyhtQ2hhcmdpbmdJY29uLCBudWxsLCBudWxsLCBudWxsKTsKLSAgICAgICAgfSBlbHNlIGlmIChtTmV4dEFsYXJtICE9IG51bGwgJiYgbUNoYXJnaW5nID09IG51bGwpIHsKLSAgICAgICAgICAgIC8vIG5leHQgYWxhcm0gb25seQotICAgICAgICAgICAgbVN0YXR1czEuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwotICAgICAgICAgICAgbVN0YXR1czIuc2V0VmlzaWJpbGl0eShWaWV3LklOVklTSUJMRSk7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5sb2NraW5nIG9mIHRoaXMgc2NyZWVuLiBUeXBpY2FsbHkganVzdCBzaG93cyB0aGUgdW5sb2NrIHdpZGdldC4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgZW5hYmxlVW5sb2NrKCkgeworICAgICAgICBpZiAobUVuZXJneVdhdmUgIT0gbnVsbCkgbUVuZXJneVdhdmUuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICBpZiAobVNsaWRpbmdUYWIgIT0gbnVsbCkgbVNsaWRpbmdUYWIuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIERpc2FibGUgdW5sb2NraW5nIG9mIHRoaXMgc2NyZWVuLiBUeXBpY2FsbHkganVzdCBoaWRlcyB0aGUgdW5sb2NrIHdpZGdldC4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgZGlzYWJsZVVubG9jaygpIHsKKyAgICAgICAgaWYgKG1FbmVyZ3lXYXZlICE9IG51bGwpIG1FbmVyZ3lXYXZlLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgaWYgKG1TbGlkaW5nVGFiICE9IG51bGwpIG1TbGlkaW5nVGFiLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICB9CisKKyAgICAvKioKICAgICAgKiBVcGRhdGUgdGhlIGxheW91dCB0byBtYXRjaCB0aGUgY3VycmVudCBzdGF0dXMuCiAgICAgICovCiAgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZUxheW91dChTdGF0dXMgc3RhdHVzKSB7CkBAIC01MDksNyArNTM1LDcgQEAKICAgICAgICAgc3dpdGNoIChzdGF0dXMpIHsKICAgICAgICAgICAgIGNhc2UgTm9ybWFsOgogICAgICAgICAgICAgICAgIC8vIHRleHQKLSAgICAgICAgICAgICAgICBtQ2Fycmllci5zZXRUZXh0KAorICAgICAgICAgICAgICAgIG1TdGF0dXNWaWV3LnNldENhcnJpZXJUZXh0KAogICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q2FycmllclN0cmluZygKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVVwZGF0ZU1vbml0b3IuZ2V0VGVsZXBob255UGxtbigpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVXBkYXRlTW9uaXRvci5nZXRUZWxlcGhvbnlTcG4oKSkpOwpAQCAtNTE4LDE0ICs1NDQsMTUgQEAKICAgICAgICAgICAgICAgICBtU2NyZWVuTG9ja2VkLnNldFRleHQoIiIpOwogCiAgICAgICAgICAgICAgICAgLy8gbGF5b3V0Ci0gICAgICAgICAgICAgICAgbVNjcmVlbkxvY2tlZC5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7Ci0gICAgICAgICAgICAgICAgbVNlbGVjdG9yLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgICAgICBtU2NyZWVuTG9ja2VkLnNldFZpc2liaWxpdHkoVmlldy5JTlZJU0lCTEUpOwogICAgICAgICAgICAgICAgIG1FbWVyZ2VuY3lDYWxsVGV4dC5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgZW5hYmxlVW5sb2NrKCk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgIGNhc2UgTmV0d29ya0xvY2tlZDoKICAgICAgICAgICAgICAgICAvLyBUaGUgY2FycmllciBzdHJpbmcgc2hvd3MgYm90aCBzaW0gY2FyZCBzdGF0dXMgKGkuZS4gTm8gU2ltIENhcmQpIGFuZAogICAgICAgICAgICAgICAgIC8vIGNhcnJpZXIncyBuYW1lIGFuZC9vciAiRW1lcmdlbmN5IENhbGxzIE9ubHkiIHN0YXR1cwotICAgICAgICAgICAgICAgIG1DYXJyaWVyLnNldFRleHQoCisgICAgICAgICAgICAgICAgbVN0YXR1c1ZpZXcuc2V0Q2FycmllclRleHQoCiAgICAgICAgICAgICAgICAgICAgICAgICBnZXRDYXJyaWVyU3RyaW5nKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVXBkYXRlTW9uaXRvci5nZXRUZWxlcGhvbnlQbG1uKCksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRleHQoKS5nZXRUZXh0KFIuc3RyaW5nLmxvY2tzY3JlZW5fbmV0d29ya19sb2NrZWRfbWVzc2FnZSkpKTsKQEAgLTUzMywyMyArNTYwLDI0IEBACiAKICAgICAgICAgICAgICAgICAvLyBsYXlvdXQKICAgICAgICAgICAgICAgICBtU2NyZWVuTG9ja2VkLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKLSAgICAgICAgICAgICAgICBtU2VsZWN0b3Iuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwogICAgICAgICAgICAgICAgIG1FbWVyZ2VuY3lDYWxsVGV4dC5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgZW5hYmxlVW5sb2NrKCk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgIGNhc2UgU2ltTWlzc2luZzoKICAgICAgICAgICAgICAgICAvLyB0ZXh0Ci0gICAgICAgICAgICAgICAgbUNhcnJpZXIuc2V0VGV4dChSLnN0cmluZy5sb2Nrc2NyZWVuX21pc3Npbmdfc2ltX21lc3NhZ2Vfc2hvcnQpOworICAgICAgICAgICAgICAgIG1TdGF0dXNWaWV3LnNldENhcnJpZXJUZXh0KFIuc3RyaW5nLmxvY2tzY3JlZW5fbWlzc2luZ19zaW1fbWVzc2FnZV9zaG9ydCk7CiAgICAgICAgICAgICAgICAgbVNjcmVlbkxvY2tlZC5zZXRUZXh0KFIuc3RyaW5nLmxvY2tzY3JlZW5fbWlzc2luZ19zaW1faW5zdHJ1Y3Rpb25zKTsKIAogICAgICAgICAgICAgICAgIC8vIGxheW91dAogICAgICAgICAgICAgICAgIG1TY3JlZW5Mb2NrZWQuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwotICAgICAgICAgICAgICAgIG1TZWxlY3Rvci5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CiAgICAgICAgICAgICAgICAgbUVtZXJnZW5jeUNhbGxUZXh0LnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKLSAgICAgICAgICAgICAgICAvLyBkbyBub3QgbmVlZCB0byBzaG93IHRoZSBlLWNhbGwgYnV0dG9uOyB1c2VyIG1heSB1bmxvY2sKKyAgICAgICAgICAgICAgICBlbmFibGVVbmxvY2soKTsgLy8gZG8gbm90IG5lZWQgdG8gc2hvdyB0aGUgZS1jYWxsIGJ1dHRvbjsgdXNlciBtYXkgdW5sb2NrCiAgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgIGNhc2UgU2ltTWlzc2luZ0xvY2tlZDoKICAgICAgICAgICAgICAgICAvLyB0ZXh0Ci0gICAgICAgICAgICAgICAgbUNhcnJpZXIuc2V0VGV4dCgKKyAgICAgICAgICAgICAgICBtU3RhdHVzVmlldy5zZXRDYXJyaWVyVGV4dCgKICAgICAgICAgICAgICAgICAgICAgICAgIGdldENhcnJpZXJTdHJpbmcoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1VcGRhdGVNb25pdG9yLmdldFRlbGVwaG9ueVBsbW4oKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldFRleHQoUi5zdHJpbmcubG9ja3NjcmVlbl9taXNzaW5nX3NpbV9tZXNzYWdlX3Nob3J0KSkpOwpAQCAtNTU3LDI1ICs1ODUsMjcgQEAKIAogICAgICAgICAgICAgICAgIC8vIGxheW91dAogICAgICAgICAgICAgICAgIG1TY3JlZW5Mb2NrZWQuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwotICAgICAgICAgICAgICAgIG1TZWxlY3Rvci5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7IC8vIGNhbm5vdCB1bmxvY2sKICAgICAgICAgICAgICAgICBtRW1lcmdlbmN5Q2FsbFRleHQuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwogICAgICAgICAgICAgICAgIG1FbWVyZ2VuY3lDYWxsQnV0dG9uLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgICAgICBkaXNhYmxlVW5sb2NrKCk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgIGNhc2UgU2ltTG9ja2VkOgogICAgICAgICAgICAgICAgIC8vIHRleHQKLSAgICAgICAgICAgICAgICBtQ2Fycmllci5zZXRUZXh0KAorICAgICAgICAgICAgICAgIG1TdGF0dXNWaWV3LnNldENhcnJpZXJUZXh0KAogICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q2FycmllclN0cmluZygKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVVwZGF0ZU1vbml0b3IuZ2V0VGVsZXBob255UGxtbigpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRDb250ZXh0KCkuZ2V0VGV4dChSLnN0cmluZy5sb2Nrc2NyZWVuX3NpbV9sb2NrZWRfbWVzc2FnZSkpKTsKIAogICAgICAgICAgICAgICAgIC8vIGxheW91dAogICAgICAgICAgICAgICAgIG1TY3JlZW5Mb2NrZWQuc2V0VmlzaWJpbGl0eShWaWV3LklOVklTSUJMRSk7Ci0gICAgICAgICAgICAgICAgbVNlbGVjdG9yLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKICAgICAgICAgICAgICAgICBtRW1lcmdlbmN5Q2FsbFRleHQuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICAgICAgICAgIGVuYWJsZVVubG9jaygpOwogICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICBjYXNlIFNpbVB1a0xvY2tlZDoKICAgICAgICAgICAgICAgICAvLyB0ZXh0Ci0gICAgICAgICAgICAgICAgbUNhcnJpZXIuc2V0VGV4dCgKKyAgICAgICAgICAgICAgICBtU3RhdHVzVmlldy5zZXRDYXJyaWVyVGV4dCgKICAgICAgICAgICAgICAgICAgICAgICAgIGdldENhcnJpZXJTdHJpbmcoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1VcGRhdGVNb25pdG9yLmdldFRlbGVwaG9ueVBsbW4oKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldFRleHQoUi5zdHJpbmcubG9ja3NjcmVlbl9zaW1fcHVrX2xvY2tlZF9tZXNzYWdlKSkpOwpAQCAtNTgzLDkgKzYxMyw5IEBACiAKICAgICAgICAgICAgICAgICAvLyBsYXlvdXQKICAgICAgICAgICAgICAgICBtU2NyZWVuTG9ja2VkLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKLSAgICAgICAgICAgICAgICBtU2VsZWN0b3Iuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOyAvLyBjYW5ub3QgdW5sb2NrCiAgICAgICAgICAgICAgICAgbUVtZXJnZW5jeUNhbGxUZXh0LnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKICAgICAgICAgICAgICAgICBtRW1lcmdlbmN5Q2FsbEJ1dHRvbi5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICAgICAgZGlzYWJsZVVubG9jaygpOwogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAgICAgfQpAQCAtNjUyLDEzICs2ODIsMTQgQEAKIAogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCiAgICAgcHVibGljIHZvaWQgb25QYXVzZSgpIHsKLQorICAgICAgICBpZiAobUVuZXJneVdhdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgbUVuZXJneVdhdmUucmVzZXQoKTsKKyAgICAgICAgfQogICAgIH0KIAogICAg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HNlKTsKKyAgICAgICAgaWYgKG1LZXlib2FyZFZpZXdBbHBoYSA9PSBudWxsIHx8ICFtSXNBbHBoYSkgeworICAgICAgICAgICAgbUtleWJvYXJkSGVscGVyLnNldEtleWJvYXJkTW9kZShtSXNBbHBoYSA/CisgICAgICAgICAgICAgICAgICAgIFBhc3N3b3JkRW50cnlLZXlib2FyZEhlbHBlci5LRVlCT0FSRF9NT0RFX0FMUEhBCisgICAgICAgICAgICAgICAgICAgIDogUGFzc3dvcmRFbnRyeUtleWJvYXJkSGVscGVyLktFWUJPQVJEX01PREVfTlVNRVJJQyk7CisgICAgICAgICAgICBtS2V5Ym9hcmRWaWV3LnNldFZpc2liaWxpdHkoCisgICAgICAgICAgICAgICAgICAgIG1DcmVhdGlvbkhhcmRLZXlib2FyZEhpZGRlbiA9PSBDb25maWd1cmF0aW9uLkhBUkRLRVlCT0FSREhJRERFTl9OTworICAgICAgICAgICAgICAgICAgICA/IFZpZXcuSU5WSVNJQkxFIDogVmlldy5WSVNJQkxFKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1LZXlib2FyZEhlbHBlckFscGhhID0gbmV3IFBhc3N3b3JkRW50cnlLZXlib2FyZEhlbHBlcihjb250ZXh0LCBtS2V5Ym9hcmRWaWV3QWxwaGEsCisgICAgICAgICAgICAgICAgICAgIHRoaXMsIGZhbHNlKTsKKyAgICAgICAgICAgIG1LZXlib2FyZEhlbHBlci5zZXRLZXlib2FyZE1vZGUoUGFzc3dvcmRFbnRyeUtleWJvYXJkSGVscGVyLktFWUJPQVJEX01PREVfTlVNRVJJQyk7CisgICAgICAgICAgICBtS2V5Ym9hcmRIZWxwZXJBbHBoYS5zZXRLZXlib2FyZE1vZGUoUGFzc3dvcmRFbnRyeUtleWJvYXJkSGVscGVyLktFWUJPQVJEX01PREVfQUxQSEEpOworICAgICAgICAgICAgbUtleWJvYXJkVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgIC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QgKzIzNCwxNCBAQAogICAgICAgICAgICAgICAgIFN0cmluZyBpbnN0cnVjdGlvbnMgPSBnZXRDb250ZXh0KCkuZ2V0U3RyaW5nKAogICAgICAgICAgICAgICAgICAgICAgICAgUi5zdHJpbmcubG9ja3NjcmVlbl90b29fbWFueV9mYWlsZWRfYXR0ZW1wdHNfY291bnRkb3duLAogICAgICAgICAgICAgICAgICAgICAgICAgc2Vjb25kc1JlbWFpbmluZyk7Ci0gICAgICAgICAgICAgICAgbVRpdGxlLnNldFRleHQoaW5zdHJ1Y3Rpb25zKTsKKyAgICAgICAgICAgICAgICBtU3RhdHVzVmlldy5zZXRJbnN0cnVjdGlvblRleHQoaW5zdHJ1Y3Rpb25zKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkZpbmlzaCgpIHsKICAgICAgICAgICAgICAgICBtUGFzc3dvcmRFbnRyeS5zZXRFbmFibGVkKHRydWUpOwotICAgICAgICAgICAgICAgIG1UaXRsZS5zZXRUZXh0KFIuc3RyaW5nLmtleWd1YXJkX3Bhc3N3b3JkX2VudGVyX3Bhc3N3b3JkX2NvZGUpOwogICAgICAgICAgICAgICAgIG1LZXlib2FyZFZpZXcuc2V0RW5hYmxlZCh0cnVlKTsKKyAgICAgICAgICAgICAgICByZXNldFN0YXR1c0luZm8oKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfS5zdGFydCgpOwogICAgIH0KQEAgLTI0NCwyNCArMjg3LDQxIEBACiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKKyAgICAvLyAtLS0tLS0tLS0tIEluZm9DYWxsYmFjaworCisgICAgLyoqIHtAaW5oZXJpdERvY30gKi8KKyAgICBwdWJsaWMgdm9pZCBvblJlZnJlc2hCYXR0ZXJ5SW5mbyhib29sZWFuIHNob3dCYXR0ZXJ5SW5mbywgYm9vbGVhbiBwbHVnZ2VkSW4sIGludCBiYXR0ZX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gICAgICAgIG1Gb290ZXJOb3JtYWwuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOwogICAgICAgICAgICAgICAgIG1Gb290ZXJGb3Jnb3RQYXR0ZXJuLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKICAgICAgICAgICAgICAgICBtRm9yZ290UGF0dGVybkJ1dHRvbi5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIFZlcmlmeVVubG9ja2VkOgorICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIm1vZGUgVmVyaWZ5VW5sb2NrZWQiKTsKICAgICAgICAgICAgICAgICBtRm9vdGVyTm9ybWFsLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKICAgICAgICAgICAgICAgICBtRm9vdGVyRm9yZ290UGF0dGVybi5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CiAgICAgICAgIH0KQEAgLTE4MCwyNCArMTU5LDE2IEBACiAgICAgICAgIG1DcmVhdGlvbk9yaWVudGF0aW9uID0gY29uZmlndXJhdGlvbi5vcmllbnRhdGlvbjsKIAogICAgICAgICBMYXlvdXRJbmZsYXRlciBpbmZsYXRlciA9IExheW91dEluZmxhdGVyLmZyb20oY29udGV4dCk7CisKICAgICAgICAgaWYgKG1DcmVhdGlvbk9yaWVudGF0aW9uICE9IENvbmZpZ3VyYXRpb24uT1JJRU5UQVRJT05fTEFORFNDQVBFKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJwb3J0cmFpdCBtb2RlIik7CiAgICAgICAgICAgICBpbmZsYXRlci5pbmZsYXRlKFIubGF5b3V0LmtleWd1YXJkX3NjcmVlbl91bmxvY2tfcG9ydHJhaXQsIHRoaXMsIHRydWUpOwogICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgTG9nLmQoVEFHLCAibGFuZHNjYXBlIG1vZGUiKTsKICAgICAgICAgICAgIGluZmxhdGV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rUGF0dGVyblV0aWxzLmdldE5leHRBbGFybSgpOwotICAgICAgICB1cGRhdGVTdGF0dXNMaW5lcygpOwotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZCB1cGRhdGVTdGF0dXNMaW5lcygpIHsKLSAgICAgICAgaWYgKG1JbnN0cnVjdGlvbnMgIT0gbnVsbCkgewotICAgICAgICAgICAgLy8gaW5zdHJ1Y3Rpb25zIG9ubHkKLSAgICAgICAgICAgIG1TdGF0dXMxLnNldFRleHQobUluc3RydWN0aW9ucyk7Ci0gICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkobUluc3RydWN0aW9ucykpIHsKLSAgICAgICAgICAgICAgICBtU3RhdHVzMS5zZXRDb21wb3VuZERyYXdhYmxlc1dpdGhJbnRyaW5zaWNCb3VuZHMoMCwgMCwgMCwgMCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1TdGF0dXMxLnNldENvbXBvdW5kRHJhd2FibGVzV2l0aEludHJpbnNpY0JvdW5kcygKLSAgICAgICAgICAgICAgICAgICAgICAgIFIuZHJhd2FibGUuaWNfbG9ja19pZGxlX2xvY2ssIDAsIDAsIDApOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtU3RhdHVzMS5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7Ci0gICAgICAgICAgICBtU3RhdHVzU2VwLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKLSAgICAgICAgICAgIG1TdGF0dXMyLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKLSAgICAgICAgfSBlbHNlIGlmIChtU2hvd2luZ0JhdHRlcnlJbmZvICYmIG1OZXh0QWxhcm0gPT0gbnVsbCkgewotICAgICAgICAgICAgLy8gYmF0dGVyeSBvbmx5Ci0gICAgICAgICAgICBpZiAobVBsdWdnZWRJbikgewotICAgICAgICAgICAgICBpZiAobUJhdHRlcnlMZXZlbCA+PSAxMDApIHsKLSAgICAgICAgICAg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2FsYXJtLCAwLCAwLCAwKTsKLQotICAgICAgICAgICAgbVN0YXR1czEuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwotICAgICAgICAgICAgbVN0YXR1c1NlcC5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7Ci0gICAgICAgICAgICBtU3RhdHVzMi5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7Ci0gICAgICAgIH0gZWxzZSBpZiAobU5leHRBbGFybSAhPSBudWxsICYmIG1TaG93aW5nQmF0dGVyeUluZm8pIHsKLSAgICAgICAgICAgIC8vIGJvdGggYmF0dGVyeSBhbmQgbmV4dCBhbGFybQotICAgICAgICAgICAgbVN0YXR1czEuc2V0VGV4dChtTmV4dEFsYXJtKTsKLSAgICAgICAgICAgIG1TdGF0dXNTZXAuc2V0VGV4dCgifCIpOwotICAgICAgICAgICAgbVN0YXR1czIuc2V0VGV4dChnZXRDb250ZXh0KCkuZ2V0U3RyaW5nKAotICAgICAgICAgICAgICAgICAgICBSLnN0cmluZy5sb2Nrc2NyZWVuX2JhdHRlcnlfc2hvcnQsCi0gICAgICAgICAgICAgICAgICAgIE1hdGgubWluKDEwMCwgbUJhdHRlcnlMZXZlbCkpKTsKLSAgICAgICAgICAgIG1TdGF0dXMxLnNldENvbXBvdW5kRHJhd2FibGVzV2l0aEludHJpbnNpY0JvdW5kcyhSLmRyYXdhYmxlLmljX2xvY2tfaWRsZV9hbGFybSwgMCwgMCwgMCk7Ci0gICAgICAgICAgICBpZiAobVBsdWdnZWRJbikgewotICAgICAgICAgICAgICAgIG1TdGF0dXMyLnNldENvbXBvdW5kRHJhd2FibGVzV2l0aEludHJpbnNpY0JvdW5kcyhSLmRyYXdhYmxlLmljX2xvY2tfaWRsZV9jaGFyZ2luZywgMCwgMCwgMCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1TdGF0dXMyLnNldENvbXBvdW5kRHJhd2FibGVzV2l0aEludHJpbnNpY0Jvd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lKTsKICAgICAgICAgICAgICAgICBtQ2FsbGJhY2sucmVwb3J0U3VjY2Vzc2Z1bFVubG9ja0F0dGVtcHQoKTsKICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC01MzMsOCArNDE0LDkgQEAKICAgICAgICAgICAgICAgICAgICAgaGFuZGxlQXR0ZW1wdExvY2tvdXQoZGVhZGxpbmUpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gbVVubG9ja0ljb24uc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwotICAgICAgICAgICAgICAgICAgICBtSW5zdHJ1Y3Rpb25zID0gZ2V0Q29udGV4dCgpLmdldFN0cmluZyhSLnN0cmluZy5sb2Nrc2NyZWVuX3BhdHRlcm5fd3JvbmcpOwotICAgICAgICAgICAgICAgICAgICB1cGRhdGVTdGF0dXNMaW5lcygpOworICAgICAgICAgICAgICAgICAgICBtU3RhdHVzVmlldy5zZXRJbnN0cnVjdGlvbnMoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldFN0cmluZyhSLnN0cmluZy5sb2Nrc2NyZWVuX3BhdHRlcm5fd3JvbmcpKTsKKyAgICAgICAgICAgICAgICAgICAgbVN0YXR1c1ZpZXcudXBkYXRlU3RhdHVzTGluZXMoKTsKICAgICAgICAgICAgICAgICAgICAgbUxvY2tQYXR0ZXJuVmlldy5wb3N0RGVsYXllZCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ2FuY2VsUGF0dGVyblJ1bm5hYmxlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBBVFRFUk5fQ0xFQVJfVElNRU9VVF9NUyk7CkBAIC01NTIsMTcgKzQzNCwxOCBAQAogICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvblRpY2sobG9uZyBtaWxsaXNVbnRpbEZpbmlzaGVkKSB7CiAgICAgICAgICAgICAgICAgaW50IHNlY29uZHNSZW1haW5pbmcgPSAoaW50KSAobWlsbGlzVW50aWxGaW5pc2hlZCAvIDEwMDApOwotICAgICAgICAgICAgICAgIG1JbnN0cnVjdGlvbnMgPSBnZXRDb250ZXh0KCkuZ2V0U3RyaW5nKAorICAgICAgICAgICAgICAgIG1TdGF0dXNWaWV3LnNldEluc3RydWN0aW9ucyhnZXRDb250ZXh0KCkuZ2V0U3RyaW5nKAogICAgICAgICAgICAgICAgICAgICAgICAgUi5zdHJpbmcubG9ja3NjcmVlbl90b29fbWFueV9mYWlsZWRfYXR0ZW1wdHNfY291bnRkb3duLAotICAgICAgICAgICAgICAgICAgICAgICAgc2Vjb25kc1JlbWFpbmluZyk7Ci0gICAgICAgICAgICAgICAgdXBkYXRlU3RhdHVzTGluZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlY29uZHNSZW1haW5pbmcpKTsKKyAgICAgICAgICAgICAgICBtU3RhdHVzVmlldy51cGRhdGVTdGF0dXNMaW5lcygpOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uRmluaXNoKCkgewogICAgICAgICAgICAgICAgIG1Mb2NrUGF0dGVyblZpZXcuc2V0RW5hYmxlZCh0cnVlKTsKLSAgICAgICAgICAgICAgICBtSW5zdHJ1Y3Rpb25zID0gZ2V0Q29udGV4dCgpLmdldFN0cmluZyhSLnN0cmluZy5sb2Nrc2NyZWVuX3BhdHRlcm5faW5zdHJ1Y3Rpb25zKTsKLSAgICAgICAgICAgICAgICB1cGRhdGVTdGF0dXNMaW5lcygpOworICAgICAgICAgICAgICAgIG1TdGF0dXNWaWV3LnNldEluc3RydWN0aW9ucyhnZXRDb250ZXh0KCkuZ2V0U3RyaW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgUi5zdHJpbmcubG9ja3NjcmVlbl9wYXR0ZXJuX2luc3RydWN0aW9ucykpOworICAgICAgICA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AgICAgIC8vIEFscmVhZHkgcHJlcGFyZWQgKGlzUHJlcGFyZWQgd2lsbCBiZSByZXNldCB0byBmYWxzZSBsYXRlcikKICAgICAgICAgaWYgKHN0LmlzUHJlcGFyZWQpCiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLQorICAgICAgICAKICAgICAgICAgaWYgKChtUHJlcGFyZWRQYW5lbCAhPSBudWxsKSAmJiAobVByZXBhcmVkUGFuZWwgIT0gc3QpKSB7CiAgICAgICAgICAgICAvLyBBbm90aGVyIFBhbmVsIGlzIHByZXBhcmVkIGFuZCBwb3NzaWJseSBvcGVuLCBzbyBjbG9zZSBpdAogICAgICAgICAgICAgY2xvc2VQYW5lbChtUHJlcGFyZWRQYW5lbCwgZmFsc2UpOwpAQCAtMzE1LDkgKzMzMiwxMSBAQAogCiAgICAgICAgIGlmIChzdC5jcmVhdGVkUGFuZWxWaWV3ID09IG51bGwpIHsKICAgICAgICAgICAgIC8vIEluaXQgdGhlIHBhbmVsIHN0YXRlJ3MgbWVudS0tcmV0dXJuIGZhbHNlIGlmIGluaXQgZmFpbGVkCi0gICAgICAgICAgICBpZiAoc3QubWVudSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaWYgKCFpbml0aWFsaXplUGFuZWxNZW51KHN0KSB8fCAoc3QubWVudSA9PSBudWxsKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICBpZiAoc3QubWVudSA9PSBudWxsIHx8IHN0LnJlZnJlc2hNZW51Q29udGVudCkgeworICAgICAgICAgICAgICAgIGlmIChzdC5tZW51ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFpbml0aWFsaXplUGFuZWxNZW51KHN0KSB8fCAoc3QubWVudSA9PSBudWxsKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIC8vIENhbGwgY2FsbGJhY2ssIGFuZCByZXR1cm4gaWYgaXQgZG9lc24ndCB3YW50IHRvIGRpc3BsYXkgbWVudQogICAgICAgICAgICAgICAgIGlmICgoY2IgPT0gbnVsbCkgfHwgIWNiLm9uQ3JlYXRlUGFuZWxNZW51KHN0LmZlYXR1cmVJZCwgc3QubWVudSkpIHsKQEAgLTMyNiw2ICszNDUsMTIgQEAKIAogICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHN0LnJlZnJlc2hNZW51Q29udGVudCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgaWYgKG1BY3Rpb25CYXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtQWN0aW9uQmFyLnNldE1lbnUoc3QubWVudSk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAvLyBDYWxsYmFjayBhbmQgcmV0dXJuIGlmIHRoZSBjYWxsYmFjayBkb2VzIG5vdCB3YW50IHRvIHNob3cgdGhlIG1lbnUKQEAgLTM0OSwzNiArMzc0LDM3IEBACiAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgdm9pZCBvbkNvbmZpZ3VyYXRpb25DaGFuZ2VkKENvbmZpZ3VyYXRpb24gbmV3Q29uZmlnKSB7Ci0gICAgICAgIFBhbmVsRmVhdHVyZVN0YXRlIHN0ID0gZ2V0UGFuZWxTdGF0ZShGRUFUVVJFX09QVElPTlNfUEFORUwsIGZhbHNlKTsKLSAgICAgICAgaWYgKChzdCAhPSBudWxsKSAmJiAoc3QubWVudSAhPSBudWxsKSkgewotICAgICAgICAgICAgZmluYWwgTWVudUJ1aWxkZXIgbWVudUJ1aWxkZXIgPSAoTWVudUJ1aWxkZXIpIHN0Lm1lbnU7CisgICAgICAgIC8vIEFjdGlvbiBiYXJzIGhhbmRsZSB0aGVpciBvd24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G8gYmUgcmVjcmVhdGVkCisgICAgICAgICAgICAgICAgICAgIC8vIGFjY29yZGluZyB0byB0aGUgbmV3IGNvbmZpZ3VyYXRpb24KKyAgICAgICAgICAgICAgICAgICAgY2xlYXJNZW51Vmlld3Moc3QpOwogCi0gICAgICAgICAgICAgICAgLy8gUmUtb3BlbiB0aGUgc2FtZSBtZW51Ci0gICAgICAgICAgICAgICAgcmVvcGVuTWVudShmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIC8vIFJlLW9wZW4gdGhlIHNhbWUgbWVudQorICAgICAgICAgICAgICAgICAgICByZW9wZW5NZW51KGZhbHNlKTsKIAotICAgICAgICAgICAgICAgIC8vIFJlc3RvcmUgc3RhdGUKLSAgICAgICAgICAgICAgICBtZW51QnVpbGRlci5yZXN0b3JlSGllcmFyY2h5U3RhdGUoc3RhdGUpOworICAgICAgICAgICAgICAgICAgICAvLyBSZXN0b3JlIHN0YXRlCisgICAgICAgICAgICAgICAgICAgIG1lbnVCdWlsZGVyLnJlc3RvcmVIaWVyYXJjaHlTdGF0ZShzdGF0ZSk7CiAKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gQ2xlYXIgbWVudSB2aWV3cyBzbyBvbiBuZXh0IG1lbnUgb3BlbmluZywgaXQgd2lsbCB1c2UKLSAgICAgICAgICAgICAgICAvLyB0aGUgcHJvcGVyIGxheW91dAotICAgICAgICAgICAgICAgIGNsZWFyTWVudVZpZXdzKHN0KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBDbGVhciBtZW51IHZpZXdzIHNvIG9uIG5leHQgbWVudSBvcGVuaW5nLCBpdCB3aWxsIHVzZQorICAgICAgICAgICAgICAgICAgICAvLyB0aGUgcHJvcGVyIGxheW91dAorICAgICAgICAgICAgICAgICAgICBjbGVhck1lbnVWaWV3cyhzdCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9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GZlYXR1cmVJZCA9PSBGRUFUVVJFX09QVElPTlNfUEFORUwpCisgICAgICAgICAgICAgICAgJiYgbUFjdGlvbkJhciAhPSBudWxsKSB7CisgICAgICAgICAgICBzdCA9IGdldFBhbmVsU3RhdGUoV2luZG93LkZFQVRVUkVfT1BUSU9OU19QQU5FTCwgZmFsc2UpOworICAgICAgICAgICAgaWYgKHN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBzdC5pc1ByZXBhcmVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgcHJlcGFyZVBhbmVsKHN0LCBudWxsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKICAgICAvKioKICAgICAgKiBDYWxsZWQgd2hlbiB0aGUgcGFuZWwga2V5IGlzIHB1c2hlZCBkb3duLgogICAgICAqIEBwYXJhbSBmZWF0dXJlSWQgVGhlIGZlYXR1cmUgSUQgb2YgdGhlIHJlbGV2YW50IHBhbmVsIChkZWZhdWx0cyB0byBGRUFUVVJFX09QVElPTlNfUEFORUx9LgpAQCAtNTU4LDcgKzYxMiw3IEBACiAgICAgICAgICAgICAvLyBUaGUgcGFuZWwga2V5IHdhcyBwdXNoZWQsIHNvIHNldCB0aGUgY2hvcmRpbmcga2V5CiAgICAgICAgICAgICBtUGFuZWxDaG9yZGluZ0tleSA9IGtleUNvZGU7CiAgICAgICAgICAgICBtUGFuZWxNYXlMb25nUHJlc3MgPSBmYWxzZTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBQYW5lbEZlYXR1cmVTdGF0ZSBzdCA9IGdldFBhbmVsU3RhdGUoZmVhdHVyZUlkLCB0cnVlKTsKICAgICAgICAgICAgIGlmICghc3QuaXNPcGVuKSB7CiAgICAgICAgICAgICAgICAgaWYgKGdldENvbnRleHQoKS5nZXRSZXNvdXJjZXMoKS5nZXRDb25maWd1cmF0aW9uKCkua2V5Ym9hcmQKQEAgLTU2NywyMCArNjIxLDEyIEBACiAgICAgICAgICAgICA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gICAgICAgICAgIH0KICAgICAgICAgICAgIAogICAgICAgICAgICAgYm9vbGVhbiBwbGF5U291bmRFZmZlY3QgPSBmYWxzZTsKLSAgICAgICAgICAgIFBhbmVsRmVhdHVyZVN0YXRlIHN0ID0gZ2V0UGFuZWxTdGF0ZShmZWF0dXJlSWQsIHRydWUpOwotICAgICAgICAgICAgaWYgKHN0LmlzT3BlbiB8fCBzdC5pc0hhbmRsZWQpIHsKKyAgICAgICAgICAgIGZpbmFsIFBhbmVsRmVhdHVyZVN0YXRlIHN0ID0gZ2V0UGFuZWxTdGF0ZShmZWF0dXJlSWQsIHRydWUpOworICAgICAgICAgICAgaWYgKGZlYXR1cmVJZCA9PSBGRUFUVVJFX09QVElPTlNfUEFORUwgJiYgbUFjdGlvbkJhciAhPSBudWxsICYmCisgICAgICAgICAgICAgICAgICAgIG1BY3Rpb25CYXIuaXNPdmVyZmxvd1Jlc2VydmVkKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW1BY3Rpb25CYXIuaXNPdmVyZmxvd01lbnVTaG93aW5nKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgQ2FsbGJhY2sgY2IgPSBnZXRDYWxsYmFjaygpOworICAgICAgICAgICAgICAgICAgICBpZiAoY2IgIT0gbnVsbCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNiLm9uUHJlcGFyZVBhbmVsKGZlYXR1cmVJZCwgc3QuY3JlYXRlZFBhbmVsVmlldywgc3QubWVudSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlTb3VuZEVmZmVjdCA9IG1BY3Rpb25CYXIuc2hvd092ZXJmbG93TWVudSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcGxheVNvdW5kRWZmZWN0ID0gbUFjdGlvbkJhci5oaWRlT3ZlcmZsb3dNZW51KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAoc3QuaXNPcGVuIHx8IHN0LmlzSGFuZGxlZCkgewogCi0gICAgICAgICAgICAgICAgLy8gUGxheSB0aGUgc291bmQgZWZmZWN0IGlmIHRoZSB1c2VyIGNsb3NlZCBhbiBvcGVuIG1lbnUgKGFuZCBub3QgaWYKLSAgICAgICAgICAgICAgICAvLyB0aGV5IGp1c3QgcmVsZWFzZWQgYSBtZW51IHNob3J0Y3V0KQotICAgICAgICAgICAgICAgIHBsYXlTb3VuZEVmZmVjdCA9IHN0LmlzT3BlbjsKKyAgICAgICAgICAgICAgICAgICAgLy8gUGxheSB0aGUgc291bmQgZWZmZWN0IGlmIHRoZSB1c2VyIGNsb3NlZCBhbiBvcGVuIG1lbnUgKGFuZCBub3QgaWYKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhleSBqdXN0IHJlbGVhc2VkIGEgbWVudSBzaG9ydGN1dCkKKyAgICAgICAgICAgICAgICAgICAgcGxheVNvdW5kRWZmZWN0ID0gc3QuaXNPcGVuOwogCi0gICAgICAgICAgICAgICAgLy8gQ2xvc2UgbWVudQotICAgICAgICAgICAgICAgIGNsb3NlUGFuZWwoc3QsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAvLyBDbG9zZSBtZW51CisgICAgICAgICAgICAgICAgICAgIGNsb3NlUGFuZWwoc3QsIHRydWUpOwogCi0gICAgICAgICAgICB9IGVsc2UgaWYgKHN0LmlzUHJlcGFyZWQpIHsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0LmlzUHJlcGFyZWQpIHsKIAotICAgICAgICAgICAgICAgIC8vIFdyaXRlICdtZW51IG9wZW5lZCcgdG8gZXZlbnQgbG9nCi0gICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudCg1MDAwMSwgMCk7CisgICAgICAgICAgICAgICAgICAgIC8vIFdyaXRlICdtZW51IG9wZW5lZCcgdG8gZXZlbnQgbG9nCisgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoNTAwMDEsIDApOwogCi0gICAgICAgICAgICAgICAgLy8gU2hvdyBtZW51Ci0gICAgICAgICAgICAgICAgb3BlblBhbmVsKHN0LCBldmVudCk7CisgICAgICAgICAgICAgICAgICAgIC8vIFNob3cgbWVudQorICAgICAgICAgICAgICAgICAgICBvcGVuUGFuZWwoc3QsIGV2ZW50KTsKIAotICAgICAgICAgICAgICAgIHBsYXlTb3VuZEVmZmVjdCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHBsYXlTb3VuZEVmZmVjdCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAocGxheVNvdW5kRWZmZWN0KSB7CkBAIC03NzcsOCArODM2LDIwIEBACiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQogCi0gICAgICAgIC8vIFRoZSB3aW5kb3cgbWFuYWdlciB3aWxsIGdpdmUgdXMgYSB2YWxpZCB3aW5kb3cgdG9rZW4KLSAgICAgICAgbmV3IE1lbnVEaWFsb2dIZWxwZXIoc3ViTWVudSkuc2hvdyhudWxsKTsKKyAgICAgICAgZmluYWwgTWVudSBwYXJlbnRNZW51ID0gc3ViTWVudS5nZXRSb290TWVudSgpOworICAgICAgICBmaW5hbCBQYW5lbEZlYXR1cmVTdGF0ZSBwYW5lbCA9IGZpbmRNZW51UGFuZWwocGFyZW50TWVudSk7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogVXNlIHRoZSBwYW5lbCBvcGVuIHN0YXRlIHRvIGRldGVybWluZSB3aGV0aGVyIHRoaXMgaXMgY29taW5nIGZyb20gYW4gb3BlbiBwYW5lbAorICAgICAgICAgKiBvciBhbiBhY3Rpb24gYnV0dG9uLiBJZiBpdCdzIGFuIG9wZW4gcGFuZWwgd2Ugd2FudCB0byB1c2UgTWVudURpYWxvZ0hlbHBlci4KKyAgICAgICAgICogSWYgaXQncyBjbG9zZWQgd2Ugd2FudCB0byBncmFiIHRoZSByZWxldmFudCB2aWV3IGFuZCBjcmVhdGUgYSBwb3B1cCBhbmNob3JlZCB0byBpdC4KKyAgICAgICAgICovCisgICAgICAgIGlmIChwYW5lbC5pc09wZW4pIHsKKyAgICAgICAgICAgIC8vIFRoZSB3aW5kb3cgbWFuYWdlciB3aWxsIGdpdmUgdXMgYSB2YWxpZCB3aW5kb3cgdG9rZW4KKyAgICAgICAgICAgIG5ldyBNZW51RGlhbG9nSGVscGVyKHN1Yk1lbnUpLnNob3cobnVsbCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBuZXcgTWVudVBvcHVwSGVscGVyKGdldENvbnRleHQoKSwgc3ViTWVudSkuc2hvdygpOworICAgICAgICB9CiAKICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQpAQCAtNzg4LDYgKzg1OSwyMSBAQAogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCByZW9wZW5NZW51KGJvb2xlYW4gdG9nZ2xlTWVudU1vZGUpIHsKKyAgICAgICAgaWYgKG1BY3Rpb25CYXIgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKCFtQWN0aW9uQmFyLmlzT3ZlcmZsb3dNZW51U2hvd2luZygpIHx8ICF0b2dnbGVNZW51TW9kZSkgeworICAgICAgICAgICAgICAgIGZpbmFsIENhbGxiYWNrIGNiID0gZ2V0Q2FsbGJhY2soKTsKKyAgICAgICAgICAgICAgICBpZiAoY2IgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBQYW5lbEZlYXR1cmVTdGF0ZSBzdCA9IGdldFBhbmVsU3RhdGUoRkVBVFVSRV9PUFRJT05TX1BBTkVMLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNiLm9uUHJlcGFyZVBhbmVsKEZFQVRVUkVfT1BUSU9OU19QQU5FTCwgc3QuY3JlYXRlZFBhbmVsVmlldywgc3QubWVudSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpb25CYXIuc2hvd092ZXJmbG93TWVudSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtQWN0aW9uQmFyLmhpZGVPdmVyZmxvd01lbnUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCiAgICAgICAgIFBhbmVsRmVhdHVyZVN0YXRlIHN0ID0gZ2V0UGFuZWxTdGF0ZShGRUFUVVJFX09QVElPTlNfUEFORUwsIHRydWUpOwogCiAgICAgICAgIC8vIFNhdmUgdGhlIGZ1dHVyZSBleHBhbmRlZCBtb2RlIHN0YXRlIHNpbmNlIGNsb3NlUGFuZWwgd2lsbCByZXNldCBpdApAQCAtMTE0NCw3ICsxMjMwLDggQEAKICAgICAgICAgCiAgICAgICAgIHN3aXRjaCAoa2V5Q29kZSkgewogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9VUDoKLSAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfRE9XTjogeworICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9ET1dOOgorICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9NVVRFOiB7CiAgICAgICAgICAgICAgICAgQXVkaW9NYW5hZ2VyIGF1ZGlvTWFuYWdlciA9IChBdWRpb01hbmFnZXIpIGdldENvbnRleHQoKS5nZXRTeXN0ZW1TZXJ2aWNlKAogICAgICAgICAgICAgICAgICAgICAgICAgQ29udGV4dC5BVURJT19TRVJWSUNFKTsKICAgICAgICAgICAgICAgICBpZiAoYXVkaW9NYW5hZ2VyICE9IG51bGwpIHsKQEAgLTExNTIsNiArMTIzOSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAqIEFkanVzdCB0aGUgdm9sdW1lIGluIG9uIGtleSBkb3duIHNpbmNlIGl0IGlzIG1vcmUKICAgICAgICAgICAgICAgICAgICAgICogcmVzcG9uc2l2ZSB0byB0aGUgdXNlci4KICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IEFjdHVhbGx5IGhhbmRsZSBNVVRFLgogICAgICAgICAgICAgICAgICAgICBhdWRpb01hbmFnZXIuYWRqdXN0U3VnZ2VzdGVkU3RyZWFtVm9sdW1lKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfVVAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQXVkaW9NYW5hZ2VyLkFESlVTVF9SQUlTRQpAQCAtMTE2Myw4ICsxMjUxLDEwIEBACiAgICAgICAgICAgICB9CiAKIAorICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BMQVk6CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUEFVU0U6CiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUExBWV9QQVVTRToKLSAgICAgICAgICAgICAgICAvKiBTdXBwcmVzcyBQTEFZUEFVU0UgdG9nZ2xlIHdoZW4gcGhvbmUgaXMgcmluZ2luZyBvciBpbi1jYWxsCisgICAgICAgICAgICAgICAgLyogU3VwcHJlc3MgUExBWS9QQVVTRSB0b2dnbGUgd2hlbiBwaG9uZSBpcyByaW5naW5nIG9yIGluLWNhbGwKICAgICAgICAgICAgICAgICAgKiB0byBhdm9pZCBtdXNpYyBwbGF5YmFjayAqLwogICAgICAgICAgICAgICAgIGlmIChtVGVsZXBob255TWFuYWdlciA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIG1UZWxlcGhvbnlNYW5hZ2VyID0gKFRlbGVwaG9ueU1hbmFnZXIpIGdldENvbnRleHQoKS5nZXRTeXN0ZW1TZXJ2aWNlKApAQCAtMTE4MCw2ICsxMjcwLDcgQEAKICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9ORVhUOgogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BSRVZJT1VTOgogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1JFV0lORDoKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9SRUNPUkQ6CiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfRkFTVF9GT1JXQVJEOiB7CiAgICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9NRURJQV9CVVRUT04sIG51bGwpOwogICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShJbnRlbnQuRVhUUkFfS0VZX0VWRU5ULCBldmVudCk7CkBAIC0xMzE2LDcgKzE0MDcsOCBAQAogICAgICAgICAKICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7CiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfVk9MVU1FX1VQOgotICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9ET1dOOiB7CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfVk9MVU1FX0RPV046CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfVk9MVU1FX01VVEU6IHsKICAgICAgICAgICAgICAgICBpZiAoIWV2ZW50LmlzQ2FuY2VsZWQoKSkgewogICAgICAgICAgICAgICAgICAgICBBdWRpb01hbmFnZXIgYXVkaW9NYW5hZ2VyID0gKEF1ZGlvTWFuYWdlcikgZ2V0Q29udGV4dCgpLmdldFN5c3RlbVNlcnZpY2UoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29udGV4dC5BVURJT19TRVJWSUNFKTsKQEAgLTEzMjUsNiArMTQxNyw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgKiBQbGF5IGEgc291bmQuIFRoaXMgaXMgZG9uZSBvbiBrZXkgdXAgc2luY2Ugd2UgZG9uJ3Qgd2FudCB0aGUKICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNvdW5kIHRvIHBsYXkgd2hlbiBhIHVzZXIgaG9sZHMgZG93biB2b2x1bWUgZG93biB0byBtdXRlLgogICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBBY3R1YWxseSBoYW5kbGUgTVVURS4KICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvTWFuYWdlci5hZGp1c3RTdWdnZXN0ZWRTdHJlYW1Wb2x1bWUoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvTWFuYWdlci5BREpVU1RfU0FNRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVZvbHVtZUNvbnRyb2xTdHJlYW1UeXBlLApAQCAtMTM2MCwxMSArMTQ1MywxNSBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfSEVBRFNFVEhPT0s6CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTVVURToKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9QTEFZOgorICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BBVVNFOgogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BMQVlfUEFVU0U6CiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfU1RPUDoKICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9ORVhUOgogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BSRVZJT1VTOgogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1JFV0lORDoKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9SRUNPUkQ6CiAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfRkFTVF9GT1JXQVJEOiB7CiAgICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9NRURJQV9CVVRUT04sIG51bGwpOwogICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShJbnRlbnQuRVhUUkFfS0VZX0VWRU5ULCBldmVudCk7CkBAIC0xNDE0LDcgKzE1MTEsMTEgQEAKICAgICAgICAgc2VuZENsb3NlU3lzdGVtV2luZG93cygpOwogICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX0NBTExfQlVUVE9OKTsKICAgICAgICAgaW50ZW50LnNldEZsYWdzKEludGVudC5GTEFHX0FDVElWSVRZX05FV19UQVNLKTsKLSAgICAgICAgZ2V0Q29udGV4dCgpLnN0YXJ0QWN0aXZpdHkoaW50ZW50KTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGdldENvbnRleHQoKS5zdGFydEFjdGl2aXR5KGludGVudCk7CisgICAgICAgIH0gY2F0Y2ggKEFjdGl2aXR5Tm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLncoVEFHLCAiTm8gYWN0aXZpdHkgZm91bmQgZm9yIGFuZHJvaWQuaW50ZW50LmFjdGlvbi5DQUxMX0JVVFRPTi4iKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIEBPdmVycmlkZQpAQCAtMTQzNyw2ICsxNTM4LDcgQEAKICAgICBzdGF0aWMgcHJpdmF0ZSBmaW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QogCiAgICAgLyoqCkBAIC0xNTk0LDYgKzE3MDQsMTAgQEAKICAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1XYXRjaGluZ0Zvck1lbnU7CiAgICAgICAgIHByaXZhdGUgaW50IG1Eb3duWTsKIAorICAgICAgICBwcml2YXRlIEFjdGlvbk1vZGUgbUFjdGlvbk1vZGU7CisgICAgICAgIHByaXZhdGUgQWN0aW9uQmFyQ29udGV4dFZpZXcgbUFjdGlvbk1vZGVWaWV3OworICAgICAgICBwcml2YXRlIFBvcHVwV2luZG93IG1BY3Rpb25Nb2RlUG9wdXA7CisKICAgICAgICAgcHVibGljIERlY29yVmlldyhDb250ZXh0IGNvbnRleHQsIGludCBmZWF0dXJlSWQpIHsKICAgICAgICAgICAgIHN1cGVyKGNvbnRleHQpOwogICAgICAgICAgICAgbUZlYXR1cmVJZCA9IGZlYXR1cmVJZDsKQEAgLTE2MDIsMTMgKzE3MTYsMTUgQEAKICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyBib29sZWFuIGRpc3BhdGNoS2V5RXZlbnQoS2V5RXZlbnQgZXZlbnQpIHsKICAgICAgICAgICAgIGZpbmFsIGludCBrZXlDb2RlID0gZXZlbnQuZ2V0S2V5Q29kZSgpOwotICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc0Rvd24gPSBldmVudC5nZXRBY3Rpb24oKSA9PSBLZXlFdmVudC5BQ1RJT05fRE9XTjsKKyAgICAgICAgICAgIGZpbmFsIGludCBhY3Rpb24gPSBldmVudC5nZXRBY3Rpb24oKTsKKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNEb3duID0gYWN0aW9uID09IEtleUV2ZW50LkFDVElPTl9ET1dOOwogCiAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICogSWYgdGhlIHVzZXIgaGl0cyBhbm90aGVyIGtleSB3aXRoaW4gdGhlIHBsYXkgc291bmQgZGVsYXksIHRoZW4KICAgICAgICAgICAgICAqIGNhbmNlbCB0aGUgc291bmQKICAgICAgICAgICAgICAqLwogICAgICAgICAgICAgaWYgKGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfRE9XTiAmJiBrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfVk9MVU1FX1VQCisgICAgICAgICAgICAgICAgICAgICYmIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfTVVURQogICAgICAgICAgICAgICAgICAgICAmJiBtVm9sdW1lS2V5VXBUaW1lICsgVm9sdW1lUGFuZWwuUExBWV9TT1VORF9ERUxBWQogICAgICAgICAgICAgICAgICAgICAgICAgICAgID4gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkpIHsKICAgICAgICAgICAgICAgICAvKgpAQCAtMTY1OSw2ICsxNzc1LDE0IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCisgICAgICAgICAgICAvLyBCYWNrIGNhbmNlbHMgYWN0aW9uIG1vZGVzIGZpcnN0LgorICAgICAgICAgICAgaWYgKG1BY3Rpb25Nb2RlICE9IG51bGwgJiYga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0JBQ0spIHsKKyAgICAgICAgICAgICAgICBpZiAoYWN0aW9uID09IEtleUV2ZW50LkFDVElPTl9VUCkgeworICAgICAgICAgICAgICAgICAgICBtQWN0aW9uTW9kZS5maW5pc2goKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIGZpbmFsIENhbGxiYWNrIGNiID0gZ2V0Q2FsbGJhY2soKTsKICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaGFuZGxlZCA9IGNiICE9IG51bGwgJiYgbUZlYXR1cmVJZCA8IDAgPyBjYi5kaXNwYXRjaEtleUV2ZW50KGV2ZW50KQogICAgICAgICAgICAgICAgICAgICA6IHN1cGVyLmRpc3BhdGNoS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worICAgICAgICAgICAgICAgIG1BY3Rpb25Nb2RlID0gbW9kZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKG1BY3Rpb25Nb2RlVmlldyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChoYXNGZWF0dXJlKEZFQVRVUkVfQUNUSU9OX01PREVfT1ZFUkxBWSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpb25Nb2RlVmlldyA9IG5ldyBBY3Rpb25CYXJDb250ZXh0VmlldyhtQ29udGV4dCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aW9uTW9kZVBvcHVwID0gbmV3IFBvcHVwV2luZG93KG1Db250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpb25Nb2RlUG9wdXAuc2V0TGF5b3V0SW5TY3JlZW5FbmFibGVkKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGlvbk1vZGVQb3B1cC5zZXRDbGlwcGluZ0VuYWJsZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGlvbk1vZGVQb3B1cC5zZXRDb250ZW50VmlldyhtQWN0aW9uTW9kZVZpZXcpOworICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGlvbk1vZGVQb3B1cC5zZXRXaWR0aChNQVRDSF9QQVJFTlQpOworCisgICAgICAgICAgICAgICAgICAgICAgICBUeXBlZFZhbHVlIGhlaWdodFZhbHVlID0gbmV3IFR5cGVkVmFsdWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFRoZW1lKCkucmVzb2x2ZUF0dHJpYnV0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hdHRyLmFjdGlvbkJhclNpemUsIGhlaWdodFZhbHVlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaGVpZ2h0ID0gVHlwZWRWYWx1ZS5jb21wbGV4VG9EaW1lbnNpb25QaXhlbFNpemUoaGVpZ2h0VmFsdWUuZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0RGlzcGxheU1ldHJpY3MoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aW9uTW9kZVBvcHVwLnNldEhlaWdodChoZWlnaHQpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgVmlld1N0dWIgc3R1YiA9IChWaWV3U3R1YikgZmluZFZpZXdCeUlkKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLmFjdGlvbl9tb2RlX2Jhcl9zdHViKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHViICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aW9uTW9kZVZpZXcgPSAoQWN0aW9uQmFyQ29udGV4dFZpZXcpIHN0dWIuaW5mbGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKG1BY3Rpb25Nb2RlVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1vZGUgPSBuZXcgU3RhbmRhbG9uZUFjdGlvbk1vZGUoZ2V0Q29udGV4dCgpLCBtQWN0aW9uTW9kZVZpZXcsIHdyYXBwZWRDYWxsYmFjayk7CisgICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjay5vbkNyZWF0ZUFjdGlvbk1vZGUobW9kZSwgbW9kZS5nZXRNZW51KCkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtb2RlLmludmFsaWRhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpb25Nb2RlVmlldy5pbml0Rm9yTW9kZShtb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpb25Nb2RlVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aW9uTW9kZSA9IG1vZGU7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFjdGlvbk1vZGVQb3B1cCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGlvbk1vZGVQb3B1cC5zaG93QXRMb2NhdGlvbih0aGlzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR3Jhdml0eS5UT1AgfCBHcmF2aXR5LkZJTExfSE9SSVpPTlRBTCwgMCwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aW9uTW9kZSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbUFjdGlvbk1vZGU7CisgICAgICAgIH0KKwogICAgICAgICBwdWJsaWMgdm9pZCBzdGFydENoYW5naW5nKCkgewogICAgICAgICAgICAgbUNoYW5naW5nID0gdHJ1ZTsKICAgICAgICAgfQpAQCAtMjA2MCw2ICsyMjQ2LDQyIEBACiAgICAgICAgICAgICBpZiAoa2VlcE9uKSBQaG9uZVdpbmRvdy50aGlzLmFkZEZsYWdzKFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfS0VFUF9TQ1JFRU5fT04pOwogICAgICAgICAgICAgZWxzZSBQaG9uZVdpbmRvdy50aGlzLmNsZWFyRmxhZ3MoV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19LRUVQX1NDUkVFTl9PTik7C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GUsIGl0ZW0pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkRlc3Ryb3lBY3Rpb25Nb2RlKEFjdGlvbk1vZGUgbW9kZSkgeworICAgICAgICAgICAgICAgIG1XcmFwcGVkLm9uRGVzdHJveUFjdGlvbk1vZGUobW9kZSk7CisgICAgICAgICAgICAgICAgaWYgKG1BY3Rpb25Nb2RlUG9wdXAgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtQWN0aW9uTW9kZVBvcHVwLmRpc21pc3MoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1BY3Rpb25Nb2RlVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1BY3Rpb25Nb2RlVmlldy5zZXRWaXNpYmlsaXR5KEdPTkUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobUFjdGlvbk1vZGVWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGlvbk1vZGVWaWV3LnJlbW92ZUFsbFZpZXdzKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1BY3Rpb25Nb2RlID0gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQogICAgIH0KIAogICAgIHByb3RlY3RlZCBEZWNvclZpZXcgZ2VuZXJhdGVEZWNvcigpIHsKQEAgLTIxMDgsNiArMjMzMCwxNyBAQAogCiAgICAgICAgIGlmIChhLmdldEJvb2xlYW4oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93X3dpbmRvd05vVGl0bGUsIGZhbHNlKSkgewogICAgICAgICAgICAgcmVxdWVzdEZlYXR1cmUoRkVBVFVSRV9OT19USVRMRSk7CisgICAgICAgIH0gZWxzZSBpZiAoYS5nZXRCb29sZWFuKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd193aW5kb3dBY3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NvdXJjZSA9IGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0LmRpYWxvZ190aXRsZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoKGZlYXR1cmVzICYgKDEgPDwgRkVBVFVSRV9BQ1RJT05fQkFSKSkgIT0gMCkgeworICAgICAgICAgICAgICAgIGlmICgoZmVhdHVyZXMgJiAoMSA8PCBGRUFUVVJFX0FDVElPTl9CQVJfT1ZFUkxBWSkpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgbGF5b3V0UmVzb3VyY2UgPSBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmxheW91dC5zY3JlZW5fYWN0aW9uX2Jhcl9vdmVybGF5OworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGxheW91dFJlc291cmNlID0gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQuc2NyZWVuX2FjdGlvbl9iYXI7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBsYXlvdXRSZXNvdXJjZSA9IGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0LnNjcmVlbl90aXRsZTsKICAgICAgICAgICAgIH0KQEAgLTIyNzUsNiArMjUyNSwyMiBAQAogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIG1UaXRsZVZpZXcuc2V0VGV4dChtVGl0bGUpOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUFjdGlvbkJhciA9IChBY3Rpb25CYXJWaWV3KSBmaW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5hY3Rpb25fYmFyKTsKKyAgICAgICAgICAgICAgICBpZiAobUFjdGlvbkJhciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQWN0aW9uQmFyLmdldFRpdGxlKCkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGlvbkJhci5zZXRXaW5kb3dUaXRsZShtVGl0bGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIFBvc3QgdGhlIHBhbmVsIGludmFsaWRhdGUgZm9yIGxhdGVyOyBhdm9pZCBhcHBsaWNhdGlvbiBvbkNyZWF0ZU9wdGlvbnNNZW51CisgICAgICAgICAgICAgICAgICAgIC8vIGJlaW5nIGNhbGxlZCBpbiB0aGUgbWlkZGxlIG9mIG9uQ3JlYXRlIG9yIHNpbWlsYXIuCisgICAgICAgICAgICAgICAgICAgIG1EZWNvci5wb3N0KG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzRGVzdHJveWVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZVBhbmVsTWVudShGRUFUVVJFX0FDVElPTl9CQVIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQpAQCAtMjYyOCw2ICsyODk0LDggQEAKIAogICAgICAgICBib29sZWFuIHJlZnJlc2hEZWNvclZpZXc7CiAKKyAgICAgICAgYm9vbGVhbiByZWZyZXNoTWVudUNvbnRlbnQ7CisgICAgICAgIAogICAgICAgICBib29sZWFuIHdhc0xhc3RPcGVuOwogICAgICAgICAKICAgICAgICAgYm9vbGVhbiB3YXNMYXN0RXhwYW5kZWQ7CkBAIC0yNzUwLDExICszMDE4LDExIEBACiAgICAgICogPGxpPiBDYWxscyBiYWNrIHRvIHRoZSBjYWxsYmFjaydzIG9uT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NDc5LDQ4IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBSdW5uYWJsZSBtUG93ZXJMb25nUHJlc3MgPSBuZXcgUnVubmFibGUoKSB7CisgICAgcHJpdmF0ZSB2b2lkIGludGVyY2VwdFBvd2VyS2V5RG93bihib29sZWFuIGhhbmRsZWQpIHsKKyAgICAgICAgbVBvd2VyS2V5SGFuZGxlZCA9IGhhbmRsZWQ7CisgICAgICAgIGlmICghaGFuZGxlZCkgeworICAgICAgICAgICAgbUhhbmRsZXIucG9zdERlbGF5ZWQobVBvd2VyTG9uZ1ByZXNzLCBWaWV3Q29uZmlndXJhdGlvbi5nZXRHbG9iYWxBY3Rpb25LZXlUaW1lb3V0KCkpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGludGVyY2VwdFBvd2VyS2V5VXAoYm9vbGVhbiBjYW5jZWxlZCkgeworICAgICAgICBpZiAoIW1Qb3dlcktleUhhbmRsZWQpIHsKKyAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtUG93ZXJMb25nUHJlc3MpOworICAgICAgICAgICAgcmV0dXJuICFjYW5jZWxlZDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1Qb3dlcktleUhhbmRsZWQgPSB0cnVlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCBSdW5uYWJsZSBtUG93ZXJMb25nUHJlc3MgPSBuZXcgUnVubmFibGUoKSB7CiAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKLSAgICAgICAgICAgIG1TaG91bGRUdXJuT2ZmT25LZXlVcCA9IGZhbHNlOwotICAgICAgICAgICAgcGVyZm9ybUhhcHRpY0ZlZWRiYWNrTHcobnVsbCwgSGFwdGljRmVlZGJhY2tDb25zdGFudHMuTE9OR19QUkVTUywgZmFsc2UpOwotICAgICAgICAgICAgc2VuZENsb3NlU3lzdGVtV2luZG93cyhTWVNURU1fRElBTE9HX1JFQVNPTl9HTE9CQUxfQUNUSU9OUyk7Ci0gICAgICAgICAgICBzaG93R2xvYmFsQWN0aW9uc0RpYWxvZygpOworICAgICAgICAgICAgaWYgKCFtUG93ZXJLZXlIYW5kbGVkKSB7CisgICAgICAgICAgICAgICAgLy8gVGhlIGNvbnRleHQgaXNuJ3QgcmVhZAorICAgICAgICAgICAgICAgIGlmIChtTG9uZ1ByZXNzT25Qb3dlckJlaGF2aW9yIDwgMCkgeworICAgICAgICAgICAgICAgICAgICBtTG9uZ1ByZXNzT25Qb3dlckJlaGF2aW9yID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0SW50ZWdlcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmludGVnZXIuY29uZmlnX2xvbmdQcmVzc09uUG93ZXJCZWhhdmlvcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHN3aXRjaCAobUxvbmdQcmVzc09uUG93ZXJCZWhhdmlvcikgeworICAgICAgICAgICAgICAgIGNhc2UgTE9OR19QUkVTU19QT1dFUl9OT1RISU5HOgorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIExPTkdfUFJFU1NfUE9XRVJfR0xPQkFMX0FDVElPTlM6CisgICAgICAgICAgICAgICAgICAgIG1Qb3dlcktleUhhbmRsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBwZXJmb3JtSGFwdGljRmVlZGJhY2tMdyhudWxsLCBIYXB0aWNGZWVkYmFja0NvbnN0YW50cy5MT05HX1BSRVNTLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIHNlbmRDbG9zZVN5c3RlbVdpbmRvd3MoU1lTVEVNX0RJQUxPR19SRUFTT05fR0xPQkFMX0FDVElPTlMpOworICAgICAgICAgICAgICAgICAgICBzaG93R2xvYmFsQWN0aW9uc0RpYWxvZygpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIExPTkdfUFJFU1NfUE9XRVJfU0hVVF9PRkY6CisgICAgICAgICAgICAgICAgICAgIG1Qb3dlcktleUhhbmRsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBwZXJmb3JtSGFwdGljRmVlZGJhY2tMdyhudWxsLCBIYXB0aWNGZWVkYmFja0NvbnN0YW50cy5MT05HX1BSRVNTLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIHNlbmRDbG9zZVN5c3RlbVdpbmRvd3MoU1lTVEVNX0RJQUxPR19SRUFTT05fR0xPQkFMX0FDVElPTlMpOworICAgICAgICAgICAgICAgICAgICBTaHV0ZG93blRocmVhZC5zaHV0ZG93bihtQ29udGV4dCwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH07CiAKQEAgLTUwMyw2ICs1NjIsMjcgQEAKICAgICAgKiBDcmVhdGUgKGlmIG5lY2Vzc2FyeSkgYW5kIGxhdW5jaCB0aGUgcmVjZW50IGFwcHMgZGlhbG9nCiAgICAgICovCiAgICAgdm9pZCBzaG93UmVjZW50QXBwc0RpYWxvZygpIHsKKyAgICAgICAgLy8gV2UgY2FuJ3QgaW5pdGlhbGl6ZSB0aGlzIGluIGluaXQoKSBzaW5jZSB0aGUgY29uZmlndXJhdGlvbiBoYXNuJ3QgYmVlbiBsb2FkZWQgeWV0LgorICAgICAgICBpZiAobVVzZTNkUmVjZW50cyA9PSBudWxsKSB7CisgICAgICAgICAgICBtVXNlM2RSZWNlbnRzID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0Qm9vbGVhbihSLmJvb2wuY29uZmlnX2VuYWJsZVJlY2VudEFwcHMzRCk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIFVzZSAzZCBSZWNlbnRzIGRpYWxvZworICAgICAgICBpZiAobVVzZTNkUmVjZW50cykgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCgpOworICAgICAgICAgICAgICAgIGludGVudC5zZXRDbGFzc05hbWUoImNvbS5hbmRyb2lkLnN5c3RlbXVpIiwgCisgICAgICAgICAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuc3lzdGVtdWkuc3RhdHVzYmFyLlJlY2VudEFwcGxpY2F0aW9uc0FjdGl2aXR5Iik7CisgICAgICAgICAgICAgICAgaW50ZW50LnNldEZsYWdzKEludGVudC5GTEFHX0FDVElWSVRZX05FV19UQVNLIAorICAgICAgICAgICAgICAgICAgICAgICAgfCBJbnRlbnQuRkxBR19BQ1RJVklUWV9FWENMVURFX0ZST01fUkVDRU5UUyk7CisgICAgICAgICAgICAgICAgbUNvbnRleHQuc3RhcnRBY3Rpdml0eShpbnRlbnQpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEFjdGl2aXR5Tm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWxlZCB0byBsYXVuY2ggUmVjZW50QXBwc0ludGVudCIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gRmFsbGJhY2sgdG8gZGlhbG9nIGlmIHdlIGZhaWwgdG8gbGF1bmNoIHRoZSBhYm92ZS4KICAgICAgICAgaWYgKG1SZWNlbnRBcHBzRGlhbG9nID09IG51bGwpIHsKICAgICAgICAgICAgIG1SZWNlbnRBcHBzRGlhbG9nID0gbmV3IFJlY2VudEFwcGxpY2F0aW9uc0RpYWxvZyhtQ29udGV4dCk7CiAgICAgICAgIH0KQEAgLTUzNCw2ICs2MTQsNyBAQAogICAgICAgICBtRGVza0RvY2tJbnRlbnQuYWRkQ2F0ZWdvcnkoSW50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XplCiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgdXBkYXRlU2V0dGluZ3MoKSB7CkBAIC04MTUsNiArODk5LDggQEAKICAgICAgICAgICAgIHJldHVybiBUT0FTVF9MQVlFUjsKICAgICAgICAgY2FzZSBUWVBFX1dBTExQQVBFUjoKICAgICAgICAgICAgIHJldHVybiBXQUxMUEFQRVJfTEFZRVI7CisgICAgICAgIGNhc2UgVFlQRV9EUkFHOgorICAgICAgICAgICAgcmV0dXJuIERSQUdfTEFZRVI7CiAgICAgICAgIH0KICAgICAgICAgTG9nLmUoVEFHLCAiVW5rbm93biB3aW5kb3cgdHlwZTogIiArIHR5cGUpOwogICAgICAgICByZXR1cm4gQVBQTElDQVRJT05fTEFZRVI7CkBAIC05OTEsNiArMTA3NywxMSBAQAogICAgICAgICAgICAgICAgICAgICByZXR1cm4gV2luZG93TWFuYWdlckltcGwuQUREX01VTFRJUExFX1NJTkdMRVRPTjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgbVN0YXR1c0JhciA9IHdpbjsKKworICAgICAgICAgICAgICAgIC8vIFRoZSBDb25maWd1cmF0aW9uIHdpbGwgYmUgc3RhYmxlIGJ5IG5vdywgc28gd2UgY2FuIGxvYWQgdGhpcworICAgICAgICAgICAgICAgIG1TdGF0dXNCYXJDYW5IaWRlID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0Qm9vbGVhbigKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYm9vbC5jb25maWdfc3RhdHVzQmFyQ2FuSGlkZSk7CisKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGNhc2UgVFlQRV9TVEFUVVNfQkFSX1BBTkVMOgogICAgICAgICAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbigKQEAgLTEwNDEsMTIgKzExMzIsMjIgQEAKICAgICAgICAgICAgICAgICBj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lcmZhY2UoCisgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuY2hlY2tTZXJ2aWNlKENvbnRleHQuQVVESU9fU0VSVklDRSkpOworICAgICAgICBpZiAoYXVkaW9TZXJ2aWNlID09IG51bGwpIHsKKyAgICAgICAgICAgIExvZy53KFRBRywgIlVuYWJsZSB0byBmaW5kIElBdWRpb1NlcnZpY2UgaW50ZXJmYWNlLiIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBhdWRpb1NlcnZpY2U7CiAgICAgfQogCiAgICAgYm9vbGVhbiBrZXlndWFyZE9uKCkgewpAQCAtMTA2MSw3ICsxMTYyLDcgQEAKICAgICAvKioge0Bpbmhlcml0RG9jfSAqLwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIGludGVyY2VwdEtleUJlZm9yZURpc3BhdGNoaW5nKFdpbmRvd1N0YXRlIHdpbiwgaW50IGFjdGlvbiwgaW50IGZsYWdzLAotICAgICAgICAgICAgaW50IGtleUNvZGUsIGludCBtZXRhU3RhdGUsIGludCByZXBlYXRDb3VudCwgaW50IHBvbGljeUZsYWdzKSB7CisgICAgICAgICAgICBpbnQga2V5Q29kZSwgaW50IHNjYW5Db2RlLCBpbnQgbWV0YVN0YXRlLCBpbnQgcmVwZWF0Q291bnQsIGludCBwb2xpY3lGbGFncykgewogICAgICAgICBmaW5hbCBib29sZWFuIGtleWd1YXJkT24gPSBrZXlndWFyZE9uKCk7CiAgICAgICAgIGZpbmFsIGJvb2xlYW4gZG93biA9IChhY3Rpb24gPT0gS2V5RXZlbnQuQUNUSU9OX0RPV04pOwogICAgICAgICBmaW5hbCBib29sZWFuIGNhbmNlbGVkID0gKChmbGFncyAmIEtleUV2ZW50LkZMQUdfQ0FOQ0VMRUQpICE9IDApOwpAQCAtMTA5NCwxMSArMTE5NSw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbmQgaGlzIE9OTFkgb3B0aW9ucyBhcmUgdG8gYW5zd2VyIG9yIHJlamVjdCB0aGUgY2FsbC4pCiAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGluY29taW5nUmluZ2luZyA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJVGVsZXBob255IHBob25lU2VydiA9IGdldFBob25lSW50ZXJmYWNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBob25lU2VydiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluY29taW5nUmluZ2luZyA9IHBob25lU2Vydi5pc1JpbmdpbmcoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJVbmFibGUgdG8gZmluZCBJVGVsZXBob255IGludGVyZmFjZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIElUZWxlcGhvbnkgdGVsZXBob255U2VydmljZSA9IGdldFRlbGVwaG9ueVNlcnZpY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGVsZXBob255U2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluY29taW5nUmluZ2luZyA9IHRlbGVwaG9ueVNlcnZpY2UuaXNSaW5naW5nKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiUmVtb3RlRXhjZXB0aW9uIGZyb20gZ2V0UGhvbmVJbnRlcmZhY2UoKSIsIGV4KTsKQEAgLTEyNDksMTAgKzEzNDgsMTEgQEAKICAgICBwdWJsaWMgdm9pZCBnZXRDb250ZW50SW5zZXRIaW50THcoV2luZG93TWFuYWdlci5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UggPSBkaXNwbGF5SGVpZ2h0OworICAgICAgICBtU2NyZWVuTGVmdCA9IG1TY3JlZW5Ub3AgPSAwOworICAgICAgICBtU2NyZWVuV2lkdGggPSBkaXNwbGF5V2lkdGg7CisgICAgICAgIG1TY3JlZW5IZWlnaHQgPSBkaXNwbGF5SGVpZ2h0OwogICAgICAgICBtRG9ja0xlZnQgPSBtQ29udGVudExlZnQgPSBtQ3VyTGVmdCA9IDA7CiAgICAgICAgIG1Eb2NrVG9wID0gbUNvbnRlbnRUb3AgPSBtQ3VyVG9wID0gMDsKICAgICAgICAgbURvY2tSaWdodCA9IG1Db250ZW50UmlnaHQgPSBtQ3VyUmlnaHQgPSBkaXNwbGF5V2lkdGg7CkBAIC0xMjgyLDE1ICsxMzgzLDQwIEBACiAgICAgICAgICAgICBpZiAobVN0YXR1c0Jhci5pc1Zpc2libGVMdygpKSB7CiAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHN0YXR1cyBiYXIgaXMgaGlkZGVuLCB3ZSBkb24ndCB3YW50IHRvIGNhdXNlCiAgICAgICAgICAgICAgICAgLy8gd2luZG93cyBiZWhpbmQgaXQgdG8gc2Nyb2xsLgotICAgICAgICAgICAgICAgIG1Eb2NrVG9wID0gbUNvbnRlbnRUb3AgPSBtQ3VyVG9wID0gbVN0YXR1c0Jhci5nZXRGcmFtZUx3KCkuYm90dG9tOwotICAgICAgICAgICAgICAgIGlmIChERUJVR19MQVlPVVQpIExvZy52KFRBRywgIlN0YXR1cyBiYXI6IG1Eb2NrQm90dG9tPSIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgbURvY2tCb3R0b20gKyAiIG1Db250ZW50Qm90dG9tPSIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgbUNvbnRlbnRCb3R0b20gKyAiIG1DdXJCb3R0b209IiArIG1DdXJCb3R0b20pOworICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgciA9IG1TdGF0dXNCYXIuZ2V0RnJhbWVMdygpOworICAgICAgICAgICAgICAgIGlmIChtU3RhdHVzQmFyQ2FuSGlkZSkgeworICAgICAgICAgICAgICAgICAgICAvLyBTdGF0dXMgYmFyIG1heSBnbyBhd2F5LCBzbyB0aGUgc2NyZWVuIGFyZWEgaXQgb2NjdXBpZXMKKyAgICAgICAgICAgICAgICAgICAgLy8gaXMgYXZhaWxhYmxlIHRvIGFwcHMgYnV0IGp1c3QgY292ZXJpbmcgdGhlbSB3aGVuIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBzdGF0dXMgYmFyIGlzIHZpc2libGUuCisgICAgICAgICAgICAgICAgICAgIGlmIChtRG9ja1RvcCA9PSByLnRvcCkgbURvY2tUb3AgPSByLmJvdHRvbTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAobURvY2tCb3R0b20gPT0gci5ib3R0b20pIG1Eb2NrQm90dG9tID0gci50b3A7CisgICAgICAgICAgICAgICAgICAgIG1Db250ZW50VG9wID0gbUN1clRvcCA9IG1Eb2NrVG9wOworICAgICAgICAgICAgICAgICAgICBtQ29udGVudEJvdHRvbSA9IG1DdXJCb3R0b20gPSBtRG9ja0JvdHRvbTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0xBWU9VVCkgTG9nLnYoVEFHLCAiU3RhdHVzIGJhcjogbURvY2tUb3A9IiArIG1Eb2NrVG9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1Db250ZW50VG9wPSIgKyBtQ29udGVudFRvcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtQ3VyVG9wPSIgKyBtQ3VyVG9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1Eb2NrQm90dG9tPSIgKyBtRG9ja0JvdHRvbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtQ29udGVudEJvdHRvbT0iICsgbUNvbnRlbnRCb3R0b20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbUN1ckJvdHRvbT0iICsgbUN1ckJvdHRvbSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU3RhdHVzIGJhciBjYW4ndCBnbyBhd2F5OyB0aGUgcGFydCBvZiB0aGUgc2NyZWVuIGl0CisgICAgICAgICAgICAgICAgICAgIC8vIGNvdmVycyBkb2VzIG5vdCBleGlzdCBmb3IgYW55dGhpbmcgYmVoaW5kIGl0LgorICAgICAgICAgICAgICAgICAgICBpZiAobVNjcmVlblRvcCA9PSByLnRvcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVNjcmVlblRvcCA9IHIuYm90dG9tOworICAgICAgICAgICAgICAgICAgICAgICAgbVNjcmVlbkhlaWdodCAtPSAoci5ib3R0b20tci50b3ApOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChtU2NyZWVuSGVpZ2h0LW1TY3JlZW5Ub3ApID09IHIuYm90dG9tKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtU2NyZWVuSGVpZ2h0IC09IChyLmJvdHRvbS1yLnRvcCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbUNvbnRlbnRUb3AgPSBtQ3VyVG9wID0gbURvY2tUb3AgPSBtU2NyZWVuVG9wOworICAgICAgICAgICAgICAgICAgICBtQ29udGVudEJvdHRvbSA9IG1DdXJCb3R0b20gPSBtRG9ja0JvdHRvbSA9IG1TY3JlZW5Ub3ArbVNjcmVlbkhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0xBWU9VVCkgTG9nLnYoVEFHLCAiU3RhdHVzIGJhcjogbVNjcmVlblRvcD0iICsgbVNjcmVlblRvcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtU2NyZWVuSGVpZ2h0PSIgKyBtU2NyZWVuSGVpZ2h0KTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKLSAgICB2b2lkIHNldEF0d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ICAgICAgICAgICAgc2V0QXR0YWNoZWRXaW5kb3dGcmFtZXMod2luLCBmbCwgc2ltLCBhdHRhY2hlZCwgdHJ1ZSwgcGYsIGRmLCBjZiwgdmYpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHBmLmxlZnQgPSBkZi5sZWZ0ID0gMDsKLSAgICAgICAgICAgICAgICAgICAgcGYudG9wID0gZGYudG9wID0gMDsKLSAgICAgICAgICAgICAgICAgICAgcGYucmlnaHQgPSBkZi5yaWdodCA9IG1XOwotICAgICAgICAgICAgICAgICAgICBwZi5ib3R0b20gPSBkZi5ib3R0b20gPSBtSDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChzaW0gJiBTT0ZUX0lOUFVUX01BU0tfQURKVVNUKSAhPSBTT0ZUX0lOUFVUX0FESlVTVF9SRVNJWkUpIHsKKyAgICAgICAgICAgICAgICAgICAgcGYubGVmdCA9IGRmLmxlZnQgPSBtU2NyZWVuTGVmdDsKKyAgICAgICAgICAgICAgICAgICAgcGYudG9wID0gZGYudG9wID0gbVNjcmVlblRvcDsKKyAgICAgICAgICAgICAgICAgICAgcGYucmlnaHQgPSBkZi5yaWdodCA9IG1TY3JlZW5MZWZ0K21TY3JlZW5XaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgcGYuYm90dG9tID0gZGYuYm90dG9tID0gbVNjcmVlblRvcCttU2NyZWVuSGVpZ2h0OworICAgICAgICAgICAgICAgICAgICBpZiAoYWRqdXN0ICE9IFNPRlRfSU5QVVRfQURKVVNUX1JFU0laRSkgewogICAgICAgICAgICAgICAgICAgICAgICAgY2YubGVmdCA9IG1Eb2NrTGVmdDsKICAgICAgICAgICAgICAgICAgICAgICAgIGNmLnRvcCA9IG1Eb2NrVG9wOwogICAgICAgICAgICAgICAgICAgICAgICAgY2YucmlnaHQgPSBtRG9ja1JpZ2h0OwpAQCAtMTM5NywyNiArMTUyNCwzNCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgY2YucmlnaHQgPSBtQ29udGVudFJpZ2h0OwogICAgICAgICAgICAgICAgICAgICAgICAgY2YuYm90dG9tID0gbUNvbnRlbnRCb3R0b207CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdmYubGVmdCA9IG1DdXJMZWZ0OwotICAgICAgICAgICAgICAgICAgICB2Zi50b3AgPSBtQ3VyVG9wOwotICAgICAgICAgICAgICAgICAgICB2Zi5yaWdodCA9IG1DdXJSaWdodDsKLSAgICAgICAgICAgICAgICAgICAgdmYuYm90dG9tID0gbUN1ckJvdHRvbTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFkanVzdCAhPSBTT0ZUX0lOUFVUX0FESlVTVF9OT1RISU5HKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2Zi5sZWZ0ID0gbUN1ckxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICB2Zi50b3AgPSBtQ3VyVG9wOworICAgICAgICAgICAgICAgICAgICAgICAgdmYucmlnaHQgPSBtQ3VyUmlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICB2Zi5ib3R0b20gPSBtQ3VyQm90dG9tOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgdmYuc2V0KGNmKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGZsICYgRkxBR19MQVlPVVRfSU5fU0NSRUVOKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgLy8gQSB3aW5kb3cgdGhhdCBoYXMgcmVxdWVzdGVkIHRvIGZpbGwgdGhlIGVudGlyZSBzY3JlZW4ganVzdAogICAgICAgICAgICAgICAgIC8vIGdldHMgZXZlcnl0aGluZywgcGVyaW9kLgotICAgICAgICAgICAgICAgIHBmLmxlZnQgPSBkZi5sZWZ0ID0gY2YubGVmdCA9IDA7Ci0gICAgICAgICAgICAgICAgcGYudG9wID0gZGYudG9wID0gY2YudG9wID0gMDsKLSAgICAgICAgICAgICAgICBwZi5yaWdodCA9IGRmLnJpZ2h0ID0gY2YucmlnaHQgPSBtVzsKLSAgICAgICAgICAgICAgICBwZi5ib3R0b20gPSBkZi5ib3R0b20gPSBjZi5ib3R0b20gPSBtSDsKLSAgICAgICAgICAgICAgICB2Zi5sZWZ0ID0gbUN1ckxlZnQ7Ci0gICAgICAgICAgICAgICAgdmYudG9wID0gbUN1clRvcDsKLSAgICAgICAgICAgICAgICB2Zi5yaWdodCA9IG1DdXJSaWdodDsKLSAgICAgICAgICAgICAgICB2Zi5ib3R0b20gPSBtQ3VyQm90dG9tOworICAgICAgICAgICAgICAgIHBmLmxlZnQgPSBkZi5sZWZ0ID0gY2YubGVmdCA9IG1TY3JlZW5MZWZ0OworICAgICAgICAgICAgICAgIHBmLnRvcCA9IGRmLnRvcCA9IGNmLnRvcCA9IG1TY3JlZW5Ub3A7CisgICAgICAgICAgICAgICAgcGYucmlnaHQgPSBkZi5yaWdodCA9IGNmLnJpZ2h0ID0gbVNjcmVlbkxlZnQrbVNjcmVlbldpZHRoOworICAgICAgICAgICAgICAgIHBmLmJvdHRvbSA9IGRmLmJvdHRvbSA9IGNmLmJvdHRvbSA9IG1TY3JlZW5Ub3ArbVNjcmVlbkhlaWdodDsKKyAgICAgICAgICAgICAgICBpZiAoYWRqdXN0ICE9IFNPRlRfSU5QVVRfQURKVVNUX05PVEhJTkcpIHsKKyAgICAgICAgICAgICAgICAgICAgdmYubGVmdCA9IG1DdXJMZWZ0OworICAgICAgICAgICAgICAgICAgICB2Zi50b3AgPSBtQ3VyVG9wOworICAgICAgICAgICAgICAgICAgICB2Zi5yaWdodCA9IG1DdXJSaWdodDsKKyAgICAgICAgICAgICAgICAgICAgdmYuYm90dG9tID0gbUN1ckJvdHRvbTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB2Zi5zZXQoY2YpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSBpZiAoYXR0YWNoZWQgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIC8vIEEgY2hpbGQgd2luZG93IHNob3VsZCBiZSBwbGFjZWQgaW5zaWRlIG9mIHRoZSBzYW1lIHZpc2libGUKICAgICAgICAgICAgICAgICAvLyBmcmFtZSB0aGF0IGl0cyBwYXJlbnQgaGFkLgotICAgICAgICAgICAgICAgIHNldEF0dGFjaGVkV2luZG93RnJhbWVzKHdpbiwgZmwsIHNpbSwgYXR0YWNoZWQsIGZhbHNlLCBwZiwgZGYsIGNmLCB2Zik7CisgICAgICAgICAgICAgICAgc2V0QXR0YWNoZWRXaW5kb3dGcmFtZXMod2luLCBmbCwgYWRqdXN0LCBhdHRhY2hlZCwgZmFsc2UsIHBmLCBkZiwgY2YsIHZmKTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgLy8gT3RoZXJ3aXNlLCBhIG5vcm1hbCB3aW5kb3cgbXVzdCBiZSBwbGFjZWQgaW5zaWRlIHRoZSBjb250ZW50CiAgICAgICAgICAgICAgICAgLy8gb2YgYWxsIHNjcmVlbiBkZWNvcmF0aW9ucy4KQEAgLTE0MjQsNyArMTU1OSw3IEBACiAgICAgICAgICAgICAgICAgcGYudG9wID0gbUNvbnRlbnRUb3A7CiAgICAgICAgICAgICAgICAgcGYucmlnaHQgPSBtQ29udGVudFJpZ2h0OwogICAgICAgICAgICAgICAgIHBmLmJvdHRvbSA9IG1Db250ZW50Qm90dG9tOwotICAgICAgICAgICAgICAgIGlmICgoc2ltICYgU09GVF9JTlBVVF9NQVNLX0FESlVTVCkgIT0gU09GVF9JTlBVVF9BREpVU1RfUkVTSVpFKSB7CisgICAgICAgICAgICAgICAgaWYgKGFkanVzdCAhPSBTT0ZUX0lOUFVUX0FESlVTVF9SRVNJWkUpIHsKICAgICAgICAgICAgICAgICAgICAgZGYubGVmdCA9IGNmLmxlZnQgPSBtRG9ja0xlZnQ7CiAgICAgICAgICAgICAgICAgICAgIGRmLnRvcCA9IGNmLnRvcCA9IG1Eb2NrVG9wOwogICAgICAgICAgICAgICAgICAgICBkZi5yaWdodCA9IGNmLnJpZ2h0ID0gbURvY2tSaWdodDsKQEAgLTE0MzUsMTAgKzE1NzAsMTQgQEAKICAgICAgICAgICAgICAgICAgICAgZGYucmlnaHQgPSBjZi5yaWdodCA9IG1Db250ZW50UmlnaHQ7CiAgICAgICAgICAgICAgICAgICAgIGRmLmJvdHRvbSA9IGNmLmJvdHRvbSA9IG1Db250ZW50Qm90dG9tOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB2Zi5sZWZ0ID0gbUN1ckxlZnQ7Ci0gICAgICAgICAgICAgICAgdmYudG9wID0gbUN1clRvcDsKLSAgICAgICAgICAgICAgICB2Zi5yaWdodCA9IG1DdXJSaWdodDsKLSAgICAgICAgICAgICAgICB2Zi5ib3R0b20gPSBtQ3VyQm90dG9tOworICAgICAgICAgICAgICAgIGlmIChhZGp1c3QgIT0gU09GVF9JTlBVVF9BREpVU1RfTk9USElORykgeworICAgICAgICAgICAgICAgICAgICB2Zi5sZWZ0ID0gbUN1ckxlZnQ7CisgICAgICAgICAgICAgICAgICAgIHZmLnRvcCA9IG1DdXJUb3A7CisgICAgICAgICAgICAgICAgICAgIHZmLnJpZ2h0ID0gbUN1clJpZ2h0OworICAgICAgICAgICAgICAgICAgICB2Zi5ib3R0b20gPSBtQ3VyQm90dG9tOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHZmLnNldChjZik7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIApAQCAtMTUzMSw4ICsxNjcwLDEyIEBACiAgICAgLyoqIHtAaW5oZXJpdERvY30gKi8KICAgICBwdWJsaWMgaW50IGZpbmlzaEFuaW1hdGlvbkx3KCkgewogICAgICAgICBpbnQgY2hhbmdlcyA9IDA7Ci0gICAgICAgIAotICAgICAgICBib29sZWFuIGhpZGluZyA9IGZhbHNlOworICAgICAgICBib29sZWFuIHRvcElzRnVsbHNjcmVlbiA9IGZhbHNlOworCisgICAgICAgIGZpbmFsIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIGxwID0gKG1Ub3BGdWxsc2NyZWVuT3BhcXVlV2luZG93U3RhdGUgIT0gbnVsbCkKKyAgICAgICAgICAgICAgICA/IG1Ub3BGdWxsc2NyZWVuT3BhcXVlV2luZG93U3RhdGUuZ2V0QXR0cnMoKQorICAgICAgICAgICAgICAgIDogbnVsbDsKKwogICAgICAgICBpZiAobVN0YXR1c0JhciAhPSBudWxsKSB7CiAgICAgICAgICAgICBpZiAobG9jYWxMT0dWKSBMb2cuaShUQUcsICJmb3JjZT0iICsgbUZvcmNlU3RhdHVzQmFyCiAgICAgICAgICAgICAgICAgICAgICsgIiB0b3A9IiArIG1Ub3BGdWxsc2NyZWVuT3BhcXVlV2luZG93U3RhdGUpOwpAQCAtMTU0MCwzOSArMTY4Myw4MiBAQAogICAgICAgICAgICAgICAgIGlmIChERUJVR19MQVlPVVQpIExvZy52KFRBRywgIlNob3dpbmcgc3RhdHVzIGJhciIpOwogICAgICAgICAgICAgICAgIGlmIChtU3RhdHVzQmFyLnNob3dMdyh0cnVlKSkgY2hhbmdlcyB8PSBGSU5JU0hfTEFZT1VUX1JFRE9fTEFZT1VUOwogICAgICAgICAgICAgfSBlbHNlIGlmIChtVG9wRnVsbHNjcmVlbk9wYXF1ZVdpbmRvd1N0YXRlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAvL0xvZy5pKFRBRywgImZyYW1lOiAiICsgbVRvcEZ1bGxzY3JlZW5PcGFxdWVXaW5kb3dTdGF0ZS5nZXRGcmFtZUx3KCkKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgKyAiIHNob3duIGZyYW1lOiAiICsgbVRvcEZ1bGxzY3JlZW5PcGFxdWVXaW5kb3dTdGF0ZS5nZXRTaG93bkZyYW1lTHcoKSk7Ci0gICAgICAgICAgICAgICAgLy9Mb2cuaShUQUcsICJhdHRyOiAiICsgbVRvcEZ1bGxzY3JlZW5PcGFxdWVXaW5kb3dTdGF0ZS5nZXRBdHRycygpKTsKLSAgICAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcyBscCA9Ci0gICAgICAgICAgICAgICAgICAgIG1Ub3BGdWxsc2NyZWVuT3BhcXVlV2luZG93U3RhdGUuZ2V0QXR0cnMoKTsKLSAgICAgICAgICAgICAgICBib29sZWFuIGhpZGVTdGF0dXNCYXIgPQotICAgICAgICAgICAgICAgICAgICAobHAuZmxhZ3MgJiBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5GTEFHX0ZVTExTQ1JFRU4pICE9IDA7Ci0gICAgICAgICAgICAgICAgaWYgKGhpZGVTdGF0dXNCYXIpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0xBWU9VVCkgTG9nLnYoVEFHLCAiSGlkaW5nIHN0YXR1cyBiYXIiKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1TdGF0dXNCYXIuaGlkZUx3KHRydWUpKSBjaGFuZ2VzIHw9IEZJTklTSF9MQVlPVVRfUkVET19MQVlPVVQ7Ci0gICAgICAgICAgICAgICAgICAgIGhpZGluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGxvY2FsTE9HVikgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJmcmFtZTogIiArIG1Ub3BGdWxsc2NyZWVuT3BhcXVlV2luZG93U3RhdGUuZ2V0RnJhbWVMdygpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHNob3duIGZyYW1lOiAiICsgbVRvcEZ1bGxzY3JlZW5PcGFxdWVXaW5kb3dTdGF0ZS5nZXRTaG93bkZyYW1lTHcoKSk7CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImF0dHI6ICIgKyBtVG9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pZiAobG9jYWxMT0dWKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJQcmV2ZW50aW5nIHN0YXR1cyBiYXIgZnJvbSBoaWRpbmcgYnkgcG9saWN5Iik7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfTEFZT1VUKSBMb2cudihUQUcsICJTaG93aW5nIHN0YXR1cyBiYXIiKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKG1TdGF0dXNCYXIuc2hvd0x3KHRydWUpKSBjaGFuZ2VzIHw9IEZJTklTSF9MQVlPVVRfUkVET19MQVlPVVQ7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBpZiAoY2hhbmdlcyAhPSAwICYmIGhpZGluZykgewotICAgICAgICAgICAgSVN0YXR1c0JhclNlcnZpY2Ugc2JzID0gSVN0YXR1c0JhclNlcnZpY2UuU3R1Yi5hc0ludGVyZmFjZShTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKCJzdGF0dXNiYXIiKSk7Ci0gICAgICAgICAgICBpZiAoc2JzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdGhlIHdpbmRvdyBzaGFkZSBpcyBoaWRkZW4uCi0gICAgICAgICAgICAgICAgICAgIHNicy5jb2xsYXBzZSgpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQorCisgICAgICAgIGJvb2xlYW4gdG9wTmVlZHNNZW51ID0gbVNob3dNZW51S2V5OworICAgICAgICBpZiAobHAgIT0gbnVsbCkgeworICAgICAgICAgICAgdG9wTmVlZHNNZW51ID0gKGxwLmZsYWdzICYgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19ORUVEU19NRU5VX0tFWSkgIT0gMDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChERUJVR19MQVlPVVQpIExvZy52KFRBRywgIlRvcCB3aW5kb3cgIiAKKyAgICAgICAgICAgICAgICArICh0b3BOZWVkc01lbnUgPyAibmVlZHMiIDogImRvZXMgbm90IG5lZWQiKQorICAgICAgICAgICAgICAgICsgIiB0aGUgTUVOVSBrZXkiKTsKKworICAgICAgICBmaW5hbCBib29sZWFuIGNoYW5nZWRGdWxsc2NyZWVuID0gKG1Ub3BJc0Z1bGxzY3JlZW4gIT0gdG9wSXNGdWxsc2NyZWVuKTsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBjaGFuZ2VkTWVudSA9ICh0b3BOZWVkc01lbnUgIT0gbVNob3dNZW51S2V5KTsKKworICAgICAgICBpZiAoY2hhbmdlZEZ1bGxzY3JlZW4gfHwgY2hhbmdlZE1lbnUpIHsKKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gdG9wSXNGdWxsc2NyZWVuRiA9IHRvcElzRnVsbHNjcmVlbjsKKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gdG9wTmVlZHNNZW51RiA9IHRvcE5lZWRzTWVudTsKKworICAgICAgICAgICAgbVRvcElzRnVsbHNjcmVlbiA9IHRvcElzRnVsbHNjcmVlbjsKKyAgICAgICAgICAgIG1TaG93TWVudUtleSA9IHRvcE5lZWRzTWVudTsKKworICAgICAgICAgICAgbUhhbmRsZXIucG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU3RhdHVzQmFyU2VydmljZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBpcyB0aGUgb25lIHRoYXQgY2FuIG5vdCBnbyBhd2F5LCBidXQgaXQgZG9lc24ndCBjb21lIHVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmVmb3JlIHRoZSB3aW5kb3cgbWFuYWdlciBkb2VzLCBzbyBkb24ndCBmYWlsIGlmIGl0IGRvZXNuJ3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBleGlzdC4gVGhpcyB3b3JrcyBhcyBsb25nIGFzIG5vIGZ1bGxzY3JlZW4gd2luZG93cyBjb21lIHVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmVmb3JlIHRoZSBzdGF0dXMgYmFyIHNlcnZpY2UgZG9lcy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhdHVzQmFyU2VydmljZSA9IElTdGF0dXNCYXJTZXJ2aWNlLlN0dWIuYXNJbnRlcmZhY2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKCJzdGF0dXNiYXIiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBJU3RhdHVzQmFyU2VydmljZSBzYnMgPSBtU3RhdHVzQmFyU2VydmljZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU3RhdHVzQmFyU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoYW5nZWRGdWxsc2NyZWVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnMuc2V0QWN0aXZlV2luZG93SXNGdWxsc2NyZWVuKHRvcElzRnVsbHNjcmVlbkYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGFuZ2VkTWVudSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JzLnNldE1lbnVLZXlWaXNpYmxlKHRvcE5lZWRzTWVudUYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBzaG91bGQgYmUgaW1wb3NzaWJsZSBiZWNhdXNlIHdlJ3JlIGluIHRoZSBzYW1lIHByb2Nlc3MuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TdGF0dXNCYXJTZXJ2aWNlID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgfQogCiAgICAgICAgIC8vIEhpZGUgdGhlIGtleSBndWFyZCBpZiBhIHZpc2libGUgd2luZG93IGV4cGxpY2l0bHkgc3BlY2lmaWVzIHRoYXQgaXQgd2FudHMgdG8gYmUgZGlzcGxheWVkCiAgICAgICAgIC8vIHdoZW4gdGhlIHNjcmVlbiBpcyBsb2NrZWQKICAgICAgICAgaWYgKG1LZXlndWFyZCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBpZiAobG9jYWxMT0dWKSBMb2cudihUQUcsICJmaW5pc2hMYXlvdXRMdzo6bUhpZGVLZXlndWFyZD0iK21IaWRlTG9ja1NjcmVlbik7CisgICAgICAgICAgICBpZiAobG9jYWxMT0dWKSBMb2cudihUQUcsICJmaW5pc2hBbmltYXRpb25Mdzo6bUhpZGVLZXlndWFyZD0iK21IaWRlTG9ja1NjcmVlbik7CiAgICAgICAgICAgICBpZiAobURpc21pc3NLZXlndWFyZCAmJiAhbUtleWd1YXJkTWVkaWF0b3IuaXNTZWN1cmUoKSkgewogICAgICAgICAgICAgICAgIGlmIChtS2V5Z3VhcmQuaGlkZUx3KHRydWUpKSB7CiAgICAgICAgICAgICAgICAgICAgIGNoYW5nZXMgfD0gRklOSVNIX0xBWU9VVF9SRURPX0xBWU9VVApAQCAtMTYyMiw5ICsxODA4LDkgQEAKICAgICAgICAgICAgICAgICAgICAgcmVjdC51bmlvbih3LmdldFNob3duRnJhbWVMdygpKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBmaW5hbCBpbnQgaW5zZXR3ID0gbVcvMTA7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgaW5zZXRoID0gbUgvMTA7Ci0gICAgICAgICAgICBpZiAocmVjdC5jb250YWlucyhpbnNldHcsIGluc2V0aCwgbVctaW5zZXR3LCBtSC1pbnNldGgpKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgaW5zZXR3ID0gbVNjcmVlbldpZHRoLzEwOworICAgICAgICAgICAgZmluYWwgaW50IGluc2V0aCA9IG1TY3JlZW5IZWlnaHQvMTA7CisgICAgICAgICAgICBpZiAocmVjdC5jb250YWlucyhpbnNldHcsIGluc2V0aCwgbVNjcmVlbldpZHRoLWluc2V0dywgbVNjcmVlbkhlaWdodC1pbnNldGgpKSB7CiAgICAgICAgICAgICAgICAgLy8gQWxsIG9mIHRoZSBzdGF0dXMgYmFyIHdpbmRvd3MgcHV0IHRvZ2V0aGVyIGNvdmVyIHRoZQogICAgICAgICAgICAgICAgIC8vIHNjcmVlbiwgc28gdGhlIGFwcCBjYW4ndCBiZSBzZWVuLiAgKE5vdGUgdGhpcyB0ZXN0IGRvZXNuJ3QKICAgICAgICAgICAgICAgICAvLyB3b3JrIGlmIHRoZSByZWN0cyBvZiB0aGVzZSB3aW5kb3dzIGFyZSBhdCBvZmYgb2Zmc2V0cyBvcgpAQCAtMTY2NywyMyArMTg1Myw2IEBACiAgICAgfQogCiAgICAgLyoqCi0gICAgICogQHJldHVybiBXaGV0aGVyIGEgdGVsZXBob25lIGNhbGwgaXMgaW4gcHJvZ3Jlc3MgcmlnaHQgbm93LgotICAgICAqLwotICAgIGJvb2xlYW4gaXNJbkNhbGwoKSB7Ci0gICAgICAgIGZpbmFsIElUZWxlcGhvbnkgcGhvbmUgPSBnZXRQaG9uZUludGVyZmFjZSgpOwotICAgICAgICBpZiAocGhvbmUgPT0gbnVsbCkgewotICAgICAgICAgICAgTG9nLncoVEFHLCAiY291bGRuJ3QgZ2V0IElUZWxlcGhvbnkgcmVmZXJlbmNlIik7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBwaG9uZS5pc09mZmhvb2soKTsKLSAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgIklUZWxlcGhvbnkuaXNPZmZoaG9vayB0aHJldyBSZW1vdGVFeGNlcHRpb24gIiArIGUpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCiAgICAgICogQHJldHVybiBXaGV0aGVyIG11c2ljIGlzIGJlaW5nIHBsYXllZCByaWdodCBub3cuCiAgICAgICovCiAgICAgYm9vbGVhbiBpc011c2ljQWN0aXZlKCkgewpAQCAtMTcwMCwxNyArMTg2OSwxNyBAQAogICAgICAqIEBwYXJhbSBrZXljb2RlCiAgICAgICovCiAgICAgdm9pZCBoYW5kbGVWb2x1bWVLZXkoaW50IHN0cmVhbSwgaW50IGtleWNvZGUpIHsKLSAgICAgICAgZmluYWwgSUF1ZGlvU2VydmljZSBhdWRpbyA9IGdldEF1ZGlvSW50ZXJmYWNlKCk7Ci0gICAgICAgIGlmIChhdWRpbyA9PSBudWxsKSB7Ci0gICAgICAgICAgICBMb2cudyhUQUcsICJoYW5kbGVWb2x1bWVLZXk6IGNvdWxkbid0IGdldCBJQXVkaW9TZXJ2aWNlIHJlZmVyZW5jZSIpOworICAgICAgICBJQXVkaW9TZXJ2aWNlIGF1ZGlvU2VydmljZSA9IGdldEF1ZGlvU2VydmljZSgpOworICAgICAgICBpZiAoYXVkaW9TZXJ2aWNlID09IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogICAgICAgICB0cnkgewogICAgICAgICAgICAgLy8gc2luY2UgYXVkaW8gaXMgcGxheWluZywgd2Ugc2hvdWxkbid0IGhhdmUgdG8gaG9sZCBhIHdha2UgbG9jawogICAgICAgICAgICAgLy8gZHVyaW5nIHRoZSBjYWxsLCBidXQgd2UgZG8gaXQgYXMgYSBwcmVjYXV0aW9uIGZvciB0aGUgcmFyZSBwb3NzaWJpbGl0eQogICAgICAgICAgICAgLy8gdGhhdCB0aGUgbXVzaWMgc3RvcHMgcmlnaHQgYmVmb3JlIHdlIGNhbGwgdGhpcworICAgICAgICAgICAgLy8gVE9ETzogQWN0dWFsbHkgaGFuZGxlIE1VVEUuCiAgICAgICAgICAgICBtQnJvYWRjYXN0V2FrZUxvY2suYWNxdWlyZSgpOwotICAgICAgICAgICAgYXVkaW8uYWRqdXN0U3RyZWFtVm9sdW1lKHN0cmVhbSwKKyAgICAgICAgICAgIGF1ZGlvU2VydmljZS5hZGp1c3RTdHJlYW1Wb2x1bWUoc3RyZWFtLAogICAgICAgICAgICAgICAgIGtleWNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfVVAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEF1ZGlvTWFuYWdlci5BREpVU1RfUkFJU0UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IEF1ZGlvTWFuYWdlci5BREpVU1RfTE9XRVIsCkBAIC0xNzIxLDM5ICsxODkwLDE1IEBACiAgICAgICAgICAgICBtQnJvYWRjYXN0V2FrZUxvY2sucmVsZWFzZSgpOwogICAgICAgICB9CiAgICAgfQotICAgIAotICAgIHN0YXRpYyBib29sZWFuIGlzTWVkaWFLZXkoaW50IGNvZGUpIHsKLSAgICAgICAgaWYgKGNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9IRUFEU0VUSE9PSyB8fCAKLSAgICAgICAgICAgICAgICBjb2RlID09IEtleUV2ZW50LktFWUNPREVfTUVESUFfUExBWV9QQVVTRSB8fAotICAgICAgICAgICAgICAgIGNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9TVE9QIHx8IAotICAgICAgICAgICAgICAgIGNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9ORVhUIHx8Ci0gICAgICAgICAgICAgICAgY29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BSRVZJT1VTIHx8IAotICAgICAgICAgICAgICAgIGNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9SRVdJTkQgfHwKLSAgICAgICAgICAgICAgICBjb2RlID09IEtleUV2ZW50LktFWUNPREVfTUVESUFfRkFTVF9GT1JXQVJEKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gZmFsc2U7ICAgIAotICAgIH0KLSAKKwogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCiAgICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGludCBpbnRlcmNlcHRLZXlCZWZvcmVRdWV1ZWluZyhsb25nIHdoZW5OYW5vcywgaW50IGtleUNvZGUsIGJvb2xlYW4gZG93biwKLSAgICAgICAgICAgIGludCBwb2xpY3lGbGFncywgYm9vbGVhbiBpc1NjcmVlbk9uKSB7Ci0gICAgICAgIGludCByZXN1bHQgPSBBQ1RJT05fUEFTU19UT19VU0VSOworICAgIHB1YmxpYyBpbnQgaW50ZXJjZXB0S2V5QmVmb3JlUXVldWVpbmcobG9uZyB3aGVuTmFub3MsIGludCBhY3Rpb24sIGludCBmbGFncywKKyAgICAgICAgICAgIGludCBrZXlDb2RlLCBpbnQgc2NhbkNvZGUsIGludCBwb2xpY3lGbGFncywgYm9vbGVhbiBpc1NjcmVlbk9uKSB7CisgICA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XkgaXMgbm90IGluamVjdGVkLCBkZXRlcm1pbmUgd2hldGhlcgorICAgICAgICAgICAgLy8gdG8gd2FrZSB0aGUgZGV2aWNlIGJ1dCBkb24ndCBwYXNzIHRoZSBrZXkgdG8gdGhlIGFwcGxpY2F0aW9uLgorICAgICAgICAgICAgcmVzdWx0ID0gMDsKIAotICAgICAgICAgICAgICAgICAgICAvLyB0ZWxsIHRoZSBtZWRpYXRvciBhYm91dCBhIHdha2Uga2V5LCBpdCBtYXkgZGVjaWRlIHRvCi0gICAgICAgICAgICAgICAgICAgIC8vIHR1cm4gb24gdGhlIHNjcmVlbiBkZXBlbmRpbmcgb24gd2hldGhlciB0aGUga2V5IGlzCi0gICAgICAgICAgICAgICAgICAgIC8vIGFwcHJvcHJpYXRlLgotICAgICAgICAgICAgICAgICAgICBpZiAoIW1LZXlndWFyZE1lZGlhdG9yLm9uV2FrZUtleVdoZW5LZXlndWFyZFNob3dpbmdUcShrZXlDb2RlKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfVk9MVU1FX0RPV04KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9VUCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdoZW4ga2V5Z3VhcmQgaXMgc2hvd2luZyBhbmQgc2NyZWVuIG9mZiwgd2UgbmVlZAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gdG8gaGFuZGxlIHRoZSB2b2x1bWUga2V5IGZvciBjYWxscyBhbmQgIG11c2ljIGhlcmUKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0luQ2FsbCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlVm9sdW1lS2V5KEF1ZGlvTWFuYWdlci5TVFJFQU1fVk9JQ0VfQ0FMTCwga2V5Q29kZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlzTXVzaWNBY3RpdmUoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZVZvbHVtZUtleShBdWRpb01hbmFnZXIuU1RSRUFNX01VU0lDLCBrZXlDb2RlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc1dha2VLZXkgPSAocG9saWN5RmxhZ3MKKyAgICAgICAgICAgICAgICAgICAgJiAoV2luZG93TWFuYWdlclBvbGljeS5GTEFHX1dBS0UgfCBXaW5kb3dNYW5hZ2VyUG9saWN5LkZMQUdfV0FLRV9EUk9QUEVEKSkgIT0gMDsKKyAgICAgICAgICAgIGlmIChkb3duICYmIGlzV2FrZUtleSkgeworICAgICAgICAgICAgICAgIGlmIChrZXlndWFyZEFjdGl2ZSkgeworICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUga2V5Z3VhcmQgaXMgc2hvd2luZywgbGV0IGl0IGRlY2lkZSB3aGF0IHRvIGRvIHdpdGggdGhlIHdha2Uga2V5LgorICAgICAgICAgICAgICAgICAgICBtS2V5Z3VhcmRNZWRpYXRvci5vbldha2VLZXlXaGVuS2V5Z3VhcmRTaG93aW5nVHEoa2V5Q29kZSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gT3RoZXJ3aXNlLCB3YWtlIHRoZSBkZXZpY2Ugb3Vyc2VsdmVzLgorICAgICAgICAgICAgICAgICAgICByZXN1bHQgfD0gQUNUSU9OX1BPS0VfVVNFUl9BQ1RJVklUWTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSBpZiAoIWlzU2NyZWVuT24pIHsKLSAgICAgICAgICAgIC8vIElmIHdlIGFyZSBpbi1jYWxsIHdpdGggc2NyZWVuIG9mZiBhbmQga2V5Z3VhcmQgaXMgbm90IHNob3dpbmcsCi0gICAgICAgICAgICAvLyB0aGVuIGhhbmRsZSB0aGUgdm9sdW1lIGtleSBvdXJzZWx2ZXMuCi0gICAgICAgICAgICAvLyBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIHRoZSBwaG9uZSBhcHAgd2lsbCBkaXNhYmxlIHRoZSBrZXlndWFyZAotICAgICAgICAgICAgLy8gd2hlbiB0aGUgcHJveGltaXR5IHNlbnNvciBpcyBpbiB1c2UuCi0gICAgICAgICAgICBpZiAoaXNJbkNhbGwoKSAmJgotICAgICAgICAgICAgICAgICAgICAgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfRE9XTgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfVk9MVU1FX1VQKSkgewotICAgICAgICAgICAgICAgIHJlc3VsdCAmPSB+QUNUSU9OX1BBU1NfVE9fVVNFUjsKLSAgICAgICAgICAgICAgICBoYW5kbGVWb2x1bWVLZXkoQXVkaW9NYW5hZ2VyLlNUUkVBTV9WT0lDRV9DQUxMLCBrZXlDb2RlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChpc1dha2VLZXkpIHsKLSAgICAgICAgICAgICAgICAvLyBhIHdha2Uga2V5IGhhcyBhIHNvbGUgcHVycG9zZSBvZiB3YWtpbmcgdGhlIGRldmljZTsgZG9uJ3QgcGFzcwotICAgICAgICAgICAgICAgIC8vIGl0IHRvIHRoZSB1c2VyCi0gICAgICAgICAgICAgICAgcmVzdWx0IHw9IEFDVElPTl9QT0tFX1VTRVJfQUNUSVZJVFk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ICY9IH5BQ1RJT05fUEFTU19UT19VU0VSOwotICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9FTkRDQUxMCi0gICAgICAgICAgICAgICAgfHwga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX1BPV0VSKSB7Ci0gICAgICAgICAgICBpZiAoZG93bikgewotICAgICAgICAgICAgICAgIGJvb2xlYW4gaGFuZGxlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIGJvb2xlYW4gaHVuZ1VwID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgLy8ga2V5IHJlcGVhdHMgYXJlIGdlbmVyYXRlZCBieSB0aGUgd2luZG93IG1hbmFnZXIsIGFuZCB3ZSBkb24ndCBzZWUgdGhlbQotICAgICAgICAgICAgICAgIC8vIGhlcmUsIHNvIHVubGVzcyB0aGUgZHJpdmVyIGlzIGRvaW5nIHNvbWV0aGluZyBpdCBzaG91bGRuJ3QgYmUsIHdlIGtub3cKLSAgICAgICAgICAgICAgICAvLyB0aGlzIGlzIHRoZSByZWFsIHByZXNzIGV2ZW50LgotICAgICAgICAgICAgICAgIElUZWxlcGhvbnkgcGhvbmVTZXJ2ID0gZ2V0UGhvbmVJbnRlcmZhY2UoKTsKLSAgICAgICAgICAgICAgICBpZiAocGhvbmVTZXJ2ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRU5EQ0FMTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSBodW5nVXAgPSBwaG9uZVNlcnYuZW5kQ2FsbCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfUE9XRVIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGhvbmVTZXJ2LmlzUmluZ2luZygpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFByZXNzaW5nIFBvd2VyIHdoaWxlIHRoZXJlJ3MgYSByaW5naW5nIGluY29taW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbGwgc2hvdWxkIHNpbGVuY2UgdGhlIHJpbmdlci4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmVTZXJ2LnNpbGVuY2VSaW5nZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwaG9uZVNlcnYuaXNPZmZob29rKCkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobUluY2FsbFBvd2VyQmVoYXZpb3IKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiBTZXR0aW5ncy5TZWN1cmUuSU5DQUxMX1BPV0VSX0JVVFRPTl9CRUhBVklPUl9IQU5HVVApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gMCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gT3RoZXJ3aXNlLCBpZiAiUG93ZXIgYnV0dG9uIGVuZHMgY2FsbCIgaXMgZW5hYmxlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIFBvd2VyIGJ1dHRvbiB3aWxsIGhhbmcgdXAgYW55IGN1cnJlbnQgYWN0aXZlIGNhbGwuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSBodW5nVXAgPSBwaG9uZVNlcnYuZW5kQ2FsbCgpOworICAgICAgICAvLyBIYW5kbGUgc3BlY2lhbCBrZXlzLgorICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfRE9XTjoKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfVVA6CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfVk9MVU1FX01VVEU6IHsKKyAgICAgICAgICAgICAgICBpZiAoZG93bikgeworICAgICAgICAgICAgICAgICAgICBJVGVsZXBob255IHRlbGVwaG9ueVNlcnZpY2UgPSBnZXRUZWxlcGhvbnlTZXJ2aWNlKCk7CisgICAgICAgICAgICAgICAgICAgIGlmICh0ZWxlcGhvbnlTZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRlbGVwaG9ueVNlcnZpY2UuaXNSaW5naW5nKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgYW4gaW5jb21pbmcgY2FsbCBpcyByaW5naW5nLCBlaXRoZXIgVk9MVU1FIGtleSBtZWFucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAic2lsZW5jZSByaW5nZXIiLiAgV2UgaGFuZGxlIHRoZXNlIGtleXMgaGVyZSwgcmF0aGVyIHRoYW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW4gdGhlIEluQ2FsbFNjcmVlbiwgdG8gbWFrZSBzdXJlIHdlJ2xsIHJlc3BvbmQgdG8gdGhlbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBldmVuIGlmIHRoZSBJbkNhbGxTY3JlZW4gaGFzbid0IGNvbWUgdG8gdGhlIGZvcmVncm91bmQgeWV0LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMb29rIGZvciB0aGUgRE9XTiBldmVudCBoZXJlLCB0byBhZ3JlZSB3aXRoIHRoZSAiZmFsbGJhY2siCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJlaGF2aW9yIGluIHRoZSBJbkNhbGxTY3JlZW4uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgImludGVyY2VwdEtleUJlZm9yZVF1ZXVlaW5nOiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIFZPTFVNRSBrZXktZG93biB3aGlsZSByaW5naW5nOiBTaWxlbmNlIHJpbmdlciEiKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTaWxlbmNlIHRoZSByaW5nZXIuICAoSXQncyBzYWZlIHRvIGNhbGwgdGhpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBldmVuIGlmIHRoZSByaW5nZXIgaGFzIGFscmVhZHkgYmVlbiBzaWxlbmNlZC4pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbGVwaG9ueVNlcnZpY2Uuc2lsZW5jZVJpbmdlcigpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFuZCAqZG9uJ3QqIHBhc3MgdGhpcyBrZXkgdGhydSB0byB0aGUgY3VycmVudCBhY3Rpdml0eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAod2hpY2ggaXMgcHJvYmFibHkgdGhlIEluQ2FsbFNjcmVlbi4pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAmPSB+QUNUSU9OX1BBU1NfVE9fVVNFUjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZWxlcGhvbnlTZXJ2aWNlLmlzT2ZmaG9vaygpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAocmVzdWx0ICYgQUNUSU9OX1BBU1NfVE9fVVNFUikgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB3ZSBhcmUgaW4gY2FsbCBidXQgd2UgZGVjaWRlZCBub3QgdG8gcGFzcyB0aGUga2V5IHRvCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBhcHBsaWNhdGlvbiwgaGFuZGxlIHRoZSB2b2x1bWUgY2hhbmdlIGhlcmUuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZVZvbHVtZUtleShBdWRpb01hbmFnZXIuU1RSRUFNX1ZPSUNFX0NBTEwsIGtleUNvZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJJVGVsZXBob255IHRocmV3IFJlbW90ZUV4Y2VwdGlvbiIsIGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChpc011c2ljQWN0aXZlKCkgJiYgKHJlc3VsdCAmIEFDVElPTl9QQVNTX1RPX1VTRVIpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIG11c2ljIGlzIHBsYXlpbmcgYnV0IHdlIGRlY2lkZWQgbm90IHRvIHBhc3MgdGhlIGtleSB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFwcGxpY2F0aW9uLCBoYW5kbGUgdGhlIHZvbHVtZSBjaGFuZ2UgaGVyZS4KKyAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZVZvbHVtZUtleShBdWRpb01hbmFnZXIuU1RSRUFNX01VU0lDLCBrZXlDb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRU5EQ0FMTDogeworICAgICAgICAgICAgICAgIHJlc3VsdCAmPSB+QUNUSU9OX1BBU1NfVE9fVVNFUjsKKyAgICAgICAgICAgICAgICBpZiAoZG93bikgeworICAgICAgICAgICAgICAgICAgICBJVGVsZXBob255IHRlbGVwaG9ueVNlcnZpY2UgPSBnZXRUZWxlcGhvbnlTZXJ2aWNlKCk7CisgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaHVuZ1VwID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGlmICh0ZWxlcGhvbnlTZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHVuZ1VwID0gdGVsZXBob255U2VydmljZS5lbmRDYWxsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJJVGVsZXBob255IHRocmV3IFJlbW90ZUV4Y2VwdGlvbiIsIGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpbnRlcmNlcHRQb3dlcktleURvd24oIWlzU2NyZWVuT24gfHwgaHVuZ1VwKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoaW50ZXJjZXB0UG93ZXJLZXlVcChjYW5jZWxlZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobUVuZGNhbGxCZWhhdmlvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmIFNldHRpbmdzLlN5c3RlbS5FTkRfQlVUVE9OX0JFSEFWSU9SX0hPTUUpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ29Ib21lKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIklUZWxlcGhvbnkgdGhyZXcgUmVtb3RlRXhjZXB0aW9uIiArIGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobUVuZGNhbGxCZWhhdmlvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmIFNldHRpbmdzLlN5c3RlbS5FTkRfQlVUVE9OX0JFSEFWSU9SX1NMRUVQKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCAmIH5BQ1RJT05fUE9LRV9VU0VSX0FDVElWSVRZKSB8IEFDVElPTl9HT19UT19TTEVFUDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX1BPV0VSOiB7CisgICAgICAgICAgICAgICAgcmVzdWx0ICY9IH5BQ1RJT05fUEFTU19UT19VU0VSOworICAgICAgICAgICAgICAgIGlmIChkb3duKSB7CisgICAgICAgICAgICAgICAgICAgIElUZWxlcGhvbnkgdGVsZXBob255U2VydmljZSA9IGdldFRlbGVwaG9ueVNlcnZpY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBodW5nVXAgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRlbGVwaG9ueVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGVsZXBob255U2VydmljZS5pc1JpbmdpbmcoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBQcmVzc2luZyBQb3dlciB3aGlsZSB0aGVyZSdzIGEgcmluZ2luZyBpbmNvbWluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjYWxsIHNob3VsZCBzaWxlbmNlIHRoZSByaW5nZXIuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbGVwaG9ueVNlcnZpY2Uuc2lsZW5jZVJpbmdlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKG1JbmNhbGxQb3dlckJlaGF2aW9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmIFNldHRpbmdzLlNlY3VyZS5JTkNBTExfUE9XRVJfQlVUVE9OX0JFSEFWSU9SX0hBTkdVUCkgIT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdGVsZXBob255U2VydmljZS5pc09mZmhvb2soKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBPdGhlcndpc2UsIGlmICJQb3dlciBidXR0b24gZW5kcyBjYWxsIiBpcyBlbmFibGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgUG93ZXIgYnV0dG9uIHdpbGwgaGFuZyB1cCBhbnkgY3VycmVudCBhY3RpdmUgY2FsbC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHVuZ1VwID0gdGVsZXBob255U2VydmljZS5lbmRDYWxsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiSVRlbGVwaG9ueSB0aHJldyBSZW1vdGVFeGNlcHRpb24iLCBleCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaW50ZXJjZXB0UG93ZXJLZXlEb3duKCFpc1NjcmVlbk9uIHx8IGh1bmdVcCk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiISEhIFVuYWJsZSB0byBmaW5kIElUZWxlcGhvbnkgaW50ZXJmYWNlICEhISIpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmICghaXNTY3JlZW5PbgotICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGhhbmRsZWQgJiYga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX1BPV0VSKQotICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGhhbmRsZWQgJiYgaHVuZ1VwICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9QT1dFUikpIHsKLSAgICAgICAgICAgICAgICAgICAgbVNob3VsZFR1cm5PZmZPbktleVVwID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gT25seSB0cnkgdG8gdHVybiBvZmYgdGhlIHNjcmVlbiBpZiB3ZSBkaWRuJ3QgYWxyZWFkeSBoYW5nIHVwLgotICAgICAgICAgICAgICAgICAgICBtU2hvdWxkVHVybk9mZk9uS2V5VXAgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5wb3N0RGVsYXllZChtUG93ZXJMb25nUHJlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0NvbmZpZ3VyYXRpb24uZ2V0R2xvYmFsQWN0aW9uS2V5VGltZW91dCgpKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICY9IH5BQ1RJT05fUEFTU19UT19VU0VSOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1Qb3dlckxvbmdQcmVzcyk7Ci0gICAgICAgICAgICAgICAgaWYgKG1TaG91bGRUdXJuT2ZmT25LZXlVcCkgewotICAgICAgICAgICAgICAgICAgICBtU2hvdWxkVHVybk9mZk9uS2V5VXAgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBnb2hvbWUsIHNsZWVwczsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9FTkRDQUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBnb2hvbWUgPSAobUVuZGNhbGxCZWhhdmlvcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYgU2V0dGluZ3MuU3lzdGVtLkVORF9CVVRUT05fQkVIQVZJT1JfSE9NRSkgIT0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNsZWVwcyA9IChtRW5kY2FsbEJlaGF2aW9yCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiBTZXR0aW5ncy5TeXN0ZW0uRU5EX0JVVFRPTl9CRUhBVklPUl9TTEVFUCkgIT0gMDsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGdvaG9tZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgc2xlZXBzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGludGVyY2VwdFBvd2VyS2V5VXAoY2FuY2VsZWQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICYgfkFDVElPTl9QT0tFX1VTRVJfQUNUSVZJVFkpIHwgQUNUSU9OX0dPX1RPX1NMRUVQOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChrZXlndWFyZEFjdGl2ZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChzbGVlcHMgJiYgIWdvaG9tZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoZ29ob21lICYmICFnb0hvbWUoKSAmJiBzbGVlcHMpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGV5IG11c3QgYWxyZWFkeSBiZSBvbiB0aGUga2V5Z3VhcmQgb3IgaG9tZSBzY3JlZW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBnbyB0byBzbGVlcCBpbnN0ZWFkIHVubGVzcyB0aGUgZXZlbnQgd2FzIGluamVjdGVkLgotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0luamVjdGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiSSdtIHRpcmVkIG1FbmRjYWxsQmVoYXZpb3I9MHgiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIEludGVnZXIudG9IZXhTdHJpbmcobUVuZGNhbGxCZWhhdmlvcikpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAmPSB+QUNUSU9OX1BPS0VfVVNFUl9BQ1RJVklUWTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgfD0gQUNUSU9OX0dPX1RPX1NMRUVQOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01FRElBX1BMQVk6CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUEFVU0U6CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfUExBWV9QQVVTRToKKyAgICAgICAgICAgICAgICBpZiAoZG93bikgeworICAgICAgICAgICAgICAgICAgICBJVGVsZXBob255IHRlbGVwaG9ueVNlcnZpY2UgPSBnZXRUZWxlcGhvbnlTZXJ2aWNlKCk7CisgICAgICAgICAgICAgICAgICAgIGlmICh0ZWxlcGhvbnlTZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0ZWxlcGhvbnlTZXJ2aWNlLmlzSWRsZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1cHByZXNzIFBMQVkvUEFVU0UgdG9nZ2xlIHdoZW4gcGhvbmUgaXMgcmluZ2luZyBvciBpbi1jYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIGF2b2lkIG11c2ljIHBsYXliYWNrLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJJVGVsZXBob255IHRocmV3IFJlbW90ZUV4Y2VwdGlvbiIsIGV4KTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXN1bHQgJj0gfkFDVElPTl9QQVNTX1RPX1VTRVI7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0hFQURTRVRIT09LOgorICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX01VVEU6CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfTUVESUFfU1RPUDoKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9NRURJQV9ORVhUOgorICAgICAgICAgICAgY2F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NvZGUsIDApOwotICAgICAgICAgICAgICAgIG1Ccm9hZGNhc3RXYWtlTG9jay5hY3F1aXJlKCk7Ci0gICAgICAgICAgICAgICAgbUhhbmRsZXIucG9zdChuZXcgUGFzc0hlYWRzZXRLZXkoa2V5RXZlbnQpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfQ0FMTCkgewotICAgICAgICAgICAgLy8gSWYgYW4gaW5jb21pbmcgY2FsbCBpcyByaW5naW5nLCBhbnN3ZXIgaXQhCi0gICAgICAgICAgICAvLyAoV2UgaGFuZGxlIHRoaXMga2V5IGhlcmUsIHJhdGhlciB0aGFuIGluIHRoZSBJbkNhbGxTY3JlZW4sIHRvIG1ha2UKLSAgICAgICAgICAgIC8vIHN1cmUgd2UnbGwgcmVzcG9uZCB0byB0aGUga2V5IGV2ZW4gaWYgdGhlIEluQ2FsbFNjcmVlbiBoYXNuJ3QgY29tZSB0bwotICAgICAgICAgICAgLy8gdGhlIGZvcmVncm91bmQgeWV0LikKIAotICAgICAgICAgICAgLy8gV2UgYW5zd2VyIHRoZSBjYWxsIG9uIHRoZSBET1dOIGV2ZW50LCB0byBhZ3JlZSB3aXRoCi0gICAgICAgICAgICAvLyB0aGUgImZhbGxiYWNrIiBiZWhhdmlvciBpbiB0aGUgSW5DYWxsU2NyZWVuLgotICAgICAgICAgICAgaWYgKGRvd24pIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBJVGVsZXBob255IHBob25lU2VydiA9IGdldFBob25lSW50ZXJmYWNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwaG9uZVNlcnYgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBob25lU2Vydi5pc1JpbmdpbmcoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgImludGVyY2VwdEtleVRxOiIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgQ0FMTCBrZXktZG93biB3aGlsZSByaW5naW5nOiBBbnN3ZXIgdGhlIGNhbGwhIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmVTZXJ2LmFuc3dlclJpbmdpbmdDYWxsKCk7CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfQ0FMTDogeworICAgICAgICAgICAgICAgIGlmIChkb3duKSB7CisgICAgICAgICAgICAgICAgICAgIElUZWxlcGhvbnkgdGVsZXBob255U2VydmljZSA9IGdldFRlbGVwaG9ueVNlcnZpY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRlbGVwaG9ueVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGVsZXBob255U2VydmljZS5pc1JpbmdpbmcoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJpbnRlcmNlcHRLZXlCZWZvcmVRdWV1ZWluZzoiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBDQUxMIGtleS1kb3duIHdoaWxlIHJpbmdpbmc6IEFuc3dlciB0aGUgY2FsbCEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVsZXBob255U2VydmljZS5hbnN3ZXJSaW5naW5nQ2FsbCgpOwogCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQW5kICpkb24ndCogcGFzcyB0aGlzIGtleSB0aHJ1IHRvIHRoZSBjdXJyZW50IGFjdGl2aXR5Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gKHdoaWNoIGlzIHByZXN1bWFibHkgdGhlIEluQ2FsbFNjcmVlbi4pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICY9IH5BQ1RJT05fUEFTU19UT19VU0VSOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBbmQgKmRvbid0KiBwYXNzIHRoaXMga2V5IHRocnUgdG8gdGhlIGN1cnJlbnQgYWN0aXZpdHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gKHdoaWNoIGlzIHByZXN1bWFibHkgdGhlIEluQ2FsbFNjcmVlbi4pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAmPSB+QUNUSU9OX1BBU1NfVE9fVVNFUjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJJVGVsZXBob255IHRocmV3IFJlbW90ZUV4Y2VwdGlvbiIsIGV4KTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNBTEwgYnV0dG9uOiBVbmFibGUgdG8gZmluZCBJVGVsZXBob255IGludGVyZmFjZSIpOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNBTEwgYnV0dG9uOiBSZW1vdGVFeGNlcHRpb24gZnJvbSBnZXRQaG9uZUludGVyZmFjZSgpIiwgZXgpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmICgoa2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9VUCkKLSAgICAgICAgICAgICAgICAgICB8fCAoa2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9ET1dOKSkgewotICAgICAgICAgICAgLy8gSWYgYW4gaW5jb21pbmcgY2FsbCBpcyByaW5naW5nLCBlaXRoZXIgVk9MVU1FIGtleSBtZWFucwotICAgICAgICAgICAgLy8gInNpbGVuY2UgcmluZ2VyIi4gIFdlIGhhbmRsZSB0aGVzZSBrZXlzIGhlcmUsIHJhdGhlciB0aGFuCi0gICAgICAgICAgICAvLyBpbiB0aGUgSW5DYWxsU2NyZWVuLCB0byBtYWtlIHN1cmUgd2UnbGwgcmVzcG9uZCB0byB0aGVtCi0gICAgICAgICAgICAvLyBldmVuIGlmIHRoZSBJbkNhbGxTY3JlZW4gaGFzbid0IGNvbWUgdG8gdGhlIGZvcmVncm91bmQgeWV0LgotCi0gICAgICAgICAgICAvLyBMb29rIGZvciB0aGUgRE9XTiBldmVudCBoZXJlLCB0byBhZ3JlZSB3aXRoIHRoZSAiZmFsbGJhY2siCi0gICAgICAgICAgICAvLyBiZWhhdmlvciBpbiB0aGUgSW5DYWxsU2NyZWVuLgotICAgICAgICAgICAgaWYgKGRvd24pIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBJVGVsZXBob255IHBob25lU2VydiA9IGdldFBob25lSW50ZXJmYWNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwaG9uZVNlcnYgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBob25lU2Vydi5pc1JpbmdpbmcoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgImludGVyY2VwdEtleVRxOiIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgVk9MVU1FIGtleS1kb3duIHdoaWxlIHJpbmdpbmc6IFNpbGVuY2UgcmluZ2VyISIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNpbGVuY2UgdGhlIHJpbmdlci4gIChJdCdzIHNhZmUgdG8gY2FsbCB0aGlzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXZlbiBpZiB0aGUgcmluZ2VyIGhhcyBhbHJlYWR5IGJlZW4gc2lsZW5jZWQuKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob25lU2Vydi5zaWxlbmNlUmluZ2VyKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBbmQgKmRvbid0KiBwYXNzIHRoaXMga2V5IHRocnUgdG8gdGhlIGN1cnJlbnQgYWN0aXZpdHkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAod2hpY2ggaXMgcHJvYmFibHkgdGhlIEluQ2FsbFNjcmVlbi4pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICY9IH5BQ1RJT05fUEFTU19UT19VU0VSOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiVk9MVU1FIGJ1dHRvbjogVW5hYmxlIHRvIGZpbmQgSVRlbGVwaG9ueSBpbnRlcmZhY2UiKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJWT0xVTUUgYnV0dG9uOiBSZW1vdGVFeGNlcHRpb24gZnJvbSBnZXRQaG9uZUludGVyZmFjZSgpIiwgZXgpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotCiAgICAgICAgIHJldHVybiByZXN1bHQ7CiAgICAgfQogCmRpZmYgLS1naXQgYS9wb2xpY3kvc3JjL2NvbS9hbmRyb2lkL2ludGVybmFsL3BvbGljeS9pbXBsL1Bvd2VyRGlhbG9nLmphdmEgYi9wb2xpY3kvc3JjL2NvbS9hbmRyb2lkL2ludGVybmFsL3BvbGljeS9pbXBs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k7Ci0gICAgICAgICAgICBpZiAocGhvbmUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRleHQgPSBwaG9uZS5pc1JhZGlvT24oKSA/IGNvbnRleHQKLSAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRUZXh0KFIuc3RyaW5nLnR1cm5fb2ZmX3JhZGlvKSA6IGNvbnRleHQKLSAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRUZXh0KFIuc3RyaW5nLnR1cm5fb25fcmFkaW8pOwotICAgICAgICAgICAgfQotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgIC8vIGlnbm9yZSBpdAotICAgICAgICB9Ci0KLSAgICAgICAgbVJhZGlvUG93ZXIuc2V0VGV4dCh0ZXh0KTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgewotICAgICAgICB0aGlzLmRpc21pc3MoKTsKLSAgICAgICAgaWYgKHYgPT0gbVBvd2VyKSB7Ci0gICAgICAgICAgICAvLyBzaHV0ZG93biBieSBtYWtpbmcgc3VyZSByYWRpbyBhbmQgcG93ZXIgYXJlIGhhbmRsZWQgYWNjb3JkaW5nbHkuCi0gICAgICAgICAgICBTaHV0ZG93blRocmVhZC5zaHV0ZG93bihnZXRDb250ZXh0KCksIHRydWUpOwotICAgICAgICB9IGVsc2UgaWYgKHYgPT0gbVJhZGlvUG93ZXIpIHsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgSVRlbGVwaG9ueSBwaG9uZSA9IElUZWxlcGhvbnkuU3R1Yi5hc0ludGVyZmFjZShTZXJ2aWNlTWFuYWdlci5jaGVja1NlcnZpY2UoInBob25lIikpOwotICAgICAgICAgICAgICAgIGlmIChwaG9uZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBob25lLnRvZ2dsZVJhZGlvT25PZmYoKTsKLSAgICAgICAgICAgICAgICB9Ci0g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kgIT0gMDsKKworICAgICAgICAgICAgbVByb3BlcnR5T2Yuc2V0VGV4dChpbmZvKTsKKyAgICAgICAgICAgIG1Qcm9wZXJ0eU9mLnNldFZpc2liaWxpdHkoZW5hYmxlZCAmJiAhVGV4dFV0aWxzLmlzRW1wdHkoaW5mbykgPworICAgICAgICAgICAgICAgICAgICBWaWV3LlZJU0lCTEUgOiBWaWV3LklOVklTSUJMRSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1IYXNTdGF0dXMyKSByZXR1cm47CisKKyAgICAgICAgaWYgKG1JbnN0cnVjdGlvbnMgIT0gbnVsbCkgeworICAgICAgICAgICAgLy8gaW5zdHJ1Y3Rpb25zIG9ubHkKKyAgICAgICAgICAgIG1TdGF0dXMxLnNldFRleHQobUluc3RydWN0aW9ucyk7CisgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkobUluc3RydWN0aW9ucykpIHsKKyAgICAgICAgICAgICAgICBtU3RhdHVzMS5zZXRDb21wb3VuZERyYXdhYmxlc1dpdGhJbnRyaW5zaWNCb3VuZHMoMCwgMCwgMCwgMCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1TdGF0dXMxLnNldENvbXBvdW5kRHJhd2FibGVzV2l0aEludHJpbnNpY0JvdW5kcygKKyAgICAgICAgICAgICAgICAgICAgICAgIFIuZHJhd2FibGUuaWNfbG9ja19pZGxlX2xvY2ssIDAsIDAsIDApOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtU3RhdHVzMS5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICBtU3RhdHVzMi5zZXRWaXNpYmlsaXR5KFZpZXcuSU5WSVNJQkxFKTsKKyAgICAgICAgfSBlbHNlIGlmIChtU2hvd2luZ0JhdHRlcnlJbmZvICYmIG1OZXh0QWxhcm0gPT0gbnVsbCkgeworICAgICAgICAgICAgLy8gYmF0dGVyeSBvbmx5CisgICAgICAgICAgICBpZiAobVBsdWdnZWRJbikgeworICAgICAgICAgICAgICBpZiAobUJhdHRlcnlMZXZlbCA+PSAxMDApIHsKKyAgICAgICAgICAgICAgICBtU3RhdHVzMS5zZXRUZXh0KGdldENvbnRleHQoKS5nZXRTdHJpbmcoUi5zdHJpbmcubG9ja3NjcmVlbl9jaGFyZ2VkKSk7CisgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICBtU3RhdHVzMS5zZXRUZXh0KGdldENvbnRleHQoKS5nZXRTdHJpbmcoUi5zdHJpbmcubG9ja3NjcmVlbl9wbHVnZ2VkX2luLAorICAgICAgICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeUxldmVsKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVN0YXR1czEuc2V0VGV4dChnZXRDb250ZXh0KCkuZ2V0U3RyaW5nKFIuc3RyaW5nLmxvY2tzY3JlZW5fbG93X2JhdHRlcnkpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1TdGF0dXMxLnNldENvbXBvdW5kRHJhd2FibGVzV2l0aEludHJpbnNpY0JvdW5kcyhSLmRyYXdhYmxlLmljX2xvY2tfaWRsZV9jaGFyZ2luZywgMCwKKyAgICAgICAgICAgICAgICAgICAgMCwgMCk7CisKKyAgICAgICAgICAgIG1TdGF0dXMxLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgIG1TdGF0dXMyLnNldFZpc2liaWxpdHkoVmlldy5JTlZJU0lCTEUpOworCisgICAgICAgIH0gZWxzZSBpZiAobU5leHRBbGFybSAhPSBudWxsICYmICFtU2hvd2luZ0JhdHRlcnlJbmZvKSB7CisgICAgICAgICAgICAvLyBhbGFybSBvbmx5CisgICAgICAgICAgICBtU3RhdHVzMS5zZXRUZXh0KG1OZXh0QWxhcm0pOworICAgICAgICAgICAgbVN0YXR1czEuc2V0Q29tcG91bmREcmF3YWJsZXNXaXRoSW50cmluc2ljQm91bmRzKFIuZHJhd2FibGUuaWNfbG9ja19pZGxlX2FsYXJtLCAwLAorICAgICAgICAgICAgICAgICAgICAwLCAwKTsKKworICAgICAgICAgICAgbVN0YXR1czEuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgbVN0YXR1czIuc2V0VmlzaWJpbGl0eShWaWV3LklOVklTSUJMRSk7CisgICAgICAgIH0gZWxzZSBpZiAobU5leHRBbGFybSAhPSBudWxsICYmIG1TaG93aW5nQmF0dGVyeUluZm8pIHsKKyAgICAgICAgICAgIC8vIGJvdGggYmF0dGVyeSBhbmQgbmV4dCBhbGFybQorICAgICAgICAgICAgbVN0YXR1czEuc2V0VGV4dChtTmV4dEFsYXJtKTsKKyAgICAgICAgICAgIG1TdGF0dXMyLnNldFRleHQoZ2V0Q29udGV4dCgpLmdldFN0cmluZygKKyAgICAgICAgICAgICAgICAgICAgUi5zdHJpbmcubG9ja3NjcmVlbl9iYXR0ZXJ5X3Nob3J0LAorICAgICAgICAgICAgICAgICAgICBNYXRoLm1pbigxMDAsIG1CYXR0ZXJ5TGV2ZWwpKSk7CisgICAgICAgICAgICBtU3RhdHVzMS5zZXRDb21wb3VuZERyYXdhYmxlc1dpdGhJbnRyaW5zaWNCb3VuZHMoUi5kcmF3YWJsZS5pY19sb2NrX2lkbGVfYWxhcm0sIDAsCisgICAgICAgICAgICAgICAgICAgIDAsIDApOworICAgICAgICAgICAgaWYgKG1QbHVnZ2VkSW4pIHsKKyAgICAgICAgICAgICAgICBtU3RhdHVzMi5zZXRDb21wb3VuZERyYXdhYmxlc1dpdGhJbnRyaW5zaWNCb3VuZHMoUi5kcmF3YWJsZS5pY19sb2NrX2lkbGVfY2hhcmdpbmcsCisgICAgICAgICAgICAgICAgICAgICAgICAwLCAwLCAwKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVN0YXR1czIuc2V0Q29tcG91bmREcmF3YWJsZXNXaXRoSW50cmluc2ljQm91bmRzKDAsIDAsIDAsIDApOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtU3RhdHVzMS5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICBtU3RhdHVzMi5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBub3RoaW5nIHNwZWNpZmljIHRvIHNob3c7IHNob3cgZ2VuZXJhbCBpbnN0cnVjdGlvbnMKKyAgICAgICAgICAgIG1TdGF0dXMxLnNldFRleHQoUi5zdHJpbmcubG9ja3NjcmVlbl9wYXR0ZXJuX2luc3RydWN0aW9ucyk7CisgICAgICAgICAgICBtU3RhdHVzMS5zZXRDb21wb3VuZERyYXdhYmxlc1dpdGhJbnRyaW5zaWNCb3VuZHMoUi5kcmF3YWJsZS5pY19sb2NrX2lkbGVfbG9jaywgMCwKKyAgICAgICAgICAgICAgICAgICAgMCwgMCk7CisKKyAgICAgICAgICAgIG1TdGF0dXMxLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgIG1TdGF0dXMyLnNldFZpc2liaWxpdHkoVmlldy5JTlZJU0lCTEUpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqIE9yaWdpbmF0ZWQgZnJvbSBMb2NrU2NyZWVuICoqLworICAgIC8vIFRPRE8gTWVyZ2Ugd2l0aCBmdW5jdGlvbiBhYm92ZQorICAgIHZvaWQgdXBkYXRlU3RhdHVzTGluZXMoYm9vbGVhbiBzaG93U3RhdHVzTGluZXMsIFN0cmluZyBjaGFyZ2luZywgRHJhd2FibGUgY2hhcmdpbmdJY29uLAorICAgICAgICAgICAgRHJhd2FibGUgYWxhcm1JY29uKSB7CisgICAgICAgIGlmICghc2hvd1N0YXR1c0xpbmVzIHx8IChjaGFyZ2luZyA9PSBudWxsICYmIG1OZXh0QWxhcm0gPT0gbnVsbC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ICB9Ci0gICAgbVN1cmZhY2UgPSBzdXJmYWNlOworICAgIGlmIChzdXJmYWNlICE9IDApIHsKKyAgICAgICAgbVN1cmZhY2UgPSBnZXRJU3VyZmFjZShzdXJmYWNlKTsKKyAgICB9IGVsc2UgeworICAgICAgICBtU3VyZmFjZSA9IDA7CisgICAgfQorICAgIG1QcmV2aWV3V2luZG93ID0gc3VyZmFjZTsKICAgICBtT3ZlcmxheVJlZiA9IDA7CiAgICAgLy8gSWYgcHJldmlldyBoYXMgYmVlbiBhbHJlYWR5IHN0YXJ0ZWQsIHNldCBvdmVybGF5IG9yIHJlZ2lzdGVyIHByZXZpZXcKICAgICAvLyBidWZmZXJzIG5vdy4KICAgICBpZiAobUhhcmR3YXJlLT5wcmV2aWV3RW5hYmxlZCgpKSB7CiAgICAgICAgIGlmIChtVXNlT3ZlcmxheSkgewogICAgICAgICAgICAgcmVzdWx0ID0gc2V0T3ZlcmxheSgpOwotICAgICAgICB9IGVsc2UgaWYgKG1TdXJmYWNlICE9IDApIHsKLSAgICAgICAgICAgIHJlc3VsdCA9IHJlZ2lzdGVyUHJldmlld0J1ZmZlcnMoKTsKKyAgICAgICAgfSBlbHNlIGlmIChtUHJldmlld1dpbmRvdyAhPSAwKSB7CisgICAgICAgICAgICBuYXRpdmVfd2luZG93X3NldF9idWZmZXJzX3RyYW5zZm9ybShtUHJldmlld1dpbmRvdy5nZXQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1PcmllbnRhdGlvbik7CisgICAgICAgICAgICByZXN1bHQgPSBtSGFyZHdhcmUtPnNldFByZXZpZXdXaW5kb3cobVByZXZpZXdXaW5kb3cpOwogICAgICAgICB9CiAgICAgfQogCiAgICAgcmV0dXJuIHJlc3VsdDsKIH0KIAotc3RhdHVzX3QgQ2FtZXJhU2VydmljZTo6Q2xpZW50OjpyZWdpc3RlclByZXZpZXdCdWZmZXJzKCkgewotICAgIGludCB3LCBoOwotICAgIENhbW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N0aWxsIGFibGUgdG8gc3RhcnQgcHJldmlldyBpbiB0aGlzIGNhc2UuCiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gc3RhcnRQcmV2aWV3TW9kZSgpOwogICAgICAgICBjYXNlIENBTUVSQV9SRUNPUkRJTkdfTU9ERToKLSAgICAgICAgICAgIGlmIChtU3VyZmFjZSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgTE9HRSgibVN1cmZhY2UgbXVzdCBiZSBzZXQgYmVmb3JlIHN0YXJ0UmVjb3JkaW5nTW9kZS4iKTsKKyAgICAgICAgICAgIGlmIChtU3VyZmFjZSA9PSAwICYmIG1QcmV2aWV3V2luZG93ID09IDApIHsKKyAgICAgICAgICAgICAgICBMT0dFKCJtU3VyZmFjZSBvciBtUHJldmlld1dpbmRvdyBtdXN0IGJlIHNldCBiZWZvcmUgc3RhcnRSZWNvcmRpbmdNb2RlLiIpOwogICAgICAgICAgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiBzdGFydFJlY29yZGluZ01vZGUoKTsKQEAgLTY2NCwxNiArNjM4LDEyIEBACiAgICAgICAgIGlmIChyZXN1bHQgIT0gTk9fRVJST1IpIHJldHVybiByZXN1bHQ7CiAgICAgICAgIHJlc3VsdCA9IG1IYXJkd2FyZS0+c3RhcnRQcmV2aWV3KCk7CiAgICAgfSBlbHNlIHsKLSAgICAgICAgZW5hYmxlTXNnVHlwZShDQU1FUkFfTVNHX1BSRVZJRVdfRlJBTUUpOwotICAgICAgICByZXN1bHQgPSBtSGFyZHdhcmUtPnN0YXJ0UHJldmlldygpOwotICAgICAgICBpZiAocmVzdWx0ICE9IE5PX0VSUk9SKSByZXR1cm4gcmVzdWx0OwotICAgICAgICAvLyBJZiBwcmV2aWV3IGRpc3BsYXkgaGFzIGJlZW4gc2V0LCByZWdpc3RlciBwcmV2aWV3IGJ1ZmZlcnMgbm93LgotICAgICAgIC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hPSAwKSB7CisgICAgICAgIC8vIERpc2FibGluZyBzaHV0dGVyIHNvdW5kIGlzIG5vdCBhbGxvd2VkLiBEZW55IGlmIHRoZSBjdXJyZW50CisgICAgICAgIC8vIHByb2Nlc3MgaXMgbm90IG1lZGlhc2VydmVyLgorICAgICAgICBpZiAoZ2V0Q2FsbGluZ1BpZCgpICE9IGdldHBpZCgpKSB7CisgICAgICAgICAgICBMT0dFKCJGYWlsZWQgdG8gZGlzYWJsZSBzaHV0dGVyIHNvdW5kLiBQZXJtaXNzaW9uIGRlbmllZCAocGlkICVkKSIsIGdldENhbGxpbmdQaWQoKSk7CisgICAgICAgICAgICByZXR1cm4gUEVSTUlTU0lPTl9ERU5JRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBtUGxheVNodXR0ZXJTb3VuZCA9IGZhbHNlOworICAgIHJldHVybiBPSzsKK30KKwogc3RhdHVzX3QgQ2FtZXJhU2VydmljZTo6Q2xpZW50OjpzZW5kQ29tbWFuZChpbnQzMl90IGNtZCwgaW50MzJfdCBhcmcxLCBpbnQzMl90IGFyZzIpIHsKICAgICBMT0cxKCJzZW5kQ29tbWFuZCAocGlkICVkKSIsIGdldENhbGxpbmdQaWQoKSk7CiAgICAgaW50IG9yaWVudGF0aW9uOwpAQCAtODM2LDYgKzg1NiwyMCBAQAogICAgICAgICAgICAgaWYgKG1PdmVybGF5UmVmICE9IDApIG1PcmllbnRhdGlvbkNoYW5nZWQgPSB0cnVlOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiBPSzsKKyAgICB9IGVsc2UgaWYgKGNtZCA9PSBDQU1FUkFfQ01EX0VOQUJMRV9TSFVUVEVSX1NPVU5EKSB7CisgICAgICAgIHN3aXRjaCAoYXJnMSkgeworICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgIGVuYWJsZVNodXR0ZXJTb3VuZChmYWxzZSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDE6CisgICA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aXJ0dWFsIHN0YXR1c190ICAgICAgICBsb2NrKCk7CiAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHVubG9jaygpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzZXRQcmV2aWV3RGlzcGxheShjb25zdCBzcDxJU3VyZmFjZT4mIHN1cmZhY2UpOworICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzZXRQcmV2aWV3RGlzcGxheShjb25zdCBzcDxTdXJmYWNlPiYgc3VyZmFjZSk7CiAgICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgICAgIHNldFByZXZpZXdDYWxsYmFja0ZsYWcoaW50IGZsYWcpOwogICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzdGFydFByZXZpZXcoKTsKICAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgc3RvcFByZXZpZXcoKTsKICAgICAgICAgdmlydHVhbCBib29sICAgICAgICAgICAgcHJldmlld0VuYWJsZWQoKTsKKyAgICAgICAgdmlydHVhbCBpbnQzMl90ICAgICAgICAgZ2V0TnVtYmVyT2ZWaWRlb0J1ZmZlcnMoKSBjb25zdDsKKyAgICAgICAgdmlydHVhbCBzcDxJTWVtb3J5PiAgICAgZ2V0VmlkZW9CdWZmZXIoaW50MzJfdCBpbmRleCkgY29uc3Q7CisgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHN0b3JlTWV0YURhdGFJbkJ1ZmZlcnMoYm9vbCBlbmFibGVkKTsKICAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgc3RhcnRSZWNvcmRpbmcoKTsKICAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgc3RvcFJlY29yZGluZygpOwogICAgICAgICB2aXJ0dWFsIGJvb2wgICAgICAgICAgICByZWNvcmRpbmdFbmFibGVkKCk7CkBAIC0xMzMsNiArMTQyLDkgQEAKICAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICAgICAgc3RhcnRQcmV2aWV3TW9kZSgpOwogICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgICAgICBzdGFydFJlY29yZGluZ01vZGUoKTsKIAorICAgICAgICAvLyBpbnRlcm5hbCBmdW5jdGlvbiB1c2VkIGJ5IHNlbmRDb21tYW5kIHRvIGVuYWJsZS9kaXNhYmxlIHNodXR0ZXIgc291bmQuCisgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgICAgIGVuYWJsZVNodXR0ZXJTb3VuZChib29sIGVuYWJsZSk7CisKICAgICAgICAgLy8gdGhlc2UgYXJlIHN0YXRpYyBjYWxsYmFjayBmdW5jdGlvbnMKICAgICAgICAgc3RhdGljIHZvaWQgICAgICAgICAgICAgbm90aWZ5Q2FsbGJhY2soaW50MzJfdCBtc2dUeXBlLCBpbnQzMl90IGV4dDEsIGludDMyX3QgZXh0Miwgdm9pZCogdXNlcik7CiAgICAgICAgIHN0YXRpYyB2b2lkICAgICAgICAgICAgIGRhdGFDYWxsYmFjayhpbnQzMl90IG1zZ1R5cGUsIGNvbnN0IHNwPElNZW1vcnk+JiBkYXRhUHRyLCB2b2lkKiB1c2VyKTsKQEAgLTE3MSwxMCArMTgzLDEyIEBACiAgICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU9yaWVudGF0aW9uOyAgICAgLy8gQ3VycmVudCBkaXNwbGF5IG9yaWVudGF0aW9uCiAgICAgICAgIC8vIFRydWUgaWYgZGlzcGxheSBvcmllbnRhdGlvbiBoYXMgYmVlbiBjaGFuZ2VkLiBUaGlzIGlzIG9ubHkgdXNlZCBpbiBvdmVybGF5LgogICAgICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1PcmllbnRhdGlvbkNoYW5nZWQ7CisgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBsYXlTaHV0dGVyU291bmQ7CiAKICAgICAgICAgLy8gRW5zdXJlcyBhdG9taWNpdHkgYW1v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7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKGFwcFdpZGdldElkcy5sZW5ndGggPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGZpbmFsIGludCBOID0gYXBwV2lkZ2V0SWRzLmxlbmd0aDsKKworICAgICAgICBzeW5jaHJvbml6ZWQgKG1BcHBXaWRnZXRJZHMpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBBcHBXaWRnZXRJZCBpZCA9IGxvb2t1cEFwcFdpZGdldElkTG9ja2VkKGFwcFdpZGdldElkc1tpXSk7CisgICAgICAgICAgICAgICAgdXBkYXRlQXBwV2lkZ2V0SW5zdGFuY2VMb2NrZWQoaWQsIHZpZXdzLCB0cnVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG5vdGlmeUFwcFdpZGdldFZpZXdEYXRhQ2hhbmdlZChpbnRbXSBhcHBXaWRnZXRJZHMsIGludCB2aWV3SWQpIHsKKyAgICAgICAgaWYgKGFwcFdpZGdldElkcyA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKGFwcFdpZGdldElkcy5sZW5ndGggPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGZpbmFsIGludCBOID0gYXBwV2lkZ2V0SWRzLmxlbmd0aDsKKworICAgICAgICBzeW5jaHJvbml6ZWQgKG1BcHBXaWRnZXRJZHMpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBBcHBXaWRnZXRJZCBpZCA9IGxvb2t1cEFwcFdpZGdldElkTG9ja2VkKGFwcFdpZGdldElkc1tpXSk7CisgICAgICAgICAgICAgICAgbm90aWZ5QXBwV2lkZ2V0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SArCiAgICAgICAgICAgICAgICAgICAgICIgdGVtcGVyYXR1cmU6ICIgKyBtQmF0dGVyeVRlbXBlcmF0dXJlICsKICAgICAgICAgICAgICAgICAgICAgIiB0ZWNobm9sb2d5OiAiICsgbUJhdHRlcnlUZWNobm9sb2d5ICsKICAgICAgICAgICAgICAgICAgICAgIiBBQyBwb3dlcmVkOiIgKyBtQWNPbmxpbmUgKyAiIFVTQiBwb3dlcmVkOiIgKyBtVXNiT25saW5lICsKLSAgICAgICAgICAgICAgICAgICAgIiBpY29uOiIgKyBpY29uICk7CisgICAgICAgICAgICAgICAgICAgICIgaWNvbjoiICsgaWNvbiAgKyAiIGludmFsaWQgY2hhcmdlcjoiICsgbUludmFsaWRDaGFyZ2VyKTsKICAgICAgICAgfQogCiAgICAgICAgIEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5icm9hZGNhc3RTdGlja3lJbnRlbnQoaW50ZW50LCBudWxsKTsKQEAgLTQ2MCwxOCArNDkzLDEwOSBAQAogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKLSAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCJDdXJyZW50IEJhdHRlcnkgU2VydmljZSBzdGF0ZToiKTsKLSAgICAgICAgICAgIHB3LnByaW50bG4oIiAgQUMgcG93ZXJlZDogIiArIG1BY09ubGluZSk7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCIgIFVTQiBwb3dlcmVkOiAiICsgbVVzYk9ubGluZSk7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCIgIHN0YXR1czogIiArIG1CYXR0ZXJ5U3RhdHVzKTsKLSAgICAgICAgICAgIHB3LnByaW50bG4oIiAgaGVhbHRoOiAiICsgbUJhdHRlcnlIZWFsdGgpOwotICAgICAgICAgICAgcHcucHJpbnRsbigiICBwcmVzZW50OiAiICsgbUJhdHRlcnlQcmVzZW50KTsKLSAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbGV2ZWw6ICIgKyBtQmF0dGVyeUxldmVsKTsKLSAgICAgICAgICAgIHB3LnByaW50bG4oIiAgc2NhbGU6ICIgKyBCQVRURVJZX1NDQUxFKTsKLSAgICAgICAgICAgIHB3LnByaW50bG4oIiAgdm9sdGFnZToiICsgbUJhdHRlcnlWb2x0YWdlKTsKLSAgICAgICAgICAgIHB3LnByaW50bG4oIiAgdGVtcGVyYXR1cmU6ICIgKyBtQmF0dGVyeVRlbXBlcmF0dXJlKTsKLSAgICAgICAgICAgIHB3LnByaW50bG4oIiAgdGVjaG5vbG9neTogIiArIG1CYXR0ZXJ5VGVjaG5vbG9neSk7CisgICAgICAgIGlmIChhcmdzID09IG51bGwgfHwgYXJncy5sZW5ndGggPT0gMCkgeworICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiQ3VycmVudCBCYXR0ZXJ5IFNlcnZpY2Ugc3RhdGU6Iik7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICBBQyBwb3dlcmVkOiAiICsgbUFjT25saW5lKTsKKyAgICAgICAgICAgICAgICBwdy5wcmludGxuKCIgIFVTQiBwb3dlcmVkOiAiICsgbVVzYk9ubGluZSk7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICBzdGF0dXM6ICIgKyBtQmF0dGVyeVN0YXR1cyk7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICBoZWFsdGg6ICIgKyBtQmF0dGVyeUhlYWx0aCk7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICBwcmVzZW50OiAiICsgbUJhdHRlcnlQcmVzZW50KTsKKyAgICAgICAgICAgICAgICBwdy5wcmludGxuKCIgIGxldmVsOiAiICsgbUJhdHRlcnlMZXZlbCk7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICBzY2FsZTogIiArIEJBVFRFUllfU0NBTEUpOworICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgdm9sdGFnZToiICsgbUJhdHRlcnlWb2x0YWdlKTsKKyAgICAgICAgICAgICAgICBwdy5wcmludGxuKCIgIHRlbXBlcmF0dXJlOiAiICsgbUJhdHRlcnlUZW1wZXJhdHVyZSk7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICB0ZWNobm9sb2d5OiAiICsgbUJhdHRlcnlUZWNobm9sb2d5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChmYWxzZSkgeworICAgICAgICAgICAgLy8gRE8gTk9UIFNVQk1JVCBXSVRIIFRISVMgVFVSTkVEIE9OCisgICAgICAgICAgICBpZiAoYXJncy5sZW5ndGggPT0gMyAmJiAic2V0Ii5lcXVhbHMoYXJnc1swXSkpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcga2V5ID0gYXJnc1sxXTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgdmFsdWUgPSBhcmdzWzJdOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gdXBkYXRlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCJhYyIuZXF1YWxzKGtleSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY09ubGluZSA9IEludGVnZXIucGFyc2VJbnQodmFsdWUpICE9IDA7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoInVzYiIuZXF1YWxzKGtleSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Vc2JPbmxpbmUgPSBJbnRlZ2VyLnBhcnNlSW50KHZhbHVlKSAhPSAwOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJzdGF0dXMiLmVxdWFscyhrZXkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeVN0YXR1cyA9IEludGVnZXIucGFyc2VJbnQodmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJsZXZlbCIuZXF1YWxzKGtleSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1CYXR0ZXJ5TGV2ZWwgPSBJbnRlZ2VyLnBhcnNlSW50KHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgiaW52YWxpZCIuZXF1YWxzKGtleSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1JbnZhbGlkQ2hhcmdlciA9IEludGVnZXIucGFyc2VJbnQodmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHVwZGF0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc1ZhbHVlcygpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIkJhZCB2YWx1ZTogIiArIHZhbHVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjbGFzcyBMZWQgeworICAgICAgICBwcml2YXRlIExpZ2h0c1NlcnZpY2UgbUxpZ2h0c1NlcnZpY2U7CisgICAgICAgIHByaXZhdGUgTGlnaHRzU2VydmljZS5MaWdodCBtQmF0dGVyeUxpZ2h0OworCisgICAgICAgIHByaXZhdGUgaW50IG1CYXR0ZXJ5TG93QVJHQjsKKyAgICAgICAgcHJpdmF0ZSBpbnQgbUJhdHRlcnlNZWRpdW1BUkdCOworICAgICAgICBwcml2YXRlIGludCBtQmF0dGVyeUZ1bGxBUkdCOworICAgICAgICBwcml2YXRlIGludCBtQmF0dGVyeUxlZE9uOworICAgICAgICBwcml2YXRlIGludCBtQmF0dGVyeUxlZE9mZjsKKworICAgICAgICBwcml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iwgTGlnaHRzU2VydmljZS5MSUdIVF9GTEFTSF9USU1FRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeUxlZE9uLCBtQmF0dGVyeUxlZE9mZik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gQmF0dGVyeU1hbmFnZXIuQkFUVEVSWV9TVEFUVVNfQ0hBUkdJTkcKKyAgICAgICAgICAgICAgICAgICAgfHwgc3RhdHVzID09IEJhdHRlcnlNYW5hZ2VyLkJBVFRFUllfU1RBVFVTX0ZVTEwpIHsKKyAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09IEJhdHRlcnlNYW5hZ2VyLkJBVFRFUllfU1RBVFVTX0ZVTEwgfHwgbGV2ZWwgPj0gOTApIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU29saWQgZ3JlZW4gd2hlbiBmdWxsIG9yIGNoYXJnaW5nIGFuZCBuZWFybHkgZnVsbAorICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeUxpZ2h0LnNldENvbG9yKG1CYXR0ZXJ5RnVsbEFSR0IpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFNvbGlkIG9yYW5nZSB3aGVuIGNoYXJnaW5nIGFuZCBoYWxmd2F5IGZ1bGwKKyAgICAgICAgICAgICAgICAgICAgbUJhdHRlcnlMaWdodC5zZXRDb2xvcihtQmF0dGVyeU1lZGl1bUFSR0IpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gTm8gbGlnaHRzIGlmIG5vdCBjaGFyZ2luZyBhbmQgbm90IGxvdworICAgICAgICAgICAgICAgIG1CYXR0ZXJ5TGlnaHQudHVybk9mZigpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogfQorCmRpZmYgLS1naXQgYS9zZXJ2aWNlcy9qYXZhL2NvbS9h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yeUNsaXA7CisKKyAgICBwcml2YXRlIGZpbmFsIEhhc2hTZXQ8U3RyaW5nPiBtQWN0aXZlUGVybWlzc2lvbk93bmVycworICAgICAgICAgICAgPSBuZXcgSGFzaFNldDxTdHJpbmc+KCk7CiAKICAgICAvKioKICAgICAgKiBJbnN0YW50aWF0ZXMgdGhlIGNsaXBib2FyZC4KICAgICAgKi8KLSAgICBwdWJsaWMgQ2xpcGJvYXJkU2VydmljZShDb250ZXh0IGNvbnRleHQpIHsgfQorICAgIHB1YmxpYyBDbGlwYm9hcmRTZXJ2aWNlKENvbnRleHQgY29udGV4dCkgeworICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7CisgICAgICAgIG1BbSA9IEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCk7CisgICAgICAgIG1QbSA9IGNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKTsKKyAgICAgICAgSUJpbmRlciBwZXJtT3duZXIgPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcGVybU93bmVyID0gbUFtLm5ld1VyaVBlcm1pc3Npb25Pd25lcigiY2xpcGJvYXJkIik7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBTbG9nLncoImNsaXBib2FyZCIsICJBTSBkZWFkIiwgZSk7CisgICAgICAgIH0KKyAgICAgICAgbVBlcm1pc3Npb25Pd25lciA9IHBlcm1Pd25lcjsKKyAgICB9CiAKLSAgICAvLyBqYXZhZG9jIGZyb20gaW50ZXJmYWNlCi0gICAgcHVibGljIHZvaWQgc2V0Q2xpcGJvYXJkVGV4dChDaGFyU2VxdWVuY2UgdGV4dCkgeworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVHJhbnNhY3QoaW50IGNvZGUsIFBhcmNlbCBkYXRhLCBQYXJjZWwgcmVwbHksIGludCBmbGFncykKKyAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIHN1cGVyLm9uVHJhbnNhY3QoY29kZSwgZGF0YSwgcmVwbHksIGZsYWdzKTsKKyAgICAgICAgfSBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBTbG9nLncoImNsaXBib2FyZCIsICJFeGNlcHRpb246ICIsIGUpOworICAgICAgICAgICAgdGhyb3cgZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQcmltYXJ5Q2xpcChDbGlwRGF0YSBjbGlwKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewotICAgICAgICAgICAgaWYgKHRleHQgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRleHQgPSAiIjsKKyAgICAgICAgICAgIGlmIChjbGlwICE9IG51bGwgJiYgY2xpcC5nZXRJdGVtQ291bnQoKSA8PSAwKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTm8gaXRlbXMiKTsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNoZWNrRGF0YU93bmVyTG9ja2VkKGNsaXAsIEJpbmRlci5nZXRDYWxsaW5nVWlkKCkpOworICAgICAgICAgICAgY2xlYXJBY3RpdmVPd25lcnNMb2NrZWQoKTsKKyAgICAgICAgICAgIG1QcmltYXJ5Q2xpcCA9IGNsaXA7CisgICAgICAgICAgICBmaW5hbCBpbnQgbiA9IG1QcmltYXJ5Q2xpcExpc3RlbmVycy5iZWdpbkJyb2FkY2FzdCgpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBtUHJpbWFyeUNsaXBMaXN0ZW5lcnMuZ2V0QnJvYWRjYXN0SXRlbShpKS5kaXNwYXRjaFByaW1hcnlDbGlwQ2hhbmdlZCgpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gVGhlIFJlbW90ZUNhbGxiYWNrTGlzdCB3aWxsIHRha2UgY2FyZSBvZiByZW1vdmluZworICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZGVhZCBvYmplY3QgZm9yIHVzLgorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1QcmltYXJ5Q2xpcExpc3RlbmVycy5maW5pc2hCcm9hZGNhc3QoKTsKKyAgICAgICAgfQorICAgIH0KICAgICAKLSAgICAgICAgICAgIG1DbGlwYm9hcmQgPSB0ZXh0OwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gamF2YWRvYyBmcm9tIGludGVyZmFjZQotICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0Q2xpcGJvYXJkVGV4dCgpIHsKKyAgICBwdWJsaWMgQ2xpcERhdGEgZ2V0UHJpbWFyeUNsaXAoU3RyaW5nIHBrZykgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgIHJldHVybiBtQ2xpcGJvYXJkOworICAgICAgICAgICAgYWRkQWN0aXZlT3duZXJMb2NrZWQoQmluZGVyLmdldENhbGxpbmdVaWQoKSwgcGtnKTsKKyAgICAgICAgICAgIHJldHVybiBtUHJpbWFyeUNsaXA7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICAvLyBqYXZhZG9jIGZyb20gaW50ZXJmYWNlCisgICAgcHVibGljIENsaXBEZXNjcmlwdGlvbiBnZXRQcmltYXJ5Q2xpcERlc2NyaXB0aW9uKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIHJldHVybiBtUHJpbWFyeUNsaXAuZ2V0RGVzY3JpcHRpb24oKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGhhc1ByaW1hcnlDbGlwKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIHJldHVybiBtUHJpbWFyeUNsaXAgIT0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZFByaW1hcnlDbGlwQ2hhbmdlZExpc3RlbmVyKElPblByaW1hcnlDbGlwQ2hhbmdlZExpc3RlbmVyIGxpc3RlbmVyKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgbVByaW1hcnlDbGlwTGlzdGVuZXJzLnJlZ2lzdGVyKGxpc3RlbmVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHJlbW92ZVByaW1hcnlDbGlwQ2hhbmdlZExpc3RlbmVyKElPblByaW1hcnlDbGlwQ2hhbmdlZExpc3RlbmVyIGxpc3RlbmVyKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgbVByaW1hcnlDbGlwTGlzdGVuZXJzLnVucmVnaXN0ZXIobGlzdGVuZXIpOworICAgICAgICB9CisgICAgfQorCiAgICAgcHVibGljIGJvb2xlYW4gaGFzQ2xpcGJvYXJkVGV4dCgpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7Ci0gICAgICAgICAgICByZXR1cm4gbUNsaXBib2FyZC5sZW5ndGgoKSA+IDA7CisgICAgICAgICAgICBpZiAobVByaW1hcnlDbGlwICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGV4dCA9IG1QcmltYXJ5Q2xpcC5nZXRJdGVtKDApLmdldFRleHQoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdGV4dCAhPSBudWxsICYmIHRleHQubGVuZ3RoKCkgPiAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCB2b2lkIGNoZWNrVXJpT3duZXJMb2NrZWQoVXJpIHVyaSwgaW50IHVpZCkgeworICAgICAgICBpZiAoISJjb250ZW50Ii5lcXVhbHModXJpLmdldFNjaGVtZSgpKSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKKyAgICAgICAgYm9vbGVhbiBhbGxvd2VkID0gZmFsc2U7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICAvLyBUaGlzIHdpbGwgdGhyb3cgU2VjdXJpdHlFeGNlcHRpb24gZm9yIHVzLgorICAgICAgICAgICAgbUFtLmNoZWNrR3JhbnRVcmlQZXJtaXNzaW9uKHVpZCwgbnVsbCwgdXJpLCBJbnRlbnQuRkxBR19HUkFOVF9SRUFEX1VSSV9QRVJNSVNTSU9OKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgdm9pZCBjaGVja0l0ZW1Pd25lckxvY2tlZChDbGlwRGF0YS5JdGVtIGl0ZW0sIGludCB1aWQpIHsKKyAgICAgICAgaWYgKGl0ZW0uZ2V0VXJpKCkgIT0gbnVsbCkgeworICAgICAgICAgICAgY2hlY2tVcmlPd25lckxvY2tlZChpdGVtLmdldFVyaSgpLCB1aWQpOworICAgICAgICB9CisgICAgICAgIEludGVudCBpbnRlbnQgPSBpdGVtLmdldEludGVudCgpOworICAgICAgICBpZiAoaW50ZW50ICE9IG51bGwgJiYgaW50ZW50LmdldERhdGEoKSAhPSBudWxsKSB7CisgICAgICAgICA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ZChpdGVtLmdldFVyaSgpLCBwa2cpOworICAgICAgICB9CisgICAgICAgIEludGVudCBpbnRlbnQgPSBpdGVtLmdldEludGVudCgpOworICAgICAgICBpZiAoaW50ZW50ICE9IG51bGwgJiYgaW50ZW50LmdldERhdGEoKSAhPSBudWxsKSB7CisgICAgICAgICAgICBncmFudFVyaUxvY2tlZChpbnRlbnQuZ2V0RGF0YSgpLCBwa2cpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCB2b2lkIGFkZEFjdGl2ZU93bmVyTG9ja2VkKGludCB1aWQsIFN0cmluZyBwa2cpIHsKKyAgICAgICAgUGFja2FnZUluZm8gcGk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBwaSA9IG1QbS5nZXRQYWNrYWdlSW5mbyhwa2csIDApOworICAgICAgICAgICAgaWYgKHBpLmFwcGxpY2F0aW9uSW5mby51aWQgIT0gdWlkKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFNlY3VyaXR5RXhjZXB0aW9uKCJDYWxsaW5nIHVpZCAiICsgdWlkCisgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3Qgb3duIHBhY2thZ2UgIiArIHBrZyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKE5hbWVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIHBhY2thZ2UgIiArIHBrZywgZSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFtQWN0aXZlUGVybWlzc2lvbk93bmVycy5jb250YWlucyhwa2cpKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1QcmltYXJ5Q2xpcC5nZXRJdGVtQ291bnQoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBncmFudEl0ZW1Mb2NrZWQobVByaW1hcnlDbGlwLmdldEl0ZW0oaSksIHBrZyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtQWN0aXZlUGVybWlzc2lvbk93bmVycy5hZGQocGtnKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgdm9pZCByZXZva2VVcmlMb2NrZWQoVXJpIHVyaSkgeworICAgICAgICBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtQW0ucmV2b2tlVXJpUGVybWlzc2lvbkZyb21Pd25lcihtUGVybWlzc2lvbk93bmVyLCB1cmksCisgICAgICAgICAgICAgICAgICAgIEludGVudC5GTEFHX0dSQU5UX1JFQURfVVJJX1BFUk1JU1NJT04KKyAgICAgICAgICAgICAgICAgICAgfCBJbnRlbnQuRkxBR19HUkFOVF9XUklURV9VUklfUEVSTUlTU0lPTik7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIHZvaWQgcmV2b2tlSXRlbUxvY2tlZChDbGlwRGF0YS5JdGVtIGl0ZW0pIHsKKyAgICAgICAgaWYgKGl0ZW0uZ2V0VXJpKCkgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV2b2tlVXJpTG9ja2VkKGl0ZW0uZ2V0VXJpKCkpOworICAgICAgICB9CisgICAgICAgIEludGVudCBpbnRlbnQgPSBpdGVtLmdldEludGVudCgpOworICAgICAgICBpZiAoaW50ZW50ICE9IG51bGwgJiYgaW50ZW50LmdldERhdGEoKSAhPSBudWxsKSB7CisgICAgICAgICAgICByZXZva2VVcmlMb2NrZWQoaW50ZW50LmdldERhdGEoKSk7CisgICAg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ml2YXRlIGludCBtTmV0VHJhbnNpdGlvbldha2VMb2NrVGltZW91dDsKKworICAgIHByaXZhdGUgSW5ldEFkZHJlc3MgbURlZmF1bHREbnM7CisKICAgICAvLyB1c2VkIGluIERCRyBtb2RlIHRvIHRyYWNrIGluZXQgY29uZGl0aW9uIHJlcG9ydHMKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgSU5FVF9DT05ESVRJT05fTE9HX01BWF9TSVpFID0gMTU7CiAgICAgcHJpdmF0ZSBBcnJheUxpc3QgbUluZXRMb2c7CkBAIC0yMTAsNTIgKzIzNCwyMCBAQAogICAgIH0KICAgICBSYWRpb0F0dHJpYnV0ZXNbXSBtUmFkaW9BdHRyaWJ1dGVzOwogCi0gICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgQ29ubmVjdGl2aXR5VGhyZWFkIGV4dGVuZHMgVGhyZWFkIHsKLSAgICAgICAgcHJpdmF0ZSBDb250ZXh0IG1Db250ZXh0OwotCi0gICAgICAgIHByaXZhdGUgQ29ubmVjdGl2aXR5VGhyZWFkKENvbnRleHQgY29udGV4dCkgewotICAgICAgICAgICAgc3VwZXIoIkNvbm5lY3Rpdml0eVRocmVhZCIpOwotICAgICAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OworICAgIHB1YmxpYyBzdGF0aWMgc3luY2hyb25pemVkIENvbm5lY3Rpdml0eVNlcnZpY2UgZ2V0SW5zdGFuY2UoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChzU2VydmljZUluc3RhbmNlID09IG51bGwpIHsKKyAgICAgICAgICAgIHNTZXJ2aWNlSW5zdGFuY2UgPSBuZXcgQ29ubmVjdGl2aXR5U2VydmljZShjb250ZXh0KTsKICAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0gICAgICAgICAgICBMb29wZXIucHJlcGFyZSgpOwotICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7Ci0gICAgICAgICAgICAgICAgc1NlcnZpY2VJbnN0YW5jZSA9IG5ldyBDb25uZWN0aXZpdHlTZXJ2aWNlKG1Db250ZXh0KTsKLSAgICAgICAgICAgICAgICBub3RpZnlBbGwoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIExvb3Blci5sb29wKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgc3RhdGljIENvbm5lY3Rpdml0eVNlcnZpY2UgZ2V0U2VydmljZUluc3RhbmNlKENvbnRleHQgY29udGV4dCkgewotICAgICAgICAgICAgQ29ubmVjdGl2aXR5VGhyZWFkIHRocmVhZCA9IG5ldyBDb25uZWN0aXZpdHlUaHJlYWQoY29udGV4dCk7Ci0gICAgICAgICAgICB0aHJlYWQuc3RhcnQoKTsKLQotICAgICAgICAgICAgc3luY2hyb25pemVkICh0aHJlYWQpIHsKLSAgICAgICAgICAgICAgICB3aGlsZSAoc1NlcnZpY2VJbnN0YW5jZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXYWl0IHVudGlsIHNTZXJ2aWNlSW5zdGFuY2UgaGFzIGJlZW4gaW5pdGlhbGl6ZWQuCi0gICAgICAgICAgICAgICAgICAgICAgICB0aHJlYWQud2FpdCgpOwotICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBpZ25vcmUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuZXhwZWN0ZWQgSW50ZXJydXB0ZWRFeGNlcHRpb24gd2hpbGUgd2FpdGluZyIrCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBmb3IgQ29ubmVjdGl2aXR5U2VydmljZSB0aHJlYWQiKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgI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RlZmF1bHQgZG5zIHNlcnZlciBpcAorICAgICAgICBTdHJpbmcgZG5zID0gU2V0dGluZ3MuU2VjdXJlLmdldFN0cmluZyhjb250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAorICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5ERUZBVUxUX0ROU19TRVJWRVIpOworICAgICAgICBpZiAoZG5zID09IG51bGwgfHwgZG5zLmxlbmd0aCgpID09IDApIHsKKyAgICAgICAgICAgIGRucyA9IGNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0U3RyaW5nKAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5jb25maWdfZGVmYXVsdF9kbnNfc2VydmVyKTsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgbURlZmF1bHREbnMgPSBJbmV0QWRkcmVzcy5nZXRCeU5hbWUoZG5zKTsKKyAgICAgICAgfSBjYXRjaCAoVW5rbm93bkhvc3RFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgU2xvZy5lKFRBRywgIkVycm9yIHNldHRpbmcgZGVmYXVsdERucyB1c2luZyAiICsgZG5zKTsKKyAgICAgICAgfQorCiAgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKKworICAgICAgICBQb3dlck1hbmFnZXIgcG93ZXJNYW5hZ2VyID0gKFBvd2VyTWFuYWdlciltQ29udGV4dC5nZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuUE9XRVJfU0VSVklDRSk7CisgICAgICAgIG1OZXRUcmFuc2l0aW9uV2FrZUxvY2sgPSBwb3dlck1hbmFnZXIubmV3V2FrZUxvY2soUG93ZXJNYW5hZ2VyLlBBUlRJQUxfV0FLRV9MT0NLLCBUQUcpOworICAgICAgICBtTmV0VHJhbnNpdGlvbldha2VMb2NrVGltZW91dCA9IG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldEludGVnZXIoCisgICAgICAgICAgICAgIC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gIG1OZXRUcmFja2Vyc1tuZXRUeXBlXS5zdGFydE1vbml0b3JpbmcoY29udGV4dCwgbUhhbmRsZXIpOwogICAgICAgICAgICAgICAgIGlmIChub01vYmlsZURhdGEpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgU2xvZy5kKFRBRywgInRlYXJpbmcgZG93biBNb2JpbGUgbmV0d29ya3MgZHVlIHRvIHNldHRpbmciKTsKICAgICAgICAgICAgICAgICAgICAgbU5ldFRyYWNrZXJzW25ldFR5cGVdLnRlYXJkb3duKCk7CkBAIC0zOTIsNyArNDA1LDggQEAKICAgICAgICAgbVRldGhlcmluZ0NvbmZpZ1ZhbGlkID0gKCgobU5ldFRyYWNrZXJzW0Nvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9NT0JJTEVfRFVOXSAhPSBudWxsKSB8fAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFtVGV0aGVyaW5nLmlzRHVuUmVxdWlyZWQoKSkgJiYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtVGV0aGVyaW5nLmdldFRldGhlcmFibGVVc2JSZWdleHMoKS5sZW5ndGggIT0gMCB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXRoZXJpbmcuZ2V0VGV0aGVyYWJsZVdpZmlSZWdleHMoKS5sZW5ndGggIT0gMCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGV0aGVyaW5nLmdldFRldGhlcmFibGVXaWZpUmVnZXhzKCkubGVuZ3RoICE9IDAgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGV0aGVyaW5nLmdldFRldGhlcmFibGVCbHVldG9vdGhSZWdleHMoKS5sZW5ndGggIT0gMCkgJiYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXRoZXJpbmcuZ2V0VXBzdHJlYW1JZmFjZVJlZ2V4cygpLmxlbmd0aCAhPSAwKTsKI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mtJbmZvIGluZm8gPSB0LmdldE5ldHdvcmtJbmZvKCk7CisgICAgICAgICAgICBpZiAoaW5mby5pc0Nvbm5lY3RlZCgpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHQuZ2V0TGlua1Byb3BlcnRpZXMoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgTGlua1Byb3BlcnRpZXMgZ2V0TGlua1Byb3BlcnRpZXMoaW50IG5ldHdvcmtUeXBlKSB7CisgICAgICAgIGVuZm9yY2VBY2Nlc3NQZXJtaXNzaW9uKCk7CisgICAgICAgIGlmIChDb25uZWN0aXZpdHlNYW5hZ2VyLmlzTmV0d29ya1R5cGVWYWxpZChuZXR3b3JrVHlwZSkpIHsKKyAgICAgICAgICAgIE5ldHdvcmtTdGF0ZVRyYWNrZXIgdCA9IG1OZXRUcmFja2Vyc1tuZXR3b3JrVHlwZV07CisgICAgICAgICAgICBpZiAodCAhPSBudWxsKSByZXR1cm4gdC5nZXRMaW5rUHJvcGVydGllcygpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKwogICAgIHB1YmxpYyBib29sZWFuIHNldFJhZGlvcyhib29sZWFuIHR1cm5PbikgewogICAgICAgICBib29sZWFuIHJlc3VsdCA9IHRydWU7CiAgICAgICAgIGVuZm9yY2VDaGFuZ2VQZXJtaXNzaW9uKCk7CkBAIC02NzYsMTQgKzcyMiw3IEBACiAgICAgICAgICAgICAgICAgbmV0d29yay5yZWNvbm5lY3QoKTsKICAgICAgICAgICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1JFUVVFU1RfU1RBUlRFRDsKICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgbUZlYXR1cmVVc2Vycy5hZGQoZik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtSGFuZGxlci5vYnRhaW5NZXNzYWdlKEVWRU5UX1JFU1RPUkVfREVGQVVMVF9ORVRXT1JLLAotICAgICAgICAgICAgICAgICAgICAgICAgZiksIGdldFJlc3RvcmVEZWZhdWx0TmV0d29ya0RlbGF5KCkpOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIG5ldHdvcmsuc3RhcnRVc2luZ05ldHdvcmtGZWF0dXJlKGZlYXR1cmUsCi0gICAgICAgICAgICAgICAgICAgICAgICBnZXRDYWxsaW5nUGlkKCksIGdldENhbGxpbmdVaWQoKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fVFlQRV9OT1RfQVZBSUxBQkxFOwpAQCAtODAyLDggKzg0MSw3IEBACiAgICAgICAgICAgICB0cmFja2VyLnRlYXJkb3duKCk7CiAgICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIGRvIGl0IHRoZSBvbGQgZmFzaGlvbmVkIHdheQotICAgICAgICAgICAgcmV0dXJuIHRyYWNrZXIuc3RvcFVzaW5nTmV0d29ya0ZlYXR1cmUoZmVhdHVyZSwgcGlkLCB1aWQpOworICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgICB9CiAgICAgfQogCkBAIC04NTIsMTEgKzg5MCwzNyBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9Ci0KICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIEluZXRBZGRyZXNzIGluZXRBZGRyZXNzID0gSW5ldEFkZHJlc3MuZ2V0QnlBZGRyZXNzKGhvc3RBZGRyZXNzKTsKLSAgICAgICAgICAgIHJldHVybiB0cmFja2VyLnJlcXVlc3RSb3V0ZVRvSG9zdChp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MgcCA9IG50LmdldExpbmtQcm9wZXJ0aWVzKCk7CisgICAgICAgIGlmIChwID09IG51bGwpIHJldHVybiBmYWxzZTsKKyAgICAgICAgU3RyaW5nIGludGVyZmFjZU5hbWUgPSBwLmdldEludGVyZmFjZU5hbWUoKTsKKworICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAiUmVxdWVzdGVkIGhvc3Qgcm91dGUgdG8gIiArIGhvc3RBZGRyZXNzICsgIigiICsgaW50ZXJmYWNlTmFtZSArICIpIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGludGVyZmFjZU5hbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIE5ldHdvcmtVdGlscy5hZGRIb3N0Um91dGUoaW50ZXJmYWNlTmFtZSwgaG9zdEFkZHJlc3MsIG51bGwpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKERCRykgU2xvZy5lKFRBRywgImFkZEhvc3RSb3V0ZSBmYWlsZWQgZHVlIHRvIG51bGwgaW50ZXJmYWNlIG5hbWUiKTsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogICAgIH0KQEAgLTk3NSw2ICsxMDM5LDEyIEBACiAgICAgICAgICAgICAgICAgIkNvbm5lY3Rpdml0eVNlcnZpY2UiKTsKICAgICB9CiAKKyAgICBwcml2YXRlIHZvaWQgZW5mb3JjZUNvbm5lY3Rpdml0eUludGVybmFsUGVybWlzc2lvbigpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKAorICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5DT05ORUNUSVZJVFlfSU5URVJOQUwsCisgICAgICAgICAgICAgICAgIkNvbm5lY3Rpdml0eVNlcnZpY2UiKTsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBIYW5kbGUgYSB7QGNvZGUgRElTQ09OTkVDVEVEfSBldmVudC4gSWYgdGhpcyBwZXJ0YWlucyB0byB0aGUgbm9uLWFjdGl2ZQogICAgICAqIG5ldHdvcmssIHdlIGlnbm9yZSBpdC4gSWYgaXQgaXMgZm9yIHRoZSBhY3RpdmUgbmV0d29yaywgd2Ugc2VuZCBvdXQgYQpAQCAtMTI2Niw5ICsxMzM2LDE3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiTmV0d29yayBkZWNsaW5lZCB0ZWFyZG93biByZXF1ZXN0Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGlzRmFpbG92ZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyTmV0LnJlbGVhc2VXYWtlTG9jaygpOwotICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgc3luY2hyb25pemVkIChDb25uZWN0aXZpdHlTZXJ2aWNlLnRoaXMpIHsKKyAgICAgICAgICAgICAgICAvLyBoYXZlIGEgbmV3IGRlZmF1bHQgbmV0d29yaywgcmVsZWFzZSB0aGUgdHJhbnNpdGlvbiB3YWtlbG9jayBpbiBhIHNlY29uZAorICAgICAgICAgICAgICAgIC8vIGlmIGl0J3MgaGVsZC4gIFRoZSBzZWNvbmQgcGF1c2UgaXMgdG8gYWxsb3cgYXBwcyB0byByZWNvbm5lY3Qgb3ZlciB0aGUKKyAgICAgICAgICAgICAgICAvLyBuZXcgbmV0d29yaworICAgICAgICAgICAgICAgIGlmIChtTmV0VHJhbnNpdGlvbldha2VMb2NrLmlzSGVsZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtSGFuZGxlci5vYnRhaW5NZXNzYWdlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVWRU5UX0NMRUFSX05FVF9UUkFOU0lUSU9OX1dBS0VMT0NLLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1OZXRUcmFuc2l0aW9uV2FrZUxvY2tTZXJpYWxOdW1iZXIsIDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwMDApOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1BY3RpdmVEZWZhdWx0TmV0d29yayA9IHR5cGU7CkBAIC0xMjgyLDM2ICsxMzYwLDE0IEBACiAgICAgICAgICAgICAvL3JlcG9ydE5ldHdvcmtDb25kaXRpb24obUFjdGl2ZURlZmF1bHROZXR3b3JrLCAxMDApOwogICAgICAgICB9CiAgICAgICAgIHRoaXNOZXQuc2V0VGVhcmRvd25SZXF1ZXN0ZWQoZmFsc2UpOwotICAgICAgICB0aGlzTmV0LnVwZGF0ZU5ldHdvcmtTZXR0aW5ncygpOworICAgICAgICB1cGRhdGVOZXR3b3JrU2V0dGluZ3ModGhpc05ldCk7CiAgICAgICAgIGhhbmRsZUNvbm5lY3Rpdml0eUNoYW5nZSh0eXBlKTsKICAgICAgICAgc2VuZENvbm5lY3RlZEJyb2FkY2FzdChpbmZvKTsKICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgaGFuZGxlU2NhblJlc3VsdHNBdmFpbGFibGUoTmV0d29ya0luZm8gaW5mbykgewotICAgICAgICBpbnQgbmV0d29ya1R5cGUgPSBpbmZvLmdldFR5cGUoKTsKLSAgICAgICAgaWYgKG5ldHdvcmtUeXBlICE9IENvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9XSUZJKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSBTbG9nLnYoVEFHLCAiR290IFNjYW5SZXN1bHRzQXZhaWxhYmxlIGZvciAiICsKLSAgICAgICAgICAgICAgICAgICAgaW5mby5nZXRUeXBlTmFtZSgpICsgIiBuZXR3b3JrLiBEb24ndCBrbm93IGhvdyB0byBoYW5kbGUuIik7Ci0g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ICAgICAgcmVtb3ZlUHJpdmF0ZURuc1JvdXRlcyhtTmV0VHJhY2tlcnNbbmV0VHlwZV0pOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIGFkZFByaXZhdGVEbnNSb3V0ZXMoTmV0d29ya1N0YXRlVHJhY2tlciBudCkgeworICAgICAgICBib29sZWFuIHByaXZhdGVEbnNSb3V0ZVNldCA9IG50LmlzUHJpdmF0ZURuc1JvdXRlU2V0KCk7CisgICAgICAgIExpbmtQcm9wZXJ0aWVzIHAgPSBudC5nZXRMaW5rUHJvcGVydGllcygpOworICAgICAgICBpZiAocCA9PSBudWxsKSByZXR1cm47CisgICAgICAgIFN0cmluZyBpbnRlcmZhY2VOYW1lID0gcC5nZXRJbnRlcmZhY2VOYW1lKCk7CisKKyAgICAgICAgaWYgKERCRykgeworICAgICAgICAgICAgU2xvZy5kKFRBRywgImFkZFByaXZhdGVEbnNSb3V0ZXMgZm9yICIgKyBudCArCisgICAgICAgICAgICAgICAgICAgICIoIiArIGludGVyZmFjZU5hbWUgKyAiKSAtIG1Qcml2YXRlRG5zUm91dGVTZXQgPSAiICsgcHJpdmF0ZURuc1JvdXRlU2V0KTsKKyAgICAgICAgfQorICAgICAgICBpZiAoaW50ZXJmYWNlTmFtZSAhPSBudWxsICYmICFwcml2YXRlRG5zUm91dGVTZXQpIHsKKyAgICAgICAgICAgIENvbGxlY3Rpb248SW5ldEFkZHJlc3M+IGRuc0xpc3QgPSBwLmdldERuc2VzKCk7CisgICAgICAgICAgICBmb3IgKEluZXRBZGRyZXNzIGRucyA6IGRuc0xpc3QpIHsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBTbG9nLmQoVEFHLCAiICBhZGRpbmcgIiArIGRucyk7CisgICAgICAgICAgICAgICAgTmV0d29ya1V0aWxzLmFkZEhvc3RSb3V0ZShpbnRlcmZhY2VOYW1lLCBkbnMsIG51bGwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbnQucHJpdmF0ZURuc1JvdXRlU2V0KHRydWUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlbW92ZVByaXZhdGVEbnNSb3V0ZXMoTmV0d29ya1N0YXRlVHJhY2tlciBudCkgeworICAgICAgICAvLyBUT0RPIC0gd2Ugc2hvdWxkIGRvIHRoaXMgZXhwbGljaXRseSBidXQgdGhlIE5ldFV0aWxzIGFwaSBkb2VzbnQKKyAgICAgICAgLy8gc3VwcG9ydCB0aGlzIHlldCAtIG11c3QgcmVtb3ZlIGFsbC4gIE5vIHdvcnNlIHRoYW4gYmVmb3JlCisgICAgICAgIExpbmtQcm9wZXJ0aWVzIHAgPSBudC5nZXRMaW5rUHJvcGVydGllcygpOworICAgICAgICBpZiAocCA9PSBudWxsKSByZXR1cm47CisgICAgICAgIFN0cmluZyBpbnRlcmZhY2VOYW1lID0gcC5nZXRJbnRlcmZhY2VOYW1lKCk7CisgICAgICAgIGJvb2xlYW4gcHJpdmF0ZURuc1JvdXRlU2V0ID0gbnQuaXNQcml2YXRlRG5zUm91dGVTZXQoKTsKKyAgICAgICAgaWYgKGludGVyZmFjZU5hbWUgIT0gbnVsbCAmJiBwcml2YXRlRG5zUm91dGVTZXQpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAicmVtb3ZlUHJpdmF0ZURuc1JvdXRlcyBmb3IgIiArIG50LmdldE5ldHdvcmtJbmZvKCkuZ2V0VHlwZU5hbWUoKSArCisgICAgICAgICAgICAgICAgICAgICAgICAiICgiICsgaW50ZXJmYWNlTmFtZSArICIpIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBOZXR3b3JrVXRpbHMucmVtb3ZlSG9zdFJvdXRlcyhpbnRlcmZhY2VOYW1lKTsKKyAgICAgICAgICAgIG50LnByaXZhdGVEbnNSb3V0ZVNldChmYWxzZSk7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIHByaXZhdGUgdm9pZCBhZGREZWZhdWx0Um91dGUoTmV0d29ya1N0YXRlVHJhY2tlciBudCkgeworICAgICAgICBMaW5rUHJvcGVydGllcyBwID0gbnQuZ2V0TGlua1Byb3BlcnRpZXMoKTsKKyAgICAgICAgaWYgKHAgPT0gbnVsbCkgcmV0dXJuOworICAgICAgICBTdHJpbmcgaW50ZXJmYWNlTmFtZSA9IHAuZ2V0SW50ZXJmYWNlTmFtZSgpOworICAgICAgICBJbmV0QWRkcmVzcyBkZWZhdWx0R2F0ZXdheUFkZHIgPSBwLmdldEdhdGV3YXkoKTsKKworICAgICAgICBpZiAoKGludGVyZmFjZU5hbWUgIT0gbnVsbCkgJiYgKGRlZmF1bHRHYXRld2F5QWRkciAhPSBudWxsICkpIHsKKyAgICAgICAgICAgIGlmICghTmV0d29ya1V0aWxzLmFkZERlZmF1bHRSb3V0ZShpbnRlcmZhY2VOYW1lLCBkZWZhdWx0R2F0ZXdheUFkZHIpICYmIERCRykgeworICAgICAgICAgICAgICAgIE5ldHdvcmtJbmZvIG5ldHdvcmtJbmZvID0gbnQuZ2V0TmV0d29ya0luZm8oKTsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiYWRkRGVmYXVsdFJvdXRlIGZvciAiICsgbmV0d29ya0luZm8uZ2V0VHlwZU5hbWUoKSArCisgICAgICAgICAgICAgICAgICAgICAgICAiICgiICsgaW50ZXJmYWNlTmFtZSArICIpLCBHYXRld2F5QWRkcj0iICsgZGVmYXVsdEdhdGV3YXlBZGRyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworCisgICAgcHVibGljIHZvaWQgcmVtb3ZlRGVmYXVsdFJvdXRlKE5ldHdvcmtTdGF0ZVRyYWNrZXIgbnQpIHsKKyAgICAgICAgTGlua1Byb3BlcnRpZXMgcCA9IG50LmdldExpbmtQcm9wZXJ0aWVzKCk7CisgICAgICAgIGlmIChwID09IG51bGwpIHJldHVybjsKKyAgICAgICAgU3RyaW5nIGludGVyZmFjZU5hbWUgPSBwLmdldEludGVyZmFjZU5hbWUoKTsKKworICAgICAgICBpZiAoaW50ZXJmYWNlTmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAoKE5ldHdvcmtVdGlscy5yZW1vdmVEZWZhdWx0Um91dGUoaW50ZXJmYWNlTmFtZSkgPj0gMCkgJiYgREJHKSB7CisgICAgICAgICAgICAgICAgTmV0d29ya0luZm8gbmV0d29ya0luZm8gPSBudC5nZXROZXR3b3JrSW5mbygpOworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJyZW1vdmVEZWZhdWx0Um91dGUgZm9yICIgKyBuZXR3b3JrSW5mby5nZXRUeXBlTmFtZSgpICsgIiAoIiArCisgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcmZhY2VOYW1lICsgIikiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgLyoqCisgICAgICogUmVhZHMgdGhlIG5ldHdvcmsgc3BlY2lmaWMgVENQIGJ1ZmZlciBzaXplcyBmcm9tIFN5c3RlbVByb3BlcnRpZXMKKyAgICAgKiBuZXQudGNwLmJ1ZmZlcnNpemUuW2RlZmF1bHR8d2lmaXx1bXRzfGVkZ2V8Z3Byc10gYW5kIHNldCB0aGVtIGZvciBzeXN0ZW0KKyAgICAgKiB3aWRlIHVzZQorICAgICAqLworICAgcHVibGljIHZvaWQgdXBkYXRlTmV0d29ya1NldHRpbmdzKE5ldHdvcmtTdGF0ZVRyYWNrZXIgbnQpIHsKKyAgICAgICAgU3RyaW5nIGtleSA9IG50LmdldFRjcEJ1ZmZlclNpemVzUHJvcE5hbWUoKTsKKyAgICAgICAgU3RyaW5nIGJ1ZmZlclNpemVzID0gU3lzdGVtUHJvcGVydGllcy5nZXQoa2V5KTsKKworICAgICAgICBpZiAoYnVmZmVyU2l6ZXMubGVuZ3RoKCkgPT0gMCkgeworICAgICAgICAgICAgU2xvZy5lKFRBRywga2V5ICsgIiBub3QgZm91b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ICBwcml2YXRlIHZvaWQgc2V0QnVmZmVyU2l6ZShTdHJpbmcgYnVmZmVyU2l6ZXMpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIFN0cmluZ1tdIHZhbHVlcyA9IGJ1ZmZlclNpemVzLnNwbGl0KCIsIik7CisKKyAgICAgICAgICAgIGlmICh2YWx1ZXMubGVuZ3RoID09IDYpIHsKKyAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHByZWZpeCA9ICIvc3lzL2tlcm5lbC9pcHY0L3RjcF8iOworICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAicm1lbV9taW4iLCB2YWx1ZXNbMF0pOworICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAicm1lbV9kZWYiLCB2YWx1ZXNbMV0pOworICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAicm1lbV9tYXgiLCB2YWx1ZXNbMl0pOworICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAid21lbV9taW4iLCB2YWx1ZXNbM10pOworICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAid21lbV9kZWYiLCB2YWx1ZXNbNF0pOworICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAid21lbV9tYXgiLCB2YWx1ZXNbNV0pOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiSW52YWxpZCBidWZmZXJzaXplIHN0cmluZzogIiArIGJ1ZmZlclNpemVzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgU2xvZy5lKFRBRywgIkNhbid0IHNldCB0Y3AgYnVmZmVyIHNpemVzOiIgKyBlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgLyoqCisgICAgICogV3JpdGVzIHN0cmluZyB0byBmaWxlLiBCYXNpY2FsbHkgc2FtZSBhcyAiZWNobyAtbiAkc3RyaW5nID4gJGZpbGVuYW1lIgorICAgICAqCisgICAgICogQHBhcmFtIGZpbGVuYW1lCisgICAgICogQHBhcmFtIHN0cmluZworICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgc3RyaW5nVG9GaWxlKFN0cmluZyBmaWxlbmFtZSwgU3RyaW5nIHN0cmluZykgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgRmlsZVdyaXRlciBvdXQgPSBuZXcgRmlsZVdyaXRlcihmaWxlbmFtZSk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBvdXQud3JpdGUoc3RyaW5nKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIG91dC5jbG9zZSgpOworICAgICAgICB9CisgICAgfQorCisKICAgICAvKioKICAgICAgKiBBZGp1c3QgdGhlIHBlci1wcm9jZXNzIGRucyBlbnRyaWVzIChuZXQuZG5zPHg+LjxwaWQ+KSBiYXNlZAogICAgICAqIG9uIHRoZSBoaWdoZXN0IHByaW9yaXR5IGFjdGl2ZSBuZXQgd2hpY2ggdGhpcyBwcm9jZXNzIHJlcXVlc3RlZC4KQEAgLTEzNTIsMTIgKzE1NDcsMTQgQEAKICAgICAgICAgICAgIE5ldHdvcmtTdGF0ZVRyYWNrZXIgbnQgPSBtTmV0VHJhY2tlcnNbaV07CiAgICAgICAgICAgICBpZiAobnQuZ2V0TmV0d29ya0luZm8oKS5pc0Nvbm5lY3RlZCgpICYmCiAgICAgICAgICAgICAgICAgICAgICFudC5pc1RlYXJkb3duUmVxdWVzdGVkKCkpIHsKKyAgICAgICAgICAgICAgICBMaW5rUHJvcGVydGllcyBwID0gbnQuZ2V0TGlua1Byb3BlcnRpZXMoKTsKKyAgICAgICAgICAgICAgICBpZiAocCA9PSBudWxsKSBjb250aW51ZTsKICAgICAgICAgICAgICAgICBMaXN0IHBpZHMgPSBtTmV0UmVxdWVzdGVyc1BpZHNbaV07CiAgICAgICAgICAgICAgICAgZm9yIChpbnQgaj0wOyBqPHBpZHMuc2l6ZSgpOyBqKyspIHsKICAgICAgICAgICAgICAgICAgICAgSW50ZWdlciBwaWQgPSAoSW50ZWdlcilwaWRzLmdldChqKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKHBpZC5pbnRWYWx1ZSgpID09IG15UGlkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSBkbnNMaXN0ID0gbnQuZ2V0TmFtZVNlcnZlcnMoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlUGlkRG5zKGRuc0xpc3QsIG15UGlkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIENvbGxlY3Rpb248SW5ldEFkZHJlc3M+IGRuc2VzID0gcC5nZXREbnNlcygpOworICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVQaWREbnMoZG5zZXMsIG15UGlkKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb0J1bXApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidW1wRG5zKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CkBAIC0xMzc5LDEyICsxNTc2LDEwIEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgd3JpdGVQaWREbnMoU3RyaW5nW10gZG5zTGlzdCwgaW50IHBpZCkgeworICAgIHByaXZhdGUgdm9pZCB3cml0ZVBpZERucyhDb2xsZWN0aW9uIDxJbmV0QWRkcmVzcz4gZG5zZXMsIGludCBwaWQpIHsKICAgICAgICAgaW50IGogPSAxOwotICAgICAgICBmb3IgKFN0cmluZyBkbnMgOiBkbnNMaXN0KSB7Ci0gICAgICAgICAgICBpZiAoZG5zICE9IG51bGwgJiYgIVRleHRVdGlscy5lcXVhbHMoZG5zLCAiMC4wLjAuMCIpKSB7Ci0gICAgICAgICAgICAgICAgU3lzdGVtUHJvcGVydGllcy5zZXQoIm5ldC5kbnMiICsgaisrICsgIi4iICsgcGlkLCBkbnMpOwotICAgICAgICAgICAgfQorICAgICAgICBmb3IgKEluZXRBZGRyZXNzIGRucyA6IGRuc2VzKSB7CisgICAgICAgICAgICBTeXN0ZW1Qcm9wZXJ0aWVzLnNldCgibmV0LmRucyIgKyBqKysgKyAiLiIgKyBwaWQsIGRucy5nZXRIb3N0QWRkcmVzcygpKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTQwNywxNiArMTYwMiwyNCBAQAogICAgICAgICAvLyBhZGQgZGVmYXVsdCBuZXQncyBkbnMgZW50cmllcwogICAgICAgICBOZXR3b3JrU3RhdGVUcmFja2VyIG50ID0gbU5ldFRyYWNrZXJzW25ldFR5cGVdOwogICAgICAgICBpZiAobnQgIT0gbnVsbCAmJiBudC5nZXROZXR3b3JrSW5mbygpLmlzQ29ubmVjdGVkKCkgJiYgIW50LmlzVGVhcmRvd25SZXF1ZXN0ZWQoKSkgewotICAgICAgICAgICAgU3RyaW5nW10gZG5zTGlzdCA9IG50LmdldE5hbWVTZXJ2ZXJzKCk7CisgICAgICAgICAgICBMaW5rUHJvcGVydGllcyBwID0gbnQuZ2V0TGlua1Byb3BlcnRpZXMoKTsKKyAgICAgICAgICAgIGlmIChwID09IG51bGwpIHJldHVybjsKKyAgICAgICAgICAgIENvbGxlY3Rpb248SW5ldEFkZHJlc3M+IGRuc2VzID0gcC5nZXREbnNlcygpOwogICAgICAgICAgICAgaWYgKG1OZXRBdHRyaWJ1dGVzW25ldFR5cGVdLmlzRGVmYXVsdCgpKSB7CiAgICAgICAgICAgICAgICAgaW50IGogPSAxOwotICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIGRucyA6IGRuc0xpc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRucyAhPSBudWxsICYmICFUZXh0VXRpbHMuZXF1YWxzKGRucywgIjAuMC4wLjAiKSkgeworICAgICAgICAgICAgICAgIGlmIChkbnNlcy5zaXplKCkgPT0gMCAmJiBtRGVmYXVsdERucyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJubyBkbnMgcHJvdmlkZWQgLSB1c2luZyAiICsgbURlZmF1bHREbnMuZ2V0SG9zdEFkZHJlc3MoKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgU3lzdGVtUHJvcGVydGllcy5zZXQoIm5ldC5kbnMxIiwgbURlZmF1bHREbnMuZ2V0SG9zdEFkZHJlc3MoKSk7CisgICAgICAgICAgICAgICAgICAgIGorKzsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBmb3IgKEluZXRBZGRyZXNzIGRucyA6IGRuc2VzKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImFkZGluZyBkbnMgIiArIGRucyArICIgZm9yICIgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnQuZ2V0TmV0d29ya0luZm8oKS5nZXRUeXBlTmFtZSgpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbVByb3BlcnRpZXMuc2V0KCJuZXQuZG5zIiArIGorKywgZG5zKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbVByb3BlcnRpZXMuc2V0KCJuZXQuZG5zIiArIGorKywgZG5zLmdldEhvc3RBZGRyZXNzKCkpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGZvciAoaW50IGs9aiA7IGs8bU51bURuc0VudHJpZXM7IGsrKykgewpAQCAtMTQyOSwxMSArMTYzMiwxMSBAQAogICAgICAgICAgICAgICAgIExpc3QgcGlkcyA9IG1OZXRSZXF1ZXN0ZXJzUGlkc1tuZXRUeXBlXTsKICAgICAgICAgICAgICAgICBmb3IgKGludCB5PTA7IHk8IHBpZHMuc2l6ZSgpOyB5KyspIHsKICAgICAgICAgICAgICAgICAgICAgSW50ZWdlciBwaWQgPSAoSW50ZWdlcilwaWRzLmdldCh5KTsKLSAgICAgICAgICAgICAgICAgICAgd3JpdGVQaWREbnMoZG5zTGlzdCwgcGlkLmludFZhbHVlKCkpOworICAgICAgICAgICAgICAgICAgICB3cml0ZVBpZERucyhkbnNlcywgcGlkLmludFZhbHVlKCkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJ1bXBEbnMoKTsKICAgICAgICAgfQotICAgICAgICBidW1wRG5zKCk7CiAgICAgfQogCiAgICAgcHJpdmF0ZSBpbnQgZ2V0UmVzdG9yZURlZmF1bHROZXR3b3JrRGVsYXkoKSB7CkBAIC0xNDg4LDYgKzE2OTEsMTMgQEAKICAgICAgICAgfQogICAgICAgICBwdy5wcmludGxuKCk7CiAKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBwdy5wcmludGxuKCJOZXR3b3JrVHJhbnN0aW9uV2FrZUxvY2sgaXMgY3VycmVudGx5ICIgKworICAgICAgICAgICAgICAgICAgICAobU5ldFRyYW5zaXRpb25XYWtlTG9jay5pc0hlbGQoKSA/ICIiIDogIm5vdCAiKSArICJoZWxkLiIpOworICAgICAgICAgICAgcHcucHJpbnRsbigiSXQgd2FzIGxhc3QgcmVxdWVzdGVkIGZvciAiK21OZXRUcmFuc2l0aW9uV2FrZUxvY2tDYXVzZWRCeSk7CisgICAgICAgIH0KKyAgICAgICAgcHcucHJpbnRsbigpOworCiAgICAgICAgIG1UZXRoZXJpbmcuZHVtcChmZCwgcHcsIGFyZ3MpOwogCiAgICAgICAgIGlmIChtSW5ldExvZyAhPSBudWxsKSB7CkBAIC0xNTAxLDYgKzE3MTEsMTAgQEAKIAogICAgIC8vIG11c3QgYmUgc3RhdGVsZXNzIC0gdGhpbmdzIGNoYW5nZSB1bmRlciB1cy4KICAgICBwcml2YXRlIGNsYXNzIE15SGFuZGxlciBleHRlbmRzIEhhbmRsZXIgeworICAgICAgICBwdWJsaWMgTXlIYW5kbGVyKExvb3BlciBsb29wZXIpIHsKKyAgICAgICAgICAgIHN1cGVyKGxvb3Blcik7CisgICAgICAgIH0KKwogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgewogICAgICAgICAgICAgTmV0d29ya0luZm8gaW5mbzsKQEAgLTE1NjIsMjkgKzE3NzYsMjUgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZUNvbm5lY3QoaW5mbyk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIE5ldHdvcmtTdGF0ZVRyYWNrZXIuRVZFTlRfU0NBTl9SRVNVTFRTX0FWQUlMQUJMRToKLSAgICAgICAgICAgICAgICAgICAgaW5mbyA9IChOZXR3b3JrSW5mbykgbXNnLm9iajsKLSAgICAgICAgICAgICAgICAgICAgaGFuZGxlU2NhblJlc3VsdHNBdmFpbGFibGUoaW5mbyk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBOZXR3b3JrU3RhdGVUcmFja2VyLkVWRU5UX05PVElGSUNBVElPTl9DSEFOR0VEOgotICAgICAgICAgICAgICAgICAgICBoYW5kbGVOb3RpZmljYXRpb25DaGFuZ2UobXNnLmFyZzEgPT0gMSwgbXNnLmFyZzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKE5vdGlmaWNhdGlvbikgbXNnLm9iaik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCiAgICAgICAgICAgICAgICAgY2FzZSBOZXR3b3JrU3RhdGVUcmFja2VyLkVWRU5UX0NPTkZJR1VSQVRJT05fQ0hBTkdFRDoKKyAgICAgICAgICAgICAgICAgICAgLy8gVE9ETyAtIG1ha2UgdGhpcyBoYW5kbGUgaXAvcHJveHkvZ2F0ZXdheS9kbnMgY2hhbmdlcwogICAgICAgICAgICAgICAgICAgICBpbmZvID0gKE5ldHdvcmtJbmZvKSBtc2cub2JqOwogICAgICAgICAgICAgICAgICAgICB0eXBlID0gaW5mby5nZXRUeXBlKCk7CiAgICAgICAgICAgICAgICAgICAgIGhhbmRsZURuc0NvbmZpZ3VyYXRpb25DaGFuZ2UodHlwZSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBOZXR3b3JrU3RhdGVUcmFja2VyLkVWRU5UX1JPQU1JTkdfQ0hBTkdFRDoKLSAgICAgICAgICAgICAgICAgICAgLy8gZmlsbCBtZSBpbgotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgTmV0d29ya1N0YXRlVHJhY2tlci5FVkVOVF9ORVRXT1JLX1NVQlRZUEVfQ0hBTkdFRDoKLSAgICAgICAgICAgICAgICAgICAgLy8gZmlsbCBtZSBpbgorICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfQ0xFQVJfTkVUX1RSQU5TSVRJT05fV0FLRUxPQ0s6CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBjYXVzZWRCeSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoQ29ubmVjdGl2aXR5U2VydmljZS50aGlzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobXNnLmFyZzEgPT0gbU5ldFRyYW5zaXRpb25XYWtlTG9ja1NlcmlhbE51bWJlciAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTmV0VHJhbnNpdGlvbldha2VMb2NrLmlzSGVsZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5ldFRyYW5zaXRpb25XYWtlTG9jay5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F1c2VkQnkgPSBtTmV0VHJhbnNpdGlvbldha2VMb2NrQ2F1c2VkQnk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGNhdXNlZEJ5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJOZXRUcmFuc2l0aW9uIFdha2Vsb2NrIGZvciAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F1c2VkQnkgKyAiIHJlbGVhc2VkIGJ5IHRpbWVvdXQiKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX1JFU1RPUkVfREVGQVVMVF9ORVRXT1JLOgogICAgICAgICAgICAgICAgICAgICBGZWF0dXJlVXNlciB1ID0gKEZlYXR1cmVVc2VyKW1zZy5vYmo7CkBAIC0xNjc4LDYgKzE4ODgsMTUgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRUZXRoZXJhYmxlQmx1ZXRvb3RoUmVnZXhzKCkgeworICAgICAgICBlbmZvcmNlVGV0aGVyQWNjZXNzUGVybWlzc2lvbigpOworICAgICAgICBpZiAoaXNUZXRoZXJpbmdTdXBwb3J0ZWQoKSkgeworICAgICAgICAgICAgcmV0dXJuIG1UZXRoZXJpbmcuZ2V0VGV0aGVyYWJsZUJsdWV0b290aFJlZ2V4cygpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmdbMF07CisgICAgICAgIH0KKyAgICB9CisKICAgICAvLyBUT0RPIC0gbW92ZSBpZmFjZSBs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gbUtleTsKKworICAgICAgICBwdWJsaWMgUmVjZWl2ZXIoSUNvdW50cnlMaXN0ZW5lciBsaXN0ZW5lcikgeworICAgICAgICAgICAgbUxpc3RlbmVyID0gbGlzdGVuZXI7CisgICAgICAgICAgICBtS2V5ID0gbGlzdGVuZXIuYXNCaW5kZXIoKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGJpbmRlckRpZWQoKSB7CisgICAgICAgICAgICByZW1vdmVMaXN0ZW5lcihtS2V5KTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG90aGVyT2JqKSB7CisgICAgICAgICAgICBpZiAob3RoZXJPYmogaW5zdGFuY2VvZiBSZWNlaXZlcikgeworICAgICAgICAgICAgICAgIHJldHVybiBtS2V5LmVxdWFscygoKFJlY2VpdmVyKSBvdGhlck9iaikubUtleSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGludCBoYXNoQ29kZSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtS2V5Lmhhc2hDb2RlKCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgSUNvdW50cnlMaXN0ZW5lciBnZXRMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgIHJldHVybiBtTGlzdGVuZXI7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBTdHJpbmcgVEFHID0gIkNvdW50cnlEZXRlY3RvclNlcnZpY2UiOworCisgICAgcHJpdmF0ZSBmaW5hbCBIYXNoTWFwPElCaW5kZXIsIFJlY2VpdmVyPiBtUmVjZWl2ZXJzOworICAgIHByaXZhdGUgZmluYWwgQ29udGV4dCBtQ29udGV4dDsKKyAgICBwcml2YXRlIENvbXByZWhlbnNpdmVDb3VudHJ5RGV0ZWN0b3IgbUNvdW50cnlEZXRlY3RvcjsKKyAgICBwcml2YXRlIGJvb2xlYW4gbVN5c3RlbVJlYWR5OworICAgIHByaXZhdGUgSGFuZGxlciBtSGFuZGxlcjsKKyAgICBwcml2YXRlIENvdW50cnlMaXN0ZW5lciBtTG9jYXRpb25CYXNlZERldGVjdG9yTGlzdGVuZXI7CisKKyAgICBwdWJsaWMgQ291bnRyeURldGVjdG9yU2VydmljZShDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgc3VwZXIoKTsKKyAgICAgICAgbVJlY2VpdmVycyA9IG5ldyBIYXNoTWFwPElCaW5kZXIsIFJlY2VpdmVyPigpOworICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIENvdW50cnkgZGV0ZWN0Q291bnRyeSgpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICBpZiAoIW1TeXN0ZW1SZWFkeSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJlbW90ZUV4Y2VwdGlvbigpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtQ291bnRyeURldGVjdG9yLmRldGVjdENvdW50cnkoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBZGQgdGhlIElDb3VudHJ5TGlzdGVuZXIgaW50byB0aGUgbGlzdGVuZXIgbGlzdC4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBhZGRDb3VudHJ5TGlzdGVuZXIoSUNvdW50cnlMaXN0ZW5lciBsaXN0ZW5lcikgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgIGlmICghbVN5c3RlbVJlYWR5KSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUmVtb3RlRXhjZXB0aW9uKCk7CisgICAgICAgIH0KKyAgICAgICAgYWRkTGlzdGVuZXIobGlzdGVuZXIpOworICAgIH0KKworICAgI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KyAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAibGlua1RvRGVhdGggZmFpbGVkOiIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlbW92ZUxpc3RlbmVyKElCaW5kZXIga2V5KSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobVJlY2VpdmVycykgeworICAgICAgICAgICAgbVJlY2VpdmVycy5yZW1vdmUoa2V5KTsKKyAgICAgICAgICAgIGlmIChtUmVjZWl2ZXJzLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgIHNldENvdW50cnlMaXN0ZW5lcihudWxsKTsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiTm8gbGlzdGVuZXIgaXMgbGVmdCIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisKKyAgICBwcm90ZWN0ZWQgdm9pZCBub3RpZnlSZWNlaXZlcnMoQ291bnRyeSBjb3VudHJ5KSB7CisgICAgICAgIHN5bmNocm9uaXplZChtUmVjZWl2ZXJzKSB7CisgICAgICAgICAgICBmb3IgKFJlY2VpdmVyIHJlY2VpdmVyIDogbVJlY2VpdmVycy52YWx1ZXMoKSkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHJlY2VpdmVyLmdldExpc3RlbmVyKCkub25Db3VudHJ5RGV0ZWN0ZWQoY291bnRyeSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogU2hhbGwgd2UgcmVtb3ZlIHRoZSByZWNlaXZlcj8KKyAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIm5vdGlmeVJlY2VpdmVycyBmYWlsZWQ6IiwgZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgdm9pZCBzeXN0ZW1SZWFkeSgpIHsKKyAgICAgICAgLy8gU2hhbGwgd2Ugd2FpdCBmb3IgdGhlIGluaXRpYWxpemF0aW9uIGZpbmlzaC4KKyAgICAgICAgVGhyZWFkIHRocmVhZCA9IG5ldyBUaHJlYWQodGhpcywgIkNvdW50cnlEZXRlY3RvclNlcnZpY2UiKTsKKyAgICAgICAgdGhyZWFkLnN0YXJ0KCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGluaXRpYWxpemUoKSB7CisgICAgICAgIG1Db3VudHJ5RGV0ZWN0b3IgPSBuZXcgQ29tcHJlaGVuc2l2ZUNvdW50cnlEZXRlY3RvcihtQ29udGV4dCk7CisgICAgICAgIG1Mb2NhdGlvbkJhc2VkRGV0ZWN0b3JMaXN0ZW5lciA9IG5ldyBDb3VudHJ5TGlzdGVuZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNvdW50cnlEZXRlY3RlZChmaW5hbCBDb3VudHJ5IGNvdW50cnkpIHsKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5wb3N0KG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbm90aWZ5UmVjZWl2ZXJzKGNvdW50cnkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICBQcm9jZXNzLnNldFRocmVhZFByaW9yaXR5KFByb2Nlc3MuVEhSRUFEX1BSSU9SSVRZX0JBQ0tHUk9VTkQpOworICAgICAgICBMb29wZXIucHJlcGFyZSgpOworICAgICAgICBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCk7CisgICAgICAgIGluaXRpYWxpemUoKTsKKyAgICAgICAgbVN5c3RlbVJlYWR5ID0gdHJ1ZTsKKyAgICAgICAgTG9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lyZWN0b3J5KCk7Ci0gICAgICAgIFN0cmluZyBbXSBmaWxlcwotICAgICAgICAgICAgPSBuZXcgRmlsZShyb290RGlyZWN0b3J5LCAiaW1hZ2VzIikubGlzdCgpOwotICAgICAgICBpbnQgY291bnQgPSBmaWxlcy5sZW5ndGg7Ci0KLSAgICAgICAgaWYgKGNvdW50ID09IDApIHsKLSAgICAgICAgICAgIFNsb2cuaShMT0dfVEFHLCAiYWRkRGVmYXVsdEltYWdlczogbm8gaW1hZ2VzIGZvdW5kISIpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBTdHJpbmcgbmFtZSA9IGZpbGVzW2ldOwotICAgICAgICAgICAgU3RyaW5nIHBhdGggPSByb290RGlyZWN0b3J5ICsgIi8iICsgbmFtZTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBJbWFnZXMuTWVkaWEuaW5zZXJ0SW1hZ2UobUNvbnRlbnRSZXNvbHZlciwgcGF0aCwgbmFtZSwgbnVsbCk7Ci0gICAgICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIFNsb2cuZShMT0dfVEFHLCAiRmFpbGVkIHRvIGltcG9ydCBpbWFnZSAiICsgcGF0aCwgZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgCi0gICAgcHJpdmF0ZSBmaW5hbCB2b2lkIGFkZERlZmF1bHREYXRhKCkKLSAgICB7Ci0gICAgICAgIFNsb2cuaShMT0dfVEFHLCAiQWRkaW5nIGRlZmF1bHQgZGF0YS4uLiIpOwotCi0vLyAgICAgICBhZGRJbWFnZSgiVmlvbGV0IiwgImltYWdlcy92aW9sZXQucG5nIik7Ci0vLyAgICAgICBhZGRJbWFnZS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GJ1ZiA9IG5ldyBieXRlW3NpemVdOwotCi0gICAgICAgICAgICBpbnQgY291bnQgPSAwOwotICAgICAgICAgICAgZG8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjb3VudCA9IGluLnJlYWQoYnVmLCAwLCBzaXplKTsKLSAgICAgICAgICAgICAgICBpZiAoY291bnQgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIG91dC53cml0ZShidWYsIDAsIGNvdW50KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IHdoaWxlIChjb3VudCA+IDApOwotICAgICAgICB9Ci0gICAgICAgIGNhdGNoIChFeGNlcHRpb24gZSkKLSAgICAgICAgewotICAgICAgICAgICAgU2xvZy5lKExPR19UQUcsICJGYWlsZWQgdG8gaW5zZXJ0IGltYWdlICciICsgZmlsZSArICInIiwgZSk7Ci0gICAgICAgICAgICB1cmwgPSBudWxsOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHVybDsKLSAgICB9Ci0KLSAgICBwcml2YXRlIGZpbmFsIFVyaSBhZGRTaG9ydGN1dChTdHJpbmcgc2hvcnRjdXQsIEludGVudCBpbnRlbnQpCi0gICAgewotICAgICAgICBpZiAoQ29uZmlnLkxPR1YpIFNsb2cudihMT0dfVEFHLCAiYWRkU2hvcnRjdXQ6IHNob3J0Y3V0PSIgKyBzaG9ydGN1dCArICIsIGludGVudD0iICsgaW50ZW50KTsKLSAgICAgICAgcmV0dXJuIFNldHRpbmdzLkJvb2ttYXJrcy5hZGQobUNvbnRlbnRSZXNvbHZlciwgaW50ZW50LCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG9ydGN1dCAhPSBudWxsID8gc2hvcnRjdXQuY2hhckF0KDApIDogMCwgMCk7Ci0gICAgfQotfQpkaWZmIC0tZ2l0IGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvRGV2aWNlUG9saWN5TWFu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ApIHsKICAgICAgICAgICAgICAgICAgICAgb3V0LnN0YXJ0VGFnKG51bGwsICJtaW4tcGFzc3dvcmQtbGVuZ3RoIik7CiAgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmRMZW5ndGgpKTsKLSAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibW4tcGFzc3dvcmQtbGVuZ3RoIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sZW5ndGgiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYocGFzc3dvcmRIaXN0b3J5TGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgInBhc3N3b3JkLWhpc3RvcnktbGVuZ3RoIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhwYXNzd29yZEhpc3RvcnlMZW5ndGgpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAicGFzc3dvcmQtaGlzdG9yeS1sZW5ndGgiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgb3V0LnN0YXJ0VGFnKG51bGwsICJtaW4tcGFzc3dvcmQtdXBwZXJjYXNlIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmRVcHBlckNhc2UpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibWluLXBhc3N3b3JkLXVwcGVyY2FzZSIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobWluaW11bVBhc3N3b3JkTG93ZXJDYXNlID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sb3dlcmNhc2UiKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAidmFsdWUiLCBJbnRlZ2VyLnRvU3RyaW5nKG1pbmltdW1QYXNzd29yZExvd2VyQ2FzZSkpOworICAgICAgICAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJtaW4tcGFzc3dvcmQtbG93ZXJjYXNlIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sZXR0ZXJzIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzKSk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sZXR0ZXJzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtaW5pbXVtUGFzc3dvcmROdW1lcmljID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1udW1lcmljIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmROdW1lcmljKSk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1udW1lcmljIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtaW5pbXVtUGFzc3dvcmRTeW1ib2xzID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1zeW1ib2xzIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmRTeW1ib2xzKSk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1zeW1ib2xzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtaW5pbXVtUGFzc3dvcmROb25MZXR0ZXIgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAibWluLXBhc3N3b3JkLW5vbmxldHRlciIpOworICAgICAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJ2YWx1ZSIsIEludGVnZXIudG9TdHJpbmcobWluaW11bVBhc3N3b3JkTm9uTGV0dGVyKSk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1ub25sZXR0ZXIiKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAobWF4aW11bVRpbWVUb1VubG9jayAhPSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQpIHsKQEAgLTEyNyw4ICsxODUsMjMgQEAKICAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJ2YWx1ZSIsIEludGVnZXIudG9TdHJpbmcobWF4aW11bUZhaWxlZFBhc3N3b3Jkc0ZvcldpcGUpKTsKICAgICAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJtYXgtZmFpbGVkLXBhc3N3b3JkLXdpcGUiKTsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChzcGVjaWZpZXNHbG9iYWxQcm94eSkgeworICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAic3BlY2lmaWVzLWdsb2JhbC1wcm94eSIpOworICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgQm9vbGVhbi50b1N0cmluZyhzcGVjaWZpZXNHbG9iYWxQcm94eSkpOworICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgInNwZWNpZmllc19nbG9iYWxfcHJveHkiKTsKKyAgICAgICAgICAgICAgICBpZiAoZ2xvYmFsUHJveHlTcGVjICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgb3V0LnN0YXJ0VGFnKG51bGwsICJnbG9iYWwtcHJveHktc3BlYyIpOworICAgICAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJ2YWx1ZSIsIGdsb2JhbFByb3h5U3BlYyk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgImdsb2JhbC1wcm94eS1zcGVjIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChnbG9iYWxQcm94eUV4Y2x1c2lvbkxpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgImdsb2JhbC1wcm94eS1leGNsdXNpb24tbGlzdCIpOworICAgICAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJ2YWx1ZSIsIGdsb2JhbFByb3h5RXhjbHVzaW9uTGlzdCk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgImdsb2JhbC1wcm94eS1leGNsdXNpb24tbGlzdCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICB2b2lkIHJlYWRGcm9tWG1sKFhtbFB1bGxQYXJzZXIgcGFyc2VyKQogICAgICAgICAgICAgICAgIHRocm93cyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uLCBJT0V4Y2VwdGlvbiB7CiAgICAgICAgICAgICBpbnQgb3V0ZXJEZXB0aCA9IHBhcnNlci5nZXREZXB0aCgpOwpAQCAtMTQ3LDE5ICsyMjAsNDkgQEAKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtaW4tcGFzc3dvcmQtbGVuZ3RoIi5lcXVhbHModGFnKSkgewogICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmRMZW5ndGggPSBJbnRlZ2VyLnBhcnNlSW50KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAidmFsdWUiKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgicGFzc3dvcmQtaGlzdG9yeS1sZW5ndGgiLmVxdWFscyh0YWcpKSB7CisgICAgICAgICAgICAgICAgICAgIHBhc3N3b3JkSGlzdG9yeUxlbmd0aCA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtaW4tcGFzc3dvcmQtdXBwZXJjYXNlIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmRVcHBlckNhc2UgPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAidmFsdWUiKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgibWluLXBhc3N3b3JkLWxvd2VyY2FzZSIuZXF1YWxzKHRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgbWluaW11bVBhc3N3b3JkTG93ZXJDYXNlID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1pbi1wYXNzd29yZC1sZXR0ZXJzIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1pbi1wYXNzd29yZC1udW1lcmljIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmROdW1lcmljID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1pbi1wYXNzd29yZC1zeW1ib2xzIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmRTeW1ib2xzID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1pbi1wYXNzd29yZC1ub25sZXR0ZXIiLmVxdWFscyh0YWcpKSB7CisgICAgICAgICAgICAgICAgICAgIG1pbmltdW1QYXNzd29yZE5vbkxldHRlciA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtYXgtdGltZS10by11bmxvY2siLmVxdWFscyh0YWcpKSB7CiAgICAgICAgICAgICAgICAgICAgIG1heGltdW1UaW1lVG9VbmxvY2sgPSBMb25nLnBhcnNlTG9uZygKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOwogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1heC1mYWlsZWQtcGFzc3dvcmQtd2lwZSIuZXF1YWxzKHRhZykpIHsKICAgICAgICAgICAgICAgICAgICAgbWF4aW11bUZhaWxlZFBhc3N3b3Jkc0ZvcldpcGUgPSBJbnRlZ2VyLnBhcnNlSW50KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAidmFsdWUiKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgic3BlY2lmaWVzLWdsb2JhbC1wcm94eSIuZXF1YWxzKHRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmaWVzR2xvYmFsUHJveHkgPSBCb29sZWFuLmdldEJvb2xlYW4oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJnbG9iYWwtcHJveHktc3BlYyIuZXF1YWxzKHRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgZ2xvYmFsUHJveHlTcGVjID0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAidmFsdWUiKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJnbG9iYWwtcHJveHktZXhjbHVzaW9uLWxpc3QiLmVxdWFscyh0YWcpKSB7CisgICAgICAgICAgICAgICAgICAgIGdsb2JhbFByb3h5RXhjbHVzaW9uTGlzdCA9CisgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIik7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIlVua25vd24gYWRtaW4gdGFnOiAiICsgdGFnKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgWG1sVXRpbHMuc2tpcEN1cnJlbnRUYWcocGFyc2VyKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICB2b2lkIGR1bXAoU3RyaW5nIHByZWZpeCwgUHJpbnRXcml0ZXIgcHcpIHsKICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJ1aWQ9Iik7IHB3LnByaW50bG4oZ2V0VWlkKCkpOwogICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnRsbigicG9saWNpZXM6Iik7CkBAIC0xNzAsMjMgKzI3Myw0NyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJwYXNzd29yZFF1YWxpdHk9MHgiKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoSW50ZWdlci50b0hleFN0cmluZyhwYXNzd29yZFF1YWxpdHkpKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBtaW5pbXVtUGFzc3dvcmRMZW5ndGg9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4oSW50ZWdlci50b0hleFN0cmluZyhwYXNzd29yZFF1YWxpdHkpKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmRMZW5ndGg9Iik7CiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkTGVuZ3RoKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJwYXNzd29yZEhpc3RvcnlMZW5ndGg9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4ocGFzc3dvcmRIaXN0b3J5TGVuZ3RoKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmRVcHBlckNhc2U9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkVXBwZXJDYXNlKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmRMb3dlckNhc2U9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkTG93ZXJDYXNlKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzPSIpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1pbmltdW1QYXNzd29yZExldHRlcnMpOworICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIm1pbmltdW1QYXNzd29yZE51bWVyaWM9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkTnVtZXJpYyk7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibWluaW11bVBhc3N3b3JkU3ltYm9scz0iKTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihtaW5pbXVtUGFzc3dvcmRTeW1ib2xzKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmROb25MZXR0ZXI9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkTm9uTGV0dGVyKTsKICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtYXhpbXVtVGltZVRvVW5sb2NrPSIpOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1heGltdW1UaW1lVG9VbmxvY2spOwogICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIm1heGltdW1GYWlsZWRQYXNzd29yZHNGb3JXaXBlPSIpOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1heGltdW1GYWlsZWRQYXNzd29yZHNGb3JXaXBlKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJzcGVjaWZpZXNHbG9iYWxQcm94eT0iKTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihzcGVjaWZpZXNHbG9iYWxQcm94eSk7CisgICAgICAgICAgICBpZiAoZ2xvYmFsUHJveHlTcGVjICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgiZ2xvYmFsUHJveHlTcGVjPSIpOworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihnbG9iYWxQcm94eVNwZWMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGdsb2JhbFByb3h5RXhjbHVzaW9uTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoImdsb2JhbFByb3h5RWNsdXNpb25MaXN0PSIpOworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihnbG9iYWxQcm94eUV4Y2x1c2lvbkxpc3QpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgY2xhc3MgTXlQYWNrYWdlTW9uaXRvciBleHRlbmRzIFBhY2thZ2VNb25pdG9yIHsKICAgICAgICAgcHVibGljIHZvaWQgb25Tb21lUGFja2FnZXNDaGFuZ2VkKCkgewogICAgICAgICAgICAgc3luY2hyb25pemVkIChEZXZpY2VQb2xpY3lNYW5hZ2VyU2VydmljZS50aGlzKSB7CiAgICAgICAgICAgICAgICAgYm9vbGVhbiByZW1vdmVkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT1tQWRtaW5MaXN0LnNpemUoKS0xOyBpPj0wOyBpLS0pIHsKICAgICAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWEgPSBtQWRtaW5MaXN0LmdldChpKTsKLSAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5nZSA9IGlzUGFja2FnZURpc2FwcGVhcmluZyhhYS5pbmZvLmdldFBhY2thZ2VOYW1lKCkpOyAKKyAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5nZSA9IGlzUGFja2FnZURpc2FwcGVhcmluZyhhYS5pbmZvLmdldFBhY2thZ2VOYW1lKCkpOwogICAgICAgICAgICAgICAgICAgICBpZiAoY2hhbmdlID09IFBBQ0tBR0VfUEVSTUFORU5UX0NIQU5HRQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGNoYW5nZSA9PSBQQUNLQUdFX1RFTVBPUkFSWV9DSEFOR0UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJBZG1pbiB1bmV4cGVjdGVkbHkgdW5pbnN0YWxsZWQ6ICIKQEAgLTIxMSw3ICszMzgsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogSW5zdGFudGlhdGVzIHRoZSBzZXJ2aWNlLgogICAgICAqLwpAQCAtMjMwLDcgKzM1Nyw3IEBACiAgICAgICAgIH0KICAgICAgIC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vbGljeSkgewogICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwogICAgICAgICBpZiAoTiA+IDApIHsKQEAgLTI4OSwxOSArNDE2LDI0IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICB2b2lkIHJlbW92ZUFjdGl2ZUFkbWluTG9ja2VkKENvbXBvbmVudE5hbWUgYWRtaW5SZWNlaXZlcikgewogICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKGFkbWluUmVjZWl2ZXIpOwogICAgICAgICBpZiAoYWRtaW4gIT0gbnVsbCkgeworICAgICAgICAgICAgYm9vbGVhbiBkb1Byb3h5Q2xlYW51cCA9CisgICAgICAgICAgICAgICAgYWRtaW4uaW5mby51c2VzUG9saWN5KERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9TRVRTX0dMT0JBTF9QUk9YWSk7CiAgICAgICAgICAgICBzZW5kQWRtaW5Db21tYW5kTG9ja2VkKGFkbWluLAogICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pblJlY2VpdmVyLkFDVElPTl9ERVZJQ0VfQURNSU5fRElTQUJMRUQpOwogICAgICAgICAgICAgLy8gWFhYIG5lZWQgdG8gd2FpdCBmb3IgaXQgdG8gY29tcGxldGUuCiAgICAgICAgICAgICBtQWRtaW5MaXN0LnJlbW92ZShhZG1pbik7CiAgICAgICAgICAgICBtQWRtaW5NYXAucmVtb3ZlKGFkbWluUmVjZWl2ZXIpOwogICAgICAgICAgICAgdmFsaWRhdGVQYXNzd29yZE93bmVyTG9ja2VkKCk7CisgICAgICAgICAgICBpZiAoZG9Qcm94eUNsZWFudXApIHsKKyAgICAgICAgICAgICAgICByZXNldEdsb2JhbFByb3h5KCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgRGV2aWNlQWRtaW5JbmZvIGZpbmRBZG1pbihDb21wb25lbnROYW1lIGFkbWluTmFtZSkgewogICAgICAgICBJbnRlbnQgcmVzb2x2ZUludGVudCA9IG5ldyBJbnRlbnQoKTsKICAgICAgICAgcmVzb2x2ZUludGVudC5zZXRDb21wb25lbnQoYWRtaW5OYW1lKTsKQEAgLTMxMCw3ICs0NDIsNyBAQAogICAgICAgICBpZiAoaW5mb3MgPT0gbnVsbCB8fCBpbmZvcy5zaXplKCkgPD0gMCkgewogICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rbm93biBhZG1pbjogIiArIGFkbWluTmFtZSk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIHJldHVybiBuZXcgRGV2aWNlQWRtaW5JbmZvKG1Db250ZXh0LCBpbmZvcy5nZXQoMCkpOwogICAgICAgICB9IGNhdGNoIChYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIGUpIHsKQEAgLTMyMSw3ICs0NTMsNyBAQAogICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwcml2YXRlIHN0YXRpYyBKb3VybmFsZWRGaWxlIG1ha2VKb3VybmFsZWRGaWxlKCkgewogICAgICAgICBmaW5hbCBTdHJpbmcgYmFzZSA9ICIvZGF0YS9zeXN0ZW0vZGV2aWNlX3BvbGljaWVzLnhtbCI7CiAgICAgICAgIHJldHVybiBuZXcgSm91cm5hbGVkRmlsZShuZXcgRmlsZShiYXNlKSwgbmV3IEZpbGUoYmFzZSArICIudG1wIikpOwpAQCAtMzM3LDcgKzQ2OSw3IEBACiAgICAgICAgICAgICBvdXQuc3RhcnREb2N1bWVudChudWxsLCB0cnVlKTsKIAogICAgICAgICAgICAgb3V0LnN0YXJ0VGFnKG51bGwsICJwb2xpY2llcyIpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CiAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYXAgPSBtQWRtaW5MaXN0LmdldChpKTsKQEAgLTM0OCwyNiArNDgwLDM2IEBACiAgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgImFkbWluIik7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGlmIChtUGFzc3dvcmRPd25lciA+PSAwKSB7CiAgICAgICAgICAgICAgICAgb3V0LnN0YXJ0VGFnKG51bGwsICJwYXNzd29yZC1vd25lciIpOwogICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtUGFzc3dvcmRPd25lcikpOwogICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgInBhc3N3b3JkLW93bmVyIik7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKG1GYWlsZWRQYXNzd29yZEF0dGVtcHRzICE9IDApIHsKICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgImZhaWxlZC1wYXNzd29yZC1hdHRlbXB0cyIpOwogICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtRmFpbGVkUGFzc3dvcmRBdHRlbXB0cykpOwogICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgImZhaWxlZC1wYXNzd29yZC1hdHRlbXB0cyIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCi0gICAgICAgICAgICBpZiAobUFjdGl2ZVBhc3N3b3JkUXVhbGl0eSAhPSAwIHx8IG1BY3RpdmVQYXNzd29yZExlbmd0aCAhPSAwKSB7CisKKyAgICAgIC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MZXR0ZXJzKSk7CisgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAibnVtZXJpYyIsIEludGVnZXIKKyAgICAgICAgICAgICAgICAgICAgICAgIC50b1N0cmluZyhtQWN0aXZlUGFzc3dvcmROdW1lcmljKSk7CisgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAic3ltYm9scyIsIEludGVnZXIudG9TdHJpbmcobUFjdGl2ZVBhc3N3b3JkU3ltYm9scykpOworICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgIm5vbmxldHRlciIsIEludGVnZXIudG9TdHJpbmcobUFjdGl2ZVBhc3N3b3JkTm9uTGV0dGVyKSk7CiAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAiYWN0aXZlLXBhc3N3b3JkIik7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAicG9saWNpZXMiKTsKIAogICAgICAgICAgICAgb3V0LmVuZERvY3VtZW50KCk7CkBAIC00NDUsNiArNTg3LDE4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJxdWFsaXR5IikpOwogICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRMZW5ndGggPSBJbnRlZ2VyLnBhcnNlSW50KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAibGVuZ3RoIikpOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRVcHBlckNhc2UgPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAidXBwZXJjYXNlIikpOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRMb3dlckNhc2UgPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAibG93ZXJjYXNlIikpOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRMZXR0ZXJzID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgImxldHRlcnMiKSk7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZE51bWVyaWMgPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAibnVtZXJpYyIpKTsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkU3ltYm9scyA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJzeW1ib2xzIikpOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmROb25MZXR0ZXIgPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAibm9ubGV0dGVyIikpOwogICAgICAgICAgICAgICAgICAgICBYbWxVdGlscy5za2lwQ3VycmVudFRhZyhwYXJzZXIpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJVbmtub3duIHRhZzogIiArIHRhZyk7CkBAIC00ODQsMTAgKzYzOCwxNiBAQAogICAgICAgICAgICAgICAgICAgICArIEludGVnZXIudG9IZXhTdHJpbmcodXRpbHMuZ2V0QWN0aXZlUGFzc3dvcmRRdWFsaXR5KCkpKTsKICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZFF1YWxpdHkgPSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQ7CiAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRMZW5ndGggPSAwOworICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkVXBwZXJDYXNlID0gMDsKKyAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZExvd2VyQ2FzZSA9IDA7CisgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRMZXR0ZXJzID0gMDsKKyAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZE51bWVyaWMgPSAwOworICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkU3ltYm9scyA9IDA7CisgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmROb25MZXR0ZXIgPSAwOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHZhbGlkYXRlUGFzc3dvcmRPd25lckxvY2tlZCgpOwotICAgICAgICAKKwogICAgICAgICBsb25nIHRpbWVNcyA9IGdldE1heGltdW1UaW1lVG9Mb2NrKG51bGwpOwogICAgICAgICBpZiAodGltZU1zIDw9IDApIHsKICAgICAgICAgICAgIHRpbWVNcyA9IEludGVnZXIuTUFYX1ZBTFVFOwpAQCAtNTA2LDEyICs2NjYsMTMgQEAKICAgICAgICAgICAgIGNhc2UgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX05VTUVSSUM6CiAgICAgICAgICAgICBjYXNlIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9BTFBIQUJFVElDOgogICAgICAgICAgICAgY2FzZSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQUxQSEFOVU1FUklDOgorICAgICAgICAgICAgY2FzZSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQ09NUExFWDoKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiSW52YWxpZCBxdWFsaXR5IGNvbnN0YW50OiAweCIKICAgICAgICAgICAgICAgICArIEludGVnZXIudG9IZXhTdHJpbmcocXVhbGl0eSkpOwogICAgIH0KLSAgICAKKwogICAgIHZvaWQgdmFsaWRhdGVQYXNzd29yZE93bmVyTG9ja2VkKCkgewogICAgICAgICBpZiAobVBhc3N3b3JkT3duZXIgPj0gMCkgewogICAgICAgICAgICAgYm9vbGVhbiBoYXZlT3duZXIgPSBmYWxzZTsKQEAgLTUyOCwxNyArNjg5LDE3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCBzeXN0ZW1SZWFkeSgpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBsb2FkU2V0dGluZ3NMb2NrZWQoKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHNldEFjdGl2ZUFkbWluKENvbXBvbmVudE5hbWUgYWRtaW5SZWNlaXZlcikgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oCiAgICAgICAgICAgICAgICAgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkJJTkRfREVWSUNFX0FETUlOLCBudWxsKTsKLSAgICAgICAgCisKICAgICAgICAgRGV2aWNlQWRtaW5JbmZvIGluZm8gPSBmaW5kQWRtaW4oYWRtaW5SZWNlaXZlcik7CiAgICAgICAgIGlmIChpbmZvID09IG51bGwpIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkJhZCBhZG1pbjogIiArIGFkbWluUmVjZWl2ZXIpOwpAQCAtNTYwLDEzICs3MjEsMTMgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBib29sZWFuIGlzQWRtaW5BY3RpdmUoQ29tcG9uZW50TmFtZSBhZG1pblJlY2VpdmVyKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgcmV0dXJuIGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKGFkbWluUmVjZWl2ZXIpICE9IG51bGw7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgTGlzdDxDb21wb25lbnROYW1lPiBnZXRBY3RpdmVBZG1pbnMoKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKQEAgLTU4MCw3ICs3NDEsNyBAQAogICAgICAgICAgICAgcmV0dXJuIHJlczsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBib29sZWFuIHBhY2thZ2VIYXNBY3RpdmVBZG1pbnMoU3RyaW5nIHBhY2thZ2VOYW1lKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKQEAgLTU5Miw3ICs3NTMsNyBAQAogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgcmVtb3ZlQWN0aXZlQWRtaW4oQ29tcG9uZW50TmFtZSBhZG1pblJlY2VpdmVyKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZChhZG1pblJlY2VpdmVyKTsKQEAgLTYxMSwxMCArNzcyLDEwIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZFF1YWxpdHkoQ29tcG9uZW50TmFtZSB3aG8sIGludCBxdWFsaXR5KSB7CiAgICAgICAgIHZhbGlkYXRlUXVhbGl0eUNvbnN0YW50KHF1YWxpdHkpOwotICAgICAgICAKKwogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiQ29tcG9uZW50TmFtZSBpcyBudWxsIik7CkBAIC02MjcsMTYgKzc4OCwxNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGludCBnZXRQYXNzd29yZFF1YWxpdHkoQ29tcG9uZW50TmFtZSB3aG8pIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpbnQgbW9kZSA9IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9VTlNQRUNJRklFRDsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5wYXNzd29yZFF1YWxpdHkgOiBtb2RlOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CiAgICAgICAgICAgICBmb3IgIChpbnQgaT0wOyBpPE47IGkrKykgewogICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CkBAIC02NDcsNyArODA4LDcgQEAKICAgICAgICAgICAgIHJldHVybiBtb2RlOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtTGVuZ3RoKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgbGVuZ3RoKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CkBAIC02NjEsMTYgKzgyMiwxNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1MZW5ndGgoQ29tcG9uZW50TmFtZSB3aG8pIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpbnQgbGVuZ3RoID0gMDsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5taW5pbXVtUGFzc3dvcmRMZW5ndGggOiBsZW5ndGg7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKICAgICAgICAgICAgIGZvciAgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKQEAgLTY4MSwxOCArODQyLDI2NyBAQAogICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDsKICAgICAgICAgfQogICAgIH0KLSAgICAKKworICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkSGlzdG9yeUxlbmd0aChDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiQ29tcG9uZW50TmFtZSBpcyBudWxsIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3RpdmVBZG1pbiBhcCA9IGdldEFjdGl2ZUFkbWluRm9yQ2FsbGVyTG9ja2VkKHdobywKKyAgICAgICAgICAgICAgICAgICAgRGV2aWNlQWRtaW5JbmZvLlVTRVNfUE9MSUNZX0xJTUlUX1BBU1NXT1JEKTsKKyAgICAgICAgICAgIGlmIChhcC5wYXNzd29yZEhpc3RvcnlMZW5ndGggIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgYXAucGFzc3dvcmRIaXN0b3J5TGVuZ3RoID0gbGVuZ3RoOworICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZEhpc3RvcnlMZW5ndGgoQ29tcG9uZW50TmFtZSB3aG8pIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpbnQgbGVuZ3RoID0gMDsKKworICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOworICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ucGFzc3dvcmRIaXN0b3J5TGVuZ3RoIDogbGVuZ3RoOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCBhZG1pbi5wYXNzd29yZEhpc3RvcnlMZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gYWRtaW4ucGFzc3dvcmRIaXN0b3J5TGVuZ3RoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1VcHBlckNhc2UoQ29tcG9uZW50TmFtZSB3aG8sIGludCBsZW5ndGgpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkNvbXBvbmVudE5hbWUgaXMgbnVsbCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQWN0aXZlQWRtaW4gYXAgPSBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZCh3aG8sCisgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9MSU1JVF9QQVNTV09SRCk7CisgICAgICAgICAgICBpZiAoYXAubWluaW11bVBhc3N3b3JkVXBwZXJDYXNlICE9IGxlbmd0aCkgeworICAgICAgICAgICAgICAgIGFwLm1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZSA9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRNaW5pbXVtVXBwZXJDYXNlKENvbXBvbmVudE5hbWUgd2hvKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaW50IGxlbmd0aCA9IDA7CisKKyAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLm1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZSA6IGxlbmd0aDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCBhZG1pbi5taW5pbXVtUGFzc3dvcmRVcHBlckNhc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gYWRtaW4ubWluaW11bVBhc3N3b3JkVXBwZXJDYXNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1Mb3dlckNhc2UoQ29tcG9uZW50TmFtZSB3aG8sIGludCBsZW5ndGgpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkNvbXBvbmVudE5hbWUgaXMgbnVsbCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQWN0aXZlQWRtaW4gYXAgPSBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZCh3aG8sCisgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9MSU1JVF9QQVNTV09SRCk7CisgICAgICAgICAgICBpZiAoYXAubWluaW11bVBhc3N3b3JkTG93ZXJDYXNlICE9IGxlbmd0aCkgeworICAgICAgICAgICAgICAgIGFwLm1pbmltdW1QYXNzd29yZExvd2VyQ2FzZSA9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRNaW5pbXVtTG93ZXJDYXNlKENvbXBvbmVudE5hbWUgd2hvKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaW50IGxlbmd0aCA9IDA7CisKKyAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLm1pbmltdW1QYXNzd29yZExvd2VyQ2FzZSA6IGxlbmd0aDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCBhZG1pbi5taW5pbXVtUGFzc3dvcmRMb3dlckNhc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gYWRtaW4ubWluaW11bVBhc3N3b3JkTG93ZXJDYXNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1MZXR0ZXJzKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJDb21wb25lbnROYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gZ2V0QWN0aXZlQWRtaW5Gb3JDYWxsZXJMb2NrZWQod2hvLAorICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pbkluZm8uVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkQpOworICAgICAgICAgICAgaWYgKGFwLm1pbmltdW1QYXNzd29yZExldHRlcnMgIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgYXAubWluaW11bVBhc3N3b3JkTGV0dGVycyA9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRNaW5pbXVtTGV0dGVycyhDb21wb25lbnROYW1lIHdobykgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGludCBsZW5ndGggPSAwOworCisgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5taW5pbXVtUGFzc3dvcmRMZXR0ZXJzIDogbGVuZ3RoOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA8IGFkbWluLm1pbmltdW1QYXNzd29yZExldHRlcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gYWRtaW4ubWluaW11bVBhc3N3b3JkTGV0dGVyczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbGVuZ3RoOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtTnVtZXJpYyhDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiQ29tcG9uZW50TmFtZSBpcyBudWxsIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3RpdmVBZG1pbiBhcCA9IGdldEFjdGl2ZUFkbWluRm9yQ2FsbGVyTG9ja2VkKHdobywKKyAgICAgICAgICAgICAgICAgICAgRGV2aWNlQWRtaW5JbmZvLlVTRVNfUE9MSUNZX0xJTUlUX1BBU1NXT1JEKTsKKyAgICAgICAgICAgIGlmIChhcC5taW5pbXVtUGFzc3dvcmROdW1lcmljICE9IGxlbmd0aCkgeworICAgICAgICAgICAgICAgIGFwLm1pbmltdW1QYXNzd29yZE51bWVyaWMgPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bU51bWVyaWMoQ29tcG9uZW50TmFtZSB3aG8pIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpbnQgbGVuZ3RoID0gMDsKKworICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOworICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ubWluaW11bVBhc3N3b3JkTnVtZXJpYyA6IGxlbmd0aDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgYWRtaW4ubWluaW11bVBhc3N3b3JkTnVtZXJpYykgeworICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBhZG1pbi5taW5pbXVtUGFzc3dvcmROdW1lcmljOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1TeW1ib2xzKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJDb21wb25lbnROYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gZ2V0QWN0aXZlQWRtaW5Gb3JDYWxsZXJMb2NrZWQod2hvLAorICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pbkluZm8uVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkQpOworICAgICAgICAgICAgaWYgKGFwLm1pbmltdW1QYXNzd29yZFN5bWJvbHMgIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgYXAubWluaW11bVBhc3N3b3JkU3ltYm9scyA9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRNaW5pbXVtU3ltYm9scyhDb21wb25lbnROYW1lIHdobykgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGludCBsZW5ndGggPSAwOworCisgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5taW5pbXVtUGFzc3dvcmRTeW1ib2xzIDogbGVuZ3RoOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOworICAgICAgICAgICAgZm9yICAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCBhZG1pbi5taW5pbXVtUGFzc3dvcmRTeW1ib2xzKSB7CisgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGFkbWluLm1pbmltdW1QYXNzd29yZFN5bWJvbHM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkTWluaW11bU5vbkxldHRlcihDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiQ29tcG9uZW50TmFtZSBpcyBudWxsIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3RpdmVBZG1pbiBhcCA9IGdldEFjdGl2ZUFkbWluRm9yQ2FsbGVyTG9ja2VkKHdobywKKyAgICAgICAgICAgICAgICAgICAgRGV2aWNlQWRtaW5JbmZvLlVTRVNfUE9MSUNZX0xJTUlUX1BBU1NXT1JEKTsKKyAgICAgICAgICAgIGlmIChhcC5taW5pbXVtUGFzc3dvcmROb25MZXR0ZXIgIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgYXAubWluaW11bVBhc3N3b3JkTm9uTGV0dGVyID0gbGVuZ3RoOworICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1Ob25MZXR0ZXIoQ29tcG9uZW50TmFtZSB3aG8pIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpbnQgbGVuZ3RoID0gMDsKKworICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOworICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ubWluaW11bVBhc3N3b3JkTm9uTGV0dGVyIDogbGVuZ3RoOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA8IGFkbWluLm1pbmltdW1QYXNzd29yZE5vbkxldHRlcikgeworICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBhZG1pbi5taW5pbXVtUGFzc3dvcmROb25MZXR0ZXI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHB1YmxpYyBib29sZWFuIGlzQWN0aXZlUGFzc3dvcmRTdWZmaWNpZW50KCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIC8vIFRoaXMgQVBJIGNhbiBvbmx5IGJlIGNhbGxlZCBieSBhbiBhY3RpdmUgZGV2aWNlIGFkbWluLAogICAgICAgICAgICAgLy8gc28gdHJ5IHRvIHJldHJpZXZlIGl0IHRvIGNoZWNrIHRoYXQgdGhlIGNhbGxlciBpcyBvbmUuCiAgICAgICAgICAgICBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZChudWxsLAogICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pbkluZm8uVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkQpOwotICAgICAgICAgICAgcmV0dXJuIG1BY3RpdmVQYXNzd29yZFF1YWxpdHkgPj0gZ2V0UGFzc3dvcmRRdWFsaXR5KG51bGwpCi0gICAgICAgICAgICAgICAgICAgICYmIG1BY3RpdmVQYXNzd29yZExlbmd0aCA+PSBnZXRQYXNzd29yZE1pbmltdW1MZW5ndGgobnVsbCk7CisgICAgICAgICAgICBpZiAobUFjdGl2ZVBhc3N3b3JkUXVhbGl0eSA8IGdldFBhc3N3b3JkUXVhbGl0eShudWxsKQorICAgICAgICAgICAgICAgICAgICB8fCBtQWN0aXZlUGFzc3dvcmRMZW5ndGggPCBnZXRQYXNzd29yZE1pbmltdW1MZW5ndGgobnVsbCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihtQWN0aXZlUGFzc3dvcmRRdWFsaXR5ICE9IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbUFjdGl2ZVBhc3N3b3JkVXBwZXJDYXNlID49IGdldFBhc3N3b3JkTWluaW11bVVwcGVyQ2FzZShudWxsKQorICAgICAgICAgICAgICAgICAgICAmJiBtQWN0aXZlUGFzc3dvcmRMb3dlckNhc2UgPj0gZ2V0UGFzc3dvcmRNaW5pbXVtTG93ZXJDYXNlKG51bGwpCisgICAgICAgICAgICAgICAgICAgICYmIG1BY3RpdmVQYXNzd29yZExldHRlcnMgPj0gZ2V0UGFzc3dvcmRNaW5pbXVtTGV0dGVycyhudWxsKQorICAgICAgICAgICAgICAgICAgICAmJiBtQWN0aXZlUGFzc3dvcmROdW1lcmljID49IGdldFBhc3N3b3JkTWluaW11bU51bWVyaWMobnVsbCkKKyAgICAgICAgICAgICAgICAgICAgJiYgbUFjdGl2ZVBhc3N3b3JkU3ltYm9scyA+PSBnZXRQYXNzd29yZE1pbmltdW1TeW1ib2xzKG51bGwpCisgICAgICAgICAgICAgICAgICAgICYmIG1BY3RpdmVQYXNzd29yZE5vbkxldHRlciA+PSBnZXRQYXNzd29yZE1pbmltdW1Ob25MZXR0ZXIobnVsbCk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgaW50IGdldEN1cnJlbnRGYWlsZWRQYXNzd29yZEF0dGVtcHRzKCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIC8vIFRoaXMgQVBJIGNhbiBvbmx5IGJlIGNhbGxlZCBieSBhbiBhY3RpdmUgZGV2aWNlIGFkbWluLApAQCAtNzAyLDcgKzExMTIsNyBAQAogICAgICAgICAgICAgcmV0dXJuIG1GYWlsZWRQYXNzd29yZEF0dGVtcHRzOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgc2V0TWF4aW11bUZhaWxlZFBhc3N3b3Jkc0ZvcldpcGUoQ29tcG9uZW50TmFtZSB3aG8sIGludCBudW0pIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICAvLyBUaGlzIEFQSSBjYW4gb25seSBiZSBjYWxsZWQgYnkgYW4gYWN0aXZlIGRldmljZSBhZG1pbiwKQEAgLTcxNywxNiArMTEyNywxNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGludCBnZXRNYXhpbXVtRmFpbGVkUGFzc3dvcmRzRm9yV2lwZShDb21wb25lbnROYW1lIHdobykgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGludCBjb3VudCA9IDA7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOwogICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ubWF4aW11bUZhaWxlZFBhc3N3b3Jkc0ZvcldpcGUgOiBjb3VudDsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwogICAgICAgICAgICAgZm9yICAoaW50IGk9MDsgaTxOOyBpKyspIHsKICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOwpAQCAtNzQwLDcgKzExNTAsNyBAQAogICAgICAgICAgICAgcmV0dXJuIGNvdW50OwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGJvb2xlYW4gcmVzZXRQYXNzd29yZChTdHJpbmcgcGFzc3dvcmQsIGludCBmbGFncykgewogICAgICAgICBpbnQgcXVhbGl0eTsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CkBAIC03NTEsMTQgKzExNjEsMTUgQEAKICAgICAgICAgICAgIHF1YWxpdHkgPSBnZXRQYXNzd29yZFF1YWxpdHkobnVsbCk7CiAgICAgICAgICAgICBpZiAocXVhbGl0eSAhPSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQpIHsKICAgICAgICAgICAgICAgICBpbnQgcmVhbFF1YWxpdHkgPSBMb2NrUGF0dGVyblV0aWxzLmNvbXB1dGVQYXNzd29yZFF1YWxpdHkocGFzc3dvcmQpOwotICAgICAgICAgICAgICAgIGlmIChyZWFsUXVhbGl0eSA8IHF1YWxpdHkpIHsKKyAgICAgICAgICAgICAgICBpZiAocmVhbFF1YWxpdHkgPCBxdWFsaXR5CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBxdWFsaXR5ICE9IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYKSB7CiAgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJyZXNldFBhc3N3b3JkOiBwYXNzd29yZCBxdWFsaXR5IDB4IgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgSW50ZWdlci50b0hleFN0cmluZyhxdWFsaXR5KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkb2VzIG5vdCBtZWV0IHJlcXVpcmVkIHF1YWxpdHkgMHgiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKHF1YWxpdHkpKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBxdWFsaXR5ID0gcmVhbFF1YWxpdHk7CisgICAgICAgICAgICAgICAgcXVhbGl0eSA9IE1hdGgubWF4KHJlYWxRdWFsaXR5LCBxdWFsaXR5KTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGludCBsZW5ndGggPSBnZXRQYXNzd29yZE1pbmltdW1MZW5ndGgobnVsbCk7CiAgICAgICAgICAgICBpZiAocGFzc3dvcmQubGVuZ3RoKCkgPCBsZW5ndGgpIHsKQEAgLTc2NiwxNCArMTE3Nyw4NiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRvZXMgbm90IG1lZXQgcmVxdWlyZWQgbGVuZ3RoICIgKyBsZW5ndGgpOwogICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChxdWFsaXR5ID09IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYKSB7CisgICAgICAgICAgICAgICAgaW50IGxldHRlcnMgPSAwOworICAgICAgICAgICAgICAgIGludCB1cHBlcmNhc2UgPSAwOworICAgICAgICAgICAgICAgIGludCBsb3dlcmNhc2UgPSAwOworICAgICAgICAgICAgICAgIGludCBudW1iZXJzID0gMDsKKyAgICAgICAgICAgICAgICBpbnQgc3ltYm9scyA9IDA7CisgICAgICAgICAgICAgICAgaW50IG5vbmxldHRlciA9IDA7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBwYXNzd29yZC5sZW5ndGgoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgYyA9IHBhc3N3b3JkLmNoYXJBdChpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGMgPj0gJ0EnICYmIGMgPD0gJ1onKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsZXR0ZXJzKys7CisgICAgICAgICAgICAgICAgICAgICAgICB1cHBlcmNhc2UrKzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjID49ICdhJyAmJiBjIDw9ICd6JykgeworICAgICAgICAgICAgICAgICAgICAgICAgbGV0dGVycysrOworICAgICAgICAgICAgICAgICAgICAgICAgbG93ZXJjYXNlKys7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYyA+PSAnMCcgJiYgYyA8PSAnOScpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bWJlcnMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5vbmxldHRlcisrOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgc3ltYm9scysrOworICAgICAgICAgICAgICAgICAgICAgICAgbm9ubGV0dGVyKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW50IG5lZWRlZExldHRlcnMgPSBnZXRQYXNzd29yZE1pbmltdW1MZXR0ZXJzKG51bGwpOworICAgICAgICAgICAgICAgIGlmKGxldHRlcnMgPCBuZWVkZWRMZXR0ZXJzKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJyZXNldFBhc3N3b3JkOiBudW1iZXIgb2YgbGV0dGVycyAiICsgbGV0dGVycworICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkb2VzIG5vdCBtZWV0IHJlcXVpcmVkIG51bWJlciBvZiBsZXR0ZXJzICIgKyBuZWVkZWRMZXR0ZXJzKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnQgbmVlZGVkTnVtYmVycyA9IGdldFBhc3N3b3JkTWluaW11bU51bWVyaWMobnVsbCk7CisgICAgICAgICAgICAgICAgaWYgKG51bWJlcnMgPCBuZWVkZWROdW1iZXJzKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAudyhUQUcsICJyZXNldFBhc3N3b3JkOiBudW1iZXIgb2YgbnVtZXJpY2FsIGRpZ2l0cyAiICsgbnVtYmVycworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRvZXMgbm90IG1lZXQgcmVxdWlyZWQgbnVtYmVyIG9mIG51bWVyaWNhbCBkaWdpdHMgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBuZWVkZWROdW1iZXJzKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnQgbmVlZGVkTG93ZXJDYXNlID0gZ2V0UGFzc3dvcmRNaW5pbXVtTG93ZXJDYXNlKG51bGwpOworICAgICAgICAgICAgICAgIGlmIChsb3dlcmNhc2UgPCBuZWVkZWRMb3dlckNhc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInJlc2V0UGFzc3dvcmQ6IG51bWJlciBvZiBsb3dlcmNhc2UgbGV0dGVycyAiICsgbG93ZXJjYXNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRvZXMgbm90IG1lZXQgcmVxdWlyZWQgbnVtYmVyIG9mIGxvd2VyY2FzZSBsZXR0ZXJzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG5lZWRlZExvd2VyQ2FzZSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW50IG5lZWRlZFVwcGVyQ2FzZSA9IGdldFBhc3N3b3JkTWluaW11bVVwcGVyQ2FzZShudWxsKTsKKyAgICAgICAgICAgICAgICBpZiAodXBwZXJjYXNlIDwgbmVlZGVkVXBwZXJDYXNlKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJyZXNldFBhc3N3b3JkOiBudW1iZXIgb2YgdXBwZXJjYXNlIGxldHRlcnMgIiArIHVwcGVyY2FzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkb2VzIG5vdCBtZWV0IHJlcXVpcmVkIG51bWJlciBvZiB1cHBlcmNhc2UgbGV0dGVycyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBuZWVkZWRVcHBlckNhc2UpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBuZWVkZWRTeW1ib2xzID0gZ2V0UGFzc3dvcmRNaW5pbXVtU3ltYm9scyhudWxsKTsKKyAgICAgICAgICAgICAgICBpZiAoc3ltYm9scyA8IG5lZWRlZFN5bWJvbHMpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInJlc2V0UGFzc3dvcmQ6IG51bWJlciBvZiBzcGVjaWFsIHN5bWJvbHMgIiArIHN5bWJvbHMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3QgbWVldCByZXF1aXJlZCBudW1iZXIgb2Ygc3BlY2lhbCBzeW1ib2xzICIgKyBuZWVkZWRTeW1ib2xzKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnQgbmVlZGVkTm9uTGV0dGVyID0gZ2V0UGFzc3dvcmRNaW5pbXVtTm9uTGV0dGVyKG51bGwpOworICAgICAgICAgICAgICAgIGlmIChub25sZXR0ZXIgPCBuZWVkZWROb25MZXR0ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInJlc2V0UGFzc3dvcmQ6IG51bWJlciBvZiBub24tbGV0dGVyIGNoYXJhY3RlcnMgIiArIG5vbmxldHRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkb2VzIG5vdCBtZWV0IHJlcXVpcmVkIG51bWJlciBvZiBub24tbGV0dGVyIGNoYXJhY3RlcnMgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbmVlZGVkTm9uTGV0dGVyKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgTG9ja1BhdHRlcm5VdGlscyB1dGlscyA9IG5ldyBMb2NrUGF0dGVyblV0aWxzKG1Db250ZXh0KTsKKyAgICAgICAgICAgIGlmKHV0aWxzLmNoZWNrUGFzc3dvcmRIaXN0b3J5KHBhc3N3b3JkKSkgeworICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJyZXNldFBhc3N3b3JkOiBwYXNzd29yZCBpcyB0aGUgc2FtZSBhcyBvbmUgb2YgdGhlIGxhc3QgIgorICAgICAgICAgICAgICAgICAgICAgICAgKyBnZXRQYXNzd29yZEhpc3RvcnlMZW5ndGgobnVsbCkgKyAiIHBhc3N3b3JkcyIpOworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBpbnQgY2FsbGluZ1VpZCA9IEJpbmRlci5nZXRDYWxsaW5nVWlkKCk7CiAgICAgICAgIGlmIChtUGFzc3dvcmRPd25lciA+PSAwICYmIG1QYXNzd29yZE93bmVyICE9IGNhbGxpbmdVaWQpIHsKICAgICAgICAgICAgIFNsb2cudyhUQUcsICJyZXNldFBhc3N3b3JkOiBhbHJlYWR5IHNldCBieSBhbm90aGVyIHVpZCBhbmQgbm90IGVudGVyZWQgYnkgdXNlciIpOwogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIC8vIERvbid0IGRvIHRoaXMgd2l0aCB0aGUgbG9jayBoZWxkLCBiZWNhdXNlIGl0IGlzIGdvaW5nIHRvIGNhbGwKICAgICAgICAgLy8gYmFjayBpbiB0byB0aGUgc2VydmljZS4KICAgICAgICAgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwpAQCAtNzkxLDEwICsxMjc0LDEwIEBACiAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudCk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgc2V0TWF4aW11bVRpbWVUb0xvY2soQ29tcG9uZW50TmFtZSB3aG8sIGxvbmcgdGltZU1zKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CkBAIC04MDQsMTYgKzEyODcsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgRGV2aWNlQWRtaW5JbmZvLlVTRVNfUE9MSUNZX0ZPUkNFX0xPQ0spOwogICAgICAgICAgICAgaWYgKGFwLm1heGltdW1UaW1lVG9VbmxvY2sgIT0gdGltZU1zKSB7CiAgICAgICAgICAgICAgICAgYXAubWF4aW11bVRpbWVUb1VubG9jayA9IHRpbWVNczsKLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKLSAgICAgICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAgICAgdGltZU1zID0gZ2V0TWF4aW11bVRpbWVUb0xvY2sobnVsbCk7CiAgICAgICAgICAgICAgICAgICAgIGlmICh0aW1lTXMgPD0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgdGltZU1zID0gSW50ZWdlci5NQVhfVkFMVUU7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIGdldElQb3dlck1hbmFnZXIoKS5zZXRNYXhpbXVtU2NyZWVuT2ZmVGltZW91bnQoKGludCl0aW1lTXMpOwogICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewpAQCAtODI1LDE2ICsxMzA4LDE2IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgbG9uZyBnZXRNYXhpbXVtVGltZVRvTG9jayhDb21wb25lbnROYW1lIHdobykgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGxvbmcgdGltZSA9IDA7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOwogICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ubWF4aW11bVRpbWVUb1VubG9jayA6IHRpbWU7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKICAgICAgICAgICAgIGZvciAgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKQEAgLTg0OCw3ICsxMzMxLDcgQEAKICAgICAgICAgICAgIHJldHVybiB0aW1lOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgbG9ja05vdygpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICAvLyBUaGlzIEFQSSBjYW4gb25seSBiZSBjYWxsZWQgYnkgYW4gYWN0aXZlIGRldmljZSBhZG1pbiwKQEAgLTg2NSw3ICsxMzQ4LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHZvaWQgd2lwZURhdGFMb2NrZWQoaW50IGZsYWdzKSB7CiAgICAgICAgIGlmICgoZmxhZ3MmRGV2aWNlUG9saWN5TWFuYWdlci5XSVBFX0VYVEVSTkFMX1NUT1JBR0UpICE9IDApIHsKICAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEV4dGVybmFsU3RvcmFnZUZvcm1hdHRlci5GT1JNQVRfQU5EX0ZBQ1RPUllfUkVTRVQpOwpAQCAtODgwLDcgKzEzNjMsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgd2lwZURhdGEoaW50IGZsYWdzKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgLy8gVGhpcyBBUEkgY2FuIG9ubHkgYmUgY2FsbGVkIGJ5IGFuIGFjdGl2ZSBkZXZpY2UgYWRtaW4sCkBAIC04OTUsMTEgKzEzNzgsMTEgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIGdldFJlbW92ZVdhcm5pbmcoQ29tcG9uZW50TmFtZSBjb21wLCBmaW5hbCBSZW1vdGVDYWxsYmFjayByZXN1bHQpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKAogICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CSU5EX0RFVklDRV9BRE1JTiwgbnVsbCk7Ci0gICAgICAgIAorCiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZChjb21wKTsKICAgICAgICAgICAgIGlmIChhZG1pbiA9PSBudWxsKSB7CkBAIC05MjIsMjAgKzE0MDUsMzAgQEAKICAgICAgICAgICAgIH0sIG51bGwsIEFjdGl2aXR5LlJFU1VMVF9PSywgbnVsbCwgbnVsbCk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCi0gICAgcHVibGljIHZvaWQgc2V0QWN0aXZlUGFzc3dvcmRTdGF0ZShpbnQgcXVhbGl0eSwgaW50IGxlbmd0aCkgeworCisgICAgcHVibGljIHZvaWQgc2V0QWN0aXZlUGFzc3dvcmRTdGF0ZShpbnQgcXVhbGl0eSwgaW50IGxlbmd0aCwgaW50IGxldHRl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LmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkUXVhbGl0eSA9IHF1YWxpdHk7CiAgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZExlbmd0aCA9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTGV0dGVycyA9IGxldHRlcnM7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZExvd2VyQ2FzZSA9IGxvd2VyY2FzZTsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkVXBwZXJDYXNlID0gdXBwZXJjYXNlOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmROdW1lcmljID0gbnVtYmVyczsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkU3ltYm9scyA9IHN5bWJvbHM7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZE5vbkxldHRlciA9IG5vbmxldHRlcjsKICAgICAgICAgICAgICAgICAgICAgbUZhaWxlZFBhc3N3b3JkQXR0ZW1wdHMgPSAwOwogICAgICAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKICAgICAgICAgICAgICAgICAgICAgc2VuZEFkbWluQ29tbWFuZExvY2tlZChEZXZpY2VBZG1pblJlY2VpdmVyLkFDVElPTl9QQVNTV09SRF9DSEFOR0VELApAQCAtOTQ2LDExICsxNDM5LDExIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCByZXBvcnRGYWlsZWRQYXNzd29yZEF0dGVtcHQoKSB7CiAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbigKICAgICAgICAgICAgICAgICBhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24uQklORF9ERVZJQ0VfQURNSU4sIG51bGwpOwotICAgICAgICAKKwogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKICAgICAgICAgICAgIHRyeSB7CkBAIC05NjcsMTEgKzE0NjAsMTEgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHJlcG9ydFN1Y2Nlc3NmdWxQYXNzd29yZEF0dGVtcHQoKSB7CiAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbigKICAgICAgICAgICAgICAgICBhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24uQklORF9ERVZJQ0VfQURNSU4sIG51bGwpOwotICAgICAgICAKKwogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGlmIChtRmFpbGVkUGFzc3dvcmRBdHRlbXB0cyAhPSAwIHx8IG1QYXNzd29yZE93bmVyID49IDApIHsKICAgICAgICAgICAgICAgICBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CkBAIC05ODcsNyArMTQ4MCw5NSBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCisgICAgcHVibGljIENvbXBvbmVudE5hbWUgc2V0R2xvYmFsUHJveHkoQ29tcG9uZW50TmFtZSB3aG8sIFN0cmluZyBwcm94eVNwZWMsCisgICAgICAgICAgICBTdHJpbmcgZXhjbHVzaW9uTGlzdCkgeworICAgICAgICBzeW5jaHJvbml6ZWQodGhpcykgeworICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJDb21wb25lbnROYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZCh3aG8sCisgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9TRVRTX0dMT0JBTF9QUk9YWSk7CisKKyAgICAgICAgICAgIC8vIFNjYW4gdGhyb3VnaCBhY3RpdmUgYWRtaW5zIGFuZCBmaW5kIGlmIGFueW9uZSBoYXMgYWxyZWFkeQorICAgICAgICAgICAgLy8gc2V0IHRoZSBnbG9iYWwgcHJveHkuCisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOworICAgICAgICAgICAgU2V0PENvbXBvbmVudE5hbWU+IGNvbXBTZXQgPSBtQWRtaW5NYXAua2V5U2V0KCk7CisgICAgICAgICAgICBmb3IgIChDb21wb25lbnROYW1lIGNvbXBvbmVudCA6IGNvbXBTZXQpIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhcCA9IG1BZG1pbk1hcC5nZXQoY29tcG9uZW50KTsKKyAgICAgICAgICAgICAgICBpZiAoKGFwLnNwZWNpZmllc0dsb2JhbFByb3h5KSAmJiAoIWNvbXBvbmVudC5lcXVhbHMod2hvKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gQW5vdGhlciBhZG1pbiBhbHJlYWR5IHNldHMgdGhlIGdsb2JhbCBwcm94eQorICAgICAgICAgICAgICAgICAgICAvLyBSZXR1cm4gaXQgdG8gdGhlIGNhbGxlci4KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvbmVudDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocHJveHlTcGVjID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBhZG1pbi5zcGVjaWZpZXNHbG9iYWxQcm94eSA9IGZhbHNlOworICAgICAgICAgICAgICAgIGFkbWluLmdsb2JhbFByb3h5U3BlYyA9IG51bGw7CisgICAgICAgICAgICAgICAgYWRtaW4uZ2xvYmFsUHJveHlFeGNsdXNpb25MaXN0ID0gbnVsbDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisKKyAgICAgICAgICAgICAgICBhZG1pbi5zcGVjaWZpZXNHbG9iYWxQcm94eSA9IHRydWU7CisgICAgICAgICAgICAgICAgYWRtaW4uZ2xvYmFsUHJveHlTcGVjID0gcHJveHlTcGVjOworICAgICAgICAgICAgICAgIGFkbWluLmdsb2JhbFByb3h5RXhjbHVzaW9uTGlzdCA9IGV4Y2x1c2lvbkxpc3Q7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFJlc2V0IHRoZSBnbG9iYWwgcHJveHkgYWNjb3JkaW5nbHkKKyAgICAgICAgICAgIC8vIERvIHRoaXMgdXNpbmcgc3lzdGVtIHBlcm1pc3Npb25zLCBhcyBhcHBzIGNhbm5vdCB3cml0ZSB0byBzZWN1cmUgc2V0dGluZ3MKKyAgICAgICAgICAgIGxvbmcgb3JpZ0lkID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgICAgICByZXNldEdsb2JhbFByb3h5KCk7CisgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShvcmlnSWQpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgQ29tcG9uZW50TmFtZSBnZXRHbG9iYWxQcm94eUFkbWluKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQodGhpcykgeworICAgICAgICAgICAgLy8gU2NhbiB0aHJvdWdoIGFjdGl2ZSBhZG1pbnMgYW5kIGZpbmQgaWYgYW55b25lIGhhcyBhbHJlYWR5CisgICAgICAgICAgICAvLyBzZXQgdGhlIGdsb2JhbCBwcm94eS4KKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gbUFkbWluTGlzdC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGFwLnNwZWNpZmllc0dsb2JhbFByb3h5KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIERldmljZSBhZG1pbiBzZXRzIHRoZSBnbG9iYWwgcHJveHkKKyAgICAgICAgICAgICAgICAgICAgLy8gUmV0dXJuIGl0IHRvIHRoZSBjYWxsZXIuCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcC5pbmZvLmdldENvbXBvbmVudCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBObyBkZXZpY2UgYWRtaW4gc2V0cyB0aGUgZ2xvYmFsIHByb3h5LgorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVzZXRHbG9iYWxQcm94eSgpIHsKKyAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBOOyBpKyspIHsKKyAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gbUFkbWluTGlzdC5nZXQoaSk7CisgICAgICAgICAgICBpZiAoYXAuc3BlY2lmaWVzR2xvYmFsUHJveHkpIHsKKyAgICAgICAgICAgICAgICBzYXZlR2xvYmFsUHJveHkoYXAuZ2xvYmFsUHJveHlTcGVjLCBhcC5nbG9iYWxQcm94eUV4Y2x1c2lvbkxpc3QpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBObyBkZXZpY2UgYWRtaW5zIGRlZmluaW5nIGdsb2Jh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vaWQuTWFuaWZlc3QucGVybWlzc2lvbi5EVU1QKQpAQCAtOTk4LDEyICsxNTc5LDEyIEBACiAgICAgICAgICAgICAgICAgICAgICsgIiwgdWlkPSIgKyBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpKTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBmaW5hbCBQcmludGVyIHAgPSBuZXcgUHJpbnRXcml0ZXJQcmludGVyKHB3KTsKLSAgICAgICAgCisKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBwLnByaW50bG4oIkN1cnJlbnQgRGV2aWNlIFBvbGljeSBNYW5hZ2VyIHN0YXRlOiIpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHAucHJpbnRsbigiICBFbmFibGVkIERldmljZSBBZG1pbnM6Iik7CiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwogICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgewpAQCAtMTAxNCwxMSArMTU5NSwxNyBAQAogICAgICAgICAgICAgICAgICAgICBhcC5kdW1wKCIgICAgIiwgcHcpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBwdy5wcmludGxuKCIgIik7CiAgICAgICAgICAgICBwdy5wcmludCgiICBtQWN0aXZlUGFzc3dvcmRRdWFsaXR5PTB4Iik7CiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4oSW50ZWdlci50b0hleFN0cmluZyhtQWN0aXZlUGFzc3dvcmRRdWFsaXR5KSk7CiAgICAgICAgICAgICBwdy5wcmludCgiICBtQWN0aXZlUGFzc3dvcmRMZW5ndGg9Iik7IHB3LnByaW50bG4obUFjdGl2ZVBhc3N3b3JkTGVuZ3RoKTsKKyAgICAgICAgICAgIHB3LnByaW50KCIgIG1BY3RpdmVQYXNzd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XJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9Eb2NrT2JzZXJ2ZXIuamF2YQorKysgYi9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9Eb2NrT2JzZXJ2ZXIuamF2YQpAQCAtMTAzLDcgKzEwMyw2IEBACiAgICAgICAgICAgICBGaWxlUmVhZGVyIGZpbGUgPSBuZXcgRmlsZVJlYWRlcihET0NLX1NUQVRFX1BBVEgpOwogICAgICAgICAgICAgaW50IGxlbiA9IGZpbGUucmVhZChidWZmZXIsIDAsIDEwMjQpOwogICAgICAgICAgICAgbVByZXZpb3VzRG9ja1N0YXRlID0gbURvY2tTdGF0ZSA9IEludGVnZXIudmFsdWVPZigobmV3IFN0cmluZyhidWZmZXIsIDAsIGxlbikpLnRyaW0oKSk7Ci0KICAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIFNsb2cudyhUQUcsICJUaGlzIGtlcm5lbCBkb2VzIG5vdCBoYXZlIGRvY2sgc3RhdGlvbiBzdXBwb3J0Iik7CiAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CkBAIC0xNTgsMTMgKzE1NywxNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyB3aGljaFNvdW5kID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobURvY2tTdGF0ZSA9PSBJbnRlbnQuRVhUUkFfRE9DS19TVEFURV9VTkRPQ0tFRCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVByZXZpb3VzRG9ja1N0YXRlID09IEludGVudC5FWFRSQV9ET0NLX1NUQVRFX0RFU0spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChtUHJldmlvdXNEb2NrU3RhdGUgPT0gSW50ZW50LkVYVFJBX0RPQ0tfU1RBVEVfREVTSykgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtUHJldmlvdXNEb2NrU3RhdGUgPT0gSW50ZW50LkVYVFJBX0RPQ0tfU1RBVEVfTEVfREVTSykgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtUHJldmlvdXNEb2NrU3RhdGUgPT0gSW50ZW50LkVYVFJBX0RPQ0tfU1RBVEVfSEVfREVTSykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWNoU291bmQgPSBTZXR0aW5ncy5TeXN0ZW0uREVTS19VTkRPQ0tfU09VTkQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVByZXZpb3VzRG9ja1N0YXRlID09IEludGVudC5FWFRSQV9ET0NLX1NUQVRFX0NBUikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpY2hTb3VuZCA9IFNldHRpbmdzLlN5c3RlbS5DQVJfVU5ET0NLX1NPVU5EOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Eb2NrU3RhdGUgPT0gSW50ZW50LkVYVFJBX0RPQ0tfU1RBVEVfREVTSykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG1Eb2NrU3RhdGUgPT0gSW50ZW50LkVYVFJBX0RPQ0tfU1RBVEVfREVTSykgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtRG9ja1N0YXRlID09IEludGVudC5FWFRSQV9ET0NLX1NUQVRFX0xFX0RFU0spIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobURvY2tTdGF0ZSA9PSBJbnRlbnQuRVhUUkFfRE9DS19TVEFURV9IRV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BtV2FrZUxvY2suYWNxdWlyZSgpOwotICAgICAgICBtSGFuZGxlci5zZW5kTWVzc2FnZURlbGF5ZWQobUhhbmRsZXIub2J0YWluTWVzc2FnZSgwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZHNldFN0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJldkhlYWRzZXRTdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhlYWRzZXROYW1lKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGF5KTsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHN5bmNocm9uaXplZCBmaW5hbCB2b2lkIHNlbmRJbnRlbnRzKGludCBoZWFkc2V0U3RhdGUsIGludCBwcmV2SGVhZHNldFN0YXRlLCBTdHJpbmcgaGVhZHNldE5hbWUpIHsKLSAgICAgICAgaW50IGFsbEhlYWRzZXRzID0gU1VQUE9SVEVEX0hFQURTRVRTOwotICAgICAgICBmb3IgKGludCBjdXJIZWFkc2V0ID0gMTsgYWxsSGVhZHNldHMgIT0gMDsgY3VySGVhZHNldCA8PD0gMSkgewotICAgICAgICAgICAgaWYgKChjdXJIZWFkc2V0ICYgYWxsSGVhZHNldHMpICE9IDApIHsKLSAgICAgICAgICAgICAgICBzZW5kSW50ZW50KGN1ckhlYWRzZXQsIGhlYWRzZXRTdGF0ZSwgcHJldkhlYWRzZXRTdGF0ZSwgaGVhZHNldE5hbWUpOwotICAgICAgICAgICAgICAgIGFsbEhlYWRzZXRzICY9IH5jdXJIZWFkc2V0OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBmaW5hbCB2b2lkIHNlbmRJbnRlbnQoaW50IGhlYWRzZXQsIGludCBoZWFkc2V0U3RhdGUsIGludCBwcmV2SGVhZHNldFN0YXRlLCBTdHJpbmcgaGVhZHNldE5hbWUpIHsKLSAgICAgICAgaWYgKChoZWFkc2V0U3RhdGUgJiBoZWFkc2V0KSAhPSAocHJldkhlYWRzZXRTdGF0ZSAmIGhlYWRzZXQpKSB7Ci0gICAgICAgICAgICAvLyAgUGFjayB1cCB0aGUgdmFsdWVzIGFuZCBicm9hZGNhc3QgdGhlbSB0byBldmVyeW9uZQotICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9IRUFEU0VUX1BMVUcpOwotICAgICAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWSk7Ci0gICAgICAgICAgICBpbnQgc3RhdGUgPSAwOwotICAgICAgICAgICAgaW50IG1pY3JvcGhvbmUgPSAwOwotCi0gICAgICAgICAgICBpZiAoKGhlYWRzZXQgJiBIRUFEU0VUU19XSVRIX01JQykgIT0gMCkgewotICAgICAgICAgICAgICAgIG1pY3JvcGhvbmUgPSAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKChoZWFkc2V0U3RhdGUgJiBoZWFkc2V0KSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgc3RhdGUgPSAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJzdGF0ZSIsIHN0YXRlKTsKLSAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgibmFtZSIsIGhlYWRzZXROYW1lKTsKLSAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgibWljcm9waG9uZSIsIG1pY3JvcGhvbmUpOwotCi0gICAgICAgICAgICBpZiAoTE9HKSBTbG9nLnYoVEFHLCAiSW50ZW50LkFDVElPTl9IRUFEU0VUX1BMVUc6IHN0YXRlOiAiK3N0YXRlKyIgbmFtZTogIitoZWFkc2V0TmFtZSsiIG1pYzogIittaWN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JlLmdldFVyaUZvcigKICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkRFRkFVTFRfSU5QVVRfTUVUSE9EKSwgZmFsc2UsIHRoaXMpOworICAgICAgICAgICAgcmVzb2x2ZXIucmVnaXN0ZXJDb250ZW50T2JzZXJ2ZXIoU2V0dGluZ3MuU2VjdXJlLmdldFVyaUZvcigKKyAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLlNFTEVDVEVEX0lOUFVUX01FVEhPRF9TVUJUWVBFKSwgZmFsc2UsIHRoaXMpOwogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlIHB1YmxpYyB2b2lkIG9uQ2hhbmdlKGJvb2xlYW4gc2VsZkNoYW5nZSkgewpAQCAtMzUxLDkgKzM2NCw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRvaXQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dFN0cmluZyhtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkRFRkFVTFRfSU5QVVRfTUVUSE9ELCAiIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNldFNlbGVjdGVkSW5wdXRNZXRob2RTdWJ0eXBlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VOZXdEZWZhdWx0SU1FTG9ja2VkKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtNDA5LDE2ICs0MjIsMTUgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNob29zZU5ld0RlZmF1bHRJTUVMb2NrZWQoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFuZ2VkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VySW0gPSBudWxsOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJJbnB1dE1ldGhvZElkID0gIiI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuaShUQUcsICJVbnNldHRpbmcgY3VycmVudCBpbnB1dCBtZXRob2QiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dFN0cmluZyhtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuREVGQVVMVF9JTlBVVF9NRVRIT0QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VySW5wdXRNZXRob2RJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkRFRkFVTFRfSU5QVVRfTUVUSE9ELCAiIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0U2VsZWN0ZWRJbnB1dE1ldGhvZFN1YnR5cGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBpZiAoY3VySW0gPT0gbnVsbCkgewogICAgICAgICA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kltID09IG51bGwgJiYgaW1pLmdldElzRGVmYXVsdFJlc291cmNlSWQoKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBSZXNvdXJjZXMgcmVzID0gbUNvbnRleHQuY3JlYXRlUGFja2FnZUNvbnRleHQoCisgICAgICAgICAgICAgICAgICAgICAgICBSZXNvdXJjZXMgcmVzID0gY29udGV4dC5jcmVhdGVQYWNrYWdlQ29udGV4dCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1pLmdldFBhY2thZ2VOYW1lKCksIDApLmdldFJlc291cmNlcygpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcy5nZXRCb29sZWFuKGltaS5nZXRJc0RlZmF1bHRSZXNvdXJjZUlkKCkpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmSW0gPSBpbWk7CkBAIC01MDAsMTUgKzUwMywxNCBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGRlZkltID09IG51bGwgJiYgTiA+IDApIHsKKyAgICAgICAgICAgIGlmIChkZWZJbSA9PSBudWxsICYmIG1NZXRob2RMaXN0LnNpemUoKSA+IDApIHsKICAgICAgICAgICAgICAgICBkZWZJbSA9IG1NZXRob2RMaXN0LmdldCgwKTsKICAgICAgICAgICAgICAgICBTbG9nLmkoVEFHLCAiTm8gZGVmYXVsdCBmb3VuZCwgdXNpbmcgIiArIGRlZkltLmdldElkKCkpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dFN0cmluZyhtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkVOQUJMRURfSU5QVVRfTUVUSE9EUywgc2IudG9TdHJpbmcoKSk7CiAgICAgICAgICAgICBpZiAoZGVmSW0gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5wdXRTdHJpbmcobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCiAgICAgICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuREVGQVVMVF9JTlBVVF9NRVRIT0QsIGRlZkltLmdldElkKCkpOworICAgICAgICAgICAgICAgIHB1dFNlbGVjdGVkSW5wdXRNZXRob2RTdWJ0eXBlKGRlZkltLCBOT1RfQV9TVUJUWVBFX0lEKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC01NTIsMzEgKzU1NCwxMCBAQAogCiAgICAgcHVibGljIExpc3Q8SW5wdXRNZXRob2RJbmZvPiBnZXRFbmFibGVkSW5wdXRNZXRob2RMaXN0KCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKG1NZXRob2RNYXApIHsKLSAgICAgICAgICAgIHJldHVybiBnZXRFbmFibGVkSW5wdXRNZXRob2RMaXN0TG9ja2VkKCk7CisgICAgICAgICAgICByZXR1cm4gbVNldHRpbmdzLmdldEVuYWJsZWRJbnB1dE1ldGhvZExpc3RMb2NrZWQoKTsKICAgICAgICAgfQogICAgIH0KIAotICAgIExpc3Q8SW5wdXRNZXRob2RJbmZvPiBnZXRFbmFibGVkSW5wdXRNZXRob2RMaXN0TG9ja2VkKCkgewotICAgICAgICBmaW5hbCBBcnJheUxpc3Q8SW5wdXRNZXRob2RJbmZvPiByZXMgPSBuZXcgQXJyYXlMaXN0PElucHV0TWV0aG9kSW5mbz4oKTsKLQotICAgICAgICBmaW5hbCBTdHJpbmcgZW5hYmxlZFN0ciA9IFNldHRpbmdzLlNlY3VyZS5nZXRTdHJpbmcoCi0gICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCi0gICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkVOQUJMRURfSU5QVVRfTUVUSE9EUyk7Ci0gICAgICAgIGlmIChlbmFibGVkU3RyICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZpbmFsIFRleHRVdGlscy5TaW1wbGVTdHJpbmdTcGxpdHRlciBzcGxpdHRlciA9IG1TdHJpbmdDb2xvblNwbGl0dGVyOwotICAgICAgICAgICAgc3BsaXR0ZXIuc2V0U3RyaW5nKGVuYWJsZWRTdHIpOwotCi0gICAgICAgICAgICB3aGlsZSAoc3BsaXR0ZXIuaGFzTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgSW5wdXRNZXRob2RJbmZvIGluZm8gPSBtTWV0aG9kTWFwLmdldChzcGxpdHRlci5uZXh0KCkpOwotICAgICAgICAgICAgICAgIGlmIChpbmZvICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcmVzLmFkZChpbmZvKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gcmVzOwotICAgIH0KLQogICAgIHB1YmxpYyB2b2lkIGFkZENsaWVudChJSW5wdXRNZXRob2RDbGllbnQgY2xpZW50LAogICAgICAgICAgICAgSUlucHV0Q29udGV4dCBpbnB1dENvbnRleHQsIGludCB1aWQsIGludCBwaWQpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtTWV0aG9kTWFwKSB7CkBAIC05NTksMTYgKzk0MCwzMyBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgcHVibGljIHZvaWQgc2V0SU1FQnV0dG9uVmlzaWJsZShJQmluZGVyIHRva2VuLCBib29sZWFuIHZpc2libGUpIHsKKyAgICAgICAgaW50IHVpZCA9IEJpbmRlci5nZXRDYWxsaW5nVWlkKCk7CisgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmICh0b2tlbiA9PSBudWxsIHx8IG1DdXJUb2tlbiAhPSB0b2tlbikgeworICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJJZ25vcmluZyBzZXRJTUVCdXR0b25WaXNpYmxlIG9mIHVpZCAiICsgdWlkICsgIiB0b2tlbjogIiArIHRva2VuKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobU1ldGhvZE1hcCkgeworICAgICAgICAgICAgICAgIG1TdGF0dXNCYXIuc2V0SU1FQnV0dG9uVmlzaWJsZSh2aXNpYmxlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50KTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHZvaWQgdXBkYXRlRnJvbVNldHRpbmdzTG9ja2VkKCkgewogICAgICAgICAvLyBXZSBhcmUgYXNzdW1pbmcgdGhhdCB3aG9ldmVyIGlzIGNoYW5naW5nIERFRkFVTFRfSU5QVVRfTUVUSE9EIGFuZAogICAgICAgICAvLyBFTkFCTEVEX0lOUFVUX01FVEhPRFMgaXMgdGFraW5nIGNhcmUgb2Yga2VlcGluZyB0aGVtIGNvcnJlY3RseSBpbgogICAgICAgICAvLyBzeW5jLCBzbyB3ZSB3aWxsIG5ldmVyIGhhdmUgYSBERUZBVUxUX0lOUFVUX01FVEhPRCB0aGF0IGlzIG5vdAogICAgICAgICAvLyBlbmFibGVkLgogICAgICAgICBTdHJpbmcgaWQgPSBTZXR0aW5ncy5TZWN1cmUuZ2V0U3RyaW5nKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkRFRkFVTFRfSU5QVVRfTUVUSE9EKTsKKyAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuREVGQVVMVF9JTlBVVF9NRVRIT0QpOwogICAgICAgICBpZiAoaWQgIT0gbnVsbCAmJiBpZC5sZW5ndGgoKSA+IDApIHsKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgc2V0SW5wdXRNZXRob2RMb2NrZWQoaWQpOworICAgICAgICAgICAgICAgIHNldElucHV0TWV0aG9kTG9ja2VkKGlkLCBnZXRTZWxlY3RlZElucHV0TWV0aG9kU3VidHlwZUlkKGlkKSk7CiAgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJVbmtub3duIGlucHV0IG1ldGhvZCBmcm9tIHByZWZzOiAiICsgaWQsIGUpOwogICAgICAgICAgICAgICAgIG1DdXJNZXRob2RJZCA9IG51bGw7CkBAIC05ODEsMjEgKzk3OSw1MSBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgdm9pZCBzZXRJbnB1dE1ldGhvZExvY2tlZChTdHJpbmcgaWQpIHsKKyAgICAvKiBwYWNrYWdlICovIHZvaWQgc2V0SW5wdXRNZXRob2RMb2NrZWQoU3RyaW5nIGlkLCBpbnQgc3VidHlwZUlkKSB7CiAgICAgICAgIElucHV0TWV0aG9kSW5mbyBpbmZvID0gbU1ldGhvZE1hcC5nZXQoaWQpOwogICAgICAgICBpZiAoaW5mbyA9PSBudWxsKSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGlkOiAiICsgaWQpOwogICAgICAgICB9CiAKICAgICAgICAgaWYgKGlkLmVxdWFscyhtQ3VyTWV0aG9kSWQpKSB7CisgICAgICAgICAgICBpZiAoc3VidHlwZUlkICE9IE5PVF9BX1NVQlRZUEVfSUQpIHsKKyAgICAgICAgICAgICAgICBJbnB1dE1ldGhvZFN1YnR5cGUgc3VidHlwZSA9IGluZm8uZ2V0U3VidHlwZXMoKS5nZXQoc3VidHlwZUlkKTsKKyAgICAgICAgICAgICAgICBpZiAoc3VidHlwZSAhPSBtQ3VycmVudFN1YnR5cGUpIHsKKyAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtTWV0aG9kTWFwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUN1ck1ldGhvZCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0U2VsZWN0ZWRJbnB1dE1ldGhvZFN1YnR5cGUoaW5mbywgc3VidHlwZUlkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRTdWJ0eXBlID0gc3VidHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1JbnB1dFNob3duKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBtSW5wdXRTaG93biBpcyBmYWxzZSwgdGhlcmUgaXMgbm8gSU1FIGJ1dHRvbiBvbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN5c3RlbSBiYXIuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaHVzIHRoZXJlIGlzIG5vIG5lZWQgdG8gbWFrZSBpdCBpbnZpc2libGUgZXhwbGljaXRseS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TdGF0dXNCYXIuc2V0SU1FQnV0dG9uVmlzaWJsZSh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VyTWV0aG9kLmNoYW5nZUlucHV0TWV0aG9kU3VidHlwZShzdWJ0eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKICAgICAgICAgZmluYWwgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgbUN1ck1ldGhvZElkID0gaWQ7CisgICAgICAgICAgICAvLyBTZXQgYSBzdWJ0eXBlIHRvIHRoaXMgaW5wdXQgbWV0aG9kLgorICAgICAgICAgICAgLy8gc3VidHlwZUlkIHRoZSBuYW1lIG9mIGEgc3VidHlwZSB3aGljaCB3aWxsIGJlIHNldC4KKyAgICAgICAgICAgIGlmIChwdXRTZWxlY3RlZElucHV0TWV0aG9kU3VidHlwZShpbmZvLCBzdWJ0eXBlSWQpKSB7CisgICAgICAgICAgICAgICAgbUN1cnJlbnRTdWJ0eXBlID0gaW5mby5nZXRTdWJ0eXBlcygpLmdldChzdWJ0eXBlSWQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFN1YnR5cGUgPSBudWxsOworICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUucHV0U3RyaW5nKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5ERUZBVUxUX0lOUFVUX01FVEhPRCwgaWQpOworICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuREVGQVVMVF9JTlBVVF9NRVRIT0QsIGlkKTsKIAogICAgICAgICAgICAgaWYgKEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5pc1N5c3RlbVJlYWR5KCkpIHsKICAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX0lOUFVUX01FVEhPRF9DSEFOR0VEKTsKQEAgLTEyMjMsNyArMTI1MSw3IEBACiAgICAgICAgIHN5bmNocm9uaXplZCAobU1ldGhvZE1hcCkgewogICAgICAgICAgICAgaWYgKG1DdXJDbGllbnQgPT0gbnVsbCB8fCBjbGllbnQgPT0gbnVsbAogICAgICAgICAgICAgICAgICAgICB8fCBtQ3VyQ2xpZW50LmNsaWVudC5hc0JpbmRlcigpICE9IGNsaWVudC5hc0JpbmRlcigpKSB7Ci0gICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIklnbm9yaW5nIHNob3dJbnB1dE1ldGhvZERpYWxvZ0Zyb21DbGllbnQgb2YgdWlkICIKKyAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAiSWdub3Jpbmcgc2hvd0lucHV0TWV0aG9kUGlja2VyRnJvbUNsaWVudCBvZiB1aWQgIgogICAgICAgICAgICAgICAgICAgICAgICAgKyBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpICsgIjogIiArIGNsaWVudCk7CiAgICAgICAgICAgICB9CiAKQEAgLTEyMzEsNyArMTI1OSwzNSBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgcHVibGljIHZvaWQgc2hvd0lucHV0TWV0aG9kU3VidHlwZVBpY2tlckZyb21DbGllbnQoSUlucHV0TWV0aG9kQ2xpZW50IGNsaWVudCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1NZXRob2RNYXApIHsKKyAgICAgICAgICAgIGlmIChtQ3VyQ2xpZW50ID09IG51bGwgfHwgY2xpZW50ID09IG51bGwKKyAgICAgICAgICAgICAgICAgICAgfHwgbUN1ckNsaWVudC5jbGllbnQuYXNCaW5kZXIoKSAhPSBjbGllbnQuYXNCaW5kZXIoKSkgeworICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJJZ25vcmluZyBzaG93SW5wdXRNZXRob2RTdWJ0eXBlUGlja2VyRnJvbUNsaWVudCBvZjogIiArIGNsaWVudCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2UoTVNHX1NIT1dfSU1fU1VCVFlQRV9QSUNLRVIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2hvd0lucHV0TWV0aG9kQW5kU3VidHlwZUVuYWJsZXJGcm9tQ2xpZW50KAorICAgICAgICAgICAgSUlucHV0TWV0aG9kQ2xpZW50IGNsaWVudCwgU3RyaW5nIHRvcElkKSB7CisgICAgICAgIC8vIFRPRE86IEhhbmRsZSB0b3BJZCBmb3Igc2V0dGluZyB0aGUgdG9wIHBvc2l0aW9uIG9mIHRoZSBsaXN0IGFjdGl2aXR5CisgICAgICAgIHN5bmNocm9uaXplZCAobU1ldGhvZE1hcCkgeworICAgICAgICAgICAgaWYgKG1DdXJDbGllbnQgPT0gbnVsbCB8fCBjbGllbnQgPT0gbnVsbAorICAgICAgICAgICAgICAgICAgICB8fCBtQ3VyQ2xpZW50LmNsaWVudC5hc0JpbmRlcigpICE9IGNsaWVudC5hc0JpbmRlcigpKSB7CisgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIklnbm9yaW5nIHNob3dJbnB1dE1ldGhvZEFuZFN1YnR5cGVFbmFibGVyRnJvbUNsaWVudCBvZjogIiArIGNsaWVudCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2UoTVNHX1NIT1dfSU1fU1VCVFlQRV9FTkFCTEVSKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHB1YmxpYyB2b2lkIHNldElucHV0TWV0aG9kKElCaW5kZXIgdG9rZW4sIFN0cmluZyBpZCkgeworICAgICAgICBzZXRJbnB1dE1ldGhvZFdpdGhTdWJ0eXBlKHRva2VuLCBpZCwgTk9UX0FfU1VCVFlQRV9JRCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldElucHV0TWV0aG9kV2l0aFN1YnR5cGUoSUJpbmRlciB0b2tlbiwgU3RyaW5nIGlkLCBpbnQgc3VidHlwZUlkKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAobU1ldGhvZE1hcCkgewogICAgICAgICAgICAgaWYgKHRva2VuID09IG51bGwpIHsKICAgICAgICAgICAgICAgICBpZiAobUNvbnRleHQuY2hlY2tDYWxsaW5nT3JTZWxmUGVybWlzc2lvbigKQEAgLTEyNDksNyArMTMwNSw3IEBACiAKICAgICAgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgc2V0SW5wdXRNZXRob2RMb2NrZWQoaWQpOworICAgICAgICAgICAgICAgIHNldElucHV0TWV0aG9kTG9ja2VkKGlkLCBzdWJ0eXBlSWQpOwogICAgICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudCk7CiAgICAgICAgICAgICB9CkBAIC0xMzE1LDYgKzEzNzEsMTQgQEAKICAgICAgICAgICAgICAgICBzaG93SW5wdXRNZXRob2RNZW51KCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAKKyAgICAgICAgICAgIGNhc2UgTVNHX1NIT1dfSU1fU1VCVFlQRV9QSUNLRVI6CisgICAgICAgICAgICAgICAgc2hvd0lucHV0TWV0aG9kU3VidHlwZU1lbnUoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKworICAgICAgICAgICAgY2FzZSBNU0dfU0hPV19JTV9TVUJUWVBFX0VOQUJMRVI6CisgICAgICAgICAgICAgICAgc2hvd0lucHV0TWV0aG9kQW5kU3VidHlwZUVuYWJsZXIoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKwogICAgICAgICAgICAgLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAKICAgICAgICAgICAgIGNhc2UgTVNHX1VOQklORF9JTlBVVDoKQEAgLTE0MTQsNyArMTQ3OCw3IEBACiAgICAgfQogCiAgICAgcHJpdmF0ZSBib29sZWFuIGNob29zZU5ld0RlZmF1bHRJTUVMb2NrZWQoKSB7Ci0gICAgICAgIExpc3Q8SW5wdXRNZXRob2RJbmZvPiBlbmFibGVkID0gZ2V0RW5hYmxlZElucHV0TWV0aG9kTGlzdExvY2tlZCgpOworICAgICAgICBMaXN0PElucHV0TWV0aG9kSW5mbz4gZW5hYmxlZCA9IG1TZXR0aW5ncy5nZXRFbmFibGVkSW5wdXRNZXRob2RMaXN0TG9ja2VkKCk7CiAgICAgICAgIGlmIChlbmFibGVkICE9IG51bGwgJiYgZW5hYmxlZC5zaXplKCkgPiAwKSB7CiAgICAgICAgICAgICAvLyBXZSdkIHByZWZlciB0byBmYWxsIGJhY2sgb24gYSBzeXN0ZW0gSU1FLCBzaW5jZSB0aGF0IGlzIHNhZmVyLgogICAgICAgICAgICAgaW50IGk9ZW5hYmxlZC5zaXplKCk7CkBAIC0xNDI1LDkgKzE0ODksMTAgQEAKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgSW5wdXRNZXRob2RJbmZvIGltaSA9IGVuYWJsZWQuZ2V0KGkpOwogICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dFN0cmluZyhtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkRFRkFVTFRfSU5QVVRfTUVUSE9ELAotICAgICAgICAgICAgICAgICAgICBlbmFibGVkLmdldChpKS5nZXRJZCgpKTsKKyAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkRFRkFVTFRfSU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0ZSB2b2lkIHNob3dJbnB1dE1ldGhvZE1lbnVJbnRlcm5hbChib29sZWFuIHNob3dTdWJ0eXBlcykgewogICAgICAgICBpZiAoREVCVUcpIFNsb2cudihUQUcsICJTaG93IHN3aXRjaGluZyBtZW51Iik7CiAKICAgICAgICAgZmluYWwgQ29udGV4dCBjb250ZXh0ID0gbUNvbnRleHQ7CkBAIC0xNTA3LDQ4ICsxNTg4LDkxIEBACiAKICAgICAgICAgU3RyaW5nIGxhc3RJbnB1dE1ldGhvZElkID0gU2V0dGluZ3MuU2VjdXJlLmdldFN0cmluZyhjb250ZXh0CiAgICAgICAgICAgICAgICAgLmdldENvbnRlbnRSZXNvbHZlcigpLCBTZXR0aW5ncy5TZWN1cmUuREVGQVVMVF9JTlBVVF9NRVRIT0QpOworICAgICAgICBpbnQgbGFzdElucHV0TWV0aG9kU3VidHlwZUlkID0gZ2V0U2VsZWN0ZWRJbnB1dE1ldGhvZFN1YnR5cGVJZChsYXN0SW5wdXRNZXRob2RJZCk7CiAgICAgICAgIGlmIChERUJVRykgU2xvZy52KFRBRywgIkN1cnJlbnQgSU1FOiAiICsgbGFzdElucHV0TWV0aG9kSWQpOwogCi0gICAgICAgIGZpbmFsIExpc3Q8SW5wdXRNZXRob2RJbmZvPiBpbW1pcyA9IGdldEVuYWJsZWRJbnB1dE1ldGhvZExpc3QoKTsKLQotICAgICAgICBpZiAoaW1taXMgPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIAogICAgICAgICBzeW5jaHJvbml6ZWQgKG1NZXRob2RNYXApIHsKKyAgICAgICAgICAgIGZpbmFsIExpc3Q8UGFpcjxJbnB1dE1ldGhvZEluZm8sIEFycmF5TGlzdDxTdHJpbmc+Pj4gaW1taXMgPQorICAgICAgICAgICAgICAgICAgICBtU2V0dGluZ3MuZ2V0RW5hYmxlZElucHV0TWV0aG9kQW5kU3VidHlwZUxpc3RMb2NrZWQoKTsKKyAgICAgICAgICAgIEFycmF5TGlzdDxJbnRlZ2VyPiBzdWJ0eXBlSWRzID0gbmV3IEFycmF5TGlzdDxJbnRlZ2VyPigpOworCisgICAgICAgICAgICBpZiAoaW1taXMgPT0gbnVsbCB8fCBpbW1pcy5zaXplKCkgPT0gMCkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgaGlkZUlucHV0TWV0aG9kTWVudUxvY2tlZCgpOwogCiAgICAgICAgICAgICBpbnQgTiA9IGltbWlzLnNpemUoKTsKIAotICAgICAgICAgICAgZmluYWwgTWFwPENoYXJTZXF1ZW5jZSwgSW5wdXRNZXRob2RJbmZvPiBpbU1hcCA9Ci0gICAgICAgICAgICAgICAgbmV3IFRyZWVNYXA8Q2hhclNlcXVlbmNlLCBJbnB1dE1ldGhvZEluZm8+KENvbGxhdG9yLmdldEluc3RhbmNlKCkpOworICAgICAgICAgICAgZmluYWwgTWFwPENoYXJTZXF1ZW5jZSwgUGFpcjxJbnB1dE1ldGhvZEluZm8sIEludGVnZXI+PiBpbU1hcCA9CisgICAgICAgICAgICAgICAgbmV3IFRyZWVNYXA8Q2hhclNlcXVlbmNlLCBQYWlyPElucHV0TWV0aG9kSW5mbywgSW50ZWdlcj4+KENvbGxhdG9yLmdldEluc3RhbmNlKCkpOwogCiAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47ICsraSkgewotICAgICAgICAgICAgICAgIElucHV0TWV0aG9kSW5mbyBwcm9wZXJ0eSA9IGltbWlzLmdldChpKTsKKyAgICAgICAgICAgICAgICBJbnB1dE1ldGhvZEluZm8gcHJvcGVydHkgPSBpbW1pcy5nZXQoaSkuZmlyc3Q7CisgICAgICAgICAgICAgICAgZmluYWwgQXJyYXlMaXN0PFN0cmluZz4gZW5hYmxlZFN1YnR5cGVJZHMgPSBpbW1pcy5nZXQoaSkuc2Vjb25kOworICAgICAgICAgICAgICAgIEhhc2hTZXQ8U3RyaW5nPiBlbmFibGVkU3VidHlwZVNldCA9IG5ldyBIYXNoU2V0PFN0cmluZz4oKTsKKyAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBzIDogZW5hYmxlZFN1YnR5cGVJZHMpIHsKKyAgICAgICAgICAgICAgICAgICAgZW5hYmxlZFN1YnR5cGVTZXQuYWRkKHMpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAocHJvcGVydHkgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaW1NYXAucHV0KHByb3BlcnR5LmxvYWRMYWJlbChwbSksIHByb3BlcnR5KTsKKyAgICAgICAgICAgICAgICBBcnJheUxpc3Q8SW5wdXRNZXRob2RTdWJ0eXBlPiBzdWJ0eXBlcyA9IHByb3BlcnR5LmdldFN1YnR5cGVzKCk7CisgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIGxhYmVsID0gcHJvcGVydHkubG9hZExhYmVsKHBtKTsKKyAgICAgICAgICAgICAgICBpZiAoc2hvd1N1YnR5cGVzICYmIGVuYWJsZWRTdWJ0eXBlU2V0LnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBzdWJ0eXBlcy5zaXplKCk7ICsraikgeworICAgICAgICAgICAgICAgICAgICAgICAgSW5wdXRNZXRob2RTdWJ0eXBlIHN1YnR5cGUgPSBzdWJ0eXBlcy5nZXQoaik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5hYmxlZFN1YnR5cGVTZXQuY29udGFpbnMoU3RyaW5nLnZhbHVlT2Yoc3VidHlwZS5oYXNoQ29kZSgpKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGl0bGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG5hbWVSZXNJZCA9IHN1YnR5cGUuZ2V0TmFtZVJlc0lkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG1vZGVSZXNJZCA9IHN1YnR5cGUuZ2V0TW9kZVJlc0lkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5hbWVSZXNJZCAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gcG0uZ2V0VGV4dChwcm9wZXJ0eS5nZXRQYWNrYWdlTmFtZSgpLCBuYW1lUmVzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHkuZ2V0U2VydmljZUluZm8oKS5hcHBsaWNhdGlvbkluZm8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBsYW5ndWFnZSA9IHN1YnR5cGUuZ2V0TG9jYWxlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBtb2RlID0gbW9kZVJlc0lkID09IDAgPyBudWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBwbS5nZXRUZXh0KHByb3BlcnR5LmdldFBhY2thZ2VOYW1lKCksIG1vZGVSZXNJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5LmdldFNlcnZpY2VJbmZvKCkuYXBwbGljYXRpb25JbmZvKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogVXNlIG1vcmUgZnJpZW5kbHkgVGl0bGUgYW5kIFVJCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gbGFiZWwgKyAiLCIgKyAobW9kZSA9PSBudWxsID8gIiIgOiBtb2RlKSArICIsIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKGxhbmd1YWdlID09IG51bGwgPyAiIiA6IGxhbmd1YWdlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1NYXAucHV0KHRpdGxlLCBuZXcgUGFpcjxJbnB1dE1ldGhvZEluZm8sIEludGVnZXI+KHByb3BlcnR5LCBqKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpbU1hcC5wdXQobGFiZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFBhaXI8SW5wdXRNZXRob2RJbmZvLCBJbnRlZ2VyPihwcm9wZXJ0eSwgTk9UX0FfU1VCVFlQRV9JRCkpOworICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlSWRzLmFkZCgwKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIE4gPSBpbU1hcC5zaXplKCk7CiAgICAgICAgICAgICBtSXRlbXMgPSBpbU1hcC5rZXlTZXQoKS50b0FycmF5KG5ldyBDaGFyU2VxdWVuY2VbTl0pOwotICAgICAgICAgICAgbUltcyA9IGltTWFwLnZhbHVlcygpLnRvQXJyYXkobmV3IElucHV0TWV0aG9kSW5mb1tOXSk7Ci0KKyAgICAgICAgICAgIG1JbXMgPSBuZXcgSW5wdXRNZXRob2RJbmZvW05dOworICAgICAgICAgICAgbVN1YnR5cGVJZHMgPSBuZXcgaW50W05dOwogICAgICAgICAgICAgaW50IGNoZWNrZWRJdGVtID0gMDsKICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTjsgKytpKSB7CisgICAgICAgICAgICAgICAgUGFpcjxJbnB1dE1ldGhvZEluZm8sIEludGVnZXI+IHZhbHVlID0gaW1NYXAuZ2V0KG1JdGVtc1tpXSk7CisgICAgICAgICAgICAgICAgbUltc1tpXSA9IHZhbHVlLmZpcnN0OworICAgICAgICAgICAgICAgIG1TdWJ0eXBlSWRzW2ldID0gdmFsdWUuc2Vjb25kOwogICAgICAgICAgICAgICAgIGlmIChtSW1zW2ldLmdldElkKCkuZXF1YWxzKGxhc3RJbnB1dE1ldGhvZElkKSkgewotICAgICAgICAgICAgICAgICAgICBjaGVja2VkSXRlbSA9IGk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBpbnQgc3VidHlwZUlkID0gbVN1YnR5cGVJZHNbaV07CisgICAgICAgICAgICAgICAgICAgIGlmICgoc3VidHlwZUlkID09IE5PVF9BX1NVQlRZUEVfSUQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGxhc3RJbnB1dE1ldGhvZFN1YnR5cGVJZCA9PSBOT1RfQV9TVUJUWVBFX0lEICYmIHN1YnR5cGVJZCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChzdWJ0eXBlSWQgPT0gbGFzdElucHV0TWV0aG9kU3VidHlwZUlkKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2tlZEl0ZW0gPSBpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgIAorCiAgICAgICAgICAgICBBbGVydERpYWxvZy5PbkNsaWNrTGlzdGVuZXIgYWRvY2wgPSBuZXcgQWxlcnREaWFsb2cuT25DbGlja0xpc3RlbmVyKCkgewogICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soRGlhbG9nSW50ZXJmYWNlIGRpYWxvZywgaW50IHdoaWNoKSB7CiAgICAgICAgICAgICAgICAgICAgIGhpZGVJbnB1dE1ldGhvZE1lbnUoKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9OwotICAgIAorCiAgICAgICAgICAgICBUeXBlZEFycmF5IGEgPSBjb250ZXh0Lm9idGFpblN0eWxlZEF0dHJpYnV0ZXMobnVsbCwKICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuRGlhbG9nUHJlZmVyZW5jZSwKICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hdHRyLmFsZXJ0RGlhbG9nU3R5bGUsIDApOwpAQCAtMTU2MiwyMyArMTY4Niw0MyBAQAogICAgICAgICAgICAgICAgICAgICAuc2V0SWNvbihhLmdldERyYXdhYmxlKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkRpYWxvZ1ByZWZlcmVuY2VfZGlhbG9nVGl0bGUpKTsKICAgICAgICAgICAgIGEucmVjeWNsZSgpOwotICAgIAorCiAgICAgICAgICAgICBtRGlhbG9nQnVpbGRlci5zZXRTaW5nbGVDaG9pY2VJdGVtcyhtSXRlbXMsIGNoZWNrZWRJdGVtLAogICAgICAgICAgICAgICAgICAgICBuZXcgQWxlcnREaWFsb2cuT25DbGlja0xpc3RlbmVyKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhEaWFsb2dJbnRlcmZhY2UgZGlhbG9nLCBpbnQgd2hpY2gpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1NZXRob2RNYXApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1JbXMgPT0gbnVsbCB8fCBtSW1zLmxlbmd0aCA8PSB3aGljaCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUltcyA9PSBudWxsIHx8IG1JbXMubGVuZ3RoIDw9IHdoaWNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgbVN1YnR5cGVJZHMgPT0gbnVsbCB8fCBtU3VidHlwZUlkcy5sZW5ndGggPD0gd2hpY2gpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnB1dE1ldGhvZEluZm8gaW0gPSBtSW1zW3doaWNoXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN1YnR5cGVJZCA9IG1TdWJ0eXBlSWRzW3doaWNoXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZUlucHV0TWV0aG9kTWVudSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0SW5wdXRNZXRob2RMb2NrZWQoaW0uZ2V0SWQoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHN1YnR5cGVJZCA8IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChzdWJ0eXBlSWQgPj0gaW0uZ2V0U3VidHlwZXMoKS5zaXplKCkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidHlwZUlkID0gTk9UX0FfU1VCVFlQRV9JRDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldElucHV0TWV0aG9kTG9ja2VkKGltLmdldElkKCksIHN1YnR5cGVJZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0pOwogCisgICAgICAgICAgICBpZiAoc2hvd1N1YnR5cGVzKSB7CisgICAgICAgICAgICAgICAgbURpYWxvZ0J1aWxkZXIuc2V0UG9zaXRpdmVCdXR0b24oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcubW9yZV9pdGVtX2xhYmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhEaWFsb2dJbnRlcmZhY2UgZGlhbG9nLCBpbnQgd2hpY2hCdXR0b24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvd0lucHV0TWV0aG9kQW5kU3VidHlwZUVuYWJsZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1EaWFsb2dCdWlsZGVyLnNldE5lZ2F0aXZlQnV0dG9uKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmNhbmNlbCwKKyAgICAgICAgICAgICAgICAgICAgbmV3IERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKERpYWxvZ0ludGVyZmFjZSBkaWFsb2csIGludCB3aGljaEJ1dHRvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVJbnB1dE1ldGhvZE1lbnUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICBtU3dpdGNoaW5nRGlhbG9nID0gbURpYWxvZ0J1aWxkZXIuY3JlYXRlKCk7CiAgICAgICAgICAgICBtU3dpdGNoaW5nRGlhbG9nLmdldFdpbmRvdygpLnNldFR5cGUoCiAgICAgICAgICAgICAgICAgICAgIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLlRZUEVfSU5QVVRfTUVUSE9EX0RJQUxPRyk7CkBAIC0xNjMwLDgwICsxNzc0LDI2NiBAQAogICAgICAgICAvLyBNYWtlIHN1cmUgdGhpcyBpcyBhIHZhbGlkIGlucHV0IG1ldGhvZC4KICAgICAgICAgSW5wdXRNZXRob2RJbmZvIGltbSA9IG1NZXRob2RNYXAuZ2V0KGlkKTsKICAgICAgICAgaWYgKGltbSA9PSBudWxsKSB7Ci0gICAgICAgICAgICBpZiAoaW1tID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGlkOiAiICsgbUN1ck1ldGhvZElkKTsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVua25vd24gaWQ6ICIgKyBtQ3VyTWV0aG9kSWQpOworICAgICAgICB9CisKKyAgICAgICAgTGlzdDxQYWlyPFN0cmluZywgQXJyYXlMaXN0PFN0cmluZz4+PiBlbmFibGVkSW5wdXRNZXRob2RzTGlzdCA9IG1TZXR0aW5ncworICAgICAgICAgICAgICAgIC5nZXRFbmFibGVkSW5wdXRNZXRob2RzQW5kU3VidHlwZUxpc3RMb2NrZWQoKTsKKworICAgICAgICBpZiAoZW5hYmxlZCkgeworICAgICAgICAgICAgZm9yIChQYWlyPFN0cmluZywgQXJyYXlMaXN0PFN0cmluZz4+IHBhaXI6IGVuYWJsZWRJbnB1dE1ldGhvZHNMaXN0KSB7CisgICAgICAgICAgICAgICAgaWYgKHBhaXIuZmlyc3QuZXF1YWxzKGlkKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBXZSBhcmUgZW5hYmxpbmcgdGhpcyBpbnB1dCBtZXRob2QsIGJ1dCBpdCBpcyBhbHJlYWR5IGVuYWJsZWQuCisgICAgICAgICAgICAgICAgICAgIC8vIE5vdGhpbmcgdG8gZG8uIFRoZSBwcmV2aW91cyBzdGF0ZSB3YXMgZW5hYmxlZC4KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgbVNldHRpbmdzLmFwcGVuZEFuZFB1dEVuYWJsZWRJbnB1dE1ldGhvZExvY2tlZChpZCwgZmFsc2UpOworICAgICAgICAgICAgLy8gUHJldmlvdXMgc3RhdGUgd2FzIGRpc2FibGVkLgorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgIGlmIChtU2V0dGluZ3MuYnVpbGRBbmRQdXRFbmFibGVkSW5wdXRNZXRob2RzU3RyUmVtb3ZpbmdJZExvY2tlZCgKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlciwgZW5hYmxlZElucHV0TWV0aG9kc0xpc3QsIGlkKSkgeworICAgICAgICAgICAgICAgIC8vIERpc2FibGVkIGlucHV0IG1ldGhvZCBpcyBjdXJyZW50bHkgc2VsZWN0ZWQsIHN3aXRjaCB0byBhbm90aGVyIG9uZS4KKyAgICAgICAgICAgICAgICBTdHJpbmcgc2VsSWQgPSBTZXR0aW5ncy5TZWN1cmUuZ2V0U3RyaW5nKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAorICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkRFRkFVTFRfSU5QVVRfTUVUSE9EKTsKKyAgICAgICAgICAgICAgICBpZiAoaWQuZXF1YWxzKHNlbElkKSkgeworICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUucHV0U3RyaW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLCBTZXR0aW5ncy5TZWN1cmUuREVGQVVMVF9JTlBVVF9NRVRIT0QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlZElucHV0TWV0aG9kc0xpc3Quc2l6ZSgpID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlbmFibGVkSW5wdXRNZXRob2RzTGlzdC5nZXQoMCkuZmlyc3QgOiAiIik7CisgICAgICAgICAgICAgICAgICAgIHJlc2V0U2VsZWN0ZWRJbnB1dE1ldGhvZFN1YnR5cGUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gUHJldmlvdXMgc3RhdGUgd2FzIGVuYWJsZWQuCisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIFdlIGFyZSBkaXNhYmxpbmcgdGhlIGlucHV0IG1ldGhvZCBidXQgaXQgaXMgYWxyZWFkeSBkaXNhYmxlZC4KKyAgICAgICAgICAgICAgICAvLyBOb3RoaW5nIHRvIGRvLiAgVGhlIHByZXZpb3VzIHN0YXRlIHdhcyBkaXNhYmxlZC4KKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVzZXRTZWxlY3RlZElucHV0TWV0aG9kU3VidHlwZSgpIHsKKyAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKKyAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuU0VMRUNURURfSU5QVVRfTUVUSE9EX1NVQlRZUEUsIE5PVF9BX1NVQlRZUEVfSUQpOworICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBwdXRTZWxlY3RlZElucHV0TWV0aG9kU3VidHlwZShJbnB1dE1ldGhvZEluZm8gaW1pLCBpbnQgc3VidHlwZUlkKSB7CisgICAgICAgIEFycmF5TGlzdDxJbnB1dE1ldGhvZFN1YnR5cGU+IHN1YnR5cGVzID0gaW1pLmdld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RIT0RfU1VCVFlQRSk7CisgICAgICAgIH0gY2F0Y2ggKFNldHRpbmdOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICByZXR1cm4gTk9UX0FfU1VCVFlQRV9JRDsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHN1YnR5cGVzLnNpemUoKTsgKytpKSB7CisgICAgICAgICAgICBJbnB1dE1ldGhvZFN1YnR5cGUgaW1zID0gc3VidHlwZXMuZ2V0KGkpOworICAgICAgICAgICAgaWYgKHN1YnR5cGVJZCA9PSBpbXMuaGFzaENvZGUoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBOT1RfQV9TVUJUWVBFX0lEOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gUmV0dXJuIHRoZSBjdXJyZW50IHN1YnR5cGUgb2YgdGhpcyBpbnB1dCBtZXRob2QuCisgICAgICovCisgICAgcHVibGljIElucHV0TWV0aG9kU3VidHlwZSBnZXRDdXJyZW50SW5wdXRNZXRob2RTdWJ0eXBlKCkgeworICAgICAgICByZXR1cm4gbUN1cnJlbnRTdWJ0eXBlOworICAgIH0KKworICAgIC8qKgorICAgICAqIFV0aWxpdHkgY2xhc3MgZm9yIHB1dHRpbmcgYW5kIGdldHRpbmcgc2V0dGluZ3MgZm9yIElucHV0TWV0aG9kCisgICAgICogVE9ETzogTW92ZSBhbGwgcHV0dGVycyBhbmQgZ2V0dGVycyBvZiBzZXR0aW5ncyB0byB0aGlzIGNsYXNzLgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIElucHV0TWV0aG9kU2V0dGluZ3MgeworICAgICAgICAvLyBUaGUgc3RyaW5nIGZvciBlbmFibGVkIGlucHV0IG1ldGhvZCBpcyBzYXZlZCBhcyBmb2xsb3dzOgorICAgICAgICAvLyBleGFtcGxlOiAoImltZTA7c3VidHlwZTA7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AgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyLCBQYWlyPFN0cmluZywgQXJyYXlMaXN0PFN0cmluZz4+IHBhaXIpIHsKKyAgICAgICAgICAgIFN0cmluZyBpZCA9IHBhaXIuZmlyc3Q7CisgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBzdWJ0eXBlcyA9IHBhaXIuc2Vjb25kOworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoaWQpOworICAgICAgICAgICAgLy8gSW5wdXRtZXRob2QgYW5kIHN1YnR5cGVzIGFyZSBzYXZlZCBpbiB0aGUgc2V0dGluZ3MgYXMgZm9sbG93czoKKyAgICAgICAgICAgIC8vIGltZTA7c3VidHlwZTA7c3VidHlwZTE6aW1lMTtzdWJ0eXBlMDppbWUyOmltZTM7c3VidHlwZTA7c3VidHlwZTEKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIHN1YnR5cGVJZDogc3VidHlwZXMpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChJTlBVVF9NRVRIT0RfU1VCVFlQRV9TRVBBUkFURVIpLmFwcGVuZChzdWJ0eXBlSWQpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoMjU2KTsKKyAgICAgICAgcHVibGljIElucHV0TWV0aG9kU2V0dGluZ3MoCisgICAgICAgICAgICAgICAgQ29udGVudFJlc29sdmVyIHJlc29sdmVyLCBIYXNoTWFwPFN0cmluZywgSW5wdXRNZXRob2RJbmZvPiBtZXRob2RNYXAsCisgICAgICAgICAgICAgICAgQXJyYXlMaXN0PElucHV0TWV0aG9kSW5mbz4gbWV0aG9kTGlzdCkgeworICAgICAgICAgICAgbVJlc29sdmVyID0gcmVzb2x2ZXI7CisgICAgICAgICAgICBtTWV0aG9kTWFwID0gbWV0aG9kTWFwOworICAgICAgICAgICAgbU1ldGhvZExpc3QgPSBtZ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AgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGFyZSBlbmFibGluZyB0aGlzIGlucHV0IG1ldGhvZCwgYnV0IGl0IGlzCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBhbHJlYWR5IGVuYWJsZWQuICBOb3RoaW5nIHRvIGRvLiAgVGhlIHByZXZpb3VzCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBzdGF0ZSB3YXMgZW5hYmxlZC4KLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICBwdWJsaWMgTGlzdDxQYWlyPElucHV0TWV0aG9kSW5mbywgQXJyYXlMaXN0PFN0cmluZz4+PgorICAgICAgICAgICAgICAgIGdldEVuYWJsZWRJbnB1dE1ldGhvZEFuZFN1YnR5cGVMaXN0TG9ja2VkKCkgeworICAgICAgICAgICAgcmV0dXJuIGNyZWF0ZUVuYWJsZWRJbnB1dE1ldGhvZEFuZFN1YnR5cGVMaXN0TG9ja2VkKAorICAgICAgICAgICAgICAgICAgICBnZXRFbmFibGVkSW5wdXRNZXRob2RzQW5kU3VidHlwZUxpc3RMb2NrZWQoKSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBBdCB0aGUgaW5pdGlhbCBib290LCB0aGUgc2V0dGluZ3MgZm9yIGlucHV0IG1ldGhvZHMgYXJlIG5vdCBzZXQsCisgICAgICAgIC8vIHNvIHdlIG5lZWQgdG8gZW5hYmxlIElNRSBpbiB0aGF0IGNhc2UuCisgICAgICAgIHB1YmxpYyB2b2lkIGVuYWJsZUFsbElNRXNJZlRoZXJlSXNOb0VuYWJsZWRJTUUoKSB7CisgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoZ2V0RW5hYmxlZElucHV0TWV0aG9kc1N0cigpKSkgeworICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbU1ldGhvZExpc3Quc2l6ZSgpOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIElucHV0TWV0aG9kSW5mbyBpbWkgPSBtTWV0aG9kTGlzdC5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgIFNsb2cuaShUQUcsICJBZGRpbmc6ICIgKyBpbWkuZ2V0SWQoKSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChpID4gMCkgc2IuYXBwZW5kKCc6Jyk7CisgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChpbWkuZ2V0SWQoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHB1dEVuYWJsZWRJbnB1dE1ldGhvZHNTdHIoc2IudG9TdHJpbmcoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgTGlzdDxQYWlyPFN0cmluZywgQXJyYXlMaXN0PFN0cmluZz4+PiBnZXRFbmFibGVkSW5wdXRNZXRob2RzQW5kU3VidHlwZUxpc3RMb2NrZWQoKSB7CisgICAgICAgICAgICBBcnJheUxpc3Q8UGFpcjxTdHJpbmcsIEFycmF5TGlzdDxTdHJpbmc+Pj4gaW1zTGlzdAorICAgICAgICAgICAgICAgICAgICA9IG5ldyBBcnJheUxpc3Q8UGFpcjxTdHJpbmcsIEFycmF5TGlzdDxTdHJpbmc+Pj4oKTsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmFibGVkSW5wdXRNZXRob2RzU3RyID0gZ2V0RW5hYmxlZElucHV0TWV0aG9kc1N0cigpOworICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGVuYWJsZWRJbnB1dE1ldGhvZHNTdHIpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGltc0xpc3Q7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtU3RyaW5nQ29sb25TcGxpdHRlci5zZXRTdHJpbmcoZW5hYmxlZElucHV0TWV0aG9kc1N0cik7CisgICAgICAgICAgICB3aGlsZSAobVN0cmluZ0NvbG9uU3BsaXR0ZXIuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIG5leHRJbXNTdHIgPSBtU3RyaW5nQ29sb25TcGxpdHRlci5uZXh0KCk7CisgICAgICAgICAgICAgICAgbVN0cmluZ1NlbWlDb2xvblNwbGl0dGVyLnNldFN0cmluZyhuZXh0SW1zU3RyKTsKKyAgICAgICAgICAgICAgICBpZiAobVN0cmluZ1NlbWlDb2xvblNwbGl0dGVyLmhhc05leHQoKSkgeworICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBzdWJ0eXBlSGFzaGVzID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBmaXJzdCBlbGVtZW50IGlzIGltZSBpZC4KKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGltZUlkID0gbVN0cmluZ1NlbWlDb2xvblNwbGl0dGVyLm5leHQoKTsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG1TdHJpbmdTZW1pQ29sb25TcGxpdHRlci5oYXNOZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1YnR5cGVIYXNoZXMuYWRkKG1TdHJpbmdTZW1pQ29sb25TcGxpdHRlci5uZXh0KCkpOwogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGltc0xpc3QuYWRkKG5ldyBQYWlyPFN0cmluZywgQXJyYXlMaXN0PFN0cmluZz4+KGltZUlkLCBzdWJ0eXBlSGFzaGVzKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGltc0xpc3Q7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBhcHBlbmRBbmRQdXRFbmFibGVkSW5wdXRNZXRob2RMb2NrZWQoU3RyaW5nIGlkLCBib29sZWFuIHJlbG9hZElucHV0TWV0aG9kU3RyKSB7CisgICAgICAgICAgICBpZiAocmVsb2FkSW5wdXRNZXRob2RTdHIpIHsKKyAgICAgICAgICAgICAgICBnZXRFbmFibGVkSW5wdXRNZXRob2RzU3RyKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkobUVuYWJsZWRJbnB1dE1ldGhvZHNTdHJDYWNoZSkpIHsKKyAgICAgICAgICAgICAgICAvLyBBZGQgaW4gdGhlIG5ld2x5IGVuYWJsZWQgaW5wdXQgbWV0aG9kLgorICAgICAgICAgICAgICAgIHB1dEVuYWJsZWRJbnB1dE1ldGhvZHNTdHIoaWQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBwdXRFbmFibGVkSW5wdXRNZXRob2RzU3RyKAorICAgICAgICAgICAgICAgICAgICAgICAgbUVuYWJsZWRJbnB1dE1ldGhvZHNTdHJDYWNoZSArIElOUFVUX01FVEhPRF9TRVBBUkFURVIgKyBpZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQnVpbGQgYW5kIHB1dCBhIHN0cmluZyBvZiBFbmFibGVkSW5wdXRNZXRob2RzIHdpdGggcmVtb3Zpbmcgc3BlY2lmaWVkIElkLgorICAgICAgICAgKiBAcmV0dXJuIHRoZSBzcGVjaWZpZWQgaWQgd2FzIHJlbW92ZWQgb3Igbm90LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGJvb2xlYW4gYnVpbGRBbmRQdXRFbmFibGVkSW5wdXRNZXRob2RzU3RyUmVtb3ZpbmdJZExvY2tlZCgKKyAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIsIExpc3Q8UGFpcjxTdHJpbmcsIEFycmF5TGlzdDxTdHJpbmc+Pj4gaW1zTGlzdCwgU3RyaW5nIGlkKSB7CisgICAgICAgICAgICBib29sZWFuIGlzUmVtb3ZlZCA9IGZhbHNlOworICAgICAgICAgICAgYm9vbGVhbiBuZWVkc0FwcGVuZFNlcGFyYXRvciA9IGZhbHNlOworICAgICAgICAgICAgZm9yIChQYWlyPFN0cmluZywgQXJyYXlMaXN0PFN0cmluZz4+IGltczogaW1zTGlzdCkgeworICAgICAgICAgICAgICAgIFN0cmluZyBjdXJJZCA9IGltcy5maXJzdDsKKyAgICAgICAgICAgICAgICBpZiAoY3VySWQuZXF1YWxzKGlkKSkgewogICAgICAgICAgICAgICAgICAgICAvLyBXZSBhcmUgZGlzYWJsaW5nIHRoaXMgaW5wdXQgbWV0aG9kLCBhbmQgaXQgaXMKICAgICAgICAgICAgICAgICAgICAgLy8gY3VycmVudGx5IGVuYWJsZWQuICBTa2lwIGl0IHRvIHJlbW92ZSBmcm9tIHRoZQogICAgICAgICAgICAgICAgICAgICAvLyBuZXcgbGlzdC4KLSAgICAgICAgICAgICAgICAgICAgcmVtb3ZlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmICghZW5hYmxlZCkgewotICAgICAgICAgICAgICAgICAgICAvLyBXZSBhcmUgYnVpbGRpbmcgYSBuZXcgbGlzdCBvZiBpbnB1dCBtZXRob2RzIHRoYXQKLSAgICAgICAgICAgICAgICAgICAgLy8gZG9lc24ndCBjb250YWluIHRoZSBnaXZlbiBvbmUuCi0gICAgICAgICAgICAgICAgICAgIGlmIChmaXJzdElkID09IG51bGwpIGZpcnN0SWQgPSBjdXJJZDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGJ1aWxkZXIubGVuZ3RoKCkgPiAwKSBidWlsZGVyLmFwcGVuZCgnOicpOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjdXJJZCk7CisgICAgICAgICAgICAgICAgICAgIGlzUmVtb3ZlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5lZWRzQXBwZW5kU2VwYXJhdG9yKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChJTlBVVF9NRVRIT0RfU0VQQVJBVEVSKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRzQXBwZW5kU2VwYXJhdG9yID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBidWlsZEVuYWJsZWRJbnB1dE1ldGhvZHNTZXR0aW5nU3RyaW5nKGJ1aWxkZXIsIGltcyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFlbmFibGVkKSB7Ci0gICAgICAgICAgICBpZiAoIXJlbW92ZWQpIHsKLSAgICAgICAgICAgICAgICAvLyBXZSBhcmUgZGlzYWJsaW5nIHRoZSBpbnB1dCBtZXRob2QgYnV0IGl0IGlzIGFscmVhZHkKLSAgICAgICAgICAgICAgICAvLyBkaXNhYmxlZC4gIE5vdGhpbmcgdG8gZG8uICBUaGUgcHJldmlvdXMgc3RhdGUgd2FzCi0gICAgICAgICAgICAgICAgLy8gZGlzYWJsZWQuCi0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgaWYgKGlzUmVtb3ZlZCkgeworICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSB0aGUgc2V0dGluZyB3aXRoIHRoZSBuZXcgbGlzdCBvZiBpbnB1dCBtZXRob2RzLgorICAgICAgICAgICAgICAgIHB1dEVuYWJsZWRJbnB1dE1ldGhvZHNTdHIoYnVpbGRlci50b1N0cmluZygpKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIFVwZGF0ZSB0aGUgc2V0dGluZyB3aXRoIHRoZSBuZXcgbGlzdCBvZiBpbnB1dCBtZXRob2RzLgotICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLn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G5ldyBBcnJheUxpc3Q8SW5wdXRNZXRob2RJbmZvPigpOworICAgICAgICAgICAgZm9yIChQYWlyPFN0cmluZywgQXJyYXlMaXN0PFN0cmluZz4+IGltczogaW1zTGlzdCkgeworICAgICAgICAgICAgICAgIElucHV0TWV0aG9kSW5mbyBpbmZvID0gbU1ldGhvZE1hcC5nZXQoaW1zLmZpcnN0KTsKKyAgICAgICAgICAgICAgICBpZiAoaW5mbyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlcy5hZGQoaW5mbyk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gUHJldmlvdXMgc3RhdGUgd2FzIGVuYWJsZWQuCi0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIHJldHVybiByZXM7CiAgICAgICAgIH0KIAotICAgICAgICAvLyBBZGQgaW4gdGhlIG5ld2x5IGVuYWJsZWQgaW5wdXQgbWV0aG9kLgotICAgICAgICBpZiAoZW5hYmxlZFN0ciA9PSBudWxsIHx8IGVuYWJsZWRTdHIubGVuZ3RoKCkgPT0gMCkgewotICAgICAgICAgICAgZW5hYmxlZFN0ciA9IGlkOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZW5hYmxlZFN0ciA9IGVuYWJsZWRTdHIgKyAnOicgKyBpZDsKKyAgICAgICAgcHJpdmF0ZSBMaXN0PFBhaXI8SW5wdXRNZXRob2RJbmZvLCBBcnJheUxpc3Q8U3RyaW5nPj4+CisgICAgICAgICAgICAgICAgY3JlYXRlRW5hYmxlZElucHV0TWV0aG9kQW5kU3VidHlwZUxpc3RMb2NrZWQoCisgICAgICAgICAgICAgICAgICAgICAgICBMaXN0PFBhaXI8U3RyaW5nLCBBcnJheUxpc3Q8U3RyaW5nPj4+IGltc0xpc3QpIHsKKyAgICAgICAgICAgIGZpbmFsIEFycmF5TGlzdDxQYWlyPElucHV0TWV0aG9kSW5mbywgQXJyYXlMaXN0PFN0cmluZz4+PiByZXMKKyAgICAgICAgICAgICAgICAgICAgPSBuZXcgQXJyYXlMaXN0PFBhaXI8SW5wdXRNZXRob2RJbmZvLCBBcnJheUxpc3Q8U3RyaW5nPj4+KCk7CisgICAgICAgICAgICBmb3IgKFBhaXI8U3RyaW5nLCBBcnJheUxpc3Q8U3RyaW5nPj4gaW1zIDogaW1zTGlzdCkgeworICAgICAgICAgICAgICAgIElucHV0TWV0aG9kSW5mbyBpbmZvID0gbU1ldGhvZE1hcC5nZXQoaW1zLmZpcnN0KTsKKyAgICAgICAgICAgICAgICBpZiAoaW5mbyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlcy5hZGQobmV3IFBhaXI8SW5wdXRNZXRob2RJbmZvLCBBcnJheUxpc3Q8U3RyaW5nPj4oaW5mbywgaW1zLnNlY29uZCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiByZXM7CiAgICAgICAgIH0KIAotICAgICAgICBTZXR0aW5ncy5TZWN1cmUucHV0U3RyaW5nKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5FTkFCTEVEX0lOUFVUX01FVEhPRFMsIGVuYWJsZWRTdHIpOworICAgICAgICBwcml2YXRlIHZvaWQgcHV0RW5hYmxlZElucHV0TWV0aG9kc1N0cihTdHJpbmcgc3RyKSB7CisgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUucHV0U3RyaW5nKG1SZXNvbHZlciwgU2V0dGluZ3MuU2VjdXJlLkVOQUJMRURfSU5QVVRfTUVUSE9EUywgc3RyKTsKKyAgICAgICAgICAgIG1FbmFibGVkSW5wdXRNZXRob2RzU3RyQ2FjaGUgPSBzdHI7CisgICAgICAgIH0KIAotICAgICAgICAvLyBQcmV2aW91cyBzdGF0ZSB3YXMgZGlzYWJsZWQuCi0gICAgICAgIHJldHVybiBmYWxzZTsKKyA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YgKG1OZXR3b3JrTG9jYXRpb25Qcm92aWRlclBhY2thZ2VOYW1lICE9IG51bGwpIHsKKyAgICAgICAgUGFja2FnZU1hbmFnZXIgcG0gPSBtQ29udGV4dC5nZXRQYWNrYWdlTWFuYWdlcigpOworICAgICAgICBpZiAobU5ldHdvcmtMb2NhdGlvblByb3ZpZGVyUGFja2FnZU5hbWUgIT0gbnVsbCAmJgorICAgICAgICAgICAgICAgIHBtLnJlc29sdmVTZXJ2aWNlKG5ldyBJbnRlbnQobU5ldHdvcmtMb2NhdGlvblByb3ZpZGVyUGFja2FnZU5hbWUpLCAwKSAhPSBudWxsKSB7CiAgICAgICAgICAgICBtTmV0d29ya0xvY2F0aW9uUHJvdmlkZXIgPQogICAgICAgICAgICAgICAgIG5ldyBMb2NhdGlvblByb3ZpZGVyUHJveHkobUNvbnRleHQsIExvY2F0aW9uTWFuYWdlci5ORVRXT1JLX1BST1ZJREVSLAogICAgICAgICAgICAgICAgICAgICAgICAgbU5ldHdvcmtMb2NhdGlvblByb3ZpZGVyUGFja2FnZU5hbWUsIG1Mb2NhdGlvbkhhbmRsZXIpOwogICAgICAgICAgICAgYWRkUHJvdmlkZXIobU5ldHdvcmtMb2NhdGlvblByb3ZpZGVyKTsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChtR2VvY29kZVByb3ZpZGVyUGFja2FnZU5hbWUgIT0gbnVsbCkgeworICAgICAgICBpZiAobUdlb2NvZGVQcm92aWRlclBhY2thZ2VOYW1lICE9IG51bGwgJiYKKyAgICAgICAgICAgICAgICBwbS5yZXNvbHZlU2VydmljZShuZXcgSW50ZW50KG1HZW9jb2RlUHJvdmlkZXJQYWNrYWdlTmFtZSksIDApICE9IG51bGwpIHsKICAgICAgICAgICAgIG1HZW9jb2RlUHJvdmlkZXIgPSBuZXcgR2VvY29kZXJQcm94eShtQ29udGV4dCwgbUdlb2NvZGVQcm92aWRlclBhY2thZ2VOYW1lKTsKICAgICAgICAgfQogCmRpZmYgLS1naXQgYS9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9Nb3VudFNlcnZpY2UuamF2YSBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL01vdW50U2VydmljZS5qYXZhCmluZGV4IDg1YmIzYWEuLjYyZGVjN2UgMTAwNjQ0Ci0tLSBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL01vdW50U2VydmljZS5qYXZhCisrKyBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL01vdW50U2VydmljZS5qYXZhCkBAIC0xNTEsNiArMTUxLDggQEAKICAgICBwcml2YXRlIGJvb2xlYW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJvb3RlZCA9IGZhbHNlOwogICAgIHByaXZhdGUgYm9vbGVhbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVhZHkgPSBmYWxzZTsKICAgICBwcml2YXRlIGJvb2xlYW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlbmRVbXNDb25uZWN0ZWRPbkJvb3QgPSBmYWxzZTsKKyAgICAvLyB0cnVlIGlmIHdlIHNob3VsZCBmYWtlIE1FRElBX01PVU5URUQgc3RhdGUgZm9yIGV4dGVybmFsIHN0b3JhZ2UKKyAgICBwcml2YXRlIGJvb2xlYW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVtdWxhdGVFeHRlcm5hbFN0b3JhZ2UgPSBmYWxzZTsKIAogICAgIC8qKgogICAgICAqIFByaXZhdGUgaGFzaCBvZiBjdXJyZW50bHkgbW91bnRlZCBzZWN1cmUgY29udGFpbmVycy4KQEAgLTQ0NSw3ICs0NDcsOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwYXRoID0gRW52aXJvbm1lbnQuZ2V0RXh0ZXJuYWxTdG9yYWdlRGlyZWN0b3J5KCkuZ2V0UGF0aCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBzdGF0ZSA9IGdldFZvbHVtZVN0YXRlKHBhdGgpOwogCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRlLmVxdWFscyhFbnZpcm9ubWVudC5NRURJQV9VTk1PVU5URUQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1FbXVsYXRlRXh0ZXJuYWxTdG9yYWdlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmeVZvbHVtZVN0YXRlQ2hhbmdlKG51bGwsIHBhdGgsIFZvbHVtZVN0YXRlLk5vTWVkaWEsIFZvbHVtZVN0YXRlLk1vdW50ZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RhdGUuZXF1YWxzKEVudmlyb25tZW50Lk1FRElBX1VOTU9VTlRFRCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHJjID0gZG9Nb3VudFZvbHVtZShwYXRoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJjICE9IFN0b3JhZ2VSZXN1bHRDb2RlLk9wZXJhdGlvblN1Y2NlZWRlZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgU3RyaW5nLmZvcm1hdCgiQm9vdC10aW1lIG1vdW50IGZhaWxlZCAoJWQpIiwgcmMpKTsKQEAgLTUxNiwyMSArNTIwLDIxIEBACiAgICAgICAgICAgICBTbG9nLncoVEFHLCBTdHJpbmcuZm9ybWF0KCJEdXBsaWNhdGUgc3RhdGUgdHJhbnNpdGlvbiAoJXMgLT4gJXMpIiwgbUxlZ2FjeVN0YXRlLCBzdGF0ZSkpOwogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CisgICAgICAgIC8vIFVwZGF0ZSBzdGF0ZSBvbiBQYWNrYWdlTWFuYWdlciwgYnV0IG9ubHkgb2YgcmVhbCB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rvci5qYXZhCmluZGV4IDdiNjhkNjguLmNmODdhOWQgMTAwNjQ0Ci0tLSBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL05hdGl2ZURhZW1vbkNvbm5lY3Rvci5qYXZhCisrKyBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL05hdGl2ZURhZW1vbkNvbm5lY3Rvci5qYXZhCkBAIC0xMzIsMTEgKzEzMiwxMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgU3RyaW5nLmZvcm1hdCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkVycm9yIGhhbmRsaW5nICclcyciLCBldmVudCksIGV4KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVzcG9uc2VRdWV1ZS5wdXQoZXZlbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJGYWlsZWQgdG8gcHV0IHJlc3BvbnNlIG9udG8gcXVldWUiLCBleCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1SZXNwb25zZVF1ZXVlLnB1dChldmVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBT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hCkBAIC0yMjYsMTAgKzIyNiwxMCBAQAogICAgICAgICAgICAgICAgIHRocm93IG5ldyBVbmtub3duSG9zdEV4Y2VwdGlvbihhZGRyU3RyaW5nKTsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaW50IGEgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnRzWzBdKSAgICAgIDsKLSAgICAgICAgICAgIGludCBiID0gSW50ZWdlci5wYXJzZUludChwYXJ0c1sxXSkgPDwgIDg7Ci0gICAgICAgICAgICBpbnQgYyA9IEludGVnZXIucGFyc2VJbnQocGFydHNbMl0pIDw8IDE2OwotICAgICAgICAgICAgaW50IGQgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnRzWzNdKSA8PCAyNDsKKyAgICAgICAgICAgIGludCBhID0gSW50ZWdlci5wYXJzZUludChwYXJ0c1swXSkgPDwgMjQ7CisgICAgICAgICAgICBpbnQgYiA9IEludGVnZXIucGFyc2VJbnQocGFydHNbMV0pIDw8IDE2OworICAgICAgICAgICAgaW50IGMgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnRzWzJdKSA8PCAgODsKKyAgICAgICAgICAgIGludCBkID0gSW50ZWdlci5wYXJzZUludChwYXJ0c1szXSkgICAgICA7CiAKICAgICAgICAgICAgIHJldHVybiBhIHwgYiB8IGMgfCBkOwogICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZXgpIHsKZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL05ldHdvcmtUaW1lVXBkYXRlU2VydmljZS5qYXZhIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvTmV0d29ya1RpbWVVcGRhdGVTZXJ2aWNlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNTJmODRlYgotLS0gL2Rldi9udWxsCisrKyBiL3NlcnZpY2VzL2phdmEvY29tL2FuZH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ybU1hbmFnZXIgPSAoQWxhcm1NYW5hZ2VyKSBtQ29udGV4dC5nZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuQUxBUk1fU0VSVklDRSk7CisgICAgICAgIEludGVudCBwb2xsSW50ZW50ID0gbmV3IEludGVudChBQ1RJT05fUE9MTCwgbnVsbCk7CisgICAgICAgIG1QZW5kaW5nUG9sbEludGVudCA9IFBlbmRpbmdJbnRlbnQuZ2V0QnJvYWRjYXN0KG1Db250ZXh0LCBQT0xMX1JFUVVFU1QsIHBvbGxJbnRlbnQsIDApOworICAgIH0KKworICAgIC8qKiBJbml0aWFsaXplIHRoZSByZWNlaXZlcnMgYW5kIGluaXRpYXRlIHRoZSBmaXJzdCBOVFAgcmVxdWVzdCAqLworICAgIHB1YmxpYyB2b2lkIHN5c3RlbVJlYWR5KCkgeworICAgICAgICBtTnRwU2VydmVyID0gZ2V0TnRwU2VydmVyQWRkcmVzcygpOworICAgICAgICBpZiAobU50cFNlcnZlciA9PSBudWxsKSB7CisgICAgICAgICAgICBTbG9nLmUoVEFHLCAiTlRQIHNlcnZlciBhZGRyZXNzIG5vdCBmb3VuZCwgbm90IHN5bmNpbmcgdG8gTlRQIHRpbWUiKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIHJlZ2lzdGVyRm9yVGVsZXBob255SW50ZW50cygpOworICAgICAgICByZWdpc3RlckZvckFsYXJtcygpOworCisgICAgICAgIG1UaHJlYWQgPSBuZXcgSGFuZGxlclRocmVhZChUQUcpOworICAgICAgICBtVGhyZWFkLnN0YXJ0KCk7CisgICAgICAgIG1IYW5kbGVyID0gbmV3IE15SGFuZGxlcihtVGhyZWFkLmdldExvb3BlcigpKTsKKyAgICAgICAgLy8gQ2hlY2sgdGhlIG5ldHdvcmsgdGltZSBvbiB0aGUgbmV3IHRocmVhZAorICAgICAgICBtSGFuZGxlci5vYnRhaW5NZXNzYWdlKEVWRU5UX1BPTExfTkVUV09SS19USU1FKS5zZW5kVG9UYXJnZXQoKTsKKworICAgICAgICBtU2V0dGluZ3NPYnNlcnZlciA9IG5ldyBTZXR0aW5nc09ic2VydmVyKG1IYW5kbGVyLCBFVkVOVF9BVVRPX1RJTUVfQ0hBTkdFRCk7CisgICAgICAgIG1TZXR0aW5nc09ic2VydmVyLm9ic2VydmUobUNvbnRleHQpOworICAgIH0KKworICAgIHByaXZhdGUgU3RyaW5nIGdldE50cFNlcnZlckFkZHJlc3MoKSB7CisgICAgICAgIFN0cmluZyBzZXJ2ZXJBZGRyZXNzID0gbnVsbDsKKyAgICAgICAgRmlsZUlucHV0U3RyZWFtIHN0cmVhbSA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBQcm9wZXJ0aWVzIHByb3BlcnRpZXMgPSBuZXcgUHJvcGVydGllcygpOworICAgICAgICAgICAgRmlsZSBmaWxlID0gbmV3IEZpbGUoUFJPUEVSVElFU19GSUxFKTsKKyAgICAgICAgICAgIHN0cmVhbSA9IG5ldyBGaWxlSW5wdXRTdHJlYW0oZmlsZSk7CisgICAgICAgICAgICBwcm9wZXJ0aWVzLmxvYWQoc3RyZWFtKTsKKyAgICAgICAgICAgIHNlcnZlckFkZHJlc3MgPSBwcm9wZXJ0aWVzLmdldFByb3BlcnR5KCJOVFBfU0VSVkVSIiwgbnVsbCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIFNsb2cuZShUQUcsICJDb3VsZCBub3Qgb3BlbiBHUFMgY29uZmlndXJhdGlvbiBmaWxlICIgKyBQUk9QRVJUSUVTX0ZJTEUpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKHN0cmVhbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgc3RyZWFtLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHt9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHNlcnZlckFkZHJlc3M7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlZ2lzdGVyRm9yVGVsZXBob255SW50ZW50cygpIHsKKyAgICAgICAgSW50ZW50RmlsdGVyIGludGVudEZpbHRlciA9IG5ldyBJbnRlbnRGaWx0ZXIoKTsKKyAgICAgICAgaW50ZW50RmlsdGVyLmFkZEFjdGlvbihUZWxlcGhvbnlJbnRlbnRzLkFDVElPTl9ORVRXT1JLX1NFVF9USU1FKTsKKyAgICAgICAgaW50ZW50RmlsdGVyLmFkZEFjdGlvbihUZWxlcGhvbnlJbnRlbnRzLkFDVElPTl9ORVRXT1JLX1NFVF9USU1FWk9ORSk7CisgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIobU5pdHpSZWNlaXZlciwgaW50ZW50RmlsdGVyKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVnaXN0ZXJGb3JBbGFybXMoKSB7CisgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIoCisgICAgICAgICAgICBuZXcgQnJvYWRjYXN0UmVjZWl2ZXIoKSB7CisgICAgICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5vYnRhaW5NZXNzYWdlKEVWRU5UX1BPTExfTkVUV09SS19USU1FKS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LCBuZXcgSW50ZW50RmlsdGVyKEFDVElPTl9QT0xMKSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIG9uUG9sbE5ldHdvcmtUaW1lKGludCBldmVudCkgeworICAgICAgICAvLyBJZiBBdXRvbWF0aWMgdGltZSBpcyBub3Qgc2V0LCBkb24ndCBib3RoZXIuCisgICAgICAgIGlmICghaXNBdXRvbWF0aWNUaW1lUmVxdWVzdGVkKCkpIHJldHVybjsKKworICAgICAgICBmaW5hbCBsb25nIHJlZlRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKKyAgICAgICAgLy8gSWYgTklUWiB0aW1lIHdhcyByZWNlaXZlZCBsZXNzIHRoYW4gUE9MTElOR19JTlRFUlZBTF9NUyB0aW1lIGFnbywKKyAgICAgICAgLy8gbm8gbmVlZCB0byBzeW5jIHRvIE5UUC4KKyAgICAgICAgaWYgKG1OaXR6VGltZVNldFRpbWUgIT0gTk9UX1NFVCAmJiByZWZUaW1lIC0gbU5pdHpUaW1lU2V0VGltZSA8IFBPTExJTkdfSU5URVJWQUxfTVMpIHsKKyAgICAgICAgICAgIHJlc2V0QWxhcm0oUE9MTElOR19JTlRFUlZBTF9NUyk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgZmluYWwgbG9uZyBjdXJyZW50VGltZSA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOworICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICJTeXN0ZW0gdGltZSA9ICIgKyBjdXJyZW50VGltZSk7CisgICAgICAgIC8vIEdldCB0aGUgTlRQIHRpbWUKKyAgICAgICAgaWYgKG1MYXN0TnRwRmV0Y2hUaW1lID09IE5PVF9TRVQgfHwgcmVmVGltZSA+PSBtTGFzdE50cEZldGNoVGltZSArIFBPTExJTkdfSU5URVJWQUxfTVMKKyAgICAgICAgICAgICAgICB8fCBldmVudCA9PSBFVkVOVF9BVVRPX1RJTUVfQ0hBTkdFRCkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAiQmVmb3JlIE50cCBmZXRjaCIpOworICAgICAgICAgICAgbG9uZyBudHAgPSBnZXROdHBUaW1lKCk7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICJOdHAgPSAiICsgbnRwKTsKKyAgICAgICAgICAgIGlmIChudHAgPiAwKSB7CisgICAgICAgICAgICAgICAgbVRyeUFnYWluQ291bnRlciA9IDA7CisgICAgICAgICAgICAgICAgbUxhc3ROdHBGZXRjaFRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKKyAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMobnRwIC0gY3VycmVudFRpbWUpID4gVElNRV9FUlJPUl9USFJFU0hPTERfTVMpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBzeXN0ZW0gdGltZQorICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICJOdHAgdGltZSB0byBiZSBzZXQgPSAiICsgbnRwKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHdlIGRvbid0IG92ZXJmbG93LCBzaW5jZSBpdCdzIGdvaW5nIHRvIGJlIGNvbnZlcnRlZCB0byBhbiBpbnQKKyAgICAgICAgICAgICAgICAgICAgaWYgKG50cCAvIDEwMDAgPCBJbnRlZ2VyLk1BWF9WQUxVRSkgeworICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtQ2xvY2suc2V0Q3VycmVudFRpbWVNaWxsaXMobnRwKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIk50cCB0aW1lIGlzIGNsb3NlIGVub3VnaCA9ICIgKyBudHApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gVHJ5IGFnYWluIHNob3J0bHkKKyAgICAgICAgICAgICAgICBtVHJ5QWdhaW5Db3VudGVyKys7CisgICAgICAgICAgICAgICAgaWYgKG1UcnlBZ2FpbkNvdW50ZXIgPD0gVFJZX0FHQUlOX1RJTUVTX01BWCkgeworICAgICAgICAgICAgICAgICAgICByZXNldEFsYXJtKFBPTExJTkdfSU5URVJWQUxfU0hPUlRFUl9NUyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVHJ5IG11Y2ggbGF0ZXIKKyAgICAgICAgICAgICAgICAgICAgbVRyeUFnYWluQ291bnRlciA9IDA7CisgICAgICAgICAgICAgICAgICAgIHJlc2V0QWxhcm0oUE9MTElOR19JTlRFUlZBTF9NUyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXNldEFsYXJtKFBPTExJTkdfSU5URVJWQUxfTVMpOworICAgIH0KKworICAgIC8qKgorICAgICAqIENhbmNlbCBvbGQgYWxhcm0gYW5kIHN0YXJ0cyBhIG5ldyBvbmUgZm9yIHRoZSBzcGVjaWZpZWQgaW50ZXJ2YWwuCisgICAgICoKKyAgICAgKiBAcGFyYW0gaW50ZXJ2YWwgd2hlbiB0byB0cmlnZ2VyIHRoZSBhbGFybSwgc3RhcnRpbmcgZnJvbSBub3cuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHJlc2V0QWxhcm0obG9uZyBpbnRlcnZhbCkgeworICAgICAgICBtQWxhcm1NYW5hZ2VyLmNhbmNlbChtUGVuZGluZ1BvbGxJbnRlbnQpOworICAgICAgICBsb25nIG5vdyA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpOworICAgICAgICBsb25nIG5leHQgPSBub3cgKyBpbnRlcnZhbDsKKyAgICAgICAgbUFsYXJtTWFuYWdlci5zZXQoQWxhcm1NYW5hZ2VyLkVMQVBTRURfUkVBTFRJTUUsIG5leHQsIG1QZW5kaW5nUG9sbEludGVudCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBsb25nIGdldE50cFRpbWUoKSB7CisgICAgICAgIFNudHBDbGllbnQgY2xpZW50ID0gbmV3IFNudHBDbGllbnQoKTsKKyAgICAgICAgaWYgKGNsaWVudC5yZXF1ZXN0VGltZShtTnRwU2VydmVyLCBNQVhfTlRQX0ZFVENIX1dBSVRfTVMpKSB7CisgICAgICAgICAgICByZXR1cm4gY2xpZW50LmdldE50cFRpbWUoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2hlY2tzIGlmIHRoZSB1c2VyIHByZWZlcnMgdG8gYXV0b21hdGljYWxseSBzZXQgdGhlIHRpbWUuCisgICAgICovCisgICAgcHJpdmF0ZSBib29sZWFuIGlzQXV0b21hdGljVGltZVJlcXVlc3RlZCgpIHsKKyAgICAgICAgcmV0dXJuIFNldHRpbmdzLlN5c3RlbS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksIFNldHRpbmdzLlN5c3RlbS5BVVRPX1RJTUUsIDApCisgICAgICAgICAgICAgICAgIT0gMDsKKyAgICB9CisKKyAgICAvKiogUmVjZWl2ZXIgZm9yIE5pdHogdGltZSBldmVudHMgKi8KKyAgICBwcml2YXRlIEJyb2FkY2FzdFJlY2VpdmVyIG1OaXR6UmVjZWl2ZXIgPSBuZXcgQnJvYWRjYXN0UmVjZWl2ZXIoKSB7CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZShDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgICAgIFN0cmluZyBhY3Rpb24gPSBpbnRlbnQuZ2V0QWN0aW9uKCk7CisgICAgICAgICAgICBpZiAoVGVsZXBob255SW50ZW50cy5BQ1RJT05fTkVUV09SS19TRVRfVElNRS5lcXVhbHMoYWN0aW9uKSkgeworICAgICAgICAgICAgICAgIG1OaXR6VGltZVNldFRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoVGVsZXBob255SW50ZW50cy5BQ1RJT05fTkVUV09SS19TRVRfVElNRVpPTkUuZXF1YWxzKGFjdGlvbikpIHsKKyAgICAgICAgICAgICAgICBtTml0elpvbmVTZXRUaW1lID0gU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgLyoqIEhhbmRsZXIgdG8gZG8gdGhlIG5ldHdvcmsgYWNjZXNzZXMgb24gKi8KKyAgICBwcml2YXRlIGNsYXNzIE15SGFuZGxlciBleHRlbmRzIEhhbmRsZXIgeworCisgICAgICAgIHB1YmxpYyBNeUhhbmRsZXIoTG9vcGVyIGwpIHsKKyAgICAgICAgICAgIHN1cGVyKGwpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX0FVVE9fVElNRV9DSEFOR0VEOgorICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfUE9MTF9ORVRXT1JLX1RJTUU6CisgICAgICAgICAgICAgICAgICAgIG9uUG9sbE5ldHdvcmtUaW1lKG1zZy53aGF0KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiogT2JzZXJ2ZXIgdG8gd2F0Y2ggZm9yIGNoYW5nZXMgdG8gdGhlIEFVVE9fVElNRSBzZXR0aW5nICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgU2V0dGluZ3NPYnNlcnZlciBleHRlbmRzIENvbnRlbnRPYnNlcnZlciB7CisKKyAgICAgICAgcHJpdmF0ZSBpbnQgbU1zZzsKKyAgICAgICAgcHJp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gICAgICAgICAgICAgICAgICBtQmF0dGVyeUxvdyA9IGJhdHRlcnlMb3c7Ci0gICAgICAgICAgICAgICAgICAgIG1CYXR0ZXJ5RnVsbCA9IGJhdHRlcnlGdWxsOwotICAgICAgICAgICAgICAgICAgICB1cGRhdGVMaWdodHMoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoVXNiLkFDVElPTl9VU0JfU1RBVEUpKSB7CisgICAgICAgICAgICBpZiAoYWN0aW9uLmVxdWFscyhVc2IuQUNUSU9OX1VTQl9TVEFURSkpIHsKICAgICAgICAgICAgICAgICBCdW5kbGUgZXh0cmFzID0gaW50ZW50LmdldEV4dHJhcygpOwogICAgICAgICAgICAgICAgIGJvb2xlYW4gdXNiQ29ubmVjdGVkID0gZXh0cmFzLmdldEJvb2xlYW4oVXNiLlVTQl9DT05ORUNURUQpOwogICAgICAgICAgICAgICAgIGJvb2xlYW4gYWRiRW5hYmxlZCA9IChVc2IuVVNCX0ZVTkNUSU9OX0VOQUJMRUQuZXF1YWxzKApAQCAtNDMwLDcgKzQwOSw2IEBACiAgICAgewogICAgICAgICBzdXBlcigpOwogICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7Ci0gICAgICAgIG1MaWdodHNTZXJ2aWNlID0gbGlnaHRzOwogICAgICAgICBtQW0gPSBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuZ2V0RGVmYXVsdCgpOwogICAgICAgICBtU291bmQgPSBuZXcgTm90aWZpY2F0aW9uUGxheWVyKFRBRyk7CiAgICAgICAgIG1Tb3VuZC5zZXRVc2VzV2FrZUxvY2soY29udGV4dCk7CkBAIC00NDAsNyArNDE4LDYgQEAKICAgICAgICAgbVN0YXR1c0JhciA9IHN0YXR1c0JhcjsKICAgICAgICAgc3RhdHVzQmFyLnNldE5vdGlmaWNhdGlvbkNhbGxiYWNrcyhtTm90aWZpY2F0aW9uQ2FsbGJhY2tzKTsKIAotIC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aWx0ZXIuYWRkQWN0aW9uKEludGVudC5BQ1RJT05fU0NSRUVOX09OKTsKICAgICAgICAgZmlsdGVyLmFkZEFjdGlvbihJbnRlbnQuQUNUSU9OX1NDUkVFTl9PRkYpOwpAQCAtNzMzLDEwICs2OTgsNiBAQAogICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImNvbnRlbnRWaWV3IHJlcXVpcmVkOiBwa2c9IiArIHBrZwogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGlkPSIgKyBpZCArICIgbm90aWZpY2F0aW9uPSIgKyBub3RpZmljYXRpb24pOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG5vdGlmaWNhdGlvbi5jb250ZW50SW50ZW50ID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJjb250ZW50SW50ZW50IHJlcXVpcmVkOiBwa2c9IiArIHBrZwotICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGlkPSIgKyBpZCArICIgbm90aWZpY2F0aW9uPSIgKyBub3RpZmljYXRpb24pOwotICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgc3luY2hyb25pemVkIChtTm90aWZpY2F0aW9uTGlzdCkgewpAQCAtMTA3NSwyNSArMTAzNiw2IEBACiAgICAgLy8gbG9jayBvbiBtTm90aWZpY2F0aW9uTGlzdAogICAgIHByaXZhdGUgdm9pZCB1cGRhdGVMaWdodHNMb2NrZWQoKQogICAgIHsKLSAgICAgICAgLy8gQmF0dGVyeSBsb3cgYWx3YXlzIHNob3dzLCBvdGhlciBzdGF0ZXMgb25seSBzaG93IGlmIGNoYXJnaW5nLgotICAgICAgICBpZiAobUJhdHRlcnlMb3cpIHsKLSAgICAgICAgICAgIGlmIChtQmF0dGVyeUNoYXJnaW5nKSB7Ci0gICAgICAgICAgICAgICAgbUJhdHRlcnlMaWdodC5zZX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C9zZXJ2ZXIvUGFja2FnZU1hbmFnZXJTZXJ2aWNlLmphdmEKaW5kZXggZDMyNGMyYi4uN2M3NThhMiAxMDA2NDQKLS0tIGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvUGFja2FnZU1hbmFnZXJTZXJ2aWNlLmphdmEKKysrIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvUGFja2FnZU1hbmFnZXJTZXJ2aWNlLmphdmEKQEAgLTcxNjYsNyArNzE2Niw5IEBACiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgICAgcmVzb3VyY2VQYXRoPSIpOyBwdy5wcmludGxuKHBzLnJlc291cmNlUGF0aFN0cmluZyk7CiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgICAgbmF0aXZlTGlicmFyeVBhdGg9Iik7IHB3LnByaW50bG4ocHMubmF0aXZlTGlicmFyeVBhdGhTdHJpbmcpOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICAgIG9iYlBhdGg9Iik7IHB3LnByaW50bG4ocHMub2JiUGF0aFN0cmluZyk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgICAgdmVyc2lvbkNvZGU9Iik7IHB3LnByaW50bG4ocHMudmVyc2lvbkNvZGUpOwogICAgICAgICAgICAgICAgICAgICBpZiAocHMucGtnICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgICAgdmVyc2lvbk5hbWU9Iik7IHB3LnByaW50bG4ocHMucGtnLm1WZXJzaW9uTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICAgIGRhdGFEaXI9Iik7IHB3LnByaW50bG4ocHMucGtnLmFwcGxpY2F0aW9uSW5mby5kYXRhRGlyKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgICAgdGFyZ2V0U2RrPSIpOyBwdy5wcmludGxuKHBzLnBrZy5hcHBsaWNhdGlvbkluZm8udGFyZ2V0U2RrVmVyc2lvbik7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHMucGtnLm1PcGVyYXRpb25QZW5kaW5nKSB7CkBAIC03MjI0LDggKzcyMjYsNiBAQAogICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICAgIHBrZ0ZsYWdzPTB4Iik7IHB3LnByaW50KEludGVnZXIudG9IZXhTdHJpbmcocHMucGtnRmxhZ3MpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIGluc3RhbGxTdGF0dXM9Iik7IHB3LnByaW50KHBzLmluc3RhbGxTdGF0dXMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgZW5hYmxlZD0iKTsgcHcucHJpbnRsbihwcy5lbmFibGVkKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAgICB2ZXJzaW9uQ29kZT0iKTsgcHcucHJpbnQocHMudmVyc2lvbkNvZGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgdmVyc2lvbk5hbWU9Iik7IHB3LnByaW50bG4ocHMucGtnLm1WZXJzaW9uTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChwcy5kaXNhYmxlZENvbXBvbmVudHMuc2l6ZSgpID4gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICAgIGRpc2FibGVkQ29tcG9uZW50czoiKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHMgOiBwcy5kaXNhYmxlZENvbXBvbmVudHMpIHsKQEAgLTk2NzIsNyArOTY3Miw4IEBACiAgICAgKiBVcGRhdGUgbWVkaWEgc3RhdHVzIG9uIFBhY2thZ2VNYW5hZ2VyLgogICAgICovCiAgICBwdWJsaWMgdm9pZCB1cGRhdGVFeHRlcm5hbE1lZGlhU3RhdHVzKGZpbmFsIGJvb2xlYW4gbWVkaWFT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c3M9IiArIG1MaWdodFNlbnNvckJ1dHRvbkJyaWdodG5lc3MKICAgICAgICAgICAgICAgICAgICAgKyAiIG1MaWdodFNlbnNvcktleWJvYXJkQnJpZ2h0bmVzcz0iICsgbUxpZ2h0U2Vuc29yS2V5Ym9hcmRCcmlnaHRuZXNzKTsKQEAgLTE3NDIsNiArMTc0Niw4IEBACiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgLy8gY2FuY2VsIGxpZ2h0IHNlbnNvciB0YXNrCiAgICAgICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtQXV0b0JyaWdodG5lc3NUYXNrKTsKKyAgICAgICAgICAgICAgICAgICAgbUxpZ2h0U2Vuc29yUGVuZGluZ0RlY3JlYXNlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIG1MaWdodFNlbnNvclBlbmRpbmdJbmNyZWFzZSA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICBtU2NyZWVuT2ZmVGltZSA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpOwogICAgICAgICAgICAgICAgICAgICBsb25nIGlkZW50aXR5ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CkBAIC0yMzI1LDkgKzIzMzEsMTAgQEAKICAgICBwcml2YXRlIFJ1bm5hYmxlIG1BdXRvQnJpZ2h0bmVzc1Rhc2sgPSBuZXcgUnVubmFibGUoKSB7CiAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2tzKSB7Ci0gICAgICAgICAgICAgICAgaW50IHZhbHVlID0gKGludCltTGlnaHRTZW5zb3JQZW5kaW5nVmFsdWU7Ci0gICAgICAgICAgICAgICAgaWYgKHZhbHVlID49IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbUxpZ2h0U2Vuc29yUGVuZGluZ1ZhbHVlID0gLTE7CisgICAgICAgICAgICAgICAgaWYgKG1MaWdodFNlbnNvclBlbmRpbmdEZWNyZWFzZSB8fCBtTGlnaHRTZW5zb3JQZW5kaW5nSW5jcmVhc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IHZhbHVlID0gKGludCltTGlnaHRTZW5zb3JQZW5kaW5nVmFsdWU7CisgICAgICAgICAgICAgICAgICAgIG1MaWdodFNlbnNvclBlbmRpbmdEZWNyZWFzZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBtTGlnaHRTZW5zb3JQZW5kaW5nSW5jcmVhc2UgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgbGlnaHRTZW5zb3JDaGFuZ2VkTG9ja2VkKHZhbHVlKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC0yNjA0LDcgKzI2MTEsOCBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgbUtleWxpZ2h0RGVsYXkgPSBMT05HX0tFWUxJR0hUX0RFTEFZOwogICAgICAgICAgICAgaWYgKHRvdGFsRGVsYXkgPCAwKSB7Ci0gICAgICAgICAgICAgICAgbVNjcmVlbk9mZkRlbGF5ID0gSW50ZWdlci5NQVhfVkFMVUU7CisgICAgICAgICAgICAgICAgLy8gbmVnYXRpdmUgbnVtYmVyIG1lYW5zIHN0YXkgb24gYXMgbG9uZyBhcyBwb3NzaWJsZS4KKyAgICAgICAgICAgICAgICBtU2NyZWVuT2ZmRGVsYXkgPSBtTWF4aW11bVNjcmVlbk9mZlRpbWVvdXQ7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKG1LZXlsaWdodERlbGF5IDwgdG90YWxEZWxheSkgewogICAgICAgICAgICAgICAgIC8vIHN1YnRyYWN0IHRoZSB0aW1lIHRoYXQgdGhlIGtleWxpZ2h0IGRlbGF5LiBUaGlzIHdpbGwgZ2l2ZSB1cyB0aGUKICAgICAgICAgICAgICAgICAvLyByZW1haW5kZXIgb2YgdGhlIHRpbWUgdGhhdCB3ZSBuZWVkIHRvIHNsZWVwIHRvIGdldCB0aGUgYWNjdXJhdGUKQEAgLTI5ODAsMTkgKzI5ODgsMjkgQEAKICAgICAgICAgICAgICAgICBpZiAobURlYnVnTGlnaHRTZW5zb3IpIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIm9uU2Vuc29yQ2hhbmdlZDogbGlnaHQgdmFsdWU6ICIgKyB2YWx1ZSk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtQXV0b0JyaWdodG5lc3NUYXNrKTsKLSAgICAgICAgICAgICAgICBpZiAobUxpZ2h0U2Vuc29yVmFsdWUgIT0gdmFsdWUpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1MaWdodFNlbnNvclZhbHVlID09IC0xIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWlsbGlzZWNvbmRzIDwgbUxhc3RTY3JlZW5PblRpbWUgKyBtTGlnaHRTZW5zb3JXYXJtdXBUaW1lKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBwcm9jZXNzIHRoZSB2YWx1ZSBpbW1lZGlhdGVseSBpZiBzY3JlZW4gaGFzIGp1c3QgdHVybmVkIG9uCi0gICAgICAgICAgICAgICAgICAgICAgICBsaWdodFNlbnNvckNoYW5nZWRMb2NrZWQodmFsdWUpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGVsYXkgcHJvY2Vzc2luZyB0byBkZWJvdW5jZSB0aGUgc2Vuc29yCi0gICAgICAgICAgICAgICAgICAgICAgICBtTGlnaHRTZW5zb3JQZW5kaW5nVmFsdWUgPSB2YWx1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1IYW5kbGVyLnBvc3REZWxheWVkKG1BdXRvQnJpZ2h0bmVzc1Rhc2ssIExJR0hUX1NFTlNPUl9ERUxBWSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobUxpZ2h0U2Vuc29yVmFsdWUgPT0gLTEgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pbGxpc2Vjb25kcyA8IG1MYXN0U2NyZWVuT25UaW1lICsgbUxpZ2h0U2Vuc29yV2FybXVwVGltZSkgeworICAgICAgICAgICAgICAgICAgICAvLyBwcm9jZXNzIHRoZSB2YWx1ZSBpbW1lZGlhdGVseSBpZiBzY3JlZW4gaGFzIGp1c3QgdHVybmVkIG9uCisgICAgICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtQXV0b0JyaWdodG5lc3NUYXNrKTsKKyAgICAgICAgICAgICAgICAgICAgbUxpZ2h0U2Vuc29yUGVuZGluZ0RlY3JlYXNlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIG1MaWdodFNlbnNvclBlbmRpbmdJbmNyZWFzZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBsaWdodFNlbnNvckNoYW5nZWRMb2NrZWQodmFsdWUpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1MaWdodFNlbnNvclBlbmRpbmdWYWx1ZSA9IC0xOworICAgICAgICAgICAgICAgICAgICBpZiAoKHZhbHVlID4gbUxpZ2h0U2Vuc29yVmFsdWUgJiYgbUxpZ2h0U2Vuc29yUGVuZGluZ0RlY3JlYXNlKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2YWx1ZSA8IG1MaWdodFNlbnNvclZhbHVlICYmIG1MaWdodFNlbnNvclBlbmRpbmdJbmNyZWFzZSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodmFsdWUgPT0gbUxpZ2h0U2Vuc29yVmFsdWUpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCFtTGlnaHRTZW5zb3JQZW5kaW5nRGVjcmVhc2UgJiYgIW1MaWdodFNlbnNvclBlbmRpbmdJbmNyZWFzZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRlbGF5IHByb2Nlc3NpbmcgdG8gZGVib3VuY2UgdGhlIHNlbnNvcgorICAgICAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1BdXRvQnJpZ2h0bmVzc1Rhc2spOworICAgICAgICAgICAgICAgICAgICAgICAgbUxpZ2h0U2Vuc29yUGVuZGluZ0RlY3JlYXNlID0gKHZhbHVlIDwgbUxpZ2h0U2Vuc29yVmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgbUxpZ2h0U2Vuc29yUGVuZGluZ0luY3JlYXNlID0gKHZhbHVlID4gbUxpZ2h0U2Vuc29yVmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1MaWdodFNlbnNvclBlbmRpbmdEZWNyZWFzZSB8fCBtTGlnaHRTZW5zb3JQZW5kaW5nSW5jcmVhc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGlnaHRTZW5zb3JQZW5kaW5nVmFsdWUgPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5wb3N0RGVsYXllZChtQXV0b0JyaWdodG5lc3NUYXNrLCBMSUdIVF9TRU5TT1JfREVMQVkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbUxpZ2h0U2Vuc29yUGVuZGluZ1ZhbHVlID0gdmFsdWU7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL1NhbXBsaW5nUHJvZmlsZXJTZX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BTbG9nLnYoVEFHLCBmaWxlLmdldFBhdGgoKSArICIgYWRkZWQgdG8gZHJvcGJveCIpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBTbG9nLmUoVEFHLCAiQ2FuJ3QgYWRkICIgKyBmaWxlLmdldFBhdGgoKSArICIgdG8gZHJvcGJveCIsIGUpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgZmlsZS5kZWxldGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZWdpc3RlclNldHRpbmdPYnNlcnZlcihDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgQ29udGVudFJlc29sdmVyIGNvbnRlbnRSZXNvbHZlciA9IGNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCk7CisgICAgICAgIGNvbnRlbnRSZXNvbHZlci5yZWdpc3RlckNvbnRlbnRPYnNlcnZlcigKKyAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuZ2V0VXJpRm9yKFNldHRpbmdzLlNlY3VyZS5TQU1QTElOR19QUk9GSUxFUl9IWiksCisgICAgICAgICAgICAgICAgZmFsc2UsIG5ldyBTYW1wbGluZ1Byb2ZpbGVyU2V0dGluZ3NPYnNlcnZlcihjb250ZW50UmVzb2x2ZXIpKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBkdW1wKEZpbGVEZXNjcmlwdG9yIGZkLCBQcmludFdyaXRlciBwdywgU3RyaW5nW10gYXJncykgeworICAgICAgICBwdy5wcmludGxuKCJTYW1wbGluZ1Byb2ZpbGVyU2VydmljZToiKTsKKyAgICAgICAgcHcucHJpbnRsbigiV2F0Y2hpbmcgZGlyZWN0b3J5OiAiICsgU05BUFNIT1RfRElSKTsKKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFNhbXBsaW5nUHJvZmlsZXJTZXR0aW5nc09ic2Vyd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09IiArIG1Db25maXJtKTsKIAogICAgICAgICBIYW5kbGVyIGggPSBuZXcgSGFuZGxlcigpOwogICAgICAgICBoLnBvc3QobmV3IFJ1bm5hYmxlKCkgewogICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewotICAgICAgICAgICAgICAgIFNodXRkb3duVGhyZWFkLnNodXRkb3duKFNodXRkb3duQWN0aXZpdHkudGhpcywgbUNvbmZpcm0pOworICAgICAgICAgICAgICAgIGlmIChtUmVib290KSB7CisgICAgICAgICAgICAgICAgICAgIFNodXRkb3duVGhyZWFkLnJlYm9vdChTaHV0ZG93bkFjdGl2aXR5LnRoaXMsIG51bGwsIG1Db25maXJtKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBTaHV0ZG93blRocmVhZC5zaHV0ZG93bihTaHV0ZG93bkFjdGl2aXR5LnRoaXMsIG1Db25maXJtKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0pOwogICAgIH0KZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL1N0YXR1c0Jhck1hbmFnZXJTZXJ2aWNlLmphdmEgYi9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9TdGF0dXNCYXJNYW5hZ2VyU2VydmljZS5qYXZhCmluZGV4IGU1ZGZiMTguLjU5NmRiNTcgMTAwNjQ0Ci0tLSBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL1N0YXR1c0Jhck1hbmFnZXJTZXJ2aWNlLmphdmEKKysrIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvU3RhdHVzQmFyTWFuYWdlclNlcnZpY2UuamF2YQpAQCAtNjgsNiArNjgsMTIgQEAKICAgICBBcnJheUxpc3Q8RGlzYWJsZVJlY29yZD4gbURpc2FibGVSZWNvcmRzID0gbmV3IEFycmF5TGlzdDxEaXNhYmxlUmVjb3JkPigpOwogICAgIGludCBtRGlzYWJsZWQgPSAwOwogCisgICAgT2JqZWN0IG1Mb2NrID0gbmV3IE9iamVjdCgpOworICAgIC8vIFdlIHVzdWFsbHkgY2FsbCBpdCBsaWdodHMgb3V0IG1vZGUsIGJ1dCBkb3VibGUgbmVnYXRpdmVzIGFyZSBhbm5veWluZworICAgIGJvb2xlYW4gbUxpZ2h0c09uID0gdHJ1ZTsKKyAgICBib29sZWFuIG1NZW51VmlzaWJsZSA9IGZhbHNlOworICAgIGJvb2xlYW4gbUlNRUJ1dHRvblZpc2libGUgPSBmYWxzZTsKKwogICAgIHByaXZhdGUgY2xhc3MgRGlzYWJsZVJlY29yZCBpbXBsZW1lbnRzIElCaW5kZXIuRGVhdGhSZWNpcGllbnQgewogICAgICAgICBTdHJpbmcgcGtnOwogICAgICAgICBpbnQgd2hhdDsKQEAgLTg0LDYgKzkwLDcgQEAKICAgICAgICAgdm9pZCBvblNldERpc2FibGVkKGludCBzdGF0dXMpOwogICAgICAgICB2b2lkIG9uQ2xlYXJBbGwoKTsKICAgICAgICAgdm9pZCBvbk5vdGlmaWNhdGlvbkNsaWNrKFN0cmluZyBwa2csIFN0cmluZyB0YWcsIGludCBpZCk7CisgICAgICAgIHZvaWQgb25Ob3RpZmljYXRpb25DbGVhcihTdHJpbmcgcGtnLCBTdHJpbmcgdGFnLCBpbnQgaWQpOwogICAgICAgICB2b2lkIG9uUGFuZWxSZXZlYWxlZCgpOwogICAgICAgICB2b2lkIG9uTm90aWZpY2F0aW9uRXJyb3IoU3RyaW5nIHBrZywgU3RyaW5nIHRhZywgaW50IGlkLAogICAgICAgICAgICAgICAgIGludCB1aWQsIGludCBpbml0aWFsUGlkLCBTdHJpbmcgbWVzc2FnZSk7CkBAIC0xMDQsMjIgKzExMSw2IEBACiAgICAgfQogCiAgICAgLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICAvLyBDb25zdHJ1Y3RpbmcgdGhlIHZpZXcKLSAgICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotCi0gICAgcHVibGljIHZvaWQgc3lzdGVtUmVhZHkoKSB7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgc3lzdGVtUmVhZHkyKCkgewotICAgICAgICBDb21wb25lbnROYW1lIGNuID0gQ29tcG9uZW50TmFtZS51bmZsYXR0ZW5Gcm9tU3RyaW5nKAotICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFN0cmluZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5jb25maWdfc3RhdHVzQmFyQ29tcG9uZW50KSk7Ci0gICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KCk7Ci0gICAgICAgIGludGVudC5zZXRDb21wb25lbnQoY24pOwotICAgICAgICBTbG9nLmkoVEFHLCAiU3RhcnRpbmcgc2VydmljZTogIiArIGNuKTsKLSAgICAgICAgbUNvbnRleHQuc3RhcnRTZXJ2aWNlKGludGVudCk7Ci0gICAgfQotCi0gICAgLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgICAvLyBGcm9tIElTdGF0dXNCYXJTZXJ2aWNlCiAgICAgLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgICBwdWJsaWMgdm9pZCBleHBhbmQoKSB7CkBAIC0yNDAsNiArMjMxLDEwNSBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgLyoqIAorICAgICAqIEhpZGUgb3Igc2hvdyB0aGUgb24tc2NyZWVuIE1lbnUga2V5LiBPbmx5IGNhbGwgdGhpcyBmcm9tIHRoZSB3aW5kb3cgbWFuYWdlciwgdHlwaWNhbGx5IGluCisgICAgICogcmVzcG9uc2UgdG8gYSB3aW5kb3cgd2l0aCBGTEFHX05FRURTX01FTlVfS0VZIHNldC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRNZW51S2V5VmlzaWJsZShmaW5hbCBib29sZWFuIHZpc2libGUpIHsKKyAgICAgICAgZW5mb3JjZVN0YXR1c0JhcigpOworCisgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAodmlzaWJsZT8ic2hvd2luZyI6ImhpZGluZyIpICsgIiBNRU5VIGtleSIpOworCisgICAgICAgIHN5bmNocm9uaXplZChtTG9jaykgeworICAgICAgICAgICAgaWYgKG1NZW51VmlzaWJsZSAhPSB2aXNpYmxlKSB7CisgICAgICAgICAgICAgICAgbU1lbnVWaXNpYmxlID0gdmlzaWJsZTsKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5wb3N0KG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUJhciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQmFyLnNldE1lbnVLZXlWaXNpYmxlKHZpc2libGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRJTUVCdXR0b25WaXNpYmxlKGZpbmFsIGJvb2xlYW4gdmlzaWJsZSkgeworICAgICAgICBlbmZvcmNlU3RhdHVzQmFyKCk7CisKKyAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICh2aXNpYmxlPyJzaG93aW5nIjoiaGlkaW5nIikgKyAiIElNRSBCdXR0b24iKTsKKworICAgICAgICBzeW5jaHJvbml6ZWQobUxvY2spIHsKKyAgICAgICAgICAgIC8vIEluIGNhc2Ugb2YgSU1FIGNoYW5nZSwgd2UgbmVlZCB0byBjYWxsIHVwIHNldElNRUJ1dHRvblZpc2libGUoKSByZWdhcmRsZXNzIG9mCisgICAgICAgICAgICAvLyBtSU1FQnV0dG9uVmlzaWJsZSBiZWNhdXNlIG1JTUVCdXR0b25WaXNpYmxlIG1heSBub3QgaGF2ZSBiZWVuIHNldCB0byBmYWxzZSB3aGVuIHRoZQorICAgICAgICAgICAgLy8gcHJldmlvdXMgSU1FIHdhcyBkZXN0cm95ZWQuCisgICAgICAgICAgICBtSU1FQnV0dG9uVmlzaWJsZSA9IHZpc2libGU7CisgICAgICAgICAgICBtSGFuZGxlci5wb3N0KG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQmFyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJhci5zZXRJTUVCdXR0b25WaXNpYmxlKHZpc2libGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFRoaXMgaXMgdXNlZCBmb3IgdGhlIGF1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rIHRoZSBiZWhhdmlvciB3aGVuIHRoZSB1c2VyIGtlZXBzIHR1cm5pbmcgbGlnaHRzLW91dCBtb2RlIG9mZiBhbmQgdGhlCisgICAgICogYXBwIGtlZXBzIHRyeWluZyB0byB0dXJuIGl0IG9uLiAgRm9yIG5vdyB0aGV5IGNhbiBqdXN0IGZpZ2h0IGl0IG91dC4gIEhhdmluZworICAgICAqIHRoZXNlIHR3byBzZXBhcnRlIGlucHV0cyB3aWxsIGFsbG93IHVzIHRvIGtlZXAgdGhhdCBjaGFuZ2UgbG9jYWwgdG8gaGVyZS4gIC0tam9lbworICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldExpZ2h0c09uKGJvb2xlYW4gbGlnaHRzT24pIHsKKyAgICAgICAgZW5mb3JjZVN0YXR1c0JhclNlcnZpY2UoKTsKKworICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICB1cGRhdGVMaWdodHNPbkxvY2tlZChsaWdodHNPbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgdXBkYXRlTGlnaHRzT25Mb2NrZWQoZmluYWwgYm9vbGVhbiBsaWdodHNPbikgeworICAgICAgICBpZiAobUxpZ2h0c09uICE9IGxpZ2h0c09uKSB7CisgICAgICAgICAgICBtTGlnaHRzT24gPSBsaWdodHNPbjsKKyAgICAgICAgICAgIG1IYW5kbGVyLnBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUJhciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJhci5zZXRMaWdodHNPbihsaWdodHNPbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9CisKICAgICBwcml2YXRlIHZvaWQgZW5mb3JjZVN0YXR1c0JhcigpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5TVEFUVVNfQkFSLAogICAgICAgICAgICAgICAgICJTdGF0dXNCYXJNYW5hZ2VyU2VydmljZSIpOwpAQCAtMjYwLDcgKzM1MCw4IEBACiAgICAgLy8gQ2FsbGJhY2tzIGZyb20gdGhlIHN0YXR1cyBiYXIgc2VydmljZS4KICAgICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgIHB1YmxpYyB2b2lkIHJlZ2lzdGVyU3RhdHVzQmFyKElTdGF0dXNCYXIgYmFyLCBTdGF0dXNCYXJJY29uTGlzdCBpY29uTGlzdCwKLSAgICAgICAgICAgIExpc3Q8SUJpbmRlcj4gbm90aWZpY2F0aW9uS2V5cywgTGlzdDxTdGF0dXNCYXJOb3RpZmljYXRpb24+IG5vdGlmaWNhdGlvbnMpIHsKKyAgICAgICAgICAgIExpc3Q8SUJpbmRlcj4gbm90aWZpY2F0aW9uS2V5cywgTGlzdDxTdGF0dXNCYXJOb3RpZmljYXRpb24+IG5vdGlmaWNhdGlvbnMsCisgICAgICAgICAgICBpbnQgc3dpdGNoZXNbXSkgewogICAgICAgICBlbmZvcmNlU3RhdHVzQmFyU2VydmljZSgpOwogCiAgICAgICAgIFNsb2cuaShUQUcsICJyZWdpc3RlclN0YXR1c0JhciBiYXI9IiArIGJhcik7CkBAIC0yNzQsNiArMzY1LDEyIEBACiAgICAgICAgICAgICAgICA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ICAgICAgICAgICBiYXR0ZXJ5ID0gbmV3IEJhdHRlcnlTZXJ2aWNlKGNvbnRleHQpOwotICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZSgiYmF0dGVyeSIsIGJhdHRlcnkpOwotCiAgICAgICAgICAgICBTbG9nLmkoVEFHLCAiTGlnaHRzIFNlcnZpY2UiKTsKICAgICAgICAgICAgIGxpZ2h0cyA9IG5ldyBMaWdodHNTZXJ2aWNlKGNvbnRleHQpOwogCisgICAgICAgICAgICBTbG9nLmkoVEFHLCAiQmF0dGVyeSBTZXJ2aWNlIik7CisgICAgICAgICAgICBiYXR0ZXJ5ID0gbmV3IEJhdHRlcnlTZXJ2aWNlKGNvbnRleHQsIGxpZ2h0cyk7CisgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKCJiYXR0ZXJ5IiwgYmF0dGVyeSk7CisKICAgICAgICAgICAgIFNsb2cuaShUQUcsICJWaWJyYXRvciBTZXJ2aWNlIik7CiAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKCJ2aWJyYXRvciIsIG5ldyBWaWJyYXRvclNlcnZpY2UoY29udGV4dCkpOwogCkBAIC0yMTUsNiArMjE3LDcgQEAKICAgICAgICAgICAgICAgICBibHVldG9vdGhBMmRwID0gbmV3IEJsdWV0b290aEEyZHBTZXJ2aWNlKGNvbnRleHQsIGJsdWV0b290aCk7CiAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZShCbHVldG9vdGhBMmRwU2VydmljZS5CTFVFVE9PVEhfQTJEUF9TRVJWSUNFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZXRvb3RoQTJkcCk7CisgICAgICAgICAgICAgICAgYmx1ZXRvb3RoLmluaXRBZnRlckEyZHBSZWdpc3RyYXRpb24oKTsKIAogICAgICAgICAgICAgICAgIGludCBibHVldG9vdGhPbiA9IFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRlbnRSZXNvbHZlciwKICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkJMVUVUT09USF9PTiwgMCk7CkBAIC0yMzQsNiArMjM3LDcgQEAKICAgICAgICAgTm90aWZpY2F0aW9uTWFuYWdlclNlcnZpY2Ugbm90aWZpY2F0aW9uID0gbnVsbDsKICAgICAgICAgV2FsbHBhcGVyTWFuYWdlclNlcnZpY2Ugd2FsbHBhcGVyID0gbnVsbDsKICAgICAgICAgTG9jYXRpb25NYW5hZ2VyU2VydmljZSBsb2NhdGlvbiA9IG51bGw7CisgICAgICAgIENvdW50cnlEZXRlY3RvclNlcnZpY2UgY291bnRyeURldGVjdG9yID0gbnVsbDsKIAogICAgICAgICBpZiAoZmFjdG9yeVRlc3QgIT0gU3lzdGVtU2VydmVyLkZBQ1RPUllfVEVTVF9MT1dfTEVWRUwpIHsKICAgICAgICAgICAgIHRyeSB7CkBAIC0zNDUsNiArMzQ5LDE0IEBACiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgU2xvZy5pKFRBRywgIkNvdW50cnkgRGV0ZWN0b3IiKTsKKyAgICAgICAgICAgICAgICBjb3VudHJ5RGV0ZWN0b3IgPSBuZXcgQ291bnRyeURldGVjdG9yU2VydmljZShjb250ZXh0KTsKKyAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKENvbnRleHQuQ09VTlRSWV9ERVRFQ1RPUiwgY291bnRyeURldGVjdG9yKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSBlKSB7CisgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIkZhaWx1cmUgc3RhcnRpbmcgQ291bnRyeSBEZXRlY3RvciIsIGUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIFNsb2cuaShUQUcsICJTZWFyY2ggU2VydmljZSIpOwogICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoQ29udGV4dC5TRUFSQ0hfU0VSVklDRSwKICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTZWFyY2hNYW5hZ2VyU2VydmljZShjb250ZXh0KSk7CkBAIC0zNTIsMTEgKzM2NCw2IEBACiAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIkZhaWx1cmUgc3RhcnRpbmcgU2VhcmNoIFNlcnZpY2UiLCBlKTsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaWYgKElOQ0xVREVfREVNTykgewotICAgICAgICAgICAgICAgIFNsb2cuaShUQUcsICJJbnN0YWxsaW5nIGRlbW8gZGF0YS4uLiIpOwotICAgICAgICAgICAgICAgIChuZXcgRGVtb1RocmVhZChjb250ZXh0KSkuc3RhcnQoKTsKLSAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICBTbG9nLmkoVEFHLCAiRHJvcEJveCBTZXJ2aWNlIik7CiAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZShDb250ZXh0LkRST1BCT1hfU0VSVklDRSwKQEAgLTM4MSwxNCArMzg4LDYgQEAKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBTbG9nLmkoVEFHLCAiSGVhZHNldCBPYnNlcnZlciIpOwotICAgICAgICAgICAgICAgIC8vIExpc3RlbiBmb3Igd2lyZWQgaGVhZHNldCBjaGFuZ2VzCi0gICAgICAgICAgICAgICAgaGVhZHNldCA9IG5ldyBIZWFkc2V0T2JzZXJ2ZXIoY29udGV4dCk7Ci0gICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgZSkgewotICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIEhlYWRzZXRPYnNlcnZlciIsIGUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIFNsb2cuaShUQUcsICJEb2NrIE9ic2VydmVyIik7CiAgICAgICAgICAgICAgICAgLy8gTGlzdGVuIGZvciBkb2NrIHN0YXRpb24gY2hhbmdlcwogICAgICAgICAgICAgICAgIGRvY2sgPSBuZXcgRG9ja09ic2VydmVyKGNvbnRleHQsIHBvd2VyKTsKQEAgLTM5Nyw2ICszOTYsMTQgQEAKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBTbG9nLmkoVEFHLCAiV2lyZWQgQWNjZXNzb3J5IE9ic2VydmVyIik7CisgICAgICAgICAgICAgICAgLy8gTGlzdGVuIGZvciB3aXJlZCBoZWFkc2V0IGNoYW5nZXMKKyAgICAgICAgICAgICAgICB3aXJlZEFjY2Vzc29yeSA9IG5ldyBXaXJlZEFjY2Vzc29yeU9ic2VydmVyKGNvbnRleHQpOworICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKKyAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRmFpbHVyZSBzdGFydGluZyBXaXJlZEFjY2Vzc29yeU9ic2VydmVyIiwgZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgU2xvZy5pKFRBRywgIlVTQiBPYnNlcnZlciIpOwogICAgICAgICAgICAgICAgIC8vIExpc3RlbiBmb3IgVVNCIGNoYW5nZXMKICAgICAgICAgICAgICAgICB1c2IgPSBuZXcgVXNiT2JzZXJ2ZXIoY29udGV4dCk7CkBAIC00MzQsMTMgKzQ0MSwzMiBAQAogICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRmFpbHVyZSBzdGFydGluZyBSZWNvZ25pdGlvbiBTZXJ2aWNlIiwgZSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICBTbG9nLmkoVEFHLCAiRGlza1N0YXRzIFNlcnZpY2UiKTsKICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKCJkaXNrc3RhdHMiLCBuZXcgRGlza1N0YXRzU2VydmljZShjb250ZXh0KSk7CiAgICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgZSkgewogICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIERpc2tTdGF0cyBTZXJ2aWNlIiwgZSk7CiAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgLy8gbmVlZCB0byBhZGQgdGhpcyBzZXJ2aWNlIGV2ZW4gaWYgU2FtcGxpbmdQcm9maWxlckludGVncmF0aW9uLmlzRW5hYmxlZCgpCisgICAgICAgICAgICAgICAgLy8gaXMgZmFsc2UsIGJlY2F1c2UgaXQgaXMgdGhpcyBzZXJ2aWNlIHRoYXQgZGV0ZWN0cyBzeXN0ZW0gcHJvcGVydHkgY2hhbmdlIGFuZAorICAgICAgICAgICAgICAgIC8vIHR1cm5zIG9uIFNhbXBsaW5nUHJvZmlsZXJJbnRlZ3JhdGlvbi4gUGx1cywgd2hlbiBzYW1wbGluZyBwcm9maWxlciBkb2Vzbid0IHdvcmssCisgICAgICAgICAgICAgICAgLy8gdGhlcmUgaXMgbGl0dGxlIG92ZXJoZWFkIGZvciBydW5uaW5nIHRoaXMgc2VydmljZS4KKyAgICAgICAgICAgICAgICBTbG9nLmkoVEFHLCAiU2FtcGxpbmdQcm9maWxlciBTZXJ2aWNlIik7CisgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZSgic2FtcGxpbmdwcm9maWxlciIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFNhbXBsaW5nU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Nvbm5lY3Rpdml0eUYgIT0gbnVsbCkgY29ubmVjdGl2aXR5Ri5zeXN0ZW1SZWFkeSgpOwogICAgICAgICAgICAgICAgIGlmIChkb2NrRiAhPSBudWxsKSBkb2NrRi5zeXN0ZW1SZWFkeSgpOwpAQCAtNTI4LDcgKzU2Myw5IEBACiAgICAgICAgICAgICAgICAgaWYgKHdhbGxwYXBlckYgIT0gbnVsbCkgd2FsbHBhcGVyRi5zeXN0ZW1SZWFkeSgpOwogICAgICAgICAgICAgICAgIGlmIChpbW1GICE9IG51bGwpIGltbUYuc3lzdGVtUmVhZHkoKTsKICAgICAgICAgICAgICAgICBpZiAobG9jYXRpb25GICE9IG51bGwpIGxvY2F0aW9uRi5zeXN0ZW1SZWFkeSgpOworICAgICAgICAgICAgICAgIGlmIChjb3VudHJ5RGV0ZWN0b3JGICE9IG51bGwpIGNvdW50cnlEZXRlY3RvckYuc3lzdGVtUmVhZHkoKTsKICAgICAgICAgICAgICAgICBpZiAodGhyb3R0bGVGICE9IG51bGwpIHRocm90dGxlRi5zeXN0ZW1SZWFkeSgpOworICAgICAgICAgICAgICAgIGlmIChuZXR3b3JrVGltZVVwZGF0ZXJGICE9IG51bGwpIG5ldHdvcmtUaW1lVXBkYXRlckYuc3lzdGVtUmVhZHkoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSk7CiAKQEAgLTU0MCwzOSArNTc3LDE3IEBACiAgICAgICAgIExvb3Blci5sb29wKCk7CiAgICAgICAgIFNsb2cuZChUQUcsICJTeXN0ZW0gU2VydmVyVGhyZWFkIGlzIGV4aXRpbmchIik7CiAgICAgfQorCisgICAgc3RhdGljIGZpbmFsIHZvaWQgc3RhcnRTeXN0ZW1VaShDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoKTsKKyAgICAgICAgaW50ZW50LnNldENvbXBvbmVudChuZXcgQ29tcG9uZW50TmFtZSgiY29tLmFuZHJvaWQuc3lzdGVtdWkiLAorICAgICAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuc3lzdGVtdWkuU3lzdGVtVUlTZXJ2aWNlIikpOworICAgICAgICBTbG9nLmQoVEFHLCAiU3RhcnRpbmcgc2VydmljZTogIiArIGludGVudCk7CisgICAgICAgIGNvbnRleHQuc3RhcnRTZXJ2aWNlKGludGVudCk7CisgICAgfQogfQogCi1jbGFzcyBEZW1vVGhyZWFkIGV4dGVuZHMgVGhyZWFkCi17Ci0gICAgRGVtb1RocmVhZChDb250ZXh0IGNvbnRleHQpCi0gICAgewotICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7Ci0gICAgfQotCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIHZvaWQgcnVuKCkKLSAgICB7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBDdXJzb3IgYyA9IG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLnF1ZXJ5KFBlb3BsZS5DT05URU5UX1VSSSwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCk7Ci0gICAgICAgICAgICBib29sZWFuIGhhc0RhdGEgPSBjICE9IG51bGwgJiYgYy5tb3ZlVG9GaXJzdCgpOwotICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGMuZGVhY3RpdmF0ZSgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFoYXNEYXRhKSB7Ci0gICAgICAgICAgICAgICAgRGVtb0RhdGFTZXQgZGF0YXNldCA9IG5ldyBEZW1vRGF0YVNldCgpOwotICAgICAgICAgICAgICAgIGRhdGFzZXQuYWRkKG1Db250ZXh0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKLSAgICAgICAgICAgIFNsb2cuZSgiU3lzdGVtU2VydmVyIiwgIkZhaWx1cmUgaW5zdGFsbGluZyBkZW1vIGRhdGEiLCBlKTsKLSAgICAgICAgfQotC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1TZXJ2aWNlU3RhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmNhbGxiYWNrLm9uU2VydmljZVN0YXRlQ2hhbmdlZChuZXcgU2VydmljZVN0YXRlKG1TZXJ2aWNlU3RhdGUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZShyLmJpbmRlcik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaWYgKChldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX1NJR05BTF9TVFJFTkdUSCkgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKQEAgLTE3OSw3ICsxOTIsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBpZiAoKGV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fQ0VMTF9MT0NBVElPTikgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc2VuZENlbGxMb2NhdGlvbihyLCBtQ2VsbExvY2F0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgci5jYWxsYmFjay5vbkNlbGxMb2NhdGlvbkNoYW5nZWQobmV3IEJ1bmRsZShtQ2VsbExvY2F0aW9uKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmUoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmICgoZXZlbnRzICYgUGhvbmVTdGF0ZUxpc3RlbmVyLkxJU1RFTl9DQUxMX1NUQVRFKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgewpAQCAtMjEwLDYgKzIyNywxMyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZShyLmJpbmRlcik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKChldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX09UQVNQX0NIQU5HRUQpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgci5jYWxsYmFjay5vbk90YXNwQ2hhbmdlZChtT3Rhc3BNb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZShyLmJpbmRlcik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7CkBAIC0yMzYsMTYgKzI2MCwxNiBAQAogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtQ2FsbFN0YXRlID0gc3RhdGU7CiAgICAgICAgICAgICBtQ2FsbEluY29taW5nTnVtYmVyID0gaW5jb21pbmdOdW1iZXI7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX0NBTExfU1RBVEUpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25DYWxsU3RhdGVDaGFuZ2VkKHN0YXRlLCBpbmNvbWluZ051bWJlcik7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlKHIuYmluZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1SZW1vdmVMaXN0LmFkZChyLmJpbmRlcik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBoYW5kbGVSZW1vdmVMaXN0TG9ja2VkKCk7CiAgICAgICAgIH0KICAgICAgICAgYnJvYWRjYXN0Q2FsbFN0YXRlQ2hhbmdlZChzdGF0ZSwgaW5jb21pbmdOdW1iZXIpOwogICAgIH0KQEAgLTI1NywxMiArMjgxLDE2IEBACiAgICAgICAgIFNsb2cuaShUQUcsICJub3RpZnlTZXJ2aWNlU3RhdGU6ICIgKyBzdGF0ZSk7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVJlY29yZHMpIHsKICAgICAgICAgICAgIG1TZXJ2aWNlU3RhdGUgPSBzdGF0ZTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBtUmVjb3Jkcy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgIFJlY29yZCByID0gbVJlY29yZHMuZ2V0KGkpOworICAgICAgICAgICAgZm9yIChSZWNvcmQgciA6IG1SZWNvcmRzKSB7CiAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fU0VSVklDRV9TVEFURSkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBzZW5kU2VydmljZVN0YXRlKHIsIHN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25TZXJ2aWNlU3RhdGVDaGFuZ2VkKG5ldyBTZXJ2aWNlU3RhdGUoc3RhdGUpKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtUmVtb3ZlTGlzdC5hZGQoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgaGFuZGxlUmVtb3ZlTGlzdExvY2tlZCgpOwogICAgICAgICB9CiAgICAgICAgIGJyb2FkY2FzdFNlcnZpY2VTdGF0ZUNoYW5nZWQoc3RhdGUpOwogICAgIH0KQEAgLTI3MywxMCArMzAxLDEzIEBACiAgICAgICAgIH0KICAgICAgICAgc3luY2hyb25pemVkIChtUmVjb3JkcykgewogICAgICAgICAgICAgbVNpZ25hbFN0cmVuZ3RoID0gc2lnbmFsU3RyZW5ndGg7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX1NJR05BTF9TVFJFTkdUSFMpICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgc2VuZFNpZ25hbFN0cmVuZ3RoKHIsIHNpZ25hbFN0cmVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25TaWduYWxTdHJlbmd0aHNDaGFuZ2VkKG5ldyBTaWduYWxTdHJlbmd0aChzaWduYWxTdHJlbmd0aCkpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1SZW1vdmVMaXN0LmFkZChyLmJpbmRlcik7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fU0lHTkFMX1NUUkVOR1RIKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CkBAIC0yODQsMTAgKzMxNSwxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgci5jYWxsYmFjay5vblNpZ25hbFN0cmVuZ3RoQ2hhbmdlZCgoZ3NtU2lnbmFsU3RyZW5ndGggPT0gOTkgPyAtMQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGdzbVNpZ25hbFN0cmVuZ3RoKSk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlKHIuYmluZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1SZW1vdmVMaXN0LmFkZChyLmJpbmRlcik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBoYW5kbGVSZW1vdmVMaXN0TG9ja2VkKCk7CiAgICAgICAgIH0KICAgICAgICAgYnJvYWRjYXN0U2lnbmFsU3RyZW5ndGhDaGFuZ2VkKHNpZ25hbFN0cmVuZ3RoKTsKICAgICB9CkBAIC0yOTYsMTkgKzMyOCwxOCBAQAogICAgICAgICBpZiAoIWNoZWNrTm90aWZ5UGVybWlzc2lvbigibm90aWZ5TWVzc2FnZVdhaXRpbmdDaGFuZ2VkKCkiKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9Ci0gICAgICAgIFNsb2cuaShUQUcsICJub3RpZnlNZXNzYWdlV2FpdGluZ0NoYW5nZWQ6ICIgKyBtd2kpOwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtTWVzc2FnZVdhaXRpbmcgPSBtd2k7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX01FU1NBR0VfV0FJVElOR19JTkRJQ0FUT1IpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25NZXNzYWdlV2FpdGluZ0luZGljYXRvckNoYW5nZWQobXdpKTsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmUoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgbVJlbW92ZUxpc3QuYWRkKHIuYmluZGVyKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhhbmRsZVJlbW92ZUxpc3RMb2NrZWQoKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMzE2LDE5ICszNDcsMTggQEAKICAgICAgICAgaWYgKCFjaGVja05vdGlmeVBlcm1pc3Npb24oIm5vdGlmeUNhbGxGb3J3YXJkaW5nQ2hhbmdlZCgpIikpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQotICAgICAgICBTbG9nLmkoVEFHLCAibm90aWZ5Q2FsbEZvcndhcmRpbmdDaGFuZ2VkOiAiICsgY2ZpKTsKICAgICAgICAgc3luY2hyb25pemVkIChtUmVjb3JkcykgewogICAgICAgICAgICAgbUNhbGxGb3J3YXJkaW5nID0gY2ZpOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1SZWNvcmRzLnNpemUoKSAtIDE7IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgICAgICAgICAgUmVjb3JkIHIgPSBtUmVjb3Jkcy5nZXQoaSk7CisgICAgICAgICAgICBmb3IgKFJlY29yZCByIDogbVJlY29yZHMpIHsKICAgICAgICAgICAgICAgICBpZiAoKHIuZXZlbnRzICYgUGhvbmVTdGF0ZUxpc3RlbmVyLkxJU1RFTl9DQUxMX0ZPUldBUkRJTkdfSU5ESUNBVE9SKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICByLmNhbGxiYWNrLm9uQ2FsbEZvcndhcmRpbmdJbmRpY2F0b3JDaGFuZ2VkKGNmaSk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlKHIuYmluZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1SZW1vdmVMaXN0LmFkZChyLmJpbmRlcik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBoYW5kbGVSZW1vdmVMaXN0TG9ja2VkKCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTMzOCw1OCArMzY4LDgwIEBACiAgICAgICAgIH0KICAgICAgICAgc3luY2hyb25pemVkIChtUmVjb3JkcykgewogICAgICAgICAgICAgbURhdGFBY3Rpdml0eSA9IHN0YXRlOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1SZWNvcmRzLnNpemUoKSAtIDE7IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgICAgICAgICAgUmVjb3JkIHIgPSBtUmVjb3Jkcy5nZXQoaSk7CisgICAgICAgICAgICBmb3IgKFJlY29yZCByIDogbVJlY29yZHMpIHsKICAgICAgICAgICAgICAgICBpZiAoKHIuZXZlbnRzICYgUGhvbmVTdGF0ZUxpc3RlbmVyLkxJU1RFTl9EQVRBX0FDVElWSVRZKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICByLmNhbGxiYWNrLm9uRGF0YUFjdGl2aXR5KHN0YXRlKTsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmUoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgbVJlbW92ZUxpc3QuYWRkKHIuYmluZGVyKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhhbmRsZVJlbW92ZUxpc3RMb2NrZWQoKTsKICAgICAgICAgfQogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIG5vdGlmeURhdGFDb25uZWN0aW9uKGludCBzdGF0ZSwgYm9vbGVhbiBpc0RhdGFDb25uZWN0aXZpdHlQb3NzaWJsZSwKLSAgICAgICAgICAgIFN0cmluZyByZWFzb24sIFN0cmluZyBhcG4sIFN0cmluZ1tdIGFwblR5cGVzLCBTdHJpbmcgaW50ZXJmYWNlTmFtZSwgaW50IG5ldHdvcmtUeXBlLAotICAgICAgICAgICAgU3RyaW5nIGdhdGV3YXkpIHsKKyAgICAgICAgICAgIFN0cmluZyByZWFzb24sIFN0cmluZyBhcG4sIFN0cmluZyBhcG5UeXBlLCBMaW5rUHJvcGVydGllcyBsaW5rUHJvcGVydGllcywKKyAgICAgICAgICAgIExpbmtDYXBhYmlsaXRpZXMgbGlua0NhcGFiaWxpdGllcywgaW50IG5ldHdvcmtUeXBlKSB7CiAgICAgICAgIGlmICghY2hlY2tOb3RpZnlQZXJtaXNzaW9uKCJub3RpZnlEYXRhQ29ubmVjdGlvbigpIiApKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgU2xvZy5pKFRBRywgIm5vdGlmeURhdGFDb25uZWN0aW9uOiBzdGF0ZT0iICsgc3RhdGUgKyAiIGlzRGF0YUNvbm5lY3Rpdml0eVBvc3NpYmxlPSIKICAgICAgICAgICAgICAgICArIGlzRGF0YUNvbm5lY3Rpdml0eVBvc3NpYmxlICsgIiByZWFzb249IiArIHJlYXNvbgotICAgICAgICAgICAgICAgICsgIiBpbnRlcmZhY2VOYW1lPSIgKyBpbnRlcmZhY2VOYW1lICsgIiBuZXR3b3JrVHlwZT0iICsgbmV0d29ya1R5cGUpOworICAgICAgICAgICAgICAgICsgIiBhcG49IiArIGFwbiArICIgbmV0d29ya1R5cGU9IiArIG5ldHdvcmtUeXBlKTsKICAgICAgICAgc3luY2hyb25pemVkIChtUmVjb3JkcykgewotICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uU3RhdGUgPSBzdGF0ZTsKLSAgICAgICAgICAgIG1EYXRhQ29ubmVjdGlvblBvc3NpYmxlID0gaXNEYXRhQ29ubmVjdGl2aXR5UG9zc2libGU7Ci0gICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25SZWFzb24gPSByZWFzb247Ci0gICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25BcG4gPSBhcG47Ci0gICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25BcG5UeXBlcyA9IGFwblR5cGVzOwotICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uSW50ZXJmYWNlTmFtZSA9IGludGVyZmFjZU5hbWU7Ci0gICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25OZXR3b3JrVHlwZSA9IG5ldHdvcmtUeXBlOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1SZWNvcmRzLnNpemUoKSAtIDE7IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgICAgICAgICAgUmVjb3JkIHIgPSBtUmVjb3Jkcy5nZXQoaSk7Ci0gICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fREFUQV9DT05ORUNUSU9OX1NUQVRFKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByLmNhbGxiYWNrLm9uRGF0YUNvbm5lY3Rpb25TdGF0ZUNoYW5nZWQoc3RhdGUsIG5ldHdvcmtUeXBlKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmUoci5iaW5kZXIpOworICAgICAgICAgICAgYm9vbGVhbiBtb2RpZmllZCA9IGZhbHNlOworICAgICAgICAgICAgaWYgKHN0YXRlID09IFRlbGVwaG9ueU1hbmFnZXIuREFUQV9DT05ORUNURUQpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW1Db25uZWN0ZWRBcG5zLmNvbnRhaW5zKGFwblR5cGUpKSB7CisgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWRBcG5zLmFkZChhcG5UeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1EYXRhQ29ubmVjdGlvblN0YXRlICE9IHN0YXRlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25TdGF0ZSA9IHN0YXRlOworICAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZpZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtQ29ubmVjdGVkQXBucy5yZW1vdmUoYXBuVHlwZSk7CisgICAgICAgICAgICAgICAgaWYgKG1Db25uZWN0ZWRBcG5zLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25TdGF0ZSA9IHN0YXRlOworICAgICAgICAgICAgICAgICAgICBtb2RpZmllZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gbGVhdmUgbURhdGFDb25uZWN0aW9uU3RhdGUgYXMgaXMgYW5kCisgICAgICAgICAgICAgICAgICAgIC8vIHNlbmQgb3V0IHRoZSBuZXcgc3RhdHVzIGZvciB0aGUgQVBOIGluIHF1ZXN0aW9uLgorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1EYXRhQ29ubmVjdGlvblBvc3NpYmxlID0gaXNEYXRhQ29ubmVjdGl2aXR5UG9zc2libGU7CisgICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25SZWFzb24gPSByZWFzb247CisgICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25MaW5rUHJvcGVydGllcyA9IGxpbmtQcm9wZXJ0aWVzOworICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uTGlua0NhcGFiaWxpdGllcyA9IGxpbmtDYXBhYmlsaXRpZXM7CisgICAgICAgICAgICBpZiAobURhdGFDb25uZWN0aW9uTmV0d29ya1R5cGUgIT0gbmV0d29ya1R5cGUpIHsKKyAgICAgICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25OZXR3b3JrVHlwZSA9IG5ldHdvcmtUeXBlOworICAgICAgICAgICAgICAgIG1vZGlmaWVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtb2RpZmllZCkgeworICAgICAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgeworICAgICAgICAgICAgICAgICAgICBpZiAoKHIuZXZlbnRzICYgUGhvbmVTdGF0ZUxpc3RlbmVyLkxJU1RFTl9EQVRBX0NPTk5FQ1RJT05fU1RBVEUpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgci5jYWxsYmFjay5vbkRhdGFDb25uZWN0aW9uU3RhdGVDaGFuZ2VkKHN0YXRlLCBuZXR3b3JrVHlwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVtb3ZlTGlzdC5hZGQoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGhhbmRsZVJlbW92ZUxpc3RMb2NrZWQoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBicm9hZGNhc3REYXRhQ29ubmVjdGlvblN0YXRlQ2hhbmdlZChzdGF0ZSwgaXNEYXRhQ29ubmVjdGl2aXR5UG9zc2libGUsIHJlYXNvbiwgYXBuLAotICAgICAgICAgICAgICAgIGFwblR5cGVzLCBpbnRlcmZhY2VOYW1lLCBnYXRld2F5KTsKKyAgICAgICAgICAgICAgICBhcG5UeXBlLCBsaW5rUHJvcGVydGllcywgbGlua0NhcGFiaWxpdGllcyk7CiAgICAgfQogCi0gICAgcHVibGljIHZvaWQgbm90aWZ5RGF0YUNvbm5lY3Rpb25GYWlsZWQoU3RyaW5nIHJlYXNvbikgeworICAgIHB1YmxpYyB2b2lkIG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gICAgICAgfQogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtQ2VsbExvY2F0aW9uID0gY2VsbExvY2F0aW9uOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1SZWNvcmRzLnNpemUoKSAtIDE7IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgICAgICAgICAgUmVjb3JkIHIgPSBtUmVjb3Jkcy5nZXQoaSk7CisgICAgICAgICAgICBmb3IgKFJlY29yZCByIDogbVJlY29yZHMpIHsKICAgICAgICAgICAgICAgICBpZiAoKHIuZXZlbnRzICYgUGhvbmVTdGF0ZUxpc3RlbmVyLkxJU1RFTl9DRUxMX0xPQ0FUSU9OKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNlbmRDZWxsTG9jYXRpb24ociwgY2VsbExvY2F0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25DZWxsTG9jYXRpb25DaGFuZ2VkKG5ldyBCdW5kbGUoY2VsbExvY2F0aW9uKSk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVJlbW92ZUxpc3QuYWRkKHIuYmluZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgaGFuZGxlUmVtb3ZlTGlzdExvY2tlZCgpOwogICAgICAgICB9CiAgICAgfQogCi0gICAgLyoqCi0gICAgICogQ29weSB0aGUgc2VydmljZSBzdGF0ZSBvYmplY3Qgc28gdGhleSBjYW4ndCBtZXNzIGl0IHVwIGluIHRoZSBsb2NhbCBjYWxscwotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNlbmRTZXJ2aWNlU3RhdGUoUmVjb3JkIHIsIFNlcnZpY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Nocm9uaXplZCAobVJlY29yZHMpIHsKKyAgICAgICAgICAgIG1PdGFzcE1vZGUgPSBvdGFzcE1vZGU7CisgICAgICAgICAgICBmb3IgKFJlY29yZCByIDogbVJlY29yZHMpIHsKKyAgICAgICAgICAgICAgICBpZiAoKHIuZXZlbnRzICYgUGhvbmVTdGF0ZUxpc3RlbmVyLkxJU1RFTl9PVEFTUF9DSEFOR0VEKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICByLmNhbGxiYWNrLm9uT3Rhc3BDaGFuZ2VkKG90YXNwTW9kZSk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVJlbW92ZUxpc3QuYWRkKHIuYmluZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhhbmRsZVJlbW92ZUxpc3RMb2NrZWQoKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtNDY4LDExICs1MTcsMTEgQEAKICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbURhdGFDb25uZWN0aW9uUG9zc2libGU9IiArIG1EYXRhQ29ubmVjdGlvblBvc3NpYmxlKTsKICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbURhdGFDb25uZWN0aW9uUmVhc29uPSIgKyBtRGF0YUNvbm5lY3Rpb25SZWFzb24pOwogICAgICAgICAgICAgcHcucHJpbnRsbigiICBtRGF0YUNvbm5lY3Rpb25BcG49IiArIG1EYXRhQ29ubmVjdGlvbkFwbik7Ci0gICAgICAgICAgICBwdy5wcmludGxuKCIgIG1EYXRhQ29ubmVjdGlvbkludGVyZmFjZU5hbWU9IiArIG1EYXRhQ29ubmVjdGlvbkludGVyZmFjZU5hbWUpOworICAgICAgICAgICAgcHcucHJpbnRsbigiICBtRGF0YU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ICAgICAgICAgaWYgKGlmYWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoUGhvbmUuREFUQV9JRkFDRV9OQU1FX0tFWSwgaWZhY2UpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5EQVRBX0FQTl9UWVBFU19LRVksIHR5cGVzKTsKLSAgICAgICAgaW50ZW50LnB1dEV4dHJhKFBob25lLkRBVEFfSUZBQ0VfTkFNRV9LRVksIGludGVyZmFjZU5hbWUpOwotICAgICAgICBpbnQgZ2F0ZXdheUFkZHIgPSAwOwotICAgICAgICBpZiAoZ2F0ZXdheSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBnYXRld2F5QWRkciA9IE5ldHdvcmtVdGlscy52NFN0cmluZ1RvSW50KGdhdGV3YXkpOworICAgICAgICBpZiAobGlua0NhcGFiaWxpdGllcyAhPSBudWxsKSB7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoUGhvbmUuREFUQV9MSU5LX0NBUEFCSUxJVElFU19LRVksIGxpbmtDYXBhYmlsaXRpZXMpOwogICAgICAgICB9Ci0gICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5EQVRBX0dBVEVXQVlfS0VZLCBnYXRld2F5QWRkcik7Ci0KKyAgICAgICAgaW50ZW50LnB1dEV4dHJhKFBob25lLkRBVEFfQVBOX0tFWSwgYXBuKTsKKyAgICAgICAgaW50ZW50LnB1dEV4dHJhKFBob25lLkRBVEFfQVBOX1RZUEVfS0VZLCBhcG5UeXBlKTsKICAgICAgICAgbUNvbnRleHQuc2VuZFN0aWNreUJyb2FkY2FzdChpbnRlbnQpOwogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBicm9hZGNhc3REYXRhQ29ubmVjdGlvbkZhaWxlZChTdHJpbmcgcmVhc29uKSB7CisgICAgcHJpdmF0ZSB2b2lkIGJyb2FkY2FzdERhdGFDb25uZWN0aW9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lX2lmYWNlKTsKQEAgLTIxNCw3ICsyMjAsNyBAQAogICAgIH0KIAogICAgIHByaXZhdGUgbG9uZyBudHBUb1dhbGxUaW1lKGxvbmcgbnRwVGltZSkgewotICAgICAgICBsb25nIGJlc3ROb3cgPSBnZXRCZXN0VGltZSgpOworICAgICAgICBsb25nIGJlc3ROb3cgPSBnZXRCZXN0VGltZSh0cnVlKTsgLy8gZG8gaXQgcXVpY2tseQogICAgICAgICBsb25nIGxvY2FsTm93ID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7CiAgICAgICAgIHJldHVybiBsb2NhbE5vdyArIChudHBUaW1lIC0gYmVzdE5vdyk7CiAgICAgfQpAQCAtMjIyLDQwICsyMjgsNDIgQEAKICAgICAvLyBUT0RPIC0gZmV0Y2ggZm9yIHRoZSBpZmFjZQogICAgIC8vIHJldHVybiB0aW1lIGluIHRoZSBsb2NhbCwgc3lzdGVtIHdhbGwgdGltZSwgY29ycmVjdGluZyBmb3IgdGhlIHVzZSBvZiBudHAKIAotICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgbG9uZyBnZXRSZXNldFRpbWUoU3RyaW5nIGlmYWNlKSB7CisgICAgcHVibGljIGxvbmcgZ2V0UmVzZXRUaW1lKFN0cmluZyBpZmFjZSkgewogICAgICAgICBlbmZvcmNlQWNjZXNzUGVybWlzc2lvbigpOwogICAgICAgICBsb25nIHJlc2V0VGltZSA9IDA7CiAgICAgICAgIGlmIChtUmVjb3JkZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgcmVzZXRUaW1lID0gbnRwVG9XYWxsVGltZShtUmVjb3JkZXIuZ2V0UGVyaW9kRW5kKCkpOworICAgICAgICAgICAgcmVzZXRUaW1lID0gbVJlY29yZGVyLmdldFBlcmlvZEVuZCgpOwogICAgICAgICB9CisgICAgICAgIHJlc2V0VGltZSA9IG50cFRvV2FsbFRpbWUocmVzZXRUaW1lKTsKICAgICAgICAgcmV0dXJuIHJlc2V0VGltZTsKICAgIC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bnRleHQpOwogICAgIH0KIAogCkBAIC0zNzUsNyArMzgyLDcgQEAKICAgICAgICAgICAgIC8vIGNoZWNrIGZvciBzaW0gY2hhbmdlIFRPRE8KICAgICAgICAgICAgIC8vIHJlcmVnaXN0ZXIgZm9yIG5vdGlmaWNhdGlvbiBvZiBwb2xpY3kgY2hhbmdlCiAKLSAgICAgICAgICAgIG1UaHJvdHRsZUluZGV4ID0gVEhST1RUTEVfSU5ERVhfVU5JTklUSUFMSVpFRDsKKyAgICAgICAgICAgIG1UaHJvdHRsZUluZGV4LnNldChUSFJPVFRMRV9JTkRFWF9VTklOSVRJQUxJWkVEKTsKIAogICAgICAgICAgICAgbVJlY29yZGVyID0gbmV3IERhdGFSZWNvcmRlcihtQ29udGV4dCwgVGhyb3R0bGVTZXJ2aWNlLnRoaXMpOwogCkBAIC00MDMsMTUgKzQxMCwxNiBAQAogICAgICAgICAgICAgICAgICAgICBSLmludGVnZXIuY29uZmlnX2RhdGF1c2VfdGhyZXNob2xkX2J5dGVzKTsKICAgICAgICAgICAgIGludCBkZWZhdWx0VmFsdWUgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRJbnRlZ2VyKAogICAgICAgICAgICAgICAgICAgICBSLmludGVnZXIuY29uZmlnX2RhdGF1c2VfdGhyb3R0bGVfa2JpdHNwcyk7Ci0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKFRocm90dGxlU2VydmljZS50aGlzKSB7Ci0gICAgICAgICAgICAgICAgbVBvbGljeVRocmVzaG9sZCA9IFNldHRpbmdzLlNlY3VyZS5nZXRMb25nKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLlRIUk9UVExFX1RIUkVTSE9MRF9CWVRFUywgZGVmYXVsdFRocmVzaG9sZCk7Ci0gICAgICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUgPSBTZXR0aW5ncy5TZWN1cmUuZ2V0SW50KG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLlRIUk9UVExFX1ZBTFVFX0tCSVRTUFMsIGRlZmF1bHRWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRlc3RpbmcpIHsKLSAgICAgICAgICAgICAgICAgICAgbVBvbGljeVBvbGxQZXJpb2RTZWMgPSBURVNUSU5HX1BPTExJTkdfUEVSSU9EX1NFQzsKLSAgICAgICAgICAgICAgICAgICAgbVBvbGljeVRocmVzaG9sZCA9IFRFU1RJTkdfVEhSRVNIT0xEOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxvbmcgdGhyZXNob2xkID0gU2V0dGluZ3MuU2VjdXJlLmdldExvbmcobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5USFJPVFRMRV9USFJFU0hPTERfQllURVMsIGRlZmF1bHRUaHJlc2hvbGQpOworICAgICAgICAgICAgaW50IHZhbHVlID0gU2V0dGluZ3MuU2VjdXJlLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKKyAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLlRIUk9UVExFX1ZBTFVFX0tCSVRTUFMsIGRlZmF1bHRWYWx1ZSk7CisKKyAgICAgICAgICAgIG1Qb2xpY3lUaHJlc2hvbGQuc2V0KHRocmVzaG9sZCk7CisgICAgICAgICAgICBtUG9saWN5VGhyb3R0bGVWYWx1ZS5zZXQodmFsdWUpOworICAgICAgICAgICAgaWYgKHRlc3RpbmcpIHsKKyAgICAgICAgICAgICAgICBtUG9saWN5UG9sbFBlcmlvZFNlYyA9IFRFU1RJTkdfUE9MTElOR19QRVJJT0RfU0VDOworICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJlc2hvbGQuc2V0KFRFU1RJTkdfVEhSRVNIT0xEKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgbVBvbGljeVJlc2V0RGF5ID0gU2V0dGluZ3MuU2VjdXJlLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKQEAgLTQyMywxMCArNDMxLDggQEAKICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUucHV0SW50KG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAogICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5USFJPVFRMRV9SRVNFVF9EQVksIG1Qb2xpY3lSZXNldERheSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKFRocm90dGxlU2VydmljZS50aGlzKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1JZmFjZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJlc2hvbGQgPSAwOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtSWZhY2UgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJlc2hvbGQuc2V0KDApOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpbnQgZGVmYXVsdE5vdGlmaWNhdGlvblR5cGUgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRJbnRlZ2VyKApAQCAtNDM3LDE1ICs0NDMsMTYgQEAKICAgICAgICAgICAgIG1NYXhOdHBDYWNoZUFnZVNlYyA9IFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCiAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5USFJPVFRMRV9NQVhfTlRQX0NBQ0hFX0FHRV9TRUMsIE1BWF9OVFBfQ0FDSEVfQUdFX1NFQyk7CiAKLSAgICAgICAgICAgIGlmIChWREJHIHx8IChtUG9saWN5VGhyZXNob2xkICE9IDApKSB7CisgICAgICAgICAgICBpZiAoVkRCRyB8fCAobVBvbGljeVRocmVzaG9sZC5nZXQoKSAhPSAwKSkgewogICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJvblBvbGljeUNoYW5nZWQgdGVzdGluZz0iICsgdGVzdGluZyArIiwgcGVyaW9kPSIgKwotICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeVBvbGxQZXJpb2RTZWMgKyAiLCB0aHJlc2hvbGQ9IiArIG1Qb2xpY3lUaHJlc2hvbGQgKyAiLCB2YWx1ZT0iICsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJvdHRsZVZhbHVlICsgIiwgcmVzZXREYXk9IiArIG1Qb2xpY3lSZXNldERheSArICIsIG5vdGVUeXBlPSIgKwotICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeU5vdGlmaWNhdGlvbnNBbGxvd2VkTWFzayArICIsIG1heE50cENhY2hlQWdlPSIgKyBtTWF4TnRwQ2FjaGVBZ2VTZWMpOworICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeVBvbGxQZXJpb2RTZWMgKyAiLCB0aHJlc2hvbGQ9IiArIG1Qb2xpY3lUaHJlc2hvbGQuZ2V0KCkgKworICAgICAgICAgICAgICAgICAgICAgICAgIiwgdmFsdWU9IiArIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLmdldCgpICsgIiwgcmVzZXREYXk9IiArIG1Qb2xpY3lSZXNldERheSArCisgICAgICAgICAgICAgICAgICAgICAgICAiLCBub3RlVHlwZT0iICsgbVBvbGljeU5vdGlmaWNhdGlvbnNBbGxvd2VkTWFzayArICIsIG1heE50cENhY2hlQWdlPSIgKworICAgICAgICAgICAgICAgICAgICAgICAgbU1heE50cENhY2hlQWdlU2VjKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgLy8gZm9yY2UgdXBkYXRlcwotICAgICAgICAgICAgbVRocm90dGxlSW5kZXggPSBUSFJPVFRMRV9JTkRFWF9VTklOSVRJQUxJWkVEOworICAgICAgICAgICAgbVRocm90dGxlSW5kZXguc2V0KFRIUk9UVExFX0lOREVYX1VOSU5JVElBTElaRUQpOwogCiAgICAgICAgICAgICBvblJlc2V0QWxhcm0oKTsKIApAQCAtNDg3LDcgKzQ5NCw3IEBACiAgICAgICAgICAgICBsb25nIHBlcmlvZFJ4ID0gbVJlY29yZGVyLmdldFBlcmlvZFJ4KDApOwogICAgICAgICAgICAgbG9uZyBwZXJpb2RUeCA9IG1SZWNvcmRlci5nZXRQZXJpb2RUeCgwKTsKICAgICAgICAgICAgIGxvbmcgdG90YWwgPSBwZXJpb2RSeCArIHBlcmlvZFR4OwotICAgICAgICAgICAgaWYgKFZEQkcgfHwgKG1Qb2xpY3lUaHJlc2hvbGQgIT0gMCkpIHsKKyAgICAgICAgICAgIGlmIChWREJHIHx8IChtUG9saWN5VGhyZXNob2xkLmdldCgpICE9IDApKSB7CiAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIm9uUG9sbEFsYXJtIC0gcm9hbWluZyA9IiArIHJvYW1pbmcgKwogICAgICAgICAgICAgICAgICAgICAgICAgIiwgcmVhZCA9IiArIGluY1JlYWQgKyAiLCB3cml0dGVuID0iICsgaW5jV3JpdGUgKyAiLCBuZXcgdG90YWwgPSIgKyB0b3RhbCk7CiAgICAgICAgICAgICB9CkBAIC01MTAsMTEgKzUxNywxMSBAQAogICAgICAgICBwcml2YXRlIHZvaWQgb25JZmFjZVVwKCkgewogICAgICAgICAgICAgLy8gaWYgd2Ugd2VyZSB0aHJvdHRsZWQgYmVmb3JlLCBiZSBzdXJlIGFuZCBzZXQgaXQgYWdhaW4gLSB0aGUgaWZhY2Ugd2VudCBkb3duCiAgICAgICAgICAgICAvLyAoYW5kIG1heSBoYXZlIGRpc2FwcGVhcmVkIGFsbCB0b2dldGhlcikgYW5kIHRoZXNlIHNldHRpbmdzIHdlcmUgbG9zdAotICAgICAgICAgICAgaWYgKG1UaHJvdHRsZUluZGV4ID09IDEpIHsKKyAgICAgICAgICAgIGlmIChtVGhyb3R0bGVJbmRleC5nZXQoKSA9PSAxKSB7CiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgbU5NU2VydmljZS5zZXRJbnRlcmZhY2VUaHJvdHRsZShtSWZhY2UsIC0xLCAtMSk7CiAgICAgICAgICAgICAgICAgICAgIG1OTVNlcnZpY2Uuc2V0SW50ZXJmYWNlVGhyb3R0bGUobUlmYWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLCBtUG9saWN5VGhyb3R0bGVWYWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUuZ2V0KCksIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLmdldCgpKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiZXJyb3Igc2V0dGluZyBUaHJvdHRsZTogIiArIGUpOwogICAgICAgICAgICAgICAgIH0KQEAgLTUyMyw3ICs1MzAsOCBAQAogCiAgICAgICAgIHByaXZhdGUgdm9pZCBjaGVja1Rocm90dGxlQW5kUG9zdE5vdGlmaWNhdGlvbihsb25nIGN1cnJlbnRUb3RhbCkgewogICAgICAgICAgICAgLy8gaXMgdGhyb3R0bGluZyBlbmFibGVkPwotICAgICAgICAgICAgaWYgKG1Qb2xpY3lUaHJlc2hvbGQgPT0gMCkgeworICAgICAgICAgICAgbG9uZyB0aHJlc2hvbGQgPSBtUG9saWN5VGhyZXNob2xkLmdldCgpOworICAgICAgICAgICAgaWYgKHRocmVzaG9sZCA9PSAwKSB7CiAgICAgICAgICAgICAgICAgY2xlYXJUaHJvdHRsZUFuZE5vdGlmaWNhdGlvbigpOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KQEAgLTUzNSwxNSArNTQzLDEzIEBACiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHdlIG5lZWQgdG8gdGhyb3R0bGUKLSAgICAgICAgICAgIGlmIChjdXJyZW50VG90YWwgPiBtUG9saWN5VGhyZXNob2xkKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1UaHJvdHRsZUluZGV4ICE9IDEpIHsKLSAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChUaHJvdHRsZVNlcnZpY2UudGhpcykgewotICAgICAgICAgICAgICAgICAgICAgICAgbVRocm90dGxlSW5kZXggPSAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIFNsb2cuZChUQUcsICJUaHJlc2hvbGQgIiArIG1Qb2xpY3lUaHJlc2hvbGQgKyAiIGV4Y2VlZGVkISIpOworICAgICAgICAgICAgaWYgKGN1cnJlbnRUb3RhbCA+IHRocmVzaG9sZCkgeworICAgICAgICAgICAgICAgIGlmIChtVGhyb3R0bGVJbmRleC5nZXQoKSAhPSAxKSB7CisgICAgICAgICAgICAgICAgICAgIG1UaHJvdHRsZUluZGV4LnNldCgxKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgU2xvZy5kKFRBRywgIlRocmVzaG9sZCAiICsgdGhyZXNob2xkICsgIiBleGNlZWRlZCEiKTsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1OTVNlcnZpY2Uuc2V0SW50ZXJmYWNlVGhyb3R0bGUobUlmYWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUG9saWN5VGhyb3R0bGVWYWx1ZSwgbVBvbGljeVRocm90dGxlVmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUG9saWN5VGhyb3R0bGVWYWx1ZS5nZXQoKSwgbVBvbGljeVRocm90dGxlVmFsdWUuZ2V0KCkpOwogICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgImVycm9yIHNldHRpbmcgVGhyb3R0bGU6ICIgKyBlKTsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtNTU2LDcgKzU2Miw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTm90aWZpY2F0aW9uLkZMQUdfT05HT0lOR19FVkVOVCk7CiAKICAgICAgICAgICAgICAgICAgICAgSW50ZW50IGJyb2FkY2FzdCA9IG5ldyBJbnRlbnQoVGhyb3R0bGVNYW5hZ2VyLlRIUk9UVExFX0FDVElPTik7Ci0gICAgICAgICAgICAgICAgICAgIGJyb2FkY2FzdC5wdXRFeHRyYShUaHJvdHRsZU1hbmFnZXIuRVhUUkFfVEhST1RUTEVfTEVWRUwsIG1Qb2xpY3lUaHJvdHRsZVZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJvYWRjYXN0LnB1dEV4dHJhKFRocm90dGxlTWFuYWdlci5FWFRSQV9USFJPVFRMRV9MRVZFTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUG9saWN5VGhyb3R0bGVWYWx1ZS5nZXQoKSk7CiAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LnNlbmRTdGlja3lCcm9hZGNhc3QoYnJvYWRjYXN0KTsKIAogICAgICAgICAgICAgICAgIH0gLy8gZWxzZSBhbHJlYWR5IHVwIQpAQCAtNTc5LDggKzU4Niw4IEBACiAgICAgICAgICAgICAgICAgICAgIGxvbmcgcGVyaW9kTGVuZ3RoID0gZW5kIC0gc3RhcnQ7CiAgICAgICAgICAgICAgICAgICAgIGxvbmcgbm93ID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7CiAgICAgICAgICAgICAgICAgICAgIGxvbmcgdGltZVVzZWQgPSBub3cgLSBzdGFydDsKLSAgICAgICAgICAgICAgICAgICAgbG9uZyB3YXJuaW5nVGhyZXNob2xkID0gMiptUG9saWN5VGhyZXNob2xkKnRpbWVVc2VkLyh0aW1lVXNlZCtwZXJpb2RMZW5ndGgpOwotICAgICAgICAgICAgICAgICAgICBpZiAoKGN1cnJlbnRUb3RhbCA+IHdhcm5pbmdUaHJlc2hvbGQpICYmIChjdXJyZW50VG90YWwgPiBtUG9saWN5VGhyZXNob2xkLzQpKSB7CisgICAgICAgICAgICAgICAgICAgIGxvbmcgd2FybmluZ1RocmVzaG9sZCA9IDIqdGhyZXNob2xkKnRpbWVVc2VkLyh0aW1lVXNlZCtwZXJpb2RMZW5ndGgpOworICAgICAgICAgICAgICAgICAgICBpZiAoKGN1cnJlbnRUb3RhbCA+IHdhcm5pbmdUaHJlc2hvbGQpICYmIChjdXJyZW50VG90YWwgPiB0aHJlc2hvbGQvNCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtV2FybmluZ05vdGlmaWNhdGlvblNlbnQgPT0gZmFsc2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2FybmluZ05vdGlmaWNhdGlvblNlbnQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb25NYW5hZ2VyLmNhbmNlbChSLmRyYXdhYmxlLnN0YXRfc3lzX3Rocm90dGxlZCk7CkBAIC02MjUsMTEgKzYzMiw5IEBACiAgICAgICAgIH0KIAogCi0gICAgICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgY2xlYXJUaHJvdHRsZUFuZE5vdGlmaWNhdGlvbigpIHsKLSAgICAgICAgICAgIGlmIChtVGhyb3R0bGVJbmRleCAhPSBUSFJPVFRMRV9JTkRFWF9VTlRIUk9UVExFRCkgewotICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoVGhyb3R0bGVTZXJ2aWNlLnRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgbVRocm90dGxlSW5kZXggPSBUSFJPVFRMRV9JTkRFWF9VTlRIUk9UVExFRDsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgIHByaXZhdGUgdm9pZCBjbGVhclRocm90dGxlQW5kTm90aWZpY2F0aW9uKCkgeworICAgICAgICAgICAgaWYgKG1UaHJvdHRsZUluZGV4LmdldCgpICE9IFRIUk9UVExFX0lOREVYX1VOVEhST1RUTEVEKSB7CisgICAgICAgICAgICAgICAgbVRocm90dGxlSW5kZXguc2V0KFRIUk9UVExFX0lOREVYX1VOVEhST1RUTEVEKTsKICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICBtTk1TZXJ2aWNlLnNldEludGVyZmFjZVRocm90dGxlKG1JZmFjZSwgLTEsIC0xKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewpAQCAtNjg3LDEyICs2OTIsMTIgQEAKICAgICAgICAgfQogCiAgICAgICAgIHByaXZhdGUgdm9pZCBvblJlc2V0QWxhcm0oKSB7Ci0gICAgICAgICAgICBpZiAoVkRCRyB8fCAobVBvbGljeVRocmVzaG9sZCAhPSAwKSkgeworICAgICAgICAgICAgaWYgKFZEQkcgfHwgKG1Qb2xpY3lUaHJlc2hvbGQuZ2V0KCkgIT0gMCkpIHsKICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAib25SZXNldEFsYXJtIC0gbGFzdCBwZXJpb2QgaGFkICIgKyBtUmVjb3JkZXIuZ2V0UGVyaW9kUngoMCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIiBieXRlcyByZWFkIGFuZCAiICsgbVJlY29yZGVyLmdldFBlcmlvZFR4KDApICsgIiB3cml0dGVuIik7CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGxvbmcgbm93ID0gZ2V0QmVzdFRpbWUoKTsKKyAgICAgICAgICAgIGxvbmcgbm93ID0gZ2V0QmVzdFRpbWUoZmFsc2UpOwogCiAgICAgICAgICAgICBpZiAobU50cEFjdGl2ZSB8fCAobU50cFNlcnZl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gdGhlCisgICAgLy8gc2xvd2VyIG1ldGhvZCAoIWZhc3QpCisgICAgcHJpdmF0ZSBsb25nIGdldEJlc3RUaW1lKGJvb2xlYW4gZmFzdCkgewogICAgICAgICBpZiAobU50cFNlcnZlciAhPSBudWxsKSB7CiAgICAgICAgICAgICBpZiAobU50cEFjdGl2ZSkgewogICAgICAgICAgICAgICAgIGxvbmcgbnRwQWdlID0gU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCkgLSBjYWNoZWROdHBUaW1lc3RhbXA7Ci0gICAgICAgICAgICAgICAgaWYgKG50cEFnZSA8IG1NYXhOdHBDYWNoZUFnZVNlYyAqIDEwMDApIHsKKyAgICAgICAgICAgICAgICBpZiAobnRwQWdlIDwgbU1heE50cENhY2hlQWdlU2VjICogMTAwMCB8fCBmYXN0KSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChWREJHKSBTbG9nLnYoVEFHLCAidXNpbmcgY2FjaGVkIHRpbWUiKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhY2hlZE50cCArIG50cEFnZTsKICAgICAgICAgICAgICAgICB9CkBAIC0xMDI1LDM5ICsxMDMzLDU3IEBACiAgICAgICAgICAgICAgICAgaWYgKERCRykgU2xvZy5kKFRBRywgImRhdGEgZmlsZSBlbXB0eSIpOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVBhcmVudCkgewotICAgICAgICAgICAgICAgIFN0cmluZ1tdIHBhcnNlZCA9IGRhdGEuc3BsaXQoIjoiKTsKLSAgICAgICAgICAgICAgICBpbnQgcGFyc2VkVXNlZCA9IDA7Ci0gICAgICAgICAgICAgICAgaWYgKHBhcnNlZC5sZW5ndGggPCA2KSB7Ci0gICAgICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJyZWFkaW5nIGRhdGEgZmlsZSB3aXRoIGluc3VmZmljaWVudCBsZW5ndGggLSBpZ25vcmluZyIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgU3RyaW5nW10gcGFyc2VkID0gZGF0YS5zcGxpdCgiOiIpOworICAgICAgICAgICAgaW50IHBhcnNlZFVzZWQgPSAwOworICAgICAgICAgICAgaWYgKHBhcnNlZC5sZW5ndGggPCA2KSB7CisgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgInJlYWRpbmcgZGF0YSBmaWxlIHdpdGggaW5zdWZmaWNpZW50IGxlbmd0aCAtIGlnbm9yaW5nIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQogCisgICAgICAgICAgICBpbnQgcGVyaW9kQ291bnQ7CisgICAgICAgICAgICBsb25nW10gcGVyaW9kUnhEYXRhOworICAgICAgICAgICAgbG9uZ1tdIHBlcmlvZFR4RGF0YTsKKyAgICAgICAgICAgIGludCBjdXJyZW50UGVyaW9kOworICAgICAgICAgICAgQ2FsZW5kYXIgcGVyaW9kU3RhcnQ7CisgICAgICAgICAgICBDYWxlbmRhciBwZXJpb2RFbmQ7CisgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIGlmIChJbnRlZ2VyLnBhcnNlSW50KHBhcnNlZFtwYXJzZWRVc2VkKytdKSAhPSBEQVRBX0ZJTEVfVkVSU0lPTikgewogICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAicmVhZGluZyBkYXRhIGZpbGUgd2l0aCBiYWQgdmVyc2lvbiAtIGlnbm9yaW5nIik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBtUGVyaW9kQ291bnQgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnNlZFtwYXJzZWRVc2VkKytdKTsKLSAgICAgICAgICAgICAgICBpZiAocGFyc2VkLmxlbmd0aCAhPSA1ICsgKDIgKiBtUGVyaW9kQ291bnQpKSB7CisgICAgICAgICAgICAgICAgcGVyaW9kQ291bnQgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnNlZFtwYXJzZWRVc2VkKytdKTsKKyAgICAgICAgICAgICAgICBpZiAocGFyc2VkLmxlbmd0aCAhPSA1ICsgKDIgKiBwZXJpb2RDb3VudCkpIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgInJlYWRpbmcgZGF0YSBmaWxlIHdpdGggYmFkIGxlbmd0aCAoIiArIHBhcnNlZC5sZW5ndGggKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgIT0gIiArICg1KygyKm1QZXJpb2RDb3VudCkpICsgIikgLSBpZ25vcmluZyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgIT0gIiArICg1ICsgKDIgKiBwZXJpb2RDb3VudCkpICsgIikgLSBpZ25vcmluZyIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBlcmlvZFJ4RGF0YSA9IG5ldyBsb25nW3BlcmlvZENvdW50XTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHBlcmlvZENvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgcGVyaW9kUnhEYXRhW2ldID0gTG9uZy5wYXJzZUxvbmcocGFyc2VkW3BhcnNlZFVzZWQrK10pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwZXJpb2RUeERhdGEgPSBuZXcgbG9uZ1twZXJpb2RDb3VudF07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBwZXJpb2RDb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHBlcmlvZFR4RGF0YVtpXSA9IExvbmcucGFyc2VMb25nKHBhcnNlZFtwYXJzZWRVc2VkKytdKTsKKyAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBtUGVyaW9kUnhEYXRhID0gbmV3IGx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ID0gbmV3IEdyZWdvcmlhbkNhbGVuZGFyKCk7CisgICAgICAgICAgICAgICAgcGVyaW9kU3RhcnQuc2V0VGltZUluTWlsbGlzKExvbmcucGFyc2VMb25nKHBhcnNlZFtwYXJzZWRVc2VkKytdKSk7CisgICAgICAgICAgICAgICAgcGVyaW9kRW5kID0gbmV3IEdyZWdvcmlhbkNhbGVuZGFyKCk7CisgICAgICAgICAgICAgICAgcGVyaW9kRW5kLnNldFRpbWVJbk1pbGxpcyhMb25nLnBhcnNlTG9uZyhwYXJzZWRbcGFyc2VkVXNlZCsrXSkpOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRXJyb3IgcGFyc2luZyBkYXRhIGZpbGUgLSBpZ25vcmluZyIpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVBhcmVudCkgeworICAgICAgICAgICAgICAgIG1QZXJpb2RDb3VudCA9IHBlcmlvZENvdW50OworICAgICAgICAgICAgICAgIG1QZXJpb2RSeERhdGEgPSBwZXJpb2RSeERhdGE7CisgICAgICAgICAgICAgICAgbVBlcmlvZFR4RGF0YSA9IHBlcmlvZFR4RGF0YTsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFBlcmlvZCA9IGN1cnJlbnRQZXJpb2Q7CisgICAgICAgICAgICAgICAgbVBlcmlvZFN0YXJ0ID0gcGVyaW9kU3RhcnQ7CisgICAgICAgICAgICAgICAgbVBlcmlvZEVuZCA9IHBlcmlvZEVuZDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC0xMDkxLDE1ICsxMTE3LDE1IEBACiAgICAgICAgIH0KICAgICAgICAgcHcucHJpbnRsbigpOwogCi0gICAgICAgIHB3LnByaW50bG4oIlRoZSB0aHJlc2hvbGQgaXMgIiArIG1Qb2xpY3lUaHJlc2hvbGQgKworICAgICAgICBwdy5wcmludGxuKCJUaGUgdGhyZXNob2xkIGlzICIgKyBtUG9saWN5VGhyZXNob2xkLmdldCgpICsKICAgICAgICAgICAgICAgICAiLCBhZnRlciB3aGljaCB5b3UgZXhwZXJpbmNlIHRocm90dGxpbmcgdG8gIiArCi0gICAgICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUgKyAia2JwcyIpOworICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLmdldCgpICsgImticHMiKTsKICAgICAgICAgcHcucHJpbnRsbigiQ3VycmVudCBwZXJpb2QgaXMgIiArCiAgICAgICAgICAgICAgICAgKG1SZWNvcmRlci5nZXRQZXJpb2RFbmQoKSAtIG1SZWNvcmRlci5nZXRQZXJpb2RTdGFydCgpKS8xMDAwICsgIiBzZWNvbmRzIGxvbmcgIiArCiAgICAgICAgICAgICAgICAgImFuZCBlbmRzIGluICIgKyAoZ2V0UmVzZXRUaW1lKG1JZmFjZSkgLSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSkgLyAxMDAwICsKICAgICAgICAgICAgICAgICAiIHNlY29uZHMuIik7CiAgICAgICAgIHB3LnByaW50bG4oIlBvbGxpbmcgZXZlcnkgIiArIG1Qb2xpY3lQb2xsUGVyaW9kU2VjICsgIiBzZWNvbmRzIik7Ci0gICAgICAgIHB3LnByaW50bG4oIkN1cnJlbnQgVGhyb3R0bGUgSW5kZXggaXMgIiArIG1UaHJvdHRsZUluZGV4KTsKKyAgICAgICAgcHcucHJpbnRsbigiQ3VycmVudCBUaHJvdHRsZSBJbmRleCBpcyAiICsgbVRocm90dGxlSW5kZXguZ2V0KCkpOwogICAgICAgICBwdy5wcmludGxuKCJNYXggTlRQIENhY2hlIEFnZSBpcyAiICsgbU1heE50cENhY2hlQWdlU2VjKTsKIAogICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1SZWNvcmRlci5nZXRQZXJpb2RDb3VudCgpOyBpKyspIHsKZGlmZiAtLWdpdC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GhhbiBzY2FubmluZywgd2UgcmVzZXQgdGhpcyB0byAwLgorICAgICAqLworICAgIHByaXZhdGUgaW50IG1OdW1TY2Fuc1NpbmNlTmV0d29ya1N0YXRlQ2hhbmdlOworCisgICAgLyoqCisgICAgICogQXN5bmNocm9ub3VzIGNoYW5uZWwgdG8gV2lmaVN0YXRlTWFjaGluZQorICAgICAqLworICAgIHByaXZhdGUgQXN5bmNDaGFubmVsIG1DaGFubmVsOworCisgICAgLyoqCisgICAgICogVE9ETzogUG9zc2libHkgY2hhbmdlIFdpZmlTZXJ2aWNlIGludG8gYW4gQXN5bmNTZXJ2aWNlLgorICAgICAqLworICAgIHByaXZhdGUgY2xhc3MgV2lmaVNlcnZpY2VIYW5kbGVyIGV4dGVuZHMgSGFuZGxlciB7CisgICAgICAgIHByaXZhdGUgQXN5bmNDaGFubmVsIG1Xc2hDaGFubmVsOworCisgICAgICAgIFdpZmlTZXJ2aWNlSGFuZGxlcihhbmRyb2lkLm9zLkxvb3BlciBsb29wZXIsIENvbnRleHQgY29udGV4dCkgeworICAgICAgICAgICAgc3VwZXIobG9vcGVyKTsKKyAgICAgICAgICAgIG1Xc2hDaGFubmVsID0gbmV3IEFzeW5jQ2hhbm5lbCgpOworICAgICAgICAgICAgbVdzaENoYW5uZWwuY29ubmVjdChjb250ZXh0LCB0aGlzLCBtV2lmaVN0YXRlTWFjaGluZS5nZXRIYW5kbGVyKCksIDApOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIEFzeW5jQ2hhbm5lbC5DTURfQ0hBTk5FTF9IQUxGX0NPTk5FQ1RFRDogeworICAgICAgICAgICAgICAgICAgICBpZiAobXNnLmFyZzEgPT0gQXN5bmNDaGFubmVsLlNUQVRVU19TVUNDRVNTRlVMKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ2hhbm5lbCA9IG1Xc2hDaGFubmVsOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIldpZmlTZXJ2aWNlaGFuZGxlci5oYW5kbGVNZXNzYWdlIGNvdWxkIG5vdCBjb25uZWN0IGVycm9yPSIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cuYXJnMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ2hhbm5lbCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OiB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJXaWZpU2VydmljZWhhbmRsZXIuaGFuZGxlTWVzc2FnZSBpZ25vcmluZyBtc2c9IiArIG1zZyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBXaWZpU2VydmljZUhhbmRsZXIgbUhhbmRsZXI7CiAKLSAgICAgICAgSGFuZGxlclRocmVhZCB3aWZpVGhyZWFkID0gbmV3IEhhbmRsZXJUaHJlYWQoIldpZmlTZXJ2aWNlIik7Ci0gICAgICAgIHdpZmlUaHJlYWQuc3RhcnQoKTsKLSAgICAgICAgbVdpZmlIYW5kbGVyID0gbmV3IFdpZmlIYW5kbGVyKHdpZmlUaHJlYWQuZ2V0TG9vcGVyKCkpOworICAgIC8qKgorICAgICAqIFRlbXBvcmFyeSBmb3IgY29tcHV0aW5nIFVJRFMgdGhhdCBhcmUgcmVzcG9uc2libGUgZm9yIHN0YXJ0aW5nIFdJRkkuCisgICAgICogUHJvdGVjdGVkIGJ5IG1XaWZpU3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gICAgICAgICAgICAgICAgbUFpcnBsYW5lTW9kZU92ZXJ3cmlkZGVuLnNldChmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiBhaXJwbGFuZSBkaXNhYmxlLCByZXN0b3JlIFdpZmkgaWYgdGhlIHNhdmVkIHN0YXRlIGluZGljYXRlcyBzbwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0FpcnBsYW5lTW9kZU9uKCkgJiYgdGVzdEFuZENsZWFyV2lmaVNhdmVkU3RhdGUoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlcnNpc3RXaWZpRW5hYmxlZCh0cnVlKTsKQEAgLTI3MSwxNCArMjgyLDUwIEBACiAgICAgICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgewogCi0gICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBhdmFpbGFibGUgPSBpbnRlbnQuZ2V0U3RyaW5nQXJyYXlMaXN0RXh0cmEoCi0gICAgICAgICAgICAgICAgICAgICAgICAgIENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfQVZBSUxBQkxFX1RFVEhFUik7Ci0gICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBhY3RpdmUgPSBpbnRlbnQuZ2V0U3RyaW5nQXJyYXlMaXN0RXh0cmEoCi0gICAgICAgICAgICAgICAgICAgICAgICAgIENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfQUNUSVZFX1RFVEhFUik7Ci0gICAgICAgICAgICAgICAgICB1cGRhdGVUZXRoZXJTdGF0ZShhdmFpbGFibGUsIGFjdGl2ZSk7CisgICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IGF2YWlsYWJsZSA9IGludGVudC5nZXRTdHJpbmdBcnJheUxpc3RFeHRyYSgKK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ICAgICAgICAgICAgICAgICBpZiAoaW50ZW50LmdldEFjdGlvbigpLmVxdWFscyhXaWZpTWFuYWdlci5XSUZJX1NUQVRFX0NIQU5HRURfQUNUSU9OKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlc2V0ICYgY2xlYXIgbm90aWZpY2F0aW9uIG9uIGFueSB3aWZpIHN0YXRlIGNoYW5nZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0Tm90aWZpY2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGludGVudC5nZXRBY3Rpb24oKS5lcXVhbHMoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlNYW5hZ2VyLk5FVFdPUktfU1RBVEVfQ0hBTkdFRF9BQ1RJT04pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5ldHdvcmtJbmZvID0gKE5ldHdvcmtJbmZvKSBpbnRlbnQuZ2V0UGFyY2VsYWJsZUV4dHJhKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2lmaU1hbmFnZXIuRVhUUkFfTkVUV09SS19JTkZPKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXNldCAmIGNsZWFyIG5vdGlmaWNhdGlvbiBvbiBhIG5ldHdvcmsgY29ubmVjdCAmIGRpc2Nvbm5lY3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2gobU5ldHdvcmtJbmZvLmdldERldGFpbGVkU3RhdGUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNURUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNldE5vdGlmaWNhdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnRlbnQuZ2V0QWN0aW9uKCkuZXF1YWxzKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaWZpTWFuYWdlci5TQ0FOX1JFU1VMVFNfQVZBSUxBQkxFX0FDVElPTikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja0FuZFNldE5vdGlmaWNhdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgZmlsdGVyKTsKKworICAgICAgICAvLyBTZXR0aW5nIGlzIGluIHNlY29uZHMKKyAgICAgICAgTk9USUZJQ0FUSU9OX1JFUEVBVF9ERUxBWV9NUyA9IFNldHRpbmdzLlNlY3VyZS5nZXRJbnQoY29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKKyAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuV0lGSV9ORVRXT1JLU19BVkFJTEFCTEVfUkVQRUFUX0RFTEFZLCA5MDApICogMTAwMGw7CisgICAgICAgIG1Ob3RpZmljYXRpb25FbmFibGVkU2V0dGluZ09ic2VydmVyID0gbmV3IE5vdGlmaWNhdGlvbkVuYWJsZWRTZXR0aW5nT2JzZXJ2ZXIobmV3IEhhbmRsZXIoKSk7CisgICAgICAgIG1Ob3RpZmljYXRpb25FbmFibGVkU2V0dGluZ09ic2VydmVyLnJlZ2lzdGVyKCk7CiAgICAgfQogCiAgICAgLyoqCkBAIC0yODcsNyArMzM0LDcgQEAKICAgICAgKgogICAgICAqIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBvbmx5IGF0IGJvb3QgdGltZQogICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHN0YXJ0V2lmaSgpIHsKKyAgICBwdWJsaWMgdm9pZCBjaGVja0FuZFN0YXJ0V2lmaSgpIHsKICAgICAgICA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ICAgICAgICAgICAgICAgICAgICBpZmNnLmlwQWRkciA9ICgxOTIgPDwgMjQpICsgKDE2OCA8PCAxNikgKyAoNDMgPDwgOCkgKyAxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmY2cubmV0bWFzayA9ICgyNTUgPDwgMjQpICsgKDI1NSA8PCAxNikgKyAoMjU1IDw8IDgpICsgMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZmNnLmludGVyZmFjZUZsYWdzID0gInVwIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZmNnLmludGVyZmFjZUZsYWdzID0gIlt1cF0iOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VydmljZS5zZXRJbnRlcmZhY2VDb25maWcoaW50ZiwgaWZjZyk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRXJyb3IgY29uZmlndXJpbmcgaW50ZXJmYWNlICIgKyBpbnRmICsgIiwgOiIgKyBlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbndTZXJ2aWNlLnN0b3BBY2Nlc3NQb2ludCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGVlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIkNvdWxkIG5vdCBzdG9wIEFQLCA6IiArIGVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHNldFdpZmlBcEVuYWJsZWRTdGF0ZShXSUZJX0FQX1NUQVRFX0ZBSUxFRCwgMCwgRHJpdmVyQWN0aW9uLkRSSVZFUl9VTkxPQUQpOworICAgICAgICAgICAgICAgICAgICAgICAgc2V0V2lmaUFwRW5hYmxlZChudWxsLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICBpZihtQ20udGV0aGVyKGludGYpICE9IENvbm5lY3Rpdml0eU1hbmFnZXIuVEVUSEVSX0VSUk9SX05PX0VSUk9SKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRXJyb3IgdGV0aGVyaW5nICIraW50Zik7CisgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRXJyb3IgdGV0aGVyaW5nIG9uICIgKyBpbnRmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldFdpZmlBcEVuYWJsZWQobnVsbCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KQEAgLTM3MCwxOCArNDE3LDE4IEBACiAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5wdXRJbnQoY3IsIFNldHRpbmdzLlNlY3VyZS5XSUZJX09OLCBlbmFibGVkID8gMSA6IDApOwogICAgIH0KIAotICAgIE5ldHdvcmtTdGF0ZVRyYWNrZXIgZ2V0TmV0d29ya1N0YXRlVHJhY2tlcigpIHsKLSAgICAgICAgcmV0dXJuIG1XaWZpU3RhdGVUcmFja2VyOwotICAgIH0KLQogICAgIC8qKgogICAgICAqIHNlZSB7QGxpbmsgYW5kcm9pZC5uZXQud2lmaS5XaWZpTWFuYWdlciNwaW5nU3VwcGxpY2FudCgpfQotICAgICAqIEByZXR1cm4ge0Bjb2RlIHRydWV9IGlmIHRoZSBvcGVyYXRpb24gc3VjY2VlZHMKKyAgICAgKiBAcmV0dXJuIHtAY29kZSB0cnVlfSBpZiB0aGUgb3BlcmF0aW9uIHN1Y2NlZWRzLCB7QGN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UoV0lGSV9TVEFURV9VTktOT1dOLCB1aWQpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgc2V0V2lmaUVuYWJsZWRTdGF0ZShlbmFibGUgPyBXSUZJX1NUQVRFX0VOQUJMSU5HIDogV0lGSV9TVEFURV9ESVNBQkxJTkcsIHVpZCk7Ci0KLSAgICAgICAgaWYgKGVuYWJsZSkgewotICAgICAgICAgICAgaWYgKCFtV2lmaVN0YXRlVHJhY2tlci5sb2FkRHJpdmVyKCkpIHsKLSAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRmFpbGVkIHRvIGxvYWQgV2ktRmkgZHJpdmVyLiIpOwotICAgICAgICAgICAgICAgIHNldFdpZmlFbmFibGVkU3RhdGUoV0lGSV9TVEFURV9VTktOT1dOLCB1aWQpOwotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghbVdpZmlTdGF0ZVRyYWNrZXIuc3RhcnRTdXBwbGljYW50KCkpIHsKLSAgICAgICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci51bmxvYWREcml2ZXIoKTsKLSAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRmFpbGVkIHRvIHN0YXJ0IHN1cHBsaWNhbnQgZGFlbW9uLiIpOwotICAgICAgICAgICAgICAgIHNldFdpZmlFbmFibGVkU3RhdGUoV0lGSV9TVEFURV9VTktOT1dOLCB1aWQpOwotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmVnaXN0ZXJGb3JCcm9hZGNhc3RzKCk7Ci0gICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5zdGFydEV2ZW50TG9vcCgpOwotCi0gICAgICAgIH0gZWxzZSB7Ci0KLSAgICAgICAgICAgIG1Db250ZXh0LnVucmVnaXN0ZXJSZWNlaXZlcihtUmVjZW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3JVbmxvYWREcml2ZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgc2V0V2lmaUVuYWJsZWRTdGF0ZShXSUZJX1NUQVRFX1VOS05PV04sIHVpZCk7Ci0gICAgICAgICAgICAgICAgICAgIGZhaWxlZFRvU3RvcFN1cHBsaWNhbnRPclVubG9hZERyaXZlciA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZmFpbGVkVG9TdG9wU3VwcGxpY2FudE9yVW5sb2FkRHJpdmVyKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLy8gU3VjY2VzcyEKLQotICAgICAgICBpZiAocGVyc2lzdCkgewotICAgICAgICAgICAgcGVyc2lzdFdpZmlFbmFibGVkKGVuYWJsZSk7Ci0gICAgICAgIH0KLSAgICAgICAgc2V0V2lmaUVuYWJsZWRTdGF0ZShldmVudHVhbFdpZmlTdGF0ZSwgdWlkKTsKLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgcHJpdmF0ZSB2b2lkIHNldFdpZmlFbmFibGVkU3RhdGUoaW50IHdpZmlTdGF0ZSwgaW50IHVpZCkgewotICAgICAgICBmaW5hbCBpbnQgcHJldmlvdXNXaWZpU3RhdGUgPSBtV2lmaVN0YXRlVHJhY2tlci5nZXRXaWZpU3RhdGUoKTsKLQotICAgICAgICBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBpZiAod2lmaVN0YXRlID09IFdJRklfU1RBVEVfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgIG1CYXR0ZXJ5U3RhdHMubm90ZVdpZmlPbigpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh3aWZpU3RhdGUgPT0gV0lGSV9TVEFURV9ESVNBQkxFRCkg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WZpSGFuZGxlcikgewotCisgICAgICAgIGlmIChlbmFibGVkKSB7CisgICAgICAgICAgICAvKiBVc2UgZGVmYXVsdCBjb25maWcgaWYgdGhlcmUgaXMgbm8gZXhpc3RpbmcgY29uZmlnICovCisgICAgICAgICAgICBpZiAod2lmaUNvbmZpZyA9PSBudWxsICYmICgod2lmaUNvbmZpZyA9IGdldFdpZmlBcENvbmZpZ3VyYXRpb24oKSkgPT0gbnVsbCkpIHsKKyAgICAgICAgICAgICAgICB3aWZpQ29uZmlnID0gbmV3IFdpZmlDb25maWd1cmF0aW9uKCk7CisgICAgICAgICAgICAgICAgd2lmaUNvbmZpZy5TU0lEID0gbUNvbnRleHQuZ2V0U3RyaW5nKFIuc3RyaW5nLndpZmlfdGV0aGVyX2NvbmZpZ3VyZV9zc2lkX2RlZmF1bHQpOworICAgICAgICAgICAgICAgIHdpZmlDb25maWcuYWxsb3dlZEtleU1hbmFnZW1lbnQuc2V0KEtleU1nbXQuTk9ORSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogQ2FsbGVyIG1pZ2h0IG5vdCBoYXZlIFdSSVRFX1NFQ1VSRV9TRVRUSU5HUywKKyAgICAgICAgICAgICAqIG9ubHkgQ0hBTkdFX1dJRklfU1RBVEUgaXMgZW5mb3JjZWQKKyAgICAgICAgICAgICAqLwogICAgICAgICAgICAgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwotICAgICAgICAgICAgc1dha2VMb2NrLmFjcXVpcmUoKTsKKyAgICAgICAgICAgIHNldFdpZmlBcENvbmZpZ3VyYXRpb24od2lmaUNvbmZpZyk7CiAgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudCk7Ci0KLSAgICAgICAgICAgIG1MYXN0QXBFbmFibGVVaWQgPSBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpOwotICAgICAgICAgICAgc2VuZEFjY2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BydW5uaW5nIGFjY2VzcyBwb2ludCAqLwotICAgICAgICAgICAgaWYoZW5hYmxlICYmICh3aWZpQ29uZmlnICE9IG51bGwpKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgbndTZXJ2aWNlLnNldEFjY2Vzc1BvaW50KHdpZmlDb25maWcsIG1XaWZpU3RhdGVUcmFja2VyLmdldEludGVyZmFjZU5hbWUoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNPRlRBUF9JRkFDRSk7Ci0gICAgICAgICAgICAgICAgICAgIHNldFdpZmlBcENvbmZpZ3VyYXRpb24od2lmaUNvbmZpZyk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgICAgIH0gY2F0Y2goRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIkV4Y2VwdGlvbiBpbiBud1NlcnZpY2UgZHVyaW5nIEFQIHJlc3RhcnQiKTsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG53U2VydmljZS5zdG9wQWNjZXNzUG9pbnQoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGVlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiQ291bGQgbm90IHN0b3AgQVAsIDoiICsgZWUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHNldFdpZmlBcEVuYWJsZWRTdGF0ZShXSUZJX0FQX1NUQVRFX0ZBSUxFRCwgdWlkLCBEcml2ZXJBY3Rpb24uRFJJVkVSX1VOTE9BRCk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyoqCi0gICAgICAgICAqIEZhaWwgQVAgaWYgV2lmaSBpcyBlbmFibGVkCi0gICAgICAgICAqLwotICAgICAgICBpZiAoKG1XaWZpU3RhdGVUcmFja2VyLmdldFdpZmlTdGF0ZSgpID09IFdJRklfU1RBVEVfRU5BQkxFRCkgJiYgZW5hYmxlKSB7Ci0gICAgICAgICAgICBzZXRXaWZpQXBFbmFibGVkU3RhdGUoV0lGSV9BUF9TVEFURV9GQUlMRUQsIHVpZCwgRHJpdmVyQWN0aW9uLk5PX0RSSVZFUl9VTkxPQUQpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgc2V0V2lmaUFwRW5hYmxlZFN0YXRlKGVuYWJsZSA/IFdJRklfQVBfU1RBVEVfRU5BQkxJTkcgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0lGSV9BUF9TVEFURV9ESVNBQkxJTkcsIHVpZCwgRHJpdmVyQWN0aW9uLk5PX0RSSVZFUl9VTkxPQUQpOwotCi0gICAgICAgIGlmIChlbmFibGUpIHsKLQotICAgICAgICAgICAgLyogVXNlIGRlZmF1bHQgY29uZmlnIGlmIHRoZXJlIGlzIG5vIGV4aXN0aW5nIGNvbmZpZyAqLwotICAgICAgICAgICAgaWYgKHdpZmlDb25maWcgPT0gbnVsbCAmJiAoKHdpZmlDb25maWcgPSBnZXRXaWZpQXBDb25maWd1cmF0aW9uKCkpID09IG51bGwpKSB7Ci0gICAgICAgICAgICAgICAgd2lmaUNvbmZpZyA9IG5ldyBXaWZpQ29uZmlndXJhdGlvbigpOwotICAgICAgICAgICAgICAgIHdpZmlDb25maWcuU1NJRCA9IG1Db250ZXh0LmdldFN0cmluZyhSLnN0cmluZy53aWZpX3RldGhlcl9jb25maWd1cmVfc3NpZF9kZWZhdWx0KTsKLSAgICAgICAgICAgICAgICB3aWZpQ29uZmlnLmFsbG93ZWRLZXlNYW5hZ2VtZW50LnNldChLZXlNZ210Lk5PTkUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIW1XaWZpU3RhdGVUcmFja2VyLmxvYWREcml2ZXIoKSkgewotICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJGYWlsZWQgdG8gbG9hZCBXaS1GaSBkcml2ZXIgZm9yIEFQIG1vZGUiKTsKLSAgICAgICAgICAgICAgICBzZXRXaWZpQXBFbmFibGVkU3RhdGUoV0lGSV9BUF9TVEFURV9GQUlMRUQsIHVpZCwgRHJpdmVyQWN0aW9uLk5PX0RSSVZFUl9VTkxPQUQpOwotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBud1NlcnZpY2Uuc3RhcnRBY2Nlc3NQb2ludCh3aWZpQ29uZmlnLCBtV2lmaVN0YXRlVHJhY2tlci5nZXRJbnRlcmZhY2VOYW1lKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU09GVEFQX0lGQUNFKTsKLSAgICAgICAgICAgIH0gY2F0Y2goRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRXhjZXB0aW9uIGluIHN0YXJ0QWNjZXNzUG9pbnQoKSIpOwotICAgICAgICAgICAgICAgIHNldFdpZmlBcEVuYWJsZWRTdGF0ZShXSUZJX0FQX1NUQVRFX0ZBSUxFRCwgdWlkLCBEcml2ZXJBY3Rpb24uRFJJVkVSX1VOTE9BRCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzZXRXaWZpQXBDb25maWd1cmF0aW9uKHdpZmlDb25maWcpOwotCi0gICAgICAgIH0gZWxzZSB7Ci0KLSAgICAgICAgICAgIHRyeSB7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YWlsZWQgc3RhdGUKLSAgICAgICAgICovCi0gICAgICAgIGlmICgobVdpZmlBcFN0YXRlID09IFdJRklfQVBfU1RBVEVfRkFJTEVEKSAmJiAoZmxhZyA9PSBEcml2ZXJBY3Rpb24uRFJJVkVSX1VOTE9BRCkpIHsKLSAgICAgICAgICAgIG1XaWZpU3RhdGVUcmFja2VyLnVubG9hZERyaXZlcigpOwotICAgICAgICB9Ci0KLSAgICAgICAgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgaWYgKHdpZmlBUFN0YXRlID09IFdJRklfQVBfU1RBVEVfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgIG1CYXR0ZXJ5U3RhdHMubm90ZVdpZmlPbigpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh3aWZpQVBTdGF0ZSA9PSBXSUZJX0FQX1NUQVRFX0RJU0FCTEVEKSB7Ci0gICAgICAgICAgICAgICAgbUJhdHRlcnlTdGF0cy5ub3RlV2lmaU9mZigpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgQmluZGVyLnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnQpOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gVXBkYXRlIHN0YXRlCi0gICAgICAgIG1XaWZpQXBTdGF0ZSA9IHdpZmlBUFN0YXRlOwotCi0gICAgICAgIC8vIEJyb2FkY2FzdAotICAgICAgICBmaW5hbCBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChXaWZpTWFuYWdlci5XSUZJX0FQX1NUQVRFX0NIQU5HRURfQUNUSU9OKTsKLSAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWV9CRUZPUkVfQk9PVCk7Ci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gICAgICAgICAqLwotICAgICAgICBsaXN0U3RyID0gbVdpZmlTdGF0ZVRyYWNrZXIubGlzdE5ldHdvcmtzKCk7Ci0KLSAgICAgICAgTGlzdDxXaWZpQ29uZmlndXJhdGlvbj4gbmV0d29ya3MgPQotICAgICAgICAgICAgbmV3IEFycmF5TGlzdDxXaWZpQ29uZmlndXJhdGlvbj4oKTsKLSAgICAgICAgaWYgKGxpc3RTdHIgPT0gbnVsbCkKLSAgICAgICAgICAgIHJldHVybiBuZXR3b3JrczsKLQotICAgICAgICBTdHJpbmdbXSBsaW5lcyA9IGxpc3RTdHIuc3BsaXQoIlxuIik7Ci0gICAgICAgIC8vIFNraXAgdGhlIGZpcnN0IGxpbmUsIHdoaWNoIGlzIGEgaGVhZGVyCi0gICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPCBsaW5lcy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICBTdHJpbmdbXSByZXN1bHQgPSBsaW5lc1tpXS5zcGxpdCgiXHQiKTsKLSAgICAgICAgICAgLy8gbmV0d29yay1pZCB8IHNzaWQgfCBic3NpZCB8IGZsYWdzCi0gICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZyA9IG5ldyBXaWZpQ29uZmlndXJhdGlvbigpOwotICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgY29uZmlnLm5ldHdvcmtJZCA9IEludGVnZXIucGFyc2VJbnQocmVzdWx0WzBdKTsKLSAgICAgICAgICAgfSBjYXRjaChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgIH0KLSAgICAgICAgICAgaWYgKHJlc3VsdC5sZW5ndGggPiAzKSB7Ci0gICAgICAgICAgICAgICBpZiAocmVzdWx0WzNdLmluZGV4T2YoIltDVVJSRU5UXSIpICE9IC0xKQotICAgICAgICAgICAgICAgICAgIGNvbmZpZy5zdGF0dXMgPSBXaWZpQ29uZmlndXJhdGlvbi5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dHJ5IHsKLSAgICAgICAgICAgICAgICBjb25maWcud2VwVHhLZXlJbmRleCA9IEludGVnZXIucGFyc2VJbnQodmFsdWUpOwotICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGlnbm9yZSkgewotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogR2V0IHVwIHRvIDQgV0VQIGtleXMuIE5vdGUgdGhhdCB0aGUgYWN0dWFsIGtleXMgYXJlIG5vdCBwYXNzZWQgYmFjaywKLSAgICAgICAgICoganVzdCBhICIqIiBpZiB0aGUga2V5IGlzIHNldCwgb3IgdGhlIG51bGwgc3RyaW5nIG90aGVyd2lzZS4KLSAgICAgICAgICovCi0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgNDsgaSsrKSB7Ci0gICAgICAgICAgICB2YWx1ZSA9IG1XaWZpU3RhdGVUcmFja2VyLmdldE5ldHdvcmtWYXJpYWJsZShuZXRJZCwgV2lmaUNvbmZpZ3VyYXRpb24ud2VwS2V5VmFyTmFtZXNbaV0pOwotICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZSkpIHsKLSAgICAgICAgICAgICAgICBjb25maWcud2VwS2V5c1tpXSA9IHZhbHVlOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBjb25maWcud2VwS2V5c1tpXSA9IG51bGw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKgotICAgICAgICAgKiBHZXQgdGhlIHByaXZhdGUgc2hhcmVkIGtleS4gTm90ZSB0aGF0IHRoZSBhY3R1YWwga2V5cyBhcmUgbm90IHBhc3NlZCBiYWNrLAotICAgICAgICAgKiBqdXN0IGEgIioiIGlmIHRoZSBrZXkgaXMgc2V0LCBvciB0aGUgbnVsbCBzdHJpbmcgb3RoZXJ3aXNlLgotICAgICAgICAgKi8KLSAgICAgICAgdmFsdWUgPSBtV2lmaVN0YXRlVHJhY2tlci5nZXROZXR3b3JrVmFyaWFibGUobmV0SWQsIFdpZmlDb25maWd1cmF0aW9uLnBza1Zhck5hbWUpOwotICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgewotICAgICAgICAgICAgY29uZmlnLnByZVNoYXJlZEtleSA9IHZhbHVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgY29uZmlnLnByZVNoYXJlZEtleSA9IG51bGw7Ci0gICAgICAgIH0KLQotICAgICAgICB2YWx1ZSA9IG1XaWZpU3RhdGVUcmFja2VyLmdldE5ldHdvcmtWYXJpYWJsZShjb25maWcubmV0d29ya0lkLAotICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLlByb3RvY29sLnZhck5hbWUpOwotICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgewotICAgICAgICAgICAgU3RyaW5nIHZhbHNbXSA9IHZhbHVlLnNwbGl0KCIgIik7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyB2YWwgOiB2YWxzKSB7Ci0gICAgICAgICAgICAgICAgaW50IGluZGV4ID0KLSAgICAgICAgICAgICAgICAgICAgbG9va3VwU3RyaW5nKHZhbCwgV2lmaUNvbmZpZ3VyYXRpb24uUHJvdG9jb2wuc3RyaW5ncyk7Ci0gICAgICAgICAgICAgICAgaWYgKDAgPD0gaW5kZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgY29uZmlnLmFsbG93ZWRQcm90b2NvbHMuc2V0KGluZGV4KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICB2YWx1ZSA9IG1XaWZpU3RhdGVUcmFja2VyLmdldE5ldHdvcmtWYXJpYWJsZShjb25maWcubmV0d29ya0lkLAotICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLktleU1nbXQudmFyTmFtZSk7Ci0gICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7Ci0gICAgICAgICAgICBTdHJpbmcgdmFsc1tdID0gdmFsdWUuc3BsaXQoIiAiKTsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIHZhbCA6IHZhbHMpIHsKLSAgICAgICAgICAgICAgICBpbnQgaW5kZXggPQotICAgICAgICAgICAgICAgICAgICBsb29rdXBTdHJpbmcodmFsLCBXaWZpQ29uZmlndXJhdGlvbi5LZXlNZ210LnN0cmluZ3MpOwotICAgICAgICAgICAgICAgIGlmICgwIDw9IGluZGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5hbGxvd2VkS2V5TWFuYWdlbWVudC5zZXQoaW5kZXgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHZhbHVlID0gbVdpZmlTdGF0ZVRyYWNrZXIuZ2V0TmV0d29ya1ZhcmlhYmxlKGNvbmZpZy5uZXR3b3JrSWQsCi0gICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uQXV0aEFsZ29yaXRobS52YXJOYW1lKTsKLSAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZSkpIHsKLSAgICAgICAgICAgIFN0cmluZyB2YWxzW10gPSB2YWx1ZS5zcGxpdCgiICIpOwotICAgICAgICAgICAgZm9yIChTdHJpbmcgdmFsIDogdmFscykgewotICAgICAgICAgICAgICAgIGludCBpbmRleCA9Ci0gICAgICAgICAgICAgICAgICAgIGxvb2t1cFN0cmluZyh2YWwsIFdpZmlDb25maWd1cmF0aW9uLkF1dGhBbGdvcml0aG0uc3RyaW5ncyk7Ci0gICAgICAgICAgICAgICAgaWYgKDAgPD0gaW5kZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgY29uZmlnLmFsbG93ZWRBdXRoQWxnb3JpdGhtcy5zZXQoaW5kZXgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHZhbHVlID0gbVdpZmlTdGF0ZVRyYWNrZXIuZ2V0TmV0d29ya1ZhcmlhYmxlKGNvbmZpZy5uZXR3b3JrSWQsCi0gICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uUGFpcndpc2VDaXBoZXIudmFyTmFtZSk7Ci0gICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7Ci0gICAgICAgICAgICBTdHJpbmcgdmFsc1tdID0gdmFsdWUuc3BsaXQoIiAiKTsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIHZhbCA6IHZhbHMpIHsKLSAgICAgICAgICAgICAgICBpbnQgaW5kZXggPQotICAgICAgICAgICAgICAgICAgICBsb29rdXBTdHJpbmcodmFsLCBXaWZpQ29uZmlndXJhdGlvbi5QYWlyd2lzZUNpcGhlci5zdHJpbmdzKTsKLSAgICAgICAgICAgICAgICBpZiAoMCA8PSBpbmRleCkgewotICAgICAgICAgICAgICAgICAgICBjb25maWcuYWxsb3dlZFBhaXJ3aXNlQ2lwaGVycy5zZXQoaW5kZXgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHZhbHVlID0gbVdpZmlTdGF0ZVRyYWNrZXIuZ2V0TmV0d29ya1ZhcmlhYmxlKGNvbmZpZy5uZXR3b3JrSWQsCi0gICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uR3JvdXBDaXBoZXIudmFyTmFtZSk7Ci0gICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7Ci0gICAgICAgICAgICBTdHJpbmcgdmFsc1tdID0gdmFsdWUuc3BsaXQoIiAiKTsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIHZhbCA6IHZhbHMpIHsKLSAgICAgICAgICAgICAgICBpbnQgaW5kZXggPQotICAgICAgICAgICAgICAgICAgICBsb29rdXBTdHJpbmcodmFsLCBXaWZpQ29uZmlndXJhdGlvbi5Hcm91cENpcGhlci5zdHJpbmdzKTsKLSAgICAgICAgICAgICAgICBpZiAoMCA8PSBpbmRleCkgewotICAgICAgICAgICAgICAgICAgICBjb25maWcuYWxsb3dlZEdyb3VwQ2lwaGVycy5zZXQoaW5kZXgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoV2lmaUNvbmZpZ3VyYXRpb24uRW50ZXJwcmlzZUZpZWxkIGZpZWxkIDoKLSAgICAgICAgICAgICAgICBjb25maWcuZW50ZXJwcmlzZUZpZWxkcykgewotICAgICAgICAgICAgdmFsdWUgPSBtV2lmaVN0YXRlVHJhY2tlci5nZXROZXR3b3JrVmFyaWFibGUobmV0SWQsCi0gICAgICAgICAgICAgICAgICAgIGZpZWxkLnZhck5hbWUoKSk7Ci0gICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgewotICAgICAgICAgICAgICAgIGlmIChmaWVsZCAhPSBjb25maWcuZWFwKSB2YWx1ZSA9IHJlbW92ZURvdWJsZVF1b3Rlcyh2YWx1ZSk7Ci0gICAgICAgICAgICAgICAgZmllbGQuc2V0VmFsdWUodmFsdWUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIHJlbW92ZURvdWJsZVF1b3RlcyhTdHJpbmcgc3RyaW5nKSB7Ci0gICAgICAgIGlmIChzdHJpbmcubGVuZ3RoKCkgPD0gMikgcmV0dXJuICIiOwotICAgICAgICByZXR1cm4gc3RyaW5nLnN1YnN0cmluZygxLCBzdHJpbmcubGVuZ3RoKCkgLSAxKTsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgY29udmVydFRvUXVvdGVkU3RyaW5nKFN0cmluZyBzdHJpbmcpIHsKLSAgICAgICAgcmV0dXJuICJcIiIgKyBzdHJpbmcgKyAiXCIiOworICAgICAgICByZXR1cm4gbVdpZmlTdGF0ZU1hY2hpbmUuc3luY0dldENvbmZpZ3VyZWROZXR3b3JrcygpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMTAzMCwyODAgKzYzOSwxNSBAQAogICAgICAqLwogICAgIHB1YmxpYyBpbnQgYWRkT3JVcGRhdGVOZXR3b3JrKFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZykgewogICAgICAgICBlbmZvcmNlQ2hhbmdlUGVybWlzc2lvbigpOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIElmIHRoZSBzdXBwbGllZCBuZXR3b3JrSWQgaXMgLTEsIHdlIGNyZWF0ZSBhIG5ldyBlbXB0eQotICAgICAgICAgKiBuZXR3b3JrIGNvbmZpZ3VyYXRpb24uIE90aGVyd2lzZSwgdGhlIG5ldHdvcmtJZCBzaG91bGQKLSAgICAgICAgICogcmVmZXIgdG8gYW4gZXhpc3RpbmcgY29uZmlndXJhdGlvbi4KLSAgICAgICAgICovCi0gICAgICAgIGludCBuZXRJZCA9IGNvbmZpZy5uZXR3b3JrSWQ7Ci0gICAgICAgIGJvb2xlYW4gbmV3TmV0d29yayA9IG5ldElkID09IC0xOwotICAgICAgICBib29sZWFuIGRvUmVjb25maWcgPSBmYWxzZTsKLSAgICAgICAgLy8gbmV0d29ya0lkIG9mIC0xIG1lYW5zIHdlIHdhbnQgdG8gY3JlYXRlIGEgbmV3IG5ldHdvcmsKLSAgICAgICAgc3luY2hyb25pemVkIChtV2lmaVN0YXRlVHJhY2tlcikgewotICAgICAgICAgICAgaWYgKG5ld05ldHdvcmspIHsKLSAgICAgICAgICAgICAgICBuZXRJZCA9IG1XaWZpU3RhdGVUcmFja2VyLmFkZE5ldHdvcmsoKTsKLSAgICAgICAgICAgICAgICBpZiAobmV0SWQgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJGYWlsZWQgdG8gYWRkIGEgbmV0d29yayEiKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGRvUmVjb25maWcgPSB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbU5lZWRSZWNvbmZpZyA9IG1OZWVkUmVjb25maWcgfHwgZG9SZWNvbmZpZzsKKyAgICAgICAgaWYgKG1DaGFubmVsICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBtV2lmaVN0YXRlTWFjaGluZS5zeW5jQWRkT3JVcGRhdGVOZXR3b3JrKG1DaGFubmVsLCBjb25maWcpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgU2xvZy5lKFRBRywgIm1DaGFubmVsIGlzIG5vdCBpbml0aWFsaXplZCIpOworICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgICB9Ci0KLSAgICAgICAgc2V0VmFyaWFibGVzOiB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogTm90ZSB0aGF0IGlmIGEgbmV0d29ya0lkIGZvciBhIG5vbi1leGlzdGVudCBuZXR3b3JrCi0gICAgICAgICAgICAgKiB3YXMgc3VwcGxpZWQsIHRoZW4gdGhlIGZpcnN0IHNldE5ldHdvcmtWYXJpYWJsZSgpCi0gICAgICAgICAgICAgKiB3aWxsIGZhaWwsIHNvIHdlIGRvbid0IGJvdGhlciB0byBtYWtlIGEgc2VwYXJhdGUgY2hlY2sKLSAgICAgICAgICAgICAqIGZvciB0aGUgdmFsaWRpdHkgb2YgdGhlIElEIHVwIGZyb250LgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBpZiAoY29uZmlnLlNTSUQgIT0gbnVsbCAmJgotICAgICAgICAgICAgICAgICAgICAhbVdpZmlTdGF0ZVRyYWNrZXIuc2V0TmV0d29ya1ZhcmlhYmxlKAotICAgICAgICAgICAgICAgICAgICAgICAgbmV0SWQsCi0gICAgICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbi5zc2lkVmFyTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5TU0lEKSkgewotICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImZhaWxlZCB0byBzZXQgU1NJRDogIitjb25maWcuU1NJRCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGNvbmZpZy5CU1NJRCAhPSBudWxsICYmCi0gICAgICAgICAgICAgICAgICAgICFtV2lmaVN0YXRlVHJhY2tlci5zZXROZXR3b3JrVmFyaWFibGUoCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLmJzc2lkVmFyTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5CU1NJRCkpIHsKLSAgICAgICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJmYWlsZWQgdG8gc2V0IEJTU0lEOiAiK2NvbmZpZy5CU1NJRCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgU3RyaW5nIGFsbG93ZWRLZXlNYW5hZ2VtZW50U3RyaW5nID0KLSAgICAgICAgICAgICAgICBtYWtlU3RyaW5nKGNvbmZpZy5hbGxvd2VkS2V5TWFuYWdlbWVudCwgV2lmaUNvbmZpZ3VyYXRpb24uS2V5TWdtdC5zdHJpbmdzKTsKLSAgICAgICAgICAgIGlmIChjb25maWcuYWxsb3dlZEtleU1hbmFnZW1lbnQuY2FyZGluYWxpdHkoKSAhPSAwICYmCi0gICAgICAgICAgICAgICAgICAgICFtV2lmaVN0YXRlVHJhY2tlci5zZXROZXR3b3JrVmFyaWFibGUoCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLktleU1nbXQudmFyTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWRLZXlNYW5hZ2VtZW50U3RyaW5nKSkgewotICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImZhaWxlZCB0byBzZXQga2V5X21nbXQ6ICIrCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb3dlZEtleU1hbmFnZW1lbnRTdHJpbmcpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhayBzZXRWYXJpYWJsZXM7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIFN0cmluZyBhbGxvd2VkUHJvdG9jb2xzU3RyaW5nID0KLSAgICAgICAgICAgICAgICBtYWtlU3RyaW5nKGNvbmZpZy5hbGxvd2VkUHJvdG9jb2xzLCBXaWZpQ29uZmlndXJhdGlvbi5Qcm90b2NvbC5zdHJpbmdzKTsKLSAgICAgICAgICAgIGlmIChjb25maWcuYWxsb3dlZFByb3RvY29scy5jYXJkaW5hbGl0eSgpICE9IDAgJiYKLSAgICAgICAgICAgICAgICAgICAgIW1XaWZpU3RhdGVUcmFja2VyLnNldE5ldHdvcmtWYXJpYWJsZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldElkLAotICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uUHJvdG9jb2wudmFyTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWRQcm90b2NvbHNTdHJpbmcpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiZmFpbGVkIHRvIHNldCBwcm90bzogIisKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxvd2VkUHJvdG9jb2xzU3RyaW5nKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWsgc2V0VmFyaWFibGVzOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBTdHJpbmcgYWxsb3dlZEF1dGhBbGdvcml0aG1zU3RyaW5nID0KLSAgICAgICAgICAgICAgICBtYWtlU3RyaW5nKGNvbmZpZy5hbGxvd2VkQXV0aEFsZ29yaXRobXMsIFdpZmlDb25maWd1cmF0aW9uLkF1dGhBbGdvcml0aG0uc3RyaW5ncyk7Ci0gICAgICAgICAgICBpZiAoY29uZmlnLmFsbG93ZWRBdXRoQWxnb3JpdGhtcy5jYXJkaW5hbGl0eSgpICE9IDAgJiYKLSAgICAgICAgICAgICAgICAgICAgIW1XaWZpU3RhdGVUcmFja2VyLnNldE5ldHdvcmtWYXJpYWJsZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldElkLAotICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uQXV0aEFsZ29yaXRobS52YXJOYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgYWxsb3dlZEF1dGhBbGdvcml0aG1zU3RyaW5nKSkgewotICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImZhaWxlZCB0byBzZXQgYXV0aF9hbGc6ICIrCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb3dlZEF1dGhBbGdvcml0aG1zU3RyaW5nKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWsgc2V0VmFyaWFibGVzOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBTdHJpbmcgYWxsb3dlZFBhaXJ3aXNlQ2lwaGVyc1N0cmluZyA9Ci0gICAgICAgICAgICAgICAgbWFrZVN0cmluZyhjb25maWcuYWxsb3dlZFBhaXJ3aXNlQ2lwaGVycywgV2lmaUNvbmZpZ3VyYXRpb24uUGFpcndpc2VDaXBoZXIuc3RyaW5ncyk7Ci0gICAgICAgICAgICBpZiAoY29uZmlnLmFsbG93ZWRQYWlyd2lzZUNpcGhlcnMuY2FyZGluYWxpdHkoKSAhPSAwICYmCi0gICAgICAgICAgICAgICAgICAgICFtV2lmaVN0YXRlVHJhY2tlci5zZXROZXR3b3JrVmFyaWFibGUoCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLlBhaXJ3aXNlQ2lwaGVyLnZhck5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICBhbGxvd2VkUGFpcndpc2VDaXBoZXJzU3RyaW5nKSkgewotICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImZhaWxlZCB0byBzZXQgcGFpcndpc2U6ICIrCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb3dlZFBhaXJ3aXNlQ2lwaGVyc1N0cmluZyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgU3RyaW5nIGFsbG93ZWRHcm91cENpcGhlcnNTdHJpbmcgPQotICAgICAgICAgICAgICAgIG1ha2VTdHJpbmcoY29uZmlnLmFsbG93ZWRHcm91cENpcGhlcnMsIFdpZmlDb25maWd1cmF0aW9uLkdyb3VwQ2lwaGVyLnN0cmluZ3MpOwotICAgICAgICAgICAgaWYgKGNvbmZpZy5hbGxvd2VkR3JvdXBDaXBoZXJzLmNhcmRpbmFsaXR5KCkgIT0gMCAmJgotICAgICAgICAgICAgICAgICAgICAhbVdpZmlTdGF0ZVRyYWNrZXIuc2V0TmV0d29ya1ZhcmlhYmxlKAotICAgICAgICAgICAgICAgICAgICAgICAgbmV0SWQsCi0gICAgICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbi5Hcm91cENpcGhlci52YXJOYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgYWxsb3dlZEdyb3VwQ2lwaGVyc1N0cmluZykpIHsKLSAgICAgICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJmYWlsZWQgdG8gc2V0IGdyb3VwOiAiKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWRHcm91cENpcGhlcnNTdHJpbmcpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhayBzZXRWYXJpYWJsZXM7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIFByZXZlbnQgY2xpZW50IHNjcmV3LXVwIGJ5IHBhc3NpbmcgaW4gYSBXaWZpQ29uZmlndXJhdGlvbiB3ZSBnYXZlIGl0Ci0gICAgICAgICAgICAvLyBieSBwcmV2ZW50aW5nICIqIiBhcyBhIGtleS4KLSAgICAgICAgICAgIGlmIChjb25maWcucHJlU2hhcmVkS2V5ICE9IG51bGwgJiYgIWNvbmZpZy5wcmVTaGFyZWRLZXkuZXF1YWxzKCIqIikgJiYKLSAgICAgICAgICAgICAgICAgICAgIW1XaWZpU3RhdGVUcmFja2VyLnNldE5ldHdvcmtWYXJpYWJsZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldElkLAotICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24ucHNrVmFyTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5wcmVTaGFyZWRLZXkpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiZmFpbGVkIHRvIHNldCBwc2s6ICIrY29uZmlnLnByZVNoYXJlZEtleSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYm9vbGVhbiBoYXNTZXRLZXkgPSBmYWxzZTsKLSAgICAgICAgICAgIGlmIChjb25maWcud2VwS2V5cyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb25maWcud2VwS2V5cy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgICAgICAgICAvLyBQcmV2ZW50IGNsaWVudCBzY3Jldy11cCBieSBwYXNzaW5nIGluIGEgV2lmaUNvbmZpZ3VyYXRpb24gd2UgZ2F2ZSBpdAotICAgICAgICAgICAgICAgICAgICAvLyBieSBwcmV2ZW50aW5nICIqIiBhcyBhIGtleS4KLSAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy53ZXBLZXlzW2ldICE9IG51bGwgJiYgIWNvbmZpZy53ZXBLZXlzW2ldLmVxdWFscygiKiIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1XaWZpU3RhdGVUcmFja2VyLnNldE5ldHdvcmtWYXJpYWJsZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldElkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24ud2VwS2V5VmFyTmFtZXNbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcud2VwS2V5c1tpXSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImZhaWxlZCB0byBzZXQgd2VwX2tleSIraSsiOiAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcud2VwS2V5c1tpXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGhhc1NldEtleSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChoYXNTZXRLZXkpIHsKLSAgICAgICAgICAgICAgICBpZiAoIW1XaWZpU3RhdGVUcmFja2VyLnNldE5ldHdvcmtWYXJpYWJsZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbi53ZXBUeEtleUlkeFZhck5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50ZWdlci50b1N0cmluZyhjb25maWcud2VwVHhLZXlJbmRleCkpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJmYWlsZWQgdG8gc2V0IHdlcF90eF9rZXlpZHg6ICIrCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy53ZXBUeEtleUluZGV4KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhayBzZXRWYXJpYWJsZXM7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIW1XaWZpU3RhdGVUcmFja2VyLnNldE5ldHdvcmtWYXJpYWJsZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldElkLAotICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24ucHJpb3JpdHlWYXJOYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgSW50ZWdlci50b1N0cmluZyhjb25maWcucHJpb3JpdHkpKSkgewotICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgY29uZmlnLlNTSUQgKyAiOiBmYWlsZWQgdG8gc2V0IHByaW9yaXR5OiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgK2NvbmZpZy5wcmlvcml0eSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGNvbmZpZy5oaWRkZW5TU0lEICYmICFtV2lmaVN0YXRlVHJhY2tlci5zZXROZXR3b3JrVmFyaWFibGUoCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLmhpZGRlblNTSURWYXJOYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgSW50ZWdlci50b1N0cmluZyhjb25maWcuaGlkZGVuU1NJRCA/IDEgOiAwKSkpIHsKLSAgICAgICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsIGNvbmZpZy5TU0lEICsgIjogZmFpbGVkIHRvIHNldCBoaWRkZW5TU0lEOiAiKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5oaWRkZW5TU0lEKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWsgc2V0VmFyaWFibGVzOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmb3IgKFdpZmlDb25maWd1cmF0aW9uLkVudGVycHJpc2VGaWVsZCBmaWVsZAotICAgICAgICAgICAgICAgICAgICA6IGNvbmZpZy5lbnRlcnByaXNlRmllbGRzKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHZhck5hbWUgPSBmaWVsZC52YXJOYW1lKCk7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHZhbHVlID0gZmllbGQudmFsdWUoKTsKLSAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoZmllbGQgIT0gY29uZmlnLmVhcCkgewotICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSAodmFsdWUubGVuZ3RoKCkgPT0gMCkgPyAiTlVMTCIgOiBjb252ZXJ0VG9RdW90ZWRTdHJpbmcodmFsdWUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbVdpZmlTdGF0ZVRyYWNrZXIuc2V0TmV0d29ya1ZhcmlhYmxlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgY29uZmlnLlNTSUQgKyAiOiBmYWlsZWQgdG8gc2V0ICIgKyB2YXJOYW1lICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI6ICIgKyB2YWx1ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhayBzZXRWYXJpYWJsZXM7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9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sKLQotICAgICAgICBpbnQgbGluZUNvdW50ID0gMDsKLQotICAgICAgICBpbnQgcmVwbHlMZW4gPSByZXBseS5sZW5ndGgoKTsKLSAgICAgICAgLy8gUGFyc2UgdGhlIHJlc3VsdCBzdHJpbmcsIGtlZXBpbmcgaW4gbWluZCB0aGF0IHRoZSBsYXN0IGxpbmUgZG9lcwotICAgICAgICAvLyBub3QgZW5kIHdpdGggYSBuZXdsaW5lLgotICAgICAgICBmb3IgKGludCBsaW5lQmVnID0gMCwgbGluZUVuZCA9IDA7IGxpbmVFbmQgPD0gcmVwbHlMZW47ICsrbGluZUVuZCkgewotICAgICAgICAgICAgaWYgKGxpbmVFbmQgPT0gcmVwbHlMZW4gfHwgcmVwbHkuY2hhckF0KGxpbmVFbmQpID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICArK2xpbmVDb3VudDsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFNraXAgdGhlIGZpcnN0IGxpbmUsIHdoaWNoIGlzIGEgaGVhZGVyCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKGxpbmVDb3VudCA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxpbmVCZWcgPSBsaW5lRW5kICsgMTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChsaW5lRW5kID4gbGluZUJlZykgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbGluZSA9IHJlcGx5LnN1YnN0cmluZyhsaW5lQmVnLCBsaW5lRW5kKTsKLSAgICAgICAgICAgICAgICAgICAgU2NhblJlc3VsdCBzY2FuUmVzdWx0ID0gcGFyc2VTY2FuUmVzdWx0KGxpbmUpOwotICAgICAgICAgICAgICAgICAgICBpZiAoc2NhblJlc3VsdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzY2FuTGlzdC5hZGQoc2NhblJlc3VsdCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAibWlzZm9ybWF0dGVkIHNjYW4gcmVzdWx0IGZvcjogIiArIGxpbmUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGxpbmVCZWcgPSBsaW5lRW5kICsgMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5zZXRTY2FuUmVzdWx0c0xpc3Qoc2Nhbkxpc3QpOwotICAgICAgICByZXR1cm4gc2Nhbkxpc3Q7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogUGFyc2UgdGhlIHNjYW4gcmVzdWx0IGxpbmUgcGFzc2VkIHRvIHVzIGJ5IHdwYV9zdXBwbGljYW50IChoZWxwZXIpLgotICAgICAqIEBwYXJhbSBsaW5lIHRoZSBsaW5lIHRvIHBhcnNlCi0gICAgICogQHJldHVybiB0aGUge0BsaW5rIFNjYW5SZXN1bHR9IG9iamVjdAotICAgICAqLwotICAgIHByaXZhdGUgU2NhblJlc3VsdCBwYXJzZVNjYW5SZXN1bHQoU3RyaW5nIGxpbmUpIHsKLSAgICAgICAgU2NhblJlc3VsdCBzY2FuUmVzdWx0ID0gbnVsbDsKLSAgICAgICAgaWYgKGxpbmUgIT0gbnVsbCkgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIENhY2hlIGltcGxlbWVudGF0aW9uIChMaW5rZWRIYXNoTWFwKSBpcyBub3Qgc3luY2hyb25pemVkLCB0aHVzLAotICAgICAgICAgICAgICogbXVzdCBzeW5jaHJvbml6ZWQgaGVyZSEKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgc3luY2hyb25pemVkIChtU2NhblJlc3VsdENhY2hlKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nW10gcmVzdWx0ID0gc2NhblJlc3VsdFBhdHRlcm4uc3BsaXQobGluZSk7Ci0gICAgICAgICAgICAgICAgaWYgKDMgPD0gcmVzdWx0Lmxlbmd0aCAmJiByZXN1bHQubGVuZ3RoIDw9IDUpIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGJzc2lkID0gcmVzdWx0WzBdOwotICAgICAgICAgICAgICAgICAgICAvLyBic3NpZCB8IGZyZXF1ZW5jeSB8IGxldmVsIHwgZmxhZ3MgfCBzc2lkCi0gICAgICAgICAgICAgICAgICAgIGludCBmcmVxdWVuY3k7Ci0gICAgICAgICAgICAgICAgICAgIGludCBsZXZlbDsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZyZXF1ZW5jeSA9IEludGVnZXIucGFyc2VJbnQocmVzdWx0WzFdKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxldmVsID0gSW50ZWdlci5wYXJzZUludChyZXN1bHRbMl0pOwotICAgICAgICAgICAgICAgICAgICAgICAgLyogc29tZSBpbXBsZW1lbnRhdGlvbnMgYXZvaWQgbmVnYXRpdmUgdmFsdWVzIGJ5IGFkZGluZyAyNTYKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHNvIHdlIG5lZWQgdG8gYWRqdXN0IGZvciB0aGF0IGhlcmUuCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZXZlbCA+IDApIGxldmVsIC09IDI1NjsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZyZXF1ZW5jeSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsZXZlbCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBUaGUgZm9ybWF0dGluZyBvZiB0aGUgcmVzdWx0cyByZXR1cm5lZCBieQotICAgICAgICAgICAgICAgICAgICAgKiB3cGFfc3VwcGxpY2FudCBpcyBpbnRlbmRlZCB0byBtYWtlIHRoZSBmaWVsZHMKLSAgICAgICAgICAgICAgICAgICAgICogbGluZSB1cCBuaWNlbHkgd2hlbiBwcmludGVkLAotICAgICAgICAgICAgICAgICAgICAgKiBub3QgdG8gbWFrZSB0aGVtIGVhc3kgdG8gcGFyc2UuIFNvIHdlIGhhdmUgdG8KLSAgICAgICAgICAgICAgICAgICAgICogYXBwbHkgc29tZSBoZXVyaXN0aWNzIHRvIGZpZ3VyZSBvdXQgd2hpY2ggZmllbGQKLSAgICAgICAgICAgICAgICAgICAgICogaXMgdGhlIFNTSUQgYW5kIHdoaWNoIGZpZWxkIGlzIHRoZSBmbGFncy4KLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBzc2lkOwotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZmxhZ3M7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQubGVuZ3RoID09IDQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHRbM10uY2hhckF0KDApID09ICdbJykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzID0gcmVzdWx0WzNdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzaWQgPSAiIjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSAiIjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzc2lkID0gcmVzdWx0WzNdOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdC5sZW5ndGggPT0gNSkgewotICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSByZXN1bHRbM107Ci0gICAgICAgICAgICAgICAgICAgICAgICBzc2lkID0gcmVzdWx0WzRdOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gSGVyZSwgd2UgbXVzdCBoYXZlIDMgZmllbGRzOiBubyBmbGFncyBhbmQgc3NpZAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbGFncyA9ICIiOwotICAgICAgICAgICAgICAgICAgICAgICAgc3NpZCA9ICIiOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gYnNzaWQgKyBzc2lkIGlzIHRoZSBoYXNoIGtleQotICAgICAgICAgICAgICAgICAgICBTdHJpbmcga2V5ID0gYnNzaWQgKyBzc2lkOwotICAgICAgICAgICAgICAgICAgICBzY2FuUmVzdWx0ID0gbVNjYW5SZXN1bHRDYWNoZS5nZXQoa2V5KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHNjYW5SZXN1bHQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlc3VsdC5sZXZlbCA9IGxldmVsOwotICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlc3VsdC5TU0lEID0gc3NpZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjYW5SZXN1bHQuY2FwYWJpbGl0aWVzID0gZmxhZ3M7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzY2FuUmVzdWx0LmZyZXF1ZW5jeSA9IGZyZXF1ZW5jeTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvIG5vdCBhZGQgc2NhbiByZXN1bHRzIHRoYXQgaGF2ZSBubyBTU0lEIHNldAotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPCBzc2lkLnRyaW0oKS5sZW5ndGgoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYW5SZXN1bHQgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU2NhblJlc3VsdCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzaWQsIGJzc2lkLCBmbGFncywgbGV2ZWwsIGZyZXF1ZW5jeSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNjYW5SZXN1bHRDYWNoZS5wdXQoa2V5LCBzY2FuUmVzdWx0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJNaXNmb3JtYXR0ZWQgc2NhbiByZXN1bHQgdGV4dCB3aXRoICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQubGVuZ3RoICsgIiBmaWVsZHM6ICIgKyBsaW5lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc2NhblJlc3VsdDsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBQYXJzZSB0aGUgImZsYWdzIiBmaWVsZCBwYXNzZWQgYmFjayBpbiBhIHNjYW4gcmVzdWx0IGJ5IHdwYV9zdXBwbGljYW50LAotICAgICAqIGFuZCBjb25zdHJ1Y3QgYSB7QGNvZGUgV2lmaUNvbmZpZ3VyYXRpb259IHRoYXQgZGVzY3JpYmVzIHRoZSBlbmNyeXB0aW9uLAotICAgICAqIGtleSBtYW5hZ2VtZW50LCBhbmQgYXV0aGVudGljYWlvbiBjYXBhYmlsaXRpZXMgb2YgdGhlIGFjY2VzcyBwb2ludC4KLSAgICAgKiBAcGFyYW0gZmxhZ3MgdGhlIHN0cmluZyByZXR1cm5lZCBieSB3cGFfc3VwcGxpY2FudAotICAgICAqIEByZXR1cm4gdGhlIHtAbGluayBXaWZpQ29u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TsKLSAgICAgICAgICAgIGlmIChyZXN1bHQgJiYgbU5lZWRSZWNvbmZpZykgewotICAgICAgICAgICAgICAgIG1OZWVkUmVjb25maWcgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSBtV2lmaVN0YXRlVHJhY2tlci5yZWxvYWRDb25maWcoKTsKLQotICAgICAgICAgICAgICAgIGlmIChyZXN1bHQpIHsKLSAgICAgICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoV2lmaU1hbmFnZXIuTkVUV09SS19JRFNfQ0hBTkdFRF9BQ1RJT04pOwotICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQorICAgICAgICBpZiAobUNoYW5uZWwgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG1XaWZpU3RhdGVNYWNoaW5lLnN5bmNTYXZlQ29uZmlnKG1DaGFubmVsKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIFNsb2cuZShUQUcsICJtQ2hhbm5lbCBpcyBub3QgaW5pdGlhbGl6ZWQiKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQotICAgICAgICAvLyBJbmZvcm0gdGhlIGJhY2t1cCBtYW5hZ2VyIGFib3V0IGEgZGF0YSBjaGFuZ2UKLSAgICAgICAgSUJhY2t1cE1hbmFnZXIgaWJtID0gSUJhY2t1cE1hbmFnZXIuU3R1Yi5hc0ludGVyZmFjZSgKLSAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKENvbnRleHQuQkFDS1VQX1NFUlZJQ0UpKTsKLSAgICAgICAgaWYgKGlibSAhPSBudWxsKSB7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGlibS5kYXRhQ2hhbmdlZCgiY29tLmFuZHJvaWQucHJvdmlkZXJzLnNldHRpbmdzIik7Ci0gICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIC8vIFRyeSBhZ2FpbiBsYXRlcgotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiByZXN1bHQ7CiAgICAgfQogCiAgICAgLyoqCkBAIC0xNTU0LDcgKzc0OCw3IEBACiAgICAgICogQHJldHVybiB7QGNvZGUgdHJ1ZX0gaWYgdGhlIG9wZXJhdGlvbiBzdWNjZWVkcywge0Bjb2RlIGZhbHNlfSBvdGhlcndpc2UsIGUuZy4sCiAgICAgICoge0Bjb2RlIG51bUNoYW5uZWxzfSBpcyBvdXRzaWRlIHRoZSB2YWxpZCByYW5nZS4KICAgICAgKi8KLSAgICBwdWJsaWMgYm9vbGVhbiBzZXROdW1BbGxvd2VkQ2hhbm5lbHMoaW50IG51bUNoYW5uZWxzLCBib29sZWFuIHBlcnNpc3QpIHsKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gc2V0TnVtQWxsb3dlZENoYW5uZWxzKGludCBudW1DaGFubmVscywgYm9vbGVhbiBwZXJzaXN0KSB7CiAgICAgICAgIFNsb2cuaShUQUcsICJXaWZpU2VydmljZSB0cnlpbmcgdG8gc2V0TnVtQWxsb3dlZCB0byAiK251bUNoYW5uZWxzKwogICAgICAgICAgICAgICAgICIgd2l0aCBwZXJzaXN0IHNldCB0byAiK3BlcnNpc3QpOwogICAgICAgICBlbmZvcmNlQ2hhbmdlUGVybWlzc2lvbigpOwpAQCAtMTU3NiwyOCArNzcwLDE1IEBACiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KIAotICAgICAgICBpZiAobVdpZmlIYW5kbGVyID09IG51bGwpIHJldHVybiBmYWxzZTsKLQotICAgICAgICBNZXNzYWdlLm9idGFpbihtV2lmaUhhbmRsZXIsCi0gICAgICAgICAgICAgICAgTUVTU0FHRV9TRVRfQ0hBTk5F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sc2UpOworICAgIH0KKworCisgICAgLyoqCisgICAgICogc2VlIHtAbGluayBhbmRyb2lkLm5ldC53aWZpLldpZmlNYW5hZ2VyI2FkZFRvQmxhY2tsaXN0fQorICAgICAqCisgICAgICovCisgICAgcHVibGljIHZvaWQgYWRkVG9CbGFja2xpc3QoU3RyaW5nIGJzc2lkKSB7CisgICAgICAgIGVuZm9yY2VDaGFuZ2VQZXJtaXNzaW9uKCk7CisKKyAgICAgICAgbVdpZmlTdGF0ZU1hY2hpbmUuYWRkVG9CbGFja2xpc3QoYnNzaWQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIHNlZSB7QGxpbmsgYW5kcm9pZC5uZXQud2lmaS5XaWZpTWFuYWdlciNjbGVhckJsYWNrbGlzdH0KKyAgICAgKgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGNsZWFyQmxhY2tsaXN0KCkgeworICAgICAgICBlbmZvcmNlQ2hhbmdlUGVybWlzc2lvbigpOworCisgICAgICAgIG1XaWZpU3RhdGVNYWNoaW5lLmNsZWFyQmxhY2tsaXN0KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY29ubmVjdE5ldHdvcmtXaXRoSWQoaW50IG5ldHdvcmtJZCkgeworICAgICAgICBlbmZvcmNlQ2hhbmdlUGVybWlzc2lvbigpOworICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5jb25uZWN0TmV0d29yayhuZXR3b3JrSWQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNvbm5lY3ROZXR3b3JrV2l0aENvbmZpZyhXaWZpQ29uZmlndXJhdGlvbiBjb25maWcpIHsKKyAgICAgICAgZW5mb3JjZUNoYW5nZVBlcm1pc3Npb24oKTsKKyAgICAgICAgbVdpZmlTdGF0ZU1hY2hpbmUuY29ubmVjdE5ldHdvcmsoY29uZmlnKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzYXZlTmV0d29yayhXaWZpQ29uZmlndXJhdGlvbiBjb25maWcpIHsKKyAg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Bub3QgaW5pdGlhbGl6ZWQiKTsKKyAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIHByaXZhdGUgZmluYWwgQnJvYWRjYXN0UmVjZWl2ZXIgbVJlY2VpdmVyID0gbmV3IEJyb2FkY2FzdFJlY2VpdmVyKCkgewpAQCAtMTY1MSw3ICs5MjEsNyBAQAogCiAgICAgICAgICAgICBsb25nIGlkbGVNaWxsaXMgPQogICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5nZXRMb25nKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5XSUZJX0lETEVfTVMsIERFRkFVTFRfSURMRV9NSUxMSVMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5XSUZJX0lETEVfTVMsIERFRkFVTFRfSURMRV9NUyk7CiAgICAgICAgICAgICBpbnQgc3RheUF3YWtlQ29uZGl0aW9ucyA9CiAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU3lzdGVtLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlN5c3RlbS5TVEFZX09OX1dISUxFX1BMVUdHRURfSU4sIDApOwpAQCAtMTY2NSwxOSArOTM1LDE0IEBACiAgICAgICAgICAgICAgICAgLy8gT25jZSB0aGUgc2NyZWVuIGlzIG9uLCB3ZSBhcmUgbm90IGtlZXBpbmcgV0lGSSBydW5uaW5nCiAgICAgICAgICAgICAgICAgLy8gYmVjYXVzZSBvZiBhbnkgbG9ja3Mgc28gY2xlYXIgdGhhdCB0cmFja2luZyBpbW1lZGlhdGVseS4KICAgICAgICAgICAgICAgICByZXBvcnRTdGFydFdvcmtTb3VyY2UoKTsKLSAgICAgICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5lbmFibGVSc3NpUG9sbGluZyh0cnVlKTsKLSAgICAgICAgICAgICAgICAvKiBESENQIG9yIG90aGVyIHRlbXBvcmFyeSBmYWlsdXJlcyBpbiB0aGUgcGFzdCBjYW4gcHJldmVudAotICAgICAgICAgICAgICAgICAqIGEgZGlzYWJsZWQgbmV0d29yayBmcm9tIGJlaW5nIGNvbm5lY3RlZCB0bywgZW5hYmxlIG9uIHNjcmVlbiBvbgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGlmIChtV2lmaVN0YXRlVHJhY2tlci5pc0FueU5ldHdvcmtEaXNhYmxlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNlbmRFbmFibGVOZXR3b3Jrc01lc3NhZ2UoKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVdpZmlTdGF0ZU1hY2hpbmUuZW5hYmxlUnNzaVBvbGxpbmcodHJ1ZSk7CisgICAgICAgICAgICAgICAgdXBkYXRlV2lmaVN0YXRlKCk7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9TQ1JFRU5fT0ZGKSkgewogICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkFDVElPTl9TQ1JFRU5fT0ZGIik7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1TY3JlZW5PZmYgPSB0cnVlOwotICAgICAgICAgICAgICAgIG1XaWZpU3RhdGVUcmFja2VyLmVuYWJsZVJzc2lQb2xsaW5nKGZhbHNlKTsKKyAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5lbmFibGVSc3NpUG9sbGluZyhmYWxzZSk7CiAgICAgICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAgICAgKiBTZXQgYSB0aW1lciB0byBwdXQgV2ktRmkgd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0IGhhdmUgdGltZSB0byB0cmFjayBkb3duIGZvciB0aGlzIHJlbGVhc2UuICBEZWxheSBpbnN0ZWFkLAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnV0IG5vdCBhcyBsb25nIGFzIHdlIHdvdWxkIGlmIGNvbm5lY3RlZCAoYmVsb3cpCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIC0gZml4IHRoZSByYWNlIGNvbmRpdGlvbnMgYW5kIHN3aXRjaCBiYWNrIHRvIHRoZSBpbW1lZGlhdGUgdHVybi1vZmYKICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgdHJpZ2dlclRpbWUgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSArICgyKjYwKjEwMDApOyAvLyAyIG1pbgogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgewpAQCAtMTcwOCwxNCArOTczLDEzIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBtQWxhcm1NYW5hZ2VyLnNldChBbGFybU1hbmFnZXIuUlRDX1dBS0VVUCwgdHJpZ2dlclRpbWUsIG1JZGxlSW50ZW50KTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvKiB3ZSBjYW4gcmV0dXJuIG5vdyAtLSB0aGVyZSdzIG5vdGhpbmcgdG8gZG8gdW50aWwgd2UgZ2V0IHRoZSBpZGxlIGludGVudCBiYWNrICovCi0gICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEFDVElPTl9ERVZJQ0VfSURMRSkpIHsKICAgICAgICAgICAgICAgICBpZiAoREJHKSB7CiAgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJnb3QgQUNUSU9OX0RFVklDRV9JRExFIik7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1EZXZpY2VJZGxlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICByZXBvcnRTdGFydFdvcmtTb3VyY2UoKTsKKyAgICAgICAgICAgICAgICB1cGRhdGVXaWZpU3RhdGUoKTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhJbnRlbnQuQUNUSU9OX0JBVFRFUllfQ0hBTkdFRCkpIHsKICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAqIFNldCBhIHRpbWVyIHRvIHB1dCBXaS1GaSB0byBzbGVlcCwgYnV0IG9ubHkgaWYgdGhlIHNjcmVlbiBpcyBvZmYKQEAgLTE3MzUsMjYgKzk5OSwxNSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgInNldHRpbmcgQUNUSU9OX0RFVklDRV9JRExFIHRpbWVyIGZvciAiICsgaWRsZU1pbGxpcyArICJtcyIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIG1BbGFybU1hbmFnZXIuc2V0KEFsYXJtTWFuYWdlci5SVENfV0FLRVVQLCB0cmlnZ2VyVGltZSwgbUlkbGVJbnRlbnQpOwotICAgICAgICAgICAgICAgICAgICBtUGx1Z2dlZFR5cGUgPSBwbHVnZ2VkVHlwZTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtUGx1Z2dlZFR5cGUgPSBwbHVnZ2VkVHlwZTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhBMmRwLkFDVElPTl9TSU5LX1NUQVRFX0NIQU5HRUQpKSB7Ci0gICAgICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcCBhMmRwID0gbmV3IEJsdWV0b290aEEyZHAobUNvbnRleHQpOwotICAgICAgICAgICAgICAgIFNldDxCbHVldG9vdGhEZXZpY2U+IHNpbmtzID0gYTJkcC5nZXRDb25uZWN0ZWRTaW5rcygpOwotICAgICAgICAgICAgICAgIGJvb2xlYW4gaXNCbHVldG9vdGhQbGF5aW5nID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgZm9yIChCbHVldG9vdGhEZXZpY2Ugc2luayA6IHNpbmtzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChhMmRwLmdldFNpbmtTdGF0ZShzaW5rKSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX1BMQVlJTkcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlzQmx1ZXRvb3RoUGxheWluZyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbVdpZmlTdGF0ZVRyYWNrZXIuc2V0Qmx1ZXRvb3RoU2Nhbk1vZGUoaXNCbHVldG9vdGhQbGF5aW5nKTsKLQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoQTJkcC5BQ1RJT05fUExBWUlOR19TVEFURV9DSEFOR0VEKSkgeworICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhQcm9maWxlLkVYVFJBX1NUQVRFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhBMmRwLlNUQVRFX05PVF9QTEFZSU5HKTsKKyAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5zZXRCbHVldG9vdGhTY2FuTW9kZShzdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX1BMQVlJTkcpOworICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEFDVElPTl9TVEFSVF9TQ0FOKSkgeworICAgICAgICAgICAgICAgIG1XaWZpU3RhdGVNYWNoaW5lLnN0YXJ0U2Nhbih0cnVl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AgICAgICAgICBzdHJvbmdlc3RMb2NrTW9kZSA9IFdpZmlNYW5hZ2VyLldJRklfTU9ERV9GVUxMOwogICAgICAgICB9CiAKLSAgICAgICAgc3luY2hyb25pemVkIChtV2lmaUhhbmRsZXIpIHsKLSAgICAgICAgICAgIGlmICgobVdpZmlTdGF0ZVRyYWNrZXIuZ2V0V2lmaVN0YXRlKCkgPT0gV0lGSV9TVEFURV9FTkFCTElORykgJiYgIWFpcnBsYW5lTW9kZSkgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KKyAgICAgICAgLyogU2NhbiBpbnRlcnZhbCB3aGVuIGRyaXZlciBpcyBzdGFydGVkICovCisgICAgICAgIGxvbmcgc2Nhbk1zID0gU2V0dGluZ3MuU2VjdXJlLmdldExvbmcobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLldJRklfU0NBTl9JTlRFUlZBTF9NUywgREVGQVVMVF9TQ0FOX0lOVEVSVkFMX01TKTsKIAotICAgICAgICAgICAgLyogRGlzYWJsZSB0ZXRoZXJpbmcgd2hlbiBhaXJwbGFuZSBtb2RlIGlzIGVuYWJsZWQgKi8KLSAgICAgICAgICAgIGlmIChhaXJwbGFuZU1vZGUgJiYKLSAgICAgICAgICAgICAgICAobVdpZmlBcFN0YXRlID09IFdJRklfQVBfU1RBVEVfRU5BQkxJTkcgfHwgbVdpZmlBcFN0YXRlID09IFdJRklfQVBfU1RBVEVfRU5BQkxFRCkpIHsKLSAgICAgICAgICAgICAgICBzV2FrZUxvY2suYWNxdWlyZSgpOwotICAgICAgICAgICAgICAgIHNlbmRBY2Nlc3NQb2ludE1lc3NhZ2UoZmFsc2UsIG51bGwsIG1MYXN0QXBFbmFibGVVaWQpOwotICAgICAgICAgICAgfQorICAgICAgICAvKiBEaXNhYmxlIHRldGhlcmluZyB3aGVuIGFpcnBsYW5lIG1vZGUgaXMgZW5hYmxlZCAqLworICAgICAgICBpZiAoYWlycGxhbmVNb2RlKSB7CisgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5zZXRXaWZpQXBFbmFibGVkKG51bGwsIGZhbHNlKTsKKyAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAod2lmaVNob3VsZEJlRW5hYmxlZCkgewotICAgICAgICAgICAgICAgIGlmICh3aWZpU2hvdWxkQmVTdGFydGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNXYWtlTG9jay5hY3F1aXJlKCk7Ci0gICAgICAgICAgICAgICAgICAgIHNlbmRFbmFibGVNZXNzYWdlKHRydWUsIGZhbHNlLCBtTGFzdEVuYWJsZVVpZCk7Ci0gICAgICAgICAgICAgICAgICAgIHNXYWtlTG9jay5hY3F1aXJlKCk7Ci0gICAgICAgICAgICAgICAgICAgIHNlbmRTdGFydE1lc3NhZ2Uoc3Ryb25nZXN0TG9ja01vZGUpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIW1XaWZpU3RhdGVUcmFja2VyLmlzRHJpdmVyU3RvcHBlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludCB3YWtlTG9ja1RpbWVvdXQgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5nZXRJbnQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5XSUZJX01PQklMRV9EQVRBX1RSQU5TSVRJT05fV0FLRUxPQ0tfVElNRU9VVF9NUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERFRkFVTFRfV0FLRUxPQ0tfVElNRU9VVCk7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqIFdlIGFyZSBhc3N1bWluZyB0aGF0IENvbm5lY3Rpdml0eVNlcnZpY2UgY2FuIG1ha2UKLSAgICAgICAgICAgICAgICAgICAgICogYSB0cmFuc2l0aW9uIHRvIGNlbGx1bGFyIGRhdGEgd2l0aGluIHdha2VMb2NrVGltZW91dCB0aW1lLgotICAgICAgICAgICAgICAgICAgICAgKiBUaGUgd2FrZWxvY2sgaXMgcmVsZWFzZWQgYnkgdGhlIGRlbGF5ZWQgbWVzc2FnZS4KLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIHNEcml2ZXJTdG9wV2FrZUxvY2suYWNxdWlyZSgpOwotICAgICAgICAgICAgICAgICAgICBtV2lmaUhhbmRsZXIuc2VuZEVtcHR5TWVzc2FnZShNRVNTQUdFX1NUT1BfV0lGSSk7Ci0gICAgICAgICAgICAgICAgICAgIG1XaWZpSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlRGVsYXllZChNRVNTQUdFX1JFTEVBU0VfV0FLRUxPQ0ssIHdha2VMb2NrVGltZW91dCk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICBpZiAod2lmaVNob3VsZEJlRW5hYmxlZCkgeworICAgICAgICAgICAgaWYgKHdpZmlTaG91bGRCZVN0YXJ0ZWQpIHsKKyAgICAgICAgICAgICAgICByZXBvcnRTdGFydFdvcmtTb3VyY2UoKTsKKyAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5zZXRXaWZpRW5hYmxlZCh0cnVlKTsKKyAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5zZXRTY2FuT25seU1vZGUoCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJvbmdlc3RMb2NrTW9kZSA9PSBXaWZpTWFuYWdlci5XSUZJX01PREVfU0NBTl9PTkxZKTsKKyAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5zZXREcml2ZXJTdGFydCh0cnVlKTsKKyAgICAgICAgICAgICAgICBtQWxhcm1NYW5hZ2VyLnNldFJlcGVhdGluZyhBbGFybU1hbmFnZXIuUlRDX1dBS0VVUCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpICsgc2Nhbk1zLCBzY2FuTXMsIG1TY2FuSW50ZW50KTsKKyAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5zZXRIaWdoUGVyZk1vZGVFbmFibGVkKHN0cm9uZ2VzdExvY2tNb2RlCisgICAgICAgICAgICAgICAgICAgICAgICA9PSBXaWZpTWFuYWdlci5XSUZJX01PREVfRlVMTF9ISUdIX1BFUkYpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzV2FrZUxvY2suYWNxdWlyZSgpOwotICAgICAgICAgICAgICAgIHNlbmRFbmFibGVNZXNzYWdlKGZhbHNlLCBmYWxzZSwgbUxhc3RFbmFibGVVaWQpOworICAgICAgICAgICAgICAgIG1XaWZpU3RhdGVNYWNoaW5lLnJlcXVlc3RDbVdha2VMb2NrKCk7CisgICAgICAgICAgICAgICAgbVdpZmlTdGF0ZU1hY2hpbmUuc2V0RHJpdmVyU3RhcnQoZmFsc2UpOworICAgICAgICAgICAgICAgIG1BbGFybU1hbmFnZXIuY2FuY2VsKG1TY2FuSW50ZW50KTsKICAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1XaWZpU3RhdGVNYWNoaW5lLnNldFdpZmlFbmFibGVkKGZhbHNlKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTkwNiw3ICsxMTE1LDggQEAKICAgICAgICAgaW50ZW50RmlsdGVyLmFkZEFjdGlvbihJbnRlbnQuQUNUSU9OX1NDUkVFTl9PRkYpOwogICAgICAgICBpbnRlbnRGaWx0ZXIuYWRkQWN0aW9uKEludGVudC5BQ1RJT05fQkFUVEVSWV9DSEFOR0VEKTsKICAgICAgICAgaW50ZW50RmlsdGVyLmFkZEFjdGlvbihBQ1RJT05fREVWSUNFX0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2aWNlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1XaWZpV2F0Y2hkb2dTZXJ2aWNlID0gbmV3IFdpZmlXYXRjaGRvZ1NlcnZpY2UobUNvbnRleHQsIG1XaWZpU3RhdGVUcmFja2VyKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBzV2FrZUxvY2sucmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgTUVTU0FHRV9TVEFSVF9XSUZJOgotICAgICAgICAgICAgICAgICAgICByZXBvcnRTdGFydFdvcmtTb3VyY2UoKTsKLSAgICAgICAgICAgICAgICAgICAgbVdpZmlTdGF0ZVRyYWNrZXIuc2V0U2Nhbk9ubHlNb2RlKG1zZy5hcmcxID09IFdpZmlNYW5hZ2VyLldJRklfTU9ERV9TQ0FOX09OTFkpOwotICAgICAgICAgICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5yZXN0YXJ0KCk7Ci0gICAgICAgICAgICAgICAgICAgIG1XaWZpU3RhdGVUcmFja2VyLnNldEhpZ2hQZXJmTW9kZShtc2cuYXJnMSA9PQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlNYW5hZ2VyLldJRklfTU9ERV9GVUxMX0hJR0hfUEVSRik7Ci0gICAgICAgICAgICAgICAgICAgIHNXYWtlTG9jay5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBNRVNTQUdFX1VQREFURV9TVEFURToKLSAgICAgICAgICAgICAgICAgICAgZG9VcGRhdGVXaWZpU3RhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIE1FU1NBR0VfRElTQUJMRV9XSUZJOgotICAgICAgICAgICAgICAgICAgICAvLyBhIG5vbi16ZXJvIG1zZy5hcmcxIHZhbHVlIG1lYW5zIHRoZSAiZW5hYmxlZCIgc2V0dGluZwotICAgICAgICAgICAgICAgICAgICAvLyBzaG91bGQgYmUgcGVyc2lzdGVkCi0gICAgICAgICAgICAgICAgICAgIHNldFdpZmlFbmFibGVkQmxvY2tpbmcoZmFsc2UsIG1zZy5hcmcxID09IDEsIG1zZy5hcmcyKTsKLSAgICAgICAgICAgICAgICAgICAgbVdpZmlXYXRjaGRvZ1NlcnZpY2UgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICBzV2FrZUxvY2sucmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgTUVTU0FHRV9TVE9QX1dJRkk6Ci0gICAgICAgICAgICAgICAgICAgIG1XaWZpU3RhdGVUcmFja2VyLmRpc2Nvbm5lY3RBbmRTdG9wKCk7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IHJlbGVhc2Ugd2FrZWxvY2sKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIE1FU1NBR0VfUkVMRUFTRV9XQUtFTE9DSzoKLSAgICAgICAgICAgICAgICAgICAgc0RyaXZlclN0b3BXYWtlTG9jay5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBNRVNTQUdFX1NUQVJUX0FDQ0VTU19QT0lOVDoKLSAgICAgICAgICAgICAgICAgICAgc2V0V2lmaUFwRW5hYmxlZEJsb2NraW5nKHRydWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cuYXJnMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXaWZpQ29uZmlndXJhdGlvbikgbXNnLm9iaik7Ci0gICAgICAgICAgICAgICAgICAgIHNXYWtlTG9jay5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBNRVNTQUdFX1NUT1BfQUNDRVNTX1BPSU5UOgotICAgICAgICAgICAgICAgICAgICBzZXRXaWZpQXBFbmFibGVkQmxvY2tpbmcoZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cuYXJnMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXaWZpQ29uZmlndXJhdGlvbikgbXNnLm9iaik7Ci0gICAgICAgICAgICAgICAgICAgIHNXYWtlTG9jay5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBNRVNTQUdFX1NFVF9DSEFOTkVMUzoKLSAgICAgICAgICAgICAgICAgICAgc2V0TnVtQWxsb3dlZENoYW5uZWxzQmxvY2tpbmcobXNnLmFyZzEsIG1zZy5hcmcyID09IDEpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgTUVTU0FHRV9FTkFCTEVfTkVUV09SS1M6Ci0gICAgICAgICAgICAgICAgICAgIG1XaWZpU3RhdGVUcmFja2VyLmVuYWJsZUFsbE5ldHdvcmtzKGdldENvbmZpZ3VyZWROZXR3b3JrcygpKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIE1FU1NBR0VfU1RBUlRfU0NBTjoKLSAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBmb3JjZUFjdGl2ZSA9IChtc2cuYXJnMSA9PSAxKTsKLSAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChtV2lmaVN0YXRlVHJhY2tlci5nZXRTdXBwbGljYW50U3RhdGUoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNURUQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIElOQUNUSVZFOgotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTQ0FOTklORzoKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgRE9STUFOVDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdpZmlTdGF0ZVRyYWNrZXIuc2V0U2NhblJlc3VsdEhhbmRsaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2lmaVN0YXRlVHJhY2tlci5TVVBQTF9TQ0FOX0hBTkRMSU5HX0xJU1RfT05MWSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbVdpZmlTdGF0ZVRyYWNrZXIuc2Nhbihmb3JjZUFjdGl2ZSk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCiAgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIHZvaWQgZHVtcChGaWxlRGVzY3JpcHRvciBmZCwgUHJpbnRXcml0ZXIgcHcsIFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICAgaWYgKG1Db250ZXh0LmNoZWNrQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkRVTVApCkBAIC0yMDM0LDE3ICsxMTUzLDE3IEBACiAgICAgICAgICAgICAgICAgICAgICsgIiwgdWlkPSIgKyBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpKTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQotICAgICAgICBwdy5wcmludGxuKCJXaS1GaSBpcyAiICsgc3RhdGVOYW1lKG1XaWZpU3RhdGVUcmFja2VyLmdldFdpZmlTdGF0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blJlc3VsdCByIDogc2NhblJlc3VsdHMpIHsKQEAgLTIwNjgsMjMgKzExODcsNiBAQAogICAgICAgICBtTG9ja3MuZHVtcChwdyk7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIHN0YXRlTmFtZShpbnQgd2lmaVN0YXRlKSB7Ci0gICAgICAgIHN3aXRjaCAod2lmaVN0YXRlKSB7Ci0gICAgICAgICAgICBjYXNlIFdJRklfU1RBVEVfRElTQUJMSU5HOgotICAgICAgICAgICAgICAgIHJldHVybiAiZGlzYWJsaW5nIjsKLSAgICAgICAgICAgIGNhc2UgV0lGSV9TVEFURV9ESVNBQkxFRDoKLSAgICAgICAgICAgICAgICByZXR1cm4gImRpc2FibGVkIjsKLSAgICAgICAgICAgIGNhc2UgV0lGSV9TVEFURV9FTkFCTElORzoKLSAgICAgICAgICAgICAgICByZXR1cm4gImVuYWJsaW5nIjsKLSAgICAgICAgICAgIGNhc2UgV0lGSV9TVEFURV9FTkFCTEVEOgotICAgICAgICAgICAgICAgIHJldHVybiAiZW5hYmxlZCI7Ci0gICAgICAgICAgICBjYXNlIFdJRklfU1RBVEVfVU5LTk9XTjoKLSAgICAgICAgICAgICAgICByZXR1cm4gInVua25vd24gc3RhdGUiOwotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICByZXR1cm4gIltpbnZhbGlkIHN0YXRlXSI7Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICBwcml2YXRlIGNsYXNzIFdpZmlMb2NrIGV4dGVuZHMgRGVhdGhSZWNpcGllbnQgewogICAgICAgICBXaWZpTG9jayhpbnQgbG9ja01vZGUsIFN0cmluZyB0YWcsIElCaW5kZXIgYmluZGVyLCBXb3JrU291cmNlIHdzKSB7CiAgICAgICAgICAgICBzdXBlcihsb2NrTW9kZSwgdGFnLCBiaW5kZXIsIHdzKTsKQEAgLTIxNjIsNyArMTI2NCw3IEBACiAgICAgfQogCiAgICAgdm9pZCBlbmZvcmN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ICAgIGJyZWFrOwpAQCAtMjM4NCw3ICsxNDgxLDcgQEAKICAgICAgICAgICAgIGlmIChtTXVsdGljYXN0ZXJzLnNpemUoKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5zdGFydFBhY2tldEZpbHRlcmluZygpOworICAgICAgICAgICAgICAgIG1XaWZpU3RhdGVNYWNoaW5lLnN0YXJ0UGFja2V0RmlsdGVyaW5nKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0yMzk5LDcgKzE0OTYsNyBAQAogICAgICAgICAgICAgLy8gb3VyIG5ldyBzaXplID09IDEgKGZpcnN0IGNhbGwpLCBidXQgdGhpcyBmdW5jdGlvbiB3b24ndAogICAgICAgICAgICAgLy8gYmUgY2FsbGVkIG9mdGVuIGFuZCBieSBtYWtpbmcgdGhlIHN0b3BQYWNrZXQgY2FsbCBlYWNoCiAgICAgICAgICAgICAvLyB0aW1lIHdlJ3JlIGxlc3MgZnJhZ2lsZSBhbmQgc2VsZi1oZWFsaW5nLgotICAgICAgICAgICAgbVdpZmlTdGF0ZVRyYWNrZXIuc3RvcFBhY2tldEZpbHRlcmluZygpOworICAgICAgICAgICAgbVdpZmlTdGF0ZU1hY2hpbmUuc3RvcFBhY2tldEZpbHRlcmluZygpOwogICAgICAgICB9CiAKICAgICAgICAgaW50IHVpZCA9IEJpbmRlci5nZXRDYWxsaW5nVWlkKCk7CkBAIC0yNDM2LDcgKzE1MzMsNyBAQAogICAgICAgICAgICAgcmVtb3ZlZC51bmxpbmtEZWF0aFJlY2lwaWVudCgpOwogICAgICAgICB9CiAgICAgICAgIGlmIChtTXVsdGljYXN0ZXJzLnNpemUoKSA9PSAwKSB7Ci0gICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5zdGFydFBhY2tldEZpbHRlcmluZygpOworICAgICAgICAgICAg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gpIC0gMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgICAgICAgICAgU2NhblJlc3VsdCBzY2FuUmVzdWx0ID0gc2NhblJlc3VsdHMuZ2V0KGkpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShzY2FuUmVzdWx0LmNhcGFiaWxpdGllcykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bU9wZW5OZXR3b3JrcysrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKG51bU9wZW5OZXR3b3JrcyA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCsrbU51bVNjYW5zU2luY2VOZXR3b3JrU3RhdGVDaGFuZ2UgPj0gTlVNX1NDQU5TX0JFRk9SRV9BQ1RVQUxMWV9TQ0FOTklORykgeworICAgICAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIFdlJ3ZlIHNjYW5uZWQgY29udGludW91c2x5IGF0IGxlYXN0CisgICAgICAgICAgICAgICAgICAgICAgICAgKiBOVU1fU0NBTlNfQkVGT1JFX05PVElGSUNBVElPTiB0aW1lcy4gVGhlIHVzZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHByb2JhYmx5IGRvZXMgbm90IGhhdmUgYSByZW1lbWJlcmVkIG5ldHdvcmsgaW4gcmFuZ2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBzaW5jZSBvdGhlcndpc2Ugc3VwcGxpY2FudCB3b3VsZCBoYXZlIHRyaWVkIHRvCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBhc3NvY2lhdGUgYW5kIHRodXMgcmVzZXR0aW5nIHRoaXMgY291bnRlci4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgc2V0Tm90aWZpY2F0aW9uVmlzaWJsZSh0cnVlLCBudW1PcGVuTmV0d29ya3MsIGZhbHNlLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gTm8gb3BlbiBuZXR3b3JrcyBpbiByYW5nZSwgcmVtb3ZlIHRoZSBub3RpZmljYXRpb24KKyAgICAgICAgc2V0Tm90aWZpY2F0aW9uVmlzaWJsZShmYWxzZSwgMCwgZmFsc2UsIDApOworICAgIH0KKworICAgIC8qKgorICAgICAqIENsZWFycyB2YXJpYWJsZXMgcmVsYXRlZCB0byB0cmFja2luZyB3aGV0aGVyIGEgbm90aWZpY2F0aW9uIGhhcyBiZWVuCisgICAgICogc2hvd24gcmVjZW50bHkgYW5kIGNsZWFycyB0aGUgY3VycmVudCBub3RpZmljYXRpb24uCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHJlc2V0Tm90aWZpY2F0aW9uKCkgeworICAgICAgICBtTm90aWZpY2F0aW9uUmVwZWF0VGltZSA9IDA7CisgICAgICAgIG1OdW1TY2Fuc1NpbmNlTmV0d29ya1N0YXRlQ2hhbmdlID0gMDsKKyAgICAgICAgc2V0Tm90aWZpY2F0aW9uVmlzaWJsZShmYWxzZSwgMCwgZmFsc2UsIDApOworICAgIH0KKworICAgIC8qKgorICAgICAqIERpc3BsYXkgb3IgZG9uJ3QgZGlzcGxheSBhIG5vdGlmaWNhdGlvbiB0aGF0IHRoZXJlIGFyZSBvcGVuIFdpLUZpIG5ldHdvcmtzLgorICAgICAqIEBwYXJhbSB2aXNpYmxlIHtAY29kZSB0cnVlfSBpZiBub3RpZmljYXRpb24gc2hvdWxkIGJlIHZpc2libGUsIHtAY29kZSBmYWxzZX0gb3RoZXJ3aXNlCisgICAgICogQHBhcmFtIG51bU5ldHdvcmtzIHRoZSBudW1iZXIgbmV0d29ya3Mgc2VlbgorICAgICAqIEBwYXJhbSBmb3JjZSB7QGNvZGUg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KKworICAgICAgICBOb3RpZmljYXRpb25NYW5hZ2VyIG5vdGlmaWNhdGlvbk1hbmFnZXIgPSAoTm90aWZpY2F0aW9uTWFuYWdlcikgbUNvbnRleHQKKyAgICAgICAgICAgICAgICAuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0Lk5PVElGSUNBVElPTl9TRVJWSUNFKTsKKworICAgICAgICBNZXNzYWdlIG1lc3NhZ2U7CisgICAgICAgIGlmICh2aXNpYmxlKSB7CisKKyAgICAgICAgICAgIC8vIE5vdCBlbm91Z2ggdGltZSBoYXMgcGFzc2VkIHRvIHNob3cgdGhlIG5vdGlmaWNhdGlvbiBhZ2FpbgorICAgICAgICAgICAgaWYgKFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIDwgbU5vdGlmaWNhdGlvblJlcGVhdFRpbWUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtTm90aWZpY2F0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvLyBDYWNoZSB0aGUgTm90aWZpY2F0aW9uIG9iamVjdC4KKyAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uID0gbmV3IE5vdGlmaWNhdGlvbigpOworICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb24ud2hlbiA9IDA7CisgICAgICAgICAgICAgICAgbU5vdGlmaWNhdGlvbi5pY29uID0gSUNPTl9ORVRXT1JLU19BVkFJTEFCTEU7CisgICAgICAgICAgICAgICAgbU5vdGlmaWNhdGlvbi5mbGFncyA9IE5vdGlmaWNhdGlvbi5GTEFHX0FVVE9fQ0FOQ0VMOworICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb24uY29udGVudEludGVudCA9IFBlbmRpbmdJbnRlbnQuZ2V0QWN0aXZpdHkobUNvbnRleHQsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgSW50ZW50KFdpZmlNYW5hZ2VyLkFDVElPTl9QSUNLX1dJRklfTkVUV09SSyksIDApOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGl0bGUgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRRdWFudGl0eVRleHQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIucGx1cmFscy53aWZpX2F2YWlsYWJsZSwgbnVtTmV0d29ya3MpOworICAgICAgICAgICAgQ2hhclNlcXVlbmNlIGRldGFpbHMgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRRdWFudGl0eVRleHQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIucGx1cmFscy53aWZpX2F2YWlsYWJsZV9kZXRhaWxlZCwgbnVtTmV0d29ya3MpOworICAgICAgICAgICAgbU5vdGlmaWNhdGlvbi50aWNrZXJUZXh0ID0gdGl0bGU7CisgICAgICAgICAgICBtTm90aWZpY2F0aW9uLnNldExhdGVzdEV2ZW50SW5mbyhtQ29udGV4dCwgdGl0bGUsIGRldGFpbHMsIG1Ob3RpZmljYXRpb24uY29udGVudEludGVudCk7CisKKyAgICAgICAgICAgIG1Ob3RpZmljYXRpb25SZXBlYXRUaW1lID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgKyBOT1RJRklDQVRJT05fUkVQRUFUX0RFTEFZX01TOworCisgICAgICAgICAgICBub3RpZmljYXRpb25NYW5hZ2VyLm5vdGlmeShJQ09OX05FVFdPUktTX0FWQUlMQUJMRSwgbU5vdGlmaWNhdGlvbik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBub3RpZmljYXRpb25NYW5hZ2VyLmNhbmNlbChJQ09OX05FVFdPUktTX0FWQUlMQUJMRSk7CisgICAgICAgIH0KKworICAgICAgICBtTm90aWZpY2F0aW9uU2hvd24gPSB2aXNpYmxlOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgTm90aWZpY2F0aW9uRW5hYmxlZFNldHRpbmdPYnNlcnZlciBleHRlbmRzIENvbnRlbnRPYnNlcnZlciB7CisKKyAgICAgICAgcHVibGljIE5vdGlmaWNhdGlvbkVuYWJsZWRTZXR0aW5nT2JzZXJ2ZXIoSGFuZGxlciBoYW5kbGVyKSB7CisgICAgICAgICAgICBzdXBlcihoYW5kbGVyKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHJlZ2lzdGVyKCkgeworICAgICAgICAgICAgQ29udGVudFJlc29sdmVyIGNyID0gbUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCk7CisgICAgICAgICAgICBjci5yZWdpc3RlckNvbnRlbnRPYnNlcnZlcihTZXR0aW5ncy5TZWN1cmUuZ2V0VXJpRm9yKAorICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5XSUZJX05FVFdPUktTX0FWQUlMQUJMRV9OT1RJRklDQVRJT05fT04pLCB0cnVlLCB0aGlzKTsKKyAgICAgICAgICAgIG1Ob3RpZmljYXRpb25FbmFibGVkID0gZ2V0VmFsdWUoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkNoYW5nZShib29sZWFuIHNlbGZDaGFuZ2UpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uQ2hhbmdlKHNlbGZDaGFuZ2UpOworCisgICAgICAgICAgICBtTm90aWZpY2F0aW9uRW5hYmxlZCA9IGdldFZhbHVlKCk7CisgICAgICAgICAgICByZXNldE5vdGlmaWNhdGlvbigpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIGdldFZhbHVlKCkgeworICAgICAgICAgICAgcmV0dXJuIFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5XSUZJX05FVFdPUktTX0FWQUlMQUJM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luYWwgYm9vbGVhbiBTSE9XX1RSQU5TQUNUSU9OUyA9IGZhbHNlOwogICAgIHN0YXRpYyBmaW5hbCBib29sZWFuIEhJREVfU1RBQ0tfQ1JBV0xTID0gdHJ1ZTsKIApAQCAtNDg2LDYgKzQ5MywzNjQgQEAKICAgICBib29sZWFuIG1UdXJuT25TY3JlZW47CiAKICAgICAvKioKKyAgICAgKiBEcmFnL2Ryb3Agc3RhdGUKKyAgICAgKi8KKyAgICBjbGFzcyBEcmFnU3RhdGUgeworICAgICAgICBJQmluZGVyIG1Ub2tlbjsKKyAgICAgICAgU3VyZmFjZSBtU3VyZmFjZTsKKyAgICAgICAgYm9vbGVhbiBtTG9jYWxPbmx5OworICAgICAgICBDbGlwRGF0YSBtRGF0YTsKKyAgICAgICAgQ2xpcERlc2NyaXB0aW9uIG1EYXRhRGVzY3JpcHRpb247CisgICAgICAgIGJvb2xlYW4gbURyYWdSZXN1bHQ7CisgICAgICAgIGZsb2F0IG1DdXJyZW50WCwgbUN1cnJlbnRZOworICAgICAgICBmbG9hdCBtVGh1bWJPZmZzZXRYLCBtVGh1bWJPZmZzZXRZOworICAgICAgICBJbnB1dENoYW5uZWwgbVNlcnZlckNoYW5uZWwsIG1DbGllbnRDaGFubmVsOworICAgICAgICBXaW5kb3dTdGF0ZSBtVGFyZ2V0V2luZG93OworICAgICAgICBBcnJheUxpc3Q8V2luZG93U3RhdGU+IG1Ob3RpZmllZFdpbmRvd3M7CisgICAgICAgIGJvb2xlYW4gbURyYWdJblByb2dyZXNzOworCisgICAgICAgIHByaXZhdGUgZmluYWwgUmVjdCB0bXBSZWN0ID0gbmV3IFJlY3QoKTsKKworICAgICAgICBEcmFnU3RhdGUoSUJpbmRlciB0b2tlbiwgU3VyZmFjZSBzdXJmYWNlLCBib29sZWFuIGxvY2FsT25seSkgeworICAgICAgICAgICAgbVRva2VuID0gdG9rZW47CisgICAgICAgICAgICBtU3VyZmFjZSA9IHN1cmZhY2U7CisgICAgICAgICAgICBtTG9jYWxPbmx5ID0gbG9jYWxPbmx5OworICAgICAgICAgICAgbU5vdGlmaWVkV2luZG93cyA9IG5ldyBBcnJheUxpc3Q8V2luZG93U3RhdGU+KCk7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHJlc2V0KCkgeworICAgICAgICAgICAgaWYgKG1TdXJmYWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtU3VyZmFjZS5kZXN0cm95KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtU3VyZmFjZSA9IG51bGw7CisgICAgICAgICAgICBtTG9jYWxPbmx5ID0gZmFsc2U7CisgICAgICAgICAgICBtVG9rZW4gPSBudWxsOworICAgICAgICAgICAgbURhdGEgPSBudWxsOworICAgICAgICAgICAgbVRodW1iT2Zmc2V0WCA9IG1UaHVtYk9mZnNldFkgPSAwOworICAgICAgICAgICAgbU5vdGlmaWVkV2luZG93cyA9IG51bGw7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHJlZ2lzdGVyKCkgeworICAgICAgICAgICAgaWYgKERFQlVHX0RSQUcpIFNsb2cuZChUQUcsICJyZWdpc3RlcmluZyBkcmFnIGlucHV0IGNoYW5uZWwiKTsKKyAgICAgICAgICAgIGlmIChtQ2xpZW50Q2hhbm5lbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIkR1cGxpY2F0ZSByZWdpc3RlciBvZiBkcmFnIGlucHV0IGNoYW5uZWwiKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgSW5wdXRDaGFubmVsW10gY2hhbm5lbHMgPSBJbnB1dENoYW5uZWwub3BlbklucHV0Q2hhbm5lbFBhaXIoImRyYWciKTsKKyAgICAgICAgICAgICAgICBtU2VydmVyQ2hhbm5lbCA9IGNoYW5uZWxzWzBdOworICAgICAgICAgICAgICAgIG1DbGllbnRDaGFubmVsID0gY2hhbm5lbHNbMV07CisgICAgICAgICAgICAgICAgbUlucHV0TWFuYWdlci5yZWdpc3RlcklucHV0Q2hhbm5lbChtU2VydmVyQ2hhbm5lbCk7CisgICAgICAgICAgICAgICAgSW5wdXRRdWV1ZS5yZWdpc3RlcklucHV0Q2hhbm5lbChtQ2xpZW50Q2hhbm5lbCwgbURyYWdJbnB1dEhhbmRsZXIsCisgICAgICAgICAgICAgICAgICAgICAgICBtSC5nZXRMb29wZXIoKS5nZXRRdWV1ZSgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgdW5yZWdpc3RlcigpIHsKKyAgICAgICAgICAgIGlmIChERUJVR19EUkFHKSBTbG9nLmQoVEFHLCAidW5yZWdpc3RlcmluZyBkcmFnIGlucHV0IGNoYW5uZWwiKTsKKyAgICAgICAgICAgIGlmIChtQ2xpZW50Q2hhbm5lbCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIlVucmVnaXN0ZXIgb2Ygbm9uZXhpc3RlbnQgZHJhZyBpbnB1dCBjaGFubmVsIik7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1JbnB1dE1hbmFnZXIudW5yZWdpc3RlcklucHV0Q2hhbm5lbChtU2VydmVyQ2hhbm5lbCk7CisgICAgICAgICAgICAgICAgSW5wdXRRdWV1ZS51bnJlZ2lzdGVySW5wdXRDaGFubmVsKG1DbGllbnRDaGFubmVsKTsKKyAgICAgICAgICAgICAgICBtQ2xpZW50Q2hhbm5lbC5kaXNwb3NlKCk7CisgICAgICAgICAgICAgICAgbVNlcnZlckNoYW5uZWwuZGlzcG9zZSgpOworICAgICAgICAgICAgICAgIG1DbGllbnRDaGFubmVsID0gbnVsbDsKKyAgICAgICAgICAgICAgICBtU2VydmVyQ2hhbm5lbCA9IG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpbnQgZ2V0RHJhZ0xheWVyTHcoKSB7CisgICAgICAgICAgICByZXR1cm4gbVBvbGljeS53aW5kb3dUeXBlVG9MYXllckx3KFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLlRZUEVfRFJBRykKKyAgICAgICAgICAgICAgICAgICAgKiBUWVBFX0xBWUVSX01VTFRJUExJRVIKKyAgICAgICAgICAgICAgICAgICAgKyBUWVBFX0xBWUVSX09GRlNFVDsKKyAgICAgICAgfQorCisgICAgICAgIC8qIGNhbGwgb3V0IHRvIGVhY2ggdmlzaWJsZSB3aW5kb3cvc2Vzc2lvbiBpbmZvcm1pbmcgaXQgYWJvdXQgdGhlIGRyYWcKKyAgICAgICAgICovCisgICAgICAgIHZvaWQgYnJvYWRjYXN0RHJhZ1N0YXJ0ZWRMdyhmaW5hbCBmbG9hdCB0b3VjaFgsIGZpbmFsIGZsb2F0IHRvdWNoWSkgeworICAgICAgICAgICAgLy8gQ2FjaGUgYSBiYXNlLWNsYXNzIGluc3RhbmNlIG9mIHRoZSBjbGlwIG1ldGFkYXRhIHNvIHRoYXQgcGFyY2VsaW5nCisgICAgICAgICAgICAvLyB3b3JrcyBjb3JyZWN0bHkgaW4gY2FsbGluZyBvdXQgdG8gdGhlIGFwcHMuCisgICAgICAgICAgICBtRGF0YURlc2NyaXB0aW9uID0gbURhdGEuZ2V0RGVzY3JpcHRpb24oKTsKKyAgICAgICAgICAgIG1Ob3RpZmllZFdpbmRvd3MuY2xlYXIoKTsKKyAgICAgICAgICAgIG1EcmFnSW5Qcm9ncmVzcyA9IHRydWU7CisKKyAgICAgICAgICAgIGlmIChERUJVR19EUkFHKSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImJyb2FkY2FzdGluZyBEUkFHX1NUQVJURUQgYXQgKCIgKyB0b3VjaFggKyAiLCAiICsgdG91Y2hZICsgIikiKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtV2luZG93cy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgeworICAgICAgICAgICAgICAgIHNlbmREcm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3RlbnRpYWxEcmFnVGFyZ2V0KCkpIHsKKyAgICAgICAgICAgICAgICBEcmFnRXZlbnQgZXZlbnQgPSBEcmFnRXZlbnQub2J0YWluKERyYWdFdmVudC5BQ1RJT05fRFJBR19TVEFSVEVELAorICAgICAgICAgICAgICAgICAgICAgICAgdG91Y2hYIC0gbmV3V2luLm1GcmFtZS5sZWZ0LCB0b3VjaFkgLSBuZXdXaW4ubUZyYW1lLnRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc2MsIG51bGwsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBuZXdXaW4ubUNsaWVudC5kaXNwYXRjaERyYWdFdmVudChldmVudCk7CisgICAgICAgICAgICAgICAgICAgIC8vIHRyYWNrIGVhY2ggd2luZG93IHRoYXQgd2UndmUgbm90aWZpZWQgdGhhdCB0aGUgZHJhZyBpcyBzdGFydGluZworICAgICAgICAgICAgICAgICAgICBtTm90aWZpZWRXaW5kb3dzLmFkZChuZXdXaW4pOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJVbmFibGUgdG8gZHJhZy1zdGFydCB3aW5kb3cgIiArIG5ld1dpbik7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIGNhbGxlZSB3YXMgbG9jYWwsIHRoZSBkaXNwYXRjaCBoYXMgYWxyZWFkeSByZWN5Y2xlZCB0aGUgZXZlbnQKKyAgICAgICAgICAgICAgICAgICAgaWYgKFByb2Nlc3MubXlQaWQoKSAhPSBuZXdXaW4ubVNlc3Npb24ubVBpZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQucmVjeWNsZSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyogaGVscGVyIC0gY29uc3RydWN0IGFuZCBzZW5kIGEgRFJBR19TVEFSVEVEIGV2ZW50IG9ubHkgaWYgdGhlIHdpbmRvdyBoYXMgbm90CisgICAgICAgICAqIHByZXZpb3VzbHkgYmVlbiBub3RpZmllZCwgaS5lLiBpdCBiZWNhbWUgdmlzaWJsZSBhZnRlciB0aGUgZHJhZyBvcGVyYXRpb24KKyAgICAgICAgICogd2FzIGJlZ3VuLiAgVGhpcyBpcyBhIHJhcmUgY2FzZS4KKyAgICAgICAgICovCisgICAgICAgIHByaXZhdGUgdm9pZCBzZW5kRHJhZ1N0YXJ0ZWRJZk5lZWRlZEx3KFdpbmRvd1N0YXRlIG5ld1dpbikgeworICAgICAgICAgICAgaWYgKG1EcmFnSW5Qcm9ncmVzcykgeworICAgICAgICAgICAgICAgIC8vIElmIHdlIGhhdmUgc2VudCB0aGUgZHJhZy1zdGFydGVkLCB3ZSBuZWVkbid0IGRvIHNvIGFnYWluCisgICAgICAgICAgICAgICAgZm9yIChXaW5kb3dTdGF0ZSB3cyA6IG1Ob3RpZmllZFdpbmRvd3MpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHdzID09IG5ld1dpbikgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChERUJVR19EUkFHKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJuZWVkIHRvIHNlbmQgRFJBR19TVEFSVEVEIHRvIG5ldyB3aW5kb3cgIiArIG5ld1dpbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNlbmREcmFnU3RhcnRlZEx3KG5ld1dpbiwgbUN1cnJlbnRYLCBtQ3VycmVudFksIG1EYXRhRGVzY3JpcHRpb24pOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgdm9pZCBicm9hZGNhc3REcmFnRW5kZWRMdygpIHsKKyAgICAgICAgICAgIGlmIChERUJVR19EUkFHKSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImJyb2FkY2FzdGluZyBEUkFHX0VOREVEIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBEcmFnRXZlbnQgZXZ0ID0gRHJhZ0V2ZW50Lm9idGFpbihEcmFnRXZlbnQuQUNUSU9OX0RSQUdfRU5ERUQsCisgICAgICAgICAgICAgICAgICAgIDAsIDAsIG51bGwsIG51bGwsIG1EcmFnUmVzdWx0KTsKKyAgICAgICAgICAgIGZvciAoV2luZG93U3RhdGUgd3M6IG1Ob3RpZmllZFdpbmRvd3MpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICB3cy5tQ2xpZW50LmRpc3BhdGNoRHJhZ0V2ZW50KGV2dCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIlVuYWJsZSB0byBkcmFnLWVuZCB3aW5kb3cgIiArIHdzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTm90aWZpZWRXaW5kb3dzLmNsZWFyKCk7CisgICAgICAgICAgICBtRHJhZ0luUHJvZ3Jlc3MgPSBmYWxzZTsKKyAgICAgICAgICAgIGV2dC5yZWN5Y2xlKCk7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIGVuZERyYWdMdygpIHsKKyAgICAgICAgICAgIG1EcmFnU3RhdGUuYnJvYWRjYXN0RHJhZ0VuZGVkTHcoKTsKKworICAgICAgICAgICAgLy8gc3RvcCBpbnRlcmNlcHRpbmcgaW5wdXQKKyAgICAgICAgICAgIG1EcmFnU3RhdGUudW5yZWdpc3RlcigpOworICAgICAgICAgICAgbUlucHV0TW9uaXRvci51cGRhdGVJbnB1dFdpbmRvd3NMdygpOworCisgICAgICAgICAgICAvLyBmcmVlIG91ciByZXNvdXJjZXMgYW5kIGRyb3AgYWxsIHRoZSBvYmplY3QgcmVmZXJlbmNlcworICAgICAgICAgICAgbURyYWdTdGF0ZS5yZXNldCgpOworICAgICAgICAgICAgbURyYWdTdGF0ZSA9IG51bGw7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIG5vdGlmeU1vdmVMdyhmbG9hdCB4LCBmbG9hdCB5KSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgbXlQaWQgPSBQcm9jZXNzLm15UGlkKCk7CisKKyAgICAgICAgICAgIC8vIE1vdmUgdGhlIHN1cmZhY2UgdG8gdGhlIGdpdmVuIHRvdWNoCisgICAgICAgICAgICBtU3VyZmFjZS5vcGVuVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgIG1TdXJmYWNlLnNldFBvc2l0aW9uKChpbnQpKHggLSBtVGh1bWJPZmZzZXRYKSwgKGludCkoeSAtIG1UaHVtYk9mZnNldFkpKTsKKyAgICAgICAgICAgIG1TdXJmYWNlLmNsb3NlVHJhbnNhY3Rpb24oKTsKKworICAgICAgICAgICAgLy8gVGVsbCB0aGUgYWZmZWN0ZWQgd2luZG93CisgICAgICAgICAgICBXaW5kb3dTdGF0ZSB0b3VjaGVkV2luID0gZ2V0VG91Y2hlZFdpbkF0UG9pbnRMdyh4LCB5KTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgLy8gaGF2ZSB3ZSBkcmFnZ2VkIG92ZXIgYSBuZXcgd2luZG93PworICAgICAgICAgICAgICAgIGlmICgodG91Y2hlZFdpbiAhPSBtVGFyZ2V0V2luZG93KSAmJiAobVRhcmdldFdpbmRvdyAhPSBudWxsKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfRFJBRykgeworICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgInNlbmRpbmcgRFJBR19FWElURUQgdG8gIiArIG1UYXJnZXRXaW5kb3cpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIGZvcmNlIERSQUdfRVhJVEVEX0VWRU5UIGlmIGFwcHJvcHJpYXRlCisgICAgICAgICAgICAgICAgICAgIERyYWdFdmVudCBldnQgPSBEcmFnRXZlbnQub2J0YWluKERyYWdFdmVudC5BQ1RJT05fRFJBR19FWElURUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCAtIG1UYXJnZXRXaW5kb3cubUZyYW1lLmxlZnQsIHkgLSBtVGFyZ2V0V2luZG93Lm1GcmFtZS50b3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0V2luZG93Lm1DbGllbnQuZGlzcGF0Y2hEcmFnRXZlbnQoZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG15UGlkICE9IG1UYXJnZXRXaW5kb3cubVNlc3Npb24ubVBpZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZXZ0LnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAodG91Y2hlZFdpbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19EUkFHKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAic2VuZGluZyBEUkFHX0xPQ0FUSU9OIHRvICIgKyB0b3VjaGVkV2luKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBEcmFnRXZlbnQgZXZ0ID0gRHJhZ0V2ZW50Lm9idGFpbihEcmFnRXZlbnQuQUNUSU9OX0RSQUdfTE9DQVRJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCAtIHRvdWNoZWRXaW4ubUZyYW1lLmxlZnQsIHkgLSB0b3VjaGVkV2luLm1GcmFtZS50b3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB0b3VjaGVkV2luLm1DbGllbnQuZGlzcGF0Y2hEcmFnRXZlbnQoZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG15UGlkICE9IHRvdWNoZWRXaW4ubVNlc3Npb24ubVBpZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZXZ0LnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgImNhbid0IHNlbmQgZHJhZyBub3RpZmljYXRpb24gdG8gd2luZG93cyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVRhcmdldFdpbmRvdyA9IHRvdWNoZWRXaW47CisgICAgICAgIH0KKworICAgICAgICAvLyBUZWxsIHRoZSBkcm9wIHRhcmdldCBhYm91dCB0aGUgZGF0YS4gIFJldHVybnMgJ3RydWUnIGlmIHdlIGNhbiBpbW1lZGlhdGVseQorICAgICAgICAvLyBkaXNwYXRjaCB0aGUgZ2xvYmFsIGRyYWctZW5kZWQgbWVzc2FnZSwgJ2ZhbHNlJyBpZiB3ZSBuZWVkIHRvIHdhaXQgZm9yIGEKKyAgICAgICAgLy8gcmVzdWx0IGZyb20gdGhlIHJlY2lwaWVudC4KKyAgICAgICAgYm9vbGVhbiBub3RpZnlEcm9wTHcoZmxvYXQgeCwgZmxvYXQgeSkgeworICAgICAgICAgICAgV2luZG93U3RhdGUgdG91Y2hlZFdpbiA9IGdldFRvdWNoZWRXaW5BdFBvaW50THcoeCwgeSk7CisgICAgICAgICAgICBpZiAodG91Y2hlZFdpbiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgLy8gImRyb3AiIG91dHNpZGUgYSB2YWxpZCB3aW5kb3cgLS0gbm8gcmVjaXBpZW50IHRvIGFwcGx5IGEKKyAgICAgICAgICAgICAgICAvLyB0aW1lb3V0IHRvLCBhbmQgd2UgY2FuIHNlbmQgdGhlIGRyYWctZW5kZWQgbWVzc2FnZSBpbW1lZGlhdGVseS4KKyAgICAgICAgICAgICAgICBtRHJhZ1Jlc3VsdCA9IGZhbHNlOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoREVCVUdfRFJBRykgeworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJzZW5kaW5nIERST1AgdG8gIiArIHRvdWNoZWRXaW4pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmluYWwgaW50IG15UGlkID0gUHJvY2Vzcy5teVBpZCgpOworICAgICAgICAgICAgZmluYWwgSUJpbmRlciB0b2tlbiA9IHRvdWNoZWRXaW4ubUNsaWVudC5hc0JpbmRlcigpOworICAgICAgICAgICAgRHJhZ0V2ZW50IGV2dCA9IERyYWdFdmVudC5vYnRhaW4oRHJhZ0V2ZW50LkFDVElPTl9EUk9QLAorICAgICAgICAgICAgICAgICAgICB4IC0gdG91Y2hlZFdpbi5tRnJhbWUubGVmdCwgeSAtIHRvdWNoZWRXaW4ubUZyYW1lLnRvcCwKKyAgICAgICAgICAgICAgICAgICAgbnVsbCwgbURhdGEsIGZhbHNlKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgdG91Y2hlZFdpbi5tQ2xpZW50LmRpc3BhdGNoRHJhZ0V2ZW50KGV2dCk7CisKKyAgICAgICAgICAgICAgICAvLyA1IHNlY29uZCB0aW1lb3V0IGZvciB0aGlzIHdpbmRvdyB0byByZXNwb25kIHRvIHRoZSBkcm9wCisgICAgICAgICAgICAgICAgbUgucmVtb3ZlTWVzc2FnZXMoSC5EUkFHX0VORF9USU1FT1VULCB0b2tlbik7CisgICAgICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtSC5vYnRhaW5NZXNzYWdlKEguRFJBR19FTkRfVElNRU9VVCwgdG9rZW4pOworICAgICAgICAgICAgICAgIG1ILnNlbmRNZXNzYWdlRGVsYXllZChtc2csIDUwMDApOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAiY2FuJ3Qgc2VuZCBkcm9wIG5vdGlmaWNhdGlvbiB0byB3aW4gIiArIHRvdWNoZWRXaW4pOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBpZiAobXlQaWQgIT0gdG91Y2hlZFdpbi5tU2Vzc2lvbi5tUGlkKSB7CisgICAgICAgICAgICAgICAgICAgIGV2dC5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgbVRva2VuID0gdG9rZW47CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICAvLyBGaW5kIHRoZSB2aXNpYmxlLCB0b3VjaC1kZWxpdmVyYWJsZSB3aW5kb3cgdW5kZXIgdGhlIGdpdmVuIHBvaW50CisgICAgICAgIHByaXZhdGUgV2luZG93U3RhdGUgZ2V0VG91Y2hlZFdpbkF0UG9pbnRMdyhmbG9hdCB4ZiwgZmxvYXQgeWYpIHsKKyAgICAgICAgICAgIFdpbmRvd1N0YXRlIHRvdWNoZWRXaW4gPSBudWxsOworICAgICAgICAgICAgZmluYWwgaW50IHggPSAoaW50KSB4ZjsKKyAgICAgICAgICAgIGZpbmFsIGludCB5ID0gKGludCkgeWY7CisgICAgICAgICAgICBmaW5hbCBBcnJheUxpc3Q8V2luZG93U3RhdGU+IHdpbmRvd3MgPSBtV2luZG93czsKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gd2luZG93cy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gTiAtIDE7IGkgPj0gMDsgaS0tKSB7CisgICAgICAgICAgICAgICAgV2luZG93U3RhdGUgY2hpbGQgPSB3aW5kb3dzLmdldChpKTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZmxhZ3MgPSBjaGlsZC5tQXR0cnMuZmxhZ3M7CisgICAgICAgICAgICAgICAgaWYgKCFjaGlsZC5pc1Zpc2libGVMdygpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIG5vdCB2aXNpYmxlID09IGRvbid0IHRlbGwgYWJvdXQgZHJhZ3MKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgoZmxhZ3MgJiBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5GTEFHX05PVF9UT1VDSEFCTEUpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gbm90IHRvdWNoYWJsZSA9PSBkb24ndCB0ZWxsIGFib3V0IGRyYWdzCisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBhY2NvdW50IGZvciB0aGUgd2luZG93J3MgZGVjb3IgZXRjCisgICAgICAgICAgICAgICAgdG1wUmVjdC5zZXQoY2hpbGQubUZyYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoY2hpbGQubVRvdWNoYWJsZUluc2V0cyA9PSBWaWV3VHJlZU9ic2VydmVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLkludGVybmFsSW5zZXRzSW5mby5UT1VDSEFCTEVfSU5TRVRTX0NPTlRFTlQpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVGhlIHBvaW50IGlzIGluc2lkZSBvZiB0aGUgd2luZG93IGlmIGl0IGlzCisgICAgICAgICAgICAgICAgICAgIC8vIGluc2lkZSB0aGUgZnJhbWUsIEFORCB0aGUgY29udGVudCBwYXJ0IG9mIHRoYXQKKyAgICAgICAgICAgICAgICAgICAgLy8gZnJhbWUgdGhhdCB3YXMgZ2l2ZW4gYnkgdGhlIGFwcGxpY2F0aW9uLgorICAgICAgICAgICAgICAgICAgICB0bXBSZWN0LmxlZnQgKz0gY2hpbGQubUdpdmVuQ29udGVudEluc2V0cy5sZWZ0OworICAgICAgICAgICAgICAgICAgICB0bXBSZWN0LnRvcCArPSBjaGlsZC5tR2l2ZW5Db250ZW50SW5zZXRzLnRvcDsKKyAgICAgICAgICAgICAgICAgICAgdG1wUmVjdC5yaWdodCAtPSBjaGlsZC5tR2l2ZW5Db250ZW50SW5zZXRzLnJpZ2h0OworICAgICAgICAgICAgICAgICAgICB0bXBSZWN0LmJvdHRvbSAtPSBjaGlsZC5tR2l2ZW5Db250ZW50SW5zZXRzLmJvdHRvbTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoaWxkLm1Ub3VjaGFibGVJbnNldHMgPT0gVmlld1RyZWVPYnNlcnZlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5JbnRlcm5hbEluc2V0c0luZm8uVE9VQ0hBQkxFX0lOU0VUU19WSVNJQkxFKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBwb2ludCBpcyBpbnNpZGUgb2YgdGhlIHdpbmRvdyBpZiBpdCBpcworICAgICAgICAgICAgICAgICAgICAvLyBpbnNpZGUgdGhlIGZyYW1lLCBBTkQgdGhlIHZpc2libGUgcGFydCBvZiB0aGF0CisgICAgICAgICAgICAgICAgICAgIC8vIGZyYW1lIHRoYXQgd2FzIGdpdmVuIGJ5IHRoZSBhcHBsaWNhdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgdG1wUmVjdC5sZWZ0ICs9IGNoaWxkLm1HaXZlblZpc2libGVJbnNldHMubGVmdDsKKyAgICAgICAgICAgICAgICAgICAgdG1wUmVjdC50b3AgKz0gY2hpbGQubUdpdmVuVmlzaWJsZUluc2V0cy50b3A7CisgICAgICAgICAgICAgICAgICAgIHRtcFJlY3QucmlnaHQgLT0gY2hpbGQubUdpdmVuVmlzaWJsZUluc2V0cy5yaWdodDsKKyAgICAgICAgICAgICAgICAgICAgdG1wUmVjdC5ib3R0b20gLT0gY2hpbGQubUdpdmVuVmlzaWJsZUluc2V0cy5ib3R0b207CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZpbmFsIGludCB0b3VjaEZsYWdzID0gZmxhZ3MgJgorICAgICAgICAgICAgICAgICAgICAoV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19OT1RfRk9DVVNBQkxFCisgICAgICAgICAgICAgICAgICAgIHwgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19OT1RfVE9VQ0hfTU9EQUwpOworICAgICAgICAgICAgICAgIGlmICh0bXBSZWN0LmNvbnRhaW5zKHgsIHkpIHx8IHRvdWNoRmxhZ3MgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAvLyBGb3VuZCBpdAorICAgICAgICAgICAgICAgICAgICB0b3VjaGVkV2luID0gY2hpbGQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHRvdWNoZWRXaW47CisgICAgICAgIH0KKyAgICB9CisKKyAgICBEcmFnU3RhdGUgbURyYWdTdGF0ZSA9IG51bGw7CisgICAgcHJpdmF0ZSBmaW5hbCBJbnB1dEhhbmRsZXIgbURyYWdJbnB1dEhhbmRsZXIgPSBuZXcgQmFzZUlucHV0SGFuZGxlcigpIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1vdGlvbihNb3Rpb25FdmVudCBldmVudCwgUnVubmFibGUgZmluaXNoZWRDYWxsYmFjaykgeworICAgICAgICAgICAgYm9vbGVhbiBlbmREcmFnID0gZmFsc2U7CisgICAgICAgICAgICBmaW5hbCBmbG9hdCBuZXdYID0gZXZlbnQuZ2V0UmF3WCgpOworICAgICAgICAgICAgZmluYWwgZmxvYXQgbmV3WSA9IGV2ZW50LmdldFJhd1koKTsKKworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAobURyYWdTdGF0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoZXZlbnQuZ2V0QWN0aW9uKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTjogeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0RSQUcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAiVW5leHBlY3RlZCBBQ1RJT05fRE9XTiBpbiBkcmFnIGxheWVyIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRTogeworICAgICAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtV2luZG93TWFwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbW92ZSB0aGUgc3VyZmFjZSBhbmQgdGVsbCB0aGUgaW52b2x2ZWQgd2luZG93KHMpIHdoZXJlIHdlIGFyZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUubm90aWZ5TW92ZUx3KG5ld1gsIG5ld1kpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1VQOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfRFJBRykgU2xvZy5kKFRBRywgIkdvdCBVUCBvbiBtb3ZlIGNoYW5uZWw7IGRyb3BwaW5nIGF0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBuZXdYICsgIiwiICsgbmV3WSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1XaW5kb3dNYXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmREcmFnID0gbURyYWdTdGF0ZS5ub3RpZnlEcm9wTHcobmV3WCwgbmV3WSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fQ0FOQ0VMOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfRFJBRykgU2xvZy5kKFRBRywgIkRyYWcgY2FuY2VsbGVkISIpOworICAgICAgICAgICAgICAgICAgICAgICAgZW5kRHJhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoZW5kRHJhZykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0RSQUcpIFNsb2cuZChUQUcsICJEcmFnIGVuZGVkOyB0ZWFyaW5nIGRvd24gc3RhdGUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRlbGwgYWxsIHRoZSB3aW5kb3dzIHRoYXQgdGhlIGRyYWcgaGFzIGVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1XaW5kb3dNYXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJhZ1N0YXRlLmVuZERyYWdMdygpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRXhjZXB0aW9uIGNhdWdodCBieSBkcmFnIGhhbmRsZU1vdGlvbiIsIGUpOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBmaW5pc2hlZENhbGxiYWNrLnJ1bigpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIC8qKgogICAgICAqIFdoZXRoZXIgdGhlIFVJIGlzIGN1cnJlbnRseSBydW5uaW5nIGluIHRvdWNoIG1vZGUgKG5vdCBzaG93aW5nCiAgICAgICogbmF2aWdhdGlvbmFsIGZvY3VzIGJlY2F1c2UgdGhlIHVzZXIgaXMgZGlyZWN0bHkgcHJlc3NpbmcgdGhlIHNjcmVlbikuCiAgICAgICovCkBAIC0xNzg5LDE4ICsyMTU0LDExIEBACiAgICAgICAgIGJvb2xlYW4gcmVwb3J0TmV3Q29uZmlnID0gZmFsc2U7CiAgICAgICAgIFdpbmRvd1N0YXRlIGF0dGFjaGVkV2luZG93ID0gbnVsbDsKICAgICAgICAgV2luZG93U3RhdGUgd2luID0gbnVsbDsKKyAgICAgICAgbG9uZyBvcmlnSWQ7CiAKICAgICAgICAgc3luY2hyb25pemVkKG1XaW5kb3dNYXApIHsKLSAgICAgICAgICAgIC8vIEluc3RhbnRpYXRpbmcgYSBEaXNwbGF5IHJlcXVpcmVzIHRhbGtpbmcgd2l0aCB0aGUgc2ltdWxhdG9yLAotICAgICAgICAgICAgLy8gc28gZG9uJ3QgZG8gaXQgdW50aWwgd2Uga25vdyB0aGUgc3lzdGVtIGlzIG1vc3RseSB1cCBhbmQKLSAgICAgICAgICAgIC8vIHJ1bm5pbmcuCiAgICAgICAgICAgICBpZiAobURpc3BsYXkgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIFdpbmRvd01hbmFnZXIgd20gPSAoV2luZG93TWFuYWdlciltQ29udGV4dC5nZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuV0lORE9XX1NFUlZJQ0UpOwotICAgICAgICAgICAgICAgIG1EaXNwbGF5ID0gd20uZ2V0RGVmYXVsdERpc3BsYXkoKTsKLSAgICAgICAgICAgICAgICBtSW5pdGlhbERpc3BsYXlXaWR0aCA9IG1EaXNwbGF5LmdldFdpZHRoKCk7Ci0gICAgICAgICAgICAgICAgbUluaXRpYWxEaXNwbGF5SGVpZ2h0ID0gbURpc3BsYXkuZ2V0SGVpZ2h0KCk7Ci0gICAgICAgICAgICAgICAgbUlucHV0TWFuYWdlci5zZXREaXNwbGF5U2l6ZSgwLCBtSW5pdGlhbERpc3BsYXlXaWR0aCwgbUluaXRpYWxEaXNwbGF5SGVpZ2h0KTsKLSAgICAgICAgICAgICAgICByZXBvcnROZXdDb25maWcgPSB0cnVlOworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkRpc3BsYXkgaGFzIG5vdCBiZWVuIGluaXRpYWxpYWxpemVkIik7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGlmIChtV2luZG93TWFwLmNvbnRhaW5zS2V5KGNsaWVudC5hc0JpbmRlcigpKSkgewpAQCAtMTkwNiw3ICsyMjY0LDcgQEAKIAogICAgICAgICAgICAgcmVzID0gV2luZG93TWFuYWdlckltcGwuQUREX09LQVk7CiAKLSAgICAgICAgICAgIGZpbmFsIGxvbmcgb3JpZ0lkID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgICAgICBvcmlnSWQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKIAogICAgICAgICAgICAgaWYgKGFkZFRva2VuKSB7CiAgICAgICAgICAgICAgICAgbVRva2VuTWFwLnB1dChhdHRycy50b2tlbiwgdG9rZW4pOwpAQCAtMTk4MywxNCArMjM0MSwxMCBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgLy8gc2VuZE5ld0NvbmZpZ3VyYXRpb24oKSBjaGVja3MgY2FsbGVyIHBlcm1pc3Npb25zIHNvIHdlIG11c3QgY2FsbCBpdCB3aXRoCi0gICAgICAgIC8vIHByaXZpbGVnZS4gIHVwZGF0ZU9yaWVudGF0aW9uRnJvbUFwcFRva2VucygpIGNsZWFycyBhbmQgcmVzZXRzIHRoZSBjYWxsZXIKLSAgICAgICAgLy8gaWRlbnRpdHkgYW55d2F5LCBzbyBpdCdzIHNhZmUgdG8ganVzdCBjbGVhciAmIHJlc3RvcmUgYXJvdW5kIHRoaXMgd2hvbGUKLSAgICAgICAgLy8gYmxvY2suCi0gICAgICAgIGZpbmFsIGxvbmcgb3JpZ0lkID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CiAgICAgICAgIGlmIChyZXBvcnROZXdDb25maWcpIHsKICAgICAgICAgICAgIHNlbmROZXdDb25maWd1cmF0aW9uKCk7CiAgICAgICAgIH0KKwogICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShvcmlnSWQpOwogCiAgICAgICAgIHJldHVybiByZXM7CkBAIC00NDM2LDggKzQ3OTAsNyBAQAogICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtV2luZG93cy5zaXplKCk7CiAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgV2luZG93U3RhdGUgdyA9IG1XaW5kb3dzLmdldChpKTsKLSAgICAgICAgICAgICAgICBpZiAody5pc1Zpc2libGVMdygpICYmICF3Lm1PYnNjdXJlZAotICAgICAgICAgICAgICAgICAgICAgICAgJiYgKHcubU9yaWVudGF0aW9uQ2hhbmdpbmcgfHwgIXcuaXNEcmF3bkx3KCkpKSB7CisgICAgICAgICAgICAgICAgaWYgKHcuaXNWaXNpYmxlTHcoKSAmJiAhdy5tT2JzY3VyZWQgJiYgIXcuaXNEcmF3bkx3KCkpIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTUwNTUsNyArNTQwOCw2MCBAQAogICAgICAgICBtUG9saWN5LmFkanVzdENvbmZpZ3VyYXRpb25Mdyhjb25maWcpOwogICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICB9Ci0gICAgCisKKyAgICAvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgLy8gRHJhZyBhbmQgZHJvcAorICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgIElCaW5kZXIgcHJlcGFyZURyYWdTdXJmYWNlKElXaW5kb3cgd2luZG93LCBTdXJmYWNlU2Vzc2lvbiBzZXNzaW9uLAorICAgICAgICAgICAgYm9vbGVhbiBsb2NhbE9ubHksIGludCB3aWR0aCwgaW50IGhlaWdodCwgU3VyZmFjZSBvdXRTdXJmYWNlKSB7CisgICAgICAgIGlmIChERUJVR19EUkFHKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAicHJlcGFyZSBkcmFnIHN1cmZhY2U6IHc9IiArIHdpZHRoICsgIiBoPSIgKyBoZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgKyAiIGxvY2FsPSIgKyBsb2NhbE9ubHkgKyAiIHdpbj0iICsgd2luZG93CisgICAgICAgICAgICAgICAgICAgICsgIiBhc2JpbmRlcj0iICsgd2luZG93LmFzQmluZGVyKCkpOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgaW50IGNhbGxlclBpZCA9IEJpbmRlci5nZXRDYWxsaW5nUGlkKCk7CisgICAgICAgIGZpbmFsIGxvbmcgb3JpZ0lkID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgIElCaW5kZXIgdG9rZW4gPSBudWxsOworCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1XaW5kb3dNYXApIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAvLyAhISEgVE9ETzogZmFpbCBpZiB0aGUgZ2l2ZW4gd2luZG93IGRvZXMgbm90IGN1cnJlbnRseSBoYXZlIHRvdWNoIGZvY3VzPworCisgICAgICAgICAgICAgICAgICAgIGlmIChtRHJhZ1N0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN1cmZhY2Ugc3VyZmFjZSA9IG5ldyBTdXJmYWNlKHNlc3Npb24sIGNhbGxlclBpZCwgImRyYWcgc3VyZmFjZSIsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoLCBoZWlnaHQsIFBpeGVsRm9ybWF0LlRSQU5TTFVDRU5ULCBTdXJmYWNlLkhJRERFTik7CisgICAgICAgICAgICAgICAgICAgICAgICBvdXRTdXJmYWNlLmNvcHlGcm9tKHN1cmZhY2UpOworICAgICAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSBuZXcgQmluZGVyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtRHJhZ1N0YXRlID0gbmV3IERyYWdTdGF0ZSh0b2tlbiwgc3VyZmFjZSwgbG9jYWxPbmx5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUubVN1cmZhY2UgPSBzdXJmYWNlOworICAgICAgICAgICAgICAgICAgICAgICAgbURyYWdTdGF0ZS5tTG9jYWxPbmx5ID0gbG9jYWxPbmx5OworICAgICAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSBtRHJhZ1N0YXRlLm1Ub2tlbiA9IG5ldyBCaW5kZXIoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gNSBzZWNvbmQgdGltZW91dCBmb3IgdGhpcyB3aW5kb3cgdG8gYWN0dWFsbHkgYmVnaW4gdGhlIGRyYWcKKyAgICAgICAgICAgICAgICAgICAgICAgIG1ILnJlbW92ZU1lc3NhZ2VzKEguRFJBR19TVEFSVF9USU1FT1VULCB3aW5kb3cpOworICAgICAgICAgICAgICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtSC5vYnRhaW5NZXNzYWdlKEguRFJBR19TVEFSVF9USU1FT1VULCB3aW5kb3cuYXNCaW5kZXIoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtSC5zZW5kTWVzc2FnZURlbGF5ZWQobXNnLCA1MDAwKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJEcmFnIGFscmVhZHkgaW4gcHJvZ3Jlc3MiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFN1cmZhY2UuT3V0T2ZSZXNvdXJjZXNFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiQ2FuJ3QgYWxsb2NhdGUgZHJhZyBzdXJmYWNlIHc9IiArIHdpZHRoICsgIiBoPSIgKyBoZWlnaHQsIGUpOworICAgICAgICAgICAgICAgICAgICBpZiAobURyYWdTdGF0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtRHJhZ1N0YXRlLnJlc2V0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtRHJhZ1N0YXRlID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KG9yaWdJZCk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gdG9rZW47CisgICAgfQorCiAgICAgLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgIC8vIElucHV0IEV2ZW50cyBhbmQgRm9jdXMgTWFuYWdlbWVudAogICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KQEAgLTUxNTQsNyArNTU2MCw0MCBAQAogICAgICAgICAgICAgCiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQotICAgICAgICAKKworICAgICAgICBwcml2YXRlIHZvaWQgYWRkRHJhZ0lucHV0V2luZG93THcoSW5wdXRXaW5kb3dMaXN0IHdpbmRvd0xpc3QpIHsKKyAgICAgICAgICAgIGZpbmFsIElucHV0V2luZG93IGlucHV0V2luZG93ID0gd2luZG93TGlzdC5hZGQoKTsKKyAgICAgICAgICAgIGlucHV0V2luZG93LmlucHV0Q2hhbm5lbCA9IG1EcmFnU3RhdGUubVNlcnZlckNoYW5uZWw7CisgICAgICAgICAgICBpbnB1dFdpbmRvdy5uYW1lID0gImRyYWciOworICAgICAgICAgICAgaW5wdXRXaW5kb3cubGF5b3V0UGFyYW1zRmxhZ3MgPSAwOworICAgICAgICAgICAgaW5wdXRXaW5kb3cubGF5b3V0UGFyYW1zVHlwZSA9IFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLlRZUEVfRFJBRzsKKyAgICAgICAgICAgIGlucHV0V2luZG93LmRpc3BhdGNoaW5nVGltZW91dE5hbm9zID0gREVGQVVMVF9JTlBVVF9ESVNQQVRDSElOR19USU1FT1VUX05BTk9TOworICAgICAgICAgICAgaW5wdXRXaW5kb3cudmlzaWJsZSA9IHRydWU7CisgICAgICAgICAgICBpbnB1dFdpbmRvdy5jYW5SZWNlaXZlS2V5cyA9IGZhbHNlOworICAgICAgICAgICAgaW5wdXRXaW5kb3cuaGFzRm9jdXMgPSB0cnVlOworICAgICAgICAgICAgaW5wdXRXaW5kb3cuaGFzV2FsbHBhcGVyID0gZmFsc2U7CisgICAgICAgICAgICBpbnB1dFdpbmRvdy5wYXVzZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIGlucHV0V2luZG93LmxheWVyID0gbURyYWdTdGF0ZS5nZXREcmFnTGF5ZXJMdygpOworICAgICAgICAgICAgaW5wdXRXaW5kb3cub3duZXJQaWQgPSBQcm9jZXNzLm15UGlkKCk7CisgICAgICAgICAgICBpbnB1dFdpbmRvdy5vd25lclVpZCA9IFByb2Nlc3MubXlVaWQoKTsKKworICAgICAgICAgICAgLy8gVGhlIGRyYWcgd2luZG93IGNvdmVycyB0aGUgZW50aXJlIGRpc3BsYXkKKyAgICAgICAgICAgIGlucHV0V2luZG93LmZyYW1lTGVmdCA9IDA7CisgICAgICAgICAgICBpbnB1dFdpbmRvdy5mcmFtZVRvcCA9IDA7CisgICAgICAgICAgICBpbnB1dFdpbmRvdy5mcmFtZVJpZ2h0ID0gbURpc3BsYXkuZ2V0V2lkdGgoKTsKKyAgICAgICAgICAgIGlucHV0V2luZG93LmZyYW1lQm90dG9tID0gbURpc3BsYXkuZ2V0SGVpZ2h0KCk7CisKKyAgICAgICAgICAgIGlucHV0V2luZG93LnZpc2libGVGcmFtZUxlZnQgPSBpbnB1dFdpbmRvdy5mcmFtZUxlZnQ7CisgICAgICAgICAgICBpbnB1dFdpbmRvdy52aXNpYmxlRnJhbWVUb3AgPSBpbnB1dFdpbmRvdy5mcmFtZVRvcDsKKyAgICAgICAgICAgIGlucHV0V2luZG93LnZpc2libGVGcmFtZVJpZ2h0ID0gaW5wdXRXaW5kb3cuZnJhbWVSaWdodDsKKyAgICAgICAgICAgIGlucHV0V2luZG93LnZpc2libGVGcmFtZUJvdHRvbSA9IGlucHV0V2luZG93LmZyYW1lQm90dG9tOworCisgICAgICAgICAgICBpbnB1dFdpbmRvdy50b3VjaGFibGVBcmVhTGVmdCA9IGlucHV0V2luZG93LmZyYW1lTGVmdDsKKyAgICAgICAgICAgIGlucHV0V2luZG93LnRvdWNoYWJsZUFyZWFUb3AgPSBpbnB1dFdpbmRvdy5mcmFtZVRvcDsKKyAgICAgICAgICAgIGlucHV0V2luZG93LnRvdWNoYWJsZUFyZ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AgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGFkZERyYWdJbnB1dFdpbmRvd0x3KG1UZW1wSW5wdXRXaW5kb3dzKTsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgZmluYWwgaW50IE4gPSB3aW5kb3dzLnNpemUoKTsKICAgICAgICAgICAgIGZvciAoaW50IGkgPSBOIC0gMTsgaSA+PSAwOyBpLS0pIHsKICAgICAgICAgICAgICAgICBmaW5hbCBXaW5kb3dTdGF0ZSBjaGlsZCA9IHdpbmRvd3MuZ2V0KGkpOwpAQCAtNTE3OCw3ICs1NjI3LDEzIEBACiAgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc1Zpc2libGUgPSBjaGlsZC5pc1Zpc2libGVMdygpOwogICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaGFzV2FsbHBhcGVyID0gKGNoaWxkID09IG1XYWxscGFwZXJUYXJnZXQpCiAgICAgICAgICAgICAgICAgICAgICAgICAmJiAodHlwZSAhPSBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5UWVBFX0tFWUdVQVJEKTsKLSAgICAgICAgICAgICAgICAKKworICAgICAgICAgICAgICAgIC8vIElmIHRoZXJlJ3MgYSBkcmFnIGluIHByb2dyZXNzIGFuZCAnY2hpbGQnIGlzIGEgcG90ZW50aWFsIGRyb3AgdGFyZ2V0LAorICAgICAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSBpdCdzIGJlZW4gdG9sZCBhYm91dCB0aGUgZHJhZworICAgICAgICAgICAgICAgIGlmIChpbkRyYWcgJiYgaXNWaXNpYmxlKSB7CisgICAgICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUuc2VuZERyYWdTdGFydGVkSWZOZWVkZWRMdyhjaGlsZCk7CisgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgLy8gQWRkIGEgd2luZG93IHRvIG91ciBsaXN0IG9mIGlucHV0IHdpbmRvd3MuCiAgICAgICAgICAgICAg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GZsYWdzLAorICAgICAgICAgICAgICAgICAgICBrZXlDb2RlLCBzY2FuQ29kZSwgcG9saWN5RmxhZ3MsIGlzU2NyZWVuT24pOwogICAgICAgICB9CiAgICAgICAgIAogICAgICAgICAvKiBQcm92aWRlcyBhbiBvcHBvcnR1bml0eSBmb3IgdGhlIHdpbmRvdyBtYW5hZ2VyIHBvbGljeSB0byBwcm9jZXNzIGEga2V5IGJlZm9yZQogICAgICAgICAgKiBvcmRpbmFyeSBkaXNwYXRjaC4gKi8KICAgICAgICAgcHVibGljIGJvb2xlYW4gaW50ZXJjZXB0S2V5QmVmb3JlRGlzcGF0Y2hpbmcoSW5wdXRDaGFubmVsIGZvY3VzLAotICAgICAgICAgICAgICAgIGludCBhY3Rpb24sIGludCBmbGFncywgaW50IGtleUNvZGUsIGludCBtZXRhU3RhdGUsIGludCByZXBlYXRDb3VudCwKKyAgICAgICAgICAgICAgICBpbnQgYWN0aW9uLCBpbnQgZmxhZ3MsIGludCBrZXlDb2RlLCBpbnQgc2NhbkNvZGUsIGludCBtZXRhU3RhdGUsIGludCByZXBlYXRDb3VudCwKICAgICAgICAgICAgICAgICBpbnQgcG9saWN5RmxhZ3MpIHsKICAgICAgICAgICAgIFdpbmRvd1N0YXRlIHdpbmRvd1N0YXRlID0gZ2V0V2luZG93U3RhdGVGb3JJbnB1dENoYW5uZWwoZm9jdXMpOwogICAgICAgICAgICAgcmV0dXJuIG1Qb2xpY3kuaW50ZXJjZXB0S2V5QmVmb3JlRGlzcGF0Y2hpbmcod2luZG93U3RhdGUsIGFjdGlvbiwgZmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgIGtleUNvZGUsIG1ldGFTdGF0ZSwgcmVwZWF0Q291bnQsIHBvbGljeUZsYWdzKTsKKyAgICAgICAgICAgICAgICAgICAga2V5Q29kZSwgc2NhbkNvZGUsIG1ldGFTdGF0ZSwgcmVwZWF0Q291bnQsIHBvbGljeUZsYWdzKTsKICAgICAgICAgfQogICAgICAgICAKICAgICAg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yNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAKKyAgICAgICAgLyogRHJhZy9kcm9wICovCisgICAgICAgIHB1YmxpYyBJQmluZGVyIHByZXBhcmVEcmFnKElXaW5kb3cgd2luZG93LCBib29sZWFuIGxvY2FsT25seSwKKyAgICAgICAgICAgICAgICBpbnQgd2lkdGgsIGludCBoZWlnaHQsIFN1cmZhY2Ugb3V0U3VyZmFjZSkgeworICAgICAgICAgICAgcmV0dXJuIHByZXBhcmVEcmFnU3VyZmFjZSh3aW5kb3csIG1TdXJmYWNlU2Vzc2lvbiwgbG9jYWxPbmx5LAorICAgICAgICAgICAgICAgICAgICB3aWR0aCwgaGVpZ2h0LCBvdXRTdXJmYWNlKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIHBlcmZvcm1EcmFnKElXaW5kb3cgd2luZG93LCBJQmluZGVyIGRyYWdUb2tlbiwKKyAgICAgICAgICAgICAgICBmbG9hdCB0b3VjaFgsIGZsb2F0IHRvdWNoWSwgZmxvYXQgdGh1bWJDZW50ZXJYLCBmbG9hdCB0aHVtYkNlbnRlclksCisgICAgICAgICAgICAgICAgQ2xpcERhdGEgZGF0YSkgeworICAgICAgICAgICAgaWYgKERFQlVHX0RSQUcpIHsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAicGVyZm9ybSBkcmFnOiB3aW49IiArIHdpbmRvdyArICIgZGF0YT0iICsgZGF0YSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVdpbmRvd01hcCkgeworICAgICAgICAgICAgICAgIGlmIChtRHJhZ1N0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIk5vIGRyYWcgcHJlcGFyZWQiKTsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigicGVyZm9ybURyYWcoKSB3aXRob3V0IHByZXBhcmVEcmFnKCkiKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoZHJhZ1Rva2VuICE9IG1EcmFnU3RhdGUubVRva2VuKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJQZXJmb3JtaW5nIG1pc21hdGNoZWQgZHJhZyIpOworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJwZXJmb3JtRHJhZygpIGRvZXMgbm90IG1hdGNoIHByZXBhcmVEcmFnKCkiKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBXaW5kb3dTdGF0ZSBjYWxsaW5nV2luID0gd2luZG93Rm9yQ2xpZW50TG9ja2VkKG51bGwsIHdpbmRvdywgZmFsc2UpOworICAgICAgICAgICAgICAgIGlmIChjYWxsaW5nV2luID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIkJhZCByZXF1ZXN0aW5nIHdpbmRvdyAiICsgd2luZG93KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOyAgLy8gISEhIFRPRE86IHRocm93IGhlcmU/CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gISEhIFRPRE86IGlmIGlucHV0IGlzIG5vdCBzdGlsbCBmb2N1c2VkIG9uIHRoZSBpbml0aWF0aW5nIHdpbmRvdywgZmFpbAorICAgICAgICAgICAgICAgIC8vIHRoZSBkcmFnIGluaXRpYXRpb24gKGUuZy4gYW4gYWxhcm0gd2luZG93IHBvcHBlZCB1cCBqdXN0IGFzIHRoZSBhcHBsaWNhdGlvbgorICAgICAgICAgICAgICAgIC8vIGNhbGxlZCBwZXJmb3JtRHJhZygpCisKKyAgICAgICAgICAgICAgICBtSC5yZW1vdmVNZXNzYWdlcyhILkRSQUdfU1RBUlRfVElNRU9VVCwgd2luZG93LmFzQmluZGVyKCkpOworCisgICAgICAgICAgICAgICAgLy8gISEhIFRPRE86IGV4dHJhY3QgdGhlIGN1cnJlbnQgdG91Y2ggKHgsIHkpIGluIHNjcmVlbiBjb29yZGluYXRlcy4gIFRoYXQKKyAgICAgICAgICAgICAgICAvLyB3aWxsIGxldCB1cyBlbGltaW5hdGUgdGhlICh0b3VjaFgsdG91Y2hZKSBwYXJhbWV0ZXJzIGZyb20gdGhlIEFQSS4KKworICAgICAgICAgICAgICAgIC8vICEhISBGSVhNRTogcHV0IGFsbCB0aGlzIGhlYXZ5IHN0dWZmIG9udG8gdGhlIG1IIGxvb3BlciwgYXMgd2VsbCBhcworICAgICAgICAgICAgICAgIC8vIHRoZSBhY3R1YWwgZHJhZyBldmVudCBkaXNwYXRjaCBzdHVmZiBpbiB0aGUgZHJhZ3N0YXRlCisKKyAgICAgICAgICAgICAgICBtRHJhZ1N0YXRlLnJlZ2lzdGVyKCk7CisgICAgICAgICAgICAgICAgbUlucHV0TW9uaXRvci51cGRhdGVJbnB1dFdpbmRvd3NMdygpOworICAgICAgICAgICAgICAgIGlmICghbUlucHV0TWFuYWdlci50cmFuc2ZlclRvdWNoRm9jdXMoY2FsbGluZ1dpbi5tSW5wdXRDaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgbURyYWdTdGF0ZS5tU2VydmVyQ2hhbm5lbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIlVuYWJsZSB0byB0cmFuc2ZlciB0b3VjaCBmb2N1cyIpOworICAgICAgICAgICAgICAgICAgICBtRHJhZ1N0YXRlLnVucmVnaXN0ZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgbURyYWdTdGF0ZSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIG1JbnB1dE1vbml0b3IudXBkYXRlSW5wdXRXaW5kb3dzTHcoKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUubURhdGEgPSBkYXRhOworICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUubUN1cnJlbnRYID0gdG91Y2hYOworICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUubUN1cnJlbnRZID0gdG91Y2hZOworICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUuYnJvYWRjYXN0RHJhZ1N0YXJ0ZWRMdyh0b3VjaFgsIHRvdWNoWSk7CisKKyAgICAgICAgICAgICAgICAvLyByZW1lbWJlciB0aGUgdGh1bWIgb2Zmc2V0cyBmb3IgbGF0ZXIKKyAgICAgICAgICAgICAgICBtRHJhZ1N0YXRlLm1UaHVtYk9mZnNldFggPSB0aHVtYkNlbnRlclg7CisgICAgICAgICAgICAgICAgbURyYWdTdGF0ZS5tVGh1bWJPZmZzZXRZID0gdGh1bWJDZW50ZXJZOworCisgICAgICAgICAgICAgICAgLy8gTWFrZSB0aGUgc3VyZmFjZSB2aXNpYmxlIGF0IHRoZSBwcm9wZXIgbG9jYXRpb24KKyAgICAgICAgICAgICAgICBmaW5hbCBTdXJmYWNlIHN1cmZhY2UgPSBtRHJhZ1N0YXRlLm1TdXJmYWNlOworICAgICAgICAgICAgICAgIFN1cmZhY2Uub3BlblRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgc3VyZmFjZS5zZXRQb3NpdGlvbigoaW50KSh0b3VjaFggLSB0aHVtYkNlbnRlclgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpKHRvdWNoWSAtIHRodW1iQ2VudGVyWSkpOworICAgICAgICAgICAgICAgICAgICBzdXJmYWNlLnNldEFscGhhKC43MDcxZik7CisgICAgICAgICAgICAgICAgICAgIHN1cmZhY2Uuc2V0TGF5ZXIobURyYWdTdGF0ZS5nZXREcmFnTGF5ZXJMdygpKTsKKyAgICAgICAgICAgICAgICAgICAgc3VyZmFjZS5zaG93KCk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgU3VyZmFjZS5jbG9zZVRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsgICAgLy8gc3VjY2VzcyEKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHJlcG9ydERyb3BSZXN1bHQoSVdpbmRvdyB3aW5kb3csIGJvb2xlYW4gY29uc3VtZWQpIHsKKyAgICAgICAgICAgIElCaW5kZXIgdG9rZW4gPSB3aW5kb3cuYXNCaW5kZXIoKTsKKyAgICAgICAgICAgIGlmIChERUJVR19EUkFHKSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkRyb3AgcmVzdWx0PSIgKyBjb25zdW1lZCArICIgcmVwb3J0ZWQgYnkgIiArIHRva2VuKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3luY2hyb25pemVkIChtV2luZG93TWFwKSB7CisgICAgICAgICAgICAgICAgaWYgKG1EcmFnU3RhdGUubVRva2VuICE9IHRva2VuKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJJbnZhbGlkIGRyb3AtcmVzdWx0IGNsYWltIGJ5ICIgKyB3aW5kb3cpOworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJyZXBvcnREcm9wUmVzdWx0KCkgYnkgbm9uLXJlY2lwaWVudCIpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIFRoZSByaWdodCB3aW5kb3cgaGFzIHJlc3BvbmRlZCwgZXZlbiBpZiBpdCdzIG5vIGxvbmdlciBhcm91bmQsCisgICAgICAgICAgICAgICAgLy8gc28gYmUgc3VyZSB0byBoYWx0IHRoZSB0aW1lb3V0IGV2ZW4gaWYgdGhlIGxhdGVyIFdpbmRvd1N0YXRlCisgICAgICAgICAgICAgICAgLy8gbG9va3VwIGZhaWxzLgorICAgICAgICAgICAgICAgIG1ILnJlbW92ZU1lc3NhZ2VzKEguRFJBR19FTkRfVElNRU9VVCwgd2luZG93LmFzQmluZGVyKCkpOworCisgICAgICAgICAgICAgICAgV2luZG93U3RhdGUgY2FsbGluZ1dpbiA9IHdpbmRvd0ZvckNsaWVudExvY2tlZChudWxsLCB3aW5kb3csIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBpZiAoY2FsbGluZ1dpbiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJCYWQgcmVzdWx0LXJlcG9ydGluZyB3aW5kb3cgIiArIHdpbmRvdyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsgIC8vICEhISBUT0RPOiB0aHJvdyBoZXJlPworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUubURyYWdSZXN1bHQgPSBjb25zdW1lZDsKKyAgICAgICAgICAgICAgICBtRHJhZ1N0YXRlLmVuZERyYWdMdygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgZHJhZ1JlY2lwaWVudEVudGVyZWQoSVdpbmRvdyB3aW5kb3cpIHsKKyAgICAgICAgICAgIGlmIChERUJVR19EUkFHKSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIkRyYWcgaW50byBuZXcgY2FuZGlkYXRlIHZpZXcgQCAiICsgd2luZG93LmFzQmluZGVyKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgZHJhZ1JlY2lwaWVudEV4aXRlZChJV2luZG93IHdpbmRvdykgeworICAgICAgICAgICAgaWYgKERFQlVHX0RSQUcpIHsKKyAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiRHJhZyBmcm9tIG9sZCBjYW5kaWRhdGUgdmlldyBAICIgKyB3aW5kb3cuYXNCaW5kZXIoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKwogICAgICAgICBwdWJsaWMgdm9pZCBzZXRXYWxscGFwZXJQb3NpdGlvbihJQmluZGVyIHdpbmRvdywgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeFN0ZXAsIGZsb2F0IHlTdGVwKSB7CiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQobVdpbmRvd01hcCkgewogICAgICAgICAgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKQEAgLTYzMDgsMTAgKzY4OTksMTYgQEAKICAgICAgICAgICAgICAgICBtU3VyZmFjZVcgPSB3OwogICAgICAgICAgICAgICAgIG1TdXJmYWNlSCA9IGg7CiAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc0h3QWNjZWxlcmF0ZWQgPSAobUF0dHJzLmZsYWdzICYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5GTEFHX0hBUkRXQVJFX0FDQ0VMRVJBVEVEKSAhPSAwOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgZm9ybWF0ID0gaXNId0FjY2VsZXJhdGVkID8gUGl4ZWxGb3JtYXQuVFJBTlNMVUNFTlQgOiBtQXR0cnMuZm9ybWF0OworICAgICAgICAgICAgICAgICAgICBpZiAoaXNId0FjY2VsZXJhdGVkICYmIG1BdHRycy5mb3JtYXQgPT0gUGl4ZWxGb3JtYXQuT1BBUVVFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmbGFncyB8PSBTdXJmYWNlLk9QQVFVRTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZSA9IG5ldyBTdXJmYWNlKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TZXNzaW9uLm1TdXJmYWNlU2Vzc2lvbiwgbVNlc3Npb24ubVBpZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cnMuZ2V0VGl0bGUoKS50b1N0cmluZygpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIHcsIGgsIG1BdHRycy5mb3JtYXQsIGZsYWdzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCB3LCBoLCBmb3JtYXQsIGZsYWdzKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBTbG9nLmkoVEFHLCAiICBDUkVBVEUgU1VSRkFDRSAiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtU3VyZmFjZSArICIgSU4gU0VTU0lPTiAiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtU2Vzc2lvbi5tU3VyZmFjZVNlc3Npb24KQEAgLTY4NDIsNyArNzQzOSw3IEBACiAgICAgICAgICAgICBmaW5hbCBBcHBXaW5kb3dUb2tlbiBhdG9rZW4gPSBtQXBwVG9rZW47CiAgICAgICAgICAgICByZXR1cm4gbVN1cmZhY2UgIT0gbnVsbCAmJiAhbUF0dGFjaGVkSGlkZGVuCiAgICAgICAgICAgICAgICAgICAgICYmIChhdG9rZW4gPT0gbnVsbCA/IG1Qb2xpY3lWaXNpYmlsaXR5IDogIWF0b2tlbi5oaWRkZW5SZXF1ZXN0ZWQpCi0gICAgICAgICAgICAgICAgICAgICYmIChtT3JpZW50YXRpb25DaGFuZ2luZyB8fCAoIW1EcmF3UGVuZGluZyAmJiAhbUNvbW1pdERyYXdQZW5kaW5nKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIW1EcmF3UGVuZGluZyAmJiAhbUNvbW1pdERyYXdQZW5kaW5nCiAgICAgICAgICAgICAgICAgICAgICYmICFtRXhpdGluZyAmJiAhbURlc3Ryb3lpbmc7CiAgICAgICAgIH0KIApAQCAtNjg2OCw2ICs3NDY1LDE1IEBACiAgICAgICAgIH0KIAogICAgICAgICAvKioKK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ogdG8gc3RvcCB0aGluZ3MgZnJvbSBleGVjdXRpbmcgZHVyaW5nIHRoYXQgdGltZS4KKyAgICAgICAgICogY29tcGxldGUgVUkgaW4gdG8uCiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc0RyYXduTHcoKSB7CiAgICAgICAgICAgICBmaW5hbCBBcHBXaW5kb3dUb2tlbiBhdG9rZW4gPSBtQXBwVG9rZW47CiAgICAgICAgICAgICByZXR1cm4gbVN1cmZhY2UgIT0gbnVsbCAmJiAhbURlc3Ryb3lpbmcKLSAgICAgICAgICAgICAgICAmJiAobU9yaWVudGF0aW9uQ2hhbmdpbmcgfHwgKCFtRHJhd1BlbmRpbmcgJiYgIW1Db21taXREcmF3UGVuZGluZykpOworICAgICAgICAgICAgICAgICYmICFtRHJhd1BlbmRpbmcgJiYgIW1Db21taXREcmF3UGVuZGluZzsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgpAQCAtNzc3MSw2ICs4Mzc1LDggQEAKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQVBQX0ZSRUVaRV9USU1FT1VUID0gMTc7CiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFNFTkRfTkVXX0NPTkZJR1VSQVRJT04gPSAxODsKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUkVQT1JUX1dJTkRPV1NfQ0hBTkdFID0gMTk7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IERSQUdfU1RBUlRfVElNRU9VVCA9IDIwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBEUkFHX0VORF9USU1FT1VUID0gMjE7CiAKICAgICAgICAgcHJpdmF0ZSBTZXNzaW9uIG1MYXN0UmVwb3J0ZWRIb2xkOwogCkBAIC04MTEzLDYgKzg3MTksMzUgQEAKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogCisgICAgICAgICAgICAgICAgY2FzZSBEUkFHX1NUQVJUX1RJTUVPVVQ6IHsKKyAgICAgICAgICAgICAgICAgICAgSUJpbmRlciB3aW4gPSAoSUJpbmRlciltc2cub2JqOworICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfRFJBRykgeworICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIlRpbWVvdXQgc3RhcnRpbmcgZHJhZyBieSB3aW4gIiArIHdpbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtV2luZG93TWFwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyAhISEgVE9ETzogQU5SIHRoZSBhcHAgdGhhdCBoYXMgZmFpbGVkIHRvIHN0YXJ0IHRoZSBkcmFnIGluIHRpbWUKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRHJhZ1N0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJhZ1N0YXRlLnVucmVnaXN0ZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW5wdXRNb25pdG9yLnVwZGF0ZUlucHV0V2luZG93c0x3KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURyYWdTdGF0ZS5yZXNldCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNhc2UgRFJBR19FTkRfVElNRU9VVDogeworICAgICAgICAgICAgICAgICAgICBJQmluZGVyIHdpbiA9IChJQmluZGVyKW1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19EUkFHKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAiVGltZW91dCBlbmRpbmcgZHJhZyB0byB3aW4gIiArIHdpbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtV2luZG93TWFwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyAhISEgVE9ETzogQU5SIHRoZSBkcmFnLXJlY2VpdmluZyBhcHAKKyAgICAgICAgICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUubURyYWdSZXN1bHQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1EcmFnU3RhdGUuZW5kRHJhZ0x3KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQpAQCAtODQ1NSw2ICs5MDkwLDExIEBACiAKICAgICBwcml2YXRlIGZpbmFsIHZvaWQgcGVyZm9ybUxheW91dEFuZFBsYWNlU3VyZmFjZXNMb2NrZWRJbm5lcigKICAgICAgICAgICAgIGJvb2xlYW4gcmVjb3ZlcmluZ01lbW9yeSkgeworICAgICAgICBpZiAobURpc3BsYXkgPT0gbnVsbCkgeworICAgICAgICAgICAgU2xvZy5pKFRBRywgInNraXBwaW5nIHBlcmZvcm1MYXlvdXRBbmRQbGFjZVN1cmZhY2VzTG9ja2VkSW5uZXIgd2l0aCBubyBtRGlzcGxheSIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKICAgICAgICAgZmluYWwgbG9uZyBjdXJyZW50VGltZSA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOwogICAgICAgICBmaW5hbCBpbnQgZHcgPSBtRGlzcGxheS5nZXRXaWR0aCgpOwogICAgICAgICBmaW5hbCBpbnQgZGggPSBtRGlzcGxheS5nZXRIZWlnaHQoKTsKQEAgLTkyNDMsMTIgKzk4ODMsNiBAQAogICAgICAgICAgICAgICAgICAgICBpZiAody5tQXR0YWNoZWRIaWRkZW4gfHwgIXcuaXNSZWFkeUZvckRpc3BsYXkoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF3Lm1MYXN0SGlkZGVuKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9kdW1wKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0NPTkZJR1VSQVRJT04pIFNsb2cudihUQUcsICJXaW5kb3cgaGlkaW5nOiB3YWl0aW5nVG9TaG93PSIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdy5tUm9vdFRva2VuLndhaXRpbmdUb1Nob3cgKyAiIHBvbHZpcz0iCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHcubVBvbGljeVZpc2liaWxpdHkgKyAiIGF0dGhpZD0iCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHcubUF0dGFjaGVkSGlkZGVuICsgIiB0b2toaWQ9IgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1Sb290VG9rZW4uaGlkZGVuICsgIiB2aXM9IgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1WaWV3VmlzaWJpbGl0eSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy5tTGFzdEhpZGRlbiA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBsb2dTdXJmYWNlKHcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSElERSAocGVyZm9ybUxheW91dCkiLCBudWxsKTsKQEAgLTk2NDksMzAgKzEwMjgzLDI2IEBACiAgICAgICAgIH0gZWxzZSBpZiAoYW5pbWF0aW5nKSB7CiAgICAgICAgICAgICByZXF1ZXN0QW5pbWF0aW9uTG9ja2VkKGN1cnJlbnRUaW1lKygxMDAwLzYwKS1TeXN0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SAgICAgICAgICAgICAgICAgICAgICAgIChidXR0b25CcmlnaHRuZXNzICogUG93ZXIuQlJJR0hUTkVTU19PTikpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGhvbGRTY3JlZW4gIT0gbUhvbGRpbmdTY3JlZW5PbikgewotICAgICAgICAgICAgICAgIG1Ib2xkaW5nU2NyZWVuT24gPSBob2xkU2NyZWVuOwotICAgICAgICAgICAgICAgIE1lc3NhZ2UgbSA9IG1ILm9idGFpbk1lc3NhZ2UoSC5IT0xEX1NDUkVFTl9DSEFOR0VELCBob2xkU2NyZWVuKTsKLSAgICAgICAgICAgICAgICBtSC5zZW5kTWVzc2FnZShtKTsKLSAgICAgICAgICAgIH0KKworICAgICAgICBzZXRIb2xkU2NyZWVuTG9ja2VkKGhvbGRTY3JlZW4gIT0gbnVsbCk7CisgICAgICAgIGlmIChzY3JlZW5CcmlnaHRuZXNzIDwgMCB8fCBzY3JlZW5CcmlnaHRuZXNzID4gMS4wZikgeworICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRTY3JlZW5CcmlnaHRuZXNzT3ZlcnJpZGUoLTEpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRTY3JlZW5CcmlnaHRuZXNzT3ZlcnJpZGUoKGludCkKKyAgICAgICAgICAgICAgICAgICAgKHNjcmVlbkJyaWdodG5lc3MgKiBQb3dlci5CUklHSFRORVNTX09OKSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGJ1dHRvbkJyaWdodG5lc3MgPCAwIHx8IGJ1dHRvbkJyaWdodG5lc3MgPiAxLjBmKSB7CisgICAgICAgICAgICBtUG93ZXJNYW5hZ2VyLnNldEJ1dHRvbkJyaWdodG5lc3NPdmVycmlkZSgtMSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtUG93ZXJNYW5hZ2VyLnNldEJ1dHRvbkJyaWdodG5lc3NPdmVycmlkZSgoaW50KQorICAgICAgICAgICAgICAgICAgICAoYnV0dG9uQnJpZ2h0bmVzcyAqIFBvd2VyLkJSSUdIVE5FU1NfT04pKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoaG9sZFNjcmVlbiAhPSBtSG9sZGluZ1NjcmVlbk9uKSB7CisgICAgICAgICAgICBtSG9sZGluZ1NjcmVlbk9uID0gaG9sZFNjcmVlbjsKKyAgICAgICAgICAgIE1lc3NhZ2UgbSA9IG1ILm9idGFpbk1lc3NhZ2UoSC5IT0xEX1NDUkVFTl9DSEFOR0VELCBob2xkU2NyZWVuKTsKKyAgICAgICAgICAgIG1ILnNlbmRNZXNzYWdlKG0pOwogICAgICAgICB9CiAKICAgICAgICAgaWYgKG1UdXJuT25TY3JlZW4pIHsKQEAgLTk5NjEsOCArMTA1OTEsNiBAQAogICAgICAgICAgICAgbUZyZWV6ZUdjUGVuZGluZyA9IG5vdzsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChERUJVR19GUkVFWkUpIFNsb2cudihUQUcsICIqKiogRlJFRVpJTkcgRElTUExBWSIsIG5ldyBSdW50aW1lRXhjZXB0aW9uKCkpOwotICAgICAgICAKICAgICAgICAgbURpc3BsYXlGcm96ZW4gPSB0cnVlOwogICAgICAgICAKICAgICAgICAgbUlucHV0TW9uaXRvci5mcmVlemVJbnB1dERpc3BhdGNoaW5nTHcoKTsKQEAgLTk5ODksOCArMTA2MTcsNiBAQAogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgICAgIAotICAgICAgICBpZiAoREVCVUdfRlJFRVpFKSBTbG9nLnYoVEFHLCAiKioqIFVORlJFRVpJTkcgRElTUExBWSIsIG5ldyBSdW50aW1lRXhjZXB0aW9uKCkpOwotICAgICAgICAKICAgICAgICAgbURpc3BsYXlGcm96ZW4gPSBmYWxzZTsKICAgICAgICAgbUgucmVtb3ZlTWVzc2FnZXMoSC5BUFBfRlJFRVpFX1RJTUVPVVQpOwogICAgICAgICBpZiAoUFJPRklMRV9PUklFTlRB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dldFNpbXBsZU5hbWUoKTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBib29sZWFuIExPRyA9IHRydWU7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE1BWF9BVURJT19QT1JUUyA9IDI7IC8qIGgydyAmIFVTQiBBdWRpbyAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyB1RXZlbnRJbmZvW11bXSA9IHsgeyJERVZQQVRIPS9kZXZpY2VzL3ZpcnR1YWwvc3dpdGNoL2gydyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi9zeXMvY2xhc3Mvc3dpdGNoL2gydy9zdGF0ZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi9zeXMvY2xhc3Mvc3dpdGNoL2gydy9uYW1lIn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IkRFVlBBVEg9L2RldmljZXMvdmlydHVhbC9zd2l0Y2gvdXNiX2F1ZGlvIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiL3N5cy9jbGFzcy9zd2l0Y2gvdXNiX2F1ZGlvL3N0YXRlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiL3N5cy9jbGFzcy9zd2l0Y2gvdXNiX2F1ZGlvL25hbWUifSB9OworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEJJVF9IRUFEU0VUID0gKDEgPDwgMCk7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEJJVF9IRUFEU0VUX05PX01JQyA9ICgxIDw8IDEpOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBCSVRfVVNCX0hFQURTRVRfQU5MRyA9ICgxIDw8IDIpOworICAgIHByaXZh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2NrLnNldFJlZmVyZW5jZUNvdW50ZWQoZmFsc2UpOworCisgICAgICAgIC8vIEF0IGFueSBnaXZlbiB0aW1lIGJvdGggaGVhZHNldHMgY291bGQgYmUgaW5zZXJ0ZWQKKyAgICAgICAgLy8gb25lIG9uIHRoZSBib2FyZCBhbmQgb25lIG9uIHRoZSBkb2NrCisgICAgICAgIC8vIG9ic2VydmUgdHdvIFVFVkVOVHMKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPD0gTUFYX0FVRElPX1BPUlRTOyBpKyspIHsKKyAgICAgICAgICAgIHN0YXJ0T2JzZXJ2aW5nKHVFdmVudEluZm9baV1bMF0pOworICAgICAgICB9CisgICAgICAgIGluaXQoKTsgIC8vIHNldCBpbml0aWFsIHN0YXR1cworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uVUV2ZW50KFVFdmVudE9ic2VydmVyLlVFdmVudCBldmVudCkgeworICAgICAgICBpZiAoTE9HKSBTbG9nLnYoVEFHLCAiSGVhZHNldCBVRVZFTlQ6ICIgKyBldmVudC50b1N0cmluZygpKTsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKChldmVudC5nZXQoIlNXSVRDSF9OQU1FIikpLmVxdWFscygidXNiX2F1ZGlvIikpIHsKKyAgICAgICAgICAgICAgICBpZiAoSW50ZWdlci5wYXJzZUludChldmVudC5nZXQoIlNXSVRDSF9TVEFURSIpKSA9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHN3aXRjaFN0YXRlID0gKChtSGVhZHNldFN0YXRlICYgKEJJVF9IRUFEU0VUfEJJVF9IRUFEU0VUX05PX01JQ3wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQklUX1VTQl9IRUFEU0VUX0RHVEwpKSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChJbnRlZ2VyLnBhcnNlSW50KGV2ZW50LmdldCgiU1dJVENIX1NUQVRFIikpIDw8IDIpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEludGVnZXIucGFyc2VJbnQoZXZlbnQuZ2V0KCJTV0lUQ0hfU1RBVEUiKSkgPT0gMikgeworICAgICAgICAgICAgICAgICAgICBzd2l0Y2hTdGF0ZSA9ICgobUhlYWRzZXRTdGF0ZSAmIChCSVRfSEVBRFNFVHxCSVRfSEVBRFNFVF9OT19NSUN8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJJVF9VU0JfSEVBRFNFVF9BTkxHKSkgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSW50ZWdlci5wYXJzZUludChldmVudC5nZXQoIlNXSVRDSF9TVEFURSIpKSA8PCAzKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2Ugc3dpdGNoU3RhdGUgPSAobUhlYWRzZXRTdGF0ZSAmIChCSVRfSEVBRFNFVHxCSVRfSEVBRFNFVF9OT19NSUMpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgIHN3aXRjaFN0YXRlID0gKChtSGVhZHNldFN0YXRlICYgKEJJVF9VU0JfSEVBRFNFVF9BTkxHfEJJVF9VU0JfSEVBRFNFVF9ER1RMKSkgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEludGVnZXIucGFyc2VJbnQoZXZlbnQuZ2V0KCJTV0lUQ0hfU1RBVEUiKSkpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHVwZGF0ZShldmVudC5nZXQoIlNXSVRDSF9OQU1FIiksIHN3aXRjaFN0YXRlKTsKKyAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIFNsb2cuZShUQUcsICJDb3VsZCBub3QgcGFyc2Ugc3dpdGNoIHN0YXRlIGZyb20gZXZlbnQgIiArIGV2ZW50KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3luY2hyb25pemVkIGZpbmFsIHZvaWQgaW5pdCgpIHsKKyAgICAgICAgY2hhcltdIGJ1ZmZlciA9IG5ldyBjaGFyWzEwMjRdOworCisgICAgICAgIFN0cmluZyBuZXdOYW1lID0gbUhlYWRzZXROYW1lOworICAgICAgICBpbnQgbmV3U3RhdGUgPSBtSGVhZHNldFN0YXRlOworICAgICAgICBtUHJldkhlYWRzZXRTdGF0ZSA9IG1IZWFkc2V0U3RhdGU7CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPD0gTUFYX0FVRElPX1BPUlRTOyBpKyspIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgRmlsZVJlYWRlciBmaWxlID0gbmV3IEZpbGVSZWFkZXIodUV2ZW50SW5mb1tpXVsxXSk7CisgICAgICAgICAgICAgICAgaW50IGxlbiA9IGZpbGUucmVhZChidWZmZXIsIDAsIDEwMjQpOworICAgICAgICAgICAgICAgIG5ld1N0YXRlID0gSW50ZWdlci52YWx1ZU9mKChuZXcgU3RyaW5nKGJ1ZmZlciwgMCwgbGVuKSkudHJpbSgpKTsKKworICAgICAgICAgICAgICAgIGZpbGUgPSBuZXcgRmlsZVJlYWRlcih1RXZlbnRJbmZvW2ldWzJdKTsKKyAgICAgICAgICAgICAgICBsZW4gPSBmaWxlLnJlYWQoYnVmZmVyLCAwLCAxMDI0KTsKKyAgICAgICAgICAgICAgICBuZXdOYW1lID0gbmV3IFN0cmluZyhidWZmZXIsIDAsIGxlbikudHJpbSgpOworCisgICAgICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJUaGlzIGtlcm5lbCBkb2VzIG5vdCBoYXZlIHdpcmVkIGhlYWRzZXQgc3VwcG9ydCIpOworICAgICAgICAgICAgfSBjYXRjaCAoRXh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F1aXJlKCk7CisgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtSGFuZGxlci5vYnRhaW5NZXNzYWdlKDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkc2V0U3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2SGVhZHNldFN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZHNldE5hbWUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsYXkpOworICAgIH0KKworICAgIHByaXZhdGUgc3luY2hyb25pemVkIGZpbmFsIHZvaWQgc2VuZEludGVudHMoaW50IGhlYWRzZXRTdGF0ZSwgaW50IHByZXZIZWFkc2V0U3RhdGUsIFN0cmluZyBoZWFkc2V0TmFtZSkgeworICAgICAgICBpbnQgYWxsSGVhZHNldHMgPSBTVVBQT1JURURfSEVBRFNFVFM7CisgICAgICAgIGZvciAoaW50IGN1ckhlYWRzZXQgPSAxOyBhbGxIZWFkc2V0cyAhPSAwOyBjdXJIZWFkc2V0IDw8PSAxKSB7CisgICAgICAgICAgICBpZiAoKGN1ckhlYWRzZXQgJiBhbGxIZWFkc2V0cykgIT0gMCkgeworICAgICAgICAgICAgICAgIHNlbmRJbnRlbnQoY3VySGVhZHNldCwgaGVhZHNldFN0YXRlLCBwcmV2SGVhZHNldFN0YXRlLCBoZWFkc2V0TmFtZSk7CisgICAgICAgICAgICAgICAgYWxsSGVhZHNldHMgJj0gfmN1ckhlYWRzZXQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIHZvaWQgc2VuZEludGVudChpbnQgaGVhZHNldCwgaW50IGhlYWRzZXRTdGF0ZSwgaW50IHByZXZIZWFkc2V0U3RhdGUsIFN0cmluZyBoZWFkc2V0TmFtZSkgeworICAgICAgICBpZiAoKGhlYWRzZXRTdGF0ZSAmIGhlYWRzZXQpICE9IChwcmV2SGVhZHNldFN0YXRlICYgaGVhZHNldCkpIHsKKworICAgICAgICAgICAgaW50IHN0YXRlID0gMDsKKyAgICAgICAgICAgIGlmICgoaGVhZHNldFN0YXRlICYgaGVhZHNldCkgIT0gMCkgeworICAgICAgICAgICAgICAgIHN0YXRlID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKChoZWFkc2V0ID09IEJJVF9VU0JfSEVBRFNFVF9BTkxHKSB8fCAoaGVhZHNldCA9PSBCSVRfVVNCX0hFQURTRVRfREdUTCkpIHsKKyAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50OworCisgICAgICAgICAgICAgICAgLy8gIFBhY2sgdXAgdGhlIHZhbHVlcyBhbmQgYnJvYWRjYXN0IHRoZW0gdG8gZXZlcnlvbmUKKyAgICAgICAgICAgICAgICBpZiAoaGVhZHNldCA9PSBCSVRfVVNCX0hFQURTRVRfQU5MRykgeworICAgICAgICAgICAgICAgICAgICBpbnRlbnQgPSBuZXcgSW50ZW50KEludGVudC5BQ1RJT05fVVNCX0FOTEdfSEVBRFNFVF9QTFVHKTsKKyAgICAgICAgICAgICAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWSk7CisgICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgic3RhdGUiLCBzdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgibmFtZSIsIGhlYWRzZXROYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgQWN0aXZpdHlNYW5hZ2VyTmF0aXZlLmJyb2FkY2FzdFN0aWNreUludGVudChpbnRlbnQsIG51bGwpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaGVhZHNldCA9PSBCSVRfVVNCX0hFQURTRVRfREdUTCkgeworICAgICAgICAgICAgICAgICAgICBpbnRlbnQgPSBuZXcgSW50ZW50KEludGVudC5BQ1RJT05fVVNCX0RHVExfSEVBRFNFVF9QTFVHKTsKKyAgICAgICAgICAgICAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWSk7CisgICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgic3RhdGUiLCBzdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgibmFtZSIsIGhlYWRzZXROYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgQWN0aXZpdHlNYW5hZ2VyTmF0aXZlLmJyb2FkY2FzdFN0aWNreUludGVudChpbnRlbnQsIG51bGwpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChMT0cpIFNsb2cudihUQUcsICJJbnRlbnQuQUNUSU9OX1VTQl9IRUFEU0VUX1BMVUc6IHN0YXRlOiAiK3N0YXRlKyIgbmFtZTogIitoZWFkc2V0TmFtZSk7CisgICAgICAgICAgICAgICAgLy8gVE9ETzogU2hvdWxkIHdlIHJlcXVpcmUgYSBwZXJtaXNzaW9uPworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoKGhlYWRzZXQgPT0gQklUX0hFQURTRVQpIHx8IChoZWFkc2V0ID09IEJJVF9IRUFEU0VUX05PX01JQykpIHsKKworICAgICAgICAgICAgICAgIC8vICBQYWNrIHVwIHRoZSB2YWx1ZXMgYW5kIGJyb2FkY2FzdCB0aGVtIHRvIGV2ZXJ5b25lCisgICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9IRUFEU0VUX1BMVUcpOworICAgICAgICAgICAgICAgIGludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19SRUNFSVZFUl9SRUdJU1RFUkVEX09OTFkpOworICAgICAgICAgICAgICAgIC8vaW50IHN0YXRlID0gMDsKKyAgICAgICAgICAgICAgICBpbnQgbWljcm9waG9uZSA9IDA7CisKKyAgICAgICAgICAgICAgICBpZiAoKGhlYWRzZXQgJiBIRUFEU0VUU19XSVRIX01JQykgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBtaWNyb3Bob25lID0gMTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoInN0YXRlIiwgc3RhdGUpOworICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgibmFtZSIsIGhlYWRzZXROYW1lKTsKKyAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoIm1pY3JvcGhvbmUiLCBtaWNyb3Bob25lKTsKKworICAgICAgICAgICAgICAgIGlmIChMT0cpIFNsb2cudihUQUcsICJJbnRlbnQuQUNUSU9OX0hFQURTRVRfUExVRzogc3RhdGU6ICIrc3RhdGUrIiBuYW1lOiAiK2hlYWRzZXROYW1lKyIgbWljOiAiK21pY3JvcGhvbmUpOworICAgICAgICAgICAgICAgIC8vIFRPRE86IFNob3VsZCB3ZSByZXF1aXJlIGEgcGVybWlzc2lvbj8KKyAgICAgICAgICAgICAgICBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuYnJvYWRjYXN0U3RpY2t5SW50ZW50KGludGVudCwgbnVsbCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIEhhbmRsZXIgbUhhbmRsZXIgPSBuZXcgSGFuZGxlcigpIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgIHNlbmRJbnRlbnRzKG1zZy5hcmcxLCBtc2cuYXJnMiwgKFN0cmluZyltc2cub2JqKTsKKyAgICAgICAgICAgIG1XYWtlTG9jay5yZWxlYXNlKCk7CisgICAgICAgIH0KKyAgICB9OworfQpkaWZmIC0tZ2l0IGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvYW0vQWN0aXZpdHlNYW5hZ2VyU2VydmljZS5qYXZhIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvYW0vQWN0aXZpdHlNYW5hZ2VyU2VydmljZS5qYXZhCmluZGV4IDZhMDVkM2MuLjYwYjJiNjcgMTAwNjQ0Ci0tLSBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL2FtL0FjdGl2aXR5TWFuYWdlclNlcnZpY2UuamF2YQorKysgYi9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9hbS9BY3Rpdml0eU1hbmFnZXJTZXJ2aWNlLmphdmEKQEAgLTI0NTEsNiArMjQ1MSwxMCBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgCiAgICAgICAgICAgICBpZiAocHJvYy50aHJlYWQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChwcm9jLnBpZCA9PSBQcm9jZXNzLm15UGlkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiY3Jhc2hBcHBsaWNhdGlvbjogdHJ5aW5nIHRvIGNyYXNoIHNlbGYhIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIHByb2MudGhyZWFkLnNjaGVkdWxlQ3Jhc2gobWVzc2FnZSk7CkBAIC00MjY4LDggKzQyNzIsMTAgQEAKICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChERUJVR19VUklfUEVSTUlTU0lPTikgU2xvZy52KFRBRywgCi0gICAgICAgICAgICAgICAgIkNoZWNraW5nIGdyYW50ICIgKyB0YXJnZXRQa2cgKyAiIHBlcm1pc3Npb24gdG8gIiArIHVyaSk7CisgICAgICAgIGlmICh0YXJnZXRQa2cgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKERFQlVHX1VSSV9QRVJNSVNTSU9OKSBTbG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAiQ2hlY2tpbmcgZ3JhbnQgIiArIHRhcmdldFBrZyArICIgcGVybWlzc2lvbiB0byAiICsgdXJpKTsKKyAgICAgICAgfQogICAgICAgICAKICAgICAgICAgZmluYWwgSVBhY2thZ2VNYW5hZ2VyIHBtID0gQXBwR2xvYmFscy5nZXRQYWNrYWdlTWFuYWdlcigpOwogCkBAIC00Mjk4LDIzICs0MzA0LDQ1IEBACiAgICAgICAgIH0KIAogICAgICAgICBpbnQgdGFyZ2V0VWlkOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgdGFyZ2V0VWlkID0gcG0uZ2V0UGFja2FnZVVpZCh0YXJnZXRQa2cpOwotICAgICAgICAgICAgaWYgKHRhcmdldFVpZCA8IDApIHsKLSAgICAgICAgICAgICAgICBpZiAoREVCVUdfVVJJX1BFUk1JU1NJT04pIFNsb2cudihUQUcsIAotICAgICAgICAgICAgICAgICAgICAgICAgIkNhbid0IGdyYW50IFVSSSBwZXJtaXNzaW9uIG5vIHVpZCBmb3I6ICIgKyB0YXJnZXRQa2cpOworICAgICAgICBpZiAodGFyZ2V0UGtnICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgdGFyZ2V0VWlkID0gcG0uZ2V0UGFja2FnZVVpZCh0YXJnZXRQa2cpOworICAgICAgICAgICAgICAgIGlmICh0YXJnZXRVaWQgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19VUklfUEVSTUlTU0lPTikgU2xvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ2FuJ3QgZ3JhbnQgVVJJIHBlcm1pc3Npb24gbm8gdWlkIGZvcjogIiArIHRhcmdldFBrZyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKICAgICAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGFyZ2V0VWlkID0gLTE7CiAgICAgICAgIH0KIAotICAgICAgICAvLyBGaXJzdC4uLiAgZG9lcyB0aGUgdGFyZ2V0IGFjdHVhbGx5IG5lZWQgdGhpcyBwZXJtaXNzaW9uPwotICAgICAgICBpZiAoY2hlY2tIb2xkaW5nUGVybWlzc2lvbnNMb2NrZWQocG0sIHBpLCB1cmksIHRhcmdldFVpZCwgbW9kZUZsYWdzKSkgewotICAgICAgICAgICAgLy8gTm8gbmVlZCB0byBncmFudCB0aGUgdGFyZ2V0IHRoaXMgcGVybWlzc2lvbi4KLSAgICAgICAgICAgIGlmIChERUJVR19VUklfUEVSTUlTU0lPTikgU2xvZy52KFRBRywgCi0gICAgICAgICAgICAgICAgICAgICJUYXJnZXQgIiArIHRhcmdldFBrZyArICIgYWxyZWFkeSBoYXMgZnVsbCBwZXJtaXNzaW9uIHRvICIgKyB1cmkpOwotICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICBpZiAodGFyZ2V0VWlkID49IDApIHsKKyAgICAgICAgICAgIC8vIEZpcnN0Li4uICBkb2VzIHRoZSB0YXJnZXQgYWN0dWFsbHkgbmVlZCB0aGlzIHBlcm1pc3Npb24/CisgICAgICAgICAgICBpZiAoY2hlY2tIb2xkaW5nUGVybWlzc2lvbnNMb2NrZWQocG0sIHBpLCB1cmksIHRhcmdldFVpZCwgbW9kZUZsYWdzKSkgeworICAgICAgICAgICAgICAgIC8vIE5vIG5lZWQgdG8gZ3JhbnQgdGhlIHRhcmdldCB0aGlzIHBlcm1pc3Npb24uCisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1VSSV9QRVJNSVNTSU9OKSBTbG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgIlRhcmdldCAiICsgdGFyZ2V0UGtnICsgIiBhbHJlYWR5IGhhcyBmdWxsIHBlcm1pc3Npb24gdG8gIiArIHVyaSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gRmlyc3QuLi4gIHRoZXJlIGlzIG5vIHRhcmdldCBwYWNrYWdlLCBzbyBjYW4gYW55b25lIGFjY2VzcyBpdD8KKyAgICAgICAgICAgIGJvb2xlYW4gYWxsb3dlZCA9IHBpLmV4cG9ydGVkOworICAgICAgICAgICAgaWYgKChtb2RlRmxhZ3MmSW50ZW50LkZMQUdfR1JBTlRfUkVBRF9VUklfUEVSTUlTU0lPTikgIT0gMCkgeworICAgICAgICAgICAgICAgIGlmIChwaS5yZWFkUGVybWlzc2lvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGFsbG93ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoKG1vZGVGbGFncyZJbnRlbnQuRkxBR19HUkFOVF9XUklURV9VUklfUEVSTUlTU0lPTikgIT0gMCkgeworICAgICAgICAgICAgICAgIGlmIChwaS53cml0ZVBlcm1pc3Npb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBhbGxvd2VkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGFsbG93ZWQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gL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QgaGF2ZSBwZXJtaXNzaW9uIHRvIHVyaSAiICsgdXJpKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICByZXR1cm4gdGFyZ2V0VWlkOwogICAgIH0KIAorICAgIHB1YmxpYyBpbnQgY2hlY2tHcmFudFVyaVBlcm1pc3Npb24oaW50IGNhbGxpbmdVaWQsIFN0cmluZyB0YXJnZXRQa2csCisgICAgICAgICAgICBVcmkgdXJpLCBpbnQgbW9kZUZsYWdzKSB7CisgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CisgICAgICAgICAgICByZXR1cm4gY2hlY2tHcmFudFVyaVBlcm1pc3Npb25Mb2NrZWQoY2FsbGluZ1VpZCwgdGFyZ2V0UGtnLCB1cmksIG1vZGVGbGFncyk7CisgICAgICAgIH0KKyAgICB9CisKICAgICB2b2lkIGdyYW50VXJpUGVybWlzc2lvblVuY2hlY2tlZExvY2tlZChpbnQgdGFyZ2V0VWlkLCBTdHJpbmcgdGFyZ2V0UGtnLAogICAgICAgICAgICAgVXJpIHVyaSwgaW50IG1vZGVGbGFncywgVXJpUGVybWlzc2lvbk93bmVyIG93bmVyKSB7CiAgICAgICAgIG1vZGVGbGFncyAmPSAoSW50ZW50LkZMQUdfR1JBTlRfUkVBRF9VUklfUEVSTUlTU0lPTgpAQCAtNDM5Niw2ICs0NDMzLDEwIEBACiAKICAgICB2b2lkIGdyYW50VXJpUGVybWlzc2lvbkxvY2tlZChpbnQgY2FsbGluZ1VpZCwKICAgICAgICAgICAgIFN0cmluZyB0YXJnZXRQa2csIFVyaSB1cmksIGludCBtb2RlRmxhZ3MsIFVyaVBlcm1pc3Npb25Pd25lciBvd25lcikgeworICAgICAgICBpZiAodGFyZ2V0UGtnID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigidGFyZ2V0UGtnIik7CisgICAgICAgIH0KKwogICAgICAgICBpbnQgdGFyZ2V0VWlkID0gY2hlY2tHcmFudFVyaVBlcm1pc3Npb25Mb2NrZWQoY2FsbGluZ1VpZCwgdGFyZ2V0UGtnLCB1cmksIG1vZGVGbGFncyk7CiAgICAgICAgIGlmICh0YXJnZXRVaWQgPCAwKSB7CiAgICAgICAgICAgICByZXR1cm47CkBAIC00NDE0LDYgKzQ0NTUsMTAgQEAKICAgICAgICAgICAgICAgICArICIgZnJvbSAiICsgaW50ZW50ICsgIjsgZmxhZ3M9MHgiCiAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGludGVudCAhPSBudWxsID8gaW50ZW50LmdldEZsYWdzKCkgOiAwKSk7CiAKKyAgICAgICAgaWYgKHRhcmdldFBrZyA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oInRhcmdldFBrZyIpOworICAgICAgICB9CisKICAgICAgICAgaWYgKGludGVudCA9PSBudWxsKSB7CiAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgIH0KQEAgLTU4NzgsNiArNTkyMywzNSBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgcHVibGljIHZvaWQgc2V0SW1tZXJzaXZlKElCaW5kZXIgdG9rZW4sIGJvb2xlYW4gaW1tZXJzaXZlKSB7CisgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CisgICAgICAgICAgICBpbnQgaW5kZXggPSAodG9rZW4gIT0gbnVsbCkgPyBtTWFpblN0YWNrLmluZGV4T2ZUb2tlbkxvY2tlZCh0b2tlbikgOiAtMTsKKyAgICAgICAgICAgIGlmIChpbmRleCA8IDApIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3Rpdml0eVJlY29yZCByID0gKEFjdGl2aXR5UmVjb3JkKW1NYWluU3RhY2subUhpc3RvcnkuZ2V0KGluZGV4KTsKKyAgICAgICAgICAgIHIuaW1tZXJzaXZlID0gaW1tZXJzaXZlOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNJbW1lcnNpdmUoSUJpbmRlciB0b2tlbikgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGludCBpbmRleCA9ICh0b2tlbiAhPSBudWxsKSA/IG1NYWluU3RhY2suaW5kZXhPZlRva2VuTG9ja2VkKHRva2VuKSA6IC0xOworICAgICAgICAgICAgaWYgKGluZGV4IDwgMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjdGl2aXR5UmVjb3JkIHIgPSAoQWN0aXZpdHlSZWNvcmQpbU1haW5TdGFjay5tSGlzdG9yeS5nZXQoaW5kZXgpOworICAgICAgICAgICAgcmV0dXJuIHIuaW1tZXJzaXZlOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNUb3BBY3Rpdml0eUltbWVyc2l2ZSgpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBBY3Rpdml0eVJlY29yZCByID0gbU1haW5TdGFjay50b3BSdW5uaW5nQWN0aXZpdHlMb2NrZWQobnVsbCk7CisgICAgICAgICAgICByZXR1cm4gKHIgIT0gbnVsbCkgPyByLmltbWVyc2l2ZSA6IGZhbHNlOworICAgICAgICB9CisgICAgfQorCiAgICAgcHVibGljIGZpbmFsIHZvaWQgZW50ZXJTYWZlTW9kZSgpIHsKICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKICAgICAgICAgICAgIC8vIEl0IG9ubHkgbWFrZXMgc2Vuc2UgdG8gZG8gdGhpcyBiZWZvcmUgdGhlIHN5c3RlbSBpcyByZWFkeQpAQCAtNjYwMiw2ICs2Njc2LDEyIEBACiAgICAgICAgICAgICBpZiAoaW5mby52aW9sYXRpb25OdW1UaGlzTG9vcCAhPSAwKSB7CiAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCJMb29wLVZpb2xhdGlvbi1OdW1iZXI6ICIpLmFwcGVuZChpbmZvLnZpb2xhdGlvbk51bVRoaXNMb29wKS5hcHBlbmQoIlxuIik7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoaW5mby5udW1BbmltYXRpb25zUnVubmluZyAhPSAwKSB7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCJBbmltYXRpb25zLVJ1bm5pbmc6ICIpLmFwcGVuZChpbmZvLm51bUFuaW1hdGlvbnNSdW5uaW5nKS5hcHBlbmQoIlxuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoaW5mby5icm9hZGNhc3RJbnRlbnRBY3Rpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiQnJvYWRjYXN0LUludGVudC1BY3Rpb246ICIpLmFwcGVuZChpbmZvLmJyb2FkY2FzdEludGVudEFjdGlvbikuYXBwZW5kKCJcbiIpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKGluZm8gIT0gbnVsbCAmJiBpbmZvLmR1cmF0aW9uTWlsbGlzICE9IC0xKSB7CiAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCJEdXJhdGlvbi1NaWxsaXM6ICIpLmFwcGVuZChpbmZvLmR1cmF0aW9uTWlsbGlzKS5hcHBlbmQoIlxuIik7CiAgICAgICAgICAgICB9CkBAIC03MjEwLDEzICs3MjkwLDE5IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoInNlcnZpY2UiLmVxdWFscyhjbWQpKSB7Ci0gICAgICAgICAgICAgICAgZHVtcFNlcnZpY2UoZmQsIHB3LCBhcmdzLCBvcHRpLCBkdW1wQWxsKTsKKyAgICAgICAgICAgICAgICBkdW1wU2VydmljZShmZCwgcHcsIGFyZ3MsIG9wdGkpOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoInNlcnZpY2VzIi5lcXVhbHMoY21kKSB8fCAicyIuZXF1YWxzKGNtZCkpIHsKICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgICAgICAgICAgZHVtcFNlcnZpY2VzTG9ja2VkKGZkLCBwdywgYXJncywgb3B0aSwgdHJ1ZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gRHVtcGluZyBhIHNpbmdsZSBhY3Rpdml0eT8KKyAgICAgICAgICAgICAgICBpZiAoZHVtcEFjdGl2aXR5KGZkLCBwdywgY21kLCBhcmdzLCBvcHRpLCBkdW1wQWxsKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIkJhZCBhY3Rpdml0eSBjb21tYW5kOiAiICsgY21kKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICAKQEAgLTc1NjMsOCArNzY0OSw3IEBACiAgICAgICogIC0gdGhlIGZpcnN0IGFyZyBpc24ndCB0aGUgZmxhdHRlbmVkIGNvbXBvbmVudCBuYW1lIG9mIGFuIGV4aXN0aW5nIHNlcnZpY2U6CiAgICAgICogICAgZHVtcCBhbGwgc2VydmljZXMgd2hvc2UgY29tcG9uZW50IGNvbnRhaW5zIHRoZSBmaXJzdCBhcmcgYXMgYSBzdWJzdHJpbmcKICAgICAgKi8KLSAgICBwcm90ZWN0ZWQgdm9pZCBkdW1wU2VydmljZShGaWxlRGVzY3JpcHRvciBmZCwgUHJpbnRXcml0ZXIgcHcsIFN0cmluZ1tdIGFyZ3MsCi0gICAgICAgICAgICBpbnQgb3B0aSwgYm9vbGVhbiBkdW1wQWxsKSB7CisgICAgcHJvdGVjdGVkIHZvaWQgZHVtcFNlcnZpY2UoRmlsZURlc2NyaXB0b3IgZmQsIFByaW50V3JpdGVyIHB3LCBTdHJpbmdbXSBhcmdzLCBpbnQgb3B0aSkgewogICAgICAgICBTdHJpbmdbXSBuZXdBcmdzOwogICAgICAgICBTdHJpbmcgY29tcG9uZW50TmFtZVN0cmluZzsKICAgICAgICAgU2VydmljZVJlY29yZCByOwpAQCAtNzU4NCw3ICs3NjY5LDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIGlmIChyICE9IG51bGwpIHsKLSAgICAgICAgICAgIGR1bXBTZXJ2aWNlKGZkLCBwdywgciwgbmV3QXJncywgZHVtcEFsbCk7CisgICAgICAgICAgICBkdW1wU2VydmljZShmZCwgcHcsIHIsIG5ld0FyZ3MpOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgQXJyYXlMaXN0PFNlcnZpY2VSZWNvcmQ+IHNlcnZpY2VzID0gbmV3IEFycmF5TGlzdDxTZXJ2aWNlUmVjb3JkPigpOwogICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CkBAIC03NTk2LDcgKzc2ODEsNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxzZXJ2aWNlcy5zaXplKCk7IGkrKykgewotICAgICAgICAgICAgICAgIGR1bXBTZXJ2aWNlKGZkLCBwdywgc2VydmljZXMuZ2V0KGkpLCBuZXdBcmdzLCBkdW1wQWxsKTsKKyAgICAgICAgICAgICAgICBkdW1wU2VydmljZShmZCwgcHcsIHNlcnZpY2VzLmdldChpKSwgbmV3QXJncyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC03NjA1LDkgKzc2OTAsNzkgQEAKICAgICAgKiBJbnZva2VzIElBcHBsaWNhdGlvblRocmVhZC5kdW1wU2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yAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG9iamVjdElkID0gSW50ZWdlci5wYXJzZUludChuYW1lLCAxNik7CisgICAgICAgICAgICBuYW1lID0gbnVsbDsKKyAgICAgICAgICAgIGNvbXBvbmVudE5hbWUgPSBudWxsOworICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgfQorICAgICAgICBuZXdBcmdzID0gbmV3IFN0cmluZ1thcmdzLmxlbmd0aCAtIG9wdGldOworICAgICAgICBpZiAoYXJncy5sZW5ndGggPiAyKSBTeXN0ZW0uYXJyYXljb3B5KGFyZ3MsIG9wdGksIG5ld0FyZ3MsIDAsIGFyZ3MubGVuZ3RoIC0gb3B0aSk7CisKKyAgICAgICAgQXJyYXlMaXN0PEFjdGl2aXR5UmVjb3JkPiBhY3Rpdml0aWVzID0gbmV3IEFycmF5TGlzdDxBY3Rpdml0eVJlY29yZD4oKTsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBmb3IgKEFjdGl2aXR5UmVjb3JkIHIxIDogKEFycmF5TGlzdDxBY3Rpdml0eVJlY29yZD4pbU1haW5TdGFjay5tSGlzdG9yeSkgeworICAgICAgICAgICAgICAgIGlmIChjb21wb25lbnROYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHIxLmludGVudC5nZXRDb21wb25lbnQoKS5lcXVhbHMoY29tcG9uZW50TmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2aXRpZXMuYWRkKHIxKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChyMS5pbnRlbnQuZ2V0Q29tcG9uZW50KCkuZmxhdHRlblRvU3RyaW5nKCkuY29udGFpbnMobmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2aXRpZXMuYWRkKHIxKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoU3lzdGVtLmlkZW50aXR5SGFzaENvZGUodGhpcykgPT0gb2JqZWN0SWQpIHsKKyAgICAgICAgICAgICAgICAgICAgYWN0aXZpdGllcy5hZGQocjEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChhY3Rpdml0aWVzLnNpemUoKSA8PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGludCBpPTA7IGk8YWN0aXZpdGllcy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgZHVtcEFjdGl2aXR5KGZkLCBwdywgYWN0aXZpdGllcy5nZXQoaSksIG5ld0FyZ3MsIGR1bXBBbGwpOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEludm9rZXMgSUFwcGxpY2F0aW9uVGhyZWFkLmR1bXBBY3Rpdml0eSgpIG9uIHRoZSB0aHJlYWQgb2YgdGhlIHNwZWNpZmllZCBhY3Rpdml0eSBpZgorICAgICAqIHRoZXJlIGlzIGEgdGhyZWFkIGFzc29jaWF0ZWQgd2l0aCB0aGUgYWN0aXZpdHkuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGR1bXBBY3Rpdml0eShGaWxlRGVzY3JpcHRvciBmZCwgUHJpbnRXcml0ZXIgcHcsIEFjdGl2aXR5UmVjb3JkIHIsIFN0cmluZ1tdIGFyZ3MsCiAgICAgICAgICAgICBib29sZWFuIGR1bXBBbGwpIHsKLSAgICAgICAgcHcucHJpbnRsbigiICBTZXJ2aWNlICIgKyByLm5hbWUuZmxhdHRlblRvU3RyaW5nKCkpOworICAgICAgICBwdy5wcmludGxuKCIgIEFjdGl2aXR5ICIgKyByLmludGVudC5nZXRDb21wb25lbnQoKS5mbGF0dGVuVG9TdHJpbmcoKSk7CiAgICAgICAgIGlmIChkdW1wQWxsKSB7CiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgICAgICBwdy5wcmludCgiICAqICIpOyBwdy5wcmludGxuKHIpOwpAQCAtNzYyMCwxMSArNzc3NSwxMSBAQAogICAgICAgICAgICAgICAgIC8vIGZsdXNoIGFueXRoaW5nIHRoYXQgaXMgYWxyZWFkeSBpbiB0aGUgUHJpbnRXcml0ZXIgc2luY2UgdGhlIHRocmVhZCBpcyBnb2luZwogICAgICAgICAgICAgICAgIC8vIHRvIHdyaXRlIHRvIHRoZSBmaWxlIGRlc2NyaXB0b3IgZGlyZWN0bHkKICAgICAgICAgICAgICAgICBwdy5mbHVzaCgpOwotICAgICAgICAgICAgICAgIHIuYXBwLnRocmVhZC5kdW1wU2VydmljZShmZCwgciwgYXJncyk7CisgICAgICAgICAgICAgICAgci5hcHAudGhyZWFkLmR1bXBBY3Rpdml0eShmZCwgciwgYXJncyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoIlxuIik7CiAgICAgICAgICAgICAgICAgcHcuZmx1c2goKTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgcHcucHJpbnRsbigiZ290IGEgUmVtb3RlRXhjZXB0aW9uIHdoaWxlIGR1bXBpbmcgdGhlIHNlcnZpY2UiKTsKKyAgICAgICAgICAgICAgICBwdy5wcmludGxuKCJnb3QgYSBSZW1vdGVFeGNlcHRpb24gd2hpbGUgZHVtcGluZyB0aGUgYWN0aXZpdHkiKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTEyNDkwLDcgKzEyNjQ1LDY5IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKKyAgICBwdWJsaWMgYm9vbGVhbiBkdW1wSGVhcChTdHJpbmcgcHJvY2VzcywgYm9vbGVhbiBtYW5hZ2VkLAorICAgICAgICAgICAgU3RyaW5nIHBhdGgsIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICAgICAgLy8gbm90ZTogaGlqYWNraW5nIFNFVF9BQ1RJVklUWV9XQVRDSEVSLCBidXQgc2hvdWxkIGJlIGNoYW5nZWQgdG8KKyAgICAgICAgICAgICAgICAvLyBpdHMgb3duIHBlcm1pc3Npb24gKHNhbWUgYXMgcHJvZmlsZUNvbnRyb2wpLgorICAgICAgICAgICAgICAgIGlmIChjaGVja0NhbGxpbmdQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5TRVRfQUNUSVZJVFlfV0FUQ0hFUikKKyAgICAgICAgICAgICAgICAgICAgICAgICE9IFBhY2thZ2VNYW5hZ2VyLlBFUk1JU1NJT05fR1JBTlRFRCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU2VjdXJpdHlFeGNlcHRpb24oIlJlcXVpcmVzIHBlcm1pc3Npb24gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLlNFVF9BQ1RJVklUWV9XQVRDSEVSKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoZmQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJudWxsIGZkIik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgUHJvY2Vzc1JlY29yZCBwcm9jID0gbnVsbDsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBpbnQgcGlkID0gSW50ZWdlci5wYXJzZUludChwcm9jZXNzKTsKKyAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtUGlkc1NlbGZMb2NrZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByb2MgPSBtUGlkc1NlbGZMb2NrZWQuZ2V0KHBpZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChwcm9jID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgSGFzaE1hcDxTdHJpbmcsIFNwYXJzZUFycmF5PFByb2Nlc3NSZWNvcmQ+PiBhbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IG1Qcm9jZXNzTmFtZXMuZ2V0TWFwKCk7CisgICAgICAgICAgICAgICAgICAgIFNwYXJzZUFycmF5PFByb2Nlc3NSZWNvcmQ+IHByb2NzID0gYWxsLmdldChwcm9jZXNzKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHByb2NzICE9IG51bGwgJiYgcHJvY3Muc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcHJvYyA9IHByb2NzLnZhbHVlQXQoMCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAocHJvYyA9PSBudWxsIHx8IHByb2MudGhyZWFkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rbm93biBwcm9jZXNzOiAiICsgcHJvY2Vzcyk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgYm9vbGVhbiBpc1NlY3VyZSA9ICIxIi5lcXVhbHMoU3lzdGVtUHJvcGVydGllcy5nZXQoU1lTVEVNX1NFQ1VSRSwgIjAiKSk7CisgICAgICAgICAgICAgICAgaWYgKGlzU2VjdXJlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgocHJvYy5pbmZvLmZsYWdzJkFwcGxpY2F0aW9uSW5mby5GTEFHX0RFQlVHR0FCTEUpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTZWN1cml0eUV4Y2VwdGlvbigiUHJvY2VzcyBub3QgZGVidWdnYWJsZTogIiArIHByb2MpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcHJvYy50aHJlYWQuZHVtcEhlYXAobWFuYWdlZCwgcGF0aCwgZmQpOworICAgICAgICAgICAgICAgIGZkID0gbnVsbDsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIlByb2Nlc3MgZGlzYXBwZWFyZWQiKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChmZCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgZmQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCiAgICAgLyoqIEluIHRoaXMgbWV0aG9kIHdlIHRyeSB0byBhY3F1aXJlIG91ciBsb2NrIHRvIG1ha2Ugc3VyZSB0aGF0IHdlIGhhdmUgbm90IGRlYWRsb2NrZWQgKi8KICAgICBwdWJsaWMgdm9pZCBtb25pdG9yKCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsgfQpkaWZmIC0tZ2l0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nQoIiBpbkhpc3Rvcnk9Iik7IHB3LnByaW50KGluSGlzdG9yeSk7CisgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBpbW1lcnNpdmU9Iik7IHB3LnByaW50KGltbWVyc2l2ZSk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBsYXVuY2hNb2RlPSIpOyBwdy5wcmludGxuKGxhdW5jaE1vZGUpOwogICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgiZnVsbHNjcmVlbj0iKTsgcHcucHJpbnQoZnVsbHNjcmVlbik7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiB2aXNpYmxlPSIpOyBwdy5wcmludCh2aXNpYmxlKTsKQEAgLTI4OSw2ICsyOTEsOCBAQAogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBpc0hvbWVBY3Rpdml0eSA9IGZhbHNlOwogICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbW1lcnNpdmUgPSAoYUluZm8uZmxhZ3MgJiBBY3Rpdml0eUluZm8uRkxBR19JTU1FUlNJVkUpICE9IDA7CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICByZWFsQWN0aXZpdHkgPSBudWxsOwogICAgICAgICAgICAgdGFza0FmZmluaXR5ID0gbnVsbDsKQEAgLTMwMCw2ICszMDQsNyBAQAogICAgICAgICAgICAgcGFja2FnZU5hbWUgPSBudWxsOwogICAgICAgICAgICAgZnVsbHNjcmVlbiA9IHRydWU7CiAgICAgICAgICAgICBpc0hvbWVBY3Rpdml0eSA9IGZhbHNlOworICAgICAgICAgICAgaW1tZXJzaXZlID0gZmFsc2U7CiAgICAgICAgIH0KICAgICB9CiAKZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL2FtL0JhdHRlcnlTdGF0c1NlcnZpY2UuamF2YSBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL2FtL0JhdHR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NhbGxpbmdQZXJtaXNzaW9uKCk7Ci0gICAgICAgIEJsdWV0b290aEhlYWRzZXQgaGVhZHNldCA9IG5ldyBCbHVldG9vdGhIZWFkc2V0KG1Db250ZXh0LCBudWxsKTsKKyAgICAgICAgQmx1ZXRvb3RoQWRhcHRlciBhZGFwdGVyID0gQmx1ZXRvb3RoQWRhcHRlci5nZXREZWZhdWx0QWRhcHRlcigpOworICAgICAgICBpZiAoYWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBhZGFwdGVyLmdldFByb2ZpbGVQcm94eShtQ29udGV4dCwgbUJsdWV0b290aFByb2ZpbGVTZXJ2aWNlTGlzdGVuZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhQcm9maWxlLkhFQURTRVQpOworICAgICAgICB9CiAgICAgICAgIHN5bmNocm9uaXplZCAobVN0YXRzKSB7Ci0gICAgICAgICAgICBtU3RhdHMubm90ZUJsdWV0b290aE9uTG9ja2VkKCk7Ci0gICAgICAgICAgICBtU3RhdHMuc2V0QnRIZWFkc2V0KGhlYWRzZXQpOworICAgICAgICAgICAgaWYgKG1CbHVldG9vdGhIZWFkc2V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtU3RhdHMubm90ZUJsdWV0b290aE9uTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgbVN0YXRzLnNldEJ0SGVhZHNldChtQmx1ZXRvb3RoSGVhZHNldCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1CbHVldG9vdGhQZW5kaW5nU3RhdHMgPSB0cnVlOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCisgICAgcHJpdmF0ZSBCbHVldG9vdGhQcm9maWxlLlNlcnZpY2VMaXN0ZW5lciBtQmx1ZXRvb3RoUHJvZmlsZVNlcnZpY2VMaXN0ZW5lciA9CisgICAgICAgIG5ldyBCbHVldG9vdGhQcm9maWxlLlNlcnZpY2VMaXN0ZW5lcigpIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlQ29ubmVjdGVkKGludCBwcm9maWxlLCBCbHVldG9vdGhQcm9maWxlIHByb3h5KSB7CisgICAgICAgICAgICBtQmx1ZXRvb3RoSGVhZHNldCA9IChCbHVldG9vdGhIZWFkc2V0KSBwcm94eTsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVN0YXRzKSB7CisgICAgICAgICAgICAgICAgaWYgKG1CbHVldG9vdGhQZW5kaW5nU3RhdHMpIHsKKyAgICAgICAgICAgICAgICAgICAgbVN0YXRzLm5vdGVCbHVldG9vdGhPbkxvY2tlZCgpOworICAgICAgICAgICAgICAgICAgICBtU3RhdHMuc2V0QnRIZWFkc2V0KG1CbHVldG9vdGhIZWFkc2V0KTsKKyAgICAgICAgICAgICAgICAgICAgbUJsdWV0b290aFBlbmRpbmdTdGF0cyA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG9uU2VydmljZURpc2Nvbm5lY3RlZChpbnQgcHJvZmlsZSkgeworICAgICAgICAgICAgbUJsdWV0b290aEhlYWRzZXQgPSBudWxsOworICAgICAgICB9CisgICAgfTsKKwogICAgIHB1YmxpYyB2b2lkIG5vdGVCbHVldG9vdGhPZmYoKSB7CiAgICAgICAgIGVuZm9yY2VDYWxsaW5nUGVybWlzc2lvbigpOwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1TdGF0cykgeworICAgICAgICAgICAgbUJsdWV0b290aFBlbmRpbmdTdGF0cyA9IGZhbHNlOwogICAgICAgICAgICAgbVN0YXRzLm5vdGVCbHVldG9vdGhPZmZMb2NrZWQoKTsKICAgICAgICAgfQogICAgIH0KZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL2FtL1VyaVBlcm1pc3Npb25Pd25lci5qYXZhIGIvc2VydmljZ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Z0FycmF5KAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYXJyYXkuY29uZmlnX3RldGhlcl9ibHVldG9vdGhfcmVnZXhzKTsKICAgICAgICAgbVVwc3RyZWFtSWZhY2VSZWdleHMgPSBjb250ZXh0LmdldFJlc291cmNlcygpLmdldFN0cmluZ0FycmF5KAogICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYXJyYXkuY29uZmlnX3RldGhlcl91cHN0cmVhbV9yZWdleHMpOwogCkBAIC0xODIsNyArMjEwLDcgQEAKICAgICB9CiAKICAgICBwdWJsaWMgdm9pZCBpbnRlcmZhY2VMaW5rU3RhdHVzQ2hhbmdlZChTdHJpbmcgaWZhY2UsIGJvb2xlYW4gbGluaykgewotICAgICAgICBMb2cuZChUQUcsICJpbnRlcmZhY2VMaW5rU3RhdHVzQ2hhbmdlZCAiICsgaWZhY2UgKyAiLCAiICsgbGluayk7CisgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiaW50ZXJmYWNlTGlua1N0YXR1c0NoYW5nZWQgIiArIGlmYWNlICsgIiwgIiArIGxpbmspOwogICAgICAgICBib29sZWFuIGZvdW5kID0gZmFsc2U7CiAgICAgICAgIGJvb2xlYW4gdXNiID0gZmFsc2U7CiAgICAgICAgIGlmIChpc1dpZmkoaWZhY2UpKSB7CkBAIC0xOTAsNiArMjE4LDggQEAKICAgICAgICAgfSBlbHNlIGlmIChpc1VzYihpZmFjZSkpIHsKICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTsKICAgICAgICAgICAgIHVzYiA9IHRydWU7CisgICAgICAgIH0gZWxzZSBpZiAoaXNCbHVldG9vdGgoaWZhY2UpKSB7CisgICAgICAgICAgICBmb3VuZCA9IHRydWU7CiAgICAgICAgIH0KICAgICAgICAgaWYgKGZvdW5kID09IGZhbHNlKSByZXR1cm47CiAKQEAgLTIyNCw2ICsyNTQsMTIgQEAKICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KIAorICAgIHB1YmxpYyBib29sZWFuIGlzQmx1ZXRvb3RoKFN0cmluZyBpZmFjZSkgeworICAgICAgICBmb3IgKFN0cmluZyByZWdleCA6IG1UZXRoZXJhYmxlQmx1ZXRvb3RoUmVnZXhzKSB7CisgICAgICAgICAgICBpZiAoaWZhY2UubWF0Y2hlcyhyZWdleCkpIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CiAgICAgcHVibGljIHZvaWQgaW50ZXJmYWNlQWRkZWQoU3RyaW5nIGlmYWNlKSB7CiAgICAgICAgIElCaW5kZXIgYiA9IFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoQ29udGV4dC5ORVRXT1JLTUFOQUdFTUVOVF9TRVJWSUNFKTsKICAgICAgICAgSU5ldHdvcmtNYW5hZ2VtZW50U2VydmljZSBzZXJ2aWNlID0gSU5ldHdvcmtNYW5hZ2VtZW50U2VydmljZS5TdHViLmFzSW50ZXJmYWNlKGIpOwpAQCAtMjM2LDI5ICsyNzIsMzQgQEAKICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTsKICAgICAgICAgICAgIHVzYiA9IHRydWU7CiAgICAgICAgIH0KKyAgICAgICAgaWYgKGlzQmx1ZXRvb3RoKGlmYWNlKSkgeworICAgICAgICAgICAgZm91bmQgPSB0cnVlOworICAgICAgICB9CiAgICAgICAgIGlmIChmb3VuZCA9PSBmYWxzZSkgewotICAgICAgICAgICAgTG9nLmQoVEFHLCBpZmFjZSArICIgaXMgbm90IGEgdGV0aGVyYWJsZSBpZmFjZSwgaWdub3JpbmciKTsKKyAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCBpZmFjZSArICIgaXMgbm90IGEgdGV0aGVyYWJsZSBpZmFjZSwgaWdub3JpbmciKTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCiAgICAgICAgIHN5bmNocm9uaXplZCAobUlmYWNlcykgewogICAgICAgICAgICAgVGV0aGVySW50ZXJmYWNlU00gc20gPSBtSWZhY2VzLmdldChpZmFjZSk7CiAgICAgICAgICAgICBpZiAoc20gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImFjdGl2ZSBpZmFjZSAoIiArIGlmYWNlICsgIikgcmVwb3J0ZWQgYXMgYWRkZWQsIGlnbm9yaW5nIik7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJhY3RpdmUgaWZhY2UgKCIgKyBpZmFjZSArICIpIHJlcG9ydGVkIGFzIGFkZGVkLCBpZ25vcmluZyIpOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHNtID0gbmV3IFRldGhlckludGVyZmFjZVNNKGlmYWNlLCBtTG9vcGVyLCB1c2IpOwogICAgICAgICAgICAgbUlmYWNlcy5wdXQoaWZhY2UsIHNtKTsKICAgICAgICAgICAgIHNtLnN0YXJ0KCk7CiAgICAgICAgIH0KLSAgICAgICAgTG9nLmQoVEFHLCAiaW50ZXJmYWNlQWRkZWQgOiIgKyBpZmFjZSk7CisgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiaW50ZXJmYWNlQWRkZWQgOiIgKyBpZmFjZSk7CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgaW50ZXJmYWNlUmVtb3ZlZChTdHJpbmcgaWZhY2UpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtSWZhY2VzKSB7CiAgICAgICAgICAgICBUZXRoZXJJbnRlcmZhY2VTTSBzbSA9IG1JZmFjZXMuZ2V0KGlmYWNlKTsKICAgICAgICAgICAgIGlmIChzbSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiYXR0ZW1wdGluZyB0byByZW1vdmUgdW5rbm93biBpZmFjZSAoIiArIGlmYWNlICsgIiksIGlnbm9yaW5nIik7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImF0dGVtcHRpbmcgdG8gcmVtb3ZlIHVua25vd24gaWZhY2UgKCIgKyBpZmFjZSArICIpLCBpZ25vcmluZyIpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBzbS5zZW5kTWVzc2FnZShUZXRoZXJJbnRlcmZhY2VTTS5DTURfSU5URVJGQUNFX0RPV04pOwpAQCAtMzI5LDEzICszNzAsMTQgQEAKIAogICAgICAgICBib29sZWFuIHdpZmlUZXRoZXJlZCA9IGZhbHNlOwogICAgICAgICBib29sZWFuIHVzYlRldGhlcmVkID0gZmFsc2U7CisgICAgICAgIGJvb2xlYW4gYmx1ZXRvb3RoVGV0aGVyZWQgPSBmYWxzZTsKIAogICAgICAgICBzeW5jaHJvbml6ZWQgKG1JZmFjZXMpIHsKICAgICAgICAgICAgIFNldCBpZmFjZXMgPSBtSWZhY2VzLmtleVNldCgpOwogICAgICAgICAgICAgZm9yIChPYmplY3QgaWZhY2UgOiBpZmFjZXMpIHsKICAgICAgICAgICAgICAgICBUZXRoZXJJbnRlcmZhY2VTTSBzbSA9IG1JZmFjZXMuZ2V0KGlmYWNlKTsKICAgICAgICAgICAgICAgICBpZiAoc20gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpZihzbS5pc0Vycm9yZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc20uaXNFcnJvcmVkKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yZWRMaXN0LmFkZCgoU3RyaW5nKWlmYWNlKTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzbS5pc0F2YWlsYWJsZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbGFibGVMaXN0LmFkZCgoU3RyaW5nKWlmYWNlKTsKQEAgLTM0NCw2ICszODYsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzYlRldGhlcmVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNXaWZpKChTdHJpbmcpaWZhY2UpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lmaVRldGhlcmVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlzQmx1ZXRvb3RoKChTdHJpbmcpaWZhY2UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZXRvb3RoVGV0aGVyZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlTGlzdC5hZGQoKFN0cmluZylpZmFjZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTM1OCwxNyArNDAyLDI1IEBACiAgICAgICAgIGJyb2FkY2FzdC5wdXRTdHJpbmdBcnJheUxpc3RFeHRyYShDb25uZWN0aXZpdHlNYW5hZ2VyLkVYVFJBX0VSUk9SRURfVEVUSEVSLAogICAgICAgICAgICAgICAgIGVycm9yZWRMaXN0KTsKICAgICAgICAgbUNvbnRleHQuc2VuZFN0aWNreUJyb2FkY2FzdChicm9hZGNhc3QpOwotICAgICAgICBMb2cuZChUQUcsICJzZW5kVGV0aGVyU3RhdGVDaGFuZ2VkQnJvYWRjYXN0ICIgKyBhdmFpbGFibGVMaXN0LnNpemUoKSArICIsICIgKwotICAgICAgICAgICAgICAgIGFjdGl2ZUxpc3Quc2l6ZSgpICsgIiwgIiArIGVycm9yZWRMaXN0LnNpemUoKSk7CisgICAgICAgIGlmIChERUJVRykgeworICAgICAgICAgICAgTG9nLmQoVEFHLCAic2VuZFRldGhlclN0YXRlQ2hhbmdlZEJyb2FkY2FzdCAiICsgYXZhaWxhYmxlTGlzdC5zaXplKCkgKyAiLCAiICsKKyAgICAgICAgICAgICAgICAgICAgYWN0aXZlTGlzdC5zaXplKCkgKyAiLCAiICsgZXJyb3JlZExpc3Quc2l6ZSgpKTsKKyAgICAgICAgfQogCiAgICAgICAgIGlmICh1c2JUZXRoZXJlZCkgewotICAgICAgICAgICAgaWYgKHdpZmlUZXRoZXJlZCkgeworICAgICAgICAgICAgaWYgKHdpZmlUZXRoZXJlZCB8fCBibHVldG9vdGhUZXRoZXJlZCkgewogICAgICAgICAgICAgICAgIHNob3dUZXRoZXJlZE5vdGlmaWNhdGlvbihjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmRyYXdhYmxlLnN0YXRfc3lzX3RldGhlcl9nZW5lcmFsKTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgc2hvd1RldGhlcmVkTm90aWZpY2F0aW9uKGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUuc3RhdF9zeXNfdGV0aGVyX3VzYik7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSBpZiAod2lmaVRldGhlcmVkKSB7Ci0gICAgICAgICAgICBzaG93VGV0aGVyZWROb3RpZmljYXRpb24oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5kcmF3YWJsZS5zdGF0X3N5c190ZXRoZXJfd2lmaSk7CisgICAgICAgICAgICBpZiAoYmx1ZXRvb3RoVGV0aGVyZWQpIHsKKyAgICAgICAgICAgICAgICBzaG93VGV0aGVyZWROb3RpZmljYXRpb24oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5kcmF3YWJsZS5zdGF0X3N5c190ZXRoZXJfZ2VuZXJhbCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNob3dUZXRoZXJlZE5vdGlmaWNhdGlvbihjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmRyYXdhYmxlLnN0YXRfc3lzX3RldGhlcl93aWZpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChibHVldG9vdGhUZXRoZXJlZCkgeworICAgICAgICAgICA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AgICAgIGJvb2xlYW4gcmV0VmFsdWUgPSB0cnVlOwogICAgICAgICAgICAgICAgIHN3aXRjaCAobWVzc2FnZS53aGF0KSB7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ01EX1RFVEhFUl9SRVFVRVNURUQ6CkBAIC04MDEsNyArODU4LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIEBPdmVycmlkZQogICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiU3RhcnRpbmdTdGF0ZS5wcm9jZXNzTWVzc2FnZSB3aGF0PSIgKyBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiU3RhcnRpbmdTdGF0ZS5wcm9jZXNzTWVzc2FnZSB3aGF0PSIgKyBtZXNzYWdlLndoYXQpOwogICAgICAgICAgICAgICAgIGJvb2xlYW4gcmV0VmFsdWUgPSB0cnVlOwogICAgICAgICAgICAgICAgIHN3aXRjaCAobWVzc2FnZS53aGF0KSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIG1heWJlIGEgcGFyZW50IGNsYXNzPwpAQCAtODUzLDcgKzkxMCw3IEBACiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKG1Vc2IpIFRldGhlcmluZy50aGlzLmVuYWJsZVVzYlJuZGlzKHRydWUpOwotICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlRldGhlcmVkICIgKyBtSWZhY2VOYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgIlRldGhlcmVkICIgKyBtSWZhY2VOYW1lKTsKICAgICAgICAgICAgICAgICBzZXRBdmFpbGFibGUoZmFsc2UpOwogICAgICAgICAgICAgICAgIHNldFRldGhlcmVkKHRydWUpOwogICAgICAgICAgICAgICAgIHNlbmRUZXRoZXJTdGF0ZUNoYW5nZWRCcm9hZGNhc3QoKTsKQEAgLTg2NCw3ICs5MjEsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJUZXRoZXJlZFN0YXRlLnByb2Nlc3NNZXNzYWdlIHdoYXQ9IiArIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJUZXRoZXJlZFN0YXRlLnByb2Nlc3NNZXNzYWdlIHdoYXQ9IiArIG1lc3NhZ2Uud2hhdCk7CiAgICAgICAgICAgICAgICAgYm9vbGVhbiByZXRWYWx1ZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgYm9vbGVhbiBlcnJvciA9IGZhbHNlOwogICAgICAgICAgICAgICAgIHN3aXRjaCAobWVzc2FnZS53aGF0KSB7CkBAIC05MDcsNyArOTY0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS53aGF0ID09IENNRF9JTlRFUkZBQ0VfRE9XTikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtVW5hdmFpbGFibGVTdGF0ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJVbnRldGhlcmVkICIgKyBtSWZhY2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiVW50ZXRoZXJlZCAiICsgbUlmYWNlTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBDTURfVEVUSEVSX0NPTk5FQ1RJT05fQ0hBTkdFRDoKICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBuZXdVcHN0cmVhbUlmYWNlTmFtZSA9IChTdHJpbmcpKG1lc3NhZ2Uub2JqKTsKQEAgLTk4MCw3ICsxMDM3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbm5lY3Rpdml0eU1hbmFnZXIuVEVUSEVSX0VSUk9SX01BU1RFUl9FUlJPUik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJUZXRoZXIgbG9zdCB1cHN0cmVhbSBjb25uZWN0aW9uICIgKyBtSWZhY2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiVGV0aGVyIGxvc3QgdXBzdHJlYW0gY29ubmVjdGlvbiAiICsgbUlmYWNlTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kVGV0aGVyU3RhdGVDaGFuZ2VkQnJvYWRjYXN0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVVzYikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghVGV0aGVyaW5nLnRoaXMuY29uZmlndXJlVXNiSWZhY2UoZmFsc2UpKSB7CkBAIC0xMjE4LDggKzEyNzUsMTAgQEAKICAgICAgICAgICAgICAgICBJQmluZGVyIGIgPSBTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKENvbnRleHQuQ09OTkVDVElWSVRZX1NFUlZJQ0UpOwogICAgICAgICAgICAgICAgIElDb25uZWN0aXZpdHlNYW5hZ2VyIGNtID0gSUNvbm5lY3Rpdml0eU1hbmFnZXIuU3R1Yi5hc0ludGVyZmFjZShiKTsKICAgICAgICAgICAgICAgICBtQ29ubmVjdGlvblJlcXVlc3RlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImNob29zZVVwc3RyZWFtVHlwZSgiICsgdHJ5Q2VsbCArICIpLCAgZHVuUmVxdWlyZWQgPSIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgbUR1blJlcXVpcmVkICsgIiwgaWZhY2U9IiArIGlmYWNlKTsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiY2hvb3NlVXBzdHJlYW1UeXBlKCIgKyB0cnlDZWxsICsgIiksICBkdW5SZXF1aXJlZCA9IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUR1blJlcXVpcmVkICsgIiwgaWZhY2U9IiArIGlmYWNlKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKGlmYWNlICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRHVuUmVxdWlyZWQpIHsKQEAgLTEyMjcsNyArMTI4Niw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTmV0d29ya0luZm8gaW5mbyA9IGNtLmdldE5ldHdvcmtJbmZvKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRV9EVU4pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmZvLmlzQ29ubmVjdGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAic2V0dGluZyBkdW4gaWZhY2VuYW1lID0iICsgaWZhY2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgInNldHRpbmcgZHVuIGlmYWNlbmFtZSA9IiArIGlmYWNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXZlbiBpZiB3ZSdyZSBhbHJlYWR5IGNvbm5lY3RlZCAtIGl0IG1heSBiZSBzb21lYm9keSBlbHNlJ3MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVmY291bnQsIHNvIGFkZCBvdXIgb3duCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR1cm5Pbk1vYmlsZUNvbm5lY3Rpb24oKTsKQEAgLTEyMzksMTEgKzEyOTgsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiY2hlY2tpbmcgaWYgaGlwcmkgYnJvdWdodCB1cyB0aGlzIGNvbm5lY3Rpb24iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgImNoZWNraW5nIGlmIGhpcHJpIGJyb3VnaHQgdXMgdGhpcyBjb25uZWN0aW9uIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTmV0d29ya0luZm8gaW5mbyA9IGNtLmdldE5ldHdvcmtJbmZvKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRV9ISVBSSSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZm8uaXNDb25uZWN0ZWQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJ5ZXMgLSBoaXByaSBpbiB1c2UiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJ5ZXMgLSBoaXByaSBpbiB1c2UiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXZlbiBpZiB3ZSdyZSBhbHJlYWR5IGNvbm5lY3RlZCAtIGl0IG1heSBiZSBzb21ib2R5IGVsc2UncwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZWZjb3VudCwgc28gYWRkIG91ciBvd24KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHVybk9uTW9iaWxlQ29ubmVjdGlvbigpOwpAQCAtMTI2NSw3ICsxMzI0LDcgQEAKICAgICAgICAgICAgICAgICBub3RpZnlUZXRoZXJlZE9mTmV3VXBzdHJlYW1JZmFjZShpZmFjZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBwcm90ZWN0ZWQgdm9pZCBub3RpZnlUZXRoZXJlZE9mTmV3VXBzdHJlYW1JZmFjZShTdHJpbmcgaWZhY2VOYW1lKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAibm90aWZ5aW5nIHRldGhlcmVkIHdpdGggaWZhY2UgPSIgKyBpZmFjZU5hbWUpOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAibm90aWZ5aW5nIHRldGhlcmVkIHdpdGggaWZhY2UgPSIgKyBpZmFjZU5hbWUpOwogICAgICAgICAgICAgICAgIG1VcHN0cmVhbUlmYWNlTmFtZSA9IGlmYWNlTmFtZTsKICAgICAgICAgICAgICAgICBmb3IgKE9iamVjdCBvIDogbU5vdGlmeUxpc3QpIHsKICAgICAgICAgICAgICAgICAgICAgVGV0aGVySW50ZXJmYWNlU00gc20gPSAoVGV0aGVySW50ZXJmYWNlU00pbzsKQEAgLTEyODIsMTkgKzEzNDEsMTkgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIEBPdmVycmlkZQogICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiTWFzdGVySW5pdGlhbFN0YXRlLnByb2Nlc3NNZXNzYWdlIHdoYXQ9IiArIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJNYXN0ZXJJbml0aWFsU3RhdGUucHJvY2Vzc01lc3NhZ2Ugd2hhdD0iICsgbWVzc2FnZS53aGF0KTsKICAgICAgICAgICAgICAgICBib29sZWFuIHJldFZhbHVlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1lc3NhZ2Uud2hhdCkgewogICAgICAgICAgICAgICAgICAgICBjYXNlIENNRF9URVRIRVJfTU9ERV9SRVFVRVNURUQ6CiAgICAgICAgICAgICAgICAgICAgICAgICBtRHVuUmVxdWlyZWQgPSBpc0R1blJlcXVpcmVkKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBUZXRoZXJJbnRlcmZhY2VTTSB3aG8gPSAoVGV0aGVySW50ZXJmYWNlU00pbWVzc2FnZS5vYmo7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJUZXRoZXIgTW9kZSByZXF1ZXN0ZWQgYnkgIiArIHdoby50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiVGV0aGVyIE1vZGUgcmVxdWVzdGVkIGJ5ICIgKyB3aG8udG9TdHJpbmcoKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBtTm90aWZ5TGlzdC5hZGQod2hvKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtVGV0aGVyTW9kZUFsaXZlU3RhdGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ01EX1RFVEhFUl9NT0RFX1VOUkVRVUVTVEVEOgogICAgICAgICAgICAgICAgICAgICAgICAgd2hvID0gKFRldGhlckludGVyZmFjZVNNKW1lc3NhZ2Uub2JqOwotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiVGV0aGVyIE1vZGUgdW5yZXF1ZXN0ZWQgYnkgIiArIHdoby50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiVGV0aGVyIE1vZGUgdW5yZXF1ZXN0ZWQgYnkgIiArIHdoby50b1N0cmluZygpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleCA9IG1Ob3RpZnlMaXN0LmluZGV4T2Yod2hvKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCAhPSAtMSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ob3RpZnlMaXN0LnJlbW92ZSh3aG8pOwpAQCAtMTMyNCw3ICsxMzgzLDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIEBPdmVycmlkZQogICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiVGV0aGVyTW9kZUFsaXZlU3RhdGUucHJvY2Vzc01lc3NhZ2Ugd2hhdD0iICsgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgIlRldGhlck1vZGVBbGl2ZVN0YXRlLnByb2Nlc3NNZXNzYWdlIHdoYXQ9IiArIG1lc3NhZ2Uud2hhdCk7CiAgICAgICAgICAgICAgICAgYm9vbGVhbiByZXRWYWx1ZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgc3dpdGNoIChtZXNzYWdlLndoYXQpIHsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBDTURfVEVUSEVSX01PREVfUkVRVUVTVEVEOgpAQCAtMTM1Miw4ICsxNDExLDEwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgd2UncmUgc3RpbGwgdXNpbmcgYSByZXF1ZXN0ZWQgY29ubmVjdGlvbiAtIG1heSBoYXZlIGZvdW5kCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aWZpIG9yIHNvbWV0aGluZyBzaW5jZSB0aGVuLgogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Db25uZWN0aW9uUmVxdWVzdGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAicmVuZXdpbmcgbW9iaWxlIGNvbm5lY3Rpb24gLSByZXF1ZXVpbmcgZm9yIGFub3RoZXIgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDRUxMX0NPTk5FQ1RJT05fUkVORVdfTVMgKyAibXMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAicmVuZXdpbmcgbW9iaWxlIGNvbm5lY3Rpb24gLSByZXF1ZXVpbmcgZm9yIGFub3RoZXIgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0VMTF9DT05ORUNUSU9OX1JFTkVXX01TICsgIm1zIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR1cm5Pbk1vYmlsZUNvbm5lY3Rpb24oKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpkaWZmIC0tZ2l0IGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvbG9jYXRpb24vQ29tcHJlaGVuc2l2ZUNvdW50cnlEZXRlY3Rvci5qYXZhIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvbG9jYXRpb24vQ29tcHJlaGVuc2l2ZUNvdW50cnlEZXRlY3Rvci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNzU1Cmlu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IGJlZW4gc3RvcHBlZC4KKyAgICAgICAgcmV0dXJuIGRldGVjdENvdW50cnkoZmFsc2UsICFtU3RvcHBlZCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc3RvcCgpIHsKKyAgICAgICAgU2xvZy5pKFRBRywgIlN0b3AgdGhlIGRldGVjdG9yLiIpOworICAgICAgICBjYW5jZWxMb2NhdGlvblJlZnJlc2goKTsKKyAgICAgICAgcmVtb3ZlUGhvbmVTdGF0ZUxpc3RlbmVyKCk7CisgICAgICAgIHN0b3BMb2NhdGlvbkJhc2VkRGV0ZWN0b3IoKTsKKyAgICAgICAgbUxpc3RlbmVyID0gbnVsbDsKKyAgICAgICAgbVN0b3BwZWQgPSB0cnVlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEdldCB0aGUgY291bnRyeSBmcm9tIGRpZmZlcmVudCBzb3VyY2VzIGluIG9yZGVyIG9mIHRoZSByZWxpYWJpbGl0eS4KKyAgICAgKi8KKyAgICBwcml2YXRlIENvdW50cnkgZ2V0Q291bnRyeSgpIHsKKyAgICAgICAgQ291bnRyeSByZXN1bHQgPSBudWxsOworICAgICAgICByZXN1bHQgPSBnZXROZXR3b3JrQmFzZWRDb3VudHJ5KCk7CisgICAgICAgIGlmIChyZXN1bHQgPT0gbnVsbCkgeworICAgICAgICAgICAgcmVzdWx0ID0gZ2V0TGFzdEtub3duTG9jYXRpb25CYXNlZENvdW50cnkoKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocmVzdWx0ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJlc3VsdCA9IGdldFNpbUJhc2VkQ291bnRyeSgpOworICAgICAgICB9CisgICAgICAgIGlmIChyZXN1bHQgPT0gbnVsbCkgeworICAgICAgICAgICAgcmVzdWx0ID0gZ2V0TG9jYWxlQ291bnRyeSgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiB0aGUgY291bnRyeSBmcm9tIHRoZSBtb2JpbGUgbmV0d29yay4KKyAgICAgKi8KKyAgICBwcm90ZWN0ZWQgQ291bnRyeSBnZXROZXR3b3JrQmFzZWRDb3VudHJ5KCkgeworICAgICAgICBTdHJpbmcgY291bnRyeUlzbyA9IG51bGw7CisgICAgICAgIC8vIFRPRE86IFRoZSBkb2N1bWVudCBzYXlzIHRoZSByZXN1bHQgbWF5IGJlIHVucmVsaWFibGUgb24gQ0RNQSBuZXR3b3Jrcy4gU2hhbGwgd2UgdXNlCisgICAgICAgIC8vIGl0IG9uIENETUEgcGhvbmU/IFdlIG1heSB0ZXN0IHRoZSBBbmRyb2lkIHByaW1hcmlseSB1c2VkIGNvdW50cmllcy4KKyAgICAgICAgaWYgKG1QaG9uZVR5cGUgPT0gVGVsZXBob255TWFuYWdlci5QSE9ORV9UWVBFX0dTTSkgeworICAgICAgICAgICAgY291bnRyeUlzbyA9IG1UZWxlcGhvbnlNYW5hZ2VyLmdldE5ldHdvcmtDb3VudHJ5SXNvKCk7CisgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGNvdW50cnlJc28pKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBDb3VudHJ5KGNvdW50cnlJc28sIENvdW50cnkuQ09VTlRSWV9TT1VSQ0VfTkVUV09SSyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiB0aGUgY2FjaGVkIGxvY2F0aW9uIGJhc2VkIGNvdW50cnkuCisgICAgICovCisgICAgcHJvdGVjdGVkIENvdW50cnkgZ2V0TGFzdEtub3duTG9jYXRpb25CYXNlZENvdW50cnkoKSB7CisgICAgICAgIHJldHVybiBtQ291bnRyeUZyb21Mb2NhdGlvbjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIHRoZSBjb3VudHJ5IGZyb20gU0lNIGNhcmQK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FibGUoKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgcnVuQWZ0ZXJEZXRlY3Rpb24oCisgICAgICAgICAgICAgICAgICAgICAgICBjb3VudHJ5LCBkZXRlY3RlZENvdW50cnksIG5vdGlmeUNoYW5nZSwgc3RhcnRMb2NhdGlvbkJhc2VkRGV0ZWN0aW9uKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0Q291bnRyeUxpc3RlbmVyKENvdW50cnlMaXN0ZW5lciBsaXN0ZW5lcikgeworICAgICAgICBDb3VudHJ5TGlzdGVuZXIgcHJldkxpc3RlbmVyID0gbUxpc3RlbmVyOworICAgICAgICBtTGlzdGVuZXIgPSBsaXN0ZW5lcjsKKyAgICAgICAgaWYgKG1MaXN0ZW5lciA9PSBudWxsKSB7CisgICAgICAgICAgICAvLyBTdG9wIGxpc3RlbmluZyBhbGwgc2VydmljZXMKKyAgICAgICAgICAgIHJlbW92ZVBob25lU3RhdGVMaXN0ZW5lcigpOworICAgICAgICAgICAgc3RvcExvY2F0aW9uQmFzZWREZXRlY3RvcigpOworICAgICAgICAgICAgY2FuY2VsTG9jYXRpb25SZWZyZXNoKCk7CisgICAgICAgIH0gZWxzZSBpZiAocHJldkxpc3RlbmVyID09IG51bGwpIHsKKyAgICAgICAgICAgIGFkZFBob25lU3RhdGVMaXN0ZW5lcigpOworICAgICAgICAgICAgZGV0ZWN0Q291bnRyeShmYWxzZSwgdHJ1ZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIHJ1bkFmdGVyRGV0ZWN0aW9uKGZpbmFsIENvdW50cnkgY291bnRyeSwgZmluYWwgQ291bnRyeSBkZXRlY3RlZENvdW50cnksCisgICAgICAgICAgICBmaW5hbCBib29sZWFuIG5vdGlmeUNoYW5nZSwgZmluYWwgYm9vbGVhbiBzdGFydExvY2F0a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zZWRDb3VudHJ5RGV0ZWN0b3IgPSBjcmVhdGVMb2NhdGlvbkJhc2VkQ291bnRyeURldGVjdG9yKCk7CisgICAgICAgIG1Mb2NhdGlvbkJhc2VkQ291bnRyeURldGVjdG9yLnNldENvdW50cnlMaXN0ZW5lcihsaXN0ZW5lcik7CisgICAgICAgIG1Mb2NhdGlvbkJhc2VkQ291bnRyeURldGVjdG9yLmRldGVjdENvdW50cnkoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIHN0b3BMb2NhdGlvbkJhc2VkRGV0ZWN0b3IoKSB7CisgICAgICAgIGlmIChtTG9jYXRpb25CYXNlZENvdW50cnlEZXRlY3RvciAhPSBudWxsKSB7CisgICAgICAgICAgICBtTG9jYXRpb25CYXNlZENvdW50cnlEZXRlY3Rvci5zdG9wKCk7CisgICAgICAgICAgICBtTG9jYXRpb25CYXNlZENvdW50cnlEZXRlY3RvciA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgQ291bnRyeURldGVjdG9yQmFzZSBjcmVhdGVMb2NhdGlvbkJhc2VkQ291bnRyeURldGVjdG9yKCkgeworICAgICAgICByZXR1cm4gbmV3IExvY2F0aW9uQmFzZWRDb3VudHJ5RGV0ZWN0b3IobUNvbnRleHQpOworICAgIH0KKworICAgIHByb3RlY3RlZCBib29sZWFuIGlzQWlycGxhbmVNb2RlT2ZmKCkgeworICAgICAgICByZXR1cm4gU2V0dGluZ3MuU3lzdGVtLmdldEludCgKKyAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwgU2V0dGluZ3MuU3lzdGVtLkFJUlBMQU5FX01PREVfT04sIDApID09IDA7CisgICAgfQorCisgICAgLyoqCisgICAgICogTm90aWZ5IHRoZSBjb3VudHJ5IGNoYW5nZS4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgbm90aWZ5SWZDb3VudHJ5Q2hhbmdlZChmaW5hbCBDb3VudHJ5IGNvdW50cnksIGZpbmFsIENvdW50cnkgZGV0ZWN0ZWRDb3VudHJ5KSB7CisgICAgICAgIGlmIChkZXRlY3RlZENvdW50cnkgIT0gbnVsbCAmJiBtTGlzdGVuZXIgIT0gbnVsbAorICAgICAgICAgICAgICAgICYmIChjb3VudHJ5ID09IG51bGwgfHwgIWNvdW50cnkuZXF1YWxzKGRldGVjdGVkQ291bnRyeSkpKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLAorICAgICAgICAgICAgICAgICAgICAiVGhlIGNvdW50cnkgd2FzIGNoYW5nZWQgZnJvbSAiICsgY291bnRyeSAhPSBudWxsID8gY291bnRyeS5nZXRDb3VudHJ5SXNvKCkgOgorICAgICAgICAgICAgICAgICAgICAgICAgY291bnRyeSArICIgdG8gIiArIGRldGVjdGVkQ291bnRyeS5nZXRDb3VudHJ5SXNvKCkpOworICAgICAgICAgICAgbm90aWZ5TGlzdGVuZXIoZGV0ZWN0ZWRDb3VudHJ5KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFNjaGVkdWxlIHRoZSBuZXh0IGxvY2F0aW9uIHJlZnJlc2guIFdlIHdpbGwgZG8gbm90aGluZyBpZiB0aGUgc2NoZWR1bGVkIHRhc2sgZXhpc3RzLgorICAgICAqLworICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgc2NoZWR1bGVMb2NhdGlvblJlZnJlc2goKSB7CisgICAgICAgIGlmIChtTG9jYXRpb25SZWZyZXNoVGltZXIgIT0gbnVsbCkgcmV0dXJuOworICAgICAgICBtTG9jYXRpb25SZWZyZXNoVGltZXIgPSBuZXcgVGltZXIoKTsKKyAgICAgICAgbUxvY2F0aW9uUmVmcmVzaFRpbWVyLnNjaGVkdWxlKG5ldyBUaW1lclRhc2soKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBtTG9jYXRpb25SZWZyZXNoVGltZXIgPSBudWxsOworICAgICAgICAgICAgICAgIGRldGVjdENvdW50cnkoZmFsc2UsIHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9LCBMT0NBVElPTl9SRUZSRVNIX0lOVEVSVkFMKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDYW5jZWwgdGhlIHNjaGVkdWxlZCByZWZyZXNoIHRhc2sgaWYgaXQgZXhpc3RzCisgICAgICovCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCBjYW5jZWxMb2NhdGlvblJlZnJlc2goKSB7CisgICAgICAgIGlmIChtTG9jYXRpb25SZWZyZXNoVGltZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbUxvY2F0aW9uUmVmcmVzaFRpbWVyLmNhbmNlbCgpOworICAgICAgICAgICAgbUxvY2F0aW9uUmVmcmVzaFRpbWVyID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByb3RlY3RlZCBzeW5jaHJvbml6ZWQgdm9pZCBhZGRQaG9uZVN0YXRlTGlzdGVuZXIoKSB7CisgICAgICAgIGlmIChtUGhvbmVTdGF0ZUxpc3RlbmVyID09IG51bGwgJiYgbVBob25lVHlwZSA9PSBUZWxlcGhvbnlNYW5hZ2VyLlBIT05FX1RZUEVfR1NNKSB7CisgICAgICAgICAgICBtTGFzdFN0YXRlID0gbnVsbDsKKyAgICAgICAgICAgIG1QaG9uZVN0YXRlTGlzdGVuZXIgPSBuZXcgUGhvbmVTdGF0ZUxpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uU2VydmljZVN0YXRlQ2hhbmdlZChTZXJ2aWNlU3RhdGUgc2VydmljZVN0YXRlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IEZpbmQgb3V0IGhvdyBvZnRlbiB3ZSB3aWxsIGJlIG5vdGlmaWVkLCBpZiB0aGlzCisgICAgICAgICAgICAgICAgICAgIC8vIG1ldGhvZCBpcyBjYWxsZWQgdG9vCisgICAgICAgICAgICAgICAgICAgIC8vIG1hbnkgdGltZXMsIGxldCdzIGNvbnNpZGVyIHF1ZXJ5aW5nIHRoZSBuZXR3b3JrLgorICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAib25TZXJ2aWNlU3RhdGVDaGFuZ2VkIik7CisgICAgICAgICAgICAgICAgICAgIC8vIFdlIG9ubHkgY2FyZSB0aGUgc3RhdGUgY2hhbmdlCisgICAgICAgICAgICAgICAgICAgIGlmIChtTGFzdFN0YXRlID09IG51bGwgfHwgbUxhc3RTdGF0ZS5nZXRTdGF0ZSgpICE9IHNlcnZpY2VTdGF0ZS5nZXRTdGF0ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXRlY3RDb3VudHJ5KHRydWUsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RTdGF0ZSA9IG5ldyBTZXJ2aWNlU3RhdGUoc2VydmljZVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBtVGVsZXBob255TWFuYWdlci5saXN0ZW4obVBob25lU3RhdGVMaXN0ZW5lciwgUGhvbmVTdGF0ZUxpc3RlbmVyLkxJU1RFTl9TRVJWSUNFX1NUQVRFKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByb3RlY3RlZCBzeW5jaHJvbml6ZWQgdm9pZCByZW1vdmVQaG9uZVN0YXRlTGlzdGVuZXIoKSB7CisgICAgICAgIGlmIChtUGhvbmVTdGF0ZUxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1UZWxlcGhvbnlNYW5hZ2VyLmxpc3RlbihtUGhvbmVTdGF0ZUxpc3RlbmVyLCBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX05PTkUpOworICAgICAgICAgICA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HRoZSBsb2NhdGlvbiBwcm92aWRlcnMKKyAgICAgKi8KKyAgICBwcm90ZWN0ZWQgdm9pZCB1bnJlZ2lzdGVyUHJvdmlkZXJzKExpc3Q8TG9jYXRpb25MaXN0ZW5lcj4gbGlzdGVuZXJzKSB7CisgICAgICAgIGZvciAoTG9jYXRpb25MaXN0ZW5lciBsaXN0ZW5lciA6IGxpc3RlbmVycykgeworICAgICAgICAgICAgbUxvY2F0aW9uTWFuYWdlci5yZW1vdmVVcGRhdGVzKGxpc3RlbmVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdGhlIGxhc3Qga25vd24gbG9jYXRpb24gZnJvbSBhbGwgcHJvdmlkZXJzCisgICAgICovCisgICAgcHJvdGVjdGVkIExvY2F0aW9uIGdldExhc3RLbm93bkxvY2F0aW9uKCkgeworICAgICAgICBMaXN0PFN0cmluZz4gcHJvdmlkZXJzID0gbUxvY2F0aW9uTWFuYWdlci5nZXRBbGxQcm92aWRlcnMoKTsKKyAgICAgICAgTG9jYXRpb24gYmVzdExvY2F0aW9uID0gbnVsbDsKKyAgICAgICAgZm9yIChTdHJpbmcgcHJvdmlkZXIgOiBwcm92aWRlcnMpIHsKKyAgICAgICAgICAgIExvY2F0aW9uIGxhc3RLbm93bkxvY2F0aW9uID0gbUxvY2F0aW9uTWFuYWdlci5nZXRMYXN0S25vd25Mb2NhdGlvbihwcm92aWRlcik7CisgICAgICAgICAgICBpZiAobGFzdEtub3duTG9jYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChiZXN0TG9jYXRpb24gPT0gbnVsbCB8fCBiZXN0TG9jYXRpb24uZ2V0VGltZSgpIDwgbGFzdEtub3duTG9jYXRpb24uZ2V0VGltZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIGJlc3RMb2NhdGlvbiA9IGxhc3RLbm93bkxvY2F0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYmVzdExvY2F0aW9uOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdGhlIHRpbWVvdXQgZm9yIHF1ZXJ5aW5nIHRoZSBsb2NhdGlvbi4KKyAgICAgKi8KKyAgICBwcm90ZWN0ZWQgbG9uZyBnZXRRdWVyeUxvY2F0aW9uVGltZW91dCgpIHsKKyAgICAgICAgcmV0dXJuIFFVRVJZX0xPQ0FUSU9OX1RJTUVPVVQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiB0aGUgdG90YWwgbnVtYmVyIG9mIGVuYWJsZWQgbG9jYXRpb24gcHJvdmlkZXJzCisgICAgICovCisgICAgcHJvdGVjdGVkIGludCBnZXRUb3RhbEVuYWJsZWRQcm92aWRlcnMoKSB7CisgICAgICAgIGlmIChtRW5hYmxlZFByb3ZpZGVycyA9PSBudWxsKSB7CisgICAgICAgICAgICBtRW5hYmxlZFByb3ZpZGVycyA9IG1Mb2NhdGlvbk1hbmFnZXIuZ2V0UHJvdmlkZXJzKHRydWUpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtRW5hYmxlZFByb3ZpZGVycy5zaXplKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU3RhcnQgZGV0ZWN0aW5nIHRoZSBjb3VudHJ5LgorICAgICAqIDxwPgorICAgICAqIFF1ZXJpZXMgdGhlIGxvY2F0aW9uIGZyb20gYWxsIGxvY2F0aW9uIHByb3ZpZGVycywgdGhlbiBzdGFydHMgYSB0aHJlYWQgdG8gcXVlcnkgdGhlCisgICAgICogY291bnRyeSBmcm9tIEdlb0NvZGVyLgorICAgICAqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgQ291bnRyeSBkZXRlY3RDb3VudHJ5KCkgeworICAgICAgICBpZiAobUxvY2F0aW9uTGlzdGVuZXJzICAhPSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCk7CisgICAgICAgIH0KKyAgICAgICAgLy8gUmVxdWVzdCB0aGUgbG9jYXRpb24gZnJvbSBhbGwgZW5hYmxlZCBwcm92aWRlcnMuCisgICAgICAgIGludCB0b3RhbFByb3ZpZGVycyA9IGdldFRvdGFsRW5hYmxlZFByb3ZpZGVycygpOworICAgICAgICBpZiAodG90YWxQcm92aWRlcnMgPiAwKSB7CisgICAgICAgICAgICBtTG9jYXRpb25MaXN0ZW5lcnMgPSBuZXcgQXJyYXlMaXN0PExvY2F0aW9uTGlzdGVuZXI+KHRvdGFsUHJvdmlkZXJzKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgdG90YWxQcm92aWRlcnM7IGkrKykgeworICAgICAgICAgICAgICAgIExvY2F0aW9uTGlzdGVuZXIgbGlzdGVuZXIgPSBuZXcgTG9jYXRpb25MaXN0ZW5lciAoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uTG9jYXRpb25DaGFuZ2VkKExvY2F0aW9uIGxvY2F0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobG9jYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvY2F0aW9uQmFzZWRDb3VudHJ5RGV0ZWN0b3IudGhpcy5zdG9wKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVlcnlDb3VudHJ5Q29kZShsb2NhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25Qcm92aWRlckRpc2FibGVkKFN0cmluZyBwcm92aWRlcikgeworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uUHJvdmlkZXJFbmFibGVkKFN0cmluZyBwcm92aWRlcikgeworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uU3RhdHVzQ2hhbmdlZChTdHJpbmcgcHJvdmlkZXIsIGludCBzdGF0dXMsIEJ1bmRsZSBleHRyYXMpIHsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgbUxvY2F0aW9uTGlzdGVuZXJzLmFkZChsaXN0ZW5lcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZWdpc3RlckVuYWJsZWRQcm92aWRlcnMobUxvY2F0aW9uTGlzdGVuZXJzKTsKKyAgICAgICAgICAgIG1UaW1lciA9IG5ldyBUaW1lcigpOworICAgICAgICAgICAgbVRpbWVyLnNjaGVkdWxlKG5ldyBUaW1lclRhc2soKSB7CisgICAgICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICBtVGltZXIgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBMb2NhdGlvbkJhc2VkQ291bnRyeURldGVjdG9yLnRoaXMuc3RvcCgpOworICAgICAgICAgICAgICAgICAgICAvLyBMb29rcyBsaWtlIG5vIHByb3ZpZGVyIGNvdWxkIHByb3ZpZGUgdGhlIGxvY2F0aW9uLCBsZXQncyB0cnkgdGhlIGxhc3QKKyAgICAgICAgICAgICAgICAgICAgLy8ga25vd24gbG9jYXRpb24uCisgICAgICAgICAgICAgICAgICAgIHF1ZXJ5Q291bnRyeUNvZGUoZ2V0TGFzdEtub3duTG9jYXRpb24oKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwgZ2V0UXVlcnlMb2NhdGlvblRpbWVvdXQoKSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBUaGVyZSBpcyBubyBwcm92aWRlciBlbmFibGVkLgorICAgICAgICAgICAgcXVlcnlDb3VudHJ5Q29kZShnZXRMYXN0S25vd25Mb2NhdGlvbigpKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbURldGVjdGVkQ291bnRyeTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdG9wIHRoZSBjdXJyZW50IHF1ZXJ5IHdpdGhvdXQgbm90aWZ5aW5nIHRoZSBsaXN0ZW5lci4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgc3RvcCgpIHsKKyAgICAgICAgaWYgKG1Mb2NhdGlvbkxpc3RlbmVycyAhPSBudWxsKSB7CisgICAgICAgICAgICB1bnJlZ2lzdGVyUHJvdmlkZXJzKG1Mb2NhdGlvbkxpc3RlbmVycyk7CisgICAgICAgICAgICBtTG9jYXRpb25MaXN0ZW5lcnMgPSBudWxsOworICAgICAgICB9CisgICAgICAgIGlmIChtVGltZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbVRpbWVyLmNhbmNlbCgpOworICAgICAgICAgICAgbVRpbWVyID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFN0YXJ0IGEgbmV3IHRocmVhZCB0byBxdWVyeSB0aGUgY291bnRyeSBmcm9tIEdlb2NvZGVyLgorICAgICAqLworICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgcXVlcnlDb3VudHJ5Q29kZShmaW5hbCBMb2NhdGlvbiBsb2NhdGlvbikgeworICAgICAgICBpZiAobG9jYXRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgbm90aWZ5TGlzdGVuZXIobnVsbCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1RdWVyeVRocmVhZCAhPSBudWxsKSByZXR1cm47CisgICAgICAgIG1RdWVyeVRocmVhZCA9IG5ldyBUaHJlYWQobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIFN0cmluZyBjb3VudHJ5SXNvID0gbnVsbDsKKyAgICAgICAgICAgICAgICBpZiAobG9jYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjb3VudHJ5SXNvID0gZ2V0Q291bnRyeUZyb21Mb2NhdGlvbihsb2NhdGlvbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChjb3VudHJ5SXNvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbURldGVjdGVkQ291bnRyeSA9IG5ldyBDb3VudHJ5KGNvdW50cnlJc28sIENvdW50cnkuQ09VTlRSWV9TT1VSQ0VfTE9DQVRJT04pOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1EZXRlY3RlZENvdW50cnkgPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcihtRGV0ZWN0ZWRDb3VudHJ5KTsKKyAgICAgICAgICAgICAgICBtUXVlcnlUaHJlYWQgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICAgICAgbVF1ZXJ5VGhyZWFkLnN0YXJ0KCk7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvc2VydmljZXMvam5pL0FuZHJvaWQubWsgYi9zZXJ2aWNlcy9qbmkvQW5kcm9pZC5tawppbmRleCBjOTA4NzlkLi5kMTBmNTRmIDEwMDY0NAotLS0gYS9zZXJ2aWNlcy9qbmkvQW5kcm9pZC5taworKysgYi9zZXJ2aWNlcy9qbmkvQW5kcm9pZC5tawpAQCAtOCw2ICs4LDcgQEAKICAgICBjb21fYW5kcm9pZF9zZXJ2ZXJfTGlnaHRzU2VydmljZS5jcHAgXAogICAgIGNvbV9hbmRyb2lkX3NlcnZlcl9Qb3dlck1hbmFnZXJTZXJ2aWNlLmNwcCBcCiAgICAgY29tX2FuZHJvaWRfc2VydmVyX1N5c3RlbVNlcnZlci5jcHAgXAorICAgIGNvbV9hbmRyb2lkX3N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oIWRldmljZSkgeworICAgICAgICBMT0dFKCJ1c2JfZGV2aWNlX29wZW4gZmFpbGVkXG4iKTsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgdXNiX2Rlc2NyaXB0b3JfaXRlcl9pbml0KGRldmljZSwgJml0ZXIpOworCisgICAgd2hpbGUgKChkZXNjID0gdXNiX2Rlc2NyaXB0b3JfaXRlcl9uZXh0KCZpdGVyKSkgIT0gTlVMTCkgeworICAgICAgICBpZiAoZGVzYy0+YkRlc2NyaXB0b3JUeXBlID09IFVTQl9EVF9JTlRFUkZBQ0UpIHsKKyAgICAgICAgICAgIHN0cnVjdCB1c2JfaW50ZXJmYWNlX2Rlc2NyaXB0b3IgKmludGVyZmFjZSA9IChzdHJ1Y3QgdXNiX2ludGVyZmFjZV9kZXNjcmlwdG9yICopZGVzYzsKKworICAgICAgICAgICAgaWYgKGludGVyZmFjZS0+YkludGVyZmFjZUNsYXNzID09IFVTQl9DTEFTU19TVElMTF9JTUFHRSAmJgorICAgICAgICAgICAgICAgIGludGVyZmFjZS0+YkludGVyZmFjZVN1YkNsYXNzID09IDEgJiYgLy8gU3RpbGwgSW1hZ2UgQ2FwdHVyZQorICAgICAgICAgICAgICAgIGludGVyZmFjZS0+YkludGVyZmFjZVByb3RvY29sID09IDEpICAgICAvLyBQaWN0dXJlIFRyYW5zZmVyIFByb3RvY29sIChQSU1BIDE1NDcwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIExPR0QoIkZvdW5kIGNhbWVyYTogXCIlc1wiIFwiJXNcIlxuIiwgdXNiX2RldmljZV9nZXRfbWFudWZhY3R1cmVyX25hbWUoZGV2aWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHVzYl9kZXZpY2VfZ2V0X3Byb2R1Y3RfbmFtZShkZXZpY2UpKTsKKworICAgICAgICAgICAgICAgIC8vIGludGVyZmFjZSBzaG91bGQgYmUgZm9sbG93ZWQgYnkgdGhyZWUgZW5kcG9pbnRzCisgICAgICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludF9kZXNjcmlwdG9yICplcDsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50X2Rlc2NyaXB0b3IgKmVwX2luX2Rlc2MgPSBOVUxMOworICAgICAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnRfZGVzY3JpcHRvciAqZXBfb3V0X2Rlc2MgPSBOVUxMOworICAgICAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnRfZGVzY3JpcHRvciAqZXBfaW50cl9kZXNjID0gTlVMTDsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBlcCA9IChzdHJ1Y3QgdXNiX2VuZHBvaW50X2Rlc2NyaXB0b3IgKil1c2JfZGVzY3JpcHRvcl9pdGVyX25leHQoJml0ZXIpOworICAgICAgICAgICAgICAgICAgICBpZiAoIWVwIHx8IGVwLT5iRGVzY3JpcHRvclR5cGUgIT0gVVNCX0RUX0VORFBPSU5UKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMT0dFKCJlbmRwb2ludHMgbm90IGZvdW5kXG4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoZXAtPmJtQXR0cmlidXRlcyA9PSBVU0JfRU5EUE9JTlRfWEZFUl9CVUxLKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXAtPmJFbmRwb2ludEFkZHJlc3MgJiBVU0JfRU5EUE9JTlRfRElSX01BU0spCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXBfaW5fZGVzYyA9IGVwOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVwX291dF9kZXNjID0gZXA7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXAtPmJtQXR0cmlidXRlcyA9PSBVU0JfRU5EUE9JTlRfWEZFUl9JTlQgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIGVwLT5iRW5kcG9pbnRBZGRyZXNzICYgVVNCX0VORFBPSU5UX0RJUl9NQVNLKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlcF9pbnRyX2Rlc2MgPSBlcDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIWVwX2luX2Rlc2MgfHwgIWVwX291dF9kZXNjIHx8ICFlcF9pbnRyX2Rlc2MpIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HRSgiZW5kcG9pbnRzIG5vdCBmb3VuZFxuIik7CisgICAgICAgICAgICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBpZiB3ZSBnb3QgaGVyZSwgd2UgZm91bmQgYSBjYW1lcmEKKyAgICAgICAgICAgICAgICBKTklFbnYqIGVudiA9IEFuZHJvaWRSdW50aW1lOjpnZXRKTklFbnYoKTsKKyAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXogPSAoam9iamVjdCljbGllbnRfZGF0YTsKKworICAgICAgICAgICAgICAgIGludCBpZCA9IHVzYl9kZXZpY2VfZ2V0X3VuaXF1ZV9pZF9mcm9tX25hbWUoZGV2bmFtZSk7CisgICAgICAgICAgICAgICAgbURldmljZUxpc3QuYWRkKGlkKTsKKworICAgICAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QodGhpeiwgbWV0aG9kX3VzYkNhbWVyYUFkZGVkLCBpZCk7CisgICAgICAgICAgICAgICAgY2hlY2tBbmRDbGVhckV4Y2VwdGlvbkZyb21DYWxsYmFjayhlbnYsIF9fRlVOQ1RJT05fXyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Citkb25lOgorICAgIHVzYl9kZXZpY2VfY2xvc2UoZGV2aWNlKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCB1c2JfZGV2aWNlX3JlbW92ZWQoY29uc3QgY2hhciAqZGV2bmFtZSwgdm9pZCogY2xpZW50X2RhdGEpIHsKKyAgICBpbnQgaWQgPSB1c2JfZGV2aWNlX2dldF91bmlxdWVfaWRfZnJvbV9uYW1lKGRldm5hbWUpOworCisgICAgLy8gc2VlIGlmIGl0IGlzIGEgZGV2aWNlIHdlIGtub3cgYWJvdXQKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IG1EZXZpY2VMaXN0LnNpemUoKTsgaSsrKSB7CisgICAgICAgIGlmIChpZCAgPT0gbURldmljZUxpc3RbaV0pIHsKKyAgICAgICAgICAgIG1EZXZpY2VMaXN0LnJlbW92ZUF0KGkpOworCisgICAgICAgICAgICBKTklFbnYqIGVudiA9IEFuZHJvaWRSdW50aW1lOjpnZXRKTklFbnYoKTsKKyAgICAgICAgICAgIGpvYmplY3QgdGhpeiA9IChqb2JqZWN0KWNsaWVudF9kYXRhOworCisgICAgICAgICAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKHRoaXosIG1ldGhvZF91c2JDYW1lcmFSZW1vdmVkLCBpZCk7CisgICAgICAgICAgICBjaGVja0FuZENsZWFyRXhjZXB0aW9uRnJvbUNhbGxiYWNrKGVudiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAwOworfQorCitzdGF0aWMgdm9pZCBhbmRyb2lkX3NlcnZlcl9Vc2JPYnNlcnZlcl9tb25pdG9yVXNiSG9zdEJ1cyhKTklFbnYgKmVudiwgam9iamVjdCB0aGl6KQoreworICAgIHN0cnVjdCB1c2JfaG9zdF9jb250ZXh0KiBjb250ZXh0ID0gdXNiX2hvc3RfaW5pdCgpOworICAgIGlmICghY29udGV4dCkgeworICAgICAgICBMT0dFKCJ1c2JfaG9zdF9pbml0IGZhaWxlZC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xlTGF5ZXJzU29ydGVkQnlaKTsKLSAgICBjb25zdCBzaXplX3QgY291bnQgPSBsYXllcnMuc2l6ZSgpOwotICAgIGZvciAoc2l6ZV90IGk9MCA7IGk8Y291bnQgOyArK2kpIHsKKyAgICBzaXplX3QgY291bnQgPSBsYXllcnMuc2l6ZSgpOworCisgICAgY29uc3QgRGlzcGxheUhhcmR3YXJlJiBodyhncmFwaGljUGxhbmUoMCkuZGlzcGxheUhhcmR3YXJlKCkpOworICAgIEhXQ29tcG9zZXImIGh3Yyhody5nZXRId0NvbXBvc2VyKCkpOworICAgIGh3Y19sYXllcl90KiBjb25zdCBjdXIoaHdjLmdldExheWVycygpKTsKKworICAgIExPR0VfSUYoY3VyICYmIGh3Yy5nZXROdW1MYXllcnMoKSAhPSBjb3VudCwKKyAgICAgICAgICAgICJIQUwgbnVtYmVyIG9mIGxheWVycyAoJWQpIGRvZXNuJ3QgbWF0Y2ggc3VyZmFjZWZsaW5nZXIgKCVkKSIsCisgICAgICAgICAgICBod2MuZ2V0TnVtTGF5ZXJzKCksIGNvdW50KTsKKworICAgIC8vIGp1c3QgdG8gYmUgZXh0cmEtc2FmZSwgdXNlIHRoZSBzbWFsbGVzdCBjb3VudAorICAgIGlmIChod2MuaW5pdENoZWNrKCkgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgY291bnQgPSBjb3VudCA8IGh3Yy5nZXROdW1MYXllcnMoKSA/IGNvdW50IDogaHdjLmdldE51bUxheWVycygpOworICAgIH0KKworICAgIC8qCisgICAgICogIHVwZGF0ZSB0aGUgcGVyLWZyYW1lIGgvdyBjb21wb3NlciBkYXRhIGZvciBlYWNoIGxheWVyCisgICAgICogIGFuZCBidWlsZCB0aGUgdHJhbnNwYXJlbnQgcmVnaW9uIG9mIHRoZSBGQgorICAgICAqLworICAgIFJlZ2lvbiB0cmFuc3BhcmVudDsKKyAgICBpZiAoY3VyKSB7CisgICAgICAgIGZvciAoc2l6ZV90IGk9MCA7IGk8Y291bnQgOyBpKyspIHsKKyAgICAgICAgICAgIGNvbnN0IHNwPExheWVyQmFzZT4mIGxheWVyKGxheWVyc1tpXSk7CisgICAgICAgICAgICBsYXllci0+c2V0UGVyRnJhbWVEYXRhKCZjdXJbaV0pOworICAgICAgICAgICAgaWYgKGN1cltpXS5oaW50cyAmIEhXQ19ISU5UX0NMRUFSX0ZCKSB7CisgICAgICAgICAgICAgICAgaWYgKCEobGF5ZXItPm5lZWRzQmxlbmRpbmcoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNwYXJlbnQub3JTZWxmKGxheWVyLT52aXNpYmxlUmVnaW9uU2NyZWVuKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZXJyID0gaHdjLnByZXBhcmUoKTsKKyAgICAgICAgTE9HRV9JRihlcnIsICJIV0NvbXBvc2VyOjpwcmVwYXJlIGZhaWxlZCAoJXMpIiwgc3RyZXJyb3IoLWVycikpOworICAgIH0KKworICAgIC8qCisgICAgICogIGNsZWFyIHRoZSBhcmVhIG9mIHRoZSBGQiB0aGF0IG5lZWQgdG8gYmUgdHJhbnNwYXJlbnQKKyAgICAgKi8KKyAgICB0cmFuc3BhcmVudC5hbmRTZWxmKGRpcnR5KTsKKyAgICBpZiAoIXRyYW5zcGFyZW50LmlzRW1wdHkoKSkgeworICAgICAgICBnbENsZWFyQ29sb3IoMCwwLDAsMCk7CisgICAgICAgIFJlZ2lvbjo6Y29uc3RfaXRlcmF0b3IgaXQgPSB0cmFuc3BhcmVudC5iZWdpbigpOworICAgICAgICBSZWdpb246OmNvbnN0X2l0ZXJhdG9yIGNvbnN0IGVuZCA9IHRyYW5zcGFyZW50LmVuZCgpOworICAgICAgICBjb25zdCBpbnQzMl90IGhlaWdodCA9IGh3LmdldEhlaWdodCgpOworICAgICAgICB3aGlsZSAoaXQgIT0gZW5kKSB7CisgICAgICAgICAgICBjb25zdCBSZWN0JiByKCppdCsrKTsKKyAgICAgICAgICAgIGNvbnN0IEdMaW50IHN5ID0gaGVpZ2h0IC0gKHIudG9wICsgci5oZWlnaHQoKSk7CisgICAgICAgICAgICBnbFNjaXNzb3Ioci5sZWZ0LCBzeSwgci53aWR0aCgpLCByLmhlaWdodCgpKTsKKyAgICAgICAgICAgIGdsQ2xlYXIoR0xfQ09MT1JfQlVGRkVSX0JJVCk7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIC8qCisgICAgICogYW5kIHRoZW4sIHJlbmRlciB0aGUgbGF5ZXJzIHRhcmdldGVkIGF0IHRoZSBmcmFtZWJ1ZmZlcgorICAgICAqLworICAgIGZvciAoc2l6ZV90IGk9MCA7IGk8Y291bnQgOyBpKyspIHsKKyAgICAgICAgaWYgKGN1cikgeworICAgICAgICAgICAgaWYgKChjdXJbaV0uY29tcG9zaXRpb25UeXBlICE9IEhXQ19GUkFNRUJVRkZFUikgJiYKKyAgICAgICAgICAgICAgICAhKGN1cltpXS5mbGFncyAmIEhXQ19TS0lQX0xBWUVSKSkgeworICAgICAgICAgICAgICAgIC8vIHNraXAgbGF5ZXJzIGhhbmRsZWQgYnkgdGhlIEhBTAorICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKICAgICAgICAgY29uc3Qgc3A8TGF5ZXJCYXNlPiYgbGF5ZXIobGF5ZXJzW2ldKTsKICAgICAgICAgY29uc3QgUmVnaW9uIGNsaXAoZGlydHkuaW50ZXJzZWN0KGxheWVyLT52aXNpYmxlUmVnaW9uU2NyZWVuKSk7CiAgICAgICAgIGlmICghY2xpcC5pc0VtcHR5KCkpIHsKQEAgLTEwNTgsNyArMTE1MCw3IEBACiAgICAgaWYgKGFuZHJvaWRfYXRvbWljX2RlYygmbVRyYW5zYWN0aW9uQ291bnQpID09IDEpIHsKICAgICAgICAgc2lnbmFsRXZlbnQoKTsKIAotICAgICAgICAvLyBpZiB0aGVyZSBpcyBhIHRyYW5zYWN0aW9uIHdpdGggYSByZXNpemUsIHdh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F0IGl0J3MKKyAgICAgICAgICAgICAqIG5vdCBpbiB0aGUgbGlzdCBhbnl3YXksIGJlY2F1c2UgaXQgc2hvdWxkIGhhdmUgYmVlbiByZW1vdmVkCisgICAgICAgICAgICAgKiBhbHJlYWR5IHVwb24gcmVxdWVzdCBvZiB0aGUgY2xpZW50IChlZzogd2luZG93IG1hbmFnZXIpLgogICAgICAgICAgICAgICogSG93ZXZlciwgYSBidWdneSBjbGllbnQgY291bGQgaGF2ZSBub3QgZG9uZSB0aGF0LgogICAgICAgICAgICAgICogU2luY2Ugd2Uga25vdyB3ZSBkb24ndCBoYXZlIGFueSBtb3JlIGNsaWVudHMsIHdlIGRvbid0IG5lZWQKICAgICAgICAgICAgICAqIHRvIHVzZSB0aGUgcHVyZ2F0b3J5LgpAQCAtMTM5Niw3ICsxNDkxLDcgQEAKICAgICAgICAgfQogICAgICAgICBjb25zdCBib29sIGxvY2tlZChyZXRyeSA+PSAwKTsKICAgICAgICAgaWYgKCFsb2NrZWQpIHsKLSAgICAgICAgICAgIHNucHJpbnRmKGJ1ZmZlciwgU0laRSwgCisgICAgICAgICAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsCiAgICAgICAgICAgICAgICAgICAgICJTdXJmYWNlRmxpbmdlciBhcHBlYXJzIHRvIGJlIHVucmVzcG9uc2l2ZSwgIgogICAgICAgICAgICAgICAgICAgICAiZHVtcGluZyBhbnl3YXlzIChubyBsb2NrcyBoZWxkKVxuIik7CiAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7CkBAIC0xNDM4LDYgKzE1MzMsMTMgQEAKICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKICAgICAgICAgfQogCisgICAgICAgIEhXQ29tcG9zZXImIGh3Yyhody5nZXRId0NvbXBvc2VyKCkpOworICAgICAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsICIgIGgvdyBjb21wb3NlciAlcyBhbmQgJXNcbiIsCisgICAgICAgICAgICAgICAgaHdjLmluaXRDaGVjaygpPT1OT19FUlJPUiA/ICJwcmVzZW50IiA6ICJub3QgcHJlc2VudCIsCisgICAgICAgICAgICAgICAgbURlYnVnRGlzYWJsZUhXQyA/ICJkaXNhYmxlZCIgOiAiZW5hYmxlZCIpOworICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7CisgICAgICAgIGh3Yy5kdW1wKHJlc3VsdCwgYnVmZmVyLCBTSVpFKTsKKwogICAgICAgICBjb25zdCBHcmFwaGljQnVmZmVyQWxsb2NhdG9yJiBhbGxvYyhHcmFwaGljQnVmZmVyQWxsb2NhdG9yOjpnZXQoKSk7CiAgICAgICAgIGFsbG9jLmR1bXAocmVzdWx0KTsKIApAQCAtMTUxMyw2ICsxNjE1LDExIEBACiAgICAgICAgICAgICAgICAgbiA9IGRhdGEucmVhZEludDMyKCk7CiAgICAgICAgICAgICAgICAgbURlYnVnQmFja2dyb3VuZCA9IG4gPyAxIDogMDsKICAgICAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgICAgICBjYXNlIDEwMDg6ICAvLyB0b2dnbGUgdXNlIG9mIGh3IGNvbXBvc2VyCisgICAgICAgICAgICAgICAgbiA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICAgICAgbURlYnVnRGlzYWJsZUhXQyA9IG4gPyAxIDogMDsKKyAgICAgICAgICAgICAgICBtSHdXb3JrTGlzdERpcnR5ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAvLyBmYWxsLXRocm91Z2guLi4KICAgICAgICAgICAgIGNhc2UgMTAwNDp7IC8vIHJlcGFpbnQgZXZlcnl0aGluZwogICAgICAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBfbChtU3RhdGVMb2NrKTsKICAgICAgICAgICAgICAgICBjb25zdCBEaXNwbGF5SGFyZHdhcmUmIGh3KGdyYXBoaWNQbGFuZSgwKS5kaXNwbGF5SGFyZHdhcmUoKSk7CkBAIC0yMzA4LDEyICsy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mxpcChjb25zdCBMYXllclZlY3RvciYgY3VycmVudExheWVycyk7CisgICAgICAgICAgICB2b2lkICAgICAgICBoYW5kbGVXb3JrTGlzdCgpOwogICAgICAgICAgICAgdm9pZCAgICAgICAgaGFuZGxlUmVwYWludCgpOwogICAgICAgICAgICAgdm9pZCAgICAgICAgcG9zdEZyYW1lYnVmZmVyKCk7CiAgICAgICAgICAgICB2b2lkICAgICAgICBjb21wb3NlU3VyZmFjZXMoY29uc3QgUmVnaW9uJiBkaXJ0eSk7CkBAIC0zOTMsNiArMzk0LDcgQEAKICAgICAgICAgICAgICAgICBSZWdpb24gICAgICAgICAgICAgICAgICAgICAgbUludmFsaWRSZWdpb247CiAgICAgICAgICAgICAgICAgUmVnaW9uICAgICAgICAgICAgICAgICAgICAgIG1Xb3JtaG9sZVJlZ2lvbjsKICAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgbVZpc2libGVSZWdpb25zRGlydHk7CisgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgIG1Id1dvcmtMaXN0RGlydHk7CiAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgIG1EZWZlclJlbGVhc2VDb25zb2xlOwogICAgICAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICBtRnJlZXplRGlzcGxheTsKICAgICAgICAgICAgICAgICBpbnQzMl90ICAgICAgICAgICAgICAgICAgICAgbUVsZWN0cm9uQmVhbUFuaW1hdGlvbk1vZGU7CkBAIC00MDQsNiArNDA2LDcgQEAKICAgICAgICAgICAgICAgICAvLyBkb24ndCB1c2UgYSBsb2NrIGZvciB0aGVzZSwgd2UgZG9uJ3QgY2FyZQogICAgICAgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICBtRGVidWdSZWdpb247CiAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIG1EZWJ1Z0JhY2tncm91bmQ7C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ICAgICBsb25nIGJlZ2luVGltZSA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOworICAgICAgICBsb25nIHBvbGxUbWVvdXQgPSBUSU1FT1VUX0JJTkRFUl9DQUxMIC8gNTsKKworICAgICAgICAvLyBwb2xsIHVudGlsIHRoZSB0aW1lb3V0IGhhcyBlbGFwc2VkCisgICAgICAgIHdoaWxlIChTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSAtIGJlZ2luVGltZSA8IFRJTUVPVVRfQklOREVSX0NBTEwpIHsKKyAgICAgICAgICAgIC8vIHNsZWVwIGZpcnN0IHNpbmNlIGltbWVkaWF0ZSBjYWxsIHdpbGwgYWx3YXlzIGZhaWwKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgVGhyZWFkLnNsZWVwKHBvbGxUbWVvdXQpOworICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gaWUpIHsKKyAgICAgICAgICAgICAgICAvKiBpZ25vcmUgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIHBvbGwgZm9yIHZlcmlmaWNhdGlvbiBhbmQgaWYgdGhpcyBmYWlscyBzYXZlIHRoZSBleGNlcHRpb24gYW5kCisgICAgICAgICAgICAvLyBrZWVwIHBvbGxpbmcKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgc2VydmljZS52ZXJpZnkoKTsKKyAgICAgICAgICAgICAgICAvLyByZXNldCBzbyBpdCBkb2VzIG5vdCBhY2NlcHQgbW9yZSBldmVudHMKKyAgICAgICAgICAgICAgICBzZXJ2aWNlLnJlc2V0KCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBsYXN0VmVyaWZ5RXhjZXB0aW9uID0gZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIH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dHlTZXJ2aWNlKCkgeworICAgICAgICAgICAgc0luc3RhbmNlID0gdGhpczsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFRoaXMgY2xhc3MgaXMgdGhlIGZpcnN0IG1vY2sge0BsaW5rIEFjY2Vzc2liaWxpdHlTZXJ2aWNlfS4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIE15U2Vjb25kTW9ja0FjY2Vzc2liaWxpdHlTZXJ2aWNlIGV4dGVuZHMgTW9ja0FjY2Vzc2liaWxpdHlTZXJ2aWNlIHsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHNlcnZpY2Uge0BsaW5rIENvbXBvbmVudE5hbWV9IGZsYXR0ZW5lZCBhcyBhIHN0cmluZy4KKyAgICAgICAgICovCisgICAgICAgIHN0YXRpYyBmaW5hbCBTdHJpbmcgc0NvbXBvbmVudE5hbWUgPSBuZXcgQ29tcG9uZW50TmFtZSgKKyAgICAgICAgICAgICAgICBzUGFja2FnZU5hbWUsCisgICAgICAgICAgICAgICAgTXlTZWNvbmRNb2NrQWNjZXNzaWJpbGl0eVNlcnZpY2UuY2xhc3MuZ2V0TmFtZSgpCisgICAgICAgICAgICAgICAgKS5mbGF0dGVuVG9TaG9ydFN0cmluZygpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBIYW5kbGUgdG8gdGhlIHNlcnZpY2UgaW5zdGFuY2UuCisgICAgICAgICAqLworICAgICAgICBzdGF0aWMgTXlTZWNvbmRNb2NrQWNjZXNzaWJpbGl0eVNlcnZpY2Ugc0luc3RhbmNlOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBDcmVhdGVzIGEgbmV3IGluc3RhbmNlLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIE15U2Vjb25kTW9ja0FjY2Vzc2liaWxpdHlTZXJ2aWNlKCkgeworICAgICAgICAgICAgc0luc3RhbmNlID0gdGhpczsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZi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50cnkpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgbUNvdW50cnkgPSBjb3VudHJ5OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIENvdW50cnkgZ2V0Q291bnRyeSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtQ291bnRyeTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzTm90aWZpZWQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUNvdW50cnkgIT0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgQ291bnRyeURldGVjdG9yU2VydmljZVRlc3RlciBleHRlbmRzIENvdW50cnlEZXRlY3RvclNlcnZpY2UgeworCisgICAgICAgIHByaXZhdGUgQ291bnRyeUxpc3RlbmVyIG1MaXN0ZW5lcjsKKworICAgICAgICBwdWJsaWMgQ291bnRyeURldGVjdG9yU2VydmljZVRlc3RlcihDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG5vdGlmeVJlY2VpdmVycyhDb3VudHJ5IGNvdW50cnkpIHsKKyAgICAgICAgICAgIHN1cGVyLm5vdGlmeVJlY2VpdmVycyhjb3VudHJ5KTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBzZXRDb3VudHJ5TGlzdGVuZXIoZmluYWwgQ291bnRyeUxpc3RlbmVyIGxpc3RlbmVyKSB7CisgICAgICAgICAgICBtTGlzdGVuZXIgPSBsaXN0ZW5lcjsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzTGlzdGVuZXJTZXQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUxpc3RlbmVyICE9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBw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Qgd2l0aCBkZWZhdWx0CisgICAgICogdmFsdWVzLgorICAgICAqCisgICAgICogQHJldHVybiBUaGUgZGVmYXVsdCBpbmZvLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgQWNjZXNzaWJpbGl0eVNlcnZpY2VJbmZvIGNyZWF0ZURlZmF1bHRJbmZvKCkgeworICAgICAgICBBY2Nlc3NpYmlsaXR5U2VydmljZUluZm8gZGVmYXVsdEluZm8gPSBuZXcgQWNjZXNzaWJpbGl0eVNlcnZpY2VJbmZvKCk7CisgICAgICAgIGRlZmF1bHRJbmZvLmV2ZW50VHlwZXMgPSBBY2Nlc3NpYmlsaXR5RXZlbnQuVFlQRV9WSUVXX0NMSUNLRUQ7CisgICAgICAgIGRlZmF1bHRJbmZvLmZlZWRiYWNrVHlwZSA9IEFjY2Vzc2liaWxpdHlTZXJ2aWNlSW5mby5GRUVEQkFDS19BVURJQkxFOworICAgICAgICBkZWZhdWx0SW5mby5mbGFncyA9IDA7CisgICAgICAgIGRlZmF1bHRJbmZvLm5vdGlmaWNhdGlvblRpbWVvdXQgPSAwOworICAgICAgICBkZWZhdWx0SW5mby5wYWNrYWdlTmFtZXMgPSBuZXcgU3RyaW5nW10geworICAgICAgICAgICAgImZvby5iYXIuYmF6IgorICAgICAgICB9OworCisgICAgICAgIHJldHVybiBkZWZhdWx0SW5mbzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdGFydHMgcmVwbGF5aW5nIHRoZSBtb2NrLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHJlcGxheSgpIHsKKyAgICAgICAgbVJlcGxheWluZyA9IHRydWU7CisgICAgfQorCisgICAgLyoqCisgICAgICogVmVyaWZpZXMgaWYgYWxsIGV4cGVjdGVkIHNlcnZpY2UgbWV0aG9kcyBoYXZlIGJlZW4gY2FsbGVkLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHZlcmlmeSgpIHsKKyAgICAgICAgaWYgKCFtUmVwbGF5aW5nKSB7CisgIC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HBlZDsKKyAgICAgICAgcHJvdGVjdGVkIGJvb2xlYW4gbU5vdGlmaWVkOworICAgICAgICBwcml2YXRlIGJvb2xlYW4gbGlzdGVuZXJBZGRlZCA9IGZhbHNlOworCisgICAgICAgIHByaXZhdGUgQ291bnRyeSBtTm90aWZpZWRDb3VudHJ5OworICAgICAgICBwdWJsaWMgVGVzdENvdW50cnlEZXRlY3RvcigpIHsKKyAgICAgICAgICAgIHN1cGVyKGdldENvbnRleHQoKSk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBub3RpZnlMb2NhdGlvbkJhc2VkTGlzdGVuZXIoQ291bnRyeSBjb3VudHJ5KSB7CisgICAgICAgICAgICBtTm90aWZpZWQgPSB0cnVlOworICAgICAgICAgICAgbU5vdGlmaWVkQ291bnRyeSA9IGNvdW50cnk7CisgICAgICAgICAgICBtTG9jYXRpb25CYXNlZENvdW50cnlEZXRlY3Rvci5ub3RpZnlMaXN0ZW5lcihjb3VudHJ5KTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGxvY2F0aW9uQmFzZWREZXRlY3RvclN0YXJ0ZWQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUxvY2F0aW9uQmFzZWRDb3VudHJ5RGV0ZWN0b3IgIT0gbnVsbCAmJiBtTG9jYXRpb25CYXNlZERldGVjdG9yU3RhcnRlZDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGxvY2F0aW9uQmFzZWREZXRlY3RvclN0b3BwZWQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUxvY2F0aW9uQmFzZWRDb3VudHJ5RGV0ZWN0b3IgPT0gbnVsbCAmJiBtTG9jYXRpb25CYXNlZERldGVjdG9yU3RvcHBlZDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGxvY2F0aW9uUmVmcmVzaFN0YXJ0ZWQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUxvY2F0aW9uUmVmcmVzaFRpbWVyICE9IG51bGw7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBsb2NhdGlvblJlZnJlc2hDYW5jZWxsZWQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUxvY2F0aW9uUmVmcmVzaFRpbWVyID09IG51bGw7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIENvdW50cnlEZXRlY3RvckJhc2UgY3JlYXRlTG9jYXRpb25CYXNlZENvdW50cnlEZXRlY3RvcigpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgQ291bnRyeURldGVjdG9yQmFzZShtQ29udGV4dCkgeworICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgIHB1YmxpYyBDb3VudHJ5IGRldGVjdENvdW50cnkoKSB7CisgICAgICAgICAgICAgICAgICAgIG1Mb2NhdGlvbkJhc2VkRGV0ZWN0b3JTdGFydGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgc3RvcCgpIHsKKyAgICAgICAgICAgICAgICAgICAgbUxvY2F0aW9uQmFzZWREZXRlY3RvclN0b3BwZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIENvdW50cnkgZ2V0TmV0d29ya0Jhc2VkQ291bnRyeSgpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCBDb3VudHJ5IGdldExhc3RLbm93bkxvY2F0aW9uQmFzZWRDb3VudHJ5KCkgeworICAgICAgICAgICAgcmV0dXJuIG1Ob3RpZmllZENvdW50cnk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIENvdW50cnkgZ2V0U2ltQmFzZWRDb3VudHJ5KCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIENvdW50cnkgZ2V0TG9jYWxlQ291bnRyeSgpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIHJ1bkFmdGVyRGV0ZWN0aW9uQXN5bmMoZmluYWwgQ291bnRyeSBjb3VudHJ5LCBmaW5hbCBDb3VudHJ5IGRldGVjdGVkQ291bnRyeSwKKyAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIG5vdGlmeUNoYW5nZSwgZmluYWwgYm9vbGVhbiBzdGFydExvY2F0aW9uQmFzZWREZXRlY3Rpb24pIHsKKyAgICAgICAgICAgIHJ1bkFmdGVyRGV0ZWN0aW9uKGNvdW50cnksIGRldGVjdGVkQ291bnRyeSwgbm90aWZ5Q2hhbmdlLCBzdGFydExvY2F0aW9uQmFzZWREZXRlY3Rpb24pOworICAgICAgICB9OworCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgYm9vbGVhbiBpc0FpcnBsYW5lTW9kZU9mZigpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCBzeW5jaHJvbml6ZWQgdm9pZCBhZGRQaG9uZVN0YXRlTGlzdGVuZXIoKSB7CisgICAgICAgICAgICBsaXN0ZW5lckFkZGVkID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgc3luY2hyb25pemVkIHZvaWQgcmVtb3ZlUGhvbmVTdGF0ZUxpc3RlbmVyKCkgeworICAgICAgICAgICAgbGlzdGVuZXJBZGRlZCA9IGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCBib29sZWFuIGlzR2VvQ29kZXJJbXBsZW1lbnRlZCgpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNQaG9uZVN0YXRlTGlzdGVuZXJBZGRlZCgpIHsKKyAgICAgICAgICAgIHJldHVybiBsaXN0ZW5lckFkZGVkOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBDb3VudHJ5TGlzdGVuZXJJbXBsIGltcGxlbWVudHMgQ291bnRyeUxpc3RlbmVyIHsKKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1Ob3RpZmllZDsKKyAgICAgICAgcHJpdmF0ZSBDb3VudHJ5IG1Db3VudHJ5OworCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ291bnRyeURldGVjdGVkKENvdW50cnkgY291bnRyeSkgeworICAgICAgICAgICAgbU5vdGlmaWVkID0gdHJ1ZTsKKyAgICAgICAgICAgIG1Db3VudHJ5ID0gY291bnRyeTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIG5vdGlmaWVkKCkgeworICAgICAgICAgICAgcmV0dXJuIG1Ob3RpZmllZDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBDb3VudHJ5IGdldENvdW50cnkoKSB7CisgICAgICAgICAgICByZXR1cm4gbUNvdW50cnk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0RGV0ZWN0TmV0d29ya0Jhc2VkQ291bnRyeSgpIHsKKyAgICAgICAgZmluYWwgQ291bnRyeSByZXN1bHRDb3VudHJ5ID0gbmV3IENvdW50cnkoCisgICA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zdWx0Q291bnRyeSA9IG5ldyBDb3VudHJ5KAorICAgICAgICAgICAgICAgIFRlc3RDb3VudHJ5RGV0ZWN0b3IuQ09VTlRSWV9JU08sIENvdW50cnkuQ09VTlRSWV9TT1VSQ0VfU0lNKTsKKyAgICAgICAgZmluYWwgQ291bnRyeSBsb2NhdGlvbkJhc2VkQ291bnRyeSA9IG5ldyBDb3VudHJ5KAorICAgICAgICAgICAgICAgIFRlc3RDb3VudHJ5RGV0ZWN0b3IuQ09VTlRSWV9JU08sIENvdW50cnkuQ09VTlRSWV9TT1VSQ0VfTE9DQVRJT04pOworICAgICAgICBUZXN0Q291bnRyeURldGVjdG9yIGNvdW50cnlEZXRlY3RvciA9IG5ldyBUZXN0Q291bnRyeURldGVjdG9yKCkgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwcm90ZWN0ZWQgQ291bnRyeSBnZXRTaW1CYXNlZENvdW50cnkoKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdENvdW50cnk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIENvdW50cnlMaXN0ZW5lckltcGwgbGlzdGVuZXIgPSBuZXcgQ291bnRyeUxpc3RlbmVySW1wbCgpOworICAgICAgICBjb3VudHJ5RGV0ZWN0b3Iuc2V0Q291bnRyeUxpc3RlbmVyKGxpc3RlbmVyKTsKKyAgICAgICAgQ291bnRyeSBjb3VudHJ5ID0gY291bnRyeURldGVjdG9yLmRldGVjdENvdW50cnkoKTsKKyAgICAgICAgYXNzZXJ0VHJ1ZShzYW1lQ291bnRyeShjb3VudHJ5LCByZXN1bHRDb3VudHJ5KSk7CisgICAgICAgIGFzc2VydFRydWUoY291bnRyeURldGVjdG9yLmxvY2F0aW9uQmFzZWREZXRlY3RvclN0YXJ0ZWQoKSk7CisgICAgICAgIGNvdW50cnlEZXRlY3Rvci5ub3RpZnlMb2NhdGlvbkJhc2VkTGlzdGVuZXIobG9jYXRpb25CYXNlZENvdW50c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uIG5vdGlmeUNvdW50cnkgPSBmYWxzZTsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBMb2NhdGlvbiBtTG9jYXRpb247CisgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nIG1Db3VudHJ5OworICAgICAgICBwcml2YXRlIGZpbmFsIGxvbmcgbVF1ZXJ5TG9jYXRpb25UaW1lb3V0OworICAgICAgICBwcml2YXRlIExpc3Q8TG9jYXRpb25MaXN0ZW5lcj4gbUxpc3RlbmVyczsKKworICAgICAgICBwdWJsaWMgVGVzdENvdW50cnlEZXRlY3RvcihTdHJpbmcgY291bnRyeSwgU3RyaW5nIHByb3ZpZGVyKSB7CisgICAgICAgICAgICB0aGlzKGNvdW50cnksIHByb3ZpZGVyLCAxMDAwICogNjAgKiA1KTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBUZXN0Q291bnRyeURldGVjdG9yKFN0cmluZyBjb3VudHJ5LCBTdHJpbmcgcHJvdmlkZXIsIGxvbmcgcXVlcnlMb2NhdGlvblRpbWVvdXQpIHsKKyAgICAgICAgICAgIHN1cGVyKGdldENvbnRleHQoKSk7CisgICAgICAgICAgICBtQ291bnRyeSA9IGNvdW50cnk7CisgICAgICAgICAgICBtTG9jYXRpb24gPSBuZXcgTG9jYXRpb24ocHJvdmlkZXIpOworICAgICAgICAgICAgbVF1ZXJ5TG9jYXRpb25UaW1lb3V0ID0gcXVlcnlMb2NhdGlvblRpbWVvdXQ7CisgICAgICAgICAgICBtTGlzdGVuZXJzID0gbmV3IEFycmF5TGlzdDxMb2NhdGlvbkxpc3RlbmVyPigpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCBTdHJpbmcgZ2V0Q291bnRyeUZyb21Mb2NhdGlvbihMb2NhdGlvbiBsb2NhdGlvbikgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChjb3VudHJ5Rm91bmRMb2NrZXIpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW5vdGlmeUNvdW50cnkpIHsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50cnlGb3VuZExvY2tlci53YWl0KCk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtTG9jYXRpb24uZ2V0UHJvdmlkZXIoKS5lbmRzV2l0aChsb2NhdGlvbi5nZXRQcm92aWRlcigpKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBtQ291bnRyeTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIExvY2F0aW9uIGdldExhc3RLbm93bkxvY2F0aW9uKCkgeworICAgICAgICAgICAgcmV0dXJuIG1Mb2NhdGlvbjsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCByZWdpc3RlckVuYWJsZWRQcm92aWRlcnMoTGlzdDxMb2NhdGlvbkxpc3RlbmVyPiBsaXN0ZW5lcnMpIHsKKyAgICAgICAgICAgIG1MaXN0ZW5lcnMuYWRkQWxsKGxpc3RlbmVycyk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgdW5yZWdpc3RlclByb3ZpZGVycyhMaXN0PExvY2F0aW9uTGlzdGVuZXI+IGxpc3RlbmVycykgeworICAgICAgICAgICAgZm9yIChMb2NhdGlvbkxpc3RlbmVyIGxpc3RlbmVyIDogbUxvY2F0aW9uTGlzdGVuZXJzKSB7CisgICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZShtTGlzdGVuZXJzLnJlbW92ZShsaXN0ZW5lcikpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCBsb25nIGdldFF1ZXJ5TG9jYXRpb25UaW1lb3V0KCkgeworICAgICAgICAgICAgcmV0dXJuIG1RdWVyeUxvY2F0aW9uVGltZW91dDsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgaW50IGdldFRvdGFsRW5hYmxlZFByb3ZpZGVycygpIHsKKyAgICAgICAgICAgIHJldHVybiBUT1RBTF9QUk9WSURFUlM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBub3RpZnlMb2NhdGlvbkZvdW5kKCkgeworICAgICAgICAgICAgLy8gTGlzdGVuZXIgY291bGQgYmUgcmVtb3ZlZCBpbiB0aGUgbm90aWZpY2F0aW9uLgorICAgICAgICAgICAgTG9jYXRpb25MaXN0ZW5lcltdIGxpc3RlbmVycyA9IG5ldyBMb2NhdGlvbkxpc3RlbmVyW21MaXN0ZW5lcnMuc2l6ZSgpXTsKKyAgICAgICAgICAgIG1Mb2NhdGlvbkxpc3RlbmVycy50b0FycmF5KGxpc3RlbmVycyk7CisgICAgICAgICAgICBmb3IgKExvY2F0aW9uTGlzdGVuZXIgbGlzdGVuZXIgOmxpc3RlbmVycykgeworICAgICAgICAgICAgICAgIGxpc3RlbmVyLm9uTG9jYXRpb25DaGFuZ2VkKG1Mb2NhdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgaW50IGdldExpc3RlbmVyc0NvdW50KCkgeworICAgICAgICAgICAgcmV0dXJuIG1MaXN0ZW5lcnMuc2l6ZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgbm90aWZ5Q291bnRyeUZvdW5kKCkgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChjb3VudHJ5Rm91bmRMb2NrZXIpIHsKKyAgICAgICAgICAgICAgICBub3RpZnlDb3VudHJ5ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBjb3VudHJ5Rm91bmRMb2NrZXIubm90aWZ5KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgVGltZXIgZ2V0VGltZXIoKSB7CisgICAgICAgICAgICByZXR1cm4gbVRpbWVyOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFRocmVhZCBnZXRRdWVyeVRocmVhZCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtUXVlcnlUaHJlYWQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIENvdW50cnlMaXN0ZW5lckltcGwgaW1wbGVtZW50cyBDb3VudHJ5TGlzdGVuZXIgeworICAgICAgICBwcml2YXRlIGJvb2xlYW4gbU5vdGlmaWVkOworICAgICAgICBwcml2YXRlIFN0cmluZyBtQ291bnRyeUNvZGU7CisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ291bnRyeURldGVjdGVkKENvdW50cnkgY291bnRyeSkgeworICAgICAgICAgICAgbU5vdGlmaWVkID0gdHJ1ZTsKKyAgICAgICAgICAgIGlmIChjb3VudHJ5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQ291bnRyeUNvZGUgPSBjb3VudHJ5LmdldENvdW50cnlJc28oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIG5vdGlmaWVkKCkgeworICAgICAgICAgICAgcmV0dXJuIG1Ob3RpZmllZDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0Q291bnRyeSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtQ291bnRyeUNvZGU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0RmluZGluZ0NvdW50cnkoKSB7Cis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BmaW5hbCBTdHJpbmcgcHJvdmlkZXIgPSAiR29vZCI7CisgICAgICAgIFRlc3RDb3VudHJ5RGV0ZWN0b3IgZGV0ZWN0b3IgPSBuZXcgVGVzdENvdW50cnlEZXRlY3Rvcihjb3VudHJ5LCBwcm92aWRlcikgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwcm90ZWN0ZWQgU3RyaW5nIGdldENvdW50cnlGcm9tTG9jYXRpb24oTG9jYXRpb24gbG9jYXRpb24pIHsKKyAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKGNvdW50cnlGb3VuZExvY2tlcikgeworICAgICAgICAgICAgICAgICAgICBpZiAoISBub3RpZnlDb3VudHJ5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50cnlGb3VuZExvY2tlci53YWl0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gV2UgZGlkbid0IGZpbmQgY291bnRyeS4KKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgICAgQ291bnRyeUxpc3RlbmVySW1wbCBjb3VudHJ5TGlzdGVuZXIgPSBuZXcgQ291bnRyeUxpc3RlbmVySW1wbCgpOworICAgICAgICBkZXRlY3Rvci5zZXRDb3VudHJ5TGlzdGVuZXIoY291bnRyeUxpc3RlbmVyKTsKKyAgICAgICAgZGV0ZWN0b3IuZGV0ZWN0Q291bnRyeSgpOworICAgICAgICBhc3NlcnRFcXVhbHMoZGV0ZWN0b3IuZ2V0TGlzdGVuZXJzQ291bnQoKSwgVGVzdENvdW50cnlEZXRlY3Rvci5UT1RB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N0ZW5lci5ub3RpZmllZCgpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKGNvdW50cnlMaXN0ZW5lci5nZXRDb3VudHJ5KCksIGNvdW50cnkpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB3YWl0Rm9yVGltZXJSZXNldChUZXN0Q291bnRyeURldGVjdG9yIGRldGVjdG9yKSB7CisgICAgICAgIGludCBjb3VudCA9IDU7CisgICAgICAgIGxvbmcgaW50ZXJ2YWwgPSAxMDAwOworICAgICAgICB0cnkgeworICAgICAgICAgICAgd2hpbGUgKGNvdW50LS0gPiAwICYmIGRldGVjdG9yLmdldFRpbWVyKCkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIFRocmVhZC5zbGVlcChpbnRlcnZhbCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgfQorICAgICAgICBUaW1lciB0aW1lciA9IGRldGVjdG9yLmdldFRpbWVyKCk7CisgICAgICAgIGFzc2VydFRydWUodGltZXIgPT0gbnVsbCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHdhaXRGb3JUaHJlYWRFbmRpbmcoVGhyZWFkIHRocmVhZCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgdGhyZWFkLmpvaW4oNTAwMCk7CisgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIGUucHJpbnRTdGFja1RyYWNlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIFRocmVhZCB3YWl0Rm9yUXVlcnlUaHJlYWRMYXVuY2hlZChUZXN0Q291bnRyeURldGVjdG9yIGRldGVjdG9yKSB7CisgICAgICAgIGludCBjb3VudCA9IDU7CisgICAgICAgIGxvbmcgaW50ZXJ2YWwgPSAxMDAwOworICAgICAgICB0cnkgeworICAgICAgICAgICAgd2hpbGUgKGNvdW50L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W50IHNlbEVuZCA9IFNlbGVjdGlvbi5nZXRTZWxlY3Rpb25FbmQocyk7Ci0gICAgICAgICAgICBpZiAocy5sZW5ndGgoKSA+IDEgLy8gQ2FuIGRlbGV0ZSBhbm90aGVyIGNoYXJhY3RlcgotICAgICAgICAgICAgICAgICAgICAmJiBjb3VudCA9PSAxIC8vIERlbGV0aW5nIG9ubHkgb25lIGNoYXJhY3RlcgotICAgICAgICAgICAgICAgICAgICAmJiBhZnRlciA9PSAwIC8vIERlbGV0aW5nCi0gICAgICAgICAgICAgICAgICAgICYmIHMuY2hhckF0KHN0YXJ0KSA9PSAnLScgLy8gYSBoeXBoZW4KLSAgICAgICAgICAgICAgICAgICAgJiYgc2VsU3RhcnQgPT0gc2VsRW5kKSB7IC8vIG5vIHNlbGVjdGlvbgotICAgICAgICAgICAgICAgIG1EZWxldGluZ0h5cGhlbiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgbUh5cGhlblN0YXJ0ID0gc3RhcnQ7Ci0gICAgICAgICAgICAgICAgLy8gQ2hlY2sgaWYgdGhlIHVzZXIgaXMgZGVsZXRpbmcgZm9yd2FyZCBvciBiYWNrd2FyZAotICAgICAgICAgICAgICAgIGlmIChzZWxTdGFydCA9PSBzdGFydCArIDEpIHsKLSAgICAgICAgICAgICAgICAgICAgbURlbGV0aW5nQmFja3dhcmQgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1EZWxldGluZ0JhY2t3YXJkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtRGVsZXRpbmdIeXBoZW4gPSBmYWxzZTsKLSAgICAgICAgICAgIH0KKyAgICBwdWJsaWMgdm9pZCBiZWZvcmVUZXh0Q2hhbmdlZChDaGFyU2VxdWVuY2UgcywgaW50IHN0YXJ0LCBpbnQgY291bnQsCisgICAgICAgICAgICBpbnQgYWZ0ZXIpIHsKKyAgICAgICAgaWYgKG1TZWxmQ2hhbmdlIHx8IG1TdG9wRm9ybWF0dGluZykgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChjb3VudCA9PSAwICYmIHMubGVuZ3RoKCkgPT0gc3RhcnQpIHsKKyAgICAgICAgICAgIC8vIEFwcGVuZCBvbmUgb3IgbW9yZSBuZXcgY2hhcnMKKyAgICAgICAgICAgIG1TdGF0ZSA9IFNUQVRFX0FQUEVORDsKKyAgICAgICAgfSBlbHNlIGlmIChhZnRlciA9PSAwICYmIHN0YXJ0ICsgY291bnQgPT0gcy5sZW5ndGgoKSAmJiBjb3VudCA+IDApIHsKKyAgICAgICAgICAgIC8vIFJlbW92ZSBvbmUgb3IgbW9yZSBjaGFycyBmcm9tIHRoZSBlbmQgb2Ygc3RyaW5nLgorICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfUkVNT1ZFX0xBU1Q7CisgICAgICAgIH0gZWxzZSBpZiAoY291bnQgPiAwICYmICFoYXNTZXBhcmF0b3Iocywgc3RhcnQsIGNvdW50KSkgeworICAgICAgICAgICAgLy8gUmVtb3ZlIHRoZSBkaWFsYWJsZSBjaGFycyBpbiB0aGUgYmVnaW4gb3IgbWlkZGxlIG9mIHRleHQuCisgICAgICAgICAgICBtU3RhdGUgPSBTVEFURV9NT0RJRllfRElHSVRTOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfT1RIRVI7CiAgICAgICAgIH0KICAgICB9CiAKICAgICBwdWJsaWMgdm9pZCBvblRleHRDaGFuZ2VkKENoYXJTZXF1ZW5jZSBzLCBpbnQgc3RhcnQsIGludCBiZWZvcmUsIGludCBjb3VudCkgewotICAgICAgICAvLyBEb2VzIG5vdGhpbmcKKyAgICAgICAgaWYgKG1TZWxmQ2hhbmdlIHx8IG1TdG9wRm9ybWF0dGluZykgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIG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nlJc28pOworICAgICAgICAgICAgaWYgKHV0aWwuaXNWYWxpZE51bWJlcihwbikpIHsKKyAgICAgICAgICAgICAgICByZXN1bHQgPSB1dGlsLmZvcm1hdChwbiwgUGhvbmVOdW1iZXJGb3JtYXQuRTE2NCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKE51bWJlclBhcnNlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIEZvcm1hdCBhIHBob25lIG51bWJlci4KKyAgICAgKiA8cD4KKyAgICAgKiBJZiB0aGUgZ2l2ZW4gbnVtYmVyIGRvZXNuJ3QgaGF2ZSB0aGUgY291bnRyeSBjb2RlLCB0aGUgcGhvbmUgd2lsbCBiZQorICAgICAqIGZvcm1hdHRlZCB0byB0aGUgZGVmYXVsdCBjb3VudHJ5J3MgY29udmVudGlvbi4KKyAgICAgKgorICAgICAqIEBwYXJhbSBwaG9uZU51bWJlcgorICAgICAqICAgICAgICAgICAgdGhlIG51bWJlciB0byBiZSBmb3JtYXR0ZWQuCisgICAgICogQHBhcmFtIGRlZmF1bHRDb3VudHJ5SXNvCisgICAgICogICAgICAgICAgICB0aGUgSVNPIDMxNjYtMSB0d28gbGV0dGVycyBjb3VudHJ5IGNvZGUgd2hvc2UgY29udmVudGlvbiB3aWxsCisgICAgICogICAgICAgICAgICBiZSB1c2VkIGlmIHRoZSBnaXZlbiBudW1iZXIgZG9lc24ndCBoYXZlIHRoZSBjb3VudHJ5IGNvZGUuCisgICAgICogQHJldHVybiB0aGUgZm9ybWF0dGVkIG51bWJlciwgb3IgbnVsbCBpZiB0aGUgZ2l2ZW4gbnVtYmVyIGlzIG5vdCB2YWxpZC4KKyAgICAgKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZm9ybWF0TnVtYmVyKFN0cmluZyBwaG9uZU51bWJlciwgU3RyaW5nIGRlZmF1bHRDb3VudHJ5SXNvKSB7CisgICAgICAgIFBob25lTnVtYmVyVXRpbCB1dGlsID0gUGhvbmVOdW1iZXJVdGlsLmdldEluc3RhbmNlKCk7CisgICAgICAgIFN0cmluZyByZXN1bHQgPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgUGhvbmVOdW1iZXIgcG4gPSB1dGlsLnBhcnNlQW5kS2VlcFJhd0lucHV0KHBob25lTnVtYmVyLCBkZWZhdWx0Q291bnRyeUlzbyk7CisgICAgICAgICAgICByZXN1bHQgPSB1dGlsLmZvcm1hdEluT3JpZ2luYWxGb3JtYXQocG4sIGRlZmF1bHRDb3VudHJ5SXNvKTsKKyAgICAgICAgfSBjYXRjaCAoTnVtYmVyUGFyc2VFeGNlcHRpb24gZSkgeworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogRm9ybWF0IHRoZSBwaG9uZSBudW1iZXIgb25seSBpZiB0aGUgZ2l2ZW4gbnVtYmVyIGhhc24ndCBiZWVuIGZvcm1hdHRlZC4KKyAgICAgKiA8cD4KKyAgICAgKiBUaGUgbnVtYmVyIHdoaWNoIGhhcyBvbmx5IGRhaWxhYmxlIGNoYXJhY3RlciBpcyB0cmVhdGVkIGFzIG5vdCBiZWluZworICAgICAqIGZvcm1hdHRlZC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBwaG9uZU51bWJlcgorICAgICAqICAgICAgICAgICAgdGhlIG51bWJlciB0byBiZSBmb3JtYXR0ZWQuCisgICAgICogQHBhcmFtIHBob25lTnVtYmVyRTE2NAorICAgICAqICAgICAgICAgICAgdGhlIEUxNjQgZm9ybWF0IG51bWJlciB3aG9zZSBjb3VudHJ5IGNvZGUgaXMgdXNlZCBpZiB0aGUgZ2l2ZW4KKyAgICAgKiAgICAgICAgICAgIHBob25lTnVtYmVyIGRvZXNuJ3QgaGF2ZSB0aGUgY291bnRyeSBjb2RlLgorICAgICAqIEBwYXJhbSBkZWZhdWx0Q291bnRyeUlzbworICAgICAqICAgICAgICAgICAgdGhlIElTTyAzMTY2LTEgdHdvIGxldHRlcnMgY291bnRyeSBjb2RlIHdob3NlIGNvbnZlbnRpb24gd2lsbAorICAgICAqICAgICAgICAgICAgYmUgdXNlZCBpZiB0aGUgcGhvbmVOdW1iZXJFMTY0IGlzIG51bGwgb3IgaW52YWxpZC4KKyAgICAgKiBAcmV0dXJuIHRoZSBmb3JtYXR0ZWQgbnVtYmVyIGlmIHRoZSBnaXZlbiBudW1iZXIgaGFzIGJlZW4gZm9ybWF0dGVkLAorICAgICAqICAgICAgICAgICAgb3RoZXJ3aXNlLCByZXR1cm4gdGhlIGdpdmVuIG51bWJlci4KKyAgICAgKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZm9ybWF0TnVtYmVyKAorICAgICAgICAgICAgU3RyaW5nIHBob25lTnVtYmVyLCBTdHJpbmcgcGhvbmVOdW1iZXJFMTY0LCBTdHJpbmcgZGVmYXVsdENvdW50cnlJc28pIHsKKyAgICAgICAgaW50IGxlbiA9IHBob25lTnVtYmVyLmxlbmd0aCgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7CisgICAgICAgICAgICBpZiAoIWlzRGlhbGFibGUocGhvbmVOdW1iZXIuY2hhckF0KGkpKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBwaG9uZU51bWJlcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBQaG9uZU51bWJlclV0aWwgdXRpbCA9IFBob25lTnVtYmVyVXRpbC5nZXRJbnN0YW5jZSgpOworICAgICAgICAvLyBHZXQgdGhlIGNvdW50cnkgY29kZSBmcm9tIHBob25lTnVtYmVyRTE2NAorICAgICAgICBpZiAocGhvbmVOdW1iZXJFMTY0ICE9IG51bGwgJiYgcGhvbmVOdW1iZXJFMTY0Lmxlbmd0aCgpID49IDIKKyAgICAgICAgICAgICAgICAmJiBwaG9uZU51bWJlckUxNjQuY2hhckF0KDApID09ICcrJykgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlciBwbiA9IHV0aWwucGFyc2UocGhvbmVOdW1iZXJFMTY0LCBkZWZhdWx0Q291bnRyeUlzbyk7CisgICAgICAgICAgICAgICAgU3RyaW5nIHJlZ2lvbkNvZGUgPSB1dGlsLmdldFJlZ2lvbkNvZGVGb3JOdW1iZXIocG4pOworICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocmVnaW9uQ29kZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdENvdW50cnlJc28gPSByZWdpb25Db2RlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKE51bWJlclBhcnNlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBTdHJpbmcgcmVzdWx0ID0gZm9ybWF0TnVtYmVyKHBob25lTnVtYmVyLCBkZWZhdWx0Q291bnRyeUlzbyk7CisgICAgICAgIHJldHVybiByZXN1bHQgIT0gbnVsbCA/IHJlc3VsdCA6IHBob25lTnVtYmVyOworICAgIH0KKworICAgIC8qKgorICAgICAqIE5vcm1hbGl6ZSBhIHBob25lIG51bWJlciBieSByZW1vdmluZyB0aGUgY2hhcmFjdGVycyBvdGhlciB0aGFuIGRpZ2l0cy4gSWYKKyAgICAgKiB0aGUgZ2l2ZW4gbnVtYmVyIGhhcyBrZXlwYWQgbGV0dGVycywgdGhlIGxldHRlcnMgd2lsbCBiZSBjb252ZXJ0ZWQgdG8KKyAgICAgKiBkaWdpdHMgZmlyc3QuCisgICAgICoKKyAgICAgKiBAcGFyYW0gcGhvbmVOdW1iZXIKKyAgICAgKiAgICAgICAgICAgIHRoZSBudW1iZXIgdG8gYmUgbm9ybWFsaXplZC4KKyAgICAgKiBAcmV0dXJuIHRoZSBub3JtYWxpemVkIG51bWJlci4KKyAgICAgKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgbm9ybWFsaXplTnVtYmVyKFN0cmluZyBwaG9uZU51bWJlcikgeworICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgaW50IGxlbiA9IHBob25lTnVtYmVyLmxlbmd0aCgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7CisgICAgICAgICAgICBjaGFyIGMgPSBwaG9uZU51bWJlci5jaGFyQXQoaSk7CisgICAgICAgICAgICBpZiAoKGkgPT0gMCAmJiBjID09ICcrJykgfHwgUGhvbmVOdW1iZXJVdGlscy5pc0lTT0RpZ2l0KGMpKSB7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGMpOworICAgICAgICAgICAgfSBlbHNlIGlmICgoYyA+PSAnYScgJiYgYyA8PSAneicpIHx8IChjID49ICdBJyAmJiBjIDw9ICdaJykpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbm9ybWFsaXplTnVtYmVyKFBob25lTnVtYmVyVXRpbHMuY29udmVydEtleXBhZExldHRlcnNUb0RpZ2l0cyhwaG9uZU51bWJlcikpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOworICAgIH0KKwogICAgIC8vIFRocmVlIGFuZCBmb3VyIGRpZ2l0IHBob25lIG51bWJlcnMgZm9yIGVpdGhlciBzcGVjaWFsIHNlcnZpY2VzLAogICAgIC8vIG9yIDMtNiBkaWdpdCBhZGRyZXNzZXMgZnJvbSB0aGUgbmV0d29yayAoZWcgY2Fycmllci1vcmlnaW5hdGVkIFNNUyBtZXNzYWdlcykgc2hvdWxkCiAgICAgLy8gbm90IG1hdGNoLgpAQCAtMTU0Niw3ICsxNjc3LDcgQEAKICAgICAgKiBAaGlkZQogICAgICAqLwogICAg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gICAgICAgfQorCiAgICAgICAgIHB1YmxpYyB2b2lkIG9uU2lnbmFsU3RyZW5ndGhzQ2hhbmdlZChTaWduYWxTdHJlbmd0aCBzaWduYWxTdHJlbmd0aCkgewogICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obUhhbmRsZXIsIExJU1RFTl9TSUdOQUxfU1RSRU5HVEhTLCAwLCAwLCBzaWduYWxTdHJlbmd0aCkuc2VuZFRvVGFyZ2V0KCk7CiAgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvbk90YXNwQ2hhbmdlZChpbnQgb3Rhc3BNb2RlKSB7CisgICAgICAgICAgICBNZXNzYWdlLm9idGFpbihtSGFuZGxlciwgTElTVEVOX09UQVNQX0NIQU5HRUQsIG90YXNwTW9kZSwgMCkuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgIH0KICAgICB9OwogCiAgICAgSGFuZGxlciBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgewpAQCAtMzI4LDYgKzM1Nyw5IEBACiAgICAgICAgICAgICAgICAgY2FzZSBMSVNURU5fU0lHTkFMX1NUUkVOR1RIUzoKICAgICAgICAgICAgICAgICAgICAgUGhvbmVTdGF0ZUxpc3RlbmVyLnRoaXMub25TaWduYWxTdHJlbmd0aHNDaGFuZ2VkKChTaWduYWxTdHJlbmd0aCltc2cub2JqKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBMSVNURU5fT1RBU1BfQ0hBTkdFRDoKKyAgICAgICAgICAgICAgICAgICAgUGhvbmVTdGF0ZUxpc3RlbmVyLnRoaXMub25PdGFzcENoYW5nZWQobXNnLmFyZzEpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH07CmRpZmYgLS1naXQgYS90ZWxlcGhvbnkvamF2YS9hbmRyb2lkL3RlbGVwaG9ueS9TbXNNYW5hZ2VyLmphdmEgYi90ZWxlcGhv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Y2F0aW9uLkNvdW50cnlEZXRlY3RvcjsKIGltcG9ydCBhbmRyb2lkLm5ldC5Vcmk7CiBpbXBvcnQgYW5kcm9pZC5vcy5IYW5kbGVyOwogaW1wb3J0IGFuZHJvaWQub3MuTG9vcGVyOwpAQCAtMjQwLDcgKzI0MSwxMSBAQAogCiAgICAgICAgICAgICAgICAgICAgIC8vIFVzZSB0aGUgbnVtYmVyIGVudGVyZWQgYnkgdGhlIHVzZXIgZm9yIGRpc3BsYXkuCiAgICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoY3cubnVtYmVyKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUNhbGxlckluZm8ucGhvbmVOdW1iZXIgPSBQaG9uZU51bWJlclV0aWxzLmZvcm1hdE51bWJlcihjdy5udW1iZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgQ291bnRyeURldGVjdG9yIGRldGVjdG9yID0gKENvdW50cnlEZXRlY3RvcikgbVF1ZXJ5Q29udGV4dC5nZXRTeXN0ZW1TZXJ2aWNlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb250ZXh0LkNPVU5UUllfREVURUNUT1IpOworICAgICAgICAgICAgICAgICAgICAgICAgbUNhbGxlckluZm8ucGhvbmVOdW1iZXIgPSBQaG9uZU51bWJlclV0aWxzLmZvcm1hdE51bWJlcihjdy5udW1iZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DYWxsZXJJbmZvLm5vbWFsaXplZE51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV0ZWN0b3IuZGV0ZWN0Q291bnRyeSgpLmdldENvdW50cnlJc28oKSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAKZGlmZiAtLWdpdCBhL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9Db21tYW5kc0ludGVyZmFjZS5q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VydGllcyBsaW5rUHJvcGVydGllcyA9IG5ldyBMaW5rUHJvcGVydGllcygpOwogICAgICAgICAgICAgaWYgKHJlc3BvbnNlLmxlbmd0aCA+PSAyKSB7CiAgICAgICAgICAgICAgICAgY2lkID0gSW50ZWdlci5wYXJzZUludChyZXNwb25zZVswXSk7Ci0gICAgICAgICAgICAgICAgaW50ZXJmYWNlTmFtZSA9IHJlc3BvbnNlWzFdOwotICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5sZW5ndGggPiAyKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlwQWRkcmVzcyA9IHJlc3BvbnNlWzJdOworICAgICAgICAgICAgICAgIFN0cmluZyBpbnRlcmZhY2VOYW1lID0gcmVzcG9uc2VbMV07CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gU2V0dXBSZXN1bHQuU1VDQ0VTUzsKKworICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwcmVmaXggPSAibmV0LiIgKyBpbnRlcmZhY2VOYW1lICsgIi4iOwotICAgICAgICAgICAgICAgICAgICBnYXRld2F5QWRkcmVzcyA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KHByZWZpeCArICJndyIpOworCisgICAgICAgICAgICAgICAgICAgIE5ldHdvcmtJbnRlcmZhY2UgbmV0d29ya0ludGVyZmFjZSA9IE5ldHdvcmtJbnRlcmZhY2UuZ2V0QnlOYW1lKGludGVyZmFjZU5hbWUpOworICAgICAgICAgICAgICAgICAgICBsaW5rUHJvcGVydGllcy5zZXRJbnRlcmZhY2VOYW1lKGludGVyZmFjZU5hbWUpOworCisgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IEdldCBnYXRld2F5IGFuZCBkbnMgdmlhIFJJTCBpbnRlcmZhY2Ugbm90IHByb3BlcnR5PworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZ2F0ZXdheUFkZHJlc3MgPSBTeXN0ZW1Qcm9wZXJ0aWVzLmdldChwcmVmaXggKyAiZ3ciKTsKKyAgICAgICAgICAgICAgICAgICAgbGlua1Byb3BlcnRpZXMuc2V0R2F0ZXdheShJbmV0QWRkcmVzcy5nZXRCeU5hbWUoZ2F0ZXdheUFkZHJlc3MpKTsKKworICAgICAgICAgICAgICAgICAgICBmb3IgKEludGVyZmFjZUFkZHJlc3MgYWRkciA6IG5ldHdvcmtJbnRlcmZhY2UuZ2V0SW50ZXJmYWNlQWRkcmVzc2VzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtQcm9wZXJ0aWVzLmFkZExpbmtBZGRyZXNzKG5ldyBMaW5rQWRkcmVzcyhhZGRyKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogR2V0IGdhdGV3YXkgYW5kIGRucyB2aWEgUklMIGludGVyZmFjZSBub3QgcHJvcGVydHk/CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBkbnNTZXJ2ZXJzW10gPSBuZXcgU3RyaW5nWzJdOwogICAgICAgICAgICAgICAgICAgICBkbnNTZXJ2ZXJzWzBdID0gU3lzdGVtUHJvcGVydGllcy5nZXQocHJlZml4ICsgImRuczEiKTsKICAgICAgICAgICAgICAgICAgICAgZG5zU2VydmVyc1sxXSA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KHByZWZpeCArICJkbnMyIik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxvZygiaW50ZXJmYWNlPSIgKyBpbnRlcmZhY2VOYW1lICsgIiBpcEFkZHJlc3M9IiArIGlwQWRkcmVzcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBnYXRld2F5PSIgKyBnYXRld2F5QWRkcmVzcyArICIgRE5TMT0iICsgZG5zU2VydmVyc1swXQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBETlMyPSIgKyBkbnNTZXJ2ZXJzWzFdKTsKLSAgICAgICAgICAgICAgICAgICAgfQotCiAgICAgICAgICAgICAgICAgICAgIGlmIChpc0Ruc09rKGRuc1NlcnZlcnMpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBTZXR1cFJlc3VsdC5TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICAgICAgbGlua1Byb3BlcnRpZXMuYWRkRG5zKEluZXRBZGRyZXNzLmdldEJ5TmFtZShkbnNTZXJ2ZXJzWzBdKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5rUHJvcGVydGllcy5hZGREbnMoSW5ldEFkZHJlc3MuZ2V0QnlOYW1lKGRuc1NlcnZlcnNbMV0pKTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IFNldHVwUmVzdWx0LkVSUl9CYWREbnM7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBTZXR1cFJlc3VsdC5TVUNDRVNTOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVua25vd25Ib3N0RXhjZXB0aW9uIGUxKSB7CisgICAgICAgICAgICAgICAgICAgIGxvZygib25TZXR1cENvbXBsZXRlZDogVW5rbm93SG9zdEV4Y2VwdGlvbiAiICsgZTEpOworICAgICAgICAgICAgICAgICAgICBlMS5wcmludFN0YWNrVHJhY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gU2V0dXBSZXN1bHQuRVJSX090aGVyOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFNvY2tldEV4Y2VwdGlvbiBlMikgeworICAgICAgICAgICAgICAgICAgICBsb2coIm9uU2V0dXBDb21wbGV0ZWQ6IFNvY2tldEV4Y2VwdGlvbiAiICsgZTIpOworICAgICAgICAgICAgICAgICAgICBlMi5wcmludFN0YWNrVHJhY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gU2V0dXBSZXN1bHQuRVJSX090aGVyOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbG9nKCJvblNldHVwQ29tcGxldGVkOiBlcnJvcjsgZXhwZWN0ZWQgbnVtYmVyIG9mIHJlc3BvbnNlcyA+PSAyIHdhcyAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmxlbmd0aCk7CiAgICAgICAgICAgICAgICAgcmVzdWx0ID0gU2V0dXBSZXN1bHQuRVJSX090aGVyOwogICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBBbiBlcnJvciBvY2N1cnJlZCBzbyBjbGVhciBwcm9wZXJ0aWVzCisgICAgICAgICAgICBpZiAocmVzdWx0ICE9IFNldHVwUmVzdWx0LlNVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICBsb2coIm9uU2V0dXBDb21wbGV0ZWQgd2l0aCBhbiBlcnJvciBjbGVhcmluZyBMaW5rUHJvcGVydGllcyIpOworICAgICAgICAgICAgICAgIGxpbmtQcm9wZXJ0aWVzLmNsZWFyKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTGlua1Byb3BlcnRpZXMgPSBsaW5rUHJvcGVydGllczsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChEQkcpIGxvZygiRGF0YUNvbm5lY3Rpb24gc2V0dXAgcmVzdWx0PSciICsgcmVzdWx0ICsgIicgb24gY2lkPSIgKyBjaWQpOworICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICBsb2coIkRhdGFDb25uZWN0aW9uIHNldHVwIHJlc3VsdD0nIiArIHJlc3VsdCArICInIG9uIGNpZD0iICsgY2lkKTsKKyAgICAgICAgICAgIGlmIChyZXN1bHQgPT0gU2V0dXBSZXN1bHQuU1VDQ0VTUykgeworICAgICAgICAgICAgICAgIGxvZygiTGlua1Byb3BlcnRpZXM6ICIgKyBtTGlua1Byb3BlcnRpZXMudG9TdHJpbmcoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICB9CiAKQEAgLTYwNiw3ICs2MzksMTYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgRVJSX0JhZERuczoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDb25uZWN0aW9uIHN1Y2NlZWRlZCBidXQgRE5TIGluZm8gaXMgYmFkIHNvIGRpc2Nvbm5lY3QKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEV2ZW50TG9nVGFncy5QRFBfQkFEX0ROU19BRERSRVNTLCBkbnNTZXJ2ZXJzWzBdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGRuc0FkZHJlc3Nlc1NiID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKEluZXRBZGRyZXNzIGFkZHIgOiBtTGlua1Byb3BlcnRpZXMuZ2V0RG5zZXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG5zQWRkcmVzc2VzU2IubGVuZ3RoKCkgIT0gMCkgZG5zQWRkcmVzc2VzU2IuYXBwZW5kKCIgIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRuc0FkZHJlc3Nlc1NiLmFwcGVuZChhZGRyLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG5zQWRkcmVzc2VzU2IubGVuZ3RoKCkgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbnNBZGRyZXNzZXNTYi5hcHBlbmQoIm5vLWRucy1hZGRyZXNzZXMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFdmVudExvZ1RhZ3MuUERQX0JBRF9ETlNfQUREUkVTUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRuc0FkZHJlc3Nlc1NiLnRvU3RyaW5nKCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlYXJEb3duRGF0YShjcCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1EaXNjb25uZWN0aW5nQmFkRG5zU3RhdGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtODczLDMxICs5MTUsMjIgQEAKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBAcmV0dXJuIHRoZSBpbnRlcmZhY2UgbmFtZSBhcyBhIHN0cmluZy4KKyAgICAgKiBSZXR1cm4gdGhlIExpbmtQcm9wZXJ0aWVzIGZvciB0aGUgY29ubmVjdGlvbi4KKyAgICAgKgorICAgICAqIEByZXR1cm4gYSBjb3B5IG9mIHRoZSBMaW5rUHJvcGVydGllcywgaXMgbmV2ZXIgbnVsbC4KICAgICAgKi8KLSAgICBwdWJsaWMgU3RyaW5nIGdldEludGVyZmFjZSgpIHsKLSAgICAgICAgcmV0dXJuIGludGVyZmFjZU5hbWU7CisgICAgcHVibGljIExpbmtQcm9wZXJ0aWVzIGdldExpbmtQcm9wZXJ0aWVzKCkgeworICAgICAgICByZXR1cm4gbmV3IExpbmtQcm9wZXJ0aWVzKG1MaW5rUHJvcGVydGllcyk7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogQHJldHVybiB0aGUgaXAgYWRkcmVzcyBhcyBhIHN0cmluZy4KKyAgICAgKiBBIGNhcGFiaWxpdHkgaXMgYW4gSW50ZWdlci9TdHJpbmcgcGFpciwgdGhlIGNhcGFiaWxpdGllcworICAgICAqIGFyZSBkZWZpbmVkIGluIHRoZSB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VjdGVkIHN5bmNocm9uaXplZCBib29sZWFuIGlzRW5hYmxlZChpbnQgaWQpIHsKKyAgICBwcm90ZWN0ZWQgTGlua1Byb3BlcnRpZXMgZ2V0TGlua1Byb3BlcnRpZXMoU3RyaW5nIGFwblR5cGUpIHsKKyAgICAgICAgaW50IGlkID0gYXBuVHlwZVRvSWQoYXBuVHlwZSk7CisgICAgICAgIGlmIChpc0FwbklkRW5hYmxlZChpZCkpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgTGlua1Byb3BlcnRpZXMobUxpbmtQcm9wZXJ0aWVzKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgTGlua1Byb3BlcnRpZXMoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByb3RlY3RlZCBMaW5rQ2FwYWJpbGl0aWVzIGdldExpbmtDYXBhYmlsaXRpZXMoU3RyaW5nIGFwblR5cGUpIHsKKyAgICAgICAgaW50IGlkID0gYXBuVHlwZVRvSWQoYXBuVHlwZSk7CisgICAgICAgIGlmIChpc0FwbklkRW5hYmxlZChpZCkpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgTGlua0NhcGFiaWxpdGllcyhtTGlua0NhcGFiaWxpdGllcyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IExpbmtDYXBhYmlsaXRpZXMoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgTGlua1Byb3BlcnRpZXMgZm9yIHRoZSBjb25uZWN0aW9uLgorICAgICAqCisgICAgICogQHBhcmFtIGNvbm5lY3Rpb24KKyAgICAgKiBAcmV0dXJuIGEgY29weSBvZiB0aGUgTGlua1Byb3BlcnRpZXMsIGlzIG5ldmVyIG51bGwuCisgICAgICovCisgICAgcHJvdGVjdGVkIExpbmtQcm9wZXJ0aWVzIGdldExpbmtQcm9wZXJ0aWVzKERhdGFDb25uZWN0aW9uIGNvbm5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SBhY3RpdmUgYW5kIG5lZWRzIHRvIHNlbmQgZXZlbnRzIHRvIGNhdGNoIHVwIHdpdGggdGhlIGN1cnJlbnQgY29uZGl0aW9uCisgICAgcHJpdmF0ZSB2b2lkIG5vdGlmeUFwbklkVXBUb0N1cnJlbnQoU3RyaW5nIHJlYXNvbiwgaW50IGFwbklkKSB7CisgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKKyAgICAgICAgICAgIGNhc2UgSURMRToKKyAgICAgICAgICAgIGNhc2UgSU5JVElORzoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQ09OTkVDVElORzoKKyAgICAgICAgICAgIGNhc2UgU0NBTk5JTkc6CisgICAgICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uLCBhcG5JZFRvVHlwZShhcG5JZCksIFBob25lLkRhdGFTdGF0ZS5DT05ORUNUSU5HKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQ09OTkVDVEVEOgorICAgICAgICAgICAgY2FzZSBESVNDT05ORUNUSU5HOgorICAgICAgICAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbiwgYXBuSWRUb1R5cGUoYXBuSWQpLCBQaG9uZS5EYXRhU3RhdGUuQ09OTkVDVElORyk7CisgICAgICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uLCBhcG5JZFRvVHlwZShhcG5JZCksIFBob25lLkRhdGFTdGF0ZS5DT05ORUNURUQpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gc2luY2Ugd2Ugbm9ybWFsbHkgZG9uJ3Qgc2VuZCBpbmZvIHRvIGEgZGlzY29ubmVjdGVkIEFQTiwgd2UgbmVlZCB0byBkbyB0aGlzIHNwZWNpYWxseQorICAgIHByaXZhdGUgdm9pZCBub3RpZn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PT0gU3RhdGUuRkFJTEVEIHx8IHN0YXRlID09IFN0YXRlLklETEUpKSk7CisgICAgICAgIGlmICghcG9zc2libGUgJiYgREJHICYmIGlzRGF0YUFsbG93ZWQoKSkgeworICAgICAgICAgICAgbG9nKCJEYXRhIG5vdCBwb3NzaWJsZS4gIE5vIGNvdmVyYWdlOiBkYXRhU3RhdGUgPSAiICsgc3RhdGUpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBwb3NzaWJsZTsKKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgYWJzdHJhY3QgYm9vbGVhbiBpc0RhdGFBbGxvd2VkKCk7CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0FwblR5cGVFbmFibGVkKFN0cmluZyBhcG5UeXBlKSB7CisgICAgICAgIHJldHVybiBpc0FwbklkRW5hYmxlZChhcG5UeXBlVG9JZChhcG5UeXBlKSk7CisgICAgfQorCisgICAgcHJvdGVjdGVkIHN5bmNocm9uaXplZCBib29sZWFuIGlzQXBuSWRFbmFibGVkKGludCBpZCkgewogICAgICAgICBpZiAoaWQgIT0gQVBOX0lOVkFMSURfSUQpIHsKICAgICAgICAgICAgIHJldHVybiBkYXRhRW5hYmxlZFtpZF07CiAgICAgICAgIH0KQEAgLTQ0NCwyMiArNTYzLDIxIEBACiAgICAgICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1JFUVVFU1RfRkFJTEVEOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgImVuYWJsZUFwblR5cGUoIit0eXBlKyIpLCBpc0FwblR5cGVBY3RpdmUgPSAiCi0gICAgICAgICAgICAgICAgKyBpc0FwblR5cGVBY3RpdmUodHlwZSkgKyAiIGFuZCBzdGF0ZSA9ICIgKyBzdGF0ZSk7CisgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJlbmFibGVBcG5UeXBlKCIgKyB0eXBlICsgIiksIGlzQXBuVHlwZUFjdG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AgICAgICAgIHJldHVybiBQaG9uZS5BUE5fQUxSRUFEWV9BQ1RJVkU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzZXRFbmFibGVkKGlkLCB0cnVlKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1JFUVVFU1RfU1RBUlRFRDsKICAgICB9CkBAIC00NzgsNyArNTk2LDcgQEAKICAgICAgICAgaWYgKGlkID09IEFQTl9JTlZBTElEX0lEKSB7CiAgICAgICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1JFUVVFU1RfRkFJTEVEOwogICAgICAgICB9Ci0gICAgICAgIGlmIChpc0VuYWJsZWQoaWQpKSB7CisgICAgICAgIGlmIChpc0FwbklkRW5hYmxlZChpZCkpIHsKICAgICAgICAgICAgIHNldEVuYWJsZWQoaWQsIGZhbHNlKTsKICAgICAgICAgICAgIGlmIChpc0FwblR5cGVBY3RpdmUoUGhvbmUuQVBOX1RZUEVfREVGQVVMVCkpIHsKICAgICAgICAgICAgICAgICBpZiAoZGF0YUVuYWJsZWRbQVBOX0RFRkFVTFRfSURdKSB7CkBAIC00OTUsOSArNjEzLDEwIEBACiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIHNldEVuYWJsZWQoaW50IGlkLCBib29sZWFuIGVuYWJsZSkgewotICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAic2V0RW5hYmxlZCgiICsgaWQgKyAiLCAiICsgZW5hYmxlICsgIikgd2l0aCBvbGQgc3RhdGUgPSAiICsKLSAgICAgICAgICAgICAgICBkYXRhRW5hYmxlZFtpZF0gKyAiIGFuZCBlbmFibGVkQ291bnQgPSAiICsgZW5hYmxlZENvdW50KTsKLQorICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAic2V0RW5hYmxlZCgiICsgaWQgKyAiLCAiICsgZW5hYmxlICsgIikgd2l0aCBvbGQgc3RhdGUgPSAiCisgICAgICAgICAg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0gRU5BQkxFRCkgewogICAgICAgICAgICAgaWYgKCFkYXRhRW5hYmxlZFthcG5JZF0pIHsKQEAgLTUyMCw2ICs2MzgsOCBAQAogICAgICAgICAgICAgaWYgKCFpc0FwblR5cGVBY3RpdmUodHlwZSkpIHsKICAgICAgICAgICAgICAgICBtUmVxdWVzdGVkQXBuVHlwZSA9IHR5cGU7CiAgICAgICAgICAgICAgICAgb25FbmFibGVOZXdBcG4oKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbm90aWZ5QXBuSWRVcFRvQ3VycmVudChQaG9uZS5SRUFTT05fQVBOX1NXSVRDSEVELCBhcG5JZCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyBkaXNhYmxlCkBAIC01MjgsOCArNjQ4LDE3IEBACiAgICAgICAgICAgICAgICAgZW5hYmxlZENvdW50LS07CiAgICAgICAgICAgICAgICAgaWYgKGVuYWJsZWRDb3VudCA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIG9uQ2xlYW5VcENvbm5lY3Rpb24odHJ1ZSwgUGhvbmUuUkVBU09OX0RBVEFfRElTQUJMRUQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0YUVuYWJsZWRbQVBOX0RFRkFVTFRfSURdID09IHRydWUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICFpc0FwblR5cGVBY3RpdmUoUGhvbmUuQVBOX1RZUEVfREVGQVVMVCkpIHsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBzZW5kIHRoZSBkaXNjb25uZWN0IG1zZyBtYW51YWxseSwgc2luY2UgdGhlIG5vcm1hbCByb3V0ZSB3b250IHNlbmQKKyAgICAgICAgICAgICAgICAvLyBpdCAoaXQncyBub3QgZW5hYmxlZCkKKyAgICAgICAgICAgICAgICBub3RpZnlBcG5JZERpc2Nvbm5lY3RlZChQaG9uZS5SRUFTT05fREFUQV9ESVNBQkxFRCwgYXBuSWQpOworICAgICAgICAgICAgICAgIGlmIChkYXRhRW5hYmxlZFtBUE5fREVGQVVMVF9JRF0gPT0gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWlzQXBuVHlwZUFjdGl2ZShQaG9uZS5BUE5fVFlQRV9ERUZBVUxUKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIC0gdGhpcyBpcyBhbiB1Z2x5IHdheSB0byByZXN0b3JlIHRoZSBkZWZhdWx0IGNvbm4gLSBzaG91bGQgYmUgZG9uZQorICAgICAgICAgICAgICAgICAgICAvLyBieSBhIHJlYWwgY29udGVudGlvbiBtYW5hZ2VyIGFuZCBwb2xpY3kgdGhhdCBkaXNjb25uZWN0cyB0aGUgbG93ZXIgcHJpCisgICAgICAgICAgICAgICAgICAgIC8vIHN0dWZmIGFzIGVuYWJsZSByZXF1ZXN0cyBjb21lIGluIGFuZCBwb3BzIHRoZW0gYmFjayBvbiBhcyB3ZSBkaXNhYmxlIGJhY2sKKyAgICAgICAgICAgICAgICAgICAgLy8gZG93biB0byB0aGUgbG93ZXIgcHJpIHN0dWZmCiAgICAgICAgICAgICAgICAgICAgIG1SZXF1ZXN0ZWRBcG5UeXBlID0gUGhvbmUuQVBOX1RZUEVfREVGQVVMVDsKICAgICAgICAgICAgICAgICAgICAgb25FbmFibGVOZXdBcG4oKTsKICAgICAgICAgICAgICAgICB9CkBAIC01NzQsOSArNzAzLDcgQEAKICAgICAgICAgICAgICAgICBvblRyeVNldHVwRGF0YShQaG9uZS5SRUFTT05fREFUQV9FTkFCTEVEKTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgb25DbGVhblVwQ29ubmVjdGlvbih0cnVlLCBQaG9uZS5SRUFTT05fREFUQV9ESVNBQkxFRCk7Ci0gICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLQotCiB9CmRpZmYgLS1naXQgYS90ZW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pbmtDYXBhYmlsaXRpZXMgPSBzZW5kZXIuZ2V0TGlua0NhcGFiaWxpdGllcyhhcG5UeXBlKTsKKyAgICAgICAgfQogICAgICAgICB0cnkgewogICAgICAgICAgICAgbVJlZ2lzdHJ5Lm5vdGlmeURhdGFDb25uZWN0aW9uKAotICAgICAgICAgICAgICAgICAgICBjb252ZXJ0RGF0YVN0YXRlKHNlbmRlci5nZXREYXRhQ29ubmVjdGlvblN0YXRlKCkpLAorICAgICAgICAgICAgICAgICAgICBjb252ZXJ0RGF0YVN0YXRlKHN0YXRlKSwKICAgICAgICAgICAgICAgICAgICAgc2VuZGVyLmlzRGF0YUNvbm5lY3Rpdml0eVBvc3NpYmxlKCksIHJlYXNvbiwKICAgICAgICAgICAgICAgICAgICAgc2VuZGVyLmdldEFjdGl2ZUFwbigpLAotICAgICAgICAgICAgICAgICAgICBzZW5kZXIuZ2V0QWN0aXZlQXBuVHlwZXMoKSwKLSAgICAgICAgICAgICAgICAgICAgc2VuZGVyLmdldEludGVyZmFjZU5hbWUobnVsbCksCisgICAgICAgICAgICAgICAgICAgIGFwblR5cGUsCisgICAgICAgICAgICAgICAgICAgIGxpbmtQcm9wZXJ0aWVzLAorICAgICAgICAgICAgICAgICAgICBsaW5rQ2FwYWJpbGl0aWVzLAogICAgICAgICAgICAgICAgICAgICAoKHRlbGVwaG9ueSE9bnVsbCkgPyB0ZWxlcGhvbnkuZ2V0TmV0d29ya1R5cGUoKSA6Ci0gICAgICAgICAgICAgICAgICAgIFRlbGVwaG9ueU1hbmFnZXIuTkVUV09SS19UWVBFX1VOS05PV04pLAotICAgICAgICAgICAgICAgICAgICBzZW5kZXIuZ2V0R2F0ZXdheShudWxsKSk7CisgICAgICAgICAgICAgICAgICAgIFRlbGVwaG9ueU1hbmFnZXIuTkVUV09SS19UWVBFX1VOS05PV04pKTsKICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CiAgICAgICAgICAgICAvLyBzeXN0ZW0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gICAgICAgICAgaWYgKCFpc01iY3MgfHwgYyA8IDB4ODAgfHwgaSArIDEgPj0gb2Zmc2V0ICsgbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXQuYXBwZW5kKChjaGFyKWdzbVRvQ2hhci5nZXQoYywgJyAnKSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBpc01iY3MgbXVzdCBiZSB0cnVlLiBTbyBib3RoIG1iY3NCdWZmZXIgYW5kIGNoYXJzZXQgYXJlIGluaXRpYWxpemVkLgorICAgICAgICAgICAgICAgICAgICAgICAgbWJjc0J1ZmZlci5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICAgICAgbWJjc0J1ZmZlci5wdXQoZGF0YSwgaSsrLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1iY3NCdWZmZXIuZmxpcCgpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0LmFwcGVuZChjaGFyc2V0LmRlY29kZShtYmNzQnVmZmVyKS50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBwcmV2V2FzRXNjYXBlID0gZmFsc2U7CiAgICAgICAgICAgICB9CmRpZmYgLS1naXQgYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvSVBob25lU3RhdGVMaXN0ZW5lci5haWRsIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0lQaG9uZVN0YXRlTGlzdGVuZXIuYWlkbAppbmRleCA4NTZkNjYzLi4wODJjMDk3IDEwMDY0NAotLS0gYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvSVBob25lU3RhdGVMaXN0ZW5lci5haWRsCisrKyBiL3RlbGVwaG9ueS9qYXZhL2Nv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cyB0YWJsZSBpcyBhIGxpc3Qgb2YgTUNDIGNvZGVzLiAgVGhlIGluZGV4IGluIHRoaXMgdGFibGUnLAotICAgICAgICAgICAgICAgICAgICAnb2YgYSBnaXZlbiBNQ0MgY29kZSBpcyB0aGUgaW5kZXggb2YgZXh0cmEgaW5mb3JtYXRpb24gYWJvdXQnLAotICAgICAgICAgICAgICAgICAgICAndGhhdCBNQ0MgaW4gdGhlIElORF9DT0RFUyB0YWJsZS4nXSkKLXByaW50IGZtdF9saXN0KCdzaG9ydFtdIE1DQ19DT0RFUycsIG1jY19jb2RlcywgMTApCi1kb19hdXRvZ2VuX2NvbW1lbnQoWydUaGUgdmFsdWVzIGluIHRoaXMgdGFibGUgYXJlIGJyb2tlbiBkb3duIGFzIGZvbGxvd3MgKG1zYiB0byBsc2IpOicsCi0gICAgICAgICAgICAgICAgICAgICcgICAgaXNvIGNvdW50cnkgY29kZSAxNiBiaXRzJywKLSAgICAgICAgICAgICAgICAgICAgJyAgICAodW51c2VkKSAgICAgICAgICAxIGJpdCcsCi0gICAgICAgICAgICAgICAgICAgICcgICAgd2lmaSBjaGFubmVsICAgICAgNCBiaXRzJywKLSAgICAgICAgICAgICAgICAgICAgJyAgICBzbWFsbGVkIGRpZ2l0ICAgICAyIGJpdHMnLAotICAgICAgICAgICAgICAgICAgICAnICAgIGRlZmF1bHQgdGltZXpvbmUgIDUgYml0cycsCi0gICAgICAgICAgICAgICAgICAgICcgICAgZGVmYXVsdCBsYW5ndWFnZSAgNCBiaXRzJ10pCi1wcmludCBmbXRfbGlzdCgnaW50W10gSU5EX0NPREVTJywgaW5kX2NvZGVzLCA2KQotCi1kZWYgcGFyc2VfaW5kX2NvZGUoaW5kKToKLSAgbWNjID0gZXZhbChtY2NfY29kZXNbaW5kXSkKLSAgY29kZSA9IGV2YWwoaW5kX2NvZGVzW2luZF0pCi0gIGlzb19sc2IgPSBpbnQoKGNvZGUgPj4gMTYpICYgMHgwMEZGKQotICBpc29fbXNiID0gaW50K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ydCBqYXZhLnV0aWwuTG9jYWxlOworaW1wb3J0IGxpYmNvcmUuaWN1LlRpbWVab25lczsKIAogLyoqCiAgKiBNb2JpbGUgQ291bnRyeSBDb2RlCkBAIC0zNzEsMjAyICszOCwxNTMgQEAKICAqLwogcHVibGljIGZpbmFsIGNsYXNzIE1jY1RhYmxlCiB7Ci0gICAgLyoqCi0gICAgICogQVVUTyBHRU5FUkFURUQgKGJ5IHRoZSBQeXRob24gY29kZSBhYm92ZSkKLSAgICAgKi8KLSAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmdbXSBUWl9TVFJJTkdTID0gewotICAgICAgICAiIiwKLSAgICAgICAgIkFmcmljYS9Kb2hhbm5lc2J1cmciLAotICAgICAgICAiQXNpYS9CZWlqaW5nIiwKLSAgICAgICAgIkFzaWEvU2VvdWwiLAotICAgICAgICAiQXNpYS9TaW5nYXBvcmUiLAotICAgICAgICAiQXNpYS9Ub2t5byIsCi0gICAgICAgICJBdXN0cmFsaWEvU3lkbmV5IiwKLSAgICAgICAgIkV1cm9wZS9BbXN0ZXJkYW0iLAotICAgICAgICAiRXVyb3BlL0JlcmxpbiIsCi0gICAgICAgICJFdXJvcGUvRHVibGluIiwKLSAgICAgICAgIkV1cm9wZS9Mb25kb24iLAotICAgICAgICAiRXVyb3BlL01hZHJpZCIsCi0gICAgICAgICJFdXJvcGUvUGFyaXMiLAotICAgICAgICAiRXVyb3BlL1ByYWd1ZSIsCi0gICAgICAgICJFdXJvcGUvUm9tZSIsCi0gICAgICAgICJFdXJvcGUvVmllbm5hIiwKLSAgICAgICAgIkV1cm9wZS9XYXJzYXciLAotICAgICAgICAiRXVyb3BlL1p1cmljaCIsCi0gICAgICAgICJQYWNpZmljL0F1Y2tsYW5kIgotICAgIH07Ci0KLSAgICAvKioKLSAgICAgKiBBVVRPIEdFTkVSQVRFRCAoYnkgdGhlIFB5dGhvbiBjb2RlIGFib3ZlKQotICAgICAqLwotICAgIHByaXZhdGUgc3RhdGljIG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d2lmaUNoYW5uZWxzOworCisgICAgICAgIE1jY0VudHJ5KGludCBtbmMsIFN0cmluZyBpc28sIGludCBzbWFsbGVzdERpZ2l0c01DQykgeworICAgICAgICAgICAgdGhpcyhtbmMsIGlzbywgc21hbGxlc3REaWdpdHNNQ0MsIG51bGwpOworICAgICAgICB9CisKKyAgICAgICAgTWNjRW50cnkoaW50IG1uYywgU3RyaW5nIGlzbywgaW50IHNtYWxsZXN0RGlnaXRzTUNDLCBTdHJpbmcgbGFuZ3VhZ2UpIHsKKyAgICAgICAgICAgIHRoaXMobW5jLCBpc28sIHNtYWxsZXN0RGlnaXRzTUNDLCBsYW5ndWFnZSwgMCk7CisgICAgICAgIH0KKworICAgICAgICBNY2NFbnRyeShpbnQgbW5jLCBTdHJpbmcgaXNvLCBpbnQgc21hbGxlc3REaWdpdHNNQ0MsIFN0cmluZyBsYW5ndWFnZSwgaW50IHdpZmlDaGFubmVscykgeworICAgICAgICAgICAgdGhpcy5tY2MgPSBtbmM7CisgICAgICAgICAgICB0aGlzLmlzbyA9IGlzbzsKKyAgICAgICAgICAgIHRoaXMuc21hbGxlc3REaWdpdHNNbmMgPSBzbWFsbGVzdERpZ2l0c01DQzsKKyAgICAgICAgICAgIHRoaXMubGFuZ3VhZ2UgPSBsYW5ndWFnZTsKKyAgICAgICAgICAgIHRoaXMud2lmaUNoYW5uZWxzID0gd2lmaUNoYW5uZWxzOworICAgICAgICB9CisKKworICAgICAgICBwdWJsaWMgaW50IGNvbXBhcmVUbyhNY2NFbnRyeSBvKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gbWNjIC0gby5tY2M7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBNY2NFbnRyeQorICAgIGVudHJ5Rm9yTWNjKGludCBtY2MpCisgICAgeworICAgICAgICBpbnQgaW5kZXg7CisKKyAgICAgICAgTWNjRW50cnkgbTsKKworICAgICAgICBtID0gbmV3IE1jY0VudHJ5KG1jYywgbnVsbCwgMCk7CisKKyAgICAgICAgaW5kZXggPSBDb2xsZWN0aW9ucy5iaW5hcnlTZWFyY2godGFibGUsIG0pOworCisgICAgICAgIGlmIChpbmRleCA8IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIHRhYmxlLmdldChpbmRleCk7CisgICAgICAgIH0KKyAgICB9CisKICAgICAvKioKLSAgICAgKiBHaXZlbiBhIE1vYmlsZSBDb3VudHJ5IENvZGUsIHJldHVybnMgYSBkZWZhdWx0IHRpbWUgem9uZSBJRAotICAgICAqIGlmIGF2YWlsYWJsZS4gIFJldHVybnMgbnVsbCBpZiB1bmF2YWlsYWJsZS4KKyAgICAgKiBSZXR1cm5zIGEgZGVmYXVsdCB0aW1lIHpvbmUgSUQgZm9yIHRoZSBnaXZlbiBNQ0MuCisgICAgICogQHBhcmFtIG1jYyBNb2JpbGUgQ291bnRyeSBDb2RlCisgICAgICogQHJldHVybiBkZWZhdWx0IFRpbWVab25lIElELCBvciBudWxsIGlmIG5vdCBzcGVjaWZpZWQKICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBkZWZhdWx0VGltZVpvbmVGb3JNY2MoaW50IG1jYykgewotICAgICAgICBpbnQgaW5kZXggPSBBcnJheXMuYmluYXJ5U2VhcmNoKE1DQ19DT0RFUywgKHNob3J0KW1jYyk7Ci0gICAgICAgIGlmIChpbmRleCA8IDApIHsKKyAgICAgICAgTWNjRW50cnkgZW50cnk7CisKKyAgICAgICAgZW50cnkgPSBlbnRyeUZvck1jYyhtY2MpOworICAgICAgICBpZiAoZW50cnkgPT0gbnVsbCB8fCBlbnRyeS5pc28gPT0gbnVsbCkgewogICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMb2NhbGUgbG9jYWxlOworICAgICAgICAgICAgaWYgKGVudHJ5Lmxhbmd1YWdlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBsb2NhbGUgPSBuZXcgTG9jYWxlKGVudHJ5Lmlzbyk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGxvY2FsZSA9IG5ldyBMb2NhbGUoZW50cnkubGFuZ3VhZ2UsIGVudHJ5Lmlzbyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTdHJpbmdbXSB0eiA9IFRpbWVab25lcy5mb3JMb2NhbGUobG9jYWxlKTsKKyAgICAgICAgICAgIGlmICh0ei5sZW5ndGggPT0gMCkgcmV0dXJuIG51bGw7CisgICAgICAgICAgICByZXR1cm4gdHpbMF07CiAgICAgICAgIH0KLSAgICAgICAgaW50IGluZENvZGUgPSBJTkRfQ09ERVNbaW5kZXhdOwotICAgICAgICBpbnQgdHpJbmQgPSAoaW5kQ29kZSA+Pj4gNCkgJiAweDAwMUY7Ci0gICAgICAgIFN0cmluZyB0eiA9IFRaX1NUUklOR1NbdHpJbmRdOwotICAgICAgICBpZiAodHogPT0gIiIpIHsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0ejsKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBHaXZlbiBhIE1vYmlsZSBDb3VudHJ5IENvZGUsIHJldHVybnMgYW4gSVNPIHR3by1jaGFyYWN0ZXIKLSAgICAgKiBjb3VudHJ5IGNvZGUgaWYgYXZhaWxhYmxlLiAgUmV0dXJucyAiIiBpZiB1bmF2YWlsYWJsZS4KKyAgICAgKiBHaXZlbiBhIEdTTSBNb2JpbGUgQ291bnRyeSBDb2RlLCByZXR1cm5zCisgICAgICogYW4gSVNPIHR3by1jaGFyYWN0ZXIgY291bnRyeSBjb2RlIGlmIGF2YWlsYWJsZS4KKyAgICAgKiBSZXR1cm5zICIiIGlmIHVuYXZhaWxhYmxlLgogICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGNvdW50cnlDb2RlRm9yTWNjKGludCB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XVsdExhbmd1YWdlRm9yTWNjKGludCBtY2MpIHsKLSAgICAgICAgaW50IGluZGV4ID0gQXJyYXlzLmJpbmFyeVNlYXJjaChNQ0NfQ09ERVMsIChzaG9ydCltY2MpOwotICAgICAgICBpZiAoaW5kZXggPCAwKSB7CisgICAgICAgIE1jY0VudHJ5IGVudHJ5OworCisgICAgICAgIGVudHJ5ID0gZW50cnlGb3JNY2MobWNjKTsKKworICAgICAgICBpZiAoZW50cnkgPT0gbnVsbCkgewogICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZW50cnkubGFuZ3VhZ2U7CiAgICAgICAgIH0KLSAgICAgICAgaW50IGluZENvZGUgPSBJTkRfQ09ERVNbaW5kZXhdOwotICAgICAgICBpbnQgbGFuZ0luZCA9IGluZENvZGUgJiAweDAwMEY7Ci0gICAgICAgIFN0cmluZyBsYW5nID0gTEFOR19TVFJJTkdTW2xhbmdJbmRdOwotICAgICAgICBpZiAobGFuZyA9PSAiIikgewotICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGxhbmc7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogR2l2ZW4gYSBHU00gTW9iaWxlIENvdW50cnkgQ29kZSwgcmV0dXJucyB0aGUgY29ycmVzcG9uZGluZwotICAgICAqIHNtYWxsZXN0IG51bWJlciBvZiBkaWdpdHMgZmllbGQuICBSZXR1cm5zIDIgaWYgdW5hdmFpbGFibGUuCisgICAgICogR2l2ZW4gYSBHU00gTW9iaWxlIENvdW50cnkgQ29kZSwgcmV0dXJucworICAgICAqIHRoZSBzbWFsbGVzdCBudW1iZXIgb2YgZGlnaXRzIHRoYXQgTSBpZiBhdmFpbGFibGUuCisgICAgICogUmV0dXJucyAyIGlmIHVuYXZhaWxhYmxlLgogICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgaW50IHNtYWxsZXN0RGlnaXRzTWNjRm9yTW5jKGludCBtY2MpIHsKLSAgICAgICAgaW50IGluZGV4ID0gQXJyYXlzLmJpbmFyeVNlYXJjaChNQ0NfQ09ERVMsIChzaG9ydCltY2MpOwotICAgICAgICBpZiAoaW5kZXggPCAwKSB7CisgICAgcHVibGljIHN0YXRpYyBpbnQKKyAgICBzbWFsbGVzdERpZ2l0c01jY0Zvck1uYyhpbnQgbWNjKQorICAgIHsKKyAgICAgICAgTWNjRW50cnkgZW50cnk7CisKKyAgICAgICAgZW50cnkgPSBlbnRyeUZvck1jYyhtY2MpOworCisgICAgICAgIGlmIChlbnRyeSA9PSBudWxsKSB7CiAgICAgICAgICAgICByZXR1cm4gMjsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBlbnRyeS5zbWFsbGVzdERpZ2l0c01uYzsKICAgICAgICAgfQotICAgICAgICBpbnQgaW5kQ29kZSA9IElORF9DT0RFU1tpbmRleF07Ci0gICAgICAgIGludCBzbURpZyA9IChpbmRDb2RlID4+PiA5KSAmIDB4MDAwMzsKLSAgICAgICAgcmV0dXJuIHNtRGlnOwogICAgIH0KIAogICAgIC8qKgogICAgICAqIEdpdmVuIGEgR1NNIE1vYmlsZSBDb3VudHJ5IENvZGUsIHJldHVybnMgdGhlIG51bWJlciBvZiB3aWZpCiAgICAgICogY2hhbm5lbHMgYWxsb3dlZCBpbiB0aGF0IGNvdW50cnkuICBSZXR1cm5zIDAgaWYgdW5hdmFpbGFibGUuCiAgICAgICovCi0gICAgcHVibGljIHN0YXRpYyBpbnQgd2lmaUNoYW5uZWxzRm9yTWNjKGludCBtY2MpIHsKLSAgICAgICAgaW50IGluZGV4ID0gQXJyYXlzLmJpbmFyeVNlYXJjaChNQ0NfQ09ERVMsIChzaG9ydCltY2MpOwotICAgICAgICBpZiAoaW5kZXggPCAwKSB7CisgICAgcHVibGljIHN0YXRpYyBpbnQKKyAgICB3aWZpQ2hhbm5lbHNGb3JNY2MoaW50IG1jYykgeworICAgICAgICBNY2NFbnRyeSBlbnRyeTsKKworICAgICAgICBlbnRyeSA9IGVudHJ5Rm9yTWNjKG1jYyk7CisKKyAgICAgICAgaWYgKGVudHJ5ID09IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIGVudHJ5LndpZmlDaGFubmVsczsKICAgICAgICAgfQotICAgICAgICBpbnQgaW5kQ29kZSA9IElORF9DT0RFU1tpbmRleF07Ci0gICAgICAgIGludCB3aWZpID0gKGluZENvZGUgPj4+IDExKSAmIDB4MDAwRjsKLSAgICAgICAgcmV0dXJuIHdpZmk7CiAgICAgfQogCiAgICAgLyoqCkBAIC02NTgsNCArMjc2LDI2MiBAQAogICAgICAgICAgICAgd00uc2V0TnVtQWxsb3dlZENoYW5uZWxzKHdpZmlDaGFubmVscywgdHJ1ZSk7CiAgICAgICAgIH0KICAgICB9CisKKyAgICBzdGF0aWMgeworICAgICAgICB0YWJsZSA9IG5ldyBBcnJheUxpc3Q8TWNjRW50cnk+KDI0MCk7CisKKworICAgICAgICAvKgorICAgICAgICAgKiBUaGUgdGFibGUgYmVsb3cgaXMgYnVpbHQgZnJvbSB0d28gcmVzb3VyY2VzOgorICAgICAgICAgKgorICAgICAgICAgKiAxKSBJVFUgIk1vYmlsZSBOZXR3b3JrIENvZGUgKE1OQykgZm9yIHRoZSBpbnRlcm5hdGlvbmFsCisgICAgICAgICAqICAgaWRlbnRpZmljYXRpb24gcGxhbiBmb3IgbW9iaWxlIHRlcm1pbmFscyBhbmQgbW9iaWxlIHVzZXJzIgorICAgICAgICAgKiAgIHdoaWNoIGlzIGF2YWlsYWJsZSBhcyBhbiBhbm5leCB0byB0aGUgSVRVIG9wZXJhdGlvbmFsIGJ1bGxldGluCisgICAgICAgICAqICAgYXZhaWxhYmxlIGhlcmU6IGh0dHA6Ly93d3cuaXR1LmludC9pdHUtdC9idWxsZXRpbi9hbm5leC5odG1sCisgICAgICAgICAqCisgICAg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C03ODAsNyArNzc5LDcgQEAKICAgICAgICAgc2VuZChycik7CiAgICAgfQogCi0gICAgcHVibGljIHZvaWQKKyAgICBARGVwcmVjYXRlZCBwdWJsaWMgdm9pZAogICAgIGdldFBEUENvbnRleHRMaXN0KE1lc3NhZ2UgcmVzdWx0KSB7CiAgICAgICAgIGdldERhdGFDYWxsTGlzdChyZXN1bHQpOwogICAgIH0KQEAgLTEyOTksMTAgKzEyOTgsMTggQEAKICAgICBwdWJsaWMgdm9pZAogICAgIHNldHVwRGF0YUNhbGwoU3RyaW5nIHJhZGlvVGVjaG5vbG9neSwgU3RyaW5nIHByb2ZpbGUsIFN0cmluZyBhcG4sCiAgICAgICAgICAgICBTdHJpbmcgdXNlciwgU3RyaW5nIHBhc3N3b3JkLCBTdHJpbmcgYXV0aFR5cGUsIE1lc3NhZ2UgcmVzdWx0KSB7CisgICAgICAgIHNldHVwRGF0YUNhbGxXaXRoUHJvdG9jb2wocmFkaW9UZWNobm9sb2d5LCBwcm9maWxlLCBhcG4sIHVzZXIsIHBhc3N3b3JkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aFR5cGUsICJJUCIsIHJlc3VsdCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQKKyAgICBzZXR1cERhdGFDYWxsV2l0aFByb3RvY29sKFN0cmluZyByYWRpb1RlY2hub2xvZ3ksIFN0cmluZyBwcm9maWxlLAorICAgICAgICAgICAgU3RyaW5nIGFwbiwgU3RyaW5nIHVzZXIsIFN0cmluZyBwYXNzd29yZCwgU3RyaW5nIGF1dGhUeXBlLAorICAgICAgICAgICAgU3RyaW5nIHByb3RvY29sVHlwZSwgTWVzc2FnZSByZXN1bHQpIHsKICAgICAgICAgUklMUmVxdWVzdCBycgogICAgICAgICAgICAgICAgID0gUklMUmVxdWVzdC5vYnRhaW4oUklMX1JFUVVFU1RfU0VUVVBfREFUQV9DQUxMLCByZXN1bHQpOwogCi0gICAgICAgIHJyLm1wLndyaXRlSW50KDYpOworICAgICAgICByci5tcC53cml0ZUludCg3KTsKIAogICAgICAgICByci5tcC53cml0ZVN0cmluZyhyYWRpb1RlY2hub2xvZ3kpOwogICAgICAgICByci5tcC53cml0ZVN0cmluZyhwcm9maWxlKTsKQEAgLTEzMTAsMTEgKzEzMTcsMTIgQEAKICAgICAgICAgcnIubXAud3JpdGVTdHJpbmcodXNlcik7CiAgICAgICAgIHJyLm1wLndyaXRlU3RyaW5nKHBhc3N3b3JkKTsKICAgICAgICAgcnIubXAud3JpdGVTdHJpbmcoYXV0aFR5cGUpOworICAgICAgICByci5tcC53cml0ZVN0cmluZyhwcm90b2NvbFR5cGUpOwogCiAgICAgICAgIGlmIChSSUxKX0xPR0QpIHJpbGpMb2cocnIuc2VyaWFsU3RyaW5nKCkgKyAiPiAiCiAgICAgICAgICAgICAgICAgKyByZXF1ZXN0VG9TdHJpbmcocnIubVJlcXVlc3QpICsgIiAiICsgcmFkaW9UZWNobm9sb2d5ICsgIiAiCiAgICAgICAgICAgICAgICAgKyBwcm9maWxlICsgIiAiICsgYXBuICsgIiAiICsgdXNlciArICIgIgotICAgICAgICAgICAgICAgICsgcGFzc3dvcmQgKyAiICIgKyBhdXRoVHlwZSk7CisgICAgICAgICAgICAgICAgKyBwYXNzd29yZCArICIgIiArIGF1dGhUeXBlICsgIiAiICsgcHJvdG9jb2xUeXBlKTsKIAogICAgICAgICBzZW5kKHJyKTsKICAgICB9CkBAIC0yOTA3LDcgKzI5MTUsMTEgQEAKICAgICAgICAgICAgIGRhdGFDYWxsLmFjdGl2ZSA9IHAucmVhZEludCgpOwogICAgICAgICAgICAgZGF0YUNhbGwudHlwZSA9IHAucmVhZFN0cmluZygpOwogICAgICAgICAgICAgZGF0YUNhbGwuYXBuID0gcC5yZWFkU3RyaW5nKCk7Ci0gICAgICAgICAgICBkYXRhQ2FsbC5hZGRyZXNzID0gcC5yZWFkU3RyaW5nKCk7CisgICAgICAgICAgICBTdHJpbmcgYWRkcmVzcyA9IHAucmVhZFN0cm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JsaWMgSGFzaE1hcCBtRGF0YTsKKyAgICAgICAgcHVibGljIEhhc2hNYXA8U3RyaW5nLCBPYmplY3Q+IG1EYXRhOwogICAgICAgICBwdWJsaWMgaW50IG1SZXRyeUNvdW50OwogICAgICAgICBwdWJsaWMgaW50IG1NZXNzYWdlUmVmOwogCiAgICAgICAgIHB1YmxpYyBQZW5kaW5nSW50ZW50IG1TZW50SW50ZW50OwogICAgICAgICBwdWJsaWMgUGVuZGluZ0ludGVudCBtRGVsaXZlcnlJbnRlbnQ7CiAKLSAgICAgICAgU21zVHJhY2tlcihIYXNoTWFwIGRhdGEsIFBlbmRpbmdJbnRlbnQgc2VudEludGVudCwKKyAgICAgICAgU21zVHJhY2tlcihIYXNoTWFwPFN0cmluZywgT2JqZWN0PiBkYXRhLCBQZW5kaW5nSW50ZW50IHNlbnRJbnRlbnQsCiAgICAgICAgICAgICAgICAgUGVuZGluZ0ludGVudCBkZWxpdmVyeUludGVudCkgewogICAgICAgICAgICAgbURhdGEgPSBkYXRhOwogICAgICAgICAgICAgbVNlbnRJbnRlbnQgPSBzZW50SW50ZW50OwpAQCAtOTQzLDcgKzk0NCw3IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcm90ZWN0ZWQgU21zVHJhY2tlciBTbXNUcmFja2VyRmFjdG9yeShIYXNoTWFwIGRhdGEsIFBlbmRpbmdJbnRlbnQgc2VudEludGVudCwKKyAgICBwcm90ZWN0ZWQgU21zVHJhY2tlciBTbXNUcmFja2VyRmFjdG9yeShIYXNoTWFwPFN0cmluZywgT2JqZWN0PiBkYXRhLCBQZW5kaW5nSW50ZW50IHNlbnRJbnRlbnQsCiAgICAgICAgICAgICBQZW5kaW5nSW50ZW50IGRlbGl2ZXJ5SW50ZW50KSB7CiAgICAgICAgIHJldHVybiBuZXcgU21zVHJhY2tlcihkYXRhLCBzZW50SW50ZW50LCBkZWxpdmVyeUludGVudCk7CiAgICAgfQpkaWZmIC0tZ2l0IGEvdGVsZXBob255L2phdm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gMjsKZGlmZiAtLWdpdCBhL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9jZG1hL0NkbWFDYWxsVHJhY2tlci5qYXZhIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L2NkbWEvQ2RtYUNhbGxUcmFja2VyLmphdmEKaW5kZXggMzY2OWU2MC4uMzI1YzJlMSAxMDA2NDQKLS0tIGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L2NkbWEvQ2RtYUNhbGxUcmFja2VyLmphdmEKKysrIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L2NkbWEvQ2RtYUNhbGxUcmFja2VyLmphdmEKQEAgLTM1NCw2ICszNTQsMjQgQEAKICAgICAgICAgICAgICAgICAgICAgfHwgKGZvcmVncm91bmRDYWxsLmdldFN0YXRlKCkgPT0gQ2RtYUNhbGwuU3RhdGUuQUNUSVZFKQogICAgICAgICAgICAgICAgICAgICB8fCAhYmFja2dyb3VuZENhbGwuZ2V0U3RhdGUoKS5pc0FsaXZlKCkpOwogCisgICAgICAgIGlmICghcmV0KSB7CisgICAgICAgICAgICBsb2coU3RyaW5nLmZvcm1hdCgiY2FuRGlhbCBpcyBmYWxzZVxuIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKChzZXJ2aWNlU3RhdGU9JWQpICE9IFNlcnZpY2VTdGF0ZS5TVEFURV9QT1dFUl9PRkYpOjo9JXNcbiIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiYmIHBlbmRpbmdNTyA9PSBudWxsOjo9JXNcbiIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiYmICFyaW5naW5nQ2FsbC5pc1JpbmdpbmcoKTo6PSVzXG4iICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICImJiAhZGlzYWJsZUNhbGwuZXF1YWxzKFwidHJ1ZVwiKTo6PSVzXG4iICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICImJiAoIWZvcmVncm91bmRDYWxsLmdldFN0YXRlKCkuaXNBbGl2ZSgpOjo9JXNcbiIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAgIHx8IGZvcmVncm91bmRDYWxsLmdldFN0YXRlKCkgPT0gQ2RtYUNhbGwuU3RhdGUuQUNUSVZFOjo9JXNcbiIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAgIHx8IWJhY2tncm91bmRDYWxsLmdldFN0YXRlKCkuaXNBbGl2ZSgpKTo6PSVzKSIsCisgICAgICAgICAgICAgICAgICAgIHNlcnZpY2VTdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgc2VydmljZVN0YXRlICE9IFNlcnZpY2VTdGF0ZS5TVEFURV9QT1dFUl9PRkYsCisgICAgICAgICAgICAgICAgICAgIHBlbmRpbmdNTyA9PSBudWxsLAorICAgICAgICAgICAgICAgICAgICAhcmluZ2luZ0NhbGwuaXNSaW5naW5nKCksCisgICAgICAgICAgICAgICAgICAgICFkaXNhYmxlQ2FsbC5lcXVhbHMoInRydWUiKSwKKyAgICAgICAgICAgICAgICAgICAgIWZvcmVncm91bmRDYWxsLmdldFN0YXRlKCkuaXNBbGl2ZSgpLAorICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kQ2FsbC5nZXRTdGF0ZSgpID09IENkbWFDYWxsLlN0YXRlLkFDVElWRSwKKyAgICAgICAgICAgICAgICAgICAgIWJhY2tncm91bmRDYWxsLmdldFN0YXRlKCkuaXNBbGl2ZSgpKSk7CisgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHJldDsKICAgICB9CiAKZGlmZiAtLWdpdCBhL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9jZG1hL0NkbWFEYXRhQ29ubmVjdGlvblRyY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sKKyAgICAgICAgICAgIGxvZygiRGF0YSBub3QgYWxsb3dlZCBkdWUgdG8iICsgcmVhc29uKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYWxsb3dlZDsKICAgICB9CiAKICAgICBwcml2YXRlIGJvb2xlYW4gdHJ5U2V0dXBEYXRhKFN0cmluZyByZWFzb24pIHsKQEAgLTMxNyw3ICszNDQsOCBAQAogICAgICAgICAgICAgLy8gQXNzdW1lIGRhdGEgaXMgY29ubmVjdGVkIG9uIHRoZSBzaW11bGF0b3IKICAgICAgICAgICAgIC8vIEZJWE1FICB0aGlzIGNhbiBiZSBpbXByb3ZlZAogICAgICAgICAgICAgc2V0U3RhdGUoU3RhdGUuQ09OTkVDVEVEKTsKLSAgICAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CisgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOworICAgICAgICAgICAgbm90aWZ5T2ZmQXBuc09mQXZhaWxhYmlsaXR5KHJlYXNvbiwgdHJ1ZSk7CiAKICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICIoZml4PykgV2UncmUgb24gdGhlIHNpbXVsYXRvcjsgYXNzdW1pbmcgZGF0YSBpcyBjb25uZWN0ZWQiKTsKICAgICAgICAgICAgIHJldHVybiB0cnVlOwpAQCAtMzI3LDM2ICszNTUsMTMgQEAKICAgICAgICAgYm9vbGVhbiByb2FtaW5nID0gcGhvbmUuZ2V0U2VydmljZVN0YXRlKCkuZ2V0Um9hbWluZygpOwogICAgICAgICBib29sZWFuIGRlc2lyZWRQb3dlclN0YXRlID0gbUNkbWFQaG9uZS5tU1NULmdldERlc2lyZWRQb3dlclN0YXRlKCk7CiAKLSAgICAgICAgaWYgKChzdGF0ZSA9PSBTdGF0ZS5JRExFIHx8IHN0YXRlID09IFN0YXRlLlNDQU5OSU5HKQotICAgICAgICAgICAgICAgICYmIChwc1N0YXRlID09IFNlcnZpY2VTdGF0ZS5TVEFURV9JTl9TRVJWSUNFKQotICAgICAgICAgICAgICAgICYmICgocGhvbmUubUNNLmdldFJhZGlvU3RhdGUoKSA9PSBDb21tYW5kc0ludGVyZmFjZS5SYWRpb1N0YXRlLk5WX1JFQURZKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgbUNkbWFQaG9uZS5tUnVpbVJlY29yZHMuZ2V0UmVjb3Jkc0xvYWRlZCgpKQotICAgICAgICAgICAgICAgICYmIChtQ2RtYVBob25lLm1TU1QuaXNDb25jdXJyZW50Vm9pY2VBbmREYXRhKCkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBob25lLmdldFN0YXRlKCkgPT0gUGhvbmUuU3RhdGUuSURMRSApCi0gICAgICAgICAgICAgICAgJiYgaXNEYXRhQWxsb3dlZCgpCi0gICAgICAgICAgICAgICAgJiYgZGVzaXJlZFBvd2VyU3RhdGUKLSAgICAgICAgICAgICAgICAmJiAhbVBlbmRpbmdSZXN0YXJ0UmFkaW8KLSAgICAgICAgICAgICAgICAmJiAhbUNkbWFQaG9uZS5uZWVkc090YVNlcnZpY2VQcm92aXNpb25pbmcoKSkgewotCi0gICAgICAgICAgICByZXR1cm4gc2V0dXBEYXRhKHJlYXNvbik7Ci0KKyAgICAgICAgaWYgKChzdGF0ZSA9PSBTdGF0ZS5JRExFIHx8IHN0YXRlID09IFN0YXRlLlNDQU5OSU5HKSAmJgorICAgICAgICAgICAgICAgIGlzRGF0YUFsbG93ZWQoKSAmJiBnZXRBbnlEYXRhRW5hYmxlZCgpKSB7CisgICAgICAgICAgICBib29sZWFuIHJldFZhbHVlID0gc2V0dXBEYXRhKHJlYXNvbik7CisgICAgICAgICAgICBub3RpZnlPZmZBcG5zT2ZBdmFpbGFiaWxpdHkocmVhc29uLCByZXRWYWx1ZSk7CisgICAgICAgICAgICByZXR1cm4gcmV0VmFsdWU7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxvZygidHJ5U2V0dXBEYXRhOiBOb3QgcmVhZHkgZm9yIGRhdGE6ICIgKwotICAgICAgICAgICAgICAgICAgICAiIGRhdGFTdGF0ZT0iICsgc3RhdGUgKwotICAgICAgICAgICAgICAgICAgICAiIFBTIHN0YXRlPSIgKyBwc1N0YXRlICsKLSAgICAgICAgICAgICAgICAgICAgIiByYWRpbyBzdGF0ZT0iICsgcGhvbmUubUNNLmdldFJhZGlvU3RhdGUoKSArCi0gICAgICAgICAgICAgICAgICAgICIgcnVpbT0iICsgbUNkbWFQaG9uZS5tUnVpbVJlY29yZHMuZ2V0UmVjb3Jkc0xvYWRlZCgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBjb25jdXJyZW50Vm9pY2UmRGF0YT0iICsgbUNkbWFQaG9uZS5tU1NULmlzQ29uY3VycmVudFZvaWNlQW5kRGF0YSgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBwaG9uZVN0YXRlPSIgKyBwaG9uZS5nZXRTdGF0ZSgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBkYXRhRW5hYmxlZD0iICsgZ2V0QW55RGF0YUVuYWJsZWQoKSArCi0gICAgICAgICAgICAgICAgICAgICIgcm9hbWluZz0iICsgcm9hbWluZyArCi0gICAgICAgICAgICAgICAgICAgICIgZGF0YU9uUm9hbWluZ0VuYWJsZT0iICsgZ2V0RGF0YU9uUm9hbWluZ0VuYWJsZWQoKSArCi0gICAgICAgICAgICAgICAgICAgICIgZGVzaXJlZFBvd2VyU3RhdGU9IiArIGRlc2lyZWRQb3dlclN0YXRlICsKLSAgICAgICAgICAgICAgICAgICAgIiBQZW5kaW5nUmVzdGFydFJhZGlvPSIgKyBtUGVuZGluZ1Jlc3RhcnRSYWRpbyArCi0gICAgICAgICAgICAgICAgICAgICIgTWFzdGVyRGF0YUVuYWJsZWQ9IiArIG1NYXN0ZXJEYXRhRW5hYmxlZCArCi0gICAgICAgICAgICAgICAgICAgICIgbmVlZHNPdGFTZXJ2aWNlUHJvdmlzaW9uaW5nPSIgKyBtQ2RtYVBob25lLm5lZWRzT3RhU2VydmljZVByb3Zpc2lvbmluZygpKTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG5vdGlmeU9mZkFwbnNPZkF2YWlsYWJpbGl0eShyZWFzb24sIGZhbHNlKTsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogICAgIH0KQEAgLTM4Miw2ICszODcsNyBAQAogICAgICAgICB9CiAKICAgICAgICAgc2V0U3RhdGUoU3RhdGUuRElTQ09OTkVDVElORyk7CisgICAgICAgIG5vdGlmeURhdGFBdmFpbGFiaWxpdHkocmVhc29uKTsKIAogICAgICAgICBib29sZWFuIG5vdGlmaWNhdGlvbkRlZmVycmVkID0gZmFsc2U7CiAgICAgICAgIGZvciAoRGF0YUNvbm5lY3Rpb24gY29ubiA6IGRhdGFDb25uZWN0aW9uTGlzdCkgewpAQCAtNDQwLDEzICs0NDYsMTMgQEAKICAgICAgICAgY29ubi5jb25uZWN0KG1zZywgbUFjdGl2ZUFwbik7CiAKICAgICAgICAgc2V0U3RhdGUoU3RhdGUuSU5JVElORyk7Ci0gICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CisgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBub3RpZnlEZWZhdWx0RGF0YShTdHJpbmcgcmVhc29uKSB7CiAgICAgICAgIHNldFN0YXRlKFN0YXRlLkNPTk5FQ1RFRCk7Ci0gICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CisgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CiAgICAgICAgIHN0YXJ0TmV0U3RhdFBvbGwoKTsKICAgICAgICAgbVJldHJ5TWdyLnJlc2V0UmV0cnlDb3VudCgpOwogICAgIH0KQEAgLTYyMiwxMiArNjI4LDEzIEBACiAKICAgICBwcml2YXRlIHZvaWQgbm90aWZ5Tm9EYXRhKEZhaWxDYXVzZSBsYXN0RmFpbENhdXNlQ29kZSkgewogICAgICAgICBzZXRTdGF0ZShTdGF0ZS5GQUlMRUQpOworICAgICAgICBub3RpZnlEYXRhQXZhaWxhYmlsaXR5KG51bGwpOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBnb3RvSWRsZUFuZE5vdGlmeURhdGFDb25uZWN0aW9uKFN0cmluZyByZWFzb24pIHsKICAgICAgICAgaWYgKERCRykgbG9nKCJnb3RvSWRsZUFuZE5vdGlmeURhdGFDb25uZWN0aW9uOiByZWFzb249IiArIHJlYXNvbik7CiAgICAgICAgIHNldFN0YXRlKFN0YXRlLklETEUpOwotICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOworICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOwogICAgICAgICBtQWN0aXZlQXBuID0gbnVsbDsKICAgICB9CiAKQEAgLTY4NywxMSArNjk0LDEzIEBACiAgICAgICAgICAgICAvLyBBc3N1bWUgZGF0YSBpcyBjb25uZWN0ZWQgb24gdGhlIHNpbXVsYXRvcgogICAgICAgICAgICAgLy8gRklYTUUgIHRoaXMgY2FuIGJlIGltcHJvdmVkCiAgICAgICAgICAgICBzZXRTdGF0ZShTdGF0ZS5DT05ORUNURUQpOwotICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24obnVsbCk7CisgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihudWxsKTsKIAogICAgICAgICAgICAgTG9nLmkoTE9HX1RBRywgIldlJ3JlIG9uIHRoZSBzaW11bGF0b3I7IGFzc3VtaW5nIGRhdGEgaXMgY29ubmVjdGVkIik7CiAgICAgICAgIH0KIAorICAgICAgICBub3RpZnlEYXRhQXZhaWxhYmlsaXR5KG51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HJpdmF0ZSBpbnQgbU5pdHpVcGRhdGVTcGFjaW5nID0gU3lzdGVtUHJvcGVydGllcy5nZXRJbnQoInJvLm5pdHpfdXBkYXRlX3NwYWNpbmciLApAQCAtNDQ3LDYgKzQ1NCwxMyBAQAogICAgICAgICAgICAgICAgICAgICBpZiAoIW1Jc01pbkluZm9SZWFkeSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbUlzTWluSW5mb1JlYWR5ID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpbnQgb3Rhc3BNb2RlID0gZ2V0T3Rhc3AoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1DdXJyZW50T3Rhc3BNb2RlICE9IG90YXNwTW9kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgImNhbGwgcGhvbmUubm90aWZ5T3Rhc3BDaGFuZ2VkIG9sZCBvdGFzcE1vZGU9IiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50T3Rhc3BNb2RlICsgIiBuZXcgb3Rhc3BNb2RlPSIgKyBvdGFzcE1vZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRPdGFzcE1vZGUgPSBvdGFzcE1vZGU7CisgICAgICAgICAgICAgICAgICAgICAgICBwaG9uZS5ub3RpZnlPdGFzcENoYW5nZWQobUN1cnJlbnRPdGFzcE1vZGUpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIHBob25lLmdldEljY0NhcmQoKS5icm9hZGNhc3RJY2NTdGF0ZUNoYW5nZWRJbnRlbnQoSWNjQ2FyZC5JTlRFTlRfVkFMVUVfSUNDX0lNU0ksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKQEAgLTY0Myw2ICs2NTcsMTEgQEAKICAgICAgICAgY3VyUGxtbiA9IHBsbW47CiAgICAgfQogCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIFBob25lIGdldFBob25lKCkgeworICAgICAgICByZXR1cm4gcGhvbmU7CisgICAgfQorCiAgICAgLyoqCiAgICAgICogSGFuZGxlIHRoZSByZXN1bHQgb2Ygb25lIG9mIHRoZSBwb2xsU3RhdGUoKS1yZWxhdGVkIHJlcXVlc3RzCiAgICAgICovCkBAIC0xMDA4LDcgKzEwMjcsNyBAQAogICAgICAgICBtTmVlZEZpeFpvbmUgPSBmYWxzZTsKIAogICAgICAgICBpZiAoem9uZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBpZiAoZ2V0QXV0b1RpbWUoKSkgeworICAgICAgICAgICAgaWYgKGdldEF1dG9UaW1lWm9uZSgpKSB7CiAgICAgICAgICAgICAgICAgc2V0QW5kQnJvYWRjYXN0TmV0d29ya1NldFRpbWVab25lKHpvbmUuZ2V0SUQoKSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBzYXZlTml0elRpbWVab25lKHpvbmUuZ2V0SUQoKSk7CkBAIC0xMTQwLDcgKzExNTksNyBAQAogICAgICAgICB9CiAKICAgICAgICAgaWYgKGhhc0NkbWFEYXRhQ29ubmVjdGlvbkNoYW5nZWQgfHwgaGFzTmV0d29ya1R5cGVDaGFuZ2VkKSB7Ci0gICAgICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihudWxsKTsKKyAgICAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKG51bGwsIG51bGwpOwogICAgICAgICB9CiAKICAgICAgICAgaWYgKGhhc1JvYW1pbmdPbikgewpAQCAtMTQ2MCw3ICsxNDc5LDcgQEAKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaWYgKHpvbmUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmIChnZXRBdXRvVGltZSgpKSB7CisgICAgICAgICAgICAgICAgaWYgKGdldEF1dG9UaW1lWm9uZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgIHNldEFuZEJyb2FkY2FzdE5ldHdvcmtTZXRUaW1lWm9uZSh6b25lLmdldElEKCkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBzYXZlTml0elRpbWVab25lKHpvbmUuZ2V0SUQoKSk7CkBAIC0xNTUwLDYgKzE1NjksMTQgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHByaXZhdGUgYm9vbGVhbiBnZXRBdXRvVGltZVpvbmUoKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gU2V0dGluZ3MuU3lzdGVtLmdldEludChjciwgU2V0dGluZ3MuU3lzdGVtLkFVVE9fVElNRV9aT05FKSA+IDA7CisgICAgICAgIH0gY2F0Y2ggKFNldHRpbmdOb3RGb3VuZEV4Y2VwdGlvbiBzbmZlKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHByaXZhdGUgdm9pZCBzYXZlTml0elRpbWVab25lKFN0cmluZyB6b25lSWQpIHsKICAgICAgICAgbVNhdmVkVGltZVpvbmUgPSB6b25lSWQ7CiAgICAgfQpAQCAtMTYzNCwxMCArMTY2MSw2IEBACiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKLSAgICBwcm90ZWN0ZWQgdm9pZCBsb2coU3RyaW5nIHMpIHsKLSAgICAgICAgTG9nLmQoTE9HX1RBRywgIltDZG1hU2VydmljZVN0YXRlVHJhY2tlcl0gIiArIHMpOwotICAgIH0KLQogICAgIHB1YmxpYyBTdHJpbmcgZ2V0TWRuTnVtYmVyKCkgewogICAgICAgICByZXR1cm4gbU1kbjsKICAgICB9CkBAIC0xNjkzLDYgKzE3MTYsMzIgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIC8qKgorICAgICAqIFJldHVybnMgT1RBU1BfVU5LTk9XTiwgT1RBU1BfTkVFREVEIG9yIE9UQVNQX05PVF9ORUVERUQKKyAgICAgKi8KKyAgICBpbnQgZ2V0T3Rhc3AoKSB7CisgICAgICAgIGludCBwcm92aXNpb25pbmdTdGF0ZTsKKyAgICAgICAgaWYgKG1NaW4gPT0gbnVsbCB8fCAobU1pbi5sZW5ndGgoKSA8IDYpKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAiZ2V0T3Rhc3A6IGJhZCBtTWluPSciICsgbU1pbiArICInIik7CisgICAgICAgICAgICBwcm92aXNpb25pbmdTdGF0ZSA9IE9UQVNQX1VOS05PV047CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAoKG1NaW4uZXF1YWxzKFVOQUNUSVZBVEVEX01JTl9WQUxVRSkKKyAgICAgICAgICAgICAgICAgICAgfHwgbU1pbi5zdWJzdHJpbmcoMCw2KS5lcXVhbHMoVU5BQ1RJVkFURURfTUlOMl9WQUxVRSkpCisgICAgICAgICAgICAgICAgICAgIHx8IFN5c3RlbVByb3BlcnRpZXMuZ2V0Qm9vbGVhbigidGVzdF9jZG1hX3NldHVwIiwgZmFsc2UpKSB7CisgICAgICAgICAgICAgICAgcHJvdmlzaW9uaW5nU3RhdGUgPSBPVEFTUF9ORUVERUQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHByb3Zpc2lvbmluZ1N0YXRlID0gT1RBU1BfTk9UX05FRURFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAiZ2V0T3Rhc3A6IHN0YXRlPSIgKyBwcm92aXNpb25pbmdTdGF0ZSk7CisgICAgICAgIHJldHVybiBwcm92aXNpb25pbmdTdGF0ZTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBsb2coU3RyaW5nIHMpIHsKKyAgICAgICAgTG9nLmQoTE9HX1RBRywgIltDZG1hU2VydmljZVN0YXRlVHJhY2tlcl0gIiArIHMpOworICA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ZS5JRExFICYmCisgICAgICAgICAgICAgICAgbU1hc3RlckRhdGFFbmFibGVkICYmCisgICAgICAgICAgICAgICAgKCFwaG9uZS5nZXRTZXJ2aWNlU3RhdGUoKS5nZXRSb2FtaW5nKCkgfHwgZ2V0RGF0YU9uUm9hbWluZ0VuYWJsZWQoKSkgJiYKKyAgICAgICAgICAgICAgICAhbUlzUHNSZXN0cmljdGVkICYmCisgICAgICAgICAgICAgICAgZGVzaXJlZFBvd2VyU3RhdGUpOworICAgICAgICBpZiAoIWFsbG93ZWQgJiYgREJHKSB7CisgICAgICAgICAgICBTdHJpbmcgcmVhc29uID0gIiI7CisgICAgICAgICAgICBpZiAoZ3Byc1N0YXRlICE9IFNlcnZpY2VTdGF0ZS5TVEFURV9JTl9TRVJWSUNFKSByZWFzb24gKz0gIiAtIGdwcnM9ICIgKyBncHJzU3RhdGU7CisgICAgICAgICAgICBpZiAoIW1Hc21QaG9uZS5tU0lNUmVjb3Jkcy5nZXRSZWNvcmRzTG9hZGVkKCkpIHJlYXNvbiArPSAiIC0gU0lNIG5vdCBsb2FkZWQiOworICAgICAgICAgICAgaWYgKHBob25lLmdldFN0YXRlKCkgIT0gUGhvbmUuU3RhdGUuSURMRSkgeworICAgICAgICAgICAgICAgIHJlYXNvbiArPSAiIC0gUGhvbmVTdGF0ZT0gIiArIHBob25lLmdldFN0YXRlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIW1NYXN0ZXJEYXRhRW5hYmxlZCkgcmVhc29uICs9ICIgLSBtTWFzdGVyRGF0YUVuYWJsZWQ9IGZhbHNlIjsKKyAgICAgICAgICAgIGlmIChwaG9uZS5nZXRTZXJ2aWNlU3RhdGUoKS5nZXRSb2FtaW5nKCkgJiYgZ2V0RGF0YU9uUm9hbWluZ0VuYWJsZWQoKSkgeworICAgICAgICAgICAgICAgIHJlYXNvbiArPSAiIC0gUm9hbWluZyI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUlzUHNSZX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VU5LTk9XTl9BUE4pOworICAgICAgICAgICAgICAgICAgICBub3RpZnlPZmZBcG5zT2ZBdmFpbGFiaWxpdHkocmVhc29uLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBsb2cgKCJDcmVhdGUgZnJvbSBhbGxBcG5zIDogIiArIGFwbkxpc3RUb1N0cmluZyhhbGxBcG5zKSk7CkBAIC00NjEsMjIgKzQ4MiwxMSBAQAogICAgICAgICAgICAgaWYgKERCRykgewogICAgICAgICAgICAgICAgIGxvZyAoIlNldHVwIHdhaXRuZ0FwbnMgOiAiICsgYXBuTGlzdFRvU3RyaW5nKHdhaXRpbmdBcG5zKSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gc2V0dXBEYXRhKHJlYXNvbik7CisgICAgICAgICAgICBib29sZWFuIHJldFZhbHVlID0gc2V0dXBEYXRhKHJlYXNvbik7CisgICAgICAgICAgICBub3RpZnlPZmZBcG5zT2ZBdmFpbGFiaWxpdHkocmVhc29uLCByZXRWYWx1ZSk7CisgICAgICAgICAgICByZXR1cm4gcmV0VmFsdWU7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoREJHKQotICAgICAgICAgICAgICAgIGxvZygidHJ5U2V0dXBEYXRhOiBOb3QgcmVhZHkgZm9yIGRhdGE6ICIgKwotICAgICAgICAgICAgICAgICAgICAiIGRhdGFTdGF0ZT0iICsgc3RhdGUgKwotICAgICAgICAgICAgICAgICAgICAiIGdwcnNTdGF0ZT0iICsgZ3Byc1N0YXRlICsKLSAgICAgICAgICAgICAgICAgICAgIiBzaW09IiArIG1Hc21QaG9uZS5tU0lNUmVjb3Jkcy5nZXRSZWNvcmRzTG9hZGVkKCkgKwotICAgICAgICAgICAgICAgICAgICAiIFVNVFM9IiArIG1Hc21QaG9uZS5tU1NULmlzQ29uY3VycmVudFZvaWNlQW5kRGF0YSgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBwaG9uZVN0YXRlPSIgKyBwaG9uZS5nZXRTdGF0ZSgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBpc0RhdGFBbGxvd2VkPSIgKyBpc0RhdGFBbGxvd2VkKCkgKwotICAgICAgICAgICAgICAgICAgICAiIGRhdGFFbmFibGVkPSIgKyBnZXRBbnlEYXRhRW5hYmxlZCgpICsKLSAgICAgICAgICAgICAgICAgICAgIiByb2FtaW5nPSIgKyBwaG9uZS5nZXRTZXJ2aWNlU3RhdGUoKS5nZXRSb2FtaW5nKCkgKwotICAgICAgICAgICAgICAgICAgICAiIGRhdGFPblJvYW1pbmdFbmFibGU9IiArIGdldERhdGFPblJvYW1pbmdFbmFibGVkKCkgKwotICAgICAgICAgICAgICAgICAgICAiIHBzIHJlc3RyaWN0ZWQ9IiArIG1Jc1BzUmVzdHJpY3RlZCArCi0gICAgICAgICAgICAgICAgICAgICIgZGVzaXJlZFBvd2VyU3RhdGU9IiArIGRlc2lyZWRQb3dlclN0YXRlICsKLSAgICAgICAgICAgICAgICAgICAgIiBNYXN0ZXJEYXRhRW5hYmxlZD0iICsgbU1hc3RlckRhdGFFbmFibGVkKTsKKyAgICAgICAgICAgIG5vdGlmeU9mZkFwbnNPZkF2YWlsYWJpbGl0eShyZWFzb24sIGZhbHNlKTsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogICAgIH0KQEAgLTU5NSw0NiArNjA1LDEwIEBACiAgICAgICAgIHBkcC5jb25uZWN0KG1zZywgYXBuKTsKIAogICAgICAgICBzZXRTdGF0ZShTdGF0ZS5JTklUSU5HKTsKLSAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKKyAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCi0gICAgcHJvdGVjd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gICB9Ci0gICAgICAgIHJldHVybiBudWxsOwotICAgIH0KLQotICAgIHByb3RlY3RlZCBTdHJpbmdbXSBnZXREbnNTZXJ2ZXJzKFN0cmluZyBhcG5UeXBlKSB7Ci0gICAgICAgIGlmIChtQWN0aXZlUGRwICE9IG51bGwgJiYKLSAgICAgICAgICAgICAgICAoYXBuVHlwZSA9PSBudWxsIHx8Ci0gICAgICAgICAgICAgICAgKG1BY3RpdmVBcG4gIT0gbnVsbCAmJiBtQWN0aXZlQXBuLmNhbkhhbmRsZVR5cGUoYXBuVHlwZSkpKSkgewotICAgICAgICAgICAgcmV0dXJuIG1BY3RpdmVQZHAuZ2V0RG5zU2VydmVycygpOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBudWxsOwotICAgIH0KLQogICAgIHByaXZhdGUgYm9vbGVhbgogICAgIHBkcFN0YXRlc0hhc0NJRCAoQXJyYXlMaXN0PERhdGFDYWxsU3RhdGU+IHN0YXRlcywgaW50IGNpZCkgewogICAgICAgICBmb3IgKGludCBpID0gMCwgcyA9IHN0YXRlcy5zaXplKCkgOyBpIDwgcyA7IGkrKykgewpAQCAtNzQ2LDcgKzcyMCw3IEBACiAKICAgICBwcml2YXRlIHZvaWQgbm90aWZ5RGVmYXVsdERhdGEoU3RyaW5nIHJlYXNvbikgewogICAgICAgICBzZXRTdGF0ZShTdGF0ZS5DT05ORUNURUQpOwotICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOworICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOwogICAgICAgICBzdGFydE5ldFN0YXRQb2xsKCk7CiAgICAgICAgIC8vIHJlc2V0IHJlY29ubmVjdCB0aW1lcgogICAgICAgICBtUmV0cnlNZ3IucmVzZXRSZXRyeUNvdW50KCk7CkBAIC03NTYsNyArNzMwLDcgQEAKICAgICBwcml2YXRlIHZvaWQgZ290b0lkbGVBbmROb3RpZnlEYXRhQ29ubmVjdGlvbihTdHJpbmcgcmVhc29uKSB7CiAgICAgICAgIGlmIChEQkcpIGxvZygiZ290b0lkbGVBbmROb3RpZnlEYXRhQ29ubmVjdGlvbjogcmVhc29uPSIgKyByZWFzb24pOwogICAgICAgICBzZXRTdGF0ZShTdGF0ZS5JRExFKTsKLSAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKKyAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKICAgICAgICAgbUFjdGl2ZUFwbiA9IG51bGw7CiAgICAgfQogCkBAIC05OTgsNyArOTcyLDcgQEAKICAgICAgICAgICAgIGlmICghbVJldHJ5TWdyLmlzUmV0cnlOZWVkZWQoKSkgewogICAgICAgICAgICAgICAgIGlmICghbVJlcXVlc3RlZEFwblR5cGUuZXF1YWxzKFBob25lLkFQTl9UWVBFX0RFRkFVTFQpKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIGlmIG5vIG1vcmUgcmV0cmllcyBvbiBhIHNlY29uZGFyeSBBUE4gYXR0ZW1wdCwgdGVsbCB0aGUgd29ybGQgYW5kIHJldmVydC4KLSAgICAgICAgICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24oUGhvbmUuUkVBU09OX0FQTl9GQUlMRUQpOworICAgICAgICAgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihQaG9uZS5SRUFTT05fQVBOX0ZBSUxFRCk7CiAgICAgICAgICAgICAgICAgICAgIG9uRW5hYmxlQXBuKGFwblR5cGVUb0lkKG1SZXF1ZXN0ZWRBcG5UeXBlKSwgRElTQUJMRUQpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQpAQCAtMTA5MSw3ICsxMDY1LDcgQEAKICAgICAgICAgICAgIC8vIEFzc3VtZSBkYXRhIGlzIGNvbm5lY3RlZCBvbiB0aGUgc2ltdWxhdG9yCiAgICAgICAgICAgICAvLyBGSVhNRSAgdGhpcyBjYW4gYmUgaW1wcm92ZWQKICAgICAgICAgICAgIHNldFN0YXRlKFN0YXRlLkNPTk5FQ1RFRCk7Ci0gICAgICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihudWxsKTsKKyAgICAgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKG51bGwpOwogCiAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiV2UncmUgb24gdGhlIHNpbXVsYXRvcjsgYXNzdW1pbmcgZGF0YSBpcyBjb25uZWN0ZWQiKTsKICAgICAgICAgfQpAQCAtMTEyNSw2ICsxMDk5LDI3IEBACiAgICAgICAgIH0KIAogICAgICAgICBpZiAoYXIuZXhjZXB0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgIC8vIFRPRE86IFdlIHNob3VsZCBjbGVhciBMaW5rUHJvcGVydGllcy9DYXBhYmlsaXRpZXMgd2hlbiB0b3JuIGRvd24gb3IgZGlzY29ubmVjdGVkCisgICAgICAgICAgICBtTGlua1Byb3BlcnRpZXMgPSBnZXRMaW5rUHJvcGVydGllcyhtQWN0aXZlUGRwKTsKKyAgICAgICAgICAgIG1MaW5rQ2FwYWJpbGl0aWVzID0gZ2V0TGlua0NhcGFiaWxpdGllcyhtQWN0aXZlUGRwKTsKKworICAgICAgICAgICAgQXBuU2V0dGluZyBhcG4gPSBtQWN0aXZlUGRwLmdldEFwbigpOworICAgICAgICAgICAgaWYgKGFwbi5wcm94eSAhPSBudWxsICYmIGFwbi5wcm94eS5sZW5ndGgoKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgUHJveHlQcm9wZXJ0aWVzIHByb3h5ID0gbmV3IFByb3h5UHJvcGVydGllcygpOworICAgICAgICAgICAgICAgICAgICBwcm94eS5zZXRTb2NrZXRBZGRyZXNzKG5ldyBJbmV0U29ja2V0QWRkcmVzcyhJbmV0QWRkcmVzcy5nZXRCeU5hbWUoYXBuLnByb3h5KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyLnBhcnNlSW50KGFwbi5wb3J0KSkpOworICAgICAgICAgICAgICAgICAgICBtTGlua1Byb3BlcnRpZXMuc2V0SHR0cFByb3h5KHByb3h5KTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChVbmtub3duSG9zdEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJVbmtub3duSG9zdEV4Y2VwdGlvbiBtYWtpbmcgUHJveHlQcm9wZXJ0aWVzOiAiICsgZSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoU2VjdXJpdHlFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiU2VjdXJpdHlFeGNlcHRpb24gbWFraW5nIFByb3h5UHJvcGVydGllczogIiArIGUpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJOdW1iZXJGb3JtYXRFeGNlcHRpb24gbWFraW5nIFByb3h5UHJvcGVydGllcyAoIiArIGFwbi5wb3J0ICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKTogIiArIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgLy8gZXZlcnl0aGluZyBpcyBzZXR1cAogICAgICAgICAgICAgaWYgKGlzQXBuVHlwZUFjdGl2ZShQaG9uZS5BUE5fVFlQRV9ERUZBVUxUKSkgewogICAgICAgICAgICAgICAgIFN5c3RlbVByb3BlcnRpZXMuc2V0KCJnc20uZGVmYXVsdHBkcGNvbnRleHQuYWN0aXZlIiwgInRydWUiKTsKQEAgLTExNTcsNyArMTE1Miw3IEBACiAgICAgICAgICAgICAvLyBObyB0cnkgZm9yIHBlcm1hbmVudCBmYWlsdXJlCiAgICAgICAgICAgICBpZiAoY2F1c2UuaXNQZXJtYW5lbnRGYWlsKCkpIHsKICAgICAgICAgICAgICAgICBub3RpZnlOb0RhdGEoY2F1c2UpOwotICAgICAgICAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKFBob25lLlJFQVNPTl9BUE5fRkFJTEVEKTsKKyAgICAgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihQaG9uZS5SRUFTT05fQVBOX0ZBSUxFRCk7CiAgICAgICAgICAgICAgICAgb25FbmFibGVBcG4oYXBuVHlwZVRvSWQobVJlcXVlc3RlZEFwblR5cGUpLCBESVNBQkxFRCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQpAQCAtMTE4Niw3ICsxMTgxLDcgQEAKICAgICAgICAgICAgcmVhc29uID0gKFN0cmluZykgYXIudXNlck9iajsKICAgICAgICAgfQogICAgICAgICBzZXRTdGF0ZShTdGF0ZS5JRExFKTsKLSAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKKyAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKICAgICAgICAgbUFjdGl2ZUFwbiA9IG51bGw7CiAgICAgICAgIGlmIChyZXRyeUFmdGVyRGlzY29ubmVjdGVkKHJlYXNvbikpIHsKICAgICAgICAgICAgIHRyeVNldHVwRGF0YShyZWFzb24pOwpAQCAtMTIxNyw3ICsxMjEyLDcgQEAKICAgICBwcm90ZWN0ZWQgdm9pZCBvblZvaWNlQ2FsbFN0YXJ0ZWQoKSB7CiAgICAgICAgIGlmIChzdGF0ZSA9PSBTdGF0ZS5DT05ORUNURUQgJiYgISBtR3NtUGhvbmUubVNTVC5pc0NvbmN1cnJlbnRWb2ljZUFuZERhdGEoKSkgewogICAgICAgICAgICAgc3RvcE5ldFN0YXRQb2xsKCk7Ci0gICAgICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmV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Niw2ICsyNTAsMTEgQEAKICAgICAgICAgaWYoREJHKSBMb2cuZChMT0dfVEFHLCAiR3NtU2VydmljZVN0YXRlVHJhY2tlciBmaW5hbGl6ZWQiKTsKICAgICB9CiAKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgUGhvbmUgZ2V0UGhvbmUoKSB7CisgICAgICAgIHJldHVybiBwaG9uZTsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBSZWdpc3RyYXRpb24gcG9pbnQgZm9yIHRyYW5zaXRpb24gaW50byBHUFJTIGF0dGFjaGVkLgogICAgICAqIEBwYXJhbSBoIGhhbmRsZXIgdG8gbm90aWZ5CkBAIC0xMDAxLDcgKzEwMTAsNyBAQAogICAgICAgICAgICAgICAgICAgICBtTmVlZEZpeFpvbmUgPSBmYWxzZTsKIAogICAgICAgICAgICAgICAgICAgICBpZiAoem9uZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0QXV0b1RpbWUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdldEF1dG9UaW1lWm9uZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0QW5kQnJvYWRjYXN0TmV0d29ya1NldFRpbWVab25lKHpvbmUuZ2V0SUQoKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBzYXZlTml0elRpbWVab25lKHpvbmUuZ2V0SUQoKSk7CkBAIC0xMDI0LDcgKzEwMzMsOCBAQAogICAgICAgICB9CiAKICAgICAgICAgaWYgKGhhc05ldHdvcmtUeXBlQ2hhbmdlZCkgewotICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24obnVsbCk7CisgICAgICAgICAgICAvLyBUT0RPIC0gZG8gd2UgcmVhbGx5IHdhbnQgdGhpcz8KKyAgICAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKG51bGwsIG51bGwpOwogICAgICAgICB9CiAKICAgICAgICAgaWYgKGhhc1JvYW1pbmdPbikgewpAQCAtMTQ4MSw3ICsxNDkxLDcgQEAKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaWYgKHpvbmUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmIChnZXRBdXRvVGltZSgpKSB7CisgICAgICAgICAgICAgICAgaWYgKGdldEF1dG9UaW1lWm9uZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgIHNldEFuZEJyb2FkY2FzdE5ldHdvcmtTZXRUaW1lWm9uZSh6b25lLmdldElEKCkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBzYXZlTml0elRpbWVab25lKHpvbmUuZ2V0SUQoKSk7CkBAIC0xNTUxLDYgKzE1NjEsMTUgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHByaXZhdGUgYm9vbGVhbiBnZXRBdXRvVGltZVpvbmUoKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gU2V0dGluZ3MuU3lzdGVtLmdldEludChwaG9uZS5nZXRDb250ZXh0KCkuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlN5c3RlbS5BVVRPX1RJTUVfWk9ORSkgPiAwOworICAgICAgICB9IGNhdGNoIChTZXR0aW5nTm90Rm91bmRFeGNlcHRpb24gc25mZSkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICB9CisKICAgICBwcml2YXRlIHZvaWQgc2F2ZU5pdHpUaW1lWm9uZShTdHJpbmcgem9uZUlkKSB7CiAgICAgICAgIG1TYXZlZFRpbWVab25lID0gem9uZUlkOwogICAgIH0KQEAgLTE2NjYsNyArMTY4NSw4IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgbG9nKFN0cmluZyBzKSB7CisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkI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duaWZpY2FudCBuaWJibGUgaXMgdGhlIHNpZ24gYnl0ZQogICAgICAgICAgICAgLy8gKG1lYW5pbmcgdGhlIG1heCByYW5nZSBvZiB0aGlzIGZpZWxkIGlzIDc5IHF1YXJ0ZXItaG91cnMsCiAgICAgICAgICAgICAvLyB3aGljaCBpcyBtb3JlIHRoYW4gZW5vdWdoKQogCkBAIC02MzIsNyArNjI4LDcgQEAKICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAqIEhlcmUgd2UganVzdCBjcmVhdGUgdGhlIHVzZXIgZGF0YSBsZW5ndGggdG8gYmUgdGhlIHJlbWFpbmRlciBvZgogICAgICAgICAgICAgICAgICAqIHRoZSBwZHUgbWludXMgdGhlIHVzZXIgZGF0YSBoZWFkZXIsIHNpbmNlIHVzZXJEYXRhTGVuZ3RoIG1lYW5zCi0gICAgICAgICAgICAgICAgICogdGhlIG51bWJlciBvZiB1bmNvbXByZXNzZWQgc2VwZXRzLgorICAgICAgICAgICAgICAgICAqIHRoZSBudW1iZXIgb2YgdW5jb21wcmVzc2VkIHNlcHRldHMuCiAgICAgICAgICAgICAgICAgICovCiAgICAgICAgICAgICAgICAgYnVmZmVyTGVuID0gcGR1Lmxlbmd0aCAtIG9mZnNldDsKICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC02NzEsMTAgKzY2NywxMCBAQAogICAgICAgICB9CiAKICAgICAgICAgLyoqCi0gICAgICAgICAqIFJldHVybnMgdGhlIG51bWJlciBvZiBwYWRkaW5nIGJpdHMgYXQgdGhlIGJlZ2luaW5nIG9mIHRoZSB1c2VyIGRhdGEKKyAgICAgICAgICogUmV0dXJucyB0aGUgbnVtYmVyIG9mIHBhZGRpbmcgYml0cyBhdCB0aGUgYmVnaW5uaW5nIG9mIHRoZSB1c2VyIGRhdGEKICAgICAgICAgICogYXJyYXkgYmVmb3JlIHRoZSBzdGFydCBvZiB0aGUgc2VwdGV0cy4KICAgICAgICAgICoKLSAgICAgICAgICogQHJldHVybiB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aW5nLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gYnl0ZUNvdW50IHRoZSBudW1iZXIgb2YgYnl0ZXMgaW4gdGhlIHVzZXIgZGF0YSBwYXlsb2FkCisgICAgICAgICAqIEByZXR1cm4gYSBTdHJpbmcgd2l0aCB0aGUgZGVjb2RlZCBjaGFyYWN0ZXJzCisgICAgICAgICAqLworICAgICAgICBTdHJpbmcgZ2V0VXNlckRhdGFLU0M1NjAxKGludCBieXRlQ291bnQpIHsKKyAgICAgICAgICAgIFN0cmluZyByZXQ7CisKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0ID0gbmV3IFN0cmluZyhwZHUsIGN1ciwgYnl0ZUNvdW50LCAiS1NDNTYwMSIpOworICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgIHJldCA9ICIiOworICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJpbXBsYXVzaWJsZSBVbnN1cHBvcnRlZEVuY29kaW5nRXhjZXB0aW9uIiwgZXgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjdXIgKz0gYnl0ZUNvdW50OworICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgfQorCiAgICAgICAgIGJvb2xlYW4gbW9yZURhdGFQcmVzZW50KCkgewogICAgICAgICAgICAgcmV0dXJuIChwZHUubGVuZ3RoID4gY3VyKTsKICAgICAgICAgfQpAQCAtODI3LDExICs4NDQsMTMgQEAKICAgICB9CiAKICAgICAvKioge0Bpbmhlcml0RG9jfSAqLworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBpbnQgZ2V0UHJvdG9jb2xJZGVudGlmaWVyKCkgewogICAgICAgICByZXR1cm4gcHJvdG9jb2xJZGVudGlmaWVyOwogICAgIH0KIAogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCisgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gaXNSZXBsYWNlKCkgewogICAgICAgICByZXR1cm4gKHByb3RvY29sSWRlbnRpZmllciAmIDB4YzApID09IDB4NDAKICAgICAgICAgICAgICAgICAmJiAocHJvdG9jb2xJZGVudGlmaWVyICYgMHgzZikgPiAwCkBAIC04MzksMTIgKzg1OCwxNCBAQAogICAgIH0KIAogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCisgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gaXNDcGhzTXdpTWVzc2FnZSgpIHsKICAgICAgICAgcmV0dXJuICgoR3NtU21zQWRkcmVzcykgb3JpZ2luYXRpbmdBZGRyZXNzKS5pc0NwaHNWb2ljZU1lc3NhZ2VDbGVhcigpCiAgICAgICAgICAgICAgICAgfHwgKChHc21TbXNBZGRyZXNzKSBvcmlnaW5hdGluZ0FkZHJlc3MpLmlzQ3Boc1ZvaWNlTWVzc2FnZVNldCgpOwogICAgIH0KIAogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCisgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gaXNNV0lDbGVhck1lc3NhZ2UoKSB7CiAgICAgICAgIGlmIChpc013aSAmJiAobXdpU2Vuc2UgPT0gZmFsc2UpKSB7CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKQEAgLTg1NSw2ICs4NzYsNyBAQAogICAgIH0KIAogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCisgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gaXNNV0lTZXRNZXNzYWdlKCkgewogICAgICAgICBpZiAoaXNNd2kgJiYgKG13aVNlbnNlID09IHRydWUpKSB7CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKQEAgLTg2NSw2ICs4ODcsNyBAQAogICAgIH0KIAogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCisgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gaXNNd2lEb250U3RvcmUoKSB7CiAgICAgICAgIGlmIChpc013aSAmJiBtd2lEb250U3RvcmUpIHsKICAgICAgICAgICAgIHJldHVybiB0cnVlOwpAQCAtODg0LDMxICs5MDcsMzQgQEAKICAgICB9CiAKICAgICAvKioge0Bpbmhlcml0RG9jfSAqLworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBpbnQgZ2V0U3RhdHVzKCkgewogICAgICAgICByZXR1cm4gc3RhdHVzOwogICAgIH0KIAogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCisgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gaXNTdGF0dXNSZXBvcnRNZXNzYWdlKCkgewogICAgICAgICByZXR1cm4gaXNTdGF0dXNSZXBvcnRNZXNzYWdlOwogICAgIH0KIAogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCisgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gaXNSZXBseVBhdGhQcmVzZW50KCkgewogICAgICAgICByZXR1cm4gcmVwbHlQYXRoUHJlc2VudDsKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBUUyAyNy4wMDUgMy4xLCA8cGR1PiBkZWZpbml0aW9uICJJbiB0aGUgY2FzZSBvZiBTTVM6IDNHUFAgVFMgMjQuMDExIFs2XQorICAgICAqIFRTIDI3LjAwNSAzLjEsICZsdDtwZHUmZ3Q7IGRlZmluaXRpb24gIkluIHRoZSBjYXNlIG9mIFNNUzogM0dQUCBUUyAyNC4wMTEgWzZdCiAgICAgICogU0MgYWRkcmVzcyBmb2xsb3dlZCBieSAzR1BQIFRTIDIzLjA0MCBbM10gVFBEVSBpbiBoZXhhZGVjaW1hbCBmb3JtYXQ6CiAgICAgICogTUUvVEEgY29udmVydHMgZWFjaCBvY3RldCBvZiBUUCBkYXRhIHVuaXQgaW50byB0d28gSVJBIGNoYXJhY3RlciBsb25nCi0gICAgICogaGV4YWQgbnVtYmVyIChlLmcuIG9jdGV0IHdpdGggaW50ZWdlciB2YWx1ZSA0MiBpcyBwcmVzZW50ZWQgdG8gVEUgYXMgdHdvCisgICAgICogaGV4IG51bWJlciAoZS5nLiBvY3RldCB3aXRoIGludGVnZXIgdmFsdWUgNDIgaXMgcHJlc2VudGVkIHRvIFRFIGFzIHR3bwogICAgICAqIGNoYXJhY3RlcnMgMkEgKElSQSA1MCBhbmQgNjUpKSIgLi4uaW4gdGhlIGNhc2Ugb2YgY2VsbCBicm9hZGNhc3QsCiAgICAgICogc29tZXRoaW5nIGVsc2UuLi4KICAgICAgKi8KICAgICBwcml2YXRlIHZvaWQgcGFyc2VQZHUoYnl0ZVtdIHBkdSkgewogICAgICAgICBtUGR1ID0gcGR1OwotICAgICAgICAvLyBMb2cuZChMT0dfVEFHLCAicmF3IHNtcyBtZXNhZ2U6Iik7CisgICAgICAgIC8vIExvZy5kKExPR19UQUcsICJyYXcgc21zIG1lc3NhZ2U6Iik7CiAgICAgICAgIC8vIExvZy5kKExPR19UQUcsIHMpOwogCiAgICAgICAgIFBkdVBhcnNlciBwID0gbmV3IFBkdVBhcnNlcihwZHUpOwpAQCAtMTEwNyw2ICsxMTMzLDE2IEBACiAgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIk1XSSBmb3IgZmF4LCBlbWFpbCwgb3Igb3RoZXIgIgogICAgICAgICAgICAgICAgICAgICAgICAgKyAoZGF0YUNvZGluZ1NjaGVtZSAmIDB4ZmYpKTsKICAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmICgoZGF0YUNvZGluZ1NjaGVtZSAmIDB4QzApID09IDB4ODApIHsKKyAgICAgICAgICAgIC8vIDNHUFAgVFMgMjMuMDM4IFY3LjAuMCAoMjAwNi0wMykgc2VjdGlvbiA0CisgICAgICAgICAgICAvLyAweDgwLi4weEJGID09IFJlc2VydmVkIGNvZGluZyBncm91cHMKKyAgICAgICAgICAgIGlmIChkYXRhQ29kaW5nU2NoZW1lID09IDB4ODQpIHsKKyAgICAgICAgICAgICAgICAvLyBUaGlzIHZhbHVlIHVzZWQgZm9yIEtTQzU2MDEgYnkgY2FycmllcnMgaW4gS29yZWEuCisgICAgICAgICAgICAgICAgZW5jb2RpbmdUeXBlID0gRU5DT0RJTkdfS1NDNTYwMTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIjUgLSBVbnN1cHBvcnRlZCBTTVMgZGF0YSBjb2Rpbmcgc2NoZW1lICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgKGRhdGFDb2RpbmdTY2hlbWUgJiAweGZmKSk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiMyAtIFVuc3VwcG9ydGVkIFNNUyBkYXRhIGNvZGluZyBzY2hlbWUgIgogICAgICAgICAgICAgICAgICAgICArIChkYXRhQ29kaW5nU2NoZW1lICYgMHhmZikpOwpAQCAtMTEzMSw2ICsxMTY3LDEwIEBACiAgICAgICAgIGNhc2UgRU5DT0RJTkdfMTZCSVQ6CiAgICAgICAgICAgICBtZXNzYWdlQm9keSA9IHAuZ2V0VXNlckRhdGFVQ1MyKGNvdW50KTsKICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgRU5DT0RJTkdfS1NDNTYwMToKKyAgICAgICAgICAgIG1lc3NhZ2VCb2R5ID0gcC5nZXRVc2VyRGF0YUtTQzU2MDEoY291bnQpOworICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KIAogICAgICAgICBpZiAoQ29uZmlnLkxPR1YpIExvZy52KExPR19UQUcsICJTTVMgbWVzc2FnZSBib2R5IChyYXcpOiAnIiArIG1lc3NhZ2VCb2R5ICsgIiciKTsKQEAgLTExNjIsNiArMTIwMiw3IEBACiAgICAgLyoqCiAgICAgICoge0Bpbmhlcml0RG9jfQogICAgICAqLworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBNZXNzYWdlQ2xhc3MgZ2V0T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U1NTQxNDEiLAotICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZXh0cmFjdE5ldHdvcmtQb3J0aW9uKCIxICg3MDApLjU1NS00MTQxIikKLSAgICAgICAgKTsKLQotICAgICAgICAvLyBUaGlzIG1heSBzZWVtIHdyb25nLCBidXQgaXQncyBwcm9iYWJseSBvawotICAgICAgICBhc3NlcnRFcXVhbHMoCi0gICAgICAgICAgICAgICAgIjE3MDA1NTU0MTQxKiMiLAotICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZXh0cmFjdE5ldHdvcmtQb3J0aW9uKCIxICg3MDApLjU1NS00MTQxKiMiKQotICAgICAgICApOwotCi0gICAgICAgIGFzc2VydEVxdWFscygKLSAgICAgICAgICAgICAgICAiMTcwMDU1NTQxTk4iLAotICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZXh0cmFjdE5ldHdvcmtQb3J0aW9uKCIxICg3MDApLjU1NS00MU5OIikKLSAgICAgICAgKTsKLQotICAgICAgICBhc3NlcnRFcXVhbHMoCi0gICAgICAgICAgICAgICAgIjE3MDA1NTU0MU5OIiwKLSAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbigiMSAoNzAwKS41NTUtNDFOTiwxMjM0IikKLSAgICAgICAgKTsKLQotICAgICAgICBhc3NlcnRFcXVhbHMoCi0gICAgICAgICAgICAgICAgIjE3MDA1NTU0MU5OIiwKLSAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbigiMSAoNzAwKS41NTUtNDFOTjsxMjM0IikKLSAgICAgICAgKTsKLQotICAgICAgICAvLyBBbiBNTUkgc3RyaW5nIGlzIHVucGVydGVyYmVkLCBldmVuIHRob3VnaCBpdCBjb250YWlucyBhCi0gICAgICAgIC8vICh2YWxpZCBpbiB0aGlzIGNhc2UpIGVtYmVkZGVkICsKLSAgICAgICA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AoNzAwKS41NTUtNDE0MSIpCi0gICAgICAgICk7Ci0KLSAgICAgICAgLy8gVGhpcyBtYXkgc2VlbSB3cm9uZywgYnV0IGl0J3MgcHJvYmFibHkgb2sKLSAgICAgICAgYXNzZXJ0RXF1YWxzKAotICAgICAgICAgICAgICAgICIxNzAwNTU1NDE0MSojIiwKLSAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbkFsdCgiMSAoNzAwKS41NTUtNDE0MSojIikKLSAgICAgICAgKTsKLQotICAgICAgICBhc3NlcnRFcXVhbHMoCi0gICAgICAgICAgICAgICAgIjE3MDA1NTU0MU5OIiwKLSAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbkFsdCgiMSAoNzAwKS41NTUtNDFOTiIpCi0gICAgICAgICk7Ci0KLSAgICAgICAgYXNzZXJ0RXF1YWxzKAotICAgICAgICAgICAgICAgICIxNzAwNTU1NDFOTiIsCi0gICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5leHRyYWN0TmV0d29ya1BvcnRpb25BbHQoIjEgKDcwMCkuNTU1LTQxTk4sMTIzNCIpCi0gICAgICAgICk7Ci0KLSAgICAgICAgYXNzZXJ0RXF1YWxzKAotICAgICAgICAgICAgICAgICIxNzAwNTU1NDFOTiIsCi0gICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5leHRyYWN0TmV0d29ya1BvcnRpb25BbHQoIjEgKDcwMCkuNTU1LTQxTk47MTIzNCIpCi0gICAgICAgICk7Ci0KLSAgICAgICAgLy8gQW4gTU1JIHN0cmluZyBpcyB1bnBlcnRlcmJlZCwgZXZlbiB0aG91Z2ggaXQgY29udGFpbnMgYQotICAgICAgICAvLyAodmFsaWQgaW4gdGhpcyBjYXNlKSBlbWJlZGRlZCArCi0gICAgICAgIGFzc2VydEVxdWFscygKLSAgICAgICAgICAgICAgICAiKioyMS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ICAgICAgIFBob25lTnVtYmVyVXRpbHMuZm9ybWF0TmFucE51bWJlcihudW1iZXIpOwotICAgICAgICBhc3NlcnRFcXVhbHMoIjgwMC01NTUtMTIxMiIsIG51bWJlci50b1N0cmluZygpKTsKLQotICAgICAgICBudW1iZXIuY2xlYXIoKTsKLSAgICAgICAgbnVtYmVyLmFwcGVuZCgiODAwNTU1MTIxIik7Ci0gICAgICAgIFBob25lTnVtYmVyVXRpbHMuZm9ybWF0TmFucE51bWJlcihudW1iZXIpOwotICAgICAgICBhc3NlcnRFcXVhbHMoIjgwMC01NTUtMTIxIiwgbnVtYmVyLnRvU3RyaW5nKCkpOwotCi0gICAgICAgIG51bWJlci5jbGVhcigpOwotICAgICAgICBudW1iZXIuYXBwZW5kKCI1NTUtMTIxMiIpOwotICAgICAgICBQaG9uZU51bWJlclV0aWxzLmZvcm1hdE5hbnBOdW1iZXIobnVtYmVyKTsKLSAgICAgICAgYXNzZXJ0RXF1YWxzKCI1NTUtMTIxMiIsIG51bWJlci50b1N0cmluZygpKTsKLQotICAgICAgICBudW1iZXIuY2xlYXIoKTsKLSAgICAgICAgbnVtYmVyLmFwcGVuZCgiODAwLTU1NTEyIik7Ci0gICAgICAgIFBob25lTnVtYmVyVXRpbHMuZm9ybWF0TmFucE51bWJlcihudW1iZXIpOwotICAgICAgICBhc3NlcnRFcXVhbHMoIjgwMC01NTUtMTIiLCBudW1iZXIudG9TdHJpbmcoKSk7Ci0KLSAgICAgICAgbnVtYmVyLmNsZWFyKCk7Ci0gICAgICAgIG51bWJlci5hcHBlbmQoIjQ2NjQ1Iik7Ci0gICAgICAgIFBob25lTnVtYmVyVXRpbHMuZm9ybWF0TmFucE51bWJlcihudW1iZXIpOwotICAgICAgICBhc3NlcnRFcXVhbHMoIjQ2NjQ1IiwgbnVtYmVyLnRvU3RyaW5nKCkpOwotICAgIH0KLQotICAgIEBTbWFsbFRlc3QKLSAgICBwdWJsaWMgdm9pZCB0ZXN0Q29udmVydEtleXBhZExldH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leHQuU3Bhbm5hYmxlU3RyaW5nQnVpbGRlcjsKK2ltcG9ydCBhbmRyb2lkLnRlbGVwaG9ueS5QaG9uZU51bWJlclV0aWxzOworCitwdWJsaWMgY2xhc3MgUGhvbmVOdW1iZXJVdGlsc1Rlc3QgZXh0ZW5kcyBBbmRyb2lkVGVzdENhc2UgeworCisgICAgQFNtYWxsVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RFeHRyYWN0TmV0d29ya1BvcnRpb24oKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKAorICAgICAgICAgICAgICAgICIrMTcwMDU1NTQxNDEiLAorICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZXh0cmFjdE5ldHdvcmtQb3J0aW9uKCIrMTcwMDU1NTQxNDEiKQorICAgICAgICApOworCisgICAgICAgIGFzc2VydEVxdWFscygKKyAgICAgICAgICAgICAgICAiKzE3MDA1NTU0MTQxIiwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbigiKzEgKDcwMCkuNTU1LTQxNDEiKQorICAgICAgICApOworCisgICAgICAgIGFzc2VydEVxdWFscygKKyAgICAgICAgICAgICAgICAiMTcwMDU1NTQxNDEiLAorICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZXh0cmFjdE5ldHdvcmtQb3J0aW9uKCIxICg3MDApLjU1NS00MTQxIikKKyAgICAgICAgKTsKKworICAgICAgICAvLyBUaGlzIG1heSBzZWVtIHdyb25nLCBidXQgaXQncyBwcm9iYWJseSBvaworICAgICAgICBhc3NlcnRFcXVhbHMoCisgICAgICAgICAgICAgICAgIjE3MDA1NTU0MTQxKiMiLAorICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZXh0cmFjdE5ldHdvcmtQb3J0aW9uKCIxICg3MDApLjU1NS00MTQxKiMiKQorICAgICAgICApOworCisgICAgICAgIGFzc2VydEVxdWFscygKKyAgICAgICAgICAgICAgICAiMTcwMDU1NTQxTk4iLAorICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZXh0cmFjdE5ldHdvcmtQb3J0aW9uKCIxICg3MDApLjU1NS00MU5OIikKKyAgICAgICAgKTsKKworICAgICAgICBhc3NlcnRFcXVhbHMoCisgICAgICAgICAgICAgICAgIjE3MDA1NTU0MU5OIiwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbigiMSAoNzAwKS41NTUtNDFOTiwxMjM0IikKKyAgICAgICAgKTsKKworICAgICAgICBhc3NlcnRFcXVhbHMoCisgICAgICAgICAgICAgICAgIjE3MDA1NTU0MU5OIiwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbigiMSAoNzAwKS41NTUtNDFOTjsxMjM0IikKKyAgICAgICAgKTsKKworICAgICAgICAvLyBBbiBNTUkgc3RyaW5nIGlzIHVucGVydGVyYmVkLCBldmVuIHRob3VnaCBpdCBjb250YWlucyBhCisgICAgICAgIC8vICh2YWxpZCBpbiB0aGlzIGNhc2UpIGVtYmVkZGVkICsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKAorICAgICAgICAgICAgICAgICIqKjIxKioxNzAwNTU1NDE0MSMiLAorICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZXh0cmFjdE5ldHdvcmtQb3J0aW9uKCIqKjIxKiorMTcwMDU1NTQxNDEjIikKKyAgICAgICAgICAgICAgICAvL1RPRE8gdGhpcyBpcyB0aGUgY29ycmVjdCByZXN1bHQsIGFsdGhvdWdoIHRoZSBhYm92ZQorICAgICAgICAgICAgICAgIC8vcmVzdWx0IGhhcyBiZWVuIHJldHVybmVkIHNpbmNlIGNoYW5nZSAzMTc3NgorICAgICAgICAgICAgICAgIC8vIioqMjEqKisxNzAwNTU1NDE0MSMiCis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Mgdm9pZCB0ZXN0RXh0cmFjdE5ldHdvcmtQb3J0aW9uQWx0KCkgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgICAgIGFzc2VydEVxdWFscygKKyAgICAgICAgICAgICAgICAiKzE3MDA1NTU0MTQxIiwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbkFsdCgiKzE3MDA1NTU0MTQxIikKKyAgICAgICAgKTsKKworICAgICAgICBhc3NlcnRFcXVhbHMoCisgICAgICAgICAgICAgICAgIisxNzAwNTU1NDE0MSIsCisgICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5leHRyYWN0TmV0d29ya1BvcnRpb25BbHQoIisxICg3MDApLjU1NS00MTQxIikKKyAgICAgICAgKTsKKworICAgICAgICBhc3NlcnRFcXVhbHMoCisgICAgICAgICAgICAgICAgIjE3MDA1NTU0MTQxIiwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbkFsdCgiMSAoNzAwKS41NTUtNDE0MSIpCisgICAgICAgICk7CisKKyAgICAgICAgLy8gVGhpcyBtYXkgc2VlbSB3cm9uZywgYnV0IGl0J3MgcHJvYmFibHkgb2sKKyAgICAgICAgYXNzZXJ0RXF1YWxzKAorICAgICAgICAgICAgICAgICIxNzAwNTU1NDE0MSojIiwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbkFsdCgiMSAoNzAwKS41NTUtNDE0MSojIikKKyAgICAgICAgKTsKKworICAgICAgICBhc3NlcnRFcXVhbHMoCisgICAgICAgICAgICAgICAgIjE3MDA1NTU0MU5OIiwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbkFsdCgiMSAoNzAwKS41NTUtNDFOTiIpCisgICAgICAgICk7CisKKyAgICAgICAgYXNzZXJ0RXF1YWxzKAorICAgICAgICAgICAgICAgICIxNzAwNTU1NDFOTiIsCisgICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5leHRyYWN0TmV0d29ya1BvcnRpb25BbHQoIjEgKDcwMCkuNTU1LTQxTk4sMTIzNCIpCisgICAgICAgICk7CisKKyAgICAgICAgYXNzZXJ0RXF1YWxzKAorICAgICAgICAgICAgICAgICIxNzAwNTU1NDFOTiIsCisgICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5leHRyYWN0TmV0d29ya1BvcnRpb25BbHQoIjEgKDcwMCkuNTU1LTQxTk47MTIzNCIpCisgICAgICAgICk7CisKKyAgICAgICAgLy8gQW4gTU1JIHN0cmluZyBpcyB1bnBlcnRlcmJlZCwgZXZlbiB0aG91Z2ggaXQgY29udGFpbnMgYQorICAgICAgICAvLyAodmFsaWQgaW4gdGhpcyBjYXNlKSBlbWJlZGRlZCArCisgICAgICAgIGFzc2VydEVxdWFscygKKyAgICAgICAgICAgICAgICAiKioyMSoqKzE3MDA1NTU0MTQxIyIsCisgICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5leHRyYWN0TmV0d29ya1BvcnRpb25BbHQoIioqMjEqKisxNzAwNTU1NDE0MSMiKQorICAgICAgICApOworCisgICAgICAgIGFzc2VydEVxdWFscygKKyAgICAgICAgICAgICAgICAiKjMxIys0NDc5NjYxNjQyMDgiLAorICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZXh0cmFjdE5ldHdvcmtQb3J0aW9uQWx0KCIqMzEjKzQ0Nzk2NjE2NDIwOCIpCisgICAgICAgICk7CisKKyAgICAgICAgYXNzZXJ0RXF1YWxzKAorICAgICAgICAgICAgICAgICIqMzEjKzQ0Nzk2NjE2NDIwOCIsCisgICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5leHRyYWN0TmV0d29ya1BvcnRpb25BbHQoIiozMSMgKCs0NCkgNzkgNjYx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MjMwMCIpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCIwMDMyKyIsIFBob25lTnVtYmVyVXRpbHMuZ2V0U3RyaXBwZWRSZXZlcnNlZCgiKzIzMDAiKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiIzEzMCMqIiwgUGhvbmVOdW1iZXJVdGlscy5nZXRTdHJpcHBlZFJldmVyc2VkKCIqIzAzMSMiKSk7CisgICAgfQorCisgICAgQFNtYWxsVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3ROYW5wRm9ybWF0dGluZygpIHsKKyAgICAgICAgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlciBudW1iZXIgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlcigpOworICAgICAgICBudW1iZXIuYXBwZW5kKCI4MDA1NTUxMjEyIik7CisgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZm9ybWF0TmFucE51bWJlcihudW1iZXIpOworICAgICAgICBhc3NlcnRFcXVhbHMoIjgwMC01NTUtMTIxMiIsIG51bWJlci50b1N0cmluZygpKTsKKworICAgICAgICBudW1iZXIuY2xlYXIoKTsKKyAgICAgICAgbnVtYmVyLmFwcGVuZCgiODAwNTU1MTIxIik7CisgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZm9ybWF0TmFucE51bWJlcihudW1iZXIpOworICAgICAgICBhc3NlcnRFcXVhbHMoIjgwMC01NTUtMTIxIiwgbnVtYmVyLnRvU3RyaW5nKCkpOworCisgICAgICAgIG51bWJlci5jbGVhcigpOworICAgICAgICBudW1iZXIuYXBwZW5kKCI1NTUtMTIxMiIpOworICAgICAgICBQaG9uZU51bWJlclV0aWxzLmZvcm1hdE5hbnBOdW1iZXIobnVtYmVyKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCI1NTUtMTIxMiIsIG51bWJlci50b1N0cmluZygpKTsKKworICAgICAgICBudW1iZXIuY2xlYXIoKTsKKyAgICAgICAgbnVtYmVyLmFwcGVuZCgiODAwLTU1NTEyIik7CisgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZm9ybWF0TmFucE51bWJlcihudW1iZXIpOworICAgICAgICBhc3NlcnRFcXVhbHMoIjgwMC01NTUtMTIiLCBudW1iZXIudG9TdHJpbmcoKSk7CisKKyAgICAgICAgbnVtYmVyLmNsZWFyKCk7CisgICAgICAgIG51bWJlci5hcHBlbmQoIjQ2NjQ1Iik7CisgICAgICAgIFBob25lTnVtYmVyVXRpbHMuZm9ybWF0TmFucE51bWJlcihudW1iZXIpOworICAgICAgICBhc3NlcnRFcXVhbHMoIjQ2NjQ1IiwgbnVtYmVyLnRvU3RyaW5nKCkpOworICAgIH0KKworICAgIEBTbWFsbFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0Q29udmVydEtleXBhZExldHRlcnNUb0RpZ2l0cygpIHsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCIxLTgwMC00NjY0LTQxMSIsCisgICAgICAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmNvbnZlcnRLZXlwYWRMZXR0ZXJzVG9EaWdpdHMoIjEtODAwLUdPT0ctNDExIikpOworICAgICAgICBhc3NlcnRFcXVhbHMoIjE4MDA0NjY0NDExIiwKKyAgICAgICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuY29udmVydEtleXBhZExldHRlcnNUb0RpZ2l0cygiMTgwMEdPT0c0MTEiKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiMS04MDAtNDY2LTQ0MTEiLAorICAgICAgICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5jb252ZXJ0S2V5cGFkTGV0dGVyc1RvRGlnaXRzKCIxLTgwMC00NjYtNDQxMSIpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCIxODAwNDY2NDQxMSIsCisgICAgICAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmNvbnZlcnRLZXlwYWRMZXR0ZXJzVG9EaWdpdHMoIjE4MDA0NjY0NDExIikpOworICAgICAgICBhc3NlcnRFcXVhbHMoIjIyMi0zMzMtNDQ0LTU1NS02NjYtNzc3Ny04ODgtOTk5OSIsCisgICAgICAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmNvbnZlcnRLZXlwYWRMZXR0ZXJzVG9EaWdpdHMoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBQkMtREVGLUdISS1KS0wtTU5PLVBRUlMtVFVWLVdYWVoiKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiMjIyLTMzMy00NDQtNTU1LTY2Ni03Nzc3LTg4OC05OTk5IiwKKyAgICAgICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuY29udmVydEtleXBhZExldHRlcnNUb0RpZ2l0cygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImFiYy1kZWYtZ2hpLWprbC1tbm8tcHFycy10dXYtd3h5eiIpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCIoODAwKSAyMjItMzMzNCIsCisgICAgICAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmNvbnZlcnRLZXlwYWRMZXR0ZXJzVG9EaWdpdHMoIig4MDApIEFCQy1ERUZHIikpOworICAgIH0KKworICAgIC8vIFRvIHJ1biB0aGlzIHRlc3QsIHRoZSBkZXZpY2UgaGFzIHRvIGJlIHJlZ2lzdGVyZWQgd2l0aCBuZXR3b3JrCisgICAgcHVibGljIHZvaWQgdGVzdENoZWNrQW5kUHJvY2Vzc1BsdXNDb2RlKCkgeworICAgICAgICBhc3NlcnRFcXVhbHMoIjAxMTg0NzU3OTcwMDAiLAorICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuY2RtYUNoZWNrQW5kUHJvY2Vzc1BsdXNDb2RlKCIrODQ3NTc5NzAwMCIpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCIxODQ3NTc5NzAwMCIsCisgICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlsc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gLy8gU2h1dCB0aGUgbG9hZGVyIGRvd24KKyAgICAgICAgICAgICAgICBjb21wbGV0ZWRMb2FkZXIudW5yZWdpc3Rlckxpc3RlbmVyKHRoaXMpOworICAgICAgICAgICAgICAgIGNvbXBsZXRlZExvYWRlci5zdG9wTG9hZGluZygpOworICAgICAgICAgICAgICAgIGNvbXBsZXRlZExvYWRlci5kZXN0cm95KCk7CisKKyAgICAgICAgICAgICAgICAvLyBTdG9yZSB0aGUgcmVzdWx0LCB1bmJsb2NraW5nIHRoZSB0ZXN0IHRocmVhZAorICAgICAgICAgICAgICAgIHF1ZXVlLmFkZChkYXRhKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICAvLyBUaGlzIGhhbmRsZXIgcnVucyBvbiB0aGUgIm1haW4iIHRocmVhZCBvZiB0aGUgcHJvY2VzcyBzaW5jZSBBc3luY1Rhc2sKKyAgICAgICAgLy8gaXMgZG9jdW1lbnRlZCBhcyBuZWVkaW5nIHRvIHJ1biBvbiB0aGUgbWFpbiB0aHJlYWQgYW5kIG1hbnkgTG9hZGVycyB1c2UKKyAgICAgICAgLy8gQXN5bmNUYXNrCisgICAgICAgIGZpbmFsIEhhbmRsZXIgbWFpblRocmVhZEhhbmRsZXIgPSBuZXcgSGFuZGxlcihMb29wZXIuZ2V0TWFpbkxvb3BlcigpKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgICAgICBsb2FkZXIucmVnaXN0ZXJMaXN0ZW5lcigwLCBsaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgbG9hZGVyLnN0YXJ0TG9hZGluZygpOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIC8vIEFzayB0aGUgbWFpbiB0aHJlYWQgdG8gc3RhcnQgdGhlIGxvYWRpbmcgcHJvY2VzcworICAgICAgICBt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4dGVuZHMgTW9ja0NvbnRleHQgeworICAgIHByaXZhdGUgY2xhc3MgTW9ja0NvbnRleHQyIGV4dGVuZHMgTW9ja0NvbnRleHQgewogCiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgUmVzb3VyY2VzIGdldFJlc291cmNlcygpIHsKQEAgLTg3LDYgKzg3LDExIEBACiAgICAgICAgICAgICAvLyBvbmUgY3JlYXRlZCB0aHJvdWdoIHRoZSByZWd1bGFyIENvbnRleHQKICAgICAgICAgICAgIHJldHVybiBnZXRDb250ZXh0KCkuZ2V0RGlyKCJtb2NrY29udGV4dDJfIiArIG5hbWUsIG1vZGUpOwogICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBDb250ZXh0IGdldEFwcGxpY2F0aW9uQ29udGV4dCgpIHsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CiAgICAgfQogICAgIC8qKgogICAgICAqIENvbnN0cnVjdG9yLgpAQCAtMTQxLDYgKzE0NiwxOCBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIFRlYXJzIGRvd24gdGhlIGVudmlyb25tZW50IGZvciB0aGUgdGVzdCBmaXh0dXJlLgorICAgICAqIDxwPgorICAgICAqIENhbGxzIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuQ29udGVudFByb3ZpZGVyI3NodXRkb3duKCl9IG9uIHRoZQorICAgICAqIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuQ29udGVudFByb3ZpZGVyfSByZXByZXNlbnRlZCBieSBtUHJvdmlkZXIuCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgdGVhckRvd24oKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgbVByb3ZpZGVyLnNodXRkb3duKCk7CisgICAgICAgIHN1cGVyLnRlYXJEb3duKCk7CisgICAgfQorCisgICAgLyoqCiAgICAgICogR2V0cyB0aGUge0Bsa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W5hbCBDb21wYXJhdG9yPENsYXNzPD8gZXh0ZW5kcyBUZXN0Q2FzZT4+IFNPUlRfQllfU0lNUExFX05BTUUKQEAgLTExNCw3ICsxMTYsNyBAQAogICAgICAgICBmb3IgKFN0cmluZyBwYWNrYWdlTmFtZSA6IHBhY2thZ2VOYW1lcykgewogICAgICAgICAgICAgTGlzdDxDbGFzczw/IGV4dGVuZHMgVGVzdENhc2U+PiBhZGRlZENsYXNzZXMgPSB0ZXN0Q2FzZUNsYXNzZXNJblBhY2thZ2UocGFja2FnZU5hbWUpOwogICAgICAgICAgICAgaWYgKGFkZGVkQ2xhc3Nlcy5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICBMb2cudygiVGVzdEdyb3VwaW5nIiwgIkludmFsaWQgUGFja2FnZTogJyIgKyBwYWNrYWdlTmFtZQorICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJJbnZhbGlkIFBhY2thZ2U6ICciICsgcGFja2FnZU5hbWUKICAgICAgICAgICAgICAgICAgICAgICAgICsgIicgY291bGQgbm90IGJlIGZvdW5kIG9yIGhhcyBubyB0ZXN0cyIpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgdGVzdENhc2VDbGFzc2VzLmFkZEFsbChhZGRlZENsYXNzZXMpOwpAQCAtMjM0LDYgKzIzNiwxMCBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgTG9nLmkoTE9HX1RBRywgU3RyaW5nLmZvcm1hdCgKKyAgICAgICAgICAgICAgICAgICAgIlRlc3RDYXNlIGNsYXNzICVzIGlzIG1pc3NpbmcgYSBwdWJsaWMgY29uc3RydWN0b3Igd2l0aCBubyBwYXJhbWV0ZXJzICIgKworICAgICAgICAgICAgICAgICAgICAib3IgYSBzaW5nbGUgU3RyaW5nIHBhcmFtZXRlciAtIHNraXBwaW5nIiwKKyAgICAgICAgICAgICAgICAgICAgYUNsYXNzLmdldE5h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sdGVyLmlzTm9uVGVzdERpcihzKSkgewogICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJSZWN1cnNpbmcgb24gIiArIHMpOwotICAgICAgICAgICAgICAgICAgICBmaW5kTGF5b3V0VGVzdHNSZWN1cnNpdmVseShib3MsIHMsIGlnbm9yZVJlc3VsdHNJbkRpcik7CisgICAgICAgICAgICAgICAgICAgIHRlc3RDb3VudCArPSB3cml0ZUxheW91dFRlc3RMaXN0UmVjdXJzaXZlbHkoYm9zLCBzLCBpZ25vcmVSZXN1bHRzSW5EaXIpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgIH0KQEAgLTc5LDcgKzg0LDkgQEAKICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaWYgKChzLnRvTG93ZXJDYXNlKCkuZW5kc1dpdGgoIi5odG1sIikgfHwgcy50b0xvd2VyQ2FzZSgpLmVuZHNXaXRoKCIueG1sIikpCisgICAgICAgICAgICBpZiAoKHMudG9Mb3dlckNhc2UoKS5lbmRzV2l0aCgiLmh0bWwiKQorICAgICAgICAgICAgICAgICAgICB8fCBzLnRvTG93ZXJDYXNlKCkuZW5kc1dpdGgoIi54bWwiKQorICAgICAgICAgICAgICAgICAgICB8fCBzLnRvTG93ZXJDYXNlKCkuZW5kc1dpdGgoIi54aHRtbCIpKQogICAgICAgICAgICAgICAgICAgICAmJiAhcy5lbmRzV2l0aCgiVEVNUExBVEUuaHRtbCIpKSB7CiAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiUmVjb3JkaW5nICIgKyBzKTsKICAgICAgICAgICAgICAgICBib3Mud3JpdGUocy5nZXRCeXRlcygpKTsKQEAgLTg4LDggKzk1LDEwIEBACiAgICAgICAgICAgICAgICAgICAgIGJvcy53cml0ZSgoIiBJR05PUkVfUkVTVUxUIikuZ2V0Qnl0ZXMoKSk7CiAgICAgICAg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sOSBAQAogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKKyAgICAgICAgbVRvdGFsVGVzdENvdW50ID0gaW50ZW50LmdldEludEV4dHJhKFRPVEFMX1RFU1RfQ09VTlQsIG1Ub3RhbFRlc3RDb3VudCk7CisgICAgICAgIG1DdXJyZW50VGVzdE51bWJlciA9IGludGVudC5nZXRJbnRFeHRyYShDVVJSRU5UX1RFU1RfTlVNQkVSLCBtQ3VycmVudFRlc3ROdW1iZXIpOworCiAgICAgICAgIG1UZXN0VXJsID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFRFU1RfVVJMKTsKICAgICAgICAgaWYgKG1UZXN0VXJsID09IG51bGwpIHsKICAgICAgICAgICAgIG1VaUF1dG9UZXN0UGF0aCA9IGludGVudC5nZXRTdHJpbmdFeHRyYShVSV9BVVRPX1RFU1QpOwpAQCAtMTcyLDYgKzE5MCwxMSBAQAogICAgICAgICBtVGltZW91dEluTWlsbGlzID0gaW50ZW50LmdldEludEV4dHJhKFRJTUVPVVRfSU5fTUlMTElTLCAwKTsKICAgICAgICAgbUdldERyYXd0aW1lID0gaW50ZW50LmdldEJvb2xlYW5FeHRyYShHRVRfRFJBV19USU1FLCBmYWxzZSk7CiAgICAgICAgIG1TYXZlSW1hZ2VQYXRoID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFNBVkVfSU1BR0UpOworICAgICAgICBtU3RvcE9uUmVmRXJyb3IgPSBpbnRlbnQuZ2V0Qm9vbGVhbkV4dHJhKFNUT1BfT05fUkVGX0VSUk9SLCBmYWxzZSk7CisgICAgICAgIHNldFRpdGxlKCJUZXN0ICIgKyBtQ3VycmVudFRlc3ROdW1iZXIgKyAiIG9mICIgKyBtVG90YWxUZXN0Q291bnQpOworICAgICAgICBmbG9hdCByYXRpbyA9IChmbG9hdCltQ3VycmVudFRlc3ROdW1iZXIgLyBtVG90YWxUZXN0Q291bnQ7CisgICAgICAgIGludCBwcm9ncmVzcyA9IChpbnQpKHJhdGlv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RyYWMud2Via2l0Lm9yZy9jaGFuZ2VzZXQvNjM3MzAuCisgICAgICAgIGlmIChlbmFibGVQaXhlbFRlc3RzKSB7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJkdW1wQXNUZXh0KGVuYWJsZVBpeGVsVGVzdHMgPT0gdHJ1ZSkgbm90IGltcGxlbWVudGVkIG9uIEFuZHJvaWQhIik7CisgICAgICAgIH0KKwogICAgICAgICBtRHVtcERhdGFUeXBlID0gRHVtcERhdGFUeXBlLkRVTVBfQVNfVEVYVDsKKyAgICAgICAgbUR1bXBUb3BGcmFtZUFzVGV4dCA9IHRydWU7CiAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7CiAgICAgICAgICAgICBTdHJpbmcgdXJsID0gbVdlYlZpZXcuZ2V0VXJsKCk7CiAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJkdW1wQXNUZXh0IGNhbGxlZDogIit1cmwpOwogICAgICAgICB9CiAgICAgfQogCisgICAgcHVibGljIHZvaWQgZHVtcENoaWxkRnJhbWVzQXNUZXh0KCkgeworICAgICAgICBtRHVtcERhdGFUeXBlID0gRHVtcERhdGFUeXBlLkRVTVBfQVNfVEVYVDsKKyAgICAgICAgbUR1bXBDaGlsZEZyYW1lc0FzVGV4dCA9IHRydWU7CisgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICBTdHJpbmcgdXJsID0gbVdlYlZpZXcuZ2V0VXJsKCk7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJkdW1wQ2hpbGRGcmFtZXNBc1RleHQgY2FsbGVkOiAiK3VybCk7CisgICAgICAgIH0KKyAgICB9CisKICAgICBwdWJsaWMgdm9pZCB3YWl0VW50aWxEb25lKCkgewogICAgICAgICBtV2FpdFVudGlsRG9uZSA9IHRydWU7CiAgICAgICAgIFN0cmluZyB1cmwgPSBtV2ViVmlldy5nZXRVcmwoKTsKQEAgLTM0OCw3ICszODcsOSBAQAogICAgICAgICBMb2cudihMT0dUQUcsICJub3RpZnlEb25lIGNhbGxlZDogIiArIHVybCk7CiAgICAgICAgIGlmIChtV2FpdFVudGlsRG9uZSkgewogICAgICAgICAgICAgbVdhaXRVbnRpbERvbmUgPSBmYWxzZTsKLSAgICAgICAgICAgIG1DaHJvbWVDbGllbnQub25Qcm9ncmVzc0NoYW5nZWQobVdlYlZpZXcsIDEwMSk7CisgICAgICAgICAgICBpZiAoIW1SZXF1ZXN0ZWRXZWJLaXREYXRhICYmICFtVGltZWRPdXQgJiYgIWZpbmlzaGVkKCkpIHsKKyAgICAgICAgICAgICAgICByZXF1ZXN0V2ViS2l0RGF0YSgpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogCkBAIC00NTksOCArNTAwLDI1IEBACiAgICAgICogU2V0cyB0aGUgR2VvbG9jYXRpb24gcGVybWlzc2lvbiBzdGF0ZSB0byBiZSB1c2VkIGZvciBhbGwgZnV0dXJlIHJlcXVlc3RzLgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldEdlb2xvY2F0aW9uUGVybWlzc2lvbihib29sZWFuIGFsbG93KSB7Ci0gICAgICAgIG1HZW9sb2NhdGlvblBlcm1pc3Npb25TZXQgPSB0cnVlOworICAgICAgICBtSXNHZW9sb2NhdGlvblBlcm1pc3Npb25TZXQgPSB0cnVlOwogICAgICAgICBtR2VvbG9jYXRpb25QZXJtaXNzaW9uID0gYWxsb3c7CisKKyAgICAgICAgaWYgKG1QZW5kaW5nR2VvbG9jYXRpb25QZXJtaXNzaW9uQ2FsbGJhY2tzICE9IG51bGwpIHsKKyAgICAgICAgICAgIEl0ZXJhdG9yIGl0ZXIgPSBtUGVuZGluZ0dlb2xvY2F0aW9uUGVybWlzc2lvbkNhbGxiYWNrcy5rZXlTZXQoKS5pdGVyYXRvcigpOworICAgICAgICAgICAgd2hpbGUgKGl0ZXIuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgR2VvbG9jYXRpb25QZXJtaXNzaW9ucy5DYWxsYmFjayBjYWxsYmFjayA9CisgICAgICAgICAgICAgICAgICAgICAgICAoR2VvbG9jYXRpb25QZXJtaXNzaW9ucy5DYWxsYmFjaykgaXRlci5uZXh0KCk7CisgICAgICAgICAgICAgICAgU3RyaW5nIG9yaWdpbiA9IChTdHJpbmcpIG1QZW5kaW5nR2VvbG9jYXRpb25QZXJtaXNzaW9uQ2FsbGJhY2tzLmdldChjYWxsYmFjayk7CisgICAgICAgICAgICAgICAgY2FsbGJhY2suaW52b2tlKG9yaWdpbiwgbUdlb2xvY2F0aW9uUGVybWlzc2lvbiwgZmFsc2UpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVBlbmRpbmdHZW9sb2NhdGlvblBlcm1pc3Npb25DYWxsYmFja3MgPSBudWxsOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0TW9ja0RldmljZU9yaWVudGF0aW9uKGJvb2xlYW4gY2FuUHJvdmlkZUFscGhhLCBkb3VibGUgYWxwaGEsCisgICAgICAgICAgICBib29sZWFuIGNhblByb3ZpZGVCZXRhLCBkb3VibGUgYmV0YSwgYm9vbGVhbiBjYW5Qcm92aWRlR2FtbWEsIGRvdWJsZSBnYW1tYSkgeworICAgICAgICBtV2ViVmlldy5zZXRNb2NrRGV2aWNlT3JpZW50YXRpb24oY2FuUHJvdmlkZUFscGhhLCBhbHBoYSwgY2FuUHJvdmlkZUJldGEsIGJldGEsCisgICAgICAgICAgICAgICAgY2FuUHJvdmlkZUdhbW1hLCBnYW1tYSk7CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgb3ZlcnJpZGVQcmVmZXJlbmNlKFN0cmluZyBrZXksIGJvb2xlYW4gdmFsdWUpIHsKQEAgLTQ2OCwxMSArNTI2LDIxIEBACiAgICAgICAgIC8vIGNhbGxlZCB0aGUgbGF5b3V0VGVzdENvbnRyb2xsZXIgbWV0aG9kLiBDdXJyZW50bHksIHdlIGp1c3QgdXNlIHRoZQogICAgICAgICAvLyBXZ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VZpZXdDbGllbnQgPSBuZXcgV2ViVmlld0NsaWVudCgpewogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIHZvaWQgb25QYWdlRmluaXNoZWQoV2ViVmlldyB2aWV3LCBTdHJpbmcgdXJsKSB7CkBAIC00OTAsMTEgKzU1OCwzMCBAQAogICAgICAgICAgICAgICAgICAgICBkcmF3UGFnZVRvRmlsZShtU2F2ZUltYWdlUGF0aCArICIvIiArIG5hbWUgKyAiLnBuZyIsIG1XZWJWaWV3KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisKICAgICAgICAgICAgIC8vIENhbGxpbmcgZmluaXNoZWQoKSB3aWxsIGNoZWNrIGlmIHdlJ3ZlIG1ldCBhbGwgdGhlIGNvbmRpdGlvbnMgZm9yIGNvbXBsZXRpbmcKLSAgICAgICAgICAgIC8vIHRoaXMgdGVzdCBhbmQgbW92ZSB0byB0aGUgbmV4dCBvbmUgaWYgd2UgYXJlIHJlYWR5LgorICAgICAgICAgICAgLy8gdGhpcyB0ZXN0IGFuZCBtb3ZlIHRvIHRoZSBuZXh0IG9uZSBpZiB3ZSBhcmUgcmVhZHkuIE90aGVyd2lzZSB3ZSBhc2sgV2ViQ29yZSB0bworICAgICAgICAgICAgLy8gZHVtcCB0aGUgcGFnZS4KICAgICAgICAgICAgIGlmIChmaW5pc2hlZCgpKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIW1XYWl0VW50aWxEb25lICYmICFtUmVxdWVzdGVkV2ViS2l0RGF0YSAmJiAhbVRpbWVkT3V0KSB7CisgICAgICAgICAgICAgICAgcmVxdWVzdFdlYktpdERhdGEoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKG1XYWl0VW50aWxEb25lKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInBhZ2UgZmluaXNoZWQgbG9hZGluZyBidXQgd2FpdGluZyBmb3Igbm90aWZ5RG9uZSB0byBiZSBjYWxsZWQ6ICIgKyB1cmwpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChtUmVxdWVzdGVkV2ViS2l0RGF0YSkgeworICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJwYWdlIGZpbmlzaGVkIGxvYWRpbmcgYnV0IHdlYmtpdCBkYXRhIGhhcyBhbHJlYWR5IGJlZW4gcmVxdWVzdGVkOiAiICsgdXJsKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAobVRpbWVkT3V0KSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInBhZ2UgZmluaXNoZWQgbG9hZGluZyBidXQgYWxyZWFkeSB0aW1lZCBvdXQ6ICIgKyB1cmwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgc3VwZXIub25QYWdlRmluaXNoZWQodmlldywgdXJsKTsKICAgICAgICAgfQogCkBAIC01MzYsNDQgKzYyMyw4IEBACiAKICAgICBwcml2YXRlIGZpbmFsIFdlYkNocm9tZUNsaWVudCBtQ2hyb21lQ2xpZW50ID0gbmV3IFdlYkNocm9tZUNsaWVudCgpIHsKICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uUHJvZ3Jlc3NDaGFuZ2VkKFdlYlZpZXcgdmlldywgaW50IG5ld1Byb2dyZXNzKSB7Ci0KLSAgICAgICAgICAgIC8vIG5vdGlmeURvbmUgY2FsbHMgdGhpcyB3aXRoIDEwMSUuIFdlIG9ubHkgd2FudCB0byB1cGRhdGUgdGhpcyBmbGFnIGlmIHRoaXMKLSAgICAgICAgICAgIC8vIGlzIHRoZSByZWFsIGNhbGwgZnJvbSBXZWJDb3JlLgotICAgICAgICAgICAgaWYgKG5ld1Byb2dyZXNzID09IDEwMCkgewotICAgICAgICAgICAgICAgIG1PbmVIdW5kcmVkUGVyY2VudENvbXBsZXRlID0gdHJ1ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gV2l0aCB0aGUgZmxhZyB1cGRhdGVkLCB3ZSBjYW4gbm93IHByb2NlZWQgYXMgbm9ybWFsIHdoZXRoZXIgdGhlIHByb2dyZXNzIHVwZGF0ZSBjYW1lIGZyb20KLSAgICAgICAgICAgIC8vIFdlYkNvcmUgb3Igbm90aWZ5RG9uZS4KLSAgICAgICAgICAgIGlmIChuZXdQcm9ncmVzcyA+PSAxMDApIHsKLSAgICAgICAgICAgICAgICAvLyBmaW5pc2hlZCgpIHdpbGwgY2hlY2sgaWYgd2UgYXJlIHJlYWR5IHRvIG1vdmUgdG8gdGhlIG5leHQgdGVzdCBhbmQgZG8gc28gaWYgd2UgYXJlLgotICAgICAgICAgICAgICAgIGlmIChmaW5pc2hlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoIW1UaW1lZE91dCAmJiAhbVdhaXRVbnRpbERvbmUgJiYgIW1SZXF1ZXN0ZWRXZWJLaXREYXRhKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyB1cmwgPSBtV2ViVmlldy5nZXRVcmwoKTsKLSAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiRmluaXNoZWQ6ICIrIHVybCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3RXZWJLaXREYXRhKCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHVybCA9IG1XZWJWaWV3LmdldFVybCgpOwotICAgICAgICAgICAgICAgICAgICBpZiAobVRpbWVkT3V0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJUaW1lZCBvdXQgYmVmb3JlIGZpbmlzaGluZzogIiArIHVybCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVdhaXRVbnRpbERvbmUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIldhaXRpbmcgZm9yIG5vdGlmeURvbmU6ICIgKyB1cmwpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1SZXF1ZXN0ZWRXZWJLaXREYXRhKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJSZXF1ZXN0ZWQgd2Via2l0IGRhdGEgcmVhZHk6ICIgKyB1cmwpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZWRUaXRsZShXZWJWaWV3IHZpZXcsIFN0cmluZyB0aXRsZSkgewotICAgICAgICAgICAgaWYgKHRpdGxlLmxlbmd0aCgpID4gMzApCi0gICAgICAgICAgICAgICAgdGl0bGUgPSAiLi4uIit0aXRsZS5zdWJzdHJpbmcodGl0bGUubGVuZ3RoKCktMzApOwotICAgICAgICAgICAgc2V0VGl0bGUodGl0bGUpOworICAgICAgICAgICAgc2V0VGl0bGUoIlRlc3QgIiArIG1DdXJyZW50VGVzdE51bWJlciArICIgb2YgIiArIG1Ub3RhbFRlc3RDb3VudCArICI6ICIrIHRpdGxlKTsKICAgICAgICAgICAgIGlmIChtRHVtcFRpdGxlQ2hhbmdlcykgewogICAgICAgICAgICAgICAgIG1UaXRsZUNoYW5nZXMuYXBwZW5kKCJUSVRMRSBDSEFOR0VEOiAiKTsKICAgICAgICAgICAgICAgICBtVGl0bGVDaGFuZ2VzLmFwcGVuZCh0aXRsZSk7CkBAIC02NzAsMjEgKzcyMSw0MCBAQAogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIHZvaWQgb25HZW9sb2NhdGlvblBlcm1pc3Npb25zU2hvd1Byb21wdChTdHJpbmcgb3JpZ2luLAogICAgICAgICAgICAgICAgIEdlb2xvY2F0aW9uUGVybWlzc2lvbnMuQ2FsbGJhY2sgY2FsbGJhY2spIHsKLSAgICAgICAgICAgIGlmIChtR2VvbG9jYXRpb25QZXJtaXNzaW9uU2V0KSB7CisgICAgICAgICAgICBpZiAobUlzR2VvbG9jYXRpb25QZXJtaXNzaW9uU2V0KSB7CiAgICAgICAgICAgICAgICAgY2FsbGJhY2suaW52b2tlKG9yaWdpbiwgbUdlb2xvY2F0aW9uUGVybWlzc2lvbiwgZmFsc2UpOworICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtUGVuZGluZ0dlb2xvY2F0aW9uUGVybWlzc2lvbkNhbGxiYWNrcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVBlbmRpbmdHZW9sb2NhdGlvblBlcm1pc3Npb25DYWxsYmFja3MgPQorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hNYXA8R2VvbG9jYXRpb25QZXJtaXNzaW9ucy5DYWxsYmFjaywgU3RyaW5nPigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVBlbmRpbmdHZW9sb2NhdGlvblBlcm1pc3Npb25DYWxsYmFja3MucHV0KGNhbGxiYWNrLCBvcmlnaW4pOwogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uQ29uc29sZU1lc3NhZ2UoU3RyaW5nIG1lc3NhZ2UsIGludCBsaW5lTnVtYmVyLAotICAgICAgICAgICAgICAgIFN0cmluZyBzb3VyY2VJRCkgeworICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbkNvbnNvbGVNZXNzYWdlKENvbnNvbGVNZXNzYWdlIGNvbnNvbGVNZXNzYWdlKSB7CisgICAgICAgICAgICBTdHJpbmcgbXNnID0gIkNPTlNPTEUgTUVTU0FHRTogbGluZSAiICsgY29uc29sZU1lc3NhZ2UubGluZU51bWJlcigpICsgIjogIgorICAgICAgICAgICAgICAgICAgICArIGNvbnNvbGVNZXNzYWdlLm1lc3NhZ2UoKSArICJcbiI7CiAgICAgICAgICAgICBpZiAobUNvbnNvbGVNZXNzYWdlcyA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgbUNvbnNvbGVNZXNzYWdlcyA9IG5ldyBTdHJpbmdCdWZmZXIoKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFN0cmluZyBjb25zb2xlTWVzc2FnZSA9ICJDT05TT0xFIE1FU1NBR0U6IGxpbmUgIgotICAgICAgICAgICAgICAgICAgICArIGxpbmVOdW1iZXIgKyI6ICIrIG1lc3NhZ2UgKyJcbiI7Ci0gICAgICAgICAgICBtQ29uc29sZU1lc3NhZ2VzLmFwcGVuZChjb25zb2xlTWVzc2FnZSk7Ci0gICAgICAgICAgICBMb2cudihMT0dUQUcsICJMT0c6ICIrY29uc29sZU1lc3NhZ2UpOworICAgICAgICAgICAgbUNvbnNvbGVNZXNzYWdlcy5hcHBlbmQobXNnKTsKKyAgICAgICAgICAgIExvZy52KExPR1RBRywgIkxPRzogIiArIG1zZyk7CisgICAgICAgICAgICAvLyB0aGUgcmF0aW9uYWxlIGhlcmUgaXMgdGhhdCBpZiB0aGVyZSdzIGFuIGVycm9yIG9mIGVpdGhlciB0eXBlLCBhbmQgdGhlIHRlc3Qgd2FzCisgICAgICAgICAgICAvLyB3YWl0aW5nIGZvciAibm90aWZ5RG9uZSIgc2lnbmFsIHRvIGZpbmlzaCwgdGhlbiB0aGVyZSdzIG5vIHBvaW50IGluIHdhaXRpbmcKKyAgICAgICAgICAgIC8vIGFueW1vcmUgYmVjYXVzZSB0aGUgSlMgZXhlY3V0aW9uIGlzIGFscmVhZHkgdGVybWluYXRlZCBhdCB0aGlzIHBvaW50IGFuZCBhCisgICAgICAgICAgICAvLyAibm90aWZ5RG9uZSIgd2lsbCBuZXZlciBjb21lIG91dCBzbyBpdCdzIGp1c3Qgd2FzdGluZyB0aW1lIHRpbGwgdGltZW91dCBraWNrcyBpbgorICAgICAgICAgICAgaWYgKChtc2cuY29udGFpbnMoIlVuY2F1Z2h0IFJlZmVyZW5jZUVycm9yOiIpIHx8IG1zZy5jb250YWlucygiVW5jYXVnaHQgVHlwZUVycm9yOiIpKQorICAgICAgICAgICAgICAgICAgICAmJiBtV2FpdFVudGlsRG9uZSAmJiBtU3RvcE9uUmVmRXJyb3IpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJUZXJtaW5hdGluZyB0ZXN0IGNhc2Ugb24gdW5jYXVnaHQgUmVmZXJlbmNlRXJyb3Igb3IgVHlwZUVycm9yLiIpOworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnBvc3REZWxheWVkKG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbm90aWZ5RG9uZSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgNTAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlCkBAIC03MjMsMTMgKzc5MywxNSBAQAogCiAgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgTmV3V2luZG93V2ViVmlldyBleHRlbmRzIFdlYlZpZXcgewogICAgICAgICBwdWJsaWMgTmV3V2luZG93V2ViVmlldyhDb250ZXh0IGNvbnRleHQsIE1hcDxTdHJpbmcsIE9iamVjdD4ganNJZmFjZXMpIHsKLSAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIG51bGwsIDAsIGpzSWZhY2VzKTsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIG51bGwsIDAsIGpzSWZhY2VzLCBmYWxzZSk7CiAgICAgICAgIH0KICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgcmVzZXRUZXN0U3RhdHVzKCkgewogICAgICAgICBtV2FpdFVudGlsRG9uZSA9IGZhbHNlOwogICAgICAgICBtRHVtcERhdGFUeXBlID0gbURlZmF1bHREdW1wRGF0YVR5cGU7CisgICAgICAgIG1EdW1wVG9wRnJhbWVBc1RleHQgPSBmYWxzZTsKKyAgICAgICAgbUR1bXBDaGlsZEZyYW1lc0FzVGV4dCA9IGZhbHNlOwogICAgICAgICBtVGltZWRPdXQgPSBmYWxzZTsKICAgICAgICAgbUR1bXBUaXRsZUNoYW5nZXMgPSBmYWxzZTsKICAgICAgICAgbVJlcXVlc3RlZFdlYktpdERhdGEgPSBmYWxzZTsKQEAgLTczOSwxMCArODExLDEyIEBACiAgICAgICAgIG1FdmVudFNlbmRlci5jbGVhclRvdWNoUG9pbnRzKCk7CiAgICAgICAgIG1FdmVudFNlbmRlci5jbGVhclRvdWNoTWV0YVN0YXRlKCk7CiAgICAgICAgIG1QYWdlRmluaXNoZWQgPSBmYWxzZTsKLSAgICAgICAgbU9uZUh1bmRyZWRQZXJjZW50Q29tcGxldGUgPSBmYWxzZTsKICAgICAgICAgbUR1bXBXZWJLaXREYXRhID0gZmFsc2U7CiAgICAgICAgIG1HZXREcmF3dGltZSA9IGZhbHNlOwogICAgICAgICBtU2F2ZUltYWdlUGF0aCA9IG51bGw7CisgICAgICAgIHNldERlZmF1bHRXZWJTZXR0aW5ncyhtV2ViVmlldyk7CisgICAgICAgIG1Jc0dlb2xvY2F0aW9uUGVybWlzc2lvblNldCA9IGZhbHNlOworICAgICAgICBtUGVuZGluZ0dlb2xvY2F0aW9uUGVybWlzc2lvbkNhbGxiYWNrcyA9IG51bGw7CiAgICAgfQogCiAgICAgcHJpdmF0ZSBsb25nW10gZ2V0RHJhd1dlYlZpZXdUaW1lKFdlYlZpZXcgdmlldywgaW50IGNvdW50KSB7CkBAIC03NzksNyArODUzLDcgQEAKICAgICB9CiAKICAgICBwcml2YXRlIGJvb2x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0RG93blRpbWUoU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkpOwotICAgICAgICBNb3Rpb25FdmVudCBldmVudCA9IE1vdGlvbkV2ZW50Lm9idGFpbih0cC5kb3duVGltZSgpLCB0cC5kb3duVGltZSgpLAotICAgICAgICAgICAgICAgIE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOLCB0cC5nZXRYKCksIHRwLmdldFkoKSwgbVRvdWNoTWV0YVN0YXRlKTsKKyAgICAgICAgaW50W10gcG9pbnRlcklkcyA9IG5ldyBpbnRbbnVtUG9pbnRzXTsKKyAgICAgICAgTW90aW9uRXZlbnQuUG9pbnRlckNvb3Jkc1tdIHBvaW50ZXJDb29yZHMgPSBuZXcgTW90aW9uRXZlbnQuUG9pbnRlckNvb3Jkc1tudW1Qb2ludHNdOworICAgICAgICBsb25nIGRvd25UaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1Qb2ludHM7ICsraSkgeworICAgICAgICAgICAgcG9pbnRlcklkc1tpXSA9IG1Ub3VjaFBvaW50cy5nZXQoaSkuZ2V0SWQoKTsKKyAgICAgICAgICAgIHBvaW50ZXJDb29yZHNbaV0gPSBuZXcgTW90aW9uRXZlbnQuUG9pbnRlckNvb3JkcygpOworICAgICAgICAgICAgcG9pbnRlckNvb3Jkc1tpXS54ID0gbVRvdWNoUG9pbnRzLmdldChpKS5nZXRYKCk7CisgICAgICAgICAgICBwb2ludGVyQ29vcmRzW2ldLnkgPSBtVG91Y2hQb2ludHMuZ2V0KGkpLmdldFkoKTsKKyAgICAgICAgICAgIG1Ub3VjaFBvaW50cy5nZXQoaSkuc2V0RG93blRpbWUoZG93blRpbWUpOworICAgICAgICB9CisKKyAgICAgICAgTW90aW9uRXZlbnQgZXZlbnQgPSBNb3Rpb25FdmVudC5vYnRhaW4oZG93blRpbWUsIGRvd25UaW1lLAorICAgICAgICAgICAgTW90aW9uRXZlbnQuQUNUSU9OX0RPV04sIG51bVBvaW50cywgcG9pbnRlcklkcywgcG9pbnRlckNvb3JkcywKKyAgICAgICAgICAgIG1Ub3VjaE1ldGFTdGF0ZSwgMS4wZiwgMS4wZiwgMCwgMCwgMCwgMCk7CisKICAgICAgICAgbVdlYlZpZXcub25Ub3VjaEV2ZW50KGV2ZW50KTsKICAgICB9CiAKICAgICBwdWJsaWMgdm9pZCB0b3VjaE1vdmUoKSB7Ci0gICAgICAgIFRvdWNoUG9pbnQgdHAgPSBtVG91Y2hQb2ludHMuZ2V0KDApOwotCi0gICAgICAgIGlmICh0cCA9PSBudWxsKSB7CisgICAgICAgIGZpbmFsIGludCBudW1Qb2ludHMgPSBtVG91Y2hQb2ludHMuc2l6ZSgpOworICAgICAgICBpZiAobnVtUG9pbnRzID09IDApIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCi0gICAgICAgIGlmICghdHAuaGFzTW92ZWQoKSkgeworICAgICAgICBpbnRbXSBwb2ludGVySWRzID0gbmV3IGludFtudW1Qb2ludHNdOworICAgICAgICBNb3Rpb25FdmVudC5Qb2ludGVyQ29vcmRzW10gcG9pbnRlckNvb3JkcyA9IG5ldyBNb3Rpb25FdmVudC5Qb2ludGVyQ29vcmRzW251bVBvaW50c107CisgICAgICAgIGludCBudW1Nb3ZlZFBvaW50cyA9IDA7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtUG9pbnRzOyArK2kpIHsKKyAgICAgICAgICAgIFRvdWNoUG9pbnQgdHAgPSBtVG91Y2hQb2ludHMuZ2V0KGkpOworICAgICAgICAgICAgaWYgKHRwLmhhc01vdmVkKCkpIHsKKyAgICAgICAgICAgICAgICBwb2ludGVySWRzW251bU1vdmVkUG9pbnRzXSA9IG1Ub3VjaFBvaW50cy5nZXQoaSkuZ2V0SWQoKTsKKyAgICAgICAgICAgICAgICBwb2ludGVyQ29vcmRzW2ldID0gbmV3IE1vdGlvbkV2ZW50LlBvaW50ZXJDb29yZHMoKTsKKyAgICAgICAgICAgICAgICBwb2ludGVyQ29vcmRzW251bU1vdmVkUG9pbnRzXS54ID0gbVRvdWNoUG9pbnRzLmdldChpKS5nZXRYKCk7CisgICAgICAgICAgICAgICAgcG9pbnRlckNvb3Jkc1tudW1Nb3ZlZFBvaW50c10ueSA9IG1Ub3VjaFBvaW50cy5nZXQoaSkuZ2V0WSgpOworICAgICAgICAgICAgICAgICsrbnVtTW92ZWRQb2ludHM7CisgICAgICAgICAgICAgICAgdHAuc2V0TW92ZWQoZmFsc2UpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKG51bU1vdmVkUG9pbnRzID09IDApIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCi0gICAgICAgIE1vdGlvbkV2ZW50IGV2ZW50ID0gTW90aW9uRXZlbnQub2J0YWluKHRwLmRvd25UaW1lKCksIFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpLAotICAgICAgICAgICAgICAgIE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFLCB0cC5nZXRYKCksIHRwLmdldFkoKSwgbVRvdWNoTWV0YVN0YXRlKTsKKyAgICAgICAgTW90aW9uRXZlbnQgZXZlbnQgPSBNb3Rpb25FdmVudC5vYnRhaW4obVRvdWNoUG9pbnRzLmdldCgwKS5kb3duVGltZSgpLAorICAgICAgICAgICAgICAgIFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpLCBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSwKKyAgICAgICAgICAgICAgICBudW1Nb3ZlZFBvaW50cywgcG9pbnRlcklkcywgcG9pbnRlckNvb3JkcywKKyAgICAgICAgICAgICAgICBtVG91Y2hNZXRhU3RhdGUsIDEuMGYsIDEuMGYsIDAsIDAsIDAsIDApOwogICAgICAgICBtV2ViVmlldy5vblRvdWNoRXZlbnQoZXZlbnQpOwotCi0gICAgICAgIHRwLnNldE1vdmVkKGZhbHNlKTsKICAgICB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gICAgICAgIH0KKworICAgICAgICBNb3Rpb25FdmVudCBldmVudCA9IE1vdGlvbkV2ZW50Lm9idGFpbihtVG91Y2hQb2ludHMuZ2V0KDApLmRvd25UaW1lKCksCisgICAgICAgICAgICAgICAgU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCksIE1vdGlvbkV2ZW50LkFDVElPTl9VUCwKKyAgICAgICAgICAgICAgICBudW1Qb2ludHMsIHBvaW50ZXJJZHMsIHBvaW50ZXJDb29yZHMsCisgICAgICAgICAgICAgICAgbVRvdWNoTWV0YVN0YXRlLCAxLjBmLCAxLjBmLCAwLCAwLCAwLCAwKTsKICAgICAgICAgbVdlYlZpZXcub25Ub3VjaEV2ZW50KGV2ZW50KTsKIAotICAgICAgICBpZiAodHAuaXNSZWxlYXNlZCgpKSB7Ci0gICAgICAgICAgICBtVG91Y2hQb2ludHMucmVtb3ZlKDApOworICAgICAgICBmb3IgKGludCBpID0gbnVtUG9pbnRzIC0gMTsgaSA+PSAwOyAtLWkpIHsgIC8vIHJlbW92ZSByZWxlYXNlZCBwb2ludHMuCisgICAgICAgICAgICBUb3VjaFBvaW50IHRwID0gbVRvdWNoUG9pbnRzLmdldChpKTsKKyAgICAgICAgICAgIGlmICh0cC5pc1JlbGVhc2VkKCkpIHsKKyAgICAgICAgICAgICAgbVRvdWNoUG9pbnRzLnJlbW92ZShpKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIHRvdWNoQ2FuY2VsKCkgewotICAgICAgICBUb3VjaFBvaW50IHRwID0gbVRvdWNoUG9pbnRzLmdldCgwKTsKLSAgICAgICAgaWYgKHRwID09IG51bGwpIHsKKyAgICAgICAgZmluYWwgaW50IG51bVBvaW50cyA9IG1Ub3VjaFBvaW50cy5zaXplKCk7CisgICAgICAgIGlmIChudW1Qb2ludHMgPT0gMCkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKHRwLmNhbmNlbGxlZCgpKSB7Ci0gICAgICAgICAgICBNb3Rpb25FdmVudCBldmVudCA9IE1vdGlvbkV2ZW50Lm9idGFpbih0cC5kb3duVGltZSgpLCBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSwKLSAgICAgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQuQUNUSU9OX0NBTkNFTCwgdHAuZ2V0WCgpLCB0cC5nZXRZKCksIG1Ub3VjaE1ldGFTdGF0ZSk7Ci0gICAgICAgICAgICBtV2ViVmlldy5vblRvdWNoRXZlbnQoZXZlbnQpOworICAgICAgICBpbnRbXSBwb2ludGVySWRzID0gbmV3IGludFtudW1Qb2ludHNdOworICAgICAgICBNb3Rpb25FdmVudC5Qb2ludGVyQ29vcmRzW10gcG9pbnRlckNvb3JkcyA9IG5ldyBNb3Rpb25FdmVudC5Qb2ludGVyQ29vcmRzW251bVBvaW50c107CisgICAgICAgIGxvbmcgY2FuY2VsVGltZSA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOworICAgICAgICBpbnQgbnVtQ2FuY2VsZWRQb2ludHMgPSAwOworCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtUG9pbnRzOyArK2kpIHsKKyAgICAgICAgICAgIFRvdWNoUG9pbnQgdHAgPSBtVG91Y2hQb2ludHMuZ2V0KGkpOworICAgICAgICAgICAgaWYgKHRwLmNhbmNlbGxlZCgpKSB7CisgICAgICAgICAgICAgICAgcG9pbnRlcklkc1tudW1DYW5jZWxlZFBvaW50c10gPSBtVG91Y2hQb2ludHMuZ2V0KGkpLmdldElkKCk7CisgICAgICAgICAgICAgICAgcG9pbnRlckNvb3Jkc1tudW1DYW5jZWxlZFBvaW50c10gPSBuZXcgTW90aW9uRXZlbnQuUG9pbnRlckNvb3JkcygpOworICAgICAgICAgICAgICAgIHBvaW50ZXJDb29yZHNbbnVtQ2FuY2VsZWRQb2ludHNdLnggPSBtVG91Y2hQb2ludHMuZ2V0KGkpLmdldFgoKTsKKyAgICAgICAgICAgICAgICBwb2ludGVyQ29vcmRzW251bUNhbmNlbGVkUG9pbnRzXS55ID0gbVRvdWNoUG9pbnRzLmdldChpKS5nZXRZKCk7CisgICAgICAgICAgICAgICAgKytudW1DYW5jZWxlZFBvaW50czsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQorCisgICAgICAgIGlmIChudW1DYW5jZWxlZFBvaW50cyA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBNb3Rpb25FdmVudCBldmVudCA9IE1vdGlvbkV2ZW50Lm9idGFpbihtVG91Y2hQb2ludHMuZ2V0KDApLmRvd25UaW1lKCksCisgICAgICAgICAgICBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSwgTW90aW9uRXZlbnQuQUNUSU9OX0NBTkNFTCwKKyAgICAgICAgICAgIG51bUNhbmNlbGVkUG9pbnRzLCBwb2ludGVySWRzLCBwb2ludGVyQ29vcmRzLAorICAgICAgICAgICAgbVRvdWNoTWV0YVN0YXRlLCAxLjBmLCAxLjBmLCAwLCAwLCAwLCAwKTsKKworICAgICAgICBtV2ViVmlldy5vblRvdWNoRXZlbnQoZXZlbnQpOwogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIGNhbmNlbFRvdWNoUG9pbnQoaW50IGlkKSB7Ci0gICAgICAgIFRvdWNoUG9pbnQgdHAgPSBtVG91Y2hQb2ludHMuZ2V0KDApOworICAgICAgICBUb3VjaFBvaW50IHRwID0gbVRvdWNoUG9pbnRzLmdldChpZCk7CiAgICAgICAgIGlmICh0cCA9PSBudWxsKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KQEAgLTI0MiwxNCArMzAxLDE5IEBACiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgYWRkVG91Y2hQb2ludChpbnQgeCwgaW50IHkpIHsKLSAgICAgICAgbVRvdWNoUG9pbnRzLmFkZChuZXcgVG91Y2hQb2ludChjb250ZW50c1RvV2luZG93WCh4KSwgY29udGVudHNUb1dpbmRvd1koeSkpKTsKLSAgICAgICAgaWYgKG1Ub3VjaFBvaW50cy5zaXplKCkgPiAxKSB7Ci0gICAgICAgICAgICBMb2cudyhMT0dUQUcsICJBZGRpbmcgbW9yZSB0aGFuIG9uZSB0b3VjaCBwb2ludCwgYnV0IG11bHRpIHRvdWNoIGlzIG5vdCBzdXBwb3J0ZWQhIik7CisgICAgICAgIGZpbmFsIGludCBudW1Qb2ludHMgPSBtVG91Y2hQb2ludHMuc2l6ZSgpOworICAgICAgICBpbnQgaWQ7CisgICAgICAgIGlmIChudW1Qb2ludHMgPT0gMCkgeworICAgICAgICAgIGlkID0gMDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBpZCA9IG1Ub3VjaFBvaW50cy5nZXQobnVtUG9pbnRzIC0gMSkuZ2V0SWQoKSArIDE7CiAgICAgICAgIH0KKworICAgICAgICBtVG91Y2hQb2ludHMuYWRkKG5ldyBUb3VjaFBvaW50KGlkLCBjb250ZW50c1RvV2luZG93WCh4KSwgY29udGVudHNUb1dpbmRvd1koeSkpKTsKICAgICB9CiAKLSAgICBwdWJsaWMgdm9pZCB1cGRhdGVUb3VjaFBvaW50KGludCBpZCwgaW50IHgsIGludCB5KSB7Ci0gICAgICAgIFRvdWNoUG9pbnQgdHAgPSBtVG91Y2hQb2ludHMuZ2V0KDApOworICAgIHB1YmxpYyB2b2lkIHVwZGF0ZVRvdWNoUG9pbnQoaW50IGksIGludCB4LCBpbnQgeSkgeworICAgICAgICBUb3VjaFBvaW50IHRwID0gbVRvdWNoUG9pbnRzLmdldChpKTsKICAgICAgICAgaWYgKHRwID09IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQpAQCAtMjc2LDcgKzM0MCw3IEBACiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgcmVsZWFzZVRvdWNoUG9pbnQoaW50IGlkKSB7Ci0gICAgICAgIFRvdWNoUG9pbnQgdHAgPSBtVG91Y2hQb2ludHMuZ2V0KDApOworICAgICAgICBUb3VjaFBvaW50IHRwID0gbVRvdWNoUG9pbnRzLmdldChpZCk7CiAgICAgICAgIGlmICh0cCA9PSBudWxsKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KQEAgLTMwNSw2ICszNjksNyBAQAogICAgIHByaXZhdGUgaW50IG1vdXNlWTsKIAogICAgIHByaXZhdGUgY2xhc3MgVG91Y2hQb2ludCB7CisgICAgICAgIHByaXZhdGUgaW50IG1JZDsKICAgICAgICAgcHJpdmF0ZSBpbnQgbVg7CiAgICAgICAgIHByaXZhdGUgaW50IG1ZOwogICAgICAgICBwcml2YXRlIGxvbmcgbURvd25UaW1lOwpAQCAtMzEyLDcgKzM3Nyw4IEBACiAgICAgICAgIHByaXZhdGUgYm9vbGVhbiBtTW92ZWQ7CiAgICAgICAgIHByaXZhdGUgYm9vbGVhbiBtQ2FuY2VsbGVkOwogCi0gICAgICAgIHB1YmxpYyBUb3VjaFBvaW50KGludCB4LCBpbnQgeSkgeworICAgICAgICBwdWJsaWMgVG91Y2hQb2ludChpbnQgaWQsIGludCB4LCBpbnQgeSkgeworICAgICAgICAgICAgbUlkID0gaWQ7CiAgICAgICAgICAgICBtWCA9IHg7CiAgICAgICAgICAgICBtWSA9IHk7CiAgICAgICAgICAgICBtUmVsZWFzZWQgPSBmYWxzZTsKQEAgLTMzMiw2ICszOTgsNyBAQAogICAgICAgICBwdWJsaWMgdm9pZCBzZXRNb3ZlZChib29sZWFuIG1vdmVkKSB7IG1Nb3ZlZCA9IG1vdmVkOyB9CiAgICAgICAgIHB1YmxpYyBib29sZWFuIGhhc01vdmVkKCkgeyByZXR1cm4gbU1vdmVkOyB9CiAKKyAgICAgICAgcHVibGljIGludCBnZXRJZCgpIHsgcmV0dXJuIG1JZDsgfQogICAgICAgICBwdWJsaWMgaW50IGdldFgoKSB7IHJldHVybiBtWDsgfQogICAgICAgICBwdWJsaWMgaW50IGdldFkoKS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gICAgICAgICByZXR1cm4gbmV3IFRleHRSZXN1bHQoYnVuZGxlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwKKyAgICAgICAgUkVOREVSX1RSRUUgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgQWJzdHJhY3RSZXN1bHQgY3JlYXRlUmVzdWx0KEJ1bmRsZSBidW5kbGUpIHsKKyAgICAgICAgICAgICAgICAvKiogVE9ETzogUmVuZGVyVHJlZSB0ZXN0cyBhcmUgbm90IHlldCBzdXBwb3J0ZWQgKi8KKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICBwdWJsaWMgYWJzdHJhY3QgQWJzdHJhY3RSZXN1bHQgY3JlYXRlUmVzdWx0KEJ1bmRsZSBidW5kbGUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEEgY29kZSByZXByZXNlbnRpbmcgdGhlIHJlc3VsdCBvZiBjb21wYXJpbmcgYWN0dWFsIGFuZCBleHBlY3RlZCByZXN1bHRzLgorICAgICAqLworICAgIHB1YmxpYyBlbnVtIFJlc3VsdENvZGUgaW1wbGVtZW50cyBTZXJpYWxpemFibGUgeworICAgICAgICBSRVNVTFRTX01BVENIKCJSZXN1bHRzIG1hdGNoIiksCisgICAgICAgIFJFU1VMVFNfRElGRkVSKCJSZXN1bHRzIGRpZmZlciIpLAorICAgICAgICBOT19FWFBFQ1RFRF9SRVNVTFQoIk5vIGV4cGVjdGVkIHJlc3VsdCIpLAorICAgICAgICBOT19BQ1RVQUxfUkVTVUxUKCJObyBhY3R1YWwgcmVzdWx0Iik7CisKKyAgICAgICAgcHJpdmF0ZSBTdHJpbmcgbVRpdGxlOworCisgICAgICAgIHByaXZhdGUgUmVzdWx0Q29kZShTdHJpbmcgdGl0bGUpIHsKKyAgICAgICAgICAgIG1UaXRsZSA9IHRpdGxlOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgICAgICByZXR1cm4gbVRpdGxlOworICAgICAgICB9CisgICAgfQorCisgICAgU3RyaW5nIG1BZGRpdGlvbmFsVGV4dE91dHB1dFN0cmluZzsKKworICAgIHB1YmxpYyBpbnQgY29tcGFyZVRvKEFic3RyYWN0UmVzdWx0IGFub3RoZXIpIHsKKyAgICAgICAgcmV0dXJuIGdldFJlbGF0aXZlUGF0aCgpLmNvbXBhcmVUbyhhbm90aGVyLmdldFJlbGF0aXZlUGF0aCgpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRBZGRpdGlvbmFsVGV4dE91dHB1dFN0cmluZyhTdHJpbmcgYWRkaXRpb25hbFRleHRPdXRwdXRTdHJpbmcpIHsKKyAgICAgICAgbUFkZGl0aW9uYWxUZXh0T3V0cHV0U3RyaW5nID0gYWRkaXRpb25hbFRleHRPdXRwdXRTdHJpbmc7CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBnZXRBZGRpdGlvbmFsVGV4dE91dHB1dFN0cmluZygpIHsKKyAgICAgICAgcmV0dXJuIG1BZGRpdGlvbmFsVGV4dE91dHB1dFN0cmluZzsKKyAgICB9CisKKyAgICBwdWJsaWMgYnl0ZVtdIGdldEJ5dGVzKCkgeworICAgICAgICBCeXRlQXJyYXlPdXRwdXRTdHJlYW0gYmFvcyA9IG51bGw7CisgICAgICAgIE9iamVjdE91dHB1dFN0cmVhbSBvb3MgPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBiYW9zID0gbmV3IEJ5dGVBcnJheU91dHB1dFN0cmVhbSgpOworICAgICAgICAgICAgICAgIG9vcyA9IG5ldyBPYmplY3RPdXRwdXRTdHJlYW0oYmFvcyk7CisgICAgICAgICAgICAgICAgb29zLndyaXRlT2JqZWN0KHRoaXMpOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBpZiAoYmFvcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGJhb3MuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG9vcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG9vcy5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIlVuYWJsZSB0byBzZXJpYWxpemUgcmVzdWx0OiAiICsgZ2V0UmVsYXRpdmVQYXRoKCksIGUpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGJhb3MgPT0gbnVsbCA/IG51bGwgOiBiYW9zLnRvQnl0ZUFycmF5KCk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBBYnN0cmFjdFJlc3VsdCBjcmVhdGUoYnl0ZVtdIGJ5dGVzKSB7CisgICAgICAgIEJ5dGVBcnJheUlucHV0U3RyZWFtIGJhaXMgPSBudWxsOworICAgICAgICBPYmplY3RJbnB1dFN0cmVhbSBvaXMgPSBudWxsOworICAgICAgICBBYnN0cmFjdFJlc3VsdCByZXN1bHQgPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBiYWlzID0gbmV3IEJ5dGVBcnJheUlucHV0U3RyZWFtKGJ5dGVzKTsKKyAgICAgICAgICAgICAgICBvaXMgPSBuZXcgT2JqZWN0SW5wdXRTdHJlYW0oYmFpcyk7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gKEFic3RyYWN0UmVzdWx0KW9pcy5yZWFkT2JqZWN0KCk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGlmIChiYWlzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYmFpcy5jbG9zZS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AgICogQHJldHVybgorICAgICAqICAgICAgd2hldGhlciB0aGlzIHRlc3QgdGltZWQgb3V0CisgICAgICovCisgICAgcHVibGljIGFic3RyYWN0IGJvb2xlYW4gZGlkVGltZU91dCgpOworCisgICAgLyoqCisgICAgICogU2V0cyB0aGF0IHRoaXMgdGVzdCB0aW1lZCBvdXQuCisgICAgICovCisgICAgcHVibGljIGFic3RyYWN0IHZvaWQgc2V0RGlkVGltZU91dCgpOworCisgICAgLyoqCisgICAgICogUmV0dXJucyB3aGV0aGVyIHRoZSB0ZXN0IHBhc3NlZC4KKyAgICAgKgorICAgICAqIEByZXR1cm4KKyAgICAgKiAgICAgIHdoZXRoZXIgdGhlIHRlc3QgcGFzc2VkCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gZGlkUGFzcygpIHsKKyAgICAgICAgLy8gVGVzdHMgdGhhdCBjcmFzaCBjYW4ndCBoYXZlIHRpbWVkIG91dCBvciBoYXZlIGFuIGFjdHVhbCByZXN1bHQuCisgICAgICAgIGFzc2VydCAhKGRpZENyYXNoKCkgJiYgZGlkVGltZU91dCgpKTsKKyAgICAgICAgYXNzZXJ0ICEoZGlkQ3Jhc2goKSAmJiBnZXRSZXN1bHRDb2RlKCkgIT0gUmVzdWx0Q29kZS5OT19BQ1RVQUxfUkVTVUxUKTsKKyAgICAgICAgcmV0dXJuICFkaWRDcmFzaCgpICYmICFkaWRUaW1lT3V0KCkgJiYgZ2V0UmVzdWx0Q29kZSgpID09IFJlc3VsdENvZGUuUkVTVUxUU19NQVRDSDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIHR5cGUgb2YgdGhlIHJlc3VsdCBkYXRhLgorICAgICAqCisgICAgICogQHJldHVybgorICAgICAqICAgICAgdGhlIHR5cGUgb2YgdGhlIHJlc3VsdCBkYXRhLgorICAgICAqLworICAgIHB1YmxpYyBhYnN0cmFjdCBUZXN0VHlwZSBnZXRUeXBlKCk7CisKKyAgICBwdWJsaWMgYWJ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YWJhc2VJZGVudGlmaWVyKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgb3V0cHV0ID0gZ2V0U3RyaW5nQnVpbGRlckZvclR5cGUoT3V0cHV0VHlwZS5FWENFRURFRF9EQl9RVU9UQV9NRVNTQUdFKTsKKworICAgICAgICBTdHJpbmcgcHJvdG9jb2wgPSAiIjsKKyAgICAgICAgU3RyaW5nIGhvc3QgPSAiIjsKKyAgICAgICAgaW50IHBvcnQgPSAwOworCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBVUkwgdXJsID0gbmV3IFVSTCh1cmxTdHJpbmcpOworICAgICAgICAgICAgcHJvdG9jb2wgPSB1cmwuZ2V0UHJvdG9jb2woKTsKKyAgICAgICAgICAgIGhvc3QgPSB1cmwuZ2V0SG9zdCgpOworICAgICAgICAgICAgaWYgKHVybC5nZXRQb3J0KCkgPiAtMSkgeworICAgICAgICAgICAgICAgIHBvcnQgPSB1cmwuZ2V0UG9ydCgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChNYWxmb3JtZWRVUkxFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgInVybFN0cmluZz0iICsgdXJsU3RyaW5nICsgIiBkYXRhYmFzZUlkZW50aWZpZXI9IiArIGRhdGFiYXNlSWRlbnRpZmllciwKKyAgICAgICAgICAgICAgICAgICAgZSk7CisgICAgICAgIH0KKworICAgICAgICBvdXRwdXQuYXBwZW5kKCJVSSBERUxFR0FURSBEQVRBQkFTRSBDQUxMQkFDSzogIik7CisgICAgICAgIG91dHB1dC5hcHBlbmQoImV4Y2VlZGVkRGF0YWJhc2VRdW90YUZvclNlY3VyaXR5T3JpZ2luOnsiKTsKKyAgICAgICAgb3V0cHV0LmFwcGVuZChwcm90b2NvbCArICIsICIgKyBob3N0ICsgIiwgIiArIHBvcnQgKyAifSAiKTsKKyAgICAgICAgb3V0cHV0LmFwcGVuZCgiZGF0YWJhc2U6IiArIGRhdGFiYXNlSWRlbnRpZmllciArICJcbiIpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFwcGVuZENvbnNvbGVNZXNzYWdlKENvbnNvbGVNZXNzYWdlIGNvbnNvbGVNZXNzYWdlKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgb3V0cHV0ID0gZ2V0U3RyaW5nQnVpbGRlckZvclR5cGUoT3V0cHV0VHlwZS5DT05TT0xFX01FU1NBR0UpOworCisgICAgICAgIG91dHB1dC5hcHBlbmQoIkNPTlNPTEUgTUVTU0FHRTogbGluZSAiICsgY29uc29sZU1lc3NhZ2UubGluZU51bWJlcigpKTsKKyAgICAgICAgb3V0cHV0LmFwcGVuZCgiOiAiICsgY29uc29sZU1lc3NhZ2UubWVzc2FnZSgpICsgIlxuIik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYXBwZW5kSnNBbGVydChTdHJpbmcgbWVzc2FnZSkgeworICAgICAgICBTdHJpbmdCdWlsZGVyIG91dHB1dCA9IGdldFN0cmluZ0J1aWxkZXJGb3JUeXBlKE91dHB1dFR5cGUuSlNfRElBTE9HKTsKKworICAgICAgICBvdXRwdXQuYXBwZW5kKCJBTEVSVDogIik7CisgICAgICAgIG91dHB1dC5hcHBlbmQobWVzc2FnZSk7CisgICAgICAgIG91dHB1dC5hcHBlbmQoJ1xuJyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYXBwZW5kSnNDb25maXJtKFN0cmluZyBtZXNzYWdlKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgb3V0cHV0ID0gZ2V0U3RyaW5nQnVpbGRlckZvclR5cGUoT3V0cHV0VHlwZS5KU19ESUFMT0cpOworCisgICAgICAgIG91dHB1dC5hcHBlbmQoIkNPTkZJUk06ICIpOworICAgICAgICBvdXRwdXQuYXBwZW5kKG1lc3NhZ2UpOworICAgICAgICBvdXRwdXQuYXBwZW5kKCdcbicpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFwcGVuZEpzUHJvbXB0KFN0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XByZW5kZXJ0cmVlMjsKKworaW1wb3J0IGFuZHJvaWQub3MuQnVuZGxlOworaW1wb3J0IGFuZHJvaWQub3MuTWVzc2FnZTsKK2ltcG9ydCBhbmRyb2lkLndlYmtpdC5XZWJWaWV3OworCisvKioKKyAqIEEgZHVtbXkgY2xhc3MgcmVwcmVzZW50aW5nIHRlc3QgdGhhdCBjcmFzaGVkLgorICoKKyAqIFRPRE86IEFsbCB0aGUgbWV0aG9kcyByZWdhcmRpbmcgZXhwZWN0ZWQgcmVzdWx0cyBuZWVkIGltcGxlbWVudGluZy4KKyAqLworcHVibGljIGNsYXNzIENyYXNoZWREdW1teVJlc3VsdCBleHRlbmRzIEFic3RyYWN0UmVzdWx0IHsKKyAgICBTdHJpbmcgbVJlbGF0aXZlUGF0aDsKKworICAgIHB1YmxpYyBDcmFzaGVkRHVtbXlSZXN1bHQoU3RyaW5nIHJlbGF0aXZlUGF0aCkgeworICAgICAgICBtUmVsYXRpdmVQYXRoID0gcmVsYXRpdmVQYXRoOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBieXRlW10gZ2V0QWN0dWFsSW1hZ2VSZXN1bHQoKSB7CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgZ2V0QWN0dWFsVGV4dFJlc3VsdCgpIHsKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEJ1bmRsZSBnZXRCdW5kbGUoKSB7CisgICAgICAgIC8qKiBUT0RPOiAgKi8KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZyBnZXREaWZmQXNIdG1sKCkgeworICAgICAgICAvKiogVE9ETzogUHJvYmFibHkgc2hvdyBhdCBsZWFzdCBleHBlY3RlZCByZXN1bHRzICovCisgICAgICAgIHJldHVybiAiT29vcHMsIEkgY3Jhc2hlZC4uLiI7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZyBnZXRSZWxhdGl2ZVBhdGgoKSB7CisgICAgICAgIHJldHVybiBtUmVsYXRpdmVQYXRoOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBSZXN1bHRDb2RlIGdldFJlc3VsdENvZGUoKSB7CisgICAgICAgIHJldHVybiBSZXN1bHRDb2RlLk5PX0FDVFVBTF9SRVNVTFQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gZGlkQ3Jhc2goKSB7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIGRpZFRpbWVPdXQoKSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXREaWRUaW1lT3V0KCkgeworICAgICAgICAvKiogVGhpcyBtZXRob2QgaXMgbm90IGFwcGxpY2FibGUgZm9yIHRoaXMgdHlwZSBvZiByZXN1bHQgKi8KKyAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBUZXN0VHlwZSBnZXRUeXBlKCkgeworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvYnRhaW5BY3R1YWxSZXN1bHRzKFdlYlZpZXcgd2VidmlldywgTWVzc2FnZSByZXN1bHRPYnRhaW5lZE1zZykgeworICAgICAgICAvKiogVGhpcyBtZXRob2QgaXMgbm90IGFwcGxpY2FibGUgZm9yIHRoaXMgdHlwZSBvZiByZXN1bHQgKi8KKyAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIH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KKyAgICAgICAgcHJpdmF0ZSBpbnQgbVk7CisgICAgICAgIHByaXZhdGUgbG9uZyBtRG93blRpbWU7CisgICAgICAgIHByaXZhdGUgYm9vbGVhbiBtUmVsZWFzZWQgPSBmYWxzZTsKKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1Nb3ZlZCA9IGZhbHNlOworICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUNhbmNlbGxlZCA9IGZhbHNlOworCisgICAgICAgIHB1YmxpYyBUb3VjaFBvaW50KFdlYlZpZXcgd2ViVmlldywgaW50IGlkLCBpbnQgeCwgaW50IHkpIHsKKyAgICAgICAgICAgIG1XZWJWaWV3ID0gd2ViVmlldzsKKyAgICAgICAgICAgIG1JZCA9IGlkOworICAgICAgICAgICAgbVggPSBzY2FsZVgoeCk7CisgICAgICAgICAgICBtWSA9IHNjYWxlWSh5KTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBpbnQgZ2V0SWQoKSB7CisgICAgICAgICAgcmV0dXJuIG1JZDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBpbnQgZ2V0WCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtWDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBpbnQgZ2V0WSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtWTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGhhc01vdmVkKCkgeworICAgICAgICAgICAgcmV0dXJuIG1Nb3ZlZDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG1vdmUoaW50IG5ld1gsIGludCBuZXdZKSB7CisgICAgICAgICAgICBtWCA9IHNjYWxlWChuZXdYKTsKKyAgICAgICAgICAgIG1ZID0gc2NhbGVZKG5ld1kpOworICAgICAgICAgICAgbU1vdmVkID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHJlc2V0SGFzTW92ZWQoKSB7CisgICAgICAgICAgICBtTW92ZWQgPSBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBsb25nIGdldERvd25UaW1lKCkgeworICAgICAgICAgICAgcmV0dXJuIG1Eb3duVGltZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldERvd25UaW1lKGxvbmcgZG93blRpbWUpIHsKKyAgICAgICAgICAgIG1Eb3duVGltZSA9IGRvd25UaW1lOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNSZWxlYXNlZCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtUmVsZWFzZWQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCByZWxlYXNlKCkgeworICAgICAgICAgICAgbVJlbGVhc2VkID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQ2FuY2VsbGVkKCkgeworICAgICAgICAgICAgcmV0dXJuIG1DYW5jZWxsZWQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBjYW5jZWwoKSB7CisgICAgICAgICAgICBtQ2FuY2VsbGVkID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgaW50IHNjYWxlWChpbnQgeCkgeworICAgICAgICAgICAgcmV0dXJuIChpbnQpKHggKiBtV2ViVmlldy5nZXRTY2FsZSgpKSAtIG1XZWJWaWV3LmdldFNjcm9sbFgoKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgaW50IHNjYWxlWShpbnQgeSkgeworICAgICAgICAgICAgcmV0dXJuIChpbnQpKHkgKiBtV2ViVmlldy5nZXRTY2FsZSgpKSAtIG1XZWJWaWV3LmdldFNjcm9sbFkoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgTGlzdDxUb3VjaFBvaW50PiBtVG91Y2hQb2ludHM7CisgICAgcHJpdmF0ZSBpbnQgbVRvdWNoTWV0YVN0YXRlOworICAgIHByaXZhdGUgaW50IG1Nb3VzZVg7CisgICAgcHJpdmF0ZSBpbnQgbU1vdXNlWTsKKworICAgIHByaXZhdGUgV2ViVmlldyBtV2ViVmlldzsKKworICAgIHByaXZhdGUgSGFuZGxlciBtRXZlbnRTZW5kZXJIYW5kbGVyID0gbmV3IEhhbmRsZXIoKSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CisgICAgICAgICAgICBCdW5kbGUgYnVuZGxlOworICAgICAgICAgICAgTW90aW9uRXZlbnQgZXZlbnQ7CisgICAgICAgICAgICBsb25nIHRzOworCisgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBNU0dfRU5BQkxFX0RPTV9VSV9FVkVOVF9MT0dHSU5HOgorICAgICAgICAgICAgICAgICAgICAvKiogVE9ETzogaW1wbGVtZW50ICovCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBNU0dfRklSRV9LRVlCT0FSRF9FVkVOVFNfVE9fRUxFTUVOVDoKKyAgICAgICAgICAgICAgICAgICAgLyoqIFRPRE86IGltcGxlbWVudCAqLworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0xFQVBfRk9SV0FSRDoKKyAgICAgICAgICAgICAgICAgICAgLyoqIFRPRE86IGltcGxlbWVudCAqLworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0tFWV9ET1dOOgorICAgICAgICAgICAgICAgICAgICBidW5kbGUgPSAoQnVuZGxlKW1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBjaGFyYWN0ZXIgPSBidW5kbGUuZ2V0U3RyaW5nKCJjaGFyYWN0ZXIiKTsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gd2l0aE1vZGlmaWVycyA9IGJ1bmRsZS5nZXRTdHJpbmdBcnJheSgid2l0aE1vZGlmaWVycyIpOworCisgICAgICAgICAgICAgICAgICAgIGlmICh3aXRoTW9kaWZpZXJzICE9IG51bGwgJiYgd2l0aE1vZGlmaWVycy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHdpdGhNb2RpZmllcnMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlS2V5RXZlbnQoS2V5RXZlbnQuQUNUSU9OX0RPV04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZmllclRvS2V5Q29kZSh3aXRoTW9kaWZpZXJzW2ldKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZUtleUV2ZW50KEtleUV2ZW50LkFDVElPTl9ET1dOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJUb0tleUNvZGUoY2hhcmFjdGVyLnRvTG93ZXJDYXNlKCkudG9DaGFyQXJyYXkoKVswXSkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIC8qKiBNT1VTRSAqLworCisgICAgICAgICAgICAgICAgY2FzZSBNU0dfTU9VU0VfRE9XTjoKKyAgICAgICAgICAgICAgICAgICAgdHMgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICAgICAgZXZlbnQgPSBNb3Rpb25FdmVudC5vYnRhaW4odHMsIHRzLCBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTiwgbU1vdXNlWCwgbU1vdXNlWSwgMCk7CisgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Lm9uVG91Y2hFdmVudChldmVudCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBNU0dfTU9VU0VfVVA6CisgICAgICAgICAgICAgICAgICAgIHRzID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgICAgICAgICAgICAgIGV2ZW50ID0gTW90aW9uRXZlbnQub2J0YWluKHRzLCB0cywgTW90aW9uRXZlbnQuQUNUSU9OX1VQLCBtTW91c2VYLCBtTW91c2VZLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXcub25Ub3VjaEV2ZW50KGV2ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19NT1VTRV9DTElDSzoKKyAgICAgICAgICAgICAgICAgICAgbW91c2VEb3duKCk7CisgICAgICAgICAgICAgICAgICAgIG1vdXNlVXAoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19NT1VTRV9NT1ZFX1RPOgorICAgICAgICAgICAgICAgICAgICBtTW91c2VYID0gbXNnLmFyZzE7CisgICAgICAgICAgICAgICAgICAgIG1Nb3VzZVkgPSBtc2cuYXJnMjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAvKiogVE9VQ0ggKi8KKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0FERF9UT1VDSF9QT0lOVDoKKyAgICAgICAgICAgICAgICAgICAgaW50IG51bVBvaW50cyA9IGdldFRvdWNoUG9pbnRzKCkuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICBpbnQgaWQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChudW1Qb2ludHMgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWQgPSAwOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgaWQgPSBnZXRUb3VjaFBvaW50cygpLmdldChudW1Qb2ludHMgLSAxKS5nZXRJZCgpICsgMTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBnZXRUb3VjaFBvaW50cygpLmFkZChuZXcgVG91Y2hQb2ludChtV2ViVmlldywgaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLmFyZzEsIG1zZy5hcmcyKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBNU0dfVE9VQ0hfU1RBUlQ6CisgICAgICAgICAgICAgICAgICAgIGlmIChnZXRUb3VjaFBvaW50cygpLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZ2V0VG91Y2hQb2ludHMoKS5zaXplKCk7ICsraSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZ2V0VG91Y2hQb2ludHMoKS5nZXQoaSkuc2V0RG93blRpbWUoU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVUb3VjaEV2ZW50KE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19VUERBVEVfVE9VQ0hfUE9JTlQ6CisgICAgICAgICAgICAgICAgICAgIGJ1bmRsZSA9IChCdW5kbGUpbXNnLm9iajsKKworICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXggPSBidW5kbGUuZ2V0SW50KCJpZCIpOworICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPj0gZ2V0VG91Y2hQb2ludHMoKS5zaXplKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcgKyAiOjpNU0dfVVBEQVRFX1RPVUNIX1BPSU5UIiwgIlRvdWNoUG9pbnQgb3V0IG9mIGJvdW5kczogIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgZ2V0VG91Y2hQb2ludHMoKS5nZXQoaW5kZXgpLm1vdmUoYnVuZGxlLmdldEludCgieCIpLCBidW5kbGUuZ2V0SW50KCJ5IikpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX1RPVUNIX01PVkU6CisgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgKiBGSVhNRTogQXQgdGhlIG1vbWVudCB3ZSBkb24ndCBzdXBwb3J0IG11bHRpLXRvdWNoLiBIZW5jZSwgd2Ugb25seSBleGFtaW5lCisgICAgICAgICAgICAgICAgICAgICAqIHRoZSBmaXJzdCB0b3VjaCBwb2ludC4gSW4gZnV0dXJlIHRoaXMgbWV0aG9kIHdpbGwgbmVlZCByZXdyaXRpbmcuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0VG91Y2hQb2ludHMoKS5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBleGVjdXRlVG91Y2hFdmVudChNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSk7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZ2V0VG91Y2hQb2ludHMoKS5zaXplKCk7ICsraSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZ2V0VG91Y2hQb2ludHMoKS5nZXQoaSkucmVzZXRIYXNNb3ZlZCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBNU0dfQ0FOQ0VMX1RPVUNIX1BPSU5UOgorICAgICAgICAgICAgICAgICAgICBpZiAobXNnLmFyZzEgPj0gZ2V0VG91Y2hQb2ludHMoKS5zaXplKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcgKyAiOjpNU0dfUkVMRUFTRV9UT1VDSF9QT0lOVCIsICJUb3VjaFBvaW50IG91dCBvZiBib3VuZHM6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtc2cuYXJnMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGdldFRvdWNoUG9pbnRzKCkuZ2V0KG1zZy5hcmcxKS5jYW5jZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19UT1VDSF9DQU5DRUw6CisgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgKiBGSVhNRTogQXQgdGhlIG1vbWVudCB3ZSBkb24ndCBzdXBwb3J0IG11bHRpLXRvdWNoLiBIZW5jZSwgd2Ugb25seSBleGFtaW5lCisgICAgICAgICAgICAgICAgICAgICAqIHRoZSBmaXJzdCB0b3VjaCBwb2ludC4gSW4gZnV0dXJlIHRoaXMgbWV0aG9kIHdpbGwgbmVlZCByZXdyaXRpbmcuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0VG91Y2hQb2ludHMoKS5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBleGVjdXRlVG91Y2hFdmVudChNb3Rpb25FdmVudC5BQ1RJT05fQ0FOQ0VMKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19SRUxFQVNFX1RPVUNIX1BPSU5UOgorICAgICAgICAgICAgICAgICAgICBpZiAobXNnLmFyZzEgPj0gZ2V0VG91Y2hQb2ludHMoKS5zaXplKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcgKyAiOjpNU0dfUkVMRUFTRV9UT1VDSF9QT0lOVCIsICJUb3VjaFBvaW50IG91dCBvZiBib3VuZHM6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtc2cuYXJnMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGdldFRvdWNoUG9pbnRzKCkuZ2V0KG1zZy5hcmcxKS5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBNU0dfVE9VQ0hfRU5EOgorICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICogRklYTUU6IEF0IHRoZSBtb21lbnQgd2UgZG9uJ3Qgc3VwcG9ydCBtdWx0aS10b3VjaC4gSGVuY2UsIHdlIG9ubHkgZXhhbWluZQorICAgICAgICAgICAgICAgICAgICAgKiB0aGUgZmlyc3QgdG91Y2ggcG9pbnQuIEluIGZ1dHVyZSB0aGlzIG1ldGhvZCB3aWxsIG5lZWQgcmV3cml0aW5nLgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKGdldFRvdWNoUG9pbnRzKCkuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZVRvdWNoRXZlbnQoTW90aW9uRXZlbnQuQUNUSU9OX1VQKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIHJlbGVhc2VkIHBvaW50cy4KKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IGdldFRvdWNoUG9pbnRzKCkuc2l6ZSgpIC0gMTsgaSA+PSAwOyAtLWkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnZXRUb3VjaFBvaW50cygpLmdldChpKS5pc1JlbGVhc2VkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRUb3VjaFBvaW50cygpLnJlbW92ZShpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX1NFVF9UT1VDSF9NT0RJRklFUjoKKyAgICAgICAgICAgICAgICAgICAgYnVuZGxlID0gKEJ1bmRsZSltc2cub2JqOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbW9kaWZpZXIgPSBidW5kbGUuZ2V0U3RyaW5nKCJtb2RpZmllciIpOworICAgICAgICAgICAgICAgICAgICBib29sZWFuIGVuYWJsZWQgPSBidW5kbGUuZ2V0Qm9vbGVhbigiZW5hYmxlZCIpOworCisgICAgICAgICAgICAgICAgICAgIGludCBtYXNrID0gMDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCJhbHQiLmVxdWFscyhtb2RpZmllci50b0xvd2VyQ2FzZSgpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbWFzayA9IEtleUV2ZW50Lk1FVEFfQUxUX09OOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJzaGlmdCIuZXF1YWxzKG1vZGlmaWVyLnRvTG93ZXJDYXNlKCkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtYXNrID0gS2V5RXZlbnQuTUVUQV9TSElGVF9PTjsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgiY3RybCIuZXF1YWxzKG1vZGlmaWVyLnRvTG93ZXJDYXNlKCkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtYXNrID0gS2V5RXZlbnQuTUVUQV9TWU1fT047CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoZW5hYmxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTWV0YVN0YXRlIHw9IG1hc2s7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNZXRhU3RhdGUgJj0gfm1hc2s7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0NMRUFSX1RPVUNIX1BPSU5UUzoKKyAgICAgICAgICAgICAgICAgICAgZ2V0VG91Y2hQb2ludHMoKS5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHB1YmxpYyB2b2lkIHJlc2V0KFdlYlZpZXcgd2ViVmlldykgeworICAgICAgICBtV2ViVmlldyA9IHdlYlZpZXc7CisgICAgICAgIG1Ub3VjaFBvaW50cyA9IG51bGw7CisgICAgICAgIG1Ub3VjaE1ldGFTdGF0ZSA9IDA7CisgICAgICAgIG1Nb3VzZVggPSAwOworICAgICAgICBtTW91c2VZID0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBlbmFibGVET01VSUV2ZW50TG9nZ2luZyhpbnQgZG9tTm9kZSkgeworICAgICAgICBNZXNzYWdlIG1zZyA9IG1FdmVudFNlbmRlckhhbmRsZXIub2J0YWluTWVzc2FnZShNU0dfRU5BQkxFX0RPTV9VSV9FVkVOVF9MT0dHSU5HKTsKKyAgICAgICAgbXNnL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oKSB7CisgICAgICAgIG1FdmVudFNlbmRlckhhbmRsZXIuc2VuZEVtcHR5TWVzc2FnZShNU0dfTU9VU0VfRE9XTik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbW91c2VVcCgpIHsKKyAgICAgICAgbUV2ZW50U2VuZGVySGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKE1TR19NT1VTRV9VUCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbW91c2VDbGljaygpIHsKKyAgICAgICAgbUV2ZW50U2VuZGVySGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKE1TR19NT1VTRV9DTElDSyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbW91c2VNb3ZlVG8oaW50IHgsIGludCB5KSB7CisgICAgICAgIG1FdmVudFNlbmRlckhhbmRsZXIub2J0YWluTWVzc2FnZShNU0dfTU9VU0VfTU9WRV9UTywgeCwgeSkuc2VuZFRvVGFyZ2V0KCk7CisgICAgfQorCisgICAgLyoqIFRPVUNIICovCisKKyAgICBwdWJsaWMgdm9pZCBhZGRUb3VjaFBvaW50KGludCB4LCBpbnQgeSkgeworICAgICAgICBtRXZlbnRTZW5kZXJIYW5kbGVyLm9idGFpbk1lc3NhZ2UoTVNHX0FERF9UT1VDSF9QT0lOVCwgeCwgeSkuc2VuZFRvVGFyZ2V0KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdG91Y2hTdGFydCgpIHsKKyAgICAgICAgbUV2ZW50U2VuZGVySGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKE1TR19UT1VDSF9TVEFSVCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdXBkYXRlVG91Y2hQb2ludChpbnQgaWQsIGludCB4LCBpbnQgeSkgeworICAgICAgICBCdW5kbGUgYnVuZGxlID0gbmV3IEJ1bmRsZSgpOworICAgICAgICBidW5kbGUucHV0SW50KCJpZCIsIGlkKTsKKyAgICAgICAgYnVuZGxlLnB1dEludCgieCIsIHgpOworICAgICAg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TsKKworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bVBvaW50czsgKytpKSB7CisgICAgICAgICAgICBib29sZWFuIGlzTmVlZGVkID0gZmFsc2U7CisgICAgICAgICAgICBzd2l0Y2goYWN0aW9uKSB7CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOOgorICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fVVA6CisgICAgICAgICAgICAgICAgaXNOZWVkZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRToKKyAgICAgICAgICAgICAgICBpc05lZWRlZCA9IGdldFRvdWNoUG9pbnRzKCkuZ2V0KGkpLmhhc01vdmVkKCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6CisgICAgICAgICAgICAgICAgaXNOZWVkZWQgPSBnZXRUb3VjaFBvaW50cygpLmdldChpKS5pc0NhbmNlbGxlZCgpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBMb2cudyhMT0dfVEFHICsgIjo6ZXhlY3V0ZVRvdWNoRXZlbnQoKSwiLCAiYWN0aW9uIG5vdCBzdXBwb3J0ZWQ6IiArIGFjdGlvbik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG51bVBvaW50cyA9IDA7CisgICAgICAgICAgICBpZiAoaXNOZWVkZWQpIHsKKyAgICAgICAgICAgICAgICBwb2ludGVySWRzW251bVBvaW50c10gPSBnZXRUb3VjaFBvaW50cygpLmdldChpKS5nZXRJZCgpOworICAgICAgICAgICAgICAgIHBvaW50ZXJDb29yZHNbbnVtUG9pbnRzXSA9IG5ldyBNb3Rpb25FdmVudC5Qb2ludGVyQ29vcmRzKCk7CisgICAgICAgICAgICAgICAgcG9pbnRlckNvb3Jkc1tudW1Qb2ludHNdLnggPSBnZXRUb3VjaFBvaW50cygpLmdldChpKS5nZXRYKCk7CisgICAgICAgICAgICAgICAgcG9pbnRlckNvb3Jkc1tudW1Qb2ludHNdLnkgPSBnZXRUb3VjaFBvaW50cygpLmdldChpKS5nZXRZKCk7CisgICAgICAgICAgICAgICAgKytudW1Qb2ludHM7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAobnVtUG9pbnRzID09IDApIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIE1vdGlvbkV2ZW50IGV2ZW50ID0gTW90aW9uRXZlbnQub2J0YWluKG1Ub3VjaFBvaW50cy5nZXQoMCkuZ2V0RG93blRpbWUoKSwKKyAgICAgICAgICAgICAgICBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSwgYWN0aW9uLAorICAgICAgICAgICAgICAgIG51bVBvaW50cywgcG9pbnRlcklkcywgcG9pbnRlckNvb3JkcywKKyAgICAgICAgICAgICAgICBtVG91Y2hNZXRhU3RhdGUsIDEuMGYsIDEuMGYsIDAsIDAsIDAsIDApOworCisgICAgICAgIG1XZWJWaWV3Lm9uVG91Y2hFdmVudChldmVudCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGV4ZWN1dGVLZXlFdmVudChpbnQgYWN0aW9uLCBpbnQga2V5Q29kZSkgeworICAgICAgICBLZXlFdmVudCBldmVudCA9IG5ldyBLZXlFdmVudChhY3Rpb24sIGtleUNvZGUpOworICAgICAgICBtV2ViVmlldy5vbktleURvd24oZXZlbnQuZ2V0S2V5Q29kZSgpLCBldmVudCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQXNzdW1lcyBsb3dlcmNhc2UgY2hhcnMsIGNhc2UgbmVlZHMgdG8gYmUgaGFuZGxlZCBieSBjYWxsaW5nIGZ1bmN0aW9uLgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGludCBjaGFyVG9LZXlDb2RlKGNoYXIgYykgeworICAgICAgICAvLyBoYW5kbGUgbnVtYmVycworICAgICAgICBpZiAoYyA+PSAnMCcgJiYgYyA8PSAnOScpIHsKKyAgICAgICAgICAgIGludCBvZmZzZXQgPSBjIC0gJzAnOworICAgICAgICAgICAgcmV0dXJuIEtleUV2ZW50LktFWUNPREVfMCArIG9mZnNldDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGhhbmRsZSBjaGFyYWN0ZXJzCisgICAgICAgIGlmIChjID49ICdhJyAmJiBjIDw9ICd6JykgeworICAgICAgICAgICAgaW50IG9mZnNldCA9IGMgLSAnYSc7CisgICAgICAgICAgICByZXR1cm4gS2V5RXZlbnQuS0VZQ09ERV9BICsgb2Zmc2V0OworICAgICAgICB9CisKKyAgICAgICAgLy8gaGFuZGxlIGFsbCBvdGhlcnMKKyAgICAgICAgc3dpdGNoIChjKSB7CisgICAgICAgICAgICBjYXNlICcqJzoKKyAgICAgICAgICAgICAgICByZXR1cm4gS2V5RXZlbnQuS0VZQ09ERV9TVEFSOworCisgICAgICAgICAgICBjYXNlICcjJzoKKyAgICAgICAgICAgICAgICByZXR1cm4gS2V5RXZlbnQuS0VZQ09ERV9QT1VORDsKKworICAgICAgICAgICAgY2FzZSAnLCc6CisgICAgICAgICAgICAgICAgcmV0dXJuIEtleUV2ZW50LktFWUNPREVfQ09NTUE7CisKKyAgICAgICAgICAgIGNhc2UgJy4nOgorICAgICAgICAgICAgICAgIHJldHVybiBLZXlFdmVudC5LRVlDT0RFX1BFUklPRDsKKworICAgICAgICAgICAgY2FzZSAnXHQnOgorICAgICAgICAgICAgICAgIHJldHVybiBLZXlFdmVudC5LRVlDT0RFX1RBQjsKKworICAgICAgICAgICAgY2FzZSAnICc6CisgICAgICAgICAgICAgICAgcmV0dXJuIEtleUV2ZW50LktFWUNPREVfU1BBQ0U7CisKKyAgICAgICAgICAgIGNhc2UgJ1xuJzoKKyAgICAgICAgICAgICAgICByZXR1cm4gS2V5RXZlbnQuS0VZQ09ERV9FTlRFUjsKKworICAgICAgICAgICAgY2FzZSAnXGInOgorICAgICAgICAgICAgY2FzZSAweDdGOgorICAgICAgICAgICAgICAgIHJldHVybiBLZXlFdmVudC5LRVlDT0RFX0RFTDsKKworICAgICAgICAgICAgY2FzZSAnfic6CisgICAgICAgICAgICAgICAgcmV0dXJuIEtleUV2ZW50LktFWUNPREVfR1JBVkU7CisKKyAgICAgICAgICAgIGNhc2UgJy0nOgorICAgICAgICAgICAgICAgIHJldHVybiBLZXlFdmVudC5LRVlDT0RFX01JTlVTOworCisgICAgICAgICAgICBjYXNlICc9JzoKKyAgICAgICAgICAgICAgICByZXR1cm4gS2V5RXZlbnQuS0VZQ09ERV9FUVVBTFM7CisKKyAgICAgICAgICAgIGNhc2UgJygnOgorICAgICAgICAgICAgICAgIHJldHVybiBLZXlFdmVudC5LRVlDT0RFX0xFRlRfQlJBQ0tFVDsKKworICAgICAgICAgICAgY2FzZSAnKSc6CisgICAgICAgICAgICAgICAgcmV0dXJuIEtleUV2ZW50LktFWUNPREVfUklHSFRfQlJBQ0tFVDsKKworICAgICAgICAgICAgY2FzZSAnXFwnOgorICAgICAgICAgICAgICAgIHJldHVybiBLZXlFdmVudC5LRVlDT0RFX0JBQ0tTTEFTSDsKKworICAgICAgICAgICAgY2FzZSAnOyc6CisgICAgICAgICAgICAgICAgcmV0dXJuIEtleUV2ZW50LktFWUNPREVfU0VNSUNPTE9OOworCisgICAgICAgICAgICBjYXNlICdcJyc6CisgICAgICAgICAgICAgICAgcmV0dXJuIEtleUV2ZW50LktFWUNPREVfQVBPU1RST1BIRTsKKworICAgICAgICAgICAgY2FzZSAnLyc6CisgICAgICAgICAgICAgICAgcmV0dXJuIEtleUV2ZW50LktFWUNPREVfU0xBU0g7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIGM7CisgICAgICAgIH0KKyAgICB9C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WxsOworICAgICAgICAgICAgQnVmZmVyZWRSZWFkZXIgYnVmZmVyZWRSZWFkZXIgPSBudWxsOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBidWZmZXJlZFJlYWRlciA9IG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgU3RyaW5nUmVhZGVyKG5ldyBTdHJpbmcoCisgICAgICAgICAgICAgICAgICAgICAgICBGc1V0aWxzLnJlYWREYXRhRnJvbVVybCh1cmwpKSkpOworCisgICAgICAgICAgICAgICAgU3RyaW5nIGxpbmU7CisgICAgICAgICAgICAgICAgU3RyaW5nIGVudHJ5OworICAgICAgICAgICAgICAgIFN0cmluZ1tdIHBhcnRzOworICAgICAgICAgICAgICAgIFN0cmluZyBwYXRoOworICAgICAgICAgICAgICAgIFNldDxTdHJpbmc+IHRva2VuczsKKyAgICAgICAgICAgICAgICB3aGlsZSAodHJ1ZSkgeworICAgICAgICAgICAgICAgICAgICBsaW5lID0gYnVmZmVyZWRSZWFkZXIucmVhZExpbmUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxpbmUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvKiogUmVtb3ZlIHRoZSBjb21tZW50IGFuZCB0cmltICovCisgICAgICAgICAgICAgICAgICAgIGVudHJ5ID0gbGluZS5zcGxpdCgiLy8iLCAyKVswXS50cmltKCk7CisKKyAgICAgICAgICAgICAgICAgICAgLyoqIE9taXQgZW1wdHkgbGluZXMsIGFkdmFuY2UgdG8gbmV4dCBsaW5lICovCisgICAgICAgICAgICAgICAgICAgIGlmIChlbnRyeS5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLyoqIFNwbGl0IG9uIHdoaXRlc3BhY2UgaW50byBwYXRoIHBhcnQgYW5kIHRoZSByZXN0ICovCisgICAgICAgICAgICAgICAgICAgIHBhcnRzID0gZW50cnkuc3BsaXQoIlxccyIsIDIpOworCisgICAgICAgICAgICAgICAgICAgIC8qKiBBdCB0aGlzIHBvaW50IHBhcnRzLmxlbmd0aCA+PSAxICovCisgICAgICAgICAgICAgICAgICAgIGlmIChwYXJ0cy5sZW5ndGggPT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRyArICI6OnJlbG9hZENvbmZpZ3VyYXRpb24iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVGhlcmUgYXJlIG5vIG9wdGlvbnMgc3BlY2lmaWVkIGZvciB0aGUgdGVzdCEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgcGF0aCA9IHRyaW1UcmFpbGluZ1NsYXNoSWZQcmVzZW50KHBhcnRzWzBdKTsKKworICAgICAgICAgICAgICAgICAgICAvKiogU3BsaXQgb24gd2hpdGVzcGFjZSAqLworICAgICAgICAgICAgICAgICAgICB0b2tlbnMgPSBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QocGFydHNbMV0uc3BsaXQoIlxccyIsIDApKSk7CisKKyAgICAgICAgICAgICAgICAgICAgLyoqIENob3NlIHRoZSByaWdodCBjb2xsZWN0aW9ucyB0byBhZGQgdG8gKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHRva2Vucy5jb250YWlucyhUT0tFTl9DUkFTSCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DcmFzaExpc3QuYWRkKHBhdGgpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvKiogSWYgdGVzdCBpcyBvbiBza2lwIGxpc3Qgd2UgaWdub3JlIGFueSBmdXJ0aGVyIG9wdGlvbnMgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRva2Vucy5jb250YWlucyhUT0tFTl9GQUlMKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUZhaWxMaXN0LmFkZChwYXRoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW5zLmNvbnRhaW5zKFRPS0VOX1NMT1cpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtU2xvd0xpc3QuYWRkKHBhdGgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBpZiAoaW5wdXRTdHJlYW0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpbnB1dFN0cmVhbS5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoYnVmZmVyZWRSZWFkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBidWZmZXJlZFJlYWRlci5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy53KExPR19UQUcsICJyZWxvYWRDb25maWd1cmF0aW9uKCk6IEZpbGUgbm90IGZvdW5kOiAiICsgZS5nZXRNZXNzYWdlKCkpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAidXJsPSIgKyB1cmwsIGUpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2hlY2tzIGlmIHRlc3QgaXMgZXhwZWN0ZWQgdG8gY3Jhc2guCisgICAgICoKKyAgICAgKiA8cD4KKyAgICAgKiBQYXRoIGdpdmVuIHNob3Vs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RmFpbChTdHJpbmcgdGVzdFBhdGgpIHsKKyAgICAgICAgZm9yIChTdHJpbmcgcHJlZml4IDogZ2V0UHJlZml4ZXModGVzdFBhdGgpKSB7CisgICAgICAgICAgICBpZiAobUZhaWxMaXN0LmNvbnRhaW5zKHByZWZpeCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDaGVja3MgaWYgdGVzdCBpcyBzbG93IGFuZCBzaG91bGQgaGF2ZSB0aW1lb3V0IGluY3JlYXNlZC4KKyAgICAgKgorICAgICAqIDxwPgorICAgICAqIFBhdGggZ2l2ZW4gc2hvdWxkIHJlbGF0aXZlIHdpdGhpbiBMYXlvdXRUZXN0cyBmb2xkZXIsIGUuZy4gZmFzdC9kb20vZm9vLmh0bWwKKyAgICAgKgorICAgICAqIEBwYXJhbSB0ZXN0UGF0aAorICAgICAqICAgICAgICAgICAgLSBhIHJlbGF0aXZlIHBhdGggd2l0aGluIExheW91dFRlc3RzIGZvbGRlcgorICAgICAqIEByZXR1cm4gaWYgdGhlIHRlc3QgaXMgc2xvdyBhbmQgc2hvdWxkIGhhdmUgdGltZW91dCBpbmNyZWFzZWQuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaXNTbG93KFN0cmluZyB0ZXN0UGF0aCkgeworICAgICAgICBmb3IgKFN0cmluZyBwcmVmaXggOiBnZXRQcmVmaXhlcyh0ZXN0UGF0aCkpIHsKKyAgICAgICAgICAgIGlmIChtU2xvd0xpc3QuY29udGFpbnMocHJlZml4KSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGxpc3Qgb2YgYWxsIHBhdGggcHJlZ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4gU2VlIHJ1bl9hcGFjaGUyLnB5IGFuZCAuY29uZiBmaWxlIGZvciBkZXRhaWxzCisgICAgICAgICAqLworICAgICAgICBpZiAocmVsYXRpdmVQYXRoLnN0YXJ0c1dpdGgoSFRUUF9URVNUU19QQVRIKSkgeworICAgICAgICAgICAgcmVsYXRpdmVQYXRoID0gcmVsYXRpdmVQYXRoLnN1YnN0cmluZyhIVFRQX1RFU1RTX1BBVEgubGVuZ3RoKCkpOworICAgICAgICAgICAgaWYgKHJlbGF0aXZlUGF0aC5zdGFydHNXaXRoKFNTTF9QQVRIKSkgeworICAgICAgICAgICAgICAgIHVybEJhc2UgPSBGb3J3YXJkZXJNYW5hZ2VyLmdldEhvc3RTY2hlbWVQb3J0KHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmVsYXRpdmVQYXRoID0gIkxheW91dFRlc3RzLyIgKyByZWxhdGl2ZVBhdGg7CisgICAgICAgIH0KKworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBVUkwodXJsQmFzZSArIHJlbGF0aXZlUGF0aCk7CisgICAgICAgIH0gY2F0Y2ggKE1hbGZvcm1lZFVSTEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiTWFsZm9ybWVkIFVSTCEiLCBlKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIElmIHRoZSBwYXRoIGNvbnRhaW5zIGV4dGVuc2lvbiAoZS5nIC5mb28gYXQgdGhlIGVuZCBvZiB0aGUgZmlsZSkgdGhlbiBpdCBjaGFuZ2VzCisgICAgICogdGhpcyAoLmZvbykgaW50byBuZXdFbmRpbmcgKHNvIGl0IGhhcyB0byBjb250YWluIHRoZSBkb3QgaWYgd2Ugd2FudCB0byBwcmVzZXJ2ZSBpdCkuCisgICAgICoKKyAgICAgKiA8cD5JZiB0aGUgcGF0a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zSHR0cENsaWVudDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIHZvaWQgd3JpdGVEYXRhVG9TdG9yYWdlKEZpbGUgZmlsZSwgYnl0ZVtdIGJ5dGVzLCBib29sZWFuIGFwcGVuZCkgeworICAgICAgICBMb2cuZChMT0dfVEFHLCAid3JpdGVEYXRhVG9TdG9yYWdlKCk6ICIgKyBmaWxlLmdldEFic29sdXRlUGF0aCgpKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIE91dHB1dFN0cmVhbSBvdXRwdXRTdHJlYW0gPSBudWxsOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBmaWxlLmdldFBhcmVudEZpbGUoKS5ta2RpcnMoKTsKKyAgICAgICAgICAgICAgICBmaWxlLmNyZWF0ZU5ld0ZpbGUoKTsKKyAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAid3JpdGVEYXRhVG9TdG9yYWdlKCk6IEZpbGUgY3JlYXRlZDogIiArIGZpbGUuZ2V0QWJzb2x1dGVQYXRoKCkpOworICAgICAgICAgICAgICAgIG91dHB1dFN0cmVhbSA9IG5ldyBGaWxlT3V0cHV0U3RyZWFtKGZpbGUsIGFwcGVuZCk7CisgICAgICAgICAgICAgICAgb3V0cHV0U3RyZWFtLndyaXRlKGJ5dGVzKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgaWYgKG91dHB1dFN0cmVhbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG91dHB1dFN0cmVhbS5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgImZpbGUuZ2V0QWJzb2x1dGVQYXRoPSIgKyBmaWxlLmdldEFic29sdXRlUGF0aCgpICsgIiBhcHBlbmQ9IiArIGFwcGVuZCwKKyAgICAgICAgICAgICAgICAgICAgZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGJ5dGVbXSByZWFkRGF0YUZyb21TdG9yYWdlKEZpbGUgZmlsZSkgeworICAgICAgICBpZiAoIWZpbGUuZXhpc3RzKCkpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJyZWFkRGF0YUZyb21TdG9yYWdlKCk6IEZpbGUgZG9lcyBub3QgZXhpc3Q6ICIKKyAgICAgICAgICAgICAgICAgICAgKyBmaWxlLmdldEFic29sdXRlUGF0aCgpKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgYnl0ZVtdIGJ5dGVzID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIEZpbGVJbnB1dFN0cmVhbSBmaXMgPSBudWxsOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBmaXMgPSBuZXcgRmlsZUlucHV0U3RyZWFtKGZpbGUpOworICAgICAgICAgICAgICAgIGJ5dGVzID0gbmV3IGJ5dGVbKGludClmaWxlLmxlbmd0aCgpXTsKKyAgICAgICAgICAgICAgICBmaXMucmVhZChieXRlcyk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGlmIChmaXMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmaXMuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJmaWxlLmdldEFic29sdXRlUGF0aD0iICsgZmlsZS5nZXRBYnNvbHV0ZVBhdGgoKSwgZSk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gYnl0ZXM7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBieXRlW10gcmVhZERhdGFGcm9tVXJsKFVSTCB1cmwpIHsKKyAgICAgICAgaWYgKHVybCA9PSBudWxsKSB7CisgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAicmVhZERhdGFGcm9tVXJsKCk6IHVybCBpcyBudWxsISIpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKworICAgICAgICBIdHRwR2V0IGh0dHBSZXF1ZXN0ID0gbmV3IEh0dHBHZXQodXJsLnRvU3RyaW5nKCkpOworICAgICAgICBSZXNwb25zZUhhbmRsZXI8Ynl0ZVtdPiBoYW5kbGVyID0gbmV3IFJlc3BvbnNlSGFuZGxlcjxieXRlW10+KCkgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgYnl0ZVtdIGhhbmRsZVJlc3BvbnNlKEh0dHBSZXNwb25zZSByZXNwb25zZSkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UuZ2V0U3RhdHVzTGluZSgpLmdldFN0YXR1c0NvZGUoKSAhPSBIdHRwU3RhdHVzLlNDX09LKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBIdHRwRW50aXR5IGVudGl0eSA9IHJlc3BvbnNlLmdldEVudGl0eSgpOworICAgICAgICAgICAgICAgIHJldHVybiAoZW50aXR5ID09IG51bGwgPyBudWxsIDogRW50aXR5VXRpbHMudG9CeXRlQXJyYXkoZW50aXR5KSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgYnl0ZVtdIGJ5dGVzID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVE9ETzogTm90IGV4YWN0bHkgc3VyZSB3aHkgc29tZSByZXF1ZXN0cyBoYW5nIGluZGVmaW5pdGVseSwgYnV0IGFkZGluZyB0aGlzCisgICAgICAgICAgICAgKiB0aW1lb3V0IChpbiBzdGF0aWMgZ2V0dGVyIGZvciBodHRwIGNsaWVudCkgaW4gbG9vcCBoZWxwcy4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgYm9vbGVhbiB0aW1lZE91dDsKKyAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICB0aW1lZE91dCA9IGZhbHNlOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGJ5dGVzID0gZ2V0SHR0cENsaWVudCgpLmV4ZWN1dGUoaHR0cFJlcXVlc3QsIGhhbmRsZXIpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFNvY2tldFRpbWVvdXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB0aW1lZE91dCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJFeHBlY3RlZCBTb2NrZXRUaW1lb3V0RXhjZXB0aW9uOiAiICsgdXJsLCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IHdoaWxlICh0aW1lZE91dCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJ1cmw9IiArIHVybCwgZSk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gYnl0ZXM7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBMaXN0PFN0cmluZz4gZ2V0TGF5b3V0VGVzdHNEaXJDb250ZW50cyhTdHJpbmcgZGlyUmVsYXRpdmVQYXRoLCBib29sZWFuIHJlY3Vyc2UsCisgICAgICAgICAgICBib29sZWFuIG1vZGUpIHsKKyAgICAgICAgU3RyaW5nIG1vZGVTdHJpbmcgPSAobW9kZSA/ICJmb2xkZXJzIiA6ICJmaWxlcyIpOworCisgICAgICAgIFVSTCB1cmwgPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgdXJsID0gbmV3IFVSTChTQ1JJUFRfVVJMICsKKyAgICAgICAgICAgICAgICAgICAgIj9wYXRoPSIgKyBkaXJSZWxhdGl2ZVBhdGggKworICAgICAgICAgICAgICAgICAgICAiJnJlY3Vyc2U9IiArIHJlY3Vyc2UgKworICAgICAgICAgICAgICAgICAgICAiJm1vZGU9IiArIG1vZGVTdHJpbmcpOworICAgICAgICB9IGNhdGNoIChNYWxmb3JtZWRVUkxFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgInBhdGg9IiArIGRpclJlbGF0aXZlUGF0aCArICIgcmVjdXJzZT0iICsgcmVjdXJzZSArICIgbW9kZT0iICsKKyAgICAgICAgICAgICAgICAgICAgbW9kZVN0cmluZywgZSk7CisgICAgICAgICAgICByZXR1cm4gbmV3IExpbmtlZExpc3Q8U3RyaW5nPigpOworICAgICAgICB9CisKKyAgICAgICAgSHR0cEdldCBodHRwUmVxdWVzdCA9IG5ldyBIdHRwR2V0KHVybC50b1N0cmluZygpKTsKKyAgICAgICAgUmVzcG9uc2VIYW5kbGVyPExpbmtlZExpc3Q8U3RyaW5nPj4gaGFuZGxlciA9IG5ldyBSZXNwb25zZUhhbmRsZXI8TGlua2VkTGlzdDxTdHJpbmc+PigpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIExpbmtlZExpc3Q8U3RyaW5nPiBoYW5kbGVSZXNwb25zZShIdHRwUmVzcG9uc2UgcmVzcG9uc2UpCisgICAgICAgICAgICAgICAgICAgIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgICAgICAgICAgTGlua2VkTGlzdDxTdHJpbmc+IGxpbmVzID0gbmV3IExpbmtlZExpc3Q8U3RyaW5nPigpOworCisgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLmdldFN0YXR1c0xpbmUoKS5nZXRTdGF0dXNDb2RlKCkgIT0gSHR0cFN0YXR1cy5TQ19PSykgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGluZXM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEh0dHBFbnRpdHkgZW50aXR5ID0gcmVzcG9uc2UuZ2V0RW50aXR5KCk7CisgICAgICAgICAgICAgICAgaWYgKGVudGl0eSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBsaW5lczsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBCdWZmZXJlZFJlYWRlciByZWFkZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEJ1ZmZlcmVkUmVhZGVyKG5ldyBJbnB1dFN0cmVhbVJlYWRlcihlbnRpdHkuZ2V0Q29udGVudCgpKSk7CisgICAgICAgICAgICAgICAgU3RyaW5nIGxpbmU7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChsaW5lID0gcmVhZGVyLnJlYWRMaW5lKCkpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzLmFkZChsaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZWFkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVhZGVyLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICByZXR1cm4gbGluZXM7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBnZXRIdHRwQ2xpZW50KCkuZXhlY3V0ZShodHRwUmVxdWVzdCwgaGFuZGxlcik7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJnZXRMYXlvdXRUZXN0c0RpckNvbnRlbnRzKCk6IEhUVFAgR0VUIGZhaWxlZCBmb3IgVVJMICIgKyB1cmwpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIHZvaWQgY2xvc2VJbnB1dFN0cmVhbShJbnB1dFN0cmVhbSBpbnB1dFN0cmVhbSkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKGlucHV0U3RyZWFtICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpbnB1dFN0cmVhbS5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiQ291bGRuJ3QgY2xvc2Ugc3RyZWFtISIsIGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyB2b2lkIGNsb3NlT3V0cHV0U3RyZWFtKE91dHB1dFN0cmVhbSBvdXRwdXRTdHJlYW0pIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChvdXRwdXRTdHJlYW0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG91dHB1dFN0cmVhbS5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiQ291bGRuJ3QgY2xvc2Ugc3RyZWFtISIsIGUpOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvdGVzdHMvRHVtcFJlbmRlclRyZWUyL3NyYy9jb20vYW5kcm9pZC9kdW1wcmVuZGVydHJlZTIvTGF5b3V0VGVzdENvbnRyb2xsZXIuamF2YSBiL3Rlc3RzL0R1bXBSZW5kZXJUcmVlMi9zcmMvY29tL2FuZHJvaWQvZHVtcHJlbmRlcnRyZWUyL0xheW91dFRlc3RDb250cm9sbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwM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4dChlbmFibGVQaXhlbFRlc3QpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGR1bXBDaGlsZEZyYW1lc0FzVGV4dCgpIHsKKyAgICAgICAgbUxheW91dFRlc3RzRXhlY3V0b3IuZHVtcENoaWxkRnJhbWVzQXNUZXh0KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgZHVtcERhdGFiYXNlQ2FsbGJhY2tzKCkgeworICAgICAgICBtTGF5b3V0VGVzdHNFeGVjdXRvci5kdW1wRGF0YWJhc2VDYWxsYmFja3MoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBub3RpZnlEb25lKCkgeworICAgICAgICBtTGF5b3V0VGVzdHNFeGVjdXRvci5ub3RpZnlEb25lKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb3ZlcnJpZGVQcmVmZXJlbmNlKFN0cmluZyBrZXksIGJvb2xlYW4gdmFsdWUpIHsKKyAgICAgICAgbUxheW91dFRlc3RzRXhlY3V0b3Iub3ZlcnJpZGVQcmVmZXJlbmNlKGtleSwgdmFsdWUpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEFwcENhY2hlTWF4aW11bVNpemUobG9uZyBzaXplKSB7CisgICAgICAgIExvZy5pKExPR19UQUcsICJzZXRBcHBDYWNoZU1heGltdW1TaXplKCkgY2FsbGVkIHdpdGg6ICIgKyBzaXplKTsKKyAgICAgICAgV2ViU3RvcmFnZS5nZXRJbnN0YW5jZSgpLnNldEFwcENhY2hlTWF4aW11bVNpemUoc2l6ZSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0Q2FuT3BlbldpbmRvd3MoKSB7CisgICAgICAgIG1MYXlvdXRUZXN0c0V4ZWN1dG9yLnNldENhbk9wZW5XaW5kb3dzKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0RGF0YWJhc2VRdW90YShsb25nIHF1b3RhKSB7CisgICAgICAgIC8qKiBUT0RPOiBSZXNldCB0aGlzIGJlZm9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nZXJTZXJ2aWNlTWVzc2VuZ2VyOworCisgICAgcHJpdmF0ZSBTZXJ2aWNlQ29ubmVjdGlvbiBtU2VydmljZUNvbm5lY3Rpb24gPSBuZXcgU2VydmljZUNvbm5lY3Rpb24oKSB7CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uU2VydmljZUNvbm5lY3RlZChDb21wb25lbnROYW1lIG5hbWUsIElCaW5kZXIgc2VydmljZSkgeworICAgICAgICAgICAgbU1hbmFnZXJTZXJ2aWNlTWVzc2VuZ2VyID0gbmV3IE1lc3NlbmdlcihzZXJ2aWNlKTsKKyAgICAgICAgICAgIHN0YXJ0VGVzdHMoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VEaXNjb25uZWN0ZWQoQ29tcG9uZW50TmFtZSBuYW1lKSB7CisgICAgICAgICAgICAvKiogVE9ETyAqLworICAgICAgICB9CisgICAgfTsKKworICAgIHByaXZhdGUgZmluYWwgSGFuZGxlciBtUmVzdWx0SGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0FDVFVBTF9SRVNVTFRfT0JUQUlORUQ6CisgICAgICAgICAgICAgICAgICAgIG9uQWN0dWFsUmVzdWx0c09idGFpbmVkKCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBNU0dfVEVTVF9USU1FRF9PVVQ6CisgICAgICAgICAgICAgICAgICAgIG9uVGVzdFRpbWVkT3V0KCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgLyoqIFdFQlZJRVcgQ09ORklHVVJBVElPTiAqLworCisgICAgcHJpdmF0ZSBXZWJWaWV3Q2xpZW50IG1XZWJWaWV3Q2xpZW50ID0gbmV3IFdlYlZpZXdDbGllbnQoKSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvblBhZ2VGaW5pc2hlZChXZWJWaWV3IHZpZXcsIFN0cmluZyB1cmwpIHsKKyAgICAgICAgICAgIC8qKiBTb21lIHRlc3RzIGZpcmUgdXAgbWFueSBwYWdlIGxvYWRzLCB3ZSBkb24ndCB3YW50IHRvIGRldGVjdCB0aGVtICovCisgICAgICAgICAgICBpZiAoIXVybC5lcXVhbHMobUN1cnJlbnRUZXN0VXJpKSkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1DdXJyZW50U3RhdGUgPT0gQ3VycmVudFN0YXRlLlJFTkRFUklOR19QQUdFKSB7CisgICAgICAgICAgICAgICAgb25UZXN0RmluaXNoZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZWRIdHRwQXV0aFJlcXVlc3QoV2ViVmlldyB2aWV3LCBIdHRwQXV0aEhhbmRsZXIgaGFuZGxlciwKKyAgICAgICAgICAgICAgICAgU3RyaW5nIGhvc3QsIFN0cmluZyByZWFsbSkgeworICAgICAgICAgICAgIGlmIChoYW5kbGVyLnVzZUh0dHBBdXRoVXNlcm5hbWVQYXNzd29yZCgpICYmIHZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICBTdHJpbmdbXSBjcmVkZW50aWFscyA9IHZpZXcuZ2V0SHR0cEF1dGhVc2VybmFtZVBhc3N3b3JkKGhvc3QsIHJlYWxtKTsKKyAgICAgICAgICAgICAgICAgaWYgKGNyZWRlbnRpYWxzICE9IG51bGwgJiYgY3JlZGVudGlhbHMubGVuZ3RoID09IDIpIHsKKyAgICAgICAgICAgICAgICAgICAgIGhhbmRsZXIucHJvY2VlZChjcmVkZW50aWFsc1swXSwgY3JlZGVudGlhbHNbMV0pOworICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGhhbmRsZXIuY2FuY2VsKCk7CisgICAgICAgICB9CisKKyAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlZFNzbEVycm9yKFdlYlZpZXcgdmlldywgU3NsRXJyb3JIYW5kbGVyIGhhbmRsZXIsIFNzbEVycm9yIGVycm9yKSB7CisgICAgICAgICAgICAgLy8gV2UgaWdub3JlIFNTTCBlcnJvcnMuIEluIHBhcnRpY3VsYXIsIHRoZSBjZXJ0aWZpY2F0ZSB1c2VkIGJ5IHRoZSBMYXlvdXRUZXN0cyBzZXJ2ZXIKKyAgICAgICAgICAgICAvLyBwcm9kdWNlcyBhbiBlcnJvciBhcyBpdCBsYWNrcyBhIENOIGZpZWxkLgorICAgICAgICAgICAgIGhhbmRsZXIucHJvY2VlZCgpOworICAgICAgICAgfQorICAgIH07CisKKyAgICBwcml2YXRlIFdlYkNocm9tZUNsaWVudCBtV2ViQ2hyb21lQ2xpZW50ID0gbmV3IFdlYkNocm9tZUNsaWVudCgpIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uRXhjZWVkZWREYXRhYmFzZVF1b3RhKFN0cmluZyB1cmwsIFN0cmluZyBkYXRhYmFzZUlkZW50aWZpZXIsCisgICAgICAgICAgICAgICAgbG9uZyBjdXJyZW50UXVvdGEsIGxvbmcgZXN0aW1hdGVkU2l6ZSwgbG9uZyB0b3RhbFVzZWRRdW90YSwKKyAgIC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ZXN1bHQpIHsKKyAgICAgICAgICAgIGdldEN1cnJlbnRBZGRpdGlvbmFsVGV4dE91dHB1dCgpLmFwcGVuZEpzQ29uZmlybShtZXNzYWdlKTsKKyAgICAgICAgICAgIHJlc3VsdC5jb25maXJtKCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbkpzUHJvbXB0KFdlYlZpZXcgdmlldywgU3RyaW5nIHVybCwgU3RyaW5nIG1lc3NhZ2UsIFN0cmluZyBkZWZhdWx0VmFsdWUsCisgICAgICAgICAgICAgICAgSnNQcm9tcHRSZXN1bHQgcmVzdWx0KSB7CisgICAgICAgICAgICBnZXRDdXJyZW50QWRkaXRpb25hbFRleHRPdXRwdXQoKS5hcHBlbmRKc1Byb21wdChtZXNzYWdlLCBkZWZhdWx0VmFsdWUpOworICAgICAgICAgICAgcmVzdWx0LmNvbmZpcm0oKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uQ29uc29sZU1lc3NhZ2UoQ29uc29sZU1lc3NhZ2UgY29uc29sZU1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGdldEN1cnJlbnRBZGRpdGlvbmFsVGV4dE91dHB1dCgpLmFwcGVuZENvbnNvbGVNZXNzYWdlKGNvbnNvbGVNZXNzYWdlKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uQ3JlYXRlV2luZG93KFdlYlZpZXcgdmlldywgYm9vbGVhbiBkaWFsb2csIGJvb2xlYW4gdXNlckdlc3R1cmUsCisgICAgICAgICAgICAgICAgTWVzc2FnZSByZXN1bHRNc2cpIHsKKyAgICAgICAgICAgIFdlYlZpZXcuV2ViVmlld1RyYW5zcG9ydCB0cmFuc3BvcnQgPSAoV2ViVmlldy5XZWJWaWV3VHJhbnNwb3J0KXJlc3VsdE1zZy5vYmo7CisgICAgICAgICAgICAvKiogQnkgZGVmYXVsdCB3aW5kb3dzIGNhbm5vdCBiZSBvcGVuZWQsIHNvIGp1c3Qgc2VuZCBudWxsIGJhY2suICovCisgICAgICAgICAgICBXZWJWaWV3IG5ld1dpbmRvd1dlYlZpZXcgPSBudWxsOworCisgICAgICAgICAgICBpZiAobUNhbk9wZW5XaW5kb3dzKSB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogV2UgbmV2ZXIgZGlzcGxheSB0aGUgbmV3IHdpbmRvdywganVzdCBjcmVhdGUgdGhlIHZpZXcgYW5kIGFsbG93IGl0J3MgY29udGVudCB0bworICAgICAgICAgICAgICAgICAqIGV4ZWN1dGUgYW5kIGJlIHJlY29yZGVkIGJ5IHRoZSBleGVjdXRvci4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBuZXdXaW5kb3dXZWJWaWV3ID0gY3JlYXRlV2ViVmlld1dpdGhKYXZhc2NyaXB0SW50ZXJmYWNlcygpOworICAgICAgICAgICAgICAgIHNldHVwV2ViVmlldyhuZXdXaW5kb3dXZWJWaWV3KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdHJhbnNwb3J0LnNldFdlYlZpZXcobmV3V2luZG93V2ViVmlldyk7CisgICAgICAgICAgICByZXN1bHRNc2cuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkdlb2xvY2F0aW9uUGVybWlzc2lvbnNTaG93UHJvbXB0KFN0cmluZyBvcmlnaW4sCisgICAgICAgICAgICAgICAgR2VvbG9jYXRpb25QZXJtaXNzaW9ucy5DYWxsYmFjayBjYWxsYmFjaykg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BpbiBhIHN0cmFuZ2Ugc3RhdGUsIHdoZXJlIGludGVudHMgZG9uJ3QgcmV2aXZlIGl0LgorICAgICAgICAgKiBIb3dldmVyLCB3ZSBzZW5kIHRoZSBtZXNzYWdlIHRvIHRoZSBzZXJ2aWNlIHRvIHNwZWVkIHVwIHRoZSByZWJvb3RpbmcKKyAgICAgICAgICogKHdlIGRvbid0IGhhdmUgdG8gd2FpdCBmb3IgdGltZS1vdXQgdG8ga2ljayBpbikuCisgICAgICAgICAqLworICAgICAgICBUaHJlYWQuc2V0RGVmYXVsdFVuY2F1Z2h0RXhjZXB0aW9uSGFuZGxlcihuZXcgVW5jYXVnaHRFeGNlcHRpb25IYW5kbGVyKCkgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgdm9pZCB1bmNhdWdodEV4Y2VwdGlvbihUaHJlYWQgdGhyZWFkLCBUaHJvd2FibGUgZSkgeworICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAib25UZXN0Q3Jhc2hlZCgpOiAiICsgbUN1cnJlbnRUZXN0UmVsYXRpdmVQYXRoICsgIiB0aHJlYWQ9IiArIHRocmVhZCwgZSk7CisKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBNZXNzYWdlIHNlcnZpY2VNc2cgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2Uub2J0YWluKG51bGwsIE1hbmFnZXJTZXJ2aWNlLk1TR19DVVJSRU5UX1RFU1RfQ1JBU0hFRCk7CisKKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXJTZXJ2aWNlTWVzc2VuZ2VyLnNlbmQoc2VydmljZU1zZyk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUyKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJtQ3VycmVudFRlc3RSZWxhdGl2Z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PSBuZXcgQnVuZGxlKCk7CisgICAgICAgICAgICBidW5kbGUucHV0U3RyaW5nKCJmaXJzdFRlc3QiLCBtVGVzdHNMaXN0LmdldCgwKSk7CisgICAgICAgICAgICBidW5kbGUucHV0SW50KCJpbmRleCIsIG1DdXJyZW50VGVzdEluZGV4KTsKKworICAgICAgICAgICAgc2VydmljZU1zZy5zZXREYXRhKGJ1bmRsZSk7CisgICAgICAgICAgICBtTWFuYWdlclNlcnZpY2VNZXNzZW5nZXIuc2VuZChzZXJ2aWNlTXNnKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJFcnJvciBzZW5kaW5nIG1lc3NhZ2UgdG8gbWFuYWdlciBzZXJ2aWNlOiIsIGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJ1bk5leHRUZXN0KCkgeworICAgICAgICBhc3NlcnQgbUN1cnJlbnRTdGF0ZSA9PSBDdXJyZW50U3RhdGUuSURMRSA6ICJtQ3VycmVudFN0YXRlID0gIiArIG1DdXJyZW50U3RhdGUubmFtZSgpOworCisgICAgICAgIGlmIChtVGVzdHNMaXN0LmlzRW1wdHkoKSkgeworICAgICAgICAgICAgb25BbGxUZXN0c0ZpbmlzaGVkKCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBtQ3VycmVudFRlc3RSZWxhdGl2ZVBhdGggPSBtVGVzdHNMaXN0LnJlbW92ZSgwKTsKKworICAgICAgICBMb2cuaShMT0dfVEFHLCAicnVuTmV4dFRlc3QoKTogU3RhcnQ6ICIgKyBtQ3VycmVudFRlc3RSZWxhdGl2ZVBhdGggKworICAgICAgICAgICAgICAgICIgKCIgKyBtQ3VycmVudFRlc3RJbmRleCArICIpIik7CisKKyAgICAgICAgbUN1cnJlbnRUZXN0VXJpID0gRmlsZUZpbHRlci5nZXRVcmwobUN1cnJlbnRUZXN0U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0gQ3VycmVudFN0YXRlLk9CVEFJTklOR19SRVNVTFQ7CisKKyAgICAgICAgaWYgKG1DdXJyZW50VGVzdFRpbWVkT3V0KSB7CisgICAgICAgICAgICBtQ3VycmVudFJlc3VsdC5zZXREaWRUaW1lT3V0KCk7CisgICAgICAgIH0KKyAgICAgICAgbUN1cnJlbnRSZXN1bHQub2J0YWluQWN0dWFsUmVzdWx0cyhtQ3VycmVudFdlYlZpZXcsCisgICAgICAgICAgICAgICAgbVJlc3VsdEhhbmRsZXIub2J0YWluTWVzc2FnZShNU0dfQUNUVUFMX1JFU1VMVF9PQlRBSU5FRCkpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBvbkFjdHVhbFJlc3VsdHNPYnRhaW5lZCgpIHsKKyAgICAgICAgYXNzZXJ0IG1DdXJyZW50U3RhdGUgPT0gQ3VycmVudFN0YXRlLk9CVEFJTklOR19SRVNVTFQKKyAgICAgICAgICAgICAgICA6ICJtQ3VycmVudFN0YXRlID0gIiArIG1DdXJyZW50U3RhdGUubmFtZSgpOworCisgICAgICAgIExvZy5pKExPR19UQUcsICJvbkFjdHVhbFJlc3VsdHNPYnRhaW5lZCgpOiAiICsgbUN1cnJlbnRUZXN0UmVsYXRpdmVQYXRoKTsKKyAgICAgICAgbUN1cnJlbnRTdGF0ZSA9IEN1cnJlbnRTdGF0ZS5JRExFOworCisgICAgICAgIHJlcG9ydFJlc3VsdFRvU2VydmljZSgpOworICAgICAgICBtQ3VycmVudFRlc3RJbmRleCsrOworICAgICAgICB1cGRhdGVQcm9ncmVzc0JhcigpOworICAgICAgICBydW5OZXh0VGVzdCgpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZXBvcnRSZXN1bHRUb1NlcnZpY2UoKSB7CisgICAgICAgIGlmIChtQ3VycmVudEFkZGl0aW9uYWxUZXh0T3V0cHV0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1DdXJyZW50UmVzdWx0LnNldEFkZGl0aW9uYWxUZXh0T3V0cHV0U3RyaW5nKG1DdXJyZW50QWRkaXRpb25hbFRleHRPdXRwdXQudG9TdHJpbmcoKSk7CisgICAgICAgIH0KKworICAgICAgICB0cnkgeworICAgICAgICAgICAgTWVzc2FnZSBzZXJ2aWNlTXNnID0KKyAgICAgICAgICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obnVsbCwgTWFuYWdlclNlcnZpY2UuTVNHX1BST0NFU1NfQUNUVUFMX1JFU1VMVFMpOworCisgICAgICAgICAgICBCdW5kbGUgYnVuZGxlID0gbUN1cnJlbnRSZXN1bHQuZ2V0QnVuZGxlKCk7CisgICAgICAgICAgICBidW5kbGUucHV0SW50KCJ0ZXN0SW5kZXgiLCBtQ3VycmVudFRlc3RJbmRleCk7CisgICAgICAgICAgICBpZiAoIW1UZXN0c0xpc3QuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgYnVuZGxlLnB1dFN0cmluZygibmV4dFRlc3QiLCBtVGVzdHNMaXN0LmdldCgwKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNlcnZpY2VNc2cuc2V0RGF0YShidW5kbGUpOworICAgICAgICAgICAgbU1hbmFnZXJTZXJ2aWNlTWVzc2VuZ2VyLnNlbmQoc2VydmljZU1zZyk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAibUN1cnJlbnRUZXN0UmVsYXRpdmVQYXRoPSIgKyBtQ3VycmVudFRlc3RSZWxhdGl2ZVBhdGgsIGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZVByb2dyZXNzQmFyKCkgeworICAgICAgICBnZXRXaW5kb3coKS5zZXRGZWF0dXJlSW50KFdpbmRvdy5GRUFUVVJFX1BST0dSRVNTLAorICAgICAgICAgICAgICAgIG1DdXJyZW50VGVzdEluZGV4ICogV2luZG93LlBST0dSRVNTX0VORCAvIG1Ub3RhbFRlc3RDb3VudCk7CisgICAgICAgIHNldFRpdGxlKG1DdXJyZW50VGVzdEluZGV4ICogMTAwIC8gbVRvdGFsVGVzdENvdW50ICsgIiUgIiArCisgICAgICAgICAgICAgICAgIigiICsgbUN1cnJlbnRUZXN0SW5kZXggKyAiLyIgKyBtVG90YWxUZXN0Q291bnQgKyAiKSIpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBvbkFsbFRlc3RzRmluaXNoZWQoKSB7CisgICAgICAgIG1TY3JlZW5EaW1Mb2NrLnJlbGVhc2UoKTsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgTWVzc2FnZSBzZXJ2aWNlTXNnID0KKyAgICAgICAgICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obnVsbCwgTWFuYWdlclNlcnZpY2UuTVNHX0FMTF9URVNUU19GSU5JU0hFRCk7CisgICAgICAgICAgICBtTWFuYWdlclNlcnZpY2VNZXNzZW5nZXIuc2VuZChzZXJ2aWNlTXNnKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJtQ3VycmVudFRlc3RSZWxhdGl2ZVBhdGg9IiArIG1DdXJyZW50VGVzdFJlbGF0aXZlUGF0aCwgZSk7CisgICAgICAgIH0KKworICAgICAgICB1bmJpbmRTZXJ2aWNlKG1TZXJ2aWNlQ29ubmVjdGlvbik7CisgICAgfQorCisgICAgcHJpdmF0ZSBBZGRpdGlvbmFsVGV4dE91dHB1dCBnZXRDdXJyZW50QWRkaXRpb25hbFRleHRPdXRwdXQoKSB7CisgICAgICAgIGlmIChtQ3VycmVudEFkZGl0aW9uYWxUZXh0T3V0cHV0ID09IG51bGwpIHsKKyAgICAgICAgICAgIG1DdXJyZW50QWRkaXRpb25hbFRleHRPdXRwdXQgPSBuZXcgQWRkaXRpb25hbFRleHRPdXRwdXQoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUN1cnJl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IGZpbmFsIFN0cmluZyBXRUJLSVRfVVNFU19QQUdFX0NBQ0hFX1BSRUZFUkVOQ0VfS0VZID0gIldlYktpdFVzZXNQYWdlQ2FjaGVQcmVmZXJlbmNlS2V5IjsKKworICAgIEhhbmRsZXIgbUxheW91dFRlc3RDb250cm9sbGVySGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICAgICAgYXNzZXJ0IG1DdXJyZW50U3RhdGUuaXNSdW5uaW5nU3RhdGUoKSA6ICJtQ3VycmVudFN0YXRlID0gIiArIG1DdXJyZW50U3RhdGUubmFtZSgpOworCisgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBNU0dfRFVNUF9BU19URVhUOgorICAgICAgICAgICAgICAgICAgICBpZiAobUN1cnJlbnRSZXN1bHQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRSZXN1bHQgPSBuZXcgVGV4dFJlc3VsdChtQ3VycmVudFRlc3RSZWxhdGl2ZVBhdGgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGFzc2VydCBtQ3VycmVudFJlc3VsdCBpbnN0YW5jZW9mIFRleHRSZXN1bHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJtQ3VycmVudFJlc3VsdCBpbnN0YW5jZW9mIiArIG1DdXJyZW50UmVzdWx0LmdldENsYXNzKCkuZ2V0TmFtZSgpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0RVTVBfQ0hJTERfRlJBTUVTX0FTX1RFWFQ6CisgICAgICAgICAgICAgICAgICAgIC8qKiBJZiBkdW1wQXNUZXh0IHdhcyBub3QgY2FsbGVkIHdlIGFzc3VtZSB0aGF0IHRoZSByZXN1bHQgc2hvdWxkIGJlIHRleHQgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1DdXJyZW50UmVzdWx0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50UmVzdWx0ID0gbmV3IFRleHRSZXN1bHQobUN1cnJlbnRUZXN0UmVsYXRpdmVQYXRoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGFzc2VydCBtQ3VycmVudFJlc3VsdCBpbnN0YW5jZW9mIFRleHRSZXN1bHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJtQ3VycmVudFJlc3VsdCBpbnN0YW5jZW9mIiArIG1DdXJyZW50UmVzdWx0LmdldENsYXNzKCkuZ2V0TmFtZSgpOworCisgICAgICAgICAgICAgICAgICAgICgoVGV4dFJlc3VsdCltQ3VycmVudFJlc3VsdCkuc2V0RHVtcENoaWxkRnJhbWVzQXNUZXh0KHRydWUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0RVTVBfREFUQUJBU0VfQ0FMTEJBQ0tTOgorICAgICAgICAgICAgICAgICAgICBtRHVtcERhdGFiYXNlQ2FsbGJhY2tzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19OT1RJRllfRE9ORToKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1DdXJyZW50U3RhdGUgPT0gQ3VycmVudFN0YXRlLldBSVRJTkdfRk9SX0FTWU5DSFJPTk9VU19URVNUKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvblRlc3RGaW5pc2hlZCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBNU0dfT1ZFUlJJREVfUFJFRkVSRU5DRToKKyAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAqIFRPRE86IFdlIHNob3VsZCBsb29rIHVwIHRoZSBjb3JyZWN0IFdlYlZpZXcgZm9yIHRoZSBmcmFtZSB3aGljaAorICAgICAgICAgICAgICAgICAgICAgKiBjYWxsZWQgdGhlIGxheW91dFRlc3RDb250cm9sbGVyIG1ldGhvZC4gQ3VycmVudGx5LCB3ZSBqdXN0IHVzZSB0aGUKKyAgICAgICAgICAgICAgICAgICAgICogV2ViVmlldyBmb3IgdGhlIG1haW4gZnJhbWUuIEV2ZW50U2VuZGVyIHN1ZmZlcnMgZnJvbSB0aGUgc2FtZQorICAgICAgICAgICAgICAgICAgICAgKiBwcm9ibGVtLgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IG1zZy5nZXREYXRhKCkuZ2V0U3RyaW5nKCJrZXkiKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiB2YWx1ZSA9IG1zZy5nZXREYXRhKCkuZ2V0Qm9vbGVhbigidmFsdWUiKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKFdFQktJVF9PRkZMSU5FX1dFQl9BUFBMSUNBVElPTl9DQUNIRV9FTkFCTEVELmVxdWFscyhrZXkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFdlYlZpZXcuZ2V0U2V0dGluZ3MoKS5zZXRBcHBDYWNoZUVuYWJsZWQodmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKFdFQktJVF9VU0VTX1BBR0VfQ0FDSEVfUFJFRkVSRU5DRV9LRVkuZXF1YWxzKGtleSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIENhY2hlIHRoZSBtYXhpbXVtIHBvc3NpYmxlIG51bWJlciBvZiBwYWdlcy4KKyAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50V2ViVmlldy5nZXRTZXR0aW5ncygpLnNldFBhZ2VDYWNoZUNhcGFjaXR5KEludGVnZXIuTUFYX1ZBTFVFKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJMYXlvdXRUZXN0Q29udHJvbGxlci5vdmVycmlkZVByZWZlcmVuY2UoKTogIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVW5zdXBwb3J0ZWQgcHJlZmVyZW5jZSAnIiArIGtleSArICInIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19TRVRfQ0FOX09QRU5fV0lORE9XUzoKKyAgICAgICAgICAgICAgICAgICAgbUNhbk9wZW5XaW5kb3dzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19TRVRfR0VPTE9DQVRJT05fUEVSTUlTU0lPTjoKKyAgICAgICAgICAgICAgICAgICAgbUlzR2VvbG9jYXRpb25QZXJtaXNzaW9uU2V0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgbUdlb2xvY2F0aW9uUGVybWlzc2lvbiA9IG1zZy5hcmcxID09IDE7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1QZW5kaW5nR2VvbG9jYXRpb25QZXJtaXNzaW9uQ2FsbGJhY2tzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEl0ZXJhdG9yPEdlb2xvY2F0aW9uUGVybWlzc2lvbnMuQ2FsbGJhY2s+IGl0ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGVuZGluZ0dlb2xvY2F0aW9uUGVybWlzc2lvbkNhbGxiYWNrcy5rZXlTZXQoKS5pdGVyYXRvcigpOworICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGl0ZXIuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgR2VvbG9jYXRpb25QZXJtaXNzaW9ucy5DYWxsYmFjayBjYWxsYmFjayA9IGl0ZXIubmV4dCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBvcmlnaW4gPSBtUGVuZGluZ0dlb2xvY2F0aW9uUGVybWlzc2lvbkNhbGxiYWNrcy5nZXQoY2FsbGJhY2spOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLmludm9rZShvcmlnaW4sIG1HZW9sb2NhdGlvblBlcm1pc3Npb24sIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1QZW5kaW5nR2VvbG9jYXRpb25QZXJtaXNzaW9uQ2FsbGJhY2tzID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX1NFVF9YU1NfQVVESVRPUl9FTkFCTEVEOgorICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFdlYlZpZXcuZ2V0U2V0dGluZ3MoKS5zZXRYU1NBdWRpdG9yRW5hYmxlZChtc2cuYXJnMSA9PSAxKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19XQUlUX1VOVElMX0RPTkU6CisgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50U3RhdGUgPSBDdXJyZW50U3RhdGUuV0FJVElOR19GT1JfQVNZTkNIUk9OT1VTX1RFU1Q7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgYXNzZXJ0IGZhbHNlIDogIm1zZy53aGF0PSIgKyBtc2cud2hhdDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9C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lvbigiICsgY2FuUHJvdmlkZUFscGhhICsKKyAgICAgICAgICAgICAgICAiLCAiICsgYWxwaGEgKyAiLCAiICsgY2FuUHJvdmlkZUJldGEgKyAiLCAiICsgYmV0YSArICIsICIgKyBjYW5Qcm92aWRlR2FtbWEgKworICAgICAgICAgICAgICAgICIsICIgKyBnYW1tYSArICIpIik7CisgICAgICAgIG1DdXJyZW50V2ViVmlldy5zZXRNb2NrRGV2aWNlT3JpZW50YXRpb24oY2FuUHJvdmlkZUFscGhhLCBhbHBoYSwgY2FuUHJvdmlkZUJldGEsIGJldGEsCisgICAgICAgICAgICAgICAgY2FuUHJvdmlkZUdhbW1hLCBnYW1tYSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0WFNTQXVkaXRvckVuYWJsZWQoYm9vbGVhbiBmbGFnKSB7CisgICAgICAgIExvZy5pKExPR19UQUcsIG1DdXJyZW50VGVzdFJlbGF0aXZlUGF0aCArICI6IHNldFhTU0F1ZGl0b3JFbmFibGVkKCIgKyBmbGFnICsgIikgY2FsbGVkIik7CisgICAgICAgIE1lc3NhZ2UgbXNnID0gbUxheW91dFRlc3RDb250cm9sbGVySGFuZGxlci5vYnRhaW5NZXNzYWdlKE1TR19TRVRfWFNTX0FVRElUT1JfRU5BQkxFRCk7CisgICAgICAgIG1zZy5hcmcxID0gZmxhZyA/IDEgOiAwOworICAgICAgICBtc2cuc2VuZFRvVGFyZ2V0KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgd2FpdFVudGlsRG9uZSgpIHsKKyAgICAgICAgTG9nLmkoTE9HX1RBRywgbUN1cnJlbnRUZXN0UmVsYXRpdmVQYXRoICsgIjogd2FpdFVudGlsRG9uZSgpIGNhbGxlZCIpOworICAgICAgICBtTGF5b3V0VGVzdENvbnRyb2xsZXJIYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2UoTVNHX1dBSVRfVU5USUxfRE9ORSk7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvdGVzdHMv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c3QiKSwgYnVuZGxlLmdldEludCgiaW5kZXgiKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBNU0dfUFJPQ0VTU19BQ1RVQUxfUkVTVUxUUzoKKyAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywibUluY29taW5nSGFuZGxlcjogIiArIG1zZy5nZXREYXRhKCkuZ2V0U3RyaW5nKCJyZWxhdGl2ZVBhdGgiKSk7CisgICAgICAgICAgICAgICAgICAgIG9uQWN0dWFsUmVzdWx0c09idGFpbmVkKG1zZy5nZXREYXRhKCkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgTVNHX0NVUlJFTlRfVEVTVF9DUkFTSEVEOgorICAgICAgICAgICAgICAgICAgICBtSW50ZXJuYWxNZXNzYWdlc0hhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTVNHX0NSQVNIX1RJTUVPVVRfRVhQSVJFRCk7CisgICAgICAgICAgICAgICAgICAgIG9uVGVzdENyYXNoZWQoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19BTExfVEVTVFNfRklOSVNIRUQ6CisgICAgICAgICAgICAgICAgICAgIC8qKiBXZSBydW4gaXQgaW4gYSBzZXBhcmF0ZSB0aHJlYWQgdG8gYXZvaWQgQU5SICovCisgICAgICAgICAgICAgICAgICAgIG5ldyBUaHJlYWQoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3VtbWFyaXplci5zZXRUZXN0c1JlbGF0aXZlUGF0aChtQWxsVGVzdHNSZWxhdGl2ZVBhdGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gTWVzc2FnZS5vYnRhaW4obUludGVybmFsTWVzc2FnZXNIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVNHX1NVTU1BUklaRVJfRE9ORSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN1bW1hcml6ZXIuc3VtbWFyaXplKG1zZyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0uc3RhcnQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisKKyAgICBwcml2YXRlIE1lc3NlbmdlciBtTWVzc2VuZ2VyID0gbmV3IE1lc3NlbmdlcihtSW5jb21pbmdIYW5kbGVyKTsKKworICAgIHByaXZhdGUgSGFuZGxlciBtSW50ZXJuYWxNZXNzYWdlc0hhbmRsZXIgPSBuZXcgSGFuZGxlcigpIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19DUkFTSF9USU1FT1VUX0VYUElSRUQ6CisgICAgICAgICAgICAgICAgICAgIG9uVGVzdENyYXNoZWQoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19TVU1NQVJJWkVSX0RPTkU6CisgICAgICAgICAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KE1hbmFnZXJTZXJ2aWNlLnRoaXMsIFRlc3RzTGlzdEFjdGl2aXR5LmNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgaW50ZW50LnNldEFjdGlvbihJbnRlbnQuQUNUSU9OX1NIVVRET1dOKTsKKyAgICAgICAgICAgICAgICAgICAgLyoqIFRoaXMgZmxhZyBpcyBuZWVkZWQgYmVjYXVzZSB3ZSBzZW5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cihtRmlsZUZpbHRlciwgUkVTVUxUU19ST09UX0RJUl9QQVRILCBnZXRBcHBsaWNhdGlvbkNvbnRleHQoKSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGludCBvblN0YXJ0Q29tbWFuZChJbnRlbnQgaW50ZW50LCBpbnQgZmxhZ3MsIGludCBzdGFydElkKSB7CisgICAgICAgIG1BbGxUZXN0c1JlbGF0aXZlUGF0aCA9IGludGVudC5nZXRTdHJpbmdFeHRyYSgicGF0aCIpOworICAgICAgICBhc3NlcnQgbUFsbFRlc3RzUmVsYXRpdmVQYXRoICE9IG51bGw7CisgICAgICAgIHJldHVybiBTVEFSVF9TVElDS1k7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIElCaW5kZXIgb25CaW5kKEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgcmV0dXJuIG1NZXNzZW5nZXIuZ2V0QmluZGVyKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIG9uQWN0dWFsUmVzdWx0c09idGFpbmVkKEJ1bmRsZSBidW5kbGUpIHsKKyAgICAgICAgbUludGVybmFsTWVzc2FnZXNIYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE1TR19DUkFTSF9USU1FT1VUX0VYUElSRUQpOworICAgICAgICBlbnN1cmVOZXh0VGVzdFNldHVwKGJ1bmRsZS5nZXRTdHJpbmcoIm5leHRUZXN0IiksIGJ1bmRsZS5nZXRJbnQoInRlc3RJbmRleCIpICsgMSk7CisKKyAgICAgICAgQWJzdHJhY3RSZXN1bHQgcmVzdWx0cyA9CisgICAgICAgICAgICAgICAgQWJzdHJhY3RSZXN1bHQuVGVzdFR5cGUudmFsdWVPZihidW5kbGUuZ2V0U3RyaW5nKCJ0eXBlIikpLmNyZWF0ZVJlc3VsdChidW5kbGUpOworCisgICAgICAgIExvZy5pKExPR19UQUcsICJvbkFjdHVhbFJlc3VsdE9idGFpbmVkOiAiICsgcmVzdWx0cy5nZXR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sYXNzIFN1bW1hcml6ZXIgeworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIExPR19UQUcgPSAiU3VtbWFyaXplciI7CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ1NTID0KKyAgICAgICAgICAgICI8c3R5bGUgdHlwZT1cInRleHQvY3NzXCI+IiArCisgICAgICAgICAgICAiKiB7IiArCisgICAgICAgICAgICAiICAgICAgIGZvbnQtZmFtaWx5OiBWZXJkYW5hOyIgKworICAgICAgICAgICAgIiAgICAgICBib3JkZXI6IDA7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbjogMDsiICsKKyAgICAgICAgICAgICIgICAgICAgcGFkZGluZzogMDt9IiArCisgICAgICAgICAgICAiYm9keSB7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbjogMTBweDt9IiArCisgICAgICAgICAgICAiaDEgeyIgKworICAgICAgICAgICAgIiAgICAgICBmb250LXNpemU6IDI0cHg7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbjogNHB4IDAgNHB4IDA7fSIgKworICAgICAgICAgICAgImgyIHsiICsKKyAgICAgICAgICAgICIgICAgICAgZm9udC1zaXplOjE4cHg7IiArCisgICAgICAgICAgICAiICAgICAgIHRleHQtdHJhbnNmb3JtOiB1cHBlcmNhc2U7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbjogMjBweCAwIDNweCAwO30iICsKKyAgICAgICAgICAgICJoMywgaDMgYSB7IiArCisgICAgICAgICAgICAiICAgICAgIGZvbnQtc2l6ZTogMTRweDsiICsKKyAgICAgICAgICAgICIgICAgICAgY29sb3I6IGJsYWNrOyIgKworICAgICAgICAgICAgIiAgICAgICB0ZXh0LWRlY29yYXRpb246IG5vbmU7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbi10b3A6IDRweDsiICsKKyAgICAgICAgICAgICIgICAgICAgbWFyZ2luLWJvdHRvbTogMnB4O30iICsKKyAgICAgICAgICAgICJoMyBhIHNwYW4ucGF0aCB7IiArCisgICAgICAgICAgICAiICAgICAgIHRleHQtZGVjb3JhdGlvbjogdW5kZXJsaW5lO30iICsKKyAgICAgICAgICAgICJoMyBzcGFuLnRyaSB7IiArCisgICAgICAgICAgICAiICAgICAgIHRleHQtZGVjb3JhdGlvbjogbm9uZTsiICsKKyAgICAgICAgICAgICIgICAgICAgZmxvYXQ6IGxlZnQ7IiArCisgICAgICAgICAgICAiICAgICAgIHdpZHRoOiAyMHB4O30iICsKKyAgICAgICAgICAgICJoMyBzcGFuLnNxciB7IiArCisgICAgICAgICAgICAiICAgICAgIHRleHQtZGVjb3JhdGlvbjogbm9uZTsiICsKKyAgICAgICAgICAgICIgICAgICAgZmxvYXQ6IGxlZnQ7IiArCisgICAgICAgICAgICAiICAgICAgIHdpZHRoOiAyMHB4O30iICsKKyAgICAgICAgICAgICJoMyBzcGFuLnNxcl9wYXNzIHsiICsKKyAgICAgICAgICAgICIgICAgICAgY29sb3I6ICM4ZWUxMDA7fSIgKworICAgICAgICAgICAgImgzIHNwYW4uc3FyX2ZhaWwgeyIgKworICAgICAgICAgICAgIiAgICAgICBjb2xvcjogI2MzMDAwMDt9IiArCisgICAgICAgICAgICAic3Bhbi5zb3VyY2UgeyIgKworICAgICAgICAgICAgIiAgICAgICBkaXNwbGF5OiBibG9jazsiICsKKyAgICAgICAgICAgICIgICAgICAgZm9udC1zaXplOiAxMHB4OyIgKworICAgICAgICAgICAgIiAgICAgICBjb2xvcjogIzg4ODsiICsKKyAgICAgICAgICAgICIgICAgICAgbWFyZ2luLWxlZnQ6IDIwcHg7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbi1ib3R0b206IDFweDt9IiArCisgICAgICAgICAgICAic3Bhbi5zb3VyY2UgYSB7IiArCisgICAgICAgICAgICAiICAgICAgIGZvbnQtc2l6ZTogMTBweDsiICsKKyAgICAgICAgICAgICIgICAgICAgY29sb3I6ICM4ODg7fSIgKworICAgICAgICAgICAgImgzIGltZyB7IiArCisgICAgICAgICAgICAiICAgICAgIHdpZHRoOiA4cHg7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbi1yaWdodDogNHB4O30iICsKKyAgICAgICAgICAgICJkaXYuZGlmZiB7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbi1ib3R0b206IDI1cHg7fSIgKworICAgICAgICAgICAgImRpdi5kaWZmIGEgeyIgKworICAgICAgICAgICAgIiAgICAgICBmb250LXNpemU6IDEycHg7IiArCisgICAgICAgICAgICAiICAgICAgIGNvbG9yOiAjODg4O30iICsKKyAgICAgICAgICAgICJ0YWJsZS52aXN1YWxfZGlmZiB7IiArCisgICAgICAgICAgICAiICAgICAgIGJvcmRlci1ib3R0b206IDBweCBzb2xpZDsiICsKKyAgICAgICAgICAgICIgICAgICAgYm9yZGVyLWNvbGxhcHNlOiBjb2xsYXBzZTsiICsKKyAgICAgICAgICAgICIgICAgICAgd2lkdGg6IDEwMCU7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbi1ib3R0b206IDJweDt9IiArCisgICAgICAgICAgICAidGFibGUudmlzdWFsX2RpZmYgdHIuaGVhZGVycyB0ZCB7IiArCisgICAgICAgICAgICAiICAgICAgIGJvcmRlci1ib3R0b206IDFweCBzb2xpZDsiICsKKyAgICAgICAgICAgICIgICAgICAgYm9yZGVyLXRvcDogMDsiICsKKyAgICAgICAgICAgICIgICAgICAgcGFkZGluZy1ib3R0b206IDNweDt9IiArCisgICAgICAgICAgICAidGFibGUudmlzdWFsX2RpZmYgdHIucmVzdWx0cyB0ZCB7IiArCisgICAgICAgICAgICAiICAgICAgIGJvcmRlci10b3A6IDFweCBkYXNoZWQ7IiArCisgICAgICAgICAgICAiICAgICAgIGJvcmRlci1yaWdodDogMXB4IHNvbGlkOyIgKworICAgICAgICAgICAgIiAgICAgICBmb250LXNpemU6IDE1cHg7IiArCisgICAgICAgICAgICAiICAgICAgIHZlcnRpY2FsLWFsaWduOiB0b3A7fSIgKworICAgICAgICAgICAgInRhYmxlLnZpc3VhbF9kaWZmIHRyLnJlc3VsdHMgdGQubGluZV9jb3VudCB7IiArCisgICAgICAgICAgICAiICAgICAgIGJhY2tncm91bmQtY29sb3I6I2FhYTsiICsKKyAgICAgICAgICAgICIgICAgICAgbWluLXdpZHRoOjIwcHg7IiArCisgICAgICAgICAgICAiICAgICAgIHRleHQtYWxpZ246IHJpZ2h0OyIgKworICAgICAgICAgICAgIiAgICAgICBib3JkZXItcmlnaHQ6IDFweCBzb2xpZDsiICsKKyAgICAgICAgICAgICIgICAgICAgYm9yZGVyLWxlZnQ6IDFweCBzb2xpZDsiICsKKyAgICAgICAgICAgICIgICAgICAgcGFkZGluZzogMnB4IDFweCAycHggMHB4O30iICsKKyAgICAgICAgICAgICJ0YWJsZS52aXN1YWxfZGlmZiB0ci5yZXN1bHRzIHRkLmxpbmUgeyIgKworICAgICAgICAgICAgIiAgICAgICBwYWRkaW5nOiAycHggMHB4IDJweCA0cHg7IiArCisgICAgICAgICAgICAiICAgICAgIGJvcmRlci1yaWdodDogMXB4IHNvbGlkOyIgKworICAgICAgICAgICAgIiAgICAgICB3aWR0aDogNDkuOCU7fSIgKworICAgICAgICAgICAgInRhYmxlLnZpc3VhbF9kaWZmIHRyLmZvb3RlcnMgdGQgeyIgKworICAgICAgICAgICAgIiAgICAgICBib3JkZXItdG9wOiAxcHggc29saWQ7IiArCisgICAgICAgICAgICAiICAgICAgIGJvcmRlci1ib3R0b206IDA7fSIgKworICAgICAgICAgICAgInRhYmxlLnZpc3VhbF9kaWZmIHRyIHRkLnNwYWNlIHsiICsKKyAgICAgICAgICAgICIgICAgICAgYm9yZGVyOiAwOyIgKworICAgICAgICAgICAgIiAgICAgICB3aWR0aDogMC40JX0iICsKKyAgICAgICAgICAgICJkaXYuc3BhY2UgeyIgKworICAgICAgICAgICAgIiAgICAgICBtYXJnaW4tdG9wOjRweDt9IiArCisgICAgICAgICAgICAic3Bhbi5lcWwgeyIgKworICAgICAgICAgICAgIiAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZjNmM2YzO30iICsKKyAgICAgICAgICAgICJzcGFuLmRlbCB7IiArCisgICAgICAgICAgICAiICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZjg4ODg7IH0iICsKKyAgICAgICAgICAgICJzcGFuLmlucyB7IiArCisgICAgICAgICAgICAiICAgICAgIGJhY2tncm91bmQtY29sb3I6ICM4OGZmODg7IH0iICsKKyAgICAgICAgICAgICJ0YWJsZS5zdW1tYXJ5IHsiICsKKyAgICAgICAgICAgICIgICAgICAgYm9yZGVyOiAxcHggc29saWQgYmxhY2s7IiArCisgICAgICAgICAgICAiICAgICAgIG1hcmdpbi10b3A6IDIwcHg7fSIgKworICAgICAgICAgICAgInRhYmxlLnN1bW1hcnkgdGQgeyIgKworICAgICAgICAgICAgIiAgICAgICBwYWRkaW5nOiAzcHg7fSIgKworICAgICAgICAgICAgInNwYW4ubGlzdEl0ZW0geyIgKworICAgICAgICAgICAgIiAgICAgICBmb250LXNpemU6IDExcHg7IiArCisgICAgICAgICAgICAiICAgICAgIGZvbnQtd2VpZ2h0OiBub3JtYWw7IiArCisgICAgICAgICAgICAiICAgICAgIHRleHQtdHJhbnNmb3JtOiB1cHBlcmNhc2U7IiArCisgICAgICAgICAgICAiICAgICAgIHBhZGRpbmc6IDNweDsiICsKKyAgICAgICAgICAgICIgICAgICAgLXdlYmtpdC1ib3JkZXItcmFkaXVzOiA0cHg7fSIgKworICAgICAgICAgICAgInNwYW4uIiArIEFic3RyYWN0UmVzdWx0LlJlc3VsdENvZGUuUkVTVUxUU19ESUZGRVIubmFtZSgpICsgInsiICsKKyAgICAgICAgICAgICIgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2NjYzsiICsKKyAgICAgICAgICAgICIgICAgICAgY29sb3I6IGJsYWNrO30iICsKKyAgICAgICAgICAgICJzcGFuLiIgKyBBYnN0cmFjdFJlc3VsdC5SZXN1bHRDb2RlLk5PX0VYUEVDVEVEX1JFU1VMVC5uYW1lKCkgKyAieyIgKworICAgICAgICAgICAgIiAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjYTcwMGU0OyIgKworICAgICAgICAgICAgIiAgICAgICBjb2xvcjogI2ZmZjt9IiArCisgICAgICAgICAgICAic3Bhbi50aW1lZF9vdXQgeyIgKworICAgICAgICAgICAgIiAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZjNjYjAwOyIgKworICAgICAgICAgICAgIiAgICAgICBjb2xvcjogYmxhY2s7fSIgKworICAgICAgICAgICAgInNwYW4uY3Jhc2hlZCB7IiArCisgICAgICAgICAgICAiICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNjMzAwMDA7IiArCisgICAgICAgICAgICAiICAgICAgIGNvbG9yOiAjZmZmO30iICsKKyAgICAgICAgICAgICJzcGFuLm5vTHRjIHsiICsKKyAgICAgICAgICAgICIgICAgICAgYmFja2dyb3VuZC1jb2xvcjogIzk0NDAwMDsiICsKKyAgICAgICAgICAgICIgICAgICAgY29sb3I6ICNmZmY7fSIgKworICAgICAgICAgICAgInNwYW4ubm9FdmVudFNlbmRlciB7IiArCisgICAgICAgICAgICAiICAgICAgIGJhY2tncm91bmQtY29sb3I6ICM4MTU2MDA7IiArCisgICAgICAgICAgICAiICAgICAgIGNvbG9yOiAjZmZmO30iICsKKyAgICAgICAgICAgICI8L3N0eWxlPiI7CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0NSSVBUID0KKyAgICAgICAgICAgICI8c2NyaXB0IHR5cGU9XCJ0ZXh0L2phdmFzY3JpcHRcIj4iICsKKyAgICAgICAgICAgICIgICAgZnVuY3Rpb24gdG9nZ2xlRGlzcGxheShpZCkgeyIgKworICAgICAgICAgICAgIiAgICAgICAgZWxlbWVudCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKGlkKTsiICsKKyAgICAgICAgICAgICIgICAgICAgIHRyaWFuZ2xlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3RyaS4nICsgaWQpOyIgKworICAgICAgICAgICAgIiAgICAgICAgaWYgKGVsZW1lbnQuc3R5bGUuZGlzcGxheSA9PSAnbm9uZScpIHsiICsKKyAgICAgICAgICAgICIgICAgICAgICAgICBlbGVtZW50LnN0eWxlLmRpc3BsYXkgPSAnaW5saW5lJzsiICsKKyAgICAgICAgICAgICIgICAgICAgICAgICB0cmlhbmdsZS5pbm5lckhUTUwgPSAnJiN4MjViYzsgJzsiICsKKyAgICAgICAgICAgICIgICAgICAgIH0gZWxzZSB7IiArCisgICAgICAgICAgICAiICAgICAgICAgICAgZWxlbWVudC5zdHlsZS5kaXNwbGF5ID0gJ25vbmUnOyIgKworICAgICAgICAgICAgIiAgICAgICAgICAgIHRyaWFuZ2xlLmlubmVySFRNTCA9ICcmI3gyNWI2OyAnOyIgKworICAgICAgICAgICAgIiAgICAgICAgfSIgKworICAgICAgICAgICAgIiAgICB9IiArCisgICAgICAgICAgICAiPC9zY3JpcHQ+IjsKKworICAgIC8qKiBUT0RPOiBNYWtlIGl0IGEgc2V0dGluZyAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBIVE1MX0RFVEFJTFNfUkVMQVRJVkVfUEFUSCA9ICJkZXRhaWxzLmh0bWwiOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBUWFRfU1VNTUFSWV9SRUxBVElWRV9QQVRIID0gInN1bW1hcnkudHh0IjsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBSRVNVTFRTX1BFUl9EVU1QID0gNTAwOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBSRVNVTFRTX1BFUl9EQl9BQ0NFU1MgPSA1MDsKKworICAgIHByaXZhdGUgaW50IG1DcmFzaGVkVGVzdHNDb3VudCA9IDA7CisgICAgcHJpdmF0ZSBMaXN0PEFic3RyYWN0UmVzdWx0PiBtVW5leHBlY3RlZEZhaWx1cmVzID0gbmV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RyaW5nIHJlc3VsdHNSb290RGlyUGF0aCwgQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIG1GaWxlRmlsdGVyID0gZmlsZUZpbHRlcjsKKyAgICAgICAgbVJlc3VsdHNSb290RGlyUGF0aCA9IHJlc3VsdHNSb290RGlyUGF0aDsKKworICAgICAgICAvKioKKyAgICAgICAgICogV2UgZG9uJ3QgcnVuIHRoZSBkYXRhYmFzZSBJL08gaW4gYSBzZXBhcmF0ZSB0aHJlYWQgdG8gYXZvaWQgY29uc3VtZXIvcHJvZHVjZXIgcHJvYmxlbQorICAgICAgICAgKiBhbmQgdG8gc2ltcGxpZnkgY29kZS4KKyAgICAgICAgICovCisgICAgICAgIG1EYkhlbHBlciA9IG5ldyBTdW1tYXJpemVyREJIZWxwZXIoY29udGV4dCk7CisgICAgICAgIG1EYkhlbHBlci5vcGVuKCk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBVUkkgZ2V0RGV0YWlsc1VyaSgpIHsKKyAgICAgICAgcmV0dXJuIG5ldyBGaWxlKE1hbmFnZXJTZXJ2aWNlLlJFU1VMVFNfUk9PVF9ESVJfUEFUSCArIEZpbGUuc2VwYXJhdG9yICsKKyAgICAgICAgICAgICAgICBIVE1MX0RFVEFJTFNfUkVMQVRJVkVfUEFUSCkudG9VUkkoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhcHBlbmRUZXN0KEFic3RyYWN0UmVzdWx0IHJlc3VsdCkgeworICAgICAgICBTdHJpbmcgcmVsYXRpdmVQYXRoID0gcmVzdWx0LmdldFJlbGF0aXZlUGF0aCgpOworCisgICAgICAgIGlmIChyZXN1bHQuZGlkQ3Jhc2goKSkgeworICAgICAgICAgICAgbUNyYXNoZWRUZXN0c0NvdW50Kys7CisgICAgICAgIH0KKworICAgICAgICBpZiAocmVzdWx0LmRpZFBhc3MoKSkgeworICAgICAgICAgICAgcmVzdWx0LmNsZWFyUmVzdWx0cygpOworICAgICAgICAgICAgaWYgKG1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gICByZXR1cm4gbVVuZXhwZWN0ZWRGYWlsdXJlc0N1cnNvci5nZXRDb3VudCgpICsKKyAgICAgICAgICAgICAgICBtVW5leHBlY3RlZFBhc3Nlc0N1cnNvci5nZXRDb3VudCgpICsKKyAgICAgICAgICAgICAgICBtRXhwZWN0ZWRQYXNzZXNDdXJzb3IuZ2V0Q291bnQoKSArCisgICAgICAgICAgICAgICAgbUV4cGVjdGVkRmFpbHVyZXNDdXJzb3IuZ2V0Q291bnQoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIFN0cmluZyBnZXRXZWJLaXRWZXJzaW9uRnJvbVVzZXJBZ2VudFN0cmluZygpIHsKKyAgICAgICAgUmVzb3VyY2VzIHJlc291cmNlcyA9IG5ldyBSZXNvdXJjZXMobmV3IEFzc2V0TWFuYWdlcigpLCBuZXcgRGlzcGxheU1ldHJpY3MoKSwKKyAgICAgICAgICAgICAgICBuZXcgQ29uZmlndXJhdGlvbigpKTsKKyAgICAgICAgU3RyaW5nIHVzZXJBZ2VudCA9CisgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFN0cmluZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy53ZWJfdXNlcl9hZ2VudCk7CisKKyAgICAgICAgTWF0Y2hlciBtYXRjaGVyID0gUGF0dGVybi5jb21waWxlKCJBcHBsZVdlYktpdC8oWzAtOV0rP1xcLlswLTldKSIpLm1hdGNoZXIodXNlckFnZW50KTsKKyAgICAgICAgaWYgKG1hdGNoZXIuZmluZCgpKSB7CisgICAgICAgICAgICByZXR1cm4gbWF0Y2hlci5ncm91cCgxKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gInVua25vd24iOworICAgIH0KKworICAgIHByaXZhdGUgU3RyaW5nIGdldFdlYktpdFJldmlzaW9uKCkgeworICAgICAgICBVUkwgdXJsID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHVybCA9IG5ldyBVUkwoRm9yd2FyZGVyTWFuYW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ZSArICIgWyIgKyBjdXJzb3IuZ2V0Q291bnQoKSArICJdPC9oMj4iKTsKKworICAgICAgICBpZiAoIWN1cnNvci5tb3ZlVG9GaXJzdCgpKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBBYnN0cmFjdFJlc3VsdCByZXN1bHQ7CisgICAgICAgIGRvIHsKKyAgICAgICAgICAgIHJlc3VsdCA9IFN1bW1hcml6ZXJEQkhlbHBlci5nZXRBYnN0cmFjdFJlc3VsdChjdXJzb3IpOworCisgICAgICAgICAgICByZWxhdGl2ZVBhdGggPSByZXN1bHQuZ2V0UmVsYXRpdmVQYXRoKCk7CisgICAgICAgICAgICByZXN1bHRDb2RlID0gcmVzdWx0LmdldFJlc3VsdENvZGUoKTsKKworICAgICAgICAgICAgaHRtbC5hcHBlbmQoIjxoMz4iKTsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUZWNobmljYWxseSwgdHdvIGRpZmZlcmVudCBwYXRocyBjb3VsZCBlbmQgdXAgYmVpbmcgdGhlIHNhbWUsIGJlY2F1c2UKKyAgICAgICAgICAgICAqICc6JyBpcyBhIHZhbGlkICBjaGFyYWN0ZXIgaW4gYSBwYXRoLiBIb3dldmVyLCBpdCBpcyBwcm9iYWJseSBub3QgZ29pbmcKKyAgICAgICAgICAgICAqIHRvIGNhdXNlIGFueSBwcm9ibGVtcyBpbiB0aGlzIGNhc2UKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWQgPSByZWxhdGl2ZVBhdGgucmVwbGFjZShGaWxlLnNlcGFyYXRvciwgIjoiKTsKKworICAgICAgICAgICAgLyoqIFdyaXRlIHRoZSB0ZXN0IG5hbWUgKi8KKyAgICAgICAgICAgIGlmIChyZXN1bHRDb2RlID09IEFic3RyYWN0UmVzdWx0LlJlc3VsdENvZGUuUkVTVUxUU19ESUZGRVIpIHsKKyAgICAgICAgICAgICAgICBodG1sLmFwcGVuZCgiPGEgaHJlZj1cIiNcIiBvb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FncyhodG1sLCByZXN1bHQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBodG1sLmFwcGVuZCgiPC9oMz4iKTsKKyAgICAgICAgICAgIGFwcGVuZEV4cGVjdGVkUmVzdWx0c1NvdXJjZXMocmVzdWx0LCBodG1sKTsKKworICAgICAgICAgICAgaWYgKHJlc3VsdENvZGUgPT0gQWJzdHJhY3RSZXN1bHQuUmVzdWx0Q29kZS5SRVNVTFRTX0RJRkZFUikgeworICAgICAgICAgICAgICAgIGh0bWwuYXBwZW5kKCI8ZGl2IGNsYXNzPVwiZGlmZlwiIHN0eWxlPVwiZGlzcGxheTogbm9uZTtcIiBpZD1cIiIgKyBpZCArICJcIj4iKTsKKyAgICAgICAgICAgICAgICBodG1sLmFwcGVuZChyZXN1bHQuZ2V0RGlmZkFzSHRtbCgpKTsKKyAgICAgICAgICAgICAgICBodG1sLmFwcGVuZCgiPGEgaHJlZj1cIiNcIiBvbkNsaWNrPVwidG9nZ2xlRGlzcGxheSgnIiArIGlkICsgIicpOyIpOworICAgICAgICAgICAgICAgIGh0bWwuYXBwZW5kKCJyZXR1cm4gZmFsc2U7XCI+SGlkZTwvYT4iKTsKKyAgICAgICAgICAgICAgICBodG1sLmFwcGVuZCgiIHwgIik7CisgICAgICAgICAgICAgICAgaHRtbC5hcHBlbmQoIjxhIGhyZWY9XCIiICsgZ2V0Vmlld1NvdXJjZVVybChyZWxhdGl2ZVBhdGgpLnRvU3RyaW5nKCkgKyAiXCIiKTsKKyAgICAgICAgICAgICAgICBodG1sLmFwcGVuZCgiIHRhcmdldD1cIl9ibGFua1wiPlNob3cgc291cmNlPC9hPiIpOworICAgICAgICAgICAgICAgIGh0bWwuYXBwZW5kKCI8L2Rpdj4iKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaHRtbC5hcHBlbmQoIjxkaXYgY2xhc3M9XCJzcGFjZVwiPjwvZGl2PiIpOworCisgICAgICAgICAgICBpZiAoKyttUmVzdWx0c1NpbmNlTGFzdEh0bWxEdW1wID09IFJFU1VMVFNfUEVSX0RVTVApIHsKKyAgICAgICAgICAgICAgICBkdW1wSHRtbFRvRmlsZShodG1sLCB0cnVlKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY3Vyc29yLm1vdmVUb05leHQoKTsKKyAgICAgICAgfSB3aGlsZSAoIWN1cnNvci5pc0FmdGVyTGFzdCgpKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgYXBwZW5kVGFncyhTdHJpbmdCdWlsZGVyIGh0bWwsIEFic3RyYWN0UmVzdWx0IHJlc3VsdCkgeworICAgICAgICAvKiogVGFnIHRlc3RzIHdoaWNoIGNyYXNoLCB0aW1lIG91dCBvciB3aGVyZSByZXN1bHRzIGRvbid0IG1hdGNoICovCisgICAgICAgIGlmIChyZXN1bHQuZGlkQ3Jhc2goKSkgeworICAgICAgICAgICAgaHRtbC5hcHBlbmQoIiA8c3BhbiBjbGFzcz1cImxpc3RJdGVtIGNyYXNoZWRcIj5DcmFzaGVkPC9zcGFuPiIpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKHJlc3VsdC5kaWRUaW1lT3V0KCkpIHsKKyAgICAgICAgICAgICAgICBodG1sLmFwcGVuZCgiIDxzcGFuIGNsYXNzPVwibGlzdEl0ZW0gdGltZWRfb3V0XCI+VGltZWQgb3V0PC9zcGFuPiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQWJzdHJhY3RSZXN1bHQuUmVzdWx0Q29kZSByZXN1bHRDb2RlID0gcmVzdWx0LmdldFJlc3VsdENvZGUoKTsKKyAgICAgICAgICAgIGlmIChyZXN1bHRDb2RlICE9IEFic3RyYWN0UmVzdWx0LlJlc3VsdENvZGUuUkVTVUxUU19NQVRDSCkgeworICAgICAgICAgICAgICAgIGh0bWwuYXBwZW5kKCIgPHNwYW4gY2xhc3M9XCJsaXN0SXRlbSAiICsgcmVzdWx0Q29kZS5uYW1lKCkgKyAiXCI+Iik7CisgICAgICAgICAgICAgICAgaHRtbC5hcHBlbmQocmVzdWx0Q29kZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICBodG1sLmFwcGVuZCgiPC9zcGFuPiIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoqIERldGVjdCBtaXNzaW5nIExUQyBmdW5jdGlvbiAqLworICAgICAgICBTdHJpbmcgYWRkaXRpb25hbFRleHRPdXRwdXRTdHJpbmcgPSByZXN1bHQuZ2V0QWRkaXRpb25hbFRleHRPdXRwdXRTdHJpbmcoKTsKKyAgICAgICAgaWYgKGFkZGl0aW9uYWxUZXh0T3V0cHV0U3RyaW5nICE9IG51bGwgJiYKKyAgICAgICAgICAgICAgICBhZGRpdGlvbmFsVGV4dE91dHB1dFN0cmluZy5jb250YWlucygiY29tLmFuZHJvaWQuZHVtcHJlbmRlcnRyZWUiKSAmJgorICAgICAgICAgICAgICAgIGFkZGl0aW9uYWxUZXh0T3V0cHV0U3RyaW5nLmNvbnRhaW5zKCJoYXMgbm8gbWV0aG9kIikpIHsKKyAgICAgICAgICAgIGlmIChhZGRpdGlvbmFsVGV4dE91dHB1dFN0cmluZy5jb250YWlucygiTGF5b3V0VGVzdENvbnRyb2xsZXIiKSkgeworICAgICAgICAgICAgICAgIGh0bWwuYXBwZW5kKCIgPHNwYW4gY2xhc3M9XCJsaXN0SXRlbSBub0x0Y1wiPkxUQyBmdW5jdGlvbiBtaXNzaW5nPC9zcGFuPiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGFkZGl0aW9uYWxUZXh0T3V0cHV0U3RyaW5nLmNvbnRhaW5zKCJFdmVudFNlbmRlciIpKSB7CisgICAgICAgICAgICAgICAgaHRtbC5hcHBlbmQoIiA8c3BhbiBjbGFzcz1cImxpc3RJdGVtIG5vRXZlbnRTZW5kZXJcIj4iKTsKKyAgICAgICAgICAgICAgICBodG1sLmFwcGVuZCgiRVMgZnVuY3Rpb24gbWlzc2luZzwvc3Bhbj4iKTsKKy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wcGVuZCgiPGEgaHJlZj1cIiIgKyBGb3J3YXJkZXJNYW5hZ2VyLmdldEhvc3RTY2hlbWVQb3J0KGZhbHNlKSArICJMYXlvdXRUZXN0cy8iICsKKyAgICAgICAgICAgICAgICAgICAgdGV4dFNvdXJjZSArICJcIiIpOworICAgICAgICAgICAgaHRtbC5hcHBlbmQoIiB0YXJnZXQ9XCJfYmxhbmtcIj4iKTsKKyAgICAgICAgICAgIGh0bWwuYXBwZW5kKHRleHRTb3VyY2UgKyAiPC9hPjwvc3Bhbj4iKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoaW1hZ2VTb3VyY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgaHRtbC5hcHBlbmQoIjxzcGFuIGNsYXNzPVwic291cmNlXCI+RXhwZWN0ZWQgaW1hZ2UgcmVzdWx0IGZyb206ICIpOworICAgICAgICAgICAgaHRtbC5hcHBlbmQoIjxhIGhyZWY9XCIiICsgRm9yd2FyZGVyTWFuYWdlci5nZXRIb3N0U2NoZW1lUG9ydChmYWxzZSkgKyAiTGF5b3V0VGVzdHMvIiArCisgICAgICAgICAgICAgICAgICAgIGltYWdlU291cmNlICsgIlwiIik7CisgICAgICAgICAgICBodG1sLmFwcGVuZCgiIHRhcmdldD1cIl9ibGFua1wiPiIpOworICAgICAgICAgICAgaHRtbC5hcHBlbmQoaW1hZ2VTb3VyY2UgKyAiPC9hPjwvc3Bhbj4iKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFVSTCBnZXRWaWV3U291cmNlVXJsKFN0cmluZyByZWxhdGl2ZVBhdGgpIHsKKyAgICAgICAgVVJMIHVybCA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICB1cmwgPSBuZXcgVVJMKCJodHRwIiwgImxvY2FsaG9zdCIsIEZvcndhcmRlck1hbmFnZXIuSFRUUF9QT1JULAorICAgICAgICAgICAgICAgICAgICAiL1dlYktpdFRvb2xzL0R1bXBS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NFU19UQUJMRSk7CisgICAgICAgIFRBQkxFU19OQU1FUy5hZGQoVU5FWFBFQ1RFRF9GQUlMVVJFU19UQUJMRSk7CisgICAgICAgIFRBQkxFU19OQU1FUy5hZGQoVU5FWFBFQ1RFRF9QQVNTRVNfVEFCTEUpOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIHZvaWQgY3JlYXRlVGFibGVzKFNRTGl0ZURhdGFiYXNlIGRiKSB7CisgICAgICAgIFN0cmluZyBjbWQ7CisgICAgICAgIGZvciAoU3RyaW5nIHRhYmxlTmFtZSA6IFRBQkxFU19OQU1FUykgeworICAgICAgICAgICAgY21kID0gImNyZWF0ZSB0YWJsZSAiICsgdGFibGVOYW1lICsgIiAoIgorICAgICAgICAgICAgICAgICAgICArIEtFWV9JRCArICIgaW50ZWdlciBwcmltYXJ5IGtleSBhdXRvaW5jcmVtZW50LCAiCisgICAgICAgICAgICAgICAgICAgICsgS0VZX1BBVEggKyAiIHRleHQgbm90IG51bGwsICIKKyAgICAgICAgICAgICAgICAgICAgKyBLRVlfQllURVMgKyAiIGJsb2Igbm90IG51bGwpOyI7CisgICAgICAgICAgICBkYi5leGVjU1FMKGNtZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCB2b2lkIGRyb3BUYWJsZXMoU1FMaXRlRGF0YWJhc2UgZGIpIHsKKyAgICAgICAgZm9yIChTdHJpbmcgdGFibGVOYW1lIDogVEFCTEVTX05BTUVTKSB7CisgICAgICAgICAgICBkYi5leGVjU1FMKCJEUk9QIFRBQkxFIElGIEVYSVNUUyAiICsgdGFibGVOYW1lKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIERhdGFiYXNlSGVscGVyIGV4dGVuZHMgU1FMaXRlT3BlbkhlbHBlciB7CisgICAgICAgIERhdGFiYXNlSGVscGVyKENvbnRleHQgY29udGV4dCkgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgREFUQUJBU0VfTkFNRSwgbnVsbCwgREFUQUJBU0VfVkVSU0lPTik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25DcmVhdGUoU1FMaXRlRGF0YWJhc2UgZGIpIHsKKyAgICAgICAgICAgIGRyb3BUYWJsZXMoZGIpOworICAgICAgICAgICAgY3JlYXRlVGFibGVzKGRiKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvblVwZ3JhZGUoU1FMaXRlRGF0YWJhc2UgZGIsIGludCBvbGRWZXJzaW9uLCBpbnQgbmV3VmVyc2lvbikgeworICAgICAgICAgICAgLyoqIE5PT1AgZm9yIG5vdywgYmVjYXVzZSB3ZSB3aWxsIG5ldmVyIHVwZ3JhZGUgdGhlIGRiICovCisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCByZXNldChTUUxpdGVEYXRhYmFzZSBkYikgeworICAgICAgICAgICAgZHJvcFRhYmxlcyhkYik7CisgICAgICAgICAgICBjcmVhdGVUYWJsZXMoZGIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBEYXRhYmFzZUhlbHBlciBtRGJIZWxwZXI7CisgICAgcHJpdmF0ZSBTUUxpdGVEYXRhYmFzZSBtRGI7CisKKyAgICBwcml2YXRlIGZpbmFsIENvbnRleHQgbUNvbnRleHQ7CisKKyAgICBwdWJsaWMgU3VtbWFyaXplckRCSGVscGVyKENvbnRleHQgY3R4KSB7CisgICAgICAgIG1Db250ZXh0ID0gY3R4OworICAgICAgICBtRGJIZWxwZXIgPSBuZXcgRGF0YWJhc2VIZWxwZXIobUNvbnRleHQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHJlc2V0KCkgeworICAgICAgICBtRGJIZWxwZXIucmVzZXQodGhpcy5tRGIpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG9wZW4o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IHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBTdHJpbmcgcGF0aCA9IGludGVudC5nZXRTdHJpbmdFeHRyYShFWFRSQV9URVNUX1BBVEgpOworCisgICAgICAgIHNQcm9ncmVzc0RpYWxvZy5zaG93KCk7CisgICAgICAgIE1lc3NhZ2UgZG9uZU1zZyA9IE1lc3NhZ2Uub2J0YWluKG1IYW5kbGVyLCBNU0dfVEVTVF9MSVNUX1BSRUxPQURFUl9ET05FKTsKKworICAgICAgICBJbnRlbnQgc2VydmljZUludGVudCA9IG5ldyBJbnRlbnQodGhpcywgTWFuYWdlclNlcnZpY2UuY2xhc3MpOworICAgICAgICBzZXJ2aWNlSW50ZW50LnB1dEV4dHJhKCJwYXRoIiwgcGF0aCk7CisgICAgICAgIHN0YXJ0U2VydmljZShzZXJ2aWNlSW50ZW50KTsKKworICAgICAgICBuZXcgVGVzdHNMaXN0UHJlbG9hZGVyVGhyZWFkKHBhdGgsIGRvbmVNc2cpLnN0YXJ0KCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25OZXdJbnRlbnQoSW50ZW50IGludGVudCkgeworICAgICAgICBpZiAoaW50ZW50LmdldEFjdGlvbigpLmVxdWFscyhJbnRlbnQuQUNUSU9OX1JFQk9PVCkpIHsKKyAgICAgICAgICAgIG9uQ3Jhc2hJbnRlbnQoaW50ZW50KTsKKyAgICAgICAgfSBlbHNlIGlmIChpbnRlbnQuZ2V0QWN0aW9uKCkuZXF1YWxzKEludGVudC5BQ1RJT05fU0hVVERPV04pKSB7CisgICAgICAgICAgICBvbkV2ZXJ5dGhpbmdGaW5pc2hlZEludGVudChpbnRlbnQpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2QgaGFuZGxlcyBhbiBpbnRlbnQgdGhhdCBjb21lcyBmcm9tIE1hbmFnZVNlcnZpY2Ugd2hlbiBjcmFzaCBpcyBkZXRlY3RlZC4KKyAgICA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LmFkZChyb290UmVsYXRpdmVQYXRoKTsKKworICAgICAgICBTdHJpbmcgcmVsYXRpdmVQYXRoOworICAgICAgICBTdHJpbmcgaXRlbU5hbWU7CisgICAgICAgIHdoaWxlICghZGlyZWN0b3JpZXNMaXN0LmlzRW1wdHkoKSkgeworICAgICAgICAgICAgcmVsYXRpdmVQYXRoID0gZGlyZWN0b3JpZXNMaXN0LnJlbW92ZUZpcnN0KCk7CisKKyAgICAgICAgICAgIExpc3Q8U3RyaW5nPiBkaXJSZWxhdGl2ZVBhdGhzID0gRnNVdGlscy5nZXRMYXlvdXRUZXN0c0RpckNvbnRlbnRzKHJlbGF0aXZlUGF0aCwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgaWYgKGRpclJlbGF0aXZlUGF0aHMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIGRpclJlbGF0aXZlUGF0aCA6IGRpclJlbGF0aXZlUGF0aHMpIHsKKyAgICAgICAgICAgICAgICAgICAgaXRlbU5hbWUgPSBuZXcgRmlsZShkaXJSZWxhdGl2ZVBhdGgpLmdldE5hbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKEZpbGVGaWx0ZXIuaXNUZXN0RGlyKGl0ZW1OYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0b3JpZXNMaXN0LmFkZChkaXJSZWxhdGl2ZVBhdGgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBMaXN0PFN0cmluZz4gdGVzdFJlbGF0aXZlUGF0aHMgPSBGc1V0aWxzLmdldExheW91dFRlc3RzRGlyQ29udGVudHMocmVsYXRpdmVQYXRoLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgaWYgKHRlc3RSZWxhdGl2ZVBhdGhzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyB0ZXN0UmVsYXRpdmVQYXRoIDogdGVzdFJlbGF0aXZlUGF0aHMpIHsKKyAgICAgICAgICAgICAgICAgICAgaXRlbU5hbWUgPSBuZXcgRmlsZSh0ZXN0UmVsYXRpdmVQYXRoKS5nZXROYW1lKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChGaWxlRmlsdGVyLmlzVGVzdEZpbGUoaXRlbU5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiogV2UgY2hvb3NlIHRvIHNraXAgYWxsIHRoZSB0ZXN0cyB0aGF0IGFyZSBleHBlY3RlZCB0byBjcmFzaC4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbUZpbGVGaWx0ZXIuaXNDcmFzaCh0ZXN0UmVsYXRpdmVQYXRoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXN0c0xpc3QuYWRkKHRlc3RSZWxhdGl2ZVBhdGgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBUT0RPOiBTdW1tYXJpemVyIGlzIG5vdyBpbiBzZXJ2aWNlIC0gZmlndXJlIG91dCBob3cgdG8gc2VuZCB0aGUgaW5mby4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBQcmV2aW91c2x5OiBtU3VtbWFyaXplci5hZGRTa2lwcGVkVGVzdChyZWxhdGl2ZVBhdGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvdGVzdHMvRHVtcFJlbmRlclRyZWUyL3NyYy9jb20vYW5kcm9pZC9kdW1wcmVuZGVydHJlZTIvVGV4dFJlc3VsdC5qYXZhIGIvdGVzdHMvRHVtcFJ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ZWFuIGRpZFRpbWVPdXQoKSB7CisgICAgICAgIHJldHVybiBtRGlkVGltZU91dDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXREaWRUaW1lT3V0KCkgeworICAgICAgICBtRGlkVGltZU91dCA9IHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJ5dGVbXSBnZXRBY3R1YWxJbWFnZVJlc3VsdCgpIHsKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZyBnZXRBY3R1YWxUZXh0UmVzdWx0KCkgeworICAgICAgICBTdHJpbmcgYWRkaXRpb25hbFRleHRSZXN1bHRTdHJpbmcgPSBnZXRBZGRpdGlvbmFsVGV4dE91dHB1dFN0cmluZygpOworICAgICAgICBpZiAoYWRkaXRpb25hbFRleHRSZXN1bHRTdHJpbmcgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIGFkZGl0aW9uYWxUZXh0UmVzdWx0U3RyaW5nICsgbUFjdHVhbFJlc3VsdDsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBtQWN0dWFsUmVzdWx0OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldEV4cGVjdGVkSW1hZ2VSZXN1bHQoYnl0ZVtdIGV4cGVjdGVkUmVzdWx0KSB7CisgICAgICAgIC8qKiBUaGlzIG1ldGhvZCBpcyBub3QgYXBwbGljYWJsZSB0byB0aGlzIHR5cGUgb2YgcmVzdWx0ICovCisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0RXhwZWN0ZWRJbWFnZVJlc3VsdFBhdGgoU3RyaW5nIHJlbGF0aXZlUGF0aCkgeworICAgICAgICAvKiogVGhpcyBtZXRob2QgaXMgbm90IGFwcGxpY2FibGUgdG8gdGhpcyB0eXBlIG9mIHJlc3VsdCAq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ludCBsZW5ndGhNaW51c09uZTsKKyAgICAgICAgZm9yIChkaWZmX21hdGNoX3BhdGNoLkRpZmYgZGlmZiA6IGRpZmZzKSB7CisgICAgICAgICAgICBwYXJ0cyA9IGRpZmYudGV4dC5zcGxpdCgiXG4iLCAtMSk7CisgICAgICAgICAgICBpZiAocGFydHMubGVuZ3RoID09IDEpIHsKKyAgICAgICAgICAgICAgICBuZXdEaWZmcy5hZGQoZGlmZik7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGxlbmd0aE1pbnVzT25lID0gcGFydHMubGVuZ3RoIC0gMTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoTWludXNPbmU7IGkrKykgeworICAgICAgICAgICAgICAgIG5ld0RpZmZzLmFkZChuZXcgZGlmZl9tYXRjaF9wYXRjaC5EaWZmKGRpZmYub3BlcmF0aW9uLCBwYXJ0c1tpXSArICJcbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghcGFydHNbbGVuZ3RoTWludXNPbmVdLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgIG5ld0RpZmZzLmFkZChuZXcgZGlmZl9tYXRjaF9wYXRjaC5EaWZmKGRpZmYub3BlcmF0aW9uLCBwYXJ0c1tsZW5ndGhNaW51c09uZV0pKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBuZXdEaWZmczsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIHZvaWQgZ2VuZXJhdGVFeHBlY3RlZFJlc3VsdExpbmVzKExpbmtlZExpc3Q8ZGlmZl9tYXRjaF9wYXRjaC5EaWZmPiBkaWZmcywKKyAgICAgICAgICAgIExpbmtlZExpc3Q8SW50ZWdlcj4gbGluZU51bXMsIExpbmtlZExpc3Q8U3RyaW5nPiBsaW5lcykgeworICAgICAgICBTdHJpbmcgZGVsU3BhbiA9ICI8c3BhbiBjbGFzcz1cImRlbFwiPiI7CisgICAgICAgIFN0cmluZyBlcWxTcGFuID0gIjxzcGFuIGNsYXNzPVwiZXFsXCI+IjsKKworICAgICAgICBTdHJpbmcgbGluZSA9ICIiOworICAgICAgICBpbnQgaSA9IDE7CisgICAgICAgIGRpZmZfbWF0Y2hfcGF0Y2guRGlmZiBkaWZmOworICAgICAgICBpbnQgc2l6ZSA9IGRpZmZzLnNpemUoKTsKKyAgICAgICAgYm9vbGVhbiBpc0xhc3REaWZmOworICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IHNpemU7IGorKykgeworICAgICAgICAgICAgZGlmZiA9IGRpZmZzLmdldChqKTsKKyAgICAgICAgICAgIGlzTGFzdERpZmYgPSBqID09IHNpemUgLSAxOworICAgICAgICAgICAgc3dpdGNoIChkaWZmLm9wZXJhdGlvbikgeworICAgICAgICAgICAgICAgIGNhc2UgREVMRVRFOgorICAgICAgICAgICAgICAgICAgICBsaW5lID0gcHJvY2Vzc0RpZmYoZGlmZiwgbGluZU51bXMsIGxpbmVzLCBsaW5lLCBpLCBkZWxTcGFuLCBpc0xhc3REaWZmKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxpbmUuZXF1YWxzKCIiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBJTlNFUlQ6CisgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBsaW5lIGlzIGN1cnJlbnRseSBlbXB0eSBhbmQgdGhpcyBpbnNlcnRpb24gaXMgdGhlIGVudGlyZSBsaW5lLCB0aGUKKyAgICAgICAgICAgICAgICAgICAgLy8gZXhwZWN0ZWQgbGluZSBpcyBhYnNlbnQsIHNvIGl0IGhhcyBubyBsaW5lIG51bWJlci4KKyAgICAgICAgICAgICAgICAgICAgaWYgKGRpZmYudGV4dC5lbmRzV2l0aCgiXG4iKSB8fCBpc0xhc3REaWZmKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5lTnVtcy5hZGQobGluZS5lcXVhbHMoIiIpID8gRE9OVF9QUklOVF9MSU5FX05VTUJFUiA6IGkrKyk7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5lcy5hZGQobGluZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5lID0gIiI7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIEVRVUFMOgorICAgICAgICAgICAgICAgICAgICBsaW5lID0gcHJvY2Vzc0RpZmYoZGlmZiwgbGluZU51bXMsIGxpbmVzLCBsaW5lLCBpLCBlcWxTcGFuLCBpc0xhc3REaWZmKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxpbmUuZXF1YWxzKCIiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyB2b2lkIGdlbmVyYXRlQWN0dWFsUmVzdWx0TGluZXMoTGlua2VkTGlzdDxkaWZmX21hdGNoX3BhdGNoLkRpZmY+IGRpZmZzLAorICAgICAgICAgICAgTGlua2VkTGlzdDxJbnRlZ2VyPiBsaW5lTnVtcywgTGlua2VkTGlzdDxTdHJpbmc+IGxpbmVzKSB7CisgICAgICAgIFN0cmluZyBpbnNTcGFuID0gIjxzcGFuIGNsYXNzPVwiaW5zXCI+IjsKKyAgICAgICAgU3RyaW5nIGVxbFNwYW4gPSAiPHNwYW4gY2xhc3M9XCJlcWxcIj4iOworCisgICAgICAgIFN0cmluZyBsaW5lID0gIiI7CisgICAgICAgIGludCBpID0gMTsKKyAgICAgICAgZGlmZl9tYXRjaF9wYXRjaC5EaWZmIGRpZmY7CisgICAgICAgIGludCBzaXplID0gZGlmZnMuc2l6ZSgpOworICAgICAgICBib29sZWFuIGlzTGFzdERpZmY7CisgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgc2l6ZTsgaisrKSB7CisgICAgICAgICAgICBkaWZmID0gZGlmZnMuZ2V0KGopOworICAgICAgICAgICAgaXNMYXN0RGlmZiA9IGogPT0gc2l6ZSAtIDE7CisgICAgICAgICAgICBzd2l0Y2ggKGRpZmYub3BlcmF0aW9uKSB7CisgICAgICAgICAgICAgICAgY2FzZSBJTlNFUlQ6CisgICAgICAgICAgICAgICAgICAgIGxpbmUgPSBwcm9jZXNzRGlmZihkaWZmLCBsaW5lTnVtcywgbGluZXMsIGxpbmUsIGksIGluc1NwYW4sIGlzTGFzdERpZmYpOworICAgICAgICAgICAgICAgICAgICBpZiAobGluZS5lcXVhbHMoIiIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIERFTEVURToKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIGxpbmUgaXMgY3VycmVudGx5IGVtcHR5IGFuZCBkZWxldGlvbiBpcyB0aGUgZW50aXJlIGxpbmUsIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBhY3R1YWwgbGluZSBpcyBhYnNlbnQsIHNvIGl0IGhhcyBubyBsaW5lIG51bWJlci4KKyAgICAgICAgICAgICAgICAgICAgaWYgKGRpZmYudGV4dC5lbmRzV2l0aCgiXG4iKSB8fCBpc0xhc3REaWZmKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5lTnVtcy5hZGQobGluZS5lcXVhbHMoIiIpID8gRE9OVF9QUklOVF9MSU5FX05VTUJFUiA6IGkrKyk7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5lcy5hZGQobGluZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5lID0gIiI7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIEVRVUFMOgorICAgICAgICAgICAgICAgICAgICBsaW5lID0gcHJvY2Vzc0RpZmYoZGlmZiwgbGluZU51bXMsIGxpbmVzLCBsaW5lLCBpLCBlcWxTcGFuLCBpc0xhc3REaWZmKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxpbmUuZXF1YWxzKCIiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogR2VuZXJhdGUgb3IgYXBwZW5kIGEgbGluZSBmb3IgYSBnaXZlbiBkaWZmIGFuZCBhZGQgaXQgdG8gZ2l2ZW4gY29sbGVjdGlvbnMgaWYgbmVjZXNzYXJ5LgorICAgICAqIEl0IHB1dHMgZGlmZnMgaW4gSFRNTCBzcGFucy4KKyAgICAgKgorICAgICAqIEBwYXJhbSBkaWZmCisgICAgICogQHBhcmFtIGxpbmVOdW1zCisgICAgICogQHBhcmFtIGxpbmVzCisgICAgICogQHBhcmFtIGxpbmUKKyAgICAgKiBAcGFyYW0gaQorICAgICAqIEBwYXJhbSBiZWdTcGFuCisgICAgICogQHBhcmFtIGZvcmNlT3V0cHV0TGluZSBGb3JjZSB0aGUgY3VycmVudCBsaW5lIHRvIGJlIG91dHB1dAorICAgICAqIEByZXR1cm4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBwcm9jZXNzRGlmZihkaWZmX21hdGNoX3BhdGNoLkRpZmYgZGlmZiwgTGlua2VkTGlzdDxJbnRlZ2VyPiBsaW5lTnVtcywKKyAgICAgICAgICAgIExpbmtlZExpc3Q8U3RyaW5nPiBsaW5lcywgU3RyaW5nIGxpbmUsIGludCBpLCBTdHJpbmcgYmVnU3BhbiwgYm9vbGVhbiBmb3JjZU91dHB1dExpbmUpIHsKKyAgICAgICAgU3RyaW5nIGVuZFNwYW4gPSAiPC9zcGFuPiI7CisgICAgICAgIFN0cmluZyBiciA9ICImbmJzcDsiOworCisgICAgICAgIGlmIChkaWZmLnRleHQuZW5kc1dpdGgoIlxuIikgfHwgZm9yY2VPdXRwdXRMaW5lKSB7CisgICAgICAgICAgICBsaW5lTnVtcy5hZGQoaSk7CisgICAgICAgICAgICAvKiogVE9ETzogVGhpbmsgb2YgYmV0dGVyIHdheSB0byByZXBsYWNlIHN0dWZmICovCisgICAgICAgICAgICBsaW5lICs9IGJlZ1NwYW4gKyBkaWZmLnRleHQucmVwbGFjZSgiICAiLCAiJm5ic3A7Jm5ic3A7IikKKyAgICAgICAgICAgICAgICAgICAgKyBlbmRTcGFuICsgYnI7CisgICAgICAgICAgICBsaW5lcy5hZGQobGluZSk7CisgICAgICAgICAgICBsaW5lID0gIiI7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBsaW5lICs9IGJlZ1NwYW4gKyBkaWZmLnRleHQucmVwbGFjZSgiICAiLCAiJm5ic3A7Jm5ic3A7IikgKyBlbmRTcGFuOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGxpbmU7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZ2V0SHRtbChMaW5rZWRMaXN0PEludGVnZXI+IGxpbmVOdW1zMSwgTGlua2VkTGlzdDxTdHJpbmc+IGxpbmVzMSwKKyAgICAgICAgICAgIExpbmtlZExpc3Q8SW50ZWdlcj4gbGluZU51bXMyLCBMaW5rZWRMaXN0PFN0cmluZz4gbGluZXMyKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgaHRtbCA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIGludCBsaW5lTnVtOworICAgICAgICBpbnQgc2l6ZSA9IGxpbmVzMS5zaXplKCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7CisgICAgICAgICAgICBodG1sLmFwcGVuZCgiPHRyIGNsYXNzPVwicmVzdWx0c1wiPiIpOworCisgICAgICAgICAgICBodG1sLmFwcGVuZCgiICAgIDx0ZCBjbGFzcz1cImxpbmVfY291bnRcIj4iKTsKKyAgICAgICAgICAgIGxpbmVOdW0gPSBsaW5lTnVtczEucmVtb3ZlRmlyc3QoKTsKKyAgICAgICAgICAgIGlmIChsaW5lTnVtID4gMCkgeworICAgICAgICAgICAgICAgIGh0bWwuYXBwZW5kKGxpbmVOdW0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaHRtbC5hcHBlbmQoIiAgICA8L3RkPiIpOworCisgICAgICAgICAgICBodG1sLmFwcGVuZCgiICAgIDx0ZCBjbGFzcz1cImxpbmVcIj4iKTsKKyAgICAgICAgICAgIGh0bWwuYXBwZW5kKGxpbmVzMS5yZW1vdmVGaXJzdCgpKTsKKyAgICAgICAgICAgIGh0bWwuYXBwZW5kKCIgICAgPC90ZD4iKTsKKworICAgICAgICAgICAgaHRtbC5hcHBlbmQoIiAgICA8dGQgY2xhc3M9XCJzcGFjZVwiPjwvdGQ+Iik7CisKKyAgICAgICAgICAgIGh0bWwuYXBwZW5kKCIgICAgPHRkIGNsYXNzPVwibGluZV9jb3VudFwiPiIpOworICAgICAgICAgICAgbGluZU51bSA9IGxpbmVOdW1zMi5yZW1vdmVGaXJzdCgpOworICAgICAgICAgICAgaWYgKGxpbmVOdW0gPiAwKSB7CisgICAgICAgICAgICAgICAgaHRtbC5hcHBlbmQobGluZU51bSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBodG1sLmFwcGVuZCgiICAgIDwvdGQ+Iik7CisKKyAgICAgICAgICAgIGh0bWwuYXBwZW5kKCIgICAgPHRkIGNsYXNzPVwibGluZVwiPiIpOworICAgICAgICAgICAgaHRtbC5hcHBlbmQobGluZXMyLnJlbW92ZUZpcnN0KCkpOworICAgICAgICAgICAgaHRtbC5hc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vbkhhbmRsZXIgeworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIExPR19UQUcgPSAiQ29ubmVjdGlvbkhhbmRsZXIiOworCisgICAgcHVibGljIHN0YXRpYyBpbnRlcmZhY2UgT25GaW5pc2hlZENhbGxiYWNrIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25GaW5pc2hlZCgpOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgU29ja2V0UGlwZVRocmVhZCBleHRlbmRzIFRocmVhZCB7CisKKyAgICAgICAgcHJpdmF0ZSBJbnB1dFN0cmVhbSBtSW5wdXRTdHJlYW07CisgICAgICAgIHByaXZhdGUgT3V0cHV0U3RyZWFtIG1PdXRwdXRTdHJlYW07CisKKyAgICAgICAgcHVibGljIFNvY2tldFBpcGVUaHJlYWQoSW5wdXRTdHJlYW0gaW5wdXRTdHJlYW0sIE91dHB1dFN0cmVhbSBvdXRwdXRTdHJlYW0pIHsKKyAgICAgICAgICAgIG1JbnB1dFN0cmVhbSA9IGlucHV0U3RyZWFtOworICAgICAgICAgICAgbU91dHB1dFN0cmVhbSA9IG91dHB1dFN0cmVhbTsKKyAgICAgICAgICAgIHNldE5hbWUoIlNvY2tldFBpcGVUaHJlYWQ6ICIgKyBnZXROYW1lKCkpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIGJ5dGVbXSBidWZmZXIgPSBuZXcgYnl0ZVs0MDk2XTsKKyAgICAgICAgICAgIGludCBsZW5ndGg7CisgICAgICAgICAgICB3aGlsZSAodHJ1ZSkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgobGVuZ3RoID0gbUlucHV0U3RyZWFtLnJlYWQoYnVmZmVyKSkgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtT3V0cHV0U3RyZWFtLndyaXRlKGJ1ZmZlciwgMCwgbGVuZ3RoKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIC8qKiBUaGlzIGV4Y2VwdGlvbiBtZWFucyBvbmUgb2YgdGhlIHN0cmVhbXMgaXMgY2xvc2VkICovCisgICAgICAgICAgICAgICAgICAgIExvZy52KExPR19UQUcsIHRoaXMudG9TdHJpbmcoKSwgZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3luY2hyb25pemVkIChtVGhyZWFkc1J1bm5pbmcpIHsKKyAgICAgICAgICAgICAgICBtVGhyZWFkc1J1bm5pbmctLTsKKyAgICAgICAgICAgICAgICBpZiAobVRocmVhZHNSdW5uaW5nID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgQ29ubmVjdGlvbkhhbmRsZXIudGhpcy5zdG9wKCk7CisgICAgICAgICAgICAgICAgICAgIG1PbkZpbmlzaGVkQ2FsbGJhY2sub25GaW5pc2hlZCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICAgICAgcmV0dXJuIGdldE5hbWUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgSW50ZWdlciBtVGhyZWFkc1J1bm5pbmc7CisKKyAgICBwcml2YXRlIFNvY2tldCBtRnJvbVNvY2tldCwgbVRvU29ja2V0OworICAgIHByaXZhdGUgU29ja2V0UGlwZVRocmVhZCBtRnJvbVRvUGlwZSwgbVRvRnJvbVBpcGU7CisgICAgcHJpdmF0ZSBJbnB1dFN0cmVhbSBtRnJvbVNvY2tldElucHV0U3RyZWFtLCBtV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9Tb2NrZXRPdXRwdXRTdHJlYW0pOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN0YXJ0KCkgeworICAgICAgICAvKiogV2UgaGF2ZSAyIHRocmVhZHMgcnVubmluZywgb25lIGZvciBlYWNoIHBpcGUsIHRoYXQgd2Ugc3RhcnQgaGVyZS4gKi8KKyAgICAgICAgbVRocmVhZHNSdW5uaW5nID0gMjsKKyAgICAgICAgbUZyb21Ub1BpcGUuc3RhcnQoKTsKKyAgICAgICAgbVRvRnJvbVBpcGUuc3RhcnQoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzdG9wKCkgeworICAgICAgICBzaHV0ZG93bihtRnJvbVNvY2tldCk7CisgICAgICAgIHNodXRkb3duKG1Ub1NvY2tldCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNodXRkb3duKFNvY2tldCBzb2NrZXQpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtRnJvbVRvUGlwZSkgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChtVG9Gcm9tUGlwZSkgeworICAgICAgICAgICAgICAgIC8qKiBUaGlzIHdpbGwgc3RvcCB0aGUgd2hpbGUgbG9vcCBpbiB0aGUgcnVuIG1ldGhvZCAqLworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghc29ja2V0LmlzSW5wdXRTaHV0ZG93bigpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzb2NrZXQuc2h1dGRvd25JbnB1dCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAibUZyb21Ub1BpcGU9IiArIG1Gcm9tVG9QaXBlICsgIiBtVG9Gcm9tUGlwZT0iICsgbVRvRnJvbVBpcGUsIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXNvY2tldC5pc091dHB1dFNodXRkb3duKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNvY2tldC5zaHV0ZG93bk91dHB1dCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAibUZyb21Ub1BpcGU9IiArIG1Gcm9tVG9QaXBlICsgIiBtVG9Gcm9tUGlwZT0iICsgbVRvRnJvbVBpcGUsIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXNvY2tldC5pc0Nsb3NlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzb2NrZXQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIm1Gcm9tVG9QaXBlPSIgKyBtRnJvbVRvUGlwZSArICIgbVRvRnJvbVBpcGU9IiArIG1Ub0Zyb21QaXBlLCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS90ZXN0cy9EdW1wUmVuZGVyVHJlZTIvc3JjL2NvbS9hbmRyb2lkL2R1bXByZW5kZXJ0cmVlMi9mb3J3YXJkZXIvRm9yd2FyZGVyLmphdmEgYi90ZXN0cy9EdW1wUmVuZGVyVHJlZTIvc3JjL2NvbS9hbmRyb2lkL2R1bXByZW5kZXJ0cmVlMi9mb3J3YXJkZXIvRm9yd2FyZGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uY2UyMmZhMAotLS0gL2Rldi9udWxsCisrKy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kgeworICAgICAgICBMb2cuaShMT0dfVEFHLCAic3RhcnQoKTogU3RhcnRpbmcgZm93YXJkZXIgb24gcG9ydDogIiArIG1Qb3J0KTsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgbVNlcnZlclNvY2tldCA9IG5ldyBTZXJ2ZXJTb2NrZXQobVBvcnQpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAibVBvcnQ9IiArIG1Qb3J0LCBlKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIHN1cGVyLnN0YXJ0KCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICB3aGlsZSAodHJ1ZSkgeworICAgICAgICAgICAgU29ja2V0IGxvY2FsU29ja2V0OworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBsb2NhbFNvY2tldCA9IG1TZXJ2ZXJTb2NrZXQuYWNjZXB0KCk7CisgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgLyoqIFRoaXMgbW9zdCBsaWtlbHkgbWVhbnMgdGhhdCBtU2VydmVyU29ja2V0IGlzIGFscmVhZHkgY2xvc2VkICovCisgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIm1Qb3J0PSIgKyBtUG9ydCwgZSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFNvY2tldCByZW1vdGVTb2NrZXQgPSBudWxsOworICAgICAgICAgICAgZmluYWwgQ29ubmVjdGlvbkhhbmRsZXIgY29ubmVjdGlvbkhhbmRsZXI7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJlbW90ZVNvY2tldCA9IEFkYlV0aWxzLmNyZWF0ZVNvY2tldCgpOworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb25IYW5kbGVyID0gbmV3IENvbm5lY3Rpb25IYW5kbGVyKAorICAgICAgICAgICAgICAgICAgICAgICAgbVJlbW90ZU1hY2hpbmVJcEFkZHJlc3MsIG1Qb3J0LCBsb2NhbFNvY2tldCwgcmVtb3RlU29ja2V0KTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4Y2VwdGlvbikgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGxvY2FsU29ja2V0LmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAibVBvcnQ9IiArIG1Qb3J0LCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHJlbW90ZVNvY2tldCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdGVTb2NrZXQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIm1Qb3J0PSIgKyBtUG9ydCwgZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogV2UgaGF2ZSB0byBjbG9zZSB0aGUgc29ja2V0cyBhZnRlciB0aGUgQ29ubmVjdGlvbkhhbmRsZXIgZmluaXNoZXMsIHNvIHdlCisgICAgICAgICAgICAgKiBkb24ndCBnZXQgIlRvbyBtYXkgb3BlbiBmaWxlcyIgZXhjZXB0aW9uLiBXZSBhbHNvIHJlbW92ZSB0aGUgQ29ubmVjdGlvbkhhbmRsZXIKKyAgICAgICAgICAgICAqIGZyb20gdGhlIGNvbGxlY3Rpb24gdG8gYXZvaWQgbWVtb3J5IGlzc3Vlcy4KKyAgICAgICAgICAgICAqICovCisgICAgICAgICAgICBDb25uZWN0aW9uSGFuZGxlci5PbkZpbmlzaGVkQ2FsbGJhY2sgY2FsbGJhY2sgPQorICAgICAgICAgICAgICAgICAgICBuZXcgQ29ubmVjdGlvbkhhbmRsZXIuT25GaW5pc2hlZENhbGxiYWNrKCkgeworICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uRmluaXNoZWQoKSB7CisgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtQ29ubmVjdGlvbkhhbmRsZXJzLnJlbW92ZShjb25uZWN0aW9uSGFuZGxlcikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhc3NlcnQgZmFsc2UgOiAicmVtb3ZlQ29ubmVjdGlvbkhhbmRsZXIoKTogbm90IGluIHRoZSBjb2xsZWN0aW9uIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBjb25uZWN0aW9uSGFuZGxlci5yZWdpc3Rlck9uQ29ubmVjdGlvbkhhbmRsZXJGaW5pc2hlZENhbGxiYWNrKGNhbGxiYWNrKTsKKworICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICAgICAgbUNvbm5lY3Rpb25IYW5kbGVycy5hZGQoY29ubmVjdGlvbkhhbmRsZXIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY29ubmVjdGlvbkhhbmRsZXIuc3RhcnQoKTsKKyAgICAgICAgfQorCisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgZm9y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RlcihIVFRQU19QT1JULCBIT1NUX0lQKSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgbWFpbiBwYXJ0IG9mIHRoZSBVUkwgd2l0aCB0aGUgdHJhaWxpbmcgc2xhc2gKKyAgICAgKgorICAgICAqIEBwYXJhbSBpc0h0dHBzCisgICAgICogQHJldHVybgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIGdldEhvc3RTY2hlbWVQb3J0KGJvb2xlYW4gaXNIdHRwcykgeworICAgICAgICBpbnQgcG9ydDsKKyAgICAgICAgU3RyaW5nIHByb3RvY29sOworICAgICAgICBpZiAoaXNIdHRwcykgeworICAgICAgICAgICAgcHJvdG9jb2wgPSAiaHR0cHMiOworICAgICAgICAgICAgcG9ydCA9IEhUVFBTX1BPUlQ7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBwcm90b2NvbCA9ICJodHRwIjsKKyAgICAgICAgICAgIHBvcnQgPSBIVFRQX1BPUlQ7CisgICAgICAgIH0KKworICAgICAgICBVUkwgdXJsID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHVybCA9IG5ldyBVUkwocHJvdG9jb2wsIEhPU1RfSVAsIHBvcnQsICIvIik7CisgICAgICAgIH0gY2F0Y2ggKE1hbGZvcm1lZFVSTEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2UgOiAiaXNIdHRwcz0iICsgaXNIdHRwczsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiB1cmwudG9TdHJpbmcoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIHN5bmNocm9uaXplZCBGb3J3YXJkZXJNYW5hZ2VyIGdldEZvcndhcmRlck1hbmFnZXIoKSB7CisgICAgICAgIGlmIChmb3J3YXJkZXJNYW5hZ2VyID09IG51bGwpIHsKKyAgICAgICAgICAgIGZvcndhcmRlck1hbmFnZXIgPSBuZXcgRm9yd2FyZGVyTWFuYWdlcigpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmb3J3YXJkZXJNYW5hZ2VyOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBPYmplY3QgY2xvbmUoKSB0aHJvd3MgQ2xvbmVOb3RTdXBwb3J0ZWRFeGNlcHRpb24geworICAgICAgICB0aHJvdyBuZXcgQ2xvbmVOb3RTdXBwb3J0ZWRFeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgc3RhcnQoKSB7CisgICAgICAgIGlmIChtSXNTdGFydGVkKSB7CisgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAic3RhcnQoKTogRm9yd2FyZGVyTWFuYWdlciBhbHJlYWR5IHJ1bm5pbmchIE5PT1AuIik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBmb3IgKEZvcndhcmRlciBmb3J3YXJkZXIgOiBtRm9yd2FyZGVycykgeworICAgICAgICAgICAgZm9yd2FyZGVyLnN0YXJ0KCk7CisgICAgICAgIH0KKworICAgICAgICBtSXNTdGFydGVkID0gdHJ1ZTsKKyAgICAgICAgTG9nLmkoTE9HX1RBRywgIkZvcndhcmRlck1hbmFnZXIgc3RhcnRlZC4iKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgc3RvcCgpIHsKKyAgICAgICAgaWYgKCFtSXNTdGFydGVkKSB7CisgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAic3RvcCgpOiBGb3J3YXJkZXJNYW5hZ2VyIGFscmVhZHkgc3RvcHBlZCEgTk9PUC4iKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGZvciAoRm9yd2FyZGVyIGZvcndhcmRlciA6IG1Gb3J3YXJkZXJzKSB7CisgICAgICAgICAgICBmb3J3YXJkZXIuZmluaXNoKCk7CisgICAgICAgIH0KKworICA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saWMgdm9pZCBvbkZpbmlzaGVkKCkgeworICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoU3RhcnRlci50aGlzKSB7CisgICAgICAgICAgICAgICAgICAgIG1FdmVyeXRoaW5nRmluaXNoZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBTdGFydGVyLnRoaXMubm90aWZ5QWxsKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9KTsKKworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIHdoaWxlICghbUV2ZXJ5dGhpbmdGaW5pc2hlZCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMud2FpdCgpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgInN0YXJ0TGF5b3V0VGVzdHMoKSIsIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEZvcndhcmRlck1hbmFnZXIuZ2V0Rm9yd2FyZGVyTWFuYWdlcigpLnN0b3AoKTsKKyAgICB9Cit9ClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvdGVzdHMvRHVtcFJlbmRlclRyZWUyL3NyYy9jb20vYW5kcm9pZC9kdW1wcmVuZGVydHJlZTIvdWkvRGlyTGlzdEFjdGl2aXR5LmphdmEgYi90ZXN0cy9EdW1wUmVuZGVyVHJlZTIvc3JjL2NvbS9hbmRyb2lkL2R1bXByZW5kZXJ0cmVlMi91aS9EaXJMaXN0QWN0aXZpdHkuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41ZGU2OWE3Ci0tLSAvZGV2L251bGwKKysrIGIvdGVzdHMvRHVtcFJlbmR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KS5nZXROYW1lKCk7CisgICAgICAgICAgICBtSXNEaXJlY3RvcnkgPSBpc0RpcmVjdG9yeTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzRGlyZWN0b3J5KCkgeworICAgICAgICAgICAgcmV0dXJuIG1Jc0RpcmVjdG9yeTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0UmVsYXRpdmVQYXRoKCkgeworICAgICAgICAgICAgcmV0dXJuIG1SZWxhdGl2ZVBhdGg7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgU3RyaW5nIGdldE5hbWUoKSB7CisgICAgICAgICAgICByZXR1cm4gbU5hbWU7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGludCBjb21wYXJlVG8oTGlzdEl0ZW0gYW5vdGhlcikgeworICAgICAgICAgICAgcmV0dXJuIG1SZWxhdGl2ZVBhdGguY29tcGFyZVRvKGFub3RoZXIuZ2V0UmVsYXRpdmVQYXRoKCkpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGVxdWFscyhPYmplY3QgbykgeworICAgICAgICAgICAgaWYgKCEobyBpbnN0YW5jZW9mIExpc3RJdGVtKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIG1SZWxhdGl2ZVBhdGguZXF1YWxzKCgoTGlzdEl0ZW0pbykuZ2V0UmVsYXRpdmVQYXRoKCkpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBpbnQgaGFzaENvZGUoKSB7CisgICAgICAgICAgICByZXR1cm4gbVJlbGF0aXZlUGF0aC5oYXNoQ29kZSgpOworICAgICAgICB9CisKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBIGN1c3RvbSBhZGFwdGV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Vmlld0J5SWQoUi5pZC5pY29uKTsKKyAgICAgICAgICAgIGlmIChtSXRlbXNbcG9zaXRpb25dLmlzRGlyZWN0b3J5KCkpIHsKKyAgICAgICAgICAgICAgICBpY29uLnNldEltYWdlUmVzb3VyY2UoUi5kcmF3YWJsZS5mb2xkZXIpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpY29uLnNldEltYWdlUmVzb3VyY2UoUi5kcmF3YWJsZS5ydW50ZXN0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHJvdzsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKKworICAgICAgICBGb3J3YXJkZXJNYW5hZ2VyLmdldEZvcndhcmRlck1hbmFnZXIoKS5zdGFydCgpOworCisgICAgICAgIG1MaXN0VmlldyA9IGdldExpc3RWaWV3KCk7CisKKyAgICAgICAgbUxpc3RWaWV3LnNldE9uSXRlbUNsaWNrTGlzdGVuZXIobmV3IEFkYXB0ZXJWaWV3Lk9uSXRlbUNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uSXRlbUNsaWNrKEFkYXB0ZXJWaWV3PD8+IHBhcmVudCwgVmlldyB2aWV3LCBpbnQgcG9zaXRpb24sIGxvbmcgaWQpIHsKKyAgICAgICAgICAgICAgICBMaXN0SXRlbSBpdGVtID0gKExpc3RJdGVtKXBhcmVudC5nZXRJdGVtQXRQb3NpdGlvbihwb3NpdGlvbik7CisKKyAgICAgICAgICAgICAgICBpZiAoaXRlbS5pc0RpcmVjdG9yeSgpKSB7CisgICAgICAgICAgICAgICAgICAgIHNob3dEaXIoaXRlbS5nZXRSZWxhdGl2ZVBhdGgoKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLyoqIFJ1biB0aGUgdGVzdCAqLworICAgICAgICAgICAgICAgICAgICBydW5BbGxUZXN0c1VuZGVyKGl0ZW0uZ2V0UmVsYXRpdmVQYXRoKCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisKKyAgICAgICAgbUxpc3RWaWV3LnNldE9uSXRlbUxvbmdDbGlja0xpc3RlbmVyKG5ldyBBZGFwdGVyVmlldy5Pbkl0ZW1Mb25nQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gb25JdGVtTG9uZ0NsaWNrKEFkYXB0ZXJWaWV3PD8+IHBhcmVudCwgVmlldyB2aWV3LCBpbnQgcG9zaXRpb24sIGxvbmcgaWQpIHsKKyAgICAgICAgICAgICAgICBMaXN0SXRlbSBpdGVtID0gKExpc3RJdGVtKXBhcmVudC5nZXRJdGVtQXRQb3NpdGlvbihwb3NpdGlvbik7CisKKyAgICAgICAgICAgICAgICBpZiAoaXRlbS5pc0RpcmVjdG9yeSgpKSB7CisgICAgICAgICAgICAgICAgICAgIEJ1bmRsZSBhcmd1bWVudHMgPSBuZXcgQnVuZGxlKDEpOworICAgICAgICAgICAgICAgICAgICBhcmd1bWVudHMucHV0U3RyaW5nKCJuYW1lIiwgaXRlbS5nZXROYW1lKCkpOworICAgICAgICAgICAgICAgICAgICBhcmd1bWVudHMucHV0U3RyaW5nKCJyZWxhdGl2ZVBhdGgiLCBpdGVtLmdldFJlbGF0aXZlUGF0aCgpKTsKKyAgICAgICAgICAgICAgICAgICAgc2hvd0RpYWxvZyhESUFMT0dfUlVOX0FCT1JUX0RJUiwgYXJndW1lbnRzKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvKiogVE9ETzogTWF5YmUgc2hvdyBzb21lIGluZm8gYWJvdXQgYSB0ZXN0PyAqLworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKworICAgICAgICAvKiogQWxsIHRoZSBwYXRocyBhcmUgcmVsYXRpdmUgdG8gdGVzdCByb290IGRpciB3aGVyZSBwb3NzaWJsZSAqLworICAgICAgICBzaG93RGlyKCIiKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcnVuQWxsVGVzdHNVbmRlcihTdHJpbmcgcmVsYXRpdmVQYXRoKSB7CisgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KCk7CisgICAgICAgIGludGVudC5zZXRDbGFzcyhEaXJMaXN0QWN0aXZpdHkudGhpcywgVGVzdHNMaXN0QWN0aXZpdHkuY2xhc3MpOworICAgICAgICBpbnRlbnQuc2V0QWN0aW9uKEludGVudC5BQ1RJT05fUlVOKTsKKyAgICAgICAgaW50ZW50LnB1dEV4dHJhKFRlc3RzTGlzdEFjdGl2aXR5LkVYVFJBX1RFU1RfUEFUSCwgcmVsYXRpdmVQYXRoKTsKKyAgICAgICAgc3RhcnRBY3Rpdml0eShpbnRlbnQpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uQ3JlYXRlT3B0aW9uc01lbnUoTWVudSBtZW51KSB7CisgICAgICAgIE1lbnVJbmZsYXRlciBpbmZsYXRlciA9IGdldE1lbnVJbmZsYXRlcigpOworICAgICAgICBpbmZsYXRlci5pbmZsYXRlKFIubWVudS5ndWlfbWVudSwgbWVudSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uT3B0aW9uc0l0ZW1TZWxlY3RlZChNZW51SXRlbSBpdGVtKSB7CisgICAgICAgIHN3aXRjaCAoaXRlbS5nZXRJdGVtSWQoKSkgeworICAgICAgICAgICAgY2FzZSBSLmlkLnJ1bl9hbGw6CisgICAgICAgICAgICAgICAgcnVuQWxsVGVzdHNVbmRlcihtQ3VycmVudERpclBhdGgpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICByZXR1cm4gc3VwZXIub25PcHRpb25zSXRlbVNlbGVjdGVkKGl0ZW0pOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgLyoqCisgICAgICogTW92ZXMgdG8gdGhlIHBhcmVudCBkaXJlY3RvcnkgaWYgb25lIGV4aXN0cy4gRG9lcyBub3QgYWxsb3cgdG8gbW92ZSBhYm92ZQorICAgICAqIHRoZSB0ZXN0ICdyb290JyBkaXJlY3RvcnkuCisgICAgICovCisgICAgcHVibGljIHZvaWQgb25CYWNrUHJlc3NlZCgpIHsKKyAgICAgICAgRmlsZSBjdXJyZW50RGlyUGFyZW50ID0gbmV3IEZpbGUobUN1cnJlbnREaXJQYXRoKS5nZXRQYXJlbnRGaWxlKCk7CisgICAgICAgIGlmIChjdXJyZW50RGlyUGFyZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHNob3dEaXIoY3VycmVudERpclBhcmVudC5nZXRQYXRoKCkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc2hvd0RpcigiIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBQcmV2ZW50cyB0aGUgYWN0aXZpdHkgZnJvbSByZWNyZWF0aW5nIG9uIGNoYW5nZSBvZiBvcmllbnRhdGlvbi4gVGhlIHRpdGxlIG5lZWRzIHRvCisgICAgICogYmUgcmVjYWxjdWxhdGVkLgorICAgICAqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uQ29uZmlndXJhdGlvbkNoYW5nZWQoQ29uZmlndXJhdGlvbiBuZXdDb25maWcpIHsKKyAgICAgICAgc3VwZXIub25Db25maWd1cmF0aW9uQ2hhbmdlZChuZXdDb25maWcpOworCisgICAgICAgIHNldFRpdGxlKHNob3J0ZW5UaXRsZShtQ3VycmVudERpclBhdGgpKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgRGlhbG9nIG9uQ3JlYXRlRGlhbG9nKGludCBpZCwgZmluYWwgQnVuZGxlIGFyZ3MpIHsKKyAgICAgICAgRGlhbG9nIGRpYWxvZyA9IG51bGw7CisgICAgICAgIEFsZXJ0RGlhbG9nLkJ1aWxkZXIgYnVpbGRlciA9IG5ldyBBbGVydERpYWxvZy5CdWlsZGVyKHRoaXMpOworCisgICAgICAgIHN3aXRjaCAoaWQpIHsKKyAgICAgICAgICAgIGNhc2UgRElBTE9HX1JVTl9BQk9SVF9ESVI6CisgICAgICAgICAgICAgICAgYnVpbGRlci5zZXRUaXRsZShnZXRUZXh0KFIuc3RyaW5nLmRpYWxvZ19ydW5fYWJvcnRfZGlyX3RpdGxlX3ByZWZpeCkgKyAiICIgKworICAgICAgICAgICAgICAgICAgICAgICAgYXJncy5nZXRTdHJpbmcoIm5hbWUiKSk7CisgICAgICAgICAgICAgICAgYnVpbGRlci5zZXRNZXNzYWdlKFIuc3RyaW5nLmRpYWxvZ19ydW5fYWJvcnRfZGlyX21zZyk7CisgICAgICAgICAgICAgICAgYnVpbGRlci5zZXRDYW5jZWxhYmxlKHRydWUpOworCisgICAgICAgICAgICAgICAgYnVpbGRlci5zZXRQb3NpdGl2ZUJ1dHRvbihSLnN0cmluZy5kaWFsb2dfcnVuX2Fib3J0X2Rpcl9va19idXR0b24sCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgRGlhbG9nSW50ZXJmYWNlLk9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soRGlhbG9nSW50ZXJmYWNlIGRpYWxvZywgaW50IHdoaWNoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVEaWFsb2coRElBTE9HX1JVTl9BQk9SVF9ESVIpOworICAgICAgICAgICAgICAgICAgICAgICAgcnVuQWxsVGVzdHNVbmRlcihhcmdzLmdldFN0cmluZygicmVsYXRpdmVQYXRoIikpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICBidWlsZGVyLnNldE5lZ2F0aXZlQnV0dG9uKFIuc3RyaW5nLmRpYWxvZ19ydW5fYWJvcnRfZGlyX2Fib3J0X2J1dHRvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBEaWFsb2dJbnRlcmZhY2UuT25DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhEaWFsb2dJbnRlcmZhY2UgZGlhbG9nLCBpbnQgd2hpY2gpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZURpYWxvZyhESUFMT0dfUlVOX0FCT1JUX0RJUik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgIGRpYWxvZyA9IGJ1aWxkZXIuY3JlYXRlKCk7CisgICAgICAgICAgICAgICAgZGlhbG9nLnNldE9uQ2FuY2VsTGlzdGVuZXIobmV3IERpYWxvZ0ludGVyZmFjZS5PbkNhbmNlbExpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DYW5jZWwoRGlhbG9nSW50ZXJmYWNlIGRpYWxvZykgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlRGlhbG9nKERJQUxPR19SVU5fQUJPUlRfRElSKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGRpYWxvZzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBMb2FkcyB0aGUgY29udGVudHMgb2YgZGlyIGludG8gdGhlIGxpc3Qgdmlldy4KKyAgICAgKgorICAgICAqIEBwYXJhbSBkaXJQYXRoCisgICAgICogICAgICBkaXJlY3RvcnkgdG8gbG9hZCBpbnRvIGxpc3QgdmlldworICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzaG93RGlyKFN0cmluZyBkaXJQYXRoKSB7CisgICAgICAgIG1DdXJyZW50RGlyUGF0aCA9IGRpclBhdGg7CisKKyAgICAgICAgLyoqIFNob3cgcHJvZ3Jlc3MgZGlhbG9nIHdpdGggYSBkZWxheSAqLworICAgICAgICBmaW5hbCBIYW5kbGVyIGRlbGF5ZWREaWFsb2dIYW5kbGVyID0gbmV3IEhhbmRsZXIoKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgICAgICBpZiAobXNnLndoYXQgPT0gTVNHX1NIT1dfUFJPR1JFU1NfRElBTE9HKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzUHJvZ3Jlc3NEaWFsb2cgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc1Byb2dyZXNzRGlhbG9nID0gbmV3IFByb2dyZXNzRGlhbG9nKERpckxpc3RBY3Rpdml0eS50aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNQcm9ncmVzc0RpYWxvZy5zZXRDYW5jZWxhYmxlKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNQcm9ncmVzc0RpYWxvZy5zZXRQcm9ncmVzc1N0eWxlKFByb2dyZXNzRGlhbG9nLlNUWUxFX1NQSU5ORVIpOworICAgICAgICAgICAgICAgICAgICAgICAgc1Byb2dyZXNzRGlhbG9nLnNldFRpdGxlKFIuc3RyaW5nLmRpYWxvZ19wcm9ncmVzc190aXRsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzUHJvZ3Jlc3NEaWFsb2cuc2V0TWVzc2FnZShnZXRUZXh0KFIuc3RyaW5nLmRpYWxvZ19wcm9ncmVzc19tc2cpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzUHJvZ3Jlc3NEaWFsb2cuc2hvdygpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgICAgTWVzc2FnZSBtc2dTaG93RGlhbG9nID0gZGVsYXllZERpYWxvZ0hhbmRsZXIub2J0YWluTWVzc2FnZShNU0dfU0hPV19QUk9HUkVTU19ESUFMT0cpOworICAgICAgICBkZWxheWVkRGlhbG9nSGFuZGxlci5zZW5kTWVzc2FnZURlbGF5ZWQobXNnU2hvd0RpYWxvZywgUFJPR1JFU1NfRElBTE9HX0RFTEFZX01TKTsKKworICAgICAgICAvKiogRGVsZWdhdGUgbG9hZGluZyBjb250ZW50cyBmcm9tIFNEIGNhcmQgdG8gYSBuZXcgdGhyZWFkICovCisgICAgICAgIG5ldyBMb2FkTGlzdEl0ZW1zVGhyZWFkKG1DdXJyZW50RGlyUGF0aCwgbmV3IEhhbmRsZXIoKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgICAgICBpZiAobXNnLndoYXQgPT0gTVNHX0xPQURFRF9JVEVNUykgeworICAgICAgICAgICAgICAgICAgICBzZXRUaXRsZShzaG9ydGVuVGl0bGUobUN1cnJlbnREaXJQYXRoKSk7CisgICAgICAgICAgICAgICAgICAgIGRlbGF5ZWREaWFsb2dIYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE1TR19TSE9XX1BST0dSRVNTX0RJQUxPRyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChzUHJvZ3Jlc3NEaWFsb2cgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc1Byb2dyZXNzRGlhbG9nLmRpc21pc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAobXNnLm9iaiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBUb2FzdC5tYWtlVGV4dChEaXJMaXN0QWN0aXZpdHkudGhpcywgTk9fUkVTUE9OU0VfTUVTU0FHRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVG9hc3QuTEVOR1RIX0xPTkcpLnNob3coKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldExpc3RBZGFwdGVyKG5ldyBEaXJMaXN0QWRhcHRlcihEaXJMaXN0QWN0aXZpdHkudGhpcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExpc3RJdGVtW10pbXNnLm9iaikpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9KS5zdGFydCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRPRE86IGZpbmQgYSBuZWF0IHdheSB0byBkZXRlcm1pbmUgbnVtYmVyIG9mIGNoYXJhY3RlcnMgdGhhdCBmaXQgaW4gdGhlIHRpdGxlCisgICAgICogYmFyLgorICAgICAqICovCisgICAgcHJpdmF0ZSBTdHJpbmcgc2hvcnRlblRpdGxlKFN0cmluZyB0aXRsZSkgeworICAgICAgICBpZiAodGl0bGUuZXF1YWxzKCIiKSkgeworICAgICAgICAgICAgcmV0dXJuICJUZXN0cycgcm9vdCBkaXI6IjsKKyAgICAgICAgfQorICAgICAgICBpbnQgY2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Hk+CisgICAgICAgIAorICAgICAgICA8YWN0aXZpdHkKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm5hbWU9IkFkdmFuY2VkR3JhZGllbnRzQWN0aXZpdHkiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYWJlbD0iX0FkdmFuY2VkIEdyYWRpZW50cyI+CisgICAgICAgICAgICA8aW50ZW50LWZpbHRlcj4KKyAgICAgICAgICAgICAgICA8YWN0aW9uIGFuZHJvaWQ6bmFtZT0iYW5kcm9pZC5pbnRlbnQuYWN0aW9uLk1BSU4iIC8+CisgICAgICAgICAgICAgICAgPGNhdGVnb3J5IGFuZHJvaWQ6bmFtZT0iYW5kcm9pZC5pbnRlbnQuY2F0ZWdvcnkuTEFVTkNIRVIiIC8+CisgICAgICAgICAgICA8L2ludGVudC1maWx0ZXI+CisgICAgICAgIDwvYWN0aXZpdHk+CisgICAgICAgIAorICAgICAgICA8YWN0aXZpdHkKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm5hbWU9IkJpdG1hcHMzZEFjdGl2aXR5IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGFiZWw9Il9CaXRtYXBzM2QiPgorICAgICAgICAgICAgPGludGVudC1maWx0ZXI+CisgICAgICAgICAgICAgICAgPGFjdGlvbiBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmFjdGlvbi5NQUlOIiAvPgorICAgICAgICAgICAgICAgIDxjYXRlZ29yeSBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmNhdGVnb3J5LkxBVU5DSEVSIiAvPgorICAgICAgICAgICAgPC9pbnRlbnQtZmlsdGVyPgorICAgICAgICA8L2FjdGl2aXR5PgorICAgICAgICAKKyAgICAgICAgPGFjdGl2aXR5CisgICAgICAgICAgICAgICAgYW5kcm9pZDpuYW1lPSJMYWJlbHNBY3Rpdml0eSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxhYmVsPSJfTGFiZWxzIj4KKyAgICAgICAg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nb3J5IGFuZHJvaWQ6bmFtZT0iYW5kcm9pZC5pbnRlbnQuY2F0ZWdvcnkuTEFVTkNIRVIiIC8+CisgICAgICAgICAgICA8L2ludGVudC1maWx0ZXI+CisgICAgICAgIDwvYWN0aXZpdHk+CisgICAgICAgIAorICAgICAgICA8YWN0aXZpdHkKKyAgICAgICAgICAgICAgICBhbmRyb2lkOm5hbWU9IlF1aWNrUmVqZWN0QWN0aXZpdHkiCisgICAgICAgICAgICAgICAgYW5kcm9pZDpsYWJlbD0iX1F1aWNrUmVqZWN0Ij4KKyAgICAgICAgICAgIDxpbnRlbnQtZmlsdGVyPgorICAgICAgICAgICAgICAgIDxhY3Rpb24gYW5kcm9pZDpuYW1lPSJhbmRyb2lkLmludGVudC5hY3Rpb24uTUFJTiIgLz4KKyAgICAgICAgICAgICAgICA8Y2F0ZWdvcnkgYW5kcm9pZDpuYW1lPSJhbmRyb2lkLmludGVudC5jYXRlZ29yeS5MQVVOQ0hFUiIgLz4KKyAgICAgICAgICAgIDwvaW50ZW50LWZpbHRlcj4KKyAgICAgICAgPC9hY3Rpdml0eT4KKyAgICAgICAgCisgICAgICAgIDxhY3Rpdml0eQorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bmFtZT0iUm90YXRpb25BY3Rpdml0eSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxhYmVsPSJfUm90YXRpb24iPgorICAgICAgICAgICAgPGludGVudC1maWx0ZXI+CisgICAgICAgICAgICAgICAgPGFjdGlvbiBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmFjdGlvbi5NQUlOIiAvPgorICAgICAgICAgICAgICAgIDxjYXRlZ29yeSBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmNhdGVnb3J5LkxBVU5DSEVSIiAvPgorICAgICAgICAgICAgPC9pbnRlbnQtZmlsdGVyPgorICAgICAgICA8L2FjdGl2aXR5PgorICAgICAgICAKKyAgICAgICAgPGFjdGl2aXR5CisgICAgIC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5IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGFiZWw9Il9MaW5lcyIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmhhcmR3YXJlQWNjZWxlcmF0ZWQ9InRydWUiPgorICAgICAgICAgICAgPGludGVudC1maWx0ZXI+CisgICAgICAgICAgICAgICAgPGFjdGlvbiBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmFjdGlvbi5NQUlOIiAvPgorICAgICAgICAgICAgICAgIDxjYXRlZ29yeSBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmNhdGVnb3J5LkxBVU5DSEVSIiAvPgorICAgICAgICAgICAgPC9pbnRlbnQtZmlsdGVyPgorICAgICAgICA8L2FjdGl2aXR5PgorCisgICAgICAgIDxhY3Rpdml0eQorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bmFtZT0iUGF0aHNBY3Rpdml0eSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxhYmVsPSJfUGF0aHMiPgorICAgICAgICAgICAgPGludGVudC1maWx0ZXI+CisgICAgICAgICAgICAgICAgPGFjdGlvbiBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmFjdGlvbi5NQUlOIiAvPgorICAgICAgICAgICAgICAgIDxjYXRlZ29yeSBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmNhdGVnb3J5LkxBVU5DSEVSIiAvPgorICAgICAgICAgICAgPC9pbnRlbnQtZmlsdGVyPgorICAgICAgICA8L2FjdGl2aXR5PgorCisgICAgICAgIDxhY3Rpdml0eQorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bmFtZT0iVHJhbnNmb3JtM2RBY3Rpdml0eSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxhYmVsPSJfM2QiPgorICAgICAgICAgICAgPGludGVudC1maWx0ZXI+CisgICAgICAgICAgICAgICAgPGFjdGlvbiBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50Lm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ICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9Im1hdGNoX3BhcmVudCI+CisKKyAgICA8TGluZWFyTGF5b3V0CisgICAgICAgIGFuZHJvaWQ6b3JpZW50YXRpb249Imhvcml6b250YWwiCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJtYXRjaF9wYXJlbnQiCisgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50Ij4KKyAgICAgICAgCisgICAgICAgIDxUZXh0VmlldworICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgYW5kcm9pZDp0ZXh0PSJGaXJzdCBuYW1lIiAvPgorICAgICAgICAKKyAgICAgICAgPEVkaXRUZXh0CisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iMGRpcCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dlaWdodD0iMS4wIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5MZWZ0PSIzZGlwIgorICAgICAgICAgICAgYW5kcm9pZDpoaW50PSJFbnRlciB5b3VyIGZpcnN0IG5hbWUiIC8+CisgICAgICAgIAorICAgIDwvTGluZWFyTGF5b3V0PgorCisgICAgPExpbmVhckxheW91dAorICAgICAgICBhbmRyb2lkOm9yaWVudGF0aW9uPSJob3Jpem9udGFsIgorICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0ibWF0Y2hfcGFyZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCI+CisgICAgICAgIAorICAgICAgICA8VGV4dFZpZXcKKyAgICAgICAgICAgIGFuZHJvaWQ6b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XI7CisKKyAgICAgICAgU2hhZGVyc1ZpZXcoQ29udGV4dCBjKSB7CisgICAgICAgICAgICBzdXBlcihjKTsKKworICAgICAgICAgICAgQml0bWFwIHRleHR1cmUgPSBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKGMuZ2V0UmVzb3VyY2VzKCksIFIuZHJhd2FibGUuc3Vuc2V0MSk7CisgICAgICAgICAgICBtVGV4V2lkdGggPSB0ZXh0dXJlLmdldFdpZHRoKCk7CisgICAgICAgICAgICBtVGV4SGVpZ2h0ID0gdGV4dHVyZS5nZXRIZWlnaHQoKTsKKyAgICAgICAgICAgIG1EcmF3V2lkdGggPSBtVGV4V2lkdGggKiAyLjJmOworICAgICAgICAgICAgbURyYXdIZWlnaHQgPSBtVGV4SGVpZ2h0ICogMS4yZjsKKworICAgICAgICAgICAgbVNjYWxlZFNoYWRlciA9IG5ldyBCaXRtYXBTaGFkZXIodGV4dHVyZSwgU2hhZGVyLlRpbGVNb2RlLk1JUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgU2hhZGVyLlRpbGVNb2RlLk1JUlJPUik7CisgICAgICAgICAgICBNYXRyaXggbTIgPSBuZXcgTWF0cml4KCk7CisgICAgICAgICAgICBtMi5zZXRTY2FsZSgwLjVmLCAwLjVmKTsKKyAgICAgICAgICAgIG1TY2FsZWRTaGFkZXIuc2V0TG9jYWxNYXRyaXgobTIpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtU2NhbGVkMlNoYWRlciA9IG5ldyBCaXRtYXBTaGFkZXIodGV4dHVyZSwgU2hhZGVyLlRpbGVNb2RlLk1JUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgU2hhZGVyLlRpbGVNb2RlLk1JUlJPUik7CisgICAgICAgICAgICBNYXRyaXggbTMgPSBuZXcgTWF0cml4KCk7CisgICAgICAgICAgICBtMy5zZXRTY2FsZSgwLjFmLCAwLjFmKTsKKyAgICAgICAgICAgIG1TY2FsZWQyU2hhZGVyLnNldExvY2FsTWF0cml4KG0zKTsKKworICAgICAgICAgICAgbUhvckdyYWRpZW50ID0gbmV3IExpbmVhckdyYWRpZW50KDAuMGYsIDAuMGYsIG1EcmF3V2lkdGgsIDAuMGYsCisgICAgICAgICAgICAgICAgICAgIENvbG9yLkJMQUNLLCBDb2xvci5XSElURSwgU2hhZGVyLlRpbGVNb2RlLkNMQU1QKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUNvbXBvc2VTaGFkZXIgPSBuZXcgQ29tcG9zZVNoYWRlcihtU2NhbGVkU2hhZGVyLCBtSG9yR3JhZGllbnQsCisgICAgICAgICAgICAgICAgICAgIFBvcnRlckR1ZmYuTW9kZS5EQVJLRU4pOworICAgICAgICAgICAgbUNvbXBvc2UyU2hhZGVyID0gbmV3IENvbXBvc2VTaGFkZXIobVNjYWxlZFNoYWRlciwgbUhvckdyYWRpZW50LAorICAgICAgICAgICAgICAgICAgICBQb3J0ZXJEdWZmLk1vZGUuTElHSFRFTik7CisgICAgICAgICAgICBtQ29tcG9zZTNTaGFkZXIgPSBuZXcgQ29tcG9zZVNoYWRlcihtU2NhbGVkU2hhZGVyLCBtSG9yR3JhZGllbnQsCisgICAgICAgICAgICAgICAgICAgIFBvcnRlckR1ZmYuTW9kZS5NVUxUSVBMWSk7CisgICAgICAgICAgICBtQ29tcG9zZTRTaGFkZXIgPSBuZXcgQ29tcG9zZVNoYWRlcihtU2NhbGVkU2hhZGVyLCBtSG9yR3JhZGllbnQsCisgICAgICAgICAgICAgICAgICAgIFBvcnRlckR1ZmYuTW9kZS5TQ1JFRU4pOworICAgICAgICAgICAgbUNvbXBvc2U1U2hhZGVyID0gbmV3IENvbXBvc2VTaGFkZXIobVNjYWxlZFNoYWRlciwgbUhvckdyYWRpZW50LAorICAgICAgICAgICAgICAgICAgICBQb3J0ZXJEdWZmLk1vZGUuQUREKTsKKyAgICAgICAgICAgIG1Db21wb3NlNlNoYWRlciA9IG5ldyBDb21wb3NlU2hhZGVyKG1Ib3JHcmFkaWVudCwgbVNjYWxlZFNoYWRlciwKKyAgICAgICAgICAgICAgICAgICAgUG9ydGVyRHVmZi5Nb2RlLk9WRVJMQVkpOworCisgICAgICAgICAgICBtUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXcoQ2FudmFzIGNhbnZhcykgeworICAgICAgICAgICAgc3VwZXIub25EcmF3KGNhbnZhcyk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JHQigyNTUsIDI1NSwgMjU1KTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoNDAuMGYsIDQwLjBmKTsKKworICAgICAgICAgICAgbVBhaW50LnNldFNoYWRlcihtQ29tcG9zZVNoYWRlcik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgbURyYXdXaWR0aCwgbURyYXdIZWlnaHQsIG1QYWludCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgNDAuMGYgKyBtRHJhd0hlaWdodCk7CisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1Db21wb3NlMlNoYWRlcik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgbURyYXdXaWR0aCwgbURyYXdIZWlnaHQsIG1QYWludCk7CisKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgNDAuMGYgKyBtRHJhd0hlaWdodCk7CisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1Db21wb3NlM1NoYWRlcik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgbURyYXdXaWR0aCwgbURyYXdIZWlnaHQsIG1QYWludCk7CisKKyAgICAgICAgICAgIGNhbnZhcy5yZ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gICAgIHByaXZhdGUgZmluYWwgUmFkaWFsR3JhZGllbnQgbVJhZGlhbEdyYWRpZW50OworICAgICAgICBwcml2YXRlIGZpbmFsIE1hdHJpeCBtTWF0cml4OworICAgICAgICBwcml2YXRlIGZpbmFsIE1hdHJpeCBtTWF0cml4MjsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBNYXRyaXggbU1hdHJpeDM7CisKKyAgICAgICAgR3JhZGllbnRzVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworCisgICAgICAgICAgICBtU3dlZXBHcmFkaWVudCA9IG5ldyBTd2VlcEdyYWRpZW50KDAuMGYsIDAuMGYsIDB4ZmYwMDAwMDAsIDB4ZmZmZmZmZmYpOworICAgICAgICAgICAgbVJhZGlhbEdyYWRpZW50ID0gbmV3IFJhZGlhbEdyYWRpZW50KDAuMGYsIDAuMGYsIDEwMC4wZiwgMHhmZjAwMDAwMCwgMHhmZmZmZmZmZiwKKyAgICAgICAgICAgICAgICAgICAgU2hhZGVyLlRpbGVNb2RlLk1JUlJPUik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1NYXRyaXggPSBuZXcgTWF0cml4KCk7CisgICAgICAgICAgICBtTWF0cml4LnNldFJvdGF0ZSgtNDUsIDAuMGYsIDAuMGYpOworICAgICAgICAgICAgbU1hdHJpeC5wb3N0VHJhbnNsYXRlKDEwMC4wZiwgMTAwLjBmKTsKKworICAgICAgICAgICAgbU1hdHJpeDIgPSBuZXcgTWF0cml4KCk7CisgICAgICAgICAgICBtTWF0cml4Mi5zZXRTY2FsZSgxLjBmLCAyLjBmKTsKKyAgICAgICAgICAgIG1NYXRyaXgyLnBvc3RSb3RhdGUoLTQ1LCAwLjBmLCAwLjBmKTsKKworICAgICAgICAgICAgbU1hdHJpeDMgPSBuZXcgTWF0cml4KCk7CisgICAgICAgICAgICBtTWF0cml4My5zZXRUcmFuc2xhdGUoMTAwLjBmLCAxMDAuMGYpOyAgICAgICAgICAgIAorICAgICAgICAgICAgCisgICAgICAgICAgICBtUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXcoQ2FudmFzIGNhbnZhcykgeworICAgICAgICAgICAgc3VwZXIub25EcmF3KGNhbnZhcyk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JHQigyNTUsIDI1NSwgMjU1KTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMTMwLjBmLCAxMDAuMGYpOworCisgICAgICAgICAgICBtU3dlZXBHcmFkaWVudC5zZXRMb2NhbE1hdHJpeChtTWF0cml4Myk7CisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1Td2VlcEdyYWRpZW50KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCAyMDAuMGYsIDIwMC4wZiwgbVBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSg0MDAuMGYsIDAwMC4wZik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1Td2VlcEdyYWRpZW50LnNldExvY2FsTWF0cml4KG1NYXRyaXgpOworICAgICAgICAgICAgbVBhaW50LnNldFNoYWRlcihtU3dlZXBHcmFkaWVudCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgMjAwLjBmLCAyMDAuMGYsIG1QYWludCk7ICAgICAgICAgICAgCisKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoNDAwLjBmLCAwMDAuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtU3dlZXBHcmFkaWVudC5zZXRMb2NhbE1hdHJpeChtTWF0cml4Mik7CisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1Td2VlcEdyYWRpZW50KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCAyMDAuMGYsIDIwMC4wZiwgbVBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgtODAwLjBmLCAzMDAuMGYpOworCisgICAgICAgICAgICBtUmFkaWFsR3JhZGllbnQuc2V0TG9jYWxNYXRyaXgobnVsbCk7CisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1SYWRpYWxHcmFkaWVudCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgMjAwLjBmLCAyMDAuMGYsIG1QYWludCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoNDAwLjBmLCAwMDAuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtUmFkaWFsR3JhZGllbnQuc2V0TG9jYWxNYXRyaXgobU1hdHJpeCk7CisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1SYWRpYWxHcmFkaWVudCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgMjAwLjBmLCAyMDAuMGYsIG1QYWludCk7CisKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoNDAwLjBmLCAwMDAuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtUmFkaWFsR3JhZGllbnQuc2V0TG9jYWxNYXRyaXgobU1hdHJpeDIpOworICAgICAgICAgICAgbVBhaW50LnNldFNoYWRlcihtUmFkaWFsR3JhZGllbnQpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDAuMGYsIDAuMGYsIDIwMC4wZiwgMjAwLjBmLCBtUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlKCk7CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS90ZXN0cy9Id0FjY2VsZXJh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ldyBjb250YWluZXIgPSBuZXcgRGlydHlCaXRtYXBWaWV3KHRoaXMpOworCisgICAgICAgIENvbG9yVmlldyBjb2xvciA9IG5ldyBDb2xvclZpZXcodGhpcyk7CisgICAgICAgIGNvbnRhaW5lci5hZGRWaWV3KGNvbG9yLCBuZXcgRGlydHlCaXRtYXBWaWV3LkxheW91dFBhcmFtcygKKyAgICAgICAgICAgICAgICBkaXBUb1B4KHRoaXMsIDEwMCksIGRpcFRvUHgodGhpcywgMTAwKSwgR3Jhdml0eS5DRU5URVIpKTsKKworICAgICAgICBBbHBoYUFuaW1hdGlvbiBhID0gbmV3IEFscGhhQW5pbWF0aW9uKDEuMGYsIDAuMGYpOworICAgICAgICBhLnNldER1cmF0aW9uKDIwMDApOworICAgICAgICBhLnNldFJlcGVhdENvdW50KEFuaW1hdGlvbi5JTkZJTklURSk7CisgICAgICAgIGEuc2V0UmVwZWF0TW9kZShBbmltYXRpb24uUkVWRVJTRSk7CisgICAgICAgIGNvbG9yLnN0YXJ0QW5pbWF0aW9uKGEpOworCisgICAgICAgIHNldENvbnRlbnRWaWV3KGNvbnRhaW5lcik7CisgICAgfQorICAgIAorICAgIEBTdXBwcmVzc1dhcm5pbmdzKHsiVW51c2VkRGVjbGFyYXRpb24ifSkKKyAgICBzdGF0aWMgaW50IGRpcFRvUHgoQ29udGV4dCBjLCBpbnQgZGlwKSB7CisgICAgICAgIHJldHVybiAoaW50KSAoYy5nZXRSZXNvdXJjZXMoKS5nZXREaXNwbGF5TWV0cmljcygpLmRlbnNpdHkgKiBkaXAgKyAwLjVmKTsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgQ29sb3JWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIENvbG9yVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UkdCKDAsIDI1NSwgMCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgRGlydHlCaXRtYXBWaWV3IGV4dGVuZHMgRnJhbWVMYXlvdXQgeworICAgICAgICBwcml2YXRlIGZpbmFsIFBhaW50IG1QYWludDsKKworICAgICAgICBEaXJ0eUJpdG1hcFZpZXcoQ29udGV4dCBjKSB7CisgICAgICAgICAgICBzdXBlcihjKTsKKyAgICAgICAgICAgIG1QYWludCA9IG5ldyBQYWludCgpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JHQigyNTUsIDI1NSwgMjU1KTsKKworICAgICAgICAgICAgbVBhaW50LnNldENvbG9yKDB4ZmZmZjAwMDApOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDIwMC4wZiwgMC4wZiwgMjIwLjBmLCAyMC4wZiwgbVBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy5jbGlwUmVjdCgyMC4wZiwgMC4wZiwgNDAuMGYsIDIwLjBmKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJjbGlwUmVjdCA9ICIgKyBjYW52YXMuZ2V0Q2xpcEJvdW5kcygpKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJyZWplY3RlZCA9ICIgKyBjYW52YXMucXVpY2tSZWplY3QoMTAwLjBmLCAxMDAuMGYsIDExMC4wZiwgMTEwLjBmLAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuRWRnZVR5cGUuQlcpKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJyZWplY3RlZCA9ICIgKyBjYW52YXMucXVpY2tSZWplY3QoMjUuMGYsIDUuMGYsIDMwLjBmLCAxMC4wZiwKKyAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkVkZ2VUeXBlLkJXKSk7CisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgY2FudmFzLnNjYWxlKDIuMGYsIDIuMGYpOworICAgICAgICAgICAgY2FudmFzLmNsaXBSZWN0KDIwLjBmLCAwLjBmLCA0MC4wZiwgMjAuMGYpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgImNsaXBSZWN0ID0gIiArIGNhbnZhcy5nZXRDbGlwQm91bmRzKCkpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgInJlamVjdGVkID0gIiArIGNhbnZhcy5xdWlja1JlamVjdCg1MC4wZiwgNTAuMGYsIDYwLjBmLCA2MC4wZiwKKyAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkVkZ2VUeXBlLkJXKSk7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAicmVqZWN0ZWQgPSAiICsgY2FudmFzLnF1aWNrUmVqZWN0KDI1LjBmLCA1LjBmLCAzMC4wZiwgMTAuMGYsCisgICAgICAgICAgICAgICAgICAgIENhbnZhcy5FZGdlVHlwZS5CVykpOworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmUoKTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMjAuMGYsIDIwLjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5jbGlwUmVjdCgyMC4wZiwgMC4wZiwgNDAuMGYsIDIwLjBmKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJjbGlwUmVjdCA9ICIgKyBjYW52YXMuZ2V0Q2xpcEJvdW5kcygpKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJyZWplY3RlZCA9ICIgKyBjYW52YXMucXVpY2tSZWplY3QoODAuMGYsIDgwLjBmLCA5MC4wZiwgOTAuMGYsCisgICAgICAgICAgICAgICAgICAgIENhbnZhcy5FZGdlVHlwZS5CVykpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgInJlamVjdGVkID0gIiArIGNhbnZhcy5xdWlja1JlamVjdCgyNS4wZiwgNS4wZiwgMzAuMGYsIDEwLjBmLAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuRWRnZVR5cGUuQlcpKTsKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlKCk7CisKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICBjYW52YXMuc2NhbGUoMi4wZiwgMi4wZik7ICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMuY2xpcFJlY3QoMjAuMGYsIDAuMGYsIDQwLjBmLCAyMC4wZik7CisKKyAgICAgICAgICAgIG1QYWludC5zZXRDb2xvcigweGZmMDBmZjAwKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCAyMC4wZiwgMjAuMGYsIG1QYWludCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1QYWludC5zZXRDb2xvcigweGZmMDAwMGZmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgyMC4wZiwgMC4wZiwgNDAuMGYsIDIwLjBmLCBtUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworCisgICAgICAgICAgICBmaW5hbCBpbnQgcmVzdG9yZVRvID0gY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlTGF5ZXJBbHBoYSgwLjBmLCAxMDAuMGYsIGdldFdpZHRoKCksIDE1MC4wZiwgMTI3LAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuSEFTX0FMUEhBX0xBWUVSX1NBVkVfR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XggbU1hdHJpeDsKKworICAgICAgICBCaXRtYXBzVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworCisgICAgICAgICAgICBtQml0bWFwMSA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlUmVzb3VyY2UoYy5nZXRSZXNvdXJjZXMoKSwgUi5kcmF3YWJsZS5zdW5zZXQxKTsKKyAgICAgICAgICAgIG1CaXRtYXBQYWludCA9IG5ldyBQYWludCgpOworCisgICAgICAgICAgICBtTWF0cml4ID0gbmV3IE1hdHJpeCgpOworICAgICAgICAgICAgbU1hdHJpeC5zZXRTY2FsZSgyLjBmLCAyLjBmKTsKKyAgICAgICAgICAgIG1NYXRyaXgucHJlVHJhbnNsYXRlKDAuMGYsIC0xMC4wZik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uRHJhdyhjYW52YXMpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMuZHJhd0NvbG9yKDB4ZmZmZmZmZmYpOworCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgxMjAuMGYsIDUwLjBmKTsKKworICAgICAgICAgICAgY2FudmFzLmNvbmNhdChtTWF0cml4KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3Qml0bWFwKG1CaXRtYXAxLCAwLjBmLCAwLjBmLCBtQml0bWFwUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvdGVzdHMvSHdBY2NlbGVyYXRpb25UZXN0L3NyYy9jb20vYW5kcm9pZC90ZXN0L2h3dWkvQml0bWFwc0FjdGl2aXR5LmphdmEgYi90ZXN0cy9Id0FjY2VsZXJ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mV3IEJpdG1hcHNWaWV3KHRoaXMpOworICAgICAgICBmaW5hbCBGcmFtZUxheW91dCBsYXlvdXQgPSBuZXcgRnJhbWVMYXlvdXQodGhpcyk7CisgICAgICAgIGxheW91dC5hZGRWaWV3KHZpZXcsIG5ldyBGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMoNDgwLCA4MDAsIEdyYXZpdHkuQ0VOVEVSKSk7CisgICAgICAgIHNldENvbnRlbnRWaWV3KGxheW91dCk7CisgICAgICAgIAorICAgICAgICBTY2FsZUFuaW1hdGlvbiBhID0gbmV3IFNjYWxlQW5pbWF0aW9uKDEuMGYsIDIuMGYsIDEuMGYsIDIuMGYsCisgICAgICAgICAgICAgICAgU2NhbGVBbmltYXRpb24uUkVMQVRJVkVfVE9fU0VMRiwgMC41ZiwKKyAgICAgICAgICAgICAgICBTY2FsZUFuaW1hdGlvbi5SRUxBVElWRV9UT19TRUxGLDAuNWYpOworICAgICAgICBhLnNldER1cmF0aW9uKDIwMDApOworICAgICAgICBhLnNldFJlcGVhdENvdW50KEFuaW1hdGlvbi5JTkZJTklURSk7CisgICAgICAgIGEuc2V0UmVwZWF0TW9kZShBbmltYXRpb24uUkVWRVJTRSk7CisgICAgICAgIHZpZXcuc3RhcnRBbmltYXRpb24oYSk7CisgICAgfQorCisgICAgc3RhdGljIGNsYXNzIEJpdG1hcHNWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIHByaXZhdGUgUGFpbnQgbUJpdG1hcFBhaW50OworICAgICAgICBwcml2YXRlIGZpbmFsIEJpdG1hcCBtQml0bWFwMTsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBCaXRtYXAgbUJpdG1hcDI7CisgICAgICAgIHByaXZhdGUgZmluYWwgUG9ydGVyRHVmZlhmZXJtb2RlIG1Ec3RJbjsKKworICAgICAgICBCaXRtYXBzVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworCisgICAgICAgICAgICBtQml0bWFwMSA9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IgICAgaGFzIGJpdG1hcCBhbHBoYT8gIiArIG1CaXRtYXAzLmhhc0FscGhhKCkpOworCisgICAgICAgICAgICBtQml0bWFwUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXcoQ2FudmFzIGNhbnZhcykgeworICAgICAgICAgICAgc3VwZXIub25EcmF3KGNhbnZhcyk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIExvZy5kKCJPcGVuR0xSZW5kZXJlciIsICI9PT09PT09PT09PT09PT09PSBEcmF3Iik7CisKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMTIwLjBmLCA1MC4wZik7CisgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChtQml0bWFwMSwgMC4wZiwgMC4wZiwgbUJpdG1hcFBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCBtQml0bWFwMS5nZXRIZWlnaHQoKSk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDI1LjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3Qml0bWFwKG1CaXRtYXAyLCAwLjBmLCAwLjBmLCBudWxsKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCBtQml0bWFwMi5nZXRIZWlnaHQoKSk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDI1LjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3Qml0bWFwKG1CaXRtYXAzLCAwLjBmLCAwLjBmLCBudWxsKTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL3Rlc3RzL0h3QWNjZWxlcmF0aW9uVGVzdC9zcmMvY29tL2FuZHJvaWQvdGVzdC9od3VpL0JpdG1hcHNSZWN0QWN0aXZpdHk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AgICAgICAgcHJpdmF0ZSBmaW5hbCBCaXRtYXAgbUJpdG1hcDE7CisgICAgICAgIHByaXZhdGUgZmluYWwgQml0bWFwIG1CaXRtYXAyOworICAgICAgICBwcml2YXRlIGZpbmFsIFJlY3QgbVNyY1JlY3Q7CisgICAgICAgIHByaXZhdGUgZmluYWwgUmVjdEYgbURzdFJlY3Q7CisgICAgICAgIHByaXZhdGUgZmluYWwgUmVjdEYgbURzdFJlY3QyOworCisgICAgICAgIEJpdG1hcHNWaWV3KENvbnRleHQgYykgeworICAgICAgICAgICAgc3VwZXIoYyk7CisKKyAgICAgICAgICAgIG1CaXRtYXAxID0gQml0bWFwRmFjdG9yeS5kZWNvZGVSZXNvdXJjZShjLmdldFJlc291cmNlcygpLCBSLmRyYXdhYmxlLnN1bnNldDEpOworICAgICAgICAgICAgbUJpdG1hcDIgPSBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKGMuZ2V0UmVzb3VyY2VzKCksIFIuZHJhd2FibGUuc3Vuc2V0Mik7CisKKyAgICAgICAgICAgIG1CaXRtYXBQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgbUJpdG1hcFBhaW50LnNldEZpbHRlckJpdG1hcCh0cnVlKTsKKworICAgICAgICAgICAgZmluYWwgZmxvYXQgZm91cnRoID0gbUJpdG1hcDEuZ2V0V2lkdGgoKSAvIDQuMGY7CisgICAgICAgICAgICBmaW5hbCBmbG9hdCBoYWxmID0gbUJpdG1hcDEuZ2V0SGVpZ2h0KCkgLyAyLjBmOworICAgICAgICAgICAgbVNyY1JlY3QgPSBuZXcgUmVjdCgoaW50KSBmb3VydGgsIChpbnQpIChoYWxmIC0gaGFsZiAvIDIuMGYpLAorICAgICAgICAgICAgICAgICAgICAoaW50KSAoZm91cnRoICsgZm91cnRoKSwgKGludCkgKGhhbGYgKyBoYWxmIC8gMi4wZikpOworICAgICAgICAgICAgbURzdFJlY3QgPSBuZXcgUmVjdEYoZm91cnRoLCBoYWxmIC0gaG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h2aWV3KTsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgQml0bWFwc1ZpZXcgZXh0ZW5kcyBWaWV3IHsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBCaXRtYXAgbUJpdG1hcDE7CisgICAgICAgIHByaXZhdGUgZmluYWwgQml0bWFwIG1CaXRtYXAyOworICAgICAgICBwcml2YXRlIGZpbmFsIFBhaW50IG1Db2xvck1hdHJpeFBhaW50OworICAgICAgICBwcml2YXRlIGZpbmFsIFBhaW50IG1MaWdodGluZ1BhaW50OworICAgICAgICBwcml2YXRlIGZpbmFsIFBhaW50IG1CbGVuZFBhaW50OworCisgICAgICAgIEJpdG1hcHNWaWV3KENvbnRleHQgYykgeworICAgICAgICAgICAgc3VwZXIoYyk7CisKKyAgICAgICAgICAgIG1CaXRtYXAxID0gQml0bWFwRmFjdG9yeS5kZWNvZGVSZXNvdXJjZShjLmdldFJlc291cmNlcygpLCBSLmRyYXdhYmxlLnN1bnNldDEpOworICAgICAgICAgICAgbUJpdG1hcDIgPSBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKGMuZ2V0UmVzb3VyY2VzKCksIFIuZHJhd2FibGUuc3Vuc2V0Mik7CisKKyAgICAgICAgICAgIG1Db2xvck1hdHJpeFBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBmaW5hbCBDb2xvck1hdHJpeCBjb2xvck1hdHJpeCA9IG5ldyBDb2xvck1hdHJpeCgpOworICAgICAgICAgICAgY29sb3JNYXRyaXguc2V0U2F0dXJhdGlvbigwKTsKKyAgICAgICAgICAgIG1Db2xvck1hdHJpeFBhaW50LnNldENvbG9yRmlsdGVyKG5ldyBDb2xvck1hdHJpeENvbG9yRmlsdGVyKGNvbG9yTWF0cml4KSk7CisKKyAgICAgICAgICAgIG1MaWdodGluZ1BhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtTGlnaHRpbmdQYWludC5zZXRDb2xvckZpbHRlcihuZXcgTGlnaHRpbmdDb2xvckZpbHRlcigweDAwNjBmZmZmLCAweDAwMTAxMDMwKSk7CisKKyAgICAgICAgICAgIG1CbGVuZFBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtQmxlbmRQYWludC5zZXRDb2xvckZpbHRlcihuZXcgUG9ydGVyRHVmZkNvbG9yRmlsdGVyKDB4N2Y5OTAwNDAsCisgICAgICAgICAgICAgICAgICAgIFBvcnRlckR1ZmYuTW9kZS5TUkNfT1ZFUikpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKworICAgICAgICAgICAgY2FudmFzLmRyYXdBUkdCKDI1NSwgMjU1LCAyNTUsIDI1NSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDEyMC4wZiwgNTAuMGYpOworICAgICAgICAgICAgY2FudmFzLmRyYXdCaXRtYXAobUJpdG1hcDEsIDAuMGYsIDAuMGYsIG1Db2xvck1hdHJpeFBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCA1MC4wZiArIG1CaXRtYXAxLmdldEhlaWdodCgpKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3Qml0bWFwKG1CaXRtYXAxLCAwLjBmLCAwLjBmLCBtTGlnaHRpbmdQYWludCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgNTAuMGYgKyBtQml0bWFwMS5nZXRIZWlnaHQoKSk7CisgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChtQml0bWFwMSwgMC4wZiwgMC4wZiwgbUJsZW5kUGFpbnQpOworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmU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CisgICAgICAgIHByaXZhdGUgQml0bWFwIG1UZXh0dXJlOworCisgICAgICAgIEJsZW5kVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworCisgICAgICAgICAgICBtVGV4dHVyZSA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlUmVzb3VyY2UoYy5nZXRSZXNvdXJjZXMoKSwgUi5kcmF3YWJsZS5zdW5zZXQxKTsKKyAgICAgICAgICAgIG1UZXhXaWR0aCA9IG1UZXh0dXJlLmdldFdpZHRoKCk7CisgICAgICAgICAgICBtVGV4SGVpZ2h0ID0gbVRleHR1cmUuZ2V0SGVpZ2h0KCk7CisKKyAgICAgICAgICAgIG1Ib3JHcmFkaWVudCA9IG5ldyBMaW5lYXJHcmFkaWVudCgwLjBmLCAwLjBmLCBtVGV4V2lkdGgsIDAuMGYsCisgICAgICAgICAgICAgICAgICAgIENvbG9yLkJMQUNLLCBDb2xvci5XSElURSwgU2hhZGVyLlRpbGVNb2RlLkNMQU1QKTsKKworICAgICAgICAgICAgbVBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uRHJhdyhjYW52YXMpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSR0IoMjU1LCAyNTUsIDI1NSk7CisKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDQwLjBmLCA0MC4wZik7CisKKyAgICAgICAgICAgIGRyYXdCbGVuZGVkQml0bWFwKGNhbnZhcywgUG9ydGVyRHVmZi5Nb2RlLkRBUktFTik7CisgICAgICAgICAgICBkcmF3QmxlbmRlZEJpdG1hcChjYW52YXMsIFBvcnRlckR1ZmYuTW9kZS5MSUdIVEVOKTsKKyAgICAgICAgICAgIGRyYXdCbGVuZGVkQml0bWFwKGNhbnZhcywgUG9ydGVyRHVmZi5Nb2RlLk1VTFRJUExZKTsKKworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmUoKTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoNDAuMGYgKyBtVGV4V2lkdGggKyA0MC4wZiwgNDAuMGYpOworCisgICAgICAgICAgICBkcmF3QmxlbmRlZEJpdG1hcChjYW52YXMsIFBvcnRlckR1ZmYuTW9kZS5TQ1JFRU4pOworICAgICAgICAgICAgZHJhd0JsZW5kZWRCaXRtYXAoY2FudmFzLCBQb3J0ZXJEdWZmLk1vZGUuQUREKTsKKyAgICAgICAgICAgIGRyYXdCbGVuZGVkQml0bWFwSW52ZXJzZShjYW52YXMsIFBvcnRlckR1ZmYuTW9kZS5PVkVSTEFZKTsKKworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmUoKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBkcmF3QmxlbmRlZEJpdG1hcChDYW52YXMgY2FudmFzLCBQb3J0ZXJEdWZmLk1vZGUgbW9kZSkgeworICAgICAgICAgICAgbVBhaW50LnNldFNoYWRlcihudWxsKTsKKyAgICAgICAgICAgIG1QYWludC5zZXRYZmVybW9kZShudWxsKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3Qml0bWFwKG1UZXh0dXJlLCAwLjBmLCAwLjBmLCBtUGFpbnQpOworCisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1Ib3JHcmFkaWVudCk7CisgICAgICAgICAgICBtUGFpbnQuc2V0WGZlcm1vZGUobmV3IFBvcnRlckR1ZmZYZmVybW9kZShtb2RlKSk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgbVRleFdpZHRoLCBtVGV4SGVpZ2h0LCBtUGFpbnQpOworCisgICAgICAgICAgICBjYW52YXMudHJhbn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vmlldy5zZXRSb3RhdGlvblkoKGZsb2F0KSBwcm9ncmVzcyk7CisgICAgICAgICAgICAgICAgcmFkaWFsR3JhZGllbnRWaWV3LnNldFJvdGF0aW9uWCgoZmxvYXQpIHByb2dyZXNzKTsKKyAgICAgICAgICAgICAgICBzd2VlcEdyYWRpZW50Vmlldy5zZXRSb3RhdGlvblkoKGZsb2F0KSBwcm9ncmVzcyk7CisgICAgICAgICAgICAgICAgYml0bWFwVmlldy5zZXRSb3RhdGlvblgoKGZsb2F0KSBwcm9ncmVzcyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0pOworICAgICAgICAKKyAgICAgICAgbGF5b3V0LmFkZFZpZXcoc2hhZGVyc1ZpZXcpOworICAgICAgICBsYXlvdXQuYWRkVmlldyhncmFkaWVudFZpZXcsIG5ldyBGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMoCisgICAgICAgICAgICAgICAgMjAwLCAyMDAsIEdyYXZpdHkuQ0VOVEVSKSk7CisKKyAgICAgICAgRnJhbWVMYXlvdXQuTGF5b3V0UGFyYW1zIGxwID0gbmV3IEZyYW1lTGF5b3V0LkxheW91dFBhcmFtcygyMDAsIDIwMCwgR3Jhdml0eS5DRU5URVIpOworICAgICAgICBscC5zZXRNYXJnaW5zKDIyMCwgMCwgMCwgMCk7CisgICAgICAgIGxheW91dC5hZGRWaWV3KHJhZGlhbEdyYWRpZW50VmlldywgbHApOworCisgICAgICAgIGxwID0gbmV3IEZyYW1lTGF5b3V0LkxheW91dFBhcmFtcygyMDAsIDIwMCwgR3Jhdml0eS5DRU5URVIpOworICAgICAgICBscC5zZXRNYXJnaW5zKDQ0MCwgMCwgMCwgMCk7CisgICAgICAgIGxheW91dC5hZGRWaWV3KHN3ZWVwR3JhZGllbnRWaWV3LCBscCk7CisKKyAgICAgICAgbHAgPSBuZXcgRnJhbWVMYXlvdXQuTGF5b3V0UGFyYW1zKDIwMCwgMjAwLCBHcmF2aXR5LkNFTlRFUik7CisgICAgICAgIGxwLnNldE1hcmdpbnMoMjIwLCAtMjIwLCAwLCAwKTsKKyAgICAgICAgbGF5b3V0LmFkZFZpZXcoYml0bWFwVmlldywgbHApOworCisgICAgICAgIGxheW91dC5hZGRWaWV3KHJvdGF0ZVZpZXcsIG5ldyBGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMoCisgICAgICAgICAgICAgICAgMzAwLCBGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5ULAorICAgICAgICAgICAgICAgIEdyYXZpdHkuQ0VOVEVSX0hPUklaT05UQUwgfCBHcmF2aXR5LkJPVFRPTSkpOworCisgICAgICAgIHNldENvbnRlbnRWaWV3KGxheW91dCk7CisgICAgfQorICAgIAorICAgIHN0YXRpYyBjbGFzcyBCaXRtYXBWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIHByaXZhdGUgZmluYWwgUGFpbnQgbVBhaW50OworCisgICAgICAgIEJpdG1hcFZpZXcoQ29udGV4dCBjKSB7CisgICAgICAgICAgICBzdXBlcihjKTsKKworICAgICAgICAgICAgQml0bWFwIHRleHR1cmUgPSBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKGMuZ2V0UmVzb3VyY2VzKCksIFIuZHJhd2FibGUuc3Vuc2V0MSk7CisgICAgICAgICAgICBCaXRtYXBTaGFkZXIgc2hhZGVyID0gbmV3IEJpdG1hcFNoYWRlcih0ZXh0dXJlLCBTaGFkZXIuVGlsZU1vZGUuUkVQRUFULAorICAgICAgICAgICAgICAgICAgICBTaGFkZXIuVGlsZU1vZGUuUkVQRUFUKTsKKyAgICAgICAgICAgIG1QYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgbVBhaW50LnNldFNoYWRlcihzaGFkZXIpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uTWVhc3VyZShpbnQgd2lkdGhNZWFzdXJlU3BlYywgaW50IGhlaWdodE1lYXN1cmVTcGVjKSB7CisgICAgICAgICAgICBzdXBlci5vbk1lYXN1cmUod2lkdGhNZWFzdXJlU3BlYywgaGVpZ2h0TWVhc3VyZVNwZWMpOworICAgICAgICAgICAgc2V0TWVhc3VyZWREaW1lbnNpb24oMjAwLCAyMDApOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCBnZXRXaWR0aCgpLCBnZXRIZWlnaHQoKSwgbVBhaW50KTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBzdGF0aWMgY2xhc3MgR3JhZGllbnRWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIHByaXZhdGUgZmluYWwgUGFpbnQgbVBhaW50OworCisgICAgICAgIEdyYWRpZW50VmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworCisgICAgICAgICAgICBMaW5lYXJHcmFkaWVudCBncmFkaWVudCA9IG5ldyBMaW5lYXJHcmFkaWVudCgwLCAwLCAyMDAsIDAsIDB4RkYwMDAwMDAsIDAsCisgICAgICAgICAgICAgICAgICAgIFNoYWRlci5UaWxlTW9kZS5DTEFNUCk7CisgICAgICAgICAgICBtUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1QYWludC5zZXRTaGFkZXIoZ3JhZGllbnQpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uTWVhc3VyZShpbnQgd2lkdGhNZWFzdXJlU3BlYywgaW50IGhlaWdodE1lYXN1cmVTcGVjKSB7CisgICAgICAgICAgICBzdXBlci5vbk1lYXN1cmUod2lkdGhNZWFzdXJlU3BlYywgaGVpZ2h0TWVhc3VyZVNwZWMpOworICAgICAgICAgICAgc2V0TWVhc3VyZWREaW1lbnNpb24oMjAwLCAyMDApOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCBnZXRXaWR0aCgpLCBnZXRIZWlnaHQoKSwgbVBhaW50KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHN0YXRpYyBjbGFzcyBSYWRpYWxHcmFkaWVudFZpZXcgZXh0ZW5kcyBWaWV3IHsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBQYWludCBtUGFpbnQ7CisKKyAgICAgICAgUmFkaWFsR3JhZGllbnRWaWV3KENvbnRleHQgYykgeworICAgICAgICAgICAgc3VwZXIoYyk7CisKKyAgICAgICAgICAgIFJhZGlhbEdyYWRpZW50IGdyYWRpZW50ID0gbmV3IFJhZGlhbEdyYWRpZW50KDAuMGYsIDAuMGYsIDEwMC4wZiwgMHhmZjAwMDAwMCwgMHhmZmZmZmZmZiwKKyAgICAgICAgICAgICAgICAgICAgU2hhZGVyLlRpbGVNb2RlLk1JUlJPUik7CisgICAgICAgICAgICBtUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1QYWludC5zZXRTaGFkZXIoZ3JhZGllbnQpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uTWVhc3VyZShpbnQgd2lkdGhNZWFzdXJlU3BlYywgaW50IGhlaWdodE1lYXN1cmVTcGVjKSB7CisgICAgICAgICAgICBzdXBlci5vbk1lYXN1cmUod2lkdGhNZWFzdXJlU3BlYywgaGVpZ2h0TWVhc3VyZVNwZWMpOworICAgICAgICAgICAgc2V0TWVhc3VyZWREaW1lbnNpb24oMjAwLCAyMDApOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCBnZXRXaWR0aCgpLCBnZXRIZWlnaHQoKSwgbVBhaW50KTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBzdGF0aWMgY2xhc3MgU3dlZXBHcmFkaWVudFZpZXcgZXh0ZW5kcyBWaWV3IHsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBQYWludCBtUGFpbnQ7CisKKyAgICAgICAgU3dlZXBHcmFkaWVudFZpZXcoQ29udGV4dCBjKSB7CisgICAgICAgICAgICBzdXBlcihjKTsKKworICAgICAgICAgICAgU3dlZXBHcmFkaWVudCBncmFkaWVudCA9IG5ldyBTd2VlcEdyYWRpZW50KDEwMC4wZiwgMTAwLjBmLCAweGZmMDAwMDAwLCAweGZmZmZmZmZmKTsgICAgICAgICAgICAgICAgCisgICAgICAgICAgICBtUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1QYWludC5zZXRTaGFkZXIoZ3JhZGllbnQpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uTWVhc3VyZShpbnQgd2lkdGhNZWFzdXJlU3BlYywgaW50IGhlaWdodE1lYXN1cmVTcGVjKSB7CisgICAgICAgICAgICBzdXBlci5vbk1lYXN1cmUod2lkdGhNZWFzdXJlU3BlYywgaGVpZ2h0TWVhc3VyZVNwZWMpOworICAgICAgICAgICAgc2V0TWVhc3VyZWREaW1lbnNpb24oMjAwLCAyMDApOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCBnZXRXaWR0aCgpLCBnZXRIZWlnaHQoKSwgbVBhaW50KTsKKyAgICAgICAgfQorICAgIH0KKyAgICAgICAgCisgICAgc3RhdGljIGNsYXNzIFNoYWRlcnNWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIHByaXZhdGUgZmluYWwgUGFpbnQgbVBhaW50OworICAgICAgICBwcml2YXRlIGZpbmFsIGZsb2F0IG1EcmF3V2lkdGg7CisgICAgICAgIHByaXZhdGUgZmluYWwgZmxvYXQgbURyYXdIZWlnaHQ7CisgICAgICAgIHByaXZhdGUgZmluYWwgTGluZWFyR3JhZGllbnQgbUdyYWRpZW50OworICAgICAgICBwcml2YXRlIGZpbmFsIE1hdHJpeCBtTWF0cml4OworCisgICAgICAgIFNoYWRlcnNWaWV3KENvbnRleHQgYykgeworICAgICAgICAgICAgc3VwZXIoYyk7CisKKyAgICAgICAgICAgIG1EcmF3V2lkdGggPSAyMDA7CisgICAgICAgICAgICBtRHJhd0hlaWdodCA9IDIwMDsKKworICAgICAgICAgICAgbUdyYWRpZW50ID0gbmV3IExpbmVhckdyYWRpZW50KDAsIDAsIDAsIDEsIDB4RkYwMDAwMDAsIDAsIFNoYWRlci5UaWxlTW9kZS5DTEFNUCk7CisgICAgICAgICAgICBtTWF0cml4ID0gbmV3IE1hdHJpeCgpOworCisgICAgICAgICAgICBtUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXcoQ2FudmFzIGNhbnZhcykgeworICAgICAgICAgICAgc3VwZXIub25EcmF3KGNhbnZhcyk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JHQigyNTUsIDI1NSwgMjU1KTsKKworICAgICAgICAgICAgLy8gR3JhZGllbnRzCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgZmxvYXQgdG9wID0gNDAuMGY7CisgICAgICAgICAgICBmbG9hdCByaWdodCA9IDQwLjBmICsgbURyYXdXaWR0aDsKKyAgICAgICAgICAgIGZsb2F0IGxlZnQgPSA0MC4wZjsKKyAgICAgICAgICAgIGZsb2F0IGJvdHRvbSA9IDQwLjBmICsgbURyYXdIZWlnaHQ7CisKKyAgICAgICAgICAgIG1QYWludC5zZXRTaGFkZXIobUdyYWRpZW50KTsKKworICAgICAgICAgICAgbU1hdHJpeC5zZXRTY2FsZSgxLCBtRHJhd1dpZHRoKTsKKyAgICAgICAgICAgIG1NYXRyaXgucG9zdFJvdGF0ZSg5MCk7CisgICAgICAgICAgICBtTWF0cml4LnBvc3RUcmFuc2xhdGUocmlnaHQsIHRvcCk7CisgICAgICAgICAgICBtR3JhZGllbnQuc2V0TG9jYWxNYXRyaXgobU1hdHJpeCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QocmlnaHQgLSBtRHJhd1dpZHRoLCB0b3AsIHJpZ2h0LCB0b3AgKyBtRHJhd0hlaWdodCwgbVBhaW50KTsKKworICAgICAgICAgICAgdG9wICs9IDQwLjBmICsgbURyYXdIZWlnaHQ7CisgICAgICAgICAgICBib3R0b20gKz0gNDAuMGYgKyBtRHJhd0hlaWdodDsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbU1hdHJpeC5zZXRTY2FsZSgxLCBtRHJhd0hlaWdodCk7CisgICAgICAgICAgICBtTWF0cml4LnBvc3RUcmFuc2xhdGUobGVmdCwgdG9wKTsKKyAgICAgICAgICAgIG1HcmFkaWVudC5zZXRMb2NhbE1hdHJpeChtTWF0cml4KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdChsZWZ0LCB0b3AsIHJpZ2h0LCB0b3AgKyBtRHJhd0hlaWdodCwgbVBhaW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbGVmdCArPSA0MC4wZiArIG1EcmF3V2lkdGg7CisgICAgICAgICAgICByaWdodCArPSA0MC4wZiArIG1EcmF3V2lkdGg7CisgICAgICAgICAgICB0b3AgLT0gNDAuMGYgKyBtRHJhd0hlaWdodDsKKyAgICAgICAgICAgIGJvdHRvbSAtPSA0MC4wZiArIG1EcmF3SGVpZ2h0OworCisgICAgICAgICAgICBtTWF0cml4LnNldFNjYWxlKDEsIG1EcmF3SGVpZ2h0KTsKKyAgICAgICAgICAgIG1NYXRyaXgucG9zdFJvdGF0ZSgxODApOworICAgICAgICAgICAgbU1hdHJpeC5wb3N0VHJhbnNsYXRlKGxlZnQsIGJvdHRvbSk7CisgICAgICAgICAgICBtR3JhZGllbnQuc2V0TG9jYWxNYXRyaXgobU1hdHJpeCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QobGVmdCwgYm90dG9tIC0gbURyYXdIZWlnaHQsIHJpZ2h0LCBib3R0b20sIG1QYWludCk7CisKKyAgICAgICAgICAgIHRvcCArPSA0MC4wZiArIG1EcmF3SGVpZ2h0OworICAgICAgICAgICAgYm90dG9tICs9IDQwLjBmICsgbURyYXdIZWlnaHQ7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1NYXRyaXguc2V0U2NhbGUoMSwgbURyYXdXaWR0aCk7CisgICAgICAgICAgICBtTWF0cml4LnBvc3RSb3RhdGUoLTkwKTsKKyAgICAgICAgICAgIG1NYXRyaXgucG9zdFRyYW5zbGF0ZShsZWZ0LCB0b3ApOworICAgICAgICAgICAgbUdyYWRpZW50LnNldExvY2FsTWF0cml4KG1NYXRyaXgpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KGxlZnQsIHRvcCwgbGVmdCArIG1EcmF3V2lkdGgsIGJvdHRvbSwgbVBhaW50KTsKKyAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICB9CisgICAgfQorfQpkaW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AvL2NhbnZhcy5kcmF3UkdCKDI1NSwgMjU1LCAyNTUpOworICAgICAgICAgICAgCisgICAgICAgICAgICBpbnQgY291bnQgPSBjYW52YXMuc2F2ZUxheWVyKDAuMGYsIDAuMGYsIDIwMC4wZiwgMTAwLjBmLCBtTGF5ZXJQYWludCwKKyAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkFMTF9TQVZFX0ZMQUcpOworCisgICAgICAgICAgICBtUmVjdFBhaW50LnNldENvbG9yKDB4ZmZmZjAwMDApOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDAuMGYsIDAuMGYsIDIwMC4wZiwgMTAwLjBmLCBtUmVjdFBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmVUb0NvdW50KGNvdW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMjUuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjb3VudCA9IGNhbnZhcy5zYXZlTGF5ZXIoMC4wZiwgMC4wZiwgMjAwLjBmLCAxMDAuMGYsIG1MYXllclBhaW50LAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuQUxMX1NBVkVfRkxBRyk7CisKKyAgICAgICAgICAgIG1SZWN0UGFpbnQuc2V0Q29sb3IoMHhmZjAwZmYwMCk7CisgICAgICAgICAgICBtUmVjdFBhaW50LnNldEFscGhhKDUwKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCAyMDAuMGYsIDEwMC4wZiwgbVJlY3RQYWludCk7CisKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlVG9Db3VudChjb3VudCk7CisKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMjUuMGYsIDEyNS4wZik7CisKKyAgICAgICAgICAgIG1SZWN0UGFpbnQuc2V0Q29sb3IoMHhmZjAwMDBmZik7CisgICAgICAgICAgICBtUmVjdFBhaW50LnNldEFscGhhKDI1NSk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgMTAwLjBmLCA1MC4wZiwgbVJlY3RQYWludCk7ICAgICAgICAgICAgCisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1MYXllclBhaW50LnNldEFscGhhKDEyNyk7CisgICAgICAgICAgICBtTGF5ZXJQYWludC5zZXRYZmVybW9kZShuZXcgUG9ydGVyRHVmZlhmZXJtb2RlKFBvcnRlckR1ZmYuTW9kZS5TUkNfT1VUKSk7CisgICAgICAgICAgICBjb3VudCA9IGNhbnZhcy5zYXZlTGF5ZXIoNTAuMGYsIDI1LjBmLCAxNTAuMGYsIDc1LjBmLCBtTGF5ZXJQYWludCwKKyAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkFMTF9TQVZFX0ZMQUcpOworCisgICAgICAgICAgICBtUmVjdFBhaW50LnNldENvbG9yKDB4ZmZmZjAwMDApOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDUwLjBmLCAyNS4wZiwgMTUwLjBmLCA3NS4wZiwgbVJlY3RQYWludCk7CisKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlVG9Db3VudChjb3VudCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgMTI1LjBmKTsKKworICAgICAgICAgICAgbVJlY3RQYWludC5zZXRDb2xvcigweGZmMDAwMGZmKTsKKyAgICAgICAgICAgIG1SZWN0UGFpbnQuc2V0QWxwaGEoMjU1KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCAxMDAuMGYsIDUwLjBmLCBtUmVjdFBhaW50KTsgICAgICAgICAgICAKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUxheWVyUGFpbnQuc2V0Q29sb3IoMHhmZmZmMDAwMCk7CisgICAgICAgICAgICBtTGF5ZXJQYWludC5zZXRBbHBoYSgxMjcpOworICAgICAgIC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2V0UmVzb3VyY2VzKCksIFIuZHJhd2FibGUuc3Vuc2V0MSk7CisKKyAgICAgICAgICAgIG1TbWFsbFBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtU21hbGxQYWludC5zZXRBbnRpQWxpYXModHJ1ZSk7CisgICAgICAgICAgICBtU21hbGxQYWludC5zZXRDb2xvcigweGZmZmYwMDAwKTsKKyAgICAgICAgICAgIG1TbWFsbFBhaW50LnNldFN0cm9rZVdpZHRoKDEuMGYpOworCisgICAgICAgICAgICBtTWVkaXVtUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1NZWRpdW1QYWludC5zZXRBbnRpQWxpYXModHJ1ZSk7CisgICAgICAgICAgICBtTWVkaXVtUGFpbnQuc2V0Q29sb3IoMHhmZjAwMDBmZik7CisgICAgICAgICAgICBtTWVkaXVtUGFpbnQuc2V0U3Ryb2tlV2lkdGgoNC4wZik7CisKKyAgICAgICAgICAgIG1MYXJnZVBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtTGFyZ2VQYWludC5zZXRBbnRpQWxpYXModHJ1ZSk7CisgICAgICAgICAgICBtTGFyZ2VQYWludC5zZXRDb2xvcigweGZmMDBmZjAwKTsKKyAgICAgICAgICAgIG1MYXJnZVBhaW50LnNldFN0cm9rZVdpZHRoKDE1LjBmKTsKKworICAgICAgICAgICAgbUFscGhhUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1BbHBoYVBhaW50LnNldEFudGlBbGlhcyh0cnVlKTsKKyAgICAgICAgICAgIG1BbHBoYVBhaW50LnNldENvbG9yKDB4N2ZmZjAwNTApOworICAgICAgICAgICAgbUFscGhhUGFpbnQuc2V0U3Ryb2tlV2lkdGgoMTAuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtU2hhZGVyID0gbmV3IEJpdG1hcFNoYWRlcihtQml0bWFwMSwgQml0bWFwU2hhZGVyLlRpbGVNb2RlLk1JUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgQml0bWFwU2hhZGVyLlRpbGVNb2RlLk1JUlJPUik7CisKKyAgICAgICAgICAgIG1Qb2ludHMgPSBuZXcgZmxvYXRbXSB7CisgICAgICAgICAgICAgICAgICAgIDYyLjBmLCAwLjBmLCAzMDIuMGYsIDQwMC4wZiwKKyAgICAgICAgICAgICAgICAgICAgMzAyLjBmLCA0MDAuMGYsIDM1Mi4wZiwgNDAwLjBmLAorICAgICAgICAgICAgICAgICAgICAzNTIuMGYsIDQwMC4wZiwgMzUyLjBmLCA1MDAuMGYKKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uRHJhdyhjYW52YXMpOworCisgICAgICAgICAgICBjYW52YXMuZHJhd0FSR0IoMjU1LCAyNTUsIDI1NSwgMjU1KTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMTAwLjBmLCAyMC4wZik7CisKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3TGluZSgwLjBmLCAwLjBmLCA0MC4wZiwgNDAwLjBmLCBtU21hbGxQYWludCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd0xpbmUoNS4wZiwgMC4wZiwgOTUuMGYsIDQwMC4wZiwgbU1lZGl1bVBhaW50KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3TGluZSgyMi4wZiwgMC4wZiwgMTYyLjBmLCA0MDAuMGYsIG1MYXJnZVBhaW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0U2hhZGVyKG1TaGFkZXIpOworICAgICAgICAgICAgY2FudmFzLmRyYXdMaW5lKDQyLjBmLCAwLjBmLCAyMjIuMGYsIDQwMC4wZiwgbUxhcmdlUGFpbnQpOworICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0U2hhZGVyKG51bGwpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMuZHJhd0xpbmVzKG1Qb2ludHMsIG1BbHBoYVBhaW50KTsKKworICAgICAgICAgICAgbVNtYWxsUGFpbnQuc2V0QW50aUFsaWFzKGZhbHNlKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3TGluZSgwLjBmLCAwLjBmLCA0MDAuMGYsIDAuMGYsIG1TbWFsbFBhaW50KTsKKyAgICAgICAgICAgIG1TbWFsbFBhaW50LnNldEFudGlBbGlhcyh0cnVlKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3TGluZSgwLjBmLCAwLjBmLCAwLjBmLCA0MDAuMGYsIG1TbWFsbFBhaW50KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3TGluZSgwLjBmLCA0MDAuMGYsIDQwMC4wZiwgNDAwLjBmLCBtU21hbGxQYWludCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMTIwLjBmLCAwLjBmKTsKKyAgICAgICAgICAgIG1BbHBoYVBhaW50LnNldFNoYWRlcihtU2hhZGVyKTsgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3TGluZXMobVBvaW50cywgbUFscGhhUGFpbnQpOworICAgICAgICAgICAgbUFscGhhUGFpbnQuc2V0U2hhZGVyKG51bGwpOworCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvdGVzdHMvSHdBY2NlbGVyYXRpb25UZXN0L3NyYy9jb20vYW5kcm9pZC90ZXN0L2h3dWkvTGlzdEFjdGl2aXR5LmphdmEgYi90ZXN0cy9Id0FjY2VsZXJhdGlvblRlc3Qvc3JjL2NvbS9hbmRyb2lkL3Rlc3QvaHd1aS9MaXN0QWN0aXZpdHkuamF2YQpuZXcgZmlsZ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vZGUuTUlSUk9SKTsKKyAgICAgICAgICAgIE1hdHJpeCBtMyA9IG5ldyBNYXRyaXgoKTsKKyAgICAgICAgICAgIG0zLnNldFNjYWxlKDAuMWYsIDAuMWYpOworICAgICAgICAgICAgbVNjYWxlZDJTaGFkZXIuc2V0TG9jYWxNYXRyaXgobTMpOworCisgICAgICAgICAgICBtSG9yR3JhZGllbnQgPSBuZXcgTGluZWFyR3JhZGllbnQoMC4wZiwgMC4wZiwgbURyYXdXaWR0aCwgMC4wZiwKKyAgICAgICAgICAgICAgICAgICAgQ29sb3IuUkVELCAweDdmMDBmZjAwLCBTaGFkZXIuVGlsZU1vZGUuQ0xBTVApOworICAgICAgICAgICAgCisgICAgICAgICAgICBtVmVydEdyYWRpZW50ID0gbmV3IExpbmVhckdyYWRpZW50KDAuMGYsIDAuMGYsIDAuMGYsIG1EcmF3SGVpZ2h0IC8gMi4wZiwKKyAgICAgICAgICAgICAgICAgICAgQ29sb3IuWUVMTE9XLCBDb2xvci5NQUdFTlRBLCBTaGFkZXIuVGlsZU1vZGUuTUlSUk9SKTsKKworICAgICAgICAgICAgbUNvbXBvc2VTaGFkZXIgPSBuZXcgQ29tcG9zZVNoYWRlcihtU2NhbGVkU2hhZGVyLCBtSG9yR3JhZGllbnQsCisgICAgICAgICAgICAgICAgICAgIFBvcnRlckR1ZmYuTW9kZS5TUkNfT1ZFUik7CisgICAgICAgICAgICBtQ29tcG9zZTJTaGFkZXIgPSBuZXcgQ29tcG9zZVNoYWRlcihtSG9yR3JhZGllbnQsIG1TY2FsZWRTaGFkZXIsCisgICAgICAgICAgICAgICAgICAgIFBvcnRlckR1ZmYuTW9kZS5TUkNfT1VUKTsKKworICAgICAgICAgICAgbUNvbG9yRmlsdGVyID0gbmV3IExpZ2h0aW5nQ29sb3JGaWx0ZXIoMHgwMDYwZmZmZiwgMHgwMDEwMTAzMCk7CisgCisgICAgICAgICAgICBtTGFyZ2VQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0QW50aUFsaWFzKHRydWUpOworICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0VGV4dFNpemUoMzYuMGYpOworICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0Q29sb3IoMHhmZjAwMDAwMCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1QYWludCA9IG5ldyBQYWludCgpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UkdCKDI1NSwgMjU1LCAyNTUpOworCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSg0MC4wZiwgNDAuMGYpOworCisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1Db21wb3NlU2hhZGVyKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCBtRHJhd1dpZHRoLCBtRHJhd0hlaWdodCwgbVBhaW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCA0MC4wZiArIG1EcmF3SGVpZ2h0KTsKKyAgICAgICAgICAgIG1QYWludC5zZXRTaGFkZXIobUNvbXBvc2UyU2hhZGVyKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCBtRHJhd1dpZHRoLCBtRHJhd0hlaWdodCwgbVBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmUoKTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoNDAuMGYgKyBtRHJhd1dpZHRoICsgNDAuMGYsIDQwLjBmKTsKKworICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0U2hhZGVyKG1Ib3JHcmFkaWVudCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1RleHQoIk9wZW5HTCByZW5kZXJpbmciLCAwLjBmLCAyMC4wZiwgbUxhcmdlUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtTGFyZ2VQYWludC5zZXRTaGFkZXIobVNjYWxlZDJTaGFkZXIpOworICAgICAgICAgICAgY2FudmFzLmRyYXdUZXh0KCJPcGVuR0wgcmVuZGVyaW5nIiwgMC4wZiwgNjAuMGYsIG1MYXJnZVBhaW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0U2hhZGVyKG1Db21wb3NlMlNoYWRlcik7CisgICAgICAgICAgICBtTGFyZ2VQYWludC5zZXRDb2xvckZpbHRlcihtQ29sb3JGaWx0ZXIpOworICAgICAgICAgICAgY2FudmFzLmRyYXdUZXh0KCJPcGVuR0wgcmVuZGVyaW5nIiwgMC4wZiwgMTAwLjBmLCBtTGFyZ2VQYWludCk7CisgICAgICAgICAgICBtTGFyZ2VQYWludC5zZXRDb2xvckZpbHRlcihudWxsKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCA0MC4wZiArIG1EcmF3SGVpZ2h0KTsKKyAgICAgICAgICAgIG1MYXJnZVBhaW50LnNldFNoYWRlcihtVmVydEdyYWRpZW50KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3VGV4dCgiT3BlbkdMIHJlbmRlcmluZyIsIDAuMGYsIDIwLjBmLCBtTGFyZ2VQYWludCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlKCk7CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS90ZXN0cy9Id0FjY2VsZXJhdGlvblRlc3Qvc3JjL2NvbS9hbmRyb2lkL3Rlc3QvaHd1aS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gICAgICAgICAgICBtUmVjdFBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtUmVjdFBhaW50LnNldEFudGlBbGlhcyh0cnVlKTsKKyAgICAgICAgICAgIG1SZWN0UGFpbnQuc2V0VGV4dFNpemUoMjQuMGYpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UkdCKDEyOCwgMjU1LCAxMjgpOworCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDE0MC4wZiwgMTAwLjBmKTsKKyAgICAgICAgICAgIGRyYXdTdHVmZihjYW52YXMsIENhbnZhcy5BTExfU0FWRV9GTEFHKTsKKworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAyMDAuMGYpOworICAgICAgICAgICAgZHJhd1N0dWZmKGNhbnZhcywgQ2FudmFzLkhBU19BTFBIQV9MQVlFUl9TQVZFX0ZMQUcpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIGRyYXdTdHVmZihDYW52YXMgY2FudmFzLCBpbnQgc2F2ZUZsYWdzKSB7CisgICAgICAgICAgICBpbnQgY291bnQgPSBjYW52YXMuc2F2ZUxheWVyKDAuMGYsIDAuMGYsIDIwMC4wZiwgMTAwLjBmLCBtTGF5ZXJQYWludCwgc2F2ZUZsYWdzKTsKKworICAgICAgICAgICAgbVJlY3RQYWludC5zZXRDb2xvcigweDdmZmYwMDAwKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgtMjAuMGYsIC0yMC4wZiwgMjIwLjBmLCAxMjAuMGYsIG1S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ZmluYWwgQml0bWFwIG1CaXRtYXA7CisgICAgICAgIHByaXZhdGUgZmluYWwgZmxvYXQgbU9mZnNldDsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBQYWludCBtTGluZVBhaW50OworCisgICAgICAgIFBhdGhzVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworCisgICAgICAgICAgICBtQml0bWFwMSA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlUmVzb3VyY2UoYy5nZXRSZXNvdXJjZXMoKSwgUi5kcmF3YWJsZS5zdW5zZXQxKTsKKworICAgICAgICAgICAgbVNtYWxsUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1TbWFsbFBhaW50LnNldEFudGlBbGlhcyh0cnVlKTsKKyAgICAgICAgICAgIG1TbWFsbFBhaW50LnNldENvbG9yKDB4ZmZmZjAwMDApOworICAgICAgICAgICAgbVNtYWxsUGFpbnQuc2V0U3Ryb2tlV2lkdGgoMS4wZik7CisgICAgICAgICAgICBtU21hbGxQYWludC5zZXRTdHlsZShQYWludC5TdHlsZS5TVFJPS0UpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtTGluZVBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtTGluZVBhaW50LnNldEFudGlBbGlhcyh0cnVlKTsKKyAgICAgICAgICAgIG1MaW5lUGFpbnQuc2V0Q29sb3IoMHhmZmZmMDBmZik7CisgICAgICAgICAgICBtTGluZVBhaW50LnNldFN0cm9rZVdpZHRoKDEuMGYpOworICAgICAgICAgICAgbUxpbmVQYWludC5zZXRTdHlsZShQYWludC5TdHlsZS5TVFJPS0UpOworCisgICAgICAgICAgICBtTWVkaXVtUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1NZWRpdW1QYWludC5zZXRBbnRpQWxpYXModHJ1ZSk7CisgICAgICAgICAgICBtTWVkaXVtUGFpbnQuc2V0Q29sb3IoMHhmZjAwMDBmZ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5kcyhtUGF0aEJvdW5kcywgdHJ1ZSk7CisKKyAgICAgICAgICAgIG1Cb3VuZHNQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgbUJvdW5kc1BhaW50LnNldENvbG9yKDB4NDAwMGZmMDApOworCisgICAgICAgICAgICBtT2Zmc2V0ID0gbU1lZGl1bVBhaW50LmdldFN0cm9rZVdpZHRoKCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgd2lkdGggPSAoaW50KSAobVBhdGhCb3VuZHMud2lkdGgoKSArIG1PZmZzZXQgKiAzLjBmICsgMC41Zik7CisgICAgICAgICAgICBmaW5hbCBpbnQgaGVpZ2h0ID0gKGludCkgKG1QYXRoQm91bmRzLmhlaWdodCgpICsgbU9mZnNldCAqIDMuMGYgKyAwLjVmKTsKKyAgICAgICAgICAgIG1CaXRtYXAgPSBCaXRtYXAuY3JlYXRlQml0bWFwKHdpZHRoLCBoZWlnaHQsIEJpdG1hcC5Db25maWcuQUxQSEFfOCk7CisgICAgICAgICAgICBDYW52YXMgY2FudmFzID0gbmV3IENhbnZhcyhtQml0bWFwKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoLW1QYXRoQm91bmRzLmxlZnQgKyBtT2Zmc2V0ICogMS41ZiwgLW1QYXRoQm91bmRzLnRvcCArIG1PZmZzZXQgKiAxLjVmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UGF0aChtUGF0aCwgbU1lZGl1bVBhaW50KTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXcoQ2FudmFzIGNhbnZhcykgeworICAgICAgICAgICAgc3VwZXIub25EcmF3KGNhbnZhcyk7CisKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3QVJHQigyNTUsIDI1NSwgMjU1LCAyNTUpOworCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgyMDAuMGYsIDYwLjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UGF0aChtUGF0aCwgbVNtYWxsUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDM1MC4wZiwgMC4wZik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1BhdGgobVBhdGgsIG1NZWRpdW1QYWludCk7CisKKyAgICAgICAgICAgIG1MYXJnZVBhaW50LnNldFNoYWRlcihtU2hhZGVyKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMzUwLjBmLCAwLjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UGF0aChtUGF0aCwgbUxhcmdlUGFpbnQpOworICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0U2hhZGVyKG51bGwpOworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmUoKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMjAwLjBmLCAzNjAuMGYpOworICAgICAgICAgICAgY2FudmFzLmRyYXdQYXRoKG1QYXRoLCBtU21hbGxQYWludCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QobVBhdGhCb3VuZHMsIG1Cb3VuZHNQYWludCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMzUwLjBmLCAwLjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3Qml0bWFwKG1CaXRtYXAsIG1QYXRoQm91bmRzLmxlZnQgLSBtT2Zmc2V0ICogMS41ZiwKKyAgICAgICAgICAgICAgICAgICAgbVBhdGhCb3VuZHMudG9wIC0gbU9mZnNldCAqIDEuNWYsIG51bGwpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KG1QYXRoQm91bmRzLCBtQm91bmRzUGFpbnQpOworICAgICAgICAgICAgY2FudmFzLm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bmdzKHsiVW51c2VkRGVjbGFyYXRpb24ifSkKK3B1YmxpYyBjbGFzcyBRdWlja1JlamVjdEFjdGl2aXR5IGV4dGVuZHMgQWN0aXZpdHkgeworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKKyAgICAgICAgZmluYWwgUXVpY2tSZWplY3RWaWV3IHZpZXcgPSBuZXcgUXVpY2tSZWplY3RWaWV3KHRoaXMpOworICAgICAgICBzZXRDb250ZW50Vmlldyh2aWV3KTsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgUXVpY2tSZWplY3RWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIHByaXZhdGUgUGFpbnQgbUJpdG1hcFBhaW50OworICAgICAgICBwcml2YXRlIGZpbmFsIEJpdG1hcCBtQml0bWFwMTsKKworICAgICAgICBRdWlja1JlamVjdFZpZXcoQ29udGV4dCBjKSB7CisgICAgICAgICAgICBzdXBlcihjKTsKKworICAgICAgICAgICAgbUJpdG1hcDEgPSBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKGMuZ2V0UmVzb3VyY2VzKCksIFIuZHJhd2FibGUuc3Vuc2V0MSk7CisKKyAgICAgICAgICAgIG1CaXRtYXBQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgbUJpdG1hcFBhaW50LnNldEZpbHRlckJpdG1hcCh0cnVlKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXcoQ2FudmFzIGNhbnZhcykgeworICAgICAgICAgICAgc3VwZXIub25EcmF3KGNhbnZhcyk7CisKKyAgICAgICAgICAgIGludCBjb3VudCA9IGNhbnZhcy5nZXRTYXZlQ291bnQoKTsKKyAgICAgICAgICAgIExvZy5kKCJPcGVuR0xSZW5kZXJlciIsICJjb3VudD0iICsgY291bnQpOworICAgICAgICAgICAgY291bnQgPSBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgTG9nLmQoIk9wZW5HTFJlbmRlcmVyIiwgImNvdW50IGFmdGVyIHNhdmU9IiArIGNvdW50KTsKKyAgICAgICAgICAgIGNvdW50ID0gY2FudmFzLmdldFNhdmVDb3VudCgpOworICAgICAgICAgICAgTG9nLmQoIk9wZW5HTFJlbmRlcmVyIiwgImdldFNhdmVDb3VudCBhZnRlciBzYXZlPSIgKyBjb3VudCk7CisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICAgICAgY291bnQgPSBjYW52YXMuZ2V0U2F2ZUNvdW50KCk7CisgICAgICAgICAgICBMb2cuZCgiT3BlbkdMUmVuZGVyZXIiLCAiY291bnQgYWZ0ZXIgcmVzdG9yZT0iICsgY291bnQpOworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIExvZy5kKCJPcGVuR0xSZW5kZXJlciIsICJjb3VudCBhZnRlciBzYXZlPSIgKyBjYW52YXMuZ2V0U2F2ZUNvdW50KCkpOworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIExvZy5kKCJPcGVuR0xSZW5kZXJlciIsICJjb3VudCBhZnRlciBzYXZlPSIgKyBjYW52YXMuZ2V0U2F2ZUNvdW50KCkpOworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIExvZy5kKCJPcGVuR0xSZW5kZXJlciIsICJjb3VudCBhZnRlciBzYXZlPSIgKyBjYW52YXMuZ2V0U2F2ZUNvdW50KCkpOworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmVUb0NvdW50KGNvdW50KTsKKyAgICAgICAgICAgIGNvdW50ID0gY2FudmFzLmdldFNhdmVDb3VudCgpOworICAgICAgICAgICAgTG9nLmQoIk9wZW5HTFJlbmRlcmVyIiwgImNvdW50IGFmdGVyIHJlc3RvcmVUb0NvdW50PSIgKyBjb3VudCk7CisgICAgICAgICAgICBjb3VudCA9IGNhbnZhcy5zYXZlTGF5ZXIoMCwgMCwgMTAsIDEwLCBtQml0bWFwUGFpbnQsIENhbnZhcy5BTExfU0FWRV9GTEFHKTsKKyAgICAgICAgICAgIExvZy5kKCJPcGVuR0xSZW5kZXJlciIsICJjb3VudCBhZnRlciBzYXZlTGF5ZXI9IiArIGNvdW50KTsKKyAgICAgICAgICAgIGNvdW50ID0gY2FudmFzLmdldFNhdmVDb3VudCgpOworICAgICAgICAgICAgTG9nLmQoIk9wZW5HTFJlbmRlcmVyIiwgImdldFNhdmVDb3VudCBhZnRlciBzYXZlTGF5ZXI9IiArIGNvdW50KTsKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlKCk7CisgICAgICAgICAgICBjb3VudCA9IGNhbnZhcy5nZXRTYXZlQ291bnQoKTsKKyAgICAgICAgICAgIExvZy5kKCJPcGVuR0xSZW5kZXJlciIsICJjb3VudCBhZnRlciByZXN0b3JlPSIgKyBjb3VudCk7CisKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICBjYW52YXMuY2xpcFJlY3QoMC4wZiwgMC4wZiwgNDAuMGYsIDQwLjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3Qml0bWFwKG1CaXRtYXAxLCAwLjBmLCAwLjBmLCBtQml0bWFwUGFpbnQpOworICAgICAgICAgICAgY2FudmFzLmRyYXdCaXRtYXAobUJpdG1hcDEsIC1tQml0bWFwMS5nZXRXaWR0aCgpLCAwLjBmLCBtQml0bWFwUGFpbnQpOworICAgICAgICAgICAgY2FudmFzLmRyYXdCaXRtYXAobUJpdG1hcDEsIDUwLjBmLCAwLjBmLCBtQml0bWFwUGFpbnQpOworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmUoKTsKKyAgICAgICAgfQorICAgIH0KK30KXCBObyBuZXdsaW5lIGF0IG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pbnQ7CitpbXBvcnQgYW5kcm9pZC5vcy5CdW5kbGU7CitpbXBvcnQgYW5kcm9pZC52aWV3LlZpZXc7CisKK0BTdXBwcmVzc1dhcm5pbmdzKHsiVW51c2VkRGVjbGFyYXRpb24ifSkKK3B1YmxpYyBjbGFzcyBSb3RhdGlvbkFjdGl2aXR5IGV4dGVuZHMgQWN0aXZpdHkgeworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKKworICAgICAgICBEcmF3aW5nVmlldyBjb250YWluZXIgPSBuZXcgRHJhd2luZ1ZpZXcodGhpcyk7CisKKyAgICAgICAgc2V0Q29udGVudFZpZXcoY29udGFpbmVyKTsKKyAgICB9CisgICAgCisgICAgQFN1cHByZXNzV2FybmluZ3MoeyJVbnVzZWREZWNsYXJhdGlvbiJ9KQorICAgIHN0YXRpYyBpbnQgZGlwVG9QeChDb250ZXh0IGMsIGludCBkaXApIHsKKyAgICAgICAgcmV0dXJuIChpbnQpIChjLmdldFJlc291cmNlcygpLmdldERpc3BsYXlNZXRyaWNzKCkuZGVuc2l0eSAqIGRpcCArIDAuNWYpOworICAgIH0KKworICAgIHN0YXRpYyBjbGFzcyBEcmF3aW5nVmlldyBleHRlbmRzIFZpZXcgeworICAgICAgICBwcml2YXRlIGZpbmFsIFBhaW50IG1QYWludDsKKworICAgICAgICBEcmF3aW5nVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworICAgICAgICAgICAgbVBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtUGFpbnQuc2V0QW50aUFsaWFzKHRydWUpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY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xvYXQgbURyYXdIZWlnaHQ7CisgICAgICAgIHByaXZhdGUgTGluZWFyR3JhZGllbnQgbUhvckdyYWRpZW50OworICAgICAgICBwcml2YXRlIExpbmVhckdyYWRpZW50IG1EaWFnR3JhZGllbnQ7CisgICAgICAgIHByaXZhdGUgTGluZWFyR3JhZGllbnQgbVZlcnRHcmFkaWVudDsKKyAgICAgICAgcHJpdmF0ZSBCaXRtYXAgbVRleHR1cmU7CisKKyAgICAgICAgU2hhZGVyc1ZpZXcoQ29udGV4dCBjKSB7CisgICAgICAgICAgICBzdXBlcihjKTsKKworICAgICAgICAgICAgbVRleHR1cmUgPSBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKGMuZ2V0UmVzb3VyY2VzKCksIFIuZHJhd2FibGUuc3Vuc2V0MSk7CisgICAgICAgICAgICBtVGV4V2lkdGggPSBtVGV4dHVyZS5nZXRXaWR0aCgpOworICAgICAgICAgICAgbVRleEhlaWdodCA9IG1UZXh0dXJlLmdldEhlaWdodCgpOworICAgICAgICAgICAgbURyYXdXaWR0aCA9IG1UZXhXaWR0aCAqIDIuMmY7CisgICAgICAgICAgICBtRHJhd0hlaWdodCA9IG1UZXhIZWlnaHQgKiAxLjJmOworCisgICAgICAgICAgICBtUmVwZWF0U2hhZGVyID0gbmV3IEJpdG1hcFNoYWRlcihtVGV4dHVyZSwgU2hhZGVyLlRpbGVNb2RlLlJFUEVBVCwKKyAgICAgICAgICAgICAgICAgICAgU2hhZGVyLlRpbGVNb2RlLlJFUEVBVCk7CisKKyAgICAgICAgICAgIG1UcmFuc2xhdGVkU2hhZGVyID0gbmV3IEJpdG1hcFNoYWRlcihtVGV4dHVyZSwgU2hhZGVyLlRpbGVNb2RlLlJFUEVBVCwKKyAgICAgICAgICAgICAgICAgICAgU2hhZGVyLlRpbGVNb2RlLlJFUEVBVCk7CisgICAgICAgICAgICBNYXRyaXggbTEgPSBuZXcgTWF0cml4KCk7CisgICAgICAgICAgICBtMS5zZXRUcmFuc2xhdGUobVRleFdpZHRoIC8gMi4wZiwgbVRleEhlaWdodCAvIDIuMGYpOworICAgICAgICAgICAgbTEucG9zdFJvdGF0ZSg0NSwgMCwgMCk7CisgICAgICAgICAgICBtVHJhbnNsYXRlZFNoYWRlci5zZXRMb2NhbE1hdHJpeChtMSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1TY2FsZWRTaGFkZXIgPSBuZXcgQml0bWFwU2hhZGVyKG1UZXh0dXJlLCBTaGFkZXIuVGlsZU1vZGUuTUlSUk9SLAorICAgICAgICAgICAgICAgICAgICBTaGFkZXIuVGlsZU1vZGUuTUlSUk9SKTsKKyAgICAgICAgICAgIE1hdHJpeCBtMiA9IG5ldyBNYXRyaXgoKTsKKyAgICAgICAgICAgIG0yLnNldFNjYWxlKDAuNWYsIDAuNWYpOworICAgICAgICAgICAgbVNjYWxlZFNoYWRlci5zZXRMb2NhbE1hdHJpeChtMik7CisKKyAgICAgICAgICAgIG1Ib3JHcmFkaWVudCA9IG5ldyBMaW5lYXJHcmFkaWVudCgwLjBmLCAwLjBmLCAxLjBmLCAwLjBmLAorICAgICAgICAgICAgICAgICAgICBDb2xvci5SRUQsIENvbG9yLkdSRUVOLCBTaGFkZXIuVGlsZU1vZGUuQ0xBTVApOworICAgICAgICAgICAgTWF0cml4IG0zID0gbmV3IE1hdHJpeCgpOworICAgICAgICAgICAgbTMuc2V0U2NhbGUobURyYXdIZWlnaHQsIDEuMGYpOworICAgICAgICAgICAgbTMucG9zdFJvdGF0ZSgtOTAuMGYpOworICAgICAgICAgICAgbTMucG9zdFRyYW5zbGF0ZSgwLjBmLCBtRHJhd0hlaWdodCk7CisgICAgICAgICAgICBtSG9yR3JhZGllbnQuc2V0TG9jYWxNYXRyaXgobTMpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtRGlhZ0dyYWRpZW50ID0gbmV3IExpbmVhckdyYWRpZW50KDAuMGYsIDAuMGYsIG1EcmF3V2lkdGggLyAxLjVmLCBtRHJhd0hlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgQ29sb3IuQkxVRSwgQ29sb3IuTUFHRU5UQSwgU2hhZGVyLlRpbGVNb2RlLkNMQU1QKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbVZlcnRHcmFkaWVudCA9IG5ldyBMaW5lYXJHcmFkaWVudCgwLjBmLCAwLjBmLCAwLjBmLCBtRHJhd0hlaWdodCAvIDIuMGYsCisgICAgICAgICAgICAgICAgICAgIENvbG9yLllFTExPVywgQ29sb3IuTUFHRU5UQSwgU2hhZGVyLlRpbGVNb2RlLk1JUlJPUik7CisKKyAgICAgICAgICAgIG1QYWludCA9IG5ldyBQYWludCgpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIC8vY2FudmFzLmRyYXdSR0IoMjU1LCAyNTUsIDI1NSk7CisgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChtVGV4dHVyZSwgMC4wZiwgMC4wZiwgbnVsbCk7CisKKyAgICAgICAgICAgIC8vIEJpdG1hcCBzaGFkZXJzCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSg0MC4wZiwgNDAuMGYpOworCisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1SZXBlYXRTaGFkZXIpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDAuMGYsIDAuMGYsIG1EcmF3V2lkdGgsIG1EcmF3SGVpZ2h0LCBtUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDQwLjBmICsgbURyYXdIZWlnaHQpOworICAgICAgICAgICAgbVBhaW50LnNldFNoYWRlcihtVHJhbnNsYXRlZFNoYWRlcik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgbURyYXdXaWR0aCwgbURyYXdIZWlnaHQsIG1QYWludCk7CisKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgNDAuMGYgKyBtRHJhd0hlaWdodCk7CisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1TY2FsZWRTaGFkZXIpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDAuMGYsIDAuMGYsIG1EcmF3V2lkdGgsIG1EcmF3SGVpZ2h0LCBtUGFpbnQpOworCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworCisgICAgICAgICAgICAvLyBHcmFkaWVudHMKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDQwLjBmICsgbURyYXdXaWR0aCArIDQwLjBmLCA0MC4wZik7CisKKyAgICAgICAgICAgIG1QYWludC5zZXRTaGFkZXIobUhvckdyYWRpZW50KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCBtRHJhd1dpZHRoLCBtRHJhd0hlaWdodCwgbVBhaW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCA0MC4wZiArIG1EcmF3SGVpZ2h0KTsKKyAgICAgICAgICAgIG1QYWludC5zZXRTaGFkZXIobURpYWdHcmFkaWVudCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgbURyYXdXaWR0aCwgbURyYXdIZWlnaHQsIG1QYWludCk7CisKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgNDAuMGYgKyBtRHJhd0hlaWdodCk7CisgICAgICAgICAgICBtUGFpbnQuc2V0U2hhZGVyKG1WZXJ0R3JhZGllbnQpOworICAgICAgICAgICAgY2FudmFzLmRyYX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7CisKK0BTdXBwcmVzc1dhcm5pbmdzKHsiVW51c2VkRGVjbGFyYXRpb24ifSkKK3B1YmxpYyBjbGFzcyBTdGFja0FjdGl2aXR5IGV4dGVuZHMgQWN0aXZpdHkgeworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKKworICAgICAgICBzZXRDb250ZW50VmlldyhSLmxheW91dC5zdGFjayk7CisKKyAgICAgICAgU3RhY2tWaWV3IHN0YWNrID0gKFN0YWNrVmlldykgZmluZFZpZXdCeUlkKFIuaWQuc3RhY2tfdmlldyk7CisgICAgICAgIHN0YWNrLnNldEFkYXB0ZXIobmV3IEFycmF5QWRhcHRlcjxEcmF3YWJsZT4odGhpcywgYW5kcm9pZC5SLmxheW91dC5zaW1wbGVfbGlzdF9pdGVtXzEsCisgICAgICAgICAgICAgICAgYW5kcm9pZC5SLmlkLnRleHQxLCBuZXcgRHJhd2FibGVbXSB7CisgICAgICAgICAgICBnZXRSZXNvdXJjZXMoKS5nZXREcmF3YWJsZShSLmRyYXdhYmxlLnN1bnNldDEpLAorICAgICAgICAgICAgZ2V0UmVzb3VyY2VzKCkuZ2V0RHJhd2FibGUoUi5kcmF3YWJsZS5zdW5zZXQyKSwKKyAgICAgICAgfSkgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgVmlldyBnZXRWaWV3KGludCBwb3NpdGlvbiwgVmlldyBjb252ZXJ0VmlldywgVmlld0dyb3VwIHBhcmVudCkgeworICAgICAgICAgICAgICAgIFZpZXcgaXRlbSA9IGNvbnZlcnRWaWV3OworICAgICAgICAgICAgICAgIGlmIChpdGVtID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaXRlbSA9IExheW91dEluZmxhdGVyLmZyb20oZ2V0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kKK3B1YmxpYyBjbGFzcyBUZXh0QWN0aXZpdHkgZXh0ZW5kcyBBY3Rpdml0eSB7CisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25DcmVhdGUoQnVuZGxlIHNhdmVkSW5zdGFuY2VTdGF0ZSkgeworICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUpOworCisgICAgICAgIHNldENvbnRlbnRWaWV3KG5ldyBDdXN0b21UZXh0Vmlldyh0aGlzKSk7CisgICAgfQorCisgICAgc3RhdGljIGNsYXNzIEN1c3RvbVRleHRWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIHByaXZhdGUgZmluYWwgUGFpbnQgbU1lZGl1bVBhaW50OworICAgICAgICBwcml2YXRlIGZpbmFsIFBhaW50IG1MYXJnZVBhaW50OworICAgICAgICBwcml2YXRlIGZpbmFsIFBhaW50IG1TdHJpa2VQYWludDsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBQYWludCBtU2NhbGVkUGFpbnQ7CisKKyAgICAgICAgQ3VzdG9tVGV4dFZpZXcoQ29udGV4dCBjKSB7CisgICAgICAgICAgICBzdXBlcihjKTsKKworICAgICAgICAgICAgbU1lZGl1bVBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtTWVkaXVtUGFpbnQuc2V0QW50aUFsaWFzKHRydWUpOworICAgICAgICAgICAgbU1lZGl1bVBhaW50LnNldENvbG9yKDB4ZmZmZjAwMDApOworCisgICAgICAgICAgICBtTGFyZ2VQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0QW50aUFsaWFzKHRydWUpOworICAgICAgICAgICAgbUxhcmdlUGFpbnQuc2V0VGV4dFNpemUoMzYuMGYpOworCisgICAgICAgICAgICBtU3RyaWtlUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1TdHJpa2VQYWludC5zZXRBbnRpQWxpYXModHJ1ZSk7CisgICAgICAgICAgICBtU3RyaWtlUGFpbnQuc2V0VGV4dFNpemUoMTYuMGYpOworICAgICAgICAgICAgbVN0cmlrZVBhaW50LnNldFVuZGVybGluZVRleHQodHJ1ZSk7CisKKyAgICAgICAgICAgIG1TY2FsZWRQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgbVNjYWxlZFBhaW50LnNldEFudGlBbGlhcyh0cnVlKTsKKyAgICAgICAgICAgIG1TY2FsZWRQYWludC5zZXRUZXh0U2l6ZSgxNi4wZik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uRHJhdyhjYW52YXMpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSR0IoMjU1LCAyNTUsIDI1NSk7CisKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3VGV4dCgiSGVsbG8gT3BlbkdMIHJlbmRlcmVyISIsIDEwMCwgMjAsIG1NZWRpdW1QYWludCk7CisgICAgICAgICAgICBtTWVkaXVtUGFpbnQuc2V0VGV4dEFsaWduKFBhaW50LkFsaWduLkNFTlRFUik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1RleHQoIkhlbGxvIE9wZW5HTCByZW5kZXJlciEiLCAxMDAsIDQwLCBtTWVkaXVtUGFpbnQpOworICAgICAgICAgICAgbU1lZGl1bVBhaW50LnNldFRleHRBbGlnbihQYWludC5BbGlnbi5SSUdIVCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1RleHQoIkhlbGxvIE9wZW5HTCByZW5kZXJlciEiLCAxMDAsIDYwLCBtTWVkaXVtUGFpbnQpOworICAgICAgICAgICAgbU1lZGl1bVBhaW50LnNldFRleHRBbGlnbihQYWludC5BbGlnbi5MRUZUKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3VGV4dCgiSGVsbG8gT3BlbkdMIHJlb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ICBtU3RyaWtlUGFpbnQuc2V0U3RyaWtlVGhydVRleHQodHJ1ZSk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1RleHQoIkhlbGxvIE9wZW5HTCByZW5kZXJlciEiLCA1MDAsIDcwLCBtU3RyaWtlUGFpbnQpOworICAgICAgICAgICAgbVN0cmlrZVBhaW50LnNldFVuZGVybGluZVRleHQoZmFsc2UpOworICAgICAgICAgICAgY2FudmFzLmRyYXdUZXh0KCJIZWxsbyBPcGVuR0wgcmVuZGVyZXIhIiwgNTAwLCAxMDAsIG1TdHJpa2VQYWludCk7CisgICAgICAgICAgICBtU3RyaWtlUGFpbnQuc2V0U3RyaWtlVGhydVRleHQoZmFsc2UpOworICAgICAgICAgICAgbVN0cmlrZVBhaW50LnNldFVuZGVybGluZVRleHQodHJ1ZSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1TY2FsZWRQYWludC5zZXRUZXh0U2NhbGVYKDAuNWYpOworICAgICAgICAgICAgY2FudmFzLmRyYXdUZXh0KCJIZWxsbyBPcGVuR0wgcmVuZGVyZXIhIiwgNTAwLCAyMDAsIG1TY2FsZWRQYWludCk7CisgICAgICAgICAgICBtU2NhbGVkUGFpbnQuc2V0VGV4dFNjYWxlWCgyLjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3VGV4dCgiSGVsbG8gT3BlbkdMIHJlbmRlcmVyISIsIDUwMCwgMjMwLCBtU2NhbGVkUGFpbnQpOworICAgICAgICAgICAgbVNjYWxlZFBhaW50LnNldFRleHRTY2FsZVgoMS4wZik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1RleHQoIkhlbGxvIE9wZW5HTCByZW5kZXJlciEiLCA1MDAsIDI2MCwgbVNjYWxlZFBhaW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy5jbGlwUmVjdCgxNTAuMGYsIDIyMC4wZiwgNDUwLjBmLCAzMjAuMGYp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ZpdHkgeworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKKworICAgICAgICBmaW5hbCBMaW5lYXJMYXlvdXQgbGF5b3V0ID0gbmV3IExpbmVhckxheW91dCh0aGlzKTsKKyAgICAgICAgbGF5b3V0LnNldE9yaWVudGF0aW9uKExpbmVhckxheW91dC5WRVJUSUNBTCk7CisKKyAgICAgICAgZmluYWwgR2FtbWFUZXh0VmlldyBnYW1tYSA9IG5ldyBHYW1tYVRleHRWaWV3KHRoaXMpOworICAgICAgICBsYXlvdXQuYWRkVmlldyhnYW1tYSwgbmV3IExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMoCisgICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UCisgICAgICAgICkpOworCisgICAgICAgIHNldENvbnRlbnRWaWV3KGxheW91dCk7CisgICAgICAgIAorICAgICAgICBsYXlvdXQucG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBCaXRtYXAgYiA9IEJpdG1hcC5jcmVhdGVCaXRtYXAoZ2FtbWEuZ2V0V2lkdGgoKSwgZ2FtbWEuZ2V0SGVpZ2h0KCksCisgICAgICAgICAgICAgICAgICAgICAgICBCaXRtYXAuQ29uZmlnLkFSR0JfODg4OCk7CisgICAgICAgICAgICAgICAgQ2FudmFzIGMgPSBuZXcgQ2FudmFzKGIpOworICAgICAgICAgICAgICAgIGMuZHJhd0NvbG9yKDAsIFBvcnRlckR1ZmYuTW9kZS5DTEVBUik7CisgICAgICAgICAgICAgICAgZ2FtbWEuZHJhdyhjKTsKKworICAgICAgICAgICAgICAgIEltYWdlVmlldyBpbWFnZSA9IG5ldyBJbWFnZVZpZXcoVGV4dEdhbW1hQWN0aXZpdHkudGhpcyk7CisgICAgICAgICAgICAgICAgaW1hZ2Uuc2V0SW1hZ2VCaXRtYXAoYik7CisKKyAgICAgICAgICAgICAgICBsYXlvdXQuYWRkVmlldyhpbWFnZSwgbmV3IExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMoCisgICAgICAgICAgICAgICAgICAgICAgICBMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UCisgICAgICAgICAgICAgICAgKSk7CisKKyAgICAgICAgICAgICAgICBzdGFydEFjdGl2aXR5KG5ldyBJbnRlbnQoVGV4dEdhbW1hQWN0aXZpdHkudGhpcywgU3ViR2FtbWFBY3Rpdml0eS5jbGFzcykpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKworICAgICAgICBnZXRXaW5kb3coKS5zZXRCYWNrZ3JvdW5kRHJhd2FibGUobmV3IENvbG9yRHJhd2FibGUoMHhmZmZmZmZmZikpOworICAgIH0KKworICAgIHN0YXRpYyBjbGFzcyBHYW1tYVRleHRWaWV3IGV4dGVuZHMgTGluZWFyTGF5b3V0IHsKKyAgICAgICAgR2FtbWFUZXh0VmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworCisgICAgICAgICAgICBzZXRCYWNrZ3JvdW5kQ29sb3IoMHhmZmZmZmZmZik7CisKKyAgICAgICAgICAgIGZpbmFsIExheW91dEluZmxhdGVyIGluZmxhdGVyID0gTGF5b3V0SW5mbGF0ZXIuZnJvbShjKTsKKyAgICAgICAgICAgIGluZmxhdGVyLmluZmxhdGUoUi5sYXlvdXQudGV4dF9sYXJnZSwgdGhpcywgdHJ1ZSk7CisgICAgICAgICAgICBpbmZsYXRlci5pbmZsYXRlKFIubGF5b3V0LnRleHRfbWVkaXVtLCB0aGlzLCB0cnVlKTsKKyAgICAgICAgICAgIGluZmxhdGVyLmluZmxhdGUoUi5sYXlvdXQudGV4dF9zbWFsbCwgdGhpcywgdHJ1ZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIFN1YkdhbW1hQWN0aXZpdHkgZXh0ZW5kcyBBY3Rpdml0eSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkNyZWF0ZShCdW5kbGUgc2F2ZWRJbnN0YW5jZVN0YXRlKSB7CisgICAgICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUpOworCisgICAgICAgICAgICBmaW5hbCBMaW5lYXJMYXlvdXQgbGF5b3V0ID0gbmV3IExpbmVhckxheW91dCh0aGlzKTsKKyAgICAgICAgICAgIGxheW91dC5zZXRPcmllbnRhdGlvbihMaW5lYXJMYXlvdXQuVkVSVElDQUwpOworICAgICAgICAKKyAgICAgICAgICAgIGZpbmFsIEdhbW1hVGV4dFZpZXcgZ2FtbWEgPSBuZXcgR2FtbWFUZXh0Vmlldyh0aGlzKTsKKyAgICAgICAgICAgIGZpbmFsIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMgbHAgPSBuZXcgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcygKKyAgICAgICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UCisgICAgICAgICAgICApOworICAgICAgICAgICAgbHAuc2V0TWFyZ2lucygwLCA3NCwgMCwgMCk7CisgICAgICAgICAgICBsYXlvdXQuYWRkVmlldyhnYW1tYSwgbHApOworCisgICAgICAgICAgICBzZXRD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yYW1zKG5ldyBGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMoRnJhbWVMYXlvdXQuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCwKKyAgICAgICAgICAgICAgICBGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSk7CisgICAgICAgIGxheW91dC5hZGRWaWV3KGIpOworICAgICAgICBsYXlvdXQuc2V0QmFja2dyb3VuZENvbG9yKDB4ZmZmZmZmZmYpOworICAgICAgICAKKyAgICAgICAgc2V0Q29udGVudFZpZXcobGF5b3V0KTsKKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFBhdGNoVmlldyBleHRlbmRzIFZpZXcgeworICAgICAgICBwcml2YXRlIERyYXdhYmxlIG1QYXRjaDEsIG1QYXRjaDI7CisKKyAgICAgICAgcHVibGljIFBhdGNoVmlldyhBY3Rpdml0eSBhY3Rpdml0eSkgeworICAgICAgICAgICAgc3VwZXIoYWN0aXZpdHkpOworCisgICAgICAgICAgICBmaW5hbCBSZXNvdXJjZXMgcmVzb3VyY2VzID0gYWN0aXZpdHkuZ2V0UmVzb3VyY2VzKCk7CisgICAgICAgICAgICBtUGF0Y2gxID0gcmVzb3VyY2VzLmdldERyYXdhYmxlKFIuZHJhd2FibGUucGF0Y2gpOworICAgICAgICAgICAgbVBhdGNoMiA9IHJlc291cmNlcy5nZXREcmF3YWJsZShSLmRyYXdhYmxlLmJ0bl90b2dnbGVfb24pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgd2lkdGggPSAxMDA7CisgICAgICAgICAgICBmaW5hbCBpbnQgaGVpZ2h0ID0gNjA7CisKKyAgICAgICAgICAgIGZpbmFsIGludCBsZWZ0ID0gKGdldFdpZHRoKCkgLSB3aWR0aCkgLyAyOworICAgICAgICAgICAgZmluY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KKworICAgICAgICAgICAgY2FudmFzLmRyYXdBUkdCKDI1NSwgMjU1LCAyNTUsIDI1NSk7CisKKyAgICAgICAgICAgIGZpbmFsIGZsb2F0IGNlbnRlclggPSBnZXRXaWR0aCgpIC8gMi4wZiAtIG1CaXRtYXAxLmdldFdpZHRoKCkgLyAyLjBmOworICAgICAgICAgICAgZmluYWwgZmxvYXQgY2VudGVyWSA9IGdldEhlaWdodCgpIC8gMi4wZiAtIG1CaXRtYXAxLmdldEhlaWdodCgpIC8gMi4wZjsKKyAgICAgICAgICAgIGZpbmFsIENhbWVyYSBjYW1lcmEgPSBtQ2FtZXJhOworICAgICAgICAgICAgCisgICAgICAgICAgICBmaW5hbCBNYXRyaXggbWF0cml4ID0gbU1hdHJpeDsKKworICAgICAgICAgICAgcm90YXRlKGNlbnRlclgsIGNlbnRlclksIGNhbWVyYSwgbWF0cml4LCAzMi4wZik7CisgICAgICAgICAgICBkcmF3Qml0bWFwKGNhbnZhcywgY2VudGVyWCwgY2VudGVyWSwgMC4wZiwgbWF0cml4KTsKKworICAgICAgICAgICAgcm90YXRlKGNlbnRlclgsIGNlbnRlclksIGNhbWVyYSwgbWF0cml4LCAxMi4wZik7CisgICAgICAgICAgICBkcmF3Qml0bWFwKGNhbnZhcywgY2VudGVyWCwgY2VudGVyWSwgLW1CaXRtYXAxLmdldFdpZHRoKCksIG1hdHJpeCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHJvdGF0ZShjZW50ZXJYLCBjZW50ZXJZLCBjYW1lcmEsIG1hdHJpeCwgNTIuMGYpOworICAgICAgICAgICAgZHJhd0JpdG1hcChjYW52YXMsIGNlbnRlclgsIGNlbnRlclksIG1CaXRtYXAxLmdldFdpZHRoKCksIG1hdHJpeCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHJvdGF0ZShjZW50ZXJYLCBjZW50ZXJZLCBjYW1lcmEsIG1hdHJpeCwgMTIyLjBmKTsKKyAgICAgICAgICAgIGRyYXdCaXRtYXAoY2FudmFzLCBjZW50ZXJYLCBjZW50ZXJZLCBtQml0bWFwMS5nZXRXaWR0aCgpICogMi4wZiwgbWF0cml4KTsKKyAgICAgICAgICAgIAorICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIGRyYXdCaXRtYXAoQ2FudmFzIGNhbnZhcywgZmxvYXQgY2VudGVyWCwgZmxvYXQgY2VudGVyWSwgZmxvYXQgb2Zmc2V0LAorICAgICAgICAgICAgICAgIE1hdHJpeCBtYXRyaXgpIHsKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKG9mZnNldCwgMC4wZik7CisgICAgICAgICAgICBjYW52YXMuY29uY2F0KG1hdHJpeCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChtQml0bWFwMSwgY2VudGVyWCwgY2VudGVyWSwgbnVsbCk7CisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIHJvdGF0ZShmbG9hdCBjZW50ZXJYLCBmbG9hdCBjZW50ZXJZLCBDYW1lcmEgY2FtZXJhLAorICAgICAgICAgICAgICAgIE1hdHJpeCBtYXRyaXgsIGZsb2F0IGFuZ2xlKSB7CisgICAgICAgICAgICBjYW1lcmEuc2F2ZSgpOworICAgICAgICAgICAgY2FtZXJhLnJvdGF0ZVkoYW5nbGUpOworICAgICAgICAgICAgY2FtZXJhLmdldE1hdHJpeChtYXRyaXgpOworICAgICAgICAgICAgY2FtZXJhLnJlc3RvcmUoKTsKKworICAgICAgICAgICAgbWF0cml4LnByZVRyYW5zbGF0ZSgtY2VudGVyWCwgLWNlbnRlclkpOworICAgICAgICAgICAgbWF0cml4LnBvc3RUcmFuc2xhdGUoY2VudGVyWCwgY2VudGVyWSk7CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS90ZXN0cy9Id0FjY2VsZXJhdGlvblRlc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gICAgICBYZmVybW9kZXNWaWV3KENvbnRleHQgYykgeworICAgICAgICAgICAgc3VwZXIoYyk7CisKKyAgICAgICAgICAgIG1CbHVlUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1CbHVlUGFpbnQuc2V0Q29sb3IoMHhmZjAwMDBmZik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1SZWRQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgbVJlZFBhaW50LnNldENvbG9yKDB4N2ZmZjAwMDApOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIC8vY2FudmFzLmRyYXdSR0IoMjU1LCAyNTUsIDI1NSk7CisKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMTAwLjBmLCAxMDAuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBTUkMgbW9kZXMKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisKKyAgICAgICAgICAgIGRyYXdSZWN0cyhjYW52YXMsIE1vZGUuU1JDX09WRVIpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMDAuMGYpOworCisgICAgICAgICAgICBkcmF3UmVjdHMoY2FudmFzLCBNb2RlLlNSQ19JTik7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDEwMC4wZik7ICAgICAgICAgICAgCisKKyAgICAgICAgICAgIGRyYXdSZWN0cyhjYW52YXMsIE1vZGUuU1JDX09VVCk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDEwMC4wZik7CisKKyAgICAgICAgICAgIGRyYXdSZWN0cyhjYW52YXMsIE1vZGUuU1JDX0FUT1ApOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMDAuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICBkcmF3UmVjdHMoY2FudmFzLCBNb2RlLlNSQyk7CisKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlKCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMTAwLjBmLCAwLjBmKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gRFNUIG1vZGVzCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworCisgICAgICAgICAgICBkcmF3UmVjdHMoY2FudmFzLCBNb2RlLkRTVF9PVkVSKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgMTAwLjBmKTsKKworICAgICAgICAgICAgZHJhd1JlY3RzKGNhbnZhcywgTW9kZS5EU1RfSU4pOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMDAuMGYpOyAgICAgICAgICAgIAorCisgICAgICAgICAgICBkcmF3UmVjdHMoY2FudmFzLCBNb2RlLkRTVF9PVVQpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMDAuMGYpOworCisgICAgICAgICAgICBkcmF3UmVjdHMoY2FudmFzLCBNb2RlLkRTVF9BVE9QKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgMTAwLjBmKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgZHJhd1JlY3RzKGNhbnZhcywgTW9kZS5EU1QpOworCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDEwMC4wZiwgMC4wZik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIE90aGVyIG1vZGVzCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworCisgICAgICAgICAgICBkcmF3UmVjdHMoY2FudmFzLCBNb2RlLkNMRUFSKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgMTAwLjBmKTsKKworICAgICAgICAgICAgZHJhd1JlY3RzKGNhbnZhcywgTW9kZS5YT1IpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDEwMC4wZik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1CbHVlUGFpbnQuc2V0QWxwaGEoMTI3KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCA1MC4wZiwgNTAuMGYsIG1CbHVlUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDEwMC4wZik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1CbHVlUGFpbnQuc2V0QWxwaGEoMTApOworICAgICAgICAgICAgbUJsdWVQYWludC5zZXRDb2xvcigweDdmMDAwMGZmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCA1MC4wZiwgNTAuMGYsIG1CbHVlUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtQmx1ZVBhaW50LnNldENvbG9yKDB4ZmYwMDAwZmYpOworICAgICAgICAgICAgbUJsdWVQYWludC5zZXRBbHBoYSgyNTUpOworCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIGRyYXdSZWN0cyhDYW52YXMgY2FudmFzLCBQb3J0ZXJEdWZmLk1vZGUgbW9kZSkgeworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDAuMGYsIDAuMGYsIDUwLjBmLCA1MC4wZiwgbUJsdWVQYWludCk7CisKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDI1LjBmLCAyNS4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SBSLmRyYXdhYmxlLm5vdGlmaWNhdGlvbng7CisKICAgICBAT3ZlcnJpZGUKICAgICBwcm90ZWN0ZWQgU3RyaW5nIHRhZygpIHsKICAgICAgICAgcmV0dXJuIFRBRzsKQEAgLTc3LDYgKzkzLDEzNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9LAogCisgICAgICAgIG5ldyBUZXN0KCJDYW5jZWwgIzEiKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1OTS5jYW5jZWwoMSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0sCisKKyAgICAgICAgbmV3IFRlc3QoIkJ1dHRvbiIpIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBOb3RpZmljYXRpb24gbiA9IG5ldyBOb3RpZmljYXRpb24oUi5kcmF3YWJsZS5pY29uMSwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpdml0eUNyZWF0ZVRpbWUpOworICAgICAgICAgICAgICAgIG4uY29udGVudFZpZXcgPSBuZXcgUmVtb3RlVmlld3MoZ2V0UGFja2FnZU5hbWUoKSwgUi5sYXlvdXQuYnV0dG9uX25vdGlmaWNhdGlvbik7CisgICAgICAgICAgICAgICAgbi5mbGFncyB8PSBOb3RpZmljYXRpb24uRkxBR19PTkdPSU5HX0VWRU5UOworICAgICAgICAgICAgICAgIG4uY29udGVudEludGVudCA9IG1ha2VJbnRlbnQoKTsKKyAgICAgICAgICAgICAgICBuLmNvbnRlbnRWaWV3LnNldE9uQ2xpY2tQZW5kaW5nSW50ZW50KFIuaWQuYnV0dG9uLCBtYWtlSW50ZW50MigpKTsKKworICAgICAgICAgICAgICAgIG1OTS5ub3RpZnkoMSwgbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0sCisKKyAgICAgICAgbmV3IFRlc3QoImN1c3RvbSBpbnRlbnQgb24gdGV4dCB2aWV3IikgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbiBuID0gbmV3IE5vdGlmaWNhdGlvbihSLmRyYXdhYmxlLmljb24xLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2aXR5Q3JlYXRlVGltZSk7CisgICAgICAgICAgICAgICAgbi5zZXRMYXRlc3RFdmVudEluZm8oTm90aWZpY2F0aW9uVGVzdExpc3QudGhpcywgIlBlcnNpc3RlbnQgIzEiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUaGlzIGlzIGEgbm90aWZpY2F0aW9uISEhIiwgbnVsbCk7CisgICAgICAgICAgICAgICAgbi5jb250ZW50Vmlldy5zZXRPbkNsaWNrUGVuZGluZ0ludGVudChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICBtYWtlSW50ZW50MigpKTsKKyAgICAgICAgICAgICAgICBtTk0ubm90aWZ5KDEsIG4pOworICAgICAgICAgICAgfQorICAgICAgICB9LAorCisgICAgICAgIG5ldyBUZXN0KCJUaWNrZXIgMSBsaW5lIikgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbiBuID0gbmV3IE5vdGlmaWNhdGlvbihSLmRyYXdhYmxlLmljb24xLCAidGljayB0aWNrIHRpY2siLAorICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2aXR5Q3JlYXRlVGltZSk7CisgICAgICAgICAgICAgICAgbi5zZXRMYXRlc3RFdmVudEluZm8oTm90aWZpY2F0aW9uVGVzdExpc3QudGhpcywgIlBlcnNpc3RlbnQgIzEiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUaGlzIGlzIGEgbm90aWZpY2F0aW9uISEhIiwgbWFrZUludGVudCgpKTsKKyAgICAgICAgICAgICAgICBtTk0ubm90aWZ5KDEsIG4pOworICAgICAgICAgICAgfQorICAgICAgICB9LAorCisgICAgICAgIG5ldyBUZXN0KCJUaWNrZXIgMSBsaW5lICYgaWNvbiIpIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBOb3RpZmljYXRpb24gbiA9IG5ldyBOb3RpZmljYXRpb24oUi5kcmF3YWJsZS5pY29uMSwgInRpY2sgdGljayB0aWNrIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpdml0eUNyZWF0ZVRpbWUpOworICAgICAgICAgICAgICAgIG4uc2V0TGF0ZXN0RXZlbnRJbmZvKE5vdGlmaWNhdGlvblRlc3RMaXN0LnRoaXMsICJQZXJzaXN0ZW50ICMxIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVGhpcyBpcyBhIG5vdGlmaWNhdGlvbiEhISIsIG1ha2VJbnRlbnQoKSk7CisgICAgICAgICAgICAgICAgbi50aWNrZXJJY29ucyA9IG5ldyBCaXRtYXBbMV07CisgICAgICAgICAgICAgICAgbi50aWNrZXJJY29uc1swXSA9IGxvYWRCaXRtYXAoUi5kcmF3YWJsZS5pY29uMyk7CisgICAgICAgICAgICAgICAgbU5NLm5vdGlmeSgxLCBuKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwKKworICAgICAgICBuZXcgVGVzdCgiVGlja2VyIDIgbGluZXMiKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgTm90aWZpY2F0aW9uIG4gPSBuZXcgTm90aWZpY2F0aW9uKFIuZHJhd2FibGUuaWNvbjEsICJ0aWNrIHRpY2sgdGlja1xudG9jayB0b2NrIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpdml0eUNyZWF0ZVRpbWUpOworICAgICAgICAgICAgICAgIG4uc2V0TGF0ZXN0RXZlbnRJbmZvKE5vdGlmaWNhdGlvblRlc3RMaXN0LnRoaXMsICJQZXJzaXN0ZW50ICMxIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVGhpcyBpcyBhIG5vdGlmaWNhdGlvbiEhISIsIG1ha2VJbnRlbnQoKSk7CisgICAgICAgICAgICAgICAgbU5NLm5vdGlmeSgxLCBuKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwKKworICAgICAgICBuZXcgVGVzdCgiVGlja2VyIHRpdGxlIikgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbiBuID0gbmV3IE5vdGlmaWNhdGlvbihSLmRyYXdhYmxlLmljb24xLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2aXR5Q3JlYXRlVGltZSk7CisgICAgICAgICAgICAgICAgbi5zZXRMYXRlc3RFdmVudEluZm8oTm90aWZpY2F0aW9uVGVzdExpc3QudGhpcywgIlBlcnNpc3RlbnQgIzEiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUaGlzIGlzIGEgbm90aWZpY2F0aW9uISEhIiwgbWFrZUludGVudCgpKTsKKyAgICAgICAgICAgICAgICBuLnRpY2tlclRpdGxlID0gIlRoaXMgaXMgYSB0aXRsZSI7CisgICAgICAgICAgICAgICAgbU5NLm5vdGlmeSgxLCBuKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwKKworICAgICAgICBuZXcgVGVzdCgiVGlja2VyIHN1YnRpdGxlIikgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbiBuID0gbmV3IE5vdGlmaWNhdGlvbihSLmRyYXdhYmxlLmljb24xLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2aXR5Q3JlYXRlVGltZSk7CisgICAgICAgICAgICAgICAgbi5zZXRMYXRlc3RFdmVudEluZm8oTm90aWZpY2F0aW9uVGVzdExpc3QudGhpcywgIlBlcnNpc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ubm90aWZ5KDEsIG4pOworICAgICAgICAgICAgfQorICAgICAgICB9LAorCisgICAgICAgIG5ldyBUZXN0KCJUaWNrZXIgdGV4dCwgdGl0bGUgJiBzdWJ0aXRsZSIpIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBOb3RpZmljYXRpb24gbiA9IG5ldyBOb3RpZmljYXRpb24oUi5kcmF3YWJsZS5pY29uMSwgIm5vdCB2aXNpYmxlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpdml0eUNyZWF0ZVRpbWUpOworICAgICAgICAgICAgICAgIG4uc2V0TGF0ZXN0RXZlbnRJbmZvKE5vdGlmaWNhdGlvblRlc3RMaXN0LnRoaXMsICJQZXJzaXN0ZW50ICMxIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVGhpcyBpcyBhIG5vdGlmaWNhdGlvbiEhISIsIG1ha2VJbnRlbnQoKSk7CisgICAgICAgICAgICAgICAgbi50aWNrZXJUaXRsZSA9ICJUaGlzIGlzIGEgdGl0bGUiOworICAgICAgICAgICAgICAgIG4udGlja2VyU3VidGl0bGUgPSAiYW5kIGEgc3VidGl0bGUiOworICAgICAgICAgICAgICAgIG1OTS5ub3RpZnkoMSwgbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0sCisKKyAgICAgICAgbmV3IFRlc3QoIlRpY2tlciB0aXRsZSwgc3VidGl0bGUgJiAyIGljb25zIikgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbiBuID0gbmV3IE5vdGlmaWNhdGlvbihSLmRyYXdhYmxlLmljb24xLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2aXR5Q3JlYXRlVGltZSk7CisgICAgICAgICAgICAgICAgbi5zZXRMYXRlc3RFdmVudEluZm8oTm90aWZpY2F0aW9uVGVzdExpc3QudGhpcywgIlBlcnNpc3RlbnQgIzEiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUaGlzIGlzIGEgbm90aWZpY2F0aW9uISEhIiwgbWFrZUludGVudCgpKTsKKyAgICAgICAgICAgICAgICBuLnRpY2tlclRpdGxlID0gIlRoaXMgaXMgYSB0aXRsZSI7CisgICAgICAgICAgICAgICAgbi50aWNrZXJTdWJ0aXRsZSA9ICJhbmQgYSBzdWJ0aXRsZSI7CisKKyAgICAgICAgICAgICAgICBuLnRpY2tlckljb25zID0gbmV3IEJpdG1hcFsyXTsKKyAgICAgICAgICAgICAgICBuLnRpY2tlckljb25zWzBdID0gbG9hZEJpdG1hcChSLmRyYXdhYmxlLmljb24zKTsKKyAgICAgICAgICAgICAgICBuLnRpY2tlckljb25zWzFdID0gbG9hZEJpdG1hcChSLmRyYXdhYmxlLmFwcF9nbWFpbCk7CisKKyAgICAgICAgICAgICAgICBtTk0ubm90aWZ5KDEsIG4pOworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgbi50aWNrZXJJY29uc1swXS5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgbi50aWNrZXJJY29uc1sxXS5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwKKwogICAgICAgICBuZXcgVGVzdCgiTm8gdmlldyIpIHsKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKICAgICAgICAgICAgICAgICBOb3RpZmljYXRpb24gbiA9IG5ldyBOb3RpZmljYXRpb24oUi5kcmF3YWJsZS5pY29uMSwgIk5vIHZpZXciLApAQCAtOTgsMTIgKzI0NSwxNiBAQAogICAgICAgICBuZXcgVGVzdCgiTGF5b3V0IikgewogICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkKICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBOb3RpZmljYXRpb24gbjsKIAotICAgICAgICAgICAgICAgIG1OTS5ub3RpZnkoMSwgbmV3IE5vdGlmaWNhdGlvbihOb3RpZmljYXRpb25UZXN0TGlzdC50aGlzLAorICAgICAgICAgICAgICAgIG4gPSBuZXcgTm90aWZpY2F0aW9uKE5vdGlmaWNhdGlvblRlc3RMaXN0LnRoaXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUi5kcmF3YWJsZS5pY19zdGF0dXNiYXJfbWlzc2VkY2FsbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKS0oMTAwMCo2MCo2MCoyNCksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIig0NTMpIDEyMy0yMzI4IiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIiwgbnVsbCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICIiLCBudWxsKTsKKyAgICAgICAgICAgICAgICBuLmZsYWdzIHw9IE5vdGlmaWNhdGlvbi5GTEFHX09OR09JTkdfRVZFTlQ7CisKKyAgICAgICAgICAgICAgICBtTk0ubm90aWZ5KDEsIG4pOwogCiAgICAgICAgICAgICAgICAgbU5NLm5vdGlmeSgyLCBuZXcgTm90aWZpY2F0aW9uKE5vdGlmaWNhdGlvblRlc3RMaXN0LnRoaXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUi5kcmF3YWJsZS5pY19zdGF0dXNiYXJfZW1haWwsCkBAIC00NzksNyArNjMwLDcgQEAKIAogICAgICAgICBuZXcgVGVzdCgiUGVyc2lzdGVudCAjMyIpIHsKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKLSAgICAgICAgICAgICAgICBOb3RpZmljYXRpb24gbiA9IG5ldyBOb3RpZmljYXRpb24oUi5kcmF3YWJsZS5pY29uMiwgInRvY2sgdG9jayB0b2NrIiwKKyAgICAgICAgICAgICAgICBOb3RpZmljYXRpb24gbiA9IG5ldyBOb3RpZmljYXRpb24oUi5kcmF3YWJsZS5pY29uMiwgInRvY2sgdG9jayB0b2NrXG5tb29vb28iLAogICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkpOwogICAgICAgICAgICAgICAgIG4uc2V0TGF0ZXN0RXZlbnRJbmZvKE5vdGlmaWNhdGlvblRlc3RMaXN0LnRoaXMsICJQZXJzaXN0ZW50ICMzIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTm90aWZ5IG1lISEhIiwgbWFrZUludGVudCgpKTsKQEAgLTU4NCw3ICs3MzUsOCBAQAogICAgICAgICBuZXcgVGVzdCgiVGVuIE5vdGlmaWNhdGlvbnMiKSB7CiAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CiAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAyOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgTm90aWZpY2F0aW9uIG4gPSBuZXcgTm90aWZpY2F0aW9uKE5vdGlmaWNhdGlvblRlc3RMaXN0LnRoaXMsIFIuZHJhd2FibGUuaWNvbjIsCisgICAgICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbiBuID0gbmV3IE5vdGlmaWNhdGlvbihOb3RpZmljYXRpb25UZXN0TGlzdC50aGlzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtOdW1iZXJlZEljb25SZXNJRHNbaV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCksICJQZXJzaXN0ZW50ICMiICsgaSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTm90aWZ5IG1lISEhIiArIGksIG51bGwpOwogICAgICAgICAgICAgICAgICAgICBuLmZsYWdzIHw9IE5vdGlmaWNhdGlvbi5GTEFHX09OR09JTkdfRVZFTlQ7CkBAIC01OTIsNyArNzQ0LDggQEAKICAgICAgICAgICAgICAgICAgICAgbU5NLm5vdGlmeSgoaSsxKSoxMCwgbik7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAyOyBpIDwgMTA7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBOb3RpZmljYXRpb24gbiA9IG5ldyBOb3RpZmljYXRpb24oTm90aWZpY2F0aW9uVGVzdExpc3QudGhpcywgUi5kcmF3YWJsZS5pY29uMiwKKyAgICAgICAgICAgICAgICAgICAgTm90aWZpY2F0aW9uIG4gPSBuZXcgTm90aWZpY2F0aW9uKE5vdGlmaWNhdGlvblRlc3RMaXN0LnRoaXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAga051bWJlcmVkSWNvblJlc0lEc1tpXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSwgIlBlcnNpc3RlbnQgIyIgKyBpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOb3RpZnkgbWUhISEiICsgaSwgbnVsbCk7CiAgICAgICAgICAgICAgICAgICAgIG4ubnVtYmVyID0gaTsKQEAgLTYwOSw2ICs3NjIsMTMgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfSwKICAgICAgICAgCisgICAgICAgIG5ldyBUZXN0KCJDYW5jZWwgdGhlIG90aGVyIHR3byBub3RpZmljYXRpb25zIikgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIG1OTS5jYW5jZWwoMTApOworICAgICAgICAgICAgICAgIG1OTS5jYW5jZWwoMTAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwKKyAgICAgICAgCiAgICAgICAgIG5ldyBUZXN0KCJQZXJzaXN0ZW50IHdpdGggbnVtYmVycyAxIikgewogICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewogICAgICAgICAgICAgICAgIG1OTS5ub3RpZnkoMSwgbm90aWZpY2F0aW9uV2l0aE51bWJlcnMoMSkpOwpAQCAtNjMzLDIwICs3OTMsNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9LAogCi0gICAgICAgIG5ldyBUZXN0KCJUaWNrZXIiKSB7Ci0gICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0gICAgICAgICAgICAgICAgTm90aWZpY2F0aW9uIG5vdCA9IG5ldyBOb3RpZmljYXRpb24oCi0gICAgICAgICAgICAgICAgICAgIFIuZHJhd2FibGUuYXBwX2dtYWlsLCAKLSAgICAgICAgICAgICAgICAgICAgIk5ldyBtYWlsIGZyb20gam9lb0BleGFtcGxlLmNvbSwgb24gdGhlIHRvcGljIG9mIHZlcnkgbG9uZyB0aWNrZXIgdGV4dHMiLAotICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSk7Ci0gICAgICAgICAgICAgICAgbm90LnNldExhdGVzdEV2ZW50SW5mbyhOb3RpZmljYXRpb25UZXN0TGlzdC50aGlzLAotICAgICAgICAgICAgICAgICAgICAiQSBuZXcgbWVzc2FnZSBhd2FpdHMiLAotICAgICAgICAgICAgICAgICAgICAiVGhlIGNvbnRlbnRzIGFyZSB2ZXJ5IGludGVyZXN0aW5nIGFuZCBpbXBvcnRhbnQiLAotICAgICAgICAgICAgICAgICAgICBtYWtlSW50ZW50KCkpOwotICAgICAgICAgICAgICAgIG1OTS5ub3RpZnkoMSwgbm90KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSwKLQogICAgICAgICBuZXcgVGVzdCgiQ3Jhc2giKSB7CiAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKQogICAgICAgICAgICAgewpAQCAtNjY2LDggKzgxMiwxNCBAQAogICAgIH07CiAKICAgICBwcml2YXRlIE5vdGlmaWNhdGlvbiBub3RpZmljYXRpb25XaXRoTnVtYmVycyhpbnQgbnVtKSB7Ci0gICAgICAgIE5vdGlmaWNhdGlvbiBuID0gbmV3IE5vdGlmaWNhdGlvbih0aGlzLCBSLmRyYXdhYmxlLmljb24yLCBudWxsLCBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSwKLSAgICAgICAgICAgICAgICAiUGVyc2lzdGVudCAjMiIsICJOb3RpZnkgbWUhISEiLCBudWxsKTsKKyAgICAgICAgTm90aWZpY2F0aW9uIG4gPSBuZXcgTm90aWZpY2F0aW9uKHRoaXMsCisgICAgICAgICAgICAgICAgKG51bSA+PSAwICYmIG51bSA8IGtOdW1iZXJlZEljb25SZXNJRHMubGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICA/IGtOdW1iZXJlZEljb25SZXNJRHNbbnVtXQorICAgICAgICAgICAgICAgICAgICA6IGtVbm51bWJlcmVkSWNvblJlc0lELAorICAgICAgICAgICAgICAgIG51bGwsCisgICAgICAgICAgICAgICAgU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCksCisgICAgICAgICAgICAgICAgIk5vdGlmaWNhdGlvbiIsICJOdW1iZXI9IiArIG51bSwKKyAgICAgICAgICAgICAgICBudWxsKTsKICAgICAgICAgbi5udW1iZXIgPSBudW07CiAgICAgICAgIHJldHVybiBuOwogICAgIH0KQEAgLTY3OCw2ICs4MzAsMTIgQEAKICAgICAgICAgcmV0dXJuIFBlbmRpbmdJbnRlbnQuZ2V0QWN0aXZpdHkodGhpcywgMCwgaW50ZW50LCAwKTsKICAgICB9CiAKKyAgICBwcml2YXRlIFBlbmRpbmdJbnRlbnQgbWFrZUludGVudDIoKSB7CisgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KHRoaXMsIFN0YXR1c0JhclRlc3QuY2xhc3MpOworICAgICAgICByZXR1cm4gUGVuZGluZ0ludGVudC5nZXRBY3Rpdml0eSh0aGlzLCAwLCBpbnRlbnQsIDApOworICAgIH0KKworCiAgICAgY2xhc3MgU3RhdGVTdHJlc3MgZXh0ZW5kcyBUZXN0IHsKICAgICAgICAgU3RhdGVTdHJlc3MoU3RyaW5nIG5hbWUsIGludCBwYXVzZSwgaW50IGl0ZXJhdGlvbnMsIFJ1bm5hY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SGlkZSAoRkxBR19GVUxMU0NSRUVOKSIpIHsKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKICAgICAgICAgICAgICAgICBXaW5kb3cgd2luID0gZ2V0V2luZG93KCk7Ci0gICAgICAgICAgICAgICAgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMgd2luUGFyYW1zID0gd2luLmdldEF0dHJpYnV0ZXMoKTsKLSAgICAgICAgICAgICAgICB3aW5QYXJhbXMuZmxhZ3MgfD0gV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19GVUxMU0NSRUVOOwotICAgICAgICAgICAgICAgIHdpbi5zZXRBdHRyaWJ1dGVzKHdpblBhcmFtcyk7CisgICAgICAgICAgICAgICAgd2luLnNldEZsYWdzKFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfRlVMTFNDUkVFTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfRlVMTFNDUkVFTik7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiZmxhZ3M9IiArIEludGVnZXIudG9IZXhTdHJpbmcod2luLmdldEF0dHJpYnV0ZXMoKS5mbGFncykpOwogICAgICAgICAgICAgfQogICAgICAgICB9LAotICAgICAgICBuZXcgVGVzdCgiU2hvdyIpIHsKKyAgICAgICAgbmV3IFRlc3QoIlNob3cgKH5GTEFHX0ZVTExTQ1JFRU4pIikgewogICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewogICAgICAgICAgICAgICAgIFdpbmRvdyB3aW4gPSBnZXRXaW5kb3coKTsKLSAgICAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcyB3aW5QYXJhbXMgPSB3aW4uZ2V0QXR0cmlidXRlcygpOwotICAgICAgICAgICAgICAgIHdpblBhcmFtcy5mbGFncyAmPSB+V2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19GVUxMU0NSRUVOOwotICAgICAgICAgICAgICAgIHdpbi5zZXRBdHRyaWJ1dGVzKHdpblBhcmFtcyk7CisgICAgICAgICAgICAgICAgd2luLnNldEZsYWdzKDAsIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfRlVMTFNDUkVFTik7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiZmxhZ3M9IiArIEludGVnZXIudG9IZXhTdHJpbmcod2luLmdldEF0dHJpYnV0ZXMoKS5mbGFncykpOwogICAgICAgICAgICAgfQogICAgICAgICB9LAotICAgICAgICBuZXcgVGVzdCgiZnVsbFNjcmVlbkludGVudCIpIHsKKyAgICAgICAgbmV3IFRlc3QoIkltbWVyc2l2ZTogRW50ZXIiKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgc2V0SW1tZXJzaXZlKHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9LAorICAgICAgICBuZXcgVGVzdCgiSW1tZXJzaXZlOiBFeGl0IikgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIHNldEltbWVyc2l2ZShmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0sCisgICAgICAgIG5ldyBUZXN0KCJQcmlvcml0eSBub3RpZmljYXRpb24iKSB7CiAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CiAgICAgICAgICAgICAgICAgTm90aWZpY2F0aW9uIG5vdCA9IG5ldyBOb3RpZmljYXRpb24oU3RhdHVzQmFyVGVzdC50aGlzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSLmRyYXdhYmxlLnN0YXRfc3lzX3Bob25lLApAQCAtMTA3LDggKzExNiw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoODg4KSA1NTUtNTAzOCIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKKyAgICAgICAgICAgICAgICBub3QuZmxhZ3MgfD0gTm90aWZpY2F0aW9uLkZMQUdfSElHSF9QUklPUklUWTsKICAgICAgICAgICAgICAgICBJbnRlbnQgZnVsbFNjcmVlbkludGVudCA9IG5ldyBJbnRlbnQoU3RhdHVzQmFyVGVzdC50aGlzLCBUZXN0QWxlcnRBY3Rpdml0eS5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgaW50IGlkID0gKGludClTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICBpbnQgaWQgPSAoaW50KVN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOyAvLyBYWFggSEFYCiAgICAgICAgICAgICAgICAgZnVsbFNjcmVlbkludGVudC5wdXRFeHRyYSgiaWQiLCBpZCk7CiAgICAgICAgICAgICAgICAgbm90LmZ1bGxTY3JlZW5JbnRlbnQgPSBQZW5kaW5nSW50ZW50LmdldEFjdGl2aXR5KAogICAgICAgICAgICAgICAgICAgICBTdGF0dXNCYXJUZXN0LnRoaXMsCkBAIC0xNTgsNiArMTY4LDI0IEBACiAgICAgICAgICAgICAgICAgICAgIH0sIDMwMDApOwogICAgICAgICAgICAgfQogICAgICAgICB9LAorICAgICAgICBuZXcgVGVzdCgiRGlzYWJsZSBOYXZpZ2F0aW9uIikgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIG1TdGF0dXNCYXJNYW5hZ2VyLmRpc2FibGUoU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05BVklHQVRJT04pOworICAgICAgICAgICAgfQorICAgICAgICB9LAorICAgICAgICBuZXcgVGVzdCgiRGlzYWJsZSBldmVyeXRoaW5nIGluIDMgc2VjIikgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnBvc3REZWxheWVkKG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhdHVzQmFyTWFuYWdlci5kaXNhYmxlKFN0YXR1c0Jhck1hbmFnZXIuRElTQUJMRV9FWFBBTkQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05PVElGSUNBVElPTl9JQ09OUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfTk9USUZJQ0FUSU9OX0FMRVJUUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfU1lTVEVNX0lORk8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgU3RhdHVzQmFyTWFuYWdlci5ESVNBQkxFX05BVklHQVRJT04pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9LCAzMDAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwKICAgICAgICAgbmV3IFRlc3QoIkVuYWJsZSBldmVyeXRoaW5nIikgewogICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewogICAgICAgICAgICAgICAgIG1TdGF0dXNCYXJNYW5hZ2VyLmRpc2FibGUoMCk7CmRpZmYgLS1naXQgYS90b29scy9hYXB0L0NvbW1hbmQuY3BwIGIvdG9vbHMvYWFwdC9Db21tYW5kLmNwcAppbmRleCBhZDA0NjVkLi5lOTgzM2M5IDEwMDY0NAotLS0gYS90b29scy9hYXB0L0NvbW1hbmQuY3BwCisrKyBiL3Rvb2xzL2FhcHQvQ29tbWFuZC5jcHAKQEAgLTE5OCw4ICsxOTgsMTAgQEAKICAgICAgICAgaWYgKCZyZXMgPT0gTlVMTC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gIHNzaXplX3QgZXJyOworICAgIHN0YXR1c190IGVycjsKICAgICBzc2l6ZV90IGNvdW50ID0gMDsKICAgICBjb25zdCBhbmRyb2lkOjpWZWN0b3I8Y29uc3QgY2hhcio+JiBqYXJzID0gYnVuZGxlLT5nZXRKYXJGaWxlcygpOwogCmRpZmYgLS1naXQgYS90b29scy9hYXB0L1Jlc291cmNlLmNwcCBiL3Rvb2xzL2FhcHQvUmVzb3VyY2UuY3BwCmluZGV4IGM4YmE5MDQuLjgyMjI2MmUgMTAwNjQ0Ci0tLSBhL3Rvb2xzL2FhcHQvUmVzb3VyY2UuY3BwCisrKyBiL3Rvb2xzL2FhcHQvUmVzb3VyY2UuY3BwCkBAIC01NDIsMTEgKzU0MiwxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgRGVmYXVsdEtleWVkVmVjdG9yPEFhcHRHcm91cEVudHJ5LCBzcDxBYXB0RmlsZT4gPiBiYXNlRmlsZXMgPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXNlR3JvdXAtPmdldEZpbGVzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpPTA7IGkgPCBiYXNlRmlsZXMuc2l6ZSgpOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoImJhc2VGaWxlICVsZCBoYXMgZmxhdm9yICVzXG4iLCBpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiYmFzZUZpbGUgJWQgaGFzIGZsYXZvciAlc1xuIiwgaSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VGaWxlcy5rZXlBdChpKS50b1N0cmluZygpLnN0cmluZygpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGk9MDsgaSA8IG92ZXJsYXlGaWxlcy5zaXplKCk7IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50Zigib3ZlcmxheUZpbGUgJWxkIGhhcyBmbGF2b3IgJXNcbiIsIGksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJvdmVybGF5RmlsZSAlZCBoYXMgZmxhdm9yICVzXG4iLCBpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUZpbGVzLmtleUF0KGkpLnRvU3RyaW5nKCkuc3RyaW5nKCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CkBAIC01NjAsNyArNTYwLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5QXQob3ZlcmxheUdyb3VwSW5kZXgpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGJhc2VGaWxlSW5kZXggPCBVTktOT1dOX0VSUk9SKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJ1bmRsZS0+Z2V0VmVyYm9zZSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiZm91bmQgYSBtYXRjaCAoJWxkKSBmb3Igb3ZlcmxheSBmaWxlICVzLCBmb3IgZmxhdm9yICVzXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoImZvdW5kIGEgbWF0Y2ggKCVkKSBmb3Igb3ZlcmxheSBmaWxlICVzLCBmb3IgZmxhdm9yICVzXG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VGaWxlSW5kZXgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUdyb3VwLT5nZXRMZWFmKCkuc3RyaW5nKCksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUZpbGVzLmtleUF0KG92ZXJsYXlHcm91cEluZGV4KS50b1N0cmluZygpLnN0cmluZygpKTsKQEAgL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gICAoMiksCi0gICAgICAgIFJHQl81NjUgICAgICg0KSwKLSAgICAgICAgQVJHQl80NDQ0ICAgKDUpLAotICAgICAgICBBUkdCXzg4ODggICAoNik7Ci0KLSAgICAgICAgQ29uZmlnKGludCBuaSkgewotICAgICAgICAgICAgdGhpcy5uYXRpdmVJbnQgPSBuaTsKLSAgICAgICAgfQotICAgICAgICBmaW5hbCBpbnQgbmF0aXZlSW50OwotCi0gICAgICAgIC8qIHBhY2thZ2UgKi8gc3RhdGljIENvbmZpZyBuYXRpdmVUb0NvbmZpZyhpbnQgbmkpIHsKLSAgICAgICAgICAgIHJldHVybiBzQ29uZmlnc1tuaV07Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIHN0YXRpYyBDb25maWcgc0NvbmZpZ3NbXSA9IHsKLSAgICAgICAgICAgIG51bGwsIG51bGwsIEFMUEhBXzgsIG51bGwsIFJHQl81NjUsIEFSR0JfNDQ0NCwgQVJHQl84ODg4Ci0gICAgICAgIH07Ci0gICAgfQotCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGludCBnZXRXaWR0aCgpIHsKLSAgICAgICAgcmV0dXJuIG1JbWFnZS5nZXRXaWR0aCgpOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBpbnQgZ2V0SGVpZ2h0KCkgewotICAgICAgICByZXR1cm4gbUltYWdlLmdldEhlaWdodCgpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJldHVybnMgYW4gaW1tdXRhYmxlIGJpdG1hcCBmcm9tIHRoZSBzb3VyY2UgYml0bWFwLiBUaGUgbmV3IGJpdG1hcCBtYXkKLSAgICAgKiBiZSB0aGUgc2FtZSBvYmplY3QgYXMgc291cmNlLCBvciBhIGNvcHkgbWF5IGhhdmUgYmVlbiBtYWRlLgotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgQml0bWFwIGNyZWF0ZUJpdG1hcChCaXRtYXAgc3JjKSB7Ci0gICAgICAgIHJldHVyb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kYpCi0gICAgICogQHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gaWYgdGhlIHdpZHRoIG9yIGhlaWdodCBhcmUgPD0gMCwgb3IgaWYKLSAgICAgKiAgICAgICAgIHRoZSBjb2xvciBhcnJheSdzIGxlbmd0aCBpcyBsZXNzIHRoYW4gdGhlIG51bWJlciBvZiBwaXhlbHMuCi0gICAgICovCi0gICAgcHVibGljIHN0YXRpYyBCaXRtYXAgY3JlYXRlQml0bWFwKGludCBjb2xvcnNbXSwgaW50IG9mZnNldCwgaW50IHN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdpZHRoLCBpbnQgaGVpZ2h0LCBDb25maWcgY29uZmlnKSB7Ci0gICAgICAgIGNoZWNrV2lkdGhIZWlnaHQod2lkdGgsIGhlaWdodCk7Ci0gICAgICAgIGlmIChNYXRoLmFicyhzdHJpZGUpIDwgd2lkdGgpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImFicyhzdHJpZGUpIG11c3QgYmUgPj0gd2lkdGgiKTsKLSAgICAgICAgfQotICAgICAgICBpbnQgbGFzdFNjYW5saW5lID0gb2Zmc2V0ICsgKGhlaWdodCAtIDEpICogc3RyaWRlOwotICAgICAgICBpbnQgbGVuZ3RoID0gY29sb3JzLmxlbmd0aDsKLSAgICAgICAgaWYgKG9mZnNldCA8IDAgfHwgKG9mZnNldCArIHdpZHRoID4gbGVuZ3RoKQotICAgICAgICAgICAgfHwgbGFzdFNjYW5saW5lIDwgMAotICAgICAgICAgICAgfHwgKGxhc3RTY2FubGluZSArIHdpZHRoID4gbGVuZ3RoKSkgewotICAgICAgICAgICAgdGhyb3cgbmV3IEFycmF5SW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigpOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gVE9ETzogY3JlYXRlIGFuIGltbXV0YWJsZSBiaXRtY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AgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIEJ1ZmZlcmVkSW1hZ2UgaW1hZ2UgPSBkZWxlZ2F0ZS5tSW1hZ2U7CisKKyAgICAgICAgR3JhcGhpY3MyRCBnID0gaW1hZ2UuY3JlYXRlR3JhcGhpY3MoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChkZWxlZ2F0ZS5tSGFzQWxwaGEgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICBjb2xvciB8PSBjb2xvciAmIDB4RkYwMDAwMDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBnLnNldENvbG9yKG5ldyBqYXZhLmF3dC5Db2xvcihjb2xvcikpOworCisgICAgICAgICAgICBnLmZpbGxSZWN0KDAsIDAsIGltYWdlLmdldFdpZHRoKCksIGltYWdlLmdldEhlaWdodCgpKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGcuZGlzcG9zZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGludCBuYXRpdmVXaWR0aChpbnQgbmF0aXZlQml0bWFwKSB7CisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUgZnJvbSB0aGUgbmF0aXZlIGludC4KKyAgICAgICAgQml0bWFwX0RlbGVnYXRlIGRlbGVnYXRlID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlQml0bWFwKTsKKyAgICAgICAgaWYgKGRlbGVnYXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGRlbGVnYXRlLm1JbWFnZS5nZXRXaWR0aCgpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBpbnQgbmF0aXZlSGVpZ2h0KGludCBuYXRpdmVCaXRtYXApIHsKKyAgICAgICAgLy8gZ2V0IHRoZSBkZ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8gMjU1LmY7Ci0KLSAgICAgICAgU3R5bGUgc3R5bGUgPSBwYWludC5nZXRTdHlsZSgpOwotICAgICAgICBpZiAoc3R5bGUgPT0gU3R5bGUuU1RST0tFIHx8IHN0eWxlID09IFN0eWxlLkZJTExfQU5EX1NUUk9LRSkgewotICAgICAgICAgICAgUGF0aEVmZmVjdCBlID0gcGFpbnQuZ2V0UGF0aEVmZmVjdCgpOwotICAgICAgICAgICAgaWYgKGUgaW5zdGFuY2VvZiBEYXNoUGF0aEVmZmVjdCkgewotICAgICAgICAgICAgICAgIERhc2hQYXRoRWZmZWN0IGRwZSA9IChEYXNoUGF0aEVmZmVjdCllOwotICAgICAgICAgICAgICAgIGcuc2V0U3Ryb2tlKG5ldyBCYXNpY1N0cm9rZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldFN0cm9rZVdpZHRoKCksCi0gICAgICAgICAgICAgICAgICAgICAgICBwYWludC5nZXRTdHJva2VDYXAoKS5nZXRKYXZhQ2FwKCksCi0gICAgICAgICAgICAgICAgICAgICAgICBwYWludC5nZXRTdHJva2VKb2luKCkuZ2V0SmF2YUpvaW4oKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldFN0cm9rZU1pdGVyKCksCi0gICAgICAgICAgICAgICAgICAgICAgICBkcGUuZ2V0SW50ZXJ2YWxzKCksCi0gICAgICAgICAgICAgICAgICAgICAgICBkcGUuZ2V0UGhhc2UoKSkpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBnLnNldFN0cm9rZShuZXcgQmFzaWNTdHJva2UoCi0gICAgICAgICAgICAgICAgICAgICAgICBwYWludC5nZXRTdHJva2VXaWR0aCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQuZ2V0U3Ryb2tlQ2FwKCkuZ2V0SmF2YUNhcCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQuZ2V0U3Ryb2tlSm9pbigpLmdldEphdmFKb2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2YVBhaW50KCk7Ci0gICAgICAgICAgICBpZiAoc2hhZGVyUGFpbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGcuc2V0UGFpbnQoc2hhZGVyUGFpbnQpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAobUxvZ2dlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Mb2dnZXIud2FybmluZyhTdHJpbmcuZm9ybWF0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTaGFkZXIgJyUxJHMnIGlzIG5vdCBzdXBwb3J0ZWQgaW4gdGhlIExheW91dCBFZGl0b3IuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFkZXIuZ2V0Q2xhc3MoKS5nZXRDYW5vbmljYWxOYW1lKCkpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gZzsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQgc2V0TW9kZUluR3JhcGhpY3MoUG9ydGVyRHVmZi5Nb2RlIG1vZGUsIEdyYXBoaWNzMkQgZywgZmxvYXQgZmFscGhhKSB7Ci0gICAgICAgIHN3aXRjaCAobW9kZSkgewotICAgICAgICAgICAgY2FzZSBDTEVBUjoKLSAgICAgICAgICAgICAgICBnLnNldENvbXBvc2l0ZShBbHBoYUNvbXBvc2l0ZS5nZXRJbnN0YW5jZShBbHBoYUNvbXBvc2l0ZS5DTEVBUiwgZmFscGhhKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIERBUktFTjoKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgRFNUOgotICAgICAgICAgICAgICAgIGcuc2V0Q29tcG9zaXRlKEFscGhhQ29tcG9zaXRlLmdldEluc3RhbmNlKEFscGhhQ29tcG9zaXRlLkRTVCwgZmFscGhhKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIERTVF9BVE9QOgotICAgICAgICAgICAgICAgIGcuc2V0Q29tcG9zaXRlKEFscGhhQ29tcG9zaXRlLmdldEluc3RhbmNlKEFscGhhQ29tcG9zaXRlLkRTVF9BVE9QLCBmYWxwaGEpKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgRFNUX0lOOgotICAgICAgICAgICAgICAgIGcuc2V0Q29tcG9zaXRlKEFscGhhQ29tcG9zaXRlLmdldEluc3RhbmNlKEFscGhhQ29tcG9zaXRlLkRTVF9JTiwgZmFscGhhKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIERTVF9PVVQ6Ci0gICAgICAgICAgICAgICAgZy5zZXRDb21wb3NpdGUoQWxwaGFDb21wb3NpdGUuZ2V0SW5zdGFuY2UoQWxwaGFDb21wb3NpdGUuRFNUX09VVCwgZmFscGhhKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIERTVF9PVkVSOgotICAgICAgICAgICAgICAgIGcuc2V0Q29tcG9zaXRlKEFscGhhQ29tcG9zaXRlLmdldEluc3RhbmNlKEFscGhhQ29tcG9zaXRlLkRTVF9PVkVSLCBmYWxwaGEpKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTElHSFRFTjoKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTVVMVElQTFk6Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIFNDUkVFTjoKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgU1JDOgotICAgICAgICAgICAgICAgIGcuc2V0Q29tcG9zaXRlKEFscGhhQ29tcG9zaXRlLmdldEluc3RhbmNlKEFscGhhQ29tcG9zaXRlLlNSQywgZmFscGhh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AgICAgICAgICAgICAgIFJlbmRlcmluZ0hpbnRzLlZBTFVFX0lOVEVSUE9MQVRJT05fQklMSU5FQVIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocGFpbnQuZ2V0QWxwaGEoKSAhPSAweEZGKSB7Ci0gICAgICAgICAgICAgICAgYyA9IGcuZ2V0Q29tcG9zaXRlKCk7Ci0gICAgICAgICAgICAgICAgZy5zZXRDb21wb3NpdGUoQWxwaGFDb21wb3NpdGUuZ2V0SW5zdGFuY2UoQWxwaGFDb21wb3NpdGUuU1JDX09WRVIsCi0gICAgICAgICAgICAgICAgICAgICAgICBwYWludC5nZXRBbHBoYSgpLzI1NS5mKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBnLmRyYXdJbWFnZShpbWFnZSwgZGxlZnQsIGR0b3AsIGRyaWdodCwgZGJvdHRvbSwKLSAgICAgICAgICAgICAgICBzbGVmdCwgc3RvcCwgc3JpZ2h0LCBzYm90dG9tLCBudWxsKTsKLQotICAgICAgICBpZiAocGFpbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgaWYgKHBhaW50LmlzRmlsdGVyQml0bWFwKCkpIHsKLSAgICAgICAgICAgICAgICBnLmRpc3Bvc2UoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBnLnNldENvbXBvc2l0ZShjKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIChub24tSmF2YWRvYykKLSAgICAgKiBAc2VlIGFuZHJvaWQuZ3JhcGhpY3MuQ2FudmFzI3JvdGF0ZShmbG9hdCwgZmxvYXQsIGZsb2F0KQotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIHJvdGF0ZShmbG9hdCBkZWdyZWVzLCBmbG9hdCBweCwgZmxvYXQgcHkpIHsKLSAgICAgICAgaWYgKGRlZ3JlZXM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CA9IGluZGV4ICsgY291bnQ7Ci0gICAgICAgICAgICAgICAgd2hpbGUgKGkgPCBsYXN0SW5kZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gYWx3YXlzIHN0YXJ0IHdpdGggdGhlIG1haW4gZm9udC4KLSAgICAgICAgICAgICAgICAgICAgaW50IHVwVG8gPSBtYWluRm9udC5tRm9udC5jYW5EaXNwbGF5VXBUbyh0ZXh0LCBpLCBsYXN0SW5kZXgpOwotICAgICAgICAgICAgICAgICAgICBpZiAodXBUbyA9PSAtMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gZHJhdyBhbGwgdGhlIHJlc3QgYW5kIGV4aXQuCi0gICAgICAgICAgICAgICAgICAgICAgICBnLnNldEZvbnQobWFpbkZvbnQubUZvbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgZy5kcmF3Q2hhcnModGV4dCwgaSwgbGFzdEluZGV4IC0gaSwgKGludCl4LCAoaW50KXkpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHVwVG8gPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBkcmF3IHdoYXQncyBwb3NzaWJsZQotICAgICAgICAgICAgICAgICAgICAgICAgZy5zZXRGb250KG1haW5Gb250Lm1Gb250KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGcuZHJhd0NoYXJzKHRleHQsIGksIHVwVG8gLSBpLCAoaW50KXgsIChpbnQpeSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbXB1dGUgdGhlIHdpZHRoIHRoYXQgd2FzIGRyYXduIHRvIGluY3JlYXNlIHgKLSAgICAgICAgICAgICAgICAgICAgICAgIHggKz0gbWFpbkZvbnQubU1ldHJpY3MuY2hhcnNXaWR0aCh0ZXh0LCBpLCB1cFRvIC0gaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1vdmUgaW5kZXggdG8gdGhlIGZpcnN0IG5vbiBkaXNwbGF5ZWQgY2hhci4KLSAgICAgICAgICAgICAgICAgICAgICAgIGkgPSB1cFRvOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCBjYWxsIGNvbnRpbnVlIGF0IHRoaXMgcG9pbnQuIFNpbmNlIGl0IGlzIGNlcnRhaW4gdGhlIG1haW4gZm9udAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2Fubm90IGRpc3BsYXkgdGhlIGZvbnQgYSBpbmRleCB1cFRvIChub3cgPT1pKSwgd2UgbW92ZSBvbiB0byB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZhbGxiYWNrIGZvbnRzIGRpcmVjdGx5LgotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gbm8gY2hhciBzdXBwb3J0ZWQsIGF0dGVtcHQgdG8gcmVhZCB0aGUgbmV4dCBjaGFyKHMpIHdpdGggdGhlCi0gICAgICAgICAgICAgICAgICAgIC8vIGZhbGxiYWNrIGZvbnQuIEluIHRoaXMgY2FzZSB3ZSBvbmx5IHRlc3QgdGhlIGZpcnN0IGNoYXJhY3RlcgotICAgICAgICAgICAgICAgICAgICAvLyBhbmQgdGhlbiBnbyBiYWNrIHRvIHRlc3Qgd2l0aCB0aGUgbWFpbiBmb250LgotICAgICAgICAgICAgICAgICAgICAvLyBTcGVjaWFsIHRlc3QgZm9yIDItY2hhciBjaGFyYWN0ZXJzLgotICAgICAgICAgICAgICAgICAgICBib29sZWFuIGZvdW5kRm9udCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBmID0gMSA7IGYgPCBmb250cy5zaXplKCkgOyBmKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEZvbnRJbmZvIGZvbnRJbmZvID0gZm9udHMuZ2V0KGYpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBuZWVkIHRvIGNoZWNrIHRoYXQgdGhlIGZvbnQgY2FuIGRpc3BsYXkgdGhlIGNoYXJhY3Rlci4gV2UgdGVzdAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGlmZmVyZW50bHkgaWYgdGhlIGNoYXIgaXMgYSBoaWdoIHN1cnJvZ2F0ZS4KLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFyQ291bnQgPSBDaGFyYWN0ZXIuaXNIaWdoU3Vycm9nYXRlKHRleHRbaV0pID8gMiA6IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICB1cFRvID0gZm9udEluZm8ubUZvbnQuY2FuRGlzcGxheVVwVG8odGV4dCwgaSwgaSArIGNoYXJDb3VudCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXBUbyA9PSAtMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRyYXcgdGhhdCBjaGFyCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZy5zZXRGb250KGZvbnRJbmZvLm1Gb250KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBnLmRyYXdDaGFycyh0ZXh0LCBpLCBjaGFyQ291bnQsIChpbnQpeCwgKGludCl5KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSB4Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgeCArPSBmb250SW5mby5tTWV0cmljcy5jaGFyc1dpZHRoKHRleHQsIGksIGNoYXJDb3VudCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGluZGV4IGluIHRoZSB0ZXh0LCBhbmQgbW92ZSBvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgKz0gY2hhckNvdW50OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kRm9udCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIC8vIGluIGNhc2Ugbm8gZm9udCBjYW4gZGlzcGxheSB0aGUgY2hhciwgZGlzcGxheSBpdCB3aXRoIHRoZSBtYWluIGZvbnQuCi0gICAgICAgICAgICAgICAgICAgIC8vIChpdCdsbCBwdXQgYSBzcXVhcmUgcHJvYmFibHkpCi0gICAgICAgICAgICAgICAgICAgIGlmIChmb3VuZEZvbnQgPT0gZmFsc2UpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFyQ291bnQgPSBDaGFyYWN0ZXIuaXNIaWdoU3Vycm9nYXRlKHRleHRbaV0pID8gMiA6IDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGcuc2V0Rm9udChtYWluRm9udC5tRm9udCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBnLmRyYXdDaGFycyh0ZXh0LCBpLCBjaGFyQ291bnQsIChpbnQpeCwgKGludCl5KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWVhc3VyZSBpdCB0byBhZHZhbmNlIHgKLSAgICAgICAgICAgICAgICAgICAgICAgIHggKz0gbWFpbkZvbnQubU1ldHJpY3MuY2hhcnNXaWR0aCh0ZXh0LCBpLCBjaGFyQ291bnQpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBhbmQgbW92ZSB0byB0aGUgbmV4dCBjaGFycy4KLSAgICAgICAgICAgICAgICAgICAgICAgIGkgKz0gY2hhckNvdW50OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgZy5kaXNwb3NlKCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiAobm9uLUphdmFkb2MpCi0gICAgICogQHNlZSBhbmRyb2lkLmdyYXBoaWNzLkNhbnZhcyNkcmF3VGV4dChqYXZhLmxhbmcuQ2hhclNlcXVlbmNlL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FudmFzLm1OYXRpdmVDYW52YXMpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIG5hdGl2ZSBkZWxlZ2F0ZSBhc3NvY2lhdGVkIHRvIGEgZ2l2ZW4gYW4gaW50IHJlZmVyZW5jaW5nIGEge0BsaW5rIENhbnZhc30gb2JqZWN0LgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgQ2FudmFzX0RlbGVnYXRlIGdldERlbGVnYXRlKGludCBuYXRpdmVfY2FudmFzKSB7CisgICAgICAgIHJldHVybiBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfY2FudmFzKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXRzIHRoZSBsYXlvdXRsaWIgbG9nZ2VyIGludG8gdGhlIGNhbnZhcy4KKyAgICAgKiBAcGFyYW0gbG9nZ2VyCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0TG9nZ2VyKElMYXlvdXRMb2cgbG9nZ2VyKSB7CisgICAgICAgIG1Mb2dnZXIgPSBsb2dnZXI7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCB7QGxpbmsgR3JhcGhpY3MyRH0gdXNlZCB0byBkcmF3LgorICAgICAqLworICAgIHB1YmxpYyBHcmFwaGljczJEIGdldEdyYXBoaWNzMmQoKSB7CisgICAgICAgIHJldHVybiBtR3JhcGhpY3NTdGFjay5wZWVrKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogRGlzcG9zZXMgb2YgdGhlIHtAbGluayBHcmFwaGljczJEfSBzdGFjay4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBkaXNwb3NlKCkgeworCisgICAgfQorCisgICAgLy8gLS0tLSBuYXRpdmUgbWV0aG9kcyAtLS0tCisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgYm9vbGVhbiBpc09wYXF1ZShDYW52YXMgdGhpc0NhbnZhcykgeworICAgICAgICAvLyBGSVhNRQorIC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YXQgdG9wLCBmbG9hdCByaWdodCwKKyAgICAgICAgICAgIGZsb2F0IGJvdHRvbSkgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIENhbnZhc19EZWxlZ2F0ZSBjYW52YXNEZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKHRoaXNDYW52YXMubU5hdGl2ZUNhbnZhcyk7CisgICAgICAgIGlmIChjYW52YXNEZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBjYW52YXNEZWxlZ2F0ZS5nZXRHcmFwaGljczJkKCkuY2xpcFJlY3QoKGludClsZWZ0LCAoaW50KXRvcCwgKGludCkocmlnaHQtbGVmdCksCisgICAgICAgICAgICAgICAgKGludCkoYm90dG9tLXRvcCkpOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgYm9vbGVhbiBjbGlwUmVjdChDYW52YXMgdGhpc0NhbnZhcywgaW50IGxlZnQsIGludCB0b3AsIGludCByaWdodCwKKyAgICAgICAgICAgIGludCBib3R0b20pIHsKKyAgICAgICAgLy8gZ2V0IHRoZSBkZWxlZ2F0ZSBmcm9tIHRoZSBuYXRpdmUgaW50LgorICAgICAgICBDYW52YXNfRGVsZWdhdGUgY2FudmFzRGVsZWdhdGUgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZSh0aGlzQ2FudmFzLm1OYXRpdmVDYW52YXMpOworICAgICAgICBpZiAoY2FudmFzRGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgY2FudmFzRGVsZWdhdGUuZ2V0R3JhcGhpY3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ShmbGFncykKKyAgICAgICAgcmV0dXJuIHNhdmUodGhpc0NhbnZhcyk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgcmVzdG9yZShDYW52YXMgdGhpc0NhbnZhcykgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIENhbnZhc19EZWxlZ2F0ZSBjYW52YXNEZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKHRoaXNDYW52YXMubU5hdGl2ZUNhbnZhcyk7CisgICAgICAgIGlmIChjYW52YXNEZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBjYW52YXNEZWxlZ2F0ZS5tR3JhcGhpY3NTdGFjay5wb3AoKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgaW50IGdldFNhdmVDb3VudChDYW52YXMgdGhpc0NhbnZhcykgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIENhbnZhc19EZWxlZ2F0ZSBjYW52YXNEZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKHRoaXNDYW52YXMubU5hdGl2ZUNhbnZhcyk7CisgICAgICAgIGlmIChjYW52YXNEZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBjYW52YXNEZWxlZ2F0ZS5tR3JhcGhpY3NTdGFjay5zaXplKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgcmVzdG9yZVRvQ291bnQoQ2FudmFzIHRoaXNDYW52YXMsIGludCBzYXZlQ291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BpbnQgY291bnQsCisgICAgICAgICAgICBQYWludCBwYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBmcmVlQ2FjaGVzKCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgaW50IGluaXRSYXN0ZXIoaW50IG5hdGl2ZUJpdG1hcE9yWmVybykgeworICAgICAgICBpZiAobmF0aXZlQml0bWFwT3JaZXJvID4gMCkgeworICAgICAgICAgICAgLy8gZ2V0IHRoZSBCaXRtYXAgZnJvbSB0aGUgaW50CisgICAgICAgICAgICBCaXRtYXBfRGVsZWdhdGUgYml0bWFwRGVsZWdhdGUgPSBCaXRtYXBfRGVsZWdhdGUuZ2V0RGVsZWdhdGUobmF0aXZlQml0bWFwT3JaZXJvKTsKKworICAgICAgICAgICAgLy8gY3JlYXRlIGEgbmV3IENhbnZhc19EZWxlZ2F0ZSB3aXRoIHRoZSBnaXZlbiBiaXRtYXAgYW5kIHJldHVybiBpdHMgbmV3IG5hdGl2ZSBpbnQuCisgICAgICAgICAgICBDYW52YXNfRGVsZWdhdGUgbmV3RGVsZWdhdGUgPSBuZXcgQ2FudmFzX0RlbGVnYXRlKGJpdG1hcERlbGVnYXRlLmdldEltYWdlKCkpOworCisgICAgICAgICAgICByZXR1cm4gc01hbmFnZXIuYWRkRGVsZWdhdGUobmV3RGVsZWdhdGUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gY3JlYXRlIGEgbmV3IENhbnZhc19EZWxlZ2F0ZSBhbmQgcmV0dXJuIGl0cyBuZXcgbmF0aXZlIGludC4KKyAgICAgICAgICAgIENhbnZhc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gICAgICAgICAgICAgICAgIGludCBwYWludCwgaW50IGxheWVyRmxhZ3MpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGludCBuYXRpdmVfc2F2ZUxheWVyKGludCBuYXRpdmVDYW52YXMsIGZsb2F0IGwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHQsIGZsb2F0IHIsIGZsb2F0IGIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwYWludCwgaW50IGxheWVyRmxhZ3MpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGludCBuYXRpdmVfc2F2ZUxheWVyQWxwaGEoaW50IG5hdGl2ZUNhbnZhcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWN0RiBib3VuZHMsIGludCBhbHBoYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGF5ZXJGbGFncykgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgaW50IG5hdGl2ZV9zYXZlTGF5ZXJBbHBoYShpbnQgbmF0aXZlQ2FudmFzLCBmbG9hdCBsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHQsIGZsb2F0IHIsIGZsb2F0IGIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGFscGhhLCBpbnQgbGF5ZXJGbGFncykgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9jb25jYXQoaW50IG5DYW52YXMsIGludCBuTWF0cml4KSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9zZXRNYXRyaXgoaW50IG5DYW52YXMsIGludCBuTWF0cml4KSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9jbGlwUmVjdChpbnQgbkNhbnZhcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgbGVmdCwgZmxvYXQgdG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCByaWdodCwgZmxvYXQgYm90dG9tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcmVnaW9uT3ApIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX2NsaXBQYXRoKGludCBuYXRpdmVDYW52YXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBuYXRpdmVQYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcmVnaW9uT3ApIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX2NsaXBSZWdpb24oaW50IG5hdGl2ZUNhbnZhcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmF0aXZlUmVnaW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCByZWdpb25PcCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVTZXREcmF3RmlsdGVyKGludCBuYXRpdmVDYW52YXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmF0aXZlRmlsdGVyKSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9nZXRDbGlwQm91bmRzKGludCBuYXRpdmVDYW52YXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVjdCBib3VuZHMpIHsKKyAgICAgICAgLy8gZ2V0IHRoZSBkZWxlZ2F0ZSBmcm9tIHRoZSBuYXRpdmUgaW50LgorICAgICAgICBDYW52YXNfRGVsZWdhdGUgY2FudmFzRGVsZWdhdGUgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVDYW52YXMpOworICAgICAgICBpZiAoY2FudmFzRGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgUmVjdGFuZ2xlIHJlY3QgPSBjYW52YXNEZWxlZ2F0ZS5nZXRHcmFwaGljczJkKCkuZ2V0Q2xpcEJvdW5kcygpOworICAgICAgICBpZiAocmVjdCAhPSBudWxsKSB7CisgICAgICAgICAgICBib3VuZHMubGVmdCA9IHJlY3QueDsKKyAgICAgICAgICAgIGJvdW5kcy50b3AgPSByZWN0Lnk7CisgICAgICAgICAgICBib3VuZHMucmlnaHQgPSByZWN0LnggKyByZWN0LndpZHRoOworICAgICAgICAgICAgYm91bmRzLmJvdHRvbSA9IHJlY3QueSArIHJlY3QuaGVpZ2h0OworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9nZXRDVE0oaW50IGNhbnZhcywgaW50IG1hdHJpeCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgYm9vbGVhbiBuYXRpdmVfcXVpY2tSZWplY3QoaW50IG5hdGl2ZUNhbnZhcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVjdEYgcmVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG5hdGl2ZV9lZGdlVHlwZSkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX3F1aWNrUmVqZWN0KGludCBuYXRpdmVDYW52YXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmF0aXZlX2VkZ2VUeXBlKSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgYm9vbGVhbiBuYXRpdmVfcXVpY2tSZWplY3QoaW50IG5hdGl2ZUNhbnZhcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgbGVmdCwgZmxvYXQgdG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCByaWdodCwgZmxvYXQgYm90dG9tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmF0aXZlX2VkZ2VUeXBlKSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfZHJhd1JHQihpbnQgbmF0aXZlQ2FudmFzLCBpbnQgciwgaW50IGcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGIpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX2RyYXdBUkdCKGludCBuYXRpdmVDYW52YXMsIGludCBhLCBpbnQgciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGcsIGludCBiKSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9kcmF3Q29sb3IoaW50IG5hdGl2ZUNhbnZhcywgaW50IGNvbG9yKSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9kcmF3Q29sb3IoaW50IG5hdGl2ZUNhbnZhcywgaW50IGNvbG9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG1vZGUpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX2RyYXdQYWludChpbnQgbmF0aXZlQ2FudmFzLCBpbnQgcGFpbnQpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX2RyYXdMaW5lKGludCBuYXRpdmVDYW52YXMsIGZsb2F0IHN0YXJ0WCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgc3RhcnRZLCBmbG9hdCBzdG9wWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgc3RvcFksIGludCBwYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfZHJhd1JlY3QoaW50IG5hdGl2ZUNhbnZhcywgUmVjdEYgcmVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBhaW50KSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9kcmF3UmVjdChpbnQgbmF0aXZlQ2FudmFzLCBmbG9hdCBsZWZ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB0b3AsIGZsb2F0IHJpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBib3R0b20sIGludCBwYWludCkgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIENhbnZhc19EZWxlZ2F0ZSBjYW52YXNEZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZUNhbnZhcyk7CisgICAgICAgIGlmIChjYW52YXNEZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIFBhaW50X0RlbGVnYXRlIHBhaW50RGVsZWdhdGUgPSBQYWludF9EZWxlZ2F0ZS5nZXREZWxlZ2F0ZShwYWludCk7CisgICAgICAgIGlmIChwYWludERlbGVnYXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChyaWdodCA+IGxlZnQgJiYgYm90dG9tID4gdG9wKSB7CisgICAgICAgICAgICAvLyBnZXQgYSBHcmFwaGljczJEIG9iamVjdCBjb25maWd1cmVkIHdpdGggdGhlIGRyYXdpbmcgcGFyYW1ldGVycy4KKyAgICAgICAgICAgIEdyYXBoaWNzMkQgZyA9IGNhbnZhc0RlbGVnYXRlLmdldEN1c3RvbUdyYXBoaWNzKHBhaW50RGVsZWdhdGUpOworCisgICAgICAgICAgICBpbnQgc3R5bGUgPSBwYWludERlbGVnYXRlLmdldFN0eWxlKCk7CisKKyAgICAgICAgICAgIC8vIGRyYXcKKyAgICAgICAgICAgIGlmIChzdHlsZSA9PSBQYWludC5TdHlsZS5GSUxMLm5hdGl2ZUludCB8fAorICAgICAgICAgICAgICAgICAgICBzdHlsZSA9PSBQYWludC5TdHlsZS5GSUxMX0FORF9TVFJPS0UubmF0aXZlSW50KSB7CisgICAgICAgICAgICAgICAgZy5maWxsUmVjdCgoaW50KWxlZnQsIChpbnQpdG9wLCAoaW50KShyaWdodC1sZWZ0KSwgKGludCkoYm90dG9tLXRvcCkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoc3R5bGUgPT0gUGFpbnQuU3R5bGUuU1RST0tFLm5hdGl2ZUludCB8fAorICAgICAgICAgICAgICAgICAgICBzdHlsZSA9PSBQYWludC5TdHlsZS5GSUxMX0FORF9TVFJPS0UubmF0aXZlSW50KSB7CisgICAgICAgICAgICAgICAgZy5kcmF3UmVjdCgoaW50KWxlZnQsIChpbnQpdG9wLCAoaW50KShyaWdodC1sZWZ0KSwgKGludCkoYm90dG9tLXRvcCkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBkaXNwb3NlIEdyYXBoaWNzMkQgb2JqZWN0CisgICAgICAgICAgICBnLmRpc3Bvc2UoKTsKKyAgICAgICAgfQorCisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX2RyYXdPdmFsKGludCBuYXRpdmVDYW52YXMsIFJlY3RGIG92YWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfZHJhd0NpcmNsZShpbnQgbmF0aXZlQ2FudmFzLCBmbG9hdCBjeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBjeSwgZmxvYXQgcmFkaXVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfZHJhd0FyYyhpbnQgbmF0aXZlQ2FudmFzLCBSZWN0RiBvdmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHN0YXJ0QW5nbGUsIGZsb2F0IHN3ZWVwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gdXNlQ2VudGVyLCBpbnQgcGFpbnQpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX2RyYXdSb3VuZFJlY3QoaW50IG5hdGl2ZUNhbnZhcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWN0RiByZWN0LCBmbG9hdCByeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCByeSwgaW50IHBhaW50KSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9kcmF3UGF0aChpbnQgbmF0aXZlQ2FudmFzLCBpbnQgcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBhaW50KSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9kcmF3Qml0bWFwKENhbnZhcyB0aGlzQ2FudmFzLCBpbnQgbmF0aXZlQ2FudmFzLCBpbnQgYml0bWFwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGxlZnQsIGZsb2F0IHRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmF0aXZlUGFpbnRPclplcm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNhbnZhc0RlbnNpdHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNjcmVlbkRlbnNpdHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGJpdG1hcERlbnNpdHkpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX2RyYXdCaXRtYXAoQ2FudmFzIHRoaXNDYW52YXMsIGludCBuYXRpdmVDYW52YXMsIGludCBiaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVjdCBzcmMsIFJlY3RGIGRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmF0aXZlUGFpbnRPclplcm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNjcmVlbkRlbnNpdHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGJpdG1hcERlbnNpdHkpIHsKKyAgICAgICAgLy8gZ2V0IHRoZSBkZWxlZ2F0ZSBmcm9tIHRoZSBuYXRpdmUgaW50LgorICAgICAgICBCaXRtYXBfRGVsZWdhdGUgYml0bWFwRGVsZWdhdGUgPSBCaXRtYXBfRGVsZWdhdGUuZ2V0RGVsZWdhdGUoYml0bWFwKTsKKyAgICAgICAgaWYgKGJpdG1hcERlbGVnYXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIEJ1ZmZlcmVkSW1hZ2UgaW1hZ2UgPSBiaXRtYXBEZWxlZ2F0ZS5nZXRJbWFnZSgpOworCisgICAgICAgIGlmIChzcmMgPT0gbnVsbCkgeworICAgICAgICAgICAgZHJhd0JpdG1hcChuYXRpdmVDYW52YXMsIGltYWdlLCBuYXRpdmVQYWludE9yWmVybywKKyAgICAgICAgICAgICAgICAgICAgMCwgMCwgaW1hZ2UuZ2V0V2lkdGgoKSwgaW1hZ2UuZ2V0SGVpZ2h0KCksCisgICAgICAgICAgICAgICAgICAgIChpbnQpZHN0LmxlZnQsIChpbnQpZHN0LnRvcCwgKGludClkc3QucmlnaHQsIChpbnQpZHN0LmJvdHRvbSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBkcmF3Qml0bWFwKG5hdGl2ZUNhbnZhcywgaW1hZ2UsIG5hdGl2ZVBhaW50T3JaZXJvLAorICAgICAgICAgICAgICAgICAgICBzcmMubGVmdCwgc3JjLnRvcCwgc3JjLndpZHRoKCksIHNyYy5oZWlnaHQoKSwKKyAgICAgICAgICAgICAgICAgICAgKGludClkc3QubGVmdCwgKGludClkc3QudG9wLCAoaW50KWRzdC5yaWdodCwgKGludClkc3QuYm90dG9tKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9kcmF3Qml0bWFwKGludCBuYXRpdmVDYW52YXMsIGludCBiaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVjdCBzcmMsIFJlY3QgZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBuYXRpdmVQYWludE9yWmVybywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2NyZWVuRGVuc2l0eSwKKyAgICAgICAgICAgICAgICAgICAg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gbmF0aXZlQ2FudmFzLCBpbnRbXSBjb2xvcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgb2Zmc2V0LCBpbnQgc3RyaWRlLCBmbG9hdCB4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHksIGludCB3aWR0aCwgaW50IGhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGhhc0FscGhhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBuYXRpdmVQYWludE9yWmVybykgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVEcmF3Qml0bWFwTWF0cml4KGludCBuQ2FudmFzLCBpbnQgbkJpdG1hcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBuTWF0cml4LCBpbnQgblBhaW50KSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZURyYXdCaXRtYXBNZXNoKGludCBuQ2FudmFzLCBpbnQgbkJpdG1hcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbWVzaFdpZHRoLCBpbnQgbWVzaEhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdFtdIHZlcnRzLCBpbnQgdmVydE9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRbXSBjb2xvcnMsIGludCBjb2xvck9mZnNldCwgaW50IG5QYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVEcmF3VmVydGljZXMoaW50IG5DYW52YXMsIGludCBtb2RlLCBpbnQgbiwKKyAgICAgICAgICAgICAgICAgICBmbG9hdFtdIHZlcnRzLCBpbnQgdmVydE9mZnNldCwgZmxvYXRbXSB0ZXhzLCBpbnQgdGV4T2Zmc2V0LAorICAgICAgICAgICAgICAgICAgIGludFtdIGNvbG9ycywgaW50IGNvbG9yT2Zmc2V0LCBzaG9ydFtdIGluZGljZXMsCisgICAgICAgICAgICAgICAgICAgaW50IGluZGV4T2Zmc2V0LCBpbnQgaW5kZXhDb3VudCwgaW50IG5QYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9kcmF3VGV4dChpbnQgbmF0aXZlQ2FudmFzLCBjaGFyW10gdGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4LCBpbnQgY291bnQsIGZsb2F0IHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHksIGludCBmbGFncywgaW50IHBhaW50KSB7CisgICAgICAgIC8vIFdBUk5JTkc6IHRoZSBsb2dpYyBpbiB0aGlzIG1ldGhvZCBpcyBzaW1pbGFyIHRvIFBhaW50Lm1lYXN1cmVUZXh0LgorICAgICA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isgICAgICAgIGcuc2V0Q29sb3IobmV3IENvbG9yKHBhaW50RGVsZWdhdGUuZ2V0Q29sb3IoKSkpOworICAgICAgICBpbnQgYWxwaGEgPSBwYWludERlbGVnYXRlLmdldEFscGhhKCk7CisgICAgICAgIGZsb2F0IGZhbHBoYSA9IGFscGhhIC8gMjU1LmY7CisgICAgICAgIGcuc2V0Q29tcG9zaXRlKEFscGhhQ29tcG9zaXRlLmdldEluc3RhbmNlKEFscGhhQ29tcG9zaXRlLlNSQ19PVkVSLCBmYWxwaGEpKTsKKworCisgICAgICAgIC8vIFBhaW50LlRleHRBbGlnbiBpbmRpY2F0ZXMgaG93IHRoZSB0ZXh0IGlzIHBvc2l0aW9uZWQgcmVsYXRpdmUgdG8gWC4KKyAgICAgICAgLy8gTEVGVCBpcyB0aGUgZGVmYXVsdCBhbmQgdGhlcmUncyBub3RoaW5nIHRvIGRvLgorICAgICAgICBpZiAocGFpbnREZWxlZ2F0ZS5nZXRUZXh0QWxpZ24oKSAhPSBQYWludC5BbGlnbi5MRUZULm5hdGl2ZUludCkgeworICAgICAgICAgICAgZmxvYXQgbSA9IHBhaW50RGVsZWdhdGUubWVhc3VyZVRleHQodGV4dCwgaW5kZXgsIGNvdW50KTsKKyAgICAgICAgICAgIGlmIChwYWludERlbGVnYXRlLmdldFRleHRBbGlnbigpID09IFBhaW50LkFsaWduLkNFTlRFUi5uYXRpdmVJbnQpIHsKKyAgICAgICAgICAgICAgICB4IC09IG0gLyAyOworICAgICAgICAgICAgfSBlbHNlIGlmIChwYWludERlbGVnYXRlLmdldFRleHRBbGlnbigpID09IFBhaW50LkFsaWduLlJJR0hULm5hdGl2ZUludCkgeworICAgICAgICAgICAgICAgIHggLT0gbTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIExpc3Q8Rm9udEluZm8+IGZvbnRzID0gcGFpbnREZWxlZ2F0ZS5nZXRGb250cygpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKGZvbnRzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgICAgICBGb250SW5mbyBtYWluRm9udCA9IGZvbnRzLmdldCgwKTsKKyAgICAgICAgICAgICAgICBpbnQgaSA9IGluZGV4OworICAgICAgICAgICAgICAgIGludCBsYXN0SW5kZXggPSBpbmRleCArIGNvdW50OworICAgICAgICAgICAgICAgIHdoaWxlIChpIDwgbGFzdEluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGFsd2F5cyBzdGFydCB3aXRoIHRoZSBtYWluIGZvbnQuCisgICAgICAgICAgICAgICAgICAgIGludCB1cFRvID0gbWFpbkZvbnQubUZvbnQuY2FuRGlzcGxheVVwVG8odGV4dCwgaSwgbGFzdEluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHVwVG8gPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRyYXcgYWxsIHRoZSByZXN0IGFuZCBleGl0LgorICAgICAgICAgICAgICAgICAgICAgICAgZy5zZXRGb250KG1haW5Gb250Lm1Gb250KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGcuZHJhd0NoYXJzKHRleHQsIGksIGxhc3RJbmRleCAtIGksIChpbnQpeCwgKGludCl5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cFRvID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gZHJhdyB3aGF0J3MgcG9zc2libGUKKyAgICAgICAgICAgICAgICAgICAgICAgIGcuc2V0Rm9udChtYWluRm9udC5tRm9udCk7CisgICAgICAgICAgICAgICAgICAgICAgICBnLmRyYXdDaGFycyh0ZXh0LCBpLCB1cFRvIC0gaSwgKGludCl4LCAoaW50KXkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb21wdXRlIHRoZSB3aWR0aCB0aGF0IHdhcyBkcmF3biB0byBpbmNyZWFzZSB4CisgICAgICAgICAgICAgICAgICAgICAgICB4ICs9IG1haW5Gb250Lm1NZXRyaWNzLmNoYXJzV2lkdGgodGV4dCwgaSwgdXBUbyAtIGkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBtb3ZlIGluZGV4IHRvIHRoZSBmaXJzdCBub24gZGlzcGxheWVkIGNoYXIuCisgICAgICAgICAgICAgICAgICAgICAgICBpID0gdXBUbzsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgY2FsbCBjb250aW51ZSBhdCB0aGlzIHBvaW50LiBTaW5jZSBpdCBpcyBjZXJ0YWluIHRoZSBtYWluIGZvbnQKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbm5vdCBkaXNwbGF5IHRoZSBmb250IGEgaW5kZXggdXBUbyAobm93ID09aSksIHdlIG1vdmUgb24gdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWxsYmFjayBmb250cyBkaXJlY3RseS4KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIG5vIGNoYXIgc3VwcG9ydGVkLCBhdHRlbXB0IHRvIHJlYWQgdGhlIG5leHQgY2hhcihzKSB3aXRoIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBmYWxsYmFjayBmb250LiBJbiB0aGlzIGNhc2Ugd2Ugb25seSB0ZXN0IHRoZSBmaXJzdCBjaGFyYWN0ZXIKKyAgICAgICAgICAgICAgICAgICAgLy8gYW5kIHRoZW4gZ28gYmFjayB0byB0ZXN0IHdpdGggdGhlIG1haW4gZm9udC4KKyAgICAgICAgICAgICAgICAgICAgLy8gU3BlY2lhbCB0ZXN0IGZvciAyLWNoYXIgY2hhcmFjdGVycy4KKyAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBmb3VuZEZvbnQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgZiA9IDEgOyBmIDwgZm9udHMuc2l6ZSgpIDsgZisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBGb250SW5mbyBmb250SW5mbyA9IGZvbnRzLmdldChmKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gbmVlZCB0byBjaGVjayB0aGF0IHRoZSBmb250IGNhbiBkaXNwbGF5IHRoZSBjaGFyYWN0ZXIuIFdlIHRlc3QKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRpZmZlcmVudGx5IGlmIHRoZSBjaGFyIGlzIGEgaGlnaCBzdXJyb2dhdGUuCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY2hhckNvdW50ID0gQ2hhcmFjdGVyLmlzSGlnaFN1cnJvZ2F0ZSh0ZXh0W2ldKSA/IDIgOiAxOworICAgICAgICAgICAgICAgICAgICAgICAgdXBUbyA9IGZvbnRJbmZvLm1Gb250LmNhbkRpc3BsYXlVcFRvKHRleHQsIGksIGkgKyBjaGFyQ291bnQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVwVG8gPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkcmF3IHRoYXQgY2hhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcuc2V0Rm9udChmb250SW5mby5tRm9udCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZy5kcmF3Q2hhcnModGV4dCwgaSwgY2hhckNvdW50LCAoaW50KXgsIChpbnQpeSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cGRhdGUgeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggKz0gZm9udEluZm8ubU1ldHJpY3MuY2hhcnNXaWR0aCh0ZXh0LCBpLCBjaGFyQ291bnQpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXBkYXRlIHRoZSBpbmRleCBpbiB0aGUgdGV4dCwgYW5kIG1vdmUgb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpICs9IGNoYXJDb3VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZEZvbnQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBpbiBjYXNlIG5vIGZvbnQgY2FuIGRpc3BsYXkgdGhlIGNoYXIsIGRpc3BsYXkgaXQgd2l0aCB0aGUgbWFpbiBmb250LgorICAgICAgICAgICAgICAgICAgICAvLyAoaXQnbGwgcHV0IGEgc3F1YXJlIHByb2JhYmx5KQorICAgICAgICAgICAgICAgICAgICBpZiAoZm91bmRGb250ID09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY2hhckNvdW50ID0gQ2hhcmFjdGVyLmlzSGlnaFN1cnJvZ2F0ZSh0ZXh0W2ldKSA/IDIgOiAxOworCisgICAgICAgICAgICAgICAgICAgICAgICBnLnNldEZvbnQobWFpbkZvbnQubUZvbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgZy5kcmF3Q2hhcnModGV4dCwgaSwgY2hhckNvdW50LCAoaW50KXgsIChpbnQpeSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1lYXN1cmUgaXQgdG8gYWR2YW5jZSB4CisgICAgICAgICAgICAgICAgICAgICAgICB4ICs9IG1haW5Gb250Lm1NZXRyaWNzLmNoYXJzV2lkdGgodGV4dCwgaSwgY2hhckNvdW50KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIG1vdmUgdG8gdGhlIG5leHQgY2hhcnMuCisgICAgICAgICAgICAgICAgICAgICAgICBpICs9IGNoYXJDb3VudDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGcuZGlzcG9zZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX2RyYXdUZXh0KGludCBuYXRpdmVDYW52YXMsIFN0cmluZyB0ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnQsIGludCBlbmQsIGZsb2F0IHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHksIGludCBmbGFncywgaW50IHBhaW50KSB7CisgICAgICAgIGludCBjb3VudCA9IGVuZCAtIHN0YXJ0OworICAgICAgICBjaGFyW10gYnVmZmVyID0gVGVtcG9yYXJ5QnVmZmVyLm9idGFpbihjb3VudCk7CisgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBzdGFydCwgZW5kLCBidWZmZXIsIDApOworCisgICAgICAgIG5hdGl2ZV9kcmF3VGV4dChuYXRpdmVDYW52YXMsIGJ1ZmZlciwgMCwgY291bnQsIHgsIHksIGZsYWdzLCBwYWludCk7CisgICAgfQorCisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfZHJhd1RleHRSdW4oaW50IG5hdGl2ZUNhbnZhcywgU3RyaW5nIHRleHQsCisgICAgICAgICAgICBpbnQgc3RhcnQsIGludCBlbmQsIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLAorICAgICAgICAgICAgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGZsYWdzLCBpbnQgcGFpbnQpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfZHJhd1RleHRSdW4oaW50IG5hdGl2ZUNhbnZhcywgY2hhcltdIHRleHQsCisgICAgICAgICAgICBpbnQgc3RhcnQsIGludCBjb3VudCwgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRDb3VudCwKKyAgICAgICAgICAgIGZsb2F0IHgsIGZsb2F0IHksIGludCBmbGFncywgaW50IHBhaW50KSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX2RyYXdQb3NUZXh0KGludCBuYXRpdmVDYW52YXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJbXSB0ZXh0LCBpbnQgaW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCwgZmxvYXRbXSBwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfZHJhd1Bvc1RleHQoaW50IG5hdGl2ZUNhbnZhcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHRleHQsIGZsb2F0W10gcG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcGFpbnQpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX2RyYXdUZXh0T25QYXRoKGludCBuYXRpdmVDYW52YXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJbXSB0ZXh0LCBpbnQgaW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCwgaW50IHBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGhPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHZPZmZzZXQsIGludCBiaWRpRmxhZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfZHJhd1RleHRPblBhdGgoaW50IG5hdGl2ZUNhbnZhcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHRleHQsIGludCBwYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBoT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB2T2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZmxhZ3MsIGludCBwYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfZHJhd1BpY3R1cmUoaW50IG5h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G9tR3JhcGhpY3MoUGFpbnRfRGVsZWdhdGUgcGFpbnQpIHsKKyAgICAgICAgLy8gbWFrZSBuZXcgb25lCisgICAgICAgIEdyYXBoaWNzMkQgZyA9IGdldEdyYXBoaWNzMmQoKTsKKyAgICAgICAgZyA9IChHcmFwaGljczJEKWcuY3JlYXRlKCk7CisKKyAgICAgICAgLy8gY29uZmlndXJlIGl0CisgICAgICAgIGcuc2V0Q29sb3IobmV3IENvbG9yKHBhaW50LmdldENvbG9yKCkpKTsKKyAgICAgICAgaW50IGFscGhhID0gcGFpbnQuZ2V0QWxwaGEoKTsKKyAgICAgICAgZmxvYXQgZmFscGhhID0gYWxwaGEgLyAyNTUuZjsKKworICAgICAgICBpbnQgc3R5bGUgPSBwYWludC5nZXRTdHlsZSgpOworICAgICAgICBpZiAoc3R5bGUgPT0gUGFpbnQuU3R5bGUuU1RST0tFLm5hdGl2ZUludCB8fAorICAgICAgICAgICAgICAgIHN0eWxlID09IFBhaW50LlN0eWxlLkZJTExfQU5EX1NUUk9LRS5uYXRpdmVJbnQpIHsKKyAgICAgICAgICAgIC8qIEZJWE1FCisgICAgICAgICAgICBQYXRoRWZmZWN0IGUgPSBwYWludC5nZXRQYXRoRWZmZWN0KCk7CisgICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIERhc2hQYXRoRWZmZWN0KSB7CisgICAgICAgICAgICAgICAgRGFzaFBhdGhFZmZlY3QgZHBlID0gKERhc2hQYXRoRWZmZWN0KWU7CisgICAgICAgICAgICAgICAgZy5zZXRTdHJva2UobmV3IEJhc2ljU3Ryb2tlKAorICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQuZ2V0U3Ryb2tlV2lkdGgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldFN0cm9rZUNhcCgpLmdldEphdmFDYXAoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldFN0cm9rZUpvaW4oKS5nZXRKYXZhSm9pbigpLAorICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQuZ2V0U3Ryb2tlTWl0ZXIoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGRwZS5nZXRJbnRlcnZhbHMoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGRwZS5nZXRQaGFzZSgpKSk7CisgICAgICAgICAgICB9IGVsc2UgeyovCisgICAgICAgICAgICAgICAgZy5zZXRTdHJva2UobmV3IEJhc2ljU3Ryb2tlKAorICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQuZ2V0U3Ryb2tlV2lkdGgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldEphdmFDYXAoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldEphdmFKb2luKCksCisgICAgICAgICAgICAgICAgICAgICAgICBwYWludC5nZXRTdHJva2VNaXRlcigpKSk7CisgICAgICAgICAgLyogIH0qLworICAgICAgICB9CisvKgorICAgICAgICBYZmVybW9kZSB4ZmVybW9kZSA9IHBhaW50LmdldFhmZXJtb2RlKCk7CisgICAgICAgIGlmICh4ZmVybW9kZSBpbnN0YW5jZW9mIFBvcnRlckR1ZmZYZmVybW9kZSkgeworICAgICAgICAgICAgUG9ydGVyRHVmZi5Nb2RlIG1vZGUgPSAoKFBvcnRlckR1ZmZYZmVybW9kZSl4ZmVybW9kZSkuZ2V0TW9kZSgpOworCisgICAgICAgICAgICBzZXRNb2RlSW5HcmFwaGljcyhtb2RlLCBnLCBmYWxwaGEpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKG1Mb2dnZXIgIT0gbnVsbCAmJiB4ZmVybW9kZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUxvZ2dlci53YXJuaW5nKFN0cmluZy5mb3JtYXQoCisgICAgICAgICAgICAgICAgICAgICAgICAiWGZlcm1vZGUgJyUxJHMnIGlzIG5vdCBzdXBwb3J0ZWQgaW4gdGhlIExheW91dCBFZGl0b3IuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHhmZXJtb2RlLmdldENsYXNzKCkuZ2V0Q2Fub25pY2FsTmFtZSgpKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBnLnNldENvbXBvc2l0ZShBbHBoYUNvbXBvc2l0ZS5nZXRJbnN0YW5jZShBbHBoYUNvbXBvc2l0ZS5TUkNfT1ZFUiwgZmFscGhhKSk7CisgICAgICAgIH0KKworICAgICAgICBTaGFkZXIgc2hhZGVyID0gcGFpbnQuZ2V0U2hhZGVyKCk7CisgICAgICAgIGlmIChzaGFkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgamF2YS5hd3QuUGFpbnQgc2hhZGVyUGFpbnQgPSBzaGFkZXIuZ2V0SmF2YVBhaW50KCk7CisgICAgICAgICAgICBpZiAoc2hhZGVyUGFpbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGcuc2V0UGFpbnQoc2hhZGVyUGFpbnQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAobUxvZ2dlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1Mb2dnZXIud2FybmluZyhTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTaGFkZXIgJyUxJHMnIGlzIG5vdCBzdXBwb3J0ZWQgaW4gdGhlIExheW91dCBFZGl0b3IuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFkZXIuZ2V0Q2xhc3MoKS5nZXRDYW5vbmljYWxOYW1lKCkpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyovCisgICAgICAgIHJldHVybiBnOworICAgIH0KKworCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBkcmF3Qml0bWFwKAorICAgICAgICAgICAgaW50IG5hdGl2ZUNhbnZhcywKKyAgICAgICAgICAgIEJ1ZmZlcmVkSW1hZ2UgaW1hZ2UsCisgICAgICAgICAgICBpbnQgbmF0aXZlUGFpbnRPclplcm8sCisgICAgICAgICAgICBpbnQgc2xlZnQsIGludCBzdG9wLCBpbnQgc3JpZ2h0LCBpbnQgc2JvdHRvbSwKKyAgICAgICAgICAgIGludCBkbGVmdCwgaW50IGR0b3AsIGludCBkcmlnaHQsIGludCBkYm90dG9tKSB7CisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUgZnJvbSB0aGUgbmF0aXZlIGludC4KKyAgICAgICAgQ2FudmFzX0RlbGVnYXRlIGNhbnZhc0RlbGVnYXRlID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlQ2FudmFzKTsKKyAgICAgICAgaWYgKGNhbnZhc0RlbGVnYXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUgZnJvbSB0aGUgbmF0aXZlIGludC4KKyAgICAgICAgUGFpbnRfRGVsZWdhdGUgcGFpbnREZWxlZ2F0ZSA9IG51bGw7CisgICAgICAgIGlmIChuYXRpdmVQYWludE9yWmVybyA+IDApIHsKKyAgICAgICAgICAgIHBhaW50RGVsZWdhdGUgPSBQYWludF9EZWxlZ2F0ZS5nZXREZWxlZ2F0ZShuYXRpdmVQYWludE9yWmVybyk7CisgICAgICAgICAgICBpZiAocGFpbnREZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGRyYXdCaXRtYXAoY2FudmFzRGVsZWdhdGUsIGltYWdlLCBwYWludERlbGVnYXRlLAorICAgICAgICAgICAgICAgIHNsZWZ0LCBzdG9wLCBzcmlnaHQsIHNib3R0b20sCisgICAgICAgICAgICAgICAgZGxlZnQsIGR0b3AsIGRyaWdodCwgZGJvdHRvbSk7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBkcmF3Qml0bWFwKAorICAgICAgICAgICAgQ2FudmFzX0RlbGVnYXRlIGNhbnZhc0RlbGVnYXRlLAorICAgICAgICAgICAgQnVmZmVyZWRJbWFnZSBpbWFnZSwKKyAgICAgICAgICAgIFBhaW50X0RlbGVnYXRlIHBhaW50RGVsZWdhdGUsCisgICAgICAgICAgICBpbnQgc2xlZnQsIGludCBzdG9wLCBpbnQgc3JpZ2h0LCBpbnQgc2JvdHRvbSwKKyAgICAgICAgICAgIGludCBkbGVmdCwgaW50IGR0b3AsIGludCBkcmlnaHQsIGludCBkYm90dG9tKSB7CisKKyAgICAgICAgR3JhcGhpY3MyRCBnID0gY2FudmFzRGVsZWdhdGUuZ2V0R3JhcGhpY3MyZCgpOworCisgICAgICAgIENvbXBvc2l0ZSBjID0gbnVsbDsKKworICAgICAgICBpZiAocGFpbnREZWxlZ2F0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAocGFpbnREZWxlZ2F0ZS5pc0ZpbHRlckJpdG1hcCgpKSB7CisgICAgICAgICAgICAgICAgZyA9IChHcmFwaGljczJEKWcuY3JlYXRlKCk7CisgICAgICAgICAgICAgICAgZy5zZXRSZW5kZXJpbmdIaW50KFJlbmRlcmluZ0hpbnRzLktFWV9JTlRFUlBPTEFUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgUmVuZGVyaW5nSGludHMuVkFMVUVfSU5URVJQT0xBVElPTl9CSUxJTkVBUik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChwYWludERlbGVnYXRlLmdldEFscGhhKCkgIT0gMHhGRikgeworICAgICAgICAgICAgICAgIGMgPSBnLmdldENvbXBvc2l0ZSgpOworICAgICAgICAgICAgICAgIGcuc2V0Q29tcG9zaXRlKEFscGhhQ29tcG9zaXRlLmdldEluc3RhbmNlKEFscGhhQ29tcG9zaXRlLlNSQ19PVkVSLAorICAgICAgICAgICAgICAg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ci0gICAgICAgIGZvciAoaW50IGkgPSAwLCBrID0gMDsgaSA8IDM7IGkrKykgewotICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCAzOyBqKyssIGsrKykgewotICAgICAgICAgICAgICAgIGlmIChtVmFsdWVzW2tdICE9ICgoaT09aikgPyAxIDogMCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiB0cnVlOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJldHVybnMgdHJ1ZSBpZiB3aWxsIG1hcCBhIHJlY3RhbmdsZSB0byBhbm90aGVyIHJlY3RhbmdsZS4gVGhpcyBjYW4gYmUKLSAgICAgKiB0cnVlIGlmIHRoZSBtYXRyaXggaXMgaWRlbnRpdHksIHNjYWxlLW9ubHksIG9yIHJvdGF0ZXMgYSBtdWx0aXBsZSBvZiA5MAotICAgICAqIGRlZ3JlZXMuCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGJvb2xlYW4gcmVjdFN0YXlzUmVjdCgpIHsKLSAgICAgICAgcmV0dXJuIChjb21wdXRlVHlwZU1hc2soKSAmIGtSZWN0U3RheXNSZWN0X01hc2spICE9IDA7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogKGRlZXApIGNvcHkgdGhlIHNyYyBtYXRyaXggaW50byB0aGlzIG1hdHJpeC4gSWYgc3JjIGlzIG51bGwsIHJlc2V0IHRoaXMKLSAgICAgKiBtYXRyaXggdG8gdGhlIGlkZW50aXR5IG1hdHJpeC4KLSAgICAgKi8KLSAgICBwdWJsaWMgdm9pZCBzZXQoTWF0cml4IHNyYykgewotICAgICAgICBpZiAoc3JjID09IG51bGwpIHsKLSAgICAgICAgICAgIHJlc2V0KCk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5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Ci0gICAgICAgICAgICAgICA9IG1WYWx1ZXNbNl0gPSBtVmFsdWVzWzddID0gMDsKLSAgICAgICAgICAgIG1WYWx1ZXNbOF0gPSAxOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZmxvYXQgICAgdHgsIHN4ID0gZHN0LndpZHRoKCkgLyBzcmMud2lkdGgoKTsKLSAgICAgICAgICAgIGZsb2F0ICAgIHR5LCBzeSA9IGRzdC5oZWlnaHQoKSAvIHNyYy5oZWlnaHQoKTsKLSAgICAgICAgICAgIGJvb2xlYW4gIHhMYXJnZXIgPSBmYWxzZTsKLQotICAgICAgICAgICAgaWYgKHN0ZiAhPSBTY2FsZVRvRml0LkZJTEwpIHsKLSAgICAgICAgICAgICAgICBpZiAoc3ggPiBzeSkgewotICAgICAgICAgICAgICAgICAgICB4TGFyZ2VyID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgc3ggPSBzeTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBzeSA9IHN4OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdHggPSBkc3QubGVmdCAtIHNyYy5sZWZ0ICogc3g7Ci0gICAgICAgICAgICB0eSA9IGRzdC50b3AgLSBzcmMudG9wICogc3k7Ci0gICAgICAgICAgICBpZiAoc3RmID09IFNjYWxlVG9GaXQuQ0VOVEVSIHx8IHN0ZiA9PSBTY2FsZVRvRml0LkVORCkgewotICAgICAgICAgICAgICAgIGZsb2F0IGRpZmY7Ci0KLSAgICAgICAgICAgICAgICBpZiAoeExhcmdlcikgewotICAgICAgICAgICAgICAgICAgICBkaWZmID0gZHN0LndpZHRoKCkgLSBzcmMud2lkdGgoKSAqIHN5OwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGRpZmYgPSBkc3QuaGVpZ2h0KCkgLSBzcmMuaGVpZ2h0KCkgKiBzeTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoc3RmID09IFNjYWxlVG9GaXQuQ0VOVEVSKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRpZmYgPSBkaWZmIC8gMjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoeExhcmdlcikgewotICAgICAgICAgICAgICAgICAgICB0eCArPSBkaWZmOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHR5ICs9IGRpZmY7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtVmFsdWVzWzBdID0gc3g7Ci0gICAgICAgICAgICBtVmFsdWVzWzRdID0gc3k7Ci0gICAgICAgICAgICBtVmFsdWVzWzJdID0gdHg7Ci0gICAgICAgICAgICBtVmFsdWVzWzVdID0gdHk7Ci0gICAgICAgICAgICBtVmFsdWVzWzFdICA9IG1WYWx1ZXNbM10gPSBtVmFsdWVzWzZdID0gbVZhbHVlc1s3XSA9IDA7Ci0KLSAgICAgICAgfQotICAgICAgICAvLyBzaGFyZWQgY2xlYW51cAotICAgICAgICBtVmFsdWVzWzhdID0gMTsKLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGJvb2xlYW4gc2V0UmVjdFRvUmVjdChSZWN0RiBzcmMsIFJlY3RGIGRzdCwgX09yaWdpbmFsX01hdHJpeC5TY2FsZVRvRml0IHN0ZikgewotICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oIkNBTEwgVE8gUEFSRU5UIEZPUkJJRERFTiIpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFNldCB0aGUgbWF0cml4IHN1Y2ggdGhhdCB0aGUgc3BlY2lmaWVkIHNyYyBwb2ludHMgd291bGQgbWFwIHRvIHRoZQotICAgICAqIHNwZWNpZmllZC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mVzc1dhcm5pbmdzKCJ1bnVzZWQiKQotICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBrVW5rbm93bl9NYXNrICAgICAgID0gMHg4MDsKLQotICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bnVzZWQiKQotICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBrQWxsTWFza3MgICAgICAgICAgID0ga1RyYW5zbGF0ZV9NYXNrIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga1NjYWxlX01hc2sgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrQWZmaW5lX01hc2sgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrUGVyc3BlY3RpdmVfTWFzayB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtSZWN0U3RheXNSZWN0X01hc2s7Ci0KLSAgICAvLyB0aGVzZSBndXlzIGFsaWduIHdpdGggdGhlIG1hc2tzLCBzbyB3ZSBjYW4gY29tcHV0ZSBhIG1hc2sgZnJvbSBhIHZhcmlhYmxlIDAvMQotICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bnVzZWQiKQotICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBrVHJhbnNsYXRlX1NoaWZ0ID0gMDsKLSAgICBAU3VwcHJlc3NXYXJuaW5ncygidW51c2VkIikKLSAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBpbnQga1NjYWxlX1NoaWZ0ID0gMTsKLSAgICBAU3VwcHJlc3NXYXJuaW5ncygidW51c2VkIikKLSAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBpbnQga0FmZmluZV9TaGlmdCA9IDI7Ci0gICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCi0gICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgaW50IGtQZXJzcGVjdGl2ZV9TaGlmdCA9IDM7Ci0gICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgaW50IGtSZWN0U3RheXNSZWN0X1NoaWZ0ID0gNDsKLQotICAgIHByaXZhdGUgaW50IGNvbXB1dGVUeXBlTWFzaygpIHsKLSAgICAgICAgaW50IG1hc2sgPSAwOwotCi0gICAgICAgIGlmIChtVmFsdWVzWzZdICE9IDAuIHx8IG1WYWx1ZXNbN10gIT0gMC4gfHwgbVZhbHVlc1s4XSAhPSAxLikgewotICAgICAgICAgICAgbWFzayB8PSBrUGVyc3BlY3RpdmVfTWFzazsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtVmFsdWVzWzJdICE9IDAuIHx8IG1WYWx1ZXNbNV0gIT0gMC4pIHsKLSAgICAgICAgICAgIG1hc2sgfD0ga1RyYW5zbGF0ZV9NYXNrOwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgbTAwID0gbVZhbHVlc1swXTsKLSAgICAgICAgZmxvYXQgbTAxID0gbVZhbHVlc1sxXTsKLSAgICAgICAgZmxvYXQgbTEwID0gbVZhbHVlc1szXTsKLSAgICAgICAgZmxvYXQgbTExID0gbVZhbHVlc1s0XTsKLQotICAgICAgICBpZiAobTAxICE9IDAuIHx8IG0xMCAhPSAwLikgewotICAgICAgICAgICAgbWFzayB8PSBrQWZmaW5lX01hc2s7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobTAwICE9IDEuIHx8IG0xMSAhPSAxLikgewotICAgICAgICAgICAgbWFzayB8PSBrU2NhbGVfTWFzazsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICgobWFzayAmIGtQZXJzcGVjdGl2ZV9NYXNrKSA9PSAwKSB7Ci0gICAgICAgICAgICAvLyBtYXAgbm9uLXplcm8gdG8gMQotICAgICAgICAgICAgaW50IGltMDAgPSBtMDAgIT0gMCA/IDEgOiAwOwotICAgICAgICAgICAgaW50IGltMDEgPSBtMDEgIT0gMCA/I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orCisgICAgICAgIHJldHVybiBzTWFuYWdlci5hZGREZWxlZ2F0ZShuZXdEZWxlZ2F0ZSk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX2lzSWRlbnRpdHkoaW50IG5hdGl2ZV9vYmplY3QpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDAsIGsgPSAwOyBpIDwgMzsgaSsrKSB7CisgICAgICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IDM7IGorKywgaysrKSB7CisgICAgICAgICAgICAgICAgaWYgKGQubVZhbHVlc1trXSAhPSAoKGk9PWopID8gMSA6IDApKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgYm9vbGVhbiBuYXRpdmVfcmVjdFN0YXlzUmVjdChpbnQgbmF0aXZlX29iamVjdCkgeworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgZCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiAoZC5jb21wdXRlVHlwZU1hc2soKSAmIGtSZWN0U3RheXNSZWN0X01hc2spICE9IDA7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX3Jlc2V0KGludCBuYXRpdmVfb2JqZWN0KSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIHJlc2V0KGQubVZhbHVlcyk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX3NldChpbnQgbmF0aXZlX29iamVjdCwgaW50IG90aGVyKSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBzcmMgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShvdGhlcik7CisgICAgICAgIGlmIChzcmMgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgU3lzdGVtLmFycmF5Y29weShzcmMubVZhbHVlcywgMCwgZC5tVmFsdWVzLCAwLCBNQVRSSVhfU0laRSk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX3NldFRyYW5zbGF0ZShpbnQgbmF0aXZlX29iamVjdCwgZmxvYXQgZHgsIGZsb2F0IGR5KSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIHNldFRyYW5zbGF0ZShkLm1WYWx1ZXMsIGR4LCBkeSk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX3NldFNjYWxlKGludCBuYXRpdmVfb2JqZWN0LCBmbG9hdCBzeCwgZmxvYXQgc3ksIGZsb2F0IHB4LCBmbG9hdCBweSkgeworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgZCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBkLm1WYWx1ZXMgPSBnZXRTY2FsZShzeCwgc3ksIHB4LCBweSk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX3NldFNjYWxlKGludCBuYXRpdmVfb2JqZWN0LCBmbG9hdCBzeCwgZmxvYXQgc3kpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZC5tVmFsdWVzWzBdID0gc3g7CisgICAgICAgIGQubVZhbHVlc1sxXSA9IDA7CisgICAgICAgIGQubVZhbHVlc1syXSA9IDA7CisgICAgICAgIGQubVZhbHVlc1szXSA9IDA7CisgICAgICAgIGQubVZhbHVlc1s0XSA9IHN5OworICAgICAgICBkLm1WYWx1ZXNbNV0gPSAwOworICAgIC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HNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICAvLyBUT0RPOiBkbyBpdCBpbiBvbmUgcGFzcworCisgICAgICAgIC8vIHRyYW5zbGF0ZSBzbyB0aGF0IHRoZSBwaXZvdCBpcyBpbiAwLDAKKyAgICAgICAgc2V0VHJhbnNsYXRlKGQubVZhbHVlcywgLXB4LCAtcHkpOworCisgICAgICAgIC8vIHNjYWxlCisgICAgICAgIGQucG9zdFRyYW5zZm9ybShnZXRSb3RhdGUoc2luVmFsdWUsIGNvc1ZhbHVlKSk7CisgICAgICAgIC8vIHRyYW5zbGF0ZSBiYWNrIHRoZSBwaXZvdAorICAgICAgICBkLnBvc3RUcmFuc2Zvcm0oZ2V0VHJhbnNsYXRlKHB4LCBweSkpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9zZXRTaW5Db3MoaW50IG5hdGl2ZV9vYmplY3QsIGZsb2F0IHNpblZhbHVlLCBmbG9hdCBjb3NWYWx1ZSkgeworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgZCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBzZXRSb3RhdGUoZC5tVmFsdWVzLCBzaW5WYWx1ZSwgY29zVmFsdWUpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIG5hdGl2ZV9zZXRTa2V3KGludCBuYXRpdmVfb2JqZWN0LCBmbG9hdCBreCwgZmxvYXQga3ksIGZsb2F0IHB4LCBmbG9hdCBweSkgeworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgZCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBkLm1WYWx1ZXMgPSBnZXRTa2V3KGt4LCBreSwgcHgsIHB5KTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfc2V0U2tldyhpbnQgbmF0aXZlX29iamVjdCwgZmxvYXQga3gsIGZsb2F0IGt5KSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGQubVZhbHVlc1swXSA9IDE7CisgICAgICAgIGQubVZhbHVlc1sxXSA9IGt4OworICAgICAgICBkLm1WYWx1ZXNbMl0gPSAtMDsKKyAgICAgICAgZC5tVmFsdWVzWzNdID0ga3k7CisgICAgICAgIGQubVZhbHVlc1s0XSA9IDE7CisgICAgICAgIGQubVZhbHVlc1s1XSA9IDA7CisgICAgICAgIGQubVZhbHVlc1s2XSA9IDA7CisgICAgICAgIGQubVZhbHVlc1s3XSA9IDA7CisgICAgICAgIGQubVZhbHVlc1s4XSA9IDE7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX3NldENvbmNhdChpbnQgbmF0aXZlX29iamVjdCwgaW50IGEsIGludCBiKSB7CisgICAgICAgIGlmIChhID09IG5hdGl2ZV9vYmplY3QpIHsKKyAgICAgICAgICAgIHJldHVybiBuYXRpdmVfcHJlQ29uY2F0KG5hdGl2ZV9vYmplY3QsIGIpOworICAgICAgICB9IGVsc2UgaWYgKGIgPT0gbmF0aXZlX29iamVjdCkgeworICAgICAgICAgICAgcmV0dXJuIG5hdGl2ZV9wb3N0Q29uY2F0KG5hdGl2ZV9vYmplY3QsIGEpOworICAgICAgICB9CisKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGFfbXR4ID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUoYSk7CisgICAgICAgIGlmIChhX210eCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgYl9tdHggPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShiKTsKKyAgICAgICAgaWYgKGJfbXR4ID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIG11bHRpcGx5KGQubVZhbHVlcywgYV9tdHgubVZhbHVlcywgYl9tdHgubVZhbHVlcyk7CisKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX3ByZVRyYW5zbGF0ZShpbnQgbmF0aXZlX29iamVjdCwgZmxvYXQgZHgsIGZsb2F0IGR5KSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGQucHJlVHJhbnNmb3JtKGdldFRyYW5zbGF0ZShkeCwgZHkpKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX3ByZVNjYWxlKGludCBuYXRpdmVfb2JqZWN0LCBmbG9hdCBzeCwgZmxvYXQgc3ksCisgICAgICAgICAgICBmbG9hdCBweCwgZmxvYXQgcHkpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZC5wcmVUcmFuc2Zvcm0oZ2V0U2NhbGUoc3gsIHN5LCBweCwgcHkpKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX3ByZVNjYWxlKGludCBuYXRpdmVfb2JqZWN0LCBmbG9hdCBzeCwgZmxvYXQgc3kpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZC5wcmVUcmFuc2Zvcm0oZ2V0U2NhbGUoc3gsIHN5KSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9wcmVSb3RhdGUoaW50IG5hdGl2ZV9vYmplY3QsIGZsb2F0IGRlZ3JlZXMsIGZsb2F0IHB4LCBmbG9hdCBweSkgeworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgZCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBkLnByZVRyYW5zZm9ybShnZXRSb3RhdGUoZGVncmVlcywgcHgsIHB5KSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9wcmVSb3RhdGUoaW50IG5hdGl2ZV9vYmplY3QsIGZsb2F0IGRlZ3JlZXMpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZG91YmxlIHJhZCA9IE1hdGgudG9SYWRpYW5zKGRlZ3JlZXMpOworICAgICAgICBmbG9hdCBzaW4gPSAoZmxvYXQpTWF0aC5zaW4ocmFkKTsKKyAgICAgICAgZmxvYXQgY29zID0gKGZsb2F0KU1hdGguY29zKHJhZCk7CisKKyAgICAgICAgZC5wcmVUcmFuc2Zvcm0oZ2V0Um90YXRlKHNpbiwgY29zKSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9wcmVTa2V3KGludCBuYXRpdmVfb2JqZWN0LCBmbG9hdCBreCwgZmxvYXQga3ksCisgICAgICAgICAgICBmbG9hdCBweCwgZmxvYXQgcHkpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZC5wcmVUcmFuc2Zvcm0oZ2V0U2tldyhreCwga3ksIHB4LCBweSkpOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgYm9vbGVhbiBuYXRpdmVfcHJlU2tldyhpbnQgbmF0aXZlX29iamVjdCwgZmxvYXQga3gsIGZsb2F0IGt5KSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGQucHJlVHJhbnNmb3JtKGdldFNrZXcoa3gsIGt5KSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9wcmVDb25jYXQoaW50IG5hdGl2ZV9vYmplY3QsIGludCBvdGhlcl9tYXRyaXgpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIG90aGVyID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUob3RoZXJfbWF0cml4KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZC5wcmVUcmFuc2Zvcm0ob3RoZXIubVZhbHVlcyk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9wb3N0VHJhbnNsYXRlKGludCBuYXRpdmVfb2JqZWN0LCBmbG9hdCBkeCwgZmxvYXQgZHkpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZC5wb3N0VHJhbnNmb3JtKGdldFRyYW5zbGF0ZShkeCwgZHkpKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX3Bvc3RTY2FsZShpbnQgbmF0aXZlX29iamVjdCwgZmxvYXQgc3gsIGZsb2F0IHN5LAorICAgICAgICAgICAgZmxvYXQgcHgsIGZsb2F0IHB5KSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHV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vYmplY3QsIGZsb2F0IGRlZ3JlZXMpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZC5wb3N0VHJhbnNmb3JtKGdldFJvdGF0ZShkZWdyZWVzKSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9wb3N0U2tldyhpbnQgbmF0aXZlX29iamVjdCwgZmxvYXQga3gsIGZsb2F0IGt5LAorICAgICAgICAgICAgZmxvYXQgcHgsIGZsb2F0IHB5KSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGQucG9zdFRyYW5zZm9ybShnZXRTa2V3KGt4LCBreSwgcHgsIHB5KSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9wb3N0U2tldyhpbnQgbmF0aXZlX29iamVjdCwgZmxvYXQga3gsIGZsb2F0IGt5KSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGQucG9zdFRyYW5zZm9ybShnZXRTa2V3KGt4LCBreSkpOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgYm9vbGVhbiBuYXRpdmVfcG9zdENvbmNhdChpbnQgbmF0aXZlX29iamVjdCwgaW50IG90aGVyX21hdHJpeCkgeworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgZCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgb3RoZXIgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShvdGhlcl9tYXRyaXgpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBkLnBvc3RUcmFuc2Zvcm0ob3RoZXIubVZhbHVlcyk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9zZXRSZWN0VG9SZWN0KGludCBuYXRpdmVfb2JqZWN0LCBSZWN0RiBzcmMsIFJlY3RGIGRzdCwgaW50IHN0ZikgeworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgZCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBpZiAoc3JjLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgcmVzZXQoZC5tVmFsdWVzKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChkc3QuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICBkLm1WYWx1ZXNbMF0gPSBkLm1WYWx1ZXNbMV0gPSBkLm1WYWx1ZXNbMl0gPSBkLm1WYWx1ZXNbM10gPSBkLm1WYWx1ZXNbNF0gPSBkLm1WYWx1ZXNbNV0KKyAgICAgICAgICAgICAgID0gZC5tVmFsdWVzWzZdID0gZC5tVmFsdWVzWzddID0gMDsKKyAgICAgICAgICAgIGQubVZhbHVlc1s4XSA9IDE7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmbG9hdCAgICB0eCwgc3ggPSBkc3Qud2lkdGgoKSAvIHNyYy53aWR0aCgpOworICAgICAgICAgICAgZmxvYXQgICAgdHksIHN5ID0gZHN0LmhlaWdodCgpIC8gc3JjLmhlaWdodCgpOworICAgICAgICAgICAgYm9vbGVhbiAgeExhcmdlciA9IGZhbHNlOworCisgICAgICAgICAgICBpZiAoc3RmICE9IFNjYWxlVG9GaXQuRklMTC5uYXRpdmVJbnQpIHsKKyAgICAgICAgICAgICAgICBpZiAoc3ggPiBzeSkgeworICAgICAgICAgICAgICAgICAgICB4TGFyZ2VyID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc3ggPSBzeTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzeSA9IHN4OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdHggPSBkc3QubGVmdCAtIHNyYy5sZWZ0ICogc3g7CisgICAgICAgICAgICB0eSA9IGRzdC50b3AgLSBzcmMudG9wICogc3k7CisgICAgICAgICAgICBpZiAoc3RmID09IFNjYWxlVG9GaXQuQ0VOVEVSLm5hdGl2ZUludCB8fCBzdGYgPT0gU2NhbGVUb0ZpdC5FTkQubmF0aXZlSW50KSB7CisgICAgICAgICAgICAgICAgZmxvYXQgZGlmZjsKKworICAgICAgICAgICAgICAgIGlmICh4TGFyZ2VyKSB7CisgICAgICAgICAgICAgICAgICAgIGRpZmYgPSBkc3Qud2lkdGgoKSAtIHNyYy53aWR0aCgpICogc3k7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZGlmZiA9IGRzdC5oZWlnaHQoKSAtIHNyYy5oZWlnaHQoKSAqIHN5OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChzdGYgPT0gU2NhbGVUb0ZpdC5DRU5URVIubmF0aXZlSW50KSB7CisgICAgICAgICAgICAgICAgICAgIGRpZmYgPSBkaWZmIC8gMjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoeExhcmdlcikgeworICAgICAgICAgICAgICAgICAgICB0eCArPSBkaWZmOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHR5ICs9IGRpZmY7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBkLm1WYWx1ZXNbMF0gPSBzeDsKKyAgICAgICAgICAgIGQubVZhbHVlc1s0XSA9IHN5OworICAgICAgICAgICAgZC5tVmFsdWVzWzJdID0gdHg7CisgICAgICAgICAgICBkLm1WYWx1ZXNbNV0gPSB0eTsKKyAgICAgICAgICAgIGQubVZhbHVlc1sxXSAgPSBkLm1WYWx1ZXNbM10gPSBkLm1WYWx1ZXNbNl0gPSBkLm1WYWx1ZXNbN10gPSAwOworCisgICAgICAgIH0KKyAgICAgICAgLy8gc2hhcmVkIGNsZWFudXAKKyAgICAgICAgZC5tVmFsdWVzWzhdID0gMTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGJvb2xlYW4gbmF0aXZlX3NldFBvbHlUb1BvbHkoaW50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bXR4Lm1WYWx1ZXNbMF0gPSAoZmxvYXQpaW52ZXJzZVRyYW5zZm9ybS5nZXRTY2FsZVgoKTsKKyAgICAgICAgICAgIGludl9tdHgubVZhbHVlc1sxXSA9IChmbG9hdClpbnZlcnNlVHJhbnNmb3JtLmdldFNoZWFyWCgpOworICAgICAgICAgICAgaW52X210eC5tVmFsdWVzWzJdID0gKGZsb2F0KWludmVyc2VUcmFuc2Zvcm0uZ2V0VHJhbnNsYXRlWCgpOworICAgICAgICAgICAgaW52X210eC5tVmFsdWVzWzNdID0gKGZsb2F0KWludmVyc2VUcmFuc2Zvcm0uZ2V0U2NhbGVYKCk7CisgICAgICAgICAgICBpbnZfbXR4Lm1WYWx1ZXNbNF0gPSAoZmxvYXQpaW52ZXJzZVRyYW5zZm9ybS5nZXRTaGVhclkoKTsKKyAgICAgICAgICAgIGludl9tdHgubVZhbHVlc1s1XSA9IChmbG9hdClpbnZlcnNlVHJhbnNmb3JtLmdldFRyYW5zbGF0ZVkoKTsKKworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gY2F0Y2ggKE5vbmludmVydGlibGVUcmFuc2Zvcm1FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX21hcFBvaW50cyhpbnQgbmF0aXZlX29iamVjdCwgZmxvYXRbXSBkc3QsIGludCBkc3RJbmRleCwKKyAgICAgICAgICAgIGZsb2F0W10gc3JjLCBpbnQgc3JjSW5kZXgsIGludCBwdENvdW50LCBib29sZWFuIGlzUHRzKSB7CisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBkID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX29iamVjdCk7CisgICAgICAgIGlmIChkID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChpc1B0cykgeworICAgICAgICAgICAgZC5tYXBQb2ludHMoZHN0LCBkc3RJbmRleCwgc3JjLCBzcmNJbmRleCwgcHRDb3VudCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBzcmMgaXMgdmVjdG9ycworICAgICAgICAgICAgLy8gRklYTUUKKyAgICAgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigiTmF0aXZlIGRlbGVnYXRlIG5lZWRlZDogTWF0cml4X0RlbGVnYXRlLm5hdGl2ZV9tYXBQb2ludHMiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9tYXBSZWN0KGludCBuYXRpdmVfb2JqZWN0LCBSZWN0RiBkc3QsIFJlY3RGIHNyYykgeworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgZCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICAvLyBhcnJheSB3aXRoIDQgY29ybmVycworICAgICAgICBmbG9hdFtdIGNvcm5lcnMgPSBuZXcgZmxvYXRbXSB7CisgICAgICAgICAgICAgICAgc3JjLmxlZnQsIHNyYy50b3AsCisgICAgICAgICAgICAgICAgc3JjLnJpZ2h0LCBzcmMudG9wLAorICAgICAgICAgICAgICAgIHNyYy5yaWdodCwgc3JjLmJvdHRvbSwKKyAgICAgICAgICAgICAgICBzcmMubGVmdCwgc3JjLmJvdHRvbSwKKyAgICAgICAgfTsKKworICAgICAgICAvLyBhcHBseSB0aGUgdHJhbnNmb3JtIHRvIHRoZW0uCisgICAgICAgIGQubWFwUG9pbnRzKGNvcm5lcnMpOwor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sdWVzKGludCBuYXRpdmVfb2JqZWN0LCBmbG9hdFtdIHZhbHVlcykgeworICAgICAgICBNYXRyaXhfRGVsZWdhdGUgZCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZCA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGQubVZhbHVlcywgMCwgZC5tVmFsdWVzLCAwLCBNQVRSSVhfU0laRSk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbmF0aXZlX3NldFZhbHVlcyhpbnQgbmF0aXZlX29iamVjdCwgZmxvYXRbXSB2YWx1ZXMpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGQgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfb2JqZWN0KTsKKyAgICAgICAgaWYgKGQgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgU3lzdGVtLmFycmF5Y29weSh2YWx1ZXMsIDAsIGQubVZhbHVlcywgMCwgTUFUUklYX1NJWkUpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9lcXVhbHMoaW50IG5hdGl2ZV9hLCBpbnQgbmF0aXZlX2IpIHsKKyAgICAgICAgTWF0cml4X0RlbGVnYXRlIGEgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZShuYXRpdmVfYSk7CisgICAgICAgIGlmIChhID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIE1hdHJpeF9EZWxlZ2F0ZSBiID0gc01hbmFnZXIuZ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8gdGhlIG9yZGVyIGlzIDAsIDMsIDEsIDQsIDIsIDUuLi4KKyAgICAgICAgcmV0dXJuIG5ldyBBZmZpbmVUcmFuc2Zvcm0oCisgICAgICAgICAgICAgICAgbWF0cml4WzBdLCBtYXRyaXhbM10sIG1hdHJpeFsxXSwKKyAgICAgICAgICAgICAgICBtYXRyaXhbNF0sIG1hdHJpeFsyXSwgbWF0cml4WzVdKTsKKyAgICB9CisKKworICAgIC8qKgorICAgICAqIFJlc2V0IGEgbWF0cml4IHRvIHRoZSBpZGVudGl0eQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgcmVzZXQoZmxvYXRbXSBtdHgpIHsKKyAgICAgICAgZm9yIChpbnQgaSA9IDAsIGsgPSAwOyBpIDwgMzsgaSsrKSB7CisgICAgICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IDM7IGorKywgaysrKSB7CisgICAgICAgICAgICAgICAgbXR4W2tdID0gKChpPT1qKSA/IDEgOiAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bnVzZWQiKQorICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBrSWRlbnRpdHlfTWFzayAgICAgID0gMDsKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBpbnQga1RyYW5zbGF0ZV9NYXNrICAgICA9IDB4MDE7ICAvLyE8IHNldCBpZiB0aGUgbWF0cml4IGhhcyB0cmFuc2xhdGlvbgorICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBrU2NhbGVfTWFzayAgICAgICAgID0gMHgwMjsgIC8vITwgc2V0IGlmIHRoZSBtYXRyaXggaGFzIFggb3IgWSBzY2FsZQorICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBrQWZmaW5lX01hc2sgICAgICAgID0gMHgwNDsgIC8vITwgc2V0IGlmIHRoZSBtYXRyaXggc2tld3Mgb3Igcm90YXRlcworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBrUGVyc3BlY3RpdmVfTWFzayAgID0gMHgwODsgIC8vITwgc2V0IGlmIHRoZSBtYXRyaXggaXMgaW4gcGVyc3BlY3RpdmUKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBpbnQga1JlY3RTdGF5c1JlY3RfTWFzayA9IDB4MTA7CisgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCisgICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgaW50IGtVbmtub3duX01hc2sgICAgICAgPSAweDgwOworCisgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCisgICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgaW50IGtBbGxNYXNrcyAgICAgICAgICAgPSBrVHJhbnNsYXRlX01hc2sgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga1NjYWxlX01hc2sgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga0FmZmluZV9NYXNrIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtQZXJzcGVjdGl2ZV9NYXNrIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtSZWN0U3RheXNSZWN0X01hc2s7CisKKyAgICAvLyB0aGVzZSBndXlzIGFsaWduIHdpdGggdGhlIG1hc2tzLCBzbyB3ZSBjYW4gY29tcHV0ZSBhIG1hc2sgZnJvbSBhIHZhcmlhYmxlIDAvMQorICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bnVzZWQiKQorICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBrVHJhbnNsYXRlX1NoaWZ0ID0gMDsKKyAgICBAU3VwcHJlc3NXYXJuaW5ncygidW51c2VkIikKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBpbnQga1NjYWxlX1NoaWZ0ID0gMTsKKyAgICBAU3VwcHJlc3NXYXJuaW5ncygidW51c2VkIikKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBpbnQga0FmZmluZV9TaGlmdCA9IDI7CisgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCisgICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgaW50IGtQZXJzcGVjdGl2ZV9TaGlmdCA9IDM7CisgICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgaW50IGtSZWN0U3RheXNSZWN0X1NoaWZ0ID0gNDsKKworICAgIHByaXZhdGUgaW50IGNvbXB1dGVUeXBlTWFzaygpIHsKKyAgICAgICAgaW50IG1hc2sgPSAwOworCisgICAgICAgIGlmIChtVmFsdWVzWzZdICE9IDAuIHx8IG1WYWx1ZXNbN10gIT0gMC4gfHwgbVZhbHVlc1s4XSAhPSAxLikgeworICAgICAgICAgICAgbWFzayB8PSBrUGVyc3BlY3RpdmVfTWFzazsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtVmFsdWVzWzJdICE9IDAuIHx8IG1WYWx1ZXNbNV0gIT0gMC4pIHsKKyAgICAgICAgICAgIG1hc2sgfD0ga1RyYW5zbGF0ZV9NYXNrOworICAgICAgICB9CisKKyAgICAgICAgZmxvYXQgbTAwID0gbVZhbHVlc1swXTsKKyAgICAgICAgZmxvYXQgbTAxID0gbVZhbHVlc1sxXTsKKyAgICAgICAgZmxvYXQgbTEwID0gbVZhbHVlc1szXTsKKyAgICAgICAgZmxvYXQgbTExID0gbVZhbHVlc1s0XTsKKworICAgICAgICBpZiAobTAxICE9IDAuIHx8IG0xMCAhPSAwLikgeworICAgICAgICAgICAgbWFzayB8PSBrQWZmaW5lX01hc2s7CisgICAgICAgIH0KKworICAgICAgICBpZiAobTAwICE9IDEuIHx8IG0xMSAhPSAxLikgeworICAgICAgICAgICAgbWFzayB8PSBrU2NhbGVfTWFzazsKKyAgICAgICAgfQorCisgICAgICAgIGlmICgobWFzayAmIGtQZXJzcGVjdGl2ZV9NYXNrKSA9PSAwKSB7CisgICAgICAgICAgICAvLyBtYXAgbm9uLXplcm8gdG8gMQorICAgICAgICAgICAgaW50IGltMDAgPSBtMDAgIT0gMCA/IDEgOiAwOworICAgICAgICAgICAgaW50IGltMDEgPSBtMDEgIT0gMCA/IDEgOiAwOworICAgICAgICAgICAgaW50IGltMTAgPSBtMTAgIT0gMCA/IDEgOiAwOworICAgICAgICAgICAgaW50IGltMTEgPSBtMTEgIT0gMCA/IDEgOiAwOworCisgICAgICAgICAgICAvLyByZWNvcmQgaWYgdGhlIChwKXJpbWFyeSBhbmQgKHMpZWNvbmRhcnkgZGlhZ29uYWxzIGFyZSBhbGwgMCBvcgorICAgICAgICAgICAgLy8gYWxsIG5vbi16ZXJvIChhbnN3ZXIgaXMgMCBvciAxKQorICAgICAgICAgICAgaW50IGRwMCA9IChpbTAwIHwgaW0xMSkgXiAxOyAgLy8gdHJ1ZSBpZiBib3RoIGFyZSAwCisgICAgICAgICAgICBpbnQgZHAxID0gaW0wMCAmIGltMTE7ICAgICAgICAvLyB0cnVlIGlmIGJvdGggYXJlIDEKKyAgICAgICAgICAgIGludCBkczAgPSAoaW0wMSB8IGltMTApIF4gMTsgIC8vIHRydWUgaWYgYm90aCBhcmUgMAorICAgICAgICAgICAgaW50IGRzMSA9IGltMDEgJiBpbTEwOyAgICAgICAgLy8gdHJ1ZSBpZiBib3RoIGFyZSAxCisKKyAgICAgICAgICAgIC8vIHJldHVybiAxIGlmIHByaW1hcnkgaXMgMSBhbmQgc2Vjb25kYXJ5IGlzIDAgb3IKKyAgICAgICAgICAgIC8vIHByaW1hcnkgaXMgMCBhbmQgc2Vjb25kYXJ5IGlzIDEKKyAgICAgICAgICAgIG1hc2sgfD0gKChkcDAgJiBkczEpIHwgKGRwMSAmIGRzMCkpIDw8IGtSZWN0U3RheXNSZWN0X1NoaWZ0OworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG1hc2s7CisgICAgfQorC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gcGFpcnMgb2YgZmxvYXRzIFt4LCB5XS4KKyAgICAgICoKKyAgICAgICogQHBhcmFtIGRzdCAgIFRoZSBhcnJheSBvZiBkc3QgcG9pbnRzICh4LHkgcGFpcnMpCisgICAgICAqIEBwYXJhbSBkc3RJbmRleCBUaGUgaW5kZXggb2YgdGhlIGZpcnN0IFt4LHldIHBhaXIgb2YgZHN0IGZsb2F0cworICAgICAgKiBAcGFyYW0gc3JjICAgVGhlIGFycmF5IG9mIHNyYyBwb2ludHMgKHgseSBwYWlycykKKyAgICAgICogQHBhcmFtIHNyY0luZGV4IFRoZSBpbmRleCBvZiB0aGUgZmlyc3QgW3gseV0gcGFpciBvZiBzcmMgZmxvYXRzCisgICAgICAqIEBwYXJhbSBwb2ludENvdW50IFRoZSBudW1iZXIgb2YgcG9pbnRzICh4LHkgcGFpcnMpIHRvIHRyYW5zZm9ybQorICAgICAgKi8KKworICAgICBwcml2YXRlIHZvaWQgbWFwUG9pbnRzKGZsb2F0W10gZHN0LCBpbnQgZHN0SW5kZXgsIGZsb2F0W10gc3JjLCBpbnQgc3JjSW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcG9pbnRDb3VudCkgeworICAgICAgICAgLy9jaGVja1BvaW50QXJyYXlzKHNyYywgc3JjSW5kZXgsIGRzdCwgZHN0SW5kZXgsIHBvaW50Q291bnQpOworCisgICAgICAgICBmbG9hdFtdIHRtcERlc3QgPSBkc3Q7CisgICAgICAgICBib29sZWFuIGluUGxhY2UgPSBkc3QgPT0gc3JjOworICAgICAgICAgaWYgKGluUGxhY2UpIHsKKyAgICAgICAgICAgICB0bXBEZXN0ID0gbmV3IGZsb2F0W2RzdEluZGV4ICsgcG9pbnRDb3VudCAqIDJdOworICAgICAgICAgfQorCisgICAgICAgICBmb3IgKGludCBpID0gMCA7IGkgPCBwb2ludENvdW50IDsgaSsrKSB7CisgICAgICAgICAgICAgLy8ganVzdCBpbiBjYXNlIHdlIGFyZSBkb2luZyBpbiBwbGFjZSwgd2UgYmV0dGVyIHB1dCB0aGlzIGluIHRlbXAgdmFycworICAgICAgICAgICAgIGZsb2F0IHggPSBtVmFsdWVzWzBdICogc3JjW2kgKyBzcmNJbmRleF0gKworICAgICAgICAgICAgICAgICAgICAgICBtVmFsdWVzWzFdICogc3JjW2kgKyBzcmNJbmRleCArIDFdICsKKyAgICAgICAgICAgICAgICAgICAgICAgbVZhbHVlc1syXTsKKyAgICAgICAgICAgICBmbG9hdCB5ID0gbVZhbHVlc1szXSAqIHNyY1tpICsgc3JjSW5kZXhdICsKKyAgICAgICAgICAgICAgICAgICAgICAgbVZhbHVlc1s0XSAqIHNyY1tpICsgc3JjSW5kZXggKyAxXSArCisgICAgICAgICAgICAgICAgICAgICAgIG1WYWx1ZXNbNV07CisKKyAgICAgICAgICAgICB0bXBEZXN0W2kgKyBkc3RJbmRleF0gICAgID0geDsKKyAgICAgICAgICAgICB0bXBEZXN0W2kgKyBkc3RJbmRleCArIDFdID0geTsKKyAgICAgICAgIH0KKworICAgICAgICAgaWYgKGluUGxhY2UpIHsKKyAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHRtcERlc3QsIGRzdEluZGV4LCBkc3QsIGRzdEluZGV4LCBwb2ludENvdW50ICogMik7CisgICAgICAgICB9CisgICAgIH0KKworICAgICAvKioKKyAgICAgICogQXBwbHkgdGhpcyBtYXRyaXggdG8gdGhlIGFycmF5IG9mIDJEIHBvaW50cywgYW5kIHdyaXRlIHRoZSB0cmFuc2Zvcm1lZAorICAgICAgKiBwb2ludHMgYmFjayBpbnRvIHRoZSBhcnJheQorICAgICAgKgorICAgICAgKiBAcGFyYW0gcHRzIFRoZSBhcnJheSBbeDAsIHkwLCB4MSwgeTEsIC4uLl0gb2YgcG9pbnRzIHRvIHRyYW5zZm9ybS4KKyAgICAgICovCisKKyAgICAgcHJpdmF0ZSB2b2lkIG1hcFBvaW50cyhmbG9hdFtdIHB0cykgeworICAgICAgICAgbWFwUG9pbnRzKHB0cywgMCwgcHRzLCAwLCBwdHMubGVuZ3RoID4+IDEpOworICAgICB9CisKKyAgICAvKioKKyAgICAgKiBtdWx0aXBseSB0d28gbWF0cmljZXMgYW5kIHN0b3JlIHRoZW0gaW4gYSAzcmQuCisgICAgICogPHAvPlRoaXMgaW4gZWZmZWN0IGRvZXMgZGVzdCA9IGEqYgorICAgICAqIGRlc3QgY2Fubm90IGJlIHRoZSBzYW1lIGFzIGEgb3IgYi4KKyAgICAgKi8KKyAgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgbXVsdGlwbHkoZmxvYXQgZGVzdFtdLCBmbG9hdFtdIGEsIGZsb2F0W10gYikgeworICAgICAgICAvLyBmaXJzdCByb3cKKyAgICAgICAgZGVzdFswXSA9IGJbMF0gKiBhWzBdICsgYlsxXSAqIGFbM10gKyBiWzJdICogYVs2XTsKKyAgICAgICAgZGVzdFsxXSA9IGJbMF0gKiBhWzFdICsgYlsxXSAqIGFbNF0gKyBiWzJdICogYVs3XTsKKyAgICAgICAgZGVzdFsyXSA9IGJbMF0gKiBhWzJdICsgYlsxXSAqIGFbNV0gKyBiWzJdICogYVs4XTsKKworICAgICAgICAvLyAybmQgcm93CisgICAgICAgIGRlc3RbM10gPSBiWzNdICogYVswXSArIGJbNF0gKiBhWzNdICsgYls1XSAqIGFbNl07CisgICAgICAgIGRlc3RbNF0gPSBiWzNdICogYVsxXSArIGJbNF0gKiBhWzRdICsgYls1XSAqIGFbN107CisgICAgICAgIGRlc3RbNV0gPSBiWzNdICogYVsyXSArIGJbNF0gKiBhWzVdICsgYls1XSAqIGFbOF07CisKKyAgICAgICAgLy8gM3JkIHJvdworICAgICAgICBkZXN0WzZdID0gYls2XSAqIGFbMF0gKyBiWzddICogYVszXSArIGJbOF0gKiBhWzZdOworICAgICAgICBkZXN0WzddID0gYls2XSAqIGFbMV0gKyBiWzddICogYVs0XSArIGJbOF0gKiBhWzddOworICAgICAgICBkZXN0WzhdID0gYls2XSAqIGFbMl0gKyBiWzddICogYVs1XSArIGJbOF0gKiBhWzhdOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgYSBtYXRyaXggdGhhdCByZXByZXNlbnRzIGEgZ2l2ZW4gdHJhbnNsYXRlCisgICAgICogQHBhcmFtIGR4CisgICAgICogQHBhcmFtIGR5CisgICAgICogQHJldHVybgorICAgICAqLworICAgIC8qcGFja2FnZSovIHN0YXRpYyBmbG9hdFtdIGdldFRyYW5zbGF0ZShmbG9hdCBkeCwgZmxvYXQgZHkpIHsKKyAgICAgICAgcmV0dXJuIHNldFRyYW5zbGF0ZShuZXcgZmxvYXRbOV0sIGR4LCBkeSk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGZsb2F0W10gc2V0VHJhbnNsYXRlKGZsb2F0W10gZGVzdCwgZmxvYXQgZHgsIGZsb2F0IGR5KSB7CisgICAgICAgIGRlc3RbMF0gPSAxOworICAgICAgICBkZXN0WzFdID0gMDsKKyAgICAgICAgZGVzdFsyXSA9IGR4OworICAgICAgICBkZXN0WzNdID0gMDsKKyAgICAgICAgZGVzdFs0XSA9IDE7CisgICAgICAgIGRlc3RbNV0gPSBkeTsKKyAgICAgICAgZGVzdFs2XSA9IDA7CisgICAgICAgIGRlc3RbN10gPSAwOworICAgICAgICBkZXN0WzhdID0gMTsKKyAgICAgICAgcmV0dXJuIGRlc3Q7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGZsb2F0W10gZ2V0U2NhbGUoZmxvYXQgc3gsIGZsb2F0IHN5KSB7CisgICAgICAgIHJldHVybiBuZXcgZmxvYXRbXSB7IHN4LCAwLCAwLCAwLCBzeSwgMCwgMCwgMCwgMSB9OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgYSBtYXRyaXggdGhhdCByZXByZXNlbnRzIHRoZSBnaXZlbiBzY2FsZSBpbmZvLgorICAgICAqIEBwYXJhbSBzeAorICAgICAqIEBwYXJhbSBzeQorICAgICAqIEBwYXJhbSBweAorICAgICAqIEBwYXJhbSBweQorICAgICAqLworICAgIC8qcGFja2FnZSovIHN0YXRpYyBmbG9hdFtdIGdldFNjYWxlKGZsb2F0IHN4LCBmbG9hdCBzeSwgZmxvYXQgcHgsIGZsb2F0IHB5KSB7CisgICAgICAgIGZsb2F0W10gdG1wID0gbmV3IGZsb2F0WzldOworICAgICAgICBmbG9hdFtdIHRtcDIgPSBuZXcgZmxvYXRbOV07CisKKyAgICAgICAgLy8gVE9ETzogZG8gaXQgaW4gb25lIHBhc3MKKworICAgICAgICAvLyB0cmFuc2xhdGUgdG1wIHNvIHRoYXQgdGhlIHBpdm90IGlzIGluIDAsMAorICAgICAgICBzZXRUcmFuc2xhdGUodG1wLCAtcHgsIC1weSk7CisKKyAgICAgICAgLy8gc2NhbGUgaW50byB0bXAyCisgICAgICAgIG11bHRpcGx5KHRtcDIsIHRtcCwgZ2V0U2NhbGUoc3gsIHN5KSk7CisKKyAgICAgICAgLy8gdHJhbnNsYXRlIGJhY2sgdGhlIHBpdm90IGJhY2sgaW50byB0bXAKKyAgICAgICAgbXVsdGlwbHkodG1wLCB0bXAyLCBnZXRUcmFuc2xhdGUocHgsIHB5KSk7CisKKyAgICAgICAgcmV0dXJuIHRtcDsKKyAgICB9CisKKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBmbG9hdFtdIGdldFJvdGF0ZShmbG9hdCBkZWdyZWVzKSB7CisgICAgICAgIGRvdWJsZSByYWQgPSBNYXRoLnRvUmFkaWFucyhkZWdyZWVzKTsKKyAgICAgICAgZmxvYXQgc2luID0gKGZsb2F0KU1hdGguc2luKHJhZCk7CisgICAgICAgIGZsb2F0IGNvcyA9IChmbG9hdClNYXRoLmNvcyhyYWQpOworCisgICAgICAgIHJldHVybiBnZXRSb3RhdGUoc2luLCBjb3MpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBmbG9hdFtdIGdldFJvdGF0ZShmbG9hdCBzaW4sIGZsb2F0IGNvcykgeworICAgICAgICByZXR1cm4gc2V0Um90YXRlKG5ldyBmbG9hdFs5XSwgc2luLCBjb3MpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBmbG9hdFtdIHNldFJvdGF0ZShmbG9hdFtdIGRlc3QsIGZsb2F0IGRlZ3JlZXMpIHsKKyAgICAgICAgZG91YmxlIHJhZCA9IE1hdGgudG9SYWRpYW5zKGRlZ3JlZXMpOworICAgICAgICBmbG9hdCBzaW4gPSAoZmxvYXQpTWF0aC5zaW4ocmFkKTsKKyAgICAgICAgZmxvYXQgY29zID0gKGZsb2F0KU1hdGguY29zKHJhZCk7CisKKyAgICAgICAgcmV0dXJuIHNldFJvdGF0ZShkZXN0LCBzaW4sIGNvcyk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGZsb2F0W10gc2V0Um90YXRlKGZsb2F0W10gZGVzdCwgZmxvYXQgc2luLCBmbG9hdCBjb3MpIHsKKyAgICAgICAgZGVzdFswXSA9IGNvczsKKyAgICAgICAgZGVzdFsxXSA9IC1zaW47CisgICAgICAgIGRlc3RbMl0gPSAwOworICAgICAgICBkZXN0WzNdID0gc2luOworICAgICAgICBkZXN0WzRdID0gY29zOworICAgICAgICBkZXN0WzVdID0gMDsKKyAgICAgICAgZGVzdFs2XSA9IDA7CisgICAgICAgIGRlc3RbN10gPSAwOworICAgICAgICBkZXN0WzhdID0gMTsKKyAgICAgICAgcmV0dXJuIGRlc3Q7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGZsb2F0W10gZ2V0Um90YXRlKGZsb2F0IGRlZ3JlZXMsIGZsb2F0IHB4LCBmbG9hdCBweSkgeworICAgICAgICBmbG9hdFtdIHRtcCA9IG5ldyBmbG9hdFs5XTsKKyAgICAgICAgZmxvYXRbXSB0bXAyID0gbmV3IGZsb2F0WzldOworCisgICAgICAgIC8vIFRPRE86IGRvIGl0IGluIG9uZSBwYXNzCisKKyAgICAgICAgLy8gdHJhbnNsYXRlIHNvIHRoYXQgdGhlIHBpdm90IGlzIGluIDAsMAorICAgICAgICBzZXRUcmFuc2xhdGUodG1wLCAtcHgsIC1weSk7CisKKyAgICAgICAgLy8gcm90YXRlIGludG8gdG1wMgorICAgICAgICBkb3VibGUgcmFkID0gTWF0aC50b1JhZGlhbnMoZGVncmVlcyk7CisgICAgICAgIGZsb2F0IGNvcyA9IChmbG9hdClNYXRoLmNvcyhyYWQpOworICAgICAgICBmbG9hdCBzaW4gPSAoZmxvYXQpTWF0aC5zaW4ocmFkKTsKKyAgICAgICAgbXVsdGlwbHkodG1wMiwgdG1wLCBnZXRSb3RhdGUoc2luLCBjb3MpKTsKKworICAgICAgICAvLyB0cmFuc2xhdGUgYmFjayB0aGUgcGl2b3QgYmFjayBpbnRvIHRtcAorICAgICAgICBtdWx0aXBseSh0bXAsIHRtcDIsIGdldFRyYW5zbGF0ZShweCwgcHkpKTsKKworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBmbG9hdFtdIGdldFNrZXcoZmxvYXQga3gsIGZsb2F0IGt5KSB7CisgICAgICAgIHJldHVybiBuZXcgZmxvYXRbXSB7IDEsIGt4LCAwLCBreSwgMSwgMCwgMCwgMCwgMSB9OworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBmbG9hdFtdIGdldFNrZXcoZmxvYXQga3gsIGZsb2F0IGt5LCBmbG9hdCBweCwgZmxvYXQgcHkpIHsKKyAgICAgICAgZmxvYXRbXSB0bXAgPSBuZXcgZmxvYXRbOV07CisgICAgICAgIGZsb2F0W10gdG1wMiA9IG5ldyBmbG9hdFs5XTsKKworICAgICAgICAvLyBUT0RPOiBkbyBpdCBpbiBvbmUgcGFzcworCisgICAgICAgIC8vIHRyYW5zbGF0ZSBzbyB0aGF0IHRoZSBwaXZvdCBpcyBpbiAwLDAKKyAgICAgICAgc2V0VHJhbnNsYXRlKHRtcCwgLXB4LCAtcHkpOworCisgICAgICAgIC8vIHNrZXcga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qIFRoZSBvdXRlciBlZGdlcyBvZiBhIGpvaW4gbWVldCBpbiBhIGNpcmN1bGFyIGFyYy4KLSAgICAgICAgICovCi0gICAgICAgIFJPVU5EICAgKDEpLAotICAgICAgICAvKioKLSAgICAgICAgICogVGhlIG91dGVyIGVkZ2VzIG9mIGEgam9pbiBtZWV0IHdpdGggYSBzdHJhaWdodCBsaW5lCi0gICAgICAgICAqLwotICAgICAgICBCRVZFTCAgICgyKTsKLQotICAgICAgICBwcml2YXRlIEpvaW4oaW50IG5hdGl2ZUludCkgewotICAgICAgICAgICAgdGhpcy5uYXRpdmVJbnQgPSBuYXRpdmVJbnQ7Ci0gICAgICAgIH0KLSAgICAgICAgZmluYWwgaW50IG5hdGl2ZUludDsKLQotICAgICAgICAvKiogY3VzdG9tIGZvciBsYXlvdXRsaWIgKi8KLSAgICAgICAgcHVibGljIGludCBnZXRKYXZhSm9pbigpIHsKLSAgICAgICAgICAgIHN3aXRjaCAodGhpcykgewotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgY2FzZSBNSVRFUjoKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJhc2ljU3Ryb2tlLkpPSU5fTUlURVI7Ci0gICAgICAgICAgICAgICAgY2FzZSBST1VORDoKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJhc2ljU3Ryb2tlLkpPSU5fUk9VTkQ7Ci0gICAgICAgICAgICAgICAgY2FzZSBCRVZFTDoKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJhc2ljU3Ryb2tlLkpPSU5fQkVWRUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBBbGlnbiBzcGVjaWZpZXMgaG93IGRyYXdUZXh0IGFsaWducyBpdHMgdGV4dCByZWxhdGl2ZSB0byB0aGUKLSAgICAgKiBbeCx5XSBjb29yZGluYXRlcy4gVGhlIGRlZmF1bHQgaXMgTEVGVC4KLSAgICAgKi8KLSAgICBwdWJsaWMgZW51bSBBbGlnbiB7Ci0gICAgICAgIC8qKgotICAgICAgICAgKiBUaGUgdGV4dCBpcyBkcmF3biB0byB0aGUgcmlnaHQgb2YgdGhlIHgseSBvcmlnaW4KLSAgICAgICAgICovCi0gICAgICAgIExFRlQgICAgKDApLAotICAgICAgICAvKioKLSAgICAgICAgICogVGhlIHRleHQgaXMgZHJhd24gY2VudGVyZWQgaG9yaXpvbnRhbGx5IG9uIHRoZSB4LHkgb3JpZ2luCi0gICAgICAgICAqLwotICAgICAgICBDRU5URVIgICgxKSwKLSAgICAgICAgLyoqCi0gICAgICAgICAqIFRoZSB0ZXh0IGlzIGRyYXduIHRvIHRoZSBsZWZ0IG9mIHRoZSB4LHkgb3JpZ2luCi0gICAgICAgICAqLwotICAgICAgICBSSUdIVCAgICgyKTsKLQotICAgICAgICBwcml2YXRlIEFsaWduKGludCBuYXRpdmVJbnQpIHsKLSAgICAgICAgICAgIHRoaXMubmF0aXZlSW50ID0gbmF0aXZlSW50OwotICAgICAgICB9Ci0gICAgICAgIGZpbmFsIGludCBuYXRpdmVJbnQ7Ci0gICAgfQotCi0gICAgcHVibGljIFBhaW50KCkgewotICAgICAgICB0aGlzKDApOwotICAgIH0KLQotICAgIC8qCi0gICAgICogRG8gbm90IHJlbW92ZSBvciBjb20uYW5kcm9pZC5sYXlvdXRsaWIuYnJpZGdlLlRlc3RDbGFzc1JlcGxhY2VtZW50IGZhaWxzLgotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIGZpbmFsaXplKCkgeyB9Ci0KLSAgICBwdWJsaWMgUGFpbnQoaW50IGZsYWdzKSB7Ci0gICAgICAgIHNldEZsYWdzKGZsYWdzIHwgREVGQVVMVF9QQUlOVF9GTEFHUyk7Ci0gICAgICAgIGluaXRGb250KCk7Ci0gICAgfQotCi0gICAgcHVibGljIFBhaW50KFBhaW50IHBhaW50KSB7Ci0gICAgICAgIHNldChwYWlud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mplY3RzIGFzIHdlbGwgYXMgRm9udE1ldHJpY3MsIGJhc2VkIG9uIHRoZSBjdXJyZW50IHRleHQgc2l6ZQotICAgICAgICAgICAgLy8gYW5kIHNrZXcgaW5mby4KLSAgICAgICAgICAgIEFycmF5TGlzdDxGb250SW5mbz4gaW5mb0xpc3QgPSBuZXcgQXJyYXlMaXN0PEZvbnRJbmZvPihmb250cy5zaXplKCkpOwotICAgICAgICAgICAgZm9yIChGb250IGZvbnQgOiBmb250cykgewotICAgICAgICAgICAgICAgIEZvbnRJbmZvIGluZm8gPSBuZXcgRm9udEluZm8oKTsKLSAgICAgICAgICAgICAgICBpbmZvLm1Gb250ID0gZm9udC5kZXJpdmVGb250KG1UZXh0U2l6ZSk7Ci0gICAgICAgICAgICAgICAgaWYgKG1TY2FsZVggIT0gMS4wIHx8IG1Ta2V3WCAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IHN1cHBvcnQgc2tldwotICAgICAgICAgICAgICAgICAgICBpbmZvLm1Gb250ID0gaW5mby5tRm9udC5kZXJpdmVGb250KG5ldyBBZmZpbmVUcmFuc2Zvcm0oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNjYWxlWCwgbVNrZXdYLCAwLCAwLCAxLCAwKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGluZm8ubU1ldHJpY3MgPSBUb29sa2l0LmdldERlZmF1bHRUb29sa2l0KCkuZ2V0Rm9udE1ldHJpY3MoaW5mby5tRm9udCk7Ci0KLSAgICAgICAgICAgICAgICBpbmZvTGlzdC5hZGQoaW5mbyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1Gb250cyA9IENvbGxlY3Rpb25zLnVubW9kaWZpYWJsZUxpc3QoaW5mb0xpc3QpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSA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XRyaWMgdmFsdWVzIGluIGl0LgotICAgICAqCi0gICAgICogQHBhcmFtIG1ldHJpY3MgSWYgdGhpcyBvYmplY3QgaXMgbm90IG51bGwsIGl0cyBmaWVsZHMgYXJlIGZpbGxlZCB3aXRoCi0gICAgICogICAgICAgICAgICAgICAgdGhlIGFwcHJvcHJpYXRlIHZhbHVlcyBnaXZlbiB0aGUgcGFpbnQncyB0ZXh0IGF0dHJpYnV0ZXMuCi0gICAgICogQHJldHVybiB0aGUgZm9udCdzIHJlY29tbWVuZGVkIGludGVybGluZSBzcGFjaW5nLgotICAgICAqLwotICAgIHB1YmxpYyBmbG9hdCBnZXRGb250TWV0cmljcyhGb250TWV0cmljcyBtZXRyaWNzKSB7Ci0gICAgICAgIGlmIChtRm9udHMuc2l6ZSgpID4gMCkgewotICAgICAgICAgICAgamF2YS5hd3QuRm9udE1ldHJpY3MgamF2YU1ldHJpY3MgPSBtRm9udHMuZ2V0KDApLm1NZXRyaWNzOwotICAgICAgICAgICAgaWYgKG1ldHJpY3MgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIEFuZHJvaWQgZXhwZWN0cyBuZWdhdGl2ZSBhc2NlbnQgc28gd2UgaW52ZXJ0IHRoZSB2YWx1ZSBmcm9tIEphdmEuCi0gICAgICAgICAgICAgICAgbWV0cmljcy50b3AgPSAtIGphdmFNZXRyaWNzLmdldE1heEFzY2VudCgpOwotICAgICAgICAgICAgICAgIG1ldHJpY3MuYXNjZW50ID0gLSBqYXZhTWV0cmljcy5nZXRBc2NlbnQoKTsKLSAgICAgICAgICAgICAgICBtZXRyaWNzLmRlc2NlbnQgPSBqYXZhTWV0cmljcy5nZXREZXNjZW50KCk7Ci0gICAgICAgICAgICAgICAgbWV0cmljcy5ib3R0b20gPSBqYXZhTWV0cmljcy5nZXRNYXhEZXNjZW50KCk7Ci0gICAgICAgICAgICAgICAgbWV0cmljcy5sZWFkaW5nID0gamF2YU1ldHJpY3MuZ2V0TGVhZGluZygpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gamF2YU1ldHJpY3MuZ2V0SGVpZ2h0KCk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gMDsKLSAgICB9Ci0KLSAgICBwdWJsaWMgaW50IGdldEZvbnRNZXRyaWNzSW50KEZvbnRNZXRyaWNzSW50IG1ldHJpY3MpIHsKLSAgICAgICAgaWYgKG1Gb250cy5zaXplKCkgPiAwKSB7Ci0gICAgICAgICAgICBqYXZhLmF3dC5Gb250TWV0cmljcyBqYXZhTWV0cmljcyA9IG1Gb250cy5nZXQoMCkubU1ldHJpY3M7Ci0gICAgICAgICAgICBpZiAobWV0cmljcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgLy8gQW5kcm9pZCBleHBlY3RzIG5lZ2F0aXZlIGFzY2VudCBzbyB3ZSBpbnZlcnQgdGhlIHZhbHVlIGZyb20gSmF2YS4KLSAgICAgICAgICAgICAgICBtZXRyaWNzLnRvcCA9IC0gamF2YU1ldHJpY3MuZ2V0TWF4QXNjZW50KCk7Ci0gICAgICAgICAgICAgICAgbWV0cmljcy5hc2NlbnQgPSAtIGphdmFNZXRyaWNzLmdldEFzY2VudCgpOwotICAgICAgICAgICAgICAgIG1ldHJpY3MuZGVzY2VudCA9IGphdmFNZXRyaWNzLmdldERlc2NlbnQoKTsKLSAgICAgICAgICAgICAgICBtZXRyaWNzLmJvdHRvbSA9IGphdmFNZXRyaWNzLmdldE1heERlc2NlbnQoKTsKLSAgICAgICAgICAgICAgICBtZXRyaWNzLmxlYWRpbmcgPSBqYXZhTWV0cmljcy5nZXRMZWFkaW5nKCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBqYXZhTWV0cmljcy5nZXRIZWlnaHQoKTsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiAwOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJlaW1wbGVtZW50ZWQgdG8gcmV0dXJuIFBhaW50LkZvbnRNZXRyaWNzIGluc3RlYWQgb2YgX09yaWdpbmFsX1BhaW50LkZvbnRNZXRyaWNzCi0gICAgICovCi0gICAgcHVibGljIEZvbnRNZXRyaWNzIGdldEZvbnRNZXRyaWNzKCkgewotICAgICAgICBGb250TWV0cmljcyBmbSA9IG5ldyBGb250TWV0cmljcygpOwotICAgICAgICBnZXRGb250TWV0cmljcyhmbSk7Ci0gICAgICAgIHJldHVybiBmbTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBSZWltcGxlbWVudGVkIHRvIHJldHVybiBQYWludC5Gb250TWV0cmljc0ludCBpbnN0ZWFkIG9mIF9PcmlnaW5hbF9QYWludC5Gb250TWV0cmljc0ludAotICAgICAqLwotICAgIHB1YmxpYyBGb250TWV0cmljc0ludCBnZXRGb250TWV0cmljc0ludCgpIHsKLSAgICAgICAgRm9udE1ldHJpY3NJbnQgZm0gPSBuZXcgRm9udE1ldHJpY3NJbnQoKTsKLSAgICAgICAgZ2V0Rm9udE1ldHJpY3NJbnQoZm0pOwotICAgICAgICByZXR1cm4gZm07Ci0gICAgfQotCi0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBmbG9hdCBnZXRGb250TWV0cmljcyhfT3JpZ2luYWxfUGFpbnQuRm9udE1ldHJpY3MgbWV0cmljcykgewotICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oIkNBTEwgVE8gUEFSRU5UIEZPUkJJRERFTiIpOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBpbnQgZ2V0Rm9udE1ldHJpY3NJbnQoX09yaWdpbmFsX1BhaW50LkZvbnRNZXRyaWNzSW50IG1ldHJpY3MpIHsKLSAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCJDQUxMIFRPIFBBUkVOVCBGT1JCSURERU4iKTsKLSAgICB9Ci0KLSAgICBAT3ZlcnJpZ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hbmNlIGFib3ZlIChuZWdhdGl2ZSkgdGhlIGJhc2VsaW5lIChhc2NlbnQpIGJhc2VkIG9uIHRoZQotICAgICAqICAgICAgICAgY3VycmVudCB0eXBlZmFjZSBhbmQgdGV4dCBzaXplLgotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBmbG9hdCBhc2NlbnQoKSB7Ci0gICAgICAgIGlmIChtRm9udHMuc2l6ZSgpID4gMCkgewotICAgICAgICAgICAgamF2YS5hd3QuRm9udE1ldHJpY3MgamF2YU1ldHJpY3MgPSBtRm9udHMuZ2V0KDApLm1NZXRyaWNzOwotICAgICAgICAgICAgLy8gQW5kcm9pZCBleHBlY3RzIG5lZ2F0aXZlIGFzY2VudCBzbyB3ZSBpbnZlcnQgdGhlIHZhbHVlIGZyb20gSmF2YS4KLSAgICAgICAgICAgIHJldHVybiAtIGphdmFNZXRyaWNzLmdldEFzY2VudCgpOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIDA7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogUmV0dXJuIHRoZSBkaXN0YW5jZSBiZWxvdyAocG9zaXRpdmUpIHRoZSBiYXNlbGluZSAoZGVzY2VudCkgYmFzZWQgb24gdGhlCi0gICAgICogY3VycmVudCB0eXBlZmFjZSBhbmQgdGV4dCBzaXplLgotICAgICAqCi0gICAgICogQHJldHVybiB0aGUgZGlzdGFuY2UgYmVsb3cgKHBvc2l0aXZlKSB0aGUgYmFzZWxpbmUgKGRlc2NlbnQpIGJhc2VkIG9uCi0gICAgICogICAgICAgICB0aGUgY3VycmVudCB0eXBlZmFjZSBhbmQgdGV4dCBzaXplLgotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBmbG9hdCBkZXNjZW50KCkgewotICAgICAgICBpZiAobUZvbnRzLnNpemUoKSA+IDApIHsKLSAgICAgICAgICAgIGphdmEuYXd0LkZvbnRNZXRyaWNzIGphdmFNZXRyaWNzID0gbUZvbnRzLmdld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lsZSAoaSA8IGxhc3RJbmRleCkgewotICAgICAgICAgICAgICAgIC8vIGFsd2F5cyBzdGFydCB3aXRoIHRoZSBtYWluIGZvbnQuCi0gICAgICAgICAgICAgICAgaW50IHVwVG8gPSBtYWluRm9udC5tRm9udC5jYW5EaXNwbGF5VXBUbyh0ZXh0LCBpLCBsYXN0SW5kZXgpOwotICAgICAgICAgICAgICAgIGlmICh1cFRvID09IC0xKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHNob3J0Y3V0IHRvIGV4aXQKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsICsgbWFpbkZvbnQubU1ldHJpY3MuY2hhcnNXaWR0aCh0ZXh0LCBpLCBsYXN0SW5kZXggLSBpKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHVwVG8gPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRvdGFsICs9IG1haW5Gb250Lm1NZXRyaWNzLmNoYXJzV2lkdGgodGV4dCwgaSwgdXBUbyAtIGkpOwotICAgICAgICAgICAgICAgICAgICBpID0gdXBUbzsKLSAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgY2FsbCBjb250aW51ZSBhdCB0aGlzIHBvaW50LiBTaW5jZSBpdCBpcyBjZXJ0YWluIHRoZSBtYWluIGZvbnQKLSAgICAgICAgICAgICAgICAgICAgLy8gY2Fubm90IGRpc3BsYXkgdGhlIGZvbnQgYSBpbmRleCB1cFRvIChub3cgPT1pKSwgd2UgbW92ZSBvbiB0byB0aGUKLSAgICAgICAgICAgICAgICAgICAgLy8gZmFsbGJhY2sgZm9udHMgZGlyZWN0bHkuCi0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gbm8gY2hhciBzdXBwb3J0ZWQsIGF0dGVtcHQgdG8gcmVhZCB0aGUgbmV4dCBjaGFyKHMpIHdpdGggdGhlCi0gICAgICAgICAgICAgICAgLy8gZmFsbGJhY2sgZm9udC4gSW4gdGhpcyBjYXNlIHdlIG9ubHkgdGVzdCB0aGUgZmlyc3QgY2hhcmFjdGVyCi0gICAgICAgICAgICAgICAgLy8gYW5kIHRoZW4gZ28gYmFjayB0byB0ZXN0IHdpdGggdGhlIG1haW4gZm9udC4KLSAgICAgICAgICAgICAgICAvLyBTcGVjaWFsIHRlc3QgZm9yIDItY2hhciBjaGFyYWN0ZXJzLgotICAgICAgICAgICAgICAgIGJvb2xlYW4gZm91bmRGb250ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgZiA9IDEgOyBmIDwgbUZvbnRzLnNpemUoKSA7IGYrKykgewotICAgICAgICAgICAgICAgICAgICBGb250SW5mbyBmb250SW5mbyA9IG1Gb250cy5nZXQoZik7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gbmVlZCB0byBjaGVjayB0aGF0IHRoZSBmb250IGNhbiBkaXNwbGF5IHRoZSBjaGFyYWN0ZXIuIFdlIHRlc3QKLSAgICAgICAgICAgICAgICAgICAgLy8gZGlmZmVyZW50bHkgaWYgdGhlIGNoYXIgaXMgYSBoaWdoIHN1cnJvZ2F0ZS4KLSAgICAgICAgICAgICAgICAgICAgaW50IGNoYXJDb3VudCA9IENoYXJhY3Rlci5pc0hpZ2hTdXJyb2dhdGUodGV4dFtpXSkgPyAyIDogMTsKLSAgICAgICAgICAgICAgICAgICAgdXBUbyA9IGZvbnRJbmZvLm1Gb250LmNhbkRpc3BsYXlVcFRvKHRleHQsIGksIGkgKyBjaGFyQ291bnQpOwotICAgICAgICAgICAgICAgICAgICBpZiAodXBUbyA9PSAtMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgdG90YWwgKz0gZm9udEluZm8ubU1ldHJpY3MuY2hhcnNXaWR0aCh0ZXh0LCBpLCBjaGFyQ291bnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgaSArPSBjaGFyQ291bnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmb3VuZEZvbnQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8vIGluIGNhc2Ugbm8gZm9udCBjYW4gZGlzcGxheSB0aGUgY2hhciwgbWVhc3VyZSBpdCB3aXRoIHRoZSBtYWluIGZvbnQuCi0gICAgICAgICAgICAgICAgaWYgKGZvdW5kRm9udCA9PSBmYWxzZSkgewotICAgICAgICAgICAgICAgICAgICBpbnQgc2l6ZSA9IENoYXJhY3Rlci5pc0hpZ2hTdXJyb2dhdGUodGV4dFtpXSkgPyAyIDogMTsKLSAgICAgICAgICAgICAgICAgICAgdG90YWwgKz0gbWFpbkZvbnQubU1ldHJpY3MuY2hhcnNXaWR0aCh0ZXh0LCBpLCBzaXplKTsKLSAgICAgICAgICAgICAgICAgICAgaSArPSBzaXplOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiAwOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJldHVybiB0aGUgd2lkdGggb2YgdGhlIHRleHQuCi0gICAgICoKLSAgICAgKiBAcGFyYW0gdGV4dCAgVGhlIHRleHQgdG8gbWVhc3VyZQotICAgICAqIEBwYXJhbSBzdGFydCBUaGUgaW5kZXggb2YgdGhlIGZpcnN0IGNoYXJhY3RlciB0byBzdGFydCBtZWFzdXJpbmcKLSAgICAgKiBAcGFyYW0gZW5kICAgMSBiZXlvbmQgdGhlIGluZGV4IG9mIHRoZSBsYXN0IGNoYXJhY3RlciB0byBtZWFzdXJlCi0gICAgICogQHJldHVybiAgICAgIFRoZSB3aWR0aCBvZiB0aGUgdGV4dAotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBmbG9hdCBtZWFzdXJlVGV4dChTdHJpbmcgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kKSB7Ci0gICAgICAgIHJldHVybiBtZWFzdXJlVGV4dCh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gICAgICAgICAgICBpZiAoaSA8IGluZGV4KSB7Ci0gICAgICAgICAgICAgICAgc3RhcnQgPSBpOwotICAgICAgICAgICAgICAgIGVuZCA9IGluZGV4OwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzdGFydCA9IGluZGV4OwotICAgICAgICAgICAgICAgIGVuZCA9IGk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIG1lYXN1cmUgZnJvbSBzdGFydCB0byBlbmQKLSAgICAgICAgICAgIGZsb2F0IHJlcyA9IG1lYXN1cmVUZXh0KHRleHQsIHN0YXJ0LCBlbmQgLSBzdGFydCArIDEpOwotCi0gICAgICAgICAgICBpZiAobWVhc3VyZWRXaWR0aCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbWVhc3VyZWRXaWR0aFttZWFzdXJlSW5kZXhdID0gcmVzOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtZWFzdXJlQWNjICs9IHJlczsKLSAgICAgICAgICAgIGlmIChyZXMgPiBtYXhXaWR0aCkgewotICAgICAgICAgICAgICAgIC8vIHdlIHNob3VsZCBub3QgcmV0dXJuIHRoaXMgY2hhciBpbmRleCwgYnV0IHNpbmNlIGl0J3MgMC1iYXNlZCBhbmQgd2UgbmVlZAotICAgICAgICAgICAgICAgIC8vIHRvIHJldHVybiBhIGNvdW50LCB3ZSBzaW1wbHkgcmV0dXJuIG1lYXN1cmVJbmRleDsKLSAgICAgICAgICAgICAgICByZXR1cm4gbWVhc3VyZUluZGV4OwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gbWVhc3VyZUluZGV4OwotICAgIH0KLQotICAgIC8qKgotICAgICAqIE1lYXN1cmUgdGhlIHRleHQsIHN0b3BwaW5nIGVhcmx5IGlmIHRoZSBtZWFzdXJlZCB3aWR0aCBleGNlZWRzIG1heFdpZHRoLgotICAgICAqIFJldHVybiB0aGUgbnVtYmVyIG9mIGNoYXJzIHRoYXQgd2VyZSBtZWFzdXJlZCwgYW5kIGlmIG1lYXN1cmVkV2lkdGggaXMKLSAgICAgKiBub3QgbnVsbCwgcmV0dXJuIGluIGl0IHRoZSBhY3R1YWwgd2lkdGggbWVhc3VyZWQuCi0gICAgICoKLSAgICAgKiBAcGFyYW0gdGV4dCAgVGhlIHRleHQgdG8gbWVhc3VyZQotICAgICAqIEBwYXJhbSBtZWFzdXJlRm9yd2FyZHMgSWYgdHJ1ZSwgbWVhc3VyZSBmb3J3YXJkcywgc3RhcnRpbmcgYXQgaW5kZXguCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICBPdGhlcndpc2UsIG1lYXN1cmUgYmFja3dhcmRzLCBzdGFydGluZyB3aXRoIHRoZQotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgbGFzdCBjaGFyYWN0ZXIgaW4gdGhlIHN0cmluZy4KLSAgICAgKiBAcGFyYW0gbWF4V2lkdGggVGhlIG1heGltdW0gd2lkdGggdG8gYWNjdW11bGF0ZS4KLSAgICAgKiBAcGFyYW0gbWVhc3VyZWRXaWR0aCBPcHRpb25hbC4gSWYgbm90IG51bGwsIHJldHVybnMgdGhlIGFjdHVhbCB3aWR0aAotICAgICAqICAgICAgICAgICAgICAgICAgICAgbWVhc3VyZWQuCi0gICAgICogQHJldHVybiBUaGUgbnVtYmVyIG9mIGNoYXJzIHRoYXQgd2VyZSBtZWFzdXJlZC4gV2lsbCBhbHdheXMgYmUgPD0KLSAgICAgKiAgICAgICAgIGFicyhjb3VudCkuCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGludCBicmVha1RleHQoU3RyaW5nIHRleHQsIGJvb2xlYW4gbWVhc3VyZUZvcndhcmRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBtYXhXaWR0aCwgZmxvYXRbXSBtZWFzdXJlZFdpZHRoKSB7Ci0gICAgICAgIHJldHVybiBicmVha1RleHQodGV4dCwKLSAgICAgICA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W0gaW5kZXggICAgVGhlIGluZGV4IG9mIHRoZSBmaXJzdCBjaGFyIHRvIHRvIG1lYXN1cmUKLSAgICAgKiBAcGFyYW0gY291bnQgICAgVGhlIG51bWJlciBvZiBjaGFycyBzdGFydGluZyB3aXRoIGluZGV4IHRvIG1lYXN1cmUKLSAgICAgKiBAcGFyYW0gd2lkdGhzICAgYXJyYXkgdG8gcmVjZWl2ZSB0aGUgYWR2YW5jZSB3aWR0aHMgb2YgdGhlIGNoYXJhY3RlcnMuCi0gICAgICogICAgICAgICAgICAgICAgIE11c3QgYmUgYXQgbGVhc3QgYSBsYXJnZSBhcyBjb3VudC4KLSAgICAgKiBAcmV0dXJuICAgICAgICAgdGhlIGFjdHVhbCBudW1iZXIgb2Ygd2lkdGhzIHJldHVybmVkLgotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBpbnQgZ2V0VGV4dFdpZHRocyhjaGFyW10gdGV4dCwgaW50IGluZGV4LCBpbnQgY291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0W10gd2lkdGhzKSB7Ci0gICAgICAgIGlmIChtRm9udHMuc2l6ZSgpID4gMCkgewotICAgICAgICAgICAgaWYgKChpbmRleCB8IGNvdW50KSA8IDAgfHwgaW5kZXggKyBjb3VudCA+IHRleHQubGVuZ3RoCi0gICAgICAgICAgICAgICAgICAgIHx8IGNvdW50ID4gd2lkdGhzLmxlbmd0aCkgewotICAgICAgICAgICAgICAgIHRocm93IG5ldyBBcnJheUluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gRklYTUU6IGhhbmRsZSBtdWx0aS1jaGFyIGNoYXJhY3RlcnMuCi0gICAgICAgICAgICAvLyBOZWVkIHRvIGZpZ3VyZSBvdXQgaWYgdGhlIGxlbmd0aHMgb2YgdGhlIHdpZHRoIGFycmF5IHRha2VzIGludG8gYWNjb3VudAotICAgICAgICAgICAgLy8gbXVsdGktY2hhciBjaGFyYWN0ZXJzLgotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgY2hhciBjID0gdGV4dFtpICsgaW5kZXhdOwotICAgICAgICAgICAgICAgIGJvb2xlYW4gZm91bmQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBmb3IgKEZvbnRJbmZvIGluZm8gOiBtRm9udHMpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGluZm8ubUZvbnQuY2FuRGlzcGxheShjKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzW2ldID0gaW5mby5tTWV0cmljcy5jaGFyV2lkdGgoYyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChmb3VuZCA9PSBmYWxzZSkgewotICAgICAgICAgICAgICAgICAgICAvLyB3ZSBzdG9wIHRoZXJlLgotICAgICAgICAgICAgICAgICAgICByZXR1cm4gaTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBjb3VudDsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiAwOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJldHVybiB0aGUgYWR2YW5jZSB3aWR0aHMgZm9yIHRoZSBjaGFyYWN0ZXJzIGluIHRoZSBzdHJpbmcuCi0gICAgICoKLSAgICAgKiBAcGFyYW0gdGV4dCAgIFRoZSB0ZXh0IHRvIG1lYXN1cmUKLSAgICAgKiBAcGFyYW0gc3RhcnQgIFRoZSBpbmRleCBvZiB0aGUgZmlyc3QgY2hhciB0byB0byBtZWFzdXJlCi0gICAgICogQHBhcmFtIGVuZCAgICBUaGUgZW5kIG9mIHRoZ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CwwKS4KLSAgICAgKgotICAgICAqIEBwYXJhbSB0ZXh0ICBBcnJheSBvZiBjaGFycyB0byBtZWFzdXJlIGFuZCByZXR1cm4gdGhlaXIgdW5pb25lZCBib3VuZHMKLSAgICAgKiBAcGFyYW0gaW5kZXggSW5kZXggb2YgdGhlIGZpcnN0IGNoYXIgaW4gdGhlIGFycmF5IHRvIG1lYXN1cmUKLSAgICAgKiBAcGFyYW0gY291bnQgVGhlIG51bWJlciBvZiBjaGFycywgYmVnaW5uaW5nIGF0IGluZGV4LCB0byBtZWFzdXJlCi0gICAgICogQHBhcmFtIGJvdW5kcyBSZXR1cm5zIHRoZSB1bmlvbmVkIGJvdW5kcyBvZiBhbGwgdGhlIHRleHQuIE11c3QgYmUKLSAgICAgKiAgICAgICAgICAgICAgIGFsbG9jYXRlZCBieSB0aGUgY2FsbGVyLgotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIGdldFRleHRCb3VuZHMoY2hhcltdIHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LCBSZWN0IGJvdW5kcykgewotICAgICAgICAvLyBGSVhNRQotICAgICAgICBpZiAobUZvbnRzLnNpemUoKSA+IDApIHsKLSAgICAgICAgICAgIGlmICgoaW5kZXggfCBjb3VudCkgPCAwIHx8IGluZGV4ICsgY291bnQgPiB0ZXh0Lmxlbmd0aCkgewotICAgICAgICAgICAgICAgIHRocm93IG5ldyBBcnJheUluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChib3VuZHMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigibmVlZCBib3VuZHMgUmVjdCIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBGb250SW5mbyBtYWluSW5mbyA9IG1Gb250cy5nZXQoMCk7Ci0KLSAgICAgICAgICAgIFJlY3RhbmdsZTJEIH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bmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX3BhaW50KTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBsaXN0IG9mIHtAbGluayBGb250fSBvYmplY3RzLiBUaGUgZmlyc3QgaXRlbSBpcyB0aGUgbWFpbiBmb250LCB0aGUgcmVzdAorICAgICAqIGFyZSBmYWxsIGJhY2tzIGZvciBjaGFyYWN0ZXJzIG5vdCBwcmVzZW50IGluIHRoZSBtYWluIGZvbnQuCisgICAgICovCisgICAgcHVibGljIExpc3Q8Rm9udEluZm8+IGdldEZvbnRzKCkgeworICAgICAgICByZXR1cm4gbUZvbnRzOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzRmlsdGVyQml0bWFwKCkgeworICAgICAgICByZXR1cm4gKG1GbGFncyAmIFBhaW50LkZJTFRFUl9CSVRNQVBfRkxBRykgIT0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFN0eWxlKCkgeworICAgICAgICByZXR1cm4gbVN0eWxlOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0Q29sb3IoKSB7CisgICAgICAgIHJldHVybiBtQ29sb3I7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRBbHBoYSgpIHsKKyAgICAgICAgcmV0dXJuIG1Db2xvciA+Pj4gMjQ7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRUZXh0QWxpZ24oKSB7CisgICAgICAgIHJldHVybiBtVGV4dEFsaWduOworICAgIH0KKworICAgIHB1YmxpYyBmbG9hdCBnZXRTdHJva2VXaWR0aCgpIHsKKyAgICAgICAgcmV0dXJuIG1TdHJva2VXaWR0aDsKKyAgICB9CisKKyAgICBwdWJsaWMgZmxvYXQgZ2V0U3Ryb2tlTWl0ZXIoKSB7CisgICAgICAgIHJldHVybiBtU3Ryb2tlTWl0ZXI7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRKYXZhQ2FwKCkgeworICAgICAgICBzd2l0Y2ggKFBhaW50LnNDYXBBcnJheVttQ2FwXSkgeworICAgICAgICAgICAgY2FzZSBCVVRUOgorICAgICAgICAgICAgICAgIHJldHVybiBCYXNpY1N0cm9rZS5DQVBfQlVUVDsKKyAgICAgICAgICAgIGNhc2UgUk9VTkQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIEJhc2ljU3Ryb2tlLkNBUF9ST1VORDsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBjYXNlIFNRVUFSRToKKyAgICAgICAgICAgICAgICByZXR1cm4gQmFzaWNTdHJva2UuQ0FQX1NRVUFSRTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0SmF2YUpvaW4oKSB7CisgICAgICAgIHN3aXRjaCAoUGFpbnQuc0pvaW5BcnJheVttSm9pbl0pIHsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBjYXNlIE1JVEVSOgorICAgICAgICAgICAgICAgIHJldHVybiBCYXNpY1N0cm9rZS5KT0lOX01JVEVSOworICAgICAgICAgICAgY2FzZSBST1VORDoKKyAgICAgICAgICAgICAgICByZXR1cm4gQmFzaWNTdHJva2UuSk9JTl9ST1VORDsKKyAgICAgICAgICAgIGNhc2UgQkVWRUw6CisgICAgICAgICAgICAgICAgcmV0dXJuIEJhc2ljU3Ryb2tlLkpPSU5fQkVWRUw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyAtLS0tIG5hdGl2ZSBtZXRob2RzIC0tLS0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBpbnQgZ2V0RmxhZ3MoUGFpbnQgdGhpc1BhaW50KSB7CisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUgZnJvbSB0aGUgbmF0aXZlIGludC4KKyAgICAgICAgUGFpbnRfRGVsZWdhdGUgZGVsZWdhdGUgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZSh0aGlzUGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICAgICAgaWYgKGRlbGVnYXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGRlbGVnYXRlLm1GbGFnczsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBzZXRGbGFncyhQYWludCB0aGlzUGFpbnQsIGludCBmbGFncykgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIFBhaW50X0RlbGVnYXRlIGRlbGVnYXRlID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUodGhpc1BhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIGlmIChkZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBkZWxlZ2F0ZS5tRmxhZ3MgPSBmbGFnczsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBzZXRGaWx0ZXJCaXRtYXAoUGFpbnQgdGhpc1BhaW50LCBib29sZWFuIGZpbHRlcikgeworICAgICAgICBzZXRGbGFnKHRoaXNQYWludCwgUGFpbnQuRklMVEVSX0JJVE1BUF9GTEFHLCBmaWx0ZXIpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIHNldEFudGlBbGlhcyhQYWludCB0aGlzUGFpbnQsIGJvb2xlYW4gYWEpIHsKKyAgICAgICAgc2V0RmxhZyh0aGlzUGFpbnQsIFBhaW50LkFOVElfQUxJQVNfRkxBRywgYWEpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIHNldFN1YnBpeGVsVGV4dChQYWludCB0aGlzUGFpbnQsIGJvb2xlYW4gc3VicGl4ZWxUZXh0KSB7CisgICAgICAg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RfRkxBRywgbGluZWFyVGV4dCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGludCBnZXRDb2xvcihQYWludCB0aGlzUGFpbnQpIHsKKyAgICAgICAgLy8gZ2V0IHRoZSBkZWxlZ2F0ZSBmcm9tIHRoZSBuYXRpdmUgaW50LgorICAgICAgICBQYWludF9EZWxlZ2F0ZSBkZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKHRoaXNQYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICBpZiAoZGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gZGVsZWdhdGUubUNvbG9yOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyB2b2lkIHNldENvbG9yKFBhaW50IHRoaXNQYWludCwgaW50IGNvbG9yKSB7CisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUgZnJvbSB0aGUgbmF0aXZlIGludC4KKyAgICAgICAgUGFpbnRfRGVsZWdhdGUgZGVsZWdhdGUgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZSh0aGlzUGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICAgICAgaWYgKGRlbGVnYXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGRlbGVnYXRlLm1Db2xvciA9IGNvbG9yOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBpbnQgZ2V0QWxwaGEoUGFpbnQgdGhpc1BhaW50KSB7CisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUgZnJvbSB0aGUgbmF0aXZlIGludC4KKyAgICAgICAgUGFpbnRfRGVsZWdhdGUgZGVsZWdhdGUgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZSh0aGlzUGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICAgICAgaWYgKGRlbGVnYXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGRlbGVnYXRlLmdldEFscGhhKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgc2V0QWxwaGEoUGFpbnQgdGhpc1BhaW50LCBpbnQgYSkgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIFBhaW50X0RlbGVnYXRlIGRlbGVnYXRlID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUodGhpc1BhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIGlmIChkZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBkZWxlZ2F0ZS5tQ29sb3IgPSAoYSA8PCAyNCkgfCAoZGVsZWdhdGUubUNvbG9yICYgMHgwMEZGRkZGRik7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGZsb2F0IGdldFN0cm9rZVdpZHRoKFBhaW50IHRoaXNQYWludCkgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIFBhaW50X0RlbGVnYXRlIGRlbGVnYXRlID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUodGhpc1BhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIGlmIChkZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gMS5mOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGRlbGV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IHsKKyAgICAgICAgLy8gZ2V0IHRoZSBkZWxlZ2F0ZSBmcm9tIHRoZSBuYXRpdmUgaW50LgorICAgICAgICBQYWludF9EZWxlZ2F0ZSBkZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKHRoaXNQYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICBpZiAoZGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZGVsZWdhdGUubVRleHRTaXplID0gdGV4dFNpemU7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGZsb2F0IGdldFRleHRTY2FsZVgoUGFpbnQgdGhpc1BhaW50KSB7CisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUgZnJvbSB0aGUgbmF0aXZlIGludC4KKyAgICAgICAgUGFpbnRfRGVsZWdhdGUgZGVsZWdhdGUgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZSh0aGlzUGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICAgICAgaWYgKGRlbGVnYXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiAxLmY7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gZGVsZWdhdGUubVRleHRTY2FsZVg7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgc2V0VGV4dFNjYWxlWChQYWludCB0aGlzUGFpbnQsIGZsb2F0IHNjYWxlWCkgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIFBhaW50X0RlbGVnYXRlIGRlbGVnYXRlID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUodGhpc1BhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIGlmIChkZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBkZWxlZ2F0ZS5tVGV4dFNjYWxlWCA9IHNjYWxlWDsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgZmxvYXQgZ2V0VGV4dFNrZXdYKFBhaW50IHRoaXNQYWludCkgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIFBhaW50X0RlbGVnYXRlIGRlbGVnYXRlID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUodGhpc1BhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIGlmIChkZWxlZ2F0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICBhc3NlcnQgZmFsc2U7CisgICAgICAgICAgICByZXR1cm4gMS5mOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGRlbGVnYXRlLm1UZXh0U2tld1g7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIHZvaWQgc2V0VGV4dFNrZXdYKFBhaW50IHRoaXNQYWludCwgZmxvYXQgc2tld1gpIHsKKyAgICAgICAgLy8gZ2V0IHRoZSBkZWxlZ2F0ZSBmcm9tIHRoZSBuYXRpdmUgaW50LgorICAgICAgICBQYWludF9EZWxlZ2F0ZSBkZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKHRoaXNQYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICBpZiAoZGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZGVsZWdhdGUubVRleHRTa2V3WCA9IHNrZXdYOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBmbG9hdCBhc2NlbnQoUGFpbnQgdGhpc1BhaW50KSB7CisgICAgICAgIC8vIEZJWE1FCisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBmbG9hdCBkZXNjZW50KFBhaW50IHRoaXNQYWludCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgZmxvYXQgZ2V0Rm9udE1ldHJpY3MoUGFpbnQgdGhpc1BhaW50LCBGb250TWV0cmljcyBtZXRyaWNzKSB7CisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUKKyAgICAgICAgUGFpbnRfRGVsZWdhdGUgZGVsZWdhdGUgPSBzTWFuYWdlci5nZXREZWxlZ2F0ZSh0aGlzUGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICAgICAgaWYgKGRlbGVnYXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGRlbGVnYXRlLm1Gb250cy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICBqYXZhLmF3dC5Gb250TWV0cmljcyBqYXZhTWV0cmljcyA9IGRlbGVnYXRlLm1Gb250cy5nZXQoMCkubU1ldHJpY3M7CisgICAgICAgICAgICBpZiAobWV0cmljcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgLy8gQW5kcm9pZCBleHBlY3RzIG5lZ2F0aXZlIGFzY2VudCBzbyB3ZSBpbnZlcnQgdGhlIHZhbHVlIGZyb20gSmF2YS4KKyAgICAgICAgICAgICAgICBtZXRyaWNzLnRvcCA9IC0gamF2YU1ldHJpY3MuZ2V0TWF4QXNjZW50KCk7CisgICAgICAgICAgICAgICAgbWV0cmljcy5hc2NlbnQgPSAtIGphdmFNZXRyaWNzLmdldEFzY2VudCgpOworICAgICAgICAgICAgICAgIG1ldHJpY3MuZGVzY2VudCA9IGphdmFNZXRyaWNzLmdldERlc2NlbnQoKTsKKyAgICAgICAgICAgICAgICBtZXRyaWNzLmJvdHRvbSA9IGphdmFNZXRyaWNzLmdldE1heERlc2NlbnQoKTsKKyAgICAgICAgICAgICAgICBtZXRyaWNzLmxlYWRpbmcgPSBqYXZhTWV0cmljcy5nZXRMZWFkaW5nKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBqYXZhTWV0cmljcy5nZXRIZWlnaHQoKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBpbnQgZ2V0Rm9udE1ldHJpY3NJbnQoUGFpbnQgdGhpc1BhaW50LCBGb250TWV0cmljc0ludCBmbWkpIHsKKyAgICAgICAgLy8gZ2V0IHRoZSBkZWxlZ2F0ZQorICAgICAgICBQYWludF9EZWxlZ2F0ZSBkZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKHRoaXNQYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICBpZiAoZGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZGVsZWdhdGUubUZvbnRzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIGphdmEuYXd0LkZvbnRNZXRyaWNzIGphdmFNZXRyaWNzID0gZGVsZWdhdGUubUZvbnRzLmdldCgwKS5tTWV0cmljczsKKyAgICAgICAgICAgIGlmIChmbWkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIC8vIEFuZHJvaWQgZXhwZWN0cyBuZWdhdGl2ZSBhc2NlbnQgc28gd2UgaW52ZXJ0IHRoZSB2YWx1ZSBmcm9tIEphdmEuCisgICAgICAgICAgICAgICAgZm1pLnRvcCA9IC0gamF2YU1ldHJpY3MuZ2V0TWF4QXNjZW50KCk7CisgICAgICAgICAgICAgICAgZm1pLmFzY2VudCA9IC0gamF2YU1ldHJpY3MuZ2V0QXNjZW50KCk7CisgICAgICAgICAgICAgICAgZm1pLmRlc2NlbnQgPSBqYXZhTWV0cmljcy5nZXREZXNjZW50KCk7CisgICAgICAgICAgICAgICAgZm1pLmJvdHRvbSA9IGphdmFNZXRyaWNzLmdldE1heERlc2NlbnQoKTsKKyAgICAgICAgICAgICAgICBmbWkubGVhZGluZyA9IGphdmFNZXRyaWNzLmdldExlYWRpbmcoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIGphdmFNZXRyaWNzLmdldEhlaWdodCgpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGZsb2F0IG5hdGl2ZV9tZWFzdXJlVGV4dChQYWludCB0aGlzUGFpbnQsIGNoYXJbXSB0ZXh0LCBpbnQgaW5kZXgsCisgICAgICAgICAgICBpbnQgY291bnQpIHsKKyAgICAgICAgLy8gV0FSTklORzogdGhlIGxvZ2ljIGluIHRoaXMgbWV0aG9kIGlzIHNpbWlsYXIgdG8gQ2FudmFzLmRyYXdUZXh0LgorICAgICAgICAvLyBBbnkgY2hhbmdlIHRvIHRoaXMgbWV0aG9kIHNob3VsZCBiZSByZWZsZWN0ZWQgaW4gQ2FudmFzLmRyYXdUZXh0CisKKyAgICAgICAgLy8gZ2V0IHRoZSBkZWxlZ2F0ZQorICAgICAgICBQYWludF9EZWxlZ2F0ZSBkZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKHRoaXNQYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICBpZiAoZGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgc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vYmplY3QpOworICAgICAgICBpZiAoZGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZGVsZWdhdGUucmVzZXQoKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgdm9pZCBuYXRpdmVfc2V0KGludCBuYXRpdmVfZHN0LCBpbnQgbmF0aXZlX3NyYykgeworICAgICAgICAvLyBnZXQgdGhlIGRlbGVnYXRlIGZyb20gdGhlIG5hdGl2ZSBpbnQuCisgICAgICAgIFBhaW50X0RlbGVnYXRlIGRlbGVnYXRlX2RzdCA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9kc3QpOworICAgICAgICBpZiAoZGVsZWdhdGVfZHN0ID09IG51bGwpIHsKKyAgICAgICAgICAgIGFzc2VydCBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUgZnJvbSB0aGUgbmF0aXZlIGludC4KKyAgICAgICAgUGFpbnRfRGVsZWdhdGUgZGVsZWdhdGVfc3JjID0gc01hbmFnZXIuZ2V0RGVsZWdhdGUobmF0aXZlX3NyYyk7CisgICAgICAgIGlmIChkZWxlZ2F0ZV9zcmMgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZGVsZWdhdGVfZHN0LnNldChkZWxlZ2F0ZV9zcmMpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBpbnQgbmF0aXZlX2dldFN0eWxlKGludCBuYXRpdmVfb2JqZWN0KSB7CisgICAgICAgIC8vIGdldCB0aGUgZGVsZWdhdGUgZnJvbSB0aGUgbmF0aXZlIGludC4KKyAgICAgICAgUGFpbnRfRGVsZWdhdGUgZGVsZWdhd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HNNYW5hZ2VyLmdldERlbGVnYXRlKG5hdGl2ZV9vYmplY3QpOworICAgICAgICBpZiAoZGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZGVsZWdhdGUubUpvaW4gPSBqb2luOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBib29sZWFuIG5hdGl2ZV9nZXRGaWxsUGF0aChpbnQgbmF0aXZlX29iamVjdCwgaW50IHNyYywgaW50IGRzdCkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgaW50IG5hdGl2ZV9zZXRTaGFkZXIoaW50IG5hdGl2ZV9vYmplY3QsIGludCBzaGFkZXIpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGludCBuYXRpdmVfc2V0Q29sb3JGaWx0ZXIoaW50IG5hdGl2ZV9vYmplY3QsIGludCBmaWx0ZXIpIHsKKyAgICAgICAgLy8gRklYTUUKKyAgICAgICAgdGhyb3cgbmV3IFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3RhdGljIGludCBuYXRpdmVfc2V0WGZlcm1vZGUoaW50IG5hdGl2ZV9vYmplY3QsIGludCB4ZmVybW9kZSkgeworICAgICAgICAvLyBGSVhNRQorICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMg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AgIHJldHVybiAwLmY7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZGVsZWdhdGUubUZvbnRzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIC8vIEZJWE1FOiBoYW5kbGUgbXVsdGktY2hhciBjaGFyYWN0ZXJzLgorICAgICAgICAgICAgLy8gc2VlIG1lYXN1cmVUZXh0LgorICAgICAgICAgICAgZmxvYXQgdG90YWxBZHZhbmNlID0gMDsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIGNoYXIgYyA9IHRleHRbaSArIGluZGV4XTsKKyAgICAgICAgICAgICAgICBib29sZWFuIGZvdW5kID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZm9yIChGb250SW5mbyBpbmZvIDogZGVsZWdhdGUubUZvbnRzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChpbmZvLm1Gb250LmNhbkRpc3BsYXkoYykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGFkdiA9IGluZm8ubU1ldHJpY3MuY2hhcldpZHRoKGMpOworICAgICAgICAgICAgICAgICAgICAgICAgdG90YWxBZHZhbmNlICs9IGFkdjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZHZhbmNlcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWR2YW5jZXNbaV0gPSBhZHY7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGZvdW5kID09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIG5vIGFkdmFuY2UgZm9yIHRoaXMgY2hhci4KKyAgICAgICAgICAgICAgICAgICAgaWYgKGFkdmFuY2VzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFkdmFuY2VzW2ldID0gMC5mOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gdG90YWxBZHZhbmNlOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIDA7CisKKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzdGF0aWMgZmxvYXQgbmF0aXZlX2dldFRleHRSdW5BZHZhbmNlcyhpbnQgbmF0aXZlX29iamVjdCwKKyAgICAgICAgICAgIFN0cmluZyB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLAorICAgICAgICAgICAgaW50IGZsYWdzLCBmbG9hdFtdIGFkdmFuY2VzLCBpbnQgYWR2YW5jZXNJbmRleCkgeworICAgICAgICAvLyBGSVhNRTogc3VwcG9ydCBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQgYW5kIGRpcmVjdGlvbiBmbGFnCisgICAgICAgIGludCBjb3VudCA9IGVuZCAtIHN0YXJ0OworICAgICAgICBjaGFyW10gYnVmZmVyID0gVGVtcG9yYXJ5QnVmZmVyLm9idGFpbihjb3VudCk7CisgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBzdGFydCwgZW5kLCBidWZmZXIsIDApOworCisgICAgICAgIHJldHVybiBuYXRpdmVfZ2V0VGV4dFJ1bkFkdmFuY2VzKG5hdGl2ZV9vYmplY3QsIGJ1ZmZlciwgMCwgY291bnQsIGNvbnRleHRTdGFydCwKKyAgICAgICAgICAgICAgICBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0LCBmbGFncywgYWR2YW5jZXMsIGFkdmFuY2VzSW5kZXgpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIHN0YXRpYyBpbnQgbmF0aXZlX2dldFRleHRSdW5DdXJzb3I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GVGb250T2JqZWN0KCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBQYWludF9EZWxlZ2F0ZShQYWludF9EZWxlZ2F0ZSBwYWludCkgeworICAgICAgICBzZXQocGFpbnQpOworICAgICAgICB1cGRhdGVGb250T2JqZWN0KCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldChQYWludF9EZWxlZ2F0ZSBwYWludCkgeworICAgICAgICBtRmxhZ3MgPSBwYWludC5tRmxhZ3M7CisgICAgICAgIG1Db2xvciA9IHBhaW50Lm1Db2xvcjsKKyAgICAgICAgbVN0eWxlID0gcGFpbnQubVN0eWxlOworICAgICAgICBtQ2FwID0gcGFpbnQubUNhcDsKKyAgICAgICAgbUpvaW4gPSBwYWludC5tSm9pbjsKKyAgICAgICAgbVRleHRBbGlnbiA9IHBhaW50Lm1UZXh0QWxpZ247CisgICAgICAgIG1UeXBlZmFjZSA9IHBhaW50Lm1UeXBlZmFjZTsKKyAgICAgICAgbVN0cm9rZVdpZHRoID0gcGFpbnQubVN0cm9rZVdpZHRoOworICAgICAgICBtU3Ryb2tlTWl0ZXIgPSBwYWludC5tU3Ryb2tlTWl0ZXI7CisgICAgICAgIG1UZXh0U2l6ZSA9IHBhaW50Lm1UZXh0U2l6ZTsKKyAgICAgICAgbVRleHRTY2FsZVggPSBwYWludC5tVGV4dFNjYWxlWDsKKyAgICAgICAgbVRleHRTa2V3WCA9IHBhaW50Lm1UZXh0U2tld1g7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlc2V0KCkgeworICAgICAgICBtRmxhZ3MgPSBQYWludC5ERUZBVUxUX1BBSU5UX0ZMQUdTOworICAgICAgICBtQ29sb3IgPSAwOworICAgICAgICBtU3R5bGUgPSAwOworICAgICAgICBtQ2FwID0gMDsKKyAgICAgICAgbUpvaW4gPSAwOworICAgICAgICBtVGV4dEFsaWduID0gMDsKKyAgICAgICAgbVR5cGVmYWNlID0gMDsKKyAgICAgICAgbVN0cm9rZVdpZHRoID0gMS5mOworICAgICAgICBtU3Ryb2tlTWl0ZXIgPSAyLmY7CisgICAgICAgIG1UZXh0U2l6ZSA9IDIwLmY7CisgICAgICAgIG1UZXh0U2NhbGVYID0gMS5mOworICAgICAgICBtVGV4dFNrZXdYID0gMC5mOworICAgIH0KKworICAgIC8qKgorICAgICAqIFVwZGF0ZSB0aGUge0BsaW5rIEZvbnR9IG9iamVjdCBmcm9tIHRoZSB0eXBlZmFjZSwgdGV4dCBzaXplIGFuZCBzY2FsaW5nCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZUZvbnRPYmplY3QoKSB7CisgICAgICAgIGlmIChtVHlwZWZhY2UgIT0gMCkgeworICAgICAgICAgICAgLy8gR2V0IHRoZSBmb250cyBmcm9tIHRoZSBUeXBlRmFjZSBvYmplY3QuCisgICAgICAgICAgICBMaXN0PEZvbnQ+IGZvbnRzID0gVHlwZWZhY2VfRGVsZWdhdGUuZ2V0Rm9udHMobVR5cGVmYWNlKTsKKworICAgICAgICAgICAgLy8gY3JlYXRlIG5ldyBmb250IG9iamVjdHMgYXMgd2VsbCBhcyBGb250TWV0cmljcywgYmFzZWQgb24gdGhlIGN1cnJlbnQgdGV4dCBzaXplCisgICAgICAgICAgICAvLyBhbmQgc2tldyBpbmZvLgorICAgICAgICAgICAgQXJyYXlMaXN0PEZvbnRJbmZvPiBpbmZvTGlzdCA9IG5ldyBBcnJheUxpc3Q8Rm9udEluZm8+KGZvbnRzLnNpemUoKSk7CisgICAgICAgICAgICBmb3IgKEZvbnQgZm9udCA6IGZvbnRzKSB7CisgICAgICAgICAgICAgICAgRm9udEluZm8gaW5mbyA9IG5ldyBGb250SW5mbygpOworICAgICAgICAgICAgICAgIGluZm8ubUZvbnQgPSBmb250LmRlcml2ZUZvbnQobVRleHRTaXplKTsKKyAgICAgICAgICAgICAgICBpZiAobVRleHRTY2FsZVggIT0gMS4wIHx8IG1UZXh0U2tld1ggIT0gMCkgeworICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBzdXBwb3J0IHNrZXcKKyAgICAgICAgICAgICAgICAgICAgaW5mby5tRm9udCA9IGluZm8ubUZvbnQuZGVyaXZlRm9udChuZXcgQWZmaW5lVHJhbnNmb3JtKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXh0U2NhbGVYLCBtVGV4dFNrZXdYLCAwLCAwLCAxLCAwKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGluZm8ubU1ldHJpY3MgPSBUb29sa2l0LmdldERlZmF1bHRUb29sa2l0KCkuZ2V0Rm9udE1ldHJpY3MoaW5mby5tRm9udCk7CisKKyAgICAgICAgICAgICAgICBpbmZvTGlzdC5hZGQoaW5mbyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1Gb250cyA9IENvbGxlY3Rpb25zLnVubW9kaWZpYWJsZUxpc3QoaW5mb0xpc3QpOworICAgICAgICB9CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gZmxvYXQgbWVhc3VyZVRleHQoY2hhcltdIHRleHQsIGludCBpbmRleCwgaW50IGNvdW50KSB7CisgICAgICAgIGlmIChtRm9udHMuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgRm9udEluZm8gbWFpbkZvbnQgPSBtRm9udHMuZ2V0KDApOworICAgICAgICAgICAgaW50IGkgPSBpbmRleDsKKyAgICAgICAgICAgIGludCBsYXN0SW5kZXggPSBpbmRleCArIGNvdW50OworICAgICAgICAgICAgZmxvYXQgdG90YWwgPSAwZjsKKyAgICAgICAgICAgIHdoaWxlIChpIDwgbGFzdEluZGV4KSB7CisgICAgICAgICAgICAgICAgLy8gYWx3YXlzIHN0YXJ0IHdpdGggdGhlIG1haW4gZm9udC4KKyAgICAgICAgICAgICAgICBpbnQgdXBUbyA9IG1haW5Gb250Lm1Gb250LmNhbkRpc3BsYXlVcFRvKHRleHQsIGksIGxhc3RJbmRleCk7CisgICAgICAgICAgICAgICAgaWYgKHVwVG8gPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gc2hvcnRjdXQgdG8gZXhpdAorICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG90YWwgKyBtYWluRm9udC5tTWV0cmljcy5jaGFyc1dpZHRoKHRleHQsIGksIGxhc3RJbmRleCAtIGkpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodXBUbyA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgdG90YWwgKz0gbWFpbkZvbnQubU1ldHJpY3MuY2hhcnNXaWR0aCh0ZXh0LCBpLCB1cFRvIC0gaSk7CisgICAgICAgICAgICAgICAgICAgIGkgPSB1cFRvOworICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCBjYWxsIGNvbnRpbnVlIGF0IHRoaXMgcG9pbnQuIFNpbmNlIGl0IGlzIGNlcnRhaW4gdGhlIG1haW4gZm9udAorICAgICAgICAgICAgICAgICAgICAvLyBjYW5ub3QgZGlzcGxheSB0aGUgZm9udCBhIGluZGV4IHVwVG8gKG5vdyA9PWkpLCB3ZSBtb3ZlIG9uIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBmYWxsYmFjayBmb250cyBkaXJlY3RseS4KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBubyBjaGFyIHN1cHBvcnRlZCwgYXR0ZW1wdCB0byByZWFkIHRoZSBuZXh0IGNoYXIocykgd2l0aCB0aGUKKyAgICAgICAgICAgICAgICAvLyBmYWxsYmFjayBmb250LiBJbiB0aGlzIGNhc2Ugd2Ugb25seSB0ZXN0IHRoZSBmaXJzdCBjaGFyYWN0ZXIKKyAgICAgICAgICAgICAgICAvLyBhbmQgdGhlbiBnbyBiYWNrIHRvIHRlc3Qgd2l0aCB0aGUgbWFpbiBmb250LgorICAgICAgICAgICAgICAgIC8vIFNwZWNpYWwgdGVzdCBmb3IgMi1jaGFyIGNoYXJhY3RlcnMuCisgICAgICAgICAgICAgICAgYm9vbGVhbiBmb3VuZEZvbnQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBmID0gMSA7IGYgPCBtRm9udHMuc2l6ZSgpIDsgZisrKSB7CisgICAgICAgICAgICAgICAgICAgIEZvbnRJbmZvIGZvbnRJbmZvID0gbUZvbnRzLmdldChmKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBuZWVkIHRvIGNoZWNrIHRoYXQgdGhlIGZvbnQgY2FuIGRpc3BsYXkgdGhlIGNoYXJhY3Rlci4gV2UgdGVzdAorICAgICAgICAgICAgICAgICAgICAvLyBkaWZmZXJlbnRseSBpZiB0aGUgY2hhciBpcyBhIGhpZ2ggc3Vycm9nYXRlLgorICAgICAgICAgICAgICAgICAgICBpbnQgY2hhckNvdW50ID0gQ2hhcmFjdGVyLmlzSGlnaFN1cnJvZ2F0ZSh0ZXh0W2ldKSA/IDIgOiAxOworICAgICAgICAgICAgICAgICAgICB1cFRvID0gZm9udEluZm8ubUZvbnQuY2FuRGlzcGxheVVwVG8odGV4dCwgaSwgaSArIGNoYXJDb3VudCk7CisgICAgICAgICAgICAgICAgICAgIGlmICh1cFRvID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0b3RhbCArPSBmb250SW5mby5tTWV0cmljcy5jaGFyc1dpZHRoKHRleHQsIGksIGNoYXJDb3VudCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpICs9IGNoYXJDb3VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kRm9udCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gaW4gY2FzZSBubyBmb250IGNhbiBkaXNwbGF5IHRoZSBjaGFyLCBtZWFzdXJlIGl0IHdpdGggdGhlIG1haW4gZm9udC4KKyAgICAgICAgICAgICAgICBpZiAoZm91bmRGb250ID09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBzaXplID0gQ2hhcmFjdGVyLmlzSGlnaFN1cnJvZ2F0ZSh0ZXh0W2ldKSA/IDIgOiAxOworICAgICAgICAgICAgICAgICAgICB0b3RhbCArPSBtYWluRm9udC5tTWV0cmljcy5jaGFyc1dpZHRoKHRleHQsIGksIHNpemUpOworICAgICAgICAgICAgICAgICAgICBpICs9IHNpemU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIDA7CisKKyAgICB9CisKKworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgc2V0RmxhZyhQYWludCB0aGlzUGFpbnQsIGludCBmbGFnTWFzaywgYm9vbGVhbiBmbGFnVmFsdWUpIHsKKyAgICAgICAgLy8gZ2V0IHRoZSBkZWxlZ2F0ZSBmcm9tIHRoZSBuYXRpdmUgaW50LgorICAgICAgICBQYWludF9EZWxlZ2F0ZSBkZWxlZ2F0ZSA9IHNNYW5hZ2VyLmdldERlbGVnYXRlKHRoaXNQYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICBpZiAoZGVsZWdhdGUgPT0gbnVsbCkgeworICAgICAgICAgICAgYXNzZXJ0IGZhbHNlOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGZsYWdWYWx1ZSkgeworICAgICAgICAgICAgZGVsZWdhdGUubUZsYWdzIHw9IGZsYWdNYXNrOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVsZWdhdGUubUZsYWdzICY9IH5mbGFnTWFzazsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL3Rvb2xzL2xheW91dGxpYi9icmlkZ2Uvc3JjL2FuZHJvaWQvZ3JhcGhpY3MvUGF0aC5qYXZhIGIvdG9vbHMvbGF5b3V0bGliL2JyaWRnZS9zcmMvYW5kcm9pZC9ncmFwaGljcy9QYXRoLmphdmEKaW5kZXggMTJkMmNkZS4uYzBiYzAwNSAxMDA2NDQKLS0tIGEvdG9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CB0cnVlKSwKICAgICAgICAgSU5WRVJTRV9FVkVOX09ERChHZW5lcmFsUGF0aC5XSU5EX0VWRU5fT0RELCB0cnVlKTsKLSAgICAgICAgCisKICAgICAgICAgRmlsbFR5cGUoaW50IHJ1bGUsIGJvb2xlYW4gaW52ZXJzZSkgewogICAgICAgICAgICAgdGhpcy5ydWxlID0gcnVsZTsKICAgICAgICAgICAgIHRoaXMuaW52ZXJzZSA9IGludmVyc2U7CkBAIC0xMDEsNyArMTAxLDcgQEAKICAgICAgICAgZmluYWwgaW50IHJ1bGU7CiAgICAgICAgIGZpbmFsIGJvb2xlYW4gaW52ZXJzZTsKICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBSZXR1cm4gdGhlIHBhdGgncyBmaWxsIHR5cGUuIFRoaXMgZGVmaW5lcyBob3cgImluc2lkZSIgaXMKICAgICAgKiBjb21wdXRlZC4gVGhlIGRlZmF1bHQgdmFsdWUgaXMgV0lORElORy4KQEAgLTEyMSw3ICsxMjEsNyBAQAogICAgICAgICBtRmlsbFR5cGUgPSBmdDsKICAgICAgICAgbVBhdGguc2V0V2luZGluZ1J1bGUoZnQucnVsZSk7CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogUmV0dXJucyB0cnVlIGlmIHRoZSBmaWxsdHlwZSBpcyBvbmUgb2YgdGhlIElOVkVSU0UgdmFyaWFudHMKICAgICAgKgpAQCAtMTMwLDcgKzEzMCw3IEBACiAgICAgcHVibGljIGJvb2xlYW4gaXNJbnZlcnNlRmlsbFR5cGUoKSB7CiAgICAgICAgIHJldHVybiBtRmlsbFR5cGUuaW52ZXJzZTsKICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBUb2dnbGVzIHRoZSBJTlZFUlNFIHN0YXRlIG9mIHRoZSBmaWxsdHlwZQogICAgICAqLwpAQCAtMTUwLDcgKzE1MCw3IEBACiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisK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VDcmVhdGVGcm9tQXNzZXQobWdyLCBwYXRoKSk7Ci0gICAgfQotCi0gICAgLy8gZG9uJ3QgYWxsb3cgY2xpZW50cyB0byBjYWxsIHRoaXMgZGlyZWN0bHkKLSAgICBwcml2YXRlIFR5cGVmYWNlKFN0cmluZyBmYW1pbHksIGludCBzdHlsZSwgTGlzdDxGb250PiBmb250cykgewotICAgICAgICBtRmFtaWx5ID0gZmFtaWx5OwotICAgICAgICBtRm9udHMgPSBDb2xsZWN0aW9ucy51bm1vZGlmaWFibGVMaXN0KGZvbnRzKTsKLSAgICAgICAgbVN0eWxlID0gc3R5bGU7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyB2b2lkIGluaXQoRm9udExvYWRlciBmb250TG9hZGVyKSB7Ci0gICAgICAgIG1Gb250TG9hZGVyID0gZm9udExvYWRlcjsKLQotICAgICAgICBERUZBVUxUID0gY3JlYXRlKERFRkFVTFRfRkFNSUxZLCBOT1JNQUwpOwotICAgICAgICBERUZBVUxUX0JPTEQgPSBjcmVhdGUoREVGQVVMVF9GQU1JTFksIEJPTEQpOwotICAgICAgICBTQU5TX1NFUklGID0gY3JlYXRlKCJzYW5zLXNlcmlmIiwgTk9STUFMKTsKLSAgICAgICAgU0VSSUYgPSBjcmVhdGUoInNlcmlmIiwgTk9STUFMKTsKLSAgICAgICAgTU9OT1NQQUNFID0gY3JlYXRlKCJtb25vc3BhY2UiLCBOT1JNQUwpOwotICAgICAgICBzRGVmYXVsdHMgPSBuZXcgVHlwZWZhY2VbXSB7Ci0gICAgICAgICAgICAgICAgREVGQVVMVCwKLSAgICAgICAgICAgICAgICBERUZBVUxUX0JPTEQsCi0gICAgICAgICAgICAgICAgY3JlYXRlKERFRkFVTFRfRkFNSUxZLCBJVEFMSUMpLAotICAgICAgICAgICAgICAgIGNyZWF0ZShERUZBVUxUX0ZBTUlMWSwgQk9MRF9JVEFMSUMpLAotICAgICAgICB9OwotCi0gICAgICAgIC8qCi0gICAgICAgIERFRkFVT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AgICAgICAgICBjYW52YXMuZGlzcG9zZSgpOworICAgICAgICAgICAgY2FudmFzRGVsZWdhdGUuZGlzcG9zZSgpOwogCi0gICAgICAgICAgICByZXR1cm4gbmV3IExheW91dFJlc3VsdCh2aXNpdCgoKFZpZXdHcm91cCl2aWV3KS5nZXRDaGlsZEF0KDApLCBjb250ZXh0KSwKLSAgICAgICAgICAgICAgICAgICAgY2FudmFzLmdldEltYWdlKCkpOworICAgICAgICAgICAgcmV0dXJuIG5ldyBMYXlvdXRSZXN1bHQoCisgICAgICAgICAgICAgICAgICAgIHZpc2l0KCgoVmlld0dyb3VwKXZpZXcpLmdldENoaWxkQXQoMCksIGNvbnRleHQpLAorICAgICAgICAgICAgICAgICAgICBpbWFnZSk7CisKICAgICAgICAgfSBjYXRjaCAoUG9zdEluZmxhdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgcmV0dXJuIG5ldyBMYXlvdXRSZXN1bHQoSUxheW91dFJlc3VsdC5FUlJPUiwgIkVycm9yIGR1cmluZyBwb3N0IGluZmxhdGlvbiBwcm9jZXNzOlxuIgogICAgICAgICAgICAgICAgICAgICArIGUuZ2V0TWVzc2FnZSgpKTsKQEAgLTEwMDQsNyArMTAyNSw3IEBACiAgICAgICAgICAgICAvLyBwYXNzIGZvciBub3cuCiAgICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBAU3VwcHJlc3NXYXJuaW5ncygidW51c2VkIikKICAgICAgICAgcHVibGljIHZvaWQgZmluaXNoRHJhd2luZyhJV2luZG93IGFyZzApIHRocm93cyBSZW1vdGVFeGNlcHRpb24gewogICAgICAgICAgICAgLy8gcGFzcyBmb3Igbm93LgpAQCAtMTA3Myw2ICsxMDk0LDM4IEBACiAgICAgICAgIH0KIAogICAgICAgICBAU3VwcHJlc3NXYXJuaW5ncygidW51c2VkIikKKyAgICAgICAgcHVibGljIElCaW5kZXIgcHJlcGFyZURyYWcoSVdpbmRvdyB3aW5kb3csIGJvb2xlYW4gbG9jYWxPbmx5LAorICAgICAgICAgICAgICAgIGludCB0aHVtYm5haWxXaWR0aCwgaW50IHRodW1ibmFpbEhlaWdodCwgU3VyZmFjZSBvdXRTdXJmYWNlKQorICAgICAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgLy8gcGFzcyBmb3Igbm93CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bnVzZWQiKQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwZXJmb3JtRHJhZyhJV2luZG93IHdpbmRvdywgSUJpbmRlciBkcmFnVG9rZW4sCisgICAgICAgICAgICAgICAgZmxvYXQgdG91Y2hYLCBmbG9hdCB0b3VjaFksIGZsb2F0IHRodW1iQ2VudGVyWCwgZmxvYXQgdGh1bWJDZW50ZXJZLAorICAgICAgICAgICAgICAgIENsaXBEYXRhIGRhdGEpCisgICAgICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICAvLyBwYXNzIGZvciBub3cKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bnVzZWQiKQorICAgICAgICBwdWJsaWMgdm9pZCByZXBvcnREcm9wUmVzdWx0KElXaW5kb3cgd2luZG93LCBib29sZWFuIGNvbnN1bWVkKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIC8vIHBhc3MgZm9yIG5vdworICAgICAgICB9CisKKyAgICAgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCisgICAgICAgIHB1YmxpYyB2b2lkIGRyYWdSZWNpcGllbnRFbnRlcmVkKElXaW5kb3cgd2luZG93KSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIC8vIHBhc3MgZm9yIG5vdworICAgICAgICB9CisKKyAgICAgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCisgICAgICAgIHB1YmxpYyB2b2lkIGRyYWdSZWNpcGllbnRFeGl0ZWQoSVdpbmRvdyB3aW5kb3cpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgLy8gcGFzcyBmb3Igbm93CisgICAgICAgIH0KKworICAgICAgICBAU3VwcHJlc3NXYXJuaW5ncygidW51c2VkIikKICAgICAgICAgcHVibGljIHZvaWQgc2V0V2FsbHBhcGVyUG9zaXRpb24oSUJpbmRlciB3aW5kb3csIGZsb2F0IHgsIGZsb2F0IHksCiAgICAgICAgICAgICBmbG9hdCB4U3RlcCwgZmxvYXQgeVN0ZXApIHsKICAgICAgICAgICAgIC8vIHBhc3MgZm9yIG5vdy4KQEAgLTExNzAsNiArMTIyMywxMSBAQAogICAgICAgICAgICAgLy8gcGFzcyBmb3Igbm93LgogICAgICAgICB9CiAKKyAgICAgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCisgICAgICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoRHJhZ0V2ZW50KERyYWdFdmVudCBldmVudCkgeworICAgICAgICAgICAgLy8gcGFzcyBmb3Igbm93LgorICAgICAgICB9CisKICAgICAgICAgcHVibGljIElCaW5kZXIgYXNCaW5kZXIoKSB7CiAgICAgICAgICAgICAvLyBwYXNzIGZvciBub3cuCiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKZGlmZiAtLWdpdCBhL3Rvb2xzL2xheW91dGxpYi9icmlkZ2Uvc3JjL2NvbS9hbmRyb2lkL2xheW91dGxpYi9icmlkZ2UvQnJpZGdlQ29udGVudFByb3ZpZGVyLmphdmEgYi90b29scy9sYXlvdXRsaWIvYnJpZGdlL3NyYy9jb20vYW5kcm9pZC9sYXlvdXRsaWIvYnJpZGdlL0JyaWRnZUNvbnRlbnRQcm92aWRlci5qYXZhCm5ldyBmaWxlIG1v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ZyYW1ld29yaykgeworICAgIHB1YmxpYyBzdGF0aWMgRHJhd2FibGUgZ2V0RHJhd2FibGUoSVJlc291cmNlVmFsdWUgdmFsdWUsIEJyaWRnZUNvbnRleHQgY29udGV4dCwKKyAgICAgICAgICAgIGJvb2xlYW4gaXNGcmFtZXdvcmspIHsKICAgICAgICAgRHJhd2FibGUgZCA9IG51bGw7CiAKICAgICAgICAgU3RyaW5nIHN0cmluZ1ZhbHVlID0gdmFsdWUuZ2V0VmFsdWUoKTsKQEAgLTE2OCwxNCArMTcwLDggQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZyYW1ld29yayA/IG51bGwgOiBjb250ZXh0LmdldFByb2plY3RLZXkoKSk7CiAKICAgICAgICAgICAgICAgICAgICAgaWYgKGJpdG1hcCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiaXRtYXAgPSBuZXcgQml0bWFwKGJtcEZpbGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRtYXAuc2V0RGVuc2l0eShEZW5zaXR5Lk1FRElVTS5nZXRWYWx1ZSgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE5vQ2xhc3NEZWZGb3VuZEVycm9yIGVycm9yKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbG9vayBsaWtlIHdlJ3JlIHJ1bm5pbmcgaW4gYW4gb2xkZXIgdmVyc2lvbiBvZiBBRFQgdGhhdCBkb2Vzbid0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5jbHVkZSB0aGUgbmV3IGxheW91dGxpYl9hcGkuIExldCdzIGp1c3QgaWdub3JlIHRoaXMsIHRoZSBkcmF3aW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2lsbCBqdXN0IGJlIHdyb25nLgotICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAg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gOyBpIDwgY291bnQgOyBpICs9IDIpIHsKQEAgLTUyLDEyICs1NSwyMSBAQAogICAgICAgICBNZXRob2RbXSBvbGRDbGFzc01ldGhvZHMgPSBvbGRDbGFzcy5nZXREZWNsYXJlZE1ldGhvZHMoKTsKIAogICAgICAgICBmb3IgKE1ldGhvZCBvbGRNZXRob2QgOiBvbGRDbGFzc01ldGhvZHMpIHsKLSAgICAgICAgICAgIC8vIHdlIGlnbm9yZSBhbnl0aGluZyB0aGF0IHN0YXJ0cyB3aXRoIG5hdGl2ZQorICAgICAgICAgICAgLy8gd2UgaWdub3JlIGFueXRoaW5nIHRoYXQgc3RhcnRzIHdpdGggbmF0aXZlLiBUaGlzIGlzIGJlY2F1c2UgdGhlIGNsYXNzIHdlIGFyZSBsb29raW5nCisgICAgICAgICAgICAvLyBhdCBoYXMgYWxyZWFkeSBiZWVuIG1vZGlmaWVkIHRvIHJlbW92ZSB0aGUgbmF0aXZlIG1vZGlmaWVycy4KICAgICAgICAgICAgIGlmIChvbGRNZXRob2QuZ2V0TmFtZSgpLnN0YXJ0c1dpdGgoIm5hdGl2ZSIpKSB7CiAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIG9yIHN0YXRpYyBhbmQgcHJpdmF0ZQorICAgICAgICAgICAgaW50IHByaXZhdGVTdGF0aWMgPSBNb2RpZmllci5TVEFUSUMgfCBNb2RpZmllci5QUklWQVRFOworICAgICAgICAgICAgaWYgKChvbGRNZXRob2QuZ2V0TW9kaWZpZXJzKCkgJiBwcml2YXRlU3RhdGljKSA9PSBwcml2YXRlU3RhdGljKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIGJvb2xlYW4gZm91bmQgPSBmYWxzZTsKICAgICAgICAgICAgIGZvciAoTWV0aG9kIG5ld01ldGhvZCA6IG5ld0NsYXNzTWV0aG9kcykgeworCiAgICAgICAgICAgICAgICAgaWYgKGNvbXBhcmVNZXRob2RzKG5ld0NsYXNzLCBuZXdNZXRob2QsIG9sZENsYXNzLCBvbGRNZXRob2QpKSB7CiAgICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC02NSw3ICs3NywzMSBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAoZm91bmQgPT0gZmFsc2UpIHsKLSAgICAgICAgICAgICAgICBmYWlsKFN0cmluZy5mb3JtYXQoIlVuYWJsZSB0byBmaW5kICUxJHMiLCBvbGRNZXRob2QudG9HZW5lcmljU3RyaW5nKCkpKTsKKyAgICAgICAgICAgICAgICAvLyBjb21wdXRlIGEgZnVsbCBjbGFzcyBuYW1lIHRoYXQncyBsb25nIGJ1dCBub3QgdG9vIGxvbmcuCisgICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBzYiA9IG5ldyBTdHJpbmdCdWlsZGVyKG9sZE1ldGhvZC5nZXROYW1lKCkgKyAiKCIpOworICAgICAgICAgICAgICAgIFR5cGVbXSBwYXJhbXMgPSBvbGRNZXRob2QuZ2V0R2VuZXJpY1BhcmFtZXRlclR5cGVzKCk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBwYXJhbXMubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtc1tqXSBpbnN0YW5jZW9mIENsYXNzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBDbGFzcyB0aGVDbGFzcyA9IChDbGFzcylwYXJhbXNbal07CisgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQodGhlQ2xhc3MuZ2V0TmFtZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBkaW1lbnNpb25zID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICh0aGVDbGFzcy5pc0FycmF5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaW1lbnNpb25zKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlQ2xhc3MgPSB0aGVDbGFzcy5nZXRDb21wb25lbnRUeXBlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGRpbWVuc2lvbnM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiW10iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKHBhcmFtc1tqXS50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChqIDwgKHBhcmFtcy5sZW5ndGggLSAxKSkKKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCIsIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiKSIpOworCisgICAgICAgICAgICAgICAgZmFpbChTdHJpbmcuZm9ybWF0KCJNaXNzaW5nICUxJHMuJTIkcyIsIG5ld0NsYXNzLmdldE5hbWUoKSwgc2IudG9TdHJpbmcoKSkpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKZGlmZiAtLWdpdCBhL3Rvb2xzL2xheW91dGxpYi9icmlkZ2UvdGVzdHMvY29tL2FuZHJvaWQvbGF5b3V0bGliL2JyaWRnZS9UZXN0TmF0aXZlRGVsZWdhdGUuamF2YSBiL3Rvb2xzL2xheW91dGxpYi9icmlkZ2UvdGVzdHMvY29tL2FuZHJvaWQvbGF5b3V0bGliL2JyaWRnZS9UZXN0TmF0aXZlRGVsZWdhdGUuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hODZiNWM5Ci0tLSAvZGV2L251bGwKKysrIGIvdG9vbHMv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Bub3Qgc3RhdGljLCB0aGVuIHRoZSBjbGFzcyBpcyBhZGRlZCBhcyB0aGUgZmlyc3QgcGFyYW1ldGVyCisgICAgICAgICAgICAvLyAoZm9yICJ0aGlzIikKKyAgICAgICAgICAgIGlmICgob3JpZ2luYWxNZXRob2QuZ2V0TW9kaWZpZXJzKCkgJiBNb2RpZmllci5TVEFUSUMpID09IDApIHsKKworICAgICAgICAgICAgICAgIENsYXNzPD8+W10gbmV3UGFyYW1ldGVycyA9IG5ldyBDbGFzczw/PltwYXJhbWV0ZXJzLmxlbmd0aCArIDFdOworICAgICAgICAgICAgICAgIG5ld1BhcmFtZXRlcnNbMF0gPSBvcmlnaW5hbENsYXNzOworICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkocGFyYW1ldGVycywgMCwgbmV3UGFyYW1ldGVycywgMSwgcGFyYW1ldGVycy5sZW5ndGgpOworICAgICAgICAgICAgICAgIHBhcmFtZXRlcnMgPSBuZXdQYXJhbWV0ZXJzOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIC8vIHRyeSB0byBsb2FkIHRoZSBtZXRob2Qgd2l0aCB0aGUgZ2l2ZW4gcGFyYW1ldGVyIHR5cGVzLgorICAgICAgICAgICAgICAgIE1ldGhvZCBkZWxlZ2F0ZU1ldGhvZCA9IGRlbGVnYXRlQ2xhc3MuZ2V0RGVjbGFyZWRNZXRob2Qob3JpZ2luYWxNZXRob2QuZ2V0TmFtZSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVycyk7CisKKyAgICAgICAgICAgICAgICAvLyBjaGVjayB0aGF0IHRoZSBtZXRob2QgaXMgc3RhdGljCisgICAgICAgICAgICAgICAgYXNzZXJ0VHJ1ZSgoZGVsZWdhdGVNZXRob2QuZ2V0TW9kaWZpZXJzKCkgJiBNb2RpZmllci5TVEFUSUMpID09IE1vZGlmaWVyLlNUQVRJQyk7CisgICAgICAgICAgICB9IGNhdGNoIChOb1N1Y2hNZXRob2RFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIC8vIGNvbXB1dGUgYSBmdWxsIGNsYXNzIG5hbWUgdGhhdCdzIGxvbmcgYnV0IG5vdCB0b28gbG9uZy4KKyAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIob3JpZ2luYWxNZXRob2QuZ2V0TmFtZSgpICsgIigiKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IHBhcmFtZXRlcnMubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgQ2xhc3M8Pz4gdGhlQ2xhc3MgPSBwYXJhbWV0ZXJzW2pdOworICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQodGhlQ2xhc3MuZ2V0TmFtZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGRpbWVuc2lvbnMgPSAwOworICAgICAgICAgICAgICAgICAgICB3aGlsZSAodGhlQ2xhc3MuaXNBcnJheSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkaW1lbnNpb25zKys7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGVDbGFzcyA9IHRoZUNsYXNzLmdldENvbXBvbmVudFR5cGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGRpbWVuc2lvbnM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCJbXSIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChqIDwgKHBhcmFtZXRlcnMubGVuZ3RoIC0gMSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiLCIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiKSIpOworCisgIC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U3RyaW5nIG1ldGhvZE5hbWUgPSBzaWduYXR1cmUuc3Vic3RyaW5nKHBvcyArIDEpOworICAgICAgICAgICAgU2V0PFN0cmluZz4gbWV0aG9kcyA9IG1EZWxlZ2F0ZU1ldGhvZHMuZ2V0KGNsYXNzTmFtZSk7CisgICAgICAgICAgICBpZiAobWV0aG9kcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbWV0aG9kcyA9IG5ldyBIYXNoU2V0PFN0cmluZz4oKTsKKyAgICAgICAgICAgICAgICBtRGVsZWdhdGVNZXRob2RzLnB1dChjbGFzc05hbWUsIG1ldGhvZHMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbWV0aG9kcy5hZGQobWV0aG9kTmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgZm9yIChTdHJpbmcgY2xhc3NOYW1lIDogY3JlYXRlSW5mby5nZXREZWxlZ2F0ZUNsYXNzTmF0aXZlcygpKSB7CisgICAgICAgICAgICBjbGFzc05hbWUgPSBiaW5hcnlUb0ludGVybmFsQ2xhc3NOYW1lKGNsYXNzTmFtZSk7CisgICAgICAgICAgICBTZXQ8U3RyaW5nPiBtZXRob2RzID0gbURlbGVnYXRlTWV0aG9kcy5nZXQoY2xhc3NOYW1lKTsKKyAgICAgICAgICAgIGlmIChtZXRob2RzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtZXRob2RzID0gbmV3IEhhc2hTZXQ8U3RyaW5nPigpOworICAgICAgICAgICAgICAgIG1EZWxlZ2F0ZU1ldGhvZHMucHV0KGNsYXNzTmFtZSwgbWV0aG9kcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtZXRob2RzLmFkZChEZWxlZ2F0ZUNsYXNzQWRhcHRlci5BTExfTkFUSVZFUyk7CisgICAgICAgIH0KIAogICAgICAgICAvLyBDcmVhdGUgdGhlIG1hcCBvZiBjbGFzc2VzIHRvIHJlbmFtZS4KICAgICAgICAgbVJlbmFtZUNsYXNzZXMgPSBuZXcgSGFza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gICAgIGZvciAoU3RyaW5nIGNsYXNzTmFtZSA6IGRlbGV0ZVJldHVybnMpIHsKLSAgICAgICAgICAgICAgICAvLyBpZiB3ZSByZWFjaCB0aGUgZW5kIG9mIGEgc2VjdGlvbiwgYWRkIGl0IHRvIHRoZSBtYWluIG1hcAotICAgICAgICAgICAgICAgIGlmIChjbGFzc05hbWUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpZiAocmV0dXJuVHlwZXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbURlbGV0ZVJldHVybnMucHV0KHJlbmFtZWRDbGFzcywgcmV0dXJuVHlwZXMpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICByZW5hbWVkQ2xhc3MgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgU3RyaW5nW10gZGVsZXRlUmV0dXJucyA9IGNyZWF0ZUluZm8uZ2V0RGVsZXRlUmV0dXJucygpOworICAgICAgICBTZXQ8U3RyaW5nPiByZXR1cm5UeXBlcyA9IG51bGw7CisgICAgICAgIFN0cmluZyByZW5hbWVkQ2xhc3MgPSBudWxsOworICAgICAgICBmb3IgKFN0cmluZyBjbGFzc05hbWUgOiBkZWxldGVSZXR1cm5zKSB7CisgICAgICAgICAgICAvLyBpZiB3ZSByZWFjaCB0aGUgZW5kIG9mIGEgc2VjdGlvbiwgYWRkIGl0IHRvIHRoZSBtYWluIG1hcAorICAgICAgICAgICAgaWYgKGNsYXNzTmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKHJldHVyblR5cGVzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbURlbGV0ZVJldHVybnMucHV0KHJlbmFtZWRDbGFzcywgcmV0dXJuVHlwZXMpOwogICAgICAgICAgICAgICAgIH0KLSAgICAKLSAgICAgICAgICAgICAgICAvLyBpZiB0aGUgcmVuYW1lZCBjbGFzcyBpcyBudWxsLCB0aGlzIGlzIHRoZSBiZWdpbm5pbmcgb2YgYSBzZWN0aW9uCi0gICAgICAgICAgICAgICAgaWYgKHJlbmFtZWRDbGFzcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlbmFtZWRDbGFzcyA9IGJpbmFyeVRvSW50ZXJuYWxDbGFzc05hbWUoY2xhc3NOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgIAotICAgICAgICAgICAgICAgIC8vIGp1c3QgYSBzdGFuZGFyZCByZXR1cm4gdHlwZSwgd2UgYWRkIGl0IHRvIHRoZSBsaXN0LgotICAgICAgICAgICAgICAgIGlmIChyZXR1cm5UeXBlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVyblR5cGVzID0gbmV3IEhhc2hTZXQ8U3RyaW5nPigpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICByZXR1cm5UeXBlcy5hZGQoYmluYXJ5VG9JbnRlcm5hbENsYXNzTmFtZShjbGFzc05hbWUpKTsKKworICAgICAgICAgICAgICAgIHJlbmFtZWRDbGFzcyA9IG51bGw7CisgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGlmIHRoZSByZW5hbWVkIGNsYXNzIGlzIG51bGwsIHRoaXMgaXMgdGhlIGJlZ2lubmluZyBvZiBhIHNlY3Rpb24KKyAgICAgICAgICAgIGlmIChyZW5hbWVkQ2xhc3MgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJlbmFtZWRDbGFzcyA9IGJpbmFyeVRvSW50ZXJuYWxDbGFzc05hbWUoY2xhc3NOYW1lKTsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8ganVzdCBhIHN0YW5kYXJkIHJldHVybiB0eXBlLCB3Z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KGludCBvcGNvZGUsIFN0cmluZyBvd25lciwgU3RyaW5nIG5hbWUsIFN0cmluZyBkZXNjKSB7CisgICAgICAgIC8vIFNraXAgb3JpZ2luYWwgY29kZS4KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB2aXNpdEZyYW1lKGludCB0eXBlLCBpbnQgbkxvY2FsLCBPYmplY3RbXSBsb2NhbCwgaW50IG5TdGFjaywgT2JqZWN0W10gc3RhY2spIHsKKyAgICAgICAgLy8gU2tpcCBvcmlnaW5hbCBjb2RlLgorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHZpc2l0SWluY0luc24oaW50IHZhciwgaW50IGluY3JlbWVudCkgeworICAgICAgICAvLyBTa2lwIG9yaWdpbmFsIGNvZGUuCisgICAgfQorCisgICAgcHVibGljIHZvaWQgdmlzaXRJbnRJbnNuKGludCBvcGNvZGUsIGludCBvcGVyYW5kKSB7CisgICAgICAgIC8vIFNraXAgb3JpZ2luYWwgY29kZS4KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB2aXNpdEp1bXBJbnNuKGludCBvcGNvZGUsIExhYmVsIGxhYmVsKSB7CisgICAgICAgIC8vIFNraXAgb3JpZ2luYWwgY29kZS4KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB2aXNpdExkY0luc24oT2JqZWN0IGNzdCkgeworICAgICAgICAvLyBTa2lwIG9yaWdpbmFsIGNvZGUuCisgICAgfQorCisgICAgcHVibGljIHZvaWQgdmlzaXRMb2NhbFZhcmlhYmxlKFN0cmluZyBuYW1lLCBTdHJpbmcgZGVzYywgU3RyaW5nIHNpZ25hdHVyZSwKKyAgICAgICAgICAgIExhYmVsIHN0YXJ0LCBMYWJlbCBlbmQsIGludCBpbmRleCkgeworICAgICAgICAvLyBTa2lwIG9yaWdpbmFsIGNvZGUuCisgICAgfQorCisgICAgcHVibGljIHZvaWQgdmlzaXRMb29rdXBTd2l0Y2hJbnNuKExhYmVsIGRmbHQsIGludFtdIGtleXMsIExhYmV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nJhbWV3b3JrIGphcnMmZ3Q7CisgKiAkIG91dC9ob3N0L2xpbnV4LXg4Ni9mcmFtZXdvcmsvYmluL2xheW91dGxpYl9jcmVhdGUgXAorICogICAgICAgIG91dC9ob3N0L2NvbW1vbi9vYmovSkFWQV9MSUJSQVJJRVMvdGVtcF9sYXlvdXRsaWJfaW50ZXJtZWRpYXRlcy9qYXZhbGliLmphciBcCisgKiAgICAgICAgb3V0L3RhcmdldC9jb21tb24vb2JqL0pBVkFfTElCUkFSSUVTL2NvcmVfaW50ZXJtZWRpYXRlcy9jbGFzc2VzLmphciBcCisgKiAgICAgICAgb3V0L3RhcmdldC9jb21tb24vb2JqL0pBVkFfTElCUkFSSUVTL2ZyYW1ld29ya19pbnRlcm1lZGlhdGVzL2NsYXNzZXMuamFyCisgKiA8L3ByZT4KKyAqLwogcHVibGljIGNsYXNzIE1haW4gewogCiAgICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewpAQCAtNDIsMTIgKzYzLDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBBc21HZW5lcmF0b3IgYWdlbiA9IG5ldyBBc21HZW5lcmF0b3IobG9nLCBvc0Rlc3RKYXJbMF0sCi0gICAgICAgICAgICAgICAgICAgIENyZWF0ZUluZm8uSU5KRUNURURfQ0xBU1NFUywKLSAgICAgICAgICAgICAgICAgICAgQ3JlYXRlSW5mby5PVkVSUklEREVOX01FVEhPRFMsCi0gICAgICAgICAgICAgICAgICAgIENyZWF0ZUluZm8uUkVOQU1FRF9DTEFTU0VTLAotICAgICAgICAgICAgICAgICAgICBDcmVhdGVJbmZvLlJFTU9WRURfTUVUSE9EUwotICAgICAgICAgICAgKTsKKyAgICAgICAgICAgIEFzbUdlbmVyYXRvciBhZ2VuID0gbmV3IEFzbUdlbmVyYXRvcihsb2csIG9zRGVzdEphclswXSwgbmV3IENyZWF0ZUluZm8oKSk7CiAKICAgICAgICAgICAgIEF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gICAgICBVUkwgdXJsID0gdGhpcy5nZXRDbGFzcygpLmdldENsYXNzTG9hZGVyKCkuZ2V0UmVzb3VyY2UoImRhdGEvbW9ja19hbmRyb2lkLmphciIpOwotICAgICAgICAKKwogICAgICAgICBtT3NKYXJQYXRoID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7CiAgICAgICAgIG1Pc0phclBhdGguYWRkKHVybC5nZXRGaWxlKCkpOwogCkBAIC02OSw5ICs2OCw5IEBACiAgICAgICAgICAgICAgICAgIm1vY2tfYW5kcm9pZC5kdW1teS5Jbm5lclRlc3QkRGVyaXZpbmdDbGFzcyIsCiAgICAgICAgICAgICAgICAgIm1vY2tfYW5kcm9pZC5kdW1teS5Jbm5lclRlc3QkTXlHZW5lcmljczEiLAogICAgICAgICAgICAgICAgICJtb2NrX2FuZHJvaWQuZHVtbXkuSW5uZXJUZXN0JE15SW50RW51bSIsCi0gICAgICAgICAgICAgICAgIm1vY2tfYW5kcm9pZC5kdW1teS5Jbm5lclRlc3QkTXlTdGF0aWNJbm5lckNsYXNzIiwgICAKLSAgICAgICAgICAgICAgICAibW9ja19hbmRyb2lkLmR1bW15LklubmVyVGVzdCROb3RTdGF0aWNJbm5lcjEiLCAKLSAgICAgICAgICAgICAgICAibW9ja19hbmRyb2lkLmR1bW15LklubmVyVGVzdCROb3RTdGF0aWNJbm5lcjIiLCAgCisgICAgICAgICAgICAgICAgIm1vY2tfYW5kcm9pZC5kdW1teS5Jbm5lclRlc3QkTXlTdGF0aWNJbm5lckNsYXNzIiwKKyAgICAgICAgICAgICAgICAibW9ja19hbmRyb2lkLmR1bW15LklubmVyVGVzdCROb3RTdGF0aWNJbm5lcjEiLAorICAgICAgICAgICAgICAgICJtb2NrX2FuZHJvaWQuZHVtbXkuSW5uZXJUZXN0JE5vdFN0YXRpY0lubmVyMiIsCiAgICAgICAgICAgICAgICAgIm1vY2tfYW5kcm9pZC52aWV3LlZpZXciLAogICAgICAgICAgICAgICAgICJtb2NrX2FuZHJvaWQudmlldy5WaWV3R3JvdXAiLAogICAgICAgICAgICAgICAgICJtb2NrX2FuZHJvaWQudmlldy5WaWV3R3JvdXAkTGF5b3V0UGFyYW1zIiwKQEAgLTgzLDcgKzgyLDcgQEAKICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICBtYXAua2V5U2V0KCkudG9BcnJheSgpKTsKICAgICB9Ci0gICAgCisKICAgICBAVGVzdAogICAgIHB1YmxpYyB2b2lkIHRlc3RGaW5kQ2xhc3MoKSB0aHJvd3MgSU9FeGNlcHRpb24sIExvZ0Fib3J0RXhjZXB0aW9uIHsKICAgICAgICAgTWFwPFN0cmluZywgQ2xhc3NSZWFkZXI+IHppcENsYXNzZXMgPSBtQWEucGFyc2VaaXAobU9zSmFyUGF0aCk7CkBAIC05MSw3ICs5MCw3IEBACiAKICAgICAgICAgQ2xhc3NSZWFkZXIgY3IgPSBtQWEuZmluZENsYXNzKCJtb2NrX2FuZHJvaWQudmlldy5WaWV3R3JvdXAkTGF5b3V0UGFyYW1zIiwKICAgICAgICAgICAgICAgICB6aXBDbGFzc2VzLCBmb3VuZCk7Ci0gICAgICAgIAorCiAgICAgICAgIGFzc2VydE5vdE51bGwoY3IpOwogICAgICAgICBhc3NlcnRFcXVhbHMoIm1vY2tfYW5kcm9pZC92aWV3L1ZpZXdHcm91cCRMYXlvdXRQYXJhbXMiLCBjci5nZXRDbGFzc05hbWUoKSk7CiAgICAgICAgIGFzc2VydEFycmF5RXF1YWxzKG5ldyBTdHJpbmdbXSB7ICJtb2NrX2FuZHJvaWQudmlldy5WaWV3R3JvdXAkTGF5b3V0UGFyYW1zIiB9LApAQCAtMTcyLDE0ICsxNzEsMTQgQEAKICAgICAgICAgICAgICAgICAibW9ja19hbmRyb2lkLndpZGdldC5UYWJsZUxheW91dCIsCiAgICAgICAgICAgICB9LAogICAgICAgICAgICAgZm91bmQua2V5U2V0KCkudG9BcnJheSgpKTsKLSAgICAgICAgCisKICAgICAgICAgZm9yIChTdHJpbmcga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bMF07CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHB1YmxpYyBTdHJpbmdbXSBnZXREZWxlZ2F0ZU1ldGhvZHMoKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmdbMF07CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHB1YmxpYyBTdHJpbmdbXSBnZXREZWxlZ2F0ZUNsYXNzTmF0aXZlcygpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0cmluZ1swXTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcHVibGljIFN0cmluZ1tdIGdldE92ZXJyaWRkZW5NZXRob2RzKCkgeworICAgICAgICAgICAgICAgIC8vIG1ldGhvZHMgdG8gZm9yY2Ugb3ZlcnJpZGUKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0cmluZ1swXTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcHVibGljIFN0cmluZ1tdIGdldFJlbmFtZWRDbGFzc2VzKCkgeworICAgICAgICAgICAgICAgIC8vIGNsYXNzZXMgdG8gcmVuYW1lIChzbyB0aGF0IHdlIGNhbiByZXBsYWNlIHRoZW0pCisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmdbXSB7CisgICAgICAgICAgICAgICAgICAgICAgICAibW9ja19hbmRyb2lkLnZpZXcuVmlldyIsICJtb2NrX2FuZHJvaWQudmlldy5fT3JpZ2luYWxfVmlldyIsCisgICAgICAgICAgICAgICAgICAgICAgICAibm90LmFuLmFjdHVhbC5DbGFzc05hbWUiLCAiYW5vdGVyLmZha2UuTmV3Q2xhc3NOYW1lIiwKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgU3RyaW5nW10gZ2V0RGVsZXRlUmV0dXJucygpIHsKKyAgICAgICAgICAgICAgICAgLy8gbWV0aG9kcyBkZWxldGVkIGZyb20gdGhlaXIgcmV0dXJuIHR5cGUuC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Ly8gVGhpcyBpcyBleHBlY3RlZCB0byBmYWlsIHNpbmNlIHRoZSBuYXRpdmUgbWV0aG9kIGhhcyBOT1QgYmVlbgorICAgICAgICAgICAgICAgICAgICAvLyBvdmVycmlkZGVuIGhlcmUuCisgICAgICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscyhVbnNhdGlzZmllZExpbmtFcnJvci5jbGFzcywgZS5nZXRDYXVzZSgpLmdldENsYXNzKCkpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIENoZWNrIHRoYXQgdGhlIG5hdGl2ZSBtZXRob2QgZG9lcyBOT1QgaGF2ZSB0aGUgbmV3IGFubm90YXRpb24KKyAgICAgICAgICAgICAgICBNZXRob2RbXSBtID0gY2xhenoyLmdldERlY2xhcmVkTWV0aG9kcygpOworICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscygibmF0aXZlX2luc3RhbmNlIiwgbVsyXS5nZXROYW1lKCkpOworICAgICAgICAgICAgICAgIGFzc2VydFRydWUoTW9kaWZpZXIuaXNOYXRpdmUobVsyXS5nZXRNb2RpZmllcnMoKSkpOworICAgICAgICAgICAgICAgIEFubm90YXRpb25bXSBhID0gbVsyXS5nZXRBbm5vdGF0aW9ucygpOworICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscygwLCBhLmxlbmd0aCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIGNsMi50ZXN0TW9kaWZpZWRJbnN0YW5jZSgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIHtAbGluayBEZWxlZ2F0ZU1ldGhvZEFkYXB0ZXJ9IGRvZXMgbm90IHN1cHBvcnQgb3ZlcnJpZGluZyBjb25zdHJ1Y3RvcnMgeWV0LAorICAgICAqIHNvIHRoaXMgc2hvdWxkIGZhaWwgd2l0aCBhbiB7QGxpbmsgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb259LgorICAgICAqCisgICAgICogQWx0aG91Z2ggbm90IHRlc3Rl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ICAgICBhc3NlcnROb3ROdWxsKGkyKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBVc2UgcmVmbGVjdGlvbiB0byBhY2Nlc3MgaW5uZXIgbWV0aG9kcworICAgICAgICAgICAgICAgICAgICBhc3NlcnRFcXVhbHMoNDIsIGNhbGxBZGQoaTIsIDIwLCAyMikpOworCisgICAgICAgICAgICAgICAgICAgICBPYmplY3RbXSBvYmpSZXN1bHQgPSBuZXcgT2JqZWN0W10geyBudWxsIH07CisgICAgICAgICAgICAgICAgICAgICBpbnQgcmVzdWx0ID0gY2FsbENhbGxOYXRpdmVJbnN0YW5jZShpMiwgMTAsIDMuMTQxNSwgb2JqUmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscygoaW50KSgxMCArIDMuMTQxNSksIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgICBhc3NlcnRTYW1lKGkyLCBvYmpSZXN1bHRbMF0pOworCisgICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayB0aGF0IHRoZSBuYXRpdmUgbWV0aG9kIG5vdyBoYXMgdGhlIG5ldyBhbm5vdGF0aW9uIGFuZCBpcyBub3QgbmF0aXZlCisgICAgICAgICAgICAgICAgICAgICBNZXRob2RbXSBtID0gY2xhenoyLmdldERlY2xhcmVkTWV0aG9kcygpOworICAgICAgICAgICAgICAgICAgICAgYXNzZXJ0RXF1YWxzKCJuYXRpdmVfaW5zdGFuY2UiLCBtWzJdLmdldE5hbWUoKSk7CisgICAgICAgICAgICAgICAgICAgICBhc3NlcnRGYWxzZShNb2RpZmllci5pc05hdGl2ZShtWzJdLmdldE1vZGlmaWVycygpKSk7CisgICAgICAgICAgICAgICAgICAgICBBbm5vdGF0aW9uW10gYSA9IG1bMl0uZ2V0QW5ub3RhdGlvbnMoKTsKKyAgICAgICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscygiTGF5b3V0bGliRGVsZWdhdGUiLCBhWzBdLmFubm90YXRpb25UeXBlKCkuZ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ndGgpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIC8vIExvYWQgZXZlcnl0aGluZyBlbHNlIGZyb20gdGhlIG9yaWdpbmFsIGRlZmluaXRpb24gaW50byB0aGUgbmV3IGNsYXNzIGxvYWRlci4KKyAgICAgICAgICAgICAgICAgICAgQ2xhc3NSZWFkZXIgY3IgPSBuZXcgQ2xhc3NSZWFkZXIobmFtZSk7CisgICAgICAgICAgICAgICAgICAgIENsYXNzV3JpdGVyIGN3ID0gbmV3IENsYXNzV3JpdGVyKDApOworICAgICAgICAgICAgICAgICAgICBjci5hY2NlcHQoY3csIDApOworICAgICAgICAgICAgICAgICAgICBieXRlW10gYnl0ZXMgPSBjdy50b0J5dGVBcnJheSgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGVmaW5lQ2xhc3MobmFtZSwgYnl0ZXMsIDAsIGJ5dGVzLmxlbmd0aCk7CisKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpb2UpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oaW9lKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQWNjZXNzZXMge0BsaW5rIENsYXNzV2l0aE5hdGl2ZSNhZGQoaW50LCBpbnQpfSB2aWEgcmVmbGVjdGlvbi4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBpbnQgY2FsbEFkZChPYmplY3QgaW5zdGFuY2UsIGludCBhLCBpbnQgYikgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgICAgICAgICBNZXRob2QgbSA9IGluc3RhbmNlLmdldENsYXNzKCkuZ2V0TWV0aG9kKCJhZGQiLAorICAgICAgICAgICAgICAgICAgICBuZXcgQ2xhc3M8Pz5bXSB7IGludC5jbGFzcywgaW50LmNsYXNzIH0pOworCisgICAgICAgICAgICBPYmplY3QgcmVzdWx0ID0gbS5pbnZva2UoaW5zdGFuY2UsIG5ldyBPYmplY3RbXSB7IGEsIGIgfSk7CisgICAgICAgICAgICByZXR1cm4gKChJbnRlZ2VyKSByZXN1bHQpLmludFZhbHVlKCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQWNjZXNzZXMge0BsaW5rIENsYXNzV2l0aE5hdGl2ZSNjYWxsTmF0aXZlSW5zdGFuY2UoaW50LCBkb3VibGUsIE9iamVjdFtdKX0KKyAgICAgICAgICogdmlhIHJlZmxlY3Rpb24uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGNhbGxDYWxsTmF0aXZlSW5zdGFuY2UoT2JqZWN0IGluc3RhbmNlLCBpbnQgYSwgZG91YmxlIGQsIE9iamVjdFtdIG8pCisgICAgICAgICAgICAgICAgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgICAgICAgICBNZXRob2QgbSA9IGluc3RhbmNlLmdldENsYXNzKCkuZ2V0TWV0aG9kKCJjYWxsTmF0aXZlSW5zdGFuY2UiLAorICAgICAgICAgICAgICAgICAgICBuZXcgQ2xhc3M8Pz5bXSB7IGludC5jbGFzcywgZG91YmxlLmNsYXNzLCBPYmplY3RbXS5jbGFzcyB9KTsKKworICAgICAgICAgICAgT2JqZWN0IHJlc3VsdCA9IG0uaW52b2tlKGluc3RhbmNlLCBuZXcgT2JqZWN0W10geyBhLCBkLCBvIH0pOworICAgICAgICAgICAgcmV0dXJuICgoSW50ZWdlcikgcmVzdWx0KS5pbnRWYWx1ZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGFic3RyYWN0IHZvaWQgdGVzdE1vZGlmaWVkSW5zdGFuY2UoKSB0aHJvd3MgRXhjZXB0aW9uOworICAgIH0KKworICAgIC8qKgorICAgICAqIER1bW15IHRlc3QgY2xhc3Mgd2l0aCBhIG5hdGl2ZSBtZXRob2QuCisgICAgICog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MKKyAgICAgKi8KKyAgICBzdGF0aWMgTGlzdDxXaWZpQ29uZmlndXJhdGlvbj4gZ2V0Q29uZmlndXJlZE5ldHdvcmtzKCkgeworICAgICAgICBMaXN0PFdpZmlDb25maWd1cmF0aW9uPiBuZXR3b3JrcyA9IG5ldyBBcnJheUxpc3Q8V2lmaUNvbmZpZ3VyYXRpb24+KCk7CisgICAgICAgIHN5bmNocm9uaXplZCAoc0NvbmZpZ3VyZWROZXR3b3JrcykgeworICAgICAgICAgICAgZm9yKFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZyA6IHNDb25maWd1cmVkTmV0d29ya3MudmFsdWVzKCkpIHsKKyAgICAgICAgICAgICAgICBuZXR3b3Jrcy5hZGQobmV3IFdpZmlDb25maWd1cmF0aW9uKGNvbmZpZykpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBuZXR3b3JrczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBlbmFibGUgYWxsIG5ldHdvcmtzIGFuZCBzYXZlIGNvbmZpZy4gVGhpcyB3aWxsIGJlIGEgbm8tb3AgaWYgdGhlIGxpc3QKKyAgICAgKiBvZiBjb25maWd1cmVkIG5ldHdvcmtzIGluZGljYXRlcyBhbGwgbmV0d29ya3MgYXMgYmVpbmcgZW5hYmxlZAorICAgICAqLworICAgIHN0YXRpYyB2b2lkIGVuYWJsZUFsbE5ldHdvcmtzKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHNDb25maWd1cmVkTmV0d29ya3MpIHsKKyAgICAgICAgICAgIGZvcihXaWZpQ29uZmlndXJhdGlvbiBjb25maWcgOiBzQ29uZmlndXJlZE5ldHdvcmtzLnZhbHVlcygpKSB7CisgICAgICAgICAgICAgICAgaWYoY29uZmlnICE9IG51bGwgJiYgY29uZmlnLnN0YXR1cyA9PSBTdGF0dXMuRElTQUJMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoV2lmaU5hdGl2ZS5lbmFibGVOZXR3b3JrQ29tbWFuZChjb25maWcubmV0d29ya0lkLCBmYWxzZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5zdGF0dXMgPSBTdGF0dXMuRU5BQkxFRDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkVuYWJsZSBuZXR3b3JrIGZhaWxlZCBvbiAiICsgY29uZmlnLm5ldHdvcmtJZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBXaWZpTmF0aXZlLnNhdmVDb25maWdDb21tYW5kKCk7CisgICAgICAgIHNlbmRDb25maWdDaGFuZ2VCcm9hZGNhc3QoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZWxlY3RzIHRoZSBzcGVjaWZpZWQgbmV0d29yayBjb25maWcgZm9yIGNvbm5lY3Rpb24uIFRoaXMgaW52b2x2ZXMKKyAgICAgKiBhZGRpdGlvbi91cGRhdGUgb2YgdGhlIHNwZWNpZmllZCBjb25maWcsIHVwZGF0aW5nIHRoZSBwcmlvcml0eSBvZgorICAgICAqIGFsbCB0aGUgbmV0d29ya3MgYW5kIGVuYWJsaW5nIHRoZSBnaXZlbiBuZXR3b3JrIHdoaWxlIGRpc2FibGluZyBvdGhlcnMuCisgICAgICoKKyAgICAgKiBTZWxlY3RpbmcgYSBuZXR3b3JrIHdpbGwgbGVhdmUgdGhlIG90aGVyIG5ldHdvcmtzIGRpc2FibGVkIGFuZAorICAgICAqIGEgY2FsbCB0byBlbmFibGVBbGxOZXR3b3JrcygpIG5lZWRzIHRvIGJlIGlzc3VlZCB1cG9uIGEgY29ubmVjdGlvbgorICAgICAqIG9yIGEgZmFpbHVyZSBldmVudCBmcm9tIHN1cHBsaWNhbnQKKyAgICAgKgorICAgICAqIEBwYXJhbSBjb25maWcgVGhlIGNvbmZpZ3VyYXRpb24gZGV0YWlscyBpbiBXaWZpQ29uZmlndXJhdGlvbgorICAgICAqLworICAgIHN0YXRpYyB2b2lkIHNlbGVjdE5ldHdvcmsoV2lmaUNvbmZpZ3VyYXRpb24gY29uZmlnKSB7CisgICAgICAgIGlmIChjb25maWcgIT0gbnVsbCkgeworICAgICAgICAgICAgaW50IG5ldElkID0gYWRkT3JVcGRhdGVOZXR3b3JrTmF0aXZlKGNvbmZpZyk7CisgICAgICAgICAgICBpZiAobmV0SWQgIT0gSU5WQUxJRF9ORVRXT1JLX0lEKSB7CisgICAgICAgICAgICAgICAgc2VsZWN0TmV0d29yayhuZXRJZCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWxlZCB0byB1cGRhdGUgbmV0d29yayAiICsgY29uZmlnKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFNlbGVjdHMgdGhlIHNwZWNpZmllZCBuZXR3b3JrIGZvciBjb25uZWN0aW9uLiBUaGlzIGludm9sdmVzCisgICAgICogdXBkYXRpbmcgdGhlIHByaW9yaXR5IG9mIGFsbCB0aGUgbmV0d29ya3MgYW5kIGVuYWJsaW5nIHRoZSBnaXZlbgorICAgICAqIG5ldHdvcmsgd2hpbGUgZGlzYWJsaW5nIG90aGVycy4KKyAgICAgKgorICAgICAqIFNlbGVjdGluZyBhIG5ldHdvcmsgd2lsbCBsZWF2ZSB0aGUgb3RoZXIgbmV0d29ya3MgZGlzYWJsZWQgYW5kCisgICAgICogYSBjYWxsIHRvIGVuYWJsZUFsbE5ldHdvcmtzKCkgbmVlZHMgdG8gYmUgaXNzdWVkIHVwb24gYSBjb25uZWN0aW9uCisgICAgICogb3IgYSBmYWlsdXJlIGV2ZW50IGZyb20gc3VwcGxpY2FudAorICAgICAqCisgICAgICogQHBhcmFtIG5ldElkIG5ldHdvcmsgdG8gc2VsZWN0IGZvciBjb25uZWN0aW9uCisgICAgICovCisgICAgc3RhdGljIHZvaWQgc2VsZWN0TmV0d29yayhpbnQgbmV0SWQpIHsKKyAgICAgICAgLy8gUmVzZXQgdGhlIHByaW9yaXR5IG9mIGVhY2ggbmV0d29yayBhdCBzdGFydCBvciBpZiBpdCBnb2VzIHRvbyBoaWdoLgorICAgICAgICBpZiAoc0xhc3RQcmlvcml0eSA9PSAtMSB8fCBzTGFzdFByaW9yaXR5ID4gMTAwMDAwMCkgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChzQ29uZmlndXJlZE5ldHdvcmtzKSB7CisgICAgICAgICAgICAgICAgZm9yKFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZyA6IHNDb25maWd1cmVkTmV0d29ya3MudmFsdWVzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5uZXR3b3JrSWQgIT0gSU5WQUxJRF9ORVRXT1JLX0lEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcucHJpb3JpdHkgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgYWRkT3JVcGRhdGVOZXR3b3JrTmF0aXZlKGNvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzTGFzdFByaW9yaXR5ID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFNldCB0byB0aGUgaGlnaGVzdCBwcmlvcml0eSBhbmQgc2F2ZSB0aGUgY29uZmlndXJhdGlvbi4KKyAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24gY29uZmlnID0gbmV3IFdpZmlDb25maWd1cmF0aW9uKCk7CisgICAgICAgIGNvbmZpZy5uZXR3b3JrSWQgPSBuZXRJZDsKKyAgICAgICAgY29uZmlnLnByaW9yaXR5ID0gKytzTGFzdFByaW9yaXR5OworCisgICAgICAgIGFkZE9yVXBkYXRlTmV0d29ya05hdGl2ZShjb25maWcpOworICAgICAgICBXaWZpTmF0aXZlLnNhdmVDb25maWdDb21tYW5kKCk7CisKKyAgICAgICAgLyogRW5hYmxlIHRoZSBnaXZlbiBuZXR3b3JrIHdoaWxlIGRpc2FibGluZyBhbGwgb3RoZXIgbmV0d29ya3MgKi8KKyAgICAgICAgZW5hYmxlTmV0d29ya1dpdGhvdXRCcm9hZGNhc3QobmV0SWQsIHRydWUpOworCisgICAgICAgLyogQXZvaWQgc2F2aW5nIHRoZSBjb25maWcgJiBzZW5kaW5nIGEgYnJvYWRjYXN0IHRvIHByZXZlbnQgc2V0dGluZ3MKKyAgICAgICAgKiBmcm9tIGRpc3BsYXlpbmcgYSBkaXNhYmxlZCBsaXN0IG9mIG5ldHdvcmtzICovCisgICAgfQorCisgICAgLyoqCisgICAgICogQWRkL3VwZGF0ZSB0aGUgc3BlY2lmaWVkIGNvbmZpZ3VyYXRpb24gYW5kIHNhdmUgY29uZmlnCisgICAgICoKKyAgICAgKiBAcGFyYW0gY29uZmlnIFdpZmlDb25maWd1cmF0aW9uIHRvIGJlIHNhdmVkCisgICAgICovCisgICAgc3RhdGljIHZvaWQgc2F2ZU5ldHdvcmsoV2lmaUNvbmZpZ3VyYXRpb24gY29uZmlnKSB7CisgICAgICAgIGJvb2xlYW4gbmV3TmV0d29yayA9IChjb25maWcubmV0d29ya0lkID09IElOVkFMSURfTkVUV09SS19JRCk7CisgICAgICAgIGludCBuZXRJZCA9IGFkZE9yVXBkYXRlTmV0d29ya05hdGl2ZShjb25maWcpOworICAgICAgICAvKiBlbmFibGUgYSBuZXcgbmV0d29yayAqLworICAgICAgICBpZiAobmV3TmV0d29yayAmJiBuZXRJZCAhPSBJTlZBTElEX05FVFdPUktfSUQpIHsKKyAgICAgICAgICAgIFdpZmlOYXRpdmUuZW5hYmxlTmV0d29ya0NvbW1hbmQobmV0SWQsIGZhbHNlKTsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc0NvbmZpZ3VyZWROZXR3b3JrcykgeworICAgICAgICAgICAgICAgIHNDb25maWd1cmVkTmV0d29ya3MuZ2V0KG5ldElkKS5zdGF0dXMgPSBTdGF0dXMuRU5BQkxFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBXaWZpTmF0aXZlLnNhdmVDb25maWdDb21tYW5kKCk7CisgICAgICAgIHNlbmRDb25maWdDaGFuZ2VCcm9hZGNhc3QoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBGb3JnZXQgdGhlIHNwZWNpZmllZCBuZXR3b3JrIGFuZCBzYXZlIGNvbmZpZworICAgICAqCisgICAgICogQHBhcmFtIG5ldElkIG5ldHdvcmsgdG8gZm9yZ2V0CisgICAgICovCisgICAgc3RhdGljIHZvaWQgZm9yZ2V0TmV0d29yayhpbnQgbmV0SWQpIHsKKyAgICAgICAgaWYgKFdpZmlOYXRpdmUucmVtb3ZlTmV0d29ya0NvbW1hbmQobmV0SWQpKSB7CisgICAgICAgICAgICBXaWZpTmF0aXZlLnNhdmVDb25maWdDb21tYW5kKCk7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNDb25maWd1cmVkTmV0d29ya3MpIHsKKyAgICAgICAgICAgICAgICBzQ29uZmlndXJlZE5ldHdvcmtzLnJlbW92ZShuZXRJZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB3cml0ZUlwQW5kUHJveHlDb25maWd1cmF0aW9ucygpOworICAgICAgICAgICAgc2VuZENvbmZpZ0NoYW5nZUJyb2FkY2FzdCgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiRmFpbGVkIHRvIHJlbW92ZSBuZXR3b3JrICIgKyBuZXRJZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBZGQvdXBkYXRlIGEgbmV0d29yay4gTm90ZSB0aGF0IHRoZXJlIGlzIG5vIHNhdmVDb25maWcgb3BlcmF0aW9uLgorICAgICAqIFRoaXMgZnVuY3Rpb24gaXMgcmV0YWluZWQgZm9yIGNvbXBhd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LCBkaXNhYmxlT3RoZXJzKTsKKworICAgICAgICBzeW5jaHJvbml6ZWQgKHNDb25maWd1cmVkTmV0d29ya3MpIHsKKyAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZyA9IHNDb25maWd1cmVkTmV0d29ya3MuZ2V0KG5ldElkKTsKKyAgICAgICAgICAgIGlmIChjb25maWcgIT0gbnVsbCkgY29uZmlnLnN0YXR1cyA9IFN0YXR1cy5FTkFCTEVEOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGRpc2FibGVPdGhlcnMpIHsKKyAgICAgICAgICAgIG1hcmtBbGxOZXR3b3Jrc0Rpc2FibGVkRXhjZXB0KG5ldElkKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIC8qKgorICAgICAqIERpc2FibGUgYSBuZXR3b3JrLiBOb3RlIHRoYXQgdGhlcmUgaXMgbm8gc2F2ZUNvbmZpZyBvcGVyYXRpb24uCisgICAgICogQHBhcmFtIG5ldElkIG5ldHdvcmsgdG8gYmUgZGlzYWJsZWQKKyAgICAgKi8KKyAgICBzdGF0aWMgYm9vbGVhbiBkaXNhYmxlTmV0d29yayhpbnQgbmV0SWQpIHsKKyAgICAgICAgYm9vbGVhbiByZXQgPSBXaWZpTmF0aXZlLmRpc2FibGVOZXR3b3JrQ29tbWFuZChuZXRJZCk7CisgICAgICAgIHN5bmNocm9uaXplZCAoc0NvbmZpZ3VyZWROZXR3b3JrcykgeworICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24gY29uZmlnID0gc0NvbmZpZ3VyZWROZXR3b3Jrcy5nZXQobmV0SWQpOworICAgICAgICAgICAgaWYgKGNvbmZpZyAhPSBudWxsKSBjb25maWcuc3RhdHVzID0gU3RhdHVzLkRJU0FCTEVEOworICAgICAgICB9CisgICAgICAgIHNlbmRDb25maWdDaGFuZ2VCcm9hZGNhc3QoKTsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisKK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XaWZpTmF0aXZlLnN0YXJ0V3BzV2l0aFBpbkZyb21EZXZpY2VDb21tYW5kKGJzc2lkKTsKKyAgICAgICAgLyogV1BTIGxlYXZlcyBhbGwgbmV0d29ya3MgZGlzYWJsZWQgKi8KKyAgICAgICAgaWYgKHBpbiAhPSAtMSkgeworICAgICAgICAgICAgbWFya0FsbE5ldHdvcmtzRGlzYWJsZWQoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWxlZCB0byBzdGFydCBXUFMgcGluIG1ldGhvZCBjb25maWd1cmF0aW9uIik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHBpbjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdGFydCBXUFMgcHVzaCBidXR0b24gY29uZmlndXJhdGlvbgorICAgICAqLworICAgIHN0YXRpYyBib29sZWFuIHN0YXJ0V3BzUGJjKFN0cmluZyBic3NpZCkgeworICAgICAgICBpZiAoV2lmaU5hdGl2ZS5zdGFydFdwc1BiY0NvbW1hbmQoYnNzaWQpKSB7CisgICAgICAgICAgICAvKiBXUFMgbGVhdmVzIGFsbCBuZXR3b3JrcyBkaXNhYmxlZCAqLworICAgICAgICAgICAgbWFya0FsbE5ldHdvcmtzRGlzYWJsZWQoKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIExvZy5lKFRBRywgIkZhaWxlZCB0byBzdGFydCBXUFMgcHVzaCBidXR0b24gY29uZmlndXJhdGlvbiIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogRmV0Y2ggdGhlIGxpbmsgcHJvcGVydGllcyBmb3IgYSBnaXZlbiBuZXR3b3JrIGlkCisgICAgICovCisgICAgc3RhdGljIExpbmtQcm9wZXJ0aWVzIGdldExpbmtQcm9wZXJ0aWVzKGludCBuZXRJZCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHNDb25maWd1cmVkTmV0d29ya3MpIHsKKyAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZyA9IHNDb25maWd1cmVkTmV0d29ya3MuZ2V0KG5ldElkKTsKKyAgICAgICAgICAgIGlmIChjb25maWcgIT0gbnVsbCkgcmV0dXJuIG5ldyBMaW5rUHJvcGVydGllcyhjb25maWcubGlua1Byb3BlcnRpZXMpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIGdldCBJUCBjb25maWd1cmF0aW9uIGZvciBhIGdpdmVuIG5ldHdvcmsgaWQKKyAgICAgKiBUT0RPOiBXZSBjYW5ub3QgaGFuZGxlIElQdjYgYWRkcmVzc2VzIGZvciBjb25maWd1cmF0aW9uCisgICAgICogICAgICAgcmlnaHQgbm93IHVudGlsIE5ldHdvcmtVdGlscyBpcyBmaXhlZC4gV2hlbiB3ZSBkbworICAgICAqICAgICAgIHRoYXQsIHdlIHNob3VsZCByZW1vdmUgaGFuZGxpbmcgRGhjcEluZm8gYW5kIG1vdmUKKyAgICAgKiAgICAgICB0byB1c2luZyBMaW5rUHJvcGVydGllcworICAgICAqLworICAgIHN0YXRpYyBEaGNwSW5mbyBnZXRJcENvbmZpZ3VyYXRpb24oaW50IG5ldElkKSB7CisgICAgICAgIERoY3BJbmZvIGRoY3BJbmZvID0gbmV3IERoY3BJbmZvKCk7CisgICAgICAgIExpbmtQcm9wZXJ0aWVzIGxpbmtQcm9wZXJ0aWVzID0gZ2V0TGlua1Byb3BlcnRpZXMobmV0SWQpOworCisgICAgICAgIGlmIChsaW5rUHJvcGVydGllcyAhPSBudWxsKSB7CisgICAgICAgICAgICBJdGVyYXRvcjxMaW5rQWRkcmVzcz4gaXRlciA9IGxpbmtQcm9wZXJ0aWVzLmdldExpbmtBZGRyZXNzZXMoKS5pdGVyYXRvcigpOworICAgICAgICAgICAgaWYgKGl0ZXIuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgTGlua0FkZHJlc3MgbGlua0FkZHJlc3MgPSBpdGVyLm5leHQoKTsKKyAgICAgICAgICAgICAgICAgICAgZGhjcEluZm8uaXBBZGRyZXNzID0gTmV0d29ya1V0aWxzLmluZXRBZGRyZXNzVG9JbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua0FkZHJlc3MuZ2V0QWRkcmVzcygpKTsKKyAgICAgICAgICAgICAgICAgICAgZGhjcEluZm8uZ2F0ZXdheSA9IE5ldHdvcmtVdGlscy5pbmV0QWRkcmVzc1RvSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtQcm9wZXJ0aWVzLmdldEdhdGV3YXkoKSk7CisgICAgICAgICAgICAgICAgICAgIGRoY3BJbmZvLm5ldG1hc2sgPSBOZXR3b3JrVXRpbHMucHJlZml4TGVuZ3RoVG9OZXRtYXNrSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtBZGRyZXNzLmdldE5ldHdvcmtQcmVmaXhMZW5ndGgoKSk7CisgICAgICAgICAgICAgICAgICAgIEl0ZXJhdG9yPEluZXRBZGRyZXNzPiBkbnNJdGVyYXRvciA9IGxpbmtQcm9wZXJ0aWVzLmdldERuc2VzKCkuaXRlcmF0b3IoKTsKKyAgICAgICAgICAgICAgICAgICAgZGhjcEluZm8uZG5zMSA9IE5ldHdvcmtVdGlscy5pbmV0QWRkcmVzc1RvSW50KGRuc0l0ZXJhdG9yLm5leHQoKSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChkbnNJdGVyYXRvci5oYXNOZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRoY3BJbmZvLmRuczIgPSBOZXR3b3JrVXRpbHMuaW5ldEFkZHJlc3NUb0ludChkbnNJdGVyYXRvci5uZXh0KCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIGUxKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIklQdjYgYWRkcmVzcyBjYW5ub3QgYmUgaGFuZGxlZCAiICsgZTEpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE51bGxQb2ludGVyRXhjZXB0aW9uIGUyKSB7CisgICAgICAgICAgICAgICAgICAgIC8qIFNob3VsZCBub3QgaGFwcGVuIHNpbmNlIGEgc3RvcmVkIHN0YXRpYyBjb25maWcgc2hvdWxkIGJlIHZhbGlkICovCisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkludmFsaWQgcGFydGlhbCBJUCBjb25maWd1cmF0aW9uICIgKyBlMik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBkaGNwSW5mbzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBGZXRjaCB0aGUgcHJveHkgcHJvcGVydGllcyBmb3IgYSBnaXZlbiBuZXR3b3JrIGlkCisgICAgICovCisgICAgc3RhdGljIFByb3h5UHJvcGVydGllcyBnZXRQcm94eVByb3BlcnRpZXMoaW50IG5ldElkKSB7CisgICAgICAgIExpbmtQcm9wZXJ0aWVzIGxpbmtQcm9wZXJ0aWVzID0gZ2V0TGlua1Byb3BlcnRpZXMobmV0SWQpOworICAgICAgICBpZiAobGlua1Byb3BlcnRpZXMgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm94eVByb3BlcnRpZXMobGlua1Byb3BlcnRpZXMuZ2V0SHR0cFByb3h5KCkpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiBpZiB0aGUgc3BlY2lmaWVkIG5ldHdvcmsgaXMgdXNpbmcgc3RhdGljIElQCisgICAgICovCisgICAgc3RhdGljIGJvb2xlYW4gaXNVc2luZ1N0YXRpY0lwKGludCBuZXRJZCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHNDb25maWd1cmVkTmV0d29ya3MpIHsKKyAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZyA9IHNDb25maWd1cmVkTmV0d29ya3MuZ2V0KG5ldElkKTsKKyAgICAgICAgICAgIGlmIChjb25maWcgIT0gbnVsbCAmJiBjb25maWcuaXBBc3NpZ25tZW50ID09IElwQXNzaWdubWVudC5TVEFUSUMpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBzZW5kQ29uZmlnQ2hhbmdlQnJvYWRjYXN0KCkgeworICAgICAgICBpZiAoIUFjdGl2aXR5TWFuYWdlck5hdGl2ZS5pc1N5c3RlbVJlYWR5KCkpIHJldHVybjsKKyAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoV2lmaU1hbmFnZXIuU1VQUExJQ0FOVF9DT05GSUdfQ0hBTkdFRF9BQ1RJT04pOworICAgICAgICBzQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCk7CisgICAgfQorCisgICAgc3RhdGljIHZvaWQgbG9hZENvbmZpZ3VyZWROZXR3b3JrcygpIHsKKyAgICAgICAgU3RyaW5nIGxpc3RTdHIgPSBXaWZpTmF0aXZlLmxpc3ROZXR3b3Jrc0NvbW1hbmQoKTsKKyAgICAgICAgc0xhc3RQcmlvcml0eSA9IDA7CisKKyAgICAgICAgc3luY2hyb25pemVkIChzQ29uZmlndXJlZE5ldHdvcmtzKSB7CisgICAgICAgICAgICBzQ29uZmlndXJlZE5ldHdvcmtzLmNsZWFyKCk7CisgICAgICAgICAgICBzTmV0d29ya0lkcy5jbGVhcigpOworCisgICAgICAgICAgICBpZiAobGlzdFN0ciA9PSBudWxsKQorICAgICAgICAgICAgICAgIHJldHVybjsKKworICAgICAgICAgICAgU3RyaW5nW10gbGluZXMgPSBsaXN0U3RyLnNwbGl0KCJcbiIpOworICAgICAgICAgICAgLy8gU2tpcCB0aGUgZmlyc3QgbGluZSwgd2hpY2ggaXMgYSBoZWFkZXIKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDwgbGluZXMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICBTdHJpbmdbXSByZXN1bHQgPSBsaW5lc1tpXS5zcGxpdCgiXHQiKTsKKyAgICAgICAgICAgICAgICAvLyBuZXR3b3JrLWlkIHwgc3NpZCB8IGJzc2lkIHwgZmxhZ3MKKyAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbiBjb25maWcgPSBuZXcgV2lmaUNvbmZpZ3VyYXRpb24oKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBjb25maWcubmV0d29ya0lkID0gSW50ZWdlci5wYXJzZUludChyZXN1bHRbMF0pOworICAgICAgICAgICAgICAgIH0gY2F0Y2goTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChyZXN1bHQubGVuZ3RoID4gMykgeworICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0WzNdLmluZGV4T2YoIltDVVJSRU5UXSIpICE9IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLnN0YXR1cyA9IFdpZmlDb25maWd1cmF0aW9uLlN0YXR1cy5DVVJSRU5UOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZXN1bHRbM10uaW5kZXhPZigiW0RJU0FCTEVEXSIpICE9IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLnN0YXR1cyA9IFdpZmlDb25maWd1cmF0aW9uLlN0YXR1cy5ESVNBQkxFRDsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLnN0YXR1cyA9IFdpZmlDb25maWd1cmF0aW9uLlN0YXR1cy5FTkFCTEVEOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5zdGF0dXMgPSBXaWZpQ29uZmlndXJhdGlvbi5TdGF0dXMuRU5BQkxFRDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmVhZE5ldHdvcmtWYXJpYWJsZXMoY29uZmlnKTsKKyAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnByaW9yaXR5ID4gc0xhc3RQcmlvcml0eSkgeworICAgICAgICAgICAgICAgICAgICBzTGFzdFByaW9yaXR5ID0gY29uZmlnLnByaW9yaXR5OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzQ29uZmlndXJlZE5ldHdvcmtzLnB1dChjb25maWcubmV0d29ya0lkLCBjb25maWcpOworICAgICAgICAgICAgICAgIHNOZXR3b3JrSWRzLnB1dChjb25maWdLZXkoY29uZmlnKSwgY29uZmlnLm5ldHdvcmtJZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmVhZElwQW5kUHJveHlDb25maWd1cmF0aW9ucygpOworICAgICAgICBzZW5kQ29uZmlnQ2hhbmdlQnJvYWRjYXN0KCk7CisgICAgfQorCisgICAgLyogTWFyayBhbGwgbmV0d29ya3MgZXhjZXB0IHNwZWNpZmllZCBuZXRJZCBhcyBkaXNhYmxlZCAqLworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgbWFya0FsbE5ldHdvcmtzRGlzYWJsZWRFeGNlcHQoaW50IG5ldElkKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAoc0NvbmZpZ3VyZWROZXR3b3JrcykgeworICAgICAgICAgICAgZm9yKFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZyA6IHNDb25maWd1cmVkTmV0d29ya3MudmFsdWVzKCkpIHsKKyAgICAgICAgICAgICAgICBpZihjb25maWcgIT0gbnVsbCAmJiBjb25maWcubmV0d29ya0lkICE9IG5ldElkKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5zdGF0dXMgPSBTdGF0dXMuRElTQUJMRUQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBtYXJrQWxsTmV0d29ya3NEaXNhYmxlZCgpIHsKKyAgICAgICAgbWFya0FsbE5ldHdvcmtzRGlzYWJsZWRFeGNlcHQoSU5WQUxJRF9ORVRXT1JLX0lEKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyB2b2lkIHdyaXRlSXBBbmRQcm94eUNvbmZpZ3VyYXRpb25zKCkgeworCisgICAgICAgIERhdGFPdXRwdXRTdHJlYW0gb3V0ID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG91dCA9IG5ldyBEYXRhT3V0cHV0U3RyZWFtKG5ldyBCdWZmZXJlZE91dHB1dFN0cmVhbSgKKyAgICAgICAgICAgICAgICAgICAgbmV3IEZpbGVPdXRwdXRTdHJlYW0oaXBDb25maWdGaWxlKSkpOworCisgICAgICAgICAgICBvdXQud3JpdGVJbnQoSVBDT05GSUdfRklMRV9WRVJTSU9OKTsKKworICAgICAgICAgICAgc3luY2hyb25pemVkIChzQ29uZmlndXJlZE5ldHdvcmtzKSB7CisgICAgICAgICAgICAgICAgZm9yKFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZyA6IHNDb25maWd1cmVkTmV0d29ya3MudmFsdWVzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiB3cml0ZVRvRmlsZSA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMaW5rUHJvcGVydGllcyBsaW5rUHJvcGVydGllcyA9IGNvbmZpZy5saW5rUHJvcGVydGllczsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoY29uZmlnLmlwQXNzaWdubWVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU1RBVElDOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVVVEYoSVBfQVNTSUdOTUVOVF9LRVkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVVVEYoY29uZmlnLmlwQXNzaWdubWVudC50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChMaW5rQWRkcmVzcyBsaW5rQWRkciA6IGxpbmtQcm9wZXJ0aWVzLmdldExpbmtBZGRyZXNzZXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlVVRGKExJTktfQUREUkVTU19LRVkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlVVRGKGxpbmtBZGRyLmdldEFkZHJlc3MoKS5nZXRIb3N0QWRkcmVzcygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZUludChsaW5rQWRkci5nZXROZXR3b3JrUHJlZml4TGVuZ3RoKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZXRBZGRyZXNzIGdhdGV3YXkgPSBsaW5rUHJvcGVydGllcy5nZXRHYXRld2F5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnYXRld2F5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZVVURihHQVRFV0FZX0tFWSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVVVEYoZ2F0ZXdheS5nZXRIb3N0QWRkcmVzcygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKEluZXRBZGRyZXNzIGluZXRBZGRyIDogbGlua1Byb3BlcnRpZXMuZ2V0RG5zZXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlVVRGKEROU19LRVkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlVVRGKGluZXRBZGRyLmdldEhvc3RBZGRyZXNzKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlVG9GaWxlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBESENQOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVVVEYoSVBfQVNTSUdOTUVOVF9LRVkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVVVEYoY29uZmlnLmlwQXNzaWdubWVudC50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVUb0ZpbGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFVOQVNTSUdORUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIElnbm9yZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJJZ25vcmUgaW52YWxpZCBpcCBhc3NpZ25tZW50IHdoaWxlIHdyaXRpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoY29uZmlnLnByb3h5U2V0dGluZ3MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNUQVRJQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUHJveHlQcm9wZXJ0aWVzIHByb3h5UHJvcGVydGllcyA9IGxpbmtQcm9wZXJ0aWVzLmdldEh0dHBQcm94eSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZXhjbHVzaW9uTGlzdCA9IHByb3h5UHJvcGVydGllcy5nZXRFeGNsdXNpb25MaXN0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZVVURihQUk9YWV9TRVRUSU5HU19LRVkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVVVEYoY29uZmlnLnByb3h5U2V0dGluZ3MudG9TdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZVVURihQUk9YWV9IT1NUX0tFWSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZVVURihwcm94eVByb3BlcnRpZXMuZ2V0U29ja2V0QWRkcmVzcygpLmdldEhvc3ROYW1lKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVVVEYoUFJPWFlfUE9SVF9LRVkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVJbnQocHJveHlQcm9wZXJ0aWVzLmdldFNvY2tldEFkZHJlc3MoKS5nZXRQb3J0KCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVVVEYoRVhDTFVTSU9OX0xJU1RfS0VZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlVVRGKGV4Y2x1c2lvbkxpc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZVRvRmlsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTk9ORToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlVVRGKFBST1hZX1NFVFRJTkdTX0tFWSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZVVURihjb25maWcucHJveHlTZXR0aW5ncy50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVUb0ZpbGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFVOQVNTSUdORUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIElnbm9yZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJJZ25vcmUgaW52YWxpZCBwcm94eSBzZXR0aW5ncyB3aGlsZSB3cml0aW5nIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdyaXRlVG9GaWxlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlVVRGKElEX0tFWSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlSW50KGNvbmZpZ0tleShjb25maWcpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTnVsbFBvaW50ZXJFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRmFpbHVyZSBpbiB3cml0aW5nICIgKyBjb25maWcubGlua1Byb3BlcnRpZXMgKyBlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGVVVEYoRU9TKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3Igd3JpdGluZyBkYXRhIGZpbGUiKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChvdXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7fQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCByZWFkSXBBbmRQcm94eUNvbmZpZ3VyYXRpb25zKCkgeworCisgICAgICAgIERhdGFJbnB1dFN0cmVhbSBpbiA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpbiA9IG5ldyBEYXRhSW5wdXRTdHJlYW0obmV3IEJ1ZmZlcmVkSW5wdXRTdHJlYW0obmV3IEZpbGVJbnB1dFN0cmVhbSgKKyAgICAgICAgICAgICAgICAgICAgaXBDb25maWdGaWxlKSkpOworCisgICAgICAgICAgICBpZiAoaW4ucmVhZEludCgpICE9IElQQ09ORklHX0ZJTEVfVkVSU0lPTikgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkJhZCB2ZXJzaW9uIG9uIElQIGNvbmZpZ3VyYXRpb24gZmlsZSwgaWdub3JlIHJlYWQiKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7CisgICAgICAgICAgICAgICAgaW50IGlkID0gLTE7CisgICAgICAgICAgICAgICAgSXBBc3NpZ25tZW50IGlwQXNzaWdubWVudCA9IElwQXNzaWdubWVudC5VTkFTU0lHTkVEOworICAgICAgICAgICAgICAgIFByb3h5U2V0dGluZ3MgcHJveHlTZXR0aW5ncyA9IFByb3h5U2V0dGluZ3MuVU5BU1NJR05FRDsKKyAgICAgICAgICAgICAgICBMaW5rUHJvcGVydGllcyBsaW5rUHJvcGVydGllcyA9IG5ldyBMaW5rUHJvcGVydGllcygpOworICAgICAgICAgICAgICAgIFN0cmluZyBwcm94eUhvc3QgPSBudWxsOworICAgICAgICAgICAgICAgIGludCBwcm94eVBvcnQgPSAtMTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgZXhjbHVzaW9uTGlzdCA9IG51bGw7CisgICAgICAgICAgICAgICAgU3RyaW5nIGtleTsKKworICAgICAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICAgICAga2V5ID0gaW4ucmVhZFVURigpOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGtleS5lcXVhbHMoSURfS0VZKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkID0gaW4ucmVhZEludCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkuZXF1YWxzKElQX0FTU0lHTk1FTlRfS0VZKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlwQXNzaWdubWVudCA9IElwQXNzaWdubWVudC52YWx1ZU9mKGluLnJlYWRVVEYoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleS5lcXVhbHMoTElOS19BRERSRVNTX0tFWSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaW5rQWRkcmVzcyBsaW5rQWRkciA9IG5ldyBMaW5rQWRkcmVzcyhJbmV0QWRkcmVzcy5nZXRCeU5hbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbi5yZWFkVVRGKCkpLCBpbi5yZWFkSW50KCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtQcm9wZXJ0aWVzLmFkZExpbmtBZGRyZXNzKGxpbmtBZGRyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5LmVxdWFscyhHQVRFV0FZX0tFWSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rUHJvcGVydGllcy5zZXRHYXRld2F5KEluZXRBZGRyZXNzLmdldEJ5TmFtZShpbi5yZWFkVVRGKCkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5LmVxdWFscyhETlNfS0VZKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtQcm9wZXJ0aWVzLmFkZERucyhJbmV0QWRkcmVzcy5nZXRCeU5hbWUoaW4ucmVhZFVURigpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleS5lcXVhbHMoUFJPWFlfU0VUVElOR1NfS0VZKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3h5U2V0dGluZ3MgPSBQcm94eVNldHRpbmdzLnZhbHVlT2YoaW4ucmVhZFVURigpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5LmVxdWFscyhQUk9YWV9IT1NUX0tFWSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm94eUhvc3QgPSBpbi5yZWFkVVRGKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleS5lcXVhbHMoUFJPWFlfUE9SVF9LRVkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJveHlQb3J0ID0gaW4ucmVhZEludCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkuZXF1YWxzKEVYQ0xVU0lPTl9MSVNUX0tFWSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGNsdXNpb25MaXN0ID0gaW4ucmVhZFVURigpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkuZXF1YWxzKEVPUykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiSWdub3JlIHVua25vd24ga2V5ICIgKyBrZXkgKyAid2hpbGUgcmVhZGluZyIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChVbmtub3duSG9zdEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJJZ25vcmUgaW52YWxpZCBhZGRyZXNzIHdoaWxlIHJlYWRpbmciICsgZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IHdoaWxlICh0cnVlKTsKKworICAgICAgICAgICAgICAgIGlmIChpZCAhPSAtMSkgeworICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNDb25maWd1cmVkTmV0d29ya3MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uIGNvbmZpZyA9IHNDb25maWd1cmVkTmV0d29ya3MuZ2V0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzTmV0d29ya0lkcy5nZXQoaWQpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiY29uZmlndXJhdGlvbiBmb3VuZCBmb3IgbWlzc2luZyBuZXR3b3JrLCBpZ25vcmVkIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5saW5rUHJvcGVydGllcyA9IGxpbmtQcm9wZXJ0aWVzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoaXBBc3NpZ25tZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU1RBVElDOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIERIQ1A6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuaXBBc3NpZ25tZW50ID0gaXBBc3NpZ25tZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVU5BU1NJR05FRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vSWdub3JlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIklnbm9yZSBpbnZhbGlkIGlwIGFzc2lnbm1lbnQgd2hpbGUgcmVhZGluZyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwcm94eVNldHRpbmdzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU1RBVElDOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLnByb3h5U2V0dGluZ3MgPSBwcm94eVNldHRpbmdzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUHJveHlQcm9wZXJ0aWVzIHByb3h5UHJvcGVydGllcyA9IG5ldyBQcm94eVByb3BlcnRpZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3h5UHJvcGVydGllcy5zZXRTb2NrZXRBZGRyZXNzKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgSW5ldFNvY2tldEFkZHJlc3MocHJveHlIb3N0LCBwcm94eVBvcnQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3h5UHJvcGVydGllcy5zZXRFeGNsdXNpb25MaXN0KGV4Y2x1c2lvbkxpc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua1Byb3BlcnRpZXMuc2V0SHR0cFByb3h5KHByb3h5UHJvcGVydGllcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBOT05FOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLnByb3h5U2V0dGluZ3MgPSBwcm94eVNldHRpbmdzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVU5BU1NJR05FRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vSWdub3JlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIklnbm9yZSBpbnZhbGlkIHByb3h5IHNldHRpbmdzIHdoaWxlIHJlYWRpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIk1pc3NpbmcgaWQgd2hpbGUgcGFyc2luZyBjb25maWd1cmF0aW9uIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChFT0ZFeGNlcHRpb24gaWdub3JlKSB7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIHBhcnNpbmcgY29uZmlndXJhdGlvbiIgKyBlKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChpbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgaW4uY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkge30KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGludCBhZGRPclVwZGF0ZU5ldHdvcmtOYXRpdmUoV2lmaUNvbmZpZ3VyYXRpb24gY29uZmlnKSB7CisgICAgICAgIC8qCisgICAgICAgICAqIElmIHRoZSBzdXBwbGllZCBuZXR3b3JrSWQgaXMgSU5WQUxJRF9ORVRXT1JLX0lELCB3ZSBjcmVhdGUgYSBuZXcgZW1wdHkKKyAgICAgICAgICogbmV0d29yayBjb25maWd1cmF0aW9uLiBPdGhlcndpc2UsIHRoZSBuZXR3b3JrSWQgc2hvdWxkCisgICAgICAgICAqIHJlZmVyIHRvIGFuIGV4aXN0aW5nIGNvbmZpZ3VyYXRpb24uCisgICAgICAgICAqLworICAgICAgICBpbnQgbmV0SWQgPSBjb25maWcubmV0d29ya0lkOworICAgICAgICBib29sZWFuIHVwZGF0ZUZhaWxlZCA9IHRydWU7CisgICAgICAgIGJvb2xlYW4gbmV3TmV0d29yayA9IChuZXRJZCA9PSBJTlZBTElEX05FVFdPUktfSUQpOworICAgICAgICAvLyBuZXR3b3JrSWQgb2YgSU5WQUxJRF9ORVRXT1JLX0lEIG1lYW5zIHdlIHdhbnQgdG8gY3JlYXRlIGEgbmV3IG5ldHdvcmsKKworICAgICAgICBpZiAobmV3TmV0d29yaykgeworICAgICAgICAgICAgbmV0SWQgPSBXaWZpTmF0aXZlLmFkZE5ldHdvcmtDb21tYW5kKCk7CisgICAgICAgICAgICBpZiAobmV0SWQgPCAwKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRmFpbGVkIHRvIGFkZCBhIG5ldHdvcmshIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIElOVkFMSURfTkVUV09SS19JRDsKKyAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBzZXRWYXJpYWJsZXM6IHsKKworICAgICAgICAgICAgaWYgKGNvbmZpZy5TU0lEICE9IG51bGwgJiYKKyAgICAgICAgICAgICAgICAgICAgIVdpZmlOYXRpdmUuc2V0TmV0d29ya1ZhcmlhYmxlQ29tbWFuZCgKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldElkLAorICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uc3NpZFZhck5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuU1NJRCkpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJmYWlsZWQgdG8gc2V0IFNTSUQ6ICIrY29uZmlnLlNTSUQpOworICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGNvbmZpZy5CU1NJRCAhPSBudWxsICYmCisgICAgICAgICAgICAgICAgICAgICFXaWZpTmF0aXZlLnNldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQoCisgICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLmJzc2lkVmFyTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5CU1NJRCkpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJmYWlsZWQgdG8gc2V0IEJTU0lEOiAiK2NvbmZpZy5CU1NJRCk7CisgICAgICAgICAgICAgICAgYnJlYWsgc2V0VmFyaWFibGVzOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmcgYWxsb3dlZEtleU1hbmFnZW1lbnRTdHJpbmcgPQorICAgICAgICAgICAgICAgIG1ha2VTdHJpbmcoY29uZmlnLmFsbG93ZWRLZXlNYW5hZ2VtZW50LCBXaWZpQ29uZmlndXJhdGlvbi5LZXlNZ210LnN0cmluZ3MpOworICAgICAgICAgICAgaWYgKGNvbmZpZy5hbGxvd2VkS2V5TWFuYWdlbWVudC5jYXJkaW5hbGl0eSgpICE9IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgIVdpZmlOYXRpdmUuc2V0TmV0d29ya1ZhcmlhYmxlQ29tbWFuZCgKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldElkLAorICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uS2V5TWdtdC52YXJOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgYWxsb3dlZEtleU1hbmFnZW1lbnRTdHJpbmcpKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiZmFpbGVkIHRvIHNldCBrZXlfbWdtdDogIisKKyAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWRLZXlNYW5hZ2VtZW50U3RyaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhayBzZXRWYXJpYWJsZXM7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0cmluZyBhbGxvd2VkUHJvdG9jb2xzU3RyaW5nID0KKyAgICAgICAgICAgICAgICBtYWtlU3RyaW5nKGNvbmZpZy5hbGxvd2VkUHJvdG9jb2xzLCBXaWZpQ29uZmlndXJhdGlvbi5Qcm90b2NvbC5zdHJpbmdzKTsKKyAgICAgICAgICAgIGlmIChjb25maWcuYWxsb3dlZFByb3RvY29scy5jYXJkaW5hbGl0eSgpICE9IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgIVdpZmlOYXRpdmUuc2V0TmV0d29ya1ZhcmlhYmxlQ29tbWFuZCgKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldElkLAorICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uUHJvdG9jb2wudmFyTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWRQcm90b2NvbHNTdHJpbmcpKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiZmFpbGVkIHRvIHNldCBwcm90bzogIisKKyAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWRQcm90b2NvbHNTdHJpbmcpOworICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3RyaW5nIGFsbG93ZWRBdXRoQWxnb3JpdGhtc1N0cmluZyA9CisgICAgICAgICAgICAgICAgbWFrZVN0cmluZyhjb25maWcuYWxsb3dlZEF1dGhBbGdvcml0aG1zLCBXaWZpQ29uZmlndXJhdGlvbi5BdXRoQWxnb3JpdGhtLnN0cmluZ3MpOworICAgICAgICAgICAgaWYgKGNvbmZpZy5hbGxvd2VkQXV0aEFsZ29yaXRobXMuY2FyZGluYWxpdHkoKSAhPSAwICYmCisgICAgICAgICAgICAgICAgICAgICFXaWZpTmF0aXZlLnNldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQoCisgICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLkF1dGhBbGdvcml0aG0udmFyTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWRBdXRoQWxnb3JpdGhtc1N0cmluZykpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJmYWlsZWQgdG8gc2V0IGF1dGhfYWxnOiAiKworICAgICAgICAgICAgICAgICAgICAgICAgYWxsb3dlZEF1dGhBbGdvcml0aG1zU3RyaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhayBzZXRWYXJpYWJsZXM7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0cmluZyBhbGxvd2VkUGFpcndpc2VDaXBoZXJzU3RyaW5nID0KKyAgICAgICAgICAgICAgICAgICAgbWFrZVN0cmluZyhjb25maWcuYWxsb3dlZFBhaXJ3aXNlQ2lwaGVycywKKyAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uUGFpcndpc2VDaXBoZXIuc3RyaW5ncyk7CisgICAgICAgICAgICBpZiAoY29uZmlnLmFsbG93ZWRQYWlyd2lzZUNpcGhlcnMuY2FyZGluYWxpdHkoKSAhPSAwICYmCisgICAgICAgICAgICAgICAgICAgICFXaWZpTmF0aXZlLnNldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQoCisgICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLlBhaXJ3aXNlQ2lwaGVyLnZhck5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICBhbGxvd2VkUGFpcndpc2VDaXBoZXJzU3RyaW5nKSkgeworICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImZhaWxlZCB0byBzZXQgcGFpcndpc2U6ICIrCisgICAgICAgICAgICAgICAgICAgICAgICBhbGxvd2VkUGFpcndpc2VDaXBoZXJzU3RyaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhayBzZXRWYXJpYWJsZXM7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0cmluZyBhbGxvd2VkR3JvdXBDaXBoZXJzU3RyaW5nID0KKyAgICAgICAgICAgICAgICBtYWtlU3RyaW5nKGNvbmZpZy5hbGxvd2VkR3JvdXBDaXBoZXJzLCBXaWZpQ29uZmlndXJhdGlvbi5Hcm91cENpcGhlci5zdHJpbmdzKTsKKyAgICAgICAgICAgIGlmIChjb25maWcuYWxsb3dlZEdyb3VwQ2lwaGVycy5jYXJkaW5hbGl0eSgpICE9IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgIVdpZmlOYXRpdmUuc2V0TmV0d29ya1ZhcmlhYmxlQ29tbWFuZCgKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldElkLAorICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24uR3JvdXBDaXBoZXIudmFyTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWRHcm91cENpcGhlcnNTdHJpbmcpKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiZmFpbGVkIHRvIHNldCBncm91cDogIisKKyAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWRHcm91cENpcGhlcnNTdHJpbmcpOworICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gUHJldmVudCBjbGllbnQgc2NyZXctdXAgYnkgcGFzc2luZyBpbiBhIFdpZmlDb25maWd1cmF0aW9uIHdlIGdhdmUgaXQKKyAgICAgICAgICAgIC8vIGJ5IHByZXZlbnRpbmcgIioiIGFzIGEga2V5LgorICAgICAgICAgICAgaWYgKGNvbmZpZy5wcmVTaGFyZWRLZXkgIT0gbnVsbCAmJiAhY29uZmlnLnByZVNoYXJlZEtleS5lcXVhbHMoIioiKSAmJgorICAgICAgICAgICAgICAgICAgICAhV2lmaU5hdGl2ZS5zZXROZXR3b3JrVmFyaWFibGVDb21tYW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgbmV0SWQsCisgICAgICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbi5wc2tWYXJOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLnByZVNoYXJlZEtleSkpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJmYWlsZWQgdG8gc2V0IHBzazogIitjb25maWcucHJlU2hhcmVkS2V5KTsKKyAgICAgICAgICAgICAgICBicmVhayBzZXRWYXJpYWJsZXM7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJvb2xlYW4gaGFzU2V0S2V5ID0gZmFsc2U7CisgICAgICAgICAgICBpZiAoY29uZmlnLndlcEtleXMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY29uZmlnLndlcEtleXMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gUHJldmVudCBjbGllbnQgc2NyZXctdXAgYnkgcGFzc2luZyBpbiBhIFdpZmlDb25maWd1cmF0aW9uIHdlIGdhdmUgaXQKKyAgICAgICAgICAgICAgICAgICAgLy8gYnkgcHJldmVudGluZyAiKiIgYXMgYSBrZXkuCisgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcud2VwS2V5c1tpXSAhPSBudWxsICYmICFjb25maWcud2VwS2V5c1tpXS5lcXVhbHMoIioiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFXaWZpTmF0aXZlLnNldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLndlcEtleVZhck5hbWVzW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLndlcEtleXNbaV0pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImZhaWxlZCB0byBzZXQgd2VwX2tleSIraSsiOiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy53ZXBLZXlzW2ldKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBzZXRWYXJpYWJsZXM7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBoYXNTZXRLZXkgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoaGFzU2V0S2V5KSB7CisgICAgICAgICAgICAgICAgaWYgKCFXaWZpTmF0aXZlLnNldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV0SWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24ud2VwVHhLZXlJZHhWYXJOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVnZXIudG9TdHJpbmcoY29uZmlnLndlcFR4S2V5SW5kZXgpKSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgImZhaWxlZCB0byBzZXQgd2VwX3R4X2tleWlkeDogIisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcud2VwVHhLZXlJbmRleCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICghV2lmaU5hdGl2ZS5zZXROZXR3b3JrVmFyaWFibGVDb21tYW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgbmV0SWQsCisgICAgICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbi5wcmlvcml0eVZhck5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyLnRvU3RyaW5nKGNvbmZpZy5wcmlvcml0eSkpKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCBjb25maWcuU1NJRCArICI6IGZhaWxlZCB0byBzZXQgcHJpb3JpdHk6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICtjb25maWcucHJpb3JpdHkpOworICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGNvbmZpZy5oaWRkZW5TU0lEICYmICFXaWZpTmF0aXZlLnNldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQoCisgICAgICAgICAgICAgICAgICAgICAgICBuZXRJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLmhpZGRlblNTSURWYXJOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgSW50ZWdlci50b1N0cmluZyhjb25maWcuaGlkZGVuU1NJRCA/IDEgOiAwKSkpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsIGNvbmZpZy5TU0lEICsgIjogZmFpbGVkIHRvIHNldCBoaWRkZW5TU0lEOiAiKworICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmhpZGRlblNTSUQpOworICAgICAgICAgICAgICAgIGJyZWFrIHNldFZhcmlhYmxlczsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZm9yIChXaWZpQ29uZmlndXJhdGlvbi5FbnRlcnByaXNlRmllbGQgZmllbGQKKyAgICAgICAgICAgICAgICAgICAgOiBjb25maWcuZW50ZXJwcmlzZUZpZWxkcykgeworICAgICAgICAgICAgICAgIFN0cmluZyB2YXJOYW1lID0gZmllbGQudmFyTmFtZSgpOworICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IGZpZWxkLnZhbHVlKCk7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGZpZWxkICE9IGNvbmZpZy5lYXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gKHZhbHVlLmxlbmd0aCgpID09IDApID8gIk5VTEwiIDogY29udmVydFRvUXVvdGVkU3RyaW5nKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoIVdpZmlOYXRpdmUuc2V0TmV0d29ya1ZhcmlhYmxlQ29tbWFuZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV0SWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhck5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCBjb25maWcuU1NJRCArICI6IGZhaWxlZCB0byBzZXQgIiArIHZhck5hbWUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiOiAiICsgdmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgc2V0VmFyaWFibGVzOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgdXBkYXRlRmFpbGVkID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBpZiAodXBkYXRlRmFpbGVkKSB7CisgICAgICAgICAgICBpZiAobmV3TmV0d29yaykgeworICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUucmVtb3ZlTmV0d29ya0NvbW1hbmQobmV0SWQpOworICAgICAgICAgICAgICAgIExvZy5kKFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gc2V0IGEgbmV0d29yayB2YXJpYWJsZSwgcmVtb3ZlZCBuZXR3b3JrOiAiCisgICAgICAgICAgICAgICAgICAgICAgICArIG5ldElkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBJTlZBTElEX05FVFdPUktfSUQ7CisgICAgICAgIH0KKworICAgICAgICAvKiBBbiB1cGRhdGUgb2YgdGhlIG5ldHdvcmsgdmFyaWFibGVzIHJlcXVpcmVzIHJlYWRpbmcgdGhlbQorICAgICAgICAgKiBiYWNrIGZyb20gdGhlIHN1cHBsaWNhbnQgdG8gdXBkYXRlIHNDb25maWd1cmVkTmV0d29ya3MuCisgICAgICAgICAqIFRoaXMgaXMgYmVjYXVzZSBzb21lIG9mIHRoZSB2YXJpYWJsZXMgKFNTSUQsIHdlcCBrZXlzICYKKyAgICAgICAgICogcGFzc3BocmFzZXMpIHJlZmxlY3QgZGlmZmVyZW50IHZhbHVlcyB3aGVuIHJlYWQgYmFjayB0aGFuCisgICAgICAgICAqIHdoZW4gd3JpdHRlbi4gRm9yIGV4YW1wbGUsIHdlcCBrZXkgaXMgc3RvcmVkIGFzICogaXJyZXNwZWN0aXZlCisgICAgICAgICAqIG9mIHRoZSB2YWx1ZSBzZW50IHRvIHRoZSBzdXBwbGljYW50CisgICAgICAgICAqLworICAgICAgICBXaWZpQ29uZmlndXJhdGlvbiBzQ29uZmlnOworICAgICAgICBzeW5jaHJvbml6ZWQgKHNDb25maWd1cmVkTmV0d29ya3MpIHsKKyAgICAgICAgICAgIHNDb25maWcgPSBzQ29uZmlndXJlZE5ldHdvcmtzLmdldChuZXRJZCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHNDb25maWcgPT0gbnVsbCkgeworICAgICAgICAgICAgc0NvbmZpZyA9IG5ldyBXaWZpQ29uZmlndXJhdGlvbigpOworICAgICAgICAgICAgc0NvbmZpZy5uZXR3b3JrSWQgPSBuZXRJZDsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc0NvbmZpZ3VyZWROZXR3b3JrcykgeworICAgICAgICAgICAgICAgIHNDb25maWd1cmVkTmV0d29ya3MucHV0KG5ldElkLCBzQ29uZmlnKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZWFkTmV0d29ya1ZhcmlhYmxlcyhzQ29uZmlnKTsKKyAgICAgICAgd3JpdGVJcEFuZFByb3h5Q29uZmlndXJhdGlvbnNPbkNoYW5nZShzQ29uZmlnLCBjb25maWcpOworICAgICAgICByZXR1cm4gbmV0SWQ7CisgICAgfQorCisgICAgLyogQ29tcGFyZSBjdXJyZW50IGFuZCBuZXcgY29uZmlndXJhdGlvbiBhbmQgd3JpdGUgdG8gZmlsZSBvbiBjaGFuZ2UgKi8KKyAgICBwcml2YXRlIHN0YXRpYyB2b2lkIHdyaXRlSXBBbmRQcm94eUNvbmZpZ3VyYXRpb25zT25DaGFuZ2UoV2lmaUNvbmZpZ3VyYXRpb24gY3VycmVudENvbmZpZywKKyAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uIG5ld0NvbmZpZykgeworICAgICAgICBib29sZWFuIGlwQ2hhbmdlZCA9IGZhbHNlOworICAgICAgICBib29sZWFuIHByb3h5Q2hhbmdlZCA9IGZhbHNlOworICAgICAgICBMaW5rUHJvcGVydGllcyBsaW5rUHJvcGVydGllcyA9IG5ldyBMaW5rUHJvcGVydGllcygpOworCisgICAgICAgIHN3aXRjaCAobmV3Q29uZmlnLmlwQXNzaWdubWVudCkgeworICAgICAgICAgICAgY2FzZSBTVEFUSUM6CisgICAgICAgICAgICAgICAgQ29sbGVjdGlvbjxMaW5rQWRkcmVzcz4gY3VycmVudExpbmtBZGRyZXNzZXMgPSBjdXJyZW50Q29uZmlnLmxpbmtQcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0TGlua0FkZHJlc3NlcygpOworICAgICAgICAgICAgICAgIENvbGxlY3Rpb248TGlua0FkZHJlc3M+IG5ld0xpbmtBZGRyZXNzZXMgPSBuZXdDb25maWcubGlua1Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRMaW5rQWRkcmVzc2VzKCk7CisgICAgICAgICAgICAgICAgQ29sbGVjdGlvbjxJbmV0QWRkcmVzcz4gY3VycmVudERuc2VzID0gY3VycmVudENvbmZpZy5saW5rUHJvcGVydGllcy5nZXREbnNlcygpOworICAgICAgICAgICAgICAgIENvbGxlY3Rpb248SW5ldEFkZHJlc3M+IG5ld0Ruc2VzID0gbmV3Q29uZmlnLmxpbmtQcm9wZXJ0aWVzLmdldERuc2VzKCk7CisgICAgICAgICAgICAgICAgSW5ldEFkZHJlc3MgY3VycmVudEdhdGV3YXkgPSBjdXJyZW50Q29uZmlnLmxpbmtQcm9wZXJ0aWVzLmdldEdhdGV3YXkoKTsKKyAgICAgICAgICAgICAgICBJbmV0QWRkcmVzcyBuZXdHYXRld2F5ID0gbmV3Q29uZmlnLmxpbmtQcm9wZXJ0aWVzLmdldEdhdGV3YXkoKTsKKworICAgICAgICAgICAgICAgIGJvb2xlYW4gbGlua0FkZHJlc3Nlc0RpZmZlciA9ICFjdXJyZW50TGlua0FkZHJlc3Nlcy5jb250YWluc0FsbChuZXdMaW5rQWRkcmVzc2VzKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgKGN1cnJlbnRMaW5rQWRkcmVzc2VzLnNpemUoKSAhPSBuZXdMaW5rQWRkcmVzc2VzLnNpemUoKSk7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBkbnNlc0RpZmZlciA9ICFjdXJyZW50RG5zZXMuY29udGFpbnNBbGwobmV3RG5zZXMpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAoY3VycmVudERuc2VzLnNpemUoKSAhPSBuZXdEbnNlcy5zaXplKCkpOworICAgICAgICAgICAgICAgIGJvb2xlYW4gZ2F0ZXdheXNEaWZmZXIgPSAoY3VycmVudEdhdGV3YXkgPT0gbnVsbCkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICFjdXJyZW50R2F0ZXdheS5lcXVhbHMobmV3R2F0ZXdheSk7CisKKyAgICAgICAgICAgICAgICBpZiAoKGN1cnJlbnRDb25maWcuaXBBc3NpZ25tZW50ICE9IG5ld0NvbmZpZy5pcEFzc2lnbm1lbnQpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5rQWRkcmVzc2VzRGlmZmVyIHx8CisgICAgICAgICAgICAgICAgICAgICAgICBkbnNlc0RpZmZlciB8fAorICAgICAgICAgICAgICAgICAgICAgICAgZ2F0ZXdheXNEaWZmZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgaXBDaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIERIQ1A6CisgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRDb25maWcuaXBBc3NpZ25tZW50ICE9IG5ld0NvbmZpZy5pcEFzc2lnbm1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgaXBDaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFVOQVNTSUdORUQ6CisgICAgICAgICAgICAgICAgLyogSWdub3JlICovCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIklnbm9yZSBpbnZhbGlkIGlwIGFzc2lnbm1lbnQgZHVyaW5nIHdyaXRlIik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBzd2l0Y2ggKG5ld0NvbmZpZy5wcm94eVNldHRpbmdzKSB7CisgICAgICAgICAgICBjYXNlIFNUQVRJQzoKKyAgICAgICAgICAgICAgICBJbmV0U29ja2V0QWRkcmVzcyBuZXdTb2NrQWRkciA9IG51bGw7CisgICAgICAgICAgICAgICAgU3RyaW5nIG5ld0V4Y2x1c2lvbkxpc3QgPSBudWxsOworICAgICAgICAgICAgICAgIEluZXRTb2NrZXRBZGRyZXNzIGN1cnJlbnRTb2NrQWRkciA9IG51bGw7CisgICAgICAgICAgICAgICAgU3RyaW5nIGN1cnJlbnRFeGNsdXNpb25MaXN0ID0gbnVsbDsKKworICAgICAgICAgICAgICAgIFByb3h5UHJvcGVydGllcyBuZXdIdHRwUHJveHkgPSBuZXdDb25maWcubGlua1Byb3BlcnRpZXMuZ2V0SHR0cFByb3h5KCk7CisgICAgICAgICAgICAgICAgaWYgKG5ld0h0dHBQcm94eSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG5ld1NvY2tBZGRyID0gbmV3SHR0cFByb3h5LmdldFNvY2tldEFkZHJlc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgbmV3RXhjbHVzaW9uTGlzdCA9IG5ld0h0dHBQcm94eS5nZXRFeGNsdXNpb25MaXN0KCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgUHJveHlQcm9wZXJ0aWVzIGN1cnJlbnRIdHRwUHJveHkgPSBjdXJyZW50Q29uZmlnLmxpbmtQcm9wZXJ0aWVzLmdldEh0dHBQcm94eSgpOworICAgICAgICAgICAgICAgIGlmIChjdXJyZW50SHR0cFByb3h5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudFNvY2tBZGRyID0gIGN1cnJlbnRIdHRwUHJveHkuZ2V0U29ja2V0QWRkcmVzcygpOworICAgICAgICAgICAgICAgICAgICBjdXJyZW50RXhjbHVzaW9uTGlzdCA9IGN1cnJlbnRIdHRwUHJveHkuZ2V0RXhjbHVzaW9uTGlzdCgpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGJvb2xlYW4gc29ja2V0QWRkcmVzc0RpZmZlcnMgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBib29sZWFuIGV4Y2x1c2lvbkxpc3REaWZmZXJzID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICBpZiAobmV3U29ja0FkZHIgIT0gbnVsbCAmJiBjdXJyZW50U29ja0FkZHIgIT0gbnVsbCApIHsKKyAgICAgICAgICAgICAgICAgICAgc29ja2V0QWRkcmVzc0RpZmZlcnMgPSAhY3VycmVudFNvY2tBZGRyLmVxdWFscyhuZXdTb2NrQWRkcik7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuZXdTb2NrQWRkciAhPSBudWxsIHx8IGN1cnJlbnRTb2NrQWRkciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHNvY2tldEFkZHJlc3NEaWZmZXJzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAobmV3RXhjbHVzaW9uTGlzdCAhPSBudWxsICYmIGN1cnJlbnRFeGNsdXNpb25MaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZXhjbHVzaW9uTGlzdERpZmZlcnMgPSAhY3VycmVudEV4Y2x1c2lvbkxpc3QuZXF1YWxzKG5ld0V4Y2x1c2lvbkxpc3QpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmV3RXhjbHVzaW9uTGlzdCAhPSBudWxsIHx8IGN1cnJlbnRFeGNsdXNpb25MaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZXhjbHVzaW9uTGlzdERpZmZlcnMgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICgoY3VycmVudENvbmZpZy5wcm94eVNldHRpbmdzICE9IG5ld0NvbmZpZy5wcm94eVNldHRpbmdzKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0QWRkcmVzc0RpZmZlcnMgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIGV4Y2x1c2lvbkxpc3REaWZmZXJzKSB7CisgICAgICAgICAgICAgICAgICAgIHByb3h5Q2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBOT05FOgorICAgICAgICAgICAgICAgIGlmIChjdXJyZW50Q29uZmlnLnByb3h5U2V0dGluZ3MgIT0gbmV3Q29uZmlnLnByb3h5U2V0dGluZ3MpIHsKKyAgICAgICAgICAgICAgICAgICAgcHJveHlDaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFVOQVNTSUdORUQ6CisgICAgICAgICAgICAgICAgLyogSWdub3JlICovCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIklnbm9yZSBpbnZhbGlkIHByb3h5IGNvbmZpZ3VyYXRpb24gZHVyaW5nIHdyaXRlIik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIWlwQ2hhbmdlZCkgeworICAgICAgICAgICAgYWRkSXBTZXR0aW5nc0Zyb21Db25maWcobGlua1Byb3BlcnRpZXMsIGN1cnJlbnRDb25maWcpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgY3VycmVudENvbmZpZy5pcEFzc2lnbm1lbnQgPSBuZXdDb25maWcuaXBBc3NpZ25tZW50OworICAgICAgICAgICAgYWRkSXBTZXR0aW5nc0Zyb21Db25maWcobGlua1Byb3BlcnRpZXMsIG5ld0NvbmZpZyk7CisgICAgICAgICAgICBMb2cuZChUQUcsICJJUCBjb25maWcgY2hhbmdlZCBTU0lEID0gIiArIGN1cnJlbnRDb25maWcuU1NJRCArICIgbGlua1Byb3BlcnRpZXM6ICIgKworICAgICAgICAgICAgICAgICAgICBsaW5rUHJvcGVydGllcy50b1N0cmluZygpKTsKKyAgICAgICAgfQorCisKKyAgICAgICAgaWYgKCFwcm94eUNoYW5nZWQpIHsKKyAgICAgICAgICAgIGxpbmtQcm9wZXJ0aWVzLnNldEh0dHBQcm94eShjdXJyZW50Q29uZmlnLmxpbmtQcm9wZXJ0aWVzLmdldEh0dHBQcm94eSgpKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGN1cnJlbnRDb25maWcucHJveHlTZXR0aW5ncyA9IG5ld0NvbmZpZy5wcm94eVNldHRpbmdzOworICAgICAgICAgICAgbGlua1Byb3BlcnRpZXMuc2V0SHR0cFByb3h5KG5ld0NvbmZpZy5saW5rUHJvcGVydGllcy5nZXRIdHRwUHJveHkoKSk7CisgICAgICAgICAgICBMb2cuZChUQUcsICJwcm94eSBjaGFuZ2VkIFNTSUQgPSAiICsgY3VycmVudENvbmZpZy5TU0lEKTsKKyAgICAgICAgICAgIGlmIChsaW5rUHJvcGVydGllcy5nZXRIdHRwUHJveHkoKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiIHByb3h5UHJvcGVydGllczogIiArIGxpbmtQcm9wZXJ0aWVzLmdldEh0dHBQcm94eSgpLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKGlwQ2hhbmdlZCB8fCBwcm94eUNoYW5nZWQpIHsKKyAgICAgICAgICAgIGN1cnJlbnRDb25maWcubGlua1Byb3BlcnRpZXMgPSBsaW5rUHJvcGVydGllczsKKyAgICAgICAgICAgIHdyaXRlSXBBbmRQcm94eUNvbmZpZ3VyYXRpb25zKCk7CisgICAgICAgICAgICBzZW5kQ29uZmlnQ2hhbmdlQnJvYWRjYXN0KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGFkZElwU2V0dGluZ3NGcm9tQ29uZmlnKExpbmtQcm9wZXJ0aWVzIGxpbmtQcm9wZXJ0aWVzLAorICAgICAgICAgICAgV2lmaUNvbmZpZ3VyYXRpb24gY29uZmlnKSB7CisgICAgICAgIGZvciAoTGlua0FkZHJlc3MgbGlua0FkZHIgOiBjb25maWcubGlua1Byb3BlcnR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gICAqIGJlIGRvaW5nIGEgcm91bmQgdHJpcCB0byB0aGUgc3VwcGxpY2FudCBkYWVtb24gZm9yIGVhY2ggdmFyaWFibGUuCisgICAgICAgICAqLworICAgICAgICBTdHJpbmcgdmFsdWU7CisKKyAgICAgICAgdmFsdWUgPSBXaWZpTmF0aXZlLmdldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQobmV0SWQsIFdpZmlDb25maWd1cmF0aW9uLnNzaWRWYXJOYW1lKTsKKyAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZSkpIHsKKyAgICAgICAgICAgIGNvbmZpZy5TU0lEID0gcmVtb3ZlRG91YmxlUXVvdGVzKHZhbHVlKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNvbmZpZy5TU0lEID0gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIHZhbHVlID0gV2lmaU5hdGl2ZS5nZXROZXR3b3JrVmFyaWFibGVDb21tYW5kKG5ldElkLCBXaWZpQ29uZmlndXJhdGlvbi5ic3NpZFZhck5hbWUpOworICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgeworICAgICAgICAgICAgY29uZmlnLkJTU0lEID0gdmFsdWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBjb25maWcuQlNTSUQgPSBudWxsOworICAgICAgICB9CisKKyAgICAgICAgdmFsdWUgPSBXaWZpTmF0aXZlLmdldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQobmV0SWQsIFdpZmlDb25maWd1cmF0aW9uLnByaW9yaXR5VmFyTmFtZSk7CisgICAgICAgIGNvbmZpZy5wcmlvcml0eSA9IC0xOworICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBjb25maWcucHJpb3JpdHkgPSBJbnRlZ2VyLnBhcnNlSW50KHZhbHVlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBpZ25vcmUpIHsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHZhbHVlID0gV2lmaU5hdGl2ZS5nZXROZXR3b3JrVmFyaWFibGVDb21tYW5kKG5ldElkLCBXaWZpQ29uZmlndXJhdGlvbi5oaWRkZW5TU0lEVmFyTmFtZSk7CisgICAgICAgIGNvbmZpZy5oaWRkZW5TU0lEID0gZmFsc2U7CisgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGNvbmZpZy5oaWRkZW5TU0lEID0gSW50ZWdlci5wYXJzZUludCh2YWx1ZSkgIT0gMDsKKyAgICAgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBpZ25vcmUpIHsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHZhbHVlID0gV2lmaU5hdGl2ZS5nZXROZXR3b3JrVmFyaWFibGVDb21tYW5kKG5ldElkLCBXaWZpQ29uZmlndXJhdGlvbi53ZXBUeEtleUlkeFZhck5hbWUpOworICAgICAgICBjb25maWcud2VwVHhLZXlJbmRleCA9IC0xOworICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBjb25maWcud2VwVHhLZXlJbmRleCA9IEludGVnZXIucGFyc2VJbnQodmFsdWUpOworICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGlnbm9yZSkgeworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCA0OyBpKyspIHsKKyAgICAgICAgICAgIHZhbHVlID0gV2lmaU5hdGl2ZS5nZXROZXR3b3JrVmFyaWFibGVDb21tYW5kKG5ldElkLAorICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbi53ZXBLZXlWYXJOYW1lc1tpXSk7CisgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgeworICAgICAgICAgICAgICAgIGNvbmZpZy53ZXBLZXlzW2ldID0gdmFsdWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGNvbmZpZy53ZXBLZXlzW2ldID0gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHZhbHVlID0gV2lmaU5hdGl2ZS5nZXROZXR3b3JrVmFyaWFibGVDb21tYW5kKG5ldElkLCBXaWZpQ29uZmlndXJhdGlvbi5wc2tWYXJOYW1lKTsKKyAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZSkpIHsKKyAgICAgICAgICAgIGNvbmZpZy5wcmVTaGFyZWRLZXkgPSB2YWx1ZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNvbmZpZy5wcmVTaGFyZWRLZXkgPSBudWxsOworICAgICAgICB9CisKKyAgICAgICAgdmFsdWUgPSBXaWZpTmF0aXZlLmdldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQoY29uZmlnLm5ldHdvcmtJZCwKKyAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbi5Qcm90b2NvbC52YXJOYW1lKTsKKyAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZSkpIHsKKyAgICAgICAgICAgIFN0cmluZyB2YWxzW10gPSB2YWx1ZS5zcGxpdCgiICIpOworICAgICAgICAgICAgZm9yIChTdHJpbmcgdmFsIDogdmFscykgeworICAgICAgICAgICAgICAgIGludCBpbmRleCA9CisgICAgICAgICAgICAgICAgICAgIGxvb2t1cFN0cmluZyh2YWwsIFdpZmlDb25maWd1cmF0aW9uLlByb3RvY29sLnN0cmluZ3MpOworICAgICAgICAgICAgICAgIGlmICgwIDw9IGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5hbGxvd2VkUHJvdG9jb2xzLnNldChpbmRleCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgdmFsdWUgPSBXaWZpTmF0aXZlLmdldE5ldHdvcmtWYXJpYWJsZUNvbW1hbmQoY29uZmlnLm5ldHdvcmtJZCwKKyAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbi5LZXlNZ210LnZhck5hbWUpOworICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgeworICAgICAgICAgICAgU3RyaW5nIHZhbHNbXSA9IHZhbHVlLnNwbGl0KCIgIik7CisgICAgICAgICAgICBmb3IgKFN0cmluZyB2YWwgOiB2YWxzKSB7CisgICAgICAgICAgICAgICAgaW50IGluZGV4ID0KKyAgICAgICAgICAgICAgICAgICAgbG9va3VwU3RyaW5nKHZhbCwgV2lmaUNvbmZpZ3VyYXRpb24uS2V5TWdtdC5zdHJpbmdzKTsKKyAgICAgICAgICAgICAgICBpZiAoMCA8PSBpbmRleCkgeworICAgICAgICAgICAgICAgICAgICBjb25maWcuYWxsb3dlZEtleU1hbmFnZW1lbnQuc2V0KGluZGV4KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICB2YWx1ZSA9IFdpZmlOYXRpdmUuZ2V0TmV0d29ya1ZhcmlhYmxlQ29tbWFuZChjb25maWcubmV0d29ya0lkLAorICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLkF1dGhBbGdvcml0aG0udmFyTmFtZSk7CisgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7CisgICAgICAgICAgICBTdHJpbmcgdmFsc1tdID0gdmFsdWUuc3BsaXQoIiAiKTsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIHZhbCA6IHZhbHMpIHsKKyAgICAgICAgICAgICAgICBpbnQgaW5kZXggPQorICAgICAgICAgICAgICAgICAgICBsb29rdXBTdHJpbmcodmFsLCBXaWZpQ29uZmlndXJhdGlvbi5BdXRoQWxnb3JpdGhtLnN0cmluZ3MpOworICAgICAgICAgICAgICAgIGlmICgwIDw9IGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5hbGxvd2VkQXV0aEFsZ29yaXRobXMuc2V0KGluZGV4KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICB2YWx1ZSA9IFdpZmlOYXRpdmUuZ2V0TmV0d29ya1ZhcmlhYmxlQ29tbWFuZChjb25maWcubmV0d29ya0lkLAorICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLlBhaXJ3aXNlQ2lwaGVyLnZhck5hbWUpOworICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgeworICAgICAgICAgICAgU3RyaW5nIHZhbHNbXSA9IHZhbHVlLnNwbGl0KCIgIik7CisgICAgICAgICAgICBmb3IgKFN0cmluZyB2YWwgOiB2YWxzKSB7CisgICAgICAgICAgICAgICAgaW50IGluZGV4ID0KKyAgICAgICAgICAgICAgICAgICAgbG9va3VwU3RyaW5nKHZhbCwgV2lmaUNvbmZpZ3VyYXRpb24uUGFpcndpc2VDaXBoZXIuc3RyaW5ncyk7CisgICAgICAgICAgICAgICAgaWYgKDAgPD0gaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgY29uZmlnLmFsbG93ZWRQYWlyd2lzZUNpcGhlcnMuc2V0KGluZGV4KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICB2YWx1ZSA9IFdpZmlOYXRpdmUuZ2V0TmV0d29ya1ZhcmlhYmxlQ29tbWFuZChjb25maWcubmV0d29ya0lkLAorICAgICAgICAgICAgICAgIFdpZmlDb25maWd1cmF0aW9uLkdyb3VwQ2lwaGVyLnZhck5hbWUpOworICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHZhbHVlKSkgeworICAgICAgICAgICAgU3RyaW5nIHZhbHNbXSA9IHZhbHVlLnNwbGl0KCIgIik7CisgICAgICAgICAgICBmb3IgKFN0cmluZyB2YWwgOiB2YWxzKSB7CisgICAgICAgICAgICAgICAgaW50IGluZGV4ID0KKyAgICAgICAgICAgICAgICAgICAgbG9va3VwU3RyaW5nKHZhbCwgV2lmaUNvbmZpZ3VyYXRpb24uR3JvdXBDaXBoZXIuc3RyaW5ncyk7CisgICAgICAgICAgICAgICAgaWYgKDAgPD0gaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgY29uZmlnLmFsbG93ZWRHcm91cENpcGhlcnMuc2V0KGluZGV4KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmb3IgKFdpZmlDb25maWd1cmF0aW9uLkVudGVycHJpc2VGaWVsZCBmaWVsZCA6CisgICAgICAgICAgICAgICAgY29uZmlnLmVudGVycHJpc2VGaWVsZHMpIHsKKyAgICAgICAgICAgIHZhbHVlID0gV2lmaU5hdGl2ZS5nZXROZXR3b3JrVmFyaWFibGVDb21tYW5kKG5ldElkLAorICAgICAgICAgICAgICAgICAgICBmaWVsZC52YXJOYW1lKCkpOworICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZSkpIHsKKyAgICAgICAgICAgICAgICBpZiAoZmllbGQgIT0gY29uZmlnLmVhcCkgdmFsdWUgPSByZW1vdmVEb3VibGVRdW90ZXModmFsdWUpOworICAgICAgICAgICAgICAgIGZpZWxkLnNldFZhbHVlKHZhbHVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIFN0cmluZyByZW1vdmVEb3VibGVR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QgKyBLZXlNZ210LnN0cmluZ3NbS2V5TWdtdC5XUEFfUFNLXTsKKyAgICAgICAgfSBlbHNlIGlmIChjb25maWcuYWxsb3dlZEtleU1hbmFnZW1lbnQuZ2V0KEtleU1nbXQuV1BBX0VBUCkgfHwKKyAgICAgICAgICAgICAgICBjb25maWcuYWxsb3dlZEtleU1hbmFnZW1lbnQuZ2V0KEtleU1nbXQuSUVFRTgwMjFYKSkgeworICAgICAgICAgICAga2V5ID0gY29uZmlnLlNTSUQgKyBLZXlNZ210LnN0cmluZ3NbS2V5TWdtdC5XUEFfRUFQXTsKKyAgICAgICAgfSBlbHNlIGlmIChjb25maWcud2VwS2V5c1swXSAhPSBudWxsKSB7CisgICAgICAgICAgICBrZXkgPSBjb25maWcuU1NJRCArICJXRVAiOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAga2V5ID0gY29uZmlnLlNTSUQgKyBLZXlNZ210LnN0cmluZ3NbS2V5TWdtdC5OT05FXTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBrZXkuaGFzaENvZGUoKTsKKyAgICB9CisKKyAgICBzdGF0aWMgU3RyaW5nIGR1bXAoKSB7CisgICAgICAgIFN0cmluZ0J1ZmZlciBzYiA9IG5ldyBTdHJpbmdCdWZmZXIoKTsKKyAgICAgICAgU3RyaW5nIExTID0gU3lzdGVtLmdldFByb3BlcnR5KCJsaW5lLnNlcGFyYXRvciIpOworICAgICAgICBzYi5hcHBlbmQoInNMYXN0UHJpb3JpdHkgIikuYXBwZW5kKHNMYXN0UHJpb3JpdHkpLmFwcGVuZChMUyk7CisgICAgICAgIHNiLmFwcGVuZCgiQ29uZmlndXJlZCBuZXR3b3JrcyAiKS5hcHBlbmQoTFMpOworICAgICAgICBmb3IgKFdpZmlDb25maWd1cmF0aW9uIGNvbmYgOiBnZXRDb25maWd1cmVkTmV0d29ya3MoKSkgeworICAgICAgICAgICAgc2IuYXBwZW5kKGNvbmYpLmFwcGVuZChMUyk7CisgICAgICAgIH0K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aWNhbGx5IGNvbmZpZ3VyZWQgSVAgc2V0dGluZ3MuIENvbmZpZ3VyYXRpb24gY2FuIGJlIGFjY2Vzc2VkCisgICAgICAgICAqIHdpdGggbGlua1Byb3BlcnRpZXMgKi8KKyAgICAgICAgU1RBVElDLAorICAgICAgICAvKiBVc2UgZHluYW1pY2FsbHkgY29uZmlndXJlZCBJUCBzZXR0aWducyAqLworICAgICAgICBESENQLAorICAgICAgICAvKiBubyBJUCBkZXRhaWxzIGFyZSBhc3NpZ25lZCwgdGhpcyBpcyB1c2VkIHRvIGluZGljYXRlCisgICAgICAgICAqIHRoYXQgYW55IGV4aXN0aW5nIElQIHNldHRpbmdzIHNob3VsZCBiZSByZXRhaW5lZCAqLworICAgICAgICBVTkFTU0lHTkVECisgICAgfQorICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIElwQXNzaWdubWVudCBpcEFzc2lnbm1lbnQ7CisKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBlbnVtIFByb3h5U2V0dGluZ3MgeworICAgICAgICAvKiBObyBwcm94eSBpcyB0byBiZSB1c2VkLiBBbnkgZXhpc3RpbmcgcHJveHkgc2V0dGluZ3MKKyAgICAgICAgICogc2hvdWxkIGJlIGNsZWFyZWQuICovCisgICAgICAgIE5PTkUsCisgICAgICAgIC8qIFVzZSBzdGF0aWNhbGx5IGNvbmZpZ3VyZWQgcHJveHkuIENvbmZpZ3VyYXRpb24gY2FuIGJlIGFjY2Vzc2VkCisgICAgICAgICAqIHdpdGggbGlua1Byb3BlcnRpZXMgKi8KKyAgICAgICAgU1RBVElDLAorICAgICAgICAvKiBubyBwcm94eSBkZXRhaWxzIGFyZSBhc3NpZ25lZCwgdGhpcyBpcyB1c2VkIHRvIGluZGljYXRlCisgICAgICAgICAqIHRoYXQgYW55IGV4aXN0aW5nIHByb3h5IHNldHRpbmdzIHNob3VsZCBiZSByZXRhaW5lZCAqLworICAgICAgICBVTkFTU0lHTkVECisgICAgfQorICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIFByb3h5U2V0dGluZ3MgcHJveHlTZXR0aW5nczsKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBMaW5rUHJvcGVydGllcyBsaW5rUHJvcGVydGllczsKIAogICAgIHB1YmxpYyBXaWZpQ29uZmlndXJhdGlvbigpIHsKLSAgICAgICAgbmV0d29ya0lkID0gLTE7CisgICAgICAgIG5ldHdvcmtJZCA9IElOVkFMSURfTkVUV09SS19JRDsKICAgICAgICAgU1NJRCA9IG51bGw7CiAgICAgICAgIEJTU0lEID0gbnVsbDsKICAgICAgICAgcHJpb3JpdHkgPSAwOwpAQCAtMzEyLDYgKzM1NSw5IEBACiAgICAgICAgIGZvciAoRW50ZXJwcmlzZUZpZWxkIGZpZWxkIDogZW50ZXJwcmlzZUZpZWxkcykgewogICAgICAgICAgICAgZmllbGQuc2V0VmFsdWUobnVsbCk7CiAgICAgICAgIH0KKyAgICAgICAgaXBBc3NpZ25tZW50ID0gSXBBc3NpZ25tZW50LlVOQVNTSUdORUQ7CisgICAgICAgIHByb3h5U2V0dGluZ3MgPSBQcm94eVNldHRpbmdzLlVOQVNTSUdORUQ7CisgICAgICAgIGxpbmtQcm9wZXJ0aWVzID0gbmV3IExpbmtQcm9wZXJ0aWVzKCk7CiAgICAgfQogCiAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKQEAgLTM5Myw2ICs0MzksMTMgQEAKICAgICAgICAgICAgIGlmICh2YWx1ZSAhPSBudWxsKSBzYnVmLmFwcGVuZCh2YWx1ZSk7CiAgICAgICAgIH0KICAgICAgICAgc2J1Zi5hcHBlbmQoJ1xuJyk7CisgICAgICAgIHNidWYuYXBwZW5kKCJJUCBhc3NpZ25tZW50OiAiICsgaXBBc3NpZ25tZW50LnRvU3RyaW5nKCkpOworICAgICAgICBzYnVmLmFwcGVuZCgiXG4iKTsKKyAgICAgICAgc2J1Zi5hcHBlbmQoIlByb3h5IHNldHRpbmdzOiAiICsgcHJveHlTZXR0aW5ncy50b1N0cmluZygpKTsKKyAgICAgICAgc2J1Zi5hcHBlbmQoIlxuIik7CisgICAgICAgIHNidWYuYXBwZW5kKGxpbmtQcm9wZXJ0aWVzLnRvU3RyaW5nKCkpOworICAgICAgICBzYnVmLmFwcGVuZCgiXG4iKTsKKwogICAgICAgICByZXR1cm4gc2J1Zi50b1N0cmluZygpOwogICAgIH0KIApAQCAtNDMyLDYgKzQ4NSwzNyBAQAogICAgICAgICByZXR1cm4gMDsKICAgICB9CiAKKyAgICAvKiogY29weSBjb25zdHJ1Y3RvciB7QGhpZGV9ICovCisgICAgcHVibGljIFdpZmlDb25maWd1cmF0aW9uKFdpZmlDb25maWd1cmF0aW9uIHNvdXJjZSkgeworICAgICAgICBpZiAoc291cmNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIG5ldHdvcmtJZCA9IHNvdXJjZS5uZXR3b3JrSWQ7CisgICAgICAgICAgICBzdGF0dXMgPSBzb3VyY2Uuc3RhdHVzOworICAgICAgICAgICAgU1NJRCA9IHNvdXJjZS5TU0lEOworICAgICAgICAgICAgQlNTSUQgPSBzb3VyY2UuQlNTSUQ7CisgICAgICAgICAgICBwcmVTaGFyZWRLZXkgPSBzb3VyY2UucHJlU2hhcmVkS2V5OworCisgICAgICAgICAgICB3ZXBLZXlzID0gbmV3IFN0cmluZ1s0XTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgd2VwS2V5cy5sZW5ndGg7IGkrKykKKyAgICAgICAgICAgICAgICB3ZXBLZXlzW2ldID0gc291cmNlLndlcEtleXNbaV07CisKKyAgICAgICAgICAgIHdlcFR4S2V5SW5kZXggPSBzb3VyY2Uud2VwVHhLZXlJbmRleDsKKyAgICAgICAgICAgIHByaW9yaXR5ID0gc291cmNlLnByaW9yaXR5OworICAgICAgICAgICAgaGlkZGVuU1NJRCA9IHNvdXJjZS5oaWRkZW5TU0lEOworICAgICAgICAgICAgYWxsb3dlZEtleU1hbmFnZW1lbnQgICA9IChCaXRTZXQpIHNvdXJjZS5hbGxvd2VkS2V5TWFuYWdlbWVudC5jbG9uZSgpOworICAgICAgICAgICAgYWxsb3dlZFByb3RvY29scyAgICAgICA9IChCaXRTZXQpIHNvdXJjZS5hbGxvd2VkUHJvdG9jb2xzLmNsb25lKCk7CisgICAgICAgICAgICBhbGxvd2VkQXV0aEFsZ29yaXRobXMgID0gKEJpdFNldCkgc291cmNlLmFsbG93ZWRBdXRoQWxnb3JpdGhtcy5jbG9uZSgpOworICAgICAgICAgICAgYWxsb3dlZFBhaXJ3aXNlQ2lwaGVycyA9IChCaXRTZXQpIHNvdXJjZS5hbGxvd2VkUGFpcndpc2VDaXBoZXJzLmNsb25lKCk7CisgICAgICAgICAgICBhbGxvd2VkR3JvdXBDaXBoZXJzICAgID0gKEJpdFNldCkgc291cmNlLmFsbG93ZWRHcm91cENpcGhlcnMuY2xvbmUoKTsKKworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzb3VyY2UuZW50ZXJwcmlzZUZpZWxkcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIGVudGVycHJpc2VGaWVsZHNbaV0uc2V0VmFsdWUoc291cmNlLmVudGVycHJpc2VGaWVsZHNbaV0udmFsdWUoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpcEFzc2lnbm1lbnQgPSBzb3VyY2UuaXBBc3NpZ25tZW50OworICAgICAgICAgICAgcHJveHlTZXR0aW5ncyA9IHNvdXJjZS5wcm94eVNldHRpbmdzOworICAgICAgICAgICAgbGlua1Byb3BlcnRpZXMgPSBuZXcgTGlua1Byb3BlcnRpZXMoc291cmNlLmxpbmtQcm9wZXJ0aWVzKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIC8qKiBJbXBsZW1lbnQgdGhlIFBhcmNlbGFibGUgaW50ZXJmYWNlIHtAaGlkZX0gKi8KICAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhcmNlbCBkZXN0LCBpbnQgZmxhZ3MpIHsKICAgICAgICAgZGVzdC53cml0ZUludChuZXR3b3JrSWQpOwpAQCAtNDU0LDYgKzUzOCw5IEBACiAgICAgICAgIGZvciAoRW50ZXJwcmlzZUZpZWxkIGZpZWxkIDogZW50ZXJwcmlzZUZpZWxkcykgewogICAgICAgICAgICAgZGVzdC53cml0ZVN0cmluZyhmaWVsZC52YWx1ZSgpKTsKICAgICAgICAgfQorICAgICAgICBkZXN0LndyaXRlU3RyaW5nKGlwQXNzaWdubWVudC5uYW1lKCkpOworICAgICAgICBkZXN0LndyaXRlU3RyaW5nKHByb3h5U2V0dGluZ3MubmFtZSgpKTsKKyAgICAgICAgZGVzdC53cml0ZVBhcmNlbGFibGUobGlua1Byb3BlcnRpZXMsIGZsYWdzKTsKICAgICB9CiAKICAgICAvKiogSW1wbGVtZW50IHRoZSBQYXJjZWxhYmxlIGludGVyZmFjZSB7QGhpZGV9ICovCkBAIC00ODAsNiArNTY3LDEwIEBACiAgICAgICAgICAgICAgICAgZm9yIChFbnRlcnByaXNlRmllbGQgZmllbGQgOiBjb25maWcuZW50ZXJwcmlzZUZpZWxkcykgewogICAgICAgICAgICAgICAgICAgICBmaWVsZC5zZXRWYWx1ZShpbi5yZWFkU3RyaW5nKCkpOwogICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNvbmZpZy5pcEFzc2lnbm1lbnQgPSBJcEFzc2lnbm1lbnQudmFsdWVPZihpbi5yZWFkU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIGNvbmZpZy5wcm94eVNldHRpbmdzID0gUHJveHlTZXR0aW5ncy52YWx1ZU9mKGluLnJlYWRTdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgY29uZmlnLmxpbmtQcm9wZXJ0aWVzID0gaW4ucmVhZFBhcmNlbGFibGUobnVsbCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuI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W50VHlwZS5CUk9BRENBU1RfSU5URU5UX0FDVElPTikKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBORVRXT1JLX0lEU19DSEFOR0VEX0FDVElPTiA9ICJhbmRyb2lkLm5ldC53aWZpLk5FVFdPUktfSURTX0NIQU5HRUQiOwotICAgIAorCiAgICAgLyoqCiAgICAgICogQWN0aXZpdHkgQWN0aW9uOiBQaWNrIGEgV2ktRmkgbmV0d29yayB0byBjb25uZWN0IHRvLgogICAgICAqIDxwPklucHV0OiBOb3RoaW5nLgpAQCAtNTEzLDcgKzU0NCw4IEBACiAgICAgICovCiAgICAgcHVibGljIGJvb2xlYW4gZGlzY29ubmVjdCgpIHsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5kaXNjb25uZWN0KCk7CisgICAgICAgICAgICBtU2VydmljZS5kaXNjb25uZWN0KCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQpAQCAtNTI3LDcgKzU1OSw4IEBACiAgICAgICovCiAgICAgcHVibGljIGJvb2xlYW4gcmVjb25uZWN0KCkgewogICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLnJlY29ubmVjdCgpOworICAgICAgICAgICAgbVNlcnZpY2UucmVjb25uZWN0KCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQpAQCAtNTQxLDcgKzU3NCw4IEBACiAgICAgICovCiAgICAgcHVibGljIGJvb2xlYW4gcmVhc3NvY2lhdGUoKSB7CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICByZXR1cm4gbVNlcnZpY2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Bjb2RlIGZhbHNlfQorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gY2xlYXJCbGFja2xpc3QoKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtU2VydmljZS5jbGVhckJsYWNrbGlzdCgpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBUT0RPOiBkZXByZWNhdGUgc3luY2hyb25vdXMgQVBJIGFuZCBvcGVuIHVwIHRoZSBmb2xsb3dpbmcgQVBJICovCisgICAgLyoqCisgICAgICogQ29ubmVjdCB0byBhIG5ldHdvcmsgd2l0aCB0aGUgZ2l2ZW4gY29uZmlndXJhdGlvbi4gVGhlIG5ldHdvcmsgYWxzbworICAgICAqIGdldHMgYWRkZWQgdG8gdGhlIHN1cHBsaWNhbnQgY29uZmlndXJhdGlvbi4KKyAgICAgKgorICAgICAqIEZvciBhIG5ldyBuZXR3b3JrLCB0aGlzIGZ1bmN0aW9uIGlzIHVzZWQgaW5zdGVhZCBvZiBhCisgICAgICogc2VxdWVuY2Ugb2YgYWRkTmV0d29yaygpLCBlbmFibGVOZXR3b3JrKCksIHNhdmVDb25maWd1cmF0aW9uKCkgYW5kCisgICAgICogcmVjb25uZWN0KCkKKyAgICAgKgorICAgICAqIEBwYXJhbSBjb25maWcgdGhlIHNldCBvZiB2YXJpYWJsZXMgdGhhdCBkZXNjcmliZSB0aGUgY29uZmlndXJhdGlvbiwKKyAgICAgKiAgICAgICAgICAgIGNvbnRhaW5lZCBpbiBhIHtAbGluayBXaWZpQ29uZmlndXJhdGlvbn0gb2JqZWN0LgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgY29ubmVjdE5ldHdvcmsoV2lmaUNvbmZpZ3VyYXRpb24gY29uZmlnKSB7CisgICAgICAgIGlmIChjb25maWcgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtU2VydmljZS5jb25uZWN0TmV0d29ya1dpdGhDb25maWcoY29uZmlnKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENvbm5lY3QgdG8gYSBuZXR3b3JrIHdpdGggdGhlIGdpdmVuIG5ldHdvcmtJZC4KKyAgICAgKgorICAgICAqIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBpbnN0ZWFkIG9mIGEgZW5hYmxlTmV0d29yaygpLCBzYXZlQ29uZmlndXJhdGlvbigpIGFuZAorICAgICAqIHJlY29ubmVjdCgpCisgICAgICoKKyAgICAgKiBAcGFyYW0gbmV0d29ya0lkIHRoZSBuZXR3b3JrIGlkIGlkZW50aWZpeWluZyB0aGUgbmV0d29yayBpbiB0aGUKKyAgICAgKiAgICAgICAgICAgICAgICBzdXBwbGljYW50IGNvbmZpZ3VyYXRpb24gbGlzdAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgY29ubmVjdE5ldHdvcmsoaW50IG5ldHdvcmtJZCkgeworICAgICAgICBpZiAobmV0d29ya0lkIDwgMCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtU2VydmljZS5jb25uZWN0TmV0d29ya1dpdGhJZChuZXR3b3JrSWQpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeyB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2F2ZSB0aGUgZ2l2ZW4gbmV0d29yayBpbiB0aGUgc3VwcGxpY2FudCBjb25maWcuIElmIHRoZSBuZXR3b3JrIGFscmVhZHkKKyAgICAgKiBleGlzdHMsIHRoZSBjb25maWd1cmF0aW9uIGl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F1ZW5jZSBvZiByZW1vdmVOZXR3b3JrKCkKKyAgICAgKiBhbmQgc2F2ZUNvbmZpZ3VyYXRpb24oKS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjb25maWcgdGhlIHNldCBvZiB2YXJpYWJsZXMgdGhhdCBkZXNjcmliZSB0aGUgY29uZmlndXJhdGlvbiwKKyAgICAgKiAgICAgICAgICAgIGNvbnRhaW5lZCBpbiBhIHtAbGluayBXaWZpQ29uZmlndXJhdGlvbn0gb2JqZWN0LgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgZm9yZ2V0TmV0d29yayhpbnQgbmV0SWQpIHsKKyAgICAgICAgaWYgKG5ldElkIDwgMCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtU2VydmljZS5mb3JnZXROZXR3b3JrKG5ldElkKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFN0YXJ0IFdpLWZpIHByb3RlY3RlZCBzZXR1cCBwdXNoIGJ1dHRvbiBDb25maWd1cmF0aW9uCisgICAgICoKKyAgICAgKiBAcGFyYW0gYnNzaWQgQlNTSUQgb2YgdGhlIGFjY2VzcyBwb2ludAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgc3RhcnRXcHNQYmMoU3RyaW5nIGJzc2lkKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtU2VydmljZS5zdGFydFdwc1BiYyhic3NpZCk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7IH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdGFydCBXaS1maSBQcm90ZWN0ZWQgU2V0dXAgcGluIG1ldGhvZCBjb25maWd1cmF0aW9uCisgICAgICogd2l0aCBwaW4gb2J0YWluZWQgZnJvbSB0aGUgYWNjZXNzIHBvaW50CisgICAgICoKKyAgICAgKiBAcGFyYW0gYnNzaWQgQlNTSUQgb2YgdGhlIGFjY2VzcyBwb2ludAorICAgICAqIEBwYXJhbSBhcFBpbiBQSU4gaXNzdWVkIGJ5IHRoZSBhY2Nlc3MgcG9pbnQKKyAgICAgKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgc3RhcnRXcHNXaXRoUGluRnJvbUFjY2Vzc1BvaW50KFN0cmluZyBic3NpZCwgaW50IGFwUGluKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtU2VydmljZS5zdGFydFdwc1dpdGhQaW5Gcm9tQWNjZXNzUG9pbnQoYnNzaWQsIGFwUGluKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFN0YXJ0IFdpLWZpIFByb3RlY3RlZCBTZXR1cCBwaW4gbWV0aG9kIGNvbmZpZ3VyYXRpb24KKyAgICAgKiB3aXRoIHBpbiBvYnRhaW5lZCBmcm9tIHRoZSBkZXZpY2UKKyAgICAgKgorICAgICAqIEBwYXJhbSBic3NpZCBCU1NJRCBvZiB0aGUgYWNjZXNzIHBvaW50CisgICAgICogQHJldHVybiBwaW4gZ2VuZXJhdGVkIGJ5IGRldmljZQorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGludCBzdGFydFdwc1dpdGhQaW5Gcm9tRGV2aWNlKFN0cmluZyBic3NpZCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLnN0YXJ0V3BzV2l0aFBpbkZyb21EZXZpY2UoYnNzaWQpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9CisgICAgfQorCiAgICAgLyoqCiAgICAgICogQWxsb3dzIGFuIGFwcGxpY2F0aW9uIHR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ICAgIC8vIHRvIHRoZSBzdXBwbGljYW50Ci0gICAgICAgICAgICAgICAgbVdpZmlTdGF0ZVRyYWNrZXIubm90aWZ5U3VwcGxpY2FudENvbm5lY3Rpb24oKTsKKyAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5ub3RpZnlTdXBwbGljYW50Q29ubmVjdGlvbigpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5ub3RpZnlTdXBwbGljYW50TG9zdCgpOworICAgICAgICAgICAgICAgIG1XaWZpU3RhdGVNYWNoaW5lLm5vdGlmeVN1cHBsaWNhbnRMb3N0KCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogCkBAIC0yNTksNyArMjU0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIC8vIG5vdGlmeSBhbmQgZXhpdAotICAgICAgICAgICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5ub3RpZnlTdXBwbGljYW50TG9zdCgpOworICAgICAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5ub3RpZnlTdXBwbGljYW50TG9zdCgpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBoYW5kbGVFdmVudChldmVudCwgZXZlbnREYXRhKTsKQEAgLTI3MiwxMSArMjY3LDExIEBACiAgICAgICAgICAgICBpbnQgY29ubmVjdFRyaWVzID0gMDsKIAogICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKLSAgICAgICAgICAgICAgICBpZiAobVdpZmlTdGF0ZVRyYWNrZXIuY29ubmVjdFRvU3VwcGxpY2FudCgpKSB7CisgICAgICAgICAgICAgICAgaWYgKFdpZmlOYXRpdmUuY29ubmVjdFRvU3VwcGxpY2FudCgpKSB7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoY29ubmVjdFRyaWVzKysgPCAzKSB7Ci0gICAgICAgICAgICAgICAgICAgIG5hcCg1KTsKKyAgICAgICAgICAgICAgICBpZiAoY29ubmVjdFRyaWVzKysgPCA1KSB7CisgICAgICAgICAgICAgICAgICAgIG5hcCgxKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CkBAIC0yODUsNyArMjgwLDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIHByaXZhdGUgdm9pZCBoYW5kbGVQYXNzd29yZEtleU1heUJlSW5jb3JyZWN0KCkgewotICAgICAgICAgICAgbVdpZmlTdGF0ZVRyYWNrZXIubm90aWZ5UGFzc3dvcmRLZXlNYXlCZUluY29ycmVjdCgpOworICAgICAgICAgICAgbVdpZmlTdGF0ZU1hY2hpbmUubm90aWZ5UGFzc3dvcmRLZXlNYXlCZUluY29ycmVjdCgpOwogICAgICAgICB9CiAKICAgICAgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZURyaXZlckV2ZW50KFN0cmluZyBzdGF0ZSkgewpAQCAtMjkzLDExICsyODgsMTEgQEAKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoc3RhdGUuZXF1YWxzKCJTVE9QUEVEIikpIHsKLSAgICAgICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5ub3RpZnlEcml2ZXJTdG9wcGVkKCk7CisgICAgICAgICAgICAgICAgbVdpZmlTdGF0ZU1hY2hpbmUubm90aWZ5RHJpdmVyU3RvcHBlZCgpOwogICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0ZS5lcXVhbHMoIlNUQVJURUQiKSkgewotICAgICAgICAgICAgICAgIG1XaWZpU3RhdGVUcmFja2VyLm5vdGlmeURyaXZlclN0YXJ0ZWQoKTsKKyAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5ub3RpZnlEcml2ZXJTdGFydGVkKCk7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0YXRlLmVxdWFscygiSEFOR0VEIikpIHsKLSAgICAgICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5ub3RpZnlEcml2ZXJIdW5nKCk7CisgICAgICAgICAgICAgICAgbVdpZmlTdGF0ZU1hY2hpbmUubm90aWZ5RHJpdmVySHVuZygpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTMxOCw3ICszMTMsNyBAQAogICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgIGNhc2UgU0NBTl9SRVNVTFRTOgotICAgICAgICAgICAgICAgICAgICBtV2lmaVN0YXRlVHJhY2tlci5ub3RpZnlTY2FuUmVzdWx0c0F2YWlsYWJsZSgpOworICAgICAgICAgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5ub3RpZnlTY2FuUmVzdWx0c0F2YWlsYWJsZSgpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgIGNhc2UgVU5LTk9XTjoKQEAgLTM3NSw3ICszNzAsNyBAQAogICAgICAgICAgICAgaWYgKG5ld1N1cHBsaWNhbnRTdGF0ZSA9PSBTdXBwbGljYW50U3RhdGUuSU5WQUxJRCkgewogICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkludmFsaWQgc3VwcGxpY2FudCBzdGF0ZTogIiArIG5ld1N0YXRlKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1XaWZpU3RhdGVUcmFja2VyLm5vdGlmeVN0YXRlQ2hhbmdlKG5ldHdvcmtJZCwgQlNTSUQsIG5ld1N1cHBsaWNhbnRTdGF0ZSk7CisgICAgICAgICAgICBtV2lmaVN0YXRlTWFjaGluZS5ub3RpZnlTdXBwbGljYW50U3RhdGVDaGFuZ2UobmV0d29ya0lkLCBCU1N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BmaW5hbCBpbnQgQ01EX0xPQURfRFJJVkVSX1NVQ0NFU1MgICAgICAgICAgICAgID0gMzsKKyAgICAvKiBJbmRpY2F0ZXMgZHJpdmVyIGxvYWQgZmFpbGVkICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9MT0FEX0RSSVZFUl9GQUlMVVJFICAgICAgICAgICAgICA9IDQ7CisgICAgLyogSW5kaWNhdGVzIGRyaXZlciB1bmxvYWQgc3VjY2VlZGVkICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9VTkxPQURfRFJJVkVSX1NVQ0NFU1MgICAgICAgICAgICA9IDU7CisgICAgLyogSW5kaWNhdGVzIGRyaXZlciB1bmxvYWQgZmFpbGVkICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9VTkxPQURfRFJJVkVSX0ZBSUxVUkUgICAgICAgICAgICA9IDY7CisgICAgLyogU2V0IGJsdWV0b290aCBoZWFkc2V0IHByb3h5ICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9TRVRfQkxVRVRPT1RIX0hFQURTRVRfUFJPWFkgICAgICA9IDc7CisgICAgLyogU2V0IGJsdWV0b290aCBBMmRwIHByb3h5ICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9TRVRfQkxVRVRPT1RIX0EyRFBfUFJPWFkgICAgICAgICA9IDg7CisKKyAgICAvKiBTdGFydCB0aGUgc3VwcGxpY2FudCAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBDTURfU1RBUlRfU1VQUExJQ0FOVCAgICAgICAgICAgICAgICAgPSAxMTsKKyAgICAvKiBTdG9wIHRoZSBzdXBwbGljYW50ICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9TVE9QX1NVUFBMSUNBTlQgICAgICAgICAgICAgICAgICA9IDEyOworICAgIC8qIFN0YXJ0IHRoZSBkcml2ZXIgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQ01EX1NUQVJUX0RSSVZFUiAgICAgICAgICAgICAgICAgICAgID0gMTM7CisgICAgLyogU3RhcnQgdGhlIGRyaXZlciAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBDTURfU1RPUF9EUklWRVIgICAgICAgICAgICAgICAgICAgICAgPSAxNDsKKyAgICAvKiBJbmRpY2F0ZXMgREhDUCBzdWNjZWRlZCAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBDTURfSVBfQ09ORklHX1NVQ0NFU1MgICAgICAgICAgICAgICAgPSAxNTsKKyAgICAvKiBJbmRpY2F0ZXMgREhDUCBmYWlsZWQgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQ01EX0lQX0NPTkZJR19GQUlMVVJFICAgICAgICAgICAgICAgID0gMTY7CisgICAgLyogUmUtY29uZmlndXJlIGludGVyZmFjZSAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBDTURfUkVDT05GSUdVUkVfSVAgICAgICAgICAgICAgICAgICAgPSAxNzsKKworCisgICAgLyogU3RhcnQgdGhlIHNvZnQgYWNjZXNzIHBvaW50ICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9TVEFSVF9BUCAgICAgICAgICAgICAgICAgICAgICAgICA9IDIxOworICAgIC8qIFN0b3AgdGhlIHNvZnQgYWNjZXNzIHBvaW50ICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9TVE9QX0FQICAgICAgICAgICAgICAgICAgICAgICAgICA9IDIyOworCisKKyAgICAvKiBTdXBwbGljYW50IGV2ZW50cyAqLworICAgIC8qIENvbm5lY3Rpb24gdG8gc3VwcGxpY2FudCBlc3RhYmxpc2hlZCAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTVVBfQ09OTkVDVElPTl9FVkVOVCAgICAgICAgICAgICAgICAgPSAzMTsKKyAgICAvKiBDb25uZWN0aW9uIHRvIHN1cHBsaWNhbnQgbG9zdCAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTVVBfRElTQ09OTkVDVElPTl9FVkVOVCAgICAgICAgICAgICAgPSAzMjsKKyAgICAvKiBEcml2ZXIgc3RhcnQgY29tcGxldGVkICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IERSSVZFUl9TVEFSVF9FVkVOVCAgICAgICAgICAgICAgICAgICA9IDMzOworICAgIC8qIERyaXZlciBzdG9wIGNvbXBsZXRlZCAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBEUklWRVJfU1RPUF9FVkVOVCAgICAgICAgICAgICAgICAgICAgPSAzNDsKKyAgICAvKiBOZXR3b3JrIGNvbm5lY3Rpb24gY29tcGxldGVkICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE5FVFdPUktfQ09OTkVDVElPTl9FVkVOVCAgICAgICAgICAgICA9IDM2OworICAgIC8qIE5ldHdvcmsgZGlzY29ubmVjdGlvbiBjb21wbGV0ZWQgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTkVUV09SS19ESVNDT05ORUNUSU9OX0VWRU5UICAgICAgICAgID0gMzc7CisgICAgLyogU2NhbiByZXN1bHRzIGFyZSBhdmFpbGFibGUgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgU0NBTl9SRVNVTFRTX0VWRU5UICAgICAgICAgICAgICAgICAgID0gMzg7CisgICAgLyogU3VwcGxpY2F0ZSBzdGF0ZSBjaGFuZ2VkICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFNVUFBMSUNBTlRfU1RBVEVfQ0hBTkdFX0VWRU5UICAgICAgICA9IDM5OworICAgIC8qIFBhc3N3b3JkIG1heSBiZSBpbmNvcnJlY3QgKi8KKyAgICBwcml2YXRlIHN0YXRpY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ludCBDTURfQkxBQ0tMSVNUX05FVFdPUksgICAgICAgICAgICAgICAgPSA1NjsKKyAgICAvKiBDbGVhciB0aGUgYmxhY2tsaXN0IG5ldHdvcmsgbGlzdCAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBDTURfQ0xFQVJfQkxBQ0tMSVNUICAgICAgICAgICAgICAgICAgPSA1NzsKKyAgICAvKiBTYXZlIGNvbmZpZ3VyYXRpb24gKi8KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQ01EX1NBVkVfQ09ORklHICAgICAgICAgICAgICAgICAgICAgID0gNTg7CisKKyAgICAvKiBTdXBwbGljYW50IGNvbW1hbmRzIGFmdGVyIGRyaXZlciBzdGFydCovCisgICAgLyogSW5pdGlhdGUgYSBzY2FuICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9TVEFSVF9TQ0FOICAgICAgICAgICAgICAgICAgICAgICA9IDcxOworICAgIC8qIFNldCBzY2FuIG1vZGUuIENPTk5FQ1RfTU9ERSBvciBTQ0FOX09OTFlfTU9ERSAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBDTURfU0VUX1NDQU5fTU9ERSAgICAgICAgICAgICAgICAgICAgPSA3MjsKKyAgICAvKiBTZXQgc2NhbiB0eXBlLiBTQ0FOX0FDVElWRSBvciBTQ0FOX1BBU1NJVkUgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQ01EX1NFVF9TQ0FOX1RZUEUgICAgICAgICAgICAgICAgICAgID0gNzM7CisgICAgLyogRGlzY29ubmVjdCBmcm9tIGEgbmV0d29yayAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBDTURfRElTQ09OTkVDVCAgICAgICAgICAgICAgICAgICAgICAgPSA3NDsKKyAgICAvKiBSZWNvbm5lY3QgdG8gYSBuZXR3b3JrICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENNRF9SR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2V0KCJ3aWZpLmludGVyZmFjZSIsICJ0aXdsYW4wIik7CisgICAgICAgIG1TdXBwbGljYW50U3RhdGVUcmFja2VyID0gbmV3IFN1cHBsaWNhbnRTdGF0ZVRyYWNrZXIoY29udGV4dCwgZ2V0SGFuZGxlcigpKTsKKworICAgICAgICBtTGlua1Byb3BlcnRpZXMgPSBuZXcgTGlua1Byb3BlcnRpZXMoKTsKKyAgICAgICAgQmx1ZXRvb3RoQWRhcHRlciBhZGFwdGVyID0gQmx1ZXRvb3RoQWRhcHRlci5nZXREZWZhdWx0QWRhcHRlcigpOworICAgICAgICBpZiAoYWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBhZGFwdGVyLmdldFByb2ZpbGVQcm94eShtQ29udGV4dCwgbUJsdWV0b290aFByb2ZpbGVTZXJ2aWNlTGlzdGVuZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhQcm9maWxlLkEyRFApOworICAgICAgICAgICAgYWRhcHRlci5nZXRQcm9maWxlUHJveHkobUNvbnRleHQsIG1CbHVldG9vdGhQcm9maWxlU2VydmljZUxpc3RlbmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoUHJvZmlsZS5IRUFEU0VUKTsKKyAgICAgICAgfQorCisgICAgICAgIG1OZXR3b3JrSW5mby5zZXRJc0F2YWlsYWJsZShmYWxzZSk7CisgICAgICAgIG1MaW5rUHJvcGVydGllcy5jbGVhcigpOworICAgICAgICBtTGFzdEJzc2lkID0gbnVsbDsKKyAgICAgICAgbUxhc3ROZXR3b3JrSWQgPSAtMTsKKyAgICAgICAgbUxhc3RTaWduYWxMZXZlbCA9IC0xOworCisgICAgICAgIG1TY2FuUmVzdWx0Q2FjaGUgPSBuZXcgTGlua2VkSGFzaE1hcDxTdHJpbmcsIFNjYW5SZXN1bHQ+KAorICAgICAgICAgICAgU0NBTl9SRVNVTFRfQ0FDSEVfU0laRSwgMC43NWYsIHRydWUpIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIExpbWl0IHRoZSBjYWNoZSBzaXplIGJ5IFNDQU5fUkVTVUxUX0NBQ0hFX1NJWkUKKyAgICAgICAgICAgICAgICAgKiBlbGVtZW50cworICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIHJlbW92ZUVsZGVzdEVudHJ5KE1hcC5FbnRyeSBlbGRlc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNDQU5fUkVTVUxUX0NBQ0hFX1NJWkUgPCB0aGlzLnNpemUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgUG93ZXJNYW5hZ2VyIHBvd2VyTWFuYWdlciA9IChQb3dlck1hbmFnZXIpbUNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LlBPV0VSX1NFUlZJQ0UpOworICAgICAgICBtV2FrZUxvY2sgPSBwb3dlck1hbmFnZXIubmV3V2FrZUxvY2soUG93ZXJNYW5hZ2VyLlBBUlRJQUxfV0FLRV9MT0NLLCBUQUcpOworCisgICAgICAgIGFkZFN0YXRlKG1EZWZhdWx0U3RhdGUpOworICAgICAgICAgICAgYWRkU3RhdGUobUluaXRpYWxTdGF0ZSwgbURlZmF1bHRTdGF0ZSk7CisgICAgICAgICAgICBhZGRTdGF0ZShtRHJpdmVyVW5sb2FkaW5nU3RhdGUsIG1EZWZhdWx0U3RhdGUpOworICAgICAgICAgICAgYWRkU3RhdGUobURyaXZlclVubG9hZGVkU3RhdGUsIG1EZWZhdWx0U3RhdGUpOworICAgICAgICAgICAgICAgIGFkZFN0YXRlKG1Ecml2ZXJGYWlsZWRTdGF0ZSwgbURyaXZlclVubG9hZGVkU3RhdGUpOworICAgICAgICAgICAgYWRkU3RhdGUobURyaXZlckxvYWRpbmdTdGF0ZSwgbURlZmF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RhdGUpOworICAgICAgICAgICAgICAgIGFkZFN0YXRlKG1Ecml2ZXJTdG9wcGVkU3RhdGUsIG1Ecml2ZXJTdXBSZWFkeVN0YXRlKTsKKyAgICAgICAgICAgIGFkZFN0YXRlKG1Tb2Z0QXBTdGFydGVkU3RhdGUsIG1EZWZhdWx0U3RhdGUpOworCisgICAgICAgIHNldEluaXRpYWxTdGF0ZShtSW5pdGlhbFN0YXRlKTsKKworICAgICAgICBpZiAoREJHKSBzZXREYmcodHJ1ZSk7CisKKyAgICAgICAgLy9zdGFydCB0aGUgc3RhdGUgbWFjaGluZQorICAgICAgICBzdGFydCgpOworICAgIH0KKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgKiBNZXRob2RzIGV4cG9zZWQgZm9yIHB1YmxpYyB1c2UKKyAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICAvKioKKyAgICAgKiBUT0RPOiBkb2MKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBzeW5jUGluZ1N1cHBsaWNhbnQoQXN5bmNDaGFubmVsIGNoYW5uZWwpIHsKKyAgICAgICAgTWVzc2FnZSByZXN1bHRNc2cgPSBjaGFubmVsLnNlbmRNZXNzYWdlU3luY2hyb25vdXNseShDTURfUElOR19TVVBQTElDQU5UKTsKKyAgICAgICAgYm9vbGVhbiByZXN1bHQgPSAocmVzdWx0TXNnLmFyZzEgIT0gRkFJTFVSRSk7CisgICAgICAgIHJlc3VsdE1zZy5yZWN5Y2xlKCk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogVE9ETzogZG9jCisgICAgICovCisgICAgcHVibGljIHZvaWQgc3RhcnRTY2FuKGJvb2xlYW4gZm9yY2VBY3RpdmUpIHsKKyAgICAgICAgc2VuZE1lc3NhZ2Uob2J0YWluTWVzc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EJpbmRlci5nZXRDYWxsaW5nVWlkKCkpOworICAgICAgICBpZiAoZW5hYmxlKSB7CisgICAgICAgICAgICAvKiBBcmd1bWVudCBpcyB0aGUgc3RhdGUgdGhhdCBpcyBlbnRlcmVkIHByaW9yIHRvIGxvYWQgKi8KKyAgICAgICAgICAgIHNlbmRNZXNzYWdlKG9idGFpbk1lc3NhZ2UoQ01EX0xPQURfRFJJVkVSLCBXSUZJX0FQX1NUQVRFX0VOQUJMSU5HLCAwKSk7CisgICAgICAgICAgICBzZW5kTWVzc2FnZShvYnRhaW5NZXNzYWdlKENNRF9TVEFSVF9BUCwgd2lmaUNvbmZpZykpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc2VuZE1lc3NhZ2UoQ01EX1NUT1BfQVApOworICAgICAgICAgICAgLyogQXJndW1lbnQgaXMgdGhlIHN0YXRlIHRoYXQgaXMgZW50ZXJlZCB1cG9uIHN1Y2Nlc3MgKi8KKyAgICAgICAgICAgIHNlbmRNZXNzYWdlKG9idGFpbk1lc3NhZ2UoQ01EX1VOTE9BRF9EUklWRVIsIFdJRklfQVBfU1RBVEVfRElTQUJMRUQsIDApKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFRPRE86IGRvYworICAgICAqLworICAgIHB1YmxpYyBpbnQgc3luY0dldFdpZmlTdGF0ZSgpIHsKKyAgICAgICAgcmV0dXJuIG1XaWZpU3RhdGUuZ2V0KCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogVE9ETzogZG9jCisgICAgICovCisgICAgcHVibGljIFN0cmluZyBzeW5jR2V0V2lmaVN0YXRlQnlOYW1lKCkgeworICAgICAgICBzd2l0Y2ggKG1XaWZpU3RhdGUuZ2V0KCkpIHsKKyAgICAgICAgICAgIGNhc2UgV0lGSV9TVEFURV9ESVNBQkxJTkc6CisgICAgICAgICAgICAgICAgcmV0dXJuICJkaXNhYmxpbmciOworICAgICAgICAgICAgY2FzZSBXSUZJX1NUQVRFX0RJU0FCTEVEOgorICAgICAgICAgICAgICAgIHJldHVybiAiZGlzYWJsZWQiOworICAgICAgICAgICAgY2FzZSBXSUZJX1NUQVRFX0VOQUJMSU5HOgorICAgICAgICAgICAgICAgIHJldHVybiAiZW5hYmxpbmciOworICAgICAgICAgICAgY2FzZSBXSUZJX1NUQVRFX0VOQUJMRUQ6CisgICAgICAgICAgICAgICAgcmV0dXJuICJlbmFibGVkIjsKKyAgICAgICAgICAgIGNhc2UgV0lGSV9TVEFURV9VTktOT1dOOgorICAgICAgICAgICAgICAgIHJldHVybiAidW5rbm93biBzdGF0ZSI7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiAiW2ludmFsaWQgc3RhdGVdIjsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFRPRE86IGRvYworICAgICAqLworICAgIHB1YmxpYyBpbnQgc3luY0dldFdpZmlBcFN0YXRlKCkgeworICAgICAgICByZXR1cm4gbVdpZmlBcFN0YXRlLmdldCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRPRE86IGRvYworICAgICAqLworICAgIHB1YmxpYyBTdHJpbmcgc3luY0dldFdpZmlBcFN0YXRlQnlOYW1lKCkgeworICAgICAgICBzd2l0Y2ggKG1XaWZpQXBTdGF0ZS5nZXQoKSkgeworICAgICAgICAgICAgY2FzZSBXSUZJX0FQX1NUQVRFX0RJU0FCTElORzoKKyAgICAgICAgICAgICAgICByZXR1cm4gImRpc2FibGluZyI7CisgICAgICAgICAgICBjYXNlIFdJRklfQVBfU1RBVEVfRElTQUJMRUQ6CisgICAgICAgICAgICAgICAgcmV0dXJuICJkaXNhYmxlZCI7CisgICAgICAgICAgICBjYXNlIFdJRklfQVBfU1RBVEVfRU5BQkxJTkc6CisgICAgICAgICAgICAgICAgcmV0dXJuICJlbmFibGluZyI7CisgICAgICAgICAgICBjYXNlIFdJRklfQVBfU1RBVEVfRU5BQkxFRDoKKyAgICAgICAgICAgICAgICByZXR1cm4gImVuYWJsZWQiOworICAgICAgICAgICAgY2FzZSBXSUZJX0FQX1NUQVRFX0ZBSUxFRDoKKyAgICAgICAgICAgICAgICByZXR1cm4gImZhaWxlZCI7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiAiW2ludmFsaWQgc3RhdGVdIjsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEdldCBzdGF0dXMgaW5mb3JtYXRpb24gZm9yIHRoZSBjdXJyZW50IGNvbm5lY3Rpb24sIGlmIGFueS4KKyAgICAgKiBAcmV0dXJuIGEge0BsaW5rIFdpZmlJbmZvfSBvYmplY3QgY29udGFpbmluZyBpbmZvcm1hdGlvbiBhYm91dCB0aGUgY3VycmVudCBjb25uZWN0aW9uCisgICAgICoKKyAgICAgKi8KKyAgICBwdWJsaWMgV2lmaUluZm8gc3luY1JlcXVlc3RDb25uZWN0aW9uSW5mbygpIHsKKyAgICAgICAgcmV0dXJuIG1XaWZpSW5mbzsKKyAgICB9CisKKyAgICBwdWJsaWMgRGhjcEluZm8gc3luY0dldERoY3BJbmZvKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1EaGNwSW5mbykgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBEaGNwSW5mbyhtRGhjcEluZm8pOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVE9ETzogZG9jCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0RHJpdmVyU3RhcnQoYm9vbGVhbiBlbmFibGUpIHsKKyAgICAgICAgaWYgKGVuYWJsZSkgeworICAgICAgICAgICAgc2VuZE1lc3NhZ2UoQ01EX1NUQVJUX0RSSVZFUik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzZW5kTWVzc2FnZShDTURfU1RPUF9EUklWRVIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVE9ETzogZG9jCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0U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worICAgICAgICB0cnkgeworICAgICAgICAgICAgc2V0TnVtQWxsb3dlZENoYW5uZWxzKAorICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuZ2V0SW50KG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAorICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuV0lGSV9OVU1fQUxMT1dFRF9DSEFOTkVMUykpOworICAgICAgICB9IGNhdGNoIChTZXR0aW5ncy5TZXR0aW5nTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgaWYgKG1OdW1BbGxvd2VkQ2hhbm5lbHMgIT0gMCkgeworICAgICAgICAgICAgICAgIHNldE51bUFsbG93ZWRDaGFubmVscyhtTnVtQWxsb3dlZENoYW5uZWxzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIG90aGVyd2lzZSwgdXNlIHRoZSBkcml2ZXIgZGVmYXVsdAorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHRoZSBudW1iZXIgb2YgcmFkaW8gZnJlcXVlbmN5IGNoYW5uZWxzIHRoYXQgYXJlIGFsbG93ZWQgdG8gYmUgdXNlZAorICAgICAqIGluIHRoZSBjdXJyZW50IHJlZ3VsYXRvcnkgZG9tYWluLgorICAgICAqIEBwYXJhbSBudW1DaGFubmVscyB0aGUgbnVtYmVyIG9mIGFsbG93ZWQgY2hhbm5lbHMuIE11c3QgYmUgZ3JlYXRlciB0aGFuIDAKKyAgICAgKiBhbmQgbGVzcyB0aGFuIG9yIGVxdWFsIHRvIDE2LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldE51bUFsbG93ZWRDaGFubmVscyhpbnQgbnVtQ2hhbm5lbHMpIHsKKyAgICAgICAgc2VuZE1lc3NhZ2Uob2J0YWluTWVzc2FnZShDTURfU0VUX05VTV9BTExPV0VEX0NIQU5ORUxTLCBudW1DaGFubmVscywgMCkpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEdldCBudW1iZXIgb2YgYWxsb3dlZCBjaGFubmVscworICAgICAqCisgICAgICogQHJldHVybiBjaGFubmVsIGNvdW50LCAtMSBvbiBmYWlsdXJlCisgICAgICoKKyAgICAgKiBUT0RPOiB0aGlzIGlzIG5vdCBhIHB1YmxpYyBBUEkgYW5kIG5lZWRzIHRvIGJlIHJlbW92ZWQgaW4gZmF2b3IKKyAgICAgKiBvZiBhc3luY2hyb25vdXMgcmVwb3J0aW5nLiB1bnVzZWQgZm9yIG5vdy4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldE51bUFsbG93ZWRDaGFubmVscygpIHsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCBibHVldG9vdGggY29leCBtb2RlOgorICAgICAqCisgICAgICogQHBhcmFtIG1vZGUKKyAgICAgKiAgQkxVRVRPT1RIX0NPRVhJU1RFTkNFX01PREVfRU5BQkxFRAorICAgICAqICBCTFVFVE9PVEhfQ09FWElTVEVOQ0VfTU9ERV9ESVNBQkxFRAorICAgICAqICBCTFVFVE9PVEhfQ09FWElTVEVOQ0VfTU9ERV9TRU5TRQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEJsdWV0b290aENvZXhpc3RlbmNlTW9kZShpbnQgbW9kZSkgeworICAgICAgICBzZW5kTWVzc2FnZShvYnRhaW5NZXNzYWdlKENNRF9TRVRfQkxVRVRPT1RIX0NPRVhJU1RFTkNFLCBtb2RlLCAwKSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogRW5hYmxlIG9yIGRpc2FibGUgQmx1ZXRvb3RoIGNvZXhpc3RlbmNlIHNjYW4gbW9kZS4gV2hlbiB0aGlzIG1vZGUgaXMgb24sCisgICAgICogc29tZSBvZiB0aGUgbG93LWxldmVsIHNjYW4gcGFyYW1ldGVycyB1c2VkIGJ5IHRoZSBkcml2ZXIgYXJlIGNoYW5nZWQgdG8KKyAgICAgKiByZWR1Y2UgaW50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SRVFVRVNUX0NNX1dBS0VMT0NLKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1cGRhdGVCYXR0ZXJ5V29ya1NvdXJjZShXb3JrU291cmNlIG5ld1NvdXJjZSkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1SdW5uaW5nV2lmaVVpZHMpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgaWYgKG5ld1NvdXJjZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1SdW5uaW5nV2lmaVVpZHMuc2V0KG5ld1NvdXJjZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtSXNSdW5uaW5nKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtUmVwb3J0ZWRSdW5uaW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgd29yayBzb3VyY2UgaGFzIGNoYW5nZWQgc2luY2UgbGFzdCB0aW1lLCBuZWVkCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0byByZW1vdmUgb2xkIHdvcmsgZnJvbSBiYXR0ZXJ5IHN0YXRzLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1MYXN0UnVubmluZ1dpZmlVaWRzLmRpZmYobVJ1bm5pbmdXaWZpVWlkcykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeVN0YXRzLm5vdGVXaWZpUnVubmluZ0NoYW5nZWQobUxhc3RSdW5uaW5nV2lmaVVpZHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUnVubmluZ1dpZmlVaWRzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFJ1bm5pbmdXaWZpVWlkcy5zZXQobVJ1bm5pbmdXaWZpVWlkcyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBOb3cgYmVpbmcgc3RhcnRlZCwgcmVwb3J0IGl0LgorICAgICAgICAgICAgICAgICAgICAgICAgbUJhdHRlcnlTdGF0cy5ub3RlV2lmaVJ1bm5pbmcobVJ1bm5pbmdXaWZpVWlkcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFJ1bm5pbmdXaWZpVWlkcy5zZXQobVJ1bm5pbmdXaWZpVWlkcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBtUmVwb3J0ZWRSdW5uaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtUmVwb3J0ZWRSdW5uaW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBMYXN0IHJlcG9ydGVkIHdlIHdlcmUgcnVubmluZywgdGltZSB0byBzdG9wLgorICAgICAgICAgICAgICAgICAgICAgICAgbUJhdHRlcnlTdGF0cy5ub3RlV2lmaVN0b3BwZWQobUxhc3RSdW5uaW5nV2lmaVVpZHMpOworICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RSdW5uaW5nV2lmaVVpZHMuY2xlYXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1SZXBvcnRlZFJ1bm5pbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtV2FrZUxvY2suc2V0V29ya1NvdXJjZShuZXdTb3VyY2UpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGlnbm9yZSkgeworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgU3RyaW5nQnVmZmVyIHNiID0gbmV3IFN0cmluZ0J1ZmZlcigpOworICAgICAgICBTdHJpbmcgTF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zc2lQb2xsaW5nKS5hcHBlbmQoTFMpOworICAgICAgICBzYi5hcHBlbmQoIm1QYXNzd29yZEtleU1heUJlSW5jb3JyZWN0ICIpLmFwcGVuZChtUGFzc3dvcmRLZXlNYXlCZUluY29ycmVjdCkuYXBwZW5kKExTKTsKKyAgICAgICAgc2IuYXBwZW5kKCJtUmVjb25uZWN0Q291bnQgIikuYXBwZW5kKG1SZWNvbm5lY3RDb3VudCkuYXBwZW5kKExTKTsKKyAgICAgICAgc2IuYXBwZW5kKCJtSXNTY2FuTW9kZSAiKS5hcHBlbmQobUlzU2Nhbk1vZGUpLmFwcGVuZChMUyk7CisgICAgICAgIHNiLmFwcGVuZCgiU3VwcGxpY2FudCBzdGF0dXMiKS5hcHBlbmQoTFMpCisgICAgICAgICAgICAgICAgLmFwcGVuZChXaWZpTmF0aXZlLnN0YXR1c0NvbW1hbmQoKSkuYXBwZW5kKExTKS5hcHBlbmQoTFMpOworCisgICAgICAgIHNiLmFwcGVuZChXaWZpQ29uZmlnU3RvcmUuZHVtcCgpKTsKKyAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7CisgICAgfQorCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAqIEludGVybmFsIHByaXZhdGUgZnVuY3Rpb25zCisgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgcHJpdmF0ZSB2b2lkIHNldFdpZmlTdGF0ZShpbnQgd2lmaVN0YXRlKSB7CisgICAgICAgIGZpbmFsIGludCBwcmV2aW91c1dpZmlTdGF0ZSA9IG1XaWZpU3RhdGUuZ2V0KCk7CisKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmICh3aWZpU3RhdGUgPT0gV0lGSV9TVEFURV9FTkFCTEVEKSB7CisgICAgICAgICAgICAgICAgbUJhdHRlcnlTdGF0cy5ub3RlV2lma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AgICAgICBtQ29udGV4dC5zZW5kU3RpY2t5QnJvYWRjYXN0KGludGVudCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUGFyc2UgdGhlIHNjYW4gcmVzdWx0IGxpbmUgcGFzc2VkIHRvIHVzIGJ5IHdwYV9zdXBwbGljYW50IChoZWxwZXIpLgorICAgICAqIEBwYXJhbSBsaW5lIHRoZSBsaW5lIHRvIHBhcnNlCisgICAgICogQHJldHVybiB0aGUge0BsaW5rIFNjYW5SZXN1bHR9IG9iamVjdAorICAgICAqLworICAgIHByaXZhdGUgU2NhblJlc3VsdCBwYXJzZVNjYW5SZXN1bHQoU3RyaW5nIGxpbmUpIHsKKyAgICAgICAgU2NhblJlc3VsdCBzY2FuUmVzdWx0ID0gbnVsbDsKKyAgICAgICAgaWYgKGxpbmUgIT0gbnVsbCkgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIENhY2hlIGltcGxlbWVudGF0aW9uIChMaW5rZWRIYXNoTWFwKSBpcyBub3Qgc3luY2hyb25pemVkLCB0aHVzLAorICAgICAgICAgICAgICogbXVzdCBzeW5jaHJvbml6ZWQgaGVyZSEKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgc3luY2hyb25pemVkIChtU2NhblJlc3VsdENhY2hlKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nW10gcmVzdWx0ID0gc2NhblJlc3VsdFBhdHRlcm4uc3BsaXQobGluZSk7CisgICAgICAgICAgICAgICAgaWYgKDMgPD0gcmVzdWx0Lmxlbmd0aCAmJiByZXN1bHQubGVuZ3RoIDw9IDUpIHsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGJzc2lkID0gcmVzdWx0WzBdOworICAgICAgICAgICAgICAgICAgICAvLyBic3NpZCB8IGZyZXF1ZW5jeSB8IGxldmVsIHwgZmxhZ3MgfCBzc2lkCisgICAgICAgICAgICAgICAgICAgIGludCBmcmVxdWVuY3k7CisgICAgICAgICAgICAgICAgICAgIGludCBsZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyZXF1ZW5jeSA9IEludGVnZXIucGFyc2VJbnQocmVzdWx0WzFdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxldmVsID0gSW50ZWdlci5wYXJzZUludChyZXN1bHRbMl0pOworICAgICAgICAgICAgICAgICAgICAgICAgLyogc29tZSBpbXBsZW1lbnRhdGlvbnMgYXZvaWQgbmVnYXRpdmUgdmFsdWVzIGJ5IGFkZGluZyAyNTYKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHNvIHdlIG5lZWQgdG8gYWRqdXN0IGZvciB0aGF0IGhlcmUuCisgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZXZlbCA+IDApIGxldmVsIC09IDI1NjsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyZXF1ZW5jeSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBsZXZlbCA9IDA7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgKiBUaGUgZm9ybWF0dGluZyBvZiB0aGUgcmVzdWx0cyByZXR1cm5lZCBieQorICAgICAgICAgICAgICAgICAgICAgKiB3cGFfc3VwcGxpY2FudCBpcyBpbnRlbmRlZCB0byBtYWtlIHRoZSBmaWVsZHMKKyAgICAgICAgICAgICAgICAgICAgICogbGluZSB1cCBuaWNlbHkgd2hlbiBwcmludGVkLAorICAgICAgICAgICAgICAgICAgICAgKiBub3QgdG8gbWFrZSB0aGVtIGVhc3kgdG8gcGFyc2UuIFNvIHdlIGhhdmUgdG8KKyAgICAgICAgICAgICAgICAgICAgICogYXBwbHkgc29tZSBoZXVyaXN0aWNzIHRvIGZpZ3VyZSBvdXQgd2hpY2ggZmllbGQKKyAgICAgICAgICAgICAgICAgICAgICogaXMgdGhlIFNTSUQgYW5kIHdoaWNoIGZpZWxkIGlzIHRoZSBmbGFncy4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBzc2lkOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZmxhZ3M7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQubGVuZ3RoID09IDQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHRbM10uY2hhckF0KDApID09ICdbJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzID0gcmVzdWx0WzNdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzaWQgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzc2lkID0gcmVzdWx0WzNdOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdC5sZW5ndGggPT0gNSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSByZXN1bHRbM107CisgICAgICAgICAgICAgICAgICAgICAgICBzc2lkID0gcmVzdWx0WzRdOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gSGVyZSwgd2UgbXVzdCBoYXZlIDMgZmllbGRzOiBubyBmbGFncyBhbmQgc3NpZAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0CisgICAgICAgICAgICAgICAgICAgICAgICBmbGFncyA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgc3NpZCA9ICIiOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gYnNzaWQgKyBzc2lkIGlzIHRoZSBoYXNoIGtleQorICAgICAgICAgICAgICAgICAgICBTdHJpbmcga2V5ID0gYnNzaWQgKyBzc2lkOworICAgICAgICAgICAgICAgICAgICBzY2FuUmVzdWx0ID0gbVNjYW5SZXN1bHRDYWNoZS5nZXQoa2V5KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjYW5SZXN1bHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlc3VsdC5sZXZlbCA9IGxldmVsOworICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlc3VsdC5TU0lEID0gc3NpZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjYW5SZXN1bHQuY2FwYWJpbGl0aWVzID0gZmxhZ3M7CisgICAgICAgICAgICAgICAgICAgICAgICBzY2FuUmVzdWx0LmZyZXF1ZW5jeSA9IGZyZXF1ZW5jeTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvIG5vdCBhZGQgc2NhbiByZXN1bHRzIHRoYXQgaGF2ZSBubyBTU0lEIHNldAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPCBzc2lkLnRyaW0oKS5sZW5ndGgoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYW5SZXN1bHQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU2NhblJlc3VsdCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzaWQsIGJzc2lkLCBmbGFncywgbGV2ZWwsIGZyZXF1ZW5jeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNjYW5SZXN1bHRDYWNoZS5wdXQoa2V5LCBzY2FuUmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIk1pc2Zvcm1hdHRlZCBzY2FuIHJlc3VsdCB0ZXh0IHdpdGggIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5sZW5ndGggKyAiIGZpZWxkczogIiArIGxpbmUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBzY2FuUmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIHNjYW5SZXN1bHRzIGlucHV0IGZvcm1hdAorICAgICAqIDAwOmJiOmNjOmRkOmNjOmVlICAgICAgIDI0MjcgICAgMTY2ICAgICBbV1BBLUVBUC1US0lQXVtXUEEyLUVBUC1DQ01QXSAgIE5ldDEKKyAgICAgKiAwMDpiYjpjYzpkZDpjYzpmZiAgICAgICAyNDEyICAgIDE2NSAgICAgW1dQQS1FQVAtVEtJUF1bV1BBMi1FQVAtQ0NNUF0gICBOZXQyCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHNldFNjYW5SZXN1bHRzKFN0cmluZyBzY2FuUmVzdWx0cykgeworICAgICAgICBpZiAoc2NhblJlc3VsdHMgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgTGlzdDxTY2FuUmVzdWx0PiBzY2FuTGlzdCA9IG5ldyBBcnJheUxpc3Q8U2NhblJlc3VsdD4oKTsKKworICAgICAgICBpbnQgbGluZUNvdW50ID0gMDsKKworICAgICAgICBpbnQgc2NhblJlc3VsdHNMZW4gPSBzY2FuUmVzdWx0cy5sZW5ndGgoKTsKKyAgICAgICAgLy8gUGFyc2UgdGhlIHJlc3VsdCBzdHJpbmcsIGtlZXBpbmcgaW4gbWluZCB0aGF0IHRoZSBsYXN0IGxpbmUgZG9lcworICAgICAgICAvLyBub3QgZW5kIHdpdGggYSBuZXdsaW5lLgorICAgICAgICBmb3IgKGludCBsaW5lQmVnID0gMCwgbGluZUVuZCA9IDA7IGxpbmVFbmQgPD0gc2NhblJlc3VsdHNMZW47ICsrbGluZUVuZCkgeworICAgICAgICAgICAgaWYgKGxpbmVFbmQgPT0gc2NhblJlc3VsdHNMZW4gfHwgc2NhblJlc3VsdHMuY2hhckF0KGxpbmVFbmQpID09ICdcbicpIHsKKyAgICAgICAgICAgICAgICArK2xpbmVDb3VudDsKKworICAgICAgICAgICAgICAgIGlmIChsaW5lQ291bnQgPT0gMSkgeworICAgICAgICAgICAgICAgICAgICBsaW5lQmVnID0gbGluZUVuZCArIDE7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobGluZUVuZCA+IGxpbmVCZWcpIHsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGxpbmUgPSBzY2FuUmVzdWx0cy5zdWJzdHJpbmcobGluZUJlZywgbGluZUVuZCk7CisgICAgICAgICAgICAgICAgICAgIFNjYW5SZXN1bHQgc2NhblJlc3VsdCA9IHBhcnNlU2NhblJlc3VsdChsaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjYW5SZXN1bHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2Nhbkxpc3QuYWRkKHNjYW5SZXN1bHQpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAibWlzZm9ybWF0dGVkIHNjYW4gcmVzdWx0IGZvcjogIiArIGxpbmUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGxpbmVCZWcgPSBsaW5lRW5kICsgMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIG1TY2FuUmVzdWx0cyA9IHNjYW5MaXN0OworICAgIH0KKworICAgIHByaXZhdGUgU3RyaW5nIGZldGNoU1NJRCgpIHsKKyAgICAgICAgU3RyaW5nIHN0YXR1cyA9IFdpZmlOYXRpdmUuc3RhdHVzQ29tbWFuZCgpOworICAgICAgICBpZiAoc3RhdHVzID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIC8vIGV4dHJhY3Qgc3NpZCBmcm9tIGEgc2VyaWVzIG9mICJuYW1lPXZhbHVlIgorICAgICAgICBTdHJpbmdbXSBsaW5lcyA9IHN0YXR1cy5zcGxpdCgiXG4iKTsKKyAgICAgICAgZm9yIChTdHJpbmcgbGluZSA6IGxpbmVzKSB7CisgICAgICAgICAgICBTdHJpbmdbXSBwcm9wID0gbGluZS5zcGxpdCgiICo9ICoiKTsKKyAgICAgICAgICAgIGlmIChwcm9wLmxlbmd0aCA8IDIpIGNvbnRpbnVlOworICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBwcm9wWzBdOworICAgICAgICAgICAgU3RyaW5nIHZhbHVlID0gcHJvcFsxXTsKKyAgICAgICAgICAgIGlmIChuYW1lLmVxdWFsc0lnbm9yZUNhc2UoInNzaWQiKSkgcmV0dXJuIHZhbHVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzZXRIaWdoUGVyZk1vZGVFbmFibGVkTmF0aXZlKGJvb2xlYW4gZW5hYmxlKSB7CisgICAgICAgIGlmKCFXaWZpTmF0aXZlLnNldFN1c3BlbmRPcHRpbWl6YXRpb25zQ29tbWFuZCghZW5hYmxlKSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAic2V0IHN1c3BlbmQgb3B0aW1pemF0aW9ucyBmYWlsZWQhIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGVuYWJsZSkgeworICAgICAgICAgICAgaWYgKCFXaWZpTmF0aXZlLnNldFBvd2VyTW9kZUNvbW1hbmQoUE9XRVJfTU9ERV9BQ1RJVkUpKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAic2V0IHBvd2VyIG1vZGUgYWN0aXZlIGZhaWxlZCEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGlmICghV2lmaU5hdGl2ZS5zZXRQb3dlck1vZGVDb21tYW5kKFBPV0VSX01PREVfQVVUTykpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJzZXQgcG93ZXIgbW9kZSBhdXRvIGZhaWxlZCEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBjb25maWd1cmVMaW5rUHJvcGVydGllcygpIHsKKyAgICAgICAgaWYgKFdpZmlDb25maWdTdG9yZS5pc1VzaW5nU3RhdGljSXAobUxhc3ROZXR3b3JrSWQpKSB7CisgICAgICAgICAgICBtTGlua1Byb3BlcnRpZXMgPSBXaWZpQ29uZmlnU3RvcmUuZ2V0TGlua1Byb3BlcnRpZXMobUxhc3ROZXR3b3JrSWQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVE9ETyAtIGZpeCB0aGlzIGZvciB2NgorICAgICAgICAgICAgc3luY2hyb25pemVkIChtRGhjcEluZm8pIHsKKyAgICAgICAgICAgICAgICBtTGlua1Byb3BlcnRpZXMuYWRkTGlua0FkZHJlc3MobmV3IExpbmtBZGRyZXNzKAorICAgICAgICAgICAgICAgICAgICAgICAgTmV0d29ya1V0aWxzLmludFRvSW5ldEFkZHJlc3MobURoY3BJbmZvLmlwQWRkcmVzcyksCisgICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrVXRpbHMuaW50VG9JbmV0QWRkcmVzcyhtRGhjcEluZm8ubmV0bWFzaykpKTsKKyAgICAgICAgICAgICAgICBtTGlua1Byb3BlcnRpZXMuc2V0R2F0ZXdheShOZXR3b3JrVXRpbHMuaW50VG9JbmV0QWRkcmVzcyhtRGhjcEluZm8uZ2F0ZXdheSkpOworICAgICAgICAgICAgICAgIG1MaW5rUHJvcGVydGllcy5hZGREbnMoTmV0d29ya1V0aWxzLmludFRvSW5ldEFkZHJlc3MobURoY3BJbmZvLmRuczEpKTsKKyAgICAgICAgICAgICAgICBtTGlua1Byb3BlcnRpZXMuYWRkRG5zKE5ldHdvcmtVdGlscy5pbnRUb0luZXRBZGRyZXNzKG1EaGNwSW5mby5kbnMyKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTGlua1Byb3BlcnRpZXMuc2V0SHR0cFByb3h5KFdpZmlDb25maWdTdG9yZS5nZXRQcm94eVByb3BlcnRpZXMobUxhc3ROZXR3b3JrSWQpKTsKKyAgICAgICAgfQorICAgICAgICBtTGlua1Byb3BlcnRpZXMuc2V0SW50ZXJmYWNlTmFtZShtSW50ZXJmYWNlTmFtZSk7CisgICAgICAgIExvZy5kKFRBRywgIm5ldElkPSIgKyBtTGFzdE5ldHdvcmtJZCAgKyAiIExpbmsgY29uZmlndXJlZDogIiArIG1MaW5rUHJvcGVydGllcy50b1N0cmluZygpKTsKKyAgICB9CisKKyAgICBwcml2YXRlIGludCBnZXRNYXhEaGNwUmV0cmllcygpIHsKKyAgICAgICAgcmV0dXJuIFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5XSUZJX01BWF9ESENQX1JFVFJZX0NPVU5ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBERUZBVUxUX01BWF9ESENQX1JFVFJJRVMpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFdoZXRoZXIgdG8gZGlzYWJsZSBjb2V4aXN0ZW5jZSBtb2RlIHdoaWxlIG9idGFpbmluZyBJUCBhZGRyZXNzLiBXZQorICAgICAqIGRpc2FibGUgY29leGlzdGVuY2UgaWYgdGhlIGhlYWRzZXQgaW5kaWNhdGVzIHRoYXQgdGhlcmUgYXJlIG5vCisgICAgICogY29ubmVjdGVkIGRldmljZXMuIElmI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AgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHNldEJsdWV0b290aFNjYW5Nb2RlKGlzQmx1ZXRvb3RoUGxheWluZyk7CisgICAgfQorCisgICAgcHJpdmF0ZSBCbHVldG9vdGhQcm9maWxlLlNlcnZpY2VMaXN0ZW5lciBtQmx1ZXRvb3RoUHJvZmlsZVNlcnZpY2VMaXN0ZW5lciA9CisgICAgICAgIG5ldyBCbHVldG9vdGhQcm9maWxlLlNlcnZpY2VMaXN0ZW5lcigpIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlQ29ubmVjdGVkKGludCBwcm9maWxlLCBCbHVldG9vdGhQcm9maWxlIHByb3h5KSB7CisgICAgICAgICAgICAgICAgaWYgKHByb2ZpbGUgPT0gQmx1ZXRvb3RoUHJvZmlsZS5IRUFEU0VUKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKENNRF9TRVRfQkxVRVRPT1RIX0hFQURTRVRfUFJPWFksIHByb3h5KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHByb2ZpbGUgPT0gQmx1ZXRvb3RoUHJvZmlsZS5BMkRQKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKENNRF9TRVRfQkxVRVRPT1RIX0EyRFBfUFJPWFksIHByb3h5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VEaXNjb25uZWN0ZWQoaW50IHByb2ZpbGUpIHsKKyAgICAgICAgICAgICAgICBpZiAocHJvZmlsZSA9PSBCbHVldG9vdGhQcm9maWxlLkhFQURTRVQpIHsKKyAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2UoQ01EX1NFVF9CTFVFVE9PVEhfSEVBRFNFVF9QUk9YWSwgbnVsbCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh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WRkRmxhZ3MoSW50ZW50LkZMQUdfUkVDRUlWRVJfUkVHSVNURVJFRF9PTkxZX0JFRk9SRV9CT09UCisgICAgICAgICAgICAgICAgfCBJbnRlbnQuRkxBR19SRUNFSVZFUl9SRVBMQUNFX1BFTkRJTkcpOworICAgICAgICBpbnRlbnQucHV0RXh0cmEoV2lmaU1hbmFnZXIuRVhUUkFfTkVUV09SS19JTkZPLCBtTmV0d29ya0luZm8pOworICAgICAgICBpbnRlbnQucHV0RXh0cmEoV2lmaU1hbmFnZXIuRVhUUkFfTElOS19QUk9QRVJUSUVTLCBtTGlua1Byb3BlcnRpZXMpOworICAgICAgICBpZiAoYnNzaWQgIT0gbnVsbCkKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShXaWZpTWFuYWdlci5FWFRSQV9CU1NJRCwgYnNzaWQpOworICAgICAgICBtQ29udGV4dC5zZW5kU3RpY2t5QnJvYWRjYXN0KGludGVudCk7CisgICAgfQorCisgICAgLyogVE9ETzogVW51c2VkIGZvciBub3csIHdpbGwgYmUgdXNlZCB3aGVuIGlwIGNoYW5nZSBvbiBjb25uZWN0ZWQgbmV0d29yayBpcyBoYW5kbGVkICovCisgICAgcHJpdmF0ZSB2b2lkIHNlbmRDb25maWdDaGFuZ2VCcm9hZGNhc3QoKSB7CisgICAgICAgIGlmICghQWN0aXZpdHlNYW5hZ2VyTmF0aXZlLmlzU3lzdGVtUmVhZHkoKSkgcmV0dXJuOworICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChXaWZpTWFuYWdlci5DT05GSUdfQ0hBTkdFRF9BQ1RJT04pOworICAgICAgICBpbnRlbnQucHV0RXh0cmEoV2lmaU1hbmFnZXIuRVhUUkFfTElOS19QUk9QRVJUSUVTLCBtTGlua1Byb3BlcnRpZXMpOworICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNlbmRTdXBwbGljYW50U3R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XQgY29ubmVjdGlvbnMgYW5kIHN0b3BwaW5nIERIQ1AiKTsKKworICAgICAgICAvKgorICAgICAgICAgKiBSZXNldCBjb25uZWN0aW9ucyAmIHN0b3AgREhDUAorICAgICAgICAgKi8KKyAgICAgICAgTmV0d29ya1V0aWxzLnJlc2V0Q29ubmVjdGlvbnMobUludGVyZmFjZU5hbWUpOworCisgICAgICAgIGlmICghTmV0d29ya1V0aWxzLnN0b3BEaGNwKG1JbnRlcmZhY2VOYW1lKSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ291bGQgbm90IHN0b3AgREhDUCIpOworICAgICAgICB9CisKKyAgICAgICAgLyogRGlzYWJsZSBpbnRlcmZhY2UgKi8KKyAgICAgICAgTmV0d29ya1V0aWxzLmRpc2FibGVJbnRlcmZhY2UobUludGVyZmFjZU5hbWUpOworCisgICAgICAgIC8qIHNlbmQgZXZlbnQgdG8gQ00gJiBuZXR3b3JrIGNoYW5nZSBicm9hZGNhc3QgKi8KKyAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLkRJU0NPTk5FQ1RFRCk7CisgICAgICAgIHNlbmROZXR3b3JrU3RhdGVDaGFuZ2VCcm9hZGNhc3QobUxhc3RCc3NpZCk7CisKKyAgICAgICAgLyogUmVzZXQgZGF0YSBzdHJ1Y3R1cmVzICovCisgICAgICAgIG1XaWZpSW5mby5zZXRJcEFkZHJlc3MoMCk7CisgICAgICAgIG1XaWZpSW5mby5zZXRCU1NJRChudWxsKTsKKyAgICAgICAgbVdpZmlJbmZvLnNldFNTSUQobnVsbCk7CisgICAgICAgIG1XaWZpSW5mby5zZXROZXR3b3JrSWQoLTEpOworCisgICAgICAgIC8qIENsZWFyIG5ldHdvcmsgcHJvcGVydGllcyAqLworICAgICAgICBtTGlua1Byb3BlcnRpZXMuY2xlYXIoKTsKKworICAgICAgICBtTGFzdEJzc2lkPSBudWxsOworICAgICAgICBtTGFzdE5ldHdvcmtJZCA9IC0xOworCisgICAgfQorCisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICogTm90aWZpY2F0aW9ucyBmcm9tIFdpZmlNb25pdG9yCisgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgLyoqCisgICAgICogQSBzdHJ1Y3R1cmUgZm9yIHN1cHBseWluZyBpbmZvcm1hdGlvbiBhYm91dCBhIHN1cHBsaWNhbnQgc3RhdGUKKyAgICAgKiBjaGFuZ2UgaW4gdGhlIFNUQVRFX0NIQU5HRSBldmVudCBtZXNzYWdlIHRoYXQgY29tZXMgZnJvbSB0aGUKKyAgICAgKiBXaWZpTW9uaXRvcgorICAgICAqIHRocmVhZC4KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBTdGF0ZUNoYW5nZVJlc3VsdCB7CisgICAgICAgIFN0YXRlQ2hhbmdlUmVzdWx0KGludCBuZXR3b3JrSWQsIFN0cmluZyBCU1NJRCwgT2JqZWN0IHN0YXRlKSB7CisgICAgICAgICAgICB0aGlzLnN0YXRlID0gc3RhdGU7CisgICAgICAgICAgICB0aGlzLkJTU0lEID0gQlNTSUQ7CisgICAgICAgICAgICB0aGlzLm5ldHdvcmtJZCA9IG5ldHdvcmtJZDsKKyAgICAgICAgfQorICAgICAgICBpbnQgbmV0d29ya0lkOworICAgICAgICBTdHJpbmcgQlNTSUQ7CisgICAgICAgIE9iamVjdCBzdGF0ZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZW5kIHRoZSB0cmFja2VyIGEgbm90aWZpY2F0aW9uIHRoYXQgYSB1c2VyLWVudGVyZWQgcGFzc3dvcmQga2V5CisgICAgICogbWF5IGJlIGluY29ycmVjdCAoaS5lLiwgY2F1c2VkIGF1dGhlbnRpY2F0aW9uIHRvIGZhaWwpLgorICAgICAqLworICAgIHZvaWQgbm90aWZ5UGFz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VOVCk7CisgICAgfQorCisgICAgdm9pZCBub3RpZnlEcml2ZXJIdW5nKCkgeworICAgICAgICBzZXRXaWZpRW5hYmxlZChmYWxzZSk7CisgICAgICAgIHNldFdpZmlFbmFibGVkKHRydWUpOworICAgIH0KKworCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICogSFNNIHN0YXRlcworICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgY2xhc3MgRGVmYXVsdFN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArIG1lc3NhZ2UudG9TdHJpbmcoKSArICJcbiIpOworICAgICAgICAgICAgc3dpdGNoIChtZXNzYWdlLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfQkxVRVRPT1RIX0hFQURTRVRfUFJPWFk6CisgICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhIZWFkc2V0ID0gKEJsdWV0b290aEhlYWRzZXQpIG1lc3NhZ2Uub2JqOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfQkxVRVRPT1RIX0EyRFBfUFJPWFk6CisgICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhBMmRwID0gKEJsdWV0b290aEEyZHApIG1lc3NhZ2Uub2JqOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgLyogU3luY2hyb25vdXMgY2FsbCByZXR1cm5zICovCisgICAgICAgICAgICAgICAgY2FzZSBDTURfUElOR19TVVBQTElDQU5UOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX0VOQUJMRV9ORVRXT1JLOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX0RJU0FCTEVfTkVUV09SSzoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9BRERfT1JfVVBEQVRFX05FVFdPUks6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfUkVNT1ZFX05FVFdPUks6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0FWRV9DT05GSUc6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfV1BTX1BJTl9GUk9NX0RFVklDRToKKyAgICAgICAgICAgICAgICAgICAgbVJlcGx5Q2hhbm5lbC5yZXBseVRvTWVzc2FnZShtZXNzYWdlLCBtZXNzYWdlLndoYXQsIEZBSUxVUkUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9FTkFCTEVfUlNTSV9QT0xMOgorICAgICAgICAgICAgICAgICAgICBtRW5hYmxlUnNzaVBvbGxpbmcgPSAobWVzc2FnZS5hcmcxID09IDEpOworICAgICAgICAgICAgICAgICAgICBtU3VwcGxpY2FudFN0YXRlVHJhY2tlci5zZW5kTWVzc2FnZShDTURfRU5BQkxFX1JTU0lfUE9MTCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAvKiBEaXNjYXJkICovCisgICAgICAgICAgICAgICAgY2FzZSBDTURfTE9BRF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfVU5MT0FEX0RSSVZFUjoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9TVVBQTElDQU5UOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfU1VQUExJQ0FOVDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfQVA6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9BUDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9TQ0FOOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX0RJU0NPTk5FQ1Q6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfUkVDT05ORUNUOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1JFQVNTT0NJQVRFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1JFQ09ORklHVVJFX0lQOgorICAgICAgICAgICAgICAgIGNhc2UgU1VQX0NPTk5FQ1RJT05fRVZFTlQ6CisgICAgICAgICAgICAgICAgY2FzZSBTVVBfRElTQ09OTkVDVElPTl9FVkVOVDoKKyAgICAgICAgICAgICAgICBjYXNlIERSSVZFUl9TVEFSVF9FVkVOVDoKKyAgICAgICAgICAgICAgICBjYXNlIERSSVZFUl9TVE9QX0VWRU5UOgorICAgICAgICAgICAgICAgIGNhc2UgTkVUV09SS19DT05ORUNUSU9OX0VWRU5UOgorICAgICAgICAgICAgICAgIGNhc2UgTkVUV09SS19ESVNDT05ORUNUSU9OX0VWRU5UOgorICAgICAgICAgICAgICAgIGNhc2UgU0NBTl9SRVNVTFRTX0VWRU5UOgorICAgICAgICAgICAgICAgIGNhc2UgU1VQUExJQ0FOVF9TVEFURV9DSEFOR0VfRVZFTlQ6CisgICAgICAgICAgICAgICAgY2FzZSBQQVNTV09SRF9NQVlfQkVfSU5DT1JSRUNUX0VWRU5UOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX0JMQUNLTElTVF9ORVRXT1JLOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX0NMRUFSX0JMQUNLTElTVDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9NT0RFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TQ0FOX1RZUEU6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0hJR0hfUEVSRl9NT0RFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9CTFVFVE9PVEhfQ09FWElTVEVOQ0U6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0JMVUVUT09USF9TQ0FOX01PREU6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX05VTV9BTExPV0VEX0NIQU5ORUxTOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1JFUVVFU1RfQ01fV0FLRUxPQ0s6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfQ09OTkVDVF9ORVRXT1JLOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NBVkVfTkVUV09SSzoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9GT1JHRVRfTkVUV09SSzoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9XUFNfUEJDOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX1dQU19QSU5fRlJPTV9BUDoKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IhIHVuaGFuZGxlZCBtZXNzYWdlIiArIG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBIQU5ETEVEOworICAgICAgICB9CisgICAgfQorCisgICAgY2xhc3MgSW5pdGlhbFN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgLy9UT0RPOiBjb3VsZCBtb3ZlIGxvZ2dpbmcgaW50byBhIGNvbW1vbiBjbGFzcworICAgICAgICBwdWJsaWMgdm9pZCBlbnRlcigpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxu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9hZCBpcyBodW5nLgorICAgICAgICAgICAgICogU2ltaWxhcmx5IGZvciBkcml2ZXIgdW5sb2FkLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBuZXcgVGhyZWFkKG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgIG1XYWtlTG9jay5hY3F1aXJlKCk7CisgICAgICAgICAgICAgICAgICAgIC8vZW5hYmxpbmcgc3RhdGUKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoKG1lc3NhZ2UuYXJnMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXSUZJX1NUQVRFX0VOQUJMSU5HOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFdpZmlTdGF0ZShXSUZJX1NUQVRFX0VOQUJMSU5HKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV0lGSV9BUF9TVEFURV9FTkFCTElORzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRXaWZpQXBTdGF0ZShXSUZJX0FQX1NUQVRFX0VOQUJMSU5HKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmKFdpZmlOYXRpdmUubG9hZERyaXZlcigpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJEcml2ZXIgbG9hZCBzdWNjZXNzZnVsIik7CisgICAgICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShDTURfTE9BRF9EUklWRVJfU1VDQ0VTUyk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsZWQgdG8gbG9hZCBkcml2ZXIhIik7CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2gobWVzc2FnZS5hcmcxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXSUZJX1NUQVRFX0VOQUJMSU5HOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRXaWZpU3RhdGUoV0lGSV9TVEFURV9VTktOT1dOKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXSUZJX0FQX1NUQVRFX0VOQUJMSU5HOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRXaWZpQXBTdGF0ZShXSUZJX0FQX1NUQVRFX0ZBSUxFRCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2UoQ01EX0xPQURfRFJJVkVSX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1XYWtlTG9jay5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSkuc3RhcnQoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgbWVzc2FnZS50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICBzd2l0Y2ggKG1lc3NhZ2Uud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgQ01EX0xPQURfRFJJVkVSX1NVQ0NFU1M6CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRHJpdmVyTG9hZGVkU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9MT0FEX0RSSVZFUl9GQUlMVVJFOgorICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obURyaXZlckZhaWxlZFN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfTE9BRF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfVU5MT0FEX0RSSVZFUjoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9TVVBQTElDQU5UOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfU1VQUExJQ0FOVDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9BUDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX0FQOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX0RSSVZFUjoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX0RSSVZFUjoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9NT0RFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TQ0FOX1RZUEU6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0hJR0hfUEVSRl9NT0RFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9CTFVFVE9PVEhfQ09FWElTVEVOQ0U6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0JMVUVUT09USF9TQ0FOX01PREU6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX05VTV9BTExPV0VEX0NIQU5ORUxTOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX1BBQ0tFVF9GSUxURVJJTkc6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9QQUNLRVRfRklMVEVSSU5HOgorICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UobWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOT1RfSEFORExFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9FVkVOVF9IQU5ETEVELCBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgcmV0dXJuIEhBTkRMRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjbGFzcyBEcml2ZXJMb2FkZWRTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9TVEFURV9DSEFOR0VELCBnZXROYW1lKCkpOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgbWVzc2FnZS50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICBzd2l0Y2gobWVzc2FnZS53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfVU5MT0FEX0RSSVZFUjoKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1Ecml2ZXJVbmxvYWRpbmdTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX1NVUFBMSUNBTlQ6CisgICAgICAgICAgICAgICAgICAgIGlmKFdpZmlOYXRpdmUuc3RhcnRTdXBwbGljYW50KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlN1cHBsaWNhbnQgc3RhcnQgc3VjY2Vzc2Z1bCIpOworICAgICAgICAgICAgICAgICAgICAgICAgbVdpZmlNb25pdG9yLnN0YXJ0TW9uaXRvcmluZygpOworICAgICAgICAgICAgICAgICAgICAgICAgc2V0V2lmaVN0YXRlKFdJRklfU1RBVEVfRU5BQkxFRCk7CisgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obVdhaXRGb3JTdXBTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsZWQgdG8gc3RhcnQgc3VwcGxpY2FudCEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKG9idGFpbk1lc3NhZ2UoQ01EX1VOTE9BRF9EUklWRVIsIFdJRklfU1RBVEVfVU5LTk9XTiwgMCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX0FQOgorICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgbndTZXJ2aWNlLnN0YXJ0QWNjZXNzUG9pbnQoKFdpZmlDb25maWd1cmF0aW9uKSBtZXNzYWdlLm9iaiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbnRlcmZhY2VOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU09GVEFQX0lGQUNFKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXhjZXB0aW9uIGluIHN0YXJ0QWNjZXNzUG9pbnQoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2Uob2J0YWluTWVzc2FnZShDTURfVU5MT0FEX0RSSVZFUiwgV0lGSV9BUF9TVEFURV9GQUlMRUQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlNvZnQgQVAgc3RhcnQgc3VjY2Vzc2Z1bCIpOworICAgICAgICAgICAgICAgICAgICBzZXRXaWZpQXBTdGF0ZShXSUZJX0FQX1NUQVRFX0VOQUJMRUQpOworICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obVNvZnRBcFN0YXJ0ZWRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOT1RfSEFORExFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9FVkVOVF9IQU5ETEVELCBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgcmV0dXJuIEhBTkRMRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjbGFzcyBEcml2ZXJVbmxvYWRpbmdTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9TVEFURV9DSEFOR0VELCBnZXROYW1lKCkpOworCisgICAgICAgICAgICBmaW5hbCBNZXNzYWdlIG1lc3NhZ2UgPSBuZXcgTWVzc2FnZSgpOworICAgICAgICAgICAgbWVzc2FnZS5jb3B5RnJvbShnZXRDdXJyZW50TWVzc2FnZSgpKTsKKyAgICAgICAgICAgIG5ldyBUaHJlYWQobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyBtZXNzYWdlLnRvU3RyaW5nKCkgKyAiXG4iKTsKKyAgICAgICAgICAgICAgICAgICAgbVdha2VMb2NrLmFjcXVpcmUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYoV2lmaU5hdGl2ZS51bmxvYWREcml2ZXIoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiRHJpdmVyIHVubG9hZCBzdWNjZXNzZnVsIik7CisgICAgICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShDTURfVU5MT0FEX0RSSVZFUl9TVUNDRVNTKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoKG1lc3NhZ2UuYXJnMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV0lGSV9TVEFURV9ESVNBQkxFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFdJRklfU1RBVEVfVU5LTk9XTjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0V2lmaVN0YXRlKG1lc3NhZ2UuYXJnMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV0lGSV9BUF9TVEFURV9ESVNBQkxFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFdJRklfQVBfU1RBVEVfRkFJTEVEOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRXaWZpQXBTdGF0ZShtZXNzYWdlLmFyZzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWxlZCB0byB1bmxvYWQgZHJpdmVyISIpOworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2UoQ01EX1VOTE9BRF9EUklWRVJfRkFJTFVSRSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaChtZXNzYWdlLmFyZzEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFdJRklfU1RBVEVfRElTQUJMRUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXSUZJX1NUQVRFX1VOS05PV046CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFdpZmlTdGF0ZShXSUZJX1NUQVRFX1VOS05PV04pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFdJRklfQVBfU1RBVEVfRElTQUJMRUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXSUZJX0FQX1NUQVRFX0ZBSUxFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0V2lmaUFwU3RhdGUoV0lGSV9BUF9TVEFURV9GQUlMRUQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtV2FrZUxvY2sucmVsZWFzZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pLnN0YXJ0KCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArIG1lc3NhZ2UudG9TdHJpbmcoKSArICJcbiIpOworICAgICAgICAgICAgc3dpdGNoIChtZXNzYWdlLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9VTkxPQURfRFJJVkVSX1NVQ0NFU1M6CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRHJpdmVyVW5sb2FkZWRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1VOTE9BRF9EUklWRVJfRkFJTFVSRToKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1Ecml2ZXJGYWlsZWRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX0xPQURfRFJJVkVSOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1VOTE9BRF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfU1VQUExJQ0FOVDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX1NVUFBMSUNBTlQ6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfQVA6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9BUDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fTU9ERToKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9UWVBFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9ISUdIX1BFUkZfTU9ERToKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfQkxVRVRPT1RIX0NPRVhJU1RFTkNFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9CTFVFVE9PVEhfU0NBTl9NT0RFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9OVU1fQUxMT1dFRF9DSEFOTkVMUzoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9QQUNLRVRfRklMVEVSSU5HOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfUEFDS0VUX0ZJTFRFUklORzoKKyAgICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfRVZFTlRfSEFORExFRCwgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICAgIHJldHVybiBIQU5ETEVEOworICAgICAgICB9CisgICAgfQorCisgICAgY2xhc3MgRHJpdmVyVW5sb2FkZWRTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9TVEFURV9DSEFOR0VELCBnZXROYW1lKCkpOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgbWVzc2FnZS50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICBzd2l0Y2ggKG1lc3NhZ2Uud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgQ01EX0xPQURfRFJJVkVSOgorICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obURyaXZlckxvYWRpbmdTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOT1RfSEFORExFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9FVkVOVF9IQU5ETEVELCBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgcmV0dXJuIEhBTkRMRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjbGFzcyBEcml2ZXJGYWlsZWRTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCBnZXROYW1lKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9TVEFURV9DSEFOR0VELCBnZXROYW1lKCkpOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgbWVzc2FnZS50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIGNsYXNzIFdhaXRGb3JTdXBTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9TVEFURV9DSEFOR0VELCBnZXROYW1lKCkpOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgbWVzc2FnZS50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICBzd2l0Y2gobWVzc2FnZS53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBTVVBfQ09OTkVDVElPTl9FVkVOVDoKKyAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiU3VwcGxpY2FudCBjb25uZWN0aW9uIGVzdGFibGlzaGVkIik7CisgICAgICAgICAgICAgICAgICAgIG1TdXBwbGljYW50U3RhdGVUcmFja2VyLnJlc2V0U3VwcGxpY2FudFN0YXRlKCk7CisgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpemUgZGF0YSBzdHJ1Y3R1cmVzICovCisgICAgICAgICAgICAgICAgICAgIG1MYXN0QnNzaWQgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBtTGFzdE5ldHdvcmtJZCA9IC0xOworICAgICAgICAgICAgICAgICAgICBtTGFzdFNpZ25hbExldmVsID0gLTE7CisKKyAgICAgICAgICAgICAgICAgICAgbVdpZmlJbmZvLnNldE1hY0FkZHJlc3MoV2lmaU5hdGl2ZS5nZXRNYWNBZGRyZXNzQ29tbWFuZCgpKTsKKworICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlnU3RvcmUuaW5pdGlhbGl6ZShtQ29udGV4dCk7CisKKyAgICAgICAgICAgICAgICAgICAgLy9UT0RPOiBpbml0aWFsaXplIGFuZCBmaXggbXVsdGljYXN0IGZpbHRlcmluZworICAgICAgICAgICAgICAgICAgICAvL21XTS5pbml0aWFsaXplTXVsdGljYXN0RmlsdGVyaW5nKCk7CisKKyAgICAgICAgICAgICAgICAgICAgY2hlY2tJc0JsdWV0b290aFBsYXlpbmcoKTsKKworICAgICAgICAgICAgICAgICAgICBzZW5kU3VwcGxpY2FudENvbm5lY3Rpb25DaGFuZ2VkQnJvYWRjYXN0KHRydWUpOworICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obURyaXZlclN0YXJ0ZWRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU1VQX0RJU0NPTk5FQ1RJT05fRVZFTlQ6CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWxlZCB0byBzZXR1cCBjb250cm9sIGNoYW5uZWwsIHJlc3RhcnQgc3VwcGxpY2FudCIpOworICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLnN0b3BTdXBwbGljYW50KCk7CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRHJpdmVyTG9hZGVkU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZUF0RnJvbnRPZlF1ZXVlKENNRF9TVEFSVF9TVVBQTElDQU5UKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfTE9BRF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfVU5MT0FEX0RSSVZFUjoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9TVVBQTElDQU5UOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfU1VQUExJQ0FOVDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9BUDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX0FQOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX0RSSVZFUjoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX0RSSVZFUjoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9NT0RFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TQ0FOX1RZUEU6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0hJR0hfUEVSRl9NT0RFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9CTFVFVE9PVEhfQ09FWElTVEVOQ0U6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0JMVUVUT09USF9TQ0FOX01PREU6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX05VTV9BTExPV0VEX0NIQU5ORUxTOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX1BBQ0tFVF9GSUxURVJJTkc6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9QQUNLRVRfRklMVEVSSU5HOgorICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UobWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOT1RfSEFORExFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9FVkVOVF9IQU5ETEVELCBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgcmV0dXJuIEhBTkRMRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjbGFzcyBEcml2ZXJTdXBSZWFkeVN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZW50ZXIoKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArICJcbiIpOworICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX1NUQVRFX0NIQU5HRUQsIGdldE5hbWUoKSk7CisgICAgICAgICAgICAvKiBJbml0aWFsaXplIGZvciBjb25uZWN0IG1vZGUgb3BlcmF0aW9uIGF0IHN0YXJ0ICovCisgICAgICAgICAgICBtSXNTY2FuTW9kZSA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgbWVzc2FnZS50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbiBjb25maWc7CisgICAgICAgICAgICBzd2l0Y2gobWVzc2FnZS53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9TVVBQTElDQU5UOiAgIC8qIFN1cHBsaWNhbnQgc3RvcHBlZCBieSB1c2VyICovCisgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9FVkVOVF9IQU5ETEVELCBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJTdG9wIHN1cHBsaWNhbnQgcmVjZWl2ZWQiKTsKKyAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5jbG9zZVN1cHBsaWNhbnRDb25uZWN0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuc3RvcFN1cHBsaWNhbnQoKTsKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlTmV0d29ya0Rpc2Nvbm5lY3QoKTsKKyAgICAgICAgICAgICAgICAgICAgc2VuZFN1cHBsaWNhbnRDb25uZWN0aW9uQ2hhbmdlZEJyb2FkY2FzdChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIG1TdXBwbGljYW50U3RhdGVUcmFja2VyLnJlc2V0U3VwcGxpY2FudFN0YXRlKCk7CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRHJpdmVyTG9hZGVkU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNVUF9ESVNDT05ORUNUSU9OX0VWRU5UOiAgLyogU3VwcGxpY2FudCBkaWVkICovCisgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9FVkVOVF9IQU5ETEVELCBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJTdXBwbGljYW50IGRpZWQsIHJlc3RhcnRpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5jbG9zZVN1cHBsaWNhbnRDb25uZWN0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIGhhbmRsZU5ldHdvcmtEaXNjb25uZWN0KCk7CisgICAgICAgICAgICAgICAgICAgIHNlbmRTdXBwbGljYW50Q29ubmVjdGlvbkNoYW5nZWRCcm9hZGNhc3QoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBtU3VwcGxpY2FudFN0YXRlVHJhY2tlci5yZXNldFN1cHBsaWNhbnRTdGF0ZSgpOworICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obURyaXZlckxvYWRlZFN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2VBdEZyb250T2ZRdWV1ZShDTURfU1RBUlRfU1VQUExJQ0FOVCk7IC8qIHJlc3RhcnQgKi8KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTQ0FOX1JFU1VMVFNfRVZFTlQ6CisgICAgICAgICAgICAgICAgICAgIHNldFNjYW5SZXN1bHRzKFdpZmlOYXRpdmUuc2NhblJlc3VsdHNDb21tYW5kKCkpOworICAgICAgICAgICAgICAgICAgICBzZW5kU2NhblJlc3VsdHNBdmFpbGFibGVCcm9hZGNhc3QoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfUElOR19TVVBQTElDQU5UOgorICAgICAgICAgICAgICAgICAgICBib29sZWFuIG9rID0gV2lmaU5hdGl2ZS5waW5nQ29tbWFuZCgpOworICAgICAgICAgICAgICAgICAgICBtUmVwbHlDaGFubmVsLnJlcGx5VG9NZXNzYWdlKG1lc3NhZ2UsIG1lc3NhZ2Uud2hhdCwgb2sgPyBTVUNDRVNTIDogRkFJTFVSRSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX0FERF9PUl9VUERBVEVfTkVUV09SSzoKKyAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX0VWRU5UX0hBTkRMRUQsIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IChXaWZpQ29uZmlndXJhdGlvbikgbWVzc2FnZS5vYmo7CisgICAgICAgICAgICAgICAgICAgIG1SZXBseUNoYW5uZWwucmVwbHlUb01lc3NhZ2UobWVzc2FnZSwgQ01EX0FERF9PUl9VUERBVEVfTkVUV09SSywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlnU3RvcmUuYWRkT3JVcGRhdGVOZXR3b3JrKGNvbmZpZykpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9SRU1PVkVfTkVUV09SSzoKKyAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX0VWRU5UX0hBTkRMRUQsIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICAgICAgICAgIG9rID0gV2lmaUNvbmZpZ1N0b3JlLnJlbW92ZU5ldHdvcmsobWVzc2FnZS5hcmcxKTsKKyAgICAgICAgICAgICAgICAgICAgbVJlcGx5Q2hhbm5lbC5yZXBseVRvTWVzc2FnZShtZXNzYWdlLCBtZXNzYWdlLndoYXQsIG9rID8gU1VDQ0VTUyA6IEZBSUxVUkUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9FTkFCTEVfTkVUV09SSzoKKyAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX0VWRU5UX0hBTkRMRUQsIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICAgICAgICAgIG9rID0gV2lmaUNvbmZpZ1N0b3JlLmVuYWJsZU5ldHdvcmsobWVzc2FnZS5hcmcxLCBtZXNzYWdlLmFyZzIgPT0gMSk7CisgICAgICAgICAgICAgICAgICAgIG1SZXBseUNoYW5uZWwucmVwbHlUb01lc3NhZ2UobWVzc2FnZSwgbWVzc2FnZS53aGF0LCBvayA/IFNVQ0NFU1MgOiBGQUlMVVJFKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfRElTQUJMRV9ORVRXT1JLOgorICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfRVZFTlRfSEFORExFRCwgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICAgICAgICAgICAgb2sgPSBXaWZpQ29uZmlnU3RvcmUuZGlzYWJsZU5ldHdvcmsobWVzc2FnZS5hcmcxKTsKKyAgICAgICAgICAgICAgICAgICAgbVJlcGx5Q2hhbm5lbC5yZXBseVRvTWVzc2FnZShtZXNzYWdlLCBtZXNzYWdlLndoYXQsIG9rID8gU1VDQ0VTUyA6IEZBSUxVUkUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9CTEFDS0xJU1RfTkVUV09SSzoKKyAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX0VWRU5UX0hBTkRMRUQsIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuYWRkVG9CbGFja2xpc3RDb21tYW5kKChTdHJpbmcpbWVzc2FnZS5vYmopOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9DTEVBUl9CTEFDS0xJU1Q6CisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuY2xlYXJCbGFja2xpc3RDb21tYW5kKCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NBVkVfQ09ORklHOgorICAgICAgICAgICAgICAgICAgICBvayA9IFdpZmlDb25maWdTdG9yZS5zYXZlQ29uZmlnKCk7CisgICAgICAgICAgICAgICAgICAgIG1SZXBseUNoYW5uZWwucmVwbHlUb01lc3NhZ2UobWVzc2FnZSwgQ01EX1NBVkVfQ09ORklHLCBvayA/IFNVQ0NFU1MgOiBGQUlMVVJFKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBJbmZvcm0gdGhlIGJhY2t1cCBtYW5hZ2VyIGFib3V0IGEgZGF0YSBjaGFuZ2UKKyAgICAgICAgICAgICAgICAgICAgSUJhY2t1cE1hbmFnZXIgaWJtID0gSUJhY2t1cE1hbmFnZXIuU3R1Yi5hc0ludGVyZmFjZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKENvbnRleHQuQkFDS1VQX1NFUlZJQ0UpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlibSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlibS5kYXRhQ2hhbmdlZCgiY29tLmFuZHJvaWQucHJvdmlkZXJzLnNldHRpbmdzIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRyeSBhZ2FpbiBsYXRlcgorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAvKiBDYW5ub3Qgc3RhcnQgc29mdCBBUCB3aGlsZSBpbiBjbGllbnQgbW9kZSAqLworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX0FQOgorICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJGYWlsZWQgdG8gc3RhcnQgc29mdCBBUCB3aXRoIGEgcnVubmluZyBzdXBwbGljYW50Iik7CisgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9FVkVOVF9IQU5ETEVELCBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgICAgICAgICBzZXRXaWZpQXBTdGF0ZShXSUZJX0FQX1NUQVRFX0ZBSUxFRCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TQ0FOX01PREU6CisgICAgICAgICAgICAgICAgICAgIG1Jc1NjYW5Nb2RlID0gKG1lc3NhZ2UuYXJnMSA9PSBTQ0FOX09OTFlfTU9ERSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NBVkVfTkVUV09SSzoKKyAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gKFdpZmlDb25maWd1cmF0aW9uKSBtZXNzYWdlLm9iajsKKyAgICAgICAgICAgICAgICAgICAgV2lmaUNvbmZpZ1N0b3JlLnNhdmVOZXR3b3JrKGNvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX0ZPUkdFVF9ORVRXT1JLOgorICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlnU3RvcmUuZm9yZ2V0TmV0d29yayhtZXNzYWdlLmFyZzEpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gSEFORExFRDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGNsYXNzIERyaXZlclN0YXJ0aW5nU3RhdGUgZXh0ZW5kcyBIaWVyYXJjaGljYWxTdGF0ZSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBlbnRlcigpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfU1RBVEVfQ0hBTkdFRCwgZ2V0TmFtZSgpKTsKKyAgICAgICAgfQorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArIG1lc3NhZ2UudG9TdHJpbmcoKSArICJcbiIpOworICAgICAgICAgICAgc3dpdGNoKG1lc3NhZ2Uud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgRFJJVkVSX1NUQVJUX0VWRU5UOgorICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obURyaXZlclN0YXJ0ZWRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAvKiBRdWV1ZSBkcml2ZXIgY29tbWFuZHMgJiBjb25uZWN0aW9uIGV2ZW50cyAqLworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX0RSSVZFUjoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX0RSSVZFUjoKKyAgICAgICAgICAgICAgICBjYXNlIFNVUFBMSUNBTlRfU1RBVEVfQ0hBTkdFX0VWRU5UOgorICAgICAgICAgICAgICAgIGNhc2UgTkVUV09SS19DT05ORUNUSU9OX0VWRU5UOgorICAgICAgICAgICAgICAgIGNhc2UgTkVUV09SS19ESVNDT05ORUNUSU9OX0VWRU5UOgorICAgICAgICAgICAgICAgIGNhc2UgUEFTU1dPUkRfTUFZX0JFX0lOQ09SUkVDVF9FVkVOVDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9UWVBFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9ISUdIX1BFUkZfTU9ERToKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfQkxVRVRPT1RIX0NPRVhJU1RFTkNFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9CTFVFVE9PVEhfU0NBTl9NT0RFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9OVU1fQUxMT1dFRF9DSEFOTkVMUzoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9QQUNLRVRfRklMVEVSSU5HOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfUEFDS0VUX0ZJTFRFUklORzoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9TQ0FOOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX0RJU0NPTk5FQ1Q6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfUkVBU1NPQ0lBVEU6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfUkVDT05ORUNUOgorICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UobWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOT1RfSEFORExFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9FVkVOVF9IQU5ETEVELCBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgcmV0dXJuIEhBTkRMRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjbGFzcyBEcml2ZXJTdGFydGVkU3RhdGUgZXh0ZW5kcyBIaWVyYXJjaGljYWxTdGF0ZSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBlbnRlcigpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfU1RBVEVfQ0hBTkdFRCwgZ2V0TmFtZSgpKTsKKworICAgICAgICAgICAgbUlzUnVubmluZyA9IHRydWU7CisgICAgICAgICAgICB1cGRhdGVCYXR0ZXJ5V29ya1NvdXJjZShudWxsKTsKKworICAgICAgICAgICAgLyogSW5pdGlhbGl6ZSBjaGFubmVsIGNvdW50ICovCisgICAgICAgICAgICBzZXROdW1BbGxvd2VkQ2hhbm5lbHMoKTsKKworICAgICAgICAgICAgaWYgKG1Jc1NjYW5Nb2RlKSB7CisgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5zZXRTY2FuUmVzdWx0SGFuZGxpbmdDb21tYW5kKFNDQU5fT05MWV9NT0RFKTsKKyAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLmRpc2Nvbm5lY3RDb21tYW5kKCk7CisgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1TY2FuTW9kZVN0YXRlKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5zZXRTY2FuUmVzdWx0SGFuZGxpbmdDb21tYW5kKENPTk5FQ1RfTU9ERSk7CisgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5yZWNvbm5lY3RDb21tYW5kKCk7CisgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1Db25uZWN0TW9kZVN0YXRlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArIG1lc3NhZ2UudG9TdHJpbmcoKSArICJcbiIpOworICAgICAgICAgICAgc3dpdGNoKG1lc3NhZ2Uud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TQ0FOX1RZUEU6CisgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmFyZzEgPT0gU0NBTl9BQ1RJVkUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuc2V0U2Nhbk1vZGVDb21tYW5kKHRydWUpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5zZXRTY2FuTW9kZUNvbW1hbmQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9ISUdIX1BFUkZfTU9ERToKKyAgICAgICAgICAgICAgICAgICAgc2V0SGlnaFBlcmZNb2RlRW5hYmxlZE5hdGl2ZShtZXNzYWdlLmFyZzEgPT0gMSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9CTFVFVE9PVEhfQ09FWElTVEVOQ0U6CisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuc2V0Qmx1ZXRvb3RoQ29leGlzdGVuY2VNb2RlQ29tbWFuZChtZXNzYWdlLmFyZzEpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfQkxVRVRPT1RIX1NDQU5fTU9ERToKKyAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5zZXRCbHVldG9vdGhDb2V4aXN0ZW5jZVNjYW5Nb2RlQ29tbWFuZChtZXNzYWdlLmFyZzEgPT0gMSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9OVU1fQUxMT1dFRF9DSEFOTkVMUzoKKyAgICAgICAgICAgICAgICAgICAgbU51bUFsbG93ZWRDaGFubmVscyA9IG1lc3NhZ2UuYXJnMTsKKyAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5zZXROdW1BbGxvd2VkQ2hhbm5lbHNDb21tYW5kKG1lc3NhZ2UuYXJnMSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfRFJJVkVSOgorICAgICAgICAgICAgICAgICAgICBtV2FrZUxvY2suYWNxdWlyZSgpOworICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLnN0b3BEcml2ZXJDb21tYW5kKCk7CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRHJpdmVyU3RvcHBpbmdTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIG1XYWtlTG9jay5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1JFUVVFU1RfQ01fV0FLRUxPQ0s6CisgICAgICAgICAgICAgICAgICAgIGlmIChtQ20gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUNtID0gKENvbm5lY3Rpdml0eU1hbmFnZXIpbUNvbnRleHQuZ2V0U3lzdGVtU2VydmljZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29udGV4dC5DT05ORUNUSVZJVFlfU0VSVklDRSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbUNtLnJlcXVlc3ROZXR3b3JrVHJhbnNpdGlvbldha2Vsb2NrKFRBRyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX1BBQ0tFVF9GSUxURVJJTkc6CisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuc3RhcnRQYWNrZXRGaWx0ZXJpbmcoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9QQUNLRVRfRklMVEVSSU5HOgorICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLnN0b3BQYWNrZXRGaWx0ZXJpbmcoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5PVF9IQU5ETEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX0VWRU5UX0hBTkRMRUQsIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICByZXR1cm4gSEFORExFRDsKKyAgICAgICAgfQorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZXhpdCgpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICBtSXNSdW5uaW5nID0gZmFsc2U7CisgICAgICAgICAgICB1cGRhdGVCYXR0ZXJ5V29ya1NvdXJjZShudWxsKTsKKyAgICAgICAgICAgIG1TY2FuUmVzdWx0cyA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjbGFzcyBEcml2ZXJTdG9wcGluZ1N0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZW50ZXIoKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArICJcbiIpOworICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX1NUQVRFX0NIQU5HRUQsIGdldE5hbWUoKSk7CisgICAgICAgIH0KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIHByb2Nlc3NNZXNzYWdlKE1lc3NhZ2UgbWVzc2FnZSkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyBtZXNzYWdlLnRvU3RyaW5nKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIHN3aXRjaChtZXNzYWdlLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIERSSVZFUl9TVE9QX0VWRU5UOgorICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obURyaXZlclN0b3BwZWRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAvKiBRdWV1ZSBkcml2ZXIgY29tbWFuZHMgKi8KKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9EUklWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fVFlQRToKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfSElHSF9QRVJGX01PREU6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0JMVUVUT09USF9DT0VYSVNURU5DRToKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfQkxVRVRPT1RIX1NDQU5fTU9ERToKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfTlVNX0FMTE9XRURfQ0hBTk5FTFM6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfUEFDS0VUX0ZJTFRFUklORzoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX1BBQ0tFVF9GSUxURVJJTkc6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfU0NBTjoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9ESVNDT05ORUNUOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1JFQVNTT0NJQVRFOgorICAgICAgICAgICAgICAgIGNhc2UgQ01EX1JFQ09OTkVDVDoKKyAgICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfRVZFTlRfSEFORExFRCwgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICAgIHJldHVybiBIQU5ETEVEOworICAgICAgICB9CisgICAgfQorCisgICAgY2xhc3MgRHJpdmVyU3RvcHBlZFN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZW50ZXIoKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArICJcbiIpOworICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX1NUQVRFX0NIQU5HRUQsIGdldE5hbWUoKSk7CisgICAgICAgIH0KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIHByb2Nlc3NNZXNzYWdlKE1lc3NhZ2UgbWVzc2FnZSkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyBtZXNzYWdlLnRvU3RyaW5nKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIHN3aXRjaCAobWVzc2FnZS53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfRFJJVkVSOgorICAgICAgICAgICAgICAgICAgICBtV2FrZUxvY2suYWNxdWlyZSgpOworICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLnN0YXJ0RHJpdmVyQ29tbWFuZCgpOworICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obURyaXZlclN0YXJ0aW5nU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBtV2FrZUxvY2sucmVsZWFzZSgpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfRVZFTlRfSEFORExFRCwgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICAgIHJldHVybiBIQU5ETEVEOworICAgICAgICB9CisgICAgfQorCisgICAgY2xhc3MgU2Nhbk1vZGVTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9TVEFURV9DSEFOR0VELCBnZXROYW1lKCkpOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgbWVzc2FnZS50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICBzd2l0Y2gobWVzc2FnZS53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fTU9ERToKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuYXJnMSA9PSBTQ0FOX09OTFlfTU9ERSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogSWdub3JlICovCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSEFORExFRDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuc2V0U2NhblJlc3VsdEhhbmRsaW5nQ29tbWFuZChtZXNzYWdlLmFyZzEpOworICAgICAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5yZWNvbm5lY3RDb21tYW5kKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtSXNTY2FuTW9kZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1EaXNjb25uZWN0ZWRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfU0NBTjoKKyAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5zY2FuQ29tbWFuZChtZXNzYWdlLmFyZzEgPT0gU0NBTl9BQ1RJVkUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgLyogSWdub3JlICovCisgICAgICAgICAgICAgICAgY2FzZSBDTURfRElTQ09OTkVDVDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9SRUNPTk5FQ1Q6CisgICAgICAgICAgICAgICAgY2FzZSBDTURfUkVBU1NPQ0lBVEU6CisgICAgICAgICAgICAgICAgY2FzZSBTVVBQTElDQU5UX1NUQVRFX0NIQU5HRV9FVkVOVDoKKyAgICAgICAgICAgICAgICBjYXNlIE5FVFdPUktfQ09OTkVDVElPTl9FVkVOVDoKKyAgICAgICAgICAgICAgICBjYXNlIE5FVFdPUktfRElTQ09OTkVDVElPTl9FVkVOVDoKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5PVF9IQU5ETEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX0VWRU5UX0hBTkRMRUQsIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICByZXR1cm4gSEFORExFRDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGNsYXNzIENvbm5lY3RNb2RlU3RhdGUgZXh0ZW5kcyBIaWVyYXJjaGljYWxTdGF0ZSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBlbnRlcigpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfU1RBVEVfQ0hBTkdFRCwgZ2V0TmFtZSgpKTsKKyAgICAgICAgfQorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArIG1lc3NhZ2UudG9TdHJpbmcoKSArICJcbiIpOworICAgICAgICAgICAgU3RhdGVDaGFuZ2VSZXN1bHQgc3RhdGVDaGFuZ2VSZXN1bHQ7CisgICAgICAgICAgICBzd2l0Y2gobWVzc2FnZS53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBQQVNTV09SRF9NQVlfQkVfSU5DT1JSRUNUX0VWRU5UOgorICAgICAgICAgICAgICAgICAgICBtUGFzc3dvcmRLZXlNYXlCZUluY29ycmVjdCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU1VQUExJQ0FOVF9TVEFURV9DSEFOR0VfRVZFTlQ6CisgICAgICAgICAgICAgICAgICAgIHN0YXRlQ2hhbmdlUmVzdWx0ID0gKFN0YXRlQ2hhbmdlUmVzdWx0KSBtZXNzYWdlLm9iajsKKyAgICAgICAgICAgICAgICAgICAgbVN1cHBsaWNhbnRTdGF0ZVRyYWNrZXIuaGFuZGxlRXZlbnQoc3RhdGVDaGFuZ2VSZXN1bHQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9TQ0FOOgorICAgICAgICAgICAgICAgICAgICAvKiBXZSBuZWVkIHRvIHNldCBzY2FuIHR5cGUgaW4gY29tcGxldGVkIHN0YXRlICovCisgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgbmV3TXNnID0gb2J0YWluTWVzc2FnZSgpOworICAgICAgICAgICAgICAgICAgICBuZXdNc2cuY29weUZyb20obWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICAgIG1TdXBwbGljYW50U3RhdGVUcmFja2VyLnNlbmRNZXNzYWdlKG5ld01zZyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAvKiBEbyBhIHJlZHVuZGFudCBkaXNjb25uZWN0IHdpdGhvdXQgdHJhbnNpdGlvbiAqLworICAgICAgICAgICAgICAgIGNhc2UgQ01EX0RJU0NPTk5FQ1Q6CisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuZGlzY29ubmVjdENvbW1hbmQoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfUkVDT05ORUNUOgorICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLnJlY29ubmVjdENvbW1hbmQoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfUkVBU1NPQ0lBVEU6CisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUucmVhc3NvY2lhdGVDb21tYW5kKCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX0NPTk5FQ1RfTkVUV09SSzoKKyAgICAgICAgICAgICAgICAgICAgaW50IG5ldElkID0gbWVzc2FnZS5hcmcxOworICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlndXJhdGlvbiBjb25maWcgPSAoV2lmaUNvbmZpZ3VyYXRpb24pIG1lc3NhZ2Uub2JqOworCisgICAgICAgICAgICAgICAgICAgIC8qIFdlIGNvbm5lY3QgdG8gYSBzcGVjaWZpYyBuZXR3b3JrIGJ5IGlzc3VpbmcgYSBzZWxlY3QKKyAgICAgICAgICAgICAgICAgICAgICogdG8gdGhlIFdpZmlDb25maWdTdG9yZS4gVGhpcyBlbmFibGVzIHRoZSBuZXR3b3JrLAorICAgICAgICAgICAgICAgICAgICAgKiB3aGlsZSBkaXNhYmxpbmcgYWxsIG90aGVyIG5ldHdvcmtzIGluIHRoZSBzdXBwbGljYW50LgorICAgICAgICAgICAgICAgICAgICAgKiBEaXNhYmxpbmcgYSBjb25uZWN0ZWQgbmV0d29yayB3aWxsIGNhdXNlIGEgZGlzY29ubmVjdGlvbgorICAgICAgICAgICAgICAgICAgICAgKiBmcm9tIHRoZSBuZXR3b3JrLiBBIHJlY29ubmVjdENvbW1hbmQoKSB3aWxsIHRoZW4gaW5pdGlhdGUKKyAgICAgICAgICAgICAgICAgICAgICogYSBjb25uZWN0aW9uIHRvIHRoZSBlbmFibGVkIG5ldHdvcmsuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWdTdG9yZS5zZWxlY3ROZXR3b3JrKGNvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlnU3RvcmUuc2VsZWN0TmV0d29yayhuZXRJZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvKiBTYXZlIGEgZmxhZyB0byBpbmRpY2F0ZSB0aGF0IHdlIG5lZWQgdG8gZW5hYmxlIGFsbAorICAgICAgICAgICAgICAgICAgICAgKiBuZXR3b3JrcyBhZnRlciBzdXBwbGljYW50IGluZGljYXRlcyBhIG5ldHdvcmsKKyAgICAgICAgICAgICAgICAgICAgICogc3RhdGUgY2hhbmdlIGV2ZW50CisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBtRW5hYmxlQWxsTmV0d29ya3MgPSB0cnVlOworCisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUucmVjb25uZWN0Q29tbWFuZCgpOworCisgICAgICAgICAgICAgICAgICAgIC8qIEV4cGVjdCBhIGRpc2Nvbm5lY3Rpb24gZnJvbSB0aGUgb2xkIGNvbm5lY3Rpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1EaXNjb25uZWN0aW5nU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9XUFNfUEJDOgorICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYnNzaWQgPSAoU3RyaW5nKSBtZXNzYWdlLm9iajsKKyAgICAgICAgICAgICAgICAgICAgLyogV1BTIHB1c2ggYnV0dG9uIGNvbmZpZ3VyYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBzdWNjZXNzID0gV2lmaUNvbmZpZ1N0b3JlLnN0YXJ0V3BzUGJjKGJzc2lkKTsKKworICAgICAgICAgICAgICAgICAgICAvKiBEdXJpbmcgV1BTIHNldHVwLCBhbGwgb3RoZXIgbmV0d29ya3MgYXJlIGRpc2FibGVkLiBBZnRlcgorICAgICAgICAgICAgICAgICAgICAgKiBhIHN1Y2Nlc3NmdWwgY29ubmVjdCBhIG5ldyBjb25maWcgaXMgY3JlYXRlZCBpbiB0aGUgc3VwcGxpY2FudC4KKyAgICAgICAgICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAgICAgICAgICogV2UgbmVlZCB0byBlbmFibGUgYWxsIG5ldHdvcmtzIGFmdGVyIGEgc3VjY2Vzc2Z1bCBjb25uZWN0aW9uCisgICAgICAgICAgICAgICAgICAgICAqIG9yIHdoZW4gc3VwcGxpY2FudCBnb2VzIGluYWN0aXZlIGR1ZSB0byBmYWlsdXJlLiBFbmFibGluZyBhbGwKKyAgICAgICAgICAgICAgICAgICAgICogbmV0d29ya3MgYWZ0ZXIgYSBkaXNjb25uZWN0IGlzIG9ic2VydmVkIGFzIGRvbmUgd2l0aCBjb25uZWN0TmV0d29yaworICAgICAgICAgICAgICAgICAgICAgKiBkb2VzIG5vdCBsZWFkIHRvIGEgc3VjY2Vzc2Z1bCBXUFMgc2V0dXAuCisgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAqIFVwb24gc3VjY2VzcywgdGhlIGNvbmZpZ3VyYXRpb24gbGlzdCBuZWVkcyB0byBiZSByZWxvYWRlZAorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHN1Y2Nlc3MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XcHNTdGFydGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIEV4cGVjdCBhIGRpc2Nvbm5lY3Rpb24gZnJvbSB0aGUgb2xkIGNvbm5lY3Rpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRGlzY29ubmVjdGluZ1N0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9XUFNfUElOX0ZST01fQVA6CisgICAgICAgICAgICAgICAgICAgIGJzc2lkID0gKFN0cmluZykgbWVzc2FnZS5vYmo7CisgICAgICAgICAgICAgICAgICAgIGludCBhcFBpbiA9IG1lc3NhZ2UuYXJnMTsKKworICAgICAgICAgICAgICAgICAgICAvKiBXUFMgcGluIGZyb20gYWNjZXNzIHBvaW50ICovCisgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSBXaWZpQ29uZmlnU3RvcmUuc3RhcnRXcHNXaXRoUGluRnJvbUFjY2Vzc1BvaW50KGJzc2lkLCBhcFBpbik7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHN1Y2Nlc3MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XcHNTdGFydGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIEV4cGVjdCBhIGRpc2Nvbm5lY3Rpb24gZnJvbSB0aGUgb2xkIGNvbm5lY3Rpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRGlzY29ubmVjdGluZ1N0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9XUFNfUElOX0ZST01fREVWSUNFOgorICAgICAgICAgICAgICAgICAgICBic3NpZCA9IChTdHJpbmcpIG1lc3NhZ2Uub2JqOworICAgICAgICAgICAgICAgICAgICBpbnQgcGluID0gV2lmaUNvbmZpZ1N0b3JlLnN0YXJ0V3BzV2l0aFBpbkZyb21EZXZpY2UoYnNzaWQpOworICAgICAgICAgICAgICAgICAgICBzdWNjZXNzID0gKHBpbiAhPSBGQUlMVVJFKTsKKyAgICAgICAgICAgICAgICAgICAgbVJlcGx5Q2hhbm5lbC5yZXBseVRvTWVzc2FnZShtZXNzYWdlLCBDTURfU1RBUlRfV1BTX1BJTl9GUk9NX0RFVklDRSwgcGluKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoc3VjY2VzcykgeworICAgICAgICAgICAgICAgICAgICAgICAgbVdwc1N0YXJ0ZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgLyogRXhwZWN0IGEgZGlzY29ubmVjdGlvbiBmcm9tIHRoZSBvbGQgY29ubmVjdGlvbiAqLworICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1EaXNjb25uZWN0aW5nU3RhdGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU0NBTl9SRVNVTFRTX0VWRU5UOgorICAgICAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIHNjYW4gc2V0dGluZyBiYWNrIHRvICJjb25uZWN0IiBtb2RlICovCisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuc2V0U2NhblJlc3VsdEhhbmRsaW5nQ29tbWFuZChDT05ORUNUX01PREUpOworICAgICAgICAgICAgICAgICAgICAvKiBIYW5kbGUgc2NhbiByZXN1bHRzICovCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOT1RfSEFORExFRDsKKyAgICAgICAgICAgICAgICBjYXNlIE5FVFdPUktfQ09OTkVDVElPTl9FVkVOVDoKKyAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCJOZXR3b3JrIGNvbm5lY3Rpb24gZXN0YWJsaXNoZWQiKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdGVDaGFuZ2VSZXN1bHQgPSAoU3RhdGVDaGFuZ2VSZXN1bHQpIG1lc3NhZ2Uub2JqOworCisgICAgICAgICAgICAgICAgICAgIC8vVE9ETzogbWFrZSBzdXBwbGljYW50IG1vZGlmaWNhdGlvbiB0byBwdXNoIHRoaXMgaW4gZXZlbnRzCisgICAgICAgICAgICAgICAgICAgIG1XaWZpSW5mby5zZXRTU0lEKGZldGNoU1NJRCgpKTsKKyAgICAgICAgICAgICAgICAgICAgbVdpZmlJbmZvLnNldEJTU0lEKG1MYXN0QnNzaWQgPSBzdGF0ZUNoYW5nZVJlc3VsdC5CU1NJRCk7CisgICAgICAgICAgICAgICAgICAgIG1XaWZpSW5mby5zZXROZXR3b3JrSWQoc3RhdGVDaGFuZ2VSZXN1bHQubmV0d29ya0lkKTsKKyAgICAgICAgICAgICAgICAgICAgbUxhc3ROZXR3b3JrSWQgPSBzdGF0ZUNoYW5nZVJlc3VsdC5uZXR3b3JrSWQ7CisgICAgICAgICAgICAgICAgICAgIC8qIHNlbmQgZXZlbnQgdG8gQ00gJiBuZXR3b3JrIGNoYW5nZSBicm9hZGNhc3QgKi8KKyAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLk9CVEFJTklOR19JUEFERFIpOworICAgICAgICAgICAgICAgICAgICBzZW5kTmV0d29ya1N0YXRlQ2hhbmdlQnJvYWRjYXN0KG1MYXN0QnNzaWQpOworICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obUNvbm5lY3RpbmdTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgTkVUV09SS19ESVNDT05ORUNUSU9OX0VWRU5UOgorICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsIk5ldHdvcmsgY29ubmVjdGlvbiBsb3N0Iik7CisgICAgICAgICAgICAgICAgICAgIGhhbmRsZU5ldHdvcmtEaXNjb25uZWN0KCk7CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRGlzY29ubmVjdGVkU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfRVZFTlRfSEFORExFRCwgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICAgIHJldHVybiBIQU5ETEVEOworICAgICAgICB9CisgICAgfQorCisgICAgY2xhc3MgQ29ubmVjdGluZ1N0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICBib29sZWFuIG1Nb2RpZmllZEJsdWV0b290aENvZXhpc3RlbmNlTW9kZTsKKyAgICAgICAgaW50IG1Qb3dlck1vZGU7CisgICAgICAgIGJvb2xlYW4gbVVzZVN0YXRpY0lwOworICAgICAgICBUaHJlYWQgbURoY3BUaHJlYWQ7CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9TVEFURV9DSEFOR0VELCBnZXROYW1lKCkpOworCisgICAgICAgICAgICBtVXNlU3RhdGljSXAgPSBXaWZpQ29uZmlnU3RvcmUuaXNVc2luZ1N0YXRpY0lwKG1MYXN0TmV0d29ya0lkKTsKKyAgICAgICAgICAgIGlmICghbVVzZVN0YXRpY0lwKSB7CisgICAgICAgICAgICAgICAgbURoY3BUaHJlYWQgPSBudWxsOworICAgICAgICAgICAgICAgIG1Nb2RpZmllZEJsdWV0b290aENvZXhpc3RlbmNlTW9kZSA9IGZhbHNlOworICAgICAgICAgICAgICAgIG1Qb3dlck1vZGUgPSBQT1dFUl9NT0RFX0FVVE87CisKKyAgICAgICAgICAgICAgICBpZiAoc2hvdWxkRGlzYWJsZUNvZXhpc3RlbmNlTW9kZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAqIFRoZXJlIGFyZSBwcm9ibGVtcyBzZXR0aW5nIHRoZSBXaS1GaSBkcml2ZXIncyBwb3dlcgorICAgICAgICAgICAgICAgICAgICAgKiBtb2RlIHRvIGFjdGl2ZSB3aGVuIGJsdWV0b290aCBjb2V4aXN0ZW5jZSBtb2RlIGlzCisgICAgICAgICAgICAgICAgICAgICAqIGVuYWJsZWQgb3Igc2Vuc2UuCisgICAgICAgICAgICAgICAgICAgICAqIDxwPgorICAgICAgICAgICAgICAgICAgICAgKiBXZSBzZXQgV2ktRmkgdG8gYWN0aXZlIG1vZGUgd2hlbgorICAgICAgICAgICAgICAgICAgICAgKiBvYnRhaW5pbmcgYW4gSVAgYWRkcmVzcyBiZWNhdXNlIHdlJ3ZlIGZvdW5kCisgICAgICAgICAgICAgICAgICAgICAqIGNvbXBhdGliaWxpdHkgaXNzdWVzIHdpdGggc29tZSByb3V0ZXJzIHdpdGggbG93IHBvd2VyCisgICAgICAgICAgICAgICAgICAgICAqIG1vZGUuCisgICAgICAgICAgICAgICAgICAgICAqIDxwPgorICAgICAgICAgICAgICAgICAgICAgKiBJbiBvcmRlciBmb3IgdGhpcyBhY3RpdmUgcG93ZXIgbW9kZSB0byBwcm9wZXJseSBiZSBzZXQsCisgICAgICAgICAgICAgICAgICAgICAqIHdlIGRpc2FibGUgY29leGlzdGVuY2UgbW9kZSB1bnRpbCB3ZSdyZSBkb25lIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICogb2J0YWluaW5nIGFuIElQIGFkZHJlc3MuICBPbmUgZXhjZXB0aW9uIGlzIGlmIHdlCisgICAgICAgICAgICAgICAgICAgICAqIGFyZSBjdXJyZW50bHkgY29ubmVjdGVkIHRvIGEgaGVhZHNldCwgc2luY2UgZGlzYWJsaW5nCisgICAgICAgICAgICAgICAgICAgICAqIGNvZXhpc3RlbmNlIHdvdWxkIGludGVycnVwdCB0aGF0IGNvbm5lY3Rpb24uCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBtTW9kaWZpZWRCbHVldG9vdGhDb2V4aXN0ZW5jZU1vZGUgPSB0cnVlOworCisgICAgICAgICAgICAgICAgICAgIC8vIERpc2FibGUgdGhlIGNvZXhpc3RlbmNlIG1vZGUKKyAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5zZXRCbHVldG9vdGhDb2V4aXN0ZW5jZU1vZGVDb21tYW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuQkxVRVRPT1RIX0NPRVhJU1RFTkNFX01PREVfRElTQUJMRUQpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIG1Qb3dlck1vZGUgPSAgV2lmaU5hdGl2ZS5nZXRQb3dlck1vZGVDb21tYW5kKCk7CisgICAgICAgICAgICAgICAgaWYgKG1Qb3dlck1vZGUgPCAwKSB7CisgICAgICAgICAgICAgICAgICAvLyBIYW5kbGUgdGhlIGNhc2Ugd2hlcmUgc3VwcGxpY2FudCBkcml2ZXIgZG9lcyBub3Qgc3VwcG9ydAorICAgICAgICAgICAgICAgICAgLy8gZ2V0UG93ZXJNb2RlQ29tbWFuZC4KKyAgICAgICAgICAgICAgICAgICAgbVBvd2VyTW9kZSA9IFBPV0VSX01PREVfQVVUTzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1Qb3dlck1vZGUgIT0gUE9XRVJfTU9ERV9BQ1RJVkUpIHsKKyAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5zZXRQb3dlck1vZGVDb21tYW5kKFBPV0VSX01PREVfQUNUSVZFKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJESENQIHJlcXVlc3Qgc3RhcnRlZCIpOworICAgICAgICAgICAgICAgIG1EaGNwVGhyZWFkID0gbmV3IFRocmVhZChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIERoY3BJbmZvIGRoY3BJbmZvID0gbmV3IERoY3BJbmZvKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTmV0d29ya1V0aWxzLnJ1bkRoY3AobUludGVyZmFjZU5hbWUsIGRoY3BJbmZvKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIkRIQ1AgcmVxdWVzdCBzdWNjZWVkZWQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1EaGNwSW5mbykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGhjcEluZm8gPSBkaGNwSW5mbzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2UoQ01EX0lQX0NPTkZJR19TVUNDRVNTKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiREhDUCByZXF1ZXN0IGZhaWxlZDogIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrVXRpbHMuZ2V0RGhjcEVycm9yKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKENNRF9JUF9DT05GSUdfRkFJTFVSRSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICBtRGhjcFRocmVhZC5zdGFydCgpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBEaGNwSW5mbyBkaGNwSW5mbyA9IFdpZmlDb25maWdTdG9yZS5nZXRJcENvbmZpZ3VyYXRpb24obUxhc3ROZXR3b3JrSWQpOworICAgICAgICAgICAgICAgIGlmIChOZXR3b3JrVXRpbHMuY29uZmlndXJlSW50ZXJmYWNlKG1JbnRlcmZhY2VOYW1lLCBkaGNwSW5mbykpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiU3RhdGljIElQIGNvbmZpZ3VyYXRpb24gc3VjY2VlZGVkIik7CisgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobURoY3BJbmZvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtRGhjcEluZm8gPSBkaGNwSW5mbzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShDTURfSVBfQ09ORklHX1NVQ0NFU1MpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIlN0YXRpYyBJUCBjb25maWd1cmF0aW9uIGZhaWxlZCIpOworICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShDTURfSVBfQ09ORklHX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgIEBPdmVycmlkZQorICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyBtZXNzYWdlLnRvU3RyaW5nKCkgKyAiXG4iKTsKKworICAgICAgICAgIHN3aXRjaChtZXNzYWdlLndoYXQpIHsKKyAgICAgICAgICAgICAgY2FzZSBDTURfSVBfQ09ORklHX1NVQ0NFU1M6CisgICAgICAgICAgICAgICAgICBtTGFzdFNpZ25hbExldmVsID0gLTE7IC8vIGZvcmNlIHVwZGF0ZSBvZiBzaWduYWwgc3RyZW5ndGgKKyAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobURoY3BJbmZvKSB7CisgICAgICAgICAgICAgICAgICAgICAgbVdpZmlJbmZvLnNldElwQWRkcmVzcyhtRGhjcEluZm8uaXBBZGRyZXNzKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyZUxpbmtQcm9wZXJ0aWVzKCk7CisgICAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuQ09OTkVDVEVEKTsKKyAgICAgICAgICAgICAgICAgIHNlbmROZXR3b3JrU3RhdGVDaGFuZ2VCcm9hZGNhc3QobUxhc3RCc3NpZCk7CisgICAgICAgICAgICAgICAgICAvL1RPRE86IFRoZSBmcmFtZXdvcmsgaXMgbm90IGRldGVjdGluZyBhIERIQ1AgcmVuZXdhbCBhbmQgYSBwb3NzaWJsZQorICAgICAgICAgICAgICAgICAgLy9JUCBjaGFuZ2UuIHdlIHNob3VsZCBkZXRlY3QgdGhpcyBhbmQgc2VuZCBvdXQgYSBjb25maWcgY2hhbmdlIGJyb2FkY2FzdAorICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1Db25uZWN0ZWRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBDTURfSVBfQ09ORklHX0ZBSUxVUkU6CisgICAgICAgICAgICAgICAgICBtV2lmaUluZm8uc2V0SXBBZGRyZXNzKDApOworCisgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJJUCBjb25maWd1cmF0aW9uIGZhaWxlZCIpOworICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgKiBJZiB3ZSd2ZSBleGNlZWRlZCB0aGUgbWF4aW11bSBudW1iZXIgb2YgcmV0cmllcyBmb3IgREhDUAorICAgICAgICAgICAgICAgICAgICogdG8gYSBnaXZlbiBuZXR3b3JrLCBkaXNhYmxlIHRoZSBuZXR3b3JrCisgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgIGlmICgrK21SZWNvbm5lY3RDb3VudCA+IGdldE1heERoY3BSZXRyaWVzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsZWQgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVjb25uZWN0Q291bnQgKyAiIHRpbWVzLCBEaXNhYmxpbmcgIiArIG1MYXN0TmV0d29ya0lkKTsKKyAgICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlnU3RvcmUuZGlzYWJsZU5ldHdvcmsobUxhc3ROZXR3b3JrSWQpOworICAgICAgICAgICAgICAgICAgICAgIG1SZWNvbm5lY3RDb3VudCA9IDA7CisgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgIC8qIERIQ1AgdGltZXMgb3V0IGFmdGVyIGFib3V0IDMwIHNlY29uZHMsIHdlIGRvIGEKKyAgICAgICAgICAgICAgICAgICAqIGRpc2Nvbm5lY3QgYW5kIGFuIGltbWVkaWF0ZSByZWNvbm5lY3QgdG8gdHJ5IGFnYWluCisgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuZGlzY29ubmVjdENvbW1hbmQoKTsKKyAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUucmVjb25uZWN0Q29tbWFuZCgpOworICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1EaXNjb25uZWN0aW5nU3RhdGUpOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgQ01EX0RJU0NPTk5FQ1Q6CisgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLmRpc2Nvbm5lY3RDb21tYW5kKCk7CisgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obURpc2Nvbm5lY3RpbmdTdGF0ZSk7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgIC8qIElnbm9yZSBjb25uZWN0aW9uIHRvIHNhbWUgbmV0d29yayAqLworICAgICAgICAgICAgICBjYXNlIENNRF9DT05ORUNUX05FVFdPUks6CisgICAgICAgICAgICAgICAgICBpbnQgbmV0SWQgPSBtZXNzYWdlLmFyZzE7CisgICAgICAgICAgICAgICAgICBpZiAobVdpZmlJbmZvLmdldE5ldHdvcmtJZCgpID09IG5ldElkKSB7CisgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgICAgICAgICAvKiBJZ25vcmUgKi8KKyAgICAgICAgICAgICAgY2FzZSBORVRXT1JLX0NPTk5FQ1RJT05fRVZFTlQ6CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9EUklWRVI6CisgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShDTURfRElTQ09OTkVDVCk7CisgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UobWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fTU9ERToKKyAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmFyZzEgPT0gU0NBTl9PTkxZX01PREUpIHsKKyAgICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShDTURfRElTQ09OTkVDVCk7CisgICAgICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgQ01EX1JFQ09ORklHVVJFX0lQOgorICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAvKiBEZWZlciBhbnkgcG93ZXIgbW9kZSBjaGFuZ2VzIHNpbmNlIHdlIG11c3Qga2VlcCBhY3RpdmUgcG93ZXIgbW9kZSBhdCBESENQICovCisgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9ISUdIX1BFUkZfTU9ERToKKyAgICAgICAgICAgICAgICAgIGRlZmVyTWVzc2FnZShtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiBOT1RfSEFORExFRDsKKyAgICAgICAgICB9CisgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX0VWRU5UX0hBTkRMRUQsIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgcmV0dXJuIEhBTkRMRUQ7CisgICAgICB9CisKKyAgICAgIEBPdmVycmlkZQorICAgICAgcHVibGljIHZvaWQgZXhpdCgpIHsKKyAgICAgICAgICAvKiByZXNldCBwb3dlciBzdGF0ZSAmIGJsdWV0b290aCBjb2V4aXN0ZW5jZSBpZiBvbiBESENQICovCisgICAgICAgICAgaWYgKCFtVXNlU3RhdGljSXApIHsKKyAgICAgICAgICAgICAgaWYgKG1Qb3dlck1vZGUgIT0gUE9XRVJfTU9ERV9BQ1RJVkUpIHsKKyAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuc2V0UG93ZXJNb2RlQ29tbWFuZChtUG93ZXJNb2RlKTsKKyAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgIGlmIChtTW9kaWZpZWRCbHVldG9vdGhDb2V4aXN0ZW5jZU1vZGUpIHsKKyAgICAgICAgICAgICAgICAgIC8vIFNldCB0aGUgY29leGlzdGVuY2UgbW9kZSBiYWNrIHRvIGl0cyBkZWZhdWx0IHZhbHVlCisgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLnNldEJsdWV0b290aENvZXhpc3RlbmNlTW9kZUNvbW1hbmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuQkxVRVRPT1RIX0NPRVhJU1RFTkNFX01PREVfU0VOU0UpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICB9CisgICAgfQorCisgICAgY2xhc3MgQ29ubmVjdGVkU3RhdGUgZXh0ZW5kcyBIaWVyYXJjaGljYWxTdGF0ZSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBlbnRlcigpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICAvKiBBIHN1Y2Nlc3NmdWwgV1BTIGNvbm5lY3Rpb24gKi8KKyAgICAgICAgICAgIGlmIChtV3BzU3RhcnRlZCkgeworICAgICAgICAgICAgICAgIFdpZmlDb25maWdTdG9yZS5lbmFibGVBbGxOZXR3b3JrcygpOworICAgICAgICAgICAgICAgIFdpZmlDb25maWdTdG9yZS5sb2FkQ29uZmlndXJlZE5ldHdvcmtzKCk7CisgICAgICAgICAgICAgICAgbVdwc1N0YXJ0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9TVEFURV9DSEFOR0VELCBnZXROYW1lKCkpOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgbWVzc2FnZS50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICBzd2l0Y2ggKG1lc3NhZ2Uud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgQ01EX0RJU0NPTk5FQ1Q6CisgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuZGlzY29ubmVjdENvbW1hbmQoKTsKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1EaXNjb25uZWN0aW5nU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9SRUNPTkZJR1VSRV9JUDoKKyAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCJSZWNvbmZpZ3VyaW5nIElQIG9uIGNvbm5lY3Rpb24iKTsKKyAgICAgICAgICAgICAgICAgICAgTmV0d29ya1V0aWxzLnJlc2V0Q29ubmVjdGlvbnMobUludGVyZmFjZU5hbWUpOworICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obUNvbm5lY3RpbmdTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfRFJJVkVSOgorICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShDTURfRElTQ09OTkVDVCk7CisgICAgICAgICAgICAgICAgICAgIGRlZmVyTWVzc2FnZShtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fTU9ERToKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuYXJnMSA9PSBTQ0FOX09OTFlfTU9ERSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2UoQ01EX0RJU0NPTk5FQ1QpOworICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJNZXNzYWdlKG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAvKiBJZ25vcmUgY29ubmVjdGlvbiB0byBzYW1lIG5ldHdvcmsgKi8KKyAgICAgICAgICAgICAgICBjYXNlIENNRF9DT05ORUNUX05FVFdPUks6CisgICAgICAgICAgICAgICAgICAgIGludCBuZXRJZCA9IG1lc3NhZ2UuYXJnMTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1XaWZpSW5mby5nZXROZXR3b3JrSWQoKSA9PSBuZXRJZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5PVF9IQU5ETEVEOworICAgICAgICAgICAgICAgICAgICAvKiBJZ25vcmUgKi8KKyAgICAgICAgICAgICAgICBjYXNlIE5FVFdPUktfQ09OTkVDVElPTl9FVkVOVDoKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5PVF9IQU5ETEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX0VWRU5UX0hBTkRMRUQsIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICByZXR1cm4gSEFORExFRDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGNsYXNzIERpc2Nvbm5lY3RpbmdTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9TVEFURV9DSEFOR0VELCBnZXROYW1lKCkpOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgbWVzc2FnZS50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICBzd2l0Y2ggKG1lc3NhZ2Uud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfRFJJVkVSOiAvKiBTdG9wIGRyaXZlciBvbmx5IGFmdGVyIGRpc2Nvbm5lY3QgaGFuZGxlZCAqLworICAgICAgICAgICAgICAgICAgICBkZWZlck1lc3NhZ2UobWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TQ0FOX01PREU6CisgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmFyZzEgPT0gU0NBTl9PTkxZX01PREUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVyTWVzc2FnZShtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfRVZFTlRfSEFORExFRCwgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICAgIHJldHVybiBIQU5ETEVEOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBleGl0KCkgeworICAgICAgICAgICAgaWYgKG1FbmFibGVBbGxOZXR3b3JrcykgeworICAgICAgICAgICAgICAgIG1FbmFibGVBbGxOZXR3b3JrcyA9IGZhbHNlOworICAgICAgICAgICAgICAgIFdpZmlDb25maWdTdG9yZS5lbmFibGVBbGxOZXR3b3JrcygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgY2xhc3MgRGlzY29ubmVjdGVkU3RhdGUgZXh0ZW5kcyBIaWVyYXJjaGljYWxTdGF0ZSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBlbnRlcigpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfU1RBVEVfQ0hBTkdFRCwgZ2V0TmFtZSgpKTsKKyAgICAgICAgfQorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArIG1lc3NhZ2UudG9TdHJpbmcoKSArICJcbiIpOworICAgICAgICAgICAgc3dpdGNoIChtZXNzYWdlLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9NT0RFOgorICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5hcmcxID09IFNDQU5fT05MWV9NT0RFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLnNldFNjYW5SZXN1bHRIYW5kbGluZ0NvbW1hbmQobWVzc2FnZS5hcmcxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vU3VwcGxpY2FudCBkaXNjb25uZWN0IHRvIHByZXZlbnQgZnVydGhlciBjb25uZWN0cworICAgICAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5kaXNjb25uZWN0Q29tbWFuZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgbUlzU2Nhbk1vZGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1TY2FuTW9kZVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgLyogSWdub3JlIG5ldHdvcmsgZGlzY29ubmVjdCAqLworICAgICAgICAgICAgICAgIGNhc2UgTkVUV09SS19ESVNDT05ORUNUSU9OX0VWRU5UOgorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UTE9HX1dJRklfRVZFTlRfSEFORExFRCwgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICAgIHJldHVybiBIQU5ETEVEOworICAgICAgICB9CisgICAgfQorCisgICAgY2xhc3MgU29mdEFwU3RhcnRlZFN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZW50ZXIoKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArICJcbiIpOworICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19XSUZJX1NUQVRFX0NIQU5HRUQsIGdldE5hbWUoKSk7CisgICAgICAgIH0KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIHByb2Nlc3NNZXNzYWdlKE1lc3NhZ2UgbWVzc2FnZSkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBnZXROYW1lKCkgKyBtZXNzYWdlLnRvU3RyaW5nKCkgKyAiXG4iKTsKKyAgICAgICAgICAgIHN3aXRjaChtZXNzYWdlLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX0FQOgorICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsIlN0b3BwaW5nIFNvZnQgQVAiKTsKKyAgICAgICAgICAgICAgICAgICAgc2V0V2lmaUFwU3RhdGUoV0lGSV9BUF9TVEFURV9ESVNBQkxJTkcpOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgbndTZXJ2aWNlLnN0b3BBY2Nlc3NQb2ludCgpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFeGNlcHRpb24gaW4gc3RvcEFjY2Vzc1BvaW50KCkiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obURyaXZlckxvYWRlZFN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfQVA6CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywiU29mdEFQIHNldCBvbiBhIHJ1bm5pbmcgYWNjZXNzIHBvaW50Iik7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBud1NlcnZpY2Uuc2V0QWNjZXNzUG9pbnQoKFdpZmlDb25maWd1cmF0aW9uKSBtZXNzYWdlLm9iaiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbnRlcmZhY2VOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU09GVEFQX0lGQUNFKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXhjZXB0aW9uIGluIG53U2VydmljZSBkdXJpbmcgc29mdCBBUCBzZXQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbndTZXJ2aWNlLnN0b3BBY2Nlc3NQb2ludCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIkNvdWxkIG5vdCBzdG9wIEFQLCA6IiArIGVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKG9idGFpbk1lc3NhZ2UoQ01EX1VOTE9BRF9EUklWRVIsIFdJRklfQVBfU1RBVEVfRkFJTEVELCAwKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgLyogRmFpbCBjbGllbnQgbW9kZSBvcGVyYXRpb24gd2hlbiBzb2Z0IEFQIGlzIGVuYWJsZWQgKi8KKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9TVVBQTElDQU5UOgorICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsIkNhbm5vdCBzdGFydCBzdXBwbGljYW50IHdpdGggYSBydW5uaW5nIHNvZnQgQVAiKTsKKyAgICAgICAgICAgICAgICAgICAgc2V0V2lmaVN0YXRlKFdJRklfU1RBVEVfVU5LTk9XTik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOT1RfSEFORExFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfV0lGSV9FVkVOVF9IQU5ETEVELCBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgcmV0dXJuIEhBTkRMRUQ7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIGNsYXNzIFN1cHBsaWNhbnRTdGF0ZVRyYWNrZXIgZXh0ZW5kcyBIaWVyYXJjaGljYWxTdGF0ZU1hY2hpbmUgeworCisgICAgICAgIHByaXZhdGUgaW50IG1Sc3NpUG9sbFRva2VuID0gMDsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG1heCBudW1iZXIgb2YgdGhlIFdQQSBzdXBwbGljYW50IGxvb3AgaXRlcmF0aW9ucyBiZWZvcmUgd2UKKyAgICAgICAgICogZGVjaWRlIHRoYXQgdGhlIGxvb3Agc2hvdWxkIGJlIHRlcm1pbmF0ZWQ6CisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTUFYX1NVUFBMSUNBTlRfTE9PUF9JVEVSQVRJT05TID0gNDsKKyAgICAgICAgcHJpdmF0ZSBpbnQgbUxvb3BEZXRlY3RJbmRleCA9IDA7CisgICAgICAgIHByaXZhdGUgaW50IG1Mb29wRGV0ZWN0Q291bnQgPSAwOworCisgICAgICAgIC8qKgorICAgICAgICAgKiAgU3VwcGxpY2FudCBzdGF0ZSBjaGFuZ2UgY29tbWFuZHMgZm9sbG93CisgICAgICAgICAqICB0aGUgb3JkaW5hbCB2YWx1ZXMgZGVmaW5lZCBpbiBTdXBwbGljYW50U3RhdGUuamF2YQorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IERJU0NPTk5FQ1RFRCAgICAgICAgICAgPSAwOworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgSU5BQ1RJVkUgICAgICAgICAgICAgICA9IDE7CisgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTQ0FOTklORyAgICAgICAgICAgICAgID0gMjsKKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEFTU09DSUFUSU5HICAgICAgICAgICAgPSAzOworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQVNTT0NJQVRFRCAgICAgICAgICAgICA9IDQ7CisgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBGT1VSX1dBWV9IQU5EU0hBS0UgICAgID0gNTsKKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEdST1VQX0hBTkRTSEFLRSAgICAgICAgPSA2OworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQ09NUExFVEVEICAgICAgICAgICAgICA9IDc7CisgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBET1JNQU5UICAgICAgICAgICAgICAgID0gODsKKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFVOSU5JVElBTElaRUQgICAgICAgICAgPSA5OworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgSU5WQUxJRCAgICAgICAgICAgICAgICA9IDEwOworCisgICAgICAgIHByaXZhdGUgSGllcmFyY2hpY2FsU3RhdGUgbVVuaW5pdGlhbGl6ZWRTdGF0ZSA9IG5ldyBVbmluaXRpYWxpemVkU3RhdGUoKTsKKyAgICAgICAgcHJpdmF0ZSBIaWVyYXJjaGljYWxTdGF0ZSBtSW5pdGlhbGl6ZWRTdGF0ZSA9IG5ldyBJbml0aWFsaXplZFN0YXRlKCk7OworICAgICAgICBwcml2YXRlIEhpZXJhcmNoaWNhbFN0YXRlIG1JbmFjdGl2ZVN0YXRlID0gbmV3IEluYWN0aXZlU3RhdGUoKTsKKyAgICAgICAgcHJ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ICAgICAgICAgICAgICAgYWRkU3RhdGUobUNvbm5lY3RTdGF0ZSwgbUluaXRpYWxpemVkU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBhZGRTdGF0ZShtSGFuZHNoYWtlU3RhdGUsIG1Db25uZWN0U3RhdGUpOworICAgICAgICAgICAgICAgICAgICBhZGRTdGF0ZShtQ29tcGxldGVkU3RhdGUsIG1Db25uZWN0U3RhdGUpOworICAgICAgICAgICAgICAgIGFkZFN0YXRlKG1Eb3JtYW50U3RhdGUsIG1Jbml0aWFsaXplZFN0YXRlKTsKKworICAgICAgICAgICAgc2V0SW5pdGlhbFN0YXRlKG1VbmluaXRpYWxpemVkU3RhdGUpOworCisgICAgICAgICAgICAvL3N0YXJ0IHRoZSBzdGF0ZSBtYWNoaW5lCisgICAgICAgICAgICBzdGFydCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlRXZlbnQoU3RhdGVDaGFuZ2VSZXN1bHQgc3RhdGVDaGFuZ2VSZXN1bHQpIHsKKyAgICAgICAgICAgIFN1cHBsaWNhbnRTdGF0ZSBuZXdTdGF0ZSA9IChTdXBwbGljYW50U3RhdGUpIHN0YXRlQ2hhbmdlUmVzdWx0LnN0YXRlOworCisgICAgICAgICAgICAvLyBTdXBwbGljYW50IHN0YXRlIGNoYW5nZQorICAgICAgICAgICAgLy8gWzMxLTEzXSBSZXNlcnZlZCBmb3IgZnV0dXJlIHVzZQorICAgICAgICAgICAgLy8gWzggLSAwXSBTdXBwbGljYW50IHN0YXRlIChhcyBkZWZpbmVkIGluIFN1cHBsaWNhbnRTdGF0ZS5qYXZhKQorICAgICAgICAgICAgLy8gNTAwMjMgc3VwcGxpY2FudF9zdGF0ZV9jaGFuZ2VkIChjdXN0b218MXw1KQorICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19TVVBQTElDQU5UX1NUQVRFX0NIQU5HRUQsIG5ld1N0YXRlLm9yZGluYWwoKSk7CisKKyAgICAgICAgICAgIHNlbmRNZXNzYWdlKG9idGFpbk1lc3NhZ2UobmV3U3RhdGUub3JkaW5hbCgpLCBzdGF0ZUNoYW5nZVJlc3VsdCkpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcmVzZXRTdXBwbGljYW50U3RhdGUoKSB7CisgICAgICAgICAgICB0cmFuc2l0aW9uVG8obVVuaW5pdGlhbGl6ZWRTdGF0ZSk7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgcmVzZXRMb29wRGV0ZWN0aW9uKCkgeworICAgICAgICAgICAgbUxvb3BEZXRlY3RDb3VudCA9IDA7CisgICAgICAgICAgICBtTG9vcERldGVjdEluZGV4ID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgYm9vbGVhbiBoYW5kbGVUcmFuc2l0aW9uKE1lc3NhZ2UgbXNnKSB7CisgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArIG1zZy50b1N0cmluZygpICsgIlxuIik7CisgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBESVNDT05ORUNURUQ6CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRGlzY29ubmVjdFN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTQ0FOTklORzoKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1TY2FuU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEFTU09DSUFUSU5HOgorICAgICAgICAgICAgICAgICAgICBTdGF0ZUNoYW5nZVJlc3VsdCBzdGF0ZUNoYW5nZVJlc3VsdCA9IChTdGF0ZUNoYW5nZVJlc3VsdCkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgLyogQlNTSUQgaXMgdmFsaWQgb25seSBpbiBBU1NPQ0lBVElORyBzdGF0ZSAqLworICAgICAgICAgICAgICAgICAgICBtV2lmaUluZm8uc2V0QlNTSUQoc3RhdGVDaGFuZ2VSZXN1bHQuQlNTSUQpOworICAgICAgICAgICAgICAgICAgICAvLyRGQUxMLVRIUk9VR0gkCisgICAgICAgICAgICAgICAgY2FzZSBBU1NPQ0lBVEVEOgorICAgICAgICAgICAgICAgIGNhc2UgRk9VUl9XQVlfSEFORFNIQUtFOgorICAgICAgICAgICAgICAgIGNhc2UgR1JPVVBfSEFORFNIQUtFOgorICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVG8obUhhbmRzaGFrZVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDT01QTEVURUQ6CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtQ29tcGxldGVkU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIERPUk1BTlQ6CisgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtRG9ybWFudFN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBJTkFDVElWRToKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1JbmFjdGl2ZVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBVTklOSVRJQUxJWkVEOgorICAgICAgICAgICAgICAgIGNhc2UgSU5WQUxJRDoKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1VbmluaXRpYWxpemVkU3RhdGUpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTdGF0ZUNoYW5nZVJlc3VsdCBzdGF0ZUNoYW5nZVJlc3VsdCA9IChTdGF0ZUNoYW5nZVJlc3VsdCkgbXNnLm9iajsKKyAgICAgICAgICAgIFN1cHBsaWNhbnRTdGF0ZSBzdXBTdGF0ZSA9IChTdXBwbGljYW50U3RhdGUpIHN0YXRlQ2hhbmdlUmVzdWx0LnN0YXRlOworICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShXaWZpSW5mby5nZXREZXRhaWxlZFN0YXRlT2Yoc3VwU3RhdGUpKTsKKyAgICAgICAgICAgIG1XaWZpSW5mby5zZXRTdXBwbGljYW50U3RhdGUoc3VwU3RhdGUpOworICAgICAgICAgICAgbVdpZmlJbmZvLnNldE5ldHdvcmtJZChzdGF0ZUNoYW5nZVJlc3VsdC5uZXR3b3JrSWQpOworICAgICAgICAgICAgcmV0dXJuIEhBTkRMRUQ7CisgICAgICAgIH0KKworICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICogSFNNIHN0YXRlcworICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgICAgICBjbGFzcyBJbml0aWFsaXplZFN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgcHVibGljIHZvaWQgZW50ZXIoKSB7CisgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArIG1lc3NhZ2UudG9TdHJpbmcoKSArICJcbiIpOworICAgICAgICAgICAgICAgIHN3aXRjaCAobWVzc2FnZS53aGF0KSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX1NDQU46CisgICAgICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLnNjYW5Db21tYW5kKG1lc3NhZ2UuYXJnMSA9PSBTQ0FOX0FDVElWRSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy53KFRBRywgIklnbm9yaW5nICIgKyBtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gSEFORExFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGNsYXNzIFVuaW5pdGlhbGl6ZWRTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArICJcbiIpOworICAgICAgICAgICAgICAgICBtTmV0d29ya0luZm8uc2V0SXNBdmFpbGFibGUoZmFsc2UpOworICAgICAgICAgICAgICAgICByZXNldExvb3BEZXRlY3Rpb24oKTsKKyAgICAgICAgICAgICAgICAgbVBhc3N3b3JkS2V5TWF5QmVJbmNvcnJlY3QgPSBmYWxzZTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIHByb2Nlc3NNZXNzYWdlKE1lc3NhZ2UgbWVzc2FnZSkgeworICAgICAgICAgICAgICAgIHN3aXRjaChtZXNzYWdlLndoYXQpIHsKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaGFuZGxlVHJhbnNpdGlvbihtZXNzYWdlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy53KFRBRywgIklnbm9yaW5nICIgKyBtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gSEFORExFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgZXhpdCgpIHsKKyAgICAgICAgICAgICAgICBtTmV0d29ya0luZm8uc2V0SXNBdmFpbGFibGUodHJ1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBjbGFzcyBJbmFjdGl2ZVN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgcHVibGljIHZvaWQgZW50ZXIoKSB7CisgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisKKyAgICAgICAgICAgICAgICAgLyogQSBmYWlsZWQgV1BTIGNvbm5lY3Rpb24gKi8KKyAgICAgICAgICAgICAgICAgaWYgKG1XcHNTdGFydGVkKSB7CisgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJXUFMgc2V0IHVwIGZhaWxlZCwgZW5hYmxpbmcgb3RoZXIgbmV0d29ya3MiKTsKKyAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWdTdG9yZS5lbmFibGVBbGxOZXR3b3JrcygpOworICAgICAgICAgICAgICAgICAgICAgbVdwc1N0YXJ0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgIE1lc3NhZ2UgbWVzc2FnZSA9IGdldEN1cnJlbnRNZXNzYWdlKCk7CisgICAgICAgICAgICAgICAgIFN0YXRlQ2hhbmdlUmVzdWx0IHN0YXRlQ2hhbmdlUmVzdWx0ID0gKFN0YXRlQ2hhbmdlUmVzdWx0KSBtZXNzYWdlLm9iajsKKworICAgICAgICAgICAgICAgICBtTmV0d29ya0luZm8uc2V0SXNBdmFpbGFibGUoZmFsc2UpOworICAgICAgICAgICAgICAgICByZXNldExvb3BEZXRlY3Rpb24oKTsKKyAgICAgICAgICAgICAgICAgbVBhc3N3b3JkS2V5TWF5QmVJbmNvcnJlY3QgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICBzZW5kU3VwcGxpY2FudFN0YXRlQ2hhbmdlZEJyb2FkY2FzdChzdGF0ZUNoYW5nZVJlc3VsdCwgZmFsc2UpOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZVRyYW5zaXRpb24obWVzc2FnZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGV4aXQoKSB7CisgICAgICAgICAgICAgICAgbU5ldHdvcmtJbmZvLnNldElzQXZhaWxhYmxlKHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKworICAgICAgICBjbGFzcyBEaXNjb25uZWN0ZWRTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArICJcbiIpOworICAgICAgICAgICAgICAgICBNZXNzYWdlIG1lc3NhZ2UgPSBnZXRDdXJyZW50TWVzc2FnZSgpOworICAgICAgICAgICAgICAgICBTdGF0ZUNoYW5nZVJlc3VsdCBzdGF0ZUNoYW5nZVJlc3VsdCA9IChTdGF0ZUNoYW5nZVJlc3VsdCkgbWVzc2FnZS5vYmo7CisKKyAgICAgICAgICAgICAgICAgcmVzZXRMb29wRGV0ZWN0aW9uKCk7CisKKyAgICAgICAgICAgICAgICAgLyogSWYgYSBkaXNjb25uZWN0IGV2ZW50IGhhcHBlbnMgYWZ0ZXIgYSBwYXNzd29yZCBrZXkgZmFpbHVyZQorICAgICAgICAgICAgICAgICAgKiBldmVudCwgZGlzYWJsZSB0aGUgbmV0d29yaworICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgaWYgKG1QYXNzd29yZEtleU1heUJlSW5jb3JyZWN0KSB7CisgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJGYWlsZWQgdG8gYXV0aGVudGljYXRlLCBkaXNhYmxpbmcgbmV0d29yayAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdpZmlJbmZvLmdldE5ldHdvcmtJZCgpKTsKKyAgICAgICAgICAgICAgICAgICAgIFdpZmlDb25maWdTdG9yZS5kaXNhYmxlTmV0d29yayhtV2lmaUluZm8uZ2V0TmV0d29ya0lkKCkpOworICAgICAgICAgICAgICAgICAgICAgbVBhc3N3b3JkS2V5TWF5QmVJbmNvcnJlY3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgIHNlbmRTdXBwbGljYW50U3RhdGVDaGFuZ2VkQnJvYWRjYXN0KHN0YXRlQ2hhbmdlUmVzdWx0LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgIHNlbmRTdXBwbGljYW50U3RhdGVDaGFuZ2VkQnJvYWRjYXN0KHN0YXRlQ2hhbmdlUmVzdWx0LCBmYWxzZSk7CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICB9CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIHByb2Nlc3NNZXNzYWdlKE1lc3NhZ2UgbWVzc2FnZSkgeworICAgICAgICAgICAgICAgIHJldHVybiBoYW5kbGVUcmFuc2l0aW9uKG1lc3NhZ2UpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgY2xhc3MgU2NhblN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgcHVibGljIHZvaWQgZW50ZXIoKSB7CisgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICAgICAgIE1lc3NhZ2UgbWVzc2FnZSA9IGdldEN1cnJlbnRNZXNzYWdlKCk7CisgICAgICAgICAgICAgICAgIFN0YXRlQ2hhbmdlUmVzdWx0IHN0YXRlQ2hhbmdlUmVzdWx0ID0gKFN0YXRlQ2hhbmdlUmVzdWx0KSBtZXNzYWdlLm9iajsKKworICAgICAgICAgICAgICAgICBtUGFzc3dvcmRLZXlNYXlCZUluY29ycmVjdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICByZXNldExvb3BEZXRlY3Rpb24oKTsKKyAgICAgICAgICAgICAgICAgc2VuZFN1cHBsaWNhbnRTdGF0ZUNoYW5nZWRCcm9hZGNhc3Qoc3RhdGVDaGFuZ2VSZXN1bHQsIGZhbHNlKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIHByb2Nlc3NNZXNzYWdlKE1lc3NhZ2UgbWVzc2FnZSkgeworICAgICAgICAgICAgICAgIHJldHVybiBoYW5kbGVUcmFuc2l0aW9uKG1lc3NhZ2UpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgY2xhc3MgQ29ubmVjdFN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgcHVibGljIHZvaWQgZW50ZXIoKSB7CisgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKG1lc3NhZ2Uud2hhdCkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9TQ0FOOgorICAgICAgICAgICAgICAgICAgICAgICAgV2lmaU5hdGl2ZS5zZXRTY2FuUmVzdWx0SGFuZGxpbmdDb21tYW5kKFNDQU5fT05MWV9NT0RFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlOYXRpdmUuc2NhbkNvbW1hbmQobWVzc2FnZS5hcmcxID09IFNDQU5fQUNUSVZFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5PVF9IQU5ETEVEOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gSEFORExFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGNsYXNzIEhhbmRzaGFrZVN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICAgcHVibGljIHZvaWQgZW50ZXIoKSB7CisgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgZ2V0TmFtZSgpICsgIlxuIik7CisgICAgICAgICAgICAgICAgIGZpbmFsIE1lc3NhZ2UgbWVzc2FnZSA9IGdldEN1cnJlbnRNZXNzYWdlKCk7CisgICAgICAgICAgICAgICAgIFN0YXRlQ2hhbmdlUmVzdWx0IHN0YXRlQ2hhbmdlUmVzdWx0ID0gKFN0YXRlQ2hhbmdlUmVzdWx0KSBtZXNzYWdlLm9iajsKKworICAgICAgICAgICAgICAgICBpZiAobUxvb3BEZXRlY3RJbmRleCA+IG1lc3NhZ2Uud2hhdCkgeworICAgICAgICAgICAgICAgICAgICAgbUxvb3BEZXRlY3RDb3VudCsrOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIGlmIChtTG9vcERldGVjdENvdW50ID4gTUFYX1NVUFBMSUNBTlRfTE9PUF9JVEVSQVRJT05TKSB7CisgICAgICAgICAgICAgICAgICAgICBXaWZpQ29uZmlnU3RvcmUuZGlzYWJsZU5ldHdvcmsoc3RhdGVDaGFuZ2VSZXN1bHQubmV0d29ya0lkKTsKKyAgICAgICAgICAgICAgICAgICAgIG1Mb29wRGV0ZWN0Q291bnQgPSAwOworICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgbUxvb3BEZXRlY3RJbmRleCA9IG1lc3NhZ2Uud2hhdDsKKworICAgICAgICAgICAgICAgICBtUGFzc3dvcmRLZXlNYXlCZUluY29ycmVjdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICBzZW5kU3VwcGxpY2FudFN0YXRlQ2hhbmdlZEJyb2FkY2FzdChzdGF0ZUNoYW5nZVJlc3VsdCwgZmFsc2UpOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZVRyYW5zaXRpb24obWVzc2FnZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBjbGFzcyBDb21wbGV0ZWRTdGF0ZSBleHRlbmRzIEhpZXJhcmNoaWNhbFN0YXRlIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGVudGVyKCkgeworICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArICJcbiIpOworICAgICAgICAgICAgICAgICBNZXNzYWdlIG1lc3NhZ2UgPSBnZXRDdXJyZW50TWVzc2FnZSgpOworICAgICAgICAgICAgICAgICBTdGF0ZUNoYW5nZVJlc3VsdCBzdGF0ZUNoYW5nZVJlc3VsdCA9IChTdGF0ZUNoYW5nZVJlc3VsdCkgbWVzc2FnZS5vYmo7CisKKyAgICAgICAgICAgICAgICAgbVJzc2lQb2xsVG9rZW4rKzsKKyAgICAgICAgICAgICAgICAgaWYgKG1FbmFibGVSc3NpUG9sbGluZykgeworICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2VEZWxheWVkKG9idGFpbk1lc3NhZ2UoQ01EX1JTU0lfUE9MTCwgbVJzc2lQb2xsVG9rZW4sIDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQT0xMX1JTU0lfSU5URVJWQUxfTVNFQ1MpOworICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgcmVzZXRMb29wRGV0ZWN0aW9uKCk7CisKKyAgICAgICAgICAgICAgICAgbVBhc3N3b3JkS2V5TWF5QmVJbmNvcnJlY3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgc2VuZFN1cHBsaWNhbnRTdGF0ZUNoYW5nZWRCcm9hZGNhc3Qoc3RhdGVDaGFuZ2VSZXN1bHQsIGZhbHNlKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIHByb2Nlc3NNZXNzYWdlKE1lc3NhZ2UgbWVzc2FnZSkgeworICAgICAgICAgICAgICAgIHN3aXRjaChtZXNzYWdlLndoYXQpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBBU1NPQ0lBVElORzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBBU1NPQ0lBVEVEOgorICAgICAgICAgICAgICAgICAgICBjYXNlIEZPVVJfV0FZX0hBTkRTSEFLRToKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBHUk9VUF9IQU5EU0hBS0U6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgQ09NUExFVEVEOgorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgQ01EX1JTU0lfUE9MTDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmFyZzEgPT0gbVJzc2lQb2xsVG9rZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBHZXQgSW5mbyBhbmQgY29udGludWUgcG9sbGluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3RQb2xsZWRJbmZvKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2VEZWxheWVkKG9idGFpbk1lc3NhZ2UoQ01EX1JTU0lfUE9MTCwgbVJzc2lQb2xsVG9rZW4sIDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUE9MTF9SU1NJX0lOVEVSVkFMX01TRUNTKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUG9sbGluZyBoYXMgY29tcGxldGVkCisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBDTURfRU5BQkxFX1JTU0lfUE9MTDoKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Sc3NpUG9sbFRva2VuKys7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUVuYWJsZVJzc2lQb2xsaW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmlyc3QgcG9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3RQb2xsZWRJbmZvKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2VEZWxheWVkKG9idGFpbk1lc3NhZ2UoQ01EX1JTU0lfUE9MTCwgbVJzc2lQb2xsVG9rZW4sIDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUE9MTF9SU1NJX0lOVEVSVkFMX01TRUNTKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZVRyYW5zaXRpb24obWVzc2FnZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBIQU5ETEVEOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgY2xhc3MgRG9ybWFudFN0YXRlIGV4dGVuZHMgSGllcmFyY2hpY2FsU3RhdGUgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBlbnRlcigpIHsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIGdldE5hbWUoKSArICJcbiIpOworICAgICAgICAgICAgICAgIE1lc3NhZ2UgbWVzc2FnZSA9IGdldEN1cnJlbnRNZXNzYWdlKCk7CisgICAgICAgICAgICAgICAgU3RhdGVDaGFuZ2VSZXN1bHQgc3RhdGVDaGFuZ2VSZXN1bHQgPSAoU3RhdGVDaGFuZ2VSZXN1bHQpIG1lc3NhZ2Uub2JqOworCisgIC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hdHRlcnkgc3RhdHMuCi0gICAgICAgICAgICAgICAgICAgIGlmIChtTGFzdFJ1bm5pbmdXaWZpVWlkcy5kaWZmKG1SdW5uaW5nV2lmaVVpZHMpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeVN0YXRzLm5vdGVXaWZpUnVubmluZ0NoYW5nZWQobUxhc3RSdW5uaW5nV2lmaVVpZHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1SdW5uaW5nV2lmaVVpZHMpOwotICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RSdW5uaW5nV2lmaVVpZHMuc2V0KG1SdW5uaW5nV2lmaVVpZHMpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gTm93IGJlaW5nIHN0YXJ0ZWQsIHJlcG9ydCBpdC4KLSAgICAgICAgICAgICAgICAgICAgbUJhdHRlcnlTdGF0cy5ub3RlV2lmaVJ1bm5pbmcobVJ1bm5pbmdXaWZpVWlkcyk7Ci0gICAgICAgICAgICAgICAgICAgIG1MYXN0UnVubmluZ1dpZmlVaWRzLnNldChtUnVubmluZ1dpZmlVaWRzKTsKLSAgICAgICAgICAgICAgICAgICAgbVJlcG9ydGVkUnVubmluZyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChtUnVuU3RhdGUgPT0gUlVOX1NUQVRFX1NUT1BQRUQpIHsKLSAgICAgICAgICAgICAgICBpZiAobVJlcG9ydGVkUnVubmluZykgewotICAgICAgICAgICAgICAgICAgICAvLyBMYXN0IHJlcG9ydGVkIHdlIHdlcmUgcnVubmluZywgdGltZSB0byBzdG9wLgotICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeVN0YXRzLm5vdGVXaWZpU3RvcHBlZChtTGFzdFJ1bm5pbmdXaWZpVWlkcyk7Ci0gICAgICAgICAgICAgICAgICAgIG1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oc2V0U2NhblJlc3VsdEhhbmRsaW5nKHNjYW5UeXBlKSkgewotICAgICAgICAgICAgICAgIG1Jc1NjYW5Pbmx5ID0gc2Nhbk9ubHlNb2RlOwotICAgICAgICAgICAgICAgIGlmICghaXNEcml2ZXJTdG9wcGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHNjYW5Pbmx5TW9kZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgZGlzY29ubmVjdCgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVjb25uZWN0Q29tbWFuZCgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogU2V0IHN1c3BlbmQgbW9kZSBvcHRpbWl6YXRpb25zLiBUaGVzZSBpbmNsdWRlOgotICAgICAqIC0gcGFja2V0IGZpbHRlcmluZwotICAgICAqIC0gdHVybiBvZmYgcm9hbWluZwotICAgICAqIC0gRFRJTSBzZXR0aW5ncwotICAgICAqCi0gICAgICogVXNlcyByZWZlcmVuY2UgY291bnRpbmcgdG8ga2VlcCB0aGUgc3VzcGVuZCBvcHRpbWl6YXRpb25zIGRpc2FibGVkCi0gICAgICogYXMgbG9uZyBhcyBvbmUgZW50aXR5IHdhbnRzIG9wdGltaXphdGlvbnMgZGlzYWJsZWQuCi0gICAgICoKLSAgICAgKiBGb3IgZXhhbXBsZSwgV2lmaUxvY2sgY2FuIGtlZXAgc3VzcGVuZCBvcHRpbWl6YXRpb25zIGRpc2FibGVkCi0gICAgICogb3IgdGhlIHVzZXIgc2V0dGluZyAod2lmaSBuZXZlciBzbGVlcHMpIGNhbiBrZWVwIHN1c3BlbmQgb3B0aW1pemF0aW9ucwotICAgICAqIGRpc2FibGVkLiBBcyBsb25nIGFzIG9uZSBlbnRpdHkgd2FudHMgaXQgZGlzYWJsZWQsIGl0IHNob3VsZCBzdGF5Ci0gICAgICogdGhhdCB3YXkKLSAgICAgKgotICAgICAqIEBwYXJhbSBlbmFibGVkIHRydWUgaWYgb3B0aW1pemF0aW9ucyBuZWVkIGVuYWJsZWQsIGZhbHNlIG90aGVyd2lzZQotICAgICAqLwotICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBzZXRTdXNwZW5kTW9kZU9wdGltaXphdGlvbnMoYm9vbGVhbiBlbmFibGVkKSB7Ci0KLSAgICAgICAgLyogSXQgaXMgZ29vZCB0byBwbHVtYiBzdXNwZW5kIG9wdGltaXphdGlvbiBlbmFibGUKLSAgICAgICAgICogb3IgZGlzYWJsZSBldmVuIGlmIHJlZiBjb3VudCBpbmRpY2F0ZXMgYWxyZWFkeSBkb25lCi0gICAgICAgICAqIHNpbmNlIHdlIGNvdWxkIGhhdmUgYSBjYXNlIG9mIHByZXZpb3VzIGZhaWx1cmUuCi0gICAgICAgICAqLwotICAgICAgICBpZiAoIWVuYWJsZWQpIHsKLSAgICAgICAgICAgIG1PcHRpbWl6YXRpb25zRGlzYWJsZWRSZWZDb3VudCsrOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbU9wdGltaXphdGlvbnNEaXNhYmxlZFJlZkNvdW50LS07Ci0gICAgICAgICAgICBpZiAobU9wdGltaXphdGlvbnNEaXNhYmxlZFJlZkNvdW50ID4gMCkgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLyogS2VlcCByZWZjb3VudCBmcm9tIGJlY29taW5nIG5lZ2F0aXZlICovCi0gICAgICAgICAgICAgICAgbU9wdGltaXphdGlvbnNEaXNhYmxlZFJlZkNvdW50ID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtV2lmaVN0YXRlLmdldCgpICE9IFdJRklfU1RBVEVfRU5BQkxFRCB8fCBpc0RyaXZlclN0b3BwZWQoKSkgew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0ZSkgewotICAgICAgICAgICAgICAgIGlmIChuZXdTdXBwbGljYW50U3RhdGUub3JkaW5hbCgpIDwgbVN1cHBsaWNhbnRMb29wU3RhdGUub3JkaW5hbCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICsrbU51bVN1cHBsaWNhbnRMb29wSXRlcmF0aW9uczsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtU3VwcGxpY2FudExvb3BTdGF0ZSA9IG5ld1N1cHBsaWNhbnRTdGF0ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmIChuZXdTdXBwbGljYW50U3RhdGUgPT0gU3VwcGxpY2FudFN0YXRlLkNPTVBMRVRFRCkgewotICAgICAgICAgICAgcmVzZXRTdXBwbGljYW50TG9vcFN0YXRlKCk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gbU51bVN1cHBsaWNhbnRMb29wSXRlcmF0aW9ucyA+PSBNQVhfU1VQUExJQ0FOVF9MT09QX0lURVJBVElPTlM7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogUmVzZXRzIHRoZSBXUEEgc3VwcGxpY2FudCBsb29wIHN0YXRlLgotICAgICAqLwotICAgIHByaXZhdGUgdm9pZCByZXNldFN1cHBsaWNhbnRMb29wU3RhdGUoKSB7Ci0gICAgICAgIG1OdW1TdXBwbGljYW50TG9vcEl0ZXJhdGlvbnMgPSAwOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKLSAgICAgICAgSW50ZW50IGludGVudDsKLQotICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7Ci0gICAgICAgICAgICBjYXNlIEVWRU5UX1NVUFBMSUNBTlRfQ09OTkVDVElPTjoKLSAgICAgICAgICAgICAgICBtUnVuU3RhdGUgPSBSVU5fU1RBVEVfUlVOTklORzsKLSAgICAgICAgICAgICAgICBTdHJpbmcgbWFjYWRkcjsKLSAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgdXBkYXRlQmF0dGVyeVdvcmtTb3VyY2VMb2NrZWQobnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgIG1hY2FkZHIgPSBXaWZpTmF0aXZlLmdldE1hY0FkZHJlc3NDb21tYW5kKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChtYWNhZGRyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgbVdpZmlJbmZvLnNldE1hY0FkZHJlc3MobWFjYWRkcik7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgY2hlY2tVc2VTdGF0aWNJcCgpOwotICAgICAgICAgICAgICAgIC8qIFJlc2V0IG5vdGlmaWNhdGlvbiBzdGF0ZSBvbiBuZXcgY29ubmVjdGlvbiAqLwotICAgICAgICAgICAgICAgIHJlc2V0Tm90aWZpY2F0aW9uVGltZXIoKTsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIERIQ1AgcmVxdWVzdHMgYXJlIGJsb2NraW5nLCBzbyBydW4gdGhlbSBpbiBhIHNlcGFyYXRlIHRocmVhZC4KLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBIYW5kbGVyVGhyZWFkIGRoY3BUaHJlYWQgPSBuZXcgSGFuZGxlclRocmVhZCgiREhDUCBIYW5kbGVyIFRocmVhZCIpOwotICAgICAgICAgICAgICAgIGRoY3BUaHJlYWQuc3RhcnQoKTsKLSAgICAgICAgICAgICAgICBtRGhjcFRhcmdldCA9IG5ldyBEaGNwSGFuZGxlcihkaGNwVGhyZWFkLmdldExvb3BlcigpLCB0aGlzKTsKLSAgICAgICAgICAgICAgICBtSXNTY2FuTW9kZUFjdGl2ZSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgbUlzSGlnaFBlcmZFbmFibGVkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgbU9wdGltaXphdGlvbnNEaXNhYmxlZFJlZkNvdW50ID0gMDsKLSAgICAgICAgICAgICAgICBtUG93ZXJNb2RlUmVmQ291bnQgPSAwOwotICAgICAgICAgICAgICAgIG1Ub3JuRG93bkJ5Q29ubk1nciA9IGZhbHNlOwotICAgICAgICAgICAgICAgIG1MYXN0QnNzaWQgPSBudWxsOwotICAgICAgICAgICAgICAgIG1MYXN0U3NpZCA9IG51bGw7Ci0gICAgICAgICAgICAgICAgbUlzQW55TmV0d29ya0Rpc2FibGVkLnNldChmYWxzZSk7Ci0gICAgICAgICAgICAgICAgcmVxdWVzdENvbm5lY3Rpb25JbmZvKCk7Ci0gICAgICAgICAgICAgICAgU3VwcGxpY2FudFN0YXRlIHN1cHBsU3RhdGUgPSBtV2lmaUluZm8uZ2V0U3VwcGxpY2FudFN0YXRlKCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HRCkgTG9nLnYoVEFHLCAiQ29ubmVjdGlvbiB0byBzdXBwbGljYW50IGVzdGFibGlzaGVkLCBzdGF0ZT0iICsKLSAgICAgICAgICAgICAgICAgICAgc3VwcGxTdGF0ZSk7Ci0gICAgICAgICAgICAgICAgLy8gV2ktRmkgc3VwcGxpY2FudCBjb25uZWN0aW9uIHN0YXRlIGNoYW5nZWQ6Ci0gICAgICAgICAgICAgICAgLy8gWzMxLSAyXSBSZXNlcnZlZCBmb3IgZnV0dXJlIHVzZQotICAgICAgICAgICAgICAgIC8vIFsgMS0gMF0gQ29ubmVjdGVkIHRvIHN1cHBsaWNhbnQgKDEpLCBkaXNjb25uZWN0ZWQgZnJvbSBzdXBwbGljYW50ICgwKSAsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICBvciBzdXBwbGljYW50IGRpZWQgKDIpCi0gICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19TVVBQTElDQU5UX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRCwgMSk7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBUaGUgQ09NUExFVEVEIHN0YXRlIGNoYW5nZSBmcm9tIHRoZSBzdXBwbGljYW50IG1heSBoYXZlIG9jY3VycmVkCi0gICAgICAgICAgICAgICAgICogaW4gYmV0d2VlbiBwb2xsaW5nIGZvciBzdXBwbGljYW50IGF2YWlsYWJpbGl0eSwgaW4gd2hpY2ggY2FzZQotICAgICAgICAgICAgICAgICAqIHdlIGRpZG4ndCBwZXJmb3JtIGEgREhDUCByZXF1ZXN0IHRvIGdldCBhbiBJUCBhZGRyZXNzLgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGlmIChzdXBwbFN0YXRlID09IFN1cHBsaWNhbnRTdGF0ZS5DT01QTEVURUQpIHsKLSAgICAgICAgICAgICAgICAgICAgbUxhc3RCc3NpZCA9IG1XaWZpSW5mby5nZXRCU1NJRCgpOwotICAgICAgICAgICAgICAgICAgICBtTGFzdFNzaWQgPSBtV2lmaUluZm8uZ2V0U1NJRCgpOwotICAgICAgICAgICAgICAgICAgICBjb25maWd1cmVJbnRlcmZhY2UoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5pc1N5c3RlbVJlYWR5KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgaW50ZW50ID0gbmV3IEludGVudChXaWZpTWFuYWdlci5TVVBQTElDQU5UX0NPTk5FQ1RJT05fQ0hBTkdFX0FDVElPTik7Ci0gICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShXaWZpTWFuYWdlci5FWFRSQV9TVVBQTElDQU5UX0NPTk5FQ1RFRCwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHN1cHBsU3RhdGUgPT0gU3VwcGxpY2FudFN0YXRlLkNPTVBMRVRFRCAmJiBtSGF2ZUlwQWRkcmVzcykgewotICAgICAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuQ09OTkVDVEVEKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKFdpZmlJbmZvLmdldERldGFpbGVkU3RhdGVPZihzdXBwbFN0YXRlKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogRmlsdGVyIG91dCBtdWx0aWNhc3QgcGFja2V0cy4gVGhpcyBzYXZlcyBiYXR0ZXJ5IHBvd2VyLCBzaW5jZQotICAgICAgICAgICAgICAgICAqIHRoZSBDUFUgZG9lc24ndCBoYXZlIHRvIHNwZW5kIHRpbWUgcHJvY2Vzc2luZyBwYWNrZXRzIHRoYXQKLSAgICAgICAgICAgICAgICAgKiBhcmUgZ29pbmcgdG8gZW5kIHVwIGJlaW5nIHRocm93biBhd2F5LgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIG1XTS5pbml0aWFsaXplTXVsdGljYXN0RmlsdGVyaW5nKCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAobUJsdWV0b290aEEyZHAgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoQTJkcCA9IG5ldyBCbHVldG9vdGhBMmRwKG1Db250ZXh0KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY2hlY2tJc0JsdWV0b290aFBsYXlpbmcoKTsKLQotICAgICAgICAgICAgICAgIC8vIGluaXRpYWxpemUgdGhpcyBhZnRlciB0aGUgc3VwcGxpY2FudCBpcyBhbGl2ZQotICAgICAgICAgICAgICAgIHNldE51bUFsbG93ZWRDaGFubmVscygpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIEVWRU5UX1NVUFBMSUNBTlRfRElTQ09OTkVDVDoKLSAgICAgICAgICAgICAgICBtUnVuU3RhdGUgPSBSVU5fU1RBVEVfU1RPUFBFRDsKLSAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgdXBkYXRlQmF0dGVyeVdvcmtTb3VyY2VMb2NrZWQobnVsbCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJvb2xlYW4gZGllZCA9IG1XaWZpU3RhdGUuZ2V0KCkgIT0gV0lGSV9TVEFURV9ESVNBQkxFRCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1XaWZpU3RhdGUuZ2V0KCkgIT0gV0lGSV9TVEFURV9ESVNBQkxJTkc7Ci0gICAgICAgICAgICAgICAgaWYgKGRpZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKExPQ0FMX0xPR0QpIExvZy52KFRBRywgIlN1cHBsaWNhbnQgZGllZCB1bmV4cGVjdGVkbHkiKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HRCkgTG9nLnYoVEFHLCAiQ29ubmVjdGlvbiB0byBzdXBwbGljYW50IGxvc3QiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgLy8gV2ktRmkgc3VwcGxpY2FudCBjb25uZWN0aW9uIHN0YXRlIGNoYW5nZWQ6Ci0gICAgICAgICAgICAgICAgLy8gWzMxLSAyXSBSZXNlcnZlZCBmb3IgZnV0dXJlIHVzZQotICAgICAgICAgICAgICAgIC8vIFsgMS0gMF0gQ29ubmVjdGVkIHRvIHN1cHBsaWNhbnQgKDEpLCBkaXNjb25uZWN0ZWQgZnJvbSBzdXBwbGljYW50ICgwKSAsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICBvciBzdXBwbGljYW50IGRpZWQgKDIpCi0gICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19TVVBQTElDQU5UX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRCwgZGllZCA/IDIgOiAwKTsKLSAgICAgICAgICAgICAgICBjbG9zZVN1cHBsaWNhbnRDb25uZWN0aW9uKCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZGllZCkgewotICAgICAgICAgICAgICAgICAgICByZXNldENvbm5lY3Rpb25zKHRydWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvLyBXaGVuIHN1cHBsaWNhbnQgZGllcywga2lsbCB0aGUgREhDUCB0aHJlYWQKLSAgICAgICAgICAgICAgICBpZiAobURoY3BUYXJnZXQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtRGhjcFRhcmdldC5nZXRMb29wZXIoKS5xdWl0KCk7Ci0gICAgICAgICAgICAgICAgICAgIG1EaGNwVGFyZ2V0ID0gbnVsbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUNvbnRleHQucmVtb3ZlU3RpY2t5QnJvYWRjYXN0KG5ldyBJbnRlbnQoV2lmaU1hbmFnZXIuTkVUV09SS19TVEFURV9DSEFOR0VEX0FDVElPTikpOwotICAgICAgICAgICAgICAgIGlmIChBY3Rpdml0eU1hbmFnZXJOYXRpdmUuaXNTeXN0ZW1SZWFkeSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludGVudCA9IG5ldyBJbnRlbnQoV2lmaU1hbmFnZXIuU1VQUExJQ0FOVF9DT05ORUNUSU9OX0NIQU5HRV9BQ1RJT04pOwotICAgICAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoV2lmaU1hbmFnZXIuRVhUUkFfU1VQUExJQ0FOVF9DT05ORUNURUQsIGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChpbnRlbnQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuRElTQ09OTkVDVEVEKTsKLSAgICAgICAgICAgICAgICBzZXRTdXBwbGljYW50U3RhdGUoU3VwcGxpY2FudFN0YXRlLlVOSU5JVElBTElaRUQpOwotICAgICAgICAgICAgICAgIG1IYXZlSXBBZGRyZXNzID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgbU9idGFpbmluZ0lwQWRkcmVzcyA9IGZhbHNlOwotICAgICAgICAgICAgICAgIGlmIChkaWVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1XTS5zZXRXaWZpRW5hYmxlZChmYWxzZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIEVWRU5UX01BWUJFX1NUQVJUX1NDQU5fUE9TVF9ESVNDT05ORUNUOgotICAgICAgICAgICAgICAgIC8vIE9ubHkgZG8gdGhpcyBpZiB3ZSBoYXZlbid0IGdvdHRlbiBhIG5ldyBzdXBwbGljYW50IHN0YXR1cyBzaW5jZSB0aGUgdGltZXIKLSAgICAgICAgICAgICAgICAvLyBzdGFydGVkCi0gICAgICAgICAgICAgICAgaWYgKG1OdW1TdXBwbGljYW50U3RhdGVDaGFuZ2VzID09IG1zZy5hcmcxKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNjYW4oZmFsc2UpOyAvLyBkbyBhIHBhc3NpdmUgc2NhbgotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSBFVkVOVF9TVVBQTElDQU5UX1NUQVRFX0NIQU5HRUQ6Ci0gICAgICAgICAgICAgICAgbU51bVN1cHBsaWNhbnRTdGF0ZUNoYW5nZXMrKzsKLSAgICAgICAgICAgICAgICBTdXBwbGljYW50U3RhdGVDaGFuZ2VSZXN1bHQgc3VwcGxpY2FudFN0YXRlUmVzdWx0ID0KLSAgICAgICAgICAgICAgICAgICAgKFN1cHBsaWNhbnRTdGF0ZUNoYW5nZVJlc3VsdCkgbXNnLm9iajsKLSAgICAgICAgICAgICAgICBTdXBwbGljYW50U3RhdGUgbmV3U3RhdGUgPSBzdXBwbGljYW50U3RhdGVSZXN1bHQuc3RhdGU7Ci0gICAgICAgICAgICAgICAgU3VwcGxpY2FudFN0YXRlIGN1cnJlbnRTdGF0ZSA9IG1XaWZpSW5mby5nZXRTdXBwbGljYW50U3RhdGUoKTsKLQotICAgICAgICAgICAgICAgIC8vIFdpLUZpIHN1cHBsaWNhbnQgc3RhdGUgY2hhbmdlZDoKLSAgICAgICAgICAgICAgICAvLyBbMzEtIDZdIFJlc2VydmVkIGZvciBmdXR1cmUgdXNlCi0gICAgICAgICAgICAgICAgLy8gWyA1LSAwXSBTdXBwbGljYW50IHN0YXRlIG9yZGluYWwgKGFzIGRlZmluZWQgYnkgU3VwcGxpY2FudFN0YXRlKQotICAgICAgICAgICAgICAgIGludCBldmVudExvZ1BhcmFtID0gKG5ld1N0YXRlLm9yZGluYWwoKSAmIDB4M2YpOwotICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfU1VQUExJQ0FOVF9TVEFURV9DSEFOR0VELCBldmVudExvZ1BhcmFtKTsKLQotICAgICAgICAgICAgICAgIGlmIChMT0NBTF9MT0dEKSBMb2cudihUQUcsICJDaGFuZ2luZyBzdXBwbGljYW50IHN0YXRlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgY3VycmVudFN0YXRlICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiA9PT4gIiArIG5ld1N0YXRlKTsKLQotICAgICAgICAgICAgICAgIGludCBuZXR3b3JrSWQgPSBzdXBwbGljYW50U3RhdGVSZXN1bHQubmV0d29ya0lkOwotCi0gICAgICAgICAgICAgICAgLyoqCi0gICAgICAgICAgICAgICAgICogVGhlIFN1cHBsaWNhbnRTdGF0ZSBCU1NJRCB2YWx1ZSBpcyB2YWxpZCBpbiBBU1NPQ0lBVElORyBzdGF0ZSBvbmx5LgotICAgICAgICAgICAgICAgICAqIFRoZSBOZXR3b3JrU3RhdGUgQlNTSUQgdmFsdWUgY29tZXMgdXBvbiBhIHN1Y2Nlc3NmdWwgY29ubmVjdGlvbi4KLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBpZiAoc3VwcGxpY2FudFN0YXRlUmVzdWx0LnN0YXRlID09IFN1cHBsaWNhbnRTdGF0ZS5BU1NPQ0lBVElORykgewotICAgICAgICAgICAgICAgICAgICBtTGFzdEJzc2lkID0gc3VwcGxpY2FudFN0YXRlUmVzdWx0LkJTU0lEOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIElmIHdlIGdldCBkaXNjb25uZWN0IG9yIGluYWN0aXZlIHdlIG5lZWQgdG8gc3RhcnQgb3VyCi0gICAgICAgICAgICAgICAgICogd2F0Y2hkb2cgdGltZXIgdG8gc3RhcnQgYSBzY2FuCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlID09IFN1cHBsaWNhbnRTdGF0ZS5ESVNDT05ORUNURUQgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ld1N0YXRlID09IFN1cHBsaWNhbnRTdGF0ZS5JTkFDVElWRSkgewotICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZURlbGF5ZWQob2J0YWluTWVzc2FnZShFVkVOVF9NQVlCRV9TVEFSVF9TQ0FOX1BPU1RfRElTQ09OTkVDVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTnVtU3VwcGxpY2FudFN0YXRlQ2hhbmdlcywgMCksIEtJQ0tTVEFSVF9TQ0FOTklOR19ERUxBWV9NU0VDUyk7Ci0gICAgICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIERpZCB3ZSBnZXQgdG8gRElTQ09OTkVDVEVEIHN0YXRlIGR1ZSB0byBhbgotICAgICAgICAgICAgICAgICAqIGF1dGhlbnRpY2F0aW9uIChwYXNzd29yZCkgZmFpbHVyZT8KLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBib29sZWFuIGZhaWxlZFRvQXV0aGVudGljYXRlID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlID09IFN1cHBsaWNhbnRTdGF0ZS5ESVNDT05ORUNURUQpIHsKLSAgICAgICAgICAgICAgICAgICAgZmFpbGVkVG9BdXRoZW50aWNhdGUgPSBtUGFzc3dvcmRLZXlNYXlCZUluY29ycmVjdDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbVBhc3N3b3JkS2V5TWF5QmVJbmNvcnJlY3QgPSBmYWxzZTsKLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogS2VlcCB0cmFjayBvZiB0aGUgc3VwcGxpY2FudCBzdGF0ZSBhbmQgY2hlY2sgaWYgd2Ugc2hvdWxkCi0gICAgICAgICAgICAgICAgICogZGlzYWJsZSB0aGUgbmV0d29yawotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGJvb2xlYW4gZGlzYWJsZWROZXR3b3JrID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgaWYgKGlzU3VwcGxpY2FudExvb3BpbmcobmV3U3RhdGUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChMT0NBTF9MT0dEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU3RvcCBXUEEgc3VwcGxpY2FudCBsb29wIGFuZCBkaXNhYmxlIG5ldHdvcmsiKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZE5ldHdvcmsgPSB3aWZpTWFuYWdlckRpc2FibGVOZXR3b3JrKG5ldHdvcmtJZCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGRpc2FibGVkTmV0d29yaykgewotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBSZXNldCB0aGUgbG9vcCBzdGF0ZSBpZiB3ZSBkaXNhYmxlZCB0aGUgbmV0d29yawotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgcmVzZXRTdXBwbGljYW50TG9vcFN0YXRlKCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuZXdTdGF0ZSAhPSBjdXJyZW50U3RhdGUgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIChuZXdTdGF0ZSA9PSBTdXBwbGljYW50U3RhdGUuRElTQ09OTkVDVEVEICYmIGlzRHJpdmVyU3RvcHBlZCgpKSkgewotICAgICAgICAgICAgICAgICAgICBzZXRTdXBwbGljYW50U3RhdGUobmV3U3RhdGUpOwotICAgICAgICAgICAgICAgICAgICBpZiAobmV3U3RhdGUgPT0gU3VwcGxpY2FudFN0YXRlLkRPUk1BTlQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIERldGFpbGVkU3RhdGUgbmV3RGV0YWlsZWRTdGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgcmVjb25uZWN0TXNnID0gb2J0YWluTWVzc2FnZShFVkVOVF9ERUZFUlJFRF9SRUNPTk5FQ1QsIG1MYXN0QnNzaWQpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Jc1NjYW5Pbmx5IHx8IG1SdW5TdGF0ZSA9PSBSVU5fU1RBVEVfU1RPUFBJTkcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdEZXRhaWxlZFN0YXRlID0gRGV0YWlsZWRTdGF0ZS5JRExFOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdEZXRhaWxlZFN0YXRlID0gRGV0YWlsZWRTdGF0ZS5GQUlMRUQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVEaXNjb25uZWN0ZWRTdGF0ZShuZXdEZXRhaWxlZFN0YXRlLCB0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qKgotICAgICAgICAgICAgICAgICAgICAgICAgICogSWYgd2Ugd2VyZSBhc3NvY2lhdGVkIHdpdGggYSBuZXR3b3JrIChuZXR3b3JrSWQgIT0gLTEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICogYXNzdW1lIHdlIHJlYWNoZWQgdGhpcyBzdGF0ZSBiZWNhdXNlIG9mIGEgZmFpbGVkIGF0dGVtcHQKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHRvIGFjcXVpcmUgYW4gSVAgYWRkcmVzcywgYW5kIGF0dGVtcHQgYW5vdGhlciBjb25uZWN0aW9uCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBhbmQgSVAgYWRkcmVzcyBhY3F1aXNpdGlvbiBpbiBSRUNPTk5FQ1RfREVMQVlfTVNFQ1MKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIG1pbGxpc2Vjb25kcy4KLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1SdW5TdGF0ZSA9PSBSVU5fU1RBVEVfUlVOTklORyAmJiAhbUlzU2Nhbk9ubHkgJiYgbmV0d29ya0lkICE9IC0xKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2VEZWxheWVkKHJlY29ubmVjdE1zZywgUkVDT05ORUNUX0RFTEFZX01TRUNTKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVJ1blN0YXRlID09IFJVTl9TVEFURV9TVE9QUElORykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3BEcml2ZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVJ1blN0YXRlID09IFJVTl9TVEFURV9TVEFSVElORyAmJiAhbUlzU2Nhbk9ubHkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNvbm5lY3RDb21tYW5kKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmV3U3RhdGUgPT0gU3VwcGxpY2FudFN0YXRlLkRJU0NPTk5FQ1RFRCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUhhdmVJcEFkZHJlc3MgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0RyaXZlclN0b3BwZWQoKSB8fCBtRGlzY29ubmVjdEV4cGVjdGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlRGlzY29ubmVjdGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5ESVNDT05ORUNURUQsIHRydWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2hlZHVsZURpc2Nvbm5lY3QoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuZXdTdGF0ZSAhPSBTdXBwbGljYW50U3RhdGUuQ09NUExFVEVEICYmICFtRGlzY29ubmVjdFBlbmRpbmcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qKgotICAgICAgICAgICAgICAgICAgICAgICAgICogSWdub3JlIGV2ZW50cyB0aGF0IGRvbid0IGNoYW5nZSB0aGUgY29ubmVjdGl2aXR5IHN0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICogc3VjaCBhcyBXUEEgcmVrZXlpbmcgb3BlcmF0aW9ucy4KLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoY3VycmVudFN0YXRlID09IFN1cHBsaWNhbnRTdGF0ZS5DT01QTEVURUQgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobmV3U3RhdGUgPT0gU3VwcGxpY2FudFN0YXRlLkFTU09DSUFUSU5HIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1N0YXRlID09IFN1cHBsaWNhbnRTdGF0ZS5BU1NPQ0lBVEVEIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1N0YXRlID09IFN1cHBsaWNhbnRTdGF0ZS5GT1VSX1dBWV9IQU5EU0hBS0UgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3U3RhdGUgPT0gU3VwcGxpY2FudFN0YXRlLkdST1VQX0hBTkRTSEFLRSkpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShXaWZpSW5mby5nZXREZXRhaWxlZFN0YXRlT2YobmV3U3RhdGUpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIG1EaXNjb25uZWN0RXhwZWN0ZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgaW50ZW50ID0gbmV3IEludGVudChXaWZpTWFuYWdlci5TVVBQTElDQU5UX1NUQVRFX0NIQU5HRURfQUNUSU9OKTsKLSAgICAgICAgICAgICAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWV9CRUZPUkVfQk9PVAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgSW50ZW50LkZMQUdfUkVDRUlWRVJfUkVQTEFDRV9QRU5ESU5HKTsKLSAgICAgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKFdpZmlNYW5hZ2VyLkVYVFJBX05FV19TVEFURSwgKFBhcmNlbGFibGUpbmV3U3RhdGUpOwotICAgICAgICAgICAgICAgICAgICBpZiAoZmFpbGVkVG9BdXRoZW50aWNhdGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMT0NBTF9MT0dEKSBMb2cuZChUQUcsICJGYWlsZWQgdG8gYXV0aGVudGljYXRlLCBkaXNhYmxpbmcgbmV0d29yayAiICsgbmV0d29ya0lkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpZmlNYW5hZ2VyRGlzYWJsZU5ldHdvcmsobmV0d29ya0lkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaWZpTWFuYWdlci5FWFRSQV9TVVBQTElDQU5UX0VSUk9SLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlNYW5hZ2VyLkVSUk9SX0FVVEhFTlRJQ0FUSU5HKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5zZW5kU3RpY2t5QnJvYWRjYXN0KGludGVudCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIEVWRU5UX05FVFdPUktfU1RBVEVfQ0hBTkdFRDoKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIEVhY2ggQ09OTkVDVCBvciBESVNDT05ORUNUIGdlbmVyYXRlcyBhIHBhaXIgb2YgZXZlbnRzLgotICAgICAgICAgICAgICAgICAqIE9uZSBpcyBhIHN1cHBsaWNhbnQgc3RhdGUgY2hhbmdlIGV2ZW50LCBhbmQgdGhlIG90aGVyCi0gICAgICAgICAgICAgIC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dWx0LnN0YXRlLm9yZGluYWwoKSAmIDB4M2YpOwotICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfTkVUV09SS19TVEFURV9DSEFOR0VELCBldmVudExvZ1BhcmFtKTsKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HRCkgTG9nLnYoVEFHLCAiTmV3IG5ldHdvcmsgc3RhdGUgaXMgIiArIHJlc3VsdC5zdGF0ZSk7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBJZiB3ZSdyZSBpbiBzY2FuLW9ubHkgbW9kZSwgZG9uJ3QgYWR2YW5jZSB0aGUgc3RhdGUgbWFjaGluZSwgYW5kCi0gICAgICAgICAgICAgICAgICogZG9uJ3QgcmVwb3J0IHRoZSBzdGF0ZSBjaGFuZ2UgdG8gY2xpZW50cy4KLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBpZiAobUlzU2Nhbk9ubHkpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKExPQ0FMX0xPR0QpIExvZy52KFRBRywgIkRyb3BwaW5nIGV2ZW50IGluIHNjYW4tb25seSBtb2RlIik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAocmVzdWx0LnN0YXRlICE9IERldGFpbGVkU3RhdGUuU0NBTk5JTkcpIHsKLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogUmVzZXQgdGhlIHNjYW4gY291bnQgc2luY2UgdGhlcmUgd2FzIGEgbmV0d29yayBzdGF0ZQotICAgICAgICAgICAgICAgICAgICAgKiBjaGFuZ2UuIFRoaXMgY291bGQgYmUgZnJvbSBzdXBwbGljYW50IHRyeWluZyB0byBhc3NvY2lhdGUKLSAgICAgICAgICAgICAgICAgICAgICogd2l0aCBhIG5ldHdvcmsuCi0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBtTnVtU2NhbnNTaW5jZU5ldHdvcmtTdGF0ZUNoYW5nZSA9IDA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogSWYgdGhlIHN1cHBsaWNhbnQgc2VudCB1cyBhIENPTk5FQ1RFRCBldmVudCwgd2UgZG9uJ3QKLSAgICAgICAgICAgICAgICAgKiB3YW50IHRvIHNlbmQgb3V0IGFuIGluZGljYXRpb24gb2Ygb3ZlcmFsbCBuZXR3b3JrCi0gICAgICAgICAgICAgICAgICogY29ubmVjdGl2aXR5IHVudGlsIHdlIGhhdmUgb3VyIElQIGFkZHJlc3MuIElmIHRoZQotICAgICAgICAgICAgICAgICAqIHN1cHBsaWNhbnQgc2VudCB1cyBhIERJU0NPTk5FQ1RFRCBldmVudCwgd2UgZGVsYXkKLSAgICAgICAgICAgICAgICAgKiBzZW5kaW5nIGEgbm90aWZpY2F0aW9uIGluIGNhc2UgYSByZWNvbm5lY3Rpb24gdG8KLSAgICAgICAgICAgICAgICAgKiB0aGUgc2FtZSBhY2Nlc3MgcG9pbnQgb2NjdXJzIHdpdGhpbiBhIHNob3J0IHRpbWUuCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0ZSA9PSBEZXRhaWxlZFN0YXRlLkRJU0NPTk5FQ1RFRCkgewotICAgICAgICAgICAgICAgICAgICBpZiAobVdpZmlJbmZvLmdldFN1cHBsaWNhbnRTdGF0ZSgpICE9IFN1cHBsaWNhbnRTdGF0ZS5ET1JNQU5UKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzY2hlZHVsZURpc2Nvbm5lY3QoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmVxdWVzdENvbm5lY3Rpb25TdGF0dXMobVdpZmlJbmZvKTsKLSAgICAgICAgICAgICAgICBpZiAoIShyZXN1bHQuc3RhdGUgPT0gRGV0YWlsZWRTdGF0ZS5DT05ORUNURUQgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICghbUhhdmVJcEFkZHJlc3MgfHwgbURpc2Nvbm5lY3RQZW5kaW5nKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShyZXN1bHQuc3RhdGUpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdGUgPT0gRGV0YWlsZWRTdGF0ZS5DT05ORUNURUQpIHsKLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogUmVtb3ZlIHRoZSAnYXZhaWxhYmxlIG5ldHdvcmtzJyBub3RpZmljYXRpb24gd2hlbiB3ZQotICAgICAgICAgICAgICAgICAgICAgKiBzdWNjZXNzZnVsbHkgY29ubmVjdCB0byBhIG5ldHdvcmsuCi0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBzZXROb3RpZmljYXRpb25WaXNpYmxlKGZhbHNlLCAwLCBmYWxzZSwgMCk7Ci0gICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gd2FzRGlzY29ubmVjdFBlbmRpbmcgPSBtRGlzY29ubmVjdFBlbmRpbmc7Ci0gICAgICAgICAgICAgICAgICAgIGNhbmNlbERpc2Nvbm5lY3QoKTsKLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogVGhlIGNvbm5lY3Rpb24gaXMgZnVsbHkgY29uZmlndXJlZCBhcyBmYXIgYXMgbGluay1sZXZlbAotICAgICAgICAgICAgICAgICAgICAgKiBjb25uZWN0aXZpdHkgaXMgY29uY2VybmVkLCBidXQgd2UgbWF5IHN0aWxsIG5lZWQgdG8gb2J0YWluCi0gICAgICAgICAgICAgICAgICAgICAqIGFuIElQIGFkZHJlc3MuCi0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBpZiAod2FzRGlzY29ubmVjdFBlbmRpbmcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIERldGFpbGVkU3RhdGUgc2F2ZVN0YXRlID0gZ2V0TmV0d29ya0luZm8oKS5nZXREZXRhaWxlZFN0YXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVEaXNjb25uZWN0ZWRTdGF0ZShEZXRhaWxlZFN0YXRlLkRJU0NPTk5FQ1RFRCwgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZUludGVybmFsKHNhdmVTdGF0ZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBjb25maWd1cmVJbnRlcmZhY2UoKTsKLSAgICAgICAgICAgICAgICAgICAgbUxhc3RCc3NpZCA9IHJlc3VsdC5CU1NJRDsKLSAgICAgICAgICAgICAgICAgICAgbUxhc3RTc2lkID0gbVdpZmlJbmZvLmdldFNTSUQoKTsKLSAgICAgICAgICAgICAgICAgICAgbUxhc3ROZXR3b3JrSWQgPSByZXN1bHQubmV0d29ya0lkOwotICAgICAgICAgICAgICAgICAgICBpZiAobUhhdmVJcEFkZHJlc3MpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5DT05ORUNURUQpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLk9CVEFJTklOR19JUEFERFIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHNlbmROZXR3b3JrU3RhdGVDaGFuZ2VCcm9hZGNhc3QobVdpZmlJbmZvLmdldEJTU0lEKCkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIEVWRU5UX1NDQU5fUkVTVUxUU19BVkFJTEFCTEU6Ci0gICAgICAgICAgICAgICAgaWYgKEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5pc1N5c3RlbVJlYWR5KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChuZXcgSW50ZW50KFdpZmlNYW5hZ2VyLlNDQU5fUkVTVUxUU19BVkFJTEFCTEVfQUNUSU9OKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHNlbmRTY2FuUmVzdWx0c0F2YWlsYWJsZSgpOwotICAgICAgICAgICAgICAgIC8qKgotICAgICAgICAgICAgICAgICAqIE9uIHJlY2VpdmluZyB0aGUgZmlyc3Qgc2NhbiByZXN1bHRzIGFmdGVyIGNvbm5lY3RpbmcgdG8KLSAgICAgICAgICAgICAgICAgKiB0aGUgc3VwcGxpY2FudCwgc3dpdGNoIHNjYW4gbW9kZSBvdmVyIHRvIHBhc3NpdmUuCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgc2V0U2Nhbk1vZGUoZmFsc2UpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIEVWRU5UX1BPTExfSU5URVJWQUw6Ci0gICAgICAgICAgICAgICAgaWYgKG1XaWZpSW5mby5nZXRTdXBwbGljYW50U3RhdGUoKSAhPSBTdXBwbGljYW50U3RhdGUuVU5JTklUSUFMSVpFRCkgewotICAgICAgICAgICAgICAgICAgICByZXF1ZXN0UG9sbGVkSW5mbyhtV2lmaUluZm8sIHRydWUpOwotICAgICAgICAgICAgICAgICAgICBjaGVja1BvbGxUaW1lcigpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgY2FzZSBFVkVOVF9ERUZFUlJFRF9ESVNDT05ORUNUOgotICAgICAgICAgICAgICAgIGlmIChtV2lmaUluZm8uZ2V0U3VwcGxpY2FudFN0YXRlKCkgIT0gU3VwcGxpY2FudFN0YXRlLlVOSU5JVElBTElaRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgaGFuZGxlRGlzY29ubmVjdGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5ESVNDT05ORUNURUQsIHRydWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSBFVkVOVF9ERUZFUlJFRF9SRUNPTk5FQ1Q6Ci0gICAgICAgICAgICAgICAgLyoqCi0gICAgICAgICAgICAgICAgICogbUxhc3RCc3NpZCBjYW4gYmUgbnVsbCB3aGVuIHRoZXJlIGlzIGEgcmVjb25uZWN0Ci0gICAgICAgICAgICAgICAgICogcmVxdWVzdCBvbiB0aGUgZmlyc3QgQlNTSUQgd2UgY29ubmVjdCB0bwotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIFN0cmluZyBCU1NJRCA9IChtc2cub2JqICE9IG51bGwpID8gbXNnLm9iai50b1N0cmluZygpIDogbnVsbDsKLSAgICAgICAgICAgICAgICAvKioKLSAgICAgICAgICAgICAgICAgKiBJZiB3ZSd2ZSBleGNlZWRlZCB0aGUgbWF4aW11bSBudW1iZXIgb2YgcmV0cmllcyBmb3IgcmVjb25uZWN0aW5nCi0gICAgICAgICAgICAgICAgICogdG8gYSBnaXZlbiBuZXR3b3JrLCBkaXNhYmxlIHRoZSBuZXR3b3JrCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKG1XaWZpSW5mby5nZXRTdXBwbGljYW50U3RhdGUoKSAhPSBTdXBwbGljYW50U3RhdGUuVU5JTklUSUFMSVpFRCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoKyttUmVjb25uZWN0Q291bnQgPiBnZXRNYXhEaGNwUmV0cmllcygpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HRCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIkZhaWxlZCByZWNvbm5lY3QgY291bnQ6ICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJlY29ubmVjdENvdW50ICsgIiBEaXNhYmxpbmcgIiArIEJTU0lEKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1XTS5kaXNhYmxlTmV0d29yayhtTGFzdE5ldHdvcmtJZCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcmVjb25uZWN0Q29tbWFuZCgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSBFVkVOVF9JTlRFUkZBQ0VfQ09ORklHVVJBVElPTl9TVUNDRUVERUQ6Ci0gICAgICAgICAgICAgICAgLyoqCi0gICAgICAgICAgICAgICAgICogU2luY2UgdGhpcyBldmVudCBpcyBzZW50IGZyb20gYW5vdGhlciB0aHJlYWQsIGl0IG1pZ2h0IGhhdmUgYmVlbgotICAgICAgICAgICAgICAgICAqIHNlbnQgYWZ0ZXIgd2UgY2xvc2VkIG91ciBjb25uZWN0aW9uIHRvIHRoZSBzdXBwbGljYW50IGluIHRoZSBjb3Vyc2UKLSAgICAgICAgICAgICAgICAgKiBvZiBkaXNhYmxpbmcgV2ktRmkuIEluIHRoYXQgY2FzZSwgd2Ugc2hvdWxkIGp1c3QgaWdub3JlIHRoZSBldmVudC4KLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBpZiAobVdpZmlJbmZvLmdldFN1cHBsaWNhbnRTdGF0ZSgpID09IFN1cHBsaWNhbnRTdGF0ZS5VTklOSVRJQUxJWkVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtUmVjb25uZWN0Q291bnQgPSAwOwotICAgICAgICAgICAgICAgIG1IYXZlSXBBZGRyZXNzID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBtT2J0YWluaW5nSXBBZGRyZXNzID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgbVdpZmlJbmZvLnNldElwQWRkcmVzcyhtRGhjcEluZm8uaXBBZGRyZXNzKTsKLSAgICAgICAgICAgICAgICBtTGFzdFNpZ25hbExldmVsID0gLTE7IC8vIGZvcmNlIHVwZGF0ZSBvZiBzaWduYWwgc3RyZW5ndGgKLSAgICAgICAgICAgICAgICBpZiAobU5ldHdvcmtJbmZvLmdldERldGFpbGVkU3RhdGUoKSAhPSBEZXRhaWxlZFN0YXRlLkNPTk5FQ1RFRCkgewotICAgICAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuQ09OTkVDVEVEKTsKLSAgICAgICAgICAgICAgICAgICAgc2VuZE5ldHdvcmtTdGF0ZUNoYW5nZUJyb2FkY2FzdChtV2lmaUluZm8uZ2V0QlNTSUQoKSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbXNnID0gbVRhcmdldC5vYnRhaW5NZXNzYWdlKEVWRU5UX0NPTkZJR1VSQVRJT05fQ0hBTkdFRCwgbU5ldHdvcmtJbmZvKTsKLSAgICAgICAgICAgICAgICAgICAgbXNnLnNlbmRUb1RhcmdldCgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HRCkgTG9nLnYoVEFHLCAiSVAgY29uZmlndXJhdGlvbjogIiArIG1EaGNwSW5mbyk7Ci0gICAgICAgICAgICAgICAgLy8gV2ktRmkgaW50ZXJmYWNlIGNvbmZpZ3VyYXRpb24gc3RhdGUgY2hhbmdlZDoKLSAgICAgICAgICAgICAgICAvLyBbMz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hhdmVJcEFkZHJlc3MgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgbVdpZmlJbmZvLnNldElwQWRkcmVzcygwKTsKLSAgICAgICAgICAgICAgICAgICAgbU9idGFpbmluZ0lwQWRkcmVzcyA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBkaXNjb25uZWN0KCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIEVWRU5UX0RSSVZFUl9TVEFURV9DSEFOR0VEOgotICAgICAgICAgICAgICAgIC8vIFdpLUZpIGRyaXZlciBzdGF0ZSBjaGFuZ2VkOgotICAgICAgICAgICAgICAgIC8vIDAgU1RBUlRFRAotICAgICAgICAgICAgICAgIC8vIDEgU1RPUFBFRAotICAgICAgICAgICAgICAgIC8vIDIgSFVORwotICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRMT0dfRFJJVkVSX1NUQVRFX0NIQU5HRUQsIG1zZy5hcmcxKTsKLQotICAgICAgICAgICAgICAgIHN3aXRjaCAobXNnLmFyZzEpIHsKLSAgICAgICAgICAgICAgICBjYXNlIERSSVZFUl9TVEFSVEVEOgotICAgICAgICAgICAgICAgICAgICAvKioKLSAgICAgICAgICAgICAgICAgICAgICogU2V0IHRoZSBudW1iZXIgb2YgYWxsb3dlZCByYWRpbyBjaGFubmVscyBhY2NvcmRpbmcKLSAgICAgICAgICAgICAgICAgICAgICogdG8gdGhlIHN5c3RlbSBzZXR0aW5nLCBzaW5jZSBpdCBnZXRzIHJlc2V0IGJ5IHRoZQotICAgICAgICAgICAgICAgICAgICAgKiBkcml2ZXIgdXBvbiBjaGFuZ2luZyB0byB0aGUgU1RBUlRFRCBzdGF0ZS4KLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIHNldE51bUFsbG93ZWRDaGFubmVscygpOwotICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1hY2FkZHIgPSBXaWZpTmF0aXZlLmdldE1hY0FkZHJlc3NDb21tYW5kKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFjYWRkciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdpZmlJbmZvLnNldE1hY0FkZHJlc3MobWFjYWRkcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUnVuU3RhdGUgPSBSVU5fU1RBVEVfUlVOTklORzsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbUlzU2Nhbk9ubHkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNvbm5lY3RDb21tYW5kKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluIHNvbWUgc2l0dWF0aW9ucywgc3VwcGxpY2FudCBuZWVkcyB0byBiZSBraWNrc3RhcnRlZCB0bwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0YXJ0IHRoZSBiYWNrZ3JvdW5kIHNjYW5uaW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Nhbih0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIERSSVZFUl9IVU5HOgotICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJXaWZpIERyaXZlciByZXBvcnRzIEhVTkcgLSByZWxvYWRpbmcuIik7Ci0gICAgICAgICAgICAgICAgICAgIC8qKgotICAgICAgICAgICAgICAgICAgICAgKiByZXN0YXJ0IHRoZSBkcml2ZXIgLSB0b2dnbGUgb2ZmIGFuZCBvbgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgbVdNLnNldFdpZmlFbmFibGVkKGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgbVdNLnNldFdpZmlFbmFibGVkKHRydWUpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7Ci0gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUJhdHRlcnlXb3JrU291cmNlTG9ja2VkKG51bGwpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSBFVkVOVF9QQVNTV09SRF9LRVlfTUFZX0JFX0lOQ09SUkVDVDoKLSAgICAgICAgICAgICAgICBtUGFzc3dvcmRLZXlNYXlCZUluY29ycmVjdCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwcml2YXRlIGJvb2xlYW4gd2lmaU1hbmFnZXJEaXNhYmxlTmV0d29yayhpbnQgbmV0d29ya0lkKSB7Ci0gICAgICAgIGJvb2xlYW4gZGlzYWJsZWROZXR3b3JrID0gZmFsc2U7Ci0gICAgICAgIGlmICgwIDw9IG5ldHdvcmtJZCkgewotICAgICAgICAgICAgZGlzYWJsZWROZXR3b3JrID0gbVdNLmRpc2FibGVOZXR3b3JrKG5ldHdvcmtJZCk7Ci0gICAgICAgICAgICBpZiAoTE9DQUxfTE9HRCkgewotICAgICAgICAgICAgICAgIGlmIChkaXNhYmxlZE5ldHdvcmspIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiRGlzYWJsZWQgbmV0d29yazogIiArIG5ldHdvcmtJZCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmIChMT0NBTF9MT0dEKSB7Ci0gICAgICAgICAgICBpZiAoIWRpc2FibG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AgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBSZWVuYWJsZSBXaS1GaSBjb25uZWN0aXZpdHkgYnkgcmVzdGFydGluZyB0aGUgZHJpdmVyLgotICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIHJlY29ubmVjdCgpIHsKLSAgICAgICAgaWYgKG1Ub3JuRG93bkJ5Q29ubk1ncikgewotICAgICAgICAgICAgaWYgKHJlc3RhcnQoKSkgewotICAgICAgICAgICAgICAgIHNldFRvcm5Eb3duQnlDb25uTWdyKGZhbHNlKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBXZSB3YW50IHRvIHN0b3AgdGhlIGRyaXZlciwgYnV0IGlmIHdlJ3JlIGNvbm5lY3RlZCB0byBhIG5ldHdvcmssCi0gICAgICogd2UgZmlyc3Qgd2FudCB0byBkaXNjb25uZWN0LCBzbyB0aGF0IHRoZSBzdXBwbGljYW50IGlzIGFsd2F5cyBpbgotICAgICAqIGEga25vd24gc3RhdGUgKERJU0NPTk5FQ1RFRCkgd2hlbiB0aGUgZHJpdmVyIGlzIHN0b3BwZWQuCi0gICAgICogQHJldHVybiB7QGNvZGUgdHJ1ZX0gaWYgdGhlIG9wZXJhdGlvbiBzdWNjZWVkcywgd2hpY2ggbWVhbnMgdGhhdCB0aGUKLSAgICAgKiBkaXNjb25uZWN0IG9yIHN0b3AgY29tbWFuZCB3YXMgaW5pdGlhdGVkLgotICAgICAqLwotICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbG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RlIGNoYW5nZQotICAgICAgICAgKiBldmVuIGlmIHJlZiBjb3VudCBpbmRpY2F0ZXMgYWxyZWFkeSBkb25lCi0gICAgICAgICAqIHNpbmNlIHdlIGNvdWxkIGhhdmUgYSBjYXNlIG9mIHByZXZpb3VzIGZhaWx1cmUuCi0gICAgICAgICAqLwotICAgICAgICBzd2l0Y2gobW9kZSkgewotICAgICAgICAgICAgY2FzZSBEUklWRVJfUE9XRVJfTU9ERV9BQ1RJVkU6Ci0gICAgICAgICAgICAgICAgbVBvd2VyTW9kZVJlZkNvdW50Kys7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIERSSVZFUl9QT1dFUl9NT0RFX0FVVE86Ci0gICAgICAgICAgICAgICAgbVBvd2VyTW9kZVJlZkNvdW50LS07Ci0gICAgICAgICAgICAgICAgaWYgKG1Qb3dlck1vZGVSZWZDb3VudCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIEtlZXAgcmVmY291bnQgZnJvbSBiZWNvbWluZyBuZWdhdGl2ZSAqLwotICAgICAgICAgICAgICAgICAgICBtUG93ZXJNb2RlUmVmQ291bnQgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtV2lmaVN0YXRlLmdldCgpICE9IFdJRklfU1RBVEVfRU5BQkxFRCB8fCBpc0RyaXZlclN0b3BwZWQoKSkgewotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgV2lmaU5hdGl2ZS5zZXRQb3dlck1vZGVDb21tYW5kKG1vZGUpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFNldCB0aGUgbnVtYmVyIG9mIGFsbG93ZWQgcmFkaW8gZnJlcXVlbmN5IGNoYW5uZWxzIGZyb20gdGhlIHN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uUmVzdWx0cy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgICAgICBTY2FuUmVzdWx0IHNjYW5SZXN1bHQgPSBzY2FuUmVzdWx0cy5nZXQoaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHNjYW5SZXN1bHQuY2FwYWJpbGl0aWVzKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbnVtT3Blbk5ldHdvcmtzKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBpZiAobnVtT3Blbk5ldHdvcmtzID4gMCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoKyttTnVtU2NhbnNTaW5jZU5ldHdvcmtTdGF0ZUNoYW5nZSA+PSBOVU1fU0NBTlNfQkVGT1JFX0FDVFVBTExZX1NDQU5OSU5HKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICogV2UndmUgc2Nhbm5lZCBjb250aW51b3VzbHkgYXQgbGVhc3QKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIE5VTV9TQ0FOU19CRUZPUkVfTk9USUZJQ0FUSU9OIHRpbWVzLiBUaGUgdXNlcgotICAgICAgICAgICAgICAgICAgICAgICAgICogcHJvYmFibHkgZG9lcyBub3QgaGF2ZSBhIHJlbWVtYmVyZWQgbmV0d29yayBpbiByYW5nZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpbmNlIG90aGVyd2lzZSBzdXBwbGljYW50IHdvdWxkIGhhdmUgdHJpZWQgdG8KLSAgICAgICAgICAgICAgICAgICAgICAgICAqIGFzc29jaWF0ZSBhbmQgdGh1cyByZXNldHRpbmcgdGhpcyBjb3VudGVyLgotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICBzZXROb3RpZmljYXR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vIE5vdCBlbm91Z2ggdGltZSBoYXMgcGFzc2VkIHRvIHNob3cgdGhlIG5vdGlmaWNhdGlvbiBhZ2FpbgotICAgICAgICAgICAgaWYgKFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIDwgbU5vdGlmaWNhdGlvblJlcGVhdFRpbWUpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGlmIChtTm90aWZpY2F0aW9uID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAvLyBDYWNoZSB0aGUgTm90aWZpY2F0aW9uIG1haW5seSBzbyB3ZSBjYW4gcmVtb3ZlIHRoZQotICAgICAgICAgICAgICAgIC8vIEVWRU5UX05PVElGSUNBVElPTl9DSEFOR0VEIG1lc3NhZ2Ugd2l0aCB0aGlzIE5vdGlmaWNhdGlvbiBmcm9tCi0gICAgICAgICAgICAgICAgLy8gdGhlIHF1ZXVlIGxhdGVyCi0gICAgICAgICAgICAgICAgbU5vdGlmaWNhdGlvbiA9IG5ldyBOb3RpZmljYXRpb24oKTsKLSAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uLndoZW4gPSAwOwotICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb24uaWNvbiA9IElDT05fTkVUV09SS1NfQVZBSUxBQkxFOwotICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb24uZmxhZ3MgPSBOb3RpZmljYXRpb24uRkxBR19BVVRPX0NBTkNFTDsKLSAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uLmNvbnRlbnRJbnRlbnQgPSBQZW5kaW5nSW50ZW50LmdldEFjdGl2aXR5KG1Db250ZXh0LCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEludGVudChXaWZpTWFuYWdlci5BQ1RJT05fUElDS19XSUZJX05FVFdPUkspLCAwKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHR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WRzIHRvIGJlIGNyZWF0ZWQKLSAgICAgICAgICogZWFybHkgYmVjYXVzZSB0aGVyZSBpcyBhIGRlbGF5IGJlZm9yZSBpdCBhY3R1YWxseSAnY29ubmVjdHMnLCBhcwotICAgICAgICAgKiBub3RlZCBieSBpdHMgamF2YWRvYy4gSWYgd2UgY2hlY2sgYmVmb3JlIGl0IGlzIGNvbm5lY3RlZCwgaXQgd2lsbCBiZQotICAgICAgICAgKiBpbiBhbiBlcnJvciBzdGF0ZSBhbmQgd2Ugd2lsbCBub3QgZGlzYWJsZSBjb2V4aXN0ZW5jZS4KLSAgICAgICAgICovCi0gICAgICAgIHByaXZhdGUgQmx1ZXRvb3RoSGVhZHNldCBtQmx1ZXRvb3RoSGVhZHNldDsKLSAgICAgICAgCi0gICAgICAgIHB1YmxpYyBEaGNwSGFuZGxlcihMb29wZXIgbG9vcGVyLCBIYW5kbGVyIHRhcmdldCkgewotICAgICAgICAgICAgc3VwZXIobG9vcGVyKTsKLSAgICAgICAgICAgIG1UYXJnZXQgPSB0YXJnZXQ7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIG1CbHVldG9vdGhIZWFkc2V0ID0gbmV3IEJsdWV0b290aEhlYWRzZXQobUNvbnRleHQsIG51bGwpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgewotICAgICAgICAgICAgaW50IGV2ZW50OwotCi0gICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7Ci0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9ESENQX1NUQVJUOgotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBtb2RpZmllZEJsdWV0b290aENvZXhpc3RlbmNlTW9kZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBpbnQgcG93ZXJNb2RlID0gRFJJVkVSX1BPV0VSX01PREVfQVVUTzsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoc2hvdWxkRGlzYWJsZUNvZXhpc3RlbmNlTW9kZSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICogVGhlcmUgYXJlIHByb2JsZW1zIHNldHRpbmcgdGhlIFdpLUZpIGRyaXZlcidzIHBvd2VyCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBtb2RlIHRvIGFjdGl2ZSB3aGVuIGJsdWV0b290aCBjb2V4aXN0ZW5jZSBtb2RlIGlzCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBlbmFibGVkIG9yIHNlbnNlLgotICAgICAgICAgICAgICAgICAgICAgICAgICogPHA+Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKiBXZSBzZXQgV2ktRmkgdG8gYWN0aXZlIG1vZGUgd2hlbgotICAgICAgICAgICAgICAgICAgICAgICAgICogb2J0YWluaW5nIGFuIElQIGFkZHJlc3MgYmVjYXVzZSB3ZSd2ZSBmb3VuZAotICAgICAgICAgICAgICAgICAgICAgICAgICogY29tcGF0aWJpbGl0eSBpc3N1ZXMgd2l0aCBzb21lIHJvdXRlcnMgd2l0aCBsb3cgcG93ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIG1vZGUuCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiA8cD4KLSAgICAgICAgICAgICAgICAgICAgICAgICAqIEluIG9yZGVyIGZvciB0aGlzIGFjdGl2ZSBwb3dlciBtb2RlIHRvIHByb3Blcmx5IGJlIHNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHdlIGRpc2FibGUgY29leGlzdGVuY2UgbW9kZSB1bnRpbCB3ZSdyZSBkb25lIHdpdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIG9idGFpbmluZyBhbiBJUCBhZGRyZXNzLiAgT25lIGV4Y2VwdGlvbiBpcyBpZiB3ZQotICAgICAgICAgICAgICAgICAgICAgICAgICogYXJlIGN1cnJlbnRseSBjb25uZWN0ZWQgdG8gYSBoZWFkc2V0LCBzaW5jZSBkaXNhYmxpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIGNvZXhpc3RlbmNlIHdvdWxkIGludGVycnVwdCB0aGF0IGNvbm5lY3Rpb24uCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQmx1ZXRvb3RoQ29leGlzdGVuY2VNb2RlID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gRGlzYWJsZSB0aGUgY29leGlzdGVuY2UgbW9kZQotICAgICAgICAgICAgICAgICAgICAgICAgc2V0Qmx1ZXRvb3RoQ29leGlzdGVuY2VNb2RlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLkJMVUVUT09USF9DT0VYSVNURU5DRV9NT0RFX0RJU0FCTEVEKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgcG93ZXJNb2RlID0gZ2V0UG93ZXJNb2RlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwb3dlck1vZGUgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgLy8gSGFuZGxlIHRoZSBjYXNlIHdoZXJlIHN1cHBsaWNhbnQgZHJpdmVyIGRvZXMgbm90IHN1cHBvcnQKLSAgICAgICAgICAgICAgICAgICAgICAvLyBnZXRQb3dlck1vZGVDb21tYW5kLgotICAgICAgICAgICAgICAgICAgICAgICAgcG93ZXJNb2RlID0gRFJJVkVSX1BPV0VSX01PREVfQVVUTzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAocG93ZXJNb2RlICE9IERSSVZFUl9QT1dFUl9NT0RFX0FDVElWRSkgewotICAgICAgICAgICAgICAgICAgICAgICAgc2V0UG93ZXJNb2RlKERSSVZFUl9QT1dFUl9NT0RFX0FDVElWRSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIEEgbmV3IHJlcXVlc3QgaXMgYmVpbmcgbWFkZSwgc28gYXNzdW1lIHdlIHdpbGwgY2FsbGJhY2sKLSAgICAgICAgICAgICAgICAgICAgICAgIG1DYW5jZWxDYWxsYmFjayA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIkRoY3BIYW5kbGVyOiBESENQIHJlcXVlc3Qgc3RhcnRlZCIpOwotICAgICAgICAgICAgICAgICAgICBpZiAoTmV0d29ya1V0aWxzLnJ1bkRoY3AobUludGVyZmFjZU5hbWUsIG1EaGNwSW5mbykpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50ID0gRVZFTlRfSU5URVJGQUNFX0NPTkZJR1VSQVRJT05fU1VDQ0VFREVEOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExPQ0FMX0xPR0QpIExvZy52KFRBRywgIkRoY3BIYW5kbGVyOiBESENQIHJlcXVlc3Qgc3VjY2VlZGVkIik7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBldmVudCA9IEVWRU5UX0lOVEVSRkFDRV9DT05GSUdVUkFUSU9OX0ZBSUxFRDsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkRoY3BIYW5kbGVyOiBESENQIHJlcXVlc3QgZmFpbGVkOiAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrVXRpbHMuZ2V0RGhjcEVycm9yKCkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHBvd2VyTW9kZSAhPSBEUklWRVJfUE9XRVJfTU9ERV9BQ1RJVkUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNldFBvd2VyTW9kZShwb3dlck1vZGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1vZGlmaWVkQmx1ZXRvb3RoQ29leGlzdGVuY2VNb2RlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBTZXQgdGhlIGNvZXhpc3RlbmNlIG1vZGUgYmFjayB0byBpdHMgZGVmYXVsdCB2YWx1ZQotICAgICAgICAgICAgICAgICAgICAgICAgc2V0Qmx1ZXRvb3RoQ29leGlzdGVuY2VNb2RlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLkJMVUVUT09USF9DT0VYSVNURU5DRV9NT0RFX1NFTlNFKTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtQ2FuY2VsQ2FsbGJhY2spIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0LnNlbmRFbXB0eU1lc3NhZ2UoZXZlbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHNldENhbmNlbENhbGxiYWNrKGJvb2xlYW4gY2FuY2VsQ2FsbGJhY2spIHsKLSAgICAgICAgICAgIG1DYW5jZWxDYWxsYmFjayA9IGNhbmNlbENhbGxiYWNrOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqCi0gICAgICAgICAqIFdoZXRoZXIgdG8gZGlzYWJsZSBjb2V4aXN0ZW5jZSBtb2RlIHdoaWxlIG9idGFpbmluZyBJUCBhZGRyZXNzLiBUaGlzCi0gICAgICAgICAqIGxvZ2ljIHdpbGwgcmV0dXJuIHRydWUgb25seSBpZiB0aGUgY3VycmVudCBibHVldG9vdGgKLSAgICAgICAgICogaGVhZHNldC9oYW5kc2ZyZWUgc3RhdGUgaXMgZGlzY29ubmVjdGVkLiBUaGlzIG1lYW5zIGlmIGl0IGlzIGluIGFuCi0gICAgICAgICAqIGVycm9yIHN0YXRlLCB3ZSB3aWxsIE5PVCBkaXNhYmxlIGNvZXhpc3RlbmNlIG1vZGUgdG8gZXJyIG9uIHRoZSBzaWRlCi0gICAgICAgICAqIG9mIHNhZmV0eS4KLSAgICAgICAgICogCi0gICAgICAgICAqIEByZXR1cm4gV2hldGhlciB0byBkaXNhYmxlIGNvZXhpc3RlbmNlIG1vZGUuCi0gICAgICAgICAqLwotICAgICAgICBwcml2YXRlIGJvb2xlYW4gc2hvdWxkRGlzYWJsZUNvZXhpc3RlbmNlTW9kZSgpIHsKLSAgICAgICAgICAgIGludCBzdGF0ZSA9IG1CbHVldG9vdGhIZWFkc2V0LmdldFN0YXRlKG1CbHVldG9vdGhIZWFkc2V0LmdldEN1cnJlbnRIZWFkc2V0KCkpOwotICAgICAgICAgICAgcmV0dXJuIHN0YXRlID09IEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRElTQ09OTkVDVEVEOwotICAgICAgICB9Ci0gICAgfQotICAgIAotICAgIHByaXZhdGUgdm9pZCBjaGVja1VzZVN0YXRpY0lwKCkgewotICAgICAgICBtVXNlU3RhdGljSXAgPSBmYWxzZTsKLSAgICAgICAgZmluYWwgQ29udGVudFJlc29sdmVyIGNyID0gbUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCk7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBpZiAoU2V0dGluZ3MuU3lzdGVtLmdldEludChjciwgU2V0dGluZ3MuU3lzdGVtLldJRklfVVNFX1NUQVRJQ19JUCkgPT0gMCkgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBjYXRjaCAoU2V0dGluZ3MuU2V0dGluZ05vdEZvdW5kRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotCi0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBTdHJpbmcgYWRkciA9IFNldHRpbmdzLlN5c3RlbS5nZXRTdHJpbmcoY3IsIFNldHRpbmdzLlN5c3RlbS5XSUZJX1NUQVRJQ19JUCk7Ci0gICAgICAgICAgICBpZiAoYWRkciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbURoY3BJbmZvLmlwQWRkcmVzcyA9IHN0cmluZ1RvSXBBZGRyKGFkZHIpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBhZGRyID0gU2V0dGluZ3MuU3lzdGVtLmdldFN0cmluZyhjciwgU2V0dGluZ3MuU3lzdGVtLldJRklfU1RBVElDX0dBVEVXQVkpOwotICAgICAgICAgICAgaWYgKGFkZHIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1EaGNwSW5mby5nYXRld2F5ID0gc3RyaW5nVG9JcEFkZHIoYWRkcik7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGFkZHIgPSBTZXR0aW5ncy5TeXN0ZW0uZ2V0U3RyaW5nKGNyLCBTZXR0aW5ncy5TeXN0ZW0uV0lGSV9TVEFUSUNfTkVUTUFTSyk7Ci0gICAgICAgICAgICBpZiAoYWRkciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbURoY3BJbmZvLm5ldG1hc2sgPSBzdHJpbmdUb0lwQWRkcihhZGRyKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYWRkciA9IFNldHRpbmdzLlN5c3RlbS5nZXRTdHJpbmcoY3IsIFNldHRpbmdzLlN5c3RlbS5XSUZJX1NUQVRJQ19ETlMxKTsKLSAgICAgICAgICAgIGlmIChhZGRyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtRGhjcEluZm8uZG5zMSA9IHN0cmluZ1RvSXBBZGRyKGFkZHIpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBhZGRyID0gU2V0dGluZ3MuU3lzdGVtLmdldFN0cmluZyhjciwgU2V0dGluZ3MuU3lzdGVtLldJRklfU1RBVElDX0ROUzIpOwotICAgICAgICAgICAgaWYgKGFkZHIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1EaGNwSW5mby5kbnMyID0gc3RyaW5nVG9JcEFkZHIoYWRkcik7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1EaGNwSW5mby5kbnMyID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBjYXRjaCAoVW5rbm93bkhvc3RFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIG1Vc2VTdGF0aWNJcCA9IHRydWU7CisgICAgLyoqCisgICAgICogRmV0Y2ggTGlua1Byb3BlcnRpZXMgZm9yIHRoZSBuZXR3b3JrCisgICAgICovCisgICAgcHVibGljIExpbmtQcm9wZXJ0aWVzIGdldExpbmtQcm9wZXJ0aWVzKCkgeworICAgICAgICByZXR1cm4gbmV3IExpbmtQcm9wZXJ0aWVzKG1MaW5rUHJvcGVydGllcyk7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBzdGF0aWMgaW50IHN0cmluZ1RvSXBBZGRyKFN0cmluZyBhZGRyU3RyaW5nKSB0aHJvd3MgVW5rbm93bkhvc3RFeGNlcHRpb24gewotICAgICAgICB0cnkgewotICAgICAgICAgICAgU3RyaW5nW10gcGFydHMgPSBhZGRyU3RyaW5nLnNwbGl0KCJcXC4iKTsKLSAgICAgICAgICAgIGlmIChwYXJ0cy5sZW5ndGggIT0gNCkgewotICAgICAgICAgICAgICAgIHRocm93IG5ldyBVbmtub3duSG9zdEV4Y2VwdGlvbihhZGRyU3RyaW5nKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaW50IGEgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnRzWzBdKSAgICAgIDsKLSAgICAgICAgICAgIGludCBiID0gSW50ZWdlci5wYXJzZUludChwYXJ0c1sxXSkgPDwgIDg7Ci0gICAgICAgICAgICBpbnQgYyA9IEludGVnZXIucGFyc2VJbnQocGFydHNbMl0pIDw8IDE2OwotICAgICAgICAgICAgaW50IGQgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnRzWzNdKSA8PCAyNDsKLQotICAgICAgICAgICAgcmV0dXJuIGEgfCBiIHwgYyB8IGQ7Ci0gICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgdGhyb3cgbmV3IFVua25vd25Ib3N0RXhjZXB0aW9uKGFkZHJTdHJpbmcpOwotICAgICAgICB9CisgICAgLyoqCisgICAgICogQSBjYXBhYmlsaXR5IGlzIGFuIEludGVnZXIvU3RyaW5nIHBhaXIsIHRoZSBjYXBhYmlsaXRpZXMKKyAgICAgKiBhcmUgZGVmaW5lZCBpbiB0aGUgY2xhc3MgTGlua1NvY2tldCNLZXkuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIGEgY29weSBvZiB0aGlzIGNvbm5lY3Rpb25zIGNhcGFiaWxpdGllcywgbWF5IGJlIGVtcHR5IGJ1dCBuZXZlciBudWxsLgorICAgICAqLworICAgIHB1YmxpYyBMaW5rQ2FwYWJpbGl0aWVzIGdldExpbmtDYXBhYmlsaXRpZXMoKSB7CisgICAgICAgIHJldHVybiBuZXcgTGlua0NhcGFiaWx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EsIG9EbnMyOwotICAgICAgICAgICAgb0lwID0gb0d3ID0gb01zayA9IG9EbnMxID0gb0RuczIgPSAwOwotICAgICAgICAgICAgaWYgKHdhc1N0YXRpY0lwKSB7Ci0gICAgICAgICAgICAgICAgb0lwID0gbURoY3BJbmZvLmlwQWRkcmVzczsKLSAgICAgICAgICAgICAgICBvR3cgPSBtRGhjcEluZm8uZ2F0ZXdheTsKLSAgICAgICAgICAgICAgICBvTXNrID0gbURoY3BJbmZvLm5ldG1hc2s7Ci0gICAgICAgICAgICAgICAgb0RuczEgPSBtRGhjcEluZm8uZG5zMTsKLSAgICAgICAgICAgICAgICBvRG5zMiA9IG1EaGNwSW5mby5kbnMyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2hlY2tVc2VTdGF0aWNJcCgpOwotCi0gICAgICAgICAgICBpZiAobVdpZmlJbmZvLmdldFN1cHBsaWNhbnRTdGF0ZSgpID09IFN1cHBsaWNhbnRTdGF0ZS5VTklOSVRJQUxJWkVEKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBib29sZWFuIGNoYW5nZWQgPQotICAgICAgICAgICAgICAgICh3YXNTdGF0aWNJcCAhPSBtVXNlU3RhdGljSXApIHx8Ci0gICAgICAgICAgICAgICAgICAgICh3YXNTdGF0aWNJcCAmJiAoCi0gICAgICAgICAgICAgICAgICAgICAgICBvSXAgICAhPSBtRGhjcEluZm8uaXBBZGRyZXNzIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBvR3cgICAhPSBtRGhjcEluZm8uZ2F0ZXdheSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgb01zayAgIT0gbURoY3BJbmZvLm5ldG1hc2sgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIG9EbnMxICE9IG1EaGNwSW5mby5kbnMxIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBvRG5zMiAhPSBtRGhjcEluZm8uZG5zMikpOwotCi0gICA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bW92ZSBhbnkgbm90aWZpY2F0aW9uIHRoYXQgbWF5IGJlIHNob3dpbmcKLSAgICAgICAgICAgICAgICBzZXROb3RpZmljYXRpb25WaXNpYmxlKGZhbHNlLCAwLCB0cnVlLCAwKTsKKyAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICBpZiAoaW50ZW50LmdldEFjdGlvbigpLmVxdWFscyhXaWZpTWFuYWdlci5ORVRXT1JLX1NUQVRFX0NIQU5HRURfQUNUSU9OKSkgeworICAgICAgICAgICAgICAgIG1OZXR3b3JrSW5mbyA9IChOZXR3b3JrSW5mbykgaW50ZW50LmdldFBhcmNlbGFibGVFeHRyYSgKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlNYW5hZ2VyLkVYVFJBX05FVFdPUktfSU5GTyk7CisgICAgICAgICAgICAgICAgbUxpbmtQcm9wZXJ0aWVzID0gaW50ZW50LmdldFBhcmNlbGFibGVFeHRyYSgKKyAgICAgICAgICAgICAgICAgICAgICAgIFdpZmlNYW5hZ2VyLkVYVFJBX0xJTktfUFJPUEVSVElFUyk7CisgICAgICAgICAgICAgICAgaWYgKG1MaW5rUHJvcGVydGllcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1MaW5rUHJvcGVydGllcyA9IG5ldyBMaW5rUHJvcGVydGllcygpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtTGlua0NhcGFiaWxpdGllcyA9IGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoCisgICAgICAgICAgICAgICAgICAgICAgICBXaWZpTWFuYWdlci5FWFRSQV9MSU5LX0NBUEFCSUxJVElFUyk7CisgICAgICAgICAgICAgICAgaWYgKG1MaW5rQ2FwYWJpbGl0aWVzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUxpbmtDYXBhYmlsaXRpZXMgPSBuZXcgTGlua0NhcGFiaWxpdGllcygpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1Dc0hhbmRsZXIub2J0YWluTWVzc2FnZShFVkVOVF9TVEFURV9DSEFOR0VELCBtTmV0d29ya0luZm8pOworICAgICAgICAgICAgICAgIG1zZy5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoaW50ZW50LmdldEFjdGlvbigpLmVxdWFscyhXaWZpTWFuYWdlci5DT05GSUdfQ0hBTkdFRF9BQ1RJT04pKSB7CisgICAgICAgICAgICAgICAgbUxpbmtQcm9wZXJ0aWVzID0gKExpbmtQcm9wZXJ0aWVzKSBpbnRlbnQuZ2V0UGFyY2VsYWJsZUV4dHJhKAorICAgICAgICAgICAgICAgICAgICAgICAgV2lmaU1hbmFnZXIuRVhUUkFfTElOS19QUk9QRVJUSUVTKTsKKyAgICAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1Dc0hhbmRsZXIub2J0YWluTWVzc2FnZShFVkVOVF9DT05GSUdVUkFUSU9OX0NIQU5HRUQsIG1OZXR3b3JrSW5mbyk7CisgICAgICAgICAgICAgICAgbXNnLnNlbmRUb1RhcmdldCgpOwogICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXNldE5vdGlmaWNhdGlvblRpbWVyKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwcml2YXRlIGJvb2xlYW4gZ2V0VmFsdWUoKSB7Ci0gICAgICAgICAgICByZXR1cm4gU2V0dGluZ3MuU2VjdXJlLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLldJRklfTkVUV09SS1NfQVZBSUxBQkxFX05PVElGSUNBVElPTl9PTiwgMSkgPT0gMTsKICAgICAgICAgfQogICAgIH0KKwogfQo=